@pie-element/extended-text-entry 15.1.2-next.4 → 15.1.2-next.6

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.
@@ -48,5 +48,6 @@ export default class ExtendedTextEntry extends HTMLElement {
48
48
  insertSound(handler: any): void;
49
49
  onDeleteSound(src: any, done: any): void;
50
50
  render(): void;
51
+ connectedCallback(): void;
51
52
  disconnectedCallback(): void;
52
53
  }
@@ -1,4 +1,4 @@
1
- import e from "./main.js";
1
+ import { Main as e } from "./main.js";
2
2
  import t from "./defaults.js";
3
3
  import n from "react";
4
4
  import { createRoot as r } from "react-dom/client";
@@ -66,8 +66,11 @@ var l = class l extends HTMLElement {
66
66
  this._root ||= r(this), this._root.render(t);
67
67
  }
68
68
  }
69
+ connectedCallback() {
70
+ this.render();
71
+ }
69
72
  disconnectedCallback() {
70
- this._root && this._root.unmount();
73
+ this._root &&= (this._root.unmount(), null);
71
74
  }
72
75
  };
73
76
  //#endregion
@@ -4,21 +4,21 @@ import n from "@mui/material/Typography";
4
4
  import { styled as r } from "@mui/material/styles";
5
5
  import i, { ALL_PLUGINS as a } from "@pie-lib/editable-html-tip-tap";
6
6
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
- import { FeedbackSelector as c, InputContainer as l, layout as u, settings as d } from "@pie-lib/config-ui";
7
+ import { FeedbackSelector as ee, InputContainer as c, layout as l, settings as u } from "@pie-lib/config-ui";
8
8
  //#region src/author/main.tsx
9
- var { Panel: f, toggle: p, numberFields: m, dropdown: h } = d, g = {
9
+ var { Panel: d, toggle: f, numberFields: p, dropdown: m } = u, h = {
10
10
  type: "default",
11
11
  default: "Your answer has been submitted"
12
- }, _ = r(n)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), v = r(l)(({ theme: e }) => ({
12
+ }, g = r(n)(({ theme: e }) => ({ paddingBottom: e.spacing(1) })), _ = r(c)(({ theme: e }) => ({
13
13
  paddingTop: e.spacing(1),
14
14
  marginTop: e.spacing(2),
15
15
  marginBottom: e.spacing(2),
16
16
  width: "100%"
17
- })), y = r("div")(({ theme: e }) => ({
17
+ })), v = r("div")(({ theme: e }) => ({
18
18
  fontSize: e.typography.fontSize - 2,
19
19
  color: e.palette.error.main,
20
20
  paddingTop: e.spacing(1)
21
- })), b = class extends e.Component {
21
+ })), y = class extends e.Component {
22
22
  static propTypes = {
23
23
  onModelChanged: t.func.isRequired,
24
24
  onConfigurationChanged: t.func,
@@ -52,9 +52,9 @@ var { Panel: f, toggle: p, numberFields: m, dropdown: h } = d, g = {
52
52
  });
53
53
  };
