@phis/ui 0.8.1 → 0.8.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 +9 -2
- package/components/calendar/gregory-calendar-adapter-client.js +1 -0
- package/components/controls/phi-accordion-control.d.ts +6 -0
- package/components/controls/phi-accordion-control.js +8 -13
- package/components/controls/phi-background-control.js +2 -5
- package/components/controls/phi-builder-insert-picker-control-labels.d.ts +2 -0
- package/components/controls/phi-builder-insert-picker-control-labels.js +1 -0
- package/components/controls/phi-builder-insert-picker-control.js +10 -11
- package/components/controls/phi-cascader-control.d.ts +9 -3
- package/components/controls/phi-cascader-control.js +38 -10
- package/components/controls/phi-checkbox-group-control.d.ts +3 -1
- package/components/controls/phi-checkbox-group-control.js +2 -2
- package/components/controls/phi-collapse-control.d.ts +9 -2
- package/components/controls/phi-collapse-control.js +14 -2
- package/components/controls/phi-color-control.d.ts +3 -1
- package/components/controls/phi-color-control.js +2 -2
- package/components/controls/phi-color-field-control.d.ts +6 -1
- package/components/controls/phi-color-field-control.js +2 -2
- package/components/controls/phi-confirm-control.d.ts +1 -1
- package/components/controls/phi-confirm-control.js +71 -2
- package/components/controls/phi-confirm-dialog.js +2 -1
- package/components/controls/phi-date-picker-control.js +1 -1
- package/components/controls/phi-dimension-control.d.ts +3 -1
- package/components/controls/phi-dimension-control.js +2 -2
- package/components/controls/phi-geometry-control.js +1 -1
- package/components/controls/phi-length-control.d.ts +6 -1
- package/components/controls/phi-length-control.js +3 -2
- package/components/controls/phi-multi-select-control.d.ts +6 -1
- package/components/controls/phi-multi-select-control.js +3 -3
- package/components/controls/phi-segmented-control.d.ts +6 -1
- package/components/controls/phi-segmented-control.js +3 -3
- package/components/controls/phi-switch-control.d.ts +3 -1
- package/components/controls/phi-switch-control.js +3 -3
- package/components/controls/phi-table-control.d.ts +8 -1
- package/components/controls/phi-table-control.js +11 -5
- package/components/forms/compound-form-controls.js +16 -1
- package/components/layouts/clients/phi-collapsible-layout-client.js +2 -6
- package/components/media/media-upload-flow.d.ts +62 -5
- package/components/media/media-upload-flow.js +62 -24
- package/components/media/media-widget-labels.d.ts +2 -0
- package/components/media/media-widget-labels.js +2 -0
- package/components/media/phi-area-upload-widget.d.ts +44 -1
- package/components/media/phi-area-upload-widget.js +32 -7
- package/components/media/phi-asset-inspector-section.js +19 -1
- package/components/media/phi-media-upload.d.ts +10 -3
- package/components/media/phi-media-upload.js +11 -8
- package/components/regions/presets/phi-area-shell-preset-nodes.js +2 -0
- package/components/shell/phi-builder-icon.js +9 -1
- package/components/shell/phi-widget-icon.js +1 -0
- package/components/tables/phi-table-surface.d.ts +25 -0
- package/components/tables/phi-table-surface.js +25 -0
- package/components/widgets/builder/phi-static-rows-editor.js +4 -1
- package/components/widgets/client/html-editor-link-node.d.ts +12 -0
- package/components/widgets/client/html-editor-link-node.js +60 -0
- package/components/widgets/client/html-editor.js +10 -6
- package/components/widgets/client/shared/phi-choice-controller.d.ts +8 -1
- package/components/widgets/client/shared/phi-choice-controller.js +16 -1
- package/components/widgets/client/shared/phi-collection-view-binding.js +33 -26
- package/components/widgets/config/choice-shared.d.ts +2 -0
- package/components/widgets/config/choice-shared.js +1 -0
- package/components/widgets/config/image-variant-options.d.ts +4 -1
- package/components/widgets/config/image-variant-options.js +27 -14
- package/components/widgets/inspector-field-row.d.ts +14 -1
- package/components/widgets/inspector-field-row.js +21 -1
- package/components/widgets/label-sets/builder-chrome.js +2 -0
- package/components/widgets/label-sets/inspector.js +10 -0
- package/components/widgets/label-sets/security.js +2 -0
- package/components/widgets/label-types/inspector.d.ts +5 -0
- package/components/widgets/label-types/inspector.js +5 -0
- package/components/widgets/label-types/security.d.ts +2 -0
- package/components/widgets/signals/signal-endpoint-list.js +4 -1
- package/constants/cms-widget-types.d.ts +1 -0
- package/constants/cms-widget-types.js +3 -0
- package/constants/runtime-module-ownership.js +1 -0
- package/gateway/site-proxy.d.ts +12 -0
- package/gateway/site-proxy.js +20 -0
- package/helpers/cms-inspector-drawer.d.ts +15 -0
- package/helpers/cms-inspector-drawer.js +37 -0
- package/helpers/cms-layout-defaults.js +1 -1
- package/helpers/preset-tree-contract-check.js +56 -0
- package/helpers/text-source.js +2 -0
- package/net/phi-next-proxy.d.ts +7 -0
- package/net/phi-next-proxy.js +1 -1
- package/package.json +27 -14
- package/plugins/runtime-modules/accounting/definition.d.ts +1 -1
- package/plugins/runtime-modules/accounting/definition.js +0 -1
- package/plugins/runtime-modules/accounting/ids.d.ts +4 -4
- package/plugins/runtime-modules/accounting/ids.js +4 -2
- package/plugins/runtime-modules/accounting/module.d.ts +1 -1
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +2 -1
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +5 -4
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +80 -38
- package/plugins/runtime-modules/admin/definition.d.ts +1 -1
- package/plugins/runtime-modules/admin/definition.js +0 -1
- package/plugins/runtime-modules/admin/module.d.ts +1 -1
- package/plugins/runtime-modules/app/definition.d.ts +1 -1
- package/plugins/runtime-modules/app/definition.js +0 -1
- package/plugins/runtime-modules/app/module.d.ts +1 -1
- package/plugins/runtime-modules/area-base-definition.d.ts +19 -1
- package/plugins/runtime-modules/area-base-definition.js +18 -0
- package/plugins/runtime-modules/area-contributions/admin.d.ts +1 -1
- package/plugins/runtime-modules/area-contributions/admin.js +2 -0
- package/plugins/runtime-modules/area-definitions.d.ts +8 -8
- package/plugins/runtime-modules/area-definitions.js +4 -3
- package/plugins/runtime-modules/area-root-route.d.ts +8 -0
- package/plugins/runtime-modules/area-root-route.js +11 -1
- package/plugins/runtime-modules/asset/labels.js +4 -0
- package/plugins/runtime-modules/asset/metadata-form.d.ts +0 -28
- package/plugins/runtime-modules/asset/metadata-form.js +6 -10
- package/plugins/runtime-modules/asset/services/options.d.ts +3 -2
- package/plugins/runtime-modules/asset/services/options.js +4 -3
- package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +2 -1
- package/plugins/runtime-modules/asset/trees/phi-default-builder-media-page-tree.js +3 -3
- package/plugins/runtime-modules/auth/widgets/security/client.js +2 -2
- package/plugins/runtime-modules/avatar/addresses.d.ts +1 -1
- package/plugins/runtime-modules/builder/addresses.d.ts +1 -1
- package/plugins/runtime-modules/builder/addresses.js +1 -1
- package/plugins/runtime-modules/builder/area-settings-form.js +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-condition-group.d.ts +16 -0
- package/plugins/runtime-modules/builder/clients/inspector-condition-group.js +9 -0
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +97 -10
- package/plugins/runtime-modules/builder/clients/pages-header.js +7 -6
- package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +7 -4
- package/plugins/runtime-modules/builder/definition.d.ts +1 -1
- package/plugins/runtime-modules/builder/definition.js +0 -1
- package/plugins/runtime-modules/builder/offered-page-catalog.d.ts +10 -4
- package/plugins/runtime-modules/builder/offered-page-catalog.js +35 -8
- package/plugins/runtime-modules/builder/page-meta-form.js +5 -2
- package/plugins/runtime-modules/builder/plugin-meta-labels.js +8 -0
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +4 -2
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +20 -13
- package/plugins/runtime-modules/builder/workspace-catalog-actions.js +8 -1
- package/plugins/runtime-modules/cdn/authoring-widgets.d.ts +3 -0
- package/plugins/runtime-modules/cdn/authoring-widgets.js +7 -0
- package/plugins/runtime-modules/cdn/authoring.d.ts +1 -0
- package/plugins/runtime-modules/cdn/authoring.js +8 -0
- package/plugins/runtime-modules/cdn/bytes.d.ts +5 -0
- package/plugins/runtime-modules/cdn/bytes.js +17 -0
- package/plugins/runtime-modules/cdn/client-data-providers.d.ts +7 -0
- package/plugins/runtime-modules/cdn/client-data-providers.js +9 -0
- package/plugins/runtime-modules/cdn/data-providers.d.ts +134 -0
- package/plugins/runtime-modules/cdn/data-providers.js +117 -0
- package/plugins/runtime-modules/cdn/definition.d.ts +140 -0
- package/plugins/runtime-modules/cdn/definition.js +23 -0
- package/plugins/runtime-modules/cdn/ids.d.ts +18 -0
- package/plugins/runtime-modules/cdn/ids.js +20 -0
- package/plugins/runtime-modules/cdn/module.d.ts +131 -0
- package/plugins/runtime-modules/cdn/module.js +4 -0
- package/plugins/runtime-modules/cdn/platform.d.ts +25 -0
- package/plugins/runtime-modules/cdn/platform.js +73 -0
- package/plugins/runtime-modules/cdn/presets.d.ts +2 -0
- package/plugins/runtime-modules/cdn/presets.js +20 -0
- package/plugins/runtime-modules/cdn/server.d.ts +1 -0
- package/plugins/runtime-modules/cdn/server.js +14 -0
- package/plugins/runtime-modules/cdn/services/table.d.ts +11 -0
- package/plugins/runtime-modules/cdn/services/table.js +296 -0
- package/plugins/runtime-modules/cdn/services/upload.d.ts +20 -0
- package/plugins/runtime-modules/cdn/services/upload.js +146 -0
- package/plugins/runtime-modules/cdn/table-params.d.ts +10 -0
- package/plugins/runtime-modules/cdn/table-params.js +10 -0
- package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.d.ts +95 -0
- package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.js +156 -0
- package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.d.ts +18 -0
- package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.js +491 -0
- package/plugins/runtime-modules/cdn/widgets/upload/client.d.ts +12 -0
- package/plugins/runtime-modules/cdn/widgets/upload/client.js +138 -0
- package/plugins/runtime-modules/cdn/widgets/upload/config.d.ts +29 -0
- package/plugins/runtime-modules/cdn/widgets/upload/config.js +43 -0
- package/plugins/runtime-modules/cdn/widgets/upload/label-types.d.ts +24 -0
- package/plugins/runtime-modules/cdn/widgets/upload/label-types.js +1 -0
- package/plugins/runtime-modules/cdn/widgets/upload/labels.d.ts +4 -0
- package/plugins/runtime-modules/cdn/widgets/upload/labels.js +72 -0
- package/plugins/runtime-modules/cdn/widgets/upload/plugin.d.ts +3 -0
- package/plugins/runtime-modules/cdn/widgets/upload/plugin.js +7 -0
- package/plugins/runtime-modules/cdn/widgets/upload/server.d.ts +8 -0
- package/plugins/runtime-modules/cdn/widgets/upload/server.js +17 -0
- package/plugins/runtime-modules/cdn/widgets.d.ts +2 -0
- package/plugins/runtime-modules/cdn/widgets.js +13 -0
- package/plugins/runtime-modules/client-authoring-providers/admin.d.ts +1 -1
- package/plugins/runtime-modules/client-authoring-providers/admin.js +6 -0
- package/plugins/runtime-modules/client-manifests/admin.js +11 -1
- package/plugins/runtime-modules/core/authoring-widgets.js +2 -1
- package/plugins/runtime-modules/core/messaging/label-defaults.d.ts +49 -0
- package/plugins/runtime-modules/core/messaging/label-defaults.js +48 -0
- package/plugins/runtime-modules/core/messaging/labels.d.ts +2 -28
- package/plugins/runtime-modules/core/messaging/labels.js +52 -23
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +3 -1
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/select-box/client.js +13 -4
- package/plugins/runtime-modules/core/widgets/select-box/config.js +1 -0
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/table/client.js +17 -8
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +1 -1143
- package/plugins/runtime-modules/core/widgets/table/config.js +144 -125
- package/plugins/runtime-modules/core/widgets/thread-conversation/authoring.d.ts +2 -0
- package/plugins/runtime-modules/core/widgets/thread-conversation/authoring.js +76 -0
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.d.ts +44 -1
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +28 -13
- package/plugins/runtime-modules/editor/definition.d.ts +1 -1
- package/plugins/runtime-modules/editor/definition.js +0 -1
- package/plugins/runtime-modules/editor/module.d.ts +1 -1
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +16 -8
- package/plugins/runtime-modules/public/definition.d.ts +1 -1
- package/plugins/runtime-modules/public/definition.js +0 -1
- package/plugins/runtime-modules/public/module.d.ts +1 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +109 -86
- package/plugins/runtime-modules/threads/controller/client.js +10 -12
- package/plugins/runtime-modules/threads/controller/definition.d.ts +6 -0
- package/plugins/runtime-modules/threads/controller/definition.js +17 -6
- package/styles/controls.css +49 -1
- package/styles/layout.css +3 -2
- package/types/calendar.d.ts +5 -0
- package/types/cms-plugins.d.ts +30 -10
- package/types/table-widget.d.ts +8 -2
|
@@ -66,38 +66,45 @@ export function usePhiCollectionViewBinding({ source, initialQuery, pageSize, })
|
|
|
66
66
|
const abortController = new AbortController();
|
|
67
67
|
const requestId = ++latestRequestRef.current;
|
|
68
68
|
const isCurrent = () => !abortController.signal.aborted && requestId === latestRequestRef.current;
|
|
69
|
-
|
|
69
|
+
let loadingTimer;
|
|
70
|
+
const queryTimer = window.setTimeout(() => {
|
|
70
71
|
if (abortController.signal.aborted)
|
|
71
72
|
return;
|
|
72
|
-
setLoading(true);
|
|
73
73
|
setError(null);
|
|
74
74
|
setQueryError(null);
|
|
75
|
+
// Reset the source first, and only show loading if its answer actually remains pending.
|
|
76
|
+
loadingTimer = window.setTimeout(() => {
|
|
77
|
+
if (isCurrent())
|
|
78
|
+
setLoading(true);
|
|
79
|
+
}, 0);
|
|
80
|
+
void Promise.resolve().then(() => provider.query({
|
|
81
|
+
resourceKey: source.resourceKey,
|
|
82
|
+
query,
|
|
83
|
+
params: source.params,
|
|
84
|
+
locale,
|
|
85
|
+
timeZone,
|
|
86
|
+
signal: abortController.signal,
|
|
87
|
+
})).then((nextData) => {
|
|
88
|
+
if (!isCurrent())
|
|
89
|
+
return;
|
|
90
|
+
setData(nextData);
|
|
91
|
+
setError(nextData.error);
|
|
92
|
+
setQueryError(nextData.error);
|
|
93
|
+
}).catch((nextError) => {
|
|
94
|
+
if (isCurrent()) {
|
|
95
|
+
const message = nextError instanceof Error ? nextError.message : "Collection request failed.";
|
|
96
|
+
setError(message);
|
|
97
|
+
setQueryError(message);
|
|
98
|
+
}
|
|
99
|
+
}).finally(() => {
|
|
100
|
+
window.clearTimeout(loadingTimer);
|
|
101
|
+
// Superseded by an action is still finished loading; only a newer query takes the flag over.
|
|
102
|
+
if (!abortController.signal.aborted)
|
|
103
|
+
setLoading(false);
|
|
104
|
+
});
|
|
75
105
|
}, 0);
|
|
76
|
-
void provider.query({
|
|
77
|
-
resourceKey: source.resourceKey,
|
|
78
|
-
query,
|
|
79
|
-
params: source.params,
|
|
80
|
-
locale,
|
|
81
|
-
timeZone,
|
|
82
|
-
signal: abortController.signal,
|
|
83
|
-
}).then((nextData) => {
|
|
84
|
-
if (!isCurrent())
|
|
85
|
-
return;
|
|
86
|
-
setData(nextData);
|
|
87
|
-
setError(nextData.error);
|
|
88
|
-
setQueryError(nextData.error);
|
|
89
|
-
}).catch((nextError) => {
|
|
90
|
-
if (isCurrent()) {
|
|
91
|
-
const message = nextError instanceof Error ? nextError.message : "Collection request failed.";
|
|
92
|
-
setError(message);
|
|
93
|
-
setQueryError(message);
|
|
94
|
-
}
|
|
95
|
-
}).finally(() => {
|
|
96
|
-
// Superseded by an action is still finished loading; only a newer query takes the flag over.
|
|
97
|
-
if (!abortController.signal.aborted)
|
|
98
|
-
setLoading(false);
|
|
99
|
-
});
|
|
100
106
|
return () => {
|
|
107
|
+
window.clearTimeout(queryTimer);
|
|
101
108
|
window.clearTimeout(loadingTimer);
|
|
102
109
|
abortController.abort();
|
|
103
110
|
};
|
|
@@ -12,6 +12,8 @@ export type PhiChoiceControlConfig = PhiControlConfig & PhiChoiceOptionsConfig &
|
|
|
12
12
|
placeholder?: string;
|
|
13
13
|
presentation?: "select" | "autocomplete";
|
|
14
14
|
allowCustom?: boolean;
|
|
15
|
+
/** A select that may be emptied again: its clear button announces the empty value. */
|
|
16
|
+
allowClear?: boolean;
|
|
15
17
|
};
|
|
16
18
|
/**
|
|
17
19
|
* The choice Controls that switch a stack -- Segmented, Steps, Tab Bar: options, a value and the Control's
|
|
@@ -59,6 +59,7 @@ export function parsePhiChoiceControlConfig(config) {
|
|
|
59
59
|
placeholder: reader.string("placeholder"),
|
|
60
60
|
presentation: reader.oneOf("presentation", ["select", "autocomplete"]) ?? "select",
|
|
61
61
|
allowCustom: reader.boolean("allowCustom"),
|
|
62
|
+
allowClear: reader.boolean("allowClear"),
|
|
62
63
|
...parsePhiChoiceOptionsConfig(config),
|
|
63
64
|
};
|
|
64
65
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { PhiControlOption } from "../../controls/phi-control-options";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* The renditions an Asset is offered in, for every field that picks one; stored as the number the key is.
|
|
4
|
+
* Built from the contracts' list, so every picker offers every variant the server renders.
|
|
5
|
+
*/
|
|
3
6
|
export declare const PHI_IMAGE_VARIANT_OPTIONS: PhiControlOption<number>[];
|
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { PhiImageAssetVariantKeyName } from "../../../constants/media";
|
|
2
|
+
/**
|
|
3
|
+
* The name every variant the contracts know is shown by. Typed against the contracts' names, so a variant
|
|
4
|
+
* added there without a name here fails the typecheck instead of being missing from every picker.
|
|
5
|
+
*/
|
|
6
|
+
const PHI_IMAGE_VARIANT_LABELS = {
|
|
7
|
+
thumbnail: "Thumbnail",
|
|
8
|
+
preview: "Preview",
|
|
9
|
+
banner: "Banner",
|
|
10
|
+
header: "Header",
|
|
11
|
+
card: "Card",
|
|
12
|
+
hero: "Hero",
|
|
13
|
+
avatar: "Avatar",
|
|
14
|
+
logo: "Logo",
|
|
15
|
+
landscape: "Landscape",
|
|
16
|
+
portrait: "Portrait",
|
|
17
|
+
icon: "Icon",
|
|
18
|
+
share: "Share",
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The renditions an Asset is offered in, for every field that picks one; stored as the number the key is.
|
|
22
|
+
* Built from the contracts' list, so every picker offers every variant the server renders.
|
|
23
|
+
*/
|
|
24
|
+
export const PHI_IMAGE_VARIANT_OPTIONS = Object.entries(PhiImageAssetVariantKeyName).map(([value, name]) => ({
|
|
25
|
+
value: Number(value),
|
|
26
|
+
label: PHI_IMAGE_VARIANT_LABELS[name],
|
|
27
|
+
}));
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
/** The label column every Inspector row shares, so a control that draws its own header lines up with the rest. */
|
|
3
3
|
export declare const PHI_INSPECTOR_FIELD_LABEL_WIDTH = 140;
|
|
4
|
+
/**
|
|
5
|
+
* The label's share of an Inspector row inside a dialog -- the Overlay a list is edited in: the medium
|
|
6
|
+
* tier of the house Form layout, ten of twenty-four tracks, so a row there splits 10 : 14 as a Form in a
|
|
7
|
+
* one-column dialog does (owner, 2026-11-25). Read from the Form layout rather than restated, so the two
|
|
8
|
+
* cannot drift apart. The narrow Inspector column keeps its fixed `PHI_INSPECTOR_FIELD_LABEL_WIDTH`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PHI_INSPECTOR_DIALOG_FIELD_LABEL_SHARE: number;
|
|
11
|
+
/**
|
|
12
|
+
* Whether Inspector rows stand in a dialog rather than in the Inspector column. The dialog that holds
|
|
13
|
+
* them says so; a row reads it for its split, and a collection reads it to edit its entries in place
|
|
14
|
+
* instead of opening a second dialog over the first.
|
|
15
|
+
*/
|
|
16
|
+
export declare const PhiInspectorDialogContext: import("react").Context<boolean>;
|
|
4
17
|
export declare function PhiInspectorFieldRow({ label, children, labelWidth, }: {
|
|
5
18
|
label: ReactNode;
|
|
6
19
|
children: ReactNode;
|
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
import { PHI_FORM_DEFAULT_LAYOUT, PHI_FORM_GRID_LAST_LINE } from "@phis/contracts/forms";
|
|
3
5
|
import { PhiFlexControl } from "../controls/phi-flex-control";
|
|
4
6
|
import { PhiTruncatedHoverText } from "../controls/phi-truncated-hover-text";
|
|
5
7
|
import { PhiTypographyControl } from "../controls/phi-typography-control";
|
|
6
8
|
/** The label column every Inspector row shares, so a control that draws its own header lines up with the rest. */
|
|
7
9
|
export const PHI_INSPECTOR_FIELD_LABEL_WIDTH = 140;
|
|
10
|
+
/**
|
|
11
|
+
* The label's share of an Inspector row inside a dialog -- the Overlay a list is edited in: the medium
|
|
12
|
+
* tier of the house Form layout, ten of twenty-four tracks, so a row there splits 10 : 14 as a Form in a
|
|
13
|
+
* one-column dialog does (owner, 2026-11-25). Read from the Form layout rather than restated, so the two
|
|
14
|
+
* cannot drift apart. The narrow Inspector column keeps its fixed `PHI_INSPECTOR_FIELD_LABEL_WIDTH`.
|
|
15
|
+
*/
|
|
16
|
+
export const PHI_INSPECTOR_DIALOG_FIELD_LABEL_SHARE = (PHI_FORM_DEFAULT_LAYOUT.label.medium.end - PHI_FORM_DEFAULT_LAYOUT.label.medium.start) / (PHI_FORM_GRID_LAST_LINE - 1);
|
|
17
|
+
/**
|
|
18
|
+
* Whether Inspector rows stand in a dialog rather than in the Inspector column. The dialog that holds
|
|
19
|
+
* them says so; a row reads it for its split, and a collection reads it to edit its entries in place
|
|
20
|
+
* instead of opening a second dialog over the first.
|
|
21
|
+
*/
|
|
22
|
+
export const PhiInspectorDialogContext = createContext(false);
|
|
23
|
+
const PHI_INSPECTOR_FIELD_ROW_GAP = 12;
|
|
8
24
|
/* The box that cuts the words is the one the hover text measures. */
|
|
9
25
|
const PHI_INSPECTOR_FIELD_LABEL_TEXT_STYLE = { display: "block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" };
|
|
10
26
|
export function PhiInspectorFieldRow({ label, children, labelWidth = PHI_INSPECTOR_FIELD_LABEL_WIDTH, }) {
|
|
11
|
-
|
|
27
|
+
const inDialog = useContext(PhiInspectorDialogContext);
|
|
28
|
+
const labelBasis = inDialog
|
|
29
|
+
? `calc((100% - ${PHI_INSPECTOR_FIELD_ROW_GAP}px) * ${PHI_INSPECTOR_DIALOG_FIELD_LABEL_SHARE})`
|
|
30
|
+
: `${labelWidth}px`;
|
|
31
|
+
return (_jsxs(PhiFlexControl, { align: "flex-start", gap: PHI_INSPECTOR_FIELD_ROW_GAP, wrap: false, style: { width: "100%" }, children: [_jsx(PhiTypographyControl, { style: { flex: `0 0 ${labelBasis}`, minWidth: 0, lineHeight: "var(--phi-control-height)" }, children: _jsx(PhiTruncatedHoverText, { title: label, children: _jsx("span", { style: PHI_INSPECTOR_FIELD_LABEL_TEXT_STYLE, children: label }) }) }), _jsx("div", { style: { flex: "1 1 auto", minWidth: 0 }, children: children })] }));
|
|
12
32
|
}
|
|
@@ -34,6 +34,7 @@ const PHI_BUILDER_CHROME_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
34
34
|
canvas_picker_pick_widget: PHI_BUILDER_CHROME_WIDGET_DEFAULT_LABELS.canvas.picker.pickWidget,
|
|
35
35
|
canvas_picker_layouts: PHI_BUILDER_CHROME_WIDGET_DEFAULT_LABELS.canvas.picker.layouts,
|
|
36
36
|
canvas_picker_widgets: PHI_BUILDER_CHROME_WIDGET_DEFAULT_LABELS.canvas.picker.widgets,
|
|
37
|
+
canvas_picker_section: PHI_BUILDER_CHROME_WIDGET_DEFAULT_LABELS.canvas.picker.section,
|
|
37
38
|
canvas_picker_search_layouts: PHI_BUILDER_CHROME_WIDGET_DEFAULT_LABELS.canvas.picker.searchLayouts,
|
|
38
39
|
canvas_picker_search_widgets: PHI_BUILDER_CHROME_WIDGET_DEFAULT_LABELS.canvas.picker.searchWidgets,
|
|
39
40
|
canvas_picker_filter_packages: PHI_BUILDER_CHROME_WIDGET_DEFAULT_LABELS.canvas.picker.filterPackages,
|
|
@@ -111,6 +112,7 @@ export async function getPhiBuilderChromeWidgetLabels(options) {
|
|
|
111
112
|
pickWidget: labels.canvas_picker_pick_widget,
|
|
112
113
|
layouts: labels.canvas_picker_layouts,
|
|
113
114
|
widgets: labels.canvas_picker_widgets,
|
|
115
|
+
section: labels.canvas_picker_section,
|
|
114
116
|
searchLayouts: labels.canvas_picker_search_layouts,
|
|
115
117
|
searchWidgets: labels.canvas_picker_search_widgets,
|
|
116
118
|
filterPackages: labels.canvas_picker_filter_packages,
|
|
@@ -59,6 +59,11 @@ const PHI_INSPECTOR_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
59
59
|
field_add_item: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.addItem,
|
|
60
60
|
field_remove: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.remove,
|
|
61
61
|
field_edit: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.edit,
|
|
62
|
+
field_conditions: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.conditions,
|
|
63
|
+
field_condition_match: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.conditionMatch,
|
|
64
|
+
field_condition_match_all: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.conditionMatchAll,
|
|
65
|
+
field_condition_match_any: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.conditionMatchAny,
|
|
66
|
+
field_condition_group_incomplete: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.conditionGroupIncomplete,
|
|
62
67
|
field_width: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.width,
|
|
63
68
|
field_height: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.height,
|
|
64
69
|
field_static_options: PHI_INSPECTOR_WIDGET_DEFAULT_LABELS.fields.staticOptions,
|
|
@@ -151,6 +156,11 @@ export async function getPhiInspectorWidgetLabels(options) {
|
|
|
151
156
|
addItem: labels.field_add_item,
|
|
152
157
|
remove: labels.field_remove,
|
|
153
158
|
edit: labels.field_edit,
|
|
159
|
+
conditions: labels.field_conditions,
|
|
160
|
+
conditionMatch: labels.field_condition_match,
|
|
161
|
+
conditionMatchAll: labels.field_condition_match_all,
|
|
162
|
+
conditionMatchAny: labels.field_condition_match_any,
|
|
163
|
+
conditionGroupIncomplete: labels.field_condition_group_incomplete,
|
|
154
164
|
width: labels.field_width,
|
|
155
165
|
height: labels.field_height,
|
|
156
166
|
staticOptions: labels.field_static_options,
|
|
@@ -38,12 +38,14 @@ const PHI_AUTH_SECURITY_WIDGET_LABEL_SET = definePhiLabelSet({
|
|
|
38
38
|
sessions_active: "Active",
|
|
39
39
|
sessions_revoke_confirm: definePhiMessageLabel("Revoke this session?"),
|
|
40
40
|
sessions_revoke: "Revoke",
|
|
41
|
+
confirm_cancel: "Cancel",
|
|
41
42
|
},
|
|
42
43
|
});
|
|
43
44
|
export async function getPhiAuthSecurityWidgetLabels(options) {
|
|
44
45
|
const labels = await getPhiLabelSet(options, PHI_AUTH_SECURITY_WIDGET_LABEL_SET);
|
|
45
46
|
return {
|
|
46
47
|
intro: labels.intro,
|
|
48
|
+
confirmCancel: labels.confirm_cancel,
|
|
47
49
|
errors: {
|
|
48
50
|
unavailable: labels.error_unavailable,
|
|
49
51
|
loadFailed: labels.error_load_failed,
|
|
@@ -93,6 +93,11 @@ export type PhiInspectorFieldLabels = {
|
|
|
93
93
|
addItem: string;
|
|
94
94
|
remove: string;
|
|
95
95
|
edit: string;
|
|
96
|
+
conditions: string;
|
|
97
|
+
conditionMatch: string;
|
|
98
|
+
conditionMatchAll: string;
|
|
99
|
+
conditionMatchAny: string;
|
|
100
|
+
conditionGroupIncomplete: string;
|
|
96
101
|
width: string;
|
|
97
102
|
height: string;
|
|
98
103
|
staticOptions: string;
|
|
@@ -62,6 +62,11 @@ export const PHI_INSPECTOR_WIDGET_DEFAULT_LABELS = {
|
|
|
62
62
|
addItem: "Add item",
|
|
63
63
|
remove: "Remove",
|
|
64
64
|
edit: "Edit",
|
|
65
|
+
conditions: "Conditions",
|
|
66
|
+
conditionMatch: "Match",
|
|
67
|
+
conditionMatchAll: "All conditions",
|
|
68
|
+
conditionMatchAny: "Any condition",
|
|
69
|
+
conditionGroupIncomplete: "Not saved until every condition is complete: a Controller condition needs its Controller Address.",
|
|
65
70
|
width: "Width",
|
|
66
71
|
height: "Height",
|
|
67
72
|
staticOptions: "Static options",
|
|
@@ -3,6 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { PhiFlexControl } from "../../controls/phi-flex-control";
|
|
4
4
|
import { PhiTagControl } from "../../controls/phi-tag-control";
|
|
5
5
|
import { PhiTableControl } from "../../controls/phi-table-control";
|
|
6
|
+
import { PHI_INSPECTOR_TABLE_CONTROL_PROPS } from "../../../helpers/cms-inspector-drawer";
|
|
6
7
|
import { PhiTypographyControl } from "../../controls/phi-typography-control";
|
|
7
8
|
function readSignalCapabilityTableKey(capability) {
|
|
8
9
|
return [
|
|
@@ -60,5 +61,7 @@ export function PhiSignalCapabilityList({ capabilities, emptyLabel = "none", sho
|
|
|
60
61
|
return leftChannel.localeCompare(rightChannel) || left.action.localeCompare(right.action);
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
|
-
return (_jsx(PhiTableControl
|
|
64
|
+
return (_jsx(PhiTableControl
|
|
65
|
+
// An inspector's Table: lines only (BUILDER.md "Inspector contract").
|
|
66
|
+
, { ...PHI_INSPECTOR_TABLE_CONTROL_PROPS, rows: dataSource, rowIdentityPath: "key", size: "small", pagination: false, sortingMode: "none", sorts: [], columnOrder: columns.map((column) => column.key), layout: { mode: "auto", overflowX: "auto" }, columns: columns }));
|
|
64
67
|
}
|
|
@@ -35,6 +35,7 @@ export declare const PhiCmsWidgetType: {
|
|
|
35
35
|
readonly Tree: string;
|
|
36
36
|
readonly AreaUpload: string;
|
|
37
37
|
readonly SlotUpload: string;
|
|
38
|
+
readonly CdnUpload: string;
|
|
38
39
|
readonly ImageInspector: string;
|
|
39
40
|
readonly AssetFocalRect: string;
|
|
40
41
|
readonly MediaPicker: string;
|
|
@@ -15,6 +15,7 @@ const PHI_CMS_WIDGET_PLUGIN_KEYS = {
|
|
|
15
15
|
"auth": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/auth/widgets`,
|
|
16
16
|
"avatar": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/avatar/widgets`,
|
|
17
17
|
"builder": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/builder/widgets`,
|
|
18
|
+
"cdn": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/cdn/widgets`,
|
|
18
19
|
"core": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/core/widgets`,
|
|
19
20
|
"news": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/news/widgets`,
|
|
20
21
|
"observability": `${PHI_CMS_WIDGET_PLUGIN_KEY_BASE}/observability/widgets`,
|
|
@@ -63,6 +64,7 @@ const PHI_CMS_WIDGET_MODULE_BY_TYPE_KEY = {
|
|
|
63
64
|
"builder-widget-viewport-inspector": "builder",
|
|
64
65
|
"button": "core",
|
|
65
66
|
"card": "core",
|
|
67
|
+
"cdn-upload": "cdn",
|
|
66
68
|
"cascader": "core",
|
|
67
69
|
"checkbox": "core",
|
|
68
70
|
"checkbox-group": "core",
|
|
@@ -166,6 +168,7 @@ export const PhiCmsWidgetType = {
|
|
|
166
168
|
Tree: defineWidgetType(resolvePhiCmsWidgetPluginKey("tree"), "tree"),
|
|
167
169
|
AreaUpload: defineWidgetType(resolvePhiCmsWidgetPluginKey("area-upload"), "area-upload"),
|
|
168
170
|
SlotUpload: defineWidgetType(resolvePhiCmsWidgetPluginKey("slot-upload"), "slot-upload"),
|
|
171
|
+
CdnUpload: defineWidgetType(resolvePhiCmsWidgetPluginKey("cdn-upload"), "cdn-upload"),
|
|
169
172
|
ImageInspector: defineWidgetType(resolvePhiCmsWidgetPluginKey("image-inspector"), "image-inspector"),
|
|
170
173
|
AssetFocalRect: defineWidgetType(resolvePhiCmsWidgetPluginKey("asset-focal-rect"), "asset-focal-rect"),
|
|
171
174
|
MediaPicker: defineWidgetType(resolvePhiCmsWidgetPluginKey("media-picker"), "media-picker"),
|
|
@@ -275,6 +275,7 @@ const PHI_RUNTIME_MODULE_OWNERSHIP = {
|
|
|
275
275
|
"tables/builder-navigation": ["builder", "navigation"],
|
|
276
276
|
"tables/runtime-modules": ["builder", "runtime-modules"],
|
|
277
277
|
"tables/builder-signal-routes": ["builder", "signal-routes"],
|
|
278
|
+
"tables/cdn": ["cdn", "cdn"],
|
|
278
279
|
"tables/content": ["core", "content"],
|
|
279
280
|
"tables/content-entries": ["core", "content-entries"],
|
|
280
281
|
"tables/content-entry-categories": ["core", "content-entry-categories"],
|
package/gateway/site-proxy.d.ts
CHANGED
|
@@ -15,4 +15,16 @@ export type BuildPhiSiteProxyHandlersOptions = {
|
|
|
15
15
|
*/
|
|
16
16
|
loadAreaBridge: PhiSiteAreaBridgeLoader;
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* A body on its way to storage through this door, bounded by the browser that sends it and not by the
|
|
20
|
+
* proxy's clock -- on a slow link it takes longer than any timeout that suits a read:
|
|
21
|
+
*
|
|
22
|
+
* - one part of a CDN upload, `PUT /api/site/admin/cdn/uploads/<token>/parts/<n>`, up to 16 MiB that Core
|
|
23
|
+
* streams on to the bucket;
|
|
24
|
+
* - a Media body sent whole (`proxy-stream`, a Space on a Local Storage Profile),
|
|
25
|
+
* `PUT /api/site/media/uploads/<token>`, up to the Site's largest object.
|
|
26
|
+
*
|
|
27
|
+
* Exactly these shapes and this verb: init, report and finalize keep the timeout.
|
|
28
|
+
*/
|
|
29
|
+
export declare function isPhiUnboundedSiteRequest(request: Pick<Request, "method">, path: readonly string[] | undefined): boolean;
|
|
18
30
|
export declare function buildPhiSiteProxyHandlers(options: BuildPhiSiteProxyHandlersOptions): PhiNextProxyHandlers;
|
package/gateway/site-proxy.js
CHANGED
|
@@ -110,6 +110,25 @@ function validatingCmsStructureWrite(handler, loadAreaBridge) {
|
|
|
110
110
|
return handler(request, context);
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* A body on its way to storage through this door, bounded by the browser that sends it and not by the
|
|
115
|
+
* proxy's clock -- on a slow link it takes longer than any timeout that suits a read:
|
|
116
|
+
*
|
|
117
|
+
* - one part of a CDN upload, `PUT /api/site/admin/cdn/uploads/<token>/parts/<n>`, up to 16 MiB that Core
|
|
118
|
+
* streams on to the bucket;
|
|
119
|
+
* - a Media body sent whole (`proxy-stream`, a Space on a Local Storage Profile),
|
|
120
|
+
* `PUT /api/site/media/uploads/<token>`, up to the Site's largest object.
|
|
121
|
+
*
|
|
122
|
+
* Exactly these shapes and this verb: init, report and finalize keep the timeout.
|
|
123
|
+
*/
|
|
124
|
+
export function isPhiUnboundedSiteRequest(request, path) {
|
|
125
|
+
if (request.method !== "PUT" || !path)
|
|
126
|
+
return false;
|
|
127
|
+
const cdnPart = path.length === 6 &&
|
|
128
|
+
path[0] === "admin" && path[1] === "cdn" && path[2] === "uploads" && path[4] === "parts";
|
|
129
|
+
const mediaBody = path.length === 3 && path[0] === "media" && path[1] === "uploads" && path[2] !== "init";
|
|
130
|
+
return cdnPart || mediaBody;
|
|
131
|
+
}
|
|
113
132
|
export function buildPhiSiteProxyHandlers(options) {
|
|
114
133
|
const { upstreamBaseUrl, timeoutMs, buildHeaders, logLabel = "[phis-ui][/api/site proxy]", missingBaseUrlMessage = "Missing apiBaseUrl for /api/site proxy.", } = options;
|
|
115
134
|
const handlers = PhiNextProxy({
|
|
@@ -120,6 +139,7 @@ export function buildPhiSiteProxyHandlers(options) {
|
|
|
120
139
|
missingBaseUrlMessage,
|
|
121
140
|
buildHeaders,
|
|
122
141
|
buildFetchInit: () => ({ cache: "no-store" }),
|
|
142
|
+
unboundedRequest: isPhiUnboundedSiteRequest,
|
|
123
143
|
});
|
|
124
144
|
// Built once per path and kept, so a Site that answers Forms all day pays the import a single time.
|
|
125
145
|
const built = new Map();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const PHI_INSPECTOR_DRAWER_BODY_INSET: {
|
|
2
|
+
readonly padding: 0;
|
|
3
|
+
readonly innerPadding: "var(--phi-padding-sm)";
|
|
4
|
+
};
|
|
5
|
+
export declare const PHI_INSPECTOR_TABLE_PRESENTATION: {
|
|
6
|
+
readonly surface: null;
|
|
7
|
+
readonly borders: false;
|
|
8
|
+
readonly stickyHeader: false;
|
|
9
|
+
};
|
|
10
|
+
/** `PHI_INSPECTOR_TABLE_PRESENTATION` as `PhiTableControl` props, and as a Form table field's config. */
|
|
11
|
+
export declare const PHI_INSPECTOR_TABLE_CONTROL_PROPS: {
|
|
12
|
+
readonly surface: null;
|
|
13
|
+
readonly bordered: false;
|
|
14
|
+
readonly stickyHeader: false;
|
|
15
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { PHI_SPACE } from "../theme/antd-css-var-contract";
|
|
2
|
+
/*
|
|
3
|
+
* What an inspector Drawer's body insets, said once: the Builder's Region, Layout and Widget inspectors
|
|
4
|
+
* and the Asset inspector all stand in a 377px Drawer whose body is a Collapsible of sections.
|
|
5
|
+
*
|
|
6
|
+
* One `sm` step on each side (owner, 2026-11-25). It used to be two -- the Layout's `padding` and the
|
|
7
|
+
* sections' `innerPadding`, `sm` each -- which left 325px for what a section holds. The step is the
|
|
8
|
+
* sections' own, not the Layout's: a section header keeps its `sm` padding, so the content under it lines
|
|
9
|
+
* up with the header's text only when the Layout itself adds nothing around both. `innerPadding` is stated
|
|
10
|
+
* rather than left out, because left out the Collapsible takes the Theme's `base` step instead.
|
|
11
|
+
*/
|
|
12
|
+
export const PHI_INSPECTOR_DRAWER_BODY_INSET = {
|
|
13
|
+
padding: 0,
|
|
14
|
+
innerPadding: PHI_SPACE.sm,
|
|
15
|
+
};
|
|
16
|
+
/*
|
|
17
|
+
* What a Table inside an inspector is, said once (owner, 2026-11-25): lines only. It stands on the
|
|
18
|
+
* inspector's own ground -- no Surface (`surface: null`, the Surface switch's "None"), so neither its box
|
|
19
|
+
* nor its header, footer or summary row paints a fill -- and it has no outer frame; the lines between its
|
|
20
|
+
* rows stay. Its header does not stick: a header without a ground of its own would let the rows show
|
|
21
|
+
* through it.
|
|
22
|
+
*
|
|
23
|
+
* Every Table an inspector shows takes it -- a Table Widget in an inspector tree as its `presentation`, a
|
|
24
|
+
* `PhiTableControl` an inspector client draws as its props, a Form's table field as its config -- and adds
|
|
25
|
+
* only what is its own. `scripts/validate-overlay-form-contracts.ts` holds each of them to it.
|
|
26
|
+
*/
|
|
27
|
+
export const PHI_INSPECTOR_TABLE_PRESENTATION = {
|
|
28
|
+
surface: null,
|
|
29
|
+
borders: false,
|
|
30
|
+
stickyHeader: false,
|
|
31
|
+
};
|
|
32
|
+
/** `PHI_INSPECTOR_TABLE_PRESENTATION` as `PhiTableControl` props, and as a Form table field's config. */
|
|
33
|
+
export const PHI_INSPECTOR_TABLE_CONTROL_PROPS = {
|
|
34
|
+
surface: PHI_INSPECTOR_TABLE_PRESENTATION.surface,
|
|
35
|
+
bordered: PHI_INSPECTOR_TABLE_PRESENTATION.borders,
|
|
36
|
+
stickyHeader: PHI_INSPECTOR_TABLE_PRESENTATION.stickyHeader,
|
|
37
|
+
};
|
|
@@ -59,7 +59,7 @@ const PHI_FLEX_LAYOUT_OVERLAY_ACTIONS_PRESET = {
|
|
|
59
59
|
separatorSpan: "75%",
|
|
60
60
|
wrap: true,
|
|
61
61
|
paddingTop: PHI_SPACE.xs,
|
|
62
|
-
paddingRight: PHI_SPACE.
|
|
62
|
+
paddingRight: PHI_SPACE.xs,
|
|
63
63
|
paddingBottom: PHI_SPACE.xs,
|
|
64
64
|
paddingLeft: PHI_SPACE.base,
|
|
65
65
|
width: "100%",
|
|
@@ -113,6 +113,7 @@ export function checkPhiPresetTreeContract(tree, options = {}) {
|
|
|
113
113
|
const body = layoutsById.get(overlay.bodyLayoutNodeId);
|
|
114
114
|
if (body)
|
|
115
115
|
checkDialogBody(overlay.id, body, report);
|
|
116
|
+
checkDialogFormPlacement(overlay, tree, report);
|
|
116
117
|
if (forms)
|
|
117
118
|
checkDialogWidth(overlay, tree, forms, report);
|
|
118
119
|
}
|
|
@@ -174,6 +175,61 @@ function checkDialogBody(overlayId, body, report) {
|
|
|
174
175
|
report(overlayId, `Preset Overlay "${overlayId}" Body "${body.id}" does not match the dialog body (${bleed ? "PHI_DIALOG_BLEED_BODY_CONFIG" : "PHI_DIALOG_BODY_CONFIG"}) at "${mismatch[0]}".`);
|
|
175
176
|
}
|
|
176
177
|
}
|
|
178
|
+
/** The config keys by which a Layout insets what it holds. */
|
|
179
|
+
const PHI_LAYOUT_INSET_KEYS = [
|
|
180
|
+
"padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft",
|
|
181
|
+
"margin", "marginTop", "marginRight", "marginBottom", "marginLeft",
|
|
182
|
+
];
|
|
183
|
+
function isPhiLayoutInsetZero(value) {
|
|
184
|
+
return value == null || value === 0 || value === "" || value === "0" || value === "0px";
|
|
185
|
+
}
|
|
186
|
+
/*
|
|
187
|
+
* A dialog's Form stands in the dialog's body itself (owner, 2026-11-25; OVERLAYS.md, "The imperative
|
|
188
|
+
* exemption, and how narrow it is").
|
|
189
|
+
*
|
|
190
|
+
* The body is the template: it gives the Form the dialog's inset and ground, and the dialog's width is
|
|
191
|
+
* worked out for a Form standing in it. A Layout of the Preset's own between the two -- one that wraps
|
|
192
|
+
* the Form alone, or insets it -- builds the template a second time. The Builder's Area settings did:
|
|
193
|
+
* a `panel` Flex around the Form took the base step off the Form's width again, left it under 377px, and
|
|
194
|
+
* its labels stood above the fields in a dialog sized to keep them beside. A Layout that groups -- two
|
|
195
|
+
* Forms side by side on a Split Card -- holds more than one thing and insets nothing, and passes.
|
|
196
|
+
*
|
|
197
|
+
* Dialogs only: a Drawer's body is a panel of its own (the Asset inspector's is a Collapsible of sections),
|
|
198
|
+
* and the loop that calls this one skips every Overlay that is not a modal.
|
|
199
|
+
*/
|
|
200
|
+
function checkDialogFormPlacement(overlay, tree, report) {
|
|
201
|
+
const layoutsById = new Map(tree.layoutNodes.map((node) => [node.id, node]));
|
|
202
|
+
const childCounts = new Map();
|
|
203
|
+
for (const node of [...tree.layoutNodes, ...tree.contentWidgets]) {
|
|
204
|
+
if (node.parentLayoutNodeId == null)
|
|
205
|
+
continue;
|
|
206
|
+
childCounts.set(node.parentLayoutNodeId, (childCounts.get(node.parentLayoutNodeId) ?? 0) + 1);
|
|
207
|
+
}
|
|
208
|
+
for (const widget of tree.contentWidgets) {
|
|
209
|
+
if (widget.widgetType !== PhiCmsWidgetType.Form || widget.parentLayoutNodeId === overlay.bodyLayoutNodeId)
|
|
210
|
+
continue;
|
|
211
|
+
const between = [];
|
|
212
|
+
let current = layoutsById.get(widget.parentLayoutNodeId);
|
|
213
|
+
while (current && current.id !== overlay.bodyLayoutNodeId) {
|
|
214
|
+
between.push(current);
|
|
215
|
+
current = current.parentLayoutNodeId == null ? undefined : layoutsById.get(current.parentLayoutNodeId);
|
|
216
|
+
}
|
|
217
|
+
// Not in this dialog's body at all.
|
|
218
|
+
if (!current)
|
|
219
|
+
continue;
|
|
220
|
+
for (const layout of between) {
|
|
221
|
+
const layoutId = layout.id;
|
|
222
|
+
const insets = PHI_LAYOUT_INSET_KEYS.find((key) => !isPhiLayoutInsetZero(layout.config[key]));
|
|
223
|
+
const wraps = (childCounts.get(layoutId) ?? 0) === 1;
|
|
224
|
+
if (!insets && !wraps)
|
|
225
|
+
continue;
|
|
226
|
+
report(overlay.id, `Preset Overlay "${overlay.id}" puts Layout "${layoutId}" between its body and the Form "${widget.id}", ` +
|
|
227
|
+
`${insets ? `and that Layout insets it ("${insets}")` : "and that Layout holds nothing else"}. A dialog's Form ` +
|
|
228
|
+
`stands in the body itself, which already gives it the dialog's inset: place it in "${overlay.bodyLayoutNodeId}".`);
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
177
233
|
function checkDialogCommands(overlayId, footerLayoutId, widgets, report) {
|
|
178
234
|
for (const widget of widgets) {
|
|
179
235
|
if (widget.parentLayoutNodeId !== footerLayoutId || widget.widgetType !== PhiCmsWidgetType.CommandToolbar)
|
package/helpers/text-source.js
CHANGED
|
@@ -29,5 +29,7 @@ export function readPhiTextSource(value) {
|
|
|
29
29
|
export function isPhiAuthoredTextField(field) {
|
|
30
30
|
if (field.type === "collection")
|
|
31
31
|
return field.itemFields.some(isPhiAuthoredTextField);
|
|
32
|
+
if (field.type === "condition-group")
|
|
33
|
+
return field.conditionFields.some(isPhiAuthoredTextField);
|
|
32
34
|
return readPhiConfigFieldTextRegister(field) != null;
|
|
33
35
|
}
|
package/net/phi-next-proxy.d.ts
CHANGED
|
@@ -19,6 +19,13 @@ export type PhiNextProxyConfig = {
|
|
|
19
19
|
tags?: string[];
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* A request that may take longer than `timeoutMs` because its body is large, answered `null`: it is
|
|
24
|
+
* bounded by the browser alone -- aborted when the browser goes away (`request.signal`) -- and not
|
|
25
|
+
* by the clock. Every request this does not name keeps `timeoutMs`. A door names only what it must:
|
|
26
|
+
* a part of a CDN upload is 16 MiB on whatever link the person has, and eight seconds cut it.
|
|
27
|
+
*/
|
|
28
|
+
unboundedRequest?: (request: NextRequest, path: PhiProxyPath) => boolean;
|
|
22
29
|
};
|
|
23
30
|
export type PhiNextProxyHandler = (request: NextRequest, context: PhiNextProxyRouteContext) => Promise<Response>;
|
|
24
31
|
export type PhiNextProxyHandlers = {
|
package/net/phi-next-proxy.js
CHANGED
|
@@ -84,7 +84,7 @@ async function proxyRequest(request, path, config) {
|
|
|
84
84
|
...(hasBody ? { body: request.body, duplex: "half" } : {}),
|
|
85
85
|
...(config.buildFetchInit?.(request, path) ?? { cache: "no-store" }),
|
|
86
86
|
redirect: "manual",
|
|
87
|
-
signal: AbortSignal.timeout(config.timeoutMs),
|
|
87
|
+
signal: config.unboundedRequest?.(request, path) ? request.signal : AbortSignal.timeout(config.timeoutMs),
|
|
88
88
|
});
|
|
89
89
|
const durationMs = Date.now() - startedAt;
|
|
90
90
|
if (durationMs >= config.timeoutMs / 2 && targetResponse.ok) {
|