@pie-element/multi-trait-rubric 6.2.0 → 6.2.1-mui-update.1

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.
@@ -1,274 +1,182 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.UnderlinedInput = exports.SimpleInput = exports.SecondaryBlock = exports.ScorePoint = exports.ScaleSettings = exports.Row = exports.PrimaryBlockWidth = exports.PrimaryBlock = exports.MultiTraitButton = exports.MaxPointsPicker = exports.HeaderHeightLarge = exports.HeaderHeight = exports.ExpandedInput = exports.DragHandleSpace = exports.BlockWidth = exports.Block = exports.Arrow = void 0;
9
-
10
8
  var _react = _interopRequireDefault(require("react"));
11
-
12
- var _classnames = _interopRequireDefault(require("classnames"));
13
-
14
- var _styles = require("@material-ui/core/styles");
15
-
9
+ var _styles = require("@mui/material/styles");
16
10
  var _editableHtml = _interopRequireDefault(require("@pie-lib/editable-html"));
17
-
18
- var _FormControl = _interopRequireDefault(require("@material-ui/core/FormControl"));
19
-
20
- var _InputLabel = _interopRequireDefault(require("@material-ui/core/InputLabel"));
21
-
22
- var _Select = _interopRequireDefault(require("@material-ui/core/Select"));
23
-
24
- var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
25
-
26
- var _InputBase = _interopRequireDefault(require("@material-ui/core/InputBase"));
27
-
11
+ var _Select = _interopRequireDefault(require("@mui/material/Select"));
12
+ var _MenuItem = _interopRequireDefault(require("@mui/material/MenuItem"));
13
+ var _InputBase = _interopRequireDefault(require("@mui/material/InputBase"));
28
14
  var _renderUi = require("@pie-lib/render-ui");
29
-
30
- var _grey = _interopRequireDefault(require("@material-ui/core/colors/grey"));
31
-
32
15
  var _utils = require("./utils");
16
+ var _colors = require("@mui/material/colors");
17
+ const InputHeight = '120px';
18
+ const BlockWidth = exports.BlockWidth = 200;
19
+ const PrimaryBlockWidth = exports.PrimaryBlockWidth = 200;
20
+ const DragHandleSpace = exports.DragHandleSpace = 32;
21
+ const HeaderHeight = exports.HeaderHeight = '100px';
22
+ const HeaderHeightLarge = exports.HeaderHeightLarge = '160px';
23
+ const greyBorder = `solid 1px ${_colors.grey[400]}`;
24
+ const Padding = '8px 4px';
33
25
 
