@burdenoff/fluidgrids-fe-sdk 2026.1111.16 → 2026.1111.17

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.
Files changed (112) hide show
  1. package/README.md +41 -0
  2. package/dist/AiStudioPage-kJHSsIcj.js +774 -0
  3. package/dist/ApprovalInboxPage-dbBDSJ-f.js +558 -0
  4. package/dist/DataSinkDashboardPage-1h2QsMzH.js +270 -0
  5. package/dist/DataTablesPage-BZy2z0LB.js +1690 -0
  6. package/dist/EntityTagPicker-BqRNsLCQ.js +135 -0
  7. package/dist/{ExecutionDetailPage-D-0_POAf.js → ExecutionDetailPage-BdcZmLT4.js} +799 -4420
  8. package/dist/ExecutionDetailPage-DvQ667OE.d.ts +10 -0
  9. package/dist/ExecutionsListPage-BCUJoAIE.js +2742 -0
  10. package/dist/{FailureTriagePanel-BHiduL7A.js → FailureTriagePanel-B9hDQymi.js} +4 -97
  11. package/dist/{FluidGridsProvider-DmvFADFa.js → FluidGridsProvider-dvZSNtSW.js} +10 -350
  12. package/dist/HistoryPage-BLoRpJ1R.d.ts +6 -0
  13. package/dist/{HistoryPage-BbUgxx1I.js → HistoryPage-U0tqupBN.js} +6 -4
  14. package/dist/HumanRequestCard-D-ooVPDn.js +439 -0
  15. package/dist/{InsightsPage-s6f5bU-8.js → InsightsPage-CALo16eB.js} +17 -328
  16. package/dist/ManagedAiPolicyAuthority-BxwJ3ptd.js +40 -0
  17. package/dist/{ManagedAiPolicyAuthority-CGux_DaV.d.ts → ManagedAiPolicyAuthority-DM3t3wNr.d.ts} +1 -5
  18. package/dist/ManagedAiPolicyAuthorityContext-CNkxIOZ1.js +10 -0
  19. package/dist/{MissingNodesInstallModal-B-9gHy2K.js → MissingNodesInstallModal-CMybsI8h.js} +3 -2
  20. package/dist/{NodesPage-ClvhUfbh.js → NodesPage-Bf5PhfBK.js} +7 -3
  21. package/dist/NodesPage-DEbnz9iU.d.ts +6 -0
  22. package/dist/{PublishCustomNodeAction-D2F7oN0S.js → PublishCustomNodeAction-5XXnSA3H.js} +3 -45
  23. package/dist/QuotaExhaustedDialog-7IFSaLyi.js +54 -0
  24. package/dist/RunnerStatusPill-Ctg4TJcP.js +187 -0
  25. package/dist/RunnersPage-CLCOCclc.js +467 -0
  26. package/dist/{ManagedAiPolicyAuthority-DsSaz-vg.js → SettingsPage-CgkRlCM5.js} +19 -50
  27. package/dist/SettingsPage-DMHQFj5-.d.ts +9 -0
  28. package/dist/TagFilterSelect-DCBOH6Ou.js +41 -0
  29. package/dist/TaskQueuesPage-9VgSnLdL.js +951 -0
  30. package/dist/TemplateCard-DsC0KNH1.js +1416 -0
  31. package/dist/{TemplateConfigurationModal-D_Mvgxqa.js → TemplateConfigurationModal-BhGWIzpm.js} +3 -2
  32. package/dist/{TemplateDetailPanel-DfFfUcOe.js → TemplateDetailPanel-D4cUVr-m.js} +3 -3
  33. package/dist/TemplatePreview-GthzCOSo.js +231 -0
  34. package/dist/TemplatesPage-BG3H-6v6.d.ts +10 -0
  35. package/dist/{TemplatesPage-Cku13bav.js → TemplatesPage-CsDNT54N.js} +11 -228
  36. package/dist/VariablesPage-67WR_lVE.js +949 -0
  37. package/dist/{VersionDiffDialog-Dq2xlPFI.js → VersionDiffDialog-DSN0mU0f.js} +2 -1
  38. package/dist/WorkflowBuilder-DEi_9YOb.js +555 -0
  39. package/dist/{WorkflowSearchRedirect-CaoOOpEl.js → WorkflowBuilder-iPqXgbYr.js} +19 -585
  40. package/dist/{WorkflowProposalCard-8Vr56kQa.js → WorkflowProposalCard-qrEeNyYG.js} +4 -405
  41. package/dist/WorkflowSearchRedirect-DwDNZ_q5.js +36 -0
  42. package/dist/{WorkflowShareDialog-6RRDe-_v.js → WorkflowShareDialog-B_gn968c.js} +6 -52
  43. package/dist/{WorkflowsList-B2j1Pehb.js → WorkflowsList-CA20dVIl.js} +11 -6
  44. package/dist/WorkflowsList-CcNDQge5.d.ts +6 -0
  45. package/dist/agent-form-Bfvm32j1.js +83 -0
  46. package/dist/{agentTools-DJ5o2ekg.js → agentTools-CkRJB7r5.js} +3 -2
  47. package/dist/{ai-usage-D5p7ZeRR.js → ai-usage-glCwHyQz.js} +1 -1
  48. package/dist/api-BrCHB5oA.js +224 -0
  49. package/dist/api-C8e0iV-Q.js +55 -0
  50. package/dist/button-DG7y_FVJ.js +48 -0
  51. package/dist/{canvasNoteTools-D3zUdEeg.js → canvasNoteTools-CQIc7Oxg.js} +2 -2
  52. package/dist/client-C9XSzSXr.js +1147 -0
  53. package/dist/{codec-client-DstqyzTN.js → codec-client-CJ95Rmqo.js} +1 -1
  54. package/dist/constants-B2lhWNoN.js +202 -0
  55. package/dist/constants-XdvUxeWK.d.ts +162 -0
  56. package/dist/dialog-Cjb4lB4D.js +105 -0
  57. package/dist/executions.d.ts +1 -1
  58. package/dist/executions.js +2 -1
  59. package/dist/feature-flags-DM5myWaD.js +296 -0
  60. package/dist/flags.d.ts +3 -0
  61. package/dist/flags.js +4 -0
  62. package/dist/{flow-builder-DEzT8TQu.js → flow-builder-y2Y1iG4Y.js} +70 -1731
  63. package/dist/{node-endpoint-configs-DHFGA5MQ.js → graphql-operation-types-kX-MMjgW.js} +1 -1194
  64. package/dist/{graphql-types-XcDLtFwU.js → graphql-types-CDKVWH2R.js} +2 -202
  65. package/dist/history.d.ts +1 -1
  66. package/dist/history.js +1 -1
  67. package/dist/index-72XFgvbn.d.ts +132 -0
  68. package/dist/index-BcdtKBM-.d.ts +56 -0
  69. package/dist/{index-B3BWqafN.d.ts → index-DjiFgEQl.d.ts} +5 -131
  70. package/dist/{index-DRf25-D3.d.ts → index-W2o__Nm6.d.ts} +32 -214
  71. package/dist/index.d.ts +13 -9
  72. package/dist/index.js +50 -5300
  73. package/dist/{node-detail-view-LNqeIqN-.js → node-detail-view-B91kXzIy.js} +11 -8
  74. package/dist/node-endpoint-configs-B5bjNMDW.js +37 -0
  75. package/dist/node-registry-refresh-Dy0uRg9f.js +84 -0
  76. package/dist/nodes.d.ts +1 -1
  77. package/dist/nodes.js +1 -1
  78. package/dist/observability.d.ts +1 -1
  79. package/dist/observability.js +2 -1
  80. package/dist/{quick-config-panel-D3ogsaFL.js → quick-config-panel-DggPl1vY.js} +2 -2
  81. package/dist/rolldown-runtime-hDbaFkMy.js +18 -0
  82. package/dist/run-display-BycKYSU0.js +46 -0
  83. package/dist/run-list-links-ByYC0OlV.js +98 -0
  84. package/dist/settings.d.ts +2 -1
  85. package/dist/settings.js +2 -1
  86. package/dist/shared-CMfn30xT.js +196 -0
  87. package/dist/templates.d.ts +1 -1
  88. package/dist/templates.js +2 -1
  89. package/dist/theme-provider-B3mIuz2d.js +11 -0
  90. package/dist/{useAgentDefinitions-NFtLytDR.js → useAgentDefinitions-Dpz0HDTq.js} +2 -1
  91. package/dist/useDurableParity-CzUQMFJ3.js +415 -0
  92. package/dist/useEntityTags-DhnsZcTl.js +236 -0
  93. package/dist/{useExecutions-DAzeWHS6.js → useExecutions-9aLuOt1c.js} +4 -3
  94. package/dist/{useObservability-COCZ0hUS.js → useObservability-CfEw3ZFD.js} +2 -2
  95. package/dist/{useRunHistory-CsYUbouO.js → useRunHistory-B1xJDwl1.js} +4 -3
  96. package/dist/{useWorkflows-w4Dx2fF2.js → useWorkflows-BlVVu8NM.js} +3 -2
  97. package/dist/utils-uaL5UVxb.js +65 -0
  98. package/dist/workflow-builder.d.ts +1 -1
  99. package/dist/workflow-builder.js +4 -2
  100. package/dist/workflow-host.d.ts +6 -0
  101. package/dist/workflow-host.js +9 -0
  102. package/dist/workflow-pages.d.ts +55 -0
  103. package/dist/workflow-pages.js +113 -0
  104. package/dist/workflows-list.d.ts +1 -1
  105. package/dist/workflows-list.js +1 -1
  106. package/package.json +13 -1
  107. package/dist/ExecutionDetailPage-MvsnOnE1.d.ts +0 -4
  108. package/dist/HistoryPage-BqUizaFv.d.ts +0 -3
  109. package/dist/NodesPage-C97-9K2Y.d.ts +0 -3
  110. package/dist/TemplatesPage-D0qnXzHh.d.ts +0 -4
  111. package/dist/WorkflowsList-0d5GSKdh.d.ts +0 -3
  112. package/dist/agent-form-BvMWhQ42.js +0 -496
