@phis/ui 0.5.2 → 0.5.4
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-cascader-control.d.ts +9 -1
- package/components/controls/phi-cascader-control.js +25 -3
- 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-money-control.d.ts +39 -0
- package/components/controls/phi-money-control.js +34 -0
- package/components/controls/phi-number-control.d.ts +6 -1
- package/components/controls/phi-number-control.js +3 -3
- package/components/controls/phi-options-provider.d.ts +7 -0
- package/components/controls/phi-options-provider.js +11 -0
- 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.d.ts +1 -0
- package/components/forms/extended-form-field-controls.js +24 -2
- package/components/forms/form-descriptor-runtime-client.js +13 -0
- package/components/forms/form-provider-contract.d.ts +43 -0
- package/components/forms/form-provider-contract.js +40 -0
- package/components/forms/money-field.d.ts +27 -0
- package/components/forms/money-field.js +78 -0
- package/components/forms/shared-form-provider-registry.js +6 -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-picker-binding.js +6 -1
- package/components/media/phi-media-restricted-icon.js +1 -1
- package/components/media/phi-site-font-assets.js +6 -1
- package/components/motion/phi-sequence-run.d.ts +14 -1
- package/components/motion/phi-sequence-run.js +22 -3
- package/components/motion/phi-sequence-viewport.js +3 -1
- package/components/overlays/phi-overlay-container-client.js +1 -1
- package/components/regions/presets/content-entry-editor-page-tree.js +3 -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/tables/client/phi-table-binding.js +16 -3
- package/components/trees/client/phi-tree-binding.js +6 -2
- 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/client/shared/phi-collection-view-binding.js +10 -2
- package/components/widgets/client/shared/phi-rendered-value.d.ts +9 -1
- package/components/widgets/client/shared/phi-rendered-value.js +20 -1
- package/components/widgets/config/background.d.ts +1 -1
- package/components/widgets/config/background.js +1 -1
- package/components/widgets/config/choice-shared.d.ts +2 -2
- package/components/widgets/inspector-field-row.js +1 -1
- package/components/widgets/label-sets/gallery.js +6 -0
- package/components/widgets/label-sets/inspector.js +2 -0
- package/components/widgets/label-sets/interval.d.ts +4 -0
- package/components/widgets/label-sets/interval.js +31 -0
- package/components/widgets/label-sets/record.js +6 -1
- package/components/widgets/label-sets/slot-upload.d.ts +4 -0
- package/components/widgets/label-sets/slot-upload.js +36 -0
- package/components/widgets/label-sets/table.js +6 -1
- package/components/widgets/label-types/gallery.d.ts +7 -0
- package/components/widgets/label-types/gallery.js +6 -0
- package/components/widgets/label-types/inspector.d.ts +1 -0
- package/components/widgets/label-types/inspector.js +1 -0
- package/components/widgets/label-types/interval.d.ts +16 -0
- package/components/widgets/label-types/interval.js +21 -0
- package/components/widgets/label-types/record.d.ts +3 -0
- package/components/widgets/label-types/record.js +2 -0
- package/components/widgets/label-types/slot-upload.d.ts +24 -0
- package/components/widgets/label-types/slot-upload.js +16 -0
- package/components/widgets/label-types/table.d.ts +3 -0
- package/components/widgets/label-types/table.js +2 -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 +2 -1
- package/controls.d.ts +7 -0
- package/controls.js +4 -0
- package/helpers/border-widget-style.d.ts +2 -2
- package/helpers/border-widget-style.js +2 -2
- package/helpers/cms-dialog.d.ts +43 -7
- package/helpers/cms-dialog.js +46 -4
- package/helpers/cms-layout-defaults.d.ts +2 -2
- package/helpers/cms-page-catalog.d.ts +13 -0
- package/helpers/cms-page-catalog.js +18 -2
- package/helpers/cms-preset-nodes.d.ts +13 -3
- package/helpers/cms-preset-nodes.js +3 -2
- 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/money-amount.d.ts +48 -0
- package/helpers/money-amount.js +131 -0
- package/helpers/page-layout-check.d.ts +4 -1
- package/helpers/page-layout-check.js +41 -2
- package/helpers/record-fields.d.ts +22 -0
- package/helpers/record-fields.js +109 -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 +7 -2
- package/module-records.js +5 -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 +11 -2
- package/plugins/runtime-modules/accounting/module.d.ts +1 -1
- package/plugins/runtime-modules/app/module.d.ts +1 -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/asset/services/collection.js +1 -0
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +2 -2
- package/plugins/runtime-modules/auth/trees/phi-default-admin-auth-settings-page-tree.js +3 -0
- 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/offered-page-catalog.js +3 -3
- package/plugins/runtime-modules/builder/options-providers.js +7 -0
- 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/trees/phi-default-builder-area-preset-tree.js +6 -3
- 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.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 +98 -0
- package/plugins/runtime-modules/core/form-providers.d.ts +43 -0
- package/plugins/runtime-modules/core/server.js +5 -0
- package/plugins/runtime-modules/core/widgets/breadcrumb/client.d.ts +6 -3
- package/plugins/runtime-modules/core/widgets/breadcrumb/client.js +6 -5
- package/plugins/runtime-modules/core/widgets/breadcrumb/plugin.js +1 -1
- package/plugins/runtime-modules/core/widgets/breadcrumb/server.d.ts +9 -1
- package/plugins/runtime-modules/core/widgets/breadcrumb/server.js +29 -3
- 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/cascader/authoring.d.ts +3 -3
- package/plugins/runtime-modules/core/widgets/cascader/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/cascader/config.d.ts +8 -2
- package/plugins/runtime-modules/core/widgets/cascader/config.js +22 -0
- package/plugins/runtime-modules/core/widgets/checkbox-group/config.d.ts +1 -1
- 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/authoring.js +12 -3
- package/plugins/runtime-modules/core/widgets/gallery/client.d.ts +4 -1
- package/plugins/runtime-modules/core/widgets/gallery/client.js +38 -21
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +18 -0
- package/plugins/runtime-modules/core/widgets/gallery/config.js +24 -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/multi-select/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/record/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/record/client.js +8 -2
- package/plugins/runtime-modules/core/widgets/record/config.js +4 -0
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +11 -0
- package/plugins/runtime-modules/core/widgets/segmented/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/select-box/config.d.ts +1 -1
- 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/slot-upload/authoring.js +2 -1
- package/plugins/runtime-modules/core/widgets/slot-upload/client.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/slot-upload/client.js +45 -24
- package/plugins/runtime-modules/core/widgets/slot-upload/config.d.ts +12 -4
- package/plugins/runtime-modules/core/widgets/slot-upload/config.js +18 -1
- package/plugins/runtime-modules/core/widgets/slot-upload/plugin.js +4 -2
- package/plugins/runtime-modules/core/widgets/slot-upload/server.d.ts +9 -3
- package/plugins/runtime-modules/core/widgets/slot-upload/server.js +17 -3
- package/plugins/runtime-modules/core/widgets/spacer/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/steps/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/table/client.js +4 -4
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +37 -0
- package/plugins/runtime-modules/core/widgets/table/config.js +3 -0
- package/plugins/runtime-modules/descriptor-compiler.d.ts +11 -1
- package/plugins/runtime-modules/descriptor-compiler.js +57 -8
- package/plugins/runtime-modules/editor/presets.d.ts +1 -0
- package/plugins/runtime-modules/groups/definition.d.ts +1 -1
- package/plugins/runtime-modules/groups/forms.d.ts +18 -0
- package/plugins/runtime-modules/groups/forms.js +2 -2
- package/plugins/runtime-modules/groups/trees/phi-default-admin-groups-page-tree.js +6 -4
- package/plugins/runtime-modules/localization/presets.d.ts +1 -0
- package/plugins/runtime-modules/news/presets.d.ts +1 -0
- package/plugins/runtime-modules/public/module.d.ts +1 -1
- package/plugins/runtime-modules/resolver.js +7 -0
- package/plugins/runtime-modules/revisions/presets.d.ts +1 -0
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +2 -2
- package/plugins/runtime-modules/theme/presets.d.ts +1 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +25 -2
- package/plugins/runtime-modules/threads/trees/phi-default-threads-page-tree.js +4 -2
- package/plugins/runtime-modules/user-management/controller/client.js +6 -1
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +3 -3
- package/runtime-render-client.d.ts +1 -1
- package/runtime-render-client.js +2 -1
- package/server-helpers/cms-page-record.d.ts +26 -0
- package/server-helpers/cms-page-record.js +52 -0
- package/server-helpers/cms-request.js +48 -4
- package/server-helpers/record-fields.d.ts +62 -0
- package/server-helpers/record-fields.js +86 -0
- package/server-helpers/record-samples.d.ts +21 -0
- package/server-helpers/record-samples.js +49 -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 +9 -0
- package/types/cms-plugins.d.ts +27 -1
- package/types/collection-provider.d.ts +7 -0
- package/types/core-widget-placements.d.ts +42 -0
- package/types/record-provider.d.ts +109 -1
- package/types/table-widget.d.ts +33 -1
- package/types/table-widget.js +1 -0
- package/types/tree-widget.d.ts +7 -0
- package/types/widget-runtime.d.ts +5 -0
- package/types.d.ts +1 -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
|
@@ -15,7 +15,7 @@ import { hasPhiFlag } from "../../../../helpers/flags";
|
|
|
15
15
|
import { PhiCmsFlags } from "../../../../constants/phi-cms";
|
|
16
16
|
import { PhiInspectorSignalSection, } from "./inspector-signal-section";
|
|
17
17
|
import { PhiTypographyControl } from "../../../../components/controls/phi-typography-control";
|
|
18
|
-
const PHI_GAP_SM = "var(--
|
|
18
|
+
const PHI_GAP_SM = "var(--phi-padding-sm)";
|
|
19
19
|
function isPhiCmsChromeConfigField(field) {
|
|
20
20
|
return (field.type === "padding"
|
|
21
21
|
|| field.type === "grid-placement"
|
|
@@ -32,7 +32,7 @@ export function PhiPlusButtonWidget({ slotIndex, label, onInsert, ariaLabel, dro
|
|
|
32
32
|
? " phi-layout-affordance--drop-rejected"
|
|
33
33
|
: "";
|
|
34
34
|
return (_jsx("span", { style: PHI_SCAFFOLD_BUTTON_BOUNDARY_STYLE, onClick: stopAtScaffold, children: _jsx(PhiButtonControl, { ref: setNodeRef, className: `phi-layout-affordance phi-layout-affordance--insert${dropStateClassName}`, type: "dashed", size: "small", icon: _jsx(PhiIcon, { name: "plus", size: "inherit" }), ariaLabel: ariaLabel ?? (labelText ? `Insert child after ${labelText}` : "Insert child"), onClick: () => onInsert(slotIndex), style: {
|
|
35
|
-
"--phi-layout-affordance-size": "var(--
|
|
35
|
+
"--phi-layout-affordance-size": "var(--phi-control-height)",
|
|
36
36
|
} }) }, `insert-${slotIndex}`));
|
|
37
37
|
}
|
|
38
38
|
export function PhiLayoutDragButtonWidget({ dragData, ariaLabel = "Move node", }) {
|
|
@@ -51,16 +51,16 @@ export function PhiLayoutDragButtonWidget({ dragData, ariaLabel = "Move node", }
|
|
|
51
51
|
buttonRef.current = node;
|
|
52
52
|
setNodeRef(node);
|
|
53
53
|
}, listeners: listeners, attributes: attributes, dragging: isDragging, className: "phi-layout-affordance phi-layout-affordance--drag", style: {
|
|
54
|
-
"--phi-layout-affordance-size": "var(--
|
|
54
|
+
"--phi-layout-affordance-size": "var(--phi-control-height-sm)",
|
|
55
55
|
} }));
|
|
56
56
|
}
|
|
57
57
|
export function PhiLayoutDeleteButtonWidget({ onDelete, ariaLabel = "Delete layout" }) {
|
|
58
58
|
return (_jsx("span", { style: PHI_SCAFFOLD_BUTTON_BOUNDARY_STYLE, onMouseDown: holdFocusAtScaffold, onClick: stopAtScaffold, children: _jsx(PhiButtonControl, { className: "phi-layout-affordance phi-layout-affordance--delete", ariaLabel: ariaLabel, icon: _jsx(PhiIcon, { name: "delete", size: "inherit" }), danger: true, type: "text", size: "small", onClick: onDelete, style: {
|
|
59
|
-
"--phi-layout-affordance-size": "var(--
|
|
59
|
+
"--phi-layout-affordance-size": "var(--phi-control-height-sm)",
|
|
60
60
|
} }) }));
|
|
61
61
|
}
|
|
62
62
|
export function PhiLayoutConfigButtonWidget({ onOpenInspector, ariaLabel = "Open inspector", }) {
|
|
63
63
|
return (_jsx("span", { style: PHI_SCAFFOLD_BUTTON_BOUNDARY_STYLE, onMouseDown: holdFocusAtScaffold, onClick: stopAtScaffold, children: _jsx(PhiButtonControl, { className: "phi-layout-affordance phi-layout-affordance--config", ariaLabel: ariaLabel, icon: _jsx(PhiIcon, { name: "setting", size: "inherit" }), type: "text", size: "small", onClick: onOpenInspector, style: {
|
|
64
|
-
"--phi-layout-affordance-size": "var(--
|
|
64
|
+
"--phi-layout-affordance-size": "var(--phi-control-height-sm)",
|
|
65
65
|
} }) }));
|
|
66
66
|
}
|
|
@@ -67,7 +67,7 @@ export function PhiLayoutDeleteButtonOverlay({ onDelete, onOpenInspector, ariaLa
|
|
|
67
67
|
"--phi-layout-scaffold-delete-background": chromeTheme.background,
|
|
68
68
|
"--phi-layout-scaffold-delete-border": chromeTheme.border,
|
|
69
69
|
"--phi-layout-scaffold-delete-color": chromeTheme.color,
|
|
70
|
-
"--phi-layout-scaffold-delete-shadow": "var(--
|
|
70
|
+
"--phi-layout-scaffold-delete-shadow": "var(--phi-box-shadow-tertiary)",
|
|
71
71
|
}, children: pageModeTone.wrap(children ?? (_jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [leading, onOpenInspector ? (_jsx(PhiLayoutConfigButtonWidget, { onOpenInspector: onOpenInspector, ariaLabel: inspectorAriaLabel })) : null, _jsx(PhiLayoutDeleteButtonWidget, { onDelete: onDelete, ariaLabel: ariaLabel })] }))) }));
|
|
72
72
|
}
|
|
73
73
|
export function PhiLayoutDragButtonOverlay({ dragData, ariaLabel, nodeKind, top = "50%", left = 0, zIndex = 41, }) {
|
|
@@ -13,7 +13,7 @@ import { PhiRegionVisibilityFields } from "./region-visibility-fields";
|
|
|
13
13
|
import { renderPhiInspectorConfigField } from "./inspector-config-field";
|
|
14
14
|
import { hasPhiFlag, readPhiFlags } from "../../../../helpers/flags";
|
|
15
15
|
import { PhiCmsFlags } from "../../../../constants/phi-cms";
|
|
16
|
-
const PHI_GAP_SM = "var(--
|
|
16
|
+
const PHI_GAP_SM = "var(--phi-padding-sm)";
|
|
17
17
|
const REGION_PADDING_KEYS = [
|
|
18
18
|
"padding",
|
|
19
19
|
"paddingTop",
|
|
@@ -11,7 +11,7 @@ import { readPhiPageReference } from "../../../../types/references";
|
|
|
11
11
|
import { usePhiDeveloperBuilderStateValue } from "../developer-workspace-store";
|
|
12
12
|
import { usePhiBuilderOfferedPageCatalog } from "../use-offered-page-catalog";
|
|
13
13
|
import { renderPhiInspectorConfigField, renderPhiInspectorSettingsRow } from "./inspector-config-field";
|
|
14
|
-
const PHI_GAP_SM = "var(--
|
|
14
|
+
const PHI_GAP_SM = "var(--phi-padding-sm)";
|
|
15
15
|
/**
|
|
16
16
|
* The Region config with a new Page scope and reveal. `all` and `always` are what a Region does without
|
|
17
17
|
* either, so they are stored as nothing; a list mode keeps its entries even while there are none, so the
|
|
@@ -239,12 +239,12 @@ export function PhiDeveloperBuilderStructureCanvas({ workspace = "structure", bu
|
|
|
239
239
|
height: "100%",
|
|
240
240
|
minHeight: 0,
|
|
241
241
|
}, {
|
|
242
|
-
"--phi-builder-structure-canvas-body-padding": isPagesWorkspace ? "0px" : "var(--
|
|
242
|
+
"--phi-builder-structure-canvas-body-padding": isPagesWorkspace ? "0px" : "var(--phi-padding-xs)",
|
|
243
243
|
"--phi-builder-structure-canvas-outer-gap": "0px",
|
|
244
244
|
}), children: _jsx(PhiFlexControl, { vertical: true, className: "phi-builder-structure-canvas__stack", style: {
|
|
245
245
|
height: "100%",
|
|
246
246
|
flex: "1 1 auto",
|
|
247
|
-
padding: isPagesWorkspace ? 0 : "var(--
|
|
247
|
+
padding: isPagesWorkspace ? 0 : "var(--phi-padding-xs)",
|
|
248
248
|
borderRadius: 0,
|
|
249
249
|
background: token.colorFillSecondary,
|
|
250
250
|
border: "none",
|
|
@@ -11,5 +11,5 @@ export function PhiWidgetEffectsToolButton({ effects, target, disabled = false,
|
|
|
11
11
|
return;
|
|
12
12
|
openPhiDeveloperBuilderEffectsEditor(effects ?? {}, target, onChange);
|
|
13
13
|
};
|
|
14
|
-
return (_jsx("div", { className: "phi-layout-affordance phi-layout-affordance--effects", onMouseDown: (event) => { event.preventDefault(); event.stopPropagation(); }, onClick: (event) => event.stopPropagation(), style: { "--phi-layout-affordance-size": "var(--
|
|
14
|
+
return (_jsx("div", { className: "phi-layout-affordance phi-layout-affordance--effects", onMouseDown: (event) => { event.preventDefault(); event.stopPropagation(); }, onClick: (event) => event.stopPropagation(), style: { "--phi-layout-affordance-size": "var(--phi-control-height-sm)" }, children: _jsx(PhiButtonControl, { ariaLabel: labels.openEditor, tooltip: labels.openEditor, icon: _jsx(PhiIcon, { name: "node-index", size: "inherit" }), type: "text", size: "small", disabled: disabled || !onChange, onClick: open }) }));
|
|
15
15
|
}
|
|
@@ -13,6 +13,7 @@ import type { PhiCmsGeometryWidgetConfig } from "../../../../components/widgets/
|
|
|
13
13
|
import type { PhiRuntimeModuleDataProviderDescriptor } from "../../../../types/cms-plugins";
|
|
14
14
|
import type { PhiCalendarAdapterDescriptor } from "../../../../types/calendar";
|
|
15
15
|
import type { PhiVideoProviderDescriptor } from "../../../../types/video";
|
|
16
|
+
import type { PhiRecordFieldDescriptor } from "../../../../types/record-provider";
|
|
16
17
|
import type { PhiBuilderWidgetMeta } from "../../../../types/builder";
|
|
17
18
|
import type { PhiSignalRoute } from "../../../../types/signals";
|
|
18
19
|
import { type PhiInspectorWidgetReferenceOption } from "./inspector-config-field";
|
|
@@ -46,6 +47,8 @@ type PhiDeveloperBuilderWidgetInspectorWidgetClientProps = {
|
|
|
46
47
|
dataProviderDescriptors?: readonly PhiRuntimeModuleDataProviderDescriptor[];
|
|
47
48
|
calendarAdapterDescriptors?: readonly PhiCalendarAdapterDescriptor[];
|
|
48
49
|
videoProviderDescriptors?: readonly PhiVideoProviderDescriptor[];
|
|
50
|
+
/** The declared fields of the record the edited Page is about; empty on a Page that is about none. */
|
|
51
|
+
pageRecordFields?: readonly PhiRecordFieldDescriptor[];
|
|
49
52
|
};
|
|
50
|
-
export declare function PhiDeveloperBuilderWidgetInspectorWidgetClient({ section, builderMode, selectedStructureNodeKey, selectedStructureNodeKind, selectedStructureNodeTitle, selectedStructureWidgetMeta, currentDraft, widgetReferenceOptions, signalRouteScope, onConfigChange, onGeometryChange, onSurfaceChange, onTranslateChange, geometryLabels, surfaceLabels, backgroundLabels, borderLabels, renderMediaPicker, signalsLabels, colorPickerLabels, iconPickerLabels, fieldLabels, dataProviderDescriptors, calendarAdapterDescriptors, videoProviderDescriptors, }: PhiDeveloperBuilderWidgetInspectorWidgetClientProps): import("react").JSX.Element;
|
|
53
|
+
export declare function PhiDeveloperBuilderWidgetInspectorWidgetClient({ section, builderMode, selectedStructureNodeKey, selectedStructureNodeKind, selectedStructureNodeTitle, selectedStructureWidgetMeta, currentDraft, widgetReferenceOptions, signalRouteScope, onConfigChange, onGeometryChange, onSurfaceChange, onTranslateChange, geometryLabels, surfaceLabels, backgroundLabels, borderLabels, renderMediaPicker, signalsLabels, colorPickerLabels, iconPickerLabels, fieldLabels, dataProviderDescriptors, calendarAdapterDescriptors, videoProviderDescriptors, pageRecordFields, }: PhiDeveloperBuilderWidgetInspectorWidgetClientProps): import("react").JSX.Element;
|
|
51
54
|
export {};
|
|
@@ -15,8 +15,8 @@ import { buildPhiInspectorConfigPathPatch, isPhiInspectorConfigFieldVisible, rea
|
|
|
15
15
|
import { PhiTypographyControl } from "../../../../components/controls/phi-typography-control";
|
|
16
16
|
import { PhiCmsFlags } from "../../../../constants/phi-cms";
|
|
17
17
|
import { hasPhiFlag } from "../../../../helpers/flags";
|
|
18
|
-
const PHI_GAP_SM = "var(--
|
|
19
|
-
export function PhiDeveloperBuilderWidgetInspectorWidgetClient({ section, builderMode = "editor", selectedStructureNodeKey = null, selectedStructureNodeKind = null, selectedStructureNodeTitle = null, selectedStructureWidgetMeta = null, currentDraft = null, widgetReferenceOptions = [], signalRouteScope = "widget", onConfigChange, onGeometryChange, onSurfaceChange, onTranslateChange, geometryLabels, surfaceLabels, backgroundLabels, borderLabels, renderMediaPicker, signalsLabels, colorPickerLabels, iconPickerLabels, fieldLabels, dataProviderDescriptors = [], calendarAdapterDescriptors = [], videoProviderDescriptors = [], }) {
|
|
18
|
+
const PHI_GAP_SM = "var(--phi-padding-sm)";
|
|
19
|
+
export function PhiDeveloperBuilderWidgetInspectorWidgetClient({ section, builderMode = "editor", selectedStructureNodeKey = null, selectedStructureNodeKind = null, selectedStructureNodeTitle = null, selectedStructureWidgetMeta = null, currentDraft = null, widgetReferenceOptions = [], signalRouteScope = "widget", onConfigChange, onGeometryChange, onSurfaceChange, onTranslateChange, geometryLabels, surfaceLabels, backgroundLabels, borderLabels, renderMediaPicker, signalsLabels, colorPickerLabels, iconPickerLabels, fieldLabels, dataProviderDescriptors = [], calendarAdapterDescriptors = [], videoProviderDescriptors = [], pageRecordFields = [], }) {
|
|
20
20
|
const isPreviewMode = builderMode === "preview";
|
|
21
21
|
const isTargetKind = selectedStructureNodeKind === "widget";
|
|
22
22
|
const currentWidgetConfig = resolvePhiBuilderWidgetDraftConfig(selectedStructureWidgetMeta, currentDraft?.config);
|
|
@@ -81,6 +81,7 @@ export function PhiDeveloperBuilderWidgetInspectorWidgetClient({ section, builde
|
|
|
81
81
|
dataProviderDescriptors,
|
|
82
82
|
calendarAdapterDescriptors,
|
|
83
83
|
videoProviderDescriptors,
|
|
84
|
+
pageRecordFields,
|
|
84
85
|
onChange: (next) => {
|
|
85
86
|
const patch = buildPhiInspectorConfigPathPatch(currentWidgetSettingsConfigRecord, next);
|
|
86
87
|
/*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { resolvePhiBuilderAreaAsCmsArea } from "../../../constants/cms-areas";
|
|
3
3
|
import { choosePhiAreaRootApplicant, resolvePhiAreaLandingSelection, } from "../../../helpers/cms-area-config";
|
|
4
|
-
import { findPhiBuilderPageKeyFromStoragePath, normalizePhiBuilderCmsCatalogPath, resolvePhiBuilderActivePageCatalog, resolvePhiBuilderActivePageKey, resolvePhiBuilderPageKeyFromCatalogPath, } from "../../../helpers/cms-page-catalog";
|
|
4
|
+
import { findPhiBuilderPageKeyFromStoragePath, normalizePhiBuilderCmsCatalogPath, resolvePhiBuilderActivePageCatalog, resolvePhiBuilderActivePageKey, resolvePhiBuilderRequestedPageKey, resolvePhiBuilderPageKeyFromCatalogPath, } from "../../../helpers/cms-page-catalog";
|
|
5
5
|
import { findFirstPhiCmsNavigationLinkPath } from "../../../components/regions/presets/navigation-redirect";
|
|
6
6
|
import { resolvePhiRuntimeAreaDefinition } from "../area-definitions";
|
|
7
7
|
import { resolvePhiAreaRootRouteNavKey } from "../area-root-route";
|
|
@@ -201,8 +201,8 @@ function findPageKeyByReference(nodes, reference) {
|
|
|
201
201
|
*/
|
|
202
202
|
export function resolvePhiBuilderOfferedPageKey(state, area, requestedPageKey) {
|
|
203
203
|
const pages = resolvePhiBuilderOfferedPageCatalog(state, area);
|
|
204
|
-
const requested = requestedPageKey
|
|
205
|
-
if (requested
|
|
204
|
+
const requested = resolvePhiBuilderRequestedPageKey(requestedPageKey, pages);
|
|
205
|
+
if (requested) {
|
|
206
206
|
return { pages, pageKey: requested };
|
|
207
207
|
}
|
|
208
208
|
const rootRoute = readPhiBuilderStoredAreaRootRoute(state, area);
|
|
@@ -22,6 +22,13 @@ function resolveProviderArea(context) {
|
|
|
22
22
|
}
|
|
23
23
|
function collectPageOptions(area, nodes) {
|
|
24
24
|
return nodes.flatMap((node) => {
|
|
25
|
+
/*
|
|
26
|
+
* A folder is offered as its Pages only. The picker chooses only what it is offered
|
|
27
|
+
* (`select: "options"`), so the folder the Cascader draws for them opens and chooses nothing.
|
|
28
|
+
*/
|
|
29
|
+
if (!node.storagePath) {
|
|
30
|
+
return collectPageOptions(area, node.children ?? []);
|
|
31
|
+
}
|
|
25
32
|
const path = resolvePhiBuilderCatalogPathForCatalog(area, node.key, nodes);
|
|
26
33
|
/*
|
|
27
34
|
* The root reads as the address, not as the title of whatever Page is standing in it.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "server-only";
|
|
2
2
|
import type { PhiBlockRuntime } from "../../../types/widget-runtime";
|
|
3
3
|
import type { PhiRuntimeModuleCatalog } from "../../../types";
|
|
4
|
+
import type { PhiCmsPageRecordDescriptor } from "../../../types/record-provider";
|
|
4
5
|
import type { PhiDeveloperBuilderArea, PhiDeveloperBuilderRegionDraft } from "./developer-workspace-types";
|
|
5
6
|
import type { PhiCmsTreeControllerSettings } from "../../../types/cms";
|
|
6
7
|
export type PhiBuilderPageDraftsByScope = Partial<Record<PhiDeveloperBuilderArea, Partial<Record<string, PhiDeveloperBuilderRegionDraft | null>>>>;
|
|
@@ -29,6 +30,11 @@ export type PhiBuilderPageMeta = {
|
|
|
29
30
|
*/
|
|
30
31
|
controllerSettings: PhiCmsTreeControllerSettings;
|
|
31
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* The record a route preset's Page is about, for the Page the Builder is on: `null` for a Page that is no
|
|
35
|
+
* route preset or whose route names none.
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolvePhiBuilderPagePresetRecord(runtime: PhiBlockRuntime, area: PhiDeveloperBuilderArea, pageKey: string, runtimeModuleCatalog: PhiRuntimeModuleCatalog): Promise<PhiCmsPageRecordDescriptor | null>;
|
|
32
38
|
export declare const buildPhiBuilderPagesDraftsByScope: (runtime: PhiBlockRuntime, runtimeModuleCatalog: PhiRuntimeModuleCatalog) => Promise<PhiBuilderPageDraftsMapByScope>;
|
|
33
39
|
export declare function resolvePhiBuilderCurrentPageScope(runtime: PhiBlockRuntime, runtimeModuleCatalog: PhiRuntimeModuleCatalog): Promise<{
|
|
34
40
|
area: "public" | "app" | "admin" | "builder" | "editor" | "accounting";
|
|
@@ -75,6 +75,14 @@ async function resolvePhiRegistryPresetPageBinding({ runtime, runtimeModuleCatal
|
|
|
75
75
|
: null;
|
|
76
76
|
return binding ? { binding, activeModuleKeys } : null;
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* The record a route preset's Page is about, for the Page the Builder is on: `null` for a Page that is no
|
|
80
|
+
* route preset or whose route names none.
|
|
81
|
+
*/
|
|
82
|
+
export async function resolvePhiBuilderPagePresetRecord(runtime, area, pageKey, runtimeModuleCatalog) {
|
|
83
|
+
const resolution = await resolvePhiRegistryPresetPageBinding({ runtime, runtimeModuleCatalog, area, pageKey });
|
|
84
|
+
return resolution?.binding.descriptor.pageRecord ?? null;
|
|
85
|
+
}
|
|
78
86
|
/**
|
|
79
87
|
* A preset Page the Site has stored nothing for, as the Builder edits it: the preset's tree with the
|
|
80
88
|
* current content of every node somebody wrote content for (phis-server CONTENT.md).
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { PHI_BUILDER_PREVIEW_SEARCH_PARAM } from "./preview-transport";
|
|
3
3
|
import { loadPhiBuilderPreviewSnapshot } from "./preview-store";
|
|
4
|
-
import { buildPhiBuilderPagesDraftsByScope, buildPhiBuilderPageMetaForScope, resolvePhiBuilderCurrentPageScope, } from "./page-presets.server";
|
|
4
|
+
import { buildPhiBuilderPagesDraftsByScope, buildPhiBuilderPageMetaForScope, resolvePhiBuilderCurrentPageScope, resolvePhiBuilderPagePresetRecord, } from "./page-presets.server";
|
|
5
5
|
import { buildPhiBuilderPreviewRenderableTrees, buildPhiBuilderServerPreviewRegions, } from "./render-root-node-preview.server";
|
|
6
6
|
import { PhiDeveloperBuilderPagesWorkspaceWidgetClient } from "./clients/pages-workspace";
|
|
7
|
+
import { resolvePhiPageRecordSampleBinding } from "../../../server-helpers/record-samples";
|
|
7
8
|
import { buildPhiBuilderRuntimeModuleIdsForArea } from "./area-shell-presets.server";
|
|
8
9
|
import { resolvePhiBuilderCanvasRuntimeModuleSandbox } from "./runtime-module-sandbox.server";
|
|
9
10
|
import { PhiBuilderWorkspaceScopeBoundary } from "./clients/workspace-scope-boundary";
|
|
@@ -47,6 +48,15 @@ export async function PhiDeveloperBuilderPagesWorkspaceWidget({ runtime, registr
|
|
|
47
48
|
activeModuleIds: sandbox.moduleSet.activeModuleIds,
|
|
48
49
|
viewer: runtime.viewer,
|
|
49
50
|
}));
|
|
51
|
+
/*
|
|
52
|
+
* A template of a route about a record is previewed with the first sample its Provider offers; the
|
|
53
|
+
* Editor canvas keeps showing each Widget's own content. A Provider with no samples leaves the Page
|
|
54
|
+
* about no record, and the template previews with its Widgets' own content as well.
|
|
55
|
+
*/
|
|
56
|
+
const pageRecord = await resolvePhiBuilderPagePresetRecord(runtime, previewArea, previewPageKey, registry.runtimeModuleCatalog);
|
|
57
|
+
const sampleRecord = pageRecord
|
|
58
|
+
? await resolvePhiPageRecordSampleBinding({ registry: sandbox.registry, runtime, pageRecord })
|
|
59
|
+
: null;
|
|
50
60
|
const previewRuntime = {
|
|
51
61
|
...runtime,
|
|
52
62
|
page: {
|
|
@@ -57,6 +67,7 @@ export async function PhiDeveloperBuilderPagesWorkspaceWidget({ runtime, registr
|
|
|
57
67
|
descriptionMsgId: runtime.page?.descriptionMsgId ?? null,
|
|
58
68
|
title: pageMeta.title ?? runtime.page?.title ?? null,
|
|
59
69
|
description: pageMeta.description ?? runtime.page?.description ?? null,
|
|
70
|
+
...(sampleRecord ? { record: sampleRecord } : {}),
|
|
60
71
|
},
|
|
61
72
|
};
|
|
62
73
|
return (_jsx(PhiBuilderRuntimeModuleAuthoringBoundary, { targetArea: previewArea, catalog: authoringCatalog, pickerDataProviderKeys: resolvePhiBuilderAuthoringPickerDataProviderKeysFromCatalog(registry.runtimeModuleCatalog), children: _jsx(PhiBuilderWorkspaceScopeBoundary, { kind: "pages", targetArea: previewArea, targetPageKey: previewPageKey, children: _jsx(PhiDeveloperBuilderPagesWorkspaceWidgetClient, { pageDraftsByScope: pageDraftsByScope, pageMeta: pageMeta, pageMetaArea: previewArea, pageMetaPageKey: previewPageKey, serverPreviewRegions: buildPhiBuilderServerPreviewRegions({
|
|
@@ -209,8 +209,8 @@ function PhiEffectsPreviewButton({ config, blockKind, onRun, }) {
|
|
|
209
209
|
transform: "translate(-50%, -50%)",
|
|
210
210
|
// Its own size, for the same reason the tool bar states its width inline: it stands in a frame
|
|
211
211
|
// whose children `styles/layout.css` stretches, and a stylesheet answer did not hold there.
|
|
212
|
-
width: "var(--
|
|
213
|
-
"--phi-layout-affordance-size": "var(--
|
|
212
|
+
width: "var(--phi-control-height)",
|
|
213
|
+
"--phi-layout-affordance-size": "var(--phi-control-height)",
|
|
214
214
|
} })) }));
|
|
215
215
|
}
|
|
216
216
|
function PhiSignalWiringToolButton({ onOpen }) {
|
|
@@ -228,11 +228,11 @@ function PhiSignalWiringToolButton({ onOpen }) {
|
|
|
228
228
|
function PhiViewportIntersectionDiagnostic() {
|
|
229
229
|
return (_jsx("span", { "aria-label": "This block is hidden at every viewport because its visibility does not overlap its ancestors.", title: "Hidden at every viewport: this block's Compact/Medium/Wide selection has no overlap with its ancestors.", style: {
|
|
230
230
|
alignItems: "center",
|
|
231
|
-
color: "var(--
|
|
231
|
+
color: "var(--phi-color-warning)",
|
|
232
232
|
display: "inline-flex",
|
|
233
|
-
height: "var(--
|
|
233
|
+
height: "var(--phi-control-height-sm)",
|
|
234
234
|
justifyContent: "center",
|
|
235
|
-
width: "var(--
|
|
235
|
+
width: "var(--phi-control-height-sm)",
|
|
236
236
|
}, children: _jsx(PhiIcon, { name: "warning", size: "inherit" }) }));
|
|
237
237
|
}
|
|
238
238
|
const PHI_WIDGET_AUTHORING_TEXT_SELECTOR = [
|
|
@@ -53,8 +53,8 @@ function PhiStructureDragSnapshot({ source, }) {
|
|
|
53
53
|
overflow: "hidden",
|
|
54
54
|
pointerEvents: "none",
|
|
55
55
|
opacity: 0.86,
|
|
56
|
-
borderRadius: "var(--
|
|
57
|
-
boxShadow: "var(--
|
|
56
|
+
borderRadius: "var(--phi-border-radius)",
|
|
57
|
+
boxShadow: "var(--phi-box-shadow-secondary)",
|
|
58
58
|
} }));
|
|
59
59
|
}
|
|
60
60
|
export function PhiStructureDndProvider({ children, }) {
|
|
@@ -27,7 +27,7 @@ import { PHI_BUILDER_AREA_SETTINGS_LAYOUT_IDS, PHI_BUILDER_AREA_SETTINGS_OVERLAY
|
|
|
27
27
|
import { PHI_BUILDER_PAGE_META_FORM_ID } from "../page-meta-form";
|
|
28
28
|
import { PHI_BUILDER_AREA_SETTINGS_FORM_ID } from "../area-settings-form";
|
|
29
29
|
import { getPhiBuilderNavigationPageLabels } from "./builder-navigation-label-set";
|
|
30
|
-
import { PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG } from "../../../../helpers/cms-dialog";
|
|
30
|
+
import { PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG, PHI_DIALOG_WIDTH_SINGLE_COLUMN, } from "../../../../helpers/cms-dialog";
|
|
31
31
|
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
32
32
|
const SYNTHETIC_DEV_REGION_IDS = {
|
|
33
33
|
regionHeaderTop: -509,
|
|
@@ -724,7 +724,7 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
724
724
|
label: "Builder area settings",
|
|
725
725
|
config: {
|
|
726
726
|
title: labels.areaSettings.title,
|
|
727
|
-
width:
|
|
727
|
+
width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
|
|
728
728
|
/*
|
|
729
729
|
* Mounted with the Page rather than on first open, because the controls inside show state
|
|
730
730
|
* rather than ask for it.
|
|
@@ -754,7 +754,7 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
754
754
|
label: "Builder page metadata",
|
|
755
755
|
config: {
|
|
756
756
|
title: labels.pages.pageMeta,
|
|
757
|
-
width:
|
|
757
|
+
width: PHI_DIALOG_WIDTH_SINGLE_COLUMN,
|
|
758
758
|
mountPolicy: "lazy-keep",
|
|
759
759
|
closeMode: "immediate",
|
|
760
760
|
signalRoutes: {
|
|
@@ -1398,6 +1398,9 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1398
1398
|
label: "dev pages select",
|
|
1399
1399
|
config: {
|
|
1400
1400
|
key: "pageSelect",
|
|
1401
|
+
// Folders open under the pointer and choose nothing: only a Page is offered.
|
|
1402
|
+
expandTrigger: "hover",
|
|
1403
|
+
select: "options",
|
|
1401
1404
|
signalRoutes: {
|
|
1402
1405
|
emits: [
|
|
1403
1406
|
{
|
|
@@ -13,6 +13,6 @@ export function PhiTestBlockWidget({ labels, config }) {
|
|
|
13
13
|
alignItems: "center",
|
|
14
14
|
justifyContent: "center",
|
|
15
15
|
textAlign: "center",
|
|
16
|
-
border: "1px solid var(--
|
|
16
|
+
border: "1px solid var(--phi-color-primary)",
|
|
17
17
|
}, children: labels.text }));
|
|
18
18
|
}
|
|
@@ -100,6 +100,7 @@ export declare function definePhiContentEntryRoutes(spec: PhiContentEntryRoutesS
|
|
|
100
100
|
activeModuleIds: ReadonlySet<PhiRuntimeModuleId>;
|
|
101
101
|
params: Readonly<Record<string, string>>;
|
|
102
102
|
}) => import("../../types").PhiResolvedCmsPageTree | Promise<import("../../types").PhiResolvedCmsPageTree>;
|
|
103
|
+
pageRecord?: import("../../types/record-provider").PhiCmsPageRecordDescriptor;
|
|
103
104
|
navigation?: readonly import("../../types").PhiCmsNavigationInjectionDescriptor[];
|
|
104
105
|
})[];
|
|
105
106
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PHI_SHARED_PACKAGE_NAME } from "../../constants/package";
|
|
2
2
|
import { createPhiRuntimeModuleId } from "../../constants/module-identity";
|
|
3
|
+
import { PHI_RECORD_FIELD_KINDS } from "../../constants/record-field-kinds";
|
|
3
4
|
import { isPhiCalendarAdapterKey } from "../../types/calendar";
|
|
4
5
|
import { collectPhiVideoProviderDescriptorErrors, isPhiVideoProviderKey, } from "../../types/video";
|
|
5
6
|
import { isPhiFormId, readPhiFormPackageName } from "../../types/form-id";
|
|
@@ -734,13 +735,52 @@ export function createPhiRuntimeModuleCatalog(entries, areaDefinitions) {
|
|
|
734
735
|
* and answers nothing, a function without a descriptor is never offered. Both are caught here, where the
|
|
735
736
|
* catalog is built, rather than on the first page that binds them.
|
|
736
737
|
*/
|
|
738
|
+
function assertPhiRecordDeclaration(owner, declaration) {
|
|
739
|
+
if (declaration.audience !== "public" && declaration.audience !== "viewer") {
|
|
740
|
+
throw new Error(`${owner} has an invalid audience.`);
|
|
741
|
+
}
|
|
742
|
+
const keys = new Set();
|
|
743
|
+
for (const field of declaration.fields) {
|
|
744
|
+
if (!/^[a-z][A-Za-z0-9]*$/.test(field.key)) {
|
|
745
|
+
throw new Error(`${owner} has an invalid field key "${field.key}".`);
|
|
746
|
+
}
|
|
747
|
+
if (keys.has(field.key)) {
|
|
748
|
+
throw new Error(`${owner} declares field "${field.key}" twice.`);
|
|
749
|
+
}
|
|
750
|
+
keys.add(field.key);
|
|
751
|
+
if (!PHI_RECORD_FIELD_KINDS.includes(field.kind)) {
|
|
752
|
+
throw new Error(`${owner} field "${field.key}" has an invalid kind.`);
|
|
753
|
+
}
|
|
754
|
+
if (!field.label.trim()) {
|
|
755
|
+
throw new Error(`${owner} field "${field.key}" has no label.`);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
}
|
|
737
759
|
function assertPhiRuntimeModuleRecordProviders(definition, entry) {
|
|
738
|
-
const
|
|
760
|
+
const descriptors = (definition.dataProviders ?? []).flatMap((provider) => provider.kind === "record" ? [provider] : []);
|
|
761
|
+
const declared = new Set(descriptors.map((provider) => provider.key));
|
|
762
|
+
const withFields = new Set();
|
|
763
|
+
for (const descriptor of descriptors) {
|
|
764
|
+
if (!descriptor.record)
|
|
765
|
+
continue;
|
|
766
|
+
withFields.add(descriptor.key);
|
|
767
|
+
assertPhiRecordDeclaration(`${definition.moduleId}: record descriptor "${descriptor.key}"`, descriptor.record);
|
|
768
|
+
}
|
|
739
769
|
const served = new Set();
|
|
740
770
|
for (const provider of entry.recordProviders ?? []) {
|
|
741
771
|
if (!declared.has(provider.key)) {
|
|
742
772
|
throw new Error(`${definition.moduleId}: record provider "${provider.key}" has no record descriptor in its dataProviders.`);
|
|
743
773
|
}
|
|
774
|
+
// Declared fields and their reader come as a pair, for the reason the descriptor and its resolver do.
|
|
775
|
+
if (withFields.has(provider.key) !== (provider.loadFields !== undefined)) {
|
|
776
|
+
throw new Error(provider.loadFields
|
|
777
|
+
? `${definition.moduleId}: record provider "${provider.key}" has a field reader, but its descriptor declares no fields.`
|
|
778
|
+
: `${definition.moduleId}: record descriptor "${provider.key}" declares fields, but its server half has no field reader.`);
|
|
779
|
+
}
|
|
780
|
+
// A sample stands in for the record a Page is about, so it needs a record that declares fields.
|
|
781
|
+
if (provider.loadSamples && !withFields.has(provider.key)) {
|
|
782
|
+
throw new Error(`${definition.moduleId}: record provider "${provider.key}" offers samples, but its descriptor declares no fields.`);
|
|
783
|
+
}
|
|
744
784
|
if (served.has(provider.key)) {
|
|
745
785
|
throw new Error(`${definition.moduleId}: record provider "${provider.key}" is served twice.`);
|
|
746
786
|
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/** How the Folder's pictures are ordered; the words a record binding's `sort` takes. */
|
|
2
|
+
export declare const PHI_MEDIA_FOLDER_IMAGES_SORTS: readonly ["name_asc", "created_at_desc"];
|
|
3
|
+
export declare const PHI_MEDIA_FOLDER_IMAGES_DEFAULT_LIMIT = 50;
|
|
4
|
+
/** What the server hands out at most (`/api/v1/site/media/folder-images`). */
|
|
5
|
+
export declare const PHI_MEDIA_FOLDER_IMAGES_MAX_LIMIT = 200;
|
|
1
6
|
export declare const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
2
7
|
key: `${string}/${string}`;
|
|
3
8
|
ownerModuleId: "@phis/ui/modules/core";
|
|
@@ -324,4 +329,59 @@ export declare const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
324
329
|
options?: undefined;
|
|
325
330
|
})[];
|
|
326
331
|
resources?: undefined;
|
|
332
|
+
} | {
|
|
333
|
+
key: `${string}/${string}`;
|
|
334
|
+
ownerModuleId: "@phis/ui/modules/core";
|
|
335
|
+
kind: "record";
|
|
336
|
+
executionMode: "live";
|
|
337
|
+
authoringMode: "none";
|
|
338
|
+
title: string;
|
|
339
|
+
description: string;
|
|
340
|
+
settingsFields: ({
|
|
341
|
+
key: string;
|
|
342
|
+
type: "choice";
|
|
343
|
+
heading: string;
|
|
344
|
+
label: string;
|
|
345
|
+
optionsProvider: {
|
|
346
|
+
providerKey: `${string}/${string}`;
|
|
347
|
+
};
|
|
348
|
+
description?: undefined;
|
|
349
|
+
options?: undefined;
|
|
350
|
+
min?: undefined;
|
|
351
|
+
max?: undefined;
|
|
352
|
+
} | {
|
|
353
|
+
key: string;
|
|
354
|
+
type: "boolean";
|
|
355
|
+
label: string;
|
|
356
|
+
description: string;
|
|
357
|
+
heading?: undefined;
|
|
358
|
+
optionsProvider?: undefined;
|
|
359
|
+
options?: undefined;
|
|
360
|
+
min?: undefined;
|
|
361
|
+
max?: undefined;
|
|
362
|
+
} | {
|
|
363
|
+
key: string;
|
|
364
|
+
type: "choice";
|
|
365
|
+
label: string;
|
|
366
|
+
options: {
|
|
367
|
+
value: string;
|
|
368
|
+
label: string;
|
|
369
|
+
}[];
|
|
370
|
+
heading?: undefined;
|
|
371
|
+
optionsProvider?: undefined;
|
|
372
|
+
description?: undefined;
|
|
373
|
+
min?: undefined;
|
|
374
|
+
max?: undefined;
|
|
375
|
+
} | {
|
|
376
|
+
key: string;
|
|
377
|
+
type: "number";
|
|
378
|
+
label: string;
|
|
379
|
+
min: number;
|
|
380
|
+
max: number;
|
|
381
|
+
heading?: undefined;
|
|
382
|
+
optionsProvider?: undefined;
|
|
383
|
+
description?: undefined;
|
|
384
|
+
options?: undefined;
|
|
385
|
+
})[];
|
|
386
|
+
resources?: undefined;
|
|
327
387
|
})[];
|
|
@@ -2,6 +2,12 @@ import { PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS } from "../../../constants/core-dat
|
|
|
2
2
|
import { PHI_CORE_RUNTIME_MODULE_ID } from "./ids";
|
|
3
3
|
import { PHI_CORE_MESSAGING_DATA_PROVIDER_DESCRIPTORS } from "./messaging/data-providers";
|
|
4
4
|
import { PHI_CONTENT_ENTRY_KINDS } from "../../../constants/content-entry-kinds";
|
|
5
|
+
import { PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS } from "../../../constants/media-library-provider-keys";
|
|
6
|
+
/** How the Folder's pictures are ordered; the words a record binding's `sort` takes. */
|
|
7
|
+
export const PHI_MEDIA_FOLDER_IMAGES_SORTS = ["name_asc", "created_at_desc"];
|
|
8
|
+
export const PHI_MEDIA_FOLDER_IMAGES_DEFAULT_LIMIT = 50;
|
|
9
|
+
/** What the server hands out at most (`/api/v1/site/media/folder-images`). */
|
|
10
|
+
export const PHI_MEDIA_FOLDER_IMAGES_MAX_LIMIT = 200;
|
|
5
11
|
export const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
6
12
|
{
|
|
7
13
|
key: PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS.spacingScale,
|
|
@@ -236,4 +242,39 @@ export const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
236
242
|
{ key: "slug", type: "string", label: "Address" },
|
|
237
243
|
],
|
|
238
244
|
},
|
|
245
|
+
/*
|
|
246
|
+
* The pictures of a Folder, read on the server while the page is drawn (`types/record-provider.ts`).
|
|
247
|
+
* A Folder is a thing somebody keeps filling, so the page reads it rather than naming each picture:
|
|
248
|
+
* what is public in the branch at render time is what the Gallery shows.
|
|
249
|
+
*/
|
|
250
|
+
{
|
|
251
|
+
key: PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.folderImages,
|
|
252
|
+
ownerModuleId: PHI_CORE_RUNTIME_MODULE_ID,
|
|
253
|
+
kind: "record",
|
|
254
|
+
executionMode: "live",
|
|
255
|
+
// The Builder draws a placeholder for a Gallery and reads nothing.
|
|
256
|
+
authoringMode: "none",
|
|
257
|
+
title: "Media folder pictures",
|
|
258
|
+
description: "The public pictures of one media folder, with its subfolders unless told otherwise.",
|
|
259
|
+
settingsFields: [
|
|
260
|
+
{
|
|
261
|
+
key: "folderId",
|
|
262
|
+
type: "choice",
|
|
263
|
+
heading: "Folder",
|
|
264
|
+
label: "Folder",
|
|
265
|
+
optionsProvider: { providerKey: PHI_MEDIA_LIBRARY_DATA_PROVIDER_KEYS.folderChoices },
|
|
266
|
+
},
|
|
267
|
+
{ key: "topLevelOnly", type: "boolean", label: "This folder only", description: "Leave the pictures in its subfolders out." },
|
|
268
|
+
{
|
|
269
|
+
key: "sort",
|
|
270
|
+
type: "choice",
|
|
271
|
+
label: "Order",
|
|
272
|
+
options: [
|
|
273
|
+
{ value: "name_asc", label: "By file name" },
|
|
274
|
+
{ value: "created_at_desc", label: "Newest first" },
|
|
275
|
+
],
|
|
276
|
+
},
|
|
277
|
+
{ key: "limit", type: "number", label: "At most", min: 1, max: PHI_MEDIA_FOLDER_IMAGES_MAX_LIMIT },
|
|
278
|
+
],
|
|
279
|
+
},
|
|
239
280
|
];
|