@pie-element/complex-rubric 3.1.4-next.3 → 3.1.4
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 +12 -0
- package/configure/CHANGELOG.md +8 -0
- package/configure/lib/defaults.js +4 -4
- package/configure/lib/defaults.js.map +1 -1
- package/configure/package.json +3 -3
- package/configure/src/defaults.js +4 -4
- package/controller/CHANGELOG.md +12 -0
- package/controller/lib/defaults.js +21 -109
- package/controller/lib/defaults.js.map +1 -1
- package/controller/lib/index.js +5 -4
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +2 -2
- package/controller/src/__tests__/index.test.js +2 -2
- package/controller/src/defaults.js +18 -137
- package/controller/src/index.js +41 -34
- package/module/configure.js +34 -19
- package/module/controller.js +57 -170
- package/module/element.js +24 -9
- package/module/manifest.json +2 -2
- package/module/print.js +24 -9
- package/package.json +4 -4
package/module/controller.js
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
|
+
// todo the import from pie-lib/rubric WILL break pslb
|
|
2
|
+
// so don't use it unless you also test "yarn build"
|
|
3
|
+
const RUBRIC_TYPES$1 = {
|
|
4
|
+
SIMPLE_RUBRIC: 'simpleRubric',
|
|
5
|
+
MULTI_TRAIT_RUBRIC: 'multiTraitRubric',
|
|
6
|
+
'rubricless': 'rubricless',
|
|
7
|
+
};
|
|
8
|
+
|
|
1
9
|
const multiTraitDefaultModel = {
|
|
2
|
-
|
|
10
|
+
description: false,
|
|
11
|
+
excludeZero: false,
|
|
3
12
|
halfScoring: false,
|
|
4
13
|
pointLabels: true,
|
|
5
|
-
description: false,
|
|
6
|
-
standards: false,
|
|
7
14
|
scales: [],
|
|
8
|
-
|
|
15
|
+
standards: false,
|
|
16
|
+
visibleToStudent: true,
|
|
9
17
|
};
|
|
10
18
|
|
|
11
19
|
const rubricDefaultModel = {
|
|
12
20
|
points: ['', '', '', ''],
|
|
13
21
|
sampleAnswers: [null, null, null, null],
|
|
14
|
-
maxPoints:
|
|
22
|
+
maxPoints: 3,
|
|
15
23
|
excludeZero: false,
|
|
16
24
|
};
|
|
17
25
|
|
|
@@ -21,139 +29,12 @@ const rubriclessDefaultModel = {
|
|
|
21
29
|
rubriclessInstructionEnabled: true,
|
|
22
30
|
};
|
|
23
31
|
|
|
24
|
-
const multiTraitDefaultConfiguration = {
|
|
25
|
-
settingsPanelDisabled: false,
|
|
26
|
-
excludeZeroDialogBoxContent: {
|
|
27
|
-
title: 'Exclude 0 (Zero) from Score Point Values.',
|
|
28
|
-
text: `<div>
|
|
29
|
-
You are about to exclude 0 from score point values.
|
|
30
|
-
<br/>
|
|
31
|
-
Some of the existing data has to be changed.
|
|
32
|
-
<br/>
|
|
33
|
-
Please choose if you want to:
|
|
34
|
-
<ul>
|
|
35
|
-
<li>
|
|
36
|
-
shift Labels and Descriptions to the left
|
|
37
|
-
</li>
|
|
38
|
-
<li>
|
|
39
|
-
remove 0 column with its Label and Description
|
|
40
|
-
</li>
|
|
41
|
-
</ul>
|
|
42
|
-
</div>`,
|
|
43
|
-
},
|
|
44
|
-
includeZeroDialogBoxContent: {
|
|
45
|
-
title: 'Include 0 (Zero) in Score Point Values.',
|
|
46
|
-
text: `<div>
|
|
47
|
-
You are about to include 0 in score point values.
|
|
48
|
-
<br/>
|
|
49
|
-
Some of the existing data has to be changed.
|
|
50
|
-
<br/>
|
|
51
|
-
Please choose if you want to:
|
|
52
|
-
<ul>
|
|
53
|
-
<li>
|
|
54
|
-
shift Labels and Descriptions to the right
|
|
55
|
-
</li>
|
|
56
|
-
<li>
|
|
57
|
-
add 0 column with empty Label and Descriptions
|
|
58
|
-
</li>
|
|
59
|
-
</ul>
|
|
60
|
-
</div>`,
|
|
61
|
-
},
|
|
62
|
-
deleteScaleDialogBoxContent: {
|
|
63
|
-
title: 'Delete Scale',
|
|
64
|
-
text: 'Are you sure you want to delete this scale?',
|
|
65
|
-
},
|
|
66
|
-
maxPointsDialogBoxContent: {
|
|
67
|
-
title: 'Decreasing Max Points.',
|
|
68
|
-
text: ` You are about to decrease max score point value.
|
|
69
|
-
<br/>
|
|
70
|
-
All the Labels and Descriptions for scores above Max Point will be deleted.`,
|
|
71
|
-
},
|
|
72
|
-
spellCheck: {
|
|
73
|
-
label: 'Spellcheck',
|
|
74
|
-
settings: false,
|
|
75
|
-
enabled: true,
|
|
76
|
-
},
|
|
77
|
-
showExcludeZero: {
|
|
78
|
-
settings: true,
|
|
79
|
-
label: 'Exclude Zero',
|
|
80
|
-
},
|
|
81
|
-
showScorePointLabels: {
|
|
82
|
-
settings: true,
|
|
83
|
-
label: 'Show Score Point Labels',
|
|
84
|
-
},
|
|
85
|
-
showDescription: {
|
|
86
|
-
settings: true,
|
|
87
|
-
label: 'Show Description',
|
|
88
|
-
},
|
|
89
|
-
showVisibleToStudent: {
|
|
90
|
-
settings: true,
|
|
91
|
-
label: 'Visible to Student',
|
|
92
|
-
},
|
|
93
|
-
showHalfScoring: {
|
|
94
|
-
settings: true,
|
|
95
|
-
label: 'Half Scoring',
|
|
96
|
-
},
|
|
97
|
-
width: '900px',
|
|
98
|
-
// these should not be set to true (should not be used) for now
|
|
99
|
-
showStandards: {
|
|
100
|
-
settings: false,
|
|
101
|
-
label: 'Show Standards',
|
|
102
|
-
},
|
|
103
|
-
showLevelTagInput: {
|
|
104
|
-
settings: false,
|
|
105
|
-
label: 'Show Level Tag Input',
|
|
106
|
-
enabled: false,
|
|
107
|
-
},
|
|
108
|
-
dragAndDrop: {
|
|
109
|
-
settings: true,
|
|
110
|
-
label: 'Enable Drag and Drop',
|
|
111
|
-
enabled: false,
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const rubricDefaultConfiguration = {
|
|
116
|
-
showExcludeZero: {
|
|
117
|
-
settings: true,
|
|
118
|
-
label: 'Ability to exclude zero',
|
|
119
|
-
},
|
|
120
|
-
showMaxPoint: {
|
|
121
|
-
settings: true,
|
|
122
|
-
label: 'Show max points dropdown',
|
|
123
|
-
},
|
|
124
|
-
settingsPanelDisabled: false,
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const rubriclessDefaultConfiguration = {
|
|
128
|
-
showExcludeZero: {
|
|
129
|
-
settings: true,
|
|
130
|
-
label: 'Ability to exclude zero',
|
|
131
|
-
},
|
|
132
|
-
showMaxPoint: {
|
|
133
|
-
settings: true,
|
|
134
|
-
label: 'Show max points dropdown',
|
|
135
|
-
},
|
|
136
|
-
settingsPanelDisabled: false,
|
|
137
|
-
// shows us if it simple rubric or rubricless(simple rubric with less structure)
|
|
138
|
-
rubricless: true,
|
|
139
|
-
// scoring instruction for rubricless
|
|
140
|
-
rubriclessInstruction: {
|
|
141
|
-
settings: true,
|
|
142
|
-
label: 'Instruction',
|
|
143
|
-
},
|
|
144
|
-
maxMaxPoints: 100,
|
|
145
|
-
};
|
|
146
|
-
|
|
147
32
|
var defaults = {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
configuration: {
|
|
154
|
-
multiTraitRubric: multiTraitDefaultConfiguration,
|
|
155
|
-
simpleRubric: rubricDefaultConfiguration,
|
|
156
|
-
rubricless: rubriclessDefaultConfiguration,
|
|
33
|
+
rubricType: 'simpleRubric',
|
|
34
|
+
rubrics: {
|
|
35
|
+
[RUBRIC_TYPES$1.SIMPLE_RUBRIC]: rubricDefaultModel,
|
|
36
|
+
[RUBRIC_TYPES$1.MULTI_TRAIT_RUBRIC]: multiTraitDefaultModel,
|
|
37
|
+
[RUBRIC_TYPES$1.RUBRICLESS]: rubriclessDefaultModel,
|
|
157
38
|
},
|
|
158
39
|
};
|
|
159
40
|
|
|
@@ -161,7 +42,8 @@ const markupToText = (s) => {
|
|
|
161
42
|
return (s || '').replace(/(<([^>]+)>)/ig, '');
|
|
162
43
|
};
|
|
163
44
|
|
|
164
|
-
// todo the import from pie-lib/rubric
|
|
45
|
+
// todo the import from pie-lib/rubric WILL break pslb
|
|
46
|
+
// so don't use it unless you also test "yarn build"
|
|
165
47
|
const RUBRIC_TYPES = {
|
|
166
48
|
SIMPLE_RUBRIC: 'simpleRubric',
|
|
167
49
|
MULTI_TRAIT_RUBRIC: 'multiTraitRubric',
|
|
@@ -169,10 +51,10 @@ const RUBRIC_TYPES = {
|
|
|
169
51
|
};
|
|
170
52
|
|
|
171
53
|
function createDefaultModel(model = {}) {
|
|
172
|
-
return new Promise((resolve) => resolve({ ...defaults
|
|
54
|
+
return new Promise((resolve) => resolve({ ...defaults, ...model }));
|
|
173
55
|
}
|
|
174
56
|
|
|
175
|
-
const normalize = (question) => ({ ...defaults
|
|
57
|
+
const normalize = (question) => ({ ...defaults, ...question });
|
|
176
58
|
|
|
177
59
|
/**
|
|
178
60
|
* @param {*} question
|
|
@@ -182,20 +64,23 @@ const normalize = (question) => ({ ...defaults.model, ...question });
|
|
|
182
64
|
async function model(question, session, env) {
|
|
183
65
|
const normalizedQuestion = normalize(question);
|
|
184
66
|
|
|
185
|
-
if (
|
|
67
|
+
if (
|
|
68
|
+
normalizedQuestion.rubricType === RUBRIC_TYPES.SIMPLE_RUBRIC ||
|
|
69
|
+
normalizedQuestion.rubricType === RUBRIC_TYPES.RUBRICLESS
|
|
70
|
+
) {
|
|
186
71
|
return new Promise((resolve) => {
|
|
187
72
|
resolve(
|
|
188
73
|
env && env.role && env.role === 'instructor'
|
|
189
74
|
? {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
75
|
+
...normalizedQuestion,
|
|
76
|
+
rubrics: {
|
|
77
|
+
...normalizedQuestion.rubrics,
|
|
78
|
+
multiTraitRubric: {
|
|
79
|
+
...normalizedQuestion.rubrics.multiTraitRubric,
|
|
80
|
+
visible: false,
|
|
81
|
+
},
|
|
196
82
|
},
|
|
197
|
-
}
|
|
198
|
-
}
|
|
83
|
+
}
|
|
199
84
|
: {},
|
|
200
85
|
);
|
|
201
86
|
});
|
|
@@ -271,7 +156,7 @@ const validateSimpleRubric = (model) => {
|
|
|
271
156
|
if (!point || point === '<div></div>') {
|
|
272
157
|
pointsDescriptorsErrors[index] = 'Points descriptors cannot be empty.';
|
|
273
158
|
} else {
|
|
274
|
-
const identicalPointDescr = points.slice(index + 1).some(p => markupToText(p) === markupToText(point));
|
|
159
|
+
const identicalPointDescr = points.slice(index + 1).some((p) => markupToText(p) === markupToText(point));
|
|
275
160
|
|
|
276
161
|
if (identicalPointDescr) {
|
|
277
162
|
pointsDescriptorsErrors[index] = 'Points descriptors should be unique.';
|
|
@@ -300,12 +185,14 @@ const validateMultiTraitRubric = (model) => {
|
|
|
300
185
|
const scaleErrors = {};
|
|
301
186
|
const scorePointsLabelsErrors = {};
|
|
302
187
|
|
|
303
|
-
if(pointLabels) {
|
|
188
|
+
if (pointLabels) {
|
|
304
189
|
scorePointsLabels.forEach((scorePointLabel, scoreIndex) => {
|
|
305
190
|
if (!scorePointLabel || scorePointLabel === '<div></div>') {
|
|
306
191
|
scorePointsLabelsErrors[scoreIndex] = 'Points labels should not be empty.';
|
|
307
192
|
} else {
|
|
308
|
-
const identicalScorePointLabel = scorePointsLabels
|
|
193
|
+
const identicalScorePointLabel = scorePointsLabels
|
|
194
|
+
.slice(scoreIndex + 1)
|
|
195
|
+
.some((s) => markupToText(s) === markupToText(scorePointLabel));
|
|
309
196
|
|
|
310
197
|
if (identicalScorePointLabel) {
|
|
311
198
|
scorePointsLabelsErrors[scoreIndex] = 'Points labels should be unique.';
|
|
@@ -314,50 +201,50 @@ const validateMultiTraitRubric = (model) => {
|
|
|
314
201
|
});
|
|
315
202
|
}
|
|
316
203
|
|
|
317
|
-
if(Object.keys(scorePointsLabelsErrors).length > 0){
|
|
204
|
+
if (Object.keys(scorePointsLabelsErrors).length > 0) {
|
|
318
205
|
scorePointsErrors[scaleIndex] = scorePointsLabelsErrors;
|
|
319
206
|
}
|
|
320
207
|
|
|
321
208
|
traits.forEach((trait, traitIndex) => {
|
|
322
|
-
if(!trait.name || trait.name === '<div></div>') {
|
|
323
|
-
scaleErrors[traitIndex] = {name: 'Trait names should not be empty.'};
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
|
|
209
|
+
if (!trait.name || trait.name === '<div></div>') {
|
|
210
|
+
scaleErrors[traitIndex] = { name: 'Trait names should not be empty.' };
|
|
211
|
+
} else {
|
|
212
|
+
const identicalTraitName = traits
|
|
213
|
+
.slice(traitIndex + 1)
|
|
214
|
+
.some((t) => markupToText(t.name) === markupToText(trait.name));
|
|
327
215
|
|
|
328
216
|
if (identicalTraitName) {
|
|
329
|
-
scaleErrors[traitIndex] = {name: 'Trait names should be unique.'};
|
|
217
|
+
scaleErrors[traitIndex] = { name: 'Trait names should be unique.' };
|
|
330
218
|
}
|
|
331
219
|
}
|
|
332
|
-
if(description && (!trait.description || trait.description === '<div></div>')) {
|
|
333
|
-
scaleErrors[traitIndex] = {...
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
|
|
220
|
+
if (description && (!trait.description || trait.description === '<div></div>')) {
|
|
221
|
+
scaleErrors[traitIndex] = { ...scaleErrors[traitIndex], description: 'Trait description should not be empty' };
|
|
222
|
+
} else {
|
|
223
|
+
const identicalTraitDescr = traits
|
|
224
|
+
.slice(traitIndex + 1)
|
|
225
|
+
.some((t) => markupToText(t.description) === markupToText(trait.description));
|
|
337
226
|
|
|
338
227
|
if (description && identicalTraitDescr) {
|
|
339
|
-
scaleErrors[traitIndex] = {...
|
|
228
|
+
scaleErrors[traitIndex] = { ...scaleErrors[traitIndex], description: 'Trait descriptions should be unique.' };
|
|
340
229
|
}
|
|
341
230
|
}
|
|
342
|
-
|
|
343
231
|
});
|
|
344
|
-
if(Object.keys(scaleErrors).length > 0){
|
|
232
|
+
if (Object.keys(scaleErrors).length > 0) {
|
|
345
233
|
traitsErrors[scaleIndex] = scaleErrors;
|
|
346
234
|
}
|
|
347
235
|
});
|
|
348
236
|
|
|
349
|
-
if(Object.keys(traitsErrors).length > 0){
|
|
237
|
+
if (Object.keys(traitsErrors).length > 0) {
|
|
350
238
|
errors.traitsErrors = traitsErrors;
|
|
351
239
|
}
|
|
352
240
|
|
|
353
|
-
if(Object.keys(scorePointsErrors).length > 0){
|
|
241
|
+
if (Object.keys(scorePointsErrors).length > 0) {
|
|
354
242
|
errors.scorePointsErrors = scorePointsErrors;
|
|
355
243
|
}
|
|
356
244
|
|
|
357
245
|
return errors;
|
|
358
246
|
};
|
|
359
247
|
|
|
360
|
-
|
|
361
248
|
const validate = (model = {}, config = {}) => {
|
|
362
249
|
const { rubrics = {}, rubricType } = model;
|
|
363
250
|
const { multiTraitRubric = {}, simpleRubric = {} } = rubrics;
|
package/module/element.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.12/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.11/module/index.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
5
5
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -32816,6 +32816,7 @@ toolbarButtons.RawMarkButton = RawMarkButton;
|
|
|
32816
32816
|
(0, _defineProperty2$R["default"])(RawMarkButton, "propTypes", {
|
|
32817
32817
|
onToggle: _propTypes$1n["default"].func.isRequired,
|
|
32818
32818
|
mark: _propTypes$1n["default"].string,
|
|
32819
|
+
label: _propTypes$1n["default"].string.isRequired,
|
|
32819
32820
|
children: _propTypes$1n["default"].oneOfType([_propTypes$1n["default"].arrayOf(_propTypes$1n["default"].node), _propTypes$1n["default"].node]).isRequired,
|
|
32820
32821
|
classes: _propTypes$1n["default"].object.isRequired,
|
|
32821
32822
|
active: _propTypes$1n["default"].bool
|
|
@@ -87661,12 +87662,19 @@ const require$$10$r = _dll_debug;
|
|
|
87661
87662
|
if (props.isMark) {
|
|
87662
87663
|
var isActive = (0, _utils.hasMark)(props.value, props.type);
|
|
87663
87664
|
log('[ToolbarButton] mark:isActive: ', isActive);
|
|
87665
|
+
var ariaLabel;
|
|
87666
|
+
if (props.type === 'sup') {
|
|
87667
|
+
ariaLabel = 'Superscript (marks text as superscripted)';
|
|
87668
|
+
} else if (props.type === 'sub') {
|
|
87669
|
+
ariaLabel = 'Subscript (marks text as subscripted)';
|
|
87670
|
+
} else {
|
|
87671
|
+
ariaLabel = props.type;
|
|
87672
|
+
}
|
|
87664
87673
|
return _react["default"].createElement(_toolbarButtons.MarkButton, {
|
|
87665
87674
|
active: isActive,
|
|
87666
|
-
label: props.type,
|
|
87667
87675
|
onToggle: onToggle,
|
|
87668
87676
|
mark: props.type,
|
|
87669
|
-
|
|
87677
|
+
label: ariaLabel
|
|
87670
87678
|
}, props.icon);
|
|
87671
87679
|
} else {
|
|
87672
87680
|
var disabled = props.disabled;
|
|
@@ -90487,7 +90495,8 @@ const require$$3$A = _dll_prop_types;
|
|
|
90487
90495
|
border: '1px solid #C0C3CF',
|
|
90488
90496
|
boxSizing: 'border-box',
|
|
90489
90497
|
borderRadius: '3px',
|
|
90490
|
-
position: 'relative'
|
|
90498
|
+
position: 'relative',
|
|
90499
|
+
alignItems: 'center'
|
|
90491
90500
|
}
|
|
90492
90501
|
}, _react["default"].createElement("div", {
|
|
90493
90502
|
style: {
|
|
@@ -90495,13 +90504,17 @@ const require$$3$A = _dll_prop_types;
|
|
|
90495
90504
|
overflow: 'hidden',
|
|
90496
90505
|
padding: '0 25px 0 8px',
|
|
90497
90506
|
whiteSpace: 'nowrap',
|
|
90498
|
-
textOverflow: 'ellipsis'
|
|
90499
|
-
|
|
90507
|
+
textOverflow: 'ellipsis'
|
|
90508
|
+
}
|
|
90509
|
+
}, _react["default"].createElement("span", {
|
|
90510
|
+
style: {
|
|
90511
|
+
display: 'inline-block',
|
|
90512
|
+
verticalAlign: 'middle'
|
|
90500
90513
|
},
|
|
90501
90514
|
dangerouslySetInnerHTML: {
|
|
90502
90515
|
__html: html
|
|
90503
90516
|
}
|
|
90504
|
-
}), _react["default"].createElement(_icons.Chevron, {
|
|
90517
|
+
})), _react["default"].createElement(_icons.Chevron, {
|
|
90505
90518
|
direction: "down",
|
|
90506
90519
|
style: {
|
|
90507
90520
|
position: 'absolute',
|
|
@@ -103894,6 +103907,7 @@ function UndoRedo(type) {
|
|
|
103894
103907
|
toolbar: {
|
|
103895
103908
|
type: type,
|
|
103896
103909
|
icon: _react$1c["default"].createElement(IconToUse, null),
|
|
103910
|
+
ariaLabel: type === 'undo' ? 'Undo (revert the last action)' : 'Redo (reapply the last undone action)',
|
|
103897
103911
|
onClick: function onClick(value, onChange) {
|
|
103898
103912
|
var change = value.change();
|
|
103899
103913
|
onChange(change[type]());
|
|
@@ -112760,7 +112774,8 @@ const require$$23 = _dll_classnames;
|
|
|
112760
112774
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderPlaceholder", function (props) {
|
|
112761
112775
|
var editor = props.editor;
|
|
112762
112776
|
var document = editor.value.document;
|
|
112763
|
-
|
|
112777
|
+
var stateValue = _this.state.value;
|
|
112778
|
+
if (!editor.props.placeholder || document.text !== '' || document.nodes.size !== 1 || !document.isEmpty || stateValue.isFocused) {
|
|
112764
112779
|
return false;
|
|
112765
112780
|
}
|
|
112766
112781
|
return _react["default"].createElement("span", {
|
package/module/manifest.json
CHANGED
package/module/print.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.
|
|
2
|
-
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.
|
|
1
|
+
import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_pie_lib__pie_toolbox_math_rendering_accessible, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@2.0.12/module/index.js";
|
|
2
|
+
import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@5.0.11/module/index.js";
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
5
5
|
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
@@ -32816,6 +32816,7 @@ toolbarButtons.RawMarkButton = RawMarkButton;
|
|
|
32816
32816
|
(0, _defineProperty2$R["default"])(RawMarkButton, "propTypes", {
|
|
32817
32817
|
onToggle: _propTypes$1n["default"].func.isRequired,
|
|
32818
32818
|
mark: _propTypes$1n["default"].string,
|
|
32819
|
+
label: _propTypes$1n["default"].string.isRequired,
|
|
32819
32820
|
children: _propTypes$1n["default"].oneOfType([_propTypes$1n["default"].arrayOf(_propTypes$1n["default"].node), _propTypes$1n["default"].node]).isRequired,
|
|
32820
32821
|
classes: _propTypes$1n["default"].object.isRequired,
|
|
32821
32822
|
active: _propTypes$1n["default"].bool
|
|
@@ -87661,12 +87662,19 @@ const require$$10$r = _dll_debug;
|
|
|
87661
87662
|
if (props.isMark) {
|
|
87662
87663
|
var isActive = (0, _utils.hasMark)(props.value, props.type);
|
|
87663
87664
|
log('[ToolbarButton] mark:isActive: ', isActive);
|
|
87665
|
+
var ariaLabel;
|
|
87666
|
+
if (props.type === 'sup') {
|
|
87667
|
+
ariaLabel = 'Superscript (marks text as superscripted)';
|
|
87668
|
+
} else if (props.type === 'sub') {
|
|
87669
|
+
ariaLabel = 'Subscript (marks text as subscripted)';
|
|
87670
|
+
} else {
|
|
87671
|
+
ariaLabel = props.type;
|
|
87672
|
+
}
|
|
87664
87673
|
return _react["default"].createElement(_toolbarButtons.MarkButton, {
|
|
87665
87674
|
active: isActive,
|
|
87666
|
-
label: props.type,
|
|
87667
87675
|
onToggle: onToggle,
|
|
87668
87676
|
mark: props.type,
|
|
87669
|
-
|
|
87677
|
+
label: ariaLabel
|
|
87670
87678
|
}, props.icon);
|
|
87671
87679
|
} else {
|
|
87672
87680
|
var disabled = props.disabled;
|
|
@@ -90487,7 +90495,8 @@ const require$$3$A = _dll_prop_types;
|
|
|
90487
90495
|
border: '1px solid #C0C3CF',
|
|
90488
90496
|
boxSizing: 'border-box',
|
|
90489
90497
|
borderRadius: '3px',
|
|
90490
|
-
position: 'relative'
|
|
90498
|
+
position: 'relative',
|
|
90499
|
+
alignItems: 'center'
|
|
90491
90500
|
}
|
|
90492
90501
|
}, _react["default"].createElement("div", {
|
|
90493
90502
|
style: {
|
|
@@ -90495,13 +90504,17 @@ const require$$3$A = _dll_prop_types;
|
|
|
90495
90504
|
overflow: 'hidden',
|
|
90496
90505
|
padding: '0 25px 0 8px',
|
|
90497
90506
|
whiteSpace: 'nowrap',
|
|
90498
|
-
textOverflow: 'ellipsis'
|
|
90499
|
-
|
|
90507
|
+
textOverflow: 'ellipsis'
|
|
90508
|
+
}
|
|
90509
|
+
}, _react["default"].createElement("span", {
|
|
90510
|
+
style: {
|
|
90511
|
+
display: 'inline-block',
|
|
90512
|
+
verticalAlign: 'middle'
|
|
90500
90513
|
},
|
|
90501
90514
|
dangerouslySetInnerHTML: {
|
|
90502
90515
|
__html: html
|
|
90503
90516
|
}
|
|
90504
|
-
}), _react["default"].createElement(_icons.Chevron, {
|
|
90517
|
+
})), _react["default"].createElement(_icons.Chevron, {
|
|
90505
90518
|
direction: "down",
|
|
90506
90519
|
style: {
|
|
90507
90520
|
position: 'absolute',
|
|
@@ -103894,6 +103907,7 @@ function UndoRedo(type) {
|
|
|
103894
103907
|
toolbar: {
|
|
103895
103908
|
type: type,
|
|
103896
103909
|
icon: _react$1c["default"].createElement(IconToUse, null),
|
|
103910
|
+
ariaLabel: type === 'undo' ? 'Undo (revert the last action)' : 'Redo (reapply the last undone action)',
|
|
103897
103911
|
onClick: function onClick(value, onChange) {
|
|
103898
103912
|
var change = value.change();
|
|
103899
103913
|
onChange(change[type]());
|
|
@@ -112760,7 +112774,8 @@ const require$$23 = _dll_classnames;
|
|
|
112760
112774
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "renderPlaceholder", function (props) {
|
|
112761
112775
|
var editor = props.editor;
|
|
112762
112776
|
var document = editor.value.document;
|
|
112763
|
-
|
|
112777
|
+
var stateValue = _this.state.value;
|
|
112778
|
+
if (!editor.props.placeholder || document.text !== '' || document.nodes.size !== 1 || !document.isEmpty || stateValue.isFocused) {
|
|
112764
112779
|
return false;
|
|
112765
112780
|
}
|
|
112766
112781
|
return _react["default"].createElement("span", {
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/complex-rubric",
|
|
3
3
|
"repository": "pie-framework/pie-elements",
|
|
4
|
-
"version": "3.1.4
|
|
4
|
+
"version": "3.1.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@material-ui/core": "^3.9.2",
|
|
10
|
-
"@pie-element/multi-trait-rubric": "^4.1.4
|
|
11
|
-
"@pie-element/rubric": "^4.1.4
|
|
10
|
+
"@pie-element/multi-trait-rubric": "^4.1.4",
|
|
11
|
+
"@pie-element/rubric": "^4.1.4",
|
|
12
12
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
13
13
|
"classnames": "^2.2.5",
|
|
14
14
|
"debug": "^4.1.1",
|
|
15
15
|
"lodash": "^4.17.11",
|
|
16
16
|
"prop-types": "^15.7.2"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "e017f0f51cfcabb6300719a2fa2309277404ce01",
|
|
19
19
|
"scripts": {
|
|
20
20
|
"postpublish": "../../scripts/postpublish"
|
|
21
21
|
},
|