@pie-element/multi-trait-rubric 8.1.1 → 8.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 (100) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/common.d.ts +90 -0
  4. package/dist/author/common.js +275 -0
  5. package/dist/author/defaults.d.ts +153 -0
  6. package/dist/author/defaults.js +113 -0
  7. package/dist/author/index.d.ts +22 -0
  8. package/dist/author/index.js +89 -0
  9. package/dist/author/main.d.ts +43 -0
  10. package/dist/author/main.js +247 -0
  11. package/dist/author/modals.d.ts +94 -0
  12. package/dist/author/modals.js +171 -0
  13. package/dist/author/scale.d.ts +46 -0
  14. package/dist/author/scale.js +280 -0
  15. package/dist/author/trait.d.ts +70 -0
  16. package/dist/author/trait.js +202 -0
  17. package/dist/author/traitsHeader.d.ts +28 -0
  18. package/dist/author/traitsHeader.js +172 -0
  19. package/dist/author/utils.d.ts +10 -0
  20. package/dist/author/utils.js +41 -0
  21. package/dist/browser/Typography-CdgSBeUZ.js +8993 -0
  22. package/dist/browser/Typography-CdgSBeUZ.js.map +1 -0
  23. package/dist/browser/author/index.js +41731 -0
  24. package/dist/browser/author/index.js.map +1 -0
  25. package/dist/browser/controller/index.js +70 -0
  26. package/dist/browser/controller/index.js.map +1 -0
  27. package/dist/browser/delivery/index.js +523 -0
  28. package/dist/browser/delivery/index.js.map +1 -0
  29. package/dist/browser/multi-trait-rubric.css +2 -0
  30. package/dist/controller/defaults.d.ts +20 -0
  31. package/dist/controller/defaults.js +14 -0
  32. package/dist/controller/index.d.ts +26 -0
  33. package/dist/controller/index.js +57 -0
  34. package/dist/controller/utils.d.ts +9 -0
  35. package/dist/controller/utils.js +4 -0
  36. package/dist/delivery/index.d.ts +17 -0
  37. package/dist/delivery/index.js +37 -0
  38. package/dist/delivery/main.d.ts +15 -0
  39. package/dist/delivery/main.js +95 -0
  40. package/dist/delivery/scale.d.ts +17 -0
  41. package/dist/delivery/scale.js +175 -0
  42. package/dist/delivery/trait.d.ts +27 -0
  43. package/dist/delivery/trait.js +44 -0
  44. package/dist/index.d.ts +1 -0
  45. package/dist/index.iife.d.ts +8 -0
  46. package/dist/index.iife.js +145 -0
  47. package/dist/index.js +2 -0
  48. package/dist/runtime-support.d.ts +12 -0
  49. package/dist/runtime-support.js +12 -0
  50. package/package.json +86 -16
  51. package/CHANGELOG.json +0 -1
  52. package/CHANGELOG.md +0 -1584
  53. package/LICENSE.md +0 -5
  54. package/README.md +0 -55
  55. package/configure/CHANGELOG.json +0 -1
  56. package/configure/CHANGELOG.md +0 -1479
  57. package/configure/lib/common.js +0 -424
  58. package/configure/lib/common.js.map +0 -1
  59. package/configure/lib/defaults.js +0 -184
  60. package/configure/lib/defaults.js.map +0 -1
  61. package/configure/lib/index.js +0 -157
  62. package/configure/lib/index.js.map +0 -1
  63. package/configure/lib/main.js +0 -454
  64. package/configure/lib/main.js.map +0 -1
  65. package/configure/lib/modals.js +0 -206
  66. package/configure/lib/modals.js.map +0 -1
  67. package/configure/lib/scale.js +0 -478
  68. package/configure/lib/scale.js.map +0 -1
  69. package/configure/lib/trait.js +0 -275
  70. package/configure/lib/trait.js.map +0 -1
  71. package/configure/lib/traitsHeader.js +0 -235
  72. package/configure/lib/traitsHeader.js.map +0 -1
  73. package/configure/lib/utils.js +0 -87
  74. package/configure/lib/utils.js.map +0 -1
  75. package/configure/package.json +0 -24
  76. package/controller/CHANGELOG.json +0 -1
  77. package/controller/CHANGELOG.md +0 -911
  78. package/controller/lib/defaults.js +0 -18
  79. package/controller/lib/defaults.js.map +0 -1
  80. package/controller/lib/index.js +0 -158
  81. package/controller/lib/index.js.map +0 -1
  82. package/controller/lib/utils.js +0 -11
  83. package/controller/lib/utils.js.map +0 -1
  84. package/controller/package.json +0 -14
  85. package/docs/config-schema.json +0 -1628
  86. package/docs/config-schema.json.md +0 -1202
  87. package/docs/demo/config.js +0 -8
  88. package/docs/demo/generate.js +0 -117
  89. package/docs/demo/index.html +0 -1
  90. package/docs/demo/session.js +0 -6
  91. package/docs/pie-schema.json +0 -861
  92. package/docs/pie-schema.json.md +0 -614
  93. package/lib/index.js +0 -54
  94. package/lib/index.js.map +0 -1
  95. package/lib/main.js +0 -123
  96. package/lib/main.js.map +0 -1
  97. package/lib/scale.js +0 -248
  98. package/lib/scale.js.map +0 -1
  99. package/lib/trait.js +0 -83
  100. package/lib/trait.js.map +0 -1
@@ -0,0 +1,89 @@
1
+ import e from "./defaults.js";
2
+ import { excludeZeroTypes as t } from "./modals.js";
3
+ import { addOrRemoveScaleColumn as n } from "./utils.js";
4
+ import r from "./main.js";
5
+ import i from "react";
6
+ import { createRoot as a } from "react-dom/client";
7
+ import { DeleteImageEvent as o, DeleteSoundEvent as s, InsertImageEvent as c, InsertSoundEvent as l, ModelUpdatedEvent as u } from "@pie-element/shared-configure-events";
8
+ //#region src/author/index.ts
9
+ var d = (t) => ({
10
+ ...e.model,
11
+ ...t
12
+ }), f = (t) => ({
13
+ ...e.configuration,
14
+ ...t
15
+ }), p = class extends HTMLElement {
16
+ constructor() {
17
+ super(), this._root = null, this._model = d(), this._configuration = f();
18
+ }
19
+ updateModelAccordingToReceivedProps = (e) => {
20
+ let r = { ...this._model };
21
+ if (!e) return r;
22
+ let i = { ...e }, { scales: a, excludeZero: o } = i || {};
23
+ return (a || []).forEach((e) => {
24
+ e ||= {
25
+ scorePointsLabels: [],
26
+ traits: []
27
+ };
28
+ let { maxPoints: t } = e || {};
29
+ e.scorePointsLabels = [...e.scorePointsLabels || []], e.traits = [...e.traits || []];
30
+ let n = o ? t : t + 1, r = e.scorePointsLabels.length;
31
+ if (r !== n) if (r < n) for (let t = 0; t < n - r; t++) e.scorePointsLabels.push("");
32
+ else e.scorePointsLabels = e.scorePointsLabels.slice(0, n);
33
+ (e.traits || []).forEach((e) => {
34
+ e ||= { scorePointsDescriptors: [] }, e.scorePointsDescriptors = [...e.scorePointsDescriptors || []];
35
+ let t = e.scorePointsDescriptors.length;
36
+ if (t !== n) if (t < n) for (let r = 0; r < n - t; r++) e.scorePointsDescriptors.push("");
37
+ else e.scorePointsDescriptors = e.scorePointsDescriptors.slice(0, n);
38
+ });
39
+ }), i.excludeZero && i.scales.some((e) => e.maxPoints === 1) && (i.excludeZero = !1, i.scales = n(a, t.add0)), i;
40
+ };
41
+ set model(e) {
42
+ this._model = this.updateModelAccordingToReceivedProps(d(e)), this._render();
43
+ }
44
+ set configuration(e) {
45
+ this._configuration = f(e), this._render();
46
+ }
47
+ onModelChanged = (e) => {
48
+ this._model = this.updateModelAccordingToReceivedProps(d(e)), this._render(), this.dispatchEvent(new u(this._model, !1));
49
+ };
50
+ onConfigurationChanged = (e) => {
51
+ this._configuration = f(e), this._render();
52
+ };
53
+ insertSound(e) {
54
+ this.dispatchEvent(new l(e));
55
+ }
56
+ onDeleteSound(e, t) {
57
+ this.dispatchEvent(new s(e, t));
58
+ }
59
+ insertImage(e) {
60
+ this.dispatchEvent(new c(e));
61
+ }
62
+ onDeleteImage(e, t) {
63
+ this.dispatchEvent(new o(e, t));
64
+ }
65
+ _render() {
66
+ if (this._model) {
67
+ let e = i.createElement(r, {
68
+ model: this._model,
69
+ configuration: this._configuration,
70
+ onModelChanged: this.onModelChanged,
71
+ onConfigurationChanged: this.onConfigurationChanged,
72
+ uploadSoundSupport: {
73
+ add: this.insertSound.bind(this),
74
+ delete: this.onDeleteSound.bind(this)
75
+ },
76
+ imageSupport: {
77
+ add: this.insertImage.bind(this),
78
+ delete: this.onDeleteImage.bind(this)
79
+ }
80
+ });
81
+ this._root ||= a(this), this._root.render(e);
82
+ }
83
+ }
84
+ disconnectedCallback() {
85
+ this._root && this._root.unmount();
86
+ }
87
+ };
88
+ //#endregion
89
+ export { p as default };
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/multi-trait-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
+ export declare class Main extends React.Component {
11
+ constructor(props: any);
12
+ state: {
13
+ showDecreaseMaxPointsDialog: boolean;
14
+ showDeleteScaleDialog: boolean;
15
+ showDeleteTraitDialog: boolean;
16
+ showExcludeZeroDialog: boolean;
17
+ showInfoDialog: boolean;
18
+ infoDialogText: string;
19
+ adjustedWidth: string;
20
+ initialUpdateCompleted: boolean;
21
+ };
22
+ componentDidMount(): void;
23
+ componentWillUnmount(): void;
24
+ componentDidUpdate(): void;
25
+ updateDivWidth(): void;
26
+ updateDivWidthDebounced: import("@pie-element/shared-lodash").CancelableFunction<() => void>;
27
+ onScaleAdded: any;
28
+ onScaleChanged: any;
29
+ onScaleRemoved: any;
30
+ onHalfScoringChanged: any;
31
+ onVisibleToStudentChanged: any;
32
+ set: (newState: any) => void;
33
+ changeShowScorePointLabels: any;
34
+ changeShowDescription: any;
35
+ changeShowStandards: any;
36
+ showToggleExcludeZeroModal: () => void;
37
+ hideToggleExcludeZeroModal: any;
38
+ onCloseInfoDialog: () => void;
39
+ changeExcludeZero: any;
40
+ onModelChanged: any;
41
+ render(): React.JSX.Element;
42
+ }
43
+ export default Main;
@@ -0,0 +1,247 @@
1
+ import { ExcludeZeroDialog as e, IncludeZeroDialog as t, InfoDialog as n, excludeZeroTypes as r } from "./modals.js";
2
+ import { addOrRemoveScaleColumn as i } from "./utils.js";
3
+ import { MultiTraitButton as a } from "./common.js";
4
+ import o from "./scale.js";
5
+ import s from "react";
6
+ import c from "prop-types";
7
+ import { styled as l } from "@mui/material/styles";
8
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
9
+ import { cloneDeep as f, debounce as p, isEmpty as m } from "@pie-element/shared-lodash";
10
+ import { layout as h, settings as g } from "@pie-lib/config-ui";
11
+ //#region src/author/main.tsx
12
+ var { Panel: _, toggle: v } = g, y = "650px", b = l("div")(({ theme: e }) => ({
13
+ fontFamily: "Cerebri Sans",
14
+ fontSize: e.typography.fontSize + 2,
15
+ padding: "16px 0"
16
+ })), x = ({ showExcludeZeroDialog: n, excludeZero: r, changeExcludeZero: i, cancel: a }) => n && !r ? /* @__PURE__ */ u(e, {
17
+ open: n && !r,
18
+ changeExcludeZero: i,
19
+ cancel: a
20
+ }) : n && r ? /* @__PURE__ */ u(t, {
21
+ open: n && r,
22
+ changeExcludeZero: i,
23
+ cancel: a
24
+ }) : null;
25
+ x.propTypes = {
26
+ showExcludeZeroDialog: c.bool,
27
+ excludeZero: c.bool,
28
+ changeExcludeZero: c.func,
29
+ cancel: c.func
30
+ };
31
+ var S = class extends s.Component {
32
+ constructor(e) {
33
+ super(e), this.divRef = s.createRef(), this.updateDivWidth = this.updateDivWidth.bind(this);
34
+ }
35
+ state = {
36
+ showDecreaseMaxPointsDialog: !1,
37
+ showDeleteScaleDialog: !1,
38
+ showDeleteTraitDialog: !1,
39
+ showExcludeZeroDialog: !1,
40
+ showInfoDialog: !1,
41
+ infoDialogText: "",
42
+ adjustedWidth: y,
43
+ initialUpdateCompleted: !1
44
+ };
45
+ componentDidMount() {
46
+ window.addEventListener("resize", this.updateDivWidthDebounced), window.addEventListener("load", this.updateDivWidth), setTimeout(this.updateDivWidth, 0);
47
+ }
48
+ componentWillUnmount() {
49
+ window.removeEventListener("resize", this.updateDivWidthDebounced), window.removeEventListener("load", this.updateDivWidth);
50
+ }
51
+ componentDidUpdate() {
52
+ this.state.initialUpdateCompleted || (this.updateDivWidth(), this.setState({ initialUpdateCompleted: !0 }));
53
+ }
54
+ updateDivWidth() {
55
+ if (this.divRef && this.divRef.current) {
56
+ let e = this.divRef.current.offsetWidth;
57
+ e !== this.state.adjustedWidth && this.set({ adjustedWidth: e });
58
+ }
59
+ }
60
+ updateDivWidthDebounced = p(() => this.updateDivWidth(), 50);
61
+ onScaleAdded = () => {
62
+ let { model: e, onModelChanged: t, configuration: n } = this.props, { scales: r, excludeZero: i } = e || {}, { maxNoOfScales: a } = n || {}, { defaultTraitLabel: o } = n || "";
63
+ if (r.length || (r = []), o = typeof o == "string" ? o : r[0]?.traitLabel || "", r.length === a) return this.set({
64
+ infoDialogText: `There can't be more than ${a} scales.`,
65
+ showInfoDialog: !0
66
+ }), !1;
67
+ r.push({
68
+ maxPoints: 1,
69
+ scorePointsLabels: i ? [""] : ["", ""],
70
+ traitLabel: o,
71
+ traits: []
72
+ }), t({
73
+ ...e,
74
+ scales: r
75
+ });
76
+ };
77
+ onScaleChanged = (e, t) => {
78
+ let { model: n, onModelChanged: a } = this.props, o = f((n || {}).scales);
79
+ if (e < 0 || e >= o.length || m(t)) return !1;
80
+ Object.keys(t).forEach((n) => {
81
+ o[e][n] = t[n];
82
+ }), n.excludeZero && t.maxPoints === 1 && (n.excludeZero = !1, o = i(o, r.add0)), a({
83
+ ...n,
84
+ scales: o
85
+ });
86
+ };
87
+ onScaleRemoved = (e) => {
88
+ let { model: t, onModelChanged: n, configuration: r } = this.props, { scales: i } = t || {}, { minNoOfScales: a } = r || {};
89
+ if (e < 0 || e >= i.length) return !1;
90
+ if (i.length === a) return this.set({
91
+ infoDialogText: `There can't be less than ${a} scales.`,
92
+ showInfoDialog: !0
93
+ }), !1;
94
+ i = [...i.slice(0, e), ...i.slice(e + 1)], n({
95
+ ...t,
96
+ scales: i
97
+ });
98
+ };
99
+ onHalfScoringChanged = () => {
100
+ let { model: e, onModelChanged: t } = this.props, { halfScoring: n } = e || {};
101
+ t({
102
+ ...e,
103
+ halfScoring: !n
104
+ });
105
+ };
106
+ onVisibleToStudentChanged = () => {
107
+ let { model: e, onModelChanged: t } = this.props, { visibleToStudent: n } = e || {};
108
+ t({
109
+ ...e,
110
+ visibleToStudent: !n
111
+ });
112
+ };
113
+ set = (e) => this.setState(e);
114
+ changeShowScorePointLabels = () => {
115
+ let { model: e, onModelChanged: t } = this.props || {}, { pointLabels: n } = e || {};
116
+ n = !n, t({
117
+ ...e,
118
+ pointLabels: n
119
+ });
120
+ };
121
+ changeShowDescription = () => {
122
+ let { model: e, onModelChanged: t } = this.props || {}, { description: n } = e || {};
123
+ n = !n, t({
124
+ ...e,
125
+ description: n
126
+ });
127
+ };
128
+ changeShowStandards = () => {
129
+ let { model: e, onModelChanged: t } = this.props || {}, { standards: n } = e || {};
130
+ n = !n, t({
131
+ ...e,
132
+ standards: n
133
+ });
134
+ };
135
+ showToggleExcludeZeroModal = () => this.set({ showExcludeZeroDialog: !0 });
136
+ hideToggleExcludeZeroModal = () => {
137
+ this.set({ showExcludeZeroDialog: !1 });
138
+ };
139
+ onCloseInfoDialog = () => this.set({ showInfoDialog: !1 });
140
+ changeExcludeZero = (e) => {
141
+ let { model: t, onModelChanged: n } = this.props || {}, { scales: r } = t || {}, { excludeZero: a } = t || {};
142
+ if (!r || !r.length) return;
143
+ a = !a;
144
+ let o = i(r, e);
145
+ n({
146
+ ...t,
147
+ scales: o,
148
+ excludeZero: a
149
+ }), this.hideToggleExcludeZeroModal();
150
+ };
151
+ onModelChanged = (e, t) => {
152
+ let { onModelChanged: n } = this.props || {};
153
+ t === "excludeZero" ? this.showToggleExcludeZeroModal() : n(e);
154
+ };
155
+ render() {
156
+ let { model: e, configuration: t, onConfigurationChanged: r, uploadSoundSupport: i, imageSupport: s } = this.props || {}, { addScale: c, baseInputConfiguration: l = {}, dragAndDrop: f, contentDimensions: p = {}, showDescription: m, showExcludeZero: g, showLevelTagInput: y, showStandards: S, showHalfScoring: C, showMaxPoint: w, showScorePointLabels: T, showVisibleToStudent: E, spellCheck: D = {}, settingsPanelDisabled: O, maxNoOfTraits: k, minNoOfTraits: A, width: j, mathMlOptions: M = {}, maxMaxPoints: N, expandedInput: P = {}, labelInput: F = {} } = t || {}, { errors: I, extraCSSRules: L, scales: R, excludeZero: z, description: B, pointLabels: V, standards: H, spellCheckEnabled: U, maxPointsEnabled: W, addScaleEnabled: G } = e || {}, { showExcludeZeroDialog: K, showInfoDialog: q, infoDialogText: J, adjustedWidth: Y } = this.state || {}, X = R?.some((e) => e.maxPoints === 1), Z = {
157
+ standards: S.settings && v(S.label),
158
+ "showLevelTagInput.enabled": y.settings && v(y.label, !0),
159
+ visibleToStudent: E.settings && v(E.label),
160
+ excludeZero: g.settings && v(g.label, !1, X),
161
+ halfScoring: C.settings && v(C.label),
162
+ "dragAndDrop.enabled": f.settings && v(f.label, !0)
163
+ }, Q = {
164
+ description: m.settings && v(m.label),
165
+ pointLabels: T.settings && v(T.label),
166
+ spellCheckEnabled: D.settings && v(D.label),
167
+ maxPointsEnabled: w.settings && v(w.label),
168
+ addScaleEnabled: c.settings && v(c.label)
169
+ }, $ = (e) => Object.assign({ ...l }, e || {});
170
+ return /* @__PURE__ */ d(h.ConfigLayout, {
171
+ extraCSSRules: L,
172
+ dimensions: p,
173
+ hideSettings: O,
174
+ settings: /* @__PURE__ */ u(_, {
175
+ model: e,
176
+ onChangeModel: this.onModelChanged,
177
+ configuration: t,
178
+ onChangeConfiguration: r,
179
+ groups: {
180
+ Settings: Z,
181
+ Properties: Q
182
+ },
183
+ modal: /* @__PURE__ */ u(x, {
184
+ showExcludeZeroDialog: K,
185
+ excludeZero: z,
186
+ changeExcludeZero: this.changeExcludeZero,
187
+ cancel: this.hideToggleExcludeZeroModal
188
+ })
189
+ }),
190
+ children: [
191
+ /* @__PURE__ */ u("div", {
192
+ style: { width: "100%" },
193
+ ref: this.divRef
194
+ }),
195
+ /* @__PURE__ */ d(b, {
196
+ style: { width: j || Y },
197
+ children: [(R || []).map((e, t) => /* @__PURE__ */ u(o, {
198
+ scale: e,
199
+ scaleIndex: t,
200
+ errors: I,
201
+ onScaleRemoved: this.onScaleRemoved,
202
+ onScaleChanged: this.onScaleChanged,
203
+ showStandards: H,
204
+ showScorePointLabels: V,
205
+ showDescription: B,
206
+ showLevelTagInput: y.enabled,
207
+ excludeZero: z,
208
+ enableDragAndDrop: f.enabled,
209
+ spellCheck: U,
210
+ width: Y,
211
+ uploadSoundSupport: i,
212
+ maxPointsEnabled: W,
213
+ maxNoOfTraits: k,
214
+ minNoOfTraits: A,
215
+ imageSupport: s,
216
+ ...this.props,
217
+ mathMlOptions: M,
218
+ maxMaxPoints: N,
219
+ expandedPluginProps: $(P?.inputConfiguration),
220
+ labelPluginProps: $(F?.inputConfiguration)
221
+ }, `scale-${t}`)), G && /* @__PURE__ */ u(a, {
222
+ onClick: this.onScaleAdded,
223
+ children: "Add Scale"
224
+ })]
225
+ }),
226
+ /* @__PURE__ */ u(n, {
227
+ open: q,
228
+ text: J,
229
+ onClose: () => this.set({ showInfoDialog: !1 })
230
+ })
231
+ ]
232
+ });
233
+ }
234
+ };
235
+ S.propTypes = {
236
+ model: c.object,
237
+ uploadSoundSupport: c.object,
238
+ configuration: c.object,
239
+ onModelChanged: c.func,
240
+ onConfigurationChanged: c.func,
241
+ imageSupport: c.shape({
242
+ add: c.func.isRequired,
243
+ delete: c.func.isRequired
244
+ })
245
+ };
246
+ //#endregion
247
+ export { S as default };
@@ -0,0 +1,94 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/multi-trait-rubric/configure/src/modals.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 const excludeZeroTypes: {
12
+ remove0: string;
13
+ add0: string;
14
+ shiftLeft: string;
15
+ shiftRight: string;
16
+ };
17
+ declare const ExcludeZeroDialog: {
18
+ ({ open, changeExcludeZero, cancel }: {
19
+ open: any;
20
+ changeExcludeZero: any;
21
+ cancel: any;
22
+ }): React.JSX.Element;
23
+ propTypes: {
24
+ open: PropTypes.Requireable<boolean>;
25
+ changeExcludeZero: PropTypes.Requireable<(...args: any[]) => any>;
26
+ cancel: PropTypes.Requireable<(...args: any[]) => any>;
27
+ };
28
+ };
29
+ declare const IncludeZeroDialog: {
30
+ ({ open, changeExcludeZero, cancel }: {
31
+ open: any;
32
+ changeExcludeZero: any;
33
+ cancel: any;
34
+ }): React.JSX.Element;
35
+ propTypes: {
36
+ open: PropTypes.Requireable<boolean>;
37
+ changeExcludeZero: PropTypes.Requireable<(...args: any[]) => any>;
38
+ cancel: PropTypes.Requireable<(...args: any[]) => any>;
39
+ };
40
+ };
41
+ declare const DecreaseMaxPoints: {
42
+ ({ open, deleteScorePoints, cancel }: {
43
+ open: any;
44
+ deleteScorePoints: any;
45
+ cancel: any;
46
+ }): React.JSX.Element;
47
+ propTypes: {
48
+ open: PropTypes.Requireable<boolean>;
49
+ deleteScorePoints: PropTypes.Requireable<(...args: any[]) => any>;
50
+ cancel: PropTypes.Requireable<(...args: any[]) => any>;
51
+ };
52
+ };
53
+ declare const DeleteScale: {
54
+ ({ open, scaleIndex, deleteScale, cancel }: {
55
+ open: any;
56
+ scaleIndex: any;
57
+ deleteScale: any;
58
+ cancel: any;
59
+ }): React.JSX.Element;
60
+ propTypes: {
61
+ open: PropTypes.Requireable<boolean>;
62
+ scaleIndex: PropTypes.Requireable<number>;
63
+ deleteScale: PropTypes.Requireable<(...args: any[]) => any>;
64
+ cancel: PropTypes.Requireable<(...args: any[]) => any>;
65
+ };
66
+ };
67
+ declare const DeleteTrait: {
68
+ ({ open, deleteTrait, cancel, traitLabel }: {
69
+ open: any;
70
+ deleteTrait: any;
71
+ cancel: any;
72
+ traitLabel: any;
73
+ }): React.JSX.Element;
74
+ propTypes: {
75
+ open: PropTypes.Requireable<boolean>;
76
+ deleteTrait: PropTypes.Requireable<(...args: any[]) => any>;
77
+ cancel: PropTypes.Requireable<(...args: any[]) => any>;
78
+ traitLabel: PropTypes.Requireable<string>;
79
+ };
80
+ };
81
+ declare const InfoDialog: {
82
+ ({ open, text, onClose }: {
83
+ open: any;
84
+ text: any;
85
+ onClose: any;
86
+ }): React.JSX.Element;
87
+ propTypes: {
88
+ open: PropTypes.Requireable<boolean>;
89
+ text: PropTypes.Requireable<string>;
90
+ cancel: PropTypes.Requireable<(...args: any[]) => any>;
91
+ onClose: PropTypes.Requireable<(...args: any[]) => any>;
92
+ };
93
+ };
94
+ export { ExcludeZeroDialog, IncludeZeroDialog, DecreaseMaxPoints, DeleteScale, DeleteTrait, InfoDialog };
@@ -0,0 +1,171 @@
1
+ import e from "./defaults.js";
2
+ import "react";
3
+ import t from "prop-types";
4
+ import { styled as n } from "@mui/material/styles";
5
+ import { color as r } from "@pie-lib/render-ui";
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
+ import o from "@mui/material/Dialog";
8
+ import s from "@mui/material/DialogTitle";
9
+ import c from "@mui/material/DialogActions";
10
+ import l from "@mui/material/DialogContent";
11
+ import u from "@mui/material/DialogContentText";
12
+ import d from "@mui/material/Button";
13
+ //#region src/author/modals.tsx
14
+ var { configuration: { excludeZeroDialogBoxContent: f, includeZeroDialogBoxContent: p, deleteScaleDialogBoxContent: m, maxPointsDialogBoxContent: h } } = e, g = {
15
+ remove0: "remove0",
16
+ add0: "add0",
17
+ shiftLeft: "shiftLeft",
18
+ shiftRight: "shiftRight"
19
+ }, _ = n(o)(({ theme: e }) => ({ "& .MuiPaper-root": { padding: e.spacing(2.5) } })), v = n(s)(({ theme: e }) => ({
20
+ padding: `0 0 ${e.spacing(2)} 0`,
21
+ "& h2": {
22
+ fontSize: "20px",
23
+ lineHeight: "23px",
24
+ fontFamily: "Cerebri Sans",
25
+ color: r.text()
26
+ }
27
+ })), y = n(l)(({ theme: e }) => ({
28
+ paddingLeft: "0",
29
+ "& p": {
30
+ fontSize: e.typography.fontSize + 2,
31
+ fontFamily: "Cerebri Sans",
32
+ color: r.text()
33
+ }
34
+ })), b = n(d)(({ theme: e }) => ({
35
+ padding: `${e.spacing(1.5)} ${e.spacing(2)}`,
36
+ borderRadius: "4px",
37
+ fontSize: e.typography.fontSize,
38
+ fontFamily: "Cerebri Sans",
39
+ lineHeight: "14px",
40
+ textTransform: "none",
41
+ background: r.primary(),
42
+ color: e.palette.common.white
43
+ })), x = n(b)({
44
+ background: r.secondaryBackground(),
45
+ color: r.text()
46
+ }), S = ({ open: e, changeExcludeZero: t, cancel: n }) => /* @__PURE__ */ a(_, {
47
+ open: e,
48
+ children: [
49
+ /* @__PURE__ */ i(v, { children: f.title }),
50
+ /* @__PURE__ */ i(y, { children: /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: f.text } }) }) }),
51
+ /* @__PURE__ */ a(c, { children: [
52
+ /* @__PURE__ */ i(x, {
53
+ onClick: () => n(),
54
+ children: "Cancel"
55
+ }),
56
+ /* @__PURE__ */ i(b, {
57
+ onClick: () => t(g.shiftLeft),
58
+ children: "Shift to Left"
59
+ }),
60
+ /* @__PURE__ */ i(b, {
61
+ onClick: () => t(g.remove0),
62
+ children: "Remove 0 column"
63
+ })
64
+ ] })
65
+ ]
66
+ });
67
+ S.propTypes = {
68
+ open: t.bool,
69
+ changeExcludeZero: t.func,
70
+ cancel: t.func
71
+ };
72
+ var C = ({ open: e, changeExcludeZero: t, cancel: n }) => /* @__PURE__ */ a(_, {
73
+ open: e,
74
+ children: [
75
+ /* @__PURE__ */ i(v, { children: p.title }),
76
+ /* @__PURE__ */ i(y, { children: /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: p.text } }) }) }),
77
+ /* @__PURE__ */ a(c, { children: [
78
+ /* @__PURE__ */ i(x, {
79
+ onClick: () => n(),
80
+ children: "Cancel"
81
+ }),
82
+ /* @__PURE__ */ i(b, {
83
+ onClick: () => t(g.shiftRight),
84
+ children: "Shift to Right"
85
+ }),
86
+ /* @__PURE__ */ i(b, {
87
+ onClick: () => t(g.add0),
88
+ children: "Add 0 column"
89
+ })
90
+ ] })
91
+ ]
92
+ });
93
+ C.propTypes = {
94
+ open: t.bool,
95
+ changeExcludeZero: t.func,
96
+ cancel: t.func
97
+ };
98
+ var w = ({ open: e, deleteScorePoints: t, cancel: n }) => /* @__PURE__ */ a(_, {
99
+ open: e,
100
+ children: [
101
+ /* @__PURE__ */ i(v, { children: h.title }),
102
+ /* @__PURE__ */ i(y, { children: /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: h.text } }) }) }),
103
+ /* @__PURE__ */ a(c, { children: [/* @__PURE__ */ i(x, {
104
+ onClick: n,
105
+ children: "Cancel"
106
+ }), /* @__PURE__ */ i(b, {
107
+ onClick: t,
108
+ children: "Confirm"
109
+ })] })
110
+ ]
111
+ });
112
+ w.propTypes = {
113
+ open: t.bool,
114
+ deleteScorePoints: t.func,
115
+ cancel: t.func
116
+ };
117
+ var T = ({ open: e, scaleIndex: t, deleteScale: n, cancel: r }) => /* @__PURE__ */ a(_, {
118
+ open: e,
119
+ children: [
120
+ /* @__PURE__ */ i(v, { children: `${m.title} #${t + 1}` }),
121
+ /* @__PURE__ */ i(y, { children: /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: m.text } }) }) }),
122
+ /* @__PURE__ */ a(c, { children: [/* @__PURE__ */ i(x, {
123
+ onClick: r,
124
+ children: "Cancel"
125
+ }), /* @__PURE__ */ i(b, {
126
+ onClick: n,
127
+ children: "Delete"
128
+ })] })
129
+ ]
130
+ });
131
+ T.propTypes = {
132
+ open: t.bool,
133
+ scaleIndex: t.number,
134
+ deleteScale: t.func,
135
+ cancel: t.func
136
+ };
137
+ var E = ({ open: e, deleteTrait: t, cancel: n, traitLabel: r }) => /* @__PURE__ */ a(_, {
138
+ open: e,
139
+ children: [
140
+ /* @__PURE__ */ a(v, { children: ["Delete ", r] }),
141
+ /* @__PURE__ */ i(y, { children: /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: `Are you sure you want to delete this ${r}?` } }) }) }),
142
+ /* @__PURE__ */ a(c, { children: [/* @__PURE__ */ i(x, {
143
+ onClick: n,
144
+ children: "Cancel"
145
+ }), /* @__PURE__ */ i(b, {
146
+ onClick: t,
147
+ children: "Delete"
148
+ })] })
149
+ ]
150
+ });
151
+ E.propTypes = {
152
+ open: t.bool,
153
+ deleteTrait: t.func,
154
+ cancel: t.func,
155
+ traitLabel: t.string
156
+ };
157
+ var D = ({ open: e, text: t, onClose: n }) => /* @__PURE__ */ a(_, {
158
+ open: e,
159
+ children: [/* @__PURE__ */ i(v, { children: t }), /* @__PURE__ */ i(c, { children: /* @__PURE__ */ i(b, {
160
+ onClick: n,
161
+ children: "OK"
162
+ }) })]
163
+ });
164
+ D.propTypes = {
165
+ open: t.bool,
166
+ text: t.string,
167
+ cancel: t.func,
168
+ onClose: t.func
169
+ };
170
+ //#endregion
171
+ export { w as DecreaseMaxPoints, T as DeleteScale, E as DeleteTrait, S as ExcludeZeroDialog, C as IncludeZeroDialog, D as InfoDialog, g as excludeZeroTypes };
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/multi-trait-rubric/configure/src/scale.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
+ export declare class Scale extends React.Component {
11
+ state: {
12
+ showDecreaseMaxPointsDialog: boolean;
13
+ showDeleteScaleDialog: boolean;
14
+ showDeleteTraitDialog: boolean;
15
+ currentPosition: number;
16
+ showRight: null;
17
+ showLeft: null;
18
+ showInfoDialog: boolean;
19
+ infoDialogText: string;
20
+ };
21
+ set: (newState: any) => void;
22
+ componentDidMount(): void;
23
+ componentDidUpdate(prevProps: any): void;
24
+ UNSAFE_componentWillReceiveProps(nextProps: any): void;
25
+ updateMaxPointsFieldValue: any;
26
+ showDecreaseMaxPointsModal: ({ newMaxPoints }: {
27
+ newMaxPoints: any;
28
+ }) => void;
29
+ hideDecreaseMaxPointsModal: () => void;
30
+ changeMaxPoints: any;
31
+ showDeleteScaleModal: () => void;
32
+ hideDeleteScaleModal: () => void;
33
+ deleteScale: any;
34
+ showDeleteTraitModal: (traitToDeleteIndex: any) => void;
35
+ hideDeleteTraitModal: () => void;
36
+ onTraitRemoved: any;
37
+ onTraitAdded: any;
38
+ onTraitChanged: any;
39
+ onTraitDropped: any;
40
+ decreasePosition: any;
41
+ getMaxScroll: any;
42
+ getNumberOfBlocks: any;
43
+ increasePosition: any;
44
+ render(): React.JSX.Element;
45
+ }
46
+ export default Scale;