@object-ui/app-shell 6.2.3 → 7.0.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.
- package/CHANGELOG.md +948 -0
- package/README.md +292 -0
- package/dist/assistant/assistantBus.d.ts +72 -0
- package/dist/assistant/assistantBus.js +133 -0
- package/dist/chrome/CommandPalette.d.ts +1 -1
- package/dist/chrome/CommandPalette.js +26 -22
- package/dist/chrome/ConditionalAuthWrapper.d.ts +1 -1
- package/dist/chrome/ConsoleToaster.d.ts +1 -1
- package/dist/chrome/ConsoleToaster.js +3 -1
- package/dist/chrome/ErrorBoundary.d.ts +1 -1
- package/dist/chrome/KeyboardShortcutsDialog.d.ts +1 -1
- package/dist/chrome/KeyboardShortcutsDialog.js +16 -5
- package/dist/chrome/LoadingScreen.d.ts +1 -1
- package/dist/chrome/LoadingScreen.js +22 -26
- package/dist/chrome/RouteFader.d.ts +1 -1
- package/dist/chrome/ThemeProvider.d.ts +1 -1
- package/dist/components/ManagedByBadge.d.ts +1 -1
- package/dist/console/AppContent.d.ts +1 -1
- package/dist/console/AppContent.js +170 -37
- package/dist/console/ConsoleShell.d.ts +7 -7
- package/dist/console/ConsoleShell.js +32 -3
- package/dist/console/ai/AiChatPage.d.ts +88 -1
- package/dist/console/ai/AiChatPage.js +743 -66
- package/dist/console/ai/ConversationsSidebar.d.ts +26 -1
- package/dist/console/ai/ConversationsSidebar.js +149 -34
- package/dist/console/ai/LiveCanvas.d.ts +22 -0
- package/dist/console/ai/LiveCanvas.js +78 -0
- package/dist/console/ai/reconcileTurn.d.ts +8 -0
- package/dist/console/ai/reconcileTurn.js +20 -0
- package/dist/console/auth/AuthPageLayout.d.ts +1 -1
- package/dist/console/auth/ForgotPasswordPage.d.ts +1 -1
- package/dist/console/auth/LoginPage.d.ts +1 -1
- package/dist/console/auth/RegisterPage.d.ts +1 -1
- package/dist/console/auth/RegisterPage.js +23 -3
- package/dist/console/cloud-connection/CloudConnectionPanel.d.ts +1 -0
- package/dist/console/cloud-connection/CloudConnectionPanel.js +169 -0
- package/dist/console/home/AppCard.d.ts +1 -1
- package/dist/console/home/AppCard.js +6 -12
- package/dist/console/home/HomeAppsStrip.d.ts +8 -0
- package/dist/console/home/HomeAppsStrip.js +61 -0
- package/dist/console/home/HomeLayout.d.ts +1 -1
- package/dist/console/home/HomeLayout.js +3 -1
- package/dist/console/home/HomePage.d.ts +1 -2
- package/dist/console/home/HomePage.js +149 -21
- package/dist/console/home/HomeRail.d.ts +22 -0
- package/dist/console/home/HomeRail.js +62 -0
- package/dist/console/home/QuickActions.d.ts +1 -1
- package/dist/console/home/QuickActions.js +3 -11
- package/dist/console/home/RecentApps.d.ts +1 -1
- package/dist/console/home/RecentApps.js +2 -2
- package/dist/console/home/StarredApps.d.ts +1 -1
- package/dist/console/home/StarredApps.js +2 -2
- package/dist/console/marketplace/InstalledListWidget.d.ts +1 -0
- package/dist/console/marketplace/InstalledListWidget.js +93 -0
- package/dist/console/marketplace/MarkdownText.d.ts +1 -1
- package/dist/console/marketplace/MarketplaceAccessDenied.d.ts +1 -1
- package/dist/console/marketplace/MarketplaceInstalledPage.d.ts +8 -14
- package/dist/console/marketplace/MarketplaceInstalledPage.js +14 -66
- package/dist/console/marketplace/MarketplacePackagePage.d.ts +1 -1
- package/dist/console/marketplace/MarketplacePackagePage.js +249 -8
- package/dist/console/marketplace/MarketplacePage.d.ts +1 -1
- package/dist/console/marketplace/MarketplacePage.js +60 -3
- package/dist/console/marketplace/PackageIcon.d.ts +1 -1
- package/dist/console/marketplace/PluginDisclosure.d.ts +14 -0
- package/dist/console/marketplace/PluginDisclosure.js +38 -0
- package/dist/console/marketplace/marketplaceApi.d.ts +123 -0
- package/dist/console/marketplace/marketplaceApi.js +254 -1
- package/dist/console/organizations/CreateWorkspaceDialog.d.ts +1 -1
- package/dist/console/organizations/OrganizationsLayout.d.ts +1 -1
- package/dist/console/organizations/OrganizationsPage.d.ts +1 -1
- package/dist/console/organizations/manage/AcceptInvitationPage.d.ts +1 -1
- package/dist/console/organizations/manage/InvitationsPage.d.ts +1 -1
- package/dist/console/organizations/manage/InviteMemberDialog.d.ts +1 -1
- package/dist/console/organizations/manage/MembersPage.d.ts +1 -1
- package/dist/console/organizations/manage/OrganizationLayout.d.ts +1 -1
- package/dist/console/organizations/manage/SettingsPage.d.ts +1 -1
- package/dist/context/CommandPaletteProvider.d.ts +44 -0
- package/dist/context/CommandPaletteProvider.js +71 -0
- package/dist/context/FavoritesProvider.d.ts +1 -1
- package/dist/context/NavigationContext.d.ts +1 -1
- package/dist/context/RecentItemsProvider.d.ts +2 -2
- package/dist/context/UserStateAdapters.d.ts +1 -1
- package/dist/context/index.d.ts +2 -0
- package/dist/context/index.js +1 -0
- package/dist/hooks/index.d.ts +5 -2
- package/dist/hooks/index.js +4 -1
- package/dist/hooks/useActionModal.d.ts +53 -0
- package/dist/hooks/useActionModal.js +111 -0
- package/dist/hooks/useChatConversation.d.ts +107 -4
- package/dist/hooks/useChatConversation.js +253 -25
- package/dist/hooks/useConsoleActionRuntime.d.ts +70 -0
- package/dist/hooks/useConsoleActionRuntime.js +560 -0
- package/dist/hooks/useConversationList.js +61 -3
- package/dist/hooks/useHomeInbox.d.ts +13 -0
- package/dist/hooks/useHomeInbox.js +142 -0
- package/dist/hooks/useNavPins.js +17 -23
- package/dist/hooks/useNavigationSync.d.ts +33 -0
- package/dist/hooks/useNavigationSync.js +98 -12
- package/dist/hooks/useReconcileOnError.d.ts +40 -0
- package/dist/hooks/useReconcileOnError.js +37 -0
- package/dist/hooks/useRecordApprovals.d.ts +18 -19
- package/dist/hooks/useRecordApprovals.js +24 -40
- package/dist/hooks/useResponsiveSidebar.js +14 -5
- package/dist/hooks/useSettleSignal.d.ts +19 -0
- package/dist/hooks/useSettleSignal.js +20 -0
- package/dist/hooks/useTrackRouteAsRecent.js +35 -0
- package/dist/hooks/useUrlOverlay.d.ts +62 -0
- package/dist/hooks/useUrlOverlay.js +88 -0
- package/dist/index.d.ts +16 -7
- package/dist/index.js +12 -4
- package/dist/layout/ActivityFeed.d.ts +1 -1
- package/dist/layout/AppHeader.d.ts +3 -2
- package/dist/layout/AppHeader.js +237 -72
- package/dist/layout/AppSidebar.d.ts +2 -1
- package/dist/layout/AppSidebar.js +26 -46
- package/dist/layout/AppSwitcher.d.ts +2 -1
- package/dist/layout/AppSwitcher.js +9 -5
- package/dist/layout/AuthPageLayout.d.ts +1 -1
- package/dist/layout/ConnectionStatus.d.ts +1 -1
- package/dist/layout/ConnectionStatus.js +9 -6
- package/dist/layout/ConsoleChatbotFab.d.ts +19 -1
- package/dist/layout/ConsoleChatbotFab.js +16 -2
- package/dist/layout/ConsoleFloatingChatbot.d.ts +32 -2
- package/dist/layout/ConsoleFloatingChatbot.js +374 -41
- package/dist/layout/ConsoleLayout.d.ts +1 -1
- package/dist/layout/ConsoleLayout.js +27 -11
- package/dist/layout/ContextSelectors.d.ts +44 -0
- package/dist/layout/ContextSelectors.js +218 -0
- package/dist/layout/InboxPopover.d.ts +6 -1
- package/dist/layout/InboxPopover.js +25 -6
- package/dist/layout/LocaleSwitcher.d.ts +1 -1
- package/dist/layout/LocalizedSidebarTrigger.d.ts +2 -0
- package/dist/layout/LocalizedSidebarTrigger.js +15 -0
- package/dist/layout/MobileViewSwitcherContext.d.ts +1 -1
- package/dist/layout/ModeToggle.d.ts +1 -1
- package/dist/layout/PageHeader.d.ts +1 -1
- package/dist/layout/UnifiedSidebar.d.ts +2 -1
- package/dist/layout/UnifiedSidebar.js +116 -15
- package/dist/observability/index.d.ts +1 -0
- package/dist/observability/index.js +1 -0
- package/dist/observability/settleSignal.d.ts +64 -0
- package/dist/observability/settleSignal.js +131 -0
- package/dist/preview/DraftChangesPanel.d.ts +19 -0
- package/dist/preview/DraftChangesPanel.js +114 -0
- package/dist/preview/DraftPreviewBar.d.ts +8 -0
- package/dist/preview/DraftPreviewBar.js +86 -0
- package/dist/preview/PreviewDraftEmptyState.d.ts +16 -0
- package/dist/preview/PreviewDraftEmptyState.js +47 -0
- package/dist/preview/PreviewModeContext.d.ts +57 -0
- package/dist/preview/PreviewModeContext.js +99 -0
- package/dist/preview/UnpublishedAppBar.d.ts +8 -0
- package/dist/preview/UnpublishedAppBar.js +79 -0
- package/dist/preview/draftStatus.d.ts +20 -0
- package/dist/preview/draftStatus.js +27 -0
- package/dist/preview/usePublishAllDrafts.d.ts +18 -0
- package/dist/preview/usePublishAllDrafts.js +106 -0
- package/dist/providers/AdapterProvider.d.ts +1 -1
- package/dist/providers/AdapterProvider.js +6 -1
- package/dist/providers/ExpressionProvider.d.ts +1 -1
- package/dist/providers/MetadataProvider.d.ts +17 -2
- package/dist/providers/MetadataProvider.js +183 -12
- package/dist/runtime-config.d.ts +46 -2
- package/dist/runtime-config.js +39 -2
- package/dist/services/builtinComponents.js +68 -59
- package/dist/skeletons/SkeletonDashboard.d.ts +1 -1
- package/dist/skeletons/SkeletonDetail.d.ts +1 -1
- package/dist/skeletons/SkeletonGrid.d.ts +1 -1
- package/dist/utils/appRoute.d.ts +21 -0
- package/dist/utils/appRoute.js +25 -0
- package/dist/utils/deriveRelatedLists.d.ts +54 -0
- package/dist/utils/deriveRelatedLists.js +91 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/managedByEmptyState.d.ts +8 -1
- package/dist/utils/managedByEmptyState.js +13 -7
- package/dist/utils/preferLocal.d.ts +18 -0
- package/dist/utils/preferLocal.js +24 -0
- package/dist/views/ActionConfirmDialog.d.ts +1 -1
- package/dist/views/ActionConfirmDialog.js +3 -1
- package/dist/views/ActionParamDialog.d.ts +6 -1
- package/dist/views/ActionParamDialog.js +9 -3
- package/dist/views/ActionResultDialog.d.ts +13 -0
- package/dist/views/ActionResultDialog.js +134 -0
- package/dist/views/ComponentNavView.d.ts +14 -1
- package/dist/views/CreateViewDialog.d.ts +1 -1
- package/dist/views/DashboardConfigPanel.d.ts +28 -0
- package/dist/views/DashboardConfigPanel.js +81 -0
- package/dist/views/DashboardView.d.ts +4 -3
- package/dist/views/DashboardView.js +38 -239
- package/dist/views/FlowRunner.d.ts +59 -0
- package/dist/views/FlowRunner.js +153 -0
- package/dist/views/InterfaceListPage.d.ts +49 -0
- package/dist/views/InterfaceListPage.js +347 -0
- package/dist/views/MetadataInspector.d.ts +2 -2
- package/dist/views/ObjectView.d.ts +1 -1
- package/dist/views/ObjectView.js +209 -532
- package/dist/views/PageView.d.ts +8 -3
- package/dist/views/PageView.js +45 -32
- package/dist/views/RecordDetailView.d.ts +1 -1
- package/dist/views/RecordDetailView.js +363 -148
- package/dist/views/RecordFormPage.d.ts +1 -1
- package/dist/views/RecordFormPage.js +26 -1
- package/dist/views/ReportConfigPanel.d.ts +37 -0
- package/dist/views/ReportConfigPanel.js +85 -0
- package/dist/views/ReportView.d.ts +1 -1
- package/dist/views/ReportView.js +116 -7
- package/dist/views/RuntimeDraftBar.d.ts +30 -0
- package/dist/views/RuntimeDraftBar.js +112 -0
- package/dist/views/SearchResultsPage.d.ts +1 -1
- package/dist/views/SearchResultsPage.js +8 -18
- package/dist/views/ViewConfigPanel.d.ts +24 -17
- package/dist/views/ViewConfigPanel.js +121 -77
- package/dist/views/index.d.ts +1 -1
- package/dist/views/index.js +1 -1
- package/dist/views/metadata-admin/AuditPanel.d.ts +28 -0
- package/dist/views/metadata-admin/AuditPanel.js +79 -0
- package/dist/views/metadata-admin/DiagnosticsPage.d.ts +20 -0
- package/dist/views/metadata-admin/DiagnosticsPage.js +69 -0
- package/dist/views/metadata-admin/DirectoryPage.d.ts +16 -1
- package/dist/views/metadata-admin/DirectoryPage.js +113 -24
- package/dist/views/metadata-admin/DraftReviewPanel.d.ts +33 -0
- package/dist/views/metadata-admin/DraftReviewPanel.js +77 -0
- package/dist/views/metadata-admin/EmbeddedItemEditor.d.ts +17 -1
- package/dist/views/metadata-admin/EmbeddedItemEditor.js +15 -8
- package/dist/views/metadata-admin/JsonSourceEditor.d.ts +37 -0
- package/dist/views/metadata-admin/JsonSourceEditor.js +178 -0
- package/dist/views/metadata-admin/LayeredDiff.d.ts +39 -1
- package/dist/views/metadata-admin/LayeredDiff.js +171 -5
- package/dist/views/metadata-admin/MetadataDetailDrawer.d.ts +15 -1
- package/dist/views/metadata-admin/MetadataTypeActions.d.ts +48 -0
- package/dist/views/metadata-admin/MetadataTypeActions.js +165 -0
- package/dist/views/metadata-admin/PackagesPage.d.ts +18 -0
- package/dist/views/metadata-admin/PackagesPage.js +395 -0
- package/dist/views/metadata-admin/PageShell.d.ts +1 -1
- package/dist/views/metadata-admin/PageShell.js +9 -4
- package/dist/views/metadata-admin/PermissionMatrixEditor.d.ts +35 -1
- package/dist/views/metadata-admin/QuickFind.d.ts +21 -1
- package/dist/views/metadata-admin/QuickFind.js +6 -3
- package/dist/views/metadata-admin/RelatedPanel.d.ts +24 -1
- package/dist/views/metadata-admin/RelatedPanel.js +20 -18
- package/dist/views/metadata-admin/ResourceEditPage.d.ts +40 -1
- package/dist/views/metadata-admin/ResourceEditPage.js +1223 -60
- package/dist/views/metadata-admin/ResourceHistoryPage.d.ts +39 -1
- package/dist/views/metadata-admin/ResourceHistoryPage.js +66 -16
- package/dist/views/metadata-admin/ResourceListPage.d.ts +13 -1
- package/dist/views/metadata-admin/ResourceListPage.js +266 -30
- package/dist/views/metadata-admin/ResourceRouter.d.ts +23 -1
- package/dist/views/metadata-admin/SchemaForm.d.ts +34 -1
- package/dist/views/metadata-admin/SchemaForm.js +559 -49
- package/dist/views/metadata-admin/StudioHomePage.d.ts +22 -0
- package/dist/views/metadata-admin/StudioHomePage.js +213 -0
- package/dist/views/metadata-admin/anchors.js +237 -24
- package/dist/views/metadata-admin/clientValidation.d.ts +50 -0
- package/dist/views/metadata-admin/clientValidation.js +169 -0
- package/dist/views/metadata-admin/color-variant-field.d.ts +30 -0
- package/dist/views/metadata-admin/color-variant-field.js +38 -0
- package/dist/views/metadata-admin/createDerive.d.ts +75 -0
- package/dist/views/metadata-admin/createDerive.js +179 -0
- package/dist/views/metadata-admin/dashboard-schema.d.ts +12 -0
- package/dist/views/metadata-admin/dashboard-schema.js +80 -0
- package/dist/views/metadata-admin/datasource/DatasourceResourcePage.d.ts +35 -0
- package/dist/views/metadata-admin/datasource/DatasourceResourcePage.js +327 -0
- package/dist/views/metadata-admin/datasource/register.d.ts +1 -0
- package/dist/views/metadata-admin/datasource/register.js +24 -0
- package/dist/views/metadata-admin/default-inspector-registry.d.ts +49 -0
- package/dist/views/metadata-admin/default-inspector-registry.js +8 -0
- package/dist/views/metadata-admin/default-schemas.js +115 -10
- package/dist/views/metadata-admin/external/ExternalDatasourcePanel.d.ts +27 -0
- package/dist/views/metadata-admin/external/ExternalDatasourcePanel.js +69 -0
- package/dist/views/metadata-admin/external/ImportObjectDialog.d.ts +27 -0
- package/dist/views/metadata-admin/external/ImportObjectDialog.js +77 -0
- package/dist/views/metadata-admin/external/SchemaBrowser.d.ts +16 -0
- package/dist/views/metadata-admin/external/SchemaBrowser.js +74 -0
- package/dist/views/metadata-admin/external/ValidationPanel.d.ts +16 -0
- package/dist/views/metadata-admin/external/ValidationPanel.js +68 -0
- package/dist/views/metadata-admin/external/api.d.ts +100 -0
- package/dist/views/metadata-admin/external/api.js +124 -0
- package/dist/views/metadata-admin/i18n.d.ts +1 -0
- package/dist/views/metadata-admin/i18n.js +1166 -2
- package/dist/views/metadata-admin/index.d.ts +8 -5
- package/dist/views/metadata-admin/index.js +12 -2
- package/dist/views/metadata-admin/inspector-registry.d.ts +51 -0
- package/dist/views/metadata-admin/inspector-registry.js +11 -0
- package/dist/views/metadata-admin/inspectors/ActionDefaultInspector.d.ts +30 -0
- package/dist/views/metadata-admin/inspectors/ActionDefaultInspector.js +180 -0
- package/dist/views/metadata-admin/inspectors/AppNavInspector.d.ts +16 -0
- package/dist/views/metadata-admin/inspectors/AppNavInspector.js +110 -0
- package/dist/views/metadata-admin/inspectors/ConditionBuilder.d.ts +29 -0
- package/dist/views/metadata-admin/inspectors/ConditionBuilder.js +154 -0
- package/dist/views/metadata-admin/inspectors/DashboardDefaultInspector.d.ts +28 -0
- package/dist/views/metadata-admin/inspectors/DashboardDefaultInspector.js +110 -0
- package/dist/views/metadata-admin/inspectors/DashboardWidgetInspector.d.ts +18 -0
- package/dist/views/metadata-admin/inspectors/DashboardWidgetInspector.js +139 -0
- package/dist/views/metadata-admin/inspectors/DatasetDefaultInspector.d.ts +21 -0
- package/dist/views/metadata-admin/inspectors/DatasetDefaultInspector.js +107 -0
- package/dist/views/metadata-admin/inspectors/FlowEdgeInspector.d.ts +16 -0
- package/dist/views/metadata-admin/inspectors/FlowEdgeInspector.js +45 -0
- package/dist/views/metadata-admin/inspectors/FlowInspector.d.ts +12 -0
- package/dist/views/metadata-admin/inspectors/FlowInspector.js +9 -0
- package/dist/views/metadata-admin/inspectors/FlowKeyValueField.d.ts +30 -0
- package/dist/views/metadata-admin/inspectors/FlowKeyValueField.js +125 -0
- package/dist/views/metadata-admin/inspectors/FlowNodeConfigField.d.ts +18 -0
- package/dist/views/metadata-admin/inspectors/FlowNodeConfigField.js +40 -0
- package/dist/views/metadata-admin/inspectors/FlowNodeInspector.d.ts +14 -0
- package/dist/views/metadata-admin/inspectors/FlowNodeInspector.js +140 -0
- package/dist/views/metadata-admin/inspectors/FlowObjectListField.d.ts +26 -0
- package/dist/views/metadata-admin/inspectors/FlowObjectListField.js +105 -0
- package/dist/views/metadata-admin/inspectors/FlowReferenceField.d.ts +83 -0
- package/dist/views/metadata-admin/inspectors/FlowReferenceField.js +181 -0
- package/dist/views/metadata-admin/inspectors/FlowStringListField.d.ts +21 -0
- package/dist/views/metadata-admin/inspectors/FlowStringListField.js +60 -0
- package/dist/views/metadata-admin/inspectors/InspectorComboField.d.ts +40 -0
- package/dist/views/metadata-admin/inspectors/InspectorComboField.js +61 -0
- package/dist/views/metadata-admin/inspectors/ObjectDefaultInspector.d.ts +21 -0
- package/dist/views/metadata-admin/inspectors/ObjectDefaultInspector.js +54 -0
- package/dist/views/metadata-admin/inspectors/ObjectFieldInspector.d.ts +23 -0
- package/dist/views/metadata-admin/inspectors/ObjectFieldInspector.js +330 -0
- package/dist/views/metadata-admin/inspectors/PageBlockInspector.d.ts +48 -0
- package/dist/views/metadata-admin/inspectors/PageBlockInspector.js +332 -0
- package/dist/views/metadata-admin/inspectors/ReportDefaultInspector.d.ts +58 -0
- package/dist/views/metadata-admin/inspectors/ReportDefaultInspector.js +160 -0
- package/dist/views/metadata-admin/inspectors/ViewColumnInspector.d.ts +19 -0
- package/dist/views/metadata-admin/inspectors/ViewColumnInspector.js +144 -0
- package/dist/views/metadata-admin/inspectors/ViewInspector.d.ts +19 -0
- package/dist/views/metadata-admin/inspectors/ViewInspector.js +21 -0
- package/dist/views/metadata-admin/inspectors/ViewVariantInspector.d.ts +54 -0
- package/dist/views/metadata-admin/inspectors/ViewVariantInspector.js +191 -0
- package/dist/views/metadata-admin/inspectors/_shared.d.ts +124 -0
- package/dist/views/metadata-admin/inspectors/_shared.js +113 -0
- package/dist/views/metadata-admin/inspectors/expression-validate.d.ts +26 -0
- package/dist/views/metadata-admin/inspectors/expression-validate.js +66 -0
- package/dist/views/metadata-admin/inspectors/flow-node-config.d.ts +143 -0
- package/dist/views/metadata-admin/inspectors/flow-node-config.js +461 -0
- package/dist/views/metadata-admin/inspectors/index.d.ts +1 -0
- package/dist/views/metadata-admin/inspectors/index.js +45 -0
- package/dist/views/metadata-admin/inspectors/json-schema-to-fields.d.ts +40 -0
- package/dist/views/metadata-admin/inspectors/json-schema-to-fields.js +227 -0
- package/dist/views/metadata-admin/inspectors/useDatasetFields.d.ts +72 -0
- package/dist/views/metadata-admin/inspectors/useDatasetFields.js +0 -0
- package/dist/views/metadata-admin/mergeServerFields.d.ts +65 -0
- package/dist/views/metadata-admin/mergeServerFields.js +56 -0
- package/dist/views/metadata-admin/preview-registry.d.ts +55 -0
- package/dist/views/metadata-admin/previews/ActionPreview.d.ts +25 -0
- package/dist/views/metadata-admin/previews/ActionPreview.js +238 -0
- package/dist/views/metadata-admin/previews/AddWidgetPicker.d.ts +12 -0
- package/dist/views/metadata-admin/previews/AddWidgetPicker.js +56 -0
- package/dist/views/metadata-admin/previews/AgentPreview.d.ts +24 -0
- package/dist/views/metadata-admin/previews/AgentPreview.js +100 -0
- package/dist/views/metadata-admin/previews/AppNavCanvas.d.ts +31 -0
- package/dist/views/metadata-admin/previews/AppNavCanvas.js +260 -0
- package/dist/views/metadata-admin/previews/AppPreview.d.ts +16 -1
- package/dist/views/metadata-admin/previews/AppPreview.js +23 -14
- package/dist/views/metadata-admin/previews/BookPreview.d.ts +20 -0
- package/dist/views/metadata-admin/previews/BookPreview.js +132 -0
- package/dist/views/metadata-admin/previews/DashboardPreview.d.ts +16 -1
- package/dist/views/metadata-admin/previews/DashboardPreview.js +110 -8
- package/dist/views/metadata-admin/previews/DatasetPreview.d.ts +18 -0
- package/dist/views/metadata-admin/previews/DatasetPreview.js +89 -0
- package/dist/views/metadata-admin/previews/DatasourcePreview.d.ts +23 -0
- package/dist/views/metadata-admin/previews/DatasourcePreview.js +68 -0
- package/dist/views/metadata-admin/previews/EmailTemplatePreview.d.ts +14 -1
- package/dist/views/metadata-admin/previews/FieldStub.d.ts +30 -0
- package/dist/views/metadata-admin/previews/FieldStub.js +104 -0
- package/dist/views/metadata-admin/previews/FieldsListEditor.d.ts +50 -0
- package/dist/views/metadata-admin/previews/FieldsListEditor.js +97 -0
- package/dist/views/metadata-admin/previews/FlowCanvas.d.ts +43 -0
- package/dist/views/metadata-admin/previews/FlowCanvas.js +328 -0
- package/dist/views/metadata-admin/previews/FlowPreview.d.ts +20 -0
- package/dist/views/metadata-admin/previews/FlowPreview.js +92 -0
- package/dist/views/metadata-admin/previews/FlowRunsPanel.d.ts +46 -0
- package/dist/views/metadata-admin/previews/FlowRunsPanel.js +97 -0
- package/dist/views/metadata-admin/previews/FlowSimulatorPanel.d.ts +25 -0
- package/dist/views/metadata-admin/previews/FlowSimulatorPanel.js +170 -0
- package/dist/views/metadata-admin/previews/JobPreview.d.ts +28 -0
- package/dist/views/metadata-admin/previews/JobPreview.js +290 -0
- package/dist/views/metadata-admin/previews/ObjectFormCanvas.d.ts +30 -0
- package/dist/views/metadata-admin/previews/ObjectFormCanvas.js +547 -0
- package/dist/views/metadata-admin/previews/ObjectPreview.d.ts +14 -1
- package/dist/views/metadata-admin/previews/ObjectPreview.js +5 -30
- package/dist/views/metadata-admin/previews/OutlineStrip.d.ts +32 -0
- package/dist/views/metadata-admin/previews/OutlineStrip.js +8 -0
- package/dist/views/metadata-admin/previews/PageBlockCanvas.d.ts +49 -0
- package/dist/views/metadata-admin/previews/PageBlockCanvas.js +510 -0
- package/dist/views/metadata-admin/previews/PagePreview.d.ts +10 -1
- package/dist/views/metadata-admin/previews/PagePreview.js +90 -4
- package/dist/views/metadata-admin/previews/PermissionPreview.d.ts +27 -0
- package/dist/views/metadata-admin/previews/PermissionPreview.js +115 -0
- package/dist/views/metadata-admin/previews/PreviewShell.d.ts +29 -6
- package/dist/views/metadata-admin/previews/PreviewShell.js +16 -3
- package/dist/views/metadata-admin/previews/ReportPreview.d.ts +18 -1
- package/dist/views/metadata-admin/previews/ReportPreview.js +23 -15
- package/dist/views/metadata-admin/previews/RolePreview.d.ts +19 -0
- package/dist/views/metadata-admin/previews/RolePreview.js +14 -0
- package/dist/views/metadata-admin/previews/SkillPreview.d.ts +22 -0
- package/dist/views/metadata-admin/previews/SkillPreview.js +34 -0
- package/dist/views/metadata-admin/previews/ToolPreview.d.ts +25 -0
- package/dist/views/metadata-admin/previews/ToolPreview.js +122 -0
- package/dist/views/metadata-admin/previews/TranslationPreview.d.ts +25 -0
- package/dist/views/metadata-admin/previews/TranslationPreview.js +52 -0
- package/dist/views/metadata-admin/previews/ValidationPreview.d.ts +27 -0
- package/dist/views/metadata-admin/previews/ValidationPreview.js +110 -0
- package/dist/views/metadata-admin/previews/ViewColumnPanes.d.ts +62 -0
- package/dist/views/metadata-admin/previews/ViewColumnPanes.js +140 -0
- package/dist/views/metadata-admin/previews/ViewPreview.d.ts +23 -1
- package/dist/views/metadata-admin/previews/ViewPreview.js +101 -73
- package/dist/views/metadata-admin/previews/block-config.d.ts +82 -0
- package/dist/views/metadata-admin/previews/block-config.js +324 -0
- package/dist/views/metadata-admin/previews/block-types.d.ts +40 -0
- package/dist/views/metadata-admin/previews/block-types.js +110 -0
- package/dist/views/metadata-admin/previews/field-types.d.ts +53 -0
- package/dist/views/metadata-admin/previews/field-types.js +97 -0
- package/dist/views/metadata-admin/previews/flow-canvas-layout.d.ts +88 -0
- package/dist/views/metadata-admin/previews/flow-canvas-layout.js +190 -0
- package/dist/views/metadata-admin/previews/flow-canvas-parts.d.ts +88 -0
- package/dist/views/metadata-admin/previews/flow-canvas-parts.js +358 -0
- package/dist/views/metadata-admin/previews/form-preview.d.ts +24 -0
- package/dist/views/metadata-admin/previews/form-preview.js +29 -0
- package/dist/views/metadata-admin/previews/index.js +43 -0
- package/dist/views/metadata-admin/previews/object-fields-bridge.d.ts +66 -0
- package/dist/views/metadata-admin/previews/object-fields-bridge.js +171 -0
- package/dist/views/metadata-admin/previews/object-fields-io.d.ts +109 -0
- package/dist/views/metadata-admin/previews/object-fields-io.js +208 -0
- package/dist/views/metadata-admin/previews/simulator/flow-sim-types.d.ts +91 -0
- package/dist/views/metadata-admin/previews/simulator/flow-sim-types.js +2 -0
- package/dist/views/metadata-admin/previews/simulator/flow-sim-validate.d.ts +8 -0
- package/dist/views/metadata-admin/previews/simulator/flow-sim-validate.js +113 -0
- package/dist/views/metadata-admin/previews/simulator/flow-simulator.d.ts +44 -0
- package/dist/views/metadata-admin/previews/simulator/flow-simulator.js +316 -0
- package/dist/views/metadata-admin/previews/useDatasetCatalog.d.ts +47 -0
- package/dist/views/metadata-admin/previews/useDatasetCatalog.js +133 -0
- package/dist/views/metadata-admin/previews/useFlowNodePalette.d.ts +44 -0
- package/dist/views/metadata-admin/previews/useFlowNodePalette.js +124 -0
- package/dist/views/metadata-admin/previews/useMetaOptions.d.ts +8 -0
- package/dist/views/metadata-admin/previews/useMetaOptions.js +50 -0
- package/dist/views/metadata-admin/previews/useObjectFields.d.ts +23 -0
- package/dist/views/metadata-admin/previews/useObjectFields.js +79 -0
- package/dist/views/metadata-admin/previews/useObjectOptions.d.ts +8 -0
- package/dist/views/metadata-admin/previews/useObjectOptions.js +43 -0
- package/dist/views/metadata-admin/previews/view-column-io.d.ts +42 -0
- package/dist/views/metadata-admin/previews/view-column-io.js +73 -0
- package/dist/views/metadata-admin/previews/widget-types.d.ts +24 -0
- package/dist/views/metadata-admin/previews/widget-types.js +40 -0
- package/dist/views/metadata-admin/registry.d.ts +140 -19
- package/dist/views/metadata-admin/report-schema.d.ts +26 -0
- package/dist/views/metadata-admin/report-schema.js +121 -0
- package/dist/views/metadata-admin/useMetadata.d.ts +100 -2
- package/dist/views/metadata-admin/useMetadata.js +155 -4
- package/dist/views/metadata-admin/view-item-normalize.d.ts +20 -0
- package/dist/views/metadata-admin/view-item-normalize.js +68 -0
- package/dist/views/metadata-admin/view-schema.d.ts +16 -0
- package/dist/views/metadata-admin/view-schema.js +107 -0
- package/dist/views/metadata-admin/view-variant-model.d.ts +23 -0
- package/dist/views/metadata-admin/view-variant-model.js +64 -0
- package/dist/views/metadata-admin/widgets.d.ts +89 -1
- package/dist/views/metadata-admin/widgets.js +491 -17
- package/dist/views/runtime-metadata-persistence.d.ts +78 -0
- package/dist/views/runtime-metadata-persistence.js +89 -0
- package/dist/views/useOpenRecordList.d.ts +18 -0
- package/dist/views/useOpenRecordList.js +36 -0
- package/dist/views/userFilterUrlState.d.ts +15 -0
- package/dist/views/userFilterUrlState.js +53 -0
- package/dist/views/view-config-adapter.d.ts +38 -0
- package/dist/views/view-config-adapter.js +80 -0
- package/package.json +52 -34
- package/dist/views/DesignDrawer.d.ts +0 -28
- package/dist/views/DesignDrawer.js +0 -51
- package/dist/views/metadata-admin/DesignerEditorWrapper.d.ts +0 -68
- package/dist/views/metadata-admin/DesignerEditorWrapper.js +0 -158
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type PaletteItem } from './flow-canvas-parts';
|
|
2
|
+
/** Minimal shape of an engine action descriptor we consume. */
|
|
3
|
+
interface ActionDescriptorLite {
|
|
4
|
+
type: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
paradigms?: string[];
|
|
8
|
+
deprecated?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* JSON Schema for the node's `config` (ADR-0018 §configSchema). Present only
|
|
11
|
+
* for actions whose executor publishes one (e.g. the ADR-0019 approval node).
|
|
12
|
+
* Drives the inspector's server-rendered property form.
|
|
13
|
+
*/
|
|
14
|
+
configSchema?: unknown;
|
|
15
|
+
}
|
|
16
|
+
/** Server API base — shared by the palette fetch and the runs panel. */
|
|
17
|
+
export declare function apiBase(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Merge engine descriptors onto the hardcoded base. Base order is canonical;
|
|
20
|
+
* a descriptor overlays its base entry's label/hint (so the engine is the
|
|
21
|
+
* source of truth for naming), and engine-only types are appended.
|
|
22
|
+
*/
|
|
23
|
+
export declare function mergePalette(base: PaletteItem[], descriptors: ActionDescriptorLite[]): PaletteItem[];
|
|
24
|
+
/**
|
|
25
|
+
* Fetch the running engine's published action descriptors from
|
|
26
|
+
* `GET /api/v1/automation/actions`. Returns `[]` while loading or on any error
|
|
27
|
+
* (offline / plugin absent / older backend), so consumers fall back to their
|
|
28
|
+
* hardcoded defaults. Shared by both the palette and the inspector's
|
|
29
|
+
* server-driven config form.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useActionDescriptors(): ActionDescriptorLite[];
|
|
32
|
+
/**
|
|
33
|
+
* Returns the node palette merged with the running engine's published
|
|
34
|
+
* descriptors. Falls back to {@link NODE_PALETTE} while loading or on any
|
|
35
|
+
* error, so the designer always has a usable palette.
|
|
36
|
+
*/
|
|
37
|
+
export declare function useFlowNodePalette(): PaletteItem[];
|
|
38
|
+
/**
|
|
39
|
+
* Map of node `type` → published config JSON Schema, for the actions whose
|
|
40
|
+
* executor publishes one. Empty while loading / offline, so the inspector
|
|
41
|
+
* falls back to its hardcoded field group for every type.
|
|
42
|
+
*/
|
|
43
|
+
export declare function useActionConfigSchemas(): Record<string, unknown>;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
|
|
2
|
+
/**
|
|
3
|
+
* useFlowNodePalette — server-driven node palette for the flow designer.
|
|
4
|
+
*
|
|
5
|
+
* The set of node types a flow can use is owned by the automation **engine**,
|
|
6
|
+
* not the client: built-in node packs and plugins (e.g. the ADR-0019
|
|
7
|
+
* `approval` node contributed by the approvals plugin, or third-party
|
|
8
|
+
* `connector_action` providers) publish an `ActionDescriptor` that the engine
|
|
9
|
+
* exposes at `GET /api/v1/automation/actions` — the same registry that backs
|
|
10
|
+
* server-side flow validation. Driving the palette from that endpoint keeps the
|
|
11
|
+
* designer in lock-step with what the running backend actually supports.
|
|
12
|
+
*
|
|
13
|
+
* The hardcoded {@link NODE_PALETTE} stays as the base: it supplies the
|
|
14
|
+
* structural / control nodes the engine does not publish as actions (subflow,
|
|
15
|
+
* wait, end, connector_action) and acts as an offline fallback so the designer
|
|
16
|
+
* still works when the endpoint is unreachable or the plugin is not installed.
|
|
17
|
+
* Server descriptors are overlaid on top — keeping the base ordering, adopting
|
|
18
|
+
* the engine's labels/descriptions, and appending any engine-only node types
|
|
19
|
+
* (and future plugin nodes) the base doesn't list.
|
|
20
|
+
*/
|
|
21
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
22
|
+
import { NODE_PALETTE, nodeCategory } from './flow-canvas-parts';
|
|
23
|
+
/** Server API base — shared by the palette fetch and the runs panel. */
|
|
24
|
+
export function apiBase() {
|
|
25
|
+
const url = import.meta.env?.VITE_SERVER_URL || '';
|
|
26
|
+
return `${String(url).replace(/\/$/, '')}/api/v1`;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Merge engine descriptors onto the hardcoded base. Base order is canonical;
|
|
30
|
+
* a descriptor overlays its base entry's label/hint (so the engine is the
|
|
31
|
+
* source of truth for naming), and engine-only types are appended.
|
|
32
|
+
*/
|
|
33
|
+
export function mergePalette(base, descriptors) {
|
|
34
|
+
const byType = new Map();
|
|
35
|
+
for (const item of base)
|
|
36
|
+
byType.set(item.type, item);
|
|
37
|
+
for (const d of descriptors) {
|
|
38
|
+
if (!d?.type)
|
|
39
|
+
continue;
|
|
40
|
+
if (d.deprecated)
|
|
41
|
+
continue;
|
|
42
|
+
// The flow designer only offers flow-capable nodes. Descriptors without a
|
|
43
|
+
// paradigm list are treated as flow-capable (conservative default).
|
|
44
|
+
if (Array.isArray(d.paradigms) && d.paradigms.length > 0 && !d.paradigms.includes('flow'))
|
|
45
|
+
continue;
|
|
46
|
+
const existing = byType.get(d.type);
|
|
47
|
+
byType.set(d.type, {
|
|
48
|
+
type: d.type,
|
|
49
|
+
label: d.name || existing?.label || d.type,
|
|
50
|
+
hint: d.description || existing?.hint,
|
|
51
|
+
// Keep the base item's section; infer one for engine-only/plugin types so
|
|
52
|
+
// they still group sensibly in the palette.
|
|
53
|
+
category: existing?.category ?? nodeCategory(d.type),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return [...byType.values()];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Fetch the running engine's published action descriptors from
|
|
60
|
+
* `GET /api/v1/automation/actions`. Returns `[]` while loading or on any error
|
|
61
|
+
* (offline / plugin absent / older backend), so consumers fall back to their
|
|
62
|
+
* hardcoded defaults. Shared by both the palette and the inspector's
|
|
63
|
+
* server-driven config form.
|
|
64
|
+
*/
|
|
65
|
+
export function useActionDescriptors() {
|
|
66
|
+
const [descriptors, setDescriptors] = useState([]);
|
|
67
|
+
// Avoid a state update after unmount (the fetch resolves async).
|
|
68
|
+
const alive = useRef(true);
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
alive.current = true;
|
|
71
|
+
const controller = new AbortController();
|
|
72
|
+
(async () => {
|
|
73
|
+
try {
|
|
74
|
+
const res = await fetch(`${apiBase()}/automation/actions`, {
|
|
75
|
+
credentials: 'include',
|
|
76
|
+
headers: { 'Content-Type': 'application/json' },
|
|
77
|
+
signal: controller.signal,
|
|
78
|
+
});
|
|
79
|
+
if (!res.ok)
|
|
80
|
+
return; // keep fallbacks (404/501 when plugin absent)
|
|
81
|
+
const payload = (await res.json());
|
|
82
|
+
const actions = payload?.data?.actions;
|
|
83
|
+
if (!Array.isArray(actions) || actions.length === 0)
|
|
84
|
+
return;
|
|
85
|
+
if (alive.current)
|
|
86
|
+
setDescriptors(actions);
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
/* offline / aborted — keep the hardcoded fallback */
|
|
90
|
+
}
|
|
91
|
+
})();
|
|
92
|
+
return () => {
|
|
93
|
+
alive.current = false;
|
|
94
|
+
controller.abort();
|
|
95
|
+
};
|
|
96
|
+
}, []);
|
|
97
|
+
return descriptors;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Returns the node palette merged with the running engine's published
|
|
101
|
+
* descriptors. Falls back to {@link NODE_PALETTE} while loading or on any
|
|
102
|
+
* error, so the designer always has a usable palette.
|
|
103
|
+
*/
|
|
104
|
+
export function useFlowNodePalette() {
|
|
105
|
+
const descriptors = useActionDescriptors();
|
|
106
|
+
return useMemo(() => (descriptors.length ? mergePalette(NODE_PALETTE, descriptors) : NODE_PALETTE), [descriptors]);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Map of node `type` → published config JSON Schema, for the actions whose
|
|
110
|
+
* executor publishes one. Empty while loading / offline, so the inspector
|
|
111
|
+
* falls back to its hardcoded field group for every type.
|
|
112
|
+
*/
|
|
113
|
+
export function useActionConfigSchemas() {
|
|
114
|
+
const descriptors = useActionDescriptors();
|
|
115
|
+
return useMemo(() => {
|
|
116
|
+
const map = {};
|
|
117
|
+
for (const d of descriptors) {
|
|
118
|
+
if (d?.type && d.configSchema !== undefined && d.configSchema !== null) {
|
|
119
|
+
map[d.type] = d.configSchema;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return map;
|
|
123
|
+
}, [descriptors]);
|
|
124
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
|
|
2
|
+
/**
|
|
3
|
+
* useMetaOptions — name+label options for ANY metadata type (generalises
|
|
4
|
+
* {@link useObjectOptions}). Powers reference pickers that point at a metadata
|
|
5
|
+
* record by name (e.g. an Action's `target` → a flow / page / view). Async;
|
|
6
|
+
* degrades to an empty list so callers fall back to a free-text input. Pass
|
|
7
|
+
* `null` to skip fetching.
|
|
8
|
+
*/
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import { useMetadataClient } from '../useMetadata';
|
|
11
|
+
export function useMetaOptions(type) {
|
|
12
|
+
const client = useMetadataClient();
|
|
13
|
+
const [options, setOptions] = React.useState([]);
|
|
14
|
+
const [loading, setLoading] = React.useState(!!type);
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
if (!type) {
|
|
17
|
+
setOptions([]);
|
|
18
|
+
setLoading(false);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
let cancelled = false;
|
|
22
|
+
setLoading(true);
|
|
23
|
+
client
|
|
24
|
+
.list(type)
|
|
25
|
+
.then((items) => {
|
|
26
|
+
if (cancelled)
|
|
27
|
+
return;
|
|
28
|
+
const mapped = (items ?? [])
|
|
29
|
+
.map((raw) => (raw && typeof raw === 'object' && 'item' in raw ? raw.item : raw))
|
|
30
|
+
.filter((i) => typeof i?.name === 'string' && i.name)
|
|
31
|
+
.map((i) => ({
|
|
32
|
+
value: i.name,
|
|
33
|
+
label: i.label ? `${i.label} (${i.name})` : i.name,
|
|
34
|
+
}))
|
|
35
|
+
.sort((a, b) => a.value.localeCompare(b.value));
|
|
36
|
+
setOptions(mapped);
|
|
37
|
+
setLoading(false);
|
|
38
|
+
})
|
|
39
|
+
.catch(() => {
|
|
40
|
+
if (!cancelled) {
|
|
41
|
+
setOptions([]);
|
|
42
|
+
setLoading(false);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return () => {
|
|
46
|
+
cancelled = true;
|
|
47
|
+
};
|
|
48
|
+
}, [client, type]);
|
|
49
|
+
return { options, loading };
|
|
50
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface ObjectFieldInfo {
|
|
2
|
+
/** snake_case API name. */
|
|
3
|
+
name: string;
|
|
4
|
+
/** Human label (falls back to the name). */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Raw field type id (e.g. 'text', 'lookup'). */
|
|
7
|
+
type: string;
|
|
8
|
+
hidden: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface UseObjectFieldsResult {
|
|
11
|
+
fields: ObjectFieldInfo[];
|
|
12
|
+
loading: boolean;
|
|
13
|
+
error: string | null;
|
|
14
|
+
}
|
|
15
|
+
export declare function useObjectFields(objectName: string | undefined,
|
|
16
|
+
/**
|
|
17
|
+
* Pre-resolved field catalog. When supplied the hook skips the network
|
|
18
|
+
* fetch entirely and returns this list verbatim — used by hosts that
|
|
19
|
+
* already hold the object definition (e.g. the runtime ViewConfigPanel,
|
|
20
|
+
* which reads `objectDef.fields`) so the inspector has zero network
|
|
21
|
+
* dependency.
|
|
22
|
+
*/
|
|
23
|
+
override?: ObjectFieldInfo[]): UseObjectFieldsResult;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
|
|
2
|
+
/**
|
|
3
|
+
* useObjectFields — loads an Object's field catalog for the View column
|
|
4
|
+
* configurator's "Available fields" pane.
|
|
5
|
+
*
|
|
6
|
+
* Reads `object.fields` (record OR array shape) via the shared
|
|
7
|
+
* MetadataClient and normalizes it into a flat, ordered list the picker
|
|
8
|
+
* can render. Hidden fields are kept (admins legitimately surface them)
|
|
9
|
+
* but flagged so the picker can de-emphasize them.
|
|
10
|
+
*
|
|
11
|
+
* The hook is defensive: a missing object name, a 404, or a transport
|
|
12
|
+
* error all resolve to an empty list with `error` set, so the configurator
|
|
13
|
+
* can gracefully fall back to manual column entry.
|
|
14
|
+
*/
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
import { useMetadataClient } from '../useMetadata';
|
|
17
|
+
import { readFields } from './object-fields-io';
|
|
18
|
+
export function useObjectFields(objectName,
|
|
19
|
+
/**
|
|
20
|
+
* Pre-resolved field catalog. When supplied the hook skips the network
|
|
21
|
+
* fetch entirely and returns this list verbatim — used by hosts that
|
|
22
|
+
* already hold the object definition (e.g. the runtime ViewConfigPanel,
|
|
23
|
+
* which reads `objectDef.fields`) so the inspector has zero network
|
|
24
|
+
* dependency.
|
|
25
|
+
*/
|
|
26
|
+
override) {
|
|
27
|
+
const client = useMetadataClient();
|
|
28
|
+
const [state, setState] = React.useState({
|
|
29
|
+
fields: [],
|
|
30
|
+
loading: !override && !!objectName,
|
|
31
|
+
error: null,
|
|
32
|
+
});
|
|
33
|
+
React.useEffect(() => {
|
|
34
|
+
// Override short-circuits the fetch: trust the caller-supplied catalog.
|
|
35
|
+
if (override) {
|
|
36
|
+
setState({ fields: override, loading: false, error: null });
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (!objectName) {
|
|
40
|
+
setState({ fields: [], loading: false, error: null });
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
let cancelled = false;
|
|
44
|
+
setState((s) => ({ ...s, loading: true, error: null }));
|
|
45
|
+
client
|
|
46
|
+
.get('object', objectName)
|
|
47
|
+
.then((obj) => {
|
|
48
|
+
if (cancelled)
|
|
49
|
+
return;
|
|
50
|
+
if (!obj) {
|
|
51
|
+
setState({ fields: [], loading: false, error: 'Object not found' });
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const view = readFields(obj.fields);
|
|
55
|
+
const fields = view.entries.map((e) => ({
|
|
56
|
+
name: e.name,
|
|
57
|
+
label: typeof e.def.label === 'string' && e.def.label
|
|
58
|
+
? e.def.label
|
|
59
|
+
: e.name,
|
|
60
|
+
type: typeof e.def.type === 'string' ? e.def.type : 'text',
|
|
61
|
+
hidden: e.def.hidden === true,
|
|
62
|
+
}));
|
|
63
|
+
setState({ fields, loading: false, error: null });
|
|
64
|
+
})
|
|
65
|
+
.catch((err) => {
|
|
66
|
+
if (cancelled)
|
|
67
|
+
return;
|
|
68
|
+
setState({
|
|
69
|
+
fields: [],
|
|
70
|
+
loading: false,
|
|
71
|
+
error: err?.message ?? String(err),
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
return () => {
|
|
75
|
+
cancelled = true;
|
|
76
|
+
};
|
|
77
|
+
}, [client, objectName, override]);
|
|
78
|
+
return state;
|
|
79
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
|
|
2
|
+
/**
|
|
3
|
+
* useObjectOptions — the list of objects (name + label) for object pickers in
|
|
4
|
+
* the page-editor block inspector. Async; degrades to an empty list (the
|
|
5
|
+
* picker then falls back to a free-text input).
|
|
6
|
+
*/
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { useMetadataClient } from '../useMetadata';
|
|
9
|
+
export function useObjectOptions() {
|
|
10
|
+
const client = useMetadataClient();
|
|
11
|
+
const [options, setOptions] = React.useState([]);
|
|
12
|
+
const [loading, setLoading] = React.useState(true);
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
let cancelled = false;
|
|
15
|
+
setLoading(true);
|
|
16
|
+
client
|
|
17
|
+
.list('object')
|
|
18
|
+
.then((items) => {
|
|
19
|
+
if (cancelled)
|
|
20
|
+
return;
|
|
21
|
+
const mapped = (items ?? [])
|
|
22
|
+
.map((raw) => (raw && typeof raw === 'object' && 'item' in raw ? raw.item : raw))
|
|
23
|
+
.filter((i) => typeof i?.name === 'string' && i.name)
|
|
24
|
+
.map((i) => ({
|
|
25
|
+
value: i.name,
|
|
26
|
+
label: i.label ? `${i.label} (${i.name})` : i.name,
|
|
27
|
+
}))
|
|
28
|
+
.sort((a, b) => a.value.localeCompare(b.value));
|
|
29
|
+
setOptions(mapped);
|
|
30
|
+
setLoading(false);
|
|
31
|
+
})
|
|
32
|
+
.catch(() => {
|
|
33
|
+
if (!cancelled) {
|
|
34
|
+
setOptions([]);
|
|
35
|
+
setLoading(false);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return () => {
|
|
39
|
+
cancelled = true;
|
|
40
|
+
};
|
|
41
|
+
}, [client]);
|
|
42
|
+
return { options, loading };
|
|
43
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column-IO helpers for the View column configurator.
|
|
3
|
+
*
|
|
4
|
+
* A View variant's `columns` array holds entries in one of two
|
|
5
|
+
* canonical shapes:
|
|
6
|
+
* • `string` — bare field name (kanban-style)
|
|
7
|
+
* • `{ field, label, ... }` — ObjectStack canonical shape
|
|
8
|
+
* • `{ accessorKey, header, ... }` — legacy/imported TanStack shape
|
|
9
|
+
*
|
|
10
|
+
* These helpers read either shape without mutating it and build new
|
|
11
|
+
* entries that respect a variant's all-strings invariant so round-trips
|
|
12
|
+
* stay lossless.
|
|
13
|
+
*/
|
|
14
|
+
export interface VariantInfo {
|
|
15
|
+
key: string;
|
|
16
|
+
schema: Record<string, unknown>;
|
|
17
|
+
columns: unknown[];
|
|
18
|
+
allStrings: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Human label for a column entry (falls back to a positional label). */
|
|
21
|
+
export declare function colLabel(c: unknown, i: number): string;
|
|
22
|
+
/** Bound field name for a column entry, if any. */
|
|
23
|
+
export declare function colFieldName(c: unknown): string | undefined;
|
|
24
|
+
/** Set of field names already used as columns in a variant. */
|
|
25
|
+
export declare function usedFieldNames(columns: unknown[]): Set<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Build a fresh column entry for `fieldName`. Honors the variant's
|
|
28
|
+
* all-strings invariant: string variants get a bare field name, object
|
|
29
|
+
* variants get `{ field, label }`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function makeColumn(allStrings: boolean, fieldName: string, label?: string): unknown;
|
|
32
|
+
/**
|
|
33
|
+
* Remap a selected column index after a remove at `removedIndex`.
|
|
34
|
+
* Returns the new index, or `null` when the selected column itself was
|
|
35
|
+
* removed (caller should clear the selection).
|
|
36
|
+
*/
|
|
37
|
+
export declare function remapIndexAfterRemove(selectedIndex: number, removedIndex: number): number | null;
|
|
38
|
+
/**
|
|
39
|
+
* Remap a selected column index after a move from `from` to `to`.
|
|
40
|
+
* Mirrors `moveArray` semantics (remove-then-insert on the same list).
|
|
41
|
+
*/
|
|
42
|
+
export declare function remapIndexAfterMove(selectedIndex: number, from: number, to: number): number;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
|
|
2
|
+
/** Human label for a column entry (falls back to a positional label). */
|
|
3
|
+
export function colLabel(c, i) {
|
|
4
|
+
if (typeof c === 'string')
|
|
5
|
+
return c || `col ${i + 1}`;
|
|
6
|
+
if (c && typeof c === 'object') {
|
|
7
|
+
const o = c;
|
|
8
|
+
return String(o.label ?? o.header ?? o.field ?? o.accessorKey ?? `col ${i + 1}`);
|
|
9
|
+
}
|
|
10
|
+
return `col ${i + 1}`;
|
|
11
|
+
}
|
|
12
|
+
/** Bound field name for a column entry, if any. */
|
|
13
|
+
export function colFieldName(c) {
|
|
14
|
+
if (typeof c === 'string')
|
|
15
|
+
return c || undefined;
|
|
16
|
+
if (c && typeof c === 'object') {
|
|
17
|
+
const o = c;
|
|
18
|
+
const v = o.field ?? o.accessorKey;
|
|
19
|
+
return typeof v === 'string' && v ? v : undefined;
|
|
20
|
+
}
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
/** Set of field names already used as columns in a variant. */
|
|
24
|
+
export function usedFieldNames(columns) {
|
|
25
|
+
const out = new Set();
|
|
26
|
+
for (const c of columns) {
|
|
27
|
+
const f = colFieldName(c);
|
|
28
|
+
if (f)
|
|
29
|
+
out.add(f);
|
|
30
|
+
}
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Build a fresh column entry for `fieldName`. Honors the variant's
|
|
35
|
+
* all-strings invariant: string variants get a bare field name, object
|
|
36
|
+
* variants get `{ field, label }`.
|
|
37
|
+
*/
|
|
38
|
+
export function makeColumn(allStrings, fieldName, label) {
|
|
39
|
+
if (allStrings)
|
|
40
|
+
return fieldName;
|
|
41
|
+
const col = { field: fieldName };
|
|
42
|
+
if (label && label !== fieldName)
|
|
43
|
+
col.label = label;
|
|
44
|
+
return col;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Remap a selected column index after a remove at `removedIndex`.
|
|
48
|
+
* Returns the new index, or `null` when the selected column itself was
|
|
49
|
+
* removed (caller should clear the selection).
|
|
50
|
+
*/
|
|
51
|
+
export function remapIndexAfterRemove(selectedIndex, removedIndex) {
|
|
52
|
+
if (selectedIndex === removedIndex)
|
|
53
|
+
return null;
|
|
54
|
+
if (selectedIndex > removedIndex)
|
|
55
|
+
return selectedIndex - 1;
|
|
56
|
+
return selectedIndex;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Remap a selected column index after a move from `from` to `to`.
|
|
60
|
+
* Mirrors `moveArray` semantics (remove-then-insert on the same list).
|
|
61
|
+
*/
|
|
62
|
+
export function remapIndexAfterMove(selectedIndex, from, to) {
|
|
63
|
+
if (selectedIndex === from)
|
|
64
|
+
return to;
|
|
65
|
+
// The moved item left `from` and was inserted at `to`; indices between
|
|
66
|
+
// shift by one in the appropriate direction.
|
|
67
|
+
let idx = selectedIndex;
|
|
68
|
+
if (from < idx)
|
|
69
|
+
idx -= 1;
|
|
70
|
+
if (to <= idx)
|
|
71
|
+
idx += 1;
|
|
72
|
+
return idx;
|
|
73
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalog of Dashboard widget types — the same set @objectstack/spec
|
|
3
|
+
* publishes for `DashboardWidgetSchema.type`. Used by the Dashboard
|
|
4
|
+
* designer's "Add widget" picker so authors can choose a chart kind
|
|
5
|
+
* up front instead of always starting from `metric` and rebinding.
|
|
6
|
+
*/
|
|
7
|
+
import { type LucideIcon } from 'lucide-react';
|
|
8
|
+
export type WidgetCategory = 'kpi' | 'chart' | 'data' | 'custom';
|
|
9
|
+
export interface WidgetTypeMeta {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
category: WidgetCategory;
|
|
13
|
+
icon: LucideIcon;
|
|
14
|
+
/** Sensible defaults applied when this widget is added. */
|
|
15
|
+
defaults?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export declare const WIDGET_TYPE_META: Record<string, WidgetTypeMeta>;
|
|
18
|
+
export declare const WIDGET_CATEGORY_LABEL: Record<WidgetCategory, string>;
|
|
19
|
+
export declare const WIDGETS_BY_CATEGORY: Array<{
|
|
20
|
+
category: WidgetCategory;
|
|
21
|
+
types: WidgetTypeMeta[];
|
|
22
|
+
}>;
|
|
23
|
+
export declare const UnknownWidgetIcon: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
24
|
+
export declare const FilterIcon: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
|
|
2
|
+
/**
|
|
3
|
+
* Catalog of Dashboard widget types — the same set @objectstack/spec
|
|
4
|
+
* publishes for `DashboardWidgetSchema.type`. Used by the Dashboard
|
|
5
|
+
* designer's "Add widget" picker so authors can choose a chart kind
|
|
6
|
+
* up front instead of always starting from `metric` and rebinding.
|
|
7
|
+
*/
|
|
8
|
+
import { Activity, AreaChart, BarChart, BarChart2, Code2, Database, Donut, Filter, Hash, LineChart, List, PieChart, ScatterChart, Table2, TrendingDown, } from 'lucide-react';
|
|
9
|
+
export const WIDGET_TYPE_META = {
|
|
10
|
+
metric: { id: 'metric', label: 'Metric (KPI)', category: 'kpi', icon: Hash },
|
|
11
|
+
bar: { id: 'bar', label: 'Bar chart', category: 'chart', icon: BarChart },
|
|
12
|
+
'horizontal-bar': {
|
|
13
|
+
id: 'horizontal-bar',
|
|
14
|
+
label: 'Horizontal bar',
|
|
15
|
+
category: 'chart',
|
|
16
|
+
icon: BarChart2,
|
|
17
|
+
},
|
|
18
|
+
line: { id: 'line', label: 'Line chart', category: 'chart', icon: LineChart },
|
|
19
|
+
area: { id: 'area', label: 'Area chart', category: 'chart', icon: AreaChart },
|
|
20
|
+
pie: { id: 'pie', label: 'Pie chart', category: 'chart', icon: PieChart },
|
|
21
|
+
donut: { id: 'donut', label: 'Donut chart', category: 'chart', icon: Donut },
|
|
22
|
+
scatter: { id: 'scatter', label: 'Scatter plot', category: 'chart', icon: ScatterChart },
|
|
23
|
+
funnel: { id: 'funnel', label: 'Funnel', category: 'chart', icon: TrendingDown },
|
|
24
|
+
table: { id: 'table', label: 'Data table', category: 'data', icon: Table2 },
|
|
25
|
+
pivot: { id: 'pivot', label: 'Pivot table', category: 'data', icon: Database },
|
|
26
|
+
list: { id: 'list', label: 'Record list', category: 'data', icon: List },
|
|
27
|
+
custom: { id: 'custom', label: 'Custom widget', category: 'custom', icon: Code2 },
|
|
28
|
+
};
|
|
29
|
+
export const WIDGET_CATEGORY_LABEL = {
|
|
30
|
+
kpi: 'Single value',
|
|
31
|
+
chart: 'Charts',
|
|
32
|
+
data: 'Tabular',
|
|
33
|
+
custom: 'Custom',
|
|
34
|
+
};
|
|
35
|
+
export const WIDGETS_BY_CATEGORY = ['kpi', 'chart', 'data', 'custom'].map((category) => ({
|
|
36
|
+
category,
|
|
37
|
+
types: Object.values(WIDGET_TYPE_META).filter((m) => m.category === category),
|
|
38
|
+
}));
|
|
39
|
+
export const UnknownWidgetIcon = Activity;
|
|
40
|
+
export const FilterIcon = Filter;
|