@fluidgrids/fe-sdk 0.0.0-stage → 2026.1203.7
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/README.md +564 -2
- package/dist/ActivityOptionsFields-C2u-hY2U.js +142 -0
- package/dist/AiStudioPage-B_hNTj-_.js +1137 -0
- package/dist/ApprovalInboxPage-ClITra3n.js +1312 -0
- package/dist/ChoiceSelect-LkK-uS9J.js +65 -0
- package/dist/ConfirmActionDialog-DHWTDRbp.js +31 -0
- package/dist/ConnectionFormDialog-C0kDgcrZ.js +153 -0
- package/dist/CreateFluidgridsTagDocument-Dtp9KPLJ.js +1055 -0
- package/dist/DataSinkDashboardPage-b4ezeqa6.js +278 -0
- package/dist/DataTablesPage-C1d9YGHz.js +5575 -0
- package/dist/DateTimeField-B1qR4ruo.js +51 -0
- package/dist/Disclosure-BNKij7-v.js +45 -0
- package/dist/ElementLibraryPage-8jNO6YmE.js +2256 -0
- package/dist/ElementLibrarySequenceDocument-B-W8SPzn.js +3979 -0
- package/dist/EnsureThemeProvider-BvlNjAd0.js +24 -0
- package/dist/EntityTagBadge-1OlP6p0c.js +25 -0
- package/dist/EntityTagPicker-BBrU5cE0.js +137 -0
- package/dist/ExecuteStepDocument-B4j1mdRT.js +189 -0
- package/dist/ExecutionDetailDocument-D6QuM-kp.js +875 -0
- package/dist/ExecutionDetailPage-D4CBtFdo.js +12217 -0
- package/dist/ExecutionDetailPage-DvQ667OE.d.ts +10 -0
- package/dist/ExecutionStatusBadge-BsDVor9t.js +221 -0
- package/dist/ExecutionsListDocument-Dan7ZiqB.js +459 -0
- package/dist/ExecutionsListPage-B3XT8ITL.js +4307 -0
- package/dist/FailureTriagePanel-DOJMaJ0n.js +1285 -0
- package/dist/FileDownloadUrlDocument-CVOYKcL5.js +92 -0
- package/dist/FluidGridsDocsLink-bX0Hnhxr.js +66 -0
- package/dist/FluidGridsMark-CE2blT7K.js +74 -0
- package/dist/HeldLoadRegion-BtTxbvOW.js +34 -0
- package/dist/HistoryPage-BLoRpJ1R.d.ts +6 -0
- package/dist/HistoryPage-BSBISXoj.js +2835 -0
- package/dist/Icon-BtQ0HXLh.js +160 -0
- package/dist/InsightsPage-D7ybj8N9.js +11245 -0
- package/dist/IsolationSetting-vy911E8b.js +1153 -0
- package/dist/LibraryParts-DOeNgR8A.js +413 -0
- package/dist/ManagedAiPolicyAuthority-BxwJ3ptd.js +40 -0
- package/dist/ManagedAiPolicyAuthority-DM3t3wNr.d.ts +18 -0
- package/dist/ManagedAiPolicyAuthorityContext-CNkxIOZ1.js +10 -0
- package/dist/McpTriggerServers-BCPCAOWB.js +459 -0
- package/dist/MissingNodesInstallModal-rO_SEDrC.js +224 -0
- package/dist/NavigationV2Provider-DCDt35eG.js +17 -0
- package/dist/NodeSchemaIntrospectionDocument-C1vAIcHd.js +95 -0
- package/dist/NodesPage-DEbnz9iU.d.ts +6 -0
- package/dist/NodesPage-O7KeeKtd.js +653 -0
- package/dist/OfflineIcon-TwMKYWjA.js +207 -0
- package/dist/OpenTemplateAsCodeButton-BhWJWIF3.js +94 -0
- package/dist/PaidTemplateConfirm-_G3ag6S4.js +28 -0
- package/dist/PublishCustomNodeAction-CIySbK4c.js +134 -0
- package/dist/RecordTaskDialog-BkpCDvhR.js +2078 -0
- package/dist/RunActionsMenu-DodOgIQm.js +59 -0
- package/dist/RunnerStatusPill-C1v967iq.js +24 -0
- package/dist/RunnersPage-dB0RSdY_.js +1929 -0
- package/dist/SandboxRuntimeExhaustedNotice-BFOIF93C.js +120 -0
- package/dist/SchedulesPage-DPWr1yvf.js +1607 -0
- package/dist/SearchBox-BGtYjvfs.js +49 -0
- package/dist/SequenceEditor-CFiHeHkR.js +497 -0
- package/dist/SettingsPage-0CQBNPZV.js +8695 -0
- package/dist/StewardPages-DAJhepen.js +47 -0
- package/dist/StewardRunImportPanel-Kva2DO0u.js +2844 -0
- package/dist/StoreTemplateCardCompact-CHn5kP7A.js +2166 -0
- package/dist/TagFilterSelect-CyA8QrS7.js +42 -0
- package/dist/TaskQueuesPage-DdnDCyat.js +3571 -0
- package/dist/TechnicalDetails-B0Oi4aZw.js +19 -0
- package/dist/TemplateConfigurationModal-CdvCYJLM.js +332 -0
- package/dist/TemplateDetailPanel-CbiKciuB.js +222 -0
- package/dist/TemplatePreview-cx7-NOeG.js +868 -0
- package/dist/TemplatesPage-BG3H-6v6.d.ts +10 -0
- package/dist/TemplatesPage-BVQpGYIV.js +3251 -0
- package/dist/TerminateExecutionDocument-B_HKNVrN.js +581 -0
- package/dist/TranslationBridge-Bd4aJKMs.d.ts +11 -0
- package/dist/TranslationBridge-Da-TPgQm.js +68 -0
- package/dist/TriggerWorkflowDocument-D9Km2Vv2.js +460 -0
- package/dist/UiSequencePickerSequenceDocument-BSYnSDV7.js +607 -0
- package/dist/UiStepScreenshot-Qh4QMyUp.js +146 -0
- package/dist/UsageTimeSeriesDocument-DcInx9-z.js +177 -0
- package/dist/VariablesPage-ChfGuW22.js +2243 -0
- package/dist/VersionDiffDialog-Bd2AeUwf.js +1702 -0
- package/dist/VersionLifecycleBar-BBeWVtz-.js +143 -0
- package/dist/WebhookDeliveriesPage-D66bua0j.js +1563 -0
- package/dist/WorkflowBuilder-B6wQD1TK.js +539 -0
- package/dist/WorkflowBuilder-DR4ku8Tr.js +1611 -0
- package/dist/WorkflowDefinitionDocument-DZLbTPUZ.js +321 -0
- package/dist/WorkflowEmbed-BXfFGy0i.js +708 -0
- package/dist/WorkflowEmbed-Cbqe1s1z.d.ts +6 -0
- package/dist/WorkflowPinnedDataDocument-BODT5omd.js +782 -0
- package/dist/WorkflowProposalCard-BruukdeF.js +96 -0
- package/dist/WorkflowProposalDocument-BdUbsrd0.js +620 -0
- package/dist/WorkflowSearchRedirect-C7zJ2MKH.js +40 -0
- package/dist/WorkflowSettingsDrawer-MVU1BKfY.d.ts +18 -0
- package/dist/WorkflowSettingsDrawer-gazs97WR.js +196 -0
- package/dist/WorkflowShareDialog-e8jJtLjU.js +469 -0
- package/dist/WorkflowVersionsDocument-DRVOp8Uj.js +3213 -0
- package/dist/WorkflowsList--hR2_8gf.js +4593 -0
- package/dist/WorkflowsList-CcNDQge5.d.ts +6 -0
- package/dist/WorkflowsListPageDocument-CnzcQm_o.js +934 -0
- package/dist/addonCatalog-CbZS4deh.js +58 -0
- package/dist/addonCatalog-sjlonAmR.d.ts +15 -0
- package/dist/addons.d.ts +3 -0
- package/dist/addons.js +4 -0
- package/dist/agent-form-Bfvm32j1.js +83 -0
- package/dist/agent-tools.d.ts +3 -0
- package/dist/agent-tools.js +5 -0
- package/dist/agentTools-CyL7DLOF.js +320 -0
- package/dist/ai-usage-BrxDgvdR.js +240 -0
- package/dist/aiCreditsBridge-BuE92tKo.js +49 -0
- package/dist/api-BKq-nIOZ.js +2286 -0
- package/dist/api-Ol7I8NxE.js +8289 -0
- package/dist/apollo-type-policies.d.ts +11 -0
- package/dist/apollo-type-policies.js +64 -0
- package/dist/askAboutBridge-ByYsQams.js +106 -0
- package/dist/askQuestions-Cmx7VnMm.js +742 -0
- package/dist/assert-rules-lfYEMc99.js +318 -0
- package/dist/assistant.d.ts +94 -0
- package/dist/assistant.js +99 -0
- package/dist/attach-node-helpers-HDKQOtrD.js +32 -0
- package/dist/badge-CXfPhoMH.js +26 -0
- package/dist/basil.generated-BK-EHbwN.js +10 -0
- package/dist/browser-steps-DMpS5TyB.js +533 -0
- package/dist/builderTimings-pvGnK1m-.js +510 -0
- package/dist/button-DG7y_FVJ.js +48 -0
- package/dist/canvasNoteTools-BxuP_AYO.js +137 -0
- package/dist/card-Bomy_1UG.js +44 -0
- package/dist/catalogGrid-BOrfMgi-.js +41 -0
- package/dist/channel-CPyQ1NR1.js +212 -0
- package/dist/chips-CvNrYJZa.js +27 -0
- package/dist/client-holder-C0M5Cfwl.js +68 -0
- package/dist/cn-QqidFIgr.js +10 -0
- package/dist/code-editor-diagnostics-Zr0cIcx1.js +46 -0
- package/dist/code-editor-field-x_JrY8KR.js +113 -0
- package/dist/codec-client-DPuD6mw7.js +515 -0
- package/dist/conditionBuilder-DwfEF0Q-.js +1144 -0
- package/dist/config-DO68jw5k.js +322 -0
- package/dist/constants-DgbVc24O.d.ts +296 -0
- package/dist/constants-DlRnHBfQ.js +217 -0
- package/dist/convert-browser-action-pfecelF7.js +347 -0
- package/dist/convert-dialog-B_o22NiJ.js +382 -0
- package/dist/create-workflow-first-Azg3JUdX.js +120 -0
- package/dist/definition-canvas-Bsda-rDT.js +31 -0
- package/dist/dialog-BVd152GS.js +94 -0
- package/dist/durable-nodes-BXyYCLxT.js +91 -0
- package/dist/duration-CDb7-mT_.js +33 -0
- package/dist/edge-mapper-wEAdGVU2.js +4477 -0
- package/dist/element-library-DkSlg_VE.js +727 -0
- package/dist/entities-I_0kio3q.js +38 -0
- package/dist/error-advice-QLr5NCm7.js +65 -0
- package/dist/errors-ClKb5sEt.js +188 -0
- package/dist/executions.d.ts +3 -0
- package/dist/executions.js +5 -0
- package/dist/feature-flags-B2qetXKd.js +385 -0
- package/dist/field-label-DPZRmE_B.js +153 -0
- package/dist/firstWorkflow-C_h0KMB2.js +133 -0
- package/dist/flags.d.ts +3 -0
- package/dist/flags.js +4 -0
- package/dist/flow-builder-DIvLOhz0.js +28038 -0
- package/dist/flow-store-holder-CUN7Terz.js +52 -0
- package/dist/fluent.generated-CA_e6-4l.js +14 -0
- package/dist/fluidgridsEvents-bbEQbwU6.js +175 -0
- package/dist/fluidgridsTheme-DUhvOgoy.js +297 -0
- package/dist/global-client-BQPuFrFa.js +433 -0
- package/dist/global-operations-BG6YgxrM.js +136 -0
- package/dist/graphql-types-UTYtujY9.js +21358 -0
- package/dist/history.d.ts +3 -0
- package/dist/history.js +4 -0
- package/dist/index-AoJAa5vU.d.ts +164958 -0
- package/dist/index-DEMT3iAM.d.ts +120 -0
- package/dist/index-ROZzNGyY.d.ts +76 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +8123 -0
- package/dist/ion.generated-mbajjcAg.js +10 -0
- package/dist/label-Lzb8ZXf_.js +29 -0
- package/dist/labels-rXd9gYQz.js +1236 -0
- package/dist/liveCanvas-D5ytXDp8.js +103 -0
- package/dist/logos.generated-X6_0kjVR.js +21 -0
- package/dist/logs-panel-Cw0DkG0l.js +468 -0
- package/dist/lucide.generated-B6NVd3GT.js +29 -0
- package/dist/marksStore-a9oIMMot.js +175 -0
- package/dist/mcp-trigger-D0nRdvq5.js +307 -0
- package/dist/mdi.generated-D1BV74d6.js +292 -0
- package/dist/menus-CU3hDGYl.js +160 -0
- package/dist/mynaui.generated-DMWr5cXz.js +66 -0
- package/dist/navigation-v2.d.ts +3 -0
- package/dist/navigation-v2.js +5 -0
- package/dist/node-detail-view-Cgm5H1P-.js +1372 -0
- package/dist/node-editor-tab-body-CZ0fVuVP.js +187 -0
- package/dist/node-operation-selection-CdV3KI_V.js +3534 -0
- package/dist/node-registry-refresh-s3okf83X.js +27 -0
- package/dist/node-role-TMbnkmeP.js +132 -0
- package/dist/node-type-icon-BZa8n4iG.js +33 -0
- package/dist/nodes.d.ts +3 -0
- package/dist/nodes.js +4 -0
- package/dist/notesKey-5EaREBGA.js +12 -0
- package/dist/observability.d.ts +3 -0
- package/dist/observability.js +5 -0
- package/dist/offset-pages-zghoClB3.js +55 -0
- package/dist/operations-BBmT9ToP.js +663 -0
- package/dist/operations-WxRJWeqO.js +3133 -0
- package/dist/output-files-Ba8bu5lv.js +196 -0
- package/dist/page-operation-DrWuhd6Y.js +129 -0
- package/dist/page-twins.d.ts +13 -0
- package/dist/page-twins.js +186 -0
- package/dist/pageControlSpecs-DZJ9K37m.js +134 -0
- package/dist/pageControlsBridge-0pX9s-3k.js +54 -0
- package/dist/pageControlsBridge-DAuT3w7L.d.ts +36 -0
- package/dist/panels-PfBBAToE.js +346 -0
- package/dist/parts-B7fBcw-B.js +346 -0
- package/dist/popover-Dms9Vz3j.js +3389 -0
- package/dist/preloadable-lazy-Pp47mqQ9.js +65 -0
- package/dist/proactive.d.ts +66 -0
- package/dist/proactive.js +237 -0
- package/dist/quick-config-panel-DFd77xho.js +451 -0
- package/dist/quota-DeA_CJ2e.js +175 -0
- package/dist/quota.d.ts +3 -0
- package/dist/quota.js +4 -0
- package/dist/read-only-context-Dt9N9SIG.js +18 -0
- package/dist/relative-time-Dxt8ZIIu.js +55 -0
- package/dist/results-CwK_yDxK.js +325 -0
- package/dist/rolldown-runtime-hDbaFkMy.js +18 -0
- package/dist/route-data.d.ts +12 -0
- package/dist/route-data.js +69 -0
- package/dist/route-match-C-0_EnAt.d.ts +5 -0
- package/dist/route-match-DMkUICYV.js +41 -0
- package/dist/route-preload-C4DlGoCd.js +120 -0
- package/dist/run-display-UjLAoYqQ.js +81 -0
- package/dist/run-history-arGiHzGU.js +285 -0
- package/dist/run-list-links-DJn4Mf1T.js +98 -0
- package/dist/run-mode-USmM0-Uo.js +82 -0
- package/dist/run-parity-CWXqEJqM.js +144 -0
- package/dist/runsQuota-B6SyTbne.js +100 -0
- package/dist/runsQuota-DsniKiSg.d.ts +20 -0
- package/dist/safe-expression-Cw7-SCsm.js +1251 -0
- package/dist/save-status-store-C7nEYpfb.js +631 -0
- package/dist/schedule-panel-B4GYXzXQ.js +13774 -0
- package/dist/schedule-rules-ggVKRkBH.js +358 -0
- package/dist/secrets-Re_wSiE3.js +153 -0
- package/dist/settings.d.ts +4 -0
- package/dist/settings.js +6 -0
- package/dist/shared-DAWGGMSM.js +177 -0
- package/dist/sidebar-node-editor-6eSSgCzc.js +178 -0
- package/dist/solar.generated-CGYuUQAC.js +10 -0
- package/dist/stableTabbedDialog-BBhrfXGe.js +20 -0
- package/dist/start-url-CT6Yz96K.js +24 -0
- package/dist/status-CessxGpm.js +55 -0
- package/dist/store-icon-OctYp5zP.js +155 -0
- package/dist/styles-WGmTnZ2n.js +26 -0
- package/dist/styles.css +139 -0
- package/dist/svg-spinners.generated-CIPT7IhM.js +10 -0
- package/dist/template-code-CzN6JWNV.js +191 -0
- package/dist/template-graph-DLF9dygU.js +20 -0
- package/dist/template-preview-DcIIKOOL.js +32 -0
- package/dist/template-price-CdUHZRMF.js +40 -0
- package/dist/templates.d.ts +3 -0
- package/dist/templates.js +5 -0
- package/dist/theme-provider-CntfC4_i.js +23 -0
- package/dist/transient-DgZfhDfN.js +57 -0
- package/dist/typed-calls-C5tO03wq.js +26 -0
- package/dist/ui-script-By74Guk3.js +1094 -0
- package/dist/ui-script-editor-CqPu2bCN.js +2447 -0
- package/dist/ui-step-fix-8uM2_Hft.js +67 -0
- package/dist/ui-step-fix-store-CcO1FdRx.js +19 -0
- package/dist/ui-step-run-context-o7bLE6KP.js +46 -0
- package/dist/ui-target-editor-D2JhB_lD.js +673 -0
- package/dist/uiMarkTools-CSznnO1i.js +1054 -0
- package/dist/upgradePrompt-BAFBKKW5.js +72 -0
- package/dist/use-bare-node-registry-O6mKJO_n.js +11498 -0
- package/dist/use-browser-available-hj8wc3Kb.js +241 -0
- package/dist/use-edge-mapper-schemas-Bonofxow.js +496 -0
- package/dist/use-extension-bridge-B9ZreOkQ.js +608 -0
- package/dist/use-mobile-BTqCUjzS.js +27 -0
- package/dist/use-sdk-query-C697xZVv.js +116 -0
- package/dist/use-workflow-code-editor-CFoRFrZ5.js +753 -0
- package/dist/useActionParam-B2tU2BlY.js +85 -0
- package/dist/useAgentTokenStream-Bko_J0d0.js +4217 -0
- package/dist/useBrowserClients-3v95-gSh.js +103 -0
- package/dist/useCodeWorkflowInsights-w0tz9Ap_.js +600 -0
- package/dist/useConnections-DsgEJs05.js +439 -0
- package/dist/useDebouncedValue-BFekcv6n.js +18 -0
- package/dist/useDurableParity-8fnMZmBc.js +1787 -0
- package/dist/useEntityTags-D0spL6Ut.js +460 -0
- package/dist/useExecutions-2u5nGJJk.js +681 -0
- package/dist/useFluidGridsAnalytics-VM8lAi2x.js +238 -0
- package/dist/useGlobalStoreClient-BTdhkA2I.js +24 -0
- package/dist/useHumanRequests-zlYDp3l1.js +221 -0
- package/dist/useNavigationV2-C2WeqN7d.js +29 -0
- package/dist/useNavigationV2-DANUmg12.d.ts +9 -0
- package/dist/useObservability-BRlQ0tOA.js +285 -0
- package/dist/useRequestedProposal-B7uPXfZB.js +51 -0
- package/dist/useRunHistory-CXCMUPyf.js +2759 -0
- package/dist/useRunLive-D0JvVZT2.js +1060 -0
- package/dist/useRunnerList-Dbi59i1K.js +446 -0
- package/dist/useRunners-URUc5quU.js +173 -0
- package/dist/useRunsPage-DG656UCK.js +2709 -0
- package/dist/useVariables-BIelxcWr.js +463 -0
- package/dist/useVersionHistoryData-CTjqVw7l.js +292 -0
- package/dist/useWorkflowCodeExport-pqxyLHD1.js +522 -0
- package/dist/useWorkflowListExport-hcZNvTaB.js +232 -0
- package/dist/useWorkflowOrganization-CpBbOrs7.js +1772 -0
- package/dist/useWorkflowProposal-BH0VdNMA.js +3280 -0
- package/dist/useWorkflows-Cvg-Z_IE.js +1606 -0
- package/dist/utils-fvBb5qOD.js +89 -0
- package/dist/webhook-deliveries-AvQujaZy.js +99 -0
- package/dist/workflow-builder-CJygVkVv.d.ts +2 -0
- package/dist/workflow-builder.d.ts +3 -0
- package/dist/workflow-builder.js +8 -0
- package/dist/workflow-code-transfer-Bsy0JKAZ.js +323 -0
- package/dist/workflow-embed.d.ts +3 -0
- package/dist/workflow-embed.js +4 -0
- package/dist/workflow-git-sync--K9ZsPDC.js +263 -0
- package/dist/workflow-host.d.ts +6 -0
- package/dist/workflow-host.js +11 -0
- package/dist/workflow-pages-D-7ByLTB.d.ts +68 -0
- package/dist/workflow-pages.d.ts +3 -0
- package/dist/workflow-pages.js +115 -0
- package/dist/workflow-preview-canvas-CO8yzdE3.js +848 -0
- package/dist/workflow-preview.d.ts +65 -0
- package/dist/workflow-preview.js +4 -0
- package/dist/workflow-route.d.ts +33 -0
- package/dist/workflow-route.js +4 -0
- package/dist/workflow-save-state-D0l-DkLf.js +767 -0
- package/dist/workflow-transfer-CQnQC-ke.js +104 -0
- package/dist/workflowRouteData-BkfVOc-O.js +169 -0
- package/dist/workflows-list.d.ts +10 -0
- package/dist/workflows-list.js +5 -0
- package/package.json +320 -4
|
@@ -0,0 +1,848 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as canvasFromDefinition } from "./definition-canvas-Bsda-rDT.js";
|
|
3
|
+
import { t as isNodeTrigger } from "./node-role-TMbnkmeP.js";
|
|
4
|
+
import { A as NodeCard, C as landingSourceHandle, D as resolveOutputHandles, E as resolveInputHandles, F as operationInPlainWords, N as nodeCardStatus, O as NodeCardStatusLine, T as outputHandlesSpacerHeight, _ as InputHandles, g as LogicNodeCard, i as WAIT_FOR_SIGNAL_NODE_TYPE, j as NodeCardHeader, m as readSignalName, r as CODE_WORKFLOW_NODE_TYPE, t as resolveOperationName, v as OutputHandles } from "./node-operation-selection-CdV3KI_V.js";
|
|
5
|
+
import { f as STICKY_NOTE_TYPE } from "./field-label-DPZRmE_B.js";
|
|
6
|
+
import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
|
|
7
|
+
import { memo, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
8
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Background, MarkerType, ReactFlow, ReactFlowProvider, getBezierPath, useReactFlow, useStore } from "@xyflow/react";
|
|
10
|
+
import { nodeCategoryColor } from "@burdenoff/fe-libs/shared/utils";
|
|
11
|
+
import "@xyflow/react/dist/style.css";
|
|
12
|
+
import { cn } from "@burdenoff/fe-libs/utils";
|
|
13
|
+
|
|
14
|
+
// src/builder/preview/preview-model.ts
|
|
15
|
+
/** The React Flow node type every preview card registers under. */
|
|
16
|
+
const PREVIEW_NODE_TYPE = "preview";
|
|
17
|
+
/** The React Flow edge type every preview edge registers under. */
|
|
18
|
+
const PREVIEW_EDGE_TYPE = "preview";
|
|
19
|
+
const LOGIC_TYPE_PATTERN = /(^|[:/])(if|switch|merge|loop|filter|branch|router|condition|aggregate)/;
|
|
20
|
+
function isRecord(value) {
|
|
21
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22
|
+
}
|
|
23
|
+
function text(value) {
|
|
24
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
25
|
+
}
|
|
26
|
+
function finite(value) {
|
|
27
|
+
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
28
|
+
}
|
|
29
|
+
/** "store/gmail_reader" → "Gmail Reader"; "internal:http-request" → "Http Request". */
|
|
30
|
+
function humanizeNodeType(nodeType) {
|
|
31
|
+
const words = (nodeType.split(/[:/]/).filter(Boolean).pop() ?? nodeType).replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[\s_\-.]+/).filter(Boolean);
|
|
32
|
+
if (words.length === 0) return nodeType;
|
|
33
|
+
return words.map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
34
|
+
}
|
|
35
|
+
/** Icons for node types the preview recognises without a registry. */
|
|
36
|
+
const FALLBACK_ICONS = [
|
|
37
|
+
[/schedule|cron|timer/, "mdi:clock-outline"],
|
|
38
|
+
[/webhook/, "mdi:webhook"],
|
|
39
|
+
[/form/, "mdi:form-select"],
|
|
40
|
+
[/mcp/, "mdi:server-network"],
|
|
41
|
+
[/(^|[:/])api($|[:/_-])|manual/, "mdi:play-circle-outline"],
|
|
42
|
+
[/(^|[:/])if($|[:/_-])|condition|branch|router/, "mdi:call-split"],
|
|
43
|
+
[/switch/, "mdi:source-branch"],
|
|
44
|
+
[/merge/, "mdi:call-merge"],
|
|
45
|
+
[/loop|iterate|each/, "mdi:repeat"],
|
|
46
|
+
[/filter/, "mdi:filter-outline"],
|
|
47
|
+
[/aggregate/, "mdi:sigma"],
|
|
48
|
+
[/wait|delay|sleep|signal/, "mdi:timer-sand"],
|
|
49
|
+
[/code|script|function|javascript|python/, "mdi:code-braces"],
|
|
50
|
+
[/http|rest|graphql|request/, "mdi:web"],
|
|
51
|
+
[/gmail|email|mail|smtp/, "mdi:email-outline"],
|
|
52
|
+
[/slack/, "mdi:slack"],
|
|
53
|
+
[/github/, "mdi:github"],
|
|
54
|
+
[/sheet|excel|csv/, "mdi:table"],
|
|
55
|
+
[/db|sql|postgres|mysql|mongo|table/, "mdi:database-outline"],
|
|
56
|
+
[/ai|llm|gpt|openai|anthropic|claude|agent/, "mdi:robot-outline"],
|
|
57
|
+
[/notify|notification|message|chat|sms/, "mdi:message-outline"]
|
|
58
|
+
];
|
|
59
|
+
/** Generic node icon (the builder's own fallback). */
|
|
60
|
+
const FALLBACK_NODE_ICON = "mynaui:puzzle";
|
|
61
|
+
/** Icon for a node type with no manifest at hand. */
|
|
62
|
+
function fallbackNodeIcon(nodeType) {
|
|
63
|
+
const key = nodeType.toLowerCase();
|
|
64
|
+
for (const [pattern, icon] of FALLBACK_ICONS) if (pattern.test(key)) return icon;
|
|
65
|
+
return FALLBACK_NODE_ICON;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The node's data as the builder card reads it. Assistant- and code-written
|
|
69
|
+
* definitions keep the executor's fields on the node root (operation, args,
|
|
70
|
+
* version) and mirror them into `data`; `data` wins where both are set.
|
|
71
|
+
*/
|
|
72
|
+
function cardData(raw) {
|
|
73
|
+
const root = raw;
|
|
74
|
+
const data = isRecord(raw.data) ? raw.data : {};
|
|
75
|
+
const merged = {};
|
|
76
|
+
for (const key of [
|
|
77
|
+
"operation_name",
|
|
78
|
+
"operation_type",
|
|
79
|
+
"args",
|
|
80
|
+
"version"
|
|
81
|
+
]) if (root[key] !== void 0) merged[key] = root[key];
|
|
82
|
+
return {
|
|
83
|
+
...merged,
|
|
84
|
+
...data
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** The config summary the builder's logic card shows under its title. */
|
|
88
|
+
function logicSubtitle(nodeType, data) {
|
|
89
|
+
const args = isRecord(data.args) ? data.args : void 0;
|
|
90
|
+
const state = isRecord(args?.state) ? args.state : void 0;
|
|
91
|
+
if (nodeType === "internal:wait-for-signal") return readSignalName(state);
|
|
92
|
+
const rules = state?.rules;
|
|
93
|
+
if (Array.isArray(rules)) return `${rules.length} rule${rules.length === 1 ? "" : "s"}`;
|
|
94
|
+
return text(state?.mode);
|
|
95
|
+
}
|
|
96
|
+
/** The card model of one stored node (sticky notes are not cards). */
|
|
97
|
+
function previewCardModel(raw, resolveMeta, connectedInputs = []) {
|
|
98
|
+
const data = cardData(raw);
|
|
99
|
+
const nodeType = text(raw.type) ?? text(data.nodeType) ?? "";
|
|
100
|
+
const manifest = isRecord(data.nodeData) ? data.nodeData : {};
|
|
101
|
+
const resolved = nodeType ? resolveMeta?.(nodeType) : void 0;
|
|
102
|
+
const appName = text(resolved?.title) ?? text(manifest.name) ?? (nodeType ? humanizeNodeType(nodeType) : "");
|
|
103
|
+
const icon = text(resolved?.icon) ?? text(manifest.icon) ?? (nodeType ? fallbackNodeIcon(nodeType) : "mynaui:puzzle");
|
|
104
|
+
const description = text(manifest.description) ?? text(resolved?.description) ?? "";
|
|
105
|
+
const label = text(data.label);
|
|
106
|
+
const trigger = isNodeTrigger({
|
|
107
|
+
type: nodeType,
|
|
108
|
+
data
|
|
109
|
+
});
|
|
110
|
+
const lowerType = nodeType.toLowerCase();
|
|
111
|
+
const isLogicType = LOGIC_TYPE_PATTERN.test(lowerType);
|
|
112
|
+
const accent = nodeCategoryColor(trigger ? "trigger" : isLogicType ? "logic" : "action");
|
|
113
|
+
const outputHandles = resolveOutputHandles(data, nodeType, resolved?.nodeData);
|
|
114
|
+
const inputHandles = resolveInputHandles(data, resolved?.nodeData, {
|
|
115
|
+
nodeType,
|
|
116
|
+
connectedHandles: connectedInputs
|
|
117
|
+
});
|
|
118
|
+
const kind = manifest.kind;
|
|
119
|
+
const isWaitForSignal = nodeType === WAIT_FOR_SIGNAL_NODE_TYPE;
|
|
120
|
+
const isCodeWorkflow = nodeType === CODE_WORKFLOW_NODE_TYPE;
|
|
121
|
+
const isControlFlow = isWaitForSignal || !isCodeWorkflow && nodeType.startsWith("internal:") && (Array.isArray(kind) ? kind.includes("control") : isLogicType);
|
|
122
|
+
const operationName = resolveOperationName(data.operation_name, "");
|
|
123
|
+
const showsDescriptionOnly = isCodeWorkflow || operationName === "execute" && nodeType.startsWith("internal:") || trigger && !operationName;
|
|
124
|
+
return {
|
|
125
|
+
variant: isControlFlow ? "logic" : "app",
|
|
126
|
+
nodeType,
|
|
127
|
+
title: label ?? appName,
|
|
128
|
+
appName,
|
|
129
|
+
icon,
|
|
130
|
+
operation: showsDescriptionOnly ? null : operationName || null,
|
|
131
|
+
description,
|
|
132
|
+
subtitle: isControlFlow ? logicSubtitle(nodeType, data) : void 0,
|
|
133
|
+
trigger,
|
|
134
|
+
disabled: data.disabled === true,
|
|
135
|
+
accent,
|
|
136
|
+
accentKey: nodeType || appName,
|
|
137
|
+
inputHandles,
|
|
138
|
+
outputHandles,
|
|
139
|
+
handleSpacer: outputHandlesSpacerHeight(Math.max(outputHandles.length, inputHandles.length))
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Gives a card the adapter ports its drawn edges leave from.
|
|
144
|
+
*
|
|
145
|
+
* The builder draws a node's adapter ports (an agent's model, memory, tools)
|
|
146
|
+
* as diamonds under the card; the preview card has none, so an edge the
|
|
147
|
+
* builder draws from one would have nowhere to start. Each such port is added
|
|
148
|
+
* as a labelled output after the card's own, which stay as they are. Only
|
|
149
|
+
* ports the builder really has are passed in (`builderCardPorts`), so this
|
|
150
|
+
* never invents a connection.
|
|
151
|
+
*/
|
|
152
|
+
function withAdapterPorts(card, edgeHandleIds) {
|
|
153
|
+
const known = new Set(card.outputHandles.map((handle) => handle.id));
|
|
154
|
+
const missing = [...new Set(edgeHandleIds)].filter((id) => !known.has(id));
|
|
155
|
+
if (missing.length === 0) return card;
|
|
156
|
+
const outputHandles = [...card.outputHandles, ...missing.map((id) => ({
|
|
157
|
+
id,
|
|
158
|
+
label: id
|
|
159
|
+
}))];
|
|
160
|
+
return {
|
|
161
|
+
...card,
|
|
162
|
+
outputHandles,
|
|
163
|
+
handleSpacer: outputHandlesSpacerHeight(Math.max(outputHandles.length, card.inputHandles.length))
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/** The adapter port names a stored node's saved manifest declares. */
|
|
167
|
+
function adapterPortNames(data) {
|
|
168
|
+
const manifest = isRecord(data.nodeData) ? data.nodeData : {};
|
|
169
|
+
return (Array.isArray(manifest.nodeAdapters) ? manifest.nodeAdapters : []).map((adapter) => isRecord(adapter) ? adapter.name : void 0).filter((name) => typeof name === "string" && !!name);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The ports the BUILDER's card for each stored node renders, read the way the
|
|
173
|
+
* builder's node component (`blocks/nodes/node/node.tsx`) reads them: from the
|
|
174
|
+
* node's stored data alone (the builder does not fill handles in from the node
|
|
175
|
+
* registry on load).
|
|
176
|
+
*
|
|
177
|
+
* - An adapter sub-node (`data.isAdapterInstance`, or the target of an edge
|
|
178
|
+
* leaving one of its source's adapter ports) is drawn as the compact
|
|
179
|
+
* sub-node: one `target` input, and only its own adapter ports as sources.
|
|
180
|
+
* - Any other card: its resolved output handles, then its adapter ports, as
|
|
181
|
+
* sources; its resolved input handles as targets, except an app card for a
|
|
182
|
+
* trigger, which has no input port (the logic card always has one).
|
|
183
|
+
*/
|
|
184
|
+
function builderCardPorts(nodes, edges, cards) {
|
|
185
|
+
const adapters = /* @__PURE__ */ new Map();
|
|
186
|
+
for (const node of nodes) adapters.set(node.id, adapterPortNames(cardData(node)));
|
|
187
|
+
const adapterSets = new Map([...adapters].map(([id, names]) => [id, new Set(names)]));
|
|
188
|
+
const subNodes = /* @__PURE__ */ new Set();
|
|
189
|
+
for (const node of nodes) if (cardData(node).isAdapterInstance) subNodes.add(node.id);
|
|
190
|
+
for (const edge of edges) {
|
|
191
|
+
const handle = edge.sourceHandle;
|
|
192
|
+
if (!handle || handle === "source") continue;
|
|
193
|
+
if (adapterSets.get(edge.source)?.has(handle)) subNodes.add(edge.target);
|
|
194
|
+
}
|
|
195
|
+
const ports = /* @__PURE__ */ new Map();
|
|
196
|
+
for (const node of nodes) {
|
|
197
|
+
const card = cards.get(node.id);
|
|
198
|
+
if (!card) continue;
|
|
199
|
+
const own = adapters.get(node.id) ?? [];
|
|
200
|
+
if (subNodes.has(node.id)) {
|
|
201
|
+
ports.set(node.id, {
|
|
202
|
+
sources: own,
|
|
203
|
+
targets: ["target"]
|
|
204
|
+
});
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
const hasInputs = card.variant === "logic" || !card.trigger;
|
|
208
|
+
ports.set(node.id, {
|
|
209
|
+
sources: [...card.outputHandles.map((handle) => handle.id), ...own],
|
|
210
|
+
targets: hasInputs ? card.inputHandles.map((handle) => handle.id) : []
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
return ports;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* The handle an edge lands on in the builder, or `null` when the builder does
|
|
217
|
+
* not draw it. React Flow (strict connection mode, the builder's) takes the
|
|
218
|
+
* first port for an edge with no handle and drops an edge whose handle the card
|
|
219
|
+
* does not have.
|
|
220
|
+
*/
|
|
221
|
+
function builderHandle(ports, handle) {
|
|
222
|
+
if (!handle) return ports[0] ?? null;
|
|
223
|
+
return ports.includes(handle) ? handle : null;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* The preview canvas of a stored definition, or `null` when it carries no
|
|
227
|
+
* canvas. Sticky notes are annotations, not steps, so they are left out, with
|
|
228
|
+
* any edge to one.
|
|
229
|
+
*
|
|
230
|
+
* ★ An edge is drawn only when the builder draws it (`builderCardPorts`): one
|
|
231
|
+
* whose source or target handle the builder's card does not have (an IF
|
|
232
|
+
* `true` edge from a card with no IF outputs, or any edge into a trigger) is
|
|
233
|
+
* left out, never given a port of its own. The preview used to invent a labelled port for every unknown handle,
|
|
234
|
+
* so it showed connections the builder silently drops (BOFF-9806). The ports
|
|
235
|
+
* follow the builder's: a node's own manifest, and for a bare node (built
|
|
236
|
+
* outside the builder) the registry manifest the host's `resolveMeta` returns
|
|
237
|
+
* as `nodeData` (BOFF-11434). As in the builder, an edge saved under the other
|
|
238
|
+
* plain output id (`source` / `output`) than its card draws lands on the
|
|
239
|
+
* card's one plain output (`landingSourceHandle`).
|
|
240
|
+
*/
|
|
241
|
+
function previewCanvasFromDefinition(definitionJson, resolveMeta) {
|
|
242
|
+
const canvas = canvasFromDefinition(definitionJson);
|
|
243
|
+
if (!canvas) return null;
|
|
244
|
+
const steps = canvas.nodes.filter((node) => node.type !== STICKY_NOTE_TYPE);
|
|
245
|
+
const ids = new Set(steps.map((node) => node.id));
|
|
246
|
+
const betweenSteps = canvas.edges.filter((edge) => ids.has(edge.source) && ids.has(edge.target));
|
|
247
|
+
const connectedInputs = /* @__PURE__ */ new Map();
|
|
248
|
+
for (const edge of betweenSteps) {
|
|
249
|
+
const list = connectedInputs.get(edge.target) ?? [];
|
|
250
|
+
list.push(edge.targetHandle);
|
|
251
|
+
connectedInputs.set(edge.target, list);
|
|
252
|
+
}
|
|
253
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
254
|
+
for (const raw of steps) resolved.set(raw.id, previewCardModel(raw, resolveMeta, connectedInputs.get(raw.id)));
|
|
255
|
+
const ports = builderCardPorts(steps, betweenSteps, resolved);
|
|
256
|
+
const rawEdges = betweenSteps.flatMap((edge) => {
|
|
257
|
+
const sourceHandle = landingSourceHandle(ports.get(edge.source)?.sources ?? [], edge.sourceHandle);
|
|
258
|
+
const targetHandle = builderHandle(ports.get(edge.target)?.targets ?? [], edge.targetHandle);
|
|
259
|
+
return sourceHandle && targetHandle ? [{
|
|
260
|
+
...edge,
|
|
261
|
+
sourceHandle,
|
|
262
|
+
targetHandle
|
|
263
|
+
}] : [];
|
|
264
|
+
});
|
|
265
|
+
const sourceHandles = /* @__PURE__ */ new Map();
|
|
266
|
+
for (const edge of rawEdges) {
|
|
267
|
+
const list = sourceHandles.get(edge.source) ?? [];
|
|
268
|
+
list.push(edge.sourceHandle);
|
|
269
|
+
sourceHandles.set(edge.source, list);
|
|
270
|
+
}
|
|
271
|
+
return {
|
|
272
|
+
nodes: steps.map((raw) => {
|
|
273
|
+
const card = withAdapterPorts(resolved.get(raw.id) ?? previewCardModel(raw, resolveMeta), sourceHandles.get(raw.id) ?? []);
|
|
274
|
+
const position = isRecord(raw.position) ? raw.position : {};
|
|
275
|
+
return {
|
|
276
|
+
id: raw.id,
|
|
277
|
+
type: PREVIEW_NODE_TYPE,
|
|
278
|
+
position: {
|
|
279
|
+
x: finite(position.x),
|
|
280
|
+
y: finite(position.y)
|
|
281
|
+
},
|
|
282
|
+
data: { card },
|
|
283
|
+
draggable: false,
|
|
284
|
+
connectable: false,
|
|
285
|
+
selectable: false,
|
|
286
|
+
deletable: false
|
|
287
|
+
};
|
|
288
|
+
}),
|
|
289
|
+
edges: rawEdges.map((edge) => ({
|
|
290
|
+
id: edge.id,
|
|
291
|
+
source: edge.source,
|
|
292
|
+
target: edge.target,
|
|
293
|
+
sourceHandle: edge.sourceHandle,
|
|
294
|
+
targetHandle: edge.targetHandle,
|
|
295
|
+
type: PREVIEW_EDGE_TYPE,
|
|
296
|
+
selectable: false,
|
|
297
|
+
deletable: false,
|
|
298
|
+
focusable: false
|
|
299
|
+
}))
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* The order a sequenced reveal shows nodes in: along the flow (left to right),
|
|
304
|
+
* then top to bottom. Ids in `shown` are already on screen and are skipped.
|
|
305
|
+
*/
|
|
306
|
+
function previewRevealOrder(nodes, shown = /* @__PURE__ */ new Set()) {
|
|
307
|
+
return nodes.filter((node) => !shown.has(node.id)).slice().sort((left, right) => left.position.x - right.position.x || left.position.y - right.position.y).map((node) => node.id);
|
|
308
|
+
}
|
|
309
|
+
/** An edge is drawn once both of its ends are on screen. */
|
|
310
|
+
function edgesBetweenVisible(edges, visible) {
|
|
311
|
+
return edges.filter((edge) => visible.has(edge.source) && visible.has(edge.target));
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* The node that just appeared: the last id of `next` (in `order`) that was not
|
|
315
|
+
* in `previous`. Keeps the current newest when nothing was added, and drops it
|
|
316
|
+
* when it left the canvas.
|
|
317
|
+
*/
|
|
318
|
+
function newestNodeId(previous, next, order, current) {
|
|
319
|
+
let added = null;
|
|
320
|
+
for (const id of order) if (next.has(id) && !previous.has(id)) added = id;
|
|
321
|
+
if (added) return added;
|
|
322
|
+
return current && next.has(current) ? current : null;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Folds React Flow's measured sizes into a size map. Only `dimensions`
|
|
326
|
+
* changes are read (a read-only canvas has no others to apply); the same map
|
|
327
|
+
* comes back when nothing changed, so an unchanged measure does not re-render.
|
|
328
|
+
*/
|
|
329
|
+
function applyMeasurements(current, changes) {
|
|
330
|
+
let next = null;
|
|
331
|
+
for (const change of changes) {
|
|
332
|
+
if (change.type !== "dimensions" || !change.dimensions) continue;
|
|
333
|
+
const before = (next ?? current).get(change.id);
|
|
334
|
+
const { width, height } = change.dimensions;
|
|
335
|
+
if (before?.width === width && before.height === height) continue;
|
|
336
|
+
next ??= new Map(current);
|
|
337
|
+
next.set(change.id, {
|
|
338
|
+
width,
|
|
339
|
+
height
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
return next ?? current;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// src/builder/preview/preview-styles.ts
|
|
346
|
+
/**
|
|
347
|
+
* Motion for `WorkflowPreviewCanvas` (BOFF-9806), as one scoped stylesheet the
|
|
348
|
+
* canvas renders inline.
|
|
349
|
+
*
|
|
350
|
+
* Inline on purpose: host apps build Tailwind from their own sources plus a
|
|
351
|
+
* scan of this package, which does not generate novel keyframes or arbitrary
|
|
352
|
+
* animation utilities, and they may not load `styles.css`. Every colour is a
|
|
353
|
+
* semantic token (`--fgp-accent` is set per node / edge to a node-category
|
|
354
|
+
* token), so the motion follows light / dark mode and the brand.
|
|
355
|
+
*
|
|
356
|
+
* `prefers-reduced-motion: reduce` turns every animation off: nodes and edges
|
|
357
|
+
* appear in their final state at once, and the fresh / running highlights
|
|
358
|
+
* become a static ring and a static dashed overlay.
|
|
359
|
+
*/
|
|
360
|
+
const PREFIX = "fgp";
|
|
361
|
+
const PREVIEW_CLASS = {
|
|
362
|
+
root: `${PREFIX}-root`,
|
|
363
|
+
node: `${PREFIX}-node`,
|
|
364
|
+
ring: `${PREFIX}-ring`,
|
|
365
|
+
edgeTrack: `${PREFIX}-edge-track`,
|
|
366
|
+
edgeArrow: `${PREFIX}-edge-arrow`,
|
|
367
|
+
edgeFlow: `${PREFIX}-edge-flow`,
|
|
368
|
+
edgeDot: `${PREFIX}-edge-dot`
|
|
369
|
+
};
|
|
370
|
+
/** Node enter: fade + pop. */
|
|
371
|
+
const NODE_ENTER_MS = 260;
|
|
372
|
+
/** Edge enter: the path draws from source to target. */
|
|
373
|
+
const EDGE_DRAW_MS = 360;
|
|
374
|
+
/** Edge enter waits for its target's pop to start reading. */
|
|
375
|
+
const EDGE_DRAW_DELAY_MS = 90;
|
|
376
|
+
/** Camera move to take in a new node. */
|
|
377
|
+
const CAMERA_MS = 350;
|
|
378
|
+
const C = PREVIEW_CLASS;
|
|
379
|
+
const PREVIEW_STYLES = `
|
|
380
|
+
.${C.node} {
|
|
381
|
+
position: relative;
|
|
382
|
+
transform-origin: 50% 50%;
|
|
383
|
+
animation: ${PREFIX}-pop ${260}ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
|
|
384
|
+
}
|
|
385
|
+
@keyframes ${PREFIX}-pop {
|
|
386
|
+
from { opacity: 0; transform: scale(0.82) translateY(6px); }
|
|
387
|
+
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
388
|
+
}
|
|
389
|
+
.${C.ring} {
|
|
390
|
+
position: absolute;
|
|
391
|
+
inset: -6px;
|
|
392
|
+
border-radius: 18px;
|
|
393
|
+
pointer-events: none;
|
|
394
|
+
opacity: 0;
|
|
395
|
+
box-shadow:
|
|
396
|
+
0 0 0 2px var(--fgp-accent),
|
|
397
|
+
0 0 18px 4px color-mix(in srgb, var(--fgp-accent) 35%, transparent);
|
|
398
|
+
transition: opacity 600ms ease-out;
|
|
399
|
+
}
|
|
400
|
+
.${C.node}[data-fresh="true"] > .${C.ring} {
|
|
401
|
+
opacity: 1;
|
|
402
|
+
transition: opacity 120ms ease-out;
|
|
403
|
+
animation: ${PREFIX}-ring-in 700ms ease-out both;
|
|
404
|
+
}
|
|
405
|
+
@keyframes ${PREFIX}-ring-in {
|
|
406
|
+
0% { box-shadow: 0 0 0 0 var(--fgp-accent), 0 0 0 0 color-mix(in srgb, var(--fgp-accent) 55%, transparent); }
|
|
407
|
+
45% { box-shadow: 0 0 0 3px var(--fgp-accent), 0 0 0 12px color-mix(in srgb, var(--fgp-accent) 0%, transparent); }
|
|
408
|
+
100% { box-shadow: 0 0 0 2px var(--fgp-accent), 0 0 18px 4px color-mix(in srgb, var(--fgp-accent) 35%, transparent); }
|
|
409
|
+
}
|
|
410
|
+
.${C.node}[data-pulse="true"] > .${C.ring} {
|
|
411
|
+
opacity: 1;
|
|
412
|
+
animation: ${PREFIX}-pulse 1400ms ease-in-out infinite;
|
|
413
|
+
}
|
|
414
|
+
@keyframes ${PREFIX}-pulse {
|
|
415
|
+
0%, 100% { box-shadow: 0 0 0 2px var(--fgp-accent), 0 0 10px 2px color-mix(in srgb, var(--fgp-accent) 25%, transparent); }
|
|
416
|
+
50% { box-shadow: 0 0 0 2px var(--fgp-accent), 0 0 24px 8px color-mix(in srgb, var(--fgp-accent) 45%, transparent); }
|
|
417
|
+
}
|
|
418
|
+
.${C.edgeTrack} {
|
|
419
|
+
fill: none;
|
|
420
|
+
stroke: var(--fgp-accent);
|
|
421
|
+
stroke-width: 2;
|
|
422
|
+
stroke-opacity: 0.6;
|
|
423
|
+
stroke-dasharray: 1;
|
|
424
|
+
stroke-dashoffset: 0;
|
|
425
|
+
animation: ${PREFIX}-draw ${360}ms cubic-bezier(0.4, 0, 0.2, 1) ${90}ms both;
|
|
426
|
+
}
|
|
427
|
+
@keyframes ${PREFIX}-draw {
|
|
428
|
+
from { stroke-dashoffset: 1; }
|
|
429
|
+
to { stroke-dashoffset: 0; }
|
|
430
|
+
}
|
|
431
|
+
.${C.edgeArrow} {
|
|
432
|
+
animation: ${PREFIX}-fade 180ms ease-out 370ms both;
|
|
433
|
+
}
|
|
434
|
+
@keyframes ${PREFIX}-fade {
|
|
435
|
+
from { opacity: 0; }
|
|
436
|
+
to { opacity: 1; }
|
|
437
|
+
}
|
|
438
|
+
.${C.edgeFlow} {
|
|
439
|
+
fill: none;
|
|
440
|
+
stroke: var(--fgp-accent);
|
|
441
|
+
stroke-width: 2;
|
|
442
|
+
stroke-dasharray: 6 8;
|
|
443
|
+
pointer-events: none;
|
|
444
|
+
animation:
|
|
445
|
+
${PREFIX}-fade 200ms ease-out both,
|
|
446
|
+
${PREFIX}-march 550ms linear infinite;
|
|
447
|
+
}
|
|
448
|
+
@keyframes ${PREFIX}-march {
|
|
449
|
+
from { stroke-dashoffset: 0; }
|
|
450
|
+
to { stroke-dashoffset: -14; }
|
|
451
|
+
}
|
|
452
|
+
.${C.edgeDot} {
|
|
453
|
+
fill: var(--fgp-accent);
|
|
454
|
+
pointer-events: none;
|
|
455
|
+
filter: drop-shadow(0 0 3px color-mix(in srgb, var(--fgp-accent) 60%, transparent));
|
|
456
|
+
}
|
|
457
|
+
@media (prefers-reduced-motion: reduce) {
|
|
458
|
+
.${C.node},
|
|
459
|
+
.${C.node} > .${C.ring},
|
|
460
|
+
.${C.edgeTrack},
|
|
461
|
+
.${C.edgeArrow},
|
|
462
|
+
.${C.edgeFlow} {
|
|
463
|
+
animation: none !important;
|
|
464
|
+
transition: none !important;
|
|
465
|
+
}
|
|
466
|
+
.${C.edgeDot} { display: none; }
|
|
467
|
+
}
|
|
468
|
+
`;
|
|
469
|
+
|
|
470
|
+
// src/builder/preview/preview-node.tsx
|
|
471
|
+
/**
|
|
472
|
+
* One read-only node card of `WorkflowPreviewCanvas` (BOFF-9806).
|
|
473
|
+
*
|
|
474
|
+
* Draws with the builder's own card parts — `NodeCard` + `NodeCardHeader`
|
|
475
|
+
* (and the status line for a turned-off step) for app/action nodes, `LogicNodeCard` for internal
|
|
476
|
+
* control-flow nodes, and the builder's `InputHandles` / `OutputHandles`
|
|
477
|
+
* ports — so a preview node looks exactly like the same node on the builder
|
|
478
|
+
* canvas. No toolbar, rename or click handlers are passed, and the handles are
|
|
479
|
+
* not connectable, so nothing on the card can change the workflow.
|
|
480
|
+
*
|
|
481
|
+
* The enter pop, fresh ring and build pulse are CSS (see `preview-styles.ts`)
|
|
482
|
+
* keyed on the `data-*` attributes of the wrapper.
|
|
483
|
+
*/
|
|
484
|
+
function noop() {}
|
|
485
|
+
function CardBody({ id, card }) {
|
|
486
|
+
const fallbackName = useTr()("fluidgrids.builder.nodeCard.defaultAppName", "Node");
|
|
487
|
+
const title = card.title || fallbackName;
|
|
488
|
+
const offStatus = card.disabled ? nodeCardStatus({
|
|
489
|
+
executionStatus: "idle",
|
|
490
|
+
disabled: true,
|
|
491
|
+
missingConnection: false,
|
|
492
|
+
missingFields: []
|
|
493
|
+
}) : null;
|
|
494
|
+
if (card.variant === "logic") return /* @__PURE__ */ jsx(LogicNodeCard, {
|
|
495
|
+
nodeId: id,
|
|
496
|
+
title,
|
|
497
|
+
subtitle: card.subtitle,
|
|
498
|
+
icon: card.icon,
|
|
499
|
+
accent: card.accent,
|
|
500
|
+
selected: false,
|
|
501
|
+
status: offStatus ?? void 0,
|
|
502
|
+
isTrigger: card.trigger,
|
|
503
|
+
isExecuting: false,
|
|
504
|
+
inputHandles: card.inputHandles,
|
|
505
|
+
outputHandles: card.outputHandles,
|
|
506
|
+
isConnectable: false,
|
|
507
|
+
onDoubleClick: noop,
|
|
508
|
+
disabled: card.disabled
|
|
509
|
+
});
|
|
510
|
+
return /* @__PURE__ */ jsxs(NodeCard, {
|
|
511
|
+
isTrigger: card.trigger,
|
|
512
|
+
accent: card.accent,
|
|
513
|
+
disabled: card.disabled,
|
|
514
|
+
children: [
|
|
515
|
+
/* @__PURE__ */ jsx(NodeCardHeader, {
|
|
516
|
+
icon: card.icon,
|
|
517
|
+
appName: card.appName || fallbackName,
|
|
518
|
+
accentKey: card.accentKey,
|
|
519
|
+
operation: operationInPlainWords(card.operation),
|
|
520
|
+
label: title,
|
|
521
|
+
dimmed: card.disabled
|
|
522
|
+
}),
|
|
523
|
+
offStatus && /* @__PURE__ */ jsx(NodeCardStatusLine, {
|
|
524
|
+
status: offStatus,
|
|
525
|
+
appName: card.appName || fallbackName
|
|
526
|
+
}),
|
|
527
|
+
card.handleSpacer > 0 && /* @__PURE__ */ jsx("div", { style: { height: card.handleSpacer } }),
|
|
528
|
+
!card.trigger && /* @__PURE__ */ jsx(InputHandles, {
|
|
529
|
+
nodeId: id,
|
|
530
|
+
handles: card.inputHandles,
|
|
531
|
+
accent: card.accent,
|
|
532
|
+
isConnectable: false
|
|
533
|
+
}),
|
|
534
|
+
/* @__PURE__ */ jsx(OutputHandles, {
|
|
535
|
+
nodeId: id,
|
|
536
|
+
handles: card.outputHandles,
|
|
537
|
+
accent: card.accent,
|
|
538
|
+
isConnectable: false
|
|
539
|
+
})
|
|
540
|
+
]
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
function PreviewNodeComponent({ id, data }) {
|
|
544
|
+
const { card, fresh, pulse } = data;
|
|
545
|
+
const style = { "--fgp-accent": card.accent };
|
|
546
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
547
|
+
className: PREVIEW_CLASS.node,
|
|
548
|
+
"data-fresh": fresh ? "true" : "false",
|
|
549
|
+
"data-pulse": pulse ? "true" : "false",
|
|
550
|
+
"data-node-type": card.nodeType,
|
|
551
|
+
style,
|
|
552
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
553
|
+
"aria-hidden": true,
|
|
554
|
+
className: PREVIEW_CLASS.ring
|
|
555
|
+
}), /* @__PURE__ */ jsx(CardBody, {
|
|
556
|
+
id,
|
|
557
|
+
card
|
|
558
|
+
})]
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
const PreviewNode = memo(PreviewNodeComponent);
|
|
562
|
+
|
|
563
|
+
// src/builder/preview/preview-edge.tsx
|
|
564
|
+
/**
|
|
565
|
+
* One read-only edge of `WorkflowPreviewCanvas` (BOFF-9806).
|
|
566
|
+
*
|
|
567
|
+
* The same curved (bezier) path and source-role colour as the builder's edge:
|
|
568
|
+
* an edge reads as "coming from a trigger / logic / action node". On mount
|
|
569
|
+
* the path draws in from source to target and the arrowhead fades in at the
|
|
570
|
+
* end; while the build runs, dashes march along it and a dot travels from
|
|
571
|
+
* source to target. Purely visual: no hover actions, labels or conditions.
|
|
572
|
+
*/
|
|
573
|
+
/** Travel time of the flow dot from source to target. */
|
|
574
|
+
const DOT_TRAVEL_S = 1.6;
|
|
575
|
+
function PreviewEdgeComponent({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, markerEnd, data }) {
|
|
576
|
+
const [path] = getBezierPath({
|
|
577
|
+
sourceX,
|
|
578
|
+
sourceY,
|
|
579
|
+
sourcePosition,
|
|
580
|
+
targetX,
|
|
581
|
+
targetY,
|
|
582
|
+
targetPosition
|
|
583
|
+
});
|
|
584
|
+
const style = { "--fgp-accent": data?.accent ?? "var(--color-edge-default)" };
|
|
585
|
+
return /* @__PURE__ */ jsxs("g", {
|
|
586
|
+
style,
|
|
587
|
+
"data-testid": `workflow-preview-edge-${id}`,
|
|
588
|
+
children: [
|
|
589
|
+
/* @__PURE__ */ jsx("path", {
|
|
590
|
+
id,
|
|
591
|
+
d: path,
|
|
592
|
+
pathLength: 1,
|
|
593
|
+
className: PREVIEW_CLASS.edgeTrack
|
|
594
|
+
}),
|
|
595
|
+
/* @__PURE__ */ jsx("g", {
|
|
596
|
+
className: PREVIEW_CLASS.edgeArrow,
|
|
597
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
598
|
+
d: path,
|
|
599
|
+
fill: "none",
|
|
600
|
+
stroke: "transparent",
|
|
601
|
+
markerEnd
|
|
602
|
+
})
|
|
603
|
+
}),
|
|
604
|
+
data?.running && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("path", {
|
|
605
|
+
d: path,
|
|
606
|
+
className: PREVIEW_CLASS.edgeFlow
|
|
607
|
+
}), !data.reducedMotion && /* @__PURE__ */ jsx("circle", {
|
|
608
|
+
r: 3.5,
|
|
609
|
+
className: PREVIEW_CLASS.edgeDot,
|
|
610
|
+
children: /* @__PURE__ */ jsx("animateMotion", {
|
|
611
|
+
dur: `${DOT_TRAVEL_S}s`,
|
|
612
|
+
repeatCount: "indefinite",
|
|
613
|
+
path
|
|
614
|
+
})
|
|
615
|
+
})] })
|
|
616
|
+
]
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
const PreviewEdge = memo(PreviewEdgeComponent);
|
|
620
|
+
|
|
621
|
+
// src/builder/preview/use-prefers-reduced-motion.ts
|
|
622
|
+
const QUERY = "(prefers-reduced-motion: reduce)";
|
|
623
|
+
function mediaQuery() {
|
|
624
|
+
return typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia(QUERY) : null;
|
|
625
|
+
}
|
|
626
|
+
function subscribe(onChange) {
|
|
627
|
+
const query = mediaQuery();
|
|
628
|
+
if (!query) return () => {};
|
|
629
|
+
query.addEventListener("change", onChange);
|
|
630
|
+
return () => query.removeEventListener("change", onChange);
|
|
631
|
+
}
|
|
632
|
+
function snapshot() {
|
|
633
|
+
return mediaQuery()?.matches ?? false;
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* True while the viewer asks for reduced motion. CSS handles most of the
|
|
637
|
+
* preview's motion through the media query; this covers what CSS cannot
|
|
638
|
+
* reach (camera easing, SVG `animateMotion`).
|
|
639
|
+
*/
|
|
640
|
+
function usePrefersReducedMotion() {
|
|
641
|
+
return useSyncExternalStore(subscribe, snapshot, () => false);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
// src/builder/preview/workflow-preview-canvas.tsx
|
|
645
|
+
/**
|
|
646
|
+
* `WorkflowPreviewCanvas` (BOFF-9806): a self-contained, read-only canvas of a
|
|
647
|
+
* stored workflow definition, drawn with the builder's own node cards, with
|
|
648
|
+
* build animations for a workflow taking shape live.
|
|
649
|
+
*
|
|
650
|
+
* Self-contained: it needs no `FluidGridsProvider`, config, Apollo client,
|
|
651
|
+
* node registry or builder store to be set up, and makes no network request
|
|
652
|
+
* of its own (node icons are Iconify names, which Iconify resolves as the
|
|
653
|
+
* builder canvas does). It owns its `ReactFlowProvider`.
|
|
654
|
+
*
|
|
655
|
+
* Read-only: nodes cannot be dragged, connected, selected or deleted; the
|
|
656
|
+
* viewer can pan and zoom.
|
|
657
|
+
*
|
|
658
|
+
* Reveal sequencing stays with the host. The host decides which nodes are on
|
|
659
|
+
* screen (`visibleNodeIds`) and which just arrived (`freshNodeIds`); the
|
|
660
|
+
* canvas animates whatever changes:
|
|
661
|
+
* - a node that becomes visible fades and pops in;
|
|
662
|
+
* - a fresh node carries a glowing ring (it fades out when the id leaves
|
|
663
|
+
* `freshNodeIds`);
|
|
664
|
+
* - an edge appears once both ends are visible and draws in from source to
|
|
665
|
+
* target;
|
|
666
|
+
* - while `running`, dashes and a dot flow along every edge and the newest
|
|
667
|
+
* node pulses;
|
|
668
|
+
* - the camera eases to take in each newly visible node (maxZoom 1.5).
|
|
669
|
+
* `previewRevealOrder` gives the along-the-flow order a host can reveal in.
|
|
670
|
+
* With `prefers-reduced-motion: reduce` every state applies at once, with no
|
|
671
|
+
* motion.
|
|
672
|
+
*/
|
|
673
|
+
const NODE_TYPES = { [PREVIEW_NODE_TYPE]: PreviewNode };
|
|
674
|
+
const EDGE_TYPES = { [PREVIEW_EDGE_TYPE]: PreviewEdge };
|
|
675
|
+
const MIN_ZOOM = .1;
|
|
676
|
+
const DEFAULT_MAX_ZOOM = 1.5;
|
|
677
|
+
const DEFAULT_PADDING = .25;
|
|
678
|
+
const KEY_SEPARATOR = "\0";
|
|
679
|
+
/** A stable key for a set of ids, so re-created arrays do not re-run effects. */
|
|
680
|
+
function idsKey(ids) {
|
|
681
|
+
return [...new Set(ids)].sort().join(KEY_SEPARATOR);
|
|
682
|
+
}
|
|
683
|
+
/** The id set a key stands for (node ids are never empty). */
|
|
684
|
+
function idsFromKey(key) {
|
|
685
|
+
return new Set(key.split(KEY_SEPARATOR).filter(Boolean));
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Eases the camera to take in every visible node whenever the visible set
|
|
689
|
+
* changes, once the new nodes are measured.
|
|
690
|
+
*/
|
|
691
|
+
function CameraFollow({ visibleIds, visibleKey, padding, maxZoom, reducedMotion }) {
|
|
692
|
+
const { fitView } = useReactFlow();
|
|
693
|
+
const initialized = useStore((state) => visibleIds.every((id) => {
|
|
694
|
+
const node = state.nodeLookup.get(id);
|
|
695
|
+
return node?.measured.width !== void 0 && node.measured.height !== void 0 && node.internals.handleBounds !== void 0;
|
|
696
|
+
}));
|
|
697
|
+
const fittedKey = useRef(null);
|
|
698
|
+
useEffect(() => {
|
|
699
|
+
if (!initialized || visibleIds.length === 0) return;
|
|
700
|
+
if (fittedKey.current === visibleKey) return;
|
|
701
|
+
const duration = reducedMotion || fittedKey.current === null ? 0 : 350;
|
|
702
|
+
const frame = requestAnimationFrame(() => {
|
|
703
|
+
fittedKey.current = visibleKey;
|
|
704
|
+
fitView({
|
|
705
|
+
nodes: visibleIds.map((id) => ({ id })),
|
|
706
|
+
padding,
|
|
707
|
+
maxZoom,
|
|
708
|
+
minZoom: MIN_ZOOM,
|
|
709
|
+
duration
|
|
710
|
+
});
|
|
711
|
+
});
|
|
712
|
+
return () => cancelAnimationFrame(frame);
|
|
713
|
+
}, [
|
|
714
|
+
initialized,
|
|
715
|
+
visibleIds,
|
|
716
|
+
visibleKey,
|
|
717
|
+
padding,
|
|
718
|
+
maxZoom,
|
|
719
|
+
reducedMotion,
|
|
720
|
+
fitView
|
|
721
|
+
]);
|
|
722
|
+
return null;
|
|
723
|
+
}
|
|
724
|
+
function PreviewFlow({ model, visibleNodeIds, freshNodeIds, running, maxZoom, fitPadding, ariaLabel }) {
|
|
725
|
+
const reducedMotion = usePrefersReducedMotion();
|
|
726
|
+
const order = useMemo(() => previewRevealOrder(model.nodes), [model]);
|
|
727
|
+
const visible = useMemo(() => {
|
|
728
|
+
const known = new Set(order);
|
|
729
|
+
if (!visibleNodeIds) return known;
|
|
730
|
+
return new Set([...visibleNodeIds].filter((id) => known.has(id)));
|
|
731
|
+
}, [order, visibleNodeIds]);
|
|
732
|
+
const visibleKey = idsKey(visible);
|
|
733
|
+
const visibleIds = useMemo(() => order.filter((id) => visible.has(id)), [order, visible]);
|
|
734
|
+
const [track, setTrack] = useState(() => ({
|
|
735
|
+
key: visibleKey,
|
|
736
|
+
visible,
|
|
737
|
+
newest: newestNodeId(/* @__PURE__ */ new Set(), visible, order, null)
|
|
738
|
+
}));
|
|
739
|
+
if (track.key !== visibleKey) setTrack({
|
|
740
|
+
key: visibleKey,
|
|
741
|
+
visible,
|
|
742
|
+
newest: newestNodeId(track.visible, visible, order, track.newest)
|
|
743
|
+
});
|
|
744
|
+
const newest = track.key === visibleKey ? track.newest : null;
|
|
745
|
+
const [measured, setMeasured] = useState(() => /* @__PURE__ */ new Map());
|
|
746
|
+
const onNodesChange = useCallback((changes) => {
|
|
747
|
+
setMeasured((current) => applyMeasurements(current, changes));
|
|
748
|
+
}, []);
|
|
749
|
+
const nodes = useMemo(() => model.nodes.filter((node) => visible.has(node.id)).map((node) => ({
|
|
750
|
+
...node,
|
|
751
|
+
measured: measured.get(node.id),
|
|
752
|
+
data: {
|
|
753
|
+
card: node.data.card,
|
|
754
|
+
fresh: freshNodeIds.has(node.id),
|
|
755
|
+
pulse: running && node.id === newest
|
|
756
|
+
}
|
|
757
|
+
})), [
|
|
758
|
+
model,
|
|
759
|
+
visible,
|
|
760
|
+
measured,
|
|
761
|
+
freshNodeIds,
|
|
762
|
+
running,
|
|
763
|
+
newest
|
|
764
|
+
]);
|
|
765
|
+
const accents = useMemo(() => new Map(model.nodes.map((node) => [node.id, node.data.card.accent])), [model]);
|
|
766
|
+
const edges = useMemo(() => edgesBetweenVisible(model.edges, visible).map((edge) => ({
|
|
767
|
+
...edge,
|
|
768
|
+
type: "preview",
|
|
769
|
+
markerEnd: {
|
|
770
|
+
type: MarkerType.ArrowClosed,
|
|
771
|
+
width: 18,
|
|
772
|
+
height: 18,
|
|
773
|
+
color: "var(--color-edge-default)"
|
|
774
|
+
},
|
|
775
|
+
data: {
|
|
776
|
+
accent: accents.get(edge.source) ?? "var(--color-edge-default)",
|
|
777
|
+
running,
|
|
778
|
+
reducedMotion
|
|
779
|
+
}
|
|
780
|
+
})), [
|
|
781
|
+
model,
|
|
782
|
+
visible,
|
|
783
|
+
accents,
|
|
784
|
+
running,
|
|
785
|
+
reducedMotion
|
|
786
|
+
]);
|
|
787
|
+
return /* @__PURE__ */ jsxs(ReactFlow, {
|
|
788
|
+
"aria-label": ariaLabel,
|
|
789
|
+
nodes,
|
|
790
|
+
onNodesChange,
|
|
791
|
+
edges,
|
|
792
|
+
nodeTypes: NODE_TYPES,
|
|
793
|
+
edgeTypes: EDGE_TYPES,
|
|
794
|
+
nodesDraggable: false,
|
|
795
|
+
nodesConnectable: false,
|
|
796
|
+
nodesFocusable: false,
|
|
797
|
+
edgesFocusable: false,
|
|
798
|
+
elementsSelectable: false,
|
|
799
|
+
zoomOnDoubleClick: false,
|
|
800
|
+
deleteKeyCode: null,
|
|
801
|
+
selectionKeyCode: null,
|
|
802
|
+
multiSelectionKeyCode: null,
|
|
803
|
+
minZoom: MIN_ZOOM,
|
|
804
|
+
maxZoom,
|
|
805
|
+
fitView: true,
|
|
806
|
+
fitViewOptions: {
|
|
807
|
+
padding: fitPadding,
|
|
808
|
+
maxZoom
|
|
809
|
+
},
|
|
810
|
+
proOptions: { hideAttribution: true },
|
|
811
|
+
style: { background: "var(--color-canvas-bg)" },
|
|
812
|
+
children: [/* @__PURE__ */ jsx(Background, {
|
|
813
|
+
gap: 24,
|
|
814
|
+
color: "var(--color-canvas-grid)"
|
|
815
|
+
}), /* @__PURE__ */ jsx(CameraFollow, {
|
|
816
|
+
visibleIds,
|
|
817
|
+
visibleKey,
|
|
818
|
+
padding: fitPadding,
|
|
819
|
+
maxZoom,
|
|
820
|
+
reducedMotion
|
|
821
|
+
})]
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
function WorkflowPreviewCanvasComponent({ definition, visibleNodeIds, freshNodeIds, running = false, resolveNodeMeta, maxZoom = DEFAULT_MAX_ZOOM, fitPadding = DEFAULT_PADDING, emptyState = null, ariaLabel, className, style }) {
|
|
825
|
+
const model = useMemo(() => previewCanvasFromDefinition(definition, resolveNodeMeta), [definition, resolveNodeMeta]);
|
|
826
|
+
const visibleKey = visibleNodeIds ? idsKey(visibleNodeIds) : null;
|
|
827
|
+
const freshKey = idsKey(freshNodeIds ?? []);
|
|
828
|
+
const stableVisible = useMemo(() => visibleKey === null ? null : idsFromKey(visibleKey), [visibleKey]);
|
|
829
|
+
const stableFresh = useMemo(() => idsFromKey(freshKey), [freshKey]);
|
|
830
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
831
|
+
className: cn(PREVIEW_CLASS.root, "relative h-full w-full", className),
|
|
832
|
+
style,
|
|
833
|
+
"data-testid": "workflow-preview-canvas",
|
|
834
|
+
"data-running": running ? "true" : "false",
|
|
835
|
+
children: [/* @__PURE__ */ jsx("style", { children: PREVIEW_STYLES }), model ? /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(PreviewFlow, {
|
|
836
|
+
model,
|
|
837
|
+
visibleNodeIds: stableVisible,
|
|
838
|
+
freshNodeIds: stableFresh,
|
|
839
|
+
running,
|
|
840
|
+
maxZoom,
|
|
841
|
+
fitPadding,
|
|
842
|
+
ariaLabel
|
|
843
|
+
}) }) : emptyState]
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
const WorkflowPreviewCanvas = memo(WorkflowPreviewCanvasComponent);
|
|
847
|
+
|
|
848
|
+
export { edgesBetweenVisible as a, newestNodeId as c, previewRevealOrder as d, NODE_ENTER_MS as i, previewCanvasFromDefinition as l, CAMERA_MS as n, fallbackNodeIcon as o, EDGE_DRAW_MS as r, humanizeNodeType as s, WorkflowPreviewCanvas as t, previewCardModel as u };
|