@wordpress/preferences-persistence 2.17.0 → 2.19.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 (18) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/migrations/legacy-local-storage-data/convert-edit-post-panels.js +0 -1
  3. package/build/migrations/legacy-local-storage-data/convert-edit-post-panels.js.map +1 -1
  4. package/build/migrations/legacy-local-storage-data/move-interface-enable-items.js +0 -1
  5. package/build/migrations/legacy-local-storage-data/move-interface-enable-items.js.map +1 -1
  6. package/build/migrations/legacy-local-storage-data/move-third-party-feature-preferences.js +0 -1
  7. package/build/migrations/legacy-local-storage-data/move-third-party-feature-preferences.js.map +1 -1
  8. package/build/migrations/preferences-package-data/convert-complementary-areas.js +0 -1
  9. package/build/migrations/preferences-package-data/convert-complementary-areas.js.map +1 -1
  10. package/build-module/migrations/legacy-local-storage-data/convert-edit-post-panels.js +0 -1
  11. package/build-module/migrations/legacy-local-storage-data/convert-edit-post-panels.js.map +1 -1
  12. package/build-module/migrations/legacy-local-storage-data/move-interface-enable-items.js +0 -1
  13. package/build-module/migrations/legacy-local-storage-data/move-interface-enable-items.js.map +1 -1
  14. package/build-module/migrations/legacy-local-storage-data/move-third-party-feature-preferences.js +0 -1
  15. package/build-module/migrations/legacy-local-storage-data/move-third-party-feature-preferences.js.map +1 -1
  16. package/build-module/migrations/preferences-package-data/convert-complementary-areas.js +0 -1
  17. package/build-module/migrations/preferences-package-data/convert-complementary-areas.js.map +1 -1
  18. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.19.0 (2025-02-28)
6
+
7
+ ## 2.18.0 (2025-02-12)
8
+
5
9
  ## 2.17.0 (2025-01-29)
6
10
 
