@pie-element/explicit-constructed-response 11.1.2-next.19 → 11.1.2-next.20
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/browser/editor-runtime/assets/Symbola-4c507403.woff2 +0 -0
- package/dist/browser/editor-runtime/author/index.js +3381 -0
- package/dist/browser/editor-runtime/author/index.js.map +1 -0
- package/dist/browser/editor-runtime/browser-Dj-HJ-qm.js +364 -0
- package/dist/browser/editor-runtime/browser-Dj-HJ-qm.js.map +1 -0
- package/dist/browser/editor-runtime/controller/index.js +4152 -0
- package/dist/browser/editor-runtime/controller/index.js.map +1 -0
- package/dist/browser/editor-runtime/delivery/index.js +156 -0
- package/dist/browser/editor-runtime/delivery/index.js.map +1 -0
- package/dist/browser/editor-runtime/dist-B9hsEnNL.js +24598 -0
- package/dist/browser/editor-runtime/dist-B9hsEnNL.js.map +1 -0
- package/dist/browser/editor-runtime/dist-DCmVXYeO.js +1528 -0
- package/dist/browser/editor-runtime/dist-DCmVXYeO.js.map +1 -0
- package/dist/browser/editor-runtime/main-Ot6cxLkg.js +954 -0
- package/dist/browser/editor-runtime/main-Ot6cxLkg.js.map +1 -0
- package/dist/browser/editor-runtime/print/index.js +40 -0
- package/dist/browser/editor-runtime/print/index.js.map +1 -0
- package/package.json +12 -2
|
@@ -0,0 +1,954 @@
|
|
|
1
|
+
import { D as e, b as t, s as n, t as r } from "./browser-Dj-HJ-qm.js";
|
|
2
|
+
import { C as i, G as a, O as o, W as s, _ as c, at as l, g as u, h as d, it as f, m as p, p as m, q as h, t as g } from "./dist-B9hsEnNL.js";
|
|
3
|
+
import { t as _ } from "./dist-DCmVXYeO.js";
|
|
4
|
+
import v, { useRef as y } from "react";
|
|
5
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
6
|
+
//#region ../../lib-react/correct-answer-toggle/dist/expander.js
|
|
7
|
+
var S = /* @__PURE__ */ e(f(), 1), C = "height ease-in 300ms, opacity ease-in 300ms", w = h("div")(() => ({
|
|
8
|
+
position: "relative",
|
|
9
|
+
height: 0,
|
|
10
|
+
overflow: "hidden",
|
|
11
|
+
display: "flex",
|
|
12
|
+
visibility: "hidden",
|
|
13
|
+
width: 0,
|
|
14
|
+
"&.enter": {
|
|
15
|
+
transition: C,
|
|
16
|
+
opacity: 1,
|
|
17
|
+
height: "auto",
|
|
18
|
+
width: "auto",
|
|
19
|
+
visibility: "visible",
|
|
20
|
+
minHeight: "25px"
|
|
21
|
+
},
|
|
22
|
+
"&.enter-done": {
|
|
23
|
+
height: "auto",
|
|
24
|
+
visibility: "visible",
|
|
25
|
+
width: "auto",
|
|
26
|
+
minHeight: "25px"
|
|
27
|
+
},
|
|
28
|
+
"&.exit": {
|
|
29
|
+
transition: C,
|
|
30
|
+
opacity: 0,
|
|
31
|
+
height: 0,
|
|
32
|
+
visibility: "visible",
|
|
33
|
+
width: 0
|
|
34
|
+
},
|
|
35
|
+
"&.exit-done": {
|
|
36
|
+
opacity: 0,
|
|
37
|
+
visibility: "hidden",
|
|
38
|
+
height: 0,
|
|
39
|
+
width: 0
|
|
40
|
+
}
|
|
41
|
+
})), T = (e) => {
|
|
42
|
+
let { show: t, children: n, className: r } = e, i = y(null);
|
|
43
|
+
return /* @__PURE__ */ b(a, {
|
|
44
|
+
nodeRef: i,
|
|
45
|
+
in: t,
|
|
46
|
+
appear: !0,
|
|
47
|
+
mountOnEnter: !1,
|
|
48
|
+
timeout: 300,
|
|
49
|
+
classNames: {
|
|
50
|
+
enter: "enter",
|
|
51
|
+
enterDone: "enter-done",
|
|
52
|
+
exit: "exit",
|
|
53
|
+
exitDone: "exit-done"
|
|
54
|
+
},
|
|
55
|
+
children: /* @__PURE__ */ b(w, {
|
|
56
|
+
ref: i,
|
|
57
|
+
className: r,
|
|
58
|
+
children: n
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
T.propTypes = {
|
|
63
|
+
show: S.default.bool.isRequired,
|
|
64
|
+
className: S.default.string,
|
|
65
|
+
children: S.default.oneOfType([S.default.arrayOf(S.default.node), S.default.node]).isRequired
|
|
66
|
+
};
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region ../../lib-react/icons/dist/correct-response-icon.js
|
|
69
|
+
var E = ({ bgFill: e, fgFill: t }) => /* @__PURE__ */ x("svg", {
|
|
70
|
+
preserveAspectRatio: "xMinYMin meet",
|
|
71
|
+
version: "1.1",
|
|
72
|
+
viewBox: "-283 359 34 35",
|
|
73
|
+
style: { enableBackground: "new -283 359 34 35" },
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ b("circle", {
|
|
76
|
+
cx: "-266",
|
|
77
|
+
cy: "375.9",
|
|
78
|
+
r: "14",
|
|
79
|
+
fill: e
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ b("path", {
|
|
82
|
+
d: "M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z\n M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z",
|
|
83
|
+
fill: e
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ b("polygon", {
|
|
86
|
+
points: "-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6",
|
|
87
|
+
fill: t
|
|
88
|
+
})
|
|
89
|
+
]
|
|
90
|
+
});
|
|
91
|
+
E.propTypes = {
|
|
92
|
+
bgFill: S.default.string.isRequired,
|
|
93
|
+
fgFill: S.default.string.isRequired
|
|
94
|
+
};
|
|
95
|
+
var D = ({ bgFill: e, fgFill: t, borderFill: n }) => /* @__PURE__ */ x("svg", {
|
|
96
|
+
preserveAspectRatio: "xMinYMin meet",
|
|
97
|
+
version: "1.1",
|
|
98
|
+
viewBox: "-129.5 127 34 35",
|
|
99
|
+
style: { enableBackground: "new -129.5 127 34 35" },
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ b("path", {
|
|
102
|
+
style: {
|
|
103
|
+
fill: "#D0CAC5",
|
|
104
|
+
stroke: "#E6E3E0",
|
|
105
|
+
strokeWidth: .75,
|
|
106
|
+
strokeMiterlimit: 10
|
|
107
|
+
},
|
|
108
|
+
d: "M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5\n C-97.4,153.5-104.3,160.4-112.9,160.4z"
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ b("path", {
|
|
111
|
+
style: {
|
|
112
|
+
fill: "#B3ABA4",
|
|
113
|
+
stroke: "#CDC7C2",
|
|
114
|
+
strokeWidth: .5,
|
|
115
|
+
strokeMiterlimit: 10
|
|
116
|
+
},
|
|
117
|
+
d: "M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z"
|
|
118
|
+
}),
|
|
119
|
+
/* @__PURE__ */ b("circle", {
|
|
120
|
+
cx: "-114.2",
|
|
121
|
+
cy: "143.5",
|
|
122
|
+
r: "14",
|
|
123
|
+
fill: e
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ b("path", {
|
|
126
|
+
d: "M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z\n M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z",
|
|
127
|
+
fill: n
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ b("polygon", {
|
|
130
|
+
points: "-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2",
|
|
131
|
+
fill: t
|
|
132
|
+
})
|
|
133
|
+
]
|
|
134
|
+
});
|
|
135
|
+
D.propTypes = {
|
|
136
|
+
bgFill: S.default.string.isRequired,
|
|
137
|
+
fgFill: S.default.string.isRequired,
|
|
138
|
+
borderFill: S.default.string.isRequired
|
|
139
|
+
};
|
|
140
|
+
var ee = h("div")(({ size: e }) => ({
|
|
141
|
+
width: e || "25px",
|
|
142
|
+
height: e || "25px"
|
|
143
|
+
})), O = ({ open: e, size: t }) => /* @__PURE__ */ b(ee, {
|
|
144
|
+
size: t,
|
|
145
|
+
children: e ? /* @__PURE__ */ b(E, {
|
|
146
|
+
bgFill: "#bce2ff",
|
|
147
|
+
fgFill: "#1a9cff"
|
|
148
|
+
}) : /* @__PURE__ */ b(D, {
|
|
149
|
+
bgFill: "white",
|
|
150
|
+
fgFill: "#1a9cff",
|
|
151
|
+
borderFill: "#bce2ff"
|
|
152
|
+
})
|
|
153
|
+
});
|
|
154
|
+
O.propTypes = {
|
|
155
|
+
open: S.default.bool,
|
|
156
|
+
size: S.default.string
|
|
157
|
+
}, O.defaultProps = { open: !1 };
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region ../../lib-react/correct-answer-toggle/dist/index.js
|
|
160
|
+
var te = /* @__PURE__ */ e(r(), 1);
|
|
161
|
+
function k(e) {
|
|
162
|
+
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
163
|
+
}
|
|
164
|
+
function ne(e, t) {
|
|
165
|
+
return !e || k(e) ? e : k(e.default) ? e.default : t && k(e[t]) ? e[t] : t && k(e[t]?.default) ? e[t].default : e;
|
|
166
|
+
}
|
|
167
|
+
var re = ne(u, "Readable") || ne(ae.Readable, "Readable"), ie = m, A = ie.default, ae = A && typeof A == "object" ? A : ie, { translator: j } = _, oe = {
|
|
168
|
+
WebkitTouchCallout: "none",
|
|
169
|
+
WebkitUserSelect: "none",
|
|
170
|
+
KhtmlUserSelect: "none",
|
|
171
|
+
MozUserSelect: "none",
|
|
172
|
+
msUserSelect: "none",
|
|
173
|
+
userSelect: "none"
|
|
174
|
+
}, se = h("div")(() => ({
|
|
175
|
+
width: "100%",
|
|
176
|
+
cursor: "pointer"
|
|
177
|
+
})), ce = h("div")(() => ({
|
|
178
|
+
margin: "0 auto",
|
|
179
|
+
textAlign: "center",
|
|
180
|
+
display: "flex"
|
|
181
|
+
})), le = h("div")(() => ({
|
|
182
|
+
width: "fit-content",
|
|
183
|
+
minWidth: "140px",
|
|
184
|
+
alignSelf: "center",
|
|
185
|
+
verticalAlign: "middle",
|
|
186
|
+
color: `var(--correct-answer-toggle-label-color, ${s.text()})`,
|
|
187
|
+
fontWeight: "normal",
|
|
188
|
+
...oe
|
|
189
|
+
})), ue = h("div")(() => ({
|
|
190
|
+
position: "absolute",
|
|
191
|
+
width: "25px",
|
|
192
|
+
"&.enter": { opacity: "0" },
|
|
193
|
+
"&.enter-active": {
|
|
194
|
+
opacity: "1",
|
|
195
|
+
transition: "opacity 0.3s ease-in"
|
|
196
|
+
},
|
|
197
|
+
"&.exit": { opacity: "1" },
|
|
198
|
+
"&.exit-active": {
|
|
199
|
+
opacity: "0",
|
|
200
|
+
transition: "opacity 0.3s ease-in"
|
|
201
|
+
}
|
|
202
|
+
})), de = h("div")(() => ({
|
|
203
|
+
width: "25px",
|
|
204
|
+
marginRight: "5px",
|
|
205
|
+
display: "flex",
|
|
206
|
+
alignItems: "center"
|
|
207
|
+
})), fe = class e extends v.Component {
|
|
208
|
+
static propTypes = {
|
|
209
|
+
onToggle: S.default.func,
|
|
210
|
+
toggled: S.default.bool,
|
|
211
|
+
show: S.default.bool,
|
|
212
|
+
hideMessage: S.default.string,
|
|
213
|
+
showMessage: S.default.string,
|
|
214
|
+
className: S.default.string,
|
|
215
|
+
language: S.default.string
|
|
216
|
+
};
|
|
217
|
+
static defaultProps = {
|
|
218
|
+
showMessage: "Show correct answer",
|
|
219
|
+
hideMessage: "Hide correct answer",
|
|
220
|
+
show: !1,
|
|
221
|
+
toggled: !1
|
|
222
|
+
};
|
|
223
|
+
constructor(t) {
|
|
224
|
+
super(t), this.state = { show: t.show }, this.openIconRef = v.createRef(), this.closedIconRef = v.createRef(), e.defaultProps = {
|
|
225
|
+
...e.defaultProps,
|
|
226
|
+
showMessage: j.t("common:showCorrectAnswer", { lng: t.language }),
|
|
227
|
+
hideMessage: j.t("common:hideCorrectAnswer", { lng: t.language })
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
onClick() {
|
|
231
|
+
this.props.onToggle(!this.props.toggled);
|
|
232
|
+
}
|
|
233
|
+
onTouch(e) {
|
|
234
|
+
e.preventDefault(), this.props.onToggle(!this.props.toggled);
|
|
235
|
+
}
|
|
236
|
+
UNSAFE_componentWillReceiveProps(t) {
|
|
237
|
+
this.setState({ show: t.show }), t.language !== this.props?.language && (e.defaultProps = {
|
|
238
|
+
...e.defaultProps,
|
|
239
|
+
showMessage: j.t("common:showCorrectAnswer", { lng: t.language }),
|
|
240
|
+
hideMessage: j.t("common:hideCorrectAnswer", { lng: t.language })
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
render() {
|
|
244
|
+
let { className: e, toggled: t, hideMessage: n, showMessage: r } = this.props;
|
|
245
|
+
return /* @__PURE__ */ b(se, {
|
|
246
|
+
className: e,
|
|
247
|
+
children: /* @__PURE__ */ b(T, {
|
|
248
|
+
show: this.state.show,
|
|
249
|
+
children: /* @__PURE__ */ x(ce, {
|
|
250
|
+
onClick: this.onClick.bind(this),
|
|
251
|
+
onTouchEnd: this.onTouch.bind(this),
|
|
252
|
+
children: [/* @__PURE__ */ x(de, { children: [/* @__PURE__ */ b(a, {
|
|
253
|
+
nodeRef: this.openIconRef,
|
|
254
|
+
timeout: 400,
|
|
255
|
+
in: t,
|
|
256
|
+
exit: !t,
|
|
257
|
+
classNames: {
|
|
258
|
+
enter: "enter",
|
|
259
|
+
enterActive: "enter-active",
|
|
260
|
+
exit: "exit",
|
|
261
|
+
exitActive: "exit-active"
|
|
262
|
+
},
|
|
263
|
+
children: /* @__PURE__ */ b(ue, {
|
|
264
|
+
ref: this.openIconRef,
|
|
265
|
+
children: /* @__PURE__ */ b(O, { open: t }, "correct-open")
|
|
266
|
+
})
|
|
267
|
+
}), /* @__PURE__ */ b(a, {
|
|
268
|
+
nodeRef: this.closedIconRef,
|
|
269
|
+
timeout: 5e3,
|
|
270
|
+
in: !t,
|
|
271
|
+
exit: t,
|
|
272
|
+
classNames: {
|
|
273
|
+
enter: "enter",
|
|
274
|
+
enterActive: "enter-active",
|
|
275
|
+
exit: "exit",
|
|
276
|
+
exitActive: "exit-active"
|
|
277
|
+
},
|
|
278
|
+
children: /* @__PURE__ */ b(ue, {
|
|
279
|
+
ref: this.closedIconRef,
|
|
280
|
+
children: /* @__PURE__ */ b(O, { open: t }, "correct-closed")
|
|
281
|
+
})
|
|
282
|
+
})] }), /* @__PURE__ */ b(re, {
|
|
283
|
+
false: !0,
|
|
284
|
+
children: /* @__PURE__ */ b(le, {
|
|
285
|
+
"aria-hidden": !this.state.show,
|
|
286
|
+
children: t ? n : r
|
|
287
|
+
})
|
|
288
|
+
})]
|
|
289
|
+
})
|
|
290
|
+
})
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}, pe = /\{\{(\d+)\}\}/g, me = (e, t) => e ? { markup: e.replace(pe, (e, n) => `<span data-component="${t}" data-id="${n}"></span>`) } : { markup: "" }, M = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), N = /* @__PURE__ */ M(((e, t) => {
|
|
294
|
+
t.exports = {
|
|
295
|
+
"border-radius": 1,
|
|
296
|
+
"border-top-left-radius": 1,
|
|
297
|
+
"border-top-right-radius": 1,
|
|
298
|
+
"border-bottom-left-radius": 1,
|
|
299
|
+
"border-bottom-right-radius": 1,
|
|
300
|
+
"box-shadow": 1,
|
|
301
|
+
order: 1,
|
|
302
|
+
flex: function(e, t) {
|
|
303
|
+
return [t + "box-flex"];
|
|
304
|
+
},
|
|
305
|
+
"box-flex": 1,
|
|
306
|
+
"box-align": 1,
|
|
307
|
+
animation: 1,
|
|
308
|
+
"animation-duration": 1,
|
|
309
|
+
"animation-name": 1,
|
|
310
|
+
transition: 1,
|
|
311
|
+
"transition-duration": 1,
|
|
312
|
+
transform: 1,
|
|
313
|
+
"transform-style": 1,
|
|
314
|
+
"transform-origin": 1,
|
|
315
|
+
"backface-visibility": 1,
|
|
316
|
+
perspective: 1,
|
|
317
|
+
"box-pack": 1
|
|
318
|
+
};
|
|
319
|
+
}));
|
|
320
|
+
N();
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssUnitless.js
|
|
323
|
+
var P = /* @__PURE__ */ M(((e, t) => {
|
|
324
|
+
t.exports = {
|
|
325
|
+
animation: 1,
|
|
326
|
+
"column-count": 1,
|
|
327
|
+
columns: 1,
|
|
328
|
+
"font-weight": 1,
|
|
329
|
+
opacity: 1,
|
|
330
|
+
"order ": 1,
|
|
331
|
+
"z-index": 1,
|
|
332
|
+
zoom: 1,
|
|
333
|
+
flex: 1,
|
|
334
|
+
"box-flex": 1,
|
|
335
|
+
transform: 1,
|
|
336
|
+
perspective: 1,
|
|
337
|
+
"box-pack": 1,
|
|
338
|
+
"box-align": 1,
|
|
339
|
+
colspan: 1,
|
|
340
|
+
rowspan: 1
|
|
341
|
+
};
|
|
342
|
+
}));
|
|
343
|
+
P();
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toUpperFirst.js
|
|
346
|
+
var F = /* @__PURE__ */ M(((e, t) => {
|
|
347
|
+
t.exports = function(e) {
|
|
348
|
+
return e.length ? e.charAt(0).toUpperCase() + e.substring(1) : e;
|
|
349
|
+
};
|
|
350
|
+
}));
|
|
351
|
+
F();
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixInfo.js
|
|
354
|
+
var I = /* @__PURE__ */ M(((e, t) => {
|
|
355
|
+
var n = F(), r = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/, i = typeof document > "u" ? {} : document.documentElement.style;
|
|
356
|
+
t.exports = (function() {
|
|
357
|
+
var e = (function() {
|
|
358
|
+
for (var e in i) if (r.test(e)) return e.match(r)[0];
|
|
359
|
+
return "WebkitOpacity" in i ? "Webkit" : "KhtmlOpacity" in i ? "Khtml" : "";
|
|
360
|
+
})();
|
|
361
|
+
return {
|
|
362
|
+
style: e,
|
|
363
|
+
css: "-" + e.toLowerCase() + "-",
|
|
364
|
+
dom: {
|
|
365
|
+
Webkit: "WebKit",
|
|
366
|
+
ms: "MS",
|
|
367
|
+
o: "WebKit"
|
|
368
|
+
}[e] || n(e)
|
|
369
|
+
};
|
|
370
|
+
})();
|
|
371
|
+
}));
|
|
372
|
+
I();
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenRe.js
|
|
375
|
+
var he = /* @__PURE__ */ M(((e, t) => {
|
|
376
|
+
t.exports = /[-\s]+(.)?/g;
|
|
377
|
+
}));
|
|
378
|
+
he();
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/camelize.js
|
|
381
|
+
var L = /* @__PURE__ */ M(((e, t) => {
|
|
382
|
+
var n = function(e, t) {
|
|
383
|
+
return t ? t.toUpperCase() : "";
|
|
384
|
+
}, r = he();
|
|
385
|
+
t.exports = function(e) {
|
|
386
|
+
return e ? e.replace(r, n) : "";
|
|
387
|
+
};
|
|
388
|
+
}));
|
|
389
|
+
L();
|
|
390
|
+
//#endregion
|
|
391
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/separate.js
|
|
392
|
+
var R = /* @__PURE__ */ M(((e, t) => {
|
|
393
|
+
var n = /::/g, r = /([A-Z]+)([A-Z][a-z])/g, i = /([a-z\d])([A-Z])/g, a = /_/g;
|
|
394
|
+
t.exports = function(e, t) {
|
|
395
|
+
return e ? e.replace(n, "/").replace(r, "$1_$2").replace(i, "$1_$2").replace(a, t || "-") : "";
|
|
396
|
+
};
|
|
397
|
+
}));
|
|
398
|
+
R();
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenate.js
|
|
401
|
+
var z = /* @__PURE__ */ M(((e, t) => {
|
|
402
|
+
var n = R();
|
|
403
|
+
t.exports = function(e) {
|
|
404
|
+
return n(e).toLowerCase();
|
|
405
|
+
};
|
|
406
|
+
}));
|
|
407
|
+
z();
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toLowerFirst.js
|
|
410
|
+
var ge = /* @__PURE__ */ M(((e, t) => {
|
|
411
|
+
t.exports = function(e) {
|
|
412
|
+
return e.length ? e.charAt(0).toLowerCase() + e.substring(1) : e;
|
|
413
|
+
};
|
|
414
|
+
}));
|
|
415
|
+
ge();
|
|
416
|
+
//#endregion
|
|
417
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixer.js
|
|
418
|
+
var _e = /* @__PURE__ */ M(((e, t) => {
|
|
419
|
+
var n = L(), r = z(), i = ge(), a = F(), o = I(), s = N(), c = typeof document > "u" ? {} : document.documentElement.style;
|
|
420
|
+
t.exports = function(e) {
|
|
421
|
+
return function(t, l) {
|
|
422
|
+
l ||= {};
|
|
423
|
+
var u = i(n(t)), d = r(t), f = e ? u : d, p = o.style ? e ? o.style : o.css : "";
|
|
424
|
+
if (u in c) return l.asString ? f : [f];
|
|
425
|
+
var m = f, h = s[d], g = [];
|
|
426
|
+
if (e && (m = a(f)), typeof h == "function") {
|
|
427
|
+
var _ = h(f, p) || [];
|
|
428
|
+
_ && !Array.isArray(_) && (_ = [_]), _.length && (_ = _.map(function(t) {
|
|
429
|
+
return e ? i(n(t)) : r(t);
|
|
430
|
+
})), g = g.concat(_);
|
|
431
|
+
}
|
|
432
|
+
return p && g.push(p + m), g.push(f), l.asString || g.length == 1 ? g[0] : g;
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
}));
|
|
436
|
+
_e();
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssPrefix.js
|
|
439
|
+
var ve = /* @__PURE__ */ M(((e, t) => {
|
|
440
|
+
t.exports = _e()();
|
|
441
|
+
}));
|
|
442
|
+
ve();
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/hasOwn.js
|
|
445
|
+
var B = /* @__PURE__ */ M(((e, t) => {
|
|
446
|
+
var n = Object.prototype.hasOwnProperty;
|
|
447
|
+
t.exports = function(e, t) {
|
|
448
|
+
return n.call(e, t);
|
|
449
|
+
};
|
|
450
|
+
}));
|
|
451
|
+
B();
|
|
452
|
+
//#endregion
|
|
453
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isObject.js
|
|
454
|
+
var V = /* @__PURE__ */ M(((e, t) => {
|
|
455
|
+
var n = Object.prototype.toString;
|
|
456
|
+
t.exports = function(e) {
|
|
457
|
+
return !!e && n.call(e) === "[object Object]";
|
|
458
|
+
};
|
|
459
|
+
}));
|
|
460
|
+
V();
|
|
461
|
+
//#endregion
|
|
462
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isFunction.js
|
|
463
|
+
var H = /* @__PURE__ */ M(((e, t) => {
|
|
464
|
+
var n = Object.prototype.toString;
|
|
465
|
+
t.exports = function(e) {
|
|
466
|
+
return n.apply(e) === "[object Function]";
|
|
467
|
+
};
|
|
468
|
+
}));
|
|
469
|
+
H();
|
|
470
|
+
//#endregion
|
|
471
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleObject.js
|
|
472
|
+
var U = /* @__PURE__ */ M(((e, t) => {
|
|
473
|
+
I();
|
|
474
|
+
var n = ve(), r = z(), i = L(), a = B(), o = V(), s = H(), c = function(e, t, r, i) {
|
|
475
|
+
n(t).forEach(function(t) {
|
|
476
|
+
e[i ? i(t) : t] = r;
|
|
477
|
+
});
|
|
478
|
+
}, l = function(e) {
|
|
479
|
+
e = (e || "").split(";");
|
|
480
|
+
var t = {};
|
|
481
|
+
return e.forEach(function(e) {
|
|
482
|
+
var n = e.split(":");
|
|
483
|
+
n.length == 2 && (t[n[0].trim()] = n[1].trim());
|
|
484
|
+
}), t;
|
|
485
|
+
}, u = { cssUnitless: P() }, d = function(e, t, n, f) {
|
|
486
|
+
typeof e == "string" && (e = l(e)), t ||= u, t.cssUnitless = t.cssUnitless || u.cssUnitless, f ||= {};
|
|
487
|
+
var p = t.scope || {}, m = t.addUnits == null ? p && p.addUnits != null ? p.addUnits : !0 : t.addUnits, h = (t.cssUnitless == null ? p ? p.cssUnitless : null : t.cssUnitless) || {}, g = (t.cssUnit || p ? p.cssUnit : null) || "px", _ = t.prefixProperties || (p ? p.prefixProperties : null) || {}, v = t.camelize ? i : r, y, b, x, S, C, w, T, E;
|
|
488
|
+
for (x in e) if (a(e, x)) {
|
|
489
|
+
if (S = e[x], b = r(n ? n + x : x), y = !1, E = !1, s(S) && (T = S.call(p || e, S, x, b, e), o(T) && T.value != null ? (S = T.value, E = T.prefix, b = T.name ? r(T.name) : b) : S = T), C = typeof S, w = C == "number" || C == "string" && S != "" && S * 1 == S, S == null || b == null || b === "") continue;
|
|
490
|
+
if ((w || C == "string") && (y = !0), !y && S.value != null && S.prefix && (y = !0, E = S.prefix, S = S.value), y) {
|
|
491
|
+
if (E ||= !!_[b], w && (S = m && !(b in h) ? S + g : S + ""), (b == "border" || !b.indexOf("border") && !~b.indexOf("radius") && !~b.indexOf("width")) && w && (b += "-width"), !b.indexOf("border-radius-") && (b.replace(/border(-radius)(-(.*))/, function(e, t, n) {
|
|
492
|
+
var r = {
|
|
493
|
+
"-top": ["-top-left", "-top-right"],
|
|
494
|
+
"-left": ["-top-left", "-bottom-left"],
|
|
495
|
+
"-right": ["-top-right", "-bottom-right"],
|
|
496
|
+
"-bottom": ["-bottom-left", "-bottom-right"]
|
|
497
|
+
};
|
|
498
|
+
n in r ? (b = [], r[n].forEach(function(e) {
|
|
499
|
+
b.push("border" + e + t);
|
|
500
|
+
})) : b = "border" + n + t;
|
|
501
|
+
}), Array.isArray(b))) {
|
|
502
|
+
b.forEach(function(e) {
|
|
503
|
+
E ? c(f, e, S, v) : f[v(e)] = S;
|
|
504
|
+
});
|
|
505
|
+
continue;
|
|
506
|
+
}
|
|
507
|
+
E ? c(f, b, S, v) : f[v(b)] = S;
|
|
508
|
+
} else d(S, t, b + "-", f);
|
|
509
|
+
}
|
|
510
|
+
return f;
|
|
511
|
+
};
|
|
512
|
+
t.exports = d;
|
|
513
|
+
}));
|
|
514
|
+
U();
|
|
515
|
+
//#endregion
|
|
516
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleString.js
|
|
517
|
+
var W = /* @__PURE__ */ M(((e, t) => {
|
|
518
|
+
var n = U(), r = B();
|
|
519
|
+
t.exports = function(e, t) {
|
|
520
|
+
e = n(e, t);
|
|
521
|
+
var i = [], a;
|
|
522
|
+
for (a in e) r(e, a) && i.push(a + ": " + e[a]);
|
|
523
|
+
return i.join("; ");
|
|
524
|
+
};
|
|
525
|
+
}));
|
|
526
|
+
W();
|
|
527
|
+
//#endregion
|
|
528
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/index.js
|
|
529
|
+
var G = /* @__PURE__ */ M(((e, t) => {
|
|
530
|
+
t.exports = {
|
|
531
|
+
prefixProperties: N(),
|
|
532
|
+
cssUnitless: P(),
|
|
533
|
+
object: U(),
|
|
534
|
+
string: W()
|
|
535
|
+
};
|
|
536
|
+
}));
|
|
537
|
+
G();
|
|
538
|
+
//#endregion
|
|
539
|
+
//#region ../../lib-react/mask-markup/dist/serialization.js
|
|
540
|
+
var ye = G(), be = (0, te.default)("@pie-lib:mask-markup:serialization"), xe = ["span"], Se = [
|
|
541
|
+
"em",
|
|
542
|
+
"strong",
|
|
543
|
+
"u"
|
|
544
|
+
], Ce = 3, we = 8, Te = 1, Ee = (e) => {
|
|
545
|
+
if (!e.attributes || e.attributes.length <= 0) return;
|
|
546
|
+
let t = {}, n;
|
|
547
|
+
for (n = 0; n < e.attributes.length; n++) {
|
|
548
|
+
let r = e.attributes[n];
|
|
549
|
+
t[r.name] = r.value;
|
|
550
|
+
}
|
|
551
|
+
return t;
|
|
552
|
+
}, De = (e) => xe.includes(e) ? "inline" : Se.includes(e) ? "mark" : "block", Oe = (e) => {
|
|
553
|
+
let t = /([\w-]*)\s*:\s*([^;]*)/g, n, r = {};
|
|
554
|
+
for (; n = t.exec(e);) r[n[1]] = n[2].trim();
|
|
555
|
+
return r;
|
|
556
|
+
}, ke = (e) => (0, ye.object)(e, {
|
|
557
|
+
camelize: !0,
|
|
558
|
+
addUnits: !1
|
|
559
|
+
}), Ae = (e, t) => ke(Oe(e.getAttribute(t))), je = (e, t, n) => {
|
|
560
|
+
let r = e.getAttribute(n);
|
|
561
|
+
return delete t.class, r;
|
|
562
|
+
}, Me = (e) => (t, n) => {
|
|
563
|
+
if (!e.getAttribute) return t;
|
|
564
|
+
if (e.getAttribute(n)) switch (n) {
|
|
565
|
+
case "style":
|
|
566
|
+
t.style = Ae(e, n);
|
|
567
|
+
break;
|
|
568
|
+
case "class":
|
|
569
|
+
t.className = je(e, t, n);
|
|
570
|
+
break;
|
|
571
|
+
default:
|
|
572
|
+
t[n] = e.getAttribute(n);
|
|
573
|
+
break;
|
|
574
|
+
}
|
|
575
|
+
return t;
|
|
576
|
+
}, Ne = [
|
|
577
|
+
"border",
|
|
578
|
+
"class",
|
|
579
|
+
"style"
|
|
580
|
+
], K = {
|
|
581
|
+
b: "bold",
|
|
582
|
+
em: "italic",
|
|
583
|
+
u: "underline",
|
|
584
|
+
s: "strikethrough",
|
|
585
|
+
code: "code",
|
|
586
|
+
strong: "strong"
|
|
587
|
+
}, Pe = (e, t = []) => {
|
|
588
|
+
if (e.nodeType === we) return null;
|
|
589
|
+
if (e.nodeType === Ce) {
|
|
590
|
+
let n = { text: e.textContent };
|
|
591
|
+
return t.length > 0 && (n.marks = t.map((e) => ({
|
|
592
|
+
type: e,
|
|
593
|
+
data: void 0
|
|
594
|
+
}))), {
|
|
595
|
+
object: "text",
|
|
596
|
+
leaves: [n]
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
if (e.nodeType === Te) {
|
|
600
|
+
let n = e.tagName.toLowerCase(), r = K[n];
|
|
601
|
+
if (r) return be("[deserialize] mark: ", r), {
|
|
602
|
+
_flatten: !0,
|
|
603
|
+
nodes: q(e.childNodes, [...t, r])
|
|
604
|
+
};
|
|
605
|
+
if (n === "math") return {
|
|
606
|
+
isMath: !0,
|
|
607
|
+
nodes: [e]
|
|
608
|
+
};
|
|
609
|
+
let i = Ee(e) || {};
|
|
610
|
+
n === "audio" && i.controls === "" && (i.controls = !0);
|
|
611
|
+
let a = Ne.reduce(Me(e), { ...i }), o = De(n), s = q(e.childNodes, t);
|
|
612
|
+
return {
|
|
613
|
+
object: o,
|
|
614
|
+
type: n,
|
|
615
|
+
data: {
|
|
616
|
+
dataset: { ...e.dataset },
|
|
617
|
+
attributes: { ...a }
|
|
618
|
+
},
|
|
619
|
+
nodes: s
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
return null;
|
|
623
|
+
}, q = (e, t = []) => {
|
|
624
|
+
let n = [];
|
|
625
|
+
for (let r = 0; r < e.length; r++) {
|
|
626
|
+
let i = Pe(e[r], t);
|
|
627
|
+
i !== null && (i._flatten && i.nodes ? n.push(...i.nodes) : n.push(i));
|
|
628
|
+
}
|
|
629
|
+
return n;
|
|
630
|
+
}, Fe = (e) => {
|
|
631
|
+
if (!e || !e.trim()) return {
|
|
632
|
+
object: "value",
|
|
633
|
+
document: {
|
|
634
|
+
object: "document",
|
|
635
|
+
data: {},
|
|
636
|
+
nodes: [{
|
|
637
|
+
object: "block",
|
|
638
|
+
type: "span",
|
|
639
|
+
data: {},
|
|
640
|
+
isVoid: !1,
|
|
641
|
+
nodes: []
|
|
642
|
+
}]
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
let t = q(new DOMParser().parseFromString(e, "text/html").body.childNodes);
|
|
646
|
+
return !t.some((e) => e.object === "block" || e.object === "inline") && t.length > 0 && (t = [{
|
|
647
|
+
object: "block",
|
|
648
|
+
type: "span",
|
|
649
|
+
data: {},
|
|
650
|
+
isVoid: !1,
|
|
651
|
+
nodes: t
|
|
652
|
+
}]), t.length === 0 && (t = [{
|
|
653
|
+
object: "block",
|
|
654
|
+
type: "span",
|
|
655
|
+
data: {},
|
|
656
|
+
isVoid: !1,
|
|
657
|
+
nodes: []
|
|
658
|
+
}]), {
|
|
659
|
+
object: "value",
|
|
660
|
+
document: {
|
|
661
|
+
object: "document",
|
|
662
|
+
data: {},
|
|
663
|
+
nodes: t
|
|
664
|
+
}
|
|
665
|
+
};
|
|
666
|
+
}, Ie = h("div")(({ theme: e }) => ({
|
|
667
|
+
paddingTop: e.spacing(.5),
|
|
668
|
+
paddingBottom: e.spacing(.5)
|
|
669
|
+
})), Le = h("span")(() => ({
|
|
670
|
+
display: "inline-block",
|
|
671
|
+
width: ".75em"
|
|
672
|
+
})), Re = ["tbody", "tr"], ze = (e, t) => {
|
|
673
|
+
let n = t.trim() === "", r = e && e.type;
|
|
674
|
+
if (!(n && Re.includes(r))) return t;
|
|
675
|
+
}, Be = (e) => {
|
|
676
|
+
let n = e.leaves.find((e) => t(e, "marks", []).length);
|
|
677
|
+
return n ? n.marks : null;
|
|
678
|
+
}, Ve = (e, t, n, r, i, a) => {
|
|
679
|
+
if (!t) return null;
|
|
680
|
+
let o = [];
|
|
681
|
+
return (e.nodes || []).forEach((e, s) => {
|
|
682
|
+
let c = e.type ? `${e.type}-${s}` : `${s}`;
|
|
683
|
+
if (e.isMath) return o.push(/* @__PURE__ */ b("span", { dangerouslySetInnerHTML: { __html: `<math displaystyle="true">${e.nodes[0].innerHTML}</math>` } })), o;
|
|
684
|
+
if (r) {
|
|
685
|
+
let i = r(e, t, n);
|
|
686
|
+
if (i) {
|
|
687
|
+
let t = e.data?.dataset?.component === "blank";
|
|
688
|
+
t && o.push(/* @__PURE__ */ b(Le, {}, `spacer-${s}-before`)), o.push(i), t && o.push(/* @__PURE__ */ b(Le, {}, `spacer-${s}-after`));
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
if (e.object === "text") {
|
|
693
|
+
let t = e.leaves.reduce((e, t) => {
|
|
694
|
+
let n = t.text, r = ze(i, n);
|
|
695
|
+
return r ? e + r : e;
|
|
696
|
+
}, ""), n = Be(e);
|
|
697
|
+
if (n?.length > 0) {
|
|
698
|
+
let e = n.map((e) => Object.keys(K).find((t) => K[t] === e.type)).filter(Boolean);
|
|
699
|
+
e.length > 0 ? o.push(e.reduceRight((e, t, n) => /* @__PURE__ */ b(t, { children: e }, `${c}-${t}-${n}`), t)) : o.push(t);
|
|
700
|
+
} else t.length > 0 && o.push(t);
|
|
701
|
+
} else {
|
|
702
|
+
let i = Ve(e, t, n, r, e, a);
|
|
703
|
+
if (e.type === "p" || e.type === "paragraph") o.push(/* @__PURE__ */ b(Ie, { children: i }, c));
|
|
704
|
+
else {
|
|
705
|
+
let t = e.type;
|
|
706
|
+
e.nodes && e.nodes.length > 0 ? o.push(/* @__PURE__ */ b(t, {
|
|
707
|
+
...e.data.attributes,
|
|
708
|
+
children: i
|
|
709
|
+
}, c)) : o.push(/* @__PURE__ */ b(t, { ...e.data.attributes }, c));
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}), o;
|
|
713
|
+
}, He = h("div")(() => ({
|
|
714
|
+
display: "initial",
|
|
715
|
+
"&:not(.MathJax) table": { borderCollapse: "collapse" },
|
|
716
|
+
"&:not(.MathJax) table td, &:not(.MathJax) table th": {
|
|
717
|
+
padding: "8px 12px",
|
|
718
|
+
textAlign: "left"
|
|
719
|
+
}
|
|
720
|
+
})), Ue = class extends v.Component {
|
|
721
|
+
constructor(e) {
|
|
722
|
+
super(e), this.internalContainerRef = v.createRef();
|
|
723
|
+
}
|
|
724
|
+
static propTypes = {
|
|
725
|
+
renderChildren: S.default.func,
|
|
726
|
+
layout: S.default.object,
|
|
727
|
+
value: S.default.object,
|
|
728
|
+
onChange: S.default.func,
|
|
729
|
+
elementType: S.default.string,
|
|
730
|
+
containerRef: S.default.oneOfType([S.default.func, S.default.shape({ current: S.default.instanceOf(Element) })])
|
|
731
|
+
};
|
|
732
|
+
componentDidMount() {
|
|
733
|
+
let e = this.props.containerRef || this.internalContainerRef;
|
|
734
|
+
e.current && typeof l == "function" && l(e.current);
|
|
735
|
+
}
|
|
736
|
+
handleChange = (e, t) => {
|
|
737
|
+
let n = {
|
|
738
|
+
...this.props.value,
|
|
739
|
+
[e]: t
|
|
740
|
+
};
|
|
741
|
+
this.props.onChange(n);
|
|
742
|
+
};
|
|
743
|
+
render() {
|
|
744
|
+
let { value: e, layout: t, elementType: n, containerRef: r } = this.props, i = Ve(t, e, this.handleChange, this.props.renderChildren, null, n);
|
|
745
|
+
return /* @__PURE__ */ b(He, {
|
|
746
|
+
ref: r || this.internalContainerRef,
|
|
747
|
+
children: i
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
}, We = (e, t) => {
|
|
751
|
+
let { markup: n } = me(e, t);
|
|
752
|
+
return Fe(n).document;
|
|
753
|
+
}, Ge = (e, t) => class extends v.Component {
|
|
754
|
+
static propTypes = {
|
|
755
|
+
markup: S.default.string,
|
|
756
|
+
layout: S.default.object,
|
|
757
|
+
value: S.default.object,
|
|
758
|
+
onChange: S.default.func,
|
|
759
|
+
customMarkMarkupComponent: S.default.func,
|
|
760
|
+
elementType: S.default.string
|
|
761
|
+
};
|
|
762
|
+
constructor(e) {
|
|
763
|
+
super(e), this.containerRef = v.createRef();
|
|
764
|
+
}
|
|
765
|
+
componentDidUpdate(e) {
|
|
766
|
+
if (this.props.markup !== e.markup) {
|
|
767
|
+
let e = this.containerRef.current;
|
|
768
|
+
(e && e.querySelectorAll("[data-latex][data-math-handled=\"true\"]") || []).forEach((e) => {
|
|
769
|
+
let t = e.querySelector("mjx-container");
|
|
770
|
+
t && e.removeChild(t), e.innerHTML = e.getAttribute("data-raw"), e.removeAttribute("data-math-handled");
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
render() {
|
|
775
|
+
let { markup: n, layout: r, value: i, onChange: a, elementType: o } = this.props, s = r || We(n, e);
|
|
776
|
+
return /* @__PURE__ */ b(Ue, {
|
|
777
|
+
containerRef: this.containerRef,
|
|
778
|
+
elementType: o,
|
|
779
|
+
layout: s,
|
|
780
|
+
value: i,
|
|
781
|
+
onChange: a,
|
|
782
|
+
renderChildren: t(this.props)
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
//#endregion
|
|
787
|
+
//#region ../../lib-react/mask-markup/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js
|
|
788
|
+
function Ke(e) {
|
|
789
|
+
var t, n, r = "";
|
|
790
|
+
if (typeof e == "string" || typeof e == "number") r += e;
|
|
791
|
+
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
792
|
+
var i = e.length;
|
|
793
|
+
for (t = 0; t < i; t++) e[t] && (n = Ke(e[t])) && (r && (r += " "), r += n);
|
|
794
|
+
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
795
|
+
return r;
|
|
796
|
+
}
|
|
797
|
+
function qe() {
|
|
798
|
+
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = Ke(e)) && (r && (r += " "), r += t);
|
|
799
|
+
return r;
|
|
800
|
+
}
|
|
801
|
+
//#endregion
|
|
802
|
+
//#region ../../lib-react/mask-markup/dist/constructed-response.js
|
|
803
|
+
var Je = h(g)(() => ({
|
|
804
|
+
display: "inline-block",
|
|
805
|
+
verticalAlign: "middle",
|
|
806
|
+
margin: "4px",
|
|
807
|
+
borderRadius: "4px",
|
|
808
|
+
border: `1px solid ${s.black()}`,
|
|
809
|
+
"&.correct": { border: `1px solid ${s.correct()}` },
|
|
810
|
+
"&.incorrect": { border: `1px solid ${s.incorrect()}` }
|
|
811
|
+
})), Ye = Ge("input", (e) => (t, n) => {
|
|
812
|
+
let { adjustedLimit: r, disabled: i, feedback: a, showCorrectAnswer: o, maxLength: s, spellCheck: c, pluginProps: l, onChange: u } = e, d = t.data?.dataset || {};
|
|
813
|
+
if (d.component === "input") {
|
|
814
|
+
let f = (e.choices && d && e.choices[d.id] || [])[0], p = o ? f && f.label : n[d.id] || "", m = s && s[d.id], h = a && a[d.id], g = o || h === "correct", _ = !o && h === "incorrect";
|
|
815
|
+
return /* @__PURE__ */ b(Je, {
|
|
816
|
+
id: d.id,
|
|
817
|
+
disabled: o || i,
|
|
818
|
+
disableUnderline: !0,
|
|
819
|
+
onChange: (e) => {
|
|
820
|
+
let t = {
|
|
821
|
+
...n,
|
|
822
|
+
[d.id]: e
|
|
823
|
+
};
|
|
824
|
+
u(t);
|
|
825
|
+
},
|
|
826
|
+
markup: p || "",
|
|
827
|
+
charactersLimit: r ? m : 25,
|
|
828
|
+
activePlugins: ["languageCharacters"],
|
|
829
|
+
pluginProps: l,
|
|
830
|
+
languageCharactersProps: [{ language: "spanish" }],
|
|
831
|
+
spellCheck: c,
|
|
832
|
+
adjustWidthForLimit: !0,
|
|
833
|
+
onKeyDown: (e) => {
|
|
834
|
+
if (e.key === "Enter" || e.keyCode === 13) return !0;
|
|
835
|
+
},
|
|
836
|
+
autoWidthToolbar: !0,
|
|
837
|
+
toolbarOpts: {
|
|
838
|
+
minWidth: "auto",
|
|
839
|
+
noBorder: !0,
|
|
840
|
+
isHidden: !!l?.characters?.disabled
|
|
841
|
+
},
|
|
842
|
+
className: qe({
|
|
843
|
+
correct: g,
|
|
844
|
+
incorrect: _
|
|
845
|
+
})
|
|
846
|
+
}, `${t.type}-input-${d.id}`);
|
|
847
|
+
}
|
|
848
|
+
});
|
|
849
|
+
//#endregion
|
|
850
|
+
//#region src/delivery/main.tsx
|
|
851
|
+
function J(e) {
|
|
852
|
+
return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
|
|
853
|
+
}
|
|
854
|
+
function Y(e, t) {
|
|
855
|
+
return !e || J(e) ? e : J(e.default) ? e.default : t && J(e[t]) ? e[t] : t && J(e[t]?.default) ? e[t].default : e;
|
|
856
|
+
}
|
|
857
|
+
var Xe = Y(i, "UiLayout") || Y($.UiLayout, "UiLayout"), X = Y(c, "PreviewPrompt") || Y($.PreviewPrompt, "PreviewPrompt"), Z = Y(o, "Collapsible") || Y($.Collapsible, "Collapsible"), Ze = m, Q = Ze.default, $ = Q && typeof Q == "object" ? Q : Ze, { translator: Qe } = _, $e = h(Xe)(({ alwaysShowCorrect: e }) => ({
|
|
858
|
+
color: s.text(),
|
|
859
|
+
backgroundColor: s.background(),
|
|
860
|
+
...e && { "& *": { borderColor: `${s.text()} !important` } }
|
|
861
|
+
})), et = h("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), tt = h("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), nt = h("h2")({
|
|
862
|
+
position: "absolute",
|
|
863
|
+
left: "-10000px",
|
|
864
|
+
top: "auto",
|
|
865
|
+
width: "1px",
|
|
866
|
+
height: "1px",
|
|
867
|
+
overflow: "hidden"
|
|
868
|
+
}), rt = class extends v.Component {
|
|
869
|
+
static propTypes = {
|
|
870
|
+
alwaysShowCorrect: S.default.bool,
|
|
871
|
+
animationsDisabled: S.default.bool,
|
|
872
|
+
disabled: S.default.bool,
|
|
873
|
+
displayType: S.default.string,
|
|
874
|
+
feedback: S.default.object,
|
|
875
|
+
language: S.default.string,
|
|
876
|
+
markup: S.default.string,
|
|
877
|
+
maxLengthPerChoice: S.default.array,
|
|
878
|
+
maxLengthPerChoiceEnabled: S.default.bool,
|
|
879
|
+
mode: S.default.string,
|
|
880
|
+
note: S.default.string,
|
|
881
|
+
onChange: S.default.func,
|
|
882
|
+
playerSpellCheckEnabled: S.default.bool,
|
|
883
|
+
prompt: S.default.string,
|
|
884
|
+
rationale: S.default.string,
|
|
885
|
+
role: S.default.string,
|
|
886
|
+
showNote: S.default.bool,
|
|
887
|
+
teacherInstructions: S.default.string,
|
|
888
|
+
value: S.default.object,
|
|
889
|
+
responseAreaInputConfiguration: S.default.object,
|
|
890
|
+
model: S.default.object.isRequired
|
|
891
|
+
};
|
|
892
|
+
static defaultProps = { value: {} };
|
|
893
|
+
state = { showCorrectAnswer: this.props.alwaysShowCorrect || !1 };
|
|
894
|
+
UNSAFE_componentWillReceiveProps(e) {
|
|
895
|
+
let { language: t } = this.props, { note: r } = this.props;
|
|
896
|
+
n(e.feedback) && this.setState({ showCorrectAnswer: !1 }), e.alwaysShowCorrect && this.setState({ showCorrectAnswer: !0 }), r && t && t !== e.language && r === Qe.t("common:commonCorrectAnswerWithAlternates", { lng: t }) && (r = Qe.t("common:commonCorrectAnswerWithAlternates", { lng: e.language }));
|
|
897
|
+
}
|
|
898
|
+
toggleShowCorrect = () => {
|
|
899
|
+
this.setState({ showCorrectAnswer: !this.state.showCorrectAnswer });
|
|
900
|
+
};
|
|
901
|
+
onChange = (e) => {
|
|
902
|
+
this.props.onChange(e);
|
|
903
|
+
};
|
|
904
|
+
render() {
|
|
905
|
+
let { showCorrectAnswer: e } = this.state, { alwaysShowCorrect: t, animationsDisabled: n, mode: r, displayType: i, role: a, language: o, maxLengthPerChoice: s, maxLengthPerChoiceEnabled: c, note: l, playerSpellCheckEnabled: u, prompt: f, rationale: m, showNote: h, teacherInstructions: g, responseAreaInputConfiguration: _, model: v, value: y } = this.props, { extraCSSRules: S } = v || {}, C = (e || r === "view" && a === "instructor") && h && l, w = /* @__PURE__ */ b(X, {
|
|
906
|
+
defaultClassName: "teacher-instructions",
|
|
907
|
+
prompt: g
|
|
908
|
+
}), T = /* @__PURE__ */ b(X, { prompt: m }), E = m && (d(m) || p(m)), D = g && (d(g) || p(g));
|
|
909
|
+
return /* @__PURE__ */ x($e, {
|
|
910
|
+
extraCSSRules: S,
|
|
911
|
+
alwaysShowCorrect: t,
|
|
912
|
+
style: { display: `${i}` },
|
|
913
|
+
children: [
|
|
914
|
+
r === "gather" && /* @__PURE__ */ b(nt, { children: "Fill in the Blank Question" }),
|
|
915
|
+
D && /* @__PURE__ */ b(tt, { children: n ? w : /* @__PURE__ */ b(Z, {
|
|
916
|
+
labels: {
|
|
917
|
+
hidden: "Show Teacher Instructions",
|
|
918
|
+
visible: "Hide Teacher Instructions"
|
|
919
|
+
},
|
|
920
|
+
children: w
|
|
921
|
+
}) }),
|
|
922
|
+
f && /* @__PURE__ */ b(X, { prompt: f }),
|
|
923
|
+
!t && r === "evaluate" && /* @__PURE__ */ b(fe, {
|
|
924
|
+
show: !0,
|
|
925
|
+
toggled: e,
|
|
926
|
+
onToggle: this.toggleShowCorrect,
|
|
927
|
+
language: o
|
|
928
|
+
}),
|
|
929
|
+
/* @__PURE__ */ b(Ye, {
|
|
930
|
+
...this.props,
|
|
931
|
+
onChange: this.onChange,
|
|
932
|
+
showCorrectAnswer: e,
|
|
933
|
+
value: y,
|
|
934
|
+
maxLength: s,
|
|
935
|
+
adjustedLimit: c,
|
|
936
|
+
spellCheck: u,
|
|
937
|
+
pluginProps: _
|
|
938
|
+
}),
|
|
939
|
+
C && /* @__PURE__ */ b(et, { dangerouslySetInnerHTML: { __html: l } }),
|
|
940
|
+
E && /* @__PURE__ */ b(tt, { children: n ? T : /* @__PURE__ */ b(Z, {
|
|
941
|
+
labels: {
|
|
942
|
+
hidden: "Show Rationale",
|
|
943
|
+
visible: "Hide Rationale"
|
|
944
|
+
},
|
|
945
|
+
children: T
|
|
946
|
+
}) })
|
|
947
|
+
]
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
//#endregion
|
|
952
|
+
export { rt as t };
|
|
953
|
+
|
|
954
|
+
//# sourceMappingURL=main-Ot6cxLkg.js.map
|