@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.
Files changed (246) hide show
  1. package/components/cms/phi-cms-layout-renderer.js +4 -3
  2. package/components/cms/phi-cms-page-render-scope.d.ts +4 -5
  3. package/components/cms/phi-cms-page-render-scope.js +43 -22
  4. package/components/cms/phi-cms-render-diagnostic-client.js +7 -3
  5. package/components/cms/phi-cms-render-error-boundary.js +2 -1
  6. package/components/controls/phi-bullet-list-control.js +31 -2
  7. package/components/controls/phi-ribbon-control.d.ts +29 -0
  8. package/components/controls/phi-ribbon-control.js +53 -0
  9. package/components/controls/phi-table-control.d.ts +3 -0
  10. package/components/controls/phi-table-control.js +13 -1
  11. package/components/controls/phi-tree-control.js +3 -3
  12. package/components/forms/shared-form-provider-registry.js +1 -4
  13. package/components/media/asset-collection-runtime.js +6 -16
  14. package/components/media/media-font-metrics.d.ts +3 -0
  15. package/components/media/media-font-metrics.js +43 -0
  16. package/components/media/phi-area-upload-widget.js +53 -97
  17. package/components/media/phi-image-preview-data.d.ts +13 -0
  18. package/components/media/phi-image-preview-data.js +184 -9
  19. package/components/media/phi-media-picker-binding.js +16 -13
  20. package/components/media/phi-media-upload.d.ts +15 -8
  21. package/components/media/phi-media-upload.js +18 -9
  22. package/components/media/phi-site-font-assets.js +7 -8
  23. package/components/overlays/phi-overlay-container-client.js +16 -1
  24. package/components/regions/presets/phi-settings-page-shell-tree.js +48 -1
  25. package/components/runtime/runtime-controller-materialization.js +12 -1
  26. package/components/state/scoped-state-store.js +20 -3
  27. package/components/tables/client/phi-table-binding.d.ts +2 -1
  28. package/components/tables/client/phi-table-binding.js +45 -21
  29. package/components/trees/client/phi-tree-binding.js +19 -11
  30. package/components/widgets/client/bullet-list-entries-editor.d.ts +26 -0
  31. package/components/widgets/client/bullet-list-entries-editor.js +103 -0
  32. package/components/widgets/config/choice-shared.js +12 -13
  33. package/components/widgets/config/command-buttons.d.ts +5 -1
  34. package/components/widgets/config/command-buttons.js +38 -81
  35. package/components/widgets/config/control-signal-config.d.ts +3 -1
  36. package/components/widgets/config/control-signal-config.js +19 -17
  37. package/components/widgets/config/image-source-parser.d.ts +1 -0
  38. package/components/widgets/config/image-source-parser.js +7 -8
  39. package/components/widgets/config/mask.d.ts +6 -1
  40. package/components/widgets/config/mask.js +24 -1
  41. package/components/widgets/config/parser-primitives.js +72 -0
  42. package/components/widgets/config/stack-tabs.d.ts +1 -1
  43. package/components/widgets/config/stack-tabs.js +2 -3
  44. package/components/widgets/config/strict-config-reader.d.ts +40 -0
  45. package/components/widgets/config/strict-config-reader.js +174 -0
  46. package/components/widgets/label-sets/effects.js +2 -0
  47. package/components/widgets/label-types/effects.d.ts +1 -0
  48. package/components/widgets/label-types/effects.js +1 -0
  49. package/components/widgets/navigation-descriptor-resolver.server.js +20 -8
  50. package/components/widgets/shared/bullet-list-vocabulary.d.ts +17 -1
  51. package/components/widgets/shared/bullet-list-vocabulary.js +19 -2
  52. package/components/widgets/shared/card-body-client.d.ts +16 -4
  53. package/components/widgets/shared/card-body-client.js +81 -24
  54. package/components/widgets/shared/card-vocabulary.d.ts +21 -4
  55. package/components/widgets/shared/card-vocabulary.js +28 -2
  56. package/components/widgets/shared/markdown-body-client.d.ts +2 -1
  57. package/components/widgets/shared/markdown-body-client.js +3 -1
  58. package/components/widgets/shared/markdown-render.js +8 -1
  59. package/components/widgets/signals/control-signal-capabilities.d.ts +0 -18
  60. package/components/widgets/signals/control-signal-capabilities.js +10 -22
  61. package/components/workspace/catalog-store.d.ts +4 -3
  62. package/components/workspace/catalog-store.js +6 -5
  63. package/gateway/dashboard-cards-route.js +1 -0
  64. package/gateway/internal-references.d.ts +6 -1
  65. package/gateway/internal-references.js +48 -23
  66. package/gateway/site-cms-write-validation.d.ts +9 -0
  67. package/gateway/site-cms-write-validation.js +78 -0
  68. package/gateway/site-proxy.js +19 -3
  69. package/helpers/renderable-block-serialization.js +1 -1
  70. package/next/config.d.mts +3 -0
  71. package/next/config.mjs +28 -1
  72. package/package.json +2 -2
  73. package/plugins/runtime/phi-slot-child-viewport-effects-observer.js +5 -1
  74. package/plugins/runtime-modules/accounting/presets.d.ts +9 -0
  75. package/plugins/runtime-modules/accounting/presets.js +37 -0
  76. package/plugins/runtime-modules/accounting/server.d.ts +1 -4
  77. package/plugins/runtime-modules/accounting/server.js +4 -7
  78. package/plugins/runtime-modules/app/presets.d.ts +18 -0
  79. package/plugins/runtime-modules/app/presets.js +67 -0
  80. package/plugins/runtime-modules/app/server.d.ts +1 -4
  81. package/plugins/runtime-modules/app/server.js +4 -7
  82. package/plugins/runtime-modules/asset/controller/runtime.js +2 -2
  83. package/plugins/runtime-modules/asset/services/collection.js +9 -1
  84. package/plugins/runtime-modules/asset/services/options.js +2 -2
  85. package/plugins/runtime-modules/builder/area-settings-answer.js +2 -1
  86. package/plugins/runtime-modules/builder/authoring-canvas.js +6 -6
  87. package/plugins/runtime-modules/builder/cards.js +3 -5
  88. package/plugins/runtime-modules/builder/clients/builder-region-overrides.js +3 -3
  89. package/plugins/runtime-modules/builder/clients/canvas-widget.js +15 -54
  90. package/plugins/runtime-modules/builder/clients/inspector-config-field.d.ts +4 -1
  91. package/plugins/runtime-modules/builder/clients/inspector-config-field.js +5 -34
  92. package/plugins/runtime-modules/builder/clients/inspector-link-target-field.js +1 -1
  93. package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +8 -8
  94. package/plugins/runtime-modules/builder/clients/inspector-title.js +6 -6
  95. package/plugins/runtime-modules/builder/clients/layout-inspector.d.ts +1 -1
  96. package/plugins/runtime-modules/builder/clients/layout-inspector.js +11 -25
  97. package/plugins/runtime-modules/builder/clients/mode-switch.js +1 -1
  98. package/plugins/runtime-modules/builder/clients/pages-header.js +11 -11
  99. package/plugins/runtime-modules/builder/clients/pages-workspace.js +1 -1
  100. package/plugins/runtime-modules/builder/clients/region-visibility-fields.js +1 -1
  101. package/plugins/runtime-modules/builder/clients/runtime-module-authoring-boundary.js +1 -1
  102. package/plugins/runtime-modules/builder/clients/shells-workspace.js +15 -31
  103. package/plugins/runtime-modules/builder/clients/structure-canvas.js +1 -1
  104. package/plugins/runtime-modules/builder/clients/use-region-draft-hydration.d.ts +26 -0
  105. package/plugins/runtime-modules/builder/clients/use-region-draft-hydration.js +36 -0
  106. package/plugins/runtime-modules/builder/clients/widget-effects-editor.js +1 -1
  107. package/plugins/runtime-modules/builder/clients/widget-inspector.js +1 -0
  108. package/plugins/runtime-modules/builder/clients/workspace-scope-boundary.js +2 -2
  109. package/plugins/runtime-modules/builder/cms-instance-allocator.js +8 -28
  110. package/plugins/runtime-modules/builder/controller/client.d.ts +0 -15
  111. package/plugins/runtime-modules/builder/controller/definition.d.ts +0 -15
  112. package/plugins/runtime-modules/builder/controller/definition.js +0 -8
  113. package/plugins/runtime-modules/builder/controller/draft-command-controller.d.ts +1 -2
  114. package/plugins/runtime-modules/builder/controller/draft-command-controller.js +11 -30
  115. package/plugins/runtime-modules/builder/controller/draft-status-controller.js +15 -2
  116. package/plugins/runtime-modules/builder/controller/inspector-controller.d.ts +1 -2
  117. package/plugins/runtime-modules/builder/controller/inspector-controller.js +4 -7
  118. package/plugins/runtime-modules/builder/controller/page-controller.d.ts +1 -2
  119. package/plugins/runtime-modules/builder/controller/page-controller.js +16 -68
  120. package/plugins/runtime-modules/builder/controller/server-definition.d.ts +0 -15
  121. package/plugins/runtime-modules/builder/controller/signal-wiring-controller.d.ts +2 -5
  122. package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +6 -50
  123. package/plugins/runtime-modules/builder/controller/workspace-controller.d.ts +2 -3
  124. package/plugins/runtime-modules/builder/controller/workspace-controller.js +89 -153
  125. package/plugins/runtime-modules/builder/data-providers.d.ts +1 -0
  126. package/plugins/runtime-modules/builder/data-providers.js +1 -0
  127. package/plugins/runtime-modules/builder/definition.d.ts +1 -0
  128. package/plugins/runtime-modules/builder/developer-workspace-store.d.ts +64 -30
  129. package/plugins/runtime-modules/builder/developer-workspace-store.js +255 -61
  130. package/plugins/runtime-modules/builder/edit-scaffold-drawer.js +1 -1
  131. package/plugins/runtime-modules/builder/history.d.ts +3 -1
  132. package/plugins/runtime-modules/builder/options-providers.js +3 -2
  133. package/plugins/runtime-modules/builder/page-catalog-client.js +19 -7
  134. package/plugins/runtime-modules/builder/page-meta-form.js +1 -0
  135. package/plugins/runtime-modules/builder/page-references-provider.js +1 -1
  136. package/plugins/runtime-modules/builder/persistence.js +33 -69
  137. package/plugins/runtime-modules/builder/public-route-collisions.d.ts +2 -2
  138. package/plugins/runtime-modules/builder/public-route-collisions.js +6 -19
  139. package/plugins/runtime-modules/builder/render-root-node-preview.server.js +20 -3
  140. package/plugins/runtime-modules/builder/render-root-node-scaffold.js +3 -3
  141. package/plugins/runtime-modules/builder/runtime-module-selection.d.ts +2 -12
  142. package/plugins/runtime-modules/builder/runtime-module-selection.js +16 -42
  143. package/plugins/runtime-modules/builder/services/navigation-table.js +9 -15
  144. package/plugins/runtime-modules/builder/services/page-source-tree.js +8 -8
  145. package/plugins/runtime-modules/builder/services/runtime-modules-table.js +10 -10
  146. package/plugins/runtime-modules/builder/services/signal-routes-table.js +3 -3
  147. package/plugins/runtime-modules/builder/signal-route-selection.d.ts +1 -2
  148. package/plugins/runtime-modules/builder/signal-route-selection.js +2 -2
  149. package/plugins/runtime-modules/builder/signal-wiring-options.js +3 -2
  150. package/plugins/runtime-modules/builder/structure-dnd.js +8 -61
  151. package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +13 -10
  152. package/plugins/runtime-modules/builder/widgets/structure-region/built-in.js +12 -18
  153. package/plugins/runtime-modules/builder/workspace-catalog-actions.d.ts +55 -0
  154. package/plugins/runtime-modules/builder/workspace-catalog-actions.js +142 -0
  155. package/plugins/runtime-modules/client-manifests/common.js +1 -1
  156. package/plugins/runtime-modules/{runtime-calendar-adapters.js → core/calendar-adapters.js} +2 -2
  157. package/plugins/runtime-modules/{client-calendar-adapters/core.js → core/client-calendar-adapters.js} +1 -1
  158. package/plugins/runtime-modules/core/content-entries/table.js +1 -1
  159. package/plugins/runtime-modules/core/data-providers.d.ts +3 -0
  160. package/plugins/runtime-modules/core/data-providers.js +2 -1
  161. package/plugins/runtime-modules/core/definition.d.ts +3 -0
  162. package/plugins/runtime-modules/core/definition.js +1 -1
  163. package/plugins/runtime-modules/core/messaging/data-providers.d.ts +1 -0
  164. package/plugins/runtime-modules/core/messaging/data-providers.js +1 -0
  165. package/plugins/runtime-modules/core/messaging/thread-inbox-table.js +1 -1
  166. package/plugins/runtime-modules/core/server.js +1 -1
  167. package/plugins/runtime-modules/core/themes.d.ts +44 -0
  168. package/plugins/runtime-modules/core/themes.js +12 -0
  169. package/plugins/runtime-modules/core/widgets/card/collection-view-binding.js +25 -9
  170. package/plugins/runtime-modules/core/widgets/card/config.d.ts +296 -254
  171. package/plugins/runtime-modules/core/widgets/card/config.js +52 -3
  172. package/plugins/runtime-modules/core/widgets/card/editor.js +30 -3
  173. package/plugins/runtime-modules/core/widgets/card/server.d.ts +3 -0
  174. package/plugins/runtime-modules/core/widgets/card/server.js +31 -3
  175. package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +7 -6
  176. package/plugins/runtime-modules/core/widgets/collection-view/config.js +9 -2
  177. package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -25
  178. package/plugins/runtime-modules/core/widgets/description/editor.js +4 -61
  179. package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -25
  180. package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -25
  181. package/plugins/runtime-modules/core/widgets/image/config.js +2 -2
  182. package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +3 -1
  183. package/plugins/runtime-modules/core/widgets/markdown/config.js +14 -0
  184. package/plugins/runtime-modules/core/widgets/markdown/editor.js +2 -3
  185. package/plugins/runtime-modules/core/widgets/result/config.d.ts +4 -25
  186. package/plugins/runtime-modules/core/widgets/result/config.js +2 -0
  187. package/plugins/runtime-modules/core/widgets/result/server.js +25 -19
  188. package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -25
  189. package/plugins/runtime-modules/core/widgets/slot-upload/client.js +11 -2
  190. package/plugins/runtime-modules/core/widgets/table/client.js +8 -4
  191. package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -83
  192. package/plugins/runtime-modules/core/widgets/table/config.js +302 -452
  193. package/plugins/runtime-modules/core/widgets/tree/config.js +5 -2
  194. package/plugins/runtime-modules/dashboard/card-rows.d.ts +5 -0
  195. package/plugins/runtime-modules/dashboard/card-rows.js +59 -0
  196. package/plugins/runtime-modules/dashboard/clients/dashboard-card-view.js +4 -6
  197. package/plugins/runtime-modules/dashboard/services/collection.js +17 -7
  198. package/plugins/runtime-modules/groups/data-providers.d.ts +2 -0
  199. package/plugins/runtime-modules/groups/data-providers.js +3 -3
  200. package/plugins/runtime-modules/groups/definition.d.ts +2 -0
  201. package/plugins/runtime-modules/localization/data-providers.d.ts +3 -0
  202. package/plugins/runtime-modules/localization/data-providers.js +2 -0
  203. package/plugins/runtime-modules/localization/definition.d.ts +3 -0
  204. package/plugins/runtime-modules/localization/services/table.js +3 -7
  205. package/plugins/runtime-modules/observability/data-providers.d.ts +1 -0
  206. package/plugins/runtime-modules/observability/data-providers.js +1 -0
  207. package/plugins/runtime-modules/observability/definition.d.ts +1 -0
  208. package/plugins/runtime-modules/observability/module.d.ts +1 -0
  209. package/plugins/runtime-modules/observability/services/table.js +1 -1
  210. package/plugins/runtime-modules/phi-default-site-area-preset-tree.js +2 -105
  211. package/plugins/runtime-modules/public/presets.d.ts +115 -0
  212. package/plugins/runtime-modules/{area-base-presets.js → public/presets.js} +19 -119
  213. package/plugins/runtime-modules/public/server.d.ts +1 -4
  214. package/plugins/runtime-modules/public/server.js +4 -7
  215. package/plugins/runtime-modules/public/trees/phi-default-pub-error-page-tree.js +7 -8
  216. package/plugins/runtime-modules/public-base-page-references.d.ts +1 -1
  217. package/plugins/runtime-modules/public-base-page-references.js +1 -1
  218. package/plugins/runtime-modules/revisions/controller/client.js +11 -11
  219. package/plugins/runtime-modules/revisions/services/table.js +3 -3
  220. package/plugins/runtime-modules/theme/trees/phi-default-builder-theme-page-tree.js +22 -0
  221. package/plugins/runtime-modules/theme/widgets/brand-controls/client.d.ts +2 -1
  222. package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +93 -58
  223. package/plugins/runtime-modules/theme/widgets/brand-controls/config.d.ts +2 -1
  224. package/plugins/runtime-modules/theme/widgets/brand-controls/config.js +23 -22
  225. package/plugins/runtime-modules/theme/widgets/brand-controls/plugin.js +1 -1
  226. package/plugins/runtime-modules/theme-descriptors.js +1 -1
  227. package/plugins/runtime-modules/user-management/data-providers.d.ts +2 -0
  228. package/plugins/runtime-modules/user-management/data-providers.js +1 -0
  229. package/plugins/runtime-modules/user-management/definition.d.ts +2 -0
  230. package/styles/control-shape.css +11 -11
  231. package/styles/controls.css +29 -3
  232. package/styles/layout.css +16 -7
  233. package/types/cms-config.js +142 -185
  234. package/types/cms-plugins.d.ts +4 -11
  235. package/types/core-widget-placements.d.ts +17 -3
  236. package/types/dashboard-cards.d.ts +9 -0
  237. package/types/media.d.ts +0 -3
  238. package/types/renderable-block.d.ts +6 -1
  239. package/types/table-widget.d.ts +9 -0
  240. package/types/table-widget.js +20 -0
  241. package/types.d.ts +1 -1
  242. package/widget-config.d.ts +2 -0
  243. package/widget-config.js +6 -0
  244. package/plugins/runtime-modules/area-base-presets.d.ts +0 -139
  245. /package/plugins/runtime-modules/{runtime-calendar-adapters.d.ts → core/calendar-adapters.d.ts} +0 -0
  246. /package/plugins/runtime-modules/{client-calendar-adapters/core.d.ts → core/client-calendar-adapters.d.ts} +0 -0
