@pie-element/multi-trait-rubric 8.1.2-next.2 → 8.1.2

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/CHANGELOG.json +1 -0
  2. package/CHANGELOG.md +1590 -0
  3. package/LICENSE.md +5 -0
  4. package/README.md +55 -0
  5. package/configure/CHANGELOG.json +1 -0
  6. package/configure/CHANGELOG.md +1485 -0
  7. package/configure/lib/common.js +424 -0
  8. package/configure/lib/common.js.map +1 -0
  9. package/configure/lib/defaults.js +184 -0
  10. package/configure/lib/defaults.js.map +1 -0
  11. package/configure/lib/index.js +157 -0
  12. package/configure/lib/index.js.map +1 -0
  13. package/configure/lib/main.js +454 -0
  14. package/configure/lib/main.js.map +1 -0
  15. package/configure/lib/modals.js +206 -0
  16. package/configure/lib/modals.js.map +1 -0
  17. package/configure/lib/scale.js +478 -0
  18. package/configure/lib/scale.js.map +1 -0
  19. package/configure/lib/trait.js +275 -0
  20. package/configure/lib/trait.js.map +1 -0
  21. package/configure/lib/traitsHeader.js +235 -0
  22. package/configure/lib/traitsHeader.js.map +1 -0
  23. package/configure/lib/utils.js +87 -0
  24. package/configure/lib/utils.js.map +1 -0
  25. package/configure/package.json +24 -0
  26. package/controller/CHANGELOG.json +1 -0
  27. package/controller/CHANGELOG.md +911 -0
  28. package/controller/lib/defaults.js +18 -0
  29. package/controller/lib/defaults.js.map +1 -0
  30. package/controller/lib/index.js +158 -0
  31. package/controller/lib/index.js.map +1 -0
  32. package/controller/lib/utils.js +11 -0
  33. package/controller/lib/utils.js.map +1 -0
  34. package/controller/package.json +14 -0
  35. package/docs/config-schema.json +1628 -0
  36. package/docs/config-schema.json.md +1202 -0
  37. package/docs/demo/config.js +8 -0
  38. package/docs/demo/generate.js +117 -0
  39. package/docs/demo/index.html +1 -0
  40. package/docs/demo/session.js +6 -0
  41. package/docs/pie-schema.json +861 -0
  42. package/docs/pie-schema.json.md +614 -0
  43. package/lib/index.js +54 -0
  44. package/lib/index.js.map +1 -0
  45. package/lib/main.js +123 -0
  46. package/lib/main.js.map +1 -0
  47. package/lib/scale.js +248 -0
  48. package/lib/scale.js.map +1 -0
  49. package/lib/trait.js +83 -0
  50. package/lib/trait.js.map +1 -0
  51. package/package.json +15 -84
  52. package/configure.js +0 -2
  53. package/controller.js +0 -1
  54. package/dist/author/common.d.ts +0 -90
  55. package/dist/author/common.js +0 -275
  56. package/dist/author/defaults.d.ts +0 -153
  57. package/dist/author/defaults.js +0 -113
  58. package/dist/author/index.d.ts +0 -22
  59. package/dist/author/index.js +0 -89
  60. package/dist/author/main.d.ts +0 -43
  61. package/dist/author/main.js +0 -247
  62. package/dist/author/modals.d.ts +0 -94
  63. package/dist/author/modals.js +0 -171
  64. package/dist/author/scale.d.ts +0 -46
  65. package/dist/author/scale.js +0 -280
  66. package/dist/author/trait.d.ts +0 -70
  67. package/dist/author/trait.js +0 -202
  68. package/dist/author/traitsHeader.d.ts +0 -28
  69. package/dist/author/traitsHeader.js +0 -172
  70. package/dist/author/utils.d.ts +0 -10
  71. package/dist/author/utils.js +0 -41
  72. package/dist/browser/Typography-CGQjcqGj.js +0 -9000
  73. package/dist/browser/Typography-CGQjcqGj.js.map +0 -1
  74. package/dist/browser/author/index.js +0 -41731
  75. package/dist/browser/author/index.js.map +0 -1
  76. package/dist/browser/controller/index.js +0 -70
  77. package/dist/browser/controller/index.js.map +0 -1
  78. package/dist/browser/delivery/index.js +0 -523
  79. package/dist/browser/delivery/index.js.map +0 -1
  80. package/dist/browser/multi-trait-rubric.css +0 -2
  81. package/dist/controller/defaults.d.ts +0 -20
  82. package/dist/controller/defaults.js +0 -14
  83. package/dist/controller/index.d.ts +0 -26
  84. package/dist/controller/index.js +0 -57
  85. package/dist/controller/utils.d.ts +0 -9
  86. package/dist/controller/utils.js +0 -4
  87. package/dist/delivery/index.d.ts +0 -17
  88. package/dist/delivery/index.js +0 -37
  89. package/dist/delivery/main.d.ts +0 -15
  90. package/dist/delivery/main.js +0 -95
  91. package/dist/delivery/scale.d.ts +0 -17
  92. package/dist/delivery/scale.js +0 -175
  93. package/dist/delivery/trait.d.ts +0 -27
  94. package/dist/delivery/trait.js +0 -44
  95. package/dist/index.d.ts +0 -1
  96. package/dist/index.iife.d.ts +0 -8
  97. package/dist/index.iife.js +0 -145
  98. package/dist/index.js +0 -2
  99. package/dist/runtime-support.d.ts +0 -12
  100. package/dist/runtime-support.js +0 -12