34
- var BlockWidth = 200;
35
- exports.BlockWidth = BlockWidth;
36
- var PrimaryBlockWidth = 200;
37
- exports.PrimaryBlockWidth = PrimaryBlockWidth;
38
- var DragHandleSpace = 32;
39
- exports.DragHandleSpace = DragHandleSpace;
40
- var HeaderHeight = '100px';
41
- exports.HeaderHeight = HeaderHeight;
42
- var HeaderHeightLarge = '160px';
43
- exports.HeaderHeightLarge = HeaderHeightLarge;
44
- var InputHeight = '120px';
45
- var greyBorder = "solid 1px ".concat(_grey["default"][400]);
46
- var Padding = '8px 4px';
47
- var MultiTraitButton = (0, _styles.withStyles)(function (theme) {
48
- return {
49
- button: {
50
- fontSize: theme.typography.fontSize + 2,
51
- textAlign: 'right',
52
- display: 'flex',
53
- flexDirection: 'row',
54
- alignItems: 'flex-start',
55
- padding: "".concat(theme.spacing.unit * 1.5, "px ").concat(theme.spacing.unit * 2, "px"),
56
- width: '114px',
57
- background: _renderUi.color.secondaryBackground(),
58
- borderRadius: '4px',
59
- justifyContent: 'space-around',
60
- color: _renderUi.color.text(),
61
- cursor: 'pointer'
26
+ // global styles for EditableHtml components
27
+ const GlobalStyles = (0, _styles.styled)('div')(({
28
+ theme
29
+ }) => ({
30
+ '& .editable-label': {
31
+ textAlign: 'left',
32
+ flex: 1,
33
+ border: 'none',
34
+ '& div': {
35
+ padding: 0,
36
+ border: 'none'
37
+ },
38
+ '& > div': {
39
+ borderLeft: greyBorder,
40
+ borderRadius: 0,
41
+ padding: Padding
62
42
  }
63
- };
64
- })(function (_ref) {
65
- var classes = _ref.classes,
66
- children = _ref.children,
67
- onClick = _ref.onClick;
68
- return /*#__PURE__*/_react["default"].createElement("div", {
69
- className: classes.button,
70
- onClick: onClick
71
- }, /*#__PURE__*/_react["default"].createElement("strong", null, "+"), /*#__PURE__*/_react["default"].createElement("div", null, children));
72
- });
43
+ },
44
+ '& .editable-level': {
45
+ background: theme.palette.common.white,
46
+ width: '60%'
47
+ },
48
+ '& .underlined-editable-level': {
49
+ background: theme.palette.common.white,
50
+ width: '100%',
51
+ '& div': {
52
+ padding: 0,
53
+ border: 'none'
54
+ },
55
+ '& > div': {
56
+ borderBottom: greyBorder,
57
+ borderRadius: 0,
58
+ padding: Padding
59
+ }
60
+ },
61
+ '& .expanded-input-prompt': {
62
+ border: 'none',
63
+ margin: '10px',
64
+ marginTop: 0
65
+ }
66
+ }));
67
+ const StyledButton = (0, _styles.styled)('div')(({
68
+ theme
69
+ }) => ({
70
+ fontSize: theme.typography.fontSize + 2,
71
+ textAlign: 'right',
72
+ display: 'flex',
73
+ flexDirection: 'row',
74
+ alignItems: 'flex-start',
75
+ padding: `${theme.spacing(1.5)} ${theme.spacing(2)}`,
76
+ width: '114px',
77
+ background: _renderUi.color.secondaryBackground(),
78
+ borderRadius: '4px',
79
+ justifyContent: 'space-around',
80
+ color: _renderUi.color.text(),
81
+ cursor: 'pointer'
82
+ }));
83
+ const MultiTraitButton = ({
84
+ children,
85
+ onClick
86
+ }) => /*#__PURE__*/_react.default.createElement(StyledButton, {
87
+ onClick: onClick
88
+ }, /*#__PURE__*/_react.default.createElement("strong", null, "+"), /*#__PURE__*/_react.default.createElement("div", null, children));
73
89
  exports.MultiTraitButton = MultiTraitButton;
74
- var PrimaryBlock = (0, _styles.withStyles)({
75
- primaryBlock: {
76
- width: "".concat(PrimaryBlockWidth, "px"),
77
- minWidth: "".concat(PrimaryBlockWidth, "px"),
78
- position: 'relative',
79
- padding: '0 10px',
80
- boxSizing: 'border-box'
90
+ const PrimaryBlock = exports.PrimaryBlock = (0, _styles.styled)('div')(({
91
+ theme
92
+ }) => ({
93
+ width: `${PrimaryBlockWidth}px`,
94
+ minWidth: `${PrimaryBlockWidth}px`,
95
+ position: 'relative',
96
+ padding: '0 10px',
97
+ boxSizing: 'border-box'
98
+ }));
99
+ const Block = exports.Block = (0, _styles.styled)('div')(({
100
+ theme
101
+ }) => ({
102
+ width: `${BlockWidth}px`,
103
+ minWidth: `${BlockWidth}px`,
104
+ '& ul, ol': {
105
+ marginBlockStart: 0,
106
+ paddingInlineStart: theme.spacing(2)
81
107
  }
82
- })(function (_ref2) {
83
- var classes = _ref2.classes,
84
- children = _ref2.children,
85
- className = _ref2.className;
86
- return /*#__PURE__*/_react["default"].createElement("div", {
87
- className: (0, _classnames["default"])(classes.primaryBlock, className)
88
- }, children);
89
- });
90
- exports.PrimaryBlock = PrimaryBlock;
91
- var Block = (0, _styles.withStyles)(function (theme) {
92
- return {
93
- block: {
94
- width: "".concat(BlockWidth, "px"),
95
- minWidth: "".concat(BlockWidth, "px"),
96
- '& ul, ol': {
97
- marginBlockStart: 0,
98
- paddingInlineStart: theme.spacing.unit * 2
99
- }
100
- }
101
- };
102
- })(function (_ref3) {
103
- var classes = _ref3.classes,
104
- children = _ref3.children;
105
- return /*#__PURE__*/_react["default"].createElement("div", {
106
- className: classes.block
107
- }, children);
108
- });
109
- exports.Block = Block;
110
- var SecondaryBlock = (0, _styles.withStyles)({
111
- secondaryBlock: {
108
+ }));
109
+ const StyledSecondaryBlock = (0, _styles.styled)('div')(({
110
+ theme
111
+ }) => ({
112
+ display: 'flex',
113
+ overflowX: 'hidden',
114
+ alignItems: 'flex-end',
115
+ // this is needed to show the editor toolbar!!!
116
+ paddingBottom: '30px'
117
+ }));
118
+ const SecondaryBlock = ({
119
+ children,
120
+ setRef,
121
+ width
122
+ }) => /*#__PURE__*/_react.default.createElement(StyledSecondaryBlock, {
123
+ style: {
124
+ width: width
125
+ },
126
+ ref: setRef
127
+ }, children);
128
+ exports.SecondaryBlock = SecondaryBlock;
129
+ const Row = ({
130
+ children,
131
+ height
132
+ }) => /*#__PURE__*/_react.default.createElement("div", {
133
+ style: {
112
134
  display: 'flex',
113
- overflowX: 'hidden',
114
- alignItems: 'flex-end',
115
- // this is needed to show the editor toolbar!!!
116
- paddingBottom: '30px'
135
+ height
117
136
  }
118
- })(function (_ref4) {
119
- var classes = _ref4.classes,
120
- children = _ref4.children,
121
- setRef = _ref4.setRef,
122
- width = _ref4.width;
123
- return /*#__PURE__*/_react["default"].createElement("div", {
124
- className: classes.secondaryBlock,
125
- style: {
126
- width: width
127
- },
128
- ref: setRef
129
- }, children);
137
+ }, children);
138
+ exports.Row = Row;
139
+ const ScorePointBoxWrapper = (0, _styles.styled)('div')({
140
+ padding: '0 10px'
130
141
  });
131
- exports.SecondaryBlock = SecondaryBlock;
132
- var Row = (0, _styles.withStyles)({
133
- row: {
134
- display: 'flex'
135
- }
136
- })(function (_ref5) {
137
- var classes = _ref5.classes,
138
- children = _ref5.children,
139
- className = _ref5.className,
140
- height = _ref5.height;
141
- return /*#__PURE__*/_react["default"].createElement("div", {
142
- className: (0, _classnames["default"])(classes.row, className),
143
- style: {
144
- height: height
145
- }
146
- }, children);
142
+ const ScorePointBox = (0, _styles.styled)('div')({
143
+ display: 'flex',
144
+ borderRadius: '4px',
145
+ background: 'white',
146
+ flexDirection: 'row',
147
+ alignItems: 'center',
148
+ justifyContent: 'space-between',
149
+ border: greyBorder
147
150
  });
148
- exports.Row = Row;
149
-
150
- var scorePointsStyles = function scorePointsStyles(theme) {
151
- return {
152
- scorePointBoxWrapper: {
153
- padding: '0 10px'
154
- },
155
- scorePointBox: {
156
- display: 'flex',
157
- borderRadius: '4px',
158
- background: 'white',
159
- flexDirection: 'row',
160
- alignItems: 'center',
161
- justifyContent: 'space-between',
162
- border: greyBorder
163
- },
164
- scorePointBoxDisabled: {
165
- background: 'none',
166
- justifyContent: 'center',
167
- border: '0'
168
- },
169
- subLabel: {
170
- width: '24px',
171
- textAlign: 'center'
172
- },
173
- editableLabel: {
174
- textAlign: 'left',
175
- flex: 1,
176
- border: 'none',
177
- '& div': {
178
- padding: 0
179
- },
180
- '& > div': {
181
- border: 'none',
182
- borderLeft: greyBorder,
183
- borderRadius: 0,
184
- padding: Padding
185
- }
186
- },
187
- slateEditor: {
188
- fontFamily: 'Cerebri'
189
- },
190
- errorText: {
191
- fontSize: theme.typography.fontSize - 2,
192
- color: theme.palette.error.main,
193
- paddingBottom: theme.spacing.unit
194
- }
195
- };
196
- };
197
-
198
- var ScorePoint = (0, _styles.withStyles)(function (theme) {
199
- return {
200
- scorePointBoxWrapper: {
201
- padding: '0 10px'
202
- },
203
- scorePointBox: {
204
- display: 'flex',
205
- borderRadius: '4px',
206
- background: 'white',
207
- flexDirection: 'row',
208
- alignItems: 'center',
209
- justifyContent: 'space-between',
210
- border: greyBorder
211
- },
212
- scorePointBoxDisabled: {
213
- background: 'none',
214
- justifyContent: 'center',
215
- border: '0'
216
- },
217
- subLabel: {
218
- width: '24px',
219
- textAlign: 'center'
220
- },
221
- editableLabel: {
222
- textAlign: 'left',
223
- flex: 1,
224
- border: 'none',
225
- '& div': {
226
- padding: 0
227
- },
228
- '& > div': {
229
- border: 'none',
230
- borderLeft: greyBorder,
231
- borderRadius: 0,
232
- padding: Padding
233
- }
234
- },
235
- slateEditor: {
236
- fontFamily: 'Cerebri'
237
- },
238
- errorText: {
239
- fontSize: theme.typography.fontSize - 2,
240
- color: theme.palette.error.main,
241
- paddingBottom: theme.spacing.unit
242
- }
243
- };
244
- })(function (_ref6) {
245
- var classes = _ref6.classes,
246
- _ref6$error = _ref6.error,
247
- error = _ref6$error === void 0 ? '' : _ref6$error,
248
- scorePointsValue = _ref6.scorePointsValue,
249
- scoreDescriptor = _ref6.scoreDescriptor,
250
- pluginProps = _ref6.pluginProps,
251
- onChange = _ref6.onChange,
252
- showScorePointLabels = _ref6.showScorePointLabels,
253
- alignToRight = _ref6.alignToRight,
254
- spellCheck = _ref6.spellCheck,
255
- uploadSoundSupport = _ref6.uploadSoundSupport,
256
- _ref6$imageSupport = _ref6.imageSupport,
257
- imageSupport = _ref6$imageSupport === void 0 ? {} : _ref6$imageSupport,
258
- _ref6$mathMlOptions = _ref6.mathMlOptions,
259
- mathMlOptions = _ref6$mathMlOptions === void 0 ? {} : _ref6$mathMlOptions;
260
- var scoreBoxClasses = showScorePointLabels ? classes.scorePointBox : "".concat(classes.scorePointBox, " ").concat(classes.scorePointBoxDisabled);
261
- return /*#__PURE__*/_react["default"].createElement("div", {
262
- className: classes.scorePointBoxWrapper
263
- }, /*#__PURE__*/_react["default"].createElement("div", {
264
- className: scoreBoxClasses
265
- }, /*#__PURE__*/_react["default"].createElement("div", {
266
- className: classes.subLabel
267
- }, scorePointsValue), showScorePointLabels ? /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
268
- className: classes.editableLabel,
269
- classes: {
270
- slateEditor: classes.slateEditor
271
- },
151
+ const ScorePointBoxDisabled = (0, _styles.styled)('div')({
152
+ display: 'flex',
153
+ borderRadius: '4px',
154
+ background: 'none',
155
+ flexDirection: 'row',
156
+ alignItems: 'center',
157
+ justifyContent: 'center',
158
+ border: '0'
159
+ });
160
+ const SubLabel = (0, _styles.styled)('div')({
161
+ width: '24px',
162
+ textAlign: 'center'
163
+ });
164
+ const ScorePoint = ({
165
+ error = '',
166
+ scorePointsValue,
167
+ scoreDescriptor,
168
+ pluginProps,
169
+ onChange,
170
+ showScorePointLabels,
171
+ alignToRight,
172
+ spellCheck,
173
+ uploadSoundSupport,
174
+ imageSupport = {},
175
+ mathMlOptions = {}
176
+ }) => {
177
+ const ScorePointBoxComponent = showScorePointLabels ? ScorePointBox : ScorePointBoxDisabled;
178
+ return /*#__PURE__*/_react.default.createElement(GlobalStyles, null, /*#__PURE__*/_react.default.createElement(ScorePointBoxWrapper, null, /*#__PURE__*/_react.default.createElement(ScorePointBoxComponent, null, /*#__PURE__*/_react.default.createElement(SubLabel, null, scorePointsValue), showScorePointLabels ? /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
179
+ className: "editable-label",
272
180
  error: error,
273
181
  markup: scoreDescriptor,
274
182
  placeholder: " Enter Label",
@@ -286,299 +194,236 @@ var ScorePoint = (0, _styles.withStyles)(function (theme) {
286
194
  language: 'special'
287
195
  }],
288
196
  mathMlOptions: mathMlOptions,
289
- imageSupport: imageSupport
290
- }) : null));
291
- });
292
- exports.ScorePoint = ScorePoint;
293
-
294
- var inputStyles = function inputStyles(theme) {
295
- return {
296
- root: {
297
- background: theme.palette.common.white,
298
- 'label + &': {
299
- marginTop: theme.spacing.unit * 2.5,
300
- marginBottom: 0,
301
- width: '80px'
302
- }
303
- },
304
- input: {
305
- borderRadius: '4px',
306
- position: 'relative',
307
- border: greyBorder,
308
- fontSize: theme.typography.fontSize,
309
- fontFamily: 'Cerebri Sans',
310
- padding: "".concat(theme.spacing.unit, "px ").concat(theme.spacing.unit * 1.5, "px"),
311
- '&:focus': {
312
- borderRadius: '4px'
313
- }
197
+ imageSupport: imageSupport,
198
+ slateEditorExtraStyles: {
199
+ fontFamily: 'Cerebri'
314
200
  }
315
- };
201
+ }) : null)));
316
202
  };
317
-
318
- var BootstrapInput = (0, _styles.withStyles)(inputStyles)(_InputBase["default"]);
319
-
320
- var createMaxScoreOptions = function createMaxScoreOptions(maxMaxPoints) {
321
- return Array.from({
322
- length: maxMaxPoints
323
- }, function (_, i) {
324
- return i + 1;
325
- });
326
- };
327
-
328
- var MaxPointsPicker = (0, _styles.withStyles)({})(function (_ref7) {
329
- var maxPoints = _ref7.maxPoints,
330
- onChange = _ref7.onChange,
331
- maxMaxPoints = _ref7.maxMaxPoints;
332
- return /*#__PURE__*/_react["default"].createElement(_FormControl["default"], null, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], null, "Max Points"), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
333
- value: maxPoints,
334
- onChange: onChange,
335
- input: /*#__PURE__*/_react["default"].createElement(BootstrapInput, null)
336
- }, createMaxScoreOptions(maxMaxPoints).map(function (maxScore) {
337
- return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
338
- key: "menu-item-".concat(maxScore),
339
- value: maxScore
340
- }, maxScore);
341
- })));
342
- });
343
- exports.MaxPointsPicker = MaxPointsPicker;
344
- var SimpleInput = (0, _styles.withStyles)(function (theme) {
345
- return {
346
- simpleInput: {
347
- display: 'flex',
348
- justifyContent: 'space-between',
349
- alignItems: 'center',
350
- margin: "".concat(theme.spacing.unit * 1.5, "px 0")
351
- },
352
- editableLevel: {
353
- background: theme.palette.common.white,
354
- width: '60%'
355
- },
356
- slateEditor: {
357
- fontFamily: 'Cerebri'
203
+ exports.ScorePoint = ScorePoint;
204
+ const StyledBootstrapInput = (0, _styles.styled)(_InputBase.default)(({
205
+ theme
206
+ }) => ({
207
+ '&.MuiInputBase-root': {
208
+ background: theme.palette.common.white,
209
+ marginTop: theme.spacing(1),
210
+ 'label + &': {
211
+ width: '80px'
358
212
  }
359
- };
360
- })(function (_ref8) {
361
- var classes = _ref8.classes,
362
- markup = _ref8.markup,
363
- onChange = _ref8.onChange,
364
- pluginProps = _ref8.pluginProps,
365
- label = _ref8.label,
366
- spellCheck = _ref8.spellCheck,
367
- uploadSoundSupport = _ref8.uploadSoundSupport,
368
- _ref8$mathMlOptions = _ref8.mathMlOptions,
369
- mathMlOptions = _ref8$mathMlOptions === void 0 ? {} : _ref8$mathMlOptions,
370
- _ref8$imageSupport = _ref8.imageSupport,
371
- imageSupport = _ref8$imageSupport === void 0 ? {} : _ref8$imageSupport;
372
- return /*#__PURE__*/_react["default"].createElement("div", {
373
- className: classes.simpleInput
374
- }, label && /*#__PURE__*/_react["default"].createElement("div", null, label), /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
375
- className: classes.editableLevel,
376
- classes: {
377
- slateEditor: classes.slateEditor
378
- },
379
- markup: markup,
380
- onChange: onChange,
381
- placeholder: "Trait Label",
382
- pluginProps: pluginProps,
383
- activePlugins: _utils.filteredDefaultPlugins,
384
- spellCheck: spellCheck,
385
- uploadSoundSupport: uploadSoundSupport,
386
- languageCharactersProps: [{
387
- language: 'spanish'
388
- }, {
389
- language: 'special'
390
- }],
391
- mathMlOptions: mathMlOptions,
392
- imageSupport: imageSupport
393
- }));
394
- });
395
- exports.SimpleInput = SimpleInput;
396
- var UnderlinedInput = (0, _styles.withStyles)(function (theme) {
397
- return {
398
- underlinedInputWrapper: {
399
- width: '100%',
400
- display: 'flex',
401
- justifyContent: 'center',
402
- alignItems: 'center'
403
- },
404
- editableLevel: {
405
- background: theme.palette.common.white,
406
- width: '100%',
407
- '& div': {
408
- padding: 0
409
- },
410
- '& > div': {
411
- border: 'none',
412
- borderBottom: greyBorder,
413
- borderRadius: 0,
414
- padding: Padding
415
- }
416
- },
417
- slateEditor: {
418
- fontFamily: 'Cerebri'
213
+ },
214
+ '& .MuiInputBase-input': {
215
+ borderRadius: '4px',
216
+ position: 'relative',
217
+ border: greyBorder,
218
+ fontSize: theme.typography.fontSize,
219
+ fontFamily: 'Cerebri Sans',
220
+ padding: `${theme.spacing(1)} ${theme.spacing(1.5)}`,
221
+ '&:focus': {
222
+ borderRadius: '4px'
419
223
  }
420
- };
421
- })(function (_ref9) {
422
- var classes = _ref9.classes,
423
- error = _ref9.error,
424
- markup = _ref9.markup,
425
- onChange = _ref9.onChange,
426
- pluginProps = _ref9.pluginProps,
427
- label = _ref9.label,
428
- placeholder = _ref9.placeholder,
429
- spellCheck = _ref9.spellCheck,
430
- uploadSoundSupport = _ref9.uploadSoundSupport,
431
- _ref9$imageSupport = _ref9.imageSupport,
432
- imageSupport = _ref9$imageSupport === void 0 ? {} : _ref9$imageSupport,
433
- _ref9$mathMlOptions = _ref9.mathMlOptions,
434
- mathMlOptions = _ref9$mathMlOptions === void 0 ? {} : _ref9$mathMlOptions;
435
- return /*#__PURE__*/_react["default"].createElement("div", {
436
- className: classes.underlinedInputWrapper
437
- }, label && /*#__PURE__*/_react["default"].createElement("div", null, label), /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
438
- className: classes.editableLevel,
439
- classes: {
440
- slateEditor: classes.slateEditor
441
- },
442
- error: error,
443
- markup: markup,
444
- onChange: onChange,
445
- placeholder: placeholder,
446
- pluginProps: pluginProps,
447
- activePlugins: _utils.filteredDefaultPlugins,
448
- spellCheck: spellCheck,
449
- uploadSoundSupport: uploadSoundSupport,
450
- languageCharactersProps: [{
451
- language: 'spanish'
452
- }, {
453
- language: 'special'
454
- }],
455
- mathMlOptions: mathMlOptions,
456
- imageSupport: imageSupport
457
- }));
224
+ }
225
+ }));
226
+ const createMaxScoreOptions = maxMaxPoints => Array.from({
227
+ length: maxMaxPoints
228
+ }, (_, i) => i + 1);
229
+ const MaxPointsPicker = ({
230
+ maxPoints,
231
+ onChange,
232
+ maxMaxPoints
233
+ }) => /*#__PURE__*/_react.default.createElement(_renderUi.InputContainer, {
234
+ label: "Max Points"
235
+ }, /*#__PURE__*/_react.default.createElement(_Select.default, {
236
+ value: maxPoints,
237
+ onChange: onChange,
238
+ input: /*#__PURE__*/_react.default.createElement(StyledBootstrapInput, null),
239
+ MenuProps: {
240
+ transitionDuration: {
241
+ enter: 225,
242
+ exit: 195
243
+ }
244
+ }
245
+ }, createMaxScoreOptions(maxMaxPoints).map(maxScore => /*#__PURE__*/_react.default.createElement(_MenuItem.default, {
246
+ key: `menu-item-${maxScore}`,
247
+ value: maxScore
248
+ }, maxScore))));
249
+ exports.MaxPointsPicker = MaxPointsPicker;
250
+ const SimpleInputWrapper = (0, _styles.styled)('div')(({
251
+ theme
252
+ }) => ({
253
+ display: 'flex',
254
+ justifyContent: 'space-between',
255
+ alignItems: 'center',
256
+ margin: `${theme.spacing(1.5)} 0`
257
+ }));
258
+ const SimpleInput = ({
259
+ markup,
260
+ onChange,
261
+ pluginProps,
262
+ label,
263
+ spellCheck,
264
+ uploadSoundSupport,
265
+ mathMlOptions = {},
266
+ imageSupport = {}
267
+ }) => /*#__PURE__*/_react.default.createElement(GlobalStyles, null, /*#__PURE__*/_react.default.createElement(SimpleInputWrapper, null, label && /*#__PURE__*/_react.default.createElement("div", null, label), /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
268
+ className: "editable-level",
269
+ markup: markup,
270
+ onChange: onChange,
271
+ placeholder: "Trait Label",
272
+ pluginProps: pluginProps,
273
+ activePlugins: _utils.filteredDefaultPlugins,
274
+ spellCheck: spellCheck,
275
+ uploadSoundSupport: uploadSoundSupport,
276
+ languageCharactersProps: [{
277
+ language: 'spanish'
278
+ }, {
279
+ language: 'special'
280
+ }],
281
+ mathMlOptions: mathMlOptions,
282
+ imageSupport: imageSupport,
283
+ slateEditorExtraStyles: {
284
+ fontFamily: 'Cerebri'
285
+ }
286
+ })));
287
+ exports.SimpleInput = SimpleInput;
288
+ const UnderlinedInputWrapper = (0, _styles.styled)('div')({
289
+ width: '100%',
290
+ display: 'flex',
291
+ justifyContent: 'center',
292
+ alignItems: 'center'
458
293
  });
