@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,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* flow-canvas-layout — pure, dependency-free geometry + graph helpers for
|
|
3
|
+
* the visual flow designer canvas (`FlowCanvas.tsx`).
|
|
4
|
+
*
|
|
5
|
+
* Kept separate from the React component so the layout math stays easy to
|
|
6
|
+
* reason about (and unit-test) without pulling in any rendering concerns.
|
|
7
|
+
*
|
|
8
|
+
* Coordinate system: top-to-bottom flowchart (mirrors Power Automate /
|
|
9
|
+
* Salesforce Flow Builder). Origin is the top-left of the diagram bounding
|
|
10
|
+
* box after normalization, so every node sits at x >= PADDING, y >= PADDING.
|
|
11
|
+
*/
|
|
12
|
+
export interface FlowNodeUI {
|
|
13
|
+
x?: number;
|
|
14
|
+
y?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface FlowNode {
|
|
17
|
+
id: string;
|
|
18
|
+
type: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
config?: Record<string, unknown>;
|
|
21
|
+
/** UI-only layout hint persisted via onPatch; ignored by the runtime. */
|
|
22
|
+
ui?: FlowNodeUI;
|
|
23
|
+
[k: string]: unknown;
|
|
24
|
+
}
|
|
25
|
+
export interface FlowEdge {
|
|
26
|
+
id?: string;
|
|
27
|
+
source: string;
|
|
28
|
+
target: string;
|
|
29
|
+
condition?: string | {
|
|
30
|
+
source?: string;
|
|
31
|
+
};
|
|
32
|
+
type?: string;
|
|
33
|
+
label?: string;
|
|
34
|
+
isDefault?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface Point {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
}
|
|
40
|
+
export declare const NODE_W = 240;
|
|
41
|
+
export declare const NODE_H = 66;
|
|
42
|
+
export declare const H_GAP = 44;
|
|
43
|
+
export declare const V_GAP = 56;
|
|
44
|
+
export declare const PADDING = 28;
|
|
45
|
+
/** A node carries a persisted manual position when both x and y are finite. */
|
|
46
|
+
export declare function hasManualPosition(node: FlowNode): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Compute a deterministic layered (top-to-bottom) layout.
|
|
49
|
+
*
|
|
50
|
+
* - Edges with a dangling endpoint are ignored for layering.
|
|
51
|
+
* - Layer assignment is a cycle-guarded longest-path relaxation: a node sits
|
|
52
|
+
* one layer below its deepest predecessor. Roots (the `start` node, else
|
|
53
|
+
* nodes with no incoming edge, else the first node) seed layer 0.
|
|
54
|
+
* - Nodes never reached from a root are dropped into a trailing layer so the
|
|
55
|
+
* author still sees them.
|
|
56
|
+
* - Within a layer, nodes keep their original `nodes[]` order (stable).
|
|
57
|
+
* - A node with a persisted `ui` position overrides its computed slot, but is
|
|
58
|
+
* still included in the returned map so callers can size the canvas.
|
|
59
|
+
*/
|
|
60
|
+
export declare function computeLayout(nodes: FlowNode[], edges: FlowEdge[]): Map<string, Point>;
|
|
61
|
+
/** Bounding box of the laid-out diagram, including node extents + padding. */
|
|
62
|
+
export declare function diagramSize(positions: Map<string, Point>): {
|
|
63
|
+
width: number;
|
|
64
|
+
height: number;
|
|
65
|
+
};
|
|
66
|
+
/** Bottom-center anchor of a node — where its outgoing edges originate. */
|
|
67
|
+
export declare function bottomAnchor(p: Point): Point;
|
|
68
|
+
/** Top-center anchor of a node — where its incoming edges terminate. */
|
|
69
|
+
export declare function topAnchor(p: Point): Point;
|
|
70
|
+
/**
|
|
71
|
+
* Smooth vertical cubic-bezier path between two anchors. Control points are
|
|
72
|
+
* pulled along the vertical axis so the curve reads as a top-down flow even
|
|
73
|
+
* when the target sits above or beside the source.
|
|
74
|
+
*/
|
|
75
|
+
export declare function edgePath(from: Point, to: Point): string;
|
|
76
|
+
/** Midpoint of an edge — anchor for the condition label + insert affordance. */
|
|
77
|
+
export declare function edgeMidpoint(from: Point, to: Point): Point;
|
|
78
|
+
/** True for an ADR-0044 declared back-edge (a revise/rework loop's return). */
|
|
79
|
+
export declare function isBackEdge(edge: Pick<FlowEdge, 'type'>): boolean;
|
|
80
|
+
/** Right-center anchor of a node — where a back-edge's return arc attaches. */
|
|
81
|
+
export declare function rightAnchor(p: Point): Point;
|
|
82
|
+
/**
|
|
83
|
+
* Curved return path for a declared back-edge (ADR-0044 revise loop). Unlike a
|
|
84
|
+
* forward edge (top→bottom), a back-edge re-enters an earlier node, so we route
|
|
85
|
+
* it off the right side of both endpoints and bow it out to the right — a
|
|
86
|
+
* distinct return arc that reads as "loop back" rather than crossing the
|
|
87
|
+
* top-to-bottom forward edges.
|
|
88
|
+
*/
|
|
89
|
+
export declare function backEdgePath(from: Point, to: Point): string;
|
|
90
|
+
/** Anchor for a back-edge's label pill — the apex of its return arc. */
|
|
91
|
+
export declare function backEdgeLabelAnchor(from: Point, to: Point): Point;
|
|
92
|
+
/**
|
|
93
|
+
* Stable identity for an edge. Prefers an explicit `edge.id`; otherwise falls
|
|
94
|
+
* back to a `source->target#index` composite so an unsaved edge still has a
|
|
95
|
+
* deterministic key. Used for selection, traversal highlighting, and inspector
|
|
96
|
+
* lookup — all of which read the same `draft.edges` array, so the index is
|
|
97
|
+
* consistent across them. Editing label/condition/isDefault never changes the
|
|
98
|
+
* key (source/target/index are untouched), so a selection survives edits.
|
|
99
|
+
*/
|
|
100
|
+
export declare function edgeKey(edge: FlowEdge, index: number): string;
|
|
101
|
+
/** Human-readable condition text for an edge's optional guard. */
|
|
102
|
+
export declare function conditionText(c: FlowEdge['condition']): string | undefined;
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
|
|
2
|
+
// Node card + spacing geometry. Written as plain numbers so both the layout
|
|
3
|
+
// pass and the SVG edge router share one source of truth.
|
|
4
|
+
export const NODE_W = 240;
|
|
5
|
+
export const NODE_H = 66;
|
|
6
|
+
export const H_GAP = 44;
|
|
7
|
+
export const V_GAP = 56;
|
|
8
|
+
export const PADDING = 28;
|
|
9
|
+
/** True when a value is a usable, finite coordinate. */
|
|
10
|
+
function isFiniteNum(v) {
|
|
11
|
+
return typeof v === 'number' && Number.isFinite(v);
|
|
12
|
+
}
|
|
13
|
+
/** A node carries a persisted manual position when both x and y are finite. */
|
|
14
|
+
export function hasManualPosition(node) {
|
|
15
|
+
return isFiniteNum(node.ui?.x) && isFiniteNum(node.ui?.y);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Compute a deterministic layered (top-to-bottom) layout.
|
|
19
|
+
*
|
|
20
|
+
* - Edges with a dangling endpoint are ignored for layering.
|
|
21
|
+
* - Layer assignment is a cycle-guarded longest-path relaxation: a node sits
|
|
22
|
+
* one layer below its deepest predecessor. Roots (the `start` node, else
|
|
23
|
+
* nodes with no incoming edge, else the first node) seed layer 0.
|
|
24
|
+
* - Nodes never reached from a root are dropped into a trailing layer so the
|
|
25
|
+
* author still sees them.
|
|
26
|
+
* - Within a layer, nodes keep their original `nodes[]` order (stable).
|
|
27
|
+
* - A node with a persisted `ui` position overrides its computed slot, but is
|
|
28
|
+
* still included in the returned map so callers can size the canvas.
|
|
29
|
+
*/
|
|
30
|
+
export function computeLayout(nodes, edges) {
|
|
31
|
+
const positions = new Map();
|
|
32
|
+
if (nodes.length === 0)
|
|
33
|
+
return positions;
|
|
34
|
+
const byId = new Map(nodes.map((n) => [n.id, n]));
|
|
35
|
+
const indexOf = new Map(nodes.map((n, i) => [n.id, i]));
|
|
36
|
+
const outAdj = new Map();
|
|
37
|
+
const incoming = new Map();
|
|
38
|
+
for (const n of nodes)
|
|
39
|
+
incoming.set(n.id, 0);
|
|
40
|
+
for (const e of edges) {
|
|
41
|
+
if (!byId.has(e.source) || !byId.has(e.target) || e.source === e.target)
|
|
42
|
+
continue;
|
|
43
|
+
// ADR-0044: a declared back-edge (`type: 'back'`) re-enters an earlier node
|
|
44
|
+
// to close a revise loop. Exclude it from layering — exactly as the engine
|
|
45
|
+
// excludes it from DAG validation — so the loop doesn't drag its target
|
|
46
|
+
// node below the wait point. The edge is still drawn (as a return arc).
|
|
47
|
+
if (isBackEdge(e))
|
|
48
|
+
continue;
|
|
49
|
+
if (!outAdj.has(e.source))
|
|
50
|
+
outAdj.set(e.source, []);
|
|
51
|
+
outAdj.get(e.source).push(e.target);
|
|
52
|
+
incoming.set(e.target, (incoming.get(e.target) ?? 0) + 1);
|
|
53
|
+
}
|
|
54
|
+
// Seed roots: explicit start nodes, then any node with no incoming edge,
|
|
55
|
+
// finally the first node as a last resort (handles pure cycles).
|
|
56
|
+
const roots = [];
|
|
57
|
+
for (const n of nodes)
|
|
58
|
+
if (n.type === 'start')
|
|
59
|
+
roots.push(n.id);
|
|
60
|
+
for (const n of nodes)
|
|
61
|
+
if ((incoming.get(n.id) ?? 0) === 0 && !roots.includes(n.id))
|
|
62
|
+
roots.push(n.id);
|
|
63
|
+
if (roots.length === 0)
|
|
64
|
+
roots.push(nodes[0].id);
|
|
65
|
+
const layer = new Map();
|
|
66
|
+
const queue = [];
|
|
67
|
+
for (const r of roots) {
|
|
68
|
+
layer.set(r, 0);
|
|
69
|
+
queue.push(r);
|
|
70
|
+
}
|
|
71
|
+
// Relaxation with a hard iteration cap so a cyclic graph can never loop.
|
|
72
|
+
const maxIterations = nodes.length * Math.max(1, edges.length) + nodes.length + 1;
|
|
73
|
+
let iterations = 0;
|
|
74
|
+
while (queue.length && iterations < maxIterations) {
|
|
75
|
+
iterations += 1;
|
|
76
|
+
const id = queue.shift();
|
|
77
|
+
const base = layer.get(id) ?? 0;
|
|
78
|
+
for (const next of outAdj.get(id) ?? []) {
|
|
79
|
+
const candidate = base + 1;
|
|
80
|
+
if ((layer.get(next) ?? -1) < candidate) {
|
|
81
|
+
layer.set(next, candidate);
|
|
82
|
+
queue.push(next);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// Any node not reached above goes one layer below the deepest known layer.
|
|
87
|
+
let maxLayer = 0;
|
|
88
|
+
for (const v of layer.values())
|
|
89
|
+
maxLayer = Math.max(maxLayer, v);
|
|
90
|
+
for (const n of nodes) {
|
|
91
|
+
if (!layer.has(n.id)) {
|
|
92
|
+
maxLayer += 1;
|
|
93
|
+
layer.set(n.id, maxLayer);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// Bucket nodes by layer, preserving original order within each layer.
|
|
97
|
+
const byLayer = new Map();
|
|
98
|
+
for (const n of nodes) {
|
|
99
|
+
const l = layer.get(n.id) ?? 0;
|
|
100
|
+
if (!byLayer.has(l))
|
|
101
|
+
byLayer.set(l, []);
|
|
102
|
+
byLayer.get(l).push(n.id);
|
|
103
|
+
}
|
|
104
|
+
for (const ids of byLayer.values()) {
|
|
105
|
+
ids.sort((a, b) => (indexOf.get(a) ?? 0) - (indexOf.get(b) ?? 0));
|
|
106
|
+
}
|
|
107
|
+
const sortedLayers = [...byLayer.keys()].sort((a, b) => a - b);
|
|
108
|
+
for (const l of sortedLayers) {
|
|
109
|
+
const ids = byLayer.get(l);
|
|
110
|
+
const rowWidth = ids.length * NODE_W + (ids.length - 1) * H_GAP;
|
|
111
|
+
const startX = -rowWidth / 2;
|
|
112
|
+
ids.forEach((id, i) => {
|
|
113
|
+
positions.set(id, {
|
|
114
|
+
x: startX + i * (NODE_W + H_GAP),
|
|
115
|
+
y: l * (NODE_H + V_GAP),
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
// Normalize the auto-computed slots so the diagram starts at
|
|
120
|
+
// (PADDING, PADDING). We do this BEFORE applying manual overrides so the
|
|
121
|
+
// auto-laid nodes always live in one stable frame — a dragged node then
|
|
122
|
+
// keeps the exact coordinate the user dropped it at, with no drift.
|
|
123
|
+
let minX = Infinity;
|
|
124
|
+
let minY = Infinity;
|
|
125
|
+
for (const p of positions.values()) {
|
|
126
|
+
minX = Math.min(minX, p.x);
|
|
127
|
+
minY = Math.min(minY, p.y);
|
|
128
|
+
}
|
|
129
|
+
if (Number.isFinite(minX) && Number.isFinite(minY)) {
|
|
130
|
+
const dx = PADDING - minX;
|
|
131
|
+
const dy = PADDING - minY;
|
|
132
|
+
for (const [id, p] of positions)
|
|
133
|
+
positions.set(id, { x: p.x + dx, y: p.y + dy });
|
|
134
|
+
}
|
|
135
|
+
// Apply persisted manual overrides on top of the normalized frame.
|
|
136
|
+
for (const n of nodes) {
|
|
137
|
+
if (hasManualPosition(n)) {
|
|
138
|
+
positions.set(n.id, { x: Math.max(0, n.ui.x), y: Math.max(0, n.ui.y) });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return positions;
|
|
142
|
+
}
|
|
143
|
+
/** Bounding box of the laid-out diagram, including node extents + padding. */
|
|
144
|
+
export function diagramSize(positions) {
|
|
145
|
+
let maxX = 0;
|
|
146
|
+
let maxY = 0;
|
|
147
|
+
for (const p of positions.values()) {
|
|
148
|
+
maxX = Math.max(maxX, p.x + NODE_W);
|
|
149
|
+
maxY = Math.max(maxY, p.y + NODE_H);
|
|
150
|
+
}
|
|
151
|
+
return { width: maxX + PADDING, height: maxY + PADDING };
|
|
152
|
+
}
|
|
153
|
+
/** Bottom-center anchor of a node — where its outgoing edges originate. */
|
|
154
|
+
export function bottomAnchor(p) {
|
|
155
|
+
return { x: p.x + NODE_W / 2, y: p.y + NODE_H };
|
|
156
|
+
}
|
|
157
|
+
/** Top-center anchor of a node — where its incoming edges terminate. */
|
|
158
|
+
export function topAnchor(p) {
|
|
159
|
+
return { x: p.x + NODE_W / 2, y: p.y };
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Smooth vertical cubic-bezier path between two anchors. Control points are
|
|
163
|
+
* pulled along the vertical axis so the curve reads as a top-down flow even
|
|
164
|
+
* when the target sits above or beside the source.
|
|
165
|
+
*/
|
|
166
|
+
export function edgePath(from, to) {
|
|
167
|
+
const dy = Math.max(Math.abs(to.y - from.y) * 0.5, 24);
|
|
168
|
+
const c1 = { x: from.x, y: from.y + dy };
|
|
169
|
+
const c2 = { x: to.x, y: to.y - dy };
|
|
170
|
+
return `M ${from.x},${from.y} C ${c1.x},${c1.y} ${c2.x},${c2.y} ${to.x},${to.y}`;
|
|
171
|
+
}
|
|
172
|
+
/** Midpoint of an edge — anchor for the condition label + insert affordance. */
|
|
173
|
+
export function edgeMidpoint(from, to) {
|
|
174
|
+
return { x: (from.x + to.x) / 2, y: (from.y + to.y) / 2 };
|
|
175
|
+
}
|
|
176
|
+
/** True for an ADR-0044 declared back-edge (a revise/rework loop's return). */
|
|
177
|
+
export function isBackEdge(edge) {
|
|
178
|
+
return edge.type === 'back';
|
|
179
|
+
}
|
|
180
|
+
/** Right-center anchor of a node — where a back-edge's return arc attaches. */
|
|
181
|
+
export function rightAnchor(p) {
|
|
182
|
+
return { x: p.x + NODE_W, y: p.y + NODE_H / 2 };
|
|
183
|
+
}
|
|
184
|
+
/** Horizontal bow of a back-edge's return arc, scaled to the vertical span. */
|
|
185
|
+
function backEdgeBow(from, to) {
|
|
186
|
+
return Math.max(64, Math.abs(to.y - from.y) * 0.35);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Curved return path for a declared back-edge (ADR-0044 revise loop). Unlike a
|
|
190
|
+
* forward edge (top→bottom), a back-edge re-enters an earlier node, so we route
|
|
191
|
+
* it off the right side of both endpoints and bow it out to the right — a
|
|
192
|
+
* distinct return arc that reads as "loop back" rather than crossing the
|
|
193
|
+
* top-to-bottom forward edges.
|
|
194
|
+
*/
|
|
195
|
+
export function backEdgePath(from, to) {
|
|
196
|
+
const bow = backEdgeBow(from, to);
|
|
197
|
+
const c1 = { x: from.x + bow, y: from.y };
|
|
198
|
+
const c2 = { x: to.x + bow, y: to.y };
|
|
199
|
+
return `M ${from.x},${from.y} C ${c1.x},${c1.y} ${c2.x},${c2.y} ${to.x},${to.y}`;
|
|
200
|
+
}
|
|
201
|
+
/** Anchor for a back-edge's label pill — the apex of its return arc. */
|
|
202
|
+
export function backEdgeLabelAnchor(from, to) {
|
|
203
|
+
// The cubic's t=0.5 point sits ~0.75·bow right of the (shared) right edge.
|
|
204
|
+
const bow = backEdgeBow(from, to);
|
|
205
|
+
return { x: Math.max(from.x, to.x) + bow * 0.75, y: (from.y + to.y) / 2 };
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Stable identity for an edge. Prefers an explicit `edge.id`; otherwise falls
|
|
209
|
+
* back to a `source->target#index` composite so an unsaved edge still has a
|
|
210
|
+
* deterministic key. Used for selection, traversal highlighting, and inspector
|
|
211
|
+
* lookup — all of which read the same `draft.edges` array, so the index is
|
|
212
|
+
* consistent across them. Editing label/condition/isDefault never changes the
|
|
213
|
+
* key (source/target/index are untouched), so a selection survives edits.
|
|
214
|
+
*/
|
|
215
|
+
export function edgeKey(edge, index) {
|
|
216
|
+
return edge.id || `${edge.source}->${edge.target}#${index}`;
|
|
217
|
+
}
|
|
218
|
+
/** Human-readable condition text for an edge's optional guard. */
|
|
219
|
+
export function conditionText(c) {
|
|
220
|
+
if (!c)
|
|
221
|
+
return undefined;
|
|
222
|
+
if (typeof c === 'string')
|
|
223
|
+
return c;
|
|
224
|
+
if (typeof c === 'object' && typeof c.source === 'string')
|
|
225
|
+
return c.source;
|
|
226
|
+
return undefined;
|
|
227
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* flow-canvas-parts — presentational building blocks for `FlowCanvas.tsx`:
|
|
3
|
+
* the per-node-type icon/tone mapping, the node card, and the add-node
|
|
4
|
+
* palette popover. Kept dependency-free and Shadcn-native (Tailwind + lucide).
|
|
5
|
+
*/
|
|
6
|
+
import * as React from 'react';
|
|
7
|
+
import { type LucideIcon } from 'lucide-react';
|
|
8
|
+
import { type Point } from './flow-canvas-layout';
|
|
9
|
+
export declare function nodeIcon(type: string): LucideIcon;
|
|
10
|
+
interface NodeTone {
|
|
11
|
+
/** Icon color (used inside the tinted chip). */
|
|
12
|
+
icon: string;
|
|
13
|
+
/** Card accent border (left edge) + selected ring color. */
|
|
14
|
+
accent: string;
|
|
15
|
+
/** Small type-label text color. */
|
|
16
|
+
label: string;
|
|
17
|
+
/** Tinted icon-chip background + ring — the card's primary color cue. */
|
|
18
|
+
chip: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function nodeTone(type: string): NodeTone;
|
|
21
|
+
/**
|
|
22
|
+
* Renders the glyph for a node type. Uses `createElement` (rather than binding
|
|
23
|
+
* the resolved icon to a capitalized local) so the renderer stays a stable
|
|
24
|
+
* module-scope component instead of one re-created on every parent render.
|
|
25
|
+
*/
|
|
26
|
+
export declare function NodeTypeIcon({ type, className }: {
|
|
27
|
+
type: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
}): React.FunctionComponentElement<Omit<import("lucide-react").LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
30
|
+
/** Palette grouping — keeps the add-node list scannable as it grows. */
|
|
31
|
+
export type NodeCategory = 'Data' | 'Logic' | 'Human' | 'Integration' | 'Flow';
|
|
32
|
+
/** Display order of the palette's category sections. */
|
|
33
|
+
export declare const NODE_CATEGORY_ORDER: NodeCategory[];
|
|
34
|
+
export interface PaletteItem {
|
|
35
|
+
type: string;
|
|
36
|
+
label: string;
|
|
37
|
+
hint?: string;
|
|
38
|
+
/** Section this item belongs to in the grouped palette. */
|
|
39
|
+
category?: NodeCategory;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Category for a node type — drives palette grouping and gives engine-only
|
|
43
|
+
* (plugin-contributed) types a sensible section. Mirrors the `nodeTone`
|
|
44
|
+
* families so color and grouping stay consistent.
|
|
45
|
+
*/
|
|
46
|
+
export declare function nodeCategory(type: string): NodeCategory;
|
|
47
|
+
/** Node types offered by the add-node palette (spec `FlowNodeAction`). */
|
|
48
|
+
export declare const NODE_PALETTE: PaletteItem[];
|
|
49
|
+
/** Human-friendly default label for a newly created node of `type`. */
|
|
50
|
+
export declare function defaultNodeLabel(type: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* Spec-valid seed fields for a newly created node, so structured blocks start
|
|
53
|
+
* in a valid-ish shape (e.g. a wait node already has a timer eventType) rather
|
|
54
|
+
* than an empty intermediate state. Returns extra node props to spread in.
|
|
55
|
+
*/
|
|
56
|
+
export declare function defaultNodeExtras(type: string): Record<string, unknown>;
|
|
57
|
+
export interface NodeCardProps {
|
|
58
|
+
id: string;
|
|
59
|
+
type: string;
|
|
60
|
+
label: string;
|
|
61
|
+
summary?: string;
|
|
62
|
+
position: Point;
|
|
63
|
+
selected: boolean;
|
|
64
|
+
editable: boolean;
|
|
65
|
+
/** Simulation overlay: the currently-executing or already-visited node. */
|
|
66
|
+
runState?: 'active' | 'visited';
|
|
67
|
+
/** Dim nodes not yet reached while a simulation is in progress. */
|
|
68
|
+
dimmed?: boolean;
|
|
69
|
+
/** Structural-validation error highlight (e.g. part of an un-declared cycle). */
|
|
70
|
+
invalid?: boolean;
|
|
71
|
+
onPointerDown?: (e: React.PointerEvent) => void;
|
|
72
|
+
onSelect?: () => void;
|
|
73
|
+
onAppend?: () => void;
|
|
74
|
+
/**
|
|
75
|
+
* ADR-0044: when set (approval nodes without an existing revise loop), render
|
|
76
|
+
* the one-click "add revision loop" affordance — drops a wait node + the
|
|
77
|
+
* `revise` and declared `back` edges in a single gesture.
|
|
78
|
+
*/
|
|
79
|
+
onAddReviseLoop?: () => void;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A single draggable flow node rendered at an absolute canvas coordinate.
|
|
83
|
+
* The card body drives selection + reposition; a dedicated bottom "+" handle
|
|
84
|
+
* (edit mode only) appends a connected child without ambiguity.
|
|
85
|
+
*/
|
|
86
|
+
export declare function NodeCard({ type, label, summary, position, selected, editable, runState, dimmed, invalid, onPointerDown, onSelect, onAppend, onAddReviseLoop, }: NodeCardProps): React.JSX.Element;
|
|
87
|
+
export interface NodePaletteProps {
|
|
88
|
+
locale?: string;
|
|
89
|
+
/** Node types to offer. Defaults to the hardcoded {@link NODE_PALETTE}. */
|
|
90
|
+
items?: PaletteItem[];
|
|
91
|
+
onPick: (type: string) => void;
|
|
92
|
+
onClose: () => void;
|
|
93
|
+
}
|
|
94
|
+
/** Compact popover listing the node types an author can add, grouped by category. */
|
|
95
|
+
export declare function NodePalette({ items, onPick, onClose }: NodePaletteProps): React.JSX.Element;
|
|
96
|
+
export {};
|