From 0e3a3711b05308fcda9af0f663be84ae2a2919aa Mon Sep 17 00:00:00 2001 From: fumikito Date: Wed, 10 Jun 2026 22:33:37 +0900 Subject: [PATCH] Rename block title 'Icon' -> 'Kunoichi Icon' (#17) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WordPress 6.9/7.0 added a core 'Icon' block (core/icon) in the Media category, colliding by title with kunoichi/icon. Rename the display title to disambiguate in the inserter. Backward compatible: block name (kunoichi/icon), attributes and save() output are unchanged -- only the title string changes. The inline-icon keyword still uses the 'Icon' msgid, so that string is preserved; a new 'Kunoichi Icon' msgid is added to the .pot/.po (ja: 'Kunoichi アイコン'), with ja.mo and the jed JSON regenerated. Verified in wp-env: getBlockType('kunoichi/icon').title === 'Kunoichi Icon'. Closes #17 Co-authored-by: Claude --- assets/js/icon-block.js | 2 +- languages/ja.mo | Bin 1723 -> 1734 bytes languages/ja.po | 6 +++++- languages/kicon-ja-kicon.json | 2 +- languages/kicon.pot | 6 +++++- src/js/icon-block.js | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) 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 9cb6403f41186cea5374317fdde49a243ddb43a4..4669aa9bd55eeaef8efdc76b7294ca855629e8cb 100644 GIT binary patch delta 649 zcmX}qKS%;$7{~GV)Ur~kw6i}(L{KCY6tpxoOF>IZO@T`mX+ds+VGuL~!O;@Y5J?RU zfzT2y5lsz^4dHS_4Q*{v(D$b=z3|@Wz4xByea`2+i#^54^?2ymFb3`X!BOU$!-cUG zFs1{yu?0)^zJgucA7U$>+5IXi?gnFci(!1k2tM2AuNX3>Z0gO0@ll07upPgwzo^7; z(3m(TPzR482bdYVKZ`1~fQnzjHe5x;|VhTwyl+%KZ?Hc;mjQF$d)`~m8`Q*^0su30GY0VlDp2N)$=2aIr; z!ZhlD73(JIpj}kKBUGUi9KuV~S5%BT*3VR&KASqFE_k0#bb5eAFH>F6pyQ3vV^tef zSpN|f==0Knl&e?NNHl3QJ>@M2?ql=Cd?A-z%ME9;g}mnm*K1e7Lcsms_ABRp<-)Jj L{Jol&Y_0wQ?0i9O delta 617 zcmXxhzb^w}7{KwjcWwP@gVHN1)kt)ale;68>xhYgK@4J0NfS+k>T zA3$QjDh4bTiNs>+U=fMc_i4|Qy!UzE-t)ZAdv71&xAE#nB3x5MnlZ@uVT>@ILOh67 zO{sP)VgxsWwTE4-cQJ~G!S6McyfcjB1-9TdcHmv`{t?4URn<##qFzxNyXAhI;ti%(m^?Evv5r!h;$dM1rEorQ z4P}FElt%j~4URB_rzroL