@wordpress/boot 0.26.0 → 0.27.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.
@@ -111,31 +111,31 @@ function registerStyle(hash, css) {
111
111
  for (const targetDocument of runtime.documents.keys()) injectStyle(targetDocument, hash, css);
112
112
  }
113
113
  // packages/boot/src/components/root/style.module.scss
114
- if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("fed1a7ec24", "._5c711a1cecefd5e8__layout{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){._5c711a1cecefd5e8__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){._5c711a1cecefd5e8__layout{min-height:calc(100vh - 32px)}body:has(._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas) ._5c711a1cecefd5e8__layout{min-height:100vh}}:where(._5c711a1cecefd5e8__layout) img{height:auto;max-width:100%}._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar .cb865dcda5233b3b__components-snackbar,._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar .components-snackbar{margin-inline:auto}._04b3b4e8346a2b7b__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}._615b052cf60fcff2__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}._615b052cf60fcff2__sidebar._6be5d95ddf25e57f__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.fd8d6491146392ce__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}.f37b94fd2c1f6020__layout-single-page .fd8d6491146392ce__mobile-sidebar-drawer{top:46px}.fd8d6491146392ce__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}._6da399dd0a232c1f__canvas._5568e036ddaba310__has-mobile-drawer{padding-top:65px;position:relative}.ff37ba01b23d0bcb__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.ff37ba01b23d0bcb__surfaces{margin:8px}.f37b94fd2c1f6020__layout-single-page .ff37ba01b23d0bcb__surfaces{margin-top:0;margin-inline-start:0}}.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}.f37b94fd2c1f6020__layout-single-page .b37b199f2111c5f8__inspector,.f37b94fd2c1f6020__layout-single-page .e323e272b8b8ed4f__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}.f37b94fd2c1f6020__layout-single-page .b37b199f2111c5f8__inspector,.f37b94fd2c1f6020__layout-single-page .e323e272b8b8ed4f__stage{height:auto}}.e323e272b8b8ed4f__stage{z-index:2}@media (min-width:782px){.e323e272b8b8ed4f__stage{z-index:auto}}.b37b199f2111c5f8__inspector{z-index:3}@media (min-width:782px){.b37b199f2111c5f8__inspector{z-index:auto}}._6da399dd0a232c1f__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}.f37b94fd2c1f6020__layout-single-page ._6da399dd0a232c1f__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._6da399dd0a232c1f__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}.f37b94fd2c1f6020__layout-single-page ._6da399dd0a232c1f__canvas{height:auto}._5c711a1cecefd5e8__layout.bbaf96f69377ab55__has-canvas .e323e272b8b8ed4f__stage,.b37b199f2111c5f8__inspector{max-width:400px}}._6da399dd0a232c1f__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .ff37ba01b23d0bcb__surfaces{gap:0;margin:0}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .b37b199f2111c5f8__inspector,._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .e323e272b8b8ed4f__stage{display:none}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}.f37b94fd2c1f6020__layout-single-page ._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{top:46px}@media (min-width:782px){.f37b94fd2c1f6020__layout-single-page ._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{top:32px}}@media (max-width:782px){._6da399dd0a232c1f__canvas:not(._5568e036ddaba310__has-mobile-drawer),.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}.fd8d6491146392ce__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){._6da399dd0a232c1f__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}._6da399dd0a232c1f__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.e323e272b8b8ed4f__stage{view-transition-name:boot--stage}.b37b199f2111c5f8__inspector{view-transition-name:boot--inspector}._6da399dd0a232c1f__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.e323e272b8b8ed4f__stage{view-transition-name:boot-safari--stage}.b37b199f2111c5f8__inspector{view-transition-name:boot-safari--inspector}._6da399dd0a232c1f__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(._5c711a1cecefd5e8__layout) *{view-transition-name:none!important}}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(root),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(._5c711a1cecefd5e8__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas-header),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas-sidebar),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--stage),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--stage),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--stage):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:_2e385023a338e4a9__zoomOut;will-change:transform,opacity}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--stage):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:e245c2f64b6256de__zoomIn;will-change:transform,opacity}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_9aa5832f67721dd4__slideFromRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:_4d20ae2879ce77c4__slideToRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:e56b4b1bb9ff1176__slideHeaderFromTop;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:e54b49876d2b7dc3__slideHeaderToTop;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:f74156de1cf32837__slideSidebarFromRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:_157f548b8629f8b5__slideSidebarToRight;will-change:transform}@keyframes _2e385023a338e4a9__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes e245c2f64b6256de__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _9aa5832f67721dd4__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes _4d20ae2879ce77c4__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes e56b4b1bb9ff1176__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes e54b49876d2b7dc3__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes f74156de1cf32837__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes _157f548b8629f8b5__slideSidebarToRight{to{transform:translateX(100%)}}");
114
+ if (typeof process === "undefined" || process.env.NODE_ENV !== "test") registerStyle("5af927cba5", "._56935e6282cea626__layout{background:var(--wpds-color-background-surface-neutral-weak,#f3f3f3);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){._56935e6282cea626__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){._56935e6282cea626__layout{min-height:calc(100vh - 32px)}body:has(._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas) ._56935e6282cea626__layout{min-height:100vh}}:where(._56935e6282cea626__layout) img{height:auto;max-width:100%}._56935e6282cea626__layout ._4b753b79328f00f2__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}._56935e6282cea626__layout ._4b753b79328f00f2__notices-snackbar .components-snackbar,._56935e6282cea626__layout ._4b753b79328f00f2__notices-snackbar .efa1f12116c3fb44__components-snackbar{margin-inline:auto}.a42f10ffa1623b1a__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}._24ece5d7d830027c__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}._24ece5d7d830027c__sidebar.ea25e130be9dcc55__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f3f3f3);bottom:0;box-shadow:0 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}._46722ab62d8eeeca__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._5021a5c25e2952a7__layout-single-page ._46722ab62d8eeeca__mobile-sidebar-drawer{top:46px}._46722ab62d8eeeca__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}._690b80eca9eb9eb6__canvas._47abeba36a2c03ed__has-mobile-drawer{padding-top:65px;position:relative}._52f74c33fd2757fc__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){._52f74c33fd2757fc__surfaces{margin:8px}._5021a5c25e2952a7__layout-single-page ._52f74c33fd2757fc__surfaces{margin-top:0;margin-inline-start:0}}._8510aae3042dca12__inspector,.ed02476df88803b9__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}._5021a5c25e2952a7__layout-single-page ._8510aae3042dca12__inspector,._5021a5c25e2952a7__layout-single-page .ed02476df88803b9__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._8510aae3042dca12__inspector,.ed02476df88803b9__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._5021a5c25e2952a7__layout-single-page ._8510aae3042dca12__inspector,._5021a5c25e2952a7__layout-single-page .ed02476df88803b9__stage{height:auto}}.ed02476df88803b9__stage{z-index:2}@media (min-width:782px){.ed02476df88803b9__stage{z-index:auto}}._8510aae3042dca12__inspector{z-index:3}@media (min-width:782px){._8510aae3042dca12__inspector{z-index:auto}}._690b80eca9eb9eb6__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}._5021a5c25e2952a7__layout-single-page ._690b80eca9eb9eb6__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._690b80eca9eb9eb6__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._5021a5c25e2952a7__layout-single-page ._690b80eca9eb9eb6__canvas{height:auto}._56935e6282cea626__layout.b4c4ba65515802c9__has-canvas .ed02476df88803b9__stage,._8510aae3042dca12__inspector{max-width:400px}}._690b80eca9eb9eb6__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._52f74c33fd2757fc__surfaces{gap:0;margin:0}._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._8510aae3042dca12__inspector,._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas .ed02476df88803b9__stage{display:none}._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._690b80eca9eb9eb6__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}._5021a5c25e2952a7__layout-single-page ._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._690b80eca9eb9eb6__canvas{top:46px}@media (min-width:782px){._5021a5c25e2952a7__layout-single-page ._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._690b80eca9eb9eb6__canvas{top:32px}}@media (max-width:782px){._690b80eca9eb9eb6__canvas:not(._47abeba36a2c03ed__has-mobile-drawer),._8510aae3042dca12__inspector,.ed02476df88803b9__stage{height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}._46722ab62d8eeeca__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){._690b80eca9eb9eb6__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}._690b80eca9eb9eb6__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.ed02476df88803b9__stage{view-transition-name:boot--stage}._8510aae3042dca12__inspector{view-transition-name:boot--inspector}._690b80eca9eb9eb6__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.ed02476df88803b9__stage{view-transition-name:boot-safari--stage}._8510aae3042dca12__inspector{view-transition-name:boot-safari--inspector}._690b80eca9eb9eb6__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(._56935e6282cea626__layout) *{view-transition-name:none!important}}:root:has(._56935e6282cea626__layout)::view-transition-new(root),:root:has(._56935e6282cea626__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(._56935e6282cea626__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(._56935e6282cea626__layout)::view-transition-group(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-group(boot--canvas-header),:root:has(._56935e6282cea626__layout)::view-transition-group(boot--canvas-sidebar),:root:has(._56935e6282cea626__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--canvas),:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--inspector),:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--stage),:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--canvas),:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--inspector),:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-new(boot--inspector),:root:has(._56935e6282cea626__layout)::view-transition-new(boot--stage),:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-old(boot--inspector),:root:has(._56935e6282cea626__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot--stage):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:ab73776591f19033__zoomOut;will-change:transform,opacity}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot--stage):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_10c071ed4bf0c4f2__zoomIn;will-change:transform,opacity}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_30a8540aba2100e9__slideFromRight;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:aea85e2dfc564485__slideToRight;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_8ad9a41739bd9fbe__slideHeaderFromTop;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:f56b26b5d5c9bc72__slideHeaderToTop;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:a2ba8d5a4515e038__slideSidebarFromRight;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:_6ddf6cb6adc49ad6__slideSidebarToRight;will-change:transform}@keyframes ab73776591f19033__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _10c071ed4bf0c4f2__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _30a8540aba2100e9__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes aea85e2dfc564485__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _8ad9a41739bd9fbe__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes f56b26b5d5c9bc72__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes a2ba8d5a4515e038__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes _6ddf6cb6adc49ad6__slideSidebarToRight{to{transform:translateX(100%)}}");
115
115
  var style_module_default = {
116
- "layout": "_5c711a1cecefd5e8__layout",
117
- "has-full-canvas": "_52e00bad88ace7ce__has-full-canvas",
118
- "notices-snackbar": "eeebb116829e2f94__notices-snackbar",
119
- "components-snackbar": "cb865dcda5233b3b__components-snackbar",
120
- "sidebar-backdrop": "_04b3b4e8346a2b7b__sidebar-backdrop",
121
- "sidebar": "_615b052cf60fcff2__sidebar",
122
- "is-mobile": "_6be5d95ddf25e57f__is-mobile",
123
- "mobile-sidebar-drawer": "fd8d6491146392ce__mobile-sidebar-drawer",
124
- "layout-single-page": "f37b94fd2c1f6020__layout-single-page",
125
- "canvas": "_6da399dd0a232c1f__canvas",
126
- "has-mobile-drawer": "_5568e036ddaba310__has-mobile-drawer",
127
- "surfaces": "ff37ba01b23d0bcb__surfaces",
128
- "stage": "e323e272b8b8ed4f__stage",
129
- "inspector": "b37b199f2111c5f8__inspector",
130
- "has-canvas": "bbaf96f69377ab55__has-canvas",
131
- "zoomOut": "_2e385023a338e4a9__zoomOut",
132
- "zoomIn": "e245c2f64b6256de__zoomIn",
133
- "slideFromRight": "_9aa5832f67721dd4__slideFromRight",
134
- "slideToRight": "_4d20ae2879ce77c4__slideToRight",
135
- "slideHeaderFromTop": "e56b4b1bb9ff1176__slideHeaderFromTop",
136
- "slideHeaderToTop": "e54b49876d2b7dc3__slideHeaderToTop",
137
- "slideSidebarFromRight": "f74156de1cf32837__slideSidebarFromRight",
138
- "slideSidebarToRight": "_157f548b8629f8b5__slideSidebarToRight"
116
+ "layout": "_56935e6282cea626__layout",
117
+ "has-full-canvas": "_8fc7f864ef1ff9d4__has-full-canvas",
118
+ "notices-snackbar": "_4b753b79328f00f2__notices-snackbar",
119
+ "components-snackbar": "efa1f12116c3fb44__components-snackbar",
120
+ "sidebar-backdrop": "a42f10ffa1623b1a__sidebar-backdrop",
121
+ "sidebar": "_24ece5d7d830027c__sidebar",
122
+ "is-mobile": "ea25e130be9dcc55__is-mobile",
123
+ "mobile-sidebar-drawer": "_46722ab62d8eeeca__mobile-sidebar-drawer",
124
+ "layout-single-page": "_5021a5c25e2952a7__layout-single-page",
125
+ "canvas": "_690b80eca9eb9eb6__canvas",
126
+ "has-mobile-drawer": "_47abeba36a2c03ed__has-mobile-drawer",
127
+ "surfaces": "_52f74c33fd2757fc__surfaces",
128
+ "stage": "ed02476df88803b9__stage",
129
+ "inspector": "_8510aae3042dca12__inspector",
130
+ "has-canvas": "b4c4ba65515802c9__has-canvas",
131
+ "zoomOut": "ab73776591f19033__zoomOut",
132
+ "zoomIn": "_10c071ed4bf0c4f2__zoomIn",
133
+ "slideFromRight": "_30a8540aba2100e9__slideFromRight",
134
+ "slideToRight": "aea85e2dfc564485__slideToRight",
135
+ "slideHeaderFromTop": "_8ad9a41739bd9fbe__slideHeaderFromTop",
136
+ "slideHeaderToTop": "f56b26b5d5c9bc72__slideHeaderToTop",
137
+ "slideSidebarFromRight": "a2ba8d5a4515e038__slideSidebarFromRight",
138
+ "slideSidebarToRight": "_6ddf6cb6adc49ad6__slideSidebarToRight"
139
139
  };
