Changeset 2994709
- Timestamp:
- 11/12/2023 03:03:40 PM (9 months ago)
- Location:
- highlighting-code-block
- Files:
-
- 16 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
highlighting-code-block/tags/2.0.1/build/js/code-block/index.asset.php
r2994656 r2994709 1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ' eee4433c3b38834bd373');1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ''); -
highlighting-code-block/tags/2.0.1/build/js/code-block/index.js
r2994656 r2994709 1 (()=>{var e={184:(e,t)=>{var a;!function(){"use strict";var l={}.hasOwnProperty;function n(){for(var e=[],t=0;t<arguments.length;t++){var a=arguments[t];if(a){var o=typeof a;if("string"===o||"number"===o)e.push(a);else if(Array.isArray(a)){if(a.length){var r=n.apply(null,a);r&&e.push(r)}}else if("object"===o){if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]")){e.push(a.toString());continue}for(var c in a)l.call(a,c)&&a[c]&&e.push(c)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):void 0===(a=function(){return n}.apply(t,[]))||(e.exports=a)}()}},t={};function a(l){var n=t[l];if(void 0!==n)return n.exports;var o=t[l]={exports:{}};return e[l](o,o.exports,a),o.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var l in t)a.o(t,l)&&!a.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.blocks,t=window.React,l=window.wp.i18n,n=window.wp.blockEditor,o=window.wp.components,r=window.wp.element;var c=a(184),s=a.n(c);const i=window.hcbVars?.showLang,u=window.hcbVars?.showLinenum;let d=window?.hcbLangs||null;const p=[["plain","Plain"],...Object.entries(d)],m=[{value:"",label:"Plain"},...Object.entries(d).map((([e,t])=>({value:e,label:t})))],g=(e="")=>{const t=e.match(/\r\n|\n/g);return null!==t?t.length+1:1};function h(e){return e?e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):e}const b=JSON.parse('{"u2":"loos-hcb/code-block"}'),f=(0,t.createElement)("svg",{x:"0px",y:"0px",viewBox:"0 0 512 512"},(0,t.createElement)("g",null,(0,t.createElement)("path",{d:"M54.4,348.2H89v51h31.2v-51h34.6V484h-34.6v-54.6H89v54.5H54.4V348.2z"}),(0,t.createElement)("path",{d:"M267.5,345.7c17.5,0,31.6,8.3,41,17.3l-19,21.6c-6.2-5.6-12.8-9.2-22-9.2c-17.3,0-30.5,15.2-30.5,40.4 c0,26.1,13.2,40.6,32,40.6c9,0,16.4-4.5,22.4-11.1l19,21.1c-11.5,13.4-26.7,19.9-43.4,19.9c-35.3,0-65.4-23.1-65.4-69.4 C201.6,371.7,230.9,345.7,267.5,345.7z"}),(0,t.createElement)("path",{d:"M356.5,348.2h44.4c28.2,0,50.6,7.1,50.6,33.7c0,11.8-7.1,25.4-22.9,29.5v0.8c19.2,3.6,29,13.7,29,31.8 c0,28-23.1,40-52.6,40h-48.5V348.2z M399.8,402c12.6,0,17.7-6,17.7-14.9c0-8.6-5.3-12.2-17.7-12.2h-8.5V402H399.8z M402.3,457.2 c14.7,0,21.1-5.5,21.1-16.2c0-10.5-6.4-14.9-21.1-14.9h-11.1v31h11.1V457.2z"})),(0,t.createElement)("polygon",{points:"172,311.6 195,288.6 76.2,165.7 195,42.9 172,19.8 30.1,165.7 "}),(0,t.createElement)("polygon",{points:"340,19.8 317,42.9 435.8,165.7 317,288.6 340,311.6 481.9,165.7 "})),y=[{supports:{className:!1},attributes:{code:{type:"string",source:"text",selector:"code"},className:{type:"string",default:""},langType:{type:"string",default:""},langName:{type:"string",default:""},fileName:{type:"string",default:""},dataLineNum:{type:"string",default:""},isLineShow:{type:"string",default:"undefined"},isShowLang:{type:"string",default:""}},save:({attributes:e})=>{const{code:a,fileName:l,langName:o,dataLineNum:r,isLineShow:c,isShowLang:i}=e,u=e.langType||"plain";let d=s()("prism",`lang-${u}`);return"undefined"!==c&&(d=s()(d,`${c}-numbers`)),(0,t.createElement)("div",{className:"hcb_wrap"},(0,t.createElement)("pre",{className:d,"data-file":l||null,"data-lang":o||null,"data-line":r||null,"data-show-lang":i||null},(0,t.createElement)(n.RichText.Content,{tagName:"code",value:h(a)})))}},{supports:{className:!1},attributes:{code:{type:"string",source:"text",selector:"code"},className:{type:"string",default:""},langType:{type:"string",default:"plane"},langName:{type:"string",default:""},fileName:{type:"string",default:""},dataLineNum:{type:"string",default:""},isLineShow:{type:"string",default:"undefined"},isShowLang:{type:"string",default:""}},migrate:e=>("plane"===e.langType&&(e.langType=""),e),save:({attributes:e})=>{const{code:a,langType:l,fileName:o,langName:r,dataLineNum:c,isLineShow:s,isShowLang:i}=e,u="prism "+s+"-numbers lang-"+l;return(0,t.createElement)("div",{className:"hcb_wrap"},(0,t.createElement)("pre",{className:u,"data-file":o||null,"data-lang":r||null,"data-line":c||null,"data-show-lang":i||null},(0,t.createElement)(n.RichText.Content,{tagName:"code",value:h(a)})))}}];(0,e.registerBlockType)(b.u2,{icon:f,transforms:{from:[{type:"block",blocks:["core/code"],transform:t=>(0,e.createBlock)("loos-hcb/code-block",{code:t.content})}],to:[{type:"block",blocks:["core/code"],transform:t=>(0,e.createBlock)("core/code",{content:t.code})}]},edit:({attributes:e,setAttributes:a,clientId:c})=>{const h=(0,r.useRef)(),{className:b,code:f="",langType:y,fileName:v,langName:w,dataLineNum:N,dataStart:E,isShowLang:_,isLineShow:S}=e,[L,x]=(0,r.useState)(g(f)),C=s()("hcb-block","hcb_wrap");(0,r.useEffect)((()=>{const e=b||"";if(!e)return;const t=e.split(" "),l=[...new Set(t)];a({className:s()(l)})}),[b,a]),(0,r.useEffect)((()=>{const{ownerDocument:e}=h.current;if(e){const t=e.querySelector(`#block-${c}`),a=t.querySelector(".hcb_textarea");if(t.style.setProperty("--hcb--code-linenum",L),a.scrollWidth>a.offsetWidth){const e=a.offsetHeight-a.clientHeight;t.style.setProperty("--hcb--scbarH",e+"px")}}}),[c,L]);let T="0";("1"===_||""===_&&"on"===i)&&(T="1");let k=null;("on"===S||"undefined"===S&&"on"===u)&&(k="1");const P=(0,n.useBlockProps)({ref:h,className:C,"data-file":v||null,"data-lang":w||null,"data-show-lang":T,"data-show-linenum":k}),B=[...p];return y||B.shift(),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n.BlockControls,null,(0,t.createElement)(o.ToolbarGroup,{isCollapsed:!0,icon:(0,t.createElement)(t.Fragment,null,w||(0,l.__)("Language","loos-hcb")),title:"Lnaguage",controls:B.map((([e,t])=>({key:e,isActive:e===y,title:t,onClick:()=>{a("plain"===e?{langType:"",langName:""}:{langType:e,langName:t})}})))})),(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(o.PanelBody,{title:(0,l.__)("HCB settings","loos-hcb"),initialOpen:!0},(0,t.createElement)(o.SelectControl,{label:(0,l.__)("Language","loos-hcb"),value:e.langType,options:m,onChange:e=>{a(""===e?{langType:"",langName:""}:{langType:e,langName:d[e]})}}),(0,t.createElement)(o.SelectControl,{label:(0,l.__)("Display number of rows","loos-hcb"),value:S,options:[{label:(0,l.__)("Do not set individually","loos-hcb"),value:"undefined"},{label:(0,l.__)("Display row count","loos-hcb"),value:"on"},{label:(0,l.__)("Do not display row count","loos-hcb"),value:"off"}],onChange:e=>{a({isLineShow:e})}}),(0,t.createElement)(o.SelectControl,{label:(0,l.__)("Display language name","loos-hcb"),value:_,options:[{label:(0,l.__)("Do not set individually","loos-hcb"),value:""},{label:(0,l.__)("Display language","loos-hcb"),value:"1"},{label:(0,l.__)("Do not display language","loos-hcb"),value:"0"}],onChange:e=>{a({isShowLang:e})}}),(0,t.createElement)(o.TextControl,{label:(0,l.__)("File name","loos-hcb"),value:v,onChange:e=>{a({fileName:e})}}),(0,t.createElement)(o.TextControl,{label:(0,t.createElement)(t.Fragment,null,(0,l.__)("Highlight Number","loos-hcb")+" ( ",(0,t.createElement)("code",{className:"hcb-code-in-label"},"[data-line]")," )"),value:N,onChange:e=>{a({dataLineNum:e})}}),(0,t.createElement)(o.TextControl,{type:"number",label:(0,t.createElement)(t.Fragment,null,(0,l.__)("First line number","loos-hcb")+" ( ",(0,t.createElement)("code",{className:"hcb-code-in-label"},"[data-start]")," )"),value:E||1,onChange:e=>{a({dataStart:parseInt(e||1)})},style:{opacity:k?1:.5},disabled:!k}))),(0,t.createElement)("div",{...P},(0,t.createElement)("div",{className:"hcb_codewrap"},k&&(0,t.createElement)("div",{className:"hcb_linenum"},(0,t.createElement)("div",{className:"hcb-startNum"},E)),(0,t.createElement)("textarea",{className:"hcb_textarea",placeholder:"Your Code...",value:f,onChange:e=>{const t=e.target.value;a({code:t});const l=g(t);L!==l&&x(l)}}),N&&(0,t.createElement)("div",{className:"hcb-datapreview"},(0,t.createElement)("div",{className:"hcb-datapreview__items"},`{${N}}`)))))},save:({attributes:e})=>{const{code:a,fileName:l,langName:o,dataLineNum:r,dataStart:c,isLineShow:i,isShowLang:u}=e,d=e.langType||"plain",p=s()("prism",`${i}-numbers`,`lang-${d}`),m=n.useBlockProps.save({className:"hcb_wrap"});return(0,t.createElement)("div",{...m},(0,t.createElement)("pre",{className:p,"data-file":l||null,"data-lang":o||null,"data-line":r||null,"data-start":1===c?null:c,"data-show-lang":u||null},(0,t.createElement)(n.RichText.Content,{tagName:"code",value:h(a)})))},deprecated:y})})()})();1 (()=>{var e={184:(e,t)=>{var a;!function(){"use strict";var l={}.hasOwnProperty;function n(){for(var e=[],t=0;t<arguments.length;t++){var a=arguments[t];if(a){var o=typeof a;if("string"===o||"number"===o)e.push(a);else if(Array.isArray(a)){if(a.length){var r=n.apply(null,a);r&&e.push(r)}}else if("object"===o){if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]")){e.push(a.toString());continue}for(var c in a)l.call(a,c)&&a[c]&&e.push(c)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):void 0===(a=function(){return n}.apply(t,[]))||(e.exports=a)}()}},t={};function a(l){var n=t[l];if(void 0!==n)return n.exports;var o=t[l]={exports:{}};return e[l](o,o.exports,a),o.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var l in t)a.o(t,l)&&!a.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.blocks,t=window.React,l=window.wp.i18n,n=window.wp.blockEditor,o=window.wp.components,r=window.wp.element;var c=a(184),s=a.n(c);const i=window.hcbVars?.showLang,u=window.hcbVars?.showLinenum;let d=window?.hcbLangs||null;const p=[["plain","Plain"],...Object.entries(d)],m=[{value:"",label:"Plain"},...Object.entries(d).map((([e,t])=>({value:e,label:t})))],g=(e="")=>{const t=e.match(/\r\n|\n/g);return null!==t?t.length+1:1};function h(e){return e?e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):e}const b=JSON.parse('{"u2":"loos-hcb/code-block"}'),f=(0,t.createElement)("svg",{x:"0px",y:"0px",viewBox:"0 0 512 512"},(0,t.createElement)("g",null,(0,t.createElement)("path",{d:"M54.4,348.2H89v51h31.2v-51h34.6V484h-34.6v-54.6H89v54.5H54.4V348.2z"}),(0,t.createElement)("path",{d:"M267.5,345.7c17.5,0,31.6,8.3,41,17.3l-19,21.6c-6.2-5.6-12.8-9.2-22-9.2c-17.3,0-30.5,15.2-30.5,40.4 c0,26.1,13.2,40.6,32,40.6c9,0,16.4-4.5,22.4-11.1l19,21.1c-11.5,13.4-26.7,19.9-43.4,19.9c-35.3,0-65.4-23.1-65.4-69.4 C201.6,371.7,230.9,345.7,267.5,345.7z"}),(0,t.createElement)("path",{d:"M356.5,348.2h44.4c28.2,0,50.6,7.1,50.6,33.7c0,11.8-7.1,25.4-22.9,29.5v0.8c19.2,3.6,29,13.7,29,31.8 c0,28-23.1,40-52.6,40h-48.5V348.2z M399.8,402c12.6,0,17.7-6,17.7-14.9c0-8.6-5.3-12.2-17.7-12.2h-8.5V402H399.8z M402.3,457.2 c14.7,0,21.1-5.5,21.1-16.2c0-10.5-6.4-14.9-21.1-14.9h-11.1v31h11.1V457.2z"})),(0,t.createElement)("polygon",{points:"172,311.6 195,288.6 76.2,165.7 195,42.9 172,19.8 30.1,165.7 "}),(0,t.createElement)("polygon",{points:"340,19.8 317,42.9 435.8,165.7 317,288.6 340,311.6 481.9,165.7 "})),y=[{supports:{className:!1},attributes:{code:{type:"string",source:"text",selector:"code"},className:{type:"string",default:""},langType:{type:"string",default:""},langName:{type:"string",default:""},fileName:{type:"string",default:""},dataLineNum:{type:"string",default:""},isLineShow:{type:"string",default:"undefined"},isShowLang:{type:"string",default:""}},save:({attributes:e})=>{const{code:a,fileName:l,langName:o,dataLineNum:r,isLineShow:c,isShowLang:i}=e,u=e.langType||"plain";let d=s()("prism",`lang-${u}`);return"undefined"!==c&&(d=s()(d,`${c}-numbers`)),(0,t.createElement)("div",{className:"hcb_wrap"},(0,t.createElement)("pre",{className:d,"data-file":l||null,"data-lang":o||null,"data-line":r||null,"data-show-lang":i||null},(0,t.createElement)(n.RichText.Content,{tagName:"code",value:h(a)})))}},{supports:{className:!1},attributes:{code:{type:"string",source:"text",selector:"code"},className:{type:"string",default:""},langType:{type:"string",default:"plane"},langName:{type:"string",default:""},fileName:{type:"string",default:""},dataLineNum:{type:"string",default:""},isLineShow:{type:"string",default:"undefined"},isShowLang:{type:"string",default:""}},migrate:e=>("plane"===e.langType&&(e.langType=""),e),save:({attributes:e})=>{const{code:a,langType:l,fileName:o,langName:r,dataLineNum:c,isLineShow:s,isShowLang:i}=e,u="prism "+s+"-numbers lang-"+l;return(0,t.createElement)("div",{className:"hcb_wrap"},(0,t.createElement)("pre",{className:u,"data-file":o||null,"data-lang":r||null,"data-line":c||null,"data-show-lang":i||null},(0,t.createElement)(n.RichText.Content,{tagName:"code",value:h(a)})))}}];(0,e.registerBlockType)(b.u2,{icon:f,transforms:{from:[{type:"block",blocks:["core/code"],transform:t=>(0,e.createBlock)("loos-hcb/code-block",{code:t.content})}],to:[{type:"block",blocks:["core/code"],transform:t=>(0,e.createBlock)("core/code",{content:t.code})}]},edit:({attributes:e,setAttributes:a,clientId:c})=>{const h=(0,r.useRef)(),{className:b,code:f="",langType:y,fileName:v,langName:w,dataLineNum:N,dataStart:E,isShowLang:_,isLineShow:S}=e,[L,x]=(0,r.useState)(g(f)),C=s()("hcb-block","hcb_wrap");(0,r.useEffect)((()=>{const e=b||"";if(!e)return;const t=e.split(" "),l=[...new Set(t)];a({className:s()(l)})}),[b,a]),(0,r.useEffect)((()=>{const{ownerDocument:e}=h.current;if(e){const t=e.querySelector(`#block-${c}`),a=t.querySelector(".hcb_textarea");if(t.style.setProperty("--hcb--code-linenum",L),a.scrollWidth>a.offsetWidth){const e=a.offsetHeight-a.clientHeight;t.style.setProperty("--hcb--scbarH",e+"px")}}}),[c,L]);let T="0";("1"===_||""===_&&"on"===i)&&(T="1");let k=null;("on"===S||"undefined"===S&&"on"===u)&&(k="1");const P=(0,n.useBlockProps)({ref:h,className:C,"data-file":v||null,"data-lang":w||null,"data-show-lang":T,"data-show-linenum":k}),B=[...p];return y||B.shift(),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n.BlockControls,null,(0,t.createElement)(o.ToolbarGroup,{isCollapsed:!0,icon:(0,t.createElement)(t.Fragment,null,w||(0,l.__)("Language","loos-hcb")),title:"Lnaguage",controls:B.map((([e,t])=>({key:e,isActive:e===y,title:t,onClick:()=>{a("plain"===e?{langType:"",langName:""}:{langType:e,langName:t})}})))})),(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(o.PanelBody,{title:(0,l.__)("HCB settings","loos-hcb"),initialOpen:!0},(0,t.createElement)(o.SelectControl,{label:(0,l.__)("Language","loos-hcb"),value:e.langType,options:m,onChange:e=>{a(""===e?{langType:"",langName:""}:{langType:e,langName:d[e]})}}),(0,t.createElement)(o.SelectControl,{label:(0,l.__)("Display s","loos-hcb"),value:S,options:[{label:(0,l.__)("Do not set individually","loos-hcb"),value:"undefined"},{label:(0,l.__)("Display row count","loos-hcb"),value:"on"},{label:(0,l.__)("Do not display row count","loos-hcb"),value:"off"}],onChange:e=>{a({isLineShow:e})}}),(0,t.createElement)(o.SelectControl,{label:(0,l.__)("Display language name","loos-hcb"),value:_,options:[{label:(0,l.__)("Do not set individually","loos-hcb"),value:""},{label:(0,l.__)("Display language","loos-hcb"),value:"1"},{label:(0,l.__)("Do not display language","loos-hcb"),value:"0"}],onChange:e=>{a({isShowLang:e})}}),(0,t.createElement)(o.TextControl,{label:(0,l.__)("File name","loos-hcb"),value:v,onChange:e=>{a({fileName:e})}}),(0,t.createElement)(o.TextControl,{label:(0,t.createElement)(t.Fragment,null,(0,l.__)("Highlight Number","loos-hcb")+" ( ",(0,t.createElement)("code",{className:"hcb-code-in-label"},"[data-line]")," )"),value:N,onChange:e=>{a({dataLineNum:e})}}),(0,t.createElement)(o.TextControl,{type:"number",label:(0,t.createElement)(t.Fragment,null,(0,l.__)("First line number","loos-hcb")+" ( ",(0,t.createElement)("code",{className:"hcb-code-in-label"},"[data-start]")," )"),value:E||1,onChange:e=>{a({dataStart:parseInt(e||1)})},style:{opacity:k?1:.5},disabled:!k}))),(0,t.createElement)("div",{...P},(0,t.createElement)("div",{className:"hcb_codewrap"},k&&(0,t.createElement)("div",{className:"hcb_linenum"},(0,t.createElement)("div",{className:"hcb-startNum"},E)),(0,t.createElement)("textarea",{className:"hcb_textarea",placeholder:"Your Code...",value:f,onChange:e=>{const t=e.target.value;a({code:t});const l=g(t);L!==l&&x(l)}}),N&&(0,t.createElement)("div",{className:"hcb-datapreview"},(0,t.createElement)("div",{className:"hcb-datapreview__items"},`{${N}}`)))))},save:({attributes:e})=>{const{code:a,fileName:l,langName:o,dataLineNum:r,dataStart:c,isLineShow:i,isShowLang:u}=e,d=e.langType||"plain",p=s()("prism",`${i}-numbers`,`lang-${d}`),m=n.useBlockProps.save({className:"hcb_wrap"});return(0,t.createElement)("div",{...m},(0,t.createElement)("pre",{className:p,"data-file":l||null,"data-lang":o||null,"data-line":r||null,"data-start":1===c?null:c,"data-show-lang":u||null},(0,t.createElement)(n.RichText.Content,{tagName:"code",value:h(a)})))},deprecated:y})})()})(); -
highlighting-code-block/tags/2.0.1/highlighting-code-block.php
r2994656 r2994709 4 4 * Plugin URI: https://wordpress.org/plugins/highlighting-code-block/ 5 5 * Description: Add code block with syntax highlighting using prism.js. (Available for Gutenberg and Classic Editor) 6 * Version: 2.0. 06 * Version: 2.0. 7 7 * Requires at least: 5.6 8 8 * Author: LOOS, Inc. -
highlighting-code-block/tags/2.0.1/languages/loos-hcb-ja-hcb-blocks.json
r2994656 r2994709 1 {"domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural_forms":"nplurals=1; plural=0;","lang":"ja_JP"}," HCB settings":["HCB設定"],"Language":["言語"],"Display number of rows":["行数の表示"],"Do not set individually":["個別で設定はしない"],"Display row count":["行数を表示する"],"Do not display row count":["行数を表示しない"],"Display language name":["言語の表示"],"Display language":["言語を表示する"],"Do not display language":["言語を表示しない"],"File name":["ファイル名"],"Highlight Number":["ハイライトする行番号"],"First line number":["開始行番号"],"[HCB] Settings":["[HCB] 設定"],"Basic settings":["基本設定"],"Display language name in code block":["コードブロックに言語名を表示する"],"If checked, the language type is displayed in the code on the site display side.":["チェックすると、サイト表示側のコードに言語の種���が表示されます。"],"Display settings for the number of rows":["行数の表示設定"],"Show line count in code block":["コードブロックに行数を表示する"],"If checked, the number of lines will be displayed on the left end of the code on the site display side.":["チェックすると、サイト表示側のコードの左端に行数が表示されます。"],"Copy button":["コピーボタン"],"Show copy button in code block":["コードブロックにコピーボタンを表示する"],"Font smoothing":["フォントスムージング"],"Turn on font smoothing":["フォントスムージングをオンにする"],"Add %s and %s to the code block.":["コードブロックに %s と %s が追加されます。"],"Cord coloring (front side)":["コードカラーリング(フロント側)"],"Code coloring (editor side)":["コードカラーリング(エディター側)"],"Font Size":["フォントサイズ"],"\"Font-family\" in code":["コードの “font-family”"],"Advanced settings":["高度な設定"],"When you use each original file, please upload it in the theme folder.":["各独自ファイルを使用する場合は、テーマフォルダの中にアップロードしてください。"],"If you set the path to your own file, the default coloring file and prism.js file will not be loaded..":["独自ファイルへのパスを設定すると、デフォルトのカラーリングファイルやprism.jsファイルは読み込まれなくなります。"],"* The currently loaded prism.js file can be downloaded at %s.":["※ 現在読み込んでいるprism.jsファイルは、 %s でダウンロードできます。"],"Here":["こちら"],"Language set to use":["使用する言語セット"],"Write in the format of %s, separated by \",\" (comma).":["%s の形式で、”,”(カンマ)区切りで記述してください。"],"class-key:\"language-name\"":["クラスキー:”言語名”"],"\"class-key\" is the class name used in prism.js (the part corresponding to \"◯◯\" in \"lang- ◯◯\")":["「クラスキー」は、prism.jsで使用されるクラス名(「lang-◯◯」の「◯◯」に該当する部分)です。"],"* If you use a language that is not supported by default, please use it together with \"Original prism.js\" setting.":["※ デフォルトでサポートされていない言語を使用する場合、「独自prism.js」設定と併用してください。"],"Original coloring file":["独自カラーリングファイル"],"Load your own CSS file for code coloring.":["あなたが用意したコードカラーリング用のCSSファイルを読み込みます。"],"Original prism.js":["独自prism.js"],"You can use the prism.js file corresponding to your own language set.":["自分専用の言語セットに対応したprism.jsファイルを使用できます。"],"help":["ヘルプ"],"Highlighting Code Block settings":["Highlighting Code Block 設定"],"Copy code to clipboard":["コードをクリップボードにコピーする"],"Highlighting Code Block":["Highlighting Code Block"],"https://wordpress.org/plugins/highlighting-code-block/":["https://wordpress.org/plugins/highlighting-code-block/"],"Add code block with syntax highlighting using prism.js. (Available for Gutenberg and Classic Editor)":["prism.js を使用したシンタックスハイライト機能付きのコードブロックを追加します。(Gutenbergとクラシックエディター共に��用可能)"],"LOOS, Inc.":["LOOS, Inc."],"https://loos-web-studio.com/":["https://loos-web-studio.com/"]}}}1 {"domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural_forms":"nplurals=1; plural=0;","lang":"ja_JP"},"s":["行数の表示"],"Do not set individually":["個別で設定はしない"],"Display row count":["行数を表示する"],"Do not display row count":["行数を表示しない"],"Display language name":["言語の表示"],"Display language":["言語を表示する"],"Do not display language":["言語を表示しない"],"File name":["ファイル名"],"Highlight Number":["ハイライトする行番号"],"First line number":["開始行番号"],"[HCB] Settings":["[HCB] 設定"],"Basic settings":["基本設定"],"Display language name in code block":["コードブロックに言語名を表示する"],"If checked, the language type is displayed in the code on the site display side.":["チェックすると、サイト表示側のコードに言語の種類が表示されます。"],"Display settings for the number of rows":["行数の表示設定"],"Show line count in code block":["コードブロックに行数を表示する"],"If checked, the number of lines will be displayed on the left end of the code on the site display side.":["チェックすると、サイト表示側のコードの左端に行数が表示されます。"],"Copy button":["コピーボタン"],"Show copy button in code block":["コードブロックにコピーボタンを表示する"],"Font smoothing":["フォントスムージング"],"Turn on font smoothing":["フォントスムージングをオンにする"],"Add %s and %s to the code block.":["コードブロックに %s と %s が追加されます。"],"Cord coloring (front side)":["コードカラーリング(フロント側)"],"Code coloring (editor side)":["コードカラーリング(エディター側)"],"Font Size":["フォントサイズ"],"\"Font-family\" in code":["コードの “font-family”"],"Advanced settings":["高度な設定"],"When you use each original file, please upload it in the theme folder.":["各独自ファイルを使用する場合は、テーマフォルダの中にアップロードしてください。"],"If you set the path to your own file, the default coloring file and prism.js file will not be loaded..":["独自ファイルへのパスを設定すると、デフォルトのカラーリングファイルやprism.jsファイルは読み込まれなくなります。"],"* The currently loaded prism.js file can be downloaded at %s.":["※ 現在読み込んでいるprism.jsファイルは、 %s でダウンロードできます。"],"Here":["こちら"],"Language set to use":["使用する言語セット"],"Write in the format of %s, separated by \",\" (comma).":["%s の形式で、”,”(カンマ)区切りで記述してください。"],"class-key:\"language-name\"":["クラスキー:”言語名”"],"\"class-key\" is the class name used in prism.js (the part corresponding to \"◯◯\" in \"lang- ◯◯\")":["「クラスキー」は、prism.jsで使用されるクラス名(「lang-◯◯」の「◯◯」に該当する部分)です。"],"* If you use a language that is not supported by default, please use it together with \"Original prism.js\" setting.":["※ デフォルトでサポートされていない言語を使用する場合、「独自prism.js」設定と併用してください。"],"Original coloring file":["独自カラーリングファイル"],"Load your own CSS file for code coloring.":["あなたが用意したコードカラーリング用のCSSファイルを読み込みます。"],"Original prism.js":["独自prism.js"],"You can use the prism.js file corresponding to your own language set.":["自分専用の言語セットに対応したprism.jsファイルを使用できます。"],"help":["ヘルプ"],"Highlighting Code Block settings":["Highlighting Code Block 設定"],"Copy code to clipboard":["コードをクリップボードにコピーする"],"Highlighting Code Block":["Highlighting Code Block"],"https://wordpress.org/plugins/highlighting-code-block/":["https://wordpress.org/plugins/highlighting-code-block/"],"Add code block with syntax highlighting using prism.js. (Available for Gutenberg and Classic Editor)":["prism.js を使用したシンタックスハイライト機能付きのコードブロックを追加します。(Gutenbergとクラシックエディター共に利用可能)"],"LOOS, Inc.":["LOOS, Inc."],"https://loos-web-studio.com/":["https://loos-web-studio.com/"]}}} -
highlighting-code-block/tags/2.0.1/languages/loos-hcb-ja.po
r2994656 r2994709 2 2 msgstr "" 3 3 "Project-Id-Version: Highlighting Code Block\n" 4 "POT-Creation-Date: 2023-11-1 0 00:11+0900\n"5 "PO-Revision-Date: 2023-11-1 0 00:12+0900\n"4 "POT-Creation-Date: 2023-11-1+0900\n" 5 "PO-Revision-Date: 2023-11-1+0900\n" 6 6 "Last-Translator: \n" 7 7 "Language-Team: \n" … … 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=1; plural=0;\n" 13 "X-Generator: Poedit 3. 2.2\n"13 "X-Generator: Poedit 3.\n" 14 14 "X-Poedit-Basepath: ..\n" 15 15 "X-Poedit-Flags-xgettext: --add-comments=translators:\n" … … 26 26 "X-Poedit-SearchPathExcluded-4: vendor\n" 27 27 28 #: src/js/code-block/edit.js:172 28 #: src/js/code-block/edit.js:168 src/js/code-block/edit.js:190 29 msgid "Language" 30 msgstr "言語" 31 32 #: src/js/code-block/edit.js:188 29 33 msgid "HCB settings" 30 34 msgstr "HCB設定" 31 35 32 #: src/js/code-block/edit.js:174 33 msgid "Language" 34 msgstr "言語" 35 36 #: src/js/code-block/edit.js:186 37 msgid "Display number of rows" 36 #: src/js/code-block/edit.js:202 37 msgid "Display line numbers" 38 38 msgstr "行数の表示" 39 39 40 #: src/js/code-block/edit.js: 190 src/js/code-block/edit.js:21140 #: src/js/code-block/edit.js: 41 41 msgid "Do not set individually" 42 42 msgstr "個別で設定はしない" 43 43 44 #: src/js/code-block/edit.js: 19444 #: src/js/code-block/edit.js: 45 45 msgid "Display row count" 46 46 msgstr "行数を表示する" 47 47 48 #: src/js/code-block/edit.js: 19848 #: src/js/code-block/edit.js: 49 49 msgid "Do not display row count" 50 50 msgstr "行数を表示しない" 51 51 52 #: src/js/code-block/edit.js:2 07class/loos_hcb_menu.php:3552 #: src/js/code-block/edit.js:2 class/loos_hcb_menu.php:35 53 53 msgid "Display language name" 54 54 msgstr "言語の表示" 55 55 56 #: src/js/code-block/edit.js:2 1556 #: src/js/code-block/edit.js:2 57 57 msgid "Display language" 58 58 msgstr "言語を表示する" 59 59 60 #: src/js/code-block/edit.js:2 1960 #: src/js/code-block/edit.js:2 61 61 msgid "Do not display language" 62 62 msgstr "言語を表示しない" 63 63 64 #: src/js/code-block/edit.js:2 2864 #: src/js/code-block/edit.js:2 65 65 msgid "File name" 66 66 msgstr "ファイル名" 67 67 68 #: src/js/code-block/edit.js:2 3868 #: src/js/code-block/edit.js:2 69 69 msgid "Highlight Number" 70 70 msgstr "ハイライトする行番号" 71 71 72 #: src/js/code-block/edit.js:2 5472 #: src/js/code-block/edit.js:2 73 73 msgid "First line number" 74 74 msgstr "開始行番号" … … 251 251 msgstr "https://loos-web-studio.com/" 252 252 253 254 255 253 256 #~ msgid "\"data-line\" value" 254 257 #~ msgstr "data-line属性値" -
highlighting-code-block/tags/2.0.1/readme.txt
r2994656 r2994709 5 5 Requires at least: 5.6 6 6 Tested up to: 6.4 7 Stable tag: 2.0. 07 Stable tag: 2.0. 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 106 106 == Changelog == 107 107 108 109 110 108 111 = 2.0.0 = 109 112 - Support for WordPress 6.4. -
highlighting-code-block/tags/2.0.1/src/js/code-block/edit.js
r2994656 r2994709 200 200 /> 201 201 <SelectControl 202 label={__('Display number of rows', 'loos-hcb')} // 行数の表示202 label={__('Display s', 'loos-hcb')} // 行数の表示 203 203 value={isLineShow} 204 204 options={[ -
highlighting-code-block/trunk/build/js/code-block/index.asset.php
r2994656 r2994709 1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ' eee4433c3b38834bd373');1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => ''); -
highlighting-code-block/trunk/build/js/code-block/index.js
r2994656 r2994709 1 (()=>{var e={184:(e,t)=>{var a;!function(){"use strict";var l={}.hasOwnProperty;function n(){for(var e=[],t=0;t<arguments.length;t++){var a=arguments[t];if(a){var o=typeof a;if("string"===o||"number"===o)e.push(a);else if(Array.isArray(a)){if(a.length){var r=n.apply(null,a);r&&e.push(r)}}else if("object"===o){if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]")){e.push(a.toString());continue}for(var c in a)l.call(a,c)&&a[c]&&e.push(c)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):void 0===(a=function(){return n}.apply(t,[]))||(e.exports=a)}()}},t={};function a(l){var n=t[l];if(void 0!==n)return n.exports;var o=t[l]={exports:{}};return e[l](o,o.exports,a),o.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var l in t)a.o(t,l)&&!a.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.blocks,t=window.React,l=window.wp.i18n,n=window.wp.blockEditor,o=window.wp.components,r=window.wp.element;var c=a(184),s=a.n(c);const i=window.hcbVars?.showLang,u=window.hcbVars?.showLinenum;let d=window?.hcbLangs||null;const p=[["plain","Plain"],...Object.entries(d)],m=[{value:"",label:"Plain"},...Object.entries(d).map((([e,t])=>({value:e,label:t})))],g=(e="")=>{const t=e.match(/\r\n|\n/g);return null!==t?t.length+1:1};function h(e){return e?e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):e}const b=JSON.parse('{"u2":"loos-hcb/code-block"}'),f=(0,t.createElement)("svg",{x:"0px",y:"0px",viewBox:"0 0 512 512"},(0,t.createElement)("g",null,(0,t.createElement)("path",{d:"M54.4,348.2H89v51h31.2v-51h34.6V484h-34.6v-54.6H89v54.5H54.4V348.2z"}),(0,t.createElement)("path",{d:"M267.5,345.7c17.5,0,31.6,8.3,41,17.3l-19,21.6c-6.2-5.6-12.8-9.2-22-9.2c-17.3,0-30.5,15.2-30.5,40.4 c0,26.1,13.2,40.6,32,40.6c9,0,16.4-4.5,22.4-11.1l19,21.1c-11.5,13.4-26.7,19.9-43.4,19.9c-35.3,0-65.4-23.1-65.4-69.4 C201.6,371.7,230.9,345.7,267.5,345.7z"}),(0,t.createElement)("path",{d:"M356.5,348.2h44.4c28.2,0,50.6,7.1,50.6,33.7c0,11.8-7.1,25.4-22.9,29.5v0.8c19.2,3.6,29,13.7,29,31.8 c0,28-23.1,40-52.6,40h-48.5V348.2z M399.8,402c12.6,0,17.7-6,17.7-14.9c0-8.6-5.3-12.2-17.7-12.2h-8.5V402H399.8z M402.3,457.2 c14.7,0,21.1-5.5,21.1-16.2c0-10.5-6.4-14.9-21.1-14.9h-11.1v31h11.1V457.2z"})),(0,t.createElement)("polygon",{points:"172,311.6 195,288.6 76.2,165.7 195,42.9 172,19.8 30.1,165.7 "}),(0,t.createElement)("polygon",{points:"340,19.8 317,42.9 435.8,165.7 317,288.6 340,311.6 481.9,165.7 "})),y=[{supports:{className:!1},attributes:{code:{type:"string",source:"text",selector:"code"},className:{type:"string",default:""},langType:{type:"string",default:""},langName:{type:"string",default:""},fileName:{type:"string",default:""},dataLineNum:{type:"string",default:""},isLineShow:{type:"string",default:"undefined"},isShowLang:{type:"string",default:""}},save:({attributes:e})=>{const{code:a,fileName:l,langName:o,dataLineNum:r,isLineShow:c,isShowLang:i}=e,u=e.langType||"plain";let d=s()("prism",`lang-${u}`);return"undefined"!==c&&(d=s()(d,`${c}-numbers`)),(0,t.createElement)("div",{className:"hcb_wrap"},(0,t.createElement)("pre",{className:d,"data-file":l||null,"data-lang":o||null,"data-line":r||null,"data-show-lang":i||null},(0,t.createElement)(n.RichText.Content,{tagName:"code",value:h(a)})))}},{supports:{className:!1},attributes:{code:{type:"string",source:"text",selector:"code"},className:{type:"string",default:""},langType:{type:"string",default:"plane"},langName:{type:"string",default:""},fileName:{type:"string",default:""},dataLineNum:{type:"string",default:""},isLineShow:{type:"string",default:"undefined"},isShowLang:{type:"string",default:""}},migrate:e=>("plane"===e.langType&&(e.langType=""),e),save:({attributes:e})=>{const{code:a,langType:l,fileName:o,langName:r,dataLineNum:c,isLineShow:s,isShowLang:i}=e,u="prism "+s+"-numbers lang-"+l;return(0,t.createElement)("div",{className:"hcb_wrap"},(0,t.createElement)("pre",{className:u,"data-file":o||null,"data-lang":r||null,"data-line":c||null,"data-show-lang":i||null},(0,t.createElement)(n.RichText.Content,{tagName:"code",value:h(a)})))}}];(0,e.registerBlockType)(b.u2,{icon:f,transforms:{from:[{type:"block",blocks:["core/code"],transform:t=>(0,e.createBlock)("loos-hcb/code-block",{code:t.content})}],to:[{type:"block",blocks:["core/code"],transform:t=>(0,e.createBlock)("core/code",{content:t.code})}]},edit:({attributes:e,setAttributes:a,clientId:c})=>{const h=(0,r.useRef)(),{className:b,code:f="",langType:y,fileName:v,langName:w,dataLineNum:N,dataStart:E,isShowLang:_,isLineShow:S}=e,[L,x]=(0,r.useState)(g(f)),C=s()("hcb-block","hcb_wrap");(0,r.useEffect)((()=>{const e=b||"";if(!e)return;const t=e.split(" "),l=[...new Set(t)];a({className:s()(l)})}),[b,a]),(0,r.useEffect)((()=>{const{ownerDocument:e}=h.current;if(e){const t=e.querySelector(`#block-${c}`),a=t.querySelector(".hcb_textarea");if(t.style.setProperty("--hcb--code-linenum",L),a.scrollWidth>a.offsetWidth){const e=a.offsetHeight-a.clientHeight;t.style.setProperty("--hcb--scbarH",e+"px")}}}),[c,L]);let T="0";("1"===_||""===_&&"on"===i)&&(T="1");let k=null;("on"===S||"undefined"===S&&"on"===u)&&(k="1");const P=(0,n.useBlockProps)({ref:h,className:C,"data-file":v||null,"data-lang":w||null,"data-show-lang":T,"data-show-linenum":k}),B=[...p];return y||B.shift(),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n.BlockControls,null,(0,t.createElement)(o.ToolbarGroup,{isCollapsed:!0,icon:(0,t.createElement)(t.Fragment,null,w||(0,l.__)("Language","loos-hcb")),title:"Lnaguage",controls:B.map((([e,t])=>({key:e,isActive:e===y,title:t,onClick:()=>{a("plain"===e?{langType:"",langName:""}:{langType:e,langName:t})}})))})),(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(o.PanelBody,{title:(0,l.__)("HCB settings","loos-hcb"),initialOpen:!0},(0,t.createElement)(o.SelectControl,{label:(0,l.__)("Language","loos-hcb"),value:e.langType,options:m,onChange:e=>{a(""===e?{langType:"",langName:""}:{langType:e,langName:d[e]})}}),(0,t.createElement)(o.SelectControl,{label:(0,l.__)("Display number of rows","loos-hcb"),value:S,options:[{label:(0,l.__)("Do not set individually","loos-hcb"),value:"undefined"},{label:(0,l.__)("Display row count","loos-hcb"),value:"on"},{label:(0,l.__)("Do not display row count","loos-hcb"),value:"off"}],onChange:e=>{a({isLineShow:e})}}),(0,t.createElement)(o.SelectControl,{label:(0,l.__)("Display language name","loos-hcb"),value:_,options:[{label:(0,l.__)("Do not set individually","loos-hcb"),value:""},{label:(0,l.__)("Display language","loos-hcb"),value:"1"},{label:(0,l.__)("Do not display language","loos-hcb"),value:"0"}],onChange:e=>{a({isShowLang:e})}}),(0,t.createElement)(o.TextControl,{label:(0,l.__)("File name","loos-hcb"),value:v,onChange:e=>{a({fileName:e})}}),(0,t.createElement)(o.TextControl,{label:(0,t.createElement)(t.Fragment,null,(0,l.__)("Highlight Number","loos-hcb")+" ( ",(0,t.createElement)("code",{className:"hcb-code-in-label"},"[data-line]")," )"),value:N,onChange:e=>{a({dataLineNum:e})}}),(0,t.createElement)(o.TextControl,{type:"number",label:(0,t.createElement)(t.Fragment,null,(0,l.__)("First line number","loos-hcb")+" ( ",(0,t.createElement)("code",{className:"hcb-code-in-label"},"[data-start]")," )"),value:E||1,onChange:e=>{a({dataStart:parseInt(e||1)})},style:{opacity:k?1:.5},disabled:!k}))),(0,t.createElement)("div",{...P},(0,t.createElement)("div",{className:"hcb_codewrap"},k&&(0,t.createElement)("div",{className:"hcb_linenum"},(0,t.createElement)("div",{className:"hcb-startNum"},E)),(0,t.createElement)("textarea",{className:"hcb_textarea",placeholder:"Your Code...",value:f,onChange:e=>{const t=e.target.value;a({code:t});const l=g(t);L!==l&&x(l)}}),N&&(0,t.createElement)("div",{className:"hcb-datapreview"},(0,t.createElement)("div",{className:"hcb-datapreview__items"},`{${N}}`)))))},save:({attributes:e})=>{const{code:a,fileName:l,langName:o,dataLineNum:r,dataStart:c,isLineShow:i,isShowLang:u}=e,d=e.langType||"plain",p=s()("prism",`${i}-numbers`,`lang-${d}`),m=n.useBlockProps.save({className:"hcb_wrap"});return(0,t.createElement)("div",{...m},(0,t.createElement)("pre",{className:p,"data-file":l||null,"data-lang":o||null,"data-line":r||null,"data-start":1===c?null:c,"data-show-lang":u||null},(0,t.createElement)(n.RichText.Content,{tagName:"code",value:h(a)})))},deprecated:y})})()})();1 (()=>{var e={184:(e,t)=>{var a;!function(){"use strict";var l={}.hasOwnProperty;function n(){for(var e=[],t=0;t<arguments.length;t++){var a=arguments[t];if(a){var o=typeof a;if("string"===o||"number"===o)e.push(a);else if(Array.isArray(a)){if(a.length){var r=n.apply(null,a);r&&e.push(r)}}else if("object"===o){if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]")){e.push(a.toString());continue}for(var c in a)l.call(a,c)&&a[c]&&e.push(c)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):void 0===(a=function(){return n}.apply(t,[]))||(e.exports=a)}()}},t={};function a(l){var n=t[l];if(void 0!==n)return n.exports;var o=t[l]={exports:{}};return e[l](o,o.exports,a),o.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var l in t)a.o(t,l)&&!a.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.blocks,t=window.React,l=window.wp.i18n,n=window.wp.blockEditor,o=window.wp.components,r=window.wp.element;var c=a(184),s=a.n(c);const i=window.hcbVars?.showLang,u=window.hcbVars?.showLinenum;let d=window?.hcbLangs||null;const p=[["plain","Plain"],...Object.entries(d)],m=[{value:"",label:"Plain"},...Object.entries(d).map((([e,t])=>({value:e,label:t})))],g=(e="")=>{const t=e.match(/\r\n|\n/g);return null!==t?t.length+1:1};function h(e){return e?e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):e}const b=JSON.parse('{"u2":"loos-hcb/code-block"}'),f=(0,t.createElement)("svg",{x:"0px",y:"0px",viewBox:"0 0 512 512"},(0,t.createElement)("g",null,(0,t.createElement)("path",{d:"M54.4,348.2H89v51h31.2v-51h34.6V484h-34.6v-54.6H89v54.5H54.4V348.2z"}),(0,t.createElement)("path",{d:"M267.5,345.7c17.5,0,31.6,8.3,41,17.3l-19,21.6c-6.2-5.6-12.8-9.2-22-9.2c-17.3,0-30.5,15.2-30.5,40.4 c0,26.1,13.2,40.6,32,40.6c9,0,16.4-4.5,22.4-11.1l19,21.1c-11.5,13.4-26.7,19.9-43.4,19.9c-35.3,0-65.4-23.1-65.4-69.4 C201.6,371.7,230.9,345.7,267.5,345.7z"}),(0,t.createElement)("path",{d:"M356.5,348.2h44.4c28.2,0,50.6,7.1,50.6,33.7c0,11.8-7.1,25.4-22.9,29.5v0.8c19.2,3.6,29,13.7,29,31.8 c0,28-23.1,40-52.6,40h-48.5V348.2z M399.8,402c12.6,0,17.7-6,17.7-14.9c0-8.6-5.3-12.2-17.7-12.2h-8.5V402H399.8z M402.3,457.2 c14.7,0,21.1-5.5,21.1-16.2c0-10.5-6.4-14.9-21.1-14.9h-11.1v31h11.1V457.2z"})),(0,t.createElement)("polygon",{points:"172,311.6 195,288.6 76.2,165.7 195,42.9 172,19.8 30.1,165.7 "}),(0,t.createElement)("polygon",{points:"340,19.8 317,42.9 435.8,165.7 317,288.6 340,311.6 481.9,165.7 "})),y=[{supports:{className:!1},attributes:{code:{type:"string",source:"text",selector:"code"},className:{type:"string",default:""},langType:{type:"string",default:""},langName:{type:"string",default:""},fileName:{type:"string",default:""},dataLineNum:{type:"string",default:""},isLineShow:{type:"string",default:"undefined"},isShowLang:{type:"string",default:""}},save:({attributes:e})=>{const{code:a,fileName:l,langName:o,dataLineNum:r,isLineShow:c,isShowLang:i}=e,u=e.langType||"plain";let d=s()("prism",`lang-${u}`);return"undefined"!==c&&(d=s()(d,`${c}-numbers`)),(0,t.createElement)("div",{className:"hcb_wrap"},(0,t.createElement)("pre",{className:d,"data-file":l||null,"data-lang":o||null,"data-line":r||null,"data-show-lang":i||null},(0,t.createElement)(n.RichText.Content,{tagName:"code",value:h(a)})))}},{supports:{className:!1},attributes:{code:{type:"string",source:"text",selector:"code"},className:{type:"string",default:""},langType:{type:"string",default:"plane"},langName:{type:"string",default:""},fileName:{type:"string",default:""},dataLineNum:{type:"string",default:""},isLineShow:{type:"string",default:"undefined"},isShowLang:{type:"string",default:""}},migrate:e=>("plane"===e.langType&&(e.langType=""),e),save:({attributes:e})=>{const{code:a,langType:l,fileName:o,langName:r,dataLineNum:c,isLineShow:s,isShowLang:i}=e,u="prism "+s+"-numbers lang-"+l;return(0,t.createElement)("div",{className:"hcb_wrap"},(0,t.createElement)("pre",{className:u,"data-file":o||null,"data-lang":r||null,"data-line":c||null,"data-show-lang":i||null},(0,t.createElement)(n.RichText.Content,{tagName:"code",value:h(a)})))}}];(0,e.registerBlockType)(b.u2,{icon:f,transforms:{from:[{type:"block",blocks:["core/code"],transform:t=>(0,e.createBlock)("loos-hcb/code-block",{code:t.content})}],to:[{type:"block",blocks:["core/code"],transform:t=>(0,e.createBlock)("core/code",{content:t.code})}]},edit:({attributes:e,setAttributes:a,clientId:c})=>{const h=(0,r.useRef)(),{className:b,code:f="",langType:y,fileName:v,langName:w,dataLineNum:N,dataStart:E,isShowLang:_,isLineShow:S}=e,[L,x]=(0,r.useState)(g(f)),C=s()("hcb-block","hcb_wrap");(0,r.useEffect)((()=>{const e=b||"";if(!e)return;const t=e.split(" "),l=[...new Set(t)];a({className:s()(l)})}),[b,a]),(0,r.useEffect)((()=>{const{ownerDocument:e}=h.current;if(e){const t=e.querySelector(`#block-${c}`),a=t.querySelector(".hcb_textarea");if(t.style.setProperty("--hcb--code-linenum",L),a.scrollWidth>a.offsetWidth){const e=a.offsetHeight-a.clientHeight;t.style.setProperty("--hcb--scbarH",e+"px")}}}),[c,L]);let T="0";("1"===_||""===_&&"on"===i)&&(T="1");let k=null;("on"===S||"undefined"===S&&"on"===u)&&(k="1");const P=(0,n.useBlockProps)({ref:h,className:C,"data-file":v||null,"data-lang":w||null,"data-show-lang":T,"data-show-linenum":k}),B=[...p];return y||B.shift(),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(n.BlockControls,null,(0,t.createElement)(o.ToolbarGroup,{isCollapsed:!0,icon:(0,t.createElement)(t.Fragment,null,w||(0,l.__)("Language","loos-hcb")),title:"Lnaguage",controls:B.map((([e,t])=>({key:e,isActive:e===y,title:t,onClick:()=>{a("plain"===e?{langType:"",langName:""}:{langType:e,langName:t})}})))})),(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(o.PanelBody,{title:(0,l.__)("HCB settings","loos-hcb"),initialOpen:!0},(0,t.createElement)(o.SelectControl,{label:(0,l.__)("Language","loos-hcb"),value:e.langType,options:m,onChange:e=>{a(""===e?{langType:"",langName:""}:{langType:e,langName:d[e]})}}),(0,t.createElement)(o.SelectControl,{label:(0,l.__)("Display s","loos-hcb"),value:S,options:[{label:(0,l.__)("Do not set individually","loos-hcb"),value:"undefined"},{label:(0,l.__)("Display row count","loos-hcb"),value:"on"},{label:(0,l.__)("Do not display row count","loos-hcb"),value:"off"}],onChange:e=>{a({isLineShow:e})}}),(0,t.createElement)(o.SelectControl,{label:(0,l.__)("Display language name","loos-hcb"),value:_,options:[{label:(0,l.__)("Do not set individually","loos-hcb"),value:""},{label:(0,l.__)("Display language","loos-hcb"),value:"1"},{label:(0,l.__)("Do not display language","loos-hcb"),value:"0"}],onChange:e=>{a({isShowLang:e})}}),(0,t.createElement)(o.TextControl,{label:(0,l.__)("File name","loos-hcb"),value:v,onChange:e=>{a({fileName:e})}}),(0,t.createElement)(o.TextControl,{label:(0,t.createElement)(t.Fragment,null,(0,l.__)("Highlight Number","loos-hcb")+" ( ",(0,t.createElement)("code",{className:"hcb-code-in-label"},"[data-line]")," )"),value:N,onChange:e=>{a({dataLineNum:e})}}),(0,t.createElement)(o.TextControl,{type:"number",label:(0,t.createElement)(t.Fragment,null,(0,l.__)("First line number","loos-hcb")+" ( ",(0,t.createElement)("code",{className:"hcb-code-in-label"},"[data-start]")," )"),value:E||1,onChange:e=>{a({dataStart:parseInt(e||1)})},style:{opacity:k?1:.5},disabled:!k}))),(0,t.createElement)("div",{...P},(0,t.createElement)("div",{className:"hcb_codewrap"},k&&(0,t.createElement)("div",{className:"hcb_linenum"},(0,t.createElement)("div",{className:"hcb-startNum"},E)),(0,t.createElement)("textarea",{className:"hcb_textarea",placeholder:"Your Code...",value:f,onChange:e=>{const t=e.target.value;a({code:t});const l=g(t);L!==l&&x(l)}}),N&&(0,t.createElement)("div",{className:"hcb-datapreview"},(0,t.createElement)("div",{className:"hcb-datapreview__items"},`{${N}}`)))))},save:({attributes:e})=>{const{code:a,fileName:l,langName:o,dataLineNum:r,dataStart:c,isLineShow:i,isShowLang:u}=e,d=e.langType||"plain",p=s()("prism",`${i}-numbers`,`lang-${d}`),m=n.useBlockProps.save({className:"hcb_wrap"});return(0,t.createElement)("div",{...m},(0,t.createElement)("pre",{className:p,"data-file":l||null,"data-lang":o||null,"data-line":r||null,"data-start":1===c?null:c,"data-show-lang":u||null},(0,t.createElement)(n.RichText.Content,{tagName:"code",value:h(a)})))},deprecated:y})})()})(); -
highlighting-code-block/trunk/highlighting-code-block.php
r2994656 r2994709 4 4 * Plugin URI: https://wordpress.org/plugins/highlighting-code-block/ 5 5 * Description: Add code block with syntax highlighting using prism.js. (Available for Gutenberg and Classic Editor) 6 * Version: 2.0. 06 * Version: 2.0. 7 7 * Requires at least: 5.6 8 8 * Author: LOOS, Inc. -
highlighting-code-block/trunk/languages/loos-hcb-ja-hcb-blocks.json
r2994656 r2994709 1 {"domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural_forms":"nplurals=1; plural=0;","lang":"ja_JP"}," HCB settings":["HCB設定"],"Language":["言語"],"Display number of rows":["行数の表示"],"Do not set individually":["個別で設定はしない"],"Display row count":["行数を表示する"],"Do not display row count":["行数を表示しない"],"Display language name":["言語の表示"],"Display language":["言語を表示する"],"Do not display language":["言語を表示しない"],"File name":["ファイル名"],"Highlight Number":["ハイライトする行番号"],"First line number":["開始行番号"],"[HCB] Settings":["[HCB] 設定"],"Basic settings":["基本設定"],"Display language name in code block":["コードブロックに言語名を表示する"],"If checked, the language type is displayed in the code on the site display side.":["チェックすると、サイト表示側のコードに言語の種類が表示されます。"],"Display settings for the number of rows":["行数の表示設定"],"Show line count in code block":["コードブロックに行数を表示する"],"If checked, the number of lines will be displayed on the left end of the code on the site display side.":["チェックすると、サイト表示側のコードの左端に行数が表示されます。"],"Copy button":["コピーボタン"],"Show copy button in code block":["コードブロックにコピーボタンを表示する"],"Font smoothing":["フォントスムージング"],"Turn on font smoothing":["フォントスムージングをオンにする"],"Add %s and %s to the code block.":["コードブロックに %s と %s が追加されます。"],"Cord coloring (front side)":["コードカラーリング(フロント側)"],"Code coloring (editor side)":["コードカラーリング(エディター側)"],"Font Size":["フォントサイズ"],"\"Font-family\" in code":["コードの “font-family”"],"Advanced settings":["高度な設定"],"When you use each original file, please upload it in the theme folder.":["各独自ファイルを使用する場合は、テーマフォルダの中にアップロードしてください。"],"If you set the path to your own file, the default coloring file and prism.js file will not be loaded..":["独自ファイルへのパス��設定すると、デフォルトのカラーリングファイルやprism.jsファイルは読み込まれなくなります。"],"* The currently loaded prism.js file can be downloaded at %s.":["※ 現在読み込んでいるprism.jsファイルは、 %s でダウンロードできます。"],"Here":["こちら"],"Language set to use":["使用する言語セット"],"Write in the format of %s, separated by \",\" (comma).":["%s の形式で、”,”(カンマ)区切りで記述してください。"],"class-key:\"language-name\"":["クラスキー:”言語名”"],"\"class-key\" is the class name used in prism.js (the part corresponding to \"◯◯\" in \"lang- ◯◯\")":["「クラスキー」は、prism.jsで使用されるクラス名(「lang-◯◯」の「◯◯」に該当する部分)です。"],"* If you use a language that is not supported by default, please use it together with \"Original prism.js\" setting.":["※ デフォルトでサポートされていない言語を使用する場合、「独自prism.js」設定と併用してください。"],"Original coloring file":["独自カラーリングファイル"],"Load your own CSS file for code coloring.":["あなたが用意したコードカラーリング用のCSSファイルを読み込みます。"],"Original prism.js":["独自prism.js"],"You can use the prism.js file corresponding to your own language set.":["自分専用の言語セットに対応したprism.jsファイルを使用できます。"],"help":["ヘルプ"],"Highlighting Code Block settings":["Highlighting Code Block 設定"],"Copy code to clipboard":["コードをクリップボードにコピーする"],"Highlighting Code Block":["Highlighting Code Block"],"https://wordpress.org/plugins/highlighting-code-block/":["https://wordpress.org/plugins/highlighting-code-block/"],"Add code block with syntax highlighting using prism.js. (Available for Gutenberg and Classic Editor)":["prism.js を使用したシンタックスハイライト機能付きのコードブロックを追加します。(Gutenbergとクラシックエディター共に利用可能)"],"LOOS, Inc.":["LOOS, Inc."],"https://loos-web-studio.com/":["https://loos-web-studio.com/"]}}}1 {"domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural_forms":"nplurals=1; plural=0;","lang":"ja_JP"},"s":["行数の表示"],"Do not set individually":["個別で設定はしない"],"Display row count":["行数を表示する"],"Do not display row count":["行数を表示しない"],"Display language name":["言語の表示"],"Display language":["言語を表示する"],"Do not display language":["言語を表示しない"],"File name":["ファイル名"],"Highlight Number":["ハイライトする行番号"],"First line number":["開始行番号"],"[HCB] Settings":["[HCB] 設定"],"Basic settings":["基本設定"],"Display language name in code block":["コードブロックに言語名を表示する"],"If checked, the language type is displayed in the code on the site display side.":["チェックすると、サイト表示側のコードに言語の種類が表示されます。"],"Display settings for the number of rows":["行数の表示設定"],"Show line count in code block":["コードブロックに行数を表示する"],"If checked, the number of lines will be displayed on the left end of the code on the site display side.":["チェックすると、サイト表示側のコードの左端に行数が表示されます。"],"Copy button":["コピーボタン"],"Show copy button in code block":["コードブロックにコピーボタンを表示する"],"Font smoothing":["フォントスムージング"],"Turn on font smoothing":["フォントスムージングをオンにする"],"Add %s and %s to the code block.":["コードブロックに %s と %s が追加されます。"],"Cord coloring (front side)":["コードカラーリング(フロント側)"],"Code coloring (editor side)":["コードカラーリング(エディター側)"],"Font Size":["フォントサイズ"],"\"Font-family\" in code":["コードの “font-family”"],"Advanced settings":["高度な設定"],"When you use each original file, please upload it in the theme folder.":["各独自ファイルを使用する場合は、テーマフォルダの中にアップロードしてください。"],"If you set the path to your own file, the default coloring file and prism.js file will not be loaded..":["独自ファイルへのパスを設定すると、デフォルトのカラーリングファイルやprism.jsファイルは読み込まれなくなります。"],"* The currently loaded prism.js file can be downloaded at %s.":["※ 現在読み込んでいるprism.jsファイルは、 %s でダウンロードできます。"],"Here":["こちら"],"Language set to use":["使用する言語セット"],"Write in the format of %s, separated by \",\" (comma).":["%s の形式で、”,”(カンマ)区切りで記述してください。"],"class-key:\"language-name\"":["クラスキー:”言語名”"],"\"class-key\" is the class name used in prism.js (the part corresponding to \"◯◯\" in \"lang- ◯◯\")":["「クラスキー」は、prism.jsで使用されるクラス名(「lang-◯◯」の「◯◯」に該当する部分)です。"],"* If you use a language that is not supported by default, please use it together with \"Original prism.js\" setting.":["※ デフォルトでサポートされていない言語を使用する場合、「独自prism.js」設定と併用してください。"],"Original coloring file":["独自カラーリングファイル"],"Load your own CSS file for code coloring.":["あなたが用意したコードカラーリング用のCSSファイルを読み込みます。"],"Original prism.js":["独自prism.js"],"You can use the prism.js file corresponding to your own language set.":["自分専用の言語セットに対応したprism.jsファイルを使用できます。"],"help":["ヘルプ"],"Highlighting Code Block settings":["Highlighting Code Block 設定"],"Copy code to clipboard":["コードをクリップボードにコピーする"],"Highlighting Code Block":["Highlighting Code Block"],"https://wordpress.org/plugins/highlighting-code-block/":["https://wordpress.org/plugins/highlighting-code-block/"],"Add code block with syntax highlighting using prism.js. (Available for Gutenberg and Classic Editor)":["prism.js を使用したシンタックスハイライト機能付きのコードブロックを追加します。(Gutenbergとクラシックエディター共に利用可能)"],"LOOS, Inc.":["LOOS, Inc."],"https://loos-web-studio.com/":["https://loos-web-studio.com/"]}}} -
highlighting-code-block/trunk/languages/loos-hcb-ja.po
r2994656 r2994709 2 2 msgstr "" 3 3 "Project-Id-Version: Highlighting Code Block\n" 4 "POT-Creation-Date: 2023-11-1 0 00:11+0900\n"5 "PO-Revision-Date: 2023-11-1 0 00:12+0900\n"4 "POT-Creation-Date: 2023-11-1+0900\n" 5 "PO-Revision-Date: 2023-11-1+0900\n" 6 6 "Last-Translator: \n" 7 7 "Language-Team: \n" … … 11 11 "Content-Transfer-Encoding: 8bit\n" 12 12 "Plural-Forms: nplurals=1; plural=0;\n" 13 "X-Generator: Poedit 3. 2.2\n"13 "X-Generator: Poedit 3.\n" 14 14 "X-Poedit-Basepath: ..\n" 15 15 "X-Poedit-Flags-xgettext: --add-comments=translators:\n" … … 26 26 "X-Poedit-SearchPathExcluded-4: vendor\n" 27 27 28 #: src/js/code-block/edit.js:172 28 #: src/js/code-block/edit.js:168 src/js/code-block/edit.js:190 29 msgid "Language" 30 msgstr "言語" 31 32 #: src/js/code-block/edit.js:188 29 33 msgid "HCB settings" 30 34 msgstr "HCB設定" 31 35 32 #: src/js/code-block/edit.js:174 33 msgid "Language" 34 msgstr "言語" 35 36 #: src/js/code-block/edit.js:186 37 msgid "Display number of rows" 36 #: src/js/code-block/edit.js:202 37 msgid "Display line numbers" 38 38 msgstr "行数の表示" 39 39 40 #: src/js/code-block/edit.js: 190 src/js/code-block/edit.js:21140 #: src/js/code-block/edit.js: 41 41 msgid "Do not set individually" 42 42 msgstr "個別で設定はしない" 43 43 44 #: src/js/code-block/edit.js: 19444 #: src/js/code-block/edit.js: 45 45 msgid "Display row count" 46 46 msgstr "行数を表示する" 47 47 48 #: src/js/code-block/edit.js: 19848 #: src/js/code-block/edit.js: 49 49 msgid "Do not display row count" 50 50 msgstr "行数を表示しない" 51 51 52 #: src/js/code-block/edit.js:2 07class/loos_hcb_menu.php:3552 #: src/js/code-block/edit.js:2 class/loos_hcb_menu.php:35 53 53 msgid "Display language name" 54 54 msgstr "言語の表示" 55 55 56 #: src/js/code-block/edit.js:2 1556 #: src/js/code-block/edit.js:2 57 57 msgid "Display language" 58 58 msgstr "言語を表示する" 59 59 60 #: src/js/code-block/edit.js:2 1960 #: src/js/code-block/edit.js:2 61 61 msgid "Do not display language" 62 62 msgstr "言語を表示しない" 63 63 64 #: src/js/code-block/edit.js:2 2864 #: src/js/code-block/edit.js:2 65 65 msgid "File name" 66 66 msgstr "ファイル名" 67 67 68 #: src/js/code-block/edit.js:2 3868 #: src/js/code-block/edit.js:2 69 69 msgid "Highlight Number" 70 70 msgstr "ハイライトする行番号" 71 71 72 #: src/js/code-block/edit.js:2 5472 #: src/js/code-block/edit.js:2 73 73 msgid "First line number" 74 74 msgstr "開始行番号" … … 251 251 msgstr "https://loos-web-studio.com/" 252 252 253 254 255 253 256 #~ msgid "\"data-line\" value" 254 257 #~ msgstr "data-line属性値" -
highlighting-code-block/trunk/readme.txt
r2994656 r2994709 5 5 Requires at least: 5.6 6 6 Tested up to: 6.4 7 Stable tag: 2.0. 07 Stable tag: 2.0. 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 106 106 == Changelog == 107 107 108 109 110 108 111 = 2.0.0 = 109 112 - Support for WordPress 6.4. -
highlighting-code-block/trunk/src/js/code-block/edit.js
r2994656 r2994709 200 200 /> 201 201 <SelectControl 202 label={__('Display number of rows', 'loos-hcb')} // 行数の表示202 label={__('Display s', 'loos-hcb')} // 行数の表示 203 203 value={isLineShow} 204 204 options={[
Note: See TracChangeset
for help on using the changeset viewer.