@pie-element/complex-rubric 7.1.2-next.2 → 7.1.2-next.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/dist/author/index.js +39 -36
- package/dist/author/main.d.ts +2 -0
- package/dist/author/main.js +55 -52
- package/dist/browser/author/index.js +1763 -7009
- package/dist/browser/author/index.js.map +1 -1
- package/dist/browser/complex-rubric.css +2 -0
- package/dist/browser/delivery/index.js +22 -21
- package/dist/browser/delivery/index.js.map +1 -1
- package/dist/browser/delivery-A_7EWNQT.js +691 -0
- package/dist/browser/delivery-A_7EWNQT.js.map +1 -0
- package/dist/browser/print/index.js +25 -24
- package/dist/browser/print/index.js.map +1 -1
- package/dist/browser/private-tags-BTGKqp_N.js +60407 -0
- package/dist/browser/private-tags-BTGKqp_N.js.map +1 -0
- package/dist/delivery/index.js +25 -24
- package/dist/index.iife.js +18 -18
- package/dist/print/index.js +26 -25
- package/dist/private-tags.d.ts +4 -0
- package/dist/private-tags.js +3 -0
- package/package.json +3 -3
- package/dist/browser/dist-DJUOd5EZ.js +0 -19
- package/dist/browser/dist-DJUOd5EZ.js.map +0 -1
package/dist/author/index.js
CHANGED
|
@@ -1,87 +1,90 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import { COMPLEX_RUBRIC_MULTI_TRAIT_CONFIGURE_TAG as e, COMPLEX_RUBRIC_SIMPLE_CONFIGURE_TAG as t } from "../private-tags.js";
|
|
2
|
+
import n from "./main.js";
|
|
3
|
+
import r from "./defaults.js";
|
|
4
|
+
import { ModelUpdatedEvent as i } from "@pie-element/shared-configure-events";
|
|
5
|
+
import a from "react";
|
|
6
|
+
import { createRoot as o } from "react-dom/client";
|
|
7
|
+
import s from "@pie-element/rubric/author";
|
|
8
|
+
import c from "@pie-element/multi-trait-rubric/author";
|
|
9
|
+
import l from "debug";
|
|
10
|
+
import { defaults as u } from "@pie-element/shared-lodash";
|
|
10
11
|
//#region src/author/index.ts
|
|
11
|
-
var
|
|
12
|
-
customElements.get(
|
|
13
|
-
var
|
|
14
|
-
configuration:
|
|
15
|
-
model:
|
|
16
|
-
}),
|
|
17
|
-
static createDefaultModel = ({ rubrics: { simpleRubric: e = {}, rubricless:
|
|
12
|
+
var d = i.TYPE, f = t, p = e, m = class extends s {}, h = class extends c {};
|
|
13
|
+
customElements.get(f) || customElements.define(f, m), customElements.get(p) || customElements.define(p, h);
|
|
14
|
+
var g = (e, t) => ({
|
|
15
|
+
configuration: u(e, r.configuration),
|
|
16
|
+
model: t
|
|
17
|
+
}), _ = class e extends HTMLElement {
|
|
18
|
+
static createDefaultModel = ({ rubrics: { simpleRubric: e = {}, rubricless: t = {}, multiTraitRubric: n = {} } = {
|
|
18
19
|
simpleRubric: {},
|
|
19
20
|
rubricless: {},
|
|
20
21
|
multiTraitRubric: {}
|
|
21
22
|
}, ...i } = {}, a = {}) => ({
|
|
22
|
-
...
|
|
23
|
+
...r?.model || {},
|
|
23
24
|
...a,
|
|
24
25
|
...i,
|
|
25
26
|
rubrics: {
|
|
26
27
|
simpleRubric: {
|
|
27
|
-
...(
|
|
28
|
+
...(r?.model?.rubrics || {}).simpleRubric,
|
|
28
29
|
...(a.rubrics || {}).simpleRubric,
|
|
29
30
|
...e
|
|
30
31
|
},
|
|
31
32
|
multiTraitRubric: {
|
|
32
|
-
...(
|
|
33
|
+
...(r?.model?.rubrics || {}).multiTraitRubric,
|
|
33
34
|
...(a.rubrics || {}).multiTraitRubric,
|
|
34
|
-
...
|
|
35
|
+
...n
|
|
35
36
|
},
|
|
36
37
|
rubricless: {
|
|
37
|
-
...(
|
|
38
|
+
...(r?.model?.rubrics || {}).rubricless,
|
|
38
39
|
...(a.rubrics || {}).rubricless,
|
|
39
|
-
...
|
|
40
|
+
...t
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
});
|
|
43
44
|
constructor() {
|
|
44
|
-
super(), this._root = null, this.canUpdateModel = !1,
|
|
45
|
+
super(), this._root = null, this.canUpdateModel = !1, l.log("constructor called"), this._model = e.createDefaultModel(), this._configuration = r.configuration, this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
|
|
45
46
|
}
|
|
46
|
-
set model(
|
|
47
|
-
this._model =
|
|
47
|
+
set model(t) {
|
|
48
|
+
this._model = e.createDefaultModel(t, this._model), this.canUpdateModel = !0, this._render();
|
|
48
49
|
}
|
|
49
50
|
dispatchModelUpdated(e) {
|
|
50
51
|
let t = !!e;
|
|
51
|
-
this.dispatchEvent(new
|
|
52
|
+
this.dispatchEvent(new i(this._model, t));
|
|
52
53
|
}
|
|
53
|
-
onModelChanged = (
|
|
54
|
-
this._model =
|
|
54
|
+
onModelChanged = (t, n) => {
|
|
55
|
+
this._model = e.createDefaultModel(t, this._model), this.dispatchModelUpdated(n), this._render();
|
|
55
56
|
};
|
|
56
57
|
set configuration(e) {
|
|
57
|
-
let t =
|
|
58
|
+
let t = g(e, this._model);
|
|
58
59
|
this._configuration = t.configuration, this._render();
|
|
59
60
|
}
|
|
60
61
|
onConfigurationChanged(e) {
|
|
61
|
-
this._configuration =
|
|
62
|
+
this._configuration = g(e, this._model).configuration, this._model && this.onModelChanged(this._model), this._render();
|
|
62
63
|
}
|
|
63
64
|
onModelUpdated = (e) => {
|
|
64
65
|
if (e.target === this) return;
|
|
65
66
|
e.preventDefault(), e.stopImmediatePropagation();
|
|
66
67
|
let t = e.target && e.target.getAttribute("id");
|
|
67
|
-
t && (e.update && (this._model.rubrics[t] = e.update), this.dispatchEvent(new
|
|
68
|
+
t && (e.update && (this._model.rubrics[t] = e.update), this.dispatchEvent(new i(this._model)));
|
|
68
69
|
};
|
|
69
70
|
connectedCallback() {
|
|
70
|
-
this.addEventListener(
|
|
71
|
+
this.addEventListener(d, this.onModelUpdated), this._render();
|
|
71
72
|
}
|
|
72
73
|
_render() {
|
|
73
|
-
let
|
|
74
|
+
let e = a.createElement(n, {
|
|
74
75
|
model: this._model,
|
|
75
76
|
configuration: this._configuration,
|
|
77
|
+
multiTraitRubricTagName: p,
|
|
76
78
|
onModelChanged: this.onModelChanged,
|
|
77
79
|
onConfigurationChanged: this.onConfigurationChanged,
|
|
80
|
+
simpleRubricTagName: f,
|
|
78
81
|
canUpdateModel: this.canUpdateModel
|
|
79
82
|
});
|
|
80
|
-
this._root ||=
|
|
83
|
+
this._root ||= o(this), this._root.render(e);
|
|
81
84
|
}
|
|
82
85
|
disconnectedCallback() {
|
|
83
|
-
this.removeEventListener(
|
|
86
|
+
this.removeEventListener(d, this.onModelUpdated), this._root && this._root.unmount();
|
|
84
87
|
}
|
|
85
88
|
};
|
|
86
89
|
//#endregion
|
|
87
|
-
export {
|
|
90
|
+
export { _ as default };
|
package/dist/author/main.d.ts
CHANGED
|
@@ -12,9 +12,11 @@ export declare class Main extends React.Component {
|
|
|
12
12
|
static propTypes: {
|
|
13
13
|
canUpdateModel: PropTypes.Requireable<boolean>;
|
|
14
14
|
configuration: PropTypes.Requireable<object>;
|
|
15
|
+
multiTraitRubricTagName: PropTypes.Requireable<string>;
|
|
15
16
|
model: PropTypes.Requireable<object>;
|
|
16
17
|
onModelChanged: PropTypes.Requireable<(...args: any[]) => any>;
|
|
17
18
|
onConfigurationChanged: PropTypes.Requireable<(...args: any[]) => any>;
|
|
19
|
+
simpleRubricTagName: PropTypes.Requireable<string>;
|
|
18
20
|
};
|
|
19
21
|
onModelChanged: any;
|
|
20
22
|
onChangeRubricType: any;
|
package/dist/author/main.js
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { COMPLEX_RUBRIC_MULTI_TRAIT_CONFIGURE_TAG as e, COMPLEX_RUBRIC_SIMPLE_CONFIGURE_TAG as t } from "../private-tags.js";
|
|
2
|
+
import { RUBRIC_TYPES as n } from "@pie-lib/rubric";
|
|
3
|
+
import r from "react";
|
|
4
|
+
import i from "prop-types";
|
|
5
|
+
import { layout as a } from "@pie-lib/config-ui";
|
|
6
|
+
import o from "@mui/material/Radio";
|
|
7
|
+
import s from "@mui/material/RadioGroup";
|
|
8
|
+
import c from "@mui/material/FormControlLabel";
|
|
9
|
+
import { styled as l } from "@mui/material/styles";
|
|
10
|
+
import { color as u } from "@pie-lib/render-ui";
|
|
11
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
11
12
|
//#region src/author/main.tsx
|
|
12
|
-
var
|
|
13
|
+
var p = l(c)({ "&.MuiFormControlLabel-root": {
|
|
13
14
|
width: "fit-content",
|
|
14
15
|
paddingRight: "24px",
|
|
15
16
|
boxSizing: "border-box",
|
|
16
17
|
"&:hover": { background: "var(--pie-secondary-background, rgba(241,241,241,1))" }
|
|
17
|
-
} }),
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
},
|
|
18
|
+
} }), m = l(o)({ "&.MuiRadio-root": { color: `${u.tertiary()} !important` } }), h = {
|
|
19
|
+
[n.MULTI_TRAIT_RUBRIC]: "Multi Trait Rubric",
|
|
20
|
+
[n.SIMPLE_RUBRIC]: "Simple Rubric",
|
|
21
|
+
[n.RUBRICLESS]: "Rubricless"
|
|
22
|
+
}, g = class extends r.Component {
|
|
22
23
|
static propTypes = {
|
|
23
|
-
canUpdateModel:
|
|
24
|
-
configuration:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
canUpdateModel: i.bool,
|
|
25
|
+
configuration: i.object,
|
|
26
|
+
multiTraitRubricTagName: i.string,
|
|
27
|
+
model: i.object,
|
|
28
|
+
onModelChanged: i.func,
|
|
29
|
+
onConfigurationChanged: i.func,
|
|
30
|
+
simpleRubricTagName: i.string
|
|
28
31
|
};
|
|
29
32
|
onModelChanged = (e) => {
|
|
30
33
|
let { onModelChanged: t } = this.props;
|
|
@@ -38,69 +41,69 @@ var d = s(o)({ "&.MuiFormControlLabel-root": {
|
|
|
38
41
|
});
|
|
39
42
|
};
|
|
40
43
|
render() {
|
|
41
|
-
let { model:
|
|
42
|
-
|
|
43
|
-
let
|
|
44
|
-
if (
|
|
45
|
-
case
|
|
44
|
+
let { model: r, configuration: i, canUpdateModel: o, multiTraitRubricTagName: c = e, simpleRubricTagName: l = t } = this.props, u = c, g = l, { extraCSSRules: _, rubrics: v = {} } = r || {}, { rubricType: y } = r, { contentDimensions: b = {}, rubricOptions: x = [], multiTraitRubric: S, simpleRubric: C, rubricless: w, width: T } = i, E = "";
|
|
45
|
+
y ||= n.SIMPLE_RUBRIC;
|
|
46
|
+
let D = x.indexOf(y) > -1;
|
|
47
|
+
if (o) switch (y) {
|
|
48
|
+
case n.SIMPLE_RUBRIC:
|
|
46
49
|
default:
|
|
47
|
-
|
|
50
|
+
E = /* @__PURE__ */ d(g, {
|
|
48
51
|
id: "simpleRubric",
|
|
49
52
|
ref: (e) => {
|
|
50
53
|
e && (this.simpleRubric = e, this.simpleRubric.model = {
|
|
51
|
-
...
|
|
52
|
-
errors:
|
|
54
|
+
...v.simpleRubric,
|
|
55
|
+
errors: r.errors || {}
|
|
53
56
|
}, this.simpleRubric.configuration = {
|
|
54
|
-
...
|
|
55
|
-
width:
|
|
57
|
+
...C,
|
|
58
|
+
width: T
|
|
56
59
|
});
|
|
57
60
|
}
|
|
58
61
|
}, "simple-rubric");
|
|
59
62
|
break;
|
|
60
|
-
case
|
|
61
|
-
|
|
63
|
+
case n.MULTI_TRAIT_RUBRIC:
|
|
64
|
+
E = /* @__PURE__ */ d(u, {
|
|
62
65
|
id: "multiTraitRubric",
|
|
63
66
|
ref: (e) => {
|
|
64
67
|
e && (this.multiTraitRubric = e, this.multiTraitRubric.model = {
|
|
65
|
-
...
|
|
66
|
-
errors:
|
|
68
|
+
...v.multiTraitRubric,
|
|
69
|
+
errors: r.errors || {}
|
|
67
70
|
}, this.multiTraitRubric.configuration = {
|
|
68
|
-
...
|
|
69
|
-
width:
|
|
71
|
+
...S,
|
|
72
|
+
width: T || S.width
|
|
70
73
|
});
|
|
71
74
|
}
|
|
72
75
|
}, "multi-trait-rubric");
|
|
73
76
|
break;
|
|
74
|
-
case
|
|
75
|
-
|
|
77
|
+
case n.RUBRICLESS:
|
|
78
|
+
E = /* @__PURE__ */ d(g, {
|
|
76
79
|
id: "rubricless",
|
|
77
80
|
ref: (e) => {
|
|
78
|
-
e && (this.rubricless = e, this.rubricless.model =
|
|
79
|
-
...
|
|
80
|
-
width:
|
|
81
|
+
e && (this.rubricless = e, this.rubricless.model = v.rubricless, this.rubricless.configuration = {
|
|
82
|
+
...w,
|
|
83
|
+
width: T
|
|
81
84
|
});
|
|
82
85
|
}
|
|
83
86
|
}, "rubricless");
|
|
84
87
|
break;
|
|
85
88
|
}
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
extraCSSRules:
|
|
88
|
-
dimensions:
|
|
89
|
+
return /* @__PURE__ */ f(a.ConfigLayout, {
|
|
90
|
+
extraCSSRules: _,
|
|
91
|
+
dimensions: b,
|
|
89
92
|
hideSettings: !0,
|
|
90
93
|
settings: null,
|
|
91
|
-
children: [/* @__PURE__ */
|
|
94
|
+
children: [/* @__PURE__ */ d(s, {
|
|
92
95
|
"aria-label": "rubric-type",
|
|
93
96
|
name: "rubricType",
|
|
94
|
-
value:
|
|
97
|
+
value: r.rubricType,
|
|
95
98
|
onChange: this.onChangeRubricType,
|
|
96
|
-
children:
|
|
99
|
+
children: x.length > 1 && x.map((e, t) => /* @__PURE__ */ d(p, {
|
|
97
100
|
value: e,
|
|
98
|
-
control: /* @__PURE__ */
|
|
99
|
-
label:
|
|
101
|
+
control: /* @__PURE__ */ d(m, { checked: y === e }),
|
|
102
|
+
label: h[e]
|
|
100
103
|
}, t))
|
|
101
|
-
}),
|
|
104
|
+
}), D && E]
|
|
102
105
|
});
|
|
103
106
|
}
|
|
104
107
|
};
|
|
105
108
|
//#endregion
|
|
106
|
-
export {
|
|
109
|
+
export { g as default };
|