Files

1 line
32 KiB
JavaScript
Raw Permalink Normal View History

!function(e){function t(a){if(n[a])return n[a].exports;var l=n[a]={i:a,l:!1,exports:{}};return e[a].call(l.exports,l,l.exports,t),l.l=!0,l.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,n){"use strict";n.d(t,"a",function(){return __});var a={};a.en_US=n(7).translations;var __=function(e){var t=argon_language;return"undefined"==typeof a[t]?e:"undefined"==typeof a[t][e]?e:a[t][e]}},function(e,t){e.exports=wp.blockEditor},function(e,t){e.exports=wp.components},function(e,t,n){"use strict";function a(e){return/\s/.test("number"===typeof e?String.fromCharCode(e):e.charAt(0))}t.a=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(5),n(8),n(10),n(12),n(14),n(16),n(18),n(20)},function(e,t,n){"use strict";var a=n(6),l=(n.n(a),n(0)),r=n(1),o=(n.n(r),n(2)),i=(n.n(o),n(3));(0,wp.blocks.registerBlockType)("argon/alert",{title:Object(l.a)("\u63d0\u793a"),icon:"warning",category:"argon",keywords:["argon",Object(l.a)("\u63d0\u793a")],attributes:{color:{type:"string",default:"#7889e8"},content:{type:"string",default:""},fa_icon_name:{type:"string",default:"info-circle"}},edit:function(e){var t=function(t){e.setAttributes({content:t})},n=function(t){e.setAttributes({color:t||"#7889e8"})},a=function(t){e.setAttributes({fa_icon_name:t})};return wp.element.createElement("div",null,wp.element.createElement("div",{className:"alert",style:{backgroundColor:e.attributes.color}},!(Object(i.a)(e.attributes.fa_icon_name)||""==e.attributes.fa_icon_name)&&wp.element.createElement("span",{className:"alert-inner--icon"},wp.element.createElement("i",{className:"fa fa-"+e.attributes.fa_icon_name})),wp.element.createElement(r.RichText,{tagName:"span",className:"alert-inner--text",placeholder:Object(l.a)("\u5185\u5bb9"),value:e.attributes.content,onChange:t})),wp.element.createElement(r.InspectorControls,{key:"setting"},wp.element.createElement(o.PanelBody,{title:Object(l.a)("\u533a\u5757\u8bbe\u7f6e"),icon:"more",initialOpen:!0},wp.element.createElement(o.PanelRow,null,wp.element.createElement("div",{id:"gutenpride-controls"},wp.element.createElement("fieldset",null,wp.element.createElement(o.PanelRow,null,Object(l.a)("\u989c\u8272","argon")),wp.element.createElement(o.ColorPalette,{onChange:n,colors:[{name:"argon",color:"#7889e8"},{name:"green",color:"#4fd69c"},{name:"red",color:"#f75676"},{name:"blue",color:"#37d5f2"},{name:"orange",color:"#fc7c5f"},{name:"pink",color:"#fa7298"},{name:"black",color:"#3c4d69"}],value:e.attributes.color})),wp.element.createElement("fieldset",null,wp.element.createElement(o.PanelRow,null,Object(l.a)("\u56fe\u6807","argon")),wp.element.createElement(o.TextControl,{value:e.attributes.fa_icon_name,onChange:a}),wp.element.createElement("p",{className:"help-text"},Object(l.a)("Font Awesome \u4e2d\u7684\u56fe\u6807\u540d\uff0c\u7559\u7a7a\u5219\u4e0d\u663e\u793a","argon"),"\xa0",wp.element.createElement("a",{href:"https://fontawesome.com/v4.7.0/icons/",target:"_blank"},Object(l.a)("\u6d4f\u89c8\u56fe\u6807","argon")))))))))},save:function(e){return wp.element.createElement("div",{className:"alert",style:{backgroundColor:e.attributes.color}},!(Object(i.a)(e.attributes.fa_icon_name)||""==e.attributes.fa_icon_name)&&wp.element.createElement("span",{className:"alert-inner--icon"},wp.element.createElement("i",{className:"fa fa-"+e.attributes.fa_icon_name})),wp.element.createElement("span",{className:"alert-inner--text",dangerouslySetInnerHTML:{__html:e.attributes.content}}))}})},function(e,t){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"translations",function(){return a});var a={"\u63d0\u793a":"Alert","\u8b66\u544a":"Admonition","\u6298\u53e0\u533a\u5757":"Collapse Block","\u65f6\u95f4\u7ebf":"Timeline","\u8fdb\u5ea6\u6761":"Progress Bar","Github Repo \u4fe1\u606f\u5361":"Github