@pie-element/categorize 13.1.11 → 13.2.0-next.9

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 (169) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/defaults.d.ts +222 -0
  4. package/dist/author/defaults.js +168 -0
  5. package/dist/author/design/builder.d.ts +10 -0
  6. package/dist/author/design/builder.js +24 -0
  7. package/dist/author/design/buttons.d.ts +28 -0
  8. package/dist/author/design/buttons.js +36 -0
  9. package/dist/author/design/categories/RowLabel.d.ts +23 -0
  10. package/dist/author/design/categories/RowLabel.js +47 -0
  11. package/dist/author/design/categories/alternateResponses.d.ts +31 -0
  12. package/dist/author/design/categories/alternateResponses.js +62 -0
  13. package/dist/author/design/categories/category.d.ts +44 -0
  14. package/dist/author/design/categories/category.js +98 -0
  15. package/dist/author/design/categories/choice-preview.d.ts +25 -0
  16. package/dist/author/design/categories/choice-preview.js +60 -0
  17. package/dist/author/design/categories/droppable-placeholder.d.ts +11 -0
  18. package/dist/author/design/categories/droppable-placeholder.js +71 -0
  19. package/dist/author/design/categories/index.d.ts +41 -0
  20. package/dist/author/design/categories/index.js +146 -0
  21. package/dist/author/design/choices/choice.d.ts +11 -0
  22. package/dist/author/design/choices/choice.js +129 -0
  23. package/dist/author/design/choices/config.d.ts +21 -0
  24. package/dist/author/design/choices/config.js +33 -0
  25. package/dist/author/design/choices/index.d.ts +41 -0
  26. package/dist/author/design/choices/index.js +110 -0
  27. package/dist/author/design/header.d.ts +24 -0
  28. package/dist/author/design/header.js +49 -0
  29. package/dist/author/design/index.d.ts +52 -0
  30. package/dist/author/design/index.js +427 -0
  31. package/dist/author/design/input-header.d.ts +39 -0
  32. package/dist/author/design/input-header.js +69 -0
  33. package/dist/author/design/utils.d.ts +9 -0
  34. package/dist/author/design/utils.js +7 -0
  35. package/dist/author/index.d.ts +50 -0
  36. package/dist/author/index.js +87 -0
  37. package/dist/author/main.d.ts +23 -0
  38. package/dist/author/main.js +30 -0
  39. package/dist/author/utils.d.ts +16 -0
  40. package/dist/author/utils.js +17 -0
  41. package/dist/browser/alert-dialog-BL9K_lnF.js +11511 -0
  42. package/dist/browser/alert-dialog-BL9K_lnF.js.map +1 -0
  43. package/dist/browser/author/index.js +43156 -0
  44. package/dist/browser/author/index.js.map +1 -0
  45. package/dist/browser/categorize.css +2 -0
  46. package/dist/browser/controller/index.js +372 -0
  47. package/dist/browser/controller/index.js.map +1 -0
  48. package/dist/browser/delivery/index.js +1205 -0
  49. package/dist/browser/delivery/index.js.map +1 -0
  50. package/dist/browser/dist-C11U2GIc.js +1871 -0
  51. package/dist/browser/dist-C11U2GIc.js.map +1 -0
  52. package/dist/browser/rolldown-runtime-CWhphoD1.js +32 -0
  53. package/dist/controller/defaults.d.ts +33 -0
  54. package/dist/controller/defaults.js +27 -0
  55. package/dist/controller/index.d.ts +62 -0
  56. package/dist/controller/index.js +168 -0
  57. package/dist/controller/utils.d.ts +20 -0
  58. package/dist/controller/utils.js +35 -0
  59. package/dist/delivery/categorize/__tests__/categories.test.d.ts +1 -0
  60. package/dist/delivery/categorize/__tests__/category.test.d.ts +1 -0
  61. package/dist/delivery/categorize/__tests__/choice.test.d.ts +1 -0
  62. package/dist/delivery/categorize/__tests__/choices.test.d.ts +1 -0
  63. package/dist/delivery/categorize/__tests__/droppable-placeholder.test.d.ts +1 -0
  64. package/dist/delivery/categorize/__tests__/grid-content.test.d.ts +1 -0
  65. package/dist/delivery/categorize/__tests__/index.test.d.ts +1 -0
  66. package/dist/delivery/categorize/__tests__/keyboard-coordinates.test.d.ts +1 -0
  67. package/dist/delivery/categorize/categories.d.ts +37 -0
  68. package/dist/delivery/categorize/categories.js +72 -0
  69. package/dist/delivery/categorize/category.d.ts +31 -0
  70. package/dist/delivery/categorize/category.js +55 -0
  71. package/dist/delivery/categorize/choice.d.ts +28 -0
  72. package/dist/delivery/categorize/choice.js +114 -0
  73. package/dist/delivery/categorize/choices.d.ts +42 -0
  74. package/dist/delivery/categorize/choices.js +58 -0
  75. package/dist/delivery/categorize/droppable-placeholder.d.ts +36 -0
  76. package/dist/delivery/categorize/droppable-placeholder.js +77 -0
  77. package/dist/delivery/categorize/grid-content.d.ts +25 -0
  78. package/dist/delivery/categorize/grid-content.js +39 -0
  79. package/dist/delivery/categorize/index.d.ts +70 -0
  80. package/dist/delivery/categorize/index.js +317 -0
  81. package/dist/delivery/categorize/keyboard-coordinates.d.ts +22 -0
  82. package/dist/delivery/categorize/keyboard-coordinates.js +49 -0
  83. package/dist/delivery/index.d.ts +27 -0
  84. package/dist/delivery/index.js +152 -0
  85. package/dist/index.d.ts +1 -0
  86. package/dist/index.iife.d.ts +8 -0
  87. package/dist/index.iife.js +152 -0
  88. package/dist/index.js +2 -0
  89. package/dist/runtime-support.d.ts +12 -0
  90. package/dist/runtime-support.js +12 -0
  91. package/package.json +97 -22
  92. package/CHANGELOG.json +0 -1637
  93. package/CHANGELOG.md +0 -2598
  94. package/LICENSE.md +0 -5
  95. package/README.md +0 -5
  96. package/configure/CHANGELOG.json +0 -1202
  97. package/configure/CHANGELOG.md +0 -2177
  98. package/configure/lib/defaults.js +0 -220
  99. package/configure/lib/defaults.js.map +0 -1
  100. package/configure/lib/design/builder.js +0 -55
  101. package/configure/lib/design/builder.js.map +0 -1
  102. package/configure/lib/design/buttons.js +0 -59
  103. package/configure/lib/design/buttons.js.map +0 -1
  104. package/configure/lib/design/categories/RowLabel.js +0 -66
  105. package/configure/lib/design/categories/RowLabel.js.map +0 -1
  106. package/configure/lib/design/categories/alternateResponses.js +0 -116
  107. package/configure/lib/design/categories/alternateResponses.js.map +0 -1
  108. package/configure/lib/design/categories/category.js +0 -153
  109. package/configure/lib/design/categories/category.js.map +0 -1
  110. package/configure/lib/design/categories/choice-preview.js +0 -79
  111. package/configure/lib/design/categories/choice-preview.js.map +0 -1
  112. package/configure/lib/design/categories/droppable-placeholder.js +0 -93
  113. package/configure/lib/design/categories/droppable-placeholder.js.map +0 -1
  114. package/configure/lib/design/categories/index.js +0 -256
  115. package/configure/lib/design/categories/index.js.map +0 -1
  116. package/configure/lib/design/choices/choice.js +0 -187
  117. package/configure/lib/design/choices/choice.js.map +0 -1
  118. package/configure/lib/design/choices/config.js +0 -58
  119. package/configure/lib/design/choices/config.js.map +0 -1
  120. package/configure/lib/design/choices/index.js +0 -197
  121. package/configure/lib/design/choices/index.js.map +0 -1
  122. package/configure/lib/design/header.js +0 -71
  123. package/configure/lib/design/header.js.map +0 -1
  124. package/configure/lib/design/index.js +0 -741
  125. package/configure/lib/design/index.js.map +0 -1
  126. package/configure/lib/design/input-header.js +0 -105
  127. package/configure/lib/design/input-header.js.map +0 -1
  128. package/configure/lib/design/utils.js +0 -12
  129. package/configure/lib/design/utils.js.map +0 -1
  130. package/configure/lib/index.js +0 -148
  131. package/configure/lib/index.js.map +0 -1
  132. package/configure/lib/main.js +0 -44
  133. package/configure/lib/main.js.map +0 -1
  134. package/configure/lib/utils.js +0 -43
  135. package/configure/lib/utils.js.map +0 -1
  136. package/configure/package.json +0 -32
  137. package/controller/CHANGELOG.json +0 -452
  138. package/controller/CHANGELOG.md +0 -1411
  139. package/controller/lib/defaults.js +0 -31
  140. package/controller/lib/defaults.js.map +0 -1
  141. package/controller/lib/index.js +0 -506
  142. package/controller/lib/index.js.map +0 -1
  143. package/controller/lib/utils.js +0 -69
  144. package/controller/lib/utils.js.map +0 -1
  145. package/controller/package.json +0 -18
  146. package/docs/config-schema.json +0 -2897
  147. package/docs/config-schema.json.md +0 -2138
  148. package/docs/demo/config.js +0 -8
  149. package/docs/demo/generate.js +0 -357
  150. package/docs/demo/index.html +0 -1
  151. package/docs/demo/session.js +0 -12
  152. package/docs/pie-schema.json +0 -1784
  153. package/docs/pie-schema.json.md +0 -1046
  154. package/lib/categorize/categories.js +0 -135
  155. package/lib/categorize/categories.js.map +0 -1
  156. package/lib/categorize/category.js +0 -67
  157. package/lib/categorize/category.js.map +0 -1
  158. package/lib/categorize/choice.js +0 -140
  159. package/lib/categorize/choice.js.map +0 -1
  160. package/lib/categorize/choices.js +0 -99
  161. package/lib/categorize/choices.js.map +0 -1
  162. package/lib/categorize/droppable-placeholder.js +0 -84
  163. package/lib/categorize/droppable-placeholder.js.map +0 -1
  164. package/lib/categorize/grid-content.js +0 -55
  165. package/lib/categorize/grid-content.js.map +0 -1
  166. package/lib/categorize/index.js +0 -450
  167. package/lib/categorize/index.js.map +0 -1
  168. package/lib/index.js +0 -316
  169. package/lib/index.js.map +0 -1
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,222 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/categorize/configure/src/defaults.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
+ allowAlternateEnabled: boolean;
12
+ allowMaxChoicesPerCategory: boolean;
13
+ alternates: never[];
14
+ categories: never[];
15
+ categoriesPerRow: number;
16
+ choices: never[];
17
+ choicesLabel: string;
18
+ choicesPosition: string;
19
+ correctResponse: never[];
20
+ feedbackEnabled: boolean;
21
+ lockChoiceOrder: boolean;
22
+ maxAnswerChoices: number;
23
+ maxChoicesPerCategory: number;
24
+ partialScoring: boolean;
25
+ promptEnabled: boolean;
26
+ rationaleEnabled: boolean;
27
+ rowLabels: string[];
28
+ studentInstructionsEnabled: boolean;
29
+ teacherInstructionsEnabled: boolean;
30
+ toolbarEditorPosition: string;
31
+ minRowHeight: string;
32
+ };
33
+ configuration: {
34
+ baseInputConfiguration: {
35
+ h3: {
36
+ disabled: boolean;
37
+ };
38
+ audio: {
39
+ disabled: boolean;
40
+ };
41
+ video: {
42
+ disabled: boolean;
43
+ };
44
+ image: {
45
+ disabled: boolean;
46
+ };
47
+ textAlign: {
48
+ disabled: boolean;
49
+ };
50
+ showParagraphs: {
51
+ disabled: boolean;
52
+ };
53
+ separateParagraphs: {
54
+ disabled: boolean;
55
+ };
56
+ };
57
+ spellCheck: {
58
+ label: string;
59
+ settings: boolean;
60
+ enabled: boolean;
61
+ };
62
+ feedback: {
63
+ settings: boolean;
64
+ label: string;
65
+ enabled: boolean;
66
+ };
67
+ lockChoiceOrder: {
68
+ settings: boolean;
69
+ label: string;
70
+ };
71
+ choicesPosition: {
72
+ settings: boolean;
73
+ label: string;
74
+ };
75
+ allowMultiplePlacements: {
76
+ settings: boolean;
77
+ label: string;
78
+ };
79
+ maxPlacements: {
80
+ settings: boolean;
81
+ label: string;
82
+ };
83
+ allowAlternate: {
84
+ settings: boolean;
85
+ label: string;
86
+ };
87
+ categoriesPerRow: {
88
+ settings: boolean;
89
+ label: string;
90
+ };
91
+ partialScoring: {
92
+ settings: boolean;
93
+ label: string;
94
+ };
95
+ prompt: {
96
+ settings: boolean;
97
+ label: string;
98
+ required: boolean;
99
+ inputConfiguration: {
100
+ audio: {
101
+ disabled: boolean;
102
+ };
103
+ video: {
104
+ disabled: boolean;
105
+ };
106
+ image: {
107
+ disabled: boolean;
108
+ };
109
+ };
110
+ };
111
+ rationale: {
112
+ settings: boolean;
113
+ label: string;
114
+ required: boolean;
115
+ inputConfiguration: {
116
+ audio: {
117
+ disabled: boolean;
118
+ };
119
+ video: {
120
+ disabled: boolean;
121
+ };
122
+ image: {
123
+ disabled: boolean;
124
+ };
125
+ };
126
+ };
127
+ scoringType: {
128
+ settings: boolean;
129
+ label: string;
130
+ };
131
+ settingsPanelDisabled: boolean;
132
+ studentInstructions: {
133
+ settings: boolean;
134
+ label: string;
135
+ };
136
+ teacherInstructions: {
137
+ settings: boolean;
138
+ label: string;
139
+ required: boolean;
140
+ inputConfiguration: {
141
+ audio: {
142
+ disabled: boolean;
143
+ };
144
+ video: {
145
+ disabled: boolean;
146
+ };
147
+ image: {
148
+ disabled: boolean;
149
+ };
150
+ };
151
+ };
152
+ headers: {
153
+ inputConfiguration: {
154
+ audio: {
155
+ disabled: boolean;
156
+ };
157
+ video: {
158
+ disabled: boolean;
159
+ };
160
+ image: {
161
+ disabled: boolean;
162
+ };
163
+ };
164
+ };
165
+ rowLabels: {
166
+ inputConfiguration: {
167
+ audio: {
168
+ disabled: boolean;
169
+ };
170
+ video: {
171
+ disabled: boolean;
172
+ };
173
+ image: {
174
+ disabled: boolean;
175
+ };
176
+ };
177
+ };
178
+ toolbarEditorPosition: {
179
+ settings: boolean;
180
+ label: string;
181
+ };
182
+ maxImageWidth: {
183
+ teacherInstructions: number;
184
+ prompt: number;
185
+ rationale: number;
186
+ rowLabel: number;
187
+ categoryLabel: number;
188
+ choices: number;
189
+ };
190
+ maxImageHeight: {
191
+ teacherInstructions: number;
192
+ prompt: number;
193
+ rationale: number;
194
+ rowLabel: number;
195
+ categoryLabel: number;
196
+ choices: number;
197
+ };
198
+ withRubric: {
199
+ settings: boolean;
200
+ label: string;
201
+ };
202
+ minCategoriesPerRow: number;
203
+ allowMaxAnswerChoices: {
204
+ settings: boolean;
205
+ label: string;
206
+ };
207
+ mathMlOptions: {
208
+ mmlOutput: boolean;
209
+ mmlEditing: boolean;
210
+ };
211
+ language: {
212
+ settings: boolean;
213
+ label: string;
214
+ enabled: boolean;
215
+ };
216
+ languageChoices: {
217
+ label: string;
218
+ options: never[];
219
+ };
220
+ };
221
+ };
222
+ export default _default;
@@ -0,0 +1,168 @@
1
+ //#region src/author/defaults.ts
2
+ var e = {
3
+ model: {
4
+ allowAlternateEnabled: !0,
5
+ allowMaxChoicesPerCategory: !1,
6
+ alternates: [],
7
+ categories: [],
8
+ categoriesPerRow: 2,
9
+ choices: [],
10
+ choicesLabel: "",
11
+ choicesPosition: "below",
12
+ correctResponse: [],
13
+ feedbackEnabled: !1,
14
+ lockChoiceOrder: !0,
15
+ maxAnswerChoices: 6,
16
+ maxChoicesPerCategory: 0,
17
+ partialScoring: !0,
18
+ promptEnabled: !0,
19
+ rationaleEnabled: !0,
20
+ rowLabels: [""],
21
+ studentInstructionsEnabled: !0,
22
+ teacherInstructionsEnabled: !0,
23
+ toolbarEditorPosition: "bottom",
24
+ minRowHeight: "80px"
25
+ },
26
+ configuration: {
27
+ baseInputConfiguration: {
28
+ h3: { disabled: !0 },
29
+ audio: { disabled: !1 },
30
+ video: { disabled: !1 },
31
+ image: { disabled: !1 },
32
+ textAlign: { disabled: !0 },
33
+ showParagraphs: { disabled: !1 },
34
+ separateParagraphs: { disabled: !0 }
35
+ },
36
+ spellCheck: {
37
+ label: "Spellcheck",
38
+ settings: !1,
39
+ enabled: !0
40
+ },
41
+ feedback: {
42
+ settings: !0,
43
+ label: "Feedback",
44
+ enabled: !0
45
+ },
46
+ lockChoiceOrder: {
47
+ settings: !0,
48
+ label: "Lock Choice Order"
49
+ },
50
+ choicesPosition: {
51
+ settings: !0,
52
+ label: "Choices Position"
53
+ },
54
+ allowMultiplePlacements: {
55
+ settings: !0,
56
+ label: "Allow Multiple Placements"
57
+ },
58
+ maxPlacements: {
59
+ settings: !0,
60
+ label: "Max choices per category"
61
+ },
62
+ allowAlternate: {
63
+ settings: !0,
64
+ label: "Allow Alternate Correct Answers"
65
+ },
66
+ categoriesPerRow: {
67
+ settings: !0,
68
+ label: "Categories per row"
69
+ },
70
+ partialScoring: {
71
+ settings: !1,
72
+ label: "Allow Partial Scoring"
73
+ },
74
+ prompt: {
75
+ settings: !0,
76
+ label: "Prompt",
77
+ required: !1,
78
+ inputConfiguration: {
79
+ audio: { disabled: !1 },
80
+ video: { disabled: !1 },
81
+ image: { disabled: !1 }
82
+ }
83
+ },
84
+ rationale: {
85
+ settings: !0,
86
+ label: "Rationale",
87
+ required: !1,
88
+ inputConfiguration: {
89
+ audio: { disabled: !1 },
90
+ video: { disabled: !1 },
91
+ image: { disabled: !1 }
92
+ }
93
+ },
94
+ scoringType: {
95
+ settings: !1,
96
+ label: "Scoring Type"
97
+ },
98
+ settingsPanelDisabled: !1,
99
+ studentInstructions: {
100
+ settings: !1,
101
+ label: "Student Instructions"
102
+ },
103
+ teacherInstructions: {
104
+ settings: !0,
105
+ label: "Teacher Instructions",
106
+ required: !1,
107
+ inputConfiguration: {
108
+ audio: { disabled: !1 },
109
+ video: { disabled: !1 },
110
+ image: { disabled: !1 }
111
+ }
112
+ },
113
+ headers: { inputConfiguration: {
114
+ audio: { disabled: !0 },
115
+ video: { disabled: !0 },
116
+ image: { disabled: !1 }
117
+ } },
118
+ rowLabels: { inputConfiguration: {
119
+ audio: { disabled: !1 },
120
+ video: { disabled: !1 },
121
+ image: { disabled: !1 }
122
+ } },
123
+ toolbarEditorPosition: {
124
+ settings: !1,
125
+ label: "Toolbar Editor Position"
126
+ },
127
+ maxImageWidth: {
128
+ teacherInstructions: 300,
129
+ prompt: 300,
130
+ rationale: 300,
131
+ rowLabel: 200,
132
+ categoryLabel: 260,
133
+ choices: 240
134
+ },
135
+ maxImageHeight: {
136
+ teacherInstructions: 300,
137
+ prompt: 300,
138
+ rationale: 300,
139
+ rowLabel: 100,
140
+ categoryLabel: 100,
141
+ choices: 150
142
+ },
143
+ withRubric: {
144
+ settings: !1,
145
+ label: "Add Rubric"
146
+ },
147
+ minCategoriesPerRow: 1,
148
+ allowMaxAnswerChoices: {
149
+ settings: !0,
150
+ label: "Max answer choices"
151
+ },
152
+ mathMlOptions: {
153
+ mmlOutput: !1,
154
+ mmlEditing: !1
155
+ },
156
+ language: {
157
+ settings: !1,
158
+ label: "Specify Language",
159
+ enabled: !1
160
+ },
161
+ languageChoices: {
162
+ label: "Language Choices",
163
+ options: []
164
+ }
165
+ }
166
+ };
167
+ //#endregion
168
+ export { e as default };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/categorize/configure/src/design/builder.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 buildCategories: (categories: any, choices: any, correctResponse: any) => any;
10
+ export declare const buildAlternateResponses: (categories: any, choices: any, correctResponse: any) => any[];
@@ -0,0 +1,24 @@
1
+ import { cloneDeep as e } from "@pie-element/shared-lodash";
2
+ //#region src/author/design/builder.ts
3
+ var t = (t, n, r) => e(t).map((e) => {
4
+ let t = r.find((t) => t.category === e.id);
5
+ return t && (e.choices = (t.choices || []).map((e) => {
6
+ let t = n.find((t) => t.id === e);
7
+ if (t) return Object.assign({}, {
8
+ id: t.id,
9
+ content: t.content
10
+ });
11
+ })), e;
12
+ }), n = (e, t, n) => !e.alternateResponses || e.alternateResponses.length === 0 ? [] : (e.alternateResponses[n] || []).map((e) => t.find((t) => t.id === e)), r = (e, t, r) => {
13
+ let i = r.reduce((e, t) => t.alternateResponses && t.alternateResponses.length >= e ? t.alternateResponses.length : e, 0);
14
+ return Array(i).fill(0).map((i, a) => r.map((r, i) => {
15
+ let o = e[i];
16
+ return {
17
+ id: o.id,
18
+ label: o.label,
19
+ choices: n(r, t, a)
20
+ };
21
+ }));
22
+ };
23
+ //#endregion
24
+ export { r as buildAlternateResponses, t as buildCategories };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/categorize/configure/src/design/buttons.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 RawAddButton extends React.Component {
12
+ static propTypes: {
13
+ label: PropTypes.Requireable<string>;
14
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
15
+ disabled: PropTypes.Requireable<boolean>;
16
+ };
17
+ static defaultProps: {
18
+ label: string;
19
+ };
20
+ render(): React.JSX.Element;
21
+ }
22
+ declare const AddButton: typeof RawAddButton;
23
+ declare const DeleteButton: ({ label, onClick, disabled }: {
24
+ label: any;
25
+ onClick: any;
26
+ disabled: any;
27
+ }) => React.JSX.Element;
28
+ export { AddButton, DeleteButton };
@@ -0,0 +1,36 @@
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 } from "react/jsx-runtime";
5
+ import i from "@mui/material/Button";
6
+ //#region src/author/design/buttons.tsx
7
+ var a = n(i)(({ theme: e }) => ({ height: e.spacing(4) })), o = class extends e.Component {
8
+ static propTypes = {
9
+ label: t.string,
10
+ onClick: t.func,
11
+ disabled: t.bool
12
+ };
13
+ static defaultProps = { label: "Add" };
14
+ render() {
15
+ let { label: e, onClick: t, disabled: n } = this.props;
16
+ return /* @__PURE__ */ r(a, {
17
+ onClick: t,
18
+ disabled: n,
19
+ size: "small",
20
+ variant: "contained",
21
+ color: "primary",
22
+ children: e
23
+ });
24
+ }
25
+ }, s = o, c = n(i)({
26
+ margin: 0,
27
+ padding: 0
28
+ }), l = ({ label: e, onClick: t, disabled: n }) => /* @__PURE__ */ r(c, {
29
+ onClick: t,
30
+ size: "small",
31
+ color: "primary",
32
+ disabled: n,
33
+ children: e
34
+ });
35
+ //#endregion
36
+ export { s as AddButton, l as DeleteButton, o as RawAddButton };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/categorize/configure/src/design/categories/RowLabel.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
+ export declare const RowLabel: ({ categoriesPerRow, configuration, disabled, markup, imageSupport, onChange, toolbarOpts, spellCheck, maxImageWidth, maxImageHeight, uploadSoundSupport, mathMlOptions, }: {
11
+ categoriesPerRow: any;
12
+ configuration: any;
13
+ disabled: any;
14
+ markup: any;
15
+ imageSupport: any;
16
+ onChange: any;
17
+ toolbarOpts: any;
18
+ spellCheck: any;
19
+ maxImageWidth: any;
20
+ maxImageHeight: any;
21
+ uploadSoundSupport: any;
22
+ mathMlOptions?: {} | undefined;
23
+ }) => React.JSX.Element;
@@ -0,0 +1,47 @@
1
+ import { getPluginProps as e } from "../utils.js";
2
+ import "react";
3
+ import * as t from "@pie-lib/render-ui";
4
+ import { InputContainer as n } from "@pie-lib/render-ui";
5
+ import { styled as r } from "@mui/material/styles";
6
+ import { jsx as i } from "react/jsx-runtime";
7
+ import a from "@pie-lib/editable-html-tip-tap";
8
+ //#region src/author/design/categories/RowLabel.tsx
9
+ function o(e) {
10
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
11
+ }
12
+ function s(e, t) {
13
+ return !e || o(e) ? e : o(e.default) ? e.default : t && o(e[t]) ? e[t] : t && o(e[t]?.default) ? e[t].default : e;
14
+ }
15
+ var c = s(n, "InputContainer") || s(d.InputContainer, "InputContainer"), l = t, u = l.default, d = u && typeof u == "object" ? u : l, f = r(c)(({ theme: e }) => ({
16
+ width: "100%",
17
+ paddingTop: e.spacing(1),
18
+ marginTop: e.spacing(1)
19
+ })), p = ({ categoriesPerRow: t, configuration: n, disabled: r, markup: o, imageSupport: s, onChange: c, toolbarOpts: l, spellCheck: u, maxImageWidth: d, maxImageHeight: p, uploadSoundSupport: m, mathMlOptions: h = {} }) => {
20
+ let { rowLabels: g, baseInputConfiguration: _ } = n;
21
+ return /* @__PURE__ */ i("div", {
22
+ style: {
23
+ gridColumn: `1/${t + 1}`,
24
+ width: "100%"
25
+ },
26
+ children: /* @__PURE__ */ i(f, {
27
+ label: "Row Label",
28
+ children: /* @__PURE__ */ i(a, {
29
+ disabled: r,
30
+ markup: o,
31
+ onChange: c,
32
+ imageSupport: s,
33
+ nonEmpty: !1,
34
+ toolbarOpts: l,
35
+ pluginProps: e(g?.inputConfiguration, _),
36
+ spellCheck: u,
37
+ maxImageWidth: d,
38
+ maxImageHeight: p,
39
+ uploadSoundSupport: m,
40
+ languageCharactersProps: [{ language: "spanish" }, { language: "special" }],
41
+ mathMlOptions: h
42
+ })
43
+ })
44
+ });
45
+ };
46
+ //#endregion
47
+ export { p as RowLabel };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/categorize/configure/src/design/categories/alternateResponses.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 AlternateResponses extends React.Component {
12
+ static propTypes: {
13
+ altIndex: PropTypes.Validator<number>;
14
+ configuration: PropTypes.Requireable<object>;
15
+ imageSupport: PropTypes.Requireable<PropTypes.InferProps<{
16
+ add: PropTypes.Validator<(...args: any[]) => any>;
17
+ delete: PropTypes.Validator<(...args: any[]) => any>;
18
+ }>>;
19
+ categories: PropTypes.Requireable<any[]>;
20
+ onModelChanged: PropTypes.Requireable<(...args: any[]) => any>;
21
+ model: PropTypes.Validator<object>;
22
+ uploadSoundSupport: PropTypes.Requireable<PropTypes.InferProps<{
23
+ add: PropTypes.Validator<(...args: any[]) => any>;
24
+ delete: PropTypes.Validator<(...args: any[]) => any>;
25
+ }>>;
26
+ spellCheck: PropTypes.Requireable<boolean>;
27
+ };
28
+ deleteChoiceFromCategory: any;
29
+ render(): React.JSX.Element;
30
+ }
31
+ export default AlternateResponses;
@@ -0,0 +1,62 @@
1
+ import { Category as e } from "./category.js";
2
+ import t from "react";
3
+ import n from "prop-types";
4
+ import { styled as r } from "@mui/material/styles";
5
+ import { removeChoiceFromAlternate as i } from "@pie-lib/categorize";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
+ //#region src/author/design/categories/alternateResponses.tsx
8
+ var s = r("div")(({ theme: e }) => ({ marginBottom: e.spacing(2.5) })), c = r("div")(({ theme: e }) => ({
9
+ display: "grid",
10
+ gridRowGap: e.spacing(1),
11
+ gridColumnGap: e.spacing(1)
12
+ })), l = r("div")({ gridColumn: "1 / 3" }), u = class extends t.Component {
13
+ static propTypes = {
14
+ altIndex: n.number.isRequired,
15
+ configuration: n.object,
16
+ imageSupport: n.shape({
17
+ add: n.func.isRequired,
18
+ delete: n.func.isRequired
19
+ }),
20
+ categories: n.array,
21
+ onModelChanged: n.func,
22
+ model: n.object.isRequired,
23
+ uploadSoundSupport: n.shape({
24
+ add: n.func.isRequired,
25
+ delete: n.func.isRequired
26
+ }),
27
+ spellCheck: n.bool
28
+ };
29
+ deleteChoiceFromCategory = (e, t, n) => {
30
+ let { model: r, altIndex: a, onModelChanged: o } = this.props;
31
+ o({ correctResponse: i(t.id, e.id, n, a, r.correctResponse) });
32
+ };
33
+ render() {
34
+ let { altIndex: n, model: r, configuration: i, categories: u, imageSupport: d, spellCheck: f, uploadSoundSupport: p, mathMlOptions: m = {} } = this.props, { categoriesPerRow: h, errors: g, rowLabels: _ } = r, { duplicateAlternate: v } = g || {}, y = { gridTemplateColumns: `repeat(${h}, 1fr)` }, b = v ? v.index === n : !1;
35
+ return /* @__PURE__ */ a(s, { children: /* @__PURE__ */ a(c, {
36
+ style: y,
37
+ children: u.map((r, s) => {
38
+ let c = s % h === 0, u = s / h;
39
+ return /* @__PURE__ */ o(t.Fragment, { children: [c && /* @__PURE__ */ a(l, {
40
+ style: {
41
+ gridColumn: `1/${h + 1}`,
42
+ width: "100%"
43
+ },
44
+ dangerouslySetInnerHTML: { __html: _[u] || "" }
45
+ }), /* @__PURE__ */ a(e, {
46
+ alternateResponseIndex: n,
47
+ imageSupport: d,
48
+ isDuplicated: b && v.category === r.id,
49
+ category: r,
50
+ spellCheck: f,
51
+ onDeleteChoice: (e, t) => this.deleteChoiceFromCategory(r, e, t),
52
+ uploadSoundSupport: p,
53
+ mathMlOptions: m,
54
+ configuration: i,
55
+ isAlternate: !0
56
+ }, s)] }, s);
57
+ })
58
+ }) });
59
+ }
60
+ };
61
+ //#endregion
62
+ export { u as AlternateResponses, u as default };