@object-ui/app-shell 6.2.2 → 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 +967 -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
|
@@ -1,6 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LayeredDiff — visualizes how the runtime resolves a two-tier metadata item.
|
|
3
|
+
*
|
|
4
|
+
* Tabs:
|
|
5
|
+
* • Diff (default) — field-level table comparing Code (artifact) vs
|
|
6
|
+
* Effective (merged). Highlights modified / added / removed top-level
|
|
7
|
+
* fields with color coding so admins can see at a glance what their
|
|
8
|
+
* overlay actually changes.
|
|
9
|
+
* • Code — pretty-printed JSON of the artifact baseline.
|
|
10
|
+
* • Overlay — pretty-printed JSON of just the deltas they've saved.
|
|
11
|
+
* • Effective — the merged value the runtime serves.
|
|
12
|
+
*
|
|
13
|
+
* Backed by `client.layered(type, name)` (Phase 3a `?layers=true`).
|
|
14
|
+
*
|
|
15
|
+
* Diff scope: top-level keys only. Nested objects/arrays are compared by
|
|
16
|
+
* JSON-stringify equality. Drilling into nested diffs is a future
|
|
17
|
+
* enhancement; the overlay deltas we ship in practice are flat.
|
|
18
|
+
*/
|
|
19
|
+
import * as React from 'react';
|
|
1
20
|
import type { MetadataLayered } from '@object-ui/data-objectstack';
|
|
21
|
+
import { type SupportedLocale } from './i18n';
|
|
2
22
|
export interface LayeredDiffProps {
|
|
3
23
|
layered: MetadataLayered<Record<string, unknown>> | null;
|
|
4
24
|
loading?: boolean;
|
|
25
|
+
locale?: SupportedLocale | string;
|
|
5
26
|
}
|
|
6
|
-
export
|
|
27
|
+
export type DiffStatus = 'unchanged' | 'modified' | 'added' | 'removed';
|
|
28
|
+
export interface DiffRow {
|
|
29
|
+
key: string;
|
|
30
|
+
status: DiffStatus;
|
|
31
|
+
codeValue: unknown;
|
|
32
|
+
effectiveValue: unknown;
|
|
33
|
+
}
|
|
34
|
+
export declare function computeDiffRows(code: unknown, effective: unknown): DiffRow[];
|
|
35
|
+
/**
|
|
36
|
+
* Count of top-level fields where the overlay actually changes the
|
|
37
|
+
* effective value vs the artifact baseline. Used by the editor's
|
|
38
|
+
* Layers tab trigger to show e.g. "3 overlaid" next to the label.
|
|
39
|
+
*
|
|
40
|
+
* Returns 0 when there is no baseline (pure-runtime item) or the two
|
|
41
|
+
* payloads are identical.
|
|
42
|
+
*/
|
|
43
|
+
export declare function countOverlaidFields(code: unknown, effective: unknown): number;
|
|
44
|
+
export declare function LayeredDiff({ layered, loading, locale }: LayeredDiffProps): React.JSX.Element;
|
|
@@ -1,15 +1,181 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
|
|
3
|
+
/**
|
|
4
|
+
* LayeredDiff — visualizes how the runtime resolves a two-tier metadata item.
|
|
5
|
+
*
|
|
6
|
+
* Tabs:
|
|
7
|
+
* • Diff (default) — field-level table comparing Code (artifact) vs
|
|
8
|
+
* Effective (merged). Highlights modified / added / removed top-level
|
|
9
|
+
* fields with color coding so admins can see at a glance what their
|
|
10
|
+
* overlay actually changes.
|
|
11
|
+
* • Code — pretty-printed JSON of the artifact baseline.
|
|
12
|
+
* • Overlay — pretty-printed JSON of just the deltas they've saved.
|
|
13
|
+
* • Effective — the merged value the runtime serves.
|
|
14
|
+
*
|
|
15
|
+
* Backed by `client.layered(type, name)` (Phase 3a `?layers=true`).
|
|
16
|
+
*
|
|
17
|
+
* Diff scope: top-level keys only. Nested objects/arrays are compared by
|
|
18
|
+
* JSON-stringify equality. Drilling into nested diffs is a future
|
|
19
|
+
* enhancement; the overlay deltas we ship in practice are flat.
|
|
20
|
+
*/
|
|
21
|
+
import * as React from 'react';
|
|
2
22
|
import { Tabs, TabsContent, TabsList, TabsTrigger, } from '@object-ui/components';
|
|
3
|
-
import { Badge } from '@object-ui/components';
|
|
4
|
-
|
|
23
|
+
import { Badge, Switch } from '@object-ui/components';
|
|
24
|
+
import { cn } from '@object-ui/components';
|
|
25
|
+
import { t, tFormat } from './i18n';
|
|
26
|
+
const STATUS_STYLE = {
|
|
27
|
+
unchanged: {
|
|
28
|
+
badge: 'bg-muted text-muted-foreground border border-border',
|
|
29
|
+
row: '',
|
|
30
|
+
},
|
|
31
|
+
modified: {
|
|
32
|
+
badge: 'bg-amber-100 text-amber-900 border border-amber-300 dark:bg-amber-950/60 dark:text-amber-200 dark:border-amber-800',
|
|
33
|
+
row: 'bg-amber-50/50 dark:bg-amber-950/20',
|
|
34
|
+
},
|
|
35
|
+
added: {
|
|
36
|
+
badge: 'bg-emerald-100 text-emerald-900 border border-emerald-300 dark:bg-emerald-950/60 dark:text-emerald-200 dark:border-emerald-800',
|
|
37
|
+
row: 'bg-emerald-50/50 dark:bg-emerald-950/20',
|
|
38
|
+
},
|
|
39
|
+
removed: {
|
|
40
|
+
badge: 'bg-rose-100 text-rose-900 border border-rose-300 dark:bg-rose-950/60 dark:text-rose-200 dark:border-rose-800',
|
|
41
|
+
row: 'bg-rose-50/50 dark:bg-rose-950/20',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export function computeDiffRows(code, effective) {
|
|
45
|
+
const codeObj = isPlainObject(code) ? code : {};
|
|
46
|
+
const effObj = isPlainObject(effective) ? effective : {};
|
|
47
|
+
const allKeys = new Set([
|
|
48
|
+
...Object.keys(codeObj),
|
|
49
|
+
...Object.keys(effObj),
|
|
50
|
+
]);
|
|
51
|
+
const rows = [];
|
|
52
|
+
for (const key of allKeys) {
|
|
53
|
+
const inCode = key in codeObj;
|
|
54
|
+
const inEff = key in effObj;
|
|
55
|
+
const codeValue = codeObj[key];
|
|
56
|
+
const effectiveValue = effObj[key];
|
|
57
|
+
let status;
|
|
58
|
+
if (inCode && !inEff) {
|
|
59
|
+
status = 'removed';
|
|
60
|
+
}
|
|
61
|
+
else if (!inCode && inEff) {
|
|
62
|
+
status = 'added';
|
|
63
|
+
}
|
|
64
|
+
else if (stableStringify(codeValue) !== stableStringify(effectiveValue)) {
|
|
65
|
+
status = 'modified';
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
status = 'unchanged';
|
|
69
|
+
}
|
|
70
|
+
rows.push({ key, status, codeValue, effectiveValue });
|
|
71
|
+
}
|
|
72
|
+
// Sort: changed first (modified, added, removed), then unchanged; alpha within each.
|
|
73
|
+
const order = {
|
|
74
|
+
modified: 0,
|
|
75
|
+
added: 1,
|
|
76
|
+
removed: 2,
|
|
77
|
+
unchanged: 3,
|
|
78
|
+
};
|
|
79
|
+
rows.sort((a, b) => {
|
|
80
|
+
if (order[a.status] !== order[b.status])
|
|
81
|
+
return order[a.status] - order[b.status];
|
|
82
|
+
return a.key.localeCompare(b.key);
|
|
83
|
+
});
|
|
84
|
+
return rows;
|
|
85
|
+
}
|
|
86
|
+
function isPlainObject(v) {
|
|
87
|
+
return typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
88
|
+
}
|
|
89
|
+
function stableStringify(v) {
|
|
90
|
+
try {
|
|
91
|
+
return JSON.stringify(v, (_k, val) => {
|
|
92
|
+
if (isPlainObject(val)) {
|
|
93
|
+
return Object.keys(val).sort().reduce((acc, k) => {
|
|
94
|
+
acc[k] = val[k];
|
|
95
|
+
return acc;
|
|
96
|
+
}, {});
|
|
97
|
+
}
|
|
98
|
+
return val;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return String(v);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function formatCell(v) {
|
|
106
|
+
if (v === undefined)
|
|
107
|
+
return '—';
|
|
108
|
+
if (v === null)
|
|
109
|
+
return 'null';
|
|
110
|
+
if (typeof v === 'string')
|
|
111
|
+
return v;
|
|
112
|
+
if (typeof v === 'number' || typeof v === 'boolean')
|
|
113
|
+
return String(v);
|
|
114
|
+
try {
|
|
115
|
+
return JSON.stringify(v);
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return String(v);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Count of top-level fields where the overlay actually changes the
|
|
123
|
+
* effective value vs the artifact baseline. Used by the editor's
|
|
124
|
+
* Layers tab trigger to show e.g. "3 overlaid" next to the label.
|
|
125
|
+
*
|
|
126
|
+
* Returns 0 when there is no baseline (pure-runtime item) or the two
|
|
127
|
+
* payloads are identical.
|
|
128
|
+
*/
|
|
129
|
+
export function countOverlaidFields(code, effective) {
|
|
130
|
+
if (code == null)
|
|
131
|
+
return 0;
|
|
132
|
+
let n = 0;
|
|
133
|
+
for (const row of computeDiffRows(code, effective)) {
|
|
134
|
+
if (row.status !== 'unchanged')
|
|
135
|
+
n += 1;
|
|
136
|
+
}
|
|
137
|
+
return n;
|
|
138
|
+
}
|
|
139
|
+
export function LayeredDiff({ layered, loading, locale }) {
|
|
5
140
|
if (loading) {
|
|
6
|
-
return (_jsx("div", { className: "p-4 text-sm text-muted-foreground", children:
|
|
141
|
+
return (_jsx("div", { className: "p-4 text-sm text-muted-foreground", children: t('engine.edit.loading', locale) }));
|
|
7
142
|
}
|
|
8
143
|
if (!layered) {
|
|
9
|
-
return (_jsx("div", { className: "p-4 text-sm text-muted-foreground", children:
|
|
144
|
+
return (_jsx("div", { className: "p-4 text-sm text-muted-foreground", children: t('engine.layers.diff.noBaseline', locale) }));
|
|
10
145
|
}
|
|
11
146
|
const hasOverlay = layered.overlay != null;
|
|
12
|
-
return (_jsxs(Tabs, { defaultValue: "
|
|
147
|
+
return (_jsxs(Tabs, { defaultValue: "diff", className: "w-full", children: [_jsxs(TabsList, { className: "grid grid-cols-4 w-fit", children: [_jsx(TabsTrigger, { value: "diff", children: t('engine.layers.diff', locale) }), _jsxs(TabsTrigger, { value: "code", children: [t('engine.layers.code', locale), _jsx(Badge, { variant: "outline", className: "ml-1.5 text-[10px]", children: "artifact" })] }), _jsxs(TabsTrigger, { value: "overlay", children: [t('engine.layers.overlay', locale), hasOverlay ? (_jsx(Badge, { className: "ml-1.5 text-[10px] bg-emerald-600 text-emerald-50", children: layered.overlayScope ?? 'set' })) : (_jsx(Badge, { variant: "outline", className: "ml-1.5 text-[10px] text-muted-foreground", children: "none" }))] }), _jsxs(TabsTrigger, { value: "effective", children: [t('engine.layers.effective', locale), _jsx(Badge, { variant: "outline", className: "ml-1.5 text-[10px]", children: "merged" })] })] }), _jsx(TabsContent, { value: "diff", className: "mt-3", children: _jsx(DiffTable, { code: layered.code, effective: layered.effective, locale: locale }) }), _jsx(TabsContent, { value: "code", className: "mt-3", children: _jsx(LayerPanel, { payload: layered.code, emptyHint: t('engine.layers.diff.noBaseline', locale) }) }), _jsx(TabsContent, { value: "overlay", className: "mt-3", children: _jsx(LayerPanel, { payload: layered.overlay, emptyHint: t('engine.layers.diff.noChanges', locale) }) }), _jsx(TabsContent, { value: "effective", className: "mt-3", children: _jsx(LayerPanel, { payload: layered.effective, emptyHint: "No effective value resolved." }) })] }));
|
|
148
|
+
}
|
|
149
|
+
function DiffTable({ code, effective, locale, }) {
|
|
150
|
+
const [showUnchanged, setShowUnchanged] = React.useState(false);
|
|
151
|
+
// No baseline = pure runtime overlay; the diff table has nothing to compare.
|
|
152
|
+
if (code == null) {
|
|
153
|
+
return (_jsx("div", { className: "rounded border bg-muted/30 p-4 text-xs text-muted-foreground", children: t('engine.layers.diff.noBaseline', locale) }));
|
|
154
|
+
}
|
|
155
|
+
const rows = React.useMemo(() => computeDiffRows(code, effective), [code, effective]);
|
|
156
|
+
const counts = React.useMemo(() => {
|
|
157
|
+
return rows.reduce((acc, r) => {
|
|
158
|
+
acc[r.status] += 1;
|
|
159
|
+
return acc;
|
|
160
|
+
}, { unchanged: 0, modified: 0, added: 0, removed: 0 });
|
|
161
|
+
}, [rows]);
|
|
162
|
+
const visibleRows = showUnchanged
|
|
163
|
+
? rows
|
|
164
|
+
: rows.filter((r) => r.status !== 'unchanged');
|
|
165
|
+
const hasAnyChange = counts.modified > 0 || counts.added > 0 || counts.removed > 0;
|
|
166
|
+
return (_jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-3 flex-wrap", children: [_jsx("div", { className: "text-xs text-muted-foreground", children: tFormat('engine.layers.diff.summary', locale, {
|
|
167
|
+
modified: counts.modified,
|
|
168
|
+
added: counts.added,
|
|
169
|
+
removed: counts.removed,
|
|
170
|
+
}) }), _jsxs("label", { className: "flex items-center gap-2 text-xs text-muted-foreground cursor-pointer select-none", children: [_jsx(Switch, { checked: showUnchanged, onCheckedChange: setShowUnchanged, "aria-label": t('engine.layers.diff.showUnchanged', locale) }), t('engine.layers.diff.showUnchanged', locale), _jsx(Badge, { variant: "outline", className: "ml-1 text-[10px]", children: counts.unchanged })] })] }), !hasAnyChange && !showUnchanged ? (_jsx("div", { className: "rounded border bg-muted/30 p-4 text-xs text-muted-foreground", children: t('engine.layers.diff.noChanges', locale) })) : (_jsxs("div", { className: "rounded border overflow-hidden", children: [_jsxs("div", { className: "grid grid-cols-[minmax(140px,1fr)_minmax(160px,1.4fr)_minmax(160px,1.4fr)_auto] bg-muted/50 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: [_jsx("div", { className: "px-3 py-2", children: t('engine.layers.diff.field', locale) }), _jsx("div", { className: "px-3 py-2", children: t('engine.layers.diff.code', locale) }), _jsx("div", { className: "px-3 py-2", children: t('engine.layers.diff.effective', locale) }), _jsx("div", { className: "px-3 py-2", children: t('engine.layers.diff.status', locale) })] }), _jsx("div", { className: "divide-y", children: visibleRows.map((row) => {
|
|
171
|
+
const style = STATUS_STYLE[row.status];
|
|
172
|
+
return (_jsxs("div", { className: cn('grid grid-cols-[minmax(140px,1fr)_minmax(160px,1.4fr)_minmax(160px,1.4fr)_auto] text-xs', style.row), children: [_jsx("div", { className: "px-3 py-2 font-mono text-foreground truncate", title: row.key, children: row.key }), _jsx(DiffValueCell, { value: row.codeValue, muted: row.status === 'added' }), _jsx(DiffValueCell, { value: row.effectiveValue, muted: row.status === 'removed' }), _jsx("div", { className: "px-3 py-2", children: _jsx("span", { className: cn('inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium', style.badge), children: t(`engine.layers.diff.${row.status}`, locale) }) })] }, row.key));
|
|
173
|
+
}) })] }))] }));
|
|
174
|
+
}
|
|
175
|
+
function DiffValueCell({ value, muted }) {
|
|
176
|
+
const text = formatCell(value);
|
|
177
|
+
const isMissing = value === undefined;
|
|
178
|
+
return (_jsx("div", { className: cn('px-3 py-2 font-mono break-all', muted || isMissing ? 'text-muted-foreground italic' : 'text-foreground'), title: text.length > 200 ? text : undefined, children: text.length > 200 ? `${text.slice(0, 200)}…` : text }));
|
|
13
179
|
}
|
|
14
180
|
function LayerPanel({ payload, emptyHint, }) {
|
|
15
181
|
if (payload == null) {
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MetadataDetailDrawer — slide-over editor for a related metadata item.
|
|
3
|
+
*
|
|
4
|
+
* Opens from the parent's Related tab without taking the user away
|
|
5
|
+
* from the parent's context. Internally we mount the same
|
|
6
|
+
* `MetadataResourceEditPage` used by the full-page route, so all the
|
|
7
|
+
* Save / Reset / Validate behaviour is shared. The drawer just frames
|
|
8
|
+
* it and adds a "Open full page ↗" affordance.
|
|
9
|
+
*
|
|
10
|
+
* Width is wide enough for forms (max 1100px) but capped at 92vw to
|
|
11
|
+
* leave a thin strip of the parent visible behind, reinforcing the
|
|
12
|
+
* "still in the same object" feel.
|
|
13
|
+
*/
|
|
14
|
+
import * as React from 'react';
|
|
1
15
|
import type { RelatedTarget } from './RelatedPanel';
|
|
2
16
|
export interface MetadataDetailDrawerProps {
|
|
3
17
|
/** When non-null, drawer is open and shows this target. */
|
|
@@ -10,4 +24,4 @@ export interface MetadataDetailDrawerProps {
|
|
|
10
24
|
name: string;
|
|
11
25
|
};
|
|
12
26
|
}
|
|
13
|
-
export declare function MetadataDetailDrawer({ target, onClose, parentContext, }: MetadataDetailDrawerProps):
|
|
27
|
+
export declare function MetadataDetailDrawer({ target, onClose, parentContext, }: MetadataDetailDrawerProps): React.JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `MetadataTypeActions` — renders the declarative, **type-level** actions a
|
|
3
|
+
* metadata type carries (GAP-1) using the same button affordance business
|
|
4
|
+
* objects use for their `actions`.
|
|
5
|
+
*
|
|
6
|
+
* The framework's `/meta/types` endpoint emits these on each rich entry as
|
|
7
|
+
* spec `ActionSchema` objects (see `MetadataTypeAction` in `useMetadata`).
|
|
8
|
+
* The canonical first consumer is the `datasource` type, which declares a
|
|
9
|
+
* "Test connection" action (`type:'api'`, `POST
|
|
10
|
+
* /api/v1/datasources/${ctx.recordId}/test`). Rendering happens in two
|
|
11
|
+
* chrome slots:
|
|
12
|
+
*
|
|
13
|
+
* • ResourceEditPage → `location='record_header'`, `recordId` = item name.
|
|
14
|
+
* • ResourceListPage → `location='list_toolbar'` (no recordId).
|
|
15
|
+
*
|
|
16
|
+
* Execution path mirrors ObjectView's auth-aware `apiHandler` rather than the
|
|
17
|
+
* core ActionRunner's bare `fetch`: the metadata API endpoints require the
|
|
18
|
+
* better-auth session cookie + bearer token, which only ride along through
|
|
19
|
+
* `createAuthenticatedFetch` (and matter in split-origin dev where the SPA is
|
|
20
|
+
* on :5180 and the backend on :3000). `${ctx.recordId}` / `${param.X}` tokens
|
|
21
|
+
* in `target` are resolved here, exactly as the spec mandates renderers do.
|
|
22
|
+
*
|
|
23
|
+
* Dialogs: actions that declare an array of `params` collect them from the
|
|
24
|
+
* user in the shared {@link ActionParamDialog} before running (same UX as
|
|
25
|
+
* business-object actions); actions that declare a `resultDialog` render the
|
|
26
|
+
* API response in {@link ActionResultDialog}. `confirmText` still gates the run.
|
|
27
|
+
*
|
|
28
|
+
* Only `type:'api'` is wired today; other types surface a toast so a
|
|
29
|
+
* misconfigured action fails loud instead of silent.
|
|
30
|
+
*/
|
|
31
|
+
import * as React from 'react';
|
|
32
|
+
import type { RichMetadataTypeEntry } from './useMetadata';
|
|
33
|
+
export interface MetadataTypeActionsProps {
|
|
34
|
+
/** The rich type entry whose `actions` to render. */
|
|
35
|
+
entry?: Pick<RichMetadataTypeEntry, 'actions'> | undefined;
|
|
36
|
+
/** Which chrome slot is asking — actions are filtered by their `locations`. */
|
|
37
|
+
location: string;
|
|
38
|
+
/** Current item name, exposed to actions as `${ctx.recordId}`. */
|
|
39
|
+
recordId?: string;
|
|
40
|
+
/** Called after a successful action when `refreshAfter` is set. */
|
|
41
|
+
onAfter?: () => void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Render the location-filtered type-level actions. Returns `null` when the
|
|
45
|
+
* type declares none for this slot, so callers can drop it straight into an
|
|
46
|
+
* existing toolbar `<>…</>` without conditionals.
|
|
47
|
+
*/
|
|
48
|
+
export declare function MetadataTypeActions({ entry, location, recordId, onAfter }: MetadataTypeActionsProps): React.ReactElement | null;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
|
|
3
|
+
/**
|
|
4
|
+
* `MetadataTypeActions` — renders the declarative, **type-level** actions a
|
|
5
|
+
* metadata type carries (GAP-1) using the same button affordance business
|
|
6
|
+
* objects use for their `actions`.
|
|
7
|
+
*
|
|
8
|
+
* The framework's `/meta/types` endpoint emits these on each rich entry as
|
|
9
|
+
* spec `ActionSchema` objects (see `MetadataTypeAction` in `useMetadata`).
|
|
10
|
+
* The canonical first consumer is the `datasource` type, which declares a
|
|
11
|
+
* "Test connection" action (`type:'api'`, `POST
|
|
12
|
+
* /api/v1/datasources/${ctx.recordId}/test`). Rendering happens in two
|
|
13
|
+
* chrome slots:
|
|
14
|
+
*
|
|
15
|
+
* • ResourceEditPage → `location='record_header'`, `recordId` = item name.
|
|
16
|
+
* • ResourceListPage → `location='list_toolbar'` (no recordId).
|
|
17
|
+
*
|
|
18
|
+
* Execution path mirrors ObjectView's auth-aware `apiHandler` rather than the
|
|
19
|
+
* core ActionRunner's bare `fetch`: the metadata API endpoints require the
|
|
20
|
+
* better-auth session cookie + bearer token, which only ride along through
|
|
21
|
+
* `createAuthenticatedFetch` (and matter in split-origin dev where the SPA is
|
|
22
|
+
* on :5180 and the backend on :3000). `${ctx.recordId}` / `${param.X}` tokens
|
|
23
|
+
* in `target` are resolved here, exactly as the spec mandates renderers do.
|
|
24
|
+
*
|
|
25
|
+
* Dialogs: actions that declare an array of `params` collect them from the
|
|
26
|
+
* user in the shared {@link ActionParamDialog} before running (same UX as
|
|
27
|
+
* business-object actions); actions that declare a `resultDialog` render the
|
|
28
|
+
* API response in {@link ActionResultDialog}. `confirmText` still gates the run.
|
|
29
|
+
*
|
|
30
|
+
* Only `type:'api'` is wired today; other types surface a toast so a
|
|
31
|
+
* misconfigured action fails loud instead of silent.
|
|
32
|
+
*/
|
|
33
|
+
import * as React from 'react';
|
|
34
|
+
import { toast } from 'sonner';
|
|
35
|
+
import { Loader2 } from 'lucide-react';
|
|
36
|
+
import { Button } from '@object-ui/components';
|
|
37
|
+
import { createAuthenticatedFetch } from '@object-ui/auth';
|
|
38
|
+
import { getIcon } from '../../utils/getIcon';
|
|
39
|
+
import { ActionParamDialog } from '../ActionParamDialog';
|
|
40
|
+
import { ActionResultDialog } from '../ActionResultDialog';
|
|
41
|
+
/** Map the spec's action variants onto the Shadcn Button variants. */
|
|
42
|
+
const VARIANT_MAP = {
|
|
43
|
+
primary: 'default',
|
|
44
|
+
secondary: 'secondary',
|
|
45
|
+
danger: 'destructive',
|
|
46
|
+
ghost: 'ghost',
|
|
47
|
+
link: 'link',
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Substitute `${ctx.X}` / `${param.X}` tokens in an action target. Values are
|
|
51
|
+
* `encodeURIComponent`'d — opaque ids in a path segment (datasource name) are
|
|
52
|
+
* the only use today, and encoding is the correct behaviour for those.
|
|
53
|
+
*/
|
|
54
|
+
function interpolateTarget(target, ctx, params) {
|
|
55
|
+
if (target.indexOf('${') === -1)
|
|
56
|
+
return target;
|
|
57
|
+
return target.replace(/\$\{(param|ctx)\.([\w.]+)\}/g, (_m, scope, path) => {
|
|
58
|
+
const root = scope === 'param' ? params : ctx;
|
|
59
|
+
const value = path
|
|
60
|
+
.split('.')
|
|
61
|
+
.reduce((o, k) => (o == null ? undefined : o[k]), root);
|
|
62
|
+
return value == null ? '' : encodeURIComponent(String(value));
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Render the location-filtered type-level actions. Returns `null` when the
|
|
67
|
+
* type declares none for this slot, so callers can drop it straight into an
|
|
68
|
+
* existing toolbar `<>…</>` without conditionals.
|
|
69
|
+
*/
|
|
70
|
+
export function MetadataTypeActions({ entry, location, recordId, onAfter }) {
|
|
71
|
+
const [busy, setBusy] = React.useState(null);
|
|
72
|
+
const [paramState, setParamState] = React.useState({ open: false, params: [] });
|
|
73
|
+
const [resultState, setResultState] = React.useState({ open: false });
|
|
74
|
+
const authFetch = React.useMemo(() => createAuthenticatedFetch(), []);
|
|
75
|
+
const actions = React.useMemo(() => (entry?.actions ?? []).filter((a) => !a.locations || a.locations.length === 0 || a.locations.includes(location)), [entry?.actions, location]);
|
|
76
|
+
if (actions.length === 0)
|
|
77
|
+
return null;
|
|
78
|
+
/** Open the param dialog and resolve with the collected values (or null on cancel). */
|
|
79
|
+
const collectParams = (params, title) => new Promise((resolve) => {
|
|
80
|
+
setParamState({ open: true, params, title, resolve });
|
|
81
|
+
});
|
|
82
|
+
const run = async (action) => {
|
|
83
|
+
const title = action.label ?? action.name;
|
|
84
|
+
// Only `type:'api'` is wired today. Default (`undefined`) is treated as
|
|
85
|
+
// `script` by the spec, which the engine cannot execute — fail loud.
|
|
86
|
+
if (action.type !== 'api') {
|
|
87
|
+
toast.error(`Action “${title}”: type "${action.type ?? 'script'}" is not supported here yet.`);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (action.confirmText && !window.confirm(action.confirmText))
|
|
91
|
+
return;
|
|
92
|
+
// Inputs: an array of param descriptors → collect in a dialog; a static
|
|
93
|
+
// object → forward as-is.
|
|
94
|
+
let params;
|
|
95
|
+
if (Array.isArray(action.params) && action.params.length > 0) {
|
|
96
|
+
const collected = await collectParams(action.params, title);
|
|
97
|
+
if (collected == null)
|
|
98
|
+
return; // user cancelled
|
|
99
|
+
params = collected;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
params = action.params ?? {};
|
|
103
|
+
}
|
|
104
|
+
const ctx = { recordId, origin: window.location.origin };
|
|
105
|
+
const resolved = interpolateTarget(action.target ?? '', ctx, params);
|
|
106
|
+
if (!resolved) {
|
|
107
|
+
toast.error(`Action “${title}” has no target.`);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
// Split SPA + backend dev: promote same-origin `/api/...` paths to the
|
|
111
|
+
// backend origin so the request (and its auth cookie) reaches :3000.
|
|
112
|
+
const apiBase = (import.meta.env?.VITE_SERVER_URL || '').replace(/\/+$/, '');
|
|
113
|
+
const url = /^https?:\/\//i.test(resolved) ? resolved : `${apiBase}${resolved}`;
|
|
114
|
+
const method = (action.method || 'POST').toUpperCase();
|
|
115
|
+
setBusy(action.name);
|
|
116
|
+
try {
|
|
117
|
+
const init = {
|
|
118
|
+
method,
|
|
119
|
+
headers: { 'Content-Type': 'application/json' },
|
|
120
|
+
credentials: 'include',
|
|
121
|
+
};
|
|
122
|
+
if (method !== 'GET' && method !== 'DELETE')
|
|
123
|
+
init.body = JSON.stringify(params);
|
|
124
|
+
const res = await authFetch(url, init);
|
|
125
|
+
let data = null;
|
|
126
|
+
try {
|
|
127
|
+
data = (await res.json());
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
/* non-JSON / empty body — fall back to status text */
|
|
131
|
+
}
|
|
132
|
+
if (!res.ok || (data && data.success === false)) {
|
|
133
|
+
const detail = data?.error || data?.message || `HTTP ${res.status} ${res.statusText}`.trim();
|
|
134
|
+
toast.error(`${action.errorMessage ? `${action.errorMessage}: ` : ''}${title}: ${detail}`);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
// Rich result reveal when declared, else a success toast.
|
|
138
|
+
if (action.resultDialog) {
|
|
139
|
+
setResultState({ open: true, spec: action.resultDialog, data: data ?? {} });
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
const msg = action.successMessage || (typeof data?.message === 'string' ? data.message : `${title} ✓`);
|
|
143
|
+
toast.success(msg);
|
|
144
|
+
}
|
|
145
|
+
if (action.refreshAfter)
|
|
146
|
+
onAfter?.();
|
|
147
|
+
}
|
|
148
|
+
catch (err) {
|
|
149
|
+
toast.error(`${title}: ${err?.message ?? String(err)}`);
|
|
150
|
+
}
|
|
151
|
+
finally {
|
|
152
|
+
setBusy(null);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
return (_jsxs(_Fragment, { children: [actions.map((action) => {
|
|
156
|
+
const Icon = action.icon ? getIcon(action.icon) : null;
|
|
157
|
+
const isBusy = busy === action.name;
|
|
158
|
+
return (_jsxs(Button, { size: "sm", variant: VARIANT_MAP[action.variant ?? 'secondary'] ?? 'secondary', disabled: isBusy, onClick: () => run(action), title: action.label ?? action.name, children: [isBusy ? (_jsx(Loader2, { className: "h-4 w-4 mr-1 animate-spin" })) : Icon ? (_jsx(Icon, { className: "h-4 w-4 mr-1" })) : null, action.label ?? action.name] }, action.name));
|
|
159
|
+
}), _jsx(ActionParamDialog, { state: paramState, onOpenChange: (open) => {
|
|
160
|
+
if (!open) {
|
|
161
|
+
paramState.resolve?.(null);
|
|
162
|
+
setParamState({ open: false, params: [] });
|
|
163
|
+
}
|
|
164
|
+
} }), _jsx(ActionResultDialog, { state: resultState, onAcknowledge: () => setResultState({ open: false }) })] }));
|
|
165
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PackagesPage — the package management entry point for Studio.
|
|
3
|
+
*
|
|
4
|
+
* Studio previously exposed packages only through the sidebar `active_package`
|
|
5
|
+
* *filter* dropdown; there was no surface to see all packages, create one, or
|
|
6
|
+
* act on one (publish / revert / enable / disable). This page fills that gap.
|
|
7
|
+
*
|
|
8
|
+
* It is the authoring home for the Studio → package → publish workflow:
|
|
9
|
+
* 1. Create a package (POST /api/v1/packages with a minimal manifest).
|
|
10
|
+
* 2. Author metadata bound to it (via the sidebar scope + ResourceEditPage).
|
|
11
|
+
* 3. Publish it (POST /api/v1/packages/:id/publish).
|
|
12
|
+
*
|
|
13
|
+
* Backed entirely by the existing `/api/v1/packages` REST surface
|
|
14
|
+
* (see framework `http-dispatcher.handlePackages`).
|
|
15
|
+
*/
|
|
16
|
+
import * as React from 'react';
|
|
17
|
+
export declare function PackagesPage(): React.JSX.Element;
|
|
18
|
+
export default PackagesPage;
|