@phis/ui 0.4.2 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-anchor-nav-control.js +4 -1
- package/components/controls/phi-background-control.js +21 -6
- package/components/controls/phi-bullet-list-control.d.ts +7 -2
- package/components/controls/phi-bullet-list-control.js +35 -5
- package/components/controls/phi-color-control.js +4 -2
- package/components/controls/phi-drawer-control-adapter.js +3 -2
- package/components/controls/phi-inline-text-editor.js +7 -1
- package/components/controls/phi-length-control.js +1 -1
- package/components/controls/phi-ribbon-control.d.ts +38 -0
- package/components/controls/phi-ribbon-control.js +57 -0
- package/components/controls/phi-ribbon-wrap-control.d.ts +26 -0
- package/components/controls/phi-ribbon-wrap-control.js +25 -0
- package/components/controls/phi-select-control.js +5 -2
- package/components/controls/phi-series-chart-control.d.ts +48 -0
- package/components/controls/phi-series-chart-control.js +82 -0
- package/components/controls/phi-table-control.d.ts +3 -0
- package/components/controls/phi-table-control.js +13 -1
- package/components/controls/phi-text-control.js +57 -3
- package/components/controls/phi-tree-control.js +4 -4
- package/components/controls/phi-truncated-hover-text.d.ts +15 -0
- package/components/controls/phi-truncated-hover-text.js +25 -0
- package/components/forms/link-target-form-control.d.ts +1 -1
- package/components/forms/link-target-form-control.js +2 -45
- package/components/forms/phi-form-widget-frame.js +4 -2
- package/components/forms/shared-form-provider-registry.js +1 -4
- package/components/layouts/clients/phi-three-column-layout-client.js +10 -1
- 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/navigation/phi-link.js +6 -1
- package/components/overlays/phi-overlay-container-client.js +16 -1
- package/components/regions/clients/cms-region-container-client.js +6 -1
- package/components/regions/phi-cms-region-container.js +3 -0
- package/components/regions/phi-cms-region-shell.d.ts +12 -1
- package/components/regions/phi-cms-region-shell.js +81 -19
- package/components/regions/presets/phi-settings-page-shell-tree.js +48 -1
- package/components/root/phi-config-provider.d.ts +13 -0
- package/components/root/phi-config-provider.js +12 -1
- package/components/root/phi-root-background.d.ts +7 -0
- package/components/root/phi-root-background.js +20 -1
- package/components/root/phi-root-theme-resolver.js +3 -0
- package/components/root/phi-shell-chrome-overlay.d.ts +12 -1
- package/components/root/phi-shell-chrome-overlay.js +19 -3
- package/components/runtime/runtime-controller-materialization.js +12 -1
- package/components/shell/phi-antd-icon.d.ts +1 -0
- package/components/shell/phi-antd-icon.js +3 -0
- package/components/shell/use-phi-shell-sticky-top.js +61 -16
- package/components/state/scoped-state-store.js +20 -3
- package/components/surface/phi-surface-tone.d.ts +13 -0
- package/components/surface/phi-surface-tone.js +21 -0
- 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 +109 -0
- package/components/widgets/client/html-editor.js +1 -1
- package/components/widgets/client/shared/use-page-reference-options.d.ts +17 -0
- package/components/widgets/client/shared/use-page-reference-options.js +57 -0
- package/components/widgets/config/background.d.ts +32 -1
- package/components/widgets/config/background.js +41 -2
- 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/background.js +2 -0
- package/components/widgets/label-sets/effects.js +2 -0
- package/components/widgets/label-types/background.d.ts +1 -0
- package/components/widgets/label-types/background.js +1 -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 +27 -1
- package/components/widgets/shared/bullet-list-vocabulary.js +24 -4
- package/components/widgets/shared/card-body-client.d.ts +18 -4
- package/components/widgets/shared/card-body-client.js +126 -26
- package/components/widgets/shared/card-vocabulary.d.ts +31 -4
- package/components/widgets/shared/card-vocabulary.js +35 -2
- package/components/widgets/shared/markdown-body-client.js +39 -10
- 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/cms-container-chrome.js +6 -1
- package/helpers/locale.d.ts +8 -0
- package/helpers/locale.js +18 -0
- package/helpers/renderable-block-serialization.js +1 -1
- package/helpers/shell-region-style.js +2 -1
- package/helpers/surface-style.d.ts +12 -1
- package/helpers/surface-style.js +28 -2
- package/module-dashboard-cards.d.ts +1 -1
- package/module-dashboard-cards.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/area-definitions.d.ts +0 -42
- package/plugins/runtime-modules/area-definitions.js +3 -8
- 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 +25 -35
- 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/layout-scaffold-overlays.js +10 -5
- 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 +4 -3
- 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 +28 -18
- 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 +17 -10
- package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +27 -22
- 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-authoring-module.d.ts +8 -1
- package/plugins/runtime-modules/client-authoring-module.js +13 -3
- 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/brand/client.d.ts +12 -3
- package/plugins/runtime-modules/core/widgets/brand/client.js +3 -11
- package/plugins/runtime-modules/core/widgets/brand/home.d.ts +15 -0
- package/plugins/runtime-modules/core/widgets/brand/home.js +18 -0
- package/plugins/runtime-modules/core/widgets/brand/plugin.js +3 -2
- package/plugins/runtime-modules/core/widgets/brand/server.d.ts +2 -2
- package/plugins/runtime-modules/core/widgets/brand/server.js +2 -2
- package/plugins/runtime-modules/core/widgets/card/collection-view-binding.js +25 -9
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +301 -254
- package/plugins/runtime-modules/core/widgets/card/config.js +68 -3
- package/plugins/runtime-modules/core/widgets/card/editor.js +41 -4
- package/plugins/runtime-modules/core/widgets/card/server.d.ts +3 -0
- package/plugins/runtime-modules/core/widgets/card/server.js +32 -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/client.js +3 -3
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +2 -25
- package/plugins/runtime-modules/core/widgets/description/editor.js +7 -63
- package/plugins/runtime-modules/core/widgets/description/server.js +3 -2
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +2 -25
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +2 -25
- package/plugins/runtime-modules/core/widgets/header-navigation/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/html/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/image/config.js +2 -2
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +320 -2
- package/plugins/runtime-modules/core/widgets/markdown/config.js +18 -4
- package/plugins/runtime-modules/core/widgets/markdown/editor.js +11 -4
- package/plugins/runtime-modules/core/widgets/markdown-toc/client.js +6 -1
- package/plugins/runtime-modules/core/widgets/markdown-toc/config.d.ts +14 -0
- package/plugins/runtime-modules/core/widgets/markdown-toc/config.js +14 -2
- package/plugins/runtime-modules/core/widgets/quick-links/authoring.js +7 -2
- package/plugins/runtime-modules/core/widgets/quick-links/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/quick-links/items.d.ts +0 -2
- package/plugins/runtime-modules/core/widgets/quick-links/items.js +0 -15
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +5 -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/sidebar-navigation/authoring.js +1 -1
- package/plugins/runtime-modules/core/widgets/sidebar-navigation/client.js +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/client.js +8 -3
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +2 -25
- package/plugins/runtime-modules/core/widgets/simple-text/editor.js +2 -2
- 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 +6 -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 +7 -0
- package/plugins/runtime-modules/dashboard/card-rows.js +87 -0
- package/plugins/runtime-modules/dashboard/clients/dashboard-card-view.js +32 -12
- package/plugins/runtime-modules/dashboard/services/collection.js +17 -7
- package/plugins/runtime-modules/dashboard/trees/phi-default-builder-dashboard-page-tree.js +5 -40
- 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 +111 -72
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +2 -1
- package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +28 -31
- 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/server-helpers/cms-link-targets.js +6 -0
- package/styles/control-shape.css +11 -11
- package/styles/controls.css +67 -5
- package/styles/layout.css +61 -9
- package/styles/shell.css +73 -0
- package/theme/phi-antd-token-resolver.js +20 -1
- package/theme/phi-theme-tokens.d.ts +1 -1
- package/theme/phi-theme-tokens.js +1 -0
- package/theme/phi-theme.d.ts +5 -0
- package/theme/phi-theme.js +21 -0
- package/theme/phi-tokens.d.ts +16 -15
- package/theme/phi-tokens.js +16 -15
- package/types/cms-config.js +142 -185
- package/types/cms-plugins.d.ts +6 -11
- package/types/core-widget-placements.d.ts +14 -3
- package/types/dashboard-cards.d.ts +48 -4
- package/types/dashboard-cards.js +6 -0
- package/types/media.d.ts +0 -3
- package/types/renderable-block.d.ts +6 -1
- package/types/site-theme.d.ts +10 -2
- 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
|
@@ -12,15 +12,14 @@ import { deleteCmsDraft } from "../../../../helpers/cms-draft-delete";
|
|
|
12
12
|
import { buildPhiBuilderLiveHref, clearPhiDeveloperBuilderDraftAllocation, createPhiDeveloperBuilderInitialPageDrafts, getPhiDeveloperBuilderModulesDraftAllocation, savePhiDeveloperBuilderModulesDraft, publishPhiDeveloperBuilderModulesDraft, previewPhiDeveloperBuilderDraft, publishPhiDeveloperBuilderDraft, savePhiDeveloperBuilderDraft, } from "../persistence";
|
|
13
13
|
import { clearPhiBuilderNavigationDraft, getPhiBuilderNavigationDraftSnapshot, updatePhiBuilderNavigationDraft, restorePhiBuilderNavigationDraft, setPhiBuilderNavigationDraft, } from "../navigation-store";
|
|
14
14
|
import { deletePhiBuilderNavigationDraft, loadPhiBuilderNavigationDraft, loadPhiBuilderNavigationScope, publishPhiBuilderNavigationDraft, savePhiBuilderNavigationDraft, } from "../navigation-persistence";
|
|
15
|
-
import {
|
|
15
|
+
import { clearPhiBuilderModuleAreasDirty, getPhiDeveloperRegionDraftsSnapshot, markPhiBuilderPageDeleted, restorePhiBuilderWorkspaceState, mergePhiDeveloperRegionDrafts, restorePhiDeveloperBuilderAreaMeta, restorePhiDeveloperRegionDrafts, setPhiDeveloperBuilderAreaRootRoute, } from "../developer-workspace-store";
|
|
16
16
|
import { findPhiBuilderNavigationSurface } from "../../../../helpers/cms-navigation-catalog";
|
|
17
17
|
import { createPhiBuilderHistoryContext, phiBuilderHistory, } from "../history";
|
|
18
18
|
import { usePhiBuilderModuleMetas } from "../plugin-meta-store";
|
|
19
|
-
import {
|
|
20
|
-
import { phiWorkspaceCatalogStore } from "../../../../components/workspace/catalog-store";
|
|
19
|
+
import { setPhiWorkspaceModuleSelection } from "../workspace-catalog-actions";
|
|
21
20
|
import { applyPhiBuilderNavigationFolderTargets, refreshPhiBuilderNavigationFolderAddresses, } from "../navigation-folder-address";
|
|
22
21
|
import { createPhiBuilderNavigationPathContext } from "../navigation-path-context";
|
|
23
|
-
export function usePhiBuilderDraftCommandController({
|
|
22
|
+
export function usePhiBuilderDraftCommandController({ effectiveArea, effectiveNavKey, effectivePageKey, pathname, captureHistoryHead, reportSaved, hasUnsavedChanges, shellPresetDraftsByArea, state, historyLabels, }) {
|
|
24
23
|
/*
|
|
25
24
|
* Every one of these is a command from a toolbar somewhere else, so there is nothing on screen to
|
|
26
25
|
* hang a Popconfirm on. Drawn as a Dialog by this Controller rather than asked of Ant Design's
|
|
@@ -212,7 +211,7 @@ export function usePhiBuilderDraftCommandController({ defaultArea, effectiveArea
|
|
|
212
211
|
scope: { area },
|
|
213
212
|
});
|
|
214
213
|
}
|
|
215
|
-
clearPhiBuilderModuleAreasDirty(
|
|
214
|
+
clearPhiBuilderModuleAreasDirty();
|
|
216
215
|
reportSaved("published", null, savedAt);
|
|
217
216
|
showMessage({
|
|
218
217
|
level: "success",
|
|
@@ -387,13 +386,7 @@ export function usePhiBuilderDraftCommandController({ defaultArea, effectiveArea
|
|
|
387
386
|
});
|
|
388
387
|
const pageDeleteDraftKey = getPhiBuilderRegionDraftKey(effectiveArea, "page_delete", effectivePageKey);
|
|
389
388
|
mergePhiDeveloperRegionDrafts(nextDrafts);
|
|
390
|
-
|
|
391
|
-
...current,
|
|
392
|
-
deletedPageDrafts: {
|
|
393
|
-
...current.deletedPageDrafts,
|
|
394
|
-
[pageDeleteDraftKey]: true,
|
|
395
|
-
},
|
|
396
|
-
}));
|
|
389
|
+
markPhiBuilderPageDeleted(pageDeleteDraftKey);
|
|
397
390
|
const result = await savePhiDeveloperBuilderDraft({
|
|
398
391
|
...state,
|
|
399
392
|
deletedPageDrafts: {
|
|
@@ -524,30 +517,18 @@ export function usePhiBuilderDraftCommandController({ defaultArea, effectiveArea
|
|
|
524
517
|
return;
|
|
525
518
|
}
|
|
526
519
|
if (snapshot.kind === "modules") {
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
...Object.fromEntries(Object.entries(snapshot.moduleIdsByArea).map(([area, moduleIds]) => [
|
|
533
|
-
area,
|
|
534
|
-
moduleIds ? [...moduleIds] : createPhiDefaultAreaRuntimeModuleIds(area),
|
|
535
|
-
])),
|
|
536
|
-
},
|
|
537
|
-
}));
|
|
520
|
+
setPhiWorkspaceModuleSelection(Object.fromEntries(Object.entries(snapshot.moduleIdsByArea).map(([area, moduleIds]) => [
|
|
521
|
+
area,
|
|
522
|
+
// `null` recorded "no selection stored", which resolves to the Area's default set.
|
|
523
|
+
moduleIds ? [...moduleIds] : createPhiDefaultAreaRuntimeModuleIds(area),
|
|
524
|
+
])));
|
|
538
525
|
return;
|
|
539
526
|
}
|
|
540
527
|
/*
|
|
541
528
|
* A workspace snapshot spans both halves -- customPages belongs to the catalog, the page drafts
|
|
542
529
|
* to the Builder -- so undo has to put each back where it lives.
|
|
543
530
|
*/
|
|
544
|
-
|
|
545
|
-
if (Object.keys(catalog).length > 0) {
|
|
546
|
-
phiWorkspaceCatalogStore.patch(defaultArea, (current) => ({ ...current, ...catalog }));
|
|
547
|
-
}
|
|
548
|
-
if (Object.keys(tool).length > 0) {
|
|
549
|
-
builderWorkspaceStore.patch(defaultArea, (current) => ({ ...current, ...tool }));
|
|
550
|
-
}
|
|
531
|
+
restorePhiBuilderWorkspaceState(snapshot.state);
|
|
551
532
|
};
|
|
552
533
|
/*
|
|
553
534
|
* An undo says what it took back. The canvas changes in place, and a step that moved a node out of
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useCallback, useEffect, useState } from "react";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { PHI_SIGNAL_VALUE_SCHEMAS } from "../../../../types/signals";
|
|
4
4
|
import { usePhiSignalDispatcher, usePhiSignalListener } from "../../../../components/runtime/runtime-signal-bus";
|
|
5
5
|
import { resolvePhiBuilderCmsStoragePath } from "../../../../helpers/cms-paths";
|
|
@@ -82,6 +82,13 @@ export function usePhiBuilderDraftStatusController({ commandWorkspace, effective
|
|
|
82
82
|
const subject = target?.subject ?? null;
|
|
83
83
|
const historyContext = target?.historyContext ?? null;
|
|
84
84
|
const [stored, setStored] = useState(null);
|
|
85
|
+
/*
|
|
86
|
+
* The history head each target was last saved or first read at. The status is read again whenever the
|
|
87
|
+
* target changes -- an Area switched away from and back -- and taking the head at that moment called
|
|
88
|
+
* every edit made before it saved: back on an Area with an unsaved edit, the badge said "Published".
|
|
89
|
+
* A target keeps the head it was read or saved at until it is saved again.
|
|
90
|
+
*/
|
|
91
|
+
const savedHeadsRef = useRef(new Map());
|
|
85
92
|
const historyHead = phiBuilderHistory.useHead(historyContext ?? PHI_BUILDER_NO_DRAFT_HISTORY_CONTEXT);
|
|
86
93
|
useEffect(() => {
|
|
87
94
|
if (targetUrl === null) {
|
|
@@ -95,7 +102,12 @@ export function usePhiBuilderDraftStatusController({ commandWorkspace, effective
|
|
|
95
102
|
setStored({
|
|
96
103
|
requestKey: targetUrl,
|
|
97
104
|
...next,
|
|
98
|
-
savedHead:
|
|
105
|
+
savedHead: (() => {
|
|
106
|
+
if (!savedHeadsRef.current.has(targetUrl)) {
|
|
107
|
+
savedHeadsRef.current.set(targetUrl, historyContext === null ? null : phiBuilderHistory.getHead(historyContext));
|
|
108
|
+
}
|
|
109
|
+
return savedHeadsRef.current.get(targetUrl);
|
|
110
|
+
})(),
|
|
99
111
|
});
|
|
100
112
|
};
|
|
101
113
|
void fetch(targetUrl, { method: "GET", cache: "no-store" })
|
|
@@ -177,6 +189,7 @@ export function usePhiBuilderDraftStatusController({ commandWorkspace, effective
|
|
|
177
189
|
if (targetUrl === null) {
|
|
178
190
|
return;
|
|
179
191
|
}
|
|
192
|
+
savedHeadsRef.current.set(targetUrl, savedAt.head);
|
|
180
193
|
setStored({
|
|
181
194
|
requestKey: targetUrl,
|
|
182
195
|
status,
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
import type { PhiBuilderInspectorAction } from "../inspector-actions";
|
|
2
|
-
|
|
3
|
-
export declare function runPhiDeveloperBuilderInspectorAction(defaultArea: PhiDeveloperBuilderArea, action: PhiBuilderInspectorAction): void;
|
|
2
|
+
export declare function runPhiDeveloperBuilderInspectorAction(action: PhiBuilderInspectorAction): void;
|
|
@@ -5,7 +5,7 @@ import { findPhiBuilderTreeNode, writePhiBuilderNode } from "../node-config-writ
|
|
|
5
5
|
import { getDefaultRegionDraft, resolveRegionDraftKey, } from "../developer-region-drafts";
|
|
6
6
|
import { getPhiBuilderRegionDraftKey, isPhiBuilderPageScopedRegion, } from "../region-keys";
|
|
7
7
|
import { createPhiBuilderRegionHistoryContext } from "../history";
|
|
8
|
-
import {
|
|
8
|
+
import { setPhiBuilderSelectedLayoutAnchor, getPhiDeveloperRegionDraftsSnapshot, setPhiDeveloperRegionDraft, getPhiDeveloperBuilderStateSnapshot, } from "../developer-workspace-store";
|
|
9
9
|
function resolveWidgetSizeFromGeometry(geometry) {
|
|
10
10
|
return {
|
|
11
11
|
size: geometry.size ?? undefined,
|
|
@@ -85,8 +85,8 @@ function readRecordPatch(value) {
|
|
|
85
85
|
? value
|
|
86
86
|
: null;
|
|
87
87
|
}
|
|
88
|
-
export function runPhiDeveloperBuilderInspectorAction(
|
|
89
|
-
const state = getPhiDeveloperBuilderStateSnapshot(
|
|
88
|
+
export function runPhiDeveloperBuilderInspectorAction(action) {
|
|
89
|
+
const state = getPhiDeveloperBuilderStateSnapshot();
|
|
90
90
|
if (action.kind === "patchSelectedRegionDraft") {
|
|
91
91
|
const patch = readRecordPatch(action.patch);
|
|
92
92
|
const selectedRegionKey = state.nodeKind === "region" ? state.nodeKey.replace(/^region:/, "") : null;
|
|
@@ -161,10 +161,7 @@ export function runPhiDeveloperBuilderInspectorAction(defaultArea, action) {
|
|
|
161
161
|
return;
|
|
162
162
|
}
|
|
163
163
|
patchSelectedStructureDraftConfig(state, "anchor", (config) => ({ ...config, anchor: selectedLayoutAnchor }));
|
|
164
|
-
|
|
165
|
-
...current,
|
|
166
|
-
selectedLayoutAnchor: selectedLayoutAnchor,
|
|
167
|
-
}));
|
|
164
|
+
setPhiBuilderSelectedLayoutAnchor(selectedLayoutAnchor);
|
|
168
165
|
return;
|
|
169
166
|
}
|
|
170
167
|
if (action.kind === "patchSelectedLayoutPadding") {
|
|
@@ -3,10 +3,9 @@ import { type PhiSignalValue } from "../../../../types/signals";
|
|
|
3
3
|
import type { PhiBuilderPageMetaPresentationLabels } from "../controller/definition";
|
|
4
4
|
type PhiBuilderPageControllerState = Pick<PhiDeveloperBuilderWorkspaceState, "customPages" | "modulePresetPagesByArea" | "pageMetaDrafts" | "persistedPageCatalogByArea">;
|
|
5
5
|
type PhiPageMetaDialogMode = "create" | "update";
|
|
6
|
-
export declare function usePhiBuilderPageController({ emitCapability,
|
|
6
|
+
export declare function usePhiBuilderPageController({ emitCapability, effectiveArea, effectivePageKey, pageMetaLabels, state, }: {
|
|
7
7
|
/** The Builder Controller's own output: the Page metadata dialog is routed by the Pages Page. */
|
|
8
8
|
emitCapability: (capabilityId: string, value: PhiSignalValue, correlationId?: string | null) => void;
|
|
9
|
-
defaultArea: PhiDeveloperBuilderArea;
|
|
10
9
|
effectiveArea: PhiDeveloperBuilderArea;
|
|
11
10
|
effectivePageKey: string;
|
|
12
11
|
pageMetaLabels: PhiBuilderPageMetaPresentationLabels;
|
|
@@ -13,16 +13,16 @@ import { collectPhiDeveloperBuilderPageKeys, collectPhiDeveloperBuilderPageStora
|
|
|
13
13
|
import { createPhiDeveloperBuilderInitialPageDrafts, createPhiDeveloperBuilderPageDraft, PhiBuilderPageExistsError, } from "../persistence";
|
|
14
14
|
import { describePhiBuilderPageAddressConflict, findPhiBuilderSitePageAddressConflict, } from "../page-address-rule";
|
|
15
15
|
import { PHI_BUILDER_AREA_SEARCH_PARAM, PHI_BUILDER_PAGE_SEARCH_PARAM, } from "../../../../helpers/cms-scope-search-params";
|
|
16
|
-
import {
|
|
16
|
+
import { mergePhiDeveloperRegionDrafts, openPhiBuilderPage, setPhiBuilderPageMetaDraft, startPhiBuilderNewPageDrafts, getPhiDeveloperBuilderStateSnapshot, } from "../developer-workspace-store";
|
|
17
17
|
import { getPhiBuilderRegionDraftKey } from "../region-keys";
|
|
18
18
|
import { capturePhiBuilderWorkspaceHistoryState, createPhiBuilderHistoryContext, phiBuilderHistory, } from "../history";
|
|
19
19
|
import { createPhiBuilderControllerAddress } from "../controller/address";
|
|
20
20
|
import { PHI_SIGNAL_VALUE_SCHEMAS } from "../../../../types/signals";
|
|
21
21
|
import { readPhiRuntimeFormValuesSignalValue } from "../../../../components/forms/runtime-form-state";
|
|
22
22
|
import { emitPhiPageTitleInputSignal } from "../page-title-signal";
|
|
23
|
-
import {
|
|
23
|
+
import { addPhiWorkspaceCustomPage, storePhiWorkspacePersistedPages, } from "../workspace-catalog-actions";
|
|
24
24
|
import { usePhiPathname } from "../../../../components/runtime/use-phi-pathname";
|
|
25
|
-
export function usePhiBuilderPageController({ emitCapability,
|
|
25
|
+
export function usePhiBuilderPageController({ emitCapability, effectiveArea, effectivePageKey, pageMetaLabels, state, }) {
|
|
26
26
|
const { showMessage } = usePhiApplicationFeedback();
|
|
27
27
|
const router = useRouter();
|
|
28
28
|
const pathname = usePhiPathname();
|
|
@@ -59,25 +59,10 @@ export function usePhiBuilderPageController({ emitCapability, defaultArea, effec
|
|
|
59
59
|
}, [effectiveArea, emitSignal, resolvePageTitleForInput]);
|
|
60
60
|
async function reloadPersistedPageCatalog(area) {
|
|
61
61
|
const pages = await loadPhiBuilderPersistedPageCatalog(area, { refresh: true });
|
|
62
|
-
|
|
63
|
-
...current,
|
|
64
|
-
persistedPageCatalogByArea: {
|
|
65
|
-
...current.persistedPageCatalogByArea,
|
|
66
|
-
[area]: pages,
|
|
67
|
-
},
|
|
68
|
-
pageCatalogHydratedByArea: {
|
|
69
|
-
...current.pageCatalogHydratedByArea,
|
|
70
|
-
[area]: true,
|
|
71
|
-
},
|
|
72
|
-
}));
|
|
62
|
+
storePhiWorkspacePersistedPages(area, pages);
|
|
73
63
|
}
|
|
74
64
|
function navigateToBuilderPage(pageKey) {
|
|
75
|
-
|
|
76
|
-
...current,
|
|
77
|
-
area: effectiveArea,
|
|
78
|
-
pageKey,
|
|
79
|
-
}));
|
|
80
|
-
builderWorkspaceStore.patch(defaultArea, (current) => resetPhiBuilderSelectionToPage(current, pageKey, { closePages: true }));
|
|
65
|
+
openPhiBuilderPage(effectiveArea, pageKey, { closePages: true });
|
|
81
66
|
if (typeof pathname === "string") {
|
|
82
67
|
const nextSearchParams = new URLSearchParams(searchParams.toString());
|
|
83
68
|
nextSearchParams.set(PHI_BUILDER_AREA_SEARCH_PARAM, effectiveArea);
|
|
@@ -180,22 +165,8 @@ export function usePhiBuilderPageController({ emitCapability, defaultArea, effec
|
|
|
180
165
|
})
|
|
181
166
|
: null;
|
|
182
167
|
const pageMetaDraftKey = getPhiBuilderRegionDraftKey(effectiveArea, "page_meta", effectivePageKey);
|
|
183
|
-
const historyBefore = capturePhiBuilderWorkspaceHistoryState(getPhiDeveloperBuilderStateSnapshot(
|
|
184
|
-
|
|
185
|
-
const current = builderWorkspaceStore.getSnapshot(defaultArea);
|
|
186
|
-
const next = {
|
|
187
|
-
...current,
|
|
188
|
-
pageMetaDrafts: {
|
|
189
|
-
...current.pageMetaDrafts,
|
|
190
|
-
[pageMetaDraftKey]: {
|
|
191
|
-
...(current.pageMetaDrafts[pageMetaDraftKey] ?? {}),
|
|
192
|
-
title: editedTitle,
|
|
193
|
-
description,
|
|
194
|
-
...indexPatch,
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
};
|
|
198
|
-
builderWorkspaceStore.replace(defaultArea, next);
|
|
168
|
+
const historyBefore = capturePhiBuilderWorkspaceHistoryState(getPhiDeveloperBuilderStateSnapshot());
|
|
169
|
+
setPhiBuilderPageMetaDraft(pageMetaDraftKey, { title: editedTitle, description, ...indexPatch });
|
|
199
170
|
phiBuilderHistory.record(createPhiBuilderHistoryContext({
|
|
200
171
|
workspace: "pages",
|
|
201
172
|
area: effectiveArea,
|
|
@@ -208,13 +179,13 @@ export function usePhiBuilderPageController({ emitCapability, defaultArea, effec
|
|
|
208
179
|
},
|
|
209
180
|
after: {
|
|
210
181
|
kind: "workspace",
|
|
211
|
-
state: capturePhiBuilderWorkspaceHistoryState(getPhiDeveloperBuilderStateSnapshot(
|
|
182
|
+
state: capturePhiBuilderWorkspaceHistoryState(getPhiDeveloperBuilderStateSnapshot()),
|
|
212
183
|
},
|
|
213
184
|
});
|
|
214
185
|
emitPageTitleInputValue(effectivePageKey, editedTitle);
|
|
215
186
|
if (pathResult) {
|
|
216
187
|
await reloadPersistedPageCatalog(effectiveArea);
|
|
217
|
-
const refreshed = getPhiDeveloperBuilderStateSnapshot(
|
|
188
|
+
const refreshed = getPhiDeveloperBuilderStateSnapshot();
|
|
218
189
|
const refreshedPages = resolvePhiBuilderActivePageCatalog(effectiveArea, refreshed.modulePresetPagesByArea, refreshed.customPages, refreshed.persistedPageCatalogByArea);
|
|
219
190
|
const nextPageKey = resolvePhiBuilderPageKeyFromCatalogPath(effectiveArea, pathResult.path, refreshedPages);
|
|
220
191
|
if (nextPageKey)
|
|
@@ -275,36 +246,13 @@ export function usePhiBuilderPageController({ emitCapability, defaultArea, effec
|
|
|
275
246
|
pathname,
|
|
276
247
|
});
|
|
277
248
|
mergePhiDeveloperRegionDrafts(nextDrafts);
|
|
278
|
-
|
|
279
|
-
...current,
|
|
280
|
-
customPages: {
|
|
281
|
-
...current.customPages,
|
|
282
|
-
[effectiveArea]: [
|
|
283
|
-
...(current.customPages[effectiveArea] ?? []),
|
|
284
|
-
{
|
|
285
|
-
key: requestedKey,
|
|
286
|
-
title,
|
|
287
|
-
storagePath: requestedStoragePath,
|
|
288
|
-
},
|
|
289
|
-
],
|
|
290
|
-
},
|
|
291
|
-
}));
|
|
249
|
+
addPhiWorkspaceCustomPage(effectiveArea, { key: requestedKey, title, storagePath: requestedStoragePath });
|
|
292
250
|
// The page's meta and delete drafts are edits in progress, so they stay with the Builder.
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
title,
|
|
299
|
-
description,
|
|
300
|
-
...indexPatch,
|
|
301
|
-
},
|
|
302
|
-
},
|
|
303
|
-
deletedPageDrafts: {
|
|
304
|
-
...current.deletedPageDrafts,
|
|
305
|
-
[getPhiBuilderRegionDraftKey(effectiveArea, "page_delete", requestedKey)]: false,
|
|
306
|
-
},
|
|
307
|
-
}));
|
|
251
|
+
startPhiBuilderNewPageDrafts({
|
|
252
|
+
metaDraftKey: getPhiBuilderRegionDraftKey(effectiveArea, "page_meta", requestedKey),
|
|
253
|
+
meta: { title, description, ...indexPatch },
|
|
254
|
+
deleteDraftKey: getPhiBuilderRegionDraftKey(effectiveArea, "page_delete", requestedKey),
|
|
255
|
+
});
|
|
308
256
|
await reloadPersistedPageCatalog(effectiveArea);
|
|
309
257
|
navigateToBuilderPage(requestedKey);
|
|
310
258
|
emitPageTitleInputValue(requestedKey, title);
|
|
@@ -315,7 +263,7 @@ export function usePhiBuilderPageController({ emitCapability, defaultArea, effec
|
|
|
315
263
|
if (error instanceof PhiBuilderPageExistsError && !error.tombstoned) {
|
|
316
264
|
// Somebody created it meanwhile: open that Page rather than failing on the path it holds.
|
|
317
265
|
await reloadPersistedPageCatalog(effectiveArea);
|
|
318
|
-
const refreshed = getPhiDeveloperBuilderStateSnapshot(
|
|
266
|
+
const refreshed = getPhiDeveloperBuilderStateSnapshot();
|
|
319
267
|
const refreshedPages = resolvePhiBuilderActivePageCatalog(effectiveArea, refreshed.modulePresetPagesByArea, refreshed.customPages, refreshed.persistedPageCatalogByArea);
|
|
320
268
|
const existingKey = resolvePhiBuilderPageKeyFromCatalogPath(effectiveArea, error.path, refreshedPages);
|
|
321
269
|
if (existingKey)
|
|
@@ -33,20 +33,10 @@ export declare const PHI_BUILDER_RUNTIME_CONTROLLER_SERVER_DEFINITION: {
|
|
|
33
33
|
allowedMountScopes: "area"[];
|
|
34
34
|
runtimeSignals: {
|
|
35
35
|
emits: ({
|
|
36
|
-
id: string;
|
|
37
|
-
action: "start";
|
|
38
|
-
valueType: "json";
|
|
39
|
-
valueSchema: `${string}/signals/${string}`;
|
|
40
|
-
} | {
|
|
41
36
|
id: string;
|
|
42
37
|
action: "change";
|
|
43
38
|
valueType: "json";
|
|
44
39
|
valueSchema: `${string}/signals/${string}`;
|
|
45
|
-
} | {
|
|
46
|
-
id: string;
|
|
47
|
-
action: "stop";
|
|
48
|
-
valueType: "json";
|
|
49
|
-
valueSchema: `${string}/signals/${string}`;
|
|
50
40
|
} | {
|
|
51
41
|
id: string;
|
|
52
42
|
action: "activate";
|
|
@@ -70,11 +60,6 @@ export declare const PHI_BUILDER_RUNTIME_CONTROLLER_SERVER_DEFINITION: {
|
|
|
70
60
|
action: "change";
|
|
71
61
|
valueType: "boolean";
|
|
72
62
|
valueSchema?: undefined;
|
|
73
|
-
} | {
|
|
74
|
-
id: string;
|
|
75
|
-
action: "drop";
|
|
76
|
-
valueType: "json";
|
|
77
|
-
valueSchema: `${string}/signals/${string}`;
|
|
78
63
|
})[];
|
|
79
64
|
listens: ({
|
|
80
65
|
id: string;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { type PhiSignalRouteSet } from "../../../../types/signals";
|
|
2
|
-
import type { PhiDeveloperBuilderArea } from "../developer-workspace-types";
|
|
3
|
-
export declare function patchPhiBuilderSignalWiringSession(defaultArea: PhiDeveloperBuilderArea, values: Record<string, unknown>): void;
|
|
4
|
-
export declare function resetPhiBuilderSignalWiringSession(defaultArea: PhiDeveloperBuilderArea): void;
|
|
5
2
|
export type PhiBuilderSignalWiringResult = {
|
|
6
3
|
kind: "applied";
|
|
7
4
|
routes: PhiSignalRouteSet;
|
|
@@ -19,7 +16,7 @@ export type PhiBuilderSignalWiringResult = {
|
|
|
19
16
|
* selection change, and a route whose value the receiver cannot read is worse than no route at all --
|
|
20
17
|
* nothing reports it at runtime.
|
|
21
18
|
*/
|
|
22
|
-
export declare function resolvePhiBuilderSignalWiringRoutes(
|
|
19
|
+
export declare function resolvePhiBuilderSignalWiringRoutes(): PhiBuilderSignalWiringResult;
|
|
23
20
|
/**
|
|
24
21
|
* Removes one route from the selected block by its key.
|
|
25
22
|
*
|
|
@@ -27,4 +24,4 @@ export declare function resolvePhiBuilderSignalWiringRoutes(defaultArea: PhiDeve
|
|
|
27
24
|
* so its rows come straight from the draft config rather than from a staged copy. Removing therefore
|
|
28
25
|
* writes to the same place Apply does, and the Table is reloaded afterwards.
|
|
29
26
|
*/
|
|
30
|
-
export declare function resolvePhiBuilderSignalWiringRoutesWithout(
|
|
27
|
+
export declare function resolvePhiBuilderSignalWiringRoutesWithout(routeKey: string): PhiSignalRouteSet | null;
|
|
@@ -1,52 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { createPhiSignalRouteKey, readPhiSignalRouteSet, PHI_SIGNAL_VALUE_SCHEMAS, } from "../../../../types/signals";
|
|
3
|
-
import {
|
|
3
|
+
import { getPhiDeveloperBuilderStateSnapshot } from "../developer-workspace-store";
|
|
4
4
|
import { getPhiDeveloperSelectedSignalRoutes } from "../signal-route-selection";
|
|
5
5
|
import { phiSignalCapabilitiesMatch, resolvePhiBuilderReceiverSignalEndpoints, resolvePhiBuilderSelectedSignalEndpoints, } from "../signal-wiring-options";
|
|
6
|
-
const EMPTY_SESSION = {
|
|
7
|
-
senderAddress: null,
|
|
8
|
-
senderCapabilityId: null,
|
|
9
|
-
receiverAddress: null,
|
|
10
|
-
receiverCapabilityId: null,
|
|
11
|
-
fieldKey: null,
|
|
12
|
-
};
|
|
13
|
-
function readOptionalString(value) {
|
|
14
|
-
return typeof value === "string" && value.trim().length > 0 ? value.trim() : null;
|
|
15
|
-
}
|
|
16
|
-
export function patchPhiBuilderSignalWiringSession(defaultArea, values) {
|
|
17
|
-
builderWorkspaceStore.patch(defaultArea, (current) => {
|
|
18
|
-
const senderAddress = readOptionalString(values.senderAddress) ?? current.signalWiring.senderAddress;
|
|
19
|
-
// A cascade only holds if the values below the one that moved are dropped: keeping a capability that
|
|
20
|
-
// belongs to the previous endpoint would build a route the runtime silently ignores.
|
|
21
|
-
const senderChanged = senderAddress !== current.signalWiring.senderAddress;
|
|
22
|
-
const senderCapabilityId = senderChanged
|
|
23
|
-
? null
|
|
24
|
-
: readOptionalString(values.senderCapabilityId) ?? current.signalWiring.senderCapabilityId;
|
|
25
|
-
const capabilityChanged = senderCapabilityId !== current.signalWiring.senderCapabilityId;
|
|
26
|
-
const receiverAddress = senderChanged || capabilityChanged
|
|
27
|
-
? null
|
|
28
|
-
: readOptionalString(values.receiverAddress) ?? current.signalWiring.receiverAddress;
|
|
29
|
-
const receiverChanged = receiverAddress !== current.signalWiring.receiverAddress;
|
|
30
|
-
return {
|
|
31
|
-
...current,
|
|
32
|
-
signalWiring: {
|
|
33
|
-
senderAddress,
|
|
34
|
-
senderCapabilityId,
|
|
35
|
-
receiverAddress,
|
|
36
|
-
receiverCapabilityId: senderChanged || capabilityChanged || receiverChanged
|
|
37
|
-
? null
|
|
38
|
-
: readOptionalString(values.receiverCapabilityId) ?? current.signalWiring.receiverCapabilityId,
|
|
39
|
-
// The field belongs to the receiver's input, so it falls with everything above it.
|
|
40
|
-
fieldKey: senderChanged || capabilityChanged || receiverChanged
|
|
41
|
-
? null
|
|
42
|
-
: readOptionalString(values.fieldKey) ?? current.signalWiring.fieldKey,
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
export function resetPhiBuilderSignalWiringSession(defaultArea) {
|
|
48
|
-
builderWorkspaceStore.patch(defaultArea, (current) => ({ ...current, signalWiring: { ...EMPTY_SESSION } }));
|
|
49
|
-
}
|
|
50
6
|
function routesAreEquivalent(left, right) {
|
|
51
7
|
return left.capabilityId === right.capabilityId && left.scope === right.scope &&
|
|
52
8
|
left.channel === right.channel && left.action === right.action && left.valueType === right.valueType &&
|
|
@@ -61,8 +17,8 @@ function routesAreEquivalent(left, right) {
|
|
|
61
17
|
* selection change, and a route whose value the receiver cannot read is worse than no route at all --
|
|
62
18
|
* nothing reports it at runtime.
|
|
63
19
|
*/
|
|
64
|
-
export function resolvePhiBuilderSignalWiringRoutes(
|
|
65
|
-
const state = getPhiDeveloperBuilderStateSnapshot(
|
|
20
|
+
export function resolvePhiBuilderSignalWiringRoutes() {
|
|
21
|
+
const state = getPhiDeveloperBuilderStateSnapshot();
|
|
66
22
|
const session = state.signalWiring;
|
|
67
23
|
if (!session.senderAddress || !session.senderCapabilityId || !session.receiverAddress || !session.receiverCapabilityId) {
|
|
68
24
|
return { kind: "incomplete" };
|
|
@@ -95,7 +51,7 @@ export function resolvePhiBuilderSignalWiringRoutes(defaultArea) {
|
|
|
95
51
|
receiver: receiver.address,
|
|
96
52
|
...(wantsFieldKey && session.fieldKey ? { fieldKey: session.fieldKey } : {}),
|
|
97
53
|
};
|
|
98
|
-
const current = getPhiDeveloperSelectedSignalRoutes(
|
|
54
|
+
const current = getPhiDeveloperSelectedSignalRoutes() ?? {};
|
|
99
55
|
if ([...(current.emits ?? []), ...(current.listens ?? [])].some((candidate) => routesAreEquivalent(candidate, route))) {
|
|
100
56
|
return { kind: "duplicate" };
|
|
101
57
|
}
|
|
@@ -112,8 +68,8 @@ export function resolvePhiBuilderSignalWiringRoutes(defaultArea) {
|
|
|
112
68
|
* so its rows come straight from the draft config rather than from a staged copy. Removing therefore
|
|
113
69
|
* writes to the same place Apply does, and the Table is reloaded afterwards.
|
|
114
70
|
*/
|
|
115
|
-
export function resolvePhiBuilderSignalWiringRoutesWithout(
|
|
116
|
-
const current = getPhiDeveloperSelectedSignalRoutes(
|
|
71
|
+
export function resolvePhiBuilderSignalWiringRoutesWithout(routeKey) {
|
|
72
|
+
const current = getPhiDeveloperSelectedSignalRoutes() ?? {};
|
|
117
73
|
const emits = (current.emits ?? []).filter((route) => route.routeKey !== routeKey);
|
|
118
74
|
const listens = (current.listens ?? []).filter((route) => route.routeKey !== routeKey);
|
|
119
75
|
if (emits.length === (current.emits ?? []).length && listens.length === (current.listens ?? []).length) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PhiSignalRouteSet } from "../../../../types/signals";
|
|
2
2
|
import type { PhiRuntimeModuleDefinition, PhiRuntimeModuleId } from "../../../../types/cms-plugins";
|
|
3
|
-
import type {
|
|
3
|
+
import type { PhiDeveloperBuilderRegionDraft } from "../developer-workspace-types";
|
|
4
4
|
import type { PhiAreaRootRoute, PhiAreaMeta } from "../../../../helpers/cms-area-config";
|
|
5
5
|
import type { PhiWorkspaceCatalogState } from "../../../../components/workspace/catalog-state";
|
|
6
6
|
import { type PhiBuilderPageMetaPresentationLabels } from "../controller/definition";
|
|
@@ -8,7 +8,6 @@ import type { PhiCmsTreeControllerSettings } from "../../../../types/cms";
|
|
|
8
8
|
import { type PhiHistoryLabels } from "../../../../components/widgets/label-types/history";
|
|
9
9
|
export type { PhiBuilderPageRegionKey, PhiBuilderRegionKey, PhiBuilderShellRegionKey, } from "../region-keys";
|
|
10
10
|
export type PhiDeveloperBuilderWorkspaceControllerProps = {
|
|
11
|
-
defaultArea?: PhiDeveloperBuilderArea;
|
|
12
11
|
shellPresetDraftsByArea?: Record<string, Record<string, PhiDeveloperBuilderRegionDraft>>;
|
|
13
12
|
runtimeModuleDefinitions?: readonly PhiRuntimeModuleDefinition[];
|
|
14
13
|
runtimeModuleIdsByArea?: Record<string, PhiRuntimeModuleId[]>;
|
|
@@ -27,4 +26,4 @@ export type PhiDeveloperBuilderWorkspaceControllerProps = {
|
|
|
27
26
|
historyLabels: PhiHistoryLabels;
|
|
28
27
|
signalRoutes?: PhiSignalRouteSet | null;
|
|
29
28
|
};
|
|
30
|
-
export declare function PhiDeveloperBuilderWorkspaceController({
|
|
29
|
+
export declare function PhiDeveloperBuilderWorkspaceController({ shellPresetDraftsByArea, runtimeModuleDefinitions, runtimeModuleIdsByArea, modulePresetPagesByArea, areaPresetSourcesByArea, navigationSurfacesByArea, unresolvedModuleIdsByArea, serverUnavailableModules, publicRouteClaims, publicRoutePaths, areaRootRoutesByArea, areaMetaByArea, areaControllerSettingsByArea, pageMetaLabels, historyLabels, signalRoutes, }: PhiDeveloperBuilderWorkspaceControllerProps): import("react").JSX.Element;
|