@object-ui/app-shell 6.2.3 → 7.1.0

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 (486) hide show
  1. package/CHANGELOG.md +1229 -0
  2. package/README.md +292 -0
  3. package/dist/assistant/assistantBus.d.ts +72 -0
  4. package/dist/assistant/assistantBus.js +133 -0
  5. package/dist/chrome/CommandPalette.d.ts +1 -1
  6. package/dist/chrome/CommandPalette.js +26 -22
  7. package/dist/chrome/ConditionalAuthWrapper.d.ts +1 -1
  8. package/dist/chrome/ConsoleToaster.d.ts +1 -1
  9. package/dist/chrome/ConsoleToaster.js +3 -1
  10. package/dist/chrome/ErrorBoundary.d.ts +1 -1
  11. package/dist/chrome/KeyboardShortcutsDialog.d.ts +1 -1
  12. package/dist/chrome/KeyboardShortcutsDialog.js +16 -5
  13. package/dist/chrome/LoadingScreen.d.ts +1 -1
  14. package/dist/chrome/LoadingScreen.js +22 -26
  15. package/dist/chrome/RouteFader.d.ts +1 -1
  16. package/dist/chrome/ThemeProvider.d.ts +1 -1
  17. package/dist/components/ManagedByBadge.d.ts +1 -1
  18. package/dist/console/AppContent.d.ts +1 -1
  19. package/dist/console/AppContent.js +184 -39
  20. package/dist/console/ConsoleShell.d.ts +7 -7
  21. package/dist/console/ConsoleShell.js +32 -3
  22. package/dist/console/ai/AiChatPage.d.ts +88 -1
  23. package/dist/console/ai/AiChatPage.js +747 -66
  24. package/dist/console/ai/ConversationsSidebar.d.ts +26 -1
  25. package/dist/console/ai/ConversationsSidebar.js +149 -34
  26. package/dist/console/ai/LiveCanvas.d.ts +28 -0
  27. package/dist/console/ai/LiveCanvas.js +80 -0
  28. package/dist/console/ai/reconcileTurn.d.ts +8 -0
  29. package/dist/console/ai/reconcileTurn.js +20 -0
  30. package/dist/console/auth/AuthPageLayout.d.ts +1 -1
  31. package/dist/console/auth/ForgotPasswordPage.d.ts +1 -1
  32. package/dist/console/auth/LoginPage.d.ts +1 -1
  33. package/dist/console/auth/RegisterPage.d.ts +1 -1
  34. package/dist/console/auth/RegisterPage.js +23 -3
  35. package/dist/console/cloud-connection/CloudConnectionPanel.d.ts +1 -0
  36. package/dist/console/cloud-connection/CloudConnectionPanel.js +169 -0
  37. package/dist/console/home/AppCard.d.ts +1 -1
  38. package/dist/console/home/AppCard.js +6 -12
  39. package/dist/console/home/HomeAppsStrip.d.ts +8 -0
  40. package/dist/console/home/HomeAppsStrip.js +61 -0
  41. package/dist/console/home/HomeLayout.d.ts +1 -1
  42. package/dist/console/home/HomeLayout.js +3 -1
  43. package/dist/console/home/HomePage.d.ts +1 -2
  44. package/dist/console/home/HomePage.js +149 -21
  45. package/dist/console/home/HomeRail.d.ts +22 -0
  46. package/dist/console/home/HomeRail.js +62 -0
  47. package/dist/console/home/QuickActions.d.ts +1 -1
  48. package/dist/console/home/QuickActions.js +3 -11
  49. package/dist/console/home/RecentApps.d.ts +1 -1
  50. package/dist/console/home/RecentApps.js +2 -2
  51. package/dist/console/home/StarredApps.d.ts +1 -1
  52. package/dist/console/home/StarredApps.js +2 -2
  53. package/dist/console/marketplace/InstalledListWidget.d.ts +1 -0
  54. package/dist/console/marketplace/InstalledListWidget.js +93 -0
  55. package/dist/console/marketplace/MarkdownText.d.ts +1 -1
  56. package/dist/console/marketplace/MarketplaceAccessDenied.d.ts +1 -1
  57. package/dist/console/marketplace/MarketplaceInstalledPage.d.ts +8 -14
  58. package/dist/console/marketplace/MarketplaceInstalledPage.js +14 -66
  59. package/dist/console/marketplace/MarketplacePackagePage.d.ts +1 -1
  60. package/dist/console/marketplace/MarketplacePackagePage.js +249 -8
  61. package/dist/console/marketplace/MarketplacePage.d.ts +1 -1
  62. package/dist/console/marketplace/MarketplacePage.js +60 -3
  63. package/dist/console/marketplace/PackageIcon.d.ts +1 -1
  64. package/dist/console/marketplace/PluginDisclosure.d.ts +14 -0
  65. package/dist/console/marketplace/PluginDisclosure.js +38 -0
  66. package/dist/console/marketplace/marketplaceApi.d.ts +123 -0
  67. package/dist/console/marketplace/marketplaceApi.js +254 -1
  68. package/dist/console/organizations/CreateWorkspaceDialog.d.ts +1 -1
  69. package/dist/console/organizations/OrganizationsLayout.d.ts +1 -1
  70. package/dist/console/organizations/OrganizationsPage.d.ts +1 -1
  71. package/dist/console/organizations/manage/AcceptInvitationPage.d.ts +1 -1
  72. package/dist/console/organizations/manage/InvitationsPage.d.ts +1 -1
  73. package/dist/console/organizations/manage/InviteMemberDialog.d.ts +1 -1
  74. package/dist/console/organizations/manage/MembersPage.d.ts +1 -1
  75. package/dist/console/organizations/manage/OrganizationLayout.d.ts +1 -1
  76. package/dist/console/organizations/manage/SettingsPage.d.ts +1 -1
  77. package/dist/context/CommandPaletteProvider.d.ts +44 -0
  78. package/dist/context/CommandPaletteProvider.js +71 -0
  79. package/dist/context/FavoritesProvider.d.ts +1 -1
  80. package/dist/context/NavigationContext.d.ts +1 -1
  81. package/dist/context/RecentItemsProvider.d.ts +2 -2
  82. package/dist/context/UserStateAdapters.d.ts +1 -1
  83. package/dist/context/index.d.ts +2 -0
  84. package/dist/context/index.js +1 -0
  85. package/dist/hooks/index.d.ts +5 -2
  86. package/dist/hooks/index.js +4 -1
  87. package/dist/hooks/useActionModal.d.ts +53 -0
  88. package/dist/hooks/useActionModal.js +111 -0
  89. package/dist/hooks/useChatConversation.d.ts +137 -4
  90. package/dist/hooks/useChatConversation.js +316 -25
  91. package/dist/hooks/useConsoleActionRuntime.d.ts +70 -0
  92. package/dist/hooks/useConsoleActionRuntime.js +564 -0
  93. package/dist/hooks/useConversationList.js +61 -3
  94. package/dist/hooks/useHomeInbox.d.ts +13 -0
  95. package/dist/hooks/useHomeInbox.js +142 -0
  96. package/dist/hooks/useNavPins.js +17 -23
  97. package/dist/hooks/useNavigationSync.d.ts +33 -0
  98. package/dist/hooks/useNavigationSync.js +98 -12
  99. package/dist/hooks/useReconcileOnError.d.ts +40 -0
  100. package/dist/hooks/useReconcileOnError.js +37 -0
  101. package/dist/hooks/useRecordApprovals.d.ts +18 -19
  102. package/dist/hooks/useRecordApprovals.js +24 -40
  103. package/dist/hooks/useResponsiveSidebar.js +14 -5
  104. package/dist/hooks/useSettleSignal.d.ts +19 -0
  105. package/dist/hooks/useSettleSignal.js +20 -0
  106. package/dist/hooks/useTrackRouteAsRecent.js +35 -0
  107. package/dist/hooks/useUrlOverlay.d.ts +62 -0
  108. package/dist/hooks/useUrlOverlay.js +88 -0
  109. package/dist/index.d.ts +18 -8
  110. package/dist/index.js +17 -5
  111. package/dist/layout/ActivityFeed.d.ts +1 -1
  112. package/dist/layout/AppHeader.d.ts +3 -2
  113. package/dist/layout/AppHeader.js +237 -72
  114. package/dist/layout/AppSidebar.d.ts +2 -1
  115. package/dist/layout/AppSidebar.js +26 -46
  116. package/dist/layout/AppSwitcher.d.ts +2 -1
  117. package/dist/layout/AppSwitcher.js +9 -5
  118. package/dist/layout/AuthPageLayout.d.ts +1 -1
  119. package/dist/layout/ConnectionStatus.d.ts +1 -1
  120. package/dist/layout/ConnectionStatus.js +9 -6
  121. package/dist/layout/ConsoleChatbotFab.d.ts +19 -1
  122. package/dist/layout/ConsoleChatbotFab.js +16 -2
  123. package/dist/layout/ConsoleFloatingChatbot.d.ts +34 -2
  124. package/dist/layout/ConsoleFloatingChatbot.js +391 -41
  125. package/dist/layout/ConsoleLayout.d.ts +1 -1
  126. package/dist/layout/ConsoleLayout.js +27 -11
  127. package/dist/layout/ContextSelectors.d.ts +44 -0
  128. package/dist/layout/ContextSelectors.js +242 -0
  129. package/dist/layout/InboxPopover.d.ts +6 -1
  130. package/dist/layout/InboxPopover.js +25 -6
  131. package/dist/layout/LocaleSwitcher.d.ts +1 -1
  132. package/dist/layout/LocalizedSidebarTrigger.d.ts +2 -0
  133. package/dist/layout/LocalizedSidebarTrigger.js +15 -0
  134. package/dist/layout/MobileViewSwitcherContext.d.ts +1 -1
  135. package/dist/layout/ModeToggle.d.ts +1 -1
  136. package/dist/layout/PageHeader.d.ts +1 -1
  137. package/dist/layout/UnifiedSidebar.d.ts +2 -1
  138. package/dist/layout/UnifiedSidebar.js +116 -15
  139. package/dist/layout/agentPicker.d.ts +56 -0
  140. package/dist/layout/agentPicker.js +40 -0
  141. package/dist/observability/index.d.ts +1 -0
  142. package/dist/observability/index.js +1 -0
  143. package/dist/observability/settleSignal.d.ts +64 -0
  144. package/dist/observability/settleSignal.js +131 -0
  145. package/dist/preview/CommitTimeline.d.ts +15 -0
  146. package/dist/preview/CommitTimeline.js +82 -0
  147. package/dist/preview/DraftChangesPanel.d.ts +19 -0
  148. package/dist/preview/DraftChangesPanel.js +114 -0
  149. package/dist/preview/DraftPreviewBar.d.ts +8 -0
  150. package/dist/preview/DraftPreviewBar.js +86 -0
  151. package/dist/preview/PreviewDraftEmptyState.d.ts +16 -0
  152. package/dist/preview/PreviewDraftEmptyState.js +47 -0
  153. package/dist/preview/PreviewModeContext.d.ts +57 -0
  154. package/dist/preview/PreviewModeContext.js +99 -0
  155. package/dist/preview/UnpublishedAppBar.d.ts +8 -0
  156. package/dist/preview/UnpublishedAppBar.js +83 -0
  157. package/dist/preview/commitHistory.d.ts +28 -0
  158. package/dist/preview/commitHistory.js +48 -0
  159. package/dist/preview/draftStatus.d.ts +20 -0
  160. package/dist/preview/draftStatus.js +27 -0
  161. package/dist/preview/usePublishAllDrafts.d.ts +18 -0
  162. package/dist/preview/usePublishAllDrafts.js +106 -0
  163. package/dist/providers/AdapterProvider.d.ts +1 -1
  164. package/dist/providers/AdapterProvider.js +6 -1
  165. package/dist/providers/ExpressionProvider.d.ts +1 -1
  166. package/dist/providers/MetadataProvider.d.ts +17 -2
  167. package/dist/providers/MetadataProvider.js +192 -12
  168. package/dist/runtime-config.d.ts +46 -2
  169. package/dist/runtime-config.js +39 -2
  170. package/dist/services/builtinComponents.js +68 -59
  171. package/dist/skeletons/SkeletonDashboard.d.ts +1 -1
  172. package/dist/skeletons/SkeletonDetail.d.ts +1 -1
  173. package/dist/skeletons/SkeletonGrid.d.ts +1 -1
  174. package/dist/utils/appRoute.d.ts +21 -0
  175. package/dist/utils/appRoute.js +25 -0
  176. package/dist/utils/deriveRelatedLists.d.ts +54 -0
  177. package/dist/utils/deriveRelatedLists.js +91 -0
  178. package/dist/utils/index.d.ts +4 -0
  179. package/dist/utils/index.js +3 -0
  180. package/dist/utils/managedByEmptyState.d.ts +8 -1
  181. package/dist/utils/managedByEmptyState.js +13 -7
  182. package/dist/utils/preferLocal.d.ts +18 -0
  183. package/dist/utils/preferLocal.js +24 -0
  184. package/dist/views/ActionConfirmDialog.d.ts +1 -1
  185. package/dist/views/ActionConfirmDialog.js +3 -1
  186. package/dist/views/ActionParamDialog.d.ts +6 -1
  187. package/dist/views/ActionParamDialog.js +9 -3
  188. package/dist/views/ActionResultDialog.d.ts +13 -0
  189. package/dist/views/ActionResultDialog.js +134 -0
  190. package/dist/views/ComponentNavView.d.ts +14 -1
  191. package/dist/views/CreateViewDialog.d.ts +1 -1
  192. package/dist/views/DashboardConfigPanel.d.ts +28 -0
  193. package/dist/views/DashboardConfigPanel.js +81 -0
  194. package/dist/views/DashboardView.d.ts +4 -3
  195. package/dist/views/DashboardView.js +38 -239
  196. package/dist/views/FlowRunner.d.ts +31 -0
  197. package/dist/views/FlowRunner.js +121 -0
  198. package/dist/views/InterfaceListPage.d.ts +49 -0
  199. package/dist/views/InterfaceListPage.js +347 -0
  200. package/dist/views/MetadataInspector.d.ts +2 -2
  201. package/dist/views/ObjectView.d.ts +1 -1
  202. package/dist/views/ObjectView.js +209 -532
  203. package/dist/views/PageView.d.ts +8 -3
  204. package/dist/views/PageView.js +45 -32
  205. package/dist/views/RecordDetailView.d.ts +1 -1
  206. package/dist/views/RecordDetailView.js +363 -148
  207. package/dist/views/RecordFormPage.d.ts +1 -1
  208. package/dist/views/RecordFormPage.js +26 -1
  209. package/dist/views/ReportConfigPanel.d.ts +37 -0
  210. package/dist/views/ReportConfigPanel.js +85 -0
  211. package/dist/views/ReportView.d.ts +1 -1
  212. package/dist/views/ReportView.js +116 -7
  213. package/dist/views/RuntimeDraftBar.d.ts +30 -0
  214. package/dist/views/RuntimeDraftBar.js +112 -0
  215. package/dist/views/ScreenView.d.ts +70 -0
  216. package/dist/views/ScreenView.js +73 -0
  217. package/dist/views/SearchResultsPage.d.ts +1 -1
  218. package/dist/views/SearchResultsPage.js +8 -18
  219. package/dist/views/ViewConfigPanel.d.ts +24 -17
  220. package/dist/views/ViewConfigPanel.js +121 -77
  221. package/dist/views/index.d.ts +1 -1
  222. package/dist/views/index.js +1 -1
  223. package/dist/views/metadata-admin/AuditPanel.d.ts +28 -0
  224. package/dist/views/metadata-admin/AuditPanel.js +79 -0
  225. package/dist/views/metadata-admin/DiagnosticsPage.d.ts +20 -0
  226. package/dist/views/metadata-admin/DiagnosticsPage.js +69 -0
  227. package/dist/views/metadata-admin/DirectoryPage.d.ts +16 -1
  228. package/dist/views/metadata-admin/DirectoryPage.js +101 -24
  229. package/dist/views/metadata-admin/DraftReviewPanel.d.ts +33 -0
  230. package/dist/views/metadata-admin/DraftReviewPanel.js +77 -0
  231. package/dist/views/metadata-admin/EmbeddedItemEditor.d.ts +17 -1
  232. package/dist/views/metadata-admin/EmbeddedItemEditor.js +15 -8
  233. package/dist/views/metadata-admin/JsonSourceEditor.d.ts +39 -0
  234. package/dist/views/metadata-admin/JsonSourceEditor.js +196 -0
  235. package/dist/views/metadata-admin/LayeredDiff.d.ts +39 -1
  236. package/dist/views/metadata-admin/LayeredDiff.js +171 -5
  237. package/dist/views/metadata-admin/MetadataDetailDrawer.d.ts +15 -1
  238. package/dist/views/metadata-admin/MetadataTypeActions.d.ts +48 -0
  239. package/dist/views/metadata-admin/MetadataTypeActions.js +165 -0
  240. package/dist/views/metadata-admin/PackagesPage.d.ts +18 -0
  241. package/dist/views/metadata-admin/PackagesPage.js +403 -0
  242. package/dist/views/metadata-admin/PageShell.d.ts +1 -1
  243. package/dist/views/metadata-admin/PageShell.js +9 -4
  244. package/dist/views/metadata-admin/PermissionMatrixEditor.d.ts +35 -1
  245. package/dist/views/metadata-admin/QuickFind.d.ts +21 -1
  246. package/dist/views/metadata-admin/QuickFind.js +6 -3
  247. package/dist/views/metadata-admin/RelatedPanel.d.ts +24 -1
  248. package/dist/views/metadata-admin/RelatedPanel.js +20 -18
  249. package/dist/views/metadata-admin/ResourceEditPage.d.ts +40 -1
  250. package/dist/views/metadata-admin/ResourceEditPage.js +1250 -60
  251. package/dist/views/metadata-admin/ResourceHistoryPage.d.ts +39 -1
  252. package/dist/views/metadata-admin/ResourceHistoryPage.js +66 -16
  253. package/dist/views/metadata-admin/ResourceListPage.d.ts +13 -1
  254. package/dist/views/metadata-admin/ResourceListPage.js +258 -30
  255. package/dist/views/metadata-admin/ResourceRouter.d.ts +23 -1
  256. package/dist/views/metadata-admin/SchemaForm.d.ts +34 -1
  257. package/dist/views/metadata-admin/SchemaForm.js +559 -49
  258. package/dist/views/metadata-admin/StudioHomePage.d.ts +22 -0
  259. package/dist/views/metadata-admin/StudioHomePage.js +205 -0
  260. package/dist/views/metadata-admin/anchors.js +255 -24
  261. package/dist/views/metadata-admin/clientValidation.d.ts +50 -0
  262. package/dist/views/metadata-admin/clientValidation.js +169 -0
  263. package/dist/views/metadata-admin/color-variant-field.d.ts +30 -0
  264. package/dist/views/metadata-admin/color-variant-field.js +38 -0
  265. package/dist/views/metadata-admin/createDerive.d.ts +75 -0
  266. package/dist/views/metadata-admin/createDerive.js +179 -0
  267. package/dist/views/metadata-admin/dashboard-schema.d.ts +12 -0
  268. package/dist/views/metadata-admin/dashboard-schema.js +80 -0
  269. package/dist/views/metadata-admin/datasource/DatasourceResourcePage.d.ts +35 -0
  270. package/dist/views/metadata-admin/datasource/DatasourceResourcePage.js +327 -0
  271. package/dist/views/metadata-admin/datasource/register.d.ts +1 -0
  272. package/dist/views/metadata-admin/datasource/register.js +24 -0
  273. package/dist/views/metadata-admin/default-inspector-registry.d.ts +49 -0
  274. package/dist/views/metadata-admin/default-inspector-registry.js +8 -0
  275. package/dist/views/metadata-admin/default-schemas.js +115 -10
  276. package/dist/views/metadata-admin/external/ExternalDatasourcePanel.d.ts +27 -0
  277. package/dist/views/metadata-admin/external/ExternalDatasourcePanel.js +69 -0
  278. package/dist/views/metadata-admin/external/ImportObjectDialog.d.ts +27 -0
  279. package/dist/views/metadata-admin/external/ImportObjectDialog.js +77 -0
  280. package/dist/views/metadata-admin/external/SchemaBrowser.d.ts +16 -0
  281. package/dist/views/metadata-admin/external/SchemaBrowser.js +74 -0
  282. package/dist/views/metadata-admin/external/ValidationPanel.d.ts +16 -0
  283. package/dist/views/metadata-admin/external/ValidationPanel.js +68 -0
  284. package/dist/views/metadata-admin/external/api.d.ts +100 -0
  285. package/dist/views/metadata-admin/external/api.js +124 -0
  286. package/dist/views/metadata-admin/i18n.d.ts +1 -0
  287. package/dist/views/metadata-admin/i18n.js +1252 -2
  288. package/dist/views/metadata-admin/index.d.ts +8 -5
  289. package/dist/views/metadata-admin/index.js +12 -2
  290. package/dist/views/metadata-admin/inspector-registry.d.ts +51 -0
  291. package/dist/views/metadata-admin/inspector-registry.js +11 -0
  292. package/dist/views/metadata-admin/inspectors/ActionDefaultInspector.d.ts +30 -0
  293. package/dist/views/metadata-admin/inspectors/ActionDefaultInspector.js +180 -0
  294. package/dist/views/metadata-admin/inspectors/AppNavInspector.d.ts +16 -0
  295. package/dist/views/metadata-admin/inspectors/AppNavInspector.js +110 -0
  296. package/dist/views/metadata-admin/inspectors/ConditionBuilder.d.ts +29 -0
  297. package/dist/views/metadata-admin/inspectors/ConditionBuilder.js +154 -0
  298. package/dist/views/metadata-admin/inspectors/DashboardDefaultInspector.d.ts +28 -0
  299. package/dist/views/metadata-admin/inspectors/DashboardDefaultInspector.js +110 -0
  300. package/dist/views/metadata-admin/inspectors/DashboardWidgetInspector.d.ts +18 -0
  301. package/dist/views/metadata-admin/inspectors/DashboardWidgetInspector.js +139 -0
  302. package/dist/views/metadata-admin/inspectors/DatasetDefaultInspector.d.ts +21 -0
  303. package/dist/views/metadata-admin/inspectors/DatasetDefaultInspector.js +221 -0
  304. package/dist/views/metadata-admin/inspectors/FlowEdgeInspector.d.ts +16 -0
  305. package/dist/views/metadata-admin/inspectors/FlowEdgeInspector.js +126 -0
  306. package/dist/views/metadata-admin/inspectors/FlowInspector.d.ts +12 -0
  307. package/dist/views/metadata-admin/inspectors/FlowInspector.js +9 -0
  308. package/dist/views/metadata-admin/inspectors/FlowKeyValueField.d.ts +30 -0
  309. package/dist/views/metadata-admin/inspectors/FlowKeyValueField.js +125 -0
  310. package/dist/views/metadata-admin/inspectors/FlowNodeConfigField.d.ts +18 -0
  311. package/dist/views/metadata-admin/inspectors/FlowNodeConfigField.js +40 -0
  312. package/dist/views/metadata-admin/inspectors/FlowNodeInspector.d.ts +14 -0
  313. package/dist/views/metadata-admin/inspectors/FlowNodeInspector.js +205 -0
  314. package/dist/views/metadata-admin/inspectors/FlowObjectListField.d.ts +26 -0
  315. package/dist/views/metadata-admin/inspectors/FlowObjectListField.js +105 -0
  316. package/dist/views/metadata-admin/inspectors/FlowReferenceField.d.ts +83 -0
  317. package/dist/views/metadata-admin/inspectors/FlowReferenceField.js +181 -0
  318. package/dist/views/metadata-admin/inspectors/FlowStringListField.d.ts +21 -0
  319. package/dist/views/metadata-admin/inspectors/FlowStringListField.js +60 -0
  320. package/dist/views/metadata-admin/inspectors/InspectorComboField.d.ts +40 -0
  321. package/dist/views/metadata-admin/inspectors/InspectorComboField.js +61 -0
  322. package/dist/views/metadata-admin/inspectors/ObjectDefaultInspector.d.ts +21 -0
  323. package/dist/views/metadata-admin/inspectors/ObjectDefaultInspector.js +55 -0
  324. package/dist/views/metadata-admin/inspectors/ObjectFieldInspector.d.ts +23 -0
  325. package/dist/views/metadata-admin/inspectors/ObjectFieldInspector.js +365 -0
  326. package/dist/views/metadata-admin/inspectors/PageBlockInspector.d.ts +48 -0
  327. package/dist/views/metadata-admin/inspectors/PageBlockInspector.js +332 -0
  328. package/dist/views/metadata-admin/inspectors/ReportDefaultInspector.d.ts +58 -0
  329. package/dist/views/metadata-admin/inspectors/ReportDefaultInspector.js +218 -0
  330. package/dist/views/metadata-admin/inspectors/ViewColumnInspector.d.ts +19 -0
  331. package/dist/views/metadata-admin/inspectors/ViewColumnInspector.js +144 -0
  332. package/dist/views/metadata-admin/inspectors/ViewInspector.d.ts +19 -0
  333. package/dist/views/metadata-admin/inspectors/ViewInspector.js +21 -0
  334. package/dist/views/metadata-admin/inspectors/ViewVariantInspector.d.ts +54 -0
  335. package/dist/views/metadata-admin/inspectors/ViewVariantInspector.js +191 -0
  336. package/dist/views/metadata-admin/inspectors/_shared.d.ts +128 -0
  337. package/dist/views/metadata-admin/inspectors/_shared.js +113 -0
  338. package/dist/views/metadata-admin/inspectors/datasetFilterCondition.d.ts +24 -0
  339. package/dist/views/metadata-admin/inspectors/datasetFilterCondition.js +97 -0
  340. package/dist/views/metadata-admin/inspectors/expression-validate.d.ts +26 -0
  341. package/dist/views/metadata-admin/inspectors/expression-validate.js +66 -0
  342. package/dist/views/metadata-admin/inspectors/flow-node-config.d.ts +143 -0
  343. package/dist/views/metadata-admin/inspectors/flow-node-config.js +506 -0
  344. package/dist/views/metadata-admin/inspectors/index.d.ts +1 -0
  345. package/dist/views/metadata-admin/inspectors/index.js +45 -0
  346. package/dist/views/metadata-admin/inspectors/json-schema-to-fields.d.ts +40 -0
  347. package/dist/views/metadata-admin/inspectors/json-schema-to-fields.js +227 -0
  348. package/dist/views/metadata-admin/inspectors/useDatasetFields.d.ts +72 -0
  349. package/dist/views/metadata-admin/inspectors/useDatasetFields.js +0 -0
  350. package/dist/views/metadata-admin/issuePath.d.ts +22 -0
  351. package/dist/views/metadata-admin/issuePath.js +65 -0
  352. package/dist/views/metadata-admin/mergeServerFields.d.ts +65 -0
  353. package/dist/views/metadata-admin/mergeServerFields.js +56 -0
  354. package/dist/views/metadata-admin/package-scope.d.ts +26 -0
  355. package/dist/views/metadata-admin/package-scope.js +43 -0
  356. package/dist/views/metadata-admin/preview-registry.d.ts +55 -0
  357. package/dist/views/metadata-admin/previews/ActionPreview.d.ts +25 -0
  358. package/dist/views/metadata-admin/previews/ActionPreview.js +238 -0
  359. package/dist/views/metadata-admin/previews/AddWidgetPicker.d.ts +12 -0
  360. package/dist/views/metadata-admin/previews/AddWidgetPicker.js +56 -0
  361. package/dist/views/metadata-admin/previews/AgentPreview.d.ts +24 -0
  362. package/dist/views/metadata-admin/previews/AgentPreview.js +100 -0
  363. package/dist/views/metadata-admin/previews/AppNavCanvas.d.ts +31 -0
  364. package/dist/views/metadata-admin/previews/AppNavCanvas.js +260 -0
  365. package/dist/views/metadata-admin/previews/AppPreview.d.ts +16 -1
  366. package/dist/views/metadata-admin/previews/AppPreview.js +23 -14
  367. package/dist/views/metadata-admin/previews/BookPreview.d.ts +20 -0
  368. package/dist/views/metadata-admin/previews/BookPreview.js +132 -0
  369. package/dist/views/metadata-admin/previews/DashboardPreview.d.ts +16 -1
  370. package/dist/views/metadata-admin/previews/DashboardPreview.js +110 -8
  371. package/dist/views/metadata-admin/previews/DatasetPreview.d.ts +18 -0
  372. package/dist/views/metadata-admin/previews/DatasetPreview.js +105 -0
  373. package/dist/views/metadata-admin/previews/DatasourcePreview.d.ts +23 -0
  374. package/dist/views/metadata-admin/previews/DatasourcePreview.js +68 -0
  375. package/dist/views/metadata-admin/previews/EmailTemplatePreview.d.ts +14 -1
  376. package/dist/views/metadata-admin/previews/FieldStub.d.ts +30 -0
  377. package/dist/views/metadata-admin/previews/FieldStub.js +104 -0
  378. package/dist/views/metadata-admin/previews/FieldsListEditor.d.ts +50 -0
  379. package/dist/views/metadata-admin/previews/FieldsListEditor.js +97 -0
  380. package/dist/views/metadata-admin/previews/FlowCanvas.d.ts +49 -0
  381. package/dist/views/metadata-admin/previews/FlowCanvas.js +416 -0
  382. package/dist/views/metadata-admin/previews/FlowPreview.d.ts +20 -0
  383. package/dist/views/metadata-admin/previews/FlowPreview.js +120 -0
  384. package/dist/views/metadata-admin/previews/FlowRunsPanel.d.ts +46 -0
  385. package/dist/views/metadata-admin/previews/FlowRunsPanel.js +97 -0
  386. package/dist/views/metadata-admin/previews/FlowSimulatorPanel.d.ts +25 -0
  387. package/dist/views/metadata-admin/previews/FlowSimulatorPanel.js +204 -0
  388. package/dist/views/metadata-admin/previews/JobPreview.d.ts +28 -0
  389. package/dist/views/metadata-admin/previews/JobPreview.js +290 -0
  390. package/dist/views/metadata-admin/previews/ObjectFormCanvas.d.ts +30 -0
  391. package/dist/views/metadata-admin/previews/ObjectFormCanvas.js +547 -0
  392. package/dist/views/metadata-admin/previews/ObjectPreview.d.ts +14 -1
  393. package/dist/views/metadata-admin/previews/ObjectPreview.js +5 -30
  394. package/dist/views/metadata-admin/previews/OutlineStrip.d.ts +32 -0
  395. package/dist/views/metadata-admin/previews/OutlineStrip.js +8 -0
  396. package/dist/views/metadata-admin/previews/PageBlockCanvas.d.ts +49 -0
  397. package/dist/views/metadata-admin/previews/PageBlockCanvas.js +510 -0
  398. package/dist/views/metadata-admin/previews/PagePreview.d.ts +10 -1
  399. package/dist/views/metadata-admin/previews/PagePreview.js +200 -5
  400. package/dist/views/metadata-admin/previews/PermissionPreview.d.ts +27 -0
  401. package/dist/views/metadata-admin/previews/PermissionPreview.js +115 -0
  402. package/dist/views/metadata-admin/previews/PreviewShell.d.ts +29 -6
  403. package/dist/views/metadata-admin/previews/PreviewShell.js +16 -3
  404. package/dist/views/metadata-admin/previews/ReportPreview.d.ts +18 -1
  405. package/dist/views/metadata-admin/previews/ReportPreview.js +23 -15
  406. package/dist/views/metadata-admin/previews/RolePreview.d.ts +19 -0
  407. package/dist/views/metadata-admin/previews/RolePreview.js +14 -0
  408. package/dist/views/metadata-admin/previews/ScreenPreview.d.ts +38 -0
  409. package/dist/views/metadata-admin/previews/ScreenPreview.js +61 -0
  410. package/dist/views/metadata-admin/previews/SkillPreview.d.ts +22 -0
  411. package/dist/views/metadata-admin/previews/SkillPreview.js +34 -0
  412. package/dist/views/metadata-admin/previews/ToolPreview.d.ts +25 -0
  413. package/dist/views/metadata-admin/previews/ToolPreview.js +122 -0
  414. package/dist/views/metadata-admin/previews/TranslationPreview.d.ts +25 -0
  415. package/dist/views/metadata-admin/previews/TranslationPreview.js +52 -0
  416. package/dist/views/metadata-admin/previews/ValidationPreview.d.ts +27 -0
  417. package/dist/views/metadata-admin/previews/ValidationPreview.js +110 -0
  418. package/dist/views/metadata-admin/previews/ViewColumnPanes.d.ts +62 -0
  419. package/dist/views/metadata-admin/previews/ViewColumnPanes.js +140 -0
  420. package/dist/views/metadata-admin/previews/ViewPreview.d.ts +23 -1
  421. package/dist/views/metadata-admin/previews/ViewPreview.js +101 -73
  422. package/dist/views/metadata-admin/previews/block-config.d.ts +82 -0
  423. package/dist/views/metadata-admin/previews/block-config.js +324 -0
  424. package/dist/views/metadata-admin/previews/block-types.d.ts +40 -0
  425. package/dist/views/metadata-admin/previews/block-types.js +110 -0
  426. package/dist/views/metadata-admin/previews/field-types.d.ts +53 -0
  427. package/dist/views/metadata-admin/previews/field-types.js +97 -0
  428. package/dist/views/metadata-admin/previews/flow-canvas-layout.d.ts +102 -0
  429. package/dist/views/metadata-admin/previews/flow-canvas-layout.js +227 -0
  430. package/dist/views/metadata-admin/previews/flow-canvas-parts.d.ts +96 -0
  431. package/dist/views/metadata-admin/previews/flow-canvas-parts.js +373 -0
  432. package/dist/views/metadata-admin/previews/form-preview.d.ts +24 -0
  433. package/dist/views/metadata-admin/previews/form-preview.js +29 -0
  434. package/dist/views/metadata-admin/previews/index.js +43 -0
  435. package/dist/views/metadata-admin/previews/object-fields-bridge.d.ts +66 -0
  436. package/dist/views/metadata-admin/previews/object-fields-bridge.js +171 -0
  437. package/dist/views/metadata-admin/previews/object-fields-io.d.ts +130 -0
  438. package/dist/views/metadata-admin/previews/object-fields-io.js +243 -0
  439. package/dist/views/metadata-admin/previews/screen-spec.d.ts +43 -0
  440. package/dist/views/metadata-admin/previews/screen-spec.js +108 -0
  441. package/dist/views/metadata-admin/previews/simulator/flow-sim-types.d.ts +102 -0
  442. package/dist/views/metadata-admin/previews/simulator/flow-sim-types.js +2 -0
  443. package/dist/views/metadata-admin/previews/simulator/flow-sim-validate.d.ts +15 -0
  444. package/dist/views/metadata-admin/previews/simulator/flow-sim-validate.js +185 -0
  445. package/dist/views/metadata-admin/previews/simulator/flow-simulator.d.ts +73 -0
  446. package/dist/views/metadata-admin/previews/simulator/flow-simulator.js +426 -0
  447. package/dist/views/metadata-admin/previews/useDatasetCatalog.d.ts +47 -0
  448. package/dist/views/metadata-admin/previews/useDatasetCatalog.js +133 -0
  449. package/dist/views/metadata-admin/previews/useFlowNodePalette.d.ts +44 -0
  450. package/dist/views/metadata-admin/previews/useFlowNodePalette.js +124 -0
  451. package/dist/views/metadata-admin/previews/useMetaOptions.d.ts +8 -0
  452. package/dist/views/metadata-admin/previews/useMetaOptions.js +50 -0
  453. package/dist/views/metadata-admin/previews/useObjectFields.d.ts +23 -0
  454. package/dist/views/metadata-admin/previews/useObjectFields.js +79 -0
  455. package/dist/views/metadata-admin/previews/useObjectOptions.d.ts +8 -0
  456. package/dist/views/metadata-admin/previews/useObjectOptions.js +43 -0
  457. package/dist/views/metadata-admin/previews/view-column-io.d.ts +42 -0
  458. package/dist/views/metadata-admin/previews/view-column-io.js +73 -0
  459. package/dist/views/metadata-admin/previews/widget-types.d.ts +24 -0
  460. package/dist/views/metadata-admin/previews/widget-types.js +40 -0
  461. package/dist/views/metadata-admin/registry.d.ts +140 -19
  462. package/dist/views/metadata-admin/report-schema.d.ts +26 -0
  463. package/dist/views/metadata-admin/report-schema.js +121 -0
  464. package/dist/views/metadata-admin/useMetadata.d.ts +100 -2
  465. package/dist/views/metadata-admin/useMetadata.js +155 -4
  466. package/dist/views/metadata-admin/view-item-normalize.d.ts +20 -0
  467. package/dist/views/metadata-admin/view-item-normalize.js +68 -0
  468. package/dist/views/metadata-admin/view-schema.d.ts +16 -0
  469. package/dist/views/metadata-admin/view-schema.js +107 -0
  470. package/dist/views/metadata-admin/view-variant-model.d.ts +23 -0
  471. package/dist/views/metadata-admin/view-variant-model.js +64 -0
  472. package/dist/views/metadata-admin/widgets.d.ts +89 -1
  473. package/dist/views/metadata-admin/widgets.js +491 -17
  474. package/dist/views/runtime-metadata-persistence.d.ts +78 -0
  475. package/dist/views/runtime-metadata-persistence.js +89 -0
  476. package/dist/views/useOpenRecordList.d.ts +18 -0
  477. package/dist/views/useOpenRecordList.js +36 -0
  478. package/dist/views/userFilterUrlState.d.ts +15 -0
  479. package/dist/views/userFilterUrlState.js +53 -0
  480. package/dist/views/view-config-adapter.d.ts +38 -0
  481. package/dist/views/view-config-adapter.js +80 -0
  482. package/package.json +52 -34
  483. package/dist/views/DesignDrawer.d.ts +0 -28
  484. package/dist/views/DesignDrawer.js +0 -51
  485. package/dist/views/metadata-admin/DesignerEditorWrapper.d.ts +0 -68
  486. package/dist/views/metadata-admin/DesignerEditorWrapper.js +0 -158
