WordPress/wp-includes/js/dist/preferences.min.js
desrosj 3c8457e747 Build/Test Tools: Update build related dependencies to their latest versions.
This updates the following npm dependencies:
- `autoprefixer` to version `10.4.16`.
- `grunt-contrib-qunit` to version `8.0.1`.
- `postcss` to version `8.4.30`.
- `react-refresh` to version `0.14.0`.
- `sass` to version `1.68.0`.
- `sinon` to version `16.0.0`.
- `uuid` to version `9.0.1`.
- `tslib` to version `2.6.2`.

This change accompanies a similar one in the Gutenberg repository: https://github.com/WordPress/gutenberg/pull/54657.

Props gziolo, desrosj.
Fixes #58863.
Built from https://develop.svn.wordpress.org/trunk@56647


git-svn-id: http://core.svn.wordpress.org/trunk@56159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-09-21 13:26:32 +00:00

2 lines
2.6 KiB
JavaScript

/*! This file is auto-generated */
!function(){"use strict";var e={d:function(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:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(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:function(){return y},store:function(){return m}});var n={};e.r(n),e.d(n,{set:function(){return l},setDefaults:function(){return w},setPersistenceLayer:function(){return g},toggle:function(){return d}});var r={};e.r(r),e.d(r,{get:function(){return S}});var o=window.wp.element,c=window.wp.data,s=window.wp.components,i=window.wp.i18n,u=window.wp.primitives;var a=(0,o.createElement)(u.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(u.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),f=window.wp.a11y;const p=function(e){let t;return(n,r)=>{if("SET_PERSISTENCE_LAYER"===r.type){const{persistenceLayer:e,persistedData:n}=r;return t=e,n}const o=e(n,r);return"SET_PREFERENCE_VALUE"===r.type&&t?.set(o),o}}(((e={},t)=>{if("SET_PREFERENCE_VALUE"===t.type){const{scope:n,name:r,value:o}=t;return{...e,[n]:{...e[n],[r]:o}}}return e}));var E=(0,c.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:p});function d(e,t){return function({select:n,dispatch:r}){const o=n.get(e,t);r.set(e,t,!o)}}function l(e,t,n){return{type:"SET_PREFERENCE_VALUE",scope:e,name:t,value:n}}function w(e,t){return{type:"SET_PREFERENCE_DEFAULTS",scope:e,defaults:t}}async function g(e){const t=await e.get();return{type:"SET_PERSISTENCE_LAYER",persistenceLayer:e,persistedData:t}}function S(e,t,n){const r=e.preferences[t]?.[n];return void 0!==r?r:e.defaults[t]?.[n]}const m=(0,c.createReduxStore)("core/preferences",{reducer:E,actions:n,selectors:r});function y({scope:e,name:t,label:n,info:r,messageActivated:u,messageDeactivated:p,shortcut:E,onToggle:d=(()=>null),disabled:l=!1}){const w=(0,c.useSelect)((n=>!!n(m).get(e,t)),[e,t]),{toggle:g}=(0,c.useDispatch)(m);return(0,o.createElement)(s.MenuItem,{icon:w&&a,isSelected:w,onClick:()=>{d(),g(e,t),(()=>{if(w){const e=p||(0,i.sprintf)((0,i.__)("Preference deactivated - %s"),n);(0,f.speak)(e)}else{const e=u||(0,i.sprintf)((0,i.__)("Preference activated - %s"),n);(0,f.speak)(e)}})()},role:"menuitemcheckbox",info:r,shortcut:E,disabled:l},n)}(0,c.register)(m),(window.wp=window.wp||{}).preferences=t}();