@oneclick.dev/cms-core-modules 0.0.124 → 0.0.125
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/AppointmentListTable-CWzbwqR-.js +1 -0
- package/dist/AppointmentListTable-DoZuBstk.mjs +270 -0
- package/dist/ContentEditor-BlNbqkAz.js +324 -0
- package/dist/{ContentEditor-DX1bTQKs.mjs → ContentEditor-D754iLJS.mjs} +8074 -27026
- package/dist/{Detail-B7pe808q.mjs → Detail-BOxWQ1QQ.mjs} +2 -2
- package/dist/{Detail-B_Q7Qkuz.mjs → Detail-BfKW0uZE.mjs} +2 -2
- package/dist/Detail-DFVu2F38.mjs +11 -0
- package/dist/{Detail-t3tOcy3X.js → Detail-DJea_fCd.js} +1 -1
- package/dist/{Detail-CNiLIEh9.js → Detail-DPJacXfm.js} +1 -1
- package/dist/Detail-DSLZ7_bM.js +1 -0
- package/dist/{Detail-BESGmY7z.js → Detail-DUGThL9Y.js} +1 -1
- package/dist/{Detail-DNxAzeCs.mjs → Detail-D_LlEeHu.mjs} +2 -2
- package/dist/Overview-0hFXiuYo.js +1 -0
- package/dist/Overview-BTx5LF4J.js +1 -0
- package/dist/Overview-CCu2PHai.mjs +289 -0
- package/dist/Overview-D2u-leeO.js +1 -0
- package/dist/Overview-D_2wozCG.mjs +1733 -0
- package/dist/Overview-Dffo-zH4.mjs +11 -0
- package/dist/{TableCalculationWidget-CrqcLGfU.mjs → TableCalculationWidget-B_LFoOYm.mjs} +3 -3
- package/dist/{TableCalculationWidget-CkQPrVUd.js → TableCalculationWidget-CahOIcbk.js} +1 -1
- package/dist/TableDataWidget-BwqWFH4A.js +1 -0
- package/dist/TableDataWidget-RsVxcDsL.mjs +112 -0
- package/dist/TableOverviewCard-BPWCqo56.js +1 -0
- package/dist/{TableOverviewCard-Ci0d4o4w.mjs → TableOverviewCard-D667DDag.mjs} +113 -127
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C3XiOXgb.js +1 -0
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-sp0TLio0.mjs +547 -0
- package/dist/{TableRowActionCard-BhdnnPaq.mjs → TableRowActionCard-BPYJ-Kjy.mjs} +95 -101
- package/dist/TableRowActionCard-Bnqj1YIe.js +1 -0
- package/dist/TableView-CwhZ9YN2.js +4 -0
- package/dist/TableView-DX9PKS8N.mjs +9673 -0
- package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-BgDdzbLe.js +1 -0
- package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-D85V4nrQ.mjs +2886 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/dateRangePresets-CaPVagHY.mjs +453 -0
- package/dist/dateRangePresets-gxQCiZ6c.js +1 -0
- package/dist/index-6hZ6MYY6.js +1 -0
- package/dist/index-BVmmicu3.mjs +14 -0
- package/dist/index-ChHD_1Cf.js +144 -0
- package/dist/index-CvV4nVWI.js +1 -0
- package/dist/index-DH2z0W_w.mjs +19012 -0
- package/dist/index-DZKzj48V.mjs +17 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +237 -103
- package/dist/orders-C_sz8J9b.js +1 -0
- package/dist/{orders-BfTLIm7U.mjs → orders-Cgdggzvx.mjs} +84 -84
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +2055 -1123
- package/dist/src/appointments/chat-components/AppointmentListTable.vue.d.ts +3 -0
- package/dist/src/appointments/index.d.ts +93 -3
- package/dist/src/appointments/reservation-summary.d.ts +48 -0
- package/dist/src/appointments/server.d.ts +1 -0
- package/dist/src/appointments/tools.d.ts +93 -3
- package/dist/src/filezone/config.d.ts +31 -0
- package/dist/src/filezone/index.d.ts +43 -0
- package/dist/src/filezone/index.vue.d.ts +2 -0
- package/dist/src/filezone/metadata.d.ts +2 -0
- package/dist/src/filezone/pages/Overview.vue.d.ts +4 -0
- package/dist/src/filezone/permissions.d.ts +5 -0
- package/dist/src/filezone/routes.d.ts +5 -0
- package/dist/src/filezone/server.d.ts +36 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/mailTemplates/builder-types.d.ts +40 -0
- package/dist/src/mailTemplates/components/BlockRenderer.vue.d.ts +24 -0
- package/dist/src/mailTemplates/components/DesignPanel.vue.d.ts +13 -0
- package/dist/src/mailTemplates/components/EmailCanvas.vue.d.ts +44 -0
- package/dist/src/mailTemplates/components/RichTextEditor.vue.d.ts +10 -0
- package/dist/src/mailTemplates/components/RightSidebar.vue.d.ts +18 -0
- package/dist/src/mailTemplates/components/SettingsPanel.vue.d.ts +15 -0
- package/dist/src/mailTemplates/components/TemplateBuilder.vue.d.ts +2 -0
- package/dist/src/mailTemplates/components/TemplateList.vue.d.ts +19 -1
- package/dist/src/mailTemplates/components/rich-text.d.ts +6 -0
- package/dist/src/mailTemplates/config.d.ts +10 -4
- package/dist/src/mailTemplates/defaults.d.ts +10 -0
- package/dist/src/mailTemplates/editor-state.d.ts +21 -0
- package/dist/src/mailTemplates/index.d.ts +11 -5
- package/dist/src/mailTemplates/index.vue.d.ts +2 -4
- package/dist/src/mailTemplates/metadata.d.ts +1 -1
- package/dist/src/mailTemplates/pages/Detail.vue.d.ts +1 -13
- package/dist/src/mailTemplates/pages/Overview.vue.d.ts +1 -13
- package/dist/src/mailTemplates/server.d.ts +23 -0
- package/dist/src/server-handlers.d.ts +4 -0
- package/dist/src/table/badge-filter-utils.d.ts +8 -0
- package/dist/src/table/chat-components/TableOverviewCard.vue.d.ts +2 -7
- package/dist/src/table/chat-components/TableResultView.vue.d.ts +3 -7
- package/dist/src/table/components/TableDisplayCell.vue.d.ts +8 -0
- package/dist/src/table/components/columns/BadgeColumnSettings.vue.d.ts +9 -0
- package/dist/src/table/components/columns/ColumnColorSelect.vue.d.ts +11 -0
- package/dist/src/table/components/columns/ColumnDisplaySettings.vue.d.ts +9 -0
- package/dist/src/table/components/columns/ColumnTypeSelect.vue.d.ts +11 -0
- package/dist/src/table/components/columns/ColumnValueSourceInput.vue.d.ts +15 -0
- package/dist/src/table/components/columns/DialogTableColumnItem.vue.d.ts +8 -11
- package/dist/src/table/components/columns/ProgressColumnSettings.vue.d.ts +8 -0
- package/dist/src/table/components/stats/StatDialog.vue.d.ts +6 -10
- package/dist/src/table/components/stats/Stats.vue.d.ts +9 -15
- package/dist/src/table/composables/useTableClock.d.ts +4 -0
- package/dist/src/table/display-utils.d.ts +35 -0
- package/dist/src/table/row-value.d.ts +1 -0
- package/dist/src/table/stat-utils.d.ts +9 -0
- package/dist/src/table/tool-utils.d.ts +1 -1
- package/dist/src/table/types.d.ts +54 -1
- package/dist/src/whatsappBusiness/analytics.d.ts +4 -0
- package/dist/src/whatsappBusiness/components/AccountPanel.vue.d.ts +2 -0
- package/dist/src/whatsappBusiness/components/InsightsPanel.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/components/TemplateDialog.vue.d.ts +14 -0
- package/dist/src/whatsappBusiness/components/TemplatesPanel.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/components/presentation.d.ts +4 -0
- package/dist/src/whatsappBusiness/config.d.ts +51 -0
- package/dist/src/whatsappBusiness/connection.d.ts +77 -0
- package/dist/src/whatsappBusiness/index.d.ts +63 -0
- package/dist/src/whatsappBusiness/index.vue.d.ts +5 -0
- package/dist/src/whatsappBusiness/metadata.d.ts +2 -0
- package/dist/src/whatsappBusiness/pages/Overview.vue.d.ts +2 -0
- package/dist/src/whatsappBusiness/permissions.d.ts +5 -0
- package/dist/src/whatsappBusiness/provider.d.ts +21 -0
- package/dist/src/whatsappBusiness/routes.d.ts +5 -0
- package/dist/src/whatsappBusiness/server.d.ts +14 -0
- package/dist/src/whatsappBusiness/templates.d.ts +94 -0
- package/dist/src/whatsappBusiness/types.d.ts +162 -0
- package/dist/{tool-sandbox-DoF1PsyS.js → tool-sandbox-BSkKdH7V.js} +1 -1
- package/dist/{tool-sandbox-DdkMLkDK.mjs → tool-sandbox-DU9b1B7v.mjs} +1 -1
- package/dist/{types-ibC3-e1N.mjs → types-B5MifmeF.mjs} +339 -273
- package/dist/types-D5dgTskW.js +1 -0
- package/dist/{useTableAgentTools-D5mzGf3A.js → useTableAgentTools-BrUot49I.js} +1 -1
- package/dist/{useTableAgentTools-DcN3kYRL.mjs → useTableAgentTools-r5InEI4p.mjs} +8 -8
- package/dist/{vee-validate-zod-BQElPD0m.js → vee-validate-zod-CWZwNTWE.js} +1 -1
- package/dist/{vee-validate-zod-CN16K2x9.mjs → vee-validate-zod-D0WaDgDZ.mjs} +1 -1
- package/package.json +2 -2
- package/src/appointments/tools.ts +52 -2
- package/dist/AppointmentListTable-DZJNmTMb.mjs +0 -177
- package/dist/AppointmentListTable-Dieu9US_.js +0 -1
- package/dist/ContentEditor-BcIUumah.js +0 -467
- package/dist/Detail-Byk781b4.mjs +0 -26
- package/dist/Detail-mvSGbnFU.js +0 -1
- package/dist/Overview-BDlBCUI_.js +0 -1
- package/dist/Overview-Su8ZUbMs.mjs +0 -26
- package/dist/TableDataWidget-7qvC3Egd.js +0 -1
- package/dist/TableDataWidget-DMTSoGRO.mjs +0 -121
- package/dist/TableOverviewCard-AFq-puJs.js +0 -1
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs +0 -534
- package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js +0 -1
- package/dist/TableRowActionCard-IzB6tNN-.js +0 -1
- package/dist/TableView-6mdrL3zx.js +0 -4
- package/dist/TableView-Du5nOE6R.mjs +0 -8228
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +0 -1
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs +0 -40
- package/dist/dateRangePresets-B-l5b_wR.mjs +0 -48
- package/dist/dateRangePresets-CPWqst_x.js +0 -1
- package/dist/orders-DUa2PVoa.js +0 -1
- package/dist/types-BMraG1kN.js +0 -1
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { defineComponent as Y, ref as c, onMounted as ee, openBlock as d, createElementBlock as b, createVNode as h, unref as w, createElementVNode as
|
|
1
|
+
import { defineComponent as Y, ref as c, onMounted as ee, openBlock as d, createElementBlock as b, createVNode as h, unref as w, createElementVNode as r, toDisplayString as y, createCommentVNode as E, createBlock as N, createTextVNode as te } from "vue";
|
|
2
2
|
import { Loader2 as I, CheckCircle2 as re, XCircle as le, AlertTriangle as j, Play as oe } from "lucide-vue-next";
|
|
3
|
-
import { u as se } from "./useTableAgentTools-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
3
|
+
import { u as se } from "./useTableAgentTools-r5InEI4p.mjs";
|
|
4
|
+
import { s as B, r as ae, p as ne } from "./dateRangePresets-CaPVagHY.mjs";
|
|
5
|
+
import { _ as ie, b as L, s as M, i as O, r as ue } from "./TableResultView.vue_vue_type_script_setup_true_lang-sp0TLio0.mjs";
|
|
6
|
+
import { r as ce } from "./tool-sandbox-DU9b1B7v.mjs";
|
|
7
|
+
const de = { class: "w-full" }, ve = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "flex items-center gap-2 py-3 text-xs text-muted-foreground"
|
|
9
|
-
},
|
|
10
|
+
}, me = {
|
|
10
11
|
key: 1,
|
|
11
12
|
class: "rounded-xl border bg-background p-4"
|
|
12
|
-
},
|
|
13
|
+
}, fe = { class: "flex items-center gap-2 text-sm font-semibold text-emerald-600 dark:text-emerald-400" }, pe = {
|
|
13
14
|
key: 2,
|
|
14
15
|
class: "rounded-xl border bg-background p-4"
|
|
15
|
-
},
|
|
16
|
+
}, be = { class: "flex items-center gap-2 text-sm font-semibold text-muted-foreground" }, ge = {
|
|
16
17
|
key: 3,
|
|
17
18
|
class: "flex items-start gap-2 rounded-xl border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive"
|
|
18
|
-
},
|
|
19
|
+
}, we = {
|
|
19
20
|
key: 4,
|
|
20
21
|
class: "overflow-hidden rounded-xl border bg-background"
|
|
21
|
-
},
|
|
22
|
+
}, xe = { class: "border-b bg-amber-50/70 p-4 dark:bg-amber-950/20" }, he = { class: "flex items-start gap-3" }, ye = { class: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-amber-500/15" }, _e = { class: "min-w-0" }, Ae = { class: "text-sm font-semibold" }, Re = {
|
|
22
23
|
key: 0,
|
|
23
24
|
class: "mt-1 text-[11px] text-muted-foreground"
|
|
24
|
-
},
|
|
25
|
+
}, ke = { class: "p-3" }, Ce = {
|
|
25
26
|
key: 0,
|
|
26
27
|
class: "mt-3 text-xs text-destructive"
|
|
27
|
-
},
|
|
28
|
+
}, Te = { class: "mt-3 flex items-center gap-2" }, De = ["disabled"], Se = ["disabled"], Be = /* @__PURE__ */ Y({
|
|
28
29
|
__name: "TableRowActionCard",
|
|
29
30
|
props: {
|
|
30
31
|
projectSlug: {},
|
|
@@ -37,37 +38,37 @@ const ue = { class: "w-full" }, ce = {
|
|
|
37
38
|
},
|
|
38
39
|
emits: ["submit"],
|
|
39
40
|
setup(P, { emit: V }) {
|
|
40
|
-
const
|
|
41
|
+
const l = P, q = V, _ = c(!0), p = c(!1), u = c(null), v = c("confirm"), o = c(null), D = c(-1), a = c(null), x = c([]), m = c(null), C = c(null), { loadRows: Z, runStoredRowAction: F } = se(l);
|
|
41
42
|
function U(e, t) {
|
|
42
|
-
const n = e.filter((
|
|
43
|
+
const n = e.filter((f) => f.id === t);
|
|
43
44
|
if (n.length === 1) return n[0];
|
|
44
|
-
const i = t.trim().toLocaleLowerCase(),
|
|
45
|
-
if (
|
|
46
|
-
throw
|
|
45
|
+
const i = t.trim().toLocaleLowerCase(), s = e.filter((f) => String(f.label).trim().toLocaleLowerCase() === i);
|
|
46
|
+
if (s.length === 1) return s[0];
|
|
47
|
+
throw s.length > 1 ? new Error(`More than one row action is named "${t}". Use its action ID.`) : new Error(`No configured row action matches "${t}".`);
|
|
47
48
|
}
|
|
48
49
|
async function X(e, t) {
|
|
49
50
|
if (e.visible === void 0 || e.visible === null || e.visible === "" || e.visible === !0 || e.visible === "true") return !0;
|
|
50
51
|
if (e.visible === !1 || e.visible === "false") return !1;
|
|
51
52
|
const i = String(e.visible).trim().match(/^\{\{([\s\S]*)\}\}$/);
|
|
52
53
|
if (!i) return !1;
|
|
53
|
-
const
|
|
54
|
+
const s = { item: { data: t } };
|
|
54
55
|
for (const [g, k] of Object.entries(t || {}))
|
|
55
|
-
/^[$A-Z_][0-9A-Z_$]*$/i.test(g) && !["constructor", "prototype", "__proto__"].includes(g) && (
|
|
56
|
-
return await
|
|
56
|
+
/^[$A-Z_][0-9A-Z_$]*$/i.test(g) && !["constructor", "prototype", "__proto__"].includes(g) && (s[g] = k);
|
|
57
|
+
return await ce(
|
|
57
58
|
`const value = (${i[1]}); return value === true || value === 'true';`,
|
|
58
|
-
|
|
59
|
+
s,
|
|
59
60
|
{ timeoutMs: 750, maxInputBytes: 1024 * 1024, maxOutputBytes: 1024 }
|
|
60
61
|
) === !0;
|
|
61
62
|
}
|
|
62
63
|
function G() {
|
|
63
|
-
if (
|
|
64
|
-
const e =
|
|
65
|
-
return !e || typeof e != "object" || Array.isArray(e) ? !1 : e.executed !== !0 && e.cancelled !== !0 && typeof e.error != "string" ? (u.value = "The saved row-action result is unavailable.", v.value = "error", _.value = !1, !0) : (C.value = e,
|
|
64
|
+
if (l.status !== "completed") return !1;
|
|
65
|
+
const e = l.resolvedArgs?._cachedData;
|
|
66
|
+
return !e || typeof e != "object" || Array.isArray(e) ? !1 : e.executed !== !0 && e.cancelled !== !0 && typeof e.error != "string" ? (u.value = "The saved row-action result is unavailable.", v.value = "error", _.value = !1, !0) : (C.value = e, o.value = e.row || null, x.value = e.columns || O(o.value ? [o.value] : []).slice(0, 8), u.value = e.error || null, v.value = e.cancelled ? "cancelled" : e.executed ? "success" : "error", _.value = !1, !0);
|
|
66
67
|
}
|
|
67
68
|
function R(e) {
|
|
68
69
|
let t;
|
|
69
70
|
try {
|
|
70
|
-
t =
|
|
71
|
+
t = M(e, 256 * 1024);
|
|
71
72
|
} catch {
|
|
72
73
|
t = {
|
|
73
74
|
executed: e?.executed === !0,
|
|
@@ -77,43 +78,40 @@ const ue = { class: "w-full" }, ce = {
|
|
|
77
78
|
resultOmitted: "The detailed result was too large to store in chat."
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
|
-
C.value = t,
|
|
81
|
+
C.value = t, l.status !== "completed" && q("submit", t);
|
|
81
82
|
}
|
|
82
83
|
function S(e) {
|
|
83
|
-
return
|
|
84
|
-
t.property,
|
|
85
|
-
M(e, t.property)
|
|
86
|
-
]));
|
|
84
|
+
return ne(e, x.value);
|
|
87
85
|
}
|
|
88
86
|
function H() {
|
|
89
|
-
const e = String(
|
|
87
|
+
const e = String(l.resolvedArgs?.action || "").trim(), t = Array.isArray(l.resolvedArgs?.match) ? l.resolvedArgs.match : [];
|
|
90
88
|
if (!e) throw new Error("A configured row action ID or label is required.");
|
|
91
89
|
if (!t.length) throw new Error("At least one exact row match is required before an action can run.");
|
|
92
90
|
return { requestedAction: e, match: t };
|
|
93
91
|
}
|
|
94
92
|
async function $(e = !1) {
|
|
95
93
|
const { requestedAction: t, match: n } = H(), i = await Z({
|
|
96
|
-
startDate:
|
|
97
|
-
endDate:
|
|
98
|
-
dateProperty:
|
|
99
|
-
useDefaultDateRange:
|
|
100
|
-
}, { freshMetadata: e }),
|
|
94
|
+
startDate: l.resolvedArgs?.startDate,
|
|
95
|
+
endDate: l.resolvedArgs?.endDate,
|
|
96
|
+
dateProperty: l.resolvedArgs?.dateProperty,
|
|
97
|
+
useDefaultDateRange: l.resolvedArgs?.useDefaultDateRange
|
|
98
|
+
}, { freshMetadata: e }), s = U(i.actions, t), f = i.rows.filter((T) => n.every((A) => {
|
|
101
99
|
if (!A || typeof A.property != "string") return !1;
|
|
102
|
-
const W =
|
|
103
|
-
return Object.is(
|
|
100
|
+
const W = ue(A.property, i.columns)?.property || A.property;
|
|
101
|
+
return Object.is(ae(T, W), A.value);
|
|
104
102
|
}));
|
|
105
|
-
if (
|
|
106
|
-
const T =
|
|
103
|
+
if (f.length !== 1) {
|
|
104
|
+
const T = f.length === 0 ? "No rows match" : `${f.length} rows match`;
|
|
107
105
|
throw new Error(`${T} the supplied identity. Refine the match until it identifies exactly one row.`);
|
|
108
106
|
}
|
|
109
|
-
const g =
|
|
107
|
+
const g = f[0], k = i.sourceRows.indexOf(g);
|
|
110
108
|
if (k < 0) throw new Error("The selected row could not be mapped back to the table data.");
|
|
111
|
-
if (!await X(
|
|
112
|
-
throw new Error(`The "${
|
|
113
|
-
return { result: i, action:
|
|
109
|
+
if (!await X(s, g))
|
|
110
|
+
throw new Error(`The "${s.label}" action is not available for this row.`);
|
|
111
|
+
return { result: i, action: s, row: g, rowIndex: k };
|
|
114
112
|
}
|
|
115
|
-
function
|
|
116
|
-
|
|
113
|
+
function z(e) {
|
|
114
|
+
m.value = e.result, a.value = e.action, o.value = e.row, D.value = e.rowIndex;
|
|
117
115
|
const t = e.result.columns.length ? e.result.columns : O([e.row]);
|
|
118
116
|
x.value = t.filter((n) => n.visible !== !1 && !n._remove).slice(0, 8);
|
|
119
117
|
}
|
|
@@ -121,13 +119,13 @@ const ue = { class: "w-full" }, ce = {
|
|
|
121
119
|
if (!G()) {
|
|
122
120
|
_.value = !0, u.value = null;
|
|
123
121
|
try {
|
|
124
|
-
|
|
122
|
+
z(await $());
|
|
125
123
|
} catch (e) {
|
|
126
124
|
u.value = e?.message || "Could not prepare the row action.", v.value = "error", R({
|
|
127
125
|
executed: !1,
|
|
128
126
|
error: u.value,
|
|
129
|
-
action:
|
|
130
|
-
availableActions:
|
|
127
|
+
action: l.resolvedArgs?.action || null,
|
|
128
|
+
availableActions: m.value?.actions?.map((t) => ({ id: t.id, label: t.label })) || []
|
|
131
129
|
});
|
|
132
130
|
} finally {
|
|
133
131
|
_.value = !1;
|
|
@@ -135,19 +133,19 @@ const ue = { class: "w-full" }, ce = {
|
|
|
135
133
|
}
|
|
136
134
|
}
|
|
137
135
|
async function K() {
|
|
138
|
-
if (!(p.value || !a.value || !
|
|
136
|
+
if (!(p.value || !a.value || !o.value || !m.value)) {
|
|
139
137
|
p.value = !0, u.value = null;
|
|
140
138
|
try {
|
|
141
|
-
|
|
139
|
+
z(await $(!0));
|
|
142
140
|
const e = await F(
|
|
143
141
|
a.value,
|
|
144
|
-
|
|
142
|
+
o.value,
|
|
145
143
|
D.value,
|
|
146
|
-
|
|
147
|
-
), t =
|
|
144
|
+
m.value.sourceRows
|
|
145
|
+
), t = L(o.value, m.value.rows, m.value.columns);
|
|
148
146
|
let n = null;
|
|
149
147
|
try {
|
|
150
|
-
n =
|
|
148
|
+
n = M(e.flowResult ?? null, 64 * 1024);
|
|
151
149
|
} catch {
|
|
152
150
|
n = { omitted: "The flow result was too large to store in chat." };
|
|
153
151
|
}
|
|
@@ -155,18 +153,14 @@ const ue = { class: "w-full" }, ce = {
|
|
|
155
153
|
executed: !0,
|
|
156
154
|
cancelled: !1,
|
|
157
155
|
action: { id: a.value.id, label: a.value.label },
|
|
158
|
-
row: S(
|
|
156
|
+
row: S(o.value),
|
|
159
157
|
rowReference: t,
|
|
160
|
-
columns: x.value.map(
|
|
161
|
-
property: r.property,
|
|
162
|
-
label: r.label || r.property,
|
|
163
|
-
type: r.type || "text"
|
|
164
|
-
})),
|
|
158
|
+
columns: x.value.map(B),
|
|
165
159
|
flowResult: n,
|
|
166
|
-
tableEffects: e.effects.map((
|
|
167
|
-
type:
|
|
168
|
-
index:
|
|
169
|
-
merge:
|
|
160
|
+
tableEffects: e.effects.map((s) => ({
|
|
161
|
+
type: s.type,
|
|
162
|
+
index: s.index,
|
|
163
|
+
merge: s.merge
|
|
170
164
|
}))
|
|
171
165
|
};
|
|
172
166
|
v.value = "success", R(i);
|
|
@@ -175,8 +169,8 @@ const ue = { class: "w-full" }, ce = {
|
|
|
175
169
|
executed: !1,
|
|
176
170
|
cancelled: !1,
|
|
177
171
|
error: u.value,
|
|
178
|
-
action: a.value ? { id: a.value.id, label: a.value.label } :
|
|
179
|
-
rowReference:
|
|
172
|
+
action: a.value ? { id: a.value.id, label: a.value.label } : l.resolvedArgs?.action,
|
|
173
|
+
rowReference: o.value && m.value ? L(o.value, m.value.rows, m.value.columns) : null
|
|
180
174
|
});
|
|
181
175
|
} finally {
|
|
182
176
|
p.value = !1;
|
|
@@ -187,54 +181,54 @@ const ue = { class: "w-full" }, ce = {
|
|
|
187
181
|
p.value || (v.value = "cancelled", R({
|
|
188
182
|
executed: !1,
|
|
189
183
|
cancelled: !0,
|
|
190
|
-
action: a.value ? { id: a.value.id, label: a.value.label } :
|
|
191
|
-
row:
|
|
192
|
-
columns: x.value
|
|
184
|
+
action: a.value ? { id: a.value.id, label: a.value.label } : l.resolvedArgs?.action,
|
|
185
|
+
row: o.value ? S(o.value) : null,
|
|
186
|
+
columns: x.value.map(B)
|
|
193
187
|
}));
|
|
194
188
|
}
|
|
195
|
-
return ee(J), (e, t) => (d(), b("div",
|
|
196
|
-
_.value ? (d(), b("div",
|
|
189
|
+
return ee(J), (e, t) => (d(), b("div", de, [
|
|
190
|
+
_.value ? (d(), b("div", ve, [
|
|
197
191
|
h(w(I), { class: "size-4 animate-spin" }),
|
|
198
|
-
t[0] || (t[0] =
|
|
199
|
-
])) : v.value === "success" ? (d(), b("div",
|
|
200
|
-
|
|
192
|
+
t[0] || (t[0] = r("span", null, "Finding the row and action…", -1))
|
|
193
|
+
])) : v.value === "success" ? (d(), b("div", me, [
|
|
194
|
+
r("div", fe, [
|
|
201
195
|
h(w(re), { class: "size-5" }),
|
|
202
|
-
|
|
196
|
+
r("span", null, y(C.value?.action?.label || "Row action") + " completed", 1)
|
|
203
197
|
]),
|
|
204
|
-
t[1] || (t[1] =
|
|
205
|
-
])) : v.value === "cancelled" ? (d(), b("div",
|
|
206
|
-
|
|
198
|
+
t[1] || (t[1] = r("p", { class: "mt-1 text-xs text-muted-foreground" }, "The table’s configured action flow finished successfully.", -1))
|
|
199
|
+
])) : v.value === "cancelled" ? (d(), b("div", pe, [
|
|
200
|
+
r("div", be, [
|
|
207
201
|
h(w(le), { class: "size-5" }),
|
|
208
|
-
t[2] || (t[2] =
|
|
202
|
+
t[2] || (t[2] = r("span", null, "Action cancelled", -1))
|
|
209
203
|
]),
|
|
210
|
-
t[3] || (t[3] =
|
|
211
|
-
])) : v.value === "error" ? (d(), b("div",
|
|
204
|
+
t[3] || (t[3] = r("p", { class: "mt-1 text-xs text-muted-foreground" }, "No row action was run.", -1))
|
|
205
|
+
])) : v.value === "error" ? (d(), b("div", ge, [
|
|
212
206
|
h(w(j), { class: "mt-0.5 size-4 shrink-0" }),
|
|
213
|
-
|
|
214
|
-
])) : (d(), b("div",
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
207
|
+
r("span", null, y(u.value), 1)
|
|
208
|
+
])) : (d(), b("div", we, [
|
|
209
|
+
r("div", xe, [
|
|
210
|
+
r("div", he, [
|
|
211
|
+
r("div", ye, [
|
|
218
212
|
h(w(j), { class: "size-4 text-amber-600 dark:text-amber-400" })
|
|
219
213
|
]),
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
t[4] || (t[4] =
|
|
223
|
-
|
|
214
|
+
r("div", _e, [
|
|
215
|
+
r("p", Ae, "Confirm “" + y(a.value?.label) + "”", 1),
|
|
216
|
+
t[4] || (t[4] = r("p", { class: "mt-1 text-xs text-muted-foreground" }, " This runs the action flow configured on this table and may change external data. ", -1)),
|
|
217
|
+
l.resolvedArgs?.confirmationMessage ? (d(), b("p", Re, " Agent note: " + y(l.resolvedArgs.confirmationMessage), 1)) : E("", !0)
|
|
224
218
|
])
|
|
225
219
|
])
|
|
226
220
|
]),
|
|
227
|
-
|
|
228
|
-
h(
|
|
221
|
+
r("div", ke, [
|
|
222
|
+
h(ie, {
|
|
229
223
|
title: "Selected row",
|
|
230
|
-
rows:
|
|
224
|
+
rows: o.value ? [o.value] : [],
|
|
231
225
|
columns: x.value,
|
|
232
226
|
view: "card",
|
|
233
227
|
"max-rows": 1
|
|
234
228
|
}, null, 8, ["rows", "columns"]),
|
|
235
|
-
u.value ? (d(), b("p",
|
|
236
|
-
|
|
237
|
-
|
|
229
|
+
u.value ? (d(), b("p", Ce, y(u.value), 1)) : E("", !0),
|
|
230
|
+
r("div", Te, [
|
|
231
|
+
r("button", {
|
|
238
232
|
type: "button",
|
|
239
233
|
class: "inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",
|
|
240
234
|
disabled: p.value,
|
|
@@ -248,13 +242,13 @@ const ue = { class: "w-full" }, ce = {
|
|
|
248
242
|
class: "size-3"
|
|
249
243
|
})),
|
|
250
244
|
te(" " + y(p.value ? "Running…" : `Run ${a.value?.label}`), 1)
|
|
251
|
-
], 8,
|
|
252
|
-
|
|
245
|
+
], 8, De),
|
|
246
|
+
r("button", {
|
|
253
247
|
type: "button",
|
|
254
248
|
class: "rounded-lg border px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted disabled:opacity-50",
|
|
255
249
|
disabled: p.value,
|
|
256
250
|
onClick: Q
|
|
257
|
-
}, " Cancel ", 8,
|
|
251
|
+
}, " Cancel ", 8, Se)
|
|
258
252
|
])
|
|
259
253
|
])
|
|
260
254
|
]))
|
|
@@ -262,5 +256,5 @@ const ue = { class: "w-full" }, ce = {
|
|
|
262
256
|
}
|
|
263
257
|
});
|
|
264
258
|
export {
|
|
265
|
-
|
|
259
|
+
Be as default
|
|
266
260
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("lucide-vue-next"),O=require("./useTableAgentTools-BrUot49I.js"),_=require("./dateRangePresets-gxQCiZ6c.js"),f=require("./TableResultView.vue_vue_type_script_setup_true_lang-C3XiOXgb.js"),Z=require("./tool-sandbox-BSkKdH7V.js"),F={class:"w-full"},U={key:0,class:"flex items-center gap-2 py-3 text-xs text-muted-foreground"},X={key:1,class:"rounded-xl border bg-background p-4"},G={class:"flex items-center gap-2 text-sm font-semibold text-emerald-600 dark:text-emerald-400"},H={key:2,class:"rounded-xl border bg-background p-4"},J={class:"flex items-center gap-2 text-sm font-semibold text-muted-foreground"},K={key:3,class:"flex items-start gap-2 rounded-xl border border-destructive/30 bg-destructive/5 p-3 text-xs text-destructive"},Q={key:4,class:"overflow-hidden rounded-xl border bg-background"},W={class:"border-b bg-amber-50/70 p-4 dark:bg-amber-950/20"},Y={class:"flex items-start gap-3"},ee={class:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-amber-500/15"},te={class:"min-w-0"},le={class:"text-sm font-semibold"},oe={key:0,class:"mt-1 text-[11px] text-muted-foreground"},re={class:"p-3"},ae={key:0,class:"mt-3 text-xs text-destructive"},ne={class:"mt-3 flex items-center gap-2"},se=["disabled"],ce=["disabled"],ue=e.defineComponent({__name:"TableRowActionCard",props:{projectSlug:{},toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(T,{emit:B}){const o=T,C=B,w=e.ref(!0),v=e.ref(!1),u=e.ref(null),i=e.ref("confirm"),r=e.ref(null),E=e.ref(-1),n=e.ref(null),g=e.ref([]),d=e.ref(null),k=e.ref(null),{loadRows:S,runStoredRowAction:D}=O.useTableAgentTools(o);function z(t,l){const s=t.filter(m=>m.id===l);if(s.length===1)return s[0];const c=l.trim().toLocaleLowerCase(),a=t.filter(m=>String(m.label).trim().toLocaleLowerCase()===c);if(a.length===1)return a[0];throw a.length>1?new Error(`More than one row action is named "${l}". Use its action ID.`):new Error(`No configured row action matches "${l}".`)}async function $(t,l){if(t.visible===void 0||t.visible===null||t.visible===""||t.visible===!0||t.visible==="true")return!0;if(t.visible===!1||t.visible==="false")return!1;const c=String(t.visible).trim().match(/^\{\{([\s\S]*)\}\}$/);if(!c)return!1;const a={item:{data:l}};for(const[p,y]of Object.entries(l||{}))/^[$A-Z_][0-9A-Z_$]*$/i.test(p)&&!["constructor","prototype","__proto__"].includes(p)&&(a[p]=y);return await Z.runSandboxedTableCode(`const value = (${c[1]}); return value === true || value === 'true';`,a,{timeoutMs:750,maxInputBytes:1024*1024,maxOutputBytes:1024})===!0}function q(){if(o.status!=="completed")return!1;const t=o.resolvedArgs?._cachedData;return!t||typeof t!="object"||Array.isArray(t)?!1:t.executed!==!0&&t.cancelled!==!0&&typeof t.error!="string"?(u.value="The saved row-action result is unavailable.",i.value="error",w.value=!1,!0):(k.value=t,r.value=t.row||null,g.value=t.columns||f.inferTableColumns(r.value?[r.value]:[]).slice(0,8),u.value=t.error||null,i.value=t.cancelled?"cancelled":t.executed?"success":"error",w.value=!1,!0)}function h(t){let l;try{l=f.serializeBounded(t,256*1024)}catch{l={executed:t?.executed===!0,cancelled:t?.cancelled===!0,action:t?.action||null,rowReference:t?.rowReference||null,resultOmitted:"The detailed result was too large to store in chat."}}k.value=l,o.status!=="completed"&&C("submit",l)}function N(t){return _.projectTableRow(t,g.value)}function I(){const t=String(o.resolvedArgs?.action||"").trim(),l=Array.isArray(o.resolvedArgs?.match)?o.resolvedArgs.match:[];if(!t)throw new Error("A configured row action ID or label is required.");if(!l.length)throw new Error("At least one exact row match is required before an action can run.");return{requestedAction:t,match:l}}async function R(t=!1){const{requestedAction:l,match:s}=I(),c=await S({startDate:o.resolvedArgs?.startDate,endDate:o.resolvedArgs?.endDate,dateProperty:o.resolvedArgs?.dateProperty,useDefaultDateRange:o.resolvedArgs?.useDefaultDateRange},{freshMetadata:t}),a=z(c.actions,l),m=c.rows.filter(A=>s.every(x=>{if(!x||typeof x.property!="string")return!1;const M=f.resolveColumn(x.property,c.columns)?.property||x.property;return Object.is(_.resolveProperty(A,M),x.value)}));if(m.length!==1){const A=m.length===0?"No rows match":`${m.length} rows match`;throw new Error(`${A} the supplied identity. Refine the match until it identifies exactly one row.`)}const p=m[0],y=c.sourceRows.indexOf(p);if(y<0)throw new Error("The selected row could not be mapped back to the table data.");if(!await $(a,p))throw new Error(`The "${a.label}" action is not available for this row.`);return{result:c,action:a,row:p,rowIndex:y}}function V(t){d.value=t.result,n.value=t.action,r.value=t.row,E.value=t.rowIndex;const l=t.result.columns.length?t.result.columns:f.inferTableColumns([t.row]);g.value=l.filter(s=>s.visible!==!1&&!s._remove).slice(0,8)}async function j(){if(!q()){w.value=!0,u.value=null;try{V(await R())}catch(t){u.value=t?.message||"Could not prepare the row action.",i.value="error",h({executed:!1,error:u.value,action:o.resolvedArgs?.action||null,availableActions:d.value?.actions?.map(l=>({id:l.id,label:l.label}))||[]})}finally{w.value=!1}}}async function L(){if(!(v.value||!n.value||!r.value||!d.value)){v.value=!0,u.value=null;try{V(await R(!0));const t=await D(n.value,r.value,E.value,d.value.sourceRows),l=f.buildRowReference(r.value,d.value.rows,d.value.columns);let s=null;try{s=f.serializeBounded(t.flowResult??null,64*1024)}catch{s={omitted:"The flow result was too large to store in chat."}}const c={executed:!0,cancelled:!1,action:{id:n.value.id,label:n.value.label},row:N(r.value),rowReference:l,columns:g.value.map(_.snapshotTableColumn),flowResult:s,tableEffects:t.effects.map(a=>({type:a.type,index:a.index,merge:a.merge}))};i.value="success",h(c)}catch(t){u.value=t?.message||"The row action failed.",i.value="error",h({executed:!1,cancelled:!1,error:u.value,action:n.value?{id:n.value.id,label:n.value.label}:o.resolvedArgs?.action,rowReference:r.value&&d.value?f.buildRowReference(r.value,d.value.rows,d.value.columns):null})}finally{v.value=!1}}}function P(){v.value||(i.value="cancelled",h({executed:!1,cancelled:!0,action:n.value?{id:n.value.id,label:n.value.label}:o.resolvedArgs?.action,row:r.value?N(r.value):null,columns:g.value.map(_.snapshotTableColumn)}))}return e.onMounted(j),(t,l)=>(e.openBlock(),e.createElementBlock("div",F,[w.value?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(e.unref(b.Loader2),{class:"size-4 animate-spin"}),l[0]||(l[0]=e.createElementVNode("span",null,"Finding the row and action…",-1))])):i.value==="success"?(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("div",G,[e.createVNode(e.unref(b.CheckCircle2),{class:"size-5"}),e.createElementVNode("span",null,e.toDisplayString(k.value?.action?.label||"Row action")+" completed",1)]),l[1]||(l[1]=e.createElementVNode("p",{class:"mt-1 text-xs text-muted-foreground"},"The table’s configured action flow finished successfully.",-1))])):i.value==="cancelled"?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",J,[e.createVNode(e.unref(b.XCircle),{class:"size-5"}),l[2]||(l[2]=e.createElementVNode("span",null,"Action cancelled",-1))]),l[3]||(l[3]=e.createElementVNode("p",{class:"mt-1 text-xs text-muted-foreground"},"No row action was run.",-1))])):i.value==="error"?(e.openBlock(),e.createElementBlock("div",K,[e.createVNode(e.unref(b.AlertTriangle),{class:"mt-0.5 size-4 shrink-0"}),e.createElementVNode("span",null,e.toDisplayString(u.value),1)])):(e.openBlock(),e.createElementBlock("div",Q,[e.createElementVNode("div",W,[e.createElementVNode("div",Y,[e.createElementVNode("div",ee,[e.createVNode(e.unref(b.AlertTriangle),{class:"size-4 text-amber-600 dark:text-amber-400"})]),e.createElementVNode("div",te,[e.createElementVNode("p",le,"Confirm “"+e.toDisplayString(n.value?.label)+"”",1),l[4]||(l[4]=e.createElementVNode("p",{class:"mt-1 text-xs text-muted-foreground"}," This runs the action flow configured on this table and may change external data. ",-1)),o.resolvedArgs?.confirmationMessage?(e.openBlock(),e.createElementBlock("p",oe," Agent note: "+e.toDisplayString(o.resolvedArgs.confirmationMessage),1)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",re,[e.createVNode(f._sfc_main,{title:"Selected row",rows:r.value?[r.value]:[],columns:g.value,view:"card","max-rows":1},null,8,["rows","columns"]),u.value?(e.openBlock(),e.createElementBlock("p",ae,e.toDisplayString(u.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ne,[e.createElementVNode("button",{type:"button",class:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50",disabled:v.value,onClick:L},[v.value?(e.openBlock(),e.createBlock(e.unref(b.Loader2),{key:0,class:"size-3 animate-spin"})):(e.openBlock(),e.createBlock(e.unref(b.Play),{key:1,class:"size-3"})),e.createTextVNode(" "+e.toDisplayString(v.value?"Running…":`Run ${n.value?.label}`),1)],8,se),e.createElementVNode("button",{type:"button",class:"rounded-lg border px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-muted disabled:opacity-50",disabled:v.value,onClick:P}," Cancel ",8,ce)])])]))]))}});exports.default=ue;
|