@wordpress/editor 14.41.0 → 14.41.1-next.v.202603102151.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 (207) hide show
  1. package/build/components/collab-sidebar/index.cjs +7 -4
  2. package/build/components/collab-sidebar/index.cjs.map +2 -2
  3. package/build/components/collab-sidebar/utils.cjs +13 -15
  4. package/build/components/collab-sidebar/utils.cjs.map +2 -2
  5. package/build/components/collaborators-overlay/avatar-iframe-styles.cjs +133 -0
  6. package/build/components/collaborators-overlay/avatar-iframe-styles.cjs.map +7 -0
  7. package/build/components/collaborators-overlay/collaborator-styles.cjs +38 -2
  8. package/build/components/collaborators-overlay/collaborator-styles.cjs.map +2 -2
  9. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs +142 -0
  10. package/build/components/collaborators-overlay/overlay-iframe-styles.cjs.map +7 -0
  11. package/build/components/collaborators-overlay/overlay.cjs +59 -201
  12. package/build/components/collaborators-overlay/overlay.cjs.map +3 -3
  13. package/build/components/collaborators-overlay/use-block-highlighting.cjs +91 -42
  14. package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +2 -2
  15. package/build/components/collaborators-overlay/use-debounced-recompute.cjs +49 -0
  16. package/build/components/collaborators-overlay/use-debounced-recompute.cjs.map +7 -0
  17. package/build/components/collaborators-overlay/use-render-cursors.cjs +49 -50
  18. package/build/components/collaborators-overlay/use-render-cursors.cjs.map +2 -2
  19. package/build/components/collaborators-presence/avatar/component.cjs +121 -0
  20. package/build/components/collaborators-presence/avatar/component.cjs.map +7 -0
  21. package/build/components/collaborators-presence/avatar/index.cjs +37 -0
  22. package/build/components/collaborators-presence/avatar/index.cjs.map +7 -0
  23. package/build/components/collaborators-presence/avatar/types.cjs +19 -0
  24. package/build/components/collaborators-presence/avatar/types.cjs.map +7 -0
  25. package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs +44 -0
  26. package/build/components/collaborators-presence/avatar/use-image-loading-status.cjs.map +7 -0
  27. package/build/components/collaborators-presence/avatar-group/component.cjs +78 -0
  28. package/build/components/collaborators-presence/avatar-group/component.cjs.map +7 -0
  29. package/build/components/collaborators-presence/avatar-group/index.cjs +37 -0
  30. package/build/components/collaborators-presence/avatar-group/index.cjs.map +7 -0
  31. package/build/components/collaborators-presence/avatar-group/types.cjs +19 -0
  32. package/build/components/collaborators-presence/avatar-group/types.cjs.map +7 -0
  33. package/build/components/collaborators-presence/index.cjs +17 -6
  34. package/build/components/collaborators-presence/index.cjs.map +3 -3
  35. package/build/components/collaborators-presence/list.cjs +20 -17
  36. package/build/components/collaborators-presence/list.cjs.map +3 -3
  37. package/build/components/entities-saved-states/hooks/use-is-dirty.cjs +14 -5
  38. package/build/components/entities-saved-states/hooks/use-is-dirty.cjs.map +2 -2
  39. package/build/components/global-styles/index.cjs +15 -24
  40. package/build/components/global-styles/index.cjs.map +3 -3
  41. package/build/components/global-styles-sidebar/index.cjs +6 -3
  42. package/build/components/global-styles-sidebar/index.cjs.map +2 -2
  43. package/build/components/page-attributes/parent.cjs +1 -0
  44. package/build/components/page-attributes/parent.cjs.map +2 -2
  45. package/build/components/post-revisions-preview/revisions-canvas.cjs +17 -4
  46. package/build/components/post-revisions-preview/revisions-canvas.cjs.map +2 -2
  47. package/build/components/post-url/panel.cjs +1 -0
  48. package/build/components/post-url/panel.cjs.map +2 -2
  49. package/build/components/provider/use-block-editor-settings.cjs +4 -1
  50. package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
  51. package/build/components/sidebar/dataform-post-summary.cjs +167 -0
  52. package/build/components/sidebar/dataform-post-summary.cjs.map +7 -0
  53. package/build/components/sidebar/post-summary.cjs +11 -0
  54. package/build/components/sidebar/post-summary.cjs.map +3 -3
  55. package/build/components/visual-editor/index.cjs +1 -1
  56. package/build/components/visual-editor/index.cjs.map +2 -2
  57. package/build/dataviews/store/private-actions.cjs +4 -0
  58. package/build/dataviews/store/private-actions.cjs.map +2 -2
  59. package/build/utils/media-upload/on-success.cjs +46 -0
  60. package/build/utils/media-upload/on-success.cjs.map +7 -0
  61. package/build-module/components/collab-sidebar/index.mjs +7 -4
  62. package/build-module/components/collab-sidebar/index.mjs.map +2 -2
  63. package/build-module/components/collab-sidebar/utils.mjs +13 -15
  64. package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
  65. package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs +120 -0
  66. package/build-module/components/collaborators-overlay/avatar-iframe-styles.mjs.map +7 -0
  67. package/build-module/components/collaborators-overlay/collaborator-styles.mjs +25 -1
  68. package/build-module/components/collaborators-overlay/collaborator-styles.mjs.map +2 -2
  69. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs +124 -0
  70. package/build-module/components/collaborators-overlay/overlay-iframe-styles.mjs.map +7 -0
  71. package/build-module/components/collaborators-overlay/overlay.mjs +49 -201
  72. package/build-module/components/collaborators-overlay/overlay.mjs.map +2 -2
  73. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs +92 -43
  74. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +2 -2
  75. package/build-module/components/collaborators-overlay/use-debounced-recompute.mjs +24 -0
  76. package/build-module/components/collaborators-overlay/use-debounced-recompute.mjs.map +7 -0
  77. package/build-module/components/collaborators-overlay/use-render-cursors.mjs +50 -51
  78. package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
  79. package/build-module/components/collaborators-presence/avatar/component.mjs +90 -0
  80. package/build-module/components/collaborators-presence/avatar/component.mjs.map +7 -0
  81. package/build-module/components/collaborators-presence/avatar/index.mjs +6 -0
  82. package/build-module/components/collaborators-presence/avatar/index.mjs.map +7 -0
  83. package/build-module/components/collaborators-presence/avatar/types.mjs +1 -0
  84. package/build-module/components/collaborators-presence/avatar/types.mjs.map +7 -0
  85. package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs +19 -0
  86. package/build-module/components/collaborators-presence/avatar/use-image-loading-status.mjs.map +7 -0
  87. package/build-module/components/collaborators-presence/avatar-group/component.mjs +47 -0
  88. package/build-module/components/collaborators-presence/avatar-group/component.mjs.map +7 -0
  89. package/build-module/components/collaborators-presence/avatar-group/index.mjs +6 -0
  90. package/build-module/components/collaborators-presence/avatar-group/index.mjs.map +7 -0
  91. package/build-module/components/collaborators-presence/avatar-group/types.mjs +1 -0
  92. package/build-module/components/collaborators-presence/avatar-group/types.mjs.map +7 -0
  93. package/build-module/components/collaborators-presence/index.mjs +7 -9
  94. package/build-module/components/collaborators-presence/index.mjs.map +2 -2
  95. package/build-module/components/collaborators-presence/list.mjs +11 -22
  96. package/build-module/components/collaborators-presence/list.mjs.map +2 -2
  97. package/build-module/components/entities-saved-states/hooks/use-is-dirty.mjs +14 -5
  98. package/build-module/components/entities-saved-states/hooks/use-is-dirty.mjs.map +2 -2
  99. package/build-module/components/global-styles/index.mjs +15 -24
  100. package/build-module/components/global-styles/index.mjs.map +2 -2
  101. package/build-module/components/global-styles-sidebar/index.mjs +6 -3
  102. package/build-module/components/global-styles-sidebar/index.mjs.map +2 -2
  103. package/build-module/components/page-attributes/parent.mjs +1 -0
  104. package/build-module/components/page-attributes/parent.mjs.map +2 -2
  105. package/build-module/components/post-revisions-preview/revisions-canvas.mjs +17 -4
  106. package/build-module/components/post-revisions-preview/revisions-canvas.mjs.map +2 -2
  107. package/build-module/components/post-url/panel.mjs +1 -0
  108. package/build-module/components/post-url/panel.mjs.map +2 -2
  109. package/build-module/components/provider/use-block-editor-settings.mjs +4 -1
  110. package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
  111. package/build-module/components/sidebar/dataform-post-summary.mjs +136 -0
  112. package/build-module/components/sidebar/dataform-post-summary.mjs.map +7 -0
  113. package/build-module/components/sidebar/post-summary.mjs +11 -0
  114. package/build-module/components/sidebar/post-summary.mjs.map +2 -2
  115. package/build-module/components/visual-editor/index.mjs +1 -1
  116. package/build-module/components/visual-editor/index.mjs.map +2 -2
  117. package/build-module/dataviews/store/private-actions.mjs +8 -1
  118. package/build-module/dataviews/store/private-actions.mjs.map +2 -2
  119. package/build-module/utils/media-upload/on-success.mjs +25 -0
  120. package/build-module/utils/media-upload/on-success.mjs.map +7 -0
  121. package/build-style/style-rtl.css +876 -137
  122. package/build-style/style.css +876 -137
  123. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  124. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
  125. package/build-types/components/collaborators-overlay/avatar-iframe-styles.d.ts +11 -0
  126. package/build-types/components/collaborators-overlay/avatar-iframe-styles.d.ts.map +1 -0
  127. package/build-types/components/collaborators-overlay/collaborator-styles.d.ts +17 -2
  128. package/build-types/components/collaborators-overlay/collaborator-styles.d.ts.map +1 -1
  129. package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts +6 -0
  130. package/build-types/components/collaborators-overlay/overlay-iframe-styles.d.ts.map +1 -0
  131. package/build-types/components/collaborators-overlay/overlay.d.ts.map +1 -1
  132. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts +21 -5
  133. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts.map +1 -1
  134. package/build-types/components/collaborators-overlay/use-debounced-recompute.d.ts +10 -0
  135. package/build-types/components/collaborators-overlay/use-debounced-recompute.d.ts.map +1 -0
  136. package/build-types/components/collaborators-overlay/use-render-cursors.d.ts +2 -1
  137. package/build-types/components/collaborators-overlay/use-render-cursors.d.ts.map +1 -1
  138. package/build-types/components/collaborators-presence/avatar/component.d.ts +7 -0
  139. package/build-types/components/collaborators-presence/avatar/component.d.ts.map +1 -0
  140. package/build-types/components/collaborators-presence/avatar/index.d.ts +3 -0
  141. package/build-types/components/collaborators-presence/avatar/index.d.ts.map +1 -0
  142. package/build-types/components/collaborators-presence/avatar/types.d.ts +66 -0
  143. package/build-types/components/collaborators-presence/avatar/types.d.ts.map +1 -0
  144. package/build-types/components/collaborators-presence/avatar/use-image-loading-status.d.ts +17 -0
  145. package/build-types/components/collaborators-presence/avatar/use-image-loading-status.d.ts.map +1 -0
  146. package/build-types/components/collaborators-presence/avatar-group/component.d.ts +7 -0
  147. package/build-types/components/collaborators-presence/avatar-group/component.d.ts.map +1 -0
  148. package/build-types/components/collaborators-presence/avatar-group/index.d.ts +3 -0
  149. package/build-types/components/collaborators-presence/avatar-group/index.d.ts.map +1 -0
  150. package/build-types/components/collaborators-presence/avatar-group/types.d.ts +14 -0
  151. package/build-types/components/collaborators-presence/avatar-group/types.d.ts.map +1 -0
  152. package/build-types/components/collaborators-presence/index.d.ts.map +1 -1
  153. package/build-types/components/collaborators-presence/list.d.ts.map +1 -1
  154. package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts.map +1 -1
  155. package/build-types/components/global-styles/index.d.ts +2 -1
  156. package/build-types/components/global-styles/index.d.ts.map +1 -1
  157. package/build-types/components/global-styles-sidebar/index.d.ts.map +1 -1
  158. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  159. package/build-types/components/post-author/hook.d.ts +1 -1
  160. package/build-types/components/post-revisions-preview/revisions-canvas.d.ts.map +1 -1
  161. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  162. package/build-types/components/sidebar/dataform-post-summary.d.ts +4 -0
  163. package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -0
  164. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  165. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  166. package/build-types/utils/media-upload/on-success.d.ts +9 -0
  167. package/build-types/utils/media-upload/on-success.d.ts.map +1 -0
  168. package/package.json +45 -44
  169. package/src/components/collab-sidebar/index.js +7 -4
  170. package/src/components/collab-sidebar/utils.js +9 -10
  171. package/src/components/collaborators-overlay/avatar-iframe-styles.ts +126 -0
  172. package/src/components/collaborators-overlay/collaborator-styles.ts +43 -2
  173. package/src/components/collaborators-overlay/overlay-iframe-styles.ts +125 -0
  174. package/src/components/collaborators-overlay/overlay.tsx +54 -207
  175. package/src/components/collaborators-overlay/use-block-highlighting.ts +147 -64
  176. package/src/components/collaborators-overlay/use-debounced-recompute.ts +32 -0
  177. package/src/components/collaborators-overlay/use-render-cursors.ts +72 -66
  178. package/src/components/collaborators-presence/avatar/component.tsx +123 -0
  179. package/src/components/collaborators-presence/avatar/index.ts +2 -0
  180. package/src/components/collaborators-presence/avatar/styles.scss +168 -0
  181. package/src/components/collaborators-presence/avatar/test/index.tsx +389 -0
  182. package/src/components/collaborators-presence/avatar/types.ts +66 -0
  183. package/src/components/collaborators-presence/avatar/use-image-loading-status.ts +36 -0
  184. package/src/components/collaborators-presence/avatar-group/component.tsx +55 -0
  185. package/src/components/collaborators-presence/avatar-group/index.ts +2 -0
  186. package/src/components/collaborators-presence/avatar-group/styles.scss +33 -0
  187. package/src/components/collaborators-presence/avatar-group/test/index.tsx +139 -0
  188. package/src/components/collaborators-presence/avatar-group/types.ts +13 -0
  189. package/src/components/collaborators-presence/index.tsx +4 -6
  190. package/src/components/collaborators-presence/list.tsx +7 -17
  191. package/src/components/collaborators-presence/styles/collaborators-list.scss +26 -19
  192. package/src/components/collaborators-presence/styles/collaborators-presence.scss +6 -2
  193. package/src/components/entities-saved-states/hooks/use-is-dirty.js +14 -5
  194. package/src/components/global-styles/index.js +20 -27
  195. package/src/components/global-styles-sidebar/index.js +3 -0
  196. package/src/components/page-attributes/parent.js +1 -0
  197. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  198. package/src/components/post-revisions-preview/revisions-canvas.js +15 -6
  199. package/src/components/post-url/panel.js +1 -0
  200. package/src/components/post-url/style.scss +5 -0
  201. package/src/components/provider/use-block-editor-settings.js +5 -0
  202. package/src/components/sidebar/dataform-post-summary.js +149 -0
  203. package/src/components/sidebar/post-summary.js +15 -0
  204. package/src/components/visual-editor/index.js +1 -1
  205. package/src/dataviews/store/private-actions.ts +14 -0
  206. package/src/style.scss +3 -0
  207. package/src/utils/media-upload/on-success.js +34 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/components/collaborators-presence/avatar/use-image-loading-status.ts"],
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useCallback, useState } from '@wordpress/element';\n\nexport type ImageLoadingStatus = 'idle' | 'loading' | 'loaded' | 'error';\n\n/**\n * Tracks the loading status of an image URL. Returns the current status and\n * `onLoad`/`onError` callbacks to attach to the `<img>` element.\n *\n * Unlike a side-channel `new Image()` preloader, this hook relies on the\n * native `<img>` element's own events, which avoids cross-browser issues\n * with Safari's privacy features blocking programmatic image requests.\n *\n * @param src - The image URL. When falsy, status is `'idle'`.\n */\nexport function useImageLoadingStatus( src?: string ) {\n\tconst [ prevSrc, setPrevSrc ] = useState( src );\n\tconst [ status, setStatus ] = useState< ImageLoadingStatus >(\n\t\tsrc ? 'loading' : 'idle'\n\t);\n\n\t// Synchronous reset when src changes \u2014 runs during render, not after\n\t// commit, so a cached image's `load` event cannot sneak in before\n\t// the reset and get overwritten.\n\tif ( prevSrc !== src ) {\n\t\tsetPrevSrc( src );\n\t\tsetStatus( src ? 'loading' : 'idle' );\n\t}\n\n\tconst handleLoad = useCallback( () => setStatus( 'loaded' ), [] );\n\tconst handleError = useCallback( () => setStatus( 'error' ), [] );\n\n\treturn { status, handleLoad, handleError };\n}\n"],
5
+ "mappings": ";AAGA,SAAS,aAAa,gBAAgB;AAc/B,SAAS,sBAAuB,KAAe;AACrD,QAAM,CAAE,SAAS,UAAW,IAAI,SAAU,GAAI;AAC9C,QAAM,CAAE,QAAQ,SAAU,IAAI;AAAA,IAC7B,MAAM,YAAY;AAAA,EACnB;AAKA,MAAK,YAAY,KAAM;AACtB,eAAY,GAAI;AAChB,cAAW,MAAM,YAAY,MAAO;AAAA,EACrC;AAEA,QAAM,aAAa,YAAa,MAAM,UAAW,QAAS,GAAG,CAAC,CAAE;AAChE,QAAM,cAAc,YAAa,MAAM,UAAW,OAAQ,GAAG,CAAC,CAAE;AAEhE,SAAO,EAAE,QAAQ,YAAY,YAAY;AAC1C;",
6
+ "names": []
7
+ }
@@ -0,0 +1,47 @@
1
+ // packages/editor/src/components/collaborators-presence/avatar-group/component.tsx
2
+ import clsx from "clsx";
3
+ import { Children } from "@wordpress/element";
4
+ import { sprintf, _n } from "@wordpress/i18n";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ function AvatarGroup({
7
+ className,
8
+ max = 3,
9
+ children,
10
+ ...props
11
+ }) {
12
+ const childArray = Children.toArray(children);
13
+ const visible = childArray.slice(0, max);
14
+ const overflowCount = childArray.length - max;
15
+ return /* @__PURE__ */ jsxs(
16
+ "div",
17
+ {
18
+ role: "group",
19
+ className: clsx("editor-avatar-group", className),
20
+ ...props,
21
+ children: [
22
+ visible,
23
+ overflowCount > 0 && /* @__PURE__ */ jsx(
24
+ "span",
25
+ {
26
+ className: "editor-avatar-group__overflow",
27
+ "aria-label": sprintf(
28
+ /* translators: %d: number of additional collaborators not shown */
29
+ _n(
30
+ "%d more collaborator",
31
+ "%d more collaborators",
32
+ overflowCount
33
+ ),
34
+ overflowCount
35
+ ),
36
+ children: `+${overflowCount}`
37
+ }
38
+ )
39
+ ]
40
+ }
41
+ );
42
+ }
43
+ var component_default = AvatarGroup;
44
+ export {
45
+ component_default as default
46
+ };
47
+ //# sourceMappingURL=component.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/components/collaborators-presence/avatar-group/component.tsx"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Children } from '@wordpress/element';\nimport { sprintf, _n } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type { AvatarGroupProps } from './types';\n\nfunction AvatarGroup( {\n\tclassName,\n\tmax = 3,\n\tchildren,\n\t...props\n}: AvatarGroupProps &\n\tOmit< React.HTMLAttributes< HTMLDivElement >, keyof AvatarGroupProps > ) {\n\tconst childArray = Children.toArray( children );\n\tconst visible = childArray.slice( 0, max );\n\tconst overflowCount = childArray.length - max;\n\n\treturn (\n\t\t<div\n\t\t\trole=\"group\"\n\t\t\tclassName={ clsx( 'editor-avatar-group', className ) }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ visible }\n\t\t\t{ overflowCount > 0 && (\n\t\t\t\t<span\n\t\t\t\t\tclassName=\"editor-avatar-group__overflow\"\n\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of additional collaborators not shown */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d more collaborator',\n\t\t\t\t\t\t\t'%d more collaborators',\n\t\t\t\t\t\t\toverflowCount\n\t\t\t\t\t\t),\n\t\t\t\t\t\toverflowCount\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ `+${ overflowCount }` }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default AvatarGroup;\n"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,gBAAgB;AACzB,SAAS,SAAS,UAAU;AAmB1B,SAOE,KAPF;AAZF,SAAS,YAAa;AAAA,EACrB;AAAA,EACA,MAAM;AAAA,EACN;AAAA,EACA,GAAG;AACJ,GAC0E;AACzE,QAAM,aAAa,SAAS,QAAS,QAAS;AAC9C,QAAM,UAAU,WAAW,MAAO,GAAG,GAAI;AACzC,QAAM,gBAAgB,WAAW,SAAS;AAE1C,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAK;AAAA,MACL,WAAY,KAAM,uBAAuB,SAAU;AAAA,MACjD,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,gBAAgB,KACjB;AAAA,UAAC;AAAA;AAAA,YACA,WAAU;AAAA,YACV,cAAa;AAAA;AAAA,cAEZ;AAAA,gBACC;AAAA,gBACA;AAAA,gBACA;AAAA,cACD;AAAA,cACA;AAAA,YACD;AAAA,YAEE,cAAK,aAAc;AAAA;AAAA,QACtB;AAAA;AAAA;AAAA,EAEF;AAEF;AAEA,IAAO,oBAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,6 @@
1
+ // packages/editor/src/components/collaborators-presence/avatar-group/index.ts
2
+ import { default as default2 } from "./component.mjs";
3
+ export {
4
+ default2 as default
5
+ };
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/components/collaborators-presence/avatar-group/index.ts"],
4
+ "sourcesContent": ["export { default } from './component';\nexport type { AvatarGroupProps } from './types';\n"],
5
+ "mappings": ";AAAA,SAAS,WAAAA,gBAAe;",
6
+ "names": ["default"]
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,23 +1,22 @@
1
1
  // packages/editor/src/components/collaborators-presence/index.tsx
2
- import {
3
- Button,
4
- privateApis as componentsPrivateApis
5
- } from "@wordpress/components";
2
+ import { Button } from "@wordpress/components";
6
3
  import { useState } from "@wordpress/element";
7
4
  import {
8
5
  privateApis
9
6
  } from "@wordpress/core-data";
10
7
  import { __, sprintf } from "@wordpress/i18n";
8
+ import Avatar from "./avatar/index.mjs";
9
+ import AvatarGroup from "./avatar-group/index.mjs";
11
10
  import { CollaboratorsList } from "./list.mjs";
12
11
  import { unlock } from "../../lock-unlock.mjs";
13
12
  import { getAvatarUrl } from "../collaborators-overlay/get-avatar-url.mjs";
14
13
  import { getAvatarBorderColor } from "../collab-sidebar/utils.mjs";
15
14
 
16
15
  // packages/editor/src/components/collaborators-presence/styles/collaborators-presence.scss
17
- if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='75307c1ddf']")) {
16
+ if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='eee1778bc0']")) {
18
17
  const style = document.createElement("style");
19
- style.setAttribute("data-wp-hash", "75307c1ddf");
20
- style.appendChild(document.createTextNode(".editor-collaborators-presence{align-items:center;background:#f0f0f0;border-radius:4px;display:flex;flex-shrink:0;height:32px;margin-right:8px}.editor-collaborators-presence:hover{background-color:#e0e0e0}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button{align-items:center;background:#0000;border-radius:4px;box-sizing:border-box;color:#2f2f2f;cursor:pointer;display:flex;height:100%;padding:4px;position:relative}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button:hover{background:#0000;color:#2f2f2f}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button.is-pressed,.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button.is-pressed:hover{background:#ddd;color:#2f2f2f}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button:focus:not(:active){box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus,2px) var(--wp-admin-theme-color,#007cba);outline:none}"));
18
+ style.setAttribute("data-wp-hash", "eee1778bc0");
19
+ style.appendChild(document.createTextNode(".editor-collaborators-presence{align-items:center;background:#f0f0f0;border-radius:4px;display:flex;flex-shrink:0;height:32px;margin-right:8px}.editor-collaborators-presence:has(.is-pressed),.editor-collaborators-presence:hover{background-color:#e0e0e0}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button{align-items:center;background:#0000;border-radius:4px;box-sizing:border-box;color:#2f2f2f;cursor:pointer;display:flex;height:100%;padding:4px;position:relative}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button.is-pressed,.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button.is-pressed:hover,.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button:hover{background:#0000;color:#2f2f2f}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button:focus:not(:active){box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus,2px) var(--wp-admin-theme-color,#007cba);outline:none}"));
21
20
  document.head.appendChild(style);
22
21
  }
23
22
 
@@ -25,7 +24,6 @@ if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !docum
25
24
  import { CollaboratorsOverlay } from "../collaborators-overlay/index.mjs";
26
25
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
27
26
  var { useActiveCollaborators } = unlock(privateApis);
28
- var { Avatar, AvatarGroup } = unlock(componentsPrivateApis);
29
27
  function CollaboratorsPresence({
30
28
  postId,
31
29
  postType
@@ -59,7 +57,7 @@ function CollaboratorsPresence({
59
57
  __("Collaborators list, %d online"),
60
58
  otherActiveCollaborators.length
61
59
  ),
62
- children: /* @__PURE__ */ jsx(AvatarGroup, { max: 3, children: otherActiveCollaborators.map(
60
+ children: /* @__PURE__ */ jsx(AvatarGroup, { max: 4, children: otherActiveCollaborators.map(
63
61
  (collaboratorState) => /* @__PURE__ */ jsx(
64
62
  Avatar,
65
63
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/collaborators-presence/index.tsx", "../../../src/components/collaborators-presence/styles/collaborators-presence.scss"],
4
- "sourcesContent": ["import {\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport {\n\tprivateApis,\n\ttype PostEditorAwarenessState,\n} from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\n\nimport { CollaboratorsList } from './list';\nimport { unlock } from '../../lock-unlock';\nimport { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\n\nimport './styles/collaborators-presence.scss';\nimport { CollaboratorsOverlay } from '../collaborators-overlay';\n\nconst { useActiveCollaborators } = unlock( privateApis );\nconst { Avatar, AvatarGroup } = unlock( componentsPrivateApis );\n\ninterface CollaboratorsPresenceProps {\n\tpostId: number | null;\n\tpostType: string | null;\n}\n\n/**\n * Renders a list of avatars for the active collaborators, with a maximum of 3 visible avatars.\n * Shows a popover with all collaborators on hover.\n *\n * @param props CollaboratorsPresence component props\n * @param props.postId ID of the post\n * @param props.postType Type of the post\n */\nexport function CollaboratorsPresence( {\n\tpostId,\n\tpostType,\n}: CollaboratorsPresenceProps ) {\n\tconst activeCollaborators = useActiveCollaborators(\n\t\tpostId,\n\t\tpostType\n\t) as PostEditorAwarenessState[];\n\n\t// Filter out current user - we never show ourselves in the list\n\tconst otherActiveCollaborators = activeCollaborators.filter(\n\t\t( collaborator ) => ! collaborator.isMe\n\t);\n\n\tconst [ isPopoverVisible, setIsPopoverVisible ] = useState( false );\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState< HTMLElement | null >(\n\t\tnull\n\t);\n\n\t// When there are no other collaborators, this component should not render\n\t// at all. This will always be the case when collaboration is not enabled, but\n\t// also when the current user is the only editor with the post open.\n\tif ( otherActiveCollaborators.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"editor-collaborators-presence\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tclassName=\"editor-collaborators-presence__button\"\n\t\t\t\t\tonClick={ () => setIsPopoverVisible( ! isPopoverVisible ) }\n\t\t\t\t\tisPressed={ isPopoverVisible }\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t// translators: %d: number of online collaborators.\n\t\t\t\t\t\t__( 'Collaborators list, %d online' ),\n\t\t\t\t\t\totherActiveCollaborators.length\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<AvatarGroup max={ 3 }>\n\t\t\t\t\t\t{ otherActiveCollaborators.map(\n\t\t\t\t\t\t\t( collaboratorState ) => (\n\t\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\t\tkey={ collaboratorState.clientId }\n\t\t\t\t\t\t\t\t\tsrc={ getAvatarUrl(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo\n\t\t\t\t\t\t\t\t\t\t\t.avatar_urls\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tname={\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.name\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tborderColor={ getAvatarBorderColor(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.id\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AvatarGroup>\n\t\t\t\t</Button>\n\t\t\t\t{ isPopoverVisible && (\n\t\t\t\t\t<CollaboratorsList\n\t\t\t\t\t\tactiveCollaborators={ otherActiveCollaborators }\n\t\t\t\t\t\tpopoverAnchor={ popoverAnchor }\n\t\t\t\t\t\tsetIsPopoverVisible={ setIsPopoverVisible }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<CollaboratorsOverlay postId={ postId } postType={ postType } />\n\t\t</>\n\t);\n}\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='75307c1ddf']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"75307c1ddf\");\n\tstyle.appendChild(document.createTextNode(\".editor-collaborators-presence{align-items:center;background:#f0f0f0;border-radius:4px;display:flex;flex-shrink:0;height:32px;margin-right:8px}.editor-collaborators-presence:hover{background-color:#e0e0e0}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button{align-items:center;background:#0000;border-radius:4px;box-sizing:border-box;color:#2f2f2f;cursor:pointer;display:flex;height:100%;padding:4px;position:relative}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button:hover{background:#0000;color:#2f2f2f}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button.is-pressed,.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button.is-pressed:hover{background:#ddd;color:#2f2f2f}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button:focus:not(:active){box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus,2px) var(--wp-admin-theme-color,#007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AAA;AAAA,YAEZ,GAAI,+BAAgC;AAAA,YACpC,yBAAyB;AAAA,UAC1B;AAAA,UAEA,8BAAC,eAAY,KAAM,GAChB,mCAAyB;AAAA,YAC1B,CAAE,sBACD;AAAA,cAAC;AAAA;AAAA,gBAEA,KAAM;AAAA,kBACL,kBAAkB,iBAChB;AAAA,gBACH;AAAA,gBACA,MACC,kBAAkB,iBAAiB;AAAA,gBAEpC,aAAc;AAAA,kBACb,kBAAkB,iBAAiB;AAAA,gBACpC;AAAA,gBACA,MAAK;AAAA;AAAA,cAXC,kBAAkB;AAAA,YAYzB;AAAA,UAEF,GACD;AAAA;AAAA,MACD;AAAA,MACE,oBACD;AAAA,QAAC;AAAA;AAAA,UACA,qBAAsB;AAAA,UACtB;AAAA,UACA;AAAA;AAAA,MACD;AAAA,OAEF;AAAA,IACA,oBAAC,wBAAqB,QAAkB,UAAsB;AAAA,KAC/D;AAEF;",
4
+ "sourcesContent": ["import { Button } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport {\n\tprivateApis,\n\ttype PostEditorAwarenessState,\n} from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\n\nimport Avatar from './avatar';\nimport AvatarGroup from './avatar-group';\nimport { CollaboratorsList } from './list';\nimport { unlock } from '../../lock-unlock';\nimport { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\n\nimport './styles/collaborators-presence.scss';\nimport { CollaboratorsOverlay } from '../collaborators-overlay';\n\nconst { useActiveCollaborators } = unlock( privateApis );\n\ninterface CollaboratorsPresenceProps {\n\tpostId: number | null;\n\tpostType: string | null;\n}\n\n/**\n * Renders a list of avatars for the active collaborators, with a maximum of 3 visible avatars.\n * Shows a popover with all collaborators on hover.\n *\n * @param props CollaboratorsPresence component props\n * @param props.postId ID of the post\n * @param props.postType Type of the post\n */\nexport function CollaboratorsPresence( {\n\tpostId,\n\tpostType,\n}: CollaboratorsPresenceProps ) {\n\tconst activeCollaborators = useActiveCollaborators(\n\t\tpostId,\n\t\tpostType\n\t) as PostEditorAwarenessState[];\n\n\t// Filter out current user - we never show ourselves in the list\n\tconst otherActiveCollaborators = activeCollaborators.filter(\n\t\t( collaborator ) => ! collaborator.isMe\n\t);\n\n\tconst [ isPopoverVisible, setIsPopoverVisible ] = useState( false );\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState< HTMLElement | null >(\n\t\tnull\n\t);\n\n\t// When there are no other collaborators, this component should not render\n\t// at all. This will always be the case when collaboration is not enabled, but\n\t// also when the current user is the only editor with the post open.\n\tif ( otherActiveCollaborators.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"editor-collaborators-presence\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tclassName=\"editor-collaborators-presence__button\"\n\t\t\t\t\tonClick={ () => setIsPopoverVisible( ! isPopoverVisible ) }\n\t\t\t\t\tisPressed={ isPopoverVisible }\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t// translators: %d: number of online collaborators.\n\t\t\t\t\t\t__( 'Collaborators list, %d online' ),\n\t\t\t\t\t\totherActiveCollaborators.length\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<AvatarGroup max={ 4 }>\n\t\t\t\t\t\t{ otherActiveCollaborators.map(\n\t\t\t\t\t\t\t( collaboratorState ) => (\n\t\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\t\tkey={ collaboratorState.clientId }\n\t\t\t\t\t\t\t\t\tsrc={ getAvatarUrl(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo\n\t\t\t\t\t\t\t\t\t\t\t.avatar_urls\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tname={\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.name\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tborderColor={ getAvatarBorderColor(\n\t\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.id\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AvatarGroup>\n\t\t\t\t</Button>\n\t\t\t\t{ isPopoverVisible && (\n\t\t\t\t\t<CollaboratorsList\n\t\t\t\t\t\tactiveCollaborators={ otherActiveCollaborators }\n\t\t\t\t\t\tpopoverAnchor={ popoverAnchor }\n\t\t\t\t\t\tsetIsPopoverVisible={ setIsPopoverVisible }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<CollaboratorsOverlay postId={ postId } postType={ postType } />\n\t\t</>\n\t);\n}\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='eee1778bc0']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"eee1778bc0\");\n\tstyle.appendChild(document.createTextNode(\".editor-collaborators-presence{align-items:center;background:#f0f0f0;border-radius:4px;display:flex;flex-shrink:0;height:32px;margin-right:8px}.editor-collaborators-presence:has(.is-pressed),.editor-collaborators-presence:hover{background-color:#e0e0e0}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button{align-items:center;background:#0000;border-radius:4px;box-sizing:border-box;color:#2f2f2f;cursor:pointer;display:flex;height:100%;padding:4px;position:relative}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button.is-pressed,.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button.is-pressed:hover,.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button:hover{background:#0000;color:#2f2f2f}.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button:focus:not(:active){box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus,2px) var(--wp-admin-theme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AAAA,YACpC,yBAAyB;AAAA,UAC1B;AAAA,UAEA,8BAAC,eAAY,KAAM,GAChB,mCAAyB;AAAA,YAC1B,CAAE,sBACD;AAAA,cAAC;AAAA;AAAA,gBAEA,KAAM;AAAA,kBACL,kBAAkB,iBAChB;AAAA,gBACH;AAAA,gBACA,MACC,kBAAkB,iBAAiB;AAAA,gBAEpC,aAAc;AAAA,kBACb,kBAAkB,iBAAiB;AAAA,gBACpC;AAAA,gBACA,MAAK;AAAA;AAAA,cAXC,kBAAkB;AAAA,YAYzB;AAAA,UAEF,GACD;AAAA;AAAA,MACD;AAAA,MACE,oBACD;AAAA,QAAC;AAAA;AAAA,UACA,qBAAsB;AAAA,UACtB;AAAA,UACA;AAAA;AAAA,MACD;AAAA,OAEF;AAAA,IACA,oBAAC,wBAAqB,QAAkB,UAAsB;AAAA,KAC/D;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,26 +1,21 @@
1
1
  // packages/editor/src/components/collaborators-presence/list.tsx
2
2
  import { __ } from "@wordpress/i18n";
3
- import {
4
- Popover,
5
- Button,
6
- privateApis as componentsPrivateApis
7
- } from "@wordpress/components";
8
- import { close } from "@wordpress/icons";
9
- import { unlock } from "../../lock-unlock.mjs";
3
+ import { Popover, Button } from "@wordpress/components";
4
+ import { closeSmall } from "@wordpress/icons";
5
+ import Avatar from "./avatar/index.mjs";
10
6
  import { getAvatarUrl } from "../collaborators-overlay/get-avatar-url.mjs";
11
7
  import { getAvatarBorderColor } from "../collab-sidebar/utils.mjs";
12
8
 
13
9
  // packages/editor/src/components/collaborators-presence/styles/collaborators-list.scss
14
- if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='0d3429a67b']")) {
10
+ if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='9537a5e604']")) {
15
11
  const style = document.createElement("style");
16
- style.setAttribute("data-wp-hash", "0d3429a67b");
17
- style.appendChild(document.createTextNode(".editor-collaborators-presence__list.components-popover .components-popover__content{background:#fff;border:1px solid #ddd;border-radius:8px;border-width:1px 0 0 1px;box-shadow:0 1px 2px #0000000d,0 2px 3px #0000000a,0 6px 6px #00000008,0 8px 8px #00000005}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-content{min-width:280px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header{align-items:center;display:flex;justify-content:space-between;padding:0 16px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-title{font-size:13px;font-weight:499;line-height:20px;padding:14px 0;text-transform:uppercase}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-title span{color:#757575}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-action{padding:8px 0}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-action button{color:#1e1e1e;height:24px;padding:0;width:24px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-items{display:flex;flex-direction:column;padding:0 10px 16px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item{all:unset;align-items:center;border-radius:12px;box-sizing:border-box;cursor:pointer;display:flex;gap:8px;padding:6px;transition:background-color .2s ease;width:100%}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:hover:not(:disabled){background-color:#0000000d}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:active:not(:disabled){background-color:#00000014}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:focus-visible{outline:2px solid var(--wp-admin-theme-color,#007cba);outline-offset:-2px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:disabled{cursor:default}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item-info{display:flex;flex:1;flex-direction:column;font-size:12px;line-height:16px}"));
12
+ style.setAttribute("data-wp-hash", "9537a5e604");
13
+ style.appendChild(document.createTextNode(".editor-collaborators-presence__list.components-popover .components-popover__content{background:#fff;border:1px solid #ddd;border-radius:8px;border-width:1px 0 0 1px;box-shadow:0 1px 2px #0000000d,0 2px 3px #0000000a,0 6px 6px #00000008,0 8px 8px #00000005}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-content{min-width:280px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header{align-items:center;display:flex;justify-content:space-between;padding:8px 16px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-title{display:flex;font-size:13px;font-weight:499;gap:4px;line-height:20px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-title span{color:#757575}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-action{padding:0}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-action button{color:#1e1e1e;height:32px;padding:0;width:32px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-items{display:flex;flex-direction:column;padding-bottom:16px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item{all:unset;align-items:center;box-sizing:border-box;cursor:pointer;display:flex;gap:8px;padding:12px 16px;transition:background-color .2s ease;width:100%}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:hover:not(:disabled){background-color:rgba(var(--wp-admin-theme-color--rgb),.04)}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:active:not(:disabled){background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:focus-visible{outline:2px solid var(--wp-admin-theme-color,#3858e9);outline-offset:-2px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:disabled{cursor:default}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item-info{display:flex;flex:1;flex-direction:column;min-width:0}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item-name{color:#1e1e1e;font-size:13px;font-weight:499;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"));
18
14
  document.head.appendChild(style);
19
15
  }
20
16
 
21
17
  // packages/editor/src/components/collaborators-presence/list.tsx
22
18
  import { jsx, jsxs } from "react/jsx-runtime";
23
- var { Avatar } = unlock(componentsPrivateApis);
24
19
  function CollaboratorsList({
25
20
  activeCollaborators,
26
21
  popoverAnchor,
@@ -38,18 +33,14 @@ function CollaboratorsList({
38
33
  /* @__PURE__ */ jsxs("div", { className: "editor-collaborators-presence__list-header", children: [
39
34
  /* @__PURE__ */ jsxs("div", { className: "editor-collaborators-presence__list-header-title", children: [
40
35
  __("Collaborators"),
41
- /* @__PURE__ */ jsxs("span", { children: [
42
- " ",
43
- activeCollaborators.length,
44
- " "
45
- ] })
36
+ /* @__PURE__ */ jsx("span", { children: activeCollaborators.length })
46
37
  ] }),
47
38
  /* @__PURE__ */ jsx("div", { className: "editor-collaborators-presence__list-header-action", children: /* @__PURE__ */ jsx(
48
39
  Button,
49
40
  {
50
41
  __next40pxDefaultSize: true,
51
- icon: close,
52
- iconSize: 16,
42
+ icon: closeSmall,
43
+ iconSize: 24,
53
44
  label: __("Close Collaborators List"),
54
45
  onClick: () => setIsPopoverVisible(false)
55
46
  }
@@ -60,9 +51,6 @@ function CollaboratorsList({
60
51
  {
61
52
  className: "editor-collaborators-presence__list-item",
62
53
  disabled: true,
63
- style: {
64
- opacity: collaboratorState.isConnected ? 1 : 0.5
65
- },
66
54
  children: [
67
55
  /* @__PURE__ */ jsx(
68
56
  Avatar,
@@ -73,7 +61,8 @@ function CollaboratorsList({
73
61
  name: collaboratorState.collaboratorInfo.name,
74
62
  borderColor: getAvatarBorderColor(
75
63
  collaboratorState.collaboratorInfo.id
76
- )
64
+ ),
65
+ dimmed: !collaboratorState.isConnected
77
66
  }
78
67
  ),
79
68
  /* @__PURE__ */ jsx("div", { className: "editor-collaborators-presence__list-item-info", children: /* @__PURE__ */ jsx("div", { className: "editor-collaborators-presence__list-item-name", children: collaboratorState.collaboratorInfo.name }) })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/collaborators-presence/list.tsx", "../../../src/components/collaborators-presence/styles/collaborators-list.scss"],
4
- "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport {\n\tPopover,\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { close } from '@wordpress/icons';\nimport { type PostEditorAwarenessState } from '@wordpress/core-data';\n\nimport { unlock } from '../../lock-unlock';\nimport { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\n\nimport './styles/collaborators-list.scss';\n\nconst { Avatar } = unlock( componentsPrivateApis );\n\ninterface CollaboratorsListProps {\n\tactiveCollaborators: PostEditorAwarenessState[];\n\tpopoverAnchor?: HTMLElement | null;\n\tsetIsPopoverVisible: ( isVisible: boolean ) => void;\n}\n\n/**\n * Renders a list showing all active collaborators with their details.\n * Note: activeUsers should already exclude the current user (filtered by parent component).\n * @param props Component props\n * @param props.activeCollaborators List of active collaborators\n * @param props.popoverAnchor Anchor element for the popover\n * @param props.setIsPopoverVisible Callback to set the visibility of the popover\n */\nexport function CollaboratorsList( {\n\tactiveCollaborators,\n\tpopoverAnchor,\n\tsetIsPopoverVisible,\n}: CollaboratorsListProps ) {\n\treturn (\n\t\t<Popover\n\t\t\tanchor={ popoverAnchor }\n\t\t\tplacement=\"bottom\"\n\t\t\toffset={ 8 }\n\t\t\tclassName=\"editor-collaborators-presence__list\"\n\t\t\tonClose={ () => setIsPopoverVisible( false ) }\n\t\t>\n\t\t\t<div className=\"editor-collaborators-presence__list-content\">\n\t\t\t\t<div className=\"editor-collaborators-presence__list-header\">\n\t\t\t\t\t<div className=\"editor-collaborators-presence__list-header-title\">\n\t\t\t\t\t\t{ __( 'Collaborators' ) }\n\t\t\t\t\t\t<span> { activeCollaborators.length } </span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"editor-collaborators-presence__list-header-action\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ticon={ close }\n\t\t\t\t\t\t\ticonSize={ 16 }\n\t\t\t\t\t\t\tlabel={ __( 'Close Collaborators List' ) }\n\t\t\t\t\t\t\tonClick={ () => setIsPopoverVisible( false ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-collaborators-presence__list-items\">\n\t\t\t\t\t{ activeCollaborators.map( ( collaboratorState ) => (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tkey={ collaboratorState.clientId }\n\t\t\t\t\t\t\tclassName=\"editor-collaborators-presence__list-item\"\n\t\t\t\t\t\t\tdisabled\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\topacity: collaboratorState.isConnected\n\t\t\t\t\t\t\t\t\t? 1\n\t\t\t\t\t\t\t\t\t: 0.5,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\tsrc={ getAvatarUrl(\n\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo\n\t\t\t\t\t\t\t\t\t\t.avatar_urls\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tname={ collaboratorState.collaboratorInfo.name }\n\t\t\t\t\t\t\t\tborderColor={ getAvatarBorderColor(\n\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.id\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<div className=\"editor-collaborators-presence__list-item-info\">\n\t\t\t\t\t\t\t\t<div className=\"editor-collaborators-presence__list-item-name\">\n\t\t\t\t\t\t\t\t\t{ collaboratorState.collaboratorInfo.name }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t) ) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Popover>\n\t);\n}\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='0d3429a67b']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"0d3429a67b\");\n\tstyle.appendChild(document.createTextNode(\".editor-collaborators-presence__list.components-popover .components-popover__content{background:#fff;border:1px solid #ddd;border-radius:8px;border-width:1px 0 0 1px;box-shadow:0 1px 2px #0000000d,0 2px 3px #0000000a,0 6px 6px #00000008,0 8px 8px #00000005}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-content{min-width:280px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header{align-items:center;display:flex;justify-content:space-between;padding:0 16px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-title{font-size:13px;font-weight:499;line-height:20px;padding:14px 0;text-transform:uppercase}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-title span{color:#757575}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-action{padding:8px 0}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-action button{color:#1e1e1e;height:24px;padding:0;width:24px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-items{display:flex;flex-direction:column;padding:0 10px 16px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item{all:unset;align-items:center;border-radius:12px;box-sizing:border-box;cursor:pointer;display:flex;gap:8px;padding:6px;transition:background-color .2s ease;width:100%}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:hover:not(:disabled){background-color:#0000000d}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:active:not(:disabled){background-color:#00000014}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:focus-visible{outline:2px solid var(--wp-admin-theme-color,#007cba);outline-offset:-2px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:disabled{cursor:default}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item-info{display:flex;flex:1;flex-direction:column;font-size:12px;line-height:16px}\"));\n\tdocument.head.appendChild(style);\n}\n"],
5
- "mappings": ";AAAA,SA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;AAAA,cACP,SAAS,kBAAkB,cACxB,IACA;AAAA,YACJ;AAAA,YAEA;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACA,KAAM;AAAA,oBACL,kBAAkB,iBAChB;AAAA,kBACH;AAAA,kBACA,MAAO,kBAAkB,iBAAiB;AAAA,kBAC1C,aAAc;AAAA,oBACb,kBAAkB,iBAAiB;AAAA,kBACpC;AAAA;AAAA,cACD;AAAA,cACA,oBAAC,SAAI,WAAU,iDACd,8BAAC,SAAI,WAAU,iDACZ,4BAAkB,iBAAiB,MACtC,GACD;AAAA;AAAA;AAAA,UAvBM,kBAAkB;AAAA,QAwBzB,CACC,GACH;AAAA,SACD;AAAA;AAAA,EACD;AAEF;",
4
+ "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport { Popover, Button } from '@wordpress/components';\nimport { closeSmall } from '@wordpress/icons';\nimport { type PostEditorAwarenessState } from '@wordpress/core-data';\n\nimport Avatar from './avatar';\nimport { getAvatarUrl } from '../collaborators-overlay/get-avatar-url';\nimport { getAvatarBorderColor } from '../collab-sidebar/utils';\n\nimport './styles/collaborators-list.scss';\n\ninterface CollaboratorsListProps {\n\tactiveCollaborators: PostEditorAwarenessState[];\n\tpopoverAnchor?: HTMLElement | null;\n\tsetIsPopoverVisible: ( isVisible: boolean ) => void;\n}\n\n/**\n * Renders a list showing all active collaborators with their details.\n * Note: activeUsers should already exclude the current user (filtered by parent component).\n * @param props Component props\n * @param props.activeCollaborators List of active collaborators\n * @param props.popoverAnchor Anchor element for the popover\n * @param props.setIsPopoverVisible Callback to set the visibility of the popover\n */\nexport function CollaboratorsList( {\n\tactiveCollaborators,\n\tpopoverAnchor,\n\tsetIsPopoverVisible,\n}: CollaboratorsListProps ) {\n\treturn (\n\t\t<Popover\n\t\t\tanchor={ popoverAnchor }\n\t\t\tplacement=\"bottom\"\n\t\t\toffset={ 8 }\n\t\t\tclassName=\"editor-collaborators-presence__list\"\n\t\t\tonClose={ () => setIsPopoverVisible( false ) }\n\t\t>\n\t\t\t<div className=\"editor-collaborators-presence__list-content\">\n\t\t\t\t<div className=\"editor-collaborators-presence__list-header\">\n\t\t\t\t\t<div className=\"editor-collaborators-presence__list-header-title\">\n\t\t\t\t\t\t{ __( 'Collaborators' ) }\n\t\t\t\t\t\t<span>{ activeCollaborators.length }</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"editor-collaborators-presence__list-header-action\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\t\ticonSize={ 24 }\n\t\t\t\t\t\t\tlabel={ __( 'Close Collaborators List' ) }\n\t\t\t\t\t\t\tonClick={ () => setIsPopoverVisible( false ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"editor-collaborators-presence__list-items\">\n\t\t\t\t\t{ activeCollaborators.map( ( collaboratorState ) => (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tkey={ collaboratorState.clientId }\n\t\t\t\t\t\t\tclassName=\"editor-collaborators-presence__list-item\"\n\t\t\t\t\t\t\tdisabled\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Avatar\n\t\t\t\t\t\t\t\tsrc={ getAvatarUrl(\n\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo\n\t\t\t\t\t\t\t\t\t\t.avatar_urls\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tname={ collaboratorState.collaboratorInfo.name }\n\t\t\t\t\t\t\t\tborderColor={ getAvatarBorderColor(\n\t\t\t\t\t\t\t\t\tcollaboratorState.collaboratorInfo.id\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tdimmed={ ! collaboratorState.isConnected }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<div className=\"editor-collaborators-presence__list-item-info\">\n\t\t\t\t\t\t\t\t<div className=\"editor-collaborators-presence__list-item-name\">\n\t\t\t\t\t\t\t\t\t{ collaboratorState.collaboratorInfo.name }\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t) ) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Popover>\n\t);\n}\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='9537a5e604']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"9537a5e604\");\n\tstyle.appendChild(document.createTextNode(\".editor-collaborators-presence__list.components-popover .components-popover__content{background:#fff;border:1px solid #ddd;border-radius:8px;border-width:1px 0 0 1px;box-shadow:0 1px 2px #0000000d,0 2px 3px #0000000a,0 6px 6px #00000008,0 8px 8px #00000005}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-content{min-width:280px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header{align-items:center;display:flex;justify-content:space-between;padding:8px 16px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-title{display:flex;font-size:13px;font-weight:499;gap:4px;line-height:20px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-title span{color:#757575}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-action{padding:0}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-header-action button{color:#1e1e1e;height:32px;padding:0;width:32px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-items{display:flex;flex-direction:column;padding-bottom:16px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item{all:unset;align-items:center;box-sizing:border-box;cursor:pointer;display:flex;gap:8px;padding:12px 16px;transition:background-color .2s ease;width:100%}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:hover:not(:disabled){background-color:rgba(var(--wp-admin-theme-color--rgb),.04)}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:active:not(:disabled){background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:focus-visible{outline:2px solid var(--wp-admin-theme-color,#3858e9);outline-offset:-2px}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item:disabled{cursor:default}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item-info{display:flex;flex:1;flex-direction:column;min-width:0}.editor-collaborators-presence__list.components-popover .editor-collaborators-presence__list-item-name{color:#1e1e1e;font-size:13px;font-weight:499;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\"));\n\tdocument.head.appendChild(style);\n}\n"],
5
+ "mappings": ";AAAA,SAAS,UAAU;AACnB,SAAS,SAAS,cAAc;AAChC,SAAS,kBAAkB;AAG3B,OAAO,YAAY;AACnB,SAAS,oBAAoB;AAC7B,SAAS,4BAA4B;;;ACPrC,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,yhFAAyhF,CAAC;AACpkF,WAAS,KAAK,YAAY,KAAK;AAChC;;;ADmCK,SAEC,KAFD;AAfE,SAAS,kBAAmB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AACD,GAA4B;AAC3B,SACC;AAAA,IAAC;AAAA;AAAA,MACA,QAAS;AAAA,MACT,WAAU;AAAA,MACV,QAAS;AAAA,MACT,WAAU;AAAA,MACV,SAAU,MAAM,oBAAqB,KAAM;AAAA,MAE3C,+BAAC,SAAI,WAAU,+CACd;AAAA,6BAAC,SAAI,WAAU,8CACd;AAAA,+BAAC,SAAI,WAAU,oDACZ;AAAA,eAAI,eAAgB;AAAA,YACtB,oBAAC,UAAO,8BAAoB,QAAQ;AAAA,aACrC;AAAA,UACA,oBAAC,SAAI,WAAU,qDACd;AAAA,YAAC;AAAA;AAAA,cACA,uBAAqB;AAAA,cACrB,MAAO;AAAA,cACP,UAAW;AAAA,cACX,OAAQ,GAAI,0BAA2B;AAAA,cACvC,SAAU,MAAM,oBAAqB,KAAM;AAAA;AAAA,UAC5C,GACD;AAAA,WACD;AAAA,QACA,oBAAC,SAAI,WAAU,6CACZ,8BAAoB,IAAK,CAAE,sBAC5B;AAAA,UAAC;AAAA;AAAA,YAEA,WAAU;AAAA,YACV,UAAQ;AAAA,YAER;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACA,KAAM;AAAA,oBACL,kBAAkB,iBAChB;AAAA,kBACH;AAAA,kBACA,MAAO,kBAAkB,iBAAiB;AAAA,kBAC1C,aAAc;AAAA,oBACb,kBAAkB,iBAAiB;AAAA,kBACpC;AAAA,kBACA,QAAS,CAAE,kBAAkB;AAAA;AAAA,cAC9B;AAAA,cACA,oBAAC,SAAI,WAAU,iDACd,8BAAC,SAAI,WAAU,iDACZ,4BAAkB,iBAAiB,MACtC,GACD;AAAA;AAAA;AAAA,UAnBM,kBAAkB;AAAA,QAoBzB,CACC,GACH;AAAA,SACD;AAAA;AAAA,EACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -23,15 +23,24 @@ var useIsDirty = () => {
23
23
  (record) => !(record.kind === "root" && record.name === "site")
24
24
  );
25
25
  const siteEntityLabels = siteEntityConfig?.meta?.labels ?? {};
26
- const editedSiteEntities = [];
27
- for (const property in siteEdits) {
28
- editedSiteEntities.push({
26
+ const {
27
+ site_logo: siteLogoEdit,
28
+ site_icon: siteIconEdit,
29
+ ...otherSiteEdits
30
+ } = siteEdits ?? {};
31
+ const orderedSiteProperties = [
32
+ siteLogoEdit !== void 0 && "site_logo",
33
+ siteIconEdit !== void 0 && "site_icon",
34
+ ...Object.keys(otherSiteEdits)
35
+ ].filter(Boolean);
36
+ const editedSiteEntities = orderedSiteProperties.map(
37
+ (property) => ({
29
38
  kind: "root",
30
39
  name: "site",
31
40
  title: siteEntityLabels[property] || property,
32
41
  property
33
- });
34
- }
42
+ })
43
+ );
35
44
  return [...editedEntitiesWithoutSite, ...editedSiteEntities];
36
45
  }, [editedEntities, siteEdits, siteEntityConfig]);
37
46
  const [unselectedEntities, _setUnselectedEntities] = useState([]);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/entities-saved-states/hooks/use-is-dirty.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo, useState } from '@wordpress/element';\n\n/**\n * Custom hook that determines if any entities are dirty (edited) and provides a way to manage selected/unselected entities.\n *\n * @return {Object} An object containing the following properties:\n * - dirtyEntityRecords: An array of dirty entity records.\n * - isDirty: A boolean indicating if there are any dirty entity records.\n * - setUnselectedEntities: A function to set the unselected entities.\n * - unselectedEntities: An array of unselected entities.\n */\nexport const useIsDirty = () => {\n\tconst { editedEntities, siteEdits, siteEntityConfig } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetEntityRecordEdits,\n\t\t\t\tgetEntityConfig,\n\t\t\t} = select( coreStore );\n\n\t\t\treturn {\n\t\t\t\teditedEntities: __experimentalGetDirtyEntityRecords(),\n\t\t\t\tsiteEdits: getEntityRecordEdits( 'root', 'site' ),\n\t\t\t\tsiteEntityConfig: getEntityConfig( 'root', 'site' ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst dirtyEntityRecords = useMemo( () => {\n\t\t// Remove site object and decouple into its edited pieces.\n\t\tconst editedEntitiesWithoutSite = editedEntities.filter(\n\t\t\t( record ) => ! ( record.kind === 'root' && record.name === 'site' )\n\t\t);\n\n\t\tconst siteEntityLabels = siteEntityConfig?.meta?.labels ?? {};\n\t\tconst editedSiteEntities = [];\n\t\tfor ( const property in siteEdits ) {\n\t\t\teditedSiteEntities.push( {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t\ttitle: siteEntityLabels[ property ] || property,\n\t\t\t\tproperty,\n\t\t\t} );\n\t\t}\n\n\t\treturn [ ...editedEntitiesWithoutSite, ...editedSiteEntities ];\n\t}, [ editedEntities, siteEdits, siteEntityConfig ] );\n\n\t// Unchecked entities to be ignored by save function.\n\tconst [ unselectedEntities, _setUnselectedEntities ] = useState( [] );\n\n\tconst setUnselectedEntities = (\n\t\t{ kind, name, key, property },\n\t\tchecked\n\t) => {\n\t\tif ( checked ) {\n\t\t\t_setUnselectedEntities(\n\t\t\t\tunselectedEntities.filter(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind !== kind ||\n\t\t\t\t\t\telt.name !== name ||\n\t\t\t\t\t\telt.key !== key ||\n\t\t\t\t\t\telt.property !== property\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t_setUnselectedEntities( [\n\t\t\t\t...unselectedEntities,\n\t\t\t\t{ kind, name, key, property },\n\t\t\t] );\n\t\t}\n\t};\n\n\tconst isDirty = dirtyEntityRecords.length - unselectedEntities.length > 0;\n\n\treturn {\n\t\tdirtyEntityRecords,\n\t\tisDirty,\n\t\tsetUnselectedEntities,\n\t\tunselectedEntities,\n\t};\n};\n"],
5
- "mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,gBAAgB;AAW3B,IAAM,aAAa,MAAM;AAC/B,QAAM,EAAE,gBAAgB,WAAW,iBAAiB,IAAI;AAAA,IACvD,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,SAAU;AAEtB,aAAO;AAAA,QACN,gBAAgB,oCAAoC;AAAA,QACpD,WAAW,qBAAsB,QAAQ,MAAO;AAAA,QAChD,kBAAkB,gBAAiB,QAAQ,MAAO;AAAA,MACnD;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAEA,QAAM,qBAAqB,QAAS,MAAM;AAEzC,UAAM,4BAA4B,eAAe;AAAA,MAChD,CAAE,WAAY,EAAI,OAAO,SAAS,UAAU,OAAO,SAAS;AAAA,IAC7D;AAEA,UAAM,mBAAmB,kBAAkB,MAAM,UAAU,CAAC;AAC5D,UAAM,qBAAqB,CAAC;AAC5B,eAAY,YAAY,WAAY;AACnC,yBAAmB,KAAM;AAAA,QACxB,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO,iBAAkB,QAAS,KAAK;AAAA,QACvC;AAAA,MACD,CAAE;AAAA,IACH;AAEA,WAAO,CAAE,GAAG,2BAA2B,GAAG,kBAAmB;AAAA,EAC9D,GAAG,CAAE,gBAAgB,WAAW,gBAAiB,CAAE;AAGnD,QAAM,CAAE,oBAAoB,sBAAuB,IAAI,SAAU,CAAC,CAAE;AAEpE,QAAM,wBAAwB,CAC7B,EAAE,MAAM,MAAM,KAAK,SAAS,GAC5B,YACI;AACJ,QAAK,SAAU;AACd;AAAA,QACC,mBAAmB;AAAA,UAClB,CAAE,QACD,IAAI,SAAS,QACb,IAAI,SAAS,QACb,IAAI,QAAQ,OACZ,IAAI,aAAa;AAAA,QACnB;AAAA,MACD;AAAA,IACD,OAAO;AACN,6BAAwB;AAAA,QACvB,GAAG;AAAA,QACH,EAAE,MAAM,MAAM,KAAK,SAAS;AAAA,MAC7B,CAAE;AAAA,IACH;AAAA,EACD;AAEA,QAAM,UAAU,mBAAmB,SAAS,mBAAmB,SAAS;AAExE,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMemo, useState } from '@wordpress/element';\n\n/**\n * Custom hook that determines if any entities are dirty (edited) and provides a way to manage selected/unselected entities.\n *\n * @return {Object} An object containing the following properties:\n * - dirtyEntityRecords: An array of dirty entity records.\n * - isDirty: A boolean indicating if there are any dirty entity records.\n * - setUnselectedEntities: A function to set the unselected entities.\n * - unselectedEntities: An array of unselected entities.\n */\nexport const useIsDirty = () => {\n\tconst { editedEntities, siteEdits, siteEntityConfig } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tgetEntityRecordEdits,\n\t\t\t\tgetEntityConfig,\n\t\t\t} = select( coreStore );\n\n\t\t\treturn {\n\t\t\t\teditedEntities: __experimentalGetDirtyEntityRecords(),\n\t\t\t\tsiteEdits: getEntityRecordEdits( 'root', 'site' ),\n\t\t\t\tsiteEntityConfig: getEntityConfig( 'root', 'site' ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst dirtyEntityRecords = useMemo( () => {\n\t\t// Remove site object and decouple into its edited pieces.\n\t\tconst editedEntitiesWithoutSite = editedEntities.filter(\n\t\t\t( record ) => ! ( record.kind === 'root' && record.name === 'site' )\n\t\t);\n\n\t\tconst siteEntityLabels = siteEntityConfig?.meta?.labels ?? {};\n\t\tconst {\n\t\t\tsite_logo: siteLogoEdit,\n\t\t\tsite_icon: siteIconEdit,\n\t\t\t...otherSiteEdits\n\t\t} = siteEdits ?? {};\n\t\tconst orderedSiteProperties = [\n\t\t\tsiteLogoEdit !== undefined && 'site_logo',\n\t\t\tsiteIconEdit !== undefined && 'site_icon',\n\t\t\t...Object.keys( otherSiteEdits ),\n\t\t].filter( Boolean );\n\t\tconst editedSiteEntities = orderedSiteProperties.map(\n\t\t\t( property ) => ( {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t\ttitle: siteEntityLabels[ property ] || property,\n\t\t\t\tproperty,\n\t\t\t} )\n\t\t);\n\n\t\treturn [ ...editedEntitiesWithoutSite, ...editedSiteEntities ];\n\t}, [ editedEntities, siteEdits, siteEntityConfig ] );\n\n\t// Unchecked entities to be ignored by save function.\n\tconst [ unselectedEntities, _setUnselectedEntities ] = useState( [] );\n\n\tconst setUnselectedEntities = (\n\t\t{ kind, name, key, property },\n\t\tchecked\n\t) => {\n\t\tif ( checked ) {\n\t\t\t_setUnselectedEntities(\n\t\t\t\tunselectedEntities.filter(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind !== kind ||\n\t\t\t\t\t\telt.name !== name ||\n\t\t\t\t\t\telt.key !== key ||\n\t\t\t\t\t\telt.property !== property\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t_setUnselectedEntities( [\n\t\t\t\t...unselectedEntities,\n\t\t\t\t{ kind, name, key, property },\n\t\t\t] );\n\t\t}\n\t};\n\n\tconst isDirty = dirtyEntityRecords.length - unselectedEntities.length > 0;\n\n\treturn {\n\t\tdirtyEntityRecords,\n\t\tisDirty,\n\t\tsetUnselectedEntities,\n\t\tunselectedEntities,\n\t};\n};\n"],
5
+ "mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,SAAS,iBAAiB;AACnC,SAAS,SAAS,gBAAgB;AAW3B,IAAM,aAAa,MAAM;AAC/B,QAAM,EAAE,gBAAgB,WAAW,iBAAiB,IAAI;AAAA,IACvD,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,SAAU;AAEtB,aAAO;AAAA,QACN,gBAAgB,oCAAoC;AAAA,QACpD,WAAW,qBAAsB,QAAQ,MAAO;AAAA,QAChD,kBAAkB,gBAAiB,QAAQ,MAAO;AAAA,MACnD;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAEA,QAAM,qBAAqB,QAAS,MAAM;AAEzC,UAAM,4BAA4B,eAAe;AAAA,MAChD,CAAE,WAAY,EAAI,OAAO,SAAS,UAAU,OAAO,SAAS;AAAA,IAC7D;AAEA,UAAM,mBAAmB,kBAAkB,MAAM,UAAU,CAAC;AAC5D,UAAM;AAAA,MACL,WAAW;AAAA,MACX,WAAW;AAAA,MACX,GAAG;AAAA,IACJ,IAAI,aAAa,CAAC;AAClB,UAAM,wBAAwB;AAAA,MAC7B,iBAAiB,UAAa;AAAA,MAC9B,iBAAiB,UAAa;AAAA,MAC9B,GAAG,OAAO,KAAM,cAAe;AAAA,IAChC,EAAE,OAAQ,OAAQ;AAClB,UAAM,qBAAqB,sBAAsB;AAAA,MAChD,CAAE,cAAgB;AAAA,QACjB,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO,iBAAkB,QAAS,KAAK;AAAA,QACvC;AAAA,MACD;AAAA,IACD;AAEA,WAAO,CAAE,GAAG,2BAA2B,GAAG,kBAAmB;AAAA,EAC9D,GAAG,CAAE,gBAAgB,WAAW,gBAAiB,CAAE;AAGnD,QAAM,CAAE,oBAAoB,sBAAuB,IAAI,SAAU,CAAC,CAAE;AAEpE,QAAM,wBAAwB,CAC7B,EAAE,MAAM,MAAM,KAAK,SAAS,GAC5B,YACI;AACJ,QAAK,SAAU;AACd;AAAA,QACC,mBAAmB;AAAA,UAClB,CAAE,QACD,IAAI,SAAS,QACb,IAAI,SAAS,QACb,IAAI,QAAQ,OACZ,IAAI,aAAa;AAAA,QACnB;AAAA,MACD;AAAA,IACD,OAAO;AACN,6BAAwB;AAAA,QACvB,GAAG;AAAA,QACH,EAAE,MAAM,MAAM,KAAK,SAAS;AAAA,MAC7B,CAAE;AAAA,IACH;AAAA,EACD;AAEA,QAAM,UAAU,mBAAmB,SAAS,mBAAmB,SAAS;AAExE,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;",
6
6
  "names": []
7
7
  }
@@ -4,37 +4,24 @@ import { useSelect } from "@wordpress/data";
4
4
  import { useMemo } from "@wordpress/element";
5
5
  import { GlobalStylesUI } from "@wordpress/global-styles-ui";
6
6
  import { uploadMedia } from "@wordpress/media-utils";
7
- import { store as editorStore } from "../../store/index.mjs";
8
7
  import { GlobalStylesBlockLink } from "./block-link.mjs";
9
8
  import { useGlobalStyles } from "./hooks.mjs";
10
9
  import { useGlobalStyles as useGlobalStyles2, useStyle, useSetting } from "./hooks.mjs";
11
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12
- function useServerData() {
13
- const {
14
- styles,
15
- __unstableResolvedAssets,
16
- colors,
17
- gradients,
18
- __experimentalDiscussionSettings,
19
- mediaUploadHandler,
20
- fontLibraryEnabled
21
- } = useSelect((select) => {
22
- const { getEditorSettings } = select(editorStore);
11
+ function useServerData(settings) {
12
+ const styles = settings?.styles;
13
+ const __unstableResolvedAssets = settings?.__unstableResolvedAssets;
14
+ const colors = settings?.colors;
15
+ const gradients = settings?.gradients;
16
+ const __experimentalDiscussionSettings = settings?.__experimentalDiscussionSettings;
17
+ const fontLibraryEnabled = settings?.fontLibraryEnabled ?? true;
18
+ const mediaUploadHandler = useSelect((select) => {
23
19
  const { canUser } = select(coreStore);
24
- const editorSettings = getEditorSettings();
25
20
  const canUserUploadMedia = canUser("create", {
26
21
  kind: "postType",
27
22
  name: "attachment"
28
23
  });
29
- return {
30
- styles: editorSettings?.styles,
31
- __unstableResolvedAssets: editorSettings?.__unstableResolvedAssets,
32
- colors: editorSettings?.colors,
33
- gradients: editorSettings?.gradients,
34
- __experimentalDiscussionSettings: editorSettings?.__experimentalDiscussionSettings,
35
- mediaUploadHandler: canUserUploadMedia ? uploadMedia : void 0,
36
- fontLibraryEnabled: editorSettings?.fontLibraryEnabled ?? true
37
- };
24
+ return canUserUploadMedia ? uploadMedia : void 0;
38
25
  }, []);
39
26
  const serverCSS = useMemo(() => {
40
27
  if (!styles) {
@@ -70,14 +57,18 @@ function useServerData() {
70
57
  ]);
71
58
  return { serverCSS, serverSettings, fontLibraryEnabled };
72
59
  }
73
- function GlobalStylesUIWrapper({ path, onPathChange }) {
60
+ function GlobalStylesUIWrapper({
61
+ path,
62
+ onPathChange,
63
+ settings
64
+ }) {
74
65
  const {
75
66
  user: userConfig,
76
67
  base: baseConfig,
77
68
  setUser: setUserConfig,
78
69
  isReady
79
70
  } = useGlobalStyles();
80
- const { serverCSS, serverSettings, fontLibraryEnabled } = useServerData();
71
+ const { serverCSS, serverSettings, fontLibraryEnabled } = useServerData(settings);
81
72
  if (!isReady) {
82
73
  return null;
83
74
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/global-styles/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { GlobalStylesUI } from '@wordpress/global-styles-ui';\nimport { uploadMedia } from '@wordpress/media-utils';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { GlobalStylesBlockLink } from './block-link';\nimport { useGlobalStyles } from './hooks';\n\n/**\n * Hook to fetch server CSS and settings for BlockEditorProvider that are not Global Styles.\n */\nfunction useServerData() {\n\tconst {\n\t\tstyles,\n\t\t__unstableResolvedAssets,\n\t\tcolors,\n\t\tgradients,\n\t\t__experimentalDiscussionSettings,\n\t\tmediaUploadHandler,\n\t\tfontLibraryEnabled,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { canUser } = select( coreStore );\n\t\tconst editorSettings = getEditorSettings();\n\n\t\tconst canUserUploadMedia = canUser( 'create', {\n\t\t\tkind: 'postType',\n\t\t\tname: 'attachment',\n\t\t} );\n\n\t\treturn {\n\t\t\tstyles: editorSettings?.styles,\n\t\t\t__unstableResolvedAssets: editorSettings?.__unstableResolvedAssets,\n\t\t\tcolors: editorSettings?.colors,\n\t\t\tgradients: editorSettings?.gradients,\n\t\t\t__experimentalDiscussionSettings:\n\t\t\t\teditorSettings?.__experimentalDiscussionSettings,\n\t\t\tmediaUploadHandler: canUserUploadMedia ? uploadMedia : undefined,\n\t\t\tfontLibraryEnabled: editorSettings?.fontLibraryEnabled ?? true,\n\t\t};\n\t}, [] );\n\n\t// Filter out global styles to get only server-provided styles\n\tconst serverCSS = useMemo( () => {\n\t\tif ( ! styles ) {\n\t\t\treturn [];\n\t\t}\n\t\treturn styles.filter( ( style ) => ! style.isGlobalStyles );\n\t}, [ styles ] );\n\n\t// Create server settings object\n\tconst serverSettings = useMemo( () => {\n\t\treturn {\n\t\t\t__unstableResolvedAssets,\n\t\t\tsettings: {\n\t\t\t\tcolor: {\n\t\t\t\t\tpalette: {\n\t\t\t\t\t\ttheme: colors ?? [],\n\t\t\t\t\t},\n\t\t\t\t\tgradients: {\n\t\t\t\t\t\ttheme: gradients ?? [],\n\t\t\t\t\t},\n\t\t\t\t\tduotone: {\n\t\t\t\t\t\ttheme: [],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t__experimentalDiscussionSettings,\n\t\t\tmediaUpload: mediaUploadHandler,\n\t\t};\n\t}, [\n\t\t__unstableResolvedAssets,\n\t\tcolors,\n\t\tgradients,\n\t\t__experimentalDiscussionSettings,\n\t\tmediaUploadHandler,\n\t] );\n\n\treturn { serverCSS, serverSettings, fontLibraryEnabled };\n}\n\nexport default function GlobalStylesUIWrapper( { path, onPathChange } ) {\n\tconst {\n\t\tuser: userConfig,\n\t\tbase: baseConfig,\n\t\tsetUser: setUserConfig,\n\t\tisReady,\n\t} = useGlobalStyles();\n\tconst { serverCSS, serverSettings, fontLibraryEnabled } = useServerData();\n\n\t// Show loading state while data is being fetched\n\tif ( ! isReady ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesUI\n\t\t\t\tvalue={ userConfig }\n\t\t\t\tbaseValue={ baseConfig || {} }\n\t\t\t\tonChange={ setUserConfig }\n\t\t\t\tpath={ path }\n\t\t\t\tonPathChange={ onPathChange }\n\t\t\t\tfontLibraryEnabled={ fontLibraryEnabled }\n\t\t\t\tserverCSS={ serverCSS }\n\t\t\t\tserverSettings={ serverSettings }\n\t\t\t/>\n\t\t\t<GlobalStylesBlockLink\n\t\t\t\tpath={ path }\n\t\t\t\tonPathChange={ onPathChange }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport { useGlobal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AW;AAAA,YACV,OAAO,aAAa,CAAC;AAAA,UACtB;AAAA,UACA,SAAS;AAAA,YACR,OAAO,CAAC;AAAA,UACT;AAAA,QACD;AAAA,MACD;AAAA,MACA;AAAA,MACA,aAAa;AAAA,IACd;AAAA,EACD,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AAEF,SAAO,EAAE,WAAW,gBAAgB,mBAAmB;AACxD;AAEe,SAAR,sBAAwC,EAAE,MAAM,aAAa,GAAI;AACvE,QAAM;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT;AAAA,EACD,IAAI,gBAAgB;AACpB,QAAM,EAAE,WAAW,gBAAgB,mBAAmB,IAAI,cAAc;AAGxE,MAAK,CAAE,SAAU;AAChB,WAAO;AAAA,EACR;AAEA,SACC,iCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ;AAAA,QACR,WAAY,cAAc,CAAC;AAAA,QAC3B,UAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,KACD;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { GlobalStylesUI } from '@wordpress/global-styles-ui';\nimport { uploadMedia } from '@wordpress/media-utils';\n\n/**\n * Internal dependencies\n */\nimport { GlobalStylesBlockLink } from './block-link';\nimport { useGlobalStyles } from './hooks';\n\n/**\n * Hook to fetch server CSS and settings for BlockEditorProvider that are not Global Styles.\n *\n * @param {Object} settings The editor settings object.\n */\nfunction useServerData( settings ) {\n\tconst styles = settings?.styles;\n\tconst __unstableResolvedAssets = settings?.__unstableResolvedAssets;\n\tconst colors = settings?.colors;\n\tconst gradients = settings?.gradients;\n\tconst __experimentalDiscussionSettings =\n\t\tsettings?.__experimentalDiscussionSettings;\n\tconst fontLibraryEnabled = settings?.fontLibraryEnabled ?? true;\n\n\tconst mediaUploadHandler = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst canUserUploadMedia = canUser( 'create', {\n\t\t\tkind: 'postType',\n\t\t\tname: 'attachment',\n\t\t} );\n\t\treturn canUserUploadMedia ? uploadMedia : undefined;\n\t}, [] );\n\n\t// Filter out global styles to get only server-provided styles\n\tconst serverCSS = useMemo( () => {\n\t\tif ( ! styles ) {\n\t\t\treturn [];\n\t\t}\n\t\treturn styles.filter( ( style ) => ! style.isGlobalStyles );\n\t}, [ styles ] );\n\n\t// Create server settings object\n\tconst serverSettings = useMemo( () => {\n\t\treturn {\n\t\t\t__unstableResolvedAssets,\n\t\t\tsettings: {\n\t\t\t\tcolor: {\n\t\t\t\t\tpalette: {\n\t\t\t\t\t\ttheme: colors ?? [],\n\t\t\t\t\t},\n\t\t\t\t\tgradients: {\n\t\t\t\t\t\ttheme: gradients ?? [],\n\t\t\t\t\t},\n\t\t\t\t\tduotone: {\n\t\t\t\t\t\ttheme: [],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t__experimentalDiscussionSettings,\n\t\t\tmediaUpload: mediaUploadHandler,\n\t\t};\n\t}, [\n\t\t__unstableResolvedAssets,\n\t\tcolors,\n\t\tgradients,\n\t\t__experimentalDiscussionSettings,\n\t\tmediaUploadHandler,\n\t] );\n\n\treturn { serverCSS, serverSettings, fontLibraryEnabled };\n}\n\nexport default function GlobalStylesUIWrapper( {\n\tpath,\n\tonPathChange,\n\tsettings,\n} ) {\n\tconst {\n\t\tuser: userConfig,\n\t\tbase: baseConfig,\n\t\tsetUser: setUserConfig,\n\t\tisReady,\n\t} = useGlobalStyles();\n\tconst { serverCSS, serverSettings, fontLibraryEnabled } =\n\t\tuseServerData( settings );\n\n\t// Show loading state while data is being fetched\n\tif ( ! isReady ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<GlobalStylesUI\n\t\t\t\tvalue={ userConfig }\n\t\t\t\tbaseValue={ baseConfig || {} }\n\t\t\t\tonChange={ setUserConfig }\n\t\t\t\tpath={ path }\n\t\t\t\tonPathChange={ onPathChange }\n\t\t\t\tfontLibraryEnabled={ fontLibraryEnabled }\n\t\t\t\tserverCSS={ serverCSS }\n\t\t\t\tserverSettings={ serverSettings }\n\t\t\t/>\n\t\t\t<GlobalStylesBlockLink\n\t\t\t\tpath={ path }\n\t\t\t\tonPathChange={ onPathChange }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport { useGlobalStyles, useStyle, useSetting } from './hooks';\n"],
5
+ "mappings": ";AAGA,SAAS,SAAS,iBAAiB;AACnC,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB;AAK5B,SAAS,6BAA6B;AACtC,SAAS,uBAAuB;AAuGhC,SAAS,mBAAAA,kBAAiB,UAAU,kBAAkB;AAnBpD,mBACC,KADD;AA7EF,SAAS,cAAe,UAAW;AAClC,QAAM,SAAS,UAAU;AACzB,QAAM,2BAA2B,UAAU;AAC3C,QAAM,SAAS,UAAU;AACzB,QAAM,YAAY,UAAU;AAC5B,QAAM,mCACL,UAAU;AACX,QAAM,qBAAqB,UAAU,sBAAsB;AAE3D,QAAM,qBAAqB,UAAW,CAAE,WAAY;AACnD,UAAM,EAAE,QAAQ,IAAI,OAAQ,SAAU;AACtC,UAAM,qBAAqB,QAAS,UAAU;AAAA,MAC7C,MAAM;AAAA,MACN,MAAM;AAAA,IACP,CAAE;AACF,WAAO,qBAAqB,cAAc;AAAA,EAC3C,GAAG,CAAC,CAAE;AAGN,QAAM,YAAY,QAAS,MAAM;AAChC,QAAK,CAAE,QAAS;AACf,aAAO,CAAC;AAAA,IACT;AACA,WAAO,OAAO,OAAQ,CAAE,UAAW,CAAE,MAAM,cAAe;AAAA,EAC3D,GAAG,CAAE,MAAO,CAAE;AAGd,QAAM,iBAAiB,QAAS,MAAM;AACrC,WAAO;AAAA,MACN;AAAA,MACA,UAAU;AAAA,QACT,OAAO;AAAA,UACN,SAAS;AAAA,YACR,OAAO,UAAU,CAAC;AAAA,UACnB;AAAA,UACA,WAAW;AAAA,YACV,OAAO,aAAa,CAAC;AAAA,UACtB;AAAA,UACA,SAAS;AAAA,YACR,OAAO,CAAC;AAAA,UACT;AAAA,QACD;AAAA,MACD;AAAA,MACA;AAAA,MACA,aAAa;AAAA,IACd;AAAA,EACD,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AAEF,SAAO,EAAE,WAAW,gBAAgB,mBAAmB;AACxD;AAEe,SAAR,sBAAwC;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT;AAAA,EACD,IAAI,gBAAgB;AACpB,QAAM,EAAE,WAAW,gBAAgB,mBAAmB,IACrD,cAAe,QAAS;AAGzB,MAAK,CAAE,SAAU;AAChB,WAAO;AAAA,EACR;AAEA,SACC,iCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ;AAAA,QACR,WAAY,cAAc,CAAC;AAAA,QAC3B,UAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,KACD;AAEF;",
6
6
  "names": ["useGlobalStyles"]
7
7
  }
@@ -22,7 +22,8 @@ function GlobalStylesSidebar() {
22
22
  showStylebook,
23
23
  showListViewByDefault,
24
24
  hasRevisions,
25
- activeComplementaryArea
25
+ activeComplementaryArea,
26
+ editorSettings
26
27
  } = useSelect((select) => {
27
28
  const { getActiveComplementaryArea } = select(interfaceStore);
28
29
  const { getStylesPath, getShowStylebook } = unlock(
@@ -42,7 +43,8 @@ function GlobalStylesSidebar() {
42
43
  shouldResetNavigation: "edit-site/global-styles" !== getActiveComplementaryArea("core") || !_isVisualEditorMode,
43
44
  showListViewByDefault: _showListViewByDefault,
44
45
  hasRevisions: !!globalStyles?._links?.["version-history"]?.[0]?.count,
45
- activeComplementaryArea: select(interfaceStore).getActiveComplementaryArea("core")
46
+ activeComplementaryArea: select(interfaceStore).getActiveComplementaryArea("core"),
47
+ editorSettings: select(editorStore).getEditorSettings()
46
48
  };
47
49
  }, []);
48
50
  const { setStylesPath, setShowStylebook, resetStylesNavigation } = unlock(
@@ -139,7 +141,8 @@ function GlobalStylesSidebar() {
139
141
  GlobalStylesUI,
140
142
  {
141
143
  path: stylesPath,
142
- onPathChange: setStylesPath
144
+ onPathChange: setStylesPath,
145
+ settings: editorSettings
143
146
  }
144
147
  )
145
148
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/global-styles-sidebar/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { FlexItem, Flex, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, seen, backup } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch, usePrevious } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport GlobalStylesUI from '../global-styles';\nimport { GlobalStylesActionMenu } from '../global-styles/menu';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport DefaultSidebar from './default-sidebar';\nimport WelcomeGuideStyles from './welcome-guide';\n\nexport default function GlobalStylesSidebar() {\n\tconst {\n\t\tshouldResetNavigation,\n\t\tstylesPath,\n\t\tshowStylebook,\n\t\tshowListViewByDefault,\n\t\thasRevisions,\n\t\tactiveComplementaryArea,\n\t} = useSelect( ( select ) => {\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getStylesPath, getShowStylebook } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\t\tconst _isVisualEditorMode =\n\t\t\t'visual' === select( editorStore ).getEditorMode();\n\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'showListViewByDefault'\n\t\t);\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tstylesPath: getStylesPath(),\n\t\t\tshowStylebook: getShowStylebook(),\n\t\t\tshouldResetNavigation:\n\t\t\t\t'edit-site/global-styles' !==\n\t\t\t\t\tgetActiveComplementaryArea( 'core' ) ||\n\t\t\t\t! _isVisualEditorMode,\n\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\thasRevisions:\n\t\t\t\t!! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count,\n\t\t\tactiveComplementaryArea:\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' ),\n\t\t};\n\t}, [] );\n\tconst { setStylesPath, setShowStylebook, resetStylesNavigation } = unlock(\n\t\tuseDispatch( editorStore )\n\t);\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\t// Derive state from path and showStylebook\n\tconst isRevisionsOpened =\n\t\tstylesPath.startsWith( '/revisions' ) && ! showStylebook;\n\tconst isRevisionsStyleBookOpened =\n\t\tstylesPath.startsWith( '/revisions' ) && showStylebook;\n\n\tconst previousActiveArea = usePrevious( activeComplementaryArea );\n\n\t// Reset navigation when sidebar opens\n\tuseEffect( () => {\n\t\tif (\n\t\t\tactiveComplementaryArea === 'edit-site/global-styles' &&\n\t\t\tpreviousActiveArea !== 'edit-site/global-styles'\n\t\t) {\n\t\t\tresetStylesNavigation();\n\t\t}\n\t}, [ activeComplementaryArea, previousActiveArea, resetStylesNavigation ] );\n\n\tuseEffect( () => {\n\t\tif ( shouldResetNavigation ) {\n\t\t\tresetStylesNavigation();\n\t\t}\n\t}, [ shouldResetNavigation, resetStylesNavigation ] );\n\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\n\tconst toggleRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tif ( isRevisionsOpened || isRevisionsStyleBookOpened ) {\n\t\t\t// Close revisions, go back to root\n\t\t\tsetStylesPath( '/' );\n\t\t} else {\n\t\t\t// Open revisions\n\t\t\tsetStylesPath( '/revisions' );\n\t\t}\n\t};\n\tconst toggleStyleBook = () => {\n\t\tsetIsListViewOpened( showStylebook && showListViewByDefault );\n\t\tsetShowStylebook( ! showStylebook );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<DefaultSidebar\n\t\t\t\tclassName=\"editor-global-styles-sidebar\"\n\t\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\ticon={ styles }\n\t\t\t\tcloseLabel={ __( 'Close Styles' ) }\n\t\t\t\tpanelClassName=\"editor-global-styles-sidebar__panel\"\n\t\t\t\theader={\n\t\t\t\t\t<Flex\n\t\t\t\t\t\tclassName=\"editor-global-styles-sidebar__header\"\n\t\t\t\t\t\tgap={ 1 }\n\t\t\t\t\t>\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<h2 className=\"editor-global-styles-sidebar__header-title\">\n\t\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t\t\tgap={ 1 }\n\t\t\t\t\t\t\tclassName=\"editor-global-styles-sidebar__header-actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\t\t\tisPressed={ showStylebook }\n\t\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\t\tdisabled={ shouldResetNavigation }\n\t\t\t\t\t\t\t\t\t\tonClick={ toggleStyleBook }\n\t\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t\t\t\t\tonClick={ toggleRevisions }\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\tdisabled={ ! hasRevisions }\n\t\t\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\t\t\tisRevisionsOpened ||\n\t\t\t\t\t\t\t\t\t\tisRevisionsStyleBookOpened\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t<GlobalStylesActionMenu\n\t\t\t\t\t\t\t\tonChangePath={ setStylesPath }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Flex>\n\t\t\t\t\t</Flex>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<GlobalStylesUI\n\t\t\t\t\tpath={ stylesPath }\n\t\t\t\t\tonPathChange={ setStylesPath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,gBAAC;AAAA;AAAA,kBACA,SAAQ;AAAA,kBACR,KAAM;AAAA,kBACN,WAAU;AAAA,kBAER;AAAA,qBAAE,oBACH,oBAAC,YACA;AAAA,sBAAC;AAAA;AAAA,wBACA,MAAO;AAAA,wBACP,OAAQ,GAAI,YAAa;AAAA,wBACzB,WAAY;AAAA,wBACZ,wBAAsB;AAAA,wBACtB,UAAW;AAAA,wBACX,SAAU;AAAA,wBACV,MAAK;AAAA;AAAA,oBACN,GACD;AAAA,oBAED,oBAAC,YACA;AAAA,sBAAC;AAAA;AAAA,wBACA,OAAQ,GAAI,WAAY;AAAA,wBACxB,MAAO;AAAA,wBACP,SAAU;AAAA,wBACV,wBAAsB;AAAA,wBACtB,UAAW,CAAE;AAAA,wBACb,WACC,qBACA;AAAA,wBAED,MAAK;AAAA;AAAA,oBACN,GACD;AAAA,oBACA;AAAA,sBAAC;AAAA;AAAA,wBACA,cAAe;AAAA;AAAA,oBAChB;AAAA;AAAA;AAAA,cACD;AAAA;AAAA;AAAA,QACD;AAAA,QAGD;AAAA,UAAC;AAAA;AAAA,YACA,MAAO;AAAA,YACP,cAAe;AAAA;AAAA,QAChB;AAAA;AAAA,IACD;AAAA,IACA,oBAAC,sBAAmB;AAAA,KACrB;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { FlexItem, Flex, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, seen, backup } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch, usePrevious } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport GlobalStylesUI from '../global-styles';\nimport { GlobalStylesActionMenu } from '../global-styles/menu';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport DefaultSidebar from './default-sidebar';\nimport WelcomeGuideStyles from './welcome-guide';\n\nexport default function GlobalStylesSidebar() {\n\tconst {\n\t\tshouldResetNavigation,\n\t\tstylesPath,\n\t\tshowStylebook,\n\t\tshowListViewByDefault,\n\t\thasRevisions,\n\t\tactiveComplementaryArea,\n\t\teditorSettings,\n\t} = useSelect( ( select ) => {\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getStylesPath, getShowStylebook } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\t\tconst _isVisualEditorMode =\n\t\t\t'visual' === select( editorStore ).getEditorMode();\n\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'showListViewByDefault'\n\t\t);\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tstylesPath: getStylesPath(),\n\t\t\tshowStylebook: getShowStylebook(),\n\t\t\tshouldResetNavigation:\n\t\t\t\t'edit-site/global-styles' !==\n\t\t\t\t\tgetActiveComplementaryArea( 'core' ) ||\n\t\t\t\t! _isVisualEditorMode,\n\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\thasRevisions:\n\t\t\t\t!! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count,\n\t\t\tactiveComplementaryArea:\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' ),\n\t\t\teditorSettings: select( editorStore ).getEditorSettings(),\n\t\t};\n\t}, [] );\n\tconst { setStylesPath, setShowStylebook, resetStylesNavigation } = unlock(\n\t\tuseDispatch( editorStore )\n\t);\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\t// Derive state from path and showStylebook\n\tconst isRevisionsOpened =\n\t\tstylesPath.startsWith( '/revisions' ) && ! showStylebook;\n\tconst isRevisionsStyleBookOpened =\n\t\tstylesPath.startsWith( '/revisions' ) && showStylebook;\n\n\tconst previousActiveArea = usePrevious( activeComplementaryArea );\n\n\t// Reset navigation when sidebar opens\n\tuseEffect( () => {\n\t\tif (\n\t\t\tactiveComplementaryArea === 'edit-site/global-styles' &&\n\t\t\tpreviousActiveArea !== 'edit-site/global-styles'\n\t\t) {\n\t\t\tresetStylesNavigation();\n\t\t}\n\t}, [ activeComplementaryArea, previousActiveArea, resetStylesNavigation ] );\n\n\tuseEffect( () => {\n\t\tif ( shouldResetNavigation ) {\n\t\t\tresetStylesNavigation();\n\t\t}\n\t}, [ shouldResetNavigation, resetStylesNavigation ] );\n\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\n\tconst toggleRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tif ( isRevisionsOpened || isRevisionsStyleBookOpened ) {\n\t\t\t// Close revisions, go back to root\n\t\t\tsetStylesPath( '/' );\n\t\t} else {\n\t\t\t// Open revisions\n\t\t\tsetStylesPath( '/revisions' );\n\t\t}\n\t};\n\tconst toggleStyleBook = () => {\n\t\tsetIsListViewOpened( showStylebook && showListViewByDefault );\n\t\tsetShowStylebook( ! showStylebook );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<DefaultSidebar\n\t\t\t\tclassName=\"editor-global-styles-sidebar\"\n\t\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\ticon={ styles }\n\t\t\t\tcloseLabel={ __( 'Close Styles' ) }\n\t\t\t\tpanelClassName=\"editor-global-styles-sidebar__panel\"\n\t\t\t\theader={\n\t\t\t\t\t<Flex\n\t\t\t\t\t\tclassName=\"editor-global-styles-sidebar__header\"\n\t\t\t\t\t\tgap={ 1 }\n\t\t\t\t\t>\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<h2 className=\"editor-global-styles-sidebar__header-title\">\n\t\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t<Flex\n\t\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t\t\tgap={ 1 }\n\t\t\t\t\t\t\tclassName=\"editor-global-styles-sidebar__header-actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\t\t\tisPressed={ showStylebook }\n\t\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\t\tdisabled={ shouldResetNavigation }\n\t\t\t\t\t\t\t\t\t\tonClick={ toggleStyleBook }\n\t\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t\t\t\t\tonClick={ toggleRevisions }\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t\tdisabled={ ! hasRevisions }\n\t\t\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\t\t\tisRevisionsOpened ||\n\t\t\t\t\t\t\t\t\t\tisRevisionsStyleBookOpened\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t\t<GlobalStylesActionMenu\n\t\t\t\t\t\t\t\tonChangePath={ setStylesPath }\n\t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A,QACX,OAAQ,GAAI,QAAS;AAAA,QACrB,MAAO;AAAA,QACP,YAAa,GAAI,cAAe;AAAA,QAChC,gBAAe;AAAA,QACf,QACC;AAAA,UAAC;AAAA;AAAA,YACA,WAAU;AAAA,YACV,KAAM;AAAA,YAEN;AAAA,kCAAC,YACA,8BAAC,QAAG,WAAU,8CACX,aAAI,QAAS,GAChB,GACD;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACA,SAAQ;AAAA,kBACR,KAAM;AAAA,kBACN,WAAU;AAAA,kBAER;AAAA,qBAAE,oBACH,oBAAC,YACA;AAAA,sBAAC;AAAA;AAAA,wBACA,MAAO;AAAA,wBACP,OAAQ,GAAI,YAAa;AAAA,wBACzB,WAAY;AAAA,wBACZ,wBAAsB;AAAA,wBACtB,UAAW;AAAA,wBACX,SAAU;AAAA,wBACV,MAAK;AAAA;AAAA,oBACN,GACD;AAAA,oBAED,oBAAC,YACA;AAAA,sBAAC;AAAA;AAAA,wBACA,OAAQ,GAAI,WAAY;AAAA,wBACxB,MAAO;AAAA,wBACP,SAAU;AAAA,wBACV,wBAAsB;AAAA,wBACtB,UAAW,CAAE;AAAA,wBACb,WACC,qBACA;AAAA,wBAED,MAAK;AAAA;AAAA,oBACN,GACD;AAAA,oBACA;AAAA,sBAAC;AAAA;AAAA,wBACA,cAAe;AAAA;AAAA,oBAChB;AAAA;AAAA;AAAA,cACD;AAAA;AAAA;AAAA,QACD;AAAA,QAGD;AAAA,UAAC;AAAA;AAAA,YACA,MAAO;AAAA,YACP,cAAe;AAAA,YACf,UAAW;AAAA;AAAA,QACZ;AAAA;AAAA,IACD;AAAA,IACA,oBAAC,sBAAmB;AAAA,KACrB;AAEF;",
6
6
  "names": []
7
7
  }
@@ -170,6 +170,7 @@ function PostParentToggle({ isOpen, onClick }) {
170
170
  Button,
171
171
  {
172
172
  size: "compact",
173
+ className: "editor-post-parent__panel-toggle",
173
174
  variant: "tertiary",
174
175
  "aria-expanded": isOpen,
175
176
  "aria-label": (