@pie-element/categorize 14.0.4-next.20261011174919 → 14.0.4
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/defaults.d.ts +67 -65
- package/dist/author/index.d.ts +57 -30
- package/dist/author/index.js +14 -5
- package/dist/author/main.d.ts +20 -11
- package/dist/author/main.js +6 -16
- package/dist/author/utils.d.ts +7 -6
- package/dist/browser/author/index.js +20 -23
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js +14 -14
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/editor-runtime/author/index.js +20 -23
- package/dist/browser/editor-runtime/author/index.js.map +1 -1
- package/dist/browser/editor-runtime/controller/index.js +14 -14
- package/dist/browser/editor-runtime/controller/index.js.map +1 -1
- package/dist/controller/defaults.d.ts +14 -13
- package/dist/controller/index.d.ts +109 -33
- package/dist/controller/index.js +14 -14
- package/dist/controller/utils.d.ts +9 -8
- package/dist/index.d.ts +1 -0
- package/dist/schemas/configuration.schema.json +463 -0
- package/dist/schemas/model.schema.json +610 -0
- package/dist/schemas/session.schema.json +71 -0
- package/dist/types.d.ts +266 -0
- package/package.json +22 -18
|
@@ -1,174 +1,176 @@
|
|
|
1
|
+
import type { ConfigureLanguageOptionsProp } from '@pie-element/shared-types';
|
|
2
|
+
import type { Category, CategoryChoice, CategoryCorrectResponse } from '../types.js';
|
|
1
3
|
declare const _default: {
|
|
2
4
|
model: {
|
|
3
|
-
allowAlternateEnabled:
|
|
4
|
-
allowMaxChoicesPerCategory:
|
|
5
|
-
alternates:
|
|
6
|
-
categories:
|
|
5
|
+
allowAlternateEnabled: true;
|
|
6
|
+
allowMaxChoicesPerCategory: false;
|
|
7
|
+
alternates: unknown[];
|
|
8
|
+
categories: Category[];
|
|
7
9
|
categoriesPerRow: number;
|
|
8
|
-
choices:
|
|
10
|
+
choices: CategoryChoice[];
|
|
9
11
|
choicesLabel: string;
|
|
10
|
-
choicesPosition:
|
|
11
|
-
correctResponse:
|
|
12
|
-
feedbackEnabled:
|
|
13
|
-
lockChoiceOrder:
|
|
12
|
+
choicesPosition: "below";
|
|
13
|
+
correctResponse: CategoryCorrectResponse[];
|
|
14
|
+
feedbackEnabled: false;
|
|
15
|
+
lockChoiceOrder: true;
|
|
14
16
|
maxAnswerChoices: number;
|
|
15
17
|
maxChoicesPerCategory: number;
|
|
16
|
-
partialScoring:
|
|
17
|
-
promptEnabled:
|
|
18
|
-
rationaleEnabled:
|
|
18
|
+
partialScoring: true;
|
|
19
|
+
promptEnabled: true;
|
|
20
|
+
rationaleEnabled: true;
|
|
19
21
|
rowLabels: string[];
|
|
20
|
-
studentInstructionsEnabled:
|
|
21
|
-
teacherInstructionsEnabled:
|
|
22
|
-
toolbarEditorPosition:
|
|
22
|
+
studentInstructionsEnabled: true;
|
|
23
|
+
teacherInstructionsEnabled: true;
|
|
24
|
+
toolbarEditorPosition: "bottom";
|
|
23
25
|
minRowHeight: string;
|
|
24
26
|
};
|
|
25
27
|
configuration: {
|
|
26
28
|
baseInputConfiguration: {
|
|
27
29
|
h3: {
|
|
28
|
-
disabled:
|
|
30
|
+
disabled: true;
|
|
29
31
|
};
|
|
30
32
|
audio: {
|
|
31
|
-
disabled:
|
|
33
|
+
disabled: false;
|
|
32
34
|
};
|
|
33
35
|
video: {
|
|
34
|
-
disabled:
|
|
36
|
+
disabled: false;
|
|
35
37
|
};
|
|
36
38
|
image: {
|
|
37
|
-
disabled:
|
|
39
|
+
disabled: false;
|
|
38
40
|
};
|
|
39
41
|
textAlign: {
|
|
40
|
-
disabled:
|
|
42
|
+
disabled: true;
|
|
41
43
|
};
|
|
42
44
|
showParagraphs: {
|
|
43
|
-
disabled:
|
|
45
|
+
disabled: false;
|
|
44
46
|
};
|
|
45
47
|
separateParagraphs: {
|
|
46
|
-
disabled:
|
|
48
|
+
disabled: true;
|
|
47
49
|
};
|
|
48
50
|
};
|
|
49
51
|
spellCheck: {
|
|
50
52
|
label: string;
|
|
51
|
-
settings:
|
|
52
|
-
enabled:
|
|
53
|
+
settings: false;
|
|
54
|
+
enabled: true;
|
|
53
55
|
};
|
|
54
56
|
feedback: {
|
|
55
|
-
settings:
|
|
57
|
+
settings: true;
|
|
56
58
|
label: string;
|
|
57
|
-
enabled:
|
|
59
|
+
enabled: true;
|
|
58
60
|
};
|
|
59
61
|
lockChoiceOrder: {
|
|
60
|
-
settings:
|
|
62
|
+
settings: true;
|
|
61
63
|
label: string;
|
|
62
64
|
};
|
|
63
65
|
choicesPosition: {
|
|
64
|
-
settings:
|
|
66
|
+
settings: true;
|
|
65
67
|
label: string;
|
|
66
68
|
};
|
|
67
69
|
allowMultiplePlacements: {
|
|
68
|
-
settings:
|
|
70
|
+
settings: true;
|
|
69
71
|
label: string;
|
|
70
72
|
};
|
|
71
73
|
maxPlacements: {
|
|
72
|
-
settings:
|
|
74
|
+
settings: true;
|
|
73
75
|
label: string;
|
|
74
76
|
};
|
|
75
77
|
allowAlternate: {
|
|
76
|
-
settings:
|
|
78
|
+
settings: true;
|
|
77
79
|
label: string;
|
|
78
80
|
};
|
|
79
81
|
categoriesPerRow: {
|
|
80
|
-
settings:
|
|
82
|
+
settings: true;
|
|
81
83
|
label: string;
|
|
82
84
|
};
|
|
83
85
|
partialScoring: {
|
|
84
|
-
settings:
|
|
86
|
+
settings: false;
|
|
85
87
|
label: string;
|
|
86
88
|
};
|
|
87
89
|
prompt: {
|
|
88
|
-
settings:
|
|
90
|
+
settings: true;
|
|
89
91
|
label: string;
|
|
90
|
-
required:
|
|
92
|
+
required: false;
|
|
91
93
|
inputConfiguration: {
|
|
92
94
|
audio: {
|
|
93
|
-
disabled:
|
|
95
|
+
disabled: false;
|
|
94
96
|
};
|
|
95
97
|
video: {
|
|
96
|
-
disabled:
|
|
98
|
+
disabled: false;
|
|
97
99
|
};
|
|
98
100
|
image: {
|
|
99
|
-
disabled:
|
|
101
|
+
disabled: false;
|
|
100
102
|
};
|
|
101
103
|
};
|
|
102
104
|
};
|
|
103
105
|
rationale: {
|
|
104
|
-
settings:
|
|
106
|
+
settings: true;
|
|
105
107
|
label: string;
|
|
106
|
-
required:
|
|
108
|
+
required: false;
|
|
107
109
|
inputConfiguration: {
|
|
108
110
|
audio: {
|
|
109
|
-
disabled:
|
|
111
|
+
disabled: false;
|
|
110
112
|
};
|
|
111
113
|
video: {
|
|
112
|
-
disabled:
|
|
114
|
+
disabled: false;
|
|
113
115
|
};
|
|
114
116
|
image: {
|
|
115
|
-
disabled:
|
|
117
|
+
disabled: false;
|
|
116
118
|
};
|
|
117
119
|
};
|
|
118
120
|
};
|
|
119
121
|
scoringType: {
|
|
120
|
-
settings:
|
|
122
|
+
settings: false;
|
|
121
123
|
label: string;
|
|
122
124
|
};
|
|
123
|
-
settingsPanelDisabled:
|
|
125
|
+
settingsPanelDisabled: false;
|
|
124
126
|
studentInstructions: {
|
|
125
|
-
settings:
|
|
127
|
+
settings: false;
|
|
126
128
|
label: string;
|
|
127
129
|
};
|
|
128
130
|
teacherInstructions: {
|
|
129
|
-
settings:
|
|
131
|
+
settings: true;
|
|
130
132
|
label: string;
|
|
131
|
-
required:
|
|
133
|
+
required: false;
|
|
132
134
|
inputConfiguration: {
|
|
133
135
|
audio: {
|
|
134
|
-
disabled:
|
|
136
|
+
disabled: false;
|
|
135
137
|
};
|
|
136
138
|
video: {
|
|
137
|
-
disabled:
|
|
139
|
+
disabled: false;
|
|
138
140
|
};
|
|
139
141
|
image: {
|
|
140
|
-
disabled:
|
|
142
|
+
disabled: false;
|
|
141
143
|
};
|
|
142
144
|
};
|
|
143
145
|
};
|
|
144
146
|
headers: {
|
|
145
147
|
inputConfiguration: {
|
|
146
148
|
audio: {
|
|
147
|
-
disabled:
|
|
149
|
+
disabled: true;
|
|
148
150
|
};
|
|
149
151
|
video: {
|
|
150
|
-
disabled:
|
|
152
|
+
disabled: true;
|
|
151
153
|
};
|
|
152
154
|
image: {
|
|
153
|
-
disabled:
|
|
155
|
+
disabled: false;
|
|
154
156
|
};
|
|
155
157
|
};
|
|
156
158
|
};
|
|
157
159
|
rowLabels: {
|
|
158
160
|
inputConfiguration: {
|
|
159
161
|
audio: {
|
|
160
|
-
disabled:
|
|
162
|
+
disabled: false;
|
|
161
163
|
};
|
|
162
164
|
video: {
|
|
163
|
-
disabled:
|
|
165
|
+
disabled: false;
|
|
164
166
|
};
|
|
165
167
|
image: {
|
|
166
|
-
disabled:
|
|
168
|
+
disabled: false;
|
|
167
169
|
};
|
|
168
170
|
};
|
|
169
171
|
};
|
|
170
172
|
toolbarEditorPosition: {
|
|
171
|
-
settings:
|
|
173
|
+
settings: false;
|
|
172
174
|
label: string;
|
|
173
175
|
};
|
|
174
176
|
maxImageWidth: {
|
|
@@ -188,26 +190,26 @@ declare const _default: {
|
|
|
188
190
|
choices: number;
|
|
189
191
|
};
|
|
190
192
|
withRubric: {
|
|
191
|
-
settings:
|
|
193
|
+
settings: false;
|
|
192
194
|
label: string;
|
|
193
195
|
};
|
|
194
196
|
minCategoriesPerRow: number;
|
|
195
197
|
allowMaxAnswerChoices: {
|
|
196
|
-
settings:
|
|
198
|
+
settings: true;
|
|
197
199
|
label: string;
|
|
198
200
|
};
|
|
199
201
|
mathMlOptions: {
|
|
200
|
-
mmlOutput:
|
|
201
|
-
mmlEditing:
|
|
202
|
+
mmlOutput: false;
|
|
203
|
+
mmlEditing: false;
|
|
202
204
|
};
|
|
203
205
|
language: {
|
|
204
|
-
settings:
|
|
206
|
+
settings: false;
|
|
205
207
|
label: string;
|
|
206
|
-
enabled:
|
|
208
|
+
enabled: false;
|
|
207
209
|
};
|
|
208
210
|
languageChoices: {
|
|
209
211
|
label: string;
|
|
210
|
-
options:
|
|
212
|
+
options: ConfigureLanguageOptionsProp[];
|
|
211
213
|
};
|
|
212
214
|
};
|
|
213
215
|
};
|
package/dist/author/index.d.ts
CHANGED
|
@@ -1,42 +1,69 @@
|
|
|
1
|
+
import { type DeleteDone, type ImageHandler, type SoundHandler } from '@pie-element/shared-configure-events';
|
|
2
|
+
import { type AuthorModel } from './main.js';
|
|
3
|
+
import type { CategorizeConfiguration, CategorizeModel } from '../types.js';
|
|
1
4
|
export default class CategorizeConfigure extends HTMLElement {
|
|
2
|
-
|
|
5
|
+
private _root;
|
|
6
|
+
private _model;
|
|
7
|
+
private _configuration;
|
|
8
|
+
static createDefaultModel: (model?: Partial<CategorizeModel>) => AuthorModel;
|
|
9
|
+
static disableAlternateResponses: (m: Partial<CategorizeModel>) => {
|
|
10
|
+
correctResponse: {
|
|
11
|
+
category: string;
|
|
12
|
+
choices: string[];
|
|
13
|
+
}[];
|
|
3
14
|
allowAlternateEnabled: boolean;
|
|
4
|
-
allowMaxChoicesPerCategory
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
allowMaxChoicesPerCategory?: boolean | undefined;
|
|
16
|
+
allowMultiplePlacementsEnabled?: import("../types.js").MultiplePlacements | undefined;
|
|
17
|
+
alternates?: unknown[] | undefined;
|
|
18
|
+
choices?: import("../types.js").CategoryChoice[] | undefined;
|
|
19
|
+
categoriesPerRow?: number | undefined;
|
|
20
|
+
choicesPosition?: "above" | "below" | "left" | "right" | undefined;
|
|
21
|
+
choicesLabel?: string | undefined;
|
|
22
|
+
lockChoiceOrder?: boolean | undefined;
|
|
23
|
+
prompt?: string | undefined;
|
|
24
|
+
promptEnabled?: boolean | undefined;
|
|
25
|
+
categories?: import("../types.js").Category[] | undefined;
|
|
26
|
+
feedback?: import("../types.js").CategorizeFeedback | undefined;
|
|
27
|
+
maxChoicesPerCategory?: number | undefined;
|
|
28
|
+
rationale?: string | undefined;
|
|
29
|
+
partialScoring?: boolean | undefined;
|
|
30
|
+
feedbackEnabled?: boolean | undefined;
|
|
31
|
+
rationaleEnabled?: boolean | undefined;
|
|
32
|
+
spellCheckEnabled?: boolean | undefined;
|
|
33
|
+
studentInstructionsEnabled?: boolean | undefined;
|
|
34
|
+
teacherInstructions?: string | undefined;
|
|
35
|
+
teacherInstructionsEnabled?: boolean | undefined;
|
|
36
|
+
note?: string | undefined;
|
|
37
|
+
toolbarEditorPosition?: "bottom" | "top" | undefined;
|
|
38
|
+
rubricEnabled?: boolean | undefined;
|
|
39
|
+
scoringType?: "auto" | "rubric" | undefined;
|
|
40
|
+
language?: string | undefined;
|
|
41
|
+
maxAnswerChoices?: number | undefined;
|
|
42
|
+
rowLabels?: string[] | undefined;
|
|
43
|
+
minRowHeight?: string | undefined;
|
|
44
|
+
fontSizeFactor?: number | undefined;
|
|
45
|
+
autoplayAudioEnabled?: boolean | undefined;
|
|
46
|
+
completeAudioEnabled?: boolean | undefined;
|
|
47
|
+
customAudioButton?: import("@pie-element/shared-types").CustomAudioButton | undefined;
|
|
48
|
+
extraCSSRules?: import("@pie-element/shared-types").ExtraCSSRules | undefined;
|
|
49
|
+
id?: string | undefined;
|
|
50
|
+
element?: string | undefined;
|
|
51
|
+
accessibilityCatalogs?: import("@pie-element/shared-types").AccessibilityCatalog[] | undefined;
|
|
24
52
|
};
|
|
25
|
-
static disableAlternateResponses: (m: any) => any;
|
|
26
53
|
constructor();
|
|
27
|
-
set model(m:
|
|
28
|
-
set configuration(c:
|
|
29
|
-
onModelChanged(m:
|
|
30
|
-
onConfigurationChanged(c:
|
|
54
|
+
set model(m: Partial<CategorizeModel>);
|
|
55
|
+
set configuration(c: CategorizeConfiguration);
|
|
56
|
+
onModelChanged(m: AuthorModel): void;
|
|
57
|
+
onConfigurationChanged(c: CategorizeConfiguration): void;
|
|
31
58
|
connectedCallback(): void;
|
|
32
59
|
/**
|
|
33
60
|
*
|
|
34
61
|
* @param {done, progress, file} handler
|
|
35
62
|
*/
|
|
36
|
-
insertImage(handler:
|
|
37
|
-
onDeleteImage(src:
|
|
38
|
-
insertSound(handler:
|
|
39
|
-
onDeleteSound(src:
|
|
63
|
+
insertImage(handler: ImageHandler): void;
|
|
64
|
+
onDeleteImage(src: string, done: DeleteDone): void;
|
|
65
|
+
insertSound(handler: SoundHandler): void;
|
|
66
|
+
onDeleteSound(src: string, done: DeleteDone): void;
|
|
40
67
|
render(): void;
|
|
41
68
|
disconnectedCallback(): void;
|
|
42
69
|
}
|
package/dist/author/index.js
CHANGED
|
@@ -6,6 +6,9 @@ import { renderMath as i } from "@pie-element/shared-math-rendering-mathjax";
|
|
|
6
6
|
import { DeleteImageEvent as a, DeleteSoundEvent as o, InsertImageEvent as s, InsertSoundEvent as c, ModelUpdatedEvent as l } from "@pie-element/shared-configure-events";
|
|
7
7
|
//#region src/author/index.ts
|
|
8
8
|
var u = class u extends HTMLElement {
|
|
9
|
+
_root;
|
|
10
|
+
_model;
|
|
11
|
+
_configuration;
|
|
9
12
|
static createDefaultModel = (e = {}) => ({
|
|
10
13
|
...t.model,
|
|
11
14
|
...e
|
|
@@ -27,17 +30,23 @@ var u = class u extends HTMLElement {
|
|
|
27
30
|
super(), this._root = null, this._model = u.createDefaultModel(), this._configuration = t.configuration;
|
|
28
31
|
}
|
|
29
32
|
set model(e) {
|
|
30
|
-
this._model = u.createDefaultModel(e), e.choices && e.choices.length >= e.maxAnswerChoices && (this._model.maxAnswerChoices = e.choices.length, console.warn("Max Answer Choices can't be less than choices length!")), this.render();
|
|
33
|
+
this._model = u.createDefaultModel(e), e.choices && e.maxAnswerChoices !== void 0 && e.choices.length >= e.maxAnswerChoices && (this._model.maxAnswerChoices = e.choices.length, console.warn("Max Answer Choices can't be less than choices length!")), this.render();
|
|
31
34
|
}
|
|
32
35
|
set configuration(e) {
|
|
33
36
|
let n = {
|
|
34
37
|
...t.configuration,
|
|
35
38
|
...e
|
|
36
39
|
};
|
|
37
|
-
this._configuration = n, n?.language?.enabled
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
if (this._configuration = n, n?.language?.enabled) n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value);
|
|
41
|
+
else if (n.language.settings && this._model.language) {
|
|
42
|
+
n.language.enabled = !0, (!n.languageChoices.options || !n.languageChoices.options.length) && (n.languageChoices.options = []);
|
|
43
|
+
let e = this._model.language;
|
|
44
|
+
n.languageChoices.options.find((t) => t.value === e) || n.languageChoices.options.push({
|
|
45
|
+
value: e,
|
|
46
|
+
label: e
|
|
47
|
+
});
|
|
48
|
+
} else delete this._model.language;
|
|
49
|
+
this.render();
|
|
41
50
|
}
|
|
42
51
|
onModelChanged(e) {
|
|
43
52
|
this._model = e, this.render(), this.dispatchEvent(new l(this._model, !1));
|
package/dist/author/main.d.ts
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import type { DeleteDone, ImageHandler, SoundHandler } from '@pie-element/shared-configure-events';
|
|
3
|
+
import type { CategorizeValidationErrors } from '../controller/index.js';
|
|
4
|
+
import type { CategorizeConfiguration, CategorizeModel } from '../types.js';
|
|
5
|
+
/** The model the author edits; the host sets `errors` from the controller's `validate()`. */
|
|
6
|
+
export type AuthorModel = Partial<CategorizeModel> & {
|
|
7
|
+
errors?: CategorizeValidationErrors;
|
|
8
|
+
};
|
|
9
|
+
type MediaSupport<Handler> = {
|
|
10
|
+
add: (handler: Handler) => void;
|
|
11
|
+
delete: (src: string, done: DeleteDone) => void;
|
|
12
|
+
};
|
|
13
|
+
export type MainProps = {
|
|
14
|
+
model: AuthorModel;
|
|
15
|
+
configuration?: CategorizeConfiguration;
|
|
16
|
+
onModelChanged: (model: AuthorModel) => void;
|
|
17
|
+
onConfigurationChanged?: (configuration: CategorizeConfiguration) => void;
|
|
18
|
+
imageSupport?: MediaSupport<ImageHandler>;
|
|
19
|
+
uploadSoundSupport?: MediaSupport<SoundHandler>;
|
|
20
|
+
};
|
|
21
|
+
export declare class Main extends React.Component<MainProps> {
|
|
13
22
|
render(): React.JSX.Element;
|
|
14
23
|
}
|
|
15
24
|
export default Main;
|
package/dist/author/main.js
CHANGED
|
@@ -1,27 +1,17 @@
|
|
|
1
1
|
import { Design as e } from "./design/index.js";
|
|
2
2
|
import t from "react";
|
|
3
|
-
import n from "
|
|
4
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
4
|
//#region src/author/main.tsx
|
|
6
|
-
var i = class extends t.Component {
|
|
7
|
-
static propTypes = {
|
|
8
|
-
configuration: n.object,
|
|
9
|
-
onConfigurationChanged: n.func,
|
|
10
|
-
model: n.object.isRequired,
|
|
11
|
-
onModelChanged: n.func.isRequired,
|
|
12
|
-
imageSupport: n.object,
|
|
13
|
-
uploadSoundSupport: n.object
|
|
14
|
-
};
|
|
15
|
-
static defaultProps = {};
|
|
5
|
+
var r = e, i = class extends t.Component {
|
|
16
6
|
render() {
|
|
17
|
-
let { model:
|
|
18
|
-
return /* @__PURE__ */ r
|
|
7
|
+
let { model: e, onModelChanged: t, configuration: i, onConfigurationChanged: a, imageSupport: o, uploadSoundSupport: s } = this.props;
|
|
8
|
+
return /* @__PURE__ */ n(r, {
|
|
19
9
|
imageSupport: o,
|
|
20
10
|
uploadSoundSupport: s,
|
|
21
11
|
title: "Design",
|
|
22
|
-
model:
|
|
12
|
+
model: e,
|
|
23
13
|
configuration: i,
|
|
24
|
-
onChange:
|
|
14
|
+
onChange: t,
|
|
25
15
|
onConfigurationChanged: a
|
|
26
16
|
});
|
|
27
17
|
}
|
package/dist/author/utils.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import type { CategorizeConfiguration, CategorizeModel } from '../types.js';
|
|
2
|
+
export declare const generateValidationMessage: (config?: CategorizeConfiguration) => string;
|
|
2
3
|
export declare const multiplePlacements: {
|
|
3
|
-
enabled:
|
|
4
|
-
disabled:
|
|
5
|
-
perChoice:
|
|
4
|
+
readonly enabled: "Yes";
|
|
5
|
+
readonly disabled: "No";
|
|
6
|
+
readonly perChoice: "Set Per Choice";
|
|
6
7
|
};
|
|
7
|
-
export declare const maxLength: (array:
|
|
8
|
-
export declare const getMaxCategoryChoices: (model:
|
|
8
|
+
export declare const maxLength: (array: unknown[][] | undefined) => number;
|
|
9
|
+
export declare const getMaxCategoryChoices: (model: Partial<CategorizeModel> | undefined) => number;
|
|
@@ -34783,15 +34783,12 @@ var VU = class extends P.Component {
|
|
|
34783
34783
|
}), GU = (e) => typeof e == "string" ? {
|
|
34784
34784
|
label: e,
|
|
34785
34785
|
value: e
|
|
34786
|
-
} : e, KU =
|
|
34787
|
-
|
|
34788
|
-
|
|
34789
|
-
|
|
34790
|
-
|
|
34791
|
-
|
|
34792
|
-
isConfigProperty: n
|
|
34793
|
-
};
|
|
34794
|
-
}, qU = (e, t, n = !1) => ({
|
|
34786
|
+
} : e, KU = (e, t, n = !1) => ({
|
|
34787
|
+
type: "radio",
|
|
34788
|
+
label: e,
|
|
34789
|
+
choices: t && t.map((e) => GU(e)),
|
|
34790
|
+
isConfigProperty: n
|
|
34791
|
+
}), qU = (e, t, n = !1) => ({
|
|
34795
34792
|
type: "dropdown",
|
|
34796
34793
|
label: e,
|
|
34797
34794
|
choices: t,
|
|
@@ -36102,15 +36099,6 @@ var hG = Me.withUid(mG), gG = u("div")(({ theme: e }) => ({
|
|
|
36102
36099
|
});
|
|
36103
36100
|
}
|
|
36104
36101
|
}, RG = class extends P.Component {
|
|
36105
|
-
static propTypes = {
|
|
36106
|
-
configuration: L.default.object,
|
|
36107
|
-
onConfigurationChanged: L.default.func,
|
|
36108
|
-
model: L.default.object.isRequired,
|
|
36109
|
-
onModelChanged: L.default.func.isRequired,
|
|
36110
|
-
imageSupport: L.default.object,
|
|
36111
|
-
uploadSoundSupport: L.default.object
|
|
36112
|
-
};
|
|
36113
|
-
static defaultProps = {};
|
|
36114
36102
|
render() {
|
|
36115
36103
|
let { model: e, onModelChanged: t, configuration: n, onConfigurationChanged: r, imageSupport: i, uploadSoundSupport: a } = this.props;
|
|
36116
36104
|
return /* @__PURE__ */ F(LG, {
|
|
@@ -36288,6 +36276,9 @@ var hG = Me.withUid(mG), gG = u("div")(({ theme: e }) => ({
|
|
|
36288
36276
|
}
|
|
36289
36277
|
}
|
|
36290
36278
|
}, BG = class e extends HTMLElement {
|
|
36279
|
+
_root;
|
|
36280
|
+
_model;
|
|
36281
|
+
_configuration;
|
|
36291
36282
|
static createDefaultModel = (e = {}) => ({
|
|
36292
36283
|
...zG.model,
|
|
36293
36284
|
...e
|
|
@@ -36309,17 +36300,23 @@ var hG = Me.withUid(mG), gG = u("div")(({ theme: e }) => ({
|
|
|
36309
36300
|
super(), this._root = null, this._model = e.createDefaultModel(), this._configuration = zG.configuration;
|
|
36310
36301
|
}
|
|
36311
36302
|
set model(t) {
|
|
36312
|
-
this._model = e.createDefaultModel(t), t.choices && t.choices.length >= t.maxAnswerChoices && (this._model.maxAnswerChoices = t.choices.length, console.warn("Max Answer Choices can't be less than choices length!")), this.render();
|
|
36303
|
+
this._model = e.createDefaultModel(t), t.choices && t.maxAnswerChoices !== void 0 && t.choices.length >= t.maxAnswerChoices && (this._model.maxAnswerChoices = t.choices.length, console.warn("Max Answer Choices can't be less than choices length!")), this.render();
|
|
36313
36304
|
}
|
|
36314
36305
|
set configuration(e) {
|
|
36315
36306
|
let t = {
|
|
36316
36307
|
...zG.configuration,
|
|
36317
36308
|
...e
|
|
36318
36309
|
};
|
|
36319
|
-
this._configuration = t, t?.language?.enabled
|
|
36320
|
-
|
|
36321
|
-
|
|
36322
|
-
|
|
36310
|
+
if (this._configuration = t, t?.language?.enabled) t?.languageChoices?.options?.length && (this._model.language = t?.languageChoices.options[0].value);
|
|
36311
|
+
else if (t.language.settings && this._model.language) {
|
|
36312
|
+
t.language.enabled = !0, (!t.languageChoices.options || !t.languageChoices.options.length) && (t.languageChoices.options = []);
|
|
36313
|
+
let e = this._model.language;
|
|
36314
|
+
t.languageChoices.options.find((t) => t.value === e) || t.languageChoices.options.push({
|
|
36315
|
+
value: e,
|
|
36316
|
+
label: e
|
|
36317
|
+
});
|
|
36318
|
+
} else delete this._model.language;
|
|
36319
|
+
this.render();
|
|
36323
36320
|
}
|
|
36324
36321
|
onModelChanged(e) {
|
|
36325
36322
|
this._model = e, this.render(), this.dispatchEvent(new iW(this._model, !1));
|