140
140
  // packages/boot/src/components/app/router.tsx
141
141
  const { createLazyRoute, createRouter, createRootRoute, createRoute, RouterProvider, createBrowserHistory, parseHref, useLoaderData } = unlock(privateApis);
@@ -1 +1 @@
1
- {"version":3,"file":"router.mjs","names":["routePrivateApis","styles","coreStore"],"sources":["../../../../style-runtime/src/index.ts","../../../src/components/root/style.module.scss","../../../src/components/app/router.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(\"fed1a7ec24\", \"._5c711a1cecefd5e8__layout{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){._5c711a1cecefd5e8__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){._5c711a1cecefd5e8__layout{min-height:calc(100vh - 32px)}body:has(._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas) ._5c711a1cecefd5e8__layout{min-height:100vh}}:where(._5c711a1cecefd5e8__layout) img{height:auto;max-width:100%}._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar .cb865dcda5233b3b__components-snackbar,._5c711a1cecefd5e8__layout .eeebb116829e2f94__notices-snackbar .components-snackbar{margin-inline:auto}._04b3b4e8346a2b7b__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}._615b052cf60fcff2__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}._615b052cf60fcff2__sidebar._6be5d95ddf25e57f__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.fd8d6491146392ce__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}.f37b94fd2c1f6020__layout-single-page .fd8d6491146392ce__mobile-sidebar-drawer{top:46px}.fd8d6491146392ce__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}._6da399dd0a232c1f__canvas._5568e036ddaba310__has-mobile-drawer{padding-top:65px;position:relative}.ff37ba01b23d0bcb__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.ff37ba01b23d0bcb__surfaces{margin:8px}.f37b94fd2c1f6020__layout-single-page .ff37ba01b23d0bcb__surfaces{margin-top:0;margin-inline-start:0}}.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}.f37b94fd2c1f6020__layout-single-page .b37b199f2111c5f8__inspector,.f37b94fd2c1f6020__layout-single-page .e323e272b8b8ed4f__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}.f37b94fd2c1f6020__layout-single-page .b37b199f2111c5f8__inspector,.f37b94fd2c1f6020__layout-single-page .e323e272b8b8ed4f__stage{height:auto}}.e323e272b8b8ed4f__stage{z-index:2}@media (min-width:782px){.e323e272b8b8ed4f__stage{z-index:auto}}.b37b199f2111c5f8__inspector{z-index:3}@media (min-width:782px){.b37b199f2111c5f8__inspector{z-index:auto}}._6da399dd0a232c1f__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}.f37b94fd2c1f6020__layout-single-page ._6da399dd0a232c1f__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._6da399dd0a232c1f__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}.f37b94fd2c1f6020__layout-single-page ._6da399dd0a232c1f__canvas{height:auto}._5c711a1cecefd5e8__layout.bbaf96f69377ab55__has-canvas .e323e272b8b8ed4f__stage,.b37b199f2111c5f8__inspector{max-width:400px}}._6da399dd0a232c1f__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .ff37ba01b23d0bcb__surfaces{gap:0;margin:0}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .b37b199f2111c5f8__inspector,._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas .e323e272b8b8ed4f__stage{display:none}._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}.f37b94fd2c1f6020__layout-single-page ._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{top:46px}@media (min-width:782px){.f37b94fd2c1f6020__layout-single-page ._5c711a1cecefd5e8__layout._52e00bad88ace7ce__has-full-canvas ._6da399dd0a232c1f__canvas{top:32px}}@media (max-width:782px){._6da399dd0a232c1f__canvas:not(._5568e036ddaba310__has-mobile-drawer),.b37b199f2111c5f8__inspector,.e323e272b8b8ed4f__stage{height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}.fd8d6491146392ce__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){._6da399dd0a232c1f__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}._6da399dd0a232c1f__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.e323e272b8b8ed4f__stage{view-transition-name:boot--stage}.b37b199f2111c5f8__inspector{view-transition-name:boot--inspector}._6da399dd0a232c1f__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.e323e272b8b8ed4f__stage{view-transition-name:boot-safari--stage}.b37b199f2111c5f8__inspector{view-transition-name:boot-safari--inspector}._6da399dd0a232c1f__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(._5c711a1cecefd5e8__layout) *{view-transition-name:none!important}}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(root),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(._5c711a1cecefd5e8__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas-header),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot--canvas-sidebar),:root:has(._5c711a1cecefd5e8__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--stage),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--stage),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--inspector),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas),:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--stage):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:_2e385023a338e4a9__zoomOut;will-change:transform,opacity}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--stage):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:e245c2f64b6256de__zoomIn;will-change:transform,opacity}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_9aa5832f67721dd4__slideFromRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas):only-child,:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:_4d20ae2879ce77c4__slideToRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:e56b4b1bb9ff1176__slideHeaderFromTop;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:e54b49876d2b7dc3__slideHeaderToTop;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:f74156de1cf32837__slideSidebarFromRight;will-change:transform}:root:has(._5c711a1cecefd5e8__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:_157f548b8629f8b5__slideSidebarToRight;will-change:transform}@keyframes _2e385023a338e4a9__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes e245c2f64b6256de__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _9aa5832f67721dd4__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes _4d20ae2879ce77c4__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes e56b4b1bb9ff1176__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes e54b49876d2b7dc3__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes f74156de1cf32837__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes _157f548b8629f8b5__slideSidebarToRight{to{transform:translateX(100%)}}\");\n}\nexport default {\"layout\":\"_5c711a1cecefd5e8__layout\",\"has-full-canvas\":\"_52e00bad88ace7ce__has-full-canvas\",\"notices-snackbar\":\"eeebb116829e2f94__notices-snackbar\",\"components-snackbar\":\"cb865dcda5233b3b__components-snackbar\",\"sidebar-backdrop\":\"_04b3b4e8346a2b7b__sidebar-backdrop\",\"sidebar\":\"_615b052cf60fcff2__sidebar\",\"is-mobile\":\"_6be5d95ddf25e57f__is-mobile\",\"mobile-sidebar-drawer\":\"fd8d6491146392ce__mobile-sidebar-drawer\",\"layout-single-page\":\"f37b94fd2c1f6020__layout-single-page\",\"canvas\":\"_6da399dd0a232c1f__canvas\",\"has-mobile-drawer\":\"_5568e036ddaba310__has-mobile-drawer\",\"surfaces\":\"ff37ba01b23d0bcb__surfaces\",\"stage\":\"e323e272b8b8ed4f__stage\",\"inspector\":\"b37b199f2111c5f8__inspector\",\"has-canvas\":\"bbaf96f69377ab55__has-canvas\",\"zoomOut\":\"_2e385023a338e4a9__zoomOut\",\"zoomIn\":\"e245c2f64b6256de__zoomIn\",\"slideFromRight\":\"_9aa5832f67721dd4__slideFromRight\",\"slideToRight\":\"_4d20ae2879ce77c4__slideToRight\",\"slideHeaderFromTop\":\"e56b4b1bb9ff1176__slideHeaderFromTop\",\"slideHeaderToTop\":\"e54b49876d2b7dc3__slideHeaderToTop\",\"slideSidebarFromRight\":\"f74156de1cf32837__slideSidebarFromRight\",\"slideSidebarToRight\":\"_157f548b8629f8b5__slideSidebarToRight\"};\n","import type { ComponentType } from 'react';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { Page } from '@wordpress/admin-ui';\nimport {\n\tprivateApis as routePrivateApis,\n\ttype AnyRoute,\n} from '@wordpress/route';\nimport { resolveSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport Root from '../root';\nimport styles from '../root/style.module.scss';\nimport ErrorBoundary from '../error-boundary';\nimport type { Route, RouteConfig, RouteLoaderContext } from '../../store/types';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tcreateLazyRoute,\n\tcreateRouter,\n\tcreateRootRoute,\n\tcreateRoute,\n\tRouterProvider,\n\tcreateBrowserHistory,\n\tparseHref,\n\tuseLoaderData,\n} = unlock( routePrivateApis );\n\n// Not found component\nfunction NotFoundComponent() {\n\treturn (\n\t\t<div className={ styles.stage }>\n\t\t\t<Page title={ __( 'Route not found' ) } hasPadding>\n\t\t\t\t{ __( \"The page you're looking for does not exist\" ) }\n\t\t\t</Page>\n\t\t</div>\n\t);\n}\n\n/**\n * Creates a TanStack route from a Route definition.\n *\n * @param route Route configuration\n * @param parentRoute Parent route.\n * @return Tanstack Route.\n */\nfunction createRouteFromDefinition( route: Route, parentRoute: AnyRoute ) {\n\t// Create route without component initially\n\tlet tanstackRoute = createRoute( {\n\t\tgetParentRoute: () => parentRoute,\n\t\tpath: route.path,\n\t\tbeforeLoad: async ( opts: any ) => {\n\t\t\t// Import route module here (lazy)\n\t\t\tif ( route.route_module ) {\n\t\t\t\tconst module = await import( route.route_module );\n\t\t\t\tconst routeConfig = module.route || {};\n\n\t\t\t\tif ( routeConfig.beforeLoad ) {\n\t\t\t\t\treturn routeConfig.beforeLoad( {\n\t\t\t\t\t\tparams: opts.params || {},\n\t\t\t\t\t\tsearch: opts.search || {},\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tloader: async ( opts: any ) => {\n\t\t\t// Import route module here (lazy)\n\t\t\tlet routeConfig: RouteConfig = {};\n\t\t\tif ( route.route_module ) {\n\t\t\t\tconst module = await import( route.route_module );\n\t\t\t\trouteConfig = module.route || {};\n\t\t\t}\n\n\t\t\tconst context: RouteLoaderContext = {\n\t\t\t\tparams: opts.params || {},\n\t\t\t\tsearch: opts.deps || {},\n\t\t\t};\n\n\t\t\tconst [ , loaderData, canvasData, titleData ] = await Promise.all( [\n\t\t\t\tresolveSelect( coreStore ).getEntityRecord(\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase'\n\t\t\t\t),\n\t\t\t\trouteConfig.loader\n\t\t\t\t\t? routeConfig.loader( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t\trouteConfig.canvas\n\t\t\t\t\t? routeConfig.canvas( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t\trouteConfig.title\n\t\t\t\t\t? routeConfig.title( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t] );\n\n\t\t\tlet inspector = true;\n\t\t\tif ( routeConfig.inspector ) {\n\t\t\t\tinspector = await routeConfig.inspector( context );\n\t\t\t}\n\n\t\t\tlet stage = true;\n\t\t\tif ( routeConfig.stage ) {\n\t\t\t\tstage = await routeConfig.stage( context );\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...( loaderData as any ),\n\t\t\t\tcanvas: canvasData,\n\t\t\t\tinspector,\n\t\t\t\tstage,\n\t\t\t\ttitle: titleData,\n\t\t\t\trouteContentModule: route.content_module,\n\t\t\t};\n\t\t},\n\t\tloaderDeps: ( opts: any ) => opts.search,\n\t} );\n\n\t// Chain .lazy() to preload content module on intent\n\ttanstackRoute = tanstackRoute.lazy( async () => {\n\t\tconst module = route.content_module\n\t\t\t? await import( route.content_module )\n\t\t\t: {};\n\n\t\tconst Stage = module.stage;\n\t\tconst Inspector = module.inspector;\n\n\t\treturn createLazyRoute( route.path )( {\n\t\t\tcomponent: function RouteComponent() {\n\t\t\t\tconst { inspector: showInspector, stage: showStage } =\n\t\t\t\t\tuseLoaderData( { from: route.path } ) ?? {};\n\n\t\t\t\treturn (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ Stage && showStage && (\n\t\t\t\t\t\t\t<div className={ styles.stage }>\n\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t<Stage />\n\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ Inspector && showInspector && (\n\t\t\t\t\t\t\t<div className={ styles.inspector }>\n\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t<Inspector />\n\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t</div>\n\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} );\n\n\treturn tanstackRoute;\n}\n\n/**\n * Creates a route tree from route definitions.\n *\n * @param routes Routes definition.\n * @param rootComponent Root component to use for the router.\n * @return Router tree.\n */\nfunction createRouteTree(\n\troutes: Route[],\n\trootComponent: ComponentType = Root\n) {\n\tconst rootRoute = createRootRoute( {\n\t\tcomponent: rootComponent as any,\n\t\tcontext: () => ( {} ),\n\t} );\n\n\t// Create routes from definitions (now synchronous)\n\tconst dynamicRoutes = routes.map( ( route ) =>\n\t\tcreateRouteFromDefinition( route, rootRoute )\n\t);\n\n\treturn rootRoute.addChildren( dynamicRoutes );\n}\n\n// Create custom history that parses ?p= query parameter\nfunction createPathHistory() {\n\treturn createBrowserHistory( {\n\t\tparseLocation: () => {\n\t\t\tconst url = new URL( window.location.href );\n\t\t\tconst path = url.searchParams.get( 'p' ) || '/';\n\t\t\tconst pathHref = `${ path }${ url.hash }`;\n\t\t\treturn parseHref( pathHref, window.history.state );\n\t\t},\n\t\tcreateHref: ( href: string ) => {\n\t\t\tconst searchParams = new URLSearchParams( window.location.search );\n\t\t\tsearchParams.set( 'p', href );\n\t\t\treturn `${ window.location.pathname }?${ searchParams }`;\n\t\t},\n\t} );\n}\n\ninterface RouterProps {\n\troutes: Route[];\n\trootComponent?: ComponentType;\n}\n\nexport default function Router( {\n\troutes,\n\trootComponent = Root,\n}: RouterProps ) {\n\tconst router = useMemo( () => {\n\t\tconst history = createPathHistory();\n\t\tconst routeTree = createRouteTree( routes, rootComponent );\n\n\t\treturn createRouter( {\n\t\t\thistory,\n\t\t\trouteTree,\n\t\t\tdefaultPreload: 'intent',\n\t\t\tdefaultNotFoundComponent: NotFoundComponent,\n\t\t\tdefaultViewTransition: {\n\t\t\t\ttypes: ( {\n\t\t\t\t\tfromLocation,\n\t\t\t\t}: {\n\t\t\t\t\tfromLocation?: unknown;\n\t\t\t\t\ttoLocation: unknown;\n\t\t\t\t\tpathChanged: boolean;\n\t\t\t\t\threfChanged: boolean;\n\t\t\t\t\thashChanged: boolean;\n\t\t\t\t} ) => {\n\t\t\t\t\t// Disable view transition on initial navigation (no previous location)\n\t\t\t\t\tif ( ! fromLocation ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Enable with navigation type for subsequent navigations\n\t\t\t\t\treturn [ 'navigate' ];\n\t\t\t\t},\n\t\t\t},\n\t\t} );\n\t}, [ routes, rootComponent ] );\n\n\tre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;EAC7B,MAAM,UAAU,kBAAkB;EAClC,MAAM,YAAY,gBAAiB,QAAQ,aAAc;EAEzD,OAAO,aAAc;GACpB;GACA;GACA,gBAAgB;GAChB,0BAA0B;GAC1B,uBAAuB,EACtB,QAAS,EACR,mBAOM;IAEN,IAAK,CAAE,cACN,OAAO;IAIR,OAAO,CAAE,UAAW;GACrB,EACD;EACD,CAAE;CACH,GAAG,CAAE,QAAQ,aAAc,CAAE;CAE7B,OAAO,oBAAC,gBAAD,EAAyB,OAAU,CAAA;AAC3C"}
1
+ {"version":3,"file":"router.mjs","names":["routePrivateApis","styles","coreStore"],"sources":["../../../../style-runtime/src/index.ts","../../../src/components/root/style.module.scss","../../../src/components/app/router.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(\"5af927cba5\", \"._56935e6282cea626__layout{background:var(--wpds-color-background-surface-neutral-weak,#f3f3f3);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){._56935e6282cea626__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){._56935e6282cea626__layout{min-height:calc(100vh - 32px)}body:has(._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas) ._56935e6282cea626__layout{min-height:100vh}}:where(._56935e6282cea626__layout) img{height:auto;max-width:100%}._56935e6282cea626__layout ._4b753b79328f00f2__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}._56935e6282cea626__layout ._4b753b79328f00f2__notices-snackbar .components-snackbar,._56935e6282cea626__layout ._4b753b79328f00f2__notices-snackbar .efa1f12116c3fb44__components-snackbar{margin-inline:auto}.a42f10ffa1623b1a__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}._24ece5d7d830027c__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}._24ece5d7d830027c__sidebar.ea25e130be9dcc55__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f3f3f3);bottom:0;box-shadow:0 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}._46722ab62d8eeeca__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._5021a5c25e2952a7__layout-single-page ._46722ab62d8eeeca__mobile-sidebar-drawer{top:46px}._46722ab62d8eeeca__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}._690b80eca9eb9eb6__canvas._47abeba36a2c03ed__has-mobile-drawer{padding-top:65px;position:relative}._52f74c33fd2757fc__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){._52f74c33fd2757fc__surfaces{margin:8px}._5021a5c25e2952a7__layout-single-page ._52f74c33fd2757fc__surfaces{margin-top:0;margin-inline-start:0}}._8510aae3042dca12__inspector,.ed02476df88803b9__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}._5021a5c25e2952a7__layout-single-page ._8510aae3042dca12__inspector,._5021a5c25e2952a7__layout-single-page .ed02476df88803b9__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._8510aae3042dca12__inspector,.ed02476df88803b9__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._5021a5c25e2952a7__layout-single-page ._8510aae3042dca12__inspector,._5021a5c25e2952a7__layout-single-page .ed02476df88803b9__stage{height:auto}}.ed02476df88803b9__stage{z-index:2}@media (min-width:782px){.ed02476df88803b9__stage{z-index:auto}}._8510aae3042dca12__inspector{z-index:3}@media (min-width:782px){._8510aae3042dca12__inspector{z-index:auto}}._690b80eca9eb9eb6__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}._5021a5c25e2952a7__layout-single-page ._690b80eca9eb9eb6__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._690b80eca9eb9eb6__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._5021a5c25e2952a7__layout-single-page ._690b80eca9eb9eb6__canvas{height:auto}._56935e6282cea626__layout.b4c4ba65515802c9__has-canvas .ed02476df88803b9__stage,._8510aae3042dca12__inspector{max-width:400px}}._690b80eca9eb9eb6__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._52f74c33fd2757fc__surfaces{gap:0;margin:0}._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._8510aae3042dca12__inspector,._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas .ed02476df88803b9__stage{display:none}._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._690b80eca9eb9eb6__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}._5021a5c25e2952a7__layout-single-page ._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._690b80eca9eb9eb6__canvas{top:46px}@media (min-width:782px){._5021a5c25e2952a7__layout-single-page ._56935e6282cea626__layout._8fc7f864ef1ff9d4__has-full-canvas ._690b80eca9eb9eb6__canvas{top:32px}}@media (max-width:782px){._690b80eca9eb9eb6__canvas:not(._47abeba36a2c03ed__has-mobile-drawer),._8510aae3042dca12__inspector,.ed02476df88803b9__stage{height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}._46722ab62d8eeeca__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){._690b80eca9eb9eb6__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}._690b80eca9eb9eb6__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.ed02476df88803b9__stage{view-transition-name:boot--stage}._8510aae3042dca12__inspector{view-transition-name:boot--inspector}._690b80eca9eb9eb6__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.ed02476df88803b9__stage{view-transition-name:boot-safari--stage}._8510aae3042dca12__inspector{view-transition-name:boot-safari--inspector}._690b80eca9eb9eb6__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(._56935e6282cea626__layout) *{view-transition-name:none!important}}:root:has(._56935e6282cea626__layout)::view-transition-new(root),:root:has(._56935e6282cea626__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(._56935e6282cea626__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(._56935e6282cea626__layout)::view-transition-group(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-group(boot--canvas-header),:root:has(._56935e6282cea626__layout)::view-transition-group(boot--canvas-sidebar),:root:has(._56935e6282cea626__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--canvas),:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--inspector),:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--stage),:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--canvas),:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--inspector),:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-new(boot--inspector),:root:has(._56935e6282cea626__layout)::view-transition-new(boot--stage),:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-old(boot--inspector),:root:has(._56935e6282cea626__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas),:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot--stage):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:ab73776591f19033__zoomOut;will-change:transform,opacity}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot--stage):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_10c071ed4bf0c4f2__zoomIn;will-change:transform,opacity}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas):only-child,:root:has(._56935e6282cea626__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_30a8540aba2100e9__slideFromRight;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas):only-child,:root:has(._56935e6282cea626__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:aea85e2dfc564485__slideToRight;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_8ad9a41739bd9fbe__slideHeaderFromTop;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:f56b26b5d5c9bc72__slideHeaderToTop;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:a2ba8d5a4515e038__slideSidebarFromRight;will-change:transform}:root:has(._56935e6282cea626__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:_6ddf6cb6adc49ad6__slideSidebarToRight;will-change:transform}@keyframes ab73776591f19033__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _10c071ed4bf0c4f2__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _30a8540aba2100e9__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes aea85e2dfc564485__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _8ad9a41739bd9fbe__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes f56b26b5d5c9bc72__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes a2ba8d5a4515e038__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes _6ddf6cb6adc49ad6__slideSidebarToRight{to{transform:translateX(100%)}}\");\n}\nexport default {\"layout\":\"_56935e6282cea626__layout\",\"has-full-canvas\":\"_8fc7f864ef1ff9d4__has-full-canvas\",\"notices-snackbar\":\"_4b753b79328f00f2__notices-snackbar\",\"components-snackbar\":\"efa1f12116c3fb44__components-snackbar\",\"sidebar-backdrop\":\"a42f10ffa1623b1a__sidebar-backdrop\",\"sidebar\":\"_24ece5d7d830027c__sidebar\",\"is-mobile\":\"ea25e130be9dcc55__is-mobile\",\"mobile-sidebar-drawer\":\"_46722ab62d8eeeca__mobile-sidebar-drawer\",\"layout-single-page\":\"_5021a5c25e2952a7__layout-single-page\",\"canvas\":\"_690b80eca9eb9eb6__canvas\",\"has-mobile-drawer\":\"_47abeba36a2c03ed__has-mobile-drawer\",\"surfaces\":\"_52f74c33fd2757fc__surfaces\",\"stage\":\"ed02476df88803b9__stage\",\"inspector\":\"_8510aae3042dca12__inspector\",\"has-canvas\":\"b4c4ba65515802c9__has-canvas\",\"zoomOut\":\"ab73776591f19033__zoomOut\",\"zoomIn\":\"_10c071ed4bf0c4f2__zoomIn\",\"slideFromRight\":\"_30a8540aba2100e9__slideFromRight\",\"slideToRight\":\"aea85e2dfc564485__slideToRight\",\"slideHeaderFromTop\":\"_8ad9a41739bd9fbe__slideHeaderFromTop\",\"slideHeaderToTop\":\"f56b26b5d5c9bc72__slideHeaderToTop\",\"slideSidebarFromRight\":\"a2ba8d5a4515e038__slideSidebarFromRight\",\"slideSidebarToRight\":\"_6ddf6cb6adc49ad6__slideSidebarToRight\"};\n","import type { ComponentType } from 'react';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { Page } from '@wordpress/admin-ui';\nimport {\n\tprivateApis as routePrivateApis,\n\ttype AnyRoute,\n} from '@wordpress/route';\nimport { resolveSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport Root from '../root';\nimport styles from '../root/style.module.scss';\nimport ErrorBoundary from '../error-boundary';\nimport type { Route, RouteConfig, RouteLoaderContext } from '../../store/types';\nimport { unlock } from '../../lock-unlock';\n\nconst {\n\tcreateLazyRoute,\n\tcreateRouter,\n\tcreateRootRoute,\n\tcreateRoute,\n\tRouterProvider,\n\tcreateBrowserHistory,\n\tparseHref,\n\tuseLoaderData,\n} = unlock( routePrivateApis );\n\n// Not found component\nfunction NotFoundComponent() {\n\treturn (\n\t\t<div className={ styles.stage }>\n\t\t\t<Page title={ __( 'Route not found' ) } hasPadding>\n\t\t\t\t{ __( \"The page you're looking for does not exist\" ) }\n\t\t\t</Page>\n\t\t</div>\n\t);\n}\n\n/**\n * Creates a TanStack route from a Route definition.\n *\n * @param route Route configuration\n * @param parentRoute Parent route.\n * @return Tanstack Route.\n */\nfunction createRouteFromDefinition( route: Route, parentRoute: AnyRoute ) {\n\t// Create route without component initially\n\tlet tanstackRoute = createRoute( {\n\t\tgetParentRoute: () => parentRoute,\n\t\tpath: route.path,\n\t\tbeforeLoad: async ( opts: any ) => {\n\t\t\t// Import route module here (lazy)\n\t\t\tif ( route.route_module ) {\n\t\t\t\tconst module = await import( route.route_module );\n\t\t\t\tconst routeConfig = module.route || {};\n\n\t\t\t\tif ( routeConfig.beforeLoad ) {\n\t\t\t\t\treturn routeConfig.beforeLoad( {\n\t\t\t\t\t\tparams: opts.params || {},\n\t\t\t\t\t\tsearch: opts.search || {},\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tloader: async ( opts: any ) => {\n\t\t\t// Import route module here (lazy)\n\t\t\tlet routeConfig: RouteConfig = {};\n\t\t\tif ( route.route_module ) {\n\t\t\t\tconst module = await import( route.route_module );\n\t\t\t\trouteConfig = module.route || {};\n\t\t\t}\n\n\t\t\tconst context: RouteLoaderContext = {\n\t\t\t\tparams: opts.params || {},\n\t\t\t\tsearch: opts.deps || {},\n\t\t\t};\n\n\t\t\tconst [ , loaderData, canvasData, titleData ] = await Promise.all( [\n\t\t\t\tresolveSelect( coreStore ).getEntityRecord(\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase'\n\t\t\t\t),\n\t\t\t\trouteConfig.loader\n\t\t\t\t\t? routeConfig.loader( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t\trouteConfig.canvas\n\t\t\t\t\t? routeConfig.canvas( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t\trouteConfig.title\n\t\t\t\t\t? routeConfig.title( context )\n\t\t\t\t\t: Promise.resolve( undefined ),\n\t\t\t] );\n\n\t\t\tlet inspector = true;\n\t\t\tif ( routeConfig.inspector ) {\n\t\t\t\tinspector = await routeConfig.inspector( context );\n\t\t\t}\n\n\t\t\tlet stage = true;\n\t\t\tif ( routeConfig.stage ) {\n\t\t\t\tstage = await routeConfig.stage( context );\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...( loaderData as any ),\n\t\t\t\tcanvas: canvasData,\n\t\t\t\tinspector,\n\t\t\t\tstage,\n\t\t\t\ttitle: titleData,\n\t\t\t\trouteContentModule: route.content_module,\n\t\t\t};\n\t\t},\n\t\tloaderDeps: ( opts: any ) => opts.search,\n\t} );\n\n\t// Chain .lazy() to preload content module on intent\n\ttanstackRoute = tanstackRoute.lazy( async () => {\n\t\tconst module = route.content_module\n\t\t\t? await import( route.content_module )\n\t\t\t: {};\n\n\t\tconst Stage = module.stage;\n\t\tconst Inspector = module.inspector;\n\n\t\treturn createLazyRoute( route.path )( {\n\t\t\tcomponent: function RouteComponent() {\n\t\t\t\tconst { inspector: showInspector, stage: showStage } =\n\t\t\t\t\tuseLoaderData( { from: route.path } ) ?? {};\n\n\t\t\t\treturn (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ Stage && showStage && (\n\t\t\t\t\t\t\t<div className={ styles.stage }>\n\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t<Stage />\n\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ Inspector && showInspector && (\n\t\t\t\t\t\t\t<div className={ styles.inspector }>\n\t\t\t\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t\t\t\t<Inspector />\n\t\t\t\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t\t\t</div>\n\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} );\n\n\treturn tanstackRoute;\n}\n\n/**\n * Creates a route tree from route definitions.\n *\n * @param routes Routes definition.\n * @param rootComponent Root component to use for the router.\n * @return Router tree.\n */\nfunction createRouteTree(\n\troutes: Route[],\n\trootComponent: ComponentType = Root\n) {\n\tconst rootRoute = createRootRoute( {\n\t\tcomponent: rootComponent as any,\n\t\tcontext: () => ( {} ),\n\t} );\n\n\t// Create routes from definitions (now synchronous)\n\tconst dynamicRoutes = routes.map( ( route ) =>\n\t\tcreateRouteFromDefinition( route, rootRoute )\n\t);\n\n\treturn rootRoute.addChildren( dynamicRoutes );\n}\n\n// Create custom history that parses ?p= query parameter\nfunction createPathHistory() {\n\treturn createBrowserHistory( {\n\t\tparseLocation: () => {\n\t\t\tconst url = new URL( window.location.href );\n\t\t\tconst path = url.searchParams.get( 'p' ) || '/';\n\t\t\tconst pathHref = `${ path }${ url.hash }`;\n\t\t\treturn parseHref( pathHref, window.history.state );\n\t\t},\n\t\tcreateHref: ( href: string ) => {\n\t\t\tconst searchParams = new URLSearchParams( window.location.search );\n\t\t\tsearchParams.set( 'p', href );\n\t\t\treturn `${ window.location.pathname }?${ searchParams }`;\n\t\t},\n\t} );\n}\n\ninterface RouterProps {\n\troutes: Route[];\n\trootComponent?: ComponentType;\n}\n\nexport default function Router( {\n\troutes,\n\trootComponent = Root,\n}: RouterProps ) {\n\tconst router = useMemo( () => {\n\t\tconst history = createPathHistory();\n\t\tconst routeTree = createRouteTree( routes, rootComponent );\n\n\t\treturn createRouter( {\n\t\t\thistory,\n\t\t\trouteTree,\n\t\t\tdefaultPreload: 'intent',\n\t\t\tdefaultNotFoundComponent: NotFoundComponent,\n\t\t\tdefaultViewTransition: {\n\t\t\t\ttypes: ( {\n\t\t\t\t\tfromLocation,\n\t\t\t\t}: {\n\t\t\t\t\tfromLocation?: unknown;\n\t\t\t\t\ttoLocation: unknown;\n\t\t\t\t\tpathChanged: boolean;\n\t\t\t\t\threfChanged: boolean;\n\t\t\t\t\thashChanged: boolean;\n\t\t\t\t} ) => {\n\t\t\t\t\t// Disable view transition on initial navigation (no previous location)\n\t\t\t\t\tif ( ! fromLocation ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Enable with navigation type for subsequent navigations\n\t\t\t\t\treturn [ 'navigate' ];\n\t\t\t\t},\n\t\t\t},\n\t\t} );\n\t}, [ routes, rootComponent ] );\n\n\treturn <RouterProvider router={ router } />;\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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AAS,IAAK;GAE1C,MAAM,WAAW,GADJ,IAAI,aAAa,IAAK,GAAI,KAAK,MACd,IAAI;GAClC,OAAO,UAAW,UAAU,OAAO,QAAQ,KAAM;EAClD;EACA,aAAc,SAAkB;GAC/B,MAAM,eAAe,IAAI,gBAAiB,OAAO,SAAS,MAAO;GACjE,aAAa,IAAK,KAAK,IAAK;GAC5B,OAAO,GAAI,OAAO,SAAS,SAAU,GAAI;EAC1C;CACD,CAAE;AACH;AAOA,SAAwB,OAAQ,EAC/B,QACA,gBAAgB,QACA;CAChB,MAAM,SAAS,cAAe;EAC7B,MAAM,UAAU,kBAAkB;EAClC,MAAM,YAAY,gBAAiB,QAAQ,aAAc;EAEzD,OAAO,aAAc;GACpB;GACA;GACA,gBAAgB;GAChB,0BAA0B;GAC1B,uBAAuB,EACtB,QAAS,EACR,mBAOM;IAEN,IAAK,CAAE,cACN,OAAO;IAIR,OAAO,CAAE,UAAW;GACrB,EACD;EACD,CAAE;CACH,GAAG,CAAE,QAAQ,aAAc,CAAE;CAE7B,OAAO,oBAAC,gBAAD,EAAyB,OAAU,CAAA;AAC3C"}
@@ -1,6 +1,6 @@
1
1
  import { speak } from "@wordpress/a11y";
2
2
  import { Component, useEffect, useState } from "@wordpress/element";
3
- import { __ } from "@wordpress/i18n";
3
+ import { __, _x } from "@wordpress/i18n";
4
4
  import { Button } from "@wordpress/components";
5
5
  import { EmptyState } from "@wordpress/ui";
6
6
  import { useCopyToClipboard } from "@wordpress/compose";
@@ -144,7 +144,7 @@ function CopyErrorButton({ error }) {
144
144
  variant: "secondary",
145
145
  ref,
146
146
  icon: RESULT_ICON[feedback.result],
147
- children: __("Copy error")
147
+ children: _x("Copy error", "button label")
148
148
  });
149
149
  }
