@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,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useHomeInbox
|
|
3
|
+
*
|
|
4
|
+
* One-shot fetch of the inbox streams the Home work-dashboard surfaces:
|
|
5
|
+
* - pendingApprovalsCount — items waiting on the user (REST endpoint)
|
|
6
|
+
* - notifications — latest in-app inbox messages (assignments/@mentions)
|
|
7
|
+
* - activities — recent human activity feed (sys_activity)
|
|
8
|
+
*
|
|
9
|
+
* Everything degrades silently to empty on 404 / error so deployments without
|
|
10
|
+
* the approvals plugin, the inbox pipeline, or a `sys_activity` object still
|
|
11
|
+
* render Home. Unlike the top-bar bell (AppHeader) this does NOT poll — Home is
|
|
12
|
+
* a landing surface, one fetch on mount is enough; the bell stays the live
|
|
13
|
+
* source of truth. Query shapes mirror AppHeader so the two never diverge.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
import { useEffect, useRef, useState } from 'react';
|
|
18
|
+
import { useAdapter } from '../providers/AdapterProvider';
|
|
19
|
+
import { useAuth } from '@object-ui/auth';
|
|
20
|
+
export function useHomeInbox(limit = 5) {
|
|
21
|
+
const dataSource = useAdapter();
|
|
22
|
+
const { user } = useAuth();
|
|
23
|
+
const [pendingApprovalsCount, setPendingApprovalsCount] = useState(0);
|
|
24
|
+
const [notifications, setNotifications] = useState([]);
|
|
25
|
+
const [activities, setActivities] = useState([]);
|
|
26
|
+
const mountedRef = useRef(true);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
mountedRef.current = true;
|
|
29
|
+
return () => { mountedRef.current = false; };
|
|
30
|
+
}, []);
|
|
31
|
+
// Recent activity (sys_activity). Raw rows use plugin-audit's column names
|
|
32
|
+
// (actor_name / summary / object_name / timestamp); map onto ActivityItem and
|
|
33
|
+
// keep only real human actions — drop sys_*/ai_* system churn (UUID-titled,
|
|
34
|
+
// actor "System"). Degrades to [] if the object is absent.
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (!dataSource)
|
|
37
|
+
return;
|
|
38
|
+
let cancelled = false;
|
|
39
|
+
Promise.resolve(dataSource.find('sys_activity', { $orderby: { timestamp: 'desc' }, $top: 20 }))
|
|
40
|
+
.then((res) => {
|
|
41
|
+
if (cancelled || !mountedRef.current)
|
|
42
|
+
return;
|
|
43
|
+
const rows = Array.isArray(res?.data) ? res.data : [];
|
|
44
|
+
const mapped = rows
|
|
45
|
+
.filter((r) => {
|
|
46
|
+
if (!r || typeof r.type !== 'string')
|
|
47
|
+
return false;
|
|
48
|
+
if (!(r.summary ?? '').toString().trim())
|
|
49
|
+
return false;
|
|
50
|
+
const actor = String(r.actor_name ?? '').trim();
|
|
51
|
+
return actor.length > 0 && actor.toLowerCase() !== 'system';
|
|
52
|
+
})
|
|
53
|
+
.map((r) => {
|
|
54
|
+
let when = r.timestamp;
|
|
55
|
+
if (!when || when === 'NOW()' || Number.isNaN(Date.parse(when)))
|
|
56
|
+
when = r.created_at;
|
|
57
|
+
const raw = String(r.type);
|
|
58
|
+
const type = raw === 'commented' || raw === 'mentioned' ? 'comment'
|
|
59
|
+
: raw === 'deleted' ? 'delete'
|
|
60
|
+
: raw === 'created' ? 'create'
|
|
61
|
+
: 'update';
|
|
62
|
+
return {
|
|
63
|
+
id: String(r.id),
|
|
64
|
+
type,
|
|
65
|
+
objectName: r.object_name ?? '',
|
|
66
|
+
recordId: r.record_id ?? undefined,
|
|
67
|
+
user: r.actor_name ?? 'System',
|
|
68
|
+
description: r.summary ?? '',
|
|
69
|
+
timestamp: when ?? '',
|
|
70
|
+
};
|
|
71
|
+
})
|
|
72
|
+
.slice(0, limit);
|
|
73
|
+
setActivities(mapped);
|
|
74
|
+
})
|
|
75
|
+
.catch(() => { });
|
|
76
|
+
return () => { cancelled = true; };
|
|
77
|
+
}, [dataSource, limit]);
|
|
78
|
+
// Latest in-app inbox messages (assignments / @mentions / alerts).
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
if (!dataSource || !user?.id)
|
|
81
|
+
return;
|
|
82
|
+
let cancelled = false;
|
|
83
|
+
Promise.resolve(dataSource.find('sys_inbox_message', {
|
|
84
|
+
$filter: { user_id: user.id },
|
|
85
|
+
$orderby: { created_at: 'desc' },
|
|
86
|
+
$top: limit,
|
|
87
|
+
}))
|
|
88
|
+
.then((res) => {
|
|
89
|
+
if (cancelled || !mountedRef.current)
|
|
90
|
+
return;
|
|
91
|
+
const rows = Array.isArray(res?.data) ? res.data : [];
|
|
92
|
+
const seenTitles = new Set();
|
|
93
|
+
const deduped = rows
|
|
94
|
+
.filter((m) => m && (m.title ?? '').toString().trim())
|
|
95
|
+
.map((m) => ({
|
|
96
|
+
id: String(m.id),
|
|
97
|
+
title: String(m.title),
|
|
98
|
+
actionUrl: m.action_url ?? undefined,
|
|
99
|
+
createdAt: m.created_at ?? undefined,
|
|
100
|
+
}))
|
|
101
|
+
// Collapse repeated identical notifications (e.g. recurring digests)
|
|
102
|
+
// — keep the most recent of each title (rows are newest-first).
|
|
103
|
+
.filter((n) => (seenTitles.has(n.title) ? false : (seenTitles.add(n.title), true)));
|
|
104
|
+
setNotifications(deduped);
|
|
105
|
+
})
|
|
106
|
+
.catch(() => { });
|
|
107
|
+
return () => { cancelled = true; };
|
|
108
|
+
}, [dataSource, user?.id, limit]);
|
|
109
|
+
// Pending-approvals count (framework REST endpoint). 404 / error → 0.
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
if (!user?.id)
|
|
112
|
+
return;
|
|
113
|
+
const serverUrl = (import.meta.env?.VITE_SERVER_URL || '').replace(/\/$/, '');
|
|
114
|
+
const identities = [];
|
|
115
|
+
if (user.id)
|
|
116
|
+
identities.push(user.id);
|
|
117
|
+
if (user.email)
|
|
118
|
+
identities.push(user.email);
|
|
119
|
+
for (const r of (user.roles || [])) {
|
|
120
|
+
if (r)
|
|
121
|
+
identities.push(`role:${r}`);
|
|
122
|
+
}
|
|
123
|
+
if (identities.length === 0)
|
|
124
|
+
return;
|
|
125
|
+
let cancelled = false;
|
|
126
|
+
const qs = new URLSearchParams({ status: 'pending', approverId: identities.join(',') });
|
|
127
|
+
fetch(`${serverUrl}/api/v1/approvals/requests?${qs}`, { credentials: 'include' })
|
|
128
|
+
.then(async (res) => {
|
|
129
|
+
if (!res.ok)
|
|
130
|
+
return;
|
|
131
|
+
const payload = await res.json().catch(() => null);
|
|
132
|
+
const seen = new Set();
|
|
133
|
+
for (const row of (payload?.data || []))
|
|
134
|
+
seen.add(row.id);
|
|
135
|
+
if (!cancelled && mountedRef.current)
|
|
136
|
+
setPendingApprovalsCount(seen.size);
|
|
137
|
+
})
|
|
138
|
+
.catch(() => { });
|
|
139
|
+
return () => { cancelled = true; };
|
|
140
|
+
}, [user?.id]);
|
|
141
|
+
return { pendingApprovalsCount, notifications, activities };
|
|
142
|
+
}
|
package/dist/hooks/useNavPins.js
CHANGED
|
@@ -13,36 +13,30 @@
|
|
|
13
13
|
* @module
|
|
14
14
|
*/
|
|
15
15
|
import { useCallback, useMemo } from 'react';
|
|
16
|
+
import { resolveHref } from '@object-ui/layout';
|
|
16
17
|
import { useFavorites } from '../context/FavoritesProvider';
|
|
17
18
|
const MAX_PINS = 20;
|
|
18
19
|
/**
|
|
19
20
|
* Synthesize the `href` for a NavigationItem in isolation from a sidebar.
|
|
20
21
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* Delegates to `@object-ui/layout`'s `resolveHref` so all routing
|
|
23
|
+
* semantics (recordId templates, componentRef, viewName, …) stay
|
|
24
|
+
* consistent with what the sidebar renders.
|
|
25
|
+
*
|
|
26
|
+
* Returns an empty string for non-routable item types or unresolved
|
|
27
|
+
* `#` placeholders; consumers should treat empty href as "fall back
|
|
28
|
+
* to live nav tree". Template variables on `recordId` are NOT resolved
|
|
29
|
+
* here (no auth context at pin-storage time) — the pinned href will
|
|
30
|
+
* gracefully degrade to the list view in that case, matching what
|
|
31
|
+
* `resolveHref` does when its templateContext is missing.
|
|
26
32
|
*/
|
|
27
33
|
function deriveHref(item, basePath = '') {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
: `${basePath}/${item.objectName}`;
|
|
35
|
-
case 'dashboard':
|
|
36
|
-
return item.dashboardName ? `${basePath}/dashboard/${item.dashboardName}` : '';
|
|
37
|
-
case 'page':
|
|
38
|
-
return item.pageName ? `${basePath}/page/${item.pageName}` : '';
|
|
39
|
-
case 'report':
|
|
40
|
-
return item.reportName ? `${basePath}/report/${item.reportName}` : '';
|
|
41
|
-
case 'url':
|
|
42
|
-
return item.url ?? '';
|
|
43
|
-
default:
|
|
44
|
-
return '';
|
|
45
|
-
}
|
|
34
|
+
const { href, external } = resolveHref(item, basePath);
|
|
35
|
+
if (external)
|
|
36
|
+
return href;
|
|
37
|
+
if (!href || href === '#')
|
|
38
|
+
return '';
|
|
39
|
+
return href;
|
|
46
40
|
}
|
|
47
41
|
function favoriteIdFor(navId) {
|
|
48
42
|
return `nav:${navId}`;
|
|
@@ -31,6 +31,39 @@ export declare function renameNavigationItems(navigation: NavigationItem[], type
|
|
|
31
31
|
* whose key ordering is deterministic (we control object creation).
|
|
32
32
|
*/
|
|
33
33
|
export declare function navigationEqual(a: NavigationItem[], b: NavigationItem[]): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* `sys_` is the platform-reserved metadata namespace (sys_organization_detail,
|
|
36
|
+
* sys_user_detail, …). Fallback signal only — see isPlatformArtifact.
|
|
37
|
+
*/
|
|
38
|
+
export declare function isSystemArtifactName(name: unknown): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Package/platform-shipped pages and dashboards are never "something the user
|
|
41
|
+
* just created", so they must not trigger navigation sync no matter when they
|
|
42
|
+
* appear in (or vanish from) the metadata lists — package install/uninstall
|
|
43
|
+
* mid-session looks exactly like user CRUD to a name-set diff. A package that
|
|
44
|
+
* ships pages also ships (or contributes to) the navigation that exposes
|
|
45
|
+
* them; auto-syncing on top of that would duplicate entries at best and write
|
|
46
|
+
* into apps the package never intended at worst.
|
|
47
|
+
*
|
|
48
|
+
* Provenance is the primary signal: ADR-0010's applyProtection stamps
|
|
49
|
+
* `_packageId` + `_provenance: 'package'` on artifacts registered with
|
|
50
|
+
* package coords (the engine manifest path passes them). The `sys_` name
|
|
51
|
+
* prefix is only a fallback for registration paths that don't stamp
|
|
52
|
+
* provenance yet — third-party plugin pages are NOT guaranteed to carry it,
|
|
53
|
+
* which is why the field check comes first.
|
|
54
|
+
*/
|
|
55
|
+
export declare function isPlatformArtifact(item: unknown): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Whether an app may be targeted by automatic navigation writes.
|
|
58
|
+
*
|
|
59
|
+
* ADR-0010 metadata protection: the loader stamps a `_lock` envelope on
|
|
60
|
+
* packaged artifacts (translated from the author-facing `protection` block,
|
|
61
|
+
* e.g. the `setup` app ships `protection.lock = 'full'`). Locks 'full' and
|
|
62
|
+
* 'no-overlay' reject PUT with 403 — a navigation write into such an app can
|
|
63
|
+
* never succeed, so don't attempt it (each attempt surfaced as a red
|
|
64
|
+
* "Failed to update navigation" toast).
|
|
65
|
+
*/
|
|
66
|
+
export declare function isNavigationSyncableApp(app: unknown): boolean;
|
|
34
67
|
export interface UseNavigationSyncReturn {
|
|
35
68
|
/** Call after a new page has been created / saved for the first time. */
|
|
36
69
|
syncPageCreated: (appName: string, pageName: string, label?: string) => Promise<void>;
|
|
@@ -13,6 +13,8 @@ import { toast } from 'sonner';
|
|
|
13
13
|
import { useObjectTranslation } from '@object-ui/i18n';
|
|
14
14
|
import { useAdapter } from '../providers/AdapterProvider';
|
|
15
15
|
import { useMetadata } from '../providers/MetadataProvider';
|
|
16
|
+
import { matchAppBySegment } from '../utils/appRoute';
|
|
17
|
+
import { usePreviewDrafts } from '../preview/PreviewModeContext';
|
|
16
18
|
// ============================================================================
|
|
17
19
|
// Pure utility helpers (exported for testing)
|
|
18
20
|
// ============================================================================
|
|
@@ -87,6 +89,54 @@ export function navigationEqual(a, b) {
|
|
|
87
89
|
return true;
|
|
88
90
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
89
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* `sys_` is the platform-reserved metadata namespace (sys_organization_detail,
|
|
94
|
+
* sys_user_detail, …). Fallback signal only — see isPlatformArtifact.
|
|
95
|
+
*/
|
|
96
|
+
export function isSystemArtifactName(name) {
|
|
97
|
+
return typeof name === 'string' && name.startsWith('sys_');
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Package/platform-shipped pages and dashboards are never "something the user
|
|
101
|
+
* just created", so they must not trigger navigation sync no matter when they
|
|
102
|
+
* appear in (or vanish from) the metadata lists — package install/uninstall
|
|
103
|
+
* mid-session looks exactly like user CRUD to a name-set diff. A package that
|
|
104
|
+
* ships pages also ships (or contributes to) the navigation that exposes
|
|
105
|
+
* them; auto-syncing on top of that would duplicate entries at best and write
|
|
106
|
+
* into apps the package never intended at worst.
|
|
107
|
+
*
|
|
108
|
+
* Provenance is the primary signal: ADR-0010's applyProtection stamps
|
|
109
|
+
* `_packageId` + `_provenance: 'package'` on artifacts registered with
|
|
110
|
+
* package coords (the engine manifest path passes them). The `sys_` name
|
|
111
|
+
* prefix is only a fallback for registration paths that don't stamp
|
|
112
|
+
* provenance yet — third-party plugin pages are NOT guaranteed to carry it,
|
|
113
|
+
* which is why the field check comes first.
|
|
114
|
+
*/
|
|
115
|
+
export function isPlatformArtifact(item) {
|
|
116
|
+
if (!item || typeof item !== 'object')
|
|
117
|
+
return false;
|
|
118
|
+
const a = item;
|
|
119
|
+
if (a._packageId != null || a._provenance === 'package')
|
|
120
|
+
return true;
|
|
121
|
+
return isSystemArtifactName(a.name);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Whether an app may be targeted by automatic navigation writes.
|
|
125
|
+
*
|
|
126
|
+
* ADR-0010 metadata protection: the loader stamps a `_lock` envelope on
|
|
127
|
+
* packaged artifacts (translated from the author-facing `protection` block,
|
|
128
|
+
* e.g. the `setup` app ships `protection.lock = 'full'`). Locks 'full' and
|
|
129
|
+
* 'no-overlay' reject PUT with 403 — a navigation write into such an app can
|
|
130
|
+
* never succeed, so don't attempt it (each attempt surfaced as a red
|
|
131
|
+
* "Failed to update navigation" toast).
|
|
132
|
+
*/
|
|
133
|
+
export function isNavigationSyncableApp(app) {
|
|
134
|
+
if (!app || typeof app !== 'object')
|
|
135
|
+
return false;
|
|
136
|
+
const a = app;
|
|
137
|
+
const lock = a._lock ?? a.protection?.lock;
|
|
138
|
+
return lock !== 'full' && lock !== 'no-overlay';
|
|
139
|
+
}
|
|
90
140
|
/**
|
|
91
141
|
* Hook that provides methods to keep the App navigation tree in sync with
|
|
92
142
|
* Page / Dashboard CRUD operations. Each method:
|
|
@@ -115,7 +165,7 @@ export function useNavigationSync() {
|
|
|
115
165
|
await refreshRef.current?.();
|
|
116
166
|
}, []);
|
|
117
167
|
/** Find the current app schema from metadata by name. */
|
|
118
|
-
const findApp = useCallback((appName) => apps
|
|
168
|
+
const findApp = useCallback((appName) => matchAppBySegment(apps, appName), [apps]);
|
|
119
169
|
// ------------------------------------------------------------------
|
|
120
170
|
// Created
|
|
121
171
|
// ------------------------------------------------------------------
|
|
@@ -324,7 +374,7 @@ export function useNavigationSync() {
|
|
|
324
374
|
const syncPageCreatedAllApps = useCallback(async (pageName, label) => {
|
|
325
375
|
for (const app of apps) {
|
|
326
376
|
const name = getAppName(app);
|
|
327
|
-
if (!name)
|
|
377
|
+
if (!name || !isNavigationSyncableApp(app))
|
|
328
378
|
continue;
|
|
329
379
|
await syncPageCreated(name, pageName, label);
|
|
330
380
|
}
|
|
@@ -333,7 +383,7 @@ export function useNavigationSync() {
|
|
|
333
383
|
const syncDashboardCreatedAllApps = useCallback(async (dashboardName, label) => {
|
|
334
384
|
for (const app of apps) {
|
|
335
385
|
const name = getAppName(app);
|
|
336
|
-
if (!name)
|
|
386
|
+
if (!name || !isNavigationSyncableApp(app))
|
|
337
387
|
continue;
|
|
338
388
|
await syncDashboardCreated(name, dashboardName, label);
|
|
339
389
|
}
|
|
@@ -342,7 +392,7 @@ export function useNavigationSync() {
|
|
|
342
392
|
const syncPageDeletedAllApps = useCallback(async (pageName) => {
|
|
343
393
|
for (const app of apps) {
|
|
344
394
|
const name = getAppName(app);
|
|
345
|
-
if (!name)
|
|
395
|
+
if (!name || !isNavigationSyncableApp(app))
|
|
346
396
|
continue;
|
|
347
397
|
await syncPageDeleted(name, pageName);
|
|
348
398
|
}
|
|
@@ -351,7 +401,7 @@ export function useNavigationSync() {
|
|
|
351
401
|
const syncDashboardDeletedAllApps = useCallback(async (dashboardName) => {
|
|
352
402
|
for (const app of apps) {
|
|
353
403
|
const name = getAppName(app);
|
|
354
|
-
if (!name)
|
|
404
|
+
if (!name || !isNavigationSyncableApp(app))
|
|
355
405
|
continue;
|
|
356
406
|
await syncDashboardDeleted(name, dashboardName);
|
|
357
407
|
}
|
|
@@ -360,7 +410,7 @@ export function useNavigationSync() {
|
|
|
360
410
|
const syncPageRenamedAllApps = useCallback(async (oldName, newName) => {
|
|
361
411
|
for (const app of apps) {
|
|
362
412
|
const name = getAppName(app);
|
|
363
|
-
if (!name)
|
|
413
|
+
if (!name || !isNavigationSyncableApp(app))
|
|
364
414
|
continue;
|
|
365
415
|
await syncPageRenamed(name, oldName, newName);
|
|
366
416
|
}
|
|
@@ -369,7 +419,7 @@ export function useNavigationSync() {
|
|
|
369
419
|
const syncDashboardRenamedAllApps = useCallback(async (oldName, newName) => {
|
|
370
420
|
for (const app of apps) {
|
|
371
421
|
const name = getAppName(app);
|
|
372
|
-
if (!name)
|
|
422
|
+
if (!name || !isNavigationSyncableApp(app))
|
|
373
423
|
continue;
|
|
374
424
|
await syncDashboardRenamed(name, oldName, newName);
|
|
375
425
|
}
|
|
@@ -404,10 +454,17 @@ export function useNavigationSync() {
|
|
|
404
454
|
* > should invoke `syncPageRenamed` / `syncDashboardRenamed` explicitly.
|
|
405
455
|
*/
|
|
406
456
|
export function NavigationSyncEffect() {
|
|
407
|
-
const { pages, dashboards, apps } = useMetadata();
|
|
457
|
+
const { pages, dashboards, apps, getTypeStatus } = useMetadata();
|
|
408
458
|
const adapter = useAdapter();
|
|
409
459
|
const adapterRef = useRef(adapter);
|
|
410
460
|
adapterRef.current = adapter;
|
|
461
|
+
// ADR-0037 — preview is read-only by design. Entering/leaving
|
|
462
|
+
// `?preview=draft` swaps the entire metadata source, so the page/dashboard
|
|
463
|
+
// sets legitimately DIFFER from the previous render; diffing across that
|
|
464
|
+
// swap would misread draft-only (or published-only) items as user
|
|
465
|
+
// creations/deletions and WRITE navigation changes back to the real app
|
|
466
|
+
// metadata from inside a preview. Disabled for the whole preview session.
|
|
467
|
+
const previewDrafts = usePreviewDrafts();
|
|
411
468
|
const { syncPageCreated, syncDashboardCreated, syncPageDeleted, syncDashboardDeleted, } = useNavigationSync();
|
|
412
469
|
// Track previous page/dashboard name sets
|
|
413
470
|
const prevPageNamesRef = useRef(null);
|
|
@@ -422,8 +479,35 @@ export function NavigationSyncEffect() {
|
|
|
422
479
|
useEffect(() => {
|
|
423
480
|
if (syncingRef.current)
|
|
424
481
|
return;
|
|
425
|
-
|
|
426
|
-
|
|
482
|
+
if (previewDrafts) {
|
|
483
|
+
// Drop the baseline so leaving preview re-seeds instead of diffing the
|
|
484
|
+
// published world against the draft world it just stopped rendering.
|
|
485
|
+
prevPageNamesRef.current = null;
|
|
486
|
+
prevDashNamesRef.current = null;
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
// `page` and `dashboard` are lazily-loaded metadata types: their arrays
|
|
490
|
+
// are empty (or stale) until the fetch lands, and `invalidate()` empties
|
|
491
|
+
// them again mid-session (e.g. the New-record flow reloads meta). Diffing
|
|
492
|
+
// a not-ready snapshot misreads that dip as mass deletion / re-creation —
|
|
493
|
+
// notably flagging system pages as "user added" once the full list
|
|
494
|
+
// arrives. Only seed the baseline and diff while both types are 'ready'.
|
|
495
|
+
// (Contexts without getTypeStatus — hand-rolled test values — are
|
|
496
|
+
// treated as always ready.)
|
|
497
|
+
if (getTypeStatus &&
|
|
498
|
+
(getTypeStatus('page') !== 'ready' || getTypeStatus('dashboard') !== 'ready')) {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
// Platform/package artifacts never participate in the diff: they ship
|
|
502
|
+
// with the platform or arrive via package install, not from user CRUD,
|
|
503
|
+
// so their appearance must not write them into app navigation (nor
|
|
504
|
+
// their disappearance delete nav entries). See isPlatformArtifact.
|
|
505
|
+
const userArtifactNames = (items) => new Set(items
|
|
506
|
+
.filter((it) => !isPlatformArtifact(it))
|
|
507
|
+
.map((it) => it?.name)
|
|
508
|
+
.filter((n) => typeof n === 'string' && n.length > 0));
|
|
509
|
+
const currentPageNames = userArtifactNames(pages ?? []);
|
|
510
|
+
const currentDashNames = userArtifactNames(dashboards ?? []);
|
|
427
511
|
const prevPages = prevPageNamesRef.current;
|
|
428
512
|
const prevDash = prevDashNamesRef.current;
|
|
429
513
|
// First render — seed refs and exit without syncing
|
|
@@ -456,7 +540,9 @@ export function NavigationSyncEffect() {
|
|
|
456
540
|
if (cancelled || syncVersionRef.current !== version)
|
|
457
541
|
break;
|
|
458
542
|
const appName = getAppName(app);
|
|
459
|
-
|
|
543
|
+
// Write-protected apps (ADR-0010 `_lock`) would 403 every PUT —
|
|
544
|
+
// skip them instead of spraying failure toasts.
|
|
545
|
+
if (!appName || !isNavigationSyncableApp(app))
|
|
460
546
|
continue;
|
|
461
547
|
for (const pageName of addedPages) {
|
|
462
548
|
if (cancelled)
|
|
@@ -492,6 +578,6 @@ export function NavigationSyncEffect() {
|
|
|
492
578
|
return () => {
|
|
493
579
|
cancelled = true;
|
|
494
580
|
};
|
|
495
|
-
}, [pages, dashboards, apps, syncPageCreated, syncDashboardCreated, syncPageDeleted, syncDashboardDeleted]);
|
|
581
|
+
}, [pages, dashboards, apps, previewDrafts, getTypeStatus, syncPageCreated, syncDashboardCreated, syncPageDeleted, syncDashboardDeleted]);
|
|
496
582
|
return null;
|
|
497
583
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
* ADR-0013 D2 — shared "reconcile a stream-transport failure instead of
|
|
10
|
+
* blindly retrying" wiring, used by every chat surface (AiChatPage and the
|
|
11
|
+
* console floating chatbot) so the behaviour is identical.
|
|
12
|
+
*
|
|
13
|
+
* The agent runtime persists the final assistant reply BEFORE it streams it
|
|
14
|
+
* (framework `service-ai`), so a network drop AFTER the turn completed leaves a
|
|
15
|
+
* complete reply server-side while the client only sees a stream error. On
|
|
16
|
+
* error we GET the conversation and, if the turn actually finished
|
|
17
|
+
* (`isReconcilableCompletedTurn`), re-hydrate the thread with the persisted
|
|
18
|
+
* messages and suppress the scary "Response failed / Retry" banner — the
|
|
19
|
+
* failure becomes a non-event. A genuinely-incomplete turn still surfaces
|
|
20
|
+
* Retry, whose re-send is idempotent under D1 (same `turnId`).
|
|
21
|
+
*/
|
|
22
|
+
export interface ReconcileOnError {
|
|
23
|
+
/** True when the last stream error was reconciled away (turn had completed). */
|
|
24
|
+
errorSuppressed: boolean;
|
|
25
|
+
/** Wire as `useObjectChat({ onError })`. */
|
|
26
|
+
handleChatError: (err: Error) => Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Assign `ref.current = setMessages` from `useObjectChat` (API mode) so the
|
|
29
|
+
* thread can be re-hydrated from the server on a reconcilable failure.
|
|
30
|
+
*/
|
|
31
|
+
setMessagesRef: React.MutableRefObject<((m: unknown[]) => void) | undefined>;
|
|
32
|
+
/** Call when a fresh turn is sent, to clear any prior suppression. */
|
|
33
|
+
resetSuppression: () => void;
|
|
34
|
+
}
|
|
35
|
+
export declare function useReconcileOnError(opts: {
|
|
36
|
+
/** The agent chat endpoint, e.g. `${apiBase}/agents/:name/chat`. */
|
|
37
|
+
chatApi?: string;
|
|
38
|
+
/** Active conversation id (no reconciliation possible without one). */
|
|
39
|
+
conversationId?: string;
|
|
40
|
+
}): ReconcileOnError;
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
import { useCallback, useRef, useState } from 'react';
|
|
9
|
+
import { fetchConversation, toUIMessages } from './useChatConversation';
|
|
10
|
+
import { isReconcilableCompletedTurn } from '../console/ai/reconcileTurn';
|
|
11
|
+
export function useReconcileOnError(opts) {
|
|
12
|
+
const { chatApi, conversationId } = opts;
|
|
13
|
+
const [errorSuppressed, setErrorSuppressed] = useState(false);
|
|
14
|
+
const setMessagesRef = useRef(undefined);
|
|
15
|
+
const handleChatError = useCallback(async (_err) => {
|
|
16
|
+
const aiBase = chatApi?.replace(/\/agents\/[^/]+\/chat$/, '');
|
|
17
|
+
if (!conversationId || !aiBase) {
|
|
18
|
+
setErrorSuppressed(false);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
const conv = await fetchConversation(aiBase, conversationId);
|
|
23
|
+
const ui = toUIMessages(conv?.messages);
|
|
24
|
+
if (isReconcilableCompletedTurn(ui) && setMessagesRef.current) {
|
|
25
|
+
setMessagesRef.current(ui);
|
|
26
|
+
setErrorSuppressed(true);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
/* fall through to the normal error banner */
|
|
32
|
+
}
|
|
33
|
+
setErrorSuppressed(false);
|
|
34
|
+
}, [conversationId, chatApi]);
|
|
35
|
+
const resetSuppression = useCallback(() => setErrorSuppressed(false), []);
|
|
36
|
+
return { errorSuppressed, handleChatError, setMessagesRef, resetSuppression };
|
|
37
|
+
}
|
|
@@ -2,20 +2,21 @@
|
|
|
2
2
|
* useRecordApprovals
|
|
3
3
|
*
|
|
4
4
|
* Resolves the approval state for a single record so the detail-view header
|
|
5
|
-
* can surface
|
|
5
|
+
* can surface a status badge and — when the current user is a pending
|
|
6
|
+
* approver — "Approve" / "Reject" actions.
|
|
7
|
+
*
|
|
8
|
+
* Since ADR-0019 an approval is a **flow node** (`type: 'approval'`), not a
|
|
9
|
+
* standalone process: the flow opens the request when it reaches the node,
|
|
10
|
+
* and a decision resumes the run down its `approve` / `reject` edge. There is
|
|
11
|
+
* therefore no manual "submit" or "recall" from the record header — those
|
|
12
|
+
* endpoints were removed. This hook reads the record's requests and lets a
|
|
13
|
+
* pending approver record a decision.
|
|
6
14
|
*
|
|
7
15
|
* Talks directly to the framework REST endpoints under
|
|
8
|
-
* `/api/v1/approvals/*`. Fails open: if the approvals plugin is not
|
|
9
|
-
*
|
|
10
|
-
*
|
|
16
|
+
* `/api/v1/approvals/*`. Fails open: if the approvals plugin is not installed
|
|
17
|
+
* (404 / 501) or the user has no identity, returns inert state so the detail
|
|
18
|
+
* view continues to render normally.
|
|
11
19
|
*/
|
|
12
|
-
export interface ApprovalProcessLite {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
label?: string;
|
|
16
|
-
object_name: string;
|
|
17
|
-
active?: boolean;
|
|
18
|
-
}
|
|
19
20
|
export interface ApprovalRequestLite {
|
|
20
21
|
id: string;
|
|
21
22
|
process_name: string;
|
|
@@ -31,18 +32,16 @@ export interface ApprovalRequestLite {
|
|
|
31
32
|
interface UseRecordApprovalsResult {
|
|
32
33
|
loading: boolean;
|
|
33
34
|
available: boolean;
|
|
34
|
-
processes: ApprovalProcessLite[];
|
|
35
35
|
pendingRequest: ApprovalRequestLite | null;
|
|
36
36
|
latestRequest: ApprovalRequestLite | null;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
processName?: string;
|
|
37
|
+
/** The current user is among the pending approvers and may record a decision. */
|
|
38
|
+
canDecide: boolean;
|
|
39
|
+
approve: (input?: {
|
|
41
40
|
comment?: string;
|
|
42
|
-
}) => Promise<ApprovalRequestLite>;
|
|
43
|
-
|
|
41
|
+
}) => Promise<ApprovalRequestLite | undefined>;
|
|
42
|
+
reject: (input?: {
|
|
44
43
|
comment?: string;
|
|
45
|
-
}) => Promise<ApprovalRequestLite>;
|
|
44
|
+
}) => Promise<ApprovalRequestLite | undefined>;
|
|
46
45
|
refresh: () => Promise<void>;
|
|
47
46
|
}
|
|
48
47
|
export declare function useRecordApprovals(objectName: string | undefined, recordId: string | undefined, currentUserId?: string | null): UseRecordApprovalsResult;
|