@wordpress/interface 5.31.0 → 5.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +10 -10
  3. package/build/components/action-item/index.js.map +1 -1
  4. package/build/components/complementary-area/index.js +58 -3
  5. package/build/components/complementary-area/index.js.map +1 -1
  6. package/build/components/complementary-area-context/index.js.map +1 -1
  7. package/build/components/complementary-area-header/index.js.map +1 -1
  8. package/build/components/complementary-area-more-menu-item/index.js.map +1 -1
  9. package/build/components/complementary-area-toggle/index.js.map +1 -1
  10. package/build/components/fullscreen-mode/index.js.map +1 -1
  11. package/build/components/index.js.map +1 -1
  12. package/build/components/index.native.js.map +1 -1
  13. package/build/components/interface-skeleton/index.js +36 -2
  14. package/build/components/interface-skeleton/index.js.map +1 -1
  15. package/build/components/navigable-region/index.js.map +1 -1
  16. package/build/components/pinned-items/index.js.map +1 -1
  17. package/build/index.js.map +1 -1
  18. package/build/store/actions.js +21 -5
  19. package/build/store/actions.js.map +1 -1
  20. package/build/store/constants.js.map +1 -1
  21. package/build/store/deprecated.js +42 -0
  22. package/build/store/deprecated.js.map +1 -0
  23. package/build/store/index.js +1 -1
  24. package/build/store/index.js.map +1 -1
  25. package/build/store/reducer.js.map +1 -1
  26. package/build/store/selectors.js +9 -0
  27. package/build/store/selectors.js.map +1 -1
  28. package/build-module/components/action-item/index.js.map +1 -1
  29. package/build-module/components/complementary-area/index.js +60 -5
  30. package/build-module/components/complementary-area/index.js.map +1 -1
  31. package/build-module/components/complementary-area-context/index.js.map +1 -1
  32. package/build-module/components/complementary-area-header/index.js.map +1 -1
  33. package/build-module/components/complementary-area-more-menu-item/index.js.map +1 -1
  34. package/build-module/components/complementary-area-toggle/index.js.map +1 -1
  35. package/build-module/components/fullscreen-mode/index.js.map +1 -1
  36. package/build-module/components/index.js.map +1 -1
  37. package/build-module/components/index.native.js.map +1 -1
  38. package/build-module/components/interface-skeleton/index.js +38 -4
  39. package/build-module/components/interface-skeleton/index.js.map +1 -1
  40. package/build-module/components/navigable-region/index.js.map +1 -1
  41. package/build-module/components/pinned-items/index.js.map +1 -1
  42. package/build-module/index.js.map +1 -1
  43. package/build-module/store/actions.js +21 -5
  44. package/build-module/store/actions.js.map +1 -1
  45. package/build-module/store/constants.js.map +1 -1
  46. package/build-module/store/deprecated.js +33 -0
  47. package/build-module/store/deprecated.js.map +1 -0
  48. package/build-module/store/index.js.map +1 -1
  49. package/build-module/store/reducer.js.map +1 -1
  50. package/build-module/store/selectors.js +9 -0
  51. package/build-module/store/selectors.js.map +1 -1
  52. package/build-style/style-rtl.css +7 -5
  53. package/build-style/style.css +7 -5
  54. package/package.json +14 -14
  55. package/src/components/complementary-area/README.md +2 -2
  56. package/src/components/complementary-area/index.js +139 -58
  57. package/src/components/complementary-area-more-menu-item/README.md +1 -1
  58. package/src/components/complementary-area-toggle/README.md +1 -1
  59. package/src/components/interface-skeleton/index.js +50 -10
  60. package/src/components/interface-skeleton/style.scss +3 -3
  61. package/src/components/pinned-items/README.md +2 -2
  62. package/src/components/pinned-items/style.scss +1 -2
  63. package/src/store/actions.js +24 -5
  64. package/src/store/deprecated.js +37 -0
  65. package/src/store/selectors.js +12 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_deprecated","_interopRequireDefault","require","_preferences","setDefaultComplementaryArea","scope","area","type","exports","enableComplementaryArea","registry","dispatch","isComplementaryAreaVisible","select","preferencesStore","get","set","disableComplementaryArea","pinItem","item","pinnedItems","unpinItem","toggleFeature","featureName","deprecated","since","alternative","toggle","setFeatureValue","value","setFeatureDefaults","defaults","setDefaults","openModal","name","closeModal"],"sources":["@wordpress/interface/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Set a default complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n *\n * @return {Object} Action object.\n */\nexport const setDefaultComplementaryArea = ( scope, area ) => ( {\n\ttype: 'SET_DEFAULT_COMPLEMENTARY_AREA',\n\tscope,\n\tarea,\n} );\n\n/**\n * Enable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n */\nexport const enableComplementaryArea =\n\t( scope, area ) =>\n\t( { registry, dispatch } ) => {\n\t\t// Return early if there's no area.\n\t\tif ( ! area ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isComplementaryAreaVisible = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\t\tif ( ! isComplementaryAreaVisible ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( scope, 'isComplementaryAreaVisible', true );\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'ENABLE_COMPLEMENTARY_AREA',\n\t\t\tscope,\n\t\t\tarea,\n\t\t} );\n\t};\n\n/**\n * Disable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n */\nexport const disableComplementaryArea =\n\t( scope ) =>\n\t( { registry } ) => {\n\t\tconst isComplementaryAreaVisible = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\t\tif ( isComplementaryAreaVisible ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( scope, 'isComplementaryAreaVisible', false );\n\t\t}\n\t};\n\n/**\n * Pins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n *\n * @return {Object} Action object.\n */\nexport const pinItem =\n\t( scope, item ) =>\n\t( { registry } ) => {\n\t\t// Return early if there's no item.\n\t\tif ( ! item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst pinnedItems = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'pinnedItems' );\n\n\t\t// The item is already pinned, there's nothing to do.\n\t\tif ( pinnedItems?.[ item ] === true ) {\n\t\t\treturn;\n\t\t}\n\n\t\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t\t...pinnedItems,\n\t\t\t[ item ]: true,\n\t\t} );\n\t};\n\n/**\n * Unpins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n */\nexport const unpinItem =\n\t( scope, item ) =>\n\t( { registry } ) => {\n\t\t// Return early if there's no item.\n\t\tif ( ! item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst pinnedItems = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'pinnedItems' );\n\n\t\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t\t...pinnedItems,\n\t\t\t[ item ]: false,\n\t\t} );\n\t};\n\n/**\n * Returns an action object used in signalling that a feature should be toggled.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n */\nexport function toggleFeature( scope, featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).toggleFeature`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).toggle`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).toggle( scope, featureName );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a feature should be set to\n * a true or false value\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n * @param {boolean} value The value to set.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureValue( scope, featureName, value ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureValue`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).set`,\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( scope, featureName, !! value );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that defaults should be set for features.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {Object<string, boolean>} defaults A key/value map of feature names to values.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureDefaults( scope, defaults ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureDefaults`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).setDefaults`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).setDefaults( scope, defaults );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport function openModal( name ) {\n\treturn {\n\t\ttype: 'OPEN_MODAL',\n\t\tname,\n\t};\n}\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @return {Object} Action object.\n */\nexport function closeModal() {\n\treturn {\n\t\ttype: 'CLOSE_MODAL',\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,2BAA2B,GAAGA,CAAEC,KAAK,EAAEC,IAAI,MAAQ;EAC/DC,IAAI,EAAE,gCAAgC;EACtCF,KAAK;EACLC;AACD,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AALAE,OAAA,CAAAJ,2BAAA,GAAAA,2BAAA;AAMO,MAAMK,uBAAuB,GACnCA,CAAEJ,KAAK,EAAEC,IAAI,KACb,CAAE;EAAEI,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7B;EACA,IAAK,CAAEL,IAAI,EAAG;IACb;EACD;EAEA,MAAMM,0BAA0B,GAAGF,QAAQ,CACzCG,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,GAAG,CAAEV,KAAK,EAAE,4BAA6B,CAAC;EAE5C,IAAK,CAAEO,0BAA0B,EAAG;IACnCF,QAAQ,CACNC,QAAQ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ACA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAAEzB,KAAK,EAAE0B,QAAQ,EAAG;EACrD,OAAO,UAAW;IAAErB;EAAS,CAAC,EAAG;IAChC,IAAAc,mBAAU,EAAG,iDAAgD,EAAE;MAC9DC,KAAK,EAAE,KAAK;MACZC,WAAW,EAAG;IACf,CAAE,CAAC;IAEHhB,QAAQ,CAACC,QAAQ,CAAEG,kBAAiB,CAAC,CAACkB,WAAW,CAAE3B,KAAK,EAAE0B,QAAS,CAAC;EACrE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,SAASA,CAAEC,IAAI,EAAG;EACjC,OAAO;IACN3B,IAAI,EAAE,YAAY;IAClB2B;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAA,EAAG;EAC5B,OAAO;IACN5B,IAAI,EAAE;EACP,CAAC;AACF"}
1
+ {"version":3,"names":["_deprecated","_interopRequireDefault","require","_preferences","_deprecated2","setDefaultComplementaryArea","scope","area","normalizeComplementaryAreaScope","normalizeComplementaryAreaName","type","exports","enableComplementaryArea","registry","dispatch","isComplementaryAreaVisible","select","preferencesStore","get","set","disableComplementaryArea","pinItem","item","pinnedItems","unpinItem","toggleFeature","featureName","deprecated","since","alternative","toggle","setFeatureValue","value","setFeatureDefaults","defaults","setDefaults","openModal","name","closeModal"],"sources":["@wordpress/interface/src/store/actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport {\n\tnormalizeComplementaryAreaScope,\n\tnormalizeComplementaryAreaName,\n} from './deprecated';\n\n/**\n * Set a default complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n *\n * @return {Object} Action object.\n */\nexport const setDefaultComplementaryArea = ( scope, area ) => {\n\tscope = normalizeComplementaryAreaScope( scope );\n\tarea = normalizeComplementaryAreaName( scope, area );\n\treturn {\n\t\ttype: 'SET_DEFAULT_COMPLEMENTARY_AREA',\n\t\tscope,\n\t\tarea,\n\t};\n};\n\n/**\n * Enable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n * @param {string} area Area identifier.\n */\nexport const enableComplementaryArea =\n\t( scope, area ) =>\n\t( { registry, dispatch } ) => {\n\t\t// Return early if there's no area.\n\t\tif ( ! area ) {\n\t\t\treturn;\n\t\t}\n\t\tscope = normalizeComplementaryAreaScope( scope );\n\t\tarea = normalizeComplementaryAreaName( scope, area );\n\n\t\tconst isComplementaryAreaVisible = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\t\tif ( ! isComplementaryAreaVisible ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( scope, 'isComplementaryAreaVisible', true );\n\t\t}\n\n\t\tdispatch( {\n\t\t\ttype: 'ENABLE_COMPLEMENTARY_AREA',\n\t\t\tscope,\n\t\t\tarea,\n\t\t} );\n\t};\n\n/**\n * Disable the complementary area.\n *\n * @param {string} scope Complementary area scope.\n */\nexport const disableComplementaryArea =\n\t( scope ) =>\n\t( { registry } ) => {\n\t\tscope = normalizeComplementaryAreaScope( scope );\n\t\tconst isComplementaryAreaVisible = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'isComplementaryAreaVisible' );\n\n\t\tif ( isComplementaryAreaVisible ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t.set( scope, 'isComplementaryAreaVisible', false );\n\t\t}\n\t};\n\n/**\n * Pins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n *\n * @return {Object} Action object.\n */\nexport const pinItem =\n\t( scope, item ) =>\n\t( { registry } ) => {\n\t\t// Return early if there's no item.\n\t\tif ( ! item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tscope = normalizeComplementaryAreaScope( scope );\n\t\titem = normalizeComplementaryAreaName( scope, item );\n\t\tconst pinnedItems = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'pinnedItems' );\n\n\t\t// The item is already pinned, there's nothing to do.\n\t\tif ( pinnedItems?.[ item ] === true ) {\n\t\t\treturn;\n\t\t}\n\n\t\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t\t...pinnedItems,\n\t\t\t[ item ]: true,\n\t\t} );\n\t};\n\n/**\n * Unpins an item.\n *\n * @param {string} scope Item scope.\n * @param {string} item Item identifier.\n */\nexport const unpinItem =\n\t( scope, item ) =>\n\t( { registry } ) => {\n\t\t// Return early if there's no item.\n\t\tif ( ! item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tscope = normalizeComplementaryAreaScope( scope );\n\t\titem = normalizeComplementaryAreaName( scope, item );\n\t\tconst pinnedItems = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( scope, 'pinnedItems' );\n\n\t\tregistry.dispatch( preferencesStore ).set( scope, 'pinnedItems', {\n\t\t\t...pinnedItems,\n\t\t\t[ item ]: false,\n\t\t} );\n\t};\n\n/**\n * Returns an action object used in signalling that a feature should be toggled.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n */\nexport function toggleFeature( scope, featureName ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).toggleFeature`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).toggle`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).toggle( scope, featureName );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that a feature should be set to\n * a true or false value\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {string} featureName The feature name.\n * @param {boolean} value The value to set.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureValue( scope, featureName, value ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureValue`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).set`,\n\t\t} );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( scope, featureName, !! value );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that defaults should be set for features.\n *\n * @param {string} scope The feature scope (e.g. core/edit-post).\n * @param {Object<string, boolean>} defaults A key/value map of feature names to values.\n *\n * @return {Object} Action object.\n */\nexport function setFeatureDefaults( scope, defaults ) {\n\treturn function ( { registry } ) {\n\t\tdeprecated( `dispatch( 'core/interface' ).setFeatureDefaults`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `dispatch( 'core/preferences' ).setDefaults`,\n\t\t} );\n\n\t\tregistry.dispatch( preferencesStore ).setDefaults( scope, defaults );\n\t};\n}\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport function openModal( name ) {\n\treturn {\n\t\ttype: 'OPEN_MODAL',\n\t\tname,\n\t};\n}\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @return {Object} Action object.\n */\nexport function closeModal() {\n\treturn {\n\t\ttype: 'CLOSE_MODAL',\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,YAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,2BAA2B,GAAGA,CAAEC,KAAK,EAAEC,IAAI,KAAM;EAC7DD,KAAK,GAAG,IAAAE,4CAA+B,EAAEF,KAAM,CAAC;EAChDC,IAAI,GAAG,IAAAE,2CAA8B,EAAEH,KAAK,EAAEC,IAAK,CAAC;EACpD,OAAO;IACNG,IAAI,EAAE,gCAAgC;IACtCJ,KAAK;IACLC;EACD,CAAC;AACF,CAAC;;AAED;A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I,EAAG;EACjC,OAAO;IACN3B,IAAI,EAAE,YAAY;IAClB2B;EACD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAA,EAAG;EAC5B,OAAO;IACN5B,IAAI,EAAE;EACP,CAAC;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["STORE_NAME","exports"],"sources":["@wordpress/interface/src/store/constants.js"],"sourcesContent":["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/interface';\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,gBAAgB"}
1
+ {"version":3,"names":["STORE_NAME","exports"],"sources":["@wordpress/interface/src/store/constants.js"],"sourcesContent":["/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/interface';\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,gBAAgB","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.normalizeComplementaryAreaName = normalizeComplementaryAreaName;
8
+ exports.normalizeComplementaryAreaScope = normalizeComplementaryAreaScope;
9
+ var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
10
+ /**
11
+ * WordPress dependencies
12
+ */
13
+
14
+ function normalizeComplementaryAreaScope(scope) {
15
+ if (['core/edit-post', 'core/edit-site'].includes(scope)) {
16
+ (0, _deprecated.default)(`${scope} interface scope`, {
17
+ alternative: 'core interface scope',
18
+ hint: 'core/edit-post and core/edit-site are merging.',
19
+ version: '6.6'
20
+ });
21
+ return 'core';
22
+ }
23
+ return scope;
24
+ }
25
+ function normalizeComplementaryAreaName(scope, name) {
26
+ if (scope === 'core' && name === 'edit-site/template') {
27
+ (0, _deprecated.default)(`edit-site/template sidebar`, {
28
+ alternative: 'edit-post/document',
29
+ version: '6.6'
30
+ });
31
+ return 'edit-post/document';
32
+ }
33
+ if (scope === 'core' && name === 'edit-site/block-inspector') {
34
+ (0, _deprecated.default)(`edit-site/block-inspector sidebar`, {
35
+ alternative: 'edit-post/block',
36
+ version: '6.6'
37
+ });
38
+ return 'edit-post/block';
39
+ }
40
+ return name;
41
+ }
42
+ //# sourceMappingURL=deprecated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_deprecated","_interopRequireDefault","require","normalizeComplementaryAreaScope","scope","includes","deprecated","alternative","hint","version","normalizeComplementaryAreaName","name"],"sources":["@wordpress/interface/src/store/deprecated.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\nexport function normalizeComplementaryAreaScope( scope ) {\n\tif ( [ 'core/edit-post', 'core/edit-site' ].includes( scope ) ) {\n\t\tdeprecated( `${ scope } interface scope`, {\n\t\t\talternative: 'core interface scope',\n\t\t\thint: 'core/edit-post and core/edit-site are merging.',\n\t\t\tversion: '6.6',\n\t\t} );\n\t\treturn 'core';\n\t}\n\n\treturn scope;\n}\n\nexport function normalizeComplementaryAreaName( scope, name ) {\n\tif ( scope === 'core' && name === 'edit-site/template' ) {\n\t\tdeprecated( `edit-site/template sidebar`, {\n\t\t\talternative: 'edit-post/document',\n\t\t\tversion: '6.6',\n\t\t} );\n\t\treturn 'edit-post/document';\n\t}\n\n\tif ( scope === 'core' && name === 'edit-site/block-inspector' ) {\n\t\tdeprecated( `edit-site/block-inspector sidebar`, {\n\t\t\talternative: 'edit-post/block',\n\t\t\tversion: '6.6',\n\t\t} );\n\t\treturn 'edit-post/block';\n\t}\n\n\treturn name;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGO,SAASC,+BAA+BA,CAAEC,KAAK,EAAG;EACxD,IAAK,CAAE,gBAAgB,EAAE,gBAAgB,CAAE,CAACC,QAAQ,CAAED,KAAM,CAAC,EAAG;IAC/D,IAAAE,mBAAU,EAAG,GAAGF,KAAO,kBAAiB,EAAE;MACzCG,WAAW,EAAE,sBAAsB;MACnCC,IAAI,EAAE,gDAAgD;MACtDC,OAAO,EAAE;IACV,CAAE,CAAC;IACH,OAAO,MAAM;EACd;EAEA,OAAOL,KAAK;AACb;AAEO,SAASM,8BAA8BA,CAAEN,KAAK,EAAEO,IAAI,EAAG;EAC7D,IAAKP,KAAK,KAAK,MAAM,IAAIO,IAAI,KAAK,oBAAoB,EAAG;IACxD,IAAAL,mBAAU,EAAG,4BAA2B,EAAE;MACzCC,WAAW,EAAE,oBAAoB;MACjCE,OAAO,EAAE;IACV,CAAE,CAAC;IACH,OAAO,oBAAoB;EAC5B;EAEA,IAAKL,KAAK,KAAK,MAAM,IAAIO,IAAI,KAAK,2BAA2B,EAAG;IAC/D,IAAAL,mBAAU,EAAG,mCAAkC,EAAE;MAChDC,WAAW,EAAE,iBAAiB;MAC9BE,OAAO,EAAE;IACV,CAAE,CAAC;IACH,OAAO,iBAAiB;EACzB;EAEA,OAAOE,IAAI;AACZ","ignoreList":[]}
@@ -11,7 +11,7 @@ var selectors = _interopRequireWildcard(require("./selectors"));
11
11
  var _reducer = _interopRequireDefault(require("./reducer"));
12
12
  var _constants = require("./constants");
13
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
15
15
  /**
16
16
  * WordPress dependencies
17
17
  */
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","actions","_interopRequireWildcard","selectors","_reducer","_interopRequireDefault","_constants","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","store","exports","createReduxStore","STORE_NAME","reducer","register"],"sources":["@wordpress/interface/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport reducer from './reducer';\nimport { STORE_NAME } from './constants';\n\n/**\n * Store definition for the interface namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\n\n// Once we build a more generic persistence plugin that works across types of stores\n// we'd be able to replace this with a register call.\nregister( store );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAD,uBAAA,CAAAF,OAAA;AACA,IAAAI,QAAA,G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ACO,MAAMY,KAAK,GAAAC,OAAA,CAAAD,KAAA,GAAG,IAAAE,sBAAgB,EAAEC,qBAAU,EAAE;EAClDC,OAAO,EAAPA,gBAAO;EACP/B,OAAO;EACPE;AACD,CAAE,CAAC;;AAEH;AACA;AACA,IAAA8B,cAAQ,EAAEL,KAAM,CAAC"}
1
+ {"version":3,"names":["_data","require","actions","_interopRequireWildcard","selectors","_reducer","_interopRequireDefault","_constants","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","store","exports","createReduxStore","STORE_NAME","reducer","register"],"sources":["@wordpress/interface/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport reducer from './reducer';\nimport { STORE_NAME } from './constants';\n\n/**\n * Store definition for the interface namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\n\n// Once we build a more generic persistence plugin that works across types of stores\n// we'd be able to replace this with a register call.\nregister( store );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAD,uBAAA,CAAAF,OAAA;AACA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAAyC,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAXzC;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMW,KAAK,GAAAC,OAAA,CAAAD,KAAA,GAAG,IAAAE,sBAAgB,EAAEC,qBAAU,EAAE;EAClDC,OAAO,EAAPA,gBAAO;EACP9B,OAAO;EACPE;AACD,CAAE,CAAC;;AAEH;AACA;AACA,IAAA6B,cAAQ,EAAEL,KAAM,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","complementaryAreas","state","action","type","scope","area","activeModal","name","_default","exports","default","combineReducers"],"sources":["@wordpress/interface/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\nexport function complementaryAreas( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_DEFAULT_COMPLEMENTARY_AREA': {\n\t\t\tconst { scope, area } = action;\n\n\t\t\t// If there's already an area, don't overwrite it.\n\t\t\tif ( state[ scope ] ) {\n\t\t\t\treturn state;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: area,\n\t\t\t};\n\t\t}\n\t\tcase 'ENABLE_COMPLEMENTARY_AREA': {\n\t\t\tconst { scope, area } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: area,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for storing the name of the open modal, or null if no modal is open.\n *\n * @param {Object} state Previous state.\n * @param {Object} action Action object containing the `name` of the modal\n *\n * @return {Object} Updated state\n */\nexport function activeModal( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_MODAL':\n\t\t\treturn action.name;\n\t\tcase 'CLOSE_MODAL':\n\t\t\treturn null;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tcomplementaryAreas,\n\tactiveModal,\n} );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,SAASC,kBAAkBA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EACxD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,gCAAgC;MAAE;QACtC,MAAM;UAAEC,KAAK;UAAEC;QAAK,CAAC,GAAGH,MAAM;;QAE9B;QACA,IAAKD,KAAK,CAAEG,KAAK,CAAE,EAAG;UACrB,OAAOH,KAAK;QACb;QAEA,OAAO;UACN,GAAGA,KAAK;UACR,CAAEG,KAAK,GAAIC;QACZ,CAAC;MACF;IACA,KAAK,2BAA2B;MAAE;QACjC,MAAM;UAAED,KAAK;UAAEC;QAAK,CAAC,GAAGH,MAAM;QAC9B,OAAO;UACN,GAAGD,KAAK;UACR,CAAEG,KAAK,GAAIC;QACZ,CAAC;MACF;EACD;EAEA,OAAOJ,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,WAAWA,CAAEL,KAAK,GAAG,IAAI,EAAEC,MAAM,EAAG;EACnD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,YAAY;MAChB,OAAOD,MAAM,CAACK,IAAI;IACnB,KAAK,aAAa;MACjB,OAAO,IAAI;EACb;EAEA,OAAON,KAAK;AACb;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,qBAAe,EAAE;EAC/BX,kBAAkB;EAClBM;AACD,CAAE,CAAC"}
1
+ {"version":3,"names":["_data","require","complementaryAreas","state","action","type","scope","area","activeModal","name","_default","exports","default","combineReducers"],"sources":["@wordpress/interface/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\nexport function complementaryAreas( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_DEFAULT_COMPLEMENTARY_AREA': {\n\t\t\tconst { scope, area } = action;\n\n\t\t\t// If there's already an area, don't overwrite it.\n\t\t\tif ( state[ scope ] ) {\n\t\t\t\treturn state;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: area,\n\t\t\t};\n\t\t}\n\t\tcase 'ENABLE_COMPLEMENTARY_AREA': {\n\t\t\tconst { scope, area } = action;\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ scope ]: area,\n\t\t\t};\n\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer for storing the name of the open modal, or null if no modal is open.\n *\n * @param {Object} state Previous state.\n * @param {Object} action Action object containing the `name` of the modal\n *\n * @return {Object} Updated state\n */\nexport function activeModal( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'OPEN_MODAL':\n\t\t\treturn action.name;\n\t\tcase 'CLOSE_MODAL':\n\t\t\treturn null;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tcomplementaryAreas,\n\tactiveModal,\n} );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGO,SAASC,kBAAkBA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EACxD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,gCAAgC;MAAE;QACtC,MAAM;UAAEC,KAAK;UAAEC;QAAK,CAAC,GAAGH,MAAM;;QAE9B;QACA,IAAKD,KAAK,CAAEG,KAAK,CAAE,EAAG;UACrB,OAAOH,KAAK;QACb;QAEA,OAAO;UACN,GAAGA,KAAK;UACR,CAAEG,KAAK,GAAIC;QACZ,CAAC;MACF;IACA,KAAK,2BAA2B;MAAE;QACjC,MAAM;UAAED,KAAK;UAAEC;QAAK,CAAC,GAAGH,MAAM;QAC9B,OAAO;UACN,GAAGD,KAAK;UACR,CAAEG,KAAK,GAAIC;QACZ,CAAC;MACF;EACD;EAEA,OAAOJ,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,WAAWA,CAAEL,KAAK,GAAG,IAAI,EAAEC,MAAM,EAAG;EACnD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,YAAY;MAChB,OAAOD,MAAM,CAACK,IAAI;IACnB,KAAK,aAAa;MACjB,OAAO,IAAI;EACb;EAEA,OAAON,KAAK;AACb;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc,IAAAC,qBAAe,EAAE;EAC/BX,kBAAkB;EAClBM;AACD,CAAE,CAAC","ignoreList":[]}
@@ -9,10 +9,15 @@ exports.isModalActive = isModalActive;
9
9
  var _data = require("@wordpress/data");
10
10
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
11
11
  var _preferences = require("@wordpress/preferences");
12
+ var _deprecated2 = require("./deprecated");
12
13
  /**
13
14
  * WordPress dependencies
14
15
  */
15
16
 
17
+ /**
18
+ * Internal dependencies
19
+ */
20
+
16
21
  /**
17
22
  * Returns the complementary area that is active in a given scope.
18
23
  *
@@ -22,6 +27,7 @@ var _preferences = require("@wordpress/preferences");
22
27
  * @return {string | null | undefined} The complementary area that is active in the given scope.
23
28
  */
24
29
  const getActiveComplementaryArea = exports.getActiveComplementaryArea = (0, _data.createRegistrySelector)(select => (state, scope) => {
30
+ scope = (0, _deprecated2.normalizeComplementaryAreaScope)(scope);
25
31
  const isComplementaryAreaVisible = select(_preferences.store).get(scope, 'isComplementaryAreaVisible');
26
32
 
27
33
  // Return `undefined` to indicate that the user has never toggled
@@ -38,6 +44,7 @@ const getActiveComplementaryArea = exports.getActiveComplementaryArea = (0, _dat
38
44
  return state?.complementaryAreas?.[scope];
39
45
  });
40
46
  const isComplementaryAreaLoading = exports.isComplementaryAreaLoading = (0, _data.createRegistrySelector)(select => (state, scope) => {
47
+ scope = (0, _deprecated2.normalizeComplementaryAreaScope)(scope);
41
48
  const isVisible = select(_preferences.store).get(scope, 'isComplementaryAreaVisible');
42
49
  const identifier = state?.complementaryAreas?.[scope];
43
50
  return isVisible && identifier === undefined;
@@ -54,6 +61,8 @@ const isComplementaryAreaLoading = exports.isComplementaryAreaLoading = (0, _dat
54
61
  */
55
62
  const isItemPinned = exports.isItemPinned = (0, _data.createRegistrySelector)(select => (state, scope, item) => {
56
63
  var _pinnedItems$item;
64
+ scope = (0, _deprecated2.normalizeComplementaryAreaScope)(scope);
65
+ item = (0, _deprecated2.normalizeComplementaryAreaName)(scope, item);
57
66
  const pinnedItems = select(_preferences.store).get(scope, 'pinnedItems');
58
67
  return (_pinnedItems$item = pinnedItems?.[item]) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true;
59
68
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_deprecated","_interopRequireDefault","_preferences","getActiveComplementaryArea","exports","createRegistrySelector","select","state","scope","isComplementaryAreaVisible","preferencesStore","get","undefined","complementaryAreas","isComplementaryAreaLoading","isVisible","identifier","isItemPinned","item","_pinnedItems$item","pinnedItems","isFeatureActive","featureName","deprecated","since","alternative","isModalActive","modalName","activeModal"],"sources":["@wordpress/interface/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Returns the complementary area that is active in a given scope.\n *\n * @param {Object} state Global application state.\n * @param {string} scope Item scope.\n *\n * @return {string | null | undefined} The complementary area that is active in the given scope.\n */\nexport const getActiveComplementaryArea = createRegistrySelector(\n\t( select ) => ( state, scope ) => {\n\t\tconst isComplementaryAreaVisible = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'isComplementaryAreaVisible'\n\t\t);\n\n\t\t// Return `undefined` to indicate that the user has never toggled\n\t\t// visibility, this is the vanilla default. Other code relies on this\n\t\t// nuance in the return value.\n\t\tif ( isComplementaryAreaVisible === undefined ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Return `null` to indicate the user hid the complementary area.\n\t\tif ( isComplementaryAreaVisible === false ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn state?.complementaryAreas?.[ scope ];\n\t}\n);\n\nexport const isComplementaryAreaLoading = createRegistrySelector(\n\t( select ) => ( state, scope ) => {\n\t\tconst isVisible = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'isComplementaryAreaVisible'\n\t\t);\n\t\tconst identifier = state?.complementaryAreas?.[ scope ];\n\n\t\treturn isVisible && identifier === undefined;\n\t}\n);\n\n/**\n * Returns a boolean indicating if an item is pinned or not.\n *\n * @param {Object} state Global application state.\n * @param {string} scope Scope.\n * @param {string} item Item to check.\n *\n * @return {boolean} True if the item is pinned and false otherwise.\n */\nexport const isItemPinned = createRegistrySelector(\n\t( select ) => ( state, scope, item ) => {\n\t\tconst pinnedItems = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'pinnedItems'\n\t\t);\n\t\treturn pinnedItems?.[ item ] ?? true;\n\t}\n);\n\n/**\n * Returns a boolean indicating whether a feature is active for a particular\n * scope.\n *\n * @param {Object} state The store state.\n * @param {string} scope The scope of the feature (e.g. core/edit-post).\n * @param {string} featureName The name of the feature.\n *\n * @return {boolean} Is the feature enabled?\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, scope, featureName ) => {\n\t\tdeprecated(\n\t\t\t`select( 'core/interface' ).isFeatureActive( scope, featureName )`,\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative: `select( 'core/preferences' ).get( scope, featureName )`,\n\t\t\t}\n\t\t);\n\n\t\treturn !! select( preferencesStore ).get( scope, featureName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport function isModalActive( state, modalName ) {\n\treturn state.activeModal === modalName;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA,GAAG,IAAAE,4BAAsB,EAC7DC,MAAM,IAAM,CAAEC,KAAK,EAAEC,KAAK,KAAM;EACjC,MAAMC,0BAA0B,GAAGH,MAAM,CAAEI,kBAAiB,CAAC,CAACC,GAAG,CAChEH,KAAK,EACL,4BACD,CAAC;;EAED;EACA;EACA;EACA,IAAKC,0BAA0B,KAAKG,SAAS,EAAG;IAC/C,OAAOA,SAAS;EACjB;;EAEA;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C,GAAG,CAAEH,KAAK,EAAEc,WAAY,CAAC;AAC/D,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,aAAaA,CAAEnB,KAAK,EAAEoB,SAAS,EAAG;EACjD,OAAOpB,KAAK,CAACqB,WAAW,KAAKD,SAAS;AACvC"}
1
+ {"version":3,"names":["_data","require","_deprecated","_interopRequireDefault","_preferences","_deprecated2","getActiveComplementaryArea","exports","createRegistrySelector","select","state","scope","normalizeComplementaryAreaScope","isComplementaryAreaVisible","preferencesStore","get","undefined","complementaryAreas","isComplementaryAreaLoading","isVisible","identifier","isItemPinned","item","_pinnedItems$item","normalizeComplementaryAreaName","pinnedItems","isFeatureActive","featureName","deprecated","since","alternative","isModalActive","modalName","activeModal"],"sources":["@wordpress/interface/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport {\n\tnormalizeComplementaryAreaScope,\n\tnormalizeComplementaryAreaName,\n} from './deprecated';\n\n/**\n * Returns the complementary area that is active in a given scope.\n *\n * @param {Object} state Global application state.\n * @param {string} scope Item scope.\n *\n * @return {string | null | undefined} The complementary area that is active in the given scope.\n */\nexport const getActiveComplementaryArea = createRegistrySelector(\n\t( select ) => ( state, scope ) => {\n\t\tscope = normalizeComplementaryAreaScope( scope );\n\t\tconst isComplementaryAreaVisible = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'isComplementaryAreaVisible'\n\t\t);\n\n\t\t// Return `undefined` to indicate that the user has never toggled\n\t\t// visibility, this is the vanilla default. Other code relies on this\n\t\t// nuance in the return value.\n\t\tif ( isComplementaryAreaVisible === undefined ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Return `null` to indicate the user hid the complementary area.\n\t\tif ( isComplementaryAreaVisible === false ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn state?.complementaryAreas?.[ scope ];\n\t}\n);\n\nexport const isComplementaryAreaLoading = createRegistrySelector(\n\t( select ) => ( state, scope ) => {\n\t\tscope = normalizeComplementaryAreaScope( scope );\n\t\tconst isVisible = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'isComplementaryAreaVisible'\n\t\t);\n\t\tconst identifier = state?.complementaryAreas?.[ scope ];\n\n\t\treturn isVisible && identifier === undefined;\n\t}\n);\n\n/**\n * Returns a boolean indicating if an item is pinned or not.\n *\n * @param {Object} state Global application state.\n * @param {string} scope Scope.\n * @param {string} item Item to check.\n *\n * @return {boolean} True if the item is pinned and false otherwise.\n */\nexport const isItemPinned = createRegistrySelector(\n\t( select ) => ( state, scope, item ) => {\n\t\tscope = normalizeComplementaryAreaScope( scope );\n\t\titem = normalizeComplementaryAreaName( scope, item );\n\t\tconst pinnedItems = select( preferencesStore ).get(\n\t\t\tscope,\n\t\t\t'pinnedItems'\n\t\t);\n\t\treturn pinnedItems?.[ item ] ?? true;\n\t}\n);\n\n/**\n * Returns a boolean indicating whether a feature is active for a particular\n * scope.\n *\n * @param {Object} state The store state.\n * @param {string} scope The scope of the feature (e.g. core/edit-post).\n * @param {string} featureName The name of the feature.\n *\n * @return {boolean} Is the feature enabled?\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, scope, featureName ) => {\n\t\tdeprecated(\n\t\t\t`select( 'core/interface' ).isFeatureActive( scope, featureName )`,\n\t\t\t{\n\t\t\t\tsince: '6.0',\n\t\t\t\talternative: `select( 'core/preferences' ).get( scope, featureName )`,\n\t\t\t}\n\t\t);\n\n\t\treturn !! select( preferencesStore ).get( scope, featureName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport function isModalActive( state, modalName ) {\n\treturn state.activeModal === modalName;\n}\n"],"mappings":";;;;;;;;A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AsB,EAC/CC,MAAM,IAAM,CAAEC,KAAK,EAAEC,KAAK,EAAEW,IAAI,KAAM;EAAA,IAAAC,iBAAA;EACvCZ,KAAK,GAAG,IAAAC,4CAA+B,EAAED,KAAM,CAAC;EAChDW,IAAI,GAAG,IAAAE,2CAA8B,EAAEb,KAAK,EAAEW,IAAK,CAAC;EACpD,MAAMG,WAAW,GAAGhB,MAAM,CAAEK,kBAAiB,CAAC,CAACC,GAAG,CACjDJ,KAAK,EACL,aACD,CAAC;EACD,QAAAY,iBAAA,GAAOE,WAAW,GAAIH,IAAI,CAAE,cAAAC,iBAAA,cAAAA,iBAAA,GAAI,IAAI;AACrC,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,eAAe,GAAAnB,OAAA,CAAAmB,eAAA,GAAG,IAAAlB,4BAAsB,EAClDC,MAAM,IAAM,CAAEC,KAAK,EAAEC,KAAK,EAAEgB,WAAW,KAAM;EAC9C,IAAAC,mBAAU,EACR,kEAAiE,EAClE;IACCC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CACD,CAAC;EAED,OAAO,CAAC,CAAErB,MAAM,CAAEK,kBAAiB,CAAC,CAACC,GAAG,CAAEJ,KAAK,EAAEgB,WAAY,CAAC;AAC/D,CACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,aAAaA,CAAErB,KAAK,EAAEsB,SAAS,EAAG;EACjD,OAAOtB,KAAK,CAACuB,WAAW,KAAKD,SAAS;AACvC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["ButtonGroup","Button","Slot","Fill","Children","noop","ActionItemSlot","name","as","Component","fillProps","bubblesVirtually","props","createElement","fills","toArray","length","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","children","map","child","includes","ActionItem","onClick","fpOnClick","args","undefined"],"sources":["@wordpress/interface/src/components/action-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';\nimport { Children } from '@wordpress/element';\n\nconst noop = () => {};\n\nfunction ActionItemSlot( {\n\tname,\n\tas: Component = ButtonGroup,\n\tfillProps = {},\n\tbubblesVirtually,\n\t...props\n} ) {\n\treturn (\n\t\t<Slot\n\t\t\tname={ name }\n\t\t\tbubblesVirtually={ bubblesVirtually }\n\t\t\tfillProps={ fillProps }\n\t\t>\n\t\t\t{ ( fills ) => {\n\t\t\t\tif ( ! Children.toArray( fills ).length ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// Special handling exists for backward compatibility.\n\t\t\t\t// It ensures that menu items created by plugin authors aren't\n\t\t\t\t// duplicated with automatically injected menu items coming\n\t\t\t\t// from pinnable plugin sidebars.\n\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t\t\t\tconst initializedByPlugins = [];\n\t\t\t\tChildren.forEach(\n\t\t\t\t\tfills,\n\t\t\t\t\t( {\n\t\t\t\t\t\tprops: { __unstableExplicitMenuItem, __unstableTarget },\n\t\t\t\t\t} ) => {\n\t\t\t\t\t\tif ( __unstableTarget && __unstableExplicitMenuItem ) {\n\t\t\t\t\t\t\tinitializedByPlugins.push( __unstableTarget );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tconst children = Children.map( fills, ( child ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t! child.props.__unstableExplicitMenuItem &&\n\t\t\t\t\t\tinitializedByPlugins.includes(\n\t\t\t\t\t\t\tchild.props.__unstableTarget\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t} );\n\n\t\t\t\treturn <Component { ...props }>{ children }</Component>;\n\t\t\t} }\n\t\t</Slot>\n\t);\n}\n\nfunction ActionItem( { name, as: Component = Button, onClick, ...props } ) {\n\treturn (\n\t\t<Fill name={ name }>\n\t\t\t{ ( { onClick: fpOnClick } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Component\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\tonClick || fpOnClick\n\t\t\t\t\t\t\t\t? ( ...args ) => {\n\t\t\t\t\t\t\t\t\t\t( onClick || noop )( ...args );\n\t\t\t\t\t\t\t\t\t\t( fpOnClick || noop )( ...args );\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</Fill>\n\t);\n}\n\nActionItem.Slot = ActionItemSlot;\n\nexport default ActionItem;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,MAAM,EAAEC,IAAI,EAAEC,IAAI,QAAQ,uBAAuB;AACvE,SAASC,QAAQ,QAAQ,oBAAoB;AAE7C,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,SAASC,cAAcA,CAAE;EACxBC,IAAI;EACJC,EAAE,EAAEC,SAAS,GAAGT,WAAW;EAC3BU,SAAS,GAAG,CAAC,CAAC;EACdC,gBAAgB;EAChB,GAAGC;AACJ,CAAC,EAAG;EACH,OACCC,aAAA,CAACX,IAAI;IACJK,IAAI,EAAGA,IAAM;IACbI,gBAAgB,EAAGA,gBAAkB;IACrCD,SAAS,EAAGA;EAAW,GAEnBI,KAAK,IAAM;IACd,IAAK,CAAEV,QAAQ,CAACW,OAAO,CAAED,KAAM,CAAC,CAACE,MAAM,EAAG;MACzC,OAAO,IAAI;IACZ;;IAEA;IACA;IACA;IACA;IACA;IACA,MAAMC,oBAAoB,GAAG,EAAE;IAC/Bb,QAAQ,CAACc,OAAO,CACfJ,KAAK,EACL,CAAE;MACDF,KAAK,EAAE;QAAEO,0BAA0B;QAAEC;MAAiB;IACvD,CAAC,KAAM;MACN,IAAKA,gBAAgB,IAAID,0BAA0B,EAAG;QACrDF,oBAAoB,CAACI,IAAI,CAAED,gBAAiB,CAAC;MAC9C;IACD,CACD,CAAC;IACD,MAAME,QAAQ,GAAGlB,QAAQ,CAACmB,GAAG,CAAET,KAAK,EAAIU,KAAK,IAAM;MAClD,IACC,CAAEA,KAAK,CAACZ,KAAK,CAACO,0BAA0B,IACxCF,oBAAoB,CAACQ,QAAQ,CAC5BD,KAAK,CAACZ,KAAK,CAACQ,gBACb,CAAC,EACA;QACD,OAAO,IAAI;MACZ;MACA,OAAOI,KAAK;IACb,CAAE,CAAC;IAEH,OAAOX,aAAA,CAACJ,SAAS;MAAA,GAAMG;IAAK,GAAKU,QAAqB,CAAC;EACxD,CACK,CAAC;AAET;AAEA,SAASI,UAAUA,CAAE;EAAEnB,IAAI;EAAEC,EAAE,EAAEC,SAAS,GAAGR,MAAM;EAAE0B,OAAO;EAAE,GAAGf;AAAM,CAAC,EAAG;EAC1E,OACCC,aAAA,CAACV,IAAI;IAACI,IAAI,EAAGA;EAAM,GAChB,CAAE;IAAEoB,OAAO,EAAEC;EAAU,CAAC,KAAM;IAC/B,OACCf,aAAA,CAACJ,SAAS;MACTkB,OAAO,EACNA,OAAO,IAAIC,SAAS,GACjB,CAAE,GAAGC,IAAI,KAAM;QACf,CAAEF,OAAO,IAAItB,IAAI,EAAI,GAAGwB,IAAK,CAAC;QAC9B,CAAED,SAAS,IAAIvB,IAAI,EAAI,GAAGwB,IAAK,CAAC;MAChC,CAAC,GACDC,SACH;MAAA,GACIlB;IAAK,CACV,CAAC;EAEJ,CACK,CAAC;AAET;AAEAc,UAAU,CAACxB,IAAI,GAAGI,cAAc;AAEhC,eAAeoB,UAAU"}
1
+ {"version":3,"names":["ButtonGroup","Button","Slot","Fill","Children","noop","ActionItemSlot","name","as","Component","fillProps","bubblesVirtually","props","createElement","fills","toArray","length","initializedByPlugins","forEach","__unstableExplicitMenuItem","__unstableTarget","push","children","map","child","includes","ActionItem","onClick","fpOnClick","args","undefined"],"sources":["@wordpress/interface/src/components/action-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ButtonGroup, Button, Slot, Fill } from '@wordpress/components';\nimport { Children } from '@wordpress/element';\n\nconst noop = () => {};\n\nfunction ActionItemSlot( {\n\tname,\n\tas: Component = ButtonGroup,\n\tfillProps = {},\n\tbubblesVirtually,\n\t...props\n} ) {\n\treturn (\n\t\t<Slot\n\t\t\tname={ name }\n\t\t\tbubblesVirtually={ bubblesVirtually }\n\t\t\tfillProps={ fillProps }\n\t\t>\n\t\t\t{ ( fills ) => {\n\t\t\t\tif ( ! Children.toArray( fills ).length ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\t// Special handling exists for backward compatibility.\n\t\t\t\t// It ensures that menu items created by plugin authors aren't\n\t\t\t\t// duplicated with automatically injected menu items coming\n\t\t\t\t// from pinnable plugin sidebars.\n\t\t\t\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t\t\t\tconst initializedByPlugins = [];\n\t\t\t\tChildren.forEach(\n\t\t\t\t\tfills,\n\t\t\t\t\t( {\n\t\t\t\t\t\tprops: { __unstableExplicitMenuItem, __unstableTarget },\n\t\t\t\t\t} ) => {\n\t\t\t\t\t\tif ( __unstableTarget && __unstableExplicitMenuItem ) {\n\t\t\t\t\t\t\tinitializedByPlugins.push( __unstableTarget );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tconst children = Children.map( fills, ( child ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\t! child.props.__unstableExplicitMenuItem &&\n\t\t\t\t\t\tinitializedByPlugins.includes(\n\t\t\t\t\t\t\tchild.props.__unstableTarget\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t} );\n\n\t\t\t\treturn <Component { ...props }>{ children }</Component>;\n\t\t\t} }\n\t\t</Slot>\n\t);\n}\n\nfunction ActionItem( { name, as: Component = Button, onClick, ...props } ) {\n\treturn (\n\t\t<Fill name={ name }>\n\t\t\t{ ( { onClick: fpOnClick } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Component\n\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\tonClick || fpOnClick\n\t\t\t\t\t\t\t\t? ( ...args ) => {\n\t\t\t\t\t\t\t\t\t\t( onClick || noop )( ...args );\n\t\t\t\t\t\t\t\t\t\t( fpOnClick || noop )( ...args );\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</Fill>\n\t);\n}\n\nActionItem.Slot = ActionItemSlot;\n\nexport default ActionItem;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,MAAM,EAAEC,IAAI,EAAEC,IAAI,QAAQ,uBAAuB;AACvE,SAASC,QAAQ,QAAQ,oBAAoB;AAE7C,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,SAASC,cAAcA,CAAE;EACxBC,IAAI;EACJC,EAAE,EAAEC,SAAS,GAAGT,WAAW;EAC3BU,SAAS,GAAG,CAAC,CAAC;EACdC,gBAAgB;EAChB,GAAGC;AACJ,CAAC,EAAG;EACH,OACCC,aAAA,CAACX,IAAI;IACJK,IAAI,EAAGA,IAAM;IACbI,gBAAgB,EAAGA,gBAAkB;IACrCD,SAAS,EAAGA;EAAW,GAEnBI,KAAK,IAAM;IACd,IAAK,CAAEV,QAAQ,CAACW,OAAO,CAAED,KAAM,CAAC,CAACE,MAAM,EAAG;MACzC,OAAO,IAAI;IACZ;;IAEA;IACA;IACA;IACA;IACA;IACA,MAAMC,oBAAoB,GAAG,EAAE;IAC/Bb,QAAQ,CAACc,OAAO,CACfJ,KAAK,EACL,CAAE;MACDF,KAAK,EAAE;QAAEO,0BAA0B;QAAEC;MAAiB;IACvD,CAAC,KAAM;MACN,IAAKA,gBAAgB,IAAID,0BAA0B,EAAG;QACrDF,oBAAoB,CAACI,IAAI,CAAED,gBAAiB,CAAC;MAC9C;IACD,CACD,CAAC;IACD,MAAME,QAAQ,GAAGlB,QAAQ,CAACmB,GAAG,CAAET,KAAK,EAAIU,KAAK,IAAM;MAClD,IACC,CAAEA,KAAK,CAACZ,KAAK,CAACO,0BAA0B,IACxCF,oBAAoB,CAACQ,QAAQ,CAC5BD,KAAK,CAACZ,KAAK,CAACQ,gBACb,CAAC,EACA;QACD,OAAO,IAAI;MACZ;MACA,OAAOI,KAAK;IACb,CAAE,CAAC;IAEH,OAAOX,aAAA,CAACJ,SAAS;MAAA,GAAMG;IAAK,GAAKU,QAAqB,CAAC;EACxD,CACK,CAAC;AAET;AAEA,SAASI,UAAUA,CAAE;EAAEnB,IAAI;EAAEC,EAAE,EAAEC,SAAS,GAAGR,MAAM;EAAE0B,OAAO;EAAE,GAAGf;AAAM,CAAC,EAAG;EAC1E,OACCC,aAAA,CAACV,IAAI;IAACI,IAAI,EAAGA;EAAM,GAChB,CAAE;IAAEoB,OAAO,EAAEC;EAAU,CAAC,KAAM;IAC/B,OACCf,aAAA,CAACJ,SAAS;MACTkB,OAAO,EACNA,OAAO,IAAIC,SAAS,GACjB,CAAE,GAAGC,IAAI,KAAM;QACf,CAAEF,OAAO,IAAItB,IAAI,EAAI,GAAGwB,IAAK,CAAC;QAC9B,CAAED,SAAS,IAAIvB,IAAI,EAAI,GAAGwB,IAAK,CAAC;MAChC,CAAC,GACDC,SACH;MAAA,GACIlB;IAAK,CACV,CAAC;EAEJ,CACK,CAAC;AAET;AAEAc,UAAU,CAACxB,IAAI,GAAGI,cAAc;AAEhC,eAAeoB,UAAU","ignoreList":[]}
@@ -7,13 +7,14 @@ import classnames from 'classnames';
7
7
  /**
8
8
  * WordPress dependencies
9
9
  */
10
- import { Button, Panel, Slot, Fill } from '@wordpress/components';
10
+ import { Button, Panel, Slot, Fill, __unstableMotion as motion, __unstableAnimatePresence as AnimatePresence } from '@wordpress/components';
11
11
  import { useDispatch, useSelect } from '@wordpress/data';
12
12
  import { __ } from '@wordpress/i18n';
13
13
  import { check, starEmpty, starFilled } from '@wordpress/icons';
14
- import { useEffect, useRef } from '@wordpress/element';
14
+ import { useEffect, useRef, useState } from '@wordpress/element';
15
15
  import { store as viewportStore } from '@wordpress/viewport';
16
16
  import { store as preferencesStore } from '@wordpress/preferences';
17
+ import { useReducedMotion, useViewportMatch, usePrevious } from '@wordpress/compose';
17
18
 
18
19
  /**
19
20
  * Internal dependencies
@@ -24,6 +25,7 @@ import ComplementaryAreaToggle from '../complementary-area-toggle';
24
25
  import withComplementaryAreaContext from '../complementary-area-context';
25
26
  import PinnedItems from '../pinned-items';
26
27
  import { store as interfaceStore } from '../../store';
28
+ const ANIMATION_DURATION = 0.3;
27
29
  function ComplementaryAreaSlot({
28
30
  scope,
29
31
  ...props
@@ -33,18 +35,60 @@ function ComplementaryAreaSlot({
33
35
  ...props
34
36
  });
35
37
  }
38
+ const SIDEBAR_WIDTH = 280;
39
+ const variants = {
40
+ open: {
41
+ width: SIDEBAR_WIDTH
42
+ },
43
+ closed: {
44
+ width: 0
45
+ },
46
+ mobileOpen: {
47
+ width: '100vw'
48
+ }
49
+ };
36
50
  function ComplementaryAreaFill({
51
+ activeArea,
52
+ isActive,
37
53
  scope,
38
54
  children,
39
55
  className,
40
56
  id
41
57
  }) {
58
+ const disableMotion = useReducedMotion();
59
+ const isMobileViewport = useViewportMatch('medium', '<');
60
+ // This is used to delay the exit animation to the next tick.
61
+ // The reason this is done is to allow us to apply the right transition properties
62
+ // When we switch from an open sidebar to another open sidebar.
63
+ // we don't want to animate in this case.
64
+ const previousActiveArea = usePrevious(activeArea);
65
+ const previousIsActive = usePrevious(isActive);
66
+ const [, setState] = useState({});
67
+ useEffect(() => {
68
+ setState({});
69
+ }, [isActive]);
70
+ const transition = {
71
+ type: 'tween',
72
+ duration: disableMotion || isMobileViewport || !!previousActiveArea && !!activeArea && activeArea !== previousActiveArea ? 0 : ANIMATION_DURATION,
73
+ ease: [0.6, 0, 0.4, 1]
74
+ };
42
75
  return createElement(Fill, {
43
76
  name: `ComplementaryArea/${scope}`
77
+ }, createElement(AnimatePresence, {
78
+ initial: false
79
+ }, (previousIsActive || isActive) && createElement(motion.div, {
80
+ variants: variants,
81
+ initial: "closed",
82
+ animate: isMobileViewport ? 'mobileOpen' : 'open',
83
+ exit: "closed",
84
+ transition: transition
44
85
  }, createElement("div", {
45
86
  id: id,
46
- className: className
47
- }, children));
87
+ className: className,
88
+ style: {
89
+ width: isMobileViewport ? '100vw' : SIDEBAR_WIDTH
90
+ }
91
+ }, children))));
48
92
  }
49
93
  function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) {
50
94
  const previousIsSmall = useRef(false);
@@ -99,6 +143,11 @@ function ComplementaryArea({
99
143
  toggleShortcut,
100
144
  isActiveByDefault
101
145
  }) {
146
+ // This state is used to delay the rendering of the Fill
147
+ // until the initial effect runs.
148
+ // This prevents the animation from running on mount if
149
+ // the complementary area is active by default.
150
+ const [isReady, setIsReady] = useState(false);
102
151
  const {
103
152
  isLoading,
104
153
  isActive,
@@ -142,7 +191,11 @@ function ComplementaryArea({
142
191
  } else if (activeArea === undefined && isSmall) {
143
192
  disableComplementaryArea(scope, identifier);
144
193
  }
194
+ setIsReady(true);
145
195
  }, [activeArea, isActiveByDefault, scope, identifier, isSmall, enableComplementaryArea, disableComplementaryArea]);
196
+ if (!isReady) {
197
+ return;
198
+ }
146
199
  return createElement(Fragment, null, isPinnable && createElement(PinnedItems, {
147
200
  scope: scope
148
201
  }, isPinned && createElement(ComplementaryAreaToggle, {
@@ -160,7 +213,9 @@ function ComplementaryArea({
160
213
  target: name,
161
214
  scope: scope,
162
215
  icon: icon
163
- }, title), isActive && createElement(ComplementaryAreaFill, {
216
+ }, title), createElement(ComplementaryAreaFill, {
217
+ activeArea: activeArea,
218
+ isActive: isActive,
164
219
  className: classnames('interface-complementary-area', className),
165
220
  scope: scope,
166
221
  id: identifier.replace('/', ':')
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","Button","Panel","Slot","Fill","useDispatch","useSelect","__","check","starEmpty","starFilled","useEffect","useRef","store","viewportStore","preferencesStore","ComplementaryAreaHeader","ComplementaryAreaMoreMenuItem","ComplementaryAreaToggle","withComplementaryAreaContext","PinnedItems","interfaceStore","ComplementaryAreaSlot","scope","props","createElement","name","ComplementaryAreaFill","children","className","id","useAdjustComplementaryListener","identifier","activeArea","isActive","isSmall","previousIsSmall","shouldOpenWhenNotSmall","enableComplementaryArea","disableComplementaryArea","current","ComplementaryArea","closeLabel","header","headerClassName","icon","isPinnable","panelClassName","smallScreenTitle","title","toggleShortcut","isActiveByDefault","isLoading","isPinned","isLarge","showIconLabels","select","getActiveComplementaryArea","isComplementaryAreaLoading","isItemPinned","get","_activeArea","isViewportMatch","pinItem","unpinItem","undefined","Fragment","isPressed","label","showTooltip","variant","size","target","replace","onClose","toggleButtonProps","shortcut","onClick","ComplementaryAreaWrapped"],"sources":["@wordpress/interface/src/components/complementary-area/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Panel, Slot, Fill } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { check, starEmpty, starFilled } from '@wordpress/icons';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { store as viewportStore } from '@wordpress/viewport';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaHeader from '../complementary-area-header';\nimport ComplementaryAreaMoreMenuItem from '../complementary-area-more-menu-item';\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport withComplementaryAreaContext from '../complementary-area-context';\nimport PinnedItems from '../pinned-items';\nimport { store as interfaceStore } from '../../store';\n\nfunction ComplementaryAreaSlot( { scope, ...props } ) {\n\treturn <Slot name={ `ComplementaryArea/${ scope }` } { ...props } />;\n}\n\nfunction ComplementaryAreaFill( { scope, children, className, id } ) {\n\treturn (\n\t\t<Fill name={ `ComplementaryArea/${ scope }` }>\n\t\t\t<div id={ id } className={ className }>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</Fill>\n\t);\n}\n\nfunction useAdjustComplementaryListener(\n\tscope,\n\tidentifier,\n\tactiveArea,\n\tisActive,\n\tisSmall\n) {\n\tconst previousIsSmall = useRef( false );\n\tconst shouldOpenWhenNotSmall = useRef( false );\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\tuseEffect( () => {\n\t\t// If the complementary area is active and the editor is switching from\n\t\t// a big to a small window size.\n\t\tif ( isActive && isSmall && ! previousIsSmall.current ) {\n\t\t\tdisableComplementaryArea( scope );\n\t\t\t// Flag the complementary area to be reopened when the window size\n\t\t\t// goes from small to big.\n\t\t\tshouldOpenWhenNotSmall.current = true;\n\t\t} else if (\n\t\t\t// If there is a flag indicating the complementary area should be\n\t\t\t// enabled when we go from small to big window size and we are going\n\t\t\t// from a small to big window size.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\t! isSmall &&\n\t\t\tpreviousIsSmall.current\n\t\t) {\n\t\t\t// Remove the flag indicating the complementary area should be\n\t\t\t// enabled.\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if (\n\t\t\t// If the flag is indicating the current complementary should be\n\t\t\t// reopened but another complementary area becomes active, remove\n\t\t\t// the flag.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\tactiveArea &&\n\t\t\tactiveArea !== identifier\n\t\t) {\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t}\n\t\tif ( isSmall !== previousIsSmall.current ) {\n\t\t\tpreviousIsSmall.current = isSmall;\n\t\t}\n\t}, [\n\t\tisActive,\n\t\tisSmall,\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tdisableComplementaryArea,\n\t\tenableComplementaryArea,\n\t] );\n}\n\nfunction ComplementaryArea( {\n\tchildren,\n\tclassName,\n\tcloseLabel = __( 'Close plugin' ),\n\tidentifier,\n\theader,\n\theaderClassName,\n\ticon,\n\tisPinnable = true,\n\tpanelClassName,\n\tscope,\n\tname,\n\tsmallScreenTitle,\n\ttitle,\n\ttoggleShortcut,\n\tisActiveByDefault,\n} ) {\n\tconst {\n\t\tisLoading,\n\t\tisActive,\n\t\tisPinned,\n\t\tactiveArea,\n\t\tisSmall,\n\t\tisLarge,\n\t\tshowIconLabels,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetActiveComplementaryArea,\n\t\t\t\tisComplementaryAreaLoading,\n\t\t\t\tisItemPinned,\n\t\t\t} = select( interfaceStore );\n\t\t\tconst { get } = select( preferencesStore );\n\n\t\t\tconst _activeArea = getActiveComplementaryArea( scope );\n\n\t\t\treturn {\n\t\t\t\tisLoading: isComplementaryAreaLoading( scope ),\n\t\t\t\tisActive: _activeArea === identifier,\n\t\t\t\tisPinned: isItemPinned( scope, identifier ),\n\t\t\t\tactiveArea: _activeArea,\n\t\t\t\tisSmall: select( viewportStore ).isViewportMatch( '< medium' ),\n\t\t\t\tisLarge: select( viewportStore ).isViewportMatch( 'large' ),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t},\n\t\t[ identifier, scope ]\n\t);\n\tuseAdjustComplementaryListener(\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tisActive,\n\t\tisSmall\n\t);\n\tconst {\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t\tpinItem,\n\t\tunpinItem,\n\t} = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\t// Set initial visibility: For large screens, enable if it's active by\n\t\t// default. For small screens, always initially disable.\n\t\tif ( isActiveByDefault && activeArea === undefined && ! isSmall ) {\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if ( activeArea === undefined && isSmall ) {\n\t\t\tdisableComplementaryArea( scope, identifier );\n\t\t}\n\t}, [\n\t\tactiveArea,\n\t\tisActiveByDefault,\n\t\tscope,\n\t\tidentifier,\n\t\tisSmall,\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t] );\n\n\treturn (\n\t\t<>\n\t\t\t{ isPinnable && (\n\t\t\t\t<PinnedItems scope={ scope }>\n\t\t\t\t\t{ isPinned && (\n\t\t\t\t\t\t<ComplementaryAreaToggle\n\t\t\t\t\t\t\tscope={ scope }\n\t\t\t\t\t\t\tidentifier={ identifier }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisActive && ( ! showIconLabels || isLarge )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-expanded={ isActive }\n\t\t\t\t\t\t\taria-disabled={ isLoading }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\ticon={ showIconLabels ? check : icon }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PinnedItems>\n\t\t\t) }\n\t\t\t{ name && isPinnable && (\n\t\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\t\ttarget={ name }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t\t) }\n\t\t\t{ isActive && (\n\t\t\t\t<ComplementaryAreaFill\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'interface-complementary-area',\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t\tid={ identifier.replace( '/', ':' ) }\n\t\t\t\t>\n\t\t\t\t\t<ComplementaryAreaHeader\n\t\t\t\t\t\tclassName={ headerClassName }\n\t\t\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\t\t\tonClose={ () => disableComplementaryArea( scope ) }\n\t\t\t\t\t\tsmallScreenTitle={ smallScreenTitle }\n\t\t\t\t\t\ttoggleButtonProps={ {\n\t\t\t\t\t\t\tlabel: closeLabel,\n\t\t\t\t\t\t\tshortcut: toggleShortcut,\n\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\tidentifier,\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ header || (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<h2 className=\"interface-complementary-area-header__title\">\n\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t\t{ isPinnable && (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tclassName=\"interface-complementary-area__pin-unpin-item\"\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tisPinned ? starFilled : starEmpty\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\tisPinned\n\t\t\t\t\t\t\t\t\t\t\t\t? __( 'Unpin from toolbar' )\n\t\t\t\t\t\t\t\t\t\t\t\t: __( 'Pin to toolbar' )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\t( isPinned ? unpinItem : pinItem )(\n\t\t\t\t\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisPressed={ isPinned }\n\t\t\t\t\t\t\t\t\t\taria-expanded={ isPinned }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ComplementaryAreaHeader>\n\t\t\t\t\t<Panel className={ panelClassName }>{ children }</Panel>\n\t\t\t\t</ComplementaryAreaFill>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nconst ComplementaryAreaWrapped =\n\twithComplementaryAreaContext( ComplementaryArea );\n\nComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;\n\nexport default ComplementaryAreaWrapped;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAEC,IAAI,QAAQ,uBAAuB;AACjE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,EAAEC,SAAS,EAAEC,UAAU,QAAQ,kBAAkB;AAC/D,SAASC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACtD,SAASC,KAAK,IAAIC,aAAa,QAAQ,qBAAqB;AAC5D,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,6BAA6B,MAAM,sCAAsC;AAChF,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,4BAA4B,MAAM,+BAA+B;AACxE,OAAOC,WAAW,MAAM,iBAAiB;AACzC,SAASP,KAAK,IAAIQ,cAAc,QAAQ,aAAa;AAErD,SAASC,qBAAqBA,CAAE;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,EAAG;EACrD,OAAOC,aAAA,CAACtB,IAAI;IAACuB,IAAI,EAAI,qBAAqBH,KAAO,EAAG;IAAA,GAAMC;EAAK,CAAI,CAAC;AACrE;AAEA,SAASG,qBAAqBA,CAAE;EAAEJ,KAAK;EAAEK,QAAQ;EAAEC,SAAS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AS,EAAG7B,UAAU,CACrB,8BAA8B,EAC9B6B,SACD,CAAG;IACHN,KAAK,EAAGA,KAAO;IACfO,EAAE,EAAGE,UAAU,CAACyC,OAAO,CAAE,GAAG,EAAE,GAAI;EAAG,GAErChD,aAAA,CAACT,uBAAuB;IACvBa,SAAS,EAAGe,eAAiB;IAC7BF,UAAU,EAAGA,UAAY;IACzBgC,OAAO,EAAGA,CAAA,KAAMnC,wBAAwB,CAAEhB,KAAM,CAAG;IACnDyB,gBAAgB,EAAGA,gBAAkB;IACrC2B,iBAAiB,EAAG;MACnBP,KAAK,EAAE1B,UAAU;MACjBkC,QAAQ,EAAE1B,cAAc;MACxB3B,KAAK;MACLS;IACD;EAAG,GAEDW,MAAM,IACPlB,aAAA,CAAAyC,QAAA,QACCzC,aAAA;IAAII,SAAS,EAAC;EAA4C,GACvDoB,KACC,CAAC,EACHH,UAAU,IACXrB,aAAA,CAACxB,MAAM;IACN4B,SAAS,EAAC,8CAA8C;IACxDgB,IAAI,EACHQ,QAAQ,GAAG3C,UAAU,GAAGD,SACxB;IACD2D,KAAK,EACJf,QAAQ,GACL9C,EAAE,CAAE,oBAAqB,CAAC,GAC1BA,EAAE,CAAE,gBAAiB,CACxB;IACDsE,OAAO,EAAGA,CAAA,KACT,CAAExB,QAAQ,GAAGW,SAAS,GAAGD,OAAO,EAC/BxC,KAAK,EACLS,UACD,CACA;IACDmC,SAAS,EAAGd,QAAU;IACtB,iBAAgBA;EAAU,CAC1B,CAED,CAEqB,CAAC,EAC1B5B,aAAA,CAACvB,KAAK;IAAC2B,SAAS,EAAGkB;EAAgB,GAAGnB,QAAiB,CACjC,CAEvB,CAAC;AAEL;AAEA,MAAMkD,wBAAwB,GAC7B3D,4BAA4B,CAAEsB,iBAAkB,CAAC;AAElDqC,wBAAwB,CAAC3E,IAAI,GAAGmB,qBAAqB;AAErD,eAAewD,wBAAwB"}
1
+ {"version":3,"names":["classnames","Button","Panel","Slot","Fill","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","useDispatch","useSelect","__","check","starEmpty","starFilled","useEffect","useRef","useState","store","viewportStore","preferencesStore","useReducedMotion","useViewportMatch","usePrevious","ComplementaryAreaHeader","ComplementaryAreaMoreMenuItem","ComplementaryAreaToggle","withComplementaryAreaContext","PinnedItems","interfaceStore","ANIMATION_DURATION","ComplementaryAreaSlot","scope","props","createElement","name","SIDEBAR_WIDTH","variants","open","width","closed","mobileOpen","ComplementaryAreaFill","activeArea","isActive","children","className","id","disableMotion","isMobileViewport","previousActiveArea","previousIsActive","setState","transition","type","duration","ease","initial","div","animate","exit","style","useAdjustComplementaryListener","identifier","isSmall","previousIsSmall","shouldOpenWhenNotSmall","enableComplementaryArea","disableComplementaryArea","current","ComplementaryArea","closeLabel","header","headerClassName","icon","isPinnable","panelClassName","smallScreenTitle","title","toggleShortcut","isActiveByDefault","isReady","setIsReady","isLoading","isPinned","isLarge","showIconLabels","select","getActiveComplementaryArea","isComplementaryAreaLoading","isItemPinned","get","_activeArea","isViewportMatch","pinItem","unpinItem","undefined","Fragment","isPressed","label","showTooltip","variant","size","target","replace","onClose","toggleButtonProps","shortcut","onClick","ComplementaryAreaWrapped"],"sources":["@wordpress/interface/src/components/complementary-area/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tPanel,\n\tSlot,\n\tFill,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { check, starEmpty, starFilled } from '@wordpress/icons';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { store as viewportStore } from '@wordpress/viewport';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tuseReducedMotion,\n\tuseViewportMatch,\n\tusePrevious,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaHeader from '../complementary-area-header';\nimport ComplementaryAreaMoreMenuItem from '../complementary-area-more-menu-item';\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport withComplementaryAreaContext from '../complementary-area-context';\nimport PinnedItems from '../pinned-items';\nimport { store as interfaceStore } from '../../store';\n\nconst ANIMATION_DURATION = 0.3;\n\nfunction ComplementaryAreaSlot( { scope, ...props } ) {\n\treturn <Slot name={ `ComplementaryArea/${ scope }` } { ...props } />;\n}\n\nconst SIDEBAR_WIDTH = 280;\nconst variants = {\n\topen: { width: SIDEBAR_WIDTH },\n\tclosed: { width: 0 },\n\tmobileOpen: { width: '100vw' },\n};\n\nfunction ComplementaryAreaFill( {\n\tactiveArea,\n\tisActive,\n\tscope,\n\tchildren,\n\tclassName,\n\tid,\n} ) {\n\tconst disableMotion = useReducedMotion();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\t// This is used to delay the exit animation to the next tick.\n\t// The reason this is done is to allow us to apply the right transition properties\n\t// When we switch from an open sidebar to another open sidebar.\n\t// we don't want to animate in this case.\n\tconst previousActiveArea = usePrevious( activeArea );\n\tconst previousIsActive = usePrevious( isActive );\n\tconst [ , setState ] = useState( {} );\n\tuseEffect( () => {\n\t\tsetState( {} );\n\t}, [ isActive ] );\n\tconst transition = {\n\t\ttype: 'tween',\n\t\tduration:\n\t\t\tdisableMotion ||\n\t\t\tisMobileViewport ||\n\t\t\t( !! previousActiveArea &&\n\t\t\t\t!! activeArea &&\n\t\t\t\tactiveArea !== previousActiveArea )\n\t\t\t\t? 0\n\t\t\t\t: ANIMATION_DURATION,\n\t\tease: [ 0.6, 0, 0.4, 1 ],\n\t};\n\n\treturn (\n\t\t<Fill name={ `ComplementaryArea/${ scope }` }>\n\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t{ ( previousIsActive || isActive ) && (\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tvariants={ variants }\n\t\t\t\t\t\tinitial=\"closed\"\n\t\t\t\t\t\tanimate={ isMobileViewport ? 'mobileOpen' : 'open' }\n\t\t\t\t\t\texit=\"closed\"\n\t\t\t\t\t\ttransition={ transition }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tid={ id }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\twidth: isMobileViewport\n\t\t\t\t\t\t\t\t\t? '100vw'\n\t\t\t\t\t\t\t\t\t: SIDEBAR_WIDTH,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</motion.div>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t</Fill>\n\t);\n}\n\nfunction useAdjustComplementaryListener(\n\tscope,\n\tidentifier,\n\tactiveArea,\n\tisActive,\n\tisSmall\n) {\n\tconst previousIsSmall = useRef( false );\n\tconst shouldOpenWhenNotSmall = useRef( false );\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\tuseEffect( () => {\n\t\t// If the complementary area is active and the editor is switching from\n\t\t// a big to a small window size.\n\t\tif ( isActive && isSmall && ! previousIsSmall.current ) {\n\t\t\tdisableComplementaryArea( scope );\n\t\t\t// Flag the complementary area to be reopened when the window size\n\t\t\t// goes from small to big.\n\t\t\tshouldOpenWhenNotSmall.current = true;\n\t\t} else if (\n\t\t\t// If there is a flag indicating the complementary area should be\n\t\t\t// enabled when we go from small to big window size and we are going\n\t\t\t// from a small to big window size.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\t! isSmall &&\n\t\t\tpreviousIsSmall.current\n\t\t) {\n\t\t\t// Remove the flag indicating the complementary area should be\n\t\t\t// enabled.\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if (\n\t\t\t// If the flag is indicating the current complementary should be\n\t\t\t// reopened but another complementary area becomes active, remove\n\t\t\t// the flag.\n\t\t\tshouldOpenWhenNotSmall.current &&\n\t\t\tactiveArea &&\n\t\t\tactiveArea !== identifier\n\t\t) {\n\t\t\tshouldOpenWhenNotSmall.current = false;\n\t\t}\n\t\tif ( isSmall !== previousIsSmall.current ) {\n\t\t\tpreviousIsSmall.current = isSmall;\n\t\t}\n\t}, [\n\t\tisActive,\n\t\tisSmall,\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tdisableComplementaryArea,\n\t\tenableComplementaryArea,\n\t] );\n}\n\nfunction ComplementaryArea( {\n\tchildren,\n\tclassName,\n\tcloseLabel = __( 'Close plugin' ),\n\tidentifier,\n\theader,\n\theaderClassName,\n\ticon,\n\tisPinnable = true,\n\tpanelClassName,\n\tscope,\n\tname,\n\tsmallScreenTitle,\n\ttitle,\n\ttoggleShortcut,\n\tisActiveByDefault,\n} ) {\n\t// This state is used to delay the rendering of the Fill\n\t// until the initial effect runs.\n\t// This prevents the animation from running on mount if\n\t// the complementary area is active by default.\n\tconst [ isReady, setIsReady ] = useState( false );\n\tconst {\n\t\tisLoading,\n\t\tisActive,\n\t\tisPinned,\n\t\tactiveArea,\n\t\tisSmall,\n\t\tisLarge,\n\t\tshowIconLabels,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetActiveComplementaryArea,\n\t\t\t\tisComplementaryAreaLoading,\n\t\t\t\tisItemPinned,\n\t\t\t} = select( interfaceStore );\n\t\t\tconst { get } = select( preferencesStore );\n\n\t\t\tconst _activeArea = getActiveComplementaryArea( scope );\n\n\t\t\treturn {\n\t\t\t\tisLoading: isComplementaryAreaLoading( scope ),\n\t\t\t\tisActive: _activeArea === identifier,\n\t\t\t\tisPinned: isItemPinned( scope, identifier ),\n\t\t\t\tactiveArea: _activeArea,\n\t\t\t\tisSmall: select( viewportStore ).isViewportMatch( '< medium' ),\n\t\t\t\tisLarge: select( viewportStore ).isViewportMatch( 'large' ),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t};\n\t\t},\n\t\t[ identifier, scope ]\n\t);\n\tuseAdjustComplementaryListener(\n\t\tscope,\n\t\tidentifier,\n\t\tactiveArea,\n\t\tisActive,\n\t\tisSmall\n\t);\n\tconst {\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t\tpinItem,\n\t\tunpinItem,\n\t} = useDispatch( interfaceStore );\n\n\tuseEffect( () => {\n\t\t// Set initial visibility: For large screens, enable if it's active by\n\t\t// default. For small screens, always initially disable.\n\t\tif ( isActiveByDefault && activeArea === undefined && ! isSmall ) {\n\t\t\tenableComplementaryArea( scope, identifier );\n\t\t} else if ( activeArea === undefined && isSmall ) {\n\t\t\tdisableComplementaryArea( scope, identifier );\n\t\t}\n\t\tsetIsReady( true );\n\t}, [\n\t\tactiveArea,\n\t\tisActiveByDefault,\n\t\tscope,\n\t\tidentifier,\n\t\tisSmall,\n\t\tenableComplementaryArea,\n\t\tdisableComplementaryArea,\n\t] );\n\n\tif ( ! isReady ) {\n\t\treturn;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isPinnable && (\n\t\t\t\t<PinnedItems scope={ scope }>\n\t\t\t\t\t{ isPinned && (\n\t\t\t\t\t\t<ComplementaryAreaToggle\n\t\t\t\t\t\t\tscope={ scope }\n\t\t\t\t\t\t\tidentifier={ identifier }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisActive && ( ! showIconLabels || isLarge )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-expanded={ isActive }\n\t\t\t\t\t\t\taria-disabled={ isLoading }\n\t\t\t\t\t\t\tlabel={ title }\n\t\t\t\t\t\t\ticon={ showIconLabels ? check : icon }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PinnedItems>\n\t\t\t) }\n\t\t\t{ name && isPinnable && (\n\t\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\t\ttarget={ name }\n\t\t\t\t\tscope={ scope }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t\t) }\n\t\t\t<ComplementaryAreaFill\n\t\t\t\tactiveArea={ activeArea }\n\t\t\t\tisActive={ isActive }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'interface-complementary-area',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\tscope={ scope }\n\t\t\t\tid={ identifier.replace( '/', ':' ) }\n\t\t\t>\n\t\t\t\t<ComplementaryAreaHeader\n\t\t\t\t\tclassName={ headerClassName }\n\t\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\t\tonClose={ () => disableComplementaryArea( scope ) }\n\t\t\t\t\tsmallScreenTitle={ smallScreenTitle }\n\t\t\t\t\ttoggleButtonProps={ {\n\t\t\t\t\t\tlabel: closeLabel,\n\t\t\t\t\t\tshortcut: toggleShortcut,\n\t\t\t\t\t\tscope,\n\t\t\t\t\t\tidentifier,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ header || (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h2 className=\"interface-complementary-area-header__title\">\n\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t\t{ isPinnable && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName=\"interface-complementary-area__pin-unpin-item\"\n\t\t\t\t\t\t\t\t\ticon={ isPinned ? starFilled : starEmpty }\n\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\tisPinned\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Unpin from toolbar' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Pin to toolbar' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t( isPinned ? unpinItem : pinItem )(\n\t\t\t\t\t\t\t\t\t\t\tscope,\n\t\t\t\t\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tisPressed={ isPinned }\n\t\t\t\t\t\t\t\t\taria-expanded={ isPinned }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</ComplementaryAreaHeader>\n\t\t\t\t<Panel className={ panelClassName }>{ children }</Panel>\n\t\t\t</ComplementaryAreaFill>\n\t\t</>\n\t);\n}\n\nconst ComplementaryAreaWrapped =\n\twithComplementaryAreaContext( ComplementaryArea );\n\nComplementaryAreaWrapped.Slot = ComplementaryAreaSlot;\n\nexport default ComplementaryAreaWrapped;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,MAAM,EACNC,KAAK,EACLC,IAAI,EACJC,IAAI,EACJC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,uBAAuB;AAC9B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,EAAEC,SAAS,EAAEC,UAAU,QAAQ,kBAAkB;AAC/D,SAASC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AAChE,SAASC,KAAK,IAAIC,aAAa,QAAQ,qBAAqB;AAC5D,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,gBAAgB,EAChBC,gBAAgB,EAChBC,WAAW,QACL,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,6BAA6B,MAAM,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;MACxB/C,KAAK;MACL+B;IACD;EAAG,GAEDS,MAAM,IACPtC,aAAA,CAAA+D,QAAA,QACC/D,aAAA;IAAIY,SAAS,EAAC;EAA4C,GACvDgC,KACC,CAAC,EACHH,UAAU,IACXzC,aAAA,CAACjC,MAAM;IACN6C,SAAS,EAAC,8CAA8C;IACxD4B,IAAI,EAAGU,QAAQ,GAAGtE,UAAU,GAAGD,SAAW;IAC1CsF,KAAK,EACJf,QAAQ,GACLzE,EAAE,CAAE,oBAAqB,CAAC,GAC1BA,EAAE,CAAE,gBAAiB,CACxB;IACDiG,OAAO,EAAGA,CAAA,KACT,CAAExB,QAAQ,GAAGW,SAAS,GAAGD,OAAO,EAC/B9D,KAAK,EACL+B,UACD,CACA;IACDmC,SAAS,EAAGd,QAAU;IACtB,iBAAgBA;EAAU,CAC1B,CAED,CAEqB,CAAC,EAC1BlD,aAAA,CAAChC,KAAK;IAAC4C,SAAS,EAAG8B;EAAgB,GAAG/B,QAAiB,CACjC,CACtB,CAAC;AAEL;AAEA,MAAMgE,wBAAwB,GAC7BlF,4BAA4B,CAAE2C,iBAAkB,CAAC;AAElDuC,wBAAwB,CAAC1G,IAAI,GAAG4B,qBAAqB;AAErD,eAAe8E,wBAAwB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["withPluginContext","context","ownProps","icon","identifier","name"],"sources":["@wordpress/interface/src/components/complementary-area-context/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withPluginContext } from '@wordpress/plugins';\n\nexport default withPluginContext( ( context, ownProps ) => {\n\treturn {\n\t\ticon: ownProps.icon || context.icon,\n\t\tidentifier:\n\t\t\townProps.identifier || `${ context.name }/${ ownProps.name }`,\n\t};\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,oBAAoB;AAEtD,eAAeA,iBAAiB,CAAE,CAAEC,OAAO,EAAEC,QAAQ,KAAM;EAC1D,OAAO;IACNC,IAAI,EAAED,QAAQ,CAACC,IAAI,IAAIF,OAAO,CAACE,IAAI;IACnCC,UAAU,EACTF,QAAQ,CAACE,UAAU,IAAK,GAAGH,OAAO,CAACI,IAAM,IAAIH,QAAQ,CAACG,IAAM;EAC9D,CAAC;AACF,CAAE,CAAC"}
1
+ {"version":3,"names":["withPluginContext","context","ownProps","icon","identifier","name"],"sources":["@wordpress/interface/src/components/complementary-area-context/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { withPluginContext } from '@wordpress/plugins';\n\nexport default withPluginContext( ( context, ownProps ) => {\n\treturn {\n\t\ticon: ownProps.icon || context.icon,\n\t\tidentifier:\n\t\t\townProps.identifier || `${ context.name }/${ ownProps.name }`,\n\t};\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,QAAQ,oBAAoB;AAEtD,eAAeA,iBAAiB,CAAE,CAAEC,OAAO,EAAEC,QAAQ,KAAM;EAC1D,OAAO;IACNC,IAAI,EAAED,QAAQ,CAACC,IAAI,IAAIF,OAAO,CAACE,IAAI;IACnCC,UAAU,EACTF,QAAQ,CAACE,UAAU,IAAK,GAAGH,OAAO,CAACI,IAAM,IAAIH,QAAQ,CAACG,IAAM;EAC9D,CAAC;AACF,CAAE,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","closeSmall","ComplementaryAreaToggle","ComplementaryAreaHeader","smallScreenTitle","children","className","toggleButtonProps","toggleButton","createElement","icon","Fragment","tabIndex"],"sources":["@wordpress/interface/src/components/complementary-area-header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\n\nconst ComplementaryAreaHeader = ( {\n\tsmallScreenTitle,\n\tchildren,\n\tclassName,\n\ttoggleButtonProps,\n} ) => {\n\tconst toggleButton = (\n\t\t<ComplementaryAreaToggle icon={ closeSmall } { ...toggleButtonProps } />\n\t);\n\treturn (\n\t\t<>\n\t\t\t<div className=\"components-panel__header interface-complementary-area-header__small\">\n\t\t\t\t{ smallScreenTitle && (\n\t\t\t\t\t<h2 className=\"interface-complementary-area-header__small-title\">\n\t\t\t\t\t\t{ smallScreenTitle }\n\t\t\t\t\t</h2>\n\t\t\t\t) }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'components-panel__header',\n\t\t\t\t\t'interface-complementary-area-header',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default ComplementaryAreaHeader;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,kBAAkB;;AAE7C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAElE,MAAMC,uBAAuB,GAAGA,CAAE;EACjCC,gBAAgB;EAChBC,QAAQ;EACRC,SAAS;EACTC;AACD,CAAC,KAAM;EACN,MAAMC,YAAY,GACjBC,aAAA,CAACP,uBAAuB;IAACQ,IAAI,EAAGT,UAAY;IAAA,GAAMM;EAAiB,CAAI,CACvE;EACD,OACCE,aAAA,CAAAE,QAAA,QACCF,aAAA;IAAKH,SAAS,EAAC;EAAqE,GACjFF,gBAAgB,IACjBK,aAAA;IAAIH,SAAS,EAAC;EAAkD,GAC7DF,gBACC,CACJ,EACCI,YACE,CAAC,EACNC,aAAA;IACCH,SAAS,EAAGN,UAAU,CACrB,0BAA0B,EAC1B,qCAAqC,EACrCM,SACD,CAAG;IACHM,QAAQ,EAAG,CAAC;EAAG,GAEbP,QAAQ,EACRG,YACE,CACJ,CAAC;AAEL,CAAC;AAED,eAAeL,uBAAuB"}
1
+ {"version":3,"names":["classnames","closeSmall","ComplementaryAreaToggle","ComplementaryAreaHeader","smallScreenTitle","children","className","toggleButtonProps","toggleButton","createElement","icon","Fragment","tabIndex"],"sources":["@wordpress/interface/src/components/complementary-area-header/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\n\nconst ComplementaryAreaHeader = ( {\n\tsmallScreenTitle,\n\tchildren,\n\tclassName,\n\ttoggleButtonProps,\n} ) => {\n\tconst toggleButton = (\n\t\t<ComplementaryAreaToggle icon={ closeSmall } { ...toggleButtonProps } />\n\t);\n\treturn (\n\t\t<>\n\t\t\t<div className=\"components-panel__header interface-complementary-area-header__small\">\n\t\t\t\t{ smallScreenTitle && (\n\t\t\t\t\t<h2 className=\"interface-complementary-area-header__small-title\">\n\t\t\t\t\t\t{ smallScreenTitle }\n\t\t\t\t\t</h2>\n\t\t\t\t) }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'components-panel__header',\n\t\t\t\t\t'interface-complementary-area-header',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\ttabIndex={ -1 }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t{ toggleButton }\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default ComplementaryAreaHeader;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,kBAAkB;;AAE7C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAElE,MAAMC,uBAAuB,GAAGA,CAAE;EACjCC,gBAAgB;EAChBC,QAAQ;EACRC,SAAS;EACTC;AACD,CAAC,KAAM;EACN,MAAMC,YAAY,GACjBC,aAAA,CAACP,uBAAuB;IAACQ,IAAI,EAAGT,UAAY;IAAA,GAAMM;EAAiB,CAAI,CACvE;EACD,OACCE,aAAA,CAAAE,QAAA,QACCF,aAAA;IAAKH,SAAS,EAAC;EAAqE,GACjFF,gBAAgB,IACjBK,aAAA;IAAIH,SAAS,EAAC;EAAkD,GAC7DF,gBACC,CACJ,EACCI,YACE,CAAC,EACNC,aAAA;IACCH,SAAS,EAAGN,UAAU,CACrB,0BAA0B,EAC1B,qCAAqC,EACrCM,SACD,CAAG;IACHM,QAAQ,EAAG,CAAC;EAAG,GAEbP,QAAQ,EACRG,YACE,CACJ,CAAC;AAEL,CAAC;AAED,eAAeL,uBAAuB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["check","MenuItem","ComplementaryAreaToggle","ActionItem","PluginsMenuItem","__unstableExplicitMenuItem","__unstableTarget","restProps","createElement","ComplementaryAreaMoreMenuItem","scope","target","props","as","toggleProps","name","role","selectedIcon"],"sources":["@wordpress/interface/src/components/complementary-area-more-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { check } from '@wordpress/icons';\nimport { MenuItem } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport ActionItem from '../action-item';\n\nconst PluginsMenuItem = ( {\n\t// Menu item is marked with unstable prop for backward compatibility.\n\t// They are removed so they don't leak to DOM elements.\n\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t__unstableExplicitMenuItem,\n\t__unstableTarget,\n\t...restProps\n} ) => <MenuItem { ...restProps } />;\n\nexport default function ComplementaryAreaMoreMenuItem( {\n\tscope,\n\ttarget,\n\t__unstableExplicitMenuItem,\n\t...props\n} ) {\n\treturn (\n\t\t<ComplementaryAreaToggle\n\t\t\tas={ ( toggleProps ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ActionItem\n\t\t\t\t\t\t__unstableExplicitMenuItem={\n\t\t\t\t\t\t\t__unstableExplicitMenuItem\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableTarget={ `${ scope }/${ target }` }\n\t\t\t\t\t\tas={ PluginsMenuItem }\n\t\t\t\t\t\tname={ `${ scope }/plugin-more-menu` }\n\t\t\t\t\t\t{ ...toggleProps }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tselectedIcon={ check }\n\t\t\tname={ target }\n\t\t\tscope={ scope }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,kBAAkB;AACxC,SAASC,QAAQ,QAAQ,uBAAuB;;AAEhD;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,UAAU,MAAM,gBAAgB;AAEvC,MAAMC,eAAe,GAAGA,CAAE;EACzB;EACA;EACA;EACAC,0BAA0B;EAC1BC,gBAAgB;EAChB,GAAGC;AACJ,CAAC,KAAMC,aAAA,CAACP,QAAQ;EAAA,GAAMM;AAAS,CAAI,CAAC;AAEpC,eAAe,SAASE,6BAA6BA,CAAE;EACtDC,KAAK;EACLC,MAAM;EACNN,0BAA0B;EAC1B,GAAGO;AACJ,CAAC,EAAG;EACH,OACCJ,aAAA,CAACN,uBAAuB;IACvBW,EAAE,EAAKC,WAAW,IAAM;MACvB,OACCN,aAAA,CAACL,UAAU;QACVE,0BAA0B,EACzBA,0BACA;QACDC,gBAAgB,EAAI,GAAGI,KAAO,IAAIC,MAAQ,EAAG;QAC7CE,EAAE,EAAGT,eAAiB;QACtBW,IAAI,EAAI,GAAGL,KAAO,mBAAoB;QAAA,GACjCI;MAAW,CAChB,CAAC;IAEJ,CAAG;IACHE,IAAI,EAAC,kBAAkB;IACvBC,YAAY,EAAGjB,KAAO;IACtBe,IAAI,EAAGJ,MAAQ;IACfD,KAAK,EAAGA,KAAO;IAAA,GACVE;EAAK,CACV,CAAC;AAEJ"}
1
+ {"version":3,"names":["check","MenuItem","ComplementaryAreaToggle","ActionItem","PluginsMenuItem","__unstableExplicitMenuItem","__unstableTarget","restProps","createElement","ComplementaryAreaMoreMenuItem","scope","target","props","as","toggleProps","name","role","selectedIcon"],"sources":["@wordpress/interface/src/components/complementary-area-more-menu-item/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { check } from '@wordpress/icons';\nimport { MenuItem } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport ActionItem from '../action-item';\n\nconst PluginsMenuItem = ( {\n\t// Menu item is marked with unstable prop for backward compatibility.\n\t// They are removed so they don't leak to DOM elements.\n\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t__unstableExplicitMenuItem,\n\t__unstableTarget,\n\t...restProps\n} ) => <MenuItem { ...restProps } />;\n\nexport default function ComplementaryAreaMoreMenuItem( {\n\tscope,\n\ttarget,\n\t__unstableExplicitMenuItem,\n\t...props\n} ) {\n\treturn (\n\t\t<ComplementaryAreaToggle\n\t\t\tas={ ( toggleProps ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ActionItem\n\t\t\t\t\t\t__unstableExplicitMenuItem={\n\t\t\t\t\t\t\t__unstableExplicitMenuItem\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableTarget={ `${ scope }/${ target }` }\n\t\t\t\t\t\tas={ PluginsMenuItem }\n\t\t\t\t\t\tname={ `${ scope }/plugin-more-menu` }\n\t\t\t\t\t\t{ ...toggleProps }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tselectedIcon={ check }\n\t\t\tname={ target }\n\t\t\tscope={ scope }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,kBAAkB;AACxC,SAASC,QAAQ,QAAQ,uBAAuB;;AAEhD;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,UAAU,MAAM,gBAAgB;AAEvC,MAAMC,eAAe,GAAGA,CAAE;EACzB;EACA;EACA;EACAC,0BAA0B;EAC1BC,gBAAgB;EAChB,GAAGC;AACJ,CAAC,KAAMC,aAAA,CAACP,QAAQ;EAAA,GAAMM;AAAS,CAAI,CAAC;AAEpC,eAAe,SAASE,6BAA6BA,CAAE;EACtDC,KAAK;EACLC,MAAM;EACNN,0BAA0B;EAC1B,GAAGO;AACJ,CAAC,EAAG;EACH,OACCJ,aAAA,CAACN,uBAAuB;IACvBW,EAAE,EAAKC,WAAW,IAAM;MACvB,OACCN,aAAA,CAACL,UAAU;QACVE,0BAA0B,EACzBA,0BACA;QACDC,gBAAgB,EAAI,GAAGI,KAAO,IAAIC,MAAQ,EAAG;QAC7CE,EAAE,EAAGT,eAAiB;QACtBW,IAAI,EAAI,GAAGL,KAAO,mBAAoB;QAAA,GACjCI;MAAW,CAChB,CAAC;IAEJ,CAAG;IACHE,IAAI,EAAC,kBAAkB;IACvBC,YAAY,EAAGjB,KAAO;IACtBe,IAAI,EAAGJ,MAAQ;IACfD,KAAK,EAAGA,KAAO;IAAA,GACVE;EAAK,CACV,CAAC;AAEJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["Button","useDispatch","useSelect","store","interfaceStore","complementaryAreaContext","ComplementaryAreaToggle","as","scope","identifier","icon","selectedIcon","name","props","ComponentToUse","isSelected","select","getActiveComplementaryArea","enableComplementaryArea","disableComplementaryArea","createElement","replace","onClick"],"sources":["@wordpress/interface/src/components/complementary-area-toggle/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as interfaceStore } from '../../store';\nimport complementaryAreaContext from '../complementary-area-context';\n\nfunction ComplementaryAreaToggle( {\n\tas = Button,\n\tscope,\n\tidentifier,\n\ticon,\n\tselectedIcon,\n\tname,\n\t...props\n} ) {\n\tconst ComponentToUse = as;\n\tconst isSelected = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( scope ) ===\n\t\t\tidentifier,\n\t\t[ identifier, scope ]\n\t);\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\treturn (\n\t\t<ComponentToUse\n\t\t\ticon={ selectedIcon && isSelected ? selectedIcon : icon }\n\t\t\taria-controls={ identifier.replace( '/', ':' ) }\n\t\t\tonClick={ () => {\n\t\t\t\tif ( isSelected ) {\n\t\t\t\t\tdisableComplementaryArea( scope );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( scope, identifier );\n\t\t\t\t}\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default complementaryAreaContext( ComplementaryAreaToggle );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,cAAc,QAAQ,aAAa;AACrD,OAAOC,wBAAwB,MAAM,+BAA+B;AAEpE,SAASC,uBAAuBA,CAAE;EACjCC,EAAE,GAAGP,MAAM;EACXQ,KAAK;EACLC,UAAU;EACVC,IAAI;EACJC,YAAY;EACZC,IAAI;EACJ,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,cAAc,GAAGP,EAAE;EACzB,MAAMQ,UAAU,GAAGb,SAAS,CACzBc,MAAM,IACPA,MAAM,CAAEZ,cAAe,CAAC,CAACa,0BAA0B,CAAET,KAAM,CAAC,KAC5DC,UAAU,EACX,CAAEA,UAAU,EAAED,KAAK,CACpB,CAAC;EACD,MAAM;IAAEU,uBAAuB;IAAEC;EAAyB,CAAC,GAC1DlB,WAAW,CAAEG,cAAe,CAAC;EAC9B,OACCgB,aAAA,CAACN,cAAc;IACdJ,IAAI,EAAGC,YAAY,IAAII,UAAU,GAAGJ,YAAY,GAAGD,IAAM;IACzD,iBAAgBD,UAAU,CAACY,OAAO,CAAE,GAAG,EAAE,GAAI,CAAG;IAChDC,OAAO,EAAGA,CAAA,KAAM;MACf,IAAKP,UAAU,EAAG;QACjBI,wBAAwB,CAAEX,KAAM,CAAC;MAClC,CAAC,MAAM;QACNU,uBAAuB,CAAEV,KAAK,EAAEC,UAAW,CAAC;MAC7C;IACD,CAAG;IAAA,GACEI;EAAK,CACV,CAAC;AAEJ;AAEA,eAAeR,wBAAwB,CAAEC,uBAAwB,CAAC"}
1
+ {"version":3,"names":["Button","useDispatch","useSelect","store","interfaceStore","complementaryAreaContext","ComplementaryAreaToggle","as","scope","identifier","icon","selectedIcon","name","props","ComponentToUse","isSelected","select","getActiveComplementaryArea","enableComplementaryArea","disableComplementaryArea","createElement","replace","onClick"],"sources":["@wordpress/interface/src/components/complementary-area-toggle/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as interfaceStore } from '../../store';\nimport complementaryAreaContext from '../complementary-area-context';\n\nfunction ComplementaryAreaToggle( {\n\tas = Button,\n\tscope,\n\tidentifier,\n\ticon,\n\tselectedIcon,\n\tname,\n\t...props\n} ) {\n\tconst ComponentToUse = as;\n\tconst isSelected = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( scope ) ===\n\t\t\tidentifier,\n\t\t[ identifier, scope ]\n\t);\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\treturn (\n\t\t<ComponentToUse\n\t\t\ticon={ selectedIcon && isSelected ? selectedIcon : icon }\n\t\t\taria-controls={ identifier.replace( '/', ':' ) }\n\t\t\tonClick={ () => {\n\t\t\t\tif ( isSelected ) {\n\t\t\t\t\tdisableComplementaryArea( scope );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( scope, identifier );\n\t\t\t\t}\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nexport default complementaryAreaContext( ComplementaryAreaToggle );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;;AAExD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,cAAc,QAAQ,aAAa;AACrD,OAAOC,wBAAwB,MAAM,+BAA+B;AAEpE,SAASC,uBAAuBA,CAAE;EACjCC,EAAE,GAAGP,MAAM;EACXQ,KAAK;EACLC,UAAU;EACVC,IAAI;EACJC,YAAY;EACZC,IAAI;EACJ,GAAGC;AACJ,CAAC,EAAG;EACH,MAAMC,cAAc,GAAGP,EAAE;EACzB,MAAMQ,UAAU,GAAGb,SAAS,CACzBc,MAAM,IACPA,MAAM,CAAEZ,cAAe,CAAC,CAACa,0BAA0B,CAAET,KAAM,CAAC,KAC5DC,UAAU,EACX,CAAEA,UAAU,EAAED,KAAK,CACpB,CAAC;EACD,MAAM;IAAEU,uBAAuB;IAAEC;EAAyB,CAAC,GAC1DlB,WAAW,CAAEG,cAAe,CAAC;EAC9B,OACCgB,aAAA,CAACN,cAAc;IACdJ,IAAI,EAAGC,YAAY,IAAII,UAAU,GAAGJ,YAAY,GAAGD,IAAM;IACzD,iBAAgBD,UAAU,CAACY,OAAO,CAAE,GAAG,EAAE,GAAI,CAAG;IAChDC,OAAO,EAAGA,CAAA,KAAM;MACf,IAAKP,UAAU,EAAG;QACjBI,wBAAwB,CAAEX,KAAM,CAAC;MAClC,CAAC,MAAM;QACNU,uBAAuB,CAAEV,KAAK,EAAEC,UAAW,CAAC;MAC7C;IACD,CAAG;IAAA,GACEI;EAAK,CACV,CAAC;AAEJ;AAEA,eAAeR,wBAAwB,CAAEC,uBAAwB,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","FullscreenMode","isActive","isSticky","document","body","classList","contains","remove","add"],"sources":["@wordpress/interface/src/components/fullscreen-mode/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\n\nconst FullscreenMode = ( { isActive } ) => {\n\tuseEffect( () => {\n\t\tlet isSticky = false;\n\t\t// `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes\n\t\t// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled\n\t\t// even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as\n\t\t// a consequence of the FullscreenMode setup.\n\t\tif ( document.body.classList.contains( 'sticky-menu' ) ) {\n\t\t\tisSticky = true;\n\t\t\tdocument.body.classList.remove( 'sticky-menu' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isSticky ) {\n\t\t\t\tdocument.body.classList.add( 'sticky-menu' );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isActive ) {\n\t\t\tdocument.body.classList.add( 'is-fullscreen-mode' );\n\t\t} else {\n\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isActive ) {\n\t\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t\t}\n\t\t};\n\t}, [ isActive ] );\n\n\treturn null;\n};\nexport default FullscreenMode;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAE9C,MAAMC,cAAc,GAAGA,CAAE;EAAEC;AAAS,CAAC,KAAM;EAC1CF,SAAS,CAAE,MAAM;IAChB,IAAIG,QAAQ,GAAG,KAAK;IACpB;IACA;IACA;IACA;IACA,IAAKC,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACC,QAAQ,CAAE,aAAc,CAAC,EAAG;MACxDJ,QAAQ,GAAG,IAAI;MACfC,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAE,aAAc,CAAC;IAChD;IAEA,OAAO,MAAM;MACZ,IAAKL,QAAQ,EAAG;QACfC,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACG,GAAG,CAAE,aAAc,CAAC;MAC7C;IACD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEPT,SAAS,CAAE,MAAM;IAChB,IAAKE,QAAQ,EAAG;MACfE,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACG,GAAG,CAAE,oBAAqB,CAAC;IACpD,CAAC,MAAM;MACNL,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAE,oBAAqB,CAAC;IACvD;IAEA,OAAO,MAAM;MACZ,IAAKN,QAAQ,EAAG;QACfE,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAE,oBAAqB,CAAC;MACvD;IACD,CAAC;EACF,CAAC,EAAE,CAAEN,QAAQ,CAAG,CAAC;EAEjB,OAAO,IAAI;AACZ,CAAC;AACD,eAAeD,cAAc"}
1
+ {"version":3,"names":["useEffect","FullscreenMode","isActive","isSticky","document","body","classList","contains","remove","add"],"sources":["@wordpress/interface/src/components/fullscreen-mode/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\n\nconst FullscreenMode = ( { isActive } ) => {\n\tuseEffect( () => {\n\t\tlet isSticky = false;\n\t\t// `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes\n\t\t// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled\n\t\t// even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as\n\t\t// a consequence of the FullscreenMode setup.\n\t\tif ( document.body.classList.contains( 'sticky-menu' ) ) {\n\t\t\tisSticky = true;\n\t\t\tdocument.body.classList.remove( 'sticky-menu' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isSticky ) {\n\t\t\t\tdocument.body.classList.add( 'sticky-menu' );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isActive ) {\n\t\t\tdocument.body.classList.add( 'is-fullscreen-mode' );\n\t\t} else {\n\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isActive ) {\n\t\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t\t}\n\t\t};\n\t}, [ isActive ] );\n\n\treturn null;\n};\nexport default FullscreenMode;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAE9C,MAAMC,cAAc,GAAGA,CAAE;EAAEC;AAAS,CAAC,KAAM;EAC1CF,SAAS,CAAE,MAAM;IAChB,IAAIG,QAAQ,GAAG,KAAK;IACpB;IACA;IACA;IACA;IACA,IAAKC,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACC,QAAQ,CAAE,aAAc,CAAC,EAAG;MACxDJ,QAAQ,GAAG,IAAI;MACfC,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAE,aAAc,CAAC;IAChD;IAEA,OAAO,MAAM;MACZ,IAAKL,QAAQ,EAAG;QACfC,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACG,GAAG,CAAE,aAAc,CAAC;MAC7C;IACD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEPT,SAAS,CAAE,MAAM;IAChB,IAAKE,QAAQ,EAAG;MACfE,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACG,GAAG,CAAE,oBAAqB,CAAC;IACpD,CAAC,MAAM;MACNL,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAE,oBAAqB,CAAC;IACvD;IAEA,OAAO,MAAM;MACZ,IAAKN,QAAQ,EAAG;QACfE,QAAQ,CAACC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAE,oBAAqB,CAAC;MACvD;IACD,CAAC;EACF,CAAC,EAAE,CAAEN,QAAQ,CAAG,CAAC;EAEjB,OAAO,IAAI;AACZ,CAAC;AACD,eAAeD,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["default","ComplementaryArea","ComplementaryAreaMoreMenuItem","FullscreenMode","InterfaceSkeleton","PinnedItems","ActionItem","NavigableRegion"],"sources":["@wordpress/interface/src/components/index.js"],"sourcesContent":["export { default as ComplementaryArea } from './complementary-area';\nexport { default as ComplementaryAreaMoreMenuItem } from './complementary-area-more-menu-item';\nexport { default as FullscreenMode } from './fullscreen-mode';\nexport { default as InterfaceSkeleton } from './interface-skeleton';\nexport { default as PinnedItems } from './pinned-items';\nexport { default as ActionItem } from './action-item';\nexport { default as NavigableRegion } from './navigable-region';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,iBAAiB,QAAQ,sBAAsB;AACnE,SAASD,OAAO,IAAIE,6BAA6B,QAAQ,qCAAqC;AAC9F,SAASF,OAAO,IAAIG,cAAc,QAAQ,mBAAmB;AAC7D,SAASH,OAAO,IAAII,iBAAiB,QAAQ,sBAAsB;AACnE,SAASJ,OAAO,IAAIK,WAAW,QAAQ,gBAAgB;AACvD,SAASL,OAAO,IAAIM,UAAU,QAAQ,eAAe;AACrD,SAASN,OAAO,IAAIO,eAAe,QAAQ,oBAAoB"}
1
+ {"version":3,"names":["default","ComplementaryArea","ComplementaryAreaMoreMenuItem","FullscreenMode","InterfaceSkeleton","PinnedItems","ActionItem","NavigableRegion"],"sources":["@wordpress/interface/src/components/index.js"],"sourcesContent":["export { default as ComplementaryArea } from './complementary-area';\nexport { default as ComplementaryAreaMoreMenuItem } from './complementary-area-more-menu-item';\nexport { default as FullscreenMode } from './fullscreen-mode';\nexport { default as InterfaceSkeleton } from './interface-skeleton';\nexport { default as PinnedItems } from './pinned-items';\nexport { default as ActionItem } from './action-item';\nexport { default as NavigableRegion } from './navigable-region';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,iBAAiB,QAAQ,sBAAsB;AACnE,SAASD,OAAO,IAAIE,6BAA6B,QAAQ,qCAAqC;AAC9F,SAASF,OAAO,IAAIG,cAAc,QAAQ,mBAAmB;AAC7D,SAASH,OAAO,IAAII,iBAAiB,QAAQ,sBAAsB;AACnE,SAASJ,OAAO,IAAIK,WAAW,QAAQ,gBAAgB;AACvD,SAASL,OAAO,IAAIM,UAAU,QAAQ,eAAe;AACrD,SAASN,OAAO,IAAIO,eAAe,QAAQ,oBAAoB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["default","ComplementaryArea","PinnedItems"],"sources":["@wordpress/interface/src/components/index.native.js"],"sourcesContent":["export { default as ComplementaryArea } from './complementary-area';\nexport { default as PinnedItems } from './pinned-items';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,iBAAiB,QAAQ,sBAAsB;AACnE,SAASD,OAAO,IAAIE,WAAW,QAAQ,gBAAgB"}
1
+ {"version":3,"names":["default","ComplementaryArea","PinnedItems"],"sources":["@wordpress/interface/src/components/index.native.js"],"sourcesContent":["export { default as ComplementaryArea } from './complementary-area';\nexport { default as PinnedItems } from './pinned-items';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,iBAAiB,QAAQ,sBAAsB;AACnE,SAASD,OAAO,IAAIE,WAAW,QAAQ,gBAAgB","ignoreList":[]}