diff --git a/assets/js/icon-block.js b/assets/js/icon-block.js index 2b99d8c..a8d39c5 100644 --- a/assets/js/icon-block.js +++ b/assets/js/icon-block.js @@ -1 +1 @@ -(()=>{"use strict";const e=window.React,{registerBlockType:o}=wp.blocks,{__}=wp.i18n,{InspectorControls:l,AlignmentToolbar:t,withColors:n,PanelColorSettings:a}=wp.blockEditor,{PanelBody:c,RangeControl:r,RadioControl:s}=wp.components,{IconSelector:i}=wp.kicon;o("kunoichi/icon",{title:__("Icon","kicon"),icon:"flag",category:"media",description:__("Insert icon block.","kicon"),keywords:["icon"],attributes:{color:{type:"string",default:"primary"},customColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},size:{type:"number",default:48},classNames:{type:"string",default:"dashicons dashicons-flag"},style:{type:"string",default:"default"},alignment:{type:"string",default:"center"}},edit:n("color","backgroundColor")(({attributes:o,setAttributes:n,className:u,setColor:m,color:g,setBackgroundColor:p,backgroundColor:d})=>{const C=u.split(" ").filter(e=>!!e);C.push("kicon-wrapper"),C.push(`is-style-${o.style}`);const k=["kicon",o.classNames],y={fontSize:Math.max(10,o.size)+"px"};o.color?k.push(`has-${o.color}-color`):o.customColor&&(y.color=o.customColor);const h={textAlign:o.alignment},b=[{value:g.color||"",label:__("Icon Color","kicon"),onChange:e=>{m(e),n({customColor:g.class?"":e})}},{value:d.color||"",label:__("Background Color"),onChange:e=>{p(e),n({customBackgroundColor:d.class?"":e})}}];return d.class?k.push(d.class):d.color&&(y.backgroundColor=d.color),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(l,null,(0,e.createElement)(c,{title:__("Icon Type","kicon")},(0,e.createElement)("p",null,__("Current Class","kicon")),(0,e.createElement)("code",null,o.classNames),(0,e.createElement)("hr",null),(0,e.createElement)(i,{handler:e=>n({classNames:e})})),(0,e.createElement)(a,{title:__("Appearance","kicon"),colorSettings:b,disableCustomColors:!1,defaultOpen:!1},(0,e.createElement)("hr",null),(0,e.createElement)(r,{label:__("Size","kicon"),value:o.size,icon:"text-color",min:10,max:500,onChange:e=>n({size:e})}),(0,e.createElement)("hr",null),(0,e.createElement)(s,{label:__("Style","kicon"),selected:o.style,options:[{label:__("Default"),value:"default"},{label:__("Outline"),value:"outline"}],onChange:e=>n({style:e})}),(0,e.createElement)("hr",null),(0,e.createElement)("p",null,__("Align","kicon")),(0,e.createElement)(t,{value:o.alignment,onChange:e=>n({alignment:e})}))),(0,e.createElement)("div",{className:C.join(" "),style:h},(0,e.createElement)("span",{className:k.join(" "),style:y})))}),save({attributes:o}){const l=["kicon",o.classNames],t={fontSize:Math.max(10,o.size)+"px"};o.color?l.push(`has-${o.color}-color`):o.customColor&&(t.color=o.customColor),o.backgroundColor?l.push(`has-${o.backgroundColor}-background-color`):o.customBackgroundColor&&(t.backgroundColor=o.customBackgroundColor);const n=["kicon-wrapper",`is-style-${o.style}`],a={textAlign:o.alignment};return(0,e.createElement)("div",{className:n.join(" "),style:a},(0,e.createElement)("span",{className:l.join(" "),style:t}))}})})(); \ No newline at end of file +(()=>{"use strict";const e=window.React,{registerBlockType:o}=wp.blocks,{__}=wp.i18n,{InspectorControls:l,AlignmentToolbar:t,withColors:n,PanelColorSettings:a}=wp.blockEditor,{PanelBody:c,RangeControl:r,RadioControl:s}=wp.components,{IconSelector:i}=wp.kicon;o("kunoichi/icon",{title:__("Kunoichi Icon","kicon"),icon:"flag",category:"media",description:__("Insert icon block.","kicon"),keywords:["icon"],attributes:{color:{type:"string",default:"primary"},customColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},size:{type:"number",default:48},classNames:{type:"string",default:"dashicons dashicons-flag"},style:{type:"string",default:"default"},alignment:{type:"string",default:"center"}},edit:n("color","backgroundColor")(({attributes:o,setAttributes:n,className:u,setColor:m,color:g,setBackgroundColor:p,backgroundColor:d})=>{const C=u.split(" ").filter(e=>!!e);C.push("kicon-wrapper"),C.push(`is-style-${o.style}`);const k=["kicon",o.classNames],h={fontSize:Math.max(10,o.size)+"px"};o.color?k.push(`has-${o.color}-color`):o.customColor&&(h.color=o.customColor);const y={textAlign:o.alignment},b=[{value:g.color||"",label:__("Icon Color","kicon"),onChange:e=>{m(e),n({customColor:g.class?"":e})}},{value:d.color||"",label:__("Background Color"),onChange:e=>{p(e),n({customBackgroundColor:d.class?"":e})}}];return d.class?k.push(d.class):d.color&&(h.backgroundColor=d.color),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(l,null,(0,e.createElement)(c,{title:__("Icon Type","kicon")},(0,e.createElement)("p",null,__("Current Class","kicon")),(0,e.createElement)("code",null,o.classNames),(0,e.createElement)("hr",null),(0,e.createElement)(i,{handler:e=>n({classNames:e})})),(0,e.createElement)(a,{title:__("Appearance","kicon"),colorSettings:b,disableCustomColors:!1,defaultOpen:!1},(0,e.createElement)("hr",null),(0,e.createElement)(r,{label:__("Size","kicon"),value:o.size,icon:"text-color",min:10,max:500,onChange:e=>n({size:e})}),(0,e.createElement)("hr",null),(0,e.createElement)(s,{label:__("Style","kicon"),selected:o.style,options:[{label:__("Default"),value:"default"},{label:__("Outline"),value:"outline"}],onChange:e=>n({style:e})}),(0,e.createElement)("hr",null),(0,e.createElement)("p",null,__("Align","kicon")),(0,e.createElement)(t,{value:o.alignment,onChange:e=>n({alignment:e})}))),(0,e.createElement)("div",{className:C.join(" "),style:y},(0,e.createElement)("span",{className:k.join(" "),style:h})))}),save({attributes:o}){const l=["kicon",o.classNames],t={fontSize:Math.max(10,o.size)+"px"};o.color?l.push(`has-${o.color}-color`):o.customColor&&(t.color=o.customColor),o.backgroundColor?l.push(`has-${o.backgroundColor}-background-color`):o.customBackgroundColor&&(t.backgroundColor=o.customBackgroundColor);const n=["kicon-wrapper",`is-style-${o.style}`],a={textAlign:o.alignment};return(0,e.createElement)("div",{className:n.join(" "),style:a},(0,e.createElement)("span",{className:l.join(" "),style:t}))}})})(); \ No newline at end of file diff --git a/languages/ja.mo b/languages/ja.mo index 9cb6403..4669aa9 100644 Binary files a/languages/ja.mo and b/languages/ja.mo differ diff --git a/languages/ja.po b/languages/ja.po index 8e8ef07..75d4868 100644 --- a/languages/ja.po +++ b/languages/ja.po @@ -46,7 +46,11 @@ msgstr "クラス名" msgid "Glyph" msgstr "グリフ" -#: assets/js/icon-block.js:13 assets/js/icon-inline.js:90 +#: assets/js/icon-block.js:13 +msgid "Kunoichi Icon" +msgstr "Kunoichi アイコン" + +#: assets/js/icon-inline.js:90 msgid "Icon" msgstr "アイコン" diff --git a/languages/kicon-ja-kicon.json b/languages/kicon-ja-kicon.json index e6863b6..82f2874 100644 --- a/languages/kicon-ja-kicon.json +++ b/languages/kicon-ja-kicon.json @@ -1 +1 @@ -{"domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural_forms":"nplurals=1; plural=0;","lang":"ja"},"No icon set found.":["アイコンセットが見つかりません。"],"Icon Name":["アイコン名"],"Font Family":["フォントファミリー"],"Count":["数"],"%s has %s.":["%sは%sあります。"],"Name":["名前"],"Class Name":["クラス名"],"Glyph":["グリフ"],"Icon":["アイコン"],"Insert icon block.":["アイコンブロックを挿入します。"],"Icon Color":["アイコンの色"],"Background Color":["背景色"],"Icon Type":["アイコンの種類"],"Current Class":["現在のクラス"],"Appearance":["外観"],"Size":["サイズ"],"Style":["スタイル"],"Default":["デフォルト"],"Outline":["アウトライン"],"Align":["テキスト寄せ"],"Inline Icon":["インラインアイコン"],"Cancel":["キャンセル"],"Search Icon":["アイコン検索"],"Type to filter...":["キー入力で絞り込み…"],"Hide":["隠す"],"Show All":["すべて表示"]}}} \ No newline at end of file +{"domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural_forms":"nplurals=1; plural=0;","lang":"ja"},"No icon set found.":["アイコンセットが見つかりません。"],"Icon Name":["アイコン名"],"Font Family":["フォントファミリー"],"Count":["数"],"%s has %s.":["%sは%sあります。"],"Name":["名前"],"Class Name":["クラス名"],"Glyph":["グリフ"],"Kunoichi Icon":["Kunoichi アイコン"],"Icon":["アイコン"],"Insert icon block.":["アイコンブロックを挿入します。"],"Icon Color":["アイコンの色"],"Background Color":["背景色"],"Icon Type":["アイコンの種類"],"Current Class":["現在のクラス"],"Appearance":["外観"],"Size":["サイズ"],"Style":["スタイル"],"Default":["デフォルト"],"Outline":["アウトライン"],"Align":["テキスト寄せ"],"Inline Icon":["インラインアイコン"],"Cancel":["キャンセル"],"Search Icon":["アイコン検索"],"Type to filter...":["キー入力で絞り込み…"],"Hide":["隠す"],"Show All":["すべて表示"]}}} \ No newline at end of file diff --git a/languages/kicon.pot b/languages/kicon.pot index 6fb84aa..2be50f8 100644 --- a/languages/kicon.pot +++ b/languages/kicon.pot @@ -53,7 +53,11 @@ msgstr "" msgid "Glyph" msgstr "" -#: assets/js/icon-block.js:13 assets/js/icon-inline.js:90 +#: assets/js/icon-block.js:13 +msgid "Kunoichi Icon" +msgstr "" + +#: assets/js/icon-inline.js:90 msgid "Icon" msgstr "" diff --git a/src/js/icon-block.js b/src/js/icon-block.js index 0d499c9..1ac78f5 100644 --- a/src/js/icon-block.js +++ b/src/js/icon-block.js @@ -10,7 +10,7 @@ const { IconSelector } = wp.kicon; registerBlockType( 'kunoichi/icon', { - title: __( 'Icon', 'kicon' ), + title: __( 'Kunoichi Icon', 'kicon' ), icon: 'flag',