@phis/ui 0.8.2 → 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/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 +8 -2
- package/components/forms/compound-form-controls.js +16 -1
- package/components/layouts/clients/phi-collapsible-layout-client.js +2 -6
- package/components/media/media-widget-labels.d.ts +2 -0
- package/components/media/media-widget-labels.js +2 -0
- package/components/media/phi-asset-inspector-section.js +19 -1
- package/components/regions/presets/phi-area-shell-preset-nodes.js +2 -0
- package/components/shell/phi-builder-icon.js +9 -1
- 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/shared/phi-choice-controller.d.ts +8 -1
- package/components/widgets/client/shared/phi-choice-controller.js +16 -1
- 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/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/package.json +4 -4
- 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-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/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/trees/phi-default-admin-cdn-page-tree.js +26 -14
- 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/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 +11 -4
- 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 +6 -0
|
@@ -15,6 +15,7 @@ import { PHI_ASSET_FOLDER_FORM_ID, PHI_ASSET_METADATA_FORM_ID } from "../metadat
|
|
|
15
15
|
import { PHI_ASSET_INSPECTOR_LAYOUT_IDS, PHI_ASSET_INSPECTOR_OVERLAY_IDS, PHI_ASSET_INSPECTOR_WIDGET_IDS, PHI_ASSET_MEDIA_PAGE_LAYOUT_IDS, PHI_ASSET_MEDIA_PAGE_WIDGET_IDS, } from "../media-page-ids";
|
|
16
16
|
import { PHI_DIALOG_BLEED_BODY_CONFIG, PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG, PHI_DIALOG_WIDTH_SINGLE_COLUMN, } from "../../../../helpers/cms-dialog";
|
|
17
17
|
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
18
|
+
import { PHI_INSPECTOR_DRAWER_BODY_INSET } from "../../../../helpers/cms-inspector-drawer";
|
|
18
19
|
const PHI_ASSET_MEDIA_PAGE_REGION_IDS = {
|
|
19
20
|
regionHeaderBottom: -511,
|
|
20
21
|
regionContent: -513,
|
|
@@ -328,8 +329,7 @@ export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
|
|
|
328
329
|
config: {
|
|
329
330
|
ghost: true,
|
|
330
331
|
bordered: false,
|
|
331
|
-
|
|
332
|
-
innerPadding: PHI_SPACE.sm,
|
|
332
|
+
...PHI_INSPECTOR_DRAWER_BODY_INSET,
|
|
333
333
|
slotTitles: [
|
|
334
334
|
assetLabels.inspector.previewTitle ?? "Preview",
|
|
335
335
|
assetLabels.inspector.metadataTitle ?? "Metadata",
|
|
@@ -596,7 +596,7 @@ export async function buildPhiDefaultBuilderMediaPageTree({ page, runtime, }) {
|
|
|
596
596
|
showLabels: true,
|
|
597
597
|
controlSize: "medium",
|
|
598
598
|
buttons: [
|
|
599
|
-
{ key: "save", emits: [{ capabilityId: "command", value: "save" }], action: "save" },
|
|
599
|
+
{ key: "save", emits: [{ capabilityId: "command", value: "save" }], action: "save", variant: "primary" },
|
|
600
600
|
],
|
|
601
601
|
signalRoutes: {
|
|
602
602
|
emits: [{
|
|
@@ -99,7 +99,7 @@ export function PhiAuthSecurityWidgetClient({ apiPath = "/api/auth/account/secur
|
|
|
99
99
|
status: payload.policy.factor?.requiredMethod === "totp"
|
|
100
100
|
? _jsx(PhiTagControl, { color: "blue", children: labels.authenticators.required })
|
|
101
101
|
: null,
|
|
102
|
-
action: (_jsx(PhiConfirmControl, { title: labels.authenticators.removeConfirm, onConfirm: () => void removeFactor(factor.id), danger: true, trigger: { label: labels.authenticators.remove, type: "link", danger: true } })),
|
|
102
|
+
action: (_jsx(PhiConfirmControl, { title: labels.authenticators.removeConfirm, confirmLabel: labels.authenticators.remove, cancelLabel: labels.confirmCancel, onConfirm: () => void removeFactor(factor.id), danger: true, trigger: { label: labels.authenticators.remove, type: "link", danger: true } })),
|
|
103
103
|
})) }) }), _jsx(PhiCardControl, { title: labels.providers.title, children: _jsx(PhiEntryListControl, { emptyDescription: labels.providers.empty, entries: payload.identities.map((identity) => ({
|
|
104
104
|
// Two accounts at one provider are two identities; the provider key alone named both the same.
|
|
105
105
|
key: String(identity.id),
|
|
@@ -114,7 +114,7 @@ export function PhiAuthSecurityWidgetClient({ apiPath = "/api/auth/account/secur
|
|
|
114
114
|
? _jsx(PhiTagControl, { children: labels.sessions.revoked })
|
|
115
115
|
: _jsx(PhiTagControl, { color: "green", children: labels.sessions.active }),
|
|
116
116
|
action: session.id !== payload.currentSessionId && !session.revokedAt
|
|
117
|
-
? (_jsx(PhiConfirmControl, { title: labels.sessions.revokeConfirm, onConfirm: () => void revokeSession(session.id), danger: true, trigger: { label: labels.sessions.revoke, type: "link", danger: true } }))
|
|
117
|
+
? (_jsx(PhiConfirmControl, { title: labels.sessions.revokeConfirm, confirmLabel: labels.sessions.revoke, cancelLabel: labels.confirmCancel, onConfirm: () => void revokeSession(session.id), danger: true, trigger: { label: labels.sessions.revoke, type: "link", danger: true } }))
|
|
118
118
|
: null,
|
|
119
119
|
})) }) })] }));
|
|
120
120
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const PHI_BUILDER_MODULES_TABLE_WIDGET_ID: import("@phis/contracts/cms").PhiCmsInstanceId;
|
|
2
2
|
export declare const PHI_BUILDER_AREA_SETTINGS_OVERLAY_IDS: Readonly<Record<"overlayAreaSettings", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
3
|
-
export declare const PHI_BUILDER_AREA_SETTINGS_LAYOUT_IDS: Readonly<Record<"areaSettingsBody" | "
|
|
3
|
+
export declare const PHI_BUILDER_AREA_SETTINGS_LAYOUT_IDS: Readonly<Record<"areaSettingsBody" | "areaSettingsFooter", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
4
4
|
export declare const PHI_BUILDER_AREA_SETTINGS_WIDGET_IDS: Readonly<Record<"areaSettingsForm" | "areaSettingsAction" | "areaSettingsCommands", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
5
5
|
export declare const PHI_BUILDER_MODULE_DETAIL_OVERLAY_IDS: Readonly<Record<"overlayModuleDetail", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
6
6
|
export declare const PHI_BUILDER_MODULE_DETAIL_LAYOUT_IDS: Readonly<Record<"body", import("@phis/contracts/cms").PhiCmsInstanceId>>;
|
|
@@ -20,7 +20,7 @@ const AREA_SETTINGS_ID_CONTEXT = {
|
|
|
20
20
|
presetKey: "builder-area-preset",
|
|
21
21
|
};
|
|
22
22
|
export const PHI_BUILDER_AREA_SETTINGS_OVERLAY_IDS = createPhiPresetCmsInstanceIdMap(AREA_SETTINGS_ID_CONTEXT, ["overlayAreaSettings"]);
|
|
23
|
-
export const PHI_BUILDER_AREA_SETTINGS_LAYOUT_IDS = createPhiPresetCmsInstanceIdMap(AREA_SETTINGS_ID_CONTEXT, ["areaSettingsBody", "
|
|
23
|
+
export const PHI_BUILDER_AREA_SETTINGS_LAYOUT_IDS = createPhiPresetCmsInstanceIdMap(AREA_SETTINGS_ID_CONTEXT, ["areaSettingsBody", "areaSettingsFooter"]);
|
|
24
24
|
export const PHI_BUILDER_AREA_SETTINGS_WIDGET_IDS = createPhiPresetCmsInstanceIdMap(AREA_SETTINGS_ID_CONTEXT, ["areaSettingsAction", "areaSettingsForm", "areaSettingsCommands"]);
|
|
25
25
|
const MODULES_DETAIL_ID_CONTEXT = {
|
|
26
26
|
domain: "page",
|
|
@@ -19,7 +19,7 @@ const text = (key, fallback) => ({ kind: "config", key, fallback });
|
|
|
19
19
|
* What an Area answers about itself, as one form rather than as six Controls that each carry a label.
|
|
20
20
|
*
|
|
21
21
|
* The form is what puts the labels in a column of their own: `PHI_FORM_DEFAULT_LAYOUT` gives every
|
|
22
|
-
* field
|
|
22
|
+
* field one label range and one control range per width, so six rows line up on one edge instead of
|
|
23
23
|
* each being indented by the width of its own caption. That is the whole reason this is a form and
|
|
24
24
|
* not a stack -- the questions did not change.
|
|
25
25
|
*
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type PhiInspectorConditionGroupWrite = {
|
|
2
|
+
kind: "write";
|
|
3
|
+
value: {
|
|
4
|
+
match: "all" | "any";
|
|
5
|
+
conditions: Record<string, unknown>[];
|
|
6
|
+
};
|
|
7
|
+
} | {
|
|
8
|
+
kind: "remove";
|
|
9
|
+
} | {
|
|
10
|
+
kind: "hold";
|
|
11
|
+
draft: {
|
|
12
|
+
match: "all" | "any";
|
|
13
|
+
conditions: Record<string, unknown>[];
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare function resolvePhiInspectorConditionGroupWrite(next: Record<string, unknown>): PhiInspectorConditionGroupWrite;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { isPhiRecord } from "../../../../helpers/is-record";
|
|
2
|
+
import { readPhiRuntimeConditionExpression } from "../../../../types/runtime-condition";
|
|
3
|
+
export function resolvePhiInspectorConditionGroupWrite(next) {
|
|
4
|
+
const conditions = Array.isArray(next.conditions) ? next.conditions.filter(isPhiRecord) : [];
|
|
5
|
+
if (conditions.length === 0)
|
|
6
|
+
return { kind: "remove" };
|
|
7
|
+
const group = { match: next.match === "any" ? "any" : "all", conditions };
|
|
8
|
+
return readPhiRuntimeConditionExpression(group) ? { kind: "write", value: group } : { kind: "hold", draft: group };
|
|
9
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { Fragment, useMemo, useState } from "react";
|
|
3
|
+
import { Fragment, useContext, useMemo, useState } from "react";
|
|
4
4
|
import { PhiBackgroundControl } from "../../../../components/controls/phi-background-control";
|
|
5
5
|
import { readPhiDotPath } from "../../../../helpers/dot-path";
|
|
6
6
|
import { PhiCheckboxGroupControl } from "../../../../components/controls/phi-checkbox-group-control";
|
|
@@ -31,7 +31,7 @@ import { usePhiWidgetScaffoldPopup } from "../../../../components/widgets/client
|
|
|
31
31
|
import { PhiDialogControl } from "../../../../components/controls/phi-dialog-control";
|
|
32
32
|
import { PhiIcon } from "../../../../components/shell/phi-icon";
|
|
33
33
|
import { PhiPaddingControl } from "../../../../components/controls/phi-padding-control";
|
|
34
|
-
import { PHI_INSPECTOR_FIELD_LABEL_WIDTH, PhiInspectorFieldRow } from "../../../../components/widgets/inspector-field-row";
|
|
34
|
+
import { PHI_INSPECTOR_FIELD_LABEL_WIDTH, PhiInspectorDialogContext, PhiInspectorFieldRow } from "../../../../components/widgets/inspector-field-row";
|
|
35
35
|
import { PhiSurfaceControl } from "../../../../components/controls/phi-surface-control";
|
|
36
36
|
import { readPhiSurface } from "../../../../types/surface";
|
|
37
37
|
import { readInspectorChoiceMultiValue, readInspectorChoiceSingleValue, } from "./inspector-choice-values";
|
|
@@ -39,6 +39,8 @@ import { PhiFlexControl } from "../../../../components/controls/phi-flex-control
|
|
|
39
39
|
import { PhiTypographyControl } from "../../../../components/controls/phi-typography-control";
|
|
40
40
|
import { PhiDescriptionHint } from "../../../../components/controls/phi-description-tooltip-icon";
|
|
41
41
|
import { isPhiRecord } from "../../../../helpers/is-record";
|
|
42
|
+
import { PhiAlertControl } from "../../../../components/controls/phi-alert-control";
|
|
43
|
+
import { resolvePhiInspectorConditionGroupWrite } from "./inspector-condition-group";
|
|
42
44
|
import { PHI_INSPECTOR_WIDGET_DEFAULT_LABELS, } from "../../../../components/widgets/label-types/inspector";
|
|
43
45
|
const PHI_STATIC_OPTIONS_PROVIDER_VALUE = "__phi_static_options__";
|
|
44
46
|
export function renderPhiInspectorSettingsRow(label, control, key) {
|
|
@@ -402,6 +404,8 @@ function PhiInspectorChoiceFieldControl({ field, config, value, defaultValue, di
|
|
|
402
404
|
function PhiInspectorCollectionFieldControl({ field, config, labels, value, defaultValue, disabled, widgetReferenceOptions, paddingLabels, backgroundLabels, borderLabels, renderMediaPicker, colorPickerLabels, iconPickerLabels, dataProviderDescriptors, calendarAdapterDescriptors, videoProviderDescriptors, onChange, }) {
|
|
403
405
|
const { token } = usePhiConfig();
|
|
404
406
|
const popup = usePhiWidgetScaffoldPopup();
|
|
407
|
+
/* Inside another list's Overlay an entry's own list is edited in place, not behind a second dialog. */
|
|
408
|
+
const insideOverlay = useContext(PhiInspectorDialogContext);
|
|
405
409
|
const [overlayOpen, setOverlayOpen] = useState(false);
|
|
406
410
|
/* The entry a `select` collection shows; held to the list when entries go. */
|
|
407
411
|
const [selectedItemIndex, setSelectedItemIndex] = useState(0);
|
|
@@ -491,6 +495,9 @@ function PhiInspectorCollectionFieldControl({ field, config, labels, value, defa
|
|
|
491
495
|
background: token.colorBgContainer,
|
|
492
496
|
}, children: [_jsxs(PhiFlexControl, { align: "center", justify: "space-between", gap: 4, style: { width: "100%" }, children: [_jsx(PhiTypographyControl, { strong: true, ellipsis: true, style: { minWidth: 0 }, title: itemLabel, children: itemLabel }), _jsxs(PhiFlexControl, { align: "center", gap: 2, children: [field.reorderable !== false ? (_jsxs(_Fragment, { children: [_jsx(PhiButtonControl, { label: "\u2191", type: "text", disabled: disabled || index === 0, onClick: () => swapRows(index - 1, index) }), _jsx(PhiButtonControl, { label: "\u2193", type: "text", disabled: disabled || index === items.length - 1, onClick: () => swapRows(index, index + 1) })] })) : null, _jsx(PhiButtonControl, { ariaLabel: labels.remove, tooltip: labels.remove, icon: _jsx(PhiIcon, { name: "delete" }), type: "text", danger: true, disabled: disabled || items.length <= minItems, onClick: () => publishRows(items.filter((_, itemIndex) => itemIndex !== index), rowKeys.filter((_, keyIndex) => keyIndex !== index)) })] })] }), renderItemFields(item, index)] }, rowKeys[index]));
|
|
493
497
|
}), _jsx(PhiButtonControl, { label: field.addLabel ?? labels.addItem, icon: _jsx(PhiIcon, { name: "plus" }), disabled: disabled || items.length >= maxItems, onClick: () => publishRows([...items, createPhiInspectorCollectionItem(field, items)], [...rowKeys, `${field.key}:new:${rowKeyState.next}`], rowKeyState.next + 1) })] }));
|
|
498
|
+
if (insideOverlay) {
|
|
499
|
+
return renderPhiInspectorConfigFieldBlock(field, editor);
|
|
500
|
+
}
|
|
494
501
|
/*
|
|
495
502
|
* The select is the field's row -- labelled with the field, "Button" -- and the chosen entry's fields
|
|
496
503
|
* follow as rows of their own, so the entry reads as part of the settings and not as a card in them.
|
|
@@ -503,19 +510,96 @@ function PhiInspectorCollectionFieldControl({ field, config, labels, value, defa
|
|
|
503
510
|
}
|
|
504
511
|
return (_jsxs(Fragment, { children: [renderPhiInspectorConfigFieldControl(field, _jsx(PhiSelectControl, { options: items.map((item, index) => ({ value: String(index), label: readItemLabel(item, index) })), value: String(selectedIndex), disabled: disabled, style: { width: "100%" }, onChange: (next) => setSelectedItemIndex(Number(next)) })), renderItemFields(selectedItem, selectedIndex)] }, field.key));
|
|
505
512
|
}
|
|
506
|
-
if (field.presentation !== "overlay") {
|
|
507
|
-
return renderPhiInspectorConfigFieldBlock(field, editor);
|
|
508
|
-
}
|
|
509
513
|
/*
|
|
510
|
-
*
|
|
511
|
-
*
|
|
514
|
+
* Every other list is edited in an Overlay (`PhiCmsConfigFieldCollectionPresentation`), never in the
|
|
515
|
+
* Inspector column, and deliberately without a draft: every change publishes as it is made, so
|
|
516
|
+
* closing the Overlay decides nothing. The static options picker
|
|
512
517
|
* has its Cancel and Apply because it edits rows with identities and a validity rule of their own and
|
|
513
518
|
* has something to hold back; here a second copy of the value would only be a second truth, and the
|
|
514
519
|
* Builder's undo is already the way back. No actions, therefore, and so no Footer either.
|
|
520
|
+
*
|
|
521
|
+
* At the field's place it is a row like every other one: the field's words, and beside them the
|
|
522
|
+
* button that opens the Overlay, drawn at the Inspector's size. What the collection holds is read in
|
|
523
|
+
* the Overlay; a list of names squeezed into the control column said less than the Overlay does and
|
|
524
|
+
* pushed the button out of line with the rows around it.
|
|
515
525
|
*/
|
|
516
|
-
return
|
|
517
|
-
|
|
518
|
-
|
|
526
|
+
return renderPhiInspectorConfigFieldControl(field, _jsxs(_Fragment, { children: [_jsx(PhiButtonControl, { label: field.editLabel ?? labels.edit, icon: _jsx(PhiIcon, { name: "edit" }), disabled: disabled, onClick: () => setOverlayOpen(true) }), _jsx(PhiDialogControl, { open: overlayOpen, title: field.label, controlSize: "medium", mountPolicy: "remount", rootClassName: popup.rootClassName, onDismiss: () => setOverlayOpen(false), children: _jsx(PhiInspectorDialogContext.Provider, { value: true, children: editor }) })] }));
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* A `condition-group` field: the group is one value, `{ match, conditions }`, written only in a shape the
|
|
530
|
+
* strict reader accepts (`resolvePhiInspectorConditionGroupWrite`). Its label and an Edit button in the
|
|
531
|
+
* Inspector column, the group in an Overlay; inside another Overlay's entry, in place there. The match
|
|
532
|
+
* and the list are drawn as the Inspector's own choice and collection fields on the group, so a
|
|
533
|
+
* condition is edited exactly as a list entry is anywhere else.
|
|
534
|
+
*/
|
|
535
|
+
function PhiInspectorConditionGroupFieldControl({ field, labels, value, disabled, onChange, }) {
|
|
536
|
+
const popup = usePhiWidgetScaffoldPopup();
|
|
537
|
+
const inDialog = useContext(PhiInspectorDialogContext);
|
|
538
|
+
const [overlayOpen, setOverlayOpen] = useState(false);
|
|
539
|
+
/* What the dialog shows while it differs from what is stored: a match chosen before any condition, or a held group. */
|
|
540
|
+
const [draft, setDraft] = useState(null);
|
|
541
|
+
const stored = isPhiRecord(value) ? value : null;
|
|
542
|
+
const group = draft?.group ?? stored ?? {};
|
|
543
|
+
const apply = (patch) => {
|
|
544
|
+
const next = { ...group, ...patch };
|
|
545
|
+
const write = resolvePhiInspectorConditionGroupWrite(next);
|
|
546
|
+
if (write.kind === "write") {
|
|
547
|
+
setDraft(null);
|
|
548
|
+
onChange?.({ [field.key]: write.value });
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
if (write.kind === "hold") {
|
|
552
|
+
setDraft({ group: write.draft, held: true });
|
|
553
|
+
return;
|
|
554
|
+
}
|
|
555
|
+
setDraft(next.match === "all" || next.match === "any" ? { group: { match: next.match, conditions: [] }, held: false } : null);
|
|
556
|
+
if (stored)
|
|
557
|
+
onChange?.({ [field.key]: undefined });
|
|
558
|
+
};
|
|
559
|
+
const matchField = {
|
|
560
|
+
key: "match",
|
|
561
|
+
type: "choice",
|
|
562
|
+
label: labels.conditionMatch,
|
|
563
|
+
options: [
|
|
564
|
+
{ value: "all", label: labels.conditionMatchAll },
|
|
565
|
+
{ value: "any", label: labels.conditionMatchAny },
|
|
566
|
+
],
|
|
567
|
+
};
|
|
568
|
+
const conditionsField = {
|
|
569
|
+
key: "conditions",
|
|
570
|
+
type: "collection",
|
|
571
|
+
label: labels.conditions,
|
|
572
|
+
itemKeyField: "valuePath",
|
|
573
|
+
itemLabelField: "valuePath",
|
|
574
|
+
itemFields: field.conditionFields,
|
|
575
|
+
defaultItem: field.defaultCondition,
|
|
576
|
+
...(field.addLabel == null ? {} : { addLabel: field.addLabel }),
|
|
577
|
+
...(field.emptyLabel == null ? {} : { emptyLabel: field.emptyLabel }),
|
|
578
|
+
};
|
|
579
|
+
const body = (_jsx(PhiInspectorDialogContext.Provider, { value: true, children: _jsxs(PhiFlexControl, { vertical: true, gap: 8, style: { width: "100%", minWidth: 0 }, children: [renderPhiInspectorConfigField({
|
|
580
|
+
field: matchField,
|
|
581
|
+
value: group.match,
|
|
582
|
+
defaultValue: "all",
|
|
583
|
+
config: group,
|
|
584
|
+
disabled,
|
|
585
|
+
fieldLabels: labels,
|
|
586
|
+
onChange: apply,
|
|
587
|
+
}), renderPhiInspectorConfigField({
|
|
588
|
+
field: conditionsField,
|
|
589
|
+
value: Array.isArray(group.conditions) ? group.conditions : [],
|
|
590
|
+
defaultValue: undefined,
|
|
591
|
+
config: group,
|
|
592
|
+
disabled,
|
|
593
|
+
fieldLabels: labels,
|
|
594
|
+
onChange: apply,
|
|
595
|
+
}), draft?.held ? _jsx(PhiAlertControl, { level: "warning", title: labels.conditionGroupIncomplete, showIcon: true }) : null] }) }));
|
|
596
|
+
if (inDialog)
|
|
597
|
+
return renderPhiInspectorConfigFieldBlock(field, body);
|
|
598
|
+
return renderPhiInspectorConfigFieldControl(field, _jsxs(_Fragment, { children: [_jsx(PhiButtonControl, { label: labels.edit, icon: _jsx(PhiIcon, { name: "edit" }), disabled: disabled, onClick: () => setOverlayOpen(true) }), _jsx(PhiDialogControl, { open: overlayOpen, title: field.label, controlSize: "medium", mountPolicy: "remount", rootClassName: popup.rootClassName, onDismiss: () => {
|
|
599
|
+
// A held group is not saved: closing the dialog lets it go, and the stored one shows again.
|
|
600
|
+
setOverlayOpen(false);
|
|
601
|
+
setDraft(null);
|
|
602
|
+
}, children: body })] }));
|
|
519
603
|
}
|
|
520
604
|
/**
|
|
521
605
|
* A list of whole numbers typed as "10, 20, 50".
|
|
@@ -759,6 +843,9 @@ function renderPhiInspectorConfigFieldBody({ field, value, defaultValue, config,
|
|
|
759
843
|
if (field.type === "choice") {
|
|
760
844
|
return (_jsx(PhiInspectorChoiceFieldControl, { field: field, config: config, value: value, defaultValue: defaultValue, disabled: disabled || !onChange, widgetReferenceOptions: widgetReferenceOptions ?? [], labels: fieldLabels, onChange: onChange }, field.key));
|
|
761
845
|
}
|
|
846
|
+
if (field.type === "condition-group") {
|
|
847
|
+
return (_jsx(PhiInspectorConditionGroupFieldControl, { field: field, labels: fieldLabels, value: value, disabled: disabled || !onChange, onChange: onChange }, field.key));
|
|
848
|
+
}
|
|
762
849
|
if (field.type === "collection") {
|
|
763
850
|
return (_jsx(PhiInspectorCollectionFieldControl, { field: field, config: config, labels: fieldLabels, value: value, defaultValue: defaultValue, disabled: disabled || !onChange, widgetReferenceOptions: widgetReferenceOptions ?? [], paddingLabels: paddingLabels, backgroundLabels: backgroundLabels, borderLabels: borderLabels, renderMediaPicker: renderMediaPicker, colorPickerLabels: colorPickerLabels, iconPickerLabels: iconPickerLabels, dataProviderDescriptors: dataProviderDescriptors, calendarAdapterDescriptors: calendarAdapterDescriptors, videoProviderDescriptors: videoProviderDescriptors, onChange: onChange }, field.key));
|
|
764
851
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { useSearchParams } from "next/navigation";
|
|
5
|
-
import { findPhiPageNodePath,
|
|
6
|
-
import { resolvePhiBuilderOfferedPageCatalog } from "../offered-page-catalog";
|
|
5
|
+
import { findPhiPageNodePath, resolvePhiBuilderCatalogPathForCatalog, } from "../../../../helpers/cms-page-catalog";
|
|
6
|
+
import { resolvePhiBuilderOfferedPageCatalog, resolvePhiBuilderOfferedPageKey, } from "../offered-page-catalog";
|
|
7
7
|
import { PHI_BUILDER_AREA_SEARCH_PARAM, PHI_BUILDER_PAGE_SEARCH_PARAM, normalizePhiBuilderAreaSearchParam, normalizePhiBuilderPageSearchParam, } from "../../../../helpers/cms-scope-search-params";
|
|
8
8
|
import { usePhiDeveloperBuilderStateValue } from "../developer-workspace-store";
|
|
9
9
|
import { PhiTextControl } from "../../../../components/controls/phi-text-control";
|
|
@@ -57,10 +57,6 @@ export function PhiDeveloperBuilderPagesHeaderSection({ mode, pageTitle, disable
|
|
|
57
57
|
const searchArea = normalizePhiBuilderAreaSearchParam(searchParams.get(PHI_BUILDER_AREA_SEARCH_PARAM));
|
|
58
58
|
const searchPageKey = normalizePhiBuilderPageSearchParam(searchParams.get(PHI_BUILDER_PAGE_SEARCH_PARAM));
|
|
59
59
|
const area = (searchArea ?? currentArea);
|
|
60
|
-
const pageKey = searchPageKey ??
|
|
61
|
-
(searchArea != null && searchArea !== currentArea
|
|
62
|
-
? (resolvePhiBuilderActivePageKey(null, modulePresetPagesByArea[searchArea]) ?? "")
|
|
63
|
-
: currentPageKey);
|
|
64
60
|
const offeredCatalogState = {
|
|
65
61
|
modulePresetPagesByArea,
|
|
66
62
|
customPages: resolvedCustomPages,
|
|
@@ -70,6 +66,11 @@ export function PhiDeveloperBuilderPagesHeaderSection({ mode, pageTitle, disable
|
|
|
70
66
|
runtimeModuleDefinitions,
|
|
71
67
|
areaRootRoutes,
|
|
72
68
|
};
|
|
69
|
+
// An Area the address names before the workspace moved to it opens where the Controller will open it.
|
|
70
|
+
const pageKey = searchPageKey ??
|
|
71
|
+
(searchArea != null && searchArea !== currentArea
|
|
72
|
+
? (resolvePhiBuilderOfferedPageKey(offeredCatalogState, searchArea, null).pageKey ?? "")
|
|
73
|
+
: currentPageKey);
|
|
73
74
|
const pageTree = resolvePhiBuilderOfferedPageCatalog(offeredCatalogState, area);
|
|
74
75
|
const pageSelectionReady = catalogHydrated && pageCatalogHydratedByArea[area] === true && pageKey.length > 0;
|
|
75
76
|
const selectedPath = pageSelectionReady
|
|
@@ -116,7 +116,7 @@ export function PhiRegionVisibilityFields({ regionKey, regionConfig, disabled, l
|
|
|
116
116
|
})),
|
|
117
117
|
});
|
|
118
118
|
return (_jsxs("div", { style: { display: "grid", gap: PHI_GAP_SM, width: "100%" }, children: [renderField(fields[0]), scope.mode === "include" || scope.mode === "exclude"
|
|
119
|
-
? renderPhiInspectorSettingsRow(labels.entries, _jsx(PhiTreeCascaderControl, { disabled: disabled, options: tree, placeholder: labels.entriesPlaceholder, value: scope.entries.flatMap((entry) => toPickerValue(entry) ?? []), onChange: (values) => onChange(patchRegionConfigVisibility(regionConfig, {
|
|
119
|
+
? renderPhiInspectorSettingsRow(labels.entries, _jsx(PhiTreeCascaderControl, { ariaLabel: labels.entries, disabled: disabled, options: tree, placeholder: labels.entriesPlaceholder, value: scope.entries.flatMap((entry) => toPickerValue(entry) ?? []), onChange: (values) => onChange(patchRegionConfigVisibility(regionConfig, {
|
|
120
120
|
entries: values.flatMap((value) => {
|
|
121
121
|
if (value.startsWith(PHI_PAGE_SCOPE_FOLDER_VALUE_PREFIX)) {
|
|
122
122
|
return [{ folder: value.slice(PHI_PAGE_SCOPE_FOLDER_VALUE_PREFIX.length) }];
|
|
@@ -15,7 +15,7 @@ import { PHI_BUILDER_PREVIEW_SEARCH_PARAM, } from "../preview-transport";
|
|
|
15
15
|
import { PHI_BUILDER_AREA_SEARCH_PARAM, PHI_BUILDER_NAVIGATION_KEY_SEARCH_PARAM, PHI_BUILDER_PAGE_SEARCH_PARAM, PHI_BUILDER_RUNTIME_MODULES_SEARCH_PARAM, normalizePhiBuilderAreaSearchParam, normalizePhiBuilderPageSearchParam, serializePhiBuilderRuntimeModuleIdsSearchParam, } from "../../../../helpers/cms-scope-search-params";
|
|
16
16
|
import { createPhiBuilderControllerAddress } from "../controller/address";
|
|
17
17
|
import { readPhiBuilderInspectorAction, } from "../inspector-actions";
|
|
18
|
-
import { createEmptyPhiBuilderModulePresetPagesByArea,
|
|
18
|
+
import { createEmptyPhiBuilderModulePresetPagesByArea, } from "../../../../helpers/cms-page-catalog";
|
|
19
19
|
import { loadPhiBuilderPersistedPageCatalog } from "../page-catalog-client";
|
|
20
20
|
import { resolvePhiBuilderOfferedPageKey, resolvePhiBuilderOfferedPageKeyFromCatalogPath, } from "../offered-page-catalog";
|
|
21
21
|
import { isPhiBuilderAreaKey, resolvePhiBuilderAreaAsCmsArea, } from "../../../../constants/cms-areas";
|
|
@@ -796,9 +796,12 @@ function usePhiDeveloperBuilderWorkspaceController(options) {
|
|
|
796
796
|
return;
|
|
797
797
|
}
|
|
798
798
|
const nextArea = signal.value;
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
799
|
+
/*
|
|
800
|
+
* The Page the shared order opens an Area on -- its landing, else where its root leads -- and
|
|
801
|
+
* not the first Page of its catalog, which is an error Page as often as not. Written to the
|
|
802
|
+
* address as a page key, it would be read back as the Page somebody asked for.
|
|
803
|
+
*/
|
|
804
|
+
const nextPageKey = resolvePhiBuilderOfferedPageKey(offeredCatalogState, nextArea, null).pageKey ?? "";
|
|
802
805
|
if (typeof pathname === "string") {
|
|
803
806
|
const nextSearchParams = new URLSearchParams(searchParams.toString());
|
|
804
807
|
nextSearchParams.set(PHI_BUILDER_AREA_SEARCH_PARAM, nextArea);
|
|
@@ -4,7 +4,6 @@ export declare const PHI_BUILDER_RUNTIME_MODULE_DEFINITION: Omit<{
|
|
|
4
4
|
controller: import("../contracts").PhiRuntimeModuleControllerDescriptor;
|
|
5
5
|
description: string;
|
|
6
6
|
category: "foundation";
|
|
7
|
-
iconFamily: string;
|
|
8
7
|
controllerMountPolicy: "area";
|
|
9
8
|
dataProviders: ({
|
|
10
9
|
key: `${string}/${string}`;
|
|
@@ -511,4 +510,5 @@ export declare const PHI_BUILDER_RUNTIME_MODULE_DEFINITION: Omit<{
|
|
|
511
510
|
kind: "module";
|
|
512
511
|
eligibleAreas: readonly ["public" | "app" | "admin" | "builder" | "editor" | "accounting"];
|
|
513
512
|
title: "Public Base" | "App Base" | "Accounting Base" | "Admin Base" | "Builder Base" | "Editor Base";
|
|
513
|
+
icon: string;
|
|
514
514
|
};
|
|
@@ -13,7 +13,6 @@ export const PHI_BUILDER_RUNTIME_MODULE_DEFINITION = definePhiAreaBaseRuntimeMod
|
|
|
13
13
|
controller: buildPhiRuntimeModuleControllerDescriptor(PHI_BUILDER_RUNTIME_CONTROLLER_DEFINITION),
|
|
14
14
|
description: "Locked Builder Area shell, workspaces, Canvas orchestration, drafts, Inspector, wiring, and authoring chrome.",
|
|
15
15
|
category: "foundation",
|
|
16
|
-
iconFamily: "builder",
|
|
17
16
|
controllerMountPolicy: "area",
|
|
18
17
|
dataProviders: PHI_BUILDER_RUNTIME_DATA_PROVIDER_DESCRIPTORS,
|
|
19
18
|
});
|
|
@@ -31,6 +31,11 @@ export declare function resolvePhiBuilderAreaRootApplicants(state: PhiBuilderOff
|
|
|
31
31
|
* entry, no revision, no contradiction. It comes back with whatever it had when the Area is set to a
|
|
32
32
|
* landing again, because nothing is cleaned up here either.
|
|
33
33
|
*
|
|
34
|
+
* `/` forwards when the Area stored a redirect, or when it stored nothing and the applicant that stands
|
|
35
|
+
* there is the base Module's forward. Nothing stored is not a forward by itself: Public's root is its
|
|
36
|
+
* Welcome Page then, or the landing a Site package offers, and reading the absent answer as a forward
|
|
37
|
+
* kept the one Page every Site starts with out of its own Page list.
|
|
38
|
+
*
|
|
34
39
|
* Otherwise exactly the one root that is served. Every other applicant leaves the list either way --
|
|
35
40
|
* an entry that cannot be reached is worse than a missing one, and two entries both reading `/` would
|
|
36
41
|
* ask an author to guess which of them the visitor gets.
|
|
@@ -50,10 +55,11 @@ export declare function resolvePhiBuilderOfferedPageKeyFromCatalogPath(state: Ph
|
|
|
50
55
|
/**
|
|
51
56
|
* The Page the Builder should be on, given the one it asked for.
|
|
52
57
|
*
|
|
53
|
-
* The asked-for Page when the Area offers it. Otherwise
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
58
|
+
* The asked-for Page when the Area offers it. Otherwise the Area's landing, the Page at `/`, wherever
|
|
59
|
+
* it is on offer: it is the front door, and the one Page every Area has. Otherwise where the front door
|
|
60
|
+
* leads, because that is the answer to the question whoever set the forward just asked: `/` goes there,
|
|
61
|
+
* so that is the Page they mean. Otherwise the first Page on offer, which without the steps before it
|
|
62
|
+
* is an error Page -- whatever sorts first in a catalog is nobody's idea of a starting point.
|
|
57
63
|
*
|
|
58
64
|
* One order, one place. The workspace moves the Builder by it and the Page Select displays by it, and
|
|
59
65
|
* if they each kept their own the Select would name one Page while the canvas edited another.
|
|
@@ -6,7 +6,7 @@ import { findPhiBuilderPageKeyFromStoragePath, findPhiPageNodePath, normalizePhi
|
|
|
6
6
|
import { findFirstPhiCmsNavigationLinkPath } from "../../../components/regions/presets/navigation-redirect";
|
|
7
7
|
import { canPhiViewerAccess } from "../../../types/access";
|
|
8
8
|
import { resolvePhiRuntimeAreaDefinition } from "../area-definitions";
|
|
9
|
-
import { resolvePhiAreaRootRouteNavKey } from "../area-root-route";
|
|
9
|
+
import { resolvePhiAreaRootRouteNavKey, resolvePhiAreaRootRoutePresetKey } from "../area-root-route";
|
|
10
10
|
import { listPhiAlwaysActiveRuntimeModuleIds } from "../settings";
|
|
11
11
|
import { readPhiBuilderStoredAreaRootRoute } from "./developer-workspace-store";
|
|
12
12
|
/**
|
|
@@ -148,6 +148,19 @@ function removePhiBuilderUnansweredPresetPages(nodes, baseModuleId, isActive) {
|
|
|
148
148
|
});
|
|
149
149
|
return uncover(active);
|
|
150
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Whether the Page standing at `/` is the Area's own forward rather than a landing.
|
|
153
|
+
*
|
|
154
|
+
* The base Module of every Area behind a sign-in stands a forward there (`buildPhiAreaRootRoutePresetDescriptor`);
|
|
155
|
+
* Public's base stands its Welcome Page, and a Site package offers a landing of its own. Which of them
|
|
156
|
+
* answers an Area that stored nothing is the applicant chain's, so whether that Area forwards is a fact
|
|
157
|
+
* about the applicant, not about the absent answer.
|
|
158
|
+
*/
|
|
159
|
+
function isPhiBuilderAreaRootForward(node, area, baseModuleId) {
|
|
160
|
+
return node.sourcePreset != null &&
|
|
161
|
+
node.sourcePreset.ownerModuleId === baseModuleId &&
|
|
162
|
+
node.sourcePreset.presetKey === resolvePhiAreaRootRoutePresetKey(resolvePhiBuilderAreaAsCmsArea(area));
|
|
163
|
+
}
|
|
151
164
|
/**
|
|
152
165
|
* The Pages of an Area that may actually be opened, which is not the same as the Pages it has.
|
|
153
166
|
*
|
|
@@ -157,6 +170,11 @@ function removePhiBuilderUnansweredPresetPages(nodes, baseModuleId, isActive) {
|
|
|
157
170
|
* entry, no revision, no contradiction. It comes back with whatever it had when the Area is set to a
|
|
158
171
|
* landing again, because nothing is cleaned up here either.
|
|
159
172
|
*
|
|
173
|
+
* `/` forwards when the Area stored a redirect, or when it stored nothing and the applicant that stands
|
|
174
|
+
* there is the base Module's forward. Nothing stored is not a forward by itself: Public's root is its
|
|
175
|
+
* Welcome Page then, or the landing a Site package offers, and reading the absent answer as a forward
|
|
176
|
+
* kept the one Page every Site starts with out of its own Page list.
|
|
177
|
+
*
|
|
160
178
|
* Otherwise exactly the one root that is served. Every other applicant leaves the list either way --
|
|
161
179
|
* an entry that cannot be reached is worse than a missing one, and two entries both reading `/` would
|
|
162
180
|
* ask an author to guess which of them the visitor gets.
|
|
@@ -165,8 +183,14 @@ export function resolvePhiBuilderOfferedPageCatalog(state, area) {
|
|
|
165
183
|
const catalog = resolvePhiBuilderActivePageCatalog(area, state.modulePresetPagesByArea, state.customPages, state.persistedPageCatalogByArea);
|
|
166
184
|
const { baseModuleId, isActive } = resolvePhiBuilderAreaModuleActivation(state, area);
|
|
167
185
|
const answered = removePhiBuilderUnansweredPresetPages(catalog, baseModuleId, isActive);
|
|
168
|
-
const
|
|
169
|
-
const
|
|
186
|
+
const storedRootRoute = readPhiBuilderStoredAreaRootRoute(state, area);
|
|
187
|
+
const rootApplicant = storedRootRoute?.mode === "redirect"
|
|
188
|
+
? null
|
|
189
|
+
: resolvePhiBuilderAreaRootPageNode(state, area, answered);
|
|
190
|
+
const rootPageNode = rootApplicant != null &&
|
|
191
|
+
(storedRootRoute?.mode === "landing" || !isPhiBuilderAreaRootForward(rootApplicant, area, baseModuleId))
|
|
192
|
+
? rootApplicant
|
|
193
|
+
: null;
|
|
170
194
|
return answered.filter((node) => node.storagePath !== "/" || (rootPageNode != null && node === rootPageNode));
|
|
171
195
|
}
|
|
172
196
|
/**
|
|
@@ -198,10 +222,11 @@ function findPageKeyByReference(nodes, reference) {
|
|
|
198
222
|
/**
|
|
199
223
|
* The Page the Builder should be on, given the one it asked for.
|
|
200
224
|
*
|
|
201
|
-
* The asked-for Page when the Area offers it. Otherwise
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
225
|
+
* The asked-for Page when the Area offers it. Otherwise the Area's landing, the Page at `/`, wherever
|
|
226
|
+
* it is on offer: it is the front door, and the one Page every Area has. Otherwise where the front door
|
|
227
|
+
* leads, because that is the answer to the question whoever set the forward just asked: `/` goes there,
|
|
228
|
+
* so that is the Page they mean. Otherwise the first Page on offer, which without the steps before it
|
|
229
|
+
* is an error Page -- whatever sorts first in a catalog is nobody's idea of a starting point.
|
|
205
230
|
*
|
|
206
231
|
* One order, one place. The workspace moves the Builder by it and the Page Select displays by it, and
|
|
207
232
|
* if they each kept their own the Select would name one Page while the canvas edited another.
|
|
@@ -214,7 +239,9 @@ export function resolvePhiBuilderOfferedPageKey(state, area, requestedPageKey) {
|
|
|
214
239
|
}
|
|
215
240
|
return {
|
|
216
241
|
pages,
|
|
217
|
-
|
|
242
|
+
// Only the root the Area serves is left on the list at `/`, and only while it does not forward.
|
|
243
|
+
pageKey: pages.find((node) => node.storagePath === "/")?.key
|
|
244
|
+
?? findAreaForwardTargetPageKey(state, area, pages)
|
|
218
245
|
?? findAreaNavigationEntryPageKey(state, area, pages)
|
|
219
246
|
?? resolvePhiBuilderActivePageKey(null, pages),
|
|
220
247
|
};
|
|
@@ -8,6 +8,7 @@ import { definePhiRuntimeModuleForm } from "../../../components/forms/form-regis
|
|
|
8
8
|
import { PHI_BUILDER_EFFECTS_SECTIONS } from "./effects-form-values";
|
|
9
9
|
import { buildPhiWidgetLabelTranslatorOptions } from "../../../components/widgets/label-sets/runtime-options";
|
|
10
10
|
import { phiFormLabel as label } from "../../../components/forms/form-descriptor-text";
|
|
11
|
+
import { PHI_INSPECTOR_TABLE_CONTROL_PROPS } from "../../../helpers/cms-inspector-drawer";
|
|
11
12
|
export const PHI_BUILDER_PAGE_META_FORM_ID = createPhiFormId(PHI_SHARED_PACKAGE_NAME, "builder/page-meta");
|
|
12
13
|
const PHI_BUILDER_PAGE_META_FORM_LABEL_SET_KEY = "@phis/ui/modules/builder/labels/page-meta";
|
|
13
14
|
const PHI_BUILDER_EFFECTS_FORM_LABEL_SET_KEY = "@phis/ui/modules/builder/labels/effects";
|
|
@@ -318,7 +319,8 @@ const effectsDescriptors = {
|
|
|
318
319
|
},
|
|
319
320
|
remove: { enabled: true, label: label("removeTransition", "Remove transition") },
|
|
320
321
|
reorder: true,
|
|
321
|
-
|
|
322
|
+
// An inspector's Table: lines only (BUILDER.md "Inspector contract").
|
|
323
|
+
...PHI_INSPECTOR_TABLE_CONTROL_PROPS,
|
|
322
324
|
emptyText: label("table.emptyTransitions", "No transitions configured."),
|
|
323
325
|
layout: { mode: "auto", overflowX: "auto" },
|
|
324
326
|
},
|
|
@@ -450,7 +452,8 @@ const effectsDescriptors = {
|
|
|
450
452
|
},
|
|
451
453
|
remove: { enabled: true, label: label("removeViewportEffect", "Remove viewport effect") },
|
|
452
454
|
reorder: true,
|
|
453
|
-
|
|
455
|
+
// An inspector's Table: lines only (BUILDER.md "Inspector contract").
|
|
456
|
+
...PHI_INSPECTOR_TABLE_CONTROL_PROPS,
|
|
454
457
|
emptyText: label("table.emptyViewportEffects", "No viewport effects configured."),
|
|
455
458
|
layout: { mode: "auto", overflowX: "auto" },
|
|
456
459
|
},
|
|
@@ -80,5 +80,13 @@ function mapPhiConfigFieldText(field, mapText) {
|
|
|
80
80
|
...(mapped.editLabel == null ? {} : { editLabel: mapOptionalText(mapped.editLabel, mapText) }),
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
+
if (mapped.type === "condition-group") {
|
|
84
|
+
return {
|
|
85
|
+
...mapped,
|
|
86
|
+
conditionFields: mapped.conditionFields.map((conditionField) => mapPhiConfigFieldText(conditionField, mapText)),
|
|
87
|
+
...(mapped.addLabel == null ? {} : { addLabel: mapOptionalText(mapped.addLabel, mapText) }),
|
|
88
|
+
...(mapped.emptyLabel == null ? {} : { emptyLabel: mapOptionalText(mapped.emptyLabel, mapText) }),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
83
91
|
return mapped;
|
|
84
92
|
}
|
package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js
CHANGED
|
@@ -17,6 +17,7 @@ import { getPhiInspectorWidgetLabels } from "../../../../components/widgets/labe
|
|
|
17
17
|
import { getPhiSignalsWidgetLabels } from "../../../../components/widgets/label-sets/signals";
|
|
18
18
|
import { PHI_DIALOG_BODY_CONFIG, PHI_DIALOG_COMMANDS_CONFIG } from "../../../../helpers/cms-dialog";
|
|
19
19
|
import { buildPhiWidgetLabelTranslatorOptions } from "../../../../components/widgets/label-sets/runtime-options";
|
|
20
|
+
import { PHI_INSPECTOR_DRAWER_BODY_INSET, PHI_INSPECTOR_TABLE_PRESENTATION } from "../../../../helpers/cms-inspector-drawer";
|
|
20
21
|
const PHI_BUILDER_INSPECTOR_SECTIONS = {
|
|
21
22
|
region: [
|
|
22
23
|
[PHI_BUILDER_INSPECTOR_SECTION_WIDGET_IDS.regionGeometry, "builder-region-geometry-inspector", "geometry"],
|
|
@@ -254,8 +255,7 @@ export async function buildPhiBuilderInspectorAreaOverlayTree({ page, runtime, }
|
|
|
254
255
|
// one past the fold. Settings stays the section that opens with the Drawer, so it mounts
|
|
255
256
|
// and can hide its own slot when the layout declares nothing for it.
|
|
256
257
|
accordion: true,
|
|
257
|
-
|
|
258
|
-
innerPadding: PHI_SPACE.sm,
|
|
258
|
+
...PHI_INSPECTOR_DRAWER_BODY_INSET,
|
|
259
259
|
slotTitles: sections.map(([, , sectionKey]) => resolveBuilderInspectorSectionTitle(inspectorLabels, sectionKey)),
|
|
260
260
|
defaultOpenSlotKeys: ["slot_0"],
|
|
261
261
|
/*
|
|
@@ -546,6 +546,8 @@ export async function buildPhiBuilderInspectorAreaOverlayTree({ page, runtime, }
|
|
|
546
546
|
},
|
|
547
547
|
initialQuery: { page: 1, pageSize: 20, filters: { direction: "emit" } },
|
|
548
548
|
presentation: {
|
|
549
|
+
// An inspector's Table: lines only (BUILDER.md "Inspector contract").
|
|
550
|
+
...PHI_INSPECTOR_TABLE_PRESENTATION,
|
|
549
551
|
layout: { mode: "auto", overflowX: "auto" },
|
|
550
552
|
columns: [
|
|
551
553
|
{ key: "capabilityId", fieldKey: "capabilityId", title: signalsLabels.routes.capability, renderer: "code", sizing: { mode: "content" } },
|