@pie-element/multi-trait-rubric 9.0.2-next.20261007003844 → 9.0.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.
@@ -3,17 +3,18 @@ import t from "react";
3
3
  import n from "prop-types";
4
4
  import { styled as r } from "@mui/material/styles";
5
5
  import { color as i } from "@pie-lib/render-ui";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- import s from "@mui/icons-material/ArrowBackIos";
8
- import c from "@mui/icons-material/ArrowForwardIos";
6
+ import { sanitizeModelHtml as a } from "@pie-element/shared-utils";
7
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
+ import c from "@mui/icons-material/ArrowBackIos";
9
+ import l from "@mui/icons-material/ArrowForwardIos";
9
10
  //#region src/delivery/scale.tsx
10
- var l = r("div")({
11
+ var u = r("div")({
11
12
  display: "flex",
12
13
  position: "relative"
13
- }), u = r("div")({
14
+ }), d = r("div")({
14
15
  width: "100%",
15
16
  overflow: "auto"
16
- }), d = r("table")(({ theme: e }) => ({
17
+ }), f = r("table")(({ theme: e }) => ({
17
18
  borderSpacing: 0,
18
19
  marginBottom: e.spacing(2),
19
20
  borderRadius: "4px",
@@ -37,12 +38,12 @@ var l = r("div")({
37
38
  padding: `${e.spacing(2)} ${e.spacing(1)}`,
38
39
  verticalAlign: "top"
39
40
  }
40
- })), f = r("table")({ "& td": {
41
+ })), p = r("table")({ "& td": {
41
42
  border: 0,
42
43
  padding: 0,
43
44
  textAlign: "center",
44
45
  minWidth: "200px"
45
- } }), p = r("div")({ marginBottom: "4px" }), m = r("td")({ fontWeight: "normal" }), h = ({ show: e, onClick: t, extraStyles: n, children: r }) => /* @__PURE__ */ a("div", {
46
+ } }), m = r("div")({ marginBottom: "4px" }), h = r("td")({ fontWeight: "normal" }), g = ({ show: e, onClick: t, extraStyles: n, children: r }) => /* @__PURE__ */ o("div", {
46
47
  style: {
47
48
  height: "calc(100% - 1px)",
48
49
  top: "1px",
@@ -58,13 +59,13 @@ var l = r("div")({
58
59
  onClick: t,
59
60
  children: r
60
61
  });
61
- h.propTypes = {
62
+ g.propTypes = {
62
63
  show: n.bool,
63
64
  onClick: n.func,
64
65
  extraStyles: n.object,
65
66
  children: n.object
66
67
  };
67
- var g = class extends t.Component {
68
+ var _ = class extends t.Component {
68
69
  state = {};
69
70
  componentDidMount() {
70
71
  this.tableWrapper && this.tableWrapper.offsetWidth < this.tableWrapper.scrollWidth && this.setState({ showRight: !0 });
@@ -83,31 +84,31 @@ var g = class extends t.Component {
83
84
  });
84
85
  };
85
86
  render() {
86
- let { showRight: t, showLeft: n } = this.state, { scale: r, scaleIndex: g, showDescription: _, showPointsLabels: v, showStandards: y, arrowsDisabled: b } = this.props, { excludeZero: x, maxPoints: S, traitLabel: C, traits: w, scorePointsLabels: T } = r || {}, E = [], D, O, k;
87
+ let { showRight: t, showLeft: n } = this.state, { scale: r, scaleIndex: _, showDescription: v, showPointsLabels: y, showStandards: b, arrowsDisabled: x } = this.props, { excludeZero: S, maxPoints: C, traitLabel: w, traits: T, scorePointsLabels: E } = r || {}, D = [], O, k, A;
87
88
  try {
88
- for (let e = S; +(e >= x); --e) E.push(e);
89
- let { traitStandards: e, traitDescriptions: t } = w.reduce((e, t) => ({
89
+ for (let e = C; +(e >= S); --e) D.push(e);
90
+ let { traitStandards: e, traitDescriptions: t } = T.reduce((e, t) => ({
90
91
  traitStandards: [...e.traitStandards, ...t.standards || []],
91
92
  traitDescriptions: [...e.traitDescriptions, ...t.description || []]
92
93
  }), {
93
94
  traitStandards: [],
94
95
  traitDescriptions: []
95
96
  });
96
- D = _ && t.length, O = v && T.length, k = y && e.length;
97
+ O = v && t.length, k = y && E.length, A = b && e.length;
97
98
  } catch {
98
- D = !1, O = !1, k = !1;
99
+ O = !1, k = !1, A = !1;
99
100
  }
100
- return /* @__PURE__ */ o(l, { children: [
101
- /* @__PURE__ */ a(h, {
102
- show: n && !b,
101
+ return /* @__PURE__ */ s(u, { children: [
102
+ /* @__PURE__ */ o(g, {
103
+ show: n && !x,
103
104
  onClick: this.scrollLeft,
104
105
  extraStyles: {
105
106
  left: 0,
106
107
  background: `linear-gradient(to right, white, ${i.background()})`
107
108
  },
108
- children: /* @__PURE__ */ a(s, {})
109
+ children: /* @__PURE__ */ o(c, {})
109
110
  }),
110
- /* @__PURE__ */ o(u, {
111
+ /* @__PURE__ */ s(d, {
111
112
  ref: (e) => {
112
113
  this.tableWrapper = e;
113
114
  },
@@ -117,42 +118,42 @@ var g = class extends t.Component {
117
118
  showLeft: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth && this.tableWrapper.scrollLeft > 0
118
119
  });
119
120
  },
120
- children: [b && (t || n) ? /* @__PURE__ */ a("div", { children: "The item is too large to fit in print mode." }) : null, /* @__PURE__ */ o(d, { children: [/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ o("tr", { children: [
121
- /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a("div", { dangerouslySetInnerHTML: { __html: C } }) }),
122
- k ? /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a("div", { children: "Standard(s)" }) }) : null,
123
- D ? /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a("div", { children: "Description" }) }) : null,
124
- E && E.map((e, t) => {
121
+ children: [x && (t || n) ? /* @__PURE__ */ o("div", { children: "The item is too large to fit in print mode." }) : null, /* @__PURE__ */ s(f, { children: [/* @__PURE__ */ o("thead", { children: /* @__PURE__ */ s("tr", { children: [
122
+ /* @__PURE__ */ o("th", { children: /* @__PURE__ */ o("div", { dangerouslySetInnerHTML: { __html: a(w) } }) }),
123
+ A ? /* @__PURE__ */ o("th", { children: /* @__PURE__ */ o("div", { children: "Standard(s)" }) }) : null,
124
+ O ? /* @__PURE__ */ o("th", { children: /* @__PURE__ */ o("div", { children: "Description" }) }) : null,
125
+ D && D.map((e, t) => {
125
126
  let n = "";
126
127
  try {
127
- n = T[E.length - t - 1] || "";
128
+ n = E[D.length - t - 1] || "";
128
129
  } catch {
129
130
  n = "";
130
131
  }
131
- return /* @__PURE__ */ a("th", { children: /* @__PURE__ */ a(f, { children: /* @__PURE__ */ o("thead", { children: [O ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { children: /* @__PURE__ */ a(p, { dangerouslySetInnerHTML: { __html: n } }) }) }) : null, /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(m, { children: e === 1 ? `${e} point` : `${e} points` }) })] }) }) }, `table-header-${t}`);
132
+ return /* @__PURE__ */ o("th", { children: /* @__PURE__ */ o(p, { children: /* @__PURE__ */ s("thead", { children: [k ? /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { children: /* @__PURE__ */ o(m, { dangerouslySetInnerHTML: { __html: a(n) } }) }) }) : null, /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o(h, { children: e === 1 ? `${e} point` : `${e} points` }) })] }) }) }, `table-header-${t}`);
132
133
  })
133
- ] }) }), /* @__PURE__ */ a("tbody", { children: w && w.map((t, n) => /* @__PURE__ */ a(e, {
134
+ ] }) }), /* @__PURE__ */ o("tbody", { children: T && T.map((t, n) => /* @__PURE__ */ o(e, {
134
135
  trait: t,
135
136
  traitIndex: n,
136
- showDescription: !!D,
137
- showStandards: !!k,
138
- scaleIndex: g,
139
- scorePointsValues: E,
140
- excludeZero: x
141
- }, `trait_${g}_${n}`)) })] }, `scale-${g}`)]
137
+ showDescription: !!O,
138
+ showStandards: !!A,
139
+ scaleIndex: _,
140
+ scorePointsValues: D,
141
+ excludeZero: S
142
+ }, `trait_${_}_${n}`)) })] }, `scale-${_}`)]
142
143
  }),
143
- /* @__PURE__ */ a(h, {
144
- show: t && !b,
144
+ /* @__PURE__ */ o(g, {
145
+ show: t && !x,
145
146
  onClick: this.scrollRight,
146
147
  extraStyles: {
147
148
  right: 0,
148
149
  background: `linear-gradient(to left, white, ${i.background()})`
149
150
  },
150
- children: /* @__PURE__ */ a(c, {})
151
+ children: /* @__PURE__ */ o(l, {})
151
152
  })
152
153
  ] });
153
154
  }
154
155
  };
155
- g.propTypes = {
156
+ _.propTypes = {
156
157
  scaleIndex: n.number,
157
158
  scale: n.shape({
158
159
  excludeZero: n.bool,
@@ -172,4 +173,4 @@ g.propTypes = {
172
173
  arrowsDisabled: n.bool
173
174
  };
174
175
  //#endregion
175
- export { g as default };
176
+ export { _ as default };
@@ -2,32 +2,33 @@ import "react";
2
2
  import e from "prop-types";
3
3
  import { styled as t } from "@mui/material/styles";
4
4
  import { color as n } from "@pie-lib/render-ui";
5
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ import { sanitizeModelHtml as r } from "@pie-element/shared-utils";
6
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
7
  //#region src/delivery/trait.tsx
7
- var a = t("td")({
8
+ var o = t("td")({
8
9
  color: n.primaryDark(),
9
10
  verticalAlign: "middle"
10
- }), o = t("div")({
11
+ }), s = t("div")({
11
12
  color: n.secondaryBackground(),
12
13
  textAlign: "center"
13
- }), s = (e) => {
14
- let { trait: t, traitIndex: n, scaleIndex: s, showStandards: c, showDescription: l, scorePointsValues: u } = e, { name: d, standards: f, scorePointsDescriptors: p, description: m } = t || {};
15
- return /* @__PURE__ */ i("tr", { children: [
16
- /* @__PURE__ */ r(a, { children: /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: d } }) }),
17
- c ? /* @__PURE__ */ r("td", { children: /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: f.join(",") } }) }) : null,
18
- l ? /* @__PURE__ */ r("td", { children: /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: m } }) }) : null,
19
- u && u.map((e, t) => {
14
+ }), c = (e) => {
15
+ let { trait: t, traitIndex: n, scaleIndex: c, showStandards: l, showDescription: u, scorePointsValues: d } = e, { name: f, standards: p, scorePointsDescriptors: m, description: h } = t || {};
16
+ return /* @__PURE__ */ a("tr", { children: [
17
+ /* @__PURE__ */ i(o, { children: /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: r(f) } }) }),
18
+ l ? /* @__PURE__ */ i("td", { children: /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: r(p.join(",")) } }) }) : null,
19
+ u ? /* @__PURE__ */ i("td", { children: /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: r(h) } }) }) : null,
20
+ d && d.map((e, t) => {
20
21
  let n;
21
22
  try {
22
- n = p[u.length - t - 1] || "";
23
+ n = m[d.length - t - 1] || "";
23
24
  } catch {
24
25
  n = "";
25
26
  }
26
- return /* @__PURE__ */ r("td", { children: n ? /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: n } }) : /* @__PURE__ */ r(o, { dangerouslySetInnerHTML: { __html: "No Description" } }) }, `table-cell-${t}`);
27
+ return /* @__PURE__ */ i("td", { children: n ? /* @__PURE__ */ i("div", { dangerouslySetInnerHTML: { __html: r(n) } }) : /* @__PURE__ */ i(s, { dangerouslySetInnerHTML: { __html: "No Description" } }) }, `table-cell-${t}`);
27
28
  })
28
- ] }, `scale-${s}-trait-${n}`);
29
+ ] }, `scale-${c}-trait-${n}`);
29
30
  };
30
- s.propTypes = {
31
+ c.propTypes = {
31
32
  showStandards: e.bool,
32
33
  showDescription: e.bool,
33
34
  scorePointsValues: e.arrayOf(e.number),
@@ -41,4 +42,4 @@ s.propTypes = {
41
42
  })
42
43
  };
43
44
  //#endregion
44
- export { s as default };
45
+ export { c as default };