@pie-element/multi-trait-rubric 8.1.2-next.1 → 8.1.2-next.11
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.
- package/dist/author/index.d.ts +1 -0
- package/dist/author/index.js +5 -2
- package/dist/author/main.js +2 -2
- package/dist/author/scale.js +2 -2
- package/dist/author/traitsHeader.js +1 -1
- package/dist/browser/{Typography-CdgSBeUZ.js → Typography-smriu_fg.js} +1806 -1788
- package/dist/browser/Typography-smriu_fg.js.map +1 -0
- package/dist/browser/author/index.js +24961 -22144
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/controller/index.js.map +1 -1
- package/dist/browser/delivery/index.js +25 -7
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/delivery/index.d.ts +3 -0
- package/dist/delivery/index.js +24 -6
- package/dist/index.iife.js +31 -31
- package/package.json +15 -16
- package/dist/browser/Typography-CdgSBeUZ.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/controller/defaults.ts","../../../src/controller/utils.ts","../../../src/controller/index.ts"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multi-trait-rubric/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport default {\n addScaleEnabled: true,\n description: false,\n excludeZero: false,\n halfScoring: false,\n maxPointsEnabled: true,\n pointLabels: true,\n scales: [],\n standards: false,\n visibleToStudent: true,\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multi-trait-rubric/controller/src/utils.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport const markupToText = (s) => {\n return (s || '').replace(/(<([^>]+)>)/ig, '');\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multi-trait-rubric/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport defaults from './defaults.js';\nimport { markupToText } from './utils.js';\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => resolve({ ...defaults, ...model }));\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n\n if (!env.role || env.role === 'student') {\n normalizedQuestion.visible = normalizedQuestion.visibleToStudent;\n } else {\n normalizedQuestion.visible = true;\n }\n\n // todo update pie-ui instead of parsing this here:\n const { scales, excludeZero } = normalizedQuestion || {};\n const parsedScales = (scales || []).map((scale) => ({ ...scale, excludeZero }));\n\n return {\n ...normalizedQuestion,\n scales: parsedScales,\n };\n}\n\nexport const getScore = () => 0;\n\n/**\n * @param {Object} model - the main model\n * @param {*} session\n * @param {Object} env\n */\nexport function outcome() {\n return new Promise((resolve) => resolve({ score: 0, empty: true }));\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({ id: '1' });\n } else {\n resolve(null);\n }\n });\n};\n\n// IMPORTANT! If you make any changes to this function, please make sure you also update complex-rubric/controller/validateMultiTraitRubric function!“.\nexport const validate = (model, config) => {\n const { scales, description = false, pointLabels = false } = model;\n const errors = {};\n const traitsErrors = {};\n const scorePointsErrors = {};\n\n (scales || []).forEach((scale, scaleIndex) => {\n const { traits = [] } = scale;\n const { scorePointsLabels = [] } = scale;\n const scaleErrors = {};\n const scorePointsLabelsErrors = {};\n\n if (pointLabels) {\n scorePointsLabels.forEach((scorePointLabel, scoreIndex) => {\n if (!scorePointLabel || scorePointLabel === '<div></div>') {\n scorePointsLabelsErrors[scoreIndex] = 'Points labels should not be empty.';\n } else {\n const identicalScorePointLabel = scorePointsLabels\n .slice(scoreIndex + 1)\n .some((s) => markupToText(s) === markupToText(scorePointLabel));\n\n if (identicalScorePointLabel) {\n scorePointsLabelsErrors[scoreIndex] = 'Points labels should be unique.';\n }\n }\n });\n }\n\n if (Object.keys(scorePointsLabelsErrors).length > 0) {\n scorePointsErrors[scaleIndex] = scorePointsLabelsErrors;\n }\n\n traits.forEach((trait, traitIndex) => {\n if (!trait.name || trait.name === '<div></div>') {\n scaleErrors[traitIndex] = { name: 'Trait names should not be empty.' };\n } else {\n const identicalTraitName = traits\n .slice(traitIndex + 1)\n .some((t) => markupToText(t.name) === markupToText(trait.name));\n\n if (identicalTraitName) {\n scaleErrors[traitIndex] = { name: 'Trait names should be unique.' };\n }\n }\n if (description && (!trait.description || trait.description === '<div></div>')) {\n scaleErrors[traitIndex] = { ...scaleErrors[traitIndex], description: 'Trait description should not be empty' };\n } else {\n const identicalTraitDescr = traits\n .slice(traitIndex + 1)\n .some((t) => markupToText(t.description) === markupToText(trait.description));\n\n if (description && identicalTraitDescr) {\n scaleErrors[traitIndex] = { ...scaleErrors[traitIndex], description: 'Trait descriptions should be unique.' };\n }\n }\n });\n if (Object.keys(scaleErrors).length > 0) {\n traitsErrors[scaleIndex] = scaleErrors;\n }\n });\n\n if (Object.keys(traitsErrors).length > 0) {\n errors.traitsErrors = traitsErrors;\n }\n\n if (Object.keys(scorePointsErrors).length > 0) {\n errors.scorePointsErrors = scorePointsErrors;\n }\n\n return errors;\n};\n"],"mappings":";AAUA,IAAA,IAAe;CACb,iBAAiB;CACjB,aAAa;CACb,aAAa;CACb,aAAa;CACb,kBAAkB;CAClB,aAAa;CACb,QAAQ,CAAC;CACT,WAAW;CACX,kBAAkB;AACpB,GCVa,KAAgB,OACjB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/controller/defaults.ts","../../../src/controller/utils.ts","../../../src/controller/index.ts"],"sourcesContent":["// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multi-trait-rubric/controller/src/defaults.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport default {\n addScaleEnabled: true,\n description: false,\n excludeZero: false,\n halfScoring: false,\n maxPointsEnabled: true,\n pointLabels: true,\n scales: [],\n standards: false,\n visibleToStudent: true,\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multi-trait-rubric/controller/src/utils.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nexport const markupToText = (s) => {\n return (s || '').replace(/(<([^>]+)>)/ig, '');\n};\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multi-trait-rubric/controller/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport defaults from './defaults.js';\nimport { markupToText } from './utils.js';\n\nexport function createDefaultModel(model = {}) {\n return new Promise((resolve) => resolve({ ...defaults, ...model }));\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\n/**\n *\n * @param {*} question\n * @param {*} session\n * @param {*} env\n */\nexport async function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n\n if (!env.role || env.role === 'student') {\n normalizedQuestion.visible = normalizedQuestion.visibleToStudent;\n } else {\n normalizedQuestion.visible = true;\n }\n\n // todo update pie-ui instead of parsing this here:\n const { scales, excludeZero } = normalizedQuestion || {};\n const parsedScales = (scales || []).map((scale) => ({ ...scale, excludeZero }));\n\n return {\n ...normalizedQuestion,\n scales: parsedScales,\n };\n}\n\nexport const getScore = () => 0;\n\n/**\n * @param {Object} model - the main model\n * @param {*} session\n * @param {Object} env\n */\nexport function outcome() {\n return new Promise((resolve) => resolve({ score: 0, empty: true }));\n}\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({ id: '1' });\n } else {\n resolve(null);\n }\n });\n};\n\n// IMPORTANT! If you make any changes to this function, please make sure you also update complex-rubric/controller/validateMultiTraitRubric function!“.\nexport const validate = (model, config) => {\n const { scales, description = false, pointLabels = false } = model;\n const errors = {};\n const traitsErrors = {};\n const scorePointsErrors = {};\n\n (scales || []).forEach((scale, scaleIndex) => {\n const { traits = [] } = scale;\n const { scorePointsLabels = [] } = scale;\n const scaleErrors = {};\n const scorePointsLabelsErrors = {};\n\n if (pointLabels) {\n scorePointsLabels.forEach((scorePointLabel, scoreIndex) => {\n if (!scorePointLabel || scorePointLabel === '<div></div>') {\n scorePointsLabelsErrors[scoreIndex] = 'Points labels should not be empty.';\n } else {\n const identicalScorePointLabel = scorePointsLabels\n .slice(scoreIndex + 1)\n .some((s) => markupToText(s) === markupToText(scorePointLabel));\n\n if (identicalScorePointLabel) {\n scorePointsLabelsErrors[scoreIndex] = 'Points labels should be unique.';\n }\n }\n });\n }\n\n if (Object.keys(scorePointsLabelsErrors).length > 0) {\n scorePointsErrors[scaleIndex] = scorePointsLabelsErrors;\n }\n\n traits.forEach((trait, traitIndex) => {\n if (!trait.name || trait.name === '<div></div>') {\n scaleErrors[traitIndex] = { name: 'Trait names should not be empty.' };\n } else {\n const identicalTraitName = traits\n .slice(traitIndex + 1)\n .some((t) => markupToText(t.name) === markupToText(trait.name));\n\n if (identicalTraitName) {\n scaleErrors[traitIndex] = { name: 'Trait names should be unique.' };\n }\n }\n if (description && (!trait.description || trait.description === '<div></div>')) {\n scaleErrors[traitIndex] = { ...scaleErrors[traitIndex], description: 'Trait description should not be empty' };\n } else {\n const identicalTraitDescr = traits\n .slice(traitIndex + 1)\n .some((t) => markupToText(t.description) === markupToText(trait.description));\n\n if (description && identicalTraitDescr) {\n scaleErrors[traitIndex] = { ...scaleErrors[traitIndex], description: 'Trait descriptions should be unique.' };\n }\n }\n });\n if (Object.keys(scaleErrors).length > 0) {\n traitsErrors[scaleIndex] = scaleErrors;\n }\n });\n\n if (Object.keys(traitsErrors).length > 0) {\n errors.traitsErrors = traitsErrors;\n }\n\n if (Object.keys(scorePointsErrors).length > 0) {\n errors.scorePointsErrors = scorePointsErrors;\n }\n\n return errors;\n};\n"],"mappings":";AAUA,IAAA,IAAe;CACb,iBAAiB;CACjB,aAAa;CACb,aAAa;CACb,aAAa;CACb,kBAAkB;CAClB,aAAa;CACb,QAAQ,CAAC;CACT,WAAW;CACX,kBAAkB;AACpB,GCVa,KAAgB,OACjB,KAAK,GAAA,CAAI,QAAQ,iBAAiB,EAAE;;;ACEhD,SAAgB,EAAmB,IAAQ,CAAC,GAAG;CAC7C,OAAO,IAAI,SAAS,MAAY,EAAQ;EAAE,GAAG;EAAU,GAAG;CAAM,CAAC,CAAC;AACpE;AAEA,IAAa,KAAa,OAAc;CAAE,GAAG;CAAU,GAAG;AAAS;AAQnE,eAAsB,EAAM,GAAU,GAAS,GAAK;CAClD,IAAM,IAAqB,EAAU,CAAQ;CAE7C,AAAI,CAAC,EAAI,QAAQ,EAAI,SAAS,YAC5B,EAAmB,UAAU,EAAmB,mBAEhD,EAAmB,UAAU;CAI/B,IAAM,EAAE,WAAQ,mBAAgB,KAAsB,CAAC,GACjD,KAAgB,KAAU,CAAC,EAAA,CAAG,KAAK,OAAW;EAAE,GAAG;EAAO;CAAY,EAAE;CAE9E,OAAO;EACL,GAAG;EACH,QAAQ;CACV;AACF;AAEA,IAAa,UAAiB;AAO9B,SAAgB,IAAU;CACxB,OAAO,IAAI,SAAS,MAAY,EAAQ;EAAE,OAAO;EAAG,OAAO;CAAK,CAAC,CAAC;AACpE;AAEA,IAAa,KAAgC,GAAU,MAC9C,IAAI,SAAS,MAAY;CAC9B,AAAI,EAAI,SAAS,cAAc,EAAI,SAAS,eAC1C,EAAQ,EAAE,IAAI,IAAI,CAAC,IAEn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C,EAAa,KAAc;CAE/B,CAAC,GAEG,OAAO,KAAK,CAAY,CAAC,CAAC,SAAS,MACrC,EAAO,eAAe,IAGpB,OAAO,KAAK,CAAiB,CAAC,CAAC,SAAS,MAC1C,EAAO,oBAAoB,IAGtB;AACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as e, E as t, Et as n, H as r, P as i, _ as a, _t as o, bt as s, ft as c, ht as l, i as u, it as d, kt as f, lt as p, n as m, ot as h, r as g, t as _, tt as v, vt as y, w as b, x, yt as S } from "../Typography-
|
|
1
|
+
import { C as e, E as t, Et as n, H as r, P as i, _ as a, _t as o, bt as s, ft as c, ht as l, i as u, it as d, kt as f, lt as p, n as m, ot as h, r as g, t as _, tt as v, vt as y, w as b, x, yt as S } from "../Typography-smriu_fg.js";
|
|
2
2
|
import * as C from "react";
|
|
3
3
|
import w from "react";
|
|
4
4
|
import { createRoot as T } from "react-dom/client";
|
|
@@ -490,7 +490,26 @@ $.propTypes = {
|
|
|
490
490
|
//#region src/delivery/index.ts
|
|
491
491
|
var te = class extends HTMLElement {
|
|
492
492
|
constructor() {
|
|
493
|
-
super(), this._model = {}, this._session = null, this._root = null;
|
|
493
|
+
super(), this._model = {}, this._session = null, this._root = null, this._mathObserver = null, this._mathRenderPending = !1;
|
|
494
|
+
}
|
|
495
|
+
_scheduleMathRender = () => {
|
|
496
|
+
this._mathRenderPending || (this._mathRenderPending = !0, requestAnimationFrame(() => {
|
|
497
|
+
this._mathObserver && this._mathObserver.disconnect(), b(this), this._mathRenderPending = !1, setTimeout(() => {
|
|
498
|
+
this._mathObserver && this._mathObserver.observe(this, {
|
|
499
|
+
childList: !0,
|
|
500
|
+
subtree: !0
|
|
501
|
+
});
|
|
502
|
+
}, 50);
|
|
503
|
+
}));
|
|
504
|
+
};
|
|
505
|
+
_initMathObserver() {
|
|
506
|
+
this._mathObserver || (this._mathObserver = new MutationObserver(this._scheduleMathRender), this._mathObserver.observe(this, {
|
|
507
|
+
childList: !0,
|
|
508
|
+
subtree: !0
|
|
509
|
+
}));
|
|
510
|
+
}
|
|
511
|
+
_disconnectMathObserver() {
|
|
512
|
+
this._mathObserver &&= (this._mathObserver.disconnect(), null);
|
|
494
513
|
}
|
|
495
514
|
set model(e) {
|
|
496
515
|
this._model = e, this.dispatchEvent(new O(this.tagName.toLowerCase(), this._session, !!this._model)), this._render();
|
|
@@ -502,19 +521,18 @@ var te = class extends HTMLElement {
|
|
|
502
521
|
return this._session;
|
|
503
522
|
}
|
|
504
523
|
connectedCallback() {
|
|
505
|
-
this._render();
|
|
524
|
+
this._initMathObserver(), this._render();
|
|
506
525
|
}
|
|
507
526
|
_render() {
|
|
527
|
+
this._initMathObserver();
|
|
508
528
|
let e = w.createElement($, {
|
|
509
529
|
model: this._model,
|
|
510
530
|
session: this._session
|
|
511
531
|
});
|
|
512
|
-
this._root ||= T(this), this._root.render(e)
|
|
513
|
-
b(this);
|
|
514
|
-
});
|
|
532
|
+
this._root ||= T(this), this._root.render(e);
|
|
515
533
|
}
|
|
516
534
|
disconnectedCallback() {
|
|
517
|
-
this._root
|
|
535
|
+
this._disconnectMathObserver(), this._root &&= (this._root.unmount(), null);
|
|
518
536
|
}
|
|
519
537
|
};
|
|
520
538
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["capitalize","React"],"sources":["../../../../../shared/player-events/dist/index.js","../../../src/delivery/trait.tsx","../../../src/delivery/scale.tsx","../../../../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/Link/linkClasses.js","../../../../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/Link/getTextDecoration.js","../../../../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/Link/Link.js","../../../src/delivery/main.tsx","../../../src/delivery/index.ts"],"sourcesContent":["//#region src/index.ts\nvar e = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"model-set\";\n\t}\n\tconstructor(t, n, r) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t,\n\t\t\t\thasModel: r\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n}, t = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"session-changed\";\n\t}\n\tconstructor(t, n) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n};\n//#endregion\nexport { e as ModelSetEvent, t as SessionChangedEvent };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multi-trait-rubric/src/trait.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { color } from '@pie-lib/render-ui';\n\nconst TraitName: any = styled('td')({\n color: color.primaryDark(),\n verticalAlign: 'middle',\n});\n\nconst NoDescription: any = styled('div')({\n color: color.secondaryBackground(),\n textAlign: 'center',\n});\n\nconst Trait = (props) => {\n const { trait, traitIndex, scaleIndex, showStandards, showDescription, scorePointsValues } = props;\n const { name, standards, scorePointsDescriptors, description } = trait || {};\n\n return (\n <tr key={`scale-${scaleIndex}-trait-${traitIndex}`}>\n <TraitName>\n <div dangerouslySetInnerHTML={{ __html: name }} />\n </TraitName>\n\n {showStandards ? (\n <td>\n <div dangerouslySetInnerHTML={{ __html: standards.join(',') }} />\n </td>\n ) : null}\n\n {showDescription ? (\n <td>\n <div dangerouslySetInnerHTML={{ __html: description }} />\n </td>\n ) : null}\n\n {scorePointsValues &&\n scorePointsValues.map((scorePointValue, index) => {\n let scoreDescriptor;\n\n try {\n scoreDescriptor = scorePointsDescriptors[scorePointsValues.length - index - 1] || '';\n } catch (e) {\n scoreDescriptor = '';\n }\n\n return (\n <td key={`table-cell-${index}`}>\n {!scoreDescriptor ? (\n <NoDescription dangerouslySetInnerHTML={{ __html: 'No Description' }} />\n ) : (\n <div dangerouslySetInnerHTML={{ __html: scoreDescriptor }} />\n )}\n </td>\n );\n })}\n </tr>\n );\n};\n\nTrait.propTypes = {\n showStandards: PropTypes.bool,\n showDescription: PropTypes.bool,\n scorePointsValues: PropTypes.arrayOf(PropTypes.number),\n scaleIndex: PropTypes.number,\n traitIndex: PropTypes.number,\n trait: PropTypes.shape({\n name: PropTypes.string,\n standards: PropTypes.arrayOf(PropTypes.string),\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n description: PropTypes.string,\n }),\n};\n\nexport default Trait;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multi-trait-rubric/src/scale.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { color } from '@pie-lib/render-ui';\nimport Trait from './trait.js';\nimport ArrowBackIosIcon from '@mui/icons-material/ArrowBackIos';\nimport ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';\n\nconst Wrapper: any = styled('div')({\n display: 'flex',\n position: 'relative',\n});\n\nconst TableWrapper: any = styled('div')({\n width: '100%',\n overflow: 'auto',\n});\n\nconst Table: any = styled('table')(({ theme }) => ({\n borderSpacing: 0,\n marginBottom: theme.spacing(2),\n borderRadius: '4px',\n color: color.text(),\n fontSize: theme.typography.fontSize,\n lineHeight: '16px',\n overflow: 'unset',\n\n '& ul, ol': {\n marginBlockStart: 0,\n paddingInlineStart: theme.spacing(2),\n },\n\n '& th': {\n padding: theme.spacing(2),\n textAlign: 'left',\n backgroundColor: color.secondaryBackground(),\n verticalAlign: 'bottom',\n },\n\n '& th div': {\n width: '200px',\n },\n\n '& td': {\n width: '200px',\n padding: `${theme.spacing(2)} ${theme.spacing(1)}`,\n verticalAlign: 'top',\n },\n}));\n\nconst ScorePointHeaderTable: any = styled('table')({\n '& td': {\n border: 0,\n padding: 0,\n textAlign: 'center',\n minWidth: '200px',\n },\n});\n\nconst PointLabel: any = styled('div')({\n marginBottom: '4px',\n});\n\nconst ScorePointValue: any = styled('td')({\n fontWeight: 'normal',\n});\n\nconst ArrowContainer = ({ show, onClick, extraStyles, children }) => (\n <div\n style={{\n height: 'calc(100% - 1px)',\n top: '1px',\n display: show ? 'flex' : 'none',\n width: '50px',\n margin: 'auto',\n position: 'absolute',\n alignItems: 'center',\n justifyContent: 'center',\n cursor: 'pointer',\n ...extraStyles,\n }}\n onClick={onClick}\n >\n {children}\n </div>\n);\n\nArrowContainer.propTypes = {\n show: PropTypes.bool,\n onClick: PropTypes.func,\n extraStyles: PropTypes.object,\n children: PropTypes.object,\n};\n\nclass Scale extends React.Component {\n state = {};\n\n componentDidMount() {\n if (this.tableWrapper) {\n if (this.tableWrapper.offsetWidth < this.tableWrapper.scrollWidth) {\n this.setState({ showRight: true });\n }\n }\n }\n\n scrollLeft: any = () => {\n this.tableWrapper.scrollLeft -= this.tableWrapper.offsetWidth / 2;\n\n this.setState({\n showRight: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth,\n showLeft: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth && this.tableWrapper.scrollLeft > 0,\n });\n };\n\n scrollRight: any = () => {\n const initialScrollLeft = this.tableWrapper.scrollLeft;\n this.tableWrapper.scrollLeft += this.tableWrapper.offsetWidth / 2;\n\n this.setState({\n showRight:\n initialScrollLeft !== this.tableWrapper.scrollLeft &&\n this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth,\n showLeft: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth && this.tableWrapper.scrollLeft > 0,\n });\n };\n\n render() {\n const { showRight, showLeft } = this.state;\n const { scale, scaleIndex, showDescription, showPointsLabels, showStandards, arrowsDisabled } = this.props;\n const { excludeZero, maxPoints, traitLabel, traits, scorePointsLabels } = scale || {};\n\n let scorePointsValues = [];\n let descriptions;\n let pointsLabels;\n let standards;\n\n try {\n // determining the score points values\n for (let pointValue = maxPoints; pointValue >= excludeZero ? 1 : 0; pointValue -= 1) {\n scorePointsValues.push(pointValue);\n }\n\n const { traitStandards, traitDescriptions } = traits.reduce(\n (tcc, trait) => ({\n traitStandards: [...tcc.traitStandards, ...(trait.standards || [])],\n traitDescriptions: [...tcc.traitDescriptions, ...(trait.description || [])],\n }),\n {\n traitStandards: [],\n traitDescriptions: [],\n },\n );\n\n descriptions = showDescription && traitDescriptions.length;\n pointsLabels = showPointsLabels && scorePointsLabels.length;\n standards = showStandards && traitStandards.length;\n } catch (e) {\n descriptions = false;\n pointsLabels = false;\n standards = false;\n }\n\n return (\n <Wrapper>\n <ArrowContainer\n show={showLeft && !arrowsDisabled}\n onClick={this.scrollLeft}\n extraStyles={{\n left: 0,\n background: `linear-gradient(to right, white, ${color.background()})`,\n }}\n >\n <ArrowBackIosIcon />\n </ArrowContainer>\n\n <TableWrapper\n ref={(ref) => {\n this.tableWrapper = ref;\n }}\n onScroll={() => {\n this.setState({\n // 5 is a margin of error\n showRight:\n this.tableWrapper.scrollLeft + this.tableWrapper.offsetWidth < this.tableWrapper.scrollWidth - 5 &&\n this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth,\n showLeft:\n this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth && this.tableWrapper.scrollLeft > 0,\n });\n }}\n >\n {arrowsDisabled && (showRight || showLeft) ? <div>The item is too large to fit in print mode.</div> : null}\n <Table key={`scale-${scaleIndex}`}>\n <thead>\n <tr>\n <th>\n <div dangerouslySetInnerHTML={{ __html: traitLabel }} />\n </th>\n\n {standards ? (\n <th>\n <div>Standard(s)</div>\n </th>\n ) : null}\n\n {descriptions ? (\n <th>\n <div>Description</div>\n </th>\n ) : null}\n\n {scorePointsValues &&\n scorePointsValues.map((scorePointValue, index) => {\n let pointLabel = '';\n\n // to handle the case when there aren't enough labels\n try {\n pointLabel = scorePointsLabels[scorePointsValues.length - index - 1] || '';\n } catch (e) {\n pointLabel = '';\n }\n\n return (\n <th key={`table-header-${index}`}>\n <ScorePointHeaderTable>\n <thead>\n {pointsLabels ? (\n <tr>\n <td>\n <PointLabel\n dangerouslySetInnerHTML={{ __html: pointLabel }}\n />\n </td>\n </tr>\n ) : null}\n <tr>\n <ScorePointValue>\n {scorePointValue === 1 ? `${scorePointValue} point` : `${scorePointValue} points`}\n </ScorePointValue>\n </tr>\n </thead>\n </ScorePointHeaderTable>\n </th>\n );\n })}\n </tr>\n </thead>\n\n <tbody>\n {traits &&\n traits.map((trait, traitIndex) => (\n <Trait\n key={`trait_${scaleIndex}_${traitIndex}`}\n trait={trait}\n traitIndex={traitIndex}\n showDescription={!!descriptions}\n showStandards={!!standards}\n scaleIndex={scaleIndex}\n scorePointsValues={scorePointsValues}\n excludeZero={excludeZero}\n />\n ))}\n </tbody>\n </Table>\n </TableWrapper>\n\n <ArrowContainer\n show={showRight && !arrowsDisabled}\n onClick={this.scrollRight}\n extraStyles={{\n right: 0,\n background: `linear-gradient(to left, white, ${color.background()})`,\n }}\n >\n <ArrowForwardIosIcon />\n </ArrowContainer>\n </Wrapper>\n );\n }\n}\n\nScale.propTypes = {\n scaleIndex: PropTypes.number,\n scale: PropTypes.shape({\n excludeZero: PropTypes.bool,\n maxPoints: PropTypes.number,\n scorePointsLabels: PropTypes.arrayOf(PropTypes.string),\n traitLabel: PropTypes.string,\n traits: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n standards: PropTypes.arrayOf(PropTypes.string),\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n description: PropTypes.string,\n }),\n ),\n }),\n showPointsLabels: PropTypes.bool,\n showDescription: PropTypes.bool,\n showStandards: PropTypes.bool,\n arrowsDisabled: PropTypes.bool,\n};\n\nexport default Scale;\n","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getLinkUtilityClass(slot) {\n return generateUtilityClass('MuiLink', slot);\n}\nconst linkClasses = generateUtilityClasses('MuiLink', ['root', 'underlineNone', 'underlineHover', 'underlineAlways', 'button', 'focusVisible']);\nexport default linkClasses;","import { getPath } from '@mui/system/style';\nimport { alpha } from '@mui/system/colorManipulator';\nconst getTextDecoration = ({\n theme,\n ownerState\n}) => {\n const transformedColor = ownerState.color;\n if ('colorSpace' in theme && theme.colorSpace) {\n const color = getPath(theme, `palette.${transformedColor}.main`) || getPath(theme, `palette.${transformedColor}`) || ownerState.color;\n return theme.alpha(color, 0.4);\n }\n\n // check the `main` color first for a custom palette, then fallback to the color itself\n const color = getPath(theme, `palette.${transformedColor}.main`, false) || getPath(theme, `palette.${transformedColor}`, false) || ownerState.color;\n const channelColor = getPath(theme, `palette.${transformedColor}.mainChannel`) || getPath(theme, `palette.${transformedColor}Channel`);\n if ('vars' in theme && channelColor) {\n return `rgba(${channelColor} / 0.4)`;\n }\n return alpha(color, 0.4);\n};\nexport default getTextDecoration;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';\nimport composeClasses from '@mui/utils/composeClasses';\nimport isFocusVisible from '@mui/utils/isFocusVisible';\nimport capitalize from \"../utils/capitalize.js\";\nimport { styled, useTheme } from \"../zero-styled/index.js\";\nimport memoTheme from \"../utils/memoTheme.js\";\nimport createSimplePaletteValueFilter from \"../utils/createSimplePaletteValueFilter.js\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.js\";\nimport Typography from \"../Typography/index.js\";\nimport linkClasses, { getLinkUtilityClass } from \"./linkClasses.js\";\nimport getTextDecoration from \"./getTextDecoration.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst v6Colors = {\n primary: true,\n secondary: true,\n error: true,\n info: true,\n success: true,\n warning: true,\n textPrimary: true,\n textSecondary: true,\n textDisabled: true\n};\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n component,\n focusVisible,\n underline\n } = ownerState;\n const slots = {\n root: ['root', `underline${capitalize(underline)}`, component === 'button' && 'button', focusVisible && 'focusVisible']\n };\n return composeClasses(slots, getLinkUtilityClass, classes);\n};\nconst LinkRoot = styled(Typography, {\n name: 'MuiLink',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[`underline${capitalize(ownerState.underline)}`], ownerState.component === 'button' && styles.button];\n }\n})(memoTheme(({\n theme\n}) => {\n return {\n variants: [{\n props: {\n underline: 'none'\n },\n style: {\n textDecoration: 'none'\n }\n }, {\n props: {\n underline: 'hover'\n },\n style: {\n textDecoration: 'none',\n '&:hover': {\n textDecoration: 'underline'\n }\n }\n }, {\n props: {\n underline: 'always'\n },\n style: {\n textDecoration: 'underline',\n '&:hover': {\n textDecorationColor: 'inherit'\n }\n }\n }, {\n props: ({\n underline,\n ownerState\n }) => underline === 'always' && ownerState.color !== 'inherit',\n style: {\n textDecorationColor: 'var(--Link-underlineColor)'\n }\n }, {\n props: ({\n underline,\n ownerState\n }) => underline === 'always' && ownerState.color === 'inherit',\n style: theme.colorSpace ? {\n textDecorationColor: theme.alpha('currentColor', 0.4)\n } : null\n }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({\n props: {\n underline: 'always',\n color\n },\n style: {\n '--Link-underlineColor': theme.alpha((theme.vars || theme).palette[color].main, 0.4)\n }\n })), {\n props: {\n underline: 'always',\n color: 'textPrimary'\n },\n style: {\n '--Link-underlineColor': theme.alpha((theme.vars || theme).palette.text.primary, 0.4)\n }\n }, {\n props: {\n underline: 'always',\n color: 'textSecondary'\n },\n style: {\n '--Link-underlineColor': theme.alpha((theme.vars || theme).palette.text.secondary, 0.4)\n }\n }, {\n props: {\n underline: 'always',\n color: 'textDisabled'\n },\n style: {\n '--Link-underlineColor': (theme.vars || theme).palette.text.disabled\n }\n }, {\n props: {\n component: 'button'\n },\n style: {\n position: 'relative',\n WebkitTapHighlightColor: 'transparent',\n backgroundColor: 'transparent',\n // Reset default value\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n border: 0,\n margin: 0,\n // Remove the margin in Safari\n borderRadius: 0,\n padding: 0,\n // Remove the padding in Firefox\n cursor: 'pointer',\n userSelect: 'none',\n verticalAlign: 'middle',\n MozAppearance: 'none',\n // Reset\n WebkitAppearance: 'none',\n // Reset\n '&::-moz-focus-inner': {\n borderStyle: 'none' // Remove Firefox dotted outline.\n },\n [`&.${linkClasses.focusVisible}`]: {\n outline: 'auto'\n }\n }\n }]\n };\n}));\nconst Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiLink'\n });\n const theme = useTheme();\n const {\n className,\n color = 'primary',\n component = 'a',\n onBlur,\n onFocus,\n TypographyClasses,\n underline = 'always',\n variant = 'inherit',\n sx,\n ...other\n } = props;\n const [focusVisible, setFocusVisible] = React.useState(false);\n const handleBlur = event => {\n if (!isFocusVisible(event.target)) {\n setFocusVisible(false);\n }\n if (onBlur) {\n onBlur(event);\n }\n };\n const handleFocus = event => {\n if (isFocusVisible(event.target)) {\n setFocusVisible(true);\n }\n if (onFocus) {\n onFocus(event);\n }\n };\n const ownerState = {\n ...props,\n color,\n component,\n focusVisible,\n underline,\n variant\n };\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(LinkRoot, {\n color: color,\n className: clsx(classes.root, className),\n classes: TypographyClasses,\n component: component,\n onBlur: handleBlur,\n onFocus: handleFocus,\n ref: ref,\n ownerState: ownerState,\n variant: variant,\n ...other,\n sx: [...(v6Colors[color] === undefined ? [{\n color\n }] : []), ...(Array.isArray(sx) ? sx : [sx])],\n style: {\n ...other.style,\n ...(underline === 'always' && color !== 'inherit' && !v6Colors[color] && {\n '--Link-underlineColor': getTextDecoration({\n theme,\n ownerState\n })\n })\n }\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? Link.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The color of the link.\n * @default 'primary'\n */\n color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['primary', 'secondary', 'success', 'error', 'info', 'warning', 'textPrimary', 'textSecondary', 'textDisabled']), PropTypes.string]),\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: elementTypeAcceptingRef,\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n /**\n * @ignore\n */\n style: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * `classes` prop applied to the [`Typography`](https://mui.com/material-ui/api/typography/) element.\n */\n TypographyClasses: PropTypes.object,\n /**\n * Controls when the link should have an underline.\n * @default 'always'\n */\n underline: PropTypes.oneOf(['always', 'hover', 'none']),\n /**\n * Applies the theme typography styles.\n * @default 'inherit'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['body1', 'body2', 'button', 'caption', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'inherit', 'overline', 'subtitle1', 'subtitle2']), PropTypes.string])\n} : void 0;\nexport default Link;","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multi-trait-rubric/src/main.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Scale from './scale.js';\nimport Link from '@mui/material/Link';\nimport Collapse from '@mui/material/Collapse';\nimport { color, UiLayout as UiLayoutImport } from '@pie-lib/render-ui';\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nconst UiLayout = unwrapReactInteropSymbol(UiLayoutImport, 'UiLayout') || unwrapReactInteropSymbol(renderUi.UiLayout, 'UiLayout');\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nclass Main extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n rubricOpen: false,\n linkPrefix: 'Show',\n };\n this.toggleRubric = this.toggleRubric.bind(this);\n }\n\n toggleRubric() {\n this.setState({ rubricOpen: !this.state.rubricOpen });\n this.setState({ linkPrefix: this.state.rubricOpen ? 'Show' : 'Hide' });\n }\n\n render() {\n const { model } = this.props;\n let { animationsDisabled } = this.props;\n const { extraCSSRules, halfScoring, scales, visible, pointLabels, description, standards, arrowsDisabled } =\n model || {};\n animationsDisabled = animationsDisabled || model.animationsDisabled;\n\n if (!scales || !visible) {\n return null;\n }\n\n const rubricItem = (\n <UiLayout\n extraCSSRules={extraCSSRules}\n style={{ fontFamily: 'Cerebri Sans', color: color.text(), backgroundColor: color.background() }}\n >\n {halfScoring ? (\n <div style={{ marginBottom: '16px' }}>* Half-point or in-between scores are permitted under this rubric.</div>\n ) : null}\n\n {scales.map((scale, scaleIndex) => (\n <Scale\n key={`scale_${scaleIndex}`}\n scale={scale}\n scaleIndex={scaleIndex}\n showPointsLabels={pointLabels}\n showDescription={description}\n showStandards={standards}\n arrowsDisabled={arrowsDisabled}\n />\n ))}\n </UiLayout>\n );\n\n if (animationsDisabled) {\n return rubricItem;\n }\n\n return (\n <UiLayout extraCSSRules={extraCSSRules} style={{ color: color.text(), backgroundColor: color.background() }}>\n <Link style={{ backgroundColor: color.background() }} href={this.dudUrl} onClick={this.toggleRubric}>\n {this.state.linkPrefix} Rubric\n </Link>\n <Collapse style={{ marginTop: '16px' }} in={this.state.rubricOpen} timeout={{ enter: 225, exit: 195 }}>\n {rubricItem}\n </Collapse>\n </UiLayout>\n );\n }\n}\n\nMain.propTypes = {\n model: PropTypes.shape({\n halfScoring: PropTypes.bool,\n scales: PropTypes.arrayOf(\n PropTypes.shape({\n excludeZero: PropTypes.bool,\n maxPoints: PropTypes.number,\n scorePointsLabels: PropTypes.arrayOf(PropTypes.string),\n traitLabel: PropTypes.string,\n traits: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n description: PropTypes.string,\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n standards: PropTypes.arrayOf(PropTypes.string),\n }),\n ),\n }),\n ),\n visible: PropTypes.bool,\n pointLabels: PropTypes.bool,\n description: PropTypes.bool,\n standards: PropTypes.bool,\n animationsDisabled: PropTypes.bool,\n }),\n animationsDisabled: PropTypes.bool,\n};\n\nexport default Main;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multi-trait-rubric/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { ModelSetEvent } from '@pie-element/shared-player-events';\nimport Main from './main.js';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\n\nexport default class MultiTraitRubric extends HTMLElement {\n constructor() {\n super();\n this._model = {};\n this._session = null;\n this._root = null;\n }\n\n set model(s) {\n this._model = s;\n this.dispatchEvent(new ModelSetEvent(this.tagName.toLowerCase(), this._session, !!this._model));\n\n this._render();\n }\n\n set session(s) {\n this._session = s;\n }\n\n get session() {\n return this._session;\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n const el = React.createElement(Main, { model: this._model, session: this._session });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(el);\n queueMicrotask(() => {\n renderMath(this);\n });\n }\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n }\n }\n}\n"],"x_google_ignoreList":[3,4,5],"mappings":";;;;;;AACA,IAAI,IAAI,MAAM,UAAU,YAAY;CACnC;EACC,KAAK,OAAO;CACb;CACA,YAAY,GAAG,GAAG,GAAG;EACpB,MAAM,EAAE,MAAM;GACb,SAAS,CAAC;GACV,UAAU,CAAC;GACX,QAAQ;IACP,UAAU;IACV,WAAW;IACX,UAAU;GACX;EACD,CAAC,GAAG,KAAK,YAAY,GAAG,KAAK,WAAW;CACzC;AACD;CAAO,MAAM,UAAU,YAAY;CAClC;EACC,KAAK,OAAO;CACb;CACA,YAAY,GAAG,GAAG;EACjB,MAAM,EAAE,MAAM;GACb,SAAS,CAAC;GACV,UAAU,CAAC;GACX,QAAQ;IACP,UAAU;IACV,WAAW;GACZ;EACD,CAAC,GAAG,KAAK,YAA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AU;EACvB,aAAa,EAAA,QAAU;EACvB,WAAW,EAAA,QAAU;EACrB,oBAAoB,EAAA,QAAU;CAChC,CAAC;CACD,oBAAoB,EAAA,QAAU;AAChC;;;ACzHA,IAAqB,KAArB,cAA8C,YAAY;CACxD,cAAc;EAIZ,AAHA,MAAM,GACN,KAAK,SAAS,CAAC,GACf,KAAK,WAAW,MAChB,KAAK,QAAQ;CACf;CAEA,IAAI,MAAM,GAAG;EAIX,AAHA,KAAK,SAAS,GACd,KAAK,cAAc,IAAI,EAAc,KAAK,QAAQ,YAAY,GAAG,KAAK,UAAU,CAAC,CAAC,KAAK,MAAM,CAAC,GAE9F,KAAK,QAAQ;CACf;CAEA,IAAI,QAAQ,GAAG;EACb,KAAK,WAAW;CAClB;CAEA,IAAI,UAAU;EACZ,OAAO,KAAK;CACd;CAEA,oBAAoB;EAClB,KAAK,QAAQ;CACf;CAEA,UAAU;EACR,IAAM,IAAK,EAAM,cAAc,GAAM;GAAE,OAAO,KAAK;GAAQ,SAAS,KAAK;EAAS,CAAC;EAMnF,AAJA,AACE,KAAK,UAAQ,EAAW,IAAI,GAE9B,KAAK,MAAM,OAAO,CAAE,GACpB,qBAAqB;GACnB,EAAW,IAAI;EACjB,CAAC;CACH;CAEA,uBAAuB;EACrB,AAAI,KAAK,SACP,KAAK,MAAM,QAAQ;CAEvB;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["capitalize","React"],"sources":["../../../../../shared/player-events/dist/index.js","../../../src/delivery/trait.tsx","../../../src/delivery/scale.tsx","../../../../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/Link/linkClasses.js","../../../../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/Link/getTextDecoration.js","../../../../../../node_modules/.bun/@mui+material@7.3.11+eb26afe407ed7030/node_modules/@mui/material/esm/Link/Link.js","../../../src/delivery/main.tsx","../../../src/delivery/index.ts"],"sourcesContent":["//#region src/session-notifier.ts\nvar e = \"commitPendingSession\", t = /* @__PURE__ */ new WeakMap();\nfunction n(e, n) {\n\tlet r = t.get(e);\n\tr || (r = /* @__PURE__ */ new Set(), t.set(e, r)), r.add(n);\n}\nfunction r(t) {\n\treturn Object.getOwnPropertyDescriptor(t, e) !== void 0;\n}\nfunction i(t) {\n\tif (r(t)) return;\n\tlet n = t[e];\n\tObject.defineProperty(t, e, {\n\t\tvalue: () => {\n\t\t\tif (typeof n == \"function\") try {\n\t\t\t\tn.call(t);\n\t\t\t} catch {}\n\t\t\to(t);\n\t\t},\n\t\tconfigurable: !0,\n\t\tenumerable: !1,\n\t\twritable: !0\n\t});\n}\nfunction a(e, t, r = {}) {\n\tlet a = r.delayMs, o = typeof a == \"function\" ? a : () => a ?? 0, s = r.maxWaitMs, c = null, l = null, u = !1, d = () => {\n\t\tc !== null && (clearTimeout(c), c = null), l !== null && (clearTimeout(l), l = null);\n\t}, f = () => {\n\t\td(), u && (u = !1, t());\n\t}, p = {\n\t\tnotify() {\n\t\t\tu = !0, c !== null && clearTimeout(c), c = setTimeout(f, Math.max(0, o())), s !== void 0 && l === null && (l = setTimeout(f, Math.max(0, s)));\n\t\t},\n\t\tflush() {\n\t\t\tif (!u) {\n\t\t\t\td();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tf();\n\t\t\t} catch (e) {\n\t\t\t\tconsole.warn(\"[session-notifier] a committed session-changed dispatch threw\", e);\n\t\t\t}\n\t\t}\n\t};\n\treturn n(e, p), i(e), p;\n}\nfunction o(e) {\n\tlet n = t.get(e);\n\tif (n) for (let e of [...n]) e.flush();\n}\n//#endregion\n//#region src/index.ts\nvar s = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"model-set\";\n\t}\n\tconstructor(t, n, r) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t,\n\t\t\t\thasModel: r\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n}, c = class e extends CustomEvent {\n\tstatic {\n\t\tthis.TYPE = \"session-changed\";\n\t}\n\tconstructor(t, n) {\n\t\tsuper(e.TYPE, {\n\t\t\tbubbles: !0,\n\t\t\tcomposed: !0,\n\t\t\tdetail: {\n\t\t\t\tcomplete: n,\n\t\t\t\tcomponent: t\n\t\t\t}\n\t\t}), this.component = t, this.complete = n;\n\t}\n};\n//#endregion\nexport { s as ModelSetEvent, e as SESSION_COMMIT_METHOD, c as SessionChangedEvent, a as createSessionNotifier, o as flushSessionNotifiers };\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multi-trait-rubric/src/trait.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { color } from '@pie-lib/render-ui';\n\nconst TraitName: any = styled('td')({\n color: color.primaryDark(),\n verticalAlign: 'middle',\n});\n\nconst NoDescription: any = styled('div')({\n color: color.secondaryBackground(),\n textAlign: 'center',\n});\n\nconst Trait = (props) => {\n const { trait, traitIndex, scaleIndex, showStandards, showDescription, scorePointsValues } = props;\n const { name, standards, scorePointsDescriptors, description } = trait || {};\n\n return (\n <tr key={`scale-${scaleIndex}-trait-${traitIndex}`}>\n <TraitName>\n <div dangerouslySetInnerHTML={{ __html: name }} />\n </TraitName>\n\n {showStandards ? (\n <td>\n <div dangerouslySetInnerHTML={{ __html: standards.join(',') }} />\n </td>\n ) : null}\n\n {showDescription ? (\n <td>\n <div dangerouslySetInnerHTML={{ __html: description }} />\n </td>\n ) : null}\n\n {scorePointsValues &&\n scorePointsValues.map((scorePointValue, index) => {\n let scoreDescriptor;\n\n try {\n scoreDescriptor = scorePointsDescriptors[scorePointsValues.length - index - 1] || '';\n } catch (e) {\n scoreDescriptor = '';\n }\n\n return (\n <td key={`table-cell-${index}`}>\n {!scoreDescriptor ? (\n <NoDescription dangerouslySetInnerHTML={{ __html: 'No Description' }} />\n ) : (\n <div dangerouslySetInnerHTML={{ __html: scoreDescriptor }} />\n )}\n </td>\n );\n })}\n </tr>\n );\n};\n\nTrait.propTypes = {\n showStandards: PropTypes.bool,\n showDescription: PropTypes.bool,\n scorePointsValues: PropTypes.arrayOf(PropTypes.number),\n scaleIndex: PropTypes.number,\n traitIndex: PropTypes.number,\n trait: PropTypes.shape({\n name: PropTypes.string,\n standards: PropTypes.arrayOf(PropTypes.string),\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n description: PropTypes.string,\n }),\n};\n\nexport default Trait;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multi-trait-rubric/src/scale.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { color } from '@pie-lib/render-ui';\nimport Trait from './trait.js';\nimport ArrowBackIosIcon from '@mui/icons-material/ArrowBackIos';\nimport ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';\n\nconst Wrapper: any = styled('div')({\n display: 'flex',\n position: 'relative',\n});\n\nconst TableWrapper: any = styled('div')({\n width: '100%',\n overflow: 'auto',\n});\n\nconst Table: any = styled('table')(({ theme }) => ({\n borderSpacing: 0,\n marginBottom: theme.spacing(2),\n borderRadius: '4px',\n color: color.text(),\n fontSize: theme.typography.fontSize,\n lineHeight: '16px',\n overflow: 'unset',\n\n '& ul, ol': {\n marginBlockStart: 0,\n paddingInlineStart: theme.spacing(2),\n },\n\n '& th': {\n padding: theme.spacing(2),\n textAlign: 'left',\n backgroundColor: color.secondaryBackground(),\n verticalAlign: 'bottom',\n },\n\n '& th div': {\n width: '200px',\n },\n\n '& td': {\n width: '200px',\n padding: `${theme.spacing(2)} ${theme.spacing(1)}`,\n verticalAlign: 'top',\n },\n}));\n\nconst ScorePointHeaderTable: any = styled('table')({\n '& td': {\n border: 0,\n padding: 0,\n textAlign: 'center',\n minWidth: '200px',\n },\n});\n\nconst PointLabel: any = styled('div')({\n marginBottom: '4px',\n});\n\nconst ScorePointValue: any = styled('td')({\n fontWeight: 'normal',\n});\n\nconst ArrowContainer = ({ show, onClick, extraStyles, children }) => (\n <div\n style={{\n height: 'calc(100% - 1px)',\n top: '1px',\n display: show ? 'flex' : 'none',\n width: '50px',\n margin: 'auto',\n position: 'absolute',\n alignItems: 'center',\n justifyContent: 'center',\n cursor: 'pointer',\n ...extraStyles,\n }}\n onClick={onClick}\n >\n {children}\n </div>\n);\n\nArrowContainer.propTypes = {\n show: PropTypes.bool,\n onClick: PropTypes.func,\n extraStyles: PropTypes.object,\n children: PropTypes.object,\n};\n\nclass Scale extends React.Component {\n state = {};\n\n componentDidMount() {\n if (this.tableWrapper) {\n if (this.tableWrapper.offsetWidth < this.tableWrapper.scrollWidth) {\n this.setState({ showRight: true });\n }\n }\n }\n\n scrollLeft: any = () => {\n this.tableWrapper.scrollLeft -= this.tableWrapper.offsetWidth / 2;\n\n this.setState({\n showRight: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth,\n showLeft: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth && this.tableWrapper.scrollLeft > 0,\n });\n };\n\n scrollRight: any = () => {\n const initialScrollLeft = this.tableWrapper.scrollLeft;\n this.tableWrapper.scrollLeft += this.tableWrapper.offsetWidth / 2;\n\n this.setState({\n showRight:\n initialScrollLeft !== this.tableWrapper.scrollLeft &&\n this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth,\n showLeft: this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth && this.tableWrapper.scrollLeft > 0,\n });\n };\n\n render() {\n const { showRight, showLeft } = this.state;\n const { scale, scaleIndex, showDescription, showPointsLabels, showStandards, arrowsDisabled } = this.props;\n const { excludeZero, maxPoints, traitLabel, traits, scorePointsLabels } = scale || {};\n\n let scorePointsValues = [];\n let descriptions;\n let pointsLabels;\n let standards;\n\n try {\n // determining the score points values\n for (let pointValue = maxPoints; pointValue >= excludeZero ? 1 : 0; pointValue -= 1) {\n scorePointsValues.push(pointValue);\n }\n\n const { traitStandards, traitDescriptions } = traits.reduce(\n (tcc, trait) => ({\n traitStandards: [...tcc.traitStandards, ...(trait.standards || [])],\n traitDescriptions: [...tcc.traitDescriptions, ...(trait.description || [])],\n }),\n {\n traitStandards: [],\n traitDescriptions: [],\n },\n );\n\n descriptions = showDescription && traitDescriptions.length;\n pointsLabels = showPointsLabels && scorePointsLabels.length;\n standards = showStandards && traitStandards.length;\n } catch (e) {\n descriptions = false;\n pointsLabels = false;\n standards = false;\n }\n\n return (\n <Wrapper>\n <ArrowContainer\n show={showLeft && !arrowsDisabled}\n onClick={this.scrollLeft}\n extraStyles={{\n left: 0,\n background: `linear-gradient(to right, white, ${color.background()})`,\n }}\n >\n <ArrowBackIosIcon />\n </ArrowContainer>\n\n <TableWrapper\n ref={(ref) => {\n this.tableWrapper = ref;\n }}\n onScroll={() => {\n this.setState({\n // 5 is a margin of error\n showRight:\n this.tableWrapper.scrollLeft + this.tableWrapper.offsetWidth < this.tableWrapper.scrollWidth - 5 &&\n this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth,\n showLeft:\n this.tableWrapper.scrollLeft < this.tableWrapper.scrollWidth && this.tableWrapper.scrollLeft > 0,\n });\n }}\n >\n {arrowsDisabled && (showRight || showLeft) ? <div>The item is too large to fit in print mode.</div> : null}\n <Table key={`scale-${scaleIndex}`}>\n <thead>\n <tr>\n <th>\n <div dangerouslySetInnerHTML={{ __html: traitLabel }} />\n </th>\n\n {standards ? (\n <th>\n <div>Standard(s)</div>\n </th>\n ) : null}\n\n {descriptions ? (\n <th>\n <div>Description</div>\n </th>\n ) : null}\n\n {scorePointsValues &&\n scorePointsValues.map((scorePointValue, index) => {\n let pointLabel = '';\n\n // to handle the case when there aren't enough labels\n try {\n pointLabel = scorePointsLabels[scorePointsValues.length - index - 1] || '';\n } catch (e) {\n pointLabel = '';\n }\n\n return (\n <th key={`table-header-${index}`}>\n <ScorePointHeaderTable>\n <thead>\n {pointsLabels ? (\n <tr>\n <td>\n <PointLabel\n dangerouslySetInnerHTML={{ __html: pointLabel }}\n />\n </td>\n </tr>\n ) : null}\n <tr>\n <ScorePointValue>\n {scorePointValue === 1 ? `${scorePointValue} point` : `${scorePointValue} points`}\n </ScorePointValue>\n </tr>\n </thead>\n </ScorePointHeaderTable>\n </th>\n );\n })}\n </tr>\n </thead>\n\n <tbody>\n {traits &&\n traits.map((trait, traitIndex) => (\n <Trait\n key={`trait_${scaleIndex}_${traitIndex}`}\n trait={trait}\n traitIndex={traitIndex}\n showDescription={!!descriptions}\n showStandards={!!standards}\n scaleIndex={scaleIndex}\n scorePointsValues={scorePointsValues}\n excludeZero={excludeZero}\n />\n ))}\n </tbody>\n </Table>\n </TableWrapper>\n\n <ArrowContainer\n show={showRight && !arrowsDisabled}\n onClick={this.scrollRight}\n extraStyles={{\n right: 0,\n background: `linear-gradient(to left, white, ${color.background()})`,\n }}\n >\n <ArrowForwardIosIcon />\n </ArrowContainer>\n </Wrapper>\n );\n }\n}\n\nScale.propTypes = {\n scaleIndex: PropTypes.number,\n scale: PropTypes.shape({\n excludeZero: PropTypes.bool,\n maxPoints: PropTypes.number,\n scorePointsLabels: PropTypes.arrayOf(PropTypes.string),\n traitLabel: PropTypes.string,\n traits: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n standards: PropTypes.arrayOf(PropTypes.string),\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n description: PropTypes.string,\n }),\n ),\n }),\n showPointsLabels: PropTypes.bool,\n showDescription: PropTypes.bool,\n showStandards: PropTypes.bool,\n arrowsDisabled: PropTypes.bool,\n};\n\nexport default Scale;\n","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getLinkUtilityClass(slot) {\n return generateUtilityClass('MuiLink', slot);\n}\nconst linkClasses = generateUtilityClasses('MuiLink', ['root', 'underlineNone', 'underlineHover', 'underlineAlways', 'button', 'focusVisible']);\nexport default linkClasses;","import { getPath } from '@mui/system/style';\nimport { alpha } from '@mui/system/colorManipulator';\nconst getTextDecoration = ({\n theme,\n ownerState\n}) => {\n const transformedColor = ownerState.color;\n if ('colorSpace' in theme && theme.colorSpace) {\n const color = getPath(theme, `palette.${transformedColor}.main`) || getPath(theme, `palette.${transformedColor}`) || ownerState.color;\n return theme.alpha(color, 0.4);\n }\n\n // check the `main` color first for a custom palette, then fallback to the color itself\n const color = getPath(theme, `palette.${transformedColor}.main`, false) || getPath(theme, `palette.${transformedColor}`, false) || ownerState.color;\n const channelColor = getPath(theme, `palette.${transformedColor}.mainChannel`) || getPath(theme, `palette.${transformedColor}Channel`);\n if ('vars' in theme && channelColor) {\n return `rgba(${channelColor} / 0.4)`;\n }\n return alpha(color, 0.4);\n};\nexport default getTextDecoration;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';\nimport composeClasses from '@mui/utils/composeClasses';\nimport isFocusVisible from '@mui/utils/isFocusVisible';\nimport capitalize from \"../utils/capitalize.js\";\nimport { styled, useTheme } from \"../zero-styled/index.js\";\nimport memoTheme from \"../utils/memoTheme.js\";\nimport createSimplePaletteValueFilter from \"../utils/createSimplePaletteValueFilter.js\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.js\";\nimport Typography from \"../Typography/index.js\";\nimport linkClasses, { getLinkUtilityClass } from \"./linkClasses.js\";\nimport getTextDecoration from \"./getTextDecoration.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst v6Colors = {\n primary: true,\n secondary: true,\n error: true,\n info: true,\n success: true,\n warning: true,\n textPrimary: true,\n textSecondary: true,\n textDisabled: true\n};\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n component,\n focusVisible,\n underline\n } = ownerState;\n const slots = {\n root: ['root', `underline${capitalize(underline)}`, component === 'button' && 'button', focusVisible && 'focusVisible']\n };\n return composeClasses(slots, getLinkUtilityClass, classes);\n};\nconst LinkRoot = styled(Typography, {\n name: 'MuiLink',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[`underline${capitalize(ownerState.underline)}`], ownerState.component === 'button' && styles.button];\n }\n})(memoTheme(({\n theme\n}) => {\n return {\n variants: [{\n props: {\n underline: 'none'\n },\n style: {\n textDecoration: 'none'\n }\n }, {\n props: {\n underline: 'hover'\n },\n style: {\n textDecoration: 'none',\n '&:hover': {\n textDecoration: 'underline'\n }\n }\n }, {\n props: {\n underline: 'always'\n },\n style: {\n textDecoration: 'underline',\n '&:hover': {\n textDecorationColor: 'inherit'\n }\n }\n }, {\n props: ({\n underline,\n ownerState\n }) => underline === 'always' && ownerState.color !== 'inherit',\n style: {\n textDecorationColor: 'var(--Link-underlineColor)'\n }\n }, {\n props: ({\n underline,\n ownerState\n }) => underline === 'always' && ownerState.color === 'inherit',\n style: theme.colorSpace ? {\n textDecorationColor: theme.alpha('currentColor', 0.4)\n } : null\n }, ...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({\n props: {\n underline: 'always',\n color\n },\n style: {\n '--Link-underlineColor': theme.alpha((theme.vars || theme).palette[color].main, 0.4)\n }\n })), {\n props: {\n underline: 'always',\n color: 'textPrimary'\n },\n style: {\n '--Link-underlineColor': theme.alpha((theme.vars || theme).palette.text.primary, 0.4)\n }\n }, {\n props: {\n underline: 'always',\n color: 'textSecondary'\n },\n style: {\n '--Link-underlineColor': theme.alpha((theme.vars || theme).palette.text.secondary, 0.4)\n }\n }, {\n props: {\n underline: 'always',\n color: 'textDisabled'\n },\n style: {\n '--Link-underlineColor': (theme.vars || theme).palette.text.disabled\n }\n }, {\n props: {\n component: 'button'\n },\n style: {\n position: 'relative',\n WebkitTapHighlightColor: 'transparent',\n backgroundColor: 'transparent',\n // Reset default value\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n border: 0,\n margin: 0,\n // Remove the margin in Safari\n borderRadius: 0,\n padding: 0,\n // Remove the padding in Firefox\n cursor: 'pointer',\n userSelect: 'none',\n verticalAlign: 'middle',\n MozAppearance: 'none',\n // Reset\n WebkitAppearance: 'none',\n // Reset\n '&::-moz-focus-inner': {\n borderStyle: 'none' // Remove Firefox dotted outline.\n },\n [`&.${linkClasses.focusVisible}`]: {\n outline: 'auto'\n }\n }\n }]\n };\n}));\nconst Link = /*#__PURE__*/React.forwardRef(function Link(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiLink'\n });\n const theme = useTheme();\n const {\n className,\n color = 'primary',\n component = 'a',\n onBlur,\n onFocus,\n TypographyClasses,\n underline = 'always',\n variant = 'inherit',\n sx,\n ...other\n } = props;\n const [focusVisible, setFocusVisible] = React.useState(false);\n const handleBlur = event => {\n if (!isFocusVisible(event.target)) {\n setFocusVisible(false);\n }\n if (onBlur) {\n onBlur(event);\n }\n };\n const handleFocus = event => {\n if (isFocusVisible(event.target)) {\n setFocusVisible(true);\n }\n if (onFocus) {\n onFocus(event);\n }\n };\n const ownerState = {\n ...props,\n color,\n component,\n focusVisible,\n underline,\n variant\n };\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(LinkRoot, {\n color: color,\n className: clsx(classes.root, className),\n classes: TypographyClasses,\n component: component,\n onBlur: handleBlur,\n onFocus: handleFocus,\n ref: ref,\n ownerState: ownerState,\n variant: variant,\n ...other,\n sx: [...(v6Colors[color] === undefined ? [{\n color\n }] : []), ...(Array.isArray(sx) ? sx : [sx])],\n style: {\n ...other.style,\n ...(underline === 'always' && color !== 'inherit' && !v6Colors[color] && {\n '--Link-underlineColor': getTextDecoration({\n theme,\n ownerState\n })\n })\n }\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? Link.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The color of the link.\n * @default 'primary'\n */\n color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['primary', 'secondary', 'success', 'error', 'info', 'warning', 'textPrimary', 'textSecondary', 'textDisabled']), PropTypes.string]),\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: elementTypeAcceptingRef,\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n /**\n * @ignore\n */\n style: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * `classes` prop applied to the [`Typography`](https://mui.com/material-ui/api/typography/) element.\n */\n TypographyClasses: PropTypes.object,\n /**\n * Controls when the link should have an underline.\n * @default 'always'\n */\n underline: PropTypes.oneOf(['always', 'hover', 'none']),\n /**\n * Applies the theme typography styles.\n * @default 'inherit'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['body1', 'body2', 'button', 'caption', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'inherit', 'overline', 'subtitle1', 'subtitle2']), PropTypes.string])\n} : void 0;\nexport default Link;","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multi-trait-rubric/src/main.jsx\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Scale from './scale.js';\nimport Link from '@mui/material/Link';\nimport Collapse from '@mui/material/Collapse';\nimport { color, UiLayout as UiLayoutImport } from '@pie-lib/render-ui';\n\nfunction isRenderableReactInteropType(value: any) {\n return (\n typeof value === 'function' ||\n (typeof value === 'object' && value !== null && typeof value.$$typeof === 'symbol')\n );\n}\n\nfunction unwrapReactInteropSymbol(maybeSymbol: any, namedExport?: string) {\n if (!maybeSymbol) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol)) return maybeSymbol;\n if (isRenderableReactInteropType(maybeSymbol.default)) return maybeSymbol.default;\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport])) {\n return maybeSymbol[namedExport];\n }\n if (namedExport && isRenderableReactInteropType(maybeSymbol[namedExport]?.default)) {\n return maybeSymbol[namedExport].default;\n }\n return maybeSymbol;\n}\nconst UiLayout = unwrapReactInteropSymbol(UiLayoutImport, 'UiLayout') || unwrapReactInteropSymbol(renderUi.UiLayout, 'UiLayout');\nimport * as RenderUiNamespace from '@pie-lib/render-ui';\nconst renderUiNamespaceAny = RenderUiNamespace as any;\nconst renderUiDefaultMaybe = renderUiNamespaceAny['default'];\nconst renderUi =\n renderUiDefaultMaybe && typeof renderUiDefaultMaybe === 'object'\n ? renderUiDefaultMaybe\n : renderUiNamespaceAny;\nclass Main extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n rubricOpen: false,\n linkPrefix: 'Show',\n };\n this.toggleRubric = this.toggleRubric.bind(this);\n }\n\n toggleRubric() {\n this.setState({ rubricOpen: !this.state.rubricOpen });\n this.setState({ linkPrefix: this.state.rubricOpen ? 'Show' : 'Hide' });\n }\n\n render() {\n const { model } = this.props;\n let { animationsDisabled } = this.props;\n const { extraCSSRules, halfScoring, scales, visible, pointLabels, description, standards, arrowsDisabled } =\n model || {};\n animationsDisabled = animationsDisabled || model.animationsDisabled;\n\n if (!scales || !visible) {\n return null;\n }\n\n const rubricItem = (\n <UiLayout\n extraCSSRules={extraCSSRules}\n style={{ fontFamily: 'Cerebri Sans', color: color.text(), backgroundColor: color.background() }}\n >\n {halfScoring ? (\n <div style={{ marginBottom: '16px' }}>* Half-point or in-between scores are permitted under this rubric.</div>\n ) : null}\n\n {scales.map((scale, scaleIndex) => (\n <Scale\n key={`scale_${scaleIndex}`}\n scale={scale}\n scaleIndex={scaleIndex}\n showPointsLabels={pointLabels}\n showDescription={description}\n showStandards={standards}\n arrowsDisabled={arrowsDisabled}\n />\n ))}\n </UiLayout>\n );\n\n if (animationsDisabled) {\n return rubricItem;\n }\n\n return (\n <UiLayout extraCSSRules={extraCSSRules} style={{ color: color.text(), backgroundColor: color.background() }}>\n <Link style={{ backgroundColor: color.background() }} href={this.dudUrl} onClick={this.toggleRubric}>\n {this.state.linkPrefix} Rubric\n </Link>\n <Collapse style={{ marginTop: '16px' }} in={this.state.rubricOpen} timeout={{ enter: 225, exit: 195 }}>\n {rubricItem}\n </Collapse>\n </UiLayout>\n );\n }\n}\n\nMain.propTypes = {\n model: PropTypes.shape({\n halfScoring: PropTypes.bool,\n scales: PropTypes.arrayOf(\n PropTypes.shape({\n excludeZero: PropTypes.bool,\n maxPoints: PropTypes.number,\n scorePointsLabels: PropTypes.arrayOf(PropTypes.string),\n traitLabel: PropTypes.string,\n traits: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n description: PropTypes.string,\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n standards: PropTypes.arrayOf(PropTypes.string),\n }),\n ),\n }),\n ),\n visible: PropTypes.bool,\n pointLabels: PropTypes.bool,\n description: PropTypes.bool,\n standards: PropTypes.bool,\n animationsDisabled: PropTypes.bool,\n }),\n animationsDisabled: PropTypes.bool,\n};\n\nexport default Main;\n","// @ts-nocheck\n/**\n * @synced-from pie-elements/packages/multi-trait-rubric/src/index.js\n * @auto-generated\n *\n * This file is automatically synced from pie-elements and converted to TypeScript.\n * Manual edits will be overwritten on next sync.\n * To make changes, edit the upstream JavaScript file and run sync again.\n */\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { ModelSetEvent } from '@pie-element/shared-player-events';\nimport Main from './main.js';\nimport { renderMath } from '@pie-element/shared-math-rendering-mathjax';\n\nexport default class MultiTraitRubric extends HTMLElement {\n constructor() {\n super();\n this._model = {};\n this._session = null;\n this._root = null;\n this._mathObserver = null;\n this._mathRenderPending = false;\n }\n\n // React commits asynchronously, so a queueMicrotask(renderMath) can run before\n // the LaTeX spans are in the DOM and leave raw LaTeX on first render — this is\n // especially visible when this element is mounted inside complex-rubric, which\n // swaps its innerHTML and re-defines the inner element. Observing the DOM and\n // typesetting after each commit keeps math in sync regardless of timing.\n _scheduleMathRender: any = () => {\n if (this._mathRenderPending) return;\n this._mathRenderPending = true;\n\n requestAnimationFrame(() => {\n if (this._mathObserver) {\n this._mathObserver.disconnect();\n }\n renderMath(this);\n this._mathRenderPending = false;\n setTimeout(() => {\n if (this._mathObserver) {\n this._mathObserver.observe(this, { childList: true, subtree: true });\n }\n }, 50);\n });\n };\n\n _initMathObserver() {\n if (this._mathObserver) return;\n this._mathObserver = new MutationObserver(this._scheduleMathRender);\n this._mathObserver.observe(this, { childList: true, subtree: true });\n }\n\n _disconnectMathObserver() {\n if (this._mathObserver) {\n this._mathObserver.disconnect();\n this._mathObserver = null;\n }\n }\n\n set model(s) {\n this._model = s;\n this.dispatchEvent(new ModelSetEvent(this.tagName.toLowerCase(), this._session, !!this._model));\n\n this._render();\n }\n\n set session(s) {\n this._session = s;\n }\n\n get session() {\n return this._session;\n }\n\n connectedCallback() {\n this._initMathObserver();\n this._render();\n }\n\n _render() {\n this._initMathObserver();\n\n const el = React.createElement(Main, { model: this._model, session: this._session });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(el);\n }\n\n disconnectedCallback() {\n this._disconnectMathObserver();\n if (this._root) {\n this._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d,KAAK,kBACT,KAAK,gBAAgB,IAAI,iBAAiB,KAAK,mBAAmB,GAClE,KAAK,cAAc,QAAQ,MAAM;GAAE,WAAW;GAAM,SAAS;EAAK,CAAC;CACrE;CAEA,0BAA0B;EACxB,AAEE,KAAK,mBADL,KAAK,cAAc,WAAW,GACT;CAEzB;CAEA,IAAI,MAAM,GAAG;EAIX,AAHA,KAAK,SAAS,GACd,KAAK,cAAc,IAAI,EAAc,KAAK,QAAQ,YAAY,GAAG,KAAK,UAAU,CAAC,CAAC,KAAK,MAAM,CAAC,GAE9F,KAAK,QAAQ;CACf;CAEA,IAAI,QAAQ,GAAG;EACb,KAAK,WAAW;CAClB;CAEA,IAAI,UAAU;EACZ,OAAO,KAAK;CACd;CAEA,oBAAoB;EAElB,AADA,KAAK,kBAAkB,GACvB,KAAK,QAAQ;CACf;CAEA,UAAU;EACR,KAAK,kBAAkB;EAEvB,IAAM,IAAK,EAAM,cAAc,GAAM;GAAE,OAAO,KAAK;GAAQ,SAAS,KAAK;EAAS,CAAC;EAKnF,AAHA,AACE,KAAK,UAAQ,EAAW,IAAI,GAE9B,KAAK,MAAM,OAAO,CAAE;CACtB;CAEA,uBAAuB;EAErB,AADA,KAAK,wBAAwB,GAC7B,AAEE,KAAK,WADL,KAAK,MAAM,QAAQ,GACN;CAEjB;AACF"}
|
package/dist/delivery/index.d.ts
CHANGED
package/dist/delivery/index.js
CHANGED
|
@@ -6,7 +6,26 @@ import { renderMath as i } from "@pie-element/shared-math-rendering-mathjax";
|
|
|
6
6
|
//#region src/delivery/index.ts
|
|
7
7
|
var a = class extends HTMLElement {
|
|
8
8
|
constructor() {
|
|
9
|
-
super(), this._model = {}, this._session = null, this._root = null;
|
|
9
|
+
super(), this._model = {}, this._session = null, this._root = null, this._mathObserver = null, this._mathRenderPending = !1;
|
|
10
|
+
}
|
|
11
|
+
_scheduleMathRender = () => {
|
|
12
|
+
this._mathRenderPending || (this._mathRenderPending = !0, requestAnimationFrame(() => {
|
|
13
|
+
this._mathObserver && this._mathObserver.disconnect(), i(this), this._mathRenderPending = !1, setTimeout(() => {
|
|
14
|
+
this._mathObserver && this._mathObserver.observe(this, {
|
|
15
|
+
childList: !0,
|
|
16
|
+
subtree: !0
|
|
17
|
+
});
|
|
18
|
+
}, 50);
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
21
|
+
_initMathObserver() {
|
|
22
|
+
this._mathObserver || (this._mathObserver = new MutationObserver(this._scheduleMathRender), this._mathObserver.observe(this, {
|
|
23
|
+
childList: !0,
|
|
24
|
+
subtree: !0
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
_disconnectMathObserver() {
|
|
28
|
+
this._mathObserver &&= (this._mathObserver.disconnect(), null);
|
|
10
29
|
}
|
|
11
30
|
set model(e) {
|
|
12
31
|
this._model = e, this.dispatchEvent(new r(this.tagName.toLowerCase(), this._session, !!this._model)), this._render();
|
|
@@ -18,19 +37,18 @@ var a = class extends HTMLElement {
|
|
|
18
37
|
return this._session;
|
|
19
38
|
}
|
|
20
39
|
connectedCallback() {
|
|
21
|
-
this._render();
|
|
40
|
+
this._initMathObserver(), this._render();
|
|
22
41
|
}
|
|
23
42
|
_render() {
|
|
43
|
+
this._initMathObserver();
|
|
24
44
|
let r = t.createElement(e, {
|
|
25
45
|
model: this._model,
|
|
26
46
|
session: this._session
|
|
27
47
|
});
|
|
28
|
-
this._root ||= n(this), this._root.render(r)
|
|
29
|
-
i(this);
|
|
30
|
-
});
|
|
48
|
+
this._root ||= n(this), this._root.render(r);
|
|
31
49
|
}
|
|
32
50
|
disconnectedCallback() {
|
|
33
|
-
this._root
|
|
51
|
+
this._disconnectMathObserver(), this._root &&= (this._root.unmount(), null);
|
|
34
52
|
}
|
|
35
53
|
};
|
|
36
54
|
//#endregion
|