@pie-element/rubric 8.1.0-next.19 → 8.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 (88) hide show
  1. package/dist/author/defaults.d.ts +71 -0
  2. package/dist/author/defaults.js +53 -0
  3. package/dist/author/index.d.ts +21 -0
  4. package/dist/author/index.js +72 -0
  5. package/dist/author/main.d.ts +14 -0
  6. package/dist/author/main.js +51 -0
  7. package/dist/controller/defaults.d.ts +17 -0
  8. package/dist/controller/defaults.js +21 -0
  9. package/dist/controller/index.d.ts +10 -0
  10. package/dist/controller/index.js +23 -0
  11. package/dist/delivery/index.d.ts +16 -0
  12. package/dist/delivery/index.js +33 -0
  13. package/dist/delivery/main.d.ts +34 -0
  14. package/dist/delivery/main.js +156 -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/_baseGetTag.js +10 -0
  21. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js +8 -0
  22. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
  23. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
  24. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
  25. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
  26. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js +8 -0
  27. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/debounce.js +50 -0
  28. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
  29. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
  30. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +9 -0
  31. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/now.js +7 -0
  32. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js +19 -0
  33. package/dist/print/index.d.ts +15 -0
  34. package/dist/print/index.js +34 -0
  35. package/package.json +57 -25
  36. package/CHANGELOG.json +0 -257
  37. package/CHANGELOG.md +0 -1707
  38. package/LICENSE.md +0 -5
  39. package/README.md +0 -3
  40. package/configure/CHANGELOG.json +0 -197
  41. package/configure/CHANGELOG.md +0 -1547
  42. package/configure/lib/defaults.js +0 -70
  43. package/configure/lib/defaults.js.map +0 -1
  44. package/configure/lib/index.js +0 -135
  45. package/configure/lib/index.js.map +0 -1
  46. package/configure/lib/main.js +0 -103
  47. package/configure/lib/main.js.map +0 -1
  48. package/configure/package.json +0 -23
  49. package/configure/src/__tests__/index.test.jsx +0 -192
  50. package/configure/src/defaults.js +0 -43
  51. package/configure/src/index.js +0 -139
  52. package/configure/src/main.jsx +0 -87
  53. package/controller/CHANGELOG.json +0 -17
  54. package/controller/CHANGELOG.md +0 -893
  55. package/controller/lib/defaults.js +0 -15
  56. package/controller/lib/defaults.js.map +0 -1
  57. package/controller/lib/index.js +0 -46
  58. package/controller/lib/index.js.map +0 -1
  59. package/controller/package.json +0 -12
  60. package/controller/src/__tests__/index.test.js +0 -33
  61. package/controller/src/defaults.js +0 -8
  62. package/controller/src/index.js +0 -41
  63. package/docs/config-schema.json +0 -712
  64. package/docs/config-schema.json.md +0 -532
  65. package/docs/demo/config.js +0 -8
  66. package/docs/demo/generate.js +0 -8
  67. package/docs/demo/index.html +0 -2
  68. package/docs/pie-schema.json +0 -391
  69. package/docs/pie-schema.json.md +0 -281
  70. package/lib/index.js +0 -52
  71. package/lib/index.js.map +0 -1
  72. package/lib/main.js +0 -208
  73. package/lib/main.js.map +0 -1
  74. package/lib/print.js +0 -71
  75. package/lib/print.js.map +0 -1
  76. package/module/configure.js +0 -1
  77. package/module/controller.js +0 -73
  78. package/module/demo.js +0 -33
  79. package/module/element.js +0 -1
  80. package/module/index.html +0 -21
  81. package/module/manifest.json +0 -14
  82. package/module/print-demo.js +0 -71
  83. package/module/print.html +0 -18
  84. package/module/print.js +0 -1
  85. package/src/__tests__/rubric-view.test.jsx +0 -37
  86. package/src/index.js +0 -48
  87. package/src/main.jsx +0 -226
  88. package/src/print.js +0 -74
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/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
+ declare const _default: {
10
+ model: {
11
+ points: string[];
12
+ sampleAnswers: null[];
13
+ maxPoints: number;
14
+ excludeZero: boolean;
15
+ excludeZeroEnabled: boolean;
16
+ maxPointsEnabled: boolean;
17
+ };
18
+ configuration: {
19
+ baseInputConfiguration: {
20
+ h3: {
21
+ disabled: boolean;
22
+ };
23
+ audio: {
24
+ disabled: boolean;
25
+ };
26
+ video: {
27
+ disabled: boolean;
28
+ };
29
+ image: {
30
+ disabled: boolean;
31
+ };
32
+ textAlign: {
33
+ disabled: boolean;
34
+ };
35
+ showParagraphs: {
36
+ disabled: boolean;
37
+ };
38
+ separateParagraphs: {
39
+ disabled: boolean;
40
+ };
41
+ };
42
+ rubriclessInstruction: {
43
+ inputConfiguration: {
44
+ audio: {
45
+ disabled: boolean;
46
+ };
47
+ video: {
48
+ disabled: boolean;
49
+ };
50
+ image: {
51
+ disabled: boolean;
52
+ };
53
+ };
54
+ };
55
+ showExcludeZero: {
56
+ settings: boolean;
57
+ label: string;
58
+ };
59
+ showMaxPoint: {
60
+ settings: boolean;
61
+ label: string;
62
+ };
63
+ settingsPanelDisabled: boolean;
64
+ mathMlOptions: {
65
+ mmlOutput: boolean;
66
+ mmlEditing: boolean;
67
+ };
68
+ maxMaxPoints: number;
69
+ };
70
+ };
71
+ export default _default;
@@ -0,0 +1,53 @@
1
+ //#region src/author/defaults.ts
2
+ var e = {
3
+ model: {
4
+ points: [
5
+ "",
6
+ "",
7
+ "",
8
+ ""
9
+ ],
10
+ sampleAnswers: [
11
+ null,
12
+ null,
13
+ null,
14
+ null
15
+ ],
16
+ maxPoints: 3,
17
+ excludeZero: !1,
18
+ excludeZeroEnabled: !0,
19
+ maxPointsEnabled: !0
20
+ },
21
+ configuration: {
22
+ baseInputConfiguration: {
23
+ h3: { disabled: !0 },
24
+ audio: { disabled: !1 },
25
+ video: { disabled: !1 },
26
+ image: { disabled: !1 },
27
+ textAlign: { disabled: !0 },
28
+ showParagraphs: { disabled: !1 },
29
+ separateParagraphs: { disabled: !0 }
30
+ },
31
+ rubriclessInstruction: { inputConfiguration: {
32
+ audio: { disabled: !1 },
33
+ video: { disabled: !1 },
34
+ image: { disabled: !1 }
35
+ } },
36
+ showExcludeZero: {
37
+ settings: !0,
38
+ label: "Ability to exclude zero"
39
+ },
40
+ showMaxPoint: {
41
+ settings: !0,
42
+ label: "Show max points dropdown"
43
+ },
44
+ settingsPanelDisabled: !1,
45
+ mathMlOptions: {
46
+ mmlOutput: !1,
47
+ mmlEditing: !1
48
+ },
49
+ maxMaxPoints: 9
50
+ }
51
+ };
52
+ //#endregion
53
+ export { e as default };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/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 RubricElement extends HTMLElement {
10
+ constructor();
11
+ updateModelAccordingToReceivedProps: any;
12
+ set model(m: any);
13
+ set configuration(c: any);
14
+ onModelChanged(m: any): void;
15
+ onConfigurationChanged: any;
16
+ insertImage(handler: any): void;
17
+ onDeleteImage(src: any, done: any): void;
18
+ connectedCallback(): void;
19
+ _render(): void;
20
+ disconnectedCallback(): void;
21
+ }
@@ -0,0 +1,72 @@
1
+ import e from "./main.js";
2
+ import t from "./defaults.js";
3
+ import n from "react";
4
+ import { createRoot as r } from "react-dom/client";
5
+ import i from "debug";
6
+ import { DeleteImageEvent as a, InsertImageEvent as o, ModelUpdatedEvent as s } from "@pie-element/shared-configure-events";
7
+ //#region src/author/index.ts
8
+ var c = (e) => ({
9
+ ...t.model,
10
+ ...e
11
+ }), l = (e) => ({
12
+ ...t.configuration,
13
+ ...e
14
+ }), u = class extends HTMLElement {
15
+ constructor() {
16
+ super(), this._root = null, i.log("constructor called"), this._model = c(), this._configuration = l(), this.onModelChanged = this.onModelChanged.bind(this), this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
17
+ }
18
+ updateModelAccordingToReceivedProps = (e) => {
19
+ let t = { ...this._model };
20
+ if (!e) return t;
21
+ let n = { ...e };
22
+ n.maxPoints === 1 && (n.excludeZero = !1);
23
+ let { maxPoints: r, excludeZero: i } = n || {};
24
+ n.points = n.points ? [...n.points] : [], n.sampleAnswers = n.sampleAnswers ? [...n.sampleAnswers] : [];
25
+ let a = i ? r : r + 1, o = n.points.length, s = t?.excludeZero !== e?.excludeZero, c = t?.maxPoints !== e?.maxPoints;
26
+ if (o < a) {
27
+ if (s && !i && (n.points = ["", ...n.points], n.sampleAnswers = [null, ...n.sampleAnswers]), c) for (let e = 0; e < a - o; e++) n.points.push(""), n.sampleAnswers.push(null);
28
+ } else o > a && (s && i && (n.points = n.points.slice(1), n.sampleAnswers = n.sampleAnswers.slice(1)), c && (n.points = n.points.slice(0, a), n.sampleAnswers = n.sampleAnswers.slice(0, a)));
29
+ return n;
30
+ };
31
+ set model(e) {
32
+ this._model = this.updateModelAccordingToReceivedProps(c(e)), this._render();
33
+ }
34
+ set configuration(e) {
35
+ this._configuration = l(e), this._render();
36
+ }
37
+ onModelChanged(e) {
38
+ this._model = this.updateModelAccordingToReceivedProps(e), this._render(), this.dispatchEvent(new s(this._model, !1));
39
+ }
40
+ onConfigurationChanged = (e) => {
41
+ this._configuration = l(e), this._model && this.onModelChanged(this._model), this._render();
42
+ };
43
+ insertImage(e) {
44
+ this.dispatchEvent(new o(e));
45
+ }
46
+ onDeleteImage(e, t) {
47
+ this.dispatchEvent(new a(e, t));
48
+ }
49
+ connectedCallback() {
50
+ this._render();
51
+ }
52
+ _render() {
53
+ if (this._model) {
54
+ let t = n.createElement(e, {
55
+ model: this._model,
56
+ configuration: this._configuration,
57
+ onModelChanged: this.onModelChanged,
58
+ onConfigurationChanged: this.onConfigurationChanged,
59
+ imageSupport: {
60
+ add: this.insertImage.bind(this),
61
+ delete: this.onDeleteImage.bind(this)
62
+ }
63
+ });
64
+ this._root ||= r(this), this._root.render(t);
65
+ }
66
+ }
67
+ disconnectedCallback() {
68
+ this._root && this._root.unmount();
69
+ }
70
+ };
71
+ //#endregion
72
+ export { u as default };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/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
+ declare class Main extends React.Component {
11
+ verifyRubriclessModel: any;
12
+ render(): React.JSX.Element;
13
+ }
14
+ export default Main;
@@ -0,0 +1,51 @@
1
+ import e from "react";
2
+ import { styled as t } from "@mui/material/styles";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ import { Authoring as r } from "@pie-lib/rubric";
5
+ import { layout as i, settings as a } from "@pie-lib/config-ui";
6
+ //#region src/author/main.tsx
7
+ var { Panel: o, toggle: s } = a, c = t("div")(({ theme: e, width: t }) => ({
8
+ maxWidth: t,
9
+ fontFamily: "Cerebri Sans",
10
+ fontSize: e.typography.fontSize
11
+ })), l = class extends e.Component {
12
+ verifyRubriclessModel = (e, t) => {
13
+ let { rubricless: n = !1 } = t || {};
14
+ return n ? (({ points: e, sampleAnswers: t, ...n }) => n)(e) : e;
15
+ };
16
+ render() {
17
+ let { model: e, configuration: t, onConfigurationChanged: a, onModelChanged: l, imageSupport: u } = this.props || {}, { baseInputConfiguration: d = {}, contentDimensions: f = {}, settingsPanelDisabled: p, showExcludeZero: m = {}, showMaxPoint: h = {}, mathMlOptions: g = {}, rubricless: _ = !1, rubriclessInstruction: v, width: y } = t || {}, b = this.verifyRubriclessModel(e, t), { extraCSSRules: x } = e, S = {
18
+ excludeZeroEnabled: m.settings && s(m.label),
19
+ maxPointsEnabled: h.settings && s(h.label),
20
+ rubriclessInstructionEnabled: _ && v.settings && s(v.label)
21
+ };
22
+ return /* @__PURE__ */ n(i.ConfigLayout, {
23
+ extraCSSRules: x,
24
+ dimensions: f,
25
+ hideSettings: p,
26
+ settings: /* @__PURE__ */ n(o, {
27
+ model: e,
28
+ onChangeModel: l,
29
+ configuration: t,
30
+ onChangeConfiguration: a,
31
+ pluginOpts: ((e) => Object.assign({ ...d }, e || {}))(v?.inputConfiguration),
32
+ groups: { Properties: S },
33
+ imageSupport: u
34
+ }),
35
+ children: /* @__PURE__ */ n(c, {
36
+ width: y,
37
+ children: /* @__PURE__ */ n(r, {
38
+ value: b,
39
+ config: t,
40
+ onChange: l,
41
+ mathMlOptions: g,
42
+ rubricless: _,
43
+ pluginOpts: d,
44
+ imageSupport: u
45
+ })
46
+ })
47
+ });
48
+ }
49
+ };
50
+ //#endregion
51
+ export { l as default };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/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 _default: {
10
+ points: string[];
11
+ sampleAnswers: null[];
12
+ maxPoints: number;
13
+ maxPointsEnabled: boolean;
14
+ excludeZero: boolean;
15
+ excludeZeroEnabled: boolean;
16
+ };
17
+ export default _default;
@@ -0,0 +1,21 @@
1
+ //#region src/controller/defaults.ts
2
+ var e = {
3
+ points: [
4
+ "",
5
+ "",
6
+ "",
7
+ ""
8
+ ],
9
+ sampleAnswers: [
10
+ null,
11
+ null,
12
+ null,
13
+ null
14
+ ],
15
+ maxPoints: 3,
16
+ maxPointsEnabled: !0,
17
+ excludeZero: !1,
18
+ excludeZeroEnabled: !0
19
+ };
20
+ //#endregion
21
+ export { e as default };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/rubric/controller/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 declare function model(model: any, session: any, env: any): Promise<unknown>;
10
+ export declare function validate(model: any): {};
@@ -0,0 +1,23 @@
1
+ import e from "./defaults.js";
2
+ //#region src/controller/index.ts
3
+ var t = (t) => ({
4
+ ...e,
5
+ ...t
6
+ });
7
+ function n(e, n, r) {
8
+ return new Promise((n) => {
9
+ let i = t(e || {});
10
+ n(r && r.role && r.role === "instructor" ? i : {});
11
+ });
12
+ }
13
+ function r(e) {
14
+ return (e || "").replace(/(<([^>]+)>)/gi, "");
15
+ }
16
+ function i(e) {
17
+ let { points: t } = e, n = {}, i = {};
18
+ return (t || []).forEach((e, n) => {
19
+ !e || e === "<div></div>" ? i[n] = "Points descriptors cannot be empty." : t.slice(n + 1).some((t) => r(t) === r(e)) && (i[n] = "Points descriptors should be unique.");
20
+ }), Object.keys(i).length > 0 && (n.pointsDescriptorsErrors = i), n;
21
+ }
22
+ //#endregion
23
+ export { n as model, i as validate };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/rubric/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 RubricRender extends HTMLElement {
10
+ constructor();
11
+ set model(s: any);
12
+ onModelChanged(m: any): void;
13
+ connectedCallback(): void;
14
+ _render(): void;
15
+ disconnectedCallback(): void;
16
+ }
@@ -0,0 +1,33 @@
1
+ import e from "./main.js";
2
+ import t from "react";
3
+ import { createRoot as n } from "react-dom/client";
4
+ import r from "debug";
5
+ import { renderMath as i } from "@pie-element/shared-math-rendering-mathjax";
6
+ //#region src/delivery/index.ts
7
+ var a = class extends HTMLElement {
8
+ constructor() {
9
+ super(), r.log("constructor called"), this.onModelChanged = this.onModelChanged.bind(this), this._root = null;
10
+ }
11
+ set model(e) {
12
+ this._model = e, this._render();
13
+ }
14
+ onModelChanged(e) {
15
+ this._model = e, this._render();
16
+ }
17
+ connectedCallback() {
18
+ this._render();
19
+ }
20
+ _render() {
21
+ if (this._model) {
22
+ let r = t.createElement(e, { value: this._model });
23
+ this._root ||= n(this), this._root.render(r), queueMicrotask(() => {
24
+ i(this);
25
+ });
26
+ }
27
+ }
28
+ disconnectedCallback() {
29
+ this._root && this._root.unmount();
30
+ }
31
+ };
32
+ //#endregion
33
+ export { a as default };
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @synced-from pie-elements/packages/rubric/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 const RubricType: PropTypes.Requireable<PropTypes.InferProps<{
12
+ excludeZero: PropTypes.Requireable<boolean>;
13
+ points: PropTypes.Requireable<(string | null | undefined)[]>;
14
+ sampleAnswers: PropTypes.Requireable<(string | null | undefined)[]>;
15
+ animationsDisabled: PropTypes.Requireable<boolean>;
16
+ }>>;
17
+ declare class Rubric extends React.Component {
18
+ dudUrl: string;
19
+ constructor(props: any);
20
+ static propTypes: {
21
+ model: PropTypes.Validator<object>;
22
+ animationsDisabled: PropTypes.Requireable<boolean>;
23
+ value: PropTypes.Requireable<PropTypes.InferProps<{
24
+ excludeZero: PropTypes.Requireable<boolean>;
25
+ points: PropTypes.Requireable<(string | null | undefined)[]>;
26
+ sampleAnswers: PropTypes.Requireable<(string | null | undefined)[]>;
27
+ animationsDisabled: PropTypes.Requireable<boolean>;
28
+ }>>;
29
+ };
30
+ toggleRubric(): void;
31
+ shouldRenderPoint: any;
32
+ render(): React.JSX.Element | null;
33
+ }
34
+ export default Rubric;
@@ -0,0 +1,156 @@
1
+ import e from "react";
2
+ import { styled as t } from "@mui/material/styles";
3
+ import n from "@mui/material/ListItem";
4
+ import r from "@mui/material/List";
5
+ import i from "@mui/material/Collapse";
6
+ import * as a from "@pie-lib/render-ui";
7
+ import { UiLayout as o, color as s } from "@pie-lib/render-ui";
8
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
+ import u from "prop-types";
10
+ //#region src/delivery/main.tsx
11
+ function d(e) {
12
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
13
+ }
14
+ function f(e, t) {
15
+ return !e || d(e) ? e : d(e.default) ? e.default : t && d(e[t]) ? e[t] : t && d(e[t]?.default) ? e[t].default : e;
16
+ }
17
+ var p = f(o, "UiLayout") || f(g.UiLayout, "UiLayout"), m = a, h = m.default, g = h && typeof h == "object" ? h : m, _ = t(p)({
18
+ color: s.text(),
19
+ backgroundColor: s.background(),
20
+ "&:not(.MathJax) table": { borderCollapse: "collapse" },
21
+ "&:not(.MathJax) table td, &:not(.MathJax) table th": {
22
+ padding: "8px 12px",
23
+ textAlign: "left"
24
+ },
25
+ "& ul p, & ol p": {
26
+ marginBottom: 0,
27
+ marginTop: 0,
28
+ lineHeight: "normal"
29
+ }
30
+ }), v = t(n)({
31
+ display: "flex",
32
+ flexDirection: "column",
33
+ alignItems: "flex-start",
34
+ padding: "12px 0px"
35
+ }), y = t("div")({ color: s.text() }), b = t("h3")({
36
+ color: s.text(),
37
+ fontSize: "16px",
38
+ fontWeight: "700",
39
+ margin: 0,
40
+ paddingBottom: "6px"
41
+ }), x = t("h4")({
42
+ color: s.text(),
43
+ fontSize: "16px",
44
+ fontWeight: "normal",
45
+ margin: 0,
46
+ paddingBottom: "6px"
47
+ }), S = t("h2")(({ theme: e }) => ({
48
+ display: "flex",
49
+ alignItems: "center",
50
+ cursor: "pointer",
51
+ userSelect: "none",
52
+ fontSize: e.typography.fontSize,
53
+ fontWeight: "500",
54
+ color: s.tertiary(),
55
+ margin: 0
56
+ })), C = t("span")({
57
+ display: "inline-flex",
58
+ transition: "transform 0.2s",
59
+ marginLeft: 2,
60
+ alignSelf: "center"
61
+ }), w = t("h2")({
62
+ position: "absolute",
63
+ width: "1px",
64
+ height: "1px",
65
+ padding: 0,
66
+ margin: "-1px",
67
+ overflow: "hidden",
68
+ clip: "rect(0,0,0,0)",
69
+ border: 0,
70
+ whiteSpace: "nowrap"
71
+ }), T = u.shape({
72
+ excludeZero: u.bool,
73
+ points: u.arrayOf(u.string),
74
+ sampleAnswers: u.arrayOf(u.string),
75
+ animationsDisabled: u.bool
76
+ }), E = class extends e.Component {
77
+ dudUrl = "javascript:;";
78
+ constructor(e) {
79
+ super(e), this.state = {
80
+ rubricOpen: !1,
81
+ linkPrefix: "Show"
82
+ }, this.toggleRubric = this.toggleRubric.bind(this);
83
+ }
84
+ static propTypes = {
85
+ model: u.object.isRequired,
86
+ animationsDisabled: u.bool,
87
+ value: T
88
+ };
89
+ toggleRubric() {
90
+ this.setState({ rubricOpen: !this.state.rubricOpen }), this.setState({ linkPrefix: this.state.rubricOpen ? "Show" : "Hide" });
91
+ }
92
+ shouldRenderPoint = (e, t) => t.excludeZero ? e !== 0 : !0;
93
+ render() {
94
+ let { model: t, value: n } = this.props, { animationsDisabled: a } = this.props;
95
+ if (a ||= n.animationsDisabled, n && n.points) {
96
+ let { extraCSSRules: o } = t || {}, { points: s, sampleAnswers: u } = n, d = /* @__PURE__ */ c(r, {
97
+ component: "nav",
98
+ children: s.slice(0).reverse().map((t, r) => {
99
+ r = s.length - r - 1;
100
+ let i = n.excludeZero ? r + 1 : r;
101
+ return /* @__PURE__ */ l(e.Fragment, { children: [/* @__PURE__ */ l(v, { children: [/* @__PURE__ */ c(b, { children: i === 1 ? `${i} PT` : `${i} PTS` }), /* @__PURE__ */ c(y, { dangerouslySetInnerHTML: { __html: t } })] }, `P${r}`), u && u[r] && /* @__PURE__ */ l(v, { children: [/* @__PURE__ */ c(x, { children: "Sample Answer" }), /* @__PURE__ */ c(y, { dangerouslySetInnerHTML: { __html: u[r] } })] }, `S${r}`)] }, r);
102
+ })
103
+ });
104
+ return /* @__PURE__ */ l(_, {
105
+ extraCSSRules: o,
106
+ children: [/* @__PURE__ */ c(w, { children: "Rubric" }), a ? d : /* @__PURE__ */ l(e.Fragment, { children: [/* @__PURE__ */ l(S, {
107
+ id: "rubric-toggle",
108
+ tabIndex: 0,
109
+ role: "button",
110
+ "aria-expanded": this.state.rubricOpen,
111
+ onClick: this.toggleRubric,
112
+ onKeyPress: (e) => {
113
+ (e.key === "Enter" || e.key === " ") && this.toggleRubric();
114
+ },
115
+ children: [
116
+ this.state.linkPrefix,
117
+ " Rubric",
118
+ /* @__PURE__ */ c(C, {
119
+ "aria-hidden": "true",
120
+ children: this.state.rubricOpen ? /* @__PURE__ */ c("svg", {
121
+ width: "20",
122
+ height: "20",
123
+ viewBox: "0 0 24 24",
124
+ fill: "none",
125
+ stroke: "currentColor",
126
+ strokeWidth: "2",
127
+ strokeLinecap: "round",
128
+ strokeLinejoin: "round",
129
+ children: /* @__PURE__ */ c("polyline", { points: "18 15 12 9 6 15" })
130
+ }) : /* @__PURE__ */ c("svg", {
131
+ width: "20",
132
+ height: "20",
133
+ viewBox: "0 0 24 24",
134
+ fill: "none",
135
+ stroke: "currentColor",
136
+ strokeWidth: "2",
137
+ strokeLinecap: "round",
138
+ strokeLinejoin: "round",
139
+ children: /* @__PURE__ */ c("polyline", { points: "6 9 12 15 18 9" })
140
+ })
141
+ })
142
+ ]
143
+ }), /* @__PURE__ */ c(i, {
144
+ in: this.state.rubricOpen,
145
+ timeout: {
146
+ enter: 225,
147
+ exit: 195
148
+ },
149
+ children: d
150
+ })] })]
151
+ });
152
+ } else return null;
153
+ }
154
+ };
155
+ //#endregion
156
+ export { E as default };
@@ -0,0 +1 @@
1
+ export { default } from './delivery/index.js';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * IIFE entry point for rubric element
3
+ * This file is only used for IIFE builds and includes auto-registration
4
+ *
5
+ * @sync-generated - Auto-generated during sync from pie-elements
6
+ */
7
+ import Element from './index.js';
8
+ export default Element;