@pie-element/complex-rubric 7.1.0-next.28 → 7.1.1-next.0

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 (118) hide show
  1. package/dist/author/defaults.d.ts +231 -0
  2. package/dist/author/defaults.js +177 -0
  3. package/dist/author/index.d.ts +34 -0
  4. package/dist/author/index.js +87 -0
  5. package/dist/author/main.d.ts +23 -0
  6. package/dist/author/main.js +106 -0
  7. package/dist/controller/defaults.d.ts +39 -0
  8. package/dist/controller/defaults.js +42 -0
  9. package/dist/controller/index.d.ts +25 -0
  10. package/dist/controller/index.js +107 -0
  11. package/dist/controller/utils.d.ts +9 -0
  12. package/dist/controller/utils.js +4 -0
  13. package/dist/delivery/index.d.ts +23 -0
  14. package/dist/delivery/index.js +96 -0
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.iife.d.ts +8 -0
  17. package/dist/index.iife.js +145 -0
  18. package/dist/index.js +2 -0
  19. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
  20. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +12 -0
  21. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  22. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
  23. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +9 -0
  24. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +11 -0
  25. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  26. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +13 -0
  27. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +9 -0
  28. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +14 -0
  29. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +7 -0
  30. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +8 -0
  31. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +5 -0
  32. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +10 -0
  33. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
  34. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +9 -0
  35. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
  36. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +6 -0
  37. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +8 -0
  38. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +12 -0
  39. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +11 -0
  40. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +8 -0
  41. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  42. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +9 -0
  43. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
  44. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +13 -0
  45. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
  46. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +6 -0
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +14 -0
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +15 -0
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +8 -0
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +16 -0
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +6 -0
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +6 -0
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +10 -0
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +4 -0
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +8 -0
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +6 -0
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +11 -0
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +7 -0
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +7 -0
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +9 -0
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +6 -0
  64. package/dist/print/index.d.ts +24 -0
  65. package/dist/print/index.js +84 -0
  66. package/package.json +58 -21
  67. package/CHANGELOG.md +0 -1431
  68. package/LICENSE.md +0 -5
  69. package/README.md +0 -3
  70. package/configure/CHANGELOG.md +0 -1085
  71. package/configure/lib/defaults.js +0 -271
  72. package/configure/lib/defaults.js.map +0 -1
  73. package/configure/lib/index.js +0 -150
  74. package/configure/lib/index.js.map +0 -1
  75. package/configure/lib/main.js +0 -172
  76. package/configure/lib/main.js.map +0 -1
  77. package/configure/package.json +0 -27
  78. package/configure/src/__tests__/index.test.js +0 -94
  79. package/configure/src/__tests__/main.test.jsx +0 -140
  80. package/configure/src/defaults.js +0 -213
  81. package/configure/src/index.js +0 -169
  82. package/configure/src/main.jsx +0 -162
  83. package/controller/CHANGELOG.md +0 -928
  84. package/controller/lib/defaults.js +0 -42
  85. package/controller/lib/defaults.js.map +0 -1
  86. package/controller/lib/index.js +0 -239
  87. package/controller/lib/index.js.map +0 -1
  88. package/controller/lib/utils.js +0 -11
  89. package/controller/lib/utils.js.map +0 -1
  90. package/controller/package.json +0 -16
  91. package/controller/src/__tests__/index.test.js +0 -55
  92. package/controller/src/defaults.js +0 -39
  93. package/controller/src/index.js +0 -220
  94. package/controller/src/utils.js +0 -3
  95. package/docs/config-schema.json +0 -4255
  96. package/docs/config-schema.json.md +0 -3162
  97. package/docs/demo/config.js +0 -8
  98. package/docs/demo/generate.js +0 -196
  99. package/docs/demo/index.html +0 -1
  100. package/docs/demo/session.js +0 -6
  101. package/docs/pie-schema.json +0 -3302
  102. package/docs/pie-schema.json.md +0 -2364
  103. package/lib/index.js +0 -141
  104. package/lib/index.js.map +0 -1
  105. package/lib/print.js +0 -129
  106. package/lib/print.js.map +0 -1
  107. package/module/configure.js +0 -1
  108. package/module/controller.js +0 -262
  109. package/module/demo.js +0 -221
  110. package/module/element.js +0 -1
  111. package/module/index.html +0 -21
  112. package/module/manifest.json +0 -22
  113. package/module/print-demo.js +0 -259
  114. package/module/print.html +0 -18
  115. package/module/print.js +0 -1
  116. package/src/__tests__/index.test.js +0 -256
  117. package/src/index.js +0 -152
  118. package/src/print.js +0 -140
@@ -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 "../node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js";
2
+ import t from "./main.js";
3
+ import n from "./defaults.js";
4
+ import { ModelUpdatedEvent as r } from "@pie-element/shared-configure-events";
5
+ import i from "react";
6
+ import { createRoot as a } from "react-dom/client";
7
+ import o from "@pie-element/rubric/author";
8
+ import s from "@pie-element/multi-trait-rubric/author";
9
+ import c from "debug";
10
+ //#region src/author/index.ts
11
+ var l = r.TYPE, u = "rubric-configure", d = "multi-trait-rubric-configure", f = class extends o {}, p = class extends s {};
12
+ customElements.get(u) || customElements.define(u, f), customElements.get(d) || customElements.define(d, p);
13
+ var m = (t, r) => ({
14
+ configuration: e(t, n.configuration),
15
+ model: r
16
+ }), h = class e extends HTMLElement {
17
+ static createDefaultModel = ({ rubrics: { simpleRubric: e = {}, rubricless: t = {}, multiTraitRubric: r = {} } = {
18
+ simpleRubric: {},
19
+ rubricless: {},
20
+ multiTraitRubric: {}
21
+ }, ...i } = {}, a = {}) => ({
22
+ ...n?.model || {},
23
+ ...a,
24
+ ...i,
25
+ rubrics: {
26
+ simpleRubric: {
27
+ ...(n?.model?.rubrics || {}).simpleRubric,
28
+ ...(a.rubrics || {}).simpleRubric,
29
+ ...e
30
+ },
31
+ multiTraitRubric: {
32
+ ...(n?.model?.rubrics || {}).multiTraitRubric,
33
+ ...(a.rubrics || {}).multiTraitRubric,
34
+ ...r
35
+ },
36
+ rubricless: {
37
+ ...(n?.model?.rubrics || {}).rubricless,
38
+ ...(a.rubrics || {}).rubricless,
39
+ ...t
40
+ }
41
+ }
42
+ });
43
+ constructor() {
44
+ super(), this._root = null, this.canUpdateModel = !1, c.log("constructor called"), this._model = e.createDefaultModel(), this._configuration = n.configuration, this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
45
+ }
46
+ set model(t) {
47
+ this._model = e.createDefaultModel(t, this._model), this.canUpdateModel = !0, this._render();
48
+ }
49
+ dispatchModelUpdated(e) {
50
+ let t = !!e;
51
+ this.dispatchEvent(new r(this._model, t));
52
+ }
53
+ onModelChanged = (t, n) => {
54
+ this._model = e.createDefaultModel(t, this._model), this.dispatchModelUpdated(n), 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 r(this._model)));
68
+ };
69
+ connectedCallback() {
70
+ this.addEventListener(l, this.onModelUpdated), this._render();
71
+ }
72
+ _render() {
73
+ let e = i.createElement(t, {
74
+ model: this._model,
75
+ configuration: this._configuration,
76
+ onModelChanged: this.onModelChanged,
77
+ onConfigurationChanged: this.onConfigurationChanged,
78
+ canUpdateModel: this.canUpdateModel
79
+ });
80
+ this._root ||= a(this), this._root.render(e);
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 };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/complex-rubric/controller/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 RUBRIC_TYPES: {
10
+ SIMPLE_RUBRIC: string;
11
+ MULTI_TRAIT_RUBRIC: string;
12
+ rubricless: string;
13
+ };
14
+ declare const _default: {
15
+ rubricType: string;
16
+ rubrics: {
17
+ [RUBRIC_TYPES.SIMPLE_RUBRIC]: {
18
+ points: string[];
19
+ sampleAnswers: null[];
20
+ maxPoints: number;
21
+ excludeZero: boolean;
22
+ };
23
+ [RUBRIC_TYPES.MULTI_TRAIT_RUBRIC]: {
24
+ description: boolean;
25
+ excludeZero: boolean;
26
+ halfScoring: boolean;
27
+ pointLabels: boolean;
28
+ scales: never[];
29
+ standards: boolean;
30
+ visibleToStudent: boolean;
31
+ };
32
+ [RUBRIC_TYPES.RUBRICLESS]: {
33
+ maxPoints: number;
34
+ excludeZero: boolean;
35
+ rubriclessInstructionEnabled: boolean;
36
+ };
37
+ };
38
+ };
39
+ export default _default;