@pie-element/rubric 1.6.3-next.133 → 1.6.3-next.1335

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 CHANGED
@@ -3,6 +3,234 @@
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
+ ## [2.0.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@2.0.0...@pie-element/rubric@2.0.1) (2022-06-28)
7
+
8
+ **Note:** Version bump only for package @pie-element/rubric
9
+
10
+
11
+
12
+
13
+
14
+ # [2.0.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.8.11...@pie-element/rubric@2.0.0) (2022-06-28)
15
+
16
+
17
+ ### chore
18
+
19
+ * Merge master with develop. ([cdca48a](https://github.com/pie-framework/pie-elements/commit/cdca48abaa1d4179e4a961e13d171e14b7ed2444))
20
+
21
+
22
+ ### BREAKING CHANGES
23
+
24
+ * Image percent buttons were removed from toolbar.
25
+ New properties maxImageWidth and maxImageHeight were added.
26
+
27
+
28
+
29
+
30
+
31
+ ## [1.8.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.8.10...@pie-element/rubric@1.8.11) (2022-06-13)
32
+
33
+ **Note:** Version bump only for package @pie-element/rubric
34
+
35
+
36
+
37
+
38
+
39
+ ## [1.8.10](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.8.9...@pie-element/rubric@1.8.10) (2022-05-30)
40
+
41
+ **Note:** Version bump only for package @pie-element/rubric
42
+
43
+
44
+
45
+
46
+
47
+ ## [1.8.9](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.8.8...@pie-element/rubric@1.8.9) (2022-05-16)
48
+
49
+ **Note:** Version bump only for package @pie-element/rubric
50
+
51
+
52
+
53
+
54
+
55
+ ## [1.8.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.8.7...@pie-element/rubric@1.8.8) (2022-05-09)
56
+
57
+ **Note:** Version bump only for package @pie-element/rubric
58
+
59
+
60
+
61
+
62
+
63
+ ## [1.8.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.8.6...@pie-element/rubric@1.8.7) (2022-05-03)
64
+
65
+ **Note:** Version bump only for package @pie-element/rubric
66
+
67
+
68
+
69
+
70
+
71
+ ## [1.8.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric@1.8.5...@pie-element/rubric@1.8.6) (2022-04-12)
72
+
73
+ **Note:** Version bump only for package @pie-element/rubric
74
+
75
+
76
+
77
+
78
+
79
+ ## [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)
80
+
81
+ **Note:** Version bump only for package @pie-element/rubric
82
+
83
+
84
+
85
+
86
+
87
+ ## [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)
88
+
89
+ **Note:** Version bump only for package @pie-element/rubric
90
+
91
+
92
+
93
+
94
+
95
+ ## [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)
96
+
97
+ **Note:** Version bump only for package @pie-element/rubric
98
+
99
+
100
+
101
+
102
+
103
+ ## [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)
104
+
105
+ **Note:** Version bump only for package @pie-element/rubric
106
+
107
+
108
+
109
+
110
+
111
+ ## [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)
112
+
113
+ **Note:** Version bump only for package @pie-element/rubric
114
+
115
+
116
+
117
+
118
+
119
+ # [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)
120
+
121
+
122
+ ### Bug Fixes
123
+
124
+ * **rubric:** display rubric in reverse order in player PD-1375 ([0620538](https://github.com/pie-framework/pie-elements/commit/06205386a3d2c530378be2dccb7943cefa6f5c55))
125
+ * **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))
126
+
127
+
128
+ ### Features
129
+
130
+ * **rubric:** Added Studio support: Treat 'null' as null value for sample answer PD-1313 ([04ea11d](https://github.com/pie-framework/pie-elements/commit/04ea11da0b4b2077693c7a22f63091eabdf09481))
131
+
132
+
133
+
134
+
135
+
136
+ ## [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)
137
+
138
+ **Note:** Version bump only for package @pie-element/rubric
139
+
140
+
141
+
142
+
143
+
144
+ ## [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)
145
+
146
+ **Note:** Version bump only for package @pie-element/rubric
147
+
148
+
149
+
150
+
151
+
152
+ ## [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)
153
+
154
+ **Note:** Version bump only for package @pie-element/rubric
155
+
156
+
157
+
158
+
159
+
160
+ ## [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)
161
+
162
+ **Note:** Version bump only for package @pie-element/rubric
163
+
164
+
165
+
166
+
167
+
168
+ ## [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)
169
+
170
+ **Note:** Version bump only for package @pie-element/rubric
171
+
172
+
173
+
174
+
175
+
176
+ # [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)
177
+
178
+
179
+ ### Bug Fixes
180
+
181
+ * **rubric:** display rubric in reverse order in player PD-1375 ([0620538](https://github.com/pie-framework/pie-elements/commit/06205386a3d2c530378be2dccb7943cefa6f5c55))
182
+ * **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))
183
+ * pie-lib updates ([e521c2f](https://github.com/pie-framework/pie-elements/commit/e521c2f1a44aa7f3e14f82a1cee05ceb484ed0a6))
184
+ * Updated pie-lib versions ([2fe4c5d](https://github.com/pie-framework/pie-elements/commit/2fe4c5d0be2d40f5fdb34815855695a7f1087f56))
185
+ * Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
186
+
187
+
188
+ ### Features
189
+
190
+ * **rubric:** Added Studio support: Treat 'null' as null value for sample answer PD-1313 ([04ea11d](https://github.com/pie-framework/pie-elements/commit/04ea11da0b4b2077693c7a22f63091eabdf09481))
191
+
192
+
193
+
194
+
195
+
196
+
197
+ ## [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)
198
+
199
+ **Note:** Version bump only for package @pie-element/rubric
200
+
201
+
202
+
203
+
204
+
205
+ ## [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)
206
+
207
+ **Note:** Version bump only for package @pie-element/rubric
208
+
209
+
210
+
211
+
212
+
213
+ ## [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)
214
+
215
+
216
+ ### Bug Fixes
217
+
218
+ * pie-lib updates ([e521c2f](https://github.com/pie-framework/pie-elements/commit/e521c2f1a44aa7f3e14f82a1cee05ceb484ed0a6))
219
+ * Updated pie-lib versions ([2fe4c5d](https://github.com/pie-framework/pie-elements/commit/2fe4c5d0be2d40f5fdb34815855695a7f1087f56))
220
+ * Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
221
+
222
+
223
+
224
+
225
+
226
+ ## [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)
227
+
228
+ **Note:** Version bump only for package @pie-element/rubric
229
+
230
+
231
+
232
+
233
+
6
234
  ## [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
235
 
8
236
 
@@ -3,6 +3,188 @@
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
+ ## [2.0.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@2.0.0...@pie-element/rubric-configure@2.0.1) (2022-06-28)
7
+
8
+ **Note:** Version bump only for package @pie-element/rubric-configure
9
+
10
+
11
+
12
+
13
+
14
+ # [2.0.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.47...@pie-element/rubric-configure@2.0.0) (2022-06-28)
15
+
16
+
17
+ ### chore
18
+
19
+ * Merge master with develop. ([cdca48a](https://github.com/pie-framework/pie-elements/commit/cdca48abaa1d4179e4a961e13d171e14b7ed2444))
20
+
21
+
22
+ ### BREAKING CHANGES
23
+
24
+ * Image percent buttons were removed from toolbar.
25
+ New properties maxImageWidth and maxImageHeight were added.
26
+
27
+
28
+
29
+
30
+
31
+ ## [1.2.47](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.46...@pie-element/rubric-configure@1.2.47) (2022-06-13)
32
+
33
+ **Note:** Version bump only for package @pie-element/rubric-configure
34
+
35
+
36
+
37
+
38
+
39
+ ## [1.2.46](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.45...@pie-element/rubric-configure@1.2.46) (2022-05-30)
40
+
41
+ **Note:** Version bump only for package @pie-element/rubric-configure
42
+
43
+
44
+
45
+
46
+
47
+ ## [1.2.45](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.44...@pie-element/rubric-configure@1.2.45) (2022-05-16)
48
+
49
+ **Note:** Version bump only for package @pie-element/rubric-configure
50
+
51
+
52
+
53
+
54
+
55
+ ## [1.2.44](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.43...@pie-element/rubric-configure@1.2.44) (2022-05-09)
56
+
57
+ **Note:** Version bump only for package @pie-element/rubric-configure
58
+
59
+
60
+
61
+
62
+
63
+ ## [1.2.43](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.42...@pie-element/rubric-configure@1.2.43) (2022-05-03)
64
+
65
+ **Note:** Version bump only for package @pie-element/rubric-configure
66
+
67
+
68
+
69
+
70
+
71
+ ## [1.2.42](https://github.com/pie-framework/pie-elements/compare/@pie-element/rubric-configure@1.2.41...@pie-element/rubric-configure@1.2.42) (2022-04-12)
72
+
73
+ **Note:** Version bump only for package @pie-element/rubric-configure
74
+
75
+
76
+
77
+
78
+
79
+ ## [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)
80
+
81
+ **Note:** Version bump only for package @pie-element/rubric-configure
82
+
83
+
84
+
85
+
86
+
87
+ ## [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)
88
+
89
+ **Note:** Version bump only for package @pie-element/rubric-configure
90
+
91
+
92
+
93
+
94
+
95
+ ## [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)
96
+
97
+ **Note:** Version bump only for package @pie-element/rubric-configure
98
+
99
+
100
+
101
+
102
+
103
+ ## [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)
104
+
105
+ **Note:** Version bump only for package @pie-element/rubric-configure
106
+
107
+
108
+
109
+
110
+
111
+ ## [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)
112
+
113
+ **Note:** Version bump only for package @pie-element/rubric-configure
114
+
115
+
116
+
117
+
118
+
119
+ ## [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)
120
+
121
+ **Note:** Version bump only for package @pie-element/rubric-configure
122
+
123
+
124
+
125
+
126
+
127
+ ## [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)
128
+
129
+ **Note:** Version bump only for package @pie-element/rubric-configure
130
+
131
+
132
+
133
+
134
+
135
+ ## [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)
136
+
137
+ **Note:** Version bump only for package @pie-element/rubric-configure
138
+
139
+
140
+
141
+
142
+
143
+ ## [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)
144
+
145
+ **Note:** Version bump only for package @pie-element/rubric-configure
146
+
147
+
148
+
149
+
150
+
151
+ ## [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)
152
+
153
+ **Note:** Version bump only for package @pie-element/rubric-configure
154
+
155
+
156
+
157
+
158
+
159
+ ## [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)
160
+
161
+ **Note:** Version bump only for package @pie-element/rubric-configure
162
+
163
+
164
+
165
+
166
+
167
+ ## [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)
168
+
169
+
170
+ ### Bug Fixes
171
+
172
+ * pie-lib updates ([e521c2f](https://github.com/pie-framework/pie-elements/commit/e521c2f1a44aa7f3e14f82a1cee05ceb484ed0a6))
173
+ * Updated pie-lib versions ([2fe4c5d](https://github.com/pie-framework/pie-elements/commit/2fe4c5d0be2d40f5fdb34815855695a7f1087f56))
174
+ * Updated pie-lib versions ([1c23830](https://github.com/pie-framework/pie-elements/commit/1c23830fc75d1de5f7bb3bb16de3c665ae5fa350))
175
+
176
+
177
+
178
+
179
+
180
+ ## [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)
181
+
182
+ **Note:** Version bump only for package @pie-element/rubric-configure
183
+
184
+
185
+
186
+
187
+
6
188
  ## [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
189
 
8
190
 
@@ -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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
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);
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@pie-element/rubric-configure",
3
3
  "private": true,
4
- "version": "1.2.25",
4
+ "version": "2.0.1",
5
5
  "description": "Rubric authoring view",
6
6
  "main": "lib/index.js",
7
7
  "author": "Pie Framework Authors",
8
8
  "dependencies": {
9
- "@pie-framework/pie-configure-events": "^1.2.0",
10
- "@pie-lib/rubric": "^0.3.5",
9
+ "@pie-framework/pie-configure-events": "^1.3.0",
10
+ "@pie-lib/rubric": "0.5.4",
11
11
  "debug": "^4.1.1",
12
12
  "react": "^16.8.6",
13
13
  "react-dom": "^16.8.6"
@@ -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
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/rubric-controller",
3
3
  "private": true,
4
- "version": "1.2.2",
4
+ "version": "1.2.7",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
7
7
  "test": "./node_modules/.bin/jest"
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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
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;;AAGAI,6BAASC,MAAT,CAAgBF,EAAhB,EAAoB,IAApB;AACD;AACF;;;kDA7BuCG,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 ReactDOM.render(el, this);\n }\n }\n}\n"],"file":"index.js"}
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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
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
- return /*#__PURE__*/_react["default"].createElement("div", {
101
- className: classes.root
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","root","dudUrl","map","desc","shouldRenderPoint","rubricCol","__html","marginLeft","React","Component","object","isRequired","styles","flex"],"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,0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-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 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 } = this.props;\n if (value && value.points) {\n const { points, sampleAnswers } = value;\n\n return (\n <div className={classes.root}>\n <Link href={this.dudUrl} onClick={this.toggleRubric}>\n {this.state.linkPrefix} Rubric\n </Link>\n <Collapse in={this.state.rubricOpen} timeout=\"auto\">\n <List component=\"nav\">\n {points.map(\n (desc, index) =>\n this.shouldRenderPoint(index, value) && (\n <React.Fragment key={index}>\n <ListItem key={`P${index}`}>\n <ListItemText\n className={classes.rubricCol}\n primary={`${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 </Collapse>\n </div>\n );\n } else {\n return null;\n }\n }\n}\n\nconst styles = () => ({\n rubricCol: {\n flex: '0 1 auto',\n },\n});\n\nexport default withStyles(styles)(Rubric);\n"],"file":"main.js"}
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,UAACC,KAAD,EAAQC,KAAR,EAAkB;AACpC,UAAI,CAACA,KAAK,CAACT,WAAX,EAAwB;AACtB,eAAO,IAAP;AACD,OAFD,MAEO;AACL,eAAOQ,KAAK,KAAK,CAAjB;AACD;AACF,KA1BkB;AAEjB,UAAKE,KAAL,GAAa;AACXC,MAAAA,UAAU,EAAE,KADD;AAEXC,MAAAA,UAAU,EAAE;AAFD,KAAb;AAIA,UAAKC,YAAL,GAAoB,MAAKA,YAAL,CAAkBC,IAAlB,gDAApB;AANiB;AAOlB;;;;WAQD,wBAAe;AACb,WAAKC,QAAL,CAAc;AAAEJ,QAAAA,UAAU,E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esContent":["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"}