@@ -1,6 +1,7 @@
1
1
  "use client";
2
- import { C as Dialog, D as DialogFooter, E as DialogDescription, O as DialogHeader, T as DialogContent, bt as Input, j as DialogTitle, x as Badge } from "./flow-builder-DEzT8TQu.js";
3
- import { i as Button } from "./PublishCustomNodeAction-D2F7oN0S.js";
2
+ import { a as DialogFooter, d as Input, i as DialogDescription, l as DialogTitle, o as DialogHeader, r as DialogContent, t as Dialog } from "./dialog-Cjb4lB4D.js";
3
+ import { t as Button } from "./button-DG7y_FVJ.js";
4
+ import { r as Badge } from "./TemplateCard-DsC0KNH1.js";
4
5
  import { t as Label } from "./label-CDy86rIZ.js";
5
6
  import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
6
7
  import { useEffect, useMemo, useState } from "react";
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { i as Button } from "./PublishCustomNodeAction-D2F7oN0S.js";
3
- import { b as templatePreview, x as Badge } from "./flow-builder-DEzT8TQu.js";
2
+ import { t as Button } from "./button-DG7y_FVJ.js";
3
+ import { n as templatePreview, r as Badge } from "./TemplateCard-DsC0KNH1.js";
4
4
  import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
