@pie-element/rubric 8.1.2-next.5 → 8.1.3
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/CHANGELOG.json +257 -0
- package/CHANGELOG.md +1731 -0
- package/LICENSE.md +5 -0
- package/README.md +3 -0
- package/configure/CHANGELOG.json +197 -0
- package/configure/CHANGELOG.md +1571 -0
- package/configure/lib/defaults.js +70 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/index.js +135 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/main.js +103 -0
- package/configure/lib/main.js.map +1 -0
- package/configure/package.json +23 -0
- package/configure/src/__tests__/index.test.jsx +192 -0
- package/configure/src/defaults.js +43 -0
- package/configure/src/index.js +139 -0
- package/configure/src/main.jsx +87 -0
- package/controller/CHANGELOG.json +17 -0
- package/controller/CHANGELOG.md +901 -0
- package/controller/lib/defaults.js +15 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +46 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/package.json +12 -0
- package/controller/src/__tests__/index.test.js +33 -0
- package/controller/src/defaults.js +8 -0
- package/controller/src/index.js +41 -0
- package/docs/config-schema.json +712 -0
- package/docs/config-schema.json.md +532 -0
- package/docs/demo/config.js +8 -0
- package/docs/demo/generate.js +8 -0
- package/docs/demo/index.html +2 -0
- package/docs/pie-schema.json +391 -0
- package/docs/pie-schema.json.md +281 -0
- package/lib/index.js +52 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +208 -0
- package/lib/main.js.map +1 -0
- package/lib/print.js +71 -0
- package/lib/print.js.map +1 -0
- package/module/configure.js +1 -0
- package/module/controller.js +73 -0
- package/module/demo.js +33 -0
- package/module/element.js +1 -0
- package/module/index.html +21 -0
- package/module/manifest.json +14 -0
- package/module/print-demo.js +71 -0
- package/module/print.html +18 -0
- package/module/print.js +1 -0
- package/package.json +25 -87
- package/src/__tests__/rubric-view.test.jsx +37 -0
- package/src/index.js +48 -0
- package/src/main.jsx +226 -0
- package/src/print.js +74 -0
- package/configure.js +0 -2
- package/controller.js +0 -1
- package/dist/author/defaults.d.ts +0 -71
- package/dist/author/defaults.js +0 -53
- package/dist/author/index.d.ts +0 -21
- package/dist/author/index.js +0 -72
- package/dist/author/main.d.ts +0 -14
- package/dist/author/main.js +0 -51
- package/dist/browser/author/index.js +0 -50284
- package/dist/browser/author/index.js.map +0 -1
- package/dist/browser/controller/index.js +0 -41
- package/dist/browser/controller/index.js.map +0 -1
- package/dist/browser/delivery/index.js +0 -34
- package/dist/browser/delivery/index.js.map +0 -1
- package/dist/browser/dist-B6elSZkE.js +0 -9091
- package/dist/browser/dist-B6elSZkE.js.map +0 -1
- package/dist/browser/dist-Bs_ywPM1.js +0 -102
- package/dist/browser/dist-Bs_ywPM1.js.map +0 -1
- package/dist/browser/main-C0Q1SfKi.js +0 -153
- package/dist/browser/main-C0Q1SfKi.js.map +0 -1
- package/dist/browser/print/index.js +0 -34
- package/dist/browser/print/index.js.map +0 -1
- package/dist/browser/rubric.css +0 -2
- package/dist/controller/defaults.d.ts +0 -17
- package/dist/controller/defaults.js +0 -21
- package/dist/controller/index.d.ts +0 -10
- package/dist/controller/index.js +0 -23
- package/dist/delivery/index.d.ts +0 -16
- package/dist/delivery/index.js +0 -33
- package/dist/delivery/main.d.ts +0 -34
- package/dist/delivery/main.js +0 -156
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -145
- package/dist/index.js +0 -2
- package/dist/print/index.d.ts +0 -15
- package/dist/print/index.js +0 -34
- package/dist/runtime-support.d.ts +0 -12
- package/dist/runtime-support.js +0 -12
package/dist/author/index.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
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 };
|
package/dist/author/main.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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;
|
package/dist/author/main.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
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 };
|