@pie-element/extended-text-entry 15.1.2-next.4 → 15.1.2-next.6

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,9 +1,9 @@
1
1
  import { a as e, t } from "./browser-kkT1XVKw.js";
2
- import { _ as n, a as r, b as i, c as a, f as o, g as s, l as c, m as l, o as u, p as d, s as f, t as p, u as m, v as h } from "./dist-Cv1iX7rJ.js";
2
+ import { A as n, F as r, K as i, S as a, Y as o, _ as s, a as c, g as l, l as u, n as d, t as f, u as p, x as m, y as h } from "./dist-BbUdUT_D.js";
3
3
  import g from "react";
4
4
  import { jsx as _, jsxs as v } from "react/jsx-runtime";
5
5
  //#region src/delivery/annotation/annotation-utils.ts
6
- var y = /* @__PURE__ */ e(i(), 1), b = /* @__PURE__ */ e(t(), 1), x = (e, t, n) => {
6
+ var y = /* @__PURE__ */ e(o(), 1), b = /* @__PURE__ */ e(t(), 1), x = (e, t, n) => {
7
7
  let r = n || [], i = r.reduce((e, t) => e + t.textContent.length, 0), a = !0;
8
8
  if (i > t) return !1;
9
9
  for (e &&= (e.nodeType === 3 && e.parentNode && !e.parentNode.hasAttribute("data-ann-id") && r.push(e), e.firstChild); e && a;) a = x(e, t, r), e = e.nextSibling;
@@ -64,7 +64,7 @@ var y = /* @__PURE__ */ e(i(), 1), b = /* @__PURE__ */ e(t(), 1), x = (e, t, n)
64
64
  }), t.normalize();
65
65
  }, O = () => {
66
66
  document.getSelection ? (document.getSelection().removeAllRanges(), document.getSelection().addRange(document.createRange())) : window.getSelection ? window.getSelection().removeAllRanges ? (window.getSelection().removeAllRanges(), window.getSelection().addRange(document.createRange())) : window.getSelection().empty && window.getSelection().empty() : document.selection && document.selection.empty();
67
- }, k = (e) => e.length >= 20 || e.search(/\n|\r|\r\n/) !== -1, A = (e) => Array.from(document.querySelectorAll(`[data-id='${e}']`)), j = (e) => document.querySelector(`[data-ann-id='${e}']`), M = n(o)(({ theme: e, annotationType: t }) => ({ "& .MuiPaper-root": {
67
+ }, k = (e) => e.length >= 20 || e.search(/\n|\r|\r\n/) !== -1, A = (e) => Array.from(document.querySelectorAll(`[data-id='${e}']`)), j = (e) => document.querySelector(`[data-ann-id='${e}']`), M = r(h)(({ annotationType: e }) => ({ "& .MuiPaper-root": {
68
68
  overflowX: "unset",
69
69
  overflowY: "unset",
70
70
  marginLeft: "16px",
@@ -78,40 +78,40 @@ var y = /* @__PURE__ */ e(i(), 1), b = /* @__PURE__ */ e(t(), 1), x = (e, t, n)
78
78
  width: 0,
79
79
  pointerEvents: "none",
80
80
  borderWidth: "7px",
81
- borderRightColor: e.palette.grey[100]
81
+ borderRightColor: a.border()
82
82
  },
83
- ...t === "negative" && { "&::before": { borderRightColor: "rgb(255, 204, 238) !important" } },
84
- ...t === "positive" && { "&::before": { borderRightColor: "rgb(153, 255, 153) !important" } }
85
- } })), N = n("div")(({ theme: e, annotationType: t }) => ({
83
+ ...e === "negative" && { "&::before": { borderRightColor: "rgb(255, 204, 238) !important" } },
84
+ ...e === "positive" && { "&::before": { borderRightColor: "rgb(153, 255, 153) !important" } }
85
+ } })), N = r("div")(({ annotationType: e }) => ({
86
86
  width: "200px",
87
87
  overflow: "hidden",
88
88
  borderRadius: "4px",
89
- backgroundColor: "#ffffff",
90
- border: `4px solid ${e.palette.grey[100]}`,
91
- ...t === "negative" && { borderColor: "rgb(255, 204, 238) !important" },
92
- ...t === "positive" && { borderColor: "rgb(153, 255, 153) !important" }
93
- })), P = n("div")(({ theme: e }) => ({
89
+ backgroundColor: a.white(),
90
+ border: `4px solid ${a.border()}`,
91
+ ...e === "negative" && { borderColor: "rgb(255, 204, 238) !important" },
92
+ ...e === "positive" && { borderColor: "rgb(153, 255, 153) !important" }
93
+ })), P = r("div")(() => ({
94
94
  display: "flex",
95
95
  flexWrap: "wrap",
96
- borderTop: `2px solid ${e.palette.grey[100]}`
97
- })), F = n("div")(({ theme: e, variant: t, annotationType: n }) => ({
96
+ borderTop: `2px solid ${a.border()}`
97
+ })), F = r("div")(({ variant: e, annotationType: t }) => ({
98
98
  flexGrow: 1,
99
99
  width: "28%",
100
100
  textAlign: "center",
101
101
  padding: "4px",
102
102
  cursor: "pointer",
103
- "&:not(:nth-child(3n))": { borderRight: `1px solid ${e.palette.grey[100]}` },
104
- "&:hover": { backgroundColor: e.palette.grey[100] },
105
- ...t === "positive" && {
103
+ "&:not(:nth-child(3n))": { borderRight: `1px solid ${a.border()}` },
104
+ "&:hover": { backgroundColor: a.backgroundDark() },
105
+ ...e === "positive" && {
106
106
  backgroundColor: "rgb(153, 255, 153) !important",
107
107
  "&:hover": { filter: "brightness(85%)" }
108
108
  },
109
- ...t === "negative" && {
109
+ ...e === "negative" && {
110
110
  backgroundColor: "rgb(255, 204, 238) !important",
111
111
  "&:hover": { filter: "brightness(85%)" }
112
112
  },
113
- ...t === "typeChange" && n === "negative" && { "&:hover": { backgroundColor: "rgb(153, 255, 153) !important" } },
114
- ...t === "typeChange" && n === "positive" && { "&:hover": { backgroundColor: "rgb(255, 204, 238) !important" } }
113
+ ...e === "typeChange" && t === "negative" && { "&:hover": { backgroundColor: "rgb(153, 255, 153) !important" } },
114
+ ...e === "typeChange" && t === "positive" && { "&:hover": { backgroundColor: "rgb(255, 204, 238) !important" } }
115
115
  })), I = class extends g.Component {
116
116
  static propTypes = {
117
117
  anchorEl: y.default.object,
@@ -166,7 +166,7 @@ var y = /* @__PURE__ */ e(i(), 1), b = /* @__PURE__ */ e(t(), 1), x = (e, t, n)
166
166
  },
167
167
  children: /* @__PURE__ */ v(N, {
168
168
  annotationType: i,
169
- children: [/* @__PURE__ */ _(u, {
169
+ children: [/* @__PURE__ */ _(c, {
170
170
  id: "annotation-editor",
171
171
  style: {
172
172
  padding: "2px 5px",
@@ -198,7 +198,7 @@ var y = /* @__PURE__ */ e(i(), 1), b = /* @__PURE__ */ e(t(), 1), x = (e, t, n)
198
198
  })
199
199
  });
200
200
  }
201
- }, ee = n(o)({ "& .MuiPaper-root": {
201
+ }, ee = r(h)({ "& .MuiPaper-root": {
202
202
  overflowX: "unset",
203
203
  overflowY: "unset",
204
204
  marginTop: "-16px",
@@ -211,35 +211,35 @@ var y = /* @__PURE__ */ e(i(), 1), b = /* @__PURE__ */ e(t(), 1), x = (e, t, n)
211
211
  width: 0,
212
212
  pointerEvents: "none",
213
213
  borderWidth: "7px",
214
- borderTopColor: "black"
214
+ borderTopColor: a.border()
215
215
  }
216
- } }), te = n("div")(({ theme: e }) => ({
216
+ } }), te = r("div")(() => ({
217
217
  width: "300px",
218
218
  overflow: "hidden",
219
219
  borderRadius: "4px",
220
- backgroundColor: e.palette.common.white,
221
- border: `2px solid ${e.palette.grey[100]}`
222
- })), ne = n("div")({
220
+ backgroundColor: a.white(),
221
+ border: `2px solid ${a.border()}`
222
+ })), ne = r("div")({
223
223
  display: "flex",
224
224
  flexWrap: "wrap"
225
- }), re = n("div")(({ theme: e }) => ({
225
+ }), re = r("div")(() => ({
226
226
  display: "flex",
227
227
  flexWrap: "wrap",
228
- borderTop: `2px solid ${e.palette.grey[100]}`
229
- })), L = n("div")(({ theme: e, variant: t }) => ({
228
+ borderTop: `2px solid ${a.border()}`
229
+ })), L = r("div")(({ variant: e }) => ({
230
230
  width: "22%",
231
231
  textAlign: "center",
232
232
  padding: "4px",
233
233
  cursor: "pointer",
234
- borderBottom: `1px solid ${e.palette.grey[100]}`,
235
- "&:not(:nth-child(4n))": { borderRight: `1px solid ${e.palette.grey[100]}` },
234
+ borderBottom: `1px solid ${a.border()}`,
235
+ "&:not(:nth-child(4n))": { borderRight: `1px solid ${a.border()}` },
236
236
  "&:nth-child(4n)": { flexGrow: 1 },
237
- "&:hover": { backgroundColor: e.palette.grey[100] },
238
- ...t === "positive" && {
237
+ "&:hover": { backgroundColor: a.backgroundDark() },
238
+ ...e === "positive" && {
239
239
  backgroundColor: "rgb(153, 255, 153) !important",
240
240
  "&:hover": { filter: "brightness(85%)" }
241
241
  },
242
- ...t === "negative" && {
242
+ ...e === "negative" && {
243
243
  backgroundColor: "rgb(255, 204, 238) !important",
244
244
  "&:hover": { filter: "brightness(85%)" }
245
245
  }
@@ -302,7 +302,7 @@ var y = /* @__PURE__ */ e(i(), 1), b = /* @__PURE__ */ e(t(), 1), x = (e, t, n)
302
302
  ] })] })
303
303
  });
304
304
  }
305
- }, z = n("div")({
305
+ }, z = r("div")({
306
306
  padding: "10px 120px 10px 16px",
307
307
  backgroundColor: "rgba(0, 0, 0, 0.06)",
308
308
  border: "1px solid #ccc",
@@ -318,11 +318,11 @@ var y = /* @__PURE__ */ e(i(), 1), b = /* @__PURE__ */ e(t(), 1), x = (e, t, n)
318
318
  "-moz-user-select": "none",
319
319
  "-ms-user-select": "none"
320
320
  }
321
- }), B = n("div")({ width: "230px" }), V = n("div")({
321
+ }), B = r("div")({ width: "230px" }), V = r("div")({
322
322
  position: "relative",
323
323
  overflowX: "hidden",
324
324
  display: "flex"
325
- }), H = n(p)(({ theme: e }) => ({
325
+ }), H = r(f)(({ theme: e }) => ({
326
326
  paddingTop: e.spacing(2),
327
327
  marginBottom: e.spacing(2),
328
328
  marginTop: e.spacing(2),
@@ -526,32 +526,32 @@ var W = class extends g.Component {
526
526
  this.textRef.removeEventListener("scroll", this.adjustAnnotationsPosition);
527
527
  }
528
528
  render() {
529
- let { comment: e, customKeys: t, disabled: n, disabledMath: i, keypadMode: a, height: o, width: s, maxHeight: c, onCommentChange: l, predefinedAnnotations: u, text: d } = this.props, { anchorEl: f, annotation: p, openedMenu: m, openedEditor: h, selectionDetails: g } = this.state, y = f && (f.offsetTop ? f.offsetTop : f.offsetParent.offsetTop), b = this.textRef && y ? y - this.textRef.scrollTop - 8 : 0;
529
+ let { comment: e, customKeys: t, disabled: n, disabledMath: r, keypadMode: i, height: a, width: o, maxHeight: s, onCommentChange: c, predefinedAnnotations: l, text: u } = this.props, { anchorEl: f, annotation: p, openedMenu: m, openedEditor: h, selectionDetails: g } = this.state, y = f && (f.offsetTop ? f.offsetTop : f.offsetParent.offsetTop), b = this.textRef && y ? y - this.textRef.scrollTop - 8 : 0;
530
530
  return /* @__PURE__ */ v("div", { children: [
531
531
  /* @__PURE__ */ v(V, { children: [/* @__PURE__ */ _(z, {
532
532
  style: {
533
- width: s - 34,
534
- minHeight: o,
535
- maxHeight: c
533
+ width: o - 34,
534
+ minHeight: a,
535
+ maxHeight: s
536
536
  },
537
537
  ref: (e) => this.textRef = e,
538
538
  onMouseDown: n ? () => {} : O,
539
539
  onMouseUp: n ? () => {} : this.handleSelection,
540
- dangerouslySetInnerHTML: { __html: d }
540
+ dangerouslySetInnerHTML: { __html: u }
541
541
  }), /* @__PURE__ */ _(B, { ref: (e) => this.labelsRef = e })] }),
542
542
  /* @__PURE__ */ _(H, {
543
543
  label: "Comment",
544
- children: /* @__PURE__ */ _(r, {
544
+ children: /* @__PURE__ */ _(d, {
545
545
  className: "prompt",
546
546
  markup: e || "",
547
- onChange: l,
548
- width: s && (s + 104).toString(),
547
+ onChange: c,
548
+ width: o && (o + 104).toString(),
549
549
  disabled: n,
550
550
  pluginProps: {
551
551
  math: {
552
- disabled: i,
552
+ disabled: r,
553
553
  customKeys: t,
554
- keypadMode: a,
554
+ keypadMode: i,
555
555
  controlledKeypadMode: !1
556
556
  },
557
557
  video: { disabled: !0 },
@@ -564,7 +564,7 @@ var W = class extends g.Component {
564
564
  /* @__PURE__ */ _(R, {
565
565
  anchorEl: f,
566
566
  open: m && !n,
567
- annotations: u,
567
+ annotations: l,
568
568
  isNewAnnotation: !!g,
569
569
  onClose: this.handleClose,
570
570
  onDelete: this.deleteAnnotation,
@@ -594,18 +594,19 @@ function G(e) {
594
594
  function K(e, t) {
595
595
  return !e || G(e) ? e : G(e.default) ? e.default : t && G(e[t]) ? e[t] : t && G(e[t]?.default) ? e[t].default : e;
596
596
  }
597
- var q = K(c, "UiLayout") || K(Q.UiLayout, "UiLayout"), J = K(a, "PreviewPrompt") || K(Q.PreviewPrompt, "PreviewPrompt"), Y = K(m, "Collapsible") || K(Q.Collapsible, "Collapsible"), ie = K(d, "Feedback") || K(Q.Feedback, "Feedback"), X = f, Z = X.default, Q = Z && typeof Z == "object" ? Z : X, ae = (0, b.default)("@pie-ui:extended-text-entry"), oe = n(q)({
598
- backgroundColor: l.background(),
599
- color: l.text()
600
- }), se = n(s)(({ theme: e }) => ({
597
+ var q = K(l, "UiLayout") || K(Q.UiLayout, "UiLayout"), J = K(p, "PreviewPrompt") || K(Q.PreviewPrompt, "PreviewPrompt"), Y = K(s, "Collapsible") || K(Q.Collapsible, "Collapsible"), ie = K(m, "Feedback") || K(Q.Feedback, "Feedback"), X = u, Z = X.default, Q = Z && typeof Z == "object" ? Z : X, ae = (0, b.default)("@pie-ui:extended-text-entry"), oe = r(q)({
598
+ backgroundColor: a.background(),
599
+ color: a.text()
600
+ }), se = r(n)(({ theme: e }) => ({
601
601
  width: "100%",
602
- color: l.text(),
602
+ color: a.text(),
603
603
  marginBottom: e.spacing(2),
604
- fontSize: "inherit"
605
- })), ce = n("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), le = n(r)(({ theme: e }) => ({
604
+ fontSize: "inherit",
605
+ display: "block"
606
+ })), ce = r("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), le = r(d)(({ theme: e }) => ({
606
607
  marginBottom: e.spacing(2),
607
608
  borderRadius: "4px"
608
- })), $ = n("h2")({
609
+ })), $ = r("h2")({
609
610
  position: "absolute",
610
611
  left: "-10000px",
611
612
  top: "auto",
@@ -624,8 +625,8 @@ var q = K(c, "UiLayout") || K(Q.UiLayout, "UiLayout"), J = K(a, "PreviewPrompt")
624
625
  comment: y.default.string
625
626
  }).isRequired
626
627
  };
627
- changeSessionValue = h(this.props.onValueChange, 1500);
628
- changeSessionComment = h(this.props.onCommentChange, 1500);
628
+ changeSessionValue = i(this.props.onValueChange, 1500);
629
+ changeSessionComment = i(this.props.onCommentChange, 1500);
629
630
  render() {
630
631
  let { model: e, session: t, onAnnotationsChange: n } = this.props, { animationsDisabled: r, annotatorMode: i, customKeys: a, dimensions: o, disabled: s, disabledAnnotator: c, equationEditor: l, extraCSSRules: u, feedback: d, mathInput: f, playersToolbarPosition: p, predefinedAnnotations: m, prompt: h, spanishInput: g, specialInput: y, spellCheckEnabled: b, teacherInstructions: x } = e, { annotations: S, comment: C, value: w } = t, { width: T, height: E } = o || {}, D = "40vh", O = { position: p === "top" ? "top" : "bottom" };
631
632
  ae("[render] disabled? ", s);
@@ -711,4 +712,4 @@ var q = K(c, "UiLayout") || K(Q.UiLayout, "UiLayout"), J = K(a, "PreviewPrompt")
711
712
  //#endregion
712
713
  export { ue as t };
713
714
 
714
- //# sourceMappingURL=main-DIChM596.js.map
715
+ //# sourceMappingURL=main-CXlds066.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main-CXlds066.js","names":[],"sources":["../../src/delivery/annotation/annotation-utils.ts","../../src/delivery/annotation/freeform-editor.tsx","../../src/delivery/annotation/annotation-menu.tsx","../../src/delivery/annotation/annotation-editor.tsx","../../src/delivery/main.tsx"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/extended-text-entry/src/annotation/annotation-utils.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\n// returns DOM Nodes before the stopOffset\nconst getAllTextNodesBeforePosition = (node, stopOffset, nodeArray) => {\n const nodes = nodeArray ? nodeArray : [];\n const offset = nodes.reduce((acc, node) => acc + node.textContent.length, 0);\n let keepWalking = true;\n\n if (offset > stopOffset) {\n return false;\n }\n\n if (node) {\n // 3 = HTML DOM node value for text nodes\n if (node.nodeType === 3 && node.parentNode && !node.parentNode.hasAttribute('data-ann-id')) {\n nodes.push(node);\n }\n\n node = node.firstChild;\n }\n\n while (node && keepWalking) {\n keepWalking = getAllTextNodesBeforePosition(node, stopOffset, nodes);\n node = node.nextSibling;\n }\n\n return nodes;\n};\n\n// returns DOM Nodes that overlap the start or end position\nexport const getDOMNodes = (startOffset, endOffset, rootNode) => {\n const textNodesToEnd = getAllTextNodesBeforePosition(rootNode, endOffset);\n const domNodes = [];\n let start = 0;\n\n textNodesToEnd.forEach((node) => {\n const end = start + node.textContent.length;\n\n [startOffset, endOffset].forEach((offset) => {\n if (start <= offset && offset < end) {\n domNodes.push({\n node,\n offset: offset - start,\n });\n }\n });\n\n start = end;\n });\n\n return domNodes;\n};\n\n// returns [ textNodes, text ]\n// textNodes = DOM Text Nodes between start range and end range node\n// text = plain text in range\nconst getTextNodesBetween = (range) => {\n const {\n commonAncestorContainer: rootNode,\n startContainer: startNode,\n endContainer: endNode,\n startOffset,\n endOffset,\n } = range;\n const textNodes = [];\n let pastStartNode = false;\n let reachedEndNode = false;\n let text = '';\n\n const getTextNodes = (node) => {\n const { nodeValue: value, childNodes } = node;\n\n if (node === startNode && node === endNode) {\n if (value) {\n text += value.substring(startOffset, endOffset);\n }\n\n pastStartNode = reachedEndNode = true;\n } else if (node === startNode) {\n if (value) {\n text += value.substring(startOffset);\n }\n\n pastStartNode = true;\n } else if (node === endNode) {\n if (value) {\n text += value.substring(0, endOffset);\n }\n\n reachedEndNode = true;\n } else if (node && node.nodeType === 3 && node.parentNode && !node.parentNode.hasAttribute('data-ann-id')) {\n // 3 = HTML DOM node value for text nodes\n if (value && pastStartNode && !reachedEndNode) {\n text += value;\n textNodes.push(node);\n }\n }\n\n childNodes.forEach((childNode) => {\n if (!reachedEndNode) {\n getTextNodes(childNode);\n } else {\n return;\n }\n });\n };\n\n getTextNodes(rootNode);\n\n return [textNodes, text];\n};\n\nconst surroundContent = (range) => {\n const wrapper = document.createElement('SPAN');\n\n range.surroundContents(wrapper);\n\n return wrapper;\n};\n\n// wrap each DOM Text Node in range into a span\nexport const wrapRange = (range) => {\n if (range.startContainer === range.endContainer) {\n return [surroundContent(range)];\n }\n\n const [nodesBetween] = getTextNodesBetween(range);\n\n // wrap the start node\n const startRange = document.createRange();\n\n startRange.selectNodeContents(range.startContainer);\n startRange.setStart(range.startContainer, range.startOffset);\n\n const startWrapper = surroundContent(startRange);\n\n // wrap the end node\n const endRange = document.createRange();\n\n endRange.selectNode(range.endContainer);\n endRange.setEnd(range.endContainer, range.endOffset);\n\n const endWrapper = surroundContent(endRange);\n\n // wrap the nodes between start and end nodes, if any\n const centerWrappers = nodesBetween.map((node) => {\n const wrapper = document.createElement('SPAN');\n\n node.parentNode.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n\n return wrapper;\n });\n\n return [startWrapper, ...centerWrappers, endWrapper];\n};\n\n// returns text in range with start and end position in rootNode\nexport const getRangeDetails = (range, rootNode) => {\n const rangeBefore = document.createRange();\n\n rangeBefore.setStart(rootNode, 0);\n rangeBefore.setEnd(range.startContainer, range.startOffset);\n\n const [, text] = getTextNodesBetween(rangeBefore);\n const [, textSelected] = getTextNodesBetween(range);\n const start = text.length;\n const end = start + textSelected.length;\n\n return {\n quote: textSelected,\n start,\n end,\n };\n};\n\n// removes the annotation spans without changing the content inside\nexport const removeElemsWrapping = (elems, container) => {\n (elems || []).forEach((elem) => {\n const parent = elem.parentNode;\n const childNodes = elem.childNodes;\n const childNodesLength = childNodes.length;\n\n if (childNodesLength > 0) {\n for (let i = 0; i < childNodesLength; i++) {\n parent.insertBefore(childNodes[0], elem);\n }\n } else {\n parent.insertBefore(document.createTextNode(elem.textContent), elem);\n }\n\n parent.removeChild(elem);\n });\n\n container.normalize();\n};\n\n// also used in select-text\nexport const clearSelection = () => {\n if (document.getSelection) {\n // for all new browsers (IE9+, Chrome, Firefox)\n document.getSelection().removeAllRanges();\n document.getSelection().addRange(document.createRange());\n } else if (window.getSelection) {\n // equals with the document.getSelection (MSDN info)\n if (window.getSelection().removeAllRanges) {\n // for all new browsers (IE9+, Chrome, Firefox)\n window.getSelection().removeAllRanges();\n window.getSelection().addRange(document.createRange());\n } else if (window.getSelection().empty) {\n // Chrome supports this as well\n window.getSelection().empty();\n }\n } else if (document.selection) {\n // IE8-\n document.selection.empty();\n }\n};\n\n// check if annotation label contains line breaks or its length >= 20 characters\nexport const isSideLabel = (text) => text.length >= 20 || text.search(/\\n|\\r|\\r\\n/) !== -1;\n\nexport const getAnnotationElements = (id) => Array.from(document.querySelectorAll(`[data-id='${id}']`));\n\nexport const getLabelElement = (id) => document.querySelector(`[data-ann-id='${id}']`);\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/extended-text-entry/src/annotation/freeform-editor.jsx\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 PropTypes from 'prop-types';\nimport { Popover, TextField } from '@mui/material';\nimport { styled } from '@mui/material/styles';\nimport { color } from '@pie-lib/render-ui';\n\nconst StyledPopover: any = styled(Popover)(({ annotationType }) => ({\n '& .MuiPaper-root': {\n overflowX: 'unset',\n overflowY: 'unset',\n marginLeft: '16px',\n '&::before': {\n position: 'absolute',\n right: '100%',\n top: '13px',\n border: 'solid transparent',\n content: '\"\"',\n height: 0,\n width: 0,\n pointerEvents: 'none',\n borderWidth: '7px',\n borderRightColor: color.border(),\n },\n ...(annotationType === 'negative' && {\n '&::before': {\n borderRightColor: 'rgb(255, 204, 238) !important',\n },\n }),\n ...(annotationType === 'positive' && {\n '&::before': {\n borderRightColor: 'rgb(153, 255, 153) !important',\n },\n }),\n },\n}));\n\n// See annotation-menu: the popover surface has to follow the scheme alongside its\n// stroke, or a scheme's border colour lands on a permanently white card.\nconst Wrapper: any = styled('div')(({ annotationType }) => ({\n width: '200px',\n overflow: 'hidden',\n borderRadius: '4px',\n backgroundColor: color.white(),\n border: `4px solid ${color.border()}`,\n ...(annotationType === 'negative' && {\n borderColor: 'rgb(255, 204, 238) !important',\n }),\n ...(annotationType === 'positive' && {\n borderColor: 'rgb(153, 255, 153) !important',\n }),\n}));\n\nconst Holder: any = styled('div')(() => ({\n display: 'flex',\n flexWrap: 'wrap',\n borderTop: `2px solid ${color.border()}`,\n}));\n\nconst Button: any = styled('div')(({ variant, annotationType }) => ({\n flexGrow: 1,\n width: '28%',\n textAlign: 'center',\n padding: '4px',\n cursor: 'pointer',\n '&:not(:nth-child(3n))': {\n borderRight: `1px solid ${color.border()}`,\n },\n '&:hover': {\n backgroundColor: color.backgroundDark(),\n },\n ...(variant === 'positive' && {\n backgroundColor: 'rgb(153, 255, 153) !important',\n '&:hover': {\n filter: 'brightness(85%)',\n },\n }),\n ...(variant === 'negative' && {\n backgroundColor: 'rgb(255, 204, 238) !important',\n '&:hover': {\n filter: 'brightness(85%)',\n },\n }),\n ...(variant === 'typeChange' && annotationType === 'negative' && {\n '&:hover': {\n backgroundColor: 'rgb(153, 255, 153) !important',\n },\n }),\n ...(variant === 'typeChange' && annotationType === 'positive' && {\n '&:hover': {\n backgroundColor: 'rgb(255, 204, 238) !important',\n },\n }),\n}));\n\nclass FreeformEditor extends React.Component {\n static propTypes = {\n anchorEl: PropTypes.object,\n open: PropTypes.bool,\n offset: PropTypes.number,\n value: PropTypes.string,\n type: PropTypes.string,\n onClose: PropTypes.func,\n onDelete: PropTypes.func,\n onSave: PropTypes.func,\n onTypeChange: PropTypes.func,\n };\n\n constructor(props) {\n super(props);\n this.state = { value: props.value };\n }\n\n UNSAFE_componentWillReceiveProps(nextProps) {\n const { value } = nextProps;\n const { value: propsValue } = this.props;\n\n if (value !== propsValue) {\n this.setState({ value });\n }\n }\n\n onValueChange = (event) => this.setState({ value: event.target.value });\n\n handleSave: any = () => {\n const { value: oldValue, onSave, onClose, onDelete } = this.props;\n const { value } = this.state;\n\n if (value === '') {\n onDelete();\n }\n\n if (oldValue !== value) {\n onSave(oldValue, value);\n }\n\n this.setState({ value: '' });\n onClose();\n };\n\n handleTypeChange: any = () => {\n const { onTypeChange, onDelete } = this.props;\n const { value } = this.state;\n\n if (value === '') {\n onDelete();\n } else {\n onTypeChange(value);\n }\n\n this.setState({ value: '' });\n };\n\n render() {\n const { anchorEl, offset, onDelete, open, type } = this.props;\n const { value } = this.state;\n\n return (\n <StyledPopover\n anchorEl={anchorEl}\n elevation={2}\n open={open}\n onClose={this.handleSave}\n annotationType={type}\n style={{ marginTop: `${offset}px`, transition: 'margin-top 2s ease-out' }}\n transitionDuration={{ enter: 225, exit: 195 }}\n anchorOrigin={{\n vertical: 'top',\n horizontal: 'right',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'left',\n }}\n >\n <Wrapper annotationType={type}>\n <TextField\n id=\"annotation-editor\"\n style={{\n padding: '2px 5px',\n width: '95%',\n }}\n autoFocus\n multiline\n rows={1}\n maxRows={4}\n value={value}\n onChange={this.onValueChange}\n InputProps={{ disableUnderline: true }}\n />\n <Holder>\n <Button onClick={onDelete}>\n Delete\n </Button>\n <Button variant=\"typeChange\" annotationType={type} onClick={this.handleTypeChange}>\n {type === 'negative' ? 'Green' : 'Pink'}\n </Button>\n <Button onClick={this.handleSave}>\n Save\n </Button>\n </Holder>\n </Wrapper>\n </StyledPopover>\n );\n }\n}\n\nexport default FreeformEditor;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/extended-text-entry/src/annotation/annotation-menu.jsx\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 PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { Popover } from '@mui/material';\nimport { color } from '@pie-lib/render-ui';\n\nconst StyledPopover: any = styled(Popover)({\n '& .MuiPaper-root': {\n overflowX: 'unset',\n overflowY: 'unset',\n marginTop: '-16px',\n '&::after': {\n position: 'absolute',\n left: 'calc(50% - 7px)',\n border: 'solid transparent',\n content: '\"\"',\n height: 0,\n width: 0,\n pointerEvents: 'none',\n borderWidth: '7px',\n borderTopColor: color.border(),\n },\n },\n});\n\n/*\n * Surface and stroke move together. Tokenising the border alone would put a scheme's\n * border colour on a fixed white popover -- under white-on-black, `--pie-border` is\n * #ffffff, so the outline would vanish. `--pie-white` inverts with the scheme, which\n * is what `common.white` was standing in for.\n */\nconst MainWrapper: any = styled('div')(() => ({\n width: '300px',\n overflow: 'hidden',\n borderRadius: '4px',\n backgroundColor: color.white(),\n border: `2px solid ${color.border()}`,\n}));\n\nconst AnnotationsWrapper: any = styled('div')({\n display: 'flex',\n flexWrap: 'wrap',\n});\n\nconst ControlsWrapper: any = styled('div')(() => ({\n display: 'flex',\n flexWrap: 'wrap',\n borderTop: `2px solid ${color.border()}`,\n}));\n\nconst Button: any = styled('div')(({ variant }) => ({\n width: '22%',\n textAlign: 'center',\n padding: '4px',\n cursor: 'pointer',\n borderBottom: `1px solid ${color.border()}`,\n '&:not(:nth-child(4n))': {\n borderRight: `1px solid ${color.border()}`,\n },\n '&:nth-child(4n)': {\n flexGrow: 1,\n },\n '&:hover': {\n backgroundColor: color.backgroundDark(),\n },\n ...(variant === 'positive' && {\n backgroundColor: 'rgb(153, 255, 153) !important',\n '&:hover': {\n filter: 'brightness(85%)',\n },\n }),\n ...(variant === 'negative' && {\n backgroundColor: 'rgb(255, 204, 238) !important',\n '&:hover': {\n filter: 'brightness(85%)',\n },\n }),\n}));\n\nclass AnnotationMenu extends React.Component {\n static propTypes = {\n anchorEl: PropTypes.object,\n open: PropTypes.bool,\n annotations: PropTypes.array,\n isNewAnnotation: PropTypes.bool,\n onClose: PropTypes.func,\n onDelete: PropTypes.func,\n onEdit: PropTypes.func,\n onWrite: PropTypes.func,\n onAnnotate: PropTypes.func,\n };\n\n render() {\n const { anchorEl, annotations, isNewAnnotation, onAnnotate, onClose, onEdit, onDelete, onWrite, open } =\n this.props;\n\n return (\n <StyledPopover\n anchorEl={anchorEl}\n open={open}\n onClose={onClose}\n elevation={5}\n transitionDuration={{ enter: 225, exit: 195 }}\n anchorOrigin={{\n vertical: 'top',\n horizontal: 'center',\n }}\n transformOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n >\n <MainWrapper>\n <AnnotationsWrapper>\n {annotations.map((annotation, index) => (\n <Button\n key={`annotation-${index}`}\n variant={annotation.type}\n onClick={() => onAnnotate(annotation)}\n >\n {annotation.label}\n </Button>\n ))}\n </AnnotationsWrapper>\n <ControlsWrapper>\n <Button onClick={onClose}>\n Cancel\n </Button>\n <Button style={{ pointerEvents: 'none' }} />\n {isNewAnnotation ? (\n <React.Fragment>\n <Button variant=\"positive\" onClick={() => onWrite('positive')}>\n Write\n </Button>\n <Button variant=\"negative\" onClick={() => onWrite('negative')}>\n Write\n </Button>\n </React.Fragment>\n ) : (\n <React.Fragment>\n <Button onClick={onDelete}>\n Delete\n </Button>\n <Button onClick={onEdit}>\n Edit\n </Button>\n </React.Fragment>\n )}\n </ControlsWrapper>\n </MainWrapper>\n </StyledPopover>\n );\n }\n}\n\nexport default AnnotationMenu;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/extended-text-entry/src/annotation/annotation-editor.jsx\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 { styled } from '@mui/material/styles';\nimport PropTypes from 'prop-types';\n\nimport {\n clearSelection,\n isSideLabel,\n getAnnotationElements,\n getDOMNodes,\n getLabelElement,\n getRangeDetails,\n removeElemsWrapping,\n wrapRange,\n} from './annotation-utils.js';\nimport FreeformEditor from './freeform-editor.js';\nimport AnnotationMenu from './annotation-menu.js';\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport { InputContainer } from '@pie-lib/config-ui';\n\nconst TextContainer: any = styled('div')({\n padding: '10px 120px 10px 16px',\n backgroundColor: 'rgba(0, 0, 0, 0.06)',\n border: '1px solid #ccc',\n borderRadius: '4px',\n overflowY: 'scroll',\n lineHeight: '36px',\n whiteSpace: 'pre-wrap',\n overflowWrap: 'break-word',\n '& p': {\n margin: 0,\n },\n '& span[data-latex]': {\n userSelect: 'none',\n '-webkit-user-select': 'none',\n '-moz-user-select': 'none',\n '-ms-user-select': 'none',\n },\n});\n\nconst LabelsContainer: any = styled('div')({\n width: '230px',\n});\n\nconst Wrapper: any = styled('div')({\n position: 'relative',\n overflowX: 'hidden',\n display: 'flex',\n});\n\nconst CommentContainer: any = styled(InputContainer)(({ theme }) => ({\n paddingTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n marginTop: theme.spacing(2),\n width: '100%',\n}));\n\n// Global styles for pseudo-elements that can't be applied inline\nconst globalStyles = `\n .sideAnnotation:before {\n position: absolute;\n right: var(--before-right, 100%);\n top: var(--before-top, 5px);\n border: solid transparent;\n content: \"\";\n height: 0;\n width: 0;\n pointer-events: none;\n border-width: var(--before-border-width, 7px);\n border-right-color: var(--before-border-color, rgb(153, 255, 153));\n }\n`;\n\n// Inject styles if not already injected\nif (!document.getElementById('annotation-editor-styles')) {\n const styleElement = document.createElement('style');\n styleElement.id = 'annotation-editor-styles';\n styleElement.textContent = globalStyles;\n document.head.appendChild(styleElement);\n}\n\nclass AnnotationEditor extends React.Component {\n static propTypes = {\n text: PropTypes.string,\n comment: PropTypes.string,\n annotations: PropTypes.array,\n predefinedAnnotations: PropTypes.array,\n onChange: PropTypes.func.isRequired,\n onCommentChange: PropTypes.func.isRequired,\n width: PropTypes.number,\n height: PropTypes.number,\n maxHeight: PropTypes.string,\n disabled: PropTypes.bool,\n disabledMath: PropTypes.bool,\n customKeys: PropTypes.array,\n keypadMode: PropTypes.string,\n };\n\n constructor(props) {\n super(props);\n this.state = {\n anchorEl: null,\n openedMenu: false,\n openedEditor: false,\n selectedElems: [],\n labelElem: null,\n selectionDetails: null,\n annotation: null,\n annotationIndex: null,\n };\n }\n\n componentDidMount() {\n const { annotations, text } = this.props;\n\n if (text) {\n annotations.forEach((annotation) => {\n const [domStart, domEnd] = getDOMNodes(annotation.start, annotation.end, this.textRef);\n\n if (domStart && domEnd) {\n const range = document.createRange();\n\n range.setStart(domStart.node, domStart.offset);\n range.setEnd(domEnd.node, domEnd.offset);\n\n const spans = wrapRange(range);\n\n this.createDOMAnnotation(spans, annotation);\n }\n });\n }\n\n if (this.textRef) {\n this.adjustAnnotationsPosition();\n this.textRef.addEventListener('scroll', this.adjustAnnotationsPosition);\n }\n }\n\n adjustAnnotationsPosition: any = () => {\n if (this.textRef && this.labelsRef) {\n const left = this.textRef.offsetLeft + this.textRef.offsetWidth + 8;\n\n Array.from(this.labelsRef.children).forEach((label) => {\n const spans = getAnnotationElements(label.dataset.annId);\n const spanOffset = spans[0].offsetTop ? spans[0].offsetTop : spans[0].offsetParent.offsetTop;\n const top = spanOffset - this.textRef.scrollTop - 6;\n\n label.style.top = `${top}px`;\n label.style.left = `${left}px`;\n });\n }\n };\n\n handleClick: any = (event) => {\n const { annotations } = this.props;\n const { selectionDetails } = this.state;\n\n if (selectionDetails) {\n // new selection was made inside another annotation and should not update that annotation\n return;\n }\n\n const { id, annId } = event.target.dataset;\n const annotationId = id || annId;\n const selectedElems = getAnnotationElements(annotationId);\n const labelElem = getLabelElement(annotationId);\n const annotationIndex = annotations.findIndex((annotation) => annotation.id === annotationId);\n const isSideLabel = labelElem.hasAttribute('data-freeform');\n\n if (isSideLabel) {\n labelElem.style.zIndex = '10';\n }\n\n this.setState({\n anchorEl: selectedElems[0],\n openedMenu: !!id || (!!annId && !isSideLabel), // true if the annotation or the label was clicked\n openedEditor: !!annId && isSideLabel, // true if the side label was clicked\n selectedElems,\n labelElem,\n annotationIndex,\n annotation: annotations[annotationIndex],\n selectionDetails: null,\n });\n };\n\n handleHover: any = (event) => {\n const { id, annId } = event.target.dataset;\n const annotationId = id || annId;\n const selectedElems = getAnnotationElements(annotationId);\n const labelElem = getLabelElement(annotationId);\n const isSideLabel = labelElem.hasAttribute('data-freeform');\n\n selectedElems.forEach((elem) => {\n elem.style.zIndex = '20';\n if (elem.classList.contains('positive')) {\n elem.style.backgroundColor = 'rgb(51, 255, 51, 0.7)';\n } else if (elem.classList.contains('negative')) {\n elem.style.backgroundColor = 'rgba(255, 102, 204, 0.55)';\n }\n });\n\n if (isSideLabel) {\n labelElem.style.zIndex = '20';\n if (labelElem.classList.contains('positive')) {\n labelElem.style.backgroundColor = 'rgb(128, 255, 128)';\n labelElem.style.setProperty('--before-border-color', 'rgb(153, 255, 153)');\n } else if (labelElem.classList.contains('negative')) {\n labelElem.style.backgroundColor = 'rgb(255, 179, 230)';\n labelElem.style.setProperty('--before-border-color', 'rgb(255, 179, 230)');\n }\n } else {\n labelElem.style.zIndex = '20';\n if (labelElem.classList.contains('positive')) {\n labelElem.style.color = 'rgb(0, 77, 0)';\n } else if (labelElem.classList.contains('negative')) {\n labelElem.style.color = 'rgb(153, 0, 102)';\n }\n }\n };\n\n handleCancelHover: any = (event) => {\n const { id, annId } = event.target.dataset;\n const annotationId = id || annId;\n const selectedElems = getAnnotationElements(annotationId);\n const labelElem = getLabelElement(annotationId);\n const isSideLabel = labelElem.hasAttribute('data-freeform');\n\n selectedElems.forEach((elem) => {\n elem.style.zIndex = '';\n if (elem.classList.contains('positive')) {\n elem.style.backgroundColor = 'rgb(51, 255, 51, 0.5)';\n } else if (elem.classList.contains('negative')) {\n elem.style.backgroundColor = 'rgba(255, 102, 204, 0.4)';\n }\n });\n\n if (isSideLabel) {\n labelElem.style.zIndex = '';\n if (labelElem.classList.contains('positive')) {\n labelElem.style.backgroundColor = 'rgb(153, 255, 153)';\n labelElem.style.removeProperty('--before-border-color');\n } else if (labelElem.classList.contains('negative')) {\n labelElem.style.backgroundColor = 'rgb(255, 204, 238)';\n labelElem.style.removeProperty('--before-border-color');\n }\n } else {\n labelElem.style.zIndex = '';\n if (labelElem.classList.contains('positive')) {\n labelElem.style.color = 'rgb(0, 128, 0)';\n } else if (labelElem.classList.contains('negative')) {\n labelElem.style.color = 'rgb(204, 0, 136)';\n }\n }\n };\n\n handleClose: any = (event) => {\n const { selectedElems, labelElem } = this.state;\n\n if (selectedElems.length && !selectedElems[0].hasAttribute('data-id')) {\n removeElemsWrapping(selectedElems, this.textRef);\n }\n\n if (labelElem) {\n labelElem.style.zIndex = '';\n }\n\n this.setState({\n anchorEl: null,\n openedMenu: false,\n openedEditor: false,\n selectedElems: [],\n labelElem: null,\n selectionDetails: null,\n annotationIndex: null,\n annotation: null,\n });\n\n clearSelection();\n };\n\n handleSelection: any = (event) => {\n const selection = window.getSelection();\n\n // prevent unwanted selections\n if (event.detail > 2) {\n clearSelection();\n return;\n }\n\n if (selection && selection.rangeCount > 0) {\n const selectedRange = selection.getRangeAt(0);\n const selectedText = selectedRange.toString();\n const isSelectionInside = this.textRef.contains(selectedRange.commonAncestorContainer);\n\n if (!selection.isCollapsed && selectedText !== '' && isSelectionInside) {\n const selectionDetails = getRangeDetails(selectedRange, this.textRef);\n const selectedElems = wrapRange(selectedRange);\n\n this.setState({\n anchorEl: selectedElems[0],\n openedMenu: true,\n selectedElems,\n selectionDetails,\n });\n }\n }\n };\n\n deleteAnnotation: any = () => {\n const { annotations, onChange } = this.props;\n const { selectedElems, labelElem, annotationIndex, annotation } = this.state;\n const parentRef = isSideLabel(annotation.label) ? this.labelsRef : selectedElems[0];\n\n parentRef.removeChild(labelElem);\n removeElemsWrapping(selectedElems, this.textRef);\n annotations.splice(annotationIndex, 1);\n\n onChange(annotations);\n this.handleClose();\n };\n\n createDOMAnnotation: any = (elems, annotation) => {\n const { disabled } = this.props;\n const { id, label, type } = annotation;\n\n (elems || []).forEach((elem) => {\n elem.dataset.id = id;\n elem.className = `annotation ${type}`;\n // Apply annotation styles directly\n elem.style.position = 'relative';\n elem.style.cursor = 'pointer';\n if (type === 'positive') {\n elem.style.backgroundColor = 'rgb(51, 255, 51, 0.5)';\n } else if (type === 'negative') {\n elem.style.backgroundColor = 'rgba(255, 102, 204, 0.4)';\n }\n elem.onclick = !disabled && this.handleClick;\n elem.onmouseover = this.handleHover;\n elem.onmouseout = this.handleCancelHover;\n });\n\n const firstSpan = (elems && elems[0]) || {};\n const labelElem = document.createElement('SPAN');\n\n labelElem.dataset.annId = id;\n labelElem.innerHTML = label;\n labelElem.onclick = !disabled && this.handleClick;\n labelElem.onmouseover = this.handleHover;\n labelElem.onmouseout = this.handleCancelHover;\n\n if (isSideLabel(label)) {\n const spanOffset = firstSpan.offsetTop ? firstSpan.offsetTop : firstSpan.offsetParent.offsetTop;\n const top = spanOffset - this.textRef.scrollTop;\n const left = this.textRef.offsetLeft + this.textRef.offsetWidth + 8;\n\n labelElem.dataset.freeform = true;\n labelElem.className = `sideAnnotation ${type}`;\n \n // Apply side annotation styles directly\n labelElem.style.position = 'absolute';\n labelElem.style.padding = '4px';\n labelElem.style.borderRadius = '4px';\n labelElem.style.marginLeft = '8px';\n labelElem.style.width = '180px';\n labelElem.style.whiteSpace = 'pre-wrap';\n labelElem.style.wordBreak = 'break-word';\n labelElem.style.border = '2px solid #ffffff';\n labelElem.style.fontSize = '14px';\n labelElem.style.fontStyle = 'normal';\n labelElem.style.fontWeight = 'normal';\n labelElem.style.top = `${top}px`;\n labelElem.style.left = `${left}px`;\n \n if (type === 'negative') {\n labelElem.style.backgroundColor = 'rgb(255, 204, 238)';\n } else if (type === 'positive') {\n labelElem.style.backgroundColor = 'rgb(153, 255, 153)';\n }\n \n // Add pseudo-element styles via CSS\n labelElem.style.setProperty('--before-border-width', '7px');\n labelElem.style.setProperty('--before-top', '5px');\n labelElem.style.setProperty('--before-right', '100%');\n if (type === 'negative') {\n labelElem.style.setProperty('--before-border-color', 'rgb(255, 204, 238)');\n } else if (type === 'positive') {\n labelElem.style.setProperty('--before-border-color', 'rgb(153, 255, 153)');\n }\n\n this.labelsRef.appendChild(labelElem);\n } else {\n labelElem.className = `annotationLabel ${type}`;\n \n // Apply annotation label styles directly\n labelElem.style.backgroundColor = 'rgb(242, 242, 242)';\n labelElem.style.padding = '2px';\n labelElem.style.position = 'absolute';\n labelElem.style.userSelect = 'none';\n labelElem.style.whiteSpace = 'nowrap';\n labelElem.style.top = '-10px';\n labelElem.style.left = '-2px';\n labelElem.style.fontSize = '12px';\n labelElem.style.fontStyle = 'normal';\n labelElem.style.fontWeight = 'normal';\n labelElem.style.lineHeight = '6px';\n labelElem.style.webkitUserSelect = 'none';\n labelElem.style.mozUserSelect = 'none';\n labelElem.style.msUserSelect = 'none';\n \n if (type === 'positive') {\n labelElem.style.color = 'rgb(0, 128, 0)';\n } else if (type === 'negative') {\n labelElem.style.color = 'rgb(204, 0, 136)';\n }\n \n firstSpan.appendChild(labelElem);\n }\n };\n\n createNewAnnotation: any = (label, type) => {\n const { selectedElems, selectionDetails } = this.state;\n const annotation = {\n id: [selectionDetails.start, selectionDetails.end, new Date().getTime()].join('-'),\n label,\n type,\n ...selectionDetails,\n };\n\n this.createDOMAnnotation(selectedElems, annotation);\n\n return annotation;\n };\n\n handleMenuClick: any = (newAnnotation) => {\n const { annotations, onChange } = this.props;\n const { annotation, annotationIndex } = this.state;\n const { type, text: label } = newAnnotation;\n\n if (annotation) {\n const updatedAnnotation = { ...annotation, label, type };\n const { type: oldType, label: oldLabel } = annotation;\n\n this.updateLabel(oldLabel, updatedAnnotation, type !== oldType && oldType);\n annotations.splice(annotationIndex, 1, updatedAnnotation);\n } else {\n const newAnnotation = this.createNewAnnotation(label, type);\n\n annotations.push(newAnnotation);\n }\n\n onChange(annotations);\n this.handleClose();\n };\n\n editAnnotation: any = () => {\n this.setState({\n openedMenu: false,\n openedEditor: true,\n });\n };\n\n addAnnotation: any = (type) => {\n const { annotations, onChange } = this.props;\n const annotation = this.createNewAnnotation('', type);\n const labelElem = getLabelElement(annotation.id);\n\n annotations.push(annotation);\n\n this.setState({\n openedMenu: false,\n openedEditor: true,\n annotationIndex: annotations.length - 1,\n annotation,\n labelElem,\n });\n\n onChange(annotations);\n };\n\n updateLabel: any = (oldLabel, annotation, oldType) => {\n const { selectedElems, labelElem } = this.state;\n const { label, type } = annotation;\n\n if ((isSideLabel(label) && isSideLabel(oldLabel)) || (!isSideLabel(label) && !isSideLabel(oldLabel))) {\n labelElem.innerHTML = label;\n\n if (oldType) {\n labelElem.classList.remove(oldType);\n labelElem.classList.add(type);\n\n selectedElems.forEach((elem) => {\n elem.classList.remove(oldType);\n elem.classList.add(type);\n });\n }\n } else if (isSideLabel(label) && !isSideLabel(oldLabel)) {\n selectedElems[0].removeChild(labelElem);\n this.createDOMAnnotation(selectedElems, annotation);\n } else if (!isSideLabel(label) && isSideLabel(oldLabel)) {\n this.labelsRef.removeChild(labelElem);\n this.createDOMAnnotation(selectedElems, annotation);\n }\n };\n\n changeAnnotationType: any = (newLabel) => {\n const { annotations, onChange } = this.props;\n const { annotationIndex, selectedElems } = this.state;\n const { type: oldType, label: oldLabel } = annotations[annotationIndex];\n const type = oldType === 'positive' ? 'negative' : 'positive';\n const updatedAnnotation = { ...annotations[annotationIndex], type, label: newLabel };\n\n selectedElems.forEach((span) => {\n span.classList.remove(oldType);\n span.classList.add(type);\n });\n\n this.updateLabel(oldLabel, updatedAnnotation, oldType);\n annotations.splice(annotationIndex, 1, updatedAnnotation);\n\n onChange(annotations);\n this.handleClose();\n };\n\n updateAnnotation: any = (oldLabel, newLabel) => {\n const { annotations, onChange } = this.props;\n const { annotationIndex } = this.state;\n const updatedAnnotation = { ...annotations[annotationIndex], label: newLabel };\n\n this.updateLabel(oldLabel, updatedAnnotation);\n annotations.splice(annotationIndex, 1, updatedAnnotation);\n\n onChange(annotations);\n };\n\n componentWillUnmount() {\n this.textRef.removeEventListener('scroll', this.adjustAnnotationsPosition);\n }\n\n render() {\n const {\n comment,\n customKeys,\n disabled,\n disabledMath,\n keypadMode,\n height,\n width,\n maxHeight,\n onCommentChange,\n predefinedAnnotations,\n text,\n } = this.props;\n const { anchorEl, annotation, openedMenu, openedEditor, selectionDetails } = this.state;\n\n const anchorOffset = anchorEl && (anchorEl.offsetTop ? anchorEl.offsetTop : anchorEl.offsetParent.offsetTop);\n const topOffset = this.textRef && anchorOffset ? anchorOffset - this.textRef.scrollTop - 8 : 0;\n\n return (\n <div>\n <Wrapper>\n <TextContainer\n style={{ width: width - 34, minHeight: height, maxHeight: maxHeight }}\n ref={(r) => (this.textRef = r)}\n onMouseDown={!disabled ? clearSelection : () => {}}\n onMouseUp={!disabled ? this.handleSelection : () => {}}\n dangerouslySetInnerHTML={{ __html: text }}\n />\n <LabelsContainer ref={(r) => (this.labelsRef = r)} />\n </Wrapper>\n\n <CommentContainer label={'Comment'}>\n <EditableHtml\n className=\"prompt\"\n markup={comment || ''}\n onChange={onCommentChange}\n width={width && (width + 104).toString()}\n disabled={disabled}\n pluginProps={{\n math: {\n disabled: disabledMath,\n customKeys: customKeys,\n keypadMode: keypadMode,\n controlledKeypadMode: false,\n },\n video: {\n disabled: true,\n },\n audio: {\n disabled: true,\n },\n textAlign: {\n disabled: true,\n },\n h3: {\n disabled: true,\n },\n }}\n />\n </CommentContainer>\n\n <AnnotationMenu\n anchorEl={anchorEl}\n open={openedMenu && !disabled}\n annotations={predefinedAnnotations}\n isNewAnnotation={!!selectionDetails}\n onClose={this.handleClose}\n onDelete={this.deleteAnnotation}\n onEdit={this.editAnnotation}\n onWrite={this.addAnnotation}\n onAnnotate={this.handleMenuClick}\n />\n\n <FreeformEditor\n anchorEl={this.textRef}\n open={openedEditor && !disabled}\n offset={topOffset}\n value={(annotation && annotation.label) || ''}\n type={annotation && annotation.type}\n onClose={this.handleClose}\n onDelete={this.deleteAnnotation}\n onSave={this.updateAnnotation}\n onTypeChange={this.changeAnnotationType}\n />\n </div>\n );\n }\n}\n\nexport default AnnotationEditor;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/extended-text-entry/src/main.jsx\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 PropTypes from 'prop-types';\nimport { debounce } from '@pie-element/shared-lodash';\nimport debug from 'debug';\n\nimport Typography from '@mui/material/Typography';\nimport { styled } from '@mui/material/styles';\n\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport { color, Feedback as FeedbackImport, Collapsible as CollapsibleImport, PreviewPrompt as PreviewPromptImport, UiLayout as UiLayoutImport } from '@pie-lib/render-ui';\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nconst UiLayout = unwrapReactInteropSymbol(UiLayoutImport, 'UiLayout') || unwrapReactInteropSymbol(renderUi.UiLayout, 'UiLayout');\nconst PreviewPrompt = unwrapReactInteropSymbol(PreviewPromptImport, 'PreviewPrompt') || unwrapReactInteropSymbol(renderUi.PreviewPrompt, 'PreviewPrompt');\nconst Collapsible = unwrapReactInteropSymbol(CollapsibleImport, 'Collapsible') || unwrapReactInteropSymbol(renderUi.Collapsible, 'Collapsible');\nconst Feedback = unwrapReactInteropSymbol(FeedbackImport, 'Feedback') || unwrapReactInteropSymbol(renderUi.Feedback, 'Feedback');\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nimport AnnotationEditor from './annotation/annotation-editor.js';\n\nconst log = debug('@pie-ui:extended-text-entry');\n\nconst MainContainer: any = styled(UiLayout)({\n backgroundColor: color.background(),\n color: color.text(),\n});\n\nconst StyledPrompt: any = styled(Typography)(({ theme }) => ({\n width: '100%',\n color: color.text(),\n marginBottom: theme.spacing(2),\n fontSize: 'inherit',\n display: 'block',\n}));\n\nconst TeacherInstructions: any = styled('div')(({ theme }) => ({\n marginBottom: theme.spacing(2),\n}));\n\nconst Editor: any = styled(EditableHtml)(({ theme }) => ({\n marginBottom: theme.spacing(2),\n borderRadius: '4px',\n}));\n\nconst SrOnly: any = styled('h2')({\n position: 'absolute',\n left: '-10000px',\n top: 'auto',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n});\n\nexport class Main extends React.Component {\n static propTypes = {\n onValueChange: PropTypes.func.isRequired,\n onAnnotationsChange: PropTypes.func.isRequired,\n onCommentChange: PropTypes.func.isRequired,\n model: PropTypes.object,\n session: PropTypes.shape({\n value: PropTypes.string,\n annotations: PropTypes.array,\n comment: PropTypes.string,\n }).isRequired,\n };\n\n changeSessionValue = debounce(this.props.onValueChange, 1500);\n\n changeSessionComment = debounce(this.props.onCommentChange, 1500);\n\n render() {\n const { model, session, onAnnotationsChange } = this.props;\n const {\n animationsDisabled,\n annotatorMode,\n customKeys,\n dimensions,\n disabled,\n disabledAnnotator,\n equationEditor,\n extraCSSRules,\n feedback,\n mathInput,\n playersToolbarPosition,\n predefinedAnnotations,\n prompt,\n spanishInput,\n specialInput,\n spellCheckEnabled,\n teacherInstructions,\n } = model;\n const { annotations, comment, value } = session;\n const { width, height } = dimensions || {};\n const maxHeight = '40vh';\n const toolbarOpts = { position: playersToolbarPosition === 'top' ? 'top' : 'bottom' };\n\n log('[render] disabled? ', disabled);\n\n const teacherInstructionsDiv = (\n <PreviewPrompt defaultClassName=\"teacher-instructions\" prompt={teacherInstructions} />\n );\n\n const languageCharactersProps = [];\n\n if (spanishInput) {\n languageCharactersProps.push({ language: 'spanish' });\n }\n\n if (specialInput) {\n languageCharactersProps.push({ language: 'special' });\n }\n\n return (\n <MainContainer\n extraCSSRules={extraCSSRules}\n ref={(ref) => {\n this.containerRef = ref;\n }}\n >\n <SrOnly>Constructed Response Question</SrOnly>\n\n {teacherInstructions && (\n <TeacherInstructions>\n {!animationsDisabled ? (\n <Collapsible\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n ) : (\n teacherInstructionsDiv\n )}\n </TeacherInstructions>\n )}\n\n {prompt && (\n <StyledPrompt component={'span'}>\n <PreviewPrompt defaultClassName=\"prompt\" prompt={model.prompt} />\n </StyledPrompt>\n )}\n\n {annotatorMode ? (\n <AnnotationEditor\n text={value || ''}\n annotations={annotations || []}\n comment={comment || ''}\n predefinedAnnotations={predefinedAnnotations || []}\n onChange={onAnnotationsChange}\n onCommentChange={this.changeSessionComment}\n width={width}\n height={height}\n maxHeight={maxHeight}\n disabled={disabledAnnotator}\n disabledMath={!mathInput}\n customKeys={customKeys}\n keypadMode={equationEditor}\n />\n ) : (\n <Editor\n className=\"response-area-editor\"\n onChange={this.changeSessionValue}\n markup={value || ''}\n maxWidth={width && width.toString()}\n minWidth={'100px'}\n minHeight={height && height.toString()}\n maxHeight={maxHeight}\n disabled={disabled}\n highlightShape={true}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n charactersLimit={50000}\n autoWidthToolbar\n pluginProps={{\n math: {\n disabled: !mathInput,\n customKeys: this.props.model.customKeys,\n keypadMode: this.props.model.equationEditor,\n controlledKeypadMode: false,\n },\n video: {\n disabled: true,\n },\n audio: {\n disabled: true,\n },\n table: {\n disabled: true,\n },\n textAlign: {\n disabled: true,\n },\n h3: {\n disabled: true,\n },\n separateParagraphs: { disabled: false },\n ul_list: { disabled: true },\n ol_list: { disabled: true },\n }}\n languageCharactersProps={languageCharactersProps}\n />\n )}\n\n {feedback && <Feedback correctness=\"correct\" feedback={feedback} />}\n </MainContainer>\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;kEAWM,KAAiC,GAAM,GAAY,MAAc;CACrE,IAAM,IAAQ,KAAwB,CAAC,GACjC,IAAS,EAAM,QAAQ,GAAK,MAAS,IAAM,EAAK,YAAY,QAAQ,CAAC,GACvE,IA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iB;MAAS,QAAQ,EAAM;KAAS,CAAA;IACpD,CAAA;IAGf,IACC,kBAAC,GAAD;KACE,MAAM,KAAS;KACf,aAAa,KAAe,CAAC;KAC7B,SAAS,KAAW;KACpB,uBAAuB,KAAyB,CAAC;KACjD,UAAU;KACV,iBAAiB,KAAK;KACf;KACC;KACG;KACX,UAAU;KACV,cAAc,CAAC;KACH;KACZ,YAAY;IACb,CAAA,IAED,kBAAC,IAAD;KACE,WAAU;KACV,UAAU,KAAK;KACf,QAAQ,KAAS;KACjB,UAAU,KAAS,EAAM,SAAS;KAClC,UAAU;KACV,WAAW,KAAU,EAAO,SAAS;KAC1B;KACD;KACV,gBAAgB;KACH;KACb,YAAY;KACZ,iBAAiB;KACjB,kBAAA;KACA,aAAa;MACX,MAAM;OACJ,UAAU,CAAC;OACX,YAAY,KAAK,MAAM,MAAM;OAC7B,YAAY,KAAK,MAAM,MAAM;OAC7B,sBAAsB;MACxB;MACA,OAAO,EACL,UAAU,GACZ;MACA,OAAO,EACL,UAAU,GACZ;MACA,OAAO,EACL,UAAU,GACZ;MACA,WAAW,EACT,UAAU,GACZ;MACA,IAAI,EACF,UAAU,GACZ;MACA,oBAAoB,EAAE,UAAU,GAAM;MACtC,SAAS,EAAE,UAAU,GAAK;MAC1B,SAAS,EAAE,UAAU,GAAK;KAC5B;KACyB;IAC1B,CAAA;IAGF,KAAY,kBAAC,IAAD;KAAU,aAAY;KAAoB;IAAW,CAAA;GACrD;;CAEnB;AACF"}
@@ -1,18 +1,18 @@
1
1
  import { a as e, t } from "../browser-kkT1XVKw.js";
2
- import { d as n, v as r, y as i } from "../dist-Cv1iX7rJ.js";
3
- import { t as a } from "../main-DIChM596.js";
2
+ import { K as n, q as r, v as i } from "../dist-BbUdUT_D.js";
3
+ import { t as a } from "../main-CXlds066.js";
4
4
  import o from "react";
5
5
  import { createRoot as s } from "react-dom/client";
6
6
  var c = (0, (/* @__PURE__ */ e(t(), 1)).default)("pie-element:extended-text-entry:print"), l = (e, t) => {
7
- let n = t.role === "instructor", r = i(e);
8
- return r.prompt = r.promptEnabled === !1 ? void 0 : r.prompt, r.teacherInstructions = n && r.teacherInstructionsEnabled !== !1 ? r.teacherInstructions : void 0, r.showTeacherInstructions = n, r.mode = n ? "evaluate" : r.mode, r.dimensions = {
7
+ let n = t.role === "instructor", i = r(e);
8
+ return i.prompt = i.promptEnabled === !1 ? void 0 : i.prompt, i.teacherInstructions = n && i.teacherInstructionsEnabled !== !1 ? i.teacherInstructions : void 0, i.showTeacherInstructions = n, i.mode = n ? "evaluate" : i.mode, i.dimensions = {
9
9
  height: 100,
10
10
  width: 500,
11
- ...r.dimensions
12
- }, r.disabled = !0, r.feedback = void 0, r.animationsDisabled = !0, r;
11
+ ...i.dimensions
12
+ }, i.disabled = !0, i.feedback = void 0, i.animationsDisabled = !0, i;
13
13
  }, u = class extends HTMLElement {
14
14
  constructor() {
15
- super(), this._options = null, this._model = null, this._session = [], this._root = null, this._rerender = r(() => {
15
+ super(), this._options = null, this._model = null, this._session = [], this._root = null, this._rerender = n(() => {
16
16
  if (this._model && this._session && this._options) {
17
17
  let e = l(this._model, this._options), t = o.createElement(a, {
18
18
  model: e,
@@ -23,7 +23,7 @@ var c = (0, (/* @__PURE__ */ e(t(), 1)).default)("pie-element:extended-text-entr
23
23
  onCommentChange: () => {}
24
24
  });
25
25
  this._root ||= s(this), this._root.render(t), queueMicrotask(() => {
26
- c("render complete - render math"), n(this);
26
+ c("render complete - render math"), i(this);
27
27
  });
28
28
  } else c("skip");
29
29
  }, 50, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/print/index.tsx"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/extended-text-entry/src/print.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 { cloneDeep, debounce } from '@pie-element/shared-lodash';\nimport Main from '../delivery/main.js';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\n\nimport debug from 'debug';\n\nconst log = debug('pie-element:extended-text-entry:print');\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n const printModel = cloneDeep(model);\n\n printModel.prompt = printModel.promptEnabled !== false ? printModel.prompt : undefined;\n printModel.teacherInstructions =\n instr && printModel.teacherInstructionsEnabled !== false ? printModel.teacherInstructions : undefined;\n printModel.showTeacherInstructions = instr;\n printModel.mode = instr ? 'evaluate' : printModel.mode;\n\n const defaultDimensions = { height: 100, width: 500 };\n\n printModel.dimensions = {\n ...defaultDimensions,\n ...printModel.dimensions,\n };\n\n printModel.disabled = true;\n printModel.feedback = undefined;\n printModel.animationsDisabled = true;\n\n return printModel;\n};\n\nexport default class ExtendedTextEntryPrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._root = null;\n this._rerender = debounce(\n () => {\n if (this._model && this._session && this._options) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element = React.createElement(Main, {\n model: printModel,\n session: {},\n onChange: () => {},\n onValueChange: () => {},\n onAnnotationsChange: () => {},\n onCommentChange: () => {},\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n queueMicrotask(() => {\n log('render complete - render math');\n renderMath(this);\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n set options(o) {\n this._options = o;\n // re-render so role changes (student/instructor) propagate\n this._rerender();\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n }\n }\n}\n"],"mappings":";;;;;AAkBA,IAAM,KAAA,IAAA,wBAAA,GAAA,SAAY,uCAAuC,GAEnD,KAAqB,GAAO,MAAS;CACzC,IAAM,IAAQ,EAAK,SAAS,cACtB,IAAa,EAAU,CAAK;CAmB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["../../../src/print/index.tsx"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/extended-text-entry/src/print.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 { cloneDeep, debounce } from '@pie-element/shared-lodash';\nimport Main from '../delivery/main.js';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\n\nimport debug from 'debug';\n\nconst log = debug('pie-element:extended-text-entry:print');\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n const printModel = cloneDeep(model);\n\n printModel.prompt = printModel.promptEnabled !== false ? printModel.prompt : undefined;\n printModel.teacherInstructions =\n instr && printModel.teacherInstructionsEnabled !== false ? printModel.teacherInstructions : undefined;\n printModel.showTeacherInstructions = instr;\n printModel.mode = instr ? 'evaluate' : printModel.mode;\n\n const defaultDimensions = { height: 100, width: 500 };\n\n printModel.dimensions = {\n ...defaultDimensions,\n ...printModel.dimensions,\n };\n\n printModel.disabled = true;\n printModel.feedback = undefined;\n printModel.animationsDisabled = true;\n\n return printModel;\n};\n\nexport default class ExtendedTextEntryPrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._root = null;\n this._rerender = debounce(\n () => {\n if (this._model && this._session && this._options) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element = React.createElement(Main, {\n model: printModel,\n session: {},\n onChange: () => {},\n onValueChange: () => {},\n onAnnotationsChange: () => {},\n onCommentChange: () => {},\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n queueMicrotask(() => {\n log('render complete - render math');\n renderMath(this);\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n set options(o) {\n this._options = o;\n // re-render so role changes (student/instructor) propagate\n this._rerender();\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n }\n }\n}\n"],"mappings":";;;;;AAkBA,IAAM,KAAA,IAAA,wBAAA,EAAA,CAAA,QAAA,CAAY,uCAAuC,GAEnD,KAAqB,GAAO,MAAS;CACzC,IAAM,IAAQ,EAAK,SAAS,cACtB,IAAa,EAAU,CAAK;CAmBlC,OAjBA,EAAW,SAAS,EAAW,kBAAkB,KAA4B,KAAA,IAApB,EAAW,QACpE,EAAW,sBACT,KAAS,EAAW,+BAA+B,KAAQ,EAAW,sBAAsB,KAAA,GAC9F,EAAW,0BAA0B,GACrC,EAAW,OAAO,IAAQ,aAAa,EAAW,MAIlD,EAAW,aAAa;EAFI,QAAQ;EAAK,OAAO;EAI9C,GAAG,EAAW;CAChB,GAEA,EAAW,WAAW,IACtB,EAAW,WAAW,KAAA,GACtB,EAAW,qBAAqB,IAEzB;AACT,GAEqB,IAArB,cAAoD,YAAY;CAC9D,cAAc;EAMZ,AALA,MAAM,GACN,KAAK,WAAW,MAChB,KAAK,SAAS,MACd,KAAK,WAAW,CAAC,GACjB,KAAK,QAAQ,MACb,KAAK,YAAY,QACT;GACJ,IAAI,KAAK,UAAU,KAAK,YAAY,KAAK,UAAU;IACjD,IAAM,IAAa,EAAkB,KAAK,QAAQ,KAAK,QAAQ,GAEzD,IAAU,EAAM,cAAc,GAAM;KACxC,OAAO;KACP,SAAS,CAAC;KACV,gBAAgB,CAAC;KACjB,qBAAqB,CAAC;KACtB,2BAA2B,CAAC;KAC5B,uBAAuB,CAAC;IAC1B,CAAC;IAMD,AAJA,AACE,KAAK,UAAQ,EAAW,IAAI,GAE9B,KAAK,MAAM,OAAO,CAAO,GACzB,qBAAqB;KAEnB,AADA,EAAI,+BAA+B,GACnC,EAAW,IAAI;IACjB,CAAC;GACH,OACE,EAAI,MAAM;EAEd,GACA,IACA;GAAE,SAAS;GAAO,UAAU;EAAK,CACnC;CACF;CACA,IAAI,QAAQ,GAAG;EAGb,AAFA,KAAK,WAAW,GAEhB,KAAK,UAAU;CACjB;CAEA,IAAI,MAAM,GAAG;EAEX,AADA,KAAK,SAAS,GACd,KAAK,UAAU;CACjB;CAEA,oBAAoB,CAAC;CAErB,uBAAuB;EACrB,AAAI,KAAK,SACP,KAAK,MAAM,QAAQ;CAEvB;AACF"}
@@ -50,7 +50,7 @@ async function o(e, t, i) {
50
50
  spellCheckEnabled: !o.playerSpellCheckDisabled,
51
51
  playersToolbarPosition: o.playersToolbarPosition || "bottom",
52
52
  annotatorMode: u,
53
- disabledAnnotator: o.annotationsEnabled ? i.role !== "instructor" : !0,
53
+ disabledAnnotator: !o.annotationsEnabled || i.role !== "instructor",
54
54
  predefinedAnnotations: o.annotationsEnabled ? o.predefinedAnnotations : [],
55
55
  extraCSSRules: o.extraCSSRules
56
56
  }));
@@ -1,10 +1,11 @@
1
1
  import e from "react";
2
2
  import t from "prop-types";
3
3
  import { styled as n } from "@mui/material/styles";
4
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
- import { Popover as a } from "@mui/material";
4
+ import { color as r } from "@pie-lib/render-ui";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import { Popover as o } from "@mui/material";
6
7
  //#region src/delivery/annotation/annotation-menu.tsx
7
- var o = n(a)({ "& .MuiPaper-root": {
8
+ var s = n(o)({ "& .MuiPaper-root": {
8
9
  overflowX: "unset",
9
10
  overflowY: "unset",
10
11
  marginTop: "-16px",
@@ -17,39 +18,39 @@ var o = n(a)({ "& .MuiPaper-root": {
17
18
  width: 0,
18
19
  pointerEvents: "none",
19
20
  borderWidth: "7px",
20
- borderTopColor: "black"
21
+ borderTopColor: r.border()
21
22
  }
22
- } }), s = n("div")(({ theme: e }) => ({
23
+ } }), c = n("div")(() => ({
23
24
  width: "300px",
24
25
  overflow: "hidden",
25
26
  borderRadius: "4px",
26
- backgroundColor: e.palette.common.white,
27
- border: `2px solid ${e.palette.grey[100]}`
28
- })), c = n("div")({
27
+ backgroundColor: r.white(),
28
+ border: `2px solid ${r.border()}`
29
+ })), l = n("div")({
29
30
  display: "flex",
30
31
  flexWrap: "wrap"
31
- }), l = n("div")(({ theme: e }) => ({
32
+ }), u = n("div")(() => ({
32
33
  display: "flex",
33
34
  flexWrap: "wrap",
34
- borderTop: `2px solid ${e.palette.grey[100]}`
35
- })), u = n("div")(({ theme: e, variant: t }) => ({
35
+ borderTop: `2px solid ${r.border()}`
36
+ })), d = n("div")(({ variant: e }) => ({
36
37
  width: "22%",
37
38
  textAlign: "center",
38
39
  padding: "4px",
39
40
  cursor: "pointer",
40
- borderBottom: `1px solid ${e.palette.grey[100]}`,
41
- "&:not(:nth-child(4n))": { borderRight: `1px solid ${e.palette.grey[100]}` },
41
+ borderBottom: `1px solid ${r.border()}`,
42
+ "&:not(:nth-child(4n))": { borderRight: `1px solid ${r.border()}` },
42
43
  "&:nth-child(4n)": { flexGrow: 1 },
43
- "&:hover": { backgroundColor: e.palette.grey[100] },
44
- ...t === "positive" && {
44
+ "&:hover": { backgroundColor: r.backgroundDark() },
45
+ ...e === "positive" && {
45
46
  backgroundColor: "rgb(153, 255, 153) !important",
46
47
  "&:hover": { filter: "brightness(85%)" }
47
48
  },
48
- ...t === "negative" && {
49
+ ...e === "negative" && {
49
50
  backgroundColor: "rgb(255, 204, 238) !important",
50
51
  "&:hover": { filter: "brightness(85%)" }
51
52
  }
52
- })), d = class extends e.Component {
53
+ })), f = class extends e.Component {
53
54
  static propTypes = {
54
55
  anchorEl: t.object,
55
56
  open: t.bool,
@@ -62,8 +63,8 @@ var o = n(a)({ "& .MuiPaper-root": {
62
63
  onAnnotate: t.func
63
64
  };
64
65
  render() {
65
- let { anchorEl: t, annotations: n, isNewAnnotation: a, onAnnotate: d, onClose: f, onEdit: p, onDelete: m, onWrite: h, open: g } = this.props;
66
- return /* @__PURE__ */ r(o, {
66
+ let { anchorEl: t, annotations: n, isNewAnnotation: r, onAnnotate: o, onClose: f, onEdit: p, onDelete: m, onWrite: h, open: g } = this.props;
67
+ return /* @__PURE__ */ i(s, {
67
68
  anchorEl: t,
68
69
  open: g,
69
70
  onClose: f,
@@ -80,28 +81,28 @@ var o = n(a)({ "& .MuiPaper-root": {
80
81
  vertical: "bottom",
81
82
  horizontal: "center"
82
83
  },
83
- children: /* @__PURE__ */ i(s, { children: [/* @__PURE__ */ r(c, { children: n.map((e, t) => /* @__PURE__ */ r(u, {
84
+ children: /* @__PURE__ */ a(c, { children: [/* @__PURE__ */ i(l, { children: n.map((e, t) => /* @__PURE__ */ i(d, {
84
85
  variant: e.type,
85
- onClick: () => d(e),
86
+ onClick: () => o(e),
86
87
  children: e.label
87
- }, `annotation-${t}`)) }), /* @__PURE__ */ i(l, { children: [
88
- /* @__PURE__ */ r(u, {
88
+ }, `annotation-${t}`)) }), /* @__PURE__ */ a(u, { children: [
89
+ /* @__PURE__ */ i(d, {
89
90
  onClick: f,
90
91
  children: "Cancel"
91
92
  }),
92
- /* @__PURE__ */ r(u, { style: { pointerEvents: "none" } }),
93
- a ? /* @__PURE__ */ i(e.Fragment, { children: [/* @__PURE__ */ r(u, {
93
+ /* @__PURE__ */ i(d, { style: { pointerEvents: "none" } }),
94
+ r ? /* @__PURE__ */ a(e.Fragment, { children: [/* @__PURE__ */ i(d, {
94
95
  variant: "positive",
95
96
  onClick: () => h("positive"),
96
97
  children: "Write"
97
- }), /* @__PURE__ */ r(u, {
98
+ }), /* @__PURE__ */ i(d, {
98
99
  variant: "negative",
99
100
  onClick: () => h("negative"),
100
101
  children: "Write"
101
- })] }) : /* @__PURE__ */ i(e.Fragment, { children: [/* @__PURE__ */ r(u, {
102
+ })] }) : /* @__PURE__ */ a(e.Fragment, { children: [/* @__PURE__ */ i(d, {
102
103
  onClick: m,
103
104
  children: "Delete"
104
- }), /* @__PURE__ */ r(u, {
105
+ }), /* @__PURE__ */ i(d, {
105
106
  onClick: p,
106
107
  children: "Edit"
107
108
  })] })
@@ -110,4 +111,4 @@ var o = n(a)({ "& .MuiPaper-root": {
110
111
  }
111
112
  };
112
113
  //#endregion
113
- export { d as default };
114
+ export { f as default };