@phis/ui 0.5.1 → 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.d.ts +5 -2
- 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/cms-region-keys.d.ts +1 -1
- 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/header-navigation/authoring.js +2 -3
- package/plugins/runtime-modules/core/widgets/header-navigation/client.d.ts +1 -3
- package/plugins/runtime-modules/core/widgets/header-navigation/client.js +9 -5
- package/plugins/runtime-modules/core/widgets/header-navigation/config.d.ts +1 -4
- package/plugins/runtime-modules/core/widgets/header-navigation/plugin.js +2 -3
- package/plugins/runtime-modules/core/widgets/header-navigation/server.d.ts +2 -2
- package/plugins/runtime-modules/core/widgets/header-navigation/server.js +1 -2
- 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 +37 -1
- 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 +121 -108
- 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 +93 -78
- package/theme/antd-css-var-contract.js +99 -79
- package/theme/phi-container-breakpoints.d.ts +4 -1
- package/theme/phi-container-breakpoints.js +4 -1
- 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 +10 -4
- package/theme/phi-theme-tokens.js +78 -23
- package/theme/phi-theme.d.ts +14 -0
- package/theme/phi-theme.js +14 -0
- package/theme/phi-tokens.d.ts +6 -1
- package/theme/phi-tokens.js +22 -2
- package/theme.d.ts +1 -1
- package/theme.js +1 -1
- 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
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ The root export (`@phis/ui`) is not an integration surface; import from the grou
|
|
|
73
73
|
| --- | --- |
|
|
74
74
|
| Next.js Site | `next/config` (`withPhiNextConfig` for the Site's `next.config`), `next/area-route`, `next/areas/<area>`, `next/areas/<area>-client`, `next/root-route`, `next/root-error-page`, `next/global-error`, `next/site-bridge`, `next/site-proxy`, `next/proxy-runtime`, `next/route-handlers`, `next/seo-routes`, `next/overlay-zones`, `next/overlay-zones-client`, `next/cache-handler`, `next/runtime-module-client-boundary` |
|
|
75
75
|
| CMS rendering | `cms`, `cms/root-layout`, `cms/root-page`, `cms/root-slot-page`, `cms/error-page`, `cms/request`, `cms/plugins`, `cms/plugins/<area>` |
|
|
76
|
-
| Module packages | `module`, `module/client`, `module/authoring-client`, `module/labels`, `module/dashboard-cards`, `module/records`, `module/references`, `module/projection`, `module/projection/client`, `module/projection/authoring-client`, `module/site-modules`, `module/site-modules-client` |
|
|
76
|
+
| Module packages | `module`, `module/client`, `module/authoring-client`, `module/labels`, `module/dashboard-cards`, `module/records`, `module/page-check`, `module/references`, `module/projection`, `module/projection/client`, `module/projection/authoring-client`, `module/site-modules`, `module/site-modules-client` |
|
|
77
77
|
| Runtime Clients | `runtime`, `runtime/controller-client`, `runtime/render-client`, `runtime/signal-client`, `runtime/data-provider-client`, `runtime/authoring-client`, `runtime/authoring-manifest-client`, `runtime/calendar-adapter-client`, `runtime/user-state-client`, `runtime/client-manifests/<area>` |
|
|
78
78
|
| UI | `widgets`, `core-widgets`, `widget-config`, `controls`, `controls/config`, `controls/date-time`, `layouts`, `shells`, `root`, `navigation`, `forms`, `forms/client`, `media`, `references`, `state`, `theme` |
|
|
79
79
|
| Builder | `builder-api-route` |
|
|
@@ -28,7 +28,7 @@ function resolveCurrentValue(value, primaryColor) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
function resolveDisplayBorderColor(color, primaryColor) {
|
|
31
|
-
if (color === "var(--
|
|
31
|
+
if (color === "var(--phi-color-primary)") {
|
|
32
32
|
return primaryColor;
|
|
33
33
|
}
|
|
34
34
|
return color;
|
|
@@ -17,14 +17,14 @@ const RADIUS_OPTIONS = [
|
|
|
17
17
|
];
|
|
18
18
|
const RADIUS_COMPARE_ALIASES = {
|
|
19
19
|
none: ["0", "0px"],
|
|
20
|
-
xxs: ["3", "3px", "var(--
|
|
21
|
-
xs: ["5", "5px", "var(--
|
|
22
|
-
sm: ["8", "8px", "var(--
|
|
23
|
-
base: ["13", "13px", "var(--
|
|
24
|
-
md: ["21", "21px", "var(--
|
|
25
|
-
lg: ["34", "34px", "var(--
|
|
26
|
-
xl: ["55", "55px", "var(--
|
|
27
|
-
xxl: ["89", "89px", "var(--
|
|
20
|
+
xxs: ["3", "3px", "var(--phi-border-radius-xs)"],
|
|
21
|
+
xs: ["5", "5px", "var(--phi-border-radius-sm)"],
|
|
22
|
+
sm: ["8", "8px", "var(--phi-border-radius)"],
|
|
23
|
+
base: ["13", "13px", "var(--phi-border-radius-lg)"],
|
|
24
|
+
md: ["21", "21px", "var(--phi-border-radius-lg)"],
|
|
25
|
+
lg: ["34", "34px", "var(--phi-border-radius-lg)"],
|
|
26
|
+
xl: ["55", "55px", "var(--phi-border-radius-outer)"],
|
|
27
|
+
xxl: ["89", "89px", "var(--phi-border-radius-outer)"],
|
|
28
28
|
round: ["50%"],
|
|
29
29
|
};
|
|
30
30
|
const PHI_RADIUS_CORNER_SHORT_LABELS = {
|
|
@@ -124,5 +124,5 @@ export function PhiBoundRadiusControl({ value, disabled = false, labels = PHI_RA
|
|
|
124
124
|
if (asGridRows) {
|
|
125
125
|
return (_jsxs(_Fragment, { children: [_jsx(Typography.Text, { children: labels.sections.radius }), _jsx("div", { style: { justifySelf: "start" }, children: switchControl }), cornerGrid ? _jsx("div", { style: { gridColumn: "1 / -1", minWidth: 0 }, children: cornerGrid }) : null] }));
|
|
126
126
|
}
|
|
127
|
-
return (_jsxs("div", { style: { display: "grid", gap: token.paddingXS, width: "100%" }, children: [_jsxs(Flex, { align: "center", justify: "flex-start", gap: labelWidth == null ? 8 : 12, children: [showLabel ? (_jsx(Typography.Text, { style: labelWidth == null ? undefined : { flex: `0 0 ${labelWidth}px`, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: "var(--
|
|
127
|
+
return (_jsxs("div", { style: { display: "grid", gap: token.paddingXS, width: "100%" }, children: [_jsxs(Flex, { align: "center", justify: "flex-start", gap: labelWidth == null ? 8 : 12, children: [showLabel ? (_jsx(Typography.Text, { style: labelWidth == null ? undefined : { flex: `0 0 ${labelWidth}px`, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: "var(--phi-control-height)" }, children: labels.sections.radius })) : null, switchControl] }), cornerGrid] }));
|
|
128
128
|
}
|
|
@@ -158,5 +158,5 @@ export function PhiBrandControl({ brand, fallbackTitle, shows = "lockup", mode,
|
|
|
158
158
|
objectFit: "contain",
|
|
159
159
|
display: "block",
|
|
160
160
|
transform: logoYOffset === 0 ? undefined : `translateY(${logoYOffset}px)`,
|
|
161
|
-
} }) })) : null, _jsxs(Flex, { vertical: true, gap: 0, justify: "center", children: [eyebrow ? (_jsx("span", { style: { display: "block", fontSize: "var(--
|
|
161
|
+
} }) })) : null, _jsxs(Flex, { vertical: true, gap: 0, justify: "center", children: [eyebrow ? (_jsx("span", { style: { display: "block", fontSize: "var(--phi-font-size-sm)", opacity: 0.75 }, children: eyebrow })) : null, wordmarkNode] })] }));
|
|
162
162
|
}
|
|
@@ -8,9 +8,9 @@ import { Drawer } from "antd";
|
|
|
8
8
|
import { PHI_FONT_SIZE, PHI_SPACE } from "../../theme/antd-css-var-contract";
|
|
9
9
|
import { PHI_OVERLAY_DEFAULT_MASK, resolvePhiOverlayDismissSource, resolvePhiOverlayMaskPresentation, } from "./phi-overlay-control-contract";
|
|
10
10
|
import { usePhiHydrated } from "../state/use-phi-hydrated";
|
|
11
|
-
const PHI_DRAWER_HEADER_MIN_BLOCK_SIZE = `calc(var(--
|
|
11
|
+
const PHI_DRAWER_HEADER_MIN_BLOCK_SIZE = `calc(var(--phi-control-height) + ${PHI_SPACE.xs} + ${PHI_SPACE.xs})`;
|
|
12
12
|
/** Where a title starts when the close button stands before it: past the button, not beneath it. */
|
|
13
|
-
const PHI_DRAWER_TITLE_AFTER_CLOSE = `calc(${PHI_SPACE.sm} + var(--
|
|
13
|
+
const PHI_DRAWER_TITLE_AFTER_CLOSE = `calc(${PHI_SPACE.sm} + var(--phi-control-height) + ${PHI_SPACE.xs})`;
|
|
14
14
|
export function PhiDrawerControlAdapter({ open, title, header, body, footer, closable = true, keyboard = true, mask = PHI_OVERLAY_DEFAULT_MASK, mountPolicy = "remount", placement = "right", size, maxSize, resizable = false, push = false, zIndex, containerStyle, onDismiss, afterOpenChange, panelRef, }) {
|
|
15
15
|
const hydrated = usePhiHydrated();
|
|
16
16
|
const resolvedMask = resolvePhiOverlayMaskPresentation(mask);
|
|
@@ -29,7 +29,7 @@ export function PhiDrawerControlAdapter({ open, title, header, body, footer, clo
|
|
|
29
29
|
* drawer without a configured background was see-through, and the presets only looked right
|
|
30
30
|
* because their glass effect brings a background of its own.
|
|
31
31
|
*/
|
|
32
|
-
background: "var(--
|
|
32
|
+
background: "var(--phi-color-bg-elevated)",
|
|
33
33
|
...containerStyle,
|
|
34
34
|
padding: 0,
|
|
35
35
|
},
|
|
@@ -51,7 +51,7 @@ export function PhiDrawerControlAdapter({ open, title, header, body, footer, clo
|
|
|
51
51
|
background: "transparent",
|
|
52
52
|
},
|
|
53
53
|
// The title in the body's size, as a Modal's is (theme/phi-theme.ts); Ant Design sets a Drawer's at `lg`.
|
|
54
|
-
title: { width: "100%", minWidth: 0, fontSize: PHI_FONT_SIZE.base, lineHeight: "var(--
|
|
54
|
+
title: { width: "100%", minWidth: 0, fontSize: PHI_FONT_SIZE.base, lineHeight: "var(--phi-line-height)" },
|
|
55
55
|
close: {
|
|
56
56
|
position: "absolute",
|
|
57
57
|
top: "50%",
|
|
@@ -72,7 +72,7 @@ export function PhiPillDropdownControl({ items, selectedKeys, open, onOpenChange
|
|
|
72
72
|
return (_jsx(PhiDropdownControl, { items: items, selectedKeys: selectedKeys, open: open, onOpenChange: onOpenChange, children: _jsxs("button", { ref: triggerRef, type: "button", className: joinPhiClassNames("phi-dropdown-control", className), style: {
|
|
73
73
|
display: "inline-flex",
|
|
74
74
|
alignItems: "center",
|
|
75
|
-
gap: "var(--
|
|
75
|
+
gap: "var(--phi-padding-xs)",
|
|
76
76
|
fontSize: "inherit",
|
|
77
77
|
color: "inherit",
|
|
78
78
|
background: "transparent",
|
|
@@ -80,5 +80,5 @@ export function PhiPillDropdownControl({ items, selectedKeys, open, onOpenChange
|
|
|
80
80
|
padding: 0,
|
|
81
81
|
cursor: canOpen ? "pointer" : "default",
|
|
82
82
|
...style,
|
|
83
|
-
}, "aria-haspopup": canOpen ? "menu" : undefined, onMouseEnter: onIntent, onFocus: onIntent, onClick: onIntent, children: [leading, hasLabel && pill ? (_jsx("span", { className: "phi-dropdown-control__pill", children: _jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: "var(--
|
|
83
|
+
}, "aria-haspopup": canOpen ? "menu" : undefined, onMouseEnter: onIntent, onFocus: onIntent, onClick: onIntent, children: [leading, hasLabel && pill ? (_jsx("span", { className: "phi-dropdown-control__pill", children: _jsxs("span", { style: { display: "inline-flex", alignItems: "center", gap: "var(--phi-padding-xxs)" }, children: [_jsx("span", { children: label }), chevron] }) })) : (_jsxs(_Fragment, { children: [hasLabel ? _jsx("span", { children: label }) : null, chevron] }))] }) }));
|
|
84
84
|
}
|
|
@@ -416,7 +416,7 @@ export const PhiFormControl = forwardRef(function PhiFormControl({ descriptor, r
|
|
|
416
416
|
[`--phi-form-cell-gap-${mode}`, part === "label"
|
|
417
417
|
? (placed.stacked ? `calc(var(--phi-form-row-gap-${mode}) / 4)` : "0px")
|
|
418
418
|
: field.key === lastInFlowFieldKey ? "0px" : `var(--phi-form-row-gap-${mode})`],
|
|
419
|
-
[`--phi-form-label-height-${mode}`, placed.stacked
|
|
419
|
+
[`--phi-form-label-slot-height-${mode}`, placed.stacked
|
|
420
420
|
? "auto"
|
|
421
421
|
: "var(--phi-form-label-min-height)"],
|
|
422
422
|
[`--phi-form-label-pad-${mode}`, placed.stacked
|
|
@@ -41,7 +41,7 @@ export function PhiImageControl({ presentation, source, alt, title, width, heigh
|
|
|
41
41
|
maxWidth: "100%",
|
|
42
42
|
lineHeight: 0,
|
|
43
43
|
overflow: presentation.simulatedCropStyle ? "hidden" : undefined,
|
|
44
|
-
...(loaded || blur ? {} : { backgroundColor: "var(--
|
|
44
|
+
...(loaded || blur ? {} : { backgroundColor: "var(--phi-color-fill-quaternary)" }),
|
|
45
45
|
...(zoom ? { cursor: "zoom-in" } : {}),
|
|
46
46
|
...style,
|
|
47
47
|
};
|
|
@@ -20,8 +20,8 @@ function renderMaskPreview(mask, label, selected = false) {
|
|
|
20
20
|
width: 54,
|
|
21
21
|
height: 54,
|
|
22
22
|
borderRadius: 8,
|
|
23
|
-
background: "linear-gradient(135deg, var(--
|
|
24
|
-
boxShadow: selected ? "0 0 0 2px var(--
|
|
23
|
+
background: "linear-gradient(135deg, var(--phi-color-primary, #1677ff), var(--phi-color-info, #13c2c2))",
|
|
24
|
+
boxShadow: selected ? "0 0 0 2px var(--phi-color-primary)" : "inset 0 0 0 1px var(--phi-color-border-secondary)",
|
|
25
25
|
...resolvePhiMaskStyle(mask),
|
|
26
26
|
} }), _jsx(Typography.Text, { style: { fontSize: 11, textAlign: "center" }, children: label })] }));
|
|
27
27
|
}
|
|
@@ -49,22 +49,22 @@ export function PhiMaskPickerControl({ value, open, buttonAriaLabel = "Select ma
|
|
|
49
49
|
});
|
|
50
50
|
};
|
|
51
51
|
const popupContainer = (triggerNode) => contentRef.current ?? triggerNode.parentElement ?? document.body;
|
|
52
|
-
const content = (_jsx("div", { ref: contentRef, style: { width: 360, maxWidth: "calc(100vw - (var(--
|
|
52
|
+
const content = (_jsx("div", { ref: contentRef, style: { width: 360, maxWidth: "calc(100vw - (var(--phi-padding-lg) * 2))" }, onClick: (event) => event.stopPropagation(), onMouseDown: (event) => event.stopPropagation(), onPointerDown: (event) => event.stopPropagation(), onKeyDown: (event) => event.stopPropagation(), children: _jsxs(Flex, { vertical: true, gap: "var(--phi-padding-sm)", children: [_jsxs(Flex, { align: "center", justify: "space-between", gap: "var(--phi-padding-sm)", children: [_jsx(Typography.Text, { strong: true, children: "Mask" }), _jsx(PhiButtonControl, { size: "small", type: "text", danger: true, icon: _jsx(PhiIcon, { name: "delete", size: "inherit" }), ariaLabel: "Clear mask", onClick: () => picker.changeValue(undefined) })] }), _jsx(PhiSegmentedControl, { block: true, value: mode, options: [
|
|
53
53
|
{ value: "preset", label: "Presets" },
|
|
54
54
|
{ value: "asset", label: "Media" },
|
|
55
55
|
], onChange: setMode }), mode === "preset" ? (_jsx("div", { style: {
|
|
56
56
|
display: "grid",
|
|
57
57
|
gridTemplateColumns: "repeat(4, minmax(0, 1fr))",
|
|
58
|
-
gap: "var(--
|
|
58
|
+
gap: "var(--phi-padding-sm)",
|
|
59
59
|
}, children: PHI_MASK_PRESET_OPTIONS.map((preset) => {
|
|
60
60
|
const selected = resolvedMask.source !== "asset" && resolvedMask.preset === preset.value;
|
|
61
|
-
return (_jsx(PhiButtonControl, { type: selected ? "primary" : "default", style: { height: "auto", padding: "var(--
|
|
61
|
+
return (_jsx(PhiButtonControl, { type: selected ? "primary" : "default", style: { height: "auto", padding: "var(--phi-padding-xs)" }, onClick: () => selectPreset(preset.value), label: renderMaskPreview({
|
|
62
62
|
...resolvedMask,
|
|
63
63
|
enabled: true,
|
|
64
64
|
source: "preset",
|
|
65
65
|
preset: preset.value,
|
|
66
66
|
}, preset.label, selected) }, preset.value));
|
|
67
|
-
}) })) : null, mode === "asset" ? (_jsxs(Flex, { vertical: true, gap: "var(--
|
|
67
|
+
}) })) : null, mode === "asset" ? (_jsxs(Flex, { vertical: true, gap: "var(--phi-padding-xs)", children: [_jsx(PhiMediaPickerControl, { ...mediaPickerProps, getPopupContainer: popupContainer, popupRootClassName: popupRootClassName, trigger: _jsx("span", { style: { display: "block" }, children: _jsx(PhiButtonControl, { block: true, label: "Select mask asset", onClick: () => undefined }) }) }), _jsx(PhiFileDropControl, { accept: ".svg,.png,image/svg+xml,image/png", onFile: (file) => onUploadFile?.(file), disabled: uploading, style: { width: "100%" }, children: _jsx("span", { style: { display: "block", width: "100%" }, children: _jsx(PhiButtonControl, { block: true, icon: _jsx(PhiIcon, { name: "upload", size: "inherit" }), loading: uploading, label: uploading ? `Uploading ${uploadProgress}%` : "Upload SVG or PNG mask", onClick: () => undefined }) }) }), _jsx(PhiIconPickerControl, { value: selectedIcon, onChange: onIconSelect, disabled: uploading, buttonAriaLabel: "Select Iconify mask", buttonIcon: selectedIcon ? _jsx(PhiIcon, { name: selectedIcon, size: 16 }) : _jsx(PhiIcon, { name: "star", size: "inherit" }), buttonLabel: uploading ? `Uploading ${uploadProgress}%` : "Select Iconify icon", buttonType: "default", buttonSize: "medium", buttonBlock: true, buttonStyle: { width: "100%" }, getPopupContainer: popupContainer, rootClassName: popupRootClassName })] })) : null, [
|
|
68
68
|
["Scale", Math.round((resolvedMask.scale ?? 1) * 100), 25, 200, "%", (next) => patchMask({ scale: next / 100 })],
|
|
69
69
|
["Offset X", resolvedMask.offsetX ?? 0, -100, 100, "%", (next) => patchMask({ offsetX: next })],
|
|
70
70
|
["Offset Y", resolvedMask.offsetY ?? 0, -100, 100, "%", (next) => patchMask({ offsetY: next })],
|
|
@@ -8,7 +8,7 @@ function isPhiSelectSeparatorEntry(entry) {
|
|
|
8
8
|
return typeof entry === "object" && entry != null && "separator" in entry;
|
|
9
9
|
}
|
|
10
10
|
function renderPhiSelectSeparator() {
|
|
11
|
-
return _jsx("div", { role: "separator", style: { borderTop: "1px solid var(--
|
|
11
|
+
return _jsx("div", { role: "separator", style: { borderTop: "1px solid var(--phi-color-split)", marginBlock: 4 } });
|
|
12
12
|
}
|
|
13
13
|
/* The options with a line where one asks for it -- once, where an option after and one before agree. */
|
|
14
14
|
function separatePhiSelectOptions(resolved) {
|
|
@@ -19,7 +19,7 @@ export function PhiThemeScopeControl({ scope, mode, token, components, children,
|
|
|
19
19
|
const theme = useMemo(() => ({
|
|
20
20
|
inherit: false,
|
|
21
21
|
cssVar: {
|
|
22
|
-
prefix: "
|
|
22
|
+
prefix: "phi",
|
|
23
23
|
key: createPhiAntdThemeCssVarKey(scope, { mode, token, components }),
|
|
24
24
|
},
|
|
25
25
|
token,
|
|
@@ -28,9 +28,9 @@ const PHI_TEXT_COLOR_TOKEN_KEYS = [
|
|
|
28
28
|
"colorTextPlaceholder",
|
|
29
29
|
"colorTextDisabled",
|
|
30
30
|
];
|
|
31
|
-
/** A Theme colour token's role, the custom property Ant Design writes for it: `colorPrimaryBg` → `var(--
|
|
31
|
+
/** A Theme colour token's role, the custom property Ant Design writes for it: `colorPrimaryBg` → `var(--phi-color-primary-bg)`. */
|
|
32
32
|
function resolvePhiColorTokenReference(tokenKey) {
|
|
33
|
-
return `var(--
|
|
33
|
+
return `var(--phi-${tokenKey.replace(/[A-Z]/gu, (letter) => `-${letter.toLowerCase()}`)})`;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* The colour picker's swatches: the Theme's custom colours, its primary and text ladders, then the fixed
|
|
@@ -187,7 +187,7 @@ export function PhiCompoundTableFormControl({ field, label, description, value,
|
|
|
187
187
|
if (addResetFields)
|
|
188
188
|
formContext?.setValues(addResetFields);
|
|
189
189
|
};
|
|
190
|
-
return (_jsxs("div", { "data-phi-form-keyboard-scope": true, style: { display: "grid", gap: "var(--
|
|
190
|
+
return (_jsxs("div", { "data-phi-form-keyboard-scope": true, style: { display: "grid", gap: "var(--phi-padding-sm)", minWidth: 0, width: "100%" }, children: [_jsx(PhiCollectionHeaderControl, { title: label, description: description, toolbar: addEnabled ? (_jsx(PhiToolbarControl, { items: [{
|
|
191
191
|
key: "add",
|
|
192
192
|
label: addLabel,
|
|
193
193
|
ariaLabel: addLabel,
|
|
@@ -212,5 +212,5 @@ export function PhiCompoundTreeFormControl({ field, label, description, value, o
|
|
|
212
212
|
blockNode: true,
|
|
213
213
|
node: { titleFieldKey: typeof config.titleFieldKey === "string" ? config.titleFieldKey : "title" },
|
|
214
214
|
});
|
|
215
|
-
return (_jsxs("div", { "data-phi-form-keyboard-scope": true, style: { display: "grid", gap: "var(--
|
|
215
|
+
return (_jsxs("div", { "data-phi-form-keyboard-scope": true, style: { display: "grid", gap: "var(--phi-padding-sm)", minWidth: 0, width: "100%" }, children: [_jsx(PhiCollectionHeaderControl, { title: label, description: description }), _jsx(PhiTreeControl, { nodes: nodes, nodeIdentityPath: identityPath, parentNodeIdentityPath: parentPath, presentation: presentation, disabled: disabled || readOnly, selectedNodeIdentities: selected, checkedNodeIdentities: checked, expandedNodeIdentities: expanded, selectionMode: config.selectionMode === "multiple" ? "multiple" : config.selectionMode === "none" ? "none" : "single", checking: config.checking === true, editing: config.editing === true && !disabled && !readOnly, draggable: config.reorder === true && !disabled && !readOnly, onSelectionChange: setSelected, onCheckingChange: setChecked, onExpansionChange: setExpanded, onCommitField: (identity, fieldKey, proposed) => onChange?.(nodes.map((node) => String(readPath(node, identityPath)) === String(identity) ? setPath(node, fieldKey, proposed) : node)), onDrop: (move) => onChange?.(applyMove(nodes, identityPath, parentPath, move)) })] }));
|
|
216
216
|
}
|
|
@@ -37,7 +37,7 @@ export const PhiSliderFormControl = ({ field, value, onChange, disabled, readOnl
|
|
|
37
37
|
const slider = (_jsx(PhiSliderControl, { value: numericValue, min: min, max: max, step: step, dots: field.config?.dots === true, included: field.config?.included !== false, reverse: field.config?.reverse === true, tooltipMode: field.config?.tooltipMode === "always" || field.config?.tooltipMode === "hidden"
|
|
38
38
|
? field.config.tooltipMode
|
|
39
39
|
: "auto", tooltipSuffix: typeof field.config?.tooltipSuffix === "string" ? field.config.tooltipSuffix : undefined, disabled: disabled, readOnly: readOnly, style: { width: "100%" }, onChange: (nextValue) => onChange?.(nextValue) }));
|
|
40
|
-
return field.config?.showInput === true ? (_jsxs("div", { style: { display: "grid", gridTemplateColumns: "minmax(96px, 1fr) minmax(0, 2fr)", gap: "var(--
|
|
40
|
+
return field.config?.showInput === true ? (_jsxs("div", { style: { display: "grid", gridTemplateColumns: "minmax(96px, 1fr) minmax(0, 2fr)", gap: "var(--phi-padding-sm)", alignItems: "center", minWidth: 0 }, children: [_jsx(PhiNumberControl, { value: numericValue ?? null, min: min, max: max, step: step, precision: typeof field.config?.precision === "number" ? field.config.precision : undefined, disabled: disabled, readOnly: readOnly, style: { width: "100%" }, onChange: (nextValue) => onChange?.(nextValue) }), slider] })) : slider;
|
|
41
41
|
};
|
|
42
42
|
export const PhiCascaderFormControl = ({ field, value, onChange, options, placeholder, disabled, readOnly }) => (_jsx(PhiCascaderControl, { value: typeof value === "string" ? value : undefined, placeholder: placeholder, disabled: disabled, readOnly: readOnly, options: options ?? [], allowRoot: field.config?.allowRoot !== false, allowClear: field.config?.allowClear === true, separator: typeof field.config?.separator === "string" ? field.config.separator : "/", rootValue: typeof field.config?.rootValue === "string" ? field.config.rootValue : "/", normalize: field.config?.normalize === "path" ? "path" : "raw", onChange: (nextValue) => onChange?.(nextValue) }));
|
|
43
43
|
export const PhiNumberFormControl = ({ id, field, value, onChange, placeholder, disabled, readOnly, labels, }) => (_jsx(PhiNumberControl, { id: id, value: typeof value === "number" ? value : null, disabled: disabled, readOnly: readOnly, placeholder: placeholder, min: typeof field.config?.min === "number" ? field.config.min : undefined, max: typeof field.config?.max === "number" ? field.config.max : undefined, step: typeof field.config?.step === "number" ? field.config.step : undefined, precision: typeof field.config?.precision === "number" ? field.config.precision : undefined, prefix: readPhiNumberFieldPrefix(field.config?.prefix, labels), style: { width: "100%" }, onChange: (nextValue) => onChange?.(nextValue) }));
|
|
@@ -25,7 +25,7 @@ placeholderRows = 1) {
|
|
|
25
25
|
* server render. On a server-rendered page React keeps the server HTML until the chunk is there.
|
|
26
26
|
*/
|
|
27
27
|
const placeholder = (_jsx("div", { "aria-busy": "true", style: {
|
|
28
|
-
blockSize: `calc(var(--
|
|
28
|
+
blockSize: `calc(var(--phi-control-height) * ${placeholderRows} + var(--phi-padding-sm) * ${placeholderRows - 1})`,
|
|
29
29
|
/*
|
|
30
30
|
* The Control shape, because this stands where a Control is about to stand. `grown-md` is half a
|
|
31
31
|
* Control line, which on the one-row placeholder is exactly the capsule and on a taller one is the
|
|
@@ -33,7 +33,7 @@ placeholderRows = 1) {
|
|
|
33
33
|
* change under the reader at the moment the chunk lands.
|
|
34
34
|
*/
|
|
35
35
|
borderRadius: "var(--phi-control-radius-grown-md)",
|
|
36
|
-
background: "var(--
|
|
36
|
+
background: "var(--phi-color-fill-quaternary)",
|
|
37
37
|
} }));
|
|
38
38
|
return function PhiLazyFormFieldControl(props) {
|
|
39
39
|
return (_jsx(Suspense, { fallback: placeholder, children: _jsx(LazyControl, { ...props }) }));
|
|
@@ -53,8 +53,8 @@ export function PhiFlexLayout({ slots, ...layoutProps }) {
|
|
|
53
53
|
minHeight: 1,
|
|
54
54
|
maxHeight: 1,
|
|
55
55
|
alignSelf: "center",
|
|
56
|
-
backgroundColor: "var(--
|
|
57
|
-
boxShadow: "inset 0 0 0 1px var(--
|
|
56
|
+
backgroundColor: "var(--phi-color-border-secondary)",
|
|
57
|
+
boxShadow: "inset 0 0 0 1px var(--phi-color-border-secondary)",
|
|
58
58
|
pointerEvents: "none",
|
|
59
59
|
}
|
|
60
60
|
: {
|
|
@@ -66,8 +66,8 @@ export function PhiFlexLayout({ slots, ...layoutProps }) {
|
|
|
66
66
|
maxHeight: resolvedSeparatorCrossSize,
|
|
67
67
|
alignSelf: "center",
|
|
68
68
|
marginInline: 0,
|
|
69
|
-
backgroundColor: "var(--
|
|
70
|
-
boxShadow: "inset 0 0 0 1px var(--
|
|
69
|
+
backgroundColor: "var(--phi-color-border-secondary)",
|
|
70
|
+
boxShadow: "inset 0 0 0 1px var(--phi-color-border-secondary)",
|
|
71
71
|
pointerEvents: "none",
|
|
72
72
|
};
|
|
73
73
|
const renderSeparator = (key) => (_jsx("div", { style: {
|
|
@@ -49,7 +49,7 @@ function renderGridGuides(profile, columns) {
|
|
|
49
49
|
marginInlineStart: `calc(var(--phi-grid-column-gap, 0px) * ${shares.lead} / 24)`,
|
|
50
50
|
marginInlineEnd: `calc(var(--phi-grid-column-gap, 0px) * ${shares.trail} / 24)`,
|
|
51
51
|
border: "1px dashed var(--phi-debug-layer-slot-border)",
|
|
52
|
-
borderRadius: "var(--
|
|
52
|
+
borderRadius: "var(--phi-border-radius)",
|
|
53
53
|
background: "var(--phi-debug-layer-slot-background-soft)",
|
|
54
54
|
} }, `grid-guide-${profile}-${index}`));
|
|
55
55
|
});
|
|
@@ -127,11 +127,11 @@ export function PhiGridLayout({ slots, ...layoutProps }) {
|
|
|
127
127
|
minWidth: 0,
|
|
128
128
|
width: "100%",
|
|
129
129
|
height: "100%",
|
|
130
|
-
minHeight: "var(--
|
|
130
|
+
minHeight: "var(--phi-control-height-lg)",
|
|
131
131
|
display: "flex",
|
|
132
132
|
alignItems: "center",
|
|
133
133
|
justifyContent: "center",
|
|
134
|
-
borderRadius: "var(--
|
|
134
|
+
borderRadius: "var(--phi-border-radius-lg)",
|
|
135
135
|
}, children: editRenderInsertControl({
|
|
136
136
|
presentation: "inline",
|
|
137
137
|
slotIndex: nextInsertSlotIndex,
|
|
@@ -39,7 +39,7 @@ export function PhiSequenceSlotEditor({ slots, slotKeys, slotLabels, slotCount,
|
|
|
39
39
|
flex: "0 0 auto",
|
|
40
40
|
width: "100%",
|
|
41
41
|
justifyContent: "center",
|
|
42
|
-
paddingBottom: "var(--
|
|
42
|
+
paddingBottom: "var(--phi-padding-xs)",
|
|
43
43
|
}, children: [_jsx("span", { onClick: (event) => event.stopPropagation(), children: _jsx(PhiButtonControl, { ariaLabel: `Previous ${slotNoun}`, icon: _jsx(PhiIcon, { name: "left", size: "inherit" }), size: "small", type: "text", disabled: !hasPreviousSlot, onClick: () => onActiveIndexChange(currentIndex - 1) }) }), _jsxs(PhiTypographyControl, { type: "secondary", style: { minWidth: 64, textAlign: "center" }, children: [currentIndex + 1, " / ", editableSlotCount] }), _jsx("span", { onClick: (event) => event.stopPropagation(), children: _jsx(PhiButtonControl, { ariaLabel: `Next ${slotNoun}`, icon: _jsx(PhiIcon, { name: "right", size: "inherit" }), size: "small", type: "text", disabled: !hasNextSlot, onClick: () => onActiveIndexChange(currentIndex + 1) }) })] }), _jsxs("div", { className: phiLayoutSlotClassName(isAuthoringRender), "data-phi-layout-has-content": phiLayoutSlotContentMarker(isAuthoringRender, hasCurrentSlot), "data-phi-sequence-active-slot": currentSlotKey, style: {
|
|
44
44
|
position: "relative",
|
|
45
45
|
display: "flex",
|
|
@@ -556,7 +556,7 @@ export declare const PHI_SPLIT_CARD_LAYOUT_DEFINITION: {
|
|
|
556
556
|
readonly background: {
|
|
557
557
|
readonly base: {
|
|
558
558
|
readonly kind: "color";
|
|
559
|
-
readonly color: "var(--
|
|
559
|
+
readonly color: "var(--phi-color-bg-container)";
|
|
560
560
|
};
|
|
561
561
|
readonly overlay: null;
|
|
562
562
|
readonly filter: null;
|
|
@@ -565,7 +565,7 @@ export declare const PHI_SPLIT_CARD_LAYOUT_DEFINITION: {
|
|
|
565
565
|
readonly border: {
|
|
566
566
|
readonly borderWidth: 1;
|
|
567
567
|
readonly borderStyle: "solid";
|
|
568
|
-
readonly borderColor: "var(--
|
|
568
|
+
readonly borderColor: "var(--phi-color-border-secondary)";
|
|
569
569
|
};
|
|
570
570
|
readonly shadow: "soft";
|
|
571
571
|
};
|
|
@@ -1247,7 +1247,7 @@ export declare const PHI_CORE_LAYOUT_DEFINITIONS: readonly [{
|
|
|
1247
1247
|
readonly background: {
|
|
1248
1248
|
readonly base: {
|
|
1249
1249
|
readonly kind: "color";
|
|
1250
|
-
readonly color: "var(--
|
|
1250
|
+
readonly color: "var(--phi-color-bg-container)";
|
|
1251
1251
|
};
|
|
1252
1252
|
readonly overlay: null;
|
|
1253
1253
|
readonly filter: null;
|
|
@@ -1256,7 +1256,7 @@ export declare const PHI_CORE_LAYOUT_DEFINITIONS: readonly [{
|
|
|
1256
1256
|
readonly border: {
|
|
1257
1257
|
readonly borderWidth: 1;
|
|
1258
1258
|
readonly borderStyle: "solid";
|
|
1259
|
-
readonly borderColor: "var(--
|
|
1259
|
+
readonly borderColor: "var(--phi-color-border-secondary)";
|
|
1260
1260
|
};
|
|
1261
1261
|
readonly shadow: "soft";
|
|
1262
1262
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { PHI_LAYOUT } from "../../theme/phi-tokens";
|
|
4
4
|
import { usePhiAuthoringRegionOverrides } from "../runtime/authoring-region-overrides";
|
|
5
|
-
const PHI_PADDING = "var(--
|
|
5
|
+
const PHI_PADDING = "var(--phi-padding)";
|
|
6
6
|
export function PhiPageRegionLayout({ blockId, headerBottom, hero, content, siderRight, footerTop, style, }) {
|
|
7
7
|
const overrides = usePhiAuthoringRegionOverrides();
|
|
8
8
|
const isPreviewMode = overrides.preview;
|
|
@@ -4,9 +4,9 @@ import { usePhiConfig } from "../root/phi-config-provider";
|
|
|
4
4
|
import { PHI_LAYOUT } from "../../theme/phi-tokens";
|
|
5
5
|
import { usePhiAuthoringRegionOverrides } from "../runtime/authoring-region-overrides";
|
|
6
6
|
import { PhiTypographyControl } from "../controls/phi-typography-control";
|
|
7
|
-
const PHI_PADDING = "var(--
|
|
8
|
-
const PHI_PADDING_XS = "var(--
|
|
9
|
-
const PHI_COLOR_BORDER_SECONDARY = "var(--
|
|
7
|
+
const PHI_PADDING = "var(--phi-padding)";
|
|
8
|
+
const PHI_PADDING_XS = "var(--phi-padding-xs)";
|
|
9
|
+
const PHI_COLOR_BORDER_SECONDARY = "var(--phi-color-border-secondary)";
|
|
10
10
|
export function PhiStructureRegionLayout({ blockId, headerTop, headerMain, siderLeft, footerMain, footerBottom, style, labels, }) {
|
|
11
11
|
const { token } = usePhiConfig();
|
|
12
12
|
const overrides = usePhiAuthoringRegionOverrides();
|
|
@@ -255,7 +255,7 @@ function PhiAssetFocalRectEditor({ asset, config, }) {
|
|
|
255
255
|
maxHeight: "calc(100dvh - 240px)",
|
|
256
256
|
minHeight: 240,
|
|
257
257
|
overflow: "hidden",
|
|
258
|
-
background: "var(--
|
|
258
|
+
background: "var(--phi-color-fill-tertiary)",
|
|
259
259
|
}, children: _jsx("div", { ref: canvasRef, onPointerDown: pointerDown, onPointerMove: pointerMove, onPointerUp: pointerUp, onPointerCancel: pointerUp, style: { position: "absolute", inset: 0, cursor, touchAction: "none", userSelect: "none" }, children: _jsxs("div", { ref: imageRef, style: {
|
|
260
260
|
position: "absolute",
|
|
261
261
|
left: imageBox?.left ?? 0,
|
|
@@ -270,9 +270,9 @@ function PhiAssetFocalRectEditor({ asset, config, }) {
|
|
|
270
270
|
top: `${draft.y * 100}%`,
|
|
271
271
|
width: `${draft.width * 100}%`,
|
|
272
272
|
height: `${draft.height * 100}%`,
|
|
273
|
-
border: "2px solid var(--
|
|
274
|
-
boxShadow: "0 0 0 1px var(--
|
|
275
|
-
background: "color-mix(in srgb, var(--
|
|
273
|
+
border: "2px solid var(--phi-color-primary)",
|
|
274
|
+
boxShadow: "0 0 0 1px var(--phi-color-bg-container) inset",
|
|
275
|
+
background: "color-mix(in srgb, var(--phi-color-primary) 12%, transparent)",
|
|
276
276
|
cursor,
|
|
277
277
|
}, children: [_jsxs("div", { style: { position: "absolute", insetInlineStart: 8, top: 8, display: "flex", gap: 6, flexWrap: "wrap" }, children: [_jsx(PhiTagControl, { color: "blue", children: `x ${focalRectToPercent(draft.x)}` }), _jsx(PhiTagControl, { color: "blue", children: `y ${focalRectToPercent(draft.y)}` })] }), _jsxs("div", { style: { position: "absolute", insetInlineEnd: 8, bottom: 8, display: "flex", gap: 6, flexWrap: "wrap" }, children: [_jsx(PhiTagControl, { color: "blue", children: `w ${focalRectToPercent(draft.width)}` }), _jsx(PhiTagControl, { color: "blue", children: `h ${focalRectToPercent(draft.height)}` })] })] })) : null] }) }) }));
|
|
278
278
|
}
|
|
@@ -112,7 +112,7 @@ export function PhiAssetInspectorSection({ section, asset, selectedVariantKey, s
|
|
|
112
112
|
width: "100%",
|
|
113
113
|
minWidth: 0,
|
|
114
114
|
"--phi-labeled-control-label-width": "33.333333%",
|
|
115
|
-
}, children: [_jsxs("div", { style: { position: "relative", width: "100%", aspectRatio: "4 / 3", overflow: "hidden", borderRadius: "var(--
|
|
115
|
+
}, children: [_jsxs("div", { style: { position: "relative", width: "100%", aspectRatio: "4 / 3", overflow: "hidden", borderRadius: "var(--phi-border-radius-lg)", background: "var(--phi-color-fill-tertiary)" }, children: [asset.kind === PhiMediaKind.Image ? (isOriginalSelection ? (originalCoverImageStyle ? (_jsx(NextImage, { alt: asset.altText ?? asset.title ?? asset.originalName, src: asset.deliveryUrl, width: asset.width ?? 1, height: asset.height ?? 1, unoptimized: unoptimizedPreview, sizes: "340px", placeholder: asset.blurDataUrl ? "blur" : "empty", blurDataURL: asset.blurDataUrl ?? undefined, style: originalCoverImageStyle })) : (_jsx(NextImage, { alt: asset.altText ?? asset.title ?? asset.originalName, src: asset.deliveryUrl, fill: true, unoptimized: unoptimizedPreview, sizes: "340px", placeholder: asset.blurDataUrl ? "blur" : "empty", blurDataURL: asset.blurDataUrl ?? undefined, style: { objectFit: "cover" } }))) : (_jsx("div", { style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center" }, children: previewFrame?.fixedCropBox ? (_jsx("div", { style: { position: "relative", width: previewFrame.fixedCropBox, height: previewFrame.fixedCropBox, flex: "0 0 auto", overflow: "hidden" }, children: _jsx(NextImage, { alt: asset.altText ?? asset.title ?? asset.originalName, src: variantPresentation?.url ?? asset.deliveryUrl, width: previewFrame.fixedCropBox, height: previewFrame.fixedCropBox, unoptimized: unoptimizedPreview, placeholder: asset.blurDataUrl ? "blur" : "empty", blurDataURL: asset.blurDataUrl ?? undefined, style: selectedVariantCoverImageStyle ?? undefined }) })) : (_jsx("div", { style: {
|
|
116
116
|
position: "relative",
|
|
117
117
|
width: previewFrame?.fitAxis === "width" ? "100%" : "auto",
|
|
118
118
|
height: previewFrame?.fitAxis === "height" ? "100%" : "auto",
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { PhiMediaKind } from "../../constants/media";
|
|
4
4
|
import { PhiIcon } from "../shell/phi-icon";
|
|
5
|
-
const PHI_COLOR_TEXT_SECONDARY = "var(--
|
|
6
|
-
const PHI_COLOR_PRIMARY = "var(--
|
|
5
|
+
const PHI_COLOR_TEXT_SECONDARY = "var(--phi-color-text-secondary)";
|
|
6
|
+
const PHI_COLOR_PRIMARY = "var(--phi-color-primary)";
|
|
7
7
|
export function PhiMediaKindIcon({ kind, size = 32, style, className }) {
|
|
8
8
|
const iconStyle = {
|
|
9
9
|
fontSize: `${size / 16}rem`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
3
|
import { PhiIcon } from "../shell/phi-icon";
|
|
4
|
-
const PHI_COLOR_ERROR = "var(--
|
|
4
|
+
const PHI_COLOR_ERROR = "var(--phi-color-error)";
|
|
5
5
|
export function PhiMediaRestrictedIcon({ size = 32, style, className, title = "not allowed", }) {
|
|
6
6
|
const iconStyle = {
|
|
7
7
|
fontSize: `${size / 16}rem`,
|
|
@@ -23,7 +23,7 @@ function renderOverlayZonesFailure(failure) {
|
|
|
23
23
|
return (_jsx(PhiAlertControl, { level: "error", title: "This content could not be shown.", description: failure }));
|
|
24
24
|
}
|
|
25
25
|
/** Stands where the body will be while the zones are on their way, so the shell opens at once. */
|
|
26
|
-
const PHI_OVERLAY_ZONES_PENDING = (_jsx("div", { "aria-busy": "true", style: { minBlockSize: "calc(var(--
|
|
26
|
+
const PHI_OVERLAY_ZONES_PENDING = (_jsx("div", { "aria-busy": "true", style: { minBlockSize: "calc(var(--phi-control-height) * 3)" } }));
|
|
27
27
|
/**
|
|
28
28
|
* Whether an `open` carried on a Table's action channel is meant for this Overlay.
|
|
29
29
|
*
|
|
@@ -18,8 +18,11 @@ export declare function buildPhiBasePageColumnFrame({ page, regionId, columnId,
|
|
|
18
18
|
regionId: number;
|
|
19
19
|
columnId: PhiCmsInstanceId;
|
|
20
20
|
label: string;
|
|
21
|
-
/**
|
|
22
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Where the column stops: a `PHI_LAYOUT` measure such as `readingMax` for prose, or `PHI_PAGE.max` for a
|
|
23
|
+
* Page as wide as the Theme lets one get.
|
|
24
|
+
*/
|
|
25
|
+
maxWidth: number | string;
|
|
23
26
|
}): {
|
|
24
27
|
regions: import("../../../types").PhiCmsRegionNode[];
|
|
25
28
|
layoutNodes: import("../../../types").PhiCmsLayoutNode[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PHI_CMS_DEFAULT_SLOT_INDEX } from "../../../constants/cms-layout-types";
|
|
2
2
|
import { createPhiCmsPresetNodes } from "../../../helpers/cms-preset-nodes";
|
|
3
3
|
import { PHI_SURFACE_WASH } from "../../../helpers/surface-presets";
|
|
4
|
-
import { PHI_SPACE } from "../../../theme/antd-css-var-contract";
|
|
4
|
+
import { PHI_PAGE, PHI_SPACE } from "../../../theme/antd-css-var-contract";
|
|
5
5
|
import { buildPhiBasePageContentScaffold, PHI_BASE_PAGE_LAYOUT_NODE_ID, } from "./phi-base-page-layout";
|
|
6
6
|
/**
|
|
7
7
|
* A module Page's content as one column on the base scaffold: the Region, the scaffold, and a vertical
|
|
@@ -32,7 +32,11 @@ export function buildPhiBasePageColumnFrame({ page, regionId, columnId, label, m
|
|
|
32
32
|
config: {
|
|
33
33
|
maxSize: { width: maxWidth },
|
|
34
34
|
surface: PHI_SURFACE_WASH,
|
|
35
|
-
padding
|
|
35
|
+
// The Theme's Page inset for the screen it is drawn on (`PHI_PAGE.padding`); a Layout's own wins.
|
|
36
|
+
paddingTop: PHI_PAGE.padding.top,
|
|
37
|
+
paddingRight: PHI_PAGE.padding.right,
|
|
38
|
+
paddingBottom: PHI_PAGE.padding.bottom,
|
|
39
|
+
paddingLeft: PHI_PAGE.padding.left,
|
|
36
40
|
// The house step between a preset's children; the Widgets keep their own air inside.
|
|
37
41
|
gap: PHI_SPACE.sm,
|
|
38
42
|
},
|
|
@@ -40,7 +40,7 @@ function PhiConfigValueProvider({ children, customColors, fonts, fontFamilies, h
|
|
|
40
40
|
}, [controlShapeVars]);
|
|
41
41
|
/*
|
|
42
42
|
* The typefaces, for the same reason. The font catalogue's classes are what define
|
|
43
|
-
* `--phi-font-source-*`, which the Theme's `--
|
|
43
|
+
* `--phi-font-source-*`, which the Theme's `--phi-font-family` points at; a Drawer or a Modal on
|
|
44
44
|
* `document.body` found the variable undefined and fell back to the browser's sans-serif.
|
|
45
45
|
*/
|
|
46
46
|
useEffect(() => {
|
|
@@ -115,7 +115,7 @@ export function resolvePhiRootBackgroundFrameStyle() {
|
|
|
115
115
|
* The fallback ground as a longhand, never as the `background` shorthand: it is the colour under
|
|
116
116
|
* every Picture, including the moment before the first one shows.
|
|
117
117
|
*/
|
|
118
|
-
backgroundColor: "var(--
|
|
118
|
+
backgroundColor: "var(--phi-color-bg-layout)",
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
/** The last `url(...)` of a background, which is the base picture: overlays are listed before it. */
|
|
@@ -112,7 +112,7 @@ export function resolvePhiRootTheme({ siteTheme, mode, fonts, presets, }) {
|
|
|
112
112
|
hashed: false,
|
|
113
113
|
zeroRuntime: true,
|
|
114
114
|
cssVar: {
|
|
115
|
-
prefix: "
|
|
115
|
+
prefix: "phi",
|
|
116
116
|
/*
|
|
117
117
|
* Named after what the tokens are resolved from, not after the tokens: the same Theme record,
|
|
118
118
|
* fonts, palette block and mode always resolve to the same tokens, and the record is a fraction
|
|
@@ -29,7 +29,7 @@ export function PhiModuleIcon({ name, size, style, className, title, ariaLabel,
|
|
|
29
29
|
* In the Builder the name stays visible as the mark's title: the Module is not active in the target
|
|
30
30
|
* Area, or does not register that name. Live, a missing icon is nothing, as an unknown `antd:` is.
|
|
31
31
|
*/
|
|
32
|
-
return flagUnavailable ? (_jsx(PhiAntdIcon, { icon: "WarningOutlined", size: size, title: name, className: className ? `phi-module-icon-unavailable ${className}` : "phi-module-icon-unavailable", style: { color: "var(--
|
|
32
|
+
return flagUnavailable ? (_jsx(PhiAntdIcon, { icon: "WarningOutlined", size: size, title: name, className: className ? `phi-module-icon-unavailable ${className}` : "phi-module-icon-unavailable", style: { color: "var(--phi-color-warning)", ...style } })) : null;
|
|
33
33
|
}
|
|
34
34
|
const { drawing } = icon;
|
|
35
35
|
return (_jsx("span", { role: "img", "aria-label": ariaLabel ?? icon.name, title: title, className: className ? `anticon ${className}` : "anticon", style: size === "1em" ? style : { fontSize: size, ...style }, children: _jsx("svg", { viewBox: drawing.viewBox, width: "1em", height: "1em", fill: "currentColor", "aria-hidden": "true", focusable: "false", children: drawing.paths.map((path, index) => (_jsx("path", { d: path, fillRule: drawing.fillRule }, index))) }) }));
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
const frameStyle = {
|
|
3
3
|
display: "grid",
|
|
4
|
-
gap: "var(--
|
|
4
|
+
gap: "var(--phi-padding-xs)",
|
|
5
5
|
gridTemplateRows: "auto auto minmax(5rem, 1fr) auto",
|
|
6
6
|
minHeight: "10rem",
|
|
7
7
|
width: "100%",
|
|
8
8
|
height: "100%",
|
|
9
|
-
padding: "var(--
|
|
10
|
-
border: "1px solid var(--
|
|
11
|
-
borderRadius: "var(--
|
|
12
|
-
background: "var(--
|
|
9
|
+
padding: "var(--phi-padding-sm)",
|
|
10
|
+
border: "1px solid var(--phi-color-border-secondary)",
|
|
11
|
+
borderRadius: "var(--phi-border-radius-lg)",
|
|
12
|
+
background: "var(--phi-color-bg-layout)",
|
|
13
13
|
boxSizing: "border-box",
|
|
14
14
|
};
|
|
15
15
|
const regionStyle = {
|
|
16
16
|
minHeight: "1.25rem",
|
|
17
|
-
borderRadius: "var(--
|
|
18
|
-
background: "var(--
|
|
17
|
+
borderRadius: "var(--phi-border-radius-sm)",
|
|
18
|
+
background: "var(--phi-color-fill-secondary)",
|
|
19
19
|
};
|
|
20
20
|
function Region({ style }) {
|
|
21
21
|
return _jsx("div", { "aria-hidden": true, style: { ...regionStyle, ...style } });
|
|
@@ -23,7 +23,7 @@ function Region({ style }) {
|
|
|
23
23
|
export function PhiBuilderWorkspacePreviewSkeleton({ kind, }) {
|
|
24
24
|
return (_jsxs("div", { "aria-label": kind === "pages" ? "Pages workspace preview" : "Shells workspace preview", "data-phi-builder-workspace-preview": kind, style: frameStyle, children: [_jsx(Region, {}), _jsx(Region, { style: { minHeight: kind === "pages" ? "2rem" : "1.5rem" } }), _jsxs("div", { style: {
|
|
25
25
|
display: "grid",
|
|
26
|
-
gap: "var(--
|
|
26
|
+
gap: "var(--phi-padding-xs)",
|
|
27
27
|
gridTemplateColumns: kind === "pages" ? "minmax(0, 1fr) 22%" : "22% minmax(0, 1fr)",
|
|
28
28
|
minHeight: 0,
|
|
29
29
|
}, children: [_jsx(Region, {}), _jsx(Region, {})] }), _jsx(Region, {})] }));
|