@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,868 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-hDbaFkMy.js";
|
|
3
|
+
import { t as ThemeProvider } from "./theme-provider-CntfC4_i.js";
|
|
4
|
+
import { t as FlowBuilderPage } from "./flow-builder-DIvLOhz0.js";
|
|
5
|
+
import { S as useInstalledNodes, d as buildRequiredNodeTypes, l as useTemplateImportFlow, p as useImportWorkflowTemplate, u as buildNodeCheck } from "./StoreTemplateCardCompact-CHn5kP7A.js";
|
|
6
|
+
import { i as CreateWorkflowRefusalDialog } from "./useWorkflowCodeExport-pqxyLHD1.js";
|
|
7
|
+
import { n as WithOpenTemplateAsCode } from "./OpenTemplateAsCodeButton-BhWJWIF3.js";
|
|
8
|
+
import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
|
|
9
|
+
import { i as SdkPermissionButton, s as useFluidGridsPermission, t as FLUIDGRIDS_PERMISSIONS } from "./constants-DlRnHBfQ.js";
|
|
10
|
+
import { n as BILLING_PLANS_PATH } from "./quota-DeA_CJ2e.js";
|
|
11
|
+
import { a as refusalOfQuota } from "./create-workflow-first-Azg3JUdX.js";
|
|
12
|
+
import { n as useNavigationV2 } from "./useNavigationV2-C2WeqN7d.js";
|
|
13
|
+
import { n as isPaidTemplate, t as formatTemplatePrice } from "./template-price-CdUHZRMF.js";
|
|
14
|
+
import { t as OfflineIcon } from "./OfflineIcon-TwMKYWjA.js";
|
|
15
|
+
import { t as describeOperationError } from "./errors-ClKb5sEt.js";
|
|
16
|
+
import { t as Disclosure } from "./Disclosure-BNKij7-v.js";
|
|
17
|
+
import { c as useUpdateVariable, l as useVariables, t as useCreateVariable } from "./useVariables-BIelxcWr.js";
|
|
18
|
+
import { t as PaidTemplateConfirm } from "./PaidTemplateConfirm-_G3ag6S4.js";
|
|
19
|
+
import { t as cn } from "./cn-QqidFIgr.js";
|
|
20
|
+
import { a as isStickyNode, f as STICKY_NOTE_TYPE, o as mergeStickyNotes } from "./field-label-DPZRmE_B.js";
|
|
21
|
+
import { t as extractTemplateGraph } from "./template-graph-DLF9dygU.js";
|
|
22
|
+
import { useEffect, useMemo, useState } from "react";
|
|
23
|
+
import { useLocation, useNavigate, useParams } from "react-router";
|
|
24
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
+
import "@xyflow/react/dist/style.css";
|
|
26
|
+
import { toast } from "sonner";
|
|
27
|
+
import { Badge, CompactMarkOr, EmptyState, Input } from "@burdenoff/fe-libs/ui";
|
|
28
|
+
import { ErrorBoundary } from "@burdenoff/fe-libs/shared/components";
|
|
29
|
+
import { Button as Button$1 } from "@burdenoff/fe-libs/button";
|
|
30
|
+
|
|
31
|
+
// src/utils/template-needs.ts
|
|
32
|
+
/** "slack_oauth2" → "Slack oauth2", "google-sheets" → "Google sheets". */
|
|
33
|
+
function humanizeIdentifier(identifier) {
|
|
34
|
+
const text = identifier.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_\-.:/]+/g, " ").replace(/\s+/g, " ").trim().toLowerCase();
|
|
35
|
+
return text ? text.charAt(0).toUpperCase() + text.slice(1) : identifier;
|
|
36
|
+
}
|
|
37
|
+
function appName(node) {
|
|
38
|
+
return node.displayName?.trim() || humanizeIdentifier(node.nodeType);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The store apps the template uses (built-in steps are always there, so they
|
|
42
|
+
* are not listed), each with its status: ready (installed at required version
|
|
43
|
+
* or newer), updated for you when you use the template, installed for you when
|
|
44
|
+
* you use the template, to buy first, or not in the store.
|
|
45
|
+
*/
|
|
46
|
+
function templateApps(check) {
|
|
47
|
+
const entry = (status) => (node) => ({
|
|
48
|
+
nodeType: node.nodeType,
|
|
49
|
+
name: appName(node),
|
|
50
|
+
status
|
|
51
|
+
});
|
|
52
|
+
return [
|
|
53
|
+
...check.installed.filter((node) => node.publishType !== "BUILTIN").map(entry("ready")),
|
|
54
|
+
...(check.needsUpdate ?? []).map(entry("update")),
|
|
55
|
+
...check.missing.map(entry("install")),
|
|
56
|
+
...check.missingPaid.map(entry("purchase")),
|
|
57
|
+
...(check.unavailable ?? []).map(entry("unavailable"))
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
/** `{{ $vars.API_URL }}` (expressions) and `${vars.API_URL}` (legacy). */
|
|
61
|
+
const VARIABLE_PATTERNS = [/\$vars\.([A-Za-z_][A-Za-z0-9_]*)/g, /\$\{vars\.([A-Za-z_][A-Za-z0-9_]*)\}/g];
|
|
62
|
+
/** The workspace values (`$vars`) a template's definition reads, sorted. */
|
|
63
|
+
function templateVariableNames(definition) {
|
|
64
|
+
let text;
|
|
65
|
+
try {
|
|
66
|
+
text = JSON.stringify(definition ?? null);
|
|
67
|
+
} catch {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
70
|
+
const names = /* @__PURE__ */ new Set();
|
|
71
|
+
for (const pattern of VARIABLE_PATTERNS) for (const match of text.matchAll(pattern)) if (match[1]) names.add(match[1]);
|
|
72
|
+
return [...names].sort();
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The names the template's `requiredVariables` marks secret. Store content
|
|
76
|
+
* is publisher JSON, so anything other than `secret: true` on an entry with
|
|
77
|
+
* a string name counts as not secret.
|
|
78
|
+
*/
|
|
79
|
+
function declaredSecretNames(declared) {
|
|
80
|
+
const secret = /* @__PURE__ */ new Set();
|
|
81
|
+
if (!Array.isArray(declared)) return secret;
|
|
82
|
+
for (const entry of declared) {
|
|
83
|
+
if (typeof entry !== "object" || entry === null) continue;
|
|
84
|
+
const { name, secret: isSecret } = entry;
|
|
85
|
+
if (typeof name === "string" && name.trim() && isSecret === true) secret.add(name.trim());
|
|
86
|
+
}
|
|
87
|
+
return secret;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The workspace values (`$vars`) a template reads, sorted, each marked
|
|
91
|
+
* secret when the template's `requiredVariables` says so (BOFF-16823).
|
|
92
|
+
* The names come from the definition, where the template reads them.
|
|
93
|
+
*/
|
|
94
|
+
function templateWorkspaceValues(content) {
|
|
95
|
+
if (!content) return [];
|
|
96
|
+
const secret = declaredSecretNames(content.requiredVariables);
|
|
97
|
+
return templateVariableNames(content.definitionJson).map((name) => ({
|
|
98
|
+
name,
|
|
99
|
+
secret: secret.has(name)
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The `createWorkflowVariable` input for a workspace value typed in on the
|
|
104
|
+
* template page: a value the template marks secret is created as a secret.
|
|
105
|
+
*/
|
|
106
|
+
function workspaceValueInput(value, text) {
|
|
107
|
+
return {
|
|
108
|
+
key: value.name,
|
|
109
|
+
value: text,
|
|
110
|
+
isSecret: value.secret
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/** Masked the way the Variables page masks it: a secret or a reference. */
|
|
114
|
+
function isStoredMasked(variable) {
|
|
115
|
+
return variable.isSecret || variable.externalProvider !== "NONE";
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Compares one workspace value the template reads with the workspace's
|
|
119
|
+
* stored variables. A value the template declares secret only counts as set
|
|
120
|
+
* when every variable saved under its key is masked; the first plain one is
|
|
121
|
+
* named so the page can save it again as a secret.
|
|
122
|
+
*/
|
|
123
|
+
function workspaceValueState(value, stored) {
|
|
124
|
+
const matches = stored.filter((variable) => variable.key === value.name);
|
|
125
|
+
if (matches.length === 0) return { kind: "missing" };
|
|
126
|
+
if (!value.secret) return { kind: "set" };
|
|
127
|
+
const plain = matches.find((variable) => !isStoredMasked(variable));
|
|
128
|
+
return plain ? {
|
|
129
|
+
kind: "plainSecret",
|
|
130
|
+
variableId: plain.id
|
|
131
|
+
} : { kind: "set" };
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The `updateWorkflowVariable` input that saves a value again as a secret:
|
|
135
|
+
* the value is re-entered so the plain one is replaced, not just relabelled.
|
|
136
|
+
*/
|
|
137
|
+
function secretValueInput(text) {
|
|
138
|
+
return {
|
|
139
|
+
isSecret: true,
|
|
140
|
+
value: text
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/** Canvas-only nodes that are not steps (they never run). */
|
|
144
|
+
const NOT_A_STEP = /* @__PURE__ */ new Set(["sticky-note"]);
|
|
145
|
+
/** The template's steps by name, in canvas order. */
|
|
146
|
+
function templateSteps(nodes) {
|
|
147
|
+
const steps = [];
|
|
148
|
+
for (const node of nodes) {
|
|
149
|
+
const type = typeof node.type === "string" ? node.type : "";
|
|
150
|
+
if (NOT_A_STEP.has(type)) continue;
|
|
151
|
+
const id = typeof node.id === "string" ? node.id : String(steps.length);
|
|
152
|
+
const label = node.data?.label;
|
|
153
|
+
steps.push({
|
|
154
|
+
id,
|
|
155
|
+
name: typeof label === "string" && label.trim() ? label.trim() : humanizeIdentifier(type.replace(/^store\//, "")) || id
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
return steps;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// src/modules/templates/components/TemplateNeedsPanel.tsx
|
|
162
|
+
/**
|
|
163
|
+
* "What you'll need" beside a template's preview (Navigation v2,
|
|
164
|
+
* BOFF-11848): before "Use this template", the apps it uses and whether each
|
|
165
|
+
* is ready, the accounts to connect, the values it will ask for, the
|
|
166
|
+
* workspace values it reads (with a way to add a missing one right here),
|
|
167
|
+
* and the price, author, step count and how often it was used.
|
|
168
|
+
*/
|
|
169
|
+
/** Download and view counts, written for the reader's locale. */
|
|
170
|
+
const COUNT_FORMAT = new Intl.NumberFormat(void 0, {
|
|
171
|
+
notation: "compact",
|
|
172
|
+
maximumFractionDigits: 1
|
|
173
|
+
});
|
|
174
|
+
const APP_STATUS_ICON = {
|
|
175
|
+
ready: "mdi:check-circle-outline",
|
|
176
|
+
update: "mdi:download-outline",
|
|
177
|
+
install: "mdi:download-outline",
|
|
178
|
+
purchase: "mdi:cart-outline",
|
|
179
|
+
unavailable: "mdi:alert-circle-outline"
|
|
180
|
+
};
|
|
181
|
+
function Section({ title, children, testId }) {
|
|
182
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
183
|
+
className: "space-y-1.5",
|
|
184
|
+
"data-testid": testId,
|
|
185
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
186
|
+
className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground",
|
|
187
|
+
children: title
|
|
188
|
+
}), children]
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* A field and Save button for one workspace value. A secret is typed in a
|
|
193
|
+
* masked field the browser does not fill in from saved passwords.
|
|
194
|
+
*/
|
|
195
|
+
function ValueEntry({ name, secret, loading, permission, saveLabel, testIdPrefix, onSave }) {
|
|
196
|
+
const tr = useTr();
|
|
197
|
+
const [value, setValue] = useState("");
|
|
198
|
+
const label = tr("fluidgrids.pages.templatePreview.addValuePlaceholder", "Value for {{name}}", { name });
|
|
199
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
200
|
+
className: "flex items-center gap-2",
|
|
201
|
+
children: [/* @__PURE__ */ jsx(Input, {
|
|
202
|
+
type: secret ? "password" : "text",
|
|
203
|
+
autoComplete: secret ? "new-password" : void 0,
|
|
204
|
+
value,
|
|
205
|
+
onChange: (event) => setValue(event.target.value),
|
|
206
|
+
placeholder: label,
|
|
207
|
+
"aria-label": label,
|
|
208
|
+
className: "h-8 text-xs",
|
|
209
|
+
"data-testid": `${testIdPrefix}-input-${name}`
|
|
210
|
+
}), /* @__PURE__ */ jsx(SdkPermissionButton, {
|
|
211
|
+
permission,
|
|
212
|
+
deniedBehavior: "hide",
|
|
213
|
+
children: /* @__PURE__ */ jsx(Button$1, {
|
|
214
|
+
"data-agent": "confirm",
|
|
215
|
+
size: "sm",
|
|
216
|
+
variant: "outline",
|
|
217
|
+
disabled: loading || !value.trim(),
|
|
218
|
+
onClick: () => void onSave(value),
|
|
219
|
+
"data-testid": `${testIdPrefix}-save-${name}`,
|
|
220
|
+
children: saveLabel
|
|
221
|
+
})
|
|
222
|
+
})]
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Saves one missing workspace value. A value the template marks secret is
|
|
227
|
+
* created as a secret variable (BOFF-16823), and typed in a masked field.
|
|
228
|
+
*/
|
|
229
|
+
function AddWorkspaceValue({ workspaceValue, onAdded }) {
|
|
230
|
+
const tr = useTr();
|
|
231
|
+
const { name, secret } = workspaceValue;
|
|
232
|
+
const { createVariable, loading } = useCreateVariable();
|
|
233
|
+
const save = async (text) => {
|
|
234
|
+
try {
|
|
235
|
+
await createVariable(workspaceValueInput(workspaceValue, text));
|
|
236
|
+
toast.success(tr("fluidgrids.pages.templatePreview.addValueSaved", "Saved {{name}}", { name }));
|
|
237
|
+
onAdded();
|
|
238
|
+
} catch (err) {
|
|
239
|
+
const failed = tr("fluidgrids.pages.templatePreview.addValueFailed", "Could not save {{name}}", { name });
|
|
240
|
+
toast.error(failed, { description: describeOperationError(err, failed) });
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
return /* @__PURE__ */ jsx(ValueEntry, {
|
|
244
|
+
name,
|
|
245
|
+
secret,
|
|
246
|
+
loading,
|
|
247
|
+
permission: FLUIDGRIDS_PERMISSIONS.VARIABLE_CREATE,
|
|
248
|
+
saveLabel: tr("fluidgrids.pages.templatePreview.addValueSave", "Save"),
|
|
249
|
+
testIdPrefix: "template-value",
|
|
250
|
+
onSave: save
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* A value the template declares secret that the workspace holds as plain
|
|
255
|
+
* text (saved before BOFF-16823, or by hand): the value is typed in again
|
|
256
|
+
* and the variable is saved as a secret, so run logs stop showing it.
|
|
257
|
+
*/
|
|
258
|
+
function SaveValueAsSecret({ name, variableId, onSaved }) {
|
|
259
|
+
const tr = useTr();
|
|
260
|
+
const { updateVariable, loading } = useUpdateVariable();
|
|
261
|
+
const save = async (text) => {
|
|
262
|
+
try {
|
|
263
|
+
await updateVariable(variableId, secretValueInput(text));
|
|
264
|
+
toast.success(tr("fluidgrids.pages.templatePreview.secureValueSaved", "Saved {{name}} as a secret", { name }));
|
|
265
|
+
onSaved();
|
|
266
|
+
} catch (err) {
|
|
267
|
+
const failed = tr("fluidgrids.pages.templatePreview.secureValueFailed", "Could not save {{name}} as a secret", { name });
|
|
268
|
+
toast.error(failed, { description: describeOperationError(err, failed) });
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
272
|
+
className: "space-y-1",
|
|
273
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
274
|
+
className: "text-status-warning-text",
|
|
275
|
+
"data-testid": `template-value-plain-warning-${name}`,
|
|
276
|
+
children: tr("fluidgrids.pages.templatePreview.secureValueWarning", "This template keeps {{name}} secret, but it is saved as plain text, so run logs can show it. Enter the value again to save it as a secret.", { name })
|
|
277
|
+
}), /* @__PURE__ */ jsx(ValueEntry, {
|
|
278
|
+
name,
|
|
279
|
+
secret: true,
|
|
280
|
+
loading,
|
|
281
|
+
permission: FLUIDGRIDS_PERMISSIONS.VARIABLE_UPDATE,
|
|
282
|
+
saveLabel: tr("fluidgrids.pages.templatePreview.secureValueSave", "Save as secret"),
|
|
283
|
+
testIdPrefix: "template-value-secure",
|
|
284
|
+
onSave: save
|
|
285
|
+
})]
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
/** The `$vars` the template reads, checked against the workspace's values. */
|
|
289
|
+
function WorkspaceValuesCheck({ values }) {
|
|
290
|
+
const tr = useTr();
|
|
291
|
+
const { variables, loading, refetch } = useVariables();
|
|
292
|
+
const states = new Map(values.map((value) => [value.name, workspaceValueState(value, variables)]));
|
|
293
|
+
const missing = loading ? [] : values.map((value) => value.name).filter((name) => states.get(name)?.kind === "missing");
|
|
294
|
+
const statusText = {
|
|
295
|
+
missing: tr("fluidgrids.pages.templatePreview.valueMissing", "Missing"),
|
|
296
|
+
set: tr("fluidgrids.pages.templatePreview.valueSet", "Set"),
|
|
297
|
+
plainSecret: tr("fluidgrids.pages.templatePreview.valuePlainText", "Saved as plain text")
|
|
298
|
+
};
|
|
299
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
300
|
+
className: "space-y-2",
|
|
301
|
+
children: [missing.length > 0 && /* @__PURE__ */ jsx("p", {
|
|
302
|
+
className: "text-xs text-text-primary",
|
|
303
|
+
"data-testid": "template-values-missing",
|
|
304
|
+
children: tr("fluidgrids.pages.templatePreview.needsValuesMissing", "This workflow needs: {{names}}", { names: missing.join(", ") })
|
|
305
|
+
}), /* @__PURE__ */ jsx("ul", {
|
|
306
|
+
className: "space-y-2",
|
|
307
|
+
children: values.map((workspaceValue) => {
|
|
308
|
+
const { name, secret } = workspaceValue;
|
|
309
|
+
const state = states.get(name) ?? { kind: "missing" };
|
|
310
|
+
const showSecretBadge = secret && (loading || state.kind !== "plainSecret");
|
|
311
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
312
|
+
className: "space-y-1 text-xs",
|
|
313
|
+
"data-state": loading ? void 0 : state.kind,
|
|
314
|
+
"data-testid": `template-value-row-${name}`,
|
|
315
|
+
children: [
|
|
316
|
+
/* @__PURE__ */ jsxs("div", {
|
|
317
|
+
className: "flex items-center justify-between gap-2",
|
|
318
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
319
|
+
className: "flex min-w-0 items-center gap-1.5",
|
|
320
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
321
|
+
className: "font-mono text-text-primary",
|
|
322
|
+
children: name
|
|
323
|
+
}), showSecretBadge && /* @__PURE__ */ jsx(Badge, {
|
|
324
|
+
variant: "outline",
|
|
325
|
+
className: "text-[10px]",
|
|
326
|
+
"data-testid": `template-value-secret-${name}`,
|
|
327
|
+
children: tr("fluidgrids.variables.secretBadge", "SECRET")
|
|
328
|
+
})]
|
|
329
|
+
}), !loading && /* @__PURE__ */ jsx("span", {
|
|
330
|
+
className: state.kind === "set" ? "text-text-secondary" : "text-status-warning-text",
|
|
331
|
+
"data-testid": `template-value-status-${name}`,
|
|
332
|
+
children: statusText[state.kind]
|
|
333
|
+
})]
|
|
334
|
+
}),
|
|
335
|
+
!loading && state.kind === "missing" && /* @__PURE__ */ jsx(AddWorkspaceValue, {
|
|
336
|
+
workspaceValue,
|
|
337
|
+
onAdded: () => void refetch()
|
|
338
|
+
}),
|
|
339
|
+
!loading && state.kind === "plainSecret" && /* @__PURE__ */ jsx(SaveValueAsSecret, {
|
|
340
|
+
name,
|
|
341
|
+
variableId: state.variableId,
|
|
342
|
+
onSaved: () => void refetch()
|
|
343
|
+
})
|
|
344
|
+
]
|
|
345
|
+
}, name);
|
|
346
|
+
})
|
|
347
|
+
})]
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
function AppsSection({ nodeCheck }) {
|
|
351
|
+
const tr = useTr();
|
|
352
|
+
const apps = nodeCheck ? templateApps(nodeCheck) : [];
|
|
353
|
+
const statusText = {
|
|
354
|
+
ready: tr("fluidgrids.pages.templatePreview.appReady", "Ready"),
|
|
355
|
+
update: tr("fluidgrids.pages.templatePreview.appWillUpdate", "Updated for you when you use it"),
|
|
356
|
+
install: tr("fluidgrids.pages.templatePreview.appWillInstall", "Added for you when you use it"),
|
|
357
|
+
purchase: tr("fluidgrids.pages.templatePreview.appNeedsPurchase", "Needs to be bought first"),
|
|
358
|
+
unavailable: tr("fluidgrids.pages.templatePreview.appUnavailable", "Not in the store")
|
|
359
|
+
};
|
|
360
|
+
const empty = nodeCheck ? tr("fluidgrids.pages.templatePreview.needsNoApps", "Only built-in steps, nothing to add") : tr("fluidgrids.pages.templatePreview.needsChecking", "Checking…");
|
|
361
|
+
return /* @__PURE__ */ jsx(Section, {
|
|
362
|
+
title: tr("fluidgrids.pages.templatePreview.needsApps", "Apps it uses"),
|
|
363
|
+
testId: "template-needs-apps",
|
|
364
|
+
children: apps.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
365
|
+
className: "space-y-1.5",
|
|
366
|
+
children: apps.map((app) => /* @__PURE__ */ jsxs("li", {
|
|
367
|
+
className: "flex items-start justify-between gap-2 text-xs",
|
|
368
|
+
"data-status": app.status,
|
|
369
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
370
|
+
className: "text-text-primary",
|
|
371
|
+
children: app.name
|
|
372
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
373
|
+
className: "flex shrink-0 items-center gap-1 text-text-secondary",
|
|
374
|
+
children: [/* @__PURE__ */ jsx(OfflineIcon, {
|
|
375
|
+
icon: APP_STATUS_ICON[app.status],
|
|
376
|
+
width: 14
|
|
377
|
+
}), statusText[app.status]]
|
|
378
|
+
})]
|
|
379
|
+
}, app.nodeType))
|
|
380
|
+
}) : /* @__PURE__ */ jsx("p", {
|
|
381
|
+
className: "text-xs text-text-secondary",
|
|
382
|
+
children: empty
|
|
383
|
+
})
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
/** A titled list of names, or a line saying there are none. */
|
|
387
|
+
function NamesSection({ title, names, empty, testId }) {
|
|
388
|
+
if (names.length === 0 && empty === void 0) return null;
|
|
389
|
+
return /* @__PURE__ */ jsx(Section, {
|
|
390
|
+
title,
|
|
391
|
+
testId,
|
|
392
|
+
children: names.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
393
|
+
className: "space-y-1 text-xs text-text-primary",
|
|
394
|
+
children: names.map((name) => /* @__PURE__ */ jsx("li", { children: name }, name))
|
|
395
|
+
}) : /* @__PURE__ */ jsx("p", {
|
|
396
|
+
className: "text-xs text-text-secondary",
|
|
397
|
+
children: empty
|
|
398
|
+
})
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
function ValuesSection({ values }) {
|
|
402
|
+
const tr = useTr();
|
|
403
|
+
const { allowed: canReadValues } = useFluidGridsPermission(FLUIDGRIDS_PERMISSIONS.VARIABLE_READ);
|
|
404
|
+
if (values.length === 0) return null;
|
|
405
|
+
return /* @__PURE__ */ jsx(Section, {
|
|
406
|
+
title: tr("fluidgrids.pages.templatePreview.needsValues", "Workspace values"),
|
|
407
|
+
testId: "template-needs-values",
|
|
408
|
+
children: canReadValues ? /* @__PURE__ */ jsx(WorkspaceValuesCheck, { values }) : /* @__PURE__ */ jsx("p", {
|
|
409
|
+
className: "text-xs text-text-primary",
|
|
410
|
+
children: tr("fluidgrids.pages.templatePreview.needsValuesMissing", "This workflow needs: {{names}}", { names: values.map((value) => value.name).join(", ") })
|
|
411
|
+
})
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
function FactsList({ template, stepCount }) {
|
|
415
|
+
const tr = useTr();
|
|
416
|
+
const author = template.authorName || template.publisher?.name || tr("fluidgrids.builder.templateCard.unknownAuthor", "Unknown");
|
|
417
|
+
const price = template.pricingModel === "FREE" ? tr("fluidgrids.builder.templateCard.freeBadge", "Free") : formatTemplatePrice(template.price, template.currency);
|
|
418
|
+
return /* @__PURE__ */ jsxs("dl", {
|
|
419
|
+
className: "grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 border-t border-card-foreground/10 pt-3 text-xs",
|
|
420
|
+
"data-testid": "template-needs-facts",
|
|
421
|
+
children: [
|
|
422
|
+
/* @__PURE__ */ jsx("dt", {
|
|
423
|
+
className: "text-text-secondary",
|
|
424
|
+
children: tr("fluidgrids.pages.templatePreview.factPrice", "Price")
|
|
425
|
+
}),
|
|
426
|
+
/* @__PURE__ */ jsx("dd", {
|
|
427
|
+
className: "text-text-primary",
|
|
428
|
+
children: price
|
|
429
|
+
}),
|
|
430
|
+
/* @__PURE__ */ jsx("dt", {
|
|
431
|
+
className: "text-text-secondary",
|
|
432
|
+
children: tr("fluidgrids.pages.templatePreview.factAuthor", "Made by")
|
|
433
|
+
}),
|
|
434
|
+
/* @__PURE__ */ jsxs("dd", {
|
|
435
|
+
className: "text-text-primary",
|
|
436
|
+
children: [author, template.publisher?.isVerified && /* @__PURE__ */ jsxs("span", {
|
|
437
|
+
className: "ml-1 text-text-secondary",
|
|
438
|
+
children: [
|
|
439
|
+
"(",
|
|
440
|
+
tr("fluidgrids.builder.templateCard.verifiedLabel", "Verified publisher"),
|
|
441
|
+
")"
|
|
442
|
+
]
|
|
443
|
+
})]
|
|
444
|
+
}),
|
|
445
|
+
/* @__PURE__ */ jsx("dt", {
|
|
446
|
+
className: "text-text-secondary",
|
|
447
|
+
children: tr("fluidgrids.pages.templatePreview.factSteps", "Steps")
|
|
448
|
+
}),
|
|
449
|
+
/* @__PURE__ */ jsx("dd", {
|
|
450
|
+
className: "text-text-primary",
|
|
451
|
+
children: stepCount
|
|
452
|
+
}),
|
|
453
|
+
/* @__PURE__ */ jsx("dt", {
|
|
454
|
+
className: "text-text-secondary",
|
|
455
|
+
children: tr("fluidgrids.pages.templatePreview.factUsage", "Used")
|
|
456
|
+
}),
|
|
457
|
+
/* @__PURE__ */ jsx("dd", {
|
|
458
|
+
className: "text-text-primary",
|
|
459
|
+
children: tr("fluidgrids.pages.templatePreview.factUsageValue", "{{downloads}} times · {{views}} views", {
|
|
460
|
+
downloads: COUNT_FORMAT.format(template.downloads ?? 0),
|
|
461
|
+
views: COUNT_FORMAT.format(template.viewCount ?? 0)
|
|
462
|
+
})
|
|
463
|
+
})
|
|
464
|
+
]
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
function StepsList({ steps }) {
|
|
468
|
+
const tr = useTr();
|
|
469
|
+
if (steps.length === 0) return null;
|
|
470
|
+
return /* @__PURE__ */ jsx(Disclosure, {
|
|
471
|
+
closedLabel: tr("fluidgrids.pages.templatePreview.showSteps", "Show the {{count}} steps", { count: steps.length }),
|
|
472
|
+
openLabel: tr("fluidgrids.pages.templatePreview.hideSteps", "Hide the steps"),
|
|
473
|
+
"data-testid": "template-needs-steps",
|
|
474
|
+
children: /* @__PURE__ */ jsx("ol", {
|
|
475
|
+
className: "list-decimal space-y-0.5 pl-5 text-xs text-text-primary",
|
|
476
|
+
children: steps.map((step) => /* @__PURE__ */ jsx("li", { children: step.name }, step.id))
|
|
477
|
+
})
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
function TemplateNeedsPanel({ template, content, nodeCheck, steps }) {
|
|
481
|
+
const tr = useTr();
|
|
482
|
+
return /* @__PURE__ */ jsxs("aside", {
|
|
483
|
+
className: "flex max-h-[40vh] w-full shrink-0 flex-col gap-4 overflow-y-auto border-b border-card-foreground/10 bg-card p-4 lg:max-h-none lg:w-80 lg:border-b-0 lg:border-l",
|
|
484
|
+
"aria-labelledby": "template-needs-title",
|
|
485
|
+
"data-testid": "template-needs-panel",
|
|
486
|
+
children: [
|
|
487
|
+
/* @__PURE__ */ jsx("h2", {
|
|
488
|
+
id: "template-needs-title",
|
|
489
|
+
className: "text-sm font-semibold text-card-foreground",
|
|
490
|
+
children: tr("fluidgrids.pages.templatePreview.needsTitle", "What you'll need")
|
|
491
|
+
}),
|
|
492
|
+
/* @__PURE__ */ jsx(AppsSection, { nodeCheck }),
|
|
493
|
+
/* @__PURE__ */ jsx(NamesSection, {
|
|
494
|
+
title: tr("fluidgrids.pages.templatePreview.needsAccounts", "Accounts to connect"),
|
|
495
|
+
names: (content?.requiredCredentialTypes ?? []).map(humanizeIdentifier),
|
|
496
|
+
empty: tr("fluidgrids.pages.templatePreview.needsNoAccounts", "No accounts needed"),
|
|
497
|
+
testId: "template-needs-accounts"
|
|
498
|
+
}),
|
|
499
|
+
/* @__PURE__ */ jsx(NamesSection, {
|
|
500
|
+
title: tr("fluidgrids.pages.templatePreview.needsInputs", "You'll be asked for"),
|
|
501
|
+
names: (content?.requiredInputs ?? []).map((input) => input.label || input.name),
|
|
502
|
+
testId: "template-needs-inputs"
|
|
503
|
+
}),
|
|
504
|
+
/* @__PURE__ */ jsx(ValuesSection, { values: templateWorkspaceValues(content) }),
|
|
505
|
+
/* @__PURE__ */ jsx(FactsList, {
|
|
506
|
+
template,
|
|
507
|
+
stepCount: steps.length
|
|
508
|
+
}),
|
|
509
|
+
/* @__PURE__ */ jsx(StepsList, { steps })
|
|
510
|
+
]
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
// src/pages/TemplatePreviewIcons.tsx
|
|
515
|
+
/**
|
|
516
|
+
* The template preview's own chrome icons (back arrow, spinner, alert, plus),
|
|
517
|
+
* drawn from the bundled icon set so the preview header never asks the public
|
|
518
|
+
* Iconify API for them.
|
|
519
|
+
*
|
|
520
|
+
* They live in this small module rather than in `TemplatePreview.tsx` because
|
|
521
|
+
* the offline icon generator bundles every `mdi:` literal in the import
|
|
522
|
+
* closure of each module that imports `OfflineIcon`. The preview page imports
|
|
523
|
+
* the whole builder; this module imports nothing but the icon component, so
|
|
524
|
+
* only these icons are added to the bundle.
|
|
525
|
+
*/
|
|
526
|
+
function PreviewBackIcon({ className }) {
|
|
527
|
+
return /* @__PURE__ */ jsx(OfflineIcon, {
|
|
528
|
+
icon: "mdi:arrow-left",
|
|
529
|
+
className
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
function PreviewAlertIcon({ className }) {
|
|
533
|
+
return /* @__PURE__ */ jsx(OfflineIcon, {
|
|
534
|
+
icon: "mdi:alert-circle-outline",
|
|
535
|
+
className
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
function PreviewPlusIcon({ className }) {
|
|
539
|
+
return /* @__PURE__ */ jsx(OfflineIcon, {
|
|
540
|
+
icon: "mdi:plus",
|
|
541
|
+
className
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
/** A spinning progress icon (the bundled set has no animated spinners). */
|
|
545
|
+
function PreviewSpinner({ className }) {
|
|
546
|
+
return /* @__PURE__ */ jsx(CompactMarkOr, {
|
|
547
|
+
today: /* @__PURE__ */ jsx(OfflineIcon, {
|
|
548
|
+
icon: "mdi:loading",
|
|
549
|
+
className: cn("animate-spin", className)
|
|
550
|
+
}),
|
|
551
|
+
className: cn("size-4", className)
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// src/utils/template-preview-canvas.ts
|
|
556
|
+
function isRecord(value) {
|
|
557
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
558
|
+
}
|
|
559
|
+
function isPosition(value) {
|
|
560
|
+
return isRecord(value) && typeof value.x === "number" && Number.isFinite(value.x) && typeof value.y === "number" && Number.isFinite(value.y);
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* A stored note the canvas can draw: a sticky-note node with an id, a
|
|
564
|
+
* position (React Flow needs one) and a data object (the note component
|
|
565
|
+
* reads its content and colour from it). Template content is published by
|
|
566
|
+
* other people, so anything else is left out rather than breaking the
|
|
567
|
+
* whole preview, or being wrapped in a generic node card.
|
|
568
|
+
*/
|
|
569
|
+
function isDrawableNote(item) {
|
|
570
|
+
return isRecord(item) && typeof item.id === "string" && item.id.length > 0 && item.type === "sticky-note" && isPosition(item.position) && isRecord(item.data);
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* The sticky notes stored with a template's definition. Reads the same
|
|
574
|
+
* wrapped (`{ data: { … } }`) or flat definition as `extractTemplateGraph`.
|
|
575
|
+
*/
|
|
576
|
+
function templateStickyNotes(content) {
|
|
577
|
+
const definition = isRecord(content) ? content.definitionJson : void 0;
|
|
578
|
+
if (!isRecord(definition)) return [];
|
|
579
|
+
const notes = (isRecord(definition.data) ? definition.data : definition).stickyNotes;
|
|
580
|
+
return Array.isArray(notes) ? notes.filter(isDrawableNote) : [];
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* The preview canvas for a template's `content`, or `null` when it has no
|
|
584
|
+
* step to show (a definition holding only sticky notes has no workflow).
|
|
585
|
+
*/
|
|
586
|
+
function templatePreviewCanvas(content) {
|
|
587
|
+
const graph = extractTemplateGraph(content);
|
|
588
|
+
if (!graph) return null;
|
|
589
|
+
const steps = graph.nodes.filter((node) => !isStickyNode(node));
|
|
590
|
+
if (!steps.length) return null;
|
|
591
|
+
return {
|
|
592
|
+
nodes: mergeStickyNotes({
|
|
593
|
+
nodes: graph.nodes,
|
|
594
|
+
stickyNotes: templateStickyNotes(content)
|
|
595
|
+
}),
|
|
596
|
+
edges: graph.edges,
|
|
597
|
+
steps
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// src/pages/useTemplatePreviewLoad.ts
|
|
602
|
+
/**
|
|
603
|
+
* Loads a store template for the preview page: the product, its content and
|
|
604
|
+
* the graph the read-only canvas draws, or a plain error. With Navigation v2
|
|
605
|
+
* (BOFF-11848) it also works out the apps the template needs, for the "What
|
|
606
|
+
* you'll need" panel: the template's own list when it has one, else from its
|
|
607
|
+
* nodes (as "Use this template" does). The canvas does not wait for that.
|
|
608
|
+
* The canvas also draws the template's sticky notes (BOFF-17037), which are
|
|
609
|
+
* not steps: only `stepNodes` count as the template's workflow.
|
|
610
|
+
*/
|
|
611
|
+
const NO_STEPS = [];
|
|
612
|
+
function useTemplatePreviewLoad(productId, withRequiredNodes) {
|
|
613
|
+
const tr = useTr();
|
|
614
|
+
const { getTemplateDetail, parseTemplateContent } = useImportWorkflowTemplate();
|
|
615
|
+
const [workflow, setWorkflow] = useState(null);
|
|
616
|
+
const [template, setTemplate] = useState(null);
|
|
617
|
+
const [content, setContent] = useState(null);
|
|
618
|
+
const [loading, setLoading] = useState(true);
|
|
619
|
+
const [error, setError] = useState(null);
|
|
620
|
+
const [requiredNodes, setRequiredNodes] = useState(null);
|
|
621
|
+
const [stepNodes, setStepNodes] = useState(NO_STEPS);
|
|
622
|
+
useEffect(() => {
|
|
623
|
+
let mounted = true;
|
|
624
|
+
const fail = (message) => {
|
|
625
|
+
if (!mounted) return;
|
|
626
|
+
setError(message);
|
|
627
|
+
setLoading(false);
|
|
628
|
+
};
|
|
629
|
+
const loadFailed = () => tr("fluidgrids.pages.templatePreview.errorLoadFailed", "Failed to load template.");
|
|
630
|
+
const load = async () => {
|
|
631
|
+
if (!productId) {
|
|
632
|
+
fail(tr("fluidgrids.pages.templatePreview.errorNoTemplateSpecified", "No template specified."));
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
try {
|
|
636
|
+
const full = await getTemplateDetail(productId);
|
|
637
|
+
if (!full) {
|
|
638
|
+
fail(loadFailed());
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
const parsed = parseTemplateContent(full);
|
|
642
|
+
const canvas = templatePreviewCanvas(parsed);
|
|
643
|
+
if (!canvas) {
|
|
644
|
+
fail(tr("fluidgrids.pages.templatePreview.errorNoWorkflow", "This template has no workflow to preview."));
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
if (mounted) {
|
|
648
|
+
setTemplate(full);
|
|
649
|
+
setContent(parsed);
|
|
650
|
+
setStepNodes(canvas.steps);
|
|
651
|
+
setWorkflow({
|
|
652
|
+
id: productId,
|
|
653
|
+
workflowKey: productId,
|
|
654
|
+
version: "preview",
|
|
655
|
+
name: full.name ?? tr("fluidgrids.pages.templatePreview.fallbackTemplateName", "Template"),
|
|
656
|
+
nodes: canvas.nodes,
|
|
657
|
+
edges: canvas.edges,
|
|
658
|
+
sidebar: {
|
|
659
|
+
active: "none",
|
|
660
|
+
panels: { nodeProperties: { selectedNode: null } }
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
setLoading(false);
|
|
664
|
+
}
|
|
665
|
+
if (withRequiredNodes) {
|
|
666
|
+
const listed = parsed?.requiredNodeTypes ?? [];
|
|
667
|
+
const required = listed.length ? listed : await buildRequiredNodeTypes(canvas.steps).catch(() => []);
|
|
668
|
+
if (mounted) setRequiredNodes(required);
|
|
669
|
+
}
|
|
670
|
+
} catch (e) {
|
|
671
|
+
fail(e instanceof Error ? e.message : loadFailed());
|
|
672
|
+
}
|
|
673
|
+
};
|
|
674
|
+
load();
|
|
675
|
+
return () => {
|
|
676
|
+
mounted = false;
|
|
677
|
+
};
|
|
678
|
+
}, [
|
|
679
|
+
productId,
|
|
680
|
+
getTemplateDetail,
|
|
681
|
+
parseTemplateContent,
|
|
682
|
+
tr,
|
|
683
|
+
withRequiredNodes
|
|
684
|
+
]);
|
|
685
|
+
return {
|
|
686
|
+
workflow,
|
|
687
|
+
template,
|
|
688
|
+
content,
|
|
689
|
+
loading,
|
|
690
|
+
error,
|
|
691
|
+
requiredNodes,
|
|
692
|
+
stepNodes
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
// src/pages/TemplatePreview.tsx
|
|
697
|
+
var TemplatePreview_exports = /* @__PURE__ */ __exportAll({ TemplatePreview: () => TemplatePreview });
|
|
698
|
+
/**
|
|
699
|
+
* TemplatePreview — a read-only, n8n-style preview of a store workflow template.
|
|
700
|
+
*
|
|
701
|
+
* It loads the template's `content.definitionJson`, seeds the builder's flow
|
|
702
|
+
* store with the graph, and renders the *real* builder canvas in read-only mode
|
|
703
|
+
* (no dragging/connecting/editing — pan + zoom only). A header shows the
|
|
704
|
+
* template name/description and a "Use this template" CTA that imports the
|
|
705
|
+
* template and opens the editable builder. Nothing is created until the user
|
|
706
|
+
* clicks "Use this template".
|
|
707
|
+
*
|
|
708
|
+
* Navigation v2 (BOFF-11848, FluidGrids only): a "What you'll need" panel
|
|
709
|
+
* beside the canvas (apps and their status, accounts, values, price, author,
|
|
710
|
+
* steps, use counts), the canvas fits the whole template on screen, the badge
|
|
711
|
+
* says nothing is created until Use, and a paid template asks first.
|
|
712
|
+
*/
|
|
713
|
+
/** The read-only badge: today's words, or (v2) why it matters. */
|
|
714
|
+
function PreviewBadge({ plain }) {
|
|
715
|
+
const text = useTr()("fluidgrids.pages.templatePreview.readOnlyBadge", plain ? "Preview — nothing is created until you click Use" : "Preview · read-only");
|
|
716
|
+
return /* @__PURE__ */ jsx("span", {
|
|
717
|
+
className: plain ? "min-w-0 truncate rounded-full bg-card-foreground/10 px-2 py-0.5 text-[11px] font-medium text-muted-foreground" : "shrink-0 rounded-full bg-card-foreground/10 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",
|
|
718
|
+
title: plain ? text : void 0,
|
|
719
|
+
"data-testid": "template-preview-badge",
|
|
720
|
+
children: text
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
/** A message in place of the canvas, with the way back to Templates. */
|
|
724
|
+
function PreviewMessage({ message, onBack, alert = false, kind = "error" }) {
|
|
725
|
+
const tr = useTr();
|
|
726
|
+
return /* @__PURE__ */ jsx(EmptyState, {
|
|
727
|
+
kind,
|
|
728
|
+
size: "page",
|
|
729
|
+
className: "h-full",
|
|
730
|
+
icon: alert ? /* @__PURE__ */ jsx(PreviewAlertIcon, { className: "size-8 text-muted-foreground" }) : null,
|
|
731
|
+
title: message,
|
|
732
|
+
action: /* @__PURE__ */ jsx(Button$1, {
|
|
733
|
+
variant: "outline",
|
|
734
|
+
onClick: onBack,
|
|
735
|
+
children: tr("fluidgrids.pages.templatePreview.backToTemplates", "Back to templates")
|
|
736
|
+
})
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
function PreviewLoading() {
|
|
740
|
+
const tr = useTr();
|
|
741
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
742
|
+
className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground",
|
|
743
|
+
children: [/* @__PURE__ */ jsx(PreviewSpinner, { className: "size-4" }), tr("fluidgrids.pages.templatePreview.loadingPreview", "Loading preview…")]
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
function TemplatePreview() {
|
|
747
|
+
const { productId } = useParams();
|
|
748
|
+
const navigate = useNavigate();
|
|
749
|
+
const location = useLocation();
|
|
750
|
+
const tr = useTr();
|
|
751
|
+
const v2 = useNavigationV2();
|
|
752
|
+
const { installedAppIds, installationsMap } = useInstalledNodes();
|
|
753
|
+
const { workflow, template, content, loading, error, requiredNodes, stepNodes } = useTemplatePreviewLoad(productId, v2);
|
|
754
|
+
const [quotaRefusal, setQuotaRefusal] = useState(null);
|
|
755
|
+
const [confirmPaid, setConfirmPaid] = useState(false);
|
|
756
|
+
const workflowsBase = location.pathname.replace(/\/templates(\/.*)?$/, "");
|
|
757
|
+
const nodeCheck = useMemo(() => requiredNodes ? buildNodeCheck(requiredNodes, installedAppIds, installationsMap) : null, [
|
|
758
|
+
requiredNodes,
|
|
759
|
+
installedAppIds,
|
|
760
|
+
installationsMap
|
|
761
|
+
]);
|
|
762
|
+
const steps = useMemo(() => templateSteps(stepNodes), [stepNodes]);
|
|
763
|
+
const templateImport = useTemplateImportFlow({
|
|
764
|
+
onImported: (created) => navigate(`${workflowsBase}/workflow/${created.workflowKey}/${created.version}`),
|
|
765
|
+
onQuotaRefusal: setQuotaRefusal
|
|
766
|
+
});
|
|
767
|
+
const importing = templateImport.busy;
|
|
768
|
+
const handleUse = () => {
|
|
769
|
+
if (!template) return;
|
|
770
|
+
if (v2 && isPaidTemplate(template)) {
|
|
771
|
+
setConfirmPaid(true);
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
templateImport.start(template);
|
|
775
|
+
};
|
|
776
|
+
const backToTemplates = () => navigate(`${workflowsBase}/templates`);
|
|
777
|
+
return /* @__PURE__ */ jsxs(ThemeProvider, { children: [
|
|
778
|
+
/* @__PURE__ */ jsxs("div", {
|
|
779
|
+
className: "flex h-full w-full flex-col overflow-hidden",
|
|
780
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
781
|
+
className: "flex h-14 shrink-0 items-center justify-between gap-3 border-b border-card-foreground/10 bg-gradient-to-r from-primary/40 to-transparent px-3",
|
|
782
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
783
|
+
className: "flex min-w-0 items-center gap-2",
|
|
784
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
785
|
+
type: "button",
|
|
786
|
+
onClick: backToTemplates,
|
|
787
|
+
title: tr("fluidgrids.pages.templatePreview.backTooltip", "Back to templates"),
|
|
788
|
+
className: "flex size-9 shrink-0 items-center justify-center rounded-md text-card-foreground transition-colors hover:bg-card-foreground/10",
|
|
789
|
+
children: /* @__PURE__ */ jsx(PreviewBackIcon, { className: "size-5" })
|
|
790
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
791
|
+
className: "min-w-0",
|
|
792
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
793
|
+
className: "flex items-center gap-2",
|
|
794
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
795
|
+
className: "truncate text-sm font-semibold text-card-foreground",
|
|
796
|
+
children: workflow?.name ?? template?.name ?? tr("fluidgrids.pages.templatePreview.fallbackHeaderTitle", "Template preview")
|
|
797
|
+
}), /* @__PURE__ */ jsx(PreviewBadge, { plain: v2 })]
|
|
798
|
+
}), template?.description ? /* @__PURE__ */ jsx("span", {
|
|
799
|
+
className: "block truncate text-xs text-muted-foreground",
|
|
800
|
+
children: template.description
|
|
801
|
+
}) : null]
|
|
802
|
+
})]
|
|
803
|
+
}), /* @__PURE__ */ jsx(WithOpenTemplateAsCode, {
|
|
804
|
+
templateName: template ? template.name : null,
|
|
805
|
+
content,
|
|
806
|
+
className: "shrink-0",
|
|
807
|
+
wrapperClassName: "flex shrink-0 items-center gap-2",
|
|
808
|
+
children: /* @__PURE__ */ jsx(SdkPermissionButton, {
|
|
809
|
+
permission: FLUIDGRIDS_PERMISSIONS.WORKFLOW_CREATE,
|
|
810
|
+
deniedTooltip: tr("fluidgrids.templates.useDeniedTooltip", "You don't have permission to create workflows from templates"),
|
|
811
|
+
children: /* @__PURE__ */ jsxs(Button$1, {
|
|
812
|
+
onClick: handleUse,
|
|
813
|
+
disabled: importing || !template,
|
|
814
|
+
className: "shrink-0 gap-2",
|
|
815
|
+
children: [importing ? /* @__PURE__ */ jsx(PreviewSpinner, { className: "size-4" }) : /* @__PURE__ */ jsx(PreviewPlusIcon, { className: "size-4" }), tr("fluidgrids.pages.templatePreview.useThisTemplate", "Use this template")]
|
|
816
|
+
})
|
|
817
|
+
})
|
|
818
|
+
})]
|
|
819
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
820
|
+
className: v2 ? "flex min-h-0 w-full flex-1 flex-col lg:flex-row-reverse" : "contents",
|
|
821
|
+
children: [v2 && template && workflow && /* @__PURE__ */ jsx(TemplateNeedsPanel, {
|
|
822
|
+
template,
|
|
823
|
+
content,
|
|
824
|
+
nodeCheck,
|
|
825
|
+
steps
|
|
826
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
827
|
+
className: "relative min-h-0 w-full flex-1",
|
|
828
|
+
children: /* @__PURE__ */ jsx(ErrorBoundary, {
|
|
829
|
+
fallback: () => /* @__PURE__ */ jsx(PreviewMessage, {
|
|
830
|
+
message: tr("fluidgrids.pages.templatePreview.renderErrorMessage", "Something went wrong rendering this template preview."),
|
|
831
|
+
onBack: backToTemplates
|
|
832
|
+
}),
|
|
833
|
+
children: loading ? /* @__PURE__ */ jsx(PreviewLoading, {}) : error ? /* @__PURE__ */ jsx(PreviewMessage, {
|
|
834
|
+
alert: true,
|
|
835
|
+
kind: productId ? "error" : "not-found",
|
|
836
|
+
message: error,
|
|
837
|
+
onBack: backToTemplates
|
|
838
|
+
}) : workflow ? /* @__PURE__ */ jsx(FlowBuilderPage, {
|
|
839
|
+
workflow,
|
|
840
|
+
readOnly: true,
|
|
841
|
+
fitToScreen: v2
|
|
842
|
+
}) : null
|
|
843
|
+
})
|
|
844
|
+
})]
|
|
845
|
+
})]
|
|
846
|
+
}),
|
|
847
|
+
templateImport.dialog,
|
|
848
|
+
/* @__PURE__ */ jsx(PaidTemplateConfirm, {
|
|
849
|
+
template: confirmPaid ? template : null,
|
|
850
|
+
onConfirm: () => {
|
|
851
|
+
setConfirmPaid(false);
|
|
852
|
+
if (template) templateImport.start(template);
|
|
853
|
+
},
|
|
854
|
+
onCancel: () => setConfirmPaid(false)
|
|
855
|
+
}),
|
|
856
|
+
/* @__PURE__ */ jsx(CreateWorkflowRefusalDialog, {
|
|
857
|
+
surface: "template-import",
|
|
858
|
+
refusal: quotaRefusal ? refusalOfQuota(quotaRefusal) : null,
|
|
859
|
+
onClose: () => setQuotaRefusal(null),
|
|
860
|
+
onUpgrade: () => {
|
|
861
|
+
setQuotaRefusal(null);
|
|
862
|
+
navigate(BILLING_PLANS_PATH);
|
|
863
|
+
}
|
|
864
|
+
})
|
|
865
|
+
] });
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
export { TemplatePreview_exports as n, TemplatePreview as t };
|