5
- import { hI as FLUIDGRIDS_PERMISSIONS, vI as SdkPermissionButton } from "./graphql-types-XcDLtFwU.js";
5
+ import { i as SdkPermissionButton, t as FLUIDGRIDS_PERMISSIONS } from "./constants-B2lhWNoN.js";
6
6
  import { Icon } from "@iconify/react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  import { Calendar, Download, ExternalLink, Eye, Sparkles, Star, Tag, User, X } from "lucide-react";
@@ -0,0 +1,231 @@
1
+ "use client";
2
+ import { t as __exportAll } from "./rolldown-runtime-hDbaFkMy.js";
3
+ import { t as ThemeProvider } from "./theme-provider-B3mIuz2d.js";
4
+ import { t as FlowBuilderPage } from "./flow-builder-y2Y1iG4Y.js";
5
+ import { a as useTemplateImportFlow, l as useImportWorkflowTemplate } from "./TemplateCard-DsC0KNH1.js";
6
+ import { t as QuotaExhaustedDialog } from "./QuotaExhaustedDialog-7IFSaLyi.js";
7
+ import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
8
+ import { i as SdkPermissionButton, t as FLUIDGRIDS_PERMISSIONS } from "./constants-B2lhWNoN.js";
9
+ import { f as BILLING_PLANS_PATH } from "./fluidgridsEvents-CNdcrUNN.js";
10
+ import { useEffect, useState } from "react";
11
+ import { useNavigate, useParams } from "react-router";
12
+ import { Icon } from "@iconify/react";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ import { ErrorBoundary } from "@burdenoff/fe-libs/shared/components";
15
+ import { Button } from "@burdenoff/fe-libs/button";
16
+ import "@xyflow/react/dist/style.css";
17
+
18
+ // src/utils/template-graph.ts
19
+ /**
20
+ * Extract nodes/edges from a template `content` object.
21
+ * Returns null when the content carries no renderable graph.
22
+ */
23
+ function extractTemplateGraph(content) {
24
+ const dj = content?.definitionJson;
25
+ if (!dj) return null;
26
+ const graph = dj.data ?? dj;
27
+ const nodes = graph?.nodes ?? [];
28
+ const edges = graph?.edges ?? [];
29
+ if (!nodes.length) return null;
30
+ return {
31
+ nodes,
32
+ edges
33
+ };
34
+ }
35
+
36
+ // src/pages/TemplatePreview.tsx
37
+ var TemplatePreview_exports = /* @__PURE__ */ __exportAll({ TemplatePreview: () => TemplatePreview });
38
+ /**
39
+ * TemplatePreview — a read-only, n8n-style preview of a store workflow template.
40
+ *
41
+ * It loads the template's `content.definitionJson`, seeds the builder's flow
42
+ * store with the graph, and renders the *real* builder canvas in read-only mode
43
+ * (no dragging/connecting/editing — pan + zoom only). A header shows the
44
+ * template name/description and a "Use this template" CTA that imports the
45
+ * template and opens the editable builder. Nothing is created until the user
46
+ * clicks "Use this template".
47
+ */
48
+ function TemplatePreview() {
49
+ const { productId } = useParams();
50
+ const navigate = useNavigate();
51
+ const tr = useTr();
52
+ const { getTemplateDetail, parseTemplateContent } = useImportWorkflowTemplate();
53
+ const [workflow, setWorkflow] = useState(null);
54
+ const [template, setTemplate] = useState(null);
55
+ const [loading, setLoading] = useState(true);
56
+ const [error, setError] = useState(null);
57
+ const [showQuotaExhausted, setShowQuotaExhausted] = useState(false);
58
+ const workflowsBase = window.location.pathname.replace(/\/templates(\/.*)?$/, "");
59
+ useEffect(() => {
60
+ let mounted = true;
61
+ const load = async () => {
62
+ if (!productId) {
63
+ setError(tr("fluidgrids.pages.templatePreview.errorNoTemplateSpecified", "No template specified."));
64
+ setLoading(false);
65
+ return;
66
+ }
67
+ try {
68
+ const full = await getTemplateDetail(productId);
69
+ if (!full) {
70
+ if (mounted) {
71
+ setError(tr("fluidgrids.pages.templatePreview.errorLoadFailed", "Failed to load template."));
72
+ setLoading(false);
73
+ }
74
+ return;
75
+ }
76
+ const content = parseTemplateContent(full);
77
+ const graph = extractTemplateGraph(content);
78
+ const nodes = graph?.nodes ?? [];
79
+ const edges = graph?.edges ?? [];
80
+ if (!nodes.length) {
81
+ if (mounted) {
82
+ setError(tr("fluidgrids.pages.templatePreview.errorNoWorkflow", "This template has no workflow to preview."));
83
+ setLoading(false);
84
+ }
85
+ return;
86
+ }
87
+ if (mounted) {
88
+ setTemplate(full);
89
+ setWorkflow({
90
+ id: productId,
91
+ workflowKey: productId,
92
+ version: "preview",
93
+ name: full.name ?? tr("fluidgrids.pages.templatePreview.fallbackTemplateName", "Template"),
94
+ nodes,
95
+ edges,
96
+ sidebar: {
97
+ active: "none",
98
+ panels: { nodeProperties: { selectedNode: null } }
99
+ }
100
+ });
101
+ setLoading(false);
102
+ }
103
+ } catch (e) {
104
+ if (mounted) {
105
+ setError(e instanceof Error ? e.message : tr("fluidgrids.pages.templatePreview.errorLoadFailed", "Failed to load template."));
106
+ setLoading(false);
107
+ }
108
+ }
109
+ };
110
+ load();
111
+ return () => {
112
+ mounted = false;
113
+ };
114
+ }, [
115
+ productId,
116
+ getTemplateDetail,
117
+ parseTemplateContent,
118
+ tr
119
+ ]);
120
+ const templateImport = useTemplateImportFlow({
121
+ onImported: (created) => navigate(`${workflowsBase}/workflow/${created.workflowKey}/${created.version}`),
122
+ onQuotaExhausted: () => setShowQuotaExhausted(true)
123
+ });
124
+ const importing = templateImport.busy;
125
+ const handleUse = () => {
126
+ if (template) templateImport.start(template);
127
+ };
128
+ const backToTemplates = () => navigate(`${workflowsBase}/templates`);
129
+ return /* @__PURE__ */ jsxs(ThemeProvider, { children: [
130
+ /* @__PURE__ */ jsxs("div", {
131
+ className: "flex h-full w-full flex-col overflow-hidden",
132
+ children: [/* @__PURE__ */ jsxs("div", {
133
+ 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",
134
+ children: [/* @__PURE__ */ jsxs("div", {
135
+ className: "flex min-w-0 items-center gap-2",
136
+ children: [/* @__PURE__ */ jsx("button", {
137
+ type: "button",
138
+ onClick: backToTemplates,
139
+ title: tr("fluidgrids.pages.templatePreview.backTooltip", "Back to templates"),
140
+ className: "flex size-9 shrink-0 items-center justify-center rounded-md text-card-foreground transition-colors hover:bg-card-foreground/10",
141
+ children: /* @__PURE__ */ jsx(Icon, {
142
+ icon: "ion:arrow-back-outline",
143
+ className: "size-5"
144
+ })
145
+ }), /* @__PURE__ */ jsxs("div", {
146
+ className: "min-w-0",
147
+ children: [/* @__PURE__ */ jsxs("div", {
148
+ className: "flex items-center gap-2",
149
+ children: [/* @__PURE__ */ jsx("span", {
150
+ className: "truncate text-sm font-semibold text-card-foreground",
151
+ children: workflow?.name ?? template?.name ?? tr("fluidgrids.pages.templatePreview.fallbackHeaderTitle", "Template preview")
152
+ }), /* @__PURE__ */ jsx("span", {
153
+ className: "shrink-0 rounded-full bg-card-foreground/10 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",
154
+ children: tr("fluidgrids.pages.templatePreview.readOnlyBadge", "Preview · read-only")
155
+ })]
156
+ }), template?.description ? /* @__PURE__ */ jsx("span", {
157
+ className: "block truncate text-xs text-muted-foreground",
158
+ children: template.description
159
+ }) : null]
160
+ })]
161
+ }), /* @__PURE__ */ jsx(SdkPermissionButton, {
162
+ permission: FLUIDGRIDS_PERMISSIONS.WORKFLOW_CREATE,
163
+ deniedTooltip: tr("fluidgrids.templates.useDeniedTooltip", "You don't have permission to create workflows from templates"),
164
+ children: /* @__PURE__ */ jsxs(Button, {
165
+ onClick: handleUse,
166
+ disabled: importing || !template,
167
+ className: "shrink-0 gap-2",
168
+ children: [/* @__PURE__ */ jsx(Icon, {
169
+ icon: importing ? "svg-spinners:ring-resize" : "mdi:plus",
170
+ className: "size-4"
171
+ }), tr("fluidgrids.pages.templatePreview.useThisTemplate", "Use this template")]
172
+ })
173
+ })]
174
+ }), /* @__PURE__ */ jsx("div", {
175
+ className: "relative min-h-0 w-full flex-1",
176
+ children: /* @__PURE__ */ jsx(ErrorBoundary, {
177
+ fallback: () => /* @__PURE__ */ jsxs("div", {
178
+ className: "flex h-full flex-col items-center justify-center gap-3 p-8 text-center",
179
+ children: [/* @__PURE__ */ jsx("p", {
180
+ className: "text-sm text-muted-foreground",
181
+ children: tr("fluidgrids.pages.templatePreview.renderErrorMessage", "Something went wrong rendering this template preview.")
182
+ }), /* @__PURE__ */ jsx(Button, {
183
+ variant: "outline",
184
+ onClick: backToTemplates,
185
+ children: tr("fluidgrids.pages.templatePreview.backToTemplates", "Back to templates")
186
+ })]
187
+ }),
188
+ children: loading ? /* @__PURE__ */ jsxs("div", {
189
+ className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground",
190
+ children: [/* @__PURE__ */ jsx(Icon, {
191
+ icon: "svg-spinners:ring-resize",
192
+ className: "size-4"
193
+ }), tr("fluidgrids.pages.templatePreview.loadingPreview", "Loading preview…")]
194
+ }) : error ? /* @__PURE__ */ jsxs("div", {
195
+ className: "flex h-full flex-col items-center justify-center gap-3 p-8 text-center",
196
+ children: [
197
+ /* @__PURE__ */ jsx(Icon, {
198
+ icon: "mdi:alert-circle-outline",
199
+ className: "size-8 text-muted-foreground"
200
+ }),
201
+ /* @__PURE__ */ jsx("p", {
202
+ className: "text-sm text-muted-foreground",
203
+ children: error
204
+ }),
205
+ /* @__PURE__ */ jsx(Button, {
206
+ variant: "outline",
207
+ onClick: backToTemplates,
208
+ children: tr("fluidgrids.pages.templatePreview.backToTemplates", "Back to templates")
209
+ })
210
+ ]
211
+ }) : workflow ? /* @__PURE__ */ jsx(FlowBuilderPage, {
212
+ workflow,
213
+ readOnly: true
214
+ }) : null
215
+ })
216
+ })]
217
+ }),
218
+ templateImport.dialog,
219
+ /* @__PURE__ */ jsx(QuotaExhaustedDialog, {
220
+ surface: "template-import",
221
+ open: showQuotaExhausted,
222
+ onOpenChange: setShowQuotaExhausted,
223
+ onUpgrade: () => {
224
+ setShowQuotaExhausted(false);
225
+ navigate(BILLING_PLANS_PATH);
226
+ }
227
+ })
228
+ ] });
229
+ }
230
+
231
+ export { TemplatePreview_exports as n, extractTemplateGraph as r, TemplatePreview as t };
@@ -0,0 +1,10 @@
1
+
2
+ declare namespace TemplatePreview_d_exports {
3
+ export { TemplatePreview };
4
+ }
5
+ declare function TemplatePreview(): import("react").JSX.Element;
6
+ declare namespace TemplatesPage_d_exports {
7
+ export { TemplatesPage };
8
+ }
9
+ declare function TemplatesPage(): import("react").JSX.Element;
10
+ export { TemplatePreview_d_exports as i, TemplatesPage_d_exports as n, TemplatePreview as r, TemplatesPage as t };
@@ -1,27 +1,26 @@
1
1
  "use client";