150
150
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["errorIcon","styles"],"sources":["../../../../style-runtime/src/index.ts","../../../src/components/error-boundary/style.module.scss","../../../src/components/error-boundary/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(\"f23470a71f\", \"._69e0fe7ecf360e98__error-boundary{align-items:center;box-sizing:border-box;display:flex;justify-content:center;min-height:100%;padding:16px}\");\n}\nexport default {\"error-boundary\":\"_69e0fe7ecf360e98__error-boundary\"};\n","import type { ReactNode } from 'react';\nimport { speak } from '@wordpress/a11y';\nimport { Component, useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { EmptyState } from '@wordpress/ui';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { caution, check, copy, error as errorIcon } from '@wordpress/icons';\nimport styles from './style.module.scss';\n\ninterface Props {\n\tchildren: ReactNode;\n}\n\ninterface State {\n\terror: Error | null;\n}\n\nconst COPY_FEEDBACK_TIMEOUT = 2000;\n\ntype CopyResult = 'idle' | 'copied' | 'error';\n\nconst RESULT_ICON = {\n\tidle: copy,\n\tcopied: check,\n\terror: errorIcon,\n};\n\nfunction CopyErrorButton( { error }: { error: Error } ) {\n\t// Bump the id on every result so a repeat of the same outcome restarts\n\t// the time the icon stays visible.\n\tconst [ feedback, setFeedback ] = useState< {\n\t\tresult: CopyResult;\n\t\tid: number;\n\t} >( { result: 'idle', id: 0 } );\n\n\tuseEffect( () => {\n\t\tif ( feedback.result === 'idle' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst timeoutId = setTimeout(\n\t\t\t() => setFeedback( { result: 'idle', id: 0 } ),\n\t\t\tCOPY_FEEDBACK_TIMEOUT\n\t\t);\n\t\treturn () => clearTimeout( timeoutId );\n\t}, [ feedback ] );\n\n\tfunction report( result: Exclude< CopyResult, 'idle' >, message: string ) {\n\t\tsetFeedback( ( current ) => ( {\n\t\t\tresult,\n\t\t\tid: current.id + 1,\n\t\t} ) );\n\t\tspeak( message );\n\t}\n\n\tconst ref = useCopyToClipboard(\n\t\t() => error.stack ?? String( error ),\n\t\t() => report( 'copied', __( 'Copied to clipboard' ) ),\n\t\t() => report( 'error', __( \"Couldn't copy to clipboard.\" ) )\n\t);\n\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tvariant=\"secondary\"\n\t\t\tref={ ref }\n\t\t\ticon={ RESULT_ICON[ feedback.result ] }\n\t\t>\n\t\t\t{ __( 'Copy error' ) }\n\t\t</Button>\n\t);\n}\n\n/**\n * Contains a failure to one surface, so a screen keeps working around it.\n *\n * Wrapping each surface separately means a stage that throws leaves the\n * navigation, the canvas and the way to save reachable, rather than taking the\n * whole screen down with it.\n */\nexport default class ErrorBoundary extends Component< Props, State > {\n\tconstructor( props: Props ) {\n\t\tsuper( props );\n\t\tthis.state = { error: null };\n\t}\n\n\tstatic getDerivedStateFromError( error: Error ): State {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<div className={ styles[ 'error-boundary' ] }>\n\t\t\t\t<EmptyState.Root>\n\t\t\t\t\t<EmptyState.Icon icon={ caution } />\n\t\t\t\t\t<EmptyState.Title>\n\t\t\t\t\t\t{ __( 'Something went wrong' ) }\n\t\t\t\t\t</EmptyState.Title>\n\t\t\t\t\t<EmptyState.Description>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'This part of the screen could not be displayed. Reloading the page may help.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</EmptyState.Description>\n\t\t\t\t\t<EmptyState.Actions>\n\t\t\t\t\t\t<CopyErrorButton error={ error } />\n\t\t\t\t\t</EmptyState.Actions>\n\t\t\t\t</EmptyState.Root>\n\t\t\t</div>\n\t\t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;EACC,uBAAA;EACA,SAAQ;EACF;EACN,MAAO,YAAa,SAAS;EAE3B,UAAA,GAAI,YAAa;CACZ,CAAA;AAEV;;;;;;;;AASA,IAAqB,gBAArB,cAA2C,UAA0B;CACpE,YAAa,OAAe;EAC3B,MAAO,KAAM;EACb,KAAK,QAAQ,EAAE,OAAO,KAAK;CAC5B;CAEA,OAAO,yBAA0B,OAAsB;EACtD,OAAO,EAAE,MAAM;CAChB;CAEA,SAAS;EACR,MAAM,EAAE,UAAU,KAAK;EAEvB,IAAK,CAAE,OACN,OAAO,KAAK,MAAM;EAGnB,OACC,oBAAC,OAAD;GAAK,WAAYC,qBAAQ;GACxB,UAAA,qBAAC,WAAW,MAAZ,EAAA,UAAA;IACC,oBAAC,WAAW,MAAZ,EAAiB,MAAO,QAAW,CAAA;IACnC,oBAAC,WAAW,OAAZ,EAAA,UACG,GAAI,sBAAuB,EACZ,CAAA;IAClB,oBAAC,WAAW,aAAZ,EAAA,UACG,GACD,8EACD,EACuB,CAAA;IACxB,oBAAC,WAAW,SAAZ,EAAA,UACC,oBAAC,iBAAD,EAAyB,MAAS,CAAA,EACf,CAAA;GACJ,EAAA,CAAA;EACb,CAAA;CAEP;AACD"}
1
+ {"version":3,"file":"index.mjs","names":["errorIcon","styles"],"sources":["../../../../style-runtime/src/index.ts","../../../src/components/error-boundary/style.module.scss","../../../src/components/error-boundary/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(\"f23470a71f\", \"._69e0fe7ecf360e98__error-boundary{align-items:center;box-sizing:border-box;display:flex;justify-content:center;min-height:100%;padding:16px}\");\n}\nexport default {\"error-boundary\":\"_69e0fe7ecf360e98__error-boundary\"};\n","import type { ReactNode } from 'react';\nimport { speak } from '@wordpress/a11y';\nimport { Component, useEffect, useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { EmptyState } from '@wordpress/ui';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { caution, check, copy, error as errorIcon } from '@wordpress/icons';\nimport styles from './style.module.scss';\n\ninterface Props {\n\tchildren: ReactNode;\n}\n\ninterface State {\n\terror: Error | null;\n}\n\nconst COPY_FEEDBACK_TIMEOUT = 2000;\n\ntype CopyResult = 'idle' | 'copied' | 'error';\n\nconst RESULT_ICON = {\n\tidle: copy,\n\tcopied: check,\n\terror: errorIcon,\n};\n\nfunction CopyErrorButton( { error }: { error: Error } ) {\n\t// Bump the id on every result so a repeat of the same outcome restarts\n\t// the time the icon stays visible.\n\tconst [ feedback, setFeedback ] = useState< {\n\t\tresult: CopyResult;\n\t\tid: number;\n\t} >( { result: 'idle', id: 0 } );\n\n\tuseEffect( () => {\n\t\tif ( feedback.result === 'idle' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst timeoutId = setTimeout(\n\t\t\t() => setFeedback( { result: 'idle', id: 0 } ),\n\t\t\tCOPY_FEEDBACK_TIMEOUT\n\t\t);\n\t\treturn () => clearTimeout( timeoutId );\n\t}, [ feedback ] );\n\n\tfunction report( result: Exclude< CopyResult, 'idle' >, message: string ) {\n\t\tsetFeedback( ( current ) => ( {\n\t\t\tresult,\n\t\t\tid: current.id + 1,\n\t\t} ) );\n\t\tspeak( message );\n\t}\n\n\tconst ref = useCopyToClipboard(\n\t\t() => error.stack ?? String( error ),\n\t\t() => report( 'copied', __( 'Copied to clipboard' ) ),\n\t\t() => report( 'error', __( \"Couldn't copy to clipboard.\" ) )\n\t);\n\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tvariant=\"secondary\"\n\t\t\tref={ ref }\n\t\t\ticon={ RESULT_ICON[ feedback.result ] }\n\t\t>\n\t\t\t{ _x( 'Copy error', 'button label' ) }\n\t\t</Button>\n\t);\n}\n\n/**\n * Contains a failure to one surface, so a screen keeps working around it.\n *\n * Wrapping each surface separately means a stage that throws leaves the\n * navigation, the canvas and the way to save reachable, rather than taking the\n * whole screen down with it.\n */\nexport default class ErrorBoundary extends Component< Props, State > {\n\tconstructor( props: Props ) {\n\t\tsuper( props );\n\t\tthis.state = { error: null };\n\t}\n\n\tstatic getDerivedStateFromError( error: Error ): State {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tconst { error } = this.state;\n\n\t\tif ( ! error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<div className={ styles[ 'error-boundary' ] }>\n\t\t\t\t<EmptyState.Root>\n\t\t\t\t\t<EmptyState.Icon icon={ caution } />\n\t\t\t\t\t<EmptyState.Title>\n\t\t\t\t\t\t{ __( 'Something went wrong' ) }\n\t\t\t\t\t</EmptyState.Title>\n\t\t\t\t\t<EmptyState.Description>\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'This part of the screen could not be displayed. Reloading the page may help.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</EmptyState.Description>\n\t\t\t\t\t<EmptyState.Actions>\n\t\t\t\t\t\t<CopyErrorButton error={ error } />\n\t\t\t\t\t</EmptyState.Actions>\n\t\t\t\t</EmptyState.Root>\n\t\t\t</div>\n\t\t);\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,S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AK,CAAE,OACN,OAAO,KAAK,MAAM;EAGnB,OACC,oBAAC,OAAD;GAAK,WAAYC,qBAAQ;GACxB,UAAA,qBAAC,WAAW,MAAZ,EAAA,UAAA;IACC,oBAAC,WAAW,MAAZ,EAAiB,MAAO,QAAW,CAAA;IACnC,oBAAC,WAAW,OAAZ,EAAA,UACG,GAAI,sBAAuB,EACZ,CAAA;IAClB,oBAAC,WAAW,aAAZ,EAAA,UACG,GACD,8EACD,EACuB,CAAA;IACxB,oBAAC,WAAW,SAAZ,EAAA,UACC,oBAAC,iBAAD,EAAyB,MAAS,CAAA,EACf,CAAA;GACJ,EAAA,CAAA;EACb,CAAA;CAEP;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("1f139f6281", "._42242b9e34dc6a19__item._42242b9e34dc6a19__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:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}._42242b9e34dc6a19__item._42242b9e34dc6a19__item:focus,._42242b9e34dc6a19__item._42242b9e34dc6a19__item:hover,._42242b9e34dc6a19__item._42242b9e34dc6a19__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._42242b9e34dc6a19__item._42242b9e34dc6a19__item svg:last-child{padding:4px}._42242b9e34dc6a19__item._42242b9e34dc6a19__item[aria-current=page],._42242b9e34dc6a19__item._42242b9e34dc6a19__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)}._42242b9e34dc6a19__item._42242b9e34dc6a19__item:focus-visible{transform:translateZ(0)}._42242b9e34dc6a19__item._5feca241f78b1f09__is-compact{min-height:24px}");
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}");
111
111
  var style_module_default = {
112
- "item": "_42242b9e34dc6a19__item",
113
- "is-compact": "_5feca241f78b1f09__is-compact"
112
+ "item": "_873b0f189db62fa3__item",
113
+ "is-compact": "_1ac4ca98dd21cec1__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(\"1f139f6281\", \"._42242b9e34dc6a19__item._42242b9e34dc6a19__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:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}._42242b9e34dc6a19__item._42242b9e34dc6a19__item:focus,._42242b9e34dc6a19__item._42242b9e34dc6a19__item:hover,._42242b9e34dc6a19__item._42242b9e34dc6a19__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._42242b9e34dc6a19__item._42242b9e34dc6a19__item svg:last-child{padding:4px}._42242b9e34dc6a19__item._42242b9e34dc6a19__item[aria-current=page],._42242b9e34dc6a19__item._42242b9e34dc6a19__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)}._42242b9e34dc6a19__item._42242b9e34dc6a19__item:focus-visible{transform:translateZ(0)}._42242b9e34dc6a19__item._5feca241f78b1f09__is-compact{min-height:24px}\");\n}\nexport default {\"item\":\"_42242b9e34dc6a19__item\",\"is-compact\":\"_5feca241f78b1f09__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{ 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</Item>\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,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;GACR,SAAU;GACV,OAAQ,EAAE,UAAU,IAAI;GAHzB,UAAA;IAKG,SAAU,MAAM,qBAAsB;IACxC,oBAAC,WAAD,EAAa,SAAqB,CAAA;IAClC,oBAACC,MAAD,EACC,MAAO,MAAM,IAAI,mBAAmB,kBACpC,CAAA;GACM;;CACH,CAAA;AAER"}
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{ 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</Item>\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,IA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,qBAAO,MAAM,SAAU;EACzC,SAAU;EAEV,UAAA,qBAACC,sBAAD;GACC,SAAQ;GACR,SAAU;GACV,OAAQ,EAAE,UAAU,IAAI;GAHzB,UAAA;IAKG,SAAU,MAAM,qBAAsB;IACxC,oBAAC,WAAD,EAAa,SAAqB,CAAA;IAClC,oBAACC,MAAD,EACC,MAAO,MAAM,IAAI,mBAAmB,kBACpC,CAAA;GACM;;CACH,CAAA;AAER"}
@@ -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("1f139f6281", "._42242b9e34dc6a19__item._42242b9e34dc6a19__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:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}._42242b9e34dc6a19__item._42242b9e34dc6a19__item:focus,._42242b9e34dc6a19__item._42242b9e34dc6a19__item:hover,._42242b9e34dc6a19__item._42242b9e34dc6a19__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._42242b9e34dc6a19__item._42242b9e34dc6a19__item svg:last-child{padding:4px}._42242b9e34dc6a19__item._42242b9e34dc6a19__item[aria-current=page],._42242b9e34dc6a19__item._42242b9e34dc6a19__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)}._42242b9e34dc6a19__item._42242b9e34dc6a19__item:focus-visible{transform:translateZ(0)}._42242b9e34dc6a19__item._5feca241f78b1f09__is-compact{min-height:24px}");
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}");
114
114
  var style_module_default$1 = {
115
- "item": "_42242b9e34dc6a19__item",
116
- "is-compact": "_5feca241f78b1f09__is-compact"
115
+ "item": "_873b0f189db62fa3__item",
116
+ "is-compact": "_1ac4ca98dd21cec1__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(\"1f139f6281\", \"._42242b9e34dc6a19__item._42242b9e34dc6a19__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:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}._42242b9e34dc6a19__item._42242b9e34dc6a19__item:focus,._42242b9e34dc6a19__item._42242b9e34dc6a19__item:hover,._42242b9e34dc6a19__item._42242b9e34dc6a19__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._42242b9e34dc6a19__item._42242b9e34dc6a19__item svg:last-child{padding:4px}._42242b9e34dc6a19__item._42242b9e34dc6a19__item[aria-current=page],._42242b9e34dc6a19__item._42242b9e34dc6a19__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)}._42242b9e34dc6a19__item._42242b9e34dc6a19__item:focus-visible{transform:translateZ(0)}._42242b9e34dc6a19__item._5feca241f78b1f09__is-compact{min-height:24px}\");\n}\nexport default {\"item\":\"_42242b9e34dc6a19__item\",\"is-compact\":\"_5feca241f78b1f09__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,IAAI,IAAI;EAChB,gCAAgB,IAAI,QAAQ;CAC7B;CAEA,IAAK,OAAO,aAAa,aACxB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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","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,MA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AE,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;;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"}
@@ -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("1f139f6281", "._42242b9e34dc6a19__item._42242b9e34dc6a19__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:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}._42242b9e34dc6a19__item._42242b9e34dc6a19__item:focus,._42242b9e34dc6a19__item._42242b9e34dc6a19__item:hover,._42242b9e34dc6a19__item._42242b9e34dc6a19__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._42242b9e34dc6a19__item._42242b9e34dc6a19__item svg:last-child{padding:4px}._42242b9e34dc6a19__item._42242b9e34dc6a19__item[aria-current=page],._42242b9e34dc6a19__item._42242b9e34dc6a19__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)}._42242b9e34dc6a19__item._42242b9e34dc6a19__item:focus-visible{transform:translateZ(0)}._42242b9e34dc6a19__item._5feca241f78b1f09__is-compact{min-height:24px}");
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}");
110
110
  var style_module_default = {
111
- "item": "_42242b9e34dc6a19__item",
112
- "is-compact": "_5feca241f78b1f09__is-compact"
111
+ "item": "_873b0f189db62fa3__item",
112
+ "is-compact": "_1ac4ca98dd21cec1__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(\"1f139f6281\", \"._42242b9e34dc6a19__item._42242b9e34dc6a19__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:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}._42242b9e34dc6a19__item._42242b9e34dc6a19__item:focus,._42242b9e34dc6a19__item._42242b9e34dc6a19__item:hover,._42242b9e34dc6a19__item._42242b9e34dc6a19__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._42242b9e34dc6a19__item._42242b9e34dc6a19__item svg:last-child{padding:4px}._42242b9e34dc6a19__item._42242b9e34dc6a19__item[aria-current=page],._42242b9e34dc6a19__item._42242b9e34dc6a19__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)}._42242b9e34dc6a19__item._42242b9e34dc6a19__item:focus-visible{transform:translateZ(0)}._42242b9e34dc6a19__item._5feca241f78b1f09__is-compact{min-height:24px}\");\n}\nexport default {\"item\":\"_42242b9e34dc6a19__item\",\"is-compact\":\"_5feca241f78b1f09__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,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,I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,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","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,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,0B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