@wordpress/boot 0.20.0 → 0.21.2-next.v.202608281122.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 +38 -0
- package/README.md +4 -0
- package/build-module/components/app/router.mjs +100 -4
- package/build-module/components/app/router.mjs.map +3 -3
- package/build-module/components/canvas/index.mjs +72 -13
- package/build-module/components/canvas/index.mjs.map +2 -2
- package/build-module/components/canvas/site-preview.mjs +50 -0
- package/build-module/components/canvas/site-preview.mjs.map +7 -0
- package/build-module/components/canvas/use-navigate-to-entity-record.mjs +122 -0
- package/build-module/components/canvas/use-navigate-to-entity-record.mjs.map +7 -0
- package/build-module/components/canvas/viewport.mjs +18 -0
- package/build-module/components/canvas/viewport.mjs.map +7 -0
- package/build-module/components/error-boundary/index.mjs +129 -0
- package/build-module/components/error-boundary/index.mjs.map +7 -0
- package/build-module/components/navigation/drilldown-item/index.mjs +91 -1
- package/build-module/components/navigation/drilldown-item/index.mjs.map +3 -3
- package/build-module/components/navigation/dropdown-item/index.mjs +98 -11
- package/build-module/components/navigation/dropdown-item/index.mjs.map +4 -4
- package/build-module/components/navigation/index.mjs +0 -1
- package/build-module/components/navigation/index.mjs.map +2 -2
- package/build-module/components/navigation/navigation-item/index.mjs +88 -15
- package/build-module/components/navigation/navigation-item/index.mjs.map +3 -3
- package/build-module/components/navigation/navigation-screen/index.mjs +111 -38
- package/build-module/components/navigation/navigation-screen/index.mjs.map +3 -3
- package/build-module/components/plugin-area/index.mjs +29 -0
- package/build-module/components/plugin-area/index.mjs.map +7 -0
- package/build-module/components/root/index.mjs +220 -122
- package/build-module/components/root/index.mjs.map +3 -3
- package/build-module/components/root/single-page.mjs +139 -47
- package/build-module/components/root/single-page.mjs.map +3 -3
- package/build-module/components/root/use-sync-body-background.mjs.map +1 -1
- package/build-module/components/save-button/index.mjs +127 -16
- package/build-module/components/save-button/index.mjs.map +3 -3
- package/build-module/components/save-panel/index.mjs +91 -1
- package/build-module/components/save-panel/index.mjs.map +3 -3
- package/build-module/components/sidebar/index.mjs +90 -10
- package/build-module/components/sidebar/index.mjs.map +3 -3
- package/build-module/index.mjs +0 -16
- package/build-module/index.mjs.map +3 -3
- package/build-module/store/actions.mjs +8 -0
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/reducer.mjs +16 -1
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +9 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-types/components/app/router.d.ts.map +1 -1
- package/build-types/components/canvas/index.d.ts.map +1 -1
- package/build-types/components/canvas/site-preview.d.ts +10 -0
- package/build-types/components/canvas/site-preview.d.ts.map +1 -0
- package/build-types/components/canvas/use-navigate-to-entity-record.d.ts +40 -0
- package/build-types/components/canvas/use-navigate-to-entity-record.d.ts.map +1 -0
- package/build-types/components/canvas/viewport.d.ts +15 -0
- package/build-types/components/canvas/viewport.d.ts.map +1 -0
- package/build-types/components/error-boundary/index.d.ts +22 -0
- package/build-types/components/error-boundary/index.d.ts.map +1 -0
- package/build-types/components/navigation/drilldown-item/index.d.ts.map +1 -1
- package/build-types/components/navigation/dropdown-item/index.d.ts +0 -1
- package/build-types/components/navigation/dropdown-item/index.d.ts.map +1 -1
- package/build-types/components/navigation/index.d.ts.map +1 -1
- package/build-types/components/navigation/navigation-item/index.d.ts +0 -1
- package/build-types/components/navigation/navigation-item/index.d.ts.map +1 -1
- package/build-types/components/navigation/navigation-screen/index.d.ts +0 -1
- package/build-types/components/navigation/navigation-screen/index.d.ts.map +1 -1
- package/build-types/components/plugin-area/index.d.ts +12 -0
- package/build-types/components/plugin-area/index.d.ts.map +1 -0
- package/build-types/components/root/index.d.ts +0 -1
- package/build-types/components/root/index.d.ts.map +1 -1
- package/build-types/components/root/single-page.d.ts +0 -1
- package/build-types/components/root/single-page.d.ts.map +1 -1
- package/build-types/components/root/use-sync-body-background.d.ts +1 -1
- package/build-types/components/save-button/index.d.ts +0 -1
- package/build-types/components/save-button/index.d.ts.map +1 -1
- package/build-types/components/save-panel/index.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts +0 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/index.d.ts +0 -2
- package/build-types/index.d.ts.map +1 -1
- package/build-types/store/actions.d.ts +15 -2
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +12 -0
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/store/types.d.ts +34 -3
- package/build-types/store/types.d.ts.map +1 -1
- package/package.json +27 -25
- package/src/components/app/router.tsx +19 -7
- package/src/components/canvas/index.tsx +117 -15
- package/src/components/canvas/site-preview.tsx +64 -0
- package/src/components/canvas/use-navigate-to-entity-record.ts +220 -0
- package/src/components/canvas/viewport.ts +34 -0
- package/src/components/error-boundary/index.tsx +71 -0
- package/src/components/error-boundary/style.module.scss +13 -0
- package/src/components/navigation/drilldown-item/index.tsx +2 -1
- package/src/components/navigation/dropdown-item/index.tsx +10 -6
- package/src/components/navigation/dropdown-item/{style.scss → style.module.scss} +6 -2
- package/src/components/navigation/index.tsx +0 -1
- package/src/components/navigation/navigation-item/index.tsx +3 -6
- package/src/components/navigation/navigation-item/{style.scss → style.module.scss} +7 -14
- package/src/components/navigation/navigation-screen/index.tsx +6 -15
- package/src/components/navigation/navigation-screen/{style.scss → style.module.scss} +10 -9
- package/src/components/plugin-area/index.tsx +34 -0
- package/src/components/root/{style.scss → _layout.module.scss} +71 -40
- package/src/components/root/_view-transitions.module.scss +205 -0
- package/src/components/root/index.tsx +44 -24
- package/src/components/root/single-page.tsx +15 -7
- package/src/components/root/style.module.scss +2 -0
- package/src/components/root/use-sync-body-background.ts +1 -1
- package/src/components/save-button/index.tsx +36 -14
- package/src/components/save-button/style.module.scss +10 -0
- package/src/components/save-panel/index.tsx +2 -1
- package/src/components/save-panel/style.module.scss +7 -0
- package/src/components/sidebar/index.tsx +5 -5
- package/src/components/sidebar/style.module.scss +29 -0
- package/src/index.tsx +0 -2
- package/src/store/actions.ts +18 -1
- package/src/store/reducer.ts +19 -0
- package/src/store/selectors.ts +28 -0
- package/src/store/types.ts +37 -3
- package/build-style/style-rtl.css +0 -133
- package/build-style/style.css +0 -133
- package/build-style/view-transitions-rtl.css +0 -189
- package/build-style/view-transitions.css +0 -189
- package/src/components/save-button/style.scss +0 -9
- package/src/components/sidebar/style.scss +0 -23
- package/src/style.scss +0 -34
- package/src/view-transitions.scss +0 -221
|
@@ -4,6 +4,96 @@ import { Modal } from "@wordpress/components";
|
|
|
4
4
|
import { EntitiesSavedStates } from "@wordpress/editor";
|
|
5
5
|
import { __ } from "@wordpress/i18n";
|
|
6
6
|
import useSaveShortcut from "./use-save-shortcut.mjs";
|
|
7
|
+
|
|
8
|
+
// packages/style-runtime/src/index.ts
|
|
9
|
+
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
|
|
10
|
+
function getRuntime() {
|
|
11
|
+
const globalScope = globalThis;
|
|
12
|
+
if (globalScope.__wpStyleRuntime) {
|
|
13
|
+
return globalScope.__wpStyleRuntime;
|
|
14
|
+
}
|
|
15
|
+
globalScope.__wpStyleRuntime = {
|
|
16
|
+
documents: /* @__PURE__ */ new Map(),
|
|
17
|
+
styles: /* @__PURE__ */ new Map(),
|
|
18
|
+
injectedStyles: /* @__PURE__ */ new WeakMap()
|
|
19
|
+
};
|
|
20
|
+
if (typeof document !== "undefined") {
|
|
21
|
+
registerDocument(document);
|
|
22
|
+
}
|
|
23
|
+
return globalScope.__wpStyleRuntime;
|
|
24
|
+
}
|
|
25
|
+
function documentContainsStyleHash(targetDocument, hash) {
|
|
26
|
+
if (!targetDocument.head) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
for (const style of targetDocument.head.querySelectorAll(
|
|
30
|
+
`style[${STYLE_HASH_ATTRIBUTE}]`
|
|
31
|
+
)) {
|
|
32
|
+
if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
function injectStyle(targetDocument, hash, css) {
|
|
39
|
+
if (!targetDocument.head) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const runtime = getRuntime();
|
|
43
|
+
let injectedStyles = runtime.injectedStyles.get(targetDocument);
|
|
44
|
+
if (!injectedStyles) {
|
|
45
|
+
injectedStyles = /* @__PURE__ */ new Set();
|
|
46
|
+
runtime.injectedStyles.set(targetDocument, injectedStyles);
|
|
47
|
+
}
|
|
48
|
+
if (injectedStyles.has(hash)) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (documentContainsStyleHash(targetDocument, hash)) {
|
|
52
|
+
injectedStyles.add(hash);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const style = targetDocument.createElement("style");
|
|
56
|
+
style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
|
|
57
|
+
style.appendChild(targetDocument.createTextNode(css));
|
|
58
|
+
targetDocument.head.appendChild(style);
|
|
59
|
+
injectedStyles.add(hash);
|
|
60
|
+
}
|
|
61
|
+
function registerDocument(targetDocument) {
|
|
62
|
+
const runtime = getRuntime();
|
|
63
|
+
runtime.documents.set(
|
|
64
|
+
targetDocument,
|
|
65
|
+
(runtime.documents.get(targetDocument) ?? 0) + 1
|
|
66
|
+
);
|
|
67
|
+
for (const [hash, css] of runtime.styles) {
|
|
68
|
+
injectStyle(targetDocument, hash, css);
|
|
69
|
+
}
|
|
70
|
+
return () => {
|
|
71
|
+
const count = runtime.documents.get(targetDocument);
|
|
72
|
+
if (count === void 0) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (count <= 1) {
|
|
76
|
+
runtime.documents.delete(targetDocument);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
runtime.documents.set(targetDocument, count - 1);
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
function registerStyle(hash, css) {
|
|
83
|
+
const runtime = getRuntime();
|
|
84
|
+
runtime.styles.set(hash, css);
|
|
85
|
+
for (const targetDocument of runtime.documents.keys()) {
|
|
86
|
+
injectStyle(targetDocument, hash, css);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// packages/boot/src/components/save-panel/style.module.scss
|
|
91
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
92
|
+
registerStyle("df1a59bc40", "@media (min-width:600px){._77efcb9ca06f5774__modal{width:600px}}");
|
|
93
|
+
}
|
|
94
|
+
var style_module_default = { "modal": "_77efcb9ca06f5774__modal" };
|
|
95
|
+
|
|
96
|
+
// packages/boot/src/components/save-panel/index.tsx
|
|
7
97
|
import { jsx } from "react/jsx-runtime";
|
|
8
98
|
function SavePanel() {
|
|
9
99
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -16,7 +106,7 @@ function SavePanel() {
|
|
|
16
106
|
return /* @__PURE__ */ jsx(
|
|
17
107
|
Modal,
|
|
18
108
|
{
|
|
19
|
-
className:
|
|
109
|
+
className: style_module_default.modal,
|
|
20
110
|
onRequestClose: () => setIsOpen(false),
|
|
21
111
|
title: __("Review changes"),
|
|
22
112
|
size: "small",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/save-panel/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useState } from '@wordpress/element';\nimport { Modal } from '@wordpress/components';\nimport { EntitiesSavedStates } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport useSaveShortcut from './use-save-shortcut';\n\nexport default function SavePanel() {\n\tconst [ isOpen, setIsOpen ] = useState< boolean >( false );\n\tuseSaveShortcut( {\n\t\topenSavePanel: () => setIsOpen( true ),\n\t} );\n\tif ( ! isOpen ) {\n\t\treturn false;\n\t}\n\treturn (\n\t\t<Modal\n\t\t\tclassName
|
|
5
|
-
"mappings": ";AAAA,SAAS,gBAAgB;AACzB,SAAS,aAAa;AACtB,SAAS,2BAA2B;AACpC,SAAS,UAAU;AACnB,OAAO,qBAAqB;
|
|
3
|
+
"sources": ["../../../src/components/save-panel/index.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/save-panel/style.module.scss"],
|
|
4
|
+
"sourcesContent": ["import { useState } from '@wordpress/element';\nimport { Modal } from '@wordpress/components';\nimport { EntitiesSavedStates } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport useSaveShortcut from './use-save-shortcut';\nimport styles from './style.module.scss';\n\nexport default function SavePanel() {\n\tconst [ isOpen, setIsOpen ] = useState< boolean >( false );\n\tuseSaveShortcut( {\n\t\topenSavePanel: () => setIsOpen( true ),\n\t} );\n\tif ( ! isOpen ) {\n\t\treturn false;\n\t}\n\treturn (\n\t\t<Modal\n\t\t\tclassName={ styles.modal }\n\t\t\tonRequestClose={ () => setIsOpen( false ) }\n\t\t\ttitle={ __( 'Review changes' ) }\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<EntitiesSavedStates\n\t\t\t\tclose={ () => setIsOpen( false ) }\n\t\t\t\tvariant=\"inline\"\n\t\t\t/>\n\t\t</Modal>\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(\"df1a59bc40\", \"@media (min-width:600px){._77efcb9ca06f5774__modal{width:600px}}\");\n}\nexport default {\"modal\":\"_77efcb9ca06f5774__modal\"};\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,gBAAgB;AACzB,SAAS,aAAa;AACtB,SAAS,2BAA2B;AACpC,SAA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AAA,EACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -7,13 +7,93 @@ import Navigation from "../navigation/index.mjs";
|
|
|
7
7
|
import SaveButton from "../save-button/index.mjs";
|
|
8
8
|
import { store as bootStore } from "../../store/index.mjs";
|
|
9
9
|
|
|
10
|
-
// packages/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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;
|
|
16
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/boot/src/components/sidebar/style.module.scss
|
|
93
|
+
if (typeof process === "undefined" || process.env.NODE_ENV !== "test") {
|
|
94
|
+
registerStyle("2f8ba86269", "._52f77809bed01e5e__scrollable{display:flex;flex-direction:column;height:100%;overflow:auto;position:relative}._6d2e23af506664fb__content{contain:content;flex-grow:1;position:relative}.c95a8ac9c6876d6e__footer{padding-block-end:8px;padding-block-start:16px;padding-inline-end:8px;padding-inline-start:16px}._28ec24681975e557__back-button{margin-block-end:8px;margin-block-start:16px;margin-inline-end:12px;margin-inline-start:12px}");
|
|
95
|
+
}
|
|
96
|
+
var style_module_default = { "scrollable": "_52f77809bed01e5e__scrollable", "content": "_6d2e23af506664fb__content", "footer": "c95a8ac9c6876d6e__footer", "back-button": "_28ec24681975e557__back-button" };
|
|
17
97
|
|
|
18
98
|
// packages/boot/src/components/sidebar/index.tsx
|
|
19
99
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -26,7 +106,7 @@ function DashboardBackButton() {
|
|
|
26
106
|
Button,
|
|
27
107
|
{
|
|
28
108
|
__next40pxDefaultSize: true,
|
|
29
|
-
className: "
|
|
109
|
+
className: style_module_default["back-button"],
|
|
30
110
|
href: dashboardLink || "/",
|
|
31
111
|
icon: isRTL() ? chevronRight : chevronLeft,
|
|
32
112
|
label: __("Go to the Dashboard"),
|
|
@@ -35,10 +115,10 @@ function DashboardBackButton() {
|
|
|
35
115
|
);
|
|
36
116
|
}
|
|
37
117
|
function Sidebar() {
|
|
38
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
118
|
+
return /* @__PURE__ */ jsxs("div", { className: style_module_default.scrollable, children: [
|
|
39
119
|
/* @__PURE__ */ jsx(DashboardBackButton, {}),
|
|
40
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
41
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
120
|
+
/* @__PURE__ */ jsx("div", { className: style_module_default.content, children: /* @__PURE__ */ jsx(Navigation, {}) }),
|
|
121
|
+
/* @__PURE__ */ jsx("div", { className: style_module_default.footer, children: /* @__PURE__ */ jsx(SaveButton, {}) })
|
|
42
122
|
] });
|
|
43
123
|
}
|
|
44
124
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/sidebar/index.tsx", "../../../src/components/sidebar/style.scss"],
|
|
4
|
-
"sourcesContent": ["import { Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight } from '@wordpress/icons';\nimport Navigation from '../navigation';\nimport SaveButton from '../save-button';\nimport { store as bootStore } from '../../store';\nimport './style.scss';\n\nfunction DashboardBackButton() {\n\tconst dashboardLink = useSelect(\n\t\t( select ) => select( bootStore ).getDashboardLink(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName
|
|
5
|
-
"mappings": ";AAAA,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,IAAI,aAAa;AAC1B,SAAS,aAAa,oBAAoB;AAC1C,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AACvB,SAAS,SAAS,iBAAiB;;;
|
|
3
|
+
"sources": ["../../../src/components/sidebar/index.tsx", "../../../../style-runtime/src/index.ts", "../../../src/components/sidebar/style.module.scss"],
|
|
4
|
+
"sourcesContent": ["import { Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { chevronLeft, chevronRight } from '@wordpress/icons';\nimport Navigation from '../navigation';\nimport SaveButton from '../save-button';\nimport { store as bootStore } from '../../store';\nimport styles from './style.module.scss';\n\nfunction DashboardBackButton() {\n\tconst dashboardLink = useSelect(\n\t\t( select ) => select( bootStore ).getDashboardLink(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName={ styles[ 'back-button' ] }\n\t\t\thref={ dashboardLink || '/' }\n\t\t\ticon={ isRTL() ? chevronRight : chevronLeft }\n\t\t\tlabel={ __( 'Go to the Dashboard' ) }\n\t\t>\n\t\t\t{ __( 'Dashboard' ) }\n\t\t</Button>\n\t);\n}\n\nexport default function Sidebar() {\n\treturn (\n\t\t<div className={ styles.scrollable }>\n\t\t\t<DashboardBackButton />\n\t\t\t<div className={ styles.content }>\n\t\t\t\t<Navigation />\n\t\t\t</div>\n\t\t\t<div className={ styles.footer }>\n\t\t\t\t<SaveButton />\n\t\t\t</div>\n\t\t</div>\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(\"2f8ba86269\", \"._52f77809bed01e5e__scrollable{display:flex;flex-direction:column;height:100%;overflow:auto;position:relative}._6d2e23af506664fb__content{contain:content;flex-grow:1;position:relative}.c95a8ac9c6876d6e__footer{padding-block-end:8px;padding-block-start:16px;padding-inline-end:8px;padding-inline-start:16px}._28ec24681975e557__back-button{margin-block-end:8px;margin-block-start:16px;margin-inline-end:12px;margin-inline-start:12px}\");\n}\nexport default {\"scrollable\":\"_52f77809bed01e5e__scrollable\",\"content\":\"_6d2e23af506664fb__content\",\"footer\":\"c95a8ac9c6876d6e__footer\",\"back-button\":\"_28ec24681975e557__back-button\"};\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,IAAI,aAAa;AAC1B,SAAS,aAAa,oBAAoB;AAC1C,OAAO,gBAAgB;AACvB,OAAO,gBAAgB;AACvB,SAAS,SAAS,iBAAiB;;;ACInC,IAAM,uBAAuB;AAU7B,SAAS,aAAa;AACrB,QAAM,cA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vB,8BAAC,cAAW,GACb;AAAA,IACA,oBAAC,SAAI,WAAY,qBAAO,QACvB,8BAAC,cAAW,GACb;AAAA,KACD;AAEF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build-module/index.mjs
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
// packages/boot/src/style.scss
|
|
2
|
-
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='5c714da7f2']")) {
|
|
3
|
-
const style = document.createElement("style");
|
|
4
|
-
style.setAttribute("data-wp-hash", "5c714da7f2");
|
|
5
|
-
style.appendChild(document.createTextNode("@media (min-width:600px){.boot-layout-container .boot-layout{bottom:0;left:0;min-height:calc(100vh - 46px);position:absolute;right:0;top:0}}@media (min-width:782px){.boot-layout-container .boot-layout{min-height:calc(100vh - 32px)}body:has(.boot-layout.has-full-canvas) .boot-layout-container .boot-layout{min-height:100vh}}:where(.boot-layout) img{height:auto;max-width:100%}.boot-layout .boot-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}.boot-layout .boot-notices__snackbar .components-snackbar{margin-inline:auto}"));
|
|
6
|
-
document.head.appendChild(style);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// packages/boot/src/view-transitions.scss
|
|
10
|
-
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='28f077581a']")) {
|
|
11
|
-
const style = document.createElement("style");
|
|
12
|
-
style.setAttribute("data-wp-hash", "28f077581a");
|
|
13
|
-
style.appendChild(document.createTextNode("@media (max-width:782px){*{view-transition-name:none!important}}::view-transition-new(root),::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){.boot-layout__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.boot-layout__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.boot-layout__stage{view-transition-name:boot--stage}.boot-layout__inspector{view-transition-name:boot--inspector}.boot-layout__canvas.is-full-canvas .interface-interface-skeleton__content,.boot-layout__canvas:not(.is-full-canvas){view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.boot-layout__stage{view-transition-name:boot-safari--stage}.boot-layout__inspector{view-transition-name:boot-safari--inspector}.boot-layout__canvas.is-full-canvas .interface-interface-skeleton__content,.boot-layout__canvas:not(.is-full-canvas){view-transition-name:boot-safari--canvas}}.components-popover:first-of-type{view-transition-name:boot--components-popover}}::view-transition-group(boot--canvas),::view-transition-group(boot--canvas-header),::view-transition-group(boot--canvas-sidebar),::view-transition-group(boot-safari--canvas){z-index:1}::view-transition-new(boot-safari--canvas),::view-transition-new(boot-safari--inspector),::view-transition-new(boot-safari--stage),::view-transition-old(boot-safari--canvas),::view-transition-old(boot-safari--inspector),::view-transition-old(boot-safari--stage){width:auto}::view-transition-new(boot--canvas),::view-transition-new(boot--inspector),::view-transition-new(boot--stage),::view-transition-old(boot--canvas),::view-transition-old(boot--inspector),::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%}::view-transition-new(boot--canvas),::view-transition-old(boot--canvas){object-position:center top}::view-transition-old(boot--inspector):only-child,::view-transition-old(boot--stage):only-child,::view-transition-old(boot-safari--inspector):only-child,::view-transition-old(boot-safari--stage):only-child{animation-name:zoomOut;will-change:transform,opacity}::view-transition-new(boot--inspector):only-child,::view-transition-new(boot--stage):only-child,::view-transition-new(boot-safari--inspector):only-child,::view-transition-new(boot-safari--stage):only-child{animation-name:zoomIn;will-change:transform,opacity}@keyframes zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}::view-transition-new(boot--canvas):only-child,::view-transition-new(boot-safari--canvas):only-child{animation-name:slideFromRight;will-change:transform}::view-transition-old(boot--canvas):only-child,::view-transition-old(boot-safari--canvas):only-child{animation-name:slideToRight;will-change:transform}@keyframes slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}::view-transition-new(boot--canvas-header):only-child{animation-name:slideHeaderFromTop;will-change:transform}::view-transition-old(boot--canvas-header):only-child{animation-name:slideHeaderToTop;will-change:transform}@keyframes slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes slideHeaderToTop{to{transform:translateY(-100%)}}::view-transition-new(boot--canvas-sidebar):only-child{animation-name:slideSidebarFromRight;will-change:transform}::view-transition-old(boot--canvas-sidebar):only-child{animation-name:slideSidebarToRight;will-change:transform}@keyframes slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes slideSidebarToRight{to{transform:translateX(100%)}}"));
|
|
14
|
-
document.head.appendChild(style);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
1
|
// packages/boot/src/index.tsx
|
|
18
2
|
import { init, initSinglePage } from "./components/app/index.mjs";
|
|
19
3
|
import { store } from "./store/index.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";AAAA,
|
|
3
|
+
"sources": ["../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["export { init, initSinglePage } from './components/app';\nexport { store } from './store';\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,MAAM,sBAAsB;AACrC,SAAS,aAAa;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -19,6 +19,13 @@ function registerRoute(route) {
|
|
|
19
19
|
route
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
+
function registerEntityLinks(postType, links) {
|
|
23
|
+
return {
|
|
24
|
+
type: "REGISTER_ENTITY_LINKS",
|
|
25
|
+
postType,
|
|
26
|
+
links
|
|
27
|
+
};
|
|
28
|
+
}
|
|
22
29
|
function setDashboardLink(dashboardLink) {
|
|
23
30
|
return {
|
|
24
31
|
type: "SET_DASHBOARD_LINK",
|
|
@@ -26,6 +33,7 @@ function setDashboardLink(dashboardLink) {
|
|
|
26
33
|
};
|
|
27
34
|
}
|
|
28
35
|
export {
|
|
36
|
+
registerEntityLinks,
|
|
29
37
|
registerMenuItem,
|
|
30
38
|
registerRoute,
|
|
31
39
|
setDashboardLink,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/actions.ts"],
|
|
4
|
-
"sourcesContent": ["import type { MenuItem, Route } from './types';\n\nexport function registerMenuItem( id: string, menuItem: MenuItem ) {\n\treturn {\n\t\ttype: 'REGISTER_MENU_ITEM' as const,\n\t\tid,\n\t\tmenuItem,\n\t};\n}\n\nexport function updateMenuItem( id: string, updates: Partial< MenuItem > ) {\n\treturn {\n\t\ttype: 'UPDATE_MENU_ITEM' as const,\n\t\tid,\n\t\tupdates,\n\t};\n}\n\nexport function registerRoute( route: Route ) {\n\treturn {\n\t\ttype: 'REGISTER_ROUTE' as const,\n\t\troute,\n\t};\n}\n\nexport function setDashboardLink( dashboardLink: string ) {\n\treturn {\n\t\ttype: 'SET_DASHBOARD_LINK' as const,\n\t\tdashboardLink,\n\t};\n}\n\nexport type Action =\n\t| ReturnType< typeof registerMenuItem >\n\t| ReturnType< typeof updateMenuItem >\n\t| ReturnType< typeof registerRoute >\n\t| ReturnType< typeof setDashboardLink >;\n"],
|
|
5
|
-
"mappings": ";AAEO,SAAS,iBAAkB,IAAY,UAAqB;AAClE,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,eAAgB,IAAY,SAA+B;AAC1E,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,cAAe,OAAe;AAC7C,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;AAEO,SAAS,iBAAkB,eAAwB;AACzD,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;",
|
|
4
|
+
"sourcesContent": ["import type { EntityLinks, MenuItem, Route } from './types';\n\nexport function registerMenuItem( id: string, menuItem: MenuItem ) {\n\treturn {\n\t\ttype: 'REGISTER_MENU_ITEM' as const,\n\t\tid,\n\t\tmenuItem,\n\t};\n}\n\nexport function updateMenuItem( id: string, updates: Partial< MenuItem > ) {\n\treturn {\n\t\ttype: 'UPDATE_MENU_ITEM' as const,\n\t\tid,\n\t\tupdates,\n\t};\n}\n\nexport function registerRoute( route: Route ) {\n\treturn {\n\t\ttype: 'REGISTER_ROUTE' as const,\n\t\troute,\n\t};\n}\n\n/**\n * Registers where entities of a post type are listed and edited.\n *\n * Register `default` to cover post types with no entry of their own.\n *\n * @param postType Post type the links belong to, or `default`.\n * @param links Paths to list and edit an entity of that post type.\n */\nexport function registerEntityLinks( postType: string, links: EntityLinks ) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_LINKS' as const,\n\t\tpostType,\n\t\tlinks,\n\t};\n}\n\nexport function setDashboardLink( dashboardLink: string ) {\n\treturn {\n\t\ttype: 'SET_DASHBOARD_LINK' as const,\n\t\tdashboardLink,\n\t};\n}\n\nexport type Action =\n\t| ReturnType< typeof registerMenuItem >\n\t| ReturnType< typeof updateMenuItem >\n\t| ReturnType< typeof registerRoute >\n\t| ReturnType< typeof registerEntityLinks >\n\t| ReturnType< typeof setDashboardLink >;\n"],
|
|
5
|
+
"mappings": ";AAEO,SAAS,iBAAkB,IAAY,UAAqB;AAClE,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,eAAgB,IAAY,SAA+B;AAC1E,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,cAAe,OAAe;AAC7C,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;AAUO,SAAS,oBAAqB,UAAkB,OAAqB;AAC3E,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;AAEO,SAAS,iBAAkB,eAAwB;AACzD,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
var initialState = {
|
|
3
3
|
menuItems: {},
|
|
4
4
|
routes: [],
|
|
5
|
-
dashboardLink: void 0
|
|
5
|
+
dashboardLink: void 0,
|
|
6
|
+
entityLinks: {}
|
|
6
7
|
};
|
|
7
8
|
function reducer(state = initialState, action) {
|
|
8
9
|
switch (action.type) {
|
|
@@ -15,6 +16,9 @@ function reducer(state = initialState, action) {
|
|
|
15
16
|
}
|
|
16
17
|
};
|
|
17
18
|
case "UPDATE_MENU_ITEM":
|
|
19
|
+
if (!state.menuItems[action.id]) {
|
|
20
|
+
return state;
|
|
21
|
+
}
|
|
18
22
|
return {
|
|
19
23
|
...state,
|
|
20
24
|
menuItems: {
|
|
@@ -30,6 +34,17 @@ function reducer(state = initialState, action) {
|
|
|
30
34
|
...state,
|
|
31
35
|
routes: [...state.routes, action.route]
|
|
32
36
|
};
|
|
37
|
+
case "REGISTER_ENTITY_LINKS":
|
|
38
|
+
return {
|
|
39
|
+
...state,
|
|
40
|
+
entityLinks: {
|
|
41
|
+
...state.entityLinks,
|
|
42
|
+
[action.postType]: {
|
|
43
|
+
...state.entityLinks[action.postType],
|
|
44
|
+
...action.links
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
33
48
|
case "SET_DASHBOARD_LINK":
|
|
34
49
|
return {
|
|
35
50
|
...state,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/reducer.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Action } from './actions';\nimport type { State } from './types';\n\nconst initialState: State = {\n\tmenuItems: {},\n\troutes: [],\n\tdashboardLink: undefined,\n};\n\nexport function reducer( state: State = initialState, action: Action ): State {\n\tswitch ( action.type ) {\n\t\tcase 'REGISTER_MENU_ITEM':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenuItems: {\n\t\t\t\t\t...state.menuItems,\n\t\t\t\t\t[ action.id ]: action.menuItem,\n\t\t\t\t},\n\t\t\t};\n\n\t\tcase 'UPDATE_MENU_ITEM':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenuItems: {\n\t\t\t\t\t...state.menuItems,\n\t\t\t\t\t[ action.id ]: {\n\t\t\t\t\t\t...state.menuItems[ action.id ],\n\t\t\t\t\t\t...action.updates,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\n\t\tcase 'REGISTER_ROUTE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\troutes: [ ...state.routes, action.route ],\n\t\t\t};\n\n\t\tcase 'SET_DASHBOARD_LINK':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tdashboardLink: action.dashboardLink,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,IAAM,eAAsB;AAAA,EAC3B,WAAW,CAAC;AAAA,EACZ,QAAQ,CAAC;AAAA,EACT,eAAe;
|
|
4
|
+
"sourcesContent": ["import type { Action } from './actions';\nimport type { State } from './types';\n\nconst initialState: State = {\n\tmenuItems: {},\n\troutes: [],\n\tdashboardLink: undefined,\n\tentityLinks: {},\n};\n\nexport function reducer( state: State = initialState, action: Action ): State {\n\tswitch ( action.type ) {\n\t\tcase 'REGISTER_MENU_ITEM':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenuItems: {\n\t\t\t\t\t...state.menuItems,\n\t\t\t\t\t[ action.id ]: action.menuItem,\n\t\t\t\t},\n\t\t\t};\n\n\t\tcase 'UPDATE_MENU_ITEM':\n\t\t\t// Updating an item that was never registered would add a partial\n\t\t\t// entry to the menu, which renders as an empty navigation row.\n\t\t\tif ( ! state.menuItems[ action.id ] ) {\n\t\t\t\treturn state;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tmenuItems: {\n\t\t\t\t\t...state.menuItems,\n\t\t\t\t\t[ action.id ]: {\n\t\t\t\t\t\t...state.menuItems[ action.id ],\n\t\t\t\t\t\t...action.updates,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\n\t\tcase 'REGISTER_ROUTE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\troutes: [ ...state.routes, action.route ],\n\t\t\t};\n\n\t\tcase 'REGISTER_ENTITY_LINKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tentityLinks: {\n\t\t\t\t\t...state.entityLinks,\n\t\t\t\t\t[ action.postType ]: {\n\t\t\t\t\t\t...state.entityLinks[ action.postType ],\n\t\t\t\t\t\t...action.links,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\n\t\tcase 'SET_DASHBOARD_LINK':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tdashboardLink: action.dashboardLink,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n"],
|
|
5
|
+
"mappings": ";AAGA,IAAM,eAAsB;AAAA,EAC3B,WAAW,CAAC;AAAA,EACZ,QAAQ,CAAC;AAAA,EACT,eAAe;AAAA,EACf,aAAa,CAAC;AACf;AAEO,SAAS,QAAS,QAAe,cAAc,QAAwB;AAC7E,UAAS,OAAO,MAAO;AAAA,IACtB,KAAK;AACJ,aAAO;AAAA,QACN,GAAG;AAAA,QACH,WAAW;AAAA,UACV,GAAG,MAAM;AAAA,UACT,CAAE,OAAO,EAAG,GAAG,OAAO;AAAA,QACvB;AAAA,MACD;AAAA,IAED,KAAK;AAGJ,UAAK,CAAE,MAAM,UAAW,OAAO,EAAG,GAAI;AACrC,eAAO;AAAA,MACR;AAEA,aAAO;AAAA,QACN,GAAG;AAAA,QACH,WAAW;AAAA,UACV,GAAG,MAAM;AAAA,UACT,CAAE,OAAO,EAAG,GAAG;AAAA,YACd,GAAG,MAAM,UAAW,OAAO,EAAG;AAAA,YAC9B,GAAG,OAAO;AAAA,UACX;AAAA,QACD;AAAA,MACD;AAAA,IAED,KAAK;AACJ,aAAO;AAAA,QACN,GAAG;AAAA,QACH,QAAQ,CAAE,GAAG,MAAM,QAAQ,OAAO,KAAM;AAAA,MACzC;AAAA,IAED,KAAK;AACJ,aAAO;AAAA,QACN,GAAG;AAAA,QACH,aAAa;AAAA,UACZ,GAAG,MAAM;AAAA,UACT,CAAE,OAAO,QAAS,GAAG;AAAA,YACpB,GAAG,MAAM,YAAa,OAAO,QAAS;AAAA,YACtC,GAAG,OAAO;AAAA,UACX;AAAA,QACD;AAAA,MACD;AAAA,IAED,KAAK;AACJ,aAAO;AAAA,QACN,GAAG;AAAA,QACH,eAAe,OAAO;AAAA,MACvB;AAAA,EACF;AAEA,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,8 +8,17 @@ function getRoutes(state) {
|
|
|
8
8
|
function getDashboardLink(state) {
|
|
9
9
|
return state.dashboardLink;
|
|
10
10
|
}
|
|
11
|
+
function getEntityLink(state, postType, postId) {
|
|
12
|
+
const links = state.entityLinks[postType] ?? state.entityLinks.default;
|
|
13
|
+
const path = postId === void 0 ? links?.list : links?.edit;
|
|
14
|
+
if (!path) {
|
|
15
|
+
return void 0;
|
|
16
|
+
}
|
|
17
|
+
return path.replace("{type}", encodeURIComponent(postType)).replace("{id}", encodeURIComponent(postId ?? ""));
|
|
18
|
+
}
|
|
11
19
|
export {
|
|
12
20
|
getDashboardLink,
|
|
21
|
+
getEntityLink,
|
|
13
22
|
getMenuItems,
|
|
14
23
|
getRoutes
|
|
15
24
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/selectors.ts"],
|
|
4
|
-
"sourcesContent": ["import type { State } from './types';\n\nexport function getMenuItems( state: State ) {\n\treturn Object.values( state.menuItems );\n}\n\nexport function getRoutes( state: State ) {\n\treturn state.routes;\n}\n\nexport function getDashboardLink( state: State ) {\n\treturn state.dashboardLink;\n}\n"],
|
|
5
|
-
"mappings": ";AAEO,SAAS,aAAc,OAAe;AAC5C,SAAO,OAAO,OAAQ,MAAM,SAAU;AACvC;AAEO,SAAS,UAAW,OAAe;AACzC,SAAO,MAAM;AACd;AAEO,SAAS,iBAAkB,OAAe;AAChD,SAAO,MAAM;AACd;",
|
|
4
|
+
"sourcesContent": ["import type { State } from './types';\n\nexport function getMenuItems( state: State ) {\n\treturn Object.values( state.menuItems );\n}\n\nexport function getRoutes( state: State ) {\n\treturn state.routes;\n}\n\nexport function getDashboardLink( state: State ) {\n\treturn state.dashboardLink;\n}\n\n/**\n * Returns the path an entity is edited or listed at.\n *\n * Falls back to the links registered for `default`, so a post type with no\n * entry of its own still resolves.\n *\n * @param state Store state.\n * @param postType Post type to resolve for.\n * @param postId Entity to edit. Omit for the list of the post type.\n * @return The path, or undefined when nothing is registered for it.\n */\nexport function getEntityLink(\n\tstate: State,\n\tpostType: string,\n\tpostId?: string | number\n) {\n\tconst links = state.entityLinks[ postType ] ?? state.entityLinks.default;\n\tconst path = postId === undefined ? links?.list : links?.edit;\n\n\tif ( ! path ) {\n\t\treturn undefined;\n\t}\n\n\treturn path\n\t\t.replace( '{type}', encodeURIComponent( postType ) )\n\t\t.replace( '{id}', encodeURIComponent( postId ?? '' ) );\n}\n"],
|
|
5
|
+
"mappings": ";AAEO,SAAS,aAAc,OAAe;AAC5C,SAAO,OAAO,OAAQ,MAAM,SAAU;AACvC;AAEO,SAAS,UAAW,OAAe;AACzC,SAAO,MAAM;AACd;AAEO,SAAS,iBAAkB,OAAe;AAChD,SAAO,MAAM;AACd;AAaO,SAAS,cACf,OACA,UACA,QACC;AACD,QAAM,QAAQ,MAAM,YAAa,QAAS,KAAK,MAAM,YAAY;AACjE,QAAM,OAAO,WAAW,SAAY,OAAO,OAAO,OAAO;AAEzD,MAAK,CAAE,MAAO;AACb,WAAO;AAAA,EACR;AAEA,SAAO,KACL,QAAS,UAAU,mBAAoB,QAAS,CAAE,EAClD,QAAS,QAAQ,mBAAoB,UAAU,EAAG,CAAE;AACvD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/components/app/router.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/components/app/router.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAa3C,OAAO,KAAK,EAAE,KAAK,EAAmC,MAAM,mBAAmB,CAAC;AAsLhF,UAAU,WAAW;IACpB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,aAAa,CAAC,EAAE,aAAa,CAAC;CAC9B;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAE,EAC/B,MAAM,EACN,aAAoB,GACpB,EAAE,WAAW,+BAiCb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/canvas/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/canvas/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAQpD,UAAU,WAAW;IACpB,MAAM,EAAE,UAAU,CAAC;CACnB;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAE,EAAE,MAAM,EAAE,EAAE,WAAW,+BAgLtD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders the site's front end in an iframe.
|
|
3
|
+
*
|
|
4
|
+
* Shown where the canvas has no entity to edit, so that a route still says
|
|
5
|
+
* something about the site it is configuring.
|
|
6
|
+
*
|
|
7
|
+
* @return The preview, or nothing until the site's address is known.
|
|
8
|
+
*/
|
|
9
|
+
export default function SitePreview(): import("react").JSX.Element | null;
|
|
10
|
+
//# sourceMappingURL=site-preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-preview.d.ts","sourceRoot":"","sources":["../../../src/components/canvas/site-preview.tsx"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,uCAiDlC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
interface NavigateParams {
|
|
2
|
+
postType: string;
|
|
3
|
+
postId: string;
|
|
4
|
+
viewport?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Builds the editor's entity navigation callbacks.
|
|
8
|
+
*
|
|
9
|
+
* The editor uses these to move between an entity and one nested inside it —
|
|
10
|
+
* a template part or a synced pattern reached from the block inspector. They
|
|
11
|
+
* are passed through the editor settings, where `onNavigateToEntityRecord`
|
|
12
|
+
* gates the inspector's edit affordance and `onNavigateToPreviousEntityRecord`
|
|
13
|
+
* gates the document bar's back button.
|
|
14
|
+
*
|
|
15
|
+
* @return The two callbacks, for spreading into the editor settings.
|
|
16
|
+
*/
|
|
17
|
+
export default function useNavigateToEntityRecord(): {
|
|
18
|
+
onNavigateToEntityRecord: (params: NavigateParams) => void;
|
|
19
|
+
onNavigateToPreviousEntityRecord: (() => any) | undefined;
|
|
20
|
+
};
|
|
21
|
+
interface ActionItem {
|
|
22
|
+
id: string | number;
|
|
23
|
+
type: string;
|
|
24
|
+
title?: string | {
|
|
25
|
+
rendered?: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Builds the callback the editor runs after a post action.
|
|
30
|
+
*
|
|
31
|
+
* Actions taken from inside the editor act on the entity being edited, so
|
|
32
|
+
* trashing or deleting one leaves the canvas showing something that is no
|
|
33
|
+
* longer there, and duplicating one gives no way to reach the copy.
|
|
34
|
+
*
|
|
35
|
+
* @param postType Post type rendered in the canvas.
|
|
36
|
+
* @return The callback, for passing to the editor.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useActionPerformed(postType?: string): (actionId: string, items: ActionItem[]) => void;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=use-navigate-to-entity-record.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-navigate-to-entity-record.d.ts","sourceRoot":"","sources":["../../../src/components/canvas/use-navigate-to-entity-record.ts"],"names":[],"mappings":"AA+BA,UAAU,cAAc;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,UAAU,yBAAyB;uCAYrC,cAAc;;EA+EzB;AAED,UAAU,UAAU;IACnB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACvC;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAE,QAAQ,CAAC,EAAE,MAAM,cASvC,MAAM,SAAS,UAAU,EAAE,UAqDxC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a viewport is one an entity can be asked to be edited at.
|
|
3
|
+
*
|
|
4
|
+
* @param viewport Viewport, as written in the URL.
|
|
5
|
+
* @return Whether the editor has a width for it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isValidViewport(viewport?: string): viewport is string;
|
|
8
|
+
/**
|
|
9
|
+
* The device type a `viewport` search param names.
|
|
10
|
+
*
|
|
11
|
+
* @param viewport Viewport, as written in the URL.
|
|
12
|
+
* @return Device type, Desktop for a viewport the editor has no width for.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getDeviceType(viewport?: string): string;
|
|
15
|
+
//# sourceMappingURL=viewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../../../src/components/canvas/viewport.ts"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAE,QAAQ,CAAC,EAAE,MAAM,GAAI,QAAQ,IAAI,MAAM,CAEvE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAE,QAAQ,CAAC,EAAE,MAAM,UAO/C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { Component } from '@wordpress/element';
|
|
3
|
+
interface Props {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
interface State {
|
|
7
|
+
error: Error | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Contains a failure to one surface, so a screen keeps working around it.
|
|
11
|
+
*
|
|
12
|
+
* Wrapping each surface separately means a stage that throws leaves the
|
|
13
|
+
* navigation, the canvas and the way to save reachable, rather than taking the
|
|
14
|
+
* whole screen down with it.
|
|
15
|
+
*/
|
|
16
|
+
export default class ErrorBoundary extends Component<Props, State> {
|
|
17
|
+
constructor(props: Props);
|
|
18
|
+
static getDerivedStateFromError(error: Error): State;
|
|
19
|
+
render(): string | number | boolean | import("react").JSX.Element | Iterable<ReactNode> | null | undefined;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/error-boundary/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAQ/C,UAAU,KAAK;IACd,QAAQ,EAAE,SAAS,CAAC;CACpB;AAED,UAAU,KAAK;IACd,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACpB;AAYD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,SAAS,CAAE,KAAK,EAAE,KAAK,CAAE;IACnE,YAAa,KAAK,EAAE,KAAK,EAGxB;IAED,MAAM,CAAC,wBAAwB,CAAE,KAAK,EAAE,KAAK,GAAI,KAAK,CAErD;IAED,MAAM,qGAyBL;CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/drilldown-item/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/drilldown-item/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGrD,UAAU,kBAAkB;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,UAAU,EAAE,CAAE,EACb,EAAE,EACF,SAAS,GACT,EAAE;QACF,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;KAClC,KAAM,IAAI,CAAC;CACZ;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAE,EACtC,SAAS,EACT,EAAE,EACF,IAAI,EACJ,qBAA4B,EAC5B,QAAQ,EACR,UAAU,GACV,EAAE,kBAAkB,+BAwBpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/dropdown-item/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAevC,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/dropdown-item/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAevC,OAAO,KAAK,EAAE,QAAQ,EAAY,MAAM,sBAAsB,CAAC;AAM/D,UAAU,iBAAiB;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAE,EACrC,SAAS,EACT,EAAE,EACF,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,QAAQ,GACR,EAAE,iBAAiB,+BAiEnB"}
|