@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,113 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowDown, ArrowUp, Trash2, X } from 'lucide-react';
|
|
3
|
+
import { cn } from '@object-ui/components';
|
|
4
|
+
import { Badge, Button, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@object-ui/components';
|
|
5
|
+
export function InspectorShell({ kindLabel, title, onClose, closeLabel = 'Close', children, footer, headerActions, hideClose }) {
|
|
6
|
+
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsxs("div", { className: "flex items-start justify-between gap-2 border-b px-4 py-2.5", children: [_jsxs("div", { className: "min-w-0", children: [_jsx(Badge, { variant: "secondary", className: "text-[10px] uppercase tracking-wider", children: kindLabel }), _jsx("div", { className: "mt-1 truncate text-sm font-medium", title: title, children: title })] }), _jsxs("div", { className: "flex items-center gap-1 shrink-0", children: [headerActions, !hideClose && (_jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, "aria-label": closeLabel, className: "h-7 w-7 p-0", children: _jsx(X, { className: "h-4 w-4" }) }))] })] }), _jsx("div", { className: "flex-1 overflow-auto px-4 py-3 space-y-3", children: children }), footer && _jsx("div", { className: "border-t px-4 py-2.5", children: footer })] }));
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Compact ↑/↓ pair sized to fit alongside the close button in the
|
|
10
|
+
* inspector header. Auto-disables boundaries (↑ at index 0, ↓ at
|
|
11
|
+
* `total - 1`) and the whole pair when `total <= 1`.
|
|
12
|
+
*/
|
|
13
|
+
export function InspectorReorderButtons({ index, total, onMove, upLabel = 'Move up', downLabel = 'Move down', disabled, }) {
|
|
14
|
+
if (total <= 1 || index < 0)
|
|
15
|
+
return null;
|
|
16
|
+
const canUp = !disabled && index > 0;
|
|
17
|
+
const canDown = !disabled && index < total - 1;
|
|
18
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, { type: "button", variant: "ghost", size: "sm", className: "h-7 w-7 p-0", onClick: () => canUp && onMove(index - 1), disabled: !canUp, "aria-label": upLabel, title: upLabel, children: _jsx(ArrowUp, { className: "h-4 w-4" }) }), _jsx(Button, { type: "button", variant: "ghost", size: "sm", className: "h-7 w-7 p-0", onClick: () => canDown && onMove(index + 1), disabled: !canDown, "aria-label": downLabel, title: downLabel, children: _jsx(ArrowDown, { className: "h-4 w-4" }) })] }));
|
|
19
|
+
}
|
|
20
|
+
/* ─────────────── Form atoms ─────────────── */
|
|
21
|
+
export function InspectorTextField({ label, value, onCommit, onBlur, placeholder, disabled, mono, testId, }) {
|
|
22
|
+
return (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: label }), _jsx(Input, { value: value, onChange: (e) => onCommit(e.target.value), onBlur: (e) => onBlur?.(e.target.value), placeholder: placeholder, disabled: disabled, "data-testid": testId, className: cn('h-8 text-sm', mono && 'font-mono') })] }));
|
|
23
|
+
}
|
|
24
|
+
export function InspectorNumberField({ label, value, onCommit, placeholder, disabled, }) {
|
|
25
|
+
return (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: label }), _jsx(Input, { type: "number", value: value ?? '', onChange: (e) => {
|
|
26
|
+
const v = e.target.value;
|
|
27
|
+
onCommit(v === '' ? undefined : Number(v));
|
|
28
|
+
}, placeholder: placeholder, disabled: disabled, className: "h-8 text-sm" })] }));
|
|
29
|
+
}
|
|
30
|
+
export function InspectorSelectField({ label, value, options, onCommit, placeholder = '—', disabled, }) {
|
|
31
|
+
// Radix `<Select.Item>` forbids an empty-string value (it reserves ""
|
|
32
|
+
// for the cleared/placeholder state), yet callers legitimately use ""
|
|
33
|
+
// to mean "no value" (e.g. a "— None —" option). Bridge with an
|
|
34
|
+
// internal sentinel so the public contract (value="" ⇄ none) holds.
|
|
35
|
+
const toInner = (v) => (v === '' ? SELECT_NONE_SENTINEL : v);
|
|
36
|
+
const fromInner = (v) => (v === SELECT_NONE_SENTINEL ? '' : v);
|
|
37
|
+
return (_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs text-muted-foreground", children: label }), _jsxs(Select, { value: toInner(value ?? ''), onValueChange: (v) => onCommit(fromInner(v)), disabled: disabled, children: [_jsx(SelectTrigger, { className: "h-8 text-sm", children: _jsx(SelectValue, { placeholder: placeholder }) }), _jsx(SelectContent, { children: options.map((o) => (_jsx(SelectItem, { value: toInner(o.value), children: o.label }, o.value))) })] })] }));
|
|
38
|
+
}
|
|
39
|
+
const SELECT_NONE_SENTINEL = '__inspector_select_none__';
|
|
40
|
+
export function InspectorCheckboxField({ label, value, onCommit, disabled, }) {
|
|
41
|
+
return (_jsxs("label", { className: "flex items-center gap-2 text-xs cursor-pointer select-none", children: [_jsx("input", { type: "checkbox", checked: value, disabled: disabled, onChange: (e) => onCommit(e.target.checked), className: "h-3.5 w-3.5" }), _jsx("span", { children: label })] }));
|
|
42
|
+
}
|
|
43
|
+
export function InspectorRemoveButton({ label, onClick, disabled }) {
|
|
44
|
+
// Calm by default (muted outline), escalating to destructive-red only on
|
|
45
|
+
// hover — a full-width solid-red bar reads as alarming for what is a routine
|
|
46
|
+
// "remove this element" footer action. The trash icon keeps intent clear.
|
|
47
|
+
return (_jsxs(Button, { variant: "outline", size: "sm", onClick: onClick, disabled: disabled, className: "w-full gap-1.5 text-muted-foreground hover:border-destructive/40 hover:bg-destructive/5 hover:text-destructive", children: [_jsx(Trash2, { className: "h-3.5 w-3.5" }), label] }));
|
|
48
|
+
}
|
|
49
|
+
export function InspectorEmptyState({ message }) {
|
|
50
|
+
return _jsx("div", { className: "text-xs italic text-muted-foreground p-4 text-center", children: message });
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Helper to immutably splice an item in an array on a draft.
|
|
54
|
+
* Returns a new array; never mutates input.
|
|
55
|
+
*/
|
|
56
|
+
export function spliceArray(arr, index, replacement) {
|
|
57
|
+
const a = Array.isArray(arr) ? [...arr] : [];
|
|
58
|
+
if (replacement === null)
|
|
59
|
+
a.splice(index, 1);
|
|
60
|
+
else
|
|
61
|
+
a[index] = replacement;
|
|
62
|
+
return a;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Insert `item` at `index` immutably. Index out of range clamps to
|
|
66
|
+
* [0, length]. Returns a new array; never mutates input.
|
|
67
|
+
*/
|
|
68
|
+
export function insertArray(arr, index, item) {
|
|
69
|
+
const a = Array.isArray(arr) ? [...arr] : [];
|
|
70
|
+
const i = Math.max(0, Math.min(a.length, index));
|
|
71
|
+
a.splice(i, 0, item);
|
|
72
|
+
return a;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Append `item` to the end immutably. Convenience wrapper over
|
|
76
|
+
* insertArray for the common "+ Add at end" case.
|
|
77
|
+
*/
|
|
78
|
+
export function appendArray(arr, item) {
|
|
79
|
+
const a = Array.isArray(arr) ? [...arr] : [];
|
|
80
|
+
a.push(item);
|
|
81
|
+
return a;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Move an item from `from` to `to` immutably. Out-of-range or no-op
|
|
85
|
+
* moves return a new copy unchanged. Useful for ↑/↓ reorder buttons.
|
|
86
|
+
*/
|
|
87
|
+
export function moveArray(arr, from, to) {
|
|
88
|
+
const a = Array.isArray(arr) ? [...arr] : [];
|
|
89
|
+
if (from < 0 || from >= a.length)
|
|
90
|
+
return a;
|
|
91
|
+
const clampedTo = Math.max(0, Math.min(a.length - 1, to));
|
|
92
|
+
if (clampedTo === from)
|
|
93
|
+
return a;
|
|
94
|
+
const [item] = a.splice(from, 1);
|
|
95
|
+
a.splice(clampedTo, 0, item);
|
|
96
|
+
return a;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Generate a snake_case id that doesn't collide with `existing`. Used
|
|
100
|
+
* by Add helpers that need a stable identifier (Flow nodes, App nav,
|
|
101
|
+
* Dashboard widgets) before the user fills in a meaningful name.
|
|
102
|
+
*
|
|
103
|
+
* uniqueId('node', ['node_1', 'node_3']) -> 'node_2'
|
|
104
|
+
*/
|
|
105
|
+
export function uniqueId(prefix, existing) {
|
|
106
|
+
const taken = new Set(existing.filter((x) => typeof x === 'string'));
|
|
107
|
+
for (let i = 1; i < 10000; i++) {
|
|
108
|
+
const candidate = `${prefix}_${i}`;
|
|
109
|
+
if (!taken.has(candidate))
|
|
110
|
+
return candidate;
|
|
111
|
+
}
|
|
112
|
+
return `${prefix}_${Date.now()}`;
|
|
113
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface BuilderCondition {
|
|
2
|
+
id?: string;
|
|
3
|
+
field: string;
|
|
4
|
+
operator: string;
|
|
5
|
+
value?: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface BuilderGroup {
|
|
8
|
+
id?: string;
|
|
9
|
+
logic: 'and' | 'or';
|
|
10
|
+
conditions: BuilderCondition[];
|
|
11
|
+
}
|
|
12
|
+
export type FilterCondition = Record<string, any>;
|
|
13
|
+
/** Serialize the visual group → a spec FilterCondition (flat `$and`). */
|
|
14
|
+
export declare function groupToCondition(group: BuilderGroup | undefined): FilterCondition | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Parse a stored FilterCondition → the visual group. `representable: false` when
|
|
17
|
+
* the condition uses shapes the flat builder can't faithfully edit (nested
|
|
18
|
+
* `$and`/`$or`, multi-op objects, unmapped operators) — callers should then show
|
|
19
|
+
* the source editor instead.
|
|
20
|
+
*/
|
|
21
|
+
export declare function conditionToGroup(cond: FilterCondition | undefined | null): {
|
|
22
|
+
group: BuilderGroup;
|
|
23
|
+
representable: boolean;
|
|
24
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
|
|
2
|
+
/**
|
|
3
|
+
* Bridge between the visual {@link FilterBuilder} (a flat `FilterGroup` of
|
|
4
|
+
* `{field, operator, value}` rows, camelCase operators) and the spec
|
|
5
|
+
* `FilterCondition` (Mongo-style `{ field: { $op: value } }`, conjoined with
|
|
6
|
+
* `$and`) stored on `dataset.filter` / `measure.filter`.
|
|
7
|
+
*
|
|
8
|
+
* Scope (deliberate): the visual editor supports the common case — a flat AND
|
|
9
|
+
* of simple `field op value` conditions. Anything it can't faithfully round-trip
|
|
10
|
+
* (nested groups, `$or`, multi-operator objects, unmapped operators) is reported
|
|
11
|
+
* as NOT representable so the caller can fall back to the source editor instead
|
|
12
|
+
* of silently corrupting the author's filter.
|
|
13
|
+
*/
|
|
14
|
+
/** FilterBuilder camelCase operator → FilterCondition Mongo operator. */
|
|
15
|
+
const OP_TO_MONGO = {
|
|
16
|
+
equals: '$eq', notEquals: '$ne',
|
|
17
|
+
greaterThan: '$gt', greaterOrEqual: '$gte', lessThan: '$lt', lessOrEqual: '$lte',
|
|
18
|
+
after: '$gt', before: '$lt',
|
|
19
|
+
contains: '$contains', in: '$in', notIn: '$nin',
|
|
20
|
+
};
|
|
21
|
+
const MONGO_TO_OP = {
|
|
22
|
+
$eq: 'equals', $ne: 'notEquals',
|
|
23
|
+
$gt: 'greaterThan', $gte: 'greaterOrEqual', $lt: 'lessThan', $lte: 'lessOrEqual',
|
|
24
|
+
$contains: 'contains', $in: 'in', $nin: 'notIn',
|
|
25
|
+
};
|
|
26
|
+
/** Serialize the visual group → a spec FilterCondition (flat `$and`). */
|
|
27
|
+
export function groupToCondition(group) {
|
|
28
|
+
const conds = (group?.conditions ?? []).filter((c) => c && c.field);
|
|
29
|
+
const parts = [];
|
|
30
|
+
for (const c of conds) {
|
|
31
|
+
if (c.operator === 'isEmpty') {
|
|
32
|
+
parts.push({ [c.field]: { $exists: false } });
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (c.operator === 'isNotEmpty') {
|
|
36
|
+
parts.push({ [c.field]: { $exists: true } });
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const mop = OP_TO_MONGO[c.operator];
|
|
40
|
+
if (!mop)
|
|
41
|
+
continue; // unmapped (e.g. notContains/between) — drop rather than emit a bad filter
|
|
42
|
+
parts.push({ [c.field]: { [mop]: c.value } });
|
|
43
|
+
}
|
|
44
|
+
if (parts.length === 0)
|
|
45
|
+
return undefined;
|
|
46
|
+
if (parts.length === 1)
|
|
47
|
+
return parts[0];
|
|
48
|
+
return { $and: parts };
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Parse a stored FilterCondition → the visual group. `representable: false` when
|
|
52
|
+
* the condition uses shapes the flat builder can't faithfully edit (nested
|
|
53
|
+
* `$and`/`$or`, multi-op objects, unmapped operators) — callers should then show
|
|
54
|
+
* the source editor instead.
|
|
55
|
+
*/
|
|
56
|
+
export function conditionToGroup(cond) {
|
|
57
|
+
const empty = { id: 'g', logic: 'and', conditions: [] };
|
|
58
|
+
if (cond == null)
|
|
59
|
+
return { group: empty, representable: true };
|
|
60
|
+
if (typeof cond !== 'object' || Array.isArray(cond))
|
|
61
|
+
return { group: empty, representable: false };
|
|
62
|
+
if ('$or' in cond)
|
|
63
|
+
return { group: empty, representable: false };
|
|
64
|
+
const list = Array.isArray(cond.$and) ? cond.$and : [cond];
|
|
65
|
+
const conditions = [];
|
|
66
|
+
for (let i = 0; i < list.length; i++) {
|
|
67
|
+
const c = list[i];
|
|
68
|
+
if (!c || typeof c !== 'object' || Array.isArray(c))
|
|
69
|
+
return { group: empty, representable: false };
|
|
70
|
+
if ('$and' in c || '$or' in c)
|
|
71
|
+
return { group: empty, representable: false };
|
|
72
|
+
const keys = Object.keys(c);
|
|
73
|
+
if (keys.length !== 1)
|
|
74
|
+
return { group: empty, representable: false };
|
|
75
|
+
const field = keys[0];
|
|
76
|
+
const v = c[field];
|
|
77
|
+
if (v && typeof v === 'object' && !Array.isArray(v)) {
|
|
78
|
+
const opKeys = Object.keys(v);
|
|
79
|
+
if (opKeys.length !== 1)
|
|
80
|
+
return { group: empty, representable: false };
|
|
81
|
+
const mop = opKeys[0];
|
|
82
|
+
if (mop === '$exists') {
|
|
83
|
+
conditions.push({ id: `c${i}`, field, operator: v.$exists ? 'isNotEmpty' : 'isEmpty', value: '' });
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
const op = MONGO_TO_OP[mop];
|
|
87
|
+
if (!op)
|
|
88
|
+
return { group: empty, representable: false };
|
|
89
|
+
conditions.push({ id: `c${i}`, field, operator: op, value: v[mop] });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
conditions.push({ id: `c${i}`, field, operator: 'equals', value: v }); // implicit equality
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return { group: { id: 'g', logic: 'and', conditions }, representable: true };
|
|
97
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Author-time expression validation for the metadata inspectors (ADR-0032).
|
|
3
|
+
*
|
|
4
|
+
* The GUI is a first-class author surface, so the same rule the build and the
|
|
5
|
+
* `validate_expression` agent tool enforce must surface *here, as you type* —
|
|
6
|
+
* not only on save/build. The #1 mistake (human or AI) is wrapping a field
|
|
7
|
+
* reference in single `{…}` braces inside a CEL condition: `{x}` parses as a
|
|
8
|
+
* CEL map literal and silently fails (issue #1491). We catch that and a couple
|
|
9
|
+
* of other obvious shape errors, with the **same corrective message** the
|
|
10
|
+
* server-side validator emits.
|
|
11
|
+
*
|
|
12
|
+
* NOTE: this is an intentionally small client-side check (no CEL parser in the
|
|
13
|
+
* browser). Once `@objectstack/formula` is published, swap the body of
|
|
14
|
+
* {@link validateExpressionClient} for a call to its shared `validateExpression`
|
|
15
|
+
* so the GUI, SDK, and CLI share one validator verbatim.
|
|
16
|
+
*/
|
|
17
|
+
export type ExprFieldRole = 'predicate' | 'value' | 'template';
|
|
18
|
+
export interface ExprClientIssue {
|
|
19
|
+
/** Self-correcting message: what is wrong + the correct form. */
|
|
20
|
+
message: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Validate one expression for a field role. Returns `null` when clean, or an
|
|
24
|
+
* issue with a corrective message. Empty/absent input is always clean.
|
|
25
|
+
*/
|
|
26
|
+
export declare function validateExpressionClient(role: ExprFieldRole, raw: unknown): ExprClientIssue | null;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
|
|
2
|
+
/** A bare `{x}` that is NOT part of a `{{x}}` mustache hole. */
|
|
3
|
+
const SINGLE_BRACE_RE = /(?:^|[^{])\{\s*([A-Za-z_$][\w.$]*)\s*\}(?!\})/;
|
|
4
|
+
function balanced(src, open, close) {
|
|
5
|
+
let depth = 0;
|
|
6
|
+
for (const ch of src) {
|
|
7
|
+
if (ch === open)
|
|
8
|
+
depth++;
|
|
9
|
+
else if (ch === close) {
|
|
10
|
+
depth--;
|
|
11
|
+
if (depth < 0)
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return depth === 0;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Validate one expression for a field role. Returns `null` when clean, or an
|
|
19
|
+
* issue with a corrective message. Empty/absent input is always clean.
|
|
20
|
+
*/
|
|
21
|
+
export function validateExpressionClient(role, raw) {
|
|
22
|
+
// Accept a bare string or an Expression envelope ({ dialect, source }).
|
|
23
|
+
let source = '';
|
|
24
|
+
let dialect;
|
|
25
|
+
if (typeof raw === 'string')
|
|
26
|
+
source = raw;
|
|
27
|
+
else if (raw && typeof raw === 'object') {
|
|
28
|
+
const env = raw;
|
|
29
|
+
dialect = env.dialect;
|
|
30
|
+
source = env.source ?? '';
|
|
31
|
+
}
|
|
32
|
+
if (!source.trim())
|
|
33
|
+
return null;
|
|
34
|
+
if (role === 'template') {
|
|
35
|
+
if (dialect && dialect !== 'template') {
|
|
36
|
+
return { message: `Expected a text template but got a \`${dialect}\` expression.` };
|
|
37
|
+
}
|
|
38
|
+
if (!balanced(source.replace(/\{\{/g, '').replace(/\}\}/g, ''), '{', '}')) {
|
|
39
|
+
// crude: only flag obviously single-brace mustache misuse below
|
|
40
|
+
}
|
|
41
|
+
const m = SINGLE_BRACE_RE.exec(source);
|
|
42
|
+
if (m) {
|
|
43
|
+
return { message: `Single-brace \`{${m[1]}}\` is not a valid template hole — use double braces: \`{{ ${m[1]} }}\`.` };
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
// predicate | value → CEL
|
|
48
|
+
if (dialect && dialect !== 'cel') {
|
|
49
|
+
return { message: `Expected a CEL expression but got a \`${dialect}\` dialect.` };
|
|
50
|
+
}
|
|
51
|
+
const m = SINGLE_BRACE_RE.exec(source);
|
|
52
|
+
if (m) {
|
|
53
|
+
return {
|
|
54
|
+
message: `It looks like a \`{${m[1]}}\` template brace was used inside a condition — ` +
|
|
55
|
+
`\`{…}\` parses as a CEL map literal and fails. Write the bare reference instead, e.g. \`${m[1]}\`. ` +
|
|
56
|
+
`Conditions are bare CEL (e.g. \`record.rating >= 4\`).`,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (!balanced(source, '(', ')')) {
|
|
60
|
+
return { message: `Unbalanced parentheses in \`${source}\`.` };
|
|
61
|
+
}
|
|
62
|
+
if (!balanced(source, '[', ']')) {
|
|
63
|
+
return { message: `Unbalanced brackets in \`${source}\`.` };
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* flow-node-config — declarative, spec-precise config-field schema per flow
|
|
3
|
+
* node type.
|
|
4
|
+
*
|
|
5
|
+
* Node types and the structured config blocks below mirror the authoritative
|
|
6
|
+
* `@objectstack/spec` FlowNode schema (automation/flow.zod.ts): the type enum
|
|
7
|
+
* is the spec's `FlowNodeAction`, and spec-schematized blocks — `waitEventConfig`
|
|
8
|
+
* (wait), `connectorConfig` (connector_action), `boundaryConfig`
|
|
9
|
+
* (boundary_event) and the node-level `timeoutMs` — are edited as precise form
|
|
10
|
+
* fields rather than free JSON.
|
|
11
|
+
*
|
|
12
|
+
* Each field declares a `path` into the node object. Most CRUD/script/http
|
|
13
|
+
* fields live under `['config', key]` (the spec's freeform, type-specific
|
|
14
|
+
* config record); spec-structured blocks live at the node top level, e.g.
|
|
15
|
+
* `['waitEventConfig', 'eventType']`. Only fields whose path is rooted at
|
|
16
|
+
* `config` "own" a config key — any *other* config keys remain editable in the
|
|
17
|
+
* optional Advanced block so authors are never locked out.
|
|
18
|
+
*
|
|
19
|
+
* Field kinds: scalar (text / expression / number / boolean / select),
|
|
20
|
+
* `textarea` (script code, request body) and `keyValue` for flat object maps
|
|
21
|
+
* (e.g. record field values, connector input). Deeply nested / array values
|
|
22
|
+
* still fall back to the optional Advanced block.
|
|
23
|
+
*/
|
|
24
|
+
export type FlowConfigFieldKind = 'text' | 'expression' | 'number' | 'boolean' | 'select' | 'textarea' | 'keyValue' | 'stringList' | 'objectList' | 'reference';
|
|
25
|
+
/**
|
|
26
|
+
* What a `reference` field points at — the picker's data source. The control
|
|
27
|
+
* is always an *editable* combobox (suggestions + free text), so an unknown /
|
|
28
|
+
* not-yet-created value is never rejected and an empty catalog degrades to a
|
|
29
|
+
* plain text box.
|
|
30
|
+
*
|
|
31
|
+
* • `object` → a business object, by API name (`client.list('object')`)
|
|
32
|
+
* • `object-field` → a field of some object; the object is resolved via
|
|
33
|
+
* {@link FlowReferenceSpec.objectSource}
|
|
34
|
+
* • `flow` → a flow, by name (`client.list('flow')`)
|
|
35
|
+
* • `role` → a security role (`client.list('role')`)
|
|
36
|
+
* • `node` → another node in *this* flow, by id (read from the draft)
|
|
37
|
+
* • `user` / `team` / `queue` / `department` → the matching metadata list
|
|
38
|
+
* (`client.list(kind)`); empty in dev, populated per tenant
|
|
39
|
+
* • `connector` → an installed connector (`client.list('connector')`)
|
|
40
|
+
* • `email-template`→ an email template (`client.list('email_template')`)
|
|
41
|
+
*
|
|
42
|
+
* Kinds that have no catalog in the current tenant simply degrade to a plain
|
|
43
|
+
* text box — the control is always an editable combobox, never a hard dropdown.
|
|
44
|
+
*/
|
|
45
|
+
export type ReferenceKind = 'object' | 'object-field' | 'flow' | 'role' | 'node' | 'user' | 'team' | 'queue' | 'department' | 'connector' | 'email-template';
|
|
46
|
+
export interface FlowReferenceSpec {
|
|
47
|
+
/**
|
|
48
|
+
* Concrete reference kind. Omit when the kind is *polymorphic* — chosen at
|
|
49
|
+
* render time from a sibling value (see {@link kindFrom}).
|
|
50
|
+
*/
|
|
51
|
+
kind?: ReferenceKind;
|
|
52
|
+
/**
|
|
53
|
+
* For `object-field` only: where to find the target object's name.
|
|
54
|
+
* • `'$trigger'` (default) → the flow trigger object, read from the start
|
|
55
|
+
* node's `config.objectName` (the record an approval / record node acts on).
|
|
56
|
+
* • any other string → a sibling config key on the *same* node holding
|
|
57
|
+
* the object name (e.g. CRUD nodes resolve from their own `objectName`).
|
|
58
|
+
*/
|
|
59
|
+
objectSource?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Polymorphic reference: the kind is selected at render time by the value of
|
|
62
|
+
* a sibling field/column named `kindFrom`, looked up in {@link map}. A value
|
|
63
|
+
* with no mapping (or an empty sibling) falls back to free text. Used by the
|
|
64
|
+
* approval node's `approvers[].value` (kind follows the row's `type`) and the
|
|
65
|
+
* script node's `template` (follows `actionType`).
|
|
66
|
+
*/
|
|
67
|
+
kindFrom?: string;
|
|
68
|
+
map?: Record<string, ReferenceKind>;
|
|
69
|
+
}
|
|
70
|
+
/** Column descriptor for an `objectList` repeater row. */
|
|
71
|
+
export interface FlowConfigColumn {
|
|
72
|
+
key: string;
|
|
73
|
+
label: string;
|
|
74
|
+
kind: 'text' | 'expression' | 'boolean' | 'select' | 'reference';
|
|
75
|
+
placeholder?: string;
|
|
76
|
+
options?: Array<{
|
|
77
|
+
value: string;
|
|
78
|
+
label: string;
|
|
79
|
+
}>;
|
|
80
|
+
/** For `kind: 'reference'` — the picker data source (may be polymorphic). */
|
|
81
|
+
ref?: FlowReferenceSpec;
|
|
82
|
+
}
|
|
83
|
+
export interface FlowConfigField {
|
|
84
|
+
/**
|
|
85
|
+
* Stable field identity — used as the React key and as the `showWhen.field`
|
|
86
|
+
* reference. Distinct from the storage path so nested-path fields stay
|
|
87
|
+
* unambiguous (e.g. `wait.timerDuration`).
|
|
88
|
+
*/
|
|
89
|
+
id: string;
|
|
90
|
+
/**
|
|
91
|
+
* Location of this value on the node object. `['config', 'objectName']`
|
|
92
|
+
* writes `node.config.objectName`; `['waitEventConfig', 'eventType']` writes
|
|
93
|
+
* the spec's top-level `node.waitEventConfig.eventType`.
|
|
94
|
+
*/
|
|
95
|
+
path: string[];
|
|
96
|
+
/** Human-readable field label (English — repo is English-only). */
|
|
97
|
+
label: string;
|
|
98
|
+
kind: FlowConfigFieldKind;
|
|
99
|
+
placeholder?: string;
|
|
100
|
+
/** Options for `select` fields. */
|
|
101
|
+
options?: Array<{
|
|
102
|
+
value: string;
|
|
103
|
+
label: string;
|
|
104
|
+
}>;
|
|
105
|
+
/** One-line helper hint shown under the control. */
|
|
106
|
+
help?: string;
|
|
107
|
+
/** Spec default, used when resolving `showWhen` against an unset controller. */
|
|
108
|
+
defaultValue?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Conditional visibility: only render this field when the controlling field
|
|
111
|
+
* (referenced by its `id`) currently resolves to one of `equals`. A field is
|
|
112
|
+
* always shown if it already holds a stored value, so existing config is
|
|
113
|
+
* never hidden.
|
|
114
|
+
*/
|
|
115
|
+
showWhen?: {
|
|
116
|
+
field: string;
|
|
117
|
+
equals: string[];
|
|
118
|
+
};
|
|
119
|
+
/** Column schema for `objectList` fields (array-of-objects repeater). */
|
|
120
|
+
columns?: FlowConfigColumn[];
|
|
121
|
+
/** Reference target for `reference` fields — drives the combobox data source. */
|
|
122
|
+
ref?: FlowReferenceSpec;
|
|
123
|
+
}
|
|
124
|
+
/** Resolve the config fields for a node type (alias-aware). */
|
|
125
|
+
export declare function fieldsForNodeType(type?: string): FlowConfigField[];
|
|
126
|
+
/** Read the current value at a field's node path. */
|
|
127
|
+
export declare function getFieldValue(node: Record<string, unknown> | null | undefined, field: FlowConfigField): unknown;
|
|
128
|
+
/**
|
|
129
|
+
* The `config` key this field owns, or `undefined` for fields stored outside
|
|
130
|
+
* `config` (spec-structured blocks, top-level `timeoutMs`). Used by the
|
|
131
|
+
* inspector to compute "extra" config keys for the optional Advanced block —
|
|
132
|
+
* only config-rooted fields suppress an Advanced key.
|
|
133
|
+
*/
|
|
134
|
+
export declare function configKeyOf(field: FlowConfigField): string | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* Whether a field should render. Conditional fields show when their controller
|
|
137
|
+
* (by `id`) resolves — via stored value, else spec `defaultValue` — to one of
|
|
138
|
+
* `equals`, OR when the field already holds a stored value (so existing config
|
|
139
|
+
* is never hidden).
|
|
140
|
+
*/
|
|
141
|
+
export declare function isFieldVisible(field: FlowConfigField, node: Record<string, unknown> | null | undefined, fields: FlowConfigField[]): boolean;
|
|
142
|
+
/** Node types offered in the inspector's type picker (spec `FlowNodeAction`). */
|
|
143
|
+
export declare const FLOW_NODE_TYPE_OPTIONS: readonly ["start", "create_record", "update_record", "delete_record", "get_record", "decision", "assignment", "loop", "http_request", "script", "screen", "approval", "wait", "subflow", "map", "connector_action", "parallel", "try_catch", "end"];
|