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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,41 +1,40 @@
1
1
  import e from "./annotation/annotation-editor.js";
2
2
  import t from "react";
3
3
  import n from "prop-types";
4
- import { debounce as r } from "@pie-element/shared-lodash";
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";
4
+ import r from "debug";
5
+ import i from "@mui/material/Typography";
6
+ import { styled as a } from "@mui/material/styles";
7
+ import o from "@pie-lib/editable-html-tip-tap";
8
+ import * as s from "@pie-lib/render-ui";
9
+ import { Collapsible as c, Feedback as l, PreviewPrompt as u, UiLayout as d, color as f } from "@pie-lib/render-ui";
10
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
12
11
  //#region src/delivery/main.tsx
13
- function g(e) {
12
+ function h(e) {
14
13
  return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
15
14
  }
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;
15
+ function g(e, t) {
16
+ return !e || h(e) ? e : h(e.default) ? e.default : t && h(e[t]) ? e[t] : t && h(e[t]?.default) ? e[t].default : e;
18
17
  }
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 }) => ({
18
+ var _ = g(d, "UiLayout") || g(C.UiLayout, "UiLayout"), v = g(u, "PreviewPrompt") || g(C.PreviewPrompt, "PreviewPrompt"), y = g(c, "Collapsible") || g(C.Collapsible, "Collapsible"), b = g(l, "Feedback") || g(C.Feedback, "Feedback"), x = s, S = x.default, C = S && typeof S == "object" ? S : x, w = r("@pie-ui:extended-text-entry"), T = a(_)({
19
+ backgroundColor: f.background(),
20
+ color: f.text()
21
+ }), E = a(i)(({ theme: e }) => ({
23
22
  width: "100%",
24
- color: p.text(),
23
+ color: f.text(),
25
24
  marginBottom: e.spacing(2),
26
25
  fontSize: "inherit",
27
26
  display: "block"
28
- })), O = o("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), k = o(s)(({ theme: e }) => ({
27
+ })), D = a("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), O = a(o)(({ theme: e }) => ({
29
28
  marginBottom: e.spacing(2),
30
29
  borderRadius: "4px"
31
- })), A = o("h2")({
30
+ })), k = a("h2")({
32
31
  position: "absolute",
33
32
  left: "-10000px",
34
33
  top: "auto",
35
34
  width: "1px",
36
35
  height: "1px",
37
36
  overflow: "hidden"
38
- }), j = class extends t.Component {
37
+ }), A = class extends t.Component {
39
38
  static propTypes = {
40
39
  onValueChange: n.func.isRequired,
41
40
  onAnnotationsChange: n.func.isRequired,
@@ -47,67 +46,65 @@ var v = _(f, "UiLayout") || _(w.UiLayout, "UiLayout"), y = _(d, "PreviewPrompt")
47
46
  comment: n.string
48
47
  }).isRequired
49
48
  };
