@burdenoff/fluidgrids-fe-sdk 2026.626.1 → 2026.629.1
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/dist/{TemplateConfigurationModal-FPQR7W4M.js → TemplateConfigurationModal-VU3Q4RFX.js} +73 -24
- package/dist/TemplateConfigurationModal-VU3Q4RFX.js.map +1 -0
- package/dist/{WorkflowBuilder-2K4MMN4U.js → WorkflowBuilder-Q44GW3KQ.js} +6 -8
- package/dist/{WorkflowBuilder-2K4MMN4U.js.map → WorkflowBuilder-Q44GW3KQ.js.map} +1 -1
- package/dist/{chunk-QANP2YKX.js → chunk-YMHXH7ZK.js} +10078 -323
- package/dist/chunk-YMHXH7ZK.js.map +1 -0
- package/dist/index.js +8 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/TemplateConfigurationModal-FPQR7W4M.js.map +0 -1
- package/dist/chunk-GSJOLO3A.js +0 -251
- package/dist/chunk-GSJOLO3A.js.map +0 -1
- package/dist/chunk-KBHRFZXR.js +0 -9488
- package/dist/chunk-KBHRFZXR.js.map +0 -1
- package/dist/chunk-QANP2YKX.js.map +0 -1
- package/dist/useImportWorkflowTemplate-UTPGK45L.js +0 -11
- package/dist/useImportWorkflowTemplate-UTPGK45L.js.map +0 -1
- package/dist/useTemplateDetail-NK63V3PC.js +0 -6
- package/dist/useTemplateDetail-NK63V3PC.js.map +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/builder/components/flow-builder/components/templates/TemplateConfigurationModal.tsx"],"names":[],"mappings":";;;;;;;AAkDO,SAAS,0BAAA,CAA2B;AAAA,EACzC,IAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,eAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA,GAAY;AACd,CAAA,EAAoC;AAClC,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAA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AA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,EAAA,EAAI,CAAA,eAAA,EAAkB,KAAA,CAAM,IAAI,CAAA,CAAA;AAAA,QAChC,KAAA;AAAA,QACA,UAAU,CAAC,CAAA,KAAM,QAAA,CAAS,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,QACxC,SAAA,EAAU,qLAAA;AAAA,QAEV,QAAA,EAAA;AAAA,0BAAA,GAAA,CAAC,QAAA,EAAA,EAAO,KAAA,EAAM,EAAA,EAAG,QAAA,EAAA,WAAA,EAAS,CAAA;AAAA,UACzB,KAAA,CAAM,OAAA,CAAQ,GAAA,CAAI,CAAC,wBAClB,GAAA,CAAC,QAAA,EAAA,EAAuB,KAAA,EAAO,GAAA,CAAI,KAAA,EAChC,QAAA,EAAA,GAAA,CAAI,KAAA,EAAA,EADM,GAAA,CAAI,KAEjB,CACD;AAAA;AAAA;AAAA,KACH,mBAEA,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,EAAA,EAAI,CAAA,eAAA,EAAkB,KAAA,CAAM,IAAI,CAAA,CAAA;AAAA,QAChC,IAAA,EACE,MAAM,IAAA,KAAS,QAAA,GACX,aACA,KAAA,CAAM,IAAA,KAAS,WACb,QAAA,GACA,MAAA;AAAA,QAER,KAAA;AAAA,QACA,UAAU,CAAC,CAAA,KAAM,QAAA,CAAS,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,QACxC,aAAa,KAAA,CAAM;AAAA;AAAA,KACrB;AAAA,IAED,MAAM,QAAA,oBACL,GAAA,CAAC,OAAE,SAAA,EAAU,+BAAA,EAAiC,gBAAM,QAAA,EAAS;AAAA,GAAA,EAEjE,CAAA;AAEJ","file":"TemplateConfigurationModal-FPQR7W4M.js","sourcesContent":["import { useState, useMemo } from \"react\";\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogDescription,\n DialogFooter,\n} from \"../../../../../ui/dialog\";\nimport { Input } from \"../../../../../ui/input\";\nimport { Button } from \"../../../../../ui/button\";\nimport { Badge } from \"../../../../../ui/badge\";\nimport { Label } from \"../../../../../ui/label\";\nimport type { StoreProduct } from \"../../../../../generated/global-types\";\nimport type {\n WorkflowTemplateContent,\n TemplateNodeCheckResult,\n TemplateRequiredInput,\n} from \"../../../../../types/workflow-template-content\";\nimport {\n Loader2,\n CheckCircle2,\n Download,\n ShoppingCart,\n KeyRound,\n Sparkles,\n AlertTriangle,\n} from \"lucide-react\";\n\nexport interface TemplateConfigurationModalProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n template: StoreProduct | null;\n content: WorkflowTemplateContent | null;\n nodeCheckResult: TemplateNodeCheckResult | null;\n onConfirm: (config: {\n name: string;\n templateInputs: Record<string, string | number>;\n }) => void;\n importing?: boolean;\n}\n\n/**\n * Configuration modal shown before importing a template that has:\n * - Required user inputs (e.g., Slack webhook URL)\n * - Missing node dependencies\n * - Required credential types\n *\n * Allows the user to review what will happen and fill in required fields.\n */\nexport function TemplateConfigurationModal({\n open,\n onOpenChange,\n template,\n content,\n nodeCheckResult,\n onConfirm,\n importing = false,\n}: TemplateConfigurationModalProps) {\n const [workflowName, setWorkflowName] = useState(\n content?.defaultWorkflowName || template?.name || \"\",\n );\n const [inputValues, setInputValues] = useState<Record<string, string>>({});\n\n // Reset form when template changes\n useMemo(() => {\n if (template) {\n setWorkflowName(content?.defaultWorkflowName || template.name || \"\");\n // Pre-fill default values\n const defaults: Record<string, string> = {};\n if (content?.requiredInputs) {\n for (const input of content.requiredInputs) {\n if (input.defaultValue) {\n defaults[input.name] = input.defaultValue;\n }\n }\n }\n setInputValues(defaults);\n }\n }, [template?.id]);\n\n const requiredInputs = content?.requiredInputs || [];\n const hasRequiredInputs = requiredInputs.length > 0;\n const hasMissingNodes =\n nodeCheckResult &&\n (nodeCheckResult.missing.length > 0 ||\n nodeCheckResult.missingPaid.length > 0);\n const hasRequiredCredentials =\n (content?.requiredCredentialTypes?.length ?? 0) > 0;\n const hasPaidBlockers = (nodeCheckResult?.missingPaid.length ?? 0) > 0;\n\n // Check if all required fields are filled\n const isValid = useMemo(() => {\n if (!workflowName.trim()) return false;\n for (const input of requiredInputs) {\n if (input.required && !inputValues[input.name]?.trim()) {\n return false;\n }\n }\n return true;\n }, [workflowName, inputValues, requiredInputs]);\n\n const handleInputChange = (name: string, value: string) => {\n setInputValues((prev) => ({ ...prev, [name]: value }));\n };\n\n const handleConfirm = () => {\n onConfirm({\n name: workflowName.trim(),\n templateInputs: inputValues,\n });\n };\n\n if (!template || !content) return null;\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent\n size=\"lg\"\n className=\"!flex !flex-col !max-h-[85vh] overflow-hidden p-0 gap-0\"\n >\n <DialogHeader className=\"px-6 pt-6 pb-4 border-b shrink-0\">\n <div className=\"flex items-center gap-2\">\n <Sparkles className=\"size-5 text-primary\" />\n <DialogTitle className=\"text-xl\">\n Import \"{template.name}\"\n </DialogTitle>\n </div>\n <DialogDescription>\n Configure and import this workflow template into your workspace\n </DialogDescription>\n </DialogHeader>\n\n {/* Scrollable Content */}\n <div className=\"flex-1 overflow-y-auto px-6 py-5 space-y-6\">\n {/* Workflow Name */}\n <div className=\"space-y-2\">\n <Label htmlFor=\"workflow-name\" className=\"text-sm font-medium\">\n Workflow Name\n </Label>\n <Input\n id=\"workflow-name\"\n value={workflowName}\n onChange={(e) => setWorkflowName(e.target.value)}\n placeholder=\"Enter workflow name\"\n />\n </div>\n\n {/* Required Configuration Inputs */}\n {hasRequiredInputs && (\n <div className=\"space-y-3\">\n <h4 className=\"text-sm font-semibold text-foreground flex items-center gap-2\">\n <KeyRound className=\"size-4\" />\n Required Configuration\n </h4>\n <div className=\"space-y-3\">\n {requiredInputs.map((input) => (\n <TemplateInputField\n key={input.name}\n input={input}\n value={inputValues[input.name] || \"\"}\n onChange={(value) => handleInputChange(input.name, value)}\n />\n ))}\n </div>\n </div>\n )}\n\n {/* Node Dependencies */}\n {nodeCheckResult && (\n <div className=\"space-y-3\">\n <h4 className=\"text-sm font-semibold text-foreground flex items-center gap-2\">\n <Download className=\"size-4\" />\n Node Dependencies\n </h4>\n <div className=\"space-y-2\">\n {/* Installed nodes */}\n {nodeCheckResult.installed.map((node) => (\n <div\n key={node.nodeType}\n className=\"flex items-center gap-2 text-sm\"\n >\n <CheckCircle2 className=\"size-4 text-green-500 shrink-0\" />\n <span>\n {node.displayName || node.nodeType} v{node.nodeVersion}\n </span>\n <Badge variant=\"secondary\" className=\"text-xs ml-auto\">\n Installed\n </Badge>\n </div>\n ))}\n\n {/* Missing free nodes (will be installed) */}\n {nodeCheckResult.missing.map((node) => (\n <div\n key={node.nodeType}\n className=\"flex items-center gap-2 text-sm\"\n >\n <Download className=\"size-4 text-blue-500 shrink-0\" />\n <span>\n {node.displayName || node.nodeType} v{node.nodeVersion}\n </span>\n <Badge\n variant=\"outline\"\n className=\"text-xs ml-auto border-blue-500/30 text-blue-500\"\n >\n Will install\n </Badge>\n </div>\n ))}\n\n {/* Missing paid nodes (need purchase) */}\n {nodeCheckResult.missingPaid.map((node) => (\n <div\n key={node.nodeType}\n className=\"flex items-center gap-2 text-sm\"\n >\n <ShoppingCart className=\"size-4 text-amber-500 shrink-0\" />\n <span>\n {node.displayName || node.nodeType} v{node.nodeVersion}\n </span>\n <Badge\n variant=\"outline\"\n className=\"text-xs ml-auto border-amber-500/30 text-amber-500\"\n >\n Purchase required\n </Badge>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {/* Required Credentials */}\n {hasRequiredCredentials && (\n <div className=\"space-y-3\">\n <h4 className=\"text-sm font-semibold text-foreground flex items-center gap-2\">\n <KeyRound className=\"size-4\" />\n Credentials Needed\n </h4>\n <p className=\"text-xs text-muted-foreground\">\n You'll need to configure these credentials after importing:\n </p>\n <div className=\"flex flex-wrap gap-2\">\n {content.requiredCredentialTypes?.map((cred) => (\n <Badge key={cred} variant=\"outline\" className=\"text-xs\">\n <KeyRound className=\"size-3 mr-1\" />\n {cred}\n </Badge>\n ))}\n </div>\n </div>\n )}\n\n {/* Info Banner */}\n <div className=\"rounded-lg bg-muted/50 p-3 text-sm text-muted-foreground\">\n <p>\n The workflow will be created as a <strong>DRAFT</strong>. You can\n review and edit it in the builder before activating.\n </p>\n </div>\n\n {/* Paid Node Blocker Warning */}\n {hasPaidBlockers && (\n <div className=\"rounded-lg bg-amber-500/10 border border-amber-500/30 p-3 text-sm text-amber-700 dark:text-amber-400 flex items-start gap-2\">\n <AlertTriangle className=\"size-4 mt-0.5 shrink-0\" />\n <div>\n <p className=\"font-medium\">Purchase required</p>\n <p className=\"mt-1 text-xs\">\n Some nodes require purchase from the store before this\n template can be fully imported. The workflow will be created\n but those nodes may not function until installed.\n </p>\n </div>\n </div>\n )}\n </div>\n\n {/* Footer */}\n <DialogFooter className=\"px-6 py-4 border-t shrink-0\">\n <Button\n variant=\"outline\"\n onClick={() => onOpenChange(false)}\n disabled={importing}\n >\n Cancel\n </Button>\n <Button onClick={handleConfirm} disabled={!isValid || importing}>\n {importing ? (\n <>\n <Loader2 className=\"size-4 mr-2 animate-spin\" />\n Importing...\n </>\n ) : (\n <>\n <Sparkles className=\"size-4 mr-2\" />\n Import & Open in Builder\n </>\n )}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n\n// ============================================================================\n// Sub-component: Template Input Field\n// ============================================================================\n\nfunction TemplateInputField({\n input,\n value,\n onChange,\n}: {\n input: TemplateRequiredInput;\n value: string;\n onChange: (value: string) => void;\n}) {\n return (\n <div className=\"space-y-1.5\">\n <Label htmlFor={`template-input-${input.name}`} className=\"text-sm\">\n {input.label}\n {input.required && <span className=\"text-destructive ml-1\">*</span>}\n </Label>\n {input.type === \"select\" && input.options ? (\n <select\n id={`template-input-${input.name}`}\n value={value}\n onChange={(e) => onChange(e.target.value)}\n className=\"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring\"\n >\n <option value=\"\">Select...</option>\n {input.options.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n ) : (\n <Input\n id={`template-input-${input.name}`}\n type={\n input.type === \"secret\"\n ? \"password\"\n : input.type === \"number\"\n ? \"number\"\n : \"text\"\n }\n value={value}\n onChange={(e) => onChange(e.target.value)}\n placeholder={input.placeholder}\n />\n )}\n {input.helpText && (\n <p className=\"text-xs text-muted-foreground\">{input.helpText}</p>\n )}\n </div>\n );\n}\n"]}
|
package/dist/chunk-GSJOLO3A.js
DELETED
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
import { createGlobalStoreClient, getGlobalStoreClient } from './chunk-BQXHJIER.js';
|
|
2
|
-
import { createFluidGridsClient, setFluidGridsClient, resetFluidGridsClient } from './chunk-5BDQNSP3.js';
|
|
3
|
-
import { validateTrustedOrigin, setFluidGridsConfig, resetFluidGridsConfig, getFluidGridsConfig } from './chunk-WWU2O2SR.js';
|
|
4
|
-
import { createContext, useMemo, useEffect, useContext, useState, useCallback } from 'react';
|
|
5
|
-
import { gql } from '@apollo/client/core';
|
|
6
|
-
import { ApolloProvider } from '@apollo/client/react';
|
|
7
|
-
import { jsx } from 'react/jsx-runtime';
|
|
8
|
-
|
|
9
|
-
var FluidGridsContext = createContext(
|
|
10
|
-
null
|
|
11
|
-
);
|
|
12
|
-
function FluidGridsProvider({
|
|
13
|
-
apiGatewayUrl,
|
|
14
|
-
globalApiUrl,
|
|
15
|
-
authToken,
|
|
16
|
-
workspaceToken,
|
|
17
|
-
workspaceId,
|
|
18
|
-
trustedOrigins,
|
|
19
|
-
tenantId,
|
|
20
|
-
organizationId,
|
|
21
|
-
workspaceClient: externalWorkspaceClient,
|
|
22
|
-
globalClient: externalGlobalClient,
|
|
23
|
-
apolloClient: legacyClient,
|
|
24
|
-
children
|
|
25
|
-
}) {
|
|
26
|
-
validateTrustedOrigin(trustedOrigins);
|
|
27
|
-
const workspaceClient = useMemo(() => {
|
|
28
|
-
if (externalWorkspaceClient) {
|
|
29
|
-
return externalWorkspaceClient;
|
|
30
|
-
}
|
|
31
|
-
if (legacyClient) {
|
|
32
|
-
return legacyClient;
|
|
33
|
-
}
|
|
34
|
-
if (apiGatewayUrl) {
|
|
35
|
-
return createFluidGridsClient({
|
|
36
|
-
apiGatewayUrl,
|
|
37
|
-
authToken,
|
|
38
|
-
workspaceToken,
|
|
39
|
-
workspaceId,
|
|
40
|
-
tenantId
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
throw new Error(
|
|
44
|
-
"FluidGridsProvider: Either provide workspaceClient or apiGatewayUrl"
|
|
45
|
-
);
|
|
46
|
-
}, [
|
|
47
|
-
apiGatewayUrl,
|
|
48
|
-
authToken,
|
|
49
|
-
workspaceToken,
|
|
50
|
-
workspaceId,
|
|
51
|
-
tenantId,
|
|
52
|
-
externalWorkspaceClient,
|
|
53
|
-
legacyClient
|
|
54
|
-
]);
|
|
55
|
-
const globalClient = useMemo(() => {
|
|
56
|
-
if (externalGlobalClient) {
|
|
57
|
-
return externalGlobalClient;
|
|
58
|
-
}
|
|
59
|
-
if (globalApiUrl) {
|
|
60
|
-
return createGlobalStoreClient({
|
|
61
|
-
globalApiUrl,
|
|
62
|
-
authToken,
|
|
63
|
-
workspaceId,
|
|
64
|
-
tenantId,
|
|
65
|
-
organizationId
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
return void 0;
|
|
69
|
-
}, [
|
|
70
|
-
globalApiUrl,
|
|
71
|
-
authToken,
|
|
72
|
-
workspaceId,
|
|
73
|
-
tenantId,
|
|
74
|
-
organizationId,
|
|
75
|
-
externalGlobalClient
|
|
76
|
-
]);
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
setFluidGridsClient(workspaceClient);
|
|
79
|
-
return () => {
|
|
80
|
-
resetFluidGridsClient();
|
|
81
|
-
};
|
|
82
|
-
}, [workspaceClient]);
|
|
83
|
-
useEffect(() => {
|
|
84
|
-
setFluidGridsConfig({
|
|
85
|
-
apiGatewayUrl,
|
|
86
|
-
globalApiUrl,
|
|
87
|
-
authToken,
|
|
88
|
-
workspaceId,
|
|
89
|
-
trustedOrigins,
|
|
90
|
-
tenantId,
|
|
91
|
-
organizationId
|
|
92
|
-
});
|
|
93
|
-
return () => {
|
|
94
|
-
resetFluidGridsConfig();
|
|
95
|
-
};
|
|
96
|
-
}, [
|
|
97
|
-
apiGatewayUrl,
|
|
98
|
-
globalApiUrl,
|
|
99
|
-
authToken,
|
|
100
|
-
workspaceId,
|
|
101
|
-
trustedOrigins,
|
|
102
|
-
tenantId,
|
|
103
|
-
organizationId
|
|
104
|
-
]);
|
|
105
|
-
const contextValue = useMemo(() => {
|
|
106
|
-
return {
|
|
107
|
-
apiGatewayUrl,
|
|
108
|
-
globalApiUrl,
|
|
109
|
-
authToken,
|
|
110
|
-
workspaceId,
|
|
111
|
-
trustedOrigins,
|
|
112
|
-
tenantId,
|
|
113
|
-
organizationId,
|
|
114
|
-
workspaceClient,
|
|
115
|
-
globalClient
|
|
116
|
-
};
|
|
117
|
-
}, [
|
|
118
|
-
apiGatewayUrl,
|
|
119
|
-
globalApiUrl,
|
|
120
|
-
authToken,
|
|
121
|
-
workspaceId,
|
|
122
|
-
trustedOrigins,
|
|
123
|
-
tenantId,
|
|
124
|
-
organizationId,
|
|
125
|
-
workspaceClient,
|
|
126
|
-
globalClient
|
|
127
|
-
]);
|
|
128
|
-
return /* @__PURE__ */ jsx(FluidGridsContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(ApolloProvider, { client: workspaceClient, children }) });
|
|
129
|
-
}
|
|
130
|
-
function useFluidGridsContext() {
|
|
131
|
-
const context = useContext(FluidGridsContext);
|
|
132
|
-
if (!context) {
|
|
133
|
-
throw new Error(
|
|
134
|
-
"useFluidGridsContext must be used within FluidGridsProvider"
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
return context;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// src/hooks/store/useGlobalStoreClient.ts
|
|
141
|
-
function useGlobalStoreClient() {
|
|
142
|
-
const context = useContext(FluidGridsContext);
|
|
143
|
-
if (context?.globalClient) {
|
|
144
|
-
return context.globalClient;
|
|
145
|
-
}
|
|
146
|
-
const singletonClient = getGlobalStoreClient();
|
|
147
|
-
if (singletonClient) {
|
|
148
|
-
return singletonClient;
|
|
149
|
-
}
|
|
150
|
-
throw new Error(
|
|
151
|
-
"useGlobalStoreClient: No global client available. Either wrap your component tree with <FluidGridsProvider globalClient={...}> or call setGlobalStoreClient(client) before rendering."
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// src/hooks/store/useTemplateDetail.ts
|
|
156
|
-
var GET_WORKFLOW_TEMPLATE_DETAIL = gql`
|
|
157
|
-
query GetWorkflowTemplateDetail($id: ID!) {
|
|
158
|
-
product(id: $id) {
|
|
159
|
-
id
|
|
160
|
-
name
|
|
161
|
-
slug
|
|
162
|
-
type
|
|
163
|
-
description
|
|
164
|
-
longDescription
|
|
165
|
-
icon
|
|
166
|
-
screenshots
|
|
167
|
-
videoUrls
|
|
168
|
-
rating
|
|
169
|
-
reviewCount
|
|
170
|
-
downloads
|
|
171
|
-
viewCount
|
|
172
|
-
price
|
|
173
|
-
pricingModel
|
|
174
|
-
currency
|
|
175
|
-
featured
|
|
176
|
-
content
|
|
177
|
-
manifest
|
|
178
|
-
manifestVersion
|
|
179
|
-
authorName
|
|
180
|
-
license
|
|
181
|
-
category
|
|
182
|
-
tags
|
|
183
|
-
compatibleProducts
|
|
184
|
-
publisher {
|
|
185
|
-
id
|
|
186
|
-
name
|
|
187
|
-
email
|
|
188
|
-
websiteUrl
|
|
189
|
-
logoUrl
|
|
190
|
-
isVerified
|
|
191
|
-
}
|
|
192
|
-
createdAt
|
|
193
|
-
updatedAt
|
|
194
|
-
publishedAt
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
`;
|
|
198
|
-
function useTemplateDetail() {
|
|
199
|
-
const client = useGlobalStoreClient();
|
|
200
|
-
const [loading, setLoading] = useState(false);
|
|
201
|
-
const [error, setError] = useState(null);
|
|
202
|
-
const context = useContext(FluidGridsContext);
|
|
203
|
-
const workspaceId = context?.workspaceId ?? getFluidGridsConfig().workspaceId;
|
|
204
|
-
const organizationId = context?.organizationId;
|
|
205
|
-
const contextHeaders = useMemo(() => {
|
|
206
|
-
const headers = {};
|
|
207
|
-
if (organizationId) {
|
|
208
|
-
headers["x-organization-id"] = organizationId;
|
|
209
|
-
}
|
|
210
|
-
if (workspaceId) {
|
|
211
|
-
headers["x-workspace-id"] = workspaceId;
|
|
212
|
-
}
|
|
213
|
-
return headers;
|
|
214
|
-
}, [organizationId, workspaceId]);
|
|
215
|
-
const fetchTemplateDetail = useCallback(
|
|
216
|
-
async (templateId) => {
|
|
217
|
-
setLoading(true);
|
|
218
|
-
setError(null);
|
|
219
|
-
try {
|
|
220
|
-
const result = await client.query({
|
|
221
|
-
query: GET_WORKFLOW_TEMPLATE_DETAIL,
|
|
222
|
-
variables: { id: templateId },
|
|
223
|
-
fetchPolicy: "network-only",
|
|
224
|
-
context: Object.keys(contextHeaders).length > 0 ? { headers: contextHeaders } : void 0
|
|
225
|
-
});
|
|
226
|
-
if (result.error) {
|
|
227
|
-
throw result.error;
|
|
228
|
-
}
|
|
229
|
-
const data = result.data;
|
|
230
|
-
return data?.product ?? null;
|
|
231
|
-
} catch (err) {
|
|
232
|
-
const fetchError = err instanceof Error ? err : new Error("Failed to fetch template detail");
|
|
233
|
-
setError(fetchError);
|
|
234
|
-
console.error("[useTemplateDetail] Error:", err);
|
|
235
|
-
return null;
|
|
236
|
-
} finally {
|
|
237
|
-
setLoading(false);
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
[client, contextHeaders]
|
|
241
|
-
);
|
|
242
|
-
return {
|
|
243
|
-
fetchTemplateDetail,
|
|
244
|
-
loading,
|
|
245
|
-
error
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export { FluidGridsContext, FluidGridsProvider, useFluidGridsContext, useGlobalStoreClient, useTemplateDetail };
|
|
250
|
-
//# sourceMappingURL=chunk-GSJOLO3A.js.map
|
|
251
|
-
//# sourceMappingURL=chunk-GSJOLO3A.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/FluidGridsProvider.tsx","../src/hooks/store/useGlobalStoreClient.ts","../src/hooks/store/useTemplateDetail.ts"],"names":["useContext","useMemo"],"mappings":";;;;;;;;AA6DO,IAAM,iBAAA,GAAoB,aAAA;AAAA,EAC/B;AACF;AAEO,SAAS,kBAAA,CAAmB;AAAA,EACjC,aAAA;AAAA,EACA,YAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA,QAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA,EAAiB,uBAAA;AAAA,EACjB,YAAA,EAAc,oBAAA;AAAA,EACd,YAAA,EAAc,YAAA;AAAA,EACd;AACF,CAAA,EAA4B;AAC1B,EAAA,qBAAA,CAAsB,cAAc,CAAA;AAGpC,EAAA,MAAM,eAAA,GAAkB,QAAQ,MAAM;AAEpC,IAAA,IAAI,uBAAA,EAAyB;AAC3B,MAAA,OAAO,uBAAA;AAAA,IACT;AACA,IAAA,IAAI,YAAA,EAAc;AAChB,MAAA,OAAO,YAAA;AAAA,IACT;AACA,IAAA,IAAI,aAAA,EAAe;AACjB,MAAA,OAAO,sBAAA,CAAuB;AAAA,QAC5B,aAAA;AAAA,QACA,SAAA;AAAA,QACA,cAAA;AAAA,QACA,WAAA;AAAA,QACA;AAAA,OACD,CAAA;AAAA,IACH;AACA,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF,CAAA,EAAG;AAAA,IACD,aAAA;AAAA,IACA,SAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,uBAAA;AAAA,IACA;AAAA,GACD,CAAA;AAGD,EAAA,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AAChB,UAAA,MAAM,MAAA,CAAO,KAAA;AAAA,QACf;AAEA,QAAA,MAAM,OAAO,MAAA,CAAO,IAAA;AACpB,QAAA,OAAO,MAAM,OAAA,IAAW,IAAA;AAAA,MAC1B,SAAS,GAAA,EAAK;AACZ,QAAA,MAAM,aACJ,GAAA,YAAe,KAAA,GACX,GAAA,GACA,IAAI,MAAM,iCAAiC,CAAA;AACjD,QAAA,QAAA,CAAS,UAAU,CAAA;AACnB,QAAA,OAAA,CAAQ,KAAA,CAAM,8BAA8B,GAAG,CAAA;AAC/C,QAAA,OAAO,IAAA;AAAA,MACT,CAAA,SAAE;AACA,QAAA,UAAA,CAAW,KAAK,CAAA;AAAA,MAClB;AAAA,IACF,CAAA;AAAA,IACA,CAAC,QAAQ,cAAc;AAAA,GACzB;AAEA,EAAA,OAAO;AAAA,IACL,mBAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-GSJOLO3A.js","sourcesContent":["import {\n createContext,\n useContext,\n useEffect,\n useMemo,\n type ReactNode,\n} from \"react\";\nimport { ApolloProvider } from \"@apollo/client/react\";\nimport { type ApolloClient } from \"@apollo/client/core\";\nimport {\n createFluidGridsClient,\n setFluidGridsClient,\n resetFluidGridsClient,\n type FluidGridsClientConfig,\n} from \"../graphql/client\";\nimport { createGlobalStoreClient } from \"../graphql/global-client\";\nimport {\n setFluidGridsConfig,\n resetFluidGridsConfig,\n validateTrustedOrigin,\n} from \"../config\";\n\nexport interface FluidGridsProviderProps {\n /** API Gateway URL (workspace gateway) */\n apiGatewayUrl?: string;\n /** Global API Gateway URL (for store operations) */\n globalApiUrl?: string;\n /** Auth token */\n authToken?: string;\n /** Workspace token for x-workspace-authorization header */\n workspaceToken?: string;\n /** Workspace ID */\n workspaceId: string;\n /** Optional host allowlist for embedded deployments */\n trustedOrigins?: string[];\n /** Tenant ID */\n tenantId?: string;\n /** Organization ID */\n organizationId?: string;\n /** Optional: provide your own workspace Apollo client */\n workspaceClient?: ApolloClient;\n /** Optional: provide your own global Apollo client */\n globalClient?: ApolloClient;\n /** @deprecated Use workspaceClient instead */\n apolloClient?: ApolloClient;\n /** Children */\n children: ReactNode;\n}\n\ninterface FluidGridsContextValue {\n apiGatewayUrl?: string;\n globalApiUrl?: string;\n authToken?: string;\n workspaceId: string;\n trustedOrigins?: string[];\n tenantId?: string;\n organizationId?: string;\n workspaceClient?: ApolloClient;\n globalClient?: ApolloClient;\n}\n\nexport const FluidGridsContext = createContext<FluidGridsContextValue | null>(\n null,\n);\n\nexport function FluidGridsProvider({\n apiGatewayUrl,\n globalApiUrl,\n authToken,\n workspaceToken,\n workspaceId,\n trustedOrigins,\n tenantId,\n organizationId,\n workspaceClient: externalWorkspaceClient,\n globalClient: externalGlobalClient,\n apolloClient: legacyClient,\n children,\n}: FluidGridsProviderProps) {\n validateTrustedOrigin(trustedOrigins);\n\n // Create or use provided workspace Apollo client\n const workspaceClient = useMemo(() => {\n // Priority: workspaceClient > apolloClient (legacy) > create new\n if (externalWorkspaceClient) {\n return externalWorkspaceClient;\n }\n if (legacyClient) {\n return legacyClient;\n }\n if (apiGatewayUrl) {\n return createFluidGridsClient({\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n });\n }\n throw new Error(\n \"FluidGridsProvider: Either provide workspaceClient or apiGatewayUrl\",\n );\n }, [\n apiGatewayUrl,\n authToken,\n workspaceToken,\n workspaceId,\n tenantId,\n externalWorkspaceClient,\n legacyClient,\n ]);\n\n // Create or use provided global Apollo client\n const globalClient = useMemo(() => {\n if (externalGlobalClient) {\n return externalGlobalClient;\n }\n // Only create if globalApiUrl is provided\n if (globalApiUrl) {\n return createGlobalStoreClient({\n globalApiUrl,\n authToken,\n workspaceId,\n tenantId,\n organizationId,\n });\n }\n // Return undefined if no global client provided (store features won't work)\n return undefined;\n }, [\n globalApiUrl,\n authToken,\n workspaceId,\n tenantId,\n organizationId,\n externalGlobalClient,\n ]);\n\n // Set the module-level workspace client for hooks that need direct access\n useEffect(() => {\n setFluidGridsClient(workspaceClient);\n return () => {\n resetFluidGridsClient();\n };\n }, [workspaceClient]);\n\n // Configure the SDK settings\n useEffect(() => {\n setFluidGridsConfig({\n apiGatewayUrl,\n globalApiUrl,\n authToken,\n workspaceId,\n trustedOrigins,\n tenantId,\n organizationId,\n });\n return () => {\n resetFluidGridsConfig();\n };\n }, [\n apiGatewayUrl,\n globalApiUrl,\n authToken,\n workspaceId,\n trustedOrigins,\n tenantId,\n organizationId,\n ]);\n\n const contextValue = useMemo(() => {\n return {\n apiGatewayUrl,\n globalApiUrl,\n authToken,\n workspaceId,\n trustedOrigins,\n tenantId,\n organizationId,\n workspaceClient,\n globalClient,\n };\n }, [\n apiGatewayUrl,\n globalApiUrl,\n authToken,\n workspaceId,\n trustedOrigins,\n tenantId,\n organizationId,\n workspaceClient,\n globalClient,\n ]);\n\n return (\n <FluidGridsContext.Provider value={contextValue}>\n <ApolloProvider client={workspaceClient}>{children}</ApolloProvider>\n </FluidGridsContext.Provider>\n );\n}\n\nexport function useFluidGridsContext() {\n const context = useContext(FluidGridsContext);\n if (!context) {\n throw new Error(\n \"useFluidGridsContext must be used within FluidGridsProvider\",\n );\n }\n return context;\n}\n","import { useContext } from \"react\";\nimport { FluidGridsContext } from \"../../components/FluidGridsProvider\";\nimport { getGlobalStoreClient } from \"../../graphql/global-client\";\n\n/**\n * Hook to get the Global Store Apollo client\n *\n * Priority:\n * 1. FluidGridsProvider context (if available)\n * 2. Module-level singleton set via setGlobalStoreClient()\n *\n * @throws Error if no global client is available from either source\n */\nexport function useGlobalStoreClient() {\n const context = useContext(FluidGridsContext);\n\n // Try context first (FluidGridsProvider)\n if (context?.globalClient) {\n return context.globalClient;\n }\n\n // Fallback to module-level singleton\n const singletonClient = getGlobalStoreClient();\n if (singletonClient) {\n return singletonClient;\n }\n\n // No client available from either source\n throw new Error(\n \"useGlobalStoreClient: No global client available. \" +\n \"Either wrap your component tree with <FluidGridsProvider globalClient={...}> \" +\n \"or call setGlobalStoreClient(client) before rendering.\",\n );\n}\n","import { useState, useCallback, useContext, useMemo } from \"react\";\nimport { gql } from \"@apollo/client/core\";\nimport { useGlobalStoreClient } from \"./useGlobalStoreClient\";\nimport type { StoreProduct } from \"../../generated/global-types\";\nimport { FluidGridsContext } from \"../../components/FluidGridsProvider\";\nimport { getFluidGridsConfig } from \"../../config\";\n\n// Inline GraphQL document to avoid dependency on generated types\n// (which requires codegen to be run). Will be replaced by generated\n// import once codegen is executed.\nconst GET_WORKFLOW_TEMPLATE_DETAIL = gql`\n query GetWorkflowTemplateDetail($id: ID!) {\n product(id: $id) {\n id\n name\n slug\n type\n description\n longDescription\n icon\n screenshots\n videoUrls\n rating\n reviewCount\n downloads\n viewCount\n price\n pricingModel\n currency\n featured\n content\n manifest\n manifestVersion\n authorName\n license\n category\n tags\n compatibleProducts\n publisher {\n id\n name\n email\n websiteUrl\n logoUrl\n isVerified\n }\n createdAt\n updatedAt\n publishedAt\n }\n }\n`;\n\n/**\n * Hook to lazily fetch full details of a workflow template from the store.\n *\n * Unlike `useWorkflowTemplates` which fetches browse-level metadata,\n * this hook fetches the full product detail including the `content` field\n * which contains the workflow definitionJson.\n *\n * Uses a manual query (not useQuery) to only fetch when explicitly requested.\n */\nexport function useTemplateDetail() {\n const client = useGlobalStoreClient();\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n // Get workspace and organization context for tenant scoping\n const context = useContext(FluidGridsContext);\n const workspaceId = context?.workspaceId ?? getFluidGridsConfig().workspaceId;\n const organizationId = context?.organizationId;\n\n const contextHeaders = useMemo(() => {\n const headers: Record<string, string> = {};\n if (organizationId) {\n headers[\"x-organization-id\"] = organizationId;\n }\n if (workspaceId) {\n headers[\"x-workspace-id\"] = workspaceId;\n }\n return headers;\n }, [organizationId, workspaceId]);\n\n /**\n * Fetch full template detail including content (definitionJson).\n * Returns the full StoreProduct with content populated.\n */\n const fetchTemplateDetail = useCallback(\n async (templateId: string): Promise<StoreProduct | null> => {\n setLoading(true);\n setError(null);\n try {\n const result = await client.query({\n query: GET_WORKFLOW_TEMPLATE_DETAIL,\n variables: { id: templateId },\n fetchPolicy: \"network-only\",\n context:\n Object.keys(contextHeaders).length > 0\n ? { headers: contextHeaders }\n : undefined,\n });\n\n if (result.error) {\n throw result.error;\n }\n\n const data = result.data as { product?: StoreProduct } | undefined;\n return data?.product ?? null;\n } catch (err) {\n const fetchError =\n err instanceof Error\n ? err\n : new Error(\"Failed to fetch template detail\");\n setError(fetchError);\n console.error(\"[useTemplateDetail] Error:\", err);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [client, contextHeaders],\n );\n\n return {\n fetchTemplateDetail,\n loading,\n error,\n };\n}\n"]}
|