@@ -22,7 +22,7 @@ import { isPhiBuilderAreaKey, resolvePhiBuilderAreaAsCmsArea, } from "../../../.
22
22
  import { resolvePhiRuntimeAreaDefinition } from "../../../../plugins/runtime-modules/area-definitions";
23
23
  import { resolvePhiBuilderNavigationWidgetNavKey } from "../navigation-widget-runtime";
24
24
  import { parsePhiBuilderNavigationScopeKey } from "../../../../helpers/cms-navigation-catalog";
25
- import { builderWorkspaceStore, usePhiDeveloperBuilderWorkspaceState, completePhiDeveloperBuilderEffectsEditor, normalizePhiDeveloperBuilderArea as normalizeBuilderArea, previewPhiDeveloperBuilderEffects, resetPhiBuilderSelectionToPage, selectPhiDeveloperBuilderNode, usePhiDeveloperRegionDraft, getPhiDeveloperBuilderStateSnapshot, getPhiDeveloperRegionDraftsSnapshot, readPhiBuilderEffectiveAreaRootRoute, setPhiDeveloperBuilderAreaRootRoutes, setPhiDeveloperBuilderAreaMetaBaseline, setPhiDeveloperBuilderAreaControllerSettings, readPhiBuilderEffectiveAreaMeta, closePhiBuilderModuleDeactivationRequest, closePhiBuilderPublicRouteCollisionRequest, } from "../developer-workspace-store";
25
+ import { patchPhiBuilderSignalWiringSession, resetPhiBuilderSignalWiringSession, openPhiBuilderPage, openPhiBuilderPageInOpenArea, openPhiBuilderPagesPanel, selectPhiBuilderPageNode, setPhiBuilderCommandWorkspace, setPhiBuilderDebugScaffold, setPhiBuilderInspectorOpen, setPhiBuilderMode, usePhiDeveloperBuilderWorkspaceState, completePhiDeveloperBuilderEffectsEditor, normalizePhiDeveloperBuilderArea as normalizeBuilderArea, previewPhiDeveloperBuilderEffects, selectPhiDeveloperBuilderNode, usePhiDeveloperRegionDraft, getPhiDeveloperBuilderStateSnapshot, getPhiDeveloperRegionDraftsSnapshot, readPhiBuilderEffectiveAreaRootRoute, setPhiDeveloperBuilderAreaRootRoutes, setPhiDeveloperBuilderAreaMetaBaseline, setPhiDeveloperBuilderAreaControllerSettings, readPhiBuilderEffectiveAreaMeta, closePhiBuilderModuleDeactivationRequest, closePhiBuilderPublicRouteCollisionRequest, } from "../developer-workspace-store";
26
26
  import {} from "../options-providers";
