@pie-element/complex-rubric 7.1.2-next.0 → 7.1.2-next.2
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 +29 -29
- package/dist/browser/author/index.js +1791 -2053
- package/dist/browser/author/index.js.map +1 -1
- package/dist/index.iife.js +7 -7
- package/dist/runtime-support.d.ts +12 -0
- package/dist/runtime-support.js +12 -0
- package/package.json +12 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +0 -12
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +0 -16
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
- package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
package/dist/author/index.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import t from "./
|
|
3
|
-
import n from "
|
|
4
|
-
import
|
|
5
|
-
import i from "react";
|
|
6
|
-
import
|
|
7
|
-
import o from "@pie-element/rubric/author";
|
|
8
|
-
import s from "
|
|
9
|
-
import c from "
|
|
1
|
+
import e from "./main.js";
|
|
2
|
+
import t from "./defaults.js";
|
|
3
|
+
import { ModelUpdatedEvent as n } from "@pie-element/shared-configure-events";
|
|
4
|
+
import r from "react";
|
|
5
|
+
import { createRoot as i } from "react-dom/client";
|
|
6
|
+
import a from "@pie-element/rubric/author";
|
|
7
|
+
import o from "@pie-element/multi-trait-rubric/author";
|
|
8
|
+
import s from "debug";
|
|
9
|
+
import { defaults as c } from "@pie-element/shared-lodash";
|
|
10
10
|
//#region src/author/index.ts
|
|
11
|
-
var l =
|
|
11
|
+
var l = n.TYPE, u = "rubric-configure", d = "multi-trait-rubric-configure", f = class extends a {}, p = class extends o {};
|
|
12
12
|
customElements.get(u) || customElements.define(u, f), customElements.get(d) || customElements.define(d, p);
|
|
13
|
-
var m = (
|
|
14
|
-
configuration: e
|
|
15
|
-
model:
|
|
16
|
-
}), h = class
|
|
17
|
-
static createDefaultModel = ({ rubrics: { simpleRubric: e = {}, rubricless:
|
|
13
|
+
var m = (e, n) => ({
|
|
14
|
+
configuration: c(e, t.configuration),
|
|
15
|
+
model: n
|
|
16
|
+
}), h = class a extends HTMLElement {
|
|
17
|
+
static createDefaultModel = ({ rubrics: { simpleRubric: e = {}, rubricless: n = {}, multiTraitRubric: r = {} } = {
|
|
18
18
|
simpleRubric: {},
|
|
19
19
|
rubricless: {},
|
|
20
20
|
multiTraitRubric: {}
|
|
21
21
|
}, ...i } = {}, a = {}) => ({
|
|
22
|
-
...
|
|
22
|
+
...t?.model || {},
|
|
23
23
|
...a,
|
|
24
24
|
...i,
|
|
25
25
|
rubrics: {
|
|
26
26
|
simpleRubric: {
|
|
27
|
-
...(
|
|
27
|
+
...(t?.model?.rubrics || {}).simpleRubric,
|
|
28
28
|
...(a.rubrics || {}).simpleRubric,
|
|
29
29
|
...e
|
|
30
30
|
},
|
|
31
31
|
multiTraitRubric: {
|
|
32
|
-
...(
|
|
32
|
+
...(t?.model?.rubrics || {}).multiTraitRubric,
|
|
33
33
|
...(a.rubrics || {}).multiTraitRubric,
|
|
34
34
|
...r
|
|
35
35
|
},
|
|
36
36
|
rubricless: {
|
|
37
|
-
...(
|
|
37
|
+
...(t?.model?.rubrics || {}).rubricless,
|
|
38
38
|
...(a.rubrics || {}).rubricless,
|
|
39
|
-
...
|
|
39
|
+
...n
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
constructor() {
|
|
44
|
-
super(), this._root = null, this.canUpdateModel = !1,
|
|
44
|
+
super(), this._root = null, this.canUpdateModel = !1, s.log("constructor called"), this._model = a.createDefaultModel(), this._configuration = t.configuration, this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
|
|
45
45
|
}
|
|
46
|
-
set model(
|
|
47
|
-
this._model =
|
|
46
|
+
set model(e) {
|
|
47
|
+
this._model = a.createDefaultModel(e, this._model), this.canUpdateModel = !0, this._render();
|
|
48
48
|
}
|
|
49
49
|
dispatchModelUpdated(e) {
|
|
50
50
|
let t = !!e;
|
|
51
|
-
this.dispatchEvent(new
|
|
51
|
+
this.dispatchEvent(new n(this._model, t));
|
|
52
52
|
}
|
|
53
|
-
onModelChanged = (
|
|
54
|
-
this._model =
|
|
53
|
+
onModelChanged = (e, t) => {
|
|
54
|
+
this._model = a.createDefaultModel(e, this._model), this.dispatchModelUpdated(t), this._render();
|
|
55
55
|
};
|
|
56
56
|
set configuration(e) {
|
|
57
57
|
let t = m(e, this._model);
|
|
@@ -64,20 +64,20 @@ var m = (t, r) => ({
|
|
|
64
64
|
if (e.target === this) return;
|
|
65
65
|
e.preventDefault(), e.stopImmediatePropagation();
|
|
66
66
|
let t = e.target && e.target.getAttribute("id");
|
|
67
|
-
t && (e.update && (this._model.rubrics[t] = e.update), this.dispatchEvent(new
|
|
67
|
+
t && (e.update && (this._model.rubrics[t] = e.update), this.dispatchEvent(new n(this._model)));
|
|
68
68
|
};
|
|
69
69
|
connectedCallback() {
|
|
70
70
|
this.addEventListener(l, this.onModelUpdated), this._render();
|
|
71
71
|
}
|
|
72
72
|
_render() {
|
|
73
|
-
let
|
|
73
|
+
let t = r.createElement(e, {
|
|
74
74
|
model: this._model,
|
|
75
75
|
configuration: this._configuration,
|
|
76
76
|
onModelChanged: this.onModelChanged,
|
|
77
77
|
onConfigurationChanged: this.onConfigurationChanged,
|
|
78
78
|
canUpdateModel: this.canUpdateModel
|
|
79
79
|
});
|
|
80
|
-
this._root ||=
|
|
80
|
+
this._root ||= i(this), this._root.render(t);
|
|
81
81
|
}
|
|
82
82
|
disconnectedCallback() {
|
|
83
83
|
this.removeEventListener(l, this.onModelUpdated), this._root && this._root.unmount();
|