@pie-element/complex-rubric 7.1.1 → 7.1.2-next.1

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 (87) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/defaults.d.ts +231 -0
  4. package/dist/author/defaults.js +177 -0
  5. package/dist/author/index.d.ts +34 -0
  6. package/dist/author/index.js +87 -0
  7. package/dist/author/main.d.ts +23 -0
  8. package/dist/author/main.js +106 -0
  9. package/dist/browser/author/index.js +7384 -0
  10. package/dist/browser/author/index.js.map +1 -0
  11. package/dist/browser/controller/index.js +145 -0
  12. package/dist/browser/controller/index.js.map +1 -0
  13. package/dist/browser/delivery/index.js +96 -0
  14. package/dist/browser/delivery/index.js.map +1 -0
  15. package/dist/browser/dist-DJUOd5EZ.js +19 -0
  16. package/dist/browser/dist-DJUOd5EZ.js.map +1 -0
  17. package/dist/browser/print/index.js +84 -0
  18. package/dist/browser/print/index.js.map +1 -0
  19. package/dist/controller/defaults.d.ts +39 -0
  20. package/dist/controller/defaults.js +42 -0
  21. package/dist/controller/index.d.ts +25 -0
  22. package/dist/controller/index.js +107 -0
  23. package/dist/controller/utils.d.ts +9 -0
  24. package/dist/controller/utils.js +4 -0
  25. package/dist/delivery/index.d.ts +23 -0
  26. package/dist/delivery/index.js +96 -0
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.iife.d.ts +8 -0
  29. package/dist/index.iife.js +145 -0
  30. package/dist/index.js +2 -0
  31. package/dist/print/index.d.ts +24 -0
  32. package/dist/print/index.js +84 -0
  33. package/dist/runtime-support.d.ts +12 -0
  34. package/dist/runtime-support.js +12 -0
  35. package/package.json +90 -22
  36. package/CHANGELOG.md +0 -1443
  37. package/LICENSE.md +0 -5
  38. package/README.md +0 -3
  39. package/configure/CHANGELOG.md +0 -1097
  40. package/configure/lib/defaults.js +0 -271
  41. package/configure/lib/defaults.js.map +0 -1
  42. package/configure/lib/index.js +0 -150
  43. package/configure/lib/index.js.map +0 -1
  44. package/configure/lib/main.js +0 -172
  45. package/configure/lib/main.js.map +0 -1
  46. package/configure/package.json +0 -27
  47. package/configure/src/__tests__/index.test.js +0 -94
  48. package/configure/src/__tests__/main.test.jsx +0 -140
  49. package/configure/src/defaults.js +0 -213
  50. package/configure/src/index.js +0 -169
  51. package/configure/src/main.jsx +0 -162
  52. package/controller/CHANGELOG.md +0 -936
  53. package/controller/lib/defaults.js +0 -42
  54. package/controller/lib/defaults.js.map +0 -1
  55. package/controller/lib/index.js +0 -239
  56. package/controller/lib/index.js.map +0 -1
  57. package/controller/lib/utils.js +0 -11
  58. package/controller/lib/utils.js.map +0 -1
  59. package/controller/package.json +0 -16
  60. package/controller/src/__tests__/index.test.js +0 -55
  61. package/controller/src/defaults.js +0 -39
  62. package/controller/src/index.js +0 -220
  63. package/controller/src/utils.js +0 -3
  64. package/docs/config-schema.json +0 -4255
  65. package/docs/config-schema.json.md +0 -3162
  66. package/docs/demo/config.js +0 -8
  67. package/docs/demo/generate.js +0 -196
  68. package/docs/demo/index.html +0 -1
  69. package/docs/demo/session.js +0 -6
  70. package/docs/pie-schema.json +0 -3302
  71. package/docs/pie-schema.json.md +0 -2364
  72. package/lib/index.js +0 -141
  73. package/lib/index.js.map +0 -1
  74. package/lib/print.js +0 -129
  75. package/lib/print.js.map +0 -1
  76. package/module/configure.js +0 -1
  77. package/module/controller.js +0 -262
  78. package/module/demo.js +0 -221
  79. package/module/element.js +0 -1
  80. package/module/index.html +0 -21
  81. package/module/manifest.json +0 -22
  82. package/module/print-demo.js +0 -259
  83. package/module/print.html +0 -18
  84. package/module/print.js +0 -1
  85. package/src/__tests__/index.test.js +0 -256
  86. package/src/index.js +0 -152
  87. package/src/print.js +0 -140
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,231 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/complex-rubric/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
+ import { RUBRIC_TYPES } from '@pie-lib/rubric';
10
+ declare const _default: {
11
+ model: {
12
+ rubricType: string;
13
+ rubrics: {
14
+ [RUBRIC_TYPES.SIMPLE_RUBRIC]: {
15
+ points: string[];
16
+ sampleAnswers: null[];
17
+ maxPoints: number;
18
+ excludeZero: boolean;
19
+ };
20
+ [RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: {
21
+ description: boolean;
22
+ excludeZero: boolean;
23
+ halfScoring: boolean;
24
+ pointLabels: boolean;
25
+ scales: never[];
26
+ standards: boolean;
27
+ visibleToStudent: boolean;
28
+ };
29
+ [RUBRIC_TYPES.RUBRICLESS]: {
30
+ maxPoints: number;
31
+ excludeZero: boolean;
32
+ rubriclessInstructionEnabled: boolean;
33
+ };
34
+ };
35
+ };
36
+ configuration: {
37
+ [RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: {
38
+ baseInputConfiguration: {
39
+ h3: {
40
+ disabled: boolean;
41
+ };
42
+ audio: {
43
+ disabled: boolean;
44
+ };
45
+ video: {
46
+ disabled: boolean;
47
+ };
48
+ image: {
49
+ disabled: boolean;
50
+ };
51
+ textAlign: {
52
+ disabled: boolean;
53
+ };
54
+ showParagraphs: {
55
+ disabled: boolean;
56
+ };
57
+ };
58
+ expandedInput: {
59
+ inputConfiguration: {
60
+ math: {
61
+ disabled: boolean;
62
+ };
63
+ audio: {
64
+ disabled: boolean;
65
+ };
66
+ video: {
67
+ disabled: boolean;
68
+ };
69
+ image: {
70
+ disabled: boolean;
71
+ };
72
+ };
73
+ };
74
+ labelInput: {
75
+ inputConfiguration: {
76
+ math: {
77
+ disabled: boolean;
78
+ };
79
+ audio: {
80
+ disabled: boolean;
81
+ };
82
+ video: {
83
+ disabled: boolean;
84
+ };
85
+ image: {
86
+ disabled: boolean;
87
+ };
88
+ };
89
+ };
90
+ settingsPanelDisabled: boolean;
91
+ excludeZeroDialogBoxContent: {
92
+ title: string;
93
+ text: string;
94
+ };
95
+ includeZeroDialogBoxContent: {
96
+ title: string;
97
+ text: string;
98
+ };
99
+ deleteScaleDialogBoxContent: {
100
+ title: string;
101
+ text: string;
102
+ };
103
+ maxPointsDialogBoxContent: {
104
+ title: string;
105
+ text: string;
106
+ };
107
+ spellCheck: {
108
+ label: string;
109
+ settings: boolean;
110
+ enabled: boolean;
111
+ };
112
+ showExcludeZero: {
113
+ settings: boolean;
114
+ label: string;
115
+ };
116
+ showScorePointLabels: {
117
+ settings: boolean;
118
+ label: string;
119
+ };
120
+ showDescription: {
121
+ settings: boolean;
122
+ label: string;
123
+ };
124
+ showVisibleToStudent: {
125
+ settings: boolean;
126
+ label: string;
127
+ };
128
+ showHalfScoring: {
129
+ settings: boolean;
130
+ label: string;
131
+ };
132
+ showStandards: {
133
+ settings: boolean;
134
+ label: string;
135
+ };
136
+ showLevelTagInput: {
137
+ settings: boolean;
138
+ label: string;
139
+ enabled: boolean;
140
+ };
141
+ dragAndDrop: {
142
+ settings: boolean;
143
+ label: string;
144
+ enabled: boolean;
145
+ };
146
+ maxMaxPoints: number;
147
+ };
148
+ [RUBRIC_TYPES.SIMPLE_RUBRIC]: {
149
+ baseInputConfiguration: {
150
+ h3: {
151
+ disabled: boolean;
152
+ };
153
+ audio: {
154
+ disabled: boolean;
155
+ };
156
+ video: {
157
+ disabled: boolean;
158
+ };
159
+ image: {
160
+ disabled: boolean;
161
+ };
162
+ textAlign: {
163
+ disabled: boolean;
164
+ };
165
+ showParagraphs: {
166
+ disabled: boolean;
167
+ };
168
+ };
169
+ showExcludeZero: {
170
+ settings: boolean;
171
+ label: string;
172
+ };
173
+ showMaxPoint: {
174
+ settings: boolean;
175
+ label: string;
176
+ };
177
+ settingsPanelDisabled: boolean;
178
+ maxMaxPoints: number;
179
+ };
180
+ [RUBRIC_TYPES.RUBRICLESS]: {
181
+ baseInputConfiguration: {
182
+ h3: {
183
+ disabled: boolean;
184
+ };
185
+ audio: {
186
+ disabled: boolean;
187
+ };
188
+ video: {
189
+ disabled: boolean;
190
+ };
191
+ image: {
192
+ disabled: boolean;
193
+ };
194
+ textAlign: {
195
+ disabled: boolean;
196
+ };
197
+ showParagraphs: {
198
+ disabled: boolean;
199
+ };
200
+ };
201
+ showExcludeZero: {
202
+ settings: boolean;
203
+ label: string;
204
+ };
205
+ showMaxPoint: {
206
+ settings: boolean;
207
+ label: string;
208
+ };
209
+ settingsPanelDisabled: boolean;
210
+ rubricless: boolean;
211
+ rubriclessInstruction: {
212
+ settings: boolean;
213
+ label: string;
214
+ inputConfiguration: {
215
+ audio: {
216
+ disabled: boolean;
217
+ };
218
+ video: {
219
+ disabled: boolean;
220
+ };
221
+ image: {
222
+ disabled: boolean;
223
+ };
224
+ };
225
+ };
226
+ maxMaxPoints: number;
227
+ };
228
+ rubricOptions: string[];
229
+ };
230
+ };
231
+ export default _default;
@@ -0,0 +1,177 @@
1
+ import { RUBRIC_TYPES as e } from "@pie-lib/rubric";
2
+ //#region src/author/defaults.tsx
3
+ var t = {
4
+ description: !1,
5
+ excludeZero: !1,
6
+ halfScoring: !1,
7
+ pointLabels: !0,
8
+ scales: [],
9
+ standards: !1,
10
+ visibleToStudent: !0
11
+ }, n = {
12
+ points: [
13
+ "",
14
+ "",
15
+ "",
16
+ ""
17
+ ],
18
+ sampleAnswers: [
19
+ null,
20
+ null,
21
+ null,
22
+ null
23
+ ],
24
+ maxPoints: 3,
25
+ excludeZero: !1
26
+ }, r = {
27
+ maxPoints: 100,
28
+ excludeZero: !1,
29
+ rubriclessInstructionEnabled: !0
30
+ }, i = {
31
+ baseInputConfiguration: {
32
+ h3: { disabled: !0 },
33
+ audio: { disabled: !1 },
34
+ video: { disabled: !1 },
35
+ image: { disabled: !1 },
36
+ textAlign: { disabled: !0 },
37
+ showParagraphs: { disabled: !1 }
38
+ },
39
+ expandedInput: { inputConfiguration: {
40
+ math: { disabled: !0 },
41
+ audio: { disabled: !1 },
42
+ video: { disabled: !1 },
43
+ image: { disabled: !1 }
44
+ } },
45
+ labelInput: { inputConfiguration: {
46
+ math: { disabled: !0 },
47
+ audio: { disabled: !0 },
48
+ video: { disabled: !0 },
49
+ image: { disabled: !0 }
50
+ } },
51
+ settingsPanelDisabled: !1,
52
+ excludeZeroDialogBoxContent: {
53
+ title: "Exclude 0 (Zero) from Score Point Values.",
54
+ text: "<div>\n You are about to exclude 0 from score point values.\n <br/>\n Some of the existing data has to be changed.\n <br/>\n Please choose if you want to:\n <ul>\n <li>\n shift Labels and Descriptions to the left\n </li>\n <li>\n remove 0 column with its Label and Description\n </li>\n </ul>\n </div>"
55
+ },
56
+ includeZeroDialogBoxContent: {
57
+ title: "Include 0 (Zero) in Score Point Values.",
58
+ text: "<div>\n You are about to include 0 in score point values.\n <br/>\n Some of the existing data has to be changed.\n <br/>\n Please choose if you want to:\n <ul>\n <li>\n shift Labels and Descriptions to the right\n </li>\n <li>\n add 0 column with empty Label and Descriptions\n </li>\n </ul>\n </div>"
59
+ },
60
+ deleteScaleDialogBoxContent: {
61
+ title: "Delete Scale",
62
+ text: "Are you sure you want to delete this scale?"
63
+ },
64
+ maxPointsDialogBoxContent: {
65
+ title: "Decreasing Max Points.",
66
+ text: " You are about to decrease max score point value.\n <br/>\n All the Labels and Descriptions for scores above Max Point will be deleted."
67
+ },
68
+ spellCheck: {
69
+ label: "Spellcheck",
70
+ settings: !1,
71
+ enabled: !0
72
+ },
73
+ showExcludeZero: {
74
+ settings: !0,
75
+ label: "Exclude Zero"
76
+ },
77
+ showScorePointLabels: {
78
+ settings: !0,
79
+ label: "Show Score Point Labels"
80
+ },
81
+ showDescription: {
82
+ settings: !0,
83
+ label: "Show Description"
84
+ },
85
+ showVisibleToStudent: {
86
+ settings: !0,
87
+ label: "Visible to Student"
88
+ },
89
+ showHalfScoring: {
90
+ settings: !0,
91
+ label: "Half Scoring"
92
+ },
93
+ showStandards: {
94
+ settings: !1,
95
+ label: "Show Standards"
96
+ },
97
+ showLevelTagInput: {
98
+ settings: !1,
99
+ label: "Show Level Tag Input",
100
+ enabled: !1
101
+ },
102
+ dragAndDrop: {
103
+ settings: !0,
104
+ label: "Enable Drag and Drop",
105
+ enabled: !1
106
+ },
107
+ maxMaxPoints: 9
108
+ }, a = {
109
+ baseInputConfiguration: {
110
+ h3: { disabled: !0 },
111
+ audio: { disabled: !1 },
112
+ video: { disabled: !1 },
113
+ image: { disabled: !1 },
114
+ textAlign: { disabled: !0 },
115
+ showParagraphs: { disabled: !1 }
116
+ },
117
+ showExcludeZero: {
118
+ settings: !0,
119
+ label: "Ability to exclude zero"
120
+ },
121
+ showMaxPoint: {
122
+ settings: !0,
123
+ label: "Show max points dropdown"
124
+ },
125
+ settingsPanelDisabled: !1,
126
+ maxMaxPoints: 9
127
+ }, o = {
128
+ baseInputConfiguration: {
129
+ h3: { disabled: !0 },
130
+ audio: { disabled: !1 },
131
+ video: { disabled: !1 },
132
+ image: { disabled: !1 },
133
+ textAlign: { disabled: !0 },
134
+ showParagraphs: { disabled: !1 }
135
+ },
136
+ showExcludeZero: {
137
+ settings: !0,
138
+ label: "Ability to exclude zero"
139
+ },
140
+ showMaxPoint: {
141
+ settings: !0,
142
+ label: "Show max points dropdown"
143
+ },
144
+ settingsPanelDisabled: !1,
145
+ rubricless: !0,
146
+ rubriclessInstruction: {
147
+ settings: !0,
148
+ label: "Instruction",
149
+ inputConfiguration: {
150
+ audio: { disabled: !1 },
151
+ video: { disabled: !1 },
152
+ image: { disabled: !1 }
153
+ }
154
+ },
155
+ maxMaxPoints: 100
156
+ }, s = {
157
+ model: {
158
+ rubricType: "simpleRubric",
159
+ rubrics: {
160
+ [e.SIMPLE_RUBRIC]: n,
161
+ [e.MULTI_TRAIT_RUBRIC]: t,
162
+ [e.RUBRICLESS]: r
163
+ }
164
+ },
165
+ configuration: {
166
+ rubricOptions: [
167
+ "simpleRubric",
168
+ "multiTraitRubric",
169
+ "rubricless"
170
+ ],
171
+ [e.MULTI_TRAIT_RUBRIC]: i,
172
+ [e.SIMPLE_RUBRIC]: a,
173
+ [e.RUBRICLESS]: o
174
+ }
175
+ };
176
+ //#endregion
177
+ export { s as default };
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/complex-rubric/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 ComplexRubricConfigureElement extends HTMLElement {
10
+ static createDefaultModel: ({ rubrics: { simpleRubric, rubricless, multiTraitRubric }, ...model }?: {
11
+ rubrics?: {
12
+ simpleRubric?: {};
13
+ rubricless?: {};
14
+ multiTraitRubric?: {};
15
+ } | undefined;
16
+ }, currentModel?: {}) => {
17
+ rubrics: {
18
+ simpleRubric: any;
19
+ multiTraitRubric: any;
20
+ rubricless: any;
21
+ };
22
+ rubricType: string;
23
+ };
24
+ constructor();
25
+ set model(m: any);
26
+ dispatchModelUpdated(reset: any): void;
27
+ onModelChanged: any;
28
+ set configuration(c: any);
29
+ onConfigurationChanged(c: any): void;
30
+ onModelUpdated: any;
31
+ connectedCallback(): void;
32
+ _render(): void;
33
+ disconnectedCallback(): void;
34
+ }
@@ -0,0 +1,87 @@
1
+ import e from "./main.js";
2
+ import t from "./defaults.js";
3
+ import { ModelUpdatedEvent as n } from "@pie-element/shared-configure-events";
4
+ import r from "react";
5
+ import { createRoot as i } from "react-dom/client";
6
+ import a from "@pie-element/rubric/author";
7
+ import o from "@pie-element/multi-trait-rubric/author";
8
+ import s from "debug";
9
+ import { defaults as c } from "@pie-element/shared-lodash";
10
+ //#region src/author/index.ts
11
+ var l = n.TYPE, u = "rubric-configure", d = "multi-trait-rubric-configure", f = class extends a {}, p = class extends o {};
12
+ customElements.get(u) || customElements.define(u, f), customElements.get(d) || customElements.define(d, p);
13
+ var m = (e, n) => ({
14
+ configuration: c(e, t.configuration),
15
+ model: n
16
+ }), h = class a extends HTMLElement {
17
+ static createDefaultModel = ({ rubrics: { simpleRubric: e = {}, rubricless: n = {}, multiTraitRubric: r = {} } = {
18
+ simpleRubric: {},
19
+ rubricless: {},
20
+ multiTraitRubric: {}
21
+ }, ...i } = {}, a = {}) => ({
22
+ ...t?.model || {},
23
+ ...a,
24
+ ...i,
25
+ rubrics: {
26
+ simpleRubric: {
27
+ ...(t?.model?.rubrics || {}).simpleRubric,
28
+ ...(a.rubrics || {}).simpleRubric,
29
+ ...e
30
+ },
31
+ multiTraitRubric: {
32
+ ...(t?.model?.rubrics || {}).multiTraitRubric,
33
+ ...(a.rubrics || {}).multiTraitRubric,
34
+ ...r
35
+ },
36
+ rubricless: {
37
+ ...(t?.model?.rubrics || {}).rubricless,
38
+ ...(a.rubrics || {}).rubricless,
39
+ ...n
40
+ }
41
+ }
42
+ });
43
+ constructor() {
44
+ super(), this._root = null, this.canUpdateModel = !1, s.log("constructor called"), this._model = a.createDefaultModel(), this._configuration = t.configuration, this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
45
+ }
46
+ set model(e) {
47
+ this._model = a.createDefaultModel(e, this._model), this.canUpdateModel = !0, this._render();
48
+ }
49
+ dispatchModelUpdated(e) {
50
+ let t = !!e;
51
+ this.dispatchEvent(new n(this._model, t));
52
+ }
53
+ onModelChanged = (e, t) => {
54
+ this._model = a.createDefaultModel(e, this._model), this.dispatchModelUpdated(t), this._render();
55
+ };
56
+ set configuration(e) {
57
+ let t = m(e, this._model);
58
+ this._configuration = t.configuration, this._render();
59
+ }
60
+ onConfigurationChanged(e) {
61
+ this._configuration = m(e, this._model).configuration, this._model && this.onModelChanged(this._model), this._render();
62
+ }
63
+ onModelUpdated = (e) => {
64
+ if (e.target === this) return;
65
+ e.preventDefault(), e.stopImmediatePropagation();
66
+ let t = e.target && e.target.getAttribute("id");
67
+ t && (e.update && (this._model.rubrics[t] = e.update), this.dispatchEvent(new n(this._model)));
68
+ };
69
+ connectedCallback() {
70
+ this.addEventListener(l, this.onModelUpdated), this._render();
71
+ }
72
+ _render() {
73
+ let t = r.createElement(e, {
74
+ model: this._model,
75
+ configuration: this._configuration,
76
+ onModelChanged: this.onModelChanged,
77
+ onConfigurationChanged: this.onConfigurationChanged,
78
+ canUpdateModel: this.canUpdateModel
79
+ });
80
+ this._root ||= i(this), this._root.render(t);
81
+ }
82
+ disconnectedCallback() {
83
+ this.removeEventListener(l, this.onModelUpdated), this._root && this._root.unmount();
84
+ }
85
+ };
86
+ //#endregion
87
+ export { h as default };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/complex-rubric/configure/src/main.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 Main extends React.Component {
12
+ static propTypes: {
13
+ canUpdateModel: PropTypes.Requireable<boolean>;
14
+ configuration: PropTypes.Requireable<object>;
15
+ model: PropTypes.Requireable<object>;
16
+ onModelChanged: PropTypes.Requireable<(...args: any[]) => any>;
17
+ onConfigurationChanged: PropTypes.Requireable<(...args: any[]) => any>;
18
+ };
19
+ onModelChanged: any;
20
+ onChangeRubricType: any;
21
+ render(): React.JSX.Element;
22
+ }
23
+ export default Main;
@@ -0,0 +1,106 @@
1
+ import { RUBRIC_TYPES as e } from "@pie-lib/rubric";
2
+ import t from "react";
3
+ import n from "prop-types";
4
+ import { layout as r } from "@pie-lib/config-ui";
5
+ import i from "@mui/material/Radio";
6
+ import a from "@mui/material/RadioGroup";
7
+ import o from "@mui/material/FormControlLabel";
8
+ import { styled as s } from "@mui/material/styles";
9
+ import { color as c } from "@pie-lib/render-ui";
10
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
11
+ //#region src/author/main.tsx
12
+ var d = s(o)({ "&.MuiFormControlLabel-root": {
13
+ width: "fit-content",
14
+ paddingRight: "24px",
15
+ boxSizing: "border-box",
16
+ "&:hover": { background: "var(--pie-secondary-background, rgba(241,241,241,1))" }
17
+ } }), f = s(i)({ "&.MuiRadio-root": { color: `${c.tertiary()} !important` } }), p = {
18
+ [e.MULTI_TRAIT_RUBRIC]: "Multi Trait Rubric",
19
+ [e.SIMPLE_RUBRIC]: "Simple Rubric",
20
+ [e.RUBRICLESS]: "Rubricless"
21
+ }, m = class extends t.Component {
22
+ static propTypes = {
23
+ canUpdateModel: n.bool,
24
+ configuration: n.object,
25
+ model: n.object,
26
+ onModelChanged: n.func,
27
+ onConfigurationChanged: n.func
28
+ };
29
+ onModelChanged = (e) => {
30
+ let { onModelChanged: t } = this.props;
31
+ return t(e);
32
+ };
33
+ onChangeRubricType = (e) => {
34
+ let { model: t } = this.props, n = e.target.value;
35
+ this.onModelChanged({
36
+ ...t,
37
+ rubricType: n
38
+ });
39
+ };
40
+ render() {
41
+ let { model: t, configuration: n, canUpdateModel: i } = this.props, { extraCSSRules: o, rubrics: s = {} } = t || {}, { rubricType: c } = t, { contentDimensions: m = {}, rubricOptions: h = [], multiTraitRubric: g, simpleRubric: _, rubricless: v, width: y } = n, b = "";
42
+ c ||= e.SIMPLE_RUBRIC;
43
+ let x = h.indexOf(c) > -1;
44
+ if (i) switch (c) {
45
+ case e.SIMPLE_RUBRIC:
46
+ default:
47
+ b = /* @__PURE__ */ l("rubric-configure", {
48
+ id: "simpleRubric",
49
+ ref: (e) => {
50
+ e && (this.simpleRubric = e, this.simpleRubric.model = {
51
+ ...s.simpleRubric,
52
+ errors: t.errors || {}
53
+ }, this.simpleRubric.configuration = {
54
+ ..._,
55
+ width: y
56
+ });
57
+ }
58
+ }, "simple-rubric");
59
+ break;
60
+ case e.MULTI_TRAIT_RUBRIC:
61
+ b = /* @__PURE__ */ l("multi-trait-rubric-configure", {
62
+ id: "multiTraitRubric",
63
+ ref: (e) => {
64
+ e && (this.multiTraitRubric = e, this.multiTraitRubric.model = {
65
+ ...s.multiTraitRubric,
66
+ errors: t.errors || {}
67
+ }, this.multiTraitRubric.configuration = {
68
+ ...g,
69
+ width: y || g.width
70
+ });
71
+ }
72
+ }, "multi-trait-rubric");
73
+ break;
74
+ case e.RUBRICLESS:
75
+ b = /* @__PURE__ */ l("rubric-configure", {
76
+ id: "rubricless",
77
+ ref: (e) => {
78
+ e && (this.rubricless = e, this.rubricless.model = s.rubricless, this.rubricless.configuration = {
79
+ ...v,
80
+ width: y
81
+ });
82
+ }
83
+ }, "rubricless");
84
+ break;
85
+ }
86
+ return /* @__PURE__ */ u(r.ConfigLayout, {
87
+ extraCSSRules: o,
88
+ dimensions: m,
89
+ hideSettings: !0,
90
+ settings: null,
91
+ children: [/* @__PURE__ */ l(a, {
92
+ "aria-label": "rubric-type",
93
+ name: "rubricType",
94
+ value: t.rubricType,
95
+ onChange: this.onChangeRubricType,
96
+ children: h.length > 1 && h.map((e, t) => /* @__PURE__ */ l(d, {
97
+ value: e,
98
+ control: /* @__PURE__ */ l(f, { checked: c === e }),
99
+ label: p[e]
100
+ }, t))
101
+ }), x && b]
102
+ });
103
+ }
104
+ };
105
+ //#endregion
106
+ export { m as default };