27
27
  import { PHI_AREA_META_PUBLIC_DEFAULTS } from "../../../../helpers/cms-area-config";
28
28
  import { getPhiBuilderRegionDraftKey } from "../region-keys";
@@ -31,7 +31,7 @@ import { getDefaultRegionDraft } from "../developer-region-drafts";
31
31
  import { isPhiAreaScopedBuilderPage, isPhiDebugScaffoldBuilderPage, readPhiDeveloperBuilderWorkspaceKey, resolvePhiDeveloperBuilderCommandWorkspace, resolvePhiDeveloperBuilderRouteScope, } from "../route-scope";
32
32
  import { usePhiDeveloperBuilderPreviewModeController, } from "./preview-controller";
33
33
  import { runPhiDeveloperBuilderInspectorAction } from "./inspector-controller";
34
- import { patchPhiBuilderSignalWiringSession, resetPhiBuilderSignalWiringSession, resolvePhiBuilderSignalWiringRoutes, resolvePhiBuilderSignalWiringRoutesWithout, } from "./signal-wiring-controller";
34
+ import { resolvePhiBuilderSignalWiringRoutes, resolvePhiBuilderSignalWiringRoutesWithout, } from "./signal-wiring-controller";
35
35
  import { readPhiTableActionSignalValue } from "../../../../types/table-signal-values";
