@oneclick.dev/cms-kit 0.0.40 → 0.0.42
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 +4 -4
- package/dist/cms-kit.js +410 -482
- package/dist/index.css +1 -1
- package/package.json +1 -1
package/dist/cms-kit.js
CHANGED
|
@@ -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
|
});
|
|
@@ -67767,10 +67765,10 @@ const Ve$1 = /* @__PURE__ */ defineComponent({
|
|
|
67767
67765
|
});
|
|
67768
67766
|
function interpolateTemplateFromVariableContext(template, variableContext) {
|
|
67769
67767
|
if (!template) return "";
|
|
67770
|
-
const context3 =
|
|
67768
|
+
const context3 = variableContext?.reduce((acc, variable) => {
|
|
67771
67769
|
acc[variable.name] = variable.value;
|
|
67772
67770
|
return acc;
|
|
67773
|
-
}, {})
|
|
67771
|
+
}, {}) ?? {};
|
|
67774
67772
|
return interpolateTemplate(template, sanitizeContext(context3));
|
|
67775
67773
|
}
|
|
67776
67774
|
function isValidIdentifier(name2) {
|
|
@@ -67821,27 +67819,26 @@ function extractIdentifiers(expr) {
|
|
|
67821
67819
|
}
|
|
67822
67820
|
const taskHandlers = {
|
|
67823
67821
|
"api-request": async (input, { node }) => {
|
|
67824
|
-
var _a2, _b, _c, _d;
|
|
67825
67822
|
try {
|
|
67826
67823
|
let variables = Object.keys(input).map((key) => ({ name: key, value: input[key] }));
|
|
67827
67824
|
let url = interpolateTemplateFromVariableContext(node.data.url, variables);
|
|
67828
67825
|
let method = interpolateTemplateFromVariableContext(node.data.method, variables).toUpperCase();
|
|
67829
|
-
let bodyPairs =
|
|
67826
|
+
let bodyPairs = node.data.body?.map((pair2) => ({
|
|
67830
67827
|
key: interpolateTemplateFromVariableContext(pair2.key, variables),
|
|
67831
67828
|
value: interpolateTemplateFromVariableContext(pair2.value, variables)
|
|
67832
|
-
}))
|
|
67833
|
-
let headersPairs =
|
|
67829
|
+
})) || [];
|
|
67830
|
+
let headersPairs = node.data.headers?.map((pair2) => ({
|
|
67834
67831
|
key: interpolateTemplateFromVariableContext(pair2.key, variables),
|
|
67835
67832
|
value: interpolateTemplateFromVariableContext(pair2.value, variables)
|
|
67836
|
-
}))
|
|
67837
|
-
let cookiesPairs =
|
|
67833
|
+
})) || [];
|
|
67834
|
+
let cookiesPairs = node.data.cookies?.map((pair2) => ({
|
|
67838
67835
|
key: interpolateTemplateFromVariableContext(pair2.key, variables),
|
|
67839
67836
|
value: interpolateTemplateFromVariableContext(pair2.value, variables)
|
|
67840
|
-
}))
|
|
67841
|
-
let urlParamPairs =
|
|
67837
|
+
})) || [];
|
|
67838
|
+
let urlParamPairs = node.data.urlParameters?.map((pair2) => ({
|
|
67842
67839
|
key: interpolateTemplateFromVariableContext(pair2.key, variables),
|
|
67843
67840
|
value: interpolateTemplateFromVariableContext(pair2.value, variables)
|
|
67844
|
-
}))
|
|
67841
|
+
})) || [];
|
|
67845
67842
|
const queryString = urlParamPairs.filter((p2) => p2.key).map((p2) => `${encodeURIComponent(p2.key)}=${encodeURIComponent(p2.value)}`).join("&");
|
|
67846
67843
|
const fullUrl = queryString ? `${url}?${queryString}` : url;
|
|
67847
67844
|
const headers = {};
|
|
@@ -67873,7 +67870,7 @@ const taskHandlers = {
|
|
|
67873
67870
|
}
|
|
67874
67871
|
let result;
|
|
67875
67872
|
const contentType = res.headers.get("content-type");
|
|
67876
|
-
if (contentType
|
|
67873
|
+
if (contentType?.includes("application/json")) {
|
|
67877
67874
|
result = await res.json();
|
|
67878
67875
|
} else {
|
|
67879
67876
|
result = await res.text();
|
|
@@ -67955,12 +67952,11 @@ const taskHandlers = {
|
|
|
67955
67952
|
return result;
|
|
67956
67953
|
},
|
|
67957
67954
|
"show-module": async (input, { node }) => {
|
|
67958
|
-
var _a2;
|
|
67959
67955
|
console.log("Show module", input, node);
|
|
67960
67956
|
const { openInOverlay } = useModuleOverlay();
|
|
67961
67957
|
let variables = Object.keys(input).map((key) => ({ name: key, value: input[key] }));
|
|
67962
67958
|
const params = {};
|
|
67963
|
-
|
|
67959
|
+
node.data.moduleData?.forEach((d) => {
|
|
67964
67960
|
params[interpolateTemplateFromVariableContext(d.key, variables)] = interpolateTemplateFromVariableContext(d.value, variables);
|
|
67965
67961
|
});
|
|
67966
67962
|
openInOverlay(node.data.moduleId, params);
|
|
@@ -68000,16 +67996,12 @@ function useRunProcess({
|
|
|
68000
67996
|
const upcomingTasks = /* @__PURE__ */ new Set();
|
|
68001
67997
|
const localVariables = ref(variables ? JSON.parse(JSON.stringify(variables.map((v) => ({ ...v, value: Object.keys(v).includes("defaultValue") ? v.defaultValue : v.value ?? null })))) : []);
|
|
68002
67998
|
async function runNode(nodeId, isStart = false) {
|
|
68003
|
-
var _a2, _b, _c, _d;
|
|
68004
67999
|
if (executedNodes.has(nodeId)) {
|
|
68005
68000
|
return;
|
|
68006
68001
|
}
|
|
68007
68002
|
upcomingTasks.add(nodeId);
|
|
68008
68003
|
const incomers = getConnectedEdges2(nodeId).filter((connection) => connection.target === nodeId);
|
|
68009
|
-
await Promise.all(incomers.map((incomer) => until(() =>
|
|
68010
|
-
var _a3;
|
|
68011
|
-
return !((_a3 = incomer.data) == null ? void 0 : _a3.isAnimating);
|
|
68012
|
-
})));
|
|
68004
|
+
await Promise.all(incomers.map((incomer) => until(() => !incomer.data?.isAnimating)));
|
|
68013
68005
|
upcomingTasks.clear();
|
|
68014
68006
|
if (!isRunning.value) {
|
|
68015
68007
|
return;
|
|
@@ -68023,7 +68015,7 @@ function useRunProcess({
|
|
|
68023
68015
|
...inputFromPredecessors,
|
|
68024
68016
|
...Object.fromEntries(localVariables.value.map((v) => [v.name, v.value]))
|
|
68025
68017
|
};
|
|
68026
|
-
const node =
|
|
68018
|
+
const node = nodeMap?.size > 0 ? nodeMap.get(nodeId) : findNode(nodeId);
|
|
68027
68019
|
const taskFn = taskHandlers[node.data.taskType ?? node.type];
|
|
68028
68020
|
console.log("Running task:", node.data.taskType, taskFn);
|
|
68029
68021
|
const result = taskFn ? await taskFn(input, { node, graph: graph2.value, onFinish, localVariables }) : {};
|
|
@@ -68034,7 +68026,7 @@ function useRunProcess({
|
|
|
68034
68026
|
for (const edge of outgoingEdges) {
|
|
68035
68027
|
const { source, sourceHandle } = edge;
|
|
68036
68028
|
const nodeType = nodeMap.get(source).type;
|
|
68037
|
-
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";
|
|
68038
68030
|
console.log("should run", shouldRun, nodeType, sourceHandle, result, hasBranching);
|
|
68039
68031
|
if (shouldRun) {
|
|
68040
68032
|
await runNode(edge.target);
|
|
@@ -68054,10 +68046,7 @@ function useRunProcess({
|
|
|
68054
68046
|
}
|
|
68055
68047
|
reset(nodes2);
|
|
68056
68048
|
isRunning.value = true;
|
|
68057
|
-
const startingNodes = nodes2.filter((node) =>
|
|
68058
|
-
var _a2;
|
|
68059
|
-
return ((_a2 = graph2.value.predecessors(node.id)) == null ? void 0 : _a2.length) === 0;
|
|
68060
|
-
});
|
|
68049
|
+
const startingNodes = nodes2.filter((node) => graph2.value.predecessors(node.id)?.length === 0);
|
|
68061
68050
|
await Promise.all(startingNodes.map((node) => runNode(node.id, true)));
|
|
68062
68051
|
clear();
|
|
68063
68052
|
}
|
|
@@ -68947,9 +68936,8 @@ const outputRegistry = {
|
|
|
68947
68936
|
default: {}
|
|
68948
68937
|
};
|
|
68949
68938
|
function getOutputsForNode(node, handleId) {
|
|
68950
|
-
var _a2;
|
|
68951
68939
|
const type = node.type || "default";
|
|
68952
|
-
return
|
|
68940
|
+
return outputRegistry[type]?.[handleId] ?? [];
|
|
68953
68941
|
}
|
|
68954
68942
|
const _sfc_main$3n = /* @__PURE__ */ Object.assign({ inheritAttrs: false }, {
|
|
68955
68943
|
__name: "DataEdge",
|
|
@@ -77242,8 +77230,8 @@ function useLayout() {
|
|
|
77242
77230
|
for (const node of nodes) {
|
|
77243
77231
|
const graphNode = findNode(node.id);
|
|
77244
77232
|
dagreGraph.setNode(node.id, {
|
|
77245
|
-
width:
|
|
77246
|
-
height:
|
|
77233
|
+
width: graphNode?.dimensions.width || 150,
|
|
77234
|
+
height: graphNode?.dimensions.height || 50
|
|
77247
77235
|
});
|
|
77248
77236
|
}
|
|
77249
77237
|
for (const edge of edges) {
|
|
@@ -77407,16 +77395,15 @@ const _sfc_main$3j = /* @__PURE__ */ defineComponent({
|
|
|
77407
77395
|
]),
|
|
77408
77396
|
createElementVNode("div", _hoisted_3$v, [
|
|
77409
77397
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(variables), (variable) => {
|
|
77410
|
-
var _a2, _b;
|
|
77411
77398
|
return openBlock(), createElementBlock("div", {
|
|
77412
77399
|
key: variable.id
|
|
77413
77400
|
}, [
|
|
77414
77401
|
createElementVNode("div", _hoisted_4$j, [
|
|
77415
77402
|
createElementVNode("div", {
|
|
77416
77403
|
class: "size-6 p-1 rounded flex items-center justify-center",
|
|
77417
|
-
style: normalizeStyle({ backgroundColor:
|
|
77404
|
+
style: normalizeStyle({ backgroundColor: variableOptions.find((option) => option.value === variable.type)?.tint })
|
|
77418
77405
|
}, [
|
|
77419
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
77406
|
+
(openBlock(), createBlock(resolveDynamicComponent(variableOptions.find((option) => option.value === variable.type)?.icon), { class: "text-white" }))
|
|
77420
77407
|
], 4),
|
|
77421
77408
|
createElementVNode("div", _hoisted_5$d, [
|
|
77422
77409
|
createVNode(_component_Input, {
|
|
@@ -77455,12 +77442,9 @@ const _sfc_main$3j = /* @__PURE__ */ defineComponent({
|
|
|
77455
77442
|
variant: "outline",
|
|
77456
77443
|
size: "sm"
|
|
77457
77444
|
}, {
|
|
77458
|
-
default: withCtx(() =>
|
|
77459
|
-
|
|
77460
|
-
|
|
77461
|
-
createTextVNode(toDisplayString((_a3 = variableOptions.find((option) => option.value === variable.type)) == null ? void 0 : _a3.label), 1)
|
|
77462
|
-
];
|
|
77463
|
-
}),
|
|
77445
|
+
default: withCtx(() => [
|
|
77446
|
+
createTextVNode(toDisplayString(variableOptions.find((option) => option.value === variable.type)?.label), 1)
|
|
77447
|
+
]),
|
|
77464
77448
|
_: 2
|
|
77465
77449
|
}, 1024)
|
|
77466
77450
|
]),
|
|
@@ -78819,9 +78803,8 @@ const _sfc_main$35 = /* @__PURE__ */ defineComponent({
|
|
|
78819
78803
|
}
|
|
78820
78804
|
};
|
|
78821
78805
|
const outputValues = computed$1(() => {
|
|
78822
|
-
|
|
78823
|
-
|
|
78824
|
-
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;
|
|
78825
78808
|
});
|
|
78826
78809
|
return (_ctx, _cache2) => {
|
|
78827
78810
|
const _component_Button = resolveComponent("Button");
|
|
@@ -79800,7 +79783,7 @@ const _sfc_main$2X = /* @__PURE__ */ defineComponent({
|
|
|
79800
79783
|
buttonClass: "bg-gray-800 text-white"
|
|
79801
79784
|
}
|
|
79802
79785
|
];
|
|
79803
|
-
const nodeType = computed$1(() => NODE_TYPES
|
|
79786
|
+
const nodeType = computed$1(() => NODE_TYPES?.find((type) => type.value === node.value.type));
|
|
79804
79787
|
return (_ctx, _cache2) => {
|
|
79805
79788
|
const _component_Button = resolveComponent("Button");
|
|
79806
79789
|
const _component_SelectValue = resolveComponent("SelectValue");
|
|
@@ -79996,7 +79979,7 @@ const _sfc_main$2W = /* @__PURE__ */ defineComponent({
|
|
|
79996
79979
|
}
|
|
79997
79980
|
});
|
|
79998
79981
|
const prettify = (type) => {
|
|
79999
|
-
if (!
|
|
79982
|
+
if (!type?.startsWith("{") || !type.endsWith("}")) return type;
|
|
80000
79983
|
const inner = type.slice(1, -1).trim();
|
|
80001
79984
|
const lines = inner.split(";").filter(Boolean).map((line) => ` ${line.trim()};`);
|
|
80002
79985
|
return ["{", ...lines, "}"].join("\n");
|
|
@@ -80208,7 +80191,7 @@ const _sfc_main$2U = /* @__PURE__ */ defineComponent({
|
|
|
80208
80191
|
};
|
|
80209
80192
|
const setState = (state) => {
|
|
80210
80193
|
console.log("Set state", state);
|
|
80211
|
-
setNodes(
|
|
80194
|
+
setNodes(state?.nodes ?? [
|
|
80212
80195
|
{
|
|
80213
80196
|
id: "START",
|
|
80214
80197
|
type: "start",
|
|
@@ -80216,9 +80199,9 @@ const _sfc_main$2U = /* @__PURE__ */ defineComponent({
|
|
|
80216
80199
|
data: {}
|
|
80217
80200
|
}
|
|
80218
80201
|
]);
|
|
80219
|
-
setEdges(
|
|
80220
|
-
variables.value =
|
|
80221
|
-
computedVariables.value =
|
|
80202
|
+
setEdges(state?.edges ?? []);
|
|
80203
|
+
variables.value = state?.variables ?? [];
|
|
80204
|
+
computedVariables.value = state?.computedVariables ?? [];
|
|
80222
80205
|
};
|
|
80223
80206
|
onMounted$1(() => {
|
|
80224
80207
|
overlayStack.push(randomId);
|
|
@@ -80332,15 +80315,13 @@ const _sfc_main$2T = /* @__PURE__ */ defineComponent({
|
|
|
80332
80315
|
watch$1(
|
|
80333
80316
|
() => props.workflow,
|
|
80334
80317
|
async () => {
|
|
80335
|
-
var _a2, _b;
|
|
80336
80318
|
await nextTick();
|
|
80337
|
-
|
|
80319
|
+
flowBuilder.value?.setState?.(props.workflow);
|
|
80338
80320
|
},
|
|
80339
80321
|
{ immediate: true }
|
|
80340
80322
|
);
|
|
80341
80323
|
const saveForm = () => {
|
|
80342
|
-
|
|
80343
|
-
const data2 = (_b = (_a2 = flowBuilder.value) == null ? void 0 : _a2.getState) == null ? void 0 : _b.call(_a2);
|
|
80324
|
+
const data2 = flowBuilder.value?.getState?.();
|
|
80344
80325
|
closeFlowBuilder(props.id, data2);
|
|
80345
80326
|
};
|
|
80346
80327
|
const cancel = () => {
|
|
@@ -81242,7 +81223,7 @@ const _sfc_main$2C = /* @__PURE__ */ defineComponent({
|
|
|
81242
81223
|
const props = __props;
|
|
81243
81224
|
const allAvailableVariables = inject("allAvailableVariables");
|
|
81244
81225
|
const output = computed(() => {
|
|
81245
|
-
return interpolateTemplateFromVariableContext(props.text, allAvailableVariables
|
|
81226
|
+
return interpolateTemplateFromVariableContext(props.text, allAvailableVariables?.value);
|
|
81246
81227
|
});
|
|
81247
81228
|
return (_ctx, _cache2) => {
|
|
81248
81229
|
return openBlock(), createElementBlock("p", _hoisted_1$I, toDisplayString(unref(output)), 1);
|
|
@@ -81442,7 +81423,7 @@ const _sfc_main$2x = /* @__PURE__ */ defineComponent({
|
|
|
81442
81423
|
const props = __props;
|
|
81443
81424
|
const allAvailableVariables = inject("allAvailableVariables");
|
|
81444
81425
|
const output = computed(() => {
|
|
81445
|
-
return interpolateTemplateFromVariableContext(props.text, allAvailableVariables
|
|
81426
|
+
return interpolateTemplateFromVariableContext(props.text, allAvailableVariables?.value);
|
|
81446
81427
|
});
|
|
81447
81428
|
return (_ctx, _cache2) => {
|
|
81448
81429
|
return openBlock(), createElementBlock("p", _hoisted_1$F, toDisplayString(unref(output)), 1);
|
|
@@ -111351,7 +111332,6 @@ const _sfc_main$2s = /* @__PURE__ */ defineComponent({
|
|
|
111351
111332
|
const state = inject$1("state");
|
|
111352
111333
|
const isDragging2 = inject$1("isDragging");
|
|
111353
111334
|
async function drag2() {
|
|
111354
|
-
var _a2, _b, _c, _d, _e2, _f, _g, _h;
|
|
111355
111335
|
isDragging2.value = true;
|
|
111356
111336
|
const parentRect = document.querySelector("#custom-form-builder .vue-grid-layout").getBoundingClientRect();
|
|
111357
111337
|
let mouseInGrid = false;
|
|
@@ -111362,31 +111342,30 @@ const _sfc_main$2s = /* @__PURE__ */ defineComponent({
|
|
|
111362
111342
|
await addElement(state.layout.length * 2 % (state.colNum || 12), state.layout.length + (state.colNum || 12), true);
|
|
111363
111343
|
await nextTick();
|
|
111364
111344
|
}
|
|
111365
|
-
if (!
|
|
111345
|
+
if (!state.itemRefs?.drop) {
|
|
111366
111346
|
return;
|
|
111367
111347
|
}
|
|
111368
111348
|
const index = state.layout.findIndex((item) => item.i === "drop");
|
|
111369
111349
|
if (index !== -1) {
|
|
111370
|
-
if (
|
|
111350
|
+
if (state.itemRefs?.drop?.el?.style) {
|
|
111371
111351
|
state.itemRefs.drop.el.style.display = "none";
|
|
111372
111352
|
}
|
|
111373
111353
|
const itemRef = state.itemRefs.drop;
|
|
111374
111354
|
const new_pos = itemRef.calcXY(mouseXY.y - parentRect.top, mouseXY.x - parentRect.left);
|
|
111375
111355
|
if (mouseInGrid === true) {
|
|
111376
|
-
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]);
|
|
111377
111357
|
DragPos.i = String(index);
|
|
111378
111358
|
DragPos.x = state.layout[index].x;
|
|
111379
111359
|
DragPos.y = state.layout[index].y;
|
|
111380
111360
|
}
|
|
111381
111361
|
if (mouseInGrid === false) {
|
|
111382
|
-
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]);
|
|
111383
111363
|
state.layout = state.layout.filter((obj) => obj.i !== "drop");
|
|
111384
111364
|
await nextTick();
|
|
111385
111365
|
}
|
|
111386
111366
|
}
|
|
111387
111367
|
}
|
|
111388
111368
|
async function dragend() {
|
|
111389
|
-
var _a2, _b, _c, _d;
|
|
111390
111369
|
isDragging2.value = false;
|
|
111391
111370
|
const parentRect = document.querySelector("#custom-form-builder .vue-grid-layout").getBoundingClientRect();
|
|
111392
111371
|
let mouseInGrid = false;
|
|
@@ -111394,22 +111373,21 @@ const _sfc_main$2s = /* @__PURE__ */ defineComponent({
|
|
|
111394
111373
|
mouseInGrid = true;
|
|
111395
111374
|
}
|
|
111396
111375
|
if (mouseInGrid === true) {
|
|
111397
|
-
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]);
|
|
111398
111377
|
state.layout = state.layout.filter((obj) => obj.i !== "drop");
|
|
111399
111378
|
await addElement(DragPos.x, DragPos.y);
|
|
111400
111379
|
await nextTick();
|
|
111401
|
-
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]);
|
|
111402
111381
|
}
|
|
111403
111382
|
}
|
|
111404
111383
|
async function addElement(x2, y, ghost) {
|
|
111405
|
-
var _a2, _b, _c, _d;
|
|
111406
111384
|
let newEl = {
|
|
111407
111385
|
x: x2,
|
|
111408
111386
|
y,
|
|
111409
|
-
w:
|
|
111410
|
-
h:
|
|
111411
|
-
minW:
|
|
111412
|
-
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,
|
|
111413
111391
|
i: ghost ? "drop" : state.index,
|
|
111414
111392
|
component: props.elementData.component,
|
|
111415
111393
|
variableName: getNextVariableName(props.elementData.variableBaseName),
|
|
@@ -111753,17 +111731,14 @@ const _sfc_main$2q = /* @__PURE__ */ defineComponent({
|
|
|
111753
111731
|
class: "flex gap-1 items-center justify-start w-full",
|
|
111754
111732
|
onClick: ($event) => editIntegrationAction(action)
|
|
111755
111733
|
}, {
|
|
111756
|
-
default: withCtx(() =>
|
|
111757
|
-
|
|
111758
|
-
|
|
111759
|
-
((
|
|
111760
|
-
|
|
111761
|
-
|
|
111762
|
-
|
|
111763
|
-
|
|
111764
|
-
createElementVNode("p", _hoisted_2$k, toDisplayString(action.label), 1)
|
|
111765
|
-
];
|
|
111766
|
-
}),
|
|
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
|
+
]),
|
|
111767
111742
|
_: 2
|
|
111768
111743
|
}, 1032, ["onClick"])
|
|
111769
111744
|
]),
|
|
@@ -111920,16 +111895,15 @@ const _sfc_main$2p = /* @__PURE__ */ defineComponent({
|
|
|
111920
111895
|
]),
|
|
111921
111896
|
createElementVNode("div", _hoisted_3$e, [
|
|
111922
111897
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(state).variables, (variable) => {
|
|
111923
|
-
var _a2, _b;
|
|
111924
111898
|
return openBlock(), createElementBlock("div", {
|
|
111925
111899
|
key: variable.id,
|
|
111926
111900
|
class: "flex gap-2 items-center"
|
|
111927
111901
|
}, [
|
|
111928
111902
|
createElementVNode("div", {
|
|
111929
111903
|
class: "size-6 p-1 rounded flex items-center justify-center",
|
|
111930
|
-
style: normalizeStyle({ backgroundColor:
|
|
111904
|
+
style: normalizeStyle({ backgroundColor: variableOptions.find((option) => option.value === variable.type)?.tint })
|
|
111931
111905
|
}, [
|
|
111932
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
111906
|
+
(openBlock(), createBlock(resolveDynamicComponent(variableOptions.find((option) => option.value === variable.type)?.icon), { class: "text-white" }))
|
|
111933
111907
|
], 4),
|
|
111934
111908
|
createElementVNode("div", _hoisted_4$8, [
|
|
111935
111909
|
createVNode(_component_Input, {
|
|
@@ -112082,19 +112056,16 @@ const _sfc_main$2n = /* @__PURE__ */ defineComponent({
|
|
|
112082
112056
|
key: action.id,
|
|
112083
112057
|
class: "flex gap-2 items-center justify-between"
|
|
112084
112058
|
}, {
|
|
112085
|
-
default: withCtx(() =>
|
|
112086
|
-
|
|
112087
|
-
|
|
112088
|
-
|
|
112089
|
-
|
|
112090
|
-
|
|
112091
|
-
|
|
112092
|
-
|
|
112093
|
-
|
|
112094
|
-
|
|
112095
|
-
createVNode(unref(ChevronDown), { class: "size-4" })
|
|
112096
|
-
];
|
|
112097
|
-
}),
|
|
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
|
+
]),
|
|
112098
112069
|
_: 2
|
|
112099
112070
|
}, 1024);
|
|
112100
112071
|
}), 128))
|
|
@@ -112131,16 +112102,15 @@ const _sfc_main$2m = /* @__PURE__ */ defineComponent({
|
|
|
112131
112102
|
], -1)),
|
|
112132
112103
|
createElementVNode("div", _hoisted_2$g, [
|
|
112133
112104
|
(openBlock(true), createElementBlock(Fragment, null, renderList(Object.entries(unref(route).query), ([param, value]) => {
|
|
112134
|
-
var _a2, _b;
|
|
112135
112105
|
return openBlock(), createElementBlock("div", {
|
|
112136
112106
|
key: toCamelCase2(param),
|
|
112137
112107
|
class: "flex gap-2 items-center"
|
|
112138
112108
|
}, [
|
|
112139
112109
|
createElementVNode("div", {
|
|
112140
112110
|
class: "size-6 p-1 rounded flex items-center justify-center",
|
|
112141
|
-
style: normalizeStyle({ backgroundColor:
|
|
112111
|
+
style: normalizeStyle({ backgroundColor: variableOptions.find((option) => option.value === "string")?.tint })
|
|
112142
112112
|
}, [
|
|
112143
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
112113
|
+
(openBlock(), createBlock(resolveDynamicComponent(variableOptions.find((option) => option.value === "string")?.icon), { class: "text-white" }))
|
|
112144
112114
|
], 4),
|
|
112145
112115
|
createElementVNode("div", _hoisted_3$c, [
|
|
112146
112116
|
createTextVNode(toDisplayString(toCamelCase2(param) + " = " + value) + " ", 1),
|
|
@@ -112226,8 +112196,7 @@ const _sfc_main$2j = /* @__PURE__ */ defineComponent({
|
|
|
112226
112196
|
}
|
|
112227
112197
|
}
|
|
112228
112198
|
onMounted(() => {
|
|
112229
|
-
|
|
112230
|
-
newName.value = ((_a2 = activeElement.value) == null ? void 0 : _a2.variableName) || "";
|
|
112199
|
+
newName.value = activeElement.value?.variableName || "";
|
|
112231
112200
|
});
|
|
112232
112201
|
return (_ctx, _cache2) => {
|
|
112233
112202
|
const _component_Input = resolveComponent("Input");
|
|
@@ -117591,9 +117560,8 @@ const _sfc_main$2i = /* @__PURE__ */ defineComponent({
|
|
|
117591
117560
|
selectionBox.style.height = "0px";
|
|
117592
117561
|
};
|
|
117593
117562
|
function isTypingInInput() {
|
|
117594
|
-
|
|
117595
|
-
const
|
|
117596
|
-
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");
|
|
117597
117565
|
return ["input", "textarea", "select"].includes(tag) || isContentEditable === "true";
|
|
117598
117566
|
}
|
|
117599
117567
|
async function handleKeydown(event) {
|
|
@@ -117622,7 +117590,7 @@ const _sfc_main$2i = /* @__PURE__ */ defineComponent({
|
|
|
117622
117590
|
};
|
|
117623
117591
|
const isHidden = (item) => {
|
|
117624
117592
|
if (Object.keys(item).includes("visibility")) {
|
|
117625
|
-
return ![true, "true", 1].includes(interpolateTemplateFromVariableContext(item.visibility.trim(), allAvailableVariables
|
|
117593
|
+
return ![true, "true", 1].includes(interpolateTemplateFromVariableContext(item.visibility.trim(), allAvailableVariables?.value));
|
|
117626
117594
|
}
|
|
117627
117595
|
return false;
|
|
117628
117596
|
};
|
|
@@ -117698,24 +117666,21 @@ const _sfc_main$2i = /* @__PURE__ */ defineComponent({
|
|
|
117698
117666
|
"max-y": item.maxY,
|
|
117699
117667
|
"preserve-aspect-ratio": item.preserveAspectRatio
|
|
117700
117668
|
}, {
|
|
117701
|
-
default: withCtx(() =>
|
|
117702
|
-
|
|
117703
|
-
|
|
117704
|
-
|
|
117705
|
-
|
|
117706
|
-
|
|
117707
|
-
|
|
117708
|
-
|
|
117709
|
-
|
|
117710
|
-
|
|
117711
|
-
|
|
117712
|
-
|
|
117713
|
-
|
|
117714
|
-
|
|
117715
|
-
|
|
117716
|
-
], 10, _hoisted_2$f)
|
|
117717
|
-
];
|
|
117718
|
-
}),
|
|
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
|
+
]),
|
|
117719
117684
|
_: 2
|
|
117720
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"]);
|
|
117721
117686
|
}), 128))
|
|
@@ -117782,13 +117747,12 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
117782
117747
|
document.body.style.userSelect = "none";
|
|
117783
117748
|
}
|
|
117784
117749
|
function handleMouseMove(e) {
|
|
117785
|
-
var _a2, _b;
|
|
117786
117750
|
if (!isResizing.value) return;
|
|
117787
117751
|
const dx = e.clientX - resizeStart.value.x;
|
|
117788
117752
|
const dy = e.clientY - resizeStart.value.y;
|
|
117789
117753
|
const minWidth = 200, minHeight = 200;
|
|
117790
|
-
const maxWidth =
|
|
117791
|
-
const maxHeight =
|
|
117754
|
+
const maxWidth = builderContainer.value?.offsetWidth || 800;
|
|
117755
|
+
const maxHeight = builderContainer.value?.offsetHeight || 800;
|
|
117792
117756
|
previewSize.value.width = Math.max(minWidth, Math.min(resizeStart.value.width + dx, maxWidth));
|
|
117793
117757
|
previewSize.value.height = Math.max(minHeight, Math.min(resizeStart.value.height + dy, maxHeight));
|
|
117794
117758
|
}
|
|
@@ -117839,7 +117803,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
117839
117803
|
});
|
|
117840
117804
|
const getState = () => {
|
|
117841
117805
|
let { layout: layout2, variables, transformers, apiActions } = JSON.parse(JSON.stringify(state));
|
|
117842
|
-
apiActions
|
|
117806
|
+
apiActions?.forEach((action) => {
|
|
117843
117807
|
action.action.response = null;
|
|
117844
117808
|
action.firedAt = null;
|
|
117845
117809
|
action.hasFired = false;
|
|
@@ -117850,17 +117814,16 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
117850
117814
|
Object.assign(state, newState);
|
|
117851
117815
|
};
|
|
117852
117816
|
const baseVariables = computed$1(() => {
|
|
117853
|
-
|
|
117854
|
-
const normalVars = ((_a2 = state.variables) == null ? void 0 : _a2.map((v) => ({
|
|
117817
|
+
const normalVars = state.variables?.map((v) => ({
|
|
117855
117818
|
name: v.name,
|
|
117856
117819
|
type: v.type,
|
|
117857
117820
|
value: v.value ?? null
|
|
117858
|
-
}))
|
|
117859
|
-
const apiActionVars =
|
|
117821
|
+
})) || [];
|
|
117822
|
+
const apiActionVars = state.apiActions?.map((a) => ({
|
|
117860
117823
|
name: a.label,
|
|
117861
117824
|
type: "apiActionResponse",
|
|
117862
117825
|
value: a.action ?? null
|
|
117863
|
-
}))
|
|
117826
|
+
})) || [];
|
|
117864
117827
|
const elementVars = Object.entries(state.elementValues ?? {}).map(([key, val]) => ({
|
|
117865
117828
|
name: key,
|
|
117866
117829
|
type: "element",
|
|
@@ -117873,7 +117836,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
117873
117836
|
type: "routeQueryParam",
|
|
117874
117837
|
value: val ?? null
|
|
117875
117838
|
})) || [];
|
|
117876
|
-
return
|
|
117839
|
+
return [...normalVars, ...apiActionVars, ...elementVars, ...routeQueryVars]?.filter((v) => v.name);
|
|
117877
117840
|
});
|
|
117878
117841
|
function toCamelCase2(str) {
|
|
117879
117842
|
return str.replace(/-([a-z])/g, (_2, letter) => letter.toUpperCase());
|
|
@@ -117898,14 +117861,13 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
117898
117861
|
return sandbox2(expression, context3);
|
|
117899
117862
|
};
|
|
117900
117863
|
const sandbox2 = (code, args = {}) => {
|
|
117901
|
-
var _a2;
|
|
117902
117864
|
try {
|
|
117903
117865
|
const frame2 = document.createElement("iframe");
|
|
117904
117866
|
frame2.style.display = "none";
|
|
117905
117867
|
document.body.appendChild(frame2);
|
|
117906
|
-
const F =
|
|
117868
|
+
const F = frame2.contentWindow?.Function;
|
|
117907
117869
|
document.body.removeChild(frame2);
|
|
117908
|
-
return F
|
|
117870
|
+
return F?.(...Object.keys(args), "'use strict';" + code)(...Object.values(args));
|
|
117909
117871
|
} catch (error) {
|
|
117910
117872
|
console.error("Sandbox error:", error);
|
|
117911
117873
|
return "";
|
|
@@ -117923,8 +117885,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
117923
117885
|
document.removeEventListener("mouseup", onMouseUp, true);
|
|
117924
117886
|
});
|
|
117925
117887
|
async function onMouseDown(e) {
|
|
117926
|
-
|
|
117927
|
-
if ((_a2 = e.target) == null ? void 0 : _a2.closest(".vue-grid-item")) {
|
|
117888
|
+
if (e.target?.closest(".vue-grid-item")) {
|
|
117928
117889
|
isDragging2.value = true;
|
|
117929
117890
|
}
|
|
117930
117891
|
}
|
|
@@ -117947,30 +117908,27 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
117947
117908
|
provide("isEditMode", isEditMode);
|
|
117948
117909
|
provide("onFinish", props.onFinish);
|
|
117949
117910
|
async function loadState() {
|
|
117950
|
-
var _a2;
|
|
117951
117911
|
const fetchedState = {};
|
|
117952
117912
|
if (fetchedState) {
|
|
117953
|
-
|
|
117913
|
+
Object.keys(fetchedState)?.forEach((key) => {
|
|
117954
117914
|
state[key] = fetchedState[key];
|
|
117955
117915
|
});
|
|
117956
117916
|
}
|
|
117957
117917
|
}
|
|
117958
117918
|
function fillDefaultValues() {
|
|
117959
|
-
|
|
117960
|
-
(_a2 = state.layout) == null ? void 0 : _a2.forEach((item) => {
|
|
117919
|
+
state.layout?.forEach((item) => {
|
|
117961
117920
|
if (Object.keys(item).includes("defaultValue")) {
|
|
117962
117921
|
state.elementValues[item.variableName] = interpolateTemplateFromVariableContext(item.defaultValue, allAvailableVariables.value);
|
|
117963
117922
|
}
|
|
117964
117923
|
});
|
|
117965
117924
|
}
|
|
117966
117925
|
const setup = async () => {
|
|
117967
|
-
var _a2, _b;
|
|
117968
117926
|
await loadState();
|
|
117969
117927
|
fillDefaultValues();
|
|
117970
117928
|
loadStartupActions();
|
|
117971
117929
|
previewSize.value = {
|
|
117972
|
-
width: Math.min(
|
|
117973
|
-
height: Math.min(
|
|
117930
|
+
width: Math.min(builderContainer.value?.offsetWidth - 40, 700),
|
|
117931
|
+
height: Math.min(builderContainer.value?.offsetHeight - 40, 1e3)
|
|
117974
117932
|
};
|
|
117975
117933
|
};
|
|
117976
117934
|
const loadStartupActions = () => {
|
|
@@ -118043,9 +118001,8 @@ const _sfc_main$2g = /* @__PURE__ */ defineComponent({
|
|
|
118043
118001
|
watch$1(
|
|
118044
118002
|
() => props.config,
|
|
118045
118003
|
async () => {
|
|
118046
|
-
var _a2;
|
|
118047
118004
|
await nextTick();
|
|
118048
|
-
|
|
118005
|
+
formBuilder.value?.setState(props.config);
|
|
118049
118006
|
},
|
|
118050
118007
|
{ immediate: true }
|
|
118051
118008
|
);
|
|
@@ -121668,10 +121625,9 @@ const _sfc_main$26 = /* @__PURE__ */ defineComponent({
|
|
|
121668
121625
|
resetForm();
|
|
121669
121626
|
});
|
|
121670
121627
|
const initForm = () => {
|
|
121671
|
-
var _a2, _b;
|
|
121672
121628
|
loadIntegrations();
|
|
121673
|
-
loadServiceTypes(
|
|
121674
|
-
loadActionTypes(
|
|
121629
|
+
loadServiceTypes(integrationAction.value?.integration);
|
|
121630
|
+
loadActionTypes(integrationAction.value?.serviceType);
|
|
121675
121631
|
};
|
|
121676
121632
|
watch$1(() => builderState.value.show, async (val) => {
|
|
121677
121633
|
if (val) {
|
|
@@ -121692,9 +121648,8 @@ const _sfc_main$26 = /* @__PURE__ */ defineComponent({
|
|
|
121692
121648
|
}
|
|
121693
121649
|
});
|
|
121694
121650
|
watch$1(() => integrationAction.value.integration, (val) => {
|
|
121695
|
-
var _a2, _b;
|
|
121696
121651
|
loadServiceTypes(val);
|
|
121697
|
-
integrationAction.value.integrationType =
|
|
121652
|
+
integrationAction.value.integrationType = integrations.value?.find((i) => i.id === val)?.type;
|
|
121698
121653
|
});
|
|
121699
121654
|
watch$1(() => integrationAction.value.serviceType, (val) => {
|
|
121700
121655
|
loadActionTypes(val);
|
|
@@ -121707,14 +121662,12 @@ const _sfc_main$26 = /* @__PURE__ */ defineComponent({
|
|
|
121707
121662
|
integrations.value = await getProjectIntegrations(projectId.value);
|
|
121708
121663
|
};
|
|
121709
121664
|
const loadServiceTypes = (integrationId) => {
|
|
121710
|
-
var _a2, _b, _c, _d, _e2, _f, _g;
|
|
121711
121665
|
if (!integrationId) return serviceTypes.value = [];
|
|
121712
|
-
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 })) : [];
|
|
121713
121667
|
};
|
|
121714
121668
|
const loadActionTypes = (serviceTypeId) => {
|
|
121715
|
-
var _a2, _b, _c, _d, _e2;
|
|
121716
121669
|
if (!serviceTypeId) return actionTypes.value = [];
|
|
121717
|
-
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 })) : [];
|
|
121718
121671
|
};
|
|
121719
121672
|
const resetForm = async () => {
|
|
121720
121673
|
Object.assign(integrationAction.value, {
|
|
@@ -121767,152 +121720,149 @@ const _sfc_main$26 = /* @__PURE__ */ defineComponent({
|
|
|
121767
121720
|
side: "left",
|
|
121768
121721
|
class: "w-full sm:w-3/4 xl:w-1/2 sm:max-w-3xl"
|
|
121769
121722
|
}, {
|
|
121770
|
-
default: withCtx(() =>
|
|
121771
|
-
|
|
121772
|
-
|
|
121773
|
-
|
|
121774
|
-
|
|
121775
|
-
|
|
121776
|
-
|
|
121777
|
-
|
|
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")
|
|
121778
121850
|
])),
|
|
121779
121851
|
_: 1,
|
|
121780
|
-
__: [
|
|
121852
|
+
__: [11]
|
|
121781
121853
|
}),
|
|
121782
|
-
createVNode(
|
|
121783
|
-
default: withCtx(() => _cache2[
|
|
121784
|
-
createTextVNode("
|
|
121854
|
+
createVNode(_component_Button, { onClick: createIntegrationAction }, {
|
|
121855
|
+
default: withCtx(() => _cache2[12] || (_cache2[12] = [
|
|
121856
|
+
createTextVNode("Create")
|
|
121785
121857
|
])),
|
|
121786
121858
|
_: 1,
|
|
121787
|
-
__: [
|
|
121859
|
+
__: [12]
|
|
121788
121860
|
})
|
|
121789
|
-
])
|
|
121790
|
-
_: 1
|
|
121791
|
-
}),
|
|
121792
|
-
createElementVNode("div", _hoisted_1$n, [
|
|
121793
|
-
createElementVNode("div", _hoisted_2$c, [
|
|
121794
|
-
createElementVNode("div", _hoisted_3$b, [
|
|
121795
|
-
_cache2[7] || (_cache2[7] = createElementVNode("p", { class: "text-sm font-semibold" }, "Integration", -1)),
|
|
121796
|
-
createVNode(_component_ResourceSelect, {
|
|
121797
|
-
modelValue: integrationAction.value.integration,
|
|
121798
|
-
"onUpdate:modelValue": _cache2[0] || (_cache2[0] = ($event) => integrationAction.value.integration = $event)
|
|
121799
|
-
}, null, 8, ["modelValue"])
|
|
121800
|
-
]),
|
|
121801
|
-
createElementVNode("div", _hoisted_4$6, [
|
|
121802
|
-
_cache2[8] || (_cache2[8] = createElementVNode("p", { class: "text-sm font-semibold" }, "Service type", -1)),
|
|
121803
|
-
createVNode(_component_Select, {
|
|
121804
|
-
modelValue: integrationAction.value.serviceType,
|
|
121805
|
-
"onUpdate:modelValue": _cache2[1] || (_cache2[1] = ($event) => integrationAction.value.serviceType = $event),
|
|
121806
|
-
disabled: !integrationAction.value.integration
|
|
121807
|
-
}, {
|
|
121808
|
-
default: withCtx(() => [
|
|
121809
|
-
createVNode(_component_SelectTrigger, { class: "w-[190px]" }, {
|
|
121810
|
-
default: withCtx(() => [
|
|
121811
|
-
createVNode(_component_SelectValue, { placeholder: "Select a service type" })
|
|
121812
|
-
]),
|
|
121813
|
-
_: 1
|
|
121814
|
-
}),
|
|
121815
|
-
createVNode(_component_SelectContent, null, {
|
|
121816
|
-
default: withCtx(() => [
|
|
121817
|
-
createVNode(_component_SelectGroup, null, {
|
|
121818
|
-
default: withCtx(() => [
|
|
121819
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(serviceTypes.value, (serviceType) => {
|
|
121820
|
-
return openBlock(), createBlock(_component_SelectItem, {
|
|
121821
|
-
key: serviceType.value,
|
|
121822
|
-
value: serviceType.value
|
|
121823
|
-
}, {
|
|
121824
|
-
default: withCtx(() => [
|
|
121825
|
-
createTextVNode(toDisplayString(serviceType.text), 1)
|
|
121826
|
-
]),
|
|
121827
|
-
_: 2
|
|
121828
|
-
}, 1032, ["value"]);
|
|
121829
|
-
}), 128))
|
|
121830
|
-
]),
|
|
121831
|
-
_: 1
|
|
121832
|
-
})
|
|
121833
|
-
]),
|
|
121834
|
-
_: 1
|
|
121835
|
-
})
|
|
121836
|
-
]),
|
|
121837
|
-
_: 1
|
|
121838
|
-
}, 8, ["modelValue", "disabled"])
|
|
121839
|
-
]),
|
|
121840
|
-
createElementVNode("div", _hoisted_5$6, [
|
|
121841
|
-
_cache2[9] || (_cache2[9] = createElementVNode("p", { class: "text-sm font-semibold" }, "Action type", -1)),
|
|
121842
|
-
createVNode(_component_Select, {
|
|
121843
|
-
modelValue: integrationAction.value.actionType,
|
|
121844
|
-
"onUpdate:modelValue": _cache2[2] || (_cache2[2] = ($event) => integrationAction.value.actionType = $event),
|
|
121845
|
-
disabled: !integrationAction.value.serviceType
|
|
121846
|
-
}, {
|
|
121847
|
-
default: withCtx(() => [
|
|
121848
|
-
createVNode(_component_SelectTrigger, { class: "w-[190px]" }, {
|
|
121849
|
-
default: withCtx(() => [
|
|
121850
|
-
createVNode(_component_SelectValue, { placeholder: "Select an action type" })
|
|
121851
|
-
]),
|
|
121852
|
-
_: 1
|
|
121853
|
-
}),
|
|
121854
|
-
createVNode(_component_SelectContent, null, {
|
|
121855
|
-
default: withCtx(() => [
|
|
121856
|
-
createVNode(_component_SelectGroup, null, {
|
|
121857
|
-
default: withCtx(() => [
|
|
121858
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(actionTypes.value, (actionType) => {
|
|
121859
|
-
return openBlock(), createBlock(_component_SelectItem, {
|
|
121860
|
-
key: actionType.value,
|
|
121861
|
-
value: actionType.value
|
|
121862
|
-
}, {
|
|
121863
|
-
default: withCtx(() => [
|
|
121864
|
-
createTextVNode(toDisplayString(actionType.text), 1)
|
|
121865
|
-
]),
|
|
121866
|
-
_: 2
|
|
121867
|
-
}, 1032, ["value"]);
|
|
121868
|
-
}), 128))
|
|
121869
|
-
]),
|
|
121870
|
-
_: 1
|
|
121871
|
-
})
|
|
121872
|
-
]),
|
|
121873
|
-
_: 1
|
|
121874
|
-
})
|
|
121875
|
-
]),
|
|
121876
|
-
_: 1
|
|
121877
|
-
}, 8, ["modelValue", "disabled"])
|
|
121878
|
-
])
|
|
121879
|
-
]),
|
|
121880
|
-
createVNode(_component_Separator, { class: "my-4" }),
|
|
121881
|
-
!integrationAction.value.actionType ? (openBlock(), createElementBlock("div", _hoisted_6$6, _cache2[10] || (_cache2[10] = [
|
|
121882
|
-
createElementVNode("p", null, "Choose an action type to get started.", -1)
|
|
121883
|
-
]))) : (openBlock(), createElementBlock("div", _hoisted_7$5, [
|
|
121884
|
-
(openBlock(), createBlock(resolveDynamicComponent((_a2 = actionTypes.value.find((at2) => at2.value === integrationAction.value.actionType)) == null ? void 0 : _a2.component), {
|
|
121885
|
-
modelValue: integrationAction.value.actionTypeConfig,
|
|
121886
|
-
"onUpdate:modelValue": _cache2[3] || (_cache2[3] = ($event) => integrationAction.value.actionTypeConfig = $event)
|
|
121887
|
-
}, null, 8, ["modelValue"]))
|
|
121888
|
-
]))
|
|
121861
|
+
])
|
|
121889
121862
|
]),
|
|
121890
|
-
|
|
121891
|
-
|
|
121892
|
-
|
|
121893
|
-
createVNode(_component_Button, {
|
|
121894
|
-
variant: "ghost",
|
|
121895
|
-
onClick: cancel
|
|
121896
|
-
}, {
|
|
121897
|
-
default: withCtx(() => _cache2[11] || (_cache2[11] = [
|
|
121898
|
-
createTextVNode("Cancel")
|
|
121899
|
-
])),
|
|
121900
|
-
_: 1,
|
|
121901
|
-
__: [11]
|
|
121902
|
-
}),
|
|
121903
|
-
createVNode(_component_Button, { onClick: createIntegrationAction }, {
|
|
121904
|
-
default: withCtx(() => _cache2[12] || (_cache2[12] = [
|
|
121905
|
-
createTextVNode("Create")
|
|
121906
|
-
])),
|
|
121907
|
-
_: 1,
|
|
121908
|
-
__: [12]
|
|
121909
|
-
})
|
|
121910
|
-
])
|
|
121911
|
-
]),
|
|
121912
|
-
_: 1
|
|
121913
|
-
})
|
|
121914
|
-
];
|
|
121915
|
-
}),
|
|
121863
|
+
_: 1
|
|
121864
|
+
})
|
|
121865
|
+
]),
|
|
121916
121866
|
_: 1
|
|
121917
121867
|
})
|
|
121918
121868
|
]),
|
|
@@ -122117,7 +122067,7 @@ const _sfc_main$22 = /* @__PURE__ */ defineComponent({
|
|
|
122117
122067
|
const reload = inject$1("reload", () => {
|
|
122118
122068
|
});
|
|
122119
122069
|
async function onDrop(files) {
|
|
122120
|
-
for (let i = 0; i <
|
|
122070
|
+
for (let i = 0; i < files?.length; i++) {
|
|
122121
122071
|
let randomID = crypto.randomUUID();
|
|
122122
122072
|
addToUploadQueue(randomID, files[i]);
|
|
122123
122073
|
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
@@ -122596,7 +122546,7 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
|
|
|
122596
122546
|
if (!softReload) {
|
|
122597
122547
|
loading.value = true;
|
|
122598
122548
|
}
|
|
122599
|
-
if (
|
|
122549
|
+
if (path?.[0] === "/") {
|
|
122600
122550
|
path = path.substring(1);
|
|
122601
122551
|
}
|
|
122602
122552
|
try {
|
|
@@ -122673,15 +122623,13 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
|
|
|
122673
122623
|
search.value = "";
|
|
122674
122624
|
};
|
|
122675
122625
|
const setEffectiveBasePath = () => {
|
|
122676
|
-
|
|
122677
|
-
effectiveBasePath.value = ((_b = (_a2 = props.sources) == null ? void 0 : _a2[0]) == null ? void 0 : _b.path) || "";
|
|
122626
|
+
effectiveBasePath.value = props.sources?.[0]?.path || "";
|
|
122678
122627
|
if (effectiveBasePath.value[0] === "/") {
|
|
122679
122628
|
effectiveBasePath.value = effectiveBasePath.value.substring(1);
|
|
122680
122629
|
}
|
|
122681
122630
|
};
|
|
122682
122631
|
onMounted$1(() => {
|
|
122683
|
-
|
|
122684
|
-
activeSourceId.value = ((_a2 = props.sources) == null ? void 0 : _a2[0]) || "";
|
|
122632
|
+
activeSourceId.value = props.sources?.[0] || "";
|
|
122685
122633
|
setEffectiveBasePath();
|
|
122686
122634
|
});
|
|
122687
122635
|
return (_ctx, _cache2) => {
|
|
@@ -122708,40 +122656,37 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
|
|
|
122708
122656
|
createVNode(_component_DialogScrollContent, { class: "w-[90%] md:w-[90%] sm:max-w-[1500px]" }, {
|
|
122709
122657
|
default: withCtx(() => [
|
|
122710
122658
|
createVNode(_component_DialogHeader, { class: "sticky -top-6 pt-10 pb-2 -mt-6 z-10 bg-background" }, {
|
|
122711
|
-
default: withCtx(() =>
|
|
122712
|
-
|
|
122713
|
-
|
|
122714
|
-
|
|
122715
|
-
|
|
122716
|
-
|
|
122717
|
-
|
|
122718
|
-
|
|
122719
|
-
onClick: navigateBack
|
|
122720
|
-
}, {
|
|
122721
|
-
default: withCtx(() => [
|
|
122722
|
-
createVNode(unref(ChevronLeft), { class: "size-4" })
|
|
122723
|
-
]),
|
|
122724
|
-
_: 1
|
|
122725
|
-
})) : createCommentVNode("", true),
|
|
122726
|
-
createVNode(_component_DialogTitle, { class: "flex items-center gap-2" }, {
|
|
122727
|
-
default: withCtx(() => [
|
|
122728
|
-
createVNode(_component_MediaSourceSelect, {
|
|
122729
|
-
sources: __props.sources,
|
|
122730
|
-
modelValue: activeSourceId.value,
|
|
122731
|
-
"onUpdate:modelValue": _cache2[0] || (_cache2[0] = ($event) => activeSourceId.value = $event)
|
|
122732
|
-
}, null, 8, ["sources", "modelValue"])
|
|
122733
|
-
]),
|
|
122734
|
-
_: 1
|
|
122735
|
-
})
|
|
122736
|
-
]),
|
|
122737
|
-
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
|
+
}, {
|
|
122738
122667
|
default: withCtx(() => [
|
|
122739
|
-
|
|
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"])
|
|
122740
122679
|
]),
|
|
122741
122680
|
_: 1
|
|
122742
122681
|
})
|
|
122743
|
-
]
|
|
122744
|
-
|
|
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
|
+
]),
|
|
122745
122690
|
_: 1
|
|
122746
122691
|
}),
|
|
122747
122692
|
createElementVNode("div", null, [
|
|
@@ -122796,23 +122741,17 @@ const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
|
|
|
122796
122741
|
]))
|
|
122797
122742
|
]),
|
|
122798
122743
|
createVNode(_component_DialogFooter, { class: "sticky -bottom-6 pb-10 pt-2 -mb-6 z-10 bg-background" }, {
|
|
122799
|
-
default: withCtx(() =>
|
|
122800
|
-
|
|
122801
|
-
|
|
122802
|
-
|
|
122803
|
-
|
|
122804
|
-
|
|
122805
|
-
|
|
122806
|
-
|
|
122807
|
-
|
|
122808
|
-
|
|
122809
|
-
|
|
122810
|
-
];
|
|
122811
|
-
}),
|
|
122812
|
-
_: 1
|
|
122813
|
-
}, 8, ["disabled"])
|
|
122814
|
-
];
|
|
122815
|
-
}),
|
|
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
|
+
]),
|
|
122816
122755
|
_: 1
|
|
122817
122756
|
})
|
|
122818
122757
|
]),
|
|
@@ -129220,17 +129159,14 @@ const _sfc_main$1_ = /* @__PURE__ */ defineComponent({
|
|
|
129220
129159
|
sources: unref(sources),
|
|
129221
129160
|
onSubmit: addMedia
|
|
129222
129161
|
}, {
|
|
129223
|
-
default: withCtx(() =>
|
|
129224
|
-
|
|
129225
|
-
|
|
129226
|
-
|
|
129227
|
-
|
|
129228
|
-
|
|
129229
|
-
|
|
129230
|
-
|
|
129231
|
-
], 2)
|
|
129232
|
-
];
|
|
129233
|
-
}),
|
|
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
|
+
]),
|
|
129234
129170
|
_: 1
|
|
129235
129171
|
}, 8, ["sources"])
|
|
129236
129172
|
], 512)
|
|
@@ -130251,19 +130187,18 @@ const _sfc_main$1v = /* @__PURE__ */ defineComponent({
|
|
|
130251
130187
|
}
|
|
130252
130188
|
};
|
|
130253
130189
|
watch$1(dialogIsOpen, (val) => {
|
|
130254
|
-
var _a2;
|
|
130255
130190
|
if (val) {
|
|
130256
130191
|
let modelValue = JSON.parse(JSON.stringify(props.modelValue));
|
|
130257
|
-
selectedIntegrationId.value =
|
|
130258
|
-
resource.value =
|
|
130259
|
-
filters.value =
|
|
130260
|
-
sorts.value =
|
|
130261
|
-
limit.value =
|
|
130262
|
-
offset.value =
|
|
130263
|
-
startAt.value =
|
|
130264
|
-
endAt.value =
|
|
130265
|
-
groupBy.value =
|
|
130266
|
-
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;
|
|
130267
130202
|
}
|
|
130268
130203
|
});
|
|
130269
130204
|
const emit = __emit;
|
|
@@ -130352,7 +130287,6 @@ const _sfc_main$1v = /* @__PURE__ */ defineComponent({
|
|
|
130352
130287
|
}
|
|
130353
130288
|
}
|
|
130354
130289
|
async function runQuery() {
|
|
130355
|
-
var _a2, _b, _c, _d;
|
|
130356
130290
|
resetOutput();
|
|
130357
130291
|
if (integration.value.type === "FIREBASE") {
|
|
130358
130292
|
try {
|
|
@@ -130366,8 +130300,8 @@ const _sfc_main$1v = /* @__PURE__ */ defineComponent({
|
|
|
130366
130300
|
});
|
|
130367
130301
|
queryResult.value = `Found ${res.length} results`;
|
|
130368
130302
|
} catch (error) {
|
|
130369
|
-
errorMessage.value =
|
|
130370
|
-
indexUrl.value =
|
|
130303
|
+
errorMessage.value = error.response.data?.message || "Failed to run query";
|
|
130304
|
+
indexUrl.value = error.response.data?.data?.indexUrl || null;
|
|
130371
130305
|
}
|
|
130372
130306
|
} else {
|
|
130373
130307
|
try {
|
|
@@ -130381,7 +130315,7 @@ const _sfc_main$1v = /* @__PURE__ */ defineComponent({
|
|
|
130381
130315
|
distinct: distinct.value
|
|
130382
130316
|
});
|
|
130383
130317
|
} catch (error) {
|
|
130384
|
-
errorMessage.value =
|
|
130318
|
+
errorMessage.value = error.response.data?.message || "Failed to run query";
|
|
130385
130319
|
}
|
|
130386
130320
|
}
|
|
130387
130321
|
}
|
|
@@ -130688,99 +130622,96 @@ const _sfc_main$1v = /* @__PURE__ */ defineComponent({
|
|
|
130688
130622
|
})
|
|
130689
130623
|
]),
|
|
130690
130624
|
createVNode(_component_CollapsibleContent, null, {
|
|
130691
|
-
default: withCtx(() =>
|
|
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
|
-
|
|
130777
|
-
|
|
130778
|
-
__: [27]
|
|
130779
|
-
})
|
|
130780
|
-
])
|
|
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
|
+
})
|
|
130781
130712
|
])
|
|
130782
|
-
]
|
|
130783
|
-
|
|
130713
|
+
])
|
|
130714
|
+
]),
|
|
130784
130715
|
_: 1
|
|
130785
130716
|
})
|
|
130786
130717
|
]),
|
|
@@ -131506,17 +131437,14 @@ const _sfc_main$1d = /* @__PURE__ */ defineComponent({
|
|
|
131506
131437
|
}, {
|
|
131507
131438
|
default: withCtx(() => [
|
|
131508
131439
|
createVNode(_component_SelectTrigger, null, {
|
|
131509
|
-
default: withCtx(() =>
|
|
131510
|
-
|
|
131511
|
-
|
|
131512
|
-
unref(
|
|
131513
|
-
|
|
131514
|
-
|
|
131515
|
-
|
|
131516
|
-
|
|
131517
|
-
createVNode(_component_SelectValue, { placeholder: "Select a resource" })
|
|
131518
|
-
];
|
|
131519
|
-
}),
|
|
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
|
+
]),
|
|
131520
131448
|
_: 1
|
|
131521
131449
|
}),
|
|
131522
131450
|
createVNode(_component_SelectContent, null, {
|
|
@@ -131864,7 +131792,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
|
|
|
131864
131792
|
const registerButton = inject$1("segmentedControlRegister", () => {
|
|
131865
131793
|
});
|
|
131866
131794
|
const buttonRef = ref(null);
|
|
131867
|
-
const isActive = computed$1(() =>
|
|
131795
|
+
const isActive = computed$1(() => currentValue?.value === props.value);
|
|
131868
131796
|
const handleClick = () => {
|
|
131869
131797
|
if (!props.disabled) {
|
|
131870
131798
|
updateValue(props.value);
|