50
- changeSessionValue = r(this.props.onValueChange, 1500);
51
- changeSessionComment = r(this.props.onCommentChange, 1500);
52
49
  render() {
53
- 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" };
54
- T("[render] disabled? ", c);
55
- let z = /* @__PURE__ */ m(y, {
50
+ let { model: t, session: n, onAnnotationsChange: r, onCommentChange: i, onValueChange: a } = this.props, { animationsDisabled: o, annotatorMode: s, customKeys: c, dimensions: l, disabled: u, disabledAnnotator: d, equationEditor: f, extraCSSRules: h, feedback: g, mathInput: _, playersToolbarPosition: x, predefinedAnnotations: S, prompt: C, spanishInput: A, specialInput: j, spellCheckEnabled: M, teacherInstructions: N } = t, { annotations: P, comment: F, value: I } = n, { width: L, height: R } = l || {}, z = "40vh", B = { position: x === "top" ? "top" : "bottom" };
51
+ w("[render] disabled? ", u);
52
+ let V = /* @__PURE__ */ p(v, {
56
53
  defaultClassName: "teacher-instructions",
57
- prompt: j
58
- }), B = [];
59
- return S && B.push({ language: "spanish" }), C && B.push({ language: "special" }), /* @__PURE__ */ h(E, {
60
- extraCSSRules: d,
54
+ prompt: N
55
+ }), H = [];
56
+ return A && H.push({ language: "spanish" }), j && H.push({ language: "special" }), /* @__PURE__ */ m(T, {
57
+ extraCSSRules: h,
61
58
  ref: (e) => {
62
59
  this.containerRef = e;
63
60
  },
64
61
  children: [
65
- /* @__PURE__ */ m(A, { children: "Constructed Response Question" }),
66
- j && /* @__PURE__ */ m(O, { children: i ? z : /* @__PURE__ */ m(b, {
62
+ /* @__PURE__ */ p(k, { children: "Constructed Response Question" }),
63
+ N && /* @__PURE__ */ p(D, { children: o ? V : /* @__PURE__ */ p(y, {
67
64
  labels: {
68
65
  hidden: "Show Teacher Instructions",
69
66
  visible: "Hide Teacher Instructions"
70
67
  },
71
- children: z
68
+ children: V
72
69
  }) }),
73
- v && /* @__PURE__ */ m(D, {
70
+ C && /* @__PURE__ */ p(E, {
74
71
  component: "span",
75
- children: /* @__PURE__ */ m(y, {
72
+ children: /* @__PURE__ */ p(v, {
76
73
  defaultClassName: "prompt",
77
74
  prompt: t.prompt
78
75
  })
79
76
  }),
80
- a ? /* @__PURE__ */ m(e, {
81
- text: P || "",
82
- annotations: M || [],
83
- comment: N || "",
84
- predefinedAnnotations: _ || [],
77
+ s ? /* @__PURE__ */ p(e, {
78
+ text: I || "",
79
+ annotations: P || [],
80
+ comment: F || "",
81
+ predefinedAnnotations: S || [],
85
82
  onChange: r,
86
- onCommentChange: this.changeSessionComment,
87
- width: F,
88
- height: I,
89
- maxHeight: L,
90
- disabled: l,
91
- disabledMath: !p,
92
- customKeys: o,
93
- keypadMode: u
94
- }) : /* @__PURE__ */ m(k, {
83
+ onCommentChange: i,
84
+ width: L,
85
+ height: R,
86
+ maxHeight: z,
87
+ disabled: d,
88
+ disabledMath: !_,
89
+ customKeys: c,
90
+ keypadMode: f
91
+ }) : /* @__PURE__ */ p(O, {
95
92
  className: "response-area-editor",
96
- onChange: this.changeSessionValue,
97
- markup: P || "",
98
- maxWidth: F && F.toString(),
93
+ onChange: a,
94
+ markup: I || "",
95
+ maxWidth: L && L.toString(),
99
96
  minWidth: "100px",
100
- minHeight: I && I.toString(),
101
- maxHeight: L,
102
- disabled: c,
97
+ minHeight: R && R.toString(),
98
+ maxHeight: z,
99
+ disabled: u,
103
100
  highlightShape: !0,
104
- toolbarOpts: R,
105
- spellCheck: w,
101
+ toolbarOpts: B,
102
+ spellCheck: M,
106
103
  charactersLimit: 5e4,
107
104
  autoWidthToolbar: !0,
108
105
  pluginProps: {
109
106
  math: {
110
- disabled: !p,
107
+ disabled: !_,
111
108
  customKeys: this.props.model.customKeys,
112
109
  keypadMode: this.props.model.equationEditor,
113
110
  controlledKeypadMode: !1
@@ -121,15 +118,15 @@ var v = _(f, "UiLayout") || _(w.UiLayout, "UiLayout"), y = _(d, "PreviewPrompt")
121
118
  ul_list: { disabled: !0 },
122
119
  ol_list: { disabled: !0 }
123
120
  },
124
- languageCharactersProps: B
121
+ languageCharactersProps: H
125
122
  }),
126
- f && /* @__PURE__ */ m(x, {
123
+ g && /* @__PURE__ */ p(b, {
127
124
  correctness: "correct",
128
- feedback: f
125
+ feedback: g
129
126
  })
130
127
  ]
131
128
  });
132
129
  }
133
130
  };
134
131
  //#endregion
135
- export { j as Main, j as default };
132
+ export { A as Main, A as default };