@pie-element/rubric 1.6.2 → 1.6.3-next.1016
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.md +155 -0
- package/configure/CHANGELOG.md +109 -0
- package/configure/lib/index.js +1 -1
- package/configure/package.json +2 -2
- package/controller/CHANGELOG.md +16 -0
- package/controller/package.json +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/main.js +22 -15
- package/lib/main.js.map +1 -1
- package/lib/print.js +114 -0
- package/lib/print.js.map +1 -0
- package/package.json +6 -2
- package/src/__tests__/__snapshots__/rubric-view.test.jsx.snap +72 -72
- package/src/index.js +2 -1
- package/src/main.jsx +51 -40
- package/src/print.js +63 -0
- package/module/configure.js +0 -29343
- package/module/controller.js +0 -29
- package/module/demo.js +0 -34
- package/module/element.js +0 -505
- package/module/index.html +0 -16
- package/module/manifest.json +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,161 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.8.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.8.4...@pie-element/rubric@1.8.5) (2022-03-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/rubric
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.8.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.8.3...@pie-element/rubric@1.8.4) (2022-03-08)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @pie-element/rubric
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [1.8.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.8.2...@pie-element/rubric@1.8.3) (2022-03-08)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @pie-element/rubric
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [1.8.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.8.1...@pie-element/rubric@1.8.2) (2022-02-21)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @pie-element/rubric
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [1.8.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.8.0...@pie-element/rubric@1.8.1) (2022-02-04)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @pie-element/rubric
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# [1.8.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.7.8...@pie-element/rubric@1.8.0) (2022-01-24)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Bug Fixes
|
|
50
|
+
|
|
51
|
+
* **rubric:** display rubric in reverse order in player PD-1375 ([0620538](https://github.com/pie-framework/pie-elements/commit/06205386a3d2c530378be2dccb7943cefa6f5c55))
|
|
52
|
+
* **rubric:** use singular 1PT instead of 1PTS, fix style in IBX PD-1373, PD-1374 ([0c27b32](https://github.com/pie-framework/pie-elements/commit/0c27b327e861831687576a639ba2b6101c7fc0ff))
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Features
|
|
56
|
+
|
|
57
|
+
* **rubric:** Added Studio support: Treat 'null' as null value for sample answer PD-1313 ([04ea11d](https://github.com/pie-framework/pie-elements/commit/04ea11da0b4b2077693c7a22f63091eabdf09481))
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
## [1.7.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.7.7...@pie-element/rubric@1.7.8) (2022-01-10)
|
|
64
|
+
|
|
65
|
+
**Note:** Version bump only for package @pie-element/rubric
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## [1.7.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.7.6...@pie-element/rubric@1.7.7) (2021-12-23)
|
|
72
|
+
|
|
73
|
+
**Note:** Version bump only for package @pie-element/rubric
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## [1.7.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.7.4...@pie-element/rubric@1.7.5) (2021-12-13)
|
|
80
|
+
|
|
81
|
+
**Note:** Version bump only for package @pie-element/rubric
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## [1.7.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.7.1...@pie-element/rubric@1.7.2) (2021-11-29)
|
|
88
|
+
|
|
89
|
+
**Note:** Version bump only for package @pie-element/rubric
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
## [1.7.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.6.6...@pie-element/rubric@1.7.1) (2021-11-11)
|
|
96
|
+
|
|
97
|
+
**Note:** Version bump only for package @pie-element/rubric
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
# [1.7.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.6.2...@pie-element/rubric@1.7.0) (2021-11-11)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
### Bug Fixes
|
|
107
|
+
|
|
108
|
+
* **rubric:** display rubric in reverse order in player PD-1375 ([0620538](https://github.com/pie-framework/pie-elements/commit/06205386a3d2c530378be2dccb7943cefa6f5c55))
|
|
109
|
+
* **rubric:** use singular 1PT instead of 1PTS, fix style in IBX PD-1373, PD-1374 ([0c27b32](https://github.com/pie-framework/pie-elements/commit/0c27b327e861831687576a639ba2b6101c7fc0ff))
|
|
110
|
+
* pie-lib updates ([e521c2f](https://github.com/pie-framework/pie-elements/commit/e521c2f1a44aa7f3e14f82a1cee05ceb484ed0a6))
|
|
111
|
+
* Updated pie-lib versions ([2fe4c5d](https://github.com/pie-framework/pie-elements/commit/2fe4c5d0be2d40f5fdb34815855695a7f1087f56))
|
|
112
|
+
* Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
### Features
|
|
116
|
+
|
|
117
|
+
* **rubric:** Added Studio support: Treat 'null' as null value for sample answer PD-1313 ([04ea11d](https://github.com/pie-framework/pie-elements/commit/04ea11da0b4b2077693c7a22f63091eabdf09481))
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
## [1.6.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.6.5...@pie-element/rubric@1.6.6) (2021-11-01)
|
|
125
|
+
|
|
126
|
+
**Note:** Version bump only for package @pie-element/rubric
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
## [1.6.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.6.4...@pie-element/rubric@1.6.5) (2021-10-04)
|
|
133
|
+
|
|
134
|
+
**Note:** Version bump only for package @pie-element/rubric
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
## [1.6.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.6.3...@pie-element/rubric@1.6.4) (2021-09-20)
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
### Bug Fixes
|
|
144
|
+
|
|
145
|
+
* pie-lib updates ([e521c2f](https://github.com/pie-framework/pie-elements/commit/e521c2f1a44aa7f3e14f82a1cee05ceb484ed0a6))
|
|
146
|
+
* Updated pie-lib versions ([2fe4c5d](https://github.com/pie-framework/pie-elements/commit/2fe4c5d0be2d40f5fdb34815855695a7f1087f56))
|
|
147
|
+
* Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
## [1.6.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.6.2...@pie-element/rubric@1.6.3) (2021-08-05)
|
|
154
|
+
|
|
155
|
+
**Note:** Version bump only for package @pie-element/rubric
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
6
161
|
## [1.6.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.6.0...@pie-element/rubric@1.6.2) (2021-08-05)
|
|
7
162
|
|
|
8
163
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,115 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.2.41](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.40...@pie-element/rubric-configure@1.2.41) (2022-03-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/rubric-configure
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.2.40](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.39...@pie-element/rubric-configure@1.2.40) (2022-03-08)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @pie-element/rubric-configure
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [1.2.39](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.38...@pie-element/rubric-configure@1.2.39) (2022-03-08)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @pie-element/rubric-configure
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [1.2.38](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.37...@pie-element/rubric-configure@1.2.38) (2022-02-21)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @pie-element/rubric-configure
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [1.2.37](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.36...@pie-element/rubric-configure@1.2.37) (2022-02-04)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @pie-element/rubric-configure
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## [1.2.36](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.35...@pie-element/rubric-configure@1.2.36) (2022-01-24)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @pie-element/rubric-configure
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## [1.2.35](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.34...@pie-element/rubric-configure@1.2.35) (2022-01-10)
|
|
55
|
+
|
|
56
|
+
**Note:** Version bump only for package @pie-element/rubric-configure
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## [1.2.34](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.33...@pie-element/rubric-configure@1.2.34) (2021-12-23)
|
|
63
|
+
|
|
64
|
+
**Note:** Version bump only for package @pie-element/rubric-configure
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## [1.2.32](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.31...@pie-element/rubric-configure@1.2.32) (2021-12-13)
|
|
71
|
+
|
|
72
|
+
**Note:** Version bump only for package @pie-element/rubric-configure
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## [1.2.29](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.28...@pie-element/rubric-configure@1.2.29) (2021-11-29)
|
|
79
|
+
|
|
80
|
+
**Note:** Version bump only for package @pie-element/rubric-configure
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## [1.2.28](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.27...@pie-element/rubric-configure@1.2.28) (2021-10-04)
|
|
87
|
+
|
|
88
|
+
**Note:** Version bump only for package @pie-element/rubric-configure
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## [1.2.27](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.26...@pie-element/rubric-configure@1.2.27) (2021-09-20)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
### Bug Fixes
|
|
98
|
+
|
|
99
|
+
* pie-lib updates ([e521c2f](https://github.com/pie-framework/pie-elements/commit/e521c2f1a44aa7f3e14f82a1cee05ceb484ed0a6))
|
|
100
|
+
* Updated pie-lib versions ([2fe4c5d](https://github.com/pie-framework/pie-elements/commit/2fe4c5d0be2d40f5fdb34815855695a7f1087f56))
|
|
101
|
+
* Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
## [1.2.26](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.25...@pie-element/rubric-configure@1.2.26) (2021-08-05)
|
|
108
|
+
|
|
109
|
+
**Note:** Version bump only for package @pie-element/rubric-configure
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
6
115
|
## [1.2.25](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.23...@pie-element/rubric-configure@1.2.25) (2021-08-05)
|
|
7
116
|
|
|
8
117
|
|
package/configure/lib/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var _debug = _interopRequireDefault(require("debug"));
|
|
|
33
33
|
|
|
34
34
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
35
35
|
|
|
36
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
36
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
37
|
|
|
38
38
|
var RubricElement = /*#__PURE__*/function (_HTMLElement) {
|
|
39
39
|
(0, _inherits2["default"])(RubricElement, _HTMLElement);
|
package/configure/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/rubric-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.41",
|
|
5
5
|
"description": "Rubric authoring view",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"author": "Pie Framework Authors",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@pie-framework/pie-configure-events": "^1.2.0",
|
|
10
|
-
"@pie-lib/rubric": "
|
|
10
|
+
"@pie-lib/rubric": "0.4.23",
|
|
11
11
|
"debug": "^4.1.1",
|
|
12
12
|
"react": "^16.8.6",
|
|
13
13
|
"react-dom": "^16.8.6"
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.2.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.2...@pie-element/rubric-controller@1.2.4) (2021-11-11)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.2.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.2...@pie-element/rubric-controller@1.2.3) (2021-11-11)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @pie-element/rubric-controller
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [1.2.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-controller@1.2.0...@pie-element/rubric-controller@1.2.2) (2021-08-05)
|
|
7
23
|
|
|
8
24
|
|
package/controller/package.json
CHANGED
package/lib/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var _debug = _interopRequireDefault(require("debug"));
|
|
|
31
31
|
|
|
32
32
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
33
33
|
|
|
34
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
34
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
35
35
|
|
|
36
36
|
var RubricRender = /*#__PURE__*/function (_HTMLElement) {
|
|
37
37
|
(0, _inherits2["default"])(RubricRender, _HTMLElement);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["RubricRender","debug","log","onModelChanged","bind","s","_model","_render","m","el","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;IAGqBA,Y;;;;;AAEnB,0BAAc;AAAA;;AAAA;AACZ;;AACAC,sBAAMC,GAAN,CAAU,oBAAV;;AACA,UAAKC,cAAL,GAAsB,MAAKA,cAAL,CAAoBC,IAApB,gDAAtB;AAHY;AAIb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKC,MAAL,GAAcD,CAAd;;AACA,WAAKE,OAAL;AACD;;;WAED,wBAAeC,CAAf,EAAkB;AAChB,WAAKF,MAAL,GAAcE,CAAd;;AACA,WAAKD,OAAL;AACD;;;WAED,6BAAoB;AAClB,WAAKA,OAAL;AACD;;;WAED,mBAAU;AACR,UAAI,KAAKD,MAAT,EAAiB;AACf,YAAMG,EAAE,gBACN,gCAAC,gBAAD;AAAQ,UAAA,KAAK,EAAE,KAAKH;AAApB,UADF;;
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["RubricRender","debug","log","onModelChanged","bind","s","_model","_render","m","el","ReactDOM","render","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;IAGqBA,Y;;;;;AAEnB,0BAAc;AAAA;;AAAA;AACZ;;AACAC,sBAAMC,GAAN,CAAU,oBAAV;;AACA,UAAKC,cAAL,GAAsB,MAAKA,cAAL,CAAoBC,IAApB,gDAAtB;AAHY;AAIb;;;;SAED,aAAUC,CAAV,EAAa;AACX,WAAKC,MAAL,GAAcD,CAAd;;AACA,WAAKE,OAAL;AACD;;;WAED,wBAAeC,CAAf,EAAkB;AAChB,WAAKF,MAAL,GAAcE,CAAd;;AACA,WAAKD,OAAL;AACD;;;WAED,6BAAoB;AAClB,WAAKA,OAAL;AACD;;;WAED,mBAAU;AACR,UAAI,KAAKD,MAAT,EAAiB;AACf,YAAMG,EAAE,gBACN,gCAAC,gBAAD;AAAQ,UAAA,KAAK,EAAE,KAAKH;AAApB,UADF;;AAIAI,6BAASC,MAAT,CAAgBF,EAAhB,EAAoB,IAApB;AACD;AACF;;;kDA9BuCG,W","sourcesContent":["import Rubric from './main';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport debug from 'debug';\n\n\nexport default class RubricRender extends HTMLElement {\n\n constructor() {\n super();\n debug.log('constructor called');\n this.onModelChanged = this.onModelChanged.bind(this);\n }\n\n set model(s) {\n this._model = s;\n this._render();\n }\n\n onModelChanged(m) {\n this._model = m;\n this._render();\n }\n\n connectedCallback() {\n this._render();\n }\n\n _render() {\n if (this._model) {\n const el = (\n <Rubric value={this._model} />\n );\n\n ReactDOM.render(el, this);\n }\n }\n}\n"],"file":"index.js"}
|
package/lib/main.js
CHANGED
|
@@ -39,7 +39,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
39
39
|
|
|
40
40
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
41
41
|
|
|
42
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
42
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
43
43
|
|
|
44
44
|
var RubricType = _propTypes["default"].shape({
|
|
45
45
|
excludeZero: _propTypes["default"].bool,
|
|
@@ -92,29 +92,24 @@ var Rubric = /*#__PURE__*/function (_React$Component) {
|
|
|
92
92
|
|
|
93
93
|
var _this$props = this.props,
|
|
94
94
|
value = _this$props.value,
|
|
95
|
-
classes = _this$props.classes
|
|
95
|
+
classes = _this$props.classes,
|
|
96
|
+
animationsDisabled = _this$props.animationsDisabled;
|
|
96
97
|
|
|
97
98
|
if (value && value.points) {
|
|
98
99
|
var points = value.points,
|
|
99
100
|
sampleAnswers = value.sampleAnswers;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
103
|
-
href: this.dudUrl,
|
|
104
|
-
onClick: this.toggleRubric
|
|
105
|
-
}, this.state.linkPrefix, " Rubric"), /*#__PURE__*/_react["default"].createElement(_Collapse["default"], {
|
|
106
|
-
"in": this.state.rubricOpen,
|
|
107
|
-
timeout: "auto"
|
|
108
|
-
}, /*#__PURE__*/_react["default"].createElement(_List["default"], {
|
|
101
|
+
|
|
102
|
+
var rubricList = /*#__PURE__*/_react["default"].createElement(_List["default"], {
|
|
109
103
|
component: "nav"
|
|
110
|
-
}, points.map(function (desc, index) {
|
|
104
|
+
}, points.slice(0).reverse().map(function (desc, index) {
|
|
105
|
+
index = points.length - index - 1;
|
|
111
106
|
return _this2.shouldRenderPoint(index, value) && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
|
|
112
107
|
key: index
|
|
113
108
|
}, /*#__PURE__*/_react["default"].createElement(_ListItem["default"], {
|
|
114
109
|
key: "P".concat(index)
|
|
115
110
|
}, /*#__PURE__*/_react["default"].createElement(_ListItemText["default"], {
|
|
116
111
|
className: classes.rubricCol,
|
|
117
|
-
primary: "".concat(index, " PTS")
|
|
112
|
+
primary: index === 1 ? "".concat(index, " PT") : "".concat(index, " PTS")
|
|
118
113
|
}), /*#__PURE__*/_react["default"].createElement(_ListItemText["default"], {
|
|
119
114
|
primary: /*#__PURE__*/_react["default"].createElement("div", {
|
|
120
115
|
dangerouslySetInnerHTML: {
|
|
@@ -136,7 +131,17 @@ var Rubric = /*#__PURE__*/function (_React$Component) {
|
|
|
136
131
|
}
|
|
137
132
|
})
|
|
138
133
|
})));
|
|
139
|
-
}))
|
|
134
|
+
}));
|
|
135
|
+
|
|
136
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
137
|
+
className: classes.root
|
|
138
|
+
}, !animationsDisabled ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
|
|
139
|
+
href: this.dudUrl,
|
|
140
|
+
onClick: this.toggleRubric
|
|
141
|
+
}, this.state.linkPrefix, " Rubric"), /*#__PURE__*/_react["default"].createElement(_Collapse["default"], {
|
|
142
|
+
"in": this.state.rubricOpen,
|
|
143
|
+
timeout: "auto"
|
|
144
|
+
}, rubricList)) : rubricList);
|
|
140
145
|
} else {
|
|
141
146
|
return null;
|
|
142
147
|
}
|
|
@@ -147,13 +152,15 @@ var Rubric = /*#__PURE__*/function (_React$Component) {
|
|
|
147
152
|
|
|
148
153
|
(0, _defineProperty2["default"])(Rubric, "propTypes", {
|
|
149
154
|
classes: _propTypes["default"].object.isRequired,
|
|
155
|
+
animationsDisabled: _propTypes["default"].bool,
|
|
150
156
|
value: RubricType
|
|
151
157
|
});
|
|
152
158
|
|
|
153
159
|
var styles = function styles() {
|
|
154
160
|
return {
|
|
155
161
|
rubricCol: {
|
|
156
|
-
flex: '0 1 auto'
|
|
162
|
+
flex: '0 1 auto',
|
|
163
|
+
minWidth: 'fit-content'
|
|
157
164
|
}
|
|
158
165
|
};
|
|
159
166
|
};
|
package/lib/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["RubricType","PropTypes","shape","excludeZero","bool","points","arrayOf","string","sampleAnswers","Rubric","props","index","value","state","rubricOpen","linkPrefix","toggleRubric","bind","setState","classes","
|
|
1
|
+
{"version":3,"sources":["../src/main.jsx"],"names":["RubricType","PropTypes","shape","excludeZero","bool","points","arrayOf","string","sampleAnswers","Rubric","props","index","value","state","rubricOpen","linkPrefix","toggleRubric","bind","setState","classes","animationsDisabled","rubricList","slice","reverse","map","desc","length","shouldRenderPoint","rubricCol","__html","marginLeft","root","dudUrl","React","Component","object","isRequired","styles","flex","minWidth"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEO,IAAMA,UAAU,GAAGC,sBAAUC,KAAV,CAAgB;AACxCC,EAAAA,WAAW,EAAEF,sBAAUG,IADiB;AAExCC,EAAAA,MAAM,EAAEJ,sBAAUK,OAAV,CAAkBL,sBAAUM,MAA5B,CAFgC;AAGxCC,EAAAA,aAAa,EAAEP,sBAAUK,OAAV,CAAkBL,sBAAUM,MAA5B;AAHyB,CAAhB,CAAnB;;;;IAMDE,M;;;;;AAGJ,kBAAYC,KAAZ,EAAmB;AAAA;;AAAA;AACjB,8BAAMA,KAAN;AADiB,+FAFV,cAEU;AAAA,0GAoBC,U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EA3FkBY,kBAAMC,S;;iCAArBzB,M,eAYe;AACjBU,EAAAA,OAAO,EAAElB,sBAAUkC,MAAV,CAAiBC,UADT;AAEjBhB,EAAAA,kBAAkB,EAAEnB,sBAAUG,IAFb;AAGjBQ,EAAAA,KAAK,EAAEZ;AAHU,C;;AAkFrB,IAAMqC,MAAM,GAAG,SAATA,MAAS;AAAA,SAAO;AACpBT,IAAAA,SAAS,EAAE;AACTU,MAAAA,IAAI,EAAE,UADG;AAETC,MAAAA,QAAQ,EAAE;AAFD;AADS,GAAP;AAAA,CAAf;;eAOe,wBAAWF,MAAX,EAAmB5B,MAAnB,C","sourcesContent":["import React from 'react';\nimport { withStyles } from '@material-ui/core/styles';\nimport ListItem from '@material-ui/core/ListItem';\nimport List from '@material-ui/core/List';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport Link from '@material-ui/core/Link';\nimport Collapse from '@material-ui/core/Collapse';\nimport PropTypes from 'prop-types';\n\nexport const RubricType = PropTypes.shape({\n excludeZero: PropTypes.bool,\n points: PropTypes.arrayOf(PropTypes.string),\n sampleAnswers: PropTypes.arrayOf(PropTypes.string),\n});\n\nclass Rubric extends React.Component {\n dudUrl = 'javascript:;';\n\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 static propTypes = {\n classes: PropTypes.object.isRequired,\n animationsDisabled: PropTypes.bool,\n value: RubricType,\n };\n\n toggleRubric() {\n this.setState({ rubricOpen: !this.state.rubricOpen });\n this.setState({ linkPrefix: this.state.rubricOpen ? 'Show' : 'Hide' });\n }\n\n shouldRenderPoint = (index, value) => {\n if (!value.excludeZero) {\n return true;\n } else {\n return index !== 0;\n }\n };\n\n render() {\n const { value, classes, animationsDisabled } = this.props;\n\n if (value && value.points) {\n const { points, sampleAnswers } = value;\n\n const rubricList = <List component=\"nav\">\n {points.slice(0).reverse().map(\n (desc, index) => {\n index = points.length - index - 1;\n return this.shouldRenderPoint(index, value) && (\n <React.Fragment key={index}>\n <ListItem key={`P${index}`}>\n <ListItemText\n className={classes.rubricCol}\n primary={index === 1 ? `${index} PT` : `${index} PTS`}\n />\n <ListItemText\n primary={\n <div dangerouslySetInnerHTML={{ __html: desc }} />\n }\n />\n </ListItem>\n {sampleAnswers && sampleAnswers[index] && (\n <ListItem key={`S${index}`}>\n <ListItemText\n className={classes.rubricCol}\n style={{marginLeft: '20px'}}\n primary={'Sample Answer'}\n />\n <ListItemText\n primary={\n <div dangerouslySetInnerHTML={{ __html: sampleAnswers[index] }} />\n }\n />\n </ListItem>\n )}\n </React.Fragment>\n )\n })}\n </List>;\n\n return (\n <div className={classes.root}>\n {!animationsDisabled ?\n <React.Fragment>\n <Link href={this.dudUrl} onClick={this.toggleRubric}>\n {this.state.linkPrefix} Rubric\n </Link>\n <Collapse in={this.state.rubricOpen} timeout=\"auto\">\n {rubricList}\n </Collapse>\n </React.Fragment>\n : rubricList\n }\n </div>\n );\n } else {\n return null;\n }\n }\n}\n\nconst styles = () => ({\n rubricCol: {\n flex: '0 1 auto',\n minWidth: 'fit-content'\n },\n});\n\nexport default withStyles(styles)(Rubric);\n"],"file":"main.js"}
|
package/lib/print.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
+
|
|
16
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
+
|
|
18
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
+
|
|
20
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
+
|
|
22
|
+
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
23
|
+
|
|
24
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
+
|
|
26
|
+
var _react = _interopRequireDefault(require("react"));
|
|
27
|
+
|
|
28
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
29
|
+
|
|
30
|
+
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
31
|
+
|
|
32
|
+
var _main = _interopRequireDefault(require("./main"));
|
|
33
|
+
|
|
34
|
+
var _mathRendering = require("@pie-lib/math-rendering");
|
|
35
|
+
|
|
36
|
+
var _debug = _interopRequireDefault(require("debug"));
|
|
37
|
+
|
|
38
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
39
|
+
|
|
40
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
|
+
|
|
42
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
43
|
+
|
|
44
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
45
|
+
|
|
46
|
+
var log = (0, _debug["default"])('pie-element:rubric:print');
|
|
47
|
+
|
|
48
|
+
var preparePrintModel = function preparePrintModel(model, opts) {
|
|
49
|
+
var instr = opts.role === 'instructor';
|
|
50
|
+
|
|
51
|
+
if (!instr) {
|
|
52
|
+
return {};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
model.value = _objectSpread({}, model);
|
|
56
|
+
model.mode = 'evaluate';
|
|
57
|
+
model.animationsDisabled = true;
|
|
58
|
+
return model;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
var RubricPrint = /*#__PURE__*/function (_HTMLElement) {
|
|
62
|
+
(0, _inherits2["default"])(RubricPrint, _HTMLElement);
|
|
63
|
+
|
|
64
|
+
var _super = _createSuper(RubricPrint);
|
|
65
|
+
|
|
66
|
+
function RubricPrint() {
|
|
67
|
+
var _this;
|
|
68
|
+
|
|
69
|
+
(0, _classCallCheck2["default"])(this, RubricPrint);
|
|
70
|
+
_this = _super.call(this);
|
|
71
|
+
_this._options = null;
|
|
72
|
+
_this._model = null;
|
|
73
|
+
_this._session = [];
|
|
74
|
+
_this._rerender = (0, _debounce["default"])(function () {
|
|
75
|
+
if (_this._model && _this._session) {
|
|
76
|
+
var printModel = preparePrintModel(_this._model, _this._options);
|
|
77
|
+
|
|
78
|
+
var element = _this._options && /*#__PURE__*/_react["default"].createElement(_main["default"], _objectSpread({}, printModel));
|
|
79
|
+
|
|
80
|
+
_reactDom["default"].render(element, (0, _assertThisInitialized2["default"])(_this), function () {
|
|
81
|
+
log('render complete - render math');
|
|
82
|
+
(0, _mathRendering.renderMath)((0, _assertThisInitialized2["default"])(_this));
|
|
83
|
+
});
|
|
84
|
+
} else {
|
|
85
|
+
log('skip');
|
|
86
|
+
}
|
|
87
|
+
}, 50, {
|
|
88
|
+
leading: false,
|
|
89
|
+
trailing: true
|
|
90
|
+
});
|
|
91
|
+
return _this;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
(0, _createClass2["default"])(RubricPrint, [{
|
|
95
|
+
key: "options",
|
|
96
|
+
set: function set(o) {
|
|
97
|
+
this._options = o;
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
key: "model",
|
|
101
|
+
set: function set(s) {
|
|
102
|
+
this._model = s;
|
|
103
|
+
|
|
104
|
+
this._rerender();
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "connectedCallback",
|
|
108
|
+
value: function connectedCallback() {}
|
|
109
|
+
}]);
|
|
110
|
+
return RubricPrint;
|
|
111
|
+
}( /*#__PURE__*/(0, _wrapNativeSuper2["default"])(HTMLElement));
|
|
112
|
+
|
|
113
|
+
exports["default"] = RubricPrint;
|
|
114
|
+
//# sourceMappingURL=print.js.map
|
package/lib/print.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/print.js"],"names":["log","preparePrintModel","model","opts","instr","role","value","mode","animationsDisabled","RubricPrint","_options","_model","_session","_rerender","printModel","element","React","createElement","Main","ReactDOM","render","leading","trailing","o","s","HTMLElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;AAEA,IAAMA,GAAG,GAAG,uBAAM,0BAAN,CAAZ;;AAEA,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,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react-dom';\nimport debounce from 'lodash/debounce';\nimport Main from './main';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport debug from 'debug';\n\nconst log = debug('pie-element:rubric:print');\n\nconst preparePrintModel = (model, opts) => {\n const instr = opts.role === 'instructor';\n\n if (!instr) {\n return {};\n }\n\n model.value = { ...model };\n model.mode = 'evaluate';\n model.animationsDisabled = true;\n\n return model;\n};\n\nexport default class RubricPrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element =\n this._options &&\n React.createElement(Main, {\n ...printModel,\n });\n\n ReactDOM.render(element, this, () => {\n log('render complete - render math');\n renderMath(this);\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true }\n );\n }\n set options(o) {\n this._options = o;\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\n}\n"],"file":"print.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/rubric",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3-next.1016+1dc291af4",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "src/index.js",
|
|
6
6
|
"description": "Rubric Scoring Interaction",
|
|
@@ -14,8 +14,12 @@
|
|
|
14
14
|
},
|
|
15
15
|
"author": "pie framework developers",
|
|
16
16
|
"license": "ISC",
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "1dc291af490cf91cc86a6a7c8d0eb0fdf184232b",
|
|
18
18
|
"scripts": {
|
|
19
19
|
"postpublish": "../../scripts/postpublish"
|
|
20
|
+
},
|
|
21
|
+
"exports": {
|
|
22
|
+
".": "./src/index.js",
|
|
23
|
+
"./print": "./src/print.js"
|
|
20
24
|
}
|
|
21
25
|
}
|