36
36
  import { usePhiBuilderPageController } from "./page-controller";
37
37
  import { PHI_BUILDER_AREA_LANDING_PAGE_EMPTY, PHI_BUILDER_AREA_ROOT_ROUTE_AUTOMATIC, PHI_BUILDER_AREA_ROOT_ROUTE_LANDING, } from "../area-settings-values";
@@ -41,9 +41,9 @@ import { usePhiBuilderDraftCommandController, } from "./draft-command-controller
41
41
  import { usePhiBuilderDraftStatusController } from "./draft-status-controller";
42
42
  import { applyPhiDeveloperBuilderSiderLeftMode, } from "./region-controller";
43
43
  import { createPhiBuilderHistoryContext, phiBuilderHistory, } from "../history";
44
- import { applyPhiBuilderRuntimeModuleSelectionChange, applyPhiBuilderRuntimeModuleSelectionChanges, areRuntimeModuleIdsEqual, } from "../runtime-module-selection";
44
+ import { applyPhiBuilderRuntimeModuleSelectionChange, applyPhiBuilderRuntimeModuleSelectionChanges, } from "../runtime-module-selection";
45
45
  import { applyPhiBuilderPublicRouteAssignments, findPhiBuilderPublicRouteAnswerProblem, } from "../public-route-collisions";
46
- import { phiWorkspaceCatalogStore } from "../../../../components/workspace/catalog-store";
46
+ import { applyPhiWorkspaceCatalogPreload, setPhiWorkspaceActiveCatalogs, storePhiWorkspacePersistedPages, } from "../workspace-catalog-actions";
47
47
  import { PHI_BUILDER_PAGE_META_DEFAULT_PRESENTATION_LABELS, resolvePhiBuilderEffectsCapabilityId, } from "../controller/definition";
48
48
  import { formatPhiHistoryTooltip, } from "../../../../components/widgets/label-types/history";
49
49
  const EMPTY_RUNTIME_MODULE_IDS_BY_AREA = {};
@@ -122,7 +122,7 @@ function filterBuilderModuleCatalogs(modulePresetPagesByArea, navigationSurfaces
122
122
  navigationSurfacesByArea: filteredNavigation,
123
123
  };
124
124
  }