294
+ const UnderlinedInput = ({
295
+ error,
296
+ markup,
297
+ onChange,
298
+ pluginProps,
299
+ label,
300
+ placeholder,
301
+ spellCheck,
302
+ uploadSoundSupport,
303
+ imageSupport = {},
304
+ mathMlOptions = {}
305
+ }) => /*#__PURE__*/_react.default.createElement(GlobalStyles, null, /*#__PURE__*/_react.default.createElement(UnderlinedInputWrapper, null, label && /*#__PURE__*/_react.default.createElement("div", null, label), /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
306
+ className: "underlined-editable-level",
307
+ error: error,
308
+ markup: markup,
309
+ onChange: onChange,
310
+ placeholder: placeholder,
311
+ pluginProps: pluginProps,
312
+ activePlugins: _utils.filteredDefaultPlugins,
313
+ spellCheck: spellCheck,
314
+ uploadSoundSupport: uploadSoundSupport,
315
+ languageCharactersProps: [{
316
+ language: 'spanish'
317
+ }, {
318
+ language: 'special'
319
+ }],
320
+ mathMlOptions: mathMlOptions,
321
+ imageSupport: imageSupport,
322
+ slateEditorExtraStyles: {
323
+ fontFamily: 'Cerebri'
324
+ }
325
+ })));
459
326
  exports.UnderlinedInput = UnderlinedInput;