2
- import { Bi as describeOperationError, Ui as throwIfResultError } from "./node-endpoint-configs-DHFGA5MQ.js";
3
- import { O as MyWorkflowTemplateSubmissionsDocument, P as WithdrawWorkflowTemplateSubmissionDocument, j as SubmitWorkflowTemplateDocument, pn as useFluidGridsAnalytics } from "./FluidGridsProvider-DmvFADFa.js";
2
+ import { t as __exportAll } from "./rolldown-runtime-hDbaFkMy.js";
3
+ import { h as useWorkflowDefinitions, l as useLazyWorkflowDefinition, s as useDuplicateWorkflow } from "./useWorkflows-BlVVu8NM.js";
4
+ import { a as useTemplateImportFlow, t as TemplateCard, u as useWorkflowTemplates, y as useGlobalStoreClient } from "./TemplateCard-DsC0KNH1.js";
5
+ import { YF as WorkflowStatus } from "./graphql-types-CDKVWH2R.js";
6
+ import { i as SdkPermissionButton, t as FLUIDGRIDS_PERMISSIONS } from "./constants-B2lhWNoN.js";
7
+ import { t as QuotaExhaustedDialog } from "./QuotaExhaustedDialog-7IFSaLyi.js";
4
8
  import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
5
- import { P as useTemplateImportFlow, R as useImportWorkflowTemplate, Z as useGlobalStoreClient, t as FlowBuilderPage, y as TemplateCard, z as useWorkflowTemplates } from "./flow-builder-DEzT8TQu.js";
9
+ import { O as MyWorkflowTemplateSubmissionsDocument, P as WithdrawWorkflowTemplateSubmissionDocument, j as SubmitWorkflowTemplateDocument, pn as useFluidGridsAnalytics } from "./FluidGridsProvider-dvZSNtSW.js";
6
10
  import { a as emitTemplateUsed, f as BILLING_PLANS_PATH, y as isQuotaExhaustedFailure } from "./fluidgridsEvents-CNdcrUNN.js";
