@pie-element/extended-text-entry 15.1.2-next.11 → 15.1.2-next.13

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.
@@ -1,10 +1,60 @@
1
1
  import { a as e, t } from "../browser-kkT1XVKw.js";
2
- import { v as n } from "../dist-dyuok0rH.js";
3
- import { t as r } from "../main-KQeC5IX0.js";
2
+ import { v as n } from "../dist-BFhge1uy.js";
3
+ import { t as r } from "../main-B7xdPHnf.js";
4
4
  import i from "react";
5
5
  import { createRoot as a } from "react-dom/client";
6
6
  //#region ../../shared/player-events/dist/index.js
7
- var o = /* @__PURE__ */ e(t(), 1), s = class e extends CustomEvent {
7
+ var o = /* @__PURE__ */ e(t(), 1), s = "commitPendingSession", c = /* @__PURE__ */ new WeakMap();
8
+ function l(e, t) {
9
+ let n = c.get(e);
10
+ n || (n = /* @__PURE__ */ new Set(), c.set(e, n)), n.add(t);
11
+ }
12
+ function u(e) {
13
+ return Object.getOwnPropertyDescriptor(e, s) !== void 0;
14
+ }
15
+ function d(e) {
16
+ if (u(e)) return;
17
+ let t = e[s];
18
+ Object.defineProperty(e, s, {
19
+ value: () => {
20
+ if (typeof t == "function") try {
21
+ t.call(e);
22
+ } catch {}
23
+ p(e);
24
+ },
25
+ configurable: !0,
26
+ enumerable: !1,
27
+ writable: !0
28
+ });
29
+ }
30
+ function f(e, t, n = {}) {
31
+ let r = n.delayMs, i = typeof r == "function" ? r : () => r ?? 0, a = n.maxWaitMs, o = null, s = null, c = !1, u = () => {
32
+ o !== null && (clearTimeout(o), o = null), s !== null && (clearTimeout(s), s = null);
33
+ }, f = () => {
34
+ u(), c && (c = !1, t());
35
+ }, p = {
36
+ notify() {
37
+ c = !0, o !== null && clearTimeout(o), o = setTimeout(f, Math.max(0, i())), a !== void 0 && s === null && (s = setTimeout(f, Math.max(0, a)));
38
+ },
39
+ flush() {
40
+ if (!c) {
41
+ u();
42
+ return;
43
+ }
44
+ try {
45
+ f();
46
+ } catch (e) {
47
+ console.warn("[session-notifier] a committed session-changed dispatch threw", e);
48
+ }
49
+ }
50
+ };
51
+ return l(e, p), d(e), p;
52
+ }
53
+ function p(e) {
54
+ let t = c.get(e);
55
+ if (t) for (let e of [...t]) e.flush();
56
+ }
57
+ var m = class e extends CustomEvent {
8
58
  static {
9
59
  this.TYPE = "model-set";
10
60
  }
@@ -19,7 +69,7 @@ var o = /* @__PURE__ */ e(t(), 1), s = class e extends CustomEvent {
19
69
  }
20
70
  }), this.component = t, this.complete = n;
21
71
  }
22
- }, c = class e extends CustomEvent {
72
+ }, h = class e extends CustomEvent {
23
73
  static {
24
74
  this.TYPE = "session-changed";
25
75
  }
@@ -33,28 +83,32 @@ var o = /* @__PURE__ */ e(t(), 1), s = class e extends CustomEvent {
33
83
  }
34
84
  }), this.component = t, this.complete = n;
35
85
  }
36
- }, l = (0, o.default)("@pie-elements:extended-text-entry"), u = new DOMParser();
37
- function d(e) {
86
+ }, g = (0, o.default)("@pie-elements:extended-text-entry"), _ = 1500, v = new DOMParser();
87
+ function y(e) {
38
88
  if (typeof e == "string") try {
39
- return u.parseFromString(e, "text/html").body.textContent;
89
+ return v.parseFromString(e, "text/html").body.textContent;
40
90
  } catch {
41
- return l("tried to parse as dom and failed", e), e;
91
+ return g("tried to parse as dom and failed", e), e;
42
92
  }
43
93
  }
