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

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 (212) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/defaults.d.ts +166 -0
  4. package/dist/author/defaults.js +209 -0
  5. package/dist/author/index.d.ts +52 -0
  6. package/dist/author/index.js +74 -0
  7. package/dist/author/main.d.ts +26 -0
  8. package/dist/author/main.js +166 -0
  9. package/dist/browser/author/index.js +495 -0
  10. package/dist/browser/author/index.js.map +1 -0
  11. package/dist/browser/browser-kkT1XVKw.js +210 -0
  12. package/dist/browser/browser-kkT1XVKw.js.map +1 -0
  13. package/dist/browser/controller/index.js +184 -0
  14. package/dist/browser/controller/index.js.map +1 -0
  15. package/dist/browser/delivery/index.js +98 -0
  16. package/dist/browser/delivery/index.js.map +1 -0
  17. package/dist/browser/dist-D8VooYkz.js +49034 -0
  18. package/dist/browser/dist-D8VooYkz.js.map +1 -0
  19. package/dist/browser/extended-text-entry.css +2 -0
  20. package/dist/browser/main-C2oHx_V9.js +714 -0
  21. package/dist/browser/main-C2oHx_V9.js.map +1 -0
  22. package/dist/browser/print/index.js +53 -0
  23. package/dist/browser/print/index.js.map +1 -0
  24. package/dist/controller/defaults.d.ts +33 -0
  25. package/dist/controller/defaults.js +104 -0
  26. package/dist/controller/index.d.ts +59 -0
  27. package/dist/controller/index.js +72 -0
  28. package/dist/delivery/annotation/annotation-editor.d.ts +47 -0
  29. package/dist/delivery/annotation/annotation-editor.js +296 -0
  30. package/dist/delivery/annotation/annotation-menu.d.ts +25 -0
  31. package/dist/delivery/annotation/annotation-menu.js +113 -0
  32. package/dist/delivery/annotation/annotation-utils.d.ts +20 -0
  33. package/dist/delivery/annotation/annotation-utils.js +65 -0
  34. package/dist/delivery/annotation/freeform-editor.d.ts +30 -0
  35. package/dist/delivery/annotation/freeform-editor.js +143 -0
  36. package/dist/delivery/index.d.ts +23 -0
  37. package/dist/delivery/index.js +68 -0
  38. package/dist/delivery/main.d.ts +27 -0
  39. package/dist/delivery/main.js +134 -0
  40. package/dist/extended-text-entry.css +2 -0
  41. package/dist/index.d.ts +1 -0
  42. package/dist/index.iife.d.ts +8 -0
  43. package/dist/index.iife.js +403 -0
  44. package/dist/index.js +2 -0
  45. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +6 -0
  46. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +16 -0
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +16 -0
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +6 -0
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +16 -0
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +6 -0
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +6 -0
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +14 -0
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +5 -0
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +6 -0
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +7 -0
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +10 -0
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +7 -0
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +10 -0
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +8 -0
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +8 -0
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +8 -0
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +12 -0
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +57 -0
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +14 -0
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +9 -0
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +9 -0
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +11 -0
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +9 -0
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +12 -0
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +13 -0
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +7 -0
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js +8 -0
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +8 -0
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +10 -0
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +8 -0
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +8 -0
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +8 -0
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +8 -0
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +14 -0
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +8 -0
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +5 -0
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +10 -0
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +9 -0
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +8 -0
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +9 -0
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +5 -0
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +10 -0
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +23 -0
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +6 -0
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +7 -0
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +7 -0
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +13 -0
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +9 -0
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +9 -0
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +8 -0
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +33 -0
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +9 -0
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +8 -0
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +7 -0
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +11 -0
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +8 -0
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +6 -0
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +9 -0
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +8 -0
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +7 -0
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +8 -0
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +13 -0
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +7 -0
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +7 -0
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +8 -0
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +5 -0
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +5 -0
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +9 -0
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +8 -0
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +7 -0
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +7 -0
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +6 -0
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +6 -0
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +16 -0
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +15 -0
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js +8 -0
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +8 -0
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/debounce.js +50 -0
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +6 -0
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +10 -0
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +4 -0
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +8 -0
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +6 -0
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +11 -0
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +7 -0
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +7 -0
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +7 -0
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +9 -0
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +7 -0
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +9 -0
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +9 -0
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/now.js +7 -0
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +6 -0
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +6 -0
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js +19 -0
  159. package/dist/print/index.d.ts +15 -0
  160. package/dist/print/index.js +49 -0
  161. package/package.json +83 -21
  162. package/CHANGELOG.json +0 -1282
  163. package/CHANGELOG.md +0 -2260
  164. package/LICENSE.md +0 -5
  165. package/README.md +0 -1
  166. package/configure/CHANGELOG.json +0 -922
  167. package/configure/CHANGELOG.md +0 -1949
  168. package/configure/lib/defaults.js +0 -224
  169. package/configure/lib/defaults.js.map +0 -1
  170. package/configure/lib/index.js +0 -125
  171. package/configure/lib/index.js.map +0 -1
  172. package/configure/lib/main.js +0 -247
  173. package/configure/lib/main.js.map +0 -1
  174. package/configure/package.json +0 -23
  175. package/controller/CHANGELOG.json +0 -362
  176. package/controller/CHANGELOG.md +0 -1179
  177. package/controller/lib/defaults.js +0 -91
  178. package/controller/lib/defaults.js.map +0 -1
  179. package/controller/lib/index.js +0 -101
  180. package/controller/lib/index.js.map +0 -1
  181. package/controller/package.json +0 -16
  182. package/docs/config-schema.json +0 -1782
  183. package/docs/config-schema.json.md +0 -1333
  184. package/docs/demo/config.js +0 -7
  185. package/docs/demo/generate.js +0 -14
  186. package/docs/demo/index.html +0 -3
  187. package/docs/demo/session.js +0 -7
  188. package/docs/pie-schema.json +0 -954
  189. package/docs/pie-schema.json.md +0 -717
  190. package/lib/annotation/annotation-editor.js +0 -636
  191. package/lib/annotation/annotation-editor.js.map +0 -1
  192. package/lib/annotation/annotation-menu.js +0 -147
  193. package/lib/annotation/annotation-menu.js.map +0 -1
  194. package/lib/annotation/annotation-utils.js +0 -205
  195. package/lib/annotation/annotation-utils.js.map +0 -1
  196. package/lib/annotation/freeform-editor.js +0 -241
  197. package/lib/annotation/freeform-editor.js.map +0 -1
  198. package/lib/index.js +0 -108
  199. package/lib/index.js.map +0 -1
  200. package/lib/main.js +0 -205
  201. package/lib/main.js.map +0 -1
  202. package/lib/print.js +0 -86
  203. package/lib/print.js.map +0 -1
  204. package/module/configure.js +0 -1
  205. package/module/controller.js +0 -139
  206. package/module/demo.js +0 -38
  207. package/module/element.js +0 -1
  208. package/module/index.html +0 -21
  209. package/module/manifest.json +0 -22
  210. package/module/print-demo.js +0 -76
  211. package/module/print.html +0 -18
  212. package/module/print.js +0 -1