125
- function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
125
+ function usePhiDeveloperBuilderWorkspaceController(options) {
126
126
  const { showMessage } = usePhiApplicationFeedback();
127
127
  const dispatchSignal = usePhiSignalDispatcher();
128
128
  const effectsWorkflowCorrelationRef = useRef(null);
@@ -139,7 +139,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
139
139
  */
140
140
  const emitRoutes = useMemo(() => signalRoutes?.emits ?? [], [signalRoutes?.emits]);
141
141
  const emitCapability = useCallback((capabilityId, value, correlationId) => dispatchPhiSignalCapability(dispatchSignal, createPhiBuilderControllerAddress(), emitRoutes, capabilityId, value, correlationId), [dispatchSignal, emitRoutes]);
142
- const state = usePhiDeveloperBuilderWorkspaceState(defaultArea);
142
+ const state = usePhiDeveloperBuilderWorkspaceState();
143
143
  const router = useRouter();
144
144
  const pathname = usePhiPathname();
145
145
  const searchParams = useSearchParams();
@@ -164,7 +164,6 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
164
164
  const effectiveNavKey = resolvePhiBuilderNavigationWidgetNavKey(null, searchParams.get(PHI_BUILDER_NAVIGATION_KEY_SEARCH_PARAM), effectiveArea);
165
165
  const { emitPageTitleInputValue, navigateToBuilderPage, openPageMetaDialog, pageMetaDialog, } = usePhiBuilderPageController({
166
166
  emitCapability,
167
- defaultArea,
168
167
  effectiveArea,
169
168
  effectivePageKey,
170
169
  pageMetaLabels,
@@ -178,7 +177,6 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
178
177
  state,
179
178
  });
180
179
  const { confirmResetPage, runBuilderCommand, confirmDialog } = usePhiBuilderDraftCommandController({
181
- defaultArea,
182
180
  effectiveArea,
183
181
  effectiveNavKey,
184
182
  effectivePageKey,
@@ -243,13 +241,13 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
243
241
  }
244
242
  openedSignalWiringCorrelationRef.current = request.correlationId;
245
243
  // A wiring session belongs to the block it was opened on, so it starts empty every time.
246
- resetPhiBuilderSignalWiringSession(defaultArea);
244
+ resetPhiBuilderSignalWiringSession();
247
245
  emitCapability("signalWiringReset", null, request.correlationId);
248
246
  // The Table is mounted eagerly with the overlay, so its rows may still belong to the block wired
249
247
  // last time; opening on a new one has to ask for them again.
250
248
  emitCapability("signalWiringRoutesReload", null, request.correlationId);
251
249
  queueMicrotask(() => emitCapability("signalWiringOpen", null, request.correlationId));
252
- }, [defaultArea, emitCapability, state.signalWiringRequest]);
250
+ }, [emitCapability, state.signalWiringRequest]);
253
251
  useEffect(() => {
254
252
  const request = state.effectsEditorRequest;
255
253
  if (!request || initializedEffectsCorrelationRef.current === request.correlationId)
@@ -431,61 +429,32 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
431
429
  * it lives in the Foundation so that revisions, and later the Editor, can read it without going
432
430
  * through here.
433
431
  */
434
- phiWorkspaceCatalogStore.patch(defaultArea, (current) => {
435
- let changed = false;
436
- const definitionsChanged = serializeRuntimeModuleDefinitions(current.runtimeModuleDefinitions) !== runtimeModuleDefinitionsPreloadKey;
437
- const modulePresetPagesChanged = JSON.stringify(current.modulePresetPagesByArea) !== modulePresetPagesPreloadKey;
438
- const areaPresetSourcesChanged = JSON.stringify(current.areaPresetSourcesByArea) !== areaPresetSourcesPreloadKey;
439
- const navigationSurfacesChanged = JSON.stringify(current.navigationSurfacesByArea) !== navigationSurfacesPreloadKey;
440
- const unresolvedModuleIdsChanged = JSON.stringify(current.unresolvedModuleIdsByArea) !== unresolvedModuleIdsPreloadKey;
441
- const publicRouteClaimsChanged = JSON.stringify(current.publicRouteClaims) !== publicRouteClaimsPreloadKey;
442
- const serverUnavailableModulesChanged = JSON.stringify(current.serverUnavailableModules) !== serverUnavailableModulesPreloadKey;
443
- /*
444
- * The assignments arrive with the Modules draft and are edited by the collision dialog, so this
445
- * follows the same rule as the Module selection beside it: what the server sent replaces what is
446
- * here when the server's answer changed, and an unsaved answer survives a re-render.
447
- */
448
- const publicRoutePathsChanged = JSON.stringify(current.publicRoutePaths) !== publicRoutePathsPreloadKey;
449
- const catalogHydrationChanged = !current.catalogHydrated;
450
- const initialPageKey = current.pageKey ||
451
- resolvePhiBuilderActivePageKey(null, activePreloadCatalogs.modulePresetPagesByArea[current.area]) || "";
452
- const initialPageChanged = initialPageKey !== current.pageKey;
453
- const nextModuleIdsByArea = {
454
- ...(current.runtimeModuleIdsByArea ?? {}),
455
- };
456
- for (const [area, moduleIds] of Object.entries(runtimeModuleIdsByArea)) {
457
- const builderArea = normalizeBuilderArea(area);
458
- if (!areRuntimeModuleIdsEqual(nextModuleIdsByArea[builderArea], moduleIds)) {
459
- nextModuleIdsByArea[builderArea] = moduleIds;
460
- changed = true;
461
- }
462
- }
463
- if (initialPageChanged) {
464
- // The selected node follows the page, and that selection is Builder tool state.
465
- builderWorkspaceStore.patch(defaultArea, (tool) => ({
466
- ...tool,
467
- nodeKey: `page:${initialPageKey}`,
468
- }));
469
- }
470
- return changed || definitionsChanged || modulePresetPagesChanged || areaPresetSourcesChanged || navigationSurfacesChanged || unresolvedModuleIdsChanged || serverUnavailableModulesChanged || publicRouteClaimsChanged || publicRoutePathsChanged || catalogHydrationChanged || initialPageChanged
471
- ? {
472
- ...current,
473
- ...(initialPageChanged ? { pageKey: initialPageKey } : {}),
474
- runtimeModuleDefinitions: [...runtimeModuleDefinitions],
475
- runtimeModuleIdsByArea: nextModuleIdsByArea,
476
- catalogHydrated: true,
477
- modulePresetPagesByArea: activePreloadCatalogs.modulePresetPagesByArea,
478
- areaPresetSourcesByArea,
479
- navigationSurfacesByArea: activePreloadCatalogs.navigationSurfacesByArea,
480
- unresolvedModuleIdsByArea,
481
- serverUnavailableModules,
482
- publicRouteClaims,
483
- ...(publicRoutePathsChanged ? { publicRoutePaths } : {}),
484
- }
485
- : current;
432
+ const openedPageKey = applyPhiWorkspaceCatalogPreload({
433
+ runtimeModuleDefinitions,
434
+ runtimeModuleIdsByArea,
435
+ areaPresetSourcesByArea,
436
+ unresolvedModuleIdsByArea,
437
+ serverUnavailableModules,
438
+ publicRouteClaims,
439
+ publicRoutePaths,
440
+ activeCatalogs: activePreloadCatalogs,
441
+ keys: {
442
+ runtimeModuleDefinitions: runtimeModuleDefinitionsPreloadKey,
443
+ modulePresetPagesByArea: modulePresetPagesPreloadKey,
444
+ areaPresetSourcesByArea: areaPresetSourcesPreloadKey,
445
+ navigationSurfacesByArea: navigationSurfacesPreloadKey,
446
+ unresolvedModuleIdsByArea: unresolvedModuleIdsPreloadKey,
447
+ publicRouteClaims: publicRouteClaimsPreloadKey,
448
+ serverUnavailableModules: serverUnavailableModulesPreloadKey,
449
+ publicRoutePaths: publicRoutePathsPreloadKey,
450
+ },
451
+ normalizeArea: normalizeBuilderArea,
486
452
  });
453
+ if (openedPageKey != null) {
454
+ // The selected node follows the page, and that selection is Builder tool state.
455
+ selectPhiBuilderPageNode(openedPageKey);
456
+ }
487
457
  }, [
488
- defaultArea,
489
458
  runtimeModuleDefinitions,
490
459
  runtimeModuleDefinitionsPreloadKey,
491
460
  runtimeModuleIdsByArea,
@@ -517,17 +486,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
517
486
  .then((pages) => {
518
487
  if (cancelled)
519
488
  return;
520
- phiWorkspaceCatalogStore.patch(defaultArea, (current) => ({
521
- ...current,
522
- persistedPageCatalogByArea: {
523
- ...current.persistedPageCatalogByArea,
524
- [effectiveArea]: pages,
525
- },
526
- pageCatalogHydratedByArea: {
527
- ...current.pageCatalogHydratedByArea,
528
- [effectiveArea]: true,
529
- },
530
- }));
489
+ storePhiWorkspacePersistedPages(effectiveArea, pages);
531
490
  })
532
491
  .catch((error) => {
533
492
  if (!cancelled) {
@@ -541,7 +500,6 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
541
500
  cancelled = true;
542
501
  };
543
502
  }, [
544
- defaultArea,
545
503
  effectiveArea,
546
504
  isBuilderWorkspace,
547
505
  showMessage,
@@ -551,23 +509,13 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
551
509
  const currentRuntimeModuleIdsKey = JSON.stringify(currentRuntimeModuleIdsByArea);
552
510
  useEffect(() => {
553
511
  const activeCatalogs = filterBuilderModuleCatalogs(modulePresetPagesByArea, navigationSurfacesByArea, currentRuntimeModuleIdsByArea, runtimeModuleDefinitions);
554
- phiWorkspaceCatalogStore.patch(defaultArea, (current) => {
555
- if (JSON.stringify(current.modulePresetPagesByArea) ===
556
- JSON.stringify(activeCatalogs.modulePresetPagesByArea) &&
557
- JSON.stringify(current.navigationSurfacesByArea) ===
558
- JSON.stringify(activeCatalogs.navigationSurfacesByArea)) {
559
- return current;
560
- }
561
- return {
562
- ...current,
563
- modulePresetPagesByArea: activeCatalogs.modulePresetPagesByArea,
564
- navigationSurfacesByArea: activeCatalogs.navigationSurfacesByArea,
565
- };
512
+ setPhiWorkspaceActiveCatalogs({
513
+ modulePresetPagesByArea: activeCatalogs.modulePresetPagesByArea,
514
+ navigationSurfacesByArea: activeCatalogs.navigationSurfacesByArea,
566
515
  });
567
516
  }, [
568
517
  currentRuntimeModuleIdsByArea,
569
518
  currentRuntimeModuleIdsKey,
570
- defaultArea,
571
519
  modulePresetPagesByArea,
572
520
  navigationSurfacesByArea,
573
521
  runtimeModuleDefinitions,
@@ -594,10 +542,15 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
594
542
  if (builderWorkspaceKey !== "shells") {
595
543
  return;
596
544
  }
545
+ /*
546
+ * The switch's own change is not told back to it -- once. The note is consumed whatever this run
547
+ * finds: kept until it matched, it outlived a change of Area, and on the way back it matched again
548
+ * and swallowed the very report that would have set the switch to this Area's draft.
549
+ */
597
550
  const handledSiderLayout = handledSiderLayoutRef.current;
551
+ handledSiderLayoutRef.current = null;
598
552
  if (handledSiderLayout?.draftKey === siderLeftDraftKey &&
599
553
  handledSiderLayout.fullHeight === siderLeftFullHeight) {
600
- handledSiderLayoutRef.current = null;
601
554
  return;
602
555
  }
603
556
  dispatchSignal({
@@ -621,11 +574,8 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
621
574
  if (state.commandWorkspace === commandWorkspace) {
622
575
  return;
623
576
  }
624
- builderWorkspaceStore.patch(defaultArea, (current) => ({
625
- ...current,
626
- commandWorkspace,
627
- }));
628
- }, [commandWorkspace, defaultArea, state.commandWorkspace]);
577
+ setPhiBuilderCommandWorkspace(commandWorkspace);
578
+ }, [commandWorkspace, state.commandWorkspace]);
629
579
  useEffect(() => {
630
580
  if (commandWorkspace !== "structure" &&
631
581
  commandWorkspace !== "pages" &&
@@ -668,11 +618,8 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
668
618
  if (state.builderMode === nextBuilderMode) {
669
619
  return;
670
620
  }
671
- builderWorkspaceStore.patch(defaultArea, (current) => ({
672
- ...current,
673
- builderMode: nextBuilderMode,
674
- }));
675
- }, [defaultArea, hasPreviewSnapshot, isBuilderWorkspace, isNavigationWorkspace, state.builderMode]);
621
+ setPhiBuilderMode(nextBuilderMode);
622
+ }, [hasPreviewSnapshot, isBuilderWorkspace, isNavigationWorkspace, state.builderMode]);
676
623
  /*
677
624
  * The workspace, narrowed to what deciding the offered Pages actually reads.
678
625
  *
@@ -749,14 +696,8 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
749
696
  if (nextArea === state.area && nextPageKey === state.pageKey) {
750
697
  return;
751
698
  }
752
- phiWorkspaceCatalogStore.patch(defaultArea, (current) => ({
753
- ...current,
754
- area: nextArea,
755
- pageKey: nextPageKey,
756
- }));
757
- builderWorkspaceStore.patch(defaultArea, (current) => resetPhiBuilderSelectionToPage(current, nextPageKey));
699
+ openPhiBuilderPage(nextArea, nextPageKey);
758
700
  }, [
759
- defaultArea,
760
701
  isBuilderWorkspace,
761
702
  offeredCatalogState,
762
703
  pathname,
@@ -796,7 +737,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
796
737
  const finishEffectsEditor = (correlationId, effects) => {
797
738
  if (!effectsRequest || effectsRequest.correlationId !== correlationId)
798
739
  return;
799
- completePhiDeveloperBuilderEffectsEditor(defaultArea, effectsRequest, effects);
740
+ completePhiDeveloperBuilderEffectsEditor(effectsRequest, effects);
800
741
  initializedEffectsCorrelationRef.current = null;
801
742
  };
802
743
  /*
@@ -815,7 +756,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
815
756
  const live = readPhiRuntimeFormValuesSignalValue(signal.value);
816
757
  if (!live)
817
758
  return;
818
- previewPhiDeveloperBuilderEffects(defaultArea, effectsRequest.correlationId, {
759
+ previewPhiDeveloperBuilderEffects(effectsRequest.correlationId, {
819
760
  ...effectsRequest.effects,
820
761
  opacity: readPhiBuilderEffectsOpacity(live.values),
821
762
  });
@@ -841,12 +782,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
841
782
  router.replace(`${pathname}?${nextSearchParams.toString()}`, { scroll: false });
842
783
  }
843
784
  else {
844
- phiWorkspaceCatalogStore.patch(defaultArea, (current) => ({
845
- ...current,
846
- area: nextArea,
847
- pageKey: nextPageKey,
848
- }));
849
- builderWorkspaceStore.patch(defaultArea, (current) => resetPhiBuilderSelectionToPage(current, nextPageKey));
785
+ openPhiBuilderPage(nextArea, nextPageKey);
850
786
  }
851
787
  return;
852
788
  }
@@ -864,10 +800,10 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
864
800
  area,
865
801
  selectedIds: (state.runtimeModuleIdsByArea?.[area] ?? [])
866
802
  .filter((moduleId) => moduleId !== request.moduleId),
867
- })), defaultArea);
803
+ })));
868
804
  emitCapability("modulesTableReload", null, signal.correlationId);
869
805
  }
870
- closePhiBuilderModuleDeactivationRequest(defaultArea);
806
+ closePhiBuilderModuleDeactivationRequest();
871
807
  return;
872
808
  }
873
809
  /*
@@ -881,7 +817,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
881
817
  signal.action === "change" &&
882
818
  signal.value === false) {
883
819
  if (state.publicRouteCollisionRequest) {
884
- closePhiBuilderPublicRouteCollisionRequest(defaultArea);
820
+ closePhiBuilderPublicRouteCollisionRequest();
885
821
  }
886
822
  return;
887
823
  }
@@ -902,7 +838,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
902
838
  return;
903
839
  }
904
840
  if (signal.value === "cancel") {
905
- closePhiBuilderPublicRouteCollisionRequest(defaultArea);
841
+ closePhiBuilderPublicRouteCollisionRequest();
906
842
  return;
907
843
  }
908
844
  if (signal.value !== "assign") {
@@ -913,12 +849,12 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
913
849
  showMessage({ level: "error", content: rejection }, { correlationId: signal.correlationId });
914
850
  return;
915
851
  }
916
- applyPhiBuilderPublicRouteAssignments(defaultArea, request);
852
+ applyPhiBuilderPublicRouteAssignments(request);
917
853
  applyPhiBuilderRuntimeModuleSelectionChanges(request.areas.map((area) => ({
918
854
  area,
919
855
  selectedIds: [...(state.runtimeModuleIdsByArea?.[area] ?? []), request.moduleId],
920
- })), defaultArea);
921
- closePhiBuilderPublicRouteCollisionRequest(defaultArea);
856
+ })));
857
+ closePhiBuilderPublicRouteCollisionRequest();
922
858
  emitCapability("modulesTableReload", null, signal.correlationId);
923
859
  return;
924
860
  }
@@ -931,7 +867,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
931
867
  const binding = readPhiTableBindingParamsSignalValue(signal.value);
932
868
  const navKey = typeof binding?.params.navKey === "string" ? binding.params.navKey : null;
933
869
  const parsed = parsePhiBuilderNavigationScopeKey(navKey);
934
- const current = getPhiDeveloperBuilderStateSnapshot(defaultArea);
870
+ const current = getPhiDeveloperBuilderStateSnapshot();
935
871
  const cmsArea = resolvePhiBuilderAreaAsCmsArea(current.area);
936
872
  const normalizedNavKey = parsed ? `${parsed.area}:${parsed.key}` : null;
937
873
  if (!parsed || parsed.area !== cmsArea ||
@@ -981,11 +917,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
981
917
  return;
982
918
  }
983
919
  emitPageTitleInputValue(nextPageKey);
984
- phiWorkspaceCatalogStore.patch(defaultArea, (current) => ({
985
- ...current,
986
- pageKey: nextPageKey,
987
- }));
988
- builderWorkspaceStore.patch(defaultArea, (current) => resetPhiBuilderSelectionToPage(current, nextPageKey, { closePages: true }));
920
+ openPhiBuilderPageInOpenArea(nextPageKey, { closePages: true });
989
921
  return;
990
922
  }
991
923
  const builderControllerReceiver = createPhiBuilderControllerAddress();
@@ -1020,7 +952,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
1020
952
  return;
1021
953
  }
1022
954
  try {
1023
- applyPhiBuilderRuntimeModuleSelectionChange(effectiveArea, selectedIds, defaultArea);
955
+ applyPhiBuilderRuntimeModuleSelectionChange(effectiveArea, selectedIds);
1024
956
  }
1025
957
  catch (error) {
1026
958
  showMessage({ level: "error", content: error instanceof Error ? error.message : "Invalid runtime module selection." }, { correlationId: signal.correlationId });
@@ -1060,10 +992,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
1060
992
  if (nextDebugScaffold == null) {
1061
993
  return;
1062
994
  }
1063
- builderWorkspaceStore.patch(defaultArea, (current) => ({
1064
- ...current,
1065
- debugScaffold: nextDebugScaffold,
1066
- }));
995
+ setPhiBuilderDebugScaffold(nextDebugScaffold);
1067
996
  return;
1068
997
  }
1069
998
  if (addressedHere && signal.channel === "selection" && signal.action === "change") {
@@ -1074,24 +1003,31 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
1074
1003
  }
1075
1004
  let nextNodeKey = next.nodeKey;
1076
1005
  let nextNodeId = readPhiCmsInstanceId(next.nodeId);
1077
- const nextPageKey = typeof next.pageKey === "string" ? next.pageKey : undefined;
1006
+ /*
1007
+ * A selection names the Area and Page its node is on, or the open ones. A node on another Area or
1008
+ * Page is not on the canvas and cannot be selected; opening that Page is the URL's business, not a
1009
+ * selection's. The selection used to write both into the tool store, where the catalog's values
1010
+ * always won, so the node was selected on a Page that was not open.
1011
+ */
1012
+ const openState = getPhiDeveloperBuilderStateSnapshot();
1013
+ if ((typeof next.area === "string" && next.area !== openState.area) ||
1014
+ (typeof next.pageKey === "string" && next.pageKey !== openState.pageKey)) {
1015
+ return;
1016
+ }
1078
1017
  /*
1079
1018
  * A Layout named only by its Region is that Region's root Layout, read from its draft. A sender that
1080
1019
  * cannot know a Site's node ids -- a Tour step showing the Layout Inspector -- names it this way. A
1081
1020
  * Region without a root Layout selects nothing.
1082
1021
  */
1083
1022
  if (next.nodeKind === "layout" && nextNodeId == null && typeof next.regionKey === "string") {
1084
- const current = getPhiDeveloperBuilderStateSnapshot(defaultArea);
1085
- const rootNode = getPhiDeveloperRegionDraftsSnapshot()[getPhiBuilderRegionDraftKey(typeof next.area === "string" ? next.area : current.area, next.regionKey, nextPageKey ?? current.pageKey)]?.rootNode;
1023
+ const rootNode = getPhiDeveloperRegionDraftsSnapshot()[getPhiBuilderRegionDraftKey(openState.area, next.regionKey, openState.pageKey)]?.rootNode;
1086
1024
  if (!rootNode) {
1087
1025
  return;
1088
1026
  }
1089
1027
  nextNodeId = rootNode.id;
1090
1028
  nextNodeKey = rootNode.widgetType;
1091
1029
  }
1092
- selectPhiDeveloperBuilderNode(defaultArea, {
1093
- ...(typeof next.area === "string" ? { area: next.area } : {}),
1094
- ...(nextPageKey ? { pageKey: nextPageKey } : {}),
1030
+ selectPhiDeveloperBuilderNode({
1095
1031
  nodeKey: nextNodeKey,
1096
1032
  nodeId: nextNodeId,
1097
1033
  nodeKind: next.nodeKind,
@@ -1253,7 +1189,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
1253
1189
  return;
1254
1190
  }
1255
1191
  if (addressedHere && signal.channel === "command" && signal.action === "activate" && signal.value === "pagesOpen") {
1256
- builderWorkspaceStore.patch(defaultArea, (current) => ({ ...current, pagesOpen: true }));
1192
+ openPhiBuilderPagesPanel();
1257
1193
  return;
1258
1194
  }
1259
1195
  if (signal.receiver === createPhiBuilderControllerAddress() && signal.channel === "effects") {
@@ -1297,7 +1233,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
1297
1233
  signal.valueSchema === PHI_SIGNAL_VALUE_SCHEMAS.formValues) {
1298
1234
  const submitted = readPhiRuntimeFormValuesSignalValue(signal.value);
1299
1235
  if (submitted)
1300
- patchPhiBuilderSignalWiringSession(defaultArea, submitted.values);
1236
+ patchPhiBuilderSignalWiringSession(submitted.values);
1301
1237
  return;
1302
1238
  }
1303
1239
  if (signal.receiver === createPhiBuilderControllerAddress() &&
@@ -1308,11 +1244,11 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
1308
1244
  if (tableAction?.actionKey !== "delete" || typeof tableAction.rowIdentity !== "string") {
1309
1245
  return;
1310
1246
  }
1311
- const routes = resolvePhiBuilderSignalWiringRoutesWithout(defaultArea, tableAction.rowIdentity);
1247
+ const routes = resolvePhiBuilderSignalWiringRoutesWithout(tableAction.rowIdentity);
1312
1248
  if (!routes)
1313
1249
  return;
1314
- const routeState = getPhiDeveloperBuilderStateSnapshot(defaultArea);
1315
- runPhiDeveloperBuilderInspectorAction(defaultArea, routeState.nodeKind === "layout"
1250
+ const routeState = getPhiDeveloperBuilderStateSnapshot();
1251
+ runPhiDeveloperBuilderInspectorAction(routeState.nodeKind === "layout"
1316
1252
  ? { kind: "patchSelectedLayoutConfig", patch: { signalRoutes: routes } }
1317
1253
  : { kind: "patchSelectedWidgetConfig", patch: { signalRoutes: routes } });
1318
1254
  emitCapability("signalWiringRoutesReload", null, signal.correlationId);
@@ -1338,7 +1274,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
1338
1274
  if (!isCloseRequest) {
1339
1275
  return;
1340
1276
  }
1341
- resetPhiBuilderSignalWiringSession(defaultArea);
1277
+ resetPhiBuilderSignalWiringSession();
1342
1278
  emitCapability("signalWiringReset", null, signal.correlationId);
1343
1279
  emitCapability("signalWiringClose", null, signal.correlationId);
1344
1280
  return;
@@ -1350,15 +1286,15 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
1350
1286
  const submitted = readPhiRuntimeFormValuesSignalValue(signal.value);
1351
1287
  if (!submitted)
1352
1288
  return;
1353
- patchPhiBuilderSignalWiringSession(defaultArea, submitted.values);
1354
- const result = resolvePhiBuilderSignalWiringRoutes(defaultArea);
1289
+ patchPhiBuilderSignalWiringSession(submitted.values);
1290
+ const result = resolvePhiBuilderSignalWiringRoutes();
1355
1291
  if (result.kind !== "applied")
1356
1292
  return;
1357
- const wiringState = getPhiDeveloperBuilderStateSnapshot(defaultArea);
1358
- runPhiDeveloperBuilderInspectorAction(defaultArea, wiringState.nodeKind === "layout"
1293
+ const wiringState = getPhiDeveloperBuilderStateSnapshot();
1294
+ runPhiDeveloperBuilderInspectorAction(wiringState.nodeKind === "layout"
1359
1295
  ? { kind: "patchSelectedLayoutConfig", patch: { signalRoutes: result.routes } }
1360
1296
  : { kind: "patchSelectedWidgetConfig", patch: { signalRoutes: result.routes } });
1361
- resetPhiBuilderSignalWiringSession(defaultArea);
1297
+ resetPhiBuilderSignalWiringSession();
1362
1298
  emitCapability("signalWiringClose", null, signal.correlationId);
1363
1299
  return;
1364
1300
  }
@@ -1425,7 +1361,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
1425
1361
  */
1426
1362
  phiBuilderHistory.endGesture();
1427
1363
  }
1428
- builderWorkspaceStore.patch(defaultArea, (current) => ({ ...current, inspectorOpen: signal.value }));
1364
+ setPhiBuilderInspectorOpen(signal.value);
1429
1365
  return;
1430
1366
  }
1431
1367
  if (signal.channel === "inspector" && signal.action === "change") {
@@ -1436,7 +1372,7 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
1436
1372
  }
1437
1373
  const action = readPhiBuilderInspectorAction(signal.value);
1438
1374
  if (action) {
1439
- runPhiDeveloperBuilderInspectorAction(defaultArea, action);
1375
+ runPhiDeveloperBuilderInspectorAction(action);
1440
1376
  }
1441
1377
  return;
1442
1378
  }
@@ -1484,8 +1420,8 @@ function usePhiDeveloperBuilderWorkspaceController(defaultArea, options) {
1484
1420
  */
1485
1421
  return _jsxs(_Fragment, { children: [pageMetaDialog, confirmDialog] });
1486
1422
  }
1487
- export function PhiDeveloperBuilderWorkspaceController({ defaultArea = "public", shellPresetDraftsByArea = {}, runtimeModuleDefinitions = [], runtimeModuleIdsByArea = {}, modulePresetPagesByArea = EMPTY_MODULE_PRESET_PAGES_BY_AREA, areaPresetSourcesByArea = {}, navigationSurfacesByArea = {}, unresolvedModuleIdsByArea = EMPTY_RUNTIME_MODULE_IDS_BY_AREA, serverUnavailableModules = EMPTY_SERVER_UNAVAILABLE_MODULES, publicRouteClaims = EMPTY_PUBLIC_ROUTE_CLAIMS, publicRoutePaths = EMPTY_PUBLIC_ROUTE_PATHS, areaRootRoutesByArea = EMPTY_AREA_ROOT_ROUTES, areaMetaByArea = EMPTY_AREA_META, areaControllerSettingsByArea = EMPTY_AREA_CONTROLLER_SETTINGS, pageMetaLabels = PHI_BUILDER_PAGE_META_DEFAULT_PRESENTATION_LABELS, historyLabels, signalRoutes = null, }) {
1488
- const controller = usePhiDeveloperBuilderWorkspaceController(defaultArea, {
1423
+ export function PhiDeveloperBuilderWorkspaceController({ shellPresetDraftsByArea = {}, runtimeModuleDefinitions = [], runtimeModuleIdsByArea = {}, modulePresetPagesByArea = EMPTY_MODULE_PRESET_PAGES_BY_AREA, areaPresetSourcesByArea = {}, navigationSurfacesByArea = {}, unresolvedModuleIdsByArea = EMPTY_RUNTIME_MODULE_IDS_BY_AREA, serverUnavailableModules = EMPTY_SERVER_UNAVAILABLE_MODULES, publicRouteClaims = EMPTY_PUBLIC_ROUTE_CLAIMS, publicRoutePaths = EMPTY_PUBLIC_ROUTE_PATHS, areaRootRoutesByArea = EMPTY_AREA_ROOT_ROUTES, areaMetaByArea = EMPTY_AREA_META, areaControllerSettingsByArea = EMPTY_AREA_CONTROLLER_SETTINGS, pageMetaLabels = PHI_BUILDER_PAGE_META_DEFAULT_PRESENTATION_LABELS, historyLabels, signalRoutes = null, }) {
1424
+ const controller = usePhiDeveloperBuilderWorkspaceController({
1489
1425
  shellPresetDraftsByArea,
1490
1426
  runtimeModuleDefinitions,
1491
1427
  runtimeModuleIdsByArea,
@@ -482,6 +482,7 @@ export declare const PHI_BUILDER_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
482
482
  filterFields: string[];
483
483
  sorting: "none";
484
484
  pagination: "offset";
485
+ total: true;
485
486
  };
486
487
  actions: ({
487
488
  key: string;
@@ -412,6 +412,7 @@ export const PHI_BUILDER_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
412
412
  filterFields: ["sessionKey", "direction"],
413
413
  sorting: "none",
414
414
  pagination: "offset",
415
+ total: true,
415
416
  },
416
417
  actions: [
417
418
  { key: "save", title: "Save", scope: "row", valueType: "json" },
@@ -485,6 +485,7 @@ export declare const PHI_BUILDER_RUNTIME_MODULE_DEFINITION: Omit<{
485
485
  filterFields: string[];
486
486
  sorting: "none";
487
487
  pagination: "offset";
488
+ total: true;
488
489
  };
489
490
  actions: ({
490
491
  key: string;