@pie-element/extended-text-entry 15.1.0-next.19 → 15.1.1-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.
- package/dist/author/defaults.d.ts +166 -0
- package/dist/author/defaults.js +209 -0
- package/dist/author/index.d.ts +52 -0
- package/dist/author/index.js +74 -0
- package/dist/author/main.d.ts +26 -0
- package/dist/author/main.js +166 -0
- package/dist/controller/defaults.d.ts +33 -0
- package/dist/controller/defaults.js +104 -0
- package/dist/controller/index.d.ts +59 -0
- package/dist/controller/index.js +72 -0
- package/dist/delivery/annotation/annotation-editor.d.ts +47 -0
- package/dist/delivery/annotation/annotation-editor.js +296 -0
- package/dist/delivery/annotation/annotation-menu.d.ts +25 -0
- package/dist/delivery/annotation/annotation-menu.js +113 -0
- package/dist/delivery/annotation/annotation-utils.d.ts +20 -0
- package/dist/delivery/annotation/annotation-utils.js +65 -0
- package/dist/delivery/annotation/freeform-editor.d.ts +30 -0
- package/dist/delivery/annotation/freeform-editor.js +143 -0
- package/dist/delivery/index.d.ts +23 -0
- package/dist/delivery/index.js +68 -0
- package/dist/delivery/main.d.ts +27 -0
- package/dist/delivery/main.js +134 -0
- package/dist/extended-text-entry.css +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.iife.d.ts +8 -0
- package/dist/index.iife.js +404 -0
- package/dist/index.js +2 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +57 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +12 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +23 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +33 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +13 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +16 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +15 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/debounce.js +50 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +11 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/now.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js +19 -0
- package/dist/print/index.d.ts +15 -0
- package/dist/print/index.js +49 -0
- package/package.json +58 -23
- package/CHANGELOG.json +0 -1282
- package/CHANGELOG.md +0 -2252
- package/LICENSE.md +0 -5
- package/README.md +0 -1
- package/configure/CHANGELOG.json +0 -922
- package/configure/CHANGELOG.md +0 -1942
- package/configure/lib/defaults.js +0 -224
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/index.js +0 -125
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/main.js +0 -247
- package/configure/lib/main.js.map +0 -1
- package/configure/package.json +0 -23
- package/controller/CHANGELOG.json +0 -362
- package/controller/CHANGELOG.md +0 -1172
- package/controller/lib/defaults.js +0 -91
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -101
- package/controller/lib/index.js.map +0 -1
- package/controller/package.json +0 -16
- package/docs/config-schema.json +0 -1782
- package/docs/config-schema.json.md +0 -1333
- package/docs/demo/config.js +0 -7
- package/docs/demo/generate.js +0 -14
- package/docs/demo/index.html +0 -3
- package/docs/demo/session.js +0 -7
- package/docs/pie-schema.json +0 -954
- package/docs/pie-schema.json.md +0 -717
- package/lib/annotation/annotation-editor.js +0 -636
- package/lib/annotation/annotation-editor.js.map +0 -1
- package/lib/annotation/annotation-menu.js +0 -147
- package/lib/annotation/annotation-menu.js.map +0 -1
- package/lib/annotation/annotation-utils.js +0 -205
- package/lib/annotation/annotation-utils.js.map +0 -1
- package/lib/annotation/freeform-editor.js +0 -241
- package/lib/annotation/freeform-editor.js.map +0 -1
- package/lib/index.js +0 -108
- package/lib/index.js.map +0 -1
- package/lib/main.js +0 -205
- package/lib/main.js.map +0 -1
- package/lib/print.js +0 -86
- package/lib/print.js.map +0 -1
- package/module/configure.js +0 -1
- package/module/controller.js +0 -139
- package/module/demo.js +0 -38
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -22
- package/module/print-demo.js +0 -76
- package/module/print.html +0 -18
- package/module/print.js +0 -1
|
@@ -0,0 +1,113 @@
|
|
|
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 } from "@mui/material";
|
|
6
|
+
//#region src/delivery/annotation/annotation-menu.tsx
|
|
7
|
+
var o = n(a)({ "& .MuiPaper-root": {
|
|
8
|
+
overflowX: "unset",
|
|
9
|
+
overflowY: "unset",
|
|
10
|
+
marginTop: "-16px",
|
|
11
|
+
"&::after": {
|
|
12
|
+
position: "absolute",
|
|
13
|
+
left: "calc(50% - 7px)",
|
|
14
|
+
border: "solid transparent",
|
|
15
|
+
content: "\"\"",
|
|
16
|
+
height: 0,
|
|
17
|
+
width: 0,
|
|
18
|
+
pointerEvents: "none",
|
|
19
|
+
borderWidth: "7px",
|
|
20
|
+
borderTopColor: "black"
|
|
21
|
+
}
|
|
22
|
+
} }), s = n("div")(({ theme: e }) => ({
|
|
23
|
+
width: "300px",
|
|
24
|
+
overflow: "hidden",
|
|
25
|
+
borderRadius: "4px",
|
|
26
|
+
backgroundColor: e.palette.common.white,
|
|
27
|
+
border: `2px solid ${e.palette.grey[100]}`
|
|
28
|
+
})), c = n("div")({
|
|
29
|
+
display: "flex",
|
|
30
|
+
flexWrap: "wrap"
|
|
31
|
+
}), l = n("div")(({ theme: e }) => ({
|
|
32
|
+
display: "flex",
|
|
33
|
+
flexWrap: "wrap",
|
|
34
|
+
borderTop: `2px solid ${e.palette.grey[100]}`
|
|
35
|
+
})), u = n("div")(({ theme: e, variant: t }) => ({
|
|
36
|
+
width: "22%",
|
|
37
|
+
textAlign: "center",
|
|
38
|
+
padding: "4px",
|
|
39
|
+
cursor: "pointer",
|
|
40
|
+
borderBottom: `1px solid ${e.palette.grey[100]}`,
|
|
41
|
+
"&:not(:nth-child(4n))": { borderRight: `1px solid ${e.palette.grey[100]}` },
|
|
42
|
+
"&:nth-child(4n)": { flexGrow: 1 },
|
|
43
|
+
"&:hover": { backgroundColor: e.palette.grey[100] },
|
|
44
|
+
...t === "positive" && {
|
|
45
|
+
backgroundColor: "rgb(153, 255, 153) !important",
|
|
46
|
+
"&:hover": { filter: "brightness(85%)" }
|
|
47
|
+
},
|
|
48
|
+
...t === "negative" && {
|
|
49
|
+
backgroundColor: "rgb(255, 204, 238) !important",
|
|
50
|
+
"&:hover": { filter: "brightness(85%)" }
|
|
51
|
+
}
|
|
52
|
+
})), d = class extends e.Component {
|
|
53
|
+
static propTypes = {
|
|
54
|
+
anchorEl: t.object,
|
|
55
|
+
open: t.bool,
|
|
56
|
+
annotations: t.array,
|
|
57
|
+
isNewAnnotation: t.bool,
|
|
58
|
+
onClose: t.func,
|
|
59
|
+
onDelete: t.func,
|
|
60
|
+
onEdit: t.func,
|
|
61
|
+
onWrite: t.func,
|
|
62
|
+
onAnnotate: t.func
|
|
63
|
+
};
|
|
64
|
+
render() {
|
|
65
|
+
let { anchorEl: t, annotations: n, isNewAnnotation: a, onAnnotate: d, onClose: f, onEdit: p, onDelete: m, onWrite: h, open: g } = this.props;
|
|
66
|
+
return /* @__PURE__ */ r(o, {
|
|
67
|
+
anchorEl: t,
|
|
68
|
+
open: g,
|
|
69
|
+
onClose: f,
|
|
70
|
+
elevation: 5,
|
|
71
|
+
transitionDuration: {
|
|
72
|
+
enter: 225,
|
|
73
|
+
exit: 195
|
|
74
|
+
},
|
|
75
|
+
anchorOrigin: {
|
|
76
|
+
vertical: "top",
|
|
77
|
+
horizontal: "center"
|
|
78
|
+
},
|
|
79
|
+
transformOrigin: {
|
|
80
|
+
vertical: "bottom",
|
|
81
|
+
horizontal: "center"
|
|
82
|
+
},
|
|
83
|
+
children: /* @__PURE__ */ i(s, { children: [/* @__PURE__ */ r(c, { children: n.map((e, t) => /* @__PURE__ */ r(u, {
|
|
84
|
+
variant: e.type,
|
|
85
|
+
onClick: () => d(e),
|
|
86
|
+
children: e.label
|
|
87
|
+
}, `annotation-${t}`)) }), /* @__PURE__ */ i(l, { children: [
|
|
88
|
+
/* @__PURE__ */ r(u, {
|
|
89
|
+
onClick: f,
|
|
90
|
+
children: "Cancel"
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ r(u, { style: { pointerEvents: "none" } }),
|
|
93
|
+
a ? /* @__PURE__ */ i(e.Fragment, { children: [/* @__PURE__ */ r(u, {
|
|
94
|
+
variant: "positive",
|
|
95
|
+
onClick: () => h("positive"),
|
|
96
|
+
children: "Write"
|
|
97
|
+
}), /* @__PURE__ */ r(u, {
|
|
98
|
+
variant: "negative",
|
|
99
|
+
onClick: () => h("negative"),
|
|
100
|
+
children: "Write"
|
|
101
|
+
})] }) : /* @__PURE__ */ i(e.Fragment, { children: [/* @__PURE__ */ r(u, {
|
|
102
|
+
onClick: m,
|
|
103
|
+
children: "Delete"
|
|
104
|
+
}), /* @__PURE__ */ r(u, {
|
|
105
|
+
onClick: p,
|
|
106
|
+
children: "Edit"
|
|
107
|
+
})] })
|
|
108
|
+
] })] })
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
//#endregion
|
|
113
|
+
export { d as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/extended-text-entry/src/annotation/annotation-utils.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 const getDOMNodes: (startOffset: any, endOffset: any, rootNode: any) => any[];
|
|
10
|
+
export declare const wrapRange: (range: any) => any[];
|
|
11
|
+
export declare const getRangeDetails: (range: any, rootNode: any) => {
|
|
12
|
+
quote: string | any[];
|
|
13
|
+
start: number;
|
|
14
|
+
end: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const removeElemsWrapping: (elems: any, container: any) => void;
|
|
17
|
+
export declare const clearSelection: () => void;
|
|
18
|
+
export declare const isSideLabel: (text: any) => boolean;
|
|
19
|
+
export declare const getAnnotationElements: (id: any) => Element[];
|
|
20
|
+
export declare const getLabelElement: (id: any) => Element | null;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//#region src/delivery/annotation/annotation-utils.ts
|
|
2
|
+
var e = (t, n, r) => {
|
|
3
|
+
let i = r || [], a = i.reduce((e, t) => e + t.textContent.length, 0), o = !0;
|
|
4
|
+
if (a > n) return !1;
|
|
5
|
+
for (t &&= (t.nodeType === 3 && t.parentNode && !t.parentNode.hasAttribute("data-ann-id") && i.push(t), t.firstChild); t && o;) o = e(t, n, i), t = t.nextSibling;
|
|
6
|
+
return i;
|
|
7
|
+
}, t = (t, n, r) => {
|
|
8
|
+
let i = e(r, n), a = [], o = 0;
|
|
9
|
+
return i.forEach((e) => {
|
|
10
|
+
let r = o + e.textContent.length;
|
|
11
|
+
[t, n].forEach((t) => {
|
|
12
|
+
o <= t && t < r && a.push({
|
|
13
|
+
node: e,
|
|
14
|
+
offset: t - o
|
|
15
|
+
});
|
|
16
|
+
}), o = r;
|
|
17
|
+
}), a;
|
|
18
|
+
}, n = (e) => {
|
|
19
|
+
let { commonAncestorContainer: t, startContainer: n, endContainer: r, startOffset: i, endOffset: a } = e, o = [], s = !1, c = !1, l = "", u = (e) => {
|
|
20
|
+
let { nodeValue: t, childNodes: d } = e;
|
|
21
|
+
e === n && e === r ? (t && (l += t.substring(i, a)), s = c = !0) : e === n ? (t && (l += t.substring(i)), s = !0) : e === r ? (t && (l += t.substring(0, a)), c = !0) : e && e.nodeType === 3 && e.parentNode && !e.parentNode.hasAttribute("data-ann-id") && t && s && !c && (l += t, o.push(e)), d.forEach((e) => {
|
|
22
|
+
if (!c) u(e);
|
|
23
|
+
else return;
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
return u(t), [o, l];
|
|
27
|
+
}, r = (e) => {
|
|
28
|
+
let t = document.createElement("SPAN");
|
|
29
|
+
return e.surroundContents(t), t;
|
|
30
|
+
}, i = (e) => {
|
|
31
|
+
if (e.startContainer === e.endContainer) return [r(e)];
|
|
32
|
+
let [t] = n(e), i = document.createRange();
|
|
33
|
+
i.selectNodeContents(e.startContainer), i.setStart(e.startContainer, e.startOffset);
|
|
34
|
+
let a = r(i), o = document.createRange();
|
|
35
|
+
o.selectNode(e.endContainer), o.setEnd(e.endContainer, e.endOffset);
|
|
36
|
+
let s = r(o);
|
|
37
|
+
return [
|
|
38
|
+
a,
|
|
39
|
+
...t.map((e) => {
|
|
40
|
+
let t = document.createElement("SPAN");
|
|
41
|
+
return e.parentNode.insertBefore(t, e), t.appendChild(e), t;
|
|
42
|
+
}),
|
|
43
|
+
s
|
|
44
|
+
];
|
|
45
|
+
}, a = (e, t) => {
|
|
46
|
+
let r = document.createRange();
|
|
47
|
+
r.setStart(t, 0), r.setEnd(e.startContainer, e.startOffset);
|
|
48
|
+
let [, i] = n(r), [, a] = n(e), o = i.length;
|
|
49
|
+
return {
|
|
50
|
+
quote: a,
|
|
51
|
+
start: o,
|
|
52
|
+
end: o + a.length
|
|
53
|
+
};
|
|
54
|
+
}, o = (e, t) => {
|
|
55
|
+
(e || []).forEach((e) => {
|
|
56
|
+
let t = e.parentNode, n = e.childNodes, r = n.length;
|
|
57
|
+
if (r > 0) for (let i = 0; i < r; i++) t.insertBefore(n[0], e);
|
|
58
|
+
else t.insertBefore(document.createTextNode(e.textContent), e);
|
|
59
|
+
t.removeChild(e);
|
|
60
|
+
}), t.normalize();
|
|
61
|
+
}, s = () => {
|
|
62
|
+
document.getSelection ? (document.getSelection().removeAllRanges(), document.getSelection().addRange(document.createRange())) : window.getSelection ? window.getSelection().removeAllRanges ? (window.getSelection().removeAllRanges(), window.getSelection().addRange(document.createRange())) : window.getSelection().empty && window.getSelection().empty() : document.selection && document.selection.empty();
|
|
63
|
+
}, c = (e) => e.length >= 20 || e.search(/\n|\r|\r\n/) !== -1, l = (e) => Array.from(document.querySelectorAll(`[data-id='${e}']`)), u = (e) => document.querySelector(`[data-ann-id='${e}']`);
|
|
64
|
+
//#endregion
|
|
65
|
+
export { s as clearSelection, l as getAnnotationElements, t as getDOMNodes, u as getLabelElement, a as getRangeDetails, c as isSideLabel, o as removeElemsWrapping, i as wrapRange };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @synced-from pie-elements/packages/extended-text-entry/src/annotation/freeform-editor.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
|
+
declare class FreeformEditor extends React.Component {
|
|
12
|
+
static propTypes: {
|
|
13
|
+
anchorEl: PropTypes.Requireable<object>;
|
|
14
|
+
open: PropTypes.Requireable<boolean>;
|
|
15
|
+
offset: PropTypes.Requireable<number>;
|
|
16
|
+
value: PropTypes.Requireable<string>;
|
|
17
|
+
type: PropTypes.Requireable<string>;
|
|
18
|
+
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
|
+
onDelete: PropTypes.Requireable<(...args: any[]) => any>;
|
|
20
|
+
onSave: PropTypes.Requireable<(...args: any[]) => any>;
|
|
21
|
+
onTypeChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
|
+
};
|
|
23
|
+
constructor(props: any);
|
|
24
|
+
UNSAFE_componentWillReceiveProps(nextProps: any): void;
|
|
25
|
+
onValueChange: (event: any) => void;
|
|
26
|
+
handleSave: any;
|
|
27
|
+
handleTypeChange: any;
|
|
28
|
+
render(): React.JSX.Element;
|
|
29
|
+
}
|
|
30
|
+
export default FreeformEditor;
|
|
@@ -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 };
|