@airalogy/aimd-renderer 2.5.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -5
- package/README.zh-CN.md +44 -5
- package/dist/aimd-renderer.css +1 -1
- package/dist/common/criticMarkup.d.ts +10 -0
- package/dist/common/criticMarkup.d.ts.map +1 -0
- package/dist/common/processor.d.ts.map +1 -1
- package/dist/common/unified-token-renderer.d.ts.map +1 -1
- package/dist/html.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +263 -211
- package/dist/{processor-B2mByErv.js → processor-BOCQYqXE.js} +3065 -2146
- package/dist/readonly-record-renderer-CkzY7UvT.js +711 -0
- package/dist/vue/index.d.ts +2 -1
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/readonly-record-renderer.d.ts +42 -0
- package/dist/vue/readonly-record-renderer.d.ts.map +1 -0
- package/dist/vue/vue-renderer.d.ts +22 -1
- package/dist/vue/vue-renderer.d.ts.map +1 -1
- package/dist/vue.js +17 -9
- package/package.json +6 -6
- package/src/__tests__/renderer.test.ts +435 -2
- package/src/common/criticMarkup.ts +97 -0
- package/src/common/processor.ts +186 -43
- package/src/common/unified-token-renderer.ts +104 -24
- package/src/index.ts +21 -0
- package/src/styles/katex.css +174 -0
- package/src/vue/index.ts +21 -0
- package/src/vue/readonly-record-renderer.ts +747 -0
- package/src/vue/vue-renderer.ts +318 -48
package/dist/index.js
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import { e as
|
|
2
|
-
import { D as
|
|
1
|
+
import { e as F, c as M, p as I, s as B, u as H, v as z, w as V, t as j, x as O, y as K, z as N, A as Q } from "./processor-BOCQYqXE.js";
|
|
2
|
+
import { D as pe, f as ue, g as fe, h as _e, a as ye, i as ge, b as ve, j as he, k as be, l as Re, m as Ae, n as we, o as xe, r as Te, d as ke, q as qe } from "./processor-BOCQYqXE.js";
|
|
3
3
|
import { h as e } from "vue";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { A as $e, c as ze, a as Ee, b as Pe, n as Le, r as Ce } from "./readonly-record-renderer-CkzY7UvT.js";
|
|
5
|
+
const te = /* @__PURE__ */ Symbol("symbol-field-event-key"), ie = /* @__PURE__ */ Symbol("symbol-protocol-key"), se = /* @__PURE__ */ Symbol("draft-event-key"), re = /* @__PURE__ */ Symbol("symbol-report-event-key"), ne = /* @__PURE__ */ Symbol("symbol-bubble-menu-event-key");
|
|
6
|
+
function U(a) {
|
|
7
|
+
return a === "var_table" ? "table" : a;
|
|
7
8
|
}
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
if (
|
|
9
|
+
const W = /\[\[([^\[\]\s]+)\]\]/g;
|
|
10
|
+
function E(a, i) {
|
|
11
|
+
if (a !== "blank")
|
|
11
12
|
return [e("span", i)];
|
|
12
|
-
const
|
|
13
|
+
const r = [];
|
|
13
14
|
let l = 0;
|
|
14
|
-
for (const
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
for (const n of i.matchAll(W)) {
|
|
16
|
+
const d = n.index ?? 0, g = n[0], p = n[1];
|
|
17
|
+
d > l && r.push(e("span", i.slice(l, d))), r.push(
|
|
17
18
|
e("span", {
|
|
18
19
|
class: "aimd-quiz__blank-placeholder",
|
|
19
20
|
"data-blank-key": p
|
|
20
21
|
}, p)
|
|
21
|
-
), l =
|
|
22
|
+
), l = d + g.length;
|
|
22
23
|
}
|
|
23
|
-
return l < i.length &&
|
|
24
|
+
return l < i.length && r.push(e("span", i.slice(l))), r.length === 0 && r.push(e("span", i)), r;
|
|
24
25
|
}
|
|
25
|
-
function P(
|
|
26
|
-
return typeof
|
|
26
|
+
function P(a) {
|
|
27
|
+
return typeof a.points == "number" && Number.isFinite(a.points) ? `${a.text} (${a.points})` : a.text;
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
return !Array.isArray(
|
|
30
|
-
e("div", { class: "aimd-scale__list" },
|
|
29
|
+
function L(a) {
|
|
30
|
+
return !Array.isArray(a.items) || a.items.length === 0 || !Array.isArray(a.options) || a.options.length === 0 ? [e("div", { class: "aimd-scale__empty" }, "Scale definition is incomplete.")] : a.display === "list" ? [
|
|
31
|
+
e("div", { class: "aimd-scale__list" }, a.items.map(
|
|
31
32
|
(i) => e("div", { class: "aimd-scale__list-item" }, [
|
|
32
33
|
e("div", { class: "aimd-scale__item-stem" }, i.stem),
|
|
33
|
-
e("ul", { class: "aimd-scale__item-options" },
|
|
34
|
-
(
|
|
34
|
+
e("ul", { class: "aimd-scale__item-options" }, a.options.map(
|
|
35
|
+
(r) => e("li", P(r))
|
|
35
36
|
))
|
|
36
37
|
])
|
|
37
38
|
))
|
|
@@ -40,39 +41,83 @@ function E(t) {
|
|
|
40
41
|
e("thead", [
|
|
41
42
|
e("tr", [
|
|
42
43
|
e("th", { class: "aimd-scale__item-header" }, "Item"),
|
|
43
|
-
...
|
|
44
|
+
...a.options.map((i) => e("th", P(i)))
|
|
44
45
|
])
|
|
45
46
|
]),
|
|
46
|
-
e("tbody",
|
|
47
|
+
e("tbody", a.items.map(
|
|
47
48
|
(i) => e("tr", [
|
|
48
49
|
e("th", { class: "aimd-scale__item-stem", scope: "row" }, i.stem),
|
|
49
|
-
...
|
|
50
|
+
...a.options.map(() => e("td", { class: "aimd-scale__cell" }, "○"))
|
|
50
51
|
])
|
|
51
52
|
))
|
|
52
53
|
])
|
|
53
54
|
];
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
-
const i = Array.isArray(
|
|
56
|
+
function C(a) {
|
|
57
|
+
const i = Array.isArray(a.grading?.bands) ? a.grading.bands : [];
|
|
57
58
|
return i.length === 0 ? [] : [
|
|
58
59
|
e("ul", { class: "aimd-scale__bands" }, i.map(
|
|
59
|
-
(
|
|
60
|
+
(r) => e("li", `${r.min}-${r.max}: ${r.label}${r.interpretation ? ` · ${r.interpretation}` : ""}`)
|
|
60
61
|
))
|
|
61
62
|
];
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
-
const r =
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
function J(a) {
|
|
65
|
+
const i = K(a), r = N(a).map(Q).map((d) => d.trim()).filter(Boolean), l = r.length > 0 ? `e.g. ${r.join(", ")}` : void 0;
|
|
66
|
+
return {
|
|
67
|
+
tooltip: [i, l].filter((d) => !!d).join(`
|
|
68
|
+
`),
|
|
69
|
+
description: i,
|
|
70
|
+
examples: r
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function G(a) {
|
|
74
|
+
if (!a.description && a.examples.length === 0)
|
|
75
|
+
return null;
|
|
76
|
+
const i = [];
|
|
77
|
+
return a.description && i.push(e("span", {
|
|
78
|
+
class: "aimd-field__metadata-popover-line"
|
|
79
|
+
}, a.description)), a.examples.length > 0 && i.push(e("span", { class: "aimd-field__metadata-examples" }, [
|
|
80
|
+
e("span", { class: "aimd-field__metadata-examples-label" }, "e.g."),
|
|
81
|
+
...a.examples.map((r, l) => e("span", {
|
|
82
|
+
key: `${l}-${r}`,
|
|
83
|
+
class: "aimd-field__metadata-example"
|
|
84
|
+
}, r))
|
|
85
|
+
])), e("span", {
|
|
86
|
+
class: "aimd-field__metadata-popover",
|
|
87
|
+
role: "tooltip"
|
|
88
|
+
}, i);
|
|
89
|
+
}
|
|
90
|
+
function $(a, i) {
|
|
91
|
+
const r = j(a, i), l = O(i) !== void 0 && r !== a, n = J(i), d = !!n.description || n.examples.length > 0;
|
|
92
|
+
return e("span", {
|
|
93
|
+
class: [
|
|
94
|
+
"aimd-field__name",
|
|
95
|
+
l || d ? "aimd-field__name--with-metadata" : void 0,
|
|
96
|
+
d ? "aimd-field__metadata-host" : void 0
|
|
97
|
+
],
|
|
98
|
+
tabindex: d ? 0 : void 0,
|
|
99
|
+
"aria-label": n.tooltip || void 0
|
|
100
|
+
}, [
|
|
101
|
+
e("span", { class: "aimd-field__title" }, r),
|
|
102
|
+
l ? e("span", { class: "aimd-field__key" }, a) : null,
|
|
103
|
+
G(n)
|
|
104
|
+
]);
|
|
105
|
+
}
|
|
106
|
+
function k(a, i, r, l, n) {
|
|
107
|
+
const d = U(a), g = z(a, r);
|
|
108
|
+
if (a === "var_table") {
|
|
109
|
+
const u = [
|
|
67
110
|
e("div", { class: "aimd-field__header" }, [
|
|
68
|
-
e("span", { class: "aimd-field__scope" },
|
|
69
|
-
|
|
111
|
+
e("span", { class: "aimd-field__scope" }, r.scope.table),
|
|
112
|
+
$(i, n)
|
|
70
113
|
])
|
|
71
114
|
];
|
|
72
|
-
return l && l.length > 0 &&
|
|
115
|
+
return l && l.length > 0 && u.push(
|
|
73
116
|
e("table", { class: "aimd-field__table-preview" }, [
|
|
74
117
|
e("thead", [
|
|
75
|
-
e("tr", l.map((
|
|
118
|
+
e("tr", l.map((b) => e("th", {
|
|
119
|
+
"data-column-id": b
|
|
120
|
+
}, [$(b, n?.subvars?.[b])])))
|
|
76
121
|
]),
|
|
77
122
|
e("tbody", [
|
|
78
123
|
e("tr", l.map(() => e("td", "...")))
|
|
@@ -82,107 +127,107 @@ function T(t, i, n, l) {
|
|
|
82
127
|
class: "aimd-field aimd-field--var-table",
|
|
83
128
|
"data-aimd-type": "var_table",
|
|
84
129
|
"data-aimd-id": i
|
|
85
|
-
},
|
|
130
|
+
}, u);
|
|
86
131
|
}
|
|
87
132
|
return e("span", {
|
|
88
|
-
class: `aimd-field aimd-field--${
|
|
89
|
-
"data-aimd-type":
|
|
133
|
+
class: `aimd-field aimd-field--${d === "table" ? "var-table" : d}`,
|
|
134
|
+
"data-aimd-type": d,
|
|
90
135
|
"data-aimd-id": i
|
|
91
136
|
}, [
|
|
92
|
-
e("span", { class: "aimd-field__scope" },
|
|
93
|
-
|
|
137
|
+
e("span", { class: "aimd-field__scope" }, g),
|
|
138
|
+
$(i, n)
|
|
94
139
|
]);
|
|
95
140
|
}
|
|
96
|
-
function
|
|
97
|
-
const { getTokenProps: i, mode:
|
|
98
|
-
AIMDItem:
|
|
99
|
-
AIMDTag:
|
|
141
|
+
function X(a) {
|
|
142
|
+
const { getTokenProps: i, mode: r, components: l = {} } = a, n = M(a.locale, a.messages), {
|
|
143
|
+
AIMDItem: d,
|
|
144
|
+
AIMDTag: g,
|
|
100
145
|
AIMDStepRef: p,
|
|
101
146
|
StepRenderer: u,
|
|
102
|
-
CheckRenderer:
|
|
147
|
+
CheckRenderer: b,
|
|
103
148
|
PreviewRenderer: _
|
|
104
|
-
} = l,
|
|
149
|
+
} = l, A = () => typeof r == "function" ? r() : r, R = () => A() === "preview", w = () => V(A(), a.quizPreview);
|
|
105
150
|
return {
|
|
106
|
-
var: async (
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
151
|
+
var: async (o, y, f) => {
|
|
152
|
+
const t = o, { id: s, scope: c } = t, m = t.definition;
|
|
153
|
+
if (R())
|
|
109
154
|
return _ ? e(_, { type: "var" }, {
|
|
110
155
|
default: () => f,
|
|
111
156
|
name: () => s
|
|
112
|
-
}) :
|
|
113
|
-
if (i &&
|
|
114
|
-
const
|
|
115
|
-
if (
|
|
157
|
+
}) : k(c, s, n, void 0, m);
|
|
158
|
+
if (i && d) {
|
|
159
|
+
const v = await i({ meta: { node: { id: s, scope: c } } });
|
|
160
|
+
if (v)
|
|
116
161
|
return e("span", {
|
|
117
162
|
class: "aimd-field-wrapper aimd-field-wrapper--inline",
|
|
118
163
|
id: `${c}-${s}`,
|
|
119
164
|
"data-has-variable": "true"
|
|
120
|
-
}, [e(
|
|
165
|
+
}, [e(d, v)]);
|
|
121
166
|
}
|
|
122
|
-
return
|
|
167
|
+
return k(c, s, n, void 0, m);
|
|
123
168
|
},
|
|
124
|
-
var_table: async (
|
|
125
|
-
const
|
|
126
|
-
if (
|
|
169
|
+
var_table: async (o, y, f) => {
|
|
170
|
+
const t = o, { id: s, scope: c, columns: m } = t, v = t.definition;
|
|
171
|
+
if (R())
|
|
127
172
|
return _ ? e(_, { type: "var_table" }, {
|
|
128
173
|
default: () => f,
|
|
129
174
|
name: () => s
|
|
130
|
-
}) :
|
|
131
|
-
if (i &&
|
|
132
|
-
const
|
|
133
|
-
return e(
|
|
175
|
+
}) : k(c, s, n, m, v);
|
|
176
|
+
if (i && g) {
|
|
177
|
+
const x = await i({ meta: { node: { id: s, scope: c } } });
|
|
178
|
+
return e(g, { ...x, props: m });
|
|
134
179
|
}
|
|
135
|
-
return
|
|
180
|
+
return k(c, s, n, m, v);
|
|
136
181
|
},
|
|
137
|
-
quiz: async (
|
|
138
|
-
const
|
|
139
|
-
if (
|
|
182
|
+
quiz: async (o, y, f) => {
|
|
183
|
+
const t = o, { id: s, scope: c, quizType: m, stem: v, score: x } = t, q = H(m, t.mode, n);
|
|
184
|
+
if (R()) {
|
|
140
185
|
if (_)
|
|
141
186
|
return e(_, { type: "quiz" }, {
|
|
142
187
|
default: () => f,
|
|
143
188
|
name: () => s
|
|
144
189
|
});
|
|
145
|
-
const
|
|
190
|
+
const h = [
|
|
146
191
|
e("div", { class: "aimd-quiz__meta" }, [
|
|
147
|
-
e("span", { class: "aimd-field__scope" },
|
|
192
|
+
e("span", { class: "aimd-field__scope" }, z(c, n)),
|
|
148
193
|
e("span", { class: "aimd-field__name" }, s),
|
|
149
|
-
e("span", { class: "aimd-field__type" }, `(${
|
|
150
|
-
|
|
194
|
+
e("span", { class: "aimd-field__type" }, `(${q})`),
|
|
195
|
+
x !== void 0 ? e("span", { class: "aimd-quiz__score" }, n.quiz.score(x)) : null
|
|
151
196
|
]),
|
|
152
|
-
e("div", { class: "aimd-quiz__stem" },
|
|
197
|
+
e("div", { class: "aimd-quiz__stem" }, E(m, v || s))
|
|
153
198
|
];
|
|
154
|
-
typeof
|
|
155
|
-
e("ul", { class: "aimd-quiz__options" },
|
|
156
|
-
(
|
|
199
|
+
typeof t.title == "string" && t.title.trim() && h.splice(1, 0, e("div", { class: "aimd-quiz__title" }, t.title)), typeof t.description == "string" && t.description.trim() && h.push(e("div", { class: "aimd-quiz__description" }, t.description)), (m === "choice" || m === "true_false") && Array.isArray(t.options) && t.options.length > 0 && h.push(
|
|
200
|
+
e("ul", { class: "aimd-quiz__options" }, t.options.map(
|
|
201
|
+
(T) => e("li", `${T.key}. ${T.text}`)
|
|
157
202
|
))
|
|
158
|
-
), m === "scale" && (
|
|
159
|
-
const
|
|
160
|
-
if (
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
e("div", { class: "aimd-quiz__answer" },
|
|
203
|
+
), m === "scale" && (h.push(...L(t)), h.push(...C(t)));
|
|
204
|
+
const S = w();
|
|
205
|
+
if (S.showAnswers && (m === "choice" || m === "true_false") && t.answer !== void 0) {
|
|
206
|
+
const T = Array.isArray(t.answer) ? t.answer.join(", ") : String(t.answer);
|
|
207
|
+
T.trim() && h.push(
|
|
208
|
+
e("div", { class: "aimd-quiz__answer" }, n.quiz.answer(T))
|
|
164
209
|
);
|
|
165
210
|
}
|
|
166
|
-
return
|
|
167
|
-
e("ul", { class: "aimd-quiz__blanks" },
|
|
168
|
-
(
|
|
211
|
+
return S.showAnswers && m === "blank" && Array.isArray(t.blanks) && t.blanks.length > 0 && h.push(
|
|
212
|
+
e("ul", { class: "aimd-quiz__blanks" }, t.blanks.map(
|
|
213
|
+
(T) => e("li", `${T.key}: ${T.answer}`)
|
|
169
214
|
))
|
|
170
|
-
),
|
|
171
|
-
e("div", { class: "aimd-quiz__rubric" },
|
|
215
|
+
), S.showRubric && m === "open" && typeof t.rubric == "string" && t.rubric.trim() && h.push(
|
|
216
|
+
e("div", { class: "aimd-quiz__rubric" }, n.quiz.rubric(t.rubric))
|
|
172
217
|
), e("div", {
|
|
173
218
|
class: "aimd-field aimd-field--quiz",
|
|
174
219
|
"data-aimd-type": "quiz",
|
|
175
220
|
"data-aimd-id": s
|
|
176
|
-
},
|
|
221
|
+
}, h);
|
|
177
222
|
}
|
|
178
|
-
if (i &&
|
|
179
|
-
const
|
|
180
|
-
if (
|
|
223
|
+
if (i && d) {
|
|
224
|
+
const h = await i({ meta: { node: { id: s, scope: c } } });
|
|
225
|
+
if (h)
|
|
181
226
|
return e("span", {
|
|
182
227
|
class: "aimd-field-wrapper aimd-field-wrapper--inline",
|
|
183
228
|
id: `${c}-${s}`,
|
|
184
229
|
"data-has-variable": "true"
|
|
185
|
-
}, [e(
|
|
230
|
+
}, [e(d, h)]);
|
|
186
231
|
}
|
|
187
232
|
return e("div", {
|
|
188
233
|
class: "aimd-field aimd-field--quiz",
|
|
@@ -190,63 +235,63 @@ function O(t) {
|
|
|
190
235
|
"data-aimd-id": s
|
|
191
236
|
}, [
|
|
192
237
|
e("div", { class: "aimd-quiz__meta" }, [
|
|
193
|
-
e("span", { class: "aimd-field__scope" },
|
|
238
|
+
e("span", { class: "aimd-field__scope" }, z(c, n)),
|
|
194
239
|
e("span", { class: "aimd-field__name" }, s),
|
|
195
|
-
e("span", { class: "aimd-field__type" }, `(${
|
|
240
|
+
e("span", { class: "aimd-field__type" }, `(${q})`)
|
|
196
241
|
]),
|
|
197
|
-
...typeof
|
|
198
|
-
e("div", { class: "aimd-quiz__stem" },
|
|
199
|
-
...typeof
|
|
200
|
-
...m === "scale" ? [...
|
|
242
|
+
...typeof t.title == "string" && t.title.trim() ? [e("div", { class: "aimd-quiz__title" }, t.title)] : [],
|
|
243
|
+
e("div", { class: "aimd-quiz__stem" }, E(m, v || s)),
|
|
244
|
+
...typeof t.description == "string" && t.description.trim() ? [e("div", { class: "aimd-quiz__description" }, t.description)] : [],
|
|
245
|
+
...m === "scale" ? [...L(t), ...C(t)] : []
|
|
201
246
|
]);
|
|
202
247
|
},
|
|
203
|
-
step: async (
|
|
204
|
-
const
|
|
205
|
-
if (
|
|
248
|
+
step: async (o, y, f) => {
|
|
249
|
+
const t = o, { id: s, scope: c, step: m, check: v } = t;
|
|
250
|
+
if (R())
|
|
206
251
|
return _ ? e(_, { type: "step" }, {
|
|
207
252
|
default: () => f,
|
|
208
253
|
name: () => s
|
|
209
|
-
}) : e("span", { class: "research-step__sequence" },
|
|
254
|
+
}) : e("span", { class: "research-step__sequence" }, n.step.sequence(m));
|
|
210
255
|
if (i && u) {
|
|
211
|
-
const
|
|
256
|
+
const x = await i({ meta: { node: { id: s, scope: c } } }), q = await i({ meta: { node: { id: s, scope: c, type: "step-annotation" } } });
|
|
212
257
|
return e(u, {
|
|
213
|
-
item:
|
|
214
|
-
annotationItem:
|
|
258
|
+
item: x,
|
|
259
|
+
annotationItem: q,
|
|
215
260
|
name: s,
|
|
216
261
|
step: String(m),
|
|
217
|
-
check:
|
|
262
|
+
check: v
|
|
218
263
|
}, {
|
|
219
264
|
default: () => f
|
|
220
265
|
});
|
|
221
266
|
}
|
|
222
|
-
return e("span", { class: "research-step__sequence" },
|
|
267
|
+
return e("span", { class: "research-step__sequence" }, n.step.sequence(m));
|
|
223
268
|
},
|
|
224
|
-
check: async (
|
|
225
|
-
const
|
|
226
|
-
if (
|
|
269
|
+
check: async (o, y, f) => {
|
|
270
|
+
const t = o, { id: s, scope: c, label: m } = t;
|
|
271
|
+
if (R())
|
|
227
272
|
return _ ? e(_, { type: "check" }, {
|
|
228
273
|
default: () => f,
|
|
229
274
|
name: () => s
|
|
230
|
-
}) :
|
|
231
|
-
if (i &&
|
|
232
|
-
const
|
|
233
|
-
return e(
|
|
234
|
-
item:
|
|
235
|
-
annotationItem:
|
|
275
|
+
}) : k(c, s, n);
|
|
276
|
+
if (i && b) {
|
|
277
|
+
const v = await i({ meta: { node: { id: s, scope: c } } }), x = await i({ meta: { node: { id: s, scope: c, type: "check-annotation" } } });
|
|
278
|
+
return e(b, {
|
|
279
|
+
item: v,
|
|
280
|
+
annotationItem: x,
|
|
236
281
|
name: s
|
|
237
282
|
}, {
|
|
238
283
|
default: () => f
|
|
239
284
|
});
|
|
240
285
|
}
|
|
241
|
-
return
|
|
286
|
+
return k(c, s, n);
|
|
242
287
|
},
|
|
243
|
-
ref_step: (
|
|
244
|
-
const { id: f } =
|
|
245
|
-
return p ? e(p, { name:
|
|
288
|
+
ref_step: (o, y) => {
|
|
289
|
+
const { id: f } = o, t = "refTarget" in o ? o.refTarget : f, s = "stepSequence" in o && typeof o.stepSequence == "string" ? o.stepSequence : void 0, c = s ? n.step.reference(s) : t;
|
|
290
|
+
return p ? e(p, { name: t, type: "step", stepSequence: s }) : e("a", {
|
|
246
291
|
class: "aimd-ref aimd-ref--step",
|
|
247
|
-
href: `#step-${
|
|
292
|
+
href: `#step-${t}`,
|
|
248
293
|
"data-aimd-step-sequence": s,
|
|
249
|
-
title:
|
|
294
|
+
title: t
|
|
250
295
|
}, [
|
|
251
296
|
e("span", { class: "aimd-ref__content" }, [
|
|
252
297
|
e("span", { class: "aimd-field aimd-field--step aimd-field--readonly" }, [
|
|
@@ -255,51 +300,51 @@ function O(t) {
|
|
|
255
300
|
])
|
|
256
301
|
]);
|
|
257
302
|
},
|
|
258
|
-
ref_var: (
|
|
259
|
-
const { id: f } =
|
|
303
|
+
ref_var: (o, y) => {
|
|
304
|
+
const { id: f } = o, t = "refTarget" in o ? o.refTarget : f, s = y.mode === "edit" ? Y(y.value, t) : null;
|
|
260
305
|
return p ? e(p, {
|
|
261
|
-
name:
|
|
306
|
+
name: t,
|
|
262
307
|
type: "var",
|
|
263
308
|
contextValue: y.value,
|
|
264
309
|
displayValue: s ?? void 0
|
|
265
310
|
}) : y.mode !== "edit" ? e("a", {
|
|
266
311
|
class: "aimd-ref aimd-ref--var",
|
|
267
|
-
href: `#var-${
|
|
268
|
-
title:
|
|
312
|
+
href: `#var-${t}`,
|
|
313
|
+
title: t
|
|
269
314
|
}, [
|
|
270
315
|
e("span", { class: "aimd-ref__icon" }, "📌"),
|
|
271
|
-
e("span", { class: "aimd-ref__name" },
|
|
316
|
+
e("span", { class: "aimd-ref__name" }, t)
|
|
272
317
|
]) : e("span", {
|
|
273
318
|
class: "aimd-ref aimd-ref--var",
|
|
274
|
-
"data-aimd-ref":
|
|
275
|
-
title:
|
|
319
|
+
"data-aimd-ref": t,
|
|
320
|
+
title: t
|
|
276
321
|
}, [
|
|
277
322
|
e("span", { class: "aimd-ref__content" }, [
|
|
278
323
|
s !== null ? e("span", {
|
|
279
324
|
class: "aimd-field aimd-field--var aimd-field--readonly",
|
|
280
|
-
"data-aimd-id":
|
|
325
|
+
"data-aimd-id": t,
|
|
281
326
|
"data-aimd-scope": "var"
|
|
282
327
|
}, [
|
|
283
328
|
e("span", { class: "aimd-field__value" }, s)
|
|
284
329
|
]) : e("span", { class: "aimd-field aimd-field--var" }, [
|
|
285
|
-
e("span", { class: "aimd-field__scope" },
|
|
286
|
-
e("span", { class: "aimd-field__name" },
|
|
330
|
+
e("span", { class: "aimd-field__scope" }, n.scope.var),
|
|
331
|
+
e("span", { class: "aimd-field__name" }, t)
|
|
287
332
|
])
|
|
288
333
|
])
|
|
289
334
|
]);
|
|
290
335
|
}
|
|
291
336
|
};
|
|
292
337
|
}
|
|
293
|
-
function
|
|
294
|
-
return typeof
|
|
338
|
+
function D(a) {
|
|
339
|
+
return typeof a == "object" && a !== null && !Array.isArray(a);
|
|
295
340
|
}
|
|
296
|
-
function
|
|
297
|
-
const
|
|
341
|
+
function Y(a, i) {
|
|
342
|
+
const r = a?.var?.[i], l = D(r) && "value" in r ? r.value : r;
|
|
298
343
|
if (l == null || l === "")
|
|
299
344
|
return null;
|
|
300
345
|
if (Array.isArray(l))
|
|
301
|
-
return l.map((
|
|
302
|
-
if (
|
|
346
|
+
return l.map((n) => String(n)).join(", ");
|
|
347
|
+
if (D(l))
|
|
303
348
|
try {
|
|
304
349
|
return JSON.stringify(l);
|
|
305
350
|
} catch {
|
|
@@ -307,34 +352,34 @@ function F(t, i) {
|
|
|
307
352
|
}
|
|
308
353
|
return String(l);
|
|
309
354
|
}
|
|
310
|
-
function
|
|
311
|
-
const { getStaticResearchAssets: i, highlighter:
|
|
312
|
-
return (
|
|
313
|
-
const { src:
|
|
314
|
-
return
|
|
315
|
-
src:
|
|
316
|
-
alt:
|
|
355
|
+
function Z(a) {
|
|
356
|
+
const { getStaticResearchAssets: i, highlighter: r, components: l = {} } = a, { AssetRenderer: n, EmbeddedRenderer: d, MermaidBlock: g } = l, p = {};
|
|
357
|
+
return (n || i) && (p.img = (u, b, _) => {
|
|
358
|
+
const { src: A, alt: R } = u.properties || {};
|
|
359
|
+
return n ? e(n, {
|
|
360
|
+
src: A,
|
|
361
|
+
alt: R,
|
|
317
362
|
getStaticResearchAssets: i
|
|
318
|
-
}) : e("img", { src:
|
|
319
|
-
}), p.pre = (u,
|
|
320
|
-
const
|
|
363
|
+
}) : e("img", { src: A, alt: R, class: "aimd-image", loading: "lazy" });
|
|
364
|
+
}), p.pre = (u, b, _) => {
|
|
365
|
+
const A = u.children.find(
|
|
321
366
|
(s) => s.type === "element" && s.tagName === "code"
|
|
322
367
|
);
|
|
323
|
-
if (!
|
|
324
|
-
return e("pre", {},
|
|
325
|
-
const
|
|
368
|
+
if (!A)
|
|
369
|
+
return e("pre", {}, b);
|
|
370
|
+
const R = A.properties?.className;
|
|
326
371
|
let w = "text";
|
|
327
|
-
if (Array.isArray(
|
|
328
|
-
const s =
|
|
372
|
+
if (Array.isArray(R)) {
|
|
373
|
+
const s = R.find((c) => typeof c == "string" && c.startsWith("language-"));
|
|
329
374
|
s && typeof s == "string" && (w = s.replace("language-", ""));
|
|
330
375
|
}
|
|
331
|
-
const
|
|
332
|
-
if ((w === "mermaid" || y === "gantt" || y === "sequenceDiagram" || /^graph (?:TB|BT|RL|LR|TD);?$/.test(y)) &&
|
|
333
|
-
return e(
|
|
334
|
-
const
|
|
335
|
-
if (
|
|
376
|
+
const o = A.children.map((s) => s.type === "text" ? s.value : "").join(""), y = o.split(/\n/)[0].trim();
|
|
377
|
+
if ((w === "mermaid" || y === "gantt" || y === "sequenceDiagram" || /^graph (?:TB|BT|RL|LR|TD);?$/.test(y)) && g)
|
|
378
|
+
return e(g, { code: o });
|
|
379
|
+
const t = typeof r == "function" ? r() : r;
|
|
380
|
+
if (t)
|
|
336
381
|
try {
|
|
337
|
-
const s =
|
|
382
|
+
const s = t.codeToHtml(o, {
|
|
338
383
|
lang: w,
|
|
339
384
|
theme: "github-dark"
|
|
340
385
|
});
|
|
@@ -349,37 +394,37 @@ function N(t) {
|
|
|
349
394
|
return e(
|
|
350
395
|
"pre",
|
|
351
396
|
{ class: `language-${w}` },
|
|
352
|
-
e("code", { class: `language-${w}` },
|
|
397
|
+
e("code", { class: `language-${w}` }, o)
|
|
353
398
|
);
|
|
354
|
-
},
|
|
399
|
+
}, d && (p.iframe = (u, b, _) => e(d, {
|
|
355
400
|
contentProps: { ...u.properties, credentialless: !0 },
|
|
356
401
|
component: "iframe"
|
|
357
|
-
}), p.video = (u,
|
|
402
|
+
}), p.video = (u, b, _) => e(d, {
|
|
358
403
|
contentProps: u.properties,
|
|
359
404
|
component: "video"
|
|
360
405
|
})), p;
|
|
361
406
|
}
|
|
362
|
-
function
|
|
363
|
-
const i = () => typeof
|
|
407
|
+
function le(a) {
|
|
408
|
+
const i = () => typeof a.mode == "function" ? a.mode() : a.mode, r = () => V(i(), a.quizPreview), l = F(a.locale), n = M(l, a.messages), d = X(a), g = Z(a), p = {
|
|
364
409
|
locale: l,
|
|
365
|
-
messages:
|
|
410
|
+
messages: n,
|
|
366
411
|
context: {
|
|
367
412
|
mode: i() === "timeline" ? "preview" : i(),
|
|
368
413
|
readonly: i() === "preview",
|
|
369
|
-
quizPreview:
|
|
414
|
+
quizPreview: r(),
|
|
370
415
|
locale: l,
|
|
371
|
-
messages:
|
|
416
|
+
messages: n
|
|
372
417
|
},
|
|
373
|
-
aimdRenderers:
|
|
374
|
-
elementRenderers:
|
|
418
|
+
aimdRenderers: d,
|
|
419
|
+
elementRenderers: g
|
|
375
420
|
};
|
|
376
421
|
return {
|
|
377
422
|
async render(u) {
|
|
378
|
-
return
|
|
423
|
+
return B(u, {
|
|
379
424
|
gfm: !0,
|
|
380
425
|
math: !0,
|
|
381
426
|
breaks: !0,
|
|
382
|
-
assignerVisibility:
|
|
427
|
+
assignerVisibility: a.assignerVisibility,
|
|
383
428
|
...p
|
|
384
429
|
});
|
|
385
430
|
},
|
|
@@ -389,51 +434,58 @@ function Z(t) {
|
|
|
389
434
|
vueOptions: p
|
|
390
435
|
};
|
|
391
436
|
}
|
|
392
|
-
function
|
|
393
|
-
const { parent: i, sequence:
|
|
394
|
-
let
|
|
437
|
+
function de(a) {
|
|
438
|
+
const { parent: i, sequence: r, level: l } = a;
|
|
439
|
+
let n = String(r + 1);
|
|
395
440
|
if (l === 1)
|
|
396
|
-
return
|
|
397
|
-
let
|
|
398
|
-
for (;
|
|
399
|
-
|
|
400
|
-
return
|
|
441
|
+
return n;
|
|
442
|
+
let d = i;
|
|
443
|
+
for (; d; )
|
|
444
|
+
n = `${d.sequence + 1}.${n}`, d = d.parent;
|
|
445
|
+
return n;
|
|
401
446
|
}
|
|
402
|
-
function
|
|
403
|
-
if (
|
|
404
|
-
const [
|
|
405
|
-
return [{ type:
|
|
447
|
+
function ce(a) {
|
|
448
|
+
if (a.startsWith("var_table")) {
|
|
449
|
+
const [d, g, p, ...u] = a.split(/(\\)?\|/g);
|
|
450
|
+
return [{ type: d, name: `${p}|${u.filter(Boolean).join(",")}` }];
|
|
406
451
|
}
|
|
407
|
-
const [
|
|
408
|
-
return [{ type:
|
|
452
|
+
const [r, l, n] = a.split(/(\\)?\|/);
|
|
453
|
+
return [{ type: r, name: n }];
|
|
409
454
|
}
|
|
410
455
|
export {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
456
|
+
$e as AIMD_RECORD_RENDER_SCOPES,
|
|
457
|
+
pe as DEFAULT_AIMD_RENDERER_LOCALE,
|
|
458
|
+
ne as bubbleMenuEventKey,
|
|
459
|
+
M as createAimdRendererMessages,
|
|
460
|
+
ue as createAssetRenderer,
|
|
461
|
+
fe as createCodeBlockRenderer,
|
|
462
|
+
_e as createComponentRenderer,
|
|
463
|
+
ye as createCustomElementAimdRenderer,
|
|
464
|
+
ge as createEmbeddedRenderer,
|
|
465
|
+
ve as createHtmlProcessor,
|
|
466
|
+
he as createMermaidRenderer,
|
|
467
|
+
ze as createReadonlyRecordAimdRenderers,
|
|
468
|
+
Ee as createReadonlyRecordElementRenderers,
|
|
469
|
+
Pe as createReadonlyRecordRenderContext,
|
|
470
|
+
be as createRenderer,
|
|
471
|
+
Re as createStepCardRenderer,
|
|
472
|
+
le as createUnifiedTokenRenderer,
|
|
473
|
+
Ae as defaultRenderer,
|
|
474
|
+
se as draftEventKey,
|
|
475
|
+
te as fieldEventKey,
|
|
476
|
+
H as getAimdRendererQuizTypeLabel,
|
|
477
|
+
de as getFinalIndent,
|
|
478
|
+
we as hastToVue,
|
|
479
|
+
xe as loadShikiHighlighter,
|
|
480
|
+
Le as normalizeRecordRenderValue,
|
|
430
481
|
I as parseAndExtract,
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
482
|
+
ce as parseFieldTag,
|
|
483
|
+
ie as protocolKey,
|
|
484
|
+
Ce as renderReadonlyRecordToVue,
|
|
485
|
+
Te as renderToHtml,
|
|
486
|
+
ke as renderToHtmlSync,
|
|
487
|
+
qe as renderToVNodes,
|
|
488
|
+
B as renderToVue,
|
|
489
|
+
re as reportEventKey,
|
|
490
|
+
F as resolveAimdRendererLocale
|
|
439
491
|
};
|