@airalogy/aimd-editor 1.14.1 → 1.16.0
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/README.md +6 -0
- package/README.zh-CN.md +6 -0
- package/dist/{AimdEditorTopBar.vue_vue_type_script_setup_true_lang-DvxTMJdO.js → AimdEditorTopBar.vue_vue_type_script_setup_true_lang-DqlyxLJI.js} +958 -950
- package/dist/AimdSourceEditor.vue_vue_type_script_setup_true_lang-DdjWUzYX.js +495 -0
- package/dist/{AimdWysiwygEditor.vue_vue_type_script_setup_true_lang-BiW39W8D.js → AimdWysiwygEditor.vue_vue_type_script_setup_true_lang-DuOq6WfS.js} +4343 -4206
- package/dist/aimd-editor.css +1 -1
- package/dist/embedded.js +2 -2
- package/dist/index.js +4 -4
- package/dist/monaco.js +1 -1
- package/dist/{theme-CB0dPzmd.js → theme-5__dt-6K.js} +2 -2
- package/dist/vue.js +3 -3
- package/dist/wysiwyg.js +1 -1
- package/package.json +3 -3
- package/src/__tests__/embedded-images.test.ts +65 -0
- package/src/__tests__/quoted-inline-roundtrip.test.ts +30 -2
- package/src/language-config.ts +2 -2
- package/src/vue/AimdSourceEditor.vue +9 -1
- package/src/vue/AimdWysiwygEditor.vue +2 -0
- package/src/vue/embeddedImages.css +23 -0
- package/src/vue/embeddedImages.ts +61 -0
- package/src/vue/locales.ts +18 -0
- package/src/vue/milkdown-aimd-plugin.ts +57 -37
- package/src/vue/milkdown-embedded-images.ts +77 -0
- package/src/vue/monaco-embedded-images.ts +113 -0
- package/src/vue/useEditorContent.ts +25 -6
- package/dist/AimdSourceEditor.vue_vue_type_script_setup_true_lang-ey9GBO3X.js +0 -424
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { defineComponent as pe, computed as
|
|
1
|
+
import { defineComponent as pe, computed as q, openBlock as h, createElementBlock as b, createElementVNode as i, createTextVNode as L, toDisplayString as m, Fragment as U, renderList as J, unref as Y, createCommentVNode as B, ref as A, watch as Z, createBlock as me, Teleport as Oe, withModifiers as ne, normalizeStyle as Ue, normalizeClass as ye, withDirectives as D, vModelText as P, createVNode as ue, vModelSelect as be, vModelRadio as kt, vModelCheckbox as pt, nextTick as Re, inject as wt, h as tt, resolveDynamicComponent as it, withKeys as nt, shallowRef as Xe, vShow as at } from "vue";
|
|
2
2
|
import { callCommand as Mt, insert as Ye, replaceAll as Le, getMarkdown as ot } from "@milkdown/kit/utils";
|
|
3
3
|
import "@milkdown/theme-nord/style.css";
|
|
4
|
-
import { j as ft, m as ze, k as _t, h as ut,
|
|
5
|
-
import { u as ve, g as lt, f as gt, i as
|
|
6
|
-
import { a as _e, c as
|
|
7
|
-
import { _ as Lt } from "./AimdSourceEditor.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { j as ft, m as ze, k as _t, h as ut, q as xt, s as Tt, t as Ct, u as $t, v as It, w as Ft, x as At, i as zt, l as Vt, _ as Dt, n as St } from "./AimdWysiwygEditor.vue_vue_type_script_setup_true_lang-DuOq6WfS.js";
|
|
5
|
+
import { u as ve, g as lt, f as gt, i as Se, s as Ve, h as De, a as Ze, j as Ge, c as Et, b as rt, p as qt } from "./lexer-DKU2sEoR.js";
|
|
6
|
+
import { a as _e, c as xe, A as ht, b as Bt, u as Nt, d as Pt } from "./fields-CC93ner-.js";
|
|
7
|
+
import { _ as Lt } from "./AimdSourceEditor.vue_vue_type_script_setup_true_lang-DdjWUzYX.js";
|
|
8
8
|
import { protectAimdInlineTemplates as Ut, restoreAimdInlineTemplates as Rt } from "@airalogy/aimd-core";
|
|
9
9
|
import { parseAndExtract as Ot } from "@airalogy/aimd-renderer";
|
|
10
|
-
import {
|
|
11
|
-
|
|
10
|
+
import { editorViewCtx as Ht } from "@milkdown/kit/core";
|
|
11
|
+
import { insertTableCommand as jt } from "@milkdown/kit/preset/gfm";
|
|
12
|
+
var ke = 1e6, dt = 1e6, Ee = "[big.js] ", qe = Ee + "Invalid ", He = qe + "decimal places", Kt = qe + "rounding mode", yt = Ee + "Division by zero", N = {}, re = void 0;
|
|
12
13
|
function we(e, n, t, a) {
|
|
13
14
|
var o = e.c;
|
|
14
|
-
if (t ===
|
|
15
|
-
throw Error(
|
|
15
|
+
if (t === re && (t = e.constructor.RM), t !== 0 && t !== 1 && t !== 2 && t !== 3)
|
|
16
|
+
throw Error(Kt);
|
|
16
17
|
if (n < 1)
|
|
17
|
-
a = t === 3 && (a || !!o[0]) || n === 0 && (t === 1 && o[0] >= 5 || t === 2 && (o[0] > 5 || o[0] === 5 && (a || o[1] !==
|
|
18
|
+
a = t === 3 && (a || !!o[0]) || n === 0 && (t === 1 && o[0] >= 5 || t === 2 && (o[0] > 5 || o[0] === 5 && (a || o[1] !== re))), o.length = 1, a ? (e.e = e.e - n + 1, o[0] = 1) : o[0] = e.e = 0;
|
|
18
19
|
else if (n < o.length) {
|
|
19
|
-
if (a = t === 1 && o[n] >= 5 || t === 2 && (o[n] > 5 || o[n] === 5 && (a || o[n + 1] !==
|
|
20
|
+
if (a = t === 1 && o[n] >= 5 || t === 2 && (o[n] > 5 || o[n] === 5 && (a || o[n + 1] !== re || o[n - 1] & 1)) || t === 3 && (a || !!o[0]), o.length = n, a) {
|
|
20
21
|
for (; ++o[--n] > 9; )
|
|
21
22
|
if (o[n] = 0, n === 0) {
|
|
22
23
|
++e.e, o.unshift(1);
|
|
@@ -41,11 +42,11 @@ function Me(e, n, t) {
|
|
|
41
42
|
else v > 1 && (o = o.charAt(0) + "." + o.slice(1));
|
|
42
43
|
return e.s < 0 && t ? "-" + o : o;
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
+
N.abs = function() {
|
|
45
46
|
var e = new this.constructor(this);
|
|
46
47
|
return e.s = 1, e;
|
|
47
48
|
};
|
|
48
|
-
|
|
49
|
+
N.cmp = function(e) {
|
|
49
50
|
var n, t = this, a = t.c, o = (e = new t.constructor(e)).c, v = t.s, p = e.s, u = t.e, l = e.e;
|
|
50
51
|
if (!a[0] || !o[0]) return a[0] ? v : o[0] ? -p : 0;
|
|
51
52
|
if (v != p) return v;
|
|
@@ -54,7 +55,7 @@ P.cmp = function(e) {
|
|
|
54
55
|
if (a[v] != o[v]) return a[v] > o[v] ^ n ? 1 : -1;
|
|
55
56
|
return u == l ? 0 : u > l ^ n ? 1 : -1;
|
|
56
57
|
};
|
|
57
|
-
|
|
58
|
+
N.div = function(e) {
|
|
58
59
|
var n = this, t = n.constructor, a = n.c, o = (e = new t(e)).c, v = n.s == e.s ? 1 : -1, p = t.DP;
|
|
59
60
|
if (p !== ~~p || p < 0 || p > ke)
|
|
60
61
|
throw Error(He);
|
|
@@ -62,58 +63,58 @@ P.div = function(e) {
|
|
|
62
63
|
throw Error(yt);
|
|
63
64
|
if (!a[0])
|
|
64
65
|
return e.s = v, e.c = [e.e = 0], e;
|
|
65
|
-
var u, l, c,
|
|
66
|
-
for (
|
|
66
|
+
var u, l, c, T, d, M = o.slice(), V = u = o.length, z = a.length, k = a.slice(0, u), w = k.length, I = e, S = I.c = [], $ = 0, F = p + (I.e = n.e - e.e) + 1;
|
|
67
|
+
for (I.s = v, v = F < 0 ? 0 : F, M.unshift(0); w++ < u; ) k.push(0);
|
|
67
68
|
do {
|
|
68
69
|
for (c = 0; c < 10; c++) {
|
|
69
|
-
if (u != (
|
|
70
|
-
|
|
70
|
+
if (u != (w = k.length))
|
|
71
|
+
T = u > w ? 1 : -1;
|
|
71
72
|
else
|
|
72
|
-
for (d = -1,
|
|
73
|
-
if (o[d] !=
|
|
74
|
-
|
|
73
|
+
for (d = -1, T = 0; ++d < u; )
|
|
74
|
+
if (o[d] != k[d]) {
|
|
75
|
+
T = o[d] > k[d] ? 1 : -1;
|
|
75
76
|
break;
|
|
76
77
|
}
|
|
77
|
-
if (
|
|
78
|
-
for (l =
|
|
79
|
-
if (
|
|
80
|
-
for (d =
|
|
81
|
-
--
|
|
78
|
+
if (T < 0) {
|
|
79
|
+
for (l = w == u ? o : M; w; ) {
|
|
80
|
+
if (k[--w] < l[w]) {
|
|
81
|
+
for (d = w; d && !k[--d]; ) k[d] = 9;
|
|
82
|
+
--k[d], k[w] += 10;
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
+
k[w] -= l[w];
|
|
84
85
|
}
|
|
85
|
-
for (; !
|
|
86
|
+
for (; !k[0]; ) k.shift();
|
|
86
87
|
} else
|
|
87
88
|
break;
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
-
} while ((
|
|
91
|
-
return !
|
|
90
|
+
S[$++] = T ? c : ++c, k[0] && T ? k[w] = a[V] || 0 : k = [a[V]];
|
|
91
|
+
} while ((V++ < z || k[0] !== re) && v--);
|
|
92
|
+
return !S[0] && $ != 1 && (S.shift(), I.e--, F--), $ > F && we(I, F, t.RM, k[0] !== re), I;
|
|
92
93
|
};
|
|
93
|
-
|
|
94
|
+
N.eq = function(e) {
|
|
94
95
|
return this.cmp(e) === 0;
|
|
95
96
|
};
|
|
96
|
-
|
|
97
|
+
N.gt = function(e) {
|
|
97
98
|
return this.cmp(e) > 0;
|
|
98
99
|
};
|
|
99
|
-
|
|
100
|
+
N.gte = function(e) {
|
|
100
101
|
return this.cmp(e) > -1;
|
|
101
102
|
};
|
|
102
|
-
|
|
103
|
+
N.lt = function(e) {
|
|
103
104
|
return this.cmp(e) < 0;
|
|
104
105
|
};
|
|
105
|
-
|
|
106
|
+
N.lte = function(e) {
|
|
106
107
|
return this.cmp(e) < 1;
|
|
107
108
|
};
|
|
108
|
-
|
|
109
|
+
N.minus = N.sub = function(e) {
|
|
109
110
|
var n, t, a, o, v = this, p = v.constructor, u = v.s, l = (e = new p(e)).s;
|
|
110
111
|
if (u != l)
|
|
111
112
|
return e.s = -l, v.plus(e);
|
|
112
|
-
var c = v.c.slice(),
|
|
113
|
+
var c = v.c.slice(), T = v.e, d = e.c, M = e.e;
|
|
113
114
|
if (!c[0] || !d[0])
|
|
114
115
|
return d[0] ? e.s = -l : c[0] ? e = new p(v) : e.s = 1, e;
|
|
115
|
-
if (u =
|
|
116
|
-
for ((o = u < 0) ? (u = -u, a = c) : (
|
|
116
|
+
if (u = T - M) {
|
|
117
|
+
for ((o = u < 0) ? (u = -u, a = c) : (M = T, a = d), a.reverse(), l = u; l--; ) a.push(0);
|
|
117
118
|
a.reverse();
|
|
118
119
|
} else
|
|
119
120
|
for (t = ((o = c.length < d.length) ? c : d).length, u = l = 0; l < t; l++)
|
|
@@ -131,20 +132,20 @@ P.minus = P.sub = function(e) {
|
|
|
131
132
|
}
|
|
132
133
|
for (; c[--l] === 0; ) c.pop();
|
|
133
134
|
for (; c[0] === 0; )
|
|
134
|
-
c.shift(), --
|
|
135
|
-
return c[0] || (e.s = 1, c = [
|
|
135
|
+
c.shift(), --M;
|
|
136
|
+
return c[0] || (e.s = 1, c = [M = 0]), e.c = c, e.e = M, e;
|
|
136
137
|
};
|
|
137
|
-
|
|
138
|
+
N.mod = function(e) {
|
|
138
139
|
var n, t = this, a = t.constructor, o = t.s, v = (e = new a(e)).s;
|
|
139
140
|
if (!e.c[0])
|
|
140
141
|
throw Error(yt);
|
|
141
142
|
return t.s = e.s = 1, n = e.cmp(t) == 1, t.s = o, e.s = v, n ? new a(t) : (o = a.DP, v = a.RM, a.DP = a.RM = 0, t = t.div(e), a.DP = o, a.RM = v, this.minus(t.times(e)));
|
|
142
143
|
};
|
|
143
|
-
|
|
144
|
+
N.neg = function() {
|
|
144
145
|
var e = new this.constructor(this);
|
|
145
146
|
return e.s = -e.s, e;
|
|
146
147
|
};
|
|
147
|
-
|
|
148
|
+
N.plus = N.add = function(e) {
|
|
148
149
|
var n, t, a, o = this, v = o.constructor;
|
|
149
150
|
if (e = new v(e), o.s != e.s)
|
|
150
151
|
return e.s = -e.s, o.minus(e);
|
|
@@ -159,7 +160,7 @@ P.plus = P.add = function(e) {
|
|
|
159
160
|
for (t && (u.unshift(t), ++l), n = u.length; u[--n] === 0; ) u.pop();
|
|
160
161
|
return e.c = u, e.e = l, e;
|
|
161
162
|
};
|
|
162
|
-
|
|
163
|
+
N.pow = function(e) {
|
|
163
164
|
var n = this, t = new n.constructor("1"), a = t, o = e < 0;
|
|
164
165
|
if (e !== ~~e || e < -dt || e > dt)
|
|
165
166
|
throw Error(qe + "exponent");
|
|
@@ -167,18 +168,18 @@ P.pow = function(e) {
|
|
|
167
168
|
n = n.times(n);
|
|
168
169
|
return o ? t.div(a) : a;
|
|
169
170
|
};
|
|
170
|
-
|
|
171
|
+
N.prec = function(e, n) {
|
|
171
172
|
if (e !== ~~e || e < 1 || e > ke)
|
|
172
173
|
throw Error(qe + "precision");
|
|
173
174
|
return we(new this.constructor(this), e, n);
|
|
174
175
|
};
|
|
175
|
-
|
|
176
|
-
if (e ===
|
|
176
|
+
N.round = function(e, n) {
|
|
177
|
+
if (e === re) e = 0;
|
|
177
178
|
else if (e !== ~~e || e < -ke || e > ke)
|
|
178
179
|
throw Error(He);
|
|
179
180
|
return we(new this.constructor(this), e + this.e + 1, n);
|
|
180
181
|
};
|
|
181
|
-
|
|
182
|
+
N.sqrt = function() {
|
|
182
183
|
var e, n, t, a = this, o = a.constructor, v = a.s, p = a.e, u = new o("0.5");
|
|
183
184
|
if (!a.c[0]) return new o(a);
|
|
184
185
|
if (v < 0)
|
|
@@ -189,7 +190,7 @@ P.sqrt = function() {
|
|
|
189
190
|
while (t.c.slice(0, p).join("") !== e.c.slice(0, p).join(""));
|
|
190
191
|
return we(e, (o.DP -= 4) + e.e + 1, o.RM);
|
|
191
192
|
};
|
|
192
|
-
|
|
193
|
+
N.times = N.mul = function(e) {
|
|
193
194
|
var n, t = this, a = t.constructor, o = t.c, v = (e = new a(e)).c, p = o.length, u = v.length, l = t.e, c = e.e;
|
|
194
195
|
if (e.s = t.s == e.s ? 1 : -1, !o[0] || !v[0])
|
|
195
196
|
return e.c = [e.e = 0], e;
|
|
@@ -202,50 +203,50 @@ P.times = P.mul = function(e) {
|
|
|
202
203
|
for (u ? ++e.e : n.shift(), l = n.length; !n[--l]; ) n.pop();
|
|
203
204
|
return e.c = n, e;
|
|
204
205
|
};
|
|
205
|
-
|
|
206
|
+
N.toExponential = function(e, n) {
|
|
206
207
|
var t = this, a = t.c[0];
|
|
207
|
-
if (e !==
|
|
208
|
+
if (e !== re) {
|
|
208
209
|
if (e !== ~~e || e < 0 || e > ke)
|
|
209
210
|
throw Error(He);
|
|
210
211
|
for (t = we(new t.constructor(t), ++e, n); t.c.length < e; ) t.c.push(0);
|
|
211
212
|
}
|
|
212
213
|
return Me(t, !0, !!a);
|
|
213
214
|
};
|
|
214
|
-
|
|
215
|
+
N.toFixed = function(e, n) {
|
|
215
216
|
var t = this, a = t.c[0];
|
|
216
|
-
if (e !==
|
|
217
|
+
if (e !== re) {
|
|
217
218
|
if (e !== ~~e || e < 0 || e > ke)
|
|
218
219
|
throw Error(He);
|
|
219
220
|
for (t = we(new t.constructor(t), e + t.e + 1, n), e = e + t.e + 1; t.c.length < e; ) t.c.push(0);
|
|
220
221
|
}
|
|
221
222
|
return Me(t, !1, !!a);
|
|
222
223
|
};
|
|
223
|
-
|
|
224
|
+
N[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = N.toJSON = N.toString = function() {
|
|
224
225
|
var e = this, n = e.constructor;
|
|
225
226
|
return Me(e, e.e <= n.NE || e.e >= n.PE, !!e.c[0]);
|
|
226
227
|
};
|
|
227
|
-
|
|
228
|
+
N.toNumber = function() {
|
|
228
229
|
var e = +Me(this, !0, !0);
|
|
229
230
|
if (this.constructor.strict === !0 && !this.eq(e.toString()))
|
|
230
231
|
throw Error(Ee + "Imprecise conversion");
|
|
231
232
|
return e;
|
|
232
233
|
};
|
|
233
|
-
|
|
234
|
+
N.toPrecision = function(e, n) {
|
|
234
235
|
var t = this, a = t.constructor, o = t.c[0];
|
|
235
|
-
if (e !==
|
|
236
|
+
if (e !== re) {
|
|
236
237
|
if (e !== ~~e || e < 1 || e > ke)
|
|
237
238
|
throw Error(qe + "precision");
|
|
238
239
|
for (t = we(new a(t), e, n); t.c.length < e; ) t.c.push(0);
|
|
239
240
|
}
|
|
240
241
|
return Me(t, e <= t.e || t.e <= a.NE || t.e >= a.PE, !!o);
|
|
241
242
|
};
|
|
242
|
-
|
|
243
|
+
N.valueOf = function() {
|
|
243
244
|
var e = this, n = e.constructor;
|
|
244
245
|
if (n.strict === !0)
|
|
245
246
|
throw Error(Ee + "valueOf disallowed");
|
|
246
247
|
return Me(e, e.e <= n.NE || e.e >= n.PE, !0);
|
|
247
248
|
};
|
|
248
|
-
const
|
|
249
|
+
const Wt = { class: "aimd-type-picker" }, Qt = ["value"], Jt = { value: "" }, Xt = ["label"], Yt = ["value"], Zt = ["label"], Gt = ["value"], el = ["value", "placeholder"], tl = /* @__PURE__ */ pe({
|
|
249
250
|
__name: "AimdTypePicker",
|
|
250
251
|
props: {
|
|
251
252
|
modelValue: {},
|
|
@@ -256,54 +257,54 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
|
|
|
256
257
|
setup(e, { emit: n }) {
|
|
257
258
|
const t = e, a = n, o = gt();
|
|
258
259
|
function v(c) {
|
|
259
|
-
const
|
|
260
|
-
return
|
|
260
|
+
const T = lt(c)?.title;
|
|
261
|
+
return T && T !== c ? `${T} (${c})` : c;
|
|
261
262
|
}
|
|
262
|
-
const p =
|
|
263
|
+
const p = q(() => [...new Map((t.varTypePlugins ?? []).map((c) => [c.value, c])).values()].filter((c) => !o.includes(c.value))), u = q(() => {
|
|
263
264
|
const c = ve(t.modelValue);
|
|
264
|
-
return lt(c)?.type_name ?? (p.value.some((
|
|
265
|
+
return lt(c)?.type_name ?? (p.value.some((T) => T.value === c) ? c : "");
|
|
265
266
|
});
|
|
266
267
|
function l(c) {
|
|
267
|
-
const
|
|
268
|
-
|
|
268
|
+
const T = c.target.value;
|
|
269
|
+
T && a("update:modelValue", T + (Se(t.modelValue) ? " | None" : ""));
|
|
269
270
|
}
|
|
270
|
-
return (c,
|
|
271
|
+
return (c, T) => (h(), b("div", Wt, [
|
|
271
272
|
i("label", null, [
|
|
272
|
-
|
|
273
|
+
L(m(e.messages.inputField.knownTypes) + " ", 1),
|
|
273
274
|
i("select", {
|
|
274
275
|
name: "knownType",
|
|
275
276
|
value: u.value,
|
|
276
277
|
onChange: l
|
|
277
278
|
}, [
|
|
278
|
-
i("option",
|
|
279
|
+
i("option", Jt, m(e.messages.inputField.customExpression), 1),
|
|
279
280
|
i("optgroup", {
|
|
280
281
|
label: e.messages.inputField.builtInTypes
|
|
281
282
|
}, [
|
|
282
|
-
(
|
|
283
|
+
(h(!0), b(U, null, J(Y(o), (d) => (h(), b("option", {
|
|
283
284
|
key: d,
|
|
284
285
|
value: d
|
|
285
|
-
}, m(v(d)), 9,
|
|
286
|
-
], 8,
|
|
287
|
-
p.value.length ? (
|
|
286
|
+
}, m(v(d)), 9, Yt))), 128))
|
|
287
|
+
], 8, Xt),
|
|
288
|
+
p.value.length ? (h(), b("optgroup", {
|
|
288
289
|
key: 0,
|
|
289
290
|
label: e.messages.inputField.pluginTypes
|
|
290
291
|
}, [
|
|
291
|
-
(
|
|
292
|
+
(h(!0), b(U, null, J(p.value, (d) => (h(), b("option", {
|
|
292
293
|
key: d.value,
|
|
293
294
|
value: d.value
|
|
294
|
-
}, m(d.label) + " (" + m(d.value) + ")", 9,
|
|
295
|
-
], 8,
|
|
296
|
-
], 40,
|
|
295
|
+
}, m(d.label) + " (" + m(d.value) + ")", 9, Gt))), 128))
|
|
296
|
+
], 8, Zt)) : B("", !0)
|
|
297
|
+
], 40, Qt)
|
|
297
298
|
]),
|
|
298
299
|
i("label", null, [
|
|
299
|
-
|
|
300
|
+
L(m(e.messages.dialog.customType), 1),
|
|
300
301
|
i("input", {
|
|
301
302
|
name: "type",
|
|
302
303
|
value: e.modelValue,
|
|
303
304
|
placeholder: e.messages.placeholders.type,
|
|
304
305
|
spellcheck: "false",
|
|
305
|
-
onInput:
|
|
306
|
-
}, null, 40,
|
|
306
|
+
onInput: T[0] || (T[0] = (d) => a("update:modelValue", d.target.value))
|
|
307
|
+
}, null, 40, el)
|
|
307
308
|
])
|
|
308
309
|
]));
|
|
309
310
|
}
|
|
@@ -312,28 +313,28 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
|
|
|
312
313
|
for (const [a, o] of n)
|
|
313
314
|
t[a] = o;
|
|
314
315
|
return t;
|
|
315
|
-
}, bt = /* @__PURE__ */ je(
|
|
316
|
+
}, bt = /* @__PURE__ */ je(tl, [["__scopeId", "data-v-be127780"]]), ll = { class: "aimd-dialog" }, sl = { class: "aimd-dialog-header" }, il = { class: "aimd-dialog-title" }, nl = ["innerHTML"], al = { class: "aimd-dialog-type-tabs" }, ol = ["onClick"], ul = ["innerHTML"], rl = { class: "aimd-dialog-body" }, dl = { class: "aimd-field-row" }, cl = { class: "aimd-field-label" }, vl = ["placeholder"], ml = { class: "aimd-field-row" }, pl = { class: "aimd-field-label" }, fl = { class: "aimd-field-hint" }, gl = { class: "aimd-var-type-grid" }, hl = ["onClick"], yl = { class: "aimd-var-type-card-title" }, bl = { class: "aimd-var-type-card-desc" }, kl = { class: "aimd-field-row" }, wl = { class: "aimd-field-label" }, Ml = ["placeholder"], _l = { class: "aimd-field-row" }, xl = { class: "aimd-field-label" }, Tl = ["placeholder"], Cl = { class: "aimd-field-row" }, $l = { class: "aimd-field-label" }, Il = ["placeholder"], Fl = { class: "aimd-field-row" }, Al = { class: "aimd-field-label" }, zl = ["placeholder"], Vl = { class: "aimd-field-hint" }, Dl = { class: "aimd-field-row" }, Sl = { class: "aimd-field-label" }, El = { class: "aimd-field-row" }, ql = { class: "aimd-field-label" }, Bl = ["placeholder"], Nl = { class: "aimd-field-row" }, Pl = { class: "aimd-field-label" }, Ll = { value: "1" }, Ul = { value: "2" }, Rl = { value: "3" }, Ol = { class: "aimd-field-row" }, Hl = { class: "aimd-field-label" }, jl = ["placeholder"], Kl = { class: "aimd-field-row" }, Wl = { class: "aimd-field-label" }, Ql = { value: "choice" }, Jl = { value: "blank" }, Xl = { value: "open" }, Yl = { class: "aimd-field-row" }, Zl = { class: "aimd-field-label" }, Gl = ["placeholder"], es = { class: "aimd-field-row" }, ts = { class: "aimd-field-label" }, ls = ["placeholder"], ss = {
|
|
316
317
|
key: 0,
|
|
317
318
|
class: "aimd-field-hint"
|
|
318
|
-
},
|
|
319
|
+
}, is = { class: "aimd-field-row" }, ns = { class: "aimd-field-label" }, as = { value: "single" }, os = { value: "multiple" }, us = { class: "aimd-field-row" }, rs = { class: "aimd-field-label" }, ds = { class: "aimd-collection-editor" }, cs = ["onDragover", "onDrop"], vs = ["title", "onDragstart"], ms = ["onUpdate:modelValue", "placeholder"], ps = ["onUpdate:modelValue", "placeholder"], fs = { class: "aimd-option-answer-toggle" }, gs = ["value", "disabled"], hs = ["value", "disabled"], ys = ["disabled", "onClick"], bs = { class: "aimd-field-hint" }, ks = {
|
|
319
320
|
key: 1,
|
|
320
321
|
class: "aimd-field-row"
|
|
321
|
-
},
|
|
322
|
+
}, ws = { class: "aimd-field-label" }, Ms = { class: "aimd-collection-editor" }, _s = ["onUpdate:modelValue", "placeholder"], xs = ["onUpdate:modelValue", "placeholder"], Ts = ["disabled", "onClick"], Cs = { class: "aimd-field-hint" }, $s = {
|
|
322
323
|
key: 2,
|
|
323
324
|
class: "aimd-field-row"
|
|
324
|
-
},
|
|
325
|
+
}, Is = { class: "aimd-field-label" }, Fs = ["placeholder"], As = { class: "aimd-field-row" }, zs = { class: "aimd-field-label" }, Vs = { class: "aimd-field-row" }, Ds = { class: "aimd-field-label" }, Ss = ["placeholder"], Es = { class: "aimd-field-row" }, qs = { class: "aimd-field-label" }, Bs = {
|
|
325
326
|
key: 5,
|
|
326
327
|
class: "aimd-field-row"
|
|
327
|
-
},
|
|
328
|
+
}, Ns = { class: "aimd-field-label" }, Ps = ["placeholder"], Ls = { id: "aimd-ref-suggestions" }, Us = ["value"], Rs = {
|
|
328
329
|
key: 0,
|
|
329
330
|
class: "aimd-field-hint"
|
|
330
|
-
},
|
|
331
|
+
}, Os = {
|
|
331
332
|
key: 6,
|
|
332
333
|
class: "aimd-field-row"
|
|
333
|
-
},
|
|
334
|
+
}, Hs = { class: "aimd-field-label" }, js = ["placeholder"], Ks = { class: "aimd-field-hint" }, Ws = { class: "aimd-dialog-preview" }, Qs = { class: "aimd-preview-header" }, Js = { class: "aimd-preview-panel" }, Xs = { class: "aimd-preview-code" }, Ys = {
|
|
334
335
|
key: 7,
|
|
335
336
|
class: "aimd-dialog-error"
|
|
336
|
-
},
|
|
337
|
+
}, Zs = { class: "aimd-dialog-footer" }, Gs = /* @__PURE__ */ pe({
|
|
337
338
|
__name: "AimdFieldDialog",
|
|
338
339
|
props: {
|
|
339
340
|
visible: { type: Boolean },
|
|
@@ -346,481 +347,481 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
|
|
|
346
347
|
},
|
|
347
348
|
emits: ["update:visible", "insert"],
|
|
348
349
|
setup(e, { emit: n }) {
|
|
349
|
-
const t = e, a = n, o =
|
|
350
|
-
const
|
|
350
|
+
const t = e, a = n, o = q(() => {
|
|
351
|
+
const g = ft(t.messages);
|
|
351
352
|
if (!t.allowedTypes || t.allowedTypes.length === 0)
|
|
352
|
-
return
|
|
353
|
+
return g;
|
|
353
354
|
const r = new Set(t.allowedTypes);
|
|
354
|
-
return
|
|
355
|
+
return g.filter((s) => r.has(s.type));
|
|
355
356
|
});
|
|
356
|
-
function v(
|
|
357
|
-
return
|
|
357
|
+
function v(g) {
|
|
358
|
+
return g && o.value.some((r) => r.type === g) ? g : o.value[0]?.type ?? g ?? "var";
|
|
358
359
|
}
|
|
359
|
-
const p =
|
|
360
|
+
const p = q(() => new Set(t.existingQuizIds || [])), u = A(v(t.initialType)), l = A(ze(u.value, t.messages, p.value)), c = A([]), T = A([]), d = A([]), M = A(null), V = A(null), z = A(""), k = q(
|
|
360
361
|
() => _t(t.messages, t.varTypePlugins ?? [])
|
|
361
362
|
);
|
|
362
|
-
function
|
|
363
|
-
return (
|
|
363
|
+
function w(g) {
|
|
364
|
+
return (g || "").trim().toLowerCase().replace(/[\s_-]/g, "");
|
|
364
365
|
}
|
|
365
|
-
function
|
|
366
|
-
return
|
|
366
|
+
function I(g) {
|
|
367
|
+
return w(l.value.type) === w(g);
|
|
367
368
|
}
|
|
368
|
-
function
|
|
369
|
-
l.value.type =
|
|
369
|
+
function S(g) {
|
|
370
|
+
l.value.type = g;
|
|
370
371
|
}
|
|
371
|
-
function
|
|
372
|
-
const s = `quiz_${
|
|
373
|
-
let
|
|
374
|
-
for (; r.has(`${s}_${
|
|
375
|
-
|
|
376
|
-
return `${s}_${
|
|
372
|
+
function $(g, r) {
|
|
373
|
+
const s = `quiz_${g}`;
|
|
374
|
+
let _ = 1;
|
|
375
|
+
for (; r.has(`${s}_${_}`); )
|
|
376
|
+
_ += 1;
|
|
377
|
+
return `${s}_${_}`;
|
|
377
378
|
}
|
|
378
|
-
function
|
|
379
|
-
const r =
|
|
379
|
+
function F(g) {
|
|
380
|
+
const r = g.split(",").map((s) => s.trim()).filter(Boolean);
|
|
380
381
|
return r.length === 0 ? [
|
|
381
382
|
{ key: "A", text: "" },
|
|
382
383
|
{ key: "B", text: "" }
|
|
383
|
-
] : r.map((s,
|
|
384
|
-
const
|
|
385
|
-
if (
|
|
386
|
-
const ge = s.slice(0,
|
|
384
|
+
] : r.map((s, _) => {
|
|
385
|
+
const E = s.indexOf(":");
|
|
386
|
+
if (E > 0) {
|
|
387
|
+
const ge = s.slice(0, E).trim() || String.fromCharCode(65 + _), Be = s.slice(E + 1).trim() || t.messages.defaults.optionText(ge);
|
|
387
388
|
return { key: ge, text: Be };
|
|
388
389
|
}
|
|
389
|
-
return { key: String.fromCharCode(65 +
|
|
390
|
+
return { key: String.fromCharCode(65 + _), text: s };
|
|
390
391
|
});
|
|
391
392
|
}
|
|
392
|
-
function W(
|
|
393
|
-
const r =
|
|
393
|
+
function W(g) {
|
|
394
|
+
const r = g.map((s) => ({ key: s.key.trim(), text: s.text.trim() })).filter((s) => s.key && s.text);
|
|
394
395
|
return r.length === 0 ? "A:, B:" : r.map((s) => `${s.key}:${s.text}`).join(", ");
|
|
395
396
|
}
|
|
396
|
-
function
|
|
397
|
-
const r =
|
|
398
|
-
return r.length === 0 ? [{ key: "b1", answer: "" }] : r.map((s,
|
|
399
|
-
const
|
|
400
|
-
if (
|
|
401
|
-
const Fe = s.slice(0,
|
|
397
|
+
function G(g) {
|
|
398
|
+
const r = g.split(",").map((s) => s.trim()).filter(Boolean);
|
|
399
|
+
return r.length === 0 ? [{ key: "b1", answer: "" }] : r.map((s, _) => {
|
|
400
|
+
const E = s.indexOf(":");
|
|
401
|
+
if (E > 0) {
|
|
402
|
+
const Fe = s.slice(0, E).trim() || `b${_ + 1}`, ge = s.slice(E + 1).trim() || "";
|
|
402
403
|
return { key: Fe, answer: ge };
|
|
403
404
|
}
|
|
404
|
-
return { key: `b${
|
|
405
|
+
return { key: `b${_ + 1}`, answer: s };
|
|
405
406
|
});
|
|
406
407
|
}
|
|
407
|
-
function
|
|
408
|
-
const r =
|
|
408
|
+
function ee(g) {
|
|
409
|
+
const r = g.map((s) => ({ key: s.key.trim(), answer: s.answer.trim() })).filter((s) => s.key);
|
|
409
410
|
return r.length === 0 ? "b1:" : r.map((s) => `${s.key}:${s.answer}`).join(", ");
|
|
410
411
|
}
|
|
411
|
-
function
|
|
412
|
-
return
|
|
412
|
+
function Q(g) {
|
|
413
|
+
return g.split(",").map((r) => r.trim()).filter(Boolean);
|
|
413
414
|
}
|
|
414
|
-
function
|
|
415
|
-
u.value === "quiz" && (l.value.quizType === "choice" ? (c.value =
|
|
415
|
+
function j() {
|
|
416
|
+
u.value === "quiz" && (l.value.quizType === "choice" ? (c.value = F(l.value.options || ""), d.value = Q(l.value.answer || "")) : l.value.quizType === "blank" && (T.value = G(l.value.blanks || "")));
|
|
416
417
|
}
|
|
417
|
-
function
|
|
418
|
+
function O() {
|
|
418
419
|
if (u.value !== "quiz" || l.value.quizType !== "choice") return;
|
|
419
|
-
const
|
|
420
|
+
const g = new Set(
|
|
420
421
|
c.value.map((r) => r.key.trim()).filter(Boolean)
|
|
421
422
|
);
|
|
422
423
|
if (l.value.mode === "multiple") {
|
|
423
|
-
const r = d.value.map((s) => s.trim()).filter((s) => s &&
|
|
424
|
+
const r = d.value.map((s) => s.trim()).filter((s) => s && g.has(s));
|
|
424
425
|
r.length !== d.value.length && (d.value = r);
|
|
425
426
|
} else {
|
|
426
427
|
const r = (l.value.answer || "").trim();
|
|
427
|
-
r && !
|
|
428
|
+
r && !g.has(r) && (l.value.answer = "");
|
|
428
429
|
}
|
|
429
430
|
}
|
|
430
|
-
function
|
|
431
|
-
const
|
|
431
|
+
function K() {
|
|
432
|
+
const g = new Set(
|
|
432
433
|
c.value.map((r) => r.key.trim().toUpperCase()).filter(Boolean)
|
|
433
434
|
);
|
|
434
435
|
for (let r = 0; r < 26; r++) {
|
|
435
436
|
const s = String.fromCharCode(65 + r);
|
|
436
|
-
if (!
|
|
437
|
+
if (!g.has(s)) return s;
|
|
437
438
|
}
|
|
438
439
|
return `K${c.value.length + 1}`;
|
|
439
440
|
}
|
|
440
|
-
function
|
|
441
|
-
const
|
|
442
|
-
c.value.push({ key:
|
|
441
|
+
function ae() {
|
|
442
|
+
const g = K();
|
|
443
|
+
c.value.push({ key: g, text: "" });
|
|
443
444
|
}
|
|
444
|
-
function
|
|
445
|
-
c.value.length <= 1 || c.value.splice(
|
|
445
|
+
function le(g) {
|
|
446
|
+
c.value.length <= 1 || c.value.splice(g, 1);
|
|
446
447
|
}
|
|
447
|
-
function
|
|
448
|
-
|
|
448
|
+
function se(g) {
|
|
449
|
+
M.value = g, V.value = g;
|
|
449
450
|
}
|
|
450
|
-
function
|
|
451
|
-
|
|
451
|
+
function x(g) {
|
|
452
|
+
M.value !== null && (V.value = g);
|
|
452
453
|
}
|
|
453
|
-
function
|
|
454
|
-
const r =
|
|
455
|
-
if (r === null || r ===
|
|
456
|
-
|
|
454
|
+
function f(g) {
|
|
455
|
+
const r = M.value;
|
|
456
|
+
if (r === null || r === g) {
|
|
457
|
+
M.value = null, V.value = null;
|
|
457
458
|
return;
|
|
458
459
|
}
|
|
459
460
|
const s = c.value.splice(r, 1)[0];
|
|
460
|
-
c.value.splice(
|
|
461
|
+
c.value.splice(g, 0, s), M.value = null, V.value = null;
|
|
461
462
|
}
|
|
462
|
-
function
|
|
463
|
-
|
|
463
|
+
function y() {
|
|
464
|
+
M.value = null, V.value = null;
|
|
464
465
|
}
|
|
465
|
-
function
|
|
466
|
-
const
|
|
467
|
-
|
|
466
|
+
function C() {
|
|
467
|
+
const g = new Set(
|
|
468
|
+
T.value.map((s) => s.key.trim().toLowerCase()).filter(Boolean)
|
|
468
469
|
);
|
|
469
470
|
let r = 1;
|
|
470
|
-
for (;
|
|
471
|
+
for (; g.has(`b${r}`); )
|
|
471
472
|
r += 1;
|
|
472
473
|
return `b${r}`;
|
|
473
474
|
}
|
|
474
|
-
function
|
|
475
|
-
|
|
475
|
+
function R() {
|
|
476
|
+
T.value.push({ key: C(), answer: "" });
|
|
476
477
|
}
|
|
477
|
-
function
|
|
478
|
-
|
|
478
|
+
function H(g) {
|
|
479
|
+
T.value.length <= 1 || T.value.splice(g, 1);
|
|
479
480
|
}
|
|
480
|
-
function
|
|
481
|
+
function X(g) {
|
|
481
482
|
const r = /* @__PURE__ */ new Set(), s = [];
|
|
482
|
-
for (const
|
|
483
|
-
r.has(
|
|
483
|
+
for (const _ of g)
|
|
484
|
+
r.has(_) && !s.includes(_) && s.push(_), r.add(_);
|
|
484
485
|
return s;
|
|
485
486
|
}
|
|
486
|
-
function
|
|
487
|
+
function oe(g) {
|
|
487
488
|
const r = [], s = /\[\[([^\[\]\s]+)\]\]/g;
|
|
488
|
-
for (const
|
|
489
|
-
r.push(
|
|
489
|
+
for (const _ of g.matchAll(s))
|
|
490
|
+
r.push(_[1]);
|
|
490
491
|
return r;
|
|
491
492
|
}
|
|
492
|
-
function
|
|
493
|
-
const
|
|
494
|
-
if (
|
|
493
|
+
function ie() {
|
|
494
|
+
const g = T.value.map((Ae) => Ae.key.trim()).filter(Boolean);
|
|
495
|
+
if (g.length === 0)
|
|
495
496
|
return t.messages.errors.blankQuizRequiresBlankKey;
|
|
496
|
-
const r =
|
|
497
|
+
const r = X(g);
|
|
497
498
|
if (r.length > 0)
|
|
498
499
|
return t.messages.errors.blankKeysMustBeUnique(r);
|
|
499
|
-
const s = l.value.stem || "",
|
|
500
|
-
if (
|
|
500
|
+
const s = l.value.stem || "", _ = oe(s);
|
|
501
|
+
if (_.length === 0)
|
|
501
502
|
return t.messages.errors.blankStemRequiresPlaceholders;
|
|
502
|
-
const
|
|
503
|
-
if (
|
|
504
|
-
return t.messages.errors.duplicatePlaceholders(
|
|
505
|
-
const Fe = new Set(
|
|
503
|
+
const E = X(_);
|
|
504
|
+
if (E.length > 0)
|
|
505
|
+
return t.messages.errors.duplicatePlaceholders(E);
|
|
506
|
+
const Fe = new Set(g), ge = new Set(_), Be = [...ge].filter((Ae) => !Fe.has(Ae));
|
|
506
507
|
if (Be.length > 0)
|
|
507
508
|
return t.messages.errors.undefinedPlaceholders(Be);
|
|
508
509
|
const st = [...Fe].filter((Ae) => !ge.has(Ae));
|
|
509
510
|
return st.length > 0 ? t.messages.errors.missingPlaceholders(st) : null;
|
|
510
511
|
}
|
|
511
512
|
function fe() {
|
|
512
|
-
return u.value !== "quiz" || l.value.quizType !== "blank" ? null :
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
const r = v(
|
|
516
|
-
u.value = r, l.value = ze(r, t.messages, p.value),
|
|
517
|
-
}),
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
}),
|
|
521
|
-
|
|
513
|
+
return u.value !== "quiz" || l.value.quizType !== "blank" ? null : ie();
|
|
514
|
+
}
|
|
515
|
+
Z(() => t.initialType, (g) => {
|
|
516
|
+
const r = v(g);
|
|
517
|
+
u.value = r, l.value = ze(r, t.messages, p.value), j(), z.value = "";
|
|
518
|
+
}), Z(o, () => {
|
|
519
|
+
const g = v(u.value);
|
|
520
|
+
g !== u.value && (u.value = g, l.value = ze(g, t.messages, p.value), j(), z.value = "");
|
|
521
|
+
}), Z(() => t.visible, (g) => {
|
|
522
|
+
g && (l.value = ze(u.value, t.messages, p.value), j(), z.value = "");
|
|
522
523
|
});
|
|
523
|
-
function de(
|
|
524
|
-
const r = v(
|
|
525
|
-
u.value = r, l.value = ze(r, t.messages, p.value),
|
|
526
|
-
}
|
|
527
|
-
const
|
|
528
|
-
function Ke(
|
|
529
|
-
return o.value.find((r) => r.type ===
|
|
530
|
-
}
|
|
531
|
-
const Ce =
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
}),
|
|
535
|
-
|
|
536
|
-
}),
|
|
537
|
-
u.value === "quiz" && l.value.quizType === "choice" && (l.value.options = W(
|
|
538
|
-
}, { deep: !0 }),
|
|
539
|
-
u.value === "quiz" && l.value.quizType === "blank" && (l.value.blanks =
|
|
540
|
-
}, { deep: !0 }),
|
|
541
|
-
u.value === "quiz" && l.value.quizType === "choice" && l.value.mode === "multiple" && (l.value.answer =
|
|
542
|
-
}, { deep: !0 }),
|
|
543
|
-
|
|
544
|
-
}, { deep: !0 }),
|
|
545
|
-
|
|
524
|
+
function de(g) {
|
|
525
|
+
const r = v(g);
|
|
526
|
+
u.value = r, l.value = ze(r, t.messages, p.value), j(), z.value = "";
|
|
527
|
+
}
|
|
528
|
+
const Te = q(() => ut(u.value, l.value, t.messages));
|
|
529
|
+
function Ke(g) {
|
|
530
|
+
return o.value.find((r) => r.type === g) || { type: g, label: g, icon: "?", svgIcon: "", desc: "", color: "#666" };
|
|
531
|
+
}
|
|
532
|
+
const Ce = q(() => Ke(u.value)), $e = q(() => t.refSuggestions ? t.refSuggestions : []), We = q(() => u.value === "ref_step" ? t.messages.dialog.referencedStepId : u.value === "ref_var" ? t.messages.dialog.referencedVariableId : t.messages.dialog.referencedFigureId), Qe = q(() => u.value === "ref_step" ? "step_id" : u.value === "ref_var" ? "var_id" : "fig_id");
|
|
533
|
+
Z(() => [u.value, l.value.quizType], ([g, r], [s, _]) => {
|
|
534
|
+
g === "quiz" && (g !== s || r !== _) && (r !== _ && _ && (l.value.id = $(r, p.value), r === "choice" ? (l.value.stem = t.messages.defaults.questionStem, l.value.mode = "single", l.value.options = "A:, B:", l.value.answer = "A", l.value.blanks = "", l.value.rubric = "") : r === "blank" ? (l.value.stem = t.messages.defaults.fillQuestionStem, l.value.blanks = "b1:", l.value.options = "", l.value.answer = "", l.value.mode = "", l.value.rubric = "", T.value = [{ key: "b1", answer: "" }]) : r === "open" && (l.value.stem = t.messages.defaults.fillQuestionStem, l.value.rubric = "", l.value.options = "", l.value.answer = "", l.value.blanks = "", l.value.mode = "")), j());
|
|
535
|
+
}), Z(() => l.value.mode, () => {
|
|
536
|
+
O();
|
|
537
|
+
}), Z(c, (g) => {
|
|
538
|
+
u.value === "quiz" && l.value.quizType === "choice" && (l.value.options = W(g), O());
|
|
539
|
+
}, { deep: !0 }), Z(T, (g) => {
|
|
540
|
+
u.value === "quiz" && l.value.quizType === "blank" && (l.value.blanks = ee(g));
|
|
541
|
+
}, { deep: !0 }), Z(d, (g) => {
|
|
542
|
+
u.value === "quiz" && l.value.quizType === "choice" && l.value.mode === "multiple" && (l.value.answer = g.join(", "));
|
|
543
|
+
}, { deep: !0 }), Z(l, () => {
|
|
544
|
+
z.value && (z.value = "");
|
|
545
|
+
}, { deep: !0 }), Z(T, () => {
|
|
546
|
+
z.value && (z.value = "");
|
|
546
547
|
}, { deep: !0 });
|
|
547
548
|
function Je() {
|
|
548
|
-
const
|
|
549
|
-
if (
|
|
550
|
-
|
|
549
|
+
const g = fe();
|
|
550
|
+
if (g) {
|
|
551
|
+
z.value = g;
|
|
551
552
|
return;
|
|
552
553
|
}
|
|
553
|
-
|
|
554
|
+
z.value = "", a("insert", ut(u.value, l.value, t.messages)), a("update:visible", !1);
|
|
554
555
|
}
|
|
555
556
|
function Ie() {
|
|
556
557
|
a("update:visible", !1);
|
|
557
558
|
}
|
|
558
|
-
return (
|
|
559
|
-
e.visible ? (
|
|
559
|
+
return (g, r) => (h(), me(Oe, { to: "body" }, [
|
|
560
|
+
e.visible ? (h(), b("div", {
|
|
560
561
|
key: 0,
|
|
561
562
|
class: "aimd-dialog-overlay",
|
|
562
|
-
onClick:
|
|
563
|
+
onClick: ne(Ie, ["self"])
|
|
563
564
|
}, [
|
|
564
|
-
i("div",
|
|
565
|
-
i("div",
|
|
566
|
-
i("span",
|
|
565
|
+
i("div", ll, [
|
|
566
|
+
i("div", sl, [
|
|
567
|
+
i("span", il, [
|
|
567
568
|
i("span", {
|
|
568
569
|
class: "aimd-dialog-icon",
|
|
569
570
|
style: Ue({ color: Ce.value.color }),
|
|
570
571
|
innerHTML: Ce.value.svgIcon
|
|
571
|
-
}, null, 12,
|
|
572
|
-
|
|
572
|
+
}, null, 12, nl),
|
|
573
|
+
L(" " + m(t.messages.dialog.title(Ce.value.label)), 1)
|
|
573
574
|
]),
|
|
574
575
|
i("button", {
|
|
575
576
|
class: "aimd-dialog-close",
|
|
576
577
|
onClick: Ie
|
|
577
578
|
}, "×")
|
|
578
579
|
]),
|
|
579
|
-
i("div",
|
|
580
|
-
(
|
|
580
|
+
i("div", al, [
|
|
581
|
+
(h(!0), b(U, null, J(o.value, (s) => (h(), b("button", {
|
|
581
582
|
key: s.type,
|
|
582
583
|
class: ye(["aimd-type-tab", { active: u.value === s.type }]),
|
|
583
584
|
style: Ue(u.value === s.type ? { borderColor: s.color, color: s.color, background: `${s.color}14` } : {}),
|
|
584
|
-
onClick: (
|
|
585
|
+
onClick: (_) => de(s.type)
|
|
585
586
|
}, [
|
|
586
587
|
i("span", {
|
|
587
588
|
innerHTML: s.svgIcon,
|
|
588
589
|
class: "aimd-type-tab-icon"
|
|
589
|
-
}, null, 8,
|
|
590
|
-
|
|
591
|
-
], 14,
|
|
590
|
+
}, null, 8, ul),
|
|
591
|
+
L(" " + m(s.label), 1)
|
|
592
|
+
], 14, ol))), 128))
|
|
592
593
|
]),
|
|
593
|
-
i("div",
|
|
594
|
-
u.value === "var" ? (
|
|
595
|
-
i("label",
|
|
596
|
-
i("span",
|
|
597
|
-
|
|
594
|
+
i("div", rl, [
|
|
595
|
+
u.value === "var" ? (h(), b(U, { key: 0 }, [
|
|
596
|
+
i("label", dl, [
|
|
597
|
+
i("span", cl, [
|
|
598
|
+
L(m(t.messages.dialog.variableId) + " ", 1),
|
|
598
599
|
r[22] || (r[22] = i("em", null, "*", -1))
|
|
599
600
|
]),
|
|
600
601
|
D(i("input", {
|
|
601
602
|
"onUpdate:modelValue": r[0] || (r[0] = (s) => l.value.name = s),
|
|
602
603
|
placeholder: t.messages.placeholders.variableId,
|
|
603
604
|
class: "aimd-field-input"
|
|
604
|
-
}, null, 8,
|
|
605
|
-
[
|
|
605
|
+
}, null, 8, vl), [
|
|
606
|
+
[P, l.value.name]
|
|
606
607
|
])
|
|
607
608
|
]),
|
|
608
|
-
i("div",
|
|
609
|
-
i("span",
|
|
610
|
-
i("span",
|
|
611
|
-
i("div",
|
|
612
|
-
(
|
|
609
|
+
i("div", ml, [
|
|
610
|
+
i("span", pl, m(t.messages.dialog.typePresetLabel), 1),
|
|
611
|
+
i("span", fl, m(t.messages.dialog.typeHint), 1),
|
|
612
|
+
i("div", gl, [
|
|
613
|
+
(h(!0), b(U, null, J(k.value, (s) => (h(), b("button", {
|
|
613
614
|
key: s.key,
|
|
614
615
|
type: "button",
|
|
615
|
-
class: ye(["aimd-var-type-card", { active:
|
|
616
|
-
onClick: (
|
|
616
|
+
class: ye(["aimd-var-type-card", { active: I(s.value) }]),
|
|
617
|
+
onClick: (_) => S(s.value)
|
|
617
618
|
}, [
|
|
618
|
-
i("span",
|
|
619
|
-
i("span",
|
|
620
|
-
], 10,
|
|
619
|
+
i("span", yl, m(s.label), 1),
|
|
620
|
+
i("span", bl, m(s.desc), 1)
|
|
621
|
+
], 10, hl))), 128))
|
|
621
622
|
])
|
|
622
623
|
]),
|
|
623
|
-
|
|
624
|
+
ue(bt, {
|
|
624
625
|
modelValue: l.value.type,
|
|
625
626
|
"onUpdate:modelValue": r[1] || (r[1] = (s) => l.value.type = s),
|
|
626
627
|
messages: e.messages,
|
|
627
628
|
"var-type-plugins": e.varTypePlugins
|
|
628
629
|
}, null, 8, ["modelValue", "messages", "var-type-plugins"]),
|
|
629
|
-
i("label",
|
|
630
|
-
i("span",
|
|
630
|
+
i("label", kl, [
|
|
631
|
+
i("span", wl, m(t.messages.dialog.defaultValue), 1),
|
|
631
632
|
D(i("input", {
|
|
632
633
|
"onUpdate:modelValue": r[2] || (r[2] = (s) => l.value.default = s),
|
|
633
634
|
placeholder: t.messages.placeholders.defaultValue,
|
|
634
635
|
class: "aimd-field-input"
|
|
635
|
-
}, null, 8,
|
|
636
|
-
[
|
|
636
|
+
}, null, 8, Ml), [
|
|
637
|
+
[P, l.value.default]
|
|
637
638
|
])
|
|
638
639
|
]),
|
|
639
|
-
i("label",
|
|
640
|
-
i("span",
|
|
640
|
+
i("label", _l, [
|
|
641
|
+
i("span", xl, m(t.messages.dialog.titleLabel), 1),
|
|
641
642
|
D(i("input", {
|
|
642
643
|
"onUpdate:modelValue": r[3] || (r[3] = (s) => l.value.title = s),
|
|
643
644
|
placeholder: t.messages.placeholders.title,
|
|
644
645
|
class: "aimd-field-input"
|
|
645
646
|
}, null, 8, Tl), [
|
|
646
|
-
[
|
|
647
|
+
[P, l.value.title]
|
|
647
648
|
])
|
|
648
649
|
])
|
|
649
|
-
], 64)) :
|
|
650
|
-
u.value === "var_table" ? (
|
|
651
|
-
i("label",
|
|
652
|
-
i("span",
|
|
653
|
-
|
|
650
|
+
], 64)) : B("", !0),
|
|
651
|
+
u.value === "var_table" ? (h(), b(U, { key: 1 }, [
|
|
652
|
+
i("label", Cl, [
|
|
653
|
+
i("span", $l, [
|
|
654
|
+
L(m(t.messages.dialog.tableId) + " ", 1),
|
|
654
655
|
r[23] || (r[23] = i("em", null, "*", -1))
|
|
655
656
|
]),
|
|
656
657
|
D(i("input", {
|
|
657
658
|
"onUpdate:modelValue": r[4] || (r[4] = (s) => l.value.name = s),
|
|
658
659
|
placeholder: t.messages.placeholders.tableId,
|
|
659
660
|
class: "aimd-field-input"
|
|
660
|
-
}, null, 8,
|
|
661
|
-
[
|
|
661
|
+
}, null, 8, Il), [
|
|
662
|
+
[P, l.value.name]
|
|
662
663
|
])
|
|
663
664
|
]),
|
|
664
|
-
i("label",
|
|
665
|
-
i("span",
|
|
665
|
+
i("label", Fl, [
|
|
666
|
+
i("span", Al, m(t.messages.dialog.subVariableColumns), 1),
|
|
666
667
|
D(i("input", {
|
|
667
668
|
"onUpdate:modelValue": r[5] || (r[5] = (s) => l.value.subvars = s),
|
|
668
669
|
placeholder: t.messages.placeholders.subVariableColumns,
|
|
669
670
|
class: "aimd-field-input"
|
|
670
|
-
}, null, 8,
|
|
671
|
-
[
|
|
671
|
+
}, null, 8, zl), [
|
|
672
|
+
[P, l.value.subvars]
|
|
672
673
|
]),
|
|
673
|
-
i("span",
|
|
674
|
+
i("span", Vl, m(t.messages.dialog.subVariableColumnsHint), 1)
|
|
674
675
|
])
|
|
675
|
-
], 64)) :
|
|
676
|
-
u.value === "step" ? (
|
|
677
|
-
i("label",
|
|
676
|
+
], 64)) : B("", !0),
|
|
677
|
+
u.value === "step" ? (h(), b(U, { key: 2 }, [
|
|
678
|
+
i("label", Dl, [
|
|
678
679
|
i("span", Sl, m(t.messages.stepField.name), 1),
|
|
679
680
|
D(i("input", {
|
|
680
681
|
"onUpdate:modelValue": r[6] || (r[6] = (s) => l.value.title = s),
|
|
681
682
|
class: "aimd-field-input"
|
|
682
683
|
}, null, 512), [
|
|
683
|
-
[
|
|
684
|
+
[P, l.value.title]
|
|
684
685
|
])
|
|
685
686
|
]),
|
|
686
|
-
i("label",
|
|
687
|
-
i("span",
|
|
688
|
-
|
|
687
|
+
i("label", El, [
|
|
688
|
+
i("span", ql, [
|
|
689
|
+
L(m(t.messages.dialog.stepId) + " ", 1),
|
|
689
690
|
r[24] || (r[24] = i("em", null, "*", -1))
|
|
690
691
|
]),
|
|
691
692
|
D(i("input", {
|
|
692
693
|
"onUpdate:modelValue": r[7] || (r[7] = (s) => l.value.name = s),
|
|
693
694
|
placeholder: t.messages.placeholders.stepId,
|
|
694
695
|
class: "aimd-field-input"
|
|
695
|
-
}, null, 8,
|
|
696
|
-
[
|
|
696
|
+
}, null, 8, Bl), [
|
|
697
|
+
[P, l.value.name]
|
|
697
698
|
])
|
|
698
699
|
]),
|
|
699
|
-
i("label",
|
|
700
|
-
i("span",
|
|
700
|
+
i("label", Nl, [
|
|
701
|
+
i("span", Pl, m(t.messages.dialog.level), 1),
|
|
701
702
|
D(i("select", {
|
|
702
703
|
"onUpdate:modelValue": r[8] || (r[8] = (s) => l.value.level = s),
|
|
703
704
|
class: "aimd-field-input"
|
|
704
705
|
}, [
|
|
705
|
-
i("option",
|
|
706
|
-
i("option",
|
|
707
|
-
i("option",
|
|
706
|
+
i("option", Ll, m(t.messages.dialog.level1), 1),
|
|
707
|
+
i("option", Ul, m(t.messages.dialog.level2), 1),
|
|
708
|
+
i("option", Rl, m(t.messages.dialog.level3), 1)
|
|
708
709
|
], 512), [
|
|
709
710
|
[be, l.value.level]
|
|
710
711
|
])
|
|
711
712
|
])
|
|
712
|
-
], 64)) :
|
|
713
|
-
u.value === "quiz" ? (
|
|
714
|
-
i("label",
|
|
715
|
-
i("span",
|
|
716
|
-
|
|
713
|
+
], 64)) : B("", !0),
|
|
714
|
+
u.value === "quiz" ? (h(), b(U, { key: 3 }, [
|
|
715
|
+
i("label", Ol, [
|
|
716
|
+
i("span", Hl, [
|
|
717
|
+
L(m(t.messages.dialog.quizId) + " ", 1),
|
|
717
718
|
r[25] || (r[25] = i("em", null, "*", -1))
|
|
718
719
|
]),
|
|
719
720
|
D(i("input", {
|
|
720
721
|
"onUpdate:modelValue": r[9] || (r[9] = (s) => l.value.id = s),
|
|
721
722
|
placeholder: t.messages.placeholders.quizId,
|
|
722
723
|
class: "aimd-field-input"
|
|
723
|
-
}, null, 8,
|
|
724
|
-
[
|
|
724
|
+
}, null, 8, jl), [
|
|
725
|
+
[P, l.value.id]
|
|
725
726
|
])
|
|
726
727
|
]),
|
|
727
|
-
i("label",
|
|
728
|
-
i("span",
|
|
728
|
+
i("label", Kl, [
|
|
729
|
+
i("span", Wl, m(t.messages.dialog.questionType), 1),
|
|
729
730
|
D(i("select", {
|
|
730
731
|
"onUpdate:modelValue": r[10] || (r[10] = (s) => l.value.quizType = s),
|
|
731
732
|
class: "aimd-field-input"
|
|
732
733
|
}, [
|
|
733
|
-
i("option",
|
|
734
|
-
i("option",
|
|
735
|
-
i("option",
|
|
734
|
+
i("option", Ql, m(t.messages.quiz.types.choice), 1),
|
|
735
|
+
i("option", Jl, m(t.messages.quiz.types.blank), 1),
|
|
736
|
+
i("option", Xl, m(t.messages.quiz.types.open), 1)
|
|
736
737
|
], 512), [
|
|
737
738
|
[be, l.value.quizType]
|
|
738
739
|
])
|
|
739
740
|
]),
|
|
740
|
-
i("label",
|
|
741
|
-
i("span",
|
|
741
|
+
i("label", Yl, [
|
|
742
|
+
i("span", Zl, m(t.messages.dialog.score), 1),
|
|
742
743
|
D(i("input", {
|
|
743
744
|
"onUpdate:modelValue": r[11] || (r[11] = (s) => l.value.score = s),
|
|
744
745
|
placeholder: t.messages.placeholders.score,
|
|
745
746
|
class: "aimd-field-input"
|
|
746
|
-
}, null, 8,
|
|
747
|
-
[
|
|
747
|
+
}, null, 8, Gl), [
|
|
748
|
+
[P, l.value.score]
|
|
748
749
|
])
|
|
749
750
|
]),
|
|
750
|
-
i("label",
|
|
751
|
-
i("span",
|
|
752
|
-
|
|
751
|
+
i("label", es, [
|
|
752
|
+
i("span", ts, [
|
|
753
|
+
L(m(t.messages.dialog.stem) + " ", 1),
|
|
753
754
|
r[26] || (r[26] = i("em", null, "*", -1))
|
|
754
755
|
]),
|
|
755
756
|
D(i("textarea", {
|
|
756
757
|
"onUpdate:modelValue": r[12] || (r[12] = (s) => l.value.stem = s),
|
|
757
758
|
placeholder: t.messages.placeholders.stem,
|
|
758
759
|
class: "aimd-field-input aimd-field-textarea"
|
|
759
|
-
}, null, 8,
|
|
760
|
-
[
|
|
760
|
+
}, null, 8, ls), [
|
|
761
|
+
[P, l.value.stem]
|
|
761
762
|
]),
|
|
762
|
-
l.value.quizType === "blank" ? (
|
|
763
|
+
l.value.quizType === "blank" ? (h(), b("span", ss, m(t.messages.dialog.blankStemHint), 1)) : B("", !0)
|
|
763
764
|
]),
|
|
764
|
-
l.value.quizType === "choice" ? (
|
|
765
|
-
i("label",
|
|
766
|
-
i("span",
|
|
765
|
+
l.value.quizType === "choice" ? (h(), b(U, { key: 0 }, [
|
|
766
|
+
i("label", is, [
|
|
767
|
+
i("span", ns, m(t.messages.dialog.mode), 1),
|
|
767
768
|
D(i("select", {
|
|
768
769
|
"onUpdate:modelValue": r[13] || (r[13] = (s) => l.value.mode = s),
|
|
769
770
|
class: "aimd-field-input"
|
|
770
771
|
}, [
|
|
771
|
-
i("option",
|
|
772
|
-
i("option",
|
|
772
|
+
i("option", as, m(t.messages.quiz.modes.single), 1),
|
|
773
|
+
i("option", os, m(t.messages.quiz.modes.multiple), 1)
|
|
773
774
|
], 512), [
|
|
774
775
|
[be, l.value.mode]
|
|
775
776
|
])
|
|
776
777
|
]),
|
|
777
|
-
i("div",
|
|
778
|
-
i("span",
|
|
779
|
-
i("div",
|
|
780
|
-
(
|
|
781
|
-
key: `choice-option-${
|
|
782
|
-
class: ye(["aimd-collection-row aimd-option-row", { "aimd-option-row-dragover":
|
|
783
|
-
onDragover:
|
|
784
|
-
onDrop:
|
|
778
|
+
i("div", us, [
|
|
779
|
+
i("span", rs, m(t.messages.dialog.options), 1),
|
|
780
|
+
i("div", ds, [
|
|
781
|
+
(h(!0), b(U, null, J(c.value, (s, _) => (h(), b("div", {
|
|
782
|
+
key: `choice-option-${_}`,
|
|
783
|
+
class: ye(["aimd-collection-row aimd-option-row", { "aimd-option-row-dragover": V.value === _ && M.value !== null && M.value !== _ }]),
|
|
784
|
+
onDragover: ne((E) => x(_), ["prevent"]),
|
|
785
|
+
onDrop: ne((E) => f(_), ["prevent"])
|
|
785
786
|
}, [
|
|
786
787
|
i("span", {
|
|
787
788
|
class: "aimd-drag-handle",
|
|
788
789
|
title: t.messages.dialog.dragToReorder,
|
|
789
790
|
draggable: "true",
|
|
790
|
-
onDragstart: (
|
|
791
|
-
onDragend:
|
|
792
|
-
}, " ⋮⋮ ", 40,
|
|
791
|
+
onDragstart: (E) => se(_),
|
|
792
|
+
onDragend: y
|
|
793
|
+
}, " ⋮⋮ ", 40, vs),
|
|
793
794
|
D(i("input", {
|
|
794
|
-
"onUpdate:modelValue": (
|
|
795
|
+
"onUpdate:modelValue": (E) => s.key = E,
|
|
795
796
|
placeholder: t.messages.placeholders.optionKey,
|
|
796
797
|
class: "aimd-field-input"
|
|
797
|
-
}, null, 8,
|
|
798
|
-
[
|
|
798
|
+
}, null, 8, ms), [
|
|
799
|
+
[P, s.key]
|
|
799
800
|
]),
|
|
800
801
|
D(i("input", {
|
|
801
|
-
"onUpdate:modelValue": (
|
|
802
|
+
"onUpdate:modelValue": (E) => s.text = E,
|
|
802
803
|
placeholder: t.messages.placeholders.optionText,
|
|
803
804
|
class: "aimd-field-input"
|
|
804
|
-
}, null, 8,
|
|
805
|
-
[
|
|
805
|
+
}, null, 8, ps), [
|
|
806
|
+
[P, s.text]
|
|
806
807
|
]),
|
|
807
|
-
i("label",
|
|
808
|
-
l.value.mode === "single" ? D((
|
|
808
|
+
i("label", fs, [
|
|
809
|
+
l.value.mode === "single" ? D((h(), b("input", {
|
|
809
810
|
key: 0,
|
|
810
|
-
"onUpdate:modelValue": r[14] || (r[14] = (
|
|
811
|
+
"onUpdate:modelValue": r[14] || (r[14] = (E) => l.value.answer = E),
|
|
811
812
|
type: "radio",
|
|
812
813
|
name: "aimd-quiz-choice-answer",
|
|
813
814
|
value: s.key.trim(),
|
|
814
815
|
disabled: !s.key.trim()
|
|
815
|
-
}, null, 8,
|
|
816
|
+
}, null, 8, gs)), [
|
|
816
817
|
[kt, l.value.answer]
|
|
817
|
-
]) : D((
|
|
818
|
+
]) : D((h(), b("input", {
|
|
818
819
|
key: 1,
|
|
819
|
-
"onUpdate:modelValue": r[15] || (r[15] = (
|
|
820
|
+
"onUpdate:modelValue": r[15] || (r[15] = (E) => d.value = E),
|
|
820
821
|
type: "checkbox",
|
|
821
822
|
value: s.key.trim(),
|
|
822
823
|
disabled: !s.key.trim()
|
|
823
|
-
}, null, 8,
|
|
824
|
+
}, null, 8, hs)), [
|
|
824
825
|
[pt, d.value]
|
|
825
826
|
]),
|
|
826
827
|
i("span", null, m(t.messages.dialog.correctAnswer), 1)
|
|
@@ -829,76 +830,76 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
|
|
|
829
830
|
type: "button",
|
|
830
831
|
class: "aimd-mini-btn",
|
|
831
832
|
disabled: c.value.length <= 1,
|
|
832
|
-
onClick: (
|
|
833
|
-
}, m(t.messages.common.remove), 9,
|
|
834
|
-
], 42,
|
|
833
|
+
onClick: (E) => le(_)
|
|
834
|
+
}, m(t.messages.common.remove), 9, ys)
|
|
835
|
+
], 42, cs))), 128)),
|
|
835
836
|
i("button", {
|
|
836
837
|
type: "button",
|
|
837
838
|
class: "aimd-mini-btn aimd-mini-btn-add",
|
|
838
|
-
onClick:
|
|
839
|
+
onClick: ae
|
|
839
840
|
}, m(t.messages.actions.addOption), 1)
|
|
840
841
|
]),
|
|
841
|
-
i("span",
|
|
842
|
+
i("span", bs, m(t.messages.dialog.optionsHint), 1)
|
|
842
843
|
])
|
|
843
|
-
], 64)) : l.value.quizType === "blank" ? (
|
|
844
|
-
i("span",
|
|
845
|
-
i("div",
|
|
846
|
-
(
|
|
847
|
-
key: `blank-item-${
|
|
844
|
+
], 64)) : l.value.quizType === "blank" ? (h(), b("div", ks, [
|
|
845
|
+
i("span", ws, m(t.messages.dialog.blanks), 1),
|
|
846
|
+
i("div", Ms, [
|
|
847
|
+
(h(!0), b(U, null, J(T.value, (s, _) => (h(), b("div", {
|
|
848
|
+
key: `blank-item-${_}`,
|
|
848
849
|
class: "aimd-collection-row"
|
|
849
850
|
}, [
|
|
850
851
|
D(i("input", {
|
|
851
|
-
"onUpdate:modelValue": (
|
|
852
|
+
"onUpdate:modelValue": (E) => s.key = E,
|
|
852
853
|
placeholder: t.messages.placeholders.blankKey,
|
|
853
854
|
class: "aimd-field-input"
|
|
854
|
-
}, null, 8,
|
|
855
|
-
[
|
|
855
|
+
}, null, 8, _s), [
|
|
856
|
+
[P, s.key]
|
|
856
857
|
]),
|
|
857
858
|
D(i("input", {
|
|
858
|
-
"onUpdate:modelValue": (
|
|
859
|
+
"onUpdate:modelValue": (E) => s.answer = E,
|
|
859
860
|
placeholder: t.messages.placeholders.blankAnswer,
|
|
860
861
|
class: "aimd-field-input"
|
|
861
|
-
}, null, 8,
|
|
862
|
-
[
|
|
862
|
+
}, null, 8, xs), [
|
|
863
|
+
[P, s.answer]
|
|
863
864
|
]),
|
|
864
865
|
i("button", {
|
|
865
866
|
type: "button",
|
|
866
867
|
class: "aimd-mini-btn",
|
|
867
|
-
disabled:
|
|
868
|
-
onClick: (
|
|
868
|
+
disabled: T.value.length <= 1,
|
|
869
|
+
onClick: (E) => H(_)
|
|
869
870
|
}, m(t.messages.common.remove), 9, Ts)
|
|
870
871
|
]))), 128)),
|
|
871
872
|
i("button", {
|
|
872
873
|
type: "button",
|
|
873
874
|
class: "aimd-mini-btn aimd-mini-btn-add",
|
|
874
|
-
onClick:
|
|
875
|
+
onClick: R
|
|
875
876
|
}, m(t.messages.actions.addBlank), 1)
|
|
876
877
|
]),
|
|
877
|
-
i("span",
|
|
878
|
-
])) : (
|
|
879
|
-
i("span",
|
|
878
|
+
i("span", Cs, m(t.messages.dialog.blanksHint), 1)
|
|
879
|
+
])) : (h(), b("label", $s, [
|
|
880
|
+
i("span", Is, m(t.messages.dialog.rubric), 1),
|
|
880
881
|
D(i("textarea", {
|
|
881
882
|
"onUpdate:modelValue": r[16] || (r[16] = (s) => l.value.rubric = s),
|
|
882
883
|
placeholder: t.messages.placeholders.rubric,
|
|
883
884
|
class: "aimd-field-input aimd-field-textarea"
|
|
884
|
-
}, null, 8,
|
|
885
|
-
[
|
|
885
|
+
}, null, 8, Fs), [
|
|
886
|
+
[P, l.value.rubric]
|
|
886
887
|
])
|
|
887
888
|
]))
|
|
888
|
-
], 64)) :
|
|
889
|
-
u.value === "check" ? (
|
|
890
|
-
i("label",
|
|
891
|
-
i("span",
|
|
889
|
+
], 64)) : B("", !0),
|
|
890
|
+
u.value === "check" ? (h(), b(U, { key: 4 }, [
|
|
891
|
+
i("label", As, [
|
|
892
|
+
i("span", zs, m(t.messages.checkField.name), 1),
|
|
892
893
|
D(i("input", {
|
|
893
894
|
"onUpdate:modelValue": r[17] || (r[17] = (s) => l.value.title = s),
|
|
894
895
|
class: "aimd-field-input"
|
|
895
896
|
}, null, 512), [
|
|
896
|
-
[
|
|
897
|
+
[P, l.value.title]
|
|
897
898
|
])
|
|
898
899
|
]),
|
|
899
|
-
i("label",
|
|
900
|
-
i("span",
|
|
901
|
-
|
|
900
|
+
i("label", Vs, [
|
|
901
|
+
i("span", Ds, [
|
|
902
|
+
L(m(t.messages.dialog.checkpointId) + " ", 1),
|
|
902
903
|
r[27] || (r[27] = i("em", null, "*", -1))
|
|
903
904
|
]),
|
|
904
905
|
D(i("input", {
|
|
@@ -906,22 +907,22 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
|
|
|
906
907
|
placeholder: t.messages.placeholders.checkpointId,
|
|
907
908
|
class: "aimd-field-input"
|
|
908
909
|
}, null, 8, Ss), [
|
|
909
|
-
[
|
|
910
|
+
[P, l.value.name]
|
|
910
911
|
])
|
|
911
912
|
]),
|
|
912
|
-
i("label",
|
|
913
|
-
i("span",
|
|
913
|
+
i("label", Es, [
|
|
914
|
+
i("span", qs, m(t.messages.checkField.checkedMessage), 1),
|
|
914
915
|
D(i("input", {
|
|
915
916
|
"onUpdate:modelValue": r[19] || (r[19] = (s) => l.value.checkedMessage = s),
|
|
916
917
|
class: "aimd-field-input"
|
|
917
918
|
}, null, 512), [
|
|
918
|
-
[
|
|
919
|
+
[P, l.value.checkedMessage]
|
|
919
920
|
])
|
|
920
921
|
])
|
|
921
|
-
], 64)) :
|
|
922
|
-
["ref_step", "ref_var", "ref_fig"].includes(u.value) ? (
|
|
923
|
-
i("span",
|
|
924
|
-
|
|
922
|
+
], 64)) : B("", !0),
|
|
923
|
+
["ref_step", "ref_var", "ref_fig"].includes(u.value) ? (h(), b("label", Bs, [
|
|
924
|
+
i("span", Ns, [
|
|
925
|
+
L(m(We.value) + " ", 1),
|
|
925
926
|
r[28] || (r[28] = i("em", null, "*", -1))
|
|
926
927
|
]),
|
|
927
928
|
D(i("input", {
|
|
@@ -929,40 +930,40 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
|
|
|
929
930
|
placeholder: Qe.value,
|
|
930
931
|
class: "aimd-field-input",
|
|
931
932
|
list: "aimd-ref-suggestions"
|
|
932
|
-
}, null, 8,
|
|
933
|
-
[
|
|
933
|
+
}, null, 8, Ps), [
|
|
934
|
+
[P, l.value.name]
|
|
934
935
|
]),
|
|
935
|
-
i("datalist",
|
|
936
|
-
(
|
|
936
|
+
i("datalist", Ls, [
|
|
937
|
+
(h(!0), b(U, null, J($e.value, (s) => (h(), b("option", {
|
|
937
938
|
key: s,
|
|
938
939
|
value: s
|
|
939
|
-
}, null, 8,
|
|
940
|
+
}, null, 8, Us))), 128))
|
|
940
941
|
]),
|
|
941
|
-
$e.value.length ? (
|
|
942
|
-
])) :
|
|
943
|
-
u.value === "cite" ? (
|
|
944
|
-
i("span",
|
|
945
|
-
|
|
942
|
+
$e.value.length ? (h(), b("span", Rs, m(t.messages.common.available) + ": " + m($e.value.join(", ")), 1)) : B("", !0)
|
|
943
|
+
])) : B("", !0),
|
|
944
|
+
u.value === "cite" ? (h(), b("label", Os, [
|
|
945
|
+
i("span", Hs, [
|
|
946
|
+
L(m(t.messages.dialog.citationId) + " ", 1),
|
|
946
947
|
r[29] || (r[29] = i("em", null, "*", -1))
|
|
947
948
|
]),
|
|
948
949
|
D(i("input", {
|
|
949
950
|
"onUpdate:modelValue": r[21] || (r[21] = (s) => l.value.refs = s),
|
|
950
951
|
placeholder: t.messages.placeholders.citationIds,
|
|
951
952
|
class: "aimd-field-input"
|
|
952
|
-
}, null, 8,
|
|
953
|
-
[
|
|
953
|
+
}, null, 8, js), [
|
|
954
|
+
[P, l.value.refs]
|
|
954
955
|
]),
|
|
955
|
-
i("span",
|
|
956
|
-
])) :
|
|
957
|
-
i("div",
|
|
958
|
-
i("div",
|
|
959
|
-
i("pre",
|
|
960
|
-
i("code",
|
|
956
|
+
i("span", Ks, m(t.messages.dialog.citationHint), 1)
|
|
957
|
+
])) : B("", !0),
|
|
958
|
+
i("div", Ws, [
|
|
959
|
+
i("div", Qs, m(t.messages.common.preview), 1),
|
|
960
|
+
i("pre", Js, [
|
|
961
|
+
i("code", Xs, m(Te.value), 1)
|
|
961
962
|
])
|
|
962
963
|
]),
|
|
963
|
-
|
|
964
|
+
z.value ? (h(), b("div", Ys, m(z.value), 1)) : B("", !0)
|
|
964
965
|
]),
|
|
965
|
-
i("div",
|
|
966
|
+
i("div", Zs, [
|
|
966
967
|
i("button", {
|
|
967
968
|
class: "aimd-btn aimd-btn-cancel",
|
|
968
969
|
onClick: Ie
|
|
@@ -973,17 +974,17 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
|
|
|
973
974
|
}, m(t.messages.common.insert), 1)
|
|
974
975
|
])
|
|
975
976
|
])
|
|
976
|
-
])) :
|
|
977
|
+
])) : B("", !0)
|
|
977
978
|
]));
|
|
978
979
|
}
|
|
979
|
-
}),
|
|
980
|
+
}), ei = ["aria-label"], ti = ["value"], li = { class: "aimd-input-dialog__required" }, si = ["checked"], ii = { key: 0 }, ni = { key: 1 }, ai = ["value"], oi = ["value"], ui = ["size"], ri = ["value", "selected"], di = { value: "" }, ci = ["value"], vi = ["value", "type", "step", "placeholder"], mi = ["open"], pi = {
|
|
980
981
|
key: 3,
|
|
981
982
|
class: "aimd-input-dialog__error",
|
|
982
983
|
role: "alert"
|
|
983
|
-
},
|
|
984
|
+
}, fi = {
|
|
984
985
|
type: "submit",
|
|
985
986
|
class: "aimd-input-dialog__save"
|
|
986
|
-
}, ce = "bool | None", Ne = "Literal[True, False]",
|
|
987
|
+
}, ce = "bool | None", Ne = "Literal[True, False]", gi = /* @__PURE__ */ pe({
|
|
987
988
|
__name: "AimdInputFieldDialog",
|
|
988
989
|
props: {
|
|
989
990
|
visible: { type: Boolean },
|
|
@@ -996,27 +997,27 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
|
|
|
996
997
|
},
|
|
997
998
|
emits: ["update:visible", "save"],
|
|
998
999
|
setup(e, { emit: n }) {
|
|
999
|
-
const t = e, a = n, o =
|
|
1000
|
-
const
|
|
1001
|
-
return Array.isArray(
|
|
1000
|
+
const t = e, a = n, o = A(), v = A(), p = A(""), u = A(""), l = A("str"), c = A(""), T = A(""), d = A("str"), M = A(""), V = A(!1), z = A(), k = A(!1), w = q(() => z.value ?? !Se(l.value)), I = q(() => T.value.split(/\r?\n/).map((f) => f.trim()).filter(Boolean)), S = q(() => /^(?:(?:typing|typing_extensions)\.)?Optional\[/.test(l.value.trim()) ? Ve(Ve(l.value, !1), !0) : ""), $ = q(() => {
|
|
1001
|
+
const f = De(c.value);
|
|
1002
|
+
return Array.isArray(f) ? f : [];
|
|
1002
1003
|
});
|
|
1003
|
-
function
|
|
1004
|
-
const
|
|
1005
|
-
c.value =
|
|
1004
|
+
function F(f) {
|
|
1005
|
+
const y = Array.from(f.target.selectedOptions, (C) => C.value);
|
|
1006
|
+
c.value = y.length ? JSON.stringify(y) : w.value ? "" : "None";
|
|
1006
1007
|
}
|
|
1007
|
-
const W =
|
|
1008
|
-
function
|
|
1009
|
-
const
|
|
1010
|
-
return W.value.find(([
|
|
1008
|
+
const W = q(() => d.value === ce || d.value === "bool" ? [["True", t.messages.inputField.yes], ["False", t.messages.inputField.no]] : d.value === "choice" ? I.value.map((f) => [JSON.stringify(f), f]) : []);
|
|
1009
|
+
function G(f) {
|
|
1010
|
+
const y = De(f);
|
|
1011
|
+
return W.value.find(([C]) => Object.is(De(C), y))?.[0];
|
|
1011
1012
|
}
|
|
1012
|
-
const
|
|
1013
|
+
const ee = q(() => ["str", "date", "time", "datetime"].includes(d.value)), Q = q(() => d.value === "int" || d.value === "float" ? "number" : d.value === "date" || d.value === "time" ? d.value : "text"), j = q({
|
|
1013
1014
|
get() {
|
|
1014
|
-
return c.value === "None" ? "" :
|
|
1015
|
+
return c.value === "None" ? "" : ee.value && /^(['"]).*\1$/s.test(c.value) ? String(De(c.value)) : W.value.length && c.value ? G(c.value) ?? c.value : c.value;
|
|
1015
1016
|
},
|
|
1016
|
-
set(
|
|
1017
|
-
c.value =
|
|
1017
|
+
set(f) {
|
|
1018
|
+
c.value = f === "" ? w.value ? "" : "None" : ee.value ? JSON.stringify(f) : f;
|
|
1018
1019
|
}
|
|
1019
|
-
}),
|
|
1020
|
+
}), O = gt().filter((f) => lt(f)?.storage_kind === "file-id"), K = q(() => [
|
|
1020
1021
|
["str", t.messages.inputField.text],
|
|
1021
1022
|
["int", t.messages.inputField.integer],
|
|
1022
1023
|
["float", t.messages.inputField.number],
|
|
@@ -1029,234 +1030,234 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
|
|
|
1029
1030
|
["datetime", t.messages.inputField.datetime],
|
|
1030
1031
|
["file", t.messages.inputField.file],
|
|
1031
1032
|
["list[str]", t.messages.inputField.list],
|
|
1032
|
-
...(t.varTypePlugins ?? []).map((
|
|
1033
|
+
...(t.varTypePlugins ?? []).map((f) => [f.value, f.label]),
|
|
1033
1034
|
["custom", t.messages.inputField.custom]
|
|
1034
1035
|
]);
|
|
1035
|
-
|
|
1036
|
-
if (!
|
|
1036
|
+
Z(() => t.visible, async (f) => {
|
|
1037
|
+
if (!f) {
|
|
1037
1038
|
o.value?.close();
|
|
1038
1039
|
return;
|
|
1039
1040
|
}
|
|
1040
|
-
const
|
|
1041
|
-
p.value =
|
|
1042
|
-
const
|
|
1043
|
-
d.value = l.value === Ne ||
|
|
1044
|
-
const
|
|
1041
|
+
const y = t.fieldContent ? Ze(t.fieldContent) : void 0;
|
|
1042
|
+
p.value = y?.id ?? _e([...xe(t.content), ...t.reservedIds ?? []]), u.value = typeof y?.kwargs?.title == "string" ? y.kwargs.title : "", l.value = y?.type ?? (t.initialPreset === "file" ? "FileIdPDF" : ["choice", "multiple-choice", "custom"].includes(t.initialPreset ?? "") ? "str" : t.initialPreset ?? "str"), c.value = y?.defaultRaw ?? "", z.value = typeof y?.kwargs?.required == "boolean" ? y.kwargs.required : void 0, k.value = !1;
|
|
1043
|
+
const C = ve(l.value);
|
|
1044
|
+
d.value = l.value === Ne || C === "bool" && Se(l.value) ? ce : K.value.some(([ie]) => ie === C) ? C : "custom";
|
|
1045
|
+
const R = Ge(l.value), H = R.length ? R : y?.enum, oe = (Array.isArray(y?.kwargs?.enum) || /^(?:(?:typing|typing_extensions)\.)?(?:(?:list|List)\s*\[\s*(?:(?:typing|typing_extensions)\.)?)?Literal\s*\[/.test(ve(l.value))) && Array.isArray(H) && H.every((ie) => typeof ie == "string" && !ie.includes(`
|
|
1045
1046
|
`));
|
|
1046
|
-
|
|
1047
|
-
`) : "",
|
|
1047
|
+
oe && (d.value = R.length ? "multiple-choice" : "choice"), O.includes(ve(l.value)) && (d.value = "file"), !y && t.initialPreset && (d.value = t.initialPreset), !y && d.value === ce && (l.value = Ne), T.value = oe ? H.join(`
|
|
1048
|
+
`) : "", V.value = d.value === "custom", M.value = "", await Re(), o.value?.showModal(), v.value?.focus();
|
|
1048
1049
|
}, { immediate: !0 });
|
|
1049
|
-
function
|
|
1050
|
-
const
|
|
1051
|
-
d.value === ce ? l.value =
|
|
1050
|
+
function ae() {
|
|
1051
|
+
const f = !w.value;
|
|
1052
|
+
d.value === ce ? l.value = f ? ce : Ne : ["custom", "choice", "multiple-choice", "file"].includes(d.value) || (l.value = Ve(d.value, f)), d.value === "file" && !O.includes(ve(l.value)) && (l.value = Ve("FileIdPDF", f)), d.value === "custom" && (V.value = !0);
|
|
1052
1053
|
}
|
|
1053
|
-
function
|
|
1054
|
-
|
|
1054
|
+
function le(f) {
|
|
1055
|
+
k.value = !0, z.value = void 0, d.value === ce ? l.value = f ? Ne : ce : l.value = Ve(l.value, !f), d.value === "bool" && !f && (d.value = ce), f && c.value === "None" && (c.value = ""), !f && !c.value.trim() && (c.value = "None");
|
|
1055
1056
|
}
|
|
1056
|
-
function
|
|
1057
|
-
l.value =
|
|
1057
|
+
function se(f) {
|
|
1058
|
+
l.value = f.target.value + (Se(l.value) ? " | None" : "");
|
|
1058
1059
|
}
|
|
1059
|
-
function
|
|
1060
|
-
const
|
|
1061
|
-
if (!ht.test(
|
|
1062
|
-
|
|
1060
|
+
function x() {
|
|
1061
|
+
const f = /* @__PURE__ */ new Set([...xe(t.content), ...t.reservedIds ?? []]), y = t.fieldContent ? Ze(t.fieldContent) : void 0, C = y?.id, R = p.value.trim() || _e(f);
|
|
1062
|
+
if (!ht.test(R)) {
|
|
1063
|
+
M.value = t.messages.inputField.invalidId, V.value = !0;
|
|
1063
1064
|
return;
|
|
1064
1065
|
}
|
|
1065
|
-
if (
|
|
1066
|
-
|
|
1066
|
+
if (R !== C && f.has(R)) {
|
|
1067
|
+
M.value = t.messages.inputField.duplicateId, V.value = !0;
|
|
1067
1068
|
return;
|
|
1068
1069
|
}
|
|
1069
|
-
let
|
|
1070
|
+
let H = l.value;
|
|
1070
1071
|
if (d.value === "choice" || d.value === "multiple-choice") {
|
|
1071
|
-
if (!
|
|
1072
|
-
|
|
1072
|
+
if (!I.value.length || new Set(I.value).size !== I.value.length) {
|
|
1073
|
+
M.value = t.messages.inputField.invalidOptions;
|
|
1073
1074
|
return;
|
|
1074
1075
|
}
|
|
1075
|
-
|
|
1076
|
-
const de = d.value === "multiple-choice" ? Ge(
|
|
1077
|
-
|
|
1076
|
+
H = `Literal[${I.value.map((Te) => JSON.stringify(Te)).join(", ")}]`, d.value === "multiple-choice" && (H = `list[${H}]`), Se(l.value) && (H += " | None");
|
|
1077
|
+
const de = d.value === "multiple-choice" ? Ge(y?.type) : y?.enum;
|
|
1078
|
+
y?.type === l.value && !y?.kwargs?.enum && JSON.stringify(I.value) === JSON.stringify(de) && Ge(y.type).length > 0 == (d.value === "multiple-choice") && (H = l.value);
|
|
1078
1079
|
}
|
|
1079
|
-
const
|
|
1080
|
-
if (
|
|
1081
|
-
|
|
1080
|
+
const X = c.value.trim(), oe = d.value === "multiple-choice" && X && X !== "None" && (!Array.isArray(De(X)) || $.value.some((de) => !I.value.includes(de)));
|
|
1081
|
+
if (w.value && X === "None" || W.value.length && X && X !== "None" && !G(X) || oe) {
|
|
1082
|
+
M.value = t.messages.inputField.invalidDefault;
|
|
1082
1083
|
return;
|
|
1083
1084
|
}
|
|
1084
|
-
const
|
|
1085
|
-
id:
|
|
1086
|
-
type:
|
|
1085
|
+
const ie = Bt(t.fieldContent, {
|
|
1086
|
+
id: R,
|
|
1087
|
+
type: H,
|
|
1087
1088
|
title: u.value,
|
|
1088
|
-
defaultRaw:
|
|
1089
|
-
clearRequiredOverride:
|
|
1090
|
-
clearEnum: d.value === "choice" || d.value === "multiple-choice" || ve(
|
|
1091
|
-
}), fe = Et(Ze(
|
|
1089
|
+
defaultRaw: X,
|
|
1090
|
+
clearRequiredOverride: k.value,
|
|
1091
|
+
clearEnum: d.value === "choice" || d.value === "multiple-choice" || ve(H) !== ve(y?.type)
|
|
1092
|
+
}), fe = Et(Ze(ie));
|
|
1092
1093
|
if (fe.length) {
|
|
1093
|
-
|
|
1094
|
+
M.value = fe.join(" "), V.value = !0;
|
|
1094
1095
|
return;
|
|
1095
1096
|
}
|
|
1096
|
-
a("save",
|
|
1097
|
+
a("save", ie), a("update:visible", !1);
|
|
1097
1098
|
}
|
|
1098
|
-
return (
|
|
1099
|
+
return (f, y) => (h(), me(Oe, { to: "body" }, [
|
|
1099
1100
|
i("dialog", {
|
|
1100
1101
|
ref_key: "dialog",
|
|
1101
1102
|
ref: o,
|
|
1102
1103
|
class: "aimd-input-dialog",
|
|
1103
1104
|
"aria-label": e.fieldContent ? e.messages.inputField.edit : e.messages.inputField.insert,
|
|
1104
|
-
onClose:
|
|
1105
|
-
onCancel:
|
|
1105
|
+
onClose: y[12] || (y[12] = (C) => a("update:visible", !1)),
|
|
1106
|
+
onCancel: y[13] || (y[13] = (C) => a("update:visible", !1))
|
|
1106
1107
|
}, [
|
|
1107
1108
|
i("form", {
|
|
1108
|
-
onSubmit:
|
|
1109
|
+
onSubmit: ne(x, ["prevent"])
|
|
1109
1110
|
}, [
|
|
1110
1111
|
i("h2", null, m(e.fieldContent ? e.messages.inputField.edit : e.messages.inputField.insert), 1),
|
|
1111
1112
|
i("label", null, [
|
|
1112
|
-
|
|
1113
|
+
L(m(e.messages.inputField.name), 1),
|
|
1113
1114
|
D(i("input", {
|
|
1114
1115
|
ref_key: "nameInput",
|
|
1115
1116
|
ref: v,
|
|
1116
|
-
"onUpdate:modelValue":
|
|
1117
|
+
"onUpdate:modelValue": y[0] || (y[0] = (C) => u.value = C),
|
|
1117
1118
|
name: "title",
|
|
1118
1119
|
autocomplete: "off"
|
|
1119
1120
|
}, null, 512), [
|
|
1120
|
-
[
|
|
1121
|
+
[P, u.value]
|
|
1121
1122
|
])
|
|
1122
1123
|
]),
|
|
1123
1124
|
i("label", null, [
|
|
1124
|
-
|
|
1125
|
+
L(m(e.messages.dialog.type) + " ", 1),
|
|
1125
1126
|
D(i("select", {
|
|
1126
|
-
"onUpdate:modelValue":
|
|
1127
|
+
"onUpdate:modelValue": y[1] || (y[1] = (C) => d.value = C),
|
|
1127
1128
|
name: "preset",
|
|
1128
|
-
onChange:
|
|
1129
|
+
onChange: ae
|
|
1129
1130
|
}, [
|
|
1130
|
-
(
|
|
1131
|
-
key:
|
|
1132
|
-
value:
|
|
1133
|
-
}, m(
|
|
1131
|
+
(h(!0), b(U, null, J(K.value, ([C, R]) => (h(), b("option", {
|
|
1132
|
+
key: C,
|
|
1133
|
+
value: C
|
|
1134
|
+
}, m(R), 9, ti))), 128))
|
|
1134
1135
|
], 544), [
|
|
1135
1136
|
[be, d.value]
|
|
1136
1137
|
])
|
|
1137
1138
|
]),
|
|
1138
|
-
i("label",
|
|
1139
|
-
|
|
1139
|
+
i("label", li, [
|
|
1140
|
+
L(m(e.messages.inputField.required) + " ", 1),
|
|
1140
1141
|
i("input", {
|
|
1141
1142
|
name: "required",
|
|
1142
1143
|
type: "checkbox",
|
|
1143
1144
|
role: "switch",
|
|
1144
|
-
checked:
|
|
1145
|
-
onChange:
|
|
1146
|
-
}, null, 40,
|
|
1145
|
+
checked: w.value,
|
|
1146
|
+
onChange: y[2] || (y[2] = (C) => le(C.target.checked))
|
|
1147
|
+
}, null, 40, si)
|
|
1147
1148
|
]),
|
|
1148
|
-
d.value === "choice" || d.value === "multiple-choice" ? (
|
|
1149
|
-
|
|
1149
|
+
d.value === "choice" || d.value === "multiple-choice" ? (h(), b("label", ii, [
|
|
1150
|
+
L(m(e.messages.inputField.options), 1),
|
|
1150
1151
|
D(i("textarea", {
|
|
1151
|
-
"onUpdate:modelValue":
|
|
1152
|
+
"onUpdate:modelValue": y[3] || (y[3] = (C) => T.value = C),
|
|
1152
1153
|
name: "options",
|
|
1153
1154
|
rows: "4"
|
|
1154
1155
|
}, null, 512), [
|
|
1155
|
-
[
|
|
1156
|
+
[P, T.value]
|
|
1156
1157
|
])
|
|
1157
|
-
])) :
|
|
1158
|
-
d.value === "file" ? (
|
|
1159
|
-
|
|
1158
|
+
])) : B("", !0),
|
|
1159
|
+
d.value === "file" ? (h(), b("label", ni, [
|
|
1160
|
+
L(m(e.messages.inputField.fileFormat), 1),
|
|
1160
1161
|
i("select", {
|
|
1161
1162
|
name: "fileType",
|
|
1162
|
-
value:
|
|
1163
|
-
onChange:
|
|
1163
|
+
value: Y(ve)(l.value),
|
|
1164
|
+
onChange: se
|
|
1164
1165
|
}, [
|
|
1165
|
-
(
|
|
1166
|
-
key:
|
|
1167
|
-
value:
|
|
1168
|
-
}, m(
|
|
1169
|
-
], 40,
|
|
1170
|
-
])) :
|
|
1166
|
+
(h(!0), b(U, null, J(Y(O), (C) => (h(), b("option", {
|
|
1167
|
+
key: C,
|
|
1168
|
+
value: C
|
|
1169
|
+
}, m(C.replace(/^FileId/, "")), 9, oi))), 128))
|
|
1170
|
+
], 40, ai)
|
|
1171
|
+
])) : B("", !0),
|
|
1171
1172
|
i("label", null, [
|
|
1172
|
-
|
|
1173
|
-
d.value === "multiple-choice" ? (
|
|
1173
|
+
L(m(e.messages.dialog.defaultValue) + " ", 1),
|
|
1174
|
+
d.value === "multiple-choice" ? (h(), b("select", {
|
|
1174
1175
|
key: 0,
|
|
1175
1176
|
name: "default",
|
|
1176
1177
|
multiple: "",
|
|
1177
|
-
size: Math.min(4, Math.max(2,
|
|
1178
|
-
onChange:
|
|
1178
|
+
size: Math.min(4, Math.max(2, I.value.length)),
|
|
1179
|
+
onChange: F
|
|
1179
1180
|
}, [
|
|
1180
|
-
(
|
|
1181
|
-
key:
|
|
1182
|
-
value:
|
|
1183
|
-
selected:
|
|
1184
|
-
}, m(
|
|
1185
|
-
], 40,
|
|
1181
|
+
(h(!0), b(U, null, J(I.value, (C) => (h(), b("option", {
|
|
1182
|
+
key: C,
|
|
1183
|
+
value: C,
|
|
1184
|
+
selected: $.value.includes(C)
|
|
1185
|
+
}, m(C), 9, ri))), 128))
|
|
1186
|
+
], 40, ui)) : W.value.length || d.value === "choice" ? D((h(), b("select", {
|
|
1186
1187
|
key: 1,
|
|
1187
|
-
"onUpdate:modelValue":
|
|
1188
|
+
"onUpdate:modelValue": y[4] || (y[4] = (C) => j.value = C),
|
|
1188
1189
|
name: "default"
|
|
1189
1190
|
}, [
|
|
1190
|
-
i("option",
|
|
1191
|
-
(
|
|
1192
|
-
key:
|
|
1193
|
-
value:
|
|
1194
|
-
}, m(
|
|
1191
|
+
i("option", di, m(e.messages.inputField.noDefault), 1),
|
|
1192
|
+
(h(!0), b(U, null, J(W.value, ([C, R]) => (h(), b("option", {
|
|
1193
|
+
key: C,
|
|
1194
|
+
value: C
|
|
1195
|
+
}, m(R), 9, ci))), 128))
|
|
1195
1196
|
], 512)), [
|
|
1196
|
-
[be,
|
|
1197
|
-
]) : (
|
|
1197
|
+
[be, j.value]
|
|
1198
|
+
]) : (h(), b("input", {
|
|
1198
1199
|
key: 2,
|
|
1199
|
-
value:
|
|
1200
|
+
value: j.value,
|
|
1200
1201
|
name: "default",
|
|
1201
|
-
type:
|
|
1202
|
+
type: Q.value,
|
|
1202
1203
|
step: d.value === "float" ? "any" : void 0,
|
|
1203
1204
|
placeholder: e.messages.inputField.noDefault,
|
|
1204
|
-
onInput:
|
|
1205
|
-
}, null, 40,
|
|
1205
|
+
onInput: y[5] || (y[5] = (C) => j.value = C.target.value)
|
|
1206
|
+
}, null, 40, vi))
|
|
1206
1207
|
]),
|
|
1207
|
-
|
|
1208
|
+
S.value ? (h(), b("button", {
|
|
1208
1209
|
key: 2,
|
|
1209
1210
|
type: "button",
|
|
1210
|
-
onClick:
|
|
1211
|
-
}, m(e.messages.inputField.useType(
|
|
1211
|
+
onClick: y[6] || (y[6] = (C) => l.value = S.value)
|
|
1212
|
+
}, m(e.messages.inputField.useType(S.value)), 1)) : B("", !0),
|
|
1212
1213
|
i("details", {
|
|
1213
|
-
open:
|
|
1214
|
-
onToggle:
|
|
1214
|
+
open: V.value,
|
|
1215
|
+
onToggle: y[10] || (y[10] = (C) => V.value = C.target.open)
|
|
1215
1216
|
}, [
|
|
1216
1217
|
i("summary", null, m(e.messages.inputField.advanced), 1),
|
|
1217
1218
|
i("label", null, [
|
|
1218
|
-
|
|
1219
|
+
L(m(e.messages.inputField.id), 1),
|
|
1219
1220
|
D(i("input", {
|
|
1220
|
-
"onUpdate:modelValue":
|
|
1221
|
+
"onUpdate:modelValue": y[7] || (y[7] = (C) => p.value = C),
|
|
1221
1222
|
name: "id",
|
|
1222
1223
|
autocomplete: "off",
|
|
1223
1224
|
spellcheck: "false"
|
|
1224
1225
|
}, null, 512), [
|
|
1225
|
-
[
|
|
1226
|
+
[P, p.value]
|
|
1226
1227
|
])
|
|
1227
1228
|
]),
|
|
1228
|
-
|
|
1229
|
+
ue(bt, {
|
|
1229
1230
|
modelValue: l.value,
|
|
1230
1231
|
"onUpdate:modelValue": [
|
|
1231
|
-
|
|
1232
|
-
|
|
1232
|
+
y[8] || (y[8] = (C) => l.value = C),
|
|
1233
|
+
y[9] || (y[9] = (C) => d.value = "custom")
|
|
1233
1234
|
],
|
|
1234
1235
|
messages: e.messages,
|
|
1235
1236
|
"var-type-plugins": e.varTypePlugins
|
|
1236
1237
|
}, null, 8, ["modelValue", "messages", "var-type-plugins"])
|
|
1237
|
-
], 40,
|
|
1238
|
-
|
|
1238
|
+
], 40, mi),
|
|
1239
|
+
M.value ? (h(), b("p", pi, m(M.value), 1)) : B("", !0),
|
|
1239
1240
|
i("footer", null, [
|
|
1240
1241
|
i("button", {
|
|
1241
1242
|
type: "button",
|
|
1242
|
-
onClick:
|
|
1243
|
+
onClick: y[11] || (y[11] = (C) => a("update:visible", !1))
|
|
1243
1244
|
}, m(e.messages.common.cancel), 1),
|
|
1244
|
-
i("button",
|
|
1245
|
+
i("button", fi, m(e.fieldContent ? e.messages.inputField.save : e.messages.common.insert), 1)
|
|
1245
1246
|
])
|
|
1246
1247
|
], 32)
|
|
1247
|
-
], 40,
|
|
1248
|
+
], 40, ei)
|
|
1248
1249
|
]));
|
|
1249
1250
|
}
|
|
1250
|
-
}),
|
|
1251
|
+
}), hi = /* @__PURE__ */ je(gi, [["__scopeId", "data-v-e4307a72"]]), yi = ["aria-label"], bi = {
|
|
1251
1252
|
key: 0,
|
|
1252
1253
|
class: "aimd-step-dialog__check"
|
|
1253
|
-
},
|
|
1254
|
+
}, ki = ["open"], wi = ["readonly"], Mi = { key: 0 }, _i = ["value"], xi = { value: "elapsed" }, Ti = { value: "countdown" }, Ci = { value: "both" }, $i = {
|
|
1254
1255
|
key: 1,
|
|
1255
1256
|
role: "alert"
|
|
1256
|
-
},
|
|
1257
|
+
}, Ii = {
|
|
1257
1258
|
type: "submit",
|
|
1258
1259
|
class: "aimd-step-dialog__save"
|
|
1259
|
-
},
|
|
1260
|
+
}, Fi = /* @__PURE__ */ pe({
|
|
1260
1261
|
__name: "AimdStepFieldDialog",
|
|
1261
1262
|
props: {
|
|
1262
1263
|
visible: { type: Boolean },
|
|
@@ -1268,149 +1269,149 @@ const Kt = { class: "aimd-type-picker" }, Wt = ["value"], Qt = { value: "" }, Jt
|
|
|
1268
1269
|
},
|
|
1269
1270
|
emits: ["update:visible", "save"],
|
|
1270
1271
|
setup(e, { emit: n }) {
|
|
1271
|
-
const t = e, a = n, o =
|
|
1272
|
-
|
|
1273
|
-
if (!
|
|
1272
|
+
const t = e, a = n, o = A(), v = A(), p = A(""), u = A(""), l = A(1), c = A(!0), T = A(""), d = A("elapsed"), M = A(""), V = A(!1), z = A(""), k = q(() => t.fieldType === "check"), w = q(() => k.value ? t.messages.checkField : t.messages.stepField);
|
|
1273
|
+
Z(() => t.visible, async (S) => {
|
|
1274
|
+
if (!S) {
|
|
1274
1275
|
o.value?.close();
|
|
1275
1276
|
return;
|
|
1276
1277
|
}
|
|
1277
|
-
const
|
|
1278
|
-
p.value = (
|
|
1278
|
+
const $ = t.fieldContent && !k.value ? rt(t.fieldContent) : void 0, F = t.fieldContent && k.value ? qt(t.fieldContent) : void 0;
|
|
1279
|
+
p.value = (F ?? $)?.id ?? _e([...xe(t.content), ...t.reservedIds ?? []], k.value ? "check" : "step"), u.value = (F ?? $)?.title ?? "", z.value = F?.checked_message ?? "", l.value = $?.level ?? 1, c.value = $?.check ?? !0, T.value = String($?.props.duration ?? ""), d.value = $?.timer_mode ?? "elapsed", M.value = "", V.value = !1, await Re(), o.value?.showModal(), v.value?.focus();
|
|
1279
1280
|
}, { immediate: !0 });
|
|
1280
|
-
function
|
|
1281
|
-
const
|
|
1282
|
-
if (!ht.test(
|
|
1283
|
-
|
|
1281
|
+
function I() {
|
|
1282
|
+
const S = /* @__PURE__ */ new Set([...xe(t.content), ...t.reservedIds ?? []]), $ = p.value.trim() || _e(S, k.value ? "check" : "step");
|
|
1283
|
+
if (!ht.test($)) {
|
|
1284
|
+
M.value = t.messages.inputField.invalidId, V.value = !0;
|
|
1284
1285
|
return;
|
|
1285
1286
|
}
|
|
1286
|
-
if (!t.fieldContent &&
|
|
1287
|
-
|
|
1287
|
+
if (!t.fieldContent && S.has($)) {
|
|
1288
|
+
M.value = t.messages.inputField.duplicateId, V.value = !0;
|
|
1288
1289
|
return;
|
|
1289
1290
|
}
|
|
1290
|
-
if (
|
|
1291
|
-
a("save", Nt(t.fieldContent, { id:
|
|
1291
|
+
if (k.value) {
|
|
1292
|
+
a("save", Nt(t.fieldContent, { id: $, title: u.value, checkedMessage: z.value })), a("update:visible", !1);
|
|
1292
1293
|
return;
|
|
1293
1294
|
}
|
|
1294
|
-
const
|
|
1295
|
-
if (
|
|
1296
|
-
|
|
1295
|
+
const F = Pt(t.fieldContent, { id: $, title: u.value, level: l.value, check: c.value, duration: T.value, timer: d.value }), W = rt(F);
|
|
1296
|
+
if (T.value.trim() && W.estimated_duration_ms === void 0 || d.value !== "elapsed" && !W.estimated_duration_ms) {
|
|
1297
|
+
M.value = t.messages.stepField.invalidDuration, V.value = !0;
|
|
1297
1298
|
return;
|
|
1298
1299
|
}
|
|
1299
|
-
a("save",
|
|
1300
|
+
a("save", F), a("update:visible", !1);
|
|
1300
1301
|
}
|
|
1301
|
-
return (
|
|
1302
|
+
return (S, $) => (h(), me(Oe, { to: "body" }, [
|
|
1302
1303
|
i("dialog", {
|
|
1303
1304
|
ref_key: "dialog",
|
|
1304
1305
|
ref: o,
|
|
1305
1306
|
class: "aimd-step-dialog",
|
|
1306
|
-
"aria-label": e.fieldContent ?
|
|
1307
|
-
onClose:
|
|
1308
|
-
onCancel:
|
|
1307
|
+
"aria-label": e.fieldContent ? w.value.edit : w.value.insert,
|
|
1308
|
+
onClose: $[9] || ($[9] = (F) => a("update:visible", !1)),
|
|
1309
|
+
onCancel: $[10] || ($[10] = (F) => a("update:visible", !1))
|
|
1309
1310
|
}, [
|
|
1310
1311
|
i("form", {
|
|
1311
|
-
onSubmit:
|
|
1312
|
+
onSubmit: ne(I, ["prevent"])
|
|
1312
1313
|
}, [
|
|
1313
|
-
i("h2", null, m(e.fieldContent ?
|
|
1314
|
+
i("h2", null, m(e.fieldContent ? w.value.edit : w.value.insert), 1),
|
|
1314
1315
|
i("label", null, [
|
|
1315
|
-
|
|
1316
|
+
L(m(w.value.name), 1),
|
|
1316
1317
|
D(i("input", {
|
|
1317
1318
|
ref_key: "nameInput",
|
|
1318
1319
|
ref: v,
|
|
1319
|
-
"onUpdate:modelValue":
|
|
1320
|
+
"onUpdate:modelValue": $[0] || ($[0] = (F) => u.value = F),
|
|
1320
1321
|
name: "title",
|
|
1321
1322
|
autocomplete: "off"
|
|
1322
1323
|
}, null, 512), [
|
|
1323
|
-
[
|
|
1324
|
+
[P, u.value]
|
|
1324
1325
|
])
|
|
1325
1326
|
]),
|
|
1326
|
-
|
|
1327
|
+
k.value ? B("", !0) : (h(), b("label", bi, [
|
|
1327
1328
|
D(i("input", {
|
|
1328
|
-
"onUpdate:modelValue":
|
|
1329
|
+
"onUpdate:modelValue": $[1] || ($[1] = (F) => c.value = F),
|
|
1329
1330
|
name: "check",
|
|
1330
1331
|
type: "checkbox"
|
|
1331
1332
|
}, null, 512), [
|
|
1332
1333
|
[pt, c.value]
|
|
1333
1334
|
]),
|
|
1334
|
-
|
|
1335
|
+
L(m(e.messages.stepField.check), 1)
|
|
1335
1336
|
])),
|
|
1336
1337
|
i("details", {
|
|
1337
|
-
open:
|
|
1338
|
-
onToggle:
|
|
1338
|
+
open: V.value,
|
|
1339
|
+
onToggle: $[7] || ($[7] = (F) => V.value = F.target.open)
|
|
1339
1340
|
}, [
|
|
1340
1341
|
i("summary", null, m(e.messages.inputField.advanced), 1),
|
|
1341
1342
|
i("label", null, [
|
|
1342
|
-
|
|
1343
|
+
L(m(w.value.id), 1),
|
|
1343
1344
|
D(i("input", {
|
|
1344
|
-
"onUpdate:modelValue":
|
|
1345
|
+
"onUpdate:modelValue": $[2] || ($[2] = (F) => p.value = F),
|
|
1345
1346
|
name: "id",
|
|
1346
1347
|
readonly: !!e.fieldContent,
|
|
1347
1348
|
autocomplete: "off",
|
|
1348
1349
|
spellcheck: "false"
|
|
1349
|
-
}, null, 8,
|
|
1350
|
-
[
|
|
1350
|
+
}, null, 8, wi), [
|
|
1351
|
+
[P, p.value]
|
|
1351
1352
|
])
|
|
1352
1353
|
]),
|
|
1353
|
-
|
|
1354
|
-
|
|
1354
|
+
k.value ? (h(), b("label", Mi, [
|
|
1355
|
+
L(m(e.messages.checkField.checkedMessage), 1),
|
|
1355
1356
|
D(i("input", {
|
|
1356
|
-
"onUpdate:modelValue":
|
|
1357
|
+
"onUpdate:modelValue": $[3] || ($[3] = (F) => z.value = F),
|
|
1357
1358
|
name: "checkedMessage"
|
|
1358
1359
|
}, null, 512), [
|
|
1359
|
-
[
|
|
1360
|
+
[P, z.value]
|
|
1360
1361
|
])
|
|
1361
|
-
])) : (
|
|
1362
|
+
])) : (h(), b(U, { key: 1 }, [
|
|
1362
1363
|
i("label", null, [
|
|
1363
|
-
|
|
1364
|
+
L(m(e.messages.dialog.level), 1),
|
|
1364
1365
|
D(i("select", {
|
|
1365
|
-
"onUpdate:modelValue":
|
|
1366
|
+
"onUpdate:modelValue": $[4] || ($[4] = (F) => l.value = F),
|
|
1366
1367
|
name: "level"
|
|
1367
1368
|
}, [
|
|
1368
|
-
(
|
|
1369
|
-
key:
|
|
1370
|
-
value:
|
|
1371
|
-
}, m(
|
|
1369
|
+
(h(), b(U, null, J(3, (F) => i("option", {
|
|
1370
|
+
key: F,
|
|
1371
|
+
value: F
|
|
1372
|
+
}, m(F), 9, _i)), 64))
|
|
1372
1373
|
], 512), [
|
|
1373
1374
|
[be, l.value]
|
|
1374
1375
|
])
|
|
1375
1376
|
]),
|
|
1376
1377
|
i("label", null, [
|
|
1377
|
-
|
|
1378
|
+
L(m(e.messages.stepField.duration), 1),
|
|
1378
1379
|
D(i("input", {
|
|
1379
|
-
"onUpdate:modelValue":
|
|
1380
|
+
"onUpdate:modelValue": $[5] || ($[5] = (F) => T.value = F),
|
|
1380
1381
|
name: "duration",
|
|
1381
1382
|
placeholder: "2m"
|
|
1382
1383
|
}, null, 512), [
|
|
1383
|
-
[
|
|
1384
|
+
[P, T.value]
|
|
1384
1385
|
])
|
|
1385
1386
|
]),
|
|
1386
1387
|
i("label", null, [
|
|
1387
|
-
|
|
1388
|
+
L(m(e.messages.stepField.timer), 1),
|
|
1388
1389
|
D(i("select", {
|
|
1389
|
-
"onUpdate:modelValue":
|
|
1390
|
+
"onUpdate:modelValue": $[6] || ($[6] = (F) => d.value = F),
|
|
1390
1391
|
name: "timer"
|
|
1391
1392
|
}, [
|
|
1392
|
-
i("option",
|
|
1393
|
+
i("option", xi, m(e.messages.stepField.elapsed), 1),
|
|
1393
1394
|
i("option", Ti, m(e.messages.stepField.countdown), 1),
|
|
1394
|
-
i("option",
|
|
1395
|
+
i("option", Ci, m(e.messages.stepField.both), 1)
|
|
1395
1396
|
], 512), [
|
|
1396
1397
|
[be, d.value]
|
|
1397
1398
|
])
|
|
1398
1399
|
])
|
|
1399
1400
|
], 64))
|
|
1400
|
-
], 40,
|
|
1401
|
-
|
|
1401
|
+
], 40, ki),
|
|
1402
|
+
M.value ? (h(), b("p", $i, m(M.value), 1)) : B("", !0),
|
|
1402
1403
|
i("footer", null, [
|
|
1403
1404
|
i("button", {
|
|
1404
1405
|
type: "button",
|
|
1405
|
-
onClick:
|
|
1406
|
+
onClick: $[8] || ($[8] = (F) => a("update:visible", !1))
|
|
1406
1407
|
}, m(e.messages.common.cancel), 1),
|
|
1407
|
-
i("button",
|
|
1408
|
+
i("button", Ii, m(e.fieldContent ? e.messages.inputField.save : e.messages.common.insert), 1)
|
|
1408
1409
|
])
|
|
1409
1410
|
], 32)
|
|
1410
|
-
], 40,
|
|
1411
|
+
], 40, yi)
|
|
1411
1412
|
]));
|
|
1412
1413
|
}
|
|
1413
|
-
}),
|
|
1414
|
+
}), Ai = /* @__PURE__ */ je(Fi, [["__scopeId", "data-v-fc5a778d"]]);
|
|
1414
1415
|
const he = {
|
|
1415
1416
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1416
1417
|
width: 24,
|
|
@@ -1426,12 +1427,12 @@ const ct = (...e) => e.filter((n, t, a) => !!n && n.trim() !== "" && a.indexOf(n
|
|
|
1426
1427
|
function et(e) {
|
|
1427
1428
|
return e != null;
|
|
1428
1429
|
}
|
|
1429
|
-
function
|
|
1430
|
-
const t = n.attributeNames ?? {}, a = (
|
|
1430
|
+
function zi(e, n = {}) {
|
|
1431
|
+
const t = n.attributeNames ?? {}, a = (M) => t[M] ?? M, o = e.size ?? e.width ?? he.width, v = e.size ?? e.height ?? he.height, p = e.aliases?.filter((M) => typeof M == "string" && M.trim() !== "").map((M) => `lucide-${M}`) ?? [], u = [...e.name ? [`lucide-${e.name}`] : [], ...p], l = n.className?.split(" ").filter(Boolean) ?? [], c = n.includeDefaultClasses === !1 ? ct(...l) : ct("lucide", ...u, ...l), T = n.absoluteStrokeWidth ? Number(n.strokeWidth ?? he["stroke-width"]) * Number(e.size ?? e.width ?? he.width) / Number(n.size ?? n.width ?? he.width) : n.strokeWidth ?? he["stroke-width"];
|
|
1431
1432
|
return [
|
|
1432
1433
|
"svg",
|
|
1433
1434
|
{
|
|
1434
|
-
...Object.entries(he).reduce((
|
|
1435
|
+
...Object.entries(he).reduce((M, [V, z]) => (M[a(V)] = z, M), {}),
|
|
1435
1436
|
..."color" in n && n.color && {
|
|
1436
1437
|
[a("stroke")]: n.color
|
|
1437
1438
|
},
|
|
@@ -1445,7 +1446,7 @@ function Ai(e, n = {}) {
|
|
|
1445
1446
|
..."height" in n && et(n.height) && {
|
|
1446
1447
|
[a("height")]: n.height
|
|
1447
1448
|
},
|
|
1448
|
-
[a("stroke-width")]:
|
|
1449
|
+
[a("stroke-width")]: T,
|
|
1449
1450
|
...c && {
|
|
1450
1451
|
[a("class")]: c
|
|
1451
1452
|
},
|
|
@@ -1455,30 +1456,30 @@ function Ai(e, n = {}) {
|
|
|
1455
1456
|
} : {},
|
|
1456
1457
|
..."attributes" in n && n.attributes
|
|
1457
1458
|
},
|
|
1458
|
-
e.node.map((
|
|
1459
|
-
const [
|
|
1460
|
-
return
|
|
1459
|
+
e.node.map((M) => {
|
|
1460
|
+
const [V, z, k] = M, w = n.nonScalingStroke ? { [a("vector-effect")]: "non-scaling-stroke", ...z } : z;
|
|
1461
|
+
return k ? [V, w, k] : [V, w];
|
|
1461
1462
|
})
|
|
1462
1463
|
];
|
|
1463
1464
|
}
|
|
1464
|
-
const
|
|
1465
|
+
const Vi = (e) => {
|
|
1465
1466
|
for (const n in e)
|
|
1466
1467
|
if (n.startsWith("aria-") || n === "role" || n === "title")
|
|
1467
1468
|
return !0;
|
|
1468
1469
|
return !1;
|
|
1469
1470
|
};
|
|
1470
1471
|
const Pe = (e) => e === "";
|
|
1471
|
-
const
|
|
1472
|
+
const Di = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1472
1473
|
const Si = /* @__PURE__ */ Symbol("lucide-icons");
|
|
1473
|
-
function
|
|
1474
|
+
function Ei() {
|
|
1474
1475
|
return wt(Si, {});
|
|
1475
1476
|
}
|
|
1476
|
-
const
|
|
1477
|
+
const qi = ({
|
|
1477
1478
|
name: e,
|
|
1478
1479
|
iconNode: n,
|
|
1479
1480
|
"icon-node": t,
|
|
1480
1481
|
icon: a = {
|
|
1481
|
-
name: e &&
|
|
1482
|
+
name: e && Di(e),
|
|
1482
1483
|
node: n ?? t ?? [],
|
|
1483
1484
|
size: 24,
|
|
1484
1485
|
aliases: []
|
|
@@ -1489,44 +1490,44 @@ const Ei = ({
|
|
|
1489
1490
|
"non-scaling-stroke": u,
|
|
1490
1491
|
strokeWidth: l,
|
|
1491
1492
|
"stroke-width": c,
|
|
1492
|
-
size:
|
|
1493
|
-
width: d =
|
|
1494
|
-
height:
|
|
1495
|
-
color:
|
|
1496
|
-
...
|
|
1497
|
-
}, { slots:
|
|
1493
|
+
size: T,
|
|
1494
|
+
width: d = T,
|
|
1495
|
+
height: M = T,
|
|
1496
|
+
color: V,
|
|
1497
|
+
...z
|
|
1498
|
+
}, { slots: k }) => {
|
|
1498
1499
|
const {
|
|
1499
|
-
size:
|
|
1500
|
-
color:
|
|
1501
|
-
strokeWidth:
|
|
1502
|
-
absoluteStrokeWidth:
|
|
1503
|
-
nonScalingStroke:
|
|
1500
|
+
size: w,
|
|
1501
|
+
color: I,
|
|
1502
|
+
strokeWidth: S = 2,
|
|
1503
|
+
absoluteStrokeWidth: $ = !1,
|
|
1504
|
+
nonScalingStroke: F = !1,
|
|
1504
1505
|
class: W = ""
|
|
1505
|
-
} =
|
|
1506
|
-
delete
|
|
1507
|
-
const
|
|
1508
|
-
color:
|
|
1509
|
-
width: d ??
|
|
1510
|
-
height:
|
|
1511
|
-
strokeWidth: l ?? c ??
|
|
1512
|
-
absoluteStrokeWidth:
|
|
1513
|
-
nonScalingStroke:
|
|
1506
|
+
} = Ei(), G = Pe(o) || Pe(v) || o === !0 || v === !0 || $ === !0, ee = Pe(p) || Pe(u) || p === !0 || u === !0 || F === !0;
|
|
1507
|
+
delete z.class;
|
|
1508
|
+
const Q = k.default?.(), [, j, O = []] = zi(a, {
|
|
1509
|
+
color: V ?? I,
|
|
1510
|
+
width: d ?? T ?? w,
|
|
1511
|
+
height: M ?? T ?? w,
|
|
1512
|
+
strokeWidth: l ?? c ?? S,
|
|
1513
|
+
absoluteStrokeWidth: G,
|
|
1514
|
+
nonScalingStroke: ee,
|
|
1514
1515
|
className: W,
|
|
1515
|
-
hasA11yProp:
|
|
1516
|
-
attributes:
|
|
1516
|
+
hasA11yProp: Q != null && Q.length > 0 || Vi(z),
|
|
1517
|
+
attributes: z
|
|
1517
1518
|
});
|
|
1518
|
-
return tt("svg",
|
|
1519
|
-
...
|
|
1520
|
-
...
|
|
1519
|
+
return tt("svg", j, [
|
|
1520
|
+
...O.map(([K, ae]) => tt(K, ae)),
|
|
1521
|
+
...Q ?? []
|
|
1521
1522
|
]);
|
|
1522
1523
|
};
|
|
1523
|
-
function
|
|
1524
|
+
function te(e, n = []) {
|
|
1524
1525
|
const t = typeof e == "string" ? {
|
|
1525
1526
|
name: e,
|
|
1526
1527
|
node: n
|
|
1527
1528
|
} : e;
|
|
1528
1529
|
return (a, { slots: o }) => tt(
|
|
1529
|
-
|
|
1530
|
+
qi,
|
|
1530
1531
|
{
|
|
1531
1532
|
...a,
|
|
1532
1533
|
icon: t
|
|
@@ -1534,7 +1535,7 @@ function ie(e, n = []) {
|
|
|
1534
1535
|
o.default ? { default: o.default } : void 0
|
|
1535
1536
|
);
|
|
1536
1537
|
}
|
|
1537
|
-
const
|
|
1538
|
+
const Bi = {
|
|
1538
1539
|
name: "calendar-days",
|
|
1539
1540
|
size: 24,
|
|
1540
1541
|
node: [
|
|
@@ -1549,29 +1550,29 @@ const qi = {
|
|
|
1549
1550
|
["path", { d: "M12 17h.01", key: "p32p05" }],
|
|
1550
1551
|
["path", { d: "M16 17h.01", key: "ql8jdd" }]
|
|
1551
1552
|
]
|
|
1552
|
-
}, vt =
|
|
1553
|
-
const
|
|
1553
|
+
}, vt = te(Bi);
|
|
1554
|
+
const Ni = {
|
|
1554
1555
|
name: "chevron-down",
|
|
1555
1556
|
size: 24,
|
|
1556
1557
|
node: [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]]
|
|
1557
|
-
},
|
|
1558
|
-
const
|
|
1558
|
+
}, Pi = te(Ni);
|
|
1559
|
+
const Li = {
|
|
1559
1560
|
name: "circle-dot",
|
|
1560
1561
|
size: 24,
|
|
1561
1562
|
node: [
|
|
1562
1563
|
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
1563
1564
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
|
|
1564
1565
|
]
|
|
1565
|
-
},
|
|
1566
|
-
const
|
|
1566
|
+
}, Ui = te(Li);
|
|
1567
|
+
const Ri = {
|
|
1567
1568
|
name: "clock",
|
|
1568
1569
|
size: 24,
|
|
1569
1570
|
node: [
|
|
1570
1571
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
1571
1572
|
["path", { d: "M12 6v6l4 2", key: "mmk7yg" }]
|
|
1572
1573
|
]
|
|
1573
|
-
},
|
|
1574
|
-
const
|
|
1574
|
+
}, Oi = te(Ri);
|
|
1575
|
+
const Hi = {
|
|
1575
1576
|
name: "hash",
|
|
1576
1577
|
size: 24,
|
|
1577
1578
|
node: [
|
|
@@ -1580,8 +1581,8 @@ const Oi = {
|
|
|
1580
1581
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
1581
1582
|
["line", { x1: "16", x2: "14", y1: "3", y2: "21", key: "weycgp" }]
|
|
1582
1583
|
]
|
|
1583
|
-
}, mt =
|
|
1584
|
-
const
|
|
1584
|
+
}, mt = te(Hi);
|
|
1585
|
+
const ji = {
|
|
1585
1586
|
name: "list-checks",
|
|
1586
1587
|
size: 24,
|
|
1587
1588
|
node: [
|
|
@@ -1591,8 +1592,8 @@ const Hi = {
|
|
|
1591
1592
|
["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
|
|
1592
1593
|
["path", { d: "m3 7 2 2 4-4", key: "1obspn" }]
|
|
1593
1594
|
]
|
|
1594
|
-
},
|
|
1595
|
-
const
|
|
1595
|
+
}, Ki = te(ji);
|
|
1596
|
+
const Wi = {
|
|
1596
1597
|
name: "list-ordered",
|
|
1597
1598
|
size: 24,
|
|
1598
1599
|
node: [
|
|
@@ -1603,8 +1604,8 @@ const Ki = {
|
|
|
1603
1604
|
["path", { d: "M4 9h2", key: "r1h2o0" }],
|
|
1604
1605
|
["path", { d: "M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02", key: "xtkcd5" }]
|
|
1605
1606
|
]
|
|
1606
|
-
},
|
|
1607
|
-
const
|
|
1607
|
+
}, Qi = te(Wi);
|
|
1608
|
+
const Ji = {
|
|
1608
1609
|
name: "paperclip",
|
|
1609
1610
|
size: 24,
|
|
1610
1611
|
node: [
|
|
@@ -1616,8 +1617,8 @@ const Qi = {
|
|
|
1616
1617
|
}
|
|
1617
1618
|
]
|
|
1618
1619
|
]
|
|
1619
|
-
},
|
|
1620
|
-
const
|
|
1620
|
+
}, Xi = te(Ji);
|
|
1621
|
+
const Yi = {
|
|
1621
1622
|
name: "settings-2",
|
|
1622
1623
|
size: 24,
|
|
1623
1624
|
node: [
|
|
@@ -1626,8 +1627,8 @@ const Xi = {
|
|
|
1626
1627
|
["circle", { cx: "17", cy: "17", r: "3", key: "18b49y" }],
|
|
1627
1628
|
["circle", { cx: "7", cy: "7", r: "3", key: "dfmy0x" }]
|
|
1628
1629
|
]
|
|
1629
|
-
},
|
|
1630
|
-
const
|
|
1630
|
+
}, Zi = te(Yi);
|
|
1631
|
+
const Gi = {
|
|
1631
1632
|
name: "square-check",
|
|
1632
1633
|
size: 24,
|
|
1633
1634
|
node: [
|
|
@@ -1635,8 +1636,8 @@ const Zi = {
|
|
|
1635
1636
|
["path", { d: "m16 9-5.5 5.5L8 12", key: "xofnsj" }]
|
|
1636
1637
|
],
|
|
1637
1638
|
aliases: ["check-square-2"]
|
|
1638
|
-
},
|
|
1639
|
-
const
|
|
1639
|
+
}, en = te(Gi);
|
|
1640
|
+
const tn = {
|
|
1640
1641
|
name: "text-cursor-input",
|
|
1641
1642
|
size: 24,
|
|
1642
1643
|
node: [
|
|
@@ -1646,118 +1647,118 @@ const en = {
|
|
|
1646
1647
|
["path", { d: "M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1", key: "1mj8rg" }],
|
|
1647
1648
|
["path", { d: "M9 6v12", key: "velyjx" }]
|
|
1648
1649
|
]
|
|
1649
|
-
},
|
|
1650
|
-
const
|
|
1650
|
+
}, ln = te(tn);
|
|
1651
|
+
const sn = {
|
|
1651
1652
|
name: "toggle-left",
|
|
1652
1653
|
size: 24,
|
|
1653
1654
|
node: [
|
|
1654
1655
|
["circle", { cx: "9", cy: "12", r: "3", key: "u3jwor" }],
|
|
1655
1656
|
["rect", { width: "20", height: "14", x: "2", y: "5", rx: "7", key: "g7kal2" }]
|
|
1656
1657
|
]
|
|
1657
|
-
},
|
|
1658
|
+
}, nn = te(sn), an = ["aria-label"], on = ["title", "aria-label", "onClick"], un = ["aria-expanded"], rn = ["aria-label"], dn = ["title", "onClick"], cn = /* @__PURE__ */ pe({
|
|
1658
1659
|
__name: "AimdInputToolbar",
|
|
1659
1660
|
props: {
|
|
1660
1661
|
messages: {}
|
|
1661
1662
|
},
|
|
1662
1663
|
emits: ["insert"],
|
|
1663
1664
|
setup(e, { emit: n }) {
|
|
1664
|
-
const t = e, a = n, o =
|
|
1665
|
+
const t = e, a = n, o = A(), v = A(), p = A(!1), u = A();
|
|
1665
1666
|
let l = 0;
|
|
1666
|
-
const c =
|
|
1667
|
-
{ preset: "str", label: t.messages.inputField.text, icon:
|
|
1667
|
+
const c = q(() => [
|
|
1668
|
+
{ preset: "str", label: t.messages.inputField.text, icon: ln },
|
|
1668
1669
|
{ preset: "int", label: t.messages.inputField.integer, icon: mt },
|
|
1669
1670
|
{ preset: "float", label: t.messages.inputField.number, icon: mt },
|
|
1670
|
-
{ preset: "choice", label: t.messages.inputField.choice, icon:
|
|
1671
|
-
{ preset: "multiple-choice", label: t.messages.inputField.multipleChoice, icon:
|
|
1672
|
-
{ preset: "bool | None", label: t.messages.inputField.boolean, icon:
|
|
1673
|
-
]),
|
|
1671
|
+
{ preset: "choice", label: t.messages.inputField.choice, icon: Ui },
|
|
1672
|
+
{ preset: "multiple-choice", label: t.messages.inputField.multipleChoice, icon: en },
|
|
1673
|
+
{ preset: "bool | None", label: t.messages.inputField.boolean, icon: nn }
|
|
1674
|
+
]), T = q(() => [
|
|
1674
1675
|
{ preset: "date", label: t.messages.inputField.date, icon: vt },
|
|
1675
|
-
{ preset: "time", label: t.messages.inputField.time, icon:
|
|
1676
|
+
{ preset: "time", label: t.messages.inputField.time, icon: Oi },
|
|
1676
1677
|
{ preset: "datetime", label: t.messages.inputField.datetime, icon: vt },
|
|
1677
|
-
{ preset: "list[str]", label: t.messages.inputField.list, icon:
|
|
1678
|
-
{ preset: "file", label: t.messages.inputField.file, icon:
|
|
1679
|
-
{ preset: "custom", label: t.messages.inputField.custom, icon:
|
|
1678
|
+
{ preset: "list[str]", label: t.messages.inputField.list, icon: Qi },
|
|
1679
|
+
{ preset: "file", label: t.messages.inputField.file, icon: Xi },
|
|
1680
|
+
{ preset: "custom", label: t.messages.inputField.custom, icon: Zi }
|
|
1680
1681
|
]);
|
|
1681
|
-
function d(
|
|
1682
|
-
o.value && (l =
|
|
1682
|
+
function d(k = !1) {
|
|
1683
|
+
o.value && (l = k ? T.value.length - 1 : 0, u.value = o.value.closest('dialog[open], [popover], [role="dialog"]') ?? o.value.ownerDocument.body, p.value = !0);
|
|
1683
1684
|
}
|
|
1684
|
-
function k
|
|
1685
|
-
p.value = !1,
|
|
1685
|
+
function M(k = !1) {
|
|
1686
|
+
p.value = !1, k && o.value?.focus({ preventScroll: !0 });
|
|
1686
1687
|
}
|
|
1687
|
-
function
|
|
1688
|
-
p.value &&
|
|
1688
|
+
function V(k) {
|
|
1689
|
+
p.value && M(!0), a("insert", k);
|
|
1689
1690
|
}
|
|
1690
|
-
function
|
|
1691
|
-
if (
|
|
1692
|
-
|
|
1691
|
+
function z(k) {
|
|
1692
|
+
if (k.key === "Tab" || k.key === "Escape") {
|
|
1693
|
+
k.key === "Escape" && (k.preventDefault(), k.stopPropagation()), M(!0);
|
|
1693
1694
|
return;
|
|
1694
1695
|
}
|
|
1695
|
-
const
|
|
1696
|
-
let
|
|
1697
|
-
switch (
|
|
1696
|
+
const w = Array.from(v.value?.querySelectorAll("button") ?? []), I = w.indexOf(k.target);
|
|
1697
|
+
let S;
|
|
1698
|
+
switch (k.key) {
|
|
1698
1699
|
case "Home":
|
|
1699
|
-
|
|
1700
|
+
S = 0;
|
|
1700
1701
|
break;
|
|
1701
1702
|
case "End":
|
|
1702
|
-
|
|
1703
|
+
S = w.length - 1;
|
|
1703
1704
|
break;
|
|
1704
1705
|
case "ArrowDown":
|
|
1705
|
-
|
|
1706
|
+
S = (I + 1) % w.length;
|
|
1706
1707
|
break;
|
|
1707
1708
|
case "ArrowUp":
|
|
1708
|
-
|
|
1709
|
+
S = (I - 1 + w.length) % w.length;
|
|
1709
1710
|
break;
|
|
1710
1711
|
default:
|
|
1711
1712
|
return;
|
|
1712
1713
|
}
|
|
1713
|
-
|
|
1714
|
+
k.preventDefault(), w[S]?.focus();
|
|
1714
1715
|
}
|
|
1715
|
-
return
|
|
1716
|
-
const
|
|
1717
|
-
if (!
|
|
1718
|
-
const
|
|
1719
|
-
|
|
1716
|
+
return Z(v, (k, w, I) => {
|
|
1717
|
+
const S = o.value;
|
|
1718
|
+
if (!k || !S) return;
|
|
1719
|
+
const $ = S.ownerDocument, F = (Q) => {
|
|
1720
|
+
Q.target instanceof Node && !k.contains(Q.target) && !S.contains(Q.target) && M();
|
|
1720
1721
|
};
|
|
1721
|
-
|
|
1722
|
-
let W = !0,
|
|
1723
|
-
const
|
|
1724
|
-
const { x:
|
|
1722
|
+
$.addEventListener("pointerdown", F, !0), $.addEventListener("focusin", F);
|
|
1723
|
+
let W = !0, G = !1;
|
|
1724
|
+
const ee = xt(S, k, async () => {
|
|
1725
|
+
const { x: Q, y: j } = await Tt(S, k, {
|
|
1725
1726
|
strategy: "fixed",
|
|
1726
1727
|
placement: "bottom-start",
|
|
1727
1728
|
middleware: [
|
|
1728
1729
|
Ct(4),
|
|
1729
1730
|
$t({ padding: 8 }),
|
|
1730
1731
|
It({ padding: 8 }),
|
|
1731
|
-
Ft({ padding: 8, apply({ availableHeight:
|
|
1732
|
-
|
|
1732
|
+
Ft({ padding: 8, apply({ availableHeight: O }) {
|
|
1733
|
+
k.style.maxHeight = `${Math.max(0, O)}px`;
|
|
1733
1734
|
} })
|
|
1734
1735
|
]
|
|
1735
1736
|
});
|
|
1736
|
-
W && (
|
|
1737
|
+
W && (k.style.left = `${Q}px`, k.style.top = `${j}px`, G || (G = !0, k.style.visibility = "visible", k.querySelectorAll("button")[l]?.focus({ preventScroll: !0 })));
|
|
1737
1738
|
});
|
|
1738
|
-
|
|
1739
|
-
W = !1,
|
|
1739
|
+
I(() => {
|
|
1740
|
+
W = !1, ee(), $.removeEventListener("pointerdown", F, !0), $.removeEventListener("focusin", F);
|
|
1740
1741
|
});
|
|
1741
|
-
}, { flush: "post" }), (
|
|
1742
|
+
}, { flush: "post" }), (k, w) => (h(), b("div", {
|
|
1742
1743
|
class: "aimd-input-tools",
|
|
1743
1744
|
role: "group",
|
|
1744
1745
|
"aria-label": e.messages.inputField.insert
|
|
1745
1746
|
}, [
|
|
1746
|
-
(
|
|
1747
|
-
key:
|
|
1747
|
+
(h(!0), b(U, null, J(c.value, (I) => (h(), b("button", {
|
|
1748
|
+
key: I.preset,
|
|
1748
1749
|
type: "button",
|
|
1749
|
-
title: e.messages.inputField.insertType(
|
|
1750
|
-
"aria-label": e.messages.inputField.insertType(
|
|
1751
|
-
onMousedown:
|
|
1750
|
+
title: e.messages.inputField.insertType(I.label),
|
|
1751
|
+
"aria-label": e.messages.inputField.insertType(I.label),
|
|
1752
|
+
onMousedown: w[0] || (w[0] = ne(() => {
|
|
1752
1753
|
}, ["prevent"])),
|
|
1753
|
-
onClick: (
|
|
1754
|
+
onClick: (S) => V(I.preset)
|
|
1754
1755
|
}, [
|
|
1755
|
-
(
|
|
1756
|
+
(h(), me(it(I.icon), {
|
|
1756
1757
|
size: 16,
|
|
1757
1758
|
"aria-hidden": "true"
|
|
1758
1759
|
})),
|
|
1759
|
-
i("span", null, m(
|
|
1760
|
-
], 40,
|
|
1760
|
+
i("span", null, m(I.label), 1)
|
|
1761
|
+
], 40, on))), 128)),
|
|
1761
1762
|
i("button", {
|
|
1762
1763
|
ref_key: "trigger",
|
|
1763
1764
|
ref: o,
|
|
@@ -1765,25 +1766,25 @@ const ln = {
|
|
|
1765
1766
|
class: "aimd-input-tools__more",
|
|
1766
1767
|
"aria-haspopup": "menu",
|
|
1767
1768
|
"aria-expanded": p.value,
|
|
1768
|
-
onMousedown:
|
|
1769
|
+
onMousedown: w[1] || (w[1] = ne(() => {
|
|
1769
1770
|
}, ["prevent"])),
|
|
1770
|
-
onClick:
|
|
1771
|
+
onClick: w[2] || (w[2] = (I) => p.value ? M(!0) : d()),
|
|
1771
1772
|
onKeydown: [
|
|
1772
|
-
|
|
1773
|
-
|
|
1773
|
+
w[3] || (w[3] = nt(ne((I) => d(), ["prevent"]), ["down"])),
|
|
1774
|
+
w[4] || (w[4] = nt(ne((I) => d(!0), ["prevent"]), ["up"]))
|
|
1774
1775
|
]
|
|
1775
1776
|
}, [
|
|
1776
|
-
|
|
1777
|
+
ue(Y(Ki), {
|
|
1777
1778
|
size: 16,
|
|
1778
1779
|
"aria-hidden": "true"
|
|
1779
1780
|
}),
|
|
1780
1781
|
i("span", null, m(e.messages.inputField.more), 1),
|
|
1781
|
-
|
|
1782
|
+
ue(Y(Pi), {
|
|
1782
1783
|
size: 14,
|
|
1783
1784
|
"aria-hidden": "true"
|
|
1784
1785
|
})
|
|
1785
|
-
], 40,
|
|
1786
|
-
p.value && u.value ? (
|
|
1786
|
+
], 40, un),
|
|
1787
|
+
p.value && u.value ? (h(), me(Oe, {
|
|
1787
1788
|
key: 0,
|
|
1788
1789
|
to: u.value
|
|
1789
1790
|
}, [
|
|
@@ -1793,41 +1794,41 @@ const ln = {
|
|
|
1793
1794
|
class: "aimd-input-tools__menu",
|
|
1794
1795
|
role: "menu",
|
|
1795
1796
|
"aria-label": e.messages.inputField.more,
|
|
1796
|
-
onKeydown:
|
|
1797
|
+
onKeydown: z
|
|
1797
1798
|
}, [
|
|
1798
|
-
(
|
|
1799
|
-
key:
|
|
1799
|
+
(h(!0), b(U, null, J(T.value, (I) => (h(), b("button", {
|
|
1800
|
+
key: I.preset,
|
|
1800
1801
|
type: "button",
|
|
1801
1802
|
role: "menuitem",
|
|
1802
1803
|
tabindex: "-1",
|
|
1803
|
-
title: e.messages.inputField.insertType(
|
|
1804
|
-
onMousedown:
|
|
1804
|
+
title: e.messages.inputField.insertType(I.label),
|
|
1805
|
+
onMousedown: w[5] || (w[5] = ne(() => {
|
|
1805
1806
|
}, ["prevent"])),
|
|
1806
|
-
onClick: (
|
|
1807
|
+
onClick: (S) => V(I.preset)
|
|
1807
1808
|
}, [
|
|
1808
|
-
(
|
|
1809
|
+
(h(), me(it(I.icon), {
|
|
1809
1810
|
size: 16,
|
|
1810
1811
|
"aria-hidden": "true"
|
|
1811
1812
|
})),
|
|
1812
|
-
i("span", null, m(
|
|
1813
|
-
], 40,
|
|
1814
|
-
], 40,
|
|
1815
|
-
], 8, ["to"])) :
|
|
1816
|
-
], 8,
|
|
1813
|
+
i("span", null, m(I.label), 1)
|
|
1814
|
+
], 40, dn))), 128))
|
|
1815
|
+
], 40, rn)
|
|
1816
|
+
], 8, ["to"])) : B("", !0)
|
|
1817
|
+
], 8, an));
|
|
1817
1818
|
}
|
|
1818
|
-
}),
|
|
1819
|
+
}), vn = /* @__PURE__ */ je(cn, [["__scopeId", "data-v-4f8b17e2"]]), mn = { class: "aimd-editor-toolbar" }, pn = {
|
|
1819
1820
|
key: 0,
|
|
1820
1821
|
class: "aimd-editor-mode-switch"
|
|
1821
|
-
},
|
|
1822
|
+
}, fn = ["title"], gn = ["title"], hn = {
|
|
1822
1823
|
key: 1,
|
|
1823
1824
|
class: "aimd-editor-toolbar-sep"
|
|
1824
|
-
},
|
|
1825
|
+
}, yn = {
|
|
1825
1826
|
key: 0,
|
|
1826
1827
|
class: "aimd-editor-toolbar-sep"
|
|
1827
|
-
},
|
|
1828
|
+
}, bn = ["title", "onClick", "innerHTML"], kn = {
|
|
1828
1829
|
key: 3,
|
|
1829
1830
|
class: "aimd-editor-toolbar-divider"
|
|
1830
|
-
},
|
|
1831
|
+
}, wn = ["title", "onClick", "onMouseup"], Mn = ["innerHTML"], _n = { class: "aimd-editor-aimd-btn-label" }, xn = /* @__PURE__ */ pe({
|
|
1831
1832
|
__name: "AimdEditorToolbar",
|
|
1832
1833
|
props: {
|
|
1833
1834
|
showTopBar: { type: Boolean },
|
|
@@ -1841,8 +1842,8 @@ const ln = {
|
|
|
1841
1842
|
emits: ["switch-mode", "md-action", "open-aimd-dialog", "quick-insert-aimd", "insert-input"],
|
|
1842
1843
|
setup(e, { emit: n }) {
|
|
1843
1844
|
const t = n;
|
|
1844
|
-
return (a, o) => (
|
|
1845
|
-
e.showTopBar ? (
|
|
1845
|
+
return (a, o) => (h(), b("div", mn, [
|
|
1846
|
+
e.showTopBar ? (h(), b("div", pn, [
|
|
1846
1847
|
i("button", {
|
|
1847
1848
|
type: "button",
|
|
1848
1849
|
class: ye(["aimd-editor-mode-btn", { active: e.editorMode === "source" }]),
|
|
@@ -1854,7 +1855,7 @@ const ln = {
|
|
|
1854
1855
|
innerHTML: '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>'
|
|
1855
1856
|
}, null, -1)),
|
|
1856
1857
|
i("span", null, m(e.resolvedMessages.mode.source), 1)
|
|
1857
|
-
], 10,
|
|
1858
|
+
], 10, fn),
|
|
1858
1859
|
i("button", {
|
|
1859
1860
|
type: "button",
|
|
1860
1861
|
class: ye(["aimd-editor-mode-btn", { active: e.editorMode === "wysiwyg" }]),
|
|
@@ -1866,220 +1867,227 @@ const ln = {
|
|
|
1866
1867
|
innerHTML: '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>'
|
|
1867
1868
|
}, null, -1)),
|
|
1868
1869
|
i("span", null, m(e.resolvedMessages.mode.wysiwyg), 1)
|
|
1869
|
-
], 10,
|
|
1870
|
-
])) :
|
|
1871
|
-
e.showTopBar && e.showMdToolbar ? (
|
|
1872
|
-
e.showMdToolbar ? (
|
|
1870
|
+
], 10, gn)
|
|
1871
|
+
])) : B("", !0),
|
|
1872
|
+
e.showTopBar && e.showMdToolbar ? (h(), b("div", hn)) : B("", !0),
|
|
1873
|
+
e.showMdToolbar ? (h(!0), b(U, { key: 2 }, J(e.localizedMdToolbarItems, (v) => (h(), b(U, {
|
|
1873
1874
|
key: v.action
|
|
1874
1875
|
}, [
|
|
1875
|
-
v.action.startsWith("sep") ? (
|
|
1876
|
+
v.action.startsWith("sep") ? (h(), b("div", yn)) : (h(), b("button", {
|
|
1876
1877
|
key: 1,
|
|
1877
1878
|
type: "button",
|
|
1878
1879
|
class: "aimd-editor-fmt-btn",
|
|
1879
1880
|
title: v.title,
|
|
1880
1881
|
onClick: (p) => t("md-action", v.action, p),
|
|
1881
1882
|
innerHTML: v.svgIcon
|
|
1882
|
-
}, null, 8,
|
|
1883
|
-
], 64))), 128)) :
|
|
1884
|
-
e.showMdToolbar && e.showAimdToolbar ? (
|
|
1885
|
-
e.showAimdToolbar ? (
|
|
1886
|
-
(
|
|
1883
|
+
}, null, 8, bn))
|
|
1884
|
+
], 64))), 128)) : B("", !0),
|
|
1885
|
+
e.showMdToolbar && e.showAimdToolbar ? (h(), b("div", kn)) : B("", !0),
|
|
1886
|
+
e.showAimdToolbar ? (h(), b(U, { key: 4 }, [
|
|
1887
|
+
(h(!0), b(U, null, J(e.localizedFieldTypes.filter((v) => v.type !== "var"), (v) => (h(), b("button", {
|
|
1887
1888
|
key: v.type,
|
|
1888
1889
|
type: "button",
|
|
1889
1890
|
class: "aimd-editor-fmt-btn aimd-editor-aimd-btn",
|
|
1890
1891
|
title: v.desc,
|
|
1891
1892
|
style: Ue({ "--aimd-color": v.color }),
|
|
1892
1893
|
onClick: (p) => t("open-aimd-dialog", v.type),
|
|
1893
|
-
onMouseup:
|
|
1894
|
+
onMouseup: ne((p) => t("quick-insert-aimd", v.type), ["middle", "prevent"])
|
|
1894
1895
|
}, [
|
|
1895
1896
|
i("span", {
|
|
1896
1897
|
class: "aimd-editor-aimd-btn-icon",
|
|
1897
1898
|
innerHTML: v.svgIcon
|
|
1898
|
-
}, null, 8,
|
|
1899
|
-
i("span",
|
|
1900
|
-
], 44,
|
|
1901
|
-
e.localizedFieldTypes.some((v) => v.type === "var") ? (
|
|
1899
|
+
}, null, 8, Mn),
|
|
1900
|
+
i("span", _n, m(v.label), 1)
|
|
1901
|
+
], 44, wn))), 128)),
|
|
1902
|
+
e.localizedFieldTypes.some((v) => v.type === "var") ? (h(), me(vn, {
|
|
1902
1903
|
key: 0,
|
|
1903
1904
|
messages: e.resolvedMessages,
|
|
1904
1905
|
onInsert: o[2] || (o[2] = (v) => t("insert-input", v))
|
|
1905
|
-
}, null, 8, ["messages"])) :
|
|
1906
|
-
], 64)) :
|
|
1906
|
+
}, null, 8, ["messages"])) : B("", !0)
|
|
1907
|
+
], 64)) : B("", !0)
|
|
1907
1908
|
]));
|
|
1908
1909
|
}
|
|
1909
1910
|
});
|
|
1910
1911
|
function Tn(e) {
|
|
1911
|
-
const { initialContent: n, initialMode: t, resolvedMessages: a, emitModelValue: o, emitMode: v } = e, p =
|
|
1912
|
-
let
|
|
1913
|
-
function
|
|
1914
|
-
|
|
1912
|
+
const { initialContent: n, initialMode: t, resolvedMessages: a, emitModelValue: o, emitMode: v } = e, p = A(t), u = A(n), l = Xe(null), c = Xe(null), T = A(!0), d = Xe(null);
|
|
1913
|
+
let M = !1, V, z = n;
|
|
1914
|
+
function k(x) {
|
|
1915
|
+
return x.action((f) => f.get(Ht).state.doc);
|
|
1916
|
+
}
|
|
1917
|
+
function w(x) {
|
|
1918
|
+
x !== u.value && (u.value = x, o(x));
|
|
1915
1919
|
}
|
|
1916
|
-
function
|
|
1917
|
-
return Ut(
|
|
1920
|
+
function I(x) {
|
|
1921
|
+
return Ut(x).content;
|
|
1918
1922
|
}
|
|
1919
|
-
function
|
|
1920
|
-
return /class="ProseMirror milkdown-editor-content editor"/.test(
|
|
1923
|
+
function S(x) {
|
|
1924
|
+
return /class="ProseMirror milkdown-editor-content editor"/.test(x) || /<div class="milkdown">/.test(x) || /<\/?[a-z][^>]*>/i.test(x) && /AIMDINLINETEMPLATE[0-9a-f]+TOKEN/.test(x);
|
|
1921
1925
|
}
|
|
1922
|
-
function
|
|
1923
|
-
const
|
|
1924
|
-
return y
|
|
1926
|
+
function $(x, f) {
|
|
1927
|
+
const y = At(Rt(x));
|
|
1928
|
+
return S(y) ? f : y;
|
|
1925
1929
|
}
|
|
1926
|
-
function
|
|
1927
|
-
return /\{\{(?:var_table|var|quiz|step|check|ref_step|ref_var|ref_fig|cite|fig)\|/.test(
|
|
1930
|
+
function F(x) {
|
|
1931
|
+
return /\{\{(?:var_table|var|quiz|step|check|task|ref_step|ref_var|ref_fig|cite|fig)\|/.test(x) || /```(?:quiz|fig|assigner|connectors)\b/.test(x);
|
|
1928
1932
|
}
|
|
1929
|
-
function
|
|
1933
|
+
function W() {
|
|
1930
1934
|
if (d.value)
|
|
1931
1935
|
try {
|
|
1932
|
-
const
|
|
1933
|
-
if (typeof
|
|
1936
|
+
const x = d.value.action(ot());
|
|
1937
|
+
if (typeof x != "string")
|
|
1934
1938
|
return;
|
|
1935
|
-
const
|
|
1936
|
-
d.value.action(Le(
|
|
1939
|
+
const f = $(x, u.value);
|
|
1940
|
+
d.value.action(Le(I(f)));
|
|
1937
1941
|
} catch {
|
|
1938
1942
|
}
|
|
1939
1943
|
}
|
|
1940
|
-
const
|
|
1944
|
+
const G = q(() => {
|
|
1941
1945
|
try {
|
|
1942
1946
|
return Ot(u.value);
|
|
1943
1947
|
} catch {
|
|
1944
1948
|
return null;
|
|
1945
1949
|
}
|
|
1946
1950
|
});
|
|
1947
|
-
async function
|
|
1948
|
-
if (
|
|
1951
|
+
async function ee(x) {
|
|
1952
|
+
if (x !== p.value) {
|
|
1949
1953
|
if (p.value === "source" && l.value && (u.value = l.value.getValue()), p.value === "wysiwyg" && d.value)
|
|
1950
1954
|
try {
|
|
1951
|
-
|
|
1952
|
-
|
|
1955
|
+
if (V?.eq(k(d.value)))
|
|
1956
|
+
w(z);
|
|
1957
|
+
else {
|
|
1958
|
+
const f = d.value.action(ot());
|
|
1959
|
+
typeof f == "string" && w($(f, u.value));
|
|
1960
|
+
}
|
|
1953
1961
|
} catch {
|
|
1954
1962
|
}
|
|
1955
|
-
if (p.value =
|
|
1956
|
-
await Re(), l.value && (
|
|
1957
|
-
else if (
|
|
1963
|
+
if (p.value = x, v(x), x === "source")
|
|
1964
|
+
await Re(), l.value && (M = !0, l.value.setValue(u.value), M = !1);
|
|
1965
|
+
else if (x === "wysiwyg" && (await Re(), d.value))
|
|
1958
1966
|
try {
|
|
1959
|
-
|
|
1967
|
+
M = !0, d.value.action(Le(I(u.value))), V = k(d.value), z = u.value, M = !1;
|
|
1960
1968
|
} catch {
|
|
1961
|
-
|
|
1969
|
+
M = !1;
|
|
1962
1970
|
}
|
|
1963
1971
|
}
|
|
1964
1972
|
}
|
|
1965
|
-
function
|
|
1966
|
-
if (
|
|
1967
|
-
if (
|
|
1968
|
-
l.value.setValue(
|
|
1973
|
+
function Q(x) {
|
|
1974
|
+
if (x !== u.value) {
|
|
1975
|
+
if (M = !0, u.value = x, p.value === "source" && l.value)
|
|
1976
|
+
l.value.setValue(x);
|
|
1969
1977
|
else if (p.value === "wysiwyg" && d.value)
|
|
1970
1978
|
try {
|
|
1971
|
-
d.value.action(Le(
|
|
1979
|
+
d.value.action(Le(I(x))), V = k(d.value), z = x;
|
|
1972
1980
|
} catch {
|
|
1973
1981
|
}
|
|
1974
|
-
|
|
1982
|
+
M = !1;
|
|
1975
1983
|
}
|
|
1976
1984
|
}
|
|
1977
|
-
function
|
|
1985
|
+
function j(x) {
|
|
1978
1986
|
if (p.value === "source" && l.value) {
|
|
1979
|
-
const
|
|
1987
|
+
const f = l.value.getSelection(), y = l.value.getModel(), C = l.value.getPosition(), oe = y.getLineContent(C.lineNumber).substring(0, C.column - 1).trim() !== "" && !x.startsWith(`
|
|
1980
1988
|
`) ? `
|
|
1981
|
-
` +
|
|
1989
|
+
` + x : x;
|
|
1982
1990
|
l.value.executeEdits("toolbar", [{
|
|
1983
|
-
range:
|
|
1984
|
-
text:
|
|
1991
|
+
range: f,
|
|
1992
|
+
text: oe,
|
|
1985
1993
|
forceMoveMarkers: !0
|
|
1986
1994
|
}]), l.value.focus();
|
|
1987
1995
|
} else if (p.value === "wysiwyg" && d.value)
|
|
1988
1996
|
try {
|
|
1989
|
-
d.value.action(Ye(
|
|
1997
|
+
d.value.action(Ye(x)), F(x) && W();
|
|
1990
1998
|
} catch {
|
|
1991
1999
|
}
|
|
1992
2000
|
}
|
|
1993
|
-
function
|
|
2001
|
+
function O(x, f = "", y = "") {
|
|
1994
2002
|
if (p.value === "source" && l.value) {
|
|
1995
|
-
const
|
|
2003
|
+
const C = l.value.getSelection(), R = l.value.getModel().getValueInRange(C) || y, H = x + R + f;
|
|
1996
2004
|
l.value.executeEdits("toolbar", [{
|
|
1997
|
-
range:
|
|
1998
|
-
text:
|
|
2005
|
+
range: C,
|
|
2006
|
+
text: H,
|
|
1999
2007
|
forceMoveMarkers: !0
|
|
2000
2008
|
}]), l.value.focus();
|
|
2001
2009
|
} else if (p.value === "wysiwyg" && d.value)
|
|
2002
2010
|
try {
|
|
2003
|
-
d.value.action(Ye(
|
|
2011
|
+
d.value.action(Ye(x + y + f));
|
|
2004
2012
|
} catch {
|
|
2005
2013
|
}
|
|
2006
2014
|
}
|
|
2007
|
-
function
|
|
2015
|
+
function K(x, f = "") {
|
|
2008
2016
|
if (p.value === "source" && l.value) {
|
|
2009
|
-
const
|
|
2010
|
-
if (
|
|
2011
|
-
const
|
|
2012
|
-
l.value.executeEdits("toolbar", [{ range:
|
|
2017
|
+
const y = l.value.getPosition(), R = l.value.getModel().getLineContent(y.lineNumber);
|
|
2018
|
+
if (R.trim() === "") {
|
|
2019
|
+
const H = { startLineNumber: y.lineNumber, startColumn: 1, endLineNumber: y.lineNumber, endColumn: R.length + 1 };
|
|
2020
|
+
l.value.executeEdits("toolbar", [{ range: H, text: x + f, forceMoveMarkers: !0 }]);
|
|
2013
2021
|
} else {
|
|
2014
|
-
const
|
|
2015
|
-
l.value.executeEdits("toolbar", [{ range:
|
|
2016
|
-
` +
|
|
2022
|
+
const H = { startLineNumber: y.lineNumber, startColumn: R.length + 1, endLineNumber: y.lineNumber, endColumn: R.length + 1 };
|
|
2023
|
+
l.value.executeEdits("toolbar", [{ range: H, text: `
|
|
2024
|
+
` + x + f, forceMoveMarkers: !0 }]);
|
|
2017
2025
|
}
|
|
2018
2026
|
l.value.focus();
|
|
2019
2027
|
} else if (p.value === "wysiwyg" && d.value)
|
|
2020
2028
|
try {
|
|
2021
2029
|
d.value.action(Ye(`
|
|
2022
|
-
` +
|
|
2030
|
+
` + x + f));
|
|
2023
2031
|
} catch {
|
|
2024
2032
|
}
|
|
2025
2033
|
}
|
|
2026
|
-
function
|
|
2027
|
-
const
|
|
2028
|
-
switch (
|
|
2034
|
+
function ae(x) {
|
|
2035
|
+
const f = a.value.snippets;
|
|
2036
|
+
switch (x) {
|
|
2029
2037
|
case "h1":
|
|
2030
|
-
|
|
2038
|
+
K("# ", f.heading);
|
|
2031
2039
|
break;
|
|
2032
2040
|
case "h2":
|
|
2033
|
-
|
|
2041
|
+
K("## ", f.heading);
|
|
2034
2042
|
break;
|
|
2035
2043
|
case "h3":
|
|
2036
|
-
|
|
2044
|
+
K("### ", f.heading);
|
|
2037
2045
|
break;
|
|
2038
2046
|
case "bold":
|
|
2039
|
-
|
|
2047
|
+
O("**", "**", f.boldText);
|
|
2040
2048
|
break;
|
|
2041
2049
|
case "italic":
|
|
2042
|
-
|
|
2050
|
+
O("*", "*", f.italicText);
|
|
2043
2051
|
break;
|
|
2044
2052
|
case "strikethrough":
|
|
2045
|
-
|
|
2053
|
+
O("~~", "~~", f.strikethrough);
|
|
2046
2054
|
break;
|
|
2047
2055
|
case "ul":
|
|
2048
|
-
|
|
2056
|
+
K("- ", f.listItem);
|
|
2049
2057
|
break;
|
|
2050
2058
|
case "ol":
|
|
2051
|
-
|
|
2059
|
+
K("1. ", f.listItem);
|
|
2052
2060
|
break;
|
|
2053
2061
|
case "blockquote":
|
|
2054
|
-
|
|
2062
|
+
K("> ", f.quote);
|
|
2055
2063
|
break;
|
|
2056
2064
|
case "code":
|
|
2057
|
-
|
|
2065
|
+
O("`", "`", f.code);
|
|
2058
2066
|
break;
|
|
2059
2067
|
case "codeblock":
|
|
2060
|
-
|
|
2068
|
+
O("```\n", "\n```", f.codeBlock);
|
|
2061
2069
|
break;
|
|
2062
2070
|
case "link":
|
|
2063
|
-
|
|
2071
|
+
O("[", "](url)", f.linkText);
|
|
2064
2072
|
break;
|
|
2065
2073
|
case "image":
|
|
2066
|
-
|
|
2074
|
+
O("", f.altText);
|
|
2067
2075
|
break;
|
|
2068
2076
|
case "hr":
|
|
2069
|
-
|
|
2077
|
+
K("---");
|
|
2070
2078
|
break;
|
|
2071
2079
|
case "math":
|
|
2072
|
-
|
|
2080
|
+
O("$", "$", f.mathFormula);
|
|
2073
2081
|
break;
|
|
2074
2082
|
case "table":
|
|
2075
2083
|
if (p.value === "wysiwyg" && d.value)
|
|
2076
2084
|
try {
|
|
2077
|
-
d.value.action(Mt(
|
|
2085
|
+
d.value.action(Mt(jt.key, { row: 3, col: 3 }));
|
|
2078
2086
|
} catch {
|
|
2079
2087
|
}
|
|
2080
2088
|
else
|
|
2081
|
-
|
|
2082
|
-
`| ${
|
|
2089
|
+
K(
|
|
2090
|
+
`| ${f.tableColumnA} | ${f.tableColumnB} | ${f.tableColumnC} |
|
|
2083
2091
|
|-------|-------|-------|
|
|
2084
2092
|
| `,
|
|
2085
2093
|
" | | |"
|
|
@@ -2087,37 +2095,37 @@ function Tn(e) {
|
|
|
2087
2095
|
break;
|
|
2088
2096
|
}
|
|
2089
2097
|
}
|
|
2090
|
-
function
|
|
2091
|
-
|
|
2098
|
+
function le(x, f, y) {
|
|
2099
|
+
M || w($(f, u.value));
|
|
2092
2100
|
}
|
|
2093
|
-
function se(
|
|
2094
|
-
d.value =
|
|
2101
|
+
function se(x) {
|
|
2102
|
+
d.value = x, V = k(x), z = u.value;
|
|
2095
2103
|
}
|
|
2096
2104
|
return {
|
|
2097
2105
|
editorMode: p,
|
|
2098
2106
|
content: u,
|
|
2099
|
-
commitUserContent:
|
|
2107
|
+
commitUserContent: w,
|
|
2100
2108
|
monacoEditor: l,
|
|
2101
2109
|
monacoInstance: c,
|
|
2102
|
-
monacoLoading:
|
|
2110
|
+
monacoLoading: T,
|
|
2103
2111
|
milkdownEditorRef: d,
|
|
2104
|
-
extractedFields:
|
|
2105
|
-
toMilkdownMarkdown:
|
|
2106
|
-
switchMode:
|
|
2107
|
-
syncFromProp:
|
|
2108
|
-
insertTextIntoActiveEditor:
|
|
2109
|
-
handleMdAction:
|
|
2110
|
-
onMilkdownMarkdownUpdated:
|
|
2112
|
+
extractedFields: G,
|
|
2113
|
+
toMilkdownMarkdown: I,
|
|
2114
|
+
switchMode: ee,
|
|
2115
|
+
syncFromProp: Q,
|
|
2116
|
+
insertTextIntoActiveEditor: j,
|
|
2117
|
+
handleMdAction: ae,
|
|
2118
|
+
onMilkdownMarkdownUpdated: le,
|
|
2111
2119
|
onMilkdownReady: se
|
|
2112
2120
|
};
|
|
2113
2121
|
}
|
|
2114
|
-
const
|
|
2122
|
+
const Cn = { class: "aimd-editor" }, $n = {
|
|
2115
2123
|
key: 0,
|
|
2116
2124
|
class: "aimd-editor-mode-host"
|
|
2117
|
-
},
|
|
2125
|
+
}, In = {
|
|
2118
2126
|
key: 1,
|
|
2119
2127
|
class: "aimd-editor-mode-host"
|
|
2120
|
-
},
|
|
2128
|
+
}, jn = /* @__PURE__ */ pe({
|
|
2121
2129
|
__name: "AimdEditor",
|
|
2122
2130
|
props: {
|
|
2123
2131
|
modelValue: { default: "" },
|
|
@@ -2141,21 +2149,21 @@ const xn = { class: "aimd-editor" }, Cn = {
|
|
|
2141
2149
|
},
|
|
2142
2150
|
emits: ["update:modelValue", "update:mode", "ready", "request-image"],
|
|
2143
2151
|
setup(e, { expose: n, emit: t }) {
|
|
2144
|
-
const a = e, o = t, v =
|
|
2152
|
+
const a = e, o = t, v = q(() => zt(a.locale, a.messages)), {
|
|
2145
2153
|
editorMode: p,
|
|
2146
2154
|
content: u,
|
|
2147
2155
|
commitUserContent: l,
|
|
2148
2156
|
monacoEditor: c,
|
|
2149
|
-
monacoInstance:
|
|
2157
|
+
monacoInstance: T,
|
|
2150
2158
|
milkdownEditorRef: d,
|
|
2151
|
-
extractedFields:
|
|
2152
|
-
toMilkdownMarkdown:
|
|
2153
|
-
switchMode:
|
|
2154
|
-
syncFromProp:
|
|
2155
|
-
insertTextIntoActiveEditor:
|
|
2156
|
-
handleMdAction:
|
|
2157
|
-
onMilkdownMarkdownUpdated:
|
|
2158
|
-
onMilkdownReady:
|
|
2159
|
+
extractedFields: M,
|
|
2160
|
+
toMilkdownMarkdown: V,
|
|
2161
|
+
switchMode: z,
|
|
2162
|
+
syncFromProp: k,
|
|
2163
|
+
insertTextIntoActiveEditor: w,
|
|
2164
|
+
handleMdAction: I,
|
|
2165
|
+
onMilkdownMarkdownUpdated: S,
|
|
2166
|
+
onMilkdownReady: $
|
|
2159
2167
|
} = Tn({
|
|
2160
2168
|
initialContent: a.modelValue,
|
|
2161
2169
|
initialMode: a.mode,
|
|
@@ -2163,102 +2171,102 @@ const xn = { class: "aimd-editor" }, Cn = {
|
|
|
2163
2171
|
emitModelValue: (s) => o("update:modelValue", s),
|
|
2164
2172
|
emitMode: (s) => o("update:mode", s)
|
|
2165
2173
|
});
|
|
2166
|
-
|
|
2167
|
-
s !== p.value &&
|
|
2174
|
+
Z(() => a.modelValue, (s) => k(s)), Z(() => a.mode, (s) => {
|
|
2175
|
+
s !== p.value && z(s);
|
|
2168
2176
|
});
|
|
2169
|
-
const
|
|
2170
|
-
function
|
|
2171
|
-
a.readonly || (
|
|
2177
|
+
const F = A(a.theme), W = q(() => a.keepInactiveEditorsMounted || p.value === "source"), G = q(() => a.keepInactiveEditorsMounted || p.value === "wysiwyg"), ee = q(() => ft(v.value)), Q = q(() => Vt(v.value)), j = A(!1), O = A("var"), K = A(!1), ae = A("str"), le = A(), se = A(!1), x = A("step"), f = A();
|
|
2178
|
+
function y(s) {
|
|
2179
|
+
a.readonly || (x.value = "step", f.value = s, se.value = !0);
|
|
2172
2180
|
}
|
|
2173
|
-
function
|
|
2174
|
-
a.readonly || (
|
|
2181
|
+
function C(s) {
|
|
2182
|
+
a.readonly || (x.value = "check", f.value = s, se.value = !0);
|
|
2175
2183
|
}
|
|
2176
|
-
function
|
|
2177
|
-
a.readonly || (
|
|
2184
|
+
function R(s) {
|
|
2185
|
+
a.readonly || (f.value ? f.value.apply(s) : w(`{{${x.value}|${s}}}${x.value === "step" ? `
|
|
2178
2186
|
|
|
2179
2187
|
` : " "}`));
|
|
2180
2188
|
}
|
|
2181
|
-
function
|
|
2182
|
-
a.readonly || (
|
|
2189
|
+
function H(s) {
|
|
2190
|
+
a.readonly || (le.value = s, K.value = !0);
|
|
2183
2191
|
}
|
|
2184
|
-
function
|
|
2185
|
-
a.readonly || (
|
|
2192
|
+
function X(s) {
|
|
2193
|
+
a.readonly || (le.value ? le.value.apply(s) : w(`{{var|${s}}}`));
|
|
2186
2194
|
}
|
|
2187
|
-
const
|
|
2188
|
-
const s =
|
|
2195
|
+
const oe = q(() => {
|
|
2196
|
+
const s = M.value;
|
|
2189
2197
|
if (!s) return [];
|
|
2190
|
-
const
|
|
2191
|
-
return
|
|
2192
|
-
}),
|
|
2193
|
-
const s =
|
|
2194
|
-
return s?.quiz ? s.quiz.map((
|
|
2198
|
+
const _ = O.value;
|
|
2199
|
+
return _ === "ref_step" ? s.step || [] : _ === "ref_var" ? s.var || [] : _ === "ref_fig" ? s.ref_fig || [] : [];
|
|
2200
|
+
}), ie = q(() => {
|
|
2201
|
+
const s = M.value;
|
|
2202
|
+
return s?.quiz ? s.quiz.map((_) => _.id) : [];
|
|
2195
2203
|
});
|
|
2196
2204
|
function fe(s) {
|
|
2197
2205
|
if (!a.readonly) {
|
|
2198
2206
|
if (s === "step" || s === "check") {
|
|
2199
|
-
|
|
2207
|
+
x.value = s, f.value = void 0, se.value = !0;
|
|
2200
2208
|
return;
|
|
2201
2209
|
}
|
|
2202
2210
|
if (s === "var") {
|
|
2203
2211
|
de("str");
|
|
2204
2212
|
return;
|
|
2205
2213
|
}
|
|
2206
|
-
|
|
2214
|
+
O.value = s, j.value = !0;
|
|
2207
2215
|
}
|
|
2208
2216
|
}
|
|
2209
2217
|
function de(s) {
|
|
2210
|
-
a.readonly || (
|
|
2218
|
+
a.readonly || (le.value = void 0, ae.value = s, K.value = !0);
|
|
2211
2219
|
}
|
|
2212
|
-
function
|
|
2220
|
+
function Te(s) {
|
|
2213
2221
|
if (!a.readonly) {
|
|
2214
2222
|
if (s === "step") {
|
|
2215
|
-
|
|
2223
|
+
w(`{{step|${_e(xe(u.value), "step")}, check=True}}
|
|
2216
2224
|
|
|
2217
2225
|
`);
|
|
2218
2226
|
return;
|
|
2219
2227
|
}
|
|
2220
2228
|
if (s === "var") {
|
|
2221
|
-
const
|
|
2222
|
-
|
|
2229
|
+
const _ = _e(xe(u.value));
|
|
2230
|
+
w(`{{var|${_}: str}}`);
|
|
2223
2231
|
return;
|
|
2224
2232
|
}
|
|
2225
|
-
|
|
2233
|
+
w(St(s, v.value));
|
|
2226
2234
|
}
|
|
2227
2235
|
}
|
|
2228
2236
|
function Ke(s) {
|
|
2229
|
-
|
|
2237
|
+
w(s);
|
|
2230
2238
|
}
|
|
2231
2239
|
function Ce(s) {
|
|
2232
2240
|
if (!(s instanceof HTMLElement)) return;
|
|
2233
|
-
const
|
|
2241
|
+
const _ = s.getBoundingClientRect();
|
|
2234
2242
|
return {
|
|
2235
|
-
top:
|
|
2236
|
-
right:
|
|
2237
|
-
bottom:
|
|
2238
|
-
left:
|
|
2239
|
-
width:
|
|
2240
|
-
height:
|
|
2243
|
+
top: _.top,
|
|
2244
|
+
right: _.right,
|
|
2245
|
+
bottom: _.bottom,
|
|
2246
|
+
left: _.left,
|
|
2247
|
+
width: _.width,
|
|
2248
|
+
height: _.height
|
|
2241
2249
|
};
|
|
2242
2250
|
}
|
|
2243
|
-
function $e(s,
|
|
2251
|
+
function $e(s, _) {
|
|
2244
2252
|
if (s === "image" && a.imageToolbarAction === "custom") {
|
|
2245
|
-
o("request-image", { buttonRect: Ce(
|
|
2253
|
+
o("request-image", { buttonRect: Ce(_.currentTarget) });
|
|
2246
2254
|
return;
|
|
2247
2255
|
}
|
|
2248
|
-
|
|
2256
|
+
I(s);
|
|
2249
2257
|
}
|
|
2250
|
-
const We =
|
|
2258
|
+
const We = A(null), Qe = A(null);
|
|
2251
2259
|
function Je(s) {
|
|
2252
2260
|
l(s);
|
|
2253
2261
|
}
|
|
2254
2262
|
function Ie(s) {
|
|
2255
2263
|
o("ready", { monaco: s });
|
|
2256
2264
|
}
|
|
2257
|
-
function
|
|
2258
|
-
|
|
2265
|
+
function g(s, _) {
|
|
2266
|
+
T.value = s, c.value = _;
|
|
2259
2267
|
}
|
|
2260
2268
|
function r(s) {
|
|
2261
|
-
|
|
2269
|
+
$(s), o("ready", { milkdown: s });
|
|
2262
2270
|
}
|
|
2263
2271
|
return n({
|
|
2264
2272
|
getContent: () => u.value,
|
|
@@ -2267,108 +2275,108 @@ const xn = { class: "aimd-editor" }, Cn = {
|
|
|
2267
2275
|
c.value.setValue(s);
|
|
2268
2276
|
else if (d.value)
|
|
2269
2277
|
try {
|
|
2270
|
-
d.value.action(Le(
|
|
2278
|
+
d.value.action(Le(V(s)));
|
|
2271
2279
|
} catch {
|
|
2272
2280
|
}
|
|
2273
2281
|
},
|
|
2274
2282
|
getMode: () => p.value,
|
|
2275
|
-
setMode: (s) =>
|
|
2283
|
+
setMode: (s) => z(s),
|
|
2276
2284
|
getMonacoEditor: () => c.value,
|
|
2277
2285
|
getMilkdownEditor: () => d.value,
|
|
2278
|
-
insertText:
|
|
2279
|
-
}), (s,
|
|
2280
|
-
e.showToolbar ? (
|
|
2286
|
+
insertText: w
|
|
2287
|
+
}), (s, _) => (h(), b("div", Cn, [
|
|
2288
|
+
e.showToolbar ? (h(), me(xn, {
|
|
2281
2289
|
key: 0,
|
|
2282
2290
|
"show-top-bar": e.showTopBar,
|
|
2283
2291
|
"show-md-toolbar": e.showMdToolbar,
|
|
2284
2292
|
"show-aimd-toolbar": e.showAimdToolbar,
|
|
2285
|
-
"editor-mode":
|
|
2293
|
+
"editor-mode": Y(p),
|
|
2286
2294
|
"resolved-messages": v.value,
|
|
2287
|
-
"localized-field-types":
|
|
2288
|
-
"localized-md-toolbar-items":
|
|
2289
|
-
onSwitchMode:
|
|
2295
|
+
"localized-field-types": ee.value,
|
|
2296
|
+
"localized-md-toolbar-items": Q.value,
|
|
2297
|
+
onSwitchMode: Y(z),
|
|
2290
2298
|
onMdAction: $e,
|
|
2291
2299
|
onOpenAimdDialog: fe,
|
|
2292
|
-
onQuickInsertAimd:
|
|
2300
|
+
onQuickInsertAimd: Te,
|
|
2293
2301
|
onInsertInput: de
|
|
2294
|
-
}, null, 8, ["show-top-bar", "show-md-toolbar", "show-aimd-toolbar", "editor-mode", "resolved-messages", "localized-field-types", "localized-md-toolbar-items", "onSwitchMode"])) :
|
|
2302
|
+
}, null, 8, ["show-top-bar", "show-md-toolbar", "show-aimd-toolbar", "editor-mode", "resolved-messages", "localized-field-types", "localized-md-toolbar-items", "onSwitchMode"])) : B("", !0),
|
|
2295
2303
|
i("div", {
|
|
2296
2304
|
class: "aimd-editor-panel",
|
|
2297
2305
|
style: Ue({ minHeight: e.minHeight + "px" })
|
|
2298
2306
|
}, [
|
|
2299
|
-
W.value ? D((
|
|
2300
|
-
|
|
2307
|
+
W.value ? D((h(), b("div", $n, [
|
|
2308
|
+
ue(Lt, {
|
|
2301
2309
|
ref_key: "sourceEditorRef",
|
|
2302
2310
|
ref: We,
|
|
2303
|
-
content:
|
|
2304
|
-
theme:
|
|
2311
|
+
content: Y(u),
|
|
2312
|
+
theme: F.value,
|
|
2305
2313
|
"min-height": e.minHeight,
|
|
2306
2314
|
readonly: e.readonly,
|
|
2307
2315
|
"monaco-options": e.monacoOptions,
|
|
2308
2316
|
"resolved-messages": v.value,
|
|
2309
2317
|
onContentChange: Je,
|
|
2310
2318
|
onReady: Ie,
|
|
2311
|
-
onMonacoLoaded:
|
|
2319
|
+
onMonacoLoaded: g
|
|
2312
2320
|
}, null, 8, ["content", "theme", "min-height", "readonly", "monaco-options", "resolved-messages"])
|
|
2313
2321
|
], 512)), [
|
|
2314
|
-
[at,
|
|
2315
|
-
]) :
|
|
2316
|
-
|
|
2317
|
-
|
|
2322
|
+
[at, Y(p) === "source"]
|
|
2323
|
+
]) : B("", !0),
|
|
2324
|
+
G.value ? D((h(), b("div", In, [
|
|
2325
|
+
ue(Dt, {
|
|
2318
2326
|
ref_key: "wysiwygEditorRef",
|
|
2319
2327
|
ref: Qe,
|
|
2320
|
-
content:
|
|
2328
|
+
content: Y(u),
|
|
2321
2329
|
"min-height": e.minHeight,
|
|
2322
2330
|
"enable-block-handle": e.enableBlockHandle,
|
|
2323
|
-
active:
|
|
2331
|
+
active: Y(p) === "wysiwyg",
|
|
2324
2332
|
"resolved-messages": v.value,
|
|
2325
|
-
"localized-field-types":
|
|
2333
|
+
"localized-field-types": ee.value,
|
|
2326
2334
|
"field-display": e.fieldDisplay,
|
|
2327
2335
|
"edit-input-fields": !0,
|
|
2328
2336
|
readonly: e.readonly,
|
|
2329
|
-
onMarkdownUpdated:
|
|
2337
|
+
onMarkdownUpdated: Y(S),
|
|
2330
2338
|
onReady: r,
|
|
2331
2339
|
onOpenAimdDialog: fe,
|
|
2332
|
-
onEditInput:
|
|
2333
|
-
onEditStep:
|
|
2334
|
-
onEditCheck:
|
|
2340
|
+
onEditInput: H,
|
|
2341
|
+
onEditStep: y,
|
|
2342
|
+
onEditCheck: C
|
|
2335
2343
|
}, null, 8, ["content", "min-height", "enable-block-handle", "active", "resolved-messages", "localized-field-types", "field-display", "readonly", "onMarkdownUpdated"])
|
|
2336
2344
|
], 512)), [
|
|
2337
|
-
[at,
|
|
2338
|
-
]) :
|
|
2345
|
+
[at, Y(p) === "wysiwyg"]
|
|
2346
|
+
]) : B("", !0)
|
|
2339
2347
|
], 4),
|
|
2340
|
-
|
|
2341
|
-
visible:
|
|
2342
|
-
"onUpdate:visible":
|
|
2343
|
-
"field-type":
|
|
2344
|
-
content:
|
|
2345
|
-
"field-content":
|
|
2348
|
+
ue(Ai, {
|
|
2349
|
+
visible: se.value,
|
|
2350
|
+
"onUpdate:visible": _[0] || (_[0] = (E) => se.value = E),
|
|
2351
|
+
"field-type": x.value,
|
|
2352
|
+
content: Y(u),
|
|
2353
|
+
"field-content": f.value?.content,
|
|
2346
2354
|
messages: v.value,
|
|
2347
|
-
onSave:
|
|
2355
|
+
onSave: R
|
|
2348
2356
|
}, null, 8, ["visible", "field-type", "content", "field-content", "messages"]),
|
|
2349
|
-
|
|
2350
|
-
visible:
|
|
2351
|
-
"onUpdate:visible":
|
|
2352
|
-
content:
|
|
2353
|
-
"field-content":
|
|
2354
|
-
"initial-preset":
|
|
2357
|
+
ue(hi, {
|
|
2358
|
+
visible: K.value,
|
|
2359
|
+
"onUpdate:visible": _[1] || (_[1] = (E) => K.value = E),
|
|
2360
|
+
content: Y(u),
|
|
2361
|
+
"field-content": le.value?.content,
|
|
2362
|
+
"initial-preset": ae.value,
|
|
2355
2363
|
"var-type-plugins": e.varTypePlugins,
|
|
2356
2364
|
messages: v.value,
|
|
2357
|
-
onSave:
|
|
2365
|
+
onSave: X
|
|
2358
2366
|
}, null, 8, ["visible", "content", "field-content", "initial-preset", "var-type-plugins", "messages"]),
|
|
2359
|
-
|
|
2360
|
-
visible:
|
|
2361
|
-
"initial-type":
|
|
2367
|
+
ue(Gs, {
|
|
2368
|
+
visible: j.value,
|
|
2369
|
+
"initial-type": O.value,
|
|
2362
2370
|
messages: v.value,
|
|
2363
|
-
"ref-suggestions":
|
|
2371
|
+
"ref-suggestions": oe.value,
|
|
2364
2372
|
"var-type-plugins": e.varTypePlugins,
|
|
2365
|
-
"existing-quiz-ids":
|
|
2366
|
-
"onUpdate:visible":
|
|
2373
|
+
"existing-quiz-ids": ie.value,
|
|
2374
|
+
"onUpdate:visible": _[2] || (_[2] = (E) => j.value = E),
|
|
2367
2375
|
onInsert: Ke
|
|
2368
2376
|
}, null, 8, ["visible", "initial-type", "messages", "ref-suggestions", "var-type-plugins", "existing-quiz-ids"])
|
|
2369
2377
|
]));
|
|
2370
2378
|
}
|
|
2371
|
-
}),
|
|
2379
|
+
}), Fn = { class: "aimd-editor-mode-switch" }, An = ["title"], zn = ["innerHTML"], Vn = ["title"], Dn = ["innerHTML"], Kn = /* @__PURE__ */ pe({
|
|
2372
2380
|
__name: "AimdEditorTopBar",
|
|
2373
2381
|
props: {
|
|
2374
2382
|
editorMode: {},
|
|
@@ -2380,7 +2388,7 @@ const xn = { class: "aimd-editor" }, Cn = {
|
|
|
2380
2388
|
source: '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>',
|
|
2381
2389
|
wysiwyg: '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>'
|
|
2382
2390
|
};
|
|
2383
|
-
return (o, v) => (
|
|
2391
|
+
return (o, v) => (h(), b("div", Fn, [
|
|
2384
2392
|
i("button", {
|
|
2385
2393
|
class: ye(["aimd-editor-mode-btn", { active: e.editorMode === "source" }]),
|
|
2386
2394
|
onClick: v[0] || (v[0] = (p) => t("switch-mode", "source")),
|
|
@@ -2389,9 +2397,9 @@ const xn = { class: "aimd-editor" }, Cn = {
|
|
|
2389
2397
|
i("span", {
|
|
2390
2398
|
class: "aimd-editor-mode-icon",
|
|
2391
2399
|
innerHTML: a.source
|
|
2392
|
-
}, null, 8,
|
|
2400
|
+
}, null, 8, zn),
|
|
2393
2401
|
i("span", null, m(e.resolvedMessages.mode.source), 1)
|
|
2394
|
-
], 10,
|
|
2402
|
+
], 10, An),
|
|
2395
2403
|
i("button", {
|
|
2396
2404
|
class: ye(["aimd-editor-mode-btn", { active: e.editorMode === "wysiwyg" }]),
|
|
2397
2405
|
onClick: v[1] || (v[1] = (p) => t("switch-mode", "wysiwyg")),
|
|
@@ -2400,18 +2408,18 @@ const xn = { class: "aimd-editor" }, Cn = {
|
|
|
2400
2408
|
i("span", {
|
|
2401
2409
|
class: "aimd-editor-mode-icon",
|
|
2402
2410
|
innerHTML: a.wysiwyg
|
|
2403
|
-
}, null, 8,
|
|
2411
|
+
}, null, 8, Dn),
|
|
2404
2412
|
i("span", null, m(e.resolvedMessages.mode.wysiwyg), 1)
|
|
2405
|
-
], 10,
|
|
2413
|
+
], 10, Vn)
|
|
2406
2414
|
]));
|
|
2407
2415
|
}
|
|
2408
2416
|
});
|
|
2409
2417
|
export {
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2418
|
+
hi as A,
|
|
2419
|
+
jn as _,
|
|
2420
|
+
xn as a,
|
|
2421
|
+
Kn as b,
|
|
2422
|
+
Gs as c,
|
|
2423
|
+
Ai as d,
|
|
2416
2424
|
Tn as u
|
|
2417
2425
|
};
|