7
11
  ## 2.16.0 (2025-01-15)
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["convertEditPostPanels","preferences","_preferences$panels","panels","Object","keys","reduce","convertedData","panelName","panel","enabled","inactivePanels","push","opened","openPanels"],"sources":["@wordpress/preferences-persistence/src/migrations/legacy-local-storage-data/convert-edit-post-panels.js"],"sourcesContent":["/**\n * Convert the post editor's panels state from:\n * ```\n * {\n * panels: {\n * tags: {\n * enabled: true,\n * opened: true,\n * },\n * permalinks: {\n * enabled: false,\n * opened: false,\n * },\n * },\n * }\n * ```\n *\n * to a new, more concise data structure:\n * {\n * inactivePanels: [\n * 'permalinks',\n * ],\n * openPanels: [\n * 'tags',\n * ],\n * }\n *\n * @param {Object} preferences A preferences object.\n *\n * @return {Object} The converted data.\n */\nexport default function convertEditPostPanels( preferences ) {\n\tconst panels = preferences?.panels ?? {};\n\treturn Object.keys( panels ).reduce(\n\t\t( convertedData, panelName ) => {\n\t\t\tconst panel = panels[ panelName ];\n\n\t\t\tif ( panel?.enabled === false ) {\n\t\t\t\tconvertedData.inactivePanels.push( panelName );\n\t\t\t}\n\n\t\t\tif ( panel?.opened === true ) {\n\t\t\t\tconvertedData.openPanels.push( panelName );\n\t\t\t}\n\n\t\t\treturn convertedData;\n\t\t},\n\t\t{ inactivePanels: [], openPanels: [] }\n\t);\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAqBA,CAAEC,WAAW,EAAG;EAAA,IAAAC,mBAAA;EAC5D,MAAMC,MAAM,IAAAD,mBAAA,GAAGD,WAAW,EAAEE,MAAM,cAAAD,mBAAA,cAAAA,mBAAA,GAAI,CAAC,CAAC;EACxC,OAAOE,MAAM,CAACC,IAAI,CAAEF,MAAO,CAAC,CAACG,MAAM,CAClC,CAAEC,aAAa,EAAEC,SAAS,KAAM;IAC/B,MAAMC,KAAK,GAAGN,MAAM,CAAEK,SAAS,CAAE;IAEjC,IAAKC,KAAK,EAAEC,OAAO,KAAK,KAAK,EAAG;MAC/BH,aAAa,CAACI,cAAc,CAACC,IAAI,CAAEJ,SAAU,CAAC;IAC/C;IAEA,IAAKC,KAAK,EAAEI,MAAM,KAAK,IAAI,EAAG;MAC7BN,aAAa,CAACO,UAAU,CAACF,IAAI,CAAEJ,SAAU,CAAC;IAC3C;IAEA,OAAOD,aAAa;EACrB,CAAC,EACD;IAAEI,cAAc,EAAE,EAAE;IAAEG,UAAU,EAAE;EAAG,CACtC,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["convertEditPostPanels","preferences","_preferences$panels","panels","Object","keys","reduce","convertedData","panelName","panel","enabled","inactivePanels","push","opened","openPanels"],"sources":["@wordpress/preferences-persistence/src/migrations/legacy-local-storage-data/convert-edit-post-panels.js"],"sourcesContent":["/**\n * Convert the post editor's panels state from:\n * ```\n * {\n * panels: {\n * tags: {\n * enabled: true,\n * opened: true,\n * },\n * permalinks: {\n * enabled: false,\n * opened: false,\n * },\n * },\n * }\n * ```\n *\n * to a new, more concise data structure:\n * {\n * inactivePanels: [\n * 'permalinks',\n * ],\n * openPanels: [\n * 'tags',\n * ],\n * }\n *\n * @param {Object} preferences A preferences object.\n *\n * @return {Object} The converted data.\n */\nexport default function convertEditPostPanels( preferences ) {\n\tconst panels = preferences?.panels ?? {};\n\treturn Object.keys( panels ).reduce(\n\t\t( convertedData, panelName ) => {\n\t\t\tconst panel = panels[ panelName ];\n\n\t\t\tif ( panel?.enabled === false ) {\n\t\t\t\tconvertedData.inactivePanels.push( panelName );\n\t\t\t}\n\n\t\t\tif ( panel?.opened === true ) {\n\t\t\t\tconvertedData.openPanels.push( panelName );\n\t\t\t}\n\n\t\t\treturn convertedData;\n\t\t},\n\t\t{ inactivePanels: [], openPanels: [] }\n\t);\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,qBAAqBA,CAAEC,WAAW,EAAG;EAAA,IAAAC,mBAAA;EAC5D,MAAMC,MAAM,IAAAD,mBAAA,GAAGD,WAAW,EAAEE,MAAM,cAAAD,mBAAA,cAAAA,mBAAA,GAAI,CAAC,CAAC;EACxC,OAAOE,MAAM,CAACC,IAAI,CAAEF,MAAO,CAAC,CAACG,MAAM,CAClC,CAAEC,aAAa,EAAEC,SAAS,KAAM;IAC/B,MAAMC,KAAK,GAAGN,MAAM,CAAEK,SAAS,CAAE;IAEjC,IAAKC,KAAK,EAAEC,OAAO,KAAK,KAAK,EAAG;MAC/BH,aAAa,CAACI,cAAc,CAACC,IAAI,CAAEJ,SAAU,CAAC;IAC/C;IAEA,IAAKC,KAAK,EAAEI,MAAM,KAAK,IAAI,EAAG;MAC7BN,aAAa,CAACO,UAAU,CAACF,IAAI,CAAEJ,SAAU,CAAC;IAC3C;IAEA,OAAOD,aAAa;EACrB,CAAC,EACD;IAAEI,cAAc,EAAE,EAAE;IAAEG,UAAU,EAAE;EAAG,CACtC,CAAC;AACF","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["moveInterfaceEnableItems","state","_state$preferencesSto","_sourceEnableItems$si","_sourceEnableItems$mu","interfaceStoreName","preferencesStoreName","sourceEnableItems","enableItems","allPreferences","preferences","sourceComplementaryAreas","singleEnableItems","complementaryArea","preferencesWithConvertedComplementaryAreas","Object","keys","reduce","accumulator","scope","data","sourcePinnedItems","multipleEnableItems","pinnedItems","allConvertedData","otherInterfaceItems","undefined"],"sources":["@wordpress/preferences-persistence/src/migrations/legacy-local-storage-data/move-interface-enable-items.js"],"sourcesContent":["/**\n * Migrates interface 'enableItems' data to the preferences store.\n *\n * The interface package stores this data in this format:\n * ```js\n * {\n * enableItems: {\n * singleEnableItems: {\n * \t complementaryArea: {\n * 'core/edit-post': 'edit-post/document',\n * 'core/edit-site': 'edit-site/global-styles',\n * }\n * },\n * multipleEnableItems: {\n * pinnedItems: {\n * 'core/edit-post': {\n * 'plugin-1': true,\n * },\n * 'core/edit-site': {\n * 'plugin-2': true,\n * },\n * },\n * }\n * }\n * }\n * ```\n *\n * and it should be converted it to:\n * ```js\n * {\n * 'core/edit-post': {\n * complementaryArea: 'edit-post/document',\n * pinnedItems: {\n * 'plugin-1': true,\n * },\n * },\n * 'core/edit-site': {\n * complementaryArea: 'edit-site/global-styles',\n * pinnedItems: {\n * 'plugin-2': true,\n * },\n * },\n * }\n * ```\n *\n * @param {Object} state The local storage state.\n */\nexport default function moveInterfaceEnableItems( state ) {\n\tconst interfaceStoreName = 'core/interface';\n\tconst preferencesStoreName = 'core/preferences';\n\tconst sourceEnableItems = state?.[ interfaceStoreName ]?.enableItems;\n\n\t// There's nothing to migrate, exit early.\n\tif ( ! sourceEnableItems ) {\n\t\treturn state;\n\t}\n\n\tconst allPreferences = state?.[ preferencesStoreName ]?.preferences ?? {};\n\n\t// First convert complementaryAreas into the right format.\n\t// Use the existing preferences as the accumulator so that the data is\n\t// merged.\n\tconst sourceComplementaryAreas =\n\t\tsourceEnableItems?.singleEnableItems?.complementaryArea ?? {};\n\n\tconst preferencesWithConvertedComplementaryAreas = Object.keys(\n\t\tsourceComplementaryAreas\n\t).reduce( ( accumulator, scope ) => {\n\t\tconst data = sourceComplementaryAreas[ scope ];\n\n\t\t// Don't overwrite any existing data in the preferences store.\n\t\tif ( accumulator?.[ scope ]?.complementaryArea ) {\n\t\t\treturn accumulator;\n\t\t}\n\n\t\treturn {\n\t\t\t...accumulator,\n\t\t\t[ scope ]: {\n\t\t\t\t...accumulator[ scope ],\n\t\t\t\tcomplementaryArea: data,\n\t\t\t},\n\t\t};\n\t}, allPreferences );\n\n\t// Next feed the converted complementary areas back into a reducer that\n\t// converts the pinned items, resulting in the fully migrated data.\n\tconst sourcePinnedItems =\n\t\tsourceEnableItems?.multipleEnableItems?.pinnedItems ?? {};\n\tconst allConvertedData = Object.keys( sourcePinnedItems ).reduce(\n\t\t( accumulator, scope ) => {\n\t\t\tconst data = sourcePinnedItems[ scope ];\n\t\t\t// Don't overwrite any existing data in the preferences store.\n\t\t\tif ( accumulator?.[ scope ]?.pinnedItems ) {\n\t\t\t\treturn accumulator;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...accumulator,\n\t\t\t\t[ scope ]: {\n\t\t\t\t\t...accumulator[ scope ],\n\t\t\t\t\tpinnedItems: data,\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\tpreferencesWithConvertedComplementaryAreas\n\t);\n\n\tconst otherInterfaceItems = state[ interfaceStoreName ];\n\n\treturn {\n\t\t...state,\n\t\t[ preferencesStoreName ]: {\n\t\t\tpreferences: allConvertedData,\n\t\t},\n\t\t[ interfaceStoreName ]: {\n\t\t\t...otherInterfaceItems,\n\t\t\tenableItems: undefined,\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,wBAAwBA,CAAEC,KAAK,EAAG;EAAA,IAAAC,qBAAA,EAAAC,qBAAA,EAAAC,qBAAA;EACzD,MAAMC,kBAAkB,GAAG,gBAAgB;EAC3C,MAAMC,oBAAoB,GAAG,kBAAkB;EAC/C,MAAMC,iBAAiB,GAAGN,KAAK,GAAII,kBAAkB,CAAE,EAAEG,WAAW;;EAEpE;EACA,IAAK,CAAED,iBAAiB,EAAG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QACvBI,WAAW,EAAEH;MACd;IACD,CAAC;EACF,CAAC,EACDN,0CACD,CAAC;EAED,MAAMW,mBAAmB,GAAGxB,KAAK,CAAEI,kBAAkB,CAAE;EAEvD,OAAO;IACN,GAAGJ,KAAK;IACR,CAAEK,oBAAoB,GAAI;MACzBI,WAAW,EAAEc;IACd,CAAC;IACD,CAAEnB,kBAAkB,GAAI;MACvB,GAAGoB,mBAAmB;MACtBjB,WAAW,EAAEkB;IACd;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["moveInterfaceEnableItems","state","_state$preferencesSto","_sourceEnableItems$si","_sourceEnableItems$mu","interfaceStoreName","preferencesStoreName","sourceEnableItems","enableItems","allPreferences","preferences","sourceComplementaryAreas","singleEnableItems","complementaryArea","preferencesWithConvertedComplementaryAreas","Object","keys","reduce","accumulator","scope","data","sourcePinnedItems","multipleEnableItems","pinnedItems","allConvertedData","otherInterfaceItems","undefined"],"sources":["@wordpress/preferences-persistence/src/migrations/legacy-local-storage-data/move-interface-enable-items.js"],"sourcesContent":["/**\n * Migrates interface 'enableItems' data to the preferences store.\n *\n * The interface package stores this data in this format:\n * ```js\n * {\n * enableItems: {\n * singleEnableItems: {\n * \t complementaryArea: {\n * 'core/edit-post': 'edit-post/document',\n * 'core/edit-site': 'edit-site/global-styles',\n * }\n * },\n * multipleEnableItems: {\n * pinnedItems: {\n * 'core/edit-post': {\n * 'plugin-1': true,\n * },\n * 'core/edit-site': {\n * 'plugin-2': true,\n * },\n * },\n * }\n * }\n * }\n * ```\n *\n * and it should be converted it to:\n * ```js\n * {\n * 'core/edit-post': {\n * complementaryArea: 'edit-post/document',\n * pinnedItems: {\n * 'plugin-1': true,\n * },\n * },\n * 'core/edit-site': {\n * complementaryArea: 'edit-site/global-styles',\n * pinnedItems: {\n * 'plugin-2': true,\n * },\n * },\n * }\n * ```\n *\n * @param {Object} state The local storage state.\n */\nexport default function moveInterfaceEnableItems( state ) {\n\tconst interfaceStoreName = 'core/interface';\n\tconst preferencesStoreName = 'core/preferences';\n\tconst sourceEnableItems = state?.[ interfaceStoreName ]?.enableItems;\n\n\t// There's nothing to migrate, exit early.\n\tif ( ! sourceEnableItems ) {\n\t\treturn state;\n\t}\n\n\tconst allPreferences = state?.[ preferencesStoreName ]?.preferences ?? {};\n\n\t// First convert complementaryAreas into the right format.\n\t// Use the existing preferences as the accumulator so that the data is\n\t// merged.\n\tconst sourceComplementaryAreas =\n\t\tsourceEnableItems?.singleEnableItems?.complementaryArea ?? {};\n\n\tconst preferencesWithConvertedComplementaryAreas = Object.keys(\n\t\tsourceComplementaryAreas\n\t).reduce( ( accumulator, scope ) => {\n\t\tconst data = sourceComplementaryAreas[ scope ];\n\n\t\t// Don't overwrite any existing data in the preferences store.\n\t\tif ( accumulator?.[ scope ]?.complementaryArea ) {\n\t\t\treturn accumulator;\n\t\t}\n\n\t\treturn {\n\t\t\t...accumulator,\n\t\t\t[ scope ]: {\n\t\t\t\t...accumulator[ scope ],\n\t\t\t\tcomplementaryArea: data,\n\t\t\t},\n\t\t};\n\t}, allPreferences );\n\n\t// Next feed the converted complementary areas back into a reducer that\n\t// converts the pinned items, resulting in the fully migrated data.\n\tconst sourcePinnedItems =\n\t\tsourceEnableItems?.multipleEnableItems?.pinnedItems ?? {};\n\tconst allConvertedData = Object.keys( sourcePinnedItems ).reduce(\n\t\t( accumulator, scope ) => {\n\t\t\tconst data = sourcePinnedItems[ scope ];\n\t\t\t// Don't overwrite any existing data in the preferences store.\n\t\t\tif ( accumulator?.[ scope ]?.pinnedItems ) {\n\t\t\t\treturn accumulator;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...accumulator,\n\t\t\t\t[ scope ]: {\n\t\t\t\t\t...accumulator[ scope ],\n\t\t\t\t\tpinnedItems: data,\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\tpreferencesWithConvertedComplementaryAreas\n\t);\n\n\tconst otherInterfaceItems = state[ interfaceStoreName ];\n\n\treturn {\n\t\t...state,\n\t\t[ preferencesStoreName ]: {\n\t\t\tpreferences: allConvertedData,\n\t\t},\n\t\t[ interfaceStoreName ]: {\n\t\t\t...otherInterfaceItems,\n\t\t\tenableItems: undefined,\n\t\t},\n\t};\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,wBAAwBA,CAAEC,KAAK,EAAG;EAAA,IAAAC,qBAAA,EAAAC,qBAAA,EAAAC,qBAAA;EACzD,MAAMC,kBAAkB,GAAG,gBAAgB;EAC3C,MAAMC,oBAAoB,GAAG,kBAAkB;EAC/C,MAAMC,iBAAiB,GAAGN,KAAK,GAAII,kBAAkB,CAAE,EAAEG,WAAW;;EAEpE;EACA,IAAK,CAAED,iBAAiB,EAAG;IAC1B,OAAON,KAAK;EACb;EAEA,MAAMQ,cAAc,IAAAP,qBAAA,GAAGD,KAAK,GAAIK,oBAAoB,CAAE,EAAEI,WAAW,cAAAR,qBAAA,cAAAA,qBAAA,GAAI,CAAC,CAAC;;EAEzE;EACA;EACA;EACA,MAAMS,wBAAwB,IAAAR,qBAAA,GAC7BI,iBAAiB,EAAEK,iBAAiB,EAAEC,iBAAiB,cAAAV,qBAAA,cAAAA,qBAAA,GAAI,CAAC,CAAC;EAE9D,MAAMW,0CAA0C,GAAGC,MAAM,CAACC,IAAI,CAC7DL,wBACD,CAAC,CAACM,MAAM,CAAE,CAAEC,WAAW,EAAEC,KAAK,KAAM;IACnC,MAAMC,IAAI,GAAGT,wBAAwB,CAAEQ,KAAK,CAAE;;IAE9C;IACA,IAAKD,WAAW,GAAIC,KAAK,CAAE,EAAEN,iBAAiB,EAAG;MAChD,OAAOK,WAAW;IACnB;IAEA,OAAO;MACN,GAAGA,WAAW;MACd,CAAEC,KAAK,GAAI;QACV,GAAGD,WAAW,CAAEC,KAAK,CAAE;QACvBN,iBAAiB,EAAEO;MACpB;IACD,CAAC;EACF,CAAC,EAAEX,cAAe,CAAC;;EAEnB;EACA;EACA,MAAMY,iBAAiB,IAAAjB,qBAAA,GACtBG,iBAAiB,EAAEe,mBAAmB,EAAEC,WAAW,cAAAnB,qBAAA,cAAAA,qBAAA,GAAI,CAAC,CAAC;EAC1D,MAAMoB,gBAAgB,GAAGT,MAAM,CAACC,IAAI,CAAEK,iBAAkB,CAAC,CAACJ,MAAM,CAC/D,CAAEC,WAAW,EAAEC,KAAK,KAAM;IACzB,MAAMC,IAAI,GAAGC,iBAAiB,CAAEF,KAAK,CAAE;IACvC;IACA,IAAKD,WAAW,GAAIC,KAAK,CAAE,EAAEI,WAAW,EAAG;MAC1C,OAAOL,WAAW;IACnB;IAEA,OAAO;MACN,GAAGA,WAAW;MACd,CAAEC,KAAK,GAAI;QACV,GAAGD,WAAW,CAAEC,KAAK,CAAE;QACvBI,WAAW,EAAEH;MACd;IACD,CAAC;EACF,CAAC,EACDN,0CACD,CAAC;EAED,MAAMW,mBAAmB,GAAGxB,KAAK,CAAEI,kBAAkB,CAAE;EAEvD,OAAO;IACN,GAAGJ,KAAK;IACR,CAAEK,oBAAoB,GAAI;MACzBI,WAAW,EAAEc;IACd,CAAC;IACD,CAAEnB,kBAAkB,GAAI;MACvB,GAAGoB,mBAAmB;MACtBjB,WAAW,EAAEkB;IACd;EACD,CAAC;AACF","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["moveThirdPartyFeaturePreferencesToPreferences","state","interfaceStoreName","preferencesStoreName","interfaceScopes","preferences","features","interfaceScopeKeys","Object","keys","length","reduce","convertedState","scope","startsWith","featuresToMigrate","existingMigratedData","otherPreferencesScopes","otherInterfaceState","otherInterfaceScopes","undefined"],"sources":["@wordpress/preferences-persistence/src/migrations/legacy-local-storage-data/move-third-party-feature-preferences.js"],"sourcesContent":["/**\n * The interface package previously had a public API that could be used by\n * plugins to set persisted boolean 'feature' preferences.\n *\n * While usage was likely non-existent or very small, this function ensures\n * those are migrated to the preferences data structure. The interface\n * package's APIs have now been deprecated and use the preferences store.\n *\n * This will convert data that looks like this:\n * ```js\n * {\n * 'core/interface': {\n * preferences: {\n * features: {\n * 'my-plugin': {\n * myPluginFeature: true\n * }\n * }\n * }\n * }\n * }\n * ```\n *\n * To this:\n * ```js\n * * {\n * 'core/preferences': {\n * preferences: {\n * 'my-plugin': {\n * myPluginFeature: true\n * }\n * }\n * }\n * }\n * ```\n *\n * @param {Object} state The local storage state\n *\n * @return {Object} The state with third party preferences moved to the\n * preferences data structure.\n */\nexport default function moveThirdPartyFeaturePreferencesToPreferences( state ) {\n\tconst interfaceStoreName = 'core/interface';\n\tconst preferencesStoreName = 'core/preferences';\n\n\tconst interfaceScopes =\n\t\tstate?.[ interfaceStoreName ]?.preferences?.features;\n\tconst interfaceScopeKeys = interfaceScopes\n\t\t? Object.keys( interfaceScopes )\n\t\t: [];\n\n\tif ( ! interfaceScopeKeys?.length ) {\n\t\treturn state;\n\t}\n\n\treturn interfaceScopeKeys.reduce( function ( convertedState, scope ) {\n\t\tif ( scope.startsWith( 'core' ) ) {\n\t\t\treturn convertedState;\n\t\t}\n\n\t\tconst featuresToMigrate = interfaceScopes?.[ scope ];\n\t\tif ( ! featuresToMigrate ) {\n\t\t\treturn convertedState;\n\t\t}\n\n\t\tconst existingMigratedData =\n\t\t\tconvertedState?.[ preferencesStoreName ]?.preferences?.[ scope ];\n\n\t\tif ( existingMigratedData ) {\n\t\t\treturn convertedState;\n\t\t}\n\n\t\tconst otherPreferencesScopes =\n\t\t\tconvertedState?.[ preferencesStoreName ]?.preferences;\n\t\tconst otherInterfaceState = convertedState?.[ interfaceStoreName ];\n\t\tconst otherInterfaceScopes =\n\t\t\tconvertedState?.[ interfaceStoreName ]?.preferences?.features;\n\n\t\treturn {\n\t\t\t...convertedState,\n\t\t\t[ preferencesStoreName ]: {\n\t\t\t\tpreferences: {\n\t\t\t\t\t...otherPreferencesScopes,\n\t\t\t\t\t[ scope ]: featuresToMigrate,\n\t\t\t\t},\n\t\t\t},\n\t\t\t[ interfaceStoreName ]: {\n\t\t\t\t...otherInterfaceState,\n\t\t\t\tpreferences: {\n\t\t\t\t\tfeatures: {\n\t\t\t\t\t\t...otherInterfaceScopes,\n\t\t\t\t\t\t[ scope ]: undefined,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}, state );\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,6CAA6CA,CAAEC,KAAK,EAAG;EAC9E,MAAMC,kBAAkB,GAAG,gBAAgB;EAC3C,MAAMC,oBAAoB,GAAG,kBAAkB;EAE/C,MAAMC,eAAe,GACpBH,KAAK,GAAIC,kBAAkB,CAAE,EAAEG,WAAW,EAAEC,QAAQ;EACrD,MAAMC,kBAAkB,GAAGH,eAAe,GACvCI,MAAM,CAACC,IAAI,CAAEL,eAAgB,CAAC,GAC9B,EAAE;EAEL,IAAK,CAAEG,kBAAkB,EAAEG,MAAM,EAAG;IACnC,OAAOT,KAAK;EACb;EAEA,OAAOM,kBAAkB,CAACI,MAAM,CAAE,UAAWC,cAAc,EAAEC,KAAK,EAAG;IACpE,IAAKA,KAAK,CAACC,UAAU,CAAE,MAAO,CAAC,EAAG;MACjC,OAAOF,cAAc;IACtB;IAEA,MAAMG,iBAAiB,GAAGX,eAAe,GAAIS,KAAK,CAAE;IACpD,IAAK,CAAEE,iBAAiB,EAAG;MAC1B,OAAOH,cAAc;IACtB;IAEA,MAAMI,oBAAoB,GACzBJ,cAAc,GAAIT,oBAAoB,CAAE,EAAEE,WAAW,GAAIQ,KAAK,CAAE;IAEjE,IAAKG,oBAAoB,EAAG;MAC3B,OAAOJ,cAAc;IACtB;IAEA,MAAMK,sBAAsB,GAC3BL,cAAc,GAAIT,oBAAoB,CAAE,EAAEE,WAAW;IACtD,MAAMa,mBAAmB,GAAGN,cAAc,GAAIV,kBAAkB,CAAE;IAClE,MAAMiB,oBAAoB,GACzBP,cAAc,GAAIV,kBAAkB,CAAE,EAAEG,WAAW,EAAEC,QAAQ;IAE9D,OAAO;MACN,GAAGM,cAAc;MACjB,CAAET,oBAAoB,GAAI;QACzBE,WAAW,EAAE;UACZ,GAAGY,sBAAsB;UACzB,CAAEJ,KAAK,GAAIE;QACZ;MACD,CAAC;MACD,CAAEb,kBAAkB,GAAI;QACvB,GAAGgB,mBAAmB;QACtBb,WAAW,EAAE;UACZC,QAAQ,EAAE;YACT,GAAGa,oBAAoB;YACvB,CAAEN,KAAK,GAAIO;UACZ;QACD;MACD;IACD,CAAC;EACF,CAAC,EAAEnB,KAAM,CAAC;AACX","ignoreList":[]}
1
+ {"version":3,"names":["moveThirdPartyFeaturePreferencesToPreferences","state","interfaceStoreName","preferencesStoreName","interfaceScopes","preferences","features","interfaceScopeKeys","Object","keys","length","reduce","convertedState","scope","startsWith","featuresToMigrate","existingMigratedData","otherPreferencesScopes","otherInterfaceState","otherInterfaceScopes","undefined"],"sources":["@wordpress/preferences-persistence/src/migrations/legacy-local-storage-data/move-third-party-feature-preferences.js"],"sourcesContent":["/**\n * The interface package previously had a public API that could be used by\n * plugins to set persisted boolean 'feature' preferences.\n *\n * While usage was likely non-existent or very small, this function ensures\n * those are migrated to the preferences data structure. The interface\n * package's APIs have now been deprecated and use the preferences store.\n *\n * This will convert data that looks like this:\n * ```js\n * {\n * 'core/interface': {\n * preferences: {\n * features: {\n * 'my-plugin': {\n * myPluginFeature: true\n * }\n * }\n * }\n * }\n * }\n * ```\n *\n * To this:\n * ```js\n * * {\n * 'core/preferences': {\n * preferences: {\n * 'my-plugin': {\n * myPluginFeature: true\n * }\n * }\n * }\n * }\n * ```\n *\n * @param {Object} state The local storage state\n *\n * @return {Object} The state with third party preferences moved to the\n * preferences data structure.\n */\nexport default function moveThirdPartyFeaturePreferencesToPreferences( state ) {\n\tconst interfaceStoreName = 'core/interface';\n\tconst preferencesStoreName = 'core/preferences';\n\n\tconst interfaceScopes =\n\t\tstate?.[ interfaceStoreName ]?.preferences?.features;\n\tconst interfaceScopeKeys = interfaceScopes\n\t\t? Object.keys( interfaceScopes )\n\t\t: [];\n\n\tif ( ! interfaceScopeKeys?.length ) {\n\t\treturn state;\n\t}\n\n\treturn interfaceScopeKeys.reduce( function ( convertedState, scope ) {\n\t\tif ( scope.startsWith( 'core' ) ) {\n\t\t\treturn convertedState;\n\t\t}\n\n\t\tconst featuresToMigrate = interfaceScopes?.[ scope ];\n\t\tif ( ! featuresToMigrate ) {\n\t\t\treturn convertedState;\n\t\t}\n\n\t\tconst existingMigratedData =\n\t\t\tconvertedState?.[ preferencesStoreName ]?.preferences?.[ scope ];\n\n\t\tif ( existingMigratedData ) {\n\t\t\treturn convertedState;\n\t\t}\n\n\t\tconst otherPreferencesScopes =\n\t\t\tconvertedState?.[ preferencesStoreName ]?.preferences;\n\t\tconst otherInterfaceState = convertedState?.[ interfaceStoreName ];\n\t\tconst otherInterfaceScopes =\n\t\t\tconvertedState?.[ interfaceStoreName ]?.preferences?.features;\n\n\t\treturn {\n\t\t\t...convertedState,\n\t\t\t[ preferencesStoreName ]: {\n\t\t\t\tpreferences: {\n\t\t\t\t\t...otherPreferencesScopes,\n\t\t\t\t\t[ scope ]: featuresToMigrate,\n\t\t\t\t},\n\t\t\t},\n\t\t\t[ interfaceStoreName ]: {\n\t\t\t\t...otherInterfaceState,\n\t\t\t\tpreferences: {\n\t\t\t\t\tfeatures: {\n\t\t\t\t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IAClE,MAAMiB,oBAAoB,GACzBP,cAAc,GAAIV,kBAAkB,CAAE,EAAEG,WAAW,EAAEC,QAAQ;IAE9D,OAAO;MACN,GAAGM,cAAc;MACjB,CAAET,oBAAoB,GAAI;QACzBE,WAAW,EAAE;UACZ,GAAGY,sBAAsB;UACzB,CAAEJ,KAAK,GAAIE;QACZ;MACD,CAAC;MACD,CAAEb,kBAAkB,GAAI;QACvB,GAAGgB,mBAAmB;QACtBb,WAAW,EAAE;UACZC,QAAQ,EAAE;YACT,GAAGa,oBAAoB;YACvB,CAAEN,KAAK,GAAIO;UACZ;QACD;MACD;IACD,CAAC;EACF,CAAC,EAAEnB,KAAM,CAAC;AACX","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["convertComplementaryAreas","state","Object","keys","reduce","stateAccumulator","scope","scopeData","complementaryArea","updatedScopeData","isComplementaryAreaVisible"],"sources":["@wordpress/preferences-persistence/src/migrations/preferences-package-data/convert-complementary-areas.js"],"sourcesContent":["export default function convertComplementaryAreas( state ) {\n\treturn Object.keys( state ).reduce( ( stateAccumulator, scope ) => {\n\t\tconst scopeData = state[ scope ];\n\n\t\t// If a complementary area is truthy, convert it to the `isComplementaryAreaVisible` boolean.\n\t\tif ( scopeData?.complementaryArea ) {\n\t\t\tconst updatedScopeData = { ...scopeData };\n\t\t\tdelete updatedScopeData.complementaryArea;\n\t\t\tupdatedScopeData.isComplementaryAreaVisible = true;\n\t\t\tstateAccumulator[ scope ] = updatedScopeData;\n\t\t\treturn stateAccumulator;\n\t\t}\n\n\t\treturn stateAccumulator;\n\t}, state );\n}\n"],"mappings":";;;;;;;AAAe,SAASA,yBAAyBA,CAAEC,KAAK,EAAG;EAC1D,OAAOC,MAAM,CAACC,IAAI,CAAEF,KAAM,CAAC,CAACG,MAAM,CAAE,CAAEC,gBAAgB,EAAEC,KAAK,KAAM;IAClE,MAAMC,SAAS,GAAGN,KAAK,CAAEK,KAAK,CAAE;;IAEhC;IACA,IAAKC,SAAS,EAAEC,iBAAiB,EAAG;MACnC,MAAMC,gBAAgB,GAAG;QAAE,GAAGF;MAAU,CAAC;MACzC,OAAOE,gBAAgB,CAACD,iBAAiB;MACzCC,gBAAgB,CAACC,0BAA0B,GAAG,IAAI;MAClDL,gBAAgB,CAAEC,KAAK,CAAE,GAAGG,gBAAgB;MAC5C,OAAOJ,gBAAgB;IACxB;IAEA,OAAOA,gBAAgB;EACxB,CAAC,EAAEJ,KAAM,CAAC;AACX","ignoreList":[]}
1
+ {"version":3,"names":["convertComplementaryAreas","state","Object","keys","reduce","stateAccumulator","scope","scopeData","complementaryArea","updatedScopeData","isComplementaryAreaVisible"],"sources":["@wordpress/preferences-persistence/src/migrations/preferences-package-data/convert-complementary-areas.js"],"sourcesContent":["export default function convertComplementaryAreas( state ) {\n\treturn Object.keys( state ).reduce( ( stateAccumulator, scope ) => {\n\t\tconst scopeData = state[ scope ];\n\n\t\t// If a complementary area is truthy, convert it to the `isComplementaryAreaVisible` boolean.\n\t\tif ( scopeData?.complementaryArea ) {\n\t\t\tconst updatedScopeData = { ...scopeData };\n\t\t\tdelete updatedScopeData.complementaryArea;\n\t\t\tupdatedScopeData.isComplementaryAreaVisible = true;\n\t\t\tstateAccumulator[ scope ] = updatedScopeData;\n\t\t\treturn stateAccumulator;\n\t\t}\n\n\t\treturn stateAccumulator;\n\t}, state );\n}\n"],"mappings":";;;;;;AAAe,SAASA,yBAAyBA,CAAEC,KAAK,EAAG;EAC1D,OAAOC,MAAM,CAACC,IAAI,CAAEF,KAAM,CAAC,CAACG,MAAM,CAAE,CAAEC,gBAAgB,EAAEC,KAAK,KAAM;IAClE,MAAMC,SAAS,GAAGN,KAAK,CAAEK,KAAK,CAAE;;IAEhC;IACA,IAAKC,SAAS,EAAEC,iBAAiB,EAAG;MACnC,MAAMC,gBAAgB,GAAG;QAAE,GAAGF;MAAU,CAAC;MACzC,OAAOE,gBAAgB,CAACD,iBAAiB;MACzCC,gBAAgB,CAACC,0BAA0B,GAAG,IAAI;MAClDL,gBAAgB,CAAEC,KAAK,CAAE,GAAGG,gBAAgB;MAC5C,OAAOJ,gBAAgB;IACxB;IAEA,OAAOA,gBAAgB;EACxB,CAAC,EAAEJ,KAAM,CAAC;AACX","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * Convert the post editor's panels state from:
4
3
  * ```
@@ -1 +1 @@
1
- {"version":3,"names":["convertEditPostPanels","preferences","_preferences$panels","panels","Object","keys","reduce","convertedData","panelName","panel","enabled","inactivePanels","push","opened","openPanels"],"sources":["@wordpress/preferences-persistence/src/migrations/legacy-local-storage-data/convert-edit-post-panels.js"],"sourcesContent":["/**\n * Convert the post editor's panels state from:\n * ```\n * {\n * panels: {\n * tags: {\n * enabled: true,\n * opened: true,\n * },\n * permalinks: {\n * enabled: false,\n * opened: false,\n * },\n * },\n * }\n * ```\n *\n * to a new, more concise data structure:\n * {\n * inactivePanels: [\n * 'permalinks',\n * ],\n * openPanels: [\n * 'tags',\n * ],\n * }\n *\n * @param {Object} preferences A preferences object.\n *\n * @return {Object} The converted data.\n */\nexport default function convertEditPostPanels( preferences ) {\n\tconst panels = preferences?.panels ?? {};\n\treturn Object.keys( panels ).reduce(\n\t\t( convertedData, panelName ) => {\n\t\t\tconst panel = panels[ panelName ];\n\n\t\t\tif ( panel?.enabled === false ) {\n\t\t\t\tconvertedData.inactivePanels.push( panelName );\n\t\t\t}\n\n\t\t\tif ( panel?.opened === true ) {\n\t\t\t\tconvertedData.openPanels.push( panelName );\n\t\t\t}\n\n\t\t\treturn convertedData;\n\t\t},\n\t\t{ inactivePanels: [], openPanels: [] }\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,qBAAqBA,CAAEC,WAAW,EAAG;EAAA,IAAAC,mBAAA;EAC5D,MAAMC,MAAM,IAAAD,mBAAA,GAAGD,WAAW,EAAEE,MAAM,cAAAD,mBAAA,cAAAA,mBAAA,GAAI,CAAC,CAAC;EACxC,OAAOE,MAAM,CAACC,IAAI,CAAEF,MAAO,CAAC,CAACG,MAAM,CAClC,CAAEC,aAAa,EAAEC,SAAS,KAAM;IAC/B,MAAMC,KAAK,GAAGN,MAAM,CAAEK,SAAS,CAAE;IAEjC,IAAKC,KAAK,EAAEC,OAAO,KAAK,KAAK,EAAG;MAC/BH,aAAa,CAACI,cAAc,CAACC,IAAI,CAAEJ,SAAU,CAAC;IAC/C;IAEA,IAAKC,KAAK,EAAEI,MAAM,KAAK,IAAI,EAAG;MAC7BN,aAAa,CAACO,UAAU,CAACF,IAAI,CAAEJ,SAAU,CAAC;IAC3C;IAEA,OAAOD,aAAa;EACrB,CAAC,EACD;IAAEI,cAAc,EAAE,EAAE;IAAEG,UAAU,EAAE;EAAG,CACtC,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["convertEditPostPanels","preferences","_preferences$panels","panels","Object","keys","reduce","convertedData","panelName","panel","enabled","inactivePanels","push","opened","openPanels"],"sources":["@wordpress/preferences-persistence/src/migrations/legacy-local-storage-data/convert-edit-post-panels.js"],"sourcesContent":["/**\n * Convert the post editor's panels state from:\n * ```\n * {\n * panels: {\n * tags: {\n * enabled: true,\n * opened: true,\n * },\n * permalinks: {\n * enabled: false,\n * opened: false,\n * },\n * },\n * }\n * ```\n *\n * to a new, more concise data structure:\n * {\n * inactivePanels: [\n * 'permalinks',\n * ],\n * openPanels: [\n * 'tags',\n * ],\n * }\n *\n * @param {Object} preferences A preferences object.\n *\n * @return {Object} The converted data.\n */\nexport default function convertEditPostPanels( preferences ) {\n\tconst panels = preferences?.panels ?? {};\n\treturn Object.keys( panels ).reduce(\n\t\t( convertedData, panelName ) => {\n\t\t\tconst panel = panels[ panelName ];\n\n\t\t\tif ( panel?.enabled === false ) {\n\t\t\t\tconvertedData.inactivePanels.push( panelName );\n\t\t\t}\n\n\t\t\tif ( panel?.opened === true ) {\n\t\t\t\tconvertedData.openPanels.push( panelName );\n\t\t\t}\n\n\t\t\treturn convertedData;\n\t\t},\n\t\t{ inactivePanels: [], openPanels: [] }\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,qBAAqBA,CAAEC,WAAW,EAAG;EAAA,IAAAC,mBAAA;EAC5D,MAAMC,MAAM,IAAAD,mBAAA,GAAGD,WAAW,EAAEE,MAAM,cAAAD,mBAAA,cAAAA,mBAAA,GAAI,CAAC,CAAC;EACxC,OAAOE,MAAM,CAACC,IAAI,CAAEF,MAAO,CAAC,CAACG,MAAM,CAClC,CAAEC,aAAa,EAAEC,SAAS,KAAM;IAC/B,MAAMC,KAAK,GAAGN,MAAM,CAAEK,SAAS,CAAE;IAEjC,IAAKC,KAAK,EAAEC,OAAO,KAAK,KAAK,EAAG;MAC/BH,aAAa,CAACI,cAAc,CAACC,IAAI,CAAEJ,SAAU,CAAC;IAC/C;IAEA,IAAKC,KAAK,EAAEI,MAAM,KAAK,IAAI,EAAG;MAC7BN,aAAa,CAACO,UAAU,CAACF,IAAI,CAAEJ,SAAU,CAAC;IAC3C;IAEA,OAAOD,aAAa;EACrB,CAAC,EACD;IAAEI,cAAc,EAAE,EAAE;IAAEG,UAAU,EAAE;EAAG,CACtC,CAAC;AACF","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * Migrates interface 'enableItems' data to the preferences store.
4
3
  *
@@ -1 +1 @@
1
- {"version":3,"names":["moveInterfaceEnableItems","state","_state$preferencesSto","_sourceEnableItems$si","_sourceEnableItems$mu","interfaceStoreName","preferencesStoreName","sourceEnableItems","enableItems","allPreferences","preferences","sourceComplementaryAreas","singleEnableItems","complementaryArea","preferencesWithConvertedComplementaryAreas","Object","keys","reduce","accumulator","scope","data","sourcePinnedItems","multipleEnableItems","pinnedItems","allConvertedData","otherInterfaceItems","undefined"],"sources":["@wordpress/preferences-persistence/src/migrations/legacy-local-storage-data/move-interface-enable-items.js"],"sourcesContent":["/**\n * Migrates interface 'enableItems' data to the preferences store.\n *\n * The interface package stores this data in this format:\n * ```js\n * {\n * enableItems: {\n * singleEnableItems: {\n * \t complementaryArea: {\n * 'core/edit-post': 'edit-post/document',\n * 'core/edit-site': 'edit-site/global-styles',\n * }\n * },\n * multipleEnableItems: {\n * pinnedItems: {\n * 'core/edit-post': {\n * 'plugin-1': true,\n * },\n * 'core/edit-site': {\n * 'plugin-2': true,\n * },\n * },\n * }\n * }\n * }\n * ```\n *\n * and it should be converted it to:\n * ```js\n * {\n * 'core/edit-post': {\n * complementaryArea: 'edit-post/document',\n * pinnedItems: {\n * 'plugin-1': true,\n * },\n * },\n * 'core/edit-site': {\n * complementaryArea: 'edit-site/global-styles',\n * pinnedItems: {\n * 'plugin-2': true,\n * },\n * },\n * }\n * ```\n *\n * @param {Object} state The local storage state.\n */\nexport default function moveInterfaceEnableItems( state ) {\n\tconst interfaceStoreName = 'core/interface';\n\tconst preferencesStoreName = 'core/preferences';\n\tconst sourceEnableItems = state?.[ interfaceStoreName ]?.enableItems;\n\n\t// There's nothing to migrate, exit early.\n\tif ( ! sourceEnableItems ) {\n\t\treturn state;\n\t}\n\n\tconst allPreferences = state?.[ preferencesStoreName ]?.preferences ?? {};\n\n\t// First convert complementaryAreas into the right format.\n\t// Use the existing preferences as the accumulator so that the data is\n\t// merged.\n\tconst sourceComplementaryAreas =\n\t\tsourceEnableItems?.singleEnableItems?.complementaryArea ?? {};\n\n\tconst preferencesWithConvertedComplementaryAreas = Object.keys(\n\t\tsourceComplementaryAreas\n\t).reduce( ( accumulator, scope ) => {\n\t\tconst data = sourceComplementaryAreas[ scope ];\n\n\t\t// Don't overwrite any existing data in the preferences store.\n\t\tif ( accumulator?.[ scope ]?.complementaryArea ) {\n\t\t\treturn accumulator;\n\t\t}\n\n\t\treturn {\n\t\t\t...accumulator,\n\t\t\t[ scope ]: {\n\t\t\t\t...accumulator[ scope ],\n\t\t\t\tcomplementaryArea: data,\n\t\t\t},\n\t\t};\n\t}, allPreferences );\n\n\t// Next feed the converted complementary areas back into a reducer that\n\t// converts the pinned items, resulting in the fully migrated data.\n\tconst sourcePinnedItems =\n\t\tsourceEnableItems?.multipleEnableItems?.pinnedItems ?? {};\n\tconst allConvertedData = Object.keys( sourcePinnedItems ).reduce(\n\t\t( accumulator, scope ) => {\n\t\t\tconst data = sourcePinnedItems[ scope ];\n\t\t\t// Don't overwrite any existing data in the preferences store.\n\t\t\tif ( accumulator?.[ scope ]?.pinnedItems ) {\n\t\t\t\treturn accumulator;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...accumulator,\n\t\t\t\t[ scope ]: {\n\t\t\t\t\t...accumulator[ scope ],\n\t\t\t\t\tpinnedItems: data,\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\tpreferencesWithConvertedComplementaryAreas\n\t);\n\n\tconst otherInterfaceItems = state[ interfaceStoreName ];\n\n\treturn {\n\t\t...state,\n\t\t[ preferencesStoreName ]: {\n\t\t\tpreferences: allConvertedData,\n\t\t},\n\t\t[ interfaceStoreName ]: {\n\t\t\t...otherInterfaceItems,\n\t\t\tenableItems: undefined,\n\t\t},\n\t};\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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,iBAAkB,CAAC,CAACJ,MAAM,CAC/D,CAAEC,WAAW,EAAEC,KAAK,KAAM;IACzB,MAAMC,IAAI,GAAGC,iBAAiB,CAAEF,KAAK,CAAE;IACvC;IACA,IAAKD,WAAW,GAAIC,KAAK,CAAE,EAAEI,WAAW,EAAG;MAC1C,OAAOL,WAAW;IACnB;IAEA,OAAO;MACN,GAAGA,WAAW;MACd,CAAEC,KAAK,GAAI;QACV,GAAGD,WAAW,CAAEC,KAAK,CAAE;QACvBI,WAAW,EAAEH;MACd;IACD,CAAC;EACF,CAAC,EACDN,0CACD,CAAC;EAED,MAAMW,mBAAmB,GAAGxB,KAAK,CAAEI,kBAAkB,CAAE;EAEvD,OAAO;IACN,GAAGJ,KAAK;IACR,CAAEK,oBAAoB,GAAI;MACzBI,WAAW,EAAEc;IACd,CAAC;IACD,CAAEnB,kBAAkB,GAAI;MACvB,GAAGoB,mBAAmB;MACtBjB,WAAW,EAAEkB;IACd;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["moveInterfaceEnableItems","state","_state$preferencesSto","_sourceEnableItems$si","_sourceEnableItems$mu","interfaceStoreName","preferencesStoreName","sourceEnableItems","enableItems","allPreferences","preferences","sourceComplementaryAreas","singleEnableItems","complementaryArea","preferencesWithConvertedComplementaryAreas","Object","keys","reduce","accumulator","scope","data","sourcePinnedItems","multipleEnableItems","pinnedItems","allConvertedData","otherInterfaceItems","undefined"],"sources":["@wordpress/preferences-persistence/src/migrations/legacy-local-storage-data/move-interface-enable-items.js"],"sourcesContent":["/**\n * Migrates interface 'enableItems' data to the preferences store.\n *\n * The interface package stores this data in this format:\n * ```js\n * {\n * enableItems: {\n * singleEnableItems: {\n * \t complementaryArea: {\n * 'core/edit-post': 'edit-post/document',\n * 'core/edit-site': 'edit-site/global-styles',\n * }\n * },\n * multipleEnableItems: {\n * pinnedItems: {\n * 'core/edit-post': {\n * 'plugin-1': true,\n * },\n * 'core/edit-site': {\n * 'plugin-2': true,\n * },\n * },\n * }\n * }\n * }\n * ```\n *\n * and it should be converted it to:\n * ```js\n * {\n * 'core/edit-post': {\n * complementaryArea: 'edit-post/document',\n * pinnedItems: {\n * 'plugin-1': true,\n * },\n * },\n * 'core/edit-site': {\n * complementaryArea: 'edit-site/global-styles',\n * pinnedItems: {\n * 'plugin-2': true,\n * },\n * },\n * }\n * ```\n *\n * @param {Object} state The local storage state.\n */\nexport default function moveInterfaceEnableItems( state ) {\n\tconst interfaceStoreName = 'core/interface';\n\tconst preferencesStoreName = 'core/preferences';\n\tconst sourceEnableItems = state?.[ interfaceStoreName ]?.enableItems;\n\n\t// There's nothing to migrate, exit early.\n\tif ( ! sourceEnableItems ) {\n\t\treturn state;\n\t}\n\n\tconst allPreferences = state?.[ preferencesStoreName ]?.preferences ?? {};\n\n\t// First convert complementaryAreas into the right format.\n\t// Use the existing preferences as the accumulator so that the data is\n\t// merged.\n\tconst sourceComplementaryAreas =\n\t\tsourceEnableItems?.singleEnableItems?.complementaryArea ?? {};\n\n\tconst preferencesWithConvertedComplementaryAreas = Object.keys(\n\t\tsourceComplementaryAreas\n\t).reduce( ( accumulator, scope ) => {\n\t\tconst data = sourceComplementaryAreas[ scope ];\n\n\t\t// Don't overwrite any existing data in the preferences store.\n\t\tif ( accumulator?.[ scope ]?.complementaryArea ) {\n\t\t\treturn accumulator;\n\t\t}\n\n\t\treturn {\n\t\t\t...accumulator,\n\t\t\t[ scope ]: {\n\t\t\t\t...accumulator[ scope ],\n\t\t\t\tcomplementaryArea: data,\n\t\t\t},\n\t\t};\n\t}, allPreferences );\n\n\t// Next feed the converted complementary areas back into a reducer that\n\t// converts the pinned items, resulting in the fully migrated data.\n\tconst sourcePinnedItems =\n\t\tsourceEnableItems?.multipleEnableItems?.pinnedItems ?? {};\n\tconst allConvertedData = Object.keys( sourcePinnedItems ).reduce(\n\t\t( accumulator, scope ) => {\n\t\t\tconst data = sourcePinnedItems[ scope ];\n\t\t\t// Don't overwrite any existing data in the preferences store.\n\t\t\tif ( accumulator?.[ scope ]?.pinnedItems ) {\n\t\t\t\treturn accumulator;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...accumulator,\n\t\t\t\t[ scope ]: {\n\t\t\t\t\t...accumulator[ scope ],\n\t\t\t\t\tpinnedItems: data,\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\tpreferencesWithConvertedComplementaryAreas\n\t);\n\n\tconst otherInterfaceItems = state[ interfaceStoreName ];\n\n\treturn {\n\t\t...state,\n\t\t[ preferencesStoreName ]: {\n\t\t\tpreferences: allConvertedData,\n\t\t},\n\t\t[ interfaceStoreName ]: {\n\t\t\t...otherInterfaceItems,\n\t\t\tenableItems: undefined,\n\t\t},\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,wBAAwBA,CAAEC,KAAK,EAAG;EAAA,IAAAC,qBAAA,EAAAC,qBAAA,EAAAC,qBAAA;EACzD,MAAMC,kBAAkB,GAAG,gBAAgB;EAC3C,MAAMC,oBAAoB,GAAG,kBAAkB;EAC/C,MAAMC,iBAAiB,GAAGN,KAAK,GAAII,kBAAkB,CAAE,EAAEG,WAAW;;EAEpE;EACA,IAAK,CAAED,iBAAiB,EAAG;IAC1B,OAAON,KAAK;EACb;EAEA,MAAMQ,cAAc,IAAAP,qBAAA,GAAGD,KAAK,GAAIK,oBAAoB,CAAE,EAAEI,WAAW,cAAAR,qBAAA,cAAAA,qBAAA,GAAI,CAAC,CAAC;;EAEzE;EACA;EACA;EACA,MAAMS,wBAAwB,IAAAR,qBAAA,GAC7BI,iBAAiB,EAAEK,iBAAiB,EAAEC,iBAAiB,cAAAV,qBAAA,cAAAA,q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AEkB;IACd;EACD,CAAC;AACF","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  /**
3
2
  * The interface package previously had a public API that could be used by
4
3
  * plugins to set persisted boolean 'feature' preferences.
@@ -1 +1 @@
1
- {"version":3,"names":["moveThirdPartyFeaturePreferencesToPreferences","state","interfaceStoreName","preferencesStoreName","interfaceScopes","preferences","features","interfaceScopeKeys","Object","keys","length","reduce","convertedState","scope","startsWith","featuresToMigrate","existingMigratedData","otherPreferencesScopes","otherInterfaceState","otherInterfaceScopes","undefined"],"sources":["@wordpress/preferences-persistence/src/migrations/legacy-local-storage-data/move-third-party-feature-preferences.js"],"sourcesContent":["/**\n * The interface package previously had a public API that could be used by\n * plugins to set persisted boolean 'feature' preferences.\n *\n * While usage was likely non-existent or very small, this function ensures\n * those are migrated to the preferences data structure. The interface\n * package's APIs have now been deprecated and use the preferences store.\n *\n * This will convert data that looks like this:\n * ```js\n * {\n * 'core/interface': {\n * preferences: {\n * features: {\n * 'my-plugin': {\n * myPluginFeature: true\n * }\n * }\n * }\n * }\n * }\n * ```\n *\n * To this:\n * ```js\n * * {\n * 'core/preferences': {\n * preferences: {\n * 'my-plugin': {\n * myPluginFeature: true\n * }\n * }\n * }\n * }\n * ```\n *\n * @param {Object} state The local storage state\n *\n * @return {Object} The state with third party preferences moved to the\n * preferences data structure.\n */\nexport default function moveThirdPartyFeaturePreferencesToPreferences( state ) {\n\tconst interfaceStoreName = 'core/interface';\n\tconst preferencesStoreName = 'core/preferences';\n\n\tconst interfaceScopes =\n\t\tstate?.[ interfaceStoreName ]?.preferences?.features;\n\tconst interfaceScopeKeys = interfaceScopes\n\t\t? Object.keys( interfaceScopes )\n\t\t: [];\n\n\tif ( ! interfaceScopeKeys?.length ) {\n\t\treturn state;\n\t}\n\n\treturn interfaceScopeKeys.reduce( function ( convertedState, scope ) {\n\t\tif ( scope.startsWith( 'core' ) ) {\n\t\t\treturn convertedState;\n\t\t}\n\n\t\tconst featuresToMigrate = interfaceScopes?.[ scope ];\n\t\tif ( ! featuresToMigrate ) {\n\t\t\treturn convertedState;\n\t\t}\n\n\t\tconst existingMigratedData =\n\t\t\tconvertedState?.[ preferencesStoreName ]?.preferences?.[ scope ];\n\n\t\tif ( existingMigratedData ) {\n\t\t\treturn convertedState;\n\t\t}\n\n\t\tconst otherPreferencesScopes =\n\t\t\tconvertedState?.[ preferencesStoreName ]?.preferences;\n\t\tconst otherInterfaceState = convertedState?.[ interfaceStoreName ];\n\t\tconst otherInterfaceScopes =\n\t\t\tconvertedState?.[ interfaceStoreName ]?.preferences?.features;\n\n\t\treturn {\n\t\t\t...convertedState,\n\t\t\t[ preferencesStoreName ]: {\n\t\t\t\tpreferences: {\n\t\t\t\t\t...otherPreferencesScopes,\n\t\t\t\t\t[ scope ]: featuresToMigrate,\n\t\t\t\t},\n\t\t\t},\n\t\t\t[ interfaceStoreName ]: {\n\t\t\t\t...otherInterfaceState,\n\t\t\t\tpreferences: {\n\t\t\t\t\tfeatures: {\n\t\t\t\t\t\t...otherInterfaceScopes,\n\t\t\t\t\t\t[ scope ]: undefined,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}, state );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,6CAA6CA,CAAEC,KAAK,EAAG;EAC9E,MAAMC,kBAAkB,GAAG,gBAAgB;EAC3C,MAAMC,oBAAoB,GAAG,kBAAkB;EAE/C,MAAMC,eAAe,GACpBH,KAAK,GAAIC,kBAAkB,CAAE,EAAEG,WAAW,EAAEC,QAAQ;EACrD,MAAMC,kBAAkB,GAAGH,eAAe,GACvCI,MAAM,CAACC,IAAI,CAAEL,eAAgB,CAAC,GAC9B,EAAE;EAEL,IAAK,CAAEG,kBAAkB,EAAEG,MAAM,EAAG;IACnC,OAAOT,KAAK;EACb;EAEA,OAAOM,kBAAkB,CAACI,MAAM,CAAE,UAAWC,cAAc,EAAEC,KAAK,EAAG;IACpE,IAAKA,KAAK,CAACC,UAAU,CAAE,MAAO,CAAC,EAAG;MACjC,OAAOF,cAAc;IACtB;IAEA,MAAMG,iBAAiB,GAAGX,eAAe,GAAIS,KAAK,CAAE;IACpD,IAAK,CAAEE,iBAAiB,EAAG;MAC1B,OAAOH,cAAc;IACtB;IAEA,MAAMI,oBAAoB,GACzBJ,cAAc,GAAIT,oBAAoB,CAAE,EAAEE,WAAW,GAAIQ,KAAK,CAAE;IAEjE,IAAKG,oBAAoB,EAAG;MAC3B,OAAOJ,cAAc;IACtB;IAEA,MAAMK,sBAAsB,GAC3BL,cAAc,GAAIT,oBAAoB,CAAE,EAAEE,WAAW;IACtD,MAAMa,mBAAmB,GAAGN,cAAc,GAAIV,kBAAkB,CAAE;IAClE,MAAMiB,oBAAoB,GACzBP,cAAc,GAAIV,kBAAkB,CAAE,EAAEG,WAAW,EAAEC,QAAQ;IAE9D,OAAO;MACN,GAAGM,cAAc;MACjB,CAAET,oBAAoB,GAAI;QACzBE,WAAW,EAAE;UACZ,GAAGY,sBAAsB;UACzB,CAAEJ,KAAK,GAAIE;QACZ;MACD,CAAC;MACD,CAAEb,kBAAkB,GAAI;QACvB,GAAGgB,mBAAmB;QACtBb,WAAW,EAAE;UACZC,QAAQ,EAAE;YACT,GAAGa,oBAAoB;YACvB,CAAEN,KAAK,GAAIO;UACZ;QACD;MACD;IACD,CAAC;EACF,CAAC,EAAEnB,KAAM,CAAC;AACX","ignoreList":[]}
1
+ {"version":3,"names":["moveThirdPartyFeaturePreferencesToPreferences","state","interfaceStoreName","preferencesStoreName","interfaceScopes","preferences","features","interfaceScopeKeys","Object","keys","length","reduce","convertedState","scope","startsWith","featuresToMigrate","existingMigratedData","otherPreferencesScopes","otherInterfaceState","otherInterfaceScopes","undefined"],"sources":["@wordpress/preferences-persistence/src/migrations/legacy-local-storage-data/move-third-party-feature-preferences.js"],"sourcesContent":["/**\n * The interface package previously had a public API that could be used by\n * plugins to set persisted boolean 'feature' preferences.\n *\n * While usage was likely non-existent or very small, this function ensures\n * those are migrated to the preferences data structure. The interface\n * package's APIs have now been deprecated and use the preferences store.\n *\n * This will convert data that looks like this:\n * ```js\n * {\n * 'core/interface': {\n * preferences: {\n * features: {\n * 'my-plugin': {\n * myPluginFeature: true\n * }\n * }\n * }\n * }\n * }\n * ```\n *\n * To this:\n * ```js\n * * {\n * 'core/preferences': {\n * preferences: {\n * 'my-plugin': {\n * myPluginFeature: true\n * }\n * }\n * }\n * }\n * ```\n *\n * @param {Object} state The local storage state\n *\n * @return {Object} The state with third party preferences moved to the\n * preferences data structure.\n */\nexport default function moveThirdPartyFeaturePreferencesToPreferences( state ) {\n\tconst interfaceStoreName = 'core/interface';\n\tconst preferencesStoreName = 'core/preferences';\n\n\tconst interfaceScopes =\n\t\tstate?.[ interfaceStoreName ]?.preferences?.features;\n\tconst interfaceScopeKeys = interfaceScopes\n\t\t? Object.keys( interfaceScopes )\n\t\t: [];\n\n\tif ( ! interfaceScopeKeys?.length ) {\n\t\treturn state;\n\t}\n\n\treturn interfaceScopeKeys.reduce( function ( convertedState, scope ) {\n\t\tif ( scope.startsWith( 'core' ) ) {\n\t\t\treturn convertedState;\n\t\t}\n\n\t\tconst featuresToMigrate = interfaceScopes?.[ scope ];\n\t\tif ( ! featuresToMigrate ) {\n\t\t\treturn convertedState;\n\t\t}\n\n\t\tconst existingMigratedData =\n\t\t\tconvertedState?.[ preferencesStoreName ]?.preferences?.[ scope ];\n\n\t\tif ( existingMigratedData ) {\n\t\t\treturn convertedState;\n\t\t}\n\n\t\tconst otherPreferencesScopes =\n\t\t\tconvertedState?.[ preferencesStoreName ]?.preferences;\n\t\tconst otherInterfaceState = convertedState?.[ interfaceStoreName ];\n\t\tconst otherInterfaceScopes =\n\t\t\tconvertedState?.[ interfaceStoreName ]?.preferences?.features;\n\n\t\treturn {\n\t\t\t...convertedState,\n\t\t\t[ preferencesStoreName ]: {\n\t\t\t\tpreferences: {\n\t\t\t\t\t...otherPreferencesScopes,\n\t\t\t\t\t[ scope ]: featuresToMigrate,\n\t\t\t\t},\n\t\t\t},\n\t\t\t[ interfaceStoreName ]: {\n\t\t\t\t...otherInterfaceState,\n\t\t\t\tpreferences: {\n\t\t\t\t\tfeatures: {\n\t\t\t\t\t\t...otherInterfaceScopes,\n\t\t\t\t\t\t[ scope ]: undefined,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}, state );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,6CAA6CA,CAAEC,KAAK,EAAG;EAC9E,MAAMC,kBAAkB,GAAG,gBAAgB;EAC3C,MAAMC,oBAAoB,GAAG,kBAAkB;EAE/C,MAAMC,eAAe,GACpBH,KAAK,GAAIC,kBAAkB,CAAE,EAAEG,WAAW,EAAEC,QAAQ;EACrD,MAAMC,kBAAkB,GAAGH,eAAe,GACvCI,MAAM,CAACC,IAAI,CAAEL,eAAgB,CAAC,GAC9B,EAAE;EAEL,IAAK,CAAEG,kBAAkB,EAAEG,MAAM,EAAG;IACnC,OAAOT,KAAK;EACb;EAEA,OAAOM,kBAAkB,CAACI,MAAM,CAAE,UAAWC,cAAc,EAAEC,KAAK,EAAG;IACpE,IAAKA,KAAK,CAACC,UAAU,CAAE,MAAO,CAAC,EAAG;MACjC,OAAOF,cAAc;IACtB;IAEA,MAAMG,iBAAiB,GAAGX,eAAe,GAAIS,KAAK,CAAE;IACpD,IAAK,CAAEE,iBAAiB,EAAG;MAC1B,OAAOH,cAAc;IACtB;IAEA,MAAMI,oBAAoB,GACzBJ,cAAc,GAAIT,oBAAoB,CAAE,EAAEE,WAAW,GAAIQ,KAAK,CAAE;IAEjE,IAAKG,oBAAoB,EAAG;MAC3B,OAAOJ,cAAc;IACtB;IAEA,MAAMK,sBAAsB,GAC3BL,cAAc,GAAIT,oBAAoB,CAAE,EAAEE,WAAW;IACtD,MAAMa,mBAAmB,GAAGN,cAAc,GAAIV,kBAAkB,CAAE;IAClE,MAAMiB,oBAAoB,GACzBP,cAAc,GAAIV,kBAAkB,CAAE,EAAEG,WAAW,EAAEC,QAAQ;IAE9D,OAAO;MACN,GAAGM,cAAc;MACjB,CAAET,oBAAoB,GAAI;QACzBE,WAAW,EAAE;UACZ,GAAGY,sBAAsB;UACzB,CAAEJ,KAAK,GAAIE;QACZ;MACD,CAAC;MACD,CAAEb,kBAAkB,GAAI;QACvB,GAAGgB,mBAAmB;QACtBb,WAAW,EAAE;UACZC,QAAQ,EAAE;YACT,GAAGa,oBAAoB;YACvB,CAAEN,KAAK,GAAIO;UACZ;QACD;MACD;IACD,CAAC;EACF,CAAC,EAAEnB,KAAM,CAAC;AACX","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  export default function convertComplementaryAreas(state) {
3
2
  return Object.keys(state).reduce((stateAccumulator, scope) => {
4
3
  const scopeData = state[scope];
@@ -1 +1 @@
1
- {"version":3,"names":["convertComplementaryAreas","state","Object","keys","reduce","stateAccumulator","scope","scopeData","complementaryArea","updatedScopeData","isComplementaryAreaVisible"],"sources":["@wordpress/preferences-persistence/src/migrations/preferences-package-data/convert-complementary-areas.js"],"sourcesContent":["export default function convertComplementaryAreas( state ) {\n\treturn Object.keys( state ).reduce( ( stateAccumulator, scope ) => {\n\t\tconst scopeData = state[ scope ];\n\n\t\t// If a complementary area is truthy, convert it to the `isComplementaryAreaVisible` boolean.\n\t\tif ( scopeData?.complementaryArea ) {\n\t\t\tconst updatedScopeData = { ...scopeData };\n\t\t\tdelete updatedScopeData.complementaryArea;\n\t\t\tupdatedScopeData.isComplementaryAreaVisible = true;\n\t\t\tstateAccumulator[ scope ] = updatedScopeData;\n\t\t\treturn stateAccumulator;\n\t\t}\n\n\t\treturn stateAccumulator;\n\t}, state );\n}\n"],"mappings":";AAAA,eAAe,SAASA,yBAAyBA,CAAEC,KAAK,EAAG;EAC1D,OAAOC,MAAM,CAACC,IAAI,CAAEF,KAAM,CAAC,CAACG,MAAM,CAAE,CAAEC,gBAAgB,EAAEC,KAAK,KAAM;IAClE,MAAMC,SAAS,GAAGN,KAAK,CAAEK,KAAK,CAAE;;IAEhC;IACA,IAAKC,SAAS,EAAEC,iBAAiB,EAAG;MACnC,MAAMC,gBAAgB,GAAG;QAAE,GAAGF;MAAU,CAAC;MACzC,OAAOE,gBAAgB,CAACD,iBAAiB;MACzCC,gBAAgB,CAACC,0BAA0B,GAAG,IAAI;MAClDL,gBAAgB,CAAEC,KAAK,CAAE,GAAGG,gBAAgB;MAC5C,OAAOJ,gBAAgB;IACxB;IAEA,OAAOA,gBAAgB;EACxB,CAAC,EAAEJ,KAAM,CAAC;AACX","ignoreList":[]}
1
+ {"version":3,"names":["convertComplementaryAreas","state","Object","keys","reduce","stateAccumulator","scope","scopeData","complementaryArea","updatedScopeData","isComplementaryAreaVisible"],"sources":["@wordpress/preferences-persistence/src/migrations/preferences-package-data/convert-complementary-areas.js"],"sourcesContent":["export default function convertComplementaryAreas( state ) {\n\treturn Object.keys( state ).reduce( ( stateAccumulator, scope ) => {\n\t\tconst scopeData = state[ scope ];\n\n\t\t// If a complementary area is truthy, convert it to the `isComplementaryAreaVisible` boolean.\n\t\tif ( scopeData?.complementaryArea ) {\n\t\t\tconst updatedScopeData = { ...scopeData };\n\t\t\tdelete updatedScopeData.complementaryArea;\n\t\t\tupdatedScopeData.isComplementaryAreaVisible = true;\n\t\t\tstateAccumulator[ scope ] = updatedScopeData;\n\t\t\treturn stateAccumulator;\n\t\t}\n\n\t\treturn stateAccumulator;\n\t}, state );\n}\n"],"mappings":"AAAA,eAAe,SAASA,yBAAyBA,CAAEC,KAAK,EAAG;EAC1D,OAAOC,MAAM,CAACC,IAAI,CAAEF,KAAM,CAAC,CAACG,MAAM,CAAE,CAAEC,gBAAgB,EAAEC,KAAK,KAAM;IAClE,MAAMC,SAAS,GAAGN,KAAK,CAAEK,KAAK,CAAE;;IAEhC;IACA,IAAKC,SAAS,EAAEC,iBAAiB,EAAG;MACnC,MAAMC,gBAAgB,GAAG;QAAE,GAAGF;MAAU,CAAC;MACzC,OAAOE,gBAAgB,CAACD,iBAAiB;MACzCC,gBAAgB,CAACC,0BAA0B,GAAG,IAAI;MAClDL,gBAAgB,CAAEC,KAAK,CAAE,GAAGG,gBAAgB;MAC5C,OAAOJ,gBAAgB;IACxB;IAEA,OAAOA,gBAAgB;EACxB,CAAC,EAAEJ,KAAM,CAAC;AACX","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/preferences-persistence",
3
- "version": "2.17.0",
3
+ "version": "2.19.0",
4
4
  "description": "Persistence utilities for `wordpress/preferences`.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -30,10 +30,10 @@
30
30
  "sideEffects": false,
31
31
  "dependencies": {
32
32
  "@babel/runtime": "7.25.7",
33
- "@wordpress/api-fetch": "^7.17.0"
33
+ "@wordpress/api-fetch": "^7.19.0"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "68a831c3178197fe87db284d4b94e5743bfb6b6c"
38
+ "gitHead": "d6b0b20fa927b110140dc7fdd906a7e0bf662004"
39
39
  }