7
- import { h as useWorkflowDefinitions, l as useLazyWorkflowDefinition, s as useDuplicateWorkflow } from "./useWorkflows-w4Dx2fF2.js";
8
- import { k as QuotaExhaustedDialog } from "./WorkflowShareDialog-6RRDe-_v.js";
9
- import { YF as WorkflowStatus, hI as FLUIDGRIDS_PERMISSIONS, vI as SdkPermissionButton } from "./graphql-types-XcDLtFwU.js";
10
11
  import { n as useFluidGridsPageControls } from "./pageControlsBridge-0pX9s-3k.js";
11
12
  import { r as templatesControls } from "./pageControlSpecs-DZJ9K37m.js";
12
13
  import { t as FluidGridsDocsLink } from "./FluidGridsDocsLink-JxkBpOeb.js";
14
+ import { _ as throwIfResultError, m as describeOperationError } from "./client-C9XSzSXr.js";
13
15
  import { useCallback, useEffect, useMemo, useState } from "react";
14
- import { useNavigate, useParams } from "react-router";
16
+ import { useNavigate } from "react-router";
15
17
  import { useQuery } from "@apollo/client/react";
16
18
  import { Icon } from "@iconify/react";
17
19
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
18
20
  import { toast } from "sonner";
19
21
  import { Badge, Card, CardHeader, Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, Input, Label, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Skeleton, Textarea } from "@burdenoff/fe-libs/ui";
