@oneclick.dev/cms-kit 0.0.39 → 0.0.41
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/{cms-kit.cjs → cms-kit.cjs.js} +6 -6
- package/dist/{cms-kit.js → cms-kit.es.js} +424 -492
- package/dist/index.css +1 -1
- package/dist/index.d.ts +26 -0
- package/package.json +1 -1
|
@@ -1938,7 +1938,6 @@ const createClassGroupUtils = (config3) => {
|
|
|
1938
1938
|
};
|
|
1939
1939
|
};
|
|
1940
1940
|
const getGroupRecursive = (classParts, classPartObject) => {
|
|
1941
|
-
var _a2;
|
|
1942
1941
|
if (classParts.length === 0) {
|
|
1943
1942
|
return classPartObject.classGroupId;
|
|
1944
1943
|
}
|
|
@@ -1952,15 +1951,15 @@ const getGroupRecursive = (classParts, classPartObject) => {
|
|
|
1952
1951
|
return void 0;
|
|
1953
1952
|
}
|
|
1954
1953
|
const classRest = classParts.join(CLASS_PART_SEPARATOR);
|
|
1955
|
-
return
|
|
1954
|
+
return classPartObject.validators.find(({
|
|
1956
1955
|
validator
|
|
1957
|
-
}) => validator(classRest))
|
|
1956
|
+
}) => validator(classRest))?.classGroupId;
|
|
1958
1957
|
};
|
|
1959
1958
|
const arbitraryPropertyRegex = /^\[(.+)\]$/;
|
|
1960
1959
|
const getGroupIdForArbitraryProperty = (className) => {
|
|
1961
1960
|
if (arbitraryPropertyRegex.test(className)) {
|
|
1962
1961
|
const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
|
|
1963
|
-
const property = arbitraryPropertyClassName
|
|
1962
|
+
const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(":"));
|
|
1964
1963
|
if (property) {
|
|
1965
1964
|
return "arbitrary.." + property;
|
|
1966
1965
|
}
|
|
@@ -52115,16 +52114,15 @@ const _sfc_main$4m = /* @__PURE__ */ defineComponent({
|
|
|
52115
52114
|
const itemRef = ref();
|
|
52116
52115
|
const currentElement = useCurrentElement(itemRef);
|
|
52117
52116
|
onMounted$1(() => {
|
|
52118
|
-
var _a2;
|
|
52119
52117
|
if (!(currentElement.value instanceof HTMLElement))
|
|
52120
52118
|
return;
|
|
52121
52119
|
allItems.value.set(id2, currentElement.value.textContent ?? props.value.toString());
|
|
52122
|
-
const groupId = groupContext
|
|
52120
|
+
const groupId = groupContext?.id;
|
|
52123
52121
|
if (groupId) {
|
|
52124
52122
|
if (!allGroups.value.has(groupId)) {
|
|
52125
52123
|
allGroups.value.set(groupId, /* @__PURE__ */ new Set([id2]));
|
|
52126
52124
|
} else {
|
|
52127
|
-
|
|
52125
|
+
allGroups.value.get(groupId)?.add(id2);
|
|
52128
52126
|
}
|
|
52129
52127
|
}
|
|
52130
52128
|
});
|
|
@@ -54324,7 +54322,7 @@ function getCmsComposable(key) {
|
|
|
54324
54322
|
}
|
|
54325
54323
|
const useIntegrationActionBuilder = () => getCmsComposable("cms-useIntegrationActionBuilder")();
|
|
54326
54324
|
const useIntegrations = () => getCmsComposable("cms-useIntegrations")();
|
|
54327
|
-
const useIntegrationActions
|
|
54325
|
+
const useIntegrationActions = (integrationId) => getCmsComposable("cms-useIntegrationActions")(integrationId);
|
|
54328
54326
|
const useMediaLibrary = () => getCmsComposable("cms-useMediaLibrary")();
|
|
54329
54327
|
const useProjectService = () => getCmsComposable("cms-useProjectService")();
|
|
54330
54328
|
const useBreadcrumbs = () => getCmsComposable("cms-useBreadcrumbs")();
|
|
@@ -54336,9 +54334,11 @@ const useLogs = () => getCmsComposable("cms-useLogs")();
|
|
|
54336
54334
|
const useUtilsService = () => getCmsComposable("cms-useUtilsService")();
|
|
54337
54335
|
const useFormBuilder = () => getCmsComposable("cms-useFormBuilder")();
|
|
54338
54336
|
const useFlowBuilder = () => getCmsComposable("cms-useFlowBuilder")();
|
|
54339
|
-
const useConfirmation
|
|
54337
|
+
const useConfirmation = () => getCmsComposable("cms-useConfirmation")();
|
|
54340
54338
|
const useFirebaseIntegration = (projectId) => getCmsComposable("cms-useFirebaseIntegration")(projectId);
|
|
54341
54339
|
const useProjectSettings = () => getCmsComposable("cms-useProjectSettings")();
|
|
54340
|
+
const useCustomDialog$1 = () => getCmsComposable("cms-useCustomDialog")();
|
|
54341
|
+
const useModuleOverlay = () => getCmsComposable("cms-useModuleOverlay")();
|
|
54342
54342
|
const useOverlayStack = () => getCmsComposable("cms-useOverlayStack")();
|
|
54343
54343
|
function tryOnScopeDispose(fn2) {
|
|
54344
54344
|
if (getCurrentScope()) {
|
|
@@ -67765,10 +67765,10 @@ const Ve$1 = /* @__PURE__ */ defineComponent({
|
|
|
67765
67765
|
});
|
|
67766
67766
|
function interpolateTemplateFromVariableContext(template, variableContext) {
|
|
67767
67767
|
if (!template) return "";
|
|
67768
|
-
const context3 =
|
|
67768
|
+
const context3 = variableContext?.reduce((acc, variable) => {
|
|
67769
67769
|
acc[variable.name] = variable.value;
|
|
67770
67770
|
return acc;
|
|
67771
|
-
}, {})
|
|
67771
|
+
}, {}) ?? {};
|
|
67772
67772
|
return interpolateTemplate(template, sanitizeContext(context3));
|
|
67773
67773
|
}
|
|
67774
67774
|
function isValidIdentifier(name2) {
|
|
@@ -67819,27 +67819,26 @@ function extractIdentifiers(expr) {
|
|
|
67819
67819
|
}
|
|
67820
67820
|
const taskHandlers = {
|
|
67821
67821
|
"api-request": async (input, { node }) => {
|
|
67822
|
-
var _a2, _b, _c, _d;
|
|
67823
67822
|
try {
|
|
67824
67823
|
let variables = Object.keys(input).map((key) => ({ name: key, value: input[key] }));
|
|
67825
67824
|
let url = interpolateTemplateFromVariableContext(node.data.url, variables);
|
|
67826
67825
|
let method = interpolateTemplateFromVariableContext(node.data.method, variables).toUpperCase();
|
|
67827
|
-
let bodyPairs =
|
|
67826
|
+
let bodyPairs = node.data.body?.map((pair2) => ({
|
|
67828
67827
|
key: interpolateTemplateFromVariableContext(pair2.key, variables),
|
|
67829
67828
|
value: interpolateTemplateFromVariableContext(pair2.value, variables)
|
|
67830
|
-
}))
|
|
67831
|
-
let headersPairs =
|
|
67829
|
+
})) || [];
|
|
67830
|
+
let headersPairs = node.data.headers?.map((pair2) => ({
|
|
67832
67831
|
key: interpolateTemplateFromVariableContext(pair2.key, variables),
|
|
67833
67832
|
value: interpolateTemplateFromVariableContext(pair2.value, variables)
|
|
67834
|
-
}))
|
|
67835
|
-
let cookiesPairs =
|
|
67833
|
+
})) || [];
|
|
67834
|
+
let cookiesPairs = node.data.cookies?.map((pair2) => ({
|
|
67836
67835
|
key: interpolateTemplateFromVariableContext(pair2.key, variables),
|
|
67837
67836
|
value: interpolateTemplateFromVariableContext(pair2.value, variables)
|
|
67838
|
-
}))
|
|
67839
|
-
let urlParamPairs =
|
|
67837
|
+
})) || [];
|
|
67838
|
+
let urlParamPairs = node.data.urlParameters?.map((pair2) => ({
|
|
67840
67839
|
key: interpolateTemplateFromVariableContext(pair2.key, variables),
|
|
67841
67840
|
value: interpolateTemplateFromVariableContext(pair2.value, variables)
|
|
67842
|
-
}))
|
|
67841
|
+
})) || [];
|
|
67843
67842
|
const queryString = urlParamPairs.filter((p2) => p2.key).map((p2) => `${encodeURIComponent(p2.key)}=${encodeURIComponent(p2.value)}`).join("&");
|
|
67844
67843
|
const fullUrl = queryString ? `${url}?${queryString}` : url;
|
|
67845
67844
|
const headers = {};
|
|
@@ -67871,7 +67870,7 @@ const taskHandlers = {
|
|
|
67871
67870
|
}
|
|
67872
67871
|
let result;
|
|
67873
67872
|
const contentType = res.headers.get("content-type");
|
|
67874
|
-
if (contentType
|
|
67873
|
+
if (contentType?.includes("application/json")) {
|
|
67875
67874
|
result = await res.json();
|
|
67876
67875
|
} else {
|
|
67877
67876
|
result = await res.text();
|
|
@@ -67946,19 +67945,18 @@ const taskHandlers = {
|
|
|
67946
67945
|
return { visited: true };
|
|
67947
67946
|
},
|
|
67948
67947
|
"show-dialog": async (input, { node }) => {
|
|
67949
|
-
const { openCustomDialog } = useCustomDialog();
|
|
67948
|
+
const { openCustomDialog } = useCustomDialog$1();
|
|
67950
67949
|
let variables = Object.keys(input).map((key) => ({ name: key, value: input[key] }));
|
|
67951
67950
|
const result = await openCustomDialog(node.data.layout, variables);
|
|
67952
67951
|
console.log("Dialog result", result);
|
|
67953
67952
|
return result;
|
|
67954
67953
|
},
|
|
67955
67954
|
"show-module": async (input, { node }) => {
|
|
67956
|
-
var _a2;
|
|
67957
67955
|
console.log("Show module", input, node);
|
|
67958
67956
|
const { openInOverlay } = useModuleOverlay();
|
|
67959
67957
|
let variables = Object.keys(input).map((key) => ({ name: key, value: input[key] }));
|
|
67960
67958
|
const params = {};
|
|
67961
|
-
|
|
67959
|
+
node.data.moduleData?.forEach((d) => {
|
|
67962
67960
|
params[interpolateTemplateFromVariableContext(d.key, variables)] = interpolateTemplateFromVariableContext(d.value, variables);
|
|
67963
67961
|
});
|
|
67964
67962
|
openInOverlay(node.data.moduleId, params);
|
|
@@ -67998,16 +67996,12 @@ function useRunProcess({
|
|
|
67998
67996
|
const upcomingTasks = /* @__PURE__ */ new Set();
|
|
67999
67997
|
const localVariables = ref(variables ? JSON.parse(JSON.stringify(variables.map((v) => ({ ...v, value: Object.keys(v).includes("defaultValue") ? v.defaultValue : v.value ?? null })))) : []);
|
|
68000
67998
|
async function runNode(nodeId, isStart = false) {
|
|
68001
|
-
var _a2, _b, _c, _d;
|
|
68002
67999
|
if (executedNodes.has(nodeId)) {
|
|
68003
68000
|
return;
|
|
68004
68001
|
}
|
|
68005
68002
|
upcomingTasks.add(nodeId);
|
|
68006
68003
|
const incomers = getConnectedEdges2(nodeId).filter((connection) => connection.target === nodeId);
|
|
68007
|
-
await Promise.all(incomers.map((incomer) => until(() =>
|
|
68008
|
-
var _a3;
|
|
68009
|
-
return !((_a3 = incomer.data) == null ? void 0 : _a3.isAnimating);
|
|
68010
|
-
})));
|
|
68004
|
+
await Promise.all(incomers.map((incomer) => until(() => !incomer.data?.isAnimating)));
|
|
68011
68005
|
upcomingTasks.clear();
|
|
68012
68006
|
if (!isRunning.value) {
|
|
68013
68007
|
return;
|
|
@@ -68021,7 +68015,7 @@ function useRunProcess({
|
|
|
68021
68015
|
...inputFromPredecessors,
|
|
68022
68016
|
...Object.fromEntries(localVariables.value.map((v) => [v.name, v.value]))
|
|
68023
68017
|
};
|
|
68024
|
-
const node =
|
|
68018
|
+
const node = nodeMap?.size > 0 ? nodeMap.get(nodeId) : findNode(nodeId);
|
|
68025
68019
|
const taskFn = taskHandlers[node.data.taskType ?? node.type];
|
|
68026
68020
|
console.log("Running task:", node.data.taskType, taskFn);
|
|
68027
68021
|
const result = taskFn ? await taskFn(input, { node, graph: graph2.value, onFinish, localVariables }) : {};
|
|
@@ -68032,7 +68026,7 @@ function useRunProcess({
|
|
|
68032
68026
|
for (const edge of outgoingEdges) {
|
|
68033
68027
|
const { source, sourceHandle } = edge;
|
|
68034
68028
|
const nodeType = nodeMap.get(source).type;
|
|
68035
|
-
const shouldRun = nodeType === "start" || nodeType === "confirm" && sourceHandle === "success" && result.confirmed === true || nodeType === "confirm" && sourceHandle === "error" && result.confirmed === false || nodeType === "integration-action" && sourceHandle === "success" &&
|
|
68029
|
+
const shouldRun = nodeType === "start" || nodeType === "confirm" && sourceHandle === "success" && result.confirmed === true || nodeType === "confirm" && sourceHandle === "error" && result.confirmed === false || nodeType === "integration-action" && sourceHandle === "success" && result.result?.success === true || nodeType === "integration-action" && sourceHandle === "error" && result.result?.success === false || nodeType === "api-request" && sourceHandle === "success" && result.result?.success === true || nodeType === "api-request" && sourceHandle === "error" && result.result?.success === false || !["confirm", "integration-action", "api-request"].includes(nodeType) && sourceHandle === "success";
|
|
68036
68030
|
console.log("should run", shouldRun, nodeType, sourceHandle, result, hasBranching);
|
|
68037
68031
|
if (shouldRun) {
|
|
68038
68032
|
await runNode(edge.target);
|
|
@@ -68052,10 +68046,7 @@ function useRunProcess({
|
|
|
68052
68046
|
}
|
|
68053
68047
|
reset(nodes2);
|
|
68054
68048
|
isRunning.value = true;
|
|
68055
|
-
const startingNodes = nodes2.filter((node) =>
|
|
68056
|
-
var _a2;
|
|
68057
|
-
return ((_a2 = graph2.value.predecessors(node.id)) == null ? void 0 : _a2.length) === 0;
|
|
68058
|
-
});
|
|
68049
|
+
const startingNodes = nodes2.filter((node) => graph2.value.predecessors(node.id)?.length === 0);
|
|
68059
68050
|
await Promise.all(startingNodes.map((node) => runNode(node.id, true)));
|
|
68060
68051
|
clear();
|
|
68061
68052
|
}
|
|
@@ -68945,9 +68936,8 @@ const outputRegistry = {
|
|
|
68945
68936
|
default: {}
|
|
68946
68937
|
};
|
|
68947
68938
|
function getOutputsForNode(node, handleId) {
|
|
68948
|
-
var _a2;
|
|
68949
68939
|
const type = node.type || "default";
|
|
68950
|
-
return
|
|
68940
|
+
return outputRegistry[type]?.[handleId] ?? [];
|
|
68951
68941
|
}
|
|
68952
68942
|
const _sfc_main$3n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
68953
68943
|
__name: "DataEdge",
|
|
@@ -77240,8 +77230,8 @@ function useLayout() {
|
|
|
77240
77230
|
for (const node of nodes) {
|
|
77241
77231
|
const graphNode = findNode(node.id);
|
|
77242
77232
|
dagreGraph.setNode(node.id, {
|
|
77243
|
-
width:
|
|
77244
|
-
height:
|
|
77233
|
+
width: graphNode?.dimensions.width || 150,
|
|
77234
|
+
height: graphNode?.dimensions.height || 50
|
|
77245
77235
|
});
|
|
77246
77236
|
}
|
|
77247
77237
|
for (const edge of edges) {
|
|
@@ -77405,16 +77395,15 @@ const _sfc_main$3j = /* @__PURE__ */ defineComponent({
|
|
|
77405
77395
|
]),
|
|
77406
77396
|
createElementVNode("div", _hoisted_3$v, [
|
|
77407
77397
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(variables), (variable) => {
|
|
77408
|
-
var _a2, _b;
|
|
77409
77398
|
return openBlock(), createElementBlock("div", {
|
|
77410
77399
|
key: variable.id
|
|
77411
77400
|
}, [
|
|
77412
77401
|
createElementVNode("div", _hoisted_4$j, [
|
|
77413
77402
|
createElementVNode("div", {
|
|
77414
77403
|
class: "size-6 p-1 rounded flex items-center justify-center",
|
|
77415
|
-
style: normalizeStyle({ backgroundColor:
|
|
77404
|
+
style: normalizeStyle({ backgroundColor: variableOptions.find((option) => option.value === variable.type)?.tint })
|
|
77416
77405
|
}, [
|
|
77417
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
77406
|
+
(openBlock(), createBlock(resolveDynamicComponent(variableOptions.find((option) => option.value === variable.type)?.icon), { class: "text-white" }))
|
|
77418
77407
|
], 4),
|
|
77419
77408
|
createElementVNode("div", _hoisted_5$d, [
|
|
77420
77409
|
createVNode(_component_Input, {
|
|
@@ -77453,12 +77442,9 @@ const _sfc_main$3j = /* @__PURE__ */ defineComponent({
|
|
|
77453
77442
|
variant: "outline",
|
|
77454
77443
|
size: "sm"
|
|
77455
77444
|
}, {
|
|
77456
|
-
default: withCtx(() =>
|
|
77457
|
-
|
|
77458
|
-
|
|
77459
|
-
createTextVNode(toDisplayString((_a3 = variableOptions.find((option) => option.value === variable.type)) == null ? void 0 : _a3.label), 1)
|
|
77460
|
-
];
|
|
77461
|
-
}),
|
|
77445
|
+
default: withCtx(() => [
|
|
77446
|
+
createTextVNode(toDisplayString(variableOptions.find((option) => option.value === variable.type)?.label), 1)
|
|
77447
|
+
]),
|
|
77462
77448
|
_: 2
|
|
77463
77449
|
}, 1024)
|
|
77464
77450
|
]),
|
|
@@ -78817,9 +78803,8 @@ const _sfc_main$35 = /* @__PURE__ */ defineComponent({
|
|
|
78817
78803
|
}
|
|
78818
78804
|
};
|
|
78819
78805
|
const outputValues = computed$1(() => {
|
|
78820
|
-
|
|
78821
|
-
|
|
78822
|
-
return (_k = (_j = (_h = (_g = (_e2 = integrationSettingViews == null ? void 0 : integrationSettingViews[(_d = node.value.data.action) == null ? void 0 : _d.integrationType]) == null ? void 0 : _e2.serviceTypes) == null ? void 0 : _g[(_f = node.value.data.action) == null ? void 0 : _f.serviceType]) == null ? void 0 : _h.actionTypes) == null ? void 0 : _j[(_i2 = node.value.data.action) == null ? void 0 : _i2.actionType]) == null ? void 0 : _k.outputs;
|
|
78806
|
+
if (!node.value.data.action?.integrationType || !node.value.data.action?.serviceType || !node.value.data.action?.actionType) return {};
|
|
78807
|
+
return integrationSettingViews?.[node.value.data.action?.integrationType]?.serviceTypes?.[node.value.data.action?.serviceType]?.actionTypes?.[node.value.data.action?.actionType]?.outputs;
|
|
78823
78808
|
});
|
|
78824
78809
|
return (_ctx, _cache2) => {
|
|
78825
78810
|
const _component_Button = resolveComponent("Button");
|
|
@@ -79798,7 +79783,7 @@ const _sfc_main$2X = /* @__PURE__ */ defineComponent({
|
|
|
79798
79783
|
buttonClass: "bg-gray-800 text-white"
|
|
79799
79784
|
}
|
|
79800
79785
|
];
|
|
79801
|
-
const nodeType = computed$1(() => NODE_TYPES
|
|
79786
|
+
const nodeType = computed$1(() => NODE_TYPES?.find((type) => type.value === node.value.type));
|
|
79802
79787
|
return (_ctx, _cache2) => {
|
|
79803
79788
|
const _component_Button = resolveComponent("Button");
|
|
79804
79789
|
const _component_SelectValue = resolveComponent("SelectValue");
|
|
@@ -79994,7 +79979,7 @@ const _sfc_main$2W = /* @__PURE__ */ defineComponent({
|
|
|
79994
79979
|
}
|
|
79995
79980
|
});
|
|
79996
79981
|
const prettify = (type) => {
|
|
79997
|
-
if (!
|
|
79982
|
+
if (!type?.startsWith("{") || !type.endsWith("}")) return type;
|
|
79998
79983
|
const inner = type.slice(1, -1).trim();
|
|
79999
79984
|
const lines = inner.split(";").filter(Boolean).map((line) => ` ${line.trim()};`);
|
|
80000
79985
|
return ["{", ...lines, "}"].join("\n");
|
|
@@ -80084,7 +80069,7 @@ const _sfc_main$2U = /* @__PURE__ */ defineComponent({
|
|
|
80084
80069
|
},
|
|
80085
80070
|
setup(__props, { expose: __expose }) {
|
|
80086
80071
|
const props = __props;
|
|
80087
|
-
const confirmation = useConfirmation
|
|
80072
|
+
const confirmation = useConfirmation();
|
|
80088
80073
|
const { nodes, edges, fitView, onEdgesChange, applyEdgeChanges, onNodesChange, applyNodeChanges, findNode, findEdge, addNodes, removeNodes, addEdges, removeEdges, setNodes, setEdges, toObject } = useVueFlow();
|
|
80089
80074
|
const overlayStack = useOverlayStack();
|
|
80090
80075
|
const randomId = crypto.randomUUID();
|
|
@@ -80206,7 +80191,7 @@ const _sfc_main$2U = /* @__PURE__ */ defineComponent({
|
|
|
80206
80191
|
};
|
|
80207
80192
|
const setState = (state) => {
|
|
80208
80193
|
console.log("Set state", state);
|
|
80209
|
-
setNodes(
|
|
80194
|
+
setNodes(state?.nodes ?? [
|
|
80210
80195
|
{
|
|
80211
80196
|
id: "START",
|
|
80212
80197
|
type: "start",
|
|
@@ -80214,9 +80199,9 @@ const _sfc_main$2U = /* @__PURE__ */ defineComponent({
|
|
|
80214
80199
|
data: {}
|
|
80215
80200
|
}
|
|
80216
80201
|
]);
|
|
80217
|
-
setEdges(
|
|
80218
|
-
variables.value =
|
|
80219
|
-
computedVariables.value =
|
|
80202
|
+
setEdges(state?.edges ?? []);
|
|
80203
|
+
variables.value = state?.variables ?? [];
|
|
80204
|
+
computedVariables.value = state?.computedVariables ?? [];
|
|
80220
80205
|
};
|
|
80221
80206
|
onMounted$1(() => {
|
|
80222
80207
|
overlayStack.push(randomId);
|
|
@@ -80330,15 +80315,13 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
|
|
|
80330
80315
|
watch$1(
|
|
80331
80316
|
() => props.workflow,
|
|
80332
80317
|
async () => {
|
|
80333
|
-
var _a2, _b;
|
|
80334
80318
|
await nextTick();
|
|
80335
|
-
|
|
80319
|
+
flowBuilder.value?.setState?.(props.workflow);
|
|
80336
80320
|
},
|
|
80337
80321
|
{ immediate: true }
|
|
80338
80322
|
);
|
|
80339
80323
|
const saveForm = () => {
|
|
80340
|
-
|
|
80341
|
-
const data2 = (_b = (_a2 = flowBuilder.value) == null ? void 0 : _a2.getState) == null ? void 0 : _b.call(_a2);
|
|
80324
|
+
const data2 = flowBuilder.value?.getState?.();
|
|
80342
80325
|
closeFlowBuilder(props.id, data2);
|
|
80343
80326
|
};
|
|
80344
80327
|
const cancel = () => {
|
|
@@ -81240,7 +81223,7 @@ const _sfc_main$2C = /* @__PURE__ */ defineComponent({
|
|
|
81240
81223
|
const props = __props;
|
|
81241
81224
|
const allAvailableVariables = inject("allAvailableVariables");
|
|
81242
81225
|
const output = computed(() => {
|
|
81243
|
-
return interpolateTemplateFromVariableContext(props.text, allAvailableVariables
|
|
81226
|
+
return interpolateTemplateFromVariableContext(props.text, allAvailableVariables?.value);
|
|
81244
81227
|
});
|
|
81245
81228
|
return (_ctx, _cache2) => {
|
|
81246
81229
|
return openBlock(), createElementBlock("p", _hoisted_1$I, toDisplayString(unref(output)), 1);
|
|
@@ -81440,7 +81423,7 @@ const _sfc_main$2x = /* @__PURE__ */ defineComponent({
|
|
|
81440
81423
|
const props = __props;
|
|
81441
81424
|
const allAvailableVariables = inject("allAvailableVariables");
|
|
81442
81425
|
const output = computed(() => {
|
|
81443
|
-
return interpolateTemplateFromVariableContext(props.text, allAvailableVariables
|
|
81426
|
+
return interpolateTemplateFromVariableContext(props.text, allAvailableVariables?.value);
|
|
81444
81427
|
});
|
|
81445
81428
|
return (_ctx, _cache2) => {
|
|
81446
81429
|
return openBlock(), createElementBlock("p", _hoisted_1$F, toDisplayString(unref(output)), 1);
|
|
@@ -111349,7 +111332,6 @@ const _sfc_main$2s = /* @__PURE__ */ defineComponent({
|
|
|
111349
111332
|
const state = inject$1("state");
|
|
111350
111333
|
const isDragging2 = inject$1("isDragging");
|
|
111351
111334
|
async function drag2() {
|
|
111352
|
-
var _a2, _b, _c, _d, _e2, _f, _g, _h;
|
|
111353
111335
|
isDragging2.value = true;
|
|
111354
111336
|
const parentRect = document.querySelector("#custom-form-builder .vue-grid-layout").getBoundingClientRect();
|
|
111355
111337
|
let mouseInGrid = false;
|
|
@@ -111360,31 +111342,30 @@ const _sfc_main$2s = /* @__PURE__ */ defineComponent({
|
|
|
111360
111342
|
await addElement(state.layout.length * 2 % (state.colNum || 12), state.layout.length + (state.colNum || 12), true);
|
|
111361
111343
|
await nextTick();
|
|
111362
111344
|
}
|
|
111363
|
-
if (!
|
|
111345
|
+
if (!state.itemRefs?.drop) {
|
|
111364
111346
|
return;
|
|
111365
111347
|
}
|
|
111366
111348
|
const index = state.layout.findIndex((item) => item.i === "drop");
|
|
111367
111349
|
if (index !== -1) {
|
|
111368
|
-
if (
|
|
111350
|
+
if (state.itemRefs?.drop?.el?.style) {
|
|
111369
111351
|
state.itemRefs.drop.el.style.display = "none";
|
|
111370
111352
|
}
|
|
111371
111353
|
const itemRef = state.itemRefs.drop;
|
|
111372
111354
|
const new_pos = itemRef.calcXY(mouseXY.y - parentRect.top, mouseXY.x - parentRect.left);
|
|
111373
111355
|
if (mouseInGrid === true) {
|
|
111374
|
-
state.layoutRef.emitter.emit("dragEvent", ["dragstart", "drop", new_pos.x, new_pos.y,
|
|
111356
|
+
state.layoutRef.emitter.emit("dragEvent", ["dragstart", "drop", new_pos.x, new_pos.y, props.elementData?.h || 1, props.elementData?.w || 1]);
|
|
111375
111357
|
DragPos.i = String(index);
|
|
111376
111358
|
DragPos.x = state.layout[index].x;
|
|
111377
111359
|
DragPos.y = state.layout[index].y;
|
|
111378
111360
|
}
|
|
111379
111361
|
if (mouseInGrid === false) {
|
|
111380
|
-
state.layoutRef.emitter.emit("dragEvent", ["dragend", "drop", new_pos.x, new_pos.y,
|
|
111362
|
+
state.layoutRef.emitter.emit("dragEvent", ["dragend", "drop", new_pos.x, new_pos.y, props.elementData?.h || 1, props.elementData?.w || 1]);
|
|
111381
111363
|
state.layout = state.layout.filter((obj) => obj.i !== "drop");
|
|
111382
111364
|
await nextTick();
|
|
111383
111365
|
}
|
|
111384
111366
|
}
|
|
111385
111367
|
}
|
|
111386
111368
|
async function dragend() {
|
|
111387
|
-
var _a2, _b, _c, _d;
|
|
111388
111369
|
isDragging2.value = false;
|
|
111389
111370
|
const parentRect = document.querySelector("#custom-form-builder .vue-grid-layout").getBoundingClientRect();
|
|
111390
111371
|
let mouseInGrid = false;
|
|
@@ -111392,22 +111373,21 @@ const _sfc_main$2s = /* @__PURE__ */ defineComponent({
|
|
|
111392
111373
|
mouseInGrid = true;
|
|
111393
111374
|
}
|
|
111394
111375
|
if (mouseInGrid === true) {
|
|
111395
|
-
state.layoutRef.emitter.emit("dragEvent", ["dragend", "drop", DragPos.x, DragPos.y,
|
|
111376
|
+
state.layoutRef.emitter.emit("dragEvent", ["dragend", "drop", DragPos.x, DragPos.y, props.elementData?.h || 1, props.elementData?.w || 1]);
|
|
111396
111377
|
state.layout = state.layout.filter((obj) => obj.i !== "drop");
|
|
111397
111378
|
await addElement(DragPos.x, DragPos.y);
|
|
111398
111379
|
await nextTick();
|
|
111399
|
-
state.layoutRef.emitter.emit("dragEvent", ["dragend", DragPos.i, DragPos.x, DragPos.y,
|
|
111380
|
+
state.layoutRef.emitter.emit("dragEvent", ["dragend", DragPos.i, DragPos.x, DragPos.y, props.elementData?.h || 1, props.elementData?.w || 1]);
|
|
111400
111381
|
}
|
|
111401
111382
|
}
|
|
111402
111383
|
async function addElement(x2, y, ghost) {
|
|
111403
|
-
var _a2, _b, _c, _d;
|
|
111404
111384
|
let newEl = {
|
|
111405
111385
|
x: x2,
|
|
111406
111386
|
y,
|
|
111407
|
-
w:
|
|
111408
|
-
h:
|
|
111409
|
-
minW:
|
|
111410
|
-
minH:
|
|
111387
|
+
w: props.elementData?.w || 1,
|
|
111388
|
+
h: props.elementData?.h || 1,
|
|
111389
|
+
minW: props.elementData?.minW || 1,
|
|
111390
|
+
minH: props.elementData?.minH || 1,
|
|
111411
111391
|
i: ghost ? "drop" : state.index,
|
|
111412
111392
|
component: props.elementData.component,
|
|
111413
111393
|
variableName: getNextVariableName(props.elementData.variableBaseName),
|
|
@@ -111668,7 +111648,7 @@ const _sfc_main$2q = /* @__PURE__ */ defineComponent({
|
|
|
111668
111648
|
watch$1(state.apiActions, (val) => {
|
|
111669
111649
|
if (val) {
|
|
111670
111650
|
async function loadData(action) {
|
|
111671
|
-
const { fireAction } = useIntegrationActions
|
|
111651
|
+
const { fireAction } = useIntegrationActions(action.integration);
|
|
111672
111652
|
let res = await fireAction(action, allAvailableVariables.value);
|
|
111673
111653
|
console.log("fireAction res", res);
|
|
111674
111654
|
}
|
|
@@ -111711,7 +111691,7 @@ const _sfc_main$2q = /* @__PURE__ */ defineComponent({
|
|
|
111711
111691
|
state.apiActions = state.apiActions.filter((a) => a.id !== action.id);
|
|
111712
111692
|
};
|
|
111713
111693
|
const executeAction = async (action) => {
|
|
111714
|
-
const { fireAction } = useIntegrationActions
|
|
111694
|
+
const { fireAction } = useIntegrationActions(action.action.integration);
|
|
111715
111695
|
let res = await fireAction(action.action, allAvailableVariables.value);
|
|
111716
111696
|
state.apiActions.find((a) => a.id === action.id).action.response = res;
|
|
111717
111697
|
};
|
|
@@ -111751,17 +111731,14 @@ const _sfc_main$2q = /* @__PURE__ */ defineComponent({
|
|
|
111751
111731
|
class: "flex gap-1 items-center justify-start w-full",
|
|
111752
111732
|
onClick: ($event) => editIntegrationAction(action)
|
|
111753
111733
|
}, {
|
|
111754
|
-
default: withCtx(() =>
|
|
111755
|
-
|
|
111756
|
-
|
|
111757
|
-
((
|
|
111758
|
-
|
|
111759
|
-
|
|
111760
|
-
|
|
111761
|
-
|
|
111762
|
-
createElementVNode("p", _hoisted_2$k, toDisplayString(action.label), 1)
|
|
111763
|
-
];
|
|
111764
|
-
}),
|
|
111734
|
+
default: withCtx(() => [
|
|
111735
|
+
action.action?.integration ? (openBlock(), createBlock(_component_IntegrationIcon, {
|
|
111736
|
+
key: 0,
|
|
111737
|
+
type: unref(integrations).find((integration) => integration.id === action.action.integration)?.type,
|
|
111738
|
+
class: "size-5"
|
|
111739
|
+
}, null, 8, ["type"])) : createCommentVNode("", true),
|
|
111740
|
+
createElementVNode("p", _hoisted_2$k, toDisplayString(action.label), 1)
|
|
111741
|
+
]),
|
|
111765
111742
|
_: 2
|
|
111766
111743
|
}, 1032, ["onClick"])
|
|
111767
111744
|
]),
|
|
@@ -111918,16 +111895,15 @@ const _sfc_main$2p = /* @__PURE__ */ defineComponent({
|
|
|
111918
111895
|
]),
|
|
111919
111896
|
createElementVNode("div", _hoisted_3$e, [
|
|
111920
111897
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(state).variables, (variable) => {
|
|
111921
|
-
var _a2, _b;
|
|
111922
111898
|
return openBlock(), createElementBlock("div", {
|
|
111923
111899
|
key: variable.id,
|
|
111924
111900
|
class: "flex gap-2 items-center"
|
|
111925
111901
|
}, [
|
|
111926
111902
|
createElementVNode("div", {
|
|
111927
111903
|
class: "size-6 p-1 rounded flex items-center justify-center",
|
|
111928
|
-
style: normalizeStyle({ backgroundColor:
|
|
111904
|
+
style: normalizeStyle({ backgroundColor: variableOptions.find((option) => option.value === variable.type)?.tint })
|
|
111929
111905
|
}, [
|
|
111930
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
111906
|
+
(openBlock(), createBlock(resolveDynamicComponent(variableOptions.find((option) => option.value === variable.type)?.icon), { class: "text-white" }))
|
|
111931
111907
|
], 4),
|
|
111932
111908
|
createElementVNode("div", _hoisted_4$8, [
|
|
111933
111909
|
createVNode(_component_Input, {
|
|
@@ -112080,19 +112056,16 @@ const _sfc_main$2n = /* @__PURE__ */ defineComponent({
|
|
|
112080
112056
|
key: action.id,
|
|
112081
112057
|
class: "flex gap-2 items-center justify-between"
|
|
112082
112058
|
}, {
|
|
112083
|
-
default: withCtx(() =>
|
|
112084
|
-
|
|
112085
|
-
|
|
112086
|
-
|
|
112087
|
-
|
|
112088
|
-
|
|
112089
|
-
|
|
112090
|
-
|
|
112091
|
-
|
|
112092
|
-
|
|
112093
|
-
createVNode(unref(ChevronDown), { class: "size-4" })
|
|
112094
|
-
];
|
|
112095
|
-
}),
|
|
112059
|
+
default: withCtx(() => [
|
|
112060
|
+
createElementVNode("div", _hoisted_2$h, [
|
|
112061
|
+
createVNode(_component_IntegrationIcon, {
|
|
112062
|
+
type: unref(integrations).find((integration) => integration.id === action.action.integration)?.type,
|
|
112063
|
+
class: "size-5"
|
|
112064
|
+
}, null, 8, ["type"]),
|
|
112065
|
+
createTextVNode(" " + toDisplayString(action.label), 1)
|
|
112066
|
+
]),
|
|
112067
|
+
createVNode(unref(ChevronDown), { class: "size-4" })
|
|
112068
|
+
]),
|
|
112096
112069
|
_: 2
|
|
112097
112070
|
}, 1024);
|
|
112098
112071
|
}), 128))
|
|
@@ -112129,16 +112102,15 @@ const _sfc_main$2m = /* @__PURE__ */ defineComponent({
|
|
|
112129
112102
|
], -1)),
|
|
112130
112103
|
createElementVNode("div", _hoisted_2$g, [
|
|
112131
112104
|
(openBlock(true), createElementBlock(Fragment, null, renderList(Object.entries(unref(route).query), ([param, value]) => {
|
|
112132
|
-
var _a2, _b;
|
|
112133
112105
|
return openBlock(), createElementBlock("div", {
|
|
112134
112106
|
key: toCamelCase2(param),
|
|
112135
112107
|
class: "flex gap-2 items-center"
|
|
112136
112108
|
}, [
|
|
112137
112109
|
createElementVNode("div", {
|
|
112138
112110
|
class: "size-6 p-1 rounded flex items-center justify-center",
|
|
112139
|
-
style: normalizeStyle({ backgroundColor:
|
|
112111
|
+
style: normalizeStyle({ backgroundColor: variableOptions.find((option) => option.value === "string")?.tint })
|
|
112140
112112
|
}, [
|
|
112141
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
112113
|
+
(openBlock(), createBlock(resolveDynamicComponent(variableOptions.find((option) => option.value === "string")?.icon), { class: "text-white" }))
|
|
112142
112114
|
], 4),
|
|
112143
112115
|
createElementVNode("div", _hoisted_3$c, [
|
|
112144
112116
|
createTextVNode(toDisplayString(toCamelCase2(param) + " = " + value) + " ", 1),
|
|
@@ -112224,8 +112196,7 @@ const _sfc_main$2j = /* @__PURE__ */ defineComponent({
|
|
|
112224
112196
|
}
|
|
112225
112197
|
}
|
|
112226
112198
|
onMounted(() => {
|
|
112227
|
-
|
|
112228
|
-
newName.value = ((_a2 = activeElement.value) == null ? void 0 : _a2.variableName) || "";
|
|
112199
|
+
newName.value = activeElement.value?.variableName || "";
|
|
112229
112200
|
});
|
|
112230
112201
|
return (_ctx, _cache2) => {
|
|
112231
112202
|
const _component_Input = resolveComponent("Input");
|
|
@@ -117508,7 +117479,7 @@ const _hoisted_2$f = ["onClick"];
|
|
|
117508
117479
|
const _sfc_main$2i = /* @__PURE__ */ defineComponent({
|
|
117509
117480
|
__name: "CustomDashboard",
|
|
117510
117481
|
setup(__props) {
|
|
117511
|
-
const confirmation = useConfirmation
|
|
117482
|
+
const confirmation = useConfirmation();
|
|
117512
117483
|
const overlayStack = useOverlayStack();
|
|
117513
117484
|
const randomId = crypto.randomUUID();
|
|
117514
117485
|
const state = inject$1("state");
|
|
@@ -117589,9 +117560,8 @@ const _sfc_main$2i = /* @__PURE__ */ defineComponent({
|
|
|
117589
117560
|
selectionBox.style.height = "0px";
|
|
117590
117561
|
};
|
|
117591
117562
|
function isTypingInInput() {
|
|
117592
|
-
|
|
117593
|
-
const
|
|
117594
|
-
const isContentEditable = (_b = document.activeElement) == null ? void 0 : _b.getAttribute("contenteditable");
|
|
117563
|
+
const tag = document.activeElement?.tagName.toLowerCase();
|
|
117564
|
+
const isContentEditable = document.activeElement?.getAttribute("contenteditable");
|
|
117595
117565
|
return ["input", "textarea", "select"].includes(tag) || isContentEditable === "true";
|
|
117596
117566
|
}
|
|
117597
117567
|
async function handleKeydown(event) {
|
|
@@ -117620,7 +117590,7 @@ const _sfc_main$2i = /* @__PURE__ */ defineComponent({
|
|
|
117620
117590
|
};
|
|
117621
117591
|
const isHidden = (item) => {
|
|
117622
117592
|
if (Object.keys(item).includes("visibility")) {
|
|
117623
|
-
return ![true, "true", 1].includes(interpolateTemplateFromVariableContext(item.visibility.trim(), allAvailableVariables
|
|
117593
|
+
return ![true, "true", 1].includes(interpolateTemplateFromVariableContext(item.visibility.trim(), allAvailableVariables?.value));
|
|
117624
117594
|
}
|
|
117625
117595
|
return false;
|
|
117626
117596
|
};
|
|
@@ -117696,24 +117666,21 @@ const _sfc_main$2i = /* @__PURE__ */ defineComponent({
|
|
|
117696
117666
|
"max-y": item.maxY,
|
|
117697
117667
|
"preserve-aspect-ratio": item.preserveAspectRatio
|
|
117698
117668
|
}, {
|
|
117699
|
-
default: withCtx(() =>
|
|
117700
|
-
|
|
117701
|
-
|
|
117702
|
-
|
|
117703
|
-
|
|
117704
|
-
|
|
117705
|
-
|
|
117706
|
-
|
|
117707
|
-
|
|
117708
|
-
|
|
117709
|
-
|
|
117710
|
-
|
|
117711
|
-
|
|
117712
|
-
|
|
117713
|
-
|
|
117714
|
-
], 10, _hoisted_2$f)
|
|
117715
|
-
];
|
|
117716
|
-
}),
|
|
117669
|
+
default: withCtx(() => [
|
|
117670
|
+
createElementVNode("div", {
|
|
117671
|
+
class: normalizeClass(["w-full h-full p-2 outline-primary/70", unref(cn$1)(
|
|
117672
|
+
unref(isEditMode) && (unref(isDragging2) || isSelecting.value) ? "outline outline-dashed" : "",
|
|
117673
|
+
unref(isEditMode) ? "group-hover:outline-2" : "",
|
|
117674
|
+
unref(isEditMode) && (unref(selectedItems).includes(item.i) || unref(activeElement)?.i === item.i) ? "outline-2" : "",
|
|
117675
|
+
unref(isEditMode) && isHidden(item) ? "opacity-50" : isHidden(item) ? "hidden pointer-events-none" : ""
|
|
117676
|
+
)]),
|
|
117677
|
+
onClick: ($event) => unref(isEditMode) ? setActive2(item) : null
|
|
117678
|
+
}, [
|
|
117679
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(elementComponents)[`CustomForm${item.component}`]), mergeProps({
|
|
117680
|
+
key: item.i
|
|
117681
|
+
}, { ref_for: true }, item), null, 16))
|
|
117682
|
+
], 10, _hoisted_2$f)
|
|
117683
|
+
]),
|
|
117717
117684
|
_: 2
|
|
117718
117685
|
}, 1032, ["data-grid-id", "static", "x", "y", "w", "h", "i", "min-w", "max-w", "min-h", "max-h", "min-x", "max-x", "min-y", "max-y", "preserve-aspect-ratio"]);
|
|
117719
117686
|
}), 128))
|
|
@@ -117780,13 +117747,12 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
117780
117747
|
document.body.style.userSelect = "none";
|
|
117781
117748
|
}
|
|
117782
117749
|
function handleMouseMove(e) {
|
|
117783
|
-
var _a2, _b;
|
|
117784
117750
|
if (!isResizing.value) return;
|
|
117785
117751
|
const dx = e.clientX - resizeStart.value.x;
|
|
117786
117752
|
const dy = e.clientY - resizeStart.value.y;
|
|
117787
117753
|
const minWidth = 200, minHeight = 200;
|
|
117788
|
-
const maxWidth =
|
|
117789
|
-
const maxHeight =
|
|
117754
|
+
const maxWidth = builderContainer.value?.offsetWidth || 800;
|
|
117755
|
+
const maxHeight = builderContainer.value?.offsetHeight || 800;
|
|
117790
117756
|
previewSize.value.width = Math.max(minWidth, Math.min(resizeStart.value.width + dx, maxWidth));
|
|
117791
117757
|
previewSize.value.height = Math.max(minHeight, Math.min(resizeStart.value.height + dy, maxHeight));
|
|
117792
117758
|
}
|
|
@@ -117837,7 +117803,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
117837
117803
|
});
|
|
117838
117804
|
const getState = () => {
|
|
117839
117805
|
let { layout: layout2, variables, transformers, apiActions } = JSON.parse(JSON.stringify(state));
|
|
117840
|
-
apiActions
|
|
117806
|
+
apiActions?.forEach((action) => {
|
|
117841
117807
|
action.action.response = null;
|
|
117842
117808
|
action.firedAt = null;
|
|
117843
117809
|
action.hasFired = false;
|
|
@@ -117848,17 +117814,16 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
117848
117814
|
Object.assign(state, newState);
|
|
117849
117815
|
};
|
|
117850
117816
|
const baseVariables = computed$1(() => {
|
|
117851
|
-
|
|
117852
|
-
const normalVars = ((_a2 = state.variables) == null ? void 0 : _a2.map((v) => ({
|
|
117817
|
+
const normalVars = state.variables?.map((v) => ({
|
|
117853
117818
|
name: v.name,
|
|
117854
117819
|
type: v.type,
|
|
117855
117820
|
value: v.value ?? null
|
|
117856
|
-
}))
|
|
117857
|
-
const apiActionVars =
|
|
117821
|
+
})) || [];
|
|
117822
|
+
const apiActionVars = state.apiActions?.map((a) => ({
|
|
117858
117823
|
name: a.label,
|
|
117859
117824
|
type: "apiActionResponse",
|
|
117860
117825
|
value: a.action ?? null
|
|
117861
|
-
}))
|
|
117826
|
+
})) || [];
|
|
117862
117827
|
const elementVars = Object.entries(state.elementValues ?? {}).map(([key, val]) => ({
|
|
117863
117828
|
name: key,
|
|
117864
117829
|
type: "element",
|
|
@@ -117871,7 +117836,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
117871
117836
|
type: "routeQueryParam",
|
|
117872
117837
|
value: val ?? null
|
|
117873
117838
|
})) || [];
|
|
117874
|
-
return
|
|
117839
|
+
return [...normalVars, ...apiActionVars, ...elementVars, ...routeQueryVars]?.filter((v) => v.name);
|
|
117875
117840
|
});
|
|
117876
117841
|
function toCamelCase2(str) {
|
|
117877
117842
|
return str.replace(/-([a-z])/g, (_2, letter) => letter.toUpperCase());
|
|
@@ -117896,14 +117861,13 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
117896
117861
|
return sandbox2(expression, context3);
|
|
117897
117862
|
};
|
|
117898
117863
|
const sandbox2 = (code, args = {}) => {
|
|
117899
|
-
var _a2;
|
|
117900
117864
|
try {
|
|
117901
117865
|
const frame2 = document.createElement("iframe");
|
|
117902
117866
|
frame2.style.display = "none";
|
|
117903
117867
|
document.body.appendChild(frame2);
|
|
117904
|
-
const F =
|
|
117868
|
+
const F = frame2.contentWindow?.Function;
|
|
117905
117869
|
document.body.removeChild(frame2);
|
|
117906
|
-
return F
|
|
117870
|
+
return F?.(...Object.keys(args), "'use strict';" + code)(...Object.values(args));
|
|
117907
117871
|
} catch (error) {
|
|
117908
117872
|
console.error("Sandbox error:", error);
|
|
117909
117873
|
return "";
|
|
@@ -117921,8 +117885,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
117921
117885
|
document.removeEventListener("mouseup", onMouseUp, true);
|
|
117922
117886
|
});
|
|
117923
117887
|
async function onMouseDown(e) {
|
|
117924
|
-
|
|
117925
|
-
if ((_a2 = e.target) == null ? void 0 : _a2.closest(".vue-grid-item")) {
|
|
117888
|
+
if (e.target?.closest(".vue-grid-item")) {
|
|
117926
117889
|
isDragging2.value = true;
|
|
117927
117890
|
}
|
|
117928
117891
|
}
|
|
@@ -117945,35 +117908,32 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
117945
117908
|
provide("isEditMode", isEditMode);
|
|
117946
117909
|
provide("onFinish", props.onFinish);
|
|
117947
117910
|
async function loadState() {
|
|
117948
|
-
var _a2;
|
|
117949
117911
|
const fetchedState = {};
|
|
117950
117912
|
if (fetchedState) {
|
|
117951
|
-
|
|
117913
|
+
Object.keys(fetchedState)?.forEach((key) => {
|
|
117952
117914
|
state[key] = fetchedState[key];
|
|
117953
117915
|
});
|
|
117954
117916
|
}
|
|
117955
117917
|
}
|
|
117956
117918
|
function fillDefaultValues() {
|
|
117957
|
-
|
|
117958
|
-
(_a2 = state.layout) == null ? void 0 : _a2.forEach((item) => {
|
|
117919
|
+
state.layout?.forEach((item) => {
|
|
117959
117920
|
if (Object.keys(item).includes("defaultValue")) {
|
|
117960
117921
|
state.elementValues[item.variableName] = interpolateTemplateFromVariableContext(item.defaultValue, allAvailableVariables.value);
|
|
117961
117922
|
}
|
|
117962
117923
|
});
|
|
117963
117924
|
}
|
|
117964
117925
|
const setup = async () => {
|
|
117965
|
-
var _a2, _b;
|
|
117966
117926
|
await loadState();
|
|
117967
117927
|
fillDefaultValues();
|
|
117968
117928
|
loadStartupActions();
|
|
117969
117929
|
previewSize.value = {
|
|
117970
|
-
width: Math.min(
|
|
117971
|
-
height: Math.min(
|
|
117930
|
+
width: Math.min(builderContainer.value?.offsetWidth - 40, 700),
|
|
117931
|
+
height: Math.min(builderContainer.value?.offsetHeight - 40, 1e3)
|
|
117972
117932
|
};
|
|
117973
117933
|
};
|
|
117974
117934
|
const loadStartupActions = () => {
|
|
117975
117935
|
async function loadAction(action) {
|
|
117976
|
-
const { fireAction } = useIntegrationActions
|
|
117936
|
+
const { fireAction } = useIntegrationActions(action.action.integration);
|
|
117977
117937
|
let res = await fireAction(action.action, allAvailableVariables.value);
|
|
117978
117938
|
state.apiActions.find((a) => a.id === action.id).action.response = res;
|
|
117979
117939
|
}
|
|
@@ -118041,9 +118001,8 @@ const _sfc_main$2g = /* @__PURE__ */ defineComponent({
|
|
|
118041
118001
|
watch$1(
|
|
118042
118002
|
() => props.config,
|
|
118043
118003
|
async () => {
|
|
118044
|
-
var _a2;
|
|
118045
118004
|
await nextTick();
|
|
118046
|
-
|
|
118005
|
+
formBuilder.value?.setState(props.config);
|
|
118047
118006
|
},
|
|
118048
118007
|
{ immediate: true }
|
|
118049
118008
|
);
|
|
@@ -121666,10 +121625,9 @@ const _sfc_main$26 = /* @__PURE__ */ defineComponent({
|
|
|
121666
121625
|
resetForm();
|
|
121667
121626
|
});
|
|
121668
121627
|
const initForm = () => {
|
|
121669
|
-
var _a2, _b;
|
|
121670
121628
|
loadIntegrations();
|
|
121671
|
-
loadServiceTypes(
|
|
121672
|
-
loadActionTypes(
|
|
121629
|
+
loadServiceTypes(integrationAction.value?.integration);
|
|
121630
|
+
loadActionTypes(integrationAction.value?.serviceType);
|
|
121673
121631
|
};
|
|
121674
121632
|
watch$1(() => builderState.value.show, async (val) => {
|
|
121675
121633
|
if (val) {
|
|
@@ -121690,9 +121648,8 @@ const _sfc_main$26 = /* @__PURE__ */ defineComponent({
|
|
|
121690
121648
|
}
|
|
121691
121649
|
});
|
|
121692
121650
|
watch$1(() => integrationAction.value.integration, (val) => {
|
|
121693
|
-
var _a2, _b;
|
|
121694
121651
|
loadServiceTypes(val);
|
|
121695
|
-
integrationAction.value.integrationType =
|
|
121652
|
+
integrationAction.value.integrationType = integrations.value?.find((i) => i.id === val)?.type;
|
|
121696
121653
|
});
|
|
121697
121654
|
watch$1(() => integrationAction.value.serviceType, (val) => {
|
|
121698
121655
|
loadActionTypes(val);
|
|
@@ -121705,14 +121662,12 @@ const _sfc_main$26 = /* @__PURE__ */ defineComponent({
|
|
|
121705
121662
|
integrations.value = await getProjectIntegrations(projectId.value);
|
|
121706
121663
|
};
|
|
121707
121664
|
const loadServiceTypes = (integrationId) => {
|
|
121708
|
-
var _a2, _b, _c, _d, _e2, _f, _g;
|
|
121709
121665
|
if (!integrationId) return serviceTypes.value = [];
|
|
121710
|
-
serviceTypes.value =
|
|
121666
|
+
serviceTypes.value = integrationSettingViews?.[integrations.value?.find((i) => i.id === integrationId)?.type]?.serviceTypes ? Object.entries(integrationSettingViews?.[integrations.value?.find((i) => i.id === integrationId)?.type]?.serviceTypes)?.map(([key, value]) => ({ text: value.name, value: key, actionTypes: value.actionTypes })) : [];
|
|
121711
121667
|
};
|
|
121712
121668
|
const loadActionTypes = (serviceTypeId) => {
|
|
121713
|
-
var _a2, _b, _c, _d, _e2;
|
|
121714
121669
|
if (!serviceTypeId) return actionTypes.value = [];
|
|
121715
|
-
actionTypes.value =
|
|
121670
|
+
actionTypes.value = serviceTypes.value?.find((st2) => st2.value === serviceTypeId)?.actionTypes ? Object.entries(serviceTypes.value?.find((st2) => st2.value === serviceTypeId)?.actionTypes)?.map(([key, value]) => ({ text: value.name, value: key, component: value.component })) : [];
|
|
121716
121671
|
};
|
|
121717
121672
|
const resetForm = async () => {
|
|
121718
121673
|
Object.assign(integrationAction.value, {
|
|
@@ -121765,152 +121720,149 @@ const _sfc_main$26 = /* @__PURE__ */ defineComponent({
|
|
|
121765
121720
|
side: "left",
|
|
121766
121721
|
class: "w-full sm:w-3/4 xl:w-1/2 sm:max-w-3xl"
|
|
121767
121722
|
}, {
|
|
121768
|
-
default: withCtx(() =>
|
|
121769
|
-
|
|
121770
|
-
|
|
121771
|
-
|
|
121772
|
-
|
|
121773
|
-
|
|
121774
|
-
|
|
121775
|
-
|
|
121723
|
+
default: withCtx(() => [
|
|
121724
|
+
createVNode(_component_SheetHeader, null, {
|
|
121725
|
+
default: withCtx(() => [
|
|
121726
|
+
createVNode(_component_SheetTitle, null, {
|
|
121727
|
+
default: withCtx(() => _cache2[5] || (_cache2[5] = [
|
|
121728
|
+
createTextVNode("New integration action")
|
|
121729
|
+
])),
|
|
121730
|
+
_: 1,
|
|
121731
|
+
__: [5]
|
|
121732
|
+
}),
|
|
121733
|
+
createVNode(_component_SheetDescription, null, {
|
|
121734
|
+
default: withCtx(() => _cache2[6] || (_cache2[6] = [
|
|
121735
|
+
createTextVNode(" Make external calls to your integrations or APIs. ")
|
|
121736
|
+
])),
|
|
121737
|
+
_: 1,
|
|
121738
|
+
__: [6]
|
|
121739
|
+
})
|
|
121740
|
+
]),
|
|
121741
|
+
_: 1
|
|
121742
|
+
}),
|
|
121743
|
+
createElementVNode("div", _hoisted_1$n, [
|
|
121744
|
+
createElementVNode("div", _hoisted_2$c, [
|
|
121745
|
+
createElementVNode("div", _hoisted_3$b, [
|
|
121746
|
+
_cache2[7] || (_cache2[7] = createElementVNode("p", { class: "text-sm font-semibold" }, "Integration", -1)),
|
|
121747
|
+
createVNode(_component_ResourceSelect, {
|
|
121748
|
+
modelValue: integrationAction.value.integration,
|
|
121749
|
+
"onUpdate:modelValue": _cache2[0] || (_cache2[0] = ($event) => integrationAction.value.integration = $event)
|
|
121750
|
+
}, null, 8, ["modelValue"])
|
|
121751
|
+
]),
|
|
121752
|
+
createElementVNode("div", _hoisted_4$6, [
|
|
121753
|
+
_cache2[8] || (_cache2[8] = createElementVNode("p", { class: "text-sm font-semibold" }, "Service type", -1)),
|
|
121754
|
+
createVNode(_component_Select, {
|
|
121755
|
+
modelValue: integrationAction.value.serviceType,
|
|
121756
|
+
"onUpdate:modelValue": _cache2[1] || (_cache2[1] = ($event) => integrationAction.value.serviceType = $event),
|
|
121757
|
+
disabled: !integrationAction.value.integration
|
|
121758
|
+
}, {
|
|
121759
|
+
default: withCtx(() => [
|
|
121760
|
+
createVNode(_component_SelectTrigger, { class: "w-[190px]" }, {
|
|
121761
|
+
default: withCtx(() => [
|
|
121762
|
+
createVNode(_component_SelectValue, { placeholder: "Select a service type" })
|
|
121763
|
+
]),
|
|
121764
|
+
_: 1
|
|
121765
|
+
}),
|
|
121766
|
+
createVNode(_component_SelectContent, null, {
|
|
121767
|
+
default: withCtx(() => [
|
|
121768
|
+
createVNode(_component_SelectGroup, null, {
|
|
121769
|
+
default: withCtx(() => [
|
|
121770
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(serviceTypes.value, (serviceType) => {
|
|
121771
|
+
return openBlock(), createBlock(_component_SelectItem, {
|
|
121772
|
+
key: serviceType.value,
|
|
121773
|
+
value: serviceType.value
|
|
121774
|
+
}, {
|
|
121775
|
+
default: withCtx(() => [
|
|
121776
|
+
createTextVNode(toDisplayString(serviceType.text), 1)
|
|
121777
|
+
]),
|
|
121778
|
+
_: 2
|
|
121779
|
+
}, 1032, ["value"]);
|
|
121780
|
+
}), 128))
|
|
121781
|
+
]),
|
|
121782
|
+
_: 1
|
|
121783
|
+
})
|
|
121784
|
+
]),
|
|
121785
|
+
_: 1
|
|
121786
|
+
})
|
|
121787
|
+
]),
|
|
121788
|
+
_: 1
|
|
121789
|
+
}, 8, ["modelValue", "disabled"])
|
|
121790
|
+
]),
|
|
121791
|
+
createElementVNode("div", _hoisted_5$6, [
|
|
121792
|
+
_cache2[9] || (_cache2[9] = createElementVNode("p", { class: "text-sm font-semibold" }, "Action type", -1)),
|
|
121793
|
+
createVNode(_component_Select, {
|
|
121794
|
+
modelValue: integrationAction.value.actionType,
|
|
121795
|
+
"onUpdate:modelValue": _cache2[2] || (_cache2[2] = ($event) => integrationAction.value.actionType = $event),
|
|
121796
|
+
disabled: !integrationAction.value.serviceType
|
|
121797
|
+
}, {
|
|
121798
|
+
default: withCtx(() => [
|
|
121799
|
+
createVNode(_component_SelectTrigger, { class: "w-[190px]" }, {
|
|
121800
|
+
default: withCtx(() => [
|
|
121801
|
+
createVNode(_component_SelectValue, { placeholder: "Select an action type" })
|
|
121802
|
+
]),
|
|
121803
|
+
_: 1
|
|
121804
|
+
}),
|
|
121805
|
+
createVNode(_component_SelectContent, null, {
|
|
121806
|
+
default: withCtx(() => [
|
|
121807
|
+
createVNode(_component_SelectGroup, null, {
|
|
121808
|
+
default: withCtx(() => [
|
|
121809
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(actionTypes.value, (actionType) => {
|
|
121810
|
+
return openBlock(), createBlock(_component_SelectItem, {
|
|
121811
|
+
key: actionType.value,
|
|
121812
|
+
value: actionType.value
|
|
121813
|
+
}, {
|
|
121814
|
+
default: withCtx(() => [
|
|
121815
|
+
createTextVNode(toDisplayString(actionType.text), 1)
|
|
121816
|
+
]),
|
|
121817
|
+
_: 2
|
|
121818
|
+
}, 1032, ["value"]);
|
|
121819
|
+
}), 128))
|
|
121820
|
+
]),
|
|
121821
|
+
_: 1
|
|
121822
|
+
})
|
|
121823
|
+
]),
|
|
121824
|
+
_: 1
|
|
121825
|
+
})
|
|
121826
|
+
]),
|
|
121827
|
+
_: 1
|
|
121828
|
+
}, 8, ["modelValue", "disabled"])
|
|
121829
|
+
])
|
|
121830
|
+
]),
|
|
121831
|
+
createVNode(_component_Separator, { class: "my-4" }),
|
|
121832
|
+
!integrationAction.value.actionType ? (openBlock(), createElementBlock("div", _hoisted_6$6, _cache2[10] || (_cache2[10] = [
|
|
121833
|
+
createElementVNode("p", null, "Choose an action type to get started.", -1)
|
|
121834
|
+
]))) : (openBlock(), createElementBlock("div", _hoisted_7$5, [
|
|
121835
|
+
(openBlock(), createBlock(resolveDynamicComponent(actionTypes.value.find((at2) => at2.value === integrationAction.value.actionType)?.component), {
|
|
121836
|
+
modelValue: integrationAction.value.actionTypeConfig,
|
|
121837
|
+
"onUpdate:modelValue": _cache2[3] || (_cache2[3] = ($event) => integrationAction.value.actionTypeConfig = $event)
|
|
121838
|
+
}, null, 8, ["modelValue"]))
|
|
121839
|
+
]))
|
|
121840
|
+
]),
|
|
121841
|
+
createVNode(_component_SheetFooter, null, {
|
|
121842
|
+
default: withCtx(() => [
|
|
121843
|
+
createElementVNode("div", _hoisted_8$3, [
|
|
121844
|
+
createVNode(_component_Button, {
|
|
121845
|
+
variant: "ghost",
|
|
121846
|
+
onClick: cancel
|
|
121847
|
+
}, {
|
|
121848
|
+
default: withCtx(() => _cache2[11] || (_cache2[11] = [
|
|
121849
|
+
createTextVNode("Cancel")
|
|
121776
121850
|
])),
|
|
121777
121851
|
_: 1,
|
|
121778
|
-
__: [
|
|
121852
|
+
__: [11]
|
|
121779
121853
|
}),
|
|
121780
|
-
createVNode(
|
|
121781
|
-
default: withCtx(() => _cache2[
|
|
121782
|
-
createTextVNode("
|
|
121854
|
+
createVNode(_component_Button, { onClick: createIntegrationAction }, {
|
|
121855
|
+
default: withCtx(() => _cache2[12] || (_cache2[12] = [
|
|
121856
|
+
createTextVNode("Create")
|
|
121783
121857
|
])),
|
|
121784
121858
|
_: 1,
|
|
121785
|
-
__: [
|
|
121859
|
+
__: [12]
|
|
121786
121860
|
})
|
|
121787
|
-
])
|
|
121788
|
-
_: 1
|
|
121789
|
-
}),
|
|
121790
|
-
createElementVNode("div", _hoisted_1$n, [
|
|
121791
|
-
createElementVNode("div", _hoisted_2$c, [
|
|
121792
|
-
createElementVNode("div", _hoisted_3$b, [
|
|
121793
|
-
_cache2[7] || (_cache2[7] = createElementVNode("p", { class: "text-sm font-semibold" }, "Integration", -1)),
|
|
121794
|
-
createVNode(_component_ResourceSelect, {
|
|
121795
|
-
modelValue: integrationAction.value.integration,
|
|
121796
|
-
"onUpdate:modelValue": _cache2[0] || (_cache2[0] = ($event) => integrationAction.value.integration = $event)
|
|
121797
|
-
}, null, 8, ["modelValue"])
|
|
121798
|
-
]),
|
|
121799
|
-
createElementVNode("div", _hoisted_4$6, [
|
|
121800
|
-
_cache2[8] || (_cache2[8] = createElementVNode("p", { class: "text-sm font-semibold" }, "Service type", -1)),
|
|
121801
|
-
createVNode(_component_Select, {
|
|
121802
|
-
modelValue: integrationAction.value.serviceType,
|
|
121803
|
-
"onUpdate:modelValue": _cache2[1] || (_cache2[1] = ($event) => integrationAction.value.serviceType = $event),
|
|
121804
|
-
disabled: !integrationAction.value.integration
|
|
121805
|
-
}, {
|
|
121806
|
-
default: withCtx(() => [
|
|
121807
|
-
createVNode(_component_SelectTrigger, { class: "w-[190px]" }, {
|
|
121808
|
-
default: withCtx(() => [
|
|
121809
|
-
createVNode(_component_SelectValue, { placeholder: "Select a service type" })
|
|
121810
|
-
]),
|
|
121811
|
-
_: 1
|
|
121812
|
-
}),
|
|
121813
|
-
createVNode(_component_SelectContent, null, {
|
|
121814
|
-
default: withCtx(() => [
|
|
121815
|
-
createVNode(_component_SelectGroup, null, {
|
|
121816
|
-
default: withCtx(() => [
|
|
121817
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(serviceTypes.value, (serviceType) => {
|
|
121818
|
-
return openBlock(), createBlock(_component_SelectItem, {
|
|
121819
|
-
key: serviceType.value,
|
|
121820
|
-
value: serviceType.value
|
|
121821
|
-
}, {
|
|
121822
|
-
default: withCtx(() => [
|
|
121823
|
-
createTextVNode(toDisplayString(serviceType.text), 1)
|
|
121824
|
-
]),
|
|
121825
|
-
_: 2
|
|
121826
|
-
}, 1032, ["value"]);
|
|
121827
|
-
}), 128))
|
|
121828
|
-
]),
|
|
121829
|
-
_: 1
|
|
121830
|
-
})
|
|
121831
|
-
]),
|
|
121832
|
-
_: 1
|
|
121833
|
-
})
|
|
121834
|
-
]),
|
|
121835
|
-
_: 1
|
|
121836
|
-
}, 8, ["modelValue", "disabled"])
|
|
121837
|
-
]),
|
|
121838
|
-
createElementVNode("div", _hoisted_5$6, [
|
|
121839
|
-
_cache2[9] || (_cache2[9] = createElementVNode("p", { class: "text-sm font-semibold" }, "Action type", -1)),
|
|
121840
|
-
createVNode(_component_Select, {
|
|
121841
|
-
modelValue: integrationAction.value.actionType,
|
|
121842
|
-
"onUpdate:modelValue": _cache2[2] || (_cache2[2] = ($event) => integrationAction.value.actionType = $event),
|
|
121843
|
-
disabled: !integrationAction.value.serviceType
|
|
121844
|
-
}, {
|
|
121845
|
-
default: withCtx(() => [
|
|
121846
|
-
createVNode(_component_SelectTrigger, { class: "w-[190px]" }, {
|
|
121847
|
-
default: withCtx(() => [
|
|
121848
|
-
createVNode(_component_SelectValue, { placeholder: "Select an action type" })
|
|
121849
|
-
]),
|
|
121850
|
-
_: 1
|
|
121851
|
-
}),
|
|
121852
|
-
createVNode(_component_SelectContent, null, {
|
|
121853
|
-
default: withCtx(() => [
|
|
121854
|
-
createVNode(_component_SelectGroup, null, {
|
|
121855
|
-
default: withCtx(() => [
|
|
121856
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(actionTypes.value, (actionType) => {
|
|
121857
|
-
return openBlock(), createBlock(_component_SelectItem, {
|
|
121858
|
-
key: actionType.value,
|
|
121859
|
-
value: actionType.value
|
|
121860
|
-
}, {
|
|
121861
|
-
default: withCtx(() => [
|
|
121862
|
-
createTextVNode(toDisplayString(actionType.text), 1)
|
|
121863
|
-
]),
|
|
121864
|
-
_: 2
|
|
121865
|
-
}, 1032, ["value"]);
|
|
121866
|
-
}), 128))
|
|
121867
|
-
]),
|
|
121868
|
-
_: 1
|
|
121869
|
-
})
|
|
121870
|
-
]),
|
|
121871
|
-
_: 1
|
|
121872
|
-
})
|
|
121873
|
-
]),
|
|
121874
|
-
_: 1
|
|
121875
|
-
}, 8, ["modelValue", "disabled"])
|
|
121876
|
-
])
|
|
121877
|
-
]),
|
|
121878
|
-
createVNode(_component_Separator, { class: "my-4" }),
|
|
121879
|
-
!integrationAction.value.actionType ? (openBlock(), createElementBlock("div", _hoisted_6$6, _cache2[10] || (_cache2[10] = [
|
|
121880
|
-
createElementVNode("p", null, "Choose an action type to get started.", -1)
|
|
121881
|
-
]))) : (openBlock(), createElementBlock("div", _hoisted_7$5, [
|
|
121882
|
-
(openBlock(), createBlock(resolveDynamicComponent((_a2 = actionTypes.value.find((at2) => at2.value === integrationAction.value.actionType)) == null ? void 0 : _a2.component), {
|
|
121883
|
-
modelValue: integrationAction.value.actionTypeConfig,
|
|
121884
|
-
"onUpdate:modelValue": _cache2[3] || (_cache2[3] = ($event) => integrationAction.value.actionTypeConfig = $event)
|
|
121885
|
-
}, null, 8, ["modelValue"]))
|
|
121886
|
-
]))
|
|
121861
|
+
])
|
|
121887
121862
|
]),
|
|
121888
|
-
|
|
121889
|
-
|
|
121890
|
-
|
|
121891
|
-
createVNode(_component_Button, {
|
|
121892
|
-
variant: "ghost",
|
|
121893
|
-
onClick: cancel
|
|
121894
|
-
}, {
|
|
121895
|
-
default: withCtx(() => _cache2[11] || (_cache2[11] = [
|
|
121896
|
-
createTextVNode("Cancel")
|
|
121897
|
-
])),
|
|
121898
|
-
_: 1,
|
|
121899
|
-
__: [11]
|
|
121900
|
-
}),
|
|
121901
|
-
createVNode(_component_Button, { onClick: createIntegrationAction }, {
|
|
121902
|
-
default: withCtx(() => _cache2[12] || (_cache2[12] = [
|
|
121903
|
-
createTextVNode("Create")
|
|
121904
|
-
])),
|
|
121905
|
-
_: 1,
|
|
121906
|
-
__: [12]
|
|
121907
|
-
})
|
|
121908
|
-
])
|
|
121909
|
-
]),
|
|
121910
|
-
_: 1
|
|
121911
|
-
})
|
|
121912
|
-
];
|
|
121913
|
-
}),
|
|
121863
|
+
_: 1
|
|
121864
|
+
})
|
|
121865
|
+
]),
|
|
121914
121866
|
_: 1
|
|
121915
121867
|
})
|
|
121916
121868
|
]),
|
|
@@ -122115,7 +122067,7 @@ const _sfc_main$22 = /* @__PURE__ */ defineComponent({
|
|
|
122115
122067
|
const reload = inject$1("reload", () => {
|
|
122116
122068
|
});
|
|
122117
122069
|
async function onDrop(files) {
|
|
122118
|
-
for (let i = 0; i <
|
|
122070
|
+
for (let i = 0; i < files?.length; i++) {
|
|
122119
122071
|
let randomID = crypto.randomUUID();
|
|
122120
122072
|
addToUploadQueue(randomID, files[i]);
|
|
122121
122073
|
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
@@ -122594,7 +122546,7 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
|
|
|
122594
122546
|
if (!softReload) {
|
|
122595
122547
|
loading.value = true;
|
|
122596
122548
|
}
|
|
122597
|
-
if (
|
|
122549
|
+
if (path?.[0] === "/") {
|
|
122598
122550
|
path = path.substring(1);
|
|
122599
122551
|
}
|
|
122600
122552
|
try {
|
|
@@ -122671,15 +122623,13 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
|
|
|
122671
122623
|
search.value = "";
|
|
122672
122624
|
};
|
|
122673
122625
|
const setEffectiveBasePath = () => {
|
|
122674
|
-
|
|
122675
|
-
effectiveBasePath.value = ((_b = (_a2 = props.sources) == null ? void 0 : _a2[0]) == null ? void 0 : _b.path) || "";
|
|
122626
|
+
effectiveBasePath.value = props.sources?.[0]?.path || "";
|
|
122676
122627
|
if (effectiveBasePath.value[0] === "/") {
|
|
122677
122628
|
effectiveBasePath.value = effectiveBasePath.value.substring(1);
|
|
122678
122629
|
}
|
|
122679
122630
|
};
|
|
122680
122631
|
onMounted$1(() => {
|
|
122681
|
-
|
|
122682
|
-
activeSourceId.value = ((_a2 = props.sources) == null ? void 0 : _a2[0]) || "";
|
|
122632
|
+
activeSourceId.value = props.sources?.[0] || "";
|
|
122683
122633
|
setEffectiveBasePath();
|
|
122684
122634
|
});
|
|
122685
122635
|
return (_ctx, _cache2) => {
|
|
@@ -122706,40 +122656,37 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
|
|
|
122706
122656
|
createVNode(_component_DialogScrollContent, { class: "w-[90%] md:w-[90%] sm:max-w-[1500px]" }, {
|
|
122707
122657
|
default: withCtx(() => [
|
|
122708
122658
|
createVNode(_component_DialogHeader, { class: "sticky -top-6 pt-10 pb-2 -mt-6 z-10 bg-background" }, {
|
|
122709
|
-
default: withCtx(() =>
|
|
122710
|
-
|
|
122711
|
-
|
|
122712
|
-
|
|
122713
|
-
|
|
122714
|
-
|
|
122715
|
-
|
|
122716
|
-
|
|
122717
|
-
onClick: navigateBack
|
|
122718
|
-
}, {
|
|
122719
|
-
default: withCtx(() => [
|
|
122720
|
-
createVNode(unref(ChevronLeft), { class: "size-4" })
|
|
122721
|
-
]),
|
|
122722
|
-
_: 1
|
|
122723
|
-
})) : createCommentVNode("", true),
|
|
122724
|
-
createVNode(_component_DialogTitle, { class: "flex items-center gap-2" }, {
|
|
122725
|
-
default: withCtx(() => [
|
|
122726
|
-
createVNode(_component_MediaSourceSelect, {
|
|
122727
|
-
sources: __props.sources,
|
|
122728
|
-
modelValue: activeSourceId.value,
|
|
122729
|
-
"onUpdate:modelValue": _cache2[0] || (_cache2[0] = ($event) => activeSourceId.value = $event)
|
|
122730
|
-
}, null, 8, ["sources", "modelValue"])
|
|
122731
|
-
]),
|
|
122732
|
-
_: 1
|
|
122733
|
-
})
|
|
122734
|
-
]),
|
|
122735
|
-
createVNode(_component_DialogDescription, null, {
|
|
122659
|
+
default: withCtx(() => [
|
|
122660
|
+
createElementVNode("div", _hoisted_1$h, [
|
|
122661
|
+
navigationHistory.value?.length > 0 ? (openBlock(), createBlock(_component_Button, {
|
|
122662
|
+
key: 0,
|
|
122663
|
+
variant: "outline",
|
|
122664
|
+
size: "icon",
|
|
122665
|
+
onClick: navigateBack
|
|
122666
|
+
}, {
|
|
122736
122667
|
default: withCtx(() => [
|
|
122737
|
-
|
|
122668
|
+
createVNode(unref(ChevronLeft), { class: "size-4" })
|
|
122669
|
+
]),
|
|
122670
|
+
_: 1
|
|
122671
|
+
})) : createCommentVNode("", true),
|
|
122672
|
+
createVNode(_component_DialogTitle, { class: "flex items-center gap-2" }, {
|
|
122673
|
+
default: withCtx(() => [
|
|
122674
|
+
createVNode(_component_MediaSourceSelect, {
|
|
122675
|
+
sources: __props.sources,
|
|
122676
|
+
modelValue: activeSourceId.value,
|
|
122677
|
+
"onUpdate:modelValue": _cache2[0] || (_cache2[0] = ($event) => activeSourceId.value = $event)
|
|
122678
|
+
}, null, 8, ["sources", "modelValue"])
|
|
122738
122679
|
]),
|
|
122739
122680
|
_: 1
|
|
122740
122681
|
})
|
|
122741
|
-
]
|
|
122742
|
-
|
|
122682
|
+
]),
|
|
122683
|
+
createVNode(_component_DialogDescription, null, {
|
|
122684
|
+
default: withCtx(() => [
|
|
122685
|
+
createTextVNode(toDisplayString(currentPath.value !== effectiveBasePath.value.value ? currentPath.value === "" ? "Root" : "/" + currentPath.value : ""), 1)
|
|
122686
|
+
]),
|
|
122687
|
+
_: 1
|
|
122688
|
+
})
|
|
122689
|
+
]),
|
|
122743
122690
|
_: 1
|
|
122744
122691
|
}),
|
|
122745
122692
|
createElementVNode("div", null, [
|
|
@@ -122794,23 +122741,17 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
|
|
|
122794
122741
|
]))
|
|
122795
122742
|
]),
|
|
122796
122743
|
createVNode(_component_DialogFooter, { class: "sticky -bottom-6 pb-10 pt-2 -mb-6 z-10 bg-background" }, {
|
|
122797
|
-
default: withCtx(() =>
|
|
122798
|
-
|
|
122799
|
-
|
|
122800
|
-
|
|
122801
|
-
|
|
122802
|
-
|
|
122803
|
-
|
|
122804
|
-
|
|
122805
|
-
|
|
122806
|
-
|
|
122807
|
-
|
|
122808
|
-
];
|
|
122809
|
-
}),
|
|
122810
|
-
_: 1
|
|
122811
|
-
}, 8, ["disabled"])
|
|
122812
|
-
];
|
|
122813
|
-
}),
|
|
122744
|
+
default: withCtx(() => [
|
|
122745
|
+
createVNode(_component_Button, {
|
|
122746
|
+
onClick: onSubmit,
|
|
122747
|
+
disabled: selectedFiles.value?.length === 0
|
|
122748
|
+
}, {
|
|
122749
|
+
default: withCtx(() => [
|
|
122750
|
+
createTextVNode(toDisplayString(selectedFiles.value?.length > 0 ? `Add ${selectedFiles.value?.length} ${selectedFiles.value?.length === 1 ? "file" : "files"}` : "0 files selected"), 1)
|
|
122751
|
+
]),
|
|
122752
|
+
_: 1
|
|
122753
|
+
}, 8, ["disabled"])
|
|
122754
|
+
]),
|
|
122814
122755
|
_: 1
|
|
122815
122756
|
})
|
|
122816
122757
|
]),
|
|
@@ -129218,17 +129159,14 @@ const _sfc_main$1_ = /* @__PURE__ */ defineComponent({
|
|
|
129218
129159
|
sources: unref(sources),
|
|
129219
129160
|
onSubmit: addMedia
|
|
129220
129161
|
}, {
|
|
129221
|
-
default: withCtx(() =>
|
|
129222
|
-
|
|
129223
|
-
|
|
129224
|
-
|
|
129225
|
-
|
|
129226
|
-
|
|
129227
|
-
|
|
129228
|
-
|
|
129229
|
-
], 2)
|
|
129230
|
-
];
|
|
129231
|
-
}),
|
|
129162
|
+
default: withCtx(() => [
|
|
129163
|
+
createElementVNode("button", {
|
|
129164
|
+
class: normalizeClass(["relative flex justify-center items-center w-full group aspect-square rounded-md cursor-pointer focus-visible:outline-ring focus-visible:outline-[1px] focus-visible:ring-ring/50 focus-visible:ring-[3px] hover:bg-black/10 transition-colors duration-200", { "col-start-1 col-span-2 row-start-1 row-span-2": unref(items)?.length === 0 }]),
|
|
129165
|
+
type: "button"
|
|
129166
|
+
}, [
|
|
129167
|
+
createVNode(unref(Plus), { class: "size-8" })
|
|
129168
|
+
], 2)
|
|
129169
|
+
]),
|
|
129232
129170
|
_: 1
|
|
129233
129171
|
}, 8, ["sources"])
|
|
129234
129172
|
], 512)
|
|
@@ -130249,19 +130187,18 @@ const _sfc_main$1v = /* @__PURE__ */ defineComponent({
|
|
|
130249
130187
|
}
|
|
130250
130188
|
};
|
|
130251
130189
|
watch$1(dialogIsOpen, (val) => {
|
|
130252
|
-
var _a2;
|
|
130253
130190
|
if (val) {
|
|
130254
130191
|
let modelValue = JSON.parse(JSON.stringify(props.modelValue));
|
|
130255
|
-
selectedIntegrationId.value =
|
|
130256
|
-
resource.value =
|
|
130257
|
-
filters.value =
|
|
130258
|
-
sorts.value =
|
|
130259
|
-
limit.value =
|
|
130260
|
-
offset.value =
|
|
130261
|
-
startAt.value =
|
|
130262
|
-
endAt.value =
|
|
130263
|
-
groupBy.value =
|
|
130264
|
-
distinct.value =
|
|
130192
|
+
selectedIntegrationId.value = modelValue?.integration?.id || null;
|
|
130193
|
+
resource.value = modelValue?.resource || "";
|
|
130194
|
+
filters.value = modelValue?.filters || [];
|
|
130195
|
+
sorts.value = modelValue?.sorts || [];
|
|
130196
|
+
limit.value = modelValue?.limit || null;
|
|
130197
|
+
offset.value = modelValue?.offset || null;
|
|
130198
|
+
startAt.value = modelValue?.startAt || null;
|
|
130199
|
+
endAt.value = modelValue?.endAt || null;
|
|
130200
|
+
groupBy.value = modelValue?.groupBy || "";
|
|
130201
|
+
distinct.value = modelValue?.distinct || false;
|
|
130265
130202
|
}
|
|
130266
130203
|
});
|
|
130267
130204
|
const emit = __emit;
|
|
@@ -130350,7 +130287,6 @@ const _sfc_main$1v = /* @__PURE__ */ defineComponent({
|
|
|
130350
130287
|
}
|
|
130351
130288
|
}
|
|
130352
130289
|
async function runQuery() {
|
|
130353
|
-
var _a2, _b, _c, _d;
|
|
130354
130290
|
resetOutput();
|
|
130355
130291
|
if (integration.value.type === "FIREBASE") {
|
|
130356
130292
|
try {
|
|
@@ -130364,8 +130300,8 @@ const _sfc_main$1v = /* @__PURE__ */ defineComponent({
|
|
|
130364
130300
|
});
|
|
130365
130301
|
queryResult.value = `Found ${res.length} results`;
|
|
130366
130302
|
} catch (error) {
|
|
130367
|
-
errorMessage.value =
|
|
130368
|
-
indexUrl.value =
|
|
130303
|
+
errorMessage.value = error.response.data?.message || "Failed to run query";
|
|
130304
|
+
indexUrl.value = error.response.data?.data?.indexUrl || null;
|
|
130369
130305
|
}
|
|
130370
130306
|
} else {
|
|
130371
130307
|
try {
|
|
@@ -130379,7 +130315,7 @@ const _sfc_main$1v = /* @__PURE__ */ defineComponent({
|
|
|
130379
130315
|
distinct: distinct.value
|
|
130380
130316
|
});
|
|
130381
130317
|
} catch (error) {
|
|
130382
|
-
errorMessage.value =
|
|
130318
|
+
errorMessage.value = error.response.data?.message || "Failed to run query";
|
|
130383
130319
|
}
|
|
130384
130320
|
}
|
|
130385
130321
|
}
|
|
@@ -130686,99 +130622,96 @@ const _sfc_main$1v = /* @__PURE__ */ defineComponent({
|
|
|
130686
130622
|
})
|
|
130687
130623
|
]),
|
|
130688
130624
|
createVNode(_component_CollapsibleContent, null, {
|
|
130689
|
-
default: withCtx(() =>
|
|
130690
|
-
|
|
130691
|
-
|
|
130692
|
-
|
|
130693
|
-
|
|
130694
|
-
|
|
130695
|
-
|
|
130696
|
-
|
|
130697
|
-
|
|
130698
|
-
|
|
130699
|
-
|
|
130700
|
-
|
|
130701
|
-
|
|
130702
|
-
|
|
130703
|
-
|
|
130704
|
-
|
|
130705
|
-
|
|
130706
|
-
|
|
130707
|
-
|
|
130708
|
-
|
|
130709
|
-
|
|
130710
|
-
|
|
130711
|
-
|
|
130712
|
-
|
|
130713
|
-
|
|
130714
|
-
|
|
130715
|
-
|
|
130716
|
-
|
|
130717
|
-
|
|
130718
|
-
|
|
130719
|
-
|
|
130720
|
-
|
|
130721
|
-
|
|
130722
|
-
|
|
130723
|
-
|
|
130724
|
-
|
|
130725
|
-
|
|
130726
|
-
|
|
130727
|
-
|
|
130728
|
-
|
|
130729
|
-
|
|
130730
|
-
|
|
130731
|
-
|
|
130732
|
-
|
|
130733
|
-
|
|
130734
|
-
|
|
130735
|
-
|
|
130736
|
-
|
|
130737
|
-
|
|
130738
|
-
|
|
130739
|
-
|
|
130740
|
-
|
|
130741
|
-
|
|
130742
|
-
|
|
130743
|
-
|
|
130744
|
-
|
|
130745
|
-
|
|
130746
|
-
|
|
130747
|
-
|
|
130748
|
-
|
|
130749
|
-
|
|
130750
|
-
|
|
130751
|
-
|
|
130752
|
-
|
|
130753
|
-
|
|
130754
|
-
|
|
130755
|
-
|
|
130756
|
-
|
|
130757
|
-
|
|
130758
|
-
|
|
130759
|
-
|
|
130760
|
-
|
|
130761
|
-
|
|
130762
|
-
|
|
130763
|
-
|
|
130764
|
-
|
|
130765
|
-
|
|
130766
|
-
|
|
130767
|
-
|
|
130768
|
-
|
|
130769
|
-
|
|
130770
|
-
|
|
130771
|
-
|
|
130772
|
-
|
|
130773
|
-
|
|
130774
|
-
|
|
130775
|
-
|
|
130776
|
-
__: [27]
|
|
130777
|
-
})
|
|
130778
|
-
])
|
|
130625
|
+
default: withCtx(() => [
|
|
130626
|
+
createElementVNode("div", _hoisted_8, [
|
|
130627
|
+
createElementVNode("div", null, [
|
|
130628
|
+
createVNode(_component_Label, { for: "limit" }, {
|
|
130629
|
+
default: withCtx(() => _cache2[22] || (_cache2[22] = [
|
|
130630
|
+
createTextVNode("Limit")
|
|
130631
|
+
])),
|
|
130632
|
+
_: 1,
|
|
130633
|
+
__: [22]
|
|
130634
|
+
}),
|
|
130635
|
+
createVNode(_component_Input, {
|
|
130636
|
+
type: "number",
|
|
130637
|
+
modelValue: limit.value,
|
|
130638
|
+
"onUpdate:modelValue": _cache2[2] || (_cache2[2] = ($event) => limit.value = $event),
|
|
130639
|
+
placeholder: "Limit"
|
|
130640
|
+
}, null, 8, ["modelValue"])
|
|
130641
|
+
]),
|
|
130642
|
+
createElementVNode("div", null, [
|
|
130643
|
+
createVNode(_component_Label, { for: "offset" }, {
|
|
130644
|
+
default: withCtx(() => _cache2[23] || (_cache2[23] = [
|
|
130645
|
+
createTextVNode("Offset")
|
|
130646
|
+
])),
|
|
130647
|
+
_: 1,
|
|
130648
|
+
__: [23]
|
|
130649
|
+
}),
|
|
130650
|
+
createVNode(_component_Input, {
|
|
130651
|
+
type: "number",
|
|
130652
|
+
modelValue: offset.value,
|
|
130653
|
+
"onUpdate:modelValue": _cache2[3] || (_cache2[3] = ($event) => offset.value = $event),
|
|
130654
|
+
placeholder: "Offset"
|
|
130655
|
+
}, null, 8, ["modelValue"])
|
|
130656
|
+
]),
|
|
130657
|
+
createElementVNode("div", null, [
|
|
130658
|
+
createVNode(_component_Label, { for: "startAt" }, {
|
|
130659
|
+
default: withCtx(() => _cache2[24] || (_cache2[24] = [
|
|
130660
|
+
createTextVNode("StartAt")
|
|
130661
|
+
])),
|
|
130662
|
+
_: 1,
|
|
130663
|
+
__: [24]
|
|
130664
|
+
}),
|
|
130665
|
+
createVNode(_component_Input, {
|
|
130666
|
+
modelValue: startAt.value,
|
|
130667
|
+
"onUpdate:modelValue": _cache2[4] || (_cache2[4] = ($event) => startAt.value = $event),
|
|
130668
|
+
placeholder: "StartAt (optional)"
|
|
130669
|
+
}, null, 8, ["modelValue"])
|
|
130670
|
+
]),
|
|
130671
|
+
createElementVNode("div", null, [
|
|
130672
|
+
createVNode(_component_Label, { for: "endAt" }, {
|
|
130673
|
+
default: withCtx(() => _cache2[25] || (_cache2[25] = [
|
|
130674
|
+
createTextVNode("EndAt")
|
|
130675
|
+
])),
|
|
130676
|
+
_: 1,
|
|
130677
|
+
__: [25]
|
|
130678
|
+
}),
|
|
130679
|
+
createVNode(_component_Input, {
|
|
130680
|
+
modelValue: endAt.value,
|
|
130681
|
+
"onUpdate:modelValue": _cache2[5] || (_cache2[5] = ($event) => endAt.value = $event),
|
|
130682
|
+
placeholder: "EndAt (optional)"
|
|
130683
|
+
}, null, 8, ["modelValue"])
|
|
130684
|
+
]),
|
|
130685
|
+
integration.value?.type !== "FIREBASE" ? (openBlock(), createElementBlock("div", _hoisted_9, [
|
|
130686
|
+
createVNode(_component_Label, { for: "groupBy" }, {
|
|
130687
|
+
default: withCtx(() => _cache2[26] || (_cache2[26] = [
|
|
130688
|
+
createTextVNode("Group By")
|
|
130689
|
+
])),
|
|
130690
|
+
_: 1,
|
|
130691
|
+
__: [26]
|
|
130692
|
+
}),
|
|
130693
|
+
createVNode(_component_Input, {
|
|
130694
|
+
modelValue: groupBy.value,
|
|
130695
|
+
"onUpdate:modelValue": _cache2[6] || (_cache2[6] = ($event) => groupBy.value = $event),
|
|
130696
|
+
placeholder: "Group By"
|
|
130697
|
+
}, null, 8, ["modelValue"])
|
|
130698
|
+
])) : createCommentVNode("", true),
|
|
130699
|
+
createElementVNode("div", _hoisted_10, [
|
|
130700
|
+
createVNode(_component_Checkbox, {
|
|
130701
|
+
modelValue: distinct.value,
|
|
130702
|
+
"onUpdate:modelValue": _cache2[7] || (_cache2[7] = ($event) => distinct.value = $event),
|
|
130703
|
+
id: "distinct"
|
|
130704
|
+
}, null, 8, ["modelValue"]),
|
|
130705
|
+
createVNode(_component_Label, { for: "distinct" }, {
|
|
130706
|
+
default: withCtx(() => _cache2[27] || (_cache2[27] = [
|
|
130707
|
+
createTextVNode("DISTINCT")
|
|
130708
|
+
])),
|
|
130709
|
+
_: 1,
|
|
130710
|
+
__: [27]
|
|
130711
|
+
})
|
|
130779
130712
|
])
|
|
130780
|
-
]
|
|
130781
|
-
|
|
130713
|
+
])
|
|
130714
|
+
]),
|
|
130782
130715
|
_: 1
|
|
130783
130716
|
})
|
|
130784
130717
|
]),
|
|
@@ -131504,17 +131437,14 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
|
|
|
131504
131437
|
}, {
|
|
131505
131438
|
default: withCtx(() => [
|
|
131506
131439
|
createVNode(_component_SelectTrigger, null, {
|
|
131507
|
-
default: withCtx(() =>
|
|
131508
|
-
|
|
131509
|
-
|
|
131510
|
-
unref(
|
|
131511
|
-
|
|
131512
|
-
|
|
131513
|
-
|
|
131514
|
-
|
|
131515
|
-
createVNode(_component_SelectValue, { placeholder: "Select a resource" })
|
|
131516
|
-
];
|
|
131517
|
-
}),
|
|
131440
|
+
default: withCtx(() => [
|
|
131441
|
+
unref(modelValue) ? (openBlock(), createBlock(_component_IntegrationIcon, {
|
|
131442
|
+
key: 0,
|
|
131443
|
+
type: unref(integrations)?.find((i) => i.id === unref(modelValue))?.type,
|
|
131444
|
+
class: "size-6"
|
|
131445
|
+
}, null, 8, ["type"])) : createCommentVNode("", true),
|
|
131446
|
+
createVNode(_component_SelectValue, { placeholder: "Select a resource" })
|
|
131447
|
+
]),
|
|
131518
131448
|
_: 1
|
|
131519
131449
|
}),
|
|
131520
131450
|
createVNode(_component_SelectContent, null, {
|
|
@@ -131862,7 +131792,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
|
131862
131792
|
const registerButton = inject$1("segmentedControlRegister", () => {
|
|
131863
131793
|
});
|
|
131864
131794
|
const buttonRef = ref(null);
|
|
131865
|
-
const isActive = computed$1(() =>
|
|
131795
|
+
const isActive = computed$1(() => currentValue?.value === props.value);
|
|
131866
131796
|
const handleClick = () => {
|
|
131867
131797
|
if (!props.disabled) {
|
|
131868
131798
|
updateValue(props.value);
|
|
@@ -142410,16 +142340,18 @@ export {
|
|
|
142410
142340
|
components,
|
|
142411
142341
|
useBreadcrumbs,
|
|
142412
142342
|
useCms,
|
|
142413
|
-
useConfirmation
|
|
142343
|
+
useConfirmation,
|
|
142344
|
+
useCustomDialog$1 as useCustomDialog,
|
|
142414
142345
|
useFirebaseIntegration,
|
|
142415
142346
|
useFlowBuilder,
|
|
142416
142347
|
useFormBuilder,
|
|
142417
142348
|
useIntegrationActionBuilder,
|
|
142418
|
-
useIntegrationActions
|
|
142349
|
+
useIntegrationActions,
|
|
142419
142350
|
useIntegrations,
|
|
142420
142351
|
useLayout,
|
|
142421
142352
|
useLogs,
|
|
142422
142353
|
useMediaLibrary,
|
|
142354
|
+
useModuleOverlay,
|
|
142423
142355
|
useModulePermissions,
|
|
142424
142356
|
useModuleRoute,
|
|
142425
142357
|
useModuleStorage,
|