@pie-element/explicit-constructed-response 11.1.2-next.10 → 11.1.2-next.12
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/author/index.js +1 -1
- package/dist/browser/delivery/index.js +71 -11
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/{dist-Bf-VDZs4.js → dist-7r5IDQTj.js} +16 -5
- package/dist/browser/{dist-Bf-VDZs4.js.map → dist-7r5IDQTj.js.map} +1 -1
- package/dist/browser/{main-DfIrflzI.js → main-C3qOHwA5.js} +245 -247
- package/dist/browser/{main-DfIrflzI.js.map → main-C3qOHwA5.js.map} +1 -1
- package/dist/browser/print/index.js +2 -2
- package/dist/delivery/index.js +18 -8
- package/dist/delivery/main.d.ts +0 -2
- package/dist/delivery/main.js +36 -38
- package/dist/index.iife.js +100 -100
- package/module/print.js +18 -9
- package/module/print.js.map +1 -1
- package/package.json +8 -15
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { E as e, S as t, a as n, b as r, c as i, h as a, i as o, l as s, m as c, n as l, o as u, p as d, r as f, s as p, t as m, u as h, v as g } from "../browser-xPiwYICU.js";
|
|
2
|
-
import { $ as _, A as v, B as y, D as b, E as x, F as S, H as C, I as w, J as T, K as E, L as D, M as O, N as k, P as A, Q as j, R as M, S as N, T as P, U as F, V as ee, W as I, X as te, Y as ne, Z as re, a as ie, b as L, c as ae, d as oe, et as R, f as se, i as z, it as ce, j as le, k as ue, l as B, n as de, nt as fe, o as pe, p as me, q as V, r as he, rt as ge, s as _e, t as H, tt as U, u as ve, v as ye, w as be, x as xe, y as Se, z as Ce } from "../dist-
|
|
2
|
+
import { $ as _, A as v, B as y, D as b, E as x, F as S, H as C, I as w, J as T, K as E, L as D, M as O, N as k, P as A, Q as j, R as M, S as N, T as P, U as F, V as ee, W as I, X as te, Y as ne, Z as re, a as ie, b as L, c as ae, d as oe, et as R, f as se, i as z, it as ce, j as le, k as ue, l as B, n as de, nt as fe, o as pe, p as me, q as V, r as he, rt as ge, s as _e, t as H, tt as U, u as ve, v as ye, w as be, x as xe, y as Se, z as Ce } from "../dist-7r5IDQTj.js";
|
|
3
3
|
import * as W from "react";
|
|
4
4
|
import G, { Component as we, createElement as Te } from "react";
|
|
5
5
|
import { createRoot as Ee } from "react-dom/client";
|
|
@@ -1,9 +1,59 @@
|
|
|
1
|
-
import { at as e } from "../dist-
|
|
2
|
-
import { t } from "../main-
|
|
1
|
+
import { at as e } from "../dist-7r5IDQTj.js";
|
|
2
|
+
import { t } from "../main-C3qOHwA5.js";
|
|
3
3
|
import n from "react";
|
|
4
4
|
import { createRoot as r } from "react-dom/client";
|
|
5
5
|
//#region ../../shared/player-events/dist/index.js
|
|
6
|
-
var i =
|
|
6
|
+
var i = "commitPendingSession", a = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
function o(e, t) {
|
|
8
|
+
let n = a.get(e);
|
|
9
|
+
n || (n = /* @__PURE__ */ new Set(), a.set(e, n)), n.add(t);
|
|
10
|
+
}
|
|
11
|
+
function s(e) {
|
|
12
|
+
return Object.getOwnPropertyDescriptor(e, i) !== void 0;
|
|
13
|
+
}
|
|
14
|
+
function c(e) {
|
|
15
|
+
if (s(e)) return;
|
|
16
|
+
let t = e[i];
|
|
17
|
+
Object.defineProperty(e, i, {
|
|
18
|
+
value: () => {
|
|
19
|
+
if (typeof t == "function") try {
|
|
20
|
+
t.call(e);
|
|
21
|
+
} catch {}
|
|
22
|
+
u(e);
|
|
23
|
+
},
|
|
24
|
+
configurable: !0,
|
|
25
|
+
enumerable: !1,
|
|
26
|
+
writable: !0
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function l(e, t, n = {}) {
|
|
30
|
+
let r = n.delayMs, i = typeof r == "function" ? r : () => r ?? 0, a = n.maxWaitMs, s = null, l = null, u = !1, d = () => {
|
|
31
|
+
s !== null && (clearTimeout(s), s = null), l !== null && (clearTimeout(l), l = null);
|
|
32
|
+
}, f = () => {
|
|
33
|
+
d(), u && (u = !1, t());
|
|
34
|
+
}, p = {
|
|
35
|
+
notify() {
|
|
36
|
+
u = !0, s !== null && clearTimeout(s), s = setTimeout(f, Math.max(0, i())), a !== void 0 && l === null && (l = setTimeout(f, Math.max(0, a)));
|
|
37
|
+
},
|
|
38
|
+
flush() {
|
|
39
|
+
if (!u) {
|
|
40
|
+
d();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
f();
|
|
45
|
+
} catch (e) {
|
|
46
|
+
console.warn("[session-notifier] a committed session-changed dispatch threw", e);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
return o(e, p), c(e), p;
|
|
51
|
+
}
|
|
52
|
+
function u(e) {
|
|
53
|
+
let t = a.get(e);
|
|
54
|
+
if (t) for (let e of [...t]) e.flush();
|
|
55
|
+
}
|
|
56
|
+
var d = class e extends CustomEvent {
|
|
7
57
|
static {
|
|
8
58
|
this.TYPE = "model-set";
|
|
9
59
|
}
|
|
@@ -18,7 +68,7 @@ var i = class e extends CustomEvent {
|
|
|
18
68
|
}
|
|
19
69
|
}), this.component = t, this.complete = n;
|
|
20
70
|
}
|
|
21
|
-
},
|
|
71
|
+
}, f = class e extends CustomEvent {
|
|
22
72
|
static {
|
|
23
73
|
this.TYPE = "session-changed";
|
|
24
74
|
}
|
|
@@ -32,16 +82,26 @@ var i = class e extends CustomEvent {
|
|
|
32
82
|
}
|
|
33
83
|
}), this.component = t, this.complete = n;
|
|
34
84
|
}
|
|
35
|
-
},
|
|
85
|
+
}, p = 200;
|
|
86
|
+
function m(e) {
|
|
87
|
+
let t = e && e.maxLengthPerChoice;
|
|
88
|
+
return Array.isArray(t) && t.length > 0 && t.every((e) => e === 1) ? 0 : p;
|
|
89
|
+
}
|
|
90
|
+
var h = class extends HTMLElement {
|
|
36
91
|
constructor() {
|
|
37
|
-
super(), this._model = null, this._session = null, this._root = null
|
|
92
|
+
super(), this._model = null, this._session = null, this._root = null, this._sessionNotifier = l(this, () => {
|
|
93
|
+
this.dispatchChangedEvent(), this._render();
|
|
94
|
+
}, {
|
|
95
|
+
delayMs: () => m(this._model),
|
|
96
|
+
maxWaitMs: p
|
|
97
|
+
});
|
|
38
98
|
}
|
|
39
99
|
setLangAttribute() {
|
|
40
100
|
let e = this._model && typeof this._model.language ? this._model.language : "", t = e ? e.slice(0, 2) : "en";
|
|
41
101
|
this.setAttribute("lang", t);
|
|
42
102
|
}
|
|
43
103
|
set model(e) {
|
|
44
|
-
this._model = e, this.dispatchEvent(new
|
|
104
|
+
this._model = e, this.dispatchEvent(new d(this.tagName.toLowerCase(), this.session && !!this.session.value, !!this._model)), this.setLangAttribute(), this._render();
|
|
45
105
|
}
|
|
46
106
|
set session(e) {
|
|
47
107
|
this._session = e, this._render();
|
|
@@ -78,19 +138,19 @@ var i = class e extends CustomEvent {
|
|
|
78
138
|
}
|
|
79
139
|
};
|
|
80
140
|
dispatchChangedEvent = () => {
|
|
81
|
-
this.dispatchEvent(new
|
|
141
|
+
this.dispatchEvent(new f(this.tagName.toLowerCase(), this.session && !!this.session.value));
|
|
82
142
|
};
|
|
83
143
|
changeSession = (e) => {
|
|
84
|
-
this.session.value = e, this.
|
|
144
|
+
this.session.value = e, this._sessionNotifier.notify();
|
|
85
145
|
};
|
|
86
146
|
connectedCallback() {
|
|
87
147
|
this.setAttribute("aria-label", "Fill in the Blank Question"), this.setAttribute("role", "region"), this._render();
|
|
88
148
|
}
|
|
89
149
|
disconnectedCallback() {
|
|
90
|
-
this._root &&= (this._root.unmount(), null);
|
|
150
|
+
u(this), this._root &&= (this._root.unmount(), null);
|
|
91
151
|
}
|
|
92
152
|
};
|
|
93
153
|
//#endregion
|
|
94
|
-
export {
|
|
154
|
+
export { h as default };
|
|
95
155
|
|
|
96
156
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../../shared/player-events/dist/index.js","../../../src/delivery/index.ts"],"sourcesContent":["//#region src/index.ts\nvar e = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"model-set\";\n\t}\n\tconstructor(t, n, r) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t,\n\t\t\t\thasModel: r\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n}, t = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"session-changed\";\n\t}\n\tconstructor(t, n) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n};\n//#endregion\nexport { e as ModelSetEvent, t as SessionChangedEvent };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/explicit-constructed-response/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-element/shared-player-events';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\n\nimport Main from './main.js';\n\nexport default class InlineDropdown extends HTMLElement {\n constructor() {\n super();\n this._model = null;\n this._session = null;\n this._root = null;\n }\n\n setLangAttribute() {\n const language = this._model && typeof this._model.language ? this._model.language : '';\n const lang = language ? language.slice(0, 2) : 'en';\n this.setAttribute('lang', lang);\n }\n\n set model(m) {\n this._model = m;\n this.dispatchEvent(\n new ModelSetEvent(this.tagName.toLowerCase(), this.session && !!this.session.value, !!this._model),\n );\n this.setLangAttribute();\n\n this._render();\n }\n\n set session(s) {\n this._session = s;\n this._render();\n }\n\n get session() {\n return this._session;\n }\n\n _render: any = () => {\n if (this._model && this._session) {\n let elem = React.createElement(Main, {\n choices: this._model.choices,\n disabled: this._model.disabled,\n displayType: this._model.displayType,\n feedback: this._model.feedback,\n language: this._model.language,\n markup: this._model.markup,\n maxLengthPerChoice: this._model.maxLengthPerChoice,\n maxLengthPerChoiceEnabled: this._model.maxLengthPerChoiceEnabled,\n mode: this._model.mode,\n note: this._model.note,\n onChange: this.changeSession,\n playerSpellCheckEnabled: this._model.playerSpellCheckEnabled,\n prompt: this._model.prompt,\n rationale: this._model.rationale,\n role: this._model.role,\n showNote: this._model.showNote,\n teacherInstructions: this._model.teacherInstructions,\n value: this._session.value,\n responseAreaInputConfiguration: this._model.responseAreaInputConfiguration,\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(elem);\n queueMicrotask(() => {\n renderMath(this);\n });\n }\n };\n\n dispatchChangedEvent: any = () => {\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.session && !!this.session.value));\n };\n\n changeSession: any = (value) => {\n this.session.value = value;\n this.dispatchChangedEvent();\n this._render();\n };\n\n connectedCallback() {\n this.setAttribute('aria-label', 'Fill in the Blank Question');\n this.setAttribute('role', 'region');\n\n this._render();\n }\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n this._root = null;\n }\n }\n}\n"],"mappings":";;;;;AACA,IAAI,IAAI,MAAM,UAAU,YAAY;CACnC;EACC,KAAK,OAAO;CACb;CACA,YAAY,GAAG,GAAG,GAAG;EACpB,MAAM,EAAE,MAAM;GACb,SAAS,CAAC;GACV,UAAU,CAAC;GACX,QAAQ;IACP,UAAU;IACV,WAAW;IACX,UAAU;GACX;EACD,CAAC,GAAG,KAAK,YAAY,GAAG,KAAK,WAAW;CACzC;AACD,GAAG,IAAI,MAAM,UAAU,YAAY;CAClC;EACC,KAAK,OAAO;CACb;CACA,YAAY,GAAG,GAAG;EACjB,MAAM,EAAE,MAAM;GACb,SAAS,CAAC;GACV,UAAU,CAAC;GACX,QAAQ;I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rB,gCAAgC,KAAK,OAAO;GAC9C,CAAC;GAMD,AAJA,AACE,KAAK,UAAQ,EAAW,IAAI,GAE9B,KAAK,MAAM,OAAO,CAAI,GACtB,qBAAqB;IACnB,EAAW,IAAI;GACjB,CAAC;EACH;CACF;CAEA,6BAAkC;EAChC,KAAK,cAAc,IAAI,EAAoB,KAAK,QAAQ,YAAY,GAAG,KAAK,WAAW,CAAC,CAAC,KAAK,QAAQ,KAAK,CAAC;CAC9G;CAEA,iBAAsB,MAAU;EAG9B,AAFA,KAAK,QAAQ,QAAQ,GACrB,KAAK,qBAAqB,GAC1B,KAAK,QAAQ;CACf;CAEA,oBAAoB;EAIlB,AAHA,KAAK,aAAa,cAAc,4BAA4B,GAC5D,KAAK,aAAa,QAAQ,QAAQ,GAElC,KAAK,QAAQ;CACf;CAEA,uBAAuB;EACrB,AAEE,KAAK,WADL,KAAK,MAAM,QAAQ,GACN;CAEjB;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../shared/player-events/dist/index.js","../../../src/delivery/index.ts"],"sourcesContent":["//#region src/session-notifier.ts\nvar e = \"commitPendingSession\", t = /* @__PURE__ */ new WeakMap();\nfunction n(e, n) {\n\tlet r = t.get(e);\n\tr || (r = /* @__PURE__ */ new Set(), t.set(e, r)), r.add(n);\n}\nfunction r(t) {\n\treturn Object.getOwnPropertyDescriptor(t, e) !== void 0;\n}\nfunction i(t) {\n\tif (r(t)) return;\n\tlet n = t[e];\n\tObject.defineProperty(t, e, {\n\t\tvalue: () => {\n\t\t\tif (typeof n == \"function\") try {\n\t\t\t\tn.call(t);\n\t\t\t} catch {}\n\t\t\to(t);\n\t\t},\n\t\tconfigurable: !0,\n\t\tenumerable: !1,\n\t\twritable: !0\n\t});\n}\nfunction a(e, t, r = {}) {\n\tlet a = r.delayMs, o = typeof a == \"function\" ? a : () => a ?? 0, s = r.maxWaitMs, c = null, l = null, u = !1, d = () => {\n\t\tc !== null && (clearTimeout(c), c = null), l !== null && (clearTimeout(l), l = null);\n\t}, f = () => {\n\t\td(), u && (u = !1, t());\n\t}, p = {\n\t\tnotify() {\n\t\t\tu = !0, c !== null && clearTimeout(c), c = setTimeout(f, Math.max(0, o())), s !== void 0 && l === null && (l = setTimeout(f, Math.max(0, s)));\n\t\t},\n\t\tflush() {\n\t\t\tif (!u) {\n\t\t\t\td();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tf();\n\t\t\t} catch (e) {\n\t\t\t\tconsole.warn(\"[session-notifier] a committed session-changed dispatch threw\", e);\n\t\t\t}\n\t\t}\n\t};\n\treturn n(e, p), i(e), p;\n}\nfunction o(e) {\n\tlet n = t.get(e);\n\tif (n) for (let e of [...n]) e.flush();\n}\n//#endregion\n//#region src/index.ts\nvar s = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"model-set\";\n\t}\n\tconstructor(t, n, r) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t,\n\t\t\t\thasModel: r\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n}, c = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"session-changed\";\n\t}\n\tconstructor(t, n) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n};\n//#endregion\nexport { s as ModelSetEvent, e as SESSION_COMMIT_METHOD, c as SessionChangedEvent, a as createSessionNotifier, o as flushSessionNotifiers };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/explicit-constructed-response/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport {\n ModelSetEvent,\n SessionChangedEvent,\n createSessionNotifier,\n flushSessionNotifiers,\n} from '@pie-element/shared-player-events';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\n\nimport Main from './main.js';\n\nconst SESSION_NOTIFY_DELAY_MS = 200;\n\n// Every blank capped at one character means each keystroke is a whole response,\n// so there is nothing to coalesce and the dispatch goes out on the next tick.\nfunction notifyDelayForModel(model) {\n const lengths = model && model.maxLengthPerChoice;\n const singleCharacterBlanks =\n Array.isArray(lengths) && lengths.length > 0 && lengths.every((length) => length === 1);\n return singleCharacterBlanks ? 0 : SESSION_NOTIFY_DELAY_MS;\n}\n\nexport default class InlineDropdown extends HTMLElement {\n constructor() {\n super();\n this._model = null;\n this._session = null;\n this._root = null;\n\n // The session is written synchronously on commit; the dispatch and the\n // re-render are what get coalesced, which keeps the render cadence the\n // value-path debounce used to set while leaving `.session` readable at any\n // point. `disconnectedCallback` flushes what is still pending.\n this._sessionNotifier = createSessionNotifier(\n this,\n () => {\n this.dispatchChangedEvent();\n this._render();\n },\n { delayMs: () => notifyDelayForModel(this._model), maxWaitMs: SESSION_NOTIFY_DELAY_MS },\n );\n }\n\n setLangAttribute() {\n const language = this._model && typeof this._model.language ? this._model.language : '';\n const lang = language ? language.slice(0, 2) : 'en';\n this.setAttribute('lang', lang);\n }\n\n set model(m) {\n this._model = m;\n this.dispatchEvent(\n new ModelSetEvent(this.tagName.toLowerCase(), this.session && !!this.session.value, !!this._model),\n );\n this.setLangAttribute();\n\n this._render();\n }\n\n set session(s) {\n this._session = s;\n this._render();\n }\n\n get session() {\n return this._session;\n }\n\n _render: any = () => {\n if (this._model && this._session) {\n let elem = React.createElement(Main, {\n choices: this._model.choices,\n disabled: this._model.disabled,\n displayType: this._model.displayType,\n feedback: this._model.feedback,\n language: this._model.language,\n markup: this._model.markup,\n maxLengthPerChoice: this._model.maxLengthPerChoice,\n maxLengthPerChoiceEnabled: this._model.maxLengthPerChoiceEnabled,\n mode: this._model.mode,\n note: this._model.note,\n onChange: this.changeSession,\n playerSpellCheckEnabled: this._model.playerSpellCheckEnabled,\n prompt: this._model.prompt,\n rationale: this._model.rationale,\n role: this._model.role,\n showNote: this._model.showNote,\n teacherInstructions: this._model.teacherInstructions,\n value: this._session.value,\n responseAreaInputConfiguration: this._model.responseAreaInputConfiguration,\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(elem);\n queueMicrotask(() => {\n renderMath(this);\n });\n }\n };\n\n dispatchChangedEvent: any = () => {\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), this.session && !!this.session.value));\n };\n\n changeSession: any = (value) => {\n this.session.value = value;\n this._sessionNotifier.notify();\n };\n\n connectedCallback() {\n this.setAttribute('aria-label', 'Fill in the Blank Question');\n this.setAttribute('role', 'region');\n\n this._render();\n }\n\n disconnectedCallback() {\n flushSessionNotifiers(this);\n\n if (this._root) {\n this._root.unmount();\n this._root = null;\n }\n }\n}\n"],"mappings":";;;;;AACA,IAAI,IAAI,wBAAwB,oBAAoB,IAAI,QAAQ;AAChE,SAAS,EAAE,GAAG,GAAG;CAChB,IAAI,IAAI,EAAE,IAAI,CAAC;CACf,MAAM,oBAAoB,IAAI,IAAI,GAAG,EAAE,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC;AAC3D;AACA,SAAS,EAAE,GAAG;CACb,OAAO,OAAO,yBAAyB,GAAG,CAAC,MAAM,KAAK;AACvD;AACA,SAAS,EAAE,GAAG;CACb,IAAI,EAAE,CAAC,GAAG;CACV,IAAI,IAAI,EAAE;CACV,OAAO,eAAe,GAAG,GAAG;EAC3B,aAAa;GACZ,IAAI,OAAO,KAAK,YAAY,IAAI;IAC/B,EAAE,KAAK,CAAC;GACT,QAAQ,CAAC;GACT,EAAE,CAAC;EACJ;EACA,cAAc,CAAC;EACf,YAAY,CAAC;EACb,UAAU,CAAC;CACZ,CAAC;AACF;AACA,SAAS,EA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tB,aAAa,KAAK,OAAO;IACzB,UAAU,KAAK,OAAO;IACtB,UAAU,KAAK,OAAO;IACtB,QAAQ,KAAK,OAAO;IACpB,oBAAoB,KAAK,OAAO;IAChC,2BAA2B,KAAK,OAAO;IACvC,MAAM,KAAK,OAAO;IAClB,MAAM,KAAK,OAAO;IAClB,UAAU,KAAK;IACf,yBAAyB,KAAK,OAAO;IACrC,QAAQ,KAAK,OAAO;IACpB,WAAW,KAAK,OAAO;IACvB,MAAM,KAAK,OAAO;IAClB,UAAU,KAAK,OAAO;IACtB,qBAAqB,KAAK,OAAO;IACjC,OAAO,KAAK,SAAS;IACrB,gCAAgC,KAAK,OAAO;GAC9C,CAAC;GAMD,AAJA,AACE,KAAK,UAAQ,EAAW,IAAI,GAE9B,KAAK,MAAM,OAAO,CAAI,GACtB,qBAAqB;IACnB,EAAW,IAAI;GACjB,CAAC;EACH;CACF;CAEA,6BAAkC;EAChC,KAAK,cAAc,IAAI,EAAoB,KAAK,QAAQ,YAAY,GAAG,KAAK,WAAW,CAAC,CAAC,KAAK,QAAQ,KAAK,CAAC;CAC9G;CAEA,iBAAsB,MAAU;EAE9B,AADA,KAAK,QAAQ,QAAQ,GACrB,KAAK,iBAAiB,OAAO;CAC/B;CAEA,oBAAoB;EAIlB,AAHA,KAAK,aAAa,cAAc,4BAA4B,GAC5D,KAAK,aAAa,QAAQ,QAAQ,GAElC,KAAK,QAAQ;CACf;CAEA,uBAAuB;EAGrB,AAFA,EAAsB,IAAI,GAE1B,AAEE,KAAK,WADL,KAAK,MAAM,QAAQ,GACN;CAEjB;AACF"}
|
|
@@ -41490,6 +41490,8 @@ var gZ = (e) => {
|
|
|
41490
41490
|
classes: t
|
|
41491
41491
|
}) });
|
|
41492
41492
|
}, _Z = P("div")(() => ({
|
|
41493
|
+
height: 0,
|
|
41494
|
+
overflow: "visible",
|
|
41493
41495
|
"& .defaultToolbar": {
|
|
41494
41496
|
display: "flex",
|
|
41495
41497
|
width: "100%",
|
|
@@ -41525,13 +41527,14 @@ var gZ = (e) => {
|
|
|
41525
41527
|
color: "var(--white)"
|
|
41526
41528
|
},
|
|
41527
41529
|
"& .toolbar": {
|
|
41528
|
-
position: "
|
|
41530
|
+
position: "relative",
|
|
41531
|
+
top: "5px",
|
|
41529
41532
|
zIndex: 20,
|
|
41530
41533
|
cursor: "pointer",
|
|
41531
41534
|
justifyContent: "space-between",
|
|
41532
41535
|
background: "var(--editable-html-toolbar-bg, #efefef)",
|
|
41533
41536
|
minWidth: "280px",
|
|
41534
|
-
margin:
|
|
41537
|
+
margin: 0,
|
|
41535
41538
|
padding: "2px",
|
|
41536
41539
|
boxShadow: "0px 1px 5px 0px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 3px 1px -2px rgba(0, 0, 0, 0.12)",
|
|
41537
41540
|
boxSizing: "border-box",
|
|
@@ -41540,7 +41543,10 @@ var gZ = (e) => {
|
|
|
41540
41543
|
pointerEvents: "none"
|
|
41541
41544
|
},
|
|
41542
41545
|
"& .toolbarWithNoDone": { minWidth: "265px" },
|
|
41543
|
-
"& .toolbarTop": {
|
|
41546
|
+
"& .toolbarTop": {
|
|
41547
|
+
position: "absolute",
|
|
41548
|
+
top: "-45px"
|
|
41549
|
+
},
|
|
41544
41550
|
"& .toolbarRight": { right: 0 },
|
|
41545
41551
|
"& .fullWidth": { width: "100%" },
|
|
41546
41552
|
"& .hidden": { visibility: "hidden" },
|
|
@@ -48212,6 +48218,8 @@ var n8 = fO.create({
|
|
|
48212
48218
|
"--red-light": "#ffebe5",
|
|
48213
48219
|
"--shadow": "0px 12px 33px 0px rgba(0, 0, 0, .06),\n 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)"
|
|
48214
48220
|
}, f8 = (e) => ({
|
|
48221
|
+
role: "textbox",
|
|
48222
|
+
"data-pie-editor": "true",
|
|
48215
48223
|
spellcheck: e ? "true" : "false",
|
|
48216
48224
|
autocorrect: e ? "on" : "off",
|
|
48217
48225
|
autocapitalize: e ? "on" : "off"
|
|
@@ -48378,7 +48386,10 @@ var n8 = fO.create({
|
|
|
48378
48386
|
g?.setEditable(!e.disabled);
|
|
48379
48387
|
}, [e.disabled, g]), D(() => {
|
|
48380
48388
|
if (!g) return;
|
|
48381
|
-
let e = g.options?.editorProps, t =
|
|
48389
|
+
let e = g.options?.editorProps, t = {
|
|
48390
|
+
...e?.attributes,
|
|
48391
|
+
...f8(h)
|
|
48392
|
+
};
|
|
48382
48393
|
e?.attributes?.spellcheck !== t.spellcheck && g.setOptions({ editorProps: {
|
|
48383
48394
|
...e,
|
|
48384
48395
|
attributes: t
|
|
@@ -48455,4 +48466,4 @@ var n8 = fO.create({
|
|
|
48455
48466
|
//#endregion
|
|
48456
48467
|
export { sa as $, ld as A, zl as B, Hf as C, Bd as D, rf as E, Lu as F, js as G, Rl as H, Ou as I, rs as J, ds as K, Su as L, od as M, rd as N, zd as O, L as P, Ha as Q, Yl as R, Kf as S, cf as T, El as U, Ll as V, pc as W, $o as X, ts as Y, Ga as Z, yp as _, AG as a, he as at, Jf as b, $U as c, LF as d, xi as et, _h as f, bp as g, wp as h, GK as i, ye as it, cd as j, dd as k, iU as l, Ep as m, GX as n, M as nt, DW as o, Xp as p, P as q, XK as r, Pn as rt, SW as s, h8 as t, bi as tt, HF as u, mp as v, Mf as w, qf as x, ip as y, Gl as z };
|
|
48457
48468
|
|
|
48458
|
-
//# sourceMappingURL=dist-
|
|
48469
|
+
//# sourceMappingURL=dist-7r5IDQTj.js.map
|