@pie-element/explicit-constructed-response 11.1.2-next.5 → 11.1.2-next.7
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/alternateResponses.js +2 -2
- package/dist/author/alternateSection.js +34 -33
- package/dist/author/ecr-toolbar.js +1 -1
- package/dist/author/index.d.ts +1 -0
- package/dist/author/index.js +5 -2
- package/dist/author/main.js +3 -3
- package/dist/author/markupUtils.js +1 -1
- package/dist/browser/author/index.js +14 -11
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/{browser-D9pWhsjw.js → browser-xPiwYICU.js} +2 -2
- package/dist/browser/browser-xPiwYICU.js.map +1 -0
- package/dist/browser/controller/index.js +3 -3
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +3 -3
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/{dist-D9ARZhQk.js → dist-DiGNNRzu.js} +2 -2
- package/dist/browser/{dist-D9ARZhQk.js.map → dist-DiGNNRzu.js.map} +1 -1
- package/dist/browser/{dist-BCSgqXjk.js → dist-HhpuchEj.js} +20298 -23516
- package/dist/browser/dist-HhpuchEj.js.map +1 -0
- package/dist/browser/{main-CoJAe1Fq.js → main-CsLCZ3jN.js} +11 -14
- package/dist/browser/main-CsLCZ3jN.js.map +1 -0
- package/dist/browser/print/index.js +3 -3
- package/dist/browser/print/index.js.map +1 -1
- package/dist/delivery/index.js +2 -2
- package/dist/delivery/main.js +1 -1
- package/dist/index.iife.js +109 -113
- package/dist/print/index.js +1 -1
- package/package.json +18 -10
- package/dist/browser/browser-D9pWhsjw.js.map +0 -1
- package/dist/browser/dist-BCSgqXjk.js.map +0 -1
- package/dist/browser/main-CoJAe1Fq.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e from "./alternateSection.js";
|
|
1
|
+
import { AlternateSection as e } from "./alternateSection.js";
|
|
2
2
|
import t from "react";
|
|
3
3
|
import n from "prop-types";
|
|
4
4
|
import { cloneDeep as r, isEqual as i, map as a, reduce as o } from "@pie-element/shared-lodash";
|
|
@@ -110,4 +110,4 @@ var l = class extends t.Component {
|
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
//#endregion
|
|
113
|
-
export { l as default };
|
|
113
|
+
export { l as AlternateResponses, l as default };
|
|
@@ -2,17 +2,18 @@ import { decodeHTML as e, getAdjustedLength as t, stripHtmlTags as n } from "./m
|
|
|
2
2
|
import r from "react";
|
|
3
3
|
import i from "prop-types";
|
|
4
4
|
import { debounce as a, isEqual as o, max as s } from "@pie-element/shared-lodash";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import d from "@
|
|
8
|
-
import f from "@
|
|
9
|
-
import p from "@mui/
|
|
10
|
-
import m from "@mui/material/
|
|
11
|
-
import h from "@mui/material/
|
|
12
|
-
import g from "@mui/material/
|
|
13
|
-
import _ from "@mui/material/
|
|
5
|
+
import { color as c } from "@pie-lib/render-ui";
|
|
6
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
import { styled as d } from "@mui/material/styles";
|
|
8
|
+
import f from "@pie-lib/editable-html-tip-tap";
|
|
9
|
+
import p from "@mui/material/Button";
|
|
10
|
+
import m from "@mui/icons-material/Delete";
|
|
11
|
+
import h from "@mui/material/IconButton";
|
|
12
|
+
import g from "@mui/material/MenuItem";
|
|
13
|
+
import _ from "@mui/material/Select";
|
|
14
|
+
import v from "@mui/material/TextField";
|
|
14
15
|
//#region src/author/alternateSection.tsx
|
|
15
|
-
var
|
|
16
|
+
var y = d("div")(({ theme: e }) => ({ marginBottom: e.spacing(.5) })), b = d("div")(({ theme: e }) => ({
|
|
16
17
|
alignItems: "flex-start",
|
|
17
18
|
flexDirection: "column",
|
|
18
19
|
display: "flex",
|
|
@@ -21,36 +22,36 @@ var v = u("div")(({ theme: e }) => ({ marginBottom: e.spacing(.5) })), y = u("di
|
|
|
21
22
|
marginBottom: e.spacing(2.5),
|
|
22
23
|
width: "100%"
|
|
23
24
|
}
|
|
24
|
-
})),
|
|
25
|
+
})), x = d(f)(({ theme: e, hasError: t }) => ({
|
|
25
26
|
flex: "1",
|
|
26
27
|
marginRight: e.spacing(2.5),
|
|
27
28
|
...t && {
|
|
28
29
|
border: `2px solid ${e.palette.error.main}`,
|
|
29
30
|
borderRadius: "6px"
|
|
30
31
|
}
|
|
31
|
-
})),
|
|
32
|
+
})), S = d(h)(() => ({ "& svg": { fill: c.text() } })), C = d("div")({
|
|
32
33
|
alignItems: "flex-end",
|
|
33
34
|
display: "flex",
|
|
34
35
|
justifyContent: "space-between",
|
|
35
36
|
width: "100%"
|
|
36
|
-
}),
|
|
37
|
+
}), w = d("div")({
|
|
37
38
|
alignItems: "center",
|
|
38
39
|
display: "flex"
|
|
39
|
-
}),
|
|
40
|
+
}), T = d(v)(({ theme: e }) => ({
|
|
40
41
|
width: "230px",
|
|
41
42
|
marginRight: e.spacing(2.5),
|
|
42
43
|
"& .MuiInput-underline:before": { borderBottomColor: e.palette.divider },
|
|
43
44
|
"& .MuiInput-underline:hover:not(.Mui-disabled):before": { borderBottomColor: e.palette.text.primary },
|
|
44
45
|
"& .MuiInput-underline:after": { borderBottomColor: e.palette.primary.main }
|
|
45
|
-
})),
|
|
46
|
+
})), E = d("div")(({ theme: e }) => ({
|
|
46
47
|
fontSize: e.typography.fontSize - 2,
|
|
47
48
|
color: e.palette.error.main,
|
|
48
49
|
paddingTop: e.spacing(.5)
|
|
49
|
-
})),
|
|
50
|
+
})), D = d("div")({
|
|
50
51
|
alignItems: "center",
|
|
51
52
|
display: "flex",
|
|
52
53
|
justifyContent: "space-between"
|
|
53
|
-
}),
|
|
54
|
+
}), O = class extends r.Component {
|
|
54
55
|
static propTypes = {
|
|
55
56
|
error: i.string,
|
|
56
57
|
markup: i.string,
|
|
@@ -75,7 +76,7 @@ var v = u("div")(({ theme: e }) => ({ marginBottom: e.spacing(.5) })), y = u("di
|
|
|
75
76
|
};
|
|
76
77
|
render() {
|
|
77
78
|
let { value: e } = this.state, { onDelete: t, spellCheck: n, error: i, showMaxLength: a, pluginProps: o } = this.props, s = a ? {} : { maxLength: 25 };
|
|
78
|
-
return /* @__PURE__ */
|
|
79
|
+
return /* @__PURE__ */ u(r.Fragment, { children: [/* @__PURE__ */ u(D, { children: [/* @__PURE__ */ l(x, {
|
|
79
80
|
hasError: !!i,
|
|
80
81
|
disableUnderline: !0,
|
|
81
82
|
onChange: this.onChange,
|
|
@@ -91,14 +92,14 @@ var v = u("div")(({ theme: e }) => ({ marginBottom: e.spacing(.5) })), y = u("di
|
|
|
91
92
|
isHidden: !!o?.characters?.disabled
|
|
92
93
|
},
|
|
93
94
|
...s
|
|
94
|
-
}), /* @__PURE__ */
|
|
95
|
+
}), /* @__PURE__ */ l(S, {
|
|
95
96
|
"aria-label": "delete",
|
|
96
97
|
onClick: t,
|
|
97
98
|
size: "large",
|
|
98
|
-
children: /* @__PURE__ */
|
|
99
|
-
})] }), i && /* @__PURE__ */
|
|
99
|
+
children: /* @__PURE__ */ l(m, {})
|
|
100
|
+
})] }), i && /* @__PURE__ */ l(E, { children: i })] });
|
|
100
101
|
}
|
|
101
|
-
},
|
|
102
|
+
}, k = class extends r.Component {
|
|
102
103
|
static propTypes = {
|
|
103
104
|
choices: i.array,
|
|
104
105
|
selectChoices: i.array.isRequired,
|
|
@@ -161,9 +162,9 @@ var v = u("div")(({ theme: e }) => ({ marginBottom: e.spacing(.5) })), y = u("di
|
|
|
161
162
|
n && n >= r && n <= r + 10 && t(n);
|
|
162
163
|
};
|
|
163
164
|
render() {
|
|
164
|
-
let { selectChoices: t, maxLength: n, showMaxLength: r, value: i, spellCheck: a, errors: o, pluginProps: s } = this.props, { choices:
|
|
165
|
-
return /* @__PURE__ */
|
|
166
|
-
/* @__PURE__ */
|
|
165
|
+
let { selectChoices: t, maxLength: n, showMaxLength: r, value: i, spellCheck: a, errors: o, pluginProps: s } = this.props, { choices: c } = this.state, d = this.getChoicesMaxLength();
|
|
166
|
+
return /* @__PURE__ */ u(y, { children: [
|
|
167
|
+
/* @__PURE__ */ u(C, { children: [/* @__PURE__ */ u(_, {
|
|
167
168
|
variant: "standard",
|
|
168
169
|
displayEmpty: !0,
|
|
169
170
|
onChange: this.handleSelect,
|
|
@@ -173,14 +174,14 @@ var v = u("div")(({ theme: e }) => ({ marginBottom: e.spacing(.5) })), y = u("di
|
|
|
173
174
|
enter: 225,
|
|
174
175
|
exit: 195
|
|
175
176
|
} },
|
|
176
|
-
children: [/* @__PURE__ */
|
|
177
|
+
children: [/* @__PURE__ */ l(g, {
|
|
177
178
|
value: "",
|
|
178
|
-
children: /* @__PURE__ */
|
|
179
|
-
}), t.map((t, n) => /* @__PURE__ */
|
|
179
|
+
children: /* @__PURE__ */ l("em", { children: i ? "Remove selection" : "Select a response" })
|
|
180
|
+
}), t.map((t, n) => /* @__PURE__ */ l(g, {
|
|
180
181
|
value: t?.value,
|
|
181
182
|
children: e(t?.label)
|
|
182
183
|
}, n))]
|
|
183
|
-
}),
|
|
184
|
+
}), c && c.length > 0 && /* @__PURE__ */ u(w, { children: [n && r && /* @__PURE__ */ l(T, {
|
|
184
185
|
variant: "standard",
|
|
185
186
|
label: "Maximum length (characters)",
|
|
186
187
|
type: "number",
|
|
@@ -190,14 +191,14 @@ var v = u("div")(({ theme: e }) => ({ marginBottom: e.spacing(.5) })), y = u("di
|
|
|
190
191
|
},
|
|
191
192
|
value: n,
|
|
192
193
|
onChange: this.changeLength
|
|
193
|
-
}), /* @__PURE__ */
|
|
194
|
+
}), /* @__PURE__ */ l(p, {
|
|
194
195
|
variant: "contained",
|
|
195
196
|
color: "primary",
|
|
196
197
|
onClick: this.onAddChoice,
|
|
197
198
|
children: "Add"
|
|
198
199
|
})] })] }),
|
|
199
|
-
o && o[0] && /* @__PURE__ */
|
|
200
|
-
/* @__PURE__ */
|
|
200
|
+
o && o[0] && /* @__PURE__ */ l(E, { children: o[0] }),
|
|
201
|
+
/* @__PURE__ */ l(b, { children: c && c.map((e, t) => t > 0 && /* @__PURE__ */ l(O, {
|
|
201
202
|
markup: e.label,
|
|
202
203
|
onChange: (n) => this.onChoiceChanged(e, n, t),
|
|
203
204
|
onDelete: () => this.onRemoveChoice(e),
|
|
@@ -210,4 +211,4 @@ var v = u("div")(({ theme: e }) => ({ marginBottom: e.spacing(.5) })), y = u("di
|
|
|
210
211
|
}
|
|
211
212
|
};
|
|
212
213
|
//#endregion
|
|
213
|
-
export {
|
|
214
|
+
export { k as AlternateSection, k as default, O as Choice };
|
package/dist/author/index.d.ts
CHANGED
package/dist/author/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createSlateMarkup as e, processMarkup as t } from "./markupUtils.js";
|
|
2
|
-
import n from "./main.js";
|
|
2
|
+
import { Main as n } from "./main.js";
|
|
3
3
|
import r from "./defaults.js";
|
|
4
4
|
import i from "react";
|
|
5
5
|
import { createRoot as a } from "react-dom/client";
|
|
@@ -88,8 +88,11 @@ var m = c("explicit-constructed-response:configure"), h = class c extends HTMLEl
|
|
|
88
88
|
});
|
|
89
89
|
this._root ||= a(this), this._root.render(e);
|
|
90
90
|
}
|
|
91
|
+
connectedCallback() {
|
|
92
|
+
this._render();
|
|
93
|
+
}
|
|
91
94
|
disconnectedCallback() {
|
|
92
|
-
this._root
|
|
95
|
+
this._root &&= (this._root.unmount(), null);
|
|
93
96
|
}
|
|
94
97
|
};
|
|
95
98
|
//#endregion
|
package/dist/author/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { decodeHTML as e, getAdjustedLength as t } from "./markupUtils.js";
|
|
2
|
-
import n from "./ecr-toolbar.js";
|
|
3
|
-
import r from "./alternateResponses.js";
|
|
2
|
+
import { ECRToolbar as n } from "./ecr-toolbar.js";
|
|
3
|
+
import { AlternateResponses as r } from "./alternateResponses.js";
|
|
4
4
|
import { generateValidationMessage as i } from "./utils.js";
|
|
5
5
|
import a from "react";
|
|
6
6
|
import o from "prop-types";
|
|
@@ -288,4 +288,4 @@ var { toggle: y, Panel: re, dropdown: ie } = g, b = p(h)(({ theme: e }) => ({
|
|
|
288
288
|
}
|
|
289
289
|
};
|
|
290
290
|
//#endregion
|
|
291
|
-
export { w as default };
|
|
291
|
+
export { w as Main, w as default };
|
|
@@ -10,4 +10,4 @@ var t = "imes|riangle|an|heta|herefore", n = "throot|parallel|cong|approx|eq|e|s
|
|
|
10
10
|
}), t.innerHTML;
|
|
11
11
|
}, s = /\{\{(\d+)\}\}/g, c = (t, n) => t ? i(t).replace(s, (t, r) => `<span data-type="explicit_constructed_response" data-index="${r}" data-value="${e(n[r][0].label || "")}"></span>`) : "", l = (e) => e <= 2 ? e + 2 : e <= 4 ? e + 3 : e <= 6 ? e + 4 : e + 5, u = (e) => typeof e == "string" ? e.replace(/<\/?[^>]+(>|$)/g, "") : "", d = (e) => new DOMParser().parseFromString(e, "text/html").body.textContent || "";
|
|
12
12
|
//#endregion
|
|
13
|
-
export { c as createSlateMarkup, d as decodeHTML, l as getAdjustedLength, o as processMarkup, u as stripHtmlTags };
|
|
13
|
+
export { c as createSlateMarkup, d as decodeHTML, l as getAdjustedLength, o as processMarkup, i as removeUnwantedCharacters, u as stripHtmlTags };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as e, S as t, a as n, b as r, c as i, h as a, i as o, l as s, m as c, n as l, o as u, p as d, r as f, s as p, t as m, u as h, v as g } from "../browser-
|
|
2
|
-
import { $ as _, A as v, B as y, D as b, E as x, F as S, H as C, I as w, J as T, K as E, L as D, M as O, N as k, P as A, Q as j, R as M, S as N, T as P, U as F, V as ee, W as I, X as te, Y as ne, Z as re, a as ie, b as L, c as ae, d as oe, et as R, f as se, i as z, it as ce, j as le, k as ue, l as B, n as de, nt as fe, o as pe, p as me, q as V, r as he, rt as ge, s as _e, t as H, tt as U, u as ve, v as ye, w as be, x as xe, y as Se, z as Ce } from "../dist-
|
|
1
|
+
import { E as e, S as t, a as n, b as r, c as i, h as a, i as o, l as s, m as c, n as l, o as u, p as d, r as f, s as p, t as m, u as h, v as g } from "../browser-xPiwYICU.js";
|
|
2
|
+
import { $ as _, A as v, B as y, D as b, E as x, F as S, H as C, I as w, J as T, K as E, L as D, M as O, N as k, P as A, Q as j, R as M, S as N, T as P, U as F, V as ee, W as I, X as te, Y as ne, Z as re, a as ie, b as L, c as ae, d as oe, et as R, f as se, i as z, it as ce, j as le, k as ue, l as B, n as de, nt as fe, o as pe, p as me, q as V, r as he, rt as ge, s as _e, t as H, tt as U, u as ve, v as ye, w as be, x as xe, y as Se, z as Ce } from "../dist-HhpuchEj.js";
|
|
3
3
|
import * as W from "react";
|
|
4
4
|
import G, { Component as we, createElement as Te } from "react";
|
|
5
5
|
import { createRoot as Ee } from "react-dom/client";
|
|
@@ -1683,7 +1683,7 @@ var ln = Object.defineProperty, un = (e, t) => {
|
|
|
1683
1683
|
}
|
|
1684
1684
|
};
|
|
1685
1685
|
//#endregion
|
|
1686
|
-
//#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.
|
|
1686
|
+
//#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/extends.js
|
|
1687
1687
|
function _n() {
|
|
1688
1688
|
return _n = Object.assign ? Object.assign.bind() : function(e) {
|
|
1689
1689
|
for (var t = 1; t < arguments.length; t++) {
|
|
@@ -1694,7 +1694,7 @@ function _n() {
|
|
|
1694
1694
|
}, _n.apply(null, arguments);
|
|
1695
1695
|
}
|
|
1696
1696
|
//#endregion
|
|
1697
|
-
//#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.
|
|
1697
|
+
//#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
|
1698
1698
|
function vn(e, t) {
|
|
1699
1699
|
if (e == null) return {};
|
|
1700
1700
|
var n = {};
|
|
@@ -1705,14 +1705,14 @@ function vn(e, t) {
|
|
|
1705
1705
|
return n;
|
|
1706
1706
|
}
|
|
1707
1707
|
//#endregion
|
|
1708
|
-
//#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.
|
|
1708
|
+
//#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
|
|
1709
1709
|
function yn(e, t) {
|
|
1710
1710
|
return yn = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
|
|
1711
1711
|
return e.__proto__ = t, e;
|
|
1712
1712
|
}, yn(e, t);
|
|
1713
1713
|
}
|
|
1714
1714
|
//#endregion
|
|
1715
|
-
//#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.
|
|
1715
|
+
//#region ../../lib-react/config-ui/dist/node_modules/.bun/@babel_runtime@7.29.7/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
|
1716
1716
|
function bn(e, t) {
|
|
1717
1717
|
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, yn(e, t);
|
|
1718
1718
|
}
|
|
@@ -2105,9 +2105,9 @@ var tr = er()(function(e) {
|
|
|
2105
2105
|
tr.displayName = "Measure", tr.propTypes.children = Q.default.func;
|
|
2106
2106
|
//#endregion
|
|
2107
2107
|
//#region ../../lib-react/config-ui/dist/layout/settings-box.js
|
|
2108
|
-
var nr = V("div")((
|
|
2109
|
-
backgroundColor:
|
|
2110
|
-
border: `2px solid ${
|
|
2108
|
+
var nr = V("div")(() => ({
|
|
2109
|
+
backgroundColor: I.white(),
|
|
2110
|
+
border: `2px solid ${I.border()}`,
|
|
2111
2111
|
display: "flex",
|
|
2112
2112
|
flexDirection: "column",
|
|
2113
2113
|
justifyContent: "flex-start",
|
|
@@ -2603,7 +2603,7 @@ var Jr = qr(ye, "InputContainer") || qr(Zr.InputContainer, "InputContainer"), Yr
|
|
|
2603
2603
|
border: `2px solid ${e.palette.error.main}`,
|
|
2604
2604
|
borderRadius: "6px"
|
|
2605
2605
|
}
|
|
2606
|
-
})), hi = V(oe)((
|
|
2606
|
+
})), hi = V(oe)(() => ({ "& svg": { fill: I.text() } })), gi = V("div")({
|
|
2607
2607
|
alignItems: "flex-end",
|
|
2608
2608
|
display: "flex",
|
|
2609
2609
|
justifyContent: "space-between",
|
|
@@ -3368,8 +3368,11 @@ var Jr = qr(ye, "InputContainer") || qr(Zr.InputContainer, "InputContainer"), Yr
|
|
|
3368
3368
|
});
|
|
3369
3369
|
this._root ||= Ee(this), this._root.render(e);
|
|
3370
3370
|
}
|
|
3371
|
+
connectedCallback() {
|
|
3372
|
+
this._render();
|
|
3373
|
+
}
|
|
3371
3374
|
disconnectedCallback() {
|
|
3372
|
-
this._root
|
|
3375
|
+
this._root &&= (this._root.unmount(), null);
|
|
3373
3376
|
}
|
|
3374
3377
|
};
|
|
3375
3378
|
//#endregion
|