@wordpress/boot 0.17.0 → 0.18.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 +7 -0
- package/build-module/components/canvas/back-button.mjs +9 -67
- package/build-module/components/canvas/back-button.mjs.map +3 -3
- package/build-module/components/navigation/navigation-item/index.mjs +3 -3
- package/build-module/components/navigation/navigation-item/index.mjs.map +2 -2
- package/build-module/components/root/index.mjs +6 -3
- package/build-module/components/root/index.mjs.map +2 -2
- package/build-module/components/root/single-page.mjs +6 -3
- package/build-module/components/root/single-page.mjs.map +2 -2
- package/build-module/components/root/use-sync-body-background.mjs +26 -0
- package/build-module/components/root/use-sync-body-background.mjs.map +7 -0
- package/build-module/components/sidebar/index.mjs +4 -6
- package/build-module/components/sidebar/index.mjs.map +2 -2
- package/build-module/index.mjs +6 -6
- package/build-module/index.mjs.map +2 -2
- package/build-style/style-rtl.css +6 -453
- package/build-style/style.css +6 -453
- package/build-style/view-transitions-rtl.css +0 -13
- package/build-style/view-transitions.css +0 -13
- package/build-types/components/app/index.d.ts +2 -2
- package/build-types/components/app/index.d.ts.map +1 -1
- package/build-types/components/app/router.d.ts +1 -1
- package/build-types/components/app/router.d.ts.map +1 -1
- package/build-types/components/canvas/back-button.d.ts +1 -8
- package/build-types/components/canvas/back-button.d.ts.map +1 -1
- package/build-types/components/canvas-renderer/index.d.ts +1 -1
- package/build-types/components/canvas-renderer/index.d.ts.map +1 -1
- package/build-types/components/navigation/drilldown-item/index.d.ts +2 -2
- package/build-types/components/navigation/drilldown-item/index.d.ts.map +1 -1
- package/build-types/components/navigation/dropdown-item/index.d.ts +1 -1
- package/build-types/components/navigation/dropdown-item/index.d.ts.map +1 -1
- package/build-types/components/navigation/navigation-item/index.d.ts +1 -1
- package/build-types/components/navigation/navigation-item/index.d.ts.map +1 -1
- package/build-types/components/navigation/navigation-screen/index.d.ts +2 -2
- package/build-types/components/navigation/navigation-screen/index.d.ts.map +1 -1
- package/build-types/components/root/index.d.ts.map +1 -1
- package/build-types/components/root/single-page.d.ts.map +1 -1
- package/build-types/components/root/use-sync-body-background.d.ts +13 -0
- package/build-types/components/root/use-sync-body-background.d.ts.map +1 -0
- package/build-types/components/save-panel/use-save-shortcut.d.ts +1 -1
- package/build-types/components/save-panel/use-save-shortcut.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts +0 -5
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/package.json +28 -28
- package/src/components/canvas/back-button.tsx +9 -77
- package/src/components/navigation/navigation-item/style.scss +2 -2
- package/src/components/root/index.tsx +4 -0
- package/src/components/root/single-page.tsx +4 -0
- package/src/components/root/style.scss +15 -1
- package/src/components/root/use-sync-body-background.ts +41 -0
- package/src/components/sidebar/index.tsx +1 -9
- package/src/components/sidebar/style.scss +1 -1
- package/src/style.scss +0 -2
- package/src/view-transitions.scss +0 -18
- package/build-module/components/site-hub/index.mjs +0 -78
- package/build-module/components/site-hub/index.mjs.map +0 -7
- package/build-module/components/site-icon/index.mjs +0 -57
- package/build-module/components/site-icon/index.mjs.map +0 -7
- package/build-module/components/site-icon-link/index.mjs +0 -53
- package/build-module/components/site-icon-link/index.mjs.map +0 -7
- package/build-style/experimental-omnibar-rtl.css +0 -37
- package/build-style/experimental-omnibar.css +0 -37
- package/build-types/components/site-hub/index.d.ts +0 -4
- package/build-types/components/site-hub/index.d.ts.map +0 -1
- package/build-types/components/site-icon/index.d.ts +0 -9
- package/build-types/components/site-icon/index.d.ts.map +0 -1
- package/build-types/components/site-icon-link/index.d.ts +0 -8
- package/build-types/components/site-icon-link/index.d.ts.map +0 -1
- package/src/components/canvas/back-button.scss +0 -67
- package/src/components/site-hub/index.tsx +0 -77
- package/src/components/site-hub/style.scss +0 -69
- package/src/components/site-icon/index.tsx +0 -60
- package/src/components/site-icon/style.scss +0 -19
- package/src/components/site-icon-link/index.tsx +0 -57
- package/src/components/site-icon-link/style.scss +0 -24
- package/src/experimental-omnibar.scss +0 -48
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// packages/boot/src/components/site-icon/index.tsx
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
import { useSelect } from "@wordpress/data";
|
|
4
|
-
import { Icon, wordpress } from "@wordpress/icons";
|
|
5
|
-
import { __ } from "@wordpress/i18n";
|
|
6
|
-
import { store as coreDataStore } from "@wordpress/core-data";
|
|
7
|
-
|
|
8
|
-
// packages/boot/src/components/site-icon/style.scss
|
|
9
|
-
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='8cdddce491']")) {
|
|
10
|
-
const style = document.createElement("style");
|
|
11
|
-
style.setAttribute("data-wp-hash", "8cdddce491");
|
|
12
|
-
style.appendChild(document.createTextNode(".boot-site-icon{display:flex}.boot-site-icon__icon{fill:var(--wpds-color-foreground-content-neutral,#1e1e1e);height:32px;width:32px}.boot-site-icon__image{aspect-ratio:1/1;border-radius:var(--wpds-border-radius-md,4px);height:32px;object-fit:cover;width:32px}"));
|
|
13
|
-
document.head.appendChild(style);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// packages/boot/src/components/site-icon/index.tsx
|
|
17
|
-
import { jsx } from "react/jsx-runtime";
|
|
18
|
-
function SiteIcon({ className }) {
|
|
19
|
-
const { isRequestingSite, siteIconUrl } = useSelect((select) => {
|
|
20
|
-
const { getEntityRecord } = select(coreDataStore);
|
|
21
|
-
const siteData = getEntityRecord(
|
|
22
|
-
"root",
|
|
23
|
-
"__unstableBase",
|
|
24
|
-
void 0
|
|
25
|
-
);
|
|
26
|
-
return {
|
|
27
|
-
isRequestingSite: !siteData,
|
|
28
|
-
siteIconUrl: siteData?.site_icon_url
|
|
29
|
-
};
|
|
30
|
-
}, []);
|
|
31
|
-
let icon = null;
|
|
32
|
-
if (isRequestingSite && !siteIconUrl) {
|
|
33
|
-
icon = /* @__PURE__ */ jsx("div", { className: "boot-site-icon__image" });
|
|
34
|
-
} else {
|
|
35
|
-
icon = siteIconUrl ? /* @__PURE__ */ jsx(
|
|
36
|
-
"img",
|
|
37
|
-
{
|
|
38
|
-
className: "boot-site-icon__image",
|
|
39
|
-
alt: __("Site Icon"),
|
|
40
|
-
src: siteIconUrl
|
|
41
|
-
}
|
|
42
|
-
) : /* @__PURE__ */ jsx(
|
|
43
|
-
Icon,
|
|
44
|
-
{
|
|
45
|
-
className: "boot-site-icon__icon",
|
|
46
|
-
icon: wordpress,
|
|
47
|
-
size: 48
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
return /* @__PURE__ */ jsx("div", { className: clsx(className, "boot-site-icon"), children: icon });
|
|
52
|
-
}
|
|
53
|
-
var site_icon_default = SiteIcon;
|
|
54
|
-
export {
|
|
55
|
-
site_icon_default as default
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/site-icon/index.tsx", "../../../src/components/site-icon/style.scss"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Icon, wordpress } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport type { UnstableBase } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport './style.scss';\n\nfunction SiteIcon( { className }: { className?: string } ) {\n\tconst { isRequestingSite, siteIconUrl } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord } = select( coreDataStore );\n\t\tconst siteData = getEntityRecord< UnstableBase >(\n\t\t\t'root',\n\t\t\t'__unstableBase',\n\t\t\tundefined\n\t\t);\n\n\t\treturn {\n\t\t\tisRequestingSite: ! siteData,\n\t\t\tsiteIconUrl: siteData?.site_icon_url,\n\t\t};\n\t}, [] );\n\n\tlet icon = null;\n\n\tif ( isRequestingSite && ! siteIconUrl ) {\n\t\ticon = <div className=\"boot-site-icon__image\" />;\n\t} else {\n\t\ticon = siteIconUrl ? (\n\t\t\t<img\n\t\t\t\tclassName=\"boot-site-icon__image\"\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t) : (\n\t\t\t<Icon\n\t\t\t\tclassName=\"boot-site-icon__icon\"\n\t\t\t\ticon={ wordpress }\n\t\t\t\tsize={ 48 }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className={ clsx( className, 'boot-site-icon' ) }>{ icon }</div>\n\t);\n}\n\nexport default SiteIcon;\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='8cdddce491']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"8cdddce491\");\n\tstyle.appendChild(document.createTextNode(\".boot-site-icon{display:flex}.boot-site-icon__icon{fill:var(--wpds-color-foreground-content-neutral,#1e1e1e);height:32px;width:32px}.boot-site-icon__image{aspect-ratio:1/1;border-radius:var(--wpds-border-radius-md,4px);height:32px;object-fit:cover;width:32px}\"));\n\tdocument.head.appendChild(style);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,iBAAiB;AAC1B,SAAS,MAAM,iBAAiB;AAChC,SAAS,UAAU;AACnB,SAAS,SAAS,qBAAqB;;;ACXvC,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,qQAAqQ,CAAC;AAChT,WAAS,KAAK,YAAY,KAAK;AAChC;;;ADgCS;AAlBT,SAAS,SAAU,EAAE,UAAU,GAA4B;AAC1D,QAAM,EAAE,kBAAkB,YAAY,IAAI,UAAW,CAAE,WAAY;AAClE,UAAM,EAAE,gBAAgB,IAAI,OAAQ,aAAc;AAClD,UAAM,WAAW;AAAA,MAChB;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAEA,WAAO;AAAA,MACN,kBAAkB,CAAE;AAAA,MACpB,aAAa,UAAU;AAAA,IACxB;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,MAAI,OAAO;AAEX,MAAK,oBAAoB,CAAE,aAAc;AACxC,WAAO,oBAAC,SAAI,WAAU,yBAAwB;AAAA,EAC/C,OAAO;AACN,WAAO,cACN;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,KAAM,GAAI,WAAY;AAAA,QACtB,KAAM;AAAA;AAAA,IACP,IAEA;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,MAAO;AAAA,QACP,MAAO;AAAA;AAAA,IACR;AAAA,EAEF;AAEA,SACC,oBAAC,SAAI,WAAY,KAAM,WAAW,gBAAiB,GAAM,gBAAM;AAEjE;AAEA,IAAO,oBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// packages/boot/src/components/site-icon-link/index.tsx
|
|
2
|
-
import { Link, privateApis as routePrivateApis } from "@wordpress/route";
|
|
3
|
-
import { Tooltip } from "@wordpress/ui";
|
|
4
|
-
import { unlock } from "../../lock-unlock.mjs";
|
|
5
|
-
import SiteIcon from "../site-icon/index.mjs";
|
|
6
|
-
|
|
7
|
-
// packages/boot/src/components/site-icon-link/style.scss
|
|
8
|
-
if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='6b58df5c9e']")) {
|
|
9
|
-
const style = document.createElement("style");
|
|
10
|
-
style.setAttribute("data-wp-hash", "6b58df5c9e");
|
|
11
|
-
style.appendChild(document.createTextNode(".boot-site-icon-link{align-items:center;background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);display:inline-flex;height:64px;justify-content:center;text-decoration:none;width:64px}@media not (prefers-reduced-motion){.boot-site-icon-link{transition:outline .1s ease-out}}.boot-site-icon-link:focus:not(:active){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:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}"));
|
|
12
|
-
document.head.appendChild(style);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// packages/boot/src/components/site-icon-link/index.tsx
|
|
16
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
-
var { useCanGoBack, useRouter } = unlock(routePrivateApis);
|
|
18
|
-
function SiteIconLink({
|
|
19
|
-
to,
|
|
20
|
-
isBackButton,
|
|
21
|
-
...props
|
|
22
|
-
}) {
|
|
23
|
-
const router = useRouter();
|
|
24
|
-
const canGoBack = useCanGoBack();
|
|
25
|
-
return /* @__PURE__ */ jsxs(Tooltip.Root, { children: [
|
|
26
|
-
/* @__PURE__ */ jsx(
|
|
27
|
-
Tooltip.Trigger,
|
|
28
|
-
{
|
|
29
|
-
render: /* @__PURE__ */ jsx(
|
|
30
|
-
Link,
|
|
31
|
-
{
|
|
32
|
-
to,
|
|
33
|
-
"aria-label": props["aria-label"],
|
|
34
|
-
className: "boot-site-icon-link",
|
|
35
|
-
onClick: (event) => {
|
|
36
|
-
if (canGoBack && isBackButton) {
|
|
37
|
-
event.preventDefault();
|
|
38
|
-
router.history.back();
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
children: /* @__PURE__ */ jsx(SiteIcon, {})
|
|
42
|
-
}
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
),
|
|
46
|
-
/* @__PURE__ */ jsx(Tooltip.Popup, { positioner: /* @__PURE__ */ jsx(Tooltip.Positioner, { side: "right" }), children: props["aria-label"] })
|
|
47
|
-
] });
|
|
48
|
-
}
|
|
49
|
-
var site_icon_link_default = SiteIconLink;
|
|
50
|
-
export {
|
|
51
|
-
site_icon_link_default as default
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/site-icon-link/index.tsx", "../../../src/components/site-icon-link/style.scss"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Link, privateApis as routePrivateApis } from '@wordpress/route';\nimport { Tooltip } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nimport SiteIcon from '../site-icon';\nimport './style.scss';\n\nconst { useCanGoBack, useRouter } = unlock( routePrivateApis );\n\nfunction SiteIconLink( {\n\tto,\n\tisBackButton,\n\t...props\n}: {\n\tto: string;\n\t'aria-label': string;\n\tisBackButton?: boolean;\n} ) {\n\tconst router = useRouter();\n\tconst canGoBack = useCanGoBack();\n\n\treturn (\n\t\t<Tooltip.Root>\n\t\t\t<Tooltip.Trigger\n\t\t\t\trender={\n\t\t\t\t\t<Link\n\t\t\t\t\t\tto={ to }\n\t\t\t\t\t\taria-label={ props[ 'aria-label' ] }\n\t\t\t\t\t\tclassName=\"boot-site-icon-link\"\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\t// If possible, restore the previous page with\n\t\t\t\t\t\t\t// filters etc.\n\t\t\t\t\t\t\tif ( canGoBack && isBackButton ) {\n\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\trouter.history.back();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<SiteIcon />\n\t\t\t\t\t</Link>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t<Tooltip.Popup positioner={ <Tooltip.Positioner side=\"right\" /> }>\n\t\t\t\t{ props[ 'aria-label' ] }\n\t\t\t</Tooltip.Popup>\n\t\t</Tooltip.Root>\n\t);\n}\n\nexport default SiteIconLink;\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='6b58df5c9e']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"6b58df5c9e\");\n\tstyle.appendChild(document.createTextNode(\".boot-site-icon-link{align-items:center;background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);display:inline-flex;height:64px;justify-content:center;text-decoration:none;width:64px}@media not (prefers-reduced-motion){.boot-site-icon-link{transition:outline .1s ease-out}}.boot-site-icon-link:focus:not(:active){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:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}\"));\n\tdocument.head.appendChild(style);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,MAAM,eAAe,wBAAwB;AACtD,SAAS,eAAe;AAKxB,SAAS,cAAc;AAEvB,OAAO,cAAc;;;ACXrB,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,+jBAA+jB,CAAC;AAC1mB,WAAS,KAAK,YAAY,KAAK;AAChC;;;ADwBE,SAgBI,KAhBJ;AAfF,IAAM,EAAE,cAAc,UAAU,IAAI,OAAQ,gBAAiB;AAE7D,SAAS,aAAc;AAAA,EACtB;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAII;AACH,QAAM,SAAS,UAAU;AACzB,QAAM,YAAY,aAAa;AAE/B,SACC,qBAAC,QAAQ,MAAR,EACA;AAAA;AAAA,MAAC,QAAQ;AAAA,MAAR;AAAA,QACA,QACC;AAAA,UAAC;AAAA;AAAA,YACA;AAAA,YACA,cAAa,MAAO,YAAa;AAAA,YACjC,WAAU;AAAA,YACV,SAAU,CAAE,UAAW;AAGtB,kBAAK,aAAa,cAAe;AAChC,sBAAM,eAAe;AACrB,uBAAO,QAAQ,KAAK;AAAA,cACrB;AAAA,YACD;AAAA,YAEA,8BAAC,YAAS;AAAA;AAAA,QACX;AAAA;AAAA,IAEF;AAAA,IACA,oBAAC,QAAQ,OAAR,EAAc,YAAa,oBAAC,QAAQ,YAAR,EAAmB,MAAK,SAAQ,GAC1D,gBAAO,YAAa,GACvB;AAAA,KACD;AAEF;AAEA,IAAO,yBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
body.has-admin-bar-in-editor #wpadminbar {
|
|
2
|
-
display: block;
|
|
3
|
-
}
|
|
4
|
-
body.has-admin-bar-in-editor .boot-canvas-back-button__link {
|
|
5
|
-
background: transparent;
|
|
6
|
-
}
|
|
7
|
-
body.has-admin-bar-in-editor .boot-canvas-back-button__icon {
|
|
8
|
-
background-color: transparent;
|
|
9
|
-
}
|
|
10
|
-
body.has-admin-bar-in-editor #site-editor-v2-app {
|
|
11
|
-
position: fixed;
|
|
12
|
-
top: 32px;
|
|
13
|
-
right: 0;
|
|
14
|
-
left: 0;
|
|
15
|
-
bottom: 0;
|
|
16
|
-
height: calc(100vh - 32px) !important;
|
|
17
|
-
}
|
|
18
|
-
body.has-admin-bar-in-editor .boot-layout.has-full-canvas .boot-layout__canvas {
|
|
19
|
-
top: 32px;
|
|
20
|
-
height: calc(100vh - 32px);
|
|
21
|
-
}
|
|
22
|
-
@media (max-width: 782px) {
|
|
23
|
-
body.has-admin-bar-in-editor #site-editor-v2-app {
|
|
24
|
-
top: 46px;
|
|
25
|
-
height: calc(100vh - 46px) !important;
|
|
26
|
-
}
|
|
27
|
-
body.has-admin-bar-in-editor .boot-layout__stage,
|
|
28
|
-
body.has-admin-bar-in-editor .boot-layout__inspector,
|
|
29
|
-
body.has-admin-bar-in-editor .boot-layout__canvas:not(.has-mobile-drawer),
|
|
30
|
-
body.has-admin-bar-in-editor .boot-layout.has-full-canvas .boot-layout__canvas {
|
|
31
|
-
top: 46px;
|
|
32
|
-
height: calc(100vh - 46px);
|
|
33
|
-
}
|
|
34
|
-
body.has-admin-bar-in-editor .boot-layout__mobile-sidebar-drawer {
|
|
35
|
-
top: 46px;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
body.has-admin-bar-in-editor #wpadminbar {
|
|
2
|
-
display: block;
|
|
3
|
-
}
|
|
4
|
-
body.has-admin-bar-in-editor .boot-canvas-back-button__link {
|
|
5
|
-
background: transparent;
|
|
6
|
-
}
|
|
7
|
-
body.has-admin-bar-in-editor .boot-canvas-back-button__icon {
|
|
8
|
-
background-color: transparent;
|
|
9
|
-
}
|
|
10
|
-
body.has-admin-bar-in-editor #site-editor-v2-app {
|
|
11
|
-
position: fixed;
|
|
12
|
-
top: 32px;
|
|
13
|
-
left: 0;
|
|
14
|
-
right: 0;
|
|
15
|
-
bottom: 0;
|
|
16
|
-
height: calc(100vh - 32px) !important;
|
|
17
|
-
}
|
|
18
|
-
body.has-admin-bar-in-editor .boot-layout.has-full-canvas .boot-layout__canvas {
|
|
19
|
-
top: 32px;
|
|
20
|
-
height: calc(100vh - 32px);
|
|
21
|
-
}
|
|
22
|
-
@media (max-width: 782px) {
|
|
23
|
-
body.has-admin-bar-in-editor #site-editor-v2-app {
|
|
24
|
-
top: 46px;
|
|
25
|
-
height: calc(100vh - 46px) !important;
|
|
26
|
-
}
|
|
27
|
-
body.has-admin-bar-in-editor .boot-layout__stage,
|
|
28
|
-
body.has-admin-bar-in-editor .boot-layout__inspector,
|
|
29
|
-
body.has-admin-bar-in-editor .boot-layout__canvas:not(.has-mobile-drawer),
|
|
30
|
-
body.has-admin-bar-in-editor .boot-layout.has-full-canvas .boot-layout__canvas {
|
|
31
|
-
top: 46px;
|
|
32
|
-
height: calc(100vh - 46px);
|
|
33
|
-
}
|
|
34
|
-
body.has-admin-bar-in-editor .boot-layout__mobile-sidebar-drawer {
|
|
35
|
-
top: 46px;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/site-hub/index.tsx"],"names":[],"mappings":"AAyBA,OAAO,cAAc,CAAC;AAEtB,iBAAS,OAAO,gCA+Cf;eAEc,OAAO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/site-icon/index.tsx"],"names":[],"mappings":"AAcA;;GAEG;AACH,OAAO,cAAc,CAAC;AAEtB,iBAAS,QAAQ,CAAE,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAsCvD;eAEc,QAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/site-icon-link/index.tsx"],"names":[],"mappings":"AAYA,OAAO,cAAc,CAAC;AAItB,iBAAS,YAAY,CAAE,EACtB,EAAE,EACF,YAAY,EACZ,GAAG,KAAK,EACR,EAAE;IACF,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,+BA8BA;eAEc,YAAY"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
@use "@wordpress/base-styles/variables";
|
|
2
|
-
|
|
3
|
-
.boot-canvas-back-button {
|
|
4
|
-
position: absolute;
|
|
5
|
-
top: 0;
|
|
6
|
-
left: 0;
|
|
7
|
-
height: variables.$header-height;
|
|
8
|
-
width: variables.$header-height;
|
|
9
|
-
z-index: 100;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.boot-canvas-back-button__container {
|
|
13
|
-
position: relative;
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 100%;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.boot-canvas-back-button__link.components-button {
|
|
19
|
-
width: variables.$header-height;
|
|
20
|
-
height: variables.$header-height;
|
|
21
|
-
display: inline-flex;
|
|
22
|
-
align-items: center;
|
|
23
|
-
justify-content: center;
|
|
24
|
-
background: var(--wpds-color-background-surface-neutral-weak);
|
|
25
|
-
text-decoration: none;
|
|
26
|
-
padding: 0;
|
|
27
|
-
border-radius: 0;
|
|
28
|
-
|
|
29
|
-
@media not (prefers-reduced-motion) {
|
|
30
|
-
transition: outline 0.1s ease-out;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&:focus:not(:active) {
|
|
34
|
-
outline:
|
|
35
|
-
var(--wpds-border-width-focus) solid
|
|
36
|
-
var(--wpds-color-stroke-focus);
|
|
37
|
-
outline-offset: calc(-1 * var(--wpds-border-width-focus));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.boot-canvas-back-button__icon {
|
|
42
|
-
position: absolute;
|
|
43
|
-
top: 0;
|
|
44
|
-
left: 0;
|
|
45
|
-
width: variables.$header-height;
|
|
46
|
-
height: variables.$header-height;
|
|
47
|
-
display: flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
background-color: hsla(0, 0%, 80%);
|
|
51
|
-
pointer-events: none;
|
|
52
|
-
|
|
53
|
-
svg {
|
|
54
|
-
fill: currentColor;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&.has-site-icon {
|
|
58
|
-
background-color: hsla(0, 0%, 100%, 0.6);
|
|
59
|
-
-webkit-backdrop-filter: saturate(180%) blur(15px);
|
|
60
|
-
backdrop-filter: saturate(180%) blur(15px);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Remove the header slide-in animation so the back logo does not move.
|
|
65
|
-
.interface-interface-skeleton__header {
|
|
66
|
-
margin-top: 0 !important;
|
|
67
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
-
import {
|
|
6
|
-
ExternalLink,
|
|
7
|
-
Button,
|
|
8
|
-
// @ts-ignore
|
|
9
|
-
__experimentalHStack as HStack,
|
|
10
|
-
} from '@wordpress/components';
|
|
11
|
-
import { __ } from '@wordpress/i18n';
|
|
12
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
13
|
-
import { decodeEntities } from '@wordpress/html-entities';
|
|
14
|
-
import { search } from '@wordpress/icons';
|
|
15
|
-
import { displayShortcut } from '@wordpress/keycodes';
|
|
16
|
-
// @ts-expect-error Commands is not typed properly.
|
|
17
|
-
import { store as commandsStore } from '@wordpress/commands';
|
|
18
|
-
import { filterURLForDisplay } from '@wordpress/url';
|
|
19
|
-
import type { UnstableBase } from '@wordpress/core-data';
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Internal dependencies
|
|
23
|
-
*/
|
|
24
|
-
import SiteIconLink from '../site-icon-link';
|
|
25
|
-
import { store as bootStore } from '../../store';
|
|
26
|
-
import './style.scss';
|
|
27
|
-
|
|
28
|
-
function SiteHub() {
|
|
29
|
-
const { dashboardLink, homeUrl, siteTitle } = useSelect( ( select ) => {
|
|
30
|
-
const { getEntityRecord } = select( coreStore );
|
|
31
|
-
const _base = getEntityRecord< UnstableBase >(
|
|
32
|
-
'root',
|
|
33
|
-
'__unstableBase'
|
|
34
|
-
);
|
|
35
|
-
return {
|
|
36
|
-
dashboardLink: select( bootStore ).getDashboardLink(),
|
|
37
|
-
homeUrl: _base?.home,
|
|
38
|
-
siteTitle:
|
|
39
|
-
! _base?.name && !! _base?.url
|
|
40
|
-
? filterURLForDisplay( _base?.url )
|
|
41
|
-
: _base?.name,
|
|
42
|
-
};
|
|
43
|
-
}, [] );
|
|
44
|
-
const { open: openCommandCenter } = useDispatch( commandsStore );
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<div className="boot-site-hub">
|
|
48
|
-
<SiteIconLink
|
|
49
|
-
to={ dashboardLink || '/' }
|
|
50
|
-
aria-label={ __( 'Go to the Dashboard' ) }
|
|
51
|
-
/>
|
|
52
|
-
<ExternalLink
|
|
53
|
-
href={ homeUrl ?? '/' }
|
|
54
|
-
className="boot-site-hub__title"
|
|
55
|
-
>
|
|
56
|
-
<div className="boot-site-hub__title-text">
|
|
57
|
-
{ siteTitle && decodeEntities( siteTitle ) }
|
|
58
|
-
</div>
|
|
59
|
-
<div className="boot-site-hub__url">
|
|
60
|
-
{ filterURLForDisplay( homeUrl ?? '' ) }
|
|
61
|
-
</div>
|
|
62
|
-
</ExternalLink>
|
|
63
|
-
<HStack className="boot-site-hub__actions">
|
|
64
|
-
<Button
|
|
65
|
-
variant="tertiary"
|
|
66
|
-
icon={ search }
|
|
67
|
-
onClick={ () => openCommandCenter() }
|
|
68
|
-
size="compact"
|
|
69
|
-
label={ __( 'Open command palette' ) }
|
|
70
|
-
shortcut={ displayShortcut.primary( 'k' ) }
|
|
71
|
-
/>
|
|
72
|
-
</HStack>
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export default SiteHub;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
@use "@wordpress/base-styles/variables";
|
|
2
|
-
|
|
3
|
-
.boot-site-hub {
|
|
4
|
-
position: sticky;
|
|
5
|
-
top: 0;
|
|
6
|
-
background-color: var(--wpds-color-background-surface-neutral-weak);
|
|
7
|
-
z-index: 1;
|
|
8
|
-
display: grid;
|
|
9
|
-
grid-template-columns: 60px 1fr auto;
|
|
10
|
-
align-items: center;
|
|
11
|
-
padding-right: variables.$grid-unit-20;
|
|
12
|
-
flex-shrink: 0; // Prevent flex parent from shrinking this element.
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.boot-site-hub__actions {
|
|
16
|
-
flex-shrink: 0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.boot-site-hub__title {
|
|
20
|
-
display: flex;
|
|
21
|
-
align-items: center;
|
|
22
|
-
text-decoration: none;
|
|
23
|
-
|
|
24
|
-
.components-external-link__contents {
|
|
25
|
-
text-decoration: none;
|
|
26
|
-
margin-inline-start: variables.$grid-unit-05;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
max-width: 140px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Show icon on hover
|
|
32
|
-
.components-external-link__icon {
|
|
33
|
-
opacity: 0;
|
|
34
|
-
transition: opacity 0.1s ease-out;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&:hover .components-external-link__icon {
|
|
38
|
-
opacity: 1;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Focus styles
|
|
42
|
-
@media not (prefers-reduced-motion) {
|
|
43
|
-
transition: outline 0.1s ease-out;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&:focus:not(:active) {
|
|
47
|
-
outline:
|
|
48
|
-
var(--wpds-border-width-focus) solid
|
|
49
|
-
var(--wpds-color-stroke-focus);
|
|
50
|
-
outline-offset: calc(-1 * var(--wpds-border-width-focus));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.boot-site-hub__title-text {
|
|
55
|
-
color: var(--wpds-color-foreground-content-neutral);
|
|
56
|
-
font-size: variables.$font-size-medium;
|
|
57
|
-
font-weight: variables.$font-weight-medium;
|
|
58
|
-
overflow: hidden;
|
|
59
|
-
text-overflow: ellipsis;
|
|
60
|
-
white-space: nowrap;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.boot-site-hub__url {
|
|
64
|
-
color: var(--wpds-color-foreground-content-neutral-weak);
|
|
65
|
-
font-size: variables.$font-size-small;
|
|
66
|
-
overflow: hidden;
|
|
67
|
-
text-overflow: ellipsis;
|
|
68
|
-
white-space: nowrap;
|
|
69
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import clsx from 'clsx';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* WordPress dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { useSelect } from '@wordpress/data';
|
|
10
|
-
import { Icon, wordpress } from '@wordpress/icons';
|
|
11
|
-
import { __ } from '@wordpress/i18n';
|
|
12
|
-
import { store as coreDataStore } from '@wordpress/core-data';
|
|
13
|
-
import type { UnstableBase } from '@wordpress/core-data';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
import './style.scss';
|
|
19
|
-
|
|
20
|
-
function SiteIcon( { className }: { className?: string } ) {
|
|
21
|
-
const { isRequestingSite, siteIconUrl } = useSelect( ( select ) => {
|
|
22
|
-
const { getEntityRecord } = select( coreDataStore );
|
|
23
|
-
const siteData = getEntityRecord< UnstableBase >(
|
|
24
|
-
'root',
|
|
25
|
-
'__unstableBase',
|
|
26
|
-
undefined
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
isRequestingSite: ! siteData,
|
|
31
|
-
siteIconUrl: siteData?.site_icon_url,
|
|
32
|
-
};
|
|
33
|
-
}, [] );
|
|
34
|
-
|
|
35
|
-
let icon = null;
|
|
36
|
-
|
|
37
|
-
if ( isRequestingSite && ! siteIconUrl ) {
|
|
38
|
-
icon = <div className="boot-site-icon__image" />;
|
|
39
|
-
} else {
|
|
40
|
-
icon = siteIconUrl ? (
|
|
41
|
-
<img
|
|
42
|
-
className="boot-site-icon__image"
|
|
43
|
-
alt={ __( 'Site Icon' ) }
|
|
44
|
-
src={ siteIconUrl }
|
|
45
|
-
/>
|
|
46
|
-
) : (
|
|
47
|
-
<Icon
|
|
48
|
-
className="boot-site-icon__icon"
|
|
49
|
-
icon={ wordpress }
|
|
50
|
-
size={ 48 }
|
|
51
|
-
/>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<div className={ clsx( className, 'boot-site-icon' ) }>{ icon }</div>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export default SiteIcon;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
@use "@wordpress/base-styles/variables";
|
|
2
|
-
|
|
3
|
-
.boot-site-icon {
|
|
4
|
-
display: flex;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.boot-site-icon__icon {
|
|
8
|
-
width: variables.$grid-unit-40;
|
|
9
|
-
height: variables.$grid-unit-40;
|
|
10
|
-
fill: var(--wpds-color-foreground-content-neutral);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.boot-site-icon__image {
|
|
14
|
-
width: variables.$grid-unit-40;
|
|
15
|
-
height: variables.$grid-unit-40;
|
|
16
|
-
object-fit: cover;
|
|
17
|
-
aspect-ratio: 1 / 1;
|
|
18
|
-
border-radius: var(--wpds-border-radius-md);
|
|
19
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { Link, privateApis as routePrivateApis } from '@wordpress/route';
|
|
5
|
-
import { Tooltip } from '@wordpress/ui';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { unlock } from '../../lock-unlock';
|
|
11
|
-
|
|
12
|
-
import SiteIcon from '../site-icon';
|
|
13
|
-
import './style.scss';
|
|
14
|
-
|
|
15
|
-
const { useCanGoBack, useRouter } = unlock( routePrivateApis );
|
|
16
|
-
|
|
17
|
-
function SiteIconLink( {
|
|
18
|
-
to,
|
|
19
|
-
isBackButton,
|
|
20
|
-
...props
|
|
21
|
-
}: {
|
|
22
|
-
to: string;
|
|
23
|
-
'aria-label': string;
|
|
24
|
-
isBackButton?: boolean;
|
|
25
|
-
} ) {
|
|
26
|
-
const router = useRouter();
|
|
27
|
-
const canGoBack = useCanGoBack();
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<Tooltip.Root>
|
|
31
|
-
<Tooltip.Trigger
|
|
32
|
-
render={
|
|
33
|
-
<Link
|
|
34
|
-
to={ to }
|
|
35
|
-
aria-label={ props[ 'aria-label' ] }
|
|
36
|
-
className="boot-site-icon-link"
|
|
37
|
-
onClick={ ( event ) => {
|
|
38
|
-
// If possible, restore the previous page with
|
|
39
|
-
// filters etc.
|
|
40
|
-
if ( canGoBack && isBackButton ) {
|
|
41
|
-
event.preventDefault();
|
|
42
|
-
router.history.back();
|
|
43
|
-
}
|
|
44
|
-
} }
|
|
45
|
-
>
|
|
46
|
-
<SiteIcon />
|
|
47
|
-
</Link>
|
|
48
|
-
}
|
|
49
|
-
/>
|
|
50
|
-
<Tooltip.Popup positioner={ <Tooltip.Positioner side="right" /> }>
|
|
51
|
-
{ props[ 'aria-label' ] }
|
|
52
|
-
</Tooltip.Popup>
|
|
53
|
-
</Tooltip.Root>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export default SiteIconLink;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
@use "@wordpress/base-styles/variables";
|
|
2
|
-
|
|
3
|
-
$header-height: variables.$header-height;
|
|
4
|
-
|
|
5
|
-
.boot-site-icon-link {
|
|
6
|
-
width: $header-height;
|
|
7
|
-
height: $header-height;
|
|
8
|
-
display: inline-flex;
|
|
9
|
-
align-items: center;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
background: var(--wpds-color-background-surface-neutral-weak);
|
|
12
|
-
text-decoration: none;
|
|
13
|
-
|
|
14
|
-
@media not (prefers-reduced-motion) {
|
|
15
|
-
transition: outline 0.1s ease-out;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
&:focus:not(:active) {
|
|
19
|
-
outline:
|
|
20
|
-
var(--wpds-border-width-focus) solid
|
|
21
|
-
var(--wpds-color-stroke-focus);
|
|
22
|
-
outline-offset: calc(-1 * var(--wpds-border-width-focus));
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// Styles for the experimental omnibar.
|
|
2
|
-
|
|
3
|
-
body.has-admin-bar-in-editor {
|
|
4
|
-
#wpadminbar {
|
|
5
|
-
display: block;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.boot-canvas-back-button__link {
|
|
9
|
-
background: transparent;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.boot-canvas-back-button__icon {
|
|
13
|
-
background-color: transparent;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
#site-editor-v2-app {
|
|
17
|
-
position: fixed;
|
|
18
|
-
top: 32px;
|
|
19
|
-
left: 0;
|
|
20
|
-
right: 0;
|
|
21
|
-
bottom: 0;
|
|
22
|
-
height: calc(100vh - 32px) !important;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.boot-layout.has-full-canvas .boot-layout__canvas {
|
|
26
|
-
top: 32px;
|
|
27
|
-
height: calc(100vh - 32px);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@media (max-width: 782px) {
|
|
31
|
-
#site-editor-v2-app {
|
|
32
|
-
top: 46px;
|
|
33
|
-
height: calc(100vh - 46px) !important;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.boot-layout__stage,
|
|
37
|
-
.boot-layout__inspector,
|
|
38
|
-
.boot-layout__canvas:not(.has-mobile-drawer),
|
|
39
|
-
.boot-layout.has-full-canvas .boot-layout__canvas {
|
|
40
|
-
top: 46px;
|
|
41
|
-
height: calc(100vh - 46px);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.boot-layout__mobile-sidebar-drawer {
|
|
45
|
-
top: 46px;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|