@pie-element/rubric 9.0.4-next.20261011174919 → 9.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.
@@ -3,59 +3,59 @@ declare const _default: {
3
3
  points: string[];
4
4
  sampleAnswers: null[];
5
5
  maxPoints: number;
6
- excludeZero: boolean;
7
- excludeZeroEnabled: boolean;
8
- maxPointsEnabled: boolean;
6
+ excludeZero: false;
7
+ excludeZeroEnabled: true;
8
+ maxPointsEnabled: true;
9
9
  };
10
10
  configuration: {
11
11
  baseInputConfiguration: {
12
12
  h3: {
13
- disabled: boolean;
13
+ disabled: true;
14
14
  };
15
15
  audio: {
16
- disabled: boolean;
16
+ disabled: false;
17
17
  };
18
18
  video: {
19
- disabled: boolean;
19
+ disabled: false;
20
20
  };
21
21
  image: {
22
- disabled: boolean;
22
+ disabled: false;
23
23
  };
24
24
  textAlign: {
25
- disabled: boolean;
25
+ disabled: true;
26
26
  };
27
27
  showParagraphs: {
28
- disabled: boolean;
28
+ disabled: false;
29
29
  };
30
30
  separateParagraphs: {
31
- disabled: boolean;
31
+ disabled: true;
32
32
  };
33
33
  };
34
34
  rubriclessInstruction: {
35
35
  inputConfiguration: {
36
36
  audio: {
37
- disabled: boolean;
37
+ disabled: false;
38
38
  };
39
39
  video: {
40
- disabled: boolean;
40
+ disabled: false;
41
41
  };
42
42
  image: {
43
- disabled: boolean;
43
+ disabled: false;
44
44
  };
45
45
  };
46
46
  };
47
47
  showExcludeZero: {
48
- settings: boolean;
48
+ settings: true;
49
49
  label: string;
50
50
  };
51
51
  showMaxPoint: {
52
- settings: boolean;
52
+ settings: true;
53
53
  label: string;
54
54
  };
55
- settingsPanelDisabled: boolean;
55
+ settingsPanelDisabled: false;
56
56
  mathMlOptions: {
57
- mmlOutput: boolean;
58
- mmlEditing: boolean;
57
+ mmlOutput: false;
58
+ mmlEditing: false;
59
59
  };
60
60
  maxMaxPoints: number;
61
61
  };
@@ -1,13 +1,21 @@
1
+ import { type DeleteDone, type ImageHandler } from '@pie-element/shared-configure-events';
2
+ import { type AuthorModel } from './main.js';
3
+ import type { RubricConfiguration, RubricModel } from '../types.js';
4
+ type ModelInput = Partial<RubricModel> & Pick<Partial<AuthorModel>, 'errors'>;
1
5
  export default class RubricElement extends HTMLElement {
6
+ private _root;
7
+ private _model;
8
+ private _configuration;
2
9
  constructor();
3
- updateModelAccordingToReceivedProps: any;
4
- set model(m: any);
5
- set configuration(c: any);
6
- onModelChanged(m: any): void;
7
- onConfigurationChanged: any;
8
- insertImage(handler: any): void;
9
- onDeleteImage(src: any, done: any): void;
10
+ updateModelAccordingToReceivedProps: (nextModel: AuthorModel) => AuthorModel;
11
+ set model(m: ModelInput);
12
+ set configuration(c: RubricConfiguration);
13
+ onModelChanged(m: AuthorModel): void;
14
+ onConfigurationChanged: (c: RubricConfiguration) => void;
15
+ insertImage(handler: ImageHandler): void;
16
+ onDeleteImage(src: string, done: DeleteDone): void;
10
17
  connectedCallback(): void;
11
18
  _render(): void;
12
19
  disconnectedCallback(): void;
13
20
  }