44
- function f(e) {
45
- let t = d(e);
94
+ function b(e) {
95
+ let t = y(e);
46
96
  return t !== void 0 && t.length > 0;
47
97
  }
48
- var p = class extends HTMLElement {
98
+ var x = class extends HTMLElement {
49
99
  constructor() {
50
- super(), this._model = null, this._session = null, this._root = null;
100
+ super(), this._model = null, this._session = null, this._root = null, this._valueNotifier = f(this, () => {
101
+ this.dispatchEvent(new h(this.tagName.toLowerCase(), b(this._session && this._session.value)));
102
+ }, { delayMs: _ }), this._commentNotifier = f(this, () => {
103
+ this.dispatchEvent(new h(this.tagName.toLowerCase(), b(this._session && this._session.comment)));
104
+ }, { delayMs: _ });
51
105
  }
52
106
  setLangAttribute() {
53
107
  let e = this._model && typeof this._model.language ? this._model.language : "", t = e ? e.slice(0, 2) : "en";
54
108
  this.setAttribute("lang", t);
55
109
  }
56
110
  set model(e) {
57
- this._model = e, this.dispatchEvent(new s(this.tagName.toLowerCase(), !1, !!this._model)), this.render();
111
+ this._model = e, this.dispatchEvent(new m(this.tagName.toLowerCase(), !1, !!this._model)), this.render();
58
112
  }
59
113
  set session(e) {
60
114
  this._session = e, this.render();
@@ -63,13 +117,13 @@ var p = class extends HTMLElement {
63
117
  return this._session;
64
118
  }
65
119
  valueChange(e) {
66
- this._session.value = e, this.dispatchEvent(new c(this.tagName.toLowerCase(), f(e))), this.render();
120
+ this._session.value = e, this._valueNotifier.notify(), this.render();
67
121
  }
68
122
  annotationsChange(e) {
69
- this._session.annotations = e, this.dispatchEvent(new c(this.tagName.toLowerCase(), !0)), this.render();
123
+ this._session.annotations = e, this.dispatchEvent(new h(this.tagName.toLowerCase(), !0)), this.render();
70
124
  }
71
125
  commentChange(e) {
72
- this._session.comment = e, this.dispatchEvent(new c(this.tagName.toLowerCase(), f(e))), this.render();
126
+ this._session.comment = e, this._commentNotifier.notify(), this.render();
73
127
  }
74
128
  connectedCallback() {
75
129
  this.setAttribute("aria-label", "Written Response Question"), this.setAttribute("role", "region"), this.render();
@@ -89,10 +143,10 @@ var p = class extends HTMLElement {
89
143
  }
90
144
  }
91
145
  disconnectedCallback() {
92
- this._root &&= (this._root.unmount(), null);
146
+ p(this), this._root &&= (this._root.unmount(), null);
93
147
  }
94
148
  };
95
149
  //#endregion
96
- export { p as default, f as isComplete, d as textContent };
150
+ export { x as default, b as isComplete, y as textContent };
97
151
 
98
152
  //# 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/extended-text-entry/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 Main from './main.js';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport debug from 'debug';\n\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-element/shared-player-events';\n\nconst log = debug('@pie-elements:extended-text-entry');\n\nconst domParser = typeof window !== undefined ? new DOMParser() : { parseFromString: (v) => v };\n\nexport function textContent(value) {\n if (typeof value !== 'string') {\n return undefined;\n }\n\n try {\n const document = domParser.parseFromString(value, 'text/html');\n const textContent = document.body.textContent;\n\n return textContent;\n } catch (err) {\n log('tried to parse as dom and failed', value);\n return value;\n }\n}\n\nexport function isComplete(value) {\n const tc = textContent(value);\n const out = tc !== undefined && tc.length > 0;\n\n return out;\n}\n\nexport default class RootExtendedTextEntry 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(new ModelSetEvent(this.tagName.toLowerCase(), false, !!this._model));\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 valueChange(value) {\n this._session.value = value;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(value)));\n\n this.render();\n }\n\n annotationsChange(annotations) {\n this._session.annotations = annotations;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), true));\n\n this.render();\n }\n\n commentChange(comment) {\n this._session.comment = comment;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(comment)));\n\n this.render();\n }\n\n connectedCallback() {\n this.setAttribute('aria-label', 'Written Response Question');\n this.setAttribute('role', 'region');\n\n this.render();\n }\n\n render() {\n if (this._model && this._session) {\n let elem = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onValueChange: this.valueChange.bind(this),\n onAnnotationsChange: this.annotationsChange.bind(this),\n onCommentChange: this.commentChange.bind(this),\n });\n\n this.setLangAttribute();\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 disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n this._root = null;\n }\n }\n}\n"],"mappings":";;;;;;mCACI,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,EA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BAAkB,GAAa;EAK7B,AAJA,KAAK,SAAS,cAAc,GAE5B,KAAK,cAAc,IAAI,EAAoB,KAAK,QAAQ,YAAY,GAAG,EAAI,CAAC,GAE5E,KAAK,OAAO;CACd;CAEA,cAAc,GAAS;EAKrB,AAJA,KAAK,SAAS,UAAU,GAExB,KAAK,cAAc,IAAI,EAAoB,KAAK,QAAQ,YAAY,GAAG,EAAW,CAAO,CAAC,CAAC,GAE3F,KAAK,OAAO;CACd;CAEA,oBAAoB;EAIlB,AAHA,KAAK,aAAa,cAAc,2BAA2B,GAC3D,KAAK,aAAa,QAAQ,QAAQ,GAElC,KAAK,OAAO;CACd;CAEA,SAAS;EACP,IAAI,KAAK,UAAU,KAAK,UAAU;GAChC,IAAI,IAAO,EAAM,cAAc,GAAM;IACnC,OAAO,KAAK;IACZ,SAAS,KAAK;IACd,eAAe,KAAK,YAAY,KAAK,IAAI;IACzC,qBAAqB,KAAK,kBAAkB,KAAK,IAAI;IACrD,iBAAiB,KAAK,cAAc,KAAK,IAAI;GAC/C,CAAC;GAQD,AANA,KAAK,iBAAiB,GAEtB,AACE,KAAK,UAAQ,EAAW,IAAI,GAE9B,KAAK,MAAM,OAAO,CAAI,GACtB,qBAAqB;IACnB,EAAW,IAAI;GACjB,CAAC;EACH;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/extended-text-entry/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 Main from './main.js';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport debug from 'debug';\n\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\nimport {\n ModelSetEvent,\n SessionChangedEvent,\n createSessionNotifier,\n flushSessionNotifiers,\n} from '@pie-element/shared-player-events';\n\nconst log = debug('@pie-elements:extended-text-entry');\n\n// Coalesce a burst of editor commits. The editor only calls back on blur and on\n// a `done` transaction, so this window is short-lived in practice.\nconst SESSION_NOTIFY_DELAY_MS = 1500;\n\nconst domParser = typeof window !== undefined ? new DOMParser() : { parseFromString: (v) => v };\n\nexport function textContent(value) {\n if (typeof value !== 'string') {\n return undefined;\n }\n\n try {\n const document = domParser.parseFromString(value, 'text/html');\n const textContent = document.body.textContent;\n\n return textContent;\n } catch (err) {\n log('tried to parse as dom and failed', value);\n return value;\n }\n}\n\nexport function isComplete(value) {\n const tc = textContent(value);\n const out = tc !== undefined && tc.length > 0;\n\n return out;\n}\n\nexport default class RootExtendedTextEntry 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; only the notification is\n // deferred, so a player reading `.session` always sees the committed\n // response. `disconnectedCallback` flushes what is still pending.\n this._valueNotifier = createSessionNotifier(\n this,\n () => {\n this.dispatchEvent(\n new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(this._session && this._session.value)),\n );\n },\n { delayMs: SESSION_NOTIFY_DELAY_MS },\n );\n\n this._commentNotifier = createSessionNotifier(\n this,\n () => {\n this.dispatchEvent(\n new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(this._session && this._session.comment)),\n );\n },\n { delayMs: 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(new ModelSetEvent(this.tagName.toLowerCase(), false, !!this._model));\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 valueChange(value) {\n this._session.value = value;\n\n this._valueNotifier.notify();\n\n this.render();\n }\n\n annotationsChange(annotations) {\n this._session.annotations = annotations;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), true));\n\n this.render();\n }\n\n commentChange(comment) {\n this._session.comment = comment;\n\n this._commentNotifier.notify();\n\n this.render();\n }\n\n connectedCallback() {\n this.setAttribute('aria-label', 'Written Response Question');\n this.setAttribute('role', 'region');\n\n this.render();\n }\n\n render() {\n if (this._model && this._session) {\n let elem = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onValueChange: this.valueChange.bind(this),\n onAnnotationsChange: this.annotationsChange.bind(this),\n onCommentChange: this.commentChange.bind(this),\n });\n\n this.setLangAttribute();\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 disconnectedCallback() {\n flushSessionNotifiers(this);\n\n if (this._root) {\n this._root.unmount();\n this._root = null;\n }\n }\n}\n"],"mappings":";;;;;;mCACI,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,y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