@pie-element/match 13.0.4-next.20261011174919 → 13.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.
@@ -1,39 +1,53 @@
1
1
  import React from 'react';
2
- import PropTypes from 'prop-types';
3
- declare class Configure extends React.Component {
4
- static propTypes: {
5
- onModelChanged: PropTypes.Requireable<(...args: any[]) => any>;
6
- onConfigurationChanged: PropTypes.Requireable<(...args: any[]) => any>;
7
- model: PropTypes.Validator<object>;
8
- configuration: PropTypes.Validator<object>;
9
- imageSupport: PropTypes.Requireable<PropTypes.InferProps<{
10
- add: PropTypes.Validator<(...args: any[]) => any>;
11
- delete: PropTypes.Validator<(...args: any[]) => any>;
12
- }>>;
13
- uploadSoundSupport: PropTypes.Requireable<PropTypes.InferProps<{
14
- add: PropTypes.Validator<(...args: any[]) => any>;
15
- delete: PropTypes.Validator<(...args: any[]) => any>;
16
- }>>;
2
+ import type { DeleteDone, ImageHandler, SoundHandler } from '@pie-element/shared-configure-events';
3
+ import type { MatchValidationErrors } from '../controller/index.js';
4
+ import type { MatchConfiguration, MatchFeedback, MatchModel, MatchRow } from '../types.js';
5
+ /** The model the author edits; the host sets `errors` from the controller's `validate()`. */
6
+ export type AuthorModel = Partial<MatchModel> & {
7
+ headers: string[];
8
+ layout: number;
9
+ rows: MatchRow[];
10
+ errors?: MatchValidationErrors;
11
+ };
12
+ type MediaSupport<Handler> = {
13
+ add: (handler: Handler) => void;
14
+ delete: (src: string, done: DeleteDone) => void;
15
+ };
16
+ export type ConfigureProps = {
17
+ model: AuthorModel;
18
+ configuration: MatchConfiguration;
19
+ onModelChanged: (model: AuthorModel) => void;
20
+ onConfigurationChanged: (configuration: MatchConfiguration) => void;
21
+ imageSupport?: MediaSupport<ImageHandler>;
22
+ uploadSoundSupport?: MediaSupport<SoundHandler>;
23
+ };
24
+ type ConfigureState = {
25
+ activeTab: number;
26
+ dialog: {
27
+ open: boolean;
28
+ text?: string;
17
29
  };
18
- static defaultProps: {};
19
- constructor(props: any);
30
+ };
31
+ declare class Configure extends React.Component<ConfigureProps, ConfigureState> {
32
+ rowIdCounter: number;
33
+ constructor(props: ConfigureProps);
20
34
  componentDidMount(): void;
21
- validateRowsID(rows: any): {
22
- updatedRows: any;
35
+ validateRowsID(rows: MatchRow[] | undefined): {
36
+ updatedRows: MatchRow[];
23
37
  wasChanged: boolean;
24
38
  };
25
- onTabChange: any;
26
- onChangeTabIndex: any;
27
- onChange: any;
28
- onFeedbackChange: any;
29
- onDeleteRow: any;
30
- onAddRow: any;
31
- onLayoutChange: any;
32
- onResponseTypeChange: any;
33
- onPartialScoringChange: any;
34
- onPromptChanged: any;
35
- onTeacherInstructionsChanged: any;
36
- onRationaleChanged: any;
39
+ onTabChange: (_event: unknown, value: number) => void;
40
+ onChangeTabIndex: (index: number) => void;
41
+ onChange: (model: AuthorModel) => void;
42
+ onFeedbackChange: (feedback: MatchFeedback) => void;
43
+ onDeleteRow: (rowIndex: number) => void;
44
+ onAddRow: () => void;
45
+ onLayoutChange: (newLayout: number) => void;
46
+ onResponseTypeChange: (newChoiceMode: MatchModel["choiceMode"]) => void;
47
+ onPartialScoringChange: (partialScoring: boolean) => void;
48
+ onPromptChanged: (prompt: string) => void;
49
+ onTeacherInstructionsChanged: (teacherInstructions: string) => void;
50
+ onRationaleChanged: (rationale: string) => void;
37
51
  render(): React.JSX.Element;
38
52
  }
39
53
  export declare const Config: typeof Configure;
@@ -2,37 +2,22 @@ import { getPluginProps as e } from "./utils.js";
2
2
  import t from "./general-config-block.js";
3
3
  import n from "./answer-config-block.js";
4
4
  import r from "react";
5
- import i from "prop-types";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- import { styled as s } from "@mui/material/styles";
8
- import c from "debug";
9
- import { AlertDialog as l, FeedbackConfig as ee, InputContainer as u, layout as d, settings as f } from "@pie-lib/config-ui";
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 { AlertDialog as c, FeedbackConfig as l, InputContainer as u, layout as d, settings as f } from "@pie-lib/config-ui";
10
9
  import p from "@pie-lib/editable-html-tip-tap";
11
10
  //#region src/author/configure.tsx
12
- var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dropdown: _ } = f, v = s("div")(() => ({ "& .promptHolder": { width: "100%" } })), y = s("div")(({ theme: e }) => ({
11
+ var m = s("@pie-element:match:configure"), { Panel: ee, toggle: h, radio: te, dropdown: g } = f, _ = o("div")(() => ({ "& .promptHolder": { width: "100%" } })), v = o("div")(({ theme: e }) => ({
13
12
  width: "100%",
14
13
  paddingTop: e.spacing(2),
15
14
  marginBottom: e.spacing(2)
16
- })), b = s("div")(({ theme: e }) => ({
15
+ })), y = o("div")(({ theme: e }) => ({
17
16
  fontSize: e.typography.fontSize - 2,
18
17
  color: e.palette.error.main,
19
18
  paddingTop: e.spacing(1)
20
- })), x = class extends r.Component {
21
- static propTypes = {
22
- onModelChanged: i.func,
23
- onConfigurationChanged: i.func,
24
- model: i.object.isRequired,
25
- configuration: i.object.isRequired,
26
- imageSupport: i.shape({
27
- add: i.func.isRequired,
28
- delete: i.func.isRequired
29
- }),
30
- uploadSoundSupport: i.shape({
31
- add: i.func.isRequired,
32
- delete: i.func.isRequired
33
- })
34
- };
35
- static defaultProps = {};
19
+ })), b = class extends r.Component {
20
+ rowIdCounter;
36
21
  constructor(e) {
37
22
  super(e);
38
23
  let t = 0;
@@ -111,7 +96,8 @@ var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dro
111
96
  onResponseTypeChange = (e) => {
112
97
  let { model: t } = this.props, n = { ...t };
113
98
  e === "radio" && n.rows.forEach((e) => {
114
- e.values.reduce((e, t) => t === !0 ? e + 1 : e) > 1 && (e.values = Array(t.layout - 1).fill(!1));
99
+ let n = e.values.reduce((e, t) => t === !0 ? Number(e) + 1 : e);
100
+ Number(n) > 1 && (e.values = Array(t.layout - 1).fill(!1));
115
101
  }), n.choiceMode = e, this.onChange(n);
116
102
  };
117
103
  onPartialScoringChange = (e) => {
@@ -136,44 +122,44 @@ var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dro
136
122
  });
137
123
  };
138
124
  render() {
139
- let { model: r, imageSupport: i, onModelChanged: s, configuration: c, onConfigurationChanged: f, uploadSoundSupport: x } = this.props, { baseInputConfiguration: S = {}, contentDimensions: C = {}, feedback: w = {}, lockChoiceOrder: T = {}, maxImageWidth: E = {}, maxImageHeight: D = {}, partialScoring: O = {}, prompt: k = {}, rationale: A = {}, settingsPanelDisabled: j, scoringType: M = {}, spellCheck: N = {}, studentInstructions: P = {}, teacherInstructions: F = {}, withRubric: I = {}, language: L = {}, languageChoices: R = {} } = c || {}, { errors: z, extraCSSRules: B, feedbackEnabled: V, promptEnabled: H, rationaleEnabled: U, spellCheckEnabled: W, teacherInstructionsEnabled: G, toolbarEditorPosition: K } = r || {}, { prompt: q, rationale: J, teacherInstructions: Y } = z || {}, { dialog: X } = this.state, Z = { position: K === "top" ? "top" : "bottom" }, Q = E && E.prompt, $ = D && D.prompt, ne = {
125
+ let { model: r, imageSupport: o, onModelChanged: s, configuration: f, onConfigurationChanged: b, uploadSoundSupport: x } = this.props, { baseInputConfiguration: S = {}, contentDimensions: C = {}, feedback: w = {}, lockChoiceOrder: T = {}, maxImageWidth: E = {}, maxImageHeight: D = {}, partialScoring: O = {}, prompt: k = {}, rationale: A = {}, settingsPanelDisabled: j, scoringType: M = {}, spellCheck: N = {}, studentInstructions: P = {}, teacherInstructions: F = {}, withRubric: I = {}, language: L = {}, languageChoices: R = {} } = f || {}, { errors: z, extraCSSRules: B, feedbackEnabled: V, promptEnabled: H, rationaleEnabled: U, spellCheckEnabled: W, teacherInstructionsEnabled: G, toolbarEditorPosition: K } = r || {}, { prompt: q, rationale: J, teacherInstructions: Y } = z || {}, { dialog: X } = this.state, Z = { position: K === "top" ? "top" : "bottom" }, Q = E && E.prompt, $ = D && D.prompt, ne = {
140
126
  partialScoring: O.settings && h(O.label),
141
127
  lockChoiceOrder: T.settings && h(T.label),
142
128
  feedbackEnabled: w.settings && h(w.label),
143
129
  "language.enabled": L.settings && h(L.label, !0),
144
- language: L.settings && L.enabled && _(R.label, R.options)
130
+ language: L.settings && L.enabled && g(R.label, R.options)
145
131
  }, re = {
146
132
  teacherInstructionsEnabled: F.settings && h(F.label),
147
133
  studentInstructionsEnabled: P.settings && h(P.label),
148
134
  promptEnabled: k.settings && h(k.label),
149
135
  rationaleEnabled: A.settings && h(A.label),
150
136
  spellCheckEnabled: N.settings && h(N.label),
151
- scoringType: M.settings && g(M.label, ["auto", "rubric"]),
137
+ scoringType: M.settings && te(M.label, ["auto", "rubric"]),
152
138
  rubricEnabled: I?.settings && h(I?.label)
153
139
  };
154
- return te("[render] model", r), /* @__PURE__ */ a(v, { children: /* @__PURE__ */ o(d.ConfigLayout, {
140
+ return m("[render] model", r), /* @__PURE__ */ i(_, { children: /* @__PURE__ */ a(d.ConfigLayout, {
155
141
  extraCSSRules: B,
156
142
  dimensions: C,
157
143
  hideSettings: j,
158
- settings: /* @__PURE__ */ a(m, {
144
+ settings: /* @__PURE__ */ i(ee, {
159
145
  model: r,
160
- configuration: c,
146
+ configuration: f,
161
147
  onChangeModel: (e) => s(e),
162
- onChangeConfiguration: (e) => f(e),
148
+ onChangeConfiguration: (e) => b(e),
163
149
  groups: {
164
150
  Settings: ne,
165
151
  Properties: re
166
152
  }
167
153
  }),
168
154
  children: [
169
- G && /* @__PURE__ */ a(u, {
155
+ G && /* @__PURE__ */ i(u, {
170
156
  label: F.label,
171
157
  className: "promptHolder",
172
- children: /* @__PURE__ */ o(y, { children: [/* @__PURE__ */ a(p, {
158
+ children: /* @__PURE__ */ a(v, { children: [/* @__PURE__ */ i(p, {
173
159
  className: "prompt",
174
160
  markup: r.teacherInstructions || "",
175
161
  onChange: this.onTeacherInstructionsChanged,
176
- imageSupport: i,
162
+ imageSupport: o,
177
163
  error: Y,
178
164
  nonEmpty: !1,
179
165
  toolbarOpts: Z,
@@ -183,16 +169,16 @@ var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dro
183
169
  maxImageHeight: D && D.teacherInstructions || $,
184
170
  uploadSoundSupport: x,
185
171
  languageCharactersProps: [{ language: "spanish" }, { language: "special" }]
186
- }), Y && /* @__PURE__ */ a(b, { children: Y })] })
172
+ }), Y && /* @__PURE__ */ i(y, { children: Y })] })
187
173
  }),
188
- H && /* @__PURE__ */ a(u, {
174
+ H && /* @__PURE__ */ i(u, {
189
175
  label: k.label,
190
176
  className: "promptHolder",
191
- children: /* @__PURE__ */ o(y, { children: [/* @__PURE__ */ a(p, {
177
+ children: /* @__PURE__ */ a(v, { children: [/* @__PURE__ */ i(p, {
192
178
  className: "prompt",
193
179
  markup: r.prompt,
194
180
  onChange: this.onPromptChanged,
195
- imageSupport: i,
181
+ imageSupport: o,
196
182
  error: q,
197
183
  nonEmpty: !1,
198
184
  disableUnderline: !0,
@@ -203,18 +189,18 @@ var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dro
203
189
  maxImageHeight: D && D.prompt,
204
190
  uploadSoundSupport: x,
205
191
  languageCharactersProps: [{ language: "spanish" }, { language: "special" }]
206
- }), q && /* @__PURE__ */ a(b, { children: q })] })
192
+ }), q && /* @__PURE__ */ i(y, { children: q })] })
207
193
  }),
208
- /* @__PURE__ */ a(t, {
194
+ /* @__PURE__ */ i(t, {
209
195
  model: r,
210
- configuration: c,
196
+ configuration: f,
211
197
  onResponseTypeChange: this.onResponseTypeChange,
212
198
  onLayoutChange: this.onLayoutChange
213
199
  }),
214
- /* @__PURE__ */ a(n, {
200
+ /* @__PURE__ */ i(n, {
215
201
  model: r,
216
- configuration: c,
217
- imageSupport: i,
202
+ configuration: f,
203
+ imageSupport: o,
218
204
  onChange: this.onChange,
219
205
  onAddRow: this.onAddRow,
220
206
  onDeleteRow: this.onDeleteRow,
@@ -222,14 +208,14 @@ var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dro
222
208
  spellCheck: W,
223
209
  uploadSoundSupport: x
224
210
  }),
225
- U && /* @__PURE__ */ a(u, {
211
+ U && /* @__PURE__ */ i(u, {
226
212
  label: A.label,
227
213
  className: "promptHolder",
228
- children: /* @__PURE__ */ o(y, { children: [/* @__PURE__ */ a(p, {
214
+ children: /* @__PURE__ */ a(v, { children: [/* @__PURE__ */ i(p, {
229
215
  className: "prompt",
230
216
  markup: r.rationale || "",
231
217
  onChange: this.onRationaleChanged,
232
- imageSupport: i,
218
+ imageSupport: o,
233
219
  error: J,
234
220
  toolbarOpts: Z,
235
221
  pluginProps: e(A?.inputConfiguration, S),
@@ -238,14 +224,14 @@ var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dro
238
224
  maxImageHeight: D && D.rationale || $,
239
225
  uploadSoundSupport: x,
240
226
  languageCharactersProps: [{ language: "spanish" }, { language: "special" }]
241
- }), J && /* @__PURE__ */ a(b, { children: J })] })
227
+ }), J && /* @__PURE__ */ i(y, { children: J })] })
242
228
  }),
243
- V && /* @__PURE__ */ a(ee, {
229
+ V && /* @__PURE__ */ i(l, {
244
230
  feedback: r.feedback,
245
231
  onChange: this.onFeedbackChange,
246
232
  toolbarOpts: Z
247
233
  }),
248
- /* @__PURE__ */ a(l, {
234
+ /* @__PURE__ */ i(c, {
249
235
  open: X.open,
250
236
  title: "Warning",
251
237
  text: X.text,
@@ -256,4 +242,4 @@ var te = c("@pie-element:match:configure"), { Panel: m, toggle: h, radio: g, dro
256
242
  }
257
243
  };
258
244
  //#endregion
259
- export { x as default };
245
+ export { b as default };
@@ -1,159 +1,161 @@
1
+ import type { ConfigureLanguageOptionsProp } from '@pie-element/shared-types';
2
+ import type { MatchRow } from '../types.js';
1
3
  /** NOTE: teacherInstructions, studentInstructions, rationale & scoringType
2
4
  * functionalities are not defined yet - the value for those can belong to
3
5
  * model or to configuration
4
6
  */
5
7
  declare const _default: {
6
8
  model: {
7
- choiceMode: string;
8
- feedbackEnabled: boolean;
9
+ choiceMode: "radio";
10
+ feedbackEnabled: false;
9
11
  headers: string[];
10
12
  layout: number;
11
- lockChoiceOrder: boolean;
12
- partialScoring: boolean;
13
+ lockChoiceOrder: true;
14
+ partialScoring: false;
13
15
  prompt: string;
14
- promptEnabled: boolean;
16
+ promptEnabled: true;
15
17
  rationale: string;
16
- rationaleEnabled: boolean;
17
- rows: never[];
18
- scoringType: string;
19
- studentInstructionsEnabled: boolean;
18
+ rationaleEnabled: true;
19
+ rows: MatchRow[];
20
+ scoringType: "auto";
21
+ studentInstructionsEnabled: true;
20
22
  teacherInstructions: string;
21
- teacherInstructionsEnabled: boolean;
22
- toolbarEditorPosition: string;
23
+ teacherInstructionsEnabled: true;
24
+ toolbarEditorPosition: "bottom";
23
25
  };
24
26
  configuration: {
25
27
  baseInputConfiguration: {
26
28
  h3: {
27
- disabled: boolean;
29
+ disabled: true;
28
30
  };
29
31
  audio: {
30
- disabled: boolean;
32
+ disabled: false;
31
33
  };
32
34
  video: {
33
- disabled: boolean;
35
+ disabled: false;
34
36
  };
35
37
  image: {
36
- disabled: boolean;
38
+ disabled: false;
37
39
  };
38
40
  textAlign: {
39
- disabled: boolean;
41
+ disabled: true;
40
42
  };
41
43
  showParagraphs: {
42
- disabled: boolean;
44
+ disabled: false;
43
45
  };
44
46
  separateParagraphs: {
45
- disabled: boolean;
47
+ disabled: true;
46
48
  };
47
49
  };
48
50
  rows: {
49
51
  inputConfiguration: {
50
52
  audio: {
51
- disabled: boolean;
53
+ disabled: true;
52
54
  };
53
55
  video: {
54
- disabled: boolean;
56
+ disabled: true;
55
57
  };
56
58
  image: {
57
- disabled: boolean;
59
+ disabled: false;
58
60
  };
59
61
  };
60
62
  };
61
63
  feedback: {
62
- settings: boolean;
64
+ settings: true;
63
65
  label: string;
64
- enabled: boolean;
66
+ enabled: true;
65
67
  };
66
68
  headers: {
67
- settings: boolean;
69
+ settings: true;
68
70
  inputConfiguration: {
69
71
  audio: {
70
- disabled: boolean;
72
+ disabled: true;
71
73
  };
72
74
  video: {
73
- disabled: boolean;
75
+ disabled: true;
74
76
  };
75
77
  image: {
76
- disabled: boolean;
78
+ disabled: false;
77
79
  };
78
80
  };
79
81
  };
80
82
  layout: {
81
- settings: boolean;
83
+ settings: true;
82
84
  label: string;
83
85
  };
84
86
  lockChoiceOrder: {
85
- settings: boolean;
87
+ settings: false;
86
88
  label: string;
87
89
  };
88
90
  partialScoring: {
89
- settings: boolean;
91
+ settings: false;
90
92
  label: string;
91
93
  };
92
94
  choiceMode: {
93
- settings: boolean;
95
+ settings: true;
94
96
  label: string;
95
97
  };
96
98
  prompt: {
97
- settings: boolean;
99
+ settings: true;
98
100
  label: string;
99
101
  inputConfiguration: {
100
102
  audio: {
101
- disabled: boolean;
103
+ disabled: false;
102
104
  };
103
105
  video: {
104
- disabled: boolean;
106
+ disabled: false;
105
107
  };
106
108
  image: {
107
- disabled: boolean;
109
+ disabled: false;
108
110
  };
109
111
  };
110
- required: boolean;
112
+ required: false;
111
113
  };
112
114
  rationale: {
113
- settings: boolean;
115
+ settings: true;
114
116
  label: string;
115
117
  inputConfiguration: {
116
118
  audio: {
117
- disabled: boolean;
119
+ disabled: false;
118
120
  };
119
121
  video: {
120
- disabled: boolean;
122
+ disabled: false;
121
123
  };
122
124
  image: {
123
- disabled: boolean;
125
+ disabled: false;
124
126
  };
125
127
  };
126
- required: boolean;
128
+ required: false;
127
129
  };
128
- settingsPanelDisabled: boolean;
130
+ settingsPanelDisabled: false;
129
131
  spellCheck: {
130
132
  label: string;
131
- settings: boolean;
132
- enabled: boolean;
133
+ settings: false;
134
+ enabled: true;
133
135
  };
134
136
  scoringType: {
135
- settings: boolean;
137
+ settings: false;
136
138
  label: string;
137
139
  };
138
140
  studentInstructions: {
139
- settings: boolean;
141
+ settings: false;
140
142
  label: string;
141
143
  };
142
144
  teacherInstructions: {
143
- settings: boolean;
145
+ settings: true;
144
146
  label: string;
145
147
  inputConfiguration: {
146
148
  audio: {
147
- disabled: boolean;
149
+ disabled: false;
148
150
  };
149
151
  video: {
150
- disabled: boolean;
152
+ disabled: false;
151
153
  };
152
154
  image: {
153
- disabled: boolean;
155
+ disabled: false;
154
156
  };
155
157
  };
156
- required: boolean;
158
+ required: false;
157
159
  };
158
160
  maxImageWidth: {
159
161
  teacherInstructions: number;
@@ -168,7 +170,7 @@ declare const _default: {
168
170
  rowTitles: number;
169
171
  };
170
172
  withRubric: {
171
- settings: boolean;
173
+ settings: false;
172
174
  label: string;
173
175
  };
174
176
  minQuestions: number;
@@ -178,17 +180,17 @@ declare const _default: {
178
180
  maxLengthAnswers: number;
179
181
  maxLengthFirstColumnHeading: number;
180
182
  mathMlOptions: {
181
- mmlOutput: boolean;
182
- mmlEditing: boolean;
183
+ mmlOutput: false;
184
+ mmlEditing: false;
183
185
  };
184
186
  language: {
185
- settings: boolean;
187
+ settings: false;
186
188
  label: string;
187
- enabled: boolean;
189
+ enabled: false;
188
190
  };
189
191
  languageChoices: {
190
192
  label: string;
191
- options: never[];
193
+ options: ConfigureLanguageOptionsProp[];
192
194
  };
193
195
  };
194
196
  };
@@ -1,36 +1,27 @@
1
+ import { type AuthorModel } from './configure.js';
2
+ import { type DeleteDone, type ImageHandler, type SoundHandler } from '@pie-element/shared-configure-events';
3
+ import type { MatchConfiguration, MatchModel } from '../types.js';
1
4
  export default class MatchConfigure extends HTMLElement {
2
- static createDefaultModel: (model?: {}) => {
3
- choiceMode: string;
4
- feedbackEnabled: boolean;
5
- headers: string[];
6
- layout: number;
7
- lockChoiceOrder: boolean;
8
- partialScoring: boolean;
9
- prompt: string;
10
- promptEnabled: boolean;
11
- rationale: string;
12
- rationaleEnabled: boolean;
13
- rows: never[];
14
- scoringType: string;
15
- studentInstructionsEnabled: boolean;
16
- teacherInstructions: string;
17
- teacherInstructionsEnabled: boolean;
18
- toolbarEditorPosition: string;
19
- };
5
+ private _root;
6
+ private _model;
7
+ private _modelCopy?;
8
+ private _configuration;
9
+ hasPlayerAsParent?: boolean;
10
+ static createDefaultModel: (model?: Partial<MatchModel>) => AuthorModel;
20
11
  constructor();
21
- set model(m: any);
22
- resetModelAfterConfigurationIsSet: any;
23
- set configuration(c: any);
24
- onModelChanged(model: any): void;
25
- onConfigurationChanged(config: any): void;
12
+ set model(m: Partial<MatchModel>);
13
+ resetModelAfterConfigurationIsSet: () => void;
14
+ set configuration(c: MatchConfiguration);
15
+ onModelChanged(model: AuthorModel): void;
16
+ onConfigurationChanged(config: MatchConfiguration): void;
26
17
  /**
27
18
  *
28
19
  * @param {done, progress, file} handler
29
20
  */
30
- insertImage(handler: any): void;
31
- onDeleteImage(src: any, done: any): void;
32
- insertSound(handler: any): void;
33
- onDeleteSound(src: any, done: any): void;
21
+ insertImage(handler: ImageHandler): void;
22
+ onDeleteImage(src: string, done: DeleteDone): void;
23
+ insertSound(handler: SoundHandler): void;
24
+ onDeleteSound(src: string, done: DeleteDone): void;
34
25
  _render(): void;
35
26
  connectedCallback(): void;
36
27
  disconnectedCallback(): void;
@@ -7,6 +7,11 @@ import s from "debug";
7
7
  import { DeleteImageEvent as c, DeleteSoundEvent as l, InsertImageEvent as u, InsertSoundEvent as d, ModelUpdatedEvent as f } from "@pie-element/shared-configure-events";
8
8
  //#region src/author/index.ts
9
9
  var p = s("pie-elements:match:configure"), m = class s extends HTMLElement {
10
+ _root;
11
+ _model;
12
+ _modelCopy;
13
+ _configuration;
14
+ hasPlayerAsParent;
10
15
  static createDefaultModel = (e = {}) => ({
11
16
  ...t.model,
12
17
  ...e
@@ -26,10 +31,16 @@ var p = s("pie-elements:match:configure"), m = class s extends HTMLElement {
26
31
  ...t.configuration,
27
32
  ...e
28
33
  };
29
- this._configuration = n, this.resetModelAfterConfigurationIsSet(), n?.language?.enabled ? n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value) : n.language.settings && this._model.language ? (this._configuration.language.enabled = !0, (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) && (this._configuration.languageChoices.options = []), this._configuration.languageChoices.options.find((e) => e.value === this._model.language) || this._configuration.languageChoices.options.push({
30
- value: this._model.language,
31
- label: this._model.language
32
- })) : delete this._model.language, a(e?.rows?.inputConfiguration) && (o(this._configuration.rows, "inputConfiguration.image.disabled", !this._model?.enableImages), o(this._configuration.rows, "inputConfiguration.video.disabled", !0), o(this._configuration.rows, "inputConfiguration.audio.disabled", !0)), this._render();
34
+ if (this._configuration = n, this.resetModelAfterConfigurationIsSet(), n?.language?.enabled) n?.languageChoices?.options?.length && (this._model.language = n?.languageChoices.options[0].value);
35
+ else if (n.language.settings && this._model.language) {
36
+ n.language.enabled = !0, (!n.languageChoices.options || !n.languageChoices.options.length) && (n.languageChoices.options = []);
37
+ let e = this._model.language;
38
+ n.languageChoices.options.find((t) => t.value === e) || n.languageChoices.options.push({
39
+ value: e,
40
+ label: e
41
+ });
42
+ } else delete this._model.language;
43
+ a(e?.rows?.inputConfiguration) && (o(n.rows, "inputConfiguration.image.disabled", !this._model?.enableImages), o(n.rows, "inputConfiguration.video.disabled", !0), o(n.rows, "inputConfiguration.audio.disabled", !0)), this._render();
33
44
  }
34
45
  onModelChanged(e) {
35
46
  this._model = e, p("[onModelChanged]: ", this._model), this._render(), this.dispatchEvent(new f(this._model));
@@ -1,2 +1,33 @@
1
- export declare const getPluginProps: (props?: {}, baseInputConfiguration?: {}) => {};
2
- export declare const generateValidationMessage: (model: any, configuration: any) => string;
1
+ import type { EditableHtmlConfigureProp } from '@pie-element/shared-types';
2
+ import type { MatchConfiguration, MatchModel } from '../types.js';
3
+ export declare const getPluginProps: (props?: EditableHtmlConfigureProp, baseInputConfiguration?: EditableHtmlConfigureProp) => {
4
+ math?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
5
+ audio?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
6
+ video?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
7
+ image?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
8
+ customPlugins?: import("@pie-element/shared-types").CustomPlugin[];
9
+ blockquote?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
10
+ h3?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
11
+ characters?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
12
+ bold?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
13
+ html?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
14
+ italic?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
15
+ ol_list?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
16
+ redo?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
17
+ strikethrough?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
18
+ sub?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
19
+ sup?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
20
+ table?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
21
+ ul_list?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
22
+ underline?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
23
+ undo?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
24
+ textAlign?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
25
+ showParagraphs?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
26
+ separateParagraphs?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
27
+ pasteFormatting?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
28
+ superscript?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
29
+ subscript?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
30
+ languageCharacters?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
31
+ responseArea?: import("@pie-element/shared-types").EditableHtmlButtonConfigure;
32
+ };
33
+ export declare const generateValidationMessage: (model: Partial<MatchModel>, configuration: MatchConfiguration) => string;