460
- var ExpandedInput = (0, _styles.withStyles)({
461
- slateEditor: {
327
+ const ExpandedInput = ({
328
+ error,
329
+ markup,
330
+ onChange,
331
+ pluginProps,
332
+ placeholder,
333
+ alignToRight,
334
+ spellCheck,
335
+ uploadSoundSupport,
336
+ mathMlOptions = {},
337
+ imageSupport = {}
338
+ }) => /*#__PURE__*/_react.default.createElement(GlobalStyles, null, /*#__PURE__*/_react.default.createElement(_editableHtml.default, {
339
+ className: "expanded-input-prompt",
340
+ error: error,
341
+ markup: markup,
342
+ onChange: onChange,
343
+ placeholder: placeholder,
344
+ pluginProps: pluginProps,
345
+ toolbarOpts: alignToRight ? {
346
+ alignment: 'right'
347
+ } : {},
348
+ spellCheck: spellCheck,
349
+ uploadSoundSupport: uploadSoundSupport,
350
+ languageCharactersProps: [{
351
+ language: 'spanish'
352
+ }, {
353
+ language: 'special'
354
+ }],
355
+ autoWidthToolbar: true,
356
+ mathMlOptions: mathMlOptions,
357
+ imageSupport: imageSupport,
358
+ slateEditorExtraStyles: {
462
359
  fontFamily: 'Cerebri',
463
360
  height: InputHeight,
464
361
  padding: 0
465
- },
466
- prompt: {
467
- border: 'none',
468
- margin: '10px',
469
- marginTop: 0
470
362
  }
471
- })(function (_ref10) {
472
- var classes = _ref10.classes,
473
- error = _ref10.error,
474
- markup = _ref10.markup,
475
- onChange = _ref10.onChange,
476
- pluginProps = _ref10.pluginProps,
477
- placeholder = _ref10.placeholder,
478
- alignToRight = _ref10.alignToRight,
479
- spellCheck = _ref10.spellCheck,
480
- uploadSoundSupport = _ref10.uploadSoundSupport,
481
- _ref10$mathMlOptions = _ref10.mathMlOptions,
482
- mathMlOptions = _ref10$mathMlOptions === void 0 ? {} : _ref10$mathMlOptions,
483
- _ref10$imageSupport = _ref10.imageSupport,
484
- imageSupport = _ref10$imageSupport === void 0 ? {} : _ref10$imageSupport;
485
- return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
486
- className: classes.prompt,
487
- classes: {
488
- slateEditor: classes.slateEditor
489
- },
490
- error: error,
491
- markup: markup,
492
- onChange: onChange,
493
- placeholder: placeholder,
494
- pluginProps: pluginProps,
495
- toolbarOpts: alignToRight ? {
496
- alignment: 'right'
497
- } : {},
498
- spellCheck: spellCheck,
499
- uploadSoundSupport: uploadSoundSupport,
500
- languageCharactersProps: [{
501
- language: 'spanish'
502
- }, {
503
- language: 'special'
504
- }],
505
- autoWidthToolbar: true,
506
- mathMlOptions: mathMlOptions,
507
- imageSupport: imageSupport
508
- }));
509
- });
363
+ }));
510
364
  exports.ExpandedInput = ExpandedInput;