@@ -0,0 +1,143 @@
1
+ import e from "react";
2
+ import t from "prop-types";
3
+ import { styled as n } from "@mui/material/styles";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import { Popover as a, TextField as o } from "@mui/material";
6
+ //#region src/delivery/annotation/freeform-editor.tsx
7
+ var s = n(a)(({ theme: e, annotationType: t }) => ({ "& .MuiPaper-root": {
8
+ overflowX: "unset",
9
+ overflowY: "unset",
10
+ marginLeft: "16px",
11
+ "&::before": {
12
+ position: "absolute",
13
+ right: "100%",
14
+ top: "13px",
15
+ border: "solid transparent",
16
+ content: "\"\"",
17
+ height: 0,
18
+ width: 0,
19
+ pointerEvents: "none",
20
+ borderWidth: "7px",
21
+ borderRightColor: e.palette.grey[100]
22
+ },
23
+ ...t === "negative" && { "&::before": { borderRightColor: "rgb(255, 204, 238) !important" } },
24
+ ...t === "positive" && { "&::before": { borderRightColor: "rgb(153, 255, 153) !important" } }
25
+ } })), c = n("div")(({ theme: e, annotationType: t }) => ({
26
+ width: "200px",
27
+ overflow: "hidden",
28
+ borderRadius: "4px",
29
+ backgroundColor: "#ffffff",
30
+ border: `4px solid ${e.palette.grey[100]}`,
31
+ ...t === "negative" && { borderColor: "rgb(255, 204, 238) !important" },
32
+ ...t === "positive" && { borderColor: "rgb(153, 255, 153) !important" }
33
+ })), l = n("div")(({ theme: e }) => ({
34
+ display: "flex",
35
+ flexWrap: "wrap",
36
+ borderTop: `2px solid ${e.palette.grey[100]}`
37
+ })), u = n("div")(({ theme: e, variant: t, annotationType: n }) => ({
38
+ flexGrow: 1,
39
+ width: "28%",
40
+ textAlign: "center",
41
+ padding: "4px",
42
+ cursor: "pointer",
43
+ "&:not(:nth-child(3n))": { borderRight: `1px solid ${e.palette.grey[100]}` },
44
+ "&:hover": { backgroundColor: e.palette.grey[100] },
45
+ ...t === "positive" && {
46
+ backgroundColor: "rgb(153, 255, 153) !important",
47
+ "&:hover": { filter: "brightness(85%)" }
48
+ },
49
+ ...t === "negative" && {
50
+ backgroundColor: "rgb(255, 204, 238) !important",
51
+ "&:hover": { filter: "brightness(85%)" }
52
+ },
53
+ ...t === "typeChange" && n === "negative" && { "&:hover": { backgroundColor: "rgb(153, 255, 153) !important" } },
54
+ ...t === "typeChange" && n === "positive" && { "&:hover": { backgroundColor: "rgb(255, 204, 238) !important" } }
55
+ })), d = class extends e.Component {
56
+ static propTypes = {
57
+ anchorEl: t.object,
58
+ open: t.bool,
59
+ offset: t.number,
60
+ value: t.string,
61
+ type: t.string,
62
+ onClose: t.func,
63
+ onDelete: t.func,
64
+ onSave: t.func,
65
+ onTypeChange: t.func
66
+ };
67
+ constructor(e) {
68
+ super(e), this.state = { value: e.value };
69
+ }
70
+ UNSAFE_componentWillReceiveProps(e) {
71
+ let { value: t } = e, { value: n } = this.props;
72
+ t !== n && this.setState({ value: t });
73
+ }
74
+ onValueChange = (e) => this.setState({ value: e.target.value });
75
+ handleSave = () => {
76
+ let { value: e, onSave: t, onClose: n, onDelete: r } = this.props, { value: i } = this.state;
77
+ i === "" && r(), e !== i && t(e, i), this.setState({ value: "" }), n();
78
+ };
79
+ handleTypeChange = () => {
80
+ let { onTypeChange: e, onDelete: t } = this.props, { value: n } = this.state;
81
+ n === "" ? t() : e(n), this.setState({ value: "" });
82
+ };
83
+ render() {
84
+ let { anchorEl: e, offset: t, onDelete: n, open: a, type: d } = this.props, { value: f } = this.state;
85
+ return /* @__PURE__ */ r(s, {
86
+ anchorEl: e,
87
+ elevation: 2,
88
+ open: a,
89
+ onClose: this.handleSave,
90
+ annotationType: d,
91
+ style: {
92
+ marginTop: `${t}px`,
93
+ transition: "margin-top 2s ease-out"
94
+ },
95
+ transitionDuration: {
96
+ enter: 225,
97
+ exit: 195
98
+ },
99
+ anchorOrigin: {
100
+ vertical: "top",
101
+ horizontal: "right"
102
+ },
103
+ transformOrigin: {
104
+ vertical: "top",
105
+ horizontal: "left"
106
+ },
107
+ children: /* @__PURE__ */ i(c, {
108
+ annotationType: d,
109
+ children: [/* @__PURE__ */ r(o, {
110
+ id: "annotation-editor",
111
+ style: {
112
+ padding: "2px 5px",
113
+ width: "95%"
114
+ },
115
+ autoFocus: !0,
116
+ multiline: !0,
117
+ rows: 1,
118
+ maxRows: 4,
119
+ value: f,
120
+ onChange: this.onValueChange,
121
+ InputProps: { disableUnderline: !0 }
122
+ }), /* @__PURE__ */ i(l, { children: [
123
+ /* @__PURE__ */ r(u, {
124
+ onClick: n,
125
+ children: "Delete"
126
+ }),
127
+ /* @__PURE__ */ r(u, {
128
+ variant: "typeChange",
129
+ annotationType: d,
130
+ onClick: this.handleTypeChange,
131
+ children: d === "negative" ? "Green" : "Pink"
132
+ }),
133
+ /* @__PURE__ */ r(u, {
134
+ onClick: this.handleSave,
135
+ children: "Save"
136
+ })
137
+ ] })]
138
+ })
139
+ });
140
+ }
141
+ };
142
+ //#endregion
143
+ export { d as default };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/extended-text-entry/src/index.js
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ export declare function textContent(value: any): any;
10
+ export declare function isComplete(value: any): boolean;
11
+ export default class RootExtendedTextEntry extends HTMLElement {
12
+ constructor();
13
+ setLangAttribute(): void;
14
+ set model(m: any);
15
+ set session(s: any);
16
+ get session(): any;
17
+ valueChange(value: any): void;
18
+ annotationsChange(annotations: any): void;
19
+ commentChange(comment: any): void;
20
+ connectedCallback(): void;
21
+ render(): void;
22
+ disconnectedCallback(): void;
23
+ }
@@ -0,0 +1,68 @@
1
+ import e from "./main.js";
2
+ import t from "react";
3
+ import n from "debug";
4
+ import { createRoot as r } from "react-dom/client";
5
+ import { renderMath as i } from "@pie-element/shared-math-rendering-mathjax";
6
+ import { ModelSetEvent as a, SessionChangedEvent as o } from "@pie-element/shared-player-events";
7
+ //#region src/delivery/index.ts
8
+ var s = n("@pie-elements:extended-text-entry"), c = new DOMParser();
9
+ function l(e) {
10
+ if (typeof e == "string") try {
11
+ return c.parseFromString(e, "text/html").body.textContent;
12
+ } catch {
13
+ return s("tried to parse as dom and failed", e), e;
14
+ }
15
+ }
16
+ function u(e) {
17
+ let t = l(e);
18
+ return t !== void 0 && t.length > 0;
19
+ }
20
+ var d = class extends HTMLElement {
21
+ constructor() {
22
+ super(), this._model = null, this._session = null, this._root = null;
23
+ }
24
+ setLangAttribute() {
25
+ let e = this._model && typeof this._model.language ? this._model.language : "", t = e ? e.slice(0, 2) : "en";
26
+ this.setAttribute("lang", t);
27
+ }
28
+ set model(e) {
29
+ this._model = e, this.dispatchEvent(new a(this.tagName.toLowerCase(), !1, !!this._model)), this.render();
30
+ }
31
+ set session(e) {
32
+ this._session = e, this.render();
33
+ }
34
+ get session() {
35
+ return this._session;
36
+ }
37
+ valueChange(e) {
38
+ this._session.value = e, this.dispatchEvent(new o(this.tagName.toLowerCase(), u(e))), this.render();
39
+ }
40
+ annotationsChange(e) {
41
+ this._session.annotations = e, this.dispatchEvent(new o(this.tagName.toLowerCase(), !0)), this.render();
42
+ }
43
+ commentChange(e) {
44
+ this._session.comment = e, this.dispatchEvent(new o(this.tagName.toLowerCase(), u(e))), this.render();
45
+ }
46
+ connectedCallback() {
47
+ this.setAttribute("aria-label", "Written Response Question"), this.setAttribute("role", "region"), this.render();
48
+ }
49
+ render() {
50
+ if (this._model && this._session) {
51
+ let n = t.createElement(e, {
52
+ model: this._model,
53
+ session: this._session,
54
+ onValueChange: this.valueChange.bind(this),
55
+ onAnnotationsChange: this.annotationsChange.bind(this),
56
+ onCommentChange: this.commentChange.bind(this)
57
+ });
58
+ this.setLangAttribute(), this._root ||= r(this), this._root.render(n), queueMicrotask(() => {
59
+ i(this);
60
+ });
61
+ }
62
+ }
63
+ disconnectedCallback() {
64
+ this._root && this._root.unmount();
65
+ }
66
+ };
67
+ //#endregion
68
+ export { d as default, u as isComplete, l as textContent };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/extended-text-entry/src/main.jsx
3
+ * @auto-generated
4
+ *
5
+ * This file is automatically synced from pie-elements and converted to TypeScript.
6
+ * Manual edits will be overwritten on next sync.
7
+ * To make changes, edit the upstream JavaScript file and run sync again.
8
+ */
9
+ import React from 'react';
10
+ import PropTypes from 'prop-types';
11
+ export declare class Main extends React.Component {
12
+ static propTypes: {
13
+ onValueChange: PropTypes.Validator<(...args: any[]) => any>;
14
+ onAnnotationsChange: PropTypes.Validator<(...args: any[]) => any>;
15
+ onCommentChange: PropTypes.Validator<(...args: any[]) => any>;
16
+ model: PropTypes.Requireable<object>;
17
+ session: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
18
+ value: PropTypes.Requireable<string>;
19
+ annotations: PropTypes.Requireable<any[]>;
20
+ comment: PropTypes.Requireable<string>;
21
+ }>>>;
22
+ };
23
+ changeSessionValue: any;
24
+ changeSessionComment: any;
25
+ render(): React.JSX.Element;
26
+ }
27
+ export default Main;
@@ -0,0 +1,134 @@
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";
5
+ import i from "debug";
6
+ import a from "@mui/material/Typography";
7
+ import { styled as o } from "@mui/material/styles";
8
+ import s from "@pie-lib/editable-html-tip-tap";
9
+ import * as c from "@pie-lib/render-ui";
10
+ import { Collapsible as l, Feedback as u, PreviewPrompt as d, UiLayout as f, color as p } from "@pie-lib/render-ui";
11
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
12
+ //#region src/delivery/main.tsx
13
+ function g(e) {
14
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
15
+ }
16
+ function _(e, t) {
17
+ return !e || g(e) ? e : g(e.default) ? e.default : t && g(e[t]) ? e[t] : t && g(e[t]?.default) ? e[t].default : e;
18
+ }
19
+ var v = _(f, "UiLayout") || _(w.UiLayout, "UiLayout"), y = _(d, "PreviewPrompt") || _(w.PreviewPrompt, "PreviewPrompt"), b = _(l, "Collapsible") || _(w.Collapsible, "Collapsible"), x = _(u, "Feedback") || _(w.Feedback, "Feedback"), S = c, C = S.default, w = C && typeof C == "object" ? C : S, T = i("@pie-ui:extended-text-entry"), E = o(v)({
20
+ backgroundColor: p.background(),
21
+ color: p.text()
22
+ }), D = o(a)(({ theme: e }) => ({
23
+ width: "100%",
24
+ color: p.text(),
25
+ marginBottom: e.spacing(2),
26
+ fontSize: "inherit"
27
+ })), O = o("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), k = o(s)(({ theme: e }) => ({
28
+ marginBottom: e.spacing(2),
29
+ borderRadius: "4px"
30
+ })), A = o("h2")({
31
+ position: "absolute",
32
+ left: "-10000px",
33
+ top: "auto",
34
+ width: "1px",
35
+ height: "1px",
36
+ overflow: "hidden"
37
+ }), j = class extends n.Component {
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
47
+ }).isRequired
48
+ };
49
+ changeSessionValue = e(this.props.onValueChange, 1500);
50
+ changeSessionComment = e(this.props.onCommentChange, 1500);
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" };
53
+ T("[render] disabled? ", c);
54
+ let z = /* @__PURE__ */ m(y, {
55
+ defaultClassName: "teacher-instructions",
56
+ prompt: j
57
+ }), B = [];
58
+ return S && B.push({ language: "spanish" }), C && B.push({ language: "special" }), /* @__PURE__ */ h(E, {
59
+ extraCSSRules: d,
60
+ ref: (e) => {
61
+ this.containerRef = e;
62
+ },
63
+ children: [
64
+ /* @__PURE__ */ m(A, { children: "Constructed Response Question" }),
65
+ j && /* @__PURE__ */ m(O, { children: i ? z : /* @__PURE__ */ m(b, {
66
+ labels: {
67
+ hidden: "Show Teacher Instructions",
68
+ visible: "Hide Teacher Instructions"
69
+ },
70
+ children: z
71
+ }) }),
72
+ v && /* @__PURE__ */ m(D, {
73
+ component: "span",
74
+ children: /* @__PURE__ */ m(y, {
75
+ defaultClassName: "prompt",
76
+ prompt: e.prompt
77
+ })
78
+ }),
79
+ a ? /* @__PURE__ */ m(t, {
80
+ text: P || "",
81
+ annotations: M || [],
82
+ comment: N || "",
83
+ predefinedAnnotations: _ || [],
84
+ onChange: r,
85
+ onCommentChange: this.changeSessionComment,
86
+ width: F,
87
+ height: I,
88
+ maxHeight: L,
89
+ disabled: l,
90
+ disabledMath: !p,
91
+ customKeys: o,
92
+ keypadMode: u
93
+ }) : /* @__PURE__ */ m(k, {
94
+ className: "response-area-editor",
95
+ onChange: this.changeSessionValue,
96
+ markup: P || "",
97
+ maxWidth: F && F.toString(),
98
+ minWidth: "100px",
99
+ minHeight: I && I.toString(),
100
+ maxHeight: L,
101
+ disabled: c,
102
+ highlightShape: !0,
103
+ toolbarOpts: R,
104
+ spellCheck: w,
105
+ charactersLimit: 5e4,
106
+ autoWidthToolbar: !0,
107
+ pluginProps: {
108
+ math: {
109
+ disabled: !p,
110
+ customKeys: this.props.model.customKeys,
111
+ keypadMode: this.props.model.equationEditor,
112
+ controlledKeypadMode: !1
113
+ },
114
+ video: { disabled: !0 },
115
+ audio: { disabled: !0 },
116
+ table: { disabled: !0 },
117
+ textAlign: { disabled: !0 },
118
+ h3: { disabled: !0 },
119
+ separateParagraphs: { disabled: !1 },
120
+ ul_list: { disabled: !0 },
121
+ ol_list: { disabled: !0 }
122
+ },
123
+ languageCharactersProps: B
124
+ }),
125
+ f && /* @__PURE__ */ m(x, {
126
+ correctness: "correct",
127
+ feedback: f
128
+ })
129
+ ]
130
+ });
131
+ }
132
+ };
133
+ //#endregion
134
+ export { j as default };