@wordpress/boot 0.15.0 → 0.15.2-next.v.202606191442.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/build-module/components/app/use-route-title.mjs +1 -1
  3. package/build-module/components/app/use-route-title.mjs.map +2 -2
  4. package/build-module/components/canvas/back-button.mjs +3 -3
  5. package/build-module/components/canvas/back-button.mjs.map +2 -2
  6. package/build-module/components/navigation/index.mjs +2 -2
  7. package/build-module/components/navigation/index.mjs.map +2 -2
  8. package/build-module/components/navigation/navigation-item/index.mjs +3 -3
  9. package/build-module/components/navigation/navigation-item/index.mjs.map +2 -2
  10. package/build-module/components/navigation/navigation-screen/index.mjs +3 -3
  11. package/build-module/components/navigation/navigation-screen/index.mjs.map +2 -2
  12. package/build-module/components/root/index.mjs +121 -100
  13. package/build-module/components/root/index.mjs.map +2 -2
  14. package/build-module/components/root/single-page.mjs +45 -25
  15. package/build-module/components/root/single-page.mjs.map +2 -2
  16. package/build-module/components/save-button/index.mjs +35 -29
  17. package/build-module/components/save-button/index.mjs.map +2 -2
  18. package/build-module/components/site-hub/index.mjs +3 -3
  19. package/build-module/components/site-hub/index.mjs.map +2 -2
  20. package/build-module/components/site-icon/index.mjs +3 -3
  21. package/build-module/components/site-icon/index.mjs.map +2 -2
  22. package/build-module/components/site-icon-link/index.mjs +28 -20
  23. package/build-module/components/site-icon-link/index.mjs.map +2 -2
  24. package/build-module/index.mjs +6 -6
  25. package/build-module/index.mjs.map +2 -2
  26. package/build-style/style-rtl.css +180 -187
  27. package/build-style/style.css +180 -187
  28. package/build-style/view-transitions-rtl.css +7 -4
  29. package/build-style/view-transitions.css +7 -4
  30. package/build-types/components/root/index.d.ts.map +1 -1
  31. package/build-types/components/root/single-page.d.ts.map +1 -1
  32. package/build-types/components/save-button/index.d.ts.map +1 -1
  33. package/build-types/components/site-icon-link/index.d.ts.map +1 -1
  34. package/package.json +31 -25
  35. package/src/components/canvas/back-button.scss +2 -2
  36. package/src/components/navigation/index.tsx +2 -2
  37. package/src/components/navigation/navigation-item/style.scss +3 -3
  38. package/src/components/navigation/navigation-screen/style.scss +2 -2
  39. package/src/components/root/index.tsx +140 -120
  40. package/src/components/root/single-page.tsx +20 -7
  41. package/src/components/root/style.scss +10 -10
  42. package/src/components/save-button/index.tsx +30 -20
  43. package/src/components/save-button/style.scss +6 -0
  44. package/src/components/site-hub/style.scss +4 -4
  45. package/src/components/site-icon/style.scss +1 -1
  46. package/src/components/site-icon-link/index.tsx +26 -18
  47. package/src/components/site-icon-link/style.scss +2 -2
  48. package/src/{experimental-admin-bar-in-editor.scss → experimental-omnibar.scss} +1 -1
  49. package/src/style.scss +1 -1
  50. package/src/view-transitions.scss +1 -1
  51. package/build-module/components/user-theme-provider/index.mjs +0 -33
  52. package/build-module/components/user-theme-provider/index.mjs.map +0 -7
  53. package/build-types/components/user-theme-provider/index.d.ts +0 -6
  54. package/build-types/components/user-theme-provider/index.d.ts.map +0 -1
  55. package/src/components/user-theme-provider/index.tsx +0 -35
  56. package/src/components/user-theme-provider/test/index.test.ts +0 -11
  57. /package/build-style/{experimental-admin-bar-in-editor-rtl.css → experimental-omnibar-rtl.css} +0 -0
  58. /package/build-style/{experimental-admin-bar-in-editor.css → experimental-omnibar.css} +0 -0
@@ -3,7 +3,7 @@
3
3
  .boot-site-hub {
4
4
  position: sticky;
5
5
  top: 0;
6
- background-color: var(--wpds-color-bg-surface-neutral-weak);
6
+ background-color: var(--wpds-color-background-surface-neutral-weak);
7
7
  z-index: 1;
8
8
  display: grid;
9
9
  grid-template-columns: 60px 1fr auto;
@@ -46,13 +46,13 @@
46
46
  &:focus:not(:active) {
47
47
  outline:
48
48
  var(--wpds-border-width-focus) solid
49
- var(--wpds-color-stroke-focus-brand);
49
+ var(--wpds-color-stroke-focus);
50
50
  outline-offset: calc(-1 * var(--wpds-border-width-focus));
51
51
  }
52
52
  }
53
53
 
54
54
  .boot-site-hub__title-text {
55
- color: var(--wpds-color-fg-content-neutral);
55
+ color: var(--wpds-color-foreground-content-neutral);
56
56
  font-size: variables.$font-size-medium;
57
57
  font-weight: variables.$font-weight-medium;
58
58
  overflow: hidden;
@@ -61,7 +61,7 @@
61
61
  }
62
62
 
63
63
  .boot-site-hub__url {
64
- color: var(--wpds-color-fg-content-neutral-weak);
64
+ color: var(--wpds-color-foreground-content-neutral-weak);
65
65
  font-size: variables.$font-size-small;
66
66
  overflow: hidden;
67
67
  text-overflow: ellipsis;
@@ -7,7 +7,7 @@
7
7
  .boot-site-icon__icon {
8
8
  width: variables.$grid-unit-40;
9
9
  height: variables.$grid-unit-40;
10
- fill: var(--wpds-color-fg-content-neutral);
10
+ fill: var(--wpds-color-foreground-content-neutral);
11
11
  }
12
12
 
13
13
  .boot-site-icon__image {
@@ -2,12 +2,13 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { Link, privateApis as routePrivateApis } from '@wordpress/route';
5
- import { Tooltip as WCTooltip } from '@wordpress/components';
5
+ import { Tooltip } from '@wordpress/ui';
6
6
 
7
7
  /**
8
8
  * Internal dependencies
9
9
  */
10
10
  import { unlock } from '../../lock-unlock';
11
+
11
12
  import SiteIcon from '../site-icon';
12
13
  import './style.scss';
13
14
 
@@ -26,23 +27,30 @@ function SiteIconLink( {
26
27
  const canGoBack = useCanGoBack();
27
28
 
28
29
  return (
29
- <WCTooltip text={ props[ 'aria-label' ] } placement="right">
30
- <Link
31
- to={ to }
32
- aria-label={ props[ 'aria-label' ] }
33
- className="boot-site-icon-link"
34
- onClick={ ( event ) => {
35
- // If possible, restore the previous page with
36
- // filters etc.
37
- if ( canGoBack && isBackButton ) {
38
- event.preventDefault();
39
- router.history.back();
40
- }
41
- } }
42
- >
43
- <SiteIcon />
44
- </Link>
45
- </WCTooltip>
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>
46
54
  );
47
55
  }
48
56
 
@@ -8,7 +8,7 @@ $header-height: variables.$header-height;
8
8
  display: inline-flex;
9
9
  align-items: center;
10
10
  justify-content: center;
11
- background: var(--wpds-color-bg-surface-neutral-weak);
11
+ background: var(--wpds-color-background-surface-neutral-weak);
12
12
  text-decoration: none;
13
13
 
14
14
  @media not (prefers-reduced-motion) {
@@ -18,7 +18,7 @@ $header-height: variables.$header-height;
18
18
  &:focus:not(:active) {
19
19
  outline:
20
20
  var(--wpds-border-width-focus) solid
21
- var(--wpds-color-stroke-focus-brand);
21
+ var(--wpds-color-stroke-focus);
22
22
  outline-offset: calc(-1 * var(--wpds-border-width-focus));
23
23
  }
24
24
  }
@@ -1,4 +1,4 @@
1
- // Styles for the experimental admin bar in editor.
1
+ // Styles for the experimental omnibar.
2
2
 
3
3
  body.has-admin-bar-in-editor {
4
4
  #wpadminbar {
package/src/style.scss CHANGED
@@ -1,7 +1,7 @@
1
1
  @use "@wordpress/theme/src/prebuilt/css/design-tokens.css" as *;
2
2
  @use "@wordpress/base-styles/mixins" as *;
3
3
  @use "@wordpress/base-styles/variables" as *;
4
- @use "./experimental-admin-bar-in-editor.scss" as *;
4
+ @use "./experimental-omnibar.scss" as *;
5
5
 
6
6
  .boot-layout-container .boot-layout {
7
7
  // On mobile the main content area has to scroll, otherwise you can invoke
@@ -106,7 +106,7 @@
106
106
  ::view-transition-new(boot--inspector),
107
107
  ::view-transition-old(boot--inspector) {
108
108
  background: colors.$white;
109
- border-radius: 8px;
109
+ border-radius: var(--wpds-border-radius-xl);
110
110
  width: 100%;
111
111
  height: 100%;
112
112
  object-fit: none;
@@ -1,33 +0,0 @@
1
- // packages/boot/src/components/user-theme-provider/index.tsx
2
- import {
3
- privateApis as themePrivateApis
4
- } from "@wordpress/theme";
5
- import { unlock } from "../../lock-unlock.mjs";
6
- import { jsx } from "react/jsx-runtime";
7
- var ThemeProvider = unlock(themePrivateApis).ThemeProvider;
8
- var THEME_PRIMARY_COLORS = /* @__PURE__ */ new Map([
9
- ["light", "#0085ba"],
10
- ["modern", "#3858e9"],
11
- ["blue", "#096484"],
12
- ["coffee", "#46403c"],
13
- ["ectoplasm", "#523f6d"],
14
- ["midnight", "#e14d43"],
15
- ["ocean", "#627c83"],
16
- ["sunrise", "#dd823b"]
17
- ]);
18
- function getAdminThemePrimaryColor() {
19
- const theme = document.body.className.match(/admin-color-([a-z]+)/)?.[1];
20
- return theme && THEME_PRIMARY_COLORS.get(theme);
21
- }
22
- function UserThemeProvider({
23
- color,
24
- ...restProps
25
- }) {
26
- const primary = getAdminThemePrimaryColor();
27
- return /* @__PURE__ */ jsx(ThemeProvider, { ...restProps, color: { primary, ...color } });
28
- }
29
- export {
30
- UserThemeProvider,
31
- getAdminThemePrimaryColor
32
- };
33
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/user-theme-provider/index.tsx"],
4
- "sourcesContent": ["import {\n\ttype ThemeProvider as ThemeProviderType,\n\tprivateApis as themePrivateApis,\n} from '@wordpress/theme';\nimport { unlock } from '../../lock-unlock';\n\nconst ThemeProvider: typeof ThemeProviderType =\n\tunlock( themePrivateApis ).ThemeProvider;\n\nconst THEME_PRIMARY_COLORS = new Map< string, string >( [\n\t[ 'light', '#0085ba' ],\n\t[ 'modern', '#3858e9' ],\n\t[ 'blue', '#096484' ],\n\t[ 'coffee', '#46403c' ],\n\t[ 'ectoplasm', '#523f6d' ],\n\t[ 'midnight', '#e14d43' ],\n\t[ 'ocean', '#627c83' ],\n\t[ 'sunrise', '#dd823b' ],\n] );\n\nexport function getAdminThemePrimaryColor(): string | undefined {\n\tconst theme =\n\t\tdocument.body.className.match( /admin-color-([a-z]+)/ )?.[ 1 ];\n\n\treturn theme && THEME_PRIMARY_COLORS.get( theme );\n}\n\nexport function UserThemeProvider( {\n\tcolor,\n\t...restProps\n}: React.ComponentProps< typeof ThemeProvider > ) {\n\tconst primary = getAdminThemePrimaryColor();\n\n\treturn <ThemeProvider { ...restProps } color={ { primary, ...color } } />;\n}\n"],
5
- "mappings": ";AAAA;AAAA,EAEC,eAAe;AAAA,OACT;AACP,SAAS,cAAc;AA6Bf;AA3BR,IAAM,gBACL,OAAQ,gBAAiB,EAAE;AAE5B,IAAM,uBAAuB,oBAAI,IAAuB;AAAA,EACvD,CAAE,SAAS,SAAU;AAAA,EACrB,CAAE,UAAU,SAAU;AAAA,EACtB,CAAE,QAAQ,SAAU;AAAA,EACpB,CAAE,UAAU,SAAU;AAAA,EACtB,CAAE,aAAa,SAAU;AAAA,EACzB,CAAE,YAAY,SAAU;AAAA,EACxB,CAAE,SAAS,SAAU;AAAA,EACrB,CAAE,WAAW,SAAU;AACxB,CAAE;AAEK,SAAS,4BAAgD;AAC/D,QAAM,QACL,SAAS,KAAK,UAAU,MAAO,sBAAuB,IAAK,CAAE;AAE9D,SAAO,SAAS,qBAAqB,IAAK,KAAM;AACjD;AAEO,SAAS,kBAAmB;AAAA,EAClC;AAAA,EACA,GAAG;AACJ,GAAkD;AACjD,QAAM,UAAU,0BAA0B;AAE1C,SAAO,oBAAC,iBAAgB,GAAG,WAAY,OAAQ,EAAE,SAAS,GAAG,MAAM,GAAI;AACxE;",
6
- "names": []
7
- }
@@ -1,6 +0,0 @@
1
- import { type ThemeProvider as ThemeProviderType } from '@wordpress/theme';
2
- declare const ThemeProvider: typeof ThemeProviderType;
3
- export declare function getAdminThemePrimaryColor(): string | undefined;
4
- export declare function UserThemeProvider({ color, ...restProps }: React.ComponentProps<typeof ThemeProvider>): import("react").JSX.Element;
5
- export {};
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/user-theme-provider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,aAAa,IAAI,iBAAiB,EAEvC,MAAM,kBAAkB,CAAC;AAG1B,QAAA,MAAM,aAAa,EAAE,OAAO,iBACa,CAAC;AAa1C,wBAAgB,yBAAyB,IAAI,MAAM,GAAG,SAAS,CAK9D;AAED,wBAAgB,iBAAiB,CAAE,EAClC,KAAK,EACL,GAAG,SAAS,EACZ,EAAE,KAAK,CAAC,cAAc,CAAE,OAAO,aAAa,CAAE,+BAI9C"}
@@ -1,35 +0,0 @@
1
- import {
2
- type ThemeProvider as ThemeProviderType,
3
- privateApis as themePrivateApis,
4
- } from '@wordpress/theme';
5
- import { unlock } from '../../lock-unlock';
6
-
7
- const ThemeProvider: typeof ThemeProviderType =
8
- unlock( themePrivateApis ).ThemeProvider;
9
-
10
- const THEME_PRIMARY_COLORS = new Map< string, string >( [
11
- [ 'light', '#0085ba' ],
12
- [ 'modern', '#3858e9' ],
13
- [ 'blue', '#096484' ],
14
- [ 'coffee', '#46403c' ],
15
- [ 'ectoplasm', '#523f6d' ],
16
- [ 'midnight', '#e14d43' ],
17
- [ 'ocean', '#627c83' ],
18
- [ 'sunrise', '#dd823b' ],
19
- ] );
20
-
21
- export function getAdminThemePrimaryColor(): string | undefined {
22
- const theme =
23
- document.body.className.match( /admin-color-([a-z]+)/ )?.[ 1 ];
24
-
25
- return theme && THEME_PRIMARY_COLORS.get( theme );
26
- }
27
-
28
- export function UserThemeProvider( {
29
- color,
30
- ...restProps
31
- }: React.ComponentProps< typeof ThemeProvider > ) {
32
- const primary = getAdminThemePrimaryColor();
33
-
34
- return <ThemeProvider { ...restProps } color={ { primary, ...color } } />;
35
- }
@@ -1,11 +0,0 @@
1
- import { getAdminThemePrimaryColor } from '../index';
2
-
3
- describe( 'getAdminThemePrimaryColor', () => {
4
- it( 'should return the primary color for the admin theme from the body class', () => {
5
- document.body.className = 'foo admin-color-coffee bar';
6
-
7
- const primaryColor = getAdminThemePrimaryColor();
8
-
9
- expect( primaryColor ).toBe( '#46403c' );
10
- } );
11
- } );