@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,451 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as Icon } from "./Icon-BtQ0HXLh.js";
|
|
3
|
+
import { t as NodeTypeIcon } from "./node-type-icon-BZa8n4iG.js";
|
|
4
|
+
import { M as nodeAccent, U as useFlowStore } from "./node-operation-selection-CdV3KI_V.js";
|
|
5
|
+
import { R as nodeSubtitle, U as useNodeConfig, cn as useNodeExecution, er as getNodeDetail, z as nodeTitle } from "./use-bare-node-registry-O6mKJO_n.js";
|
|
6
|
+
import { i as NodeInputFields, n as useNodeEditorTab, r as NodeEditorTabs, t as NodeEditorTabBody } from "./node-editor-tab-body-CZ0fVuVP.js";
|
|
7
|
+
import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
|
|
8
|
+
import { r as NodeExecutionActions } from "./schedule-panel-B4GYXzXQ.js";
|
|
9
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
import { useReactFlow, useStoreApi } from "@xyflow/react";
|
|
12
|
+
|
|
13
|
+
// src/builder/components/quick-config/quick-config-placement.ts
|
|
14
|
+
const PANEL_WIDTH = 380;
|
|
15
|
+
const MAPPER_WIDTH = 260;
|
|
16
|
+
const VIEWPORT_MARGIN = 12;
|
|
17
|
+
/** Gap between the node and the attached panel. */
|
|
18
|
+
const NODE_GAP = 14;
|
|
19
|
+
/** Gap between the panel and its input-mapper flyout. */
|
|
20
|
+
const MAPPER_GAP = 10;
|
|
21
|
+
const clamp = (v, lo, hi) => Math.min(Math.max(v, lo), Math.max(lo, hi));
|
|
22
|
+
/**
|
|
23
|
+
* The panel's width on a screen `viewportWidth` px wide: 380 px, or the
|
|
24
|
+
* screen less its margins when that is narrower (BOFF-18043: on a 360 px
|
|
25
|
+
* phone the fixed 380 px panel ran 32 px off the right edge, Close included).
|
|
26
|
+
*/
|
|
27
|
+
function panelWidthFor(viewportWidth) {
|
|
28
|
+
return Math.max(0, Math.min(380, viewportWidth - 24));
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The input-mapper flyout prefers the LEFT of the panel and falls back to the
|
|
32
|
+
* right only when the left placement would run off the left edge. Always
|
|
33
|
+
* clamped so it never leaves the viewport.
|
|
34
|
+
*/
|
|
35
|
+
function mapperCoords(panelLeft, panelTop, panelWidth, viewport) {
|
|
36
|
+
const leftPlacement = panelLeft - 10 - 260;
|
|
37
|
+
const rightPlacement = panelLeft + panelWidth + 10;
|
|
38
|
+
return {
|
|
39
|
+
mapperLeft: clamp(leftPlacement >= 12 ? leftPlacement : rightPlacement, 12, viewport.width - 260 - 12),
|
|
40
|
+
mapperTop: panelTop
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Attach the panel on whichever side of the node has room, vertically centred
|
|
45
|
+
* on the node and clamped inside the viewport, with a thin connector from the
|
|
46
|
+
* node edge to the panel edge. Without a measured node it centres the panel
|
|
47
|
+
* near the top of the viewport.
|
|
48
|
+
*/
|
|
49
|
+
function computeQuickConfigPlacement(nodeRect, panelHeight, viewport) {
|
|
50
|
+
const width = panelWidthFor(viewport.width);
|
|
51
|
+
if (!nodeRect) {
|
|
52
|
+
const left = viewport.width / 2 - width / 2;
|
|
53
|
+
const top = viewport.height / 4;
|
|
54
|
+
return {
|
|
55
|
+
side: "right",
|
|
56
|
+
width,
|
|
57
|
+
left,
|
|
58
|
+
top,
|
|
59
|
+
connectorLeft: 0,
|
|
60
|
+
connectorWidth: 0,
|
|
61
|
+
connectorTop: 0,
|
|
62
|
+
hasConnector: false,
|
|
63
|
+
...mapperCoords(left, top, width, viewport)
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const need = width + 14 + 12;
|
|
67
|
+
const spaceRight = viewport.width - nodeRect.right;
|
|
68
|
+
const spaceLeft = nodeRect.left;
|
|
69
|
+
const side = spaceRight >= need ? "right" : spaceLeft >= need ? "left" : spaceRight >= spaceLeft ? "right" : "left";
|
|
70
|
+
const rawLeft = side === "right" ? nodeRect.right + 14 : nodeRect.left - 14 - width;
|
|
71
|
+
const left = clamp(rawLeft, 12, viewport.width - width - 12);
|
|
72
|
+
const top = clamp(nodeRect.cy - panelHeight / 2, 12, viewport.height - panelHeight - 12);
|
|
73
|
+
const connectorTop = clamp(nodeRect.cy, top + 6, top + panelHeight - 6);
|
|
74
|
+
const connectorLeft = side === "right" ? nodeRect.right : left + width;
|
|
75
|
+
const connectorWidth = Math.max(0, side === "right" ? left - nodeRect.right : nodeRect.left - (left + width));
|
|
76
|
+
return {
|
|
77
|
+
side,
|
|
78
|
+
width,
|
|
79
|
+
left,
|
|
80
|
+
top,
|
|
81
|
+
connectorLeft,
|
|
82
|
+
connectorWidth,
|
|
83
|
+
connectorTop,
|
|
84
|
+
hasConnector: connectorWidth > 1,
|
|
85
|
+
...mapperCoords(left, top, width, viewport)
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Client-space rect of a node, read from React Flow's store at this moment.
|
|
90
|
+
* Conversion to client coords uses `flowToScreenPosition`, which also accounts
|
|
91
|
+
* for the canvas container's offset from the window.
|
|
92
|
+
*/
|
|
93
|
+
function readNodeScreenRect(state, nodeId, flowToScreenPosition) {
|
|
94
|
+
const n = state.nodeLookup.get(nodeId);
|
|
95
|
+
if (!n) return null;
|
|
96
|
+
const p = n.internals?.positionAbsolute ?? n.position;
|
|
97
|
+
const w = n.measured?.width ?? n.width ?? 288;
|
|
98
|
+
const h = n.measured?.height ?? n.height ?? 120;
|
|
99
|
+
const tl = flowToScreenPosition({
|
|
100
|
+
x: p.x,
|
|
101
|
+
y: p.y
|
|
102
|
+
});
|
|
103
|
+
const br = flowToScreenPosition({
|
|
104
|
+
x: p.x + w,
|
|
105
|
+
y: p.y + h
|
|
106
|
+
});
|
|
107
|
+
return {
|
|
108
|
+
left: tl.x,
|
|
109
|
+
top: tl.y,
|
|
110
|
+
right: br.x,
|
|
111
|
+
bottom: br.y,
|
|
112
|
+
cy: (tl.y + br.y) / 2
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/** Write a placement onto the panel, the mapper flyout and the connector. */
|
|
116
|
+
function applyQuickConfigPlacement(elements, placement) {
|
|
117
|
+
const { panel, mapper, connector } = elements;
|
|
118
|
+
if (panel) {
|
|
119
|
+
panel.style.left = `${placement.left}px`;
|
|
120
|
+
panel.style.top = `${placement.top}px`;
|
|
121
|
+
panel.style.width = `${placement.width}px`;
|
|
122
|
+
}
|
|
123
|
+
if (mapper) {
|
|
124
|
+
mapper.style.left = `${placement.mapperLeft}px`;
|
|
125
|
+
mapper.style.top = `${placement.mapperTop}px`;
|
|
126
|
+
}
|
|
127
|
+
if (connector) {
|
|
128
|
+
connector.style.display = placement.hasConnector ? "" : "none";
|
|
129
|
+
connector.style.left = `${placement.connectorLeft}px`;
|
|
130
|
+
connector.style.top = `${placement.connectorTop - 1}px`;
|
|
131
|
+
connector.style.width = `${placement.connectorWidth}px`;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/** Whether two placements put every element in the same place. */
|
|
135
|
+
const samePlacement = (a, b) => a.width === b.width && a.left === b.left && a.top === b.top && a.mapperLeft === b.mapperLeft && a.mapperTop === b.mapperTop && a.hasConnector === b.hasConnector && a.connectorLeft === b.connectorLeft && a.connectorTop === b.connectorTop && a.connectorWidth === b.connectorWidth;
|
|
136
|
+
|
|
137
|
+
// src/builder/components/quick-config/quick-config-panel.tsx
|
|
138
|
+
/**
|
|
139
|
+
* The panel's placement beside its node, kept up to date on drag, pan and
|
|
140
|
+
* zoom without re-rendering the panel (BOFF-17281).
|
|
141
|
+
*
|
|
142
|
+
* The panel used to select the viewport transform from React Flow's store, so
|
|
143
|
+
* every pan or zoom frame re-rendered the whole parameters form. Now the render
|
|
144
|
+
* reads the placement once, and a store subscription moves the elements
|
|
145
|
+
* directly while the panel is open.
|
|
146
|
+
*/
|
|
147
|
+
function useNodeAnchoredPlacement(nodeId, panelHeight, elements) {
|
|
148
|
+
const store = useStoreApi();
|
|
149
|
+
const { flowToScreenPosition } = useReactFlow();
|
|
150
|
+
const compute = useCallback(() => computeQuickConfigPlacement(readNodeScreenRect(store.getState(), nodeId, flowToScreenPosition), panelHeight, {
|
|
151
|
+
width: window.innerWidth,
|
|
152
|
+
height: window.innerHeight
|
|
153
|
+
}), [
|
|
154
|
+
store,
|
|
155
|
+
nodeId,
|
|
156
|
+
flowToScreenPosition,
|
|
157
|
+
panelHeight
|
|
158
|
+
]);
|
|
159
|
+
const [placement, setPlacement] = useState(compute);
|
|
160
|
+
useLayoutEffect(() => {
|
|
161
|
+
let last = compute();
|
|
162
|
+
setPlacement((current) => samePlacement(current, last) ? current : last);
|
|
163
|
+
applyQuickConfigPlacement(elements.current, last);
|
|
164
|
+
return store.subscribe(() => {
|
|
165
|
+
const next = compute();
|
|
166
|
+
if (samePlacement(last, next)) return;
|
|
167
|
+
last = next;
|
|
168
|
+
applyQuickConfigPlacement(elements.current, next);
|
|
169
|
+
});
|
|
170
|
+
}, [
|
|
171
|
+
compute,
|
|
172
|
+
elements,
|
|
173
|
+
store
|
|
174
|
+
]);
|
|
175
|
+
return {
|
|
176
|
+
placement,
|
|
177
|
+
place: useCallback(() => applyQuickConfigPlacement(elements.current, compute()), [compute, elements])
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Single-click node-config panel (Make-style) attached beside its node.
|
|
182
|
+
*
|
|
183
|
+
* The NDV's editor in a compact card: the same Parameters / Settings tabs
|
|
184
|
+
* (and Schedule for a Schedule Trigger, BOFF-11325), the shared
|
|
185
|
+
* `NodeParamsForm` and write-through semantics, with the input-data mapper as
|
|
186
|
+
* a flyout. The panel is anchored to the node: it follows the node on drag /
|
|
187
|
+
* pan / zoom and opens on whichever side has room (a node in the right corner
|
|
188
|
+
* gets the panel on its left). Double-click (or the expand button) still opens
|
|
189
|
+
* the full 3-pane NDV.
|
|
190
|
+
*/
|
|
191
|
+
function QuickConfigPanel() {
|
|
192
|
+
const quickConfig = useFlowStore((s) => s.workflow.quickConfig);
|
|
193
|
+
if (!quickConfig) return null;
|
|
194
|
+
return /* @__PURE__ */ jsx(QuickConfigPanelInner, {
|
|
195
|
+
nodeId: quickConfig.nodeId,
|
|
196
|
+
type: quickConfig.type
|
|
197
|
+
}, quickConfig.nodeId);
|
|
198
|
+
}
|
|
199
|
+
/** Measures an element's height and follows its size changes. */
|
|
200
|
+
function useMeasuredHeight(fallback) {
|
|
201
|
+
const ref = useRef(null);
|
|
202
|
+
const [height, setHeight] = useState(fallback);
|
|
203
|
+
useLayoutEffect(() => {
|
|
204
|
+
const el = ref.current;
|
|
205
|
+
if (!el) return;
|
|
206
|
+
const measure = () => setHeight(el.offsetHeight);
|
|
207
|
+
measure();
|
|
208
|
+
const ro = new ResizeObserver(measure);
|
|
209
|
+
ro.observe(el);
|
|
210
|
+
return () => ro.disconnect();
|
|
211
|
+
}, []);
|
|
212
|
+
return {
|
|
213
|
+
ref,
|
|
214
|
+
height
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function QuickConfigPanelInner({ nodeId, type }) {
|
|
218
|
+
const close = useFlowStore((s) => s.actions.quickConfig.close);
|
|
219
|
+
const tr = useTr();
|
|
220
|
+
const config = useNodeConfig({
|
|
221
|
+
nodeId,
|
|
222
|
+
type
|
|
223
|
+
});
|
|
224
|
+
const { node, nodes, sourceIds } = config;
|
|
225
|
+
const [showMapper, setShowMapper] = useState(false);
|
|
226
|
+
const { tab, setTab, hasSchedule } = useNodeEditorTab(node?.type);
|
|
227
|
+
const { ref: cardRef, height: panelH } = useMeasuredHeight(480);
|
|
228
|
+
const placed = useRef({
|
|
229
|
+
panel: null,
|
|
230
|
+
mapper: null,
|
|
231
|
+
connector: null
|
|
232
|
+
});
|
|
233
|
+
const { placement, place } = useNodeAnchoredPlacement(nodeId, panelH, placed);
|
|
234
|
+
useEffect(() => {
|
|
235
|
+
const onKey = (e) => {
|
|
236
|
+
if (e.key === "Escape") close();
|
|
237
|
+
};
|
|
238
|
+
window.addEventListener("keydown", onKey);
|
|
239
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
240
|
+
}, [close]);
|
|
241
|
+
useEffect(() => {
|
|
242
|
+
if (!nodes.some((n) => n.id === nodeId)) close();
|
|
243
|
+
}, [
|
|
244
|
+
nodes,
|
|
245
|
+
nodeId,
|
|
246
|
+
close
|
|
247
|
+
]);
|
|
248
|
+
if (!node) return null;
|
|
249
|
+
const accent = nodeAccent(node.type || getNodeDetail(node.type).title);
|
|
250
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
251
|
+
/* @__PURE__ */ jsx("div", {
|
|
252
|
+
ref: (el) => {
|
|
253
|
+
placed.current.connector = el;
|
|
254
|
+
},
|
|
255
|
+
"aria-hidden": true,
|
|
256
|
+
"data-testid": "quick-config-connector",
|
|
257
|
+
className: "pointer-events-none fixed",
|
|
258
|
+
style: {
|
|
259
|
+
display: placement.hasConnector ? void 0 : "none",
|
|
260
|
+
left: placement.connectorLeft,
|
|
261
|
+
top: placement.connectorTop - 1,
|
|
262
|
+
width: placement.connectorWidth,
|
|
263
|
+
height: 2,
|
|
264
|
+
background: accent,
|
|
265
|
+
opacity: .55,
|
|
266
|
+
zIndex: 299
|
|
267
|
+
}
|
|
268
|
+
}),
|
|
269
|
+
showMapper && /* @__PURE__ */ jsx("div", {
|
|
270
|
+
ref: (el) => {
|
|
271
|
+
placed.current.mapper = el;
|
|
272
|
+
if (el) place();
|
|
273
|
+
},
|
|
274
|
+
className: "fixed overflow-hidden rounded-xl border border-border bg-card shadow-xl",
|
|
275
|
+
style: {
|
|
276
|
+
left: placement.mapperLeft,
|
|
277
|
+
top: placement.mapperTop,
|
|
278
|
+
width: 260,
|
|
279
|
+
maxHeight: "min(60vh, 480px)",
|
|
280
|
+
zIndex: 301,
|
|
281
|
+
display: "flex",
|
|
282
|
+
flexDirection: "column"
|
|
283
|
+
},
|
|
284
|
+
"data-testid": "quick-config-mapper",
|
|
285
|
+
children: /* @__PURE__ */ jsx(NodeInputFields, {
|
|
286
|
+
config,
|
|
287
|
+
testIdPrefix: "qc"
|
|
288
|
+
})
|
|
289
|
+
}),
|
|
290
|
+
/* @__PURE__ */ jsx("div", {
|
|
291
|
+
ref: (el) => {
|
|
292
|
+
placed.current.panel = el;
|
|
293
|
+
},
|
|
294
|
+
className: "fixed",
|
|
295
|
+
style: {
|
|
296
|
+
left: placement.left,
|
|
297
|
+
top: placement.top,
|
|
298
|
+
zIndex: 300,
|
|
299
|
+
width: placement.width
|
|
300
|
+
},
|
|
301
|
+
"data-testid": "quick-config-panel",
|
|
302
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
303
|
+
ref: cardRef,
|
|
304
|
+
className: "flex flex-col overflow-hidden rounded-xl border border-border bg-card shadow-2xl animate-in fade-in zoom-in-95 duration-150",
|
|
305
|
+
style: {
|
|
306
|
+
maxHeight: "min(70vh, 560px)",
|
|
307
|
+
borderTop: `3px solid ${accent}`
|
|
308
|
+
},
|
|
309
|
+
children: [
|
|
310
|
+
/* @__PURE__ */ jsx(QuickConfigHeader, {
|
|
311
|
+
config,
|
|
312
|
+
nodeId,
|
|
313
|
+
type,
|
|
314
|
+
accent,
|
|
315
|
+
showMapper,
|
|
316
|
+
onToggleMapper: () => setShowMapper((v) => !v),
|
|
317
|
+
onClose: close
|
|
318
|
+
}),
|
|
319
|
+
/* @__PURE__ */ jsx(NodeEditorTabs, {
|
|
320
|
+
active: tab,
|
|
321
|
+
onChange: setTab,
|
|
322
|
+
hasSchedule,
|
|
323
|
+
testIdPrefix: "qc"
|
|
324
|
+
}),
|
|
325
|
+
/* @__PURE__ */ jsx("div", {
|
|
326
|
+
className: "min-h-0 flex-1 overflow-auto",
|
|
327
|
+
onFocusCapture: (e) => {
|
|
328
|
+
const tag = e.target.tagName;
|
|
329
|
+
if (tab === "parameters" && sourceIds.length > 0 && (tag === "INPUT" || tag === "SELECT" || tag === "TEXTAREA")) setShowMapper(true);
|
|
330
|
+
},
|
|
331
|
+
children: /* @__PURE__ */ jsx(NodeEditorTabBody, {
|
|
332
|
+
tab,
|
|
333
|
+
config,
|
|
334
|
+
nodeId,
|
|
335
|
+
testIdPrefix: "qc"
|
|
336
|
+
})
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ jsx(QuickConfigRunActions, { nodeId }),
|
|
339
|
+
/* @__PURE__ */ jsx("p", {
|
|
340
|
+
className: "shrink-0 border-t border-border px-3 py-1.5 text-[10px] leading-snug text-muted-foreground",
|
|
341
|
+
children: tr("fluidgrids.builder.quickConfigPanel.footerHint", "Changes apply instantly · double-click the node for the full editor")
|
|
342
|
+
})
|
|
343
|
+
]
|
|
344
|
+
})
|
|
345
|
+
})
|
|
346
|
+
] });
|
|
347
|
+
}
|
|
348
|
+
/** The node, plus the mapper toggle, the switch to the full NDV and close. */
|
|
349
|
+
function QuickConfigHeader({ config, nodeId, type, accent, showMapper, onToggleMapper, onClose }) {
|
|
350
|
+
const tr = useTr();
|
|
351
|
+
const openNdv = useFlowStore((s) => s.actions.ndv.open);
|
|
352
|
+
const meta = getNodeDetail(config.node?.type);
|
|
353
|
+
const subtitle = nodeSubtitle(config.node);
|
|
354
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
355
|
+
className: "flex shrink-0 items-center gap-2.5 border-b border-border px-3 py-2.5 select-none",
|
|
356
|
+
children: [
|
|
357
|
+
/* @__PURE__ */ jsx("div", {
|
|
358
|
+
className: "flex size-7 shrink-0 items-center justify-center rounded-lg",
|
|
359
|
+
style: {
|
|
360
|
+
backgroundColor: `color-mix(in srgb, ${accent} 13%, transparent)`,
|
|
361
|
+
color: accent,
|
|
362
|
+
border: `1px solid color-mix(in srgb, ${accent} 26%, transparent)`
|
|
363
|
+
},
|
|
364
|
+
children: /* @__PURE__ */ jsx(NodeTypeIcon, {
|
|
365
|
+
icon: meta.icon,
|
|
366
|
+
className: "size-4"
|
|
367
|
+
})
|
|
368
|
+
}),
|
|
369
|
+
/* @__PURE__ */ jsxs("div", {
|
|
370
|
+
className: "min-w-0 flex-1",
|
|
371
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
372
|
+
className: "truncate text-sm font-semibold leading-tight text-foreground",
|
|
373
|
+
children: nodeTitle(config.node)
|
|
374
|
+
}), subtitle && /* @__PURE__ */ jsx("p", {
|
|
375
|
+
className: "truncate font-mono text-[11px] leading-tight text-muted-foreground",
|
|
376
|
+
children: subtitle
|
|
377
|
+
})]
|
|
378
|
+
}),
|
|
379
|
+
/* @__PURE__ */ jsx("button", {
|
|
380
|
+
type: "button",
|
|
381
|
+
title: showMapper ? tr("fluidgrids.builder.quickConfigPanel.hideInputDataTooltip", "Hide input data") : tr("fluidgrids.builder.quickConfigPanel.mapInputDataTooltip", "Map data from input"),
|
|
382
|
+
"aria-label": tr("fluidgrids.builder.quickConfigPanel.toggleMapperAriaLabel", "Toggle input mapper"),
|
|
383
|
+
onClick: onToggleMapper,
|
|
384
|
+
className: `rounded-md p-1.5 transition-colors hover:bg-muted ${showMapper ? "text-primary" : "text-muted-foreground"} hover:text-foreground`,
|
|
385
|
+
"data-testid": "qc-toggle-mapper",
|
|
386
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
387
|
+
icon: "mdi:tray-arrow-down",
|
|
388
|
+
className: "size-4"
|
|
389
|
+
})
|
|
390
|
+
}),
|
|
391
|
+
/* @__PURE__ */ jsx("button", {
|
|
392
|
+
type: "button",
|
|
393
|
+
title: tr("fluidgrids.builder.quickConfigPanel.openFullEditorTooltip", "Open full editor"),
|
|
394
|
+
"aria-label": tr("fluidgrids.builder.quickConfigPanel.openFullEditorAriaLabel", "Open full editor"),
|
|
395
|
+
onClick: () => openNdv({
|
|
396
|
+
nodeId,
|
|
397
|
+
type
|
|
398
|
+
}),
|
|
399
|
+
className: "rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
400
|
+
"data-testid": "qc-expand",
|
|
401
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
402
|
+
icon: "mdi:arrow-expand",
|
|
403
|
+
className: "size-4"
|
|
404
|
+
})
|
|
405
|
+
}),
|
|
406
|
+
/* @__PURE__ */ jsx("button", {
|
|
407
|
+
type: "button",
|
|
408
|
+
title: tr("fluidgrids.builder.quickConfigPanel.closeTooltip", "Close"),
|
|
409
|
+
"aria-label": tr("fluidgrids.builder.quickConfigPanel.closeAriaLabel", "Close"),
|
|
410
|
+
onClick: onClose,
|
|
411
|
+
className: "rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
412
|
+
"data-testid": "qc-close",
|
|
413
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
414
|
+
icon: "mdi:close",
|
|
415
|
+
className: "size-4"
|
|
416
|
+
})
|
|
417
|
+
})
|
|
418
|
+
]
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
/** Run this step / continue from this node, reading only the store slices it needs. */
|
|
422
|
+
function QuickConfigRunActions({ nodeId }) {
|
|
423
|
+
const nodes = useFlowStore((s) => s.workflow.nodes);
|
|
424
|
+
const edges = useFlowStore((s) => s.workflow.edges);
|
|
425
|
+
const workflowKey = useFlowStore((s) => s.workflow.workflowKey);
|
|
426
|
+
const workflowId = useFlowStore((s) => s.workflow.id);
|
|
427
|
+
const workflowVersion = useFlowStore((s) => s.workflow.version);
|
|
428
|
+
const logs = useFlowStore((s) => s.execution.logs);
|
|
429
|
+
const sourceRun = useFlowStore((s) => s.execution.sourceRun);
|
|
430
|
+
const isExecuting = useFlowStore((s) => s.execution.isExecuting);
|
|
431
|
+
const { executeStep, executeFromNode } = useNodeExecution();
|
|
432
|
+
return /* @__PURE__ */ jsx(NodeExecutionActions, {
|
|
433
|
+
targetNodeId: nodeId,
|
|
434
|
+
nodes,
|
|
435
|
+
edges,
|
|
436
|
+
logs,
|
|
437
|
+
workflowKey: workflowKey || workflowId,
|
|
438
|
+
workflowVersion: workflowVersion || "1.0.0",
|
|
439
|
+
sourceRun,
|
|
440
|
+
isExecuting,
|
|
441
|
+
onExecuteStep: async (targetId) => {
|
|
442
|
+
await executeStep(targetId);
|
|
443
|
+
},
|
|
444
|
+
onContinueFromNode: async (sourceRunId, targetId) => {
|
|
445
|
+
await executeFromNode(sourceRunId, targetId);
|
|
446
|
+
},
|
|
447
|
+
testIdPrefix: "qc"
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export { QuickConfigPanel };
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
// src/billing/quota.ts
|
|
3
|
+
/**
|
|
4
|
+
* Plan-quota refusals for the FluidGrids SDK.
|
|
5
|
+
*
|
|
6
|
+
* wspace-workflow-svc meters two quotas with `@usage`, and the gateway refuses
|
|
7
|
+
* a call past either one with `429 QUOTA_EXHAUSTED`:
|
|
8
|
+
*
|
|
9
|
+
* - `fluidgrids.runs.monthly` — every mutation that starts a run:
|
|
10
|
+
* `triggerWorkflow`, `runFromNode`, `replayWorkflowRun`, `retryWorkflowRuns`
|
|
11
|
+
* and `listenForWebhookTestEvent`.
|
|
12
|
+
* - `fluidgrids.workflows.count` — the mutations that create a workflow
|
|
13
|
+
* (save, duplicate, template import). Those keep their local
|
|
14
|
+
* `QuotaExhaustedDialog`.
|
|
15
|
+
* - `fluidgrids.nodes.count` — node additions are counted by workflow save;
|
|
16
|
+
* the same save dialog handles its refusal.
|
|
17
|
+
*
|
|
18
|
+
* A run refusal opens the shell's shared upgrade prompt — see
|
|
19
|
+
* `openRunQuotaUpgradePrompt` in `./upgradePrompt`. This module is the pure
|
|
20
|
+
* detection half, so it imports nothing from `@burdenoff/fe-libs`.
|
|
21
|
+
*
|
|
22
|
+
* ★★ Why this does not just call fe-libs `isQuotaExhaustedError`. That helper
|
|
23
|
+
* reads the Apollo 3 shapes (`graphQLErrors`, `networkError.result.errors`, a
|
|
24
|
+
* code in the message). Under Apollo 4 — what every host runs — the refusal
|
|
25
|
+
* never takes those shapes:
|
|
26
|
+
*
|
|
27
|
+
* - the gateway answers `429`, and Apollo 4's HTTP link turns any non-2xx
|
|
28
|
+
* `application/json` response into a `ServerError` whose GraphQL body is
|
|
29
|
+
* only in `bodyText` (message: "Response not successful: Received status
|
|
30
|
+
* code 429");
|
|
31
|
+
* - a 2xx GraphQL error arrives as `CombinedGraphQLErrors`, whose list is
|
|
32
|
+
* `.errors`, not `.graphQLErrors`;
|
|
33
|
+
* - `throwIfResultError` wraps either one in a plain `Error`, keeping the
|
|
34
|
+
* original as `cause`.
|
|
35
|
+
*
|
|
36
|
+
* None of those match, so the refusal read as an ordinary failure. This walker
|
|
37
|
+
* reads all of them, and the Apollo 3 shapes too.
|
|
38
|
+
*/
|
|
39
|
+
/** The monthly run allowance every run-starting mutation is metered against. */
|
|
40
|
+
const RUNS_QUOTA_NAME = "fluidgrids.runs.monthly";
|
|
41
|
+
/** The workflow-count allowance save / duplicate / template import consume. */
|
|
42
|
+
const WORKFLOWS_QUOTA_NAME = "fluidgrids.workflows.count";
|
|
43
|
+
/**
|
|
44
|
+
* The monthly workflow sandbox runtime allowance (BOFF-16579). Unlike the
|
|
45
|
+
* quotas above it is not refused at the gateway: the worker charges it while a
|
|
46
|
+
* sandboxed node runs, and a node or run stopped because it is used up fails
|
|
47
|
+
* with `errorType` `QUOTA_EXHAUSTED` (see `isSandboxRuntimeExhausted`).
|
|
48
|
+
*/
|
|
49
|
+
const SANDBOX_RUNTIME_QUOTA_NAME = "fluidgrids.sandbox.runtime_hours";
|
|
50
|
+
/**
|
|
51
|
+
* Where an upgrade CTA sends the user: the plan picker, not the billing
|
|
52
|
+
* overview. Matches the shared `UpgradePromptModal` default and the shell nav.
|
|
53
|
+
*/
|
|
54
|
+
const BILLING_PLANS_PATH = "/billing/plans";
|
|
55
|
+
/**
|
|
56
|
+
* Where a "buy more" CTA sends the user: the add-ons page, where a one-off
|
|
57
|
+
* top-up (e.g. Extra Sandbox Runtime) is bought without changing plan.
|
|
58
|
+
*/
|
|
59
|
+
const BILLING_ADDONS_PATH = "/billing/addons";
|
|
60
|
+
const QUOTA_EXHAUSTED_CODE = "QUOTA_EXHAUSTED";
|
|
61
|
+
const QUOTA_NOT_PROVISIONED_CODE = "QUOTA_NOT_PROVISIONED";
|
|
62
|
+
/**
|
|
63
|
+
* True when a run's or node's `errorType` says it stopped because the
|
|
64
|
+
* workspace's sandbox runtime allowance is used up (BOFF-16579).
|
|
65
|
+
*
|
|
66
|
+
* wspace-workflow-svc stores that failure as the `ErrorType` value
|
|
67
|
+
* `QUOTA_EXHAUSTED`. Compared as a string so a client whose generated enum
|
|
68
|
+
* predates the value still recognises it.
|
|
69
|
+
*/
|
|
70
|
+
function isSandboxRuntimeExhausted(errorType) {
|
|
71
|
+
return errorType === QUOTA_EXHAUSTED_CODE;
|
|
72
|
+
}
|
|
73
|
+
function asRecord(value) {
|
|
74
|
+
return typeof value === "object" && value !== null ? value : null;
|
|
75
|
+
}
|
|
76
|
+
/** The `extensions` of each entry of an `errors`-like list. */
|
|
77
|
+
function extensionsOfList(list) {
|
|
78
|
+
if (!Array.isArray(list)) return [];
|
|
79
|
+
const found = [];
|
|
80
|
+
for (const entry of list) {
|
|
81
|
+
const extensions = asRecord(asRecord(entry)?.extensions);
|
|
82
|
+
if (extensions) found.push(extensions);
|
|
83
|
+
}
|
|
84
|
+
return found;
|
|
85
|
+
}
|
|
86
|
+
/** The GraphQL `errors[].extensions` inside a raw response body, if it is JSON. */
|
|
87
|
+
function extensionsOfBody(bodyText) {
|
|
88
|
+
if (typeof bodyText !== "string" || !bodyText.includes("errors")) return [];
|
|
89
|
+
try {
|
|
90
|
+
return extensionsOfList(asRecord(JSON.parse(bodyText))?.errors);
|
|
91
|
+
} catch {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/** Bounds the `cause` walk; real chains are one or two links long. */
|
|
96
|
+
const MAX_CAUSE_DEPTH = 5;
|
|
97
|
+
/**
|
|
98
|
+
* Every `extensions` object reachable on a thrown value, across the Apollo 3
|
|
99
|
+
* and Apollo 4 shapes and the `cause` chain `throwIfResultError` adds.
|
|
100
|
+
*/
|
|
101
|
+
function collectExtensions(error) {
|
|
102
|
+
const found = [];
|
|
103
|
+
const seen = /* @__PURE__ */ new Set();
|
|
104
|
+
let current = error;
|
|
105
|
+
for (let depth = 0; depth < MAX_CAUSE_DEPTH; depth += 1) {
|
|
106
|
+
const host = asRecord(current);
|
|
107
|
+
if (!host || seen.has(host)) break;
|
|
108
|
+
seen.add(host);
|
|
109
|
+
const direct = asRecord(host.extensions);
|
|
110
|
+
if (direct) found.push(direct);
|
|
111
|
+
found.push(...extensionsOfList(host.errors));
|
|
112
|
+
found.push(...extensionsOfList(host.graphQLErrors));
|
|
113
|
+
const networkError = asRecord(host.networkError);
|
|
114
|
+
found.push(...extensionsOfList(asRecord(networkError?.result)?.errors));
|
|
115
|
+
found.push(...extensionsOfBody(networkError?.bodyText));
|
|
116
|
+
found.push(...extensionsOfList(asRecord(host.result)?.errors));
|
|
117
|
+
found.push(...extensionsOfBody(host.bodyText));
|
|
118
|
+
current = host.cause;
|
|
119
|
+
}
|
|
120
|
+
return found;
|
|
121
|
+
}
|
|
122
|
+
/** Every GraphQL `extensions.code` carried by `error` or its causes. */
|
|
123
|
+
function errorCodesOf(error) {
|
|
124
|
+
return collectExtensions(error).map((ext) => ext.code).filter((code) => typeof code === "string");
|
|
125
|
+
}
|
|
126
|
+
function stringField(extensions, key) {
|
|
127
|
+
const value = extensions[key];
|
|
128
|
+
return typeof value === "string" && value.length > 0 ? value : null;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* The refusal kind one GraphQL `extensions` object reports, or null.
|
|
132
|
+
*
|
|
133
|
+
* The gateway sets both `code` and `quotaBlock` on a quota refusal
|
|
134
|
+
* (`sendQuotaExhausted` in wspace-public-gateway); either is enough here, so
|
|
135
|
+
* a refusal relayed with only one of them (a proxy, an older gateway build)
|
|
136
|
+
* still reads as one.
|
|
137
|
+
*/
|
|
138
|
+
function refusalKindOf(extensions) {
|
|
139
|
+
if (extensions.code === "QUOTA_NOT_PROVISIONED" || extensions.quotaBlock === "not-provisioned") return "not-provisioned";
|
|
140
|
+
if (extensions.code === "QUOTA_EXHAUSTED" || extensions.quotaBlock === "exhausted") return "exhausted";
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* The quota refusal carried by `error`, or null when it is not one.
|
|
145
|
+
*
|
|
146
|
+
* Keyed on `extensions.code` (or the gateway's `extensions.quotaBlock`), never
|
|
147
|
+
* on the HTTP status or the message: both refusals are 429s, and only those
|
|
148
|
+
* fields tell "used up" from "never granted". `not-provisioned` wins when both
|
|
149
|
+
* appear.
|
|
150
|
+
*/
|
|
151
|
+
function findQuotaRefusal(error) {
|
|
152
|
+
const all = collectExtensions(error);
|
|
153
|
+
const notProvisioned = all.find((ext) => refusalKindOf(ext) === "not-provisioned");
|
|
154
|
+
if (notProvisioned) return {
|
|
155
|
+
kind: "not-provisioned",
|
|
156
|
+
quotaName: stringField(notProvisioned, "quotaName"),
|
|
157
|
+
limitLeft: null
|
|
158
|
+
};
|
|
159
|
+
const exhausted = all.find((ext) => refusalKindOf(ext) === "exhausted");
|
|
160
|
+
if (exhausted) {
|
|
161
|
+
const limitLeft = exhausted.limitLeft;
|
|
162
|
+
return {
|
|
163
|
+
kind: "exhausted",
|
|
164
|
+
quotaName: stringField(exhausted, "quotaName"),
|
|
165
|
+
limitLeft: typeof limitLeft === "number" ? limitLeft : null
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
/** True when `error` is an exhausted (not merely unprovisioned) plan quota. */
|
|
171
|
+
function isQuotaExhaustedFailure(error) {
|
|
172
|
+
return findQuotaRefusal(error)?.kind === "exhausted";
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export { SANDBOX_RUNTIME_QUOTA_NAME as a, errorCodesOf as c, isSandboxRuntimeExhausted as d, RUNS_QUOTA_NAME as i, findQuotaRefusal as l, BILLING_PLANS_PATH as n, WORKFLOWS_QUOTA_NAME as o, QUOTA_EXHAUSTED_CODE as r, collectExtensions as s, BILLING_ADDONS_PATH as t, isQuotaExhaustedFailure as u };
|
package/dist/quota.d.ts
ADDED
package/dist/quota.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
|
|
4
|
+
// src/builder/components/flow-builder/read-only-context.ts
|
|
5
|
+
/**
|
|
6
|
+
* Whether the builder is read-only: the `readOnly` prop or `?readonly=true`
|
|
7
|
+
* (embeds, template previews), or someone else holding the workflow's edit
|
|
8
|
+
* lease (BOFF-9725). Provided by `FlowBuilder` for the whole canvas, so node
|
|
9
|
+
* cards, sticky notes and the node panels stop changing the workflow and
|
|
10
|
+
* controls with side effects can hide themselves.
|
|
11
|
+
*/
|
|
12
|
+
const BuilderReadOnlyContext = createContext(false);
|
|
13
|
+
const BuilderReadOnlyProvider = BuilderReadOnlyContext.Provider;
|
|
14
|
+
function useBuilderReadOnly() {
|
|
15
|
+
return useContext(BuilderReadOnlyContext);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { useBuilderReadOnly as n, BuilderReadOnlyProvider as t };
|