511
- var ScaleSettings = (0, _styles.withStyles)({
512
- scaleSettings: {
513
- display: 'flex',
514
- justifyContent: 'space-between',
515
- alignItems: 'flex-end'
365
+ const ScaleSettings = exports.ScaleSettings = (0, _styles.styled)('div')(({
366
+ theme
367
+ }) => ({
368
+ display: 'flex',
369
+ justifyContent: 'space-between',
370
+ alignItems: 'flex-end',
371
+ paddingBottom: '18px',
372
+ gap: theme.spacing(0.25)
373
+ }));
374
+ const StyledArrow = (0, _styles.styled)('div')(({
375
+ theme
376
+ }) => ({
377
+ position: 'absolute',
378
+ zIndex: 10,
379
+ cursor: 'pointer',
380
+ right: 0,
381
+ alignItems: 'flex-start',
382
+ justifyContent: 'center',
383
+ background: `linear-gradient(to left, ${theme.palette.common.white}, ${_renderUi.color.background()})`,
384
+ boxSizing: 'border-box'
385
+ }));
386
+ const StyledInnerGrey = (0, _styles.styled)('div')(({
387
+ theme
388
+ }) => ({
389
+ position: 'absolute',
390
+ zIndex: 11,
391
+ cursor: 'pointer',
392
+ right: 0,
393
+ alignItems: 'flex-start',
394
+ justifyContent: 'center',
395
+ background: `linear-gradient(to left, ${theme.palette.common.white}, ${_renderUi.color.background()})`,
396
+ boxSizing: 'border-box',
397
+ '& svg': {
398
+ position: 'absolute',
399
+ bottom: '-24px'
516
400
  }
517
- })(function (_ref11) {
518
- var classes = _ref11.classes,
519
- children = _ref11.children;
520
- return /*#__PURE__*/_react["default"].createElement("div", {
521
- className: classes.scaleSettings
522
- }, children);
523
- });
524
- exports.ScaleSettings = ScaleSettings;
525
- var Arrow = (0, _styles.withStyles)(function (theme) {
526
- return {
527
- arrow: {
528
- position: 'absolute',
529
- zIndex: 10,
530
- cursor: 'pointer',
531
- right: 0,
532
- alignItems: 'flex-start',
533
- justifyContent: 'center',
534
- background: "linear-gradient(to left, ".concat(theme.palette.common.white, ", ").concat(_renderUi.color.background(), ")"),
535
- boxSizing: 'border-box'
536
- },
537
- innerGrey: {
538
- position: 'absolute',
539
- zIndex: 11,
540
- cursor: 'pointer',
541
- right: 0,
542
- alignItems: 'flex-start',
543
- justifyContent: 'center',
544
- background: "linear-gradient(to left, ".concat(theme.palette.common.white, ", ").concat(_renderUi.color.background(), ")"),
545
- boxSizing: 'border-box',
546
- '& svg': {
547
- position: 'absolute',
548
- bottom: '-24px'
549
- }
550
- }
551
- };
552
- })(function (_ref12) {
553
- var classes = _ref12.classes,
554
- children = _ref12.children,
555
- className = _ref12.className,
556
- show = _ref12.show,
557
- width = _ref12.width,
558
- onClick = _ref12.onClick,
559
- left = _ref12.left,
560
- showLevelTagInput = _ref12.showLevelTagInput;
561
- return /*#__PURE__*/_react["default"].createElement("div", {
562
- className: (0, _classnames["default"])(classes.arrow, className),
563
- style: {
564
- height: '-webkit-fill-available',
565
- display: show ? 'flex' : 'none',
566
- width: width,
567
- left: left,
568
- background: left ? "linear-gradient(to right, white, ".concat(_renderUi.color.background(), ")") : undefined
569
- },
570
- onClick: onClick
571
- }, /*#__PURE__*/_react["default"].createElement("div", {
572
- className: (0, _classnames["default"])(classes.innerGrey, className),
573
- style: {
574
- display: show ? 'flex' : 'none',
575
- width: width,
576
- height: showLevelTagInput ? HeaderHeightLarge : HeaderHeight,
577
- left: 0,
578
- background: left ? "linear-gradient(to right, ".concat(_renderUi.color.secondaryBackground(), ", ").concat(_renderUi.color.background(), ")") : undefined
579
- },
580
- onClick: onClick
581
- }, children));
582
- });
401
+ }));
402
+ const Arrow = ({
403
+ children,
404
+ show,
405
+ width,
406
+ onClick,
407
+ left,
408
+ showLevelTagInput
409
+ }) => /*#__PURE__*/_react.default.createElement(StyledArrow, {
410
+ style: {
411
+ height: '-webkit-fill-available',
412
+ display: show ? 'flex' : 'none',
413
+ width: width,
414
+ left: left,
415
+ background: left ? `linear-gradient(to right, white, ${_renderUi.color.background()})` : undefined
416
+ },
417
+ onClick: onClick
418
+ }, /*#__PURE__*/_react.default.createElement(StyledInnerGrey, {
419
+ style: {
420
+ display: show ? 'flex' : 'none',
421
+ width: width,
422
+ height: showLevelTagInput ? HeaderHeightLarge : HeaderHeight,
423
+ left: 0,
424
+ background: left ? `linear-gradient(to right, ${_renderUi.color.secondaryBackground()}, ${_renderUi.color.background()})` : undefined
425
+ },
426
+ onClick: onClick
427
+ }, children));
583
428
  exports.Arrow = Arrow;
584
429
  //# sourceMappingURL=common.js.map