@phis/ui 0.4.1 → 0.4.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/cms/phi-cms-layout-renderer.js +4 -3
- package/components/cms/phi-cms-page-render-scope.d.ts +4 -5
- package/components/cms/phi-cms-page-render-scope.js +43 -22
- package/components/cms/phi-cms-render-diagnostic-client.js +7 -3
- package/components/cms/phi-cms-render-error-boundary.js +2 -1
- package/components/controls/phi-bullet-list-control.js +31 -2
- package/components/controls/phi-ribbon-control.d.ts +29 -0
- package/components/controls/phi-ribbon-control.js +53 -0
- package/components/controls/phi-table-control.d.ts +3 -0
- package/components/controls/phi-table-control.js +13 -1
- package/components/controls/phi-tree-control.js +3 -3
- package/components/forms/shared-form-provider-registry.js +1 -4
- package/components/media/asset-collection-runtime.js +6 -16
- package/components/media/media-font-metrics.d.ts +3 -0
- package/components/media/media-font-metrics.js +43 -0
- package/components/media/phi-area-upload-widget.js +53 -97
- package/components/media/phi-image-preview-data.d.ts +13 -0
- package/components/media/phi-image-preview-data.js +184 -9
- package/components/media/phi-media-picker-binding.js +16 -13
- package/components/media/phi-media-upload.d.ts +15 -8
- package/components/media/phi-media-upload.js +18 -9
- package/components/media/phi-site-font-assets.js +7 -8
- package/components/overlays/phi-overlay-container-client.js +16 -1
- package/components/regions/presets/phi-settings-page-shell-tree.js +48 -1
- package/components/runtime/runtime-controller-materialization.js +12 -1
- package/components/state/scoped-state-store.js +20 -3
- package/components/tables/client/phi-table-binding.d.ts +2 -1
- package/components/tables/client/phi-table-binding.js +45 -21
- package/components/trees/client/phi-tree-binding.js +19 -11
- package/components/widgets/client/bullet-list-entries-editor.d.ts +26 -0
- package/components/widgets/client/bullet-list-entries-editor.js +103 -0
- package/components/widgets/config/choice-shared.js +12 -13
- package/components/widgets/config/command-buttons.d.ts +5 -1
- package/components/widgets/config/command-buttons.js +38 -81
- package/components/widgets/config/control-signal-config.d.ts +3 -1
- package/components/widgets/config/control-signal-config.js +19 -17
- package/components/widgets/config/image-source-parser.d.ts +1 -0
- package/components/widgets/config/image-source-parser.js +7 -8
- package/components/widgets/config/mask.d.ts +6 -1
- package/components/widgets/config/mask.js +24 -1
- package/components/widgets/config/parser-primitives.js +72 -0
- package/components/widgets/config/stack-tabs.d.ts +1 -1
- package/components/widgets/config/stack-tabs.js +2 -3
- package/components/widgets/config/strict-config-reader.d.ts +40 -0
- package/components/widgets/config/strict-config-reader.js +174 -0
- package/components/widgets/label-sets/effects.js +2 -0
- package/components/widgets/label-types/effects.d.ts +1 -0
- package/components/widgets/label-types/effects.js +1 -0
- package/components/widgets/navigation-descriptor-resolver.server.js +20 -8
- package/components/widgets/shared/bullet-list-vocabulary.d.ts +17 -1
- package/components/widgets/shared/bullet-list-vocabulary.js +19 -2
- package/components/widgets/shared/card-body-client.d.ts +16 -4
- package/components/widgets/shared/card-body-client.js +81 -24
- package/components/widgets/shared/card-vocabulary.d.ts +21 -4
- package/components/widgets/shared/card-vocabulary.js +28 -2
- package/components/widgets/shared/markdown-body-client.d.ts +2 -1
- package/components/widgets/shared/markdown-body-client.js +3 -1
- package/components/widgets/shared/markdown-render.js +8 -1
- package/components/widgets/signals/control-signal-capabilities.d.ts +0 -18
- package/components/widgets/signals/control-signal-capabilities.js +10 -22
- package/components/workspace/catalog-store.d.ts +4 -3
- package/components/workspace/catalog-store.js +6 -5
- package/gateway/dashboard-cards-route.js +1 -0
- package/gateway/internal-references.d.ts +6 -1
- package/gateway/internal-references.js +48 -23
- package/gateway/site-cms-write-validation.d.ts +9 -0
- package/gateway/site-cms-write-validation.js +78 -0
- package/gateway/site-proxy.js +19 -3
- package/helpers/renderable-block-serialization.js +1 -1
- package/next/config.d.mts +3 -0
- package/next/config.mjs +28 -1
- package/package.json +2 -2
- package/plugins/runtime/phi-slot-child-viewport-effects-observer.js +5 -1
- package/plugins/runtime-modules/accounting/presets.d.ts +9 -0
- package/plugins/runtime-modules/accounting/presets.js +37 -0
- package/plugins/runtime-modules/accounting/server.d.ts +1 -4
- package/plugins/runtime-modules/accounting/server.js +4 -7
- package/plugins/runtime-modules/app/presets.d.ts +18 -0
- package/plugins/runtime-modules/app/presets.js +67 -0
- package/plugins/runtime-modules/app/server.d.ts +1 -4
- package/plugins/runtime-modules/app/server.js +4 -7
- package/plugins/runtime-modules/asset/controller/runtime.js +2 -2
- package/plugins/runtime-modules/asset/services/collection.js +9 -1
- package/plugins/runtime-modules/asset/services/options.js +2 -2
- package/plugins/runtime-modules/builder/area-settings-answer.js +2 -1
- package/plugins/runtime-modules/builder/authoring-canvas.js +6 -6
- package/plugins/runtime-modules/builder/cards.js +3 -5
- package/plugins/runtime-modules/builder/clients/builder-region-overrides.js +3 -3
- package/plugins/runtime-modules/builder/clients/canvas-widget.js +15 -54
- package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +4 -1
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +5 -34
- package/plugins/runtime-modules/builder/clients/inspector-link-target-field.js +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +8 -8
- package/plugins/runtime-modules/builder/clients/inspector-title.js +6 -6
- package/plugins/runtime-modules/builder/clients/layout-inspector.d.ts +1 -1
- package/plugins/runtime-modules/builder/clients/layout-inspector.js +11 -25
- package/plugins/runtime-modules/builder/clients/mode-switch.js +1 -1
- package/plugins/runtime-modules/builder/clients/pages-header.js +11 -11
- package/plugins/runtime-modules/builder/clients/pages-workspace.js +1 -1
- package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
- package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +1 -1
- package/plugins/runtime-modules/builder/clients/shells-workspace.js +15 -31
- package/plugins/runtime-modules/builder/clients/structure-canvas.js +1 -1
- package/plugins/runtime-modules/builder/clients/use-region-draft-hydration.d.ts +26 -0
- package/plugins/runtime-modules/builder/clients/use-region-draft-hydration.js +36 -0
- package/plugins/runtime-modules/builder/clients/widget-effects-editor.js +1 -1
- package/plugins/runtime-modules/builder/clients/widget-inspector.js +1 -0
- package/plugins/runtime-modules/builder/clients/workspace-scope-boundary.js +2 -2
- package/plugins/runtime-modules/builder/cms-instance-allocator.js +8 -28
- package/plugins/runtime-modules/builder/controller/client.d.ts +0 -15
- package/plugins/runtime-modules/builder/controller/definition.d.ts +0 -15
- package/plugins/runtime-modules/builder/controller/definition.js +0 -8
- package/plugins/runtime-modules/builder/controller/draft-command-controller.d.ts +1 -2
- package/plugins/runtime-modules/builder/controller/draft-command-controller.js +11 -30
- package/plugins/runtime-modules/builder/controller/draft-status-controller.js +15 -2
- package/plugins/runtime-modules/builder/controller/inspector-controller.d.ts +1 -2
- package/plugins/runtime-modules/builder/controller/inspector-controller.js +4 -7
- package/plugins/runtime-modules/builder/controller/page-controller.d.ts +1 -2
- package/plugins/runtime-modules/builder/controller/page-controller.js +16 -68
- package/plugins/runtime-modules/builder/controller/server-definition.d.ts +0 -15
- package/plugins/runtime-modules/builder/controller/signal-wiring-controller.d.ts +2 -5
- package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +6 -50
- package/plugins/runtime-modules/builder/controller/workspace-controller.d.ts +2 -3
- package/plugins/runtime-modules/builder/controller/workspace-controller.js +89 -153
- package/plugins/runtime-modules/builder/data-providers.d.ts +1 -0
- package/plugins/runtime-modules/builder/data-providers.js +1 -0
- package/plugins/runtime-modules/builder/definition.d.ts +1 -0
- package/plugins/runtime-modules/builder/developer-workspace-store.d.ts +64 -30
- package/plugins/runtime-modules/builder/developer-workspace-store.js +255 -61
- package/plugins/runtime-modules/builder/edit-scaffold-drawer.js +1 -1
- package/plugins/runtime-modules/builder/history.d.ts +3 -1
- package/plugins/runtime-modules/builder/options-providers.js +3 -2
- package/plugins/runtime-modules/builder/page-catalog-client.js +19 -7
- package/plugins/runtime-modules/builder/page-meta-form.js +1 -0
- package/plugins/runtime-modules/builder/page-references-provider.js +1 -1
- package/plugins/runtime-modules/builder/persistence.js +33 -69
- package/plugins/runtime-modules/builder/public-route-collisions.d.ts +2 -2
- package/plugins/runtime-modules/builder/public-route-collisions.js +6 -19
- package/plugins/runtime-modules/builder/render-root-node-preview.server.js +20 -3
- package/plugins/runtime-modules/builder/render-root-node-scaffold.js +3 -3
- package/plugins/runtime-modules/builder/runtime-module-selection.d.ts +2 -12
- package/plugins/runtime-modules/builder/runtime-module-selection.js +16 -42
- package/plugins/runtime-modules/builder/services/navigation-table.js +9 -15
- package/plugins/runtime-modules/builder/services/page-source-tree.js +8 -8
- package/plugins/runtime-modules/builder/services/runtime-modules-table.js +10 -10
- package/plugins/runtime-modules/builder/services/signal-routes-table.js +3 -3
- package/plugins/runtime-modules/builder/signal-route-selection.d.ts +1 -2
- package/plugins/runtime-modules/builder/signal-route-selection.js +2 -2
- package/plugins/runtime-modules/builder/signal-wiring-options.js +3 -2
- package/plugins/runtime-modules/builder/structure-dnd.js +8 -61
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +13 -10
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +12 -18
- package/plugins/runtime-modules/builder/workspace-catalog-actions.d.ts +55 -0
- package/plugins/runtime-modules/builder/workspace-catalog-actions.js +142 -0
- package/plugins/runtime-modules/client-manifests/common.js +1 -1
- package/plugins/runtime-modules/{runtime-calendar-adapters.js → core/calendar-adapters.js} +2 -2
- package/plugins/runtime-modules/{client-calendar-adapters/core.js → core/client-calendar-adapters.js} +1 -1
- package/plugins/runtime-modules/core/content-entries/table.js +1 -1
- package/plugins/runtime-modules/core/data-providers.d.ts +3 -0
- package/plugins/runtime-modules/core/data-providers.js +2 -1
- package/plugins/runtime-modules/core/definition.d.ts +3 -0
- package/plugins/runtime-modules/core/definition.js +1 -1
- package/plugins/runtime-modules/core/messaging/data-providers.d.ts +1 -0
- package/plugins/runtime-modules/core/messaging/data-providers.js +1 -0
- package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +1 -1
- package/plugins/runtime-modules/core/server.js +1 -1
- package/plugins/runtime-modules/core/themes.d.ts +44 -0
- package/plugins/runtime-modules/core/themes.js +12 -0
- package/plugins/runtime-modules/core/widgets/card/collection-view-binding.js +25 -9
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +296 -254
- package/plugins/runtime-modules/core/widgets/card/config.js +52 -3
- package/plugins/runtime-modules/core/widgets/card/editor.js +30 -3
- package/plugins/runtime-modules/core/widgets/card/server.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/card/server.js +31 -3
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +7 -6
- package/plugins/runtime-modules/core/widgets/collection-view/config.js +9 -2
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -25
- package/plugins/runtime-modules/core/widgets/description/editor.js +4 -61
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -25
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -25
- package/plugins/runtime-modules/core/widgets/image/config.js +2 -2
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +3 -1
- package/plugins/runtime-modules/core/widgets/markdown/config.js +14 -0
- package/plugins/runtime-modules/core/widgets/markdown/editor.js +2 -3
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +4 -25
- package/plugins/runtime-modules/core/widgets/result/config.js +2 -0
- package/plugins/runtime-modules/core/widgets/result/server.js +25 -19
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -25
- package/plugins/runtime-modules/core/widgets/slot-upload/client.js +11 -2
- package/plugins/runtime-modules/core/widgets/table/client.js +8 -4
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -83
- package/plugins/runtime-modules/core/widgets/table/config.js +302 -452
- package/plugins/runtime-modules/core/widgets/tree/config.js +5 -2
- package/plugins/runtime-modules/dashboard/card-rows.d.ts +5 -0
- package/plugins/runtime-modules/dashboard/card-rows.js +59 -0
- package/plugins/runtime-modules/dashboard/clients/dashboard-card-view.js +4 -6
- package/plugins/runtime-modules/dashboard/services/collection.js +17 -7
- package/plugins/runtime-modules/groups/data-providers.d.ts +2 -0
- package/plugins/runtime-modules/groups/data-providers.js +3 -3
- package/plugins/runtime-modules/groups/definition.d.ts +2 -0
- package/plugins/runtime-modules/localization/data-providers.d.ts +3 -0
- package/plugins/runtime-modules/localization/data-providers.js +2 -0
- package/plugins/runtime-modules/localization/definition.d.ts +3 -0
- package/plugins/runtime-modules/localization/services/table.js +3 -7
- package/plugins/runtime-modules/observability/data-providers.d.ts +1 -0
- package/plugins/runtime-modules/observability/data-providers.js +1 -0
- package/plugins/runtime-modules/observability/definition.d.ts +1 -0
- package/plugins/runtime-modules/observability/module.d.ts +1 -0
- package/plugins/runtime-modules/observability/services/table.js +1 -1
- package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +2 -105
- package/plugins/runtime-modules/public/presets.d.ts +115 -0
- package/plugins/runtime-modules/{area-base-presets.js → public/presets.js} +19 -119
- package/plugins/runtime-modules/public/server.d.ts +1 -4
- package/plugins/runtime-modules/public/server.js +4 -7
- package/plugins/runtime-modules/public/trees/phi-default-pub-error-page-tree.js +7 -8
- package/plugins/runtime-modules/public-base-page-references.d.ts +1 -1
- package/plugins/runtime-modules/public-base-page-references.js +1 -1
- package/plugins/runtime-modules/revisions/controller/client.js +11 -11
- package/plugins/runtime-modules/revisions/services/table.js +3 -3
- package/plugins/runtime-modules/theme/trees/phi-default-builder-theme-page-tree.js +22 -0
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.d.ts +2 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +93 -58
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +2 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +23 -22
- package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +1 -1
- package/plugins/runtime-modules/theme-descriptors.js +1 -1
- package/plugins/runtime-modules/user-management/data-providers.d.ts +2 -0
- package/plugins/runtime-modules/user-management/data-providers.js +1 -0
- package/plugins/runtime-modules/user-management/definition.d.ts +2 -0
- package/styles/control-shape.css +11 -11
- package/styles/controls.css +29 -3
- package/styles/layout.css +16 -7
- package/types/cms-config.js +142 -185
- package/types/cms-plugins.d.ts +4 -11
- package/types/core-widget-placements.d.ts +17 -3
- package/types/dashboard-cards.d.ts +9 -0
- package/types/media.d.ts +0 -3
- package/types/renderable-block.d.ts +6 -1
- package/types/table-widget.d.ts +9 -0
- package/types/table-widget.js +20 -0
- package/types.d.ts +1 -1
- package/widget-config.d.ts +2 -0
- package/widget-config.js +6 -0
- package/plugins/runtime-modules/area-base-presets.d.ts +0 -139
- /package/plugins/runtime-modules/{runtime-calendar-adapters.d.ts → core/calendar-adapters.d.ts} +0 -0
- /package/plugins/runtime-modules/{client-calendar-adapters/core.d.ts → core/client-calendar-adapters.d.ts} +0 -0
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { DndContext, DragOverlay, PointerSensor, pointerWithin, useDraggable, useDroppable, useSensor, useSensors, } from "@dnd-kit/core";
|
|
4
4
|
import { createContext, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
5
|
-
import { PHI_SIGNAL_VALUE_SCHEMAS } from "../../../types/signals";
|
|
6
|
-
import { usePhiSignalDispatcher } from "../../../components/runtime/runtime-signal-bus";
|
|
7
|
-
import { createPhiBuilderControllerAddress } from "./controller/address";
|
|
8
5
|
const PhiStructureDndContext = createContext({
|
|
9
6
|
active: null,
|
|
10
7
|
acceptedTargetId: null,
|
|
@@ -61,47 +58,18 @@ function PhiStructureDragSnapshot({ source, }) {
|
|
|
61
58
|
} }));
|
|
62
59
|
}
|
|
63
60
|
export function PhiStructureDndProvider({ children, }) {
|
|
64
|
-
const emitSignal = usePhiSignalDispatcher();
|
|
65
61
|
const sensors = useSensors(useSensor(PointerSensor, {
|
|
66
62
|
activationConstraint: { distance: 4 },
|
|
67
63
|
}));
|
|
68
64
|
const [active, setActive] = useState(null);
|
|
69
65
|
const [acceptedTargetId, setAcceptedTargetId] = useState(null);
|
|
70
|
-
const lastOverTargetIdRef = useRef(null);
|
|
71
66
|
const previewElement = active?.getPreviewElement() ?? null;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
value: {
|
|
79
|
-
area: source.area,
|
|
80
|
-
pageKey: source.pageKey,
|
|
81
|
-
sourceRegionKey: source.regionKey,
|
|
82
|
-
sourceNodeId: source.nodeId,
|
|
83
|
-
sourceNodeKind: source.nodeKind,
|
|
84
|
-
targetRegionKey: input.target?.regionKey ?? null,
|
|
85
|
-
targetKey: input.target?.id ?? null,
|
|
86
|
-
targetNodeId: input.target?.targetNodeId ?? null,
|
|
87
|
-
dropMode: input.target?.dropMode ?? null,
|
|
88
|
-
accepted: input.accepted ?? null,
|
|
89
|
-
},
|
|
90
|
-
valueType: "json",
|
|
91
|
-
valueSchema: PHI_SIGNAL_VALUE_SCHEMAS.dragDrop,
|
|
92
|
-
sender: controller,
|
|
93
|
-
receiver: controller,
|
|
94
|
-
timestamp: Date.now(),
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
const finish = (source) => {
|
|
98
|
-
if (source) {
|
|
99
|
-
emitDragSignal(source, {
|
|
100
|
-
channel: "drag",
|
|
101
|
-
action: "stop",
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
lastOverTargetIdRef.current = null;
|
|
67
|
+
/*
|
|
68
|
+
* The drag stays inside this context: the drop moves the node through its target, and nothing is
|
|
69
|
+
* signalled. The Builder Controller used to send `drag/*` and `drop/drop` here, addressed to itself,
|
|
70
|
+
* which answers nothing under its own address -- four declared outputs that never reached anybody.
|
|
71
|
+
*/
|
|
72
|
+
const finish = () => {
|
|
105
73
|
setAcceptedTargetId(null);
|
|
106
74
|
setActive(null);
|
|
107
75
|
};
|
|
@@ -111,10 +79,6 @@ export function PhiStructureDndProvider({ children, }) {
|
|
|
111
79
|
return;
|
|
112
80
|
}
|
|
113
81
|
setActive(source);
|
|
114
|
-
emitDragSignal(source, {
|
|
115
|
-
channel: "drag",
|
|
116
|
-
action: "start",
|
|
117
|
-
});
|
|
118
82
|
};
|
|
119
83
|
const handleDragOver = (event) => {
|
|
120
84
|
const source = readStructureDragData(event);
|
|
@@ -122,17 +86,6 @@ export function PhiStructureDndProvider({ children, }) {
|
|
|
122
86
|
const accepted = !!source && !!target && target.accepts(source);
|
|
123
87
|
const nextTargetId = accepted ? target.id : null;
|
|
124
88
|
setAcceptedTargetId((current) => current === nextTargetId ? current : nextTargetId);
|
|
125
|
-
if (source &&
|
|
126
|
-
target &&
|
|
127
|
-
lastOverTargetIdRef.current !== `${target.id}:${accepted}`) {
|
|
128
|
-
lastOverTargetIdRef.current = `${target.id}:${accepted}`;
|
|
129
|
-
emitDragSignal(source, {
|
|
130
|
-
channel: "drag",
|
|
131
|
-
action: "change",
|
|
132
|
-
target,
|
|
133
|
-
accepted,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
89
|
};
|
|
137
90
|
const handleDragEnd = (event) => {
|
|
138
91
|
const source = readStructureDragData(event);
|
|
@@ -140,14 +93,8 @@ export function PhiStructureDndProvider({ children, }) {
|
|
|
140
93
|
const accepted = !!source && !!target && target.accepts(source);
|
|
141
94
|
if (source && target && accepted) {
|
|
142
95
|
target.drop(source);
|
|
143
|
-
emitDragSignal(source, {
|
|
144
|
-
channel: "drop",
|
|
145
|
-
action: "drop",
|
|
146
|
-
target,
|
|
147
|
-
accepted: true,
|
|
148
|
-
});
|
|
149
96
|
}
|
|
150
|
-
finish(
|
|
97
|
+
finish();
|
|
151
98
|
};
|
|
152
99
|
const contextValue = useMemo(() => ({ active, acceptedTargetId }), [acceptedTargetId, active]);
|
|
153
100
|
useEffect(() => {
|
|
@@ -156,7 +103,7 @@ export function PhiStructureDndProvider({ children, }) {
|
|
|
156
103
|
document.documentElement.removeAttribute("data-phi-structure-drop-accepted");
|
|
157
104
|
};
|
|
158
105
|
}, [acceptedTargetId]);
|
|
159
|
-
return (_jsx(DndContext, { sensors: sensors, collisionDetection: pointerWithin, onDragStart: handleDragStart, onDragOver: handleDragOver, onDragEnd: handleDragEnd, onDragCancel:
|
|
106
|
+
return (_jsx(DndContext, { sensors: sensors, collisionDetection: pointerWithin, onDragStart: handleDragStart, onDragOver: handleDragOver, onDragEnd: handleDragEnd, onDragCancel: finish, children: _jsxs(PhiStructureDndContext.Provider, { value: contextValue, children: [children, _jsx(DragOverlay, { dropAnimation: null, children: active ? _jsx(PhiStructureDragSnapshot, { source: previewElement }) : null })] }) }));
|
|
160
107
|
}
|
|
161
108
|
export function usePhiStructureDraggable(id, data) {
|
|
162
109
|
return useDraggable({
|
|
@@ -273,17 +273,20 @@ function remapBuilderPresetTreeInstanceIds(tree, ownerModuleId, presetKey) {
|
|
|
273
273
|
from: createPhiSignalAddress("cms", from),
|
|
274
274
|
to: createPhiSignalAddress("cms", to),
|
|
275
275
|
}));
|
|
276
|
-
|
|
276
|
+
// One id stays one id: a node whose id is not remapped keeps its own, so nothing here can come back
|
|
277
|
+
// empty. The nullable form is for the links a tree may leave unset, and only for those.
|
|
278
|
+
const remapInstanceId = (value) => instanceIdRemaps.get(value) ?? value;
|
|
279
|
+
const remapOptionalInstanceId = (value) => value == null ? null : remapInstanceId(value);
|
|
277
280
|
return {
|
|
278
281
|
...tree,
|
|
279
282
|
page: {
|
|
280
283
|
...tree.page,
|
|
281
|
-
heroRootLayoutNodeId:
|
|
282
|
-
headerBottomRootLayoutNodeId:
|
|
283
|
-
siderRightRootLayoutNodeId:
|
|
284
|
-
footerTopRootLayoutNodeId:
|
|
285
|
-
drawerRightRootLayoutNodeId:
|
|
286
|
-
contentRootLayoutNodeId:
|
|
284
|
+
heroRootLayoutNodeId: remapOptionalInstanceId(tree.page.heroRootLayoutNodeId),
|
|
285
|
+
headerBottomRootLayoutNodeId: remapOptionalInstanceId(tree.page.headerBottomRootLayoutNodeId),
|
|
286
|
+
siderRightRootLayoutNodeId: remapOptionalInstanceId(tree.page.siderRightRootLayoutNodeId),
|
|
287
|
+
footerTopRootLayoutNodeId: remapOptionalInstanceId(tree.page.footerTopRootLayoutNodeId),
|
|
288
|
+
drawerRightRootLayoutNodeId: remapOptionalInstanceId(tree.page.drawerRightRootLayoutNodeId),
|
|
289
|
+
contentRootLayoutNodeId: remapOptionalInstanceId(tree.page.contentRootLayoutNodeId),
|
|
287
290
|
},
|
|
288
291
|
regions: tree.regions.map((region) => ({
|
|
289
292
|
...region,
|
|
@@ -292,7 +295,7 @@ function remapBuilderPresetTreeInstanceIds(tree, ownerModuleId, presetKey) {
|
|
|
292
295
|
overlays: tree.overlays.map((overlay) => ({
|
|
293
296
|
...overlay,
|
|
294
297
|
id: remapInstanceId(overlay.id),
|
|
295
|
-
headerLayoutNodeId:
|
|
298
|
+
headerLayoutNodeId: remapOptionalInstanceId(overlay.headerLayoutNodeId),
|
|
296
299
|
bodyLayoutNodeId: remapInstanceId(overlay.bodyLayoutNodeId),
|
|
297
300
|
...(overlay.footerPresentation === "none"
|
|
298
301
|
? { footerPresentation: "none", footerLayoutNodeId: null }
|
|
@@ -305,7 +308,7 @@ function remapBuilderPresetTreeInstanceIds(tree, ownerModuleId, presetKey) {
|
|
|
305
308
|
layoutNodes: tree.layoutNodes.map((node) => ({
|
|
306
309
|
...node,
|
|
307
310
|
id: remapInstanceId(node.id),
|
|
308
|
-
parentLayoutNodeId:
|
|
311
|
+
parentLayoutNodeId: remapOptionalInstanceId(node.parentLayoutNodeId),
|
|
309
312
|
config: remapPhiSignalRoutesInConfig(node.config, signalRemaps),
|
|
310
313
|
})),
|
|
311
314
|
// The Controller's routes name the same receivers the nodes' routes do, so they move with them.
|
|
@@ -1880,7 +1883,7 @@ async function buildPhiDefaultBuilderPagePresetTemplateTree({ page, runtime, pre
|
|
|
1880
1883
|
},
|
|
1881
1884
|
}),
|
|
1882
1885
|
]
|
|
1883
|
-
:
|
|
1886
|
+
: navigationLabels
|
|
1884
1887
|
? [
|
|
1885
1888
|
nodes.widget({
|
|
1886
1889
|
typeKey: "command-toolbar",
|
|
@@ -296,13 +296,13 @@ export function PhiStructureRegionScaffold({ config, serverPreview, structureDra
|
|
|
296
296
|
const activeModules = usePhiRuntimeModuleState();
|
|
297
297
|
const authoringCanvas = usePhiBuilderAuthoringCanvas();
|
|
298
298
|
const builderState = {
|
|
299
|
-
area: usePhiDeveloperBuilderStateValue(
|
|
300
|
-
pageKey: usePhiDeveloperBuilderStateValue(
|
|
301
|
-
builderMode: usePhiDeveloperBuilderStateValue(
|
|
302
|
-
debugScaffold: usePhiDeveloperBuilderStateValue(
|
|
303
|
-
pickerWidgetCategoryFilters: usePhiDeveloperBuilderStateValue(
|
|
304
|
-
selectedLayoutAnchor: usePhiDeveloperBuilderStateValue(
|
|
305
|
-
regionSelected: usePhiDeveloperBuilderStateValue(
|
|
299
|
+
area: usePhiDeveloperBuilderStateValue((state) => state.area),
|
|
300
|
+
pageKey: usePhiDeveloperBuilderStateValue((state) => state.pageKey),
|
|
301
|
+
builderMode: usePhiDeveloperBuilderStateValue((state) => state.builderMode),
|
|
302
|
+
debugScaffold: usePhiDeveloperBuilderStateValue((state) => state.debugScaffold),
|
|
303
|
+
pickerWidgetCategoryFilters: usePhiDeveloperBuilderStateValue((state) => state.pickerWidgetCategoryFilters),
|
|
304
|
+
selectedLayoutAnchor: usePhiDeveloperBuilderStateValue((state) => state.selectedRootRegionKey === config.regionKey ? state.selectedLayoutAnchor : null),
|
|
305
|
+
regionSelected: usePhiDeveloperBuilderStateValue((state) => state.nodeKind === "region" && state.selectedRegionKey === config.regionKey),
|
|
306
306
|
};
|
|
307
307
|
const builderModuleMetas = usePhiBuilderModuleMetas(builderState.area);
|
|
308
308
|
const layoutMetasByType = useMemo(() => buildPhiBuilderContainerMetaMap(builderModuleMetas.plugins), [builderModuleMetas.plugins]);
|
|
@@ -424,9 +424,7 @@ export function PhiStructureRegionScaffold({ config, serverPreview, structureDra
|
|
|
424
424
|
if (!hasRootNode || isPreviewMode || !rootNodeKind) {
|
|
425
425
|
return;
|
|
426
426
|
}
|
|
427
|
-
selectPhiDeveloperBuilderNode(
|
|
428
|
-
area: builderState.area,
|
|
429
|
-
pageKey: builderState.pageKey,
|
|
427
|
+
selectPhiDeveloperBuilderNode({
|
|
430
428
|
regionKey: config.regionKey,
|
|
431
429
|
nodeId: options?.nodeId ?? rootNodeId,
|
|
432
430
|
nodeKey: options?.nodeKey ?? rootNodeTypeKey,
|
|
@@ -1026,7 +1024,7 @@ export function PhiStructureRegionScaffold({ config, serverPreview, structureDra
|
|
|
1026
1024
|
}, [builderMode, isPicking]);
|
|
1027
1025
|
useEffect(() => {
|
|
1028
1026
|
if (!Array.isArray(builderState.pickerWidgetCategoryFilters)) {
|
|
1029
|
-
patchPhiDeveloperBuilderState(
|
|
1027
|
+
patchPhiDeveloperBuilderState({ pickerWidgetCategoryFilters: [] });
|
|
1030
1028
|
}
|
|
1031
1029
|
}, [builderState.pickerWidgetCategoryFilters]);
|
|
1032
1030
|
useEffect(() => {
|
|
@@ -1074,9 +1072,7 @@ export function PhiStructureRegionScaffold({ config, serverPreview, structureDra
|
|
|
1074
1072
|
if (!config.allowSelect || isPreviewMode) {
|
|
1075
1073
|
return;
|
|
1076
1074
|
}
|
|
1077
|
-
selectPhiDeveloperBuilderNode(
|
|
1078
|
-
area: builderState.area,
|
|
1079
|
-
pageKey: builderState.pageKey,
|
|
1075
|
+
selectPhiDeveloperBuilderNode({
|
|
1080
1076
|
nodeKind: "region",
|
|
1081
1077
|
nodeKey: `region:${config.regionKey}`,
|
|
1082
1078
|
regionKey: config.regionKey,
|
|
@@ -1113,9 +1109,7 @@ export function PhiStructureRegionScaffold({ config, serverPreview, structureDra
|
|
|
1113
1109
|
setSlotPickerContext(nextSlotPickerContext);
|
|
1114
1110
|
setPickSection(nextDefaultPickSection);
|
|
1115
1111
|
setIsPicking(true);
|
|
1116
|
-
selectPhiDeveloperBuilderNode(
|
|
1117
|
-
area: builderState.area,
|
|
1118
|
-
pageKey: builderState.pageKey,
|
|
1112
|
+
selectPhiDeveloperBuilderNode({
|
|
1119
1113
|
regionKey: config.regionKey,
|
|
1120
1114
|
nodeKey: `slot:${config.regionKey}`,
|
|
1121
1115
|
nodeKind: "slot",
|
|
@@ -1150,7 +1144,7 @@ export function PhiStructureRegionScaffold({ config, serverPreview, structureDra
|
|
|
1150
1144
|
if (!nextOpen && isActiveTarget)
|
|
1151
1145
|
closePicker();
|
|
1152
1146
|
}, onSectionChange: setPickSection, onPackageFiltersChange: setPickPackageFilters, onWidgetCategoryFiltersChange: (filters) => {
|
|
1153
|
-
patchPhiDeveloperBuilderState(
|
|
1147
|
+
patchPhiDeveloperBuilderState({ pickerWidgetCategoryFilters: filters });
|
|
1154
1148
|
}, onChange: (item) => void insertPickedItem(item) }, key));
|
|
1155
1149
|
}
|
|
1156
1150
|
/*
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type PhiWorkspaceCatalogState } from "../../../components/workspace/catalog-store";
|
|
2
|
+
import type { PhiBuilderPersistedPageCatalogEntry, PhiPresetPageNode } from "../../../helpers/cms-page-catalog";
|
|
3
|
+
import type { PhiCmsResolvedNavigationSurface } from "../../../types/cms-module-descriptors";
|
|
4
|
+
import type { PhiRuntimeModuleId } from "../../../types";
|
|
5
|
+
import type { PhiDeveloperBuilderArea } from "./developer-workspace-types";
|
|
6
|
+
/** The Area and Page being worked on. Leaves the catalog as it is when both are already open. */
|
|
7
|
+
export declare function openPhiWorkspacePage(area: PhiDeveloperBuilderArea, pageKey: string): void;
|
|
8
|
+
/** The Page being worked on, within the Area that is open. */
|
|
9
|
+
export declare function setPhiWorkspacePageKey(pageKey: string): void;
|
|
10
|
+
/** The Site's own Pages of one Area, as the server answered them; the Area's catalog counts as read. */
|
|
11
|
+
export declare function storePhiWorkspacePersistedPages(area: PhiDeveloperBuilderArea, pages: PhiBuilderPersistedPageCatalogEntry[]): void;
|
|
12
|
+
/** A Page created in the Builder and not saved yet. */
|
|
13
|
+
export declare function addPhiWorkspaceCustomPage(area: PhiDeveloperBuilderArea, page: PhiPresetPageNode): void;
|
|
14
|
+
/** A navigation created in the Builder, added to the surfaces of its Area. */
|
|
15
|
+
export declare function addPhiWorkspaceNavigationSurface(area: PhiDeveloperBuilderArea, surface: PhiCmsResolvedNavigationSurface): void;
|
|
16
|
+
/** The Pages and navigation surfaces the active Modules contribute, when the Module selection changed. */
|
|
17
|
+
export declare function setPhiWorkspaceActiveCatalogs(catalogs: Pick<PhiWorkspaceCatalogState, "modulePresetPagesByArea" | "navigationSurfacesByArea">): void;
|
|
18
|
+
/** The Module selection of the named Areas; the other Areas keep theirs. */
|
|
19
|
+
export declare function setPhiWorkspaceModuleSelection(moduleIdsByArea: Partial<Record<PhiDeveloperBuilderArea, PhiRuntimeModuleId[]>>): void;
|
|
20
|
+
/**
|
|
21
|
+
* The Public addresses one Module's Pages take, as the collision dialog answered them. The Module's
|
|
22
|
+
* other assignments, and every other Module's, stay.
|
|
23
|
+
*/
|
|
24
|
+
export declare function assignPhiWorkspacePublicRoutePaths(moduleId: PhiRuntimeModuleId, answers: ReadonlyMap<string, string>): void;
|
|
25
|
+
/** Catalog fields an undo or redo puts back (`splitWorkspacePatch`). */
|
|
26
|
+
export declare function restorePhiWorkspaceCatalog(fields: Partial<PhiWorkspaceCatalogState>): void;
|
|
27
|
+
/** What the server rendered the Builder with, as its preload hands it in. */
|
|
28
|
+
export type PhiWorkspaceCatalogPreload = Pick<PhiWorkspaceCatalogState, "areaPresetSourcesByArea" | "unresolvedModuleIdsByArea" | "serverUnavailableModules" | "publicRouteClaims" | "publicRoutePaths"> & {
|
|
29
|
+
runtimeModuleDefinitions: readonly PhiWorkspaceCatalogState["runtimeModuleDefinitions"][number][];
|
|
30
|
+
runtimeModuleIdsByArea: Readonly<Record<string, PhiRuntimeModuleId[]>>;
|
|
31
|
+
/** The Pages and surfaces of the active Modules, which is what the catalog holds. */
|
|
32
|
+
activeCatalogs: Pick<PhiWorkspaceCatalogState, "modulePresetPagesByArea" | "navigationSurfacesByArea">;
|
|
33
|
+
/**
|
|
34
|
+
* The server's answer, serialized, per field: a field is taken again only when this differs from what
|
|
35
|
+
* the catalog holds, so an unsaved edit -- a Module selection, a collision answer -- survives a
|
|
36
|
+
* re-render that brought nothing new.
|
|
37
|
+
*/
|
|
38
|
+
keys: {
|
|
39
|
+
runtimeModuleDefinitions: string;
|
|
40
|
+
modulePresetPagesByArea: string;
|
|
41
|
+
areaPresetSourcesByArea: string;
|
|
42
|
+
navigationSurfacesByArea: string;
|
|
43
|
+
unresolvedModuleIdsByArea: string;
|
|
44
|
+
publicRouteClaims: string;
|
|
45
|
+
serverUnavailableModules: string;
|
|
46
|
+
publicRoutePaths: string;
|
|
47
|
+
};
|
|
48
|
+
normalizeArea: (area: string) => PhiDeveloperBuilderArea;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Feeds the server's preload into the catalog, and answers the Page it opened when none was open yet --
|
|
52
|
+
* the caller selects that Page in the Builder. Nothing else is written from inside the update, so the
|
|
53
|
+
* Builder's own store is never patched from within the catalog's.
|
|
54
|
+
*/
|
|
55
|
+
export declare function applyPhiWorkspaceCatalogPreload(preload: PhiWorkspaceCatalogPreload): string | null;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { PHI_WORKSPACE_CATALOG_SCOPE, phiWorkspaceCatalogStore, } from "../../../components/workspace/catalog-store";
|
|
3
|
+
import { resolvePhiBuilderActivePageKey } from "../../../helpers/cms-page-catalog";
|
|
4
|
+
import { normalizePhiAreaPublicRoutePaths } from "../../../helpers/cms-area-config";
|
|
5
|
+
/*
|
|
6
|
+
* Every write the Builder makes to the workspace catalog (`components/workspace/catalog-store.ts`).
|
|
7
|
+
*
|
|
8
|
+
* The catalog is the Foundation's -- revisions read it, and the Editor will feed it -- but on this side
|
|
9
|
+
* only the Builder feeds it, and it does so here and nowhere else. Each write is a named action, so
|
|
10
|
+
* "who changes which Area is open" has one answer; before, fourteen places in six files patched the
|
|
11
|
+
* store with whatever they held. `scripts/validate-builder-store-ownership.mjs` keeps it that way.
|
|
12
|
+
*/
|
|
13
|
+
function patchCatalog(update) {
|
|
14
|
+
phiWorkspaceCatalogStore.patch(PHI_WORKSPACE_CATALOG_SCOPE, update);
|
|
15
|
+
}
|
|
16
|
+
/** The Area and Page being worked on. Leaves the catalog as it is when both are already open. */
|
|
17
|
+
export function openPhiWorkspacePage(area, pageKey) {
|
|
18
|
+
patchCatalog((current) => (current.area === area && current.pageKey === pageKey
|
|
19
|
+
? current
|
|
20
|
+
: { ...current, area, pageKey }));
|
|
21
|
+
}
|
|
22
|
+
/** The Page being worked on, within the Area that is open. */
|
|
23
|
+
export function setPhiWorkspacePageKey(pageKey) {
|
|
24
|
+
patchCatalog((current) => (current.pageKey === pageKey ? current : { ...current, pageKey }));
|
|
25
|
+
}
|
|
26
|
+
/** The Site's own Pages of one Area, as the server answered them; the Area's catalog counts as read. */
|
|
27
|
+
export function storePhiWorkspacePersistedPages(area, pages) {
|
|
28
|
+
patchCatalog((current) => ({
|
|
29
|
+
...current,
|
|
30
|
+
persistedPageCatalogByArea: { ...current.persistedPageCatalogByArea, [area]: pages },
|
|
31
|
+
pageCatalogHydratedByArea: { ...current.pageCatalogHydratedByArea, [area]: true },
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
/** A Page created in the Builder and not saved yet. */
|
|
35
|
+
export function addPhiWorkspaceCustomPage(area, page) {
|
|
36
|
+
patchCatalog((current) => ({
|
|
37
|
+
...current,
|
|
38
|
+
customPages: { ...current.customPages, [area]: [...(current.customPages[area] ?? []), page] },
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
/** A navigation created in the Builder, added to the surfaces of its Area. */
|
|
42
|
+
export function addPhiWorkspaceNavigationSurface(area, surface) {
|
|
43
|
+
patchCatalog((current) => ({
|
|
44
|
+
...current,
|
|
45
|
+
navigationSurfacesByArea: {
|
|
46
|
+
...current.navigationSurfacesByArea,
|
|
47
|
+
[area]: [...(current.navigationSurfacesByArea[area] ?? []), surface],
|
|
48
|
+
},
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
/** The Pages and navigation surfaces the active Modules contribute, when the Module selection changed. */
|
|
52
|
+
export function setPhiWorkspaceActiveCatalogs(catalogs) {
|
|
53
|
+
patchCatalog((current) => (JSON.stringify(current.modulePresetPagesByArea) === JSON.stringify(catalogs.modulePresetPagesByArea) &&
|
|
54
|
+
JSON.stringify(current.navigationSurfacesByArea) === JSON.stringify(catalogs.navigationSurfacesByArea)
|
|
55
|
+
? current
|
|
56
|
+
: { ...current, ...catalogs }));
|
|
57
|
+
}
|
|
58
|
+
/** The Module selection of the named Areas; the other Areas keep theirs. */
|
|
59
|
+
export function setPhiWorkspaceModuleSelection(moduleIdsByArea) {
|
|
60
|
+
patchCatalog((current) => ({
|
|
61
|
+
...current,
|
|
62
|
+
runtimeModuleIdsByArea: { ...(current.runtimeModuleIdsByArea ?? {}), ...moduleIdsByArea },
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The Public addresses one Module's Pages take, as the collision dialog answered them. The Module's
|
|
67
|
+
* other assignments, and every other Module's, stay.
|
|
68
|
+
*/
|
|
69
|
+
export function assignPhiWorkspacePublicRoutePaths(moduleId, answers) {
|
|
70
|
+
patchCatalog((current) => {
|
|
71
|
+
const kept = (current.publicRoutePaths ?? []).filter((assignment) => assignment.ownerModuleId !== moduleId || !answers.has(assignment.presetKey));
|
|
72
|
+
return {
|
|
73
|
+
...current,
|
|
74
|
+
publicRoutePaths: normalizePhiAreaPublicRoutePaths([
|
|
75
|
+
...kept,
|
|
76
|
+
...[...answers.entries()].map(([presetKey, path]) => ({ ownerModuleId: moduleId, presetKey, path })),
|
|
77
|
+
]),
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/** Catalog fields an undo or redo puts back (`splitWorkspacePatch`). */
|
|
82
|
+
export function restorePhiWorkspaceCatalog(fields) {
|
|
83
|
+
if (Object.keys(fields).length === 0)
|
|
84
|
+
return;
|
|
85
|
+
patchCatalog((current) => ({ ...current, ...fields }));
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Feeds the server's preload into the catalog, and answers the Page it opened when none was open yet --
|
|
89
|
+
* the caller selects that Page in the Builder. Nothing else is written from inside the update, so the
|
|
90
|
+
* Builder's own store is never patched from within the catalog's.
|
|
91
|
+
*/
|
|
92
|
+
export function applyPhiWorkspaceCatalogPreload(preload) {
|
|
93
|
+
let openedPageKey = null;
|
|
94
|
+
patchCatalog((current) => {
|
|
95
|
+
let changed = false;
|
|
96
|
+
const definitionsChanged = JSON.stringify(current.runtimeModuleDefinitions ?? []) !== preload.keys.runtimeModuleDefinitions;
|
|
97
|
+
const modulePresetPagesChanged = JSON.stringify(current.modulePresetPagesByArea) !== preload.keys.modulePresetPagesByArea;
|
|
98
|
+
const areaPresetSourcesChanged = JSON.stringify(current.areaPresetSourcesByArea) !== preload.keys.areaPresetSourcesByArea;
|
|
99
|
+
const navigationSurfacesChanged = JSON.stringify(current.navigationSurfacesByArea) !== preload.keys.navigationSurfacesByArea;
|
|
100
|
+
const unresolvedModuleIdsChanged = JSON.stringify(current.unresolvedModuleIdsByArea) !== preload.keys.unresolvedModuleIdsByArea;
|
|
101
|
+
const publicRouteClaimsChanged = JSON.stringify(current.publicRouteClaims) !== preload.keys.publicRouteClaims;
|
|
102
|
+
const serverUnavailableModulesChanged = JSON.stringify(current.serverUnavailableModules) !== preload.keys.serverUnavailableModules;
|
|
103
|
+
/*
|
|
104
|
+
* The assignments arrive with the Modules draft and are edited by the collision dialog, so this
|
|
105
|
+
* follows the same rule as the Module selection beside it: what the server sent replaces what is
|
|
106
|
+
* here when the server's answer changed, and an unsaved answer survives a re-render.
|
|
107
|
+
*/
|
|
108
|
+
const publicRoutePathsChanged = JSON.stringify(current.publicRoutePaths) !== preload.keys.publicRoutePaths;
|
|
109
|
+
const catalogHydrationChanged = !current.catalogHydrated;
|
|
110
|
+
const initialPageKey = current.pageKey ||
|
|
111
|
+
resolvePhiBuilderActivePageKey(null, preload.activeCatalogs.modulePresetPagesByArea[current.area]) || "";
|
|
112
|
+
const initialPageChanged = initialPageKey !== current.pageKey;
|
|
113
|
+
const nextModuleIdsByArea = { ...(current.runtimeModuleIdsByArea ?? {}) };
|
|
114
|
+
for (const [area, moduleIds] of Object.entries(preload.runtimeModuleIdsByArea)) {
|
|
115
|
+
const builderArea = preload.normalizeArea(area);
|
|
116
|
+
if (JSON.stringify(nextModuleIdsByArea[builderArea] ?? []) !== JSON.stringify(moduleIds ?? [])) {
|
|
117
|
+
nextModuleIdsByArea[builderArea] = moduleIds;
|
|
118
|
+
changed = true;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
openedPageKey = initialPageChanged ? initialPageKey : null;
|
|
122
|
+
return changed || definitionsChanged || modulePresetPagesChanged || areaPresetSourcesChanged ||
|
|
123
|
+
navigationSurfacesChanged || unresolvedModuleIdsChanged || serverUnavailableModulesChanged ||
|
|
124
|
+
publicRouteClaimsChanged || publicRoutePathsChanged || catalogHydrationChanged || initialPageChanged
|
|
125
|
+
? {
|
|
126
|
+
...current,
|
|
127
|
+
...(initialPageChanged ? { pageKey: initialPageKey } : {}),
|
|
128
|
+
runtimeModuleDefinitions: [...preload.runtimeModuleDefinitions],
|
|
129
|
+
runtimeModuleIdsByArea: nextModuleIdsByArea,
|
|
130
|
+
catalogHydrated: true,
|
|
131
|
+
modulePresetPagesByArea: preload.activeCatalogs.modulePresetPagesByArea,
|
|
132
|
+
areaPresetSourcesByArea: preload.areaPresetSourcesByArea,
|
|
133
|
+
navigationSurfacesByArea: preload.activeCatalogs.navigationSurfacesByArea,
|
|
134
|
+
unresolvedModuleIdsByArea: preload.unresolvedModuleIdsByArea,
|
|
135
|
+
serverUnavailableModules: preload.serverUnavailableModules,
|
|
136
|
+
publicRouteClaims: preload.publicRouteClaims,
|
|
137
|
+
...(publicRoutePathsChanged ? { publicRoutePaths: preload.publicRoutePaths } : {}),
|
|
138
|
+
}
|
|
139
|
+
: current;
|
|
140
|
+
});
|
|
141
|
+
return openedPageKey;
|
|
142
|
+
}
|
|
@@ -11,7 +11,7 @@ import { PHI_ASSET_RUNTIME_MODULE_ID } from "../asset/ids";
|
|
|
11
11
|
import { PHI_MEDIA_LIBRARY_ITEM_RENDERER_KEY } from "../../../constants/media-library-provider-keys";
|
|
12
12
|
import { PHI_DASHBOARD_CARD_ITEM_RENDERER_KEY } from "../../../constants/dashboard-card-provider-keys";
|
|
13
13
|
import { createPhiRuntimeModuleCalendarAdapterClientManifest } from "../../../components/runtime/runtime-module-calendar-adapter-client-manifest";
|
|
14
|
-
import { PHI_CORE_CALENDAR_ADAPTER_CLIENT_DEFINITIONS } from "../client-calendar-adapters
|
|
14
|
+
import { PHI_CORE_CALENDAR_ADAPTER_CLIENT_DEFINITIONS } from "../core/client-calendar-adapters";
|
|
15
15
|
import { PhiLazyAssetRuntimeControllerClient } from "../asset/client";
|
|
16
16
|
import { createPhiRuntimeModuleUiProviderClientManifest, } from "../../../components/runtime/runtime-module-ui-provider-client-manifest";
|
|
17
17
|
import { PHI_AUTH_RUNTIME_MODULE_ID } from "../auth/ids";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PHI_GREGORY_CALENDAR_ADAPTER_KEY } from "
|
|
2
|
-
import { PHI_CORE_RUNTIME_MODULE_ID } from "./
|
|
1
|
+
import { PHI_GREGORY_CALENDAR_ADAPTER_KEY } from "../../../types/calendar-keys";
|
|
2
|
+
import { PHI_CORE_RUNTIME_MODULE_ID } from "./ids";
|
|
3
3
|
export const PHI_CORE_CALENDAR_ADAPTER_DESCRIPTORS = [{
|
|
4
4
|
key: PHI_GREGORY_CALENDAR_ADAPTER_KEY,
|
|
5
5
|
ownerModuleId: PHI_CORE_RUNTIME_MODULE_ID,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { PHI_GREGORY_CALENDAR_ADAPTER_KEY } from "../../../types/calendar-keys";
|
|
3
|
-
import { PHI_CORE_RUNTIME_MODULE_ID } from "
|
|
3
|
+
import { PHI_CORE_RUNTIME_MODULE_ID } from "./ids";
|
|
4
4
|
export const PHI_CORE_CALENDAR_ADAPTER_CLIENT_DEFINITIONS = [{
|
|
5
5
|
key: PHI_GREGORY_CALENDAR_ADAPTER_KEY,
|
|
6
6
|
ownerModuleId: PHI_CORE_RUNTIME_MODULE_ID,
|
|
@@ -53,7 +53,7 @@ async function loadEntries(kind, { query, signal }) {
|
|
|
53
53
|
}));
|
|
54
54
|
return {
|
|
55
55
|
rows,
|
|
56
|
-
total: readNumber(result?.total)
|
|
56
|
+
total: readNumber(result?.total),
|
|
57
57
|
page: readNumber(result?.page) ?? 1,
|
|
58
58
|
pageSize: readNumber(result?.pageSize) ?? (rows.length || 25),
|
|
59
59
|
/*
|
|
@@ -56,6 +56,7 @@ export declare const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
56
56
|
search: false;
|
|
57
57
|
sorting: "none";
|
|
58
58
|
pagination: "offset";
|
|
59
|
+
total: true;
|
|
59
60
|
filterFields: string[];
|
|
60
61
|
};
|
|
61
62
|
actions: ({
|
|
@@ -115,6 +116,7 @@ export declare const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
115
116
|
search: true;
|
|
116
117
|
sorting: "multiple";
|
|
117
118
|
pagination: "offset";
|
|
119
|
+
total: true;
|
|
118
120
|
};
|
|
119
121
|
}[];
|
|
120
122
|
settingsFields?: undefined;
|
|
@@ -205,6 +207,7 @@ export declare const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
205
207
|
filterFields: string[];
|
|
206
208
|
sorting: "none";
|
|
207
209
|
pagination: "offset";
|
|
210
|
+
total: true;
|
|
208
211
|
facets: string[];
|
|
209
212
|
};
|
|
210
213
|
recordRead: true;
|
|
@@ -35,7 +35,7 @@ export const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
35
35
|
description: "Neutral package-owned baseline for a provider-bound table.",
|
|
36
36
|
rowIdentityPath: "id",
|
|
37
37
|
fields: [{ key: "id", title: "ID", type: "string", required: true }],
|
|
38
|
-
query: { search: true, sorting: "multiple", pagination: "offset" },
|
|
38
|
+
query: { search: true, sorting: "multiple", pagination: "offset", total: true },
|
|
39
39
|
}],
|
|
40
40
|
},
|
|
41
41
|
...PHI_CORE_MESSAGING_DATA_PROVIDER_DESCRIPTORS,
|
|
@@ -121,6 +121,7 @@ export const PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
121
121
|
filterFields: ["status"],
|
|
122
122
|
sorting: "none",
|
|
123
123
|
pagination: "offset",
|
|
124
|
+
total: true,
|
|
124
125
|
facets: ["tags"],
|
|
125
126
|
},
|
|
126
127
|
recordRead: true,
|
|
@@ -67,6 +67,7 @@ export declare const PHI_CORE_RUNTIME_MODULE_DEFINITION: {
|
|
|
67
67
|
search: false;
|
|
68
68
|
sorting: "none";
|
|
69
69
|
pagination: "offset";
|
|
70
|
+
total: true;
|
|
70
71
|
filterFields: string[];
|
|
71
72
|
};
|
|
72
73
|
actions: ({
|
|
@@ -126,6 +127,7 @@ export declare const PHI_CORE_RUNTIME_MODULE_DEFINITION: {
|
|
|
126
127
|
search: true;
|
|
127
128
|
sorting: "multiple";
|
|
128
129
|
pagination: "offset";
|
|
130
|
+
total: true;
|
|
129
131
|
};
|
|
130
132
|
}[];
|
|
131
133
|
settingsFields?: undefined;
|
|
@@ -216,6 +218,7 @@ export declare const PHI_CORE_RUNTIME_MODULE_DEFINITION: {
|
|
|
216
218
|
filterFields: string[];
|
|
217
219
|
sorting: "none";
|
|
218
220
|
pagination: "offset";
|
|
221
|
+
total: true;
|
|
219
222
|
facets: string[];
|
|
220
223
|
};
|
|
221
224
|
recordRead: true;
|
|
@@ -6,7 +6,7 @@ import { PHI_CORE_RUNTIME_DATA_PROVIDER_DESCRIPTORS } from "./data-providers";
|
|
|
6
6
|
import { PHI_CMS_AREA_KEYS } from "../../../constants/cms-areas";
|
|
7
7
|
import { PHI_CORE_FORM_PROVIDER_DESCRIPTORS } from "./form-providers";
|
|
8
8
|
import { PHI_CORE_SERVER_BINDING } from "../../../types/server-capabilities";
|
|
9
|
-
import { PHI_CORE_CALENDAR_ADAPTER_DESCRIPTORS } from "
|
|
9
|
+
import { PHI_CORE_CALENDAR_ADAPTER_DESCRIPTORS } from "./calendar-adapters";
|
|
10
10
|
export const PHI_CORE_RUNTIME_MODULE_DEFINITION = {
|
|
11
11
|
...PHI_CORE_RUNTIME_MODULE_IDENTITY,
|
|
12
12
|
kind: "platform",
|
|
@@ -61,7 +61,7 @@ async function queryThreadTable({ resourceKey, query, signal, }) {
|
|
|
61
61
|
const rows = readPhiTableRows(payload?.rows).map(readThreadRow);
|
|
62
62
|
return {
|
|
63
63
|
rows,
|
|
64
|
-
total: typeof payload?.total === "number" ? payload.total :
|
|
64
|
+
total: typeof payload?.total === "number" ? payload.total : undefined,
|
|
65
65
|
page: typeof payload?.page === "number" ? payload.page : undefined,
|
|
66
66
|
pageSize: typeof payload?.pageSize === "number" ? payload.pageSize : undefined,
|
|
67
67
|
// Unread among everything the listing matches, for a footer beside the total.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PHI_CORE_RUNTIME_DATA_PROVIDER_KEYS } from "../../../constants/core-data-provider-keys";
|
|
2
|
-
import { PHI_CORE_RUNTIME_MODULE_THEMES } from "
|
|
2
|
+
import { PHI_CORE_RUNTIME_MODULE_THEMES } from "./themes";
|
|
3
3
|
import { definePhiRuntimeModuleServerAreaContribution } from "../area-contributions";
|
|
4
4
|
import { PHI_CORE_RUNTIME_MODULE_DEFINITION } from "./definition";
|
|
5
5
|
import { PHI_RUNTIME_MODULE_LAYOUTS as PHI_CORE_LAYOUTS } from "./layouts";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare const PHI_CORE_RUNTIME_MODULE_THEMES: {
|
|
2
|
+
loadPreset: () => {
|
|
3
|
+
readonly key: "phis";
|
|
4
|
+
readonly version: 1;
|
|
5
|
+
readonly title: "Phis";
|
|
6
|
+
readonly description: "Warm orange brand color with a deep blue text base.";
|
|
7
|
+
readonly palette: {
|
|
8
|
+
readonly seed: {
|
|
9
|
+
readonly colorPrimary: "#E05A2A";
|
|
10
|
+
readonly colorInfo: "#7088BA";
|
|
11
|
+
readonly colorSuccess: "#4D8F6B";
|
|
12
|
+
readonly colorWarning: "#D99A2B";
|
|
13
|
+
readonly colorError: "#C94A3A";
|
|
14
|
+
readonly colorLink: "#7088BA";
|
|
15
|
+
};
|
|
16
|
+
readonly modes: {
|
|
17
|
+
readonly light: {
|
|
18
|
+
readonly seed: {
|
|
19
|
+
readonly colorTextBase: "#223A61";
|
|
20
|
+
readonly colorBgBase: "#ffffff";
|
|
21
|
+
};
|
|
22
|
+
readonly overrides: {
|
|
23
|
+
readonly colorFillQuaternary: "rgba(34, 58, 97, 0.03)";
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly dark: {
|
|
27
|
+
readonly seed: {
|
|
28
|
+
readonly colorTextBase: "#DCE7F8";
|
|
29
|
+
readonly colorBgBase: "#050914";
|
|
30
|
+
};
|
|
31
|
+
readonly overrides: {
|
|
32
|
+
readonly colorFillQuaternary: "rgba(220, 231, 248, 0.06)";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
description?: "Warm orange brand color with a deep blue text base." | undefined;
|
|
39
|
+
ownerModuleId: "@phis/ui/modules/core";
|
|
40
|
+
presetKey: string;
|
|
41
|
+
presetVersion: number;
|
|
42
|
+
themeKey: "phis";
|
|
43
|
+
title: "Phis";
|
|
44
|
+
}[];
|