@airalogy/aimd-recorder 1.15.0 → 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/dist/{AimdDnaSequenceField-D-EXuZgw.js → AimdDnaSequenceField-CPyMqIVh.js} +1 -1
- package/dist/{AimdEditor.vue_vue_type_style_index_0_lang-BFuOo7df.js → AimdEditor.vue_vue_type_style_index_0_lang-lyHIpch9.js} +3141 -3120
- package/dist/{AimdMarkdownField-DGDl9M2z.js → AimdMarkdownField-CX71bOdX.js} +2 -2
- package/dist/{AimdMarkdownNoteField-DluU9HV5.js → AimdMarkdownNoteField--ssNIQfG.js} +2 -2
- package/dist/aimd-recorder.css +1 -1
- package/dist/components.js +284 -282
- package/dist/composables.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{useFieldRendering-RBC8P3jQ.js → useFieldRendering-Dh6Kib_0.js} +1 -1
- package/package.json +3 -3
- package/src/components/AimdRecorderEditor.vue +2 -2
- package/src/composables/workbenchFieldEditing.ts +8 -5
package/dist/components.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineAsyncComponent as it, defineComponent as Ee, h as f, ref as K, onMounted as Zt, nextTick as Pe, onBeforeUnmount as nt, watch as de, Transition as Ca, computed as z, openBlock as _, createElementBlock as w, createElementVNode as v, toDisplayString as C, unref as qe, createCommentVNode as O, Fragment as fe, renderList as pe, withDirectives as Je, vModelRadio as Vt, vModelText as Xt, normalizeClass as Ce, createTextVNode as et, reactive as ft, createVNode as Oe, render as Ft, watchEffect as za, getCurrentInstance as $a, normalizeStyle as Qe, mergeProps as Ea, createBlock as Mt, withModifiers as ut } from "vue";
|
|
2
|
-
import { renderToVue as
|
|
3
|
-
import { g as Ge, c as Jt, a as
|
|
4
|
-
import { Z as ea, aj as Ga, ak as Ya, al as Pt, c as Ue, a9 as Za, _ as Xa, a8 as Ja, E as Ot, y as ei, s as xe, a3 as ti, G as at, F as ai, z as ii, H as ni, ah as gt, ag as ri, v as li, w as si, ad as oi, am as Le, a as vt, h as ta, g as di, ac as ci, ae as ui, a4 as mi, p as fi, x as hi, j as vi, n as yi, a1 as pi, $ as gi, a7 as bi, a6 as _i, D as ki, an as wi, ao as Ci, C as zi, M as $i, a2 as Ei, S as tt, U as
|
|
2
|
+
import { renderToVue as Sa, parseAndExtract as ht } from "@airalogy/aimd-renderer";
|
|
3
|
+
import { g as Ge, c as Jt, a as Ta, r as qa, P as Da, d as Ra, $ as Aa, b as xa, h as Va, e as Fa, f as Ma, i as Ba, j as Bt, k as Ia, l as It, N as Pa, m as Oa, n as La, o as Na, u as Ha, p as Ka, q as Wa, s as Ua, t as ja, _ as Qa } from "./AimdEditor.vue_vue_type_style_index_0_lang-lyHIpch9.js";
|
|
4
|
+
import { Z as ea, aj as Ga, ak as Ya, al as Pt, c as Ue, a9 as Za, _ as Xa, a8 as Ja, E as Ot, y as ei, s as xe, a3 as ti, G as at, F as ai, z as ii, H as ni, ah as gt, ag as ri, v as li, w as si, ad as oi, am as Le, a as vt, h as ta, g as di, ac as ci, ae as ui, a4 as mi, p as fi, x as hi, j as vi, n as yi, a1 as pi, $ as gi, a7 as bi, a6 as _i, D as ki, an as wi, ao as Ci, C as zi, M as $i, a2 as Ei, S as tt, U as Si, K as Ti, T as qi, X as Di } from "./useFieldRendering-Dh6Kib_0.js";
|
|
5
5
|
import { isScaleQuizAnswerComplete as Ri, gradeScaleQuizLocally as Ai } from "@airalogy/aimd-core";
|
|
6
6
|
import { _ as Ye } from "./_commonjsHelpers-CZXJ37nu.js";
|
|
7
7
|
const xi = it(() => import("./AimdCodeField-DC3DPvgc.js")), Vi = Ee({
|
|
@@ -21,18 +21,18 @@ const xi = it(() => import("./AimdCodeField-DC3DPvgc.js")), Vi = Ee({
|
|
|
21
21
|
emits: ["change", "blur"],
|
|
22
22
|
setup(e, { emit: t }) {
|
|
23
23
|
return () => {
|
|
24
|
-
const i = e.node, a = i.id, r = i.definition?.type || "str",
|
|
25
|
-
function W(
|
|
26
|
-
const
|
|
24
|
+
const i = e.node, a = i.id, r = i.definition?.type || "str", g = ea(r), d = e.inputKind, p = g === "int" || g === "integer", h = d === "number" && !p, D = e.fieldMeta, T = e.disabled, A = e.extraClasses, L = D?.placeholder ?? Fi(i), j = e.displayValue, Y = Ga(r, D) ?? "plaintext", I = d === "number" ? Ya(r, i.definition?.kwargs) : {}, G = d === "number" ? Pt(j, r, i.definition?.kwargs) : null;
|
|
25
|
+
function W(b) {
|
|
26
|
+
const S = Xa(b, r, d, {
|
|
27
27
|
typePlugin: e.typePlugin
|
|
28
28
|
});
|
|
29
|
-
t("change", { id: a, value:
|
|
29
|
+
t("change", { id: a, value: S, type: r, inputKind: d });
|
|
30
30
|
}
|
|
31
31
|
function N() {
|
|
32
32
|
t("blur", { id: a });
|
|
33
33
|
}
|
|
34
|
-
function k(
|
|
35
|
-
Ue(
|
|
34
|
+
function k(b) {
|
|
35
|
+
Ue(b, d), typeof HTMLTextAreaElement < "u" && b instanceof HTMLTextAreaElement && Ja(b);
|
|
36
36
|
}
|
|
37
37
|
const V = D?.enumOptions ?? [];
|
|
38
38
|
if (V.length)
|
|
@@ -46,16 +46,16 @@ const xi = it(() => import("./AimdCodeField-DC3DPvgc.js")), Vi = Ee({
|
|
|
46
46
|
f("select", {
|
|
47
47
|
"data-rec-focus-key": `var:${a}`,
|
|
48
48
|
class: "aimd-rec-inline__input aimd-rec-inline__input--stacked aimd-rec-inline__select",
|
|
49
|
-
disabled:
|
|
49
|
+
disabled: T,
|
|
50
50
|
value: e.value,
|
|
51
|
-
onChange: (
|
|
51
|
+
onChange: (b) => W(b.target.value),
|
|
52
52
|
onBlur: N
|
|
53
|
-
}, V.map((
|
|
53
|
+
}, V.map((b) => f("option", { key: String(b.value), value: b.value }, b.label)))
|
|
54
54
|
]);
|
|
55
|
-
const R = (
|
|
55
|
+
const R = (b, S) => f("span", {
|
|
56
56
|
class: [
|
|
57
57
|
"aimd-rec-inline aimd-rec-inline--var-stacked aimd-field-wrapper aimd-field-wrapper--inline",
|
|
58
|
-
|
|
58
|
+
S,
|
|
59
59
|
G ? "aimd-rec-inline--error" : void 0,
|
|
60
60
|
...A
|
|
61
61
|
]
|
|
@@ -64,7 +64,7 @@ const xi = it(() => import("./AimdCodeField-DC3DPvgc.js")), Vi = Ee({
|
|
|
64
64
|
f("span", { class: "aimd-field__scope aimd-field__scope--var" }, Ge("var", e.messages)),
|
|
65
65
|
f("span", { class: "aimd-field__id" }, a)
|
|
66
66
|
]),
|
|
67
|
-
|
|
67
|
+
b
|
|
68
68
|
]);
|
|
69
69
|
if (d === "checkbox")
|
|
70
70
|
return R(
|
|
@@ -72,13 +72,13 @@ const xi = it(() => import("./AimdCodeField-DC3DPvgc.js")), Vi = Ee({
|
|
|
72
72
|
f("input", {
|
|
73
73
|
"data-rec-focus-key": `var:${a}`,
|
|
74
74
|
type: "checkbox",
|
|
75
|
-
disabled:
|
|
75
|
+
disabled: T,
|
|
76
76
|
checked: Za(e.value),
|
|
77
|
-
onVnodeMounted: (
|
|
78
|
-
onVnodeUpdated: (
|
|
79
|
-
onChange: (
|
|
80
|
-
const
|
|
81
|
-
t("change", { id: a, value:
|
|
77
|
+
onVnodeMounted: (b) => Ue(b.el, d),
|
|
78
|
+
onVnodeUpdated: (b) => Ue(b.el, d),
|
|
79
|
+
onChange: (b) => {
|
|
80
|
+
const S = b.target.checked;
|
|
81
|
+
t("change", { id: a, value: S, type: r, inputKind: d });
|
|
82
82
|
},
|
|
83
83
|
onBlur: N
|
|
84
84
|
})
|
|
@@ -90,12 +90,12 @@ const xi = it(() => import("./AimdCodeField-DC3DPvgc.js")), Vi = Ee({
|
|
|
90
90
|
f("textarea", {
|
|
91
91
|
"data-rec-focus-key": `var:${a}`,
|
|
92
92
|
class: "aimd-rec-inline__textarea aimd-rec-inline__textarea--stacked",
|
|
93
|
-
disabled:
|
|
93
|
+
disabled: T,
|
|
94
94
|
placeholder: L,
|
|
95
95
|
value: j,
|
|
96
|
-
onVnodeMounted: (
|
|
97
|
-
onVnodeUpdated: (
|
|
98
|
-
onInput: (
|
|
96
|
+
onVnodeMounted: (b) => Ue(b.el, d),
|
|
97
|
+
onVnodeUpdated: (b) => Ue(b.el, d),
|
|
98
|
+
onInput: (b) => W(b.target.value),
|
|
99
99
|
onBlur: N
|
|
100
100
|
}),
|
|
101
101
|
d === "dna" ? "aimd-rec-inline--var-stacked--dna" : "aimd-rec-inline--var-stacked--textarea"
|
|
@@ -105,8 +105,8 @@ const xi = it(() => import("./AimdCodeField-DC3DPvgc.js")), Vi = Ee({
|
|
|
105
105
|
f(xi, {
|
|
106
106
|
modelValue: typeof j == "number" ? String(j) : j,
|
|
107
107
|
language: Y,
|
|
108
|
-
disabled:
|
|
109
|
-
"onUpdate:modelValue": (
|
|
108
|
+
disabled: T,
|
|
109
|
+
"onUpdate:modelValue": (b) => W(b),
|
|
110
110
|
onBlur: N
|
|
111
111
|
}),
|
|
112
112
|
"aimd-rec-inline--var-stacked--code"
|
|
@@ -117,30 +117,30 @@ const xi = it(() => import("./AimdCodeField-DC3DPvgc.js")), Vi = Ee({
|
|
|
117
117
|
"data-rec-focus-key": `var:${a}`,
|
|
118
118
|
class: "aimd-rec-inline__textarea aimd-rec-inline__textarea--stacked aimd-rec-inline__textarea--stacked-text",
|
|
119
119
|
rows: 1,
|
|
120
|
-
disabled:
|
|
120
|
+
disabled: T,
|
|
121
121
|
placeholder: L,
|
|
122
122
|
value: j,
|
|
123
|
-
onVnodeMounted: (
|
|
124
|
-
const
|
|
125
|
-
k(
|
|
123
|
+
onVnodeMounted: (b) => {
|
|
124
|
+
const S = b.el;
|
|
125
|
+
k(S);
|
|
126
126
|
},
|
|
127
|
-
onVnodeUpdated: (
|
|
128
|
-
const
|
|
129
|
-
k(
|
|
127
|
+
onVnodeUpdated: (b) => {
|
|
128
|
+
const S = b.el;
|
|
129
|
+
k(S);
|
|
130
130
|
},
|
|
131
|
-
onInput: (
|
|
132
|
-
const
|
|
133
|
-
k(
|
|
131
|
+
onInput: (b) => {
|
|
132
|
+
const S = b.target;
|
|
133
|
+
k(S), W(S.value);
|
|
134
134
|
},
|
|
135
135
|
onBlur: N
|
|
136
136
|
})
|
|
137
137
|
);
|
|
138
138
|
const B = d === "datetime" ? "datetime-local" : h ? "text" : d, Q = d === "number" && B === "number" ? I : {};
|
|
139
|
-
function H(
|
|
139
|
+
function H(b) {
|
|
140
140
|
if (d !== "number")
|
|
141
141
|
return;
|
|
142
|
-
const
|
|
143
|
-
|
|
142
|
+
const S = Pt(b.value, r, i.definition?.kwargs);
|
|
143
|
+
b.setCustomValidity(S ?? "");
|
|
144
144
|
}
|
|
145
145
|
return R(
|
|
146
146
|
f("input", {
|
|
@@ -150,23 +150,23 @@ const xi = it(() => import("./AimdCodeField-DC3DPvgc.js")), Vi = Ee({
|
|
|
150
150
|
inputmode: d === "number" ? p ? "numeric" : "decimal" : void 0,
|
|
151
151
|
min: Q.min,
|
|
152
152
|
max: Q.max,
|
|
153
|
-
disabled:
|
|
153
|
+
disabled: T,
|
|
154
154
|
placeholder: L,
|
|
155
155
|
step: d === "number" ? Q.step ?? (p ? "1" : void 0) : d === "time" ? "1" : void 0,
|
|
156
156
|
title: G ?? void 0,
|
|
157
157
|
"aria-invalid": G ? "true" : void 0,
|
|
158
158
|
value: j,
|
|
159
|
-
onVnodeMounted: (
|
|
160
|
-
const
|
|
161
|
-
k(
|
|
159
|
+
onVnodeMounted: (b) => {
|
|
160
|
+
const S = b.el;
|
|
161
|
+
k(S), H(S);
|
|
162
162
|
},
|
|
163
|
-
onVnodeUpdated: (
|
|
164
|
-
const
|
|
165
|
-
k(
|
|
163
|
+
onVnodeUpdated: (b) => {
|
|
164
|
+
const S = b.el;
|
|
165
|
+
k(S), H(S);
|
|
166
166
|
},
|
|
167
|
-
onInput: (
|
|
168
|
-
const
|
|
169
|
-
k(
|
|
167
|
+
onInput: (b) => {
|
|
168
|
+
const S = b.target;
|
|
169
|
+
k(S), H(S), W(S.value);
|
|
170
170
|
},
|
|
171
171
|
onBlur: N
|
|
172
172
|
})
|
|
@@ -232,9 +232,9 @@ const Mi = Ee({
|
|
|
232
232
|
],
|
|
233
233
|
setup(e, { emit: t }) {
|
|
234
234
|
const i = K(null), a = K(!1), r = K(!1);
|
|
235
|
-
let
|
|
235
|
+
let g = null, d = null, p = null, h = 0;
|
|
236
236
|
const D = 40;
|
|
237
|
-
function
|
|
237
|
+
function T(k) {
|
|
238
238
|
return e.disabled ? !0 : !!e.fieldMeta?.[`var_table:${e.node.id}:${k}`]?.disabled;
|
|
239
239
|
}
|
|
240
240
|
function A(k, V) {
|
|
@@ -242,7 +242,7 @@ const Mi = Ee({
|
|
|
242
242
|
return B === "compact" ? Math.max(7, Math.min(12, R + 2)) : B === "wide" ? Math.max(16, Math.min(42, R + 5)) : Math.max(10, Math.min(22, R + 4));
|
|
243
243
|
}
|
|
244
244
|
function L(k, V) {
|
|
245
|
-
return 108 + k.reduce((
|
|
245
|
+
return 108 + k.reduce((S, q) => S + A(q, V) * 8.2 + 24, 0);
|
|
246
246
|
}
|
|
247
247
|
function j(k, V) {
|
|
248
248
|
return `${A(k, V)}ch`;
|
|
@@ -280,13 +280,13 @@ const Mi = Ee({
|
|
|
280
280
|
requestAnimationFrame(V);
|
|
281
281
|
}
|
|
282
282
|
function N(k, V, R, B, Q) {
|
|
283
|
-
return R.map((H,
|
|
284
|
-
const
|
|
283
|
+
return R.map((H, b) => {
|
|
284
|
+
const S = Ot(H), q = V[0] ?? "", J = V.slice(q ? 1 : 0);
|
|
285
285
|
return f("div", {
|
|
286
|
-
key: `${k}-card-${
|
|
286
|
+
key: `${k}-card-${S}`,
|
|
287
287
|
class: "aimd-rec-card",
|
|
288
|
-
onDragover: (P) => t("drag-over", { tableName: k, rowIndex:
|
|
289
|
-
onDrop: (P) => t("drag-drop", { tableName: k, rowIndex:
|
|
288
|
+
onDragover: (P) => t("drag-over", { tableName: k, rowIndex: b, event: P }),
|
|
289
|
+
onDrop: (P) => t("drag-drop", { tableName: k, rowIndex: b, columns: V, event: P })
|
|
290
290
|
}, [
|
|
291
291
|
f("div", { class: "aimd-rec-card__toolbar" }, [
|
|
292
292
|
f("span", {
|
|
@@ -296,10 +296,10 @@ const Mi = Ee({
|
|
|
296
296
|
],
|
|
297
297
|
title: e.readonly ? Q.table.dragDisabled : Q.table.dragReorder,
|
|
298
298
|
draggable: !e.readonly,
|
|
299
|
-
onDragstart: (P) => t("drag-start", { tableName: k, rowIndex:
|
|
299
|
+
onDragstart: (P) => t("drag-start", { tableName: k, rowIndex: b, event: P }),
|
|
300
300
|
onDragend: () => t("drag-end")
|
|
301
301
|
}, Array.from({ length: 6 }, (P, X) => f("span", {
|
|
302
|
-
key: `${
|
|
302
|
+
key: `${S}-card-drag-dot-${X}`,
|
|
303
303
|
class: "aimd-rec-inline-table__drag-dot"
|
|
304
304
|
}))),
|
|
305
305
|
f("button", {
|
|
@@ -308,22 +308,22 @@ const Mi = Ee({
|
|
|
308
308
|
disabled: B || R.length <= 1,
|
|
309
309
|
"aria-label": Q.table.deleteRow,
|
|
310
310
|
title: Q.table.deleteRow,
|
|
311
|
-
onClick: () => t("remove-row", { tableName: k, rowIndex:
|
|
311
|
+
onClick: () => t("remove-row", { tableName: k, rowIndex: b, columns: V })
|
|
312
312
|
}, [Lt()])
|
|
313
313
|
]),
|
|
314
314
|
q ? f("div", { class: "aimd-rec-card__field aimd-rec-card__field--title" }, [
|
|
315
315
|
f("span", { class: "aimd-rec-card__label" }, q),
|
|
316
316
|
f("input", {
|
|
317
|
-
"data-rec-focus-key": `var_table:${k}:${
|
|
317
|
+
"data-rec-focus-key": `var_table:${k}:${b}:${q}`,
|
|
318
318
|
class: "aimd-rec-card__input",
|
|
319
|
-
disabled:
|
|
319
|
+
disabled: T(q),
|
|
320
320
|
placeholder: q,
|
|
321
321
|
value: H[q] ?? "",
|
|
322
322
|
onInput: (P) => {
|
|
323
323
|
t("cell-input", {
|
|
324
324
|
tableName: k,
|
|
325
325
|
column: q,
|
|
326
|
-
rowIndex:
|
|
326
|
+
rowIndex: b,
|
|
327
327
|
value: P.target.value,
|
|
328
328
|
row: H
|
|
329
329
|
});
|
|
@@ -333,7 +333,7 @@ const Mi = Ee({
|
|
|
333
333
|
!X || !X.includes(" ") && !/[\r\n]/.test(X) || (P.preventDefault(), t("cell-paste", {
|
|
334
334
|
tableName: k,
|
|
335
335
|
column: q,
|
|
336
|
-
rowIndex:
|
|
336
|
+
rowIndex: b,
|
|
337
337
|
text: X
|
|
338
338
|
}));
|
|
339
339
|
},
|
|
@@ -343,21 +343,21 @@ const Mi = Ee({
|
|
|
343
343
|
f("div", { class: "aimd-rec-card__body" }, J.map((P) => {
|
|
344
344
|
const he = e.fieldState?.[`var_table:${k}:${P}`]?.validationError ? "aimd-rec-card__input aimd-rec-card__input--error" : "aimd-rec-card__input";
|
|
345
345
|
return f("div", {
|
|
346
|
-
key: `${k}-${
|
|
346
|
+
key: `${k}-${S}-${P}`,
|
|
347
347
|
class: "aimd-rec-card__field"
|
|
348
348
|
}, [
|
|
349
349
|
f("span", { class: "aimd-rec-card__label" }, P),
|
|
350
350
|
f("input", {
|
|
351
|
-
"data-rec-focus-key": `var_table:${k}:${
|
|
351
|
+
"data-rec-focus-key": `var_table:${k}:${b}:${P}`,
|
|
352
352
|
class: he,
|
|
353
|
-
disabled:
|
|
353
|
+
disabled: T(P),
|
|
354
354
|
placeholder: P,
|
|
355
355
|
value: H[P] ?? "",
|
|
356
356
|
onInput: (ie) => {
|
|
357
357
|
t("cell-input", {
|
|
358
358
|
tableName: k,
|
|
359
359
|
column: P,
|
|
360
|
-
rowIndex:
|
|
360
|
+
rowIndex: b,
|
|
361
361
|
value: ie.target.value,
|
|
362
362
|
row: H
|
|
363
363
|
});
|
|
@@ -367,7 +367,7 @@ const Mi = Ee({
|
|
|
367
367
|
!$ || !$.includes(" ") && !/[\r\n]/.test($) || (ie.preventDefault(), t("cell-paste", {
|
|
368
368
|
tableName: k,
|
|
369
369
|
column: P,
|
|
370
|
-
rowIndex:
|
|
370
|
+
rowIndex: b,
|
|
371
371
|
text: $
|
|
372
372
|
}));
|
|
373
373
|
},
|
|
@@ -379,9 +379,9 @@ const Mi = Ee({
|
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
return Zt(() => {
|
|
382
|
-
i.value && (
|
|
382
|
+
i.value && (g = new ResizeObserver(() => G()), g.observe(i.value), Pe(() => W()));
|
|
383
383
|
}), nt(() => {
|
|
384
|
-
|
|
384
|
+
g?.disconnect(), d !== null && cancelAnimationFrame(d);
|
|
385
385
|
}), de(() => e.columns, () => Pe(() => G())), de(() => e.rows, () => Pe(() => G()), { deep: !0 }), () => {
|
|
386
386
|
const k = e.node.id, V = e.columns, R = e.rows, B = e.disabled, Q = e.messages;
|
|
387
387
|
return f("div", {
|
|
@@ -427,17 +427,17 @@ const Mi = Ee({
|
|
|
427
427
|
f("th", { class: "aimd-rec-inline-table__action-head" }, Q.table.actionColumn)
|
|
428
428
|
])
|
|
429
429
|
]),
|
|
430
|
-
f("tbody", R.map((H,
|
|
431
|
-
const
|
|
430
|
+
f("tbody", R.map((H, b) => {
|
|
431
|
+
const S = Ot(H);
|
|
432
432
|
return f("tr", {
|
|
433
|
-
key: `${k}-${
|
|
433
|
+
key: `${k}-${S}`,
|
|
434
434
|
class: [
|
|
435
435
|
"aimd-rec-inline-table__row",
|
|
436
|
-
|
|
437
|
-
e.settlingRowKey ===
|
|
436
|
+
b % 2 === 1 ? "aimd-rec-inline-table__row--alt" : "",
|
|
437
|
+
e.settlingRowKey === S ? "aimd-rec-inline-table__row--settling" : ""
|
|
438
438
|
],
|
|
439
|
-
onDragover: (q) => t("drag-over", { tableName: k, rowIndex:
|
|
440
|
-
onDrop: (q) => t("drag-drop", { tableName: k, rowIndex:
|
|
439
|
+
onDragover: (q) => t("drag-over", { tableName: k, rowIndex: b, event: q }),
|
|
440
|
+
onDrop: (q) => t("drag-drop", { tableName: k, rowIndex: b, columns: V, event: q })
|
|
441
441
|
}, [
|
|
442
442
|
f("td", { class: "aimd-rec-inline-table__drag-cell" }, [
|
|
443
443
|
f("span", {
|
|
@@ -447,15 +447,15 @@ const Mi = Ee({
|
|
|
447
447
|
],
|
|
448
448
|
title: e.readonly ? Q.table.dragDisabled : Q.table.dragReorder,
|
|
449
449
|
draggable: !e.readonly,
|
|
450
|
-
onDragstart: (q) => t("drag-start", { tableName: k, rowIndex:
|
|
450
|
+
onDragstart: (q) => t("drag-start", { tableName: k, rowIndex: b, event: q }),
|
|
451
451
|
onDragend: () => t("drag-end")
|
|
452
452
|
}, Array.from({ length: 6 }, (q, J) => f("span", {
|
|
453
|
-
key: `${
|
|
453
|
+
key: `${S}-drag-dot-${J}`,
|
|
454
454
|
class: "aimd-rec-inline-table__drag-dot"
|
|
455
455
|
})))
|
|
456
456
|
]),
|
|
457
457
|
...V.map((q) => f("td", {
|
|
458
|
-
key: `${k}-${
|
|
458
|
+
key: `${k}-${b}-${q}`,
|
|
459
459
|
class: [
|
|
460
460
|
"aimd-rec-inline-table__value-cell",
|
|
461
461
|
`aimd-rec-inline-table__value-cell--${Ie(q)}`
|
|
@@ -473,16 +473,16 @@ const Mi = Ee({
|
|
|
473
473
|
`aimd-rec-table-cell-input--${P}`
|
|
474
474
|
];
|
|
475
475
|
return f("input", {
|
|
476
|
-
"data-rec-focus-key": `var_table:${k}:${
|
|
476
|
+
"data-rec-focus-key": `var_table:${k}:${b}:${q}`,
|
|
477
477
|
class: X,
|
|
478
|
-
disabled:
|
|
478
|
+
disabled: T(q),
|
|
479
479
|
placeholder: q,
|
|
480
480
|
value: H[q] ?? "",
|
|
481
481
|
onInput: (he) => {
|
|
482
482
|
t("cell-input", {
|
|
483
483
|
tableName: k,
|
|
484
484
|
column: q,
|
|
485
|
-
rowIndex:
|
|
485
|
+
rowIndex: b,
|
|
486
486
|
value: he.target.value,
|
|
487
487
|
row: H
|
|
488
488
|
});
|
|
@@ -492,7 +492,7 @@ const Mi = Ee({
|
|
|
492
492
|
!ie || !ie.includes(" ") && !/[\r\n]/.test(ie) || (he.preventDefault(), t("cell-paste", {
|
|
493
493
|
tableName: k,
|
|
494
494
|
column: q,
|
|
495
|
-
rowIndex:
|
|
495
|
+
rowIndex: b,
|
|
496
496
|
text: ie
|
|
497
497
|
}));
|
|
498
498
|
},
|
|
@@ -507,7 +507,7 @@ const Mi = Ee({
|
|
|
507
507
|
disabled: B || R.length <= 1,
|
|
508
508
|
"aria-label": Q.table.deleteRow,
|
|
509
509
|
title: Q.table.deleteRow,
|
|
510
|
-
onClick: () => t("remove-row", { tableName: k, rowIndex:
|
|
510
|
+
onClick: () => t("remove-row", { tableName: k, rowIndex: b, columns: V })
|
|
511
511
|
}, [Lt()])
|
|
512
512
|
])
|
|
513
513
|
]);
|
|
@@ -525,7 +525,7 @@ const Mi = Ee({
|
|
|
525
525
|
]);
|
|
526
526
|
};
|
|
527
527
|
}
|
|
528
|
-
}), Bi = it(() => import("./AimdMarkdownNoteField
|
|
528
|
+
}), Bi = it(() => import("./AimdMarkdownNoteField--ssNIQfG.js")), Ii = Ee({
|
|
529
529
|
name: "AimdStepField",
|
|
530
530
|
props: {
|
|
531
531
|
node: { type: Object, required: !0 },
|
|
@@ -539,7 +539,7 @@ const Mi = Ee({
|
|
|
539
539
|
},
|
|
540
540
|
emits: ["check-change", "annotation-change", "timer-start", "timer-pause", "timer-reset", "blur"],
|
|
541
541
|
setup(e, { emit: t }) {
|
|
542
|
-
const i = K(Date.now()), a = K(null), r = K(!1),
|
|
542
|
+
const i = K(Date.now()), a = K(null), r = K(!1), g = K(!1);
|
|
543
543
|
let d = null, p = null;
|
|
544
544
|
function h() {
|
|
545
545
|
d && (clearInterval(d), d = null), at(e.state) && (d = setInterval(() => {
|
|
@@ -551,12 +551,12 @@ const Mi = Ee({
|
|
|
551
551
|
}, { immediate: !0 }), nt(() => {
|
|
552
552
|
d && clearInterval(d), p && clearTimeout(p);
|
|
553
553
|
});
|
|
554
|
-
const D = z(() => e.detailDisplay === "always"),
|
|
554
|
+
const D = z(() => e.detailDisplay === "always"), T = z(() => ei(e.state, i.value)), A = z(() => xe(T.value, e.locale)), L = z(() => typeof e.node.estimated_duration_ms == "number" ? xe(e.node.estimated_duration_ms, e.locale) : ""), j = z(() => ti(e.node)), Y = z(() => at(e.state)), I = z(() => ai(e.state)), G = z(() => !!e.state.annotation?.trim()), W = z(() => ii(e.state, e.node.estimated_duration_ms, i.value)), N = z(() => j.value === "countdown" || j.value === "both"), k = z(() => j.value === "elapsed" || j.value === "both"), V = z(() => (Y.value || I.value) && ni(W.value, e.node.estimated_duration_ms)), R = z(() => typeof W.value == "number" && W.value < 0), B = z(() => W.value == null ? "" : R.value ? e.messages.step.overtimeBadge(xe(Math.abs(W.value), e.locale)) : e.messages.step.remainingBadge(xe(Math.max(0, W.value), e.locale))), Q = z(() => W.value == null ? "" : R.value ? e.messages.step.overtimeDuration(xe(Math.abs(W.value), e.locale)) : e.messages.step.remainingDuration(xe(Math.max(0, W.value), e.locale))), H = z(() => N.value), b = z(() => D.value || G.value || r.value), S = z(() => D.value || H.value || Y.value || I.value || g.value), q = z(() => !S.value && (Y.value || I.value)), J = z(() => b.value || S.value);
|
|
555
555
|
function P() {
|
|
556
556
|
p && (clearTimeout(p), p = null);
|
|
557
557
|
}
|
|
558
558
|
function X() {
|
|
559
|
-
G.value || (r.value = !1), !H.value && !Y.value && !I.value && (
|
|
559
|
+
G.value || (r.value = !1), !H.value && !Y.value && !I.value && (g.value = !1);
|
|
560
560
|
}
|
|
561
561
|
function he() {
|
|
562
562
|
P();
|
|
@@ -573,14 +573,14 @@ const Mi = Ee({
|
|
|
573
573
|
r.value = !0;
|
|
574
574
|
}
|
|
575
575
|
function ne() {
|
|
576
|
-
|
|
576
|
+
g.value = !0, t("timer-start", { id: e.node.id });
|
|
577
577
|
}
|
|
578
578
|
function ye(le) {
|
|
579
579
|
le.preventDefault();
|
|
580
580
|
}
|
|
581
581
|
return () => {
|
|
582
|
-
const le = e.node, x = le.id, ve = e.state, me = le.step || "?", ee = !!le.check, be = e.disabled, _e = e.extraClasses, Z = I.value || Y.value,
|
|
583
|
-
if (
|
|
582
|
+
const le = e.node, x = le.id, ve = e.state, me = le.step || "?", ee = !!le.check, be = e.disabled, _e = e.extraClasses, Z = I.value || Y.value, Se = Y.value ? e.messages.step.pauseTimer : I.value ? e.messages.step.resumeTimer : e.messages.step.startTimer, ze = [], se = [], ke = [];
|
|
583
|
+
if (S.value) {
|
|
584
584
|
const ge = [];
|
|
585
585
|
N.value && B.value && ge.push(
|
|
586
586
|
f("span", {
|
|
@@ -609,7 +609,7 @@ const Mi = Ee({
|
|
|
609
609
|
type: "button",
|
|
610
610
|
class: "aimd-step-timer__btn",
|
|
611
611
|
onClick: () => t(Y.value ? "timer-pause" : "timer-start", { id: x })
|
|
612
|
-
},
|
|
612
|
+
}, Se),
|
|
613
613
|
f("button", {
|
|
614
614
|
type: "button",
|
|
615
615
|
class: "aimd-step-timer__btn aimd-step-timer__btn--ghost",
|
|
@@ -620,7 +620,7 @@ const Mi = Ee({
|
|
|
620
620
|
])
|
|
621
621
|
);
|
|
622
622
|
}
|
|
623
|
-
|
|
623
|
+
b.value && ze.push(
|
|
624
624
|
f("span", {
|
|
625
625
|
class: "aimd-step-field__detail aimd-step-field__detail--annotation"
|
|
626
626
|
}, [
|
|
@@ -675,14 +675,14 @@ const Mi = Ee({
|
|
|
675
675
|
],
|
|
676
676
|
title: e.messages.step.recordedDuration(A.value)
|
|
677
677
|
}, e.messages.step.recordedBadge(A.value))
|
|
678
|
-
), !be && !
|
|
678
|
+
), !be && !b.value && ke.push(
|
|
679
679
|
f("button", {
|
|
680
680
|
type: "button",
|
|
681
681
|
class: "aimd-step-timer__btn aimd-step-timer__btn--ghost aimd-step-field__toggle aimd-step-field__toggle--annotation",
|
|
682
682
|
onMousedown: ye,
|
|
683
683
|
onClick: $
|
|
684
684
|
}, e.messages.step.annotationToggle)
|
|
685
|
-
), !be && !
|
|
685
|
+
), !be && !S.value && ke.push(
|
|
686
686
|
f("button", {
|
|
687
687
|
type: "button",
|
|
688
688
|
class: "aimd-step-timer__btn aimd-step-timer__btn--ghost aimd-step-field__toggle aimd-step-field__toggle--timer",
|
|
@@ -725,7 +725,7 @@ const Mi = Ee({
|
|
|
725
725
|
emits: ["check-change", "annotation-change", "blur"],
|
|
726
726
|
setup(e, { emit: t }) {
|
|
727
727
|
return () => {
|
|
728
|
-
const i = e.node, a = i.id, r = e.state,
|
|
728
|
+
const i = e.node, a = i.id, r = e.state, g = e.disabled, d = e.extraClasses, p = e.bodyNodes.length > 0, h = !!(r.checked && i.checked_message), D = i.label || a;
|
|
729
729
|
return f("div", {
|
|
730
730
|
class: ["aimd-rec-inline aimd-rec-inline--check aimd-field aimd-field--check", ...d]
|
|
731
731
|
}, [
|
|
@@ -735,12 +735,12 @@ const Mi = Ee({
|
|
|
735
735
|
"data-rec-focus-key": `check:${a}:checked`,
|
|
736
736
|
type: "checkbox",
|
|
737
737
|
class: "aimd-checkbox",
|
|
738
|
-
disabled:
|
|
738
|
+
disabled: g,
|
|
739
739
|
checked: !!r.checked,
|
|
740
|
-
onChange: (
|
|
740
|
+
onChange: (T) => {
|
|
741
741
|
t("check-change", {
|
|
742
742
|
id: a,
|
|
743
|
-
value:
|
|
743
|
+
value: T.target.checked
|
|
744
744
|
});
|
|
745
745
|
},
|
|
746
746
|
onBlur: () => t("blur", { id: a })
|
|
@@ -759,13 +759,13 @@ const Mi = Ee({
|
|
|
759
759
|
f("input", {
|
|
760
760
|
"data-rec-focus-key": `check:${a}:annotation`,
|
|
761
761
|
class: "aimd-rec-inline__input aimd-rec-inline__input--annotation",
|
|
762
|
-
disabled:
|
|
762
|
+
disabled: g,
|
|
763
763
|
placeholder: e.messages.check.annotationPlaceholder,
|
|
764
764
|
value: r.annotation || "",
|
|
765
|
-
onInput: (
|
|
765
|
+
onInput: (T) => {
|
|
766
766
|
t("annotation-change", {
|
|
767
767
|
id: a,
|
|
768
|
-
value:
|
|
768
|
+
value: T.target.value
|
|
769
769
|
});
|
|
770
770
|
},
|
|
771
771
|
onBlur: () => t("blur", { id: a })
|
|
@@ -815,10 +815,10 @@ const Mi = Ee({
|
|
|
815
815
|
}, wn = { class: "aimd-quiz-recorder__followup-label" }, Cn = ["data-rec-focus-key", "checked", "disabled", "onChange"], zn = ["type", "step", "data-rec-focus-key", "value", "readonly", "onInput"], $n = {
|
|
816
816
|
key: 2,
|
|
817
817
|
class: "aimd-quiz-recorder__followup-unit"
|
|
818
|
-
}, En = ["data-rec-focus-key", "placeholder", "readonly"],
|
|
818
|
+
}, En = ["data-rec-focus-key", "placeholder", "readonly"], Sn = {
|
|
819
819
|
key: 6,
|
|
820
820
|
class: "aimd-scale"
|
|
821
|
-
},
|
|
821
|
+
}, Tn = { class: "aimd-scale__item-stem" }, qn = { class: "aimd-scale__item-options" }, Dn = ["data-rec-focus-key", "name", "value", "checked", "disabled", "onChange"], Rn = {
|
|
822
822
|
key: 7,
|
|
823
823
|
class: "aimd-scale"
|
|
824
824
|
}, An = { class: "aimd-scale__table" }, xn = {
|
|
@@ -858,7 +858,7 @@ const Mi = Ee({
|
|
|
858
858
|
},
|
|
859
859
|
emits: ["update:modelValue"],
|
|
860
860
|
setup(e, { emit: t }) {
|
|
861
|
-
const i = e, a = t, r = /\[\[([^\[\]\s]+)\]\]/g,
|
|
861
|
+
const i = e, a = t, r = /\[\[([^\[\]\s]+)\]\]/g, g = z(() => {
|
|
862
862
|
const y = i.quiz.stem || "";
|
|
863
863
|
if (i.quiz.type !== "blank")
|
|
864
864
|
return [{ type: "text", value: y }];
|
|
@@ -891,7 +891,7 @@ const Mi = Ee({
|
|
|
891
891
|
function D(y) {
|
|
892
892
|
return typeof y == "string" ? y ? [y] : [] : Array.isArray(y) ? y.filter((o) => typeof o == "string" && o.length > 0) : [];
|
|
893
893
|
}
|
|
894
|
-
function
|
|
894
|
+
function T(y) {
|
|
895
895
|
const o = p(y);
|
|
896
896
|
if (!o)
|
|
897
897
|
return {};
|
|
@@ -908,7 +908,7 @@ const Mi = Ee({
|
|
|
908
908
|
return n;
|
|
909
909
|
}
|
|
910
910
|
function A() {
|
|
911
|
-
return d.value ?
|
|
911
|
+
return d.value ? T(p(i.modelValue)?.followups) : {};
|
|
912
912
|
}
|
|
913
913
|
function L(y) {
|
|
914
914
|
const o = i.quiz.options?.find((c) => c.key === y), n = {};
|
|
@@ -972,11 +972,11 @@ const Mi = Ee({
|
|
|
972
972
|
function H(y) {
|
|
973
973
|
return y.title || y.key;
|
|
974
974
|
}
|
|
975
|
-
function
|
|
975
|
+
function b(y, o) {
|
|
976
976
|
const n = A()[y]?.[o.key];
|
|
977
977
|
return typeof n == "string" || typeof n == "number" ? String(n) : "";
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function S(y, o) {
|
|
980
980
|
return A()[y]?.[o.key] === !0;
|
|
981
981
|
}
|
|
982
982
|
function q(y, o) {
|
|
@@ -1043,7 +1043,7 @@ const Mi = Ee({
|
|
|
1043
1043
|
function le(y) {
|
|
1044
1044
|
return typeof y.points == "number" && Number.isFinite(y.points) ? `${y.text} (${y.points})` : y.text;
|
|
1045
1045
|
}
|
|
1046
|
-
const x = z(() => Jt(i.locale, i.messages)), ve = z(() =>
|
|
1046
|
+
const x = z(() => Jt(i.locale, i.messages)), ve = z(() => Ta(i.quiz.type, x.value, i.quiz.mode)), me = z(() => i.quiz.type === "scale" && Array.isArray(i.quiz.items) ? i.quiz.items : []), ee = z(() => i.quiz.type === "scale" && Array.isArray(i.quiz.options) ? i.quiz.options : []), be = z(() => i.quiz.type === "scale" && Ri(i.quiz, i.modelValue)), _e = z(() => i.quiz.type !== "scale" || !be.value ? null : Ai(i.quiz, i.modelValue)), Z = z(() => {
|
|
1047
1047
|
if (i.grade)
|
|
1048
1048
|
return i.grade;
|
|
1049
1049
|
if (i.quiz.type !== "scale")
|
|
@@ -1056,7 +1056,7 @@ const Mi = Ee({
|
|
|
1056
1056
|
default:
|
|
1057
1057
|
return null;
|
|
1058
1058
|
}
|
|
1059
|
-
}),
|
|
1059
|
+
}), Se = z(() => {
|
|
1060
1060
|
switch (Z.value?.status) {
|
|
1061
1061
|
case "correct":
|
|
1062
1062
|
return "correct";
|
|
@@ -1106,7 +1106,7 @@ const Mi = Ee({
|
|
|
1106
1106
|
]),
|
|
1107
1107
|
e.quiz.title ? (_(), w("div", Ui, C(e.quiz.title), 1)) : O("", !0),
|
|
1108
1108
|
v("div", ji, [
|
|
1109
|
-
(_(!0), w(fe, null, pe(
|
|
1109
|
+
(_(!0), w(fe, null, pe(g.value, (n, c) => (_(), w(fe, {
|
|
1110
1110
|
key: `${e.quiz.id}-stem-${c}`
|
|
1111
1111
|
}, [
|
|
1112
1112
|
n.type === "text" ? (_(), w("span", Qi, C(n.value), 1)) : (_(), w("input", {
|
|
@@ -1179,7 +1179,7 @@ const Mi = Ee({
|
|
|
1179
1179
|
type: "checkbox",
|
|
1180
1180
|
class: "aimd-quiz-recorder__followup-checkbox",
|
|
1181
1181
|
"data-rec-focus-key": `${e.focusKeyPrefix || `quiz:${e.quiz.id}`}:single:${n.key}:followup:${c.key}`,
|
|
1182
|
-
checked:
|
|
1182
|
+
checked: S(n.key, c),
|
|
1183
1183
|
disabled: e.readonly,
|
|
1184
1184
|
onChange: (m) => J(n.key, c, m.target.checked)
|
|
1185
1185
|
}, null, 40, mn)) : (_(), w("input", {
|
|
@@ -1188,7 +1188,7 @@ const Mi = Ee({
|
|
|
1188
1188
|
step: c.type === "int" ? "1" : void 0,
|
|
1189
1189
|
class: "aimd-quiz-recorder__followup-input",
|
|
1190
1190
|
"data-rec-focus-key": `${e.focusKeyPrefix || `quiz:${e.quiz.id}`}:single:${n.key}:followup:${c.key}`,
|
|
1191
|
-
value:
|
|
1191
|
+
value: b(n.key, c),
|
|
1192
1192
|
readonly: e.readonly,
|
|
1193
1193
|
onInput: (m) => J(n.key, c, m.target.value)
|
|
1194
1194
|
}, null, 40, fn)),
|
|
@@ -1227,7 +1227,7 @@ const Mi = Ee({
|
|
|
1227
1227
|
type: "checkbox",
|
|
1228
1228
|
class: "aimd-quiz-recorder__followup-checkbox",
|
|
1229
1229
|
"data-rec-focus-key": `${e.focusKeyPrefix || `quiz:${e.quiz.id}`}:multiple:${n.key}:followup:${c.key}`,
|
|
1230
|
-
checked:
|
|
1230
|
+
checked: S(n.key, c),
|
|
1231
1231
|
disabled: e.readonly,
|
|
1232
1232
|
onChange: (m) => J(n.key, c, m.target.checked)
|
|
1233
1233
|
}, null, 40, Cn)) : (_(), w("input", {
|
|
@@ -1236,7 +1236,7 @@ const Mi = Ee({
|
|
|
1236
1236
|
step: c.type === "int" ? "1" : void 0,
|
|
1237
1237
|
class: "aimd-quiz-recorder__followup-input",
|
|
1238
1238
|
"data-rec-focus-key": `${e.focusKeyPrefix || `quiz:${e.quiz.id}`}:multiple:${n.key}:followup:${c.key}`,
|
|
1239
|
-
value:
|
|
1239
|
+
value: b(n.key, c),
|
|
1240
1240
|
readonly: e.readonly,
|
|
1241
1241
|
onInput: (m) => J(n.key, c, m.target.value)
|
|
1242
1242
|
}, null, 40, zn)),
|
|
@@ -1256,12 +1256,12 @@ const Mi = Ee({
|
|
|
1256
1256
|
}, null, 8, En)), [
|
|
1257
1257
|
[Xt, ye.value]
|
|
1258
1258
|
]) : O("", !0),
|
|
1259
|
-
e.quiz.type === "scale" && me.value.length && ee.value.length && e.quiz.display === "list" ? (_(), w("div",
|
|
1259
|
+
e.quiz.type === "scale" && me.value.length && ee.value.length && e.quiz.display === "list" ? (_(), w("div", Sn, [
|
|
1260
1260
|
(_(!0), w(fe, null, pe(me.value, (n) => (_(), w("div", {
|
|
1261
1261
|
key: `${e.quiz.id}-scale-list-${n.key}`,
|
|
1262
1262
|
class: "aimd-scale__list-item"
|
|
1263
1263
|
}, [
|
|
1264
|
-
v("div",
|
|
1264
|
+
v("div", Tn, C(n.stem), 1),
|
|
1265
1265
|
v("div", qn, [
|
|
1266
1266
|
(_(!0), w(fe, null, pe(ee.value, (c) => (_(), w("label", {
|
|
1267
1267
|
key: `${e.quiz.id}-scale-list-${n.key}-${c.key}`,
|
|
@@ -1320,14 +1320,14 @@ const Mi = Ee({
|
|
|
1320
1320
|
])) : O("", !0),
|
|
1321
1321
|
Z.value && ge.value ? (_(), w("div", {
|
|
1322
1322
|
key: 8,
|
|
1323
|
-
class: Ce(["aimd-quiz__grade-panel", `aimd-quiz__grade-panel--${
|
|
1323
|
+
class: Ce(["aimd-quiz__grade-panel", `aimd-quiz__grade-panel--${Se.value}`])
|
|
1324
1324
|
}, [
|
|
1325
1325
|
v("div", Mn, [
|
|
1326
1326
|
v("span", {
|
|
1327
|
-
class: Ce(["aimd-quiz__grade-status", `aimd-quiz__grade-status--${
|
|
1327
|
+
class: Ce(["aimd-quiz__grade-status", `aimd-quiz__grade-status--${Se.value}`])
|
|
1328
1328
|
}, C(ze.value), 3),
|
|
1329
1329
|
v("span", {
|
|
1330
|
-
class: Ce(["aimd-quiz__grade-score", `aimd-quiz__grade-score--${
|
|
1330
|
+
class: Ce(["aimd-quiz__grade-score", `aimd-quiz__grade-score--${Se.value}`])
|
|
1331
1331
|
}, C(x.value.quiz.gradedScore(Z.value.earned_score, Z.value.max_score)), 3)
|
|
1332
1332
|
]),
|
|
1333
1333
|
Z.value.band ? (_(), w("div", Bn, [
|
|
@@ -1396,8 +1396,8 @@ const Mi = Ee({
|
|
|
1396
1396
|
},
|
|
1397
1397
|
emits: ["update:modelValue", "fields-change", "error", "field-change", "field-blur", "assigner-request", "assigner-cancel", "table-add-row", "table-remove-row"],
|
|
1398
1398
|
setup(e, { expose: t, emit: i }) {
|
|
1399
|
-
const a = e, r = i,
|
|
1400
|
-
let D = 0,
|
|
1399
|
+
const a = e, r = i, g = K([]), d = K(""), p = K(null), h = ft(gt());
|
|
1400
|
+
let D = 0, T = 0, A = !1, L = !1, j = !1, Y = null, I = null;
|
|
1401
1401
|
const G = K(Date.now());
|
|
1402
1402
|
let W = null;
|
|
1403
1403
|
const N = z(() => qa(a.locale)), k = z(() => Jt(N.value, a.messages)), V = z(() => ri(a.typePlugins)), R = Ee({
|
|
@@ -1437,7 +1437,7 @@ const Mi = Ee({
|
|
|
1437
1437
|
ref_fig: [],
|
|
1438
1438
|
cite: [],
|
|
1439
1439
|
fig: []
|
|
1440
|
-
}, H = K(Q),
|
|
1440
|
+
}, H = K(Q), b = K([]), S = z(() => {
|
|
1441
1441
|
const o = {};
|
|
1442
1442
|
for (const n of H.value.var_definitions ?? [])
|
|
1443
1443
|
o[n.id] = {
|
|
@@ -1463,9 +1463,9 @@ const Mi = Ee({
|
|
|
1463
1463
|
A || r("update:modelValue", ta(h));
|
|
1464
1464
|
}
|
|
1465
1465
|
function le() {
|
|
1466
|
-
Y = di(p.value) ?? Y, I = ++
|
|
1466
|
+
Y = di(p.value) ?? Y, I = ++T, !L && (L = !0, Promise.resolve().then(() => {
|
|
1467
1467
|
L = !1;
|
|
1468
|
-
const o = Y, n = I ??
|
|
1468
|
+
const o = Y, n = I ?? T;
|
|
1469
1469
|
Y = null, I = null, Re(void 0, o, n);
|
|
1470
1470
|
}));
|
|
1471
1471
|
}
|
|
@@ -1475,8 +1475,8 @@ const Mi = Ee({
|
|
|
1475
1475
|
}
|
|
1476
1476
|
const ve = ci({
|
|
1477
1477
|
readonly: () => a.readonly,
|
|
1478
|
-
clientAssigners:
|
|
1479
|
-
fieldDefinitions: () =>
|
|
1478
|
+
clientAssigners: b,
|
|
1479
|
+
fieldDefinitions: () => S.value,
|
|
1480
1480
|
localRecord: h,
|
|
1481
1481
|
onError: (o) => r("error", o),
|
|
1482
1482
|
emitRecordUpdate: ye,
|
|
@@ -1531,7 +1531,7 @@ const Mi = Ee({
|
|
|
1531
1531
|
ce
|
|
1532
1532
|
);
|
|
1533
1533
|
JSON.stringify(Ae) !== JSON.stringify(h.var[n]) && (h.var[n] = Ae, j = !0);
|
|
1534
|
-
const
|
|
1534
|
+
const Te = ee.getVarDisplayValue(
|
|
1535
1535
|
n,
|
|
1536
1536
|
o,
|
|
1537
1537
|
E,
|
|
@@ -1555,7 +1555,7 @@ const Mi = Ee({
|
|
|
1555
1555
|
locale: N.value,
|
|
1556
1556
|
messages: k.value,
|
|
1557
1557
|
record: h,
|
|
1558
|
-
displayValue:
|
|
1558
|
+
displayValue: Te,
|
|
1559
1559
|
extraClasses: Ze,
|
|
1560
1560
|
placeholder: re,
|
|
1561
1561
|
fieldState: a.fieldState?.[c],
|
|
@@ -1572,7 +1572,7 @@ const Mi = Ee({
|
|
|
1572
1572
|
extraClasses: Ze,
|
|
1573
1573
|
messages: k.value,
|
|
1574
1574
|
fieldMeta: m,
|
|
1575
|
-
displayValue:
|
|
1575
|
+
displayValue: Te,
|
|
1576
1576
|
inputKind: ce,
|
|
1577
1577
|
typePlugin: ae,
|
|
1578
1578
|
initialized: n in h.var,
|
|
@@ -1605,7 +1605,7 @@ const Mi = Ee({
|
|
|
1605
1605
|
const M = m.indexOf(F.column);
|
|
1606
1606
|
if (M < 0)
|
|
1607
1607
|
return;
|
|
1608
|
-
const Ae = wi(F.text),
|
|
1608
|
+
const Ae = wi(F.text), Te = Ci(
|
|
1609
1609
|
E,
|
|
1610
1610
|
m,
|
|
1611
1611
|
F.rowIndex,
|
|
@@ -1613,11 +1613,11 @@ const Mi = Ee({
|
|
|
1613
1613
|
Ae,
|
|
1614
1614
|
{ disabledColumns: ce }
|
|
1615
1615
|
);
|
|
1616
|
-
if (!(
|
|
1616
|
+
if (!(Te.rowsAdded === 0 && Te.changedCells.length === 0)) {
|
|
1617
1617
|
x({ rebuild: !0, runClientAssigners: !0 });
|
|
1618
|
-
for (let we = 0; we <
|
|
1618
|
+
for (let we = 0; we < Te.rowsAdded; we += 1)
|
|
1619
1619
|
r("table-add-row", { tableName: F.tableName, columns: m });
|
|
1620
|
-
for (const we of
|
|
1620
|
+
for (const we of Te.changedCells)
|
|
1621
1621
|
r("field-change", {
|
|
1622
1622
|
section: "var_table",
|
|
1623
1623
|
fieldKey: `${F.tableName}:${we.column}`,
|
|
@@ -1658,7 +1658,7 @@ const Mi = Ee({
|
|
|
1658
1658
|
const c = n.class, m = Array.isArray(c) ? c : typeof c == "string" ? [c] : [];
|
|
1659
1659
|
return n["data-aimd-step-body"] === "true" || n["data-aimd-step-body"] === !0 || n.dataAimdStepBody === "true" || n.dataAimdStepBody === !0 || m.some((E) => typeof E == "string" && E.includes("aimd-step-body"));
|
|
1660
1660
|
}
|
|
1661
|
-
function
|
|
1661
|
+
function Se(o = []) {
|
|
1662
1662
|
if (o.length === 0)
|
|
1663
1663
|
return [];
|
|
1664
1664
|
const n = o.find((m) => Z(m));
|
|
@@ -1688,7 +1688,7 @@ const Mi = Ee({
|
|
|
1688
1688
|
function ke(o, n = []) {
|
|
1689
1689
|
const c = o.id, m = `step:${c}`;
|
|
1690
1690
|
c in h.step || (h.step[c] = yi(), j = !0);
|
|
1691
|
-
const E = h.step[c], ae = ee.isFieldDisabled(m), ce = ee.fieldStateClasses(m), re =
|
|
1691
|
+
const E = h.step[c], ae = ee.isFieldDisabled(m), ce = ee.fieldStateClasses(m), re = Se(n), F = f(Ii, {
|
|
1692
1692
|
node: o,
|
|
1693
1693
|
state: E,
|
|
1694
1694
|
bodyNodes: re,
|
|
@@ -1780,7 +1780,7 @@ const Mi = Ee({
|
|
|
1780
1780
|
}
|
|
1781
1781
|
async function Re(o, n, c) {
|
|
1782
1782
|
j = !1;
|
|
1783
|
-
const m = await
|
|
1783
|
+
const m = await Sa(a.content || "", {
|
|
1784
1784
|
locale: N.value,
|
|
1785
1785
|
groupStepBodies: !0,
|
|
1786
1786
|
groupCheckBodies: !0,
|
|
@@ -1798,22 +1798,22 @@ const Mi = Ee({
|
|
|
1798
1798
|
quiz: (E) => ge(E)
|
|
1799
1799
|
}
|
|
1800
1800
|
});
|
|
1801
|
-
o !== void 0 && o !== D || c !== void 0 && c !==
|
|
1801
|
+
o !== void 0 && o !== D || c !== void 0 && c !== T || (g.value = m.nodes, await Pe(), mi(p.value, n ?? null), j && ye());
|
|
1802
1802
|
}
|
|
1803
1803
|
async function y() {
|
|
1804
|
-
const o = ++D, n = ++
|
|
1804
|
+
const o = ++D, n = ++T;
|
|
1805
1805
|
try {
|
|
1806
1806
|
d.value = "";
|
|
1807
1807
|
const c = ht(a.content || "");
|
|
1808
1808
|
if (o !== D) return;
|
|
1809
|
-
H.value = c,
|
|
1809
|
+
H.value = c, b.value = c.client_assigner || [], r("fields-change", c);
|
|
1810
1810
|
const m = fi(h, c), E = ve.applyCurrentClientAssigners();
|
|
1811
1811
|
(m || E) && ye(), await Re(o, void 0, n);
|
|
1812
1812
|
} catch (c) {
|
|
1813
1813
|
if (o !== D)
|
|
1814
1814
|
return;
|
|
1815
1815
|
const m = c instanceof Error ? c.message : String(c);
|
|
1816
|
-
d.value = m,
|
|
1816
|
+
d.value = m, g.value = [], H.value = Q, b.value = [], r("fields-change", Q), r("error", m);
|
|
1817
1817
|
}
|
|
1818
1818
|
}
|
|
1819
1819
|
return de(
|
|
@@ -1871,13 +1871,13 @@ const Mi = Ee({
|
|
|
1871
1871
|
q.value > 0 ? (_(), w("span", Qn, C(k.value.step.protocolEstimatedTotal(X.value)), 1)) : O("", !0),
|
|
1872
1872
|
J.value > 0 ? (_(), w("span", Gn, C(k.value.step.protocolRecordedTotal(he.value)), 1)) : O("", !0)
|
|
1873
1873
|
])) : O("", !0),
|
|
1874
|
-
|
|
1874
|
+
g.value.length ? (_(), w("div", {
|
|
1875
1875
|
key: 1,
|
|
1876
1876
|
ref_key: "contentRoot",
|
|
1877
1877
|
ref: p,
|
|
1878
1878
|
class: "aimd-protocol-recorder__content"
|
|
1879
1879
|
}, [
|
|
1880
|
-
Oe(qe(R), { nodes:
|
|
1880
|
+
Oe(qe(R), { nodes: g.value }, null, 8, ["nodes"])
|
|
1881
1881
|
], 512)) : (_(), w("div", Yn, C(k.value.common.emptyContent), 1))
|
|
1882
1882
|
], 64))
|
|
1883
1883
|
]));
|
|
@@ -1906,9 +1906,9 @@ function Ut(e, t, i, a) {
|
|
|
1906
1906
|
D += 1;
|
|
1907
1907
|
return { segmentStart: h, segmentEnd: D };
|
|
1908
1908
|
}
|
|
1909
|
-
const r = Kt(e, t),
|
|
1909
|
+
const r = Kt(e, t), g = Wt(e, i), d = e.slice(r, g).replace(/\r?\n$/, ""), p = e.slice(t, i);
|
|
1910
1910
|
if (d.trim() === p.trim()) {
|
|
1911
|
-
let h =
|
|
1911
|
+
let h = g;
|
|
1912
1912
|
for (; h < e.length && e.slice(h, h + 1) === `
|
|
1913
1913
|
`; )
|
|
1914
1914
|
h += 1;
|
|
@@ -1935,7 +1935,7 @@ function _t(e) {
|
|
|
1935
1935
|
suffixRaw: a
|
|
1936
1936
|
};
|
|
1937
1937
|
}
|
|
1938
|
-
const
|
|
1938
|
+
const g = r.indexOf(":"), d = r.slice(0, g).trim(), p = r.slice(g + 1).trim(), h = p.indexOf("=");
|
|
1939
1939
|
return h >= 0 ? {
|
|
1940
1940
|
id: d,
|
|
1941
1941
|
valueType: p.slice(0, h).trim(),
|
|
@@ -1976,10 +1976,10 @@ function ar(e) {
|
|
|
1976
1976
|
subvarsText: d || "col1, col2"
|
|
1977
1977
|
};
|
|
1978
1978
|
}
|
|
1979
|
-
const a = t.split(",")[0]?.trim() || "my_table",
|
|
1979
|
+
const a = t.split(",")[0]?.trim() || "my_table", g = t.match(/subvars\s*=\s*\[([\s\S]*?)\]/)?.[1]?.split(",").map((d) => tr(d)).filter(Boolean).join(", ");
|
|
1980
1980
|
return {
|
|
1981
1981
|
id: a,
|
|
1982
|
-
subvarsText:
|
|
1982
|
+
subvarsText: g || "col1, col2"
|
|
1983
1983
|
};
|
|
1984
1984
|
}
|
|
1985
1985
|
function ir(e) {
|
|
@@ -2011,9 +2011,9 @@ function sr(e, t, i) {
|
|
|
2011
2011
|
return e;
|
|
2012
2012
|
const r = a[1];
|
|
2013
2013
|
if (t === "var") {
|
|
2014
|
-
const
|
|
2014
|
+
const g = _t(r);
|
|
2015
2015
|
return yt(e, aa({
|
|
2016
|
-
...
|
|
2016
|
+
...g,
|
|
2017
2017
|
id: i
|
|
2018
2018
|
}));
|
|
2019
2019
|
}
|
|
@@ -2049,18 +2049,18 @@ function je(e, t) {
|
|
|
2049
2049
|
case "check":
|
|
2050
2050
|
return `{{check|${(t.name || "").trim() || "my_check"}}}`;
|
|
2051
2051
|
case "quiz": {
|
|
2052
|
-
const i = (t.
|
|
2053
|
-
return
|
|
2052
|
+
const i = (t.quizType || "").trim() || "choice", a = (t.id || "").trim() || `quiz_${i}_1`, r = t.stem || "Fill the question stem";
|
|
2053
|
+
return i === "open" ? [
|
|
2054
2054
|
"```quiz",
|
|
2055
|
-
`id: ${
|
|
2055
|
+
`id: ${a}`,
|
|
2056
2056
|
"type: open",
|
|
2057
2057
|
"stem: |",
|
|
2058
2058
|
` ${r}`,
|
|
2059
2059
|
"```"
|
|
2060
2060
|
].join(`
|
|
2061
|
-
`) :
|
|
2061
|
+
`) : i === "scale" ? [
|
|
2062
2062
|
"```quiz",
|
|
2063
|
-
`id: ${
|
|
2063
|
+
`id: ${a}`,
|
|
2064
2064
|
"type: scale",
|
|
2065
2065
|
"title: Scale title",
|
|
2066
2066
|
"stem: |",
|
|
@@ -2087,11 +2087,11 @@ function je(e, t) {
|
|
|
2087
2087
|
].join(`
|
|
2088
2088
|
`) : [
|
|
2089
2089
|
"```quiz",
|
|
2090
|
-
`id: ${
|
|
2091
|
-
`type: ${
|
|
2090
|
+
`id: ${a}`,
|
|
2091
|
+
`type: ${i}`,
|
|
2092
2092
|
"stem: |",
|
|
2093
2093
|
` ${r}`,
|
|
2094
|
-
|
|
2094
|
+
i === "blank" ? `blanks:
|
|
2095
2095
|
- key: blank_1
|
|
2096
2096
|
answer: answer` : `mode: single
|
|
2097
2097
|
options:
|
|
@@ -2126,38 +2126,40 @@ function kt(e, t) {
|
|
|
2126
2126
|
return je("check", {
|
|
2127
2127
|
name: i || "my_check"
|
|
2128
2128
|
});
|
|
2129
|
-
case "quiz":
|
|
2129
|
+
case "quiz": {
|
|
2130
|
+
const a = t?.quizType?.trim() || "choice";
|
|
2130
2131
|
return je("quiz", {
|
|
2131
|
-
id: i ||
|
|
2132
|
-
quizType:
|
|
2132
|
+
id: i || `quiz_${a}_1`,
|
|
2133
|
+
quizType: a
|
|
2133
2134
|
});
|
|
2135
|
+
}
|
|
2134
2136
|
}
|
|
2135
2137
|
}
|
|
2136
2138
|
function Ve(e, t, i, a) {
|
|
2137
2139
|
return e.slice(0, t) + a + e.slice(i);
|
|
2138
2140
|
}
|
|
2139
2141
|
function cr(e, t, i) {
|
|
2140
|
-
const a = t > 0 ? e[t - 1] : "", r = t < e.length ? e[t] : "",
|
|
2141
|
-
return `${
|
|
2142
|
+
const a = t > 0 ? e[t - 1] : "", r = t < e.length ? e[t] : "", g = !!a && !/\s/.test(a), d = !!r && !/\s/.test(r);
|
|
2143
|
+
return `${g ? " " : ""}${i}${d ? " " : ""}`;
|
|
2142
2144
|
}
|
|
2143
2145
|
function ur(e, t, i) {
|
|
2144
|
-
const a = e.slice(0, t), r = e.slice(t),
|
|
2145
|
-
`.repeat(2 -
|
|
2146
|
+
const a = e.slice(0, t), r = e.slice(t), g = a.match(/\n*$/)?.[0].length ?? 0, d = r.match(/^\n*/)?.[0].length ?? 0, p = a.length === 0 || g >= 2 ? "" : `
|
|
2147
|
+
`.repeat(2 - g), h = r.length === 0 || d >= 2 ? "" : `
|
|
2146
2148
|
`.repeat(2 - d);
|
|
2147
2149
|
return `${p}${i}${h}`;
|
|
2148
2150
|
}
|
|
2149
2151
|
function pt(e) {
|
|
2150
2152
|
const t = [];
|
|
2151
2153
|
for (const i of e.matchAll(Xn)) {
|
|
2152
|
-
const a = i[0], r = i[1],
|
|
2153
|
-
if (r === "var" && !er(
|
|
2154
|
-
const
|
|
2154
|
+
const a = i[0], r = i[1], g = i[2], d = i.index ?? 0, p = d + a.length, h = Ut(e, d, p, "inline");
|
|
2155
|
+
if (r === "var" && !er(g)) {
|
|
2156
|
+
const T = _t(g);
|
|
2155
2157
|
t.push({
|
|
2156
2158
|
uid: `inline:${d}:${p}`,
|
|
2157
2159
|
fieldType: "var",
|
|
2158
2160
|
sourceKind: "inline",
|
|
2159
|
-
id:
|
|
2160
|
-
valueType:
|
|
2161
|
+
id: T.id || "my_var",
|
|
2162
|
+
valueType: T.valueType || "str",
|
|
2161
2163
|
raw: a,
|
|
2162
2164
|
start: d,
|
|
2163
2165
|
end: p,
|
|
@@ -2167,13 +2169,13 @@ function pt(e) {
|
|
|
2167
2169
|
continue;
|
|
2168
2170
|
}
|
|
2169
2171
|
if (r === "var" || r === "var_table") {
|
|
2170
|
-
const
|
|
2172
|
+
const T = ar(g);
|
|
2171
2173
|
t.push({
|
|
2172
2174
|
uid: `inline:${d}:${p}`,
|
|
2173
2175
|
fieldType: "var_table",
|
|
2174
2176
|
sourceKind: "inline",
|
|
2175
|
-
id:
|
|
2176
|
-
subvarsText:
|
|
2177
|
+
id: T.id,
|
|
2178
|
+
subvarsText: T.subvarsText,
|
|
2177
2179
|
raw: a,
|
|
2178
2180
|
start: d,
|
|
2179
2181
|
end: p,
|
|
@@ -2183,12 +2185,12 @@ function pt(e) {
|
|
|
2183
2185
|
continue;
|
|
2184
2186
|
}
|
|
2185
2187
|
if (r === "step") {
|
|
2186
|
-
const
|
|
2188
|
+
const T = ir(g);
|
|
2187
2189
|
t.push({
|
|
2188
2190
|
uid: `inline:${d}:${p}`,
|
|
2189
2191
|
fieldType: "step",
|
|
2190
2192
|
sourceKind: "inline",
|
|
2191
|
-
id:
|
|
2193
|
+
id: T.id,
|
|
2192
2194
|
raw: a,
|
|
2193
2195
|
start: d,
|
|
2194
2196
|
end: p,
|
|
@@ -2197,7 +2199,7 @@ function pt(e) {
|
|
|
2197
2199
|
});
|
|
2198
2200
|
continue;
|
|
2199
2201
|
}
|
|
2200
|
-
const D = nr(
|
|
2202
|
+
const D = nr(g);
|
|
2201
2203
|
t.push({
|
|
2202
2204
|
uid: `inline:${d}:${p}`,
|
|
2203
2205
|
fieldType: "check",
|
|
@@ -2211,30 +2213,30 @@ function pt(e) {
|
|
|
2211
2213
|
});
|
|
2212
2214
|
}
|
|
2213
2215
|
for (const i of e.matchAll(Jn)) {
|
|
2214
|
-
const a = i[0], r = i.index ?? 0,
|
|
2216
|
+
const a = i[0], r = i.index ?? 0, g = r + a.length, d = Ut(e, r, g, "block"), p = rr(a);
|
|
2215
2217
|
t.push({
|
|
2216
|
-
uid: `block:${r}:${
|
|
2218
|
+
uid: `block:${r}:${g}`,
|
|
2217
2219
|
fieldType: "quiz",
|
|
2218
2220
|
sourceKind: "block",
|
|
2219
2221
|
id: p.id,
|
|
2220
2222
|
quizType: p.quizType,
|
|
2221
2223
|
raw: a,
|
|
2222
2224
|
start: r,
|
|
2223
|
-
end:
|
|
2225
|
+
end: g,
|
|
2224
2226
|
segmentStart: d.segmentStart,
|
|
2225
2227
|
segmentEnd: d.segmentEnd
|
|
2226
2228
|
});
|
|
2227
2229
|
}
|
|
2228
2230
|
return t.sort((i, a) => i.start - a.start);
|
|
2229
2231
|
}
|
|
2230
|
-
function jt(e, t) {
|
|
2231
|
-
const
|
|
2232
|
-
if (!
|
|
2233
|
-
return
|
|
2234
|
-
let
|
|
2235
|
-
for (;
|
|
2236
|
-
|
|
2237
|
-
return `${
|
|
2232
|
+
function jt(e, t, i) {
|
|
2233
|
+
const a = new Set(e.map((d) => d.id)), r = t === "var" ? "new_var" : t === "var_table" ? "new_table" : t === "step" ? "new_step" : t === "check" ? "new_check" : `quiz_${i || "choice"}`;
|
|
2234
|
+
if (!a.has(r))
|
|
2235
|
+
return r;
|
|
2236
|
+
let g = 2;
|
|
2237
|
+
for (; a.has(`${r}_${g}`); )
|
|
2238
|
+
g += 1;
|
|
2239
|
+
return `${r}_${g}`;
|
|
2238
2240
|
}
|
|
2239
2241
|
function ia(e, t, i) {
|
|
2240
2242
|
const a = kt(t, i), r = e.replace(/\s+$/, "");
|
|
@@ -2245,7 +2247,7 @@ ${a}` : a;
|
|
|
2245
2247
|
function mr(e, t, i, a, r) {
|
|
2246
2248
|
if (t.length === 0)
|
|
2247
2249
|
return ia(e, a, r);
|
|
2248
|
-
const
|
|
2250
|
+
const g = kt(a, r), d = Math.max(0, Math.min(i, t.length)), p = d >= t.length ? t[t.length - 1].segmentEnd : t[d].segmentStart, D = (a === "quiz" ? "block" : "inline") === "block" ? ur(e, p, g) : cr(e, p, g);
|
|
2249
2251
|
return Ve(e, p, p, D);
|
|
2250
2252
|
}
|
|
2251
2253
|
function fr(e, t) {
|
|
@@ -2287,11 +2289,11 @@ function gr(e, t, i, a) {
|
|
|
2287
2289
|
const r = t.find((L) => L.uid === i);
|
|
2288
2290
|
if (!r)
|
|
2289
2291
|
return e;
|
|
2290
|
-
const
|
|
2292
|
+
const g = t.filter((L) => L.uid !== i), d = Math.max(0, Math.min(a, g.length)), p = e.slice(r.segmentStart, r.segmentEnd), h = Ve(e, r.segmentStart, r.segmentEnd, ""), D = r.segmentEnd - r.segmentStart, T = g.map((L) => ({
|
|
2291
2293
|
...L,
|
|
2292
2294
|
segmentStart: L.segmentStart > r.segmentStart ? L.segmentStart - D : L.segmentStart,
|
|
2293
2295
|
segmentEnd: L.segmentEnd > r.segmentStart ? L.segmentEnd - D : L.segmentEnd
|
|
2294
|
-
})), A = d >=
|
|
2296
|
+
})), A = d >= T.length ? T.length === 0 ? h.length : T[T.length - 1].segmentEnd : T[d].segmentStart;
|
|
2295
2297
|
return Ve(h, A, A, p);
|
|
2296
2298
|
}
|
|
2297
2299
|
function br(e = {}) {
|
|
@@ -2305,10 +2307,10 @@ class _r {
|
|
|
2305
2307
|
constructor(t, i) {
|
|
2306
2308
|
var a;
|
|
2307
2309
|
this.editorView = t, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = (a = i.width) !== null && a !== void 0 ? a : 1, this.color = i.color === !1 ? void 0 : i.color || "black", this.class = i.class, this.handlers = ["dragover", "dragend", "drop", "dragleave"].map((r) => {
|
|
2308
|
-
let
|
|
2310
|
+
let g = (d) => {
|
|
2309
2311
|
this[r](d);
|
|
2310
2312
|
};
|
|
2311
|
-
return t.dom.addEventListener(r,
|
|
2313
|
+
return t.dom.addEventListener(r, g), { name: r, handler: g };
|
|
2312
2314
|
});
|
|
2313
2315
|
}
|
|
2314
2316
|
destroy() {
|
|
@@ -2321,7 +2323,7 @@ class _r {
|
|
|
2321
2323
|
t != this.cursorPos && (this.cursorPos = t, t == null ? (this.element.parentNode.removeChild(this.element), this.element = null) : this.updateOverlay());
|
|
2322
2324
|
}
|
|
2323
2325
|
updateOverlay() {
|
|
2324
|
-
let t = this.editorView.state.doc.resolve(this.cursorPos), i = !t.parent.inlineContent, a, r = this.editorView.dom,
|
|
2326
|
+
let t = this.editorView.state.doc.resolve(this.cursorPos), i = !t.parent.inlineContent, a, r = this.editorView.dom, g = r.getBoundingClientRect(), d = g.width / r.offsetWidth, p = g.height / r.offsetHeight;
|
|
2325
2327
|
if (i) {
|
|
2326
2328
|
let A = t.nodeBefore, L = t.nodeAfter;
|
|
2327
2329
|
if (A || L) {
|
|
@@ -2340,14 +2342,14 @@ class _r {
|
|
|
2340
2342
|
}
|
|
2341
2343
|
let h = this.editorView.dom.offsetParent;
|
|
2342
2344
|
this.element || (this.element = h.appendChild(document.createElement("div")), this.class && (this.element.className = this.class), this.element.style.cssText = "position: absolute; z-index: 50; pointer-events: none;", this.color && (this.element.style.backgroundColor = this.color)), this.element.classList.toggle("prosemirror-dropcursor-block", i), this.element.classList.toggle("prosemirror-dropcursor-inline", !i);
|
|
2343
|
-
let D,
|
|
2345
|
+
let D, T;
|
|
2344
2346
|
if (!h || h == document.body && getComputedStyle(h).position == "static")
|
|
2345
|
-
D = -pageXOffset,
|
|
2347
|
+
D = -pageXOffset, T = -pageYOffset;
|
|
2346
2348
|
else {
|
|
2347
2349
|
let A = h.getBoundingClientRect(), L = A.width / h.offsetWidth, j = A.height / h.offsetHeight;
|
|
2348
|
-
D = A.left - h.scrollLeft * L,
|
|
2350
|
+
D = A.left - h.scrollLeft * L, T = A.top - h.scrollTop * j;
|
|
2349
2351
|
}
|
|
2350
|
-
this.element.style.left = (a.left - D) / d + "px", this.element.style.top = (a.top -
|
|
2352
|
+
this.element.style.left = (a.left - D) / d + "px", this.element.style.top = (a.top - T) / p + "px", this.element.style.width = (a.right - a.left) / d + "px", this.element.style.height = (a.bottom - a.top) / p + "px";
|
|
2351
2353
|
}
|
|
2352
2354
|
scheduleRemoval(t) {
|
|
2353
2355
|
clearTimeout(this.timeout), this.timeout = setTimeout(() => this.setCursor(null), t);
|
|
@@ -2355,8 +2357,8 @@ class _r {
|
|
|
2355
2357
|
dragover(t) {
|
|
2356
2358
|
if (!this.editorView.editable)
|
|
2357
2359
|
return;
|
|
2358
|
-
let i = this.editorView.posAtCoords({ left: t.clientX, top: t.clientY }), a = i && i.inside >= 0 && this.editorView.state.doc.nodeAt(i.inside), r = a && a.type.spec.disableDropCursor,
|
|
2359
|
-
if (i && !
|
|
2360
|
+
let i = this.editorView.posAtCoords({ left: t.clientX, top: t.clientY }), a = i && i.inside >= 0 && this.editorView.state.doc.nodeAt(i.inside), r = a && a.type.spec.disableDropCursor, g = typeof r == "function" ? r(this.editorView, i, t) : r;
|
|
2361
|
+
if (i && !g) {
|
|
2360
2362
|
let d = i.pos;
|
|
2361
2363
|
if (this.editorView.dragging && this.editorView.dragging.slice) {
|
|
2362
2364
|
let p = Ra(this.editorView.state.doc, d, this.editorView.dragging.slice);
|
|
@@ -2404,14 +2406,14 @@ const kr = /* @__PURE__ */ Ee({
|
|
|
2404
2406
|
"resolve-file": e.surfaceState.resolveFile,
|
|
2405
2407
|
"type-plugins": e.surfaceState.typePlugins,
|
|
2406
2408
|
"onUpdate:modelValue": e.surfaceState.onUpdateRecord,
|
|
2407
|
-
onFieldsChange: r[0] || (r[0] = (
|
|
2408
|
-
onError: r[1] || (r[1] = (
|
|
2409
|
-
onFieldChange: r[2] || (r[2] = (
|
|
2410
|
-
onFieldBlur: r[3] || (r[3] = (
|
|
2411
|
-
onAssignerRequest: r[4] || (r[4] = (
|
|
2412
|
-
onAssignerCancel: r[5] || (r[5] = (
|
|
2413
|
-
onTableAddRow: r[6] || (r[6] = (
|
|
2414
|
-
onTableRemoveRow: r[7] || (r[7] = (
|
|
2409
|
+
onFieldsChange: r[0] || (r[0] = (g) => e.surfaceState.onFieldsChange?.(g)),
|
|
2410
|
+
onError: r[1] || (r[1] = (g) => e.surfaceState.onError?.(g)),
|
|
2411
|
+
onFieldChange: r[2] || (r[2] = (g) => e.surfaceState.onFieldChange?.(g)),
|
|
2412
|
+
onFieldBlur: r[3] || (r[3] = (g) => e.surfaceState.onFieldBlur?.(g)),
|
|
2413
|
+
onAssignerRequest: r[4] || (r[4] = (g) => e.surfaceState.onAssignerRequest?.(g)),
|
|
2414
|
+
onAssignerCancel: r[5] || (r[5] = (g) => e.surfaceState.onAssignerCancel?.(g)),
|
|
2415
|
+
onTableAddRow: r[6] || (r[6] = (g) => e.surfaceState.onTableAddRow?.(g)),
|
|
2416
|
+
onTableRemoveRow: r[7] || (r[7] = (g) => e.surfaceState.onTableRemoveRow?.(g))
|
|
2415
2417
|
}, null, 8, ["content", "model-value", "readonly", "current-user-name", "now", "locale", "messages", "step-detail-display", "field-meta", "field-state", "wrap-field", "custom-renderers", "field-adapters", "resolve-file", "type-plugins", "onUpdate:modelValue"])
|
|
2416
2418
|
], 2));
|
|
2417
2419
|
}
|
|
@@ -2447,10 +2449,10 @@ function Er(e) {
|
|
|
2447
2449
|
dragTitle: t ? "拖动字段" : "Drag field"
|
|
2448
2450
|
};
|
|
2449
2451
|
}
|
|
2450
|
-
function
|
|
2452
|
+
function Sr(e, t) {
|
|
2451
2453
|
return `{{${e}|${t}}}`;
|
|
2452
2454
|
}
|
|
2453
|
-
function
|
|
2455
|
+
function Tr(e) {
|
|
2454
2456
|
return `\`\`\`quiz
|
|
2455
2457
|
${e.replace(/\r\n?/g, `
|
|
2456
2458
|
`).replace(/\n+$/, "")}
|
|
@@ -2530,30 +2532,30 @@ const Rr = Aa("aimdRecorderQuizBlock", () => Dr()), Gt = xa("aimd_recorder_quiz"
|
|
|
2530
2532
|
}
|
|
2531
2533
|
}));
|
|
2532
2534
|
class Yt {
|
|
2533
|
-
constructor(t, i, a, r,
|
|
2534
|
-
this.node = t, this.view = i, this.getPos = a, this.options = r, this.block =
|
|
2535
|
-
const d =
|
|
2535
|
+
constructor(t, i, a, r, g) {
|
|
2536
|
+
this.node = t, this.view = i, this.getPos = a, this.options = r, this.block = g, this.editButtonEl = null, this.deleteButtonEl = null, this.dragHandleEl = null;
|
|
2537
|
+
const d = g ? "div" : "span", p = Er(this.options.surfaceState.locale);
|
|
2536
2538
|
this.dom = document.createElement(d), this.dom.className = [
|
|
2537
2539
|
"aimd-recorder-wysiwyg-node",
|
|
2538
|
-
|
|
2540
|
+
g ? "aimd-recorder-wysiwyg-node--block" : "aimd-recorder-wysiwyg-node--inline"
|
|
2539
2541
|
].join(" "), this.dom.contentEditable = "false", this.dom.draggable = !this.options.surfaceState.readonly;
|
|
2540
|
-
const h = document.createElement(
|
|
2542
|
+
const h = document.createElement(g ? "div" : "span");
|
|
2541
2543
|
h.className = [
|
|
2542
2544
|
"aimd-recorder-wysiwyg-node__chrome",
|
|
2543
|
-
|
|
2545
|
+
g ? "aimd-recorder-wysiwyg-node__chrome--block" : "aimd-recorder-wysiwyg-node__chrome--inline"
|
|
2544
2546
|
].join(" "), this.summaryEl = document.createElement("span"), this.summaryEl.className = "aimd-recorder-wysiwyg-node__summary", h.appendChild(this.summaryEl);
|
|
2545
2547
|
const D = document.createElement("span");
|
|
2546
|
-
D.className = "aimd-recorder-wysiwyg-node__actions", this.editButtonEl = document.createElement("button"), this.editButtonEl.type = "button", this.editButtonEl.className = "aimd-recorder-wysiwyg-node__action aimd-recorder-wysiwyg-node__action--edit", this.editButtonEl.textContent = p.edit, this.editButtonEl.title = p.editTitle, this.editButtonEl.setAttribute("aria-label", p.editTitle), this.editButtonEl.addEventListener("click", (
|
|
2547
|
-
if (
|
|
2548
|
+
D.className = "aimd-recorder-wysiwyg-node__actions", this.editButtonEl = document.createElement("button"), this.editButtonEl.type = "button", this.editButtonEl.className = "aimd-recorder-wysiwyg-node__action aimd-recorder-wysiwyg-node__action--edit", this.editButtonEl.textContent = p.edit, this.editButtonEl.title = p.editTitle, this.editButtonEl.setAttribute("aria-label", p.editTitle), this.editButtonEl.addEventListener("click", (T) => {
|
|
2549
|
+
if (T.preventDefault(), T.stopPropagation(), this.options.surfaceState.readonly)
|
|
2548
2550
|
return;
|
|
2549
2551
|
const A = this.resolveIdentity();
|
|
2550
2552
|
A && this.options.onEditField?.(A);
|
|
2551
|
-
}), D.appendChild(this.editButtonEl), this.deleteButtonEl = document.createElement("button"), this.deleteButtonEl.type = "button", this.deleteButtonEl.className = "aimd-recorder-wysiwyg-node__action aimd-recorder-wysiwyg-node__action--danger", this.deleteButtonEl.textContent = p.delete, this.deleteButtonEl.title = p.deleteTitle, this.deleteButtonEl.setAttribute("aria-label", p.deleteTitle), this.deleteButtonEl.addEventListener("click", (
|
|
2552
|
-
if (
|
|
2553
|
+
}), D.appendChild(this.editButtonEl), this.deleteButtonEl = document.createElement("button"), this.deleteButtonEl.type = "button", this.deleteButtonEl.className = "aimd-recorder-wysiwyg-node__action aimd-recorder-wysiwyg-node__action--danger", this.deleteButtonEl.textContent = p.delete, this.deleteButtonEl.title = p.deleteTitle, this.deleteButtonEl.setAttribute("aria-label", p.deleteTitle), this.deleteButtonEl.addEventListener("click", (T) => {
|
|
2554
|
+
if (T.preventDefault(), T.stopPropagation(), this.options.surfaceState.readonly)
|
|
2553
2555
|
return;
|
|
2554
2556
|
const A = this.resolveIdentity();
|
|
2555
2557
|
A && this.options.onDeleteField?.(A);
|
|
2556
|
-
}), D.appendChild(this.deleteButtonEl), this.dragHandleEl = document.createElement("span"), this.dragHandleEl.className = "aimd-recorder-wysiwyg-node__drag", this.dragHandleEl.textContent = "::", this.dragHandleEl.title = p.dragTitle, this.dragHandleEl.setAttribute("data-drag-handle", "true"), this.dragHandleEl.draggable = !this.options.surfaceState.readonly, this.dragHandleEl.addEventListener("mousedown", (
|
|
2558
|
+
}), D.appendChild(this.deleteButtonEl), this.dragHandleEl = document.createElement("span"), this.dragHandleEl.className = "aimd-recorder-wysiwyg-node__drag", this.dragHandleEl.textContent = "::", this.dragHandleEl.title = p.dragTitle, this.dragHandleEl.setAttribute("data-drag-handle", "true"), this.dragHandleEl.draggable = !this.options.surfaceState.readonly, this.dragHandleEl.addEventListener("mousedown", (T) => {
|
|
2557
2559
|
this.selectThisNode();
|
|
2558
2560
|
}), this.dragHandleEl.addEventListener("dragstart", () => {
|
|
2559
2561
|
this.selectThisNode();
|
|
@@ -2573,7 +2575,7 @@ class Yt {
|
|
|
2573
2575
|
return this.block ? "quiz" : this.node.attrs.fieldType || "var";
|
|
2574
2576
|
}
|
|
2575
2577
|
resolveRaw() {
|
|
2576
|
-
return this.block ?
|
|
2578
|
+
return this.block ? Tr(String(this.node.attrs.fieldContent || "")) : Sr(
|
|
2577
2579
|
String(this.node.attrs.fieldType || "var"),
|
|
2578
2580
|
String(this.node.attrs.fieldContent || "")
|
|
2579
2581
|
);
|
|
@@ -2611,7 +2613,7 @@ class Yt {
|
|
|
2611
2613
|
class Ar {
|
|
2612
2614
|
constructor(t, i, a) {
|
|
2613
2615
|
this.editing = !1, this.node = t, this.view = i, this.getPos = a;
|
|
2614
|
-
const r = String(t.attrs.fieldType || "var"),
|
|
2616
|
+
const r = String(t.attrs.fieldType || "var"), g = String(t.attrs.fieldContent || ""), d = mt(r);
|
|
2615
2617
|
this.dom = document.createElement("span"), this.dom.className = "aimd-field-chip", this.dom.setAttribute("data-field-type", r), this.dom.contentEditable = "false", this.dom.style.cssText = `
|
|
2616
2618
|
display: inline-flex;
|
|
2617
2619
|
align-items: center;
|
|
@@ -2633,7 +2635,7 @@ class Ar {
|
|
|
2633
2635
|
font-size: 11px;
|
|
2634
2636
|
opacity: 0.7;
|
|
2635
2637
|
margin-right: 2px;
|
|
2636
|
-
`, this.contentEl = document.createElement("span"), this.contentEl.className = "aimd-field-chip-content", this.contentEl.textContent =
|
|
2638
|
+
`, this.contentEl = document.createElement("span"), this.contentEl.className = "aimd-field-chip-content", this.contentEl.textContent = g, this.contentEl.style.cssText = "font-weight: 500;", this.dom.appendChild(this.labelEl), this.dom.appendChild(this.contentEl), this.dom.addEventListener("mouseenter", () => {
|
|
2637
2639
|
this.dom.style.background = `${d}1a`, this.dom.style.borderColor = `${d}66`;
|
|
2638
2640
|
}), this.dom.addEventListener("mouseleave", () => {
|
|
2639
2641
|
this.editing || (this.dom.style.background = `${d}0d`, this.dom.style.borderColor = `${d}33`);
|
|
@@ -2649,8 +2651,8 @@ class Ar {
|
|
|
2649
2651
|
this.contentEl.contentEditable = "true", this.contentEl.style.outline = "none", this.contentEl.style.minWidth = "30px", this.contentEl.style.borderBottom = `1px dashed ${a}`, this.dom.style.background = `${a}1a`, this.dom.style.borderColor = `${a}66`, this.contentEl.focus();
|
|
2650
2652
|
const r = document.createRange();
|
|
2651
2653
|
r.selectNodeContents(this.contentEl);
|
|
2652
|
-
const
|
|
2653
|
-
|
|
2654
|
+
const g = window.getSelection();
|
|
2655
|
+
g?.removeAllRanges(), g?.addRange(r);
|
|
2654
2656
|
const d = () => {
|
|
2655
2657
|
this.editing = !1;
|
|
2656
2658
|
const p = this.contentEl.textContent || "";
|
|
@@ -2691,10 +2693,10 @@ const xr = Va.extendSchema((e) => (t) => ({
|
|
|
2691
2693
|
width: 4
|
|
2692
2694
|
}));
|
|
2693
2695
|
function Fr(e) {
|
|
2694
|
-
const t = It(Bt, () => (a, r,
|
|
2696
|
+
const t = It(Bt, () => (a, r, g) => {
|
|
2695
2697
|
const d = String(a.attrs.fieldType || "var");
|
|
2696
|
-
return Cr.has(d) ? new Yt(a, r,
|
|
2697
|
-
}), i = It(Gt, () => (a, r,
|
|
2698
|
+
return Cr.has(d) ? new Yt(a, r, g, e, !1) : new Ar(a, r, g);
|
|
2699
|
+
}), i = It(Gt, () => (a, r, g) => new Yt(a, r, g, e, !0));
|
|
2698
2700
|
return [
|
|
2699
2701
|
Ba,
|
|
2700
2702
|
Rr,
|
|
@@ -2730,7 +2732,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
2730
2732
|
},
|
|
2731
2733
|
emits: ["update:content", "update:modelValue", "ready", "fields-change", "error", "field-change", "field-blur", "assigner-request", "assigner-cancel", "table-add-row", "table-remove-row", "edit-field", "delete-field"],
|
|
2732
2734
|
setup(e, { expose: t, emit: i }) {
|
|
2733
|
-
const a = ["var", "var_table", "quiz", "step", "check"], r = new Set(a),
|
|
2735
|
+
const a = ["var", "var_table", "quiz", "step", "check"], r = new Set(a), g = [...a], d = e, p = i, h = z(() => Oa(d.locale)), D = z(() => La(h.value).filter(($) => r.has($.type))), T = z(() => Na(h.value)), A = z(() => (d.locale || "").toLowerCase().startsWith("zh") ? "拖到这里" : "Drop here"), L = z(() => ({
|
|
2734
2736
|
"--aimd-recorder-drop-label": JSON.stringify(A.value)
|
|
2735
2737
|
})), j = z(() => (d.typePlugins ?? []).map(($) => ({
|
|
2736
2738
|
key: $.type,
|
|
@@ -2803,16 +2805,16 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
2803
2805
|
onEditField: ($) => p("edit-field", $),
|
|
2804
2806
|
onDeleteField: ($) => p("delete-field", $)
|
|
2805
2807
|
})
|
|
2806
|
-
],
|
|
2808
|
+
], b = z(() => {
|
|
2807
2809
|
try {
|
|
2808
2810
|
const $ = ht(Y.value);
|
|
2809
2811
|
return [...$.step || [], ...$.var || []];
|
|
2810
2812
|
} catch {
|
|
2811
2813
|
return [];
|
|
2812
2814
|
}
|
|
2813
|
-
}),
|
|
2815
|
+
}), S = K(!1), q = K("var");
|
|
2814
2816
|
function J($) {
|
|
2815
|
-
q.value = r.has($) ? $ : "var",
|
|
2817
|
+
q.value = r.has($) ? $ : "var", S.value = !0;
|
|
2816
2818
|
}
|
|
2817
2819
|
function P($) {
|
|
2818
2820
|
r.has($) && G(ja($, h.value));
|
|
@@ -2837,7 +2839,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
2837
2839
|
"editor-mode": "wysiwyg",
|
|
2838
2840
|
"resolved-messages": h.value,
|
|
2839
2841
|
"localized-field-types": D.value,
|
|
2840
|
-
"localized-md-toolbar-items":
|
|
2842
|
+
"localized-md-toolbar-items": T.value,
|
|
2841
2843
|
onMdAction: qe(W),
|
|
2842
2844
|
onOpenAimdDialog: J,
|
|
2843
2845
|
onQuickInsertAimd: P
|
|
@@ -2858,13 +2860,13 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
2858
2860
|
onOpenAimdDialog: J
|
|
2859
2861
|
}, null, 8, ["content", "min-height", "enable-block-handle", "readonly", "resolved-messages", "localized-field-types", "onMarkdownUpdated"]),
|
|
2860
2862
|
Oe(qe(Ua), {
|
|
2861
|
-
visible:
|
|
2863
|
+
visible: S.value,
|
|
2862
2864
|
"initial-type": q.value,
|
|
2863
2865
|
messages: h.value,
|
|
2864
|
-
"ref-suggestions":
|
|
2866
|
+
"ref-suggestions": b.value,
|
|
2865
2867
|
"var-type-plugins": j.value,
|
|
2866
|
-
"allowed-types":
|
|
2867
|
-
"onUpdate:visible": ne[0] || (ne[0] = (ye) =>
|
|
2868
|
+
"allowed-types": g,
|
|
2869
|
+
"onUpdate:visible": ne[0] || (ne[0] = (ye) => S.value = ye),
|
|
2868
2870
|
onInsert: X
|
|
2869
2871
|
}, null, 8, ["visible", "initial-type", "messages", "ref-suggestions", "var-type-plugins"])
|
|
2870
2872
|
], 4));
|
|
@@ -2896,7 +2898,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
2896
2898
|
}, El = {
|
|
2897
2899
|
key: 1,
|
|
2898
2900
|
class: "aimd-recorder-workbench__structure-empty"
|
|
2899
|
-
},
|
|
2901
|
+
}, Sl = { class: "aimd-recorder-workbench__code" }, Tl = { class: "aimd-recorder-workbench__detached-description" }, ql = { class: "aimd-recorder-workbench__code aimd-recorder-workbench__code--detached" }, Dl = ["aria-label"], Rl = { class: "aimd-recorder-workbench__dialog-head" }, Al = { class: "aimd-recorder-workbench__dialog-title" }, xl = { class: "aimd-recorder-workbench__dialog-summary" }, Vl = { class: "aimd-recorder-workbench__dialog-body" }, Fl = { class: "aimd-recorder-workbench__dialog-label" }, Ml = ["value", "disabled"], Bl = { value: "var" }, Il = { value: "var_table" }, Pl = { value: "step" }, Ol = { value: "check" }, Ll = { value: "quiz" }, Nl = { class: "aimd-recorder-workbench__dialog-label" }, Hl = ["value", "disabled"], Kl = {
|
|
2900
2902
|
key: 0,
|
|
2901
2903
|
class: "aimd-recorder-workbench__dialog-label"
|
|
2902
2904
|
}, Wl = ["value", "disabled"], Ul = {
|
|
@@ -2945,7 +2947,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
2945
2947
|
},
|
|
2946
2948
|
emits: ["update:content", "update:modelValue", "update:editorMode", "editor-ready", "fields-change", "error", "field-change", "field-blur", "assigner-request", "assigner-cancel", "table-add-row", "table-remove-row"],
|
|
2947
2949
|
setup(e, { expose: t, emit: i }) {
|
|
2948
|
-
const a = e, r = i,
|
|
2950
|
+
const a = e, r = i, g = {
|
|
2949
2951
|
var: [],
|
|
2950
2952
|
var_definitions: [],
|
|
2951
2953
|
var_table: [],
|
|
@@ -2958,7 +2960,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
2958
2960
|
ref_fig: [],
|
|
2959
2961
|
cite: [],
|
|
2960
2962
|
fig: []
|
|
2961
|
-
}, d = K(null), p = K(null), h = K(null), D = K(null),
|
|
2963
|
+
}, d = K(null), p = K(null), h = K(null), D = K(null), T = K(null), A = K(null), L = K(null), j = K(null), Y = K(g), I = K(a.content || ""), G = K(a.content || ""), W = K(tt(a.modelValue)), N = K(null), k = K(a.initialVisualEditMode), V = K(null), R = K("recorder"), B = K(a.editorMinHeight), Q = K(a.recorderMinHeight), H = K(Math.max(320, a.recorderMinHeight)), b = K(null), S = K(""), q = K(null);
|
|
2962
2964
|
let J = 0, P = null, X = [], he = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Map();
|
|
2963
2965
|
const $ = /* @__PURE__ */ new Set(), ne = /* @__PURE__ */ new Set();
|
|
2964
2966
|
function ye(l) {
|
|
@@ -3006,7 +3008,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3006
3008
|
P = null, be(l), G.value = l;
|
|
3007
3009
|
}, Jl);
|
|
3008
3010
|
}
|
|
3009
|
-
function
|
|
3011
|
+
function Se(l) {
|
|
3010
3012
|
const s = ye(l), u = X.indexOf(s);
|
|
3011
3013
|
if (u !== -1) {
|
|
3012
3014
|
X = X.slice(u + 1);
|
|
@@ -3024,7 +3026,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3024
3026
|
de(() => a.initialVisualEditMode, (l) => {
|
|
3025
3027
|
k.value = l;
|
|
3026
3028
|
}), de(() => a.content, (l) => {
|
|
3027
|
-
|
|
3029
|
+
Se(l);
|
|
3028
3030
|
}, { immediate: !0 }), de(k, (l) => {
|
|
3029
3031
|
l && _e(I.value);
|
|
3030
3032
|
}), de(() => a.modelValue, (l) => {
|
|
@@ -3103,7 +3105,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3103
3105
|
B.value = a.editorMinHeight, Q.value = a.recorderMinHeight;
|
|
3104
3106
|
return;
|
|
3105
3107
|
}
|
|
3106
|
-
const l = Math.max(h.value?.getBoundingClientRect().top ?? 0, 0), s = Math.max(0, Math.floor(E() - l - a.viewportOffset)), u = ae(A.value?.querySelector(".aimd-editor-toolbar")), U = ae(D.value), te = ae(
|
|
3108
|
+
const l = Math.max(h.value?.getBoundingClientRect().top ?? 0, 0), s = Math.max(0, Math.floor(E() - l - a.viewportOffset)), u = ae(A.value?.querySelector(".aimd-editor-toolbar")), U = ae(D.value), te = ae(T.value), $e = Math.max(
|
|
3107
3109
|
a.recorderMinHeight,
|
|
3108
3110
|
Math.floor(s - te)
|
|
3109
3111
|
), We = ae(j.value), oe = ae(L.value?.querySelector(".aimd-editor-toolbar"));
|
|
@@ -3135,7 +3137,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3135
3137
|
for (const s of M.value)
|
|
3136
3138
|
l.set(`${s.fieldType}:${s.id}`, s);
|
|
3137
3139
|
return l;
|
|
3138
|
-
}),
|
|
3140
|
+
}), Te = z(() => {
|
|
3139
3141
|
const l = /* @__PURE__ */ new Map();
|
|
3140
3142
|
return M.value.forEach((s, u) => {
|
|
3141
3143
|
l.set(s.uid, u);
|
|
@@ -3150,7 +3152,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3150
3152
|
return l.find((U) => U.start === s.start) ?? l.find((U) => U.uid === s.uid) ?? l.find((U) => U.fieldType === s.fieldType && U.id === s.id) ?? null;
|
|
3151
3153
|
}
|
|
3152
3154
|
function Ze(l, s) {
|
|
3153
|
-
const u = gt(), U = new Set(s.var), te = new Set(
|
|
3155
|
+
const u = gt(), U = new Set(s.var), te = new Set(Si(s.step).map((oe) => oe.name)), $e = new Set(Ti(s.check).map((oe) => oe.name)), We = new Set(qi(s.quiz).map((oe) => oe.id));
|
|
3154
3156
|
for (const oe of Di(s.var_table))
|
|
3155
3157
|
U.add(oe.id);
|
|
3156
3158
|
for (const [oe, Me] of Object.entries(l.var))
|
|
@@ -3183,14 +3185,14 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3183
3185
|
}, { immediate: !0 }), de([k, R], ([l, s]) => {
|
|
3184
3186
|
(!l || s !== "recorder") && (Be(), q.value = null);
|
|
3185
3187
|
}), de(M, (l) => {
|
|
3186
|
-
if (!
|
|
3188
|
+
if (!b.value)
|
|
3187
3189
|
return;
|
|
3188
|
-
const s = we(l,
|
|
3190
|
+
const s = we(l, b.value);
|
|
3189
3191
|
if (!s) {
|
|
3190
3192
|
Be();
|
|
3191
3193
|
return;
|
|
3192
3194
|
}
|
|
3193
|
-
|
|
3195
|
+
b.value = s, S.value = s.raw;
|
|
3194
3196
|
}), de(
|
|
3195
3197
|
[
|
|
3196
3198
|
R,
|
|
@@ -3218,7 +3220,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3218
3220
|
if (ze(l)) {
|
|
3219
3221
|
if (_e(l), s || u) {
|
|
3220
3222
|
const U = pt(l), te = s ? we(U, s, u) : U.find(($e) => $e.fieldType === u?.fieldType && $e.id === u?.id) ?? null;
|
|
3221
|
-
te ? (
|
|
3223
|
+
te ? (b.value = te, S.value = te.raw) : s && b.value?.uid === s.uid && Be();
|
|
3222
3224
|
}
|
|
3223
3225
|
r("update:content", l);
|
|
3224
3226
|
}
|
|
@@ -3246,7 +3248,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3246
3248
|
Y.value = l, r("fields-change", l);
|
|
3247
3249
|
}
|
|
3248
3250
|
function He(l) {
|
|
3249
|
-
const s = jt(M.value, l);
|
|
3251
|
+
const s = jt(M.value, l, l === "quiz" ? "choice" : void 0);
|
|
3250
3252
|
Fe(ia(I.value, l, {
|
|
3251
3253
|
id: s,
|
|
3252
3254
|
valueType: l === "var" ? "str" : void 0
|
|
@@ -3256,7 +3258,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3256
3258
|
});
|
|
3257
3259
|
}
|
|
3258
3260
|
function ot(l) {
|
|
3259
|
-
|
|
3261
|
+
b.value?.uid === l.uid && Be(), st(fr(I.value, l));
|
|
3260
3262
|
}
|
|
3261
3263
|
function ha(l, s) {
|
|
3262
3264
|
const u = s.trim();
|
|
@@ -3274,26 +3276,26 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3274
3276
|
id: l.id
|
|
3275
3277
|
});
|
|
3276
3278
|
}
|
|
3277
|
-
function
|
|
3279
|
+
function St(l, s) {
|
|
3278
3280
|
va(l, s.target.value);
|
|
3279
3281
|
}
|
|
3280
3282
|
function ya(l, s) {
|
|
3281
3283
|
Fe(yr(I.value, l, s), l);
|
|
3282
3284
|
}
|
|
3283
|
-
function
|
|
3285
|
+
function Tt(l, s) {
|
|
3284
3286
|
ya(l, s.target.value);
|
|
3285
3287
|
}
|
|
3286
3288
|
function qt(l) {
|
|
3287
|
-
|
|
3289
|
+
b.value = l, S.value = l.raw, q.value = null;
|
|
3288
3290
|
}
|
|
3289
3291
|
function Be() {
|
|
3290
|
-
|
|
3292
|
+
b.value = null, S.value = "";
|
|
3291
3293
|
}
|
|
3292
3294
|
function pa(l) {
|
|
3293
3295
|
a.readonly || (q.value = q.value === l ? null : l);
|
|
3294
3296
|
}
|
|
3295
3297
|
function Ke(l, s) {
|
|
3296
|
-
const u = jt(M.value, l);
|
|
3298
|
+
const u = jt(M.value, l, l === "quiz" ? "choice" : void 0);
|
|
3297
3299
|
q.value = null, Fe(mr(
|
|
3298
3300
|
I.value,
|
|
3299
3301
|
M.value,
|
|
@@ -3309,11 +3311,11 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3309
3311
|
});
|
|
3310
3312
|
}
|
|
3311
3313
|
function ga() {
|
|
3312
|
-
!a.allowRawFieldSourceEditing || !
|
|
3314
|
+
!a.allowRawFieldSourceEditing || !b.value || Fe(pr(
|
|
3313
3315
|
I.value,
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
),
|
|
3316
|
+
b.value,
|
|
3317
|
+
S.value
|
|
3318
|
+
), b.value);
|
|
3317
3319
|
}
|
|
3318
3320
|
function Dt(l) {
|
|
3319
3321
|
return M.value.find((s) => s.fieldType === l.fieldType && s.id === l.id) ?? M.value.find((s) => s.raw === l.raw) ?? null;
|
|
@@ -3418,7 +3420,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3418
3420
|
const U = Ae.value.get(l);
|
|
3419
3421
|
if (!U)
|
|
3420
3422
|
return a.wrapField ? a.wrapField(l, s, u) : u;
|
|
3421
|
-
const te =
|
|
3423
|
+
const te = Te.value.get(U.uid) ?? 0, $e = f("span", {
|
|
3422
3424
|
class: [
|
|
3423
3425
|
"aimd-recorder-workbench__visual-field",
|
|
3424
3426
|
U.sourceKind === "block" ? "aimd-recorder-workbench__visual-field--block" : "aimd-recorder-workbench__visual-field--inline",
|
|
@@ -3497,7 +3499,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3497
3499
|
}, [
|
|
3498
3500
|
v("header", {
|
|
3499
3501
|
ref_key: "sidePanelHeadRef",
|
|
3500
|
-
ref:
|
|
3502
|
+
ref: T,
|
|
3501
3503
|
class: "aimd-recorder-workbench__panel-head"
|
|
3502
3504
|
}, [
|
|
3503
3505
|
v("div", Lr, [
|
|
@@ -3679,7 +3681,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3679
3681
|
v("select", {
|
|
3680
3682
|
value: u.fieldType,
|
|
3681
3683
|
disabled: e.readonly,
|
|
3682
|
-
onChange: (te) =>
|
|
3684
|
+
onChange: (te) => St(u, te)
|
|
3683
3685
|
}, [
|
|
3684
3686
|
v("option", vl, C(m.value.typeLabels.var), 1),
|
|
3685
3687
|
v("option", yl, C(m.value.typeLabels.var_table), 1),
|
|
@@ -3701,7 +3703,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3701
3703
|
v("input", {
|
|
3702
3704
|
value: u.valueType || "str",
|
|
3703
3705
|
disabled: e.readonly,
|
|
3704
|
-
onChange: (te) =>
|
|
3706
|
+
onChange: (te) => Tt(u, te)
|
|
3705
3707
|
}, null, 40, Cl)
|
|
3706
3708
|
])) : O("", !0)
|
|
3707
3709
|
])
|
|
@@ -3721,19 +3723,19 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3721
3723
|
class: "aimd-recorder-workbench__panel-body aimd-recorder-workbench__panel-body--code",
|
|
3722
3724
|
style: Qe(Xe.value)
|
|
3723
3725
|
}, [
|
|
3724
|
-
v("pre",
|
|
3726
|
+
v("pre", Sl, C(ra.value), 1)
|
|
3725
3727
|
], 4)) : R.value === "detached" ? (_(), w("div", {
|
|
3726
3728
|
key: 3,
|
|
3727
3729
|
class: "aimd-recorder-workbench__panel-body aimd-recorder-workbench__panel-body--code",
|
|
3728
3730
|
style: Qe(Xe.value)
|
|
3729
3731
|
}, [
|
|
3730
|
-
v("p",
|
|
3732
|
+
v("p", Tl, C(y.value), 1),
|
|
3731
3733
|
v("pre", ql, " " + C(la.value) + `
|
|
3732
3734
|
`, 1)
|
|
3733
3735
|
], 4)) : O("", !0)
|
|
3734
3736
|
], 2)
|
|
3735
3737
|
]),
|
|
3736
|
-
|
|
3738
|
+
b.value ? (_(), w("div", {
|
|
3737
3739
|
key: 0,
|
|
3738
3740
|
class: "aimd-recorder-workbench__dialog-backdrop",
|
|
3739
3741
|
onClick: ut(Be, ["self"])
|
|
@@ -3759,9 +3761,9 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3759
3761
|
v("label", Fl, [
|
|
3760
3762
|
v("span", null, C(m.value.kind), 1),
|
|
3761
3763
|
v("select", {
|
|
3762
|
-
value:
|
|
3764
|
+
value: b.value.fieldType,
|
|
3763
3765
|
disabled: e.readonly,
|
|
3764
|
-
onChange: s[26] || (s[26] = (u) =>
|
|
3766
|
+
onChange: s[26] || (s[26] = (u) => St(b.value, u))
|
|
3765
3767
|
}, [
|
|
3766
3768
|
v("option", Bl, C(m.value.typeLabels.var), 1),
|
|
3767
3769
|
v("option", Il, C(m.value.typeLabels.var_table), 1),
|
|
@@ -3773,27 +3775,27 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3773
3775
|
v("label", Nl, [
|
|
3774
3776
|
v("span", null, C(m.value.id), 1),
|
|
3775
3777
|
v("input", {
|
|
3776
|
-
value:
|
|
3778
|
+
value: b.value.id,
|
|
3777
3779
|
disabled: e.readonly,
|
|
3778
|
-
onChange: s[27] || (s[27] = (u) => Et(
|
|
3780
|
+
onChange: s[27] || (s[27] = (u) => Et(b.value, u))
|
|
3779
3781
|
}, null, 40, Hl)
|
|
3780
3782
|
]),
|
|
3781
|
-
|
|
3783
|
+
b.value.fieldType === "var" ? (_(), w("label", Kl, [
|
|
3782
3784
|
v("span", null, C(m.value.valueType), 1),
|
|
3783
3785
|
v("input", {
|
|
3784
|
-
value:
|
|
3786
|
+
value: b.value.valueType || "str",
|
|
3785
3787
|
disabled: e.readonly,
|
|
3786
|
-
onChange: s[28] || (s[28] = (u) =>
|
|
3788
|
+
onChange: s[28] || (s[28] = (u) => Tt(b.value, u))
|
|
3787
3789
|
}, null, 40, Wl)
|
|
3788
3790
|
])) : O("", !0),
|
|
3789
3791
|
e.allowRawFieldSourceEditing ? (_(), w("label", Ul, [
|
|
3790
3792
|
v("span", null, C(m.value.source), 1),
|
|
3791
3793
|
Je(v("textarea", {
|
|
3792
|
-
"onUpdate:modelValue": s[29] || (s[29] = (u) =>
|
|
3794
|
+
"onUpdate:modelValue": s[29] || (s[29] = (u) => S.value = u),
|
|
3793
3795
|
class: "aimd-recorder-workbench__dialog-textarea",
|
|
3794
3796
|
disabled: e.readonly
|
|
3795
3797
|
}, null, 8, jl), [
|
|
3796
|
-
[Xt,
|
|
3798
|
+
[Xt, S.value]
|
|
3797
3799
|
])
|
|
3798
3800
|
])) : O("", !0)
|
|
3799
3801
|
]),
|
|
@@ -3804,7 +3806,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3804
3806
|
class: "aimd-recorder-workbench__dialog-delete",
|
|
3805
3807
|
type: "button",
|
|
3806
3808
|
disabled: e.readonly,
|
|
3807
|
-
onClick: s[30] || (s[30] = (u) => ot(
|
|
3809
|
+
onClick: s[30] || (s[30] = (u) => ot(b.value))
|
|
3808
3810
|
}, C(m.value.delete), 9, Zl),
|
|
3809
3811
|
e.allowRawFieldSourceEditing ? (_(), w("button", {
|
|
3810
3812
|
key: 0,
|
|
@@ -3819,7 +3821,7 @@ const Mr = /* @__PURE__ */ Ee({
|
|
|
3819
3821
|
])) : O("", !0)
|
|
3820
3822
|
], 512));
|
|
3821
3823
|
}
|
|
3822
|
-
}), ds = /* @__PURE__ */ Ye(as, [["__scopeId", "data-v-
|
|
3824
|
+
}), ds = /* @__PURE__ */ Ye(as, [["__scopeId", "data-v-8ed92917"]]), cs = it(() => import("./AimdDnaSequenceField-CPyMqIVh.js")), us = it(() => import("./AimdMarkdownField-CX71bOdX.js")), ms = bt;
|
|
3823
3825
|
export {
|
|
3824
3826
|
cs as AimdDnaSequenceField,
|
|
3825
3827
|
us as AimdMarkdownField,
|