Changeset 3222617
- Timestamp:
- 01/15/2025 06:24:32 AM (7 weeks ago)
- Location:
- snow-monkey-editor/trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
snow-monkey-editor/trunk/dist/css/editor.css
r3183004 r3222617 1 .sme-editor-block-presets{display:flex;flex-wrap:wrap;gap:8px}.sme-editor-block-presets__preset{display:flex;flex:100%;gap:8px;justify-content:space-between}.sme-editor-block-presets__preset .components-button.is-secondary{flex:1;justify-content:center}.sme-editor-block-presets-inserter .sme-editor-block-presets-inserter__title{font-weight:700;margin:0 0 8px}.sme-editor-block-presets-inserter__control{display:flex}.sme-editor-block-presets-inserter__control .components-base-control{display:flex;flex:1;margin:0 8px 0 0}.sme-editor-block-presets-inserter__control .components-base-control .components-base-control__field{display:flex;flex:1;margin:0}.sme-editor-block-presets+.sme-editor-block-presets-inserter{margin-top:1em}.sme-date-time-picker__action{display:flex;justify-content:space-between;margin-top:8px}.sme-date-time-picker__action .components-button{flex:0 0 auto}.sme-date-time-picker .components-datetime .components-datetime__date-help-button{display:none}.sme-date-time-picker [aria-label=Calendar]{left:50%;position:relative;transform:translateX(-50%)}[data-sme-tabindex]{opacity:.7;pointer-events:none!important;-webkit-user-select:none!important;user-select:none!important} .sme-hidden-by-role,[data-sme-tabindex] .components-drop-zone,[data-sme-tabindex] .components-resizable-box__handle,[data-sme-tabindex] .editor-block-contextual-toolbar,[data-sme-tabindex] .editor-block-list__block-edit:before,[data-sme-tabindex] .editor-block-list__insertion-point,[data-sme-tabindex] .editor-block-mover,[data-sme-tabindex] .editor-rich-text__inline-toolbar{display:none!important}@media not all and (min-width:640px){.sme-hidden-sm{opacity:.3!important}}@media (min-width:640px) and (max-width:1023.9px){.sme-hidden-md{opacity:.3!important}}@media (min-width:1024px){.sme-hidden-lg-up{opacity:.3!important}}.customize-control-sidebar_block_editor .sme-br,.editor-styles-wrapper .sme-br{display:inline;position:relative}@media (min-width:1024px){.customize-control-sidebar_block_editor .sme-br--disable\:desktop br,.editor-styles-wrapper .sme-br--disable\:desktop br{display:none}}@media (min-width:640px) and (max-width:1023.9px){.customize-control-sidebar_block_editor .sme-br--disable\:tablet br,.editor-styles-wrapper .sme-br--disable\:tablet br{display:none}}@media not all and (min-width:640px){.customize-control-sidebar_block_editor .sme-br--disable\:mobile br,.editor-styles-wrapper .sme-br--disable\:mobile br{display:none}}.customize-control-sidebar_block_editor .sme-br:before,.editor-styles-wrapper .sme-br:before{content:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="%23cd162c" stroke="%23fff" stroke-width="1.5" d="M7.212 11.922v-1.249h5.019c.839 0 1.519-.68 1.519-1.52V3.77a1.52 1.52 0 0 0-3.039 0v3.866h-3.5V4.826L5.994 5.8 2.532 8.568l-.733.586.733.586 3.461 2.767 1.219.975z"/></svg>');line-height:0;position:absolute;top:calc(50% - 6px);transition:opacity .2s}@media (min-width:1024px){.customize-control-sidebar_block_editor .sme-br--disable\:desktop:before,.editor-styles-wrapper .sme-br--disable\:desktop:before{opacity:0}.customize-control-sidebar_block_editor .sme-br--disable\:desktop:hover:before,.customize-control-sidebar_block_editor .sme-br--disable\:desktop[data-rich-text-format-boundary=true]:before,.editor-styles-wrapper .sme-br--disable\:desktop:hover:before,.editor-styles-wrapper .sme-br--disable\:desktop[data-rich-text-format-boundary=true]:before{opacity:1}}@media (min-width:640px) and (max-width:1023.9px){.customize-control-sidebar_block_editor .sme-br--disable\:tablet:before,.editor-styles-wrapper .sme-br--disable\:tablet:before{opacity:0}.customize-control-sidebar_block_editor .sme-br--disable\:tablet:hover:before,.customize-control-sidebar_block_editor .sme-br--disable\:tablet[data-rich-text-format-boundary=true]:before,.editor-styles-wrapper .sme-br--disable\:tablet:hover:before,.editor-styles-wrapper .sme-br--disable\:tablet[data-rich-text-format-boundary=true]:before{opacity:1}}@media not all and (min-width:640px){.customize-control-sidebar_block_editor .sme-br--disable\:mobile:before,.editor-styles-wrapper .sme-br--disable\:mobile:before{opacity:0}.customize-control-sidebar_block_editor .sme-br--disable\:mobile:hover:before,.customize-control-sidebar_block_editor .sme-br--disable\:mobile[data-rich-text-format-boundary=true]:before,.editor-styles-wrapper .sme-br--disable\:mobile:hover:before,.editor-styles-wrapper .sme-br--disable\:mobile[data-rich-text-format-boundary=true]:before{opacity:1}}.sme-popover .components-popover__content{max-height:none!important;min-width:260px;overflow:visible!important;padding:16px}.sme-popover .components-popover__content>*>*+*{margin-top:8px}.sme-popover .components-dropdown-content-wrapper{margin:0!important}.sme-popover .components-dropdown-content-wrapper .sme-popover__title{font-weight:700;margin-bottom:16px}.sme-popover .components-dropdown-content-wrapper>fieldset>:last-child{margin-bottom:0}.sme-popover--inline-font-size .components-font-size-picker{padding:0}.sme-popover--inline-font-size .components-font-size-picker__controls{margin-bottom:5px}.sme-popover--inline-font-size .components-custom-select-control__menu{max-height:200px}.sme-extension-tools-panel .block-editor-panel-color-gradient-settings__dropdown{justify-content:space-between;padding-bottom:12px;padding-top:12px}.sme-extension-tools-panel .block-editor-tools-panel-color-gradient-settings__item:first-child{border-top:1px solid #ddd}.sme-extension-panel .components-panel__icon{fill:var(--_light-color-gray)}.sme-extension-panel--enabled .components-panel__icon{fill:#cd162c}.components-dropdown-menu__menu-item.has-text.has-icon .dashicon{margin-right:8px}1 .sme-editor-block-presets{display:flex;flex-wrap:wrap;gap:8px}.sme-editor-block-presets__preset{display:flex;flex:100%;gap:8px;justify-content:space-between}.sme-editor-block-presets__preset .components-button.is-secondary{flex:1;justify-content:center}.sme-editor-block-presets-inserter .sme-editor-block-presets-inserter__title{font-weight:700;margin:0 0 8px}.sme-editor-block-presets-inserter__control{display:flex}.sme-editor-block-presets-inserter__control .components-base-control{display:flex;flex:1;margin:0 8px 0 0}.sme-editor-block-presets-inserter__control .components-base-control .components-base-control__field{display:flex;flex:1;margin:0}.sme-editor-block-presets+.sme-editor-block-presets-inserter{margin-top:1em}.sme-date-time-picker__action{display:flex;justify-content:space-between;margin-top:8px}.sme-date-time-picker__action .components-button{flex:0 0 auto}.sme-date-time-picker .components-datetime .components-datetime__date-help-button{display:none}.sme-date-time-picker [aria-label=Calendar]{left:50%;position:relative;transform:translateX(-50%)}[data-sme-tabindex]{opacity:.7;pointer-events:none!important;-webkit-user-select:none!important;user-select:none!important}[data-sme-tabindex] .components-drop-zone,[data-sme-tabindex] .components-resizable-box__handle,[data-sme-tabindex] .editor-block-contextual-toolbar,[data-sme-tabindex] .editor-block-list__block-edit:before,[data-sme-tabindex] .editor-block-list__insertion-point,[data-sme-tabindex] .editor-block-mover,[data-sme-tabindex] .editor-rich-text__inline-toolbar{display:none!important}.sme-popover--editing-lock fieldset{max-height:215px;overflow:auto;padding:3px}.sme-hidden-by-role{display:none!important}.sme-popover--hidden-by-role fieldset{max-height:215px;overflow:auto;padding:3px}@media not all and (min-width:640px){.sme-hidden-sm{opacity:.3!important}}@media (min-width:640px) and (max-width:1023.9px){.sme-hidden-md{opacity:.3!important}}@media (min-width:1024px){.sme-hidden-lg-up{opacity:.3!important}}.customize-control-sidebar_block_editor .sme-br,.editor-styles-wrapper .sme-br{display:inline;position:relative}@media (min-width:1024px){.customize-control-sidebar_block_editor .sme-br--disable\:desktop br,.editor-styles-wrapper .sme-br--disable\:desktop br{display:none}}@media (min-width:640px) and (max-width:1023.9px){.customize-control-sidebar_block_editor .sme-br--disable\:tablet br,.editor-styles-wrapper .sme-br--disable\:tablet br{display:none}}@media not all and (min-width:640px){.customize-control-sidebar_block_editor .sme-br--disable\:mobile br,.editor-styles-wrapper .sme-br--disable\:mobile br{display:none}}.customize-control-sidebar_block_editor .sme-br:before,.editor-styles-wrapper .sme-br:before{content:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="%23cd162c" stroke="%23fff" stroke-width="1.5" d="M7.212 11.922v-1.249h5.019c.839 0 1.519-.68 1.519-1.52V3.77a1.52 1.52 0 0 0-3.039 0v3.866h-3.5V4.826L5.994 5.8 2.532 8.568l-.733.586.733.586 3.461 2.767 1.219.975z"/></svg>');line-height:0;position:absolute;top:calc(50% - 6px);transition:opacity .2s}@media (min-width:1024px){.customize-control-sidebar_block_editor .sme-br--disable\:desktop:before,.editor-styles-wrapper .sme-br--disable\:desktop:before{opacity:0}.customize-control-sidebar_block_editor .sme-br--disable\:desktop:hover:before,.customize-control-sidebar_block_editor .sme-br--disable\:desktop[data-rich-text-format-boundary=true]:before,.editor-styles-wrapper .sme-br--disable\:desktop:hover:before,.editor-styles-wrapper .sme-br--disable\:desktop[data-rich-text-format-boundary=true]:before{opacity:1}}@media (min-width:640px) and (max-width:1023.9px){.customize-control-sidebar_block_editor .sme-br--disable\:tablet:before,.editor-styles-wrapper .sme-br--disable\:tablet:before{opacity:0}.customize-control-sidebar_block_editor .sme-br--disable\:tablet:hover:before,.customize-control-sidebar_block_editor .sme-br--disable\:tablet[data-rich-text-format-boundary=true]:before,.editor-styles-wrapper .sme-br--disable\:tablet:hover:before,.editor-styles-wrapper .sme-br--disable\:tablet[data-rich-text-format-boundary=true]:before{opacity:1}}@media not all and (min-width:640px){.customize-control-sidebar_block_editor .sme-br--disable\:mobile:before,.editor-styles-wrapper .sme-br--disable\:mobile:before{opacity:0}.customize-control-sidebar_block_editor .sme-br--disable\:mobile:hover:before,.customize-control-sidebar_block_editor .sme-br--disable\:mobile[data-rich-text-format-boundary=true]:before,.editor-styles-wrapper .sme-br--disable\:mobile:hover:before,.editor-styles-wrapper .sme-br--disable\:mobile[data-rich-text-format-boundary=true]:before{opacity:1}}.sme-popover .components-popover__content{max-height:none!important;min-width:260px;overflow:visible!important;padding:16px}.sme-popover .components-popover__content>*>*+*{margin-top:8px}.sme-popover .components-dropdown-content-wrapper{margin:0!important}.sme-popover .components-dropdown-content-wrapper .sme-popover__title{font-weight:700;margin-bottom:16px}.sme-popover .components-dropdown-content-wrapper>fieldset>:last-child{margin-bottom:0}.sme-popover--inline-font-size .components-font-size-picker{padding:0}.sme-popover--inline-font-size .components-font-size-picker__controls{margin-bottom:5px}.sme-popover--inline-font-size .components-custom-select-control__menu{max-height:200px}.sme-extension-tools-panel .block-editor-panel-color-gradient-settings__dropdown{justify-content:space-between;padding-bottom:12px;padding-top:12px}.sme-extension-tools-panel .block-editor-tools-panel-color-gradient-settings__item:first-child{border-top:1px solid #ddd;margin-top:0}.sme-extension-panel .components-panel__icon{fill:var(--_light-color-gray)}.sme-extension-panel--enabled .components-panel__icon{fill:#cd162c}.components-dropdown-menu__menu-item.has-text.has-icon .dashicon{margin-right:8px} -
snow-monkey-editor/trunk/dist/js/editor-extension.asset.php
r3203380 r3222617 1 <?php return array('dependencies' => array('lodash', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => ' f316e9027062501d9caf');1 <?php return array('dependencies' => array('lodash', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '51c2ee988c82eee19ae5'); -
snow-monkey-editor/trunk/dist/js/editor-extension.js
r3203380 r3222617 1 (()=>{var e={655:(e,t)=>{var n;!function(){"use strict";var s=function(){function e(){}function t(e,t){for(var n=t.length,s=0;s<n;++s)o(e,t[s])}e.prototype=Object.create(null);var n={}.hasOwnProperty,s=/\s+/;function o(e,o){if(o){var r=typeof o;"string"===r?function(e,t){for(var n=t.split(s),o=n.length,r=0;r<o;++r)e[n[r]]=!0}(e,o):Array.isArray(o)?t(e,o):"object"===r?function(e,t){if(t.toString===Object.prototype.toString||t.toString.toString().includes("[native code]"))for(var s in t)n.call(t,s)&&(e[s]=!!t[s]);else e[t.toString()]=!0}(e,o):"number"===r&&function(e,t){e[t]=!0}(e,o)}}return function(){for(var n=arguments.length,s=Array(n),o=0;o<n;o++)s[o]=arguments[o];var r=new e;t(r,s);var i=[];for(var a in r)r[a]&&i.push(a);return i.join(" ")}}();e.exports?(s.default=s,e.exports=s):void 0===(n=function(){return s}.apply(t,[]))||(e.exports=n)}()}},t={};function n(s){var o=t[s];if(void 0!==o)return o.exports;var r=t[s]={exports:{}};return e[s](r,r.exports,n),r.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(655),t=n.n(e);const s=window.wp.components,o=window.wp.blockEditor,r=window.wp.compose,i=window.wp.hooks,a=window.wp.i18n,l=window.lodash,d=window.wp.blocks,m=window.wp.element;function c(e,t){if("core/freeform"===e)return!1;const n=function(e){return(0,i.applyFilters)("SnowMonkeyEditor.extension.allowedNameSpaces",["core","snow-monkey-blocks"],e)}(t);return 0<n.filter((t=>0===e.indexOf(t))).length}function u(e,t){if(!e||!Object.keys(e).length)return!1;const n=function(e){return(0,i.applyFilters)("SnowMonkeyEditor.extension.allowedRoles",["administrator","editor","author","contributor"],e)}(t);return 0<e.roles.filter((e=>-1<n.indexOf(e))).length}const b=JSON.parse('{"smeIsHiddenSm":{"type":"boolean","default":false},"smeIsHiddenMd":{"type":"boolean","default":false},"smeIsHiddenLg":{"type":"boolean","default":false}}'),p=window.ReactJSXRuntime,g={resetAll:{},hasValue:e=>0<(0,l.compact)([e.attributes?.smeIsHiddenSm,e.attributes?.smeIsHiddenMd,e.attributes?.smeIsHiddenLg]).length,resetValue:e=>{e.setAttributes({smeIsHiddenSm:b.smeIsHiddenSm.default,smeIsHiddenMd:b.smeIsHiddenMd.default,smeIsHiddenLg:b.smeIsHiddenLg.default})},resetClassnames:()=>({"sme-hidden-sm":b.smeIsHiddenSm.default,"sme-hidden-md":b.smeIsHiddenMd.default,"sme-hidden-lg-up":b.smeIsHiddenLg.default}),label:(0,a.__)("Display setting (By window size)","snow-monkey-editor"),isShown:e=>{if(!u(snowmonkeyeditor?.currentUser,"hidden-by-size"))return!1;if(!c(e.name,"hidden-by-size"))return!1;const t=(0,d.getBlockType)(e.name);return!!t&&!!(0,d.hasBlockSupport)(t,"customClassName",!0)},Content:e=>{const{attributes:n,setAttributes:o}=e,{smeIsHiddenSm:r,smeIsHiddenMd:i,smeIsHiddenLg:l,className:d}=n;return(0,m.useEffect)((()=>{o({className:t()(d,{"sme-hidden-sm":r,"sme-hidden-md":i,"sme-hidden-lg-up":l})})}),[r,i,l]),(0,p.jsxs)(s.__experimentalVStack,{spacing:"16px",children:[(0,p.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Hide on smartphone size","snow-monkey-editor"),checked:r,onChange:e=>{o({smeIsHiddenSm:e})}}),(0,p.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Hide on tablet size","snow-monkey-editor"),checked:i,onChange:e=>{o({smeIsHiddenMd:e})}}),(0,p.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Hide on PC size","snow-monkey-editor"),checked:l,onChange:e=>{o({smeIsHiddenLg:e})}})]})}},h=window.wp.data,y=JSON.parse('{"smeIsHiddenRoles":{"type":"array","default":[]}}'),w=window.wp.dataControls,f={roles:{}},k={setRoles:e=>({type:"SET_ROLES",roles:e}),*fetchRoles(){const e=yield(0,w.apiFetch)({path:"/snow-monkey-editor/v1/roles"});return k.setRoles(e)}},_={*getRoles(){yield k.fetchRoles()}},x=(0,h.createReduxStore)("snow-monkey-editor/roles",{reducer:(e=f,t)=>"SET_ROLES"===t.type?{...e,roles:t.roles}:e,actions:k,selectors:{getRoles:e=>e.roles},controls:w.controls,resolvers:_});(0,h.register)(x);const j={resetAll:{},hasValue:e=>!e.attributes?.smeIsHiddenRoles||0<e.attributes?.smeIsHiddenRoles.length,resetValue:e=>{e.setAttributes({smeIsHiddenRoles:y.smeIsHiddenRoles.default})},resetClassnames:e=>{const t=e.attributes?.smeIsHiddenRoles||[],n={};return t.forEach((e=>{n[`sme-hidden-by-role--${e}`]=!1})),n},label:(0,a.__)("Display setting (By roles)","snow-monkey-editor"),isShown:e=>!!u(snowmonkeyeditor?.currentUser,"hidden-by-role")&&(!!c(e.name,"hidden-by-role")&&!!(0,d.getBlockType)(e.name)),Content:e=>{const{attributes:n,setAttributes:o}=e,{smeIsHiddenRoles:r,className:i}=n,d=(()=>{const e=(0,h.useSelect)((e=>{const t={...e(x).getRoles()};return{"sme-guest":{name:(0,a.__)("user is not logged in","snow-monkey-editor")},...t}}),[]);let t={};return snowmonkeyeditor?.currentUser?.roles?.includes("administrator")?t={...e}:Object.keys(e).forEach(((n,s)=>{const o=snowmonkeyeditor?.currentUser?.roles?.includes(n);o||(t[n]=Object.values(e)[s])})),t})();return(0,m.useEffect)((()=>{const e={};Object.keys(d).forEach((t=>{e[`sme-hidden-by-role--${t}`]=!1})),r.forEach((t=>{e[`sme-hidden-by-role--${t}`]=!0})),o({className:t()(i,{...e})})}),[r]),(0,p.jsx)(s.__experimentalVStack,{spacing:"16px",children:Object.keys(d).map((e=>{const t=(0,a.sprintf)(1 (()=>{var e={655:(e,t)=>{var n;!function(){"use strict";var s=function(){function e(){}function t(e,t){for(var n=t.length,s=0;s<n;++s)o(e,t[s])}e.prototype=Object.create(null);var n={}.hasOwnProperty,s=/\s+/;function o(e,o){if(o){var i=typeof o;"string"===i?function(e,t){for(var n=t.split(s),o=n.length,i=0;i<o;++i)e[n[i]]=!0}(e,o):Array.isArray(o)?t(e,o):"object"===i?function(e,t){if(t.toString===Object.prototype.toString||t.toString.toString().includes("[native code]"))for(var s in t)n.call(t,s)&&(e[s]=!!t[s]);else e[t.toString()]=!0}(e,o):"number"===i&&function(e,t){e[t]=!0}(e,o)}}return function(){for(var n=arguments.length,s=Array(n),o=0;o<n;o++)s[o]=arguments[o];var i=new e;t(i,s);var r=[];for(var a in i)i[a]&&r.push(a);return r.join(" ")}}();e.exports?(s.default=s,e.exports=s):void 0===(n=function(){return s}.apply(t,[]))||(e.exports=n)}()}},t={};function n(s){var o=t[s];if(void 0!==o)return o.exports;var i=t[s]={exports:{}};return e[s](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var s in t)n.o(t,s)&&!n.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(655),t=n.n(e);const s=window.wp.components,o=window.wp.blockEditor,i=window.wp.compose,r=window.wp.hooks,a=window.wp.i18n,l=window.lodash,d=window.wp.blocks,m=window.wp.element;function c(e,t){if("core/freeform"===e)return!1;const n=function(e){return(0,r.applyFilters)("SnowMonkeyEditor.extension.allowedNameSpaces",["core","snow-monkey-blocks"],e)}(t);return 0<n.filter((t=>0===e.indexOf(t))).length}function u(e,t){if(!e||!Object.keys(e).length)return!1;const n=function(e){return(0,r.applyFilters)("SnowMonkeyEditor.extension.allowedRoles",["administrator","editor","author","contributor"],e)}(t);return 0<e.roles.filter((e=>-1<n.indexOf(e))).length}const b=JSON.parse('{"smeIsHiddenSm":{"type":"boolean","default":false},"smeIsHiddenMd":{"type":"boolean","default":false},"smeIsHiddenLg":{"type":"boolean","default":false}}'),p=window.ReactJSXRuntime,h={resetAll:{},hasValue:e=>0<(0,l.compact)([e.attributes?.smeIsHiddenSm,e.attributes?.smeIsHiddenMd,e.attributes?.smeIsHiddenLg]).length,resetValue:e=>{e.setAttributes({smeIsHiddenSm:b.smeIsHiddenSm.default,smeIsHiddenMd:b.smeIsHiddenMd.default,smeIsHiddenLg:b.smeIsHiddenLg.default})},resetClassnames:()=>({"sme-hidden-sm":b.smeIsHiddenSm.default,"sme-hidden-md":b.smeIsHiddenMd.default,"sme-hidden-lg-up":b.smeIsHiddenLg.default}),label:(0,a.__)("Display setting (By window size)","snow-monkey-editor"),name:"hidden-by-size",isShown:e=>{if(!u(snowmonkeyeditor?.currentUser,"hidden-by-size"))return!1;if(!c(e.name,"hidden-by-size"))return!1;const t=(0,d.getBlockType)(e.name);return!!t&&!!(0,d.hasBlockSupport)(t,"customClassName",!0)},Content:e=>{const{attributes:n,setAttributes:o}=e,{smeIsHiddenSm:i,smeIsHiddenMd:r,smeIsHiddenLg:l,className:d}=n;return(0,m.useEffect)((()=>{o({className:t()(d,{"sme-hidden-sm":i,"sme-hidden-md":r,"sme-hidden-lg-up":l})})}),[i,r,l]),(0,p.jsxs)(s.__experimentalVStack,{spacing:"16px",children:[(0,p.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Hide on smartphone size","snow-monkey-editor"),checked:i,onChange:e=>{o({smeIsHiddenSm:e})}}),(0,p.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Hide on tablet size","snow-monkey-editor"),checked:r,onChange:e=>{o({smeIsHiddenMd:e})}}),(0,p.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Hide on PC size","snow-monkey-editor"),checked:l,onChange:e=>{o({smeIsHiddenLg:e})}})]})}},g=window.wp.data,y=JSON.parse('{"smeIsHiddenRoles":{"type":"array","default":[]}}'),w=window.wp.dataControls,f={roles:{}},k={setRoles:e=>({type:"SET_ROLES",roles:e}),*fetchRoles(){const e=yield(0,w.apiFetch)({path:"/snow-monkey-editor/v1/roles"});return k.setRoles(e)}},_={*getRoles(){yield k.fetchRoles()}},x=(0,g.createReduxStore)("snow-monkey-editor/roles",{reducer:(e=f,t)=>"SET_ROLES"===t.type?{...e,roles:t.roles}:e,actions:k,selectors:{getRoles:e=>e.roles},controls:w.controls,resolvers:_});(0,g.register)(x);const v={resetAll:{},hasValue:e=>!e.attributes?.smeIsHiddenRoles||0<e.attributes?.smeIsHiddenRoles.length,resetValue:e=>{e.setAttributes({smeIsHiddenRoles:y.smeIsHiddenRoles.default})},resetClassnames:e=>{const t=e.attributes?.smeIsHiddenRoles||[],n={};return t.forEach((e=>{n[`sme-hidden-by-role--${e}`]=!1})),n},label:(0,a.__)("Display setting (By roles)","snow-monkey-editor"),name:"hidden-by-role",isShown:e=>!!u(snowmonkeyeditor?.currentUser,"hidden-by-role")&&(!!c(e.name,"hidden-by-role")&&!!(0,d.getBlockType)(e.name)),Content:e=>{const{attributes:n,setAttributes:o}=e,{smeIsHiddenRoles:i,className:r}=n,d=(()=>{const e=(0,g.useSelect)((e=>{const t={...e(x).getRoles()};return{"sme-guest":{name:(0,a.__)("user is not logged in","snow-monkey-editor")},...t}}),[]);let t={};return snowmonkeyeditor?.currentUser?.roles?.includes("administrator")?t={...e}:Object.keys(e).forEach(((n,s)=>{const o=snowmonkeyeditor?.currentUser?.roles?.includes(n);o||(t[n]=Object.values(e)[s])})),t})();return(0,m.useEffect)((()=>{const e={};Object.keys(d).forEach((t=>{e[`sme-hidden-by-role--${t}`]=!1})),i.forEach((t=>{e[`sme-hidden-by-role--${t}`]=!0})),o({className:t()(r,{...e})})}),[i]),(0,p.jsx)(s.__experimentalVStack,{spacing:"16px",children:Object.keys(d).map((e=>{const t=(0,a.sprintf)( 2 2 // translators: %1$s: The role name 3 3 // translators: %1$s: The role name 4 (0,a.__)("Hide if %1$s","snow-monkey-editor"),d[e].name),n="object"==typeof r&&r.includes(e);return(0,p.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:t,checked:n,onChange:t=>{const n=((e,t)=>{let n=[...r];return!0===t?n.push(e):n=n.filter((t=>e!==t)),(0,l.uniq)(n)})(e,t);o({smeIsHiddenRoles:n})}},`sme-hidden-role-${e}`)}))})},Decorator:e=>{const{attributes:t,children:n}=e,{className:s,smeIsHiddenRoles:o=[]}=t;return s&&!snowmonkeyeditor?.currentUser?.roles?.includes("administrator")&&o.some((e=>snowmonkeyeditor?.currentUser?.roles?.includes(e)))?(0,p.jsx)("div",{className:"sme-hidden-by-role",children:n}):(0,p.jsx)(p.Fragment,{children:n})}},v=JSON.parse('{"smeAnimation":{"type":"string"},"smeAnimationDelay":{"type":"number","default":0},"smeAnimationDuration":{"type":"number"}}'),S=[{label:"",value:void 0},{label:(0,a.__)("bounce-in","snow-monkey-editor"),value:"bounce-in"},{label:(0,a.__)("bounce-down","snow-monkey-editor"),value:"bounce-down"},{label:(0,a.__)("fade-in","snow-monkey-editor"),value:"fade-in"},{label:(0,a.__)("fade-in-up","snow-monkey-editor"),value:"fade-in-up"},{label:(0,a.__)("fade-in-down","snow-monkey-editor"),value:"fade-in-down"},{label:(0,a.__)("fade-in-left","snow-monkey-editor"),value:"fade-in-left"},{label:(0,a.__)("fade-in-right","snow-monkey-editor"),value:"fade-in-right"}],A={resetAll:{},hasValue:e=>!!e.attributes?.smeAnimation,resetValue:e=>{e.setAttributes({smeAnimation:v.smeAnimation.default,smeAnimationDelay:v.smeAnimationDelay.default,smeAnimationDuration:v.smeAnimationDuration.default})},resetClassnames:e=>{const t={};return null!=e.attributes?.smeAnimation&&(t[`sme-animation-${e.attributes.smeAnimation}`]=!1),t},label:(0,a.__)("Animation","snow-monkey-editor"),isShown:e=>{if(!u(snowmonkeyeditor?.currentUser,"animation"))return!1;if(!c(e.name,"animation"))return!1;const t=(0,d.getBlockType)(e.name);return!!t&&!!(0,d.hasBlockSupport)(t,"customClassName",!0)},Content:e=>{const{attributes:n,setAttributes:o}=e,{smeAnimation:r,smeAnimationDelay:i,smeAnimationDuration:l,className:d}=n;return(0,m.useEffect)((()=>{const e={};S.forEach((t=>{e[`sme-animation-${t.value}`]=!1})),r&&(e[`sme-animation-${r}`]=!0),o({className:t()(d,{...e})})}),[r]),(0,p.jsxs)(s.__experimentalVStack,{spacing:"16px",children:[(0,p.jsx)(s.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Animation","snow-monkey-editor"),value:r||void 0,options:S,onChange:e=>{o({smeAnimation:e}),e||o({smeAnimationDelay:v.smeAnimationDelay.default})}}),(0,p.jsx)(s.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Delay","snow-monkey-editor"),value:i||0,onChange:e=>{o({smeAnimationDelay:e})},allowReset:!0,min:0,max:5,step:.1}),(0,p.jsx)(s.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Duration","snow-monkey-editor"),value:l||void 0,onChange:e=>{o({smeAnimationDuration:e})},allowReset:!0,min:0,max:5,step:.1})]})}},C=JSON.parse('{"smeStartDateTime":{"type":"string"},"smeEndDateTime":{"type":"string"}}'),H=window.wp.date;function I({currentDate:e,onChange:t,onReset:n}){const o=(0,H.getSettings)(),r=/a(?!\\)/i.test(o.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,p.jsxs)("div",{className:"sme-date-time-picker",children:[(0,p.jsx)(s.DateTimePicker,{currentDate:e,onChange:t,is12Hour:r}),(0,p.jsxs)("div",{className:"sme-date-time-picker__action",children:[(0,p.jsx)("div",{children:e}),(0,p.jsx)(s.Button,{isSmall:!0,onClick:n,children:(0,a.__)("Clear","snow-monkey-editor")})]})]})}const D=e=>!!u(snowmonkeyeditor?.currentUser,"date-time")&&(!!c(e.name,"date-time")&&!!(0,d.getBlockType)(e.name)),E={resetAll:{},hasValue:e=>!!e.attributes?.smeStartDateTime,resetValue:e=>e.setAttributes({smeStartDateTime:void 0}),label:(0,a.__)("Publish setting","snow-monkey-editor"),isShown:D,Content:e=>{const{attributes:t,setAttributes:n}=e,{smeStartDateTime:s}=t;return(0,p.jsx)(I,{currentDate:s,onChange:e=>n({smeStartDateTime:e}),onReset:()=>n({smeStartDateTime:void 0})})}},N={resetAll:{},hasValue:e=>!!e.attributes?.smeEndDateTime,resetValue:e=>e.setAttributes({smeEndDateTime:void 0}),label:(0,a.__)("Unpublish setting","snow-monkey-editor"),isShown:D,Content:e=>{const{attributes:t,setAttributes:n}=e,{smeEndDateTime:s}=t;return(0,p.jsx)(I,{currentDate:s,onChange:e=>n({smeEndDateTime:e}),onReset:()=>n({smeEndDateTime:void 0})})}},R=JSON.parse('{"smeIsEditingLockRoles":{"type":"array","default":[]}}'),T=e=>0<(0,l.intersection)(e.attributes.smeIsEditingLockRoles,snowmonkeyeditor?.currentUser?.roles).length,B={resetAll:{},hasValue:e=>!e.attributes?.smeIsEditingLockRoles||0<e.attributes?.smeIsEditingLockRoles.length,resetValue:e=>e.setAttributes({smeIsEditingLockRoles:[]}),label:(0,a.__)("Editing lock (By roles)","snow-monkey-editor"),isShown:e=>!!u(snowmonkeyeditor?.currentUser,"editing-lock")&&(!!c(e.name,"editing-lock")&&(!!(0,l.includes)(snowmonkeyeditor?.currentUser?.roles,"administrator")&&!!(0,d.getBlockType)(e.name))),Content:e=>{const{attributes:t,setAttributes:n,clientId:o}=e,{smeIsEditingLockRoles:r}=t,i=(0,h.useSelect)((e=>{const t={...e(x).getRoles()};return delete t.administrator,Object.keys(t).forEach((e=>{!0!==t[e].capabilities.edit_posts&&delete t[e]})),t}),[]),d=document.getElementById(`block-${o}`);if(d)if(T(e)){const e=d.getAttribute("tabindex");e&&(d.setAttribute("data-sme-tabindex",e),d.setAttribute("tabindex",-1))}else{const e=d.getAttribute("tabindex"),t=d.getAttribute("data-sme-tabindex");e&&t&&(d.setAttribute("tabindex",t),d.removeAttribute("data-sme-tabindex"))}return(0,p.jsx)(s.__experimentalVStack,{spacing:"16px",children:Object.keys(i).map((e=>{const t=(0,a.sprintf)(4 (0,a.__)("Hide if %1$s","snow-monkey-editor"),d[e].name),n="object"==typeof i&&i.includes(e);return(0,p.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:t,checked:n,onChange:t=>{const n=((e,t)=>{let n=[...i];return!0===t?n.push(e):n=n.filter((t=>e!==t)),(0,l.uniq)(n)})(e,t);o({smeIsHiddenRoles:n})}},`sme-hidden-role-${e}`)}))})},Decorator:e=>{const{attributes:t,children:n}=e,{className:s,smeIsHiddenRoles:o=[]}=t;return s&&!snowmonkeyeditor?.currentUser?.roles?.includes("administrator")&&o.some((e=>snowmonkeyeditor?.currentUser?.roles?.includes(e)))?(0,p.jsx)("div",{className:"sme-hidden-by-role",children:n}):(0,p.jsx)(p.Fragment,{children:n})}},j=JSON.parse('{"smeAnimation":{"type":"string"},"smeAnimationDelay":{"type":"number","default":0},"smeAnimationDuration":{"type":"number"}}'),S=[{label:"",value:void 0},{label:(0,a.__)("bounce-in","snow-monkey-editor"),value:"bounce-in"},{label:(0,a.__)("bounce-down","snow-monkey-editor"),value:"bounce-down"},{label:(0,a.__)("fade-in","snow-monkey-editor"),value:"fade-in"},{label:(0,a.__)("fade-in-up","snow-monkey-editor"),value:"fade-in-up"},{label:(0,a.__)("fade-in-down","snow-monkey-editor"),value:"fade-in-down"},{label:(0,a.__)("fade-in-left","snow-monkey-editor"),value:"fade-in-left"},{label:(0,a.__)("fade-in-right","snow-monkey-editor"),value:"fade-in-right"}],A={resetAll:{},hasValue:e=>!!e.attributes?.smeAnimation,resetValue:e=>{e.setAttributes({smeAnimation:j.smeAnimation.default,smeAnimationDelay:j.smeAnimationDelay.default,smeAnimationDuration:j.smeAnimationDuration.default})},resetClassnames:e=>{const t={};return null!=e.attributes?.smeAnimation&&(t[`sme-animation-${e.attributes.smeAnimation}`]=!1),t},label:(0,a.__)("Animation","snow-monkey-editor"),name:"animation",isShown:e=>{if(!u(snowmonkeyeditor?.currentUser,"animation"))return!1;if(!c(e.name,"animation"))return!1;const t=(0,d.getBlockType)(e.name);return!!t&&!!(0,d.hasBlockSupport)(t,"customClassName",!0)},Content:e=>{const{attributes:n,setAttributes:o}=e,{smeAnimation:i,smeAnimationDelay:r,smeAnimationDuration:l,className:d}=n;return(0,m.useEffect)((()=>{const e={};S.forEach((t=>{e[`sme-animation-${t.value}`]=!1})),i&&(e[`sme-animation-${i}`]=!0),o({className:t()(d,{...e})})}),[i]),(0,p.jsxs)(s.__experimentalVStack,{spacing:"16px",children:[(0,p.jsx)(s.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Animation","snow-monkey-editor"),value:i||void 0,options:S,onChange:e=>{o({smeAnimation:e}),e||o({smeAnimationDelay:j.smeAnimationDelay.default})}}),(0,p.jsx)(s.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Delay","snow-monkey-editor"),value:r||0,onChange:e=>{o({smeAnimationDelay:e})},allowReset:!0,min:0,max:5,step:.1}),(0,p.jsx)(s.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Duration","snow-monkey-editor"),value:l||void 0,onChange:e=>{o({smeAnimationDuration:e})},allowReset:!0,min:0,max:5,step:.1})]})}},C=JSON.parse('{"smeStartDateTime":{"type":"string"},"smeEndDateTime":{"type":"string"}}'),H=window.wp.date;function I({currentDate:e,onChange:t,onReset:n}){const o=(0,H.getSettings)(),i=/a(?!\\)/i.test(o.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,p.jsxs)("div",{className:"sme-date-time-picker",children:[(0,p.jsx)(s.DateTimePicker,{currentDate:e,onChange:t,is12Hour:i}),(0,p.jsxs)("div",{className:"sme-date-time-picker__action",children:[(0,p.jsx)("div",{children:e}),(0,p.jsx)(s.Button,{isSmall:!0,onClick:n,children:(0,a.__)("Clear","snow-monkey-editor")})]})]})}const D=e=>!!u(snowmonkeyeditor?.currentUser,"date-time")&&(!!c(e.name,"date-time")&&!!(0,d.getBlockType)(e.name)),E={resetAll:{},hasValue:e=>!!e.attributes?.smeStartDateTime,resetValue:e=>e.setAttributes({smeStartDateTime:void 0}),label:(0,a.__)("Publish setting","snow-monkey-editor"),name:"date-time",isShown:D,Content:e=>{const{attributes:t,setAttributes:n}=e,{smeStartDateTime:s}=t;return(0,p.jsx)(I,{currentDate:s,onChange:e=>n({smeStartDateTime:e}),onReset:()=>n({smeStartDateTime:void 0})})}},N={resetAll:{},hasValue:e=>!!e.attributes?.smeEndDateTime,resetValue:e=>e.setAttributes({smeEndDateTime:void 0}),label:(0,a.__)("Unpublish setting","snow-monkey-editor"),isShown:D,Content:e=>{const{attributes:t,setAttributes:n}=e,{smeEndDateTime:s}=t;return(0,p.jsx)(I,{currentDate:s,onChange:e=>n({smeEndDateTime:e}),onReset:()=>n({smeEndDateTime:void 0})})}},R=JSON.parse('{"smeIsEditingLockRoles":{"type":"array","default":[]}}'),T=e=>0<(0,l.intersection)(e.attributes.smeIsEditingLockRoles,snowmonkeyeditor?.currentUser?.roles).length,B={resetAll:{},hasValue:e=>!e.attributes?.smeIsEditingLockRoles||0<e.attributes?.smeIsEditingLockRoles.length,resetValue:e=>e.setAttributes({smeIsEditingLockRoles:[]}),label:(0,a.__)("Editing lock (By roles)","snow-monkey-editor"),name:"editing-lock",isShown:e=>!!u(snowmonkeyeditor?.currentUser,"editing-lock")&&(!!c(e.name,"editing-lock")&&(!!(0,l.includes)(snowmonkeyeditor?.currentUser?.roles,"administrator")&&!!(0,d.getBlockType)(e.name))),Content:e=>{const{attributes:t,setAttributes:n,clientId:o}=e,{smeIsEditingLockRoles:i}=t,r=(0,g.useSelect)((e=>{const t={...e(x).getRoles()};return delete t.administrator,Object.keys(t).forEach((e=>{!0!==t[e].capabilities.edit_posts&&delete t[e]})),t}),[]),d=document.getElementById(`block-${o}`);if(d)if(T(e)){const e=d.getAttribute("tabindex");e&&(d.setAttribute("data-sme-tabindex",e),d.setAttribute("tabindex",-1))}else{const e=d.getAttribute("tabindex"),t=d.getAttribute("data-sme-tabindex");e&&t&&(d.setAttribute("tabindex",t),d.removeAttribute("data-sme-tabindex"))}return(0,p.jsx)(s.__experimentalVStack,{spacing:"16px",children:Object.keys(r).map((e=>{const t=(0,a.sprintf)( 5 5 // translators: %1$s: The role name 6 6 // translators: %1$s: The role name 7 (0,a.__)("Edit lock if %1$s","snow-monkey-editor"), i[e].name),o="object"==typeof r&&r.includes(e);return(0,p.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:t,checked:o,onChange:t=>{const s=((e,t)=>{let n=[...r];return!0===t?n.push(e):n=n.filter((t=>e!==t)),(0,l.uniq)(n)})(e,t);n({smeIsEditingLockRoles:s})}},`sme-editing-lock-role-${e}`)}))})},Decorator:e=>T(e)?(0,p.jsx)(s.Disabled,{children:e.children}):(0,p.jsx)(p.Fragment,{children:e.children})},O=(0,p.jsx)("svg",{role:"img",focusable:"false",width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,p.jsx)("path",{d:"M13.982,16.711c-0.744,1.441 -2.248,2.428 -3.982,2.428c-1.735,0 -3.238,-0.986 -3.983,-2.428c0.909,-1.213 2.355,-2.002 3.983,-2.002c1.629,0 3.074,0.789 3.982,2.002Zm-0.748,-7.657c-0.314,2.56 1.248,2.919 1.248,5.603c0,0.467 -0.072,0.918 -0.205,1.344c-1.037,-1.203 -2.57,-1.967 -4.277,-1.967c-1.708,0 -3.24,0.764 -4.277,1.967c-0.133,-0.426 -0.205,-0.877 -0.205,-1.344c0,-2.684 1.563,-3.043 1.247,-5.603c-0.362,-2.928 -4.315,-2.465 -4.315,-5.334c0,-1.579 1.279,-2.858 2.858,-2.858c1.709,0 2.765,1.558 4.692,1.558c1.926,0 2.982,-1.558 4.691,-1.558c1.578,0 2.857,1.279 2.857,2.858c0.001,2.869 -3.952,2.406 -4.314,5.334Zm-4.677,-4.947l-0.708,0c0,0.498 -0.403,0.9 -0.901,0.9c-0.498,0 -0.901,-0.402 -0.901,-0.9l-0.708,0c0,0.889 0.72,1.609 1.609,1.609c0.889,0 1.609,-0.72 1.609,-1.609Zm0.979,7.141c0,-0.312 -0.253,-0.568 -0.566,-0.568c-0.313,0 -0.567,0.256 -0.567,0.568c0,0.312 0.254,0.566 0.567,0.566c0.313,0 0.566,-0.253 0.566,-0.566Zm2.062,0c0,-0.312 -0.254,-0.568 -0.568,-0.568c-0.312,0 -0.566,0.256 -0.566,0.568c0,0.312 0.254,0.566 0.566,0.566c0.314,0 0.568,-0.253 0.568,-0.566Zm3.062,-7.141l-0.707,0c0,0.498 -0.404,0.9 -0.9,0.9c-0.498,0 -0.902,-0.402 -0.902,-0.9l-0.707,0c0,0.889 0.721,1.609 1.609,1.609c0.886,0.001 1.607,-0.72 1.607,-1.609Z"})}),V=[g,j,A,E,N,B],M=(0,r.createHigherOrderComponent)((e=>n=>{const r=V.some((e=>e.isShown(n)));return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(e,{...n}),r&&(0,p.jsx)(o.InspectorControls,{children:(0,p.jsx)(s.__experimentalToolsPanel,{label:(0,a.__)("Snow Monkey Editor","snow-monkey-editor"),resetAll:()=>{V.forEach((e=>e.resetValue(n)));let e={};V.forEach((t=>{t?.resetClassnames&&(e={...e,...t.resetClassnames(n)})})),0<Object.values(e).length&&n.setAttributes({className:t()(n.attributes.className,{...e})})},className:"color-block-support-panel sme-extension-tools-panel",children:(0,p.jsx)("div",{className:"color-block-support-panel__inner-wrapper",style:{gridColumn:"1 / -1"},children:V.map(((e,o)=>e.isShown(n)&&(0,p.jsx)(s.__experimentalToolsPanelItem,{isShownByDefault:!1,hasValue:()=>!!e.hasValue(n),onDeselect:()=>{if(e.resetValue(n),e?.resetClassnames){const s={...e.resetClassnames(n)};n.setAttributes({className:t()(n.attributes.className,{...s})})}},label:e.label,className:t()("block-editor-tools-panel-color-gradient-settings__item",{first:0===o}),children:(0,p.jsx)(s.Dropdown,{popoverProps:{className:"sme-popover",placement:"left-start",offset:36,shift:!0},className:t()("block-editor-tools-panel-color-gradient-settings__dropdown","sme-extension-panel",{"sme-extension-panel--enabled":e.hasValue(n)}),renderToggle:({isOpen:t,onToggle:n})=>(0,p.jsxs)(s.Button,{onClick:n,"aria-expanded":t,className:"block-editor-panel-color-gradient-settings__dropdown",children:[e.label,(0,p.jsx)(s.Icon,{icon:O,className:"components-panel__icon",size:20})]}),renderContent:()=>(0,p.jsxs)(s.__experimentalDropdownContentWrapper,{paddingSize:"none",children:[(0,p.jsx)("div",{className:"sme-popover__title",children:e.label}),(0,p.jsx)("fieldset",{children:(0,p.jsx)(e.Content,{...n})})]})})},o)))})})})]})}),"addBlockControl");(0,i.addFilter)("blocks.registerBlockType","snow-monkey-editor/attributes",(e=>{var t;return t=e,(e=>u(snowmonkeyeditor?.currentUser,"editing-lock")&&c(e.name,"editing-lock")?(e.attributes={...e.attributes,...R},e):e)(e=(e=>u(snowmonkeyeditor?.currentUser,"date-time")&&c(e.name,"date-time")?(e.attributes={...e.attributes,...C},e):e)(e=(e=>u(snowmonkeyeditor?.currentUser,"animation")&&c(e.name,"animation")?(e.attributes={...e.attributes,...v},e):e)(e=(e=>u(snowmonkeyeditor?.currentUser,"hidden-by-role")&&c(e.name,"hidden-by-role")?(e.attributes={...e.attributes,...y},e):e)(e=u(snowmonkeyeditor?.currentUser,"hidden-by-size")&&c(t.name,"hidden-by-size")?(t.attributes={...t.attributes,...b},t):t))))})),(0,i.addFilter)("editor.BlockEdit","snow-monkey-editor/block-control",M,101),V&&V.forEach(((e,t)=>{(0,i.addFilter)("editor.BlockEdit",`snow-monkey-editor/block-edit-${t}`,(0,r.createHigherOrderComponent)((t=>n=>{const s=e?.Decorator;return s?(0,p.jsx)(s,{...n,children:(0,p.jsx)(t,{...n})}):(0,p.jsx)(t,{...n})})))}))})()})();7 (0,a.__)("Edit lock if %1$s","snow-monkey-editor"),r[e].name),o="object"==typeof i&&i.includes(e);return(0,p.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:t,checked:o,onChange:t=>{const s=((e,t)=>{let n=[...i];return!0===t?n.push(e):n=n.filter((t=>e!==t)),(0,l.uniq)(n)})(e,t);n({smeIsEditingLockRoles:s})}},`sme-editing-lock-role-${e}`)}))})},Decorator:e=>T(e)?(0,p.jsx)(s.Disabled,{children:e.children}):(0,p.jsx)(p.Fragment,{children:e.children})},O=(0,p.jsx)("svg",{role:"img",focusable:"false",width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,p.jsx)("path",{d:"M13.982,16.711c-0.744,1.441 -2.248,2.428 -3.982,2.428c-1.735,0 -3.238,-0.986 -3.983,-2.428c0.909,-1.213 2.355,-2.002 3.983,-2.002c1.629,0 3.074,0.789 3.982,2.002Zm-0.748,-7.657c-0.314,2.56 1.248,2.919 1.248,5.603c0,0.467 -0.072,0.918 -0.205,1.344c-1.037,-1.203 -2.57,-1.967 -4.277,-1.967c-1.708,0 -3.24,0.764 -4.277,1.967c-0.133,-0.426 -0.205,-0.877 -0.205,-1.344c0,-2.684 1.563,-3.043 1.247,-5.603c-0.362,-2.928 -4.315,-2.465 -4.315,-5.334c0,-1.579 1.279,-2.858 2.858,-2.858c1.709,0 2.765,1.558 4.692,1.558c1.926,0 2.982,-1.558 4.691,-1.558c1.578,0 2.857,1.279 2.857,2.858c0.001,2.869 -3.952,2.406 -4.314,5.334Zm-4.677,-4.947l-0.708,0c0,0.498 -0.403,0.9 -0.901,0.9c-0.498,0 -0.901,-0.402 -0.901,-0.9l-0.708,0c0,0.889 0.72,1.609 1.609,1.609c0.889,0 1.609,-0.72 1.609,-1.609Zm0.979,7.141c0,-0.312 -0.253,-0.568 -0.566,-0.568c-0.313,0 -0.567,0.256 -0.567,0.568c0,0.312 0.254,0.566 0.567,0.566c0.313,0 0.566,-0.253 0.566,-0.566Zm2.062,0c0,-0.312 -0.254,-0.568 -0.568,-0.568c-0.312,0 -0.566,0.256 -0.566,0.568c0,0.312 0.254,0.566 0.566,0.566c0.314,0 0.568,-0.253 0.568,-0.566Zm3.062,-7.141l-0.707,0c0,0.498 -0.404,0.9 -0.9,0.9c-0.498,0 -0.902,-0.402 -0.902,-0.9l-0.707,0c0,0.889 0.721,1.609 1.609,1.609c0.886,0.001 1.607,-0.72 1.607,-1.609Z"})}),V=[h,v,A,E,N,B],M=(0,i.createHigherOrderComponent)((e=>n=>{const i=V.some((e=>e.isShown(n)));return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(e,{...n}),i&&(0,p.jsx)(o.InspectorControls,{children:(0,p.jsx)(s.__experimentalToolsPanel,{label:(0,a.__)("Snow Monkey Editor","snow-monkey-editor"),resetAll:()=>{V.forEach((e=>e.resetValue(n)));let e={};V.forEach((t=>{t?.resetClassnames&&(e={...e,...t.resetClassnames(n)})})),0<Object.values(e).length&&n.setAttributes({className:t()(n.attributes.className,{...e})})},className:"color-block-support-panel sme-extension-tools-panel",children:(0,p.jsx)("div",{className:"color-block-support-panel__inner-wrapper",style:{gridColumn:"1 / -1"},children:V.map(((e,o)=>e.isShown(n)&&(0,p.jsx)(s.__experimentalToolsPanelItem,{isShownByDefault:!1,hasValue:()=>!!e.hasValue(n),onDeselect:()=>{if(e.resetValue(n),e?.resetClassnames){const s={...e.resetClassnames(n)};n.setAttributes({className:t()(n.attributes.className,{...s})})}},label:e.label,className:t()("block-editor-tools-panel-color-gradient-settings__item",{first:0===o}),children:(0,p.jsx)(s.Dropdown,{popoverProps:{className:`sme-popover sme-popover--${e.name}`,placement:"left-start",offset:36,shift:!0},className:t()("block-editor-tools-panel-color-gradient-settings__dropdown","sme-extension-panel",{"sme-extension-panel--enabled":e.hasValue(n)}),renderToggle:({isOpen:t,onToggle:n})=>(0,p.jsxs)(s.Button,{onClick:n,"aria-expanded":t,className:"block-editor-panel-color-gradient-settings__dropdown",children:[e.label,(0,p.jsx)(s.Icon,{icon:O,className:"components-panel__icon",size:20})]}),renderContent:()=>(0,p.jsxs)(s.__experimentalDropdownContentWrapper,{paddingSize:"none",children:[(0,p.jsx)("div",{className:"sme-popover__title",children:e.label}),(0,p.jsx)("fieldset",{children:(0,p.jsx)(e.Content,{...n})})]})})},o)))})})})]})}),"addBlockControl");(0,r.addFilter)("blocks.registerBlockType","snow-monkey-editor/attributes",(e=>{var t;return t=e,(e=>u(snowmonkeyeditor?.currentUser,"editing-lock")&&c(e.name,"editing-lock")?(e.attributes={...e.attributes,...R},e):e)(e=(e=>u(snowmonkeyeditor?.currentUser,"date-time")&&c(e.name,"date-time")?(e.attributes={...e.attributes,...C},e):e)(e=(e=>u(snowmonkeyeditor?.currentUser,"animation")&&c(e.name,"animation")?(e.attributes={...e.attributes,...j},e):e)(e=(e=>u(snowmonkeyeditor?.currentUser,"hidden-by-role")&&c(e.name,"hidden-by-role")?(e.attributes={...e.attributes,...y},e):e)(e=u(snowmonkeyeditor?.currentUser,"hidden-by-size")&&c(t.name,"hidden-by-size")?(t.attributes={...t.attributes,...b},t):t))))})),(0,r.addFilter)("editor.BlockEdit","snow-monkey-editor/block-control",M,101),V&&V.forEach(((e,t)=>{(0,r.addFilter)("editor.BlockEdit",`snow-monkey-editor/block-edit-${t}`,(0,i.createHigherOrderComponent)((t=>n=>{const s=e?.Decorator;return s?(0,p.jsx)(s,{...n,children:(0,p.jsx)(t,{...n})}):(0,p.jsx)(t,{...n})})))}))})()})(); -
snow-monkey-editor/trunk/dist/js/editor.asset.php
r3183004 r3222617 1 <?php return array('dependencies' => array('lodash', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-preferences', 'wp-rich-text'), 'version' => ' c431b2729375cf5279a5');1 <?php return array('dependencies' => array('lodash', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-preferences', 'wp-rich-text'), 'version' => 'e419d1507c00ba4d3f93'); -
snow-monkey-editor/trunk/dist/js/editor.js
r3183004 r3222617 1 (()=>{var e={558:e=>{"use strict";var t=function(e){return parseInt(e,16)};e.exports=function(e,o){var n,s,r=function(e){return"#"===e.charAt(0)?e.slice(1):e}(e),i=function(e){var o=e.g,n=e.b,s=e.a;return{r:t(e.r),g:t(o),b:t(n),a:+(t(s)/255).toFixed(2)}}({r:(s=3===(n=r).length||4===n.length)?"".concat(n.slice(0,1)).concat(n.slice(0,1)):n.slice(0,2),g:s?"".concat(n.slice(1,2)).concat(n.slice(1,2)):n.slice(2,4),b:s?"".concat(n.slice(2,3)).concat(n.slice(2,3)):n.slice(4,6),a:(s?"".concat(n.slice(3,4)).concat(n.slice(3,4)):n.slice(6,8))||"ff"});return function(e,t){var o,n=e.r,s=e.g,r=e.b,i=e.a,a=(o=t,!isNaN(parseFloat(o))&&isFinite(o)?t:i);return"rgba(".concat(n,", ").concat(s,", ").concat(r,", ").concat(a,")")}(i,o)}},919:e=>{e.exports=function(e){if("string"!=typeof e)throw new Error("color has to be type of `string`");if("#"===e.substr(0,1))return{hex:e,alpha:1};var t=e.replace(/\s+/g,""),o=/(.*?)rgb(a)??\((\d{1,3}),(\d{1,3}),(\d{1,3})(,([01]|1.0*|0??\.([0-9]{0,})))??\)/.exec(t);if(!o)throw new Error("given color ("+e+") isn't a valid rgb or rgba color");var n=parseInt(o[3],10),s=parseInt(o[4],10),r=parseInt(o[5],10),i=o[6]?/([0-9\.]+)/.exec(o[6])[0]:"1",a=(r|s<<8|n<<16|1<<24).toString(16).slice(1);return"."===i.substr(0,1)&&(i=parseFloat("0"+i)),i=parseFloat(Math.round(100*i))/100,{hex:"#"+a.toString(16),alpha:i}}},942:(e,t)=>{var o;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=i(e,r(o)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return s.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var o in e)n.call(e,o)&&e[o]&&(t=i(t,o));return t}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(s.default=s,e.exports=s):void 0===(o=function(){return s}.apply(t,[]))||(e.exports=o)}()}},t={};function o(n){var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,o),r.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};o.r(e),o.d(e,{settings:()=>j});var t={};o.r(t),o.d(t,{settings:()=>B});var n={};o.r(n),o.d(n,{settings:()=>E});var s={};o.r(s),o.d(s,{settings:()=>L});var r={};o.r(r),o.d(r,{settings:()=>J});var i={};o.r(i),o.d(i,{settings:()=>te});var a={};o.r(a),o.d(a,{settings:()=>de});var l={};o.r(l),o.d(l,{settings:()=>be});var c={};o.r(c),o.d(c,{settings:()=>fe});const m=window.lodash,u=window.wp.blockEditor,d=window.wp.components,g=window.wp.richText,p=window.wp.i18n,h=window.ReactJSXRuntime,b=(0,h.jsx)("svg",{role:"img",focusable:"false",width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M13.982,16.711c-0.744,1.441 -2.248,2.428 -3.982,2.428c-1.735,0 -3.238,-0.986 -3.983,-2.428c0.909,-1.213 2.355,-2.002 3.983,-2.002c1.629,0 3.074,0.789 3.982,2.002Zm-0.748,-7.657c-0.314,2.56 1.248,2.919 1.248,5.603c0,0.467 -0.072,0.918 -0.205,1.344c-1.037,-1.203 -2.57,-1.967 -4.277,-1.967c-1.708,0 -3.24,0.764 -4.277,1.967c-0.133,-0.426 -0.205,-0.877 -0.205,-1.344c0,-2.684 1.563,-3.043 1.247,-5.603c-0.362,-2.928 -4.315,-2.465 -4.315,-5.334c0,-1.579 1.279,-2.858 2.858,-2.858c1.709,0 2.765,1.558 4.692,1.558c1.926,0 2.982,-1.558 4.691,-1.558c1.578,0 2.857,1.279 2.857,2.858c0.001,2.869 -3.952,2.406 -4.314,5.334Zm-4.677,-4.947l-0.708,0c0,0.498 -0.403,0.9 -0.901,0.9c-0.498,0 -0.901,-0.402 -0.901,-0.9l-0.708,0c0,0.889 0.72,1.609 1.609,1.609c0.889,0 1.609,-0.72 1.609,-1.609Zm0.979,7.141c0,-0.312 -0.253,-0.568 -0.566,-0.568c-0.313,0 -0.567,0.256 -0.567,0.568c0,0.312 0.254,0.566 0.567,0.566c0.313,0 0.566,-0.253 0.566,-0.566Zm2.062,0c0,-0.312 -0.254,-0.568 -0.568,-0.568c-0.312,0 -0.566,0.256 -0.566,0.568c0,0.312 0.254,0.566 0.566,0.566c0.314,0 0.568,-0.253 0.568,-0.566Zm3.062,-7.141l-0.707,0c0,0.498 -0.404,0.9 -0.9,0.9c-0.498,0 -0.902,-0.402 -0.902,-0.9l-0.707,0c0,0.889 0.721,1.609 1.609,1.609c0.886,0.001 1.607,-0.72 1.607,-1.609Z"})}),v={position:"bottom left",variant:"alternate"};(0,g.registerFormatType)("snow-monkey-editor/dropdown",{title:"buttons",tagName:"sme-dropdown",className:null,edit:()=>(0,h.jsx)(u.BlockFormatControls,{children:(0,h.jsx)("div",{className:"block-editor-format-toolbar",children:(0,h.jsxs)(d.ToolbarGroup,{children:[(0,h.jsx)(d.Slot,{name:"SnowMonkey.ToolbarControls",children:e=>0!==e.length&&(0,h.jsx)(d.ToolbarItem,{children:t=>(0,h.jsx)(d.DropdownMenu,{icon:b,label:(0,p.__)("Snow Monkey Editor Controls","snow-monkey-editor"),toggleProps:t,controls:(0,m.orderBy)(e.map((([{props:e}])=>e)),"title"),popoverProps:v})})}),["sme-font-size","sme-letter-spacing","sme-line-height","sme-text-color","sme-bg-color","sme-highlighter","sme-badge"].map((e=>(0,h.jsx)(d.Slot,{name:`SnowMonkey.ToolbarControls.${e}`},e)))]})})})});const C=e=>{if(!e)return;const{name:t,settings:o}=e;(0,g.registerFormatType)(t,o)},x=window.wp.data,y=window.wp.element,f=window.wp.keycodes;function k({name:e,shortcutType:t,shortcutCharacter:o,...n}){let s,r="SnowMonkey.ToolbarControls";return e&&(r+=`.${e}`),t&&o&&(s=f.displayShortcut[t](o)),(0,h.jsx)(d.Fill,{name:r,children:(0,h.jsx)(d.ToolbarButton,{...n,shortcut:s})})}const w=(0,p.__)("Remove formatting","snow-monkey-editor"),j={name:"snow-monkey-editor/remove-fomatting",title:w,tagName:"span",className:"sme-remove-fomatting",edit:({value:e,onChange:t})=>{const o=(0,x.useSelect)((e=>e("core/rich-text").getFormatTypes()),[]),n=(0,y.useCallback)((()=>{if(0<o.length){let n=e;o.forEach((e=>{n=(0,g.removeFormat)(n,e.name)})),t({...n})}}),[e,o]);return(0,h.jsx)(k,{icon:"editor-removeformatting",title:w,onClick:n})}};var _=o(942),S=o.n(_);const R=({name:e,value:t,onChange:o,onReset:n})=>{const s=(0,x.useSelect)((e=>{const{getSettings:t}=e("core/block-editor");return(0,m.get)(t(),["fontSizes"],[])})),r=(0,y.useMemo)((()=>function(e,t,o){const n=(0,g.getActiveFormat)(t,e);if(!n)return;const s=n.attributes.style;if(s)return s.replace(new RegExp("^font-size:\\s*"),"");const r=n.attributes.class;if(r){let e=r.replace(/.*has-([^\s]*)-font-size.*/,"$1"),t=(0,m.find)(o,{slug:e});if(!t&&(e=e.replace(/(\d)-([^\d])/,"$1$2",e),t=(0,m.find)(o,{slug:e}),!t))return;return t.size}}(e,t,s)),[e,t]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(u.FontSizePicker,{value:r,onChange:o,fontSizes:s,__nextHasNoMarginBottom:!0}),(0,h.jsx)(d.Button,{disabled:void 0===t,variant:"secondary",isSmall:!0,onClick:n,children:(0,p.__)("Reset")})]})},N=(0,d.withSpokenMessages)((({name:e,value:t,onChange:o,onClose:n,onReset:s,contentRef:r,settings:i})=>{const a=(0,g.useAnchor)({editableContentElement:r.current,settings:i}),l=(0,u.useCachedTruthy)(a.getBoundingClientRect());return a.getBoundingClientRect=()=>l,(0,h.jsx)(d.Popover,{anchor:a,onClose:n,className:"sme-popover sme-popover--inline-font-size components-inline-color-popover",children:(0,h.jsx)("fieldset",{children:(0,h.jsx)(R,{name:e,value:t,onChange:o,onReset:s})})})})),F="snow-monkey-editor/font-size",A=(0,p.__)("Font size","snow-monkey-editor"),B={name:F,title:A,tagName:"span",className:"sme-font-size",attributes:{style:"style",class:"class"},edit:e=>{const{value:t,onChange:o,isActive:n,activeAttributes:s,contentRef:r}=e,[i]=(0,u.useSettings)("typography.fontSizes"),[a,l]=(0,y.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{name:n?"sme-font-size":void 0,title:A,className:S()("sme-toolbar-button",{"is-pressed":!!n}),onClick:()=>{l(!a)},icon:(0,h.jsx)(d.Icon,{icon:"editor-textcolor"})},n?"sme-font-size":"sme-font-size-not-active"),a&&(0,h.jsx)(N,{name:F,activeAttributes:s,value:t,onClose:()=>l(!1),onReset:()=>{l(!1),o((0,g.removeFormat)(t,F))},onChange:e=>{if(e){let n;if((0,m.isString)(e)||i[0]&&(0,m.isString)(i[0].size))n=e;else{if(!(0,m.isNumber)(e))return;n=`${e}px`}const s=(0,m.find)(i,{size:e});o((0,g.applyFormat)(t,{type:F,attributes:s?{class:(0,u.getFontSizeClass)(s.slug)}:{style:`font-size: ${n}`}}))}else o((0,g.removeFormat)(t,F))},contentRef:r,settings:B})]})}},M=({name:e,title:t,value:o,onChange:n,onReset:s})=>{const r=(0,y.useMemo)((()=>function(e,t){const o=(0,g.getActiveFormat)(t,e);if(!o)return;const n=o.attributes?.style;return n?parseFloat(n.replace(new RegExp("^letter-spacing:\\s*"),"").replace("rem","")):void 0}(e,o)),[e,o]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d.RangeControl,{__nextHasNoMarginBottom:!0,label:t,value:r,onChange:n,min:"0",max:"2",step:"0.1",initialPosition:void 0}),(0,h.jsx)(d.Button,{disabled:void 0===o,variant:"secondary",isSmall:!0,onClick:s,children:(0,p.__)("Reset")})]})},O=(0,d.withSpokenMessages)((({name:e,title:t,value:o,onChange:n,onClose:s,onReset:r,contentRef:i,settings:a})=>{const l=(0,g.useAnchor)({editableContentElement:i.current,settings:a}),c=(0,u.useCachedTruthy)(l.getBoundingClientRect());return l.getBoundingClientRect=()=>c,(0,h.jsx)(d.Popover,{anchor:l,onClose:s,className:"sme-popover sme-popover--inline-letter-spacing components-inline-color-popover",children:(0,h.jsx)("fieldset",{children:(0,h.jsx)(M,{name:e,title:t,value:o,onChange:n,onReset:r})})})})),P="snow-monkey-editor/letter-spacing",T=(0,p.__)("Letter spacing","snow-monkey-editor"),E={name:P,title:T,tagName:"span",className:"sme-letter-spacing",attributes:{style:"style"},edit:e=>{const{value:t,onChange:o,isActive:n,activeAttributes:s,contentRef:r}=e,[i,a]=(0,y.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{name:n?"sme-letter-spacing":void 0,title:T,className:S()("sme-toolbar-button",{"is-pressed":!!n}),onClick:()=>{a(!i)},icon:(0,h.jsx)(d.Icon,{icon:"controls-pause"})},n?"sme-letter-spacing":"sme-letter-spacing-not-active"),i&&(0,h.jsx)(O,{name:P,title:T,activeAttributes:s,value:t,onClose:()=>{a(!1)},onReset:()=>{a(!1),o((0,g.removeFormat)(t,P))},onChange:e=>{o((0,g.applyFormat)(t,{type:P,attributes:{style:`letter-spacing: ${e}rem`}}))},contentRef:r,settings:E})]})}},I=({name:e,title:t,value:o,onChange:n,onReset:s})=>{const r=(0,y.useMemo)((()=>function(e,t){const o=(0,g.getActiveFormat)(t,e);if(!o)return;const n=o.attributes.style;return n?parseFloat(n.replace(new RegExp("^line-height:\\s*"),"")):void 0}(e,o)),[e,o]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d.RangeControl,{__nextHasNoMarginBottom:!0,label:t,value:r,onChange:n,min:"0",max:"5",step:"0.1",initialPosition:void 0}),(0,h.jsx)(d.Button,{disabled:void 0===o,variant:"secondary",isSmall:!0,onClick:s,children:(0,p.__)("Reset")})]})},z=(0,d.withSpokenMessages)((({name:e,title:t,value:o,onChange:n,onClose:s,onReset:r,contentRef:i,settings:a})=>{const l=(0,g.useAnchor)({editableContentElement:i.current,settings:a}),c=(0,u.useCachedTruthy)(l.getBoundingClientRect());return l.getBoundingClientRect=()=>c,(0,h.jsx)(d.Popover,{anchor:l,onClose:s,className:"sme-popover sme-popover--inline-line-height components-inline-color-popover",children:(0,h.jsx)("fieldset",{children:(0,h.jsx)(I,{name:e,title:t,value:o,onChange:n,onReset:r})})})})),$="snow-monkey-editor/line-height",H=(0,p.__)("Line height","snow-monkey-editor"),L={name:$,title:H,tagName:"span",className:"sme-line-height",attributes:{style:"style"},edit:e=>{const{value:t,onChange:o,isActive:n,activeAttributes:s,contentRef:r}=e,[i,a]=(0,y.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{name:n?"sme-line-height":void 0,title:H,className:S()("sme-toolbar-button",{"is-pressed":!!n}),onClick:()=>{a(!i)},icon:(0,h.jsx)(d.Icon,{icon:"editor-insertmore"})},n?"sme-line-height":"sme-line-height-not-active"),i&&(0,h.jsx)(z,{name:$,title:H,activeAttributes:s,value:t,onClose:()=>{a(!1)},onReset:()=>{a(!1),o((0,g.removeFormat)(t,$))},onChange:e=>{o((0,g.applyFormat)(t,{type:$,attributes:{style:`line-height: ${e}`}}))},contentRef:r,settings:L})]})}};function V(e,t,o){const n=(0,g.getActiveFormat)(t,e);if(!n)return;const s=n.attributes.style;if(s)return s.replace(new RegExp("^color:\\s*"),"");const r=n.attributes.class;if(r){const e=r.replace(/.*has-([^\s]*)-color.*/,"$1");return(0,u.getColorObjectByAttributeValues)(o,e).color}}const G=({name:e,value:t,onChange:o})=>{const n=(0,x.useSelect)((e=>{const{getSettings:t}=e("core/block-editor");return(0,m.get)(t(),["colors"],[])})),s=(0,y.useMemo)((()=>V(e,t,n)),[e,t,n]);return(0,h.jsx)(u.__experimentalColorGradientControl,{label:(0,p.__)("Color","snow-monkey-editor"),colorValue:s,onColorChange:o,...(0,u.__experimentalUseMultipleOriginColorsAndGradients)(),__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})},Z=(0,d.withSpokenMessages)((({name:e,value:t,onChange:o,onClose:n,contentRef:s,settings:r})=>{const i=(0,g.useAnchor)({editableContentElement:s.current,settings:r}),a=(0,u.useCachedTruthy)(i.getBoundingClientRect());return i.getBoundingClientRect=()=>a,(0,h.jsx)(d.Popover,{anchor:i,value:t,onClose:n,className:"sme-popover sme-popover--inline-color components-inline-color-popover",children:(0,h.jsx)(G,{name:e,value:t,onChange:o})})})),U="snow-monkey-editor/text-color",D=(0,p.__)("Text color","snow-monkey-editor"),q=[],J={name:U,title:D,tagName:"span",className:"sme-text-color",attributes:{style:"style",class:"class"},edit:e=>{const{value:t,onChange:o,isActive:n,activeAttributes:s,contentRef:r}=e,[i=q]=(0,u.useSettings)("color.palette"),[a,l]=(0,y.useState)(!1),c=(0,y.useMemo)((()=>V(U,t,i)),[t,i]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{name:n?"sme-text-color":void 0,title:D,style:{color:c},className:S()("sme-toolbar-button",{"is-pressed":!!n}),onClick:()=>{l(!a)},icon:(0,h.jsx)(d.Icon,{icon:"edit"})},n?"sme-text-color":"sme-text-color-not-active"),a&&(0,h.jsx)(Z,{name:U,activeAttributes:s,value:t,onClose:()=>l(!1),onChange:e=>{if(e){const n=(0,u.getColorObjectByColorValue)(i,e);o((0,g.applyFormat)(t,{type:U,attributes:n?{class:(0,u.getColorClassName)("color",n.slug)}:{style:`color: ${e}`}}))}else o((0,g.removeFormat)(t,U)),l(!1)},contentRef:r,settings:J})]})}};function X(e,t,o){const n=(0,g.getActiveFormat)(t,e);if(!n)return;const s=n.attributes.style;if(s)return s.replace(new RegExp("^background-color:\\s*"),"");const r=n.attributes.class;if(r){const e=r.replace(/.*has-([^\s]*)-background-color.*/,"$1");return(0,u.getColorObjectByAttributeValues)(o,e).color}}const K=({name:e,value:t,onChange:o})=>{const n=(0,x.useSelect)((e=>{const{getSettings:t}=e("core/block-editor");return(0,m.get)(t(),["colors"],[])})),s=(0,y.useMemo)((()=>X(e,t,n)),[e,t,n]);return(0,h.jsx)(u.__experimentalColorGradientControl,{label:(0,p.__)("Color","snow-monkey-editor"),colorValue:s,onColorChange:o,...(0,u.__experimentalUseMultipleOriginColorsAndGradients)(),__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})},Q=(0,d.withSpokenMessages)((({name:e,value:t,onChange:o,onClose:n,contentRef:s,settings:r})=>{const i=(0,g.useAnchor)({editableContentElement:s.current,settings:r}),a=(0,u.useCachedTruthy)(i.getBoundingClientRect());return i.getBoundingClientRect=()=>a,(0,h.jsx)(d.Popover,{anchor:i,onClose:n,className:"sme-popover sme-popover--inline-background-color components-inline-color-popover",children:(0,h.jsx)(K,{name:e,value:t,onChange:o})})})),W="snow-monkey-editor/bg-color",Y=(0,p.__)("Background color","snow-monkey-editor"),ee=[],te={name:W,title:Y,tagName:"span",className:"sme-bg-color",attributes:{style:"style",class:"class"},edit:e=>{const{value:t,onChange:o,isActive:n,activeAttributes:s,contentRef:r}=e,[i=ee]=(0,u.useSettings)("color.palette"),[a,l]=(0,y.useState)(!1),c=(0,y.useMemo)((()=>X(W,t,i)),[t,i]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{name:n?"sme-bg-color":void 0,title:Y,style:{color:c},className:S()("sme-toolbar-button",{"is-pressed":!!n}),onClick:()=>{l(!a)},icon:(0,h.jsx)(d.Icon,{icon:"tag"})},n?"sme-bg-color":"sme-bg-color-not-active"),a&&(0,h.jsx)(Q,{name:W,activeAttributes:s,value:t,onClose:()=>l(!1),onChange:e=>{if(e){const n=(0,u.getColorObjectByColorValue)(i,e);o((0,g.applyFormat)(t,{type:W,attributes:n?{class:(0,u.getColorClassName)("background-color",n.slug)}:{style:`background-color: ${e}`}}))}else o((0,g.removeFormat)(t,W)),l(!1)},contentRef:r,settings:te})]})}};var oe=o(558),ne=o.n(oe),se=o(919),re=o.n(se);function ie(e,t){const o=(0,g.getActiveFormat)(t,e);if(!o)return;const n=o.attributes.style;if(!n)return;const s=n.match(/(#[0-9A-F]{3,6}) /i);if(s)return s;const r=n.match(/,\s*?(rgba?\([^)]+\)) /i);return r?function(e){if(!e||4===e.length)return e;const t=e.match(/^#([0-9A-F])\1([0-9A-F])\1([0-9A-F])\1$/i);return t?`#${t[1].slice(0,1)}${t[2].slice(0,1)}${t[3].slice(0,1)}`:e}(re()(r[1]).hex):void 0}const ae=({name:e,value:t,onChange:o})=>{const n=(0,x.useSelect)((e=>{const{getSettings:t}=e("core/block-editor");return(0,m.get)(t(),["colors"],[])})),s=(0,y.useMemo)((()=>ie(e,t)),[e,t,n]);return(0,h.jsx)(u.__experimentalColorGradientControl,{label:(0,p.__)("Color","snow-monkey-editor"),colorValue:s,onColorChange:o,...(0,u.__experimentalUseMultipleOriginColorsAndGradients)(),__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})},le=(0,d.withSpokenMessages)((({name:e,value:t,onChange:o,onClose:n,contentRef:s,settings:r})=>{const i=(0,g.useAnchor)({editableContentElement:s.current,settings:r}),a=(0,u.useCachedTruthy)(i.getBoundingClientRect());return i.getBoundingClientRect=()=>a,(0,h.jsx)(d.Popover,{anchor:i,onClose:n,className:"sme-popover sme-popover--inline-color components-inline-color-popover",children:(0,h.jsx)(ae,{name:e,value:t,onChange:o})})})),ce="snow-monkey-editor/highlighter",me=(0,p.__)("Highlighter","snow-monkey-editor"),ue=[],de={name:ce,title:me,tagName:"span",className:"sme-highlighter",attributes:{style:"style"},edit:e=>{const{value:t,onChange:o,isActive:n,activeAttributes:s,contentRef:r}=e,[i=ue]=(0,u.useSettings)("color.palette"),[a,l]=(0,y.useState)(!1),c=(0,y.useMemo)((()=>ie(ce,t)),[t,i]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{name:n?"sme-highlighter":void 0,title:me,style:{color:c},className:S()("sme-toolbar-button",{"is-pressed":!!n}),onClick:()=>{l(!a)},icon:(0,h.jsx)(d.Icon,{icon:"tag"})},n?"sme-highlighter":"sme-highlighter-not-active"),a&&(0,h.jsx)(le,{name:ce,activeAttributes:s,value:t,onClose:()=>l(!1),onChange:e=>{e?(e.match(/^#/)&&(e=ne()(e,.5)),o((0,g.applyFormat)(t,{type:ce,attributes:{style:`background-image: linear-gradient(transparent 60%, ${e} 60%)`}}))):(o((0,g.removeFormat)(t,ce)),l(!1))},contentRef:r,settings:de})]})}},ge="snow-monkey-editor/badge",pe=(0,p.__)("Badge","snow-monkey-editor"),he=[],be={name:ge,title:pe,tagName:"span",className:"sme-badge",attributes:{style:"style",class:"class"},edit:e=>{const{value:t,onChange:o,isActive:n,activeAttributes:s,contentRef:r}=e,[i=he]=(0,u.useSettings)("color.palette"),[a,l]=(0,y.useState)(!1),c=(0,y.useMemo)((()=>X(ge,t,i)),[t,i]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{name:n?"sme-badge":void 0,title:pe,style:{color:c},className:S()("sme-toolbar-button",{"is-pressed":!!n}),onClick:()=>{l(!a)},icon:(0,h.jsx)(d.Icon,{icon:"tag"})},n?"sme-badge":"sme-badge-not-active"),a&&(0,h.jsx)(Q,{name:ge,activeAttributes:s,value:t,onClose:()=>l(!1),onChange:e=>{if(e){const n=(0,u.getColorObjectByColorValue)(i,e);o((0,g.applyFormat)(t,{type:ge,attributes:n?{class:(0,u.getColorClassName)("background-color",n.slug)}:{style:`background-color: ${e}`}}))}else o((0,g.removeFormat)(t,ge)),l(!1)},contentRef:r,settings:be})]})}},ve="snow-monkey-editor/br",Ce=(0,p.__)("Line break per screen size","snow-monkey-editor"),xe={type:ve,innerHTML:"<br />"};function ye({value:e,onChange:t,activeObjectAttributes:o,contentRef:n}){const s=e.replacements.slice()?.[e.start]?.attributes?.class,[r,i]=(0,y.useState)(!!s?.match(/sme-br--disable:desktop/)),[a,l]=(0,y.useState)(!!s?.match(/sme-br--disable:tablet/)),[c,m]=(0,y.useState)(!!s?.match(/sme-br--disable:mobile/)),u=(0,g.useAnchor)({editableContentElement:n.current,settings:fe}),b=(0,y.useCallback)((n=>{i(!n);const s=e.replacements.slice();s[e.start]={...xe,attributes:{...o,class:S()({"sme-br--disable:desktop":!n,"sme-br--disable:tablet":a,"sme-br--disable:mobile":c})}},t({...e,replacements:s})}),[a,c]),v=(0,y.useCallback)((n=>{l(!n);const s=e.replacements.slice();s[e.start]={...xe,attributes:{...o,class:S()({"sme-br--disable:desktop":r,"sme-br--disable:tablet":!n,"sme-br--disable:mobile":c})}},t({...e,replacements:s})}),[r,c]),C=(0,y.useCallback)((n=>{m(!n);const s=e.replacements.slice();s[e.start]={...xe,attributes:{...o,class:S()({"sme-br--disable:desktop":r,"sme-br--disable:tablet":a,"sme-br--disable:mobile":!n})}},t({...e,replacements:s})}),[r,a]);return(0,h.jsx)(d.Popover,{placement:"bottom",shift:!0,focusOnMount:!1,anchor:u,className:"sme-popover ",children:(0,h.jsxs)("div",{style:{width:"260px"},children:[(0,h.jsx)(d.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,p.__)("Line breaks when on the desktop","snow-monkey-editor"),checked:!r,onChange:b,disabled:a&&c}),(0,h.jsx)(d.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,p.__)("Line breaks when on the tablet","snow-monkey-editor"),checked:!a,onChange:v,disabled:r&&c}),(0,h.jsx)(d.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,p.__)("Line breaks when on the mobile","snow-monkey-editor"),checked:!c,onChange:C,disabled:r&&a})]})})}const fe={name:ve,title:Ce,tagName:"span",className:"sme-br",attributes:{class:"class"},interactive:!0,contentEditable:!1,edit:function({value:e,onChange:t,onFocus:o,isObjectActive:n,activeObjectAttributes:s,contentRef:r}){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{icon:(0,h.jsx)("span",{className:"dashicon",children:(0,h.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0224 5.25C18.4366 5.25 18.7724 5.58579 18.7724 6V15C18.7724 15.4142 18.4366 15.75 18.0224 15.75L18.0112 15.7499L18 15.75H10.0784V19L4.5 14.8349L10.0784 10.6699V14.25H17.2724V6C17.2724 5.58579 17.6082 5.25 18.0224 5.25Z",fill:"currentColor"})})}),title:Ce,onClick:()=>{const n=(0,g.insertObject)(e,{...xe},e.end,e.end);n.start=n.end-1,t(n),o()},isActive:n}),n&&(0,h.jsx)(ye,{value:e,onChange:t,activeObjectAttributes:s,contentRef:r})]})}};C(e),C(t),C(n),C(s),C(r),C(i),C(a),C(l),C(c);const ke=window.wp.compose,we=window.wp.hooks;(0,we.addFilter)("editor.BlockListBlock","snow-monkey-editor/ordered-list/orderd-styles",(0,ke.createHigherOrderComponent)((e=>t=>{const{attributes:o,name:n}=t?.block,{start:s,reversed:r,ordered:i,className:a}=o;return"core/list"!==n?(0,h.jsx)(e,{...t}):(a?.match("is-style-sme-ordered-list-square")||a?.match("is-style-sme-ordered-list-circle"))&&i?(0,h.jsx)(e,{...t,wrapperProps:{...t.wrapperProps,style:{...t.wrapperProps?.style,counterReset:r?`sme-count ${s+1}`:"sme-count "+(s-1)}}}):(0,h.jsx)(e,{...t})}),"withSnowMonkeyEditorOrderdListOrderdStyles"));const je=window.wp.blocks,_e=window.wp.preferences;const Se="snow-monkey-editor/preferences",Re=["allowedBlocks","content","templateLock","placeholder"],Ne=e=>!(({name:e}={})=>!(0,je.hasBlockSupport)(e,"snowmonkeyeditor.blockPresets"))(e)&&(!!function(e,t){if(!e||!Object.keys(e).length)return!1;const o=function(e){return(0,we.applyFilters)("SnowMonkeyEditor.extension.allowedRoles",["administrator","editor","author","contributor"],e)}(t);return 0<e.roles.filter((e=>-1<o.indexOf(e))).length}(snowmonkeyeditor?.currentUser,"block-presets")&&!!(0,je.getBlockType)(e.name)),Fe=(0,ke.createHigherOrderComponent)((e=>((0,x.dispatch)(_e.store).setDefaults(Se,{blockPresets:{}}),t=>{if(!Ne(t))return(0,h.jsx)(e,{...t});const{name:o,attributes:n,setAttributes:s}=t,[r,i]=(0,y.useState)(void 0),[a,l]=(0,y.useState)(0),c=(0,x.useSelect)((e=>e(_e.store).get(Se,"blockPresets")),[]),m=c?.[o],g=(0,je.getBlockSupport)(o,"snowmonkeyeditor.blockPresets"),b=g?.ignore||[],v=({blockName:e,presetName:t,preset:o})=>(0,h.jsxs)("div",{className:"sme-editor-block-presets__preset",children:[(0,h.jsx)(d.Button,{onClick:()=>{const t=(0,je.getBlockType)(e),n={};Object.keys(t.attributes).forEach((e=>{n[e]=void 0})),Re.forEach((e=>{delete n[e],delete o[e]})),b.forEach((e=>{delete n[e],delete o[e]})),s({...n,...o})},variant:"secondary",children:t}),(0,h.jsx)(d.Button,{label:(0,p.__)("Remove this preset","snow-monkey-editor"),onClick:()=>{const o={...c};delete o?.[e]?.[t],(0,x.dispatch)(_e.store).set(Se,"blockPresets",o),l(a+1)},variant:"tertiary",children:"x"})]});return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(e,{...t}),(0,h.jsx)(u.InspectorControls,{children:(0,h.jsxs)(d.PanelBody,{title:(0,p.__)("Presets","snow-monkey-editor"),children:[!!m&&!!Object.values(m)&&(0,h.jsx)("div",{className:"sme-editor-block-presets",children:Object.values(m).map(((e,t)=>{const n=Object.keys(m)[t];return(0,h.jsx)(v,{blockName:o,presetName:n,preset:e},t)}))}),(0,h.jsxs)("div",{className:"sme-editor-block-presets-inserter",children:[(0,h.jsx)("h3",{className:"sme-editor-block-presets-inserter__title",children:(0,p.__)("Save current settings as a preset","snow-monkey-editor")}),(0,h.jsxs)("div",{className:"sme-editor-block-presets-inserter__control",children:[(0,h.jsx)(d.TextControl,{__nextHasNoMarginBottom:!0,value:r||"",placeholder:(0,p.__)("Input the preset name.","snow-monkey-editor"),onChange:e=>i(e)}),(0,h.jsx)(d.Button,{variant:"primary",disabled:!r,onClick:async()=>{const e={...n};Re.forEach((t=>{delete e[t]})),b.forEach((t=>{delete e[t]}));const t={...c,[o]:{...m,[r]:{...e}}};(0,x.dispatch)(_e.store).set(Se,"blockPresets",t),i(void 0)},children:(0,p.__)("Save","snow-monkey-editor")})]})]})]})})]})})),"withInspectorControl");(0,we.addFilter)("editor.BlockEdit","snow-monkey-editor/block-presets/with-inspector-controls",Fe,100),(0,we.addFilter)("blocks.registerBlockType","snow-monkey-editor/block-presets/support",((e,t)=>{let o=!1;return"core/button"===t?o={ignore:["url","title","text","linkTarget","rel"]}:"core/cover"===t?o={ignore:["url"]}:"core/list"===t?o={ignore:["values"]}:"core/paragraph"!==t&&"core/group"!==t&&"core/columns"!==t&&"core/column"!==t&&"core/heading"!==t||(o=!0),!1===o?e:{...e,supports:{...e.supports,snowmonkeyeditor:{blockPresets:o}}}}))})()})();1 (()=>{var e={558:e=>{"use strict";var t=function(e){return parseInt(e,16)};e.exports=function(e,o){var n,s,r=function(e){return"#"===e.charAt(0)?e.slice(1):e}(e),i=function(e){var o=e.g,n=e.b,s=e.a;return{r:t(e.r),g:t(o),b:t(n),a:+(t(s)/255).toFixed(2)}}({r:(s=3===(n=r).length||4===n.length)?"".concat(n.slice(0,1)).concat(n.slice(0,1)):n.slice(0,2),g:s?"".concat(n.slice(1,2)).concat(n.slice(1,2)):n.slice(2,4),b:s?"".concat(n.slice(2,3)).concat(n.slice(2,3)):n.slice(4,6),a:(s?"".concat(n.slice(3,4)).concat(n.slice(3,4)):n.slice(6,8))||"ff"});return function(e,t){var o,n=e.r,s=e.g,r=e.b,i=e.a,a=(o=t,!isNaN(parseFloat(o))&&isFinite(o)?t:i);return"rgba(".concat(n,", ").concat(s,", ").concat(r,", ").concat(a,")")}(i,o)}},919:e=>{e.exports=function(e){if("string"!=typeof e)throw new Error("color has to be type of `string`");if("#"===e.substr(0,1))return{hex:e,alpha:1};var t=e.replace(/\s+/g,""),o=/(.*?)rgb(a)??\((\d{1,3}),(\d{1,3}),(\d{1,3})(,([01]|1.0*|0??\.([0-9]{0,})))??\)/.exec(t);if(!o)throw new Error("given color ("+e+") isn't a valid rgb or rgba color");var n=parseInt(o[3],10),s=parseInt(o[4],10),r=parseInt(o[5],10),i=o[6]?/([0-9\.]+)/.exec(o[6])[0]:"1",a=(r|s<<8|n<<16|1<<24).toString(16).slice(1);return"."===i.substr(0,1)&&(i=parseFloat("0"+i)),i=parseFloat(Math.round(100*i))/100,{hex:"#"+a.toString(16),alpha:i}}},942:(e,t)=>{var o;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=i(e,r(o)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return s.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var o in e)n.call(e,o)&&e[o]&&(t=i(t,o));return t}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(s.default=s,e.exports=s):void 0===(o=function(){return s}.apply(t,[]))||(e.exports=o)}()}},t={};function o(n){var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,o),r.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e={};o.r(e),o.d(e,{settings:()=>j});var t={};o.r(t),o.d(t,{settings:()=>B});var n={};o.r(n),o.d(n,{settings:()=>E});var s={};o.r(s),o.d(s,{settings:()=>L});var r={};o.r(r),o.d(r,{settings:()=>J});var i={};o.r(i),o.d(i,{settings:()=>te});var a={};o.r(a),o.d(a,{settings:()=>de});var l={};o.r(l),o.d(l,{settings:()=>be});var c={};o.r(c),o.d(c,{settings:()=>fe});const m=window.lodash,u=window.wp.blockEditor,d=window.wp.components,g=window.wp.richText,p=window.wp.i18n,h=window.ReactJSXRuntime,b=(0,h.jsx)("svg",{role:"img",focusable:"false",width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,h.jsx)("path",{d:"M13.982,16.711c-0.744,1.441 -2.248,2.428 -3.982,2.428c-1.735,0 -3.238,-0.986 -3.983,-2.428c0.909,-1.213 2.355,-2.002 3.983,-2.002c1.629,0 3.074,0.789 3.982,2.002Zm-0.748,-7.657c-0.314,2.56 1.248,2.919 1.248,5.603c0,0.467 -0.072,0.918 -0.205,1.344c-1.037,-1.203 -2.57,-1.967 -4.277,-1.967c-1.708,0 -3.24,0.764 -4.277,1.967c-0.133,-0.426 -0.205,-0.877 -0.205,-1.344c0,-2.684 1.563,-3.043 1.247,-5.603c-0.362,-2.928 -4.315,-2.465 -4.315,-5.334c0,-1.579 1.279,-2.858 2.858,-2.858c1.709,0 2.765,1.558 4.692,1.558c1.926,0 2.982,-1.558 4.691,-1.558c1.578,0 2.857,1.279 2.857,2.858c0.001,2.869 -3.952,2.406 -4.314,5.334Zm-4.677,-4.947l-0.708,0c0,0.498 -0.403,0.9 -0.901,0.9c-0.498,0 -0.901,-0.402 -0.901,-0.9l-0.708,0c0,0.889 0.72,1.609 1.609,1.609c0.889,0 1.609,-0.72 1.609,-1.609Zm0.979,7.141c0,-0.312 -0.253,-0.568 -0.566,-0.568c-0.313,0 -0.567,0.256 -0.567,0.568c0,0.312 0.254,0.566 0.567,0.566c0.313,0 0.566,-0.253 0.566,-0.566Zm2.062,0c0,-0.312 -0.254,-0.568 -0.568,-0.568c-0.312,0 -0.566,0.256 -0.566,0.568c0,0.312 0.254,0.566 0.566,0.566c0.314,0 0.568,-0.253 0.568,-0.566Zm3.062,-7.141l-0.707,0c0,0.498 -0.404,0.9 -0.9,0.9c-0.498,0 -0.902,-0.402 -0.902,-0.9l-0.707,0c0,0.889 0.721,1.609 1.609,1.609c0.886,0.001 1.607,-0.72 1.607,-1.609Z"})}),v={position:"bottom left",variant:"alternate"};(0,g.registerFormatType)("snow-monkey-editor/dropdown",{title:"buttons",tagName:"sme-dropdown",className:null,edit:()=>(0,h.jsx)(u.BlockFormatControls,{children:(0,h.jsx)("div",{className:"block-editor-format-toolbar",children:(0,h.jsxs)(d.ToolbarGroup,{children:[(0,h.jsx)(d.Slot,{name:"SnowMonkey.ToolbarControls",children:e=>0!==e.length&&(0,h.jsx)(d.ToolbarItem,{children:t=>(0,h.jsx)(d.DropdownMenu,{icon:b,label:(0,p.__)("Snow Monkey Editor Controls","snow-monkey-editor"),toggleProps:t,controls:(0,m.orderBy)(e.map((([{props:e}])=>e)),"title"),popoverProps:v})})}),["sme-font-size","sme-letter-spacing","sme-line-height","sme-text-color","sme-bg-color","sme-highlighter","sme-badge"].map((e=>(0,h.jsx)(d.Slot,{name:`SnowMonkey.ToolbarControls.${e}`},e)))]})})})});const C=e=>{if(!e)return;const{name:t,settings:o}=e;(0,g.registerFormatType)(t,o)},x=window.wp.data,y=window.wp.element,f=window.wp.keycodes;function k({name:e,shortcutType:t,shortcutCharacter:o,...n}){let s,r="SnowMonkey.ToolbarControls";return e&&(r+=`.${e}`),t&&o&&(s=f.displayShortcut[t](o)),(0,h.jsx)(d.Fill,{name:r,children:(0,h.jsx)(d.ToolbarButton,{...n,shortcut:s})})}const w=(0,p.__)("Remove formatting","snow-monkey-editor"),j={name:"snow-monkey-editor/remove-fomatting",title:w,tagName:"span",className:"sme-remove-fomatting",edit:({value:e,onChange:t})=>{const o=(0,x.useSelect)((e=>e("core/rich-text").getFormatTypes()),[]),n=(0,y.useCallback)((()=>{if(0<o.length){let n=e;o.forEach((e=>{n=(0,g.removeFormat)(n,e.name)})),t({...n})}}),[e,o]);return(0,h.jsx)(k,{icon:"editor-removeformatting",title:w,onClick:n})}};var _=o(942),S=o.n(_);const R=({name:e,value:t,onChange:o,onReset:n})=>{const s=(0,x.useSelect)((e=>{const{getSettings:t}=e("core/block-editor");return(0,m.get)(t(),["fontSizes"],[])})),r=(0,y.useMemo)((()=>function(e,t,o){const n=(0,g.getActiveFormat)(t,e);if(!n)return;const s=n.attributes.style;if(s)return s.replace(new RegExp("^font-size:\\s*"),"");const r=n.attributes.class;if(r){let e=r.replace(/.*has-([^\s]*)-font-size.*/,"$1"),t=(0,m.find)(o,{slug:e});if(!t&&(e=e.replace(/(\d)-([^\d])/,"$1$2",e),t=(0,m.find)(o,{slug:e}),!t))return;return t.size}}(e,t,s)),[e,t]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(u.FontSizePicker,{value:r,onChange:o,fontSizes:s,__nextHasNoMarginBottom:!0}),(0,h.jsx)(d.Button,{disabled:void 0===t,variant:"secondary",isSmall:!0,onClick:n,children:(0,p.__)("Reset")})]})},N=(0,d.withSpokenMessages)((({name:e,value:t,onChange:o,onClose:n,onReset:s,contentRef:r,settings:i})=>{const a=(0,g.useAnchor)({editableContentElement:r.current,settings:i}),l=(0,u.useCachedTruthy)(a.getBoundingClientRect());return a.getBoundingClientRect=()=>l,(0,h.jsx)(d.Popover,{anchor:a,onClose:n,className:"sme-popover sme-popover--inline-font-size components-inline-color-popover",children:(0,h.jsx)("fieldset",{children:(0,h.jsx)(R,{name:e,value:t,onChange:o,onReset:s})})})})),F="snow-monkey-editor/font-size",A=(0,p.__)("Font size","snow-monkey-editor"),B={name:F,title:A,tagName:"span",className:"sme-font-size",attributes:{style:"style",class:"class"},edit:e=>{const{value:t,onChange:o,isActive:n,activeAttributes:s,contentRef:r}=e,[i]=(0,u.useSettings)("typography.fontSizes"),[a,l]=(0,y.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{name:n?"sme-font-size":void 0,title:A,className:S()("sme-toolbar-button",{"is-pressed":!!n}),onClick:()=>{l(!a)},icon:(0,h.jsx)(d.Icon,{icon:"editor-textcolor"})},n?"sme-font-size":"sme-font-size-not-active"),a&&(0,h.jsx)(N,{name:F,activeAttributes:s,value:t,onClose:()=>l(!1),onReset:()=>{l(!1),o((0,g.removeFormat)(t,F))},onChange:e=>{if(e){let n;if((0,m.isString)(e)||i[0]&&(0,m.isString)(i[0].size))n=e;else{if(!(0,m.isNumber)(e))return;n=`${e}px`}const s=(0,m.find)(i,{size:e});o((0,g.applyFormat)(t,{type:F,attributes:s?{class:(0,u.getFontSizeClass)(s.slug)}:{style:`font-size: ${n}`}}))}else o((0,g.removeFormat)(t,F))},contentRef:r,settings:B})]})}},M=({name:e,title:t,value:o,onChange:n,onReset:s})=>{const r=(0,y.useMemo)((()=>function(e,t){const o=(0,g.getActiveFormat)(t,e);if(!o)return;const n=o.attributes?.style;return n?parseFloat(n.replace(new RegExp("^letter-spacing:\\s*"),"").replace("rem","")):void 0}(e,o)),[e,o]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d.RangeControl,{__nextHasNoMarginBottom:!0,label:t,value:r,onChange:n,min:"0",max:"2",step:"0.1",initialPosition:void 0}),(0,h.jsx)(d.Button,{disabled:void 0===o,variant:"secondary",isSmall:!0,onClick:s,children:(0,p.__)("Reset")})]})},O=(0,d.withSpokenMessages)((({name:e,title:t,value:o,onChange:n,onClose:s,onReset:r,contentRef:i,settings:a})=>{const l=(0,g.useAnchor)({editableContentElement:i.current,settings:a}),c=(0,u.useCachedTruthy)(l.getBoundingClientRect());return l.getBoundingClientRect=()=>c,(0,h.jsx)(d.Popover,{anchor:l,onClose:s,className:"sme-popover sme-popover--inline-letter-spacing components-inline-color-popover",children:(0,h.jsx)("fieldset",{children:(0,h.jsx)(M,{name:e,title:t,value:o,onChange:n,onReset:r})})})})),P="snow-monkey-editor/letter-spacing",T=(0,p.__)("Letter spacing","snow-monkey-editor"),E={name:P,title:T,tagName:"span",className:"sme-letter-spacing",attributes:{style:"style"},edit:e=>{const{value:t,onChange:o,isActive:n,activeAttributes:s,contentRef:r}=e,[i,a]=(0,y.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{name:n?"sme-letter-spacing":void 0,title:T,className:S()("sme-toolbar-button",{"is-pressed":!!n}),onClick:()=>{a(!i)},icon:(0,h.jsx)(d.Icon,{icon:"controls-pause"})},n?"sme-letter-spacing":"sme-letter-spacing-not-active"),i&&(0,h.jsx)(O,{name:P,title:T,activeAttributes:s,value:t,onClose:()=>{a(!1)},onReset:()=>{a(!1),o((0,g.removeFormat)(t,P))},onChange:e=>{o((0,g.applyFormat)(t,{type:P,attributes:{style:`letter-spacing: ${e}rem`}}))},contentRef:r,settings:E})]})}},I=({name:e,title:t,value:o,onChange:n,onReset:s})=>{const r=(0,y.useMemo)((()=>function(e,t){const o=(0,g.getActiveFormat)(t,e);if(!o)return;const n=o.attributes.style;return n?parseFloat(n.replace(new RegExp("^line-height:\\s*"),"")):void 0}(e,o)),[e,o]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d.RangeControl,{__nextHasNoMarginBottom:!0,label:t,value:r,onChange:n,min:"0",max:"5",step:"0.1",initialPosition:void 0}),(0,h.jsx)(d.Button,{disabled:void 0===o,variant:"secondary",isSmall:!0,onClick:s,children:(0,p.__)("Reset")})]})},z=(0,d.withSpokenMessages)((({name:e,title:t,value:o,onChange:n,onClose:s,onReset:r,contentRef:i,settings:a})=>{const l=(0,g.useAnchor)({editableContentElement:i.current,settings:a}),c=(0,u.useCachedTruthy)(l.getBoundingClientRect());return l.getBoundingClientRect=()=>c,(0,h.jsx)(d.Popover,{anchor:l,onClose:s,className:"sme-popover sme-popover--inline-line-height components-inline-color-popover",children:(0,h.jsx)("fieldset",{children:(0,h.jsx)(I,{name:e,title:t,value:o,onChange:n,onReset:r})})})})),$="snow-monkey-editor/line-height",H=(0,p.__)("Line height","snow-monkey-editor"),L={name:$,title:H,tagName:"span",className:"sme-line-height",attributes:{style:"style"},edit:e=>{const{value:t,onChange:o,isActive:n,activeAttributes:s,contentRef:r}=e,[i,a]=(0,y.useState)(!1);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{name:n?"sme-line-height":void 0,title:H,className:S()("sme-toolbar-button",{"is-pressed":!!n}),onClick:()=>{a(!i)},icon:(0,h.jsx)(d.Icon,{icon:"editor-insertmore"})},n?"sme-line-height":"sme-line-height-not-active"),i&&(0,h.jsx)(z,{name:$,title:H,activeAttributes:s,value:t,onClose:()=>{a(!1)},onReset:()=>{a(!1),o((0,g.removeFormat)(t,$))},onChange:e=>{o((0,g.applyFormat)(t,{type:$,attributes:{style:`line-height: ${e}`}}))},contentRef:r,settings:L})]})}};function V(e,t,o){const n=(0,g.getActiveFormat)(t,e);if(!n)return;const s=n.attributes.style;if(s)return s.replace(new RegExp("^color:\\s*"),"");const r=n.attributes.class;if(r){const e=r.replace(/.*has-([^\s]*)-color.*/,"$1");return(0,u.getColorObjectByAttributeValues)(o,e).color}}const G=({name:e,value:t,onChange:o})=>{const n=(0,x.useSelect)((e=>{const{getSettings:t}=e("core/block-editor");return(0,m.get)(t(),["colors"],[])})),s=(0,y.useMemo)((()=>V(e,t,n)),[e,t,n]);return(0,h.jsx)(u.__experimentalColorGradientControl,{label:(0,p.__)("Color","snow-monkey-editor"),colorValue:s,onColorChange:o,...(0,u.__experimentalUseMultipleOriginColorsAndGradients)(),__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})},Z=(0,d.withSpokenMessages)((({name:e,value:t,onChange:o,onClose:n,contentRef:s,settings:r})=>{const i=(0,g.useAnchor)({editableContentElement:s.current,settings:r}),a=(0,u.useCachedTruthy)(i.getBoundingClientRect());return i.getBoundingClientRect=()=>a,(0,h.jsx)(d.Popover,{anchor:i,value:t,onClose:n,className:"sme-popover sme-popover--inline-color components-inline-color-popover",children:(0,h.jsx)(G,{name:e,value:t,onChange:o})})})),U="snow-monkey-editor/text-color",D=(0,p.__)("Text color","snow-monkey-editor"),q=[],J={name:U,title:D,tagName:"span",className:"sme-text-color",attributes:{style:"style",class:"class"},edit:e=>{const{value:t,onChange:o,isActive:n,activeAttributes:s,contentRef:r}=e,[i=q]=(0,u.useSettings)("color.palette"),[a,l]=(0,y.useState)(!1),c=(0,y.useMemo)((()=>V(U,t,i)),[t,i]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{name:n?"sme-text-color":void 0,title:D,style:{color:c},className:S()("sme-toolbar-button",{"is-pressed":!!n}),onClick:()=>{l(!a)},icon:(0,h.jsx)(d.Icon,{icon:"edit"})},n?"sme-text-color":"sme-text-color-not-active"),a&&(0,h.jsx)(Z,{name:U,activeAttributes:s,value:t,onClose:()=>l(!1),onChange:e=>{if(e){const n=(0,u.getColorObjectByColorValue)(i,e);o((0,g.applyFormat)(t,{type:U,attributes:n?{class:(0,u.getColorClassName)("color",n.slug)}:{style:`color: ${e}`}}))}else o((0,g.removeFormat)(t,U)),l(!1)},contentRef:r,settings:J})]})}};function X(e,t,o){const n=(0,g.getActiveFormat)(t,e);if(!n)return;const s=n.attributes.style;if(s)return s.replace(new RegExp("^background-color:\\s*"),"");const r=n.attributes.class;if(r){const e=r.replace(/.*has-([^\s]*)-background-color.*/,"$1");return(0,u.getColorObjectByAttributeValues)(o,e).color}}const K=({name:e,value:t,onChange:o})=>{const n=(0,x.useSelect)((e=>{const{getSettings:t}=e("core/block-editor");return(0,m.get)(t(),["colors"],[])})),s=(0,y.useMemo)((()=>X(e,t,n)),[e,t,n]);return(0,h.jsx)(u.__experimentalColorGradientControl,{label:(0,p.__)("Color","snow-monkey-editor"),colorValue:s,onColorChange:o,...(0,u.__experimentalUseMultipleOriginColorsAndGradients)(),__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})},Q=(0,d.withSpokenMessages)((({name:e,value:t,onChange:o,onClose:n,contentRef:s,settings:r})=>{const i=(0,g.useAnchor)({editableContentElement:s.current,settings:r}),a=(0,u.useCachedTruthy)(i.getBoundingClientRect());return i.getBoundingClientRect=()=>a,(0,h.jsx)(d.Popover,{anchor:i,onClose:n,className:"sme-popover sme-popover--inline-background-color components-inline-color-popover",children:(0,h.jsx)(K,{name:e,value:t,onChange:o})})})),W="snow-monkey-editor/bg-color",Y=(0,p.__)("Background color","snow-monkey-editor"),ee=[],te={name:W,title:Y,tagName:"span",className:"sme-bg-color",attributes:{style:"style",class:"class"},edit:e=>{const{value:t,onChange:o,isActive:n,activeAttributes:s,contentRef:r}=e,[i=ee]=(0,u.useSettings)("color.palette"),[a,l]=(0,y.useState)(!1),c=(0,y.useMemo)((()=>X(W,t,i)),[t,i]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{name:n?"sme-bg-color":void 0,title:Y,style:{color:c},className:S()("sme-toolbar-button",{"is-pressed":!!n}),onClick:()=>{l(!a)},icon:(0,h.jsx)(d.Icon,{icon:"tag"})},n?"sme-bg-color":"sme-bg-color-not-active"),a&&(0,h.jsx)(Q,{name:W,activeAttributes:s,value:t,onClose:()=>l(!1),onChange:e=>{if(e){const n=(0,u.getColorObjectByColorValue)(i,e);o((0,g.applyFormat)(t,{type:W,attributes:n?{class:(0,u.getColorClassName)("background-color",n.slug)}:{style:`background-color: ${e}`}}))}else o((0,g.removeFormat)(t,W)),l(!1)},contentRef:r,settings:te})]})}};var oe=o(558),ne=o.n(oe),se=o(919),re=o.n(se);function ie(e,t){const o=(0,g.getActiveFormat)(t,e);if(!o)return;const n=o.attributes.style;if(!n)return;const s=n.match(/(#[0-9A-F]{3,6}) /i);if(s)return s;const r=n.match(/,\s*?(rgba?\([^)]+\)) /i);return r?function(e){if(!e||4===e.length)return e;const t=e.match(/^#([0-9A-F])\1([0-9A-F])\1([0-9A-F])\1$/i);return t?`#${t[1].slice(0,1)}${t[2].slice(0,1)}${t[3].slice(0,1)}`:e}(re()(r[1]).hex):void 0}const ae=({name:e,value:t,onChange:o})=>{const n=(0,x.useSelect)((e=>{const{getSettings:t}=e("core/block-editor");return(0,m.get)(t(),["colors"],[])})),s=(0,y.useMemo)((()=>ie(e,t)),[e,t,n]);return(0,h.jsx)(u.__experimentalColorGradientControl,{label:(0,p.__)("Color","snow-monkey-editor"),colorValue:s,onColorChange:o,...(0,u.__experimentalUseMultipleOriginColorsAndGradients)(),__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})},le=(0,d.withSpokenMessages)((({name:e,value:t,onChange:o,onClose:n,contentRef:s,settings:r})=>{const i=(0,g.useAnchor)({editableContentElement:s.current,settings:r}),a=(0,u.useCachedTruthy)(i.getBoundingClientRect());return i.getBoundingClientRect=()=>a,(0,h.jsx)(d.Popover,{anchor:i,onClose:n,className:"sme-popover sme-popover--inline-color components-inline-color-popover",children:(0,h.jsx)(ae,{name:e,value:t,onChange:o})})})),ce="snow-monkey-editor/highlighter",me=(0,p.__)("Highlighter","snow-monkey-editor"),ue=[],de={name:ce,title:me,tagName:"span",className:"sme-highlighter",attributes:{style:"style"},edit:e=>{const{value:t,onChange:o,isActive:n,activeAttributes:s,contentRef:r}=e,[i=ue]=(0,u.useSettings)("color.palette"),[a,l]=(0,y.useState)(!1),c=(0,y.useMemo)((()=>ie(ce,t)),[t,i]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{name:n?"sme-highlighter":void 0,title:me,style:{color:c},className:S()("sme-toolbar-button",{"is-pressed":!!n}),onClick:()=>{l(!a)},icon:(0,h.jsx)(d.Icon,{icon:"tag"})},n?"sme-highlighter":"sme-highlighter-not-active"),a&&(0,h.jsx)(le,{name:ce,activeAttributes:s,value:t,onClose:()=>l(!1),onChange:e=>{e?(e.match(/^#/)&&(e=ne()(e,.5)),o((0,g.applyFormat)(t,{type:ce,attributes:{style:`background-image: linear-gradient(transparent 60%, ${e} 60%)`}}))):(o((0,g.removeFormat)(t,ce)),l(!1))},contentRef:r,settings:de})]})}},ge="snow-monkey-editor/badge",pe=(0,p.__)("Badge","snow-monkey-editor"),he=[],be={name:ge,title:pe,tagName:"span",className:"sme-badge",attributes:{style:"style",class:"class"},edit:e=>{const{value:t,onChange:o,isActive:n,activeAttributes:s,contentRef:r}=e,[i=he]=(0,u.useSettings)("color.palette"),[a,l]=(0,y.useState)(!1),c=(0,y.useMemo)((()=>X(ge,t,i)),[t,i]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{name:n?"sme-badge":void 0,title:pe,style:{color:c},className:S()("sme-toolbar-button",{"is-pressed":!!n}),onClick:()=>{l(!a)},icon:(0,h.jsx)(d.Icon,{icon:"tag"})},n?"sme-badge":"sme-badge-not-active"),a&&(0,h.jsx)(Q,{name:ge,activeAttributes:s,value:t,onClose:()=>l(!1),onChange:e=>{if(e){const n=(0,u.getColorObjectByColorValue)(i,e);o((0,g.applyFormat)(t,{type:ge,attributes:n?{class:(0,u.getColorClassName)("background-color",n.slug)}:{style:`background-color: ${e}`}}))}else o((0,g.removeFormat)(t,ge)),l(!1)},contentRef:r,settings:be})]})}},ve="snow-monkey-editor/br",Ce=(0,p.__)("Line break per screen size","snow-monkey-editor"),xe={type:ve,innerHTML:"<br />"};function ye({value:e,onChange:t,activeObjectAttributes:o,contentRef:n}){const s=e.replacements.slice()?.[e.start]?.attributes?.class,[r,i]=(0,y.useState)(!!s?.match(/sme-br--disable:desktop/)),[a,l]=(0,y.useState)(!!s?.match(/sme-br--disable:tablet/)),[c,m]=(0,y.useState)(!!s?.match(/sme-br--disable:mobile/)),u=(0,g.useAnchor)({editableContentElement:n.current,settings:fe}),b=(0,y.useCallback)((n=>{i(!n);const s=e.replacements.slice();s[e.start]={...xe,attributes:{...o,class:S()({"sme-br--disable:desktop":!n,"sme-br--disable:tablet":a,"sme-br--disable:mobile":c})}},t({...e,replacements:s})}),[a,c]),v=(0,y.useCallback)((n=>{l(!n);const s=e.replacements.slice();s[e.start]={...xe,attributes:{...o,class:S()({"sme-br--disable:desktop":r,"sme-br--disable:tablet":!n,"sme-br--disable:mobile":c})}},t({...e,replacements:s})}),[r,c]),C=(0,y.useCallback)((n=>{m(!n);const s=e.replacements.slice();s[e.start]={...xe,attributes:{...o,class:S()({"sme-br--disable:desktop":r,"sme-br--disable:tablet":a,"sme-br--disable:mobile":!n})}},t({...e,replacements:s})}),[r,a]);return(0,h.jsx)(d.Popover,{placement:"bottom",shift:!0,focusOnMount:!1,anchor:u,className:"sme-popover sme-popover--inline-br",children:(0,h.jsxs)("div",{style:{width:"260px"},children:[(0,h.jsx)(d.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,p.__)("Line breaks when on the desktop","snow-monkey-editor"),checked:!r,onChange:b,disabled:a&&c}),(0,h.jsx)(d.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,p.__)("Line breaks when on the tablet","snow-monkey-editor"),checked:!a,onChange:v,disabled:r&&c}),(0,h.jsx)(d.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,p.__)("Line breaks when on the mobile","snow-monkey-editor"),checked:!c,onChange:C,disabled:r&&a})]})})}const fe={name:ve,title:Ce,tagName:"span",className:"sme-br",attributes:{class:"class"},interactive:!0,contentEditable:!1,edit:function({value:e,onChange:t,onFocus:o,isObjectActive:n,activeObjectAttributes:s,contentRef:r}){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(k,{icon:(0,h.jsx)("span",{className:"dashicon",children:(0,h.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.0224 5.25C18.4366 5.25 18.7724 5.58579 18.7724 6V15C18.7724 15.4142 18.4366 15.75 18.0224 15.75L18.0112 15.7499L18 15.75H10.0784V19L4.5 14.8349L10.0784 10.6699V14.25H17.2724V6C17.2724 5.58579 17.6082 5.25 18.0224 5.25Z",fill:"currentColor"})})}),title:Ce,onClick:()=>{const n=(0,g.insertObject)(e,{...xe},e.end,e.end);n.start=n.end-1,t(n),o()},isActive:n}),n&&(0,h.jsx)(ye,{value:e,onChange:t,activeObjectAttributes:s,contentRef:r})]})}};C(e),C(t),C(n),C(s),C(r),C(i),C(a),C(l),C(c);const ke=window.wp.compose,we=window.wp.hooks;(0,we.addFilter)("editor.BlockListBlock","snow-monkey-editor/ordered-list/orderd-styles",(0,ke.createHigherOrderComponent)((e=>t=>{const{attributes:o,name:n}=t?.block,{start:s,reversed:r,ordered:i,className:a}=o;return"core/list"!==n?(0,h.jsx)(e,{...t}):(a?.match("is-style-sme-ordered-list-square")||a?.match("is-style-sme-ordered-list-circle"))&&i?(0,h.jsx)(e,{...t,wrapperProps:{...t.wrapperProps,style:{...t.wrapperProps?.style,counterReset:r?`sme-count ${s+1}`:"sme-count "+(s-1)}}}):(0,h.jsx)(e,{...t})}),"withSnowMonkeyEditorOrderdListOrderdStyles"));const je=window.wp.blocks,_e=window.wp.preferences;const Se="snow-monkey-editor/preferences",Re=["allowedBlocks","content","templateLock","placeholder"],Ne=e=>!(({name:e}={})=>!(0,je.hasBlockSupport)(e,"snowmonkeyeditor.blockPresets"))(e)&&(!!function(e,t){if(!e||!Object.keys(e).length)return!1;const o=function(e){return(0,we.applyFilters)("SnowMonkeyEditor.extension.allowedRoles",["administrator","editor","author","contributor"],e)}(t);return 0<e.roles.filter((e=>-1<o.indexOf(e))).length}(snowmonkeyeditor?.currentUser,"block-presets")&&!!(0,je.getBlockType)(e.name)),Fe=(0,ke.createHigherOrderComponent)((e=>((0,x.dispatch)(_e.store).setDefaults(Se,{blockPresets:{}}),t=>{if(!Ne(t))return(0,h.jsx)(e,{...t});const{name:o,attributes:n,setAttributes:s}=t,[r,i]=(0,y.useState)(void 0),[a,l]=(0,y.useState)(0),c=(0,x.useSelect)((e=>e(_e.store).get(Se,"blockPresets")),[]),m=c?.[o],g=(0,je.getBlockSupport)(o,"snowmonkeyeditor.blockPresets"),b=g?.ignore||[],v=({blockName:e,presetName:t,preset:o})=>(0,h.jsxs)("div",{className:"sme-editor-block-presets__preset",children:[(0,h.jsx)(d.Button,{onClick:()=>{const t=(0,je.getBlockType)(e),n={};Object.keys(t.attributes).forEach((e=>{n[e]=void 0})),Re.forEach((e=>{delete n[e],delete o[e]})),b.forEach((e=>{delete n[e],delete o[e]})),s({...n,...o})},variant:"secondary",children:t}),(0,h.jsx)(d.Button,{label:(0,p.__)("Remove this preset","snow-monkey-editor"),onClick:()=>{const o={...c};delete o?.[e]?.[t],(0,x.dispatch)(_e.store).set(Se,"blockPresets",o),l(a+1)},variant:"tertiary",children:"x"})]});return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(e,{...t}),(0,h.jsx)(u.InspectorControls,{children:(0,h.jsxs)(d.PanelBody,{title:(0,p.__)("Presets","snow-monkey-editor"),children:[!!m&&!!Object.values(m)&&(0,h.jsx)("div",{className:"sme-editor-block-presets",children:Object.values(m).map(((e,t)=>{const n=Object.keys(m)[t];return(0,h.jsx)(v,{blockName:o,presetName:n,preset:e},t)}))}),(0,h.jsxs)("div",{className:"sme-editor-block-presets-inserter",children:[(0,h.jsx)("h3",{className:"sme-editor-block-presets-inserter__title",children:(0,p.__)("Save current settings as a preset","snow-monkey-editor")}),(0,h.jsxs)("div",{className:"sme-editor-block-presets-inserter__control",children:[(0,h.jsx)(d.TextControl,{__nextHasNoMarginBottom:!0,value:r||"",placeholder:(0,p.__)("Input the preset name.","snow-monkey-editor"),onChange:e=>i(e)}),(0,h.jsx)(d.Button,{variant:"primary",disabled:!r,onClick:async()=>{const e={...n};Re.forEach((t=>{delete e[t]})),b.forEach((t=>{delete e[t]}));const t={...c,[o]:{...m,[r]:{...e}}};(0,x.dispatch)(_e.store).set(Se,"blockPresets",t),i(void 0)},children:(0,p.__)("Save","snow-monkey-editor")})]})]})]})})]})})),"withInspectorControl");(0,we.addFilter)("editor.BlockEdit","snow-monkey-editor/block-presets/with-inspector-controls",Fe,100),(0,we.addFilter)("blocks.registerBlockType","snow-monkey-editor/block-presets/support",((e,t)=>{let o=!1;return"core/button"===t?o={ignore:["url","title","text","linkTarget","rel"]}:"core/cover"===t?o={ignore:["url"]}:"core/list"===t?o={ignore:["values"]}:"core/paragraph"!==t&&"core/group"!==t&&"core/columns"!==t&&"core/column"!==t&&"core/heading"!==t||(o=!0),!1===o?e:{...e,supports:{...e.supports,snowmonkeyeditor:{blockPresets:o}}}}))})()})(); -
snow-monkey-editor/trunk/readme.txt
r3203380 r3222617 5 5 Requires at least: 6.6 6 6 Tested up to: 6.7 7 Stable tag: 10.1. 07 Stable tag: 10.1.1 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 193 193 == Changelog == 194 194 195 = 10.1.1 = 196 * Improved popover display when there are many roles in "Edit lock (by role)" and "Display settings (by role)". 197 195 198 = 10.1.0 = 196 199 * Add animation "Fade in left". -
snow-monkey-editor/trunk/snow-monkey-editor.php
r3203380 r3222617 2 2 /** 3 3 * Plugin name: Snow Monkey Editor 4 * Version: 10.1. 04 * Version: 10.1.1 5 5 * Description: Extends gutenberg block editor 6 6 * Author: inc2734 -
snow-monkey-editor/trunk/src/css/editor.scss
r3183004 r3222617 57 57 58 58 .block-editor-tools-panel-color-gradient-settings__item:first-child { 59 margin-top: 0; 59 60 border-top: 1px solid #ddd; 60 61 } -
snow-monkey-editor/trunk/src/extension/animation/editor.js
r3203380 r3222617 160 160 }, 161 161 label: __( 'Animation', 'snow-monkey-editor' ), 162 name: 'animation', 162 163 isShown, 163 164 Content, -
snow-monkey-editor/trunk/src/extension/date-time/editor.js
r2916141 r3222617 73 73 props.setAttributes( { smeStartDateTime: undefined } ), 74 74 label: __( 'Publish setting', 'snow-monkey-editor' ), 75 name: 'date-time', 75 76 isShown, 76 77 Content: PublishContent, -
snow-monkey-editor/trunk/src/extension/editing-lock/_editor.scss
r2949849 r3222617 14 14 } 15 15 } 16 17 .sme-popover--editing-lock fieldset { 18 max-height: 215px; 19 overflow: auto; 20 padding: 3px; 21 } -
snow-monkey-editor/trunk/src/extension/editing-lock/editor.js
r3183004 r3222617 158 158 props.setAttributes( { smeIsEditingLockRoles: [] } ), 159 159 label: __( 'Editing lock (By roles)', 'snow-monkey-editor' ), 160 name: 'editing-lock', 160 161 isShown, 161 162 Content, -
snow-monkey-editor/trunk/src/extension/editor.js
r2949849 r3222617 155 155 <Dropdown 156 156 popoverProps={ { 157 className: 158 'sme-popover', 157 className: `sme-popover sme-popover--${ setting.name }`, 159 158 placement: 'left-start', 160 159 offset: 36, -
snow-monkey-editor/trunk/src/extension/hidden-by-role/_editor.scss
r2889548 r3222617 2 2 display: none !important; 3 3 } 4 5 .sme-popover--hidden-by-role fieldset { 6 max-height: 215px; 7 overflow: auto; 8 padding: 3px; 9 } -
snow-monkey-editor/trunk/src/extension/hidden-by-role/editor.js
r3183004 r3222617 180 180 }, 181 181 label: __( 'Display setting (By roles)', 'snow-monkey-editor' ), 182 name: 'hidden-by-role', 182 183 isShown, 183 184 Content, -
snow-monkey-editor/trunk/src/extension/hidden-by-size/editor.js
r3183004 r3222617 128 128 }, 129 129 label: __( 'Display setting (By window size)', 'snow-monkey-editor' ), 130 name: 'hidden-by-size', 130 131 isShown, 131 132 Content, -
snow-monkey-editor/trunk/src/format/br/editor.js
r3183004 r3222617 123 123 focusOnMount={ false } 124 124 anchor={ popoverAnchor } 125 className="sme-popover "125 className="sme-popover sme-popover--inline-br" 126 126 > 127 127 <div -
snow-monkey-editor/trunk/vendor/composer/InstalledVersions.php
r2889548 r3222617 323 323 324 324 $installed = array(); 325 $copiedLocalDir = false; 325 326 326 327 if (self::$canGetVendors) { … … 331 332 /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */ 332 333 $required = require $vendorDir.'/composer/installed.php'; 333 $installed[] = self::$installedByVendor[$vendorDir] = $required; 334 if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 335 self::$installed = $installed[count($installed) - 1]; 334 self::$installedByVendor[$vendorDir] = $required; 335 $installed[] = $required; 336 if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { 337 self::$installed = $required; 338 $copiedLocalDir = true; 336 339 } 337 340 } … … 351 354 } 352 355 353 if (self::$installed !== array() ) {356 if (self::$installed !== array() && !$copiedLocalDir) { 354 357 $installed[] = self::$installed; 355 358 }
Note: See TracChangeset
for help on using the changeset viewer.