@pie-element/select-text 13.4.0-beta.6 → 14.0.0-next.20261002094057

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 (106) hide show
  1. package/README.md +29 -3
  2. package/author.js +2 -0
  3. package/configure.js +2 -0
  4. package/controller.js +1 -0
  5. package/dist/author/defaultConfiguration.d.ts +179 -0
  6. package/dist/author/defaultConfiguration.js +141 -0
  7. package/dist/author/design.d.ts +38 -0
  8. package/dist/author/design.js +263 -0
  9. package/dist/author/index.d.ts +27 -0
  10. package/dist/author/index.js +74 -0
  11. package/dist/author/utils.d.ts +10 -0
  12. package/dist/author/utils.js +50 -0
  13. package/dist/browser/Check-Ci4LDjFB.js +9399 -0
  14. package/dist/browser/Check-Ci4LDjFB.js.map +1 -0
  15. package/dist/browser/assets/Symbola-4c507403.woff2 +0 -0
  16. package/dist/browser/author/index.js +36509 -0
  17. package/dist/browser/author/index.js.map +1 -0
  18. package/dist/browser/controller/index.js +194 -0
  19. package/dist/browser/controller/index.js.map +1 -0
  20. package/dist/browser/delivery/index.js +89 -0
  21. package/dist/browser/delivery/index.js.map +1 -0
  22. package/dist/browser/dist-BamN0-DG.js +323 -0
  23. package/dist/browser/dist-BamN0-DG.js.map +1 -0
  24. package/dist/browser/editor-runtime/Check-YttKR25j.js +9399 -0
  25. package/dist/browser/editor-runtime/Check-YttKR25j.js.map +1 -0
  26. package/dist/browser/editor-runtime/assets/Symbola-4c507403.woff2 +0 -0
  27. package/dist/browser/editor-runtime/author/index.js +20100 -0
  28. package/dist/browser/editor-runtime/author/index.js.map +1 -0
  29. package/dist/browser/editor-runtime/controller/index.js +194 -0
  30. package/dist/browser/editor-runtime/controller/index.js.map +1 -0
  31. package/dist/browser/editor-runtime/delivery/index.js +89 -0
  32. package/dist/browser/editor-runtime/delivery/index.js.map +1 -0
  33. package/dist/browser/editor-runtime/dist-CMfXI_t0.js +323 -0
  34. package/dist/browser/editor-runtime/dist-CMfXI_t0.js.map +1 -0
  35. package/dist/browser/editor-runtime/main-DkSwljhi.js +4914 -0
  36. package/dist/browser/editor-runtime/main-DkSwljhi.js.map +1 -0
  37. package/dist/browser/editor-runtime/print/index.js +43 -0
  38. package/dist/browser/editor-runtime/print/index.js.map +1 -0
  39. package/dist/browser/main-KepLpD8x.js +4914 -0
  40. package/dist/browser/main-KepLpD8x.js.map +1 -0
  41. package/dist/browser/print/index.js +43 -0
  42. package/dist/browser/print/index.js.map +1 -0
  43. package/dist/controller/defaults.d.ts +27 -0
  44. package/dist/controller/defaults.js +21 -0
  45. package/dist/controller/index.d.ts +25 -0
  46. package/dist/controller/index.js +121 -0
  47. package/dist/delivery/index.d.ts +19 -0
  48. package/dist/delivery/index.js +60 -0
  49. package/dist/delivery/main.d.ts +36 -0
  50. package/dist/delivery/main.js +145 -0
  51. package/dist/delivery/utils.d.ts +10 -0
  52. package/dist/delivery/utils.js +47 -0
  53. package/dist/index.d.ts +1 -0
  54. package/dist/index.iife.d.ts +8 -0
  55. package/dist/index.iife.js +167 -0
  56. package/dist/index.js +2 -0
  57. package/dist/print/index.d.ts +15 -0
  58. package/dist/print/index.js +43 -0
  59. package/dist/runtime-support.d.ts +12 -0
  60. package/dist/runtime-support.js +12 -0
  61. package/module/print.js +20364 -0
  62. package/module/print.js.map +1 -0
  63. package/package.json +108 -22
  64. package/print.js +2 -0
  65. package/CHANGELOG.json +0 -1422
  66. package/CHANGELOG.md +0 -2328
  67. package/LICENSE.md +0 -5
  68. package/configure/CHANGELOG.json +0 -1032
  69. package/configure/CHANGELOG.md +0 -2062
  70. package/configure/lib/__tests__/design.test.js +0 -173
  71. package/configure/lib/defaultConfiguration.js +0 -177
  72. package/configure/lib/defaultConfiguration.js.map +0 -1
  73. package/configure/lib/design.js +0 -406
  74. package/configure/lib/design.js.map +0 -1
  75. package/configure/lib/index.js +0 -129
  76. package/configure/lib/index.js.map +0 -1
  77. package/configure/lib/utils.js +0 -92
  78. package/configure/lib/utils.js.map +0 -1
  79. package/configure/package.json +0 -25
  80. package/controller/CHANGELOG.json +0 -442
  81. package/controller/CHANGELOG.md +0 -1506
  82. package/controller/lib/__tests__/index.test.js +0 -627
  83. package/controller/lib/defaults.js +0 -25
  84. package/controller/lib/defaults.js.map +0 -1
  85. package/controller/lib/index.js +0 -258
  86. package/controller/lib/index.js.map +0 -1
  87. package/controller/package.json +0 -16
  88. package/docs/config-schema.json +0 -2135
  89. package/docs/config-schema.json.md +0 -1579
  90. package/docs/demo/config.js +0 -8
  91. package/docs/demo/generate.js +0 -823
  92. package/docs/demo/index.html +0 -1
  93. package/docs/demo/pie.manifest.json +0 -11
  94. package/docs/demo/session.js +0 -24
  95. package/docs/pie-schema.json +0 -1248
  96. package/docs/pie-schema.json.md +0 -711
  97. package/lib/__tests__/index.test.js +0 -86
  98. package/lib/__tests__/main.test.js +0 -89
  99. package/lib/index.js +0 -104
  100. package/lib/index.js.map +0 -1
  101. package/lib/main.js +0 -203
  102. package/lib/main.js.map +0 -1
  103. package/lib/print.js +0 -87
  104. package/lib/print.js.map +0 -1
  105. package/lib/utils.js +0 -80
  106. package/lib/utils.js.map +0 -1
