@airalogy/aimd-editor 1.8.0 → 1.9.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/AimdEditorTopBar.vue_vue_type_script_setup_true_lang-DUzstO_i.js +1145 -0
- package/dist/{AimdWysiwygEditor.vue_vue_type_script_setup_true_lang-tRm4S2Nv.js → AimdWysiwygEditor.vue_vue_type_script_setup_true_lang-BYUea59a.js} +13 -6
- package/dist/aimd-editor.css +1 -1
- package/dist/embedded.js +1 -1
- package/dist/index.js +2 -2
- package/dist/vue.js +2 -2
- package/dist/wysiwyg.js +1 -1
- package/package.json +1 -1
- package/src/vue/AimdEditor.vue +7 -0
- package/src/vue/AimdFieldDialog.vue +58 -15
- package/src/vue/locales.ts +3 -0
- package/src/vue/types.ts +21 -11
- package/src/vue/useEditorContent.ts +7 -1
- package/dist/AimdEditorTopBar.vue_vue_type_script_setup_true_lang-yYY-Yq1g.js +0 -1131
|
@@ -0,0 +1,1145 @@
|
|
|
1
|
+
import { defineComponent as ve, computed as x, ref as $, watch as U, openBlock as r, createBlock as xe, Teleport as Ee, createElementBlock as v, withModifiers as ue, createElementVNode as l, normalizeStyle as me, createTextVNode as N, toDisplayString as i, Fragment as A, renderList as j, normalizeClass as W, withDirectives as b, vModelText as I, createCommentVNode as C, vModelSelect as be, vModelRadio as Le, vModelCheckbox as He, shallowRef as we, nextTick as Te, unref as O, createVNode as ke, vShow as Ce } from "vue";
|
|
2
|
+
import { callCommand as De, insert as _e, replaceAll as ce, getMarkdown as ze } from "@milkdown/kit/utils";
|
|
3
|
+
import "@milkdown/theme-nord/style.css";
|
|
4
|
+
import { j as $e, m as ie, k as Pe, h as Ie, o as Re, i as Ne, l as Fe, _ as Oe, n as Ke } from "./AimdWysiwygEditor.vue_vue_type_script_setup_true_lang-BYUea59a.js";
|
|
5
|
+
import { _ as Qe } from "./AimdSourceEditor.vue_vue_type_script_setup_true_lang-ttzw5IdG.js";
|
|
6
|
+
import { protectAimdInlineTemplates as je, restoreAimdInlineTemplates as We } from "@airalogy/aimd-core";
|
|
7
|
+
import { parseAndExtract as Ge } from "@airalogy/aimd-renderer";
|
|
8
|
+
import { insertTableCommand as Je } from "@milkdown/kit/preset/gfm";
|
|
9
|
+
const Xe = { class: "aimd-dialog" }, Ye = { class: "aimd-dialog-header" }, Ze = { class: "aimd-dialog-title" }, el = ["innerHTML"], ll = { class: "aimd-dialog-type-tabs" }, sl = ["onClick"], tl = ["innerHTML"], ol = { class: "aimd-dialog-body" }, al = { class: "aimd-field-row" }, il = { class: "aimd-field-label" }, nl = ["placeholder"], dl = { class: "aimd-field-row" }, rl = { class: "aimd-field-label" }, ul = { class: "aimd-field-hint" }, cl = { class: "aimd-var-type-grid" }, ml = ["onClick"], vl = { class: "aimd-var-type-card-title" }, pl = { class: "aimd-var-type-card-desc" }, gl = { class: "aimd-field-row" }, fl = { class: "aimd-field-label" }, hl = ["placeholder"], yl = { class: "aimd-field-hint" }, bl = { class: "aimd-field-row" }, wl = { class: "aimd-field-label" }, kl = ["placeholder"], _l = { class: "aimd-field-row" }, Ml = { class: "aimd-field-label" }, Tl = ["placeholder"], Cl = { class: "aimd-field-row" }, zl = { class: "aimd-field-label" }, Il = ["placeholder"], xl = { class: "aimd-field-row" }, $l = { class: "aimd-field-label" }, Vl = ["placeholder"], Bl = { class: "aimd-field-hint" }, Al = { class: "aimd-field-row" }, ql = { class: "aimd-field-label" }, Sl = ["placeholder"], Ul = { class: "aimd-field-row" }, El = { class: "aimd-field-label" }, Ll = { value: "1" }, Hl = { value: "2" }, Dl = { value: "3" }, Pl = { class: "aimd-field-row" }, Rl = { class: "aimd-field-label" }, Nl = ["placeholder"], Fl = { class: "aimd-field-row" }, Ol = { class: "aimd-field-label" }, Kl = { value: "choice" }, Ql = { value: "blank" }, jl = { value: "open" }, Wl = { class: "aimd-field-row" }, Gl = { class: "aimd-field-label" }, Jl = ["placeholder"], Xl = { class: "aimd-field-row" }, Yl = { class: "aimd-field-label" }, Zl = ["placeholder"], es = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "aimd-field-hint"
|
|
12
|
+
}, ls = { class: "aimd-field-row" }, ss = { class: "aimd-field-label" }, ts = { value: "single" }, os = { value: "multiple" }, as = { class: "aimd-field-row" }, is = { class: "aimd-field-label" }, ns = { class: "aimd-collection-editor" }, ds = ["onDragover", "onDrop"], rs = ["title", "onDragstart"], us = ["onUpdate:modelValue", "placeholder"], cs = ["onUpdate:modelValue", "placeholder"], ms = { class: "aimd-option-answer-toggle" }, vs = ["value", "disabled"], ps = ["value", "disabled"], gs = ["disabled", "onClick"], fs = { class: "aimd-field-hint" }, hs = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "aimd-field-row"
|
|
15
|
+
}, ys = { class: "aimd-field-label" }, bs = { class: "aimd-collection-editor" }, ws = ["onUpdate:modelValue", "placeholder"], ks = ["onUpdate:modelValue", "placeholder"], _s = ["disabled", "onClick"], Ms = { class: "aimd-field-hint" }, Ts = {
|
|
16
|
+
key: 2,
|
|
17
|
+
class: "aimd-field-row"
|
|
18
|
+
}, Cs = { class: "aimd-field-label" }, zs = ["placeholder"], Is = {
|
|
19
|
+
key: 4,
|
|
20
|
+
class: "aimd-field-row"
|
|
21
|
+
}, xs = { class: "aimd-field-label" }, $s = ["placeholder"], Vs = {
|
|
22
|
+
key: 5,
|
|
23
|
+
class: "aimd-field-row"
|
|
24
|
+
}, Bs = { class: "aimd-field-label" }, As = ["placeholder"], qs = { id: "aimd-ref-suggestions" }, Ss = ["value"], Us = {
|
|
25
|
+
key: 0,
|
|
26
|
+
class: "aimd-field-hint"
|
|
27
|
+
}, Es = {
|
|
28
|
+
key: 6,
|
|
29
|
+
class: "aimd-field-row"
|
|
30
|
+
}, Ls = { class: "aimd-field-label" }, Hs = ["placeholder"], Ds = { class: "aimd-field-hint" }, Ps = { class: "aimd-dialog-preview" }, Rs = { class: "aimd-preview-header" }, Ns = { class: "aimd-preview-panel" }, Fs = { class: "aimd-preview-code" }, Os = {
|
|
31
|
+
key: 7,
|
|
32
|
+
class: "aimd-dialog-error"
|
|
33
|
+
}, Ks = { class: "aimd-dialog-footer" }, Qs = /* @__PURE__ */ ve({
|
|
34
|
+
__name: "AimdFieldDialog",
|
|
35
|
+
props: {
|
|
36
|
+
visible: { type: Boolean },
|
|
37
|
+
initialType: {},
|
|
38
|
+
messages: {},
|
|
39
|
+
refSuggestions: {},
|
|
40
|
+
varTypePlugins: {},
|
|
41
|
+
allowedTypes: {},
|
|
42
|
+
existingQuizIds: {}
|
|
43
|
+
},
|
|
44
|
+
emits: ["update:visible", "insert"],
|
|
45
|
+
setup(u, { emit: F }) {
|
|
46
|
+
const o = u, M = F, w = x(() => {
|
|
47
|
+
const a = $e(o.messages);
|
|
48
|
+
if (!o.allowedTypes || o.allowedTypes.length === 0)
|
|
49
|
+
return a;
|
|
50
|
+
const s = new Set(o.allowedTypes);
|
|
51
|
+
return a.filter((e) => s.has(e.type));
|
|
52
|
+
});
|
|
53
|
+
function g(a) {
|
|
54
|
+
return a && w.value.some((s) => s.type === a) ? a : w.value[0]?.type ?? a ?? "var";
|
|
55
|
+
}
|
|
56
|
+
const f = x(() => new Set(o.existingQuizIds || [])), d = $(g(o.initialType)), t = $(ie(d.value, o.messages, f.value)), T = $([]), V = $([]), h = $([]), _ = $(null), E = $(null), k = $(""), G = x(
|
|
57
|
+
() => Pe(o.messages, o.varTypePlugins ?? [])
|
|
58
|
+
);
|
|
59
|
+
function D(a) {
|
|
60
|
+
return (a || "").trim().toLowerCase().replace(/[\s_-]/g, "");
|
|
61
|
+
}
|
|
62
|
+
function J(a) {
|
|
63
|
+
return D(t.value.type) === D(a);
|
|
64
|
+
}
|
|
65
|
+
function X(a) {
|
|
66
|
+
t.value.type = a;
|
|
67
|
+
}
|
|
68
|
+
function Y(a, s) {
|
|
69
|
+
const e = `quiz_${a}`;
|
|
70
|
+
let p = 1;
|
|
71
|
+
for (; s.has(`${e}_${p}`); )
|
|
72
|
+
p += 1;
|
|
73
|
+
return `${e}_${p}`;
|
|
74
|
+
}
|
|
75
|
+
function Z(a) {
|
|
76
|
+
const s = a.split(",").map((e) => e.trim()).filter(Boolean);
|
|
77
|
+
return s.length === 0 ? [
|
|
78
|
+
{ key: "A", text: "" },
|
|
79
|
+
{ key: "B", text: "" }
|
|
80
|
+
] : s.map((e, p) => {
|
|
81
|
+
const y = e.indexOf(":");
|
|
82
|
+
if (y > 0) {
|
|
83
|
+
const Q = e.slice(0, y).trim() || String.fromCharCode(65 + p), re = e.slice(y + 1).trim() || o.messages.defaults.optionText(Q);
|
|
84
|
+
return { key: Q, text: re };
|
|
85
|
+
}
|
|
86
|
+
return { key: String.fromCharCode(65 + p), text: e };
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function ee(a) {
|
|
90
|
+
const s = a.map((e) => ({ key: e.key.trim(), text: e.text.trim() })).filter((e) => e.key && e.text);
|
|
91
|
+
return s.length === 0 ? "A:, B:" : s.map((e) => `${e.key}:${e.text}`).join(", ");
|
|
92
|
+
}
|
|
93
|
+
function le(a) {
|
|
94
|
+
const s = a.split(",").map((e) => e.trim()).filter(Boolean);
|
|
95
|
+
return s.length === 0 ? [{ key: "b1", answer: "" }] : s.map((e, p) => {
|
|
96
|
+
const y = e.indexOf(":");
|
|
97
|
+
if (y > 0) {
|
|
98
|
+
const oe = e.slice(0, y).trim() || `b${p + 1}`, Q = e.slice(y + 1).trim() || "";
|
|
99
|
+
return { key: oe, answer: Q };
|
|
100
|
+
}
|
|
101
|
+
return { key: `b${p + 1}`, answer: e };
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function B(a) {
|
|
105
|
+
const s = a.map((e) => ({ key: e.key.trim(), answer: e.answer.trim() })).filter((e) => e.key);
|
|
106
|
+
return s.length === 0 ? "b1:" : s.map((e) => `${e.key}:${e.answer}`).join(", ");
|
|
107
|
+
}
|
|
108
|
+
function q(a) {
|
|
109
|
+
return a.split(",").map((s) => s.trim()).filter(Boolean);
|
|
110
|
+
}
|
|
111
|
+
function L() {
|
|
112
|
+
d.value === "quiz" && (t.value.quizType === "choice" ? (T.value = Z(t.value.options || ""), h.value = q(t.value.answer || "")) : t.value.quizType === "blank" && (V.value = le(t.value.blanks || "")));
|
|
113
|
+
}
|
|
114
|
+
function K() {
|
|
115
|
+
if (d.value !== "quiz" || t.value.quizType !== "choice") return;
|
|
116
|
+
const a = new Set(
|
|
117
|
+
T.value.map((s) => s.key.trim()).filter(Boolean)
|
|
118
|
+
);
|
|
119
|
+
if (t.value.mode === "multiple") {
|
|
120
|
+
const s = h.value.map((e) => e.trim()).filter((e) => e && a.has(e));
|
|
121
|
+
s.length !== h.value.length && (h.value = s);
|
|
122
|
+
} else {
|
|
123
|
+
const s = (t.value.answer || "").trim();
|
|
124
|
+
s && !a.has(s) && (t.value.answer = "");
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function se() {
|
|
128
|
+
const a = new Set(
|
|
129
|
+
T.value.map((s) => s.key.trim().toUpperCase()).filter(Boolean)
|
|
130
|
+
);
|
|
131
|
+
for (let s = 0; s < 26; s++) {
|
|
132
|
+
const e = String.fromCharCode(65 + s);
|
|
133
|
+
if (!a.has(e)) return e;
|
|
134
|
+
}
|
|
135
|
+
return `K${T.value.length + 1}`;
|
|
136
|
+
}
|
|
137
|
+
function n() {
|
|
138
|
+
const a = se();
|
|
139
|
+
T.value.push({ key: a, text: "" });
|
|
140
|
+
}
|
|
141
|
+
function c(a) {
|
|
142
|
+
T.value.length <= 1 || T.value.splice(a, 1);
|
|
143
|
+
}
|
|
144
|
+
function z(a) {
|
|
145
|
+
_.value = a, E.value = a;
|
|
146
|
+
}
|
|
147
|
+
function P(a) {
|
|
148
|
+
_.value !== null && (E.value = a);
|
|
149
|
+
}
|
|
150
|
+
function H(a) {
|
|
151
|
+
const s = _.value;
|
|
152
|
+
if (s === null || s === a) {
|
|
153
|
+
_.value = null, E.value = null;
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const e = T.value.splice(s, 1)[0];
|
|
157
|
+
T.value.splice(a, 0, e), _.value = null, E.value = null;
|
|
158
|
+
}
|
|
159
|
+
function R() {
|
|
160
|
+
_.value = null, E.value = null;
|
|
161
|
+
}
|
|
162
|
+
function ne() {
|
|
163
|
+
const a = new Set(
|
|
164
|
+
V.value.map((e) => e.key.trim().toLowerCase()).filter(Boolean)
|
|
165
|
+
);
|
|
166
|
+
let s = 1;
|
|
167
|
+
for (; a.has(`b${s}`); )
|
|
168
|
+
s += 1;
|
|
169
|
+
return `b${s}`;
|
|
170
|
+
}
|
|
171
|
+
function te() {
|
|
172
|
+
V.value.push({ key: ne(), answer: "" });
|
|
173
|
+
}
|
|
174
|
+
function pe(a) {
|
|
175
|
+
V.value.length <= 1 || V.value.splice(a, 1);
|
|
176
|
+
}
|
|
177
|
+
function de(a) {
|
|
178
|
+
const s = /* @__PURE__ */ new Set(), e = [];
|
|
179
|
+
for (const p of a)
|
|
180
|
+
s.has(p) && !e.includes(p) && e.push(p), s.add(p);
|
|
181
|
+
return e;
|
|
182
|
+
}
|
|
183
|
+
function m(a) {
|
|
184
|
+
const s = [], e = /\[\[([^\[\]\s]+)\]\]/g;
|
|
185
|
+
for (const p of a.matchAll(e))
|
|
186
|
+
s.push(p[1]);
|
|
187
|
+
return s;
|
|
188
|
+
}
|
|
189
|
+
function S() {
|
|
190
|
+
const a = V.value.map((ae) => ae.key.trim()).filter(Boolean);
|
|
191
|
+
if (a.length === 0)
|
|
192
|
+
return o.messages.errors.blankQuizRequiresBlankKey;
|
|
193
|
+
const s = de(a);
|
|
194
|
+
if (s.length > 0)
|
|
195
|
+
return o.messages.errors.blankKeysMustBeUnique(s);
|
|
196
|
+
const e = t.value.stem || "", p = m(e);
|
|
197
|
+
if (p.length === 0)
|
|
198
|
+
return o.messages.errors.blankStemRequiresPlaceholders;
|
|
199
|
+
const y = de(p);
|
|
200
|
+
if (y.length > 0)
|
|
201
|
+
return o.messages.errors.duplicatePlaceholders(y);
|
|
202
|
+
const oe = new Set(a), Q = new Set(p), re = [...Q].filter((ae) => !oe.has(ae));
|
|
203
|
+
if (re.length > 0)
|
|
204
|
+
return o.messages.errors.undefinedPlaceholders(re);
|
|
205
|
+
const Me = [...oe].filter((ae) => !Q.has(ae));
|
|
206
|
+
return Me.length > 0 ? o.messages.errors.missingPlaceholders(Me) : null;
|
|
207
|
+
}
|
|
208
|
+
function ge() {
|
|
209
|
+
return d.value !== "quiz" || t.value.quizType !== "blank" ? null : S();
|
|
210
|
+
}
|
|
211
|
+
U(() => o.initialType, (a) => {
|
|
212
|
+
const s = g(a);
|
|
213
|
+
d.value = s, t.value = ie(s, o.messages, f.value), L(), k.value = "";
|
|
214
|
+
}), U(w, () => {
|
|
215
|
+
const a = g(d.value);
|
|
216
|
+
a !== d.value && (d.value = a, t.value = ie(a, o.messages, f.value), L(), k.value = "");
|
|
217
|
+
}), U(() => o.visible, (a) => {
|
|
218
|
+
a && (t.value = ie(d.value, o.messages, f.value), L(), k.value = "");
|
|
219
|
+
});
|
|
220
|
+
function Ve(a) {
|
|
221
|
+
const s = g(a);
|
|
222
|
+
d.value = s, t.value = ie(s, o.messages, f.value), L(), k.value = "";
|
|
223
|
+
}
|
|
224
|
+
const Be = x(() => Ie(d.value, t.value, o.messages));
|
|
225
|
+
function Ae(a) {
|
|
226
|
+
return w.value.find((s) => s.type === a) || { type: a, label: a, icon: "?", svgIcon: "", desc: "", color: "#666" };
|
|
227
|
+
}
|
|
228
|
+
const fe = x(() => Ae(d.value)), he = x(() => o.refSuggestions ? o.refSuggestions : []), qe = x(() => d.value === "ref_step" ? o.messages.dialog.referencedStepId : d.value === "ref_var" ? o.messages.dialog.referencedVariableId : o.messages.dialog.referencedFigureId), Se = x(() => d.value === "ref_step" ? "step_id" : d.value === "ref_var" ? "var_id" : "fig_id");
|
|
229
|
+
U(() => [d.value, t.value.quizType], ([a, s], [e, p]) => {
|
|
230
|
+
a === "quiz" && (a !== e || s !== p) && (s !== p && p && (t.value.id = Y(s, f.value), s === "choice" ? (t.value.stem = o.messages.defaults.questionStem, t.value.mode = "single", t.value.options = "A:, B:", t.value.answer = "A", t.value.blanks = "", t.value.rubric = "") : s === "blank" ? (t.value.stem = o.messages.defaults.fillQuestionStem, t.value.blanks = "b1:", t.value.options = "", t.value.answer = "", t.value.mode = "", t.value.rubric = "", V.value = [{ key: "b1", answer: "" }]) : s === "open" && (t.value.stem = o.messages.defaults.fillQuestionStem, t.value.rubric = "", t.value.options = "", t.value.answer = "", t.value.blanks = "", t.value.mode = "")), L());
|
|
231
|
+
}), U(() => t.value.mode, () => {
|
|
232
|
+
K();
|
|
233
|
+
}), U(T, (a) => {
|
|
234
|
+
d.value === "quiz" && t.value.quizType === "choice" && (t.value.options = ee(a), K());
|
|
235
|
+
}, { deep: !0 }), U(V, (a) => {
|
|
236
|
+
d.value === "quiz" && t.value.quizType === "blank" && (t.value.blanks = B(a));
|
|
237
|
+
}, { deep: !0 }), U(h, (a) => {
|
|
238
|
+
d.value === "quiz" && t.value.quizType === "choice" && t.value.mode === "multiple" && (t.value.answer = a.join(", "));
|
|
239
|
+
}, { deep: !0 }), U(t, () => {
|
|
240
|
+
k.value && (k.value = "");
|
|
241
|
+
}, { deep: !0 }), U(V, () => {
|
|
242
|
+
k.value && (k.value = "");
|
|
243
|
+
}, { deep: !0 });
|
|
244
|
+
function Ue() {
|
|
245
|
+
const a = ge();
|
|
246
|
+
if (a) {
|
|
247
|
+
k.value = a;
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
k.value = "", M("insert", Ie(d.value, t.value, o.messages)), M("update:visible", !1);
|
|
251
|
+
}
|
|
252
|
+
function ye() {
|
|
253
|
+
M("update:visible", !1);
|
|
254
|
+
}
|
|
255
|
+
return (a, s) => (r(), xe(Ee, { to: "body" }, [
|
|
256
|
+
u.visible ? (r(), v("div", {
|
|
257
|
+
key: 0,
|
|
258
|
+
class: "aimd-dialog-overlay",
|
|
259
|
+
onClick: ue(ye, ["self"])
|
|
260
|
+
}, [
|
|
261
|
+
l("div", Xe, [
|
|
262
|
+
l("div", Ye, [
|
|
263
|
+
l("span", Ze, [
|
|
264
|
+
l("span", {
|
|
265
|
+
class: "aimd-dialog-icon",
|
|
266
|
+
style: me({ color: fe.value.color }),
|
|
267
|
+
innerHTML: fe.value.svgIcon
|
|
268
|
+
}, null, 12, el),
|
|
269
|
+
N(" " + i(o.messages.dialog.title(fe.value.label)), 1)
|
|
270
|
+
]),
|
|
271
|
+
l("button", {
|
|
272
|
+
class: "aimd-dialog-close",
|
|
273
|
+
onClick: ye
|
|
274
|
+
}, "×")
|
|
275
|
+
]),
|
|
276
|
+
l("div", ll, [
|
|
277
|
+
(r(!0), v(A, null, j(w.value, (e) => (r(), v("button", {
|
|
278
|
+
key: e.type,
|
|
279
|
+
class: W(["aimd-type-tab", { active: d.value === e.type }]),
|
|
280
|
+
style: me(d.value === e.type ? { borderColor: e.color, color: e.color, background: `${e.color}14` } : {}),
|
|
281
|
+
onClick: (p) => Ve(e.type)
|
|
282
|
+
}, [
|
|
283
|
+
l("span", {
|
|
284
|
+
innerHTML: e.svgIcon,
|
|
285
|
+
class: "aimd-type-tab-icon"
|
|
286
|
+
}, null, 8, tl),
|
|
287
|
+
N(" " + i(e.label), 1)
|
|
288
|
+
], 14, sl))), 128))
|
|
289
|
+
]),
|
|
290
|
+
l("div", ol, [
|
|
291
|
+
d.value === "var" ? (r(), v(A, { key: 0 }, [
|
|
292
|
+
l("label", al, [
|
|
293
|
+
l("span", il, [
|
|
294
|
+
N(i(o.messages.dialog.variableId) + " ", 1),
|
|
295
|
+
s[19] || (s[19] = l("em", null, "*", -1))
|
|
296
|
+
]),
|
|
297
|
+
b(l("input", {
|
|
298
|
+
"onUpdate:modelValue": s[0] || (s[0] = (e) => t.value.name = e),
|
|
299
|
+
placeholder: o.messages.placeholders.variableId,
|
|
300
|
+
class: "aimd-field-input"
|
|
301
|
+
}, null, 8, nl), [
|
|
302
|
+
[I, t.value.name]
|
|
303
|
+
])
|
|
304
|
+
]),
|
|
305
|
+
l("div", dl, [
|
|
306
|
+
l("span", rl, i(o.messages.dialog.typePresetLabel), 1),
|
|
307
|
+
l("span", ul, i(o.messages.dialog.typeHint), 1),
|
|
308
|
+
l("div", cl, [
|
|
309
|
+
(r(!0), v(A, null, j(G.value, (e) => (r(), v("button", {
|
|
310
|
+
key: e.key,
|
|
311
|
+
type: "button",
|
|
312
|
+
class: W(["aimd-var-type-card", { active: J(e.value) }]),
|
|
313
|
+
onClick: (p) => X(e.value)
|
|
314
|
+
}, [
|
|
315
|
+
l("span", vl, i(e.label), 1),
|
|
316
|
+
l("span", pl, i(e.desc), 1)
|
|
317
|
+
], 10, ml))), 128))
|
|
318
|
+
])
|
|
319
|
+
]),
|
|
320
|
+
l("label", gl, [
|
|
321
|
+
l("span", fl, i(o.messages.dialog.customType), 1),
|
|
322
|
+
b(l("input", {
|
|
323
|
+
"onUpdate:modelValue": s[1] || (s[1] = (e) => t.value.type = e),
|
|
324
|
+
placeholder: o.messages.placeholders.type,
|
|
325
|
+
class: "aimd-field-input"
|
|
326
|
+
}, null, 8, hl), [
|
|
327
|
+
[I, t.value.type]
|
|
328
|
+
]),
|
|
329
|
+
l("span", yl, i(o.messages.dialog.customTypeHint), 1)
|
|
330
|
+
]),
|
|
331
|
+
l("label", bl, [
|
|
332
|
+
l("span", wl, i(o.messages.dialog.defaultValue), 1),
|
|
333
|
+
b(l("input", {
|
|
334
|
+
"onUpdate:modelValue": s[2] || (s[2] = (e) => t.value.default = e),
|
|
335
|
+
placeholder: o.messages.placeholders.defaultValue,
|
|
336
|
+
class: "aimd-field-input"
|
|
337
|
+
}, null, 8, kl), [
|
|
338
|
+
[I, t.value.default]
|
|
339
|
+
])
|
|
340
|
+
]),
|
|
341
|
+
l("label", _l, [
|
|
342
|
+
l("span", Ml, i(o.messages.dialog.titleLabel), 1),
|
|
343
|
+
b(l("input", {
|
|
344
|
+
"onUpdate:modelValue": s[3] || (s[3] = (e) => t.value.title = e),
|
|
345
|
+
placeholder: o.messages.placeholders.title,
|
|
346
|
+
class: "aimd-field-input"
|
|
347
|
+
}, null, 8, Tl), [
|
|
348
|
+
[I, t.value.title]
|
|
349
|
+
])
|
|
350
|
+
])
|
|
351
|
+
], 64)) : C("", !0),
|
|
352
|
+
d.value === "var_table" ? (r(), v(A, { key: 1 }, [
|
|
353
|
+
l("label", Cl, [
|
|
354
|
+
l("span", zl, [
|
|
355
|
+
N(i(o.messages.dialog.tableId) + " ", 1),
|
|
356
|
+
s[20] || (s[20] = l("em", null, "*", -1))
|
|
357
|
+
]),
|
|
358
|
+
b(l("input", {
|
|
359
|
+
"onUpdate:modelValue": s[4] || (s[4] = (e) => t.value.name = e),
|
|
360
|
+
placeholder: o.messages.placeholders.tableId,
|
|
361
|
+
class: "aimd-field-input"
|
|
362
|
+
}, null, 8, Il), [
|
|
363
|
+
[I, t.value.name]
|
|
364
|
+
])
|
|
365
|
+
]),
|
|
366
|
+
l("label", xl, [
|
|
367
|
+
l("span", $l, i(o.messages.dialog.subVariableColumns), 1),
|
|
368
|
+
b(l("input", {
|
|
369
|
+
"onUpdate:modelValue": s[5] || (s[5] = (e) => t.value.subvars = e),
|
|
370
|
+
placeholder: o.messages.placeholders.subVariableColumns,
|
|
371
|
+
class: "aimd-field-input"
|
|
372
|
+
}, null, 8, Vl), [
|
|
373
|
+
[I, t.value.subvars]
|
|
374
|
+
]),
|
|
375
|
+
l("span", Bl, i(o.messages.dialog.subVariableColumnsHint), 1)
|
|
376
|
+
])
|
|
377
|
+
], 64)) : C("", !0),
|
|
378
|
+
d.value === "step" ? (r(), v(A, { key: 2 }, [
|
|
379
|
+
l("label", Al, [
|
|
380
|
+
l("span", ql, [
|
|
381
|
+
N(i(o.messages.dialog.stepId) + " ", 1),
|
|
382
|
+
s[21] || (s[21] = l("em", null, "*", -1))
|
|
383
|
+
]),
|
|
384
|
+
b(l("input", {
|
|
385
|
+
"onUpdate:modelValue": s[6] || (s[6] = (e) => t.value.name = e),
|
|
386
|
+
placeholder: o.messages.placeholders.stepId,
|
|
387
|
+
class: "aimd-field-input"
|
|
388
|
+
}, null, 8, Sl), [
|
|
389
|
+
[I, t.value.name]
|
|
390
|
+
])
|
|
391
|
+
]),
|
|
392
|
+
l("label", Ul, [
|
|
393
|
+
l("span", El, i(o.messages.dialog.level), 1),
|
|
394
|
+
b(l("select", {
|
|
395
|
+
"onUpdate:modelValue": s[7] || (s[7] = (e) => t.value.level = e),
|
|
396
|
+
class: "aimd-field-input"
|
|
397
|
+
}, [
|
|
398
|
+
l("option", Ll, i(o.messages.dialog.level1), 1),
|
|
399
|
+
l("option", Hl, i(o.messages.dialog.level2), 1),
|
|
400
|
+
l("option", Dl, i(o.messages.dialog.level3), 1)
|
|
401
|
+
], 512), [
|
|
402
|
+
[be, t.value.level]
|
|
403
|
+
])
|
|
404
|
+
])
|
|
405
|
+
], 64)) : C("", !0),
|
|
406
|
+
d.value === "quiz" ? (r(), v(A, { key: 3 }, [
|
|
407
|
+
l("label", Pl, [
|
|
408
|
+
l("span", Rl, [
|
|
409
|
+
N(i(o.messages.dialog.quizId) + " ", 1),
|
|
410
|
+
s[22] || (s[22] = l("em", null, "*", -1))
|
|
411
|
+
]),
|
|
412
|
+
b(l("input", {
|
|
413
|
+
"onUpdate:modelValue": s[8] || (s[8] = (e) => t.value.id = e),
|
|
414
|
+
placeholder: o.messages.placeholders.quizId,
|
|
415
|
+
class: "aimd-field-input"
|
|
416
|
+
}, null, 8, Nl), [
|
|
417
|
+
[I, t.value.id]
|
|
418
|
+
])
|
|
419
|
+
]),
|
|
420
|
+
l("label", Fl, [
|
|
421
|
+
l("span", Ol, i(o.messages.dialog.questionType), 1),
|
|
422
|
+
b(l("select", {
|
|
423
|
+
"onUpdate:modelValue": s[9] || (s[9] = (e) => t.value.quizType = e),
|
|
424
|
+
class: "aimd-field-input"
|
|
425
|
+
}, [
|
|
426
|
+
l("option", Kl, i(o.messages.quiz.types.choice), 1),
|
|
427
|
+
l("option", Ql, i(o.messages.quiz.types.blank), 1),
|
|
428
|
+
l("option", jl, i(o.messages.quiz.types.open), 1)
|
|
429
|
+
], 512), [
|
|
430
|
+
[be, t.value.quizType]
|
|
431
|
+
])
|
|
432
|
+
]),
|
|
433
|
+
l("label", Wl, [
|
|
434
|
+
l("span", Gl, i(o.messages.dialog.score), 1),
|
|
435
|
+
b(l("input", {
|
|
436
|
+
"onUpdate:modelValue": s[10] || (s[10] = (e) => t.value.score = e),
|
|
437
|
+
placeholder: o.messages.placeholders.score,
|
|
438
|
+
class: "aimd-field-input"
|
|
439
|
+
}, null, 8, Jl), [
|
|
440
|
+
[I, t.value.score]
|
|
441
|
+
])
|
|
442
|
+
]),
|
|
443
|
+
l("label", Xl, [
|
|
444
|
+
l("span", Yl, [
|
|
445
|
+
N(i(o.messages.dialog.stem) + " ", 1),
|
|
446
|
+
s[23] || (s[23] = l("em", null, "*", -1))
|
|
447
|
+
]),
|
|
448
|
+
b(l("textarea", {
|
|
449
|
+
"onUpdate:modelValue": s[11] || (s[11] = (e) => t.value.stem = e),
|
|
450
|
+
placeholder: o.messages.placeholders.stem,
|
|
451
|
+
class: "aimd-field-input aimd-field-textarea"
|
|
452
|
+
}, null, 8, Zl), [
|
|
453
|
+
[I, t.value.stem]
|
|
454
|
+
]),
|
|
455
|
+
t.value.quizType === "blank" ? (r(), v("span", es, i(o.messages.dialog.blankStemHint), 1)) : C("", !0)
|
|
456
|
+
]),
|
|
457
|
+
t.value.quizType === "choice" ? (r(), v(A, { key: 0 }, [
|
|
458
|
+
l("label", ls, [
|
|
459
|
+
l("span", ss, i(o.messages.dialog.mode), 1),
|
|
460
|
+
b(l("select", {
|
|
461
|
+
"onUpdate:modelValue": s[12] || (s[12] = (e) => t.value.mode = e),
|
|
462
|
+
class: "aimd-field-input"
|
|
463
|
+
}, [
|
|
464
|
+
l("option", ts, i(o.messages.quiz.modes.single), 1),
|
|
465
|
+
l("option", os, i(o.messages.quiz.modes.multiple), 1)
|
|
466
|
+
], 512), [
|
|
467
|
+
[be, t.value.mode]
|
|
468
|
+
])
|
|
469
|
+
]),
|
|
470
|
+
l("div", as, [
|
|
471
|
+
l("span", is, i(o.messages.dialog.options), 1),
|
|
472
|
+
l("div", ns, [
|
|
473
|
+
(r(!0), v(A, null, j(T.value, (e, p) => (r(), v("div", {
|
|
474
|
+
key: `choice-option-${p}`,
|
|
475
|
+
class: W(["aimd-collection-row aimd-option-row", { "aimd-option-row-dragover": E.value === p && _.value !== null && _.value !== p }]),
|
|
476
|
+
onDragover: ue((y) => P(p), ["prevent"]),
|
|
477
|
+
onDrop: ue((y) => H(p), ["prevent"])
|
|
478
|
+
}, [
|
|
479
|
+
l("span", {
|
|
480
|
+
class: "aimd-drag-handle",
|
|
481
|
+
title: o.messages.dialog.dragToReorder,
|
|
482
|
+
draggable: "true",
|
|
483
|
+
onDragstart: (y) => z(p),
|
|
484
|
+
onDragend: R
|
|
485
|
+
}, " ⋮⋮ ", 40, rs),
|
|
486
|
+
b(l("input", {
|
|
487
|
+
"onUpdate:modelValue": (y) => e.key = y,
|
|
488
|
+
placeholder: o.messages.placeholders.optionKey,
|
|
489
|
+
class: "aimd-field-input"
|
|
490
|
+
}, null, 8, us), [
|
|
491
|
+
[I, e.key]
|
|
492
|
+
]),
|
|
493
|
+
b(l("input", {
|
|
494
|
+
"onUpdate:modelValue": (y) => e.text = y,
|
|
495
|
+
placeholder: o.messages.placeholders.optionText,
|
|
496
|
+
class: "aimd-field-input"
|
|
497
|
+
}, null, 8, cs), [
|
|
498
|
+
[I, e.text]
|
|
499
|
+
]),
|
|
500
|
+
l("label", ms, [
|
|
501
|
+
t.value.mode === "single" ? b((r(), v("input", {
|
|
502
|
+
key: 0,
|
|
503
|
+
"onUpdate:modelValue": s[13] || (s[13] = (y) => t.value.answer = y),
|
|
504
|
+
type: "radio",
|
|
505
|
+
name: "aimd-quiz-choice-answer",
|
|
506
|
+
value: e.key.trim(),
|
|
507
|
+
disabled: !e.key.trim()
|
|
508
|
+
}, null, 8, vs)), [
|
|
509
|
+
[Le, t.value.answer]
|
|
510
|
+
]) : b((r(), v("input", {
|
|
511
|
+
key: 1,
|
|
512
|
+
"onUpdate:modelValue": s[14] || (s[14] = (y) => h.value = y),
|
|
513
|
+
type: "checkbox",
|
|
514
|
+
value: e.key.trim(),
|
|
515
|
+
disabled: !e.key.trim()
|
|
516
|
+
}, null, 8, ps)), [
|
|
517
|
+
[He, h.value]
|
|
518
|
+
]),
|
|
519
|
+
l("span", null, i(o.messages.dialog.correctAnswer), 1)
|
|
520
|
+
]),
|
|
521
|
+
l("button", {
|
|
522
|
+
type: "button",
|
|
523
|
+
class: "aimd-mini-btn",
|
|
524
|
+
disabled: T.value.length <= 1,
|
|
525
|
+
onClick: (y) => c(p)
|
|
526
|
+
}, i(o.messages.common.remove), 9, gs)
|
|
527
|
+
], 42, ds))), 128)),
|
|
528
|
+
l("button", {
|
|
529
|
+
type: "button",
|
|
530
|
+
class: "aimd-mini-btn aimd-mini-btn-add",
|
|
531
|
+
onClick: n
|
|
532
|
+
}, i(o.messages.actions.addOption), 1)
|
|
533
|
+
]),
|
|
534
|
+
l("span", fs, i(o.messages.dialog.optionsHint), 1)
|
|
535
|
+
])
|
|
536
|
+
], 64)) : t.value.quizType === "blank" ? (r(), v("div", hs, [
|
|
537
|
+
l("span", ys, i(o.messages.dialog.blanks), 1),
|
|
538
|
+
l("div", bs, [
|
|
539
|
+
(r(!0), v(A, null, j(V.value, (e, p) => (r(), v("div", {
|
|
540
|
+
key: `blank-item-${p}`,
|
|
541
|
+
class: "aimd-collection-row"
|
|
542
|
+
}, [
|
|
543
|
+
b(l("input", {
|
|
544
|
+
"onUpdate:modelValue": (y) => e.key = y,
|
|
545
|
+
placeholder: o.messages.placeholders.blankKey,
|
|
546
|
+
class: "aimd-field-input"
|
|
547
|
+
}, null, 8, ws), [
|
|
548
|
+
[I, e.key]
|
|
549
|
+
]),
|
|
550
|
+
b(l("input", {
|
|
551
|
+
"onUpdate:modelValue": (y) => e.answer = y,
|
|
552
|
+
placeholder: o.messages.placeholders.blankAnswer,
|
|
553
|
+
class: "aimd-field-input"
|
|
554
|
+
}, null, 8, ks), [
|
|
555
|
+
[I, e.answer]
|
|
556
|
+
]),
|
|
557
|
+
l("button", {
|
|
558
|
+
type: "button",
|
|
559
|
+
class: "aimd-mini-btn",
|
|
560
|
+
disabled: V.value.length <= 1,
|
|
561
|
+
onClick: (y) => pe(p)
|
|
562
|
+
}, i(o.messages.common.remove), 9, _s)
|
|
563
|
+
]))), 128)),
|
|
564
|
+
l("button", {
|
|
565
|
+
type: "button",
|
|
566
|
+
class: "aimd-mini-btn aimd-mini-btn-add",
|
|
567
|
+
onClick: te
|
|
568
|
+
}, i(o.messages.actions.addBlank), 1)
|
|
569
|
+
]),
|
|
570
|
+
l("span", Ms, i(o.messages.dialog.blanksHint), 1)
|
|
571
|
+
])) : (r(), v("label", Ts, [
|
|
572
|
+
l("span", Cs, i(o.messages.dialog.rubric), 1),
|
|
573
|
+
b(l("textarea", {
|
|
574
|
+
"onUpdate:modelValue": s[15] || (s[15] = (e) => t.value.rubric = e),
|
|
575
|
+
placeholder: o.messages.placeholders.rubric,
|
|
576
|
+
class: "aimd-field-input aimd-field-textarea"
|
|
577
|
+
}, null, 8, zs), [
|
|
578
|
+
[I, t.value.rubric]
|
|
579
|
+
])
|
|
580
|
+
]))
|
|
581
|
+
], 64)) : C("", !0),
|
|
582
|
+
d.value === "check" ? (r(), v("label", Is, [
|
|
583
|
+
l("span", xs, [
|
|
584
|
+
N(i(o.messages.dialog.checkpointId) + " ", 1),
|
|
585
|
+
s[24] || (s[24] = l("em", null, "*", -1))
|
|
586
|
+
]),
|
|
587
|
+
b(l("input", {
|
|
588
|
+
"onUpdate:modelValue": s[16] || (s[16] = (e) => t.value.name = e),
|
|
589
|
+
placeholder: o.messages.placeholders.checkpointId,
|
|
590
|
+
class: "aimd-field-input"
|
|
591
|
+
}, null, 8, $s), [
|
|
592
|
+
[I, t.value.name]
|
|
593
|
+
])
|
|
594
|
+
])) : C("", !0),
|
|
595
|
+
["ref_step", "ref_var", "ref_fig"].includes(d.value) ? (r(), v("label", Vs, [
|
|
596
|
+
l("span", Bs, [
|
|
597
|
+
N(i(qe.value) + " ", 1),
|
|
598
|
+
s[25] || (s[25] = l("em", null, "*", -1))
|
|
599
|
+
]),
|
|
600
|
+
b(l("input", {
|
|
601
|
+
"onUpdate:modelValue": s[17] || (s[17] = (e) => t.value.name = e),
|
|
602
|
+
placeholder: Se.value,
|
|
603
|
+
class: "aimd-field-input",
|
|
604
|
+
list: "aimd-ref-suggestions"
|
|
605
|
+
}, null, 8, As), [
|
|
606
|
+
[I, t.value.name]
|
|
607
|
+
]),
|
|
608
|
+
l("datalist", qs, [
|
|
609
|
+
(r(!0), v(A, null, j(he.value, (e) => (r(), v("option", {
|
|
610
|
+
key: e,
|
|
611
|
+
value: e
|
|
612
|
+
}, null, 8, Ss))), 128))
|
|
613
|
+
]),
|
|
614
|
+
he.value.length ? (r(), v("span", Us, i(o.messages.common.available) + ": " + i(he.value.join(", ")), 1)) : C("", !0)
|
|
615
|
+
])) : C("", !0),
|
|
616
|
+
d.value === "cite" ? (r(), v("label", Es, [
|
|
617
|
+
l("span", Ls, [
|
|
618
|
+
N(i(o.messages.dialog.citationId) + " ", 1),
|
|
619
|
+
s[26] || (s[26] = l("em", null, "*", -1))
|
|
620
|
+
]),
|
|
621
|
+
b(l("input", {
|
|
622
|
+
"onUpdate:modelValue": s[18] || (s[18] = (e) => t.value.refs = e),
|
|
623
|
+
placeholder: o.messages.placeholders.citationIds,
|
|
624
|
+
class: "aimd-field-input"
|
|
625
|
+
}, null, 8, Hs), [
|
|
626
|
+
[I, t.value.refs]
|
|
627
|
+
]),
|
|
628
|
+
l("span", Ds, i(o.messages.dialog.citationHint), 1)
|
|
629
|
+
])) : C("", !0),
|
|
630
|
+
l("div", Ps, [
|
|
631
|
+
l("div", Rs, i(o.messages.common.preview), 1),
|
|
632
|
+
l("pre", Ns, [
|
|
633
|
+
l("code", Fs, i(Be.value), 1)
|
|
634
|
+
])
|
|
635
|
+
]),
|
|
636
|
+
k.value ? (r(), v("div", Os, i(k.value), 1)) : C("", !0)
|
|
637
|
+
]),
|
|
638
|
+
l("div", Ks, [
|
|
639
|
+
l("button", {
|
|
640
|
+
class: "aimd-btn aimd-btn-cancel",
|
|
641
|
+
onClick: ye
|
|
642
|
+
}, i(o.messages.common.cancel), 1),
|
|
643
|
+
l("button", {
|
|
644
|
+
class: "aimd-btn aimd-btn-primary",
|
|
645
|
+
onClick: Ue
|
|
646
|
+
}, i(o.messages.common.insert), 1)
|
|
647
|
+
])
|
|
648
|
+
])
|
|
649
|
+
])) : C("", !0)
|
|
650
|
+
]));
|
|
651
|
+
}
|
|
652
|
+
}), js = { class: "aimd-editor-toolbar" }, Ws = {
|
|
653
|
+
key: 0,
|
|
654
|
+
class: "aimd-editor-mode-switch"
|
|
655
|
+
}, Gs = ["title"], Js = ["title"], Xs = {
|
|
656
|
+
key: 1,
|
|
657
|
+
class: "aimd-editor-toolbar-sep"
|
|
658
|
+
}, Ys = {
|
|
659
|
+
key: 0,
|
|
660
|
+
class: "aimd-editor-toolbar-sep"
|
|
661
|
+
}, Zs = ["title", "onClick", "innerHTML"], et = {
|
|
662
|
+
key: 3,
|
|
663
|
+
class: "aimd-editor-toolbar-divider"
|
|
664
|
+
}, lt = ["title", "onClick", "onMouseup"], st = ["innerHTML"], tt = { class: "aimd-editor-aimd-btn-label" }, ot = /* @__PURE__ */ ve({
|
|
665
|
+
__name: "AimdEditorToolbar",
|
|
666
|
+
props: {
|
|
667
|
+
showTopBar: { type: Boolean },
|
|
668
|
+
showMdToolbar: { type: Boolean },
|
|
669
|
+
showAimdToolbar: { type: Boolean },
|
|
670
|
+
editorMode: {},
|
|
671
|
+
resolvedMessages: {},
|
|
672
|
+
localizedFieldTypes: {},
|
|
673
|
+
localizedMdToolbarItems: {}
|
|
674
|
+
},
|
|
675
|
+
emits: ["switch-mode", "md-action", "open-aimd-dialog", "quick-insert-aimd"],
|
|
676
|
+
setup(u, { emit: F }) {
|
|
677
|
+
const o = F;
|
|
678
|
+
return (M, w) => (r(), v("div", js, [
|
|
679
|
+
u.showTopBar ? (r(), v("div", Ws, [
|
|
680
|
+
l("button", {
|
|
681
|
+
type: "button",
|
|
682
|
+
class: W(["aimd-editor-mode-btn", { active: u.editorMode === "source" }]),
|
|
683
|
+
onClick: w[0] || (w[0] = (g) => o("switch-mode", "source")),
|
|
684
|
+
title: u.resolvedMessages.mode.sourceTitle
|
|
685
|
+
}, [
|
|
686
|
+
w[2] || (w[2] = l("span", {
|
|
687
|
+
class: "aimd-editor-mode-icon",
|
|
688
|
+
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>'
|
|
689
|
+
}, null, -1)),
|
|
690
|
+
l("span", null, i(u.resolvedMessages.mode.source), 1)
|
|
691
|
+
], 10, Gs),
|
|
692
|
+
l("button", {
|
|
693
|
+
type: "button",
|
|
694
|
+
class: W(["aimd-editor-mode-btn", { active: u.editorMode === "wysiwyg" }]),
|
|
695
|
+
onClick: w[1] || (w[1] = (g) => o("switch-mode", "wysiwyg")),
|
|
696
|
+
title: u.resolvedMessages.mode.wysiwygTitle
|
|
697
|
+
}, [
|
|
698
|
+
w[3] || (w[3] = l("span", {
|
|
699
|
+
class: "aimd-editor-mode-icon",
|
|
700
|
+
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>'
|
|
701
|
+
}, null, -1)),
|
|
702
|
+
l("span", null, i(u.resolvedMessages.mode.wysiwyg), 1)
|
|
703
|
+
], 10, Js)
|
|
704
|
+
])) : C("", !0),
|
|
705
|
+
u.showTopBar && u.showMdToolbar ? (r(), v("div", Xs)) : C("", !0),
|
|
706
|
+
u.showMdToolbar ? (r(!0), v(A, { key: 2 }, j(u.localizedMdToolbarItems, (g) => (r(), v(A, {
|
|
707
|
+
key: g.action
|
|
708
|
+
}, [
|
|
709
|
+
g.action.startsWith("sep") ? (r(), v("div", Ys)) : (r(), v("button", {
|
|
710
|
+
key: 1,
|
|
711
|
+
type: "button",
|
|
712
|
+
class: "aimd-editor-fmt-btn",
|
|
713
|
+
title: g.title,
|
|
714
|
+
onClick: (f) => o("md-action", g.action),
|
|
715
|
+
innerHTML: g.svgIcon
|
|
716
|
+
}, null, 8, Zs))
|
|
717
|
+
], 64))), 128)) : C("", !0),
|
|
718
|
+
u.showMdToolbar && u.showAimdToolbar ? (r(), v("div", et)) : C("", !0),
|
|
719
|
+
u.showAimdToolbar ? (r(!0), v(A, { key: 4 }, j(u.localizedFieldTypes, (g) => (r(), v("button", {
|
|
720
|
+
key: g.type,
|
|
721
|
+
type: "button",
|
|
722
|
+
class: "aimd-editor-fmt-btn aimd-editor-aimd-btn",
|
|
723
|
+
title: g.desc,
|
|
724
|
+
style: me({ "--aimd-color": g.color }),
|
|
725
|
+
onClick: (f) => o("open-aimd-dialog", g.type),
|
|
726
|
+
onMouseup: ue((f) => o("quick-insert-aimd", g.type), ["middle", "prevent"])
|
|
727
|
+
}, [
|
|
728
|
+
l("span", {
|
|
729
|
+
class: "aimd-editor-aimd-btn-icon",
|
|
730
|
+
innerHTML: g.svgIcon
|
|
731
|
+
}, null, 8, st),
|
|
732
|
+
l("span", tt, i(g.label), 1)
|
|
733
|
+
], 44, lt))), 128)) : C("", !0)
|
|
734
|
+
]));
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
function at(u) {
|
|
738
|
+
const { initialContent: F, initialMode: o, resolvedMessages: M, emitModelValue: w, emitMode: g } = u, f = $(o), d = $(F), t = we(null), T = we(null), V = $(!0), h = we(null);
|
|
739
|
+
let _ = !1;
|
|
740
|
+
function E(n) {
|
|
741
|
+
n !== d.value && (d.value = n, w(n));
|
|
742
|
+
}
|
|
743
|
+
function k(n) {
|
|
744
|
+
return je(n).content;
|
|
745
|
+
}
|
|
746
|
+
function G(n) {
|
|
747
|
+
return /class="ProseMirror milkdown-editor-content editor"/.test(n) || /<div class="milkdown">/.test(n) || /<\/?[a-z][^>]*>/i.test(n) && /AIMDINLINETEMPLATE[0-9a-f]+TOKEN/.test(n);
|
|
748
|
+
}
|
|
749
|
+
function D(n, c) {
|
|
750
|
+
const z = Re(We(n));
|
|
751
|
+
return G(z) ? c : z;
|
|
752
|
+
}
|
|
753
|
+
function J(n) {
|
|
754
|
+
return /\{\{(?:var_table|var|quiz|step|check|ref_step|ref_var|ref_fig|cite|fig)\|/.test(n) || /```(?:quiz|fig|assigner)\b/.test(n);
|
|
755
|
+
}
|
|
756
|
+
function X() {
|
|
757
|
+
if (h.value)
|
|
758
|
+
try {
|
|
759
|
+
const n = h.value.action(ze());
|
|
760
|
+
if (typeof n != "string")
|
|
761
|
+
return;
|
|
762
|
+
const c = D(n, d.value);
|
|
763
|
+
h.value.action(ce(k(c)));
|
|
764
|
+
} catch {
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
const Y = x(() => {
|
|
768
|
+
try {
|
|
769
|
+
return Ge(d.value);
|
|
770
|
+
} catch {
|
|
771
|
+
return null;
|
|
772
|
+
}
|
|
773
|
+
});
|
|
774
|
+
async function Z(n) {
|
|
775
|
+
if (n !== f.value) {
|
|
776
|
+
if (f.value === "source" && t.value && (d.value = t.value.getValue()), f.value === "wysiwyg" && h.value)
|
|
777
|
+
try {
|
|
778
|
+
const c = h.value.action(ze());
|
|
779
|
+
typeof c == "string" && (d.value = D(c, d.value));
|
|
780
|
+
} catch {
|
|
781
|
+
}
|
|
782
|
+
if (f.value = n, g(n), n === "source")
|
|
783
|
+
await Te(), t.value && (_ = !0, t.value.setValue(d.value), _ = !1);
|
|
784
|
+
else if (n === "wysiwyg" && (await Te(), h.value))
|
|
785
|
+
try {
|
|
786
|
+
_ = !0, h.value.action(ce(k(d.value))), _ = !1;
|
|
787
|
+
} catch {
|
|
788
|
+
_ = !1;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
function ee(n) {
|
|
793
|
+
if (n !== d.value) {
|
|
794
|
+
if (_ = !0, d.value = n, f.value === "source" && t.value)
|
|
795
|
+
t.value.setValue(n);
|
|
796
|
+
else if (f.value === "wysiwyg" && h.value)
|
|
797
|
+
try {
|
|
798
|
+
h.value.action(ce(k(n)));
|
|
799
|
+
} catch {
|
|
800
|
+
}
|
|
801
|
+
_ = !1;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
function le(n) {
|
|
805
|
+
if (f.value === "source" && t.value) {
|
|
806
|
+
const c = t.value.getSelection(), z = t.value.getModel(), P = t.value.getPosition(), te = z.getLineContent(P.lineNumber).substring(0, P.column - 1).trim() !== "" && !n.startsWith(`
|
|
807
|
+
`) ? `
|
|
808
|
+
` + n : n;
|
|
809
|
+
t.value.executeEdits("toolbar", [{
|
|
810
|
+
range: c,
|
|
811
|
+
text: te,
|
|
812
|
+
forceMoveMarkers: !0
|
|
813
|
+
}]), t.value.focus();
|
|
814
|
+
} else if (f.value === "wysiwyg" && h.value)
|
|
815
|
+
try {
|
|
816
|
+
h.value.action(_e(n)), J(n) && X();
|
|
817
|
+
} catch {
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
function B(n, c = "", z = "") {
|
|
821
|
+
if (f.value === "source" && t.value) {
|
|
822
|
+
const P = t.value.getSelection(), H = t.value.getModel().getValueInRange(P) || z, R = n + H + c;
|
|
823
|
+
t.value.executeEdits("toolbar", [{
|
|
824
|
+
range: P,
|
|
825
|
+
text: R,
|
|
826
|
+
forceMoveMarkers: !0
|
|
827
|
+
}]), t.value.focus();
|
|
828
|
+
} else if (f.value === "wysiwyg" && h.value)
|
|
829
|
+
try {
|
|
830
|
+
h.value.action(_e(n + z + c));
|
|
831
|
+
} catch {
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
function q(n, c = "") {
|
|
835
|
+
if (f.value === "source" && t.value) {
|
|
836
|
+
const z = t.value.getPosition(), H = t.value.getModel().getLineContent(z.lineNumber);
|
|
837
|
+
if (H.trim() === "") {
|
|
838
|
+
const R = { startLineNumber: z.lineNumber, startColumn: 1, endLineNumber: z.lineNumber, endColumn: H.length + 1 };
|
|
839
|
+
t.value.executeEdits("toolbar", [{ range: R, text: n + c, forceMoveMarkers: !0 }]);
|
|
840
|
+
} else {
|
|
841
|
+
const R = { startLineNumber: z.lineNumber, startColumn: H.length + 1, endLineNumber: z.lineNumber, endColumn: H.length + 1 };
|
|
842
|
+
t.value.executeEdits("toolbar", [{ range: R, text: `
|
|
843
|
+
` + n + c, forceMoveMarkers: !0 }]);
|
|
844
|
+
}
|
|
845
|
+
t.value.focus();
|
|
846
|
+
} else if (f.value === "wysiwyg" && h.value)
|
|
847
|
+
try {
|
|
848
|
+
h.value.action(_e(`
|
|
849
|
+
` + n + c));
|
|
850
|
+
} catch {
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
function L(n) {
|
|
854
|
+
const c = M.value.snippets;
|
|
855
|
+
switch (n) {
|
|
856
|
+
case "h1":
|
|
857
|
+
q("# ", c.heading);
|
|
858
|
+
break;
|
|
859
|
+
case "h2":
|
|
860
|
+
q("## ", c.heading);
|
|
861
|
+
break;
|
|
862
|
+
case "h3":
|
|
863
|
+
q("### ", c.heading);
|
|
864
|
+
break;
|
|
865
|
+
case "bold":
|
|
866
|
+
B("**", "**", c.boldText);
|
|
867
|
+
break;
|
|
868
|
+
case "italic":
|
|
869
|
+
B("*", "*", c.italicText);
|
|
870
|
+
break;
|
|
871
|
+
case "strikethrough":
|
|
872
|
+
B("~~", "~~", c.strikethrough);
|
|
873
|
+
break;
|
|
874
|
+
case "ul":
|
|
875
|
+
q("- ", c.listItem);
|
|
876
|
+
break;
|
|
877
|
+
case "ol":
|
|
878
|
+
q("1. ", c.listItem);
|
|
879
|
+
break;
|
|
880
|
+
case "blockquote":
|
|
881
|
+
q("> ", c.quote);
|
|
882
|
+
break;
|
|
883
|
+
case "code":
|
|
884
|
+
B("`", "`", c.code);
|
|
885
|
+
break;
|
|
886
|
+
case "codeblock":
|
|
887
|
+
B("```\n", "\n```", c.codeBlock);
|
|
888
|
+
break;
|
|
889
|
+
case "link":
|
|
890
|
+
B("[", "](url)", c.linkText);
|
|
891
|
+
break;
|
|
892
|
+
case "image":
|
|
893
|
+
B("", c.altText);
|
|
894
|
+
break;
|
|
895
|
+
case "hr":
|
|
896
|
+
q("---");
|
|
897
|
+
break;
|
|
898
|
+
case "math":
|
|
899
|
+
B("$", "$", c.mathFormula);
|
|
900
|
+
break;
|
|
901
|
+
case "table":
|
|
902
|
+
if (f.value === "wysiwyg" && h.value)
|
|
903
|
+
try {
|
|
904
|
+
h.value.action(De(Je.key, { row: 3, col: 3 }));
|
|
905
|
+
} catch {
|
|
906
|
+
}
|
|
907
|
+
else
|
|
908
|
+
q(
|
|
909
|
+
`| ${c.tableColumnA} | ${c.tableColumnB} | ${c.tableColumnC} |
|
|
910
|
+
|-------|-------|-------|
|
|
911
|
+
| `,
|
|
912
|
+
" | | |"
|
|
913
|
+
);
|
|
914
|
+
break;
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
function K(n, c, z) {
|
|
918
|
+
_ || E(D(c, d.value));
|
|
919
|
+
}
|
|
920
|
+
function se(n) {
|
|
921
|
+
h.value = n;
|
|
922
|
+
}
|
|
923
|
+
return {
|
|
924
|
+
editorMode: f,
|
|
925
|
+
content: d,
|
|
926
|
+
commitUserContent: E,
|
|
927
|
+
monacoEditor: t,
|
|
928
|
+
monacoInstance: T,
|
|
929
|
+
monacoLoading: V,
|
|
930
|
+
milkdownEditorRef: h,
|
|
931
|
+
extractedFields: Y,
|
|
932
|
+
toMilkdownMarkdown: k,
|
|
933
|
+
switchMode: Z,
|
|
934
|
+
syncFromProp: ee,
|
|
935
|
+
insertTextIntoActiveEditor: le,
|
|
936
|
+
handleMdAction: L,
|
|
937
|
+
onMilkdownMarkdownUpdated: K,
|
|
938
|
+
onMilkdownReady: se
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
const it = { class: "aimd-editor" }, nt = { key: 0 }, dt = { key: 1 }, _t = /* @__PURE__ */ ve({
|
|
942
|
+
__name: "AimdEditor",
|
|
943
|
+
props: {
|
|
944
|
+
modelValue: { default: "" },
|
|
945
|
+
locale: {},
|
|
946
|
+
messages: { default: () => ({}) },
|
|
947
|
+
mode: { default: "source" },
|
|
948
|
+
theme: { default: "aimd-light" },
|
|
949
|
+
showTopBar: { type: Boolean, default: !0 },
|
|
950
|
+
showToolbar: { type: Boolean, default: !0 },
|
|
951
|
+
showAimdToolbar: { type: Boolean, default: !0 },
|
|
952
|
+
showMdToolbar: { type: Boolean, default: !0 },
|
|
953
|
+
enableBlockHandle: { type: Boolean, default: !0 },
|
|
954
|
+
enableSlashMenu: { type: Boolean, default: !0 },
|
|
955
|
+
keepInactiveEditorsMounted: { type: Boolean, default: !0 },
|
|
956
|
+
minHeight: { default: 500 },
|
|
957
|
+
readonly: { type: Boolean, default: !1 },
|
|
958
|
+
monacoOptions: { default: () => ({}) },
|
|
959
|
+
varTypePlugins: {}
|
|
960
|
+
},
|
|
961
|
+
emits: ["update:modelValue", "update:mode", "ready"],
|
|
962
|
+
setup(u, { expose: F, emit: o }) {
|
|
963
|
+
const M = u, w = o, g = x(() => Ne(M.locale, M.messages)), {
|
|
964
|
+
editorMode: f,
|
|
965
|
+
content: d,
|
|
966
|
+
commitUserContent: t,
|
|
967
|
+
monacoEditor: T,
|
|
968
|
+
monacoInstance: V,
|
|
969
|
+
milkdownEditorRef: h,
|
|
970
|
+
extractedFields: _,
|
|
971
|
+
toMilkdownMarkdown: E,
|
|
972
|
+
switchMode: k,
|
|
973
|
+
syncFromProp: G,
|
|
974
|
+
insertTextIntoActiveEditor: D,
|
|
975
|
+
handleMdAction: J,
|
|
976
|
+
onMilkdownMarkdownUpdated: X,
|
|
977
|
+
onMilkdownReady: Y
|
|
978
|
+
} = at({
|
|
979
|
+
initialContent: M.modelValue,
|
|
980
|
+
initialMode: M.mode,
|
|
981
|
+
resolvedMessages: g,
|
|
982
|
+
emitModelValue: (m) => w("update:modelValue", m),
|
|
983
|
+
emitMode: (m) => w("update:mode", m)
|
|
984
|
+
});
|
|
985
|
+
U(() => M.modelValue, (m) => G(m)), U(() => M.mode, (m) => {
|
|
986
|
+
m !== f.value && k(m);
|
|
987
|
+
});
|
|
988
|
+
const Z = $(M.theme), ee = x(() => M.keepInactiveEditorsMounted || f.value === "source"), le = x(() => M.keepInactiveEditorsMounted || f.value === "wysiwyg"), B = x(() => $e(g.value)), q = x(() => Fe(g.value)), L = $(!1), K = $("var"), se = x(() => {
|
|
989
|
+
const m = _.value;
|
|
990
|
+
if (!m) return [];
|
|
991
|
+
const S = K.value;
|
|
992
|
+
return S === "ref_step" ? m.step || [] : S === "ref_var" ? m.var || [] : S === "ref_fig" ? m.ref_fig || [] : [];
|
|
993
|
+
}), n = x(() => {
|
|
994
|
+
const m = _.value;
|
|
995
|
+
return m?.quiz ? m.quiz.map((S) => S.id) : [];
|
|
996
|
+
});
|
|
997
|
+
function c(m) {
|
|
998
|
+
K.value = m, L.value = !0;
|
|
999
|
+
}
|
|
1000
|
+
function z(m) {
|
|
1001
|
+
D(Ke(m, g.value));
|
|
1002
|
+
}
|
|
1003
|
+
function P(m) {
|
|
1004
|
+
D(m);
|
|
1005
|
+
}
|
|
1006
|
+
const H = $(null), R = $(null);
|
|
1007
|
+
function ne(m) {
|
|
1008
|
+
t(m);
|
|
1009
|
+
}
|
|
1010
|
+
function te(m) {
|
|
1011
|
+
w("ready", { monaco: m });
|
|
1012
|
+
}
|
|
1013
|
+
function pe(m, S) {
|
|
1014
|
+
V.value = m, T.value = S;
|
|
1015
|
+
}
|
|
1016
|
+
function de(m) {
|
|
1017
|
+
Y(m), w("ready", { milkdown: m });
|
|
1018
|
+
}
|
|
1019
|
+
return F({
|
|
1020
|
+
getContent: () => d.value,
|
|
1021
|
+
setContent: (m) => {
|
|
1022
|
+
if (d.value = m, f.value === "source" && T.value)
|
|
1023
|
+
T.value.setValue(m);
|
|
1024
|
+
else if (h.value)
|
|
1025
|
+
try {
|
|
1026
|
+
h.value.action(ce(E(m)));
|
|
1027
|
+
} catch {
|
|
1028
|
+
}
|
|
1029
|
+
},
|
|
1030
|
+
getMode: () => f.value,
|
|
1031
|
+
setMode: (m) => k(m),
|
|
1032
|
+
getMonacoEditor: () => T.value,
|
|
1033
|
+
getMilkdownEditor: () => h.value,
|
|
1034
|
+
insertText: D
|
|
1035
|
+
}), (m, S) => (r(), v("div", it, [
|
|
1036
|
+
u.showToolbar ? (r(), xe(ot, {
|
|
1037
|
+
key: 0,
|
|
1038
|
+
"show-top-bar": u.showTopBar,
|
|
1039
|
+
"show-md-toolbar": u.showMdToolbar,
|
|
1040
|
+
"show-aimd-toolbar": u.showAimdToolbar,
|
|
1041
|
+
"editor-mode": O(f),
|
|
1042
|
+
"resolved-messages": g.value,
|
|
1043
|
+
"localized-field-types": B.value,
|
|
1044
|
+
"localized-md-toolbar-items": q.value,
|
|
1045
|
+
onSwitchMode: O(k),
|
|
1046
|
+
onMdAction: O(J),
|
|
1047
|
+
onOpenAimdDialog: c,
|
|
1048
|
+
onQuickInsertAimd: z
|
|
1049
|
+
}, null, 8, ["show-top-bar", "show-md-toolbar", "show-aimd-toolbar", "editor-mode", "resolved-messages", "localized-field-types", "localized-md-toolbar-items", "onSwitchMode", "onMdAction"])) : C("", !0),
|
|
1050
|
+
l("div", {
|
|
1051
|
+
class: "aimd-editor-panel",
|
|
1052
|
+
style: me({ minHeight: u.minHeight + "px" })
|
|
1053
|
+
}, [
|
|
1054
|
+
ee.value ? b((r(), v("div", nt, [
|
|
1055
|
+
ke(Qe, {
|
|
1056
|
+
ref_key: "sourceEditorRef",
|
|
1057
|
+
ref: H,
|
|
1058
|
+
content: O(d),
|
|
1059
|
+
theme: Z.value,
|
|
1060
|
+
"min-height": u.minHeight,
|
|
1061
|
+
readonly: u.readonly,
|
|
1062
|
+
"monaco-options": u.monacoOptions,
|
|
1063
|
+
"resolved-messages": g.value,
|
|
1064
|
+
onContentChange: ne,
|
|
1065
|
+
onReady: te,
|
|
1066
|
+
onMonacoLoaded: pe
|
|
1067
|
+
}, null, 8, ["content", "theme", "min-height", "readonly", "monaco-options", "resolved-messages"])
|
|
1068
|
+
], 512)), [
|
|
1069
|
+
[Ce, O(f) === "source"]
|
|
1070
|
+
]) : C("", !0),
|
|
1071
|
+
le.value ? b((r(), v("div", dt, [
|
|
1072
|
+
ke(Oe, {
|
|
1073
|
+
ref_key: "wysiwygEditorRef",
|
|
1074
|
+
ref: R,
|
|
1075
|
+
content: O(d),
|
|
1076
|
+
"min-height": u.minHeight,
|
|
1077
|
+
"enable-block-handle": u.enableBlockHandle,
|
|
1078
|
+
active: O(f) === "wysiwyg",
|
|
1079
|
+
"resolved-messages": g.value,
|
|
1080
|
+
"localized-field-types": B.value,
|
|
1081
|
+
onMarkdownUpdated: O(X),
|
|
1082
|
+
onReady: de,
|
|
1083
|
+
onOpenAimdDialog: c
|
|
1084
|
+
}, null, 8, ["content", "min-height", "enable-block-handle", "active", "resolved-messages", "localized-field-types", "onMarkdownUpdated"])
|
|
1085
|
+
], 512)), [
|
|
1086
|
+
[Ce, O(f) === "wysiwyg"]
|
|
1087
|
+
]) : C("", !0)
|
|
1088
|
+
], 4),
|
|
1089
|
+
ke(Qs, {
|
|
1090
|
+
visible: L.value,
|
|
1091
|
+
"initial-type": K.value,
|
|
1092
|
+
messages: g.value,
|
|
1093
|
+
"ref-suggestions": se.value,
|
|
1094
|
+
"var-type-plugins": u.varTypePlugins,
|
|
1095
|
+
"existing-quiz-ids": n.value,
|
|
1096
|
+
"onUpdate:visible": S[0] || (S[0] = (ge) => L.value = ge),
|
|
1097
|
+
onInsert: P
|
|
1098
|
+
}, null, 8, ["visible", "initial-type", "messages", "ref-suggestions", "var-type-plugins", "existing-quiz-ids"])
|
|
1099
|
+
]));
|
|
1100
|
+
}
|
|
1101
|
+
}), rt = { class: "aimd-editor-mode-switch" }, ut = ["title"], ct = ["innerHTML"], mt = ["title"], vt = ["innerHTML"], Mt = /* @__PURE__ */ ve({
|
|
1102
|
+
__name: "AimdEditorTopBar",
|
|
1103
|
+
props: {
|
|
1104
|
+
editorMode: {},
|
|
1105
|
+
resolvedMessages: {}
|
|
1106
|
+
},
|
|
1107
|
+
emits: ["switch-mode"],
|
|
1108
|
+
setup(u, { emit: F }) {
|
|
1109
|
+
const o = F, M = {
|
|
1110
|
+
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>',
|
|
1111
|
+
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>'
|
|
1112
|
+
};
|
|
1113
|
+
return (w, g) => (r(), v("div", rt, [
|
|
1114
|
+
l("button", {
|
|
1115
|
+
class: W(["aimd-editor-mode-btn", { active: u.editorMode === "source" }]),
|
|
1116
|
+
onClick: g[0] || (g[0] = (f) => o("switch-mode", "source")),
|
|
1117
|
+
title: u.resolvedMessages.mode.sourceTitle
|
|
1118
|
+
}, [
|
|
1119
|
+
l("span", {
|
|
1120
|
+
class: "aimd-editor-mode-icon",
|
|
1121
|
+
innerHTML: M.source
|
|
1122
|
+
}, null, 8, ct),
|
|
1123
|
+
l("span", null, i(u.resolvedMessages.mode.source), 1)
|
|
1124
|
+
], 10, ut),
|
|
1125
|
+
l("button", {
|
|
1126
|
+
class: W(["aimd-editor-mode-btn", { active: u.editorMode === "wysiwyg" }]),
|
|
1127
|
+
onClick: g[1] || (g[1] = (f) => o("switch-mode", "wysiwyg")),
|
|
1128
|
+
title: u.resolvedMessages.mode.wysiwygTitle
|
|
1129
|
+
}, [
|
|
1130
|
+
l("span", {
|
|
1131
|
+
class: "aimd-editor-mode-icon",
|
|
1132
|
+
innerHTML: M.wysiwyg
|
|
1133
|
+
}, null, 8, vt),
|
|
1134
|
+
l("span", null, i(u.resolvedMessages.mode.wysiwyg), 1)
|
|
1135
|
+
], 10, mt)
|
|
1136
|
+
]));
|
|
1137
|
+
}
|
|
1138
|
+
});
|
|
1139
|
+
export {
|
|
1140
|
+
_t as _,
|
|
1141
|
+
ot as a,
|
|
1142
|
+
Mt as b,
|
|
1143
|
+
Qs as c,
|
|
1144
|
+
at as u
|
|
1145
|
+
};
|