@wordpress/widget-dashboard 0.1.1 → 0.3.1-next.v.202607070741.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.
- package/CHANGELOG.md +24 -0
- package/README.md +10 -16
- package/build/components/actions/actions.cjs +2 -19
- package/build/components/actions/actions.cjs.map +3 -3
- package/build/components/commands/commands.cjs +1 -60
- package/build/components/commands/commands.cjs.map +2 -2
- package/build/{utils/grid-model-change → components/widget-attribute-controls}/index.cjs +7 -9
- package/build/components/widget-attribute-controls/index.cjs.map +7 -0
- package/build/components/widget-attribute-controls/widget-attribute-controls.cjs +93 -0
- package/build/components/widget-attribute-controls/widget-attribute-controls.cjs.map +7 -0
- package/build/components/widget-chrome/widget-chrome.cjs +16 -63
- package/build/components/widget-chrome/widget-chrome.cjs.map +2 -2
- package/build/components/{layout-settings → widget-frame}/index.cjs +9 -7
- package/build/components/widget-frame/index.cjs.map +7 -0
- package/build/components/widget-frame/widget-frame.cjs +193 -0
- package/build/components/widget-frame/widget-frame.cjs.map +7 -0
- package/build/{utils/migrate-layout → components/widget-header}/index.cjs +7 -7
- package/build/components/widget-header/index.cjs.map +7 -0
- package/build/components/widget-header/widget-header-infotip.cjs +166 -0
- package/build/components/widget-header/widget-header-infotip.cjs.map +7 -0
- package/build/components/widget-header/widget-header.cjs +173 -0
- package/build/components/widget-header/widget-header.cjs.map +7 -0
- package/build/components/{widget-settings/utils/get-admin-menu-inset.cjs → widget-layout-controls/index.cjs} +8 -18
- package/build/components/widget-layout-controls/index.cjs.map +7 -0
- package/build/components/{widgets/widget-layout-toolbar.cjs → widget-layout-controls/widget-layout-controls.cjs} +9 -100
- package/build/components/widget-layout-controls/widget-layout-controls.cjs.map +7 -0
- package/build/components/widget-picker/widget-picker.cjs +5 -93
- package/build/components/widget-picker/widget-picker.cjs.map +3 -3
- package/build/components/widget-preview-chrome/index.cjs +31 -0
- package/build/components/widget-preview-chrome/index.cjs.map +7 -0
- package/build/components/{widget-settings/widget-settings-toolbar.cjs → widget-preview-chrome/widget-preview-chrome.cjs} +41 -23
- package/build/components/widget-preview-chrome/widget-preview-chrome.cjs.map +7 -0
- package/build/components/widget-settings/index.cjs +3 -3
- package/build/components/widget-settings/index.cjs.map +1 -1
- package/build/components/widget-settings/utils/index.cjs +0 -3
- package/build/components/widget-settings/utils/index.cjs.map +2 -2
- package/build/components/widget-settings/widget-settings-trigger.cjs +22 -28
- package/build/components/widget-settings/widget-settings-trigger.cjs.map +2 -2
- package/build/components/widget-settings/widget-settings.cjs +40 -57
- package/build/components/widget-settings/widget-settings.cjs.map +2 -2
- package/build/components/widget-toolbar/widget-toolbar.cjs +7 -4
- package/build/components/widget-toolbar/widget-toolbar.cjs.map +2 -2
- package/build/components/widgets/widgets.cjs +14 -7
- package/build/components/widgets/widgets.cjs.map +2 -2
- package/build/context/dashboard-context.cjs +31 -80
- package/build/context/dashboard-context.cjs.map +2 -2
- package/build/context/ui-context.cjs +2 -18
- package/build/context/ui-context.cjs.map +2 -2
- package/build/types.cjs.map +1 -1
- package/build/utils/index.cjs +2 -5
- package/build/utils/index.cjs.map +2 -2
- package/build/widget-dashboard.cjs +0 -4
- package/build/widget-dashboard.cjs.map +2 -2
- package/build-module/components/actions/actions.mjs +3 -20
- package/build-module/components/actions/actions.mjs.map +2 -2
- package/build-module/components/commands/commands.mjs +2 -67
- package/build-module/components/commands/commands.mjs.map +2 -2
- package/build-module/components/widget-attribute-controls/index.mjs +6 -0
- package/build-module/components/widget-attribute-controls/index.mjs.map +7 -0
- package/build-module/components/widget-attribute-controls/widget-attribute-controls.mjs +68 -0
- package/build-module/components/widget-attribute-controls/widget-attribute-controls.mjs.map +7 -0
- package/build-module/components/widget-chrome/widget-chrome.mjs +17 -70
- package/build-module/components/widget-chrome/widget-chrome.mjs.map +2 -2
- package/build-module/components/widget-frame/index.mjs +7 -0
- package/build-module/components/widget-frame/index.mjs.map +7 -0
- package/build-module/components/widget-frame/widget-frame.mjs +157 -0
- package/build-module/components/widget-frame/widget-frame.mjs.map +7 -0
- package/build-module/components/widget-header/index.mjs +6 -0
- package/build-module/components/widget-header/index.mjs.map +7 -0
- package/build-module/components/widget-header/widget-header-infotip.mjs +141 -0
- package/build-module/components/widget-header/widget-header-infotip.mjs.map +7 -0
- package/build-module/components/widget-header/widget-header.mjs +138 -0
- package/build-module/components/widget-header/widget-header.mjs.map +7 -0
- package/build-module/components/widget-layout-controls/index.mjs +6 -0
- package/build-module/components/widget-layout-controls/index.mjs.map +7 -0
- package/build-module/components/widget-layout-controls/widget-layout-controls.mjs +90 -0
- package/build-module/components/widget-layout-controls/widget-layout-controls.mjs.map +7 -0
- package/build-module/components/widget-picker/widget-picker.mjs +6 -94
- package/build-module/components/widget-picker/widget-picker.mjs.map +3 -3
- package/build-module/components/widget-preview-chrome/index.mjs +6 -0
- package/build-module/components/widget-preview-chrome/index.mjs.map +7 -0
- package/build-module/components/{widget-settings/widget-settings-toolbar.mjs → widget-preview-chrome/widget-preview-chrome.mjs} +37 -19
- package/build-module/components/widget-preview-chrome/widget-preview-chrome.mjs.map +7 -0
- package/build-module/components/widget-settings/index.mjs +2 -2
- package/build-module/components/widget-settings/index.mjs.map +1 -1
- package/build-module/components/widget-settings/utils/index.mjs +0 -2
- package/build-module/components/widget-settings/utils/index.mjs.map +2 -2
- package/build-module/components/widget-settings/widget-settings-trigger.mjs +23 -29
- package/build-module/components/widget-settings/widget-settings-trigger.mjs.map +2 -2
- package/build-module/components/widget-settings/widget-settings.mjs +40 -57
- package/build-module/components/widget-settings/widget-settings.mjs.map +2 -2
- package/build-module/components/widget-toolbar/widget-toolbar.mjs +7 -4
- package/build-module/components/widget-toolbar/widget-toolbar.mjs.map +2 -2
- package/build-module/components/widgets/widgets.mjs +14 -7
- package/build-module/components/widgets/widgets.mjs.map +2 -2
- package/build-module/context/dashboard-context.mjs +31 -80
- package/build-module/context/dashboard-context.mjs.map +2 -2
- package/build-module/context/ui-context.mjs +2 -18
- package/build-module/context/ui-context.mjs.map +2 -2
- package/build-module/types.mjs.map +1 -1
- package/build-module/utils/index.mjs +1 -3
- package/build-module/utils/index.mjs.map +2 -2
- package/build-module/widget-dashboard.mjs +0 -4
- package/build-module/widget-dashboard.mjs.map +2 -2
- package/build-types/components/actions/actions.d.ts.map +1 -1
- package/build-types/components/commands/commands.d.ts.map +1 -1
- package/build-types/components/widget-attribute-controls/index.d.ts +2 -0
- package/build-types/components/widget-attribute-controls/index.d.ts.map +1 -0
- package/build-types/components/widget-attribute-controls/widget-attribute-controls.d.ts +23 -0
- package/build-types/components/widget-attribute-controls/widget-attribute-controls.d.ts.map +1 -0
- package/build-types/components/widget-chrome/widget-chrome.d.ts +8 -8
- package/build-types/components/widget-chrome/widget-chrome.d.ts.map +1 -1
- package/build-types/components/widget-frame/index.d.ts +3 -0
- package/build-types/components/widget-frame/index.d.ts.map +1 -0
- package/build-types/components/widget-frame/widget-frame.d.ts +25 -0
- package/build-types/components/widget-frame/widget-frame.d.ts.map +1 -0
- package/build-types/components/widget-header/index.d.ts +3 -0
- package/build-types/components/widget-header/index.d.ts.map +1 -0
- package/build-types/components/widget-header/widget-header-infotip.d.ts +20 -0
- package/build-types/components/widget-header/widget-header-infotip.d.ts.map +1 -0
- package/build-types/components/widget-header/widget-header.d.ts +38 -0
- package/build-types/components/widget-header/widget-header.d.ts.map +1 -0
- package/build-types/components/widget-layout-controls/index.d.ts +3 -0
- package/build-types/components/widget-layout-controls/index.d.ts.map +1 -0
- package/build-types/components/widget-layout-controls/widget-layout-controls.d.ts +14 -0
- package/build-types/components/widget-layout-controls/widget-layout-controls.d.ts.map +1 -0
- package/build-types/components/widget-picker/widget-picker.d.ts.map +1 -1
- package/build-types/components/widget-preview-chrome/index.d.ts +3 -0
- package/build-types/components/widget-preview-chrome/index.d.ts.map +1 -0
- package/build-types/components/widget-preview-chrome/widget-preview-chrome.d.ts +15 -0
- package/build-types/components/widget-preview-chrome/widget-preview-chrome.d.ts.map +1 -0
- package/build-types/components/widget-settings/index.d.ts +2 -2
- package/build-types/components/widget-settings/utils/index.d.ts +0 -1
- package/build-types/components/widget-settings/utils/index.d.ts.map +1 -1
- package/build-types/components/widget-settings/widget-settings-trigger.d.ts +4 -3
- package/build-types/components/widget-settings/widget-settings-trigger.d.ts.map +1 -1
- package/build-types/components/widget-settings/widget-settings.d.ts +2 -2
- package/build-types/components/widget-settings/widget-settings.d.ts.map +1 -1
- package/build-types/components/widget-toolbar/widget-toolbar.d.ts +10 -7
- package/build-types/components/widget-toolbar/widget-toolbar.d.ts.map +1 -1
- package/build-types/components/widgets/widgets.d.ts.map +1 -1
- package/build-types/context/dashboard-context.d.ts +23 -40
- package/build-types/context/dashboard-context.d.ts.map +1 -1
- package/build-types/context/ui-context.d.ts +0 -18
- package/build-types/context/ui-context.d.ts.map +1 -1
- package/build-types/types.d.ts +9 -15
- package/build-types/types.d.ts.map +1 -1
- package/build-types/utils/index.d.ts +0 -1
- package/build-types/utils/index.d.ts.map +1 -1
- package/build-types/widget-dashboard.d.ts +5 -5
- package/build-types/widget-dashboard.d.ts.map +1 -1
- package/package.json +17 -17
- package/src/components/actions/actions.tsx +2 -22
- package/src/components/commands/commands.tsx +3 -70
- package/src/components/widget-attribute-controls/index.ts +1 -0
- package/src/components/widget-attribute-controls/widget-attribute-controls.tsx +108 -0
- package/src/components/widget-chrome/widget-chrome.module.css +3 -68
- package/src/components/widget-chrome/widget-chrome.tsx +19 -130
- package/src/components/widget-frame/index.ts +2 -0
- package/src/components/widget-frame/widget-frame.module.css +17 -0
- package/src/components/widget-frame/widget-frame.tsx +138 -0
- package/src/components/widget-header/index.ts +2 -0
- package/src/components/widget-header/widget-header-infotip.tsx +82 -0
- package/src/components/widget-header/widget-header.module.css +76 -0
- package/src/components/widget-header/widget-header.tsx +101 -0
- package/src/components/widget-layout-controls/index.ts +2 -0
- package/src/components/{widgets/widget-layout-toolbar.tsx → widget-layout-controls/widget-layout-controls.tsx} +12 -13
- package/src/components/widget-picker/widget-picker.tsx +5 -10
- package/src/components/widget-preview-chrome/index.ts +2 -0
- package/src/components/widget-preview-chrome/widget-preview-chrome.module.css +22 -0
- package/src/components/widget-preview-chrome/widget-preview-chrome.tsx +65 -0
- package/src/components/widget-settings/index.ts +2 -2
- package/src/components/widget-settings/utils/index.ts +0 -1
- package/src/components/widget-settings/widget-settings-trigger.tsx +36 -43
- package/src/components/widget-settings/widget-settings.tsx +7 -26
- package/src/components/widget-toolbar/widget-toolbar.module.css +6 -9
- package/src/components/widget-toolbar/widget-toolbar.tsx +14 -8
- package/src/components/widgets/widgets.module.css +0 -1
- package/src/components/widgets/widgets.tsx +30 -8
- package/src/context/dashboard-context.tsx +70 -133
- package/src/context/ui-context.tsx +1 -39
- package/src/test/actions.test.tsx +7 -77
- package/src/test/commands.test.tsx +6 -45
- package/src/test/staging.test.tsx +82 -144
- package/src/test/widget-dashboard.test.tsx +24 -0
- package/src/types.ts +9 -16
- package/src/utils/index.ts +0 -1
- package/src/widget-dashboard.tsx +4 -8
- package/build/components/layout-settings/index.cjs.map +0 -7
- package/build/components/layout-settings/layout-model-edit-field/index.cjs +0 -186
- package/build/components/layout-settings/layout-model-edit-field/index.cjs.map +0 -7
- package/build/components/layout-settings/layout-model-edit-field/thumbnail-grid.cjs +0 -53
- package/build/components/layout-settings/layout-model-edit-field/thumbnail-grid.cjs.map +0 -7
- package/build/components/layout-settings/layout-model-edit-field/thumbnail-masonry.cjs +0 -53
- package/build/components/layout-settings/layout-model-edit-field/thumbnail-masonry.cjs.map +0 -7
- package/build/components/layout-settings/layout-settings.cjs +0 -207
- package/build/components/layout-settings/layout-settings.cjs.map +0 -7
- package/build/components/widget-settings/utils/get-admin-menu-inset.cjs.map +0 -7
- package/build/components/widget-settings/widget-settings-toolbar.cjs.map +0 -7
- package/build/components/widgets/widget-layout-toolbar.cjs.map +0 -7
- package/build/utils/grid-model-change/grid-model-change.cjs +0 -56
- package/build/utils/grid-model-change/grid-model-change.cjs.map +0 -7
- package/build/utils/grid-model-change/index.cjs.map +0 -7
- package/build/utils/migrate-layout/index.cjs.map +0 -7
- package/build/utils/migrate-layout/migrate-layout.cjs +0 -94
- package/build/utils/migrate-layout/migrate-layout.cjs.map +0 -7
- package/build-module/components/layout-settings/index.mjs +0 -6
- package/build-module/components/layout-settings/index.mjs.map +0 -7
- package/build-module/components/layout-settings/layout-model-edit-field/index.mjs +0 -151
- package/build-module/components/layout-settings/layout-model-edit-field/index.mjs.map +0 -7
- package/build-module/components/layout-settings/layout-model-edit-field/thumbnail-grid.mjs +0 -28
- package/build-module/components/layout-settings/layout-model-edit-field/thumbnail-grid.mjs.map +0 -7
- package/build-module/components/layout-settings/layout-model-edit-field/thumbnail-masonry.mjs +0 -28
- package/build-module/components/layout-settings/layout-model-edit-field/thumbnail-masonry.mjs.map +0 -7
- package/build-module/components/layout-settings/layout-settings.mjs +0 -187
- package/build-module/components/layout-settings/layout-settings.mjs.map +0 -7
- package/build-module/components/widget-settings/utils/get-admin-menu-inset.mjs +0 -16
- package/build-module/components/widget-settings/utils/get-admin-menu-inset.mjs.map +0 -7
- package/build-module/components/widget-settings/widget-settings-toolbar.mjs.map +0 -7
- package/build-module/components/widgets/widget-layout-toolbar.mjs +0 -181
- package/build-module/components/widgets/widget-layout-toolbar.mjs.map +0 -7
- package/build-module/utils/grid-model-change/grid-model-change.mjs +0 -30
- package/build-module/utils/grid-model-change/grid-model-change.mjs.map +0 -7
- package/build-module/utils/grid-model-change/index.mjs +0 -7
- package/build-module/utils/grid-model-change/index.mjs.map +0 -7
- package/build-module/utils/migrate-layout/index.mjs +0 -6
- package/build-module/utils/migrate-layout/index.mjs.map +0 -7
- package/build-module/utils/migrate-layout/migrate-layout.mjs +0 -69
- package/build-module/utils/migrate-layout/migrate-layout.mjs.map +0 -7
- package/build-types/components/layout-settings/index.d.ts +0 -2
- package/build-types/components/layout-settings/index.d.ts.map +0 -1
- package/build-types/components/layout-settings/layout-model-edit-field/index.d.ts +0 -17
- package/build-types/components/layout-settings/layout-model-edit-field/index.d.ts.map +0 -1
- package/build-types/components/layout-settings/layout-model-edit-field/thumbnail-grid.d.ts +0 -6
- package/build-types/components/layout-settings/layout-model-edit-field/thumbnail-grid.d.ts.map +0 -1
- package/build-types/components/layout-settings/layout-model-edit-field/thumbnail-masonry.d.ts +0 -6
- package/build-types/components/layout-settings/layout-model-edit-field/thumbnail-masonry.d.ts.map +0 -1
- package/build-types/components/layout-settings/layout-settings.d.ts +0 -14
- package/build-types/components/layout-settings/layout-settings.d.ts.map +0 -1
- package/build-types/components/widget-settings/utils/get-admin-menu-inset.d.ts +0 -17
- package/build-types/components/widget-settings/utils/get-admin-menu-inset.d.ts.map +0 -1
- package/build-types/components/widget-settings/widget-settings-toolbar.d.ts +0 -20
- package/build-types/components/widget-settings/widget-settings-toolbar.d.ts.map +0 -1
- package/build-types/components/widgets/widget-layout-toolbar.d.ts +0 -14
- package/build-types/components/widgets/widget-layout-toolbar.d.ts.map +0 -1
- package/build-types/utils/grid-model-change/grid-model-change.d.ts +0 -20
- package/build-types/utils/grid-model-change/grid-model-change.d.ts.map +0 -1
- package/build-types/utils/grid-model-change/index.d.ts +0 -2
- package/build-types/utils/grid-model-change/index.d.ts.map +0 -1
- package/build-types/utils/migrate-layout/index.d.ts +0 -2
- package/build-types/utils/migrate-layout/index.d.ts.map +0 -1
- package/build-types/utils/migrate-layout/migrate-layout.d.ts +0 -36
- package/build-types/utils/migrate-layout/migrate-layout.d.ts.map +0 -1
- package/src/components/layout-settings/index.ts +0 -1
- package/src/components/layout-settings/layout-model-edit-field/index.tsx +0 -98
- package/src/components/layout-settings/layout-model-edit-field/style.module.css +0 -34
- package/src/components/layout-settings/layout-model-edit-field/thumbnail-grid.tsx +0 -28
- package/src/components/layout-settings/layout-model-edit-field/thumbnail-masonry.tsx +0 -28
- package/src/components/layout-settings/layout-settings.tsx +0 -217
- package/src/components/widget-picker/widget-picker.module.css +0 -11
- package/src/components/widget-settings/utils/get-admin-menu-inset.ts +0 -30
- package/src/components/widget-settings/widget-settings-toolbar.module.css +0 -25
- package/src/components/widget-settings/widget-settings-toolbar.tsx +0 -45
- package/src/components/widgets/widget-layout-toolbar.module.css +0 -6
- package/src/utils/grid-model-change/grid-model-change.ts +0 -53
- package/src/utils/grid-model-change/index.ts +0 -1
- package/src/utils/migrate-layout/index.ts +0 -1
- package/src/utils/migrate-layout/migrate-layout.ts +0 -156
- package/src/utils/migrate-layout/test/migrate-layout.test.ts +0 -114
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
// packages/widget-dashboard/src/components/widget-chrome/widget-chrome.tsx
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
Component,
|
|
6
|
-
Suspense,
|
|
7
|
-
forwardRef,
|
|
8
|
-
useId,
|
|
9
|
-
useMemo
|
|
10
|
-
} from "@wordpress/element";
|
|
3
|
+
import { forwardRef, useId, useMemo } from "@wordpress/element";
|
|
11
4
|
import { __ } from "@wordpress/i18n";
|
|
12
5
|
import { plugins } from "@wordpress/icons";
|
|
13
|
-
import { Card, Icon, Stack,
|
|
6
|
+
import { Card, Icon, Stack, Text } from "@wordpress/ui";
|
|
14
7
|
import { useDashboardInternalContext } from "../../context/dashboard-context.mjs";
|
|
15
8
|
import { WidgetContextProvider } from "../../context/widget-context.mjs";
|
|
16
|
-
import {
|
|
9
|
+
import { LoadingOverlay, WidgetFrame } from "../widget-frame/index.mjs";
|
|
17
10
|
|
|
18
11
|
// packages/style-runtime/src/index.ts
|
|
19
12
|
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
|
|
@@ -99,27 +92,12 @@ function registerStyle(hash, css) {
|
|
|
99
92
|
|
|
100
93
|
// packages/widget-dashboard/src/components/widget-chrome/widget-chrome.module.css
|
|
101
94
|
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
102
|
-
registerStyle("
|
|
95
|
+
registerStyle("6d4975b814", "._79b45ce7d3422efe__widgetChrome:has(:focus-visible){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline-offset:2px}.d85f7657585b9203__widgetChromeHeaderIcon{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:inline-flex}._9f0be51a1b96c8d7__widgetChromeContent{flex:1;height:100%;min-height:0;min-width:0}._9b694d63bdec1a98__unavailable{height:100%}");
|
|
103
96
|
}
|
|
104
|
-
var widget_chrome_default = { "widgetChrome": "_79b45ce7d3422efe__widgetChrome", "
|
|
97
|
+
var widget_chrome_default = { "widgetChrome": "_79b45ce7d3422efe__widgetChrome", "widgetChromeHeaderIcon": "d85f7657585b9203__widgetChromeHeaderIcon", "widgetChromeContent": "_9f0be51a1b96c8d7__widgetChromeContent", "unavailable": "_9b694d63bdec1a98__unavailable" };
|
|
105
98
|
|
|
106
99
|
// packages/widget-dashboard/src/components/widget-chrome/widget-chrome.tsx
|
|
107
100
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
108
|
-
var WidgetErrorBoundary = class extends Component {
|
|
109
|
-
state = { hasError: false };
|
|
110
|
-
static getDerivedStateFromError() {
|
|
111
|
-
return { hasError: true };
|
|
112
|
-
}
|
|
113
|
-
render() {
|
|
114
|
-
if (this.state.hasError) {
|
|
115
|
-
return /* @__PURE__ */ jsx(Notice.Root, { intent: "error", children: /* @__PURE__ */ jsx(Notice.Description, { children: __("This widget encountered an error.") }) });
|
|
116
|
-
}
|
|
117
|
-
return this.props.children;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
function LoadingOverlay() {
|
|
121
|
-
return /* @__PURE__ */ jsx(Stack, { justify: "center", align: "center", className: widget_chrome_default.loading, children: /* @__PURE__ */ jsx(Spinner, {}) });
|
|
122
|
-
}
|
|
123
101
|
function UnavailableWidget({ widgetTypeName }) {
|
|
124
102
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
125
103
|
/* @__PURE__ */ jsx(Card.Header, { children: /* @__PURE__ */ jsx(
|
|
@@ -146,24 +124,8 @@ function UnavailableWidget({ widgetTypeName }) {
|
|
|
146
124
|
) })
|
|
147
125
|
] });
|
|
148
126
|
}
|
|
149
|
-
function Header({ titleId, widgetType }) {
|
|
150
|
-
if (!widgetType.title) {
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
return /* @__PURE__ */ jsx(Card.Header, { children: /* @__PURE__ */ jsxs(Stack, { direction: "row", align: "center", gap: "sm", children: [
|
|
154
|
-
widgetType.icon && /* @__PURE__ */ jsx(
|
|
155
|
-
"span",
|
|
156
|
-
{
|
|
157
|
-
className: widget_chrome_default.widgetChromeHeaderIcon,
|
|
158
|
-
"aria-hidden": "true",
|
|
159
|
-
children: /* @__PURE__ */ jsx(Icon, { icon: widgetType.icon })
|
|
160
|
-
}
|
|
161
|
-
),
|
|
162
|
-
/* @__PURE__ */ jsx(Card.Title, { id: titleId, render: /* @__PURE__ */ jsx("h2", {}), children: widgetType.title })
|
|
163
|
-
] }) });
|
|
164
|
-
}
|
|
165
127
|
var WidgetChrome = forwardRef(
|
|
166
|
-
function WidgetChrome2({ widget, index, className }, ref) {
|
|
128
|
+
function WidgetChrome2({ widget, index, className, headerToolbar }, ref) {
|
|
167
129
|
const { widgetTypes, isResolvingWidgetTypes, editMode } = useDashboardInternalContext();
|
|
168
130
|
const widgetType = widgetTypes.find((t) => t.name === widget.type);
|
|
169
131
|
const titleId = useId();
|
|
@@ -206,38 +168,23 @@ var WidgetChrome = forwardRef(
|
|
|
206
168
|
}
|
|
207
169
|
) });
|
|
208
170
|
}
|
|
209
|
-
|
|
210
|
-
const isHeaderHidden = presentation === "full-bleed";
|
|
211
|
-
const isBodyBleeding = presentation === "full-bleed" || presentation === "content-bleed";
|
|
212
|
-
const header = /* @__PURE__ */ jsx(Header, { titleId, widgetType });
|
|
213
|
-
const body = /* @__PURE__ */ jsx(WidgetErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingOverlay, {}), children: /* @__PURE__ */ jsx(WidgetRender, { widget, widgetType }) }) });
|
|
214
|
-
return /* @__PURE__ */ jsx(WidgetContextProvider, { value: contextValue, children: /* @__PURE__ */ jsxs(
|
|
171
|
+
return /* @__PURE__ */ jsx(WidgetContextProvider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
215
172
|
Card.Root,
|
|
216
173
|
{
|
|
217
174
|
render: /* @__PURE__ */ jsx("section", {}),
|
|
218
175
|
ref,
|
|
219
176
|
className: clsx(widget_chrome_default.widgetChrome, className),
|
|
220
177
|
"aria-labelledby": widgetType.title ? titleId : void 0,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
children: isBodyBleeding ? /* @__PURE__ */ jsx(
|
|
232
|
-
Card.FullBleed,
|
|
233
|
-
{
|
|
234
|
-
className: widget_chrome_default.widgetChromeBleedScroll,
|
|
235
|
-
children: body
|
|
236
|
-
}
|
|
237
|
-
) : body
|
|
238
|
-
}
|
|
239
|
-
)
|
|
240
|
-
]
|
|
178
|
+
children: /* @__PURE__ */ jsx(
|
|
179
|
+
WidgetFrame,
|
|
180
|
+
{
|
|
181
|
+
widget,
|
|
182
|
+
widgetType,
|
|
183
|
+
titleId,
|
|
184
|
+
editMode,
|
|
185
|
+
headerToolbar
|
|
186
|
+
}
|
|
187
|
+
)
|
|
241
188
|
}
|
|
242
189
|
) });
|
|
243
190
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/widget-chrome/widget-chrome.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/widget-chrome/widget-chrome.module.css"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { Spinner } from '@wordpress/components';\nimport {\n\tComponent,\n\tSuspense,\n\tforwardRef,\n\tuseId,\n\tuseMemo,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { plugins } from '@wordpress/icons';\n// eslint-disable-next-line @wordpress/use-recommended-components\nimport { Card, Icon, Stack, Notice, Text, VisuallyHidden } from '@wordpress/ui';\nimport type { WidgetType } from '@wordpress/widget-primitives';\n\n/**\n * Internal dependencies\n */\nimport { useDashboardInternalContext } from '../../context/dashboard-context';\nimport { WidgetContextProvider } from '../../context/widget-context';\nimport { WidgetRender } from '../widget-render';\nimport styles from './widget-chrome.module.css';\nimport type { DashboardWidget } from '../../types';\n\ninterface ErrorBoundaryProps {\n\tchildren: ReactNode;\n}\n\ninterface ErrorBoundaryState {\n\thasError: boolean;\n}\n\nclass WidgetErrorBoundary extends Component<\n\tErrorBoundaryProps,\n\tErrorBoundaryState\n> {\n\tstate: ErrorBoundaryState = { hasError: false };\n\n\tstatic getDerivedStateFromError(): ErrorBoundaryState {\n\t\treturn { hasError: true };\n\t}\n\n\trender() {\n\t\tif ( this.state.hasError ) {\n\t\t\treturn (\n\t\t\t\t<Notice.Root intent=\"error\">\n\t\t\t\t\t<Notice.Description>\n\t\t\t\t\t\t{ __( 'This widget encountered an error.' ) }\n\t\t\t\t\t</Notice.Description>\n\t\t\t\t</Notice.Root>\n\t\t\t);\n\t\t}\n\t\treturn this.props.children;\n\t}\n}\n\nfunction LoadingOverlay() {\n\treturn (\n\t\t<Stack justify=\"center\" align=\"center\" className={ styles.loading }>\n\t\t\t<Spinner />\n\t\t</Stack>\n\t);\n}\n\ninterface UnavailableWidgetProps {\n\twidgetTypeName: string;\n}\n\nfunction UnavailableWidget( { widgetTypeName }: UnavailableWidgetProps ) {\n\treturn (\n\t\t<>\n\t\t\t<Card.Header>\n\t\t\t\t<span\n\t\t\t\t\tclassName={ styles.widgetChromeHeaderIcon }\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={ plugins } />\n\t\t\t\t</span>\n\t\t\t</Card.Header>\n\t\t\t<Card.Content className={ styles.widgetChromeContent }>\n\t\t\t\t<Stack\n\t\t\t\t\tdirection=\"column\"\n\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName={ styles.unavailable }\n\t\t\t\t>\n\t\t\t\t\t<Text>{ __( 'Widget is no longer available.' ) }</Text>\n\t\t\t\t\t<Text render={ <code /> }>{ widgetTypeName }</Text>\n\t\t\t\t</Stack>\n\t\t\t</Card.Content>\n\t\t</>\n\t);\n}\n\ninterface HeaderProps {\n\ttitleId: string;\n\twidgetType: WidgetType;\n}\n\nfunction Header( { titleId, widgetType }: HeaderProps ) {\n\tif ( ! widgetType.title ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Card.Header>\n\t\t\t<Stack direction=\"row\" align=\"center\" gap=\"sm\">\n\t\t\t\t{ widgetType.icon && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ styles.widgetChromeHeaderIcon }\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={ widgetType.icon } />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<Card.Title id={ titleId } render={ <h2 /> }>\n\t\t\t\t\t{ widgetType.title }\n\t\t\t\t</Card.Title>\n\t\t\t</Stack>\n\t\t</Card.Header>\n\t);\n}\n\nexport interface WidgetChromeProps {\n\twidget: DashboardWidget< unknown >;\n\tindex: number;\n\t/**\n\t * Lifted by the surrounding `@wordpress/grid` surface into a sibling\n\t * slot of the grid item; not rendered by `WidgetChrome` itself.\n\t * Living outside `Card.Root` is what keeps these controls interactive\n\t * while edit mode applies `inert` to the chrome.\n\t */\n\tactionableArea?: ReactNode;\n\tclassName?: string;\n}\n\n/**\n * Per-instance wrapper. Owns the chrome around a widget instance: identity\n * context, header (title + icon), edit-mode `inert` attribute, and the\n * error/loading boundaries that keep neighbours mounted when one widget fails\n * or is still resolving.\n */\nexport const WidgetChrome = forwardRef< HTMLDivElement, WidgetChromeProps >(\n\tfunction WidgetChrome( { widget, index, className }, ref ) {\n\t\tconst { widgetTypes, isResolvingWidgetTypes, editMode } =\n\t\t\tuseDashboardInternalContext();\n\t\tconst widgetType = widgetTypes.find( ( t ) => t.name === widget.type );\n\t\tconst titleId = useId();\n\n\t\tconst contextValue = useMemo(\n\t\t\t() => ( {\n\t\t\t\tuuid: widget.uuid,\n\t\t\t\tname: widget.type,\n\t\t\t\tindex,\n\t\t\t} ),\n\t\t\t[ widget.uuid, widget.type, index ]\n\t\t);\n\n\t\tif ( ! widgetType ) {\n\t\t\tif ( isResolvingWidgetTypes ) {\n\t\t\t\treturn (\n\t\t\t\t\t<WidgetContextProvider value={ contextValue }>\n\t\t\t\t\t\t<Card.Root\n\t\t\t\t\t\t\trender={ <section /> }\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tclassName={ clsx( styles.widgetChrome, className ) }\n\t\t\t\t\t\t\taria-busy=\"true\"\n\t\t\t\t\t\t\taria-label={ __( 'Loading' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Card.Content\n\t\t\t\t\t\t\t\tclassName={ styles.widgetChromeContent }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<LoadingOverlay />\n\t\t\t\t\t\t\t</Card.Content>\n\t\t\t\t\t\t</Card.Root>\n\t\t\t\t\t</WidgetContextProvider>\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<WidgetContextProvider value={ contextValue }>\n\t\t\t\t\t<Card.Root\n\t\t\t\t\t\trender={ <section /> }\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tclassName={ clsx( styles.widgetChrome, className ) }\n\t\t\t\t\t\taria-label={ __( 'Missing widget' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<UnavailableWidget widgetTypeName={ widget.type } />\n\t\t\t\t\t</Card.Root>\n\t\t\t\t</WidgetContextProvider>\n\t\t\t);\n\t\t}\n\n\t\t// `presentation` encodes two independent axes. `full-bleed` hides\n\t\t// the header; both `full-bleed` and `content-bleed` let the body\n\t\t// break out of the content padding.\n\t\tconst { presentation } = widgetType;\n\t\tconst isHeaderHidden = presentation === 'full-bleed';\n\t\tconst isBodyBleeding =\n\t\t\tpresentation === 'full-bleed' || presentation === 'content-bleed';\n\t\tconst header = <Header titleId={ titleId } widgetType={ widgetType } />;\n\n\t\tconst body = (\n\t\t\t<WidgetErrorBoundary>\n\t\t\t\t<Suspense fallback={ <LoadingOverlay /> }>\n\t\t\t\t\t<WidgetRender widget={ widget } widgetType={ widgetType } />\n\t\t\t\t</Suspense>\n\t\t\t</WidgetErrorBoundary>\n\t\t);\n\n\t\treturn (\n\t\t\t<WidgetContextProvider value={ contextValue }>\n\t\t\t\t<Card.Root\n\t\t\t\t\trender={ <section /> }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tclassName={ clsx( styles.widgetChrome, className ) }\n\t\t\t\t\taria-labelledby={ widgetType.title ? titleId : undefined }\n\t\t\t\t\t{ ...( editMode ? { inert: 'true' } : {} ) }\n\t\t\t\t>\n\t\t\t\t\t{ isHeaderHidden ? (\n\t\t\t\t\t\t<VisuallyHidden>{ header }</VisuallyHidden>\n\t\t\t\t\t) : (\n\t\t\t\t\t\theader\n\t\t\t\t\t) }\n\n\t\t\t\t\t<Card.Content\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\tstyles.widgetChromeContent,\n\t\t\t\t\t\t\tisBodyBleeding && styles.widgetChromeContentBleed\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isBodyBleeding ? (\n\t\t\t\t\t\t\t<Card.FullBleed\n\t\t\t\t\t\t\t\tclassName={ styles.widgetChromeBleedScroll }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ body }\n\t\t\t\t\t\t\t</Card.FullBleed>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tbody\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Card.Content>\n\t\t\t\t</Card.Root>\n\t\t\t</WidgetContextProvider>\n\t\t);\n\t}\n);\n", "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(\"345dedc0b8\", \"._79b45ce7d3422efe__widgetChrome{contain:layout;height:100%}._79b45ce7d3422efe__widgetChrome:has(._9f0be51a1b96c8d7__widgetChromeContent :focus-visible){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline-offset:2px}.d85f7657585b9203__widgetChromeHeaderIcon{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:inline-flex}._9f0be51a1b96c8d7__widgetChromeContent{flex:1;height:100%;min-height:0;min-width:0;overflow-y:auto}._21770471c9c2115b__widgetChromeContentBleed{padding-block:0}._229727240ac2aa18__widgetChromeBleedScroll{height:100%;margin-block-end:0;overflow-y:auto}._3c919e86d1bb80ab__loading,._9b694d63bdec1a98__unavailable{height:100%}\");\n}\nexport default {\"widgetChrome\":\"_79b45ce7d3422efe__widgetChrome\",\"widgetChromeContent\":\"_9f0be51a1b96c8d7__widgetChromeContent\",\"widgetChromeHeaderIcon\":\"d85f7657585b9203__widgetChromeHeaderIcon\",\"widgetChromeContentBleed\":\"_21770471c9c2115b__widgetChromeContentBleed\",\"widgetChromeBleedScroll\":\"_229727240ac2aa18__widgetChromeBleedScroll\",\"loading\":\"_3c919e86d1bb80ab__loading\",\"unavailable\":\"_9b694d63bdec1a98__unavailable\"};\n"],
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAMjB,SAAS,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useId, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { plugins } from '@wordpress/icons';\nimport { Card, Icon, Stack, Text } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport { useDashboardInternalContext } from '../../context/dashboard-context';\nimport { WidgetContextProvider } from '../../context/widget-context';\nimport { LoadingOverlay, WidgetFrame } from '../widget-frame';\nimport styles from './widget-chrome.module.css';\nimport type { DashboardWidget } from '../../types';\n\ninterface UnavailableWidgetProps {\n\twidgetTypeName: string;\n}\n\nfunction UnavailableWidget( { widgetTypeName }: UnavailableWidgetProps ) {\n\treturn (\n\t\t<>\n\t\t\t<Card.Header>\n\t\t\t\t<span\n\t\t\t\t\tclassName={ styles.widgetChromeHeaderIcon }\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t>\n\t\t\t\t\t<Icon icon={ plugins } />\n\t\t\t\t</span>\n\t\t\t</Card.Header>\n\t\t\t<Card.Content className={ styles.widgetChromeContent }>\n\t\t\t\t<Stack\n\t\t\t\t\tdirection=\"column\"\n\t\t\t\t\tjustify=\"center\"\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName={ styles.unavailable }\n\t\t\t\t>\n\t\t\t\t\t<Text>{ __( 'Widget is no longer available.' ) }</Text>\n\t\t\t\t\t<Text render={ <code /> }>{ widgetTypeName }</Text>\n\t\t\t\t</Stack>\n\t\t\t</Card.Content>\n\t\t</>\n\t);\n}\n\nexport interface WidgetChromeProps {\n\twidget: DashboardWidget< unknown >;\n\tindex: number;\n\t/**\n\t * Lifted by `@wordpress/grid` into a sibling slot outside `Card.Root`,\n\t * for full-bleed widgets with no in-card header to host the toolbar.\n\t */\n\tactionableArea?: ReactNode;\n\t/**\n\t * Toolbar rendered in the in-card header (framed and content-bleed).\n\t */\n\theaderToolbar?: ReactNode;\n\tclassName?: string;\n}\n\n/**\n * Dashboard chrome: wraps `WidgetFrame` in the grid tile's `Card.Root`, owning\n * the missing and resolving states.\n */\nexport const WidgetChrome = forwardRef< HTMLDivElement, WidgetChromeProps >(\n\tfunction WidgetChrome( { widget, index, className, headerToolbar }, ref ) {\n\t\tconst { widgetTypes, isResolvingWidgetTypes, editMode } =\n\t\t\tuseDashboardInternalContext();\n\t\tconst widgetType = widgetTypes.find( ( t ) => t.name === widget.type );\n\t\tconst titleId = useId();\n\n\t\tconst contextValue = useMemo(\n\t\t\t() => ( {\n\t\t\t\tuuid: widget.uuid,\n\t\t\t\tname: widget.type,\n\t\t\t\tindex,\n\t\t\t} ),\n\t\t\t[ widget.uuid, widget.type, index ]\n\t\t);\n\n\t\tif ( ! widgetType ) {\n\t\t\tif ( isResolvingWidgetTypes ) {\n\t\t\t\treturn (\n\t\t\t\t\t<WidgetContextProvider value={ contextValue }>\n\t\t\t\t\t\t<Card.Root\n\t\t\t\t\t\t\trender={ <section /> }\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tclassName={ clsx( styles.widgetChrome, className ) }\n\t\t\t\t\t\t\taria-busy=\"true\"\n\t\t\t\t\t\t\taria-label={ __( 'Loading' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Card.Content\n\t\t\t\t\t\t\t\tclassName={ styles.widgetChromeContent }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<LoadingOverlay />\n\t\t\t\t\t\t\t</Card.Content>\n\t\t\t\t\t\t</Card.Root>\n\t\t\t\t\t</WidgetContextProvider>\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<WidgetContextProvider value={ contextValue }>\n\t\t\t\t\t<Card.Root\n\t\t\t\t\t\trender={ <section /> }\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tclassName={ clsx( styles.widgetChrome, className ) }\n\t\t\t\t\t\taria-label={ __( 'Missing widget' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<UnavailableWidget widgetTypeName={ widget.type } />\n\t\t\t\t\t</Card.Root>\n\t\t\t\t</WidgetContextProvider>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<WidgetContextProvider value={ contextValue }>\n\t\t\t\t<Card.Root\n\t\t\t\t\trender={ <section /> }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tclassName={ clsx( styles.widgetChrome, className ) }\n\t\t\t\t\taria-labelledby={ widgetType.title ? titleId : undefined }\n\t\t\t\t>\n\t\t\t\t\t<WidgetFrame\n\t\t\t\t\t\twidget={ widget }\n\t\t\t\t\t\twidgetType={ widgetType }\n\t\t\t\t\t\ttitleId={ titleId }\n\t\t\t\t\t\teditMode={ editMode }\n\t\t\t\t\t\theaderToolbar={ headerToolbar }\n\t\t\t\t\t/>\n\t\t\t\t</Card.Root>\n\t\t\t</WidgetContextProvider>\n\t\t);\n\t}\n);\n", "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(\"6d4975b814\", \"._79b45ce7d3422efe__widgetChrome:has(:focus-visible){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline-offset:2px}.d85f7657585b9203__widgetChromeHeaderIcon{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:inline-flex}._9f0be51a1b96c8d7__widgetChromeContent{flex:1;height:100%;min-height:0;min-width:0}._9b694d63bdec1a98__unavailable{height:100%}\");\n}\nexport default {\"widgetChrome\":\"_79b45ce7d3422efe__widgetChrome\",\"widgetChromeHeaderIcon\":\"d85f7657585b9203__widgetChromeHeaderIcon\",\"widgetChromeContent\":\"_9f0be51a1b96c8d7__widgetChromeContent\",\"unavailable\":\"_9b694d63bdec1a98__unavailable\"};\n"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;AAMjB,SAAS,YAAY,OAAO,eAAe;AAC3C,SAAS,UAAU;AACnB,SAAS,eAAe;AACxB,SAAS,MAAM,MAAM,OAAO,YAAY;AAKxC,SAAS,mCAAmC;AAC5C,SAAS,6BAA6B;AACtC,SAAS,gBAAgB,mBAAmB;;;ACT5C,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACrB,QAAM,cAAc;AAEpB,MAAK,YAAY,kBAAmB;AACnC,WAAO,YAAY;AAAA,EACpB;AAEA,cAAY,mBAAmB;AAAA,IAC9B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC7B;AAEA,MAAK,OAAO,aAAa,aAAc;AACtC,qBAAkB,QAAS;AAAA,EAC5B;AAEA,SAAO,YAAY;AACpB;AAUA,SAAS,0BACR,gBACA,MACU;AACV,MAAK,CAAE,eAAe,MAAO;AAC5B,WAAO;AAAA,EACR;AAEA,aAAY,SAAS,eAAe,KAAK;AAAA,IACxC,SAAU,oBAAqB;AAAA,EAChC,GAAI;AACH,QAAK,MAAM,aAAc,oBAAqB,MAAM,MAAO;AAC1D,aAAO;AAAA,IACR;AAAA,EACD;AAEA,SAAO;AACR;AAUA,SAAS,YAAa,gBAA0B,MAAc,KAAc;AAC3E,MAAK,CAAE,eAAe,MAAO;AAC5B;AAAA,EACD;AAEA,QAAM,UAAU,WAAW;AAC3B,MAAI,iBAAiB,QAAQ,eAAe,IAAK,cAAe;AAEhE,MAAK,CAAE,gBAAiB;AACvB,qBAAiB,oBAAI,IAAI;AACzB,YAAQ,eAAe,IAAK,gBAAg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AAY,sBAAO;AAAA,gBAEnB,8BAAC,kBAAe;AAAA;AAAA,YACjB;AAAA;AAAA,QACD,GACD;AAAA,MAEF;AAEA,aACC,oBAAC,yBAAsB,OAAQ,cAC9B;AAAA,QAAC,KAAK;AAAA,QAAL;AAAA,UACA,QAAS,oBAAC,aAAQ;AAAA,UAClB;AAAA,UACA,WAAY,KAAM,sBAAO,cAAc,SAAU;AAAA,UACjD,cAAa,GAAI,gBAAiB;AAAA,UAElC,8BAAC,qBAAkB,gBAAiB,OAAO,MAAO;AAAA;AAAA,MACnD,GACD;AAAA,IAEF;AAEA,WACC,oBAAC,yBAAsB,OAAQ,cAC9B;AAAA,MAAC,KAAK;AAAA,MAAL;AAAA,QACA,QAAS,oBAAC,aAAQ;AAAA,QAClB;AAAA,QACA,WAAY,KAAM,sBAAO,cAAc,SAAU;AAAA,QACjD,mBAAkB,WAAW,QAAQ,UAAU;AAAA,QAE/C;AAAA,UAAC;AAAA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACD;AAAA;AAAA,IACD,GACD;AAAA,EAEF;AACD;",
|
|
6
6
|
"names": ["WidgetChrome"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/widget-frame/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { WidgetFrame, LoadingOverlay } from './widget-frame';\nexport type { WidgetFrameProps } from './widget-frame';\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,aAAa,sBAAsB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// packages/widget-dashboard/src/components/widget-frame/widget-frame.tsx
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { Spinner } from "@wordpress/components";
|
|
4
|
+
import { Component, Suspense } from "@wordpress/element";
|
|
5
|
+
import { __ } from "@wordpress/i18n";
|
|
6
|
+
import { Card, Notice, Stack, VisuallyHidden } from "@wordpress/ui";
|
|
7
|
+
import { WidgetHeader } from "../widget-header/index.mjs";
|
|
8
|
+
import { WidgetRender } from "../widget-render/index.mjs";
|
|
9
|
+
|
|
10
|
+
// packages/style-runtime/src/index.ts
|
|
11
|
+
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
|
|
12
|
+
function getRuntime() {
|
|
13
|
+
const globalScope = globalThis;
|
|
14
|
+
if (globalScope.__wpStyleRuntime) {
|
|
15
|
+
return globalScope.__wpStyleRuntime;
|
|
16
|
+
}
|
|
17
|
+
globalScope.__wpStyleRuntime = {
|
|
18
|
+
documents: /* @__PURE__ */ new Map(),
|
|
19
|
+
styles: /* @__PURE__ */ new Map(),
|
|
20
|
+
injectedStyles: /* @__PURE__ */ new WeakMap()
|
|
21
|
+
};
|
|
22
|
+
if (typeof document !== "undefined") {
|
|
23
|
+
registerDocument(document);
|
|
24
|
+
}
|
|
25
|
+
return globalScope.__wpStyleRuntime;
|
|
26
|
+
}
|
|
27
|
+
function documentContainsStyleHash(targetDocument, hash) {
|
|
28
|
+
if (!targetDocument.head) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
for (const style of targetDocument.head.querySelectorAll(
|
|
32
|
+
`style[${STYLE_HASH_ATTRIBUTE}]`
|
|
33
|
+
)) {
|
|
34
|
+
if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
function injectStyle(targetDocument, hash, css) {
|
|
41
|
+
if (!targetDocument.head) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const runtime = getRuntime();
|
|
45
|
+
let injectedStyles = runtime.injectedStyles.get(targetDocument);
|
|
46
|
+
if (!injectedStyles) {
|
|
47
|
+
injectedStyles = /* @__PURE__ */ new Set();
|
|
48
|
+
runtime.injectedStyles.set(targetDocument, injectedStyles);
|
|
49
|
+
}
|
|
50
|
+
if (injectedStyles.has(hash)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (documentContainsStyleHash(targetDocument, hash)) {
|
|
54
|
+
injectedStyles.add(hash);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const style = targetDocument.createElement("style");
|
|
58
|
+
style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
|
|
59
|
+
style.appendChild(targetDocument.createTextNode(css));
|
|
60
|
+
targetDocument.head.appendChild(style);
|
|
61
|
+
injectedStyles.add(hash);
|
|
62
|
+
}
|
|
63
|
+
function registerDocument(targetDocument) {
|
|
64
|
+
const runtime = getRuntime();
|
|
65
|
+
runtime.documents.set(
|
|
66
|
+
targetDocument,
|
|
67
|
+
(runtime.documents.get(targetDocument) ?? 0) + 1
|
|
68
|
+
);
|
|
69
|
+
for (const [hash, css] of runtime.styles) {
|
|
70
|
+
injectStyle(targetDocument, hash, css);
|
|
71
|
+
}
|
|
72
|
+
return () => {
|
|
73
|
+
const count = runtime.documents.get(targetDocument);
|
|
74
|
+
if (count === void 0) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (count <= 1) {
|
|
78
|
+
runtime.documents.delete(targetDocument);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
runtime.documents.set(targetDocument, count - 1);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function registerStyle(hash, css) {
|
|
85
|
+
const runtime = getRuntime();
|
|
86
|
+
runtime.styles.set(hash, css);
|
|
87
|
+
for (const targetDocument of runtime.documents.keys()) {
|
|
88
|
+
injectStyle(targetDocument, hash, css);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// packages/widget-dashboard/src/components/widget-frame/widget-frame.module.css
|
|
93
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
94
|
+
registerStyle("627665ae60", "._5848d9de101def77__content{flex:1;height:100%;min-height:0;min-width:0;overflow-y:auto}._475e9e5d90f37dab__bleedContent{padding:0}._605aa8383905f0a9__loading{height:100%}");
|
|
95
|
+
}
|
|
96
|
+
var widget_frame_default = { "content": "_5848d9de101def77__content", "bleedContent": "_475e9e5d90f37dab__bleedContent", "loading": "_605aa8383905f0a9__loading" };
|
|
97
|
+
|
|
98
|
+
// packages/widget-dashboard/src/components/widget-frame/widget-frame.tsx
|
|
99
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
100
|
+
var WidgetErrorBoundary = class extends Component {
|
|
101
|
+
state = { hasError: false };
|
|
102
|
+
static getDerivedStateFromError() {
|
|
103
|
+
return { hasError: true };
|
|
104
|
+
}
|
|
105
|
+
render() {
|
|
106
|
+
if (this.state.hasError) {
|
|
107
|
+
return /* @__PURE__ */ jsx(Notice.Root, { intent: "error", children: /* @__PURE__ */ jsx(Notice.Description, { children: __("This widget encountered an error.") }) });
|
|
108
|
+
}
|
|
109
|
+
return this.props.children;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
function LoadingOverlay() {
|
|
113
|
+
return /* @__PURE__ */ jsx(Stack, { justify: "center", align: "center", className: widget_frame_default.loading, children: /* @__PURE__ */ jsx(Spinner, {}) });
|
|
114
|
+
}
|
|
115
|
+
function WidgetFrame({
|
|
116
|
+
widget,
|
|
117
|
+
widgetType,
|
|
118
|
+
titleId,
|
|
119
|
+
editMode = false,
|
|
120
|
+
headerToolbar
|
|
121
|
+
}) {
|
|
122
|
+
const { presentation } = widgetType;
|
|
123
|
+
const isHeaderHidden = presentation === "full-bleed";
|
|
124
|
+
const isBodyBleeding = presentation === "full-bleed" || presentation === "content-bleed";
|
|
125
|
+
const body = /* @__PURE__ */ jsx(WidgetErrorBoundary, { children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingOverlay, {}), children: /* @__PURE__ */ jsx(WidgetRender, { widget, widgetType }) }) });
|
|
126
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
127
|
+
!isHeaderHidden && /* @__PURE__ */ jsx(
|
|
128
|
+
WidgetHeader,
|
|
129
|
+
{
|
|
130
|
+
showIdentity: true,
|
|
131
|
+
widgetType,
|
|
132
|
+
titleId,
|
|
133
|
+
editMode,
|
|
134
|
+
children: headerToolbar
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
/* @__PURE__ */ jsxs(
|
|
138
|
+
Card.Content,
|
|
139
|
+
{
|
|
140
|
+
className: clsx(
|
|
141
|
+
widget_frame_default.content,
|
|
142
|
+
isBodyBleeding && widget_frame_default.bleedContent
|
|
143
|
+
),
|
|
144
|
+
...editMode ? { inert: "true" } : {},
|
|
145
|
+
children: [
|
|
146
|
+
isHeaderHidden && widgetType.title && /* @__PURE__ */ jsx(VisuallyHidden, { render: /* @__PURE__ */ jsx("h2", { id: titleId }), children: widgetType.title }),
|
|
147
|
+
body
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
)
|
|
151
|
+
] });
|
|
152
|
+
}
|
|
153
|
+
export {
|
|
154
|
+
LoadingOverlay,
|
|
155
|
+
WidgetFrame
|
|
156
|
+
};
|
|
157
|
+
//# sourceMappingURL=widget-frame.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/widget-frame/widget-frame.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/widget-frame/widget-frame.module.css"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { Spinner } from '@wordpress/components';\nimport { Component, Suspense } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n// eslint-disable-next-line @wordpress/use-recommended-components\nimport { Card, Notice, Stack, VisuallyHidden } from '@wordpress/ui';\nimport type { WidgetType } from '@wordpress/widget-primitives';\n\n/**\n * Internal dependencies\n */\nimport { WidgetHeader } from '../widget-header';\nimport { WidgetRender } from '../widget-render';\nimport styles from './widget-frame.module.css';\nimport type { DashboardWidget } from '../../types';\n\ninterface ErrorBoundaryProps {\n\tchildren: ReactNode;\n}\n\ninterface ErrorBoundaryState {\n\thasError: boolean;\n}\n\nclass WidgetErrorBoundary extends Component<\n\tErrorBoundaryProps,\n\tErrorBoundaryState\n> {\n\tstate: ErrorBoundaryState = { hasError: false };\n\n\tstatic getDerivedStateFromError(): ErrorBoundaryState {\n\t\treturn { hasError: true };\n\t}\n\n\trender() {\n\t\tif ( this.state.hasError ) {\n\t\t\treturn (\n\t\t\t\t<Notice.Root intent=\"error\">\n\t\t\t\t\t<Notice.Description>\n\t\t\t\t\t\t{ __( 'This widget encountered an error.' ) }\n\t\t\t\t\t</Notice.Description>\n\t\t\t\t</Notice.Root>\n\t\t\t);\n\t\t}\n\t\treturn this.props.children;\n\t}\n}\n\n/* Centered spinner for resolving and Suspense waits. */\nexport function LoadingOverlay() {\n\treturn (\n\t\t<Stack justify=\"center\" align=\"center\" className={ styles.loading }>\n\t\t\t<Spinner />\n\t\t</Stack>\n\t);\n}\n\nexport interface WidgetFrameProps {\n\twidget: DashboardWidget< unknown >;\n\twidgetType: WidgetType;\n\ttitleId: string;\n\n\t/**\n\t * Inert the body and identity while customizing.\n\t */\n\teditMode?: boolean;\n\n\t/**\n\t * Toolbar shown beside the identity in the in-card header.\n\t */\n\theaderToolbar?: ReactNode;\n}\n\n/**\n * Shared framing: `presentation` into header + content, with the error/loading\n * boundaries. Hosts supply the `Card.Root` and their own concerns.\n *\n * @param {WidgetFrameProps} props Component props.\n */\nexport function WidgetFrame( {\n\twidget,\n\twidgetType,\n\ttitleId,\n\teditMode = false,\n\theaderToolbar,\n}: WidgetFrameProps ) {\n\t// full-bleed hides the header; full-bleed and content-bleed bleed the body.\n\tconst { presentation } = widgetType;\n\tconst isHeaderHidden = presentation === 'full-bleed';\n\tconst isBodyBleeding =\n\t\tpresentation === 'full-bleed' || presentation === 'content-bleed';\n\n\tconst body = (\n\t\t<WidgetErrorBoundary>\n\t\t\t<Suspense fallback={ <LoadingOverlay /> }>\n\t\t\t\t<WidgetRender widget={ widget } widgetType={ widgetType } />\n\t\t\t</Suspense>\n\t\t</WidgetErrorBoundary>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ ! isHeaderHidden && (\n\t\t\t\t<WidgetHeader\n\t\t\t\t\tshowIdentity\n\t\t\t\t\twidgetType={ widgetType }\n\t\t\t\t\ttitleId={ titleId }\n\t\t\t\t\teditMode={ editMode }\n\t\t\t\t>\n\t\t\t\t\t{ headerToolbar }\n\t\t\t\t</WidgetHeader>\n\t\t\t) }\n\n\t\t\t<Card.Content\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\tstyles.content,\n\t\t\t\t\tisBodyBleeding && styles.bleedContent\n\t\t\t\t) }\n\t\t\t\t{ ...( editMode ? { inert: 'true' } : {} ) }\n\t\t\t>\n\t\t\t\t{ isHeaderHidden && widgetType.title && (\n\t\t\t\t\t<VisuallyHidden render={ <h2 id={ titleId } /> }>\n\t\t\t\t\t\t{ widgetType.title }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t) }\n\t\t\t\t{ body }\n\t\t\t</Card.Content>\n\t\t</>\n\t);\n}\n", "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(\"627665ae60\", \"._5848d9de101def77__content{flex:1;height:100%;min-height:0;min-width:0;overflow-y:auto}._475e9e5d90f37dab__bleedContent{padding:0}._605aa8383905f0a9__loading{height:100%}\");\n}\nexport default {\"content\":\"_5848d9de101def77__content\",\"bleedContent\":\"_475e9e5d90f37dab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AAM,UAAW;AAC1B,aACC,oBAAC,OAAO,MAAP,EAAY,QAAO,SACnB,8BAAC,OAAO,aAAP,EACE,aAAI,mCAAoC,GAC3C,GACD;AAAA,IAEF;AACA,WAAO,KAAK,MAAM;AAAA,EACnB;AACD;AAGO,SAAS,iBAAiB;AAChC,SACC,oBAAC,SAAM,SAAQ,UAAS,OAAM,UAAS,WAAY,qBAAO,SACzD,8BAAC,WAAQ,GACV;AAEF;AAwBO,SAAS,YAAa;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AACD,GAAsB;AAErB,QAAM,EAAE,aAAa,IAAI;AACzB,QAAM,iBAAiB,iBAAiB;AACxC,QAAM,iBACL,iBAAiB,gBAAgB,iBAAiB;AAEnD,QAAM,OACL,oBAAC,uBACA,8BAAC,YAAS,UAAW,oBAAC,kBAAe,GACpC,8BAAC,gBAAa,QAAkB,YAA0B,GAC3D,GACD;AAGD,SACC,iCACG;AAAA,KAAE,kBACH;AAAA,MAAC;AAAA;AAAA,QACA,cAAY;AAAA,QACZ;AAAA,QACA;AAAA,QACA;AAAA,QAEE;AAAA;AAAA,IACH;AAAA,IAGD;AAAA,MAAC,KAAK;AAAA,MAAL;AAAA,QACA,WAAY;AAAA,UACX,qBAAO;AAAA,UACP,kBAAkB,qBAAO;AAAA,QAC1B;AAAA,QACE,GAAK,WAAW,EAAE,OAAO,OAAO,IAAI,CAAC;AAAA,QAErC;AAAA,4BAAkB,WAAW,SAC9B,oBAAC,kBAAe,QAAS,oBAAC,QAAG,IAAK,SAAU,GACzC,qBAAW,OACd;AAAA,UAEC;AAAA;AAAA;AAAA,IACH;AAAA,KACD;AAEF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/widget-header/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { WidgetHeader } from './widget-header';\nexport type { WidgetHeaderProps } from './widget-header';\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,oBAAoB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// packages/widget-dashboard/src/components/widget-header/widget-header-infotip.tsx
|
|
2
|
+
import { createInterpolateElement } from "@wordpress/element";
|
|
3
|
+
import { __ } from "@wordpress/i18n";
|
|
4
|
+
import { info } from "@wordpress/icons";
|
|
5
|
+
import { Icon, Link, Popover, Stack, VisuallyHidden } from "@wordpress/ui";
|
|
6
|
+
|
|
7
|
+
// packages/style-runtime/src/index.ts
|
|
8
|
+
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
|
|
9
|
+
function getRuntime() {
|
|
10
|
+
const globalScope = globalThis;
|
|
11
|
+
if (globalScope.__wpStyleRuntime) {
|
|
12
|
+
return globalScope.__wpStyleRuntime;
|
|
13
|
+
}
|
|
14
|
+
globalScope.__wpStyleRuntime = {
|
|
15
|
+
documents: /* @__PURE__ */ new Map(),
|
|
16
|
+
styles: /* @__PURE__ */ new Map(),
|
|
17
|
+
injectedStyles: /* @__PURE__ */ new WeakMap()
|
|
18
|
+
};
|
|
19
|
+
if (typeof document !== "undefined") {
|
|
20
|
+
registerDocument(document);
|
|
21
|
+
}
|
|
22
|
+
return globalScope.__wpStyleRuntime;
|
|
23
|
+
}
|
|
24
|
+
function documentContainsStyleHash(targetDocument, hash) {
|
|
25
|
+
if (!targetDocument.head) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
for (const style of targetDocument.head.querySelectorAll(
|
|
29
|
+
`style[${STYLE_HASH_ATTRIBUTE}]`
|
|
30
|
+
)) {
|
|
31
|
+
if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
function injectStyle(targetDocument, hash, css) {
|
|
38
|
+
if (!targetDocument.head) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const runtime = getRuntime();
|
|
42
|
+
let injectedStyles = runtime.injectedStyles.get(targetDocument);
|
|
43
|
+
if (!injectedStyles) {
|
|
44
|
+
injectedStyles = /* @__PURE__ */ new Set();
|
|
45
|
+
runtime.injectedStyles.set(targetDocument, injectedStyles);
|
|
46
|
+
}
|
|
47
|
+
if (injectedStyles.has(hash)) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (documentContainsStyleHash(targetDocument, hash)) {
|
|
51
|
+
injectedStyles.add(hash);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const style = targetDocument.createElement("style");
|
|
55
|
+
style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
|
|
56
|
+
style.appendChild(targetDocument.createTextNode(css));
|
|
57
|
+
targetDocument.head.appendChild(style);
|
|
58
|
+
injectedStyles.add(hash);
|
|
59
|
+
}
|
|
60
|
+
function registerDocument(targetDocument) {
|
|
61
|
+
const runtime = getRuntime();
|
|
62
|
+
runtime.documents.set(
|
|
63
|
+
targetDocument,
|
|
64
|
+
(runtime.documents.get(targetDocument) ?? 0) + 1
|
|
65
|
+
);
|
|
66
|
+
for (const [hash, css] of runtime.styles) {
|
|
67
|
+
injectStyle(targetDocument, hash, css);
|
|
68
|
+
}
|
|
69
|
+
return () => {
|
|
70
|
+
const count = runtime.documents.get(targetDocument);
|
|
71
|
+
if (count === void 0) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (count <= 1) {
|
|
75
|
+
runtime.documents.delete(targetDocument);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
runtime.documents.set(targetDocument, count - 1);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function registerStyle(hash, css) {
|
|
82
|
+
const runtime = getRuntime();
|
|
83
|
+
runtime.styles.set(hash, css);
|
|
84
|
+
for (const targetDocument of runtime.documents.keys()) {
|
|
85
|
+
injectStyle(targetDocument, hash, css);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// packages/widget-dashboard/src/components/widget-header/widget-header.module.css
|
|
90
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
91
|
+
registerStyle("6bc1a11567", ".a7cf38a139398543__widgetHeader{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px)}._967cd798e5c37202__toolbar,.f41e4aad10324455__identity{align-items:center;display:flex;height:var(--wpds-dimension-size-lg,40px)}.f41e4aad10324455__identity{min-width:0}._53584a4927dfbcf1__icon{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:inline-flex}._917a5a960220d44f__popoverPopup{max-width:300px}.d6f136cf92858182__help{align-items:center;background:none;border:0;color:var(--wpds-color-foreground-content-neutral-weak,#707070);cursor:var(--wpds-cursor-control,pointer);display:inline-flex;padding:0}._9bdac6051677514a__link+._9bdac6051677514a__link{border-inline-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);padding-inline-start:var(--wpds-dimension-gap-sm,8px)}._967cd798e5c37202__toolbar{margin-inline-start:auto}.f32f2cd669c9b4b0__overlay{--wp-ui-card-padding:var(--wpds-dimension-padding-2xl,24px);inset-block-start:0;inset-inline:0;pointer-events:none;position:absolute;z-index:1}.f32f2cd669c9b4b0__overlay ._967cd798e5c37202__toolbar{pointer-events:auto}");
|
|
92
|
+
}
|
|
93
|
+
var widget_header_default = { "widgetHeader": "a7cf38a139398543__widgetHeader", "identity": "f41e4aad10324455__identity", "toolbar": "_967cd798e5c37202__toolbar", "icon": "_53584a4927dfbcf1__icon", "popoverPopup": "_917a5a960220d44f__popoverPopup", "help": "d6f136cf92858182__help", "link": "_9bdac6051677514a__link", "overlay": "f32f2cd669c9b4b0__overlay" };
|
|
94
|
+
|
|
95
|
+
// packages/widget-dashboard/src/components/widget-header/widget-header-infotip.tsx
|
|
96
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
97
|
+
function WidgetInfotip({
|
|
98
|
+
content,
|
|
99
|
+
links
|
|
100
|
+
}) {
|
|
101
|
+
return /* @__PURE__ */ jsxs(Popover.Root, { modal: "trap-focus", children: [
|
|
102
|
+
/* @__PURE__ */ jsx(
|
|
103
|
+
Popover.Trigger,
|
|
104
|
+
{
|
|
105
|
+
"aria-label": __("More information"),
|
|
106
|
+
className: widget_header_default.help,
|
|
107
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: info, size: 20 })
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ jsxs(
|
|
111
|
+
Popover.Popup,
|
|
112
|
+
{
|
|
113
|
+
className: widget_header_default.popoverPopup,
|
|
114
|
+
positioner: /* @__PURE__ */ jsx(Popover.Positioner, { side: "top", align: "start" }),
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsx(Popover.Arrow, {}),
|
|
117
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { render: /* @__PURE__ */ jsx(Popover.Title, {}), children: __("More information") }),
|
|
118
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "column", align: "start", gap: "sm", children: [
|
|
119
|
+
/* @__PURE__ */ jsx(Popover.Description, { children: createInterpolateElement(content, {
|
|
120
|
+
em: /* @__PURE__ */ jsx("em", {}),
|
|
121
|
+
strong: /* @__PURE__ */ jsx("strong", {})
|
|
122
|
+
}) }),
|
|
123
|
+
links && links.length > 0 && /* @__PURE__ */ jsx(Stack, { direction: "row", align: "start", gap: "sm", children: links.map((link) => /* @__PURE__ */ jsx(
|
|
124
|
+
Link,
|
|
125
|
+
{
|
|
126
|
+
href: link.href,
|
|
127
|
+
className: widget_header_default.link,
|
|
128
|
+
children: link.label
|
|
129
|
+
},
|
|
130
|
+
link.href
|
|
131
|
+
)) })
|
|
132
|
+
] })
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
] });
|
|
137
|
+
}
|
|
138
|
+
export {
|
|
139
|
+
WidgetInfotip
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=widget-header-infotip.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/widget-header/widget-header-infotip.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/widget-header/widget-header.module.css"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createInterpolateElement } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { info } from '@wordpress/icons';\n// eslint-disable-next-line @wordpress/use-recommended-components\nimport { Icon, Link, Popover, Stack, VisuallyHidden } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport styles from './widget-header.module.css';\n\nexport interface WidgetInfotipProps {\n\t/**\n\t * Help content to display; may carry `<em>`/`<strong>`.\n\t */\n\tcontent: string;\n\n\t/**\n\t * Links rendered after the content.\n\t */\n\tlinks?: {\n\t\tlabel: string;\n\t\thref: string;\n\t}[];\n}\n\n/**\n * Header infotip: a click-open popover holding the widget type's help note.\n *\n * @param {WidgetInfotipProps} props Component props.\n */\nexport function WidgetInfotip( {\n\tcontent,\n\tlinks,\n}: WidgetInfotipProps ): React.ReactNode {\n\treturn (\n\t\t<Popover.Root modal=\"trap-focus\">\n\t\t\t<Popover.Trigger\n\t\t\t\taria-label={ __( 'More information' ) }\n\t\t\t\tclassName={ styles.help }\n\t\t\t>\n\t\t\t\t<Icon icon={ info } size={ 20 } />\n\t\t\t</Popover.Trigger>\n\n\t\t\t<Popover.Popup\n\t\t\t\tclassName={ styles.popoverPopup }\n\t\t\t\tpositioner={ <Popover.Positioner side=\"top\" align=\"start\" /> }\n\t\t\t>\n\t\t\t\t<Popover.Arrow />\n\t\t\t\t<VisuallyHidden render={ <Popover.Title /> }>\n\t\t\t\t\t{ __( 'More information' ) }\n\t\t\t\t</VisuallyHidden>\n\n\t\t\t\t<Stack direction=\"column\" align=\"start\" gap=\"sm\">\n\t\t\t\t\t<Popover.Description>\n\t\t\t\t\t\t{ createInterpolateElement( content, {\n\t\t\t\t\t\t\tem: <em />,\n\t\t\t\t\t\t\tstrong: <strong />,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t</Popover.Description>\n\n\t\t\t\t\t{ links && links.length > 0 && (\n\t\t\t\t\t\t<Stack direction=\"row\" align=\"start\" gap=\"sm\">\n\t\t\t\t\t\t\t{ links.map( ( link ) => (\n\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\tkey={ link.href }\n\t\t\t\t\t\t\t\t\thref={ link.href }\n\t\t\t\t\t\t\t\t\tclassName={ styles.link }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ link.label }\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t) }\n\t\t\t\t</Stack>\n\t\t\t</Popover.Popup>\n\t\t</Popover.Root>\n\t);\n}\n", "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(\"6bc1a11567\", \".a7cf38a139398543__widgetHeader{align-items:center;display:flex;gap:var(--wpds-dimension-gap-sm,8px)}._967cd798e5c37202__toolbar,.f41e4aad10324455__identity{align-items:center;display:flex;height:var(--wpds-dimension-size-lg,40px)}.f41e4aad10324455__identity{min-width:0}._53584a4927dfbcf1__icon{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:inline-flex}._917a5a960220d44f__popoverPopup{max-width:300px}.d6f136cf92858182__help{align-items:center;background:none;border:0;color:var(--wpds-color-foreground-content-neutral-weak,#707070);cursor:var(--wpds-cursor-control,pointer);display:inline-flex;padding:0}._9bdac6051677514a__link+._9bdac6051677514a__link{border-inline-start:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);padding-inline-start:var(--wpds-dimension-gap-sm,8px)}._967cd798e5c37202__toolbar{margin-inline-start:auto}.f32f2cd669c9b4b0__overlay{--wp-ui-card-padding:var(--wpds-dimension-padding-2xl,24px);inset-block-start:0;inset-inline:0;pointer-events:none;position:absolute;z-index:1}.f32f2cd669c9b4b0__overlay ._967cd798e5c37202__toolbar{pointer-events:auto}\");\n}\nexport default {\"widgetHeader\":\"a7cf38a139398543__widgetHeader\",\"identity\":\"f41e4aad10324455__identity\",\"toolbar\":\"_967cd798e5c37202__toolbar\",\"icon\":\"_53584a4927dfbcf1__icon\",\"popoverPopup\":\"_917a5a960220d44f__popoverPopup\",\"help\":\"d6f136cf92858182__help\",\"link\":\"_9bdac6051677514a__link\",\"overlay\":\"f32f2cd669c9b4b0__overlay\"};\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,gCAAgC;AACzC,SAAS,UAAU;AACnB,SAAS,YAAY;AAErB,SAAS,MAAM,MAAM,SAAS,OAAO,sBAAsB;;;ACG3D,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACrB,QAAM,cAAc;AAEpB,MAAK,YAAY,kBAAmB;AACnC,WAAO,YAAY;AAAA,EACpB;AAEA,cAAY,mBAAmB;AAAA,IAC9B,WAAW,oBAAI,IAAI;AAAA,IACnB,QAAQ,oBAAI,IAAI;AAAA,IAChB,gBAAgB,oBAAI,QAAQ;AAAA,EAC7B;AAEA,MAAK,OAAO,aAAa,aAAc;AACtC,qBAAkB,QAAS;AAAA,EAC5B;AAEA,SAAO,YAAY;AACpB;AAUA,SAAS,0BACR,gBACA,MACU;AACV,MAAK,CAAE,eAAe,MAAO;AAC5B,WAAO;AAAA,EACR;AAEA,aAAY,SAAS,eAAe,KAAK;AAAA,IACxC,SAAU,oBAAqB;AAAA,EAChC,GAAI;A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