@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.
- package/CHANGELOG.md +1229 -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 +184 -39
- 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 +747 -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 +28 -0
- package/dist/console/ai/LiveCanvas.js +80 -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 +137 -4
- package/dist/hooks/useChatConversation.js +316 -25
- package/dist/hooks/useConsoleActionRuntime.d.ts +70 -0
- package/dist/hooks/useConsoleActionRuntime.js +564 -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 +18 -8
- package/dist/index.js +17 -5
- 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 +34 -2
- package/dist/layout/ConsoleFloatingChatbot.js +391 -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 +242 -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/layout/agentPicker.d.ts +56 -0
- package/dist/layout/agentPicker.js +40 -0
- 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/CommitTimeline.d.ts +15 -0
- package/dist/preview/CommitTimeline.js +82 -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 +83 -0
- package/dist/preview/commitHistory.d.ts +28 -0
- package/dist/preview/commitHistory.js +48 -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 +192 -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 +31 -0
- package/dist/views/FlowRunner.js +121 -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/ScreenView.d.ts +70 -0
- package/dist/views/ScreenView.js +73 -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 +101 -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 +39 -0
- package/dist/views/metadata-admin/JsonSourceEditor.js +196 -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 +403 -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 +1250 -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 +258 -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 +205 -0
- package/dist/views/metadata-admin/anchors.js +255 -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 +1252 -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 +221 -0
- package/dist/views/metadata-admin/inspectors/FlowEdgeInspector.d.ts +16 -0
- package/dist/views/metadata-admin/inspectors/FlowEdgeInspector.js +126 -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 +205 -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 +55 -0
- package/dist/views/metadata-admin/inspectors/ObjectFieldInspector.d.ts +23 -0
- package/dist/views/metadata-admin/inspectors/ObjectFieldInspector.js +365 -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 +218 -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 +128 -0
- package/dist/views/metadata-admin/inspectors/_shared.js +113 -0
- package/dist/views/metadata-admin/inspectors/datasetFilterCondition.d.ts +24 -0
- package/dist/views/metadata-admin/inspectors/datasetFilterCondition.js +97 -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 +506 -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/issuePath.d.ts +22 -0
- package/dist/views/metadata-admin/issuePath.js +65 -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/package-scope.d.ts +26 -0
- package/dist/views/metadata-admin/package-scope.js +43 -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 +105 -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 +49 -0
- package/dist/views/metadata-admin/previews/FlowCanvas.js +416 -0
- package/dist/views/metadata-admin/previews/FlowPreview.d.ts +20 -0
- package/dist/views/metadata-admin/previews/FlowPreview.js +120 -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 +204 -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 +200 -5
- 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/ScreenPreview.d.ts +38 -0
- package/dist/views/metadata-admin/previews/ScreenPreview.js +61 -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 +102 -0
- package/dist/views/metadata-admin/previews/flow-canvas-layout.js +227 -0
- package/dist/views/metadata-admin/previews/flow-canvas-parts.d.ts +96 -0
- package/dist/views/metadata-admin/previews/flow-canvas-parts.js +373 -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 +130 -0
- package/dist/views/metadata-admin/previews/object-fields-io.js +243 -0
- package/dist/views/metadata-admin/previews/screen-spec.d.ts +43 -0
- package/dist/views/metadata-admin/previews/screen-spec.js +108 -0
- package/dist/views/metadata-admin/previews/simulator/flow-sim-types.d.ts +102 -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 +15 -0
- package/dist/views/metadata-admin/previews/simulator/flow-sim-validate.js +185 -0
- package/dist/views/metadata-admin/previews/simulator/flow-simulator.d.ts +73 -0
- package/dist/views/metadata-admin/previews/simulator/flow-simulator.js +426 -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,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;
|
|
Binary file
|
|
@@ -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
|
/**
|