54
54
  render() {
55
- let { model: t, configuration: n, imageSupport: r, onConfigurationChanged: l, onModelChanged: d, uploadSoundSupport: b } = this.props, { annotations: x = {}, contentDimensions: S = {}, dimensions: C = {}, equationEditor: w = {}, feedback: T = {}, playerSpellCheck: E = {}, prompt: D = {}, settingsPanelDisabled: ee, spanishInput: O = {}, specialInput: k = {}, spellCheck: A = {}, studentInstructions: j = {}, teacherInstructions: M = {}, mathInput: N = {}, maxImageWidth: P = {}, maxImageHeight: F = {}, multiple: I = {}, withRubric: L = {}, mathMlOptions: R = {}, baseInputConfiguration: z = {} } = n || {}, { errors: B = {}, extraCSSRules: V, feedbackEnabled: H, promptEnabled: U, spellCheckEnabled: W, teacherInstructionsEnabled: G, toolbarEditorPosition: K } = t || {}, { prompt: q, teacherInstructions: J } = B, Y = P && P.prompt, X = F && F.prompt, Z = { position: K === "top" ? "top" : "bottom" }, Q = {
56
- mathInput: N.settings && p(N.label),
57
- equationEditor: w.enabled && t.mathInput && h(w.label, [
55
+ let { model: t, configuration: n, imageSupport: r, onConfigurationChanged: c, onModelChanged: u, uploadSoundSupport: y } = this.props, { annotations: b = {}, contentDimensions: x = {}, dimensions: S = {}, equationEditor: C = {}, feedback: w = {}, playerSpellCheck: T = {}, prompt: E = {}, settingsPanelDisabled: D, spanishInput: O = {}, specialInput: k = {}, spellCheck: A = {}, studentInstructions: j = {}, teacherInstructions: M = {}, mathInput: N = {}, maxImageWidth: P = {}, maxImageHeight: F = {}, multiple: I = {}, withRubric: L = {}, mathMlOptions: R = {}, baseInputConfiguration: z = {} } = n || {}, { errors: B = {}, extraCSSRules: V, feedbackEnabled: H, promptEnabled: U, spellCheckEnabled: W, teacherInstructionsEnabled: G, toolbarEditorPosition: K } = t || {}, { prompt: q, teacherInstructions: J } = B, Y = P && P.prompt, X = F && F.prompt, Z = { position: K === "top" ? "top" : "bottom" }, Q = {
56
+ mathInput: N.settings && f(N.label),
57
+ equationEditor: C.enabled && t.mathInput && m(C.label, [
58
58
  "non-negative-integers",
59
59
  "integers",
60
60
  "decimals",
@@ -68,9 +68,9 @@ var { Panel: f, toggle: p, numberFields: m, dropdown: h } = d, g = {
68
68
  "statistics",
69
69
  "item-authoring"
70
70
  ]),
71
- spanishInput: O.settings && p(O.label),
72
- specialInput: k.settings && p(k.label),
73
- dimensions: C.settings && m(C.label, {
71
+ spanishInput: O.settings && f(O.label),
72
+ specialInput: k.settings && f(k.label),
73
+ dimensions: S.settings && p(S.label, {
74
74
  width: {
75
75
  label: "Width (px)",
76
76
  suffix: "px",
@@ -84,33 +84,33 @@ var { Panel: f, toggle: p, numberFields: m, dropdown: h } = d, g = {
84
84
  max: 500
85
85
  }
86
86
  }),
87
- "multiple.enabled": I.settings && p(I.label, !0),
88
- promptEnabled: D.settings && p(D.label),
89
- feedbackEnabled: T.settings && p(T.label),
90
- annotationsEnabled: x.settings && p(x.label),
91
- spellCheckEnabled: A.settings && p(A.label),
92
- playerSpellCheckDisabled: E.settings && p(E.label)
87
+ "multiple.enabled": I.settings && f(I.label, !0),
88
+ promptEnabled: E.settings && f(E.label),
89
+ feedbackEnabled: w.settings && f(w.label),
90
+ annotationsEnabled: b.settings && f(b.label),
91
+ spellCheckEnabled: A.settings && f(A.label),
92
+ playerSpellCheckDisabled: T.settings && f(T.label)
93
93
  }, te = {
94
- teacherInstructionsEnabled: M.settings && p(M.label),
95
- studentInstructionsEnabled: j.settings && p(j.label),
96
- rubricEnabled: L?.settings && p(L?.label)
94
+ teacherInstructionsEnabled: M.settings && f(M.label),
95
+ studentInstructionsEnabled: j.settings && f(j.label),
96
+ rubricEnabled: L?.settings && f(L?.label)
97
97
  }, $ = (e) => Object.assign({ ...z }, e || {});
98
- return /* @__PURE__ */ s(u.ConfigLayout, {
98
+ return /* @__PURE__ */ s(l.ConfigLayout, {
99
99
  extraCSSRules: V,
100
- dimensions: S,
101
- hideSettings: ee,
102
- settings: /* @__PURE__ */ o(f, {
100
+ dimensions: x,
101
+ hideSettings: D,
102
+ settings: /* @__PURE__ */ o(d, {
103
103
  model: t,
104
104
  configuration: n,
105
- onChangeModel: (e) => d(e),
106
- onChangeConfiguration: (e) => l(e),
105
+ onChangeModel: (e) => u(e),
106
+ onChangeConfiguration: (e) => c(e),
107
107
  groups: {
108
108
  Settings: Q,
109
109
  Properties: te
110
110
  }
111
111
  }),
112
112
  children: [
113
- G && /* @__PURE__ */ s(v, {
113
+ G && /* @__PURE__ */ s(_, {
114
114
  label: M.label,
115
115
  children: [/* @__PURE__ */ o(i, {
116
116
  className: "prompt",
@@ -123,14 +123,14 @@ var { Panel: f, toggle: p, numberFields: m, dropdown: h } = d, g = {
123
123
  spellCheck: W,
124
124
  maxImageWidth: P && P.teacherInstructions || Y,
125
125
  maxImageHeight: F && F.teacherInstructions || X,
126
- uploadSoundSupport: b,
126
+ uploadSoundSupport: y,
127
127
  languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
128
128
  mathMlOptions: R,
129
129
  pluginProps: $(M?.inputConfiguration)
130
- }), J && /* @__PURE__ */ o(y, { children: J })]
130
+ }), J && /* @__PURE__ */ o(v, { children: J })]
131
131
  }),
132
- U && /* @__PURE__ */ s(v, {
133
- label: D.label,
132
+ U && /* @__PURE__ */ s(_, {
133
+ label: E.label,
134
134
  children: [/* @__PURE__ */ o(i, {
135
135
  activePlugins: a,
136
136
  className: "prompt",
@@ -143,18 +143,18 @@ var { Panel: f, toggle: p, numberFields: m, dropdown: h } = d, g = {
143
143
  spellCheck: W,
144
144
  maxImageWidth: Y,
145
145
  maxImageHeight: X,
146
- uploadSoundSupport: b,
146
+ uploadSoundSupport: y,
147
147
  languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
148
148
  mathMlOptions: R,
149
- pluginProps: $(D?.inputConfiguration)
150
- }), q && /* @__PURE__ */ o(y, { children: q })]
149
+ pluginProps: $(E?.inputConfiguration)
150
+ }), q && /* @__PURE__ */ o(v, { children: q })]
151
151
  }),
152
- H && /* @__PURE__ */ s(e.Fragment, { children: [/* @__PURE__ */ o(_, {
152
+ H && /* @__PURE__ */ s(e.Fragment, { children: [/* @__PURE__ */ o(g, {
153
153
  variant: "h6",
154
154
  children: "Feedback"
155
- }), /* @__PURE__ */ o(c, {
155
+ }), /* @__PURE__ */ o(ee, {
156
156
  label: "When submitted, show",
157
- feedback: t.feedback || g,
157
+ feedback: t.feedback || h,
158
158
  onChange: this.changeFeedback,
159
159
  toolbarOpts: Z
160
160
  })] })
@@ -163,4 +163,4 @@ var { Panel: f, toggle: p, numberFields: m, dropdown: h } = d, g = {
163
163
  }
164
164
  };
165
165
  //#endregion
166
- export { b as default };
166
+ export { y as Main, y as default };