@phis/ui 0.5.2 → 0.5.3
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/README.md +1 -1
- package/components/controls/phi-border-control.js +1 -1
- package/components/controls/phi-bound-radius-control.js +9 -9
- package/components/controls/phi-brand-control.js +1 -1
- package/components/controls/phi-drawer-control-adapter.js +4 -4
- package/components/controls/phi-dropdown-control.js +2 -2
- package/components/controls/phi-form-control.js +1 -1
- package/components/controls/phi-image-control.js +1 -1
- package/components/controls/phi-mask-picker-control.js +6 -6
- package/components/controls/phi-select-control.js +1 -1
- package/components/controls/phi-theme-scope-control.js +1 -1
- package/components/controls/use-phi-color-control-presets.js +2 -2
- package/components/forms/compound-form-controls.js +2 -2
- package/components/forms/extended-form-field-controls.js +1 -1
- package/components/forms/shared-form-provider-registry.js +2 -2
- package/components/layouts/clients/phi-flex-layout-client.js +4 -4
- package/components/layouts/clients/phi-grid-layout-client.js +3 -3
- package/components/layouts/clients/phi-sequence-slot-editor.js +1 -1
- package/components/layouts/layout-definitions.d.ts +4 -4
- package/components/layouts/phi-page-region-layout.js +1 -1
- package/components/layouts/phi-structure-region-layout.js +3 -3
- package/components/media/phi-asset-focal-rect-widget.js +4 -4
- package/components/media/phi-asset-inspector-section.js +1 -1
- package/components/media/phi-media-kind-icon.js +2 -2
- package/components/media/phi-media-restricted-icon.js +1 -1
- package/components/overlays/phi-overlay-container-client.js +1 -1
- package/components/regions/presets/phi-base-page-column.js +6 -2
- package/components/root/phi-config-provider.js +1 -1
- package/components/root/phi-root-background.js +1 -1
- package/components/root/phi-root-theme-resolver.js +1 -1
- package/components/shell/phi-module-icons.js +1 -1
- package/components/widgets/built-in/builder-workspace-preview.js +8 -8
- package/components/widgets/client/bullet-list-entries-editor.js +2 -2
- package/components/widgets/client/external-document-editor.js +1 -1
- package/components/widgets/client/html-editor.js +3 -3
- package/components/widgets/config/background.d.ts +1 -1
- package/components/widgets/config/background.js +1 -1
- package/components/widgets/inspector-field-row.js +1 -1
- package/components/widgets/label-sets/inspector.js +2 -0
- package/components/widgets/label-types/inspector.d.ts +1 -0
- package/components/widgets/label-types/inspector.js +1 -0
- package/components/widgets/shared/card-body-client.js +1 -1
- package/components/widgets/shared/result-body-client.js +1 -1
- package/constants/media-library-provider-keys.d.ts +8 -1
- package/constants/media-library-provider-keys.js +8 -1
- package/constants/record-field-kinds.d.ts +6 -0
- package/constants/record-field-kinds.js +7 -0
- package/constants/runtime-module-ownership.js +1 -1
- package/helpers/border-widget-style.d.ts +2 -2
- package/helpers/border-widget-style.js +2 -2
- package/helpers/cms-dialog.d.ts +4 -4
- package/helpers/cms-layout-defaults.d.ts +2 -2
- package/helpers/cms-page-catalog.d.ts +5 -0
- package/helpers/cms-preset-page-tree.d.ts +4 -0
- package/helpers/cms-preset-page-tree.js +2 -0
- package/helpers/layout-style.d.ts +2 -2
- package/helpers/page-layout-check.d.ts +4 -1
- package/helpers/page-layout-check.js +26 -0
- package/helpers/record-fields.d.ts +9 -0
- package/helpers/record-fields.js +84 -0
- package/helpers/surface-presets.d.ts +6 -6
- package/helpers/surface-style.d.ts +1 -1
- package/helpers.d.ts +0 -1
- package/helpers.js +0 -2
- package/module-page-check.d.ts +12 -0
- package/module-page-check.js +12 -0
- package/module-records.d.ts +4 -2
- package/module-records.js +3 -1
- package/next/antd-form-context-loader.mjs +31 -0
- package/next/config.d.mts +2 -0
- package/next/config.mjs +36 -3
- package/package.json +10 -1
- package/plugins/runtime-modules/asset/data-providers.d.ts +0 -65
- package/plugins/runtime-modules/asset/data-providers.js +0 -40
- package/plugins/runtime-modules/asset/definition.d.ts +0 -60
- package/plugins/runtime-modules/asset/ids.d.ts +0 -1
- package/plugins/runtime-modules/asset/ids.js +1 -2
- package/plugins/runtime-modules/asset/presets.d.ts +1 -0
- package/plugins/runtime-modules/asset/server.js +0 -5
- package/plugins/runtime-modules/blog/presets.d.ts +1 -0
- package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +4 -1
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +13 -4
- package/plugins/runtime-modules/builder/clients/inspector-link-target-field.js +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +14 -1
- package/plugins/runtime-modules/builder/clients/inspector-signal-section.js +2 -2
- package/plugins/runtime-modules/builder/clients/layout-inspector.js +1 -1
- package/plugins/runtime-modules/builder/clients/layout-scaffold-buttons.js +4 -4
- package/plugins/runtime-modules/builder/clients/layout-scaffold-overlays.js +1 -1
- package/plugins/runtime-modules/builder/clients/region-inspector.js +1 -1
- package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
- package/plugins/runtime-modules/builder/clients/shells-workspace.js +1 -1
- package/plugins/runtime-modules/builder/clients/structure-canvas.js +2 -2
- package/plugins/runtime-modules/builder/clients/widget-effects-editor.js +1 -1
- package/plugins/runtime-modules/builder/clients/widget-inspector.d.ts +4 -1
- package/plugins/runtime-modules/builder/clients/widget-inspector.js +3 -2
- package/plugins/runtime-modules/builder/page-presets.server.d.ts +6 -0
- package/plugins/runtime-modules/builder/page-presets.server.js +8 -0
- package/plugins/runtime-modules/builder/pages-workspace.js +12 -1
- package/plugins/runtime-modules/builder/render-root-node-scaffold.js +5 -5
- package/plugins/runtime-modules/builder/structure-dnd.js +2 -2
- package/plugins/runtime-modules/builder/widgets/test-block/client.js +1 -1
- package/plugins/runtime-modules/content-entry-routes.d.ts +1 -0
- package/plugins/runtime-modules/contracts.d.ts +1 -1
- package/plugins/runtime-modules/contracts.js +41 -1
- package/plugins/runtime-modules/core/data-providers.d.ts +60 -0
- package/plugins/runtime-modules/core/data-providers.js +41 -0
- package/plugins/runtime-modules/core/definition.d.ts +55 -0
- package/plugins/runtime-modules/core/server.js +5 -0
- package/plugins/runtime-modules/core/widgets/button/config.d.ts +34 -0
- package/plugins/runtime-modules/core/widgets/button/config.js +16 -0
- package/plugins/runtime-modules/core/widgets/button/plugin.js +37 -6
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +13 -2
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +13 -2
- package/plugins/runtime-modules/core/widgets/description/editor.js +13 -13
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +11 -0
- package/plugins/runtime-modules/core/widgets/gallery/client.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/gallery/client.js +29 -21
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +16 -0
- package/plugins/runtime-modules/core/widgets/gallery/config.js +16 -0
- package/plugins/runtime-modules/core/widgets/gallery/server.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/gallery/server.js +11 -0
- package/plugins/runtime-modules/core/widgets/image/config.d.ts +35 -0
- package/plugins/runtime-modules/core/widgets/image/config.js +8 -0
- package/plugins/runtime-modules/core/widgets/image/plugin.js +19 -1
- package/plugins/runtime-modules/core/widgets/image/server.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/image/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +13 -0
- package/plugins/runtime-modules/core/widgets/markdown/config.js +8 -0
- package/plugins/runtime-modules/core/widgets/markdown/editor.js +7 -7
- package/plugins/runtime-modules/core/widgets/markdown/plugin.js +20 -7
- package/plugins/runtime-modules/core/widgets/record/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +11 -0
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +13 -0
- package/plugins/runtime-modules/core/widgets/simple-text/config.js +9 -0
- package/plugins/runtime-modules/core/widgets/simple-text/editor.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/plugin.js +14 -1
- package/plugins/runtime-modules/core/widgets/spacer/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +37 -0
- package/plugins/runtime-modules/descriptor-compiler.js +8 -0
- package/plugins/runtime-modules/editor/presets.d.ts +1 -0
- package/plugins/runtime-modules/groups/definition.d.ts +1 -1
- package/plugins/runtime-modules/localization/presets.d.ts +1 -0
- package/plugins/runtime-modules/news/presets.d.ts +1 -0
- package/plugins/runtime-modules/resolver.js +2 -0
- package/plugins/runtime-modules/revisions/presets.d.ts +1 -0
- package/plugins/runtime-modules/theme/presets.d.ts +1 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +25 -2
- package/server-helpers/cms-page-record.d.ts +26 -0
- package/server-helpers/cms-page-record.js +42 -0
- package/server-helpers/cms-request.js +48 -4
- package/server-helpers/record-fields.d.ts +62 -0
- package/server-helpers/record-fields.js +87 -0
- package/server-helpers/record-samples.d.ts +21 -0
- package/server-helpers/record-samples.js +41 -0
- package/styles/builder-scaffold.css +19 -19
- package/styles/controls.css +109 -109
- package/styles/gradients.css +23 -23
- package/styles/layout-affordances.css +15 -15
- package/styles/layout-authoring-scaffold.css +20 -20
- package/styles/layout.css +9 -9
- package/styles/root.css +4 -4
- package/styles/shell.css +48 -17
- package/theme/antd-css-var-contract.d.ts +86 -80
- package/theme/antd-css-var-contract.js +92 -81
- package/theme/phi-control-shape.d.ts +1 -1
- package/theme/phi-theme-gradients.d.ts +2 -2
- package/theme/phi-theme-gradients.js +14 -14
- package/theme/phi-theme-palette.d.ts +1 -1
- package/theme/phi-theme-palette.js +2 -2
- package/theme/phi-theme-tokens.d.ts +8 -5
- package/theme/phi-theme-tokens.js +59 -28
- package/theme/phi-theme.d.ts +14 -2
- package/theme/phi-theme.js +14 -1
- package/theme/phi-tokens.d.ts +5 -0
- package/theme/phi-tokens.js +9 -0
- package/types/cms-module-descriptors.d.ts +6 -0
- package/types/cms-plugins.d.ts +19 -1
- package/types/core-widget-placements.d.ts +10 -0
- package/types/record-provider.d.ts +92 -0
- package/types/widget-runtime.d.ts +5 -0
- /package/plugins/runtime-modules/{asset/services/folder-images.server.d.ts → core/services/media-folder-images.server.d.ts} +0 -0
- /package/plugins/runtime-modules/{asset/services/folder-images.server.js → core/services/media-folder-images.server.js} +0 -0
|
@@ -9,112 +9,123 @@ export const PHI_COLOR = {
|
|
|
9
9
|
* The primary colour's ladder, as the Theme derives it per mode -- the same ten the colour picker offers
|
|
10
10
|
* as the Theme's primary swatches, so a colour picked there is stored as its role and follows the Theme.
|
|
11
11
|
*/
|
|
12
|
-
primaryBg: "var(--
|
|
13
|
-
primaryBgHover: "var(--
|
|
14
|
-
primaryBorder: "var(--
|
|
15
|
-
primaryBorderHover: "var(--
|
|
16
|
-
primaryHover: "var(--
|
|
17
|
-
primary: "var(--
|
|
18
|
-
primaryActive: "var(--
|
|
19
|
-
primaryTextHover: "var(--
|
|
20
|
-
primaryText: "var(--
|
|
21
|
-
primaryTextActive: "var(--
|
|
22
|
-
link: "var(--
|
|
23
|
-
linkHover: "var(--
|
|
12
|
+
primaryBg: "var(--phi-color-primary-bg)",
|
|
13
|
+
primaryBgHover: "var(--phi-color-primary-bg-hover)",
|
|
14
|
+
primaryBorder: "var(--phi-color-primary-border)",
|
|
15
|
+
primaryBorderHover: "var(--phi-color-primary-border-hover)",
|
|
16
|
+
primaryHover: "var(--phi-color-primary-hover)",
|
|
17
|
+
primary: "var(--phi-color-primary)",
|
|
18
|
+
primaryActive: "var(--phi-color-primary-active)",
|
|
19
|
+
primaryTextHover: "var(--phi-color-primary-text-hover)",
|
|
20
|
+
primaryText: "var(--phi-color-primary-text)",
|
|
21
|
+
primaryTextActive: "var(--phi-color-primary-text-active)",
|
|
22
|
+
link: "var(--phi-color-link)",
|
|
23
|
+
linkHover: "var(--phi-color-link-hover)",
|
|
24
24
|
/* The text ladder, likewise the picker's text swatches. */
|
|
25
|
-
textBase: "var(--
|
|
26
|
-
text: "var(--
|
|
27
|
-
textSecondary: "var(--
|
|
28
|
-
textTertiary: "var(--
|
|
29
|
-
textQuaternary: "var(--
|
|
30
|
-
textHeading: "var(--
|
|
31
|
-
textLabel: "var(--
|
|
32
|
-
textDescription: "var(--
|
|
33
|
-
textPlaceholder: "var(--
|
|
34
|
-
textDisabled: "var(--
|
|
35
|
-
textLightSolid: "var(--
|
|
36
|
-
bgContainer: "var(--
|
|
37
|
-
bgLayout: "var(--
|
|
38
|
-
bgElevated: "var(--
|
|
39
|
-
bgSpotlight: "var(--
|
|
40
|
-
fill: "var(--
|
|
41
|
-
fillSecondary: "var(--
|
|
42
|
-
fillTertiary: "var(--
|
|
43
|
-
fillQuaternary: "var(--
|
|
44
|
-
border: "var(--
|
|
45
|
-
borderSecondary: "var(--
|
|
46
|
-
linkActive: "var(--
|
|
47
|
-
split: "var(--
|
|
48
|
-
error: "var(--
|
|
49
|
-
success: "var(--
|
|
50
|
-
warning: "var(--
|
|
25
|
+
textBase: "var(--phi-color-text-base)",
|
|
26
|
+
text: "var(--phi-color-text)",
|
|
27
|
+
textSecondary: "var(--phi-color-text-secondary)",
|
|
28
|
+
textTertiary: "var(--phi-color-text-tertiary)",
|
|
29
|
+
textQuaternary: "var(--phi-color-text-quaternary)",
|
|
30
|
+
textHeading: "var(--phi-color-text-heading)",
|
|
31
|
+
textLabel: "var(--phi-color-text-label)",
|
|
32
|
+
textDescription: "var(--phi-color-text-description)",
|
|
33
|
+
textPlaceholder: "var(--phi-color-text-placeholder)",
|
|
34
|
+
textDisabled: "var(--phi-color-text-disabled)",
|
|
35
|
+
textLightSolid: "var(--phi-color-text-light-solid)",
|
|
36
|
+
bgContainer: "var(--phi-color-bg-container)",
|
|
37
|
+
bgLayout: "var(--phi-color-bg-layout)",
|
|
38
|
+
bgElevated: "var(--phi-color-bg-elevated)",
|
|
39
|
+
bgSpotlight: "var(--phi-color-bg-spotlight)",
|
|
40
|
+
fill: "var(--phi-color-fill)",
|
|
41
|
+
fillSecondary: "var(--phi-color-fill-secondary)",
|
|
42
|
+
fillTertiary: "var(--phi-color-fill-tertiary)",
|
|
43
|
+
fillQuaternary: "var(--phi-color-fill-quaternary)",
|
|
44
|
+
border: "var(--phi-color-border)",
|
|
45
|
+
borderSecondary: "var(--phi-color-border-secondary)",
|
|
46
|
+
linkActive: "var(--phi-color-link-active)",
|
|
47
|
+
split: "var(--phi-color-split)",
|
|
48
|
+
error: "var(--phi-color-error)",
|
|
49
|
+
success: "var(--phi-color-success)",
|
|
50
|
+
warning: "var(--phi-color-warning)",
|
|
51
51
|
/*
|
|
52
52
|
* The palette's ten custom colours, per mode, written by the Theme as tokens of its own
|
|
53
|
-
* (`
|
|
53
|
+
* (`custom1` ... `custom10`, theme/phi-theme-palette.ts).
|
|
54
54
|
*/
|
|
55
|
-
custom1: "var(--
|
|
56
|
-
custom2: "var(--
|
|
57
|
-
custom3: "var(--
|
|
58
|
-
custom4: "var(--
|
|
59
|
-
custom5: "var(--
|
|
60
|
-
custom6: "var(--
|
|
61
|
-
custom7: "var(--
|
|
62
|
-
custom8: "var(--
|
|
63
|
-
custom9: "var(--
|
|
64
|
-
custom10: "var(--
|
|
55
|
+
custom1: "var(--phi-custom-1)",
|
|
56
|
+
custom2: "var(--phi-custom-2)",
|
|
57
|
+
custom3: "var(--phi-custom-3)",
|
|
58
|
+
custom4: "var(--phi-custom-4)",
|
|
59
|
+
custom5: "var(--phi-custom-5)",
|
|
60
|
+
custom6: "var(--phi-custom-6)",
|
|
61
|
+
custom7: "var(--phi-custom-7)",
|
|
62
|
+
custom8: "var(--phi-custom-8)",
|
|
63
|
+
custom9: "var(--phi-custom-9)",
|
|
64
|
+
custom10: "var(--phi-custom-10)",
|
|
65
65
|
};
|
|
66
66
|
/**
|
|
67
67
|
* Every distance a Phi surface states, inside a frame (`padding`) and between two things (`gap`), on the
|
|
68
|
-
* one scale (`theme/phi-tokens.ts`, `PHI_PADDING`). Ant Design's `--
|
|
68
|
+
* one scale (`theme/phi-tokens.ts`, `PHI_PADDING`). Ant Design's `--phi-margin-*` family carries the
|
|
69
69
|
* same values and stays Ant Design's own.
|
|
70
70
|
*/
|
|
71
71
|
export const PHI_SPACE = {
|
|
72
|
-
xxs: "var(--
|
|
73
|
-
xs: "var(--
|
|
74
|
-
sm: "var(--
|
|
75
|
-
base: "var(--
|
|
76
|
-
md: "var(--
|
|
77
|
-
lg: "var(--
|
|
78
|
-
xl: "var(--
|
|
79
|
-
xxl: "var(--
|
|
72
|
+
xxs: "var(--phi-padding-xxs)",
|
|
73
|
+
xs: "var(--phi-padding-xs)",
|
|
74
|
+
sm: "var(--phi-padding-sm)",
|
|
75
|
+
base: "var(--phi-padding)",
|
|
76
|
+
md: "var(--phi-padding-md)",
|
|
77
|
+
lg: "var(--phi-padding-lg)",
|
|
78
|
+
xl: "var(--phi-padding-xl)",
|
|
79
|
+
xxl: "var(--phi-padding-xxl)",
|
|
80
80
|
};
|
|
81
81
|
/**
|
|
82
|
-
* How wide a Page may get: the Theme's `
|
|
82
|
+
* How wide a Page may get: the Theme's `pageMax` (theme/phi-tokens.ts, `PHI_LAYOUT.pageMax`).
|
|
83
83
|
*
|
|
84
84
|
* A Page states this reference and not the number, so the Theme's answer reaches every Page, an edited
|
|
85
85
|
* copy included -- a number written into a preset tree stays what it was the day the copy was made.
|
|
86
86
|
*/
|
|
87
87
|
export const PHI_PAGE = {
|
|
88
|
-
max: "var(--
|
|
88
|
+
max: "var(--phi-page-max)",
|
|
89
|
+
/*
|
|
90
|
+
* How far a Page's content stands in, per side: the Theme's `pagePadding<Side><Band>` for the band the
|
|
91
|
+
* screen is in, chosen by styles/shell.css ("Page inset"). Outside a Shell, where no band is chosen,
|
|
92
|
+
* the desktop answer.
|
|
93
|
+
*/
|
|
94
|
+
padding: {
|
|
95
|
+
top: "var(--phi-page-inset-top, var(--phi-page-padding-top-desktop))",
|
|
96
|
+
right: "var(--phi-page-inset-right, var(--phi-page-padding-right-desktop))",
|
|
97
|
+
bottom: "var(--phi-page-inset-bottom, var(--phi-page-padding-bottom-desktop))",
|
|
98
|
+
left: "var(--phi-page-inset-left, var(--phi-page-padding-left-desktop))",
|
|
99
|
+
},
|
|
89
100
|
};
|
|
90
101
|
export const PHI_RADIUS = {
|
|
91
|
-
xxs: "var(--
|
|
92
|
-
xs: "var(--
|
|
93
|
-
sm: "var(--
|
|
94
|
-
base: "var(--
|
|
95
|
-
md: "var(--
|
|
96
|
-
lg: "var(--
|
|
97
|
-
xl: "var(--
|
|
98
|
-
xxl: "var(--
|
|
102
|
+
xxs: "var(--phi-border-radius-xs)",
|
|
103
|
+
xs: "var(--phi-border-radius-sm)",
|
|
104
|
+
sm: "var(--phi-border-radius)",
|
|
105
|
+
base: "var(--phi-border-radius-lg)",
|
|
106
|
+
md: "var(--phi-border-radius-lg)",
|
|
107
|
+
lg: "var(--phi-border-radius-lg)",
|
|
108
|
+
xl: "var(--phi-border-radius-outer)",
|
|
109
|
+
xxl: "var(--phi-border-radius-outer)",
|
|
99
110
|
};
|
|
100
111
|
export const PHI_CONTROL = {
|
|
101
|
-
sm: "var(--
|
|
102
|
-
md: "var(--
|
|
103
|
-
lg: "var(--
|
|
112
|
+
sm: "var(--phi-control-height-sm)",
|
|
113
|
+
md: "var(--phi-control-height)",
|
|
114
|
+
lg: "var(--phi-control-height-lg)",
|
|
104
115
|
};
|
|
105
116
|
export const PHI_SHADOW = {
|
|
106
|
-
primary: "var(--
|
|
107
|
-
secondary: "var(--
|
|
108
|
-
tertiary: "var(--
|
|
117
|
+
primary: "var(--phi-box-shadow)",
|
|
118
|
+
secondary: "var(--phi-box-shadow-secondary)",
|
|
119
|
+
tertiary: "var(--phi-box-shadow-tertiary)",
|
|
109
120
|
};
|
|
110
121
|
export const PHI_FONT_SIZE = {
|
|
111
|
-
base: "var(--
|
|
112
|
-
sm: "var(--
|
|
113
|
-
lg: "var(--
|
|
114
|
-
xl: "var(--
|
|
115
|
-
heading2: "var(--
|
|
116
|
-
heading4: "var(--
|
|
117
|
-
heading3: "var(--
|
|
122
|
+
base: "var(--phi-font-size)",
|
|
123
|
+
sm: "var(--phi-font-size-sm)",
|
|
124
|
+
lg: "var(--phi-font-size-lg)",
|
|
125
|
+
xl: "var(--phi-font-size-xl)",
|
|
126
|
+
heading2: "var(--phi-font-size-heading-2)",
|
|
127
|
+
heading4: "var(--phi-font-size-heading-4)",
|
|
128
|
+
heading3: "var(--phi-font-size-heading-3)",
|
|
118
129
|
};
|
|
119
130
|
export const PHI_LINE_HEIGHT = {
|
|
120
131
|
base: 1.5,
|
|
@@ -75,7 +75,7 @@ export declare function resolvePhiControlShapeRadius(shape: PhiControlShape, tok
|
|
|
75
75
|
/**
|
|
76
76
|
* Custom properties `styles/control-shape.css` reads. They carry the resolved numbers rather than a
|
|
77
77
|
* reference to an adapter token so a nested preview -- which runs its own draft scale through a plain
|
|
78
|
-
* `ConfigProvider` and therefore never redefines the ambient `--
|
|
78
|
+
* `ConfigProvider` and therefore never redefines the ambient `--phi-border-radius-*` -- still resolves
|
|
79
79
|
* its OWN shape. Inheritance is also what makes nesting work at all: two rules that both match a
|
|
80
80
|
* Control tie on specificity and source order decides, while an inherited custom property is always
|
|
81
81
|
* taken from the nearest ancestor that declares it.
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* palette states each slot per mode (`modes[mode].gradients`), and a slot it leaves out is derived from
|
|
8
8
|
* the mode's own colours, which is what lets every Theme offer all three without anybody drawing them.
|
|
9
9
|
*
|
|
10
|
-
* They reach the page as Ant Design tokens -- `
|
|
11
|
-
* writes every token as a custom property under the Theme's class (`--
|
|
10
|
+
* They reach the page as Ant Design tokens -- `gradient1` and its `gradient1Text` -- and Ant Design
|
|
11
|
+
* writes every token as a custom property under the Theme's class (`--phi-gradient-1`). That is the
|
|
12
12
|
* whole transport: the root writes both modes, a Surface tone writes its own mode on its box, and the
|
|
13
13
|
* Theme workspace's preview writes the draft's, so a control that reads the property is in the right mode
|
|
14
14
|
* wherever it stands without asking which one that is.
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* palette states each slot per mode (`modes[mode].gradients`), and a slot it leaves out is derived from
|
|
8
8
|
* the mode's own colours, which is what lets every Theme offer all three without anybody drawing them.
|
|
9
9
|
*
|
|
10
|
-
* They reach the page as Ant Design tokens -- `
|
|
11
|
-
* writes every token as a custom property under the Theme's class (`--
|
|
10
|
+
* They reach the page as Ant Design tokens -- `gradient1` and its `gradient1Text` -- and Ant Design
|
|
11
|
+
* writes every token as a custom property under the Theme's class (`--phi-gradient-1`). That is the
|
|
12
12
|
* whole transport: the root writes both modes, a Surface tone writes its own mode on its box, and the
|
|
13
13
|
* Theme workspace's preview writes the draft's, so a control that reads the property is in the right mode
|
|
14
14
|
* wherever it stands without asking which one that is.
|
|
@@ -55,18 +55,18 @@ function serializePhiThemeGradientCss(gradient) {
|
|
|
55
55
|
return `linear-gradient(${gradient.direction}, ${gradient.stops.map((stop) => `${stop.color} ${stop.percent}%`).join(", ")})`;
|
|
56
56
|
}
|
|
57
57
|
/*
|
|
58
|
-
* The custom properties, named the way Ant Design names a token's (`token2CSSVar`): `
|
|
59
|
-
* becomes `--
|
|
58
|
+
* The custom properties, named the way Ant Design names a token's (`token2CSSVar`): `gradient1Text`
|
|
59
|
+
* becomes `--phi-gradient-1-text`. Stated once so CSS and controls never spell them differently.
|
|
60
60
|
*/
|
|
61
61
|
const PHI_THEME_GRADIENT_TOKEN_NAMES = {
|
|
62
|
-
gradient1: { paint: "
|
|
63
|
-
gradient2: { paint: "
|
|
64
|
-
gradient3: { paint: "
|
|
62
|
+
gradient1: { paint: "gradient1", text: "gradient1Text" },
|
|
63
|
+
gradient2: { paint: "gradient2", text: "gradient2Text" },
|
|
64
|
+
gradient3: { paint: "gradient3", text: "gradient3Text" },
|
|
65
65
|
};
|
|
66
66
|
export const PHI_THEME_GRADIENT_CSS_VARS = {
|
|
67
|
-
gradient1: { paint: "--
|
|
68
|
-
gradient2: { paint: "--
|
|
69
|
-
gradient3: { paint: "--
|
|
67
|
+
gradient1: { paint: "--phi-gradient-1", text: "--phi-gradient-1-text" },
|
|
68
|
+
gradient2: { paint: "--phi-gradient-2", text: "--phi-gradient-2-text" },
|
|
69
|
+
gradient3: { paint: "--phi-gradient-3", text: "--phi-gradient-3-text" },
|
|
70
70
|
};
|
|
71
71
|
/*
|
|
72
72
|
* The primary Buttons' run when the Theme gives them one, with the filter each pressed state lays over
|
|
@@ -76,10 +76,10 @@ export const PHI_THEME_GRADIENT_CSS_VARS = {
|
|
|
76
76
|
* flickered as the pointer left -- where a filter eases.
|
|
77
77
|
*/
|
|
78
78
|
const PHI_PRIMARY_BUTTON_GRADIENT_TOKENS = {
|
|
79
|
-
paint: "
|
|
80
|
-
hover: "
|
|
81
|
-
active: "
|
|
82
|
-
text: "
|
|
79
|
+
paint: "primaryButtonGradient",
|
|
80
|
+
hover: "primaryButtonGradientHover",
|
|
81
|
+
active: "primaryButtonGradientActive",
|
|
82
|
+
text: "primaryButtonGradientText",
|
|
83
83
|
};
|
|
84
84
|
/** A run a little lighter under the pointer, a little darker while it is pressed. */
|
|
85
85
|
export const PHI_GRADIENT_HOVER_FILTER = "brightness(1.18) saturate(1.15)";
|
|
@@ -15,7 +15,7 @@ export declare function resolvePhiThemePaletteCustomColors(palette: PhiThemePale
|
|
|
15
15
|
export declare function resolvePhiPublishedThemeCustomColors(siteTheme: PhiThemeCustomColorSource, mode: PhiThemeMode, presets: readonly PhiThemePresetPlugin[]): PhiThemeCustomColorPalette;
|
|
16
16
|
/**
|
|
17
17
|
* The custom colours of one mode as tokens of the Theme's own, laid over the resolved ones like the
|
|
18
|
-
* gradient slots, so Ant Design writes them per mode and per Surface tone (`--
|
|
18
|
+
* gradient slots, so Ant Design writes them per mode and per Surface tone (`--phi-custom-1` ...) and a
|
|
19
19
|
* config can name one by its role (`PHI_COLOR.custom1`) instead of copying its value.
|
|
20
20
|
*/
|
|
21
21
|
export declare function buildPhiThemeCustomColorTokens(palette: PhiThemePalette | null | undefined, mode: PhiThemeMode): Record<string, string>;
|
|
@@ -32,11 +32,11 @@ export function resolvePhiPublishedThemeCustomColors(siteTheme, mode, presets) {
|
|
|
32
32
|
}
|
|
33
33
|
/** The token a custom colour rides as, and so the custom property Ant Design writes for it. */
|
|
34
34
|
function resolvePhiThemeCustomColorTokenName(key) {
|
|
35
|
-
return `
|
|
35
|
+
return `custom${key.slice("custom".length)}`;
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* The custom colours of one mode as tokens of the Theme's own, laid over the resolved ones like the
|
|
39
|
-
* gradient slots, so Ant Design writes them per mode and per Surface tone (`--
|
|
39
|
+
* gradient slots, so Ant Design writes them per mode and per Surface tone (`--phi-custom-1` ...) and a
|
|
40
40
|
* config can name one by its role (`PHI_COLOR.custom1`) instead of copying its value.
|
|
41
41
|
*/
|
|
42
42
|
export function buildPhiThemeCustomColorTokens(palette, mode) {
|
|
@@ -27,7 +27,7 @@ export declare const PHI_THEME_TOKEN_KEYS: readonly ["colorBgContainer", "colorB
|
|
|
27
27
|
* The names this house adds to Ant Design's set.
|
|
28
28
|
*
|
|
29
29
|
* `buildPhiThemeTokens` hands Ant Design the whole structural scale, `paddingXXL` included, and the
|
|
30
|
-
* cssVar pass emits a variable for every token it is given -- so `--
|
|
30
|
+
* cssVar pass emits a variable for every token it is given -- so `--phi-padding-xxl` is on the page
|
|
31
31
|
* even though `AliasToken` has no such field. The name is therefore real, usable from CSS, and
|
|
32
32
|
* invisible to the type, which is exactly why it has to be stated somewhere.
|
|
33
33
|
*
|
|
@@ -35,15 +35,18 @@ export declare const PHI_THEME_TOKEN_KEYS: readonly ["colorBgContainer", "colorB
|
|
|
35
35
|
* Design's type and a name Ant Design does not know cannot be cut from it. A Client Component that
|
|
36
36
|
* needs one of these reads it as a CSS variable, the way a Server Component does.
|
|
37
37
|
*
|
|
38
|
-
* `
|
|
38
|
+
* `pageMax` is how wide a Page may get (theme/phi-tokens.ts, `PHI_LAYOUT.pageMax`); a Page reads it
|
|
39
39
|
* as `PHI_PAGE.max`.
|
|
40
40
|
*
|
|
41
|
-
* The `
|
|
41
|
+
* The `gradient*` names are the Theme's gradient slots and the primary Buttons' run
|
|
42
42
|
* (theme/phi-theme-gradients.ts): tokens of this package's own, laid over the resolved ones so Ant
|
|
43
|
-
* Design writes them per mode and per Surface tone like every other. The `
|
|
43
|
+
* Design writes them per mode and per Surface tone like every other. The `custom*` names are the
|
|
44
44
|
* palette's custom colours, laid over the same way (theme/phi-theme-palette.ts).
|
|
45
45
|
*/
|
|
46
|
-
export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "
|
|
46
|
+
export declare const PHI_THEME_OWN_TOKEN_KEYS: readonly ["paddingXXL", "pageMax", "pagePaddingTopPhone", "pagePaddingRightPhone", "pagePaddingBottomPhone", "pagePaddingLeftPhone", "pagePaddingTopTablet", "pagePaddingRightTablet", "pagePaddingBottomTablet", "pagePaddingLeftTablet", "pagePaddingTopDesktop", "pagePaddingRightDesktop", "pagePaddingBottomDesktop", "pagePaddingLeftDesktop", "gradient1", "gradient1Text", "gradient2", "gradient2Text", "gradient3", "gradient3Text", "primaryButtonGradient", "primaryButtonGradientHover", "primaryButtonGradientActive", "primaryButtonGradientText", "custom1", "custom2", "custom3", "custom4", "custom5", "custom6", "custom7", "custom8", "custom9", "custom10"];
|
|
47
|
+
/** The Page inset's names, per band and side (`PHI_LAYOUT.pagePadding`, `PHI_PAGE.padding`). */
|
|
48
|
+
export declare const PHI_THEME_PAGE_PADDING_BANDS: readonly ["Phone", "Tablet", "Desktop"];
|
|
49
|
+
export declare const PHI_THEME_PAGE_PADDING_SIDES: readonly ["Top", "Right", "Bottom", "Left"];
|
|
47
50
|
export type PhiThemeTokenKey = (typeof PHI_THEME_TOKEN_KEYS)[number];
|
|
48
51
|
/**
|
|
49
52
|
* The resolved Theme, in the names above and their Ant Design value types.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PHI_SPACE } from "./antd-css-var-contract";
|
|
1
2
|
import { PHI_CONTAINER_BREAKPOINT_REGION } from "./phi-container-breakpoints";
|
|
2
3
|
/**
|
|
3
4
|
* The token vocabulary of this house, stated once.
|
|
@@ -158,7 +159,7 @@ export const PHI_THEME_TOKEN_KEYS = [
|
|
|
158
159
|
* The names this house adds to Ant Design's set.
|
|
159
160
|
*
|
|
160
161
|
* `buildPhiThemeTokens` hands Ant Design the whole structural scale, `paddingXXL` included, and the
|
|
161
|
-
* cssVar pass emits a variable for every token it is given -- so `--
|
|
162
|
+
* cssVar pass emits a variable for every token it is given -- so `--phi-padding-xxl` is on the page
|
|
162
163
|
* even though `AliasToken` has no such field. The name is therefore real, usable from CSS, and
|
|
163
164
|
* invisible to the type, which is exactly why it has to be stated somewhere.
|
|
164
165
|
*
|
|
@@ -166,38 +167,54 @@ export const PHI_THEME_TOKEN_KEYS = [
|
|
|
166
167
|
* Design's type and a name Ant Design does not know cannot be cut from it. A Client Component that
|
|
167
168
|
* needs one of these reads it as a CSS variable, the way a Server Component does.
|
|
168
169
|
*
|
|
169
|
-
* `
|
|
170
|
+
* `pageMax` is how wide a Page may get (theme/phi-tokens.ts, `PHI_LAYOUT.pageMax`); a Page reads it
|
|
170
171
|
* as `PHI_PAGE.max`.
|
|
171
172
|
*
|
|
172
|
-
* The `
|
|
173
|
+
* The `gradient*` names are the Theme's gradient slots and the primary Buttons' run
|
|
173
174
|
* (theme/phi-theme-gradients.ts): tokens of this package's own, laid over the resolved ones so Ant
|
|
174
|
-
* Design writes them per mode and per Surface tone like every other. The `
|
|
175
|
+
* Design writes them per mode and per Surface tone like every other. The `custom*` names are the
|
|
175
176
|
* palette's custom colours, laid over the same way (theme/phi-theme-palette.ts).
|
|
176
177
|
*/
|
|
177
178
|
export const PHI_THEME_OWN_TOKEN_KEYS = [
|
|
178
179
|
"paddingXXL",
|
|
179
|
-
"
|
|
180
|
-
"
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
"
|
|
190
|
-
"
|
|
191
|
-
"
|
|
192
|
-
"
|
|
193
|
-
"
|
|
194
|
-
"
|
|
195
|
-
"
|
|
196
|
-
"
|
|
197
|
-
"
|
|
198
|
-
"
|
|
199
|
-
"
|
|
180
|
+
"pageMax",
|
|
181
|
+
"pagePaddingTopPhone",
|
|
182
|
+
"pagePaddingRightPhone",
|
|
183
|
+
"pagePaddingBottomPhone",
|
|
184
|
+
"pagePaddingLeftPhone",
|
|
185
|
+
"pagePaddingTopTablet",
|
|
186
|
+
"pagePaddingRightTablet",
|
|
187
|
+
"pagePaddingBottomTablet",
|
|
188
|
+
"pagePaddingLeftTablet",
|
|
189
|
+
"pagePaddingTopDesktop",
|
|
190
|
+
"pagePaddingRightDesktop",
|
|
191
|
+
"pagePaddingBottomDesktop",
|
|
192
|
+
"pagePaddingLeftDesktop",
|
|
193
|
+
"gradient1",
|
|
194
|
+
"gradient1Text",
|
|
195
|
+
"gradient2",
|
|
196
|
+
"gradient2Text",
|
|
197
|
+
"gradient3",
|
|
198
|
+
"gradient3Text",
|
|
199
|
+
"primaryButtonGradient",
|
|
200
|
+
"primaryButtonGradientHover",
|
|
201
|
+
"primaryButtonGradientActive",
|
|
202
|
+
"primaryButtonGradientText",
|
|
203
|
+
"custom1",
|
|
204
|
+
"custom2",
|
|
205
|
+
"custom3",
|
|
206
|
+
"custom4",
|
|
207
|
+
"custom5",
|
|
208
|
+
"custom6",
|
|
209
|
+
"custom7",
|
|
210
|
+
"custom8",
|
|
211
|
+
"custom9",
|
|
212
|
+
"custom10",
|
|
200
213
|
];
|
|
214
|
+
/** The Page inset's names, per band and side (`PHI_LAYOUT.pagePadding`, `PHI_PAGE.padding`). */
|
|
215
|
+
export const PHI_THEME_PAGE_PADDING_BANDS = ["Phone", "Tablet", "Desktop"];
|
|
216
|
+
export const PHI_THEME_PAGE_PADDING_SIDES = ["Top", "Right", "Bottom", "Left"];
|
|
217
|
+
const PHI_THEME_PAGE_PADDING_TOKEN_KEYS = PHI_THEME_PAGE_PADDING_BANDS.flatMap((band) => PHI_THEME_PAGE_PADDING_SIDES.map((side) => `pagePadding${side}${band}`));
|
|
201
218
|
/**
|
|
202
219
|
* The colours a palette seeds, shared by both modes.
|
|
203
220
|
*
|
|
@@ -258,6 +275,7 @@ export function assertPhiThemeVocabulary({ palette, styleToken, modeSeedKeys, so
|
|
|
258
275
|
violations.push(...readPhiThemeVocabularyViolations(modeConfig?.seed, modeSeedNames, source, `the ${mode} seed`), ...readPhiThemeVocabularyViolations(modeConfig?.overrides, PHI_THEME_TOKEN_NAMES, source, `the ${mode} override`));
|
|
259
276
|
}
|
|
260
277
|
violations.push(...readPhiThemePageMaxViolations(styleToken, source));
|
|
278
|
+
violations.push(...readPhiThemePagePaddingViolations(styleToken, source));
|
|
261
279
|
if (violations.length > 0) {
|
|
262
280
|
throw new Error(violations.join(" "));
|
|
263
281
|
}
|
|
@@ -268,15 +286,28 @@ export function assertPhiThemeVocabulary({ palette, styleToken, modeSeedKeys, so
|
|
|
268
286
|
* Narrower, no Page could ever be wide: a Grid of four columns or anything else that answers to the
|
|
269
287
|
* Region threshold would never draw its wide form, and nothing would say why.
|
|
270
288
|
*/
|
|
289
|
+
/**
|
|
290
|
+
* A Page's inset is a step of the spacing scale on each side and band, or none: the Page column reads it
|
|
291
|
+
* as a length, and a word it cannot resolve would leave the side at no padding with nothing to say why.
|
|
292
|
+
*/
|
|
293
|
+
function readPhiThemePagePaddingViolations(styleToken, source) {
|
|
294
|
+
const steps = new Set([...Object.values(PHI_SPACE), 0, "0"]);
|
|
295
|
+
return PHI_THEME_PAGE_PADDING_TOKEN_KEYS.flatMap((key) => {
|
|
296
|
+
const value = styleToken?.[key];
|
|
297
|
+
if (value == null || steps.has(value))
|
|
298
|
+
return [];
|
|
299
|
+
return [`${source}: the style token states ${key} as ${JSON.stringify(value)}, which is not a step of the spacing scale.`];
|
|
300
|
+
});
|
|
301
|
+
}
|
|
271
302
|
function readPhiThemePageMaxViolations(styleToken, source) {
|
|
272
|
-
const value = styleToken?.
|
|
303
|
+
const value = styleToken?.pageMax;
|
|
273
304
|
if (value == null)
|
|
274
305
|
return [];
|
|
275
306
|
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
276
|
-
return [`${source}: the style token states
|
|
307
|
+
return [`${source}: the style token states pageMax as ${JSON.stringify(value)}, which is not a number of pixels.`];
|
|
277
308
|
}
|
|
278
309
|
if (value < PHI_CONTAINER_BREAKPOINT_REGION) {
|
|
279
|
-
return [`${source}: the style token states
|
|
310
|
+
return [`${source}: the style token states pageMax ${value}, narrower than ${PHI_CONTAINER_BREAKPOINT_REGION}, from which a Region counts as wide.`];
|
|
280
311
|
}
|
|
281
312
|
return [];
|
|
282
313
|
}
|
package/theme/phi-theme.d.ts
CHANGED
|
@@ -32,8 +32,20 @@ export type PhiThemeTokens = {
|
|
|
32
32
|
paddingLG: number;
|
|
33
33
|
paddingXL: number;
|
|
34
34
|
paddingXXL: number;
|
|
35
|
-
/** How wide a Page may get (`PHI_LAYOUT.pageMax`), published as `--
|
|
36
|
-
|
|
35
|
+
/** How wide a Page may get (`PHI_LAYOUT.pageMax`), published as `--phi-page-max`. */
|
|
36
|
+
pageMax: number;
|
|
37
|
+
pagePaddingTopPhone: string;
|
|
38
|
+
pagePaddingRightPhone: string;
|
|
39
|
+
pagePaddingBottomPhone: string;
|
|
40
|
+
pagePaddingLeftPhone: string;
|
|
41
|
+
pagePaddingTopTablet: string;
|
|
42
|
+
pagePaddingRightTablet: string;
|
|
43
|
+
pagePaddingBottomTablet: string;
|
|
44
|
+
pagePaddingLeftTablet: string;
|
|
45
|
+
pagePaddingTopDesktop: string;
|
|
46
|
+
pagePaddingRightDesktop: string;
|
|
47
|
+
pagePaddingBottomDesktop: string;
|
|
48
|
+
pagePaddingLeftDesktop: string;
|
|
37
49
|
marginXXS: number;
|
|
38
50
|
marginXS: number;
|
|
39
51
|
marginSM: number;
|
package/theme/phi-theme.js
CHANGED
|
@@ -17,7 +17,20 @@ function buildPhiThemeTokens(options = {}) {
|
|
|
17
17
|
paddingLG: PHI_PADDING_VALUES.lg,
|
|
18
18
|
paddingXL: PHI_PADDING_VALUES.xl,
|
|
19
19
|
paddingXXL: PHI_PADDING_VALUES.xxl,
|
|
20
|
-
|
|
20
|
+
pageMax: PHI_LAYOUT.pageMax,
|
|
21
|
+
// A Page's inset per side and screen width, as steps of the spacing scale (`PHI_LAYOUT.pagePadding`).
|
|
22
|
+
pagePaddingTopPhone: PHI_SPACE[PHI_LAYOUT.pagePadding.phone],
|
|
23
|
+
pagePaddingRightPhone: PHI_SPACE[PHI_LAYOUT.pagePadding.phone],
|
|
24
|
+
pagePaddingBottomPhone: PHI_SPACE[PHI_LAYOUT.pagePadding.phone],
|
|
25
|
+
pagePaddingLeftPhone: PHI_SPACE[PHI_LAYOUT.pagePadding.phone],
|
|
26
|
+
pagePaddingTopTablet: PHI_SPACE[PHI_LAYOUT.pagePadding.tablet],
|
|
27
|
+
pagePaddingRightTablet: PHI_SPACE[PHI_LAYOUT.pagePadding.tablet],
|
|
28
|
+
pagePaddingBottomTablet: PHI_SPACE[PHI_LAYOUT.pagePadding.tablet],
|
|
29
|
+
pagePaddingLeftTablet: PHI_SPACE[PHI_LAYOUT.pagePadding.tablet],
|
|
30
|
+
pagePaddingTopDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
|
|
31
|
+
pagePaddingRightDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
|
|
32
|
+
pagePaddingBottomDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
|
|
33
|
+
pagePaddingLeftDesktop: PHI_SPACE[PHI_LAYOUT.pagePadding.desktop],
|
|
21
34
|
// Ant Design's second family, on the same scale: its own components read it (phi-tokens.ts).
|
|
22
35
|
marginXXS: PHI_PADDING_VALUES.xxs,
|
|
23
36
|
marginXS: PHI_PADDING_VALUES.xs,
|
package/theme/phi-tokens.d.ts
CHANGED
|
@@ -89,6 +89,11 @@ export declare const PHI_LAYOUT: {
|
|
|
89
89
|
readonly contentMaxNarrow: 377;
|
|
90
90
|
readonly contentMax: 610;
|
|
91
91
|
readonly pageMax: 1220;
|
|
92
|
+
readonly pagePadding: {
|
|
93
|
+
readonly phone: "base";
|
|
94
|
+
readonly tablet: "md";
|
|
95
|
+
readonly desktop: "md";
|
|
96
|
+
};
|
|
92
97
|
readonly readingMax: 754;
|
|
93
98
|
readonly heroHeight: 377;
|
|
94
99
|
};
|
package/theme/phi-tokens.js
CHANGED
|
@@ -136,6 +136,15 @@ export const PHI_LAYOUT = {
|
|
|
136
136
|
* be able to get past it, which is why a Theme may not state less (`assertPhiThemeVocabulary`).
|
|
137
137
|
*/
|
|
138
138
|
pageMax: 1220,
|
|
139
|
+
/*
|
|
140
|
+
* How far a Page's content stands in from the room it is given, by the screen it is drawn on: the
|
|
141
|
+
* Shell's device bands on `phi-render-viewport` (styles/shell.css), a phone below 768, a tablet below
|
|
142
|
+
* 1200, a desktop from there -- not the block profiles' 377 and 610, which measure room and would put
|
|
143
|
+
* two phones of one class on opposite sides. Steps of the spacing scale, the same on all four sides; a
|
|
144
|
+
* phone one step below the rest. The Theme's to decide, as `pageMax` is: a Page reads it as
|
|
145
|
+
* `PHI_PAGE.padding`, and a Layout that states its own padding keeps it.
|
|
146
|
+
*/
|
|
147
|
+
pagePadding: { phone: "base", tablet: "md", desktop: "md" },
|
|
139
148
|
/*
|
|
140
149
|
* How wide a column of prose is allowed to get: an article, an entry and what stands around it.
|
|
141
150
|
*
|
|
@@ -75,6 +75,12 @@ export type PhiCmsRoutePresetDescriptor = PhiCmsPresetIdentity & {
|
|
|
75
75
|
activeModuleIds: ReadonlySet<PhiRuntimeModuleId>;
|
|
76
76
|
params: Readonly<Record<string, string>>;
|
|
77
77
|
}) => PhiResolvedCmsPageTree | Promise<PhiResolvedCmsPageTree>;
|
|
78
|
+
/**
|
|
79
|
+
* The record this route's Page is about (MODULES.md, "The fields of a record, and the record a Page is
|
|
80
|
+
* about"). Only on a route with a parameter. Core reads it before anything is drawn -- no record is a
|
|
81
|
+
* 404 -- and the Page's Widgets bind to its fields, in the Module's tree and in a stored override alike.
|
|
82
|
+
*/
|
|
83
|
+
pageRecord?: import("./record-provider").PhiCmsPageRecordDescriptor;
|
|
78
84
|
navigation?: readonly PhiCmsNavigationInjectionDescriptor[];
|
|
79
85
|
/**
|
|
80
86
|
* The Page's guided Tour, in the owning Module's language (design/TOURS.md). Read with the route, not
|
package/types/cms-plugins.d.ts
CHANGED
|
@@ -158,6 +158,15 @@ export type PhiCmsConfigField = (PhiCmsConfigFieldBase & {
|
|
|
158
158
|
* what gets stored is a provider key the render path looks up in the same registry.
|
|
159
159
|
*/
|
|
160
160
|
type: "video-provider";
|
|
161
|
+
}) | (PhiCmsConfigFieldBase & {
|
|
162
|
+
/**
|
|
163
|
+
* A field of the record the Page is about (MODULES.md, "The fields of a record, and the record a
|
|
164
|
+
* Page is about"). The Inspector offers the fields the Page's record Provider declares, of the
|
|
165
|
+
* kinds the Widget draws; on a Page that is about no record the row is not shown. What is stored
|
|
166
|
+
* is the field's key.
|
|
167
|
+
*/
|
|
168
|
+
type: "record-field";
|
|
169
|
+
kinds: readonly import("./record-provider").PhiRecordFieldKind[];
|
|
161
170
|
}) | (PhiCmsConfigFieldBase & {
|
|
162
171
|
type: "dimension";
|
|
163
172
|
widthKey?: string;
|
|
@@ -583,6 +592,10 @@ export type PhiCmsRuntimeRenderRegistry = {
|
|
|
583
592
|
* a page that binds none loads none.
|
|
584
593
|
*/
|
|
585
594
|
recordProviderLoadersByKey: ReadonlyMap<PhiRuntimeDataProviderKey, () => Promise<import("./record-provider").PhiRuntimeRecordProviderResolver>>;
|
|
595
|
+
/** The field readers of the `record` Providers that declare fields, by key. */
|
|
596
|
+
recordFieldsLoadersByKey: ReadonlyMap<PhiRuntimeDataProviderKey, () => Promise<import("./record-provider").PhiRuntimeRecordFieldsReader>>;
|
|
597
|
+
/** The sample readers of the `record` Providers that offer samples, by key: what the Builder previews a template with. */
|
|
598
|
+
recordSamplesLoadersByKey: ReadonlyMap<PhiRuntimeDataProviderKey, () => Promise<import("./record-provider").PhiRuntimeRecordSamplesReader>>;
|
|
586
599
|
dataProviderDescriptorsByKey: ReadonlyMap<PhiRuntimeDataProviderKey, PhiRuntimeModuleDataProviderDescriptor>;
|
|
587
600
|
formDefinitionsById: ReadonlyMap<string, PhiRuntimeModuleFormDefinition>;
|
|
588
601
|
};
|
|
@@ -957,7 +970,12 @@ export type PhiRuntimeModuleDataProviderDescriptor = PhiRuntimeModuleDataProvide
|
|
|
957
970
|
kind: "collection";
|
|
958
971
|
resources: readonly import("./collection-provider").PhiCollectionProviderResourceDescriptor[];
|
|
959
972
|
} | {
|
|
960
|
-
kind:
|
|
973
|
+
kind: "record";
|
|
974
|
+
resources?: never;
|
|
975
|
+
/** Whose the record is and what it consists of; what a Widget binds to as a field of it. */
|
|
976
|
+
record?: import("./record-provider").PhiRecordDeclaration;
|
|
977
|
+
} | {
|
|
978
|
+
kind: Exclude<PhiRuntimeDataProviderKind, "table" | "tree" | "collection" | "record">;
|
|
961
979
|
resources?: never;
|
|
962
980
|
});
|
|
963
981
|
export type PhiRuntimeModuleDataProviderClientProps = {
|