package/README.md CHANGED
@@ -1,5 +1,31 @@
1
- # select-text
1
+ # @pie-element/select-text
2
2
 
3
- TODO...
3
+ A PIE element where students select words, sentences or other tokens in a passage. Content
4
+ authoring tools often call this item type "Hot Text".
4
5
 
5
- > Don't release until 1.0.0-beta.46 is fixed and I can remove @babel/runtime
6
+ One package serves every mode: delivery, authoring, the controller and print.
7
+
8
+ ## Entry points
9
+
10
+ | Import | What it is |
11
+ | --- | --- |
12
+ | `@pie-element/select-text` | The delivery element |
13
+ | `@pie-element/select-text/author` (or `/configure`) | The authoring element |
14
+ | `@pie-element/select-text/controller` | The controller: `model()`, `outcome()`, `createCorrectResponseSession()` |
15
+ | `@pie-element/select-text/print` | The print element |
16
+ | `@pie-element/select-text/browser/*` | Browser builds of the above, for loading straight from a CDN |
17
+
18
+ ## Printing
19
+
20
+ The print element renders the item read-only, with a dashed box around every token. For the
21
+ `instructor` role the correct answers are outlined, and teacher instructions and rationale are
22
+ shown.
23
+
24
+ Two builds of it are published:
25
+
26
+ - `print` (and `browser/print`) for players in this repository, such as
27
+ `<pie-element-player view="print">`.
28
+ - `module/print.js` for the legacy `pie-print` player used by PIEOneer and other content
29
+ systems. Math in the item (LaTeX or MathML) is typeset through `pie-print`'s own renderer.
30
+
31
+ See [Print Support](../../../docs/PRINT_SUPPORT.md) for how the two print players differ.
package/author.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './dist/author/index.js';
2
+ export * from './dist/author/index.js';
package/configure.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './dist/author/index.js';
2
+ export * from './dist/author/index.js';
package/controller.js ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/controller/index.js';
@@ -0,0 +1,179 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/select-text/configure/src/defaultConfiguration.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
+ declare const _default: {
10
+ model: {
11
+ feedbackEnabled: boolean;
12
+ highlightChoices: boolean;
13
+ maxSelections: number;
14
+ mode: string;
15
+ partialScoring: boolean;
16
+ prompt: string;
17
+ promptEnabled: boolean;
18
+ rationale: string;
19
+ rationaleEnabled: boolean;
20
+ scoringType: string;
21
+ studentInstructionsEnabled: boolean;
22
+ teacherInstructions: string;
23
+ teacherInstructionsEnabled: boolean;
24
+ text: string;
25
+ tokens: never[];
26
+ toolbarEditorPosition: string;
27
+ };
28
+ configuration: {
29
+ baseInputConfiguration: {
30
+ h3: {
31
+ disabled: boolean;
32
+ };
33
+ audio: {
34
+ disabled: boolean;
35
+ };
36
+ video: {
37
+ disabled: boolean;
38
+ };
39
+ image: {
40
+ disabled: boolean;
41
+ };
42
+ textAlign: {
43
+ disabled: boolean;
44
+ };
45
+ showParagraphs: {
46
+ disabled: boolean;
47
+ };
48
+ separateParagraphs: {
49
+ disabled: boolean;
50
+ };
51
+ };
52
+ selectionCount: {
53
+ settings: boolean;
54
+ label: string;
55
+ };
56
+ correctAnswer: {
57
+ settings: boolean;
58
+ label: string;
59
+ };
60
+ selections: {
61
+ settings: boolean;
62
+ label: string;
63
+ };
64
+ highlightChoices: {
65
+ settings: boolean;
66
+ label: string;
67
+ };
68
+ rationale: {
69
+ settings: boolean;
70
+ label: string;
71
+ inputConfiguration: {
72
+ audio: {
73
+ disabled: boolean;
74
+ };
75
+ video: {
76
+ disabled: boolean;
77
+ };
78
+ image: {
79
+ disabled: boolean;
80
+ };
81
+ };
82
+ required: boolean;
83
+ };
84
+ scoringType: {
85
+ settings: boolean;
86
+ label: string;
87
+ };
88
+ studentInstructions: {
89
+ settings: boolean;
90
+ label: string;
91
+ };
92
+ teacherInstructions: {
93
+ settings: boolean;
94
+ label: string;
95
+ inputConfiguration: {
96
+ audio: {
97
+ disabled: boolean;
98
+ };
99
+ video: {
100
+ disabled: boolean;
101
+ };
102
+ image: {
103
+ disabled: boolean;
104
+ };
105
+ };
106
+ required: boolean;
107
+ };
108
+ prompt: {
109
+ label: string;
110
+ settings: boolean;
111
+ inputConfiguration: {
112
+ audio: {
113
+ disabled: boolean;
114
+ };
115
+ video: {
116
+ disabled: boolean;
117
+ };
118
+ image: {
119
+ disabled: boolean;
120
+ };
121
+ };
122
+ required: boolean;
123
+ };
124
+ text: {
125
+ settings: boolean;
126
+ label: string;
127
+ };
128
+ tokens: {
129
+ settings: boolean;
130
+ label: string;
131
+ };
132
+ feedback: {
133
+ settings: boolean;
134
+ label: string;
135
+ };
136
+ spellCheck: {
137
+ label: string;
138
+ settings: boolean;
139
+ enabled: boolean;
140
+ };
141
+ partialScoring: {
142
+ settings: boolean;
143
+ label: string;
144
+ };
145
+ mode: {
146
+ settings: boolean;
147
+ label: string;
148
+ };
149
+ minTokens: number;
150
+ maxImageWidth: {
151
+ teacherInstructions: number;
152
+ prompt: number;
153
+ rationale: number;
154
+ };
155
+ maxImageHeight: {
156
+ teacherInstructions: number;
157
+ prompt: number;
158
+ rationale: number;
159
+ };
160
+ withRubric: {
161
+ settings: boolean;
162
+ label: string;
163
+ };
164
+ mathMlOptions: {
165
+ mmlOutput: boolean;
166
+ mmlEditing: boolean;
167
+ };
168
+ language: {
169
+ settings: boolean;
170
+ label: string;
171
+ enabled: boolean;
172
+ };
173
+ languageChoices: {
174
+ label: string;
175
+ options: never[];
176
+ };
177
+ };
178
+ };
179
+ export default _default;
@@ -0,0 +1,141 @@
1
+ //#region src/author/defaultConfiguration.ts
2
+ var e = {
3
+ model: {
4
+ feedbackEnabled: !1,
5
+ highlightChoices: !1,
6
+ maxSelections: 0,
7
+ mode: "sentence",
8
+ partialScoring: !1,
9
+ prompt: "",
10
+ promptEnabled: !0,
11
+ rationale: "",
12
+ rationaleEnabled: !0,
13
+ scoringType: "auto",
14
+ studentInstructionsEnabled: !0,
15
+ teacherInstructions: "",
16
+ teacherInstructionsEnabled: !0,
17
+ text: "",
18
+ tokens: [],
19
+ toolbarEditorPosition: "bottom"
20
+ },
21
+ configuration: {
22
+ baseInputConfiguration: {
23
+ h3: { disabled: !0 },
24
+ audio: { disabled: !1 },
25
+ video: { disabled: !1 },
26
+ image: { disabled: !1 },
27
+ textAlign: { disabled: !0 },
28
+ showParagraphs: { disabled: !1 },
29
+ separateParagraphs: { disabled: !0 }
30
+ },
31
+ selectionCount: {
32
+ settings: !0,
33
+ label: "Selection count"
34
+ },
35
+ correctAnswer: {
36
+ settings: !0,
37
+ label: "Correct Answers"
38
+ },
39
+ selections: {
40
+ settings: !0,
41
+ label: "Selections Available"
42
+ },
43
+ highlightChoices: {
44
+ settings: !0,
45
+ label: "Highlight choices"
46
+ },
47
+ rationale: {
48
+ settings: !0,
49
+ label: "Rationale",
50
+ inputConfiguration: {
51
+ audio: { disabled: !1 },
52
+ video: { disabled: !1 },
53
+ image: { disabled: !1 }
54
+ },
55
+ required: !1
56
+ },
57
+ scoringType: {
58
+ settings: !1,
59
+ label: "Scoring Type"
60
+ },
61
+ studentInstructions: {
62
+ settings: !1,
63
+ label: "Student Instructions"
64
+ },
65
+ teacherInstructions: {
66
+ settings: !0,
67
+ label: "Teacher Instructions",
68
+ inputConfiguration: {
69
+ audio: { disabled: !1 },
70
+ video: { disabled: !1 },
71
+ image: { disabled: !1 }
72
+ },
73
+ required: !1
74
+ },
75
+ prompt: {
76
+ label: "Prompt",
77
+ settings: !0,
78
+ inputConfiguration: {
79
+ audio: { disabled: !1 },
80
+ video: { disabled: !1 },
81
+ image: { disabled: !1 }
82
+ },
83
+ required: !1
84
+ },
85
+ text: {
86
+ settings: !0,
87
+ label: "Content"
88
+ },
89
+ tokens: {
90
+ settings: !0,
91
+ label: "Tokens"
92
+ },
93
+ feedback: {
94
+ settings: !0,
95
+ label: "Feedback"
96
+ },
97
+ spellCheck: {
98
+ label: "Spellcheck",
99
+ settings: !1,
100
+ enabled: !0
101
+ },
102
+ partialScoring: {
103
+ settings: !1,
104
+ label: "Allow Partial Scoring"
105
+ },
106
+ mode: {
107
+ settings: !0,
108
+ label: "Mode"
109
+ },
110
+ minTokens: 2,
111
+ maxImageWidth: {
112
+ teacherInstructions: 300,
113
+ prompt: 300,
114
+ rationale: 300
115
+ },
116
+ maxImageHeight: {
117
+ teacherInstructions: 300,
118
+ prompt: 300,
119
+ rationale: 300
120
+ },
121
+ withRubric: {
122
+ settings: !1,
123
+ label: "Add Rubric"
124
+ },
125
+ mathMlOptions: {
126
+ mmlOutput: !1,
127
+ mmlEditing: !1
128
+ },
129
+ language: {
130
+ settings: !1,
131
+ label: "Specify Language",
132
+ enabled: !1
133
+ },
134
+ languageChoices: {
135
+ label: "Language Choices",
136
+ options: []
137
+ }
138
+ }
139
+ };
140
+ //#endregion
141
+ export { e as default };
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/select-text/configure/src/design.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 Design extends React.Component {
12
+ static propTypes: {
13
+ model: PropTypes.Validator<object>;
14
+ configuration: PropTypes.Validator<object>;
15
+ onModelChanged: PropTypes.Validator<(...args: any[]) => any>;
16
+ onConfigurationChanged: PropTypes.Validator<(...args: any[]) => any>;
17
+ imageSupport: PropTypes.Requireable<PropTypes.InferProps<{
18
+ add: PropTypes.Validator<(...args: any[]) => any>;
19
+ delete: PropTypes.Validator<(...args: any[]) => any>;
20
+ }>>;
21
+ uploadSoundSupport: PropTypes.Requireable<object>;
22
+ };
23
+ static defaultProps: {};
24
+ constructor(props: any);
25
+ UNSAFE_componentWillReceiveProps(nProps: any): void;
26
+ updateText: import("@pie-element/shared-lodash").CancelableFunction<(val: any) => void>;
27
+ changeText: (event: any) => void | undefined;
28
+ changeTokens: any;
29
+ changeMaxSelections: any;
30
+ apply: any;
31
+ changeFeedback: any;
32
+ changePartialScoring: any;
33
+ onPromptChanged: any;
34
+ onTeacherInstructionsChanged: any;
35
+ onRationaleChanged: any;
36
+ render(): React.JSX.Element;
37
+ }
38
+ export default Design;
@@ -0,0 +1,263 @@
1
+ import { generateValidationMessage as e } from "./utils.js";
2
+ import t from "react";
3
+ import n from "prop-types";
4
+ import { Tokenizer as r } from "@pie-lib/text-select";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ import { styled as o } from "@mui/material/styles";
7
+ import s from "debug";
8
+ import { cloneDeep as c, debounce as l } from "@pie-element/shared-lodash";
9
+ import u from "@mui/material/TextField";
10
+ import { FeedbackConfig as ee, InputContainer as d, NumberTextField as f, layout as p, settings as m } from "@pie-lib/config-ui";
11
+ import h from "@mui/material/Chip";
12
+ import te from "@mui/icons-material/Info";
13
+ import g from "@pie-lib/editable-html-tip-tap";
14
+ import _ from "@mui/material/Tooltip";
15
+ //#region src/author/design.tsx
16
+ var { Panel: ne, toggle: v, radio: y, dropdown: re } = m, b = o(d)(({ theme: e }) => ({
17
+ width: "100%",
18
+ paddingTop: e.spacing(2),
19
+ marginBottom: e.spacing(2)
20
+ })), x = o(g)({ width: "100%" }), S = o("div")(({ theme: e }) => ({
21
+ fontSize: e.typography.fontSize - 2,
22
+ color: e.palette.error.main,
23
+ paddingTop: e.spacing(1)
24
+ })), ie = o(u)({ width: "100%" }), ae = o(d)(({ theme: e }) => ({
25
+ paddingRight: 0,
26
+ marginRight: 0,
27
+ position: "relative",
28
+ "&:after": {
29
+ position: "absolute",
30
+ bottom: 0,
31
+ left: 0,
32
+ right: 0,
33
+ height: "1px",
34
+ content: "\"\"",
35
+ backgroundColor: e.palette.primary.main
36
+ },
37
+ marginBottom: e.spacing(1)
38
+ })), C = o(_)(({ theme: e }) => ({ "& .MuiTooltip-tooltip": {
39
+ fontSize: e.typography.fontSize - 2,
40
+ whiteSpace: "pre",
41
+ maxWidth: "500px"
42
+ } })), oe = o(r)(({ theme: e }) => ({ marginTop: e.spacing(2) })), w = o(h)(({ theme: e }) => ({
43
+ marginTop: e.spacing(.5),
44
+ marginRight: e.spacing(2)
45
+ })), se = o("div")(({ theme: e }) => ({
46
+ display: "flex",
47
+ alignItems: "center",
48
+ flexWrap: "wrap",
49
+ marginBottom: e.spacing(2.5)
50
+ })), ce = o(f)(({ theme: e }) => ({
51
+ width: "180px",
52
+ margin: `${e.spacing(.5)} auto 0`
53
+ })), le = s("@pie-element:select-text:configure"), T = class extends t.Component {
54
+ static propTypes = {
55
+ model: n.object.isRequired,
56
+ configuration: n.object.isRequired,
57
+ onModelChanged: n.func.isRequired,
58
+ onConfigurationChanged: n.func.isRequired,
59
+ imageSupport: n.shape({
60
+ add: n.func.isRequired,
61
+ delete: n.func.isRequired
62
+ }),
63
+ uploadSoundSupport: n.object
64
+ };
65
+ static defaultProps = {};
66
+ constructor(e) {
67
+ super(e);
68
+ let { model: t } = this.props;
69
+ this.state = { text: t && t.text || "" };
70
+ }
71
+ UNSAFE_componentWillReceiveProps(e) {
72
+ let { model: t } = e;
73
+ t && t.text && this.setState({ text: t.text });
74
+ }
75
+ updateText = l((e) => {
76
+ this.apply((t) => {
77
+ t.text = e, t.tokens = [];
78
+ });
79
+ }, 200);
80
+ changeText = (e) => this.updateText(e.target.value);
81
+ changeTokens = (e, t) => {
82
+ this.apply((n) => {
83
+ n.tokens = e, n.mode = t;
84
+ let r = e.filter((e) => e.correct).length, i = isFinite(n.maxSelections) ? n.maxSelections : 0;
85
+ n.maxSelections = Math.max(i, r);
86
+ });
87
+ };
88
+ changeMaxSelections = (e, t) => {
89
+ this.apply((e) => e.maxSelections = t);
90
+ };
91
+ apply = (e) => {
92
+ let { onModelChanged: t, model: n } = this.props, r = c(n);
93
+ e(r), t(r);
94
+ };
95
+ changeFeedback = (e) => {
96
+ this.apply((t) => t.feedback = e);
97
+ };
98
+ changePartialScoring = (e) => {
99
+ let { onModelChanged: t, model: n } = this.props, r = c(n);
100
+ r.partialScoring = e, t(r);
101
+ };
102
+ onPromptChanged = (e) => {
103
+ let { onModelChanged: t, model: n } = this.props, r = c(n);
104
+ r.prompt = e, t(r);
105
+ };
106
+ onTeacherInstructionsChanged = (e) => {
107
+ let { onModelChanged: t, model: n } = this.props, r = c(n);
108
+ r.teacherInstructions = e, t(r);
109
+ };
110
+ onRationaleChanged = (e) => {
111
+ let { onModelChanged: t, model: n } = this.props;
112
+ t({
113
+ ...n,
114
+ rationale: e
115
+ });
116
+ };
117
+ render() {
118
+ let { text: t } = this.state, { configuration: n, imageSupport: r, model: o, onConfigurationChanged: s, onModelChanged: c, uploadSoundSupport: l } = this.props, { baseInputConfiguration: u = {}, correctAnswer: d = {}, contentDimensions: f = {}, feedback: m = {}, highlightChoices: h = {}, mode: g = {}, partialScoring: _ = {}, prompt: T = {}, rationale: E = {}, selectionCount: D = {}, selections: O = {}, settingsPanelDisabled: ue, scoringType: k = {}, spellCheck: A = {}, studentInstructions: j = {}, teacherInstructions: M = {}, text: N = {}, tokens: P = {}, maxImageWidth: F = {}, maxImageHeight: I = {}, withRubric: L = {}, mathMlOptions: R = {}, language: z = {}, languageChoices: B = {} } = n || {}, { errors: V, extraCSSRules: H, feedbackEnabled: de, promptEnabled: fe, rationaleEnabled: pe, spellCheckEnabled: U, teacherInstructionsEnabled: me, toolbarEditorPosition: he } = o || {}, { prompt: W, rationale: G, selectionsError: K, teacherInstructions: q, tokensError: J } = V || {}, ge = e(n), Y = F && F.prompt, X = I && I.prompt, { tokens: Z } = o;
119
+ Z ||= [];
120
+ let Q = { position: he === "top" ? "top" : "bottom" };
121
+ le("[render] maxSelections:", o.maxSelections);
122
+ let _e = {
123
+ partialScoring: _.settings && v(_.label),
124
+ highlightChoices: h.settings && v(h.label),
125
+ feedbackEnabled: m.settings && v(m.label),
126
+ "language.enabled": z.settings && v(z.label, !0),
127
+ language: z.settings && z.enabled && re(B.label, B.options)
128
+ }, ve = {
129
+ teacherInstructionsEnabled: M.settings && v(M.label),
130
+ studentInstructionsEnabled: j.settings && v(j.label),
131
+ promptEnabled: T.settings && v(T.label),
132
+ rationaleEnabled: E.settings && v(E.label),
133
+ spellCheckEnabled: A.settings && v(A.label),
134
+ scoringType: k.settings && y(k.label, ["auto", "rubric"]),
135
+ rubricEnabled: L?.settings && v(L?.label)
136
+ }, $ = (e = {}) => ({
137
+ ...u,
138
+ ...e
139
+ });
140
+ return /* @__PURE__ */ a(p.ConfigLayout, {
141
+ extraCSSRules: H,
142
+ dimensions: f,
143
+ hideSettings: ue,
144
+ settings: /* @__PURE__ */ i(ne, {
145
+ model: o,
146
+ configuration: n,
147
+ onChangeModel: (e) => c(e),
148
+ onChangeConfiguration: s,
149
+ groups: {
150
+ Settings: _e,
151
+ Properties: ve
152
+ }
153
+ }),
154
+ children: [
155
+ me && /* @__PURE__ */ a(b, {
156
+ label: M.label,
157
+ children: [/* @__PURE__ */ i(x, {
158
+ markup: o.teacherInstructions || "",
159
+ onChange: this.onTeacherInstructionsChanged,
160
+ imageSupport: r,
161
+ nonEmpty: !1,
162
+ error: q,
163
+ toolbarOpts: Q,
164
+ pluginProps: $(n?.teacherInstructions?.inputConfiguration),
165
+ spellCheck: U,
166
+ maxImageWidth: F && F.teacherInstructions || Y,
167
+ maxImageHeight: I && I.teacherInstructions || X,
168
+ uploadSoundSupport: l,
169
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
170
+ mathMlOptions: R
171
+ }), q && /* @__PURE__ */ i(S, { children: q })]
172
+ }),
173
+ fe && /* @__PURE__ */ a(b, {
174
+ label: T.label || "",
175
+ children: [/* @__PURE__ */ i(x, {
176
+ markup: o.prompt,
177
+ onChange: this.onPromptChanged,
178
+ imageSupport: r,
179
+ error: W,
180
+ toolbarOpts: Q,
181
+ pluginProps: $(n?.prompt?.inputConfiguration),
182
+ spellCheck: U,
183
+ maxImageWidth: Y,
184
+ maxImageHeight: X,
185
+ uploadSoundSupport: l,
186
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
187
+ mathMlOptions: R
188
+ }), W && /* @__PURE__ */ i(S, { children: W })]
189
+ }),
190
+ N.settings && /* @__PURE__ */ i(b, {
191
+ label: N.label || "",
192
+ children: /* @__PURE__ */ i(ie, {
193
+ variant: "standard",
194
+ multiline: !0,
195
+ defaultValue: t,
196
+ onChange: this.changeText,
197
+ spellCheck: U
198
+ })
199
+ }),
200
+ P.settings && /* @__PURE__ */ a(ae, {
201
+ label: P.label || "",
202
+ children: [/* @__PURE__ */ i(C, {
203
+ disableFocusListener: !0,
204
+ disableTouchListener: !0,
205
+ placement: "right",
206
+ title: ge,
207
+ children: /* @__PURE__ */ i(te, {
208
+ fontSize: "small",
209
+ color: "primary",
210
+ style: {
211
+ position: "absolute",
212
+ left: "48px",
213
+ top: "-3px"
214
+ }
215
+ })
216
+ }), /* @__PURE__ */ i(oe, {
217
+ text: o.text,
218
+ tokens: Z,
219
+ onChange: this.changeTokens
220
+ })]
221
+ }),
222
+ J && /* @__PURE__ */ i(S, { children: J }),
223
+ K && /* @__PURE__ */ i(S, { children: K }),
224
+ /* @__PURE__ */ a(se, { children: [
225
+ g.settings && /* @__PURE__ */ i(w, { label: `${g.label}: ${o.mode ? o.mode : "None"}` }),
226
+ O.settings && /* @__PURE__ */ i(w, { label: `${O.label}: ${Z.length}` }),
227
+ d.settings && /* @__PURE__ */ i(w, { label: `${d.label}: ${Z.filter((e) => e.correct).length}` }),
228
+ D.settings && /* @__PURE__ */ i(ce, {
229
+ min: Z.filter((e) => e.correct).length || 0,
230
+ label: `${D.label} (0:any)`,
231
+ max: Z.length,
232
+ value: o.maxSelections,
233
+ onChange: this.changeMaxSelections
234
+ })
235
+ ] }),
236
+ pe && /* @__PURE__ */ a(b, {
237
+ label: E.label || "",
238
+ children: [/* @__PURE__ */ i(x, {
239
+ markup: o.rationale || "",
240
+ onChange: this.onRationaleChanged,
241
+ imageSupport: r,
242
+ error: G,
243
+ toolbarOpts: Q,
244
+ pluginProps: $(n?.rationale?.inputConfiguration),
245
+ spellCheck: U,
246
+ maxImageWidth: F && F.rationale || Y,
247
+ maxImageHeight: I && I.rationale || X,
248
+ uploadSoundSupport: l,
249
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
250
+ mathMlOptions: R
251
+ }), G && /* @__PURE__ */ i(S, { children: G })]
252
+ }),
253
+ de && /* @__PURE__ */ i(ee, {
254
+ feedback: o.feedback,
255
+ onChange: this.changeFeedback,
256
+ toolbarOpts: Q
257
+ })
258
+ ]
259
+ });
260
+ }
261
+ };
262
+ //#endregion
263
+ export { T as Design, T as default };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/select-text/configure/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 default class SelectTextConfigure extends HTMLElement {
10
+ static createDefaultModel: (model?: {}) => any;
11
+ constructor();
12
+ set model(m: any);
13
+ set configuration(c: any);
14
+ connectedCallback(): void;
15
+ modelChanged(m: any): void;
16
+ onConfigurationChanged(c: any): void;
17
+ /**
18
+ *
19
+ * @param {done, progress, file} handler
20
+ */
21
+ insertImage(handler: any): void;
22
+ onDeleteImage(src: any, done: any): void;
23
+ insertSound(handler: any): void;
24
+ onDeleteSound(src: any, done: any): void;
25
+ render(): void;
26
+ disconnectedCallback(): void;
27
+ }