@wordpress/edit-site 6.0.1 → 6.1.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 (133) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-page/index.js +2 -1
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/app/index.js +17 -1
  5. package/build/components/app/index.js.map +1 -1
  6. package/build/components/editor/index.js +3 -10
  7. package/build/components/editor/index.js.map +1 -1
  8. package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  9. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  10. package/build/components/global-styles/screen-revisions/index.js +4 -23
  11. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  12. package/build/components/global-styles/shadows-edit-panel.js +1 -0
  13. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  14. package/build/components/global-styles/variations/variation.js +11 -16
  15. package/build/components/global-styles/variations/variation.js.map +1 -1
  16. package/build/components/global-styles/variations/variations-color.js +1 -0
  17. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  18. package/build/components/global-styles/variations/variations-typography.js +1 -0
  19. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  20. package/build/components/layout/index.js +8 -37
  21. package/build/components/layout/index.js.map +1 -1
  22. package/build/components/page/header.js +1 -0
  23. package/build/components/page/header.js.map +1 -1
  24. package/build/components/page-patterns/header.js +2 -1
  25. package/build/components/page-patterns/header.js.map +1 -1
  26. package/build/components/posts-app/index.js +50 -0
  27. package/build/components/posts-app/index.js.map +1 -0
  28. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
  29. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  30. package/build/hooks/commands/use-set-command-context.js +53 -0
  31. package/build/hooks/commands/use-set-command-context.js.map +1 -0
  32. package/build/hooks/push-changes-to-global-styles/index.js +2 -2
  33. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  34. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +20 -88
  35. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  36. package/build/index.js +15 -2
  37. package/build/index.js.map +1 -1
  38. package/build/posts.js +34 -0
  39. package/build/posts.js.map +1 -0
  40. package/build-module/components/add-new-page/index.js +2 -1
  41. package/build-module/components/add-new-page/index.js.map +1 -1
  42. package/build-module/components/app/index.js +17 -1
  43. package/build-module/components/app/index.js.map +1 -1
  44. package/build-module/components/editor/index.js +3 -10
  45. package/build-module/components/editor/index.js.map +1 -1
  46. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  47. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  48. package/build-module/components/global-styles/screen-revisions/index.js +4 -23
  49. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  50. package/build-module/components/global-styles/shadows-edit-panel.js +1 -0
  51. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  52. package/build-module/components/global-styles/variations/variation.js +11 -16
  53. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  54. package/build-module/components/global-styles/variations/variations-color.js +1 -0
  55. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  56. package/build-module/components/global-styles/variations/variations-typography.js +1 -0
  57. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  58. package/build-module/components/layout/index.js +10 -39
  59. package/build-module/components/layout/index.js.map +1 -1
  60. package/build-module/components/page/header.js +1 -0
  61. package/build-module/components/page/header.js.map +1 -1
  62. package/build-module/components/page-patterns/header.js +2 -1
  63. package/build-module/components/page-patterns/header.js.map +1 -1
  64. package/build-module/components/posts-app/index.js +43 -0
  65. package/build-module/components/posts-app/index.js.map +1 -0
  66. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
  67. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  68. package/build-module/hooks/commands/use-set-command-context.js +46 -0
  69. package/build-module/hooks/commands/use-set-command-context.js.map +1 -0
  70. package/build-module/hooks/push-changes-to-global-styles/index.js +2 -2
  71. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  72. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +19 -86
  73. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  74. package/build-module/index.js +8 -2
  75. package/build-module/index.js.map +1 -1
  76. package/build-module/posts.js +27 -0
  77. package/build-module/posts.js.map +1 -0
  78. package/build-style/posts-rtl.css +1707 -0
  79. package/build-style/posts.css +1707 -0
  80. package/build-style/style-rtl.css +16 -19
  81. package/build-style/style.css +16 -19
  82. package/package.json +41 -41
  83. package/src/components/add-new-page/index.js +2 -1
  84. package/src/components/app/index.js +17 -1
  85. package/src/components/editor/index.js +2 -8
  86. package/src/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  87. package/src/components/global-styles/screen-revisions/index.js +4 -24
  88. package/src/components/global-styles/shadows-edit-panel.js +1 -0
  89. package/src/components/global-styles/style.scss +1 -7
  90. package/src/components/global-styles/variations/variation.js +14 -19
  91. package/src/components/global-styles/variations/variations-color.js +6 -1
  92. package/src/components/global-styles/variations/variations-typography.js +5 -1
  93. package/src/components/global-styles-sidebar/style.scss +0 -1
  94. package/src/components/layout/index.js +24 -70
  95. package/src/components/page/header.js +1 -0
  96. package/src/components/page/style.scss +6 -0
  97. package/src/components/page-patterns/header.js +8 -2
  98. package/src/components/page-patterns/style.scss +6 -0
  99. package/src/components/posts-app/index.js +39 -0
  100. package/src/components/sidebar/style.scss +4 -4
  101. package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
  102. package/src/hooks/commands/use-set-command-context.js +37 -0
  103. package/src/hooks/push-changes-to-global-styles/index.js +2 -2
  104. package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +1 -875
  105. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +29 -117
  106. package/src/index.js +10 -2
  107. package/src/posts.js +29 -0
  108. package/src/posts.scss +46 -0
  109. package/build/components/block-editor/block-inspector-button.js +0 -57
  110. package/build/components/block-editor/block-inspector-button.js.map +0 -1
  111. package/build/components/block-editor/inserter-media-categories.js +0 -183
  112. package/build/components/block-editor/inserter-media-categories.js.map +0 -1
  113. package/build/components/template-part-converter/convert-to-regular.js +0 -38
  114. package/build/components/template-part-converter/convert-to-regular.js.map +0 -1
  115. package/build/components/template-part-converter/convert-to-template-part.js +0 -84
  116. package/build/components/template-part-converter/convert-to-template-part.js.map +0 -1
  117. package/build/components/template-part-converter/index.js +0 -67
  118. package/build/components/template-part-converter/index.js.map +0 -1
  119. package/build-module/components/block-editor/block-inspector-button.js +0 -50
  120. package/build-module/components/block-editor/block-inspector-button.js.map +0 -1
  121. package/build-module/components/block-editor/inserter-media-categories.js +0 -177
  122. package/build-module/components/block-editor/inserter-media-categories.js.map +0 -1
  123. package/build-module/components/template-part-converter/convert-to-regular.js +0 -31
  124. package/build-module/components/template-part-converter/convert-to-regular.js.map +0 -1
  125. package/build-module/components/template-part-converter/convert-to-template-part.js +0 -79
  126. package/build-module/components/template-part-converter/convert-to-template-part.js.map +0 -1
  127. package/build-module/components/template-part-converter/index.js +0 -59
  128. package/build-module/components/template-part-converter/index.js.map +0 -1
  129. package/src/components/block-editor/block-inspector-button.js +0 -60
  130. package/src/components/block-editor/inserter-media-categories.js +0 -225
  131. package/src/components/template-part-converter/convert-to-regular.js +0 -32
  132. package/src/components/template-part-converter/convert-to-template-part.js +0 -78
  133. package/src/components/template-part-converter/index.js +0 -59
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","coreStore","useContext","useMemo","privateApis","blockEditorPrivateApis","editorPrivateApis","__","cloneDeep","unlock","GlobalStylesContext","mergeBaseAndUserConfigs","removePropertyFromObject","object","property","Object","keys","length","key","useCurrentMergeThemeStyleVariationsWithUserConfig","filter","variationsFromTheme","select","_variationsFromTheme","__experimentalGetCurrentThemeGlobalStylesVariations","user","baseVariation","variations","title","settings","styles","useThemeStyleVariationsByProperty","filterObjectByProperty","newObject","forEach","newFilter","clonedBaseVariation","processedStyleVariations","reduce","accumulator","variation","variationFilteredByProperty","result","description","isDuplicate","some","item","JSON","stringify","push","isVariationWithSingleProperty","variationWithProperty"],"sources":["@wordpress/edit-site/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport cloneDeep from '../../utils/clone-deep';\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\n/**\n * Removes all instances of a property from an object.\n *\n * @param {Object} object The object to remove the property from.\n * @param {string} property The property to remove.\n * @return {Object} The modified object.\n */\nexport function removePropertyFromObject( object, property ) {\n\tif ( ! property || typeof property !== 'string' ) {\n\t\treturn object;\n\t}\n\n\tif (\n\t\ttypeof object !== 'object' ||\n\t\t! object ||\n\t\t! Object.keys( object ).length\n\t) {\n\t\treturn object;\n\t}\n\n\tfor ( const key in object ) {\n\t\tif ( key === property ) {\n\t\t\tdelete object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tremovePropertyFromObject( object[ key ], property );\n\t\t}\n\t}\n\treturn object;\n}\n\n/**\n * A convenience wrapper for `useThemeStyleVariationsByProperty()` that fetches the current theme style variations,\n * and user-defined global style/settings object.\n *\n * @param {Object} props Object of hook args.\n * @param {string} props.property The property to filter by.\n * @param {Function} props.filter Optional. The filter function to apply to the variations.\n * @return {Object[]|*} The merged object.\n */\nexport function useCurrentMergeThemeStyleVariationsWithUserConfig( {\n\tproperty,\n\tfilter,\n} ) {\n\tconst { variationsFromTheme } = useSelect( ( select ) => {\n\t\tconst _variationsFromTheme =\n\t\t\tselect(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\n\t\treturn {\n\t\t\tvariationsFromTheme: _variationsFromTheme || [],\n\t\t};\n\t}, [] );\n\tconst { user: baseVariation } = useContext( GlobalStylesContext );\n\n\tconst variations = useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...variationsFromTheme,\n\t\t];\n\t}, [ variationsFromTheme ] );\n\n\treturn useThemeStyleVariationsByProperty( {\n\t\tvariations,\n\t\tproperty,\n\t\tfilter,\n\t\tbaseVariation: removePropertyFromObject(\n\t\t\tcloneDeep( baseVariation ),\n\t\t\tproperty\n\t\t),\n\t} );\n}\n\n/**\n * Returns a new object, with properties specified in `property`,\n * maintain the original object tree structure.\n * The function is recursive, so it will perform a deep search for the given property.\n * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the property is `test`.\n *\n * @param {Object} object The object to filter\n * @param {Object} property The property to filter by\n * @return {Object} The merged object.\n */\nexport const filterObjectByProperty = ( object, property ) => {\n\tif ( ! object ) {\n\t\treturn {};\n\t}\n\n\tconst newObject = {};\n\tObject.keys( object ).forEach( ( key ) => {\n\t\tif ( key === property ) {\n\t\t\tnewObject[ key ] = object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tconst newFilter = filterObjectByProperty( object[ key ], property );\n\t\t\tif ( Object.keys( newFilter ).length ) {\n\t\t\t\tnewObject[ key ] = newFilter;\n\t\t\t}\n\t\t}\n\t} );\n\treturn newObject;\n};\n\n/**\n * Returns a new object with only the properties specified in `property`.\n * Optional merges the baseVariation object with the variation object.\n * Note: this function will only overwrite the specified property in baseVariation if it exists.\n * The baseVariation will not be otherwise modified. To strip a property from the baseVariation object, use `removePropertyFromObject`.\n * See useCurrentMergeThemeStyleVariationsWithUserConfig for an example of how to use this function.\n *\n * @param {Object} props Object of hook args.\n * @param {Object[]} props.variations The theme style variations to filter.\n * @param {string} props.property The property to filter by.\n * @param {Function} props.filter Optional. The filter function to apply to the variations.\n * @param {Object} props.baseVariation Optional. Base or user settings to be updated with variation properties.\n * @return {Object[]|*} The merged object.\n */\nexport default function useThemeStyleVariationsByProperty( {\n\tvariations,\n\tproperty,\n\tfilter,\n\tbaseVariation,\n} ) {\n\treturn useMemo( () => {\n\t\tif ( ! property || ! variations || variations?.length === 0 ) {\n\t\t\treturn variations;\n\t\t}\n\n\t\tconst clonedBaseVariation =\n\t\t\ttypeof baseVariation === 'object' &&\n\t\t\tObject.keys( baseVariation ).length > 0\n\t\t\t\t? cloneDeep( baseVariation )\n\t\t\t\t: null;\n\n\t\tlet processedStyleVariations = variations.reduce(\n\t\t\t( accumulator, variation ) => {\n\t\t\t\tconst variationFilteredByProperty = filterObjectByProperty(\n\t\t\t\t\tcloneDeep( variation ),\n\t\t\t\t\tproperty\n\t\t\t\t);\n\n\t\t\t\t// Remove variations that are empty once the property is filtered out.\n\t\t\t\tif (\n\t\t\t\t\tvariation.title !== __( 'Default' ) &&\n\t\t\t\t\tObject.keys( variationFilteredByProperty ).length === 0\n\t\t\t\t) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\tlet result = {\n\t\t\t\t\t...variationFilteredByProperty,\n\t\t\t\t\ttitle: variation?.title,\n\t\t\t\t\tdescription: variation?.description,\n\t\t\t\t};\n\n\t\t\t\tif ( clonedBaseVariation ) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Overwrites all baseVariation object `styleProperty` properties\n\t\t\t\t\t * with the theme variation `styleProperty` properties.\n\t\t\t\t\t */\n\t\t\t\t\tresult = mergeBaseAndUserConfigs(\n\t\t\t\t\t\tclonedBaseVariation,\n\t\t\t\t\t\tresult\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Detect if this is a duplicate variation.\n\t\t\t\tconst isDuplicate = accumulator.some( ( item ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tJSON.stringify( item.styles ) ===\n\t\t\t\t\t\t\tJSON.stringify( result?.styles ) &&\n\t\t\t\t\t\tJSON.stringify( item.settings ) ===\n\t\t\t\t\t\t\tJSON.stringify( result?.settings )\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t\tif ( isDuplicate ) {\n\t\t\t\t\treturn accumulator;\n\t\t\t\t}\n\n\t\t\t\t// If the variation is not a duplicate, add it to the accumulator.\n\t\t\t\taccumulator.push( result );\n\t\t\t\treturn accumulator;\n\t\t\t},\n\t\t\t[] // Initial accumulator value.\n\t\t);\n\n\t\tif ( 'function' === typeof filter ) {\n\t\t\tprocessedStyleVariations =\n\t\t\t\tprocessedStyleVariations.filter( filter );\n\t\t}\n\n\t\treturn processedStyleVariations;\n\t}, [ variations, property, baseVariation, filter ] );\n}\n\n/**\n * Compares a style variation to the same variation filtered by a single property.\n * Returns true if the variation contains only the property specified.\n *\n * @param {Object} variation The variation to compare.\n * @param {string} property The property to compare.\n * @return {boolean} Whether the variation contains only a single property.\n */\nexport function isVariationWithSingleProperty( variation, property ) {\n\tconst variationWithProperty = filterObjectByProperty(\n\t\tcloneDeep( variation ),\n\t\tproperty\n\t);\n\n\treturn (\n\t\tJSON.stringify( variationWithProperty?.styles ) ===\n\t\t\tJSON.stringify( variation?.styles ) &&\n\t\tJSON.stringify( variationWithProperty?.settings ) ===\n\t\t\tJSON.stringify( variation?.settings )\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;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,IAAI,IAAM;QACjD,OACCC,IAAI,CAACC,SAAS,CAAEF,IAAI,CAAChB,MAAO,CAAC,KAC5BiB,IAAI,CAACC,SAAS,CAAEN,MAAM,EAAEZ,MAAO,CAAC,IACjCiB,IAAI,CAACC,SAAS,CAAEF,IAAI,CAACjB,QAAS,CAAC,KAC9BkB,IAAI,CAACC,SAAS,CAAEN,MAAM,EAAEb,QAAS,CAAC;MAErC,CAAE,CAAC;MACH,IAAKe,WAAW,EAAG;QAClB,OAAOL,WAAW;MACnB;;MAEA;MACAA,WAAW,CAACU,IAAI,CAAEP,MAAO,CAAC;MAC1B,OAAOH,WAAW;IACnB,CAAC,EACD,EAAE,CAAC;IACJ,CAAC;IAED,IAAK,UAAU,KAAK,OAAOnB,MAAM,EAAG;MACnCiB,wBAAwB,GACvBA,wBAAwB,CAACjB,MAAM,CAAEA,MAAO,CAAC;IAC3C;IAEA,OAAOiB,wBAAwB;EAChC,CAAC,EAAE,CAAEV,UAAU,EAAEb,QAAQ,EAAEY,aAAa,EAAEN,MAAM,CAAG,CAAC;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS8B,6BAA6BA,CAAEV,SAAS,EAAE1B,QAAQ,EAAG;EACpE,MAAMqC,qBAAqB,GAAGnB,sBAAsB,CACnDxB,SAAS,CAAEgC,SAAU,CAAC,EACtB1B,QACD,CAAC;EAED,OACCiC,IAAI,CAACC,SAAS,CAAEG,qBAAqB,EAAErB,MAAO,CAAC,KAC9CiB,IAAI,CAACC,SAAS,CAAER,SAAS,EAAEV,MAAO,CAAC,IACpCiB,IAAI,CAACC,SAAS,CAAEG,qBAAqB,EAAEtB,QAAS,CAAC,KAChDkB,IAAI,CAACC,SAAS,CAAER,SAAS,EAAEX,QAAS,CAAC;AAExC","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","store","coreStore","useContext","useMemo","privateApis","blockEditorPrivateApis","editorPrivateApis","__","cloneDeep","unlock","GlobalStylesContext","mergeBaseAndUserConfigs","removePropertyFromObject","object","property","Object","keys","length","key","useCurrentMergeThemeStyleVariationsWithUserConfig","variationsFromTheme","select","_variationsFromTheme","__experimentalGetCurrentThemeGlobalStylesVariations","user","userVariation","clonedUserVariation","userVariationWithoutProperty","title","variationsWithSinglePropertyAndBase","filter","variation","isVariationWithSingleProperty","map","filterObjectByProperty","newObject","forEach","newFilter","variationWithProperty","JSON","stringify","styles","settings"],"sources":["@wordpress/edit-site/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useContext, useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport cloneDeep from '../../utils/clone-deep';\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\nconst { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );\n\n/**\n * Removes all instances of a property from an object.\n *\n * @param {Object} object The object to remove the property from.\n * @param {string} property The property to remove.\n * @return {Object} The modified object.\n */\nexport function removePropertyFromObject( object, property ) {\n\tif ( ! property || typeof property !== 'string' ) {\n\t\treturn object;\n\t}\n\n\tif (\n\t\ttypeof object !== 'object' ||\n\t\t! object ||\n\t\t! Object.keys( object ).length\n\t) {\n\t\treturn object;\n\t}\n\n\tfor ( const key in object ) {\n\t\tif ( key === property ) {\n\t\t\tdelete object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tremovePropertyFromObject( object[ key ], property );\n\t\t}\n\t}\n\treturn object;\n}\n\n/**\n * Fetches the current theme style variations that contain only the specified property\n * and merges them with the user config.\n *\n * @param {Object} props Object of hook args.\n * @param {string} props.property The property to filter by.\n * @return {Object[]|*} The merged object.\n */\nexport function useCurrentMergeThemeStyleVariationsWithUserConfig( {\n\tproperty,\n} ) {\n\tconst { variationsFromTheme } = useSelect( ( select ) => {\n\t\tconst _variationsFromTheme =\n\t\t\tselect(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\n\t\treturn {\n\t\t\tvariationsFromTheme: _variationsFromTheme || [],\n\t\t};\n\t}, [] );\n\tconst { user: userVariation } = useContext( GlobalStylesContext );\n\n\treturn useMemo( () => {\n\t\tconst clonedUserVariation = cloneDeep( userVariation );\n\n\t\t// Get user variation and remove the settings for the given property.\n\t\tconst userVariationWithoutProperty = removePropertyFromObject(\n\t\t\tclonedUserVariation,\n\t\t\tproperty\n\t\t);\n\t\tuserVariationWithoutProperty.title = __( 'Default' );\n\n\t\tconst variationsWithSinglePropertyAndBase = variationsFromTheme\n\t\t\t.filter( ( variation ) => {\n\t\t\t\treturn isVariationWithSingleProperty( variation, property );\n\t\t\t} )\n\t\t\t.map( ( variation ) => {\n\t\t\t\treturn mergeBaseAndUserConfigs(\n\t\t\t\t\tuserVariationWithoutProperty,\n\t\t\t\t\tvariation\n\t\t\t\t);\n\t\t\t} );\n\n\t\treturn [\n\t\t\tuserVariationWithoutProperty,\n\t\t\t...variationsWithSinglePropertyAndBase,\n\t\t];\n\t}, [ property, userVariation, variationsFromTheme ] );\n}\n\n/**\n * Returns a new object, with properties specified in `property`,\n * maintain the original object tree structure.\n * The function is recursive, so it will perform a deep search for the given property.\n * E.g., the function will return `{ a: { b: { c: { test: 1 } } } }` if the property is `test`.\n *\n * @param {Object} object The object to filter\n * @param {Object} property The property to filter by\n * @return {Object} The merged object.\n */\nexport const filterObjectByProperty = ( object, property ) => {\n\tif ( ! object ) {\n\t\treturn {};\n\t}\n\n\tconst newObject = {};\n\tObject.keys( object ).forEach( ( key ) => {\n\t\tif ( key === property ) {\n\t\t\tnewObject[ key ] = object[ key ];\n\t\t} else if ( typeof object[ key ] === 'object' ) {\n\t\t\tconst newFilter = filterObjectByProperty( object[ key ], property );\n\t\t\tif ( Object.keys( newFilter ).length ) {\n\t\t\t\tnewObject[ key ] = newFilter;\n\t\t\t}\n\t\t}\n\t} );\n\treturn newObject;\n};\n\n/**\n * Compares a style variation to the same variation filtered by a single property.\n * Returns true if the variation contains only the property specified.\n *\n * @param {Object} variation The variation to compare.\n * @param {string} property The property to compare.\n * @return {boolean} Whether the variation contains only a single property.\n */\nexport function isVariationWithSingleProperty( variation, property ) {\n\tconst variationWithProperty = filterObjectByProperty(\n\t\tcloneDeep( variation ),\n\t\tproperty\n\t);\n\n\treturn (\n\t\tJSON.stringify( variationWithProperty?.styles ) ===\n\t\t\tJSON.stringify( variation?.styles ) &&\n\t\tJSON.stringify( variationWithProperty?.settings ) ===\n\t\t\tJSON.stringify( variation?.settings )\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;AACxD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASD,WAAW,IAAIE,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,SAAS,MAAM,wBAAwB;AAC9C,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC;AAAoB,CAAC,GAAGD,MAAM,CAAEJ,sBAAuB,CAAC;AAChE,MAAM;EAAEM;AAAwB,CAAC,GAAGF,MAAM,CAAEH,iBAAkB,CAAC;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,wBAAwBA,CAAEC,MAAM,EAAEC,QAAQ,EAAG;EAC5D,IAAK,CAAEA,QAAQ,IAAI,OAAOA,QAAQ,KAAK,QAAQ,EAAG;IACjD,OAAOD,MAAM;EACd;EAEA,IACC,OAAOA,MAAM,KAAK,QAAQ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AC9CF,IAAI,CAACC,SAAS,CAAET,SAAS,EAAEU,MAAO,CAAC,IACpCF,IAAI,CAACC,SAAS,CAAEF,qBAAqB,EAAEI,QAAS,CAAC,KAChDH,IAAI,CAACC,SAAS,CAAET,SAAS,EAAEW,QAAS,CAAC;AAExC","ignoreList":[]}
@@ -5,7 +5,7 @@ import { store as blocksStore } from '@wordpress/blocks';
5
5
  import { registerCoreBlocks, __experimentalGetCoreBlocks, __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';
6
6
  import { dispatch } from '@wordpress/data';
7
7
  import deprecated from '@wordpress/deprecated';
8
- import { createRoot } from '@wordpress/element';
8
+ import { createRoot, StrictMode } from '@wordpress/element';
9
9
  import { store as editorStore } from '@wordpress/editor';
10
10
  import { store as preferencesStore } from '@wordpress/preferences';
11
11
  import { registerLegacyWidgetBlock, registerWidgetGroupBlock } from '@wordpress/widgets';
@@ -79,7 +79,9 @@ export function initializeEditor(id, settings) {
79
79
  // Prevent the default browser action for files dropped outside of dropzones.
80
80
  window.addEventListener('dragover', e => e.preventDefault(), false);
81
81
  window.addEventListener('drop', e => e.preventDefault(), false);
82
- root.render( /*#__PURE__*/_jsx(App, {}));
82
+ root.render( /*#__PURE__*/_jsx(StrictMode, {
83
+ children: /*#__PURE__*/_jsx(App, {})
84
+ }));
83
85
  return root;
84
86
  }
85
87
  export function reinitializeEditor() {
@@ -91,4 +93,8 @@ export function reinitializeEditor() {
91
93
  export { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';
92
94
  export { store } from './store';
93
95
  export * from './deprecated';
96
+
97
+ // Temporary: While the posts dashboard is being iterated on
98
+ // it's being built in the same package as the site editor.
99
+ export { initializePostsDashboard } from './posts';
94
100
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","editorStore","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","App","jsx","_jsx","initializeEditor","id","settings","target","document","getElementById","root","reapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","globalThis","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","editorMode","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","reinitializeEditor","since","version","default","PluginTemplateSettingPanel"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t} );\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render( <App /> );\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\nexport * from './deprecated';\n"],"mappings":"AAAA;AACA;AACA;AACA,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CmD,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;AAEA,SAASC,OAAO,IAAIC,0BAA0B,QAAQ,4CAA4C;AAClG,SAAS5D,KAAK,QAAQ,SAAS;AAC/B,cAAc,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["store","blocksStore","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","dispatch","deprecated","createRoot","StrictMode","editorStore","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","editSiteStore","App","jsx","_jsx","initializeEditor","id","settings","target","document","getElementById","root","reapplyBlockTypeFilters","coreBlocks","filter","name","setFreeformFallbackBlockName","inserter","globalThis","IS_GUTENBERG_PLUGIN","enableFSEBlocks","setDefaults","welcomeGuide","welcomeGuideStyles","welcomeGuidePage","welcomeGuideTemplate","allowRightClickOverrides","distractionFree","editorMode","fixedToolbar","focusMode","inactivePanels","keepCaretInsideBlock","openPanels","showBlockBreadcrumbs","showListViewByDefault","updateSettings","updateEditorSettings","defaultTemplateTypes","defaultTemplatePartAreas","window","addEventListener","e","preventDefault","render","children","reinitializeEditor","since","version","default","PluginTemplateSettingPanel","initializePostsDashboard"],"sources":["@wordpress/edit-site/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport { store as editSiteStore } from './store';\nimport App from './components/app';\n\n/**\n * Initializes the site editor screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter(\n\t\t( { name } ) => name !== 'core/freeform'\n\t);\n\tregisterCoreBlocks( coreBlocks );\n\tdispatch( blocksStore ).setFreeformFallbackBlockName( 'core/html' );\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: true,\n\t\t} );\n\t}\n\n\t// We dispatch actions and update the store synchronously before rendering\n\t// so that we won't trigger unnecessary re-renders with useEffect.\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-site', {\n\t\twelcomeGuide: true,\n\t\twelcomeGuideStyles: true,\n\t\twelcomeGuidePage: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\tdistractionFree: false,\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfocusMode: false,\n\t\tinactivePanels: [],\n\t\tkeepCaretInsideBlock: false,\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowListViewByDefault: false,\n\t} );\n\n\tdispatch( editSiteStore ).updateSettings( settings );\n\n\t// Keep the defaultTemplateTypes in the core/editor settings too,\n\t// so that they can be selected with core/editor selectors in any editor.\n\t// This is needed because edit-site doesn't initialize with EditorProvider,\n\t// which internally uses updateEditorSettings as well.\n\tdispatch( editorStore ).updateEditorSettings( {\n\t\tdefaultTemplateTypes: settings.defaultTemplateTypes,\n\t\tdefaultTemplatePartAreas: settings.defaultTemplatePartAreas,\n\t} );\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<App />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editSite.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginTemplateSettingPanel } from './components/plugin-template-setting-panel';\nexport { store } from './store';\nexport * from './deprecated';\n\n// Temporary: While the posts dashboard is being iterated on\n// it's being built in the same package as the site editor.\nexport { initializePostsDashboard } from './posts';\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SAASR,KAAK,IAAIS,WAAW,QAAQ,mBAAmB;AACxD,SAAST,KAAK,IAAIU,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,yBAAyB,EACzBC,wBAAwB,QAClB,oBAAoB;;AAE3B;AACA;AACA;AACA,OAAO,SAAS;AAChB,SAASZ,KAAK,IAAIa,aAAa,QAAQ,SAAS;AAChD,OAAOC,GAAG,MAAM,kBAAkB;;AAElC;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,GAAA,IAAAC,IAAA;AAMA,OAAO,SAASC,gBAAgBA,CAAEC,EAAE,EAAEC,QAAQ,EAAG;EAChD,MAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAc,CAAEJ,EAAG,CAAC;EAC5C,MAAMK,IAAI,GAAGhB,UAAU,CAAEa,MAAO,CAAC;EAEjCf,QAAQ,CAAEJ,WAAY,CAAC,CAACu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,CAAC+B,oBAAoB;IACnDC,wBAAwB,EAAEhC,QAAQ,CAACgC;EACpC,CAAE,CAAC;;EAEH;EACAC,MAAM,CAACC,gBAAgB,CAAE,UAAU,EAAIC,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EACzEH,MAAM,CAACC,gBAAgB,CAAE,MAAM,EAAIC,CAAC,IAAMA,CAAC,CAACC,cAAc,CAAC,CAAC,EAAE,KAAM,CAAC;EAErEhC,IAAI,CAACiC,MAAM,eACVxC,IAAA,CAACR,UAAU;IAAAiD,QAAA,eACVzC,IAAA,CAACF,GAAG,IAAE;EAAC,CACI,CACb,CAAC;EAED,OAAOS,IAAI;AACZ;AAEA,OAAO,SAASmC,kBAAkBA,CAAA,EAAG;EACpCpD,UAAU,CAAE,gCAAgC,EAAE;IAC7CqD,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;AAEA,SAASC,OAAO,IAAIC,0BAA0B,QAAQ,4CAA4C;AAClG,SAAS9D,KAAK,QAAQ,SAAS;AAC/B,cAAc,cAAc;;AAE5B;AACA;AACA,SAAS+D,wBAAwB,QAAQ,SAAS","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { createRoot, StrictMode } from '@wordpress/element';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import PostsApp from './components/posts-app';
10
+
11
+ /**
12
+ * Initializes the "Posts Dashboard"
13
+ * @param {string} id DOM element id.
14
+ */
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ export function initializePostsDashboard(id) {
17
+ if (!globalThis.IS_GUTENBERG_PLUGIN) {
18
+ return;
19
+ }
20
+ const target = document.getElementById(id);
21
+ const root = createRoot(target);
22
+ root.render( /*#__PURE__*/_jsx(StrictMode, {
23
+ children: /*#__PURE__*/_jsx(PostsApp, {})
24
+ }));
25
+ return root;
26
+ }
27
+ //# sourceMappingURL=posts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createRoot","StrictMode","PostsApp","jsx","_jsx","initializePostsDashboard","id","globalThis","IS_GUTENBERG_PLUGIN","target","document","getElementById","root","render","children"],"sources":["@wordpress/edit-site/src/posts.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRoot, StrictMode } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport PostsApp from './components/posts-app';\n\n/**\n * Initializes the \"Posts Dashboard\"\n * @param {string} id DOM element id.\n */\nexport function initializePostsDashboard( id ) {\n\tif ( ! globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\treturn;\n\t}\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<PostsApp />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;;AAE3D;AACA;AACA;AACA,OAAOC,QAAQ,MAAM,wBAAwB;;AAE7C;AACA;AACA;AACA;AAHA,SAAAC,GAAA,IAAAC,IAAA;AAIA,OAAO,SAASC,wBAAwBA,CAAEC,EAAE,EAAG;EAC9C,IAAK,CAAEC,UAAU,CAACC,mBAAmB,EAAG;IACvC;EACD;EACA,MAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAc,CAAEL,EAAG,CAAC;EAC5C,MAAMM,IAAI,GAAGZ,UAAU,CAAES,MAAO,CAAC;EAEjCG,IAAI,CAACC,MAAM,eACVT,IAAA,CAACH,UAAU;IAAAa,QAAA,eACVV,IAAA,CAACF,QAAQ,IAAE;EAAC,CACD,CACb,CAAC;EAED,OAAOU,IAAI;AACZ","ignoreList":[]}