20
- import { ErrorBoundary } from "@burdenoff/fe-libs/shared/components";
21
22
  import { Button as Button$1 } from "@burdenoff/fe-libs/button";
22
23
  import { v4 } from "uuid";
23
- import { ThemeProvider } from "@burdenoff/fe-libs/shared/providers/shell";
24
- import "@xyflow/react/dist/style.css";
25
24
 
26
25
  // src/hooks/store/usePublishToStore.ts
27
26
  /** Categories a community template can be filed under (matches the store). */
@@ -151,223 +150,6 @@ function useTemplateSubmissions(enabled = true, limit = 50) {
151
150
  };
152
151
  }
153
152
 
154
- // src/builder/components/theme-provider.tsx
155
- function ThemeProvider$1({ children }) {
156
- return /* @__PURE__ */ jsx(ThemeProvider, { children });
157
- }
158
-
159
- // src/utils/template-graph.ts
160
- /**
161
- * Extract nodes/edges from a template `content` object.
162
- * Returns null when the content carries no renderable graph.
163
- */
164
- function extractTemplateGraph(content) {
165
- const dj = content?.definitionJson;
166
- if (!dj) return null;
167
- const graph = dj.data ?? dj;
168
- const nodes = graph?.nodes ?? [];
169
- const edges = graph?.edges ?? [];
170
- if (!nodes.length) return null;
171
- return {
172
- nodes,
173
- edges
174
- };
175
- }
176
-
177
- // src/pages/TemplatePreview.tsx
178
- /**
179
- * TemplatePreview — a read-only, n8n-style preview of a store workflow template.
180
- *
181
- * It loads the template's `content.definitionJson`, seeds the builder's flow
182
- * store with the graph, and renders the *real* builder canvas in read-only mode
183
- * (no dragging/connecting/editing — pan + zoom only). A header shows the
184
- * template name/description and a "Use this template" CTA that imports the
185
- * template and opens the editable builder. Nothing is created until the user
186
- * clicks "Use this template".
187
- */
188
- function TemplatePreview() {
189
- const { productId } = useParams();
190
- const navigate = useNavigate();
191
- const tr = useTr();
192
- const { getTemplateDetail, parseTemplateContent } = useImportWorkflowTemplate();
193
- const [workflow, setWorkflow] = useState(null);
194
- const [template, setTemplate] = useState(null);
195
- const [loading, setLoading] = useState(true);
196
- const [error, setError] = useState(null);
197
- const [showQuotaExhausted, setShowQuotaExhausted] = useState(false);
198
- const workflowsBase = window.location.pathname.replace(/\/templates(\/.*)?$/, "");
199
- useEffect(() => {
200
- let mounted = true;
201
- const load = async () => {
202
- if (!productId) {
203
- setError(tr("fluidgrids.pages.templatePreview.errorNoTemplateSpecified", "No template specified."));
204
- setLoading(false);
205
- return;
206
- }
207
- try {
208
- const full = await getTemplateDetail(productId);
209
- if (!full) {
210
- if (mounted) {
211
- setError(tr("fluidgrids.pages.templatePreview.errorLoadFailed", "Failed to load template."));
212
- setLoading(false);
213
- }
214
- return;
215
- }
216
- const content = parseTemplateContent(full);
217
- const graph = extractTemplateGraph(content);
218
- const nodes = graph?.nodes ?? [];
219
- const edges = graph?.edges ?? [];
220
- if (!nodes.length) {
221
- if (mounted) {
222
- setError(tr("fluidgrids.pages.templatePreview.errorNoWorkflow", "This template has no workflow to preview."));
223
- setLoading(false);
224
- }
225
- return;
226
- }
227
- if (mounted) {
228
- setTemplate(full);
229
- setWorkflow({
230
- id: productId,
231
- workflowKey: productId,
232
- version: "preview",
233
- name: full.name ?? tr("fluidgrids.pages.templatePreview.fallbackTemplateName", "Template"),
234
- nodes,
235
- edges,
236
- sidebar: {
237
- active: "none",
238
- panels: { nodeProperties: { selectedNode: null } }
239
- }
240
- });
241
- setLoading(false);
242
- }
243
- } catch (e) {
244
- if (mounted) {
245
- setError(e instanceof Error ? e.message : tr("fluidgrids.pages.templatePreview.errorLoadFailed", "Failed to load template."));
246
- setLoading(false);
247
- }
248
- }
249
- };
250
- load();
251
- return () => {
252
- mounted = false;
253
- };
254
- }, [
255
- productId,
256
- getTemplateDetail,
257
- parseTemplateContent,
258
- tr
259
- ]);
260
- const templateImport = useTemplateImportFlow({
261
- onImported: (created) => navigate(`${workflowsBase}/workflow/${created.workflowKey}/${created.version}`),
262
- onQuotaExhausted: () => setShowQuotaExhausted(true)
263
- });
264
- const importing = templateImport.busy;
265
- const handleUse = () => {
266
- if (template) templateImport.start(template);
267
- };
268
- const backToTemplates = () => navigate(`${workflowsBase}/templates`);
269
- return /* @__PURE__ */ jsxs(ThemeProvider$1, { children: [
270
- /* @__PURE__ */ jsxs("div", {
271
- className: "flex h-full w-full flex-col overflow-hidden",
272
- children: [/* @__PURE__ */ jsxs("div", {
273
- 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",
274
- children: [/* @__PURE__ */ jsxs("div", {
275
- className: "flex min-w-0 items-center gap-2",
276
- children: [/* @__PURE__ */ jsx("button", {
277
- type: "button",
278
- onClick: backToTemplates,
279
- title: tr("fluidgrids.pages.templatePreview.backTooltip", "Back to templates"),
280
- className: "flex size-9 shrink-0 items-center justify-center rounded-md text-card-foreground transition-colors hover:bg-card-foreground/10",
281
- children: /* @__PURE__ */ jsx(Icon, {
282
- icon: "ion:arrow-back-outline",
283
- className: "size-5"
284
- })
285
- }), /* @__PURE__ */ jsxs("div", {
286
- className: "min-w-0",
287
- children: [/* @__PURE__ */ jsxs("div", {
288
- className: "flex items-center gap-2",
289
- children: [/* @__PURE__ */ jsx("span", {
290
- className: "truncate text-sm font-semibold text-card-foreground",
291
- children: workflow?.name ?? template?.name ?? tr("fluidgrids.pages.templatePreview.fallbackHeaderTitle", "Template preview")
292
- }), /* @__PURE__ */ jsx("span", {
293
- className: "shrink-0 rounded-full bg-card-foreground/10 px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground",
294
- children: tr("fluidgrids.pages.templatePreview.readOnlyBadge", "Preview · read-only")
295
- })]
296
- }), template?.description ? /* @__PURE__ */ jsx("span", {
297
- className: "block truncate text-xs text-muted-foreground",
298
- children: template.description
299
- }) : null]
300
- })]
301
- }), /* @__PURE__ */ jsx(SdkPermissionButton, {
302
- permission: FLUIDGRIDS_PERMISSIONS.WORKFLOW_CREATE,
303
- deniedTooltip: tr("fluidgrids.templates.useDeniedTooltip", "You don't have permission to create workflows from templates"),
304
- children: /* @__PURE__ */ jsxs(Button$1, {
305
- onClick: handleUse,
306
- disabled: importing || !template,
307
- className: "shrink-0 gap-2",
308
- children: [/* @__PURE__ */ jsx(Icon, {
309
- icon: importing ? "svg-spinners:ring-resize" : "mdi:plus",
310
- className: "size-4"
311
- }), tr("fluidgrids.pages.templatePreview.useThisTemplate", "Use this template")]
312
- })
313
- })]
314
- }), /* @__PURE__ */ jsx("div", {
315
- className: "relative min-h-0 w-full flex-1",
316
- children: /* @__PURE__ */ jsx(ErrorBoundary, {
317
- fallback: () => /* @__PURE__ */ jsxs("div", {
318
- className: "flex h-full flex-col items-center justify-center gap-3 p-8 text-center",
319
- children: [/* @__PURE__ */ jsx("p", {
320
- className: "text-sm text-muted-foreground",
321
- children: tr("fluidgrids.pages.templatePreview.renderErrorMessage", "Something went wrong rendering this template preview.")
322
- }), /* @__PURE__ */ jsx(Button$1, {
323
- variant: "outline",
324
- onClick: backToTemplates,
325
- children: tr("fluidgrids.pages.templatePreview.backToTemplates", "Back to templates")
326
- })]
327
- }),
328
- children: loading ? /* @__PURE__ */ jsxs("div", {
329
- className: "flex h-full items-center justify-center gap-2 text-sm text-muted-foreground",
330
- children: [/* @__PURE__ */ jsx(Icon, {
331
- icon: "svg-spinners:ring-resize",
332
- className: "size-4"
333
- }), tr("fluidgrids.pages.templatePreview.loadingPreview", "Loading preview…")]
334
- }) : error ? /* @__PURE__ */ jsxs("div", {
335
- className: "flex h-full flex-col items-center justify-center gap-3 p-8 text-center",
336
- children: [
337
- /* @__PURE__ */ jsx(Icon, {
338
- icon: "mdi:alert-circle-outline",
339
- className: "size-8 text-muted-foreground"
340
- }),
341
- /* @__PURE__ */ jsx("p", {
342
- className: "text-sm text-muted-foreground",
343
- children: error
344
- }),
345
- /* @__PURE__ */ jsx(Button$1, {
346
- variant: "outline",
347
- onClick: backToTemplates,
348
- children: tr("fluidgrids.pages.templatePreview.backToTemplates", "Back to templates")
349
- })
350
- ]
351
- }) : workflow ? /* @__PURE__ */ jsx(FlowBuilderPage, {
352
- workflow,
353
- readOnly: true
354
- }) : null
355
- })
356
- })]
357
- }),
358
- templateImport.dialog,
359
- /* @__PURE__ */ jsx(QuotaExhaustedDialog, {
360
- surface: "template-import",
361
- open: showQuotaExhausted,
362
- onOpenChange: setShowQuotaExhausted,
363
- onUpgrade: () => {
364
- setShowQuotaExhausted(false);
365
- navigate(BILLING_PLANS_PATH);
366
- }
367
- })
368
- ] });
369
- }
370
-
371
153
  // src/modules/templates/utils/template-categories.ts
372
154
  /** English labels for the store's template categories (BOFF-4316). */
373
155
  const TEMPLATE_CATEGORY_LABELS = {
@@ -973,6 +755,7 @@ function galleryCategory(workflow) {
973
755
  }
974
756
 
975
757
  // src/modules/templates/pages/TemplatesPage.tsx
758
+ var TemplatesPage_exports = /* @__PURE__ */ __exportAll({ TemplatesPage: () => TemplatesPage });
976
759
  /**
977
760
  * Category chips, shared by My Templates and From Store. My Templates groups
978
761
  * by the same store categories, read from each workflow's stored category
@@ -1480,4 +1263,4 @@ function TemplatesPage() {
1480
1263
  });
1481
1264
  }
1482
1265
 
1483
- export { ThemeProvider$1 as i, TemplatePreview as n, extractTemplateGraph as r, TemplatesPage as t };
1266
+ export { TemplatesPage_exports as n, TemplatesPage as t };