@@ -0,0 +1,102 @@
1
+ /**
2
+ * flow-canvas-layout — pure, dependency-free geometry + graph helpers for
3
+ * the visual flow designer canvas (`FlowCanvas.tsx`).
4
+ *
5
+ * Kept separate from the React component so the layout math stays easy to
6
+ * reason about (and unit-test) without pulling in any rendering concerns.
7
+ *
8
+ * Coordinate system: top-to-bottom flowchart (mirrors Power Automate /
9
+ * Salesforce Flow Builder). Origin is the top-left of the diagram bounding
10
+ * box after normalization, so every node sits at x >= PADDING, y >= PADDING.
11
+ */
12
+ export interface FlowNodeUI {
13
+ x?: number;
14
+ y?: number;
15
+ }
16
+ export interface FlowNode {
17
+ id: string;
18
+ type: string;
19
+ label?: string;
20
+ config?: Record<string, unknown>;
21
+ /** UI-only layout hint persisted via onPatch; ignored by the runtime. */
22
+ ui?: FlowNodeUI;
23
+ [k: string]: unknown;
24
+ }
25
+ export interface FlowEdge {
26
+ id?: string;
27
+ source: string;
28
+ target: string;
29
+ condition?: string | {
30
+ source?: string;
31
+ };
32
+ type?: string;
33
+ label?: string;
34
+ isDefault?: boolean;
35
+ }
36
+ export interface Point {
37
+ x: number;
38
+ y: number;
39
+ }
40
+ export declare const NODE_W = 240;
41
+ export declare const NODE_H = 66;
42
+ export declare const H_GAP = 44;
43
+ export declare const V_GAP = 56;
44
+ export declare const PADDING = 28;
45
+ /** A node carries a persisted manual position when both x and y are finite. */
46
+ export declare function hasManualPosition(node: FlowNode): boolean;
47
+ /**
48
+ * Compute a deterministic layered (top-to-bottom) layout.
49
+ *
50
+ * - Edges with a dangling endpoint are ignored for layering.
51
+ * - Layer assignment is a cycle-guarded longest-path relaxation: a node sits
52
+ * one layer below its deepest predecessor. Roots (the `start` node, else
53
+ * nodes with no incoming edge, else the first node) seed layer 0.
54
+ * - Nodes never reached from a root are dropped into a trailing layer so the
55
+ * author still sees them.
56
+ * - Within a layer, nodes keep their original `nodes[]` order (stable).
57
+ * - A node with a persisted `ui` position overrides its computed slot, but is
58
+ * still included in the returned map so callers can size the canvas.
59
+ */
60
+ export declare function computeLayout(nodes: FlowNode[], edges: FlowEdge[]): Map<string, Point>;
61
+ /** Bounding box of the laid-out diagram, including node extents + padding. */
62
+ export declare function diagramSize(positions: Map<string, Point>): {
63
+ width: number;
64
+ height: number;
65
+ };
66
+ /** Bottom-center anchor of a node — where its outgoing edges originate. */
67
+ export declare function bottomAnchor(p: Point): Point;
68
+ /** Top-center anchor of a node — where its incoming edges terminate. */
69
+ export declare function topAnchor(p: Point): Point;
70
+ /**
71
+ * Smooth vertical cubic-bezier path between two anchors. Control points are
72
+ * pulled along the vertical axis so the curve reads as a top-down flow even
73
+ * when the target sits above or beside the source.
74
+ */
75
+ export declare function edgePath(from: Point, to: Point): string;
76
+ /** Midpoint of an edge — anchor for the condition label + insert affordance. */
77
+ export declare function edgeMidpoint(from: Point, to: Point): Point;
78
+ /** True for an ADR-0044 declared back-edge (a revise/rework loop's return). */
79
+ export declare function isBackEdge(edge: Pick<FlowEdge, 'type'>): boolean;
80
+ /** Right-center anchor of a node — where a back-edge's return arc attaches. */
81
+ export declare function rightAnchor(p: Point): Point;
82
+ /**
83
+ * Curved return path for a declared back-edge (ADR-0044 revise loop). Unlike a
84
+ * forward edge (top→bottom), a back-edge re-enters an earlier node, so we route
85
+ * it off the right side of both endpoints and bow it out to the right — a
86
+ * distinct return arc that reads as "loop back" rather than crossing the
87
+ * top-to-bottom forward edges.
88
+ */
89
+ export declare function backEdgePath(from: Point, to: Point): string;
90
+ /** Anchor for a back-edge's label pill — the apex of its return arc. */
91
+ export declare function backEdgeLabelAnchor(from: Point, to: Point): Point;
92
+ /**
93
+ * Stable identity for an edge. Prefers an explicit `edge.id`; otherwise falls
94
+ * back to a `source->target#index` composite so an unsaved edge still has a
95
+ * deterministic key. Used for selection, traversal highlighting, and inspector
96
+ * lookup — all of which read the same `draft.edges` array, so the index is
97
+ * consistent across them. Editing label/condition/isDefault never changes the
98
+ * key (source/target/index are untouched), so a selection survives edits.
99
+ */
100
+ export declare function edgeKey(edge: FlowEdge, index: number): string;
101
+ /** Human-readable condition text for an edge's optional guard. */
102
+ export declare function conditionText(c: FlowEdge['condition']): string | undefined;
@@ -0,0 +1,227 @@
1
+ // Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
2
+ // Node card + spacing geometry. Written as plain numbers so both the layout
3
+ // pass and the SVG edge router share one source of truth.
4
+ export const NODE_W = 240;
5
+ export const NODE_H = 66;
6
+ export const H_GAP = 44;
7
+ export const V_GAP = 56;
8
+ export const PADDING = 28;
9
+ /** True when a value is a usable, finite coordinate. */
10
+ function isFiniteNum(v) {
11
+ return typeof v === 'number' && Number.isFinite(v);
12
+ }
13
+ /** A node carries a persisted manual position when both x and y are finite. */
14
+ export function hasManualPosition(node) {
15
+ return isFiniteNum(node.ui?.x) && isFiniteNum(node.ui?.y);
16
+ }
17
+ /**
18
+ * Compute a deterministic layered (top-to-bottom) layout.
19
+ *
20
+ * - Edges with a dangling endpoint are ignored for layering.
21
+ * - Layer assignment is a cycle-guarded longest-path relaxation: a node sits
22
+ * one layer below its deepest predecessor. Roots (the `start` node, else
23
+ * nodes with no incoming edge, else the first node) seed layer 0.
24
+ * - Nodes never reached from a root are dropped into a trailing layer so the
25
+ * author still sees them.
26
+ * - Within a layer, nodes keep their original `nodes[]` order (stable).
27
+ * - A node with a persisted `ui` position overrides its computed slot, but is
28
+ * still included in the returned map so callers can size the canvas.
29
+ */
30
+ export function computeLayout(nodes, edges) {
31
+ const positions = new Map();
32
+ if (nodes.length === 0)
33
+ return positions;
34
+ const byId = new Map(nodes.map((n) => [n.id, n]));
35
+ const indexOf = new Map(nodes.map((n, i) => [n.id, i]));
36
+ const outAdj = new Map();
37
+ const incoming = new Map();
38
+ for (const n of nodes)
39
+ incoming.set(n.id, 0);
40
+ for (const e of edges) {
41
+ if (!byId.has(e.source) || !byId.has(e.target) || e.source === e.target)
42
+ continue;
43
+ // ADR-0044: a declared back-edge (`type: 'back'`) re-enters an earlier node
44
+ // to close a revise loop. Exclude it from layering — exactly as the engine
45
+ // excludes it from DAG validation — so the loop doesn't drag its target
46
+ // node below the wait point. The edge is still drawn (as a return arc).
47
+ if (isBackEdge(e))
48
+ continue;
49
+ if (!outAdj.has(e.source))
50
+ outAdj.set(e.source, []);
51
+ outAdj.get(e.source).push(e.target);
52
+ incoming.set(e.target, (incoming.get(e.target) ?? 0) + 1);
53
+ }
54
+ // Seed roots: explicit start nodes, then any node with no incoming edge,
55
+ // finally the first node as a last resort (handles pure cycles).
56
+ const roots = [];
57
+ for (const n of nodes)
58
+ if (n.type === 'start')
59
+ roots.push(n.id);
60
+ for (const n of nodes)
61
+ if ((incoming.get(n.id) ?? 0) === 0 && !roots.includes(n.id))
62
+ roots.push(n.id);
63
+ if (roots.length === 0)
64
+ roots.push(nodes[0].id);
65
+ const layer = new Map();
66
+ const queue = [];
67
+ for (const r of roots) {
68
+ layer.set(r, 0);
69
+ queue.push(r);
70
+ }
71
+ // Relaxation with a hard iteration cap so a cyclic graph can never loop.
72
+ const maxIterations = nodes.length * Math.max(1, edges.length) + nodes.length + 1;
73
+ let iterations = 0;
74
+ while (queue.length && iterations < maxIterations) {
75
+ iterations += 1;
76
+ const id = queue.shift();
77
+ const base = layer.get(id) ?? 0;
78
+ for (const next of outAdj.get(id) ?? []) {
79
+ const candidate = base + 1;
80
+ if ((layer.get(next) ?? -1) < candidate) {
81
+ layer.set(next, candidate);
82
+ queue.push(next);
83
+ }
84
+ }
85
+ }
86
+ // Any node not reached above goes one layer below the deepest known layer.
87
+ let maxLayer = 0;
88
+ for (const v of layer.values())
89
+ maxLayer = Math.max(maxLayer, v);
90
+ for (const n of nodes) {
91
+ if (!layer.has(n.id)) {
92
+ maxLayer += 1;
93
+ layer.set(n.id, maxLayer);
94
+ }
95
+ }
96
+ // Bucket nodes by layer, preserving original order within each layer.
97
+ const byLayer = new Map();
98
+ for (const n of nodes) {
99
+ const l = layer.get(n.id) ?? 0;
100
+ if (!byLayer.has(l))
101
+ byLayer.set(l, []);
102
+ byLayer.get(l).push(n.id);
103
+ }
104
+ for (const ids of byLayer.values()) {
105
+ ids.sort((a, b) => (indexOf.get(a) ?? 0) - (indexOf.get(b) ?? 0));
106
+ }
107
+ const sortedLayers = [...byLayer.keys()].sort((a, b) => a - b);
108
+ for (const l of sortedLayers) {
109
+ const ids = byLayer.get(l);
110
+ const rowWidth = ids.length * NODE_W + (ids.length - 1) * H_GAP;
111
+ const startX = -rowWidth / 2;
112
+ ids.forEach((id, i) => {
113
+ positions.set(id, {
114
+ x: startX + i * (NODE_W + H_GAP),
115
+ y: l * (NODE_H + V_GAP),
116
+ });
117
+ });
118
+ }
119
+ // Normalize the auto-computed slots so the diagram starts at
120
+ // (PADDING, PADDING). We do this BEFORE applying manual overrides so the
121
+ // auto-laid nodes always live in one stable frame — a dragged node then
122
+ // keeps the exact coordinate the user dropped it at, with no drift.
123
+ let minX = Infinity;
124
+ let minY = Infinity;
125
+ for (const p of positions.values()) {
126
+ minX = Math.min(minX, p.x);
127
+ minY = Math.min(minY, p.y);
128
+ }
129
+ if (Number.isFinite(minX) && Number.isFinite(minY)) {
130
+ const dx = PADDING - minX;
131
+ const dy = PADDING - minY;
132
+ for (const [id, p] of positions)
133
+ positions.set(id, { x: p.x + dx, y: p.y + dy });
134
+ }
135
+ // Apply persisted manual overrides on top of the normalized frame.
136
+ for (const n of nodes) {
137
+ if (hasManualPosition(n)) {
138
+ positions.set(n.id, { x: Math.max(0, n.ui.x), y: Math.max(0, n.ui.y) });
139
+ }
140
+ }
141
+ return positions;
142
+ }
143
+ /** Bounding box of the laid-out diagram, including node extents + padding. */
144
+ export function diagramSize(positions) {
145
+ let maxX = 0;
146
+ let maxY = 0;
147
+ for (const p of positions.values()) {
148
+ maxX = Math.max(maxX, p.x + NODE_W);
149
+ maxY = Math.max(maxY, p.y + NODE_H);
150
+ }
151
+ return { width: maxX + PADDING, height: maxY + PADDING };
152
+ }
153
+ /** Bottom-center anchor of a node — where its outgoing edges originate. */
154
+ export function bottomAnchor(p) {
155
+ return { x: p.x + NODE_W / 2, y: p.y + NODE_H };
156
+ }
157
+ /** Top-center anchor of a node — where its incoming edges terminate. */
158
+ export function topAnchor(p) {
159
+ return { x: p.x + NODE_W / 2, y: p.y };
160
+ }
161
+ /**
162
+ * Smooth vertical cubic-bezier path between two anchors. Control points are
163
+ * pulled along the vertical axis so the curve reads as a top-down flow even
164
+ * when the target sits above or beside the source.
165
+ */
166
+ export function edgePath(from, to) {
167
+ const dy = Math.max(Math.abs(to.y - from.y) * 0.5, 24);
168
+ const c1 = { x: from.x, y: from.y + dy };
169
+ const c2 = { x: to.x, y: to.y - dy };
170
+ return `M ${from.x},${from.y} C ${c1.x},${c1.y} ${c2.x},${c2.y} ${to.x},${to.y}`;
171
+ }
172
+ /** Midpoint of an edge — anchor for the condition label + insert affordance. */
173
+ export function edgeMidpoint(from, to) {
174
+ return { x: (from.x + to.x) / 2, y: (from.y + to.y) / 2 };
175
+ }
176
+ /** True for an ADR-0044 declared back-edge (a revise/rework loop's return). */
177
+ export function isBackEdge(edge) {
178
+ return edge.type === 'back';
179
+ }
180
+ /** Right-center anchor of a node — where a back-edge's return arc attaches. */
181
+ export function rightAnchor(p) {
182
+ return { x: p.x + NODE_W, y: p.y + NODE_H / 2 };
183
+ }
184
+ /** Horizontal bow of a back-edge's return arc, scaled to the vertical span. */
185
+ function backEdgeBow(from, to) {
186
+ return Math.max(64, Math.abs(to.y - from.y) * 0.35);
187
+ }
188
+ /**
189
+ * Curved return path for a declared back-edge (ADR-0044 revise loop). Unlike a
190
+ * forward edge (top→bottom), a back-edge re-enters an earlier node, so we route
191
+ * it off the right side of both endpoints and bow it out to the right — a
192
+ * distinct return arc that reads as "loop back" rather than crossing the
193
+ * top-to-bottom forward edges.
194
+ */
195
+ export function backEdgePath(from, to) {
196
+ const bow = backEdgeBow(from, to);
197
+ const c1 = { x: from.x + bow, y: from.y };
198
+ const c2 = { x: to.x + bow, y: to.y };
199
+ return `M ${from.x},${from.y} C ${c1.x},${c1.y} ${c2.x},${c2.y} ${to.x},${to.y}`;
200
+ }
201
+ /** Anchor for a back-edge's label pill — the apex of its return arc. */
202
+ export function backEdgeLabelAnchor(from, to) {
203
+ // The cubic's t=0.5 point sits ~0.75·bow right of the (shared) right edge.
204
+ const bow = backEdgeBow(from, to);
205
+ return { x: Math.max(from.x, to.x) + bow * 0.75, y: (from.y + to.y) / 2 };
206
+ }
207
+ /**
208
+ * Stable identity for an edge. Prefers an explicit `edge.id`; otherwise falls
209
+ * back to a `source->target#index` composite so an unsaved edge still has a
210
+ * deterministic key. Used for selection, traversal highlighting, and inspector
211
+ * lookup — all of which read the same `draft.edges` array, so the index is
212
+ * consistent across them. Editing label/condition/isDefault never changes the
213
+ * key (source/target/index are untouched), so a selection survives edits.
214
+ */
215
+ export function edgeKey(edge, index) {
216
+ return edge.id || `${edge.source}->${edge.target}#${index}`;
217
+ }
218
+ /** Human-readable condition text for an edge's optional guard. */
219
+ export function conditionText(c) {
220
+ if (!c)
221
+ return undefined;
222
+ if (typeof c === 'string')
223
+ return c;
224
+ if (typeof c === 'object' && typeof c.source === 'string')
225
+ return c.source;
226
+ return undefined;
227
+ }
@@ -0,0 +1,96 @@
1
+ /**
2
+ * flow-canvas-parts — presentational building blocks for `FlowCanvas.tsx`:
3
+ * the per-node-type icon/tone mapping, the node card, and the add-node
4
+ * palette popover. Kept dependency-free and Shadcn-native (Tailwind + lucide).
5
+ */
6
+ import * as React from 'react';
7
+ import { type LucideIcon } from 'lucide-react';
8
+ import { type Point } from './flow-canvas-layout';
9
+ export declare function nodeIcon(type: string): LucideIcon;
10
+ interface NodeTone {
11
+ /** Icon color (used inside the tinted chip). */
12
+ icon: string;
13
+ /** Card accent border (left edge) + selected ring color. */
14
+ accent: string;
15
+ /** Small type-label text color. */
16
+ label: string;
17
+ /** Tinted icon-chip background + ring — the card's primary color cue. */
18
+ chip: string;
19
+ }
20
+ export declare function nodeTone(type: string): NodeTone;
21
+ /**
22
+ * Renders the glyph for a node type. Uses `createElement` (rather than binding
23
+ * the resolved icon to a capitalized local) so the renderer stays a stable
24
+ * module-scope component instead of one re-created on every parent render.
25
+ */
26
+ export declare function NodeTypeIcon({ type, className }: {
27
+ type: string;
28
+ className?: string;
29
+ }): React.FunctionComponentElement<Omit<import("lucide-react").LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
30
+ /** Palette grouping — keeps the add-node list scannable as it grows. */
31
+ export type NodeCategory = 'Data' | 'Logic' | 'Human' | 'Integration' | 'Flow';
32
+ /** Display order of the palette's category sections. */
33
+ export declare const NODE_CATEGORY_ORDER: NodeCategory[];
34
+ export interface PaletteItem {
35
+ type: string;
36
+ label: string;
37
+ hint?: string;
38
+ /** Section this item belongs to in the grouped palette. */
39
+ category?: NodeCategory;
40
+ }
41
+ /**
42
+ * Category for a node type — drives palette grouping and gives engine-only
43
+ * (plugin-contributed) types a sensible section. Mirrors the `nodeTone`
44
+ * families so color and grouping stay consistent.
45
+ */
46
+ export declare function nodeCategory(type: string): NodeCategory;
47
+ /** Node types offered by the add-node palette (spec `FlowNodeAction`). */
48
+ export declare const NODE_PALETTE: PaletteItem[];
49
+ /** Human-friendly default label for a newly created node of `type`. */
50
+ export declare function defaultNodeLabel(type: string): string;
51
+ /**
52
+ * Spec-valid seed fields for a newly created node, so structured blocks start
53
+ * in a valid-ish shape (e.g. a wait node already has a timer eventType) rather
54
+ * than an empty intermediate state. Returns extra node props to spread in.
55
+ */
56
+ export declare function defaultNodeExtras(type: string): Record<string, unknown>;
57
+ export interface NodeCardProps {
58
+ id: string;
59
+ type: string;
60
+ label: string;
61
+ summary?: string;
62
+ position: Point;
63
+ selected: boolean;
64
+ editable: boolean;
65
+ /** Simulation overlay: the currently-executing or already-visited node. */
66
+ runState?: 'active' | 'visited';
67
+ /** Dim nodes not yet reached while a simulation is in progress. */
68
+ dimmed?: boolean;
69
+ /** Structural-validation error highlight (e.g. part of an un-declared cycle). */
70
+ invalid?: boolean;
71
+ onPointerDown?: (e: React.PointerEvent) => void;
72
+ onSelect?: () => void;
73
+ onAppend?: () => void;
74
+ /**
75
+ * ADR-0044: when set (approval nodes without an existing revise loop), render
76
+ * the one-click "add revision loop" affordance — drops a wait node + the
77
+ * `revise` and declared `back` edges in a single gesture.
78
+ */
79
+ onAddReviseLoop?: () => void;
80
+ }
81
+ /**
82
+ * A single draggable flow node rendered at an absolute canvas coordinate.
83
+ * The card body drives selection + reposition; a dedicated bottom "+" handle
84
+ * (edit mode only) appends a connected child without ambiguity.
85
+ */
86
+ export declare function NodeCard({ type, label, summary, position, selected, editable, runState, dimmed, invalid, onPointerDown, onSelect, onAppend, onAddReviseLoop, }: NodeCardProps): React.JSX.Element;
87
+ export interface NodePaletteProps {
88
+ locale?: string;
89
+ /** Node types to offer. Defaults to the hardcoded {@link NODE_PALETTE}. */
90
+ items?: PaletteItem[];
91
+ onPick: (type: string) => void;
92
+ onClose: () => void;
93
+ }
94
+ /** Compact popover listing the node types an author can add, grouped by category. */
95
+ export declare function NodePalette({ items, onPick, onClose }: NodePaletteProps): React.JSX.Element;
96
+ export {};