@pie-element/extended-text-entry 15.1.2-next.0 → 15.1.2-next.2

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.
Files changed (131) hide show
  1. package/dist/browser/author/index.js +1 -1
  2. package/dist/browser/browser-kkT1XVKw.js +13 -4
  3. package/dist/browser/delivery/index.js +2 -2
  4. package/dist/browser/{dist-D8VooYkz.js → dist-BCJzhghM.js} +9189 -10344
  5. package/dist/browser/dist-BCJzhghM.js.map +1 -0
  6. package/dist/browser/{main-C2oHx_V9.js → main-VcQEFn-b.js} +2 -2
  7. package/dist/browser/{main-C2oHx_V9.js.map → main-VcQEFn-b.js.map} +1 -1
  8. package/dist/browser/print/index.js +9 -14
  9. package/dist/browser/print/index.js.map +1 -1
  10. package/dist/delivery/main.d.ts +2 -2
  11. package/dist/delivery/main.js +18 -18
  12. package/dist/index.iife.js +99 -99
  13. package/dist/print/index.js +9 -10
  14. package/dist/runtime-support.d.ts +12 -0
  15. package/dist/runtime-support.js +12 -0
  16. package/package.json +11 -8
  17. package/dist/browser/dist-D8VooYkz.js.map +0 -1
  18. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
  19. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
  20. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
  21. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
  22. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
  23. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
  24. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
  25. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
  26. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
  27. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
  28. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
  29. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
  30. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
  31. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
  32. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
  33. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
  34. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
  35. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
  36. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
  37. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
  38. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
  39. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
  40. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  41. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
  42. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
  43. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
  44. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
  45. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
  46. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js +0 -8
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js +0 -8
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/debounce.js +0 -50
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/now.js +0 -7
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js +0 -19
@@ -1,5 +1,5 @@
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-D8VooYkz.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-BCJzhghM.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
@@ -711,4 +711,4 @@ var q = K(c, "UiLayout") || K(Q.UiLayout, "UiLayout"), J = K(a, "PreviewPrompt")
711
711
  //#endregion
712
712
  export { ue as t };
713
713
 
714
- //# sourceMappingURL=main-C2oHx_V9.js.map
714
+ //# sourceMappingURL=main-VcQEFn-b.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"main-C2oHx_V9.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';\n\nconst StyledPopover: any = styled(Popover)(({ theme, 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: theme.palette.grey[100],\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\nconst Wrapper: any = styled('div')(({ theme, annotationType }) => ({\n width: '200px',\n overflow: 'hidden',\n borderRadius: '4px',\n backgroundColor: '#ffffff',\n border: `4px solid ${theme.palette.grey[100]}`,\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')(({ theme }) => ({\n display: 'flex',\n flexWrap: 'wrap',\n borderTop: `2px solid ${theme.palette.grey[100]}`,\n}));\n\nconst Button: any = styled('div')(({ theme, 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 ${theme.palette.grey[100]}`,\n },\n '&:hover': {\n backgroundColor: theme.palette.grey[100],\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';\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: 'black',\n },\n },\n});\n\nconst MainWrapper: any = styled('div')(({ theme }) => ({\n width: '300px',\n overflow: 'hidden',\n borderRadius: '4px',\n backgroundColor: theme.palette.common.white,\n border: `2px solid ${theme.palette.grey[100]}`,\n}));\n\nconst AnnotationsWrapper: any = styled('div')({\n display: 'flex',\n flexWrap: 'wrap',\n});\n\nconst ControlsWrapper: any = styled('div')(({ theme }) => ({\n display: 'flex',\n flexWrap: 'wrap',\n borderTop: `2px solid ${theme.palette.grey[100]}`,\n}));\n\nconst Button: any = styled('div')(({ theme, variant }) => ({\n width: '22%',\n textAlign: 'center',\n padding: '4px',\n cursor: 'pointer',\n borderBottom: `1px solid ${theme.palette.grey[100]}`,\n '&:not(:nth-child(4n))': {\n borderRight: `1px solid ${theme.palette.grey[100]}`,\n },\n '&:nth-child(4n)': {\n flexGrow: 1,\n },\n '&:hover': {\n backgroundColor: theme.palette.grey[100],\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 'lodash-es';\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}));\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":";;;;;kEAWA,KAAA,GAAA,GAAA,MAAA;;;;;AAwBA,GAGA,KAAA,GAAA,GAAA,MAAA;;;;;;;;;;;AAqBA,GAKA,KAAA,MAAA;;;;;;;;;AAsDA,GAEA,KAAA,MAAA;;;AAMA,GAGA,KAAA,MAAA;;;;;;;;;;;;;;;AAkCA,GAGA,KAAA,GAAA,MAAA;;;;;;;;;AAgBA,GAGA,KAAA,GAAA,MAAA;;;;;;;AAkBA,GAGA,UAAA;;AAmBA,GAGA,KAAA,MAAA,EAAA,UAAA,MAAA,EAAA,OAAA,YAAA,MAAA,IAEA,KAAA,MAAA,MAAA,KAAA,SAAA,iBAAA,aAAA,EAAA,GAAA,CAAA,GAEA,KAAA,MAAA,SAAA,cAAA,iBAAA,EAAA,GAAA,GCzNM,IAAqB,EAAO,CAAO,GAAG,EAAE,UAAO,yBAAsB,EACzE,oBAAoB;CAClB,WAAW;CACX,WAAW;CACX,YAAY;CACZ,aAAa;EACX,UAAU;EACV,OAAO;EACP,KAAK;EACL,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,OAAO;EACP,eAAe;EACf,aAAa;EACb,kBAAkB,EAAM,QAAQ,KAAK;CACvC;CACA,GAAI,MAAmB,cAAc,E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AQ;MAA6B,SAAS;KAA4B;eAEnF;IACU,CAAA,EAII,CAAA;IAGtB,KACC,kBAAC,IAAD;KAAc,WAAW;eACvB,kBAAC,GAAD;MAAe,kBAAiB;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
+ {"version":3,"file":"main-VcQEFn-b.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';\n\nconst StyledPopover: any = styled(Popover)(({ theme, 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: theme.palette.grey[100],\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\nconst Wrapper: any = styled('div')(({ theme, annotationType }) => ({\n width: '200px',\n overflow: 'hidden',\n borderRadius: '4px',\n backgroundColor: '#ffffff',\n border: `4px solid ${theme.palette.grey[100]}`,\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')(({ theme }) => ({\n display: 'flex',\n flexWrap: 'wrap',\n borderTop: `2px solid ${theme.palette.grey[100]}`,\n}));\n\nconst Button: any = styled('div')(({ theme, 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 ${theme.palette.grey[100]}`,\n },\n '&:hover': {\n backgroundColor: theme.palette.grey[100],\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';\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: 'black',\n },\n },\n});\n\nconst MainWrapper: any = styled('div')(({ theme }) => ({\n width: '300px',\n overflow: 'hidden',\n borderRadius: '4px',\n backgroundColor: theme.palette.common.white,\n border: `2px solid ${theme.palette.grey[100]}`,\n}));\n\nconst AnnotationsWrapper: any = styled('div')({\n display: 'flex',\n flexWrap: 'wrap',\n});\n\nconst ControlsWrapper: any = styled('div')(({ theme }) => ({\n display: 'flex',\n flexWrap: 'wrap',\n borderTop: `2px solid ${theme.palette.grey[100]}`,\n}));\n\nconst Button: any = styled('div')(({ theme, variant }) => ({\n width: '22%',\n textAlign: 'center',\n padding: '4px',\n cursor: 'pointer',\n borderBottom: `1px solid ${theme.palette.grey[100]}`,\n '&:not(:nth-child(4n))': {\n borderRight: `1px solid ${theme.palette.grey[100]}`,\n },\n '&:nth-child(4n)': {\n flexGrow: 1,\n },\n '&:hover': {\n backgroundColor: theme.palette.grey[100],\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}));\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":";;;;;kEAWA,KAAA,GAAA,GAAA,MAAA;;;;;AAwBA,GAGA,KAAA,GAAA,GAAA,MAAA;;;;;;;;;;;AAqBA,GAKA,KAAA,MAAA;;;;;;;;;AAsDA,GAEA,KAAA,MAAA;;;AAMA,GAGA,KAAA,MAAA;;;;;;;;;;;;;;;AAkCA,GAGA,KAAA,GAAA,MAAA;;;;;;;;;AAgBA,GAGA,KAAA,GAAA,MAAA;;;;;;;AAkBA,GAGA,UAAA;;AAmBA,GAGA,KAAA,MAAA,EAAA,UAAA,MAAA,EAAA,OAAA,YAAA,MAAA,IAEA,KAAA,MAAA,MAAA,KAAA,SAAA,iBAAA,aAAA,EAAA,GAAA,CAAA,GAEA,KAAA,MAAA,SAAA,cAAA,iBAAA,EAAA,GAAA,GCzNM,IAAqB,EAAO,CAAO,GAAG,EAAE,UAAO,yBAAsB,EACzE,oBAAoB;CAClB,WAAW;CACX,WAAW;CACX,YAAY;CACZ,aAAa;EACX,UAAU;EACV,OAAO;EACP,KAAK;EACL,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,OAAO;EACP,eAAe;EACf,aAAa;EACb,kBAAkB,EAAM,QAAQ,KAAK;CACvC;CACA,GAAI,MAAmB,cAAc,EACnC,aAAa,EACX,kBAAkB,gCACpB,EACF;CACA,GAAI,MAAmB,cAAc,EACnC,aAAa,EACX,kBAAkB,gCACpB,EACF;AACF,EACF,EAAE,GAEI,IAAe,EAAO,KAAK,GAAG,EAAE,UAAO,yBAAsB;CACjE,OAAO;CACP,UAAU;CACV,cAA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E,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,25 +1,20 @@
1
1
  import { a as e, t } from "../browser-kkT1XVKw.js";
2
- import { d as n, v as r, y as i } from "../dist-D8VooYkz.js";
3
- import { t as a } from "../main-C2oHx_V9.js";
2
+ import { d as n, v as r, y as i } from "../dist-BCJzhghM.js";
3
+ import { t as a } from "../main-VcQEFn-b.js";
4
4
  import o from "react";
5
5
  import { createRoot as s } from "react-dom/client";
6
- //#region ../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js
7
- var c = 1, l = 4;
8
- function u(e) {
9
- return i(e, c | l);
10
- }
11
- var d = (0, (/* @__PURE__ */ e(t(), 1)).default)("pie-element:extended-text-entry:print"), f = (e, t) => {
12
- let n = t.role === "instructor", r = u(e);
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);
13
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 = {
14
9
  height: 100,
15
10
  width: 500,
16
11
  ...r.dimensions
17
12
  }, r.disabled = !0, r.feedback = void 0, r.animationsDisabled = !0, r;
18
- }, p = class extends HTMLElement {
13
+ }, u = class extends HTMLElement {
19
14
  constructor() {
20
15
  super(), this._options = null, this._model = null, this._session = [], this._root = null, this._rerender = r(() => {
21
16
  if (this._model && this._session && this._options) {
22
- let e = f(this._model, this._options), t = o.createElement(a, {
17
+ let e = l(this._model, this._options), t = o.createElement(a, {
23
18
  model: e,
24
19
  session: {},
25
20
  onChange: () => {},
@@ -28,9 +23,9 @@ var d = (0, (/* @__PURE__ */ e(t(), 1)).default)("pie-element:extended-text-entr
28
23
  onCommentChange: () => {}
29
24
  });
30
25
  this._root ||= s(this), this._root.render(t), queueMicrotask(() => {
31
- d("render complete - render math"), n(this);
26
+ c("render complete - render math"), n(this);
32
27
  });
33
- } else d("skip");
28
+ } else c("skip");
34
29
  }, 50, {
35
30
  leading: !1,
36
31
  trailing: !0
@@ -48,6 +43,6 @@ var d = (0, (/* @__PURE__ */ e(t(), 1)).default)("pie-element:extended-text-entr
48
43
  }
49
44
  };
50
45
  //#endregion
51
- export { p as default };
46
+ export { u as default };
52
47
 
53
48
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js","../../../src/print/index.tsx"],"sourcesContent":["import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","// @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 'lodash-es';\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"],"x_google_ignoreList":[0],"mappings":";;;;;;AAGA,IAAI,IAAkB,GAClB,IAAqB;AAoBzB,SAAS,EAAU,GAAO;CACxB,OAAO,EAAU,GAAO,IAAkB,CAAkB;AAC9D;ACRA,IAAM,KAAA,IAAA,wBAAA,GAAA,SAAY,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"}
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;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"}
@@ -20,8 +20,8 @@ export declare class Main extends React.Component {
20
20
  comment: PropTypes.Requireable<string>;
21
21
  }>>>;
22
22
  };
23
- changeSessionValue: any;
24
- changeSessionComment: any;
23
+ changeSessionValue: import("@pie-element/shared-lodash").CancelableFunction<any>;
24
+ changeSessionComment: import("@pie-element/shared-lodash").CancelableFunction<any>;
25
25
  render(): React.JSX.Element;
26
26
  }
27
27
  export default Main;
@@ -1,7 +1,7 @@
1
- import e from "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/debounce.js";
2
- import t from "./annotation/annotation-editor.js";
3
- import n from "react";
4
- import r from "prop-types";
1
+ import e from "./annotation/annotation-editor.js";
2
+ import t from "react";
3
+ import n from "prop-types";
4
+ import { debounce as r } from "@pie-element/shared-lodash";
5
5
  import i from "debug";
6
6
  import a from "@mui/material/Typography";
7
7
  import { styled as o } from "@mui/material/styles";
@@ -34,22 +34,22 @@ var v = _(f, "UiLayout") || _(w.UiLayout, "UiLayout"), y = _(d, "PreviewPrompt")
34
34
  width: "1px",
35
35
  height: "1px",
36
36
  overflow: "hidden"
37
- }), j = class extends n.Component {
37
+ }), j = class extends t.Component {
38
38
  static propTypes = {
39
- onValueChange: r.func.isRequired,
40
- onAnnotationsChange: r.func.isRequired,
41
- onCommentChange: r.func.isRequired,
42
- model: r.object,
43
- session: r.shape({
44
- value: r.string,
45
- annotations: r.array,
46
- comment: r.string
39
+ onValueChange: n.func.isRequired,
40
+ onAnnotationsChange: n.func.isRequired,
41
+ onCommentChange: n.func.isRequired,
42
+ model: n.object,
43
+ session: n.shape({
44
+ value: n.string,
45
+ annotations: n.array,
46
+ comment: n.string
47
47
  }).isRequired
48
48
  };
49
- changeSessionValue = e(this.props.onValueChange, 1500);
50
- changeSessionComment = e(this.props.onCommentChange, 1500);
49
+ changeSessionValue = r(this.props.onValueChange, 1500);
50
+ changeSessionComment = r(this.props.onCommentChange, 1500);
51
51
  render() {
52
- let { model: e, session: n, onAnnotationsChange: r } = this.props, { animationsDisabled: i, annotatorMode: a, customKeys: o, dimensions: s, disabled: c, disabledAnnotator: l, equationEditor: u, extraCSSRules: d, feedback: f, mathInput: p, playersToolbarPosition: g, predefinedAnnotations: _, prompt: v, spanishInput: S, specialInput: C, spellCheckEnabled: w, teacherInstructions: j } = e, { annotations: M, comment: N, value: P } = n, { width: F, height: I } = s || {}, L = "40vh", R = { position: g === "top" ? "top" : "bottom" };
52
+ let { model: t, session: n, onAnnotationsChange: r } = this.props, { animationsDisabled: i, annotatorMode: a, customKeys: o, dimensions: s, disabled: c, disabledAnnotator: l, equationEditor: u, extraCSSRules: d, feedback: f, mathInput: p, playersToolbarPosition: g, predefinedAnnotations: _, prompt: v, spanishInput: S, specialInput: C, spellCheckEnabled: w, teacherInstructions: j } = t, { annotations: M, comment: N, value: P } = n, { width: F, height: I } = s || {}, L = "40vh", R = { position: g === "top" ? "top" : "bottom" };
53
53
  T("[render] disabled? ", c);
54
54
  let z = /* @__PURE__ */ m(y, {
55
55
  defaultClassName: "teacher-instructions",
@@ -73,10 +73,10 @@ var v = _(f, "UiLayout") || _(w.UiLayout, "UiLayout"), y = _(d, "PreviewPrompt")
73
73
  component: "span",
74
74
  children: /* @__PURE__ */ m(y, {
75
75
  defaultClassName: "prompt",
76
- prompt: e.prompt
76
+ prompt: t.prompt
77
77
  })
78
78
  }),
79
- a ? /* @__PURE__ */ m(t, {
79
+ a ? /* @__PURE__ */ m(e, {
80
80
  text: P || "",
81
81
  annotations: M || [],
82
82
  comment: N || "",