Plugin Directory

Changeset 3183004


Ignore:
Timestamp:
11/06/2024 09:55:59 AM (4 months ago)
Author:
inc2734
Message:

Version up. v10.0.5

Location:
snow-monkey-editor/trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • snow-monkey-editor/trunk/dist/css/editor.css

    r3119407 r3183004  
    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}.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}.sme-popover fieldset{padding:16px}.sme-popover .components-dropdown-content-wrapper .sme-popover__title{font-weight:700;padding:16px 16px 0}.sme-popover .components-dropdown-content-wrapper fieldset{padding: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}.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}
  • snow-monkey-editor/trunk/dist/js/editor-extension.asset.php

    r3119407 r3183004  
    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' => '01532bd62bc0932a5e0f');
     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' => '3499fdc0e38b7bc00841');
  • snow-monkey-editor/trunk/dist/js/editor-extension.js

    r3119407 r3183004  
    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,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"),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)(p.Fragment,{children:[(0,p.jsx)(s.ToggleControl,{label:(0,a.__)("Hide on smartphone size","snow-monkey-editor"),checked:r,onChange:e=>{o({smeIsHiddenSm:e})}}),(0,p.jsx)(s.ToggleControl,{label:(0,a.__)("Hide on tablet size","snow-monkey-editor"),checked:i,onChange:e=>{o({smeIsHiddenMd:e})}}),(0,p.jsx)(s.ToggleControl,{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)}},x={*getRoles(){yield k.fetchRoles()}},_=(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:x});(0,g.register)(_);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,g.useSelect)((e=>{const t={...e(_).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)(p.Fragment,{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 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 p=JSON.parse('{"smeIsHiddenSm":{"type":"boolean","default":false},"smeIsHiddenMd":{"type":"boolean","default":false},"smeIsHiddenLg":{"type":"boolean","default":false}}'),b=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:p.smeIsHiddenSm.default,smeIsHiddenMd:p.smeIsHiddenMd.default,smeIsHiddenLg:p.smeIsHiddenLg.default})},resetClassnames:()=>({"sme-hidden-sm":p.smeIsHiddenSm.default,"sme-hidden-md":p.smeIsHiddenMd.default,"sme-hidden-lg-up":p.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,b.jsxs)(s.__experimentalVStack,{spacing:"16px",children:[(0,b.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Hide on smartphone size","snow-monkey-editor"),checked:r,onChange:e=>{o({smeIsHiddenSm:e})}}),(0,b.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Hide on tablet size","snow-monkey-editor"),checked:i,onChange:e=>{o({smeIsHiddenMd:e})}}),(0,b.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,b.jsx)(s.__experimentalVStack,{spacing:"16px",children:Object.keys(d).map((e=>{const t=(0,a.sprintf)(
    22// translators: %1$s: The role name
    33// 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,{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"}}'),A=[{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"}],S={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={};A.forEach((t=>{e[`sme-animation-${t.value}`]=!1})),r&&(e[`sme-animation-${r}`]=!0),o({className:t()(d,{...e})})}),[r]),(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(s.SelectControl,{label:(0,a.__)("Animation","snow-monkey-editor"),value:r||void 0,options:A,onChange:e=>{o({smeAnimation:e}),e||o({smeAnimationDelay:v.smeAnimationDelay.default})}}),(0,p.jsx)(s.RangeControl,{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,{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"}}'),I=window.wp.date;function D({currentDate:e,onChange:t,onReset:n}){const o=(0,I.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 E=e=>!!u(snowmonkeyeditor?.currentUser,"date-time")&&(!!c(e.name,"date-time")&&!!(0,d.getBlockType)(e.name)),H={resetAll:{},hasValue:e=>!!e.attributes?.smeStartDateTime,resetValue:e=>e.setAttributes({smeStartDateTime:void 0}),label:(0,a.__)("Publish setting","snow-monkey-editor"),isShown:E,Content:e=>{const{attributes:t,setAttributes:n}=e,{smeStartDateTime:s}=t;return(0,p.jsx)(D,{currentDate:s,onChange:e=>n({smeStartDateTime:e}),onReset:()=>n({smeStartDateTime:void 0})})}},R={resetAll:{},hasValue:e=>!!e.attributes?.smeEndDateTime,resetValue:e=>e.setAttributes({smeEndDateTime:void 0}),label:(0,a.__)("Unpublish setting","snow-monkey-editor"),isShown:E,Content:e=>{const{attributes:t,setAttributes:n}=e,{smeEndDateTime:s}=t;return(0,p.jsx)(D,{currentDate:s,onChange:e=>n({smeEndDateTime:e}),onReset:()=>n({smeEndDateTime:void 0})})}},N=JSON.parse('{"smeIsEditingLockRoles":{"type":"array","default":[]}}'),T=e=>0<(0,l.intersection)(e.attributes.smeIsEditingLockRoles,snowmonkeyeditor?.currentUser?.roles).length,O={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,g.useSelect)((e=>{const t={...e(_).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)(p.Fragment,{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 r&&r.includes(e);return(0,b.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,b.jsx)("div",{className:"sme-hidden-by-role",children:n}):(0,b.jsx)(b.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"}],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,b.jsxs)(s.__experimentalVStack,{spacing:"16px",children:[(0,b.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,b.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,b.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,b.jsxs)("div",{className:"sme-date-time-picker",children:[(0,b.jsx)(s.DateTimePicker,{currentDate:e,onChange:t,is12Hour:r}),(0,b.jsxs)("div",{className:"sme-date-time-picker__action",children:[(0,b.jsx)("div",{children:e}),(0,b.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,b.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,b.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,b.jsx)(s.__experimentalVStack,{spacing:"16px",children:Object.keys(i).map((e=>{const t=(0,a.sprintf)(
    55// translators: %1$s: The role name
    66// 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,{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})},B=(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"})}),L=[h,j,S,H,R,O],U=(0,r.createHigherOrderComponent)((e=>n=>{const r=L.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:()=>{L.forEach((e=>e.resetValue(n)));let e={};L.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:L.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:B,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,...N},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",U,101),L&&L.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"),i[e].name),o="object"==typeof r&&r.includes(e);return(0,b.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,b.jsx)(s.Disabled,{children:e.children}):(0,b.jsx)(b.Fragment,{children:e.children})},O=(0,b.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,b.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,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(e,{...n}),r&&(0,b.jsx)(o.InspectorControls,{children:(0,b.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,b.jsx)("div",{className:"color-block-support-panel__inner-wrapper",style:{gridColumn:"1 / -1"},children:V.map(((e,o)=>e.isShown(n)&&(0,b.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,b.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,b.jsxs)(s.Button,{onClick:n,"aria-expanded":t,className:"block-editor-panel-color-gradient-settings__dropdown",children:[e.label,(0,b.jsx)(s.Icon,{icon:O,className:"components-panel__icon",size:20})]}),renderContent:()=>(0,b.jsxs)(s.__experimentalDropdownContentWrapper,{paddingSize:"none",children:[(0,b.jsx)("div",{className:"sme-popover__title",children:e.label}),(0,b.jsx)("fieldset",{children:(0,b.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,...p},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,b.jsx)(s,{...n,children:(0,b.jsx)(t,{...n})}):(0,b.jsx)(t,{...n})})))}))})()})();
  • snow-monkey-editor/trunk/dist/js/editor.asset.php

    r3120595 r3183004  
    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' => '9ae1c3e38f850affa4ce');
     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');
  • snow-monkey-editor/trunk/dist/js/editor.js

    r3120595 r3183004  
    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:()=>V});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")})]})},F=(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})})})})),N="snow-monkey-editor/font-size",A=(0,p.__)("Font size","snow-monkey-editor"),B={name:N,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)(F,{name:N,activeAttributes:s,value:t,onClose:()=>l(!1),onReset:()=>{l(!1),o((0,g.removeFormat)(t,N))},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:N,attributes:s?{class:(0,u.getFontSizeClass)(s.slug)}:{style:`font-size: ${n}`}}))}else o((0,g.removeFormat)(t,N))},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,{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,{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",L=(0,p.__)("Line height","snow-monkey-editor"),V={name:$,title:L,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:L,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:L,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:V})]})}};function H(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)((()=>H(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)((()=>H(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:"block-editor-format-toolbar__image-popover",children:(0,h.jsxs)("div",{style:{width:"260px",padding:"16px"},children:[(0,h.jsx)(d.ToggleControl,{label:(0,p.__)("Line breaks when on the desktop","snow-monkey-editor"),checked:!r,onChange:b,disabled:a&&c}),(0,h.jsx)(d.ToggleControl,{label:(0,p.__)("Line breaks when on the tablet","snow-monkey-editor"),checked:!a,onChange:v,disabled:r&&c}),(0,h.jsx)(d.ToggleControl,{label:(0,p.__)("Line breaks when on the mobile","snow-monkey-editor"),checked:!c,onChange:C,disabled:r&&a,__nextHasNoMarginBottom:!0})]})})}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"],Fe=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)),Ne=(0,ke.createHigherOrderComponent)((e=>((0,x.dispatch)(_e.store).setDefaults(Se,{blockPresets:{}}),t=>{if(!Fe(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,{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",Ne,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",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

    r3134282 r3183004  
    44Tags: gutenberg, block, blocks, editor, gutenberg blocks, page builder
    55Requires at least: 6.6
    6 Tested up to: 6.6
    7 Stable tag: 10.0.4
     6Tested up to: 6.7-rc1
     7Stable tag: 10.0.5
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    193193== Changelog ==
    194194
     195= 10.0.5 =
     196* WordPress 6.7 compatible.
     197
    195198= 10.0.4 =
    196199* Replace node-sass to sass.
  • snow-monkey-editor/trunk/snow-monkey-editor.php

    r3134282 r3183004  
    22/**
    33 * Plugin name: Snow Monkey Editor
    4  * Version: 10.0.4
     4 * Version: 10.0.5
    55 * Description: Extends gutenberg block editor
    66 * Author: inc2734
     
    7171    public function _bootstrap() {
    7272        add_filter( 'load_textdomain_mofile', array( $this, '_load_textdomain_mofile' ), 10, 2 );
    73 
     73        add_filter( 'init', array( $this, '_init' ) );
     74
     75        new App\Setup\Assets();
     76        new App\Setup\BlockStyles();
     77        new App\Setup\CurrentUser();
     78        new App\Setup\Endpoint();
     79    }
     80
     81    /**
     82     * When local .mo file exists, load this.
     83     *
     84     * @param string $mofile Path to the MO file.
     85     * @param string $domain Text domain. Unique identifier for retrieving translated strings.
     86     * @return string
     87     */
     88    public function _load_textdomain_mofile( $mofile, $domain ) {
     89        if ( 'snow-monkey-editor' !== $domain ) {
     90            return $mofile;
     91        }
     92
     93        $mofilename   = basename( $mofile );
     94        $local_mofile = SNOW_MONKEY_EDITOR_PATH . '/languages/' . $mofilename;
     95        if ( ! file_exists( $local_mofile ) ) {
     96            return $mofile;
     97        }
     98
     99        return $local_mofile;
     100    }
     101
     102    /**
     103     * Load textdomain.
     104     */
     105    public function _init() {
    74106        load_plugin_textdomain(
    75107            'snow-monkey-editor',
     
    77109            basename( SNOW_MONKEY_EDITOR_PATH ) . '/languages'
    78110        );
    79 
    80         new App\Setup\Assets();
    81         new App\Setup\BlockStyles();
    82         new App\Setup\CurrentUser();
    83         new App\Setup\Endpoint();
    84     }
    85 
    86     /**
    87      * When local .mo file exists, load this.
    88      *
    89      * @param string $mofile Path to the MO file.
    90      * @param string $domain Text domain. Unique identifier for retrieving translated strings.
    91      * @return string
    92      */
    93     public function _load_textdomain_mofile( $mofile, $domain ) {
    94         if ( 'snow-monkey-editor' !== $domain ) {
    95             return $mofile;
    96         }
    97 
    98         $mofilename   = basename( $mofile );
    99         $local_mofile = SNOW_MONKEY_EDITOR_PATH . '/languages/' . $mofilename;
    100         if ( ! file_exists( $local_mofile ) ) {
    101             return $mofile;
    102         }
    103 
    104         return $local_mofile;
    105111    }
    106112
  • snow-monkey-editor/trunk/src/block-presets/editor.js

    r2916141 r3183004  
    170170                            <div className="sme-editor-block-presets-inserter__control">
    171171                                <TextControl
     172                                    __nextHasNoMarginBottom
    172173                                    value={ newPresetName || '' }
    173174                                    placeholder={ __(
  • snow-monkey-editor/trunk/src/css/editor.scss

    r3134282 r3183004  
    66.sme-popover {
    77    .components-popover__content {
     8        padding: 16px;
    89        min-width: 260px;
    910        max-height: none !important;
    1011        overflow: visible !important;
    11     }
    1212
    13     fieldset {
    14         padding: 16px;
     13        > * {
     14            > * + * {
     15                margin-top: 8px;
     16            }
     17        }
    1518    }
    1619
    1720    // ToolsPanelItem Popover
    1821    .components-dropdown-content-wrapper {
     22        margin: 0 !important;
     23
    1924        .sme-popover__title {
    2025            font-weight: bold;
    21             padding: 16px 16px 0;
     26            margin-bottom: 16px;
    2227        }
    2328
    24         fieldset {
    25             padding: 16px;
    26 
     29        > fieldset {
    2730            > :last-child {
    2831                margin-bottom: 0;
  • snow-monkey-editor/trunk/src/extension/animation/editor.js

    r2949849 r3183004  
    22
    33import { hasBlockSupport, getBlockType } from '@wordpress/blocks';
    4 import { SelectControl, RangeControl } from '@wordpress/components';
     4import {
     5    SelectControl,
     6    RangeControl,
     7    __experimentalVStack as VStack,
     8} from '@wordpress/components';
     9
    510import { useEffect } from '@wordpress/element';
    611import { __ } from '@wordpress/i18n';
     
    8085
    8186    return (
    82         <>
     87        <VStack spacing="16px">
    8388            <SelectControl
     89                __nextHasNoMarginBottom
    8490                label={ __( 'Animation', 'snow-monkey-editor' ) }
    8591                value={ smeAnimation || undefined }
     
    98104
    99105            <RangeControl
     106                __nextHasNoMarginBottom
    100107                label={ __( 'Delay', 'snow-monkey-editor' ) }
    101108                value={ smeAnimationDelay || 0 }
     
    110117
    111118            <RangeControl
     119                __nextHasNoMarginBottom
    112120                label={ __( 'Duration', 'snow-monkey-editor' ) }
    113121                value={ smeAnimationDuration || undefined }
     
    120128                step={ 0.1 }
    121129            />
    122         </>
     130        </VStack>
    123131    );
    124132};
  • snow-monkey-editor/trunk/src/extension/date-time/_editor.scss

    r2949849 r3183004  
    11.sme-date-time-picker {
    22    &__action {
     3        margin-top: 8px;
    34        display: flex;
    45        justify-content: space-between;
  • snow-monkey-editor/trunk/src/extension/editing-lock/editor.js

    r2916141 r3183004  
    11import { uniq, intersection, includes } from 'lodash';
    22
     3import {
     4    Disabled,
     5    ToggleControl,
     6    __experimentalVStack as VStack,
     7} from '@wordpress/components';
     8
    39import { getBlockType } from '@wordpress/blocks';
    4 import { Disabled, ToggleControl } from '@wordpress/components';
    510import { useSelect } from '@wordpress/data';
    611import { sprintf, __ } from '@wordpress/i18n';
     
    109114
    110115    return (
    111         <>
     116        <VStack spacing="16px">
    112117            { Object.keys( roles ).map( ( key ) => {
    113118                const labelEditingLockRole = sprintf(
     
    133138                return (
    134139                    <ToggleControl
     140                        __nextHasNoMarginBottom
    135141                        key={ `sme-editing-lock-role-${ key }` }
    136142                        label={ labelEditingLockRole }
     
    140146                );
    141147            } ) }
    142         </>
     148        </VStack>
    143149    );
    144150};
  • snow-monkey-editor/trunk/src/extension/hidden-by-role/editor.js

    r2949849 r3183004  
    22import classnames from 'classnames/dedupe';
    33
     4import {
     5    ToggleControl,
     6    __experimentalVStack as VStack,
     7} from '@wordpress/components';
     8
    49import { getBlockType } from '@wordpress/blocks';
    5 import { ToggleControl } from '@wordpress/components';
    610import { useSelect } from '@wordpress/data';
    711import { useEffect } from '@wordpress/element';
     
    123127
    124128    return (
    125         <>
     129        <VStack spacing="16px">
    126130            { Object.keys( rolesForHiddenByRoles ).map( ( key ) => {
    127131                const hiddenRoleLabel = sprintf(
     
    145149                return (
    146150                    <ToggleControl
     151                        __nextHasNoMarginBottom
    147152                        key={ `sme-hidden-role-${ key }` }
    148153                        label={ hiddenRoleLabel }
     
    152157                );
    153158            } ) }
    154         </>
     159        </VStack>
    155160    );
    156161};
  • snow-monkey-editor/trunk/src/extension/hidden-by-size/editor.js

    r2949849 r3183004  
    22import classnames from 'classnames/dedupe';
    33
     4import {
     5    ToggleControl,
     6    __experimentalVStack as VStack,
     7} from '@wordpress/components';
     8
    49import { hasBlockSupport, getBlockType } from '@wordpress/blocks';
    5 import { ToggleControl } from '@wordpress/components';
    610import { useEffect } from '@wordpress/element';
    711import { __ } from '@wordpress/i18n';
     
    6367
    6468    return (
    65         <>
     69        <VStack spacing="16px">
    6670            <ToggleControl
     71                __nextHasNoMarginBottom
    6772                label={ __( 'Hide on smartphone size', 'snow-monkey-editor' ) }
    6873                checked={ smeIsHiddenSm }
     
    7580
    7681            <ToggleControl
     82                __nextHasNoMarginBottom
    7783                label={ __( 'Hide on tablet size', 'snow-monkey-editor' ) }
    7884                checked={ smeIsHiddenMd }
     
    8591
    8692            <ToggleControl
     93                __nextHasNoMarginBottom
    8794                label={ __( 'Hide on PC size', 'snow-monkey-editor' ) }
    8895                checked={ smeIsHiddenLg }
     
    93100                } }
    94101            />
    95         </>
     102        </VStack>
    96103    );
    97104};
  • snow-monkey-editor/trunk/src/format/br/editor.js

    r3069302 r3183004  
    123123            focusOnMount={ false }
    124124            anchor={ popoverAnchor }
    125             className="block-editor-format-toolbar__image-popover"
     125            className="sme-popover"
    126126        >
    127127            <div
    128128                style={ {
    129129                    width: '260px',
    130                     padding: '16px',
    131130                } }
    132131            >
    133132                <ToggleControl
     133                    __nextHasNoMarginBottom
    134134                    label={ __(
    135135                        'Line breaks when on the desktop',
     
    142142
    143143                <ToggleControl
     144                    __nextHasNoMarginBottom
    144145                    label={ __(
    145146                        'Line breaks when on the tablet',
     
    152153
    153154                <ToggleControl
     155                    __nextHasNoMarginBottom
    154156                    label={ __(
    155157                        'Line breaks when on the mobile',
     
    159161                    onChange={ onChangeMobile }
    160162                    disabled={ disableDesktop && disableTablet }
    161                     __nextHasNoMarginBottom
    162163                />
    163164            </div>
  • snow-monkey-editor/trunk/src/format/component/inline-letter-spacing.js

    r3033439 r3183004  
    4040        <>
    4141            <RangeControl
     42                __nextHasNoMarginBottom
    4243                label={ title }
    4344                value={ activeLetterSpacing }
  • snow-monkey-editor/trunk/src/format/component/inline-line-height.js

    r3033439 r3183004  
    3535        <>
    3636            <RangeControl
     37                __nextHasNoMarginBottom
    3738                label={ title }
    3839                value={ activeLineHeight }
Note: See TracChangeset for help on using the changeset viewer.