@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,227 @@
1
+ // Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
2
+ const REFERENCE_KINDS = new Set([
3
+ 'object',
4
+ 'object-field',
5
+ 'flow',
6
+ 'role',
7
+ 'node',
8
+ 'user',
9
+ 'team',
10
+ 'queue',
11
+ 'department',
12
+ 'connector',
13
+ 'email-template',
14
+ ]);
15
+ /**
16
+ * Read a valid `xRef` annotation off a schema node, or undefined. Accepts both
17
+ * the static shape (`{ kind }`) and the polymorphic shape (`{ kindFrom, map }`),
18
+ * validating every referenced kind against {@link REFERENCE_KINDS} so an unknown
19
+ * kind degrades to free text rather than a broken picker.
20
+ */
21
+ function refOf(node) {
22
+ const x = node.xRef;
23
+ if (!x || typeof x !== 'object')
24
+ return undefined;
25
+ const objectSource = typeof x.objectSource === 'string' && x.objectSource ? { objectSource: x.objectSource } : {};
26
+ // Polymorphic: kindFrom + a map of discriminator value → kind.
27
+ if (typeof x.kindFrom === 'string' && x.kindFrom && x.map && typeof x.map === 'object') {
28
+ const map = {};
29
+ for (const [disc, kind] of Object.entries(x.map)) {
30
+ if (typeof kind === 'string' && REFERENCE_KINDS.has(kind))
31
+ map[disc] = kind;
32
+ }
33
+ if (Object.keys(map).length === 0)
34
+ return undefined;
35
+ return { kindFrom: x.kindFrom, map, ...objectSource };
36
+ }
37
+ // Static: a single concrete kind.
38
+ if (typeof x.kind === 'string' && REFERENCE_KINDS.has(x.kind)) {
39
+ return { kind: x.kind, ...objectSource };
40
+ }
41
+ return undefined;
42
+ }
43
+ /** "approvalStatusField" → "Approval Status Field"; "approve" → "Approve". */
44
+ export function humanizeKey(key) {
45
+ const spaced = key
46
+ .replace(/[_-]+/g, ' ')
47
+ .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
48
+ .trim();
49
+ if (!spaced)
50
+ return key;
51
+ return spaced
52
+ .split(/\s+/)
53
+ .map((w) => w.charAt(0).toUpperCase() + w.slice(1))
54
+ .join(' ');
55
+ }
56
+ function isObject(v) {
57
+ return !!v && typeof v === 'object' && !Array.isArray(v);
58
+ }
59
+ /** The JSON Schema `type`, normalized to a single string (first non-null of a union). */
60
+ function schemaType(node) {
61
+ if (Array.isArray(node.type))
62
+ return node.type.find((t) => t !== 'null');
63
+ if (typeof node.type === 'string')
64
+ return node.type;
65
+ // Infer from shape when `type` is omitted (common with enum-only schemas).
66
+ if (Array.isArray(node.enum))
67
+ return 'string';
68
+ if (node.properties)
69
+ return 'object';
70
+ if (node.items)
71
+ return 'array';
72
+ return undefined;
73
+ }
74
+ /** Build `{ value, label }` options from a string enum. */
75
+ function enumOptions(values) {
76
+ return values
77
+ .filter((v) => typeof v === 'string')
78
+ .map((v) => ({ value: v, label: humanizeKey(v) }));
79
+ }
80
+ /** Default coerced to the string form the inspector's `defaultValue` expects. */
81
+ function defaultString(node) {
82
+ if (node.default === undefined || node.default === null)
83
+ return undefined;
84
+ if (typeof node.default === 'boolean')
85
+ return String(node.default);
86
+ if (typeof node.default === 'number')
87
+ return String(node.default);
88
+ if (typeof node.default === 'string')
89
+ return node.default;
90
+ return undefined;
91
+ }
92
+ /** Scalar (non-object, non-array) → field kind. */
93
+ function scalarKind(node) {
94
+ if (Array.isArray(node.enum))
95
+ return 'select';
96
+ const t = schemaType(node);
97
+ if (t === 'boolean')
98
+ return 'boolean';
99
+ if (t === 'number' || t === 'integer')
100
+ return 'number';
101
+ if (t === 'string')
102
+ return node.format === 'multiline' ? 'textarea' : 'text';
103
+ return undefined;
104
+ }
105
+ /** Derive `objectList` columns from an item object's properties. */
106
+ function columnsFor(item) {
107
+ const props = item.properties ?? {};
108
+ const cols = [];
109
+ for (const [key, prop] of Object.entries(props)) {
110
+ if (!isObject(prop))
111
+ continue;
112
+ const t = schemaType(prop);
113
+ let kind;
114
+ let options;
115
+ // A reference annotation wins over the plain scalar mapping — the column is
116
+ // a typed reference and gets a picker (static or polymorphic via kindFrom).
117
+ const ref = refOf(prop);
118
+ if (ref) {
119
+ kind = 'reference';
120
+ }
121
+ else if (Array.isArray(prop.enum)) {
122
+ kind = 'select';
123
+ options = enumOptions(prop.enum);
124
+ }
125
+ else if (t === 'boolean') {
126
+ kind = 'boolean';
127
+ }
128
+ else {
129
+ kind = 'text';
130
+ }
131
+ cols.push({
132
+ key,
133
+ label: prop.title || humanizeKey(key),
134
+ kind,
135
+ ...(options ? { options } : {}),
136
+ ...(ref ? { ref } : {}),
137
+ // Columns have no help slot — surface the schema description as a hint.
138
+ ...(prop.description ? { placeholder: prop.description } : {}),
139
+ });
140
+ }
141
+ return cols;
142
+ }
143
+ /** Common field metadata derived from a schema node. */
144
+ function meta(node, key) {
145
+ return {
146
+ label: node.title || humanizeKey(key),
147
+ ...(node.description ? { help: node.description } : {}),
148
+ ...(defaultString(node) ? { defaultValue: defaultString(node) } : {}),
149
+ };
150
+ }
151
+ /**
152
+ * Convert a published config JSON Schema (an object schema) into the inspector's
153
+ * `FlowConfigField[]`. Property order is preserved. Returns `null` when the
154
+ * schema is not a usable object schema, so callers fall back to their hardcoded
155
+ * field group.
156
+ */
157
+ export function jsonSchemaToFlowFields(schema) {
158
+ if (!isObject(schema) || schemaType(schema) !== 'object' || !isObject(schema.properties)) {
159
+ return null;
160
+ }
161
+ const fields = [];
162
+ for (const [key, prop] of Object.entries(schema.properties)) {
163
+ if (!isObject(prop))
164
+ continue;
165
+ const t = schemaType(prop);
166
+ // ── arrays ────────────────────────────────────────────────────────────
167
+ if (t === 'array') {
168
+ const item = isObject(prop.items) ? prop.items : undefined;
169
+ const itemType = item ? schemaType(item) : undefined;
170
+ if (item && itemType === 'object' && isObject(item.properties)) {
171
+ fields.push({ id: key, path: ['config', key], kind: 'objectList', columns: columnsFor(item), ...meta(prop, key) });
172
+ }
173
+ else if (itemType === 'string') {
174
+ fields.push({ id: key, path: ['config', key], kind: 'stringList', ...meta(prop, key) });
175
+ }
176
+ // arrays of anything else fall through to the Advanced block.
177
+ continue;
178
+ }
179
+ // ── nested object → flatten one level under config.<key>.* ──────────────
180
+ if (t === 'object' && isObject(prop.properties)) {
181
+ const subProps = Object.entries(prop.properties).filter(([, p]) => isObject(p));
182
+ // A boolean `enabled` toggle gates the rest of the group (mirrors the SLA
183
+ // escalation UX): the group's other fields reveal only when it is on.
184
+ const hasEnabled = subProps.some(([k, p]) => k === 'enabled' && schemaType(p) === 'boolean');
185
+ for (const [subKey, subProp] of subProps) {
186
+ const sp = subProp;
187
+ const subRef = refOf(sp);
188
+ const kind = subRef ? 'reference' : scalarKind(sp);
189
+ if (!kind)
190
+ continue; // deeper nesting / unsupported → Advanced block
191
+ const id = `${key}.${subKey}`;
192
+ const isGate = hasEnabled && subKey === 'enabled';
193
+ const field = {
194
+ id,
195
+ path: ['config', key, subKey],
196
+ kind,
197
+ // The gate adopts the parent group's label; siblings keep their own.
198
+ ...(isGate ? { label: prop.title || humanizeKey(key), ...(prop.description ? { help: prop.description } : {}), ...(defaultString(sp) ? { defaultValue: defaultString(sp) } : {}) } : meta(sp, subKey)),
199
+ ...(subRef ? { ref: subRef } : {}),
200
+ ...(kind === 'select' && Array.isArray(sp.enum) ? { options: enumOptions(sp.enum) } : {}),
201
+ ...(hasEnabled && !isGate ? { showWhen: { field: `${key}.enabled`, equals: ['true'] } } : {}),
202
+ };
203
+ fields.push(field);
204
+ }
205
+ continue;
206
+ }
207
+ // ── scalars ─────────────────────────────────────────────────────────────
208
+ // A reference annotation (xRef) wins over the plain scalar mapping — the
209
+ // string is really a typed reference and gets a picker.
210
+ const ref = refOf(prop);
211
+ if (ref) {
212
+ fields.push({ id: key, path: ['config', key], kind: 'reference', ref, ...meta(prop, key) });
213
+ continue;
214
+ }
215
+ const kind = scalarKind(prop);
216
+ if (!kind)
217
+ continue; // unrepresentable → Advanced block
218
+ fields.push({
219
+ id: key,
220
+ path: ['config', key],
221
+ kind,
222
+ ...meta(prop, key),
223
+ ...(kind === 'select' && Array.isArray(prop.enum) ? { options: enumOptions(prop.enum) } : {}),
224
+ });
225
+ }
226
+ return fields;
227
+ }
@@ -0,0 +1,72 @@
1
+ export interface DatasetObjectOption {
2
+ /** Object API name (snake_case) — what `dataset.object` stores. */
3
+ name: string;
4
+ /** Human label (falls back to the name). */
5
+ label: string;
6
+ }
7
+ export interface DatasetRelationship {
8
+ /** Relationship field name — what goes in `dataset.include`. */
9
+ name: string;
10
+ /** Human label (falls back to the name). */
11
+ label: string;
12
+ /** Target object the relationship points at (for `rel.field` paths). */
13
+ referenceTo?: string;
14
+ }
15
+ export interface DatasetFieldOption {
16
+ /** Field path: a base field name or `relationship.field`. */
17
+ value: string;
18
+ /** Human label (falls back to the value). */
19
+ label: string;
20
+ /** Raw framework field type (e.g. 'text', 'currency', 'lookup'). */
21
+ type?: string;
22
+ /** Group heading: the base object label, or `rel → target`. */
23
+ group: string;
24
+ }
25
+ export interface DatasetFieldCatalog {
26
+ relationships: DatasetRelationship[];
27
+ fieldOptions: DatasetFieldOption[];
28
+ loading: boolean;
29
+ }
30
+ /** Resolve a string | i18n-object label down to a display string. */
31
+ export declare function resolveLabel(label: unknown, fallback: string): string;
32
+ /** Read a lookup/master_detail field's target object from its raw def. */
33
+ export declare function resolveReferenceTo(def: Record<string, unknown>): string | undefined;
34
+ /** Map a framework field type onto a dataset dimension type. */
35
+ export declare function fieldTypeToDimensionType(type: string | undefined): string;
36
+ export interface NormalizedObject {
37
+ label: string;
38
+ fields: Array<{
39
+ name: string;
40
+ label: string;
41
+ type?: string;
42
+ def: Record<string, unknown>;
43
+ }>;
44
+ relationships: DatasetRelationship[];
45
+ }
46
+ /** Normalize a raw object metadata doc into label + fields + relationships. */
47
+ export declare function normalizeObject(doc: Record<string, unknown> | null | undefined, name: string): NormalizedObject;
48
+ /**
49
+ * Build the flat `field` / `relationship.field` option list from the base
50
+ * object and the included relationships' (already-fetched) target objects.
51
+ */
52
+ export declare function buildFieldOptions(base: NormalizedObject, include: string[], targets: Record<string, NormalizedObject>): DatasetFieldOption[];
53
+ /** Recursively test whether a metadata doc references `datasetName` via a `dataset` key. */
54
+ export declare function referencesDataset(doc: unknown, datasetName: string): boolean;
55
+ /** Every object as `{ name, label }`, sorted by label. Fetched once. */
56
+ export declare function useObjectOptions(): {
57
+ options: DatasetObjectOption[];
58
+ loading: boolean;
59
+ };
60
+ /**
61
+ * The base object's relationships (join allowlist) + a flat `field` /
62
+ * `relationship.field` option list. Refetches when `object` or the set of
63
+ * included relationships changes.
64
+ */
65
+ export declare function useDatasetFieldCatalog(object: string | undefined, include: string[]): DatasetFieldCatalog;
66
+ export interface DatasetUsage {
67
+ reports: number;
68
+ dashboards: number;
69
+ loading: boolean;
70
+ }
71
+ /** Reverse lineage: how many reports / dashboards bind this dataset by name. */
72
+ export declare function useDatasetUsage(name: string | undefined): DatasetUsage;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ /**
9
+ * Render a (possibly nested) validation issue path into a human-readable trail
10
+ * that names the offending element. A Zod issue on a dashboard widget arrives as
11
+ * a dot-joined path like `widgets.2.layout`; shown as just its head field
12
+ * ("Widgets") the author can't tell WHICH widget or sub-field is at fault. This
13
+ * turns it into "Widgets → priority_split → layout" by resolving each array
14
+ * index to the item's stable identity (id/name/title) from the draft value.
15
+ *
16
+ * @param headLabel resolved human label for the first segment (caller knows the
17
+ * form/schema labels).
18
+ * @param path dot-joined issue path (e.g. `widgets.2.layout`).
19
+ * @param rootValue the draft object the path indexes into (used to resolve an
20
+ * array index to the item's identity).
21
+ */
22
+ export declare function describeIssuePath(headLabel: string, path: string, rootValue: unknown): string;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ /**
9
+ * Render a (possibly nested) validation issue path into a human-readable trail
10
+ * that names the offending element. A Zod issue on a dashboard widget arrives as
11
+ * a dot-joined path like `widgets.2.layout`; shown as just its head field
12
+ * ("Widgets") the author can't tell WHICH widget or sub-field is at fault. This
13
+ * turns it into "Widgets → priority_split → layout" by resolving each array
14
+ * index to the item's stable identity (id/name/title) from the draft value.
15
+ *
16
+ * @param headLabel resolved human label for the first segment (caller knows the
17
+ * form/schema labels).
18
+ * @param path dot-joined issue path (e.g. `widgets.2.layout`).
19
+ * @param rootValue the draft object the path indexes into (used to resolve an
20
+ * array index to the item's identity).
21
+ */
22
+ export function describeIssuePath(headLabel, path, rootValue) {
23
+ const segments = path.split('.');
24
+ if (segments.length <= 1)
25
+ return headLabel;
26
+ const parts = [headLabel];
27
+ let cursor = asRecord(rootValue)?.[segments[0]];
28
+ for (let i = 1; i < segments.length; i++) {
29
+ const seg = segments[i];
30
+ if (/^\d+$/.test(seg)) {
31
+ const idx = Number(seg);
32
+ const item = Array.isArray(cursor) ? cursor[idx] : undefined;
33
+ // 1-based index reads naturally for non-developers ("#1" not "#0").
34
+ parts.push(itemIdentity(item) ?? `#${idx + 1}`);
35
+ cursor = item;
36
+ }
37
+ else {
38
+ parts.push(seg);
39
+ cursor = asRecord(cursor)?.[seg];
40
+ }
41
+ }
42
+ return parts.join(' → ');
43
+ }
44
+ /** Best-effort stable identity of an array item, resolving an I18nLabel object
45
+ * ({ key, defaultValue }) to its string. Returns undefined when none usable. */
46
+ function itemIdentity(item) {
47
+ const o = asRecord(item);
48
+ if (!o)
49
+ return undefined;
50
+ for (const k of ['id', 'name', 'key', 'title', 'label']) {
51
+ const v = o[k];
52
+ if (typeof v === 'string' && v.trim())
53
+ return v;
54
+ const nested = asRecord(v);
55
+ if (nested) {
56
+ const s = nested.defaultValue ?? nested.key;
57
+ if (typeof s === 'string' && s.trim())
58
+ return s;
59
+ }
60
+ }
61
+ return undefined;
62
+ }
63
+ function asRecord(v) {
64
+ return v && typeof v === 'object' ? v : undefined;
65
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * mergeServerFields — completes the cross-repo spec-skew root-cure for the
3
+ * CURATED inspectors (report / dashboard / view).
4
+ *
5
+ * Background: the curated "home" inspectors derive their authoring form from
6
+ * the BUNDLED `@objectstack/spec` (`getReportForm()`/`getReportSchema()` …).
7
+ * When the running server adds new fields to a metadata type (e.g. report's
8
+ * `dataset`/`rows`/`values`) before objectui bumps its bundled spec, those
9
+ * fields exist in the live server schema (`/meta/types` → `entry.schema`) but
10
+ * NOT in the bundled one — so the curated form can't render them. They were
11
+ * only reachable via the raw "source" tab / API.
12
+ *
13
+ * `clientValidation.ts` already stopped the bundled spec from being STRICTER
14
+ * than the server (no more false "required" banners). This is the symmetric
15
+ * other half: let the bundled-derived FORM be a SUPERSET of the bundled spec
16
+ * by grafting in any server-only top-level properties, so new fields become
17
+ * directly editable in the right-hand curated form.
18
+ *
19
+ * It is purely ADDITIVE and lag-tolerant:
20
+ * - Only fields the server has and the bundle lacks are added; existing
21
+ * bundled fields, ordering, sections and `visibleOn` predicates are
22
+ * untouched.
23
+ * - When the bundle catches up (the field appears in `bundledSchema`), the
24
+ * merge becomes a no-op for that field automatically — no shim to remove.
25
+ * - When no server schema is available (offline/older server), it returns
26
+ * the bundled `{schema, form}` verbatim.
27
+ *
28
+ * SchemaForm renders ONLY the fields a `form` declares (see SchemaForm's
29
+ * sectioned path), so new properties must be added to BOTH the schema's
30
+ * `properties` AND the form (as a trailing section) to actually surface.
31
+ */
32
+ import type { FormViewSpec } from './SchemaForm';
33
+ type JsonSchema = Record<string, any>;
34
+ export interface MergeServerFieldsArgs {
35
+ /** Bundled-spec JSONSchema for the whole document (may be undefined). */
36
+ bundledSchema: JsonSchema | undefined;
37
+ /** Bundled-spec authoring FormView (may be undefined). */
38
+ bundledForm: FormViewSpec | undefined;
39
+ /**
40
+ * Live server JSONSchema for this type (`RichMetadataTypeEntry.schema`).
41
+ * For nested documents (view), pass the relevant sub-schema (e.g.
42
+ * `serverSchema.properties.list`).
43
+ */
44
+ serverSchema: JsonSchema | undefined;
45
+ /**
46
+ * Top-level fields the curated inspector renders itself (e.g. report's
47
+ * `objectName`/`columns`/`label`) plus identity (`name`). These are never
48
+ * grafted into the spec form even if the server adds/keeps them, so they
49
+ * are not double-edited.
50
+ */
51
+ excludeFields: Set<string>;
52
+ /** Localized title for the trailing "new server fields" section. */
53
+ sectionTitle: string;
54
+ }
55
+ export interface MergeServerFieldsResult {
56
+ schema: JsonSchema | undefined;
57
+ form: FormViewSpec | undefined;
58
+ }
59
+ /**
60
+ * Return `{schema, form}` with server-only top-level properties grafted onto
61
+ * the bundled pair. No-op (returns the bundled pair) when there is nothing to
62
+ * add or no server schema to read.
63
+ */
64
+ export declare function mergeServerFields({ bundledSchema, bundledForm, serverSchema, excludeFields, sectionTitle, }: MergeServerFieldsArgs): MergeServerFieldsResult;
65
+ export {};
@@ -0,0 +1,56 @@
1
+ // Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2
+ /** Collect every field name a FormView's sections already declare. */
3
+ function formDeclaredFields(form) {
4
+ const out = new Set();
5
+ for (const s of form?.sections ?? []) {
6
+ for (const f of s.fields ?? []) {
7
+ out.add(typeof f === 'string' ? f : f?.field);
8
+ }
9
+ }
10
+ return out;
11
+ }
12
+ /**
13
+ * Return `{schema, form}` with server-only top-level properties grafted onto
14
+ * the bundled pair. No-op (returns the bundled pair) when there is nothing to
15
+ * add or no server schema to read.
16
+ */
17
+ export function mergeServerFields({ bundledSchema, bundledForm, serverSchema, excludeFields, sectionTitle, }) {
18
+ if (!bundledSchema)
19
+ return { schema: bundledSchema, form: bundledForm };
20
+ const serverProps = serverSchema?.properties;
21
+ if (!serverProps || typeof serverProps !== 'object') {
22
+ return { schema: bundledSchema, form: bundledForm };
23
+ }
24
+ const bundledProps = (bundledSchema.properties ?? {});
25
+ const alreadyShown = formDeclaredFields(bundledForm);
26
+ // Server-only fields = on the server, absent from the bundled schema, not
27
+ // curated-owned, and not already declared by the bundled form.
28
+ const newKeys = Object.keys(serverProps).filter((k) => !(k in bundledProps) &&
29
+ !excludeFields.has(k) &&
30
+ !alreadyShown.has(k));
31
+ if (newKeys.length === 0)
32
+ return { schema: bundledSchema, form: bundledForm };
33
+ // ── additive schema merge (shallow clone; bundled defs win on conflict) ──
34
+ const mergedSchema = {
35
+ ...bundledSchema,
36
+ properties: { ...bundledProps },
37
+ };
38
+ for (const k of newKeys) {
39
+ if (!(k in mergedSchema.properties))
40
+ mergedSchema.properties[k] = serverProps[k];
41
+ }
42
+ // ── additive form merge — append a trailing section with the new fields ──
43
+ // When the bundle ships no form at all, SchemaForm falls back to a flat
44
+ // property list (which already renders every property), so we only need to
45
+ // synthesise a form when one exists to preserve its curated layout.
46
+ let mergedForm = bundledForm;
47
+ if (bundledForm && typeof bundledForm === 'object') {
48
+ const clone = JSON.parse(JSON.stringify(bundledForm));
49
+ clone.sections = [
50
+ ...(clone.sections ?? []),
51
+ { label: sectionTitle, fields: newKeys.map((field) => ({ field })) },
52
+ ];
53
+ mergedForm = clone;
54
+ }
55
+ return { schema: mergedSchema, form: mergedForm };
56
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Sentinel "package" id for this environment's runtime, DB-authored metadata —
3
+ * items with no code-package binding (`package_id IS NULL`). The metadata
4
+ * list/get API treats `?package=sys_metadata` as exactly that local scope on
5
+ * READ, and a WRITE under it persists `package_id = null` (matching the
6
+ * server's runtime-only provenance, see framework #2252).
7
+ *
8
+ * Why this exists: a self-hosted, metadata-customizable environment is
9
+ * single-tenant — there is no "org" dimension here; the real axis is
10
+ * code-package vs. runtime (DB-authored). Before this scope, the package
11
+ * selector only listed code packages, so metadata authored at runtime
12
+ * (`package_id = null`) was filtered out of every code-package view and became
13
+ * un-navigable (the route redirected to "new"). Surfacing the local scope as a
14
+ * first-class, always-present selector entry makes it discoverable and editable.
15
+ */
16
+ export declare const LOCAL_PACKAGE_ID = "sys_metadata";
17
+ /**
18
+ * Build the Studio package-scope options from the raw `package` metadata list.
19
+ * Filters out system/cloud-scoped packages and appends a stable
20
+ * "Local / Custom (this environment)" scope so runtime metadata authored here
21
+ * is always selectable/visible — even when zero items exist yet.
22
+ */
23
+ export declare function buildPackageScopeOptions(rawList: unknown[] | null | undefined): {
24
+ id: string;
25
+ name: string;
26
+ }[];
@@ -0,0 +1,43 @@
1
+ // Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
2
+ import { detectLocale, t } from './i18n';
3
+ /**
4
+ * Sentinel "package" id for this environment's runtime, DB-authored metadata —
5
+ * items with no code-package binding (`package_id IS NULL`). The metadata
6
+ * list/get API treats `?package=sys_metadata` as exactly that local scope on
7
+ * READ, and a WRITE under it persists `package_id = null` (matching the
8
+ * server's runtime-only provenance, see framework #2252).
9
+ *
10
+ * Why this exists: a self-hosted, metadata-customizable environment is
11
+ * single-tenant — there is no "org" dimension here; the real axis is
12
+ * code-package vs. runtime (DB-authored). Before this scope, the package
13
+ * selector only listed code packages, so metadata authored at runtime
14
+ * (`package_id = null`) was filtered out of every code-package view and became
15
+ * un-navigable (the route redirected to "new"). Surfacing the local scope as a
16
+ * first-class, always-present selector entry makes it discoverable and editable.
17
+ */
18
+ export const LOCAL_PACKAGE_ID = 'sys_metadata';
19
+ const SYSTEM_SCOPES = new Set(['system', 'cloud']);
20
+ /**
21
+ * Build the Studio package-scope options from the raw `package` metadata list.
22
+ * Filters out system/cloud-scoped packages and appends a stable
23
+ * "Local / Custom (this environment)" scope so runtime metadata authored here
24
+ * is always selectable/visible — even when zero items exist yet.
25
+ */
26
+ export function buildPackageScopeOptions(rawList) {
27
+ const rows = (rawList ?? [])
28
+ .map((raw) => {
29
+ const item = raw && typeof raw === 'object' && 'item' in raw ? raw.item : raw;
30
+ const m = (item?.manifest ?? item ?? {});
31
+ return {
32
+ id: m.id,
33
+ scope: m.scope,
34
+ name: m.name || m.id,
35
+ };
36
+ })
37
+ .filter((p) => p.id && !SYSTEM_SCOPES.has(p.scope));
38
+ rows.sort((a, b) => a.name.localeCompare(b.name));
39
+ const opts = rows.map((p) => ({ id: p.id, name: p.name }));
40
+ // Append (never default) so the existing first-code-package default is
41
+ // preserved; the user opts into the local scope explicitly.
42
+ return [...opts, { id: LOCAL_PACKAGE_ID, name: t('engine.package.local', detectLocale()) }];
43
+ }
@@ -19,6 +19,20 @@
19
19
  * empty "preview not available" surface is shown.
20
20
  */
21
21
  import type { ComponentType } from 'react';
22
+ /**
23
+ * Identifies a sub-element selected inside a preview surface.
24
+ *
25
+ * { kind: 'widget', id: 'metric_revenue', label: 'Revenue (KPI)' }
26
+ *
27
+ * `kind` is preview-defined (dashboard uses 'widget'; page may use
28
+ * 'block'; view may use 'column'). The host (`ResourceEditPage`) is
29
+ * agnostic — it only forwards the value to the registered inspector.
30
+ */
31
+ export interface MetadataSelection {
32
+ kind: string;
33
+ id: string;
34
+ label?: string;
35
+ }
22
36
  export interface MetadataPreviewProps {
23
37
  /** The metadata type, e.g. 'page', 'dashboard'. */
24
38
  type: string;
@@ -29,6 +43,47 @@ export interface MetadataPreviewProps {
29
43
  * as immutable and untrusted (validation may be in progress).
30
44
  */
31
45
  draft: Record<string, unknown>;
46
+ /**
47
+ * Optional: apply a shallow patch to the draft. When omitted, the
48
+ * preview surface is read-only (legacy behavior). When provided, the
49
+ * preview may offer in-place edits (Airtable-style column management,
50
+ * inline rename, etc.) — implementations should respect `editing`
51
+ * before exposing mutating affordances.
52
+ */
53
+ onPatch?: (patch: Record<string, unknown>) => void;
54
+ /**
55
+ * Optional: the last *published* version of this item, for previews
56
+ * that offer a review/diff mode (e.g. the object designer diffing an
57
+ * AI-authored draft against what's live). Undefined in create mode or
58
+ * when no published baseline exists.
59
+ */
60
+ baseline?: Record<string, unknown>;
61
+ /**
62
+ * Optional: whether the host is in edit mode. Previews that ship
63
+ * editing affordances should render them in a disabled/hidden state
64
+ * when `editing === false`.
65
+ */
66
+ editing?: boolean;
67
+ /**
68
+ * Optional: BCP-47 locale code (e.g. 'en', 'zh-CN') for previews that
69
+ * render localized labels. Defaults are derived from the host locale.
70
+ */
71
+ locale?: string;
72
+ /**
73
+ * Optional: the currently selected sub-element (e.g. a dashboard
74
+ * widget). Previews use this to render selection chrome (highlight
75
+ * ring, keyboard focus) and the host uses it to swap the inspector
76
+ * to a scoped sub-form. `null` means "nothing selected → show the
77
+ * top-level form".
78
+ */
79
+ selection?: MetadataSelection | null;
80
+ /**
81
+ * Optional: notify the host that the user picked (or cleared) a
82
+ * sub-element. Pair with {@link MetadataPreviewProps.selection} and
83
+ * a registered inspector (`registerMetadataInspector`) to get the
84
+ * "click widget → edit widget in the right panel" pattern.
85
+ */
86
+ onSelectionChange?: (selection: MetadataSelection | null) => void;
32
87
  }
33
88
  export type MetadataPreview = ComponentType<MetadataPreviewProps>;
34
89
  /**