@@ -1,172 +0,0 @@
1
- import { Block as e, HeaderHeight as t, HeaderHeightLarge as n, MaxPointsPicker as r, ScaleSettings as i, ScorePoint as a, SecondaryBlock as o, SimpleInput as s } from "./common.js";
2
- import c from "react";
3
- import l from "prop-types";
4
- import { styled as u } from "@mui/material/styles";
5
- import * as d from "@pie-lib/render-ui";
6
- import { InlineMenu as f, color as p } from "@pie-lib/render-ui";
7
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
8
- import g from "@mui/material/IconButton";
9
- import _ from "@mui/material/MenuItem";
10
- import v from "@mui/icons-material/MoreVert";
11
- //#region src/author/traitsHeader.tsx
12
- function y(e) {
13
- return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
14
- }
15
- function b(e, t) {
16
- return !e || y(e) ? e : y(e.default) ? e.default : t && y(e[t]) ? e[t] : t && y(e[t]?.default) ? e[t].default : e;
17
- }
18
- var x = b(f, "InlineMenu") || b(w.InlineMenu, "InlineMenu"), S = d, C = S.default, w = C && typeof C == "object" ? C : S, T = u("div")({
19
- width: "140px",
20
- border: "none",
21
- padding: "10px 0",
22
- display: "flex",
23
- alignItems: "center",
24
- justifyContent: "space-around"
25
- }), E = u("div")(({ height: e, theme: t }) => ({
26
- background: p.secondaryBackground(),
27
- borderRadius: "4px",
28
- position: "relative",
29
- marginBottom: t.spacing(2),
30
- display: "flex",
31
- height: e
32
- })), D = u("div")(({ theme: e }) => ({
33
- width: "200px",
34
- minWidth: "200px",
35
- position: "relative",
36
- padding: "0 10px",
37
- boxSizing: "border-box",
38
- paddingTop: e.spacing(1.5),
39
- alignSelf: "center"
40
- })), O = u("div")(({ theme: e }) => ({
41
- position: "absolute",
42
- fontSize: e.typography.fontSize - 2,
43
- color: e.palette.error.main,
44
- paddingTop: e.spacing(.5)
45
- })), k = class extends c.Component {
46
- static propTypes = {
47
- maxPointsEnabled: l.bool,
48
- spellCheck: l.bool,
49
- errors: l.object
50
- };
51
- state = { anchorEl: null };
52
- UNSAFE_componentWillReceiveProps(e) {
53
- e.currentPosition !== this.props.currentPosition && this.scrollToPosition(e.currentPosition);
54
- }
55
- onScorePointLabelChange = ({ scorePointLabel: e, value: t }) => {
56
- let { scorePointsLabels: n, onScaleChange: r } = this.props;
57
- t < 0 || t >= n.length || (n[t] = e, r({ scorePointsLabels: n }));
58
- };
59
- handleClick = (e) => this.setState({ anchorEl: e.currentTarget });
60
- handleClose = () => this.setState({ anchorEl: null });
61
- scrollToPosition = (e) => {
62
- this.secondaryBlock && this.secondaryBlock.scrollTo({ left: e });
63
- };
64
- openMenu = () => {
65
- this.props.showDeleteScaleModal(), this.handleClose();
66
- };
67
- render() {
68
- let { scorePointsValues: c, scorePointsLabels: l, traitLabel: u, currentPosition: d, showStandards: f, onTraitLabelChange: p, showDescription: y, showLevelTagInput: b, maxPoints: S, updateMaxPointsFieldValue: C, scaleIndex: w, showScorePointLabels: k, secondaryBlockWidth: A, setSecondaryBlockRef: j, spellCheck: M, uploadSoundSupport: N, maxPointsEnabled: P, mathMlOptions: F = {}, errors: I = {}, maxMaxPoints: L, labelPluginProps: R = {}, imageSupport: z = {} } = this.props, { anchorEl: B } = this.state;
69
- return /* @__PURE__ */ h(E, {
70
- height: b ? n : t,
71
- children: [/* @__PURE__ */ h(D, { children: [b && /* @__PURE__ */ m(s, {
72
- markup: u || "Trait",
73
- onChange: p,
74
- pluginProps: R,
75
- spellCheck: M,
76
- label: "Level Label",
77
- uploadSoundSupport: N,
78
- mathMlOptions: F,
79
- imageSupport: z
80
- }), /* @__PURE__ */ h(i, { children: [
81
- /* @__PURE__ */ h("div", { children: ["Scale ", w + 1] }),
82
- P && /* @__PURE__ */ m(r, {
83
- maxPoints: S,
84
- maxMaxPoints: L,
85
- onChange: C
86
- }),
87
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m(g, {
88
- "aria-label": "more",
89
- "aria-controls": "long-menu",
90
- "aria-haspopup": "true",
91
- onClick: this.handleClick,
92
- size: "large",
93
- children: /* @__PURE__ */ m(v, {})
94
- }), /* @__PURE__ */ m(x, {
95
- id: "long-menu",
96
- anchorEl: B,
97
- keepMounted: !0,
98
- open: !!B,
99
- onClose: this.handleClose,
100
- transitionDuration: {
101
- enter: 225,
102
- exit: 195
103
- },
104
- children: ["Remove Scale"].map((e) => /* @__PURE__ */ m(_, {
105
- onClick: this.openMenu,
106
- children: e
107
- }, e))
108
- })] })
109
- ] })] }), /* @__PURE__ */ h(o, {
110
- setRef: (e) => {
111
- e && (this.secondaryBlock = e, j(e));
112
- },
113
- width: `${A}px`,
114
- children: [
115
- f && /* @__PURE__ */ m(e, { children: /* @__PURE__ */ m(T, { children: "Standard(s)" }) }),
116
- y && /* @__PURE__ */ m(e, { children: /* @__PURE__ */ m(T, { children: "Description" }) }),
117
- c.map((t, n) => {
118
- let r = A - 216 * n + d - 128, i = c.length - n - 1, o, s;
119
- try {
120
- o = l[i] || "", s = I[i] || "";
121
- } catch {
122
- o = "";
123
- }
124
- return /* @__PURE__ */ h(e, { children: [/* @__PURE__ */ m(a, {
125
- scorePointsValue: t,
126
- error: s,
127
- scoreDescriptor: o,
128
- pluginProps: R,
129
- showScorePointLabels: k,
130
- onChange: (e) => this.onScorePointLabelChange({
131
- scorePointLabel: e,
132
- value: i
133
- }),
134
- alignToRight: r < 296 && t < S,
135
- spellCheck: M,
136
- uploadSoundSupport: N,
137
- mathMlOptions: F,
138
- imageSupport: z
139
- }), s && /* @__PURE__ */ m(O, { children: s })] }, `secondary-block-part-${n}`);
140
- })
141
- ]
142
- })]
143
- });
144
- }
145
- };
146
- k.propTypes = {
147
- onTraitLabelChange: l.func,
148
- onScaleChange: l.func,
149
- scorePointsValues: l.arrayOf(l.number),
150
- scorePointsLabels: l.arrayOf(l.string),
151
- traitLabel: l.string,
152
- showStandards: l.bool,
153
- showLevelTagInput: l.bool,
154
- showDescription: l.bool,
155
- maxPoints: l.number,
156
- updateMaxPointsFieldValue: l.func,
157
- scaleIndex: l.number,
158
- currentPosition: l.number,
159
- secondaryBlockWidth: l.number,
160
- showDeleteScaleModal: l.func,
161
- showScorePointLabels: l.bool,
162
- setSecondaryBlockRef: l.func,
163
- uploadSoundSupport: l.object,
164
- maxMaxPoints: l.number,
165
- labelPluginProps: l.object,
166
- imageSupport: l.shape({
167
- add: l.func.isRequired,
168
- delete: l.func.isRequired
169
- })
170
- };
171
- //#endregion
172
- export { k as default };
@@ -1,10 +0,0 @@
1
- /**
2
- * @synced-from pie-elements/packages/multi-trait-rubric/configure/src/utils.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 declare const filteredDefaultPlugins: string[];
10
- export declare const addOrRemoveScaleColumn: (scales: any, excludeZeroType: any) => any;
@@ -1,41 +0,0 @@
1
- import { excludeZeroTypes as e } from "./modals.js";
2
- import { DEFAULT_PLUGINS as t } from "@pie-lib/editable-html-tip-tap";
3
- //#region src/author/utils.ts
4
- var n = (t || []).filter((e) => e !== "table" && e !== "bulleted-list" && e !== "numbered-list"), r = (t, n) => !t || !t.length ? [] : t.reduce((t, r) => {
5
- let { scorePointsLabels: i, traits: a } = r || {};
6
- if (i.length < 1) return t;
7
- switch (n) {
8
- case e.remove0:
9
- i = i.slice(1), a = a.map(({ scorePointsDescriptors: e, ...t }) => ({
10
- ...t,
11
- scorePointsDescriptors: e.slice(1)
12
- }));
13
- break;
14
- case e.add0:
15
- i = ["", ...i], a = a.map(({ scorePointsDescriptors: e, ...t }) => ({
16
- ...t,
17
- scorePointsDescriptors: ["", ...e]
18
- }));
19
- break;
20
- case e.shiftLeft:
21
- i = i.slice(0, -1), a = a.map(({ scorePointsDescriptors: e, ...t }) => ({
22
- ...t,
23
- scorePointsDescriptors: e.slice(0, -1)
24
- }));
25
- break;
26
- case e.shiftRight:
27
- i = [...i, ""], a = a.map(({ scorePointsDescriptors: e, ...t }) => ({
28
- ...t,
29
- scorePointsDescriptors: [...e, ""]
30
- }));
31
- break;
32
- default: break;
33
- }
34
- return t.push({
35
- ...r,
36
- scorePointsLabels: i,
37
- traits: a
38
- }), t;
39
- }, []);
40
- //#endregion
41
- export { r as addOrRemoveScaleColumn, n as filteredDefaultPlugins };