21
+ export {};
@@ -12,6 +12,9 @@ var c = (e) => ({
12
12
  ...t.configuration,
13
13
  ...e
14
14
  }), u = class extends HTMLElement {
15
+ _root;
16
+ _model;
17
+ _configuration;
15
18
  constructor() {
16
19
  super(), this._root = null, i.log("constructor called"), this._model = c(), this._configuration = l(), this.onModelChanged = this.onModelChanged.bind(this), this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
17
20
  }
@@ -1,6 +1,44 @@
1
1
  import React from 'react';
2
- declare class Main extends React.Component {
3
- verifyRubriclessModel: any;
2
+ import type { DeleteDone, ImageHandler } from '@pie-element/shared-configure-events';
3
+ import type { EditableHtmlPluginConfigure } from '@pie-element/shared-types';
4
+ import type { RubricValidationErrors } from '../controller/index.js';
5
+ import type { RubricConfiguration, RubricModel } from '../types.js';
6
+ /** The model the author edits: the defaults supply `maxPoints`; a host sets `errors` from the controller's `validate()`. */
7
+ export type AuthorModel = Partial<RubricModel> & {
8
+ maxPoints: number;
9
+ errors?: RubricValidationErrors;
10
+ };
11
+ /** The configuration the author renders: the defaults supply `rubriclessInstruction`. */
12
+ export type AuthorConfiguration = RubricConfiguration & {
13
+ rubriclessInstruction: EditableHtmlPluginConfigure;
14
+ };
15
+ export type MainProps = {
16
+ model: AuthorModel;
17
+ configuration: AuthorConfiguration;
18
+ onModelChanged: (model: AuthorModel) => void;
19
+ onConfigurationChanged: (configuration: RubricConfiguration) => void;
20
+ imageSupport?: {
21
+ add: (handler: ImageHandler) => void;
22
+ delete: (src: string, done: DeleteDone) => void;
23
+ };
24
+ };
25
+ declare class Main extends React.Component<MainProps> {
26
+ verifyRubriclessModel: (m: AuthorModel, config: RubricConfiguration) => {
27
+ maxPoints: number;
28
+ excludeZero?: boolean | undefined;
29
+ excludeZeros?: boolean | undefined;
30
+ excludeZeroEnabled?: boolean | undefined;
31
+ maxPointsEnabled?: boolean | undefined;
32
+ rubriclessInstructionEnabled?: boolean | undefined;
33
+ rubriclessInstruction?: string | undefined;
34
+ animationsDisabled?: boolean | undefined;
35
+ language?: string | undefined;
36
+ extraCSSRules?: import("@pie-element/shared-types").ExtraCSSRules | undefined;
37
+ id?: string | undefined;
38
+ element?: string | undefined;
39
+ accessibilityCatalogs?: import("@pie-element/shared-types").AccessibilityCatalog[] | undefined;
40
+ errors?: RubricValidationErrors;
41
+ };
4
42
  render(): React.JSX.Element;
5
43
  }
6
44
  export default Main;
@@ -28,9 +28,7 @@ var { Panel: o, toggle: s } = a, c = t("div")(({ theme: e, width: t }) => ({
28
28
  onChangeModel: l,
29
29
  configuration: t,
30
30
  onChangeConfiguration: a,
31
- pluginOpts: ((e) => Object.assign({ ...d }, e || {}))(v?.inputConfiguration),
32
- groups: { Properties: S },
33
- imageSupport: u
31
+ groups: { Properties: S }
34
32
  }),
35
33
  children: /* @__PURE__ */ n(c, {
36
34
  width: y,
@@ -39876,15 +39876,12 @@ var f$ = class extends j.Component {
39876
39876
  }), g$ = (e) => typeof e == "string" ? {
39877
39877
  label: e,
39878
39878
  value: e
39879
- } : e, _$ = function() {
39880
- let [e, t, n = !1] = Array.prototype.slice.call(arguments);
39881
- return {
39882
- type: "radio",
39883
- label: e,
39884
- choices: t && t.map((e) => g$(e)),
39885
- isConfigProperty: n
39886
- };
39887
- }, v$ = (e, t, n = !1) => ({
39879
+ } : e, _$ = (e, t, n = !1) => ({
39880
+ type: "radio",
39881
+ label: e,
39882
+ choices: t && t.map((e) => g$(e)),
39883
+ isConfigProperty: n
39884
+ }), v$ = (e, t, n = !1) => ({
39888
39885
  type: "dropdown",
39889
39886
  label: e,
39890
39887
  choices: t,
@@ -40190,6 +40187,8 @@ J$.propTypes = {
40190
40187
  value: j$,
40191
40188
  config: F.default.object,
40192
40189
  pluginOpts: F.default.object,
40190
+ mathMlOptions: F.default.object,
40191
+ imageSupport: F.default.object,
40193
40192
  rubricless: F.default.bool,
40194
40193
  getIndex: F.default.func,
40195
40194
  onChange: F.default.func
@@ -40220,9 +40219,7 @@ var { Panel: Y$, toggle: X$ } = p$, Z$ = D("div")(({ theme: e, width: t }) => ({
40220
40219
  onChangeModel: r,
40221
40220
  configuration: t,
40222
40221
  onChangeConfiguration: n,
40223
- pluginOpts: ((e) => Object.assign({ ...a }, e || {}))(f?.inputConfiguration),
40224
- groups: { Properties: g },
40225
- imageSupport: i
40222
+ groups: { Properties: g }
40226
40223
  }),
40227
40224
  children: /* @__PURE__ */ N(Z$, {
40228
40225
  width: p,
@@ -40294,6 +40291,9 @@ var { Panel: Y$, toggle: X$ } = p$, Z$ = D("div")(({ theme: e, width: t }) => ({
40294
40291
  ...$$.configuration,
40295
40292
  ...e
40296
40293
  }), n1 = class extends HTMLElement {
40294
+ _root;
40295
+ _model;
40296
+ _configuration;
40297
40297
  constructor() {
40298
40298
  super(), this._root = null, ip.log("constructor called"), this._model = e1(), this._configuration = t1(), this.onModelChanged = this.onModelChanged.bind(this), this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
40299
40299
  }