diff options
Diffstat (limited to 'wp-includes/js/dist/preferences.min.js')
-rw-r--r-- | wp-includes/js/dist/preferences.min.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/wp-includes/js/dist/preferences.min.js b/wp-includes/js/dist/preferences.min.js index 101a6de..8cf295b 100644 --- a/wp-includes/js/dist/preferences.min.js +++ b/wp-includes/js/dist/preferences.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{PreferenceToggleMenuItem:()=>y,privateApis:()=>F,store:()=>h});var n={};e.r(n),e.d(n,{set:()=>E,setDefaults:()=>f,setPersistenceLayer:()=>_,toggle:()=>u});var r={};e.r(r),e.d(r,{get:()=>b});const a=window.React,s=window.wp.data,o=window.wp.components,c=window.wp.i18n,l=window.wp.primitives,i=(0,a.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(l.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),d=window.wp.a11y;const m=function(e){let t;return(n,r)=>{if("SET_PERSISTENCE_LAYER"===r.type){const{persistenceLayer:e,persistedData:n}=r;return t=e,n}const a=e(n,r);return"SET_PREFERENCE_VALUE"===r.type&&t?.set(a),a}}(((e={},t)=>{if("SET_PREFERENCE_VALUE"===t.type){const{scope:n,name:r,value:a}=t;return{...e,[n]:{...e[n],[r]:a}}}return e})),p=(0,s.combineReducers)({defaults:function(e={},t){if("SET_PREFERENCE_DEFAULTS"===t.type){const{scope:n,defaults:r}=t;return{...e,[n]:{...e[n],...r}}}return e},preferences:m});function u(e,t){return function({select:n,dispatch:r}){const a=n.get(e,t);r.set(e,t,!a)}}function E(e,t,n){return{type:"SET_PREFERENCE_VALUE",scope:e,name:t,value:n}}function f(e,t){return{type:"SET_PREFERENCE_DEFAULTS",scope:e,defaults:t}}async function _(e){const t=await e.get();return{type:"SET_PERSISTENCE_LAYER",persistenceLayer:e,persistedData:t}}const w=window.wp.deprecated;var g=e.n(w);const b=(v=(e,t,n)=>{const r=e.preferences[t]?.[n];return void 0!==r?r:e.defaults[t]?.[n]},(e,t,n)=>["allowRightClickOverrides","distractionFree","editorMode","fixedToolbar","focusMode","hiddenBlockTypes","inactivePanels","keepCaretInsideBlock","mostUsedBlocks","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault"].includes(n)&&["core/edit-post","core/edit-site"].includes(t)?(g()(`wp.data.select( 'core/preferences' ).get( '${t}', '${n}' )`,{since:"6.5",alternative:`wp.data.select( 'core/preferences' ).get( 'core', '${n}' )`}),v(e,"core",n)):v(e,t,n));var v;const h=(0,s.createReduxStore)("core/preferences",{reducer:p,actions:n,selectors:r});function y({scope:e,name:t,label:n,info:r,messageActivated:l,messageDeactivated:m,shortcut:p,handleToggling:u=!0,onToggle:E=(()=>null),disabled:f=!1}){const _=(0,s.useSelect)((n=>!!n(h).get(e,t)),[e,t]),{toggle:w}=(0,s.useDispatch)(h);return(0,a.createElement)(o.MenuItem,{icon:_&&i,isSelected:_,onClick:()=>{E(),u&&w(e,t),(()=>{if(_){const e=m||(0,c.sprintf)((0,c.__)("Preference deactivated - %s"),n);(0,d.speak)(e)}else{const e=l||(0,c.sprintf)((0,c.__)("Preference activated - %s"),n);(0,d.speak)(e)}})()},role:"menuitemcheckbox",info:r,shortcut:p,disabled:f},n)}(0,s.register)(h);const T=function({help:e,label:t,isChecked:n,onChange:r,children:s}){return(0,a.createElement)("div",{className:"preference-base-option"},(0,a.createElement)(o.ToggleControl,{__nextHasNoMarginBottom:!0,help:e,label:t,checked:n,onChange:r}),s)};const P=function(e){const{scope:t,featureName:n,onToggle:r=(()=>{}),...o}=e,c=(0,s.useSelect)((e=>!!e(h).get(t,n)),[t,n]),{toggle:l}=(0,s.useDispatch)(h);return(0,a.createElement)(T,{onChange:()=>{r(),l(t,n)},isChecked:c,...o})};const S=({description:e,title:t,children:n})=>(0,a.createElement)("fieldset",{className:"preferences-modal__section"},(0,a.createElement)("legend",{className:"preferences-modal__section-legend"},(0,a.createElement)("h2",{className:"preferences-modal__section-title"},t),e&&(0,a.createElement)("p",{className:"preferences-modal__section-description"},e)),(0,a.createElement)("div",{className:"preferences-modal__section-content"},n)),C=window.wp.compose,N=window.wp.element;const x=(0,N.forwardRef)((function({icon:e,size:t=24,...n},r){return(0,N.cloneElement)(e,{width:t,height:t,...n,ref:r})})),k=(0,a.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(l.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),M=(0,a.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(l.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),R=window.wp.privateApis,{lock:L,unlock:B}=(0,R.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/preferences"),{Tabs:I}=B(o.privateApis),A="preferences-menu";const F={};L(F,{PreferenceBaseOption:T,PreferenceToggleControl:P,PreferencesModal:function({closeModal:e,children:t}){return(0,a.createElement)(o.Modal,{className:"preferences-modal",title:(0,c.__)("Preferences"),onRequestClose:e},t)},PreferencesModalSection:S,PreferencesModalTabs:function({sections:e}){const t=(0,C.useViewportMatch)("medium"),[n,r]=(0,N.useState)(A),{tabs:s,sectionsContentMap:l}=(0,N.useMemo)((()=>{let t={tabs:[],sectionsContentMap:{}};return e.length&&(t=e.reduce(((e,{name:t,tabLabel:n,content:r})=>(e.tabs.push({name:t,title:n}),e.sectionsContentMap[t]=r,e)),{tabs:[],sectionsContentMap:{}})),t}),[e]);let i;return i=t?(0,a.createElement)("div",{className:"preferences__tabs"},(0,a.createElement)(I,{initialTabId:n!==A?n:void 0,onSelect:r,orientation:"vertical"},(0,a.createElement)(I.TabList,{className:"preferences__tabs-tablist"},s.map((e=>(0,a.createElement)(I.Tab,{tabId:e.name,key:e.name,className:"preferences__tabs-tab"},e.title)))),s.map((e=>(0,a.createElement)(I.TabPanel,{tabId:e.name,key:e.name,className:"preferences__tabs-tabpanel",focusable:!1},l[e.name]||null))))):(0,a.createElement)(o.__experimentalNavigatorProvider,{initialPath:"/",className:"preferences__provider"},(0,a.createElement)(o.__experimentalNavigatorScreen,{path:"/"},(0,a.createElement)(o.Card,{isBorderless:!0,size:"small"},(0,a.createElement)(o.CardBody,null,(0,a.createElement)(o.__experimentalItemGroup,null,s.map((e=>(0,a.createElement)(o.__experimentalNavigatorButton,{key:e.name,path:e.name,as:o.__experimentalItem,isAction:!0},(0,a.createElement)(o.__experimentalHStack,{justify:"space-between"},(0,a.createElement)(o.FlexItem,null,(0,a.createElement)(o.__experimentalTruncate,null,e.title)),(0,a.createElement)(o.FlexItem,null,(0,a.createElement)(x,{icon:(0,c.isRTL)()?k:M})))))))))),e.length&&e.map((e=>(0,a.createElement)(o.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,a.createElement)(o.Card,{isBorderless:!0,size:"large"},(0,a.createElement)(o.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,a.createElement)(o.__experimentalNavigatorBackButton,{icon:(0,c.isRTL)()?M:k,"aria-label":(0,c.__)("Navigate to the previous view")}),(0,a.createElement)(o.__experimentalText,{size:"16"},e.tabLabel)),(0,a.createElement)(o.CardBody,null,e.content)))))),i}}),(window.wp=window.wp||{}).preferences=t})();
\ No newline at end of file +(()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var s in n)e.o(n,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:n[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{PreferenceToggleMenuItem:()=>v,privateApis:()=>A,store:()=>j});var n={};e.r(n),e.d(n,{set:()=>f,setDefaults:()=>h,setPersistenceLayer:()=>_,toggle:()=>m});var s={};e.r(s),e.d(s,{get:()=>g});const r=window.wp.data,a=window.wp.components,o=window.wp.i18n,i=window.wp.primitives,c=window.ReactJSXRuntime,l=(0,c.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(i.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),d=window.wp.a11y;const p=function(e){let t;return(n,s)=>{if("SET_PERSISTENCE_LAYER"===s.type){const{persistenceLayer:e,persistedData:n}=s;return t=e,n}const r=e(n,s);return"SET_PREFERENCE_VALUE"===s.type&&t?.set(r),r}}(((e={},t)=>{if("SET_PREFERENCE_VALUE"===t.type){const{scope:n,name:s,value:r}=t;return{...e,[n]:{...e[n],[s]:r}}}return e})),u=(0,r.combineReducers)({defaults:function(e={},t){if("SET_PREFERENCE_DEFAULTS"===t.type){const{scope:n,defaults:s}=t;return{...e,[n]:{...e[n],...s}}}return e},preferences:p});function m(e,t){return function({select:n,dispatch:s}){const r=n.get(e,t);s.set(e,t,!r)}}function f(e,t,n){return{type:"SET_PREFERENCE_VALUE",scope:e,name:t,value:n}}function h(e,t){return{type:"SET_PREFERENCE_DEFAULTS",scope:e,defaults:t}}async function _(e){const t=await e.get();return{type:"SET_PERSISTENCE_LAYER",persistenceLayer:e,persistedData:t}}const w=window.wp.deprecated;var x=e.n(w);const g=(b=(e,t,n)=>{const s=e.preferences[t]?.[n];return void 0!==s?s:e.defaults[t]?.[n]},(e,t,n)=>["allowRightClickOverrides","distractionFree","editorMode","fixedToolbar","focusMode","hiddenBlockTypes","inactivePanels","keepCaretInsideBlock","mostUsedBlocks","openPanels","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","isPublishSidebarEnabled","isComplementaryAreaVisible","pinnedItems"].includes(n)&&["core/edit-post","core/edit-site"].includes(t)?(x()(`wp.data.select( 'core/preferences' ).get( '${t}', '${n}' )`,{since:"6.5",alternative:`wp.data.select( 'core/preferences' ).get( 'core', '${n}' )`}),b(e,"core",n)):b(e,t,n));var b;const j=(0,r.createReduxStore)("core/preferences",{reducer:u,actions:n,selectors:s});function v({scope:e,name:t,label:n,info:s,messageActivated:i,messageDeactivated:p,shortcut:u,handleToggling:m=!0,onToggle:f=(()=>null),disabled:h=!1}){const _=(0,r.useSelect)((n=>!!n(j).get(e,t)),[e,t]),{toggle:w}=(0,r.useDispatch)(j);return(0,c.jsx)(a.MenuItem,{icon:_&&l,isSelected:_,onClick:()=>{f(),m&&w(e,t),(()=>{if(_){const e=p||(0,o.sprintf)((0,o.__)("Preference deactivated - %s"),n);(0,d.speak)(e)}else{const e=i||(0,o.sprintf)((0,o.__)("Preference activated - %s"),n);(0,d.speak)(e)}})()},role:"menuitemcheckbox",info:s,shortcut:u,disabled:h,children:n})}(0,r.register)(j);const E=function({help:e,label:t,isChecked:n,onChange:s,children:r}){return(0,c.jsxs)("div",{className:"preference-base-option",children:[(0,c.jsx)(a.ToggleControl,{__nextHasNoMarginBottom:!0,help:e,label:t,checked:n,onChange:s}),r]})};const S=function(e){const{scope:t,featureName:n,onToggle:s=(()=>{}),...a}=e,o=(0,r.useSelect)((e=>!!e(j).get(t,n)),[t,n]),{toggle:i}=(0,r.useDispatch)(j);return(0,c.jsx)(E,{onChange:()=>{s(),i(t,n)},isChecked:o,...a})};const P=({description:e,title:t,children:n})=>(0,c.jsxs)("fieldset",{className:"preferences-modal__section",children:[(0,c.jsxs)("legend",{className:"preferences-modal__section-legend",children:[(0,c.jsx)("h2",{className:"preferences-modal__section-title",children:t}),e&&(0,c.jsx)("p",{className:"preferences-modal__section-description",children:e})]}),(0,c.jsx)("div",{className:"preferences-modal__section-content",children:n})]}),T=window.wp.compose,y=window.wp.element;const C=(0,y.forwardRef)((function({icon:e,size:t=24,...n},s){return(0,y.cloneElement)(e,{width:t,height:t,...n,ref:s})})),N=(0,c.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(i.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})}),M=(0,c.jsx)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,c.jsx)(i.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),R=window.wp.privateApis,{lock:k,unlock:B}=(0,R.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/preferences"),{Tabs:L}=B(a.privateApis),I="preferences-menu";const A={};k(A,{PreferenceBaseOption:E,PreferenceToggleControl:S,PreferencesModal:function({closeModal:e,children:t}){return(0,c.jsx)(a.Modal,{className:"preferences-modal",title:(0,o.__)("Preferences"),onRequestClose:e,children:t})},PreferencesModalSection:P,PreferencesModalTabs:function({sections:e}){const t=(0,T.useViewportMatch)("medium"),[n,s]=(0,y.useState)(I),{tabs:r,sectionsContentMap:i}=(0,y.useMemo)((()=>{let t={tabs:[],sectionsContentMap:{}};return e.length&&(t=e.reduce(((e,{name:t,tabLabel:n,content:s})=>(e.tabs.push({name:t,title:n}),e.sectionsContentMap[t]=s,e)),{tabs:[],sectionsContentMap:{}})),t}),[e]);let l;return l=t?(0,c.jsx)("div",{className:"preferences__tabs",children:(0,c.jsxs)(L,{defaultTabId:n!==I?n:void 0,onSelect:s,orientation:"vertical",children:[(0,c.jsx)(L.TabList,{className:"preferences__tabs-tablist",children:r.map((e=>(0,c.jsx)(L.Tab,{tabId:e.name,className:"preferences__tabs-tab",children:e.title},e.name)))}),r.map((e=>(0,c.jsx)(L.TabPanel,{tabId:e.name,className:"preferences__tabs-tabpanel",focusable:!1,children:i[e.name]||null},e.name)))]})}):(0,c.jsxs)(a.__experimentalNavigatorProvider,{initialPath:"/",className:"preferences__provider",children:[(0,c.jsx)(a.__experimentalNavigatorScreen,{path:"/",children:(0,c.jsx)(a.Card,{isBorderless:!0,size:"small",children:(0,c.jsx)(a.CardBody,{children:(0,c.jsx)(a.__experimentalItemGroup,{children:r.map((e=>(0,c.jsx)(a.__experimentalNavigatorButton,{path:e.name,as:a.__experimentalItem,isAction:!0,children:(0,c.jsxs)(a.__experimentalHStack,{justify:"space-between",children:[(0,c.jsx)(a.FlexItem,{children:(0,c.jsx)(a.__experimentalTruncate,{children:e.title})}),(0,c.jsx)(a.FlexItem,{children:(0,c.jsx)(C,{icon:(0,o.isRTL)()?N:M})})]})},e.name)))})})})}),e.length&&e.map((e=>(0,c.jsx)(a.__experimentalNavigatorScreen,{path:e.name,children:(0,c.jsxs)(a.Card,{isBorderless:!0,size:"large",children:[(0,c.jsxs)(a.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6",children:[(0,c.jsx)(a.__experimentalNavigatorBackButton,{icon:(0,o.isRTL)()?M:N,label:(0,o.__)("Back")}),(0,c.jsx)(a.__experimentalText,{size:"16",children:e.tabLabel})]}),(0,c.jsx)(a.CardBody,{children:e.content})]})},`${e.name}-menu`)))]}),l}}),(window.wp=window.wp||{}).preferences=t})();
\ No newline at end of file |