@pie-element/rubric 8.1.1-next.11 → 8.1.2-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.
- package/configure.js +2 -0
- package/controller.js +1 -0
- package/dist/author/defaults.d.ts +71 -0
- package/dist/author/defaults.js +53 -0
- package/dist/author/index.d.ts +21 -0
- package/dist/author/index.js +72 -0
- package/dist/author/main.d.ts +14 -0
- package/dist/author/main.js +51 -0
- package/dist/browser/author/index.js +45540 -0
- package/dist/browser/author/index.js.map +1 -0
- package/dist/browser/controller/index.js +41 -0
- package/dist/browser/controller/index.js.map +1 -0
- package/dist/browser/debounce-CwNJlAWB.js +120 -0
- package/dist/browser/debounce-CwNJlAWB.js.map +1 -0
- package/dist/browser/delivery/index.js +34 -0
- package/dist/browser/delivery/index.js.map +1 -0
- package/dist/browser/dist-DESt1KeY.js +9075 -0
- package/dist/browser/dist-DESt1KeY.js.map +1 -0
- package/dist/browser/main-wvVb2SYi.js +153 -0
- package/dist/browser/main-wvVb2SYi.js.map +1 -0
- package/dist/browser/print/index.js +34 -0
- package/dist/browser/print/index.js.map +1 -0
- package/dist/browser/rubric.css +2 -0
- package/dist/controller/defaults.d.ts +17 -0
- package/dist/controller/defaults.js +21 -0
- package/dist/controller/index.d.ts +10 -0
- package/dist/controller/index.js +23 -0
- package/dist/delivery/index.d.ts +16 -0
- package/dist/delivery/index.js +33 -0
- package/dist/delivery/main.d.ts +34 -0
- package/dist/delivery/main.js +156 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.iife.d.ts +8 -0
- package/dist/index.iife.js +145 -0
- package/dist/index.js +2 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js +8 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/debounce.js +50 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +9 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/now.js +7 -0
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js +19 -0
- package/dist/print/index.d.ts +15 -0
- package/dist/print/index.js +34 -0
- package/package.json +84 -25
- package/CHANGELOG.json +0 -257
- package/CHANGELOG.md +0 -1715
- package/LICENSE.md +0 -5
- package/README.md +0 -3
- package/configure/CHANGELOG.json +0 -197
- package/configure/CHANGELOG.md +0 -1555
- package/configure/lib/defaults.js +0 -70
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/index.js +0 -135
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/main.js +0 -103
- package/configure/lib/main.js.map +0 -1
- package/configure/package.json +0 -23
- package/configure/src/__tests__/index.test.jsx +0 -192
- package/configure/src/defaults.js +0 -43
- package/configure/src/index.js +0 -139
- package/configure/src/main.jsx +0 -87
- package/controller/CHANGELOG.json +0 -17
- package/controller/CHANGELOG.md +0 -897
- package/controller/lib/defaults.js +0 -15
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -46
- package/controller/lib/index.js.map +0 -1
- package/controller/package.json +0 -12
- package/controller/src/__tests__/index.test.js +0 -33
- package/controller/src/defaults.js +0 -8
- package/controller/src/index.js +0 -41
- package/docs/config-schema.json +0 -712
- package/docs/config-schema.json.md +0 -532
- package/docs/demo/config.js +0 -8
- package/docs/demo/generate.js +0 -8
- package/docs/demo/index.html +0 -2
- package/docs/pie-schema.json +0 -391
- package/docs/pie-schema.json.md +0 -281
- package/lib/index.js +0 -52
- package/lib/index.js.map +0 -1
- package/lib/main.js +0 -208
- package/lib/main.js.map +0 -1
- package/lib/print.js +0 -71
- package/lib/print.js.map +0 -1
- package/module/configure.js +0 -1
- package/module/controller.js +0 -73
- package/module/demo.js +0 -33
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -14
- package/module/print-demo.js +0 -71
- package/module/print.html +0 -18
- package/module/print.js +0 -1
- package/src/__tests__/rubric-view.test.jsx +0 -37
- package/src/index.js +0 -48
- package/src/main.jsx +0 -226
- package/src/print.js +0 -74
package/configure.js
ADDED
package/controller.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/controller/index.js';
|
|
@@ -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 };
|