@wordpress/boot 0.27.0 → 0.28.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 (63) hide show
  1. package/build-module/components/app/index.mjs.map +1 -1
  2. package/build-module/components/app/router.mjs +24 -24
  3. package/build-module/components/app/router.mjs.map +1 -1
  4. package/build-module/components/app/use-route-focus.mjs +162 -0
  5. package/build-module/components/app/use-route-focus.mjs.map +1 -0
  6. package/build-module/components/app/use-route-title.mjs +6 -1
  7. package/build-module/components/app/use-route-title.mjs.map +1 -1
  8. package/build-module/components/canvas/index.mjs +1 -1
  9. package/build-module/components/canvas/index.mjs.map +1 -1
  10. package/build-module/components/canvas/use-navigate-to-entity-record.mjs +20 -12
  11. package/build-module/components/canvas/use-navigate-to-entity-record.mjs.map +1 -1
  12. package/build-module/components/navigation/drilldown-item/index.mjs +3 -3
  13. package/build-module/components/navigation/drilldown-item/index.mjs.map +1 -1
  14. package/build-module/components/navigation/dropdown-item/index.mjs +3 -3
  15. package/build-module/components/navigation/dropdown-item/index.mjs.map +1 -1
  16. package/build-module/components/navigation/navigation-item/index.mjs +3 -3
  17. package/build-module/components/navigation/navigation-item/index.mjs.map +1 -1
  18. package/build-module/components/navigation/navigation-screen/index.mjs +5 -5
  19. package/build-module/components/navigation/navigation-screen/index.mjs.map +1 -1
  20. package/build-module/components/navigation/router-link-item.mjs.map +1 -1
  21. package/build-module/components/plugin-area/index.mjs +5 -1
  22. package/build-module/components/plugin-area/index.mjs.map +1 -1
  23. package/build-module/components/root/index.mjs +28 -25
  24. package/build-module/components/root/index.mjs.map +1 -1
  25. package/build-module/components/root/single-page.mjs +28 -25
  26. package/build-module/components/root/single-page.mjs.map +1 -1
  27. package/build-module/components/save-button/index.mjs +8 -3
  28. package/build-module/components/save-button/index.mjs.map +1 -1
  29. package/build-module/components/save-panel/index.mjs +3 -1
  30. package/build-module/components/save-panel/index.mjs.map +1 -1
  31. package/build-module/components/sidebar/index.mjs +11 -11
  32. package/build-module/components/sidebar/index.mjs.map +1 -1
  33. package/build-types/components/app/use-route-focus.d.ts +14 -0
  34. package/build-types/components/app/use-route-focus.d.ts.map +1 -0
  35. package/build-types/components/canvas/use-navigate-to-entity-record.d.ts +3 -1
  36. package/build-types/components/canvas/use-navigate-to-entity-record.d.ts.map +1 -1
  37. package/build-types/components/root/index.d.ts.map +1 -1
  38. package/build-types/components/root/single-page.d.ts.map +1 -1
  39. package/build-types/components/save-button/index.d.ts.map +1 -1
  40. package/build-types/components/save-panel/index.d.ts.map +1 -1
  41. package/build-types/components/sidebar/index.d.ts.map +1 -1
  42. package/package.json +35 -28
  43. package/src/components/app/test/fixtures/own-focus.tsx +22 -0
  44. package/src/components/app/test/fixtures/settings-general.tsx +21 -0
  45. package/src/components/app/test/fixtures/settings.tsx +10 -0
  46. package/src/components/app/test/navigation-focus.browser.test.tsx +108 -0
  47. package/src/components/app/use-route-focus.ts +53 -0
  48. package/src/components/canvas/index.tsx +1 -1
  49. package/src/components/canvas/use-navigate-to-entity-record.ts +33 -16
  50. package/src/components/navigation/drilldown-item/index.tsx +3 -3
  51. package/src/components/navigation/dropdown-item/index.tsx +3 -3
  52. package/src/components/navigation/navigation-item/index.tsx +3 -3
  53. package/src/components/navigation/navigation-item/style.module.scss +13 -7
  54. package/src/components/navigation/navigation-screen/style.module.scss +1 -1
  55. package/src/components/navigation/router-link-item.tsx +3 -3
  56. package/src/components/root/_layout.module.scss +7 -0
  57. package/src/components/root/index.tsx +4 -1
  58. package/src/components/root/single-page.tsx +4 -1
  59. package/src/components/root/test/admin-scheme-sidebar.browser.test.tsx +120 -0
  60. package/src/components/save-button/index.tsx +7 -2
  61. package/src/components/save-panel/index.tsx +4 -1
  62. package/src/components/sidebar/index.tsx +10 -6
  63. package/src/components/sidebar/style.module.scss +1 -0
@@ -1,12 +1,11 @@
1
1
  import { useCallback, useMemo } from "@wordpress/element";
2
2
  import { useDispatch, useRegistry, useSelect } from "@wordpress/data";
3
3
  import { store } from "@wordpress/core-data";
4
- import { store as store$1 } from "@wordpress/editor";
5
- import { store as store$2 } from "@wordpress/notices";
4
+ import { store as store$1 } from "@wordpress/notices";
6
5
  import { decodeEntities } from "@wordpress/html-entities";
7
6
  import { __, sprintf } from "@wordpress/i18n";
8
7
  import { privateApis, useNavigate, useSearch } from "@wordpress/route";
9
- import { store as store$3 } from "../../store/index.mjs";
8
+ import { store as store$2 } from "../../store/index.mjs";
10
9
  import { isValidViewport } from "./viewport.mjs";
11
10
  import { unlock } from "../../lock-unlock.mjs";
12
11
  // packages/boot/src/components/canvas/use-navigate-to-entity-record.ts
@@ -20,19 +19,22 @@ const { useCanGoBack, useRouter } = unlock(privateApis);
20
19
  * gates the inspector's edit affordance and `onNavigateToPreviousEntityRecord`
21
20
  * gates the document bar's back button.
22
21
  *
22
+ * @param postType Post type rendered in the canvas, if the route names one.
23
+ * @param postId Post ID rendered in the canvas, if the route names one.
23
24
  * @return The two callbacks, for spreading into the editor settings.
24
25
  */
25
- function useNavigateToEntityRecord() {
26
+ function useNavigateToEntityRecord(postType, postId) {
26
27
  const navigate = useNavigate();
27
28
  const search = useSearch({ strict: false });
28
29
  const registry = useRegistry();
29
- const getEntityLink = useSelect((select) => select(store$3).getEntityLink, []);
30
+ const getEntityLink = useSelect((select) => select(store$2).getEntityLink, []);
30
31
  const router = useRouter();
31
32
  const canGoBack = useCanGoBack();
32
33
  const onNavigateToEntityRecord = useCallback((params) => {
33
- const currentPostType = registry.select(store$1).getCurrentPostType();
34
- const currentPostId = registry.select(store$1).getCurrentPostId();
35
- const selectedBlock = registry.select(store).getEntityRecordEdits("postType", currentPostType, currentPostId)?.selection?.selectionStart?.clientId;
34
+ const homePage = postType || postId ? null : unlock(registry.select(store)).getHomePage();
35
+ const currentPostType = postType || homePage?.postType;
36
+ const currentPostId = postId || homePage?.postId;
37
+ const selectedBlock = (currentPostType && currentPostId ? registry.select(store).getEntityRecordEdits("postType", currentPostType, currentPostId) : void 0)?.selection?.selectionStart?.clientId;
36
38
  if (selectedBlock) navigate({
37
39
  search: (previous) => ({
38
40
  ...previous,
@@ -53,7 +55,9 @@ function useNavigateToEntityRecord() {
53
55
  }, [
54
56
  navigate,
55
57
  registry,
56
- getEntityLink
58
+ getEntityLink,
59
+ postType,
60
+ postId
57
61
  ]);
58
62
  const isFocusMode = !!search.focusMode;
59
63
  return {
@@ -77,8 +81,8 @@ function useNavigateToEntityRecord() {
77
81
  */
78
82
  function useActionPerformed(postType) {
79
83
  const navigate = useNavigate();
80
- const { createSuccessNotice } = useDispatch(store$2);
81
- const getEntityLink = useSelect((select) => select(store$3).getEntityLink, []);
84
+ const { createSuccessNotice } = useDispatch(store$1);
85
+ const getEntityLink = useSelect((select) => select(store$2).getEntityLink, []);
82
86
  return useCallback((actionId, items) => {
83
87
  switch (actionId) {
84
88
  case "move-to-trash":
@@ -96,7 +100,11 @@ function useActionPerformed(postType) {
96
100
  const to = getEntityLink(newItem.type, newItem.id);
97
101
  if (!to) break;
98
102
  const title = typeof newItem.title === "string" ? newItem.title : newItem.title?.rendered;
99
- createSuccessNotice(sprintf(__("\"%s\" successfully created."), decodeEntities(title ?? "") || __("(no title)")), {
103
+ createSuccessNotice(sprintf(
104
+ /** translators: %s: Title of the created post, e.g: "Hello world". */
105
+ __("\"%s\" successfully created."),
106
+ decodeEntities(title ?? "") || __("(no title)")
107
+ ), {
100
108
  type: "snackbar",
101
109
  id: "duplicate-post-action",
102
110
  actions: [{
@@ -1 +1 @@
1
- {"version":3,"file":"use-navigate-to-entity-record.mjs","names":["routePrivateApis","bootStore","editorStore","coreStore","noticesStore"],"sources":["../../../src/components/canvas/use-navigate-to-entity-record.ts"],"sourcesContent":["import { useCallback, useMemo } from '@wordpress/element';\nimport { useDispatch, useRegistry, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseNavigate,\n\tuseSearch,\n\tprivateApis as routePrivateApis,\n} from '@wordpress/route';\nimport { store as bootStore } from '../../store';\nimport { isValidViewport } from './viewport';\nimport { unlock } from '../../lock-unlock';\n\nconst { useCanGoBack, useRouter } = unlock( routePrivateApis );\n\n/*\n * The route tree is assembled from routes registered at runtime, so TanStack has\n * no search schema to infer and types `search` against a placeholder. Describe\n * the two calls this module makes instead.\n */\ntype Navigate = ( options: {\n\tto?: string;\n\treplace?: boolean;\n\tsearch?: (\n\t\tprevious: Record< string, unknown >\n\t) => Record< string, unknown >;\n} ) => void;\n\ninterface NavigateParams {\n\tpostType: string;\n\tpostId: string;\n\tviewport?: string;\n}\n\n/**\n * Builds the editor's entity navigation callbacks.\n *\n * The editor uses these to move between an entity and one nested inside it —\n * a template part or a synced pattern reached from the block inspector. They\n * are passed through the editor settings, where `onNavigateToEntityRecord`\n * gates the inspector's edit affordance and `onNavigateToPreviousEntityRecord`\n * gates the document bar's back button.\n *\n * @return The two callbacks, for spreading into the editor settings.\n */\nexport default function useNavigateToEntityRecord() {\n\tconst navigate = useNavigate() as Navigate;\n\tconst search = useSearch( { strict: false } ) as { focusMode?: unknown };\n\tconst registry = useRegistry();\n\tconst getEntityLink = useSelect(\n\t\t( select ) => select( bootStore ).getEntityLink,\n\t\t[]\n\t);\n\tconst router = useRouter();\n\tconst canGoBack = useCanGoBack();\n\n\tconst onNavigateToEntityRecord = useCallback(\n\t\t( params: NavigateParams ) => {\n\t\t\t/*\n\t\t\t * Stash the block selected in the entity being left, so returning to\n\t\t\t * it can restore the user's place. The edits hold the external\n\t\t\t * client ID, which `onChangeSelection` has already resolved.\n\t\t\t */\n\t\t\tconst currentPostType = (\n\t\t\t\tregistry.select( editorStore ) as any\n\t\t\t ).getCurrentPostType();\n\t\t\tconst currentPostId = (\n\t\t\t\tregistry.select( editorStore ) as any\n\t\t\t ).getCurrentPostId();\n\t\t\tconst edits = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityRecordEdits(\n\t\t\t\t\t'postType',\n\t\t\t\t\tcurrentPostType,\n\t\t\t\t\tcurrentPostId\n\t\t\t\t) as { selection?: { selectionStart?: { clientId?: string } } };\n\t\t\tconst selectedBlock = edits?.selection?.selectionStart?.clientId;\n\n\t\t\tif ( selectedBlock ) {\n\t\t\t\tnavigate( {\n\t\t\t\t\tsearch: ( previous: Record< string, unknown > ) => ( {\n\t\t\t\t\t\t...previous,\n\t\t\t\t\t\tselectedBlock,\n\t\t\t\t\t} ),\n\t\t\t\t\treplace: true,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * An entity can ask to be edited at a particular width — a\n\t\t\t * navigation overlay meant for mobile. The width is where the entity\n\t\t\t * opens, not something the entity being left carries away: a width\n\t\t\t * set from the device preview is view state, and an entity that asks\n\t\t\t * for none opens at the default.\n\t\t\t */\n\t\t\tconst requestedViewport = params.viewport?.toLowerCase();\n\t\t\tconst hasRequestedViewport = isValidViewport( requestedViewport );\n\n\t\t\t/*\n\t\t\t * `focusMode` marks the entity as one navigated into rather than\n\t\t\t * opened directly, which is what offers the way back out. The search\n\t\t\t * is replaced rather than extended so the block stashed above stays\n\t\t\t * with the entity it belongs to.\n\t\t\t */\n\t\t\tconst to = getEntityLink( params.postType, params.postId );\n\n\t\t\tif ( to ) {\n\t\t\t\tnavigate( {\n\t\t\t\t\tto,\n\t\t\t\t\tsearch: () => ( {\n\t\t\t\t\t\tfocusMode: true,\n\t\t\t\t\t\t...( hasRequestedViewport\n\t\t\t\t\t\t\t? { viewport: requestedViewport }\n\t\t\t\t\t\t\t: {} ),\n\t\t\t\t\t} ),\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ navigate, registry, getEntityLink ]\n\t);\n\n\t/*\n\t * Only entities navigated into offer a way back out. The editor reads this\n\t * as the entity being a focused one, giving it the document bar's back\n\t * button and the surrounding padding, so an entity opened directly — from a\n\t * list, say — must not have it. `canGoBack` covers reloading such a URL,\n\t * where the marker survives but the history to return to does not.\n\t */\n\tconst isFocusMode = !! search.focusMode;\n\tconst onNavigateToPreviousEntityRecord = useMemo(\n\t\t() =>\n\t\t\tisFocusMode && canGoBack ? () => router.history.back() : undefined,\n\t\t[ isFocusMode, canGoBack, router ]\n\t);\n\n\treturn { onNavigateToEntityRecord, onNavigateToPreviousEntityRecord };\n}\n\ninterface ActionItem {\n\tid: string | number;\n\ttype: string;\n\ttitle?: string | { rendered?: string };\n}\n\n/**\n * Builds the callback the editor runs after a post action.\n *\n * Actions taken from inside the editor act on the entity being edited, so\n * trashing or deleting one leaves the canvas showing something that is no\n * longer there, and duplicating one gives no way to reach the copy.\n *\n * @param postType Post type rendered in the canvas.\n * @return The callback, for passing to the editor.\n */\nexport function useActionPerformed( postType?: string ) {\n\tconst navigate = useNavigate() as Navigate;\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst getEntityLink = useSelect(\n\t\t( select ) => select( bootStore ).getEntityLink,\n\t\t[]\n\t);\n\n\treturn useCallback(\n\t\t( actionId: string, items: ActionItem[] ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\tcase 'permanently-delete':\n\t\t\t\tcase 'delete-post': {\n\t\t\t\t\tconst to = postType && getEntityLink( postType );\n\n\t\t\t\t\tif ( to ) {\n\t\t\t\t\t\tnavigate( { to, search: () => ( {} ) } );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'duplicate-post': {\n\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\tconst to = getEntityLink( newItem.type, newItem.id );\n\n\t\t\t\t\tif ( ! to ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst title =\n\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t: newItem.title?.rendered;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * The action has already announced the copy under this id.\n\t\t\t\t\t * Reissuing it under the same id replaces that notice rather\n\t\t\t\t\t * than stacking a second one, and adds the way to reach it.\n\t\t\t\t\t */\n\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t// translators: %s: Title of the created post, e.g: \"Hello world\".\n\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\tdecodeEntities( title ?? '' ) || __( '(no title)' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\tonClick: () => navigate( { to } ),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ navigate, createSuccessNotice, getEntityLink, postType ]\n\t);\n}\n"],"mappings":";;;;;;;;;;;;AAgBA,MAAM,EAAE,cAAc,cAAc,OAAQA,WAAiB;;;;;;;;;;;;AAgC7D,SAAwB,4BAA4B;CACnD,MAAM,WAAW,YAAY;CAC7B,MAAM,SAAS,UAAW,EAAE,QAAQ,MAAM,CAAE;CAC5C,MAAM,WAAW,YAAY;CAC7B,MAAM,gBAAgB,WACnB,WAAY,OAAQC,OAAU,CAAC,CAAC,eAClC,CAAC,CACF;CACA,MAAM,SAAS,UAAU;CACzB,MAAM,YAAY,aAAa;CAE/B,MAAM,2BAA2B,aAC9B,WAA4B;EAM7B,MAAM,kBACL,SAAS,OAAQC,OAAY,CAAC,CAC5B,mBAAmB;EACtB,MAAM,gBACL,SAAS,OAAQA,OAAY,CAAC,CAC5B,iBAAiB;EAQpB,MAAM,gBAPQ,SACZ,OAAQC,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,EAAG,KAAK,GAAI,YAAa,CACnD,GACA;KACC,MAAM;KACN,IAAI;KACJ,SAAS,CACR;MACC,OAAO,GAAI,MAAO;MAClB,eAAe,SAAU,EAAE,GAAG,CAAE;KACjC,CACD;IACD,CACD;IACA;GACD;EACD;CACD,GACA;EAAE;EAAU;EAAqB;EAAe;CAAS,CAC1D;AACD"}
1
+ {"version":3,"file":"use-navigate-to-entity-record.mjs","names":["routePrivateApis","bootStore","coreStore","noticesStore"],"sources":["../../../src/components/canvas/use-navigate-to-entity-record.ts"],"sourcesContent":["import { useCallback, useMemo } from '@wordpress/element';\nimport { useDispatch, useRegistry, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseNavigate,\n\tuseSearch,\n\tprivateApis as routePrivateApis,\n} from '@wordpress/route';\nimport { store as bootStore } from '../../store';\nimport { isValidViewport } from './viewport';\nimport { unlock } from '../../lock-unlock';\n\nconst { useCanGoBack, useRouter } = unlock( routePrivateApis );\n\n/*\n * The route tree is assembled from routes registered at runtime, so TanStack has\n * no search schema to infer and types `search` against a placeholder. Describe\n * the two calls this module makes instead.\n */\ntype Navigate = ( options: {\n\tto?: string;\n\treplace?: boolean;\n\tsearch?: (\n\t\tprevious: Record< string, unknown >\n\t) => Record< string, unknown >;\n} ) => void;\n\ninterface NavigateParams {\n\tpostType: string;\n\tpostId: string;\n\tviewport?: string;\n}\n\n/**\n * Builds the editor's entity navigation callbacks.\n *\n * The editor uses these to move between an entity and one nested inside it —\n * a template part or a synced pattern reached from the block inspector. They\n * are passed through the editor settings, where `onNavigateToEntityRecord`\n * gates the inspector's edit affordance and `onNavigateToPreviousEntityRecord`\n * gates the document bar's back button.\n *\n * @param postType Post type rendered in the canvas, if the route names one.\n * @param postId Post ID rendered in the canvas, if the route names one.\n * @return The two callbacks, for spreading into the editor settings.\n */\nexport default function useNavigateToEntityRecord(\n\tpostType?: string,\n\tpostId?: string\n) {\n\tconst navigate = useNavigate() as Navigate;\n\tconst search = useSearch( { strict: false } ) as { focusMode?: unknown };\n\tconst registry = useRegistry();\n\tconst getEntityLink = useSelect(\n\t\t( select ) => select( bootStore ).getEntityLink,\n\t\t[]\n\t);\n\tconst router = useRouter();\n\tconst canGoBack = useCanGoBack();\n\n\tconst onNavigateToEntityRecord = useCallback(\n\t\t( params: NavigateParams ) => {\n\t\t\t/*\n\t\t\t * Stash the block selected in the entity being left, so returning to\n\t\t\t * it can restore the user's place. The edits hold the external\n\t\t\t * client ID, which `onChangeSelection` has already resolved.\n\t\t\t *\n\t\t\t * The entity being left is the one the canvas shows. A route that\n\t\t\t * names none shows the homepage, which the editor resolves the same\n\t\t\t * way.\n\t\t\t */\n\t\t\tconst homePage =\n\t\t\t\tpostType || postId\n\t\t\t\t\t? null\n\t\t\t\t\t: ( unlock(\n\t\t\t\t\t\t\tregistry.select( coreStore )\n\t\t\t\t\t\t).getHomePage() as {\n\t\t\t\t\t\t\tpostType?: string;\n\t\t\t\t\t\t\tpostId?: string;\n\t\t\t\t\t\t} | null );\n\t\t\tconst currentPostType = postType || homePage?.postType;\n\t\t\tconst currentPostId = postId || homePage?.postId;\n\t\t\tconst edits = (\n\t\t\t\tcurrentPostType && currentPostId\n\t\t\t\t\t? registry\n\t\t\t\t\t\t\t.select( coreStore )\n\t\t\t\t\t\t\t.getEntityRecordEdits(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\tcurrentPostType,\n\t\t\t\t\t\t\t\tcurrentPostId\n\t\t\t\t\t\t\t)\n\t\t\t\t\t: undefined\n\t\t\t) as { selection?: { selectionStart?: { clientId?: string } } };\n\t\t\tconst selectedBlock = edits?.selection?.selectionStart?.clientId;\n\n\t\t\tif ( selectedBlock ) {\n\t\t\t\tnavigate( {\n\t\t\t\t\tsearch: ( previous: Record< string, unknown > ) => ( {\n\t\t\t\t\t\t...previous,\n\t\t\t\t\t\tselectedBlock,\n\t\t\t\t\t} ),\n\t\t\t\t\treplace: true,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * An entity can ask to be edited at a particular width — a\n\t\t\t * navigation overlay meant for mobile. The width is where the entity\n\t\t\t * opens, not something the entity being left carries away: a width\n\t\t\t * set from the device preview is view state, and an entity that asks\n\t\t\t * for none opens at the default.\n\t\t\t */\n\t\t\tconst requestedViewport = params.viewport?.toLowerCase();\n\t\t\tconst hasRequestedViewport = isValidViewport( requestedViewport );\n\n\t\t\t/*\n\t\t\t * `focusMode` marks the entity as one navigated into rather than\n\t\t\t * opened directly, which is what offers the way back out. The search\n\t\t\t * is replaced rather than extended so the block stashed above stays\n\t\t\t * with the entity it belongs to.\n\t\t\t */\n\t\t\tconst to = getEntityLink( params.postType, params.postId );\n\n\t\t\tif ( to ) {\n\t\t\t\tnavigate( {\n\t\t\t\t\tto,\n\t\t\t\t\tsearch: () => ( {\n\t\t\t\t\t\tfocusMode: true,\n\t\t\t\t\t\t...( hasRequestedViewport\n\t\t\t\t\t\t\t? { viewport: requestedViewport }\n\t\t\t\t\t\t\t: {} ),\n\t\t\t\t\t} ),\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ navigate, registry, getEntityLink, postType, postId ]\n\t);\n\n\t/*\n\t * Only entities navigated into offer a way back out. The editor reads this\n\t * as the entity being a focused one, giving it the document bar's back\n\t * button and the surrounding padding, so an entity opened directly — from a\n\t * list, say — must not have it. `canGoBack` covers reloading such a URL,\n\t * where the marker survives but the history to return to does not.\n\t */\n\tconst isFocusMode = !! search.focusMode;\n\tconst onNavigateToPreviousEntityRecord = useMemo(\n\t\t() =>\n\t\t\tisFocusMode && canGoBack ? () => router.history.back() : undefined,\n\t\t[ isFocusMode, canGoBack, router ]\n\t);\n\n\treturn { onNavigateToEntityRecord, onNavigateToPreviousEntityRecord };\n}\n\ninterface ActionItem {\n\tid: string | number;\n\ttype: string;\n\ttitle?: string | { rendered?: string };\n}\n\n/**\n * Builds the callback the editor runs after a post action.\n *\n * Actions taken from inside the editor act on the entity being edited, so\n * trashing or deleting one leaves the canvas showing something that is no\n * longer there, and duplicating one gives no way to reach the copy.\n *\n * @param postType Post type rendered in the canvas.\n * @return The callback, for passing to the editor.\n */\nexport function useActionPerformed( postType?: string ) {\n\tconst navigate = useNavigate() as Navigate;\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst getEntityLink = useSelect(\n\t\t( select ) => select( bootStore ).getEntityLink,\n\t\t[]\n\t);\n\n\treturn useCallback(\n\t\t( actionId: string, items: ActionItem[] ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\tcase 'permanently-delete':\n\t\t\t\tcase 'delete-post': {\n\t\t\t\t\tconst to = postType && getEntityLink( postType );\n\n\t\t\t\t\tif ( to ) {\n\t\t\t\t\t\tnavigate( { to, search: () => ( {} ) } );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'duplicate-post': {\n\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\tconst to = getEntityLink( newItem.type, newItem.id );\n\n\t\t\t\t\tif ( ! to ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst title =\n\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t: newItem.title?.rendered;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * The action has already announced the copy under this id.\n\t\t\t\t\t * Reissuing it under the same id replaces that notice rather\n\t\t\t\t\t * than stacking a second one, and adds the way to reach it.\n\t\t\t\t\t */\n\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t// translators: %s: Title of the created post, e.g: \"Hello world\".\n\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\tdecodeEntities( title ?? '' ) || __( '(no title)' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\tonClick: () => navigate( { to } ),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ navigate, createSuccessNotice, getEntityLink, postType ]\n\t);\n}\n"],"mappings":";;;;;;;;;;;AAeA,MAAM,EAAE,cAAc,cAAc,OAAQA,WAAiB;;;;;;;;;;;;;;AAkC7D,SAAwB,0BACvB,UACA,QACC;CACD,MAAM,WAAW,YAAY;CAC7B,MAAM,SAAS,UAAW,EAAE,QAAQ,MAAM,CAAE;CAC5C,MAAM,WAAW,YAAY;CAC7B,MAAM,gBAAgB,WACnB,WAAY,OAAQC,OAAU,CAAC,CAAC,eAClC,CAAC,CACF;CACA,MAAM,SAAS,UAAU;CACzB,MAAM,YAAY,aAAa;CAE/B,MAAM,2BAA2B,aAC9B,WAA4B;EAU7B,MAAM,WACL,YAAY,SACT,OACE,OACF,SAAS,OAAQC,KAAU,CAC5B,CAAC,CAAC,YAAY;EAIjB,MAAM,kBAAkB,YAAY,UAAU;EAC9C,MAAM,gBAAgB,UAAU,UAAU;EAY1C,MAAM,iBAVL,mBAAmB,gBAChB,SACC,OAAQA,KAAU,CAAA,CAClB,qBACA,YACA,iBACA,aACD,IACA,KAAA,EAAA,EAEyB,WAAW,gBAAgB;EAExD,IAAK,eACJ,SAAU;GACT,SAAU,cAA2C;IACpD,GAAG;IACH;GACD;GACA,SAAS;EACV,CAAE;EAUH,MAAM,oBAAoB,OAAO,UAAU,YAAY;EACvD,MAAM,uBAAuB,gBAAiB,i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CAC1D;AACD"}
@@ -107,10 +107,10 @@ function registerStyle(hash, css) {
107
107
  for (const targetDocument of runtime.documents.keys()) injectStyle(targetDocument, hash, css);
108
108
  }
109
109
  // packages/boot/src/components/navigation/navigation-item/style.module.scss
110
- if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("8d0506d52b", "._873b0f189db62fa3__item._873b0f189db62fa3__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);line-height:var(--wpds-typography-line-height-sm,20px);margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}._873b0f189db62fa3__item._873b0f189db62fa3__item:focus,._873b0f189db62fa3__item._873b0f189db62fa3__item:hover,._873b0f189db62fa3__item._873b0f189db62fa3__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._873b0f189db62fa3__item._873b0f189db62fa3__item svg:last-child{padding:4px}._873b0f189db62fa3__item._873b0f189db62fa3__item[aria-current=page],._873b0f189db62fa3__item._873b0f189db62fa3__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}._873b0f189db62fa3__item._873b0f189db62fa3__item:focus-visible{transform:translateZ(0)}._873b0f189db62fa3__item._1ac4ca98dd21cec1__is-compact{min-height:24px}");
110
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("b211302088", ".f2cce29625927c0c__item.f2cce29625927c0c__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);line-height:var(--wpds-typography-line-height-sm,20px);margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.f2cce29625927c0c__item.f2cce29625927c0c__item svg:last-child{padding:4px}.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=page],.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=true],.f2cce29625927c0c__item.f2cce29625927c0c__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=page],.f2cce29625927c0c__item.f2cce29625927c0c__item[data-status=active]{font-weight:var(--wpds-typography-font-weight-emphasis,600)}.f2cce29625927c0c__item.f2cce29625927c0c__item:focus,.f2cce29625927c0c__item.f2cce29625927c0c__item:hover{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.f2cce29625927c0c__item.f2cce29625927c0c__item:focus-visible{transform:translateZ(0)}.f2cce29625927c0c__item._5c6a45f7e5600635__is-compact{min-height:24px}");
111
111
  var style_module_default = {
112
- "item": "_873b0f189db62fa3__item",
113
- "is-compact": "_1ac4ca98dd21cec1__is-compact"
112
+ "item": "f2cce29625927c0c__item",
113
+ "is-compact": "_5c6a45f7e5600635__is-compact"
114
114
  };
115
115
  // packages/boot/src/components/navigation/drilldown-item/index.tsx
116
116
  function DrilldownItem({ className, id, icon, shouldShowPlaceholder = true, children, onNavigate }) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["Item","styles","HStack","WCIcon"],"sources":["../../../../../style-runtime/src/index.ts","../../../../src/components/navigation/navigation-item/style.module.scss","../../../../src/components/navigation/drilldown-item/index.tsx"],"sourcesContent":["type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"8d0506d52b\", \"._873b0f189db62fa3__item._873b0f189db62fa3__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);line-height:var(--wpds-typography-line-height-sm,20px);margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}._873b0f189db62fa3__item._873b0f189db62fa3__item:focus,._873b0f189db62fa3__item._873b0f189db62fa3__item:hover,._873b0f189db62fa3__item._873b0f189db62fa3__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._873b0f189db62fa3__item._873b0f189db62fa3__item svg:last-child{padding:4px}._873b0f189db62fa3__item._873b0f189db62fa3__item[aria-current=page],._873b0f189db62fa3__item._873b0f189db62fa3__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}._873b0f189db62fa3__item._873b0f189db62fa3__item:focus-visible{transform:translateZ(0)}._873b0f189db62fa3__item._1ac4ca98dd21cec1__is-compact{min-height:24px}\");\n}\nexport default {\"item\":\"_873b0f189db62fa3__item\",\"is-compact\":\"_1ac4ca98dd21cec1__is-compact\"};\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport {\n\tFlexBlock,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tIcon as WCIcon,\n} from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall, chevronLeftSmall } from '@wordpress/icons';\nimport { wrapIcon } from '../items';\nimport type { IconType } from '../../../store/types';\nimport styles from '../navigation-item/style.module.scss';\n\ninterface DrilldownItemProps {\n\t/**\n\t * Optional CSS class name.\n\t */\n\tclassName?: string;\n\t/**\n\t * Identifier of the navigation item.\n\t */\n\tid: string;\n\t/**\n\t * Icon to display with the navigation item.\n\t */\n\ticon?: IconType;\n\t/**\n\t * Whether to show placeholder icons for alignment.\n\t */\n\tshouldShowPlaceholder?: boolean;\n\t/**\n\t * Content to display inside the navigation item.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Function to handle sidebar navigation when the item is clicked.\n\t */\n\tonNavigate: ( {\n\t\tid,\n\t\tdirection,\n\t}: {\n\t\tid?: string;\n\t\tdirection: 'forward' | 'backward';\n\t} ) => void;\n}\n\nexport default function DrilldownItem( {\n\tclassName,\n\tid,\n\ticon,\n\tshouldShowPlaceholder = true,\n\tchildren,\n\tonNavigate,\n}: DrilldownItemProps ) {\n\tconst handleClick = ( e: React.MouseEvent ) => {\n\t\te.preventDefault();\n\t\tonNavigate( { id, direction: 'forward' } );\n\t};\n\n\treturn (\n\t\t<Item\n\t\t\tclassName={ clsx( styles.item, className ) }\n\t\t\tonClick={ handleClick }\n\t\t>\n\t\t\t<HStack\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tspacing={ 2 }\n\t\t\t\tstyle={ { flexGrow: '1' } }\n\t\t\t>\n\t\t\t\t{ wrapI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CAAA;AAER"}
1
+ {"version":3,"file":"index.mjs","names":["WCItem","styles","HStack","WCIcon"],"sources":["../../../../../style-runtime/src/index.ts","../../../../src/components/navigation/navigation-item/style.module.scss","../../../../src/components/navigation/drilldown-item/index.tsx"],"sourcesContent":["type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"b211302088\", \".f2cce29625927c0c__item.f2cce29625927c0c__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);line-height:var(--wpds-typography-line-height-sm,20px);margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.f2cce29625927c0c__item.f2cce29625927c0c__item svg:last-child{padding:4px}.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=page],.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=true],.f2cce29625927c0c__item.f2cce29625927c0c__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=page],.f2cce29625927c0c__item.f2cce29625927c0c__item[data-status=active]{font-weight:var(--wpds-typography-font-weight-emphasis,600)}.f2cce29625927c0c__item.f2cce29625927c0c__item:focus,.f2cce29625927c0c__item.f2cce29625927c0c__item:hover{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.f2cce29625927c0c__item.f2cce29625927c0c__item:focus-visible{transform:translateZ(0)}.f2cce29625927c0c__item._5c6a45f7e5600635__is-compact{min-height:24px}\");\n}\nexport default {\"item\":\"f2cce29625927c0c__item\",\"is-compact\":\"_5c6a45f7e5600635__is-compact\"};\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport {\n\tFlexBlock,\n\t__experimentalItem as WCItem,\n\t__experimentalHStack as HStack,\n\tIcon as WCIcon,\n} from '@wordpress/components';\nimport { isRTL } from '@wordpress/i18n';\nimport { chevronRightSmall, chevronLeftSmall } from '@wordpress/icons';\nimport { wrapIcon } from '../items';\nimport type { IconType } from '../../../store/types';\nimport styles from '../navigation-item/style.module.scss';\n\ninterface DrilldownItemProps {\n\t/**\n\t * Optional CSS class name.\n\t */\n\tclassName?: string;\n\t/**\n\t * Identifier of the navigation item.\n\t */\n\tid: string;\n\t/**\n\t * Icon to display with the navigation item.\n\t */\n\ticon?: IconType;\n\t/**\n\t * Whether to show placeholder icons for alignment.\n\t */\n\tshouldShowPlaceholder?: boolean;\n\t/**\n\t * Content to display inside the navigation item.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Function to handle sidebar navigation when the item is clicked.\n\t */\n\tonNavigate: ( {\n\t\tid,\n\t\tdirection,\n\t}: {\n\t\tid?: string;\n\t\tdirection: 'forward' | 'backward';\n\t} ) => void;\n}\n\nexport default function DrilldownItem( {\n\tclassName,\n\tid,\n\ticon,\n\tshouldShowPlaceholder = true,\n\tchildren,\n\tonNavigate,\n}: DrilldownItemProps ) {\n\tconst handleClick = ( e: React.MouseEvent ) => {\n\t\te.preventDefault();\n\t\tonNavigate( { id, direction: 'forward' } );\n\t};\n\n\treturn (\n\t\t<WCItem\n\t\t\tclassName={ clsx( styles.item, className ) }\n\t\t\tonClick={ handleClick }\n\t\t>\n\t\t\t<HStack\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tspacing={ 2 }\n\t\t\t\tstyle={ { flexGrow: '1' } }\n\t\t\t>\n\t\t\t\t{ wrapIcon( icon, shouldShowPlaceholder ) }\n\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t<WCIcon\n\t\t\t\t\ticon={ isRTL() ? chevronLeftSmall : chevronRightSmall }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</WCItem>\n\t);\n}\n"],"mappings":";;;;;;;AAUA,MAAM,uBAAuB;;;;;;;;;AAU7B,SAAS,aAAa;CACrB,MAAM,cAAc;CAEpB,IAAK,YAAY,kBAChB,OAAO,YAAY;CAGpB,YAAY,mBAAmB;EAC9B,2BAAW,IAAI,IAAI;EACnB,wBAAQ,IAAI,IAAI;EAChB,gCAAgB,IAAI,QAAQ;CAC7B;CAEA,IAAK,OAAO,aAAa,aACxB,iBAAkB,QAAS;CAG5B,OAAO,YAAY;AACpB;;;;;;;;;AAUA,SAAS,0BACR,gBACA,MACU;CACV,IAAK,CAAE,eAAe,MACrB,OAAO;CAGR,KAAM,MAAM,SAAS,eAAe,KAAK,iBACxC,SAAU,qBAAsB,EACjC,GACC,IAAK,MAAM,aAAc,oBAAqB,MAAM,MACnD,OAAO;CAIT,OAAO;AACR;;;;;;;;;AAUA,SAAS,YAAa,gBAA0B,MAAc,KAAc;CAC3E,IAAK,CAAE,eAAe,MACrB;CAGD,MAAM,UAAU,WAAW;CAC3B,IAAI,iBAAiB,QAAQ,eAAe,IAAK,cAAe;CAEhE,IAAK,CAAE,gBAAiB;EACvB,iCAAiB,IAAI,IAAI;EACzB,QAAQ,eAAe,IAAK,gBAAgB,cAAe;CAC5D;CAEA,IAAK,eAAe,IAAK,IAAK,GAC7B;CAMD,IAAK,0BAA2B,gBAAgB,IAAK,GAAI;EACxD,eAAe,IAAK,IAAK;EACzB;CACD;CAEA,MAAM,QAAQ,eAAe,cAAe,OAAQ;CACpD,MAAM,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MAAM,qBAAsB;IACxC,oBAAC,WAAD,EAAa,SAAqB,CAAA;IAClC,oBAACC,MAAD,EACC,MAAO,MAAM,IAAI,mBAAmB,kBACpC,CAAA;GACM;;CACD,CAAA;AAEV"}
@@ -110,10 +110,10 @@ function registerStyle(hash, css) {
110
110
  for (const targetDocument of runtime.documents.keys()) injectStyle(targetDocument, hash, css);
111
111
  }
112
112
  // packages/boot/src/components/navigation/navigation-item/style.module.scss
113
- if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("8d0506d52b", "._873b0f189db62fa3__item._873b0f189db62fa3__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);line-height:var(--wpds-typography-line-height-sm,20px);margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}._873b0f189db62fa3__item._873b0f189db62fa3__item:focus,._873b0f189db62fa3__item._873b0f189db62fa3__item:hover,._873b0f189db62fa3__item._873b0f189db62fa3__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._873b0f189db62fa3__item._873b0f189db62fa3__item svg:last-child{padding:4px}._873b0f189db62fa3__item._873b0f189db62fa3__item[aria-current=page],._873b0f189db62fa3__item._873b0f189db62fa3__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}._873b0f189db62fa3__item._873b0f189db62fa3__item:focus-visible{transform:translateZ(0)}._873b0f189db62fa3__item._1ac4ca98dd21cec1__is-compact{min-height:24px}");
113
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("b211302088", ".f2cce29625927c0c__item.f2cce29625927c0c__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);line-height:var(--wpds-typography-line-height-sm,20px);margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.f2cce29625927c0c__item.f2cce29625927c0c__item svg:last-child{padding:4px}.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=page],.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=true],.f2cce29625927c0c__item.f2cce29625927c0c__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=page],.f2cce29625927c0c__item.f2cce29625927c0c__item[data-status=active]{font-weight:var(--wpds-typography-font-weight-emphasis,600)}.f2cce29625927c0c__item.f2cce29625927c0c__item:focus,.f2cce29625927c0c__item.f2cce29625927c0c__item:hover{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.f2cce29625927c0c__item.f2cce29625927c0c__item:focus-visible{transform:translateZ(0)}.f2cce29625927c0c__item._5c6a45f7e5600635__is-compact{min-height:24px}");
114
114
  var style_module_default$1 = {
115
- "item": "_873b0f189db62fa3__item",
116
- "is-compact": "_1ac4ca98dd21cec1__is-compact"
115
+ "item": "f2cce29625927c0c__item",
116
+ "is-compact": "_5c6a45f7e5600635__is-compact"
117
117
  };
118
118
  // packages/boot/src/components/navigation/dropdown-item/style.module.scss
119
119
  if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("afe932ce31", "._51fbf12353b41bfd__dropdown{display:block}.d62b19ea84deb921__dropdown-children{display:flex;flex-direction:column;margin-block-end:2px;margin-block-start:-2px;margin-inline-start:30px;overflow:hidden;padding:2px}._32fed855b8f13ebb__chevron._3ab794a15eff17b0__is-up{transform:rotate(180deg)}");
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["styles","Item","navigationItemStyles","HStack","WCIcon","AnimatePresence","motion"],"sources":["../../../../../style-runtime/src/index.ts","../../../../src/components/navigation/navigation-item/style.module.scss","../../../../src/components/navigation/dropdown-item/style.module.scss","../../../../src/components/navigation/dropdown-item/index.tsx"],"sourcesContent":["type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"8d0506d52b\", \"._873b0f189db62fa3__item._873b0f189db62fa3__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);line-height:var(--wpds-typography-line-height-sm,20px);margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}._873b0f189db62fa3__item._873b0f189db62fa3__item:focus,._873b0f189db62fa3__item._873b0f189db62fa3__item:hover,._873b0f189db62fa3__item._873b0f189db62fa3__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._873b0f189db62fa3__item._873b0f189db62fa3__item svg:last-child{padding:4px}._873b0f189db62fa3__item._873b0f189db62fa3__item[aria-current=page],._873b0f189db62fa3__item._873b0f189db62fa3__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}._873b0f189db62fa3__item._873b0f189db62fa3__item:focus-visible{transform:translateZ(0)}._873b0f189db62fa3__item._1ac4ca98dd21cec1__is-compact{min-height:24px}\");\n}\nexport default {\"item\":\"_873b0f189db62fa3__item\",\"is-compact\":\"_1ac4ca98dd21cec1__is-compact\"};\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"afe932ce31\", \"._51fbf12353b41bfd__dropdown{display:block}.d62b19ea84deb921__dropdown-children{display:flex;flex-direction:column;margin-block-end:2px;margin-block-start:-2px;margin-inline-start:30px;overflow:hidden;padding:2px}._32fed855b8f13ebb__chevron._3ab794a15eff17b0__is-up{transform:rotate(180deg)}\");\n}\nexport default {\"dropdown\":\"_51fbf12353b41bfd__dropdown\",\"dropdown-children\":\"d62b19ea84deb921__dropdown-children\",\"chevron\":\"_32fed855b8f13ebb__chevron\",\"is-up\":\"_3ab794a15eff17b0__is-up\"};\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport {\n\tFlexBlock,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n\tIcon as WCIcon,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { chevronDownSmall } from '@wordpress/icons';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { STORE_NAME } from '../../../store';\nimport NavigationItem from '../navigation-item';\nimport { wrapIcon } from '../items';\nimport type { IconType, MenuItem } from '../../../store/types';\nimport navigationItemStyles from '../navigation-item/style.module.scss';\nimport styles from './style.module.scss';\n\nconst ANIMATION_DURATION = 0.2;\n\ninterface DropdownItemProps {\n\t/**\n\t * Optional CSS class name.\n\t */\n\tclassName?: string;\n\t/**\n\t * Identifier of the parent menu item.\n\t */\n\tid: string;\n\t/**\n\t * Icon to display with the dropdown item.\n\t */\n\ticon?: IconType;\n\t/**\n\t * Whether to show placeholder icons for alignment.\n\t */\n\tshouldShowPlaceholder?: boolean;\n\t/**\n\t * Content to display inside the dropdown item.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Whether this dropdown is currently expanded.\n\t */\n\tisExpanded: boolean;\n\t/**\n\t * Function to toggle this dropdown's expanded state.\n\t */\n\tonToggle: () => void;\n}\n\nexport default function DropdownItem( {\n\tclassName,\n\tid,\n\ticon,\n\tchildren,\n\tisExpanded,\n\tonToggle,\n}: DropdownItemProps ) {\n\tconst menuItems: MenuItem[] = useSelect(\n\t\t( select ) =>\n\t\t\t// @ts-expect-error Store types are not available when selecting by store name.\n\t\t\tselect( STORE_NAME ).getMenuItems(),\n\t\t[]\n\t);\n\tconst items = menuItems.filter( ( item ) => item.parent === id );\n\tconst disableMotion = useReducedMotion();\n\treturn (\n\t\t<div className={ styles.dropdown }>\n\t\t\t<Item\n\t\t\t\tclassName={ clsx( navigationItemStyles.item, className ) }\n\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\tonToggle();\n\t\t\t\t} }\n\t\t\t\tonMouseDown={ ( e ) => e.preventDefault() }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\tstyle={ { flexGrow: '1' } }\n\t\t\t\t>\n\t\t\t\t\t{ wrapIcon( icon, false ) }\n\t\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t\t<WCIcon\n\t\t\t\t\t\ticon={ chevronDownSmall }\n\t\t\t\t\t\tclassName={ clsx( styles.chevron, {\n\t\t\t\t\t\t\t[ styles[ 'is-up' ] ]: isExpanded,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t/>\n\t\t\t\t</HStack>\n\t\t\t</Item>\n\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t{ isExpanded && (\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tinitial={ { height: 0 } }\n\t\t\t\t\t\tanimate={ { height: 'auto' } }\n\t\t\t\t\t\texit={ { height: 0 } }\n\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\tduration: disableMotion ? 0 : ANIMATION_DURATION,\n\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tclassName={ styles[ 'dropdown-children' ] }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ items.map( ( item, index ) => (\n\t\t\t\t\t\t\t<NavigationItem\n\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\tnavigationItemStyles[ 'is-compact' ]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tto={ item.to }\n\t\t\t\t\t\t\t\tshouldShowPlaceholder={ false }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ item.label }\n\t\t\t\t\t\t\t</NavigationItem>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</motion.div>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;;;AAUA,MAAM,uBAAuB;;;;;;;;;AAU7B,SAAS,aAAa;CACrB,MAAM,cAAc;CAEpB,IAAK,YAAY,kBAChB,OAAO,YAAY;CAGpB,YAAY,mBAAmB;EAC9B,2BAAW,IAAI,IAAI;EACnB,wBAAQ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BA,qBAAQ,WAAa,WACxB,CAAE;KACF,CAAA;IACM;;EACH,CAAA,GACN,oBAACK,2BAAD;GAAiB,SAAU;GACxB,UAAA,cACD,oBAACC,iBAAO,KAAR;IACC,SAAU,EAAE,QAAQ,EAAE;IACtB,SAAU,EAAE,QAAQ,OAAO;IAC3B,MAAO,EAAE,QAAQ,EAAE;IACnB,YAAa;KACZ,MAAM;KACN,UAAU,gBAAgB,IAAI;KAC9B,MAAM;IACP;IACA,WAAYN,qBAAQ;IAElB,UAAA,MAAM,KAAO,MAAM,UACpB,oBAAC,gBAAD;KAEC,WACCE,uBAAsB;KAEvB,IAAK,KAAK;KACV,uBAAwB;KAEtB,UAAA,KAAK;IACQ,GART,KAQS,CACf;GACS,CAAA;EAEG,CAAA,CACb;;AAEP"}
1
+ {"version":3,"file":"index.mjs","names":["styles","WCItem","navigationItemStyles","HStack","WCIcon","AnimatePresence","motion"],"sources":["../../../../../style-runtime/src/index.ts","../../../../src/components/navigation/navigation-item/style.module.scss","../../../../src/components/navigation/dropdown-item/style.module.scss","../../../../src/components/navigation/dropdown-item/index.tsx"],"sourcesContent":["type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"b211302088\", \".f2cce29625927c0c__item.f2cce29625927c0c__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);line-height:var(--wpds-typography-line-height-sm,20px);margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.f2cce29625927c0c__item.f2cce29625927c0c__item svg:last-child{padding:4px}.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=page],.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=true],.f2cce29625927c0c__item.f2cce29625927c0c__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=page],.f2cce29625927c0c__item.f2cce29625927c0c__item[data-status=active]{font-weight:var(--wpds-typography-font-weight-emphasis,600)}.f2cce29625927c0c__item.f2cce29625927c0c__item:focus,.f2cce29625927c0c__item.f2cce29625927c0c__item:hover{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.f2cce29625927c0c__item.f2cce29625927c0c__item:focus-visible{transform:translateZ(0)}.f2cce29625927c0c__item._5c6a45f7e5600635__is-compact{min-height:24px}\");\n}\nexport default {\"item\":\"f2cce29625927c0c__item\",\"is-compact\":\"_5c6a45f7e5600635__is-compact\"};\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"afe932ce31\", \"._51fbf12353b41bfd__dropdown{display:block}.d62b19ea84deb921__dropdown-children{display:flex;flex-direction:column;margin-block-end:2px;margin-block-start:-2px;margin-inline-start:30px;overflow:hidden;padding:2px}._32fed855b8f13ebb__chevron._3ab794a15eff17b0__is-up{transform:rotate(180deg)}\");\n}\nexport default {\"dropdown\":\"_51fbf12353b41bfd__dropdown\",\"dropdown-children\":\"d62b19ea84deb921__dropdown-children\",\"chevron\":\"_32fed855b8f13ebb__chevron\",\"is-up\":\"_3ab794a15eff17b0__is-up\"};\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport {\n\tFlexBlock,\n\t__experimentalItem as WCItem,\n\t__experimentalHStack as HStack,\n\tIcon as WCIcon,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { chevronDownSmall } from '@wordpress/icons';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { STORE_NAME } from '../../../store';\nimport NavigationItem from '../navigation-item';\nimport { wrapIcon } from '../items';\nimport type { IconType, MenuItem } from '../../../store/types';\nimport navigationItemStyles from '../navigation-item/style.module.scss';\nimport styles from './style.module.scss';\n\nconst ANIMATION_DURATION = 0.2;\n\ninterface DropdownItemProps {\n\t/**\n\t * Optional CSS class name.\n\t */\n\tclassName?: string;\n\t/**\n\t * Identifier of the parent menu item.\n\t */\n\tid: string;\n\t/**\n\t * Icon to display with the dropdown item.\n\t */\n\ticon?: IconType;\n\t/**\n\t * Whether to show placeholder icons for alignment.\n\t */\n\tshouldShowPlaceholder?: boolean;\n\t/**\n\t * Content to display inside the dropdown item.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * Whether this dropdown is currently expanded.\n\t */\n\tisExpanded: boolean;\n\t/**\n\t * Function to toggle this dropdown's expanded state.\n\t */\n\tonToggle: () => void;\n}\n\nexport default function DropdownItem( {\n\tclassName,\n\tid,\n\ticon,\n\tchildren,\n\tisExpanded,\n\tonToggle,\n}: DropdownItemProps ) {\n\tconst menuItems: MenuItem[] = useSelect(\n\t\t( select ) =>\n\t\t\t// @ts-expect-error Store types are not available when selecting by store name.\n\t\t\tselect( STORE_NAME ).getMenuItems(),\n\t\t[]\n\t);\n\tconst items = menuItems.filter( ( item ) => item.parent === id );\n\tconst disableMotion = useReducedMotion();\n\treturn (\n\t\t<div className={ styles.dropdown }>\n\t\t\t<WCItem\n\t\t\t\tclassName={ clsx( navigationItemStyles.item, className ) }\n\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\tonToggle();\n\t\t\t\t} }\n\t\t\t\tonMouseDown={ ( e ) => e.preventDefault() }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\tstyle={ { flexGrow: '1' } }\n\t\t\t\t>\n\t\t\t\t\t{ wrapIcon( icon, false ) }\n\t\t\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t\t\t\t<WCIcon\n\t\t\t\t\t\ticon={ chevronDownSmall }\n\t\t\t\t\t\tclassName={ clsx( styles.chevron, {\n\t\t\t\t\t\t\t[ styles[ 'is-up' ] ]: isExpanded,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t/>\n\t\t\t\t</HStack>\n\t\t\t</WCItem>\n\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t{ isExpanded && (\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tinitial={ { height: 0 } }\n\t\t\t\t\t\tanimate={ { height: 'auto' } }\n\t\t\t\t\t\texit={ { height: 0 } }\n\t\t\t\t\t\ttransition={ {\n\t\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\t\tduration: disableMotion ? 0 : ANIMATION_DURATION,\n\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tclassName={ styles[ 'dropdown-children' ] }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ items.map( ( item, index ) => (\n\t\t\t\t\t\t\t<NavigationItem\n\t\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t\tnavigationItemStyles[ 'is-compact' ]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tto={ item.to }\n\t\t\t\t\t\t\t\tshouldShowPlaceholder={ false }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ item.label }\n\t\t\t\t\t\t\t</Navig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Ae;IACjB,EAAE,gBAAgB;IAClB,SAAS;GACV;GACA,cAAgB,MAAO,EAAE,eAAe;GAExC,UAAA,qBAACC,sBAAD;IACC,SAAQ;IACR,SAAU;IACV,OAAQ,EAAE,UAAU,IAAI;IAHzB,UAAA;KAKG,SAAU,MAAM,KAAM;KACxB,oBAAC,WAAD,EAAa,SAAqB,CAAA;KAClC,oBAACC,MAAD;MACC,MAAO;MACP,WAAY,KAAMJ,qBAAO,SAAS,GAC/BA,qBAAQ,WAAa,WACxB,CAAE;KACF,CAAA;IACM;;EACD,CAAA,GACR,oBAACK,2BAAD;GAAiB,SAAU;GACxB,UAAA,cACD,oBAACC,iBAAO,KAAR;IACC,SAAU,EAAE,QAAQ,EAAE;IACtB,SAAU,EAAE,QAAQ,OAAO;IAC3B,MAAO,EAAE,QAAQ,EAAE;IACnB,YAAa;KACZ,MAAM;KACN,UAAU,gBAAgB,IAAI;KAC9B,MAAM;IACP;IACA,WAAYN,qBAAQ;IAElB,UAAA,MAAM,KAAO,MAAM,UACpB,oBAAC,gBAAD;KAEC,WACCE,uBAAsB;KAEvB,IAAK,KAAK;KACV,uBAAwB;KAEtB,UAAA,KAAK;IACQ,GART,KAQS,CACf;GACS,CAAA;EAEG,CAAA,CACb;;AAEP"}
@@ -106,10 +106,10 @@ function registerStyle(hash, css) {
106
106
  for (const targetDocument of runtime.documents.keys()) injectStyle(targetDocument, hash, css);
107
107
  }
108
108
  // packages/boot/src/components/navigation/navigation-item/style.module.scss
109
- if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("8d0506d52b", "._873b0f189db62fa3__item._873b0f189db62fa3__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);line-height:var(--wpds-typography-line-height-sm,20px);margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}._873b0f189db62fa3__item._873b0f189db62fa3__item:focus,._873b0f189db62fa3__item._873b0f189db62fa3__item:hover,._873b0f189db62fa3__item._873b0f189db62fa3__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._873b0f189db62fa3__item._873b0f189db62fa3__item svg:last-child{padding:4px}._873b0f189db62fa3__item._873b0f189db62fa3__item[aria-current=page],._873b0f189db62fa3__item._873b0f189db62fa3__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}._873b0f189db62fa3__item._873b0f189db62fa3__item:focus-visible{transform:translateZ(0)}._873b0f189db62fa3__item._1ac4ca98dd21cec1__is-compact{min-height:24px}");
109
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("b211302088", ".f2cce29625927c0c__item.f2cce29625927c0c__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\"Segoe UI\",\"Roboto\",\"Oxygen-Sans\",\"Ubuntu\",\"Cantarell\",\"Helvetica Neue\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);line-height:var(--wpds-typography-line-height-sm,20px);margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.f2cce29625927c0c__item.f2cce29625927c0c__item svg:last-child{padding:4px}.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=page],.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=true],.f2cce29625927c0c__item.f2cce29625927c0c__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=page],.f2cce29625927c0c__item.f2cce29625927c0c__item[data-status=active]{font-weight:var(--wpds-typography-font-weight-emphasis,600)}.f2cce29625927c0c__item.f2cce29625927c0c__item:focus,.f2cce29625927c0c__item.f2cce29625927c0c__item:hover{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.f2cce29625927c0c__item.f2cce29625927c0c__item:focus-visible{transform:translateZ(0)}.f2cce29625927c0c__item._5c6a45f7e5600635__is-compact{min-height:24px}");
110
110
  var style_module_default = {
111
- "item": "_873b0f189db62fa3__item",
112
- "is-compact": "_1ac4ca98dd21cec1__is-compact"
111
+ "item": "f2cce29625927c0c__item",
112
+ "is-compact": "_5c6a45f7e5600635__is-compact"
113
113
  };
114
114
  // packages/boot/src/components/navigation/navigation-item/index.tsx
115
115
  function NavigationItem({ className, icon, shouldShowPlaceholder = true, children, to }) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["HStack","Item","styles"],"sources":["../../../../../style-runtime/src/index.ts","../../../../src/components/navigation/navigation-item/style.module.scss","../../../../src/components/navigation/navigation-item/index.tsx"],"sourcesContent":["type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"8d0506d52b\", \"._873b0f189db62fa3__item._873b0f189db62fa3__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);line-height:var(--wpds-typography-line-height-sm,20px);margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}._873b0f189db62fa3__item._873b0f189db62fa3__item:focus,._873b0f189db62fa3__item._873b0f189db62fa3__item:hover,._873b0f189db62fa3__item._873b0f189db62fa3__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._873b0f189db62fa3__item._873b0f189db62fa3__item svg:last-child{padding:4px}._873b0f189db62fa3__item._873b0f189db62fa3__item[aria-current=page],._873b0f189db62fa3__item._873b0f189db62fa3__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}._873b0f189db62fa3__item._873b0f189db62fa3__item:focus-visible{transform:translateZ(0)}._873b0f189db62fa3__item._1ac4ca98dd21cec1__is-compact{min-height:24px}\");\n}\nexport default {\"item\":\"_873b0f189db62fa3__item\",\"is-compact\":\"_1ac4ca98dd21cec1__is-compact\"};\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport {\n\tFlexBlock,\n\t__experimentalItem as Item,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport RouterLinkItem from '../router-link-item';\nimport { wrapIcon } from '../items';\nimport type { IconType } from '../../../store/types';\nimport styles from './style.module.scss';\n\ninterface NavigationItemProps {\n\t/**\n\t * Optional CSS class name.\n\t */\n\tclassName?: string;\n\t/**\n\t * Icon to display with the navigation item.\n\t */\n\ticon?: IconType;\n\t/**\n\t * Whether to show placeholder icons for alignment.\n\t */\n\tshouldShowPlaceholder?: boolean;\n\t/**\n\t * Content to display inside the navigation item.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * The path to navigate to.\n\t */\n\tto: string;\n}\n\nexport default function NavigationItem( {\n\tclassName,\n\ticon,\n\tshouldShowPlaceholder = true,\n\tchildren,\n\tto,\n}: NavigationItemProps ) {\n\t// Check if the 'to' prop is an external URL\n\tconst isExternal = ! String(\n\t\tnew URL( to, window.location.origin )\n\t).startsWith( window.location.origin );\n\n\tconst content = (\n\t\t<HStack justify=\"flex-start\" spacing={ 2 } style={ { flexGrow: '1' } }>\n\t\t\t{ wrapIcon( icon, shouldShowPlaceholder ) }\n\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t</HStack>\n\t);\n\n\tif ( isExternal ) {\n\t\t// Render as a regular anchor tag for external URLs\n\t\treturn (\n\t\t\t<Item\n\t\t\t\tas=\"a\"\n\t\t\t\thref={ to }\n\t\t\t\tclassName={ clsx( styles.item, className ) }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Item>\n\t\t);\n\t}\n\n\treturn (\n\t\t<RouterLinkItem to={ to } className={ clsx( styles.item, className ) }>\n\t\t\t{ content }\n\t\t</RouterLinkItem>\n\t);\n}\n"],"mappings":";;;;;;AAUA,MAAM,uBAAuB;;;;;;;;;AAU7B,SAAS,aAAa;CACrB,MAAM,cAAc;CAEpB,IAAK,YAAY,kBAChB,OAAO,YAAY;CAGpB,YAAY,mBAAmB;EAC9B,2BAAW,IAAI,IAAI;EACnB,wBAAQ,IAAI,IAAI;EAChB,gCAAgB,IAAI,QAAQ;CAC7B;CAEA,IAAK,OAAO,aAAa,aACxB,iBAAkB,QAAS;CAG5B,OAAO,YAAY;AACpB;;;;;;;;;AAUA,SAAS,0BACR,gBACA,MACU;CACV,IAAK,CAAE,eAAe,MACrB,OAAO;CAGR,KAAM,MAAM,SAAS,eAAe,KAAK,iBACxC,SAAU,qBAAsB,EACjC,GACC,IAAK,MAA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AI,OAAO,YAAY,eAAe,QAAQ,IAAI,aAAa,QAC9D,cAAc,cAAc,2+CAA2+C;AAExgD,IAAA,uBAAe;CAAC,QAAO;CAA0B,cAAa;AAA+B;;AC+B7F,SAAwB,eAAgB,EACvC,WACA,MACA,wBAAwB,MACxB,UACA,MACwB;CAExB,MAAM,aAAa,CAAE,OACpB,IAAI,IAAK,IAAI,OAAO,SAAS,MAAO,CACrC,CAAC,CAAC,WAAY,OAAO,SAAS,MAAO;CAErC,MAAM,UACL,qBAACA,sBAAD;EAAQ,SAAQ;EAAa,SAAU;EAAI,OAAQ,EAAE,UAAU,IAAI;EAAnE,UAAA,CACG,SAAU,MAAM,qBAAsB,GACxC,oBAAC,WAAD,EAAa,SAAqB,CAAA,CAC3B;;CAGT,IAAK,YAEJ,OACC,oBAACC,oBAAD;EACC,IAAG;EACH,MAAO;EACP,WAAY,KAAMC,qBAAO,MAAM,SAAU;EAEvC,UAAA;CACG,CAAA;CAIR,OACC,oBAAC,gBAAD;EAAqB;EAAK,WAAY,KAAMA,qBAAO,MAAM,SAAU;EAChE,UAAA;CACa,CAAA;AAElB"}
1
+ {"version":3,"file":"index.mjs","names":["HStack","WCItem","styles"],"sources":["../../../../../style-runtime/src/index.ts","../../../../src/components/navigation/navigation-item/style.module.scss","../../../../src/components/navigation/navigation-item/index.tsx"],"sourcesContent":["type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"b211302088\", \".f2cce29625927c0c__item.f2cce29625927c0c__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,\\\"Segoe UI\\\",\\\"Roboto\\\",\\\"Oxygen-Sans\\\",\\\"Ubuntu\\\",\\\"Cantarell\\\",\\\"Helvetica Neue\\\",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);line-height:var(--wpds-typography-line-height-sm,20px);margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.f2cce29625927c0c__item.f2cce29625927c0c__item svg:last-child{padding:4px}.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=page],.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=true],.f2cce29625927c0c__item.f2cce29625927c0c__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.f2cce29625927c0c__item.f2cce29625927c0c__item[aria-current=page],.f2cce29625927c0c__item.f2cce29625927c0c__item[data-status=active]{font-weight:var(--wpds-typography-font-weight-emphasis,600)}.f2cce29625927c0c__item.f2cce29625927c0c__item:focus,.f2cce29625927c0c__item.f2cce29625927c0c__item:hover{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.f2cce29625927c0c__item.f2cce29625927c0c__item:focus-visible{transform:translateZ(0)}.f2cce29625927c0c__item._5c6a45f7e5600635__is-compact{min-height:24px}\");\n}\nexport default {\"item\":\"f2cce29625927c0c__item\",\"is-compact\":\"_5c6a45f7e5600635__is-compact\"};\n","import clsx from 'clsx';\nimport type { ReactNode } from 'react';\nimport {\n\tFlexBlock,\n\t__experimentalItem as WCItem,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport RouterLinkItem from '../router-link-item';\nimport { wrapIcon } from '../items';\nimport type { IconType } from '../../../store/types';\nimport styles from './style.module.scss';\n\ninterface NavigationItemProps {\n\t/**\n\t * Optional CSS class name.\n\t */\n\tclassName?: string;\n\t/**\n\t * Icon to display with the navigation item.\n\t */\n\ticon?: IconType;\n\t/**\n\t * Whether to show placeholder icons for alignment.\n\t */\n\tshouldShowPlaceholder?: boolean;\n\t/**\n\t * Content to display inside the navigation item.\n\t */\n\tchildren: ReactNode;\n\t/**\n\t * The path to navigate to.\n\t */\n\tto: string;\n}\n\nexport default function NavigationItem( {\n\tclassName,\n\ticon,\n\tshouldShowPlaceholder = true,\n\tchildren,\n\tto,\n}: NavigationItemProps ) {\n\t// Check if the 'to' prop is an external URL\n\tconst isExternal = ! String(\n\t\tnew URL( to, window.location.origin )\n\t).startsWith( window.location.origin );\n\n\tconst content = (\n\t\t<HStack justify=\"flex-start\" spacing={ 2 } style={ { flexGrow: '1' } }>\n\t\t\t{ wrapIcon( icon, shouldShowPlaceholder ) }\n\t\t\t<FlexBlock>{ children }</FlexBlock>\n\t\t</HStack>\n\t);\n\n\tif ( isExternal ) {\n\t\t// Render as a regular anchor tag for external URLs\n\t\treturn (\n\t\t\t<WCItem\n\t\t\t\tas=\"a\"\n\t\t\t\thref={ to }\n\t\t\t\tclassName={ clsx( styles.item, className ) }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</WCItem>\n\t\t);\n\t}\n\n\treturn (\n\t\t<RouterLinkItem to={ to } className={ clsx( styles.item, className ) }>\n\t\t\t{ content }\n\t\t</RouterLinkItem>\n\t);\n}\n"],"mappings":";;;;;;AAUA,MAAM,uBAAuB;;;;;;;;;AAU7B,SAAS,aAAa;CACrB,MAAM,cAAc;CAEpB,IAAK,YAAY,kBAChB,OAAO,YAAY;CAGpB,YAAY,mBAAmB;EAC9B,2BAAW,IAAI,IAAI;EACnB,wBAAQ,IAAI,IAAI;EAChB,gCAAgB,IAAI,QAAQ;CAC7B;CAEA,IAAK,OAAO,aAAa,aACxB,iBAAkB,QAAS;CAG5B,OAAO,YAAY;AACpB;;;;;;;;;AAUA,SAAS,0BACR,gBACA,MACU;CACV,IAAK,CAAE,eAAe,MACrB,OAAO;CAGR,KAAM,MAAM,SAAS,eAA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GACpD,YAAa,gBAAgB,MAAM,GAAI;AAEzC;;ACpKA,IAAI,OAAO,YAAY,eAAe,QAAQ,IAAI,aAAa,QAC9D,cAAc,cAAc,2jDAA2jD;AAExlD,IAAA,uBAAe;CAAC,QAAO;CAAyB,cAAa;AAA+B;;AC+B5F,SAAwB,eAAgB,EACvC,WACA,MACA,wBAAwB,MACxB,UACA,MACwB;CAExB,MAAM,aAAa,CAAE,OACpB,IAAI,IAAK,IAAI,OAAO,SAAS,MAAO,CACrC,CAAC,CAAC,WAAY,OAAO,SAAS,MAAO;CAErC,MAAM,UACL,qBAACA,sBAAD;EAAQ,SAAQ;EAAa,SAAU;EAAI,OAAQ,EAAE,UAAU,IAAI;EAAnE,UAAA,CACG,SAAU,MAAM,qBAAsB,GACxC,oBAAC,WAAD,EAAa,SAAqB,CAAA,CAC3B;;CAGT,IAAK,YAEJ,OACC,oBAACC,oBAAD;EACC,IAAG;EACH,MAAO;EACP,WAAY,KAAMC,qBAAO,MAAM,SAAU;EAEvC,UAAA;CACK,CAAA;CAIV,OACC,oBAAC,gBAAD;EAAqB;EAAK,WAAY,KAAMA,qBAAO,MAAM,SAAU;EAChE,UAAA;CACa,CAAA;AAElB"}
@@ -106,12 +106,12 @@ function registerStyle(hash, css) {
106
106
  for (const targetDocument of runtime.documents.keys()) injectStyle(targetDocument, hash, css);
107
107
  }
108
108
  // packages/boot/src/components/navigation/navigation-screen/style.module.scss
109
- if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("587e8bd148", "._8ee768104cd6989d__screen{padding-block-end:4px}._8ee768104cd6989d__screen .components-text{color:var(--wpds-color-foreground-content-neutral,#1e1e1e)}._86eaeab8cbb71ab3__title-icon{padding-block-end:8px;padding-block-start:12px;padding-inline-end:16px;padding-inline-start:16px;position:sticky;top:0}.c70a3969756ff3ce__title{flex-grow:1;overflow-wrap:break-word}.c70a3969756ff3ce__title.c70a3969756ff3ce__title,.c70a3969756ff3ce__title.c70a3969756ff3ce__title .c70a3969756ff3ce__title{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);line-height:32px}.f21c64ba84799e5c__actions{display:flex;flex-shrink:0}");
109
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("238635cb9f", "._0b9fa044c30b3008__screen{padding-block-end:4px}._0b9fa044c30b3008__screen .components-text{color:var(--wpds-color-foreground-content-neutral,#1e1e1e)}.b175c7232dd81174__title-icon{padding-block-end:8px;padding-block-start:12px;padding-inline-end:16px;padding-inline-start:16px;position:sticky;top:0}.b2dc4838239d6dd4__title{flex-grow:1;overflow-wrap:break-word}.b2dc4838239d6dd4__title.b2dc4838239d6dd4__title,.b2dc4838239d6dd4__title.b2dc4838239d6dd4__title .b2dc4838239d6dd4__title{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);line-height:var(--wpds-typography-line-height-xl,32px)}._19318fbfc6c5a033__actions{display:flex;flex-shrink:0}");
110
110
  var style_module_default = {
111
- "screen": "_8ee768104cd6989d__screen",
112
- "title-icon": "_86eaeab8cbb71ab3__title-icon",
113
- "title": "c70a3969756ff3ce__title",
114
- "actions": "f21c64ba84799e5c__actions"
111
+ "screen": "_0b9fa044c30b3008__screen",
112
+ "title-icon": "b175c7232dd81174__title-icon",
113
+ "title": "b2dc4838239d6dd4__title",
114
+ "actions": "_19318fbfc6c5a033__actions"
115
115
  };
116
116
  // packages/boot/src/components/navigation/navigation-screen/index.tsx
117
117
  const ANIMATION_DURATION = .3;
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["styles","AnimatePresence","motion","HStack","Heading"],"sources":["../../../../../style-runtime/src/index.ts","../../../../src/components/navigation/navigation-screen/style.module.scss","../../../../src/components/navigation/navigation-screen/index.tsx"],"sourcesContent":["type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"587e8bd148\", \"._8ee768104cd6989d__screen{padding-block-end:4px}._8ee768104cd6989d__screen .components-text{color:var(--wpds-color-foreground-content-neutral,#1e1e1e)}._86eaeab8cbb71ab3__title-icon{padding-block-end:8px;padding-block-start:12px;padding-inline-end:16px;padding-inline-start:16px;position:sticky;top:0}.c70a3969756ff3ce__title{flex-grow:1;overflow-wrap:break-word}.c70a3969756ff3ce__title.c70a3969756ff3ce__title,.c70a3969756ff3ce__title.c70a3969756ff3ce__title .c70a3969756ff3ce__title{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);line-height:32px}.f21c64ba84799e5c__actions{display:flex;flex-shrink:0}\");\n}\nexport default {\"screen\":\"_8ee768104cd6989d__screen\",\"title-icon\":\"_86eaeab8cbb71ab3__title-icon\",\"title\":\"c70a3969756ff3ce__title\",\"actions\":\"f21c64ba84799e5c__actions\"};\n","import type { ReactNode, RefObject } from 'react';\nimport {\n\t__experimentalHeading as Heading,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\tButton,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { useReducedMotion } from '@wordpress/compose';\nimport styles from './style.module.scss';\n\nconst ANIMATION_DURATION = 0.3;\nconst slideVariants = {\n\tinitial: ( direction: 'forward' | 'backward' ) => ( {\n\t\tx: ( direction === 'forward' ? 100 : -100 ) * ( isRTL() ? -1 : 1 ),\n\t\topacity: 0,\n\t} ),\n\tanimate: {\n\t\tx: 0,\n\t\topacity: 1,\n\t},\n\texit: ( direction: 'forward' | 'backward' ) => ( {\n\t\tx: ( direction === 'forward' ? 100 : -100 ) * ( isRTL() ? -1 : 1 ),\n\t\topacity: 0,\n\t} ),\n};\n\nexport default function NavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tcontent,\n\tdescription,\n\tanimationDirection,\n\tbackMenuItem,\n\tbackButtonRef,\n\tnavigationKey,\n\tonNavigate,\n}: {\n\tisRoot?: boolean;\n\ttitle: string;\n\tactions?: ReactNode;\n\tcontent: ReactNode;\n\tdescription?: ReactNode;\n\tbackMenuItem?: string;\n\tbackButtonRef?: RefObject< HTMLButtonElement | null >;\n\tanimationDirection?: 'forward' | 'backward';\n\tnavigationKey?: string;\n\tonNavigate: ( {\n\t\tid,\n\t\tdirection,\n\t}: {\n\t\tid?: string;\n\t\tdirection: 'forward' | 'backward';\n\t} ) => void;\n} ) {\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\tconst disableMotion = useReducedMotion();\n\n\tconst handleBackClick = ( e: React.MouseEvent ) => {\n\t\te.preventDefault();\n\t\tonNavigate( { id: backMenuItem, direction: 'backward' } );\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ styles.screen }\n\t\t\tstyle={ {\n\t\t\t\toverflow: 'hidden',\n\t\t\t\tposition: 'relative',\n\t\t\t\tdisplay: 'grid',\n\t\t\t\tgridTemplateColumns: '1fr',\n\t\t\t\tgridTemplateRows: '1fr',\n\t\t\t} }\n\t\t>\n\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ navigationKey }\n\t\t\t\t\tcustom={ animationDirection }\n\t\t\t\t\tvariants={ slideVariants }\n\t\t\t\t\tinitial=\"initial\"\n\t\t\t\t\tanimate=\"animate\"\n\t\t\t\t\texit=\"exit\"\n\t\t\t\t\ttransition={ {\n\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\tduration: disableMotion ? 0 : ANIMATION_DURATION,\n\t\t\t\t\t\tease: [ 0.33, 0, 0, 1 ],\n\t\t\t\t\t} }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\tgridColumn: '1',\n\t\t\t\t\t\tgridRow: '1',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack spacing={ 2 } className={ styles[ 'title-icon' ] }>\n\t\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tref={ backButtonRef }\n\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\tonClick={ handleBackClick }\n\t\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Heading\n\t\t\t\t\t\t\tclassName={ styles.title }\n\t\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\t\tsize=\"15px\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t\t<div className={ styles.actions }>{ actions }</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HStack>\n\n\t\t\t\t\t{ description && <div>{ description }</div> }\n\n\t\t\t\t\t{ content }\n\t\t\t\t</motion.div>\n\t\t\t</AnimatePresence>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAUA,MAAM,uBAAuB;;;;;;;;;AAU7B,SAAS,aAAa;CACrB,MAAM,cAAc;CAEpB,IAAK,YAAY,kBAChB,OAAO,YAAY;CAGpB,YAAY,mBAAmB;EAC9B,2BAAW,IAAI,IAAI;EACnB,wBAAQ,IAAI,IAAI;EAChB,gCAAgB,IAAI,QAAQ;CAC7B;CAEA,IAAK,OAAO,aAAa,aACxB,iBAAkB,QAAS;CAG5B,OAAO,YAAY;AACpB;;;;;;;;;AAUA,SAAS,0BACR,gBACA,MACU;CACV,IAAK,CAAE,eAAe,MACrB,OAAO;CAGR,KAAM,MAAM,SAAS,eAAe,KAAK,iBACxC,SAAU,qBAAsB,EACjC,GACC,IAAK,MAAM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B,MAAK;QACL,SAAQ;OACR,CAAA;OAEF,oBAACI,uBAAD;QACC,WAAYJ,qBAAO;QACnB,OAAQ;QACR,MAAK;QAEH,UAAA;OACM,CAAA;OACP,WACD,oBAAC,OAAD;QAAK,WAAYA,qBAAO;QAAY,UAAA;OAAc,CAAA;MAE5C;;KAEN,eAAe,oBAAC,OAAD,EAAA,UAAO,YAAkB,CAAA;KAExC;IACS;GA3CL,GAAA,aA2CK;EACI,CAAA;CACb,CAAA;AAEP"}
1
+ {"version":3,"file":"index.mjs","names":["styles","AnimatePresence","motion","HStack","Heading"],"sources":["../../../../../style-runtime/src/index.ts","../../../../src/components/navigation/navigation-screen/style.module.scss","../../../../src/components/navigation/navigation-screen/index.tsx"],"sourcesContent":["type GlobalScopeWithStyleRuntime = typeof globalThis & {\n\t// This global is shared by separately bundled copies of this package.\n\t// Keep its shape backward compatible after release.\n\t__wpStyleRuntime?: {\n\t\tdocuments: Map< Document, number >;\n\t\tstyles: Map< string, string >;\n\t\tinjectedStyles: WeakMap< Document, Set< string > >;\n\t};\n};\n\nconst STYLE_HASH_ATTRIBUTE = 'data-wp-hash';\n\n/**\n * Returns the shared style runtime registry.\n *\n * The registry is stored on `globalThis` so separately bundled copies of this\n * package can coordinate through the same document and style maps.\n *\n * @return The shared runtime registry.\n */\nfunction getRuntime() {\n\tconst globalScope = globalThis as GlobalScopeWithStyleRuntime;\n\n\tif ( globalScope.__wpStyleRuntime ) {\n\t\treturn globalScope.__wpStyleRuntime;\n\t}\n\n\tglobalScope.__wpStyleRuntime = {\n\t\tdocuments: new Map(),\n\t\tstyles: new Map(),\n\t\tinjectedStyles: new WeakMap(),\n\t};\n\n\tif ( typeof document !== 'undefined' ) {\n\t\tregisterDocument( document );\n\t}\n\n\treturn globalScope.__wpStyleRuntime;\n}\n\n/**\n * Checks whether a document already contains a style tag for a hash.\n *\n * @param targetDocument Document to inspect.\n * @param hash Stable hash for the transformed CSS.\n *\n * @return Whether the style hash already exists in the document.\n */\nfunction documentContainsStyleHash(\n\ttargetDocument: Document,\n\thash: string\n): boolean {\n\tif ( ! targetDocument.head ) {\n\t\treturn false;\n\t}\n\n\tfor ( const style of targetDocument.head.querySelectorAll(\n\t\t`style[${ STYLE_HASH_ATTRIBUTE }]`\n\t) ) {\n\t\tif ( style.getAttribute( STYLE_HASH_ATTRIBUTE ) === hash ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\n/**\n * Injects a registered style into a document, unless that document already\n * contains a style tag for the same hash.\n *\n * @param targetDocument Document to inject the style into.\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nfunction injectStyle( targetDocument: Document, hash: string, css: string ) {\n\tif ( ! targetDocument.head ) {\n\t\treturn;\n\t}\n\n\tconst runtime = getRuntime();\n\tlet injectedStyles = runtime.injectedStyles.get( targetDocument );\n\n\tif ( ! injectedStyles ) {\n\t\tinjectedStyles = new Set();\n\t\truntime.injectedStyles.set( targetDocument, injectedStyles );\n\t}\n\n\tif ( injectedStyles.has( hash ) ) {\n\t\treturn;\n\t}\n\n\t// Older generated CSS module output can still inject matching style tags\n\t// after this document's cache is created, so keep the DOM as the fallback\n\t// source of truth on cache misses.\n\tif ( documentContainsStyleHash( targetDocument, hash ) ) {\n\t\tinjectedStyles.add( hash );\n\t\treturn;\n\t}\n\n\tconst style = targetDocument.createElement( 'style' );\n\tstyle.setAttribute( STYLE_HASH_ATTRIBUTE, hash );\n\tstyle.appendChild( targetDocument.createTextNode( css ) );\n\ttargetDocument.head.appendChild( style );\n\tinjectedStyles.add( hash );\n}\n\n/**\n * Registers a document as a style injection target.\n *\n * Existing registered styles are replayed into the document immediately.\n * Documents are reference-counted so multiple providers can safely register the\n * same document without one cleanup removing it while another registration is\n * still active.\n *\n * @param targetDocument Document to receive registered styles.\n * @return Cleanup function that unregisters this document registration.\n */\nexport function registerDocument( targetDocument: Document ) {\n\tconst runtime = getRuntime();\n\n\truntime.documents.set(\n\t\ttargetDocument,\n\t\t( runtime.documents.get( targetDocument ) ?? 0 ) + 1\n\t);\n\n\tfor ( const [ hash, css ] of runtime.styles ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n\n\treturn () => {\n\t\tconst count = runtime.documents.get( targetDocument );\n\n\t\tif ( count === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( count <= 1 ) {\n\t\t\truntime.documents.delete( targetDocument );\n\t\t\treturn;\n\t\t}\n\n\t\truntime.documents.set( targetDocument, count - 1 );\n\t};\n}\n\n/**\n * Registers a style and injects it into all registered documents.\n *\n * The hash is used as the deduplication key, so calling this repeatedly with\n * the same hash will not add duplicate style tags to a document.\n * Registered styles are retained for the lifetime of the page so they can be\n * replayed into documents that are registered later.\n *\n * @param hash Stable hash for the transformed CSS.\n * @param css CSS text to inject.\n */\nexport function registerStyle( hash: string, css: string ) {\n\tconst runtime = getRuntime();\n\n\truntime.styles.set( hash, css );\n\n\tfor ( const targetDocument of runtime.documents.keys() ) {\n\t\tinjectStyle( targetDocument, hash, css );\n\t}\n}\n","import { registerStyle } from '@wordpress/style-runtime';\nif (typeof process === 'undefined' || process.env.NODE_ENV !== 'test') {\n\tregisterStyle(\"238635cb9f\", \"._0b9fa044c30b3008__screen{padding-block-end:4px}._0b9fa044c30b3008__screen .components-text{color:var(--wpds-color-foreground-content-neutral,#1e1e1e)}.b175c7232dd81174__title-icon{padding-block-end:8px;padding-block-start:12px;padding-inline-end:16px;padding-inline-start:16px;position:sticky;top:0}.b2dc4838239d6dd4__title{flex-grow:1;overflow-wrap:break-word}.b2dc4838239d6dd4__title.b2dc4838239d6dd4__title,.b2dc4838239d6dd4__title.b2dc4838239d6dd4__title .b2dc4838239d6dd4__title{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);line-height:var(--wpds-typography-line-height-xl,32px)}._19318fbfc6c5a033__actions{display:flex;flex-shrink:0}\");\n}\nexport default {\"screen\":\"_0b9fa044c30b3008__screen\",\"title-icon\":\"b175c7232dd81174__title-icon\",\"title\":\"b2dc4838239d6dd4__title\",\"actions\":\"_19318fbfc6c5a033__actions\"};\n","import type { ReactNode, RefObject } from 'react';\nimport {\n\t__experimentalHeading as Heading,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n\tButton,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { useReducedMotion } from '@wordpress/compose';\nimport styles from './style.module.scss';\n\nconst ANIMATION_DURATION = 0.3;\nconst slideVariants = {\n\tinitial: ( direction: 'forward' | 'backward' ) => ( {\n\t\tx: ( direction === 'forward' ? 100 : -100 ) * ( isRTL() ? -1 : 1 ),\n\t\topacity: 0,\n\t} ),\n\tanimate: {\n\t\tx: 0,\n\t\topacity: 1,\n\t},\n\texit: ( direction: 'forward' | 'backward' ) => ( {\n\t\tx: ( direction === 'forward' ? 100 : -100 ) * ( isRTL() ? -1 : 1 ),\n\t\topacity: 0,\n\t} ),\n};\n\nexport default function NavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tcontent,\n\tdescription,\n\tanimationDirection,\n\tbackMenuItem,\n\tbackButtonRef,\n\tnavigationKey,\n\tonNavigate,\n}: {\n\tisRoot?: boolean;\n\ttitle: string;\n\tactions?: ReactNode;\n\tcontent: ReactNode;\n\tdescription?: ReactNode;\n\tbackMenuItem?: string;\n\tbackButtonRef?: RefObject< HTMLButtonElement | null >;\n\tanimationDirection?: 'forward' | 'backward';\n\tnavigationKey?: string;\n\tonNavigate: ( {\n\t\tid,\n\t\tdirection,\n\t}: {\n\t\tid?: string;\n\t\tdirection: 'forward' | 'backward';\n\t} ) => void;\n} ) {\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\tconst disableMotion = useReducedMotion();\n\n\tconst handleBackClick = ( e: React.MouseEvent ) => {\n\t\te.preventDefault();\n\t\tonNavigate( { id: backMenuItem, direction: 'backward' } );\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ styles.screen }\n\t\t\tstyle={ {\n\t\t\t\toverflow: 'hidden',\n\t\t\t\tposition: 'relative',\n\t\t\t\tdisplay: 'grid',\n\t\t\t\tgridTemplateColumns: '1fr',\n\t\t\t\tgridTemplateRows: '1fr',\n\t\t\t} }\n\t\t>\n\t\t\t<AnimatePresence initial={ false }>\n\t\t\t\t<motion.div\n\t\t\t\t\tkey={ navigationKey }\n\t\t\t\t\tcustom={ animationDirection }\n\t\t\t\t\tvariants={ slideVariants }\n\t\t\t\t\tinitial=\"initial\"\n\t\t\t\t\tanimate=\"animate\"\n\t\t\t\t\texit=\"exit\"\n\t\t\t\t\ttransition={ {\n\t\t\t\t\t\ttype: 'tween',\n\t\t\t\t\t\tduration: disableMotion ? 0 : ANIMATION_DURATION,\n\t\t\t\t\t\tease: [ 0.33, 0, 0, 1 ],\n\t\t\t\t\t} }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\tgridColumn: '1',\n\t\t\t\t\t\tgridRow: '1',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<HStack spacing={ 2 } className={ styles[ 'title-icon' ] }>\n\t\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tref={ backButtonRef }\n\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\tonClick={ handleBackClick }\n\t\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<Heading\n\t\t\t\t\t\t\tclassName={ styles.title }\n\t\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\t\tsize=\"15px\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t\t<div className={ styles.actions }>{ actions }</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HStack>\n\n\t\t\t\t\t{ description && <div>{ description }</div> }\n\n\t\t\t\t\t{ content }\n\t\t\t\t</motion.div>\n\t\t\t</AnimatePresence>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAUA,MAAM,uBAAuB;;;;;;;;;AAU7B,SAAS,aAAa;CACrB,MAAM,cAAc;CAEpB,IAAK,YAAY,kBAChB,OAAO,YAAY;CAGpB,YAAY,mBAAmB;EAC9B,2BAAW,IAAI,IAAI;EACnB,wBAAQ,IAAI,IAAI;EAChB,gCAAgB,IAAI,QAAQ;CAC7B;CAEA,IAAK,OAAO,aAAa,aACxB,iBAAkB,QAAS;CAG5B,OAAO,YAAY;AACpB;;;;;;;;;AAUA,SAAS,0BACR,gBACA,MACU;CACV,IAAK,CAAE,eAAe,MACrB,OAAO;CAGR,KAAM,MAAM,SAAS,eAAe,KAAK,iBACxC,SAAU,qBAAsB,EACjC,GACC,IAAK,MAAM,aAAc,oBAAqB,MAAM,MACnD,OAAO;CAIT,OAAO;AACR;;;;;;;;;AAUA,SAAS,YAAa,gBAA0B,MAAc,KAAc;CAC3E,IAAK,CAAE,eAAe,MACrB;CAGD,MAAM,UAAU,WAAW;CAC3B,IAAI,iBAAiB,QAAQ,eAAe,IAAK,cAAe;CAEhE,IAAK,CAAE,gBAAiB;EACvB,iCAAiB,IAAI,IAAI;EACzB,QAAQ,eAAe,IAAK,gBAAgB,cAAe;CAC5D;CAEA,IAAK,eAAe,IAAK,IAAK,GAC7B;CAMD,IAAK,0BAA2B,gBAAgB,IAAK,GAAI;EACxD,eAAe,IAAK,IAAK;EACzB;CACD;CAEA,MAAM,QAAQ,eAAe,cAAe,OAAQ;CACpD,MAAM,aAAc,sBAAsB,IAAK;CAC/C,MAAM,YAAa,eAAe,eAAgB,GAAI,CAAE;CACxD,eAAe,KAAK,YAAa,KAAM;CACvC,eAAe,IAAK,IA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oB,MAAyB;EAClD,EAAE,eAAe;EACjB,WAAY;GAAE,IAAI;GAAc,WAAW;EAAW,CAAE;CACzD;CAEA,OACC,oBAAC,OAAD;EACC,WAAYA,qBAAO;EACnB,OAAQ;GACP,UAAU;GACV,UAAU;GACV,SAAS;GACT,qBAAqB;GACrB,kBAAkB;EACnB;EAEA,UAAA,oBAACC,2BAAD;GAAiB,SAAU;GAC1B,UAAA,qBAACC,iBAAO,KAAR;IAEC,QAAS;IACT,UAAW;IACX,SAAQ;IACR,SAAQ;IACR,MAAK;IACL,YAAa;KACZ,MAAM;KACN,UAAU,gBAAgB,IAAI;KAC9B,MAAM;MAAE;MAAM;MAAG;MAAG;KAAE;IACvB;IACA,OAAQ;KACP,OAAO;KACP,YAAY;KACZ,SAAS;IACV;IAhBD,UAAA;KAkBC,qBAACC,sBAAD;MAAQ,SAAU;MAAI,WAAYH,qBAAQ;MAA1C,UAAA;OACG,CAAE,UACH,oBAAC,QAAD;QACC,KAAM;QACC;QACP,SAAU;QACV,OAAQ,GAAI,MAAO;QACnB,MAAK;QACL,SAAQ;OACR,CAAA;OAEF,oBAACI,uBAAD;QACC,WAAYJ,qBAAO;QACnB,OAAQ;QACR,MAAK;QAEH,UAAA;OACM,CAAA;OACP,WACD,oBAAC,OAAD;QAAK,WAAYA,qBAAO;QAAY,UAAA;OAAc,CAAA;MAE5C;;KAEN,eAAe,oBAAC,OAAD,EAAA,UAAO,YAAkB,CAAA;KAExC;IACS;GA3CL,GAAA,aA2CK;EACI,CAAA;CACb,CAAA;AAEP"}
@@ -1 +1 @@
1
- {"version":3,"file":"router-link-item.mjs","names":["routePrivateApis","Item"],"sources":["../../../src/components/navigation/router-link-item.tsx"],"sourcesContent":["import type { ForwardedRef } from 'react';\nimport { forwardRef } from '@wordpress/element';\nimport { __experimentalItem as Item } from '@wordpress/components';\nimport { privateApis as routePrivateApis } from '@wordpress/route';\nimport { unlock } from '../../lock-unlock';\n\nconst { createLink } = unlock( routePrivateApis );\n\nfunction AnchorOnlyItem(\n\tprops: React.ComponentProps< typeof Item >,\n\tforwardedRef: ForwardedRef< HTMLAnchorElement >\n) {\n\treturn <Item as=\"a\" ref={ forwardedRef } { ...props } />;\n}\n\nconst RouterLinkItem = createLink( forwardRef( AnchorOnlyItem ) );\n\nexport default RouterLinkItem;\n"],"mappings":";;;;;;AAMA,MAAM,EAAE,eAAe,OAAQA,WAAiB;AAEhD,SAAS,eACR,OACA,cACC;CACD,OAAO,oBAACC,oBAAD;EAAM,IAAG;EAAI,KAAM;EAAe,GAAK;CAAS,CAAA;AACxD;AAEA,MAAM,iBAAiB,WAAY,WAAY,cAAe,CAAE"}
1
+ {"version":3,"file":"router-link-item.mjs","names":["routePrivateApis","WCItem"],"sources":["../../../src/components/navigation/router-link-item.tsx"],"sourcesContent":["import type { ForwardedRef } from 'react';\nimport { forwardRef } from '@wordpress/element';\nimport { __experimentalItem as WCItem } from '@wordpress/components';\nimport { privateApis as routePrivateApis } from '@wordpress/route';\nimport { unlock } from '../../lock-unlock';\n\nconst { createLink } = unlock( routePrivateApis );\n\nfunction AnchorOnlyItem(\n\tprops: React.ComponentProps< typeof WCItem >,\n\tforwardedRef: ForwardedRef< HTMLAnchorElement >\n) {\n\treturn <WCItem as=\"a\" ref={ forwardedRef } { ...props } />;\n}\n\nconst RouterLinkItem = createLink( forwardRef( AnchorOnlyItem ) );\n\nexport default RouterLinkItem;\n"],"mappings":";;;;;;AAMA,MAAM,EAAE,eAAe,OAAQA,WAAiB;AAEhD,SAAS,eACR,OACA,cACC;CACD,OAAO,oBAACC,oBAAD;EAAQ,IAAG;EAAI,KAAM;EAAe,GAAK;CAAS,CAAA;AAC1D;AAEA,MAAM,iBAAiB,WAAY,WAAY,cAAe,CAAE"}
@@ -17,7 +17,11 @@ import { jsx } from "react/jsx-runtime";
17
17
  function PluginArea() {
18
18
  const { createErrorNotice } = useDispatch(store);
19
19
  return /* @__PURE__ */ jsx(PluginArea$1, { onError: (name) => {
20
- createErrorNotice(sprintf(__("The \"%s\" plugin has encountered an error and cannot be rendered."), name));
20
+ createErrorNotice(sprintf(
21
+ /** translators: %s: plugin name */
22
+ __("The \"%s\" plugin has encountered an error and cannot be rendered."),
23
+ name
24
+ ));
21
25
  } });
22
26
  }
23
27
  export { PluginArea as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["noticesStore","WPPluginArea"],"sources":["../../../src/components/plugin-area/index.tsx"],"sourcesContent":["import { useDispatch } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { PluginArea as WPPluginArea } from '@wordpress/plugins';\n\n/**\n * Mounts every plugin registered with `registerPlugin`, so the fills they\n * render reach their slots.\n *\n * Sits at the root rather than with the editor: a plugin's fills mostly target\n * editor slots, but the component holding them is also where it registers\n * commands and extends a list, which the routes without a canvas need too.\n *\n * @return The mount point. Renders whatever the plugins do, and nothing itself.\n */\nexport default function PluginArea() {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\treturn (\n\t\t<WPPluginArea\n\t\t\tonError={ ( name ) => {\n\t\t\t\tcreateErrorNotice(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tname\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,SAAwB,aAAa;CACpC,MAAM,EAAE,sBAAsB,YAAaA,KAAa;CAExD,OACC,oBAACC,cAAD,EACC,UAAY,SAAU;EACrB,kBACC,QAEC,GACC,oEACD,GACA,IACD,CACD;CACD,EACA,CAAA;AAEH"}
1
+ {"version":3,"file":"index.mjs","names":["noticesStore","WPPluginArea"],"sources":["../../../src/components/plugin-area/index.tsx"],"sourcesContent":["import { useDispatch } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { PluginArea as WPPluginArea } from '@wordpress/plugins';\n\n/**\n * Mounts every plugin registered with `registerPlugin`, so the fills they\n * render reach their slots.\n *\n * Sits at the root rather than with the editor: a plugin's fills mostly target\n * editor slots, but the component holding them is also where it registers\n * commands and extends a list, which the routes without a canvas need too.\n *\n * @return The mount point. Renders whatever the plugins do, and nothing itself.\n */\nexport default function PluginArea() {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\treturn (\n\t\t<WPPluginArea\n\t\t\tonError={ ( name ) => {\n\t\t\t\tcreateErrorNotice(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tname\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,SAAwB,aAAa;CACpC,MAAM,EAAE,sBAAsB,YAAaA,KAAa;CAExD,OACC,oBAACC,cAAD,EACC,UAAY,SAAU;EACrB,kBACC;;GAEC,GACC,oEACD;GACA;EACD,CACD;CACD,EACA,CAAA;AAEH"}