@wordpress/boot 0.3.1-next.738bb1424.0 → 0.4.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 (48) hide show
  1. package/build-module/components/app/index.js +3 -3
  2. package/build-module/components/app/router.js +39 -42
  3. package/build-module/components/app/router.js.map +2 -2
  4. package/build-module/components/app/use-route-title.js +1 -1
  5. package/build-module/components/canvas/back-button.js +1 -1
  6. package/build-module/components/canvas/index.js +1 -1
  7. package/build-module/components/canvas-renderer/index.js +1 -1
  8. package/build-module/components/navigation/drilldown-item/index.js +1 -1
  9. package/build-module/components/navigation/dropdown-item/index.js +3 -3
  10. package/build-module/components/navigation/index.js +6 -6
  11. package/build-module/components/navigation/navigation-item/index.js +2 -2
  12. package/build-module/components/navigation/router-link-item.js +1 -1
  13. package/build-module/components/navigation/use-sidebar-parent.js +3 -3
  14. package/build-module/components/root/index.js +112 -102
  15. package/build-module/components/root/index.js.map +2 -2
  16. package/build-module/components/root/single-page.js +17 -11
  17. package/build-module/components/root/single-page.js.map +2 -2
  18. package/build-module/components/save-button/index.js +1 -1
  19. package/build-module/components/save-panel/index.js +1 -1
  20. package/build-module/components/sidebar/index.js +3 -3
  21. package/build-module/components/site-hub/index.js +10 -28
  22. package/build-module/components/site-hub/index.js.map +2 -2
  23. package/build-module/components/site-icon-link/index.js +2 -2
  24. package/build-module/index.js +62 -20
  25. package/build-module/index.js.map +2 -2
  26. package/build-module/store/index.js +3 -3
  27. package/build-style/style-rtl.css +59 -17
  28. package/build-style/style.css +59 -17
  29. package/build-types/components/app/router.d.ts.map +1 -1
  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/site-hub/index.d.ts.map +1 -1
  33. package/package.json +22 -30
  34. package/src/components/app/router.tsx +51 -54
  35. package/src/components/root/index.tsx +46 -44
  36. package/src/components/root/single-page.tsx +19 -18
  37. package/src/components/root/style.scss +0 -1
  38. package/src/components/site-hub/index.tsx +1 -6
  39. package/src/components/site-hub/style.scss +6 -21
  40. package/src/style.scss +34 -19
  41. package/tsconfig.json +27 -0
  42. package/tsconfig.tsbuildinfo +1 -0
  43. package/build-module/components/user-theme-provider/index.js +0 -33
  44. package/build-module/components/user-theme-provider/index.js.map +0 -7
  45. package/build-types/components/user-theme-provider/index.d.ts +0 -6
  46. package/build-types/components/user-theme-provider/index.d.ts.map +0 -1
  47. package/src/components/user-theme-provider/index.tsx +0 -35
  48. package/src/components/user-theme-provider/test/index.test.ts +0 -11
@@ -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.js";
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.js.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
- } );