@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,242 @@
|
|
|
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
|
+
* AppContextSelectors — renders the app-level "scope" dropdowns declared
|
|
5
|
+
* in `App.contextSelectors` (e.g. the Studio package filter) and exposes
|
|
6
|
+
* their current values so the sidebar can feed them into
|
|
7
|
+
* `NavigationRenderer`'s `templateContext.contextValues`.
|
|
8
|
+
*
|
|
9
|
+
* Each selector's value is published under its `id` and referenced by
|
|
10
|
+
* nav items as `{<id>}` (e.g. `{active_package}`), exactly like the
|
|
11
|
+
* built-in `{current_user_id}` / `{current_org_id}` template vars.
|
|
12
|
+
* Selecting an option therefore transparently scopes every child nav
|
|
13
|
+
* item — no per-item wiring required.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
import * as React from 'react';
|
|
18
|
+
import { useLocation, useNavigate } from 'react-router-dom';
|
|
19
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@object-ui/components';
|
|
20
|
+
import { getIcon } from '../utils/getIcon';
|
|
21
|
+
import { resolveI18nLabel } from '../utils';
|
|
22
|
+
// Local/Custom scope sentinel — kept inline (not imported from metadata-admin)
|
|
23
|
+
// so this layout module never forms an import cycle with the metadata-admin
|
|
24
|
+
// views. Mirrors `LOCAL_PACKAGE_ID` in views/metadata-admin/package-scope.ts.
|
|
25
|
+
const LOCAL_SCOPE_ID = 'sys_metadata';
|
|
26
|
+
function localScopeLabel() {
|
|
27
|
+
const lang = (typeof document !== 'undefined' && document.documentElement?.lang) ||
|
|
28
|
+
(typeof navigator !== 'undefined' && navigator.language) ||
|
|
29
|
+
'';
|
|
30
|
+
return /^zh/i.test(lang) ? '本地 / 自定义(本环境)' : 'Local / Custom (this env)';
|
|
31
|
+
}
|
|
32
|
+
const ALL_SENTINEL = '__all__';
|
|
33
|
+
/** Read a (possibly dotted) property path off a row, e.g. `manifest.id`. */
|
|
34
|
+
function getByPath(row, key) {
|
|
35
|
+
if (!key)
|
|
36
|
+
return undefined;
|
|
37
|
+
return key.split('.').reduce((o, k) => (o == null ? o : o[k]), row);
|
|
38
|
+
}
|
|
39
|
+
/** Tolerate the common REST envelope shapes used across the platform. */
|
|
40
|
+
function extractRows(json) {
|
|
41
|
+
if (Array.isArray(json))
|
|
42
|
+
return json;
|
|
43
|
+
const d = json?.data ?? json;
|
|
44
|
+
if (Array.isArray(d))
|
|
45
|
+
return d;
|
|
46
|
+
if (Array.isArray(d?.packages))
|
|
47
|
+
return d.packages;
|
|
48
|
+
if (Array.isArray(d?.items))
|
|
49
|
+
return d.items;
|
|
50
|
+
if (Array.isArray(json?.items))
|
|
51
|
+
return json.items;
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
/** Apply a selector's `filter` predicates (AND) to a fetched row. */
|
|
55
|
+
function rowPasses(row, filters) {
|
|
56
|
+
if (!filters || filters.length === 0)
|
|
57
|
+
return true;
|
|
58
|
+
for (const f of filters) {
|
|
59
|
+
const actual = getByPath(row, f.key);
|
|
60
|
+
const op = f.op ?? 'eq';
|
|
61
|
+
const list = Array.isArray(f.value) ? f.value : [f.value];
|
|
62
|
+
switch (op) {
|
|
63
|
+
case 'eq':
|
|
64
|
+
if (actual !== f.value)
|
|
65
|
+
return false;
|
|
66
|
+
break;
|
|
67
|
+
case 'ne':
|
|
68
|
+
if (actual === f.value)
|
|
69
|
+
return false;
|
|
70
|
+
break;
|
|
71
|
+
// `in`/`nin` treat a missing value as "not in the set", which keeps
|
|
72
|
+
// untagged rows visible under `nin` (e.g. a package whose manifest
|
|
73
|
+
// omits `scope` defaults to project and should remain selectable).
|
|
74
|
+
case 'in':
|
|
75
|
+
if (!list.includes(actual))
|
|
76
|
+
return false;
|
|
77
|
+
break;
|
|
78
|
+
case 'nin':
|
|
79
|
+
if (list.includes(actual))
|
|
80
|
+
return false;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
function useSelectorOptions(def) {
|
|
87
|
+
const [options, setOptions] = React.useState([]);
|
|
88
|
+
const endpoint = def.optionsSource.endpoint;
|
|
89
|
+
const valueKey = def.optionsSource.valueKey || 'id';
|
|
90
|
+
const labelKey = def.optionsSource.labelKey || 'name';
|
|
91
|
+
const filters = def.optionsSource.filter;
|
|
92
|
+
const filterKey = JSON.stringify(filters ?? []);
|
|
93
|
+
// Stable, re-runnable fetch. Without an explicit refetch the option list is
|
|
94
|
+
// read once on mount, so a package created elsewhere (PackagesPage) stays
|
|
95
|
+
// invisible in this dropdown until a full page reload. We refetch on
|
|
96
|
+
// dropdown-open and on a global `objectui:packages-changed` signal.
|
|
97
|
+
const load = React.useCallback(async () => {
|
|
98
|
+
try {
|
|
99
|
+
const res = await fetch(endpoint, {
|
|
100
|
+
credentials: 'include',
|
|
101
|
+
headers: { Accept: 'application/json' },
|
|
102
|
+
});
|
|
103
|
+
if (!res.ok)
|
|
104
|
+
return;
|
|
105
|
+
const json = await res.json();
|
|
106
|
+
const rows = extractRows(json);
|
|
107
|
+
const opts = [];
|
|
108
|
+
const seen = new Set();
|
|
109
|
+
for (const row of rows) {
|
|
110
|
+
if (!rowPasses(row, filters))
|
|
111
|
+
continue;
|
|
112
|
+
const value = getByPath(row, valueKey);
|
|
113
|
+
if (value == null || typeof value !== 'string' || seen.has(value))
|
|
114
|
+
continue;
|
|
115
|
+
seen.add(value);
|
|
116
|
+
const labelRaw = getByPath(row, labelKey);
|
|
117
|
+
opts.push({ value, label: typeof labelRaw === 'string' && labelRaw ? labelRaw : value });
|
|
118
|
+
}
|
|
119
|
+
opts.sort((a, b) => a.label.localeCompare(b.label));
|
|
120
|
+
// The package-scope selector gets a stable "Local / Custom (this env)"
|
|
121
|
+
// entry for this environment's runtime, DB-authored metadata — it is
|
|
122
|
+
// never a real package row (`package_id = null` / `sys_metadata`
|
|
123
|
+
// provenance) yet must always be selectable so org-authored items are
|
|
124
|
+
// discoverable and editable. The metadata list/get API already treats
|
|
125
|
+
// `?package=sys_metadata` as exactly this local scope.
|
|
126
|
+
if (/package/i.test(endpoint) && !opts.some((o) => o.value === LOCAL_SCOPE_ID)) {
|
|
127
|
+
opts.push({ value: LOCAL_SCOPE_ID, label: localScopeLabel() });
|
|
128
|
+
}
|
|
129
|
+
setOptions(opts);
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
/* offline / unauthorized — render with no options */
|
|
133
|
+
}
|
|
134
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
135
|
+
}, [endpoint, valueKey, labelKey, filterKey]);
|
|
136
|
+
React.useEffect(() => {
|
|
137
|
+
void load();
|
|
138
|
+
const onChanged = () => { void load(); };
|
|
139
|
+
window.addEventListener('objectui:packages-changed', onChanged);
|
|
140
|
+
return () => window.removeEventListener('objectui:packages-changed', onChanged);
|
|
141
|
+
}, [load]);
|
|
142
|
+
return { options, refetch: load };
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Hook: resolves the active values for an app's context selectors and
|
|
146
|
+
* returns a ready-to-render UI element plus the `contextValues` map for
|
|
147
|
+
* `NavigationRenderer`.
|
|
148
|
+
*/
|
|
149
|
+
export function useAppContextSelectors(appName, selectors, t) {
|
|
150
|
+
const list = Array.isArray(selectors) ? selectors : [];
|
|
151
|
+
const navigate = useNavigate();
|
|
152
|
+
const location = useLocation();
|
|
153
|
+
// The URL query string is the single source of truth for the active
|
|
154
|
+
// scope. Deriving the selected value from it (rather than a parallel
|
|
155
|
+
// useState) keeps the sidebar control in lock-step with the page — no
|
|
156
|
+
// more "sidebar says A while the list shows B" drift.
|
|
157
|
+
const params = new URLSearchParams(location.search);
|
|
158
|
+
// Re-apply a remembered scope whenever navigation drops the query param.
|
|
159
|
+
// The selector is mandatory for Studio: package-scoped pages should never
|
|
160
|
+
// sit at a blank package value just because a nav link omitted `?package=`.
|
|
161
|
+
React.useEffect(() => {
|
|
162
|
+
const p = new URLSearchParams(location.search);
|
|
163
|
+
let changed = false;
|
|
164
|
+
for (const sel of list) {
|
|
165
|
+
if (sel.persist === 'none')
|
|
166
|
+
continue;
|
|
167
|
+
if (p.get('package'))
|
|
168
|
+
continue;
|
|
169
|
+
try {
|
|
170
|
+
const saved = sessionStorage.getItem(`objectui-ctx-${appName}-${sel.id}`);
|
|
171
|
+
if (saved) {
|
|
172
|
+
p.set('package', saved);
|
|
173
|
+
changed = true;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
catch { /* storage disabled */ }
|
|
177
|
+
}
|
|
178
|
+
if (changed) {
|
|
179
|
+
navigate({ pathname: location.pathname, search: p.toString() }, { replace: true });
|
|
180
|
+
}
|
|
181
|
+
}, [appName, list, location.pathname, location.search, navigate]);
|
|
182
|
+
const setValue = React.useCallback((sel, raw) => {
|
|
183
|
+
const value = raw === ALL_SENTINEL ? (sel.allValue ?? '') : raw;
|
|
184
|
+
try {
|
|
185
|
+
const key = `objectui-ctx-${appName}-${sel.id}`;
|
|
186
|
+
if (value)
|
|
187
|
+
sessionStorage.setItem(key, value);
|
|
188
|
+
else
|
|
189
|
+
sessionStorage.removeItem(key);
|
|
190
|
+
}
|
|
191
|
+
catch { /* storage disabled */ }
|
|
192
|
+
// Reflect the scope onto the current page immediately. Metadata
|
|
193
|
+
// surfaces read the `package` query param as the conventional filter
|
|
194
|
+
// key; nav links pick it up via the `{active_package}` template var.
|
|
195
|
+
const next = new URLSearchParams(location.search);
|
|
196
|
+
if (value)
|
|
197
|
+
next.set('package', value);
|
|
198
|
+
else
|
|
199
|
+
next.delete('package');
|
|
200
|
+
navigate({ pathname: location.pathname, search: next.toString() }, { replace: true });
|
|
201
|
+
}, [appName, location.pathname, location.search, navigate]);
|
|
202
|
+
const contextValues = {};
|
|
203
|
+
for (const sel of list) {
|
|
204
|
+
let saved = '';
|
|
205
|
+
try {
|
|
206
|
+
saved = sessionStorage.getItem(`objectui-ctx-${appName}-${sel.id}`) ?? '';
|
|
207
|
+
}
|
|
208
|
+
catch { /* storage disabled */ }
|
|
209
|
+
contextValues[sel.id] = (params.get('package') ?? saved) || (sel.allValue ?? '');
|
|
210
|
+
}
|
|
211
|
+
const element = list.length === 0 ? null : (_jsx("div", { className: "flex flex-col gap-1.5", children: list.map((sel) => (_jsx(SelectorControl, { def: sel, value: contextValues[sel.id], onChange: (raw) => setValue(sel, raw), t: t }, sel.id))) }));
|
|
212
|
+
return { contextValues, element };
|
|
213
|
+
}
|
|
214
|
+
function SelectorControl({ def, value, onChange, t, }) {
|
|
215
|
+
const { options, refetch } = useSelectorOptions(def);
|
|
216
|
+
const Icon = getIcon(def.icon);
|
|
217
|
+
const rawLabel = resolveI18nLabel(def.label, t) || def.id;
|
|
218
|
+
const label = rawLabel === 'Package'
|
|
219
|
+
? (t?.('common.package', { defaultValue: rawLabel }) ?? rawLabel)
|
|
220
|
+
: rawLabel;
|
|
221
|
+
const placeholder = t?.('actionDialog.selectPlaceholder', {
|
|
222
|
+
label,
|
|
223
|
+
defaultValue: `Select ${label}…`,
|
|
224
|
+
}) ?? `Select ${label}…`;
|
|
225
|
+
// Context selectors are *mandatory scope* selectors: a concrete option must
|
|
226
|
+
// always be active. Allowing an "All" choice would unscope the surface and,
|
|
227
|
+
// for Studio's package filter, leak system metadata. We therefore ignore
|
|
228
|
+
// `includeAll`, never render an "All" row, and auto-select the first option
|
|
229
|
+
// as soon as the list resolves when nothing concrete is selected yet.
|
|
230
|
+
const hasConcrete = !!value && value !== (def.allValue ?? '');
|
|
231
|
+
React.useEffect(() => {
|
|
232
|
+
if (hasConcrete) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
if (options.length > 0) {
|
|
236
|
+
onChange(options[0].value);
|
|
237
|
+
}
|
|
238
|
+
}, [hasConcrete, onChange, options]);
|
|
239
|
+
const current = hasConcrete ? value : '';
|
|
240
|
+
return (_jsxs(Select, { value: current, onValueChange: onChange, onOpenChange: (open) => { if (open)
|
|
241
|
+
refetch(); }, children: [_jsx(SelectTrigger, { "aria-label": label, "data-testid": "package-switcher", className: "h-9 w-full gap-2 rounded-md border-sidebar-border/70 bg-sidebar/80 px-2 text-xs font-medium text-sidebar-foreground shadow-none transition-colors hover:bg-sidebar-accent focus:ring-1 focus:ring-sidebar-ring data-[state=open]:bg-sidebar-accent [&>svg]:h-3.5 [&>svg]:w-3.5 [&>svg]:shrink-0", children: _jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2 overflow-hidden", children: [_jsx("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded border border-sidebar-border/70 bg-sidebar-accent text-sidebar-foreground/70", children: _jsx(Icon, { className: "h-3 w-3" }) }), _jsx(SelectValue, { placeholder: placeholder, className: "truncate" })] }) }), _jsx(SelectContent, { className: "w-[var(--radix-select-trigger-width)]", children: options.map((opt) => (_jsx(SelectItem, { value: opt.value, children: opt.label }, opt.value))) })] }));
|
|
242
|
+
}
|
|
@@ -16,9 +16,14 @@
|
|
|
16
16
|
import type { ActivityItem } from './ActivityFeed';
|
|
17
17
|
export interface InboxNotification {
|
|
18
18
|
id: string;
|
|
19
|
+
/** FK → sys_notification (L2 event) — keys the read-state receipt (ADR-0030). */
|
|
20
|
+
notification_id?: string | null;
|
|
21
|
+
receipt_id?: string | null;
|
|
19
22
|
type: string;
|
|
20
23
|
title: string;
|
|
21
24
|
body?: string | null;
|
|
25
|
+
/** Deep-link target carried by the inbox materialization. */
|
|
26
|
+
action_url?: string | null;
|
|
22
27
|
source_object?: string | null;
|
|
23
28
|
source_id?: string | null;
|
|
24
29
|
actor_name?: string | null;
|
|
@@ -33,4 +38,4 @@ export interface InboxPopoverProps {
|
|
|
33
38
|
onMarkAllRead: () => void;
|
|
34
39
|
onMarkRead: (id: string) => void;
|
|
35
40
|
}
|
|
36
|
-
export declare function InboxPopover({ notifications, unreadCount, pendingApprovalsCount, activities, onMarkAllRead, onMarkRead, }: InboxPopoverProps): import("react
|
|
41
|
+
export declare function InboxPopover({ notifications, unreadCount, pendingApprovalsCount, activities, onMarkAllRead, onMarkRead, }: InboxPopoverProps): import("react").JSX.Element;
|
|
@@ -77,11 +77,11 @@ export function InboxPopover({ notifications, unreadCount, pendingApprovalsCount
|
|
|
77
77
|
};
|
|
78
78
|
const goToAllNotifications = () => {
|
|
79
79
|
setOpen(false);
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
navigate('/apps/setup/
|
|
80
|
+
// Route through the setup app's sys_inbox_message list view — the
|
|
81
|
+
// canonical full-page inbox (ADR-0030 L5), outside per-app sidebars. The
|
|
82
|
+
// `?view=mine` query selects the user-scoped "Notifications" view, matching
|
|
83
|
+
// the popover scope.
|
|
84
|
+
navigate('/apps/setup/sys_inbox_message?view=mine');
|
|
85
85
|
};
|
|
86
86
|
const goToAllActivity = () => {
|
|
87
87
|
setOpen(false);
|
|
@@ -92,9 +92,28 @@ export function InboxPopover({ notifications, unreadCount, pendingApprovalsCount
|
|
|
92
92
|
};
|
|
93
93
|
const handleNotificationClick = (n) => {
|
|
94
94
|
onMarkRead(n.id);
|
|
95
|
+
const app = currentAppName ?? params.appName;
|
|
96
|
+
// Prefer the materialization's action_url (ADR-0030). The messaging
|
|
97
|
+
// pipeline synthesizes an app-relative `/{object}/{id}` link from the
|
|
98
|
+
// event's source when a producer didn't set an explicit url.
|
|
99
|
+
if (n.action_url) {
|
|
100
|
+
setOpen(false);
|
|
101
|
+
const url = n.action_url;
|
|
102
|
+
if (/^https?:\/\//i.test(url)) {
|
|
103
|
+
window.open(url, '_blank', 'noopener,noreferrer');
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (url.startsWith('/apps/')) {
|
|
107
|
+
navigate(url);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const rel = url.startsWith('/') ? url : `/${url}`;
|
|
111
|
+
navigate(app ? `/apps/${app}${rel}` : rel);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
// Back-compat fallback: explicit source object/record pointer.
|
|
95
115
|
if (n.source_object && n.source_id) {
|
|
96
116
|
setOpen(false);
|
|
97
|
-
const app = currentAppName ?? params.appName;
|
|
98
117
|
const target = app
|
|
99
118
|
? `/apps/${app}/${n.source_object}/${n.source_id}`
|
|
100
119
|
: `/objects/${n.source_object}/${n.source_id}`;
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* Dropdown menu for switching the application language.
|
|
5
5
|
* Uses the i18n context to change language at runtime.
|
|
6
6
|
*/
|
|
7
|
-
export declare function LocaleSwitcher(): import("react
|
|
7
|
+
export declare function LocaleSwitcher(): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { PanelLeft } from 'lucide-react';
|
|
4
|
+
import { Button, cn, useSidebar } from '@object-ui/components';
|
|
5
|
+
import { useObjectTranslation } from '@object-ui/i18n';
|
|
6
|
+
export const LocalizedSidebarTrigger = React.forwardRef(({ className, onClick, 'aria-label': ariaLabel, title, ...props }, ref) => {
|
|
7
|
+
const { toggleSidebar } = useSidebar();
|
|
8
|
+
const { t } = useObjectTranslation();
|
|
9
|
+
const label = String(ariaLabel || title || t('common.toggleSidebar', { defaultValue: 'Toggle sidebar' }));
|
|
10
|
+
return (_jsxs(Button, { ref: ref, "data-sidebar": "trigger", variant: "ghost", size: "icon", className: cn('h-7 w-7', className), "aria-label": label, title: label, onClick: (event) => {
|
|
11
|
+
onClick?.(event);
|
|
12
|
+
toggleSidebar();
|
|
13
|
+
}, ...props, children: [_jsx(PanelLeft, {}), _jsx("span", { className: "sr-only", children: label })] }));
|
|
14
|
+
});
|
|
15
|
+
LocalizedSidebarTrigger.displayName = 'LocalizedSidebarTrigger';
|
|
@@ -54,7 +54,7 @@ export interface MobileViewSwitcherValue {
|
|
|
54
54
|
/** Provider — mount once near the top of the console tree (above AppHeader). */
|
|
55
55
|
export declare function MobileViewSwitcherProvider({ children }: {
|
|
56
56
|
children: React.ReactNode;
|
|
57
|
-
}):
|
|
57
|
+
}): React.JSX.Element;
|
|
58
58
|
/** Read the currently registered switcher value (or `null`). */
|
|
59
59
|
export declare function useMobileViewSwitcher(): MobileViewSwitcherValue | null;
|
|
60
60
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function ModeToggle(): import("react
|
|
1
|
+
export declare function ModeToggle(): import("react").JSX.Element;
|
|
@@ -65,5 +65,5 @@ export interface PageHeaderProps {
|
|
|
65
65
|
* (`--page-header-accent`) so consumers can override it without rebuilding
|
|
66
66
|
* Tailwind classes.
|
|
67
67
|
*/
|
|
68
|
-
export declare function PageHeader({ title, description, icon, actions, accentColor, sticky, className, 'data-testid': testId, }: PageHeaderProps):
|
|
68
|
+
export declare function PageHeader({ title, description, icon, actions, accentColor, sticky, className, 'data-testid': testId, }: PageHeaderProps): React.JSX.Element;
|
|
69
69
|
export default PageHeader;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @module
|
|
14
14
|
*/
|
|
15
|
+
import * as React from 'react';
|
|
15
16
|
/**
|
|
16
17
|
* Lazy-resolved Lucide icon — see ../utils/getIcon for impl.
|
|
17
18
|
* The local symbol is kept for backwards compat with existing call sites
|
|
@@ -23,5 +24,5 @@ interface UnifiedSidebarProps {
|
|
|
23
24
|
/** Callback when user switches apps */
|
|
24
25
|
onAppChange?: (name: string) => void;
|
|
25
26
|
}
|
|
26
|
-
export declare function UnifiedSidebar({ activeAppName }: UnifiedSidebarProps):
|
|
27
|
+
export declare function UnifiedSidebar({ activeAppName }: UnifiedSidebarProps): React.JSX.Element;
|
|
27
28
|
export {};
|
|
@@ -16,20 +16,24 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
16
16
|
import * as React from 'react';
|
|
17
17
|
import { Link, useLocation } from 'react-router-dom';
|
|
18
18
|
import { getIcon } from '../utils/getIcon';
|
|
19
|
-
import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarGroup, SidebarGroupLabel, SidebarGroupContent, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarMenuAction,
|
|
19
|
+
import { Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarGroup, SidebarGroupLabel, SidebarGroupContent, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarMenuAction, useSidebar, } from '@object-ui/components';
|
|
20
20
|
import { Clock, Star, StarOff, ChevronRight, Home, Layers, } from 'lucide-react';
|
|
21
21
|
import { NavigationRenderer } from '@object-ui/layout';
|
|
22
22
|
import { useMetadata } from '../providers/MetadataProvider';
|
|
23
23
|
import { useExpressionContext, evaluateVisibility } from '../providers/ExpressionProvider';
|
|
24
24
|
import { usePermissions } from '@object-ui/permissions';
|
|
25
|
+
import { useAuth, useIsWorkspaceAdmin } from '@object-ui/auth';
|
|
25
26
|
import { useRecentItems } from '../hooks/useRecentItems';
|
|
26
27
|
import { useFavorites } from '../hooks/useFavorites';
|
|
27
28
|
import { useNavPins } from '../hooks/useNavPins';
|
|
29
|
+
import { matchAppBySegment, appRouteSegment } from '../utils';
|
|
28
30
|
import { useObjectTranslation, useObjectLabel } from '@object-ui/i18n';
|
|
29
31
|
// useObjectLabel provides appLabel/appDescription for convention-based
|
|
30
32
|
// i18n lookup — `{ns}.apps.{name}.label` resolves to the translated label
|
|
31
33
|
// loaded from /api/v1/i18n/translations/:locale.
|
|
32
34
|
import { useNavigationContext } from '../context/NavigationContext';
|
|
35
|
+
import { useAppContextSelectors } from './ContextSelectors';
|
|
36
|
+
import { LocalizedSidebarTrigger } from './LocalizedSidebarTrigger';
|
|
33
37
|
// ---------------------------------------------------------------------------
|
|
34
38
|
// useNavOrder – localStorage-persisted drag-and-drop reorder for nav items
|
|
35
39
|
// ---------------------------------------------------------------------------
|
|
@@ -84,12 +88,27 @@ function useNavOrder(appName) {
|
|
|
84
88
|
}, [orderMap, persist]);
|
|
85
89
|
return { applyOrder, handleReorder };
|
|
86
90
|
}
|
|
91
|
+
function isMetadataDirectoryItem(item) {
|
|
92
|
+
return item.componentRef === 'metadata:directory';
|
|
93
|
+
}
|
|
94
|
+
function isPackagesItem(item) {
|
|
95
|
+
return item.componentRef === 'developer:packages';
|
|
96
|
+
}
|
|
97
|
+
function isOverviewGroup(item) {
|
|
98
|
+
if (item.type !== 'group')
|
|
99
|
+
return false;
|
|
100
|
+
const id = String(item.id ?? '').toLowerCase();
|
|
101
|
+
const label = typeof item.label === 'string' ? item.label.toLowerCase() : '';
|
|
102
|
+
return id === 'overview' || label === 'overview';
|
|
103
|
+
}
|
|
87
104
|
export function UnifiedSidebar({ activeAppName }) {
|
|
88
105
|
const { isMobile, setOpenMobile } = useSidebar();
|
|
89
106
|
const location = useLocation();
|
|
90
107
|
const { t } = useObjectTranslation();
|
|
91
108
|
const { objectLabel: resolveNavObjectLabel, dashboardLabel: resolveNavDashboardLabel, navGroupLabel: resolveNavGroupLabel, viewLabel: resolveNavViewLabel } = useObjectLabel();
|
|
92
109
|
const { context, currentAppName } = useNavigationContext();
|
|
110
|
+
const { user } = useAuth();
|
|
111
|
+
const isWorkspaceAdmin = useIsWorkspaceAdmin();
|
|
93
112
|
// Swipe-from-left-edge gesture to open sidebar on mobile
|
|
94
113
|
React.useEffect(() => {
|
|
95
114
|
const EDGE_THRESHOLD = 30;
|
|
@@ -101,7 +120,8 @@ export function UnifiedSidebar({ activeAppName }) {
|
|
|
101
120
|
const handleTouchEnd = (e) => {
|
|
102
121
|
const deltaX = e.changedTouches[0].clientX - touchStartX;
|
|
103
122
|
if (touchStartX < EDGE_THRESHOLD && deltaX > SWIPE_DISTANCE && isMobile) {
|
|
104
|
-
|
|
123
|
+
// Idempotent direct open (ADR-0054 C1) — no synthetic click dispatch.
|
|
124
|
+
setOpenMobile(true);
|
|
105
125
|
}
|
|
106
126
|
};
|
|
107
127
|
document.addEventListener('touchstart', handleTouchStart, { passive: true });
|
|
@@ -110,13 +130,16 @@ export function UnifiedSidebar({ activeAppName }) {
|
|
|
110
130
|
document.removeEventListener('touchstart', handleTouchStart);
|
|
111
131
|
document.removeEventListener('touchend', handleTouchEnd);
|
|
112
132
|
};
|
|
113
|
-
}, [isMobile]);
|
|
133
|
+
}, [isMobile, setOpenMobile]);
|
|
114
134
|
const { recentItems } = useRecentItems();
|
|
115
135
|
const { favorites, removeFavorite } = useFavorites();
|
|
116
136
|
const { apps: metadataApps, objects: metadataObjects } = useMetadata();
|
|
117
137
|
const apps = metadataApps || [];
|
|
118
|
-
|
|
119
|
-
|
|
138
|
+
// Filter switcher to non-hidden apps; active-app lookup spans all so
|
|
139
|
+
// direct navigation to /apps/account still renders.
|
|
140
|
+
const activeApps = apps.filter((a) => a.active !== false && a.hidden !== true);
|
|
141
|
+
// ADR-0048 (A) — route segment may be a package id; match by it (name fallback).
|
|
142
|
+
const activeApp = matchAppBySegment(apps.filter((a) => a.active !== false), activeAppName || currentAppName) || activeApps[0];
|
|
120
143
|
// Drag-reorder and pin persistence
|
|
121
144
|
const { applyOrder, handleReorder } = useNavOrder(activeApp?.name || 'home');
|
|
122
145
|
const { togglePin, applyPins } = useNavPins();
|
|
@@ -134,17 +157,93 @@ export function UnifiedSidebar({ activeAppName }) {
|
|
|
134
157
|
// Resolve navigation items
|
|
135
158
|
const activeArea = areas.find((a) => a.id === activeAreaId);
|
|
136
159
|
const appNavigation = activeArea?.navigation || activeApp?.navigation || [];
|
|
137
|
-
//
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
160
|
+
// App-level context selectors (e.g. Studio's package scope). Their
|
|
161
|
+
// values are injected into nav items as `{<id>}` template vars so a
|
|
162
|
+
// single dropdown transparently scopes every secondary menu.
|
|
163
|
+
const { contextValues, element: contextSelectorsUI } = useAppContextSelectors(activeApp?.name || 'home', activeApp?.contextSelectors, t);
|
|
164
|
+
// Home navigation items. For workspace admins we surface the full system
|
|
165
|
+
// ("Administration") nav right here on /home — previously the home context
|
|
166
|
+
// showed ONLY a "Home" link, so a fresh env (no apps yet) rendered a bare
|
|
167
|
+
// centered page with the real menu nowhere in sight. Mirrors AppSidebar's
|
|
168
|
+
// `systemFallbackNavigation` (sans the deprecated manual "Create App").
|
|
169
|
+
// Non-admins get just Home — system administration is owner/admin-gated.
|
|
170
|
+
const homeNavigation = React.useMemo(() => {
|
|
171
|
+
const items = [
|
|
172
|
+
{ id: 'home-dashboard', label: t('home.nav', { defaultValue: 'Home' }), type: 'url', url: '/home', icon: 'home' },
|
|
173
|
+
// Package documentation portal (ADR-0046) — visible to all users, not
|
|
174
|
+
// just workspace admins, so it lives in the base items rather than the
|
|
175
|
+
// admin cluster below.
|
|
176
|
+
{ id: 'docs', label: t('layout.systemNav.documentation', { defaultValue: 'Documentation' }), type: 'url', url: '/docs', icon: 'book-open' },
|
|
177
|
+
];
|
|
178
|
+
if (isWorkspaceAdmin) {
|
|
179
|
+
const adminItems = [
|
|
180
|
+
{ id: 'sys-settings', label: t('layout.systemNav.systemSettings', { defaultValue: 'System Settings' }), type: 'url', url: '/apps/setup', icon: 'settings' },
|
|
181
|
+
{ id: 'sys-apps', label: t('layout.systemNav.applications', { defaultValue: 'Applications' }), type: 'url', url: '/apps/setup/system/apps', icon: 'layout-grid' },
|
|
182
|
+
{ id: 'sys-marketplace', label: t('layout.systemNav.appMarketplace', { defaultValue: 'App Marketplace' }), type: 'url', url: '/apps/setup/system/marketplace', icon: 'store' },
|
|
183
|
+
{ id: 'sys-objects', label: t('layout.systemNav.objectManager', { defaultValue: 'Object Manager' }), type: 'url', url: '/apps/setup/system/metadata/object', icon: 'database' },
|
|
184
|
+
{ id: 'sys-datasources', label: t('layout.systemNav.datasources', { defaultValue: 'Datasources' }), type: 'url', url: '/apps/setup/component/metadata/resource?type=datasource', icon: 'database' },
|
|
185
|
+
{ id: 'sys-users', label: t('layout.systemNav.users', { defaultValue: 'Users' }), type: 'url', url: '/apps/setup/system/users', icon: 'users' },
|
|
186
|
+
{ id: 'sys-orgs', label: t('layout.systemNav.organizations', { defaultValue: 'Organizations' }), type: 'url', url: '/apps/setup/system/organizations', icon: 'building-2' },
|
|
187
|
+
{ id: 'sys-roles', label: t('layout.systemNav.roles', { defaultValue: 'Roles' }), type: 'url', url: '/apps/setup/system/roles', icon: 'shield' },
|
|
188
|
+
{ id: 'sys-config', label: t('layout.systemNav.configuration', { defaultValue: 'Configuration' }), type: 'url', url: '/apps/setup/system/settings', icon: 'sliders-horizontal' },
|
|
189
|
+
];
|
|
190
|
+
items.push({
|
|
191
|
+
id: 'sys-administration',
|
|
192
|
+
label: t('layout.systemNav.administration', { defaultValue: 'Administration' }),
|
|
193
|
+
type: 'group',
|
|
194
|
+
icon: 'shield',
|
|
195
|
+
children: adminItems,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
return items;
|
|
199
|
+
}, [t, isWorkspaceAdmin]);
|
|
141
200
|
// Determine which navigation to show based on context
|
|
142
201
|
const navigationItems = context === 'home' ? homeNavigation : appNavigation;
|
|
202
|
+
const basePath = context === 'app' && activeApp ? `/apps/${appRouteSegment(activeApp)}` : '';
|
|
203
|
+
const isStudioApp = context === 'app' && activeApp?.name === 'studio';
|
|
204
|
+
const studioHomeSearch = React.useMemo(() => {
|
|
205
|
+
if (!isStudioApp)
|
|
206
|
+
return '';
|
|
207
|
+
const packageId = new URLSearchParams(location.search).get('package') || contextValues.active_package;
|
|
208
|
+
return packageId ? `?package=${encodeURIComponent(packageId)}` : '';
|
|
209
|
+
}, [contextValues.active_package, isStudioApp, location.search]);
|
|
210
|
+
const studioNavigationItems = React.useMemo(() => {
|
|
211
|
+
if (context !== 'app' || activeApp?.name !== 'studio')
|
|
212
|
+
return navigationItems;
|
|
213
|
+
const packageManagementLabel = t('sidebar.packageManagement', {
|
|
214
|
+
defaultValue: 'Package management',
|
|
215
|
+
});
|
|
216
|
+
const walk = (items) => items.flatMap((item) => {
|
|
217
|
+
if (isMetadataDirectoryItem(item))
|
|
218
|
+
return [];
|
|
219
|
+
const children = item.children?.length ? walk(item.children) : item.children;
|
|
220
|
+
if (item.type === 'group' && children?.length === 0)
|
|
221
|
+
return [];
|
|
222
|
+
if (isPackagesItem(item)) {
|
|
223
|
+
return [{
|
|
224
|
+
...item,
|
|
225
|
+
type: 'url',
|
|
226
|
+
label: packageManagementLabel,
|
|
227
|
+
url: `${basePath}/component/developer/packages${studioHomeSearch}`,
|
|
228
|
+
children,
|
|
229
|
+
}];
|
|
230
|
+
}
|
|
231
|
+
if (children !== item.children) {
|
|
232
|
+
return [{ ...item, children }];
|
|
233
|
+
}
|
|
234
|
+
return [item];
|
|
235
|
+
});
|
|
236
|
+
return walk(navigationItems).flatMap((item) => {
|
|
237
|
+
if (!isOverviewGroup(item))
|
|
238
|
+
return [item];
|
|
239
|
+
return item.children ?? [];
|
|
240
|
+
});
|
|
241
|
+
}, [activeApp?.name, basePath, context, navigationItems, studioHomeSearch, t]);
|
|
143
242
|
// Apply saved order and pin state
|
|
144
243
|
const processedNavigation = React.useMemo(() => {
|
|
145
|
-
const ordered = applyOrder(
|
|
244
|
+
const ordered = applyOrder(studioNavigationItems);
|
|
146
245
|
return applyPins(ordered);
|
|
147
|
-
}, [
|
|
246
|
+
}, [studioNavigationItems, applyOrder, applyPins]);
|
|
148
247
|
// Recent section collapsed by default
|
|
149
248
|
const [recentExpanded, setRecentExpanded] = React.useState(false);
|
|
150
249
|
// Visibility evaluation
|
|
@@ -170,14 +269,16 @@ export function UnifiedSidebar({ activeAppName }) {
|
|
|
170
269
|
}
|
|
171
270
|
return true;
|
|
172
271
|
}, [registeredObjectNames]);
|
|
173
|
-
const
|
|
174
|
-
return (_jsx(_Fragment, { children: _jsxs(Sidebar, { collapsible: "icon", className: "!top-14 !h-[calc(100svh-3.5rem)]", children: [isMobile && context === 'app' && (_jsx(SidebarHeader, { className: "border-b p-1.5", children: _jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, className: "h-
|
|
272
|
+
const isStudioHomeActive = isStudioApp && location.pathname.replace(/\/+$/, '') === basePath;
|
|
273
|
+
return (_jsx(_Fragment, { children: _jsxs(Sidebar, { collapsible: "icon", className: "!top-14 !h-[calc(100svh-3.5rem)]", children: [isMobile && context === 'app' && (_jsx(SidebarHeader, { className: "border-b p-1.5", children: _jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, className: "min-h-[44px] text-[15px] font-medium rounded-xl", children: _jsxs(Link, { to: "/home", onClick: () => setOpenMobile(false), "data-testid": "mobile-sidebar-home", children: [_jsx(Home, { className: "h-5 w-5" }), _jsx("span", { children: t('home.nav', { defaultValue: 'Home' }) })] }) }) }) }) })), _jsx(SidebarContent, { className: "pt-2", children: _jsx("div", { className: "transition-opacity duration-200 ease-in-out", children: context === 'app' && activeApp ? (_jsxs(_Fragment, { children: [contextSelectorsUI && (_jsx(SidebarGroup, { className: "group-data-[state=collapsed]:hidden px-2 pb-1", children: _jsx("div", { className: "rounded-lg border border-sidebar-border/70 bg-sidebar-accent/25 p-1.5 shadow-xs", children: _jsx(SidebarGroupContent, { children: contextSelectorsUI }) }) })), isStudioApp && (_jsx(SidebarGroup, { children: _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, isActive: isStudioHomeActive, tooltip: t('home.nav', { defaultValue: 'Home' }), children: _jsxs(Link, { to: { pathname: basePath, search: studioHomeSearch }, children: [_jsx(Home, { className: "h-4 w-4" }), _jsx("span", { children: t('home.nav', { defaultValue: 'Home' }) })] }) }) }) }) }) })), areas.length > 1 && (_jsxs(SidebarGroup, { children: [_jsxs(SidebarGroupLabel, { className: "flex items-center gap-1.5", children: [_jsx(Layers, { className: "h-3.5 w-3.5" }), t('sidebar.area', { defaultValue: 'Area' })] }), _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: areas.map((area) => {
|
|
175
274
|
const AreaIcon = getIcon(area.icon);
|
|
176
275
|
const isActiveArea = area.id === activeAreaId;
|
|
177
276
|
return (_jsx(SidebarMenuItem, { children: _jsxs(SidebarMenuButton, { isActive: isActiveArea, tooltip: area.label, onClick: () => setActiveAreaId(area.id), children: [_jsx(AreaIcon, { className: "h-4 w-4" }), _jsx("span", { children: area.label })] }) }, area.id));
|
|
178
|
-
}) }) })] })), _jsx(NavigationRenderer, { items: processedNavigation, basePath: basePath, evaluateVisibility: evalVis, checkPermission: checkPerm, checkCapability: checkCap, enablePinning: !isMobile, onPinToggle: togglePin, enableReorder: !isMobile, onReorder: handleReorder, resolveObjectLabel: (objectName, fallback) => resolveNavObjectLabel({ name: objectName, label: fallback }), resolveDashboardLabel: (dashboardName, fallback) => resolveNavDashboardLabel({ name: dashboardName, label: fallback }), resolveGroupLabel: activeApp ? (groupId, fallback) => resolveNavGroupLabel(activeApp.name, groupId, fallback) : undefined, resolveItemLabel: activeApp ? (itemId, fallback) =>
|
|
277
|
+
}) }) })] })), _jsx(NavigationRenderer, { items: processedNavigation, basePath: basePath, evaluateVisibility: evalVis, checkPermission: checkPerm, checkCapability: checkCap, enablePinning: !isMobile, onPinToggle: togglePin, enableReorder: !isMobile, onReorder: handleReorder, resolveObjectLabel: (objectName, fallback) => resolveNavObjectLabel({ name: objectName, label: fallback }), resolveDashboardLabel: (dashboardName, fallback) => resolveNavDashboardLabel({ name: dashboardName, label: fallback }), resolveGroupLabel: activeApp ? (groupId, fallback) => resolveNavGroupLabel(activeApp.name, groupId, fallback) : undefined, resolveItemLabel: activeApp ? (itemId, fallback) => (activeApp.name === 'studio' && fallback === t('sidebar.packageManagement', { defaultValue: 'Package management' })
|
|
278
|
+
? fallback
|
|
279
|
+
: resolveNavGroupLabel(activeApp.name, itemId, fallback)) : undefined, resolveViewLabel: (objectName, viewName, fallback) => resolveNavViewLabel(objectName, viewName, fallback), t: t, templateContext: { currentUserId: user?.id ?? null, contextValues } }), recentItems.length > 0 && (_jsxs(SidebarGroup, { children: [_jsxs(SidebarGroupLabel, { className: "flex items-center gap-1.5 cursor-pointer select-none", onClick: () => setRecentExpanded(prev => !prev), children: [_jsx(ChevronRight, { className: `h-3 w-3 transition-transform duration-150 ${recentExpanded ? 'rotate-90' : ''}` }), _jsx(Clock, { className: "h-3.5 w-3.5" }), t('sidebar.recent', { defaultValue: 'Recent' })] }), recentExpanded && (_jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: recentItems.slice(0, 5).map(item => (_jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, tooltip: item.label, children: _jsxs(Link, { to: item.href, children: [_jsx("span", { className: "text-muted-foreground", children: item.type === 'dashboard' ? '📊' : item.type === 'report' ? '📈' : '📄' }), _jsx("span", { className: "truncate", children: item.label })] }) }) }, item.id))) }) }))] })), favorites.some(f => f.type !== 'nav') && (_jsxs(SidebarGroup, { children: [_jsxs(SidebarGroupLabel, { className: "flex items-center gap-1.5", children: [_jsx(Star, { className: "h-3.5 w-3.5" }), t('sidebar.favorites', { defaultValue: 'Favorites' })] }), _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: favorites.filter(f => f.type !== 'nav').slice(0, 8).map(item => (_jsxs(SidebarMenuItem, { children: [_jsx(SidebarMenuButton, { asChild: true, tooltip: item.label, children: _jsxs(Link, { to: item.href, children: [_jsx("span", { className: "text-muted-foreground", children: item.type === 'dashboard' ? '📊' : item.type === 'report' ? '📈' : item.type === 'page' ? '📄' : '📋' }), _jsx("span", { className: "truncate", children: item.label })] }) }), _jsx(SidebarMenuAction, { showOnHover: true, onClick: (e) => { e.stopPropagation(); removeFavorite(item.id); }, "aria-label": t('sidebar.removeFromFavorites', { defaultValue: 'Remove {{name}} from favorites', name: item.label }), children: _jsx(StarOff, { className: "h-3 w-3" }) })] }, item.id))) }) })] }))] })) : (_jsxs(_Fragment, { children: [_jsx(SidebarGroup, { children: _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: homeNavigation.map((item) => {
|
|
179
280
|
const NavIcon = getIcon(item.icon);
|
|
180
281
|
const isActive = location.pathname === item.url;
|
|
181
282
|
return (_jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, tooltip: item.label, isActive: isActive, children: _jsxs(Link, { to: item.url || '/home', children: [_jsx(NavIcon, { className: "h-4 w-4" }), _jsx("span", { children: item.label })] }) }) }, item.id));
|
|
182
|
-
}) }) }) }), favorites.filter(f => f.type === 'object' || f.type === 'dashboard' || f.type === 'page').length > 0 && (_jsxs(SidebarGroup, { children: [_jsxs(SidebarGroupLabel, { className: "flex items-center gap-1.5", children: [_jsx(Star, { className: "h-3.5 w-3.5" }), t('sidebar.starred', { defaultValue: 'Starred' })] }), _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: favorites.filter(f => f.type === 'object' || f.type === 'dashboard' || f.type === 'page').slice(0, 8).map(item => (_jsxs(SidebarMenuItem, { children: [_jsx(SidebarMenuButton, { asChild: true, tooltip: item.label, children: _jsxs(Link, { to: item.href, children: [_jsx("span", { className: "text-muted-foreground", children: item.type === 'dashboard' ? '📊' : item.type === 'page' ? '📄' : '📋' }), _jsx("span", { className: "truncate", children: item.label })] }) }), _jsx(SidebarMenuAction, { showOnHover: true, onClick: (e) => { e.stopPropagation(); removeFavorite(item.id); }, "aria-label": t('sidebar.removeFromFavorites', { defaultValue: 'Remove {{name}} from favorites', name: item.label }), children: _jsx(StarOff, { className: "h-3 w-3" }) })] }, item.id))) }) })] }))] })) }) }), _jsx(SidebarFooter, { className: "border-t p-1", children: _jsx(
|
|
283
|
+
}) }) }) }), favorites.filter(f => f.type === 'object' || f.type === 'dashboard' || f.type === 'page').length > 0 && (_jsxs(SidebarGroup, { children: [_jsxs(SidebarGroupLabel, { className: "flex items-center gap-1.5", children: [_jsx(Star, { className: "h-3.5 w-3.5" }), t('sidebar.starred', { defaultValue: 'Starred' })] }), _jsx(SidebarGroupContent, { children: _jsx(SidebarMenu, { children: favorites.filter(f => f.type === 'object' || f.type === 'dashboard' || f.type === 'page').slice(0, 8).map(item => (_jsxs(SidebarMenuItem, { children: [_jsx(SidebarMenuButton, { asChild: true, tooltip: item.label, children: _jsxs(Link, { to: item.href, children: [_jsx("span", { className: "text-muted-foreground", children: item.type === 'dashboard' ? '📊' : item.type === 'page' ? '📄' : '📋' }), _jsx("span", { className: "truncate", children: item.label })] }) }), _jsx(SidebarMenuAction, { showOnHover: true, onClick: (e) => { e.stopPropagation(); removeFavorite(item.id); }, "aria-label": t('sidebar.removeFromFavorites', { defaultValue: 'Remove {{name}} from favorites', name: item.label }), children: _jsx(StarOff, { className: "h-3 w-3" }) })] }, item.id))) }) })] }))] })) }) }), _jsx(SidebarFooter, { className: "border-t p-1", children: _jsx(LocalizedSidebarTrigger, { className: "w-full justify-start pl-2 group-data-[state=collapsed]:justify-center group-data-[state=collapsed]:pl-0" }) })] }) }));
|
|
183
284
|
}
|