@pie-element/inline-dropdown 3.7.1-next.99 → 3.8.3-next.1008
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 +177 -0
- package/configure/CHANGELOG.md +152 -0
- package/configure/lib/defaults.js +23 -1
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +3 -3
- package/configure/lib/inline-dropdown-toolbar.js +13 -7
- package/configure/lib/inline-dropdown-toolbar.js.map +1 -1
- package/configure/lib/main.js +160 -18
- package/configure/lib/main.js.map +1 -1
- package/configure/lib/markupUtils.js +9 -2
- package/configure/lib/markupUtils.js.map +1 -1
- package/configure/lib/utils.js +16 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +4 -4
- package/controller/CHANGELOG.md +46 -0
- package/controller/lib/index.js +39 -6
- package/controller/lib/index.js.map +1 -1
- package/controller/package.json +1 -1
- package/docs/config-schema.json +100 -0
- package/docs/config-schema.json.md +77 -1
- package/docs/demo/generate.js +20 -10
- package/docs/pie-schema.json +49 -0
- package/docs/pie-schema.json.md +33 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/inline-dropdown.js +65 -18
- package/lib/inline-dropdown.js.map +1 -1
- package/package.json +6 -6
package/configure/lib/main.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -45,6 +45,8 @@ var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
|
45
45
|
|
|
46
46
|
var _reduce = _interopRequireDefault(require("lodash/reduce"));
|
|
47
47
|
|
|
48
|
+
var _max = _interopRequireDefault(require("lodash/max"));
|
|
49
|
+
|
|
48
50
|
var _styles = require("@material-ui/core/styles");
|
|
49
51
|
|
|
50
52
|
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
|
|
@@ -55,19 +57,35 @@ var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle
|
|
|
55
57
|
|
|
56
58
|
var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));
|
|
57
59
|
|
|
60
|
+
var _Tooltip = _interopRequireDefault(require("@material-ui/core/Tooltip"));
|
|
61
|
+
|
|
58
62
|
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
|
|
59
63
|
|
|
64
|
+
var _ExpansionPanel = _interopRequireDefault(require("@material-ui/core/ExpansionPanel"));
|
|
65
|
+
|
|
66
|
+
var _ExpansionPanelSummary = _interopRequireDefault(require("@material-ui/core/ExpansionPanelSummary"));
|
|
67
|
+
|
|
68
|
+
var _ExpansionPanelDetails = _interopRequireDefault(require("@material-ui/core/ExpansionPanelDetails"));
|
|
69
|
+
|
|
70
|
+
var _ExpandMore = _interopRequireDefault(require("@material-ui/icons/ExpandMore"));
|
|
71
|
+
|
|
72
|
+
var _Info = _interopRequireDefault(require("@material-ui/icons/Info"));
|
|
73
|
+
|
|
60
74
|
var _inlineDropdownToolbar = _interopRequireDefault(require("./inline-dropdown-toolbar"));
|
|
61
75
|
|
|
62
|
-
var
|
|
76
|
+
var _utils = require("./utils");
|
|
77
|
+
|
|
78
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
79
|
+
|
|
80
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
63
81
|
|
|
64
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
82
|
+
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; }
|
|
65
83
|
|
|
66
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
84
|
+
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; }
|
|
67
85
|
|
|
68
86
|
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); }; }
|
|
69
87
|
|
|
70
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try {
|
|
88
|
+
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; } }
|
|
71
89
|
|
|
72
90
|
var toggle = _configUi.settings.toggle,
|
|
73
91
|
Panel = _configUi.settings.Panel;
|
|
@@ -132,7 +150,34 @@ var styles = function styles(theme) {
|
|
|
132
150
|
fontFamily: 'Cerebri Sans',
|
|
133
151
|
fontSize: '16px',
|
|
134
152
|
lineHeight: '19px',
|
|
135
|
-
color: '#495B8F'
|
|
153
|
+
color: '#495B8F',
|
|
154
|
+
marginRight: '5px'
|
|
155
|
+
},
|
|
156
|
+
rationaleLabel: {
|
|
157
|
+
display: 'flex',
|
|
158
|
+
whiteSpace: 'break-spaces'
|
|
159
|
+
},
|
|
160
|
+
rationaleChoices: {
|
|
161
|
+
marginTop: '16px'
|
|
162
|
+
},
|
|
163
|
+
panelDetails: {
|
|
164
|
+
display: 'block'
|
|
165
|
+
},
|
|
166
|
+
flexContainer: {
|
|
167
|
+
display: 'flex',
|
|
168
|
+
alignItems: 'center',
|
|
169
|
+
marginBottom: '5px'
|
|
170
|
+
},
|
|
171
|
+
tooltip: {
|
|
172
|
+
fontSize: '12px',
|
|
173
|
+
whiteSpace: 'pre',
|
|
174
|
+
maxWidth: '500px'
|
|
175
|
+
},
|
|
176
|
+
errorText: {
|
|
177
|
+
fontSize: '12px',
|
|
178
|
+
color: 'red',
|
|
179
|
+
paddingTop: '5px',
|
|
180
|
+
marginTop: '8px'
|
|
136
181
|
}
|
|
137
182
|
};
|
|
138
183
|
};
|
|
@@ -183,6 +228,15 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
183
228
|
rationale: rationale
|
|
184
229
|
});
|
|
185
230
|
});
|
|
231
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onChoiceRationaleChanged", function (index, choice) {
|
|
232
|
+
var model = _this.props.model;
|
|
233
|
+
var indexOfChoice = model.choices && model.choices[index] && model.choices[index].findIndex(function (elem) {
|
|
234
|
+
return elem.label === choice.label && elem.value === choice.value;
|
|
235
|
+
});
|
|
236
|
+
model.choices[index] && model.choices[index].splice(indexOfChoice, 1, choice);
|
|
237
|
+
|
|
238
|
+
_this.onModelChange(model);
|
|
239
|
+
});
|
|
186
240
|
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "onTeacherInstructionsChanged", function (teacherInstructions) {
|
|
187
241
|
_this.onModelChange({
|
|
188
242
|
teacherInstructions: teacherInstructions
|
|
@@ -395,13 +449,70 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
395
449
|
lockChoiceOrder = _ref2$lockChoiceOrder === void 0 ? {} : _ref2$lockChoiceOrder,
|
|
396
450
|
_ref2$rationale = _ref2.rationale,
|
|
397
451
|
rationale = _ref2$rationale === void 0 ? {} : _ref2$rationale,
|
|
452
|
+
_ref2$choiceRationale = _ref2.choiceRationale,
|
|
453
|
+
choiceRationale = _ref2$choiceRationale === void 0 ? {} : _ref2$choiceRationale,
|
|
398
454
|
_ref2$teacherInstruct = _ref2.teacherInstructions,
|
|
399
|
-
teacherInstructions = _ref2$teacherInstruct === void 0 ? {} : _ref2$teacherInstruct
|
|
455
|
+
teacherInstructions = _ref2$teacherInstruct === void 0 ? {} : _ref2$teacherInstruct,
|
|
456
|
+
_ref2$spellCheck = _ref2.spellCheck,
|
|
457
|
+
spellCheck = _ref2$spellCheck === void 0 ? {} : _ref2$spellCheck,
|
|
458
|
+
maxResponseAreas = _ref2.maxResponseAreas,
|
|
459
|
+
_ref2$maxImageWidth = _ref2.maxImageWidth,
|
|
460
|
+
maxImageWidth = _ref2$maxImageWidth === void 0 ? {} : _ref2$maxImageWidth,
|
|
461
|
+
_ref2$maxImageHeight = _ref2.maxImageHeight,
|
|
462
|
+
maxImageHeight = _ref2$maxImageHeight === void 0 ? {} : _ref2$maxImageHeight;
|
|
400
463
|
|
|
401
464
|
var _ref3 = model || {},
|
|
402
465
|
rationaleEnabled = _ref3.rationaleEnabled,
|
|
466
|
+
choiceRationaleEnabled = _ref3.choiceRationaleEnabled,
|
|
403
467
|
promptEnabled = _ref3.promptEnabled,
|
|
404
|
-
teacherInstructionsEnabled = _ref3.teacherInstructionsEnabled
|
|
468
|
+
teacherInstructionsEnabled = _ref3.teacherInstructionsEnabled,
|
|
469
|
+
choices = _ref3.choices,
|
|
470
|
+
spellCheckEnabled = _ref3.spellCheckEnabled,
|
|
471
|
+
errors = _ref3.errors;
|
|
472
|
+
|
|
473
|
+
var _ref4 = errors || {},
|
|
474
|
+
responseAreasError = _ref4.responseAreasError;
|
|
475
|
+
|
|
476
|
+
var defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;
|
|
477
|
+
var defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;
|
|
478
|
+
|
|
479
|
+
var renderChoiceRationale = function renderChoiceRationale() {
|
|
480
|
+
return (Object.keys(choices) || []).map(function (key) {
|
|
481
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
482
|
+
key: key,
|
|
483
|
+
className: classes.rationaleChoices
|
|
484
|
+
}, /*#__PURE__*/_react["default"].createElement(_ExpansionPanel["default"], null, /*#__PURE__*/_react["default"].createElement(_ExpansionPanelSummary["default"], {
|
|
485
|
+
expandIcon: /*#__PURE__*/_react["default"].createElement(_ExpandMore["default"], null)
|
|
486
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
487
|
+
className: classes.text
|
|
488
|
+
}, "Rationale for response area #".concat(parseInt(key) + 1))), /*#__PURE__*/_react["default"].createElement(_ExpansionPanelDetails["default"], {
|
|
489
|
+
className: classes.panelDetails
|
|
490
|
+
}, (choices[key] || []).map(function (choice) {
|
|
491
|
+
return /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
492
|
+
key: choice.label,
|
|
493
|
+
label: /*#__PURE__*/_react["default"].createElement("span", {
|
|
494
|
+
className: classes.rationaleLabel,
|
|
495
|
+
dangerouslySetInnerHTML: {
|
|
496
|
+
__html: "".concat(rationale.label, " for ").concat(choice.label, " (").concat(choice.correct ? 'correct' : 'incorrect', ")")
|
|
497
|
+
}
|
|
498
|
+
}),
|
|
499
|
+
className: classes.promptHolder
|
|
500
|
+
}, /*#__PURE__*/_react["default"].createElement(_editableHtml["default"], {
|
|
501
|
+
className: classes.prompt,
|
|
502
|
+
markup: choice.rationale || '',
|
|
503
|
+
spellCheck: spellCheckEnabled,
|
|
504
|
+
onChange: function onChange(c) {
|
|
505
|
+
return _this2.onChoiceRationaleChanged(key, _objectSpread(_objectSpread({}, choice), {}, {
|
|
506
|
+
rationale: c
|
|
507
|
+
}));
|
|
508
|
+
},
|
|
509
|
+
imageSupport: imageSupport,
|
|
510
|
+
maxImageWidth: maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth,
|
|
511
|
+
maxImageHeight: maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight
|
|
512
|
+
}));
|
|
513
|
+
}))));
|
|
514
|
+
});
|
|
515
|
+
};
|
|
405
516
|
|
|
406
517
|
var toolbarOpts = {};
|
|
407
518
|
|
|
@@ -415,6 +526,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
415
526
|
break;
|
|
416
527
|
}
|
|
417
528
|
|
|
529
|
+
var validationMessage = (0, _utils.generateValidationMessage)(configuration);
|
|
418
530
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
419
531
|
className: classes.design
|
|
420
532
|
}, /*#__PURE__*/_react["default"].createElement(_configUi.layout.ConfigLayout, {
|
|
@@ -435,7 +547,9 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
435
547
|
Properties: {
|
|
436
548
|
teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),
|
|
437
549
|
rationaleEnabled: rationale.settings && toggle(rationale.label),
|
|
438
|
-
|
|
550
|
+
choiceRationaleEnabled: choiceRationale.settings && toggle(choiceRationale.label),
|
|
551
|
+
promptEnabled: prompt.settings && toggle(prompt.label),
|
|
552
|
+
spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label)
|
|
439
553
|
}
|
|
440
554
|
}
|
|
441
555
|
})
|
|
@@ -448,7 +562,10 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
448
562
|
onChange: this.onTeacherInstructionsChanged,
|
|
449
563
|
imageSupport: imageSupport,
|
|
450
564
|
nonEmpty: false,
|
|
451
|
-
toolbarOpts: toolbarOpts
|
|
565
|
+
toolbarOpts: toolbarOpts,
|
|
566
|
+
spellCheck: spellCheckEnabled,
|
|
567
|
+
maxImageWidth: maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth,
|
|
568
|
+
maxImageHeight: maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight
|
|
452
569
|
})), promptEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
453
570
|
label: prompt.label,
|
|
454
571
|
className: classes.promptHolder
|
|
@@ -459,7 +576,10 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
459
576
|
imageSupport: imageSupport,
|
|
460
577
|
nonEmpty: false,
|
|
461
578
|
disableUnderline: true,
|
|
462
|
-
toolbarOpts: toolbarOpts
|
|
579
|
+
toolbarOpts: toolbarOpts,
|
|
580
|
+
spellCheck: spellCheckEnabled,
|
|
581
|
+
maxImageWidth: defaultImageMaxWidth,
|
|
582
|
+
maxImageHeight: defaultImageMaxHeight
|
|
463
583
|
})), rationaleEnabled && /*#__PURE__*/_react["default"].createElement(_configUi.InputContainer, {
|
|
464
584
|
label: rationale.label,
|
|
465
585
|
className: classes.promptHolder
|
|
@@ -468,10 +588,28 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
468
588
|
markup: model.rationale || '',
|
|
469
589
|
onChange: this.onRationaleChanged,
|
|
470
590
|
imageSupport: imageSupport,
|
|
471
|
-
toolbarOpts: toolbarOpts
|
|
472
|
-
|
|
591
|
+
toolbarOpts: toolbarOpts,
|
|
592
|
+
spellCheck: spellCheckEnabled,
|
|
593
|
+
maxImageWidth: maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth,
|
|
594
|
+
maxImageHeight: maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight
|
|
595
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
596
|
+
className: classes.flexContainer
|
|
597
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
473
598
|
className: classes.text
|
|
474
|
-
}, "Define Template, Choices, and Correct Responses"), /*#__PURE__*/_react["default"].createElement(
|
|
599
|
+
}, "Define Template, Choices, and Correct Responses"), /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
600
|
+
classes: {
|
|
601
|
+
tooltip: classes.tooltip
|
|
602
|
+
},
|
|
603
|
+
disableFocusListener: true,
|
|
604
|
+
disableTouchListener: true,
|
|
605
|
+
placement: 'right',
|
|
606
|
+
title: validationMessage
|
|
607
|
+
}, /*#__PURE__*/_react["default"].createElement(_Info["default"], {
|
|
608
|
+
fontSize: 'small',
|
|
609
|
+
color: 'primary'
|
|
610
|
+
}))), responseAreasError && /*#__PURE__*/_react["default"].createElement("div", {
|
|
611
|
+
className: classes.errorText
|
|
612
|
+
}, responseAreasError), /*#__PURE__*/_react["default"].createElement(InfoDialog, {
|
|
475
613
|
open: dialog.open,
|
|
476
614
|
title: dialog.message,
|
|
477
615
|
onCancel: dialog.onCancel,
|
|
@@ -486,6 +624,7 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
486
624
|
options: {
|
|
487
625
|
duplicates: true
|
|
488
626
|
},
|
|
627
|
+
maxResponseAreas: maxResponseAreas,
|
|
489
628
|
respAreaToolbar: function respAreaToolbar(node, value, onToolbarDone) {
|
|
490
629
|
var respAreaChoices = _this2.state.respAreaChoices;
|
|
491
630
|
return function () {
|
|
@@ -501,19 +640,22 @@ var Main = /*#__PURE__*/function (_React$Component) {
|
|
|
501
640
|
node: node,
|
|
502
641
|
value: value,
|
|
503
642
|
onToolbarDone: onToolbarDone,
|
|
504
|
-
choices: respAreaChoices[node.data.get('index')]
|
|
643
|
+
choices: respAreaChoices[node.data.get('index')],
|
|
644
|
+
spellCheck: spellCheckEnabled
|
|
505
645
|
});
|
|
506
646
|
};
|
|
507
647
|
}
|
|
508
648
|
},
|
|
649
|
+
spellCheck: spellCheckEnabled,
|
|
509
650
|
className: classes.markup,
|
|
510
651
|
markup: model.slateMarkup || '',
|
|
511
652
|
onChange: this.onChange,
|
|
512
653
|
imageSupport: imageSupport,
|
|
513
654
|
onBlur: this.onBlur,
|
|
514
655
|
disabled: false,
|
|
515
|
-
highlightShape: false
|
|
516
|
-
|
|
656
|
+
highlightShape: false,
|
|
657
|
+
error: responseAreasError
|
|
658
|
+
}), /*#__PURE__*/_react["default"].createElement("br", null), choiceRationaleEnabled && renderChoiceRationale())));
|
|
517
659
|
}
|
|
518
660
|
}]);
|
|
519
661
|
return Main;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/main.jsx"],"names":["toggle","settings","Panel","InfoDialog","open","onCancel","onOk","title","propTypes","PropTypes","bool","func","string","styles","theme","promptHolder","width","paddingBottom","spacing","unit","marginBottom","prompt","paddingTop","markup","minHeight","design","choiceConfiguration","switchElement","justifyContent","margin","addButton","text","fontFamily","fontSize","lineHeight","color","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","prepareVal","html","tmp","value","textContent","innerText","Main","dialog","newVal","props","onModelChanged","model","onModelChange","rationale","teacherInstructions","slateMarkup","callback","setState","message","respAreaChoices","state","domMarkup","allRespAreas","querySelectorAll","allChoices","forEach","el","dataset","index","existingRespAreaChoices","obj","choices","key","newRespAreaChoices","shouldWarn","newChoices","length","find","c","correct","remove","label","r","map","parseInt","filter","val","isNaN","push","respIndex","splice","selectedIndex","ch","nProps","newState","domNode","ReactDOM","findDOMNode","classes","configuration","onConfigurationChanged","imageSupport","partialScoring","lockChoiceOrder","rationaleEnabled","promptEnabled","teacherInstructionsEnabled","toolbarOpts","toolbarEditorPosition","position","Settings","Properties","onTeacherInstructionsChanged","onPromptChanged","onRationaleChanged","ALL_PLUGINS","type","options","duplicates","respAreaToolbar","node","onToolbarDone","onAddChoice","onCheck","onRemoveChoice","data","get","onSelectChoice","onChange","onBlur","React","Component","object","isRequired","disableSidePanel","shape","add","Styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;IAEQA,M,GAAkBC,kB,CAAlBD,M;IAAQE,K,GAAUD,kB,CAAVC,K;;AAEhB,IAAMC,UAAU,GAAG,SAAbA,UAAa;AAAA,MAAGC,IAAH,QAAGA,IAAH;AAAA,MAASC,QAAT,QAASA,QAAT;AAAA,MAAmBC,IAAnB,QAAmBA,IAAnB;AAAA,MAAyBC,KAAzB,QAAyBA,KAAzB;AAAA,sBACjB,gCAAC,kBAAD;AAAQ,IAAA,IAAI,EAAEH;AAAd,kBACE,gCAAC,uBAAD,QAAcG,KAAd,CADF,eAEE,gCAAC,yBAAD,QACGD,IAAI,iBACH,gCAAC,kBAAD;AAAQ,IAAA,OAAO,EAAEA,IAAjB;AAAuB,IAAA,KAAK,EAAC;AAA7B,UAFJ,EAMGD,QAAQ,iBACP,gCAAC,kBAAD;AAAQ,IAAA,OAAO,EAAEA,QAAjB;AAA2B,IAAA,KAAK,EAAC;AAAjC,cAPJ,CAFF,CADiB;AAAA,CAAnB;;AAkBAF,UAAU,CAACK,SAAX,GA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tml, { ALL_PLUGINS } from '@pie-lib/editable-html';\nimport { InputContainer, layout, settings } from '@pie-lib/config-ui';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEqual from 'lodash/isEqual';\nimport isUndefined from 'lodash/isUndefined';\nimport isEmpty from 'lodash/isEmpty';\nimport reduce from 'lodash/reduce';\nimport { withStyles } from '@material-ui/core/styles';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Typography from '@material-ui/core/Typography';\n\nimport InlineDropdownToolbar from './inline-dropdown-toolbar';\nimport max from 'lodash/max';\n\nconst { toggle, Panel } = settings;\n\nconst InfoDialog = ({ open, onCancel, onOk, title }) => (\n <Dialog open={open}>\n <DialogTitle>{title}</DialogTitle>\n <DialogActions>\n {onOk && (\n <Button onClick={onOk} color=\"primary\">\n OK\n </Button>\n )}\n {onCancel && (\n <Button onClick={onCancel} color=\"primary\">\n Cancel\n </Button>\n )}\n </DialogActions>\n </Dialog>\n);\n\nInfoDialog.propTypes = {\n open: PropTypes.bool,\n onCancel: PropTypes.func,\n onOk: PropTypes.func,\n title: PropTypes.string\n};\n\nconst styles = theme => ({\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%'\n },\n markup: {\n minHeight: '100px',\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n '& [data-slate-editor=\"true\"]': {\n minHeight: '100px'\n }\n },\n design: {\n paddingTop: theme.spacing.unit * 3\n },\n choiceConfiguration: {\n paddingTop: theme.spacing.unit * 2,\n paddingBottom: theme.spacing.unit * 2\n },\n switchElement: {\n justifyContent: 'space-between',\n margin: 0\n },\n addButton: {\n float: 'right'\n },\n text: {\n fontFamily: 'Cerebri Sans',\n fontSize: '16px',\n lineHeight: '19px',\n color: '#495B8F'\n }\n});\n\nconst createElementFromHTML = htmlString => {\n const div = document.createElement('div');\n\n div.innerHTML = (htmlString || '').trim();\n\n return div;\n};\n\nconst prepareVal = html => {\n const tmp = document.createElement('DIV');\n\n tmp.innerHTML = html;\n\n const value = tmp.textContent || tmp.innerText || '';\n\n return value.trim();\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n configuration: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n classes: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired\n })\n };\n\n state = {\n dialog: {\n open: false\n }\n };\n\n componentDidMount() {\n const {\n model: { choices }\n } = this.props;\n\n this.setState({ respAreaChoices: cloneDeep(choices) });\n }\n\n UNSAFE_componentWillReceiveProps(nProps) {\n const newState = {};\n\n if (\n !isEqual(nProps.model.choices, this.props.model.choices) ||\n !isEqual(nProps.model.choices, this.state.respAreaChoices)\n ) {\n newState.respAreaChoices = cloneDeep(nProps.model.choices);\n }\n\n if (!isEmpty(newState)) {\n this.setState(newState);\n }\n }\n\n componentDidUpdate() {\n //eslint-disable-next-line\n const domNode = ReactDOM.findDOMNode(this);\n\n renderMath(domNode);\n }\n\n onModelChange = newVal => {\n this.props.onModelChanged({\n ...this.props.model,\n ...newVal\n });\n };\n\n onPromptChanged = prompt => {\n this.onModelChange({ prompt });\n };\n\n onRationaleChanged = rationale => {\n this.onModelChange({ rationale });\n };\n\n onTeacherInstructionsChanged = teacherInstructions => {\n this.onModelChange({ teacherInstructions });\n };\n\n onMarkupChanged = slateMarkup => {\n this.onModelChange({ slateMarkup });\n };\n\n onCheck = callback => {\n this.setState({\n dialog: {\n open: true,\n message:\n 'Response areas with under 2 options or with no correct answers will be discarded',\n onOk: () => {\n this.setState(\n {\n dialog: {\n open: false\n }\n },\n callback\n );\n },\n onCancel: () =>\n this.setState({\n dialog: {\n open: false\n }\n })\n }\n });\n };\n\n onChange = markup => {\n const { respAreaChoices } = this.state;\n const domMarkup = createElementFromHTML(markup);\n const allRespAreas = domMarkup.querySelectorAll(\n '[data-type=\"inline_dropdown\"]'\n );\n\n const allChoices = {};\n\n allRespAreas.forEach(el => {\n allChoices[el.dataset.index] = el.dataset.value || '';\n });\n\n const existingRespAreaChoices = reduce(\n respAreaChoices,\n (obj, choices, key) => {\n if (!isUndefined(allChoices[key])) {\n obj[key] = respAreaChoices[key];\n }\n\n return obj;\n },\n {}\n );\n\n const newRespAreaChoices = {};\n let shouldWarn = false;\n\n allRespAreas.forEach((el, index) => {\n const newChoices = existingRespAreaChoices[el.dataset.index] || [];\n\n if (newChoices.length < 2 || !newChoices.find(c => c.correct)) {\n el.remove();\n shouldWarn = true;\n } else {\n newRespAreaChoices[index] =\n existingRespAreaChoices[el.dataset.index] || [];\n el.dataset.index = index;\n }\n });\n\n if (shouldWarn) {\n this.setState({\n dialog: {\n open: true,\n message:\n 'Response areas with under 2 options or with no correct answers will be discarded',\n onOk: () => {\n this.setState(\n {\n dialog: {\n open: false\n }\n },\n () =>\n this.onModelChange({\n choices: cloneDeep(newRespAreaChoices),\n slateMarkup: domMarkup.innerHTML\n })\n );\n },\n onCancel: () =>\n this.setState({\n dialog: {\n open: false\n }\n })\n }\n });\n } else {\n this.onModelChange({\n choices: cloneDeep(newRespAreaChoices),\n slateMarkup: domMarkup.innerHTML\n });\n }\n };\n\n onAddChoice = (index, label) => {\n const { respAreaChoices } = this.state;\n\n if (!respAreaChoices[index]) {\n respAreaChoices[index] = [];\n }\n\n if (\n (respAreaChoices[index] || []).find(\n r => prepareVal(r.label) === prepareVal(label)\n )\n ) {\n this.setState({\n dialog: {\n open: true,\n message: 'Duplicate answers are not allowed.',\n onOk: () => {\n this.setState({\n dialog: {\n open: false\n }\n });\n }\n }\n });\n\n return;\n }\n\n const value = (respAreaChoices[index] && max(respAreaChoices[index].map(c => parseInt(c.value)).filter(val => !isNaN(val)))) || 0;\n\n respAreaChoices[index].push({\n label,\n value: `${value + 1}`,\n correct: false\n });\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n onRemoveChoice = (respIndex, index) => {\n const { respAreaChoices } = this.state;\n\n respAreaChoices[respIndex].splice(index, 1);\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n onSelectChoice = (respIndex, selectedIndex) => {\n const { respAreaChoices } = this.state;\n\n respAreaChoices[respIndex] = respAreaChoices[respIndex].map(\n (ch, index) => ({ ...ch, correct: index === selectedIndex })\n );\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n render() {\n const { dialog } = this.state;\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged,\n imageSupport\n } = this.props;\n const {\n prompt = {},\n partialScoring = {},\n lockChoiceOrder = {},\n rationale = {},\n teacherInstructions = {}\n } = configuration || {};\n const { rationaleEnabled, promptEnabled, teacherInstructionsEnabled } =\n model || {};\n\n const toolbarOpts = {};\n\n switch (model.toolbarEditorPosition) {\n case 'top':\n toolbarOpts.position = 'top';\n break;\n default:\n toolbarOpts.position = 'bottom';\n break;\n }\n\n return (\n <div className={classes.design}>\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={model => this.onModelChange(model)}\n onChangeConfiguration={configuration =>\n onConfigurationChanged(configuration, true)\n }\n groups={{\n Settings: {\n partialScoring:\n partialScoring.settings && toggle(partialScoring.label),\n lockChoiceOrder:\n lockChoiceOrder.settings && toggle(lockChoiceOrder.label)\n },\n Properties: {\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n rationaleEnabled:\n rationale.settings && toggle(rationale.label),\n promptEnabled: prompt.settings && toggle(prompt.label)\n }\n }}\n />\n }\n >\n <div>\n {teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer\n label={prompt.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n toolbarOpts={toolbarOpts}\n />\n </InputContainer>\n )}\n\n {rationaleEnabled && (\n <InputContainer\n label={rationale.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChanged}\n imageSupport={imageSupport}\n toolbarOpts={toolbarOpts}\n />\n </InputContainer>\n )}\n\n <Typography className={classes.text}>\n Define Template, Choices, and Correct Responses\n </Typography>\n <InfoDialog\n open={dialog.open}\n title={dialog.message}\n onCancel={dialog.onCancel}\n onOk={dialog.onOk}\n />\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n toolbarOpts={{ position: 'top' }}\n responseAreaProps={{\n type: 'inline-dropdown',\n options: {\n duplicates: true\n },\n respAreaToolbar: (node, value, onToolbarDone) => {\n const { respAreaChoices } = this.state;\n\n return () => (\n <InlineDropdownToolbar\n onAddChoice={this.onAddChoice}\n onCheck={this.onCheck}\n onRemoveChoice={index =>\n this.onRemoveChoice(node.data.get('index'), index)\n }\n onSelectChoice={index =>\n this.onSelectChoice(node.data.get('index'), index)\n }\n node={node}\n value={value}\n onToolbarDone={onToolbarDone}\n choices={respAreaChoices[node.data.get('index')]}\n />\n );\n }\n }}\n className={classes.markup}\n markup={model.slateMarkup || ''}\n onChange={this.onChange}\n imageSupport={imageSupport}\n onBlur={this.onBlur}\n disabled={false}\n highlightShape={false}\n />\n </div>\n </layout.ConfigLayout>\n </div>\n );\n }\n}\n\nconst Styled = withStyles(styles)(Main);\n\nexport default Styled;\n"],"file":"main.js"}
|
|
1
|
+
{"version":3,"sources":["../src/main.jsx"],"names":["toggle","settings","Panel","InfoDialog","open","onCancel","onOk","title","propTypes","PropTypes","bool","func","string","styles","theme","promptHolder","width","paddingBottom","spacing","unit","marginBottom","prompt","paddingTop","markup","minHeight","design","choiceConfiguration","switchElement","justifyContent","margin","addButton","text","fontFamily","fontSize","lineHeight","color","marginRight","rationaleLabel","display","whiteSpace","rationaleChoices","marginTop","panelDetails","flexContainer","alignItems","tooltip","maxWidth","errorText","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","prepareVal","html","tmp","value","textContent","innerText","Main","dialog","newVal","props","onModelChanged","model","onModelChange","rationale","index","choice","indexOfChoice","choices","findIndex","elem","label","splice","teacherInstructions","slateMarkup","callback","setState","message","respAreaChoices","state","domMarkup","allRespAreas","querySelectorAll","allChoices","forEach","el","dataset","existingRespAreaChoices","obj","key","newRespAreaChoices","shouldWarn","newChoices","length","find","c","correct","remove","r","map","parseInt","filter","val","isNaN","push","respIndex","selectedIndex","ch","nProps","newState","domNode","ReactDOM","findDOMNode","classes","configuration","onConfigurationChanged","imageSupport","partialScoring","lockChoiceOrder","choiceRationale","spellCheck","maxResponseAreas","maxImageWidth","maxImageHeight","rationaleEnabled","choiceRationaleEnabled","promptEnabled","teacherInstructionsEnabled","spellCheckEnabled","errors","responseAreasError","defaultImageMaxWidth","defaultImageMaxHeight","renderChoiceRationale","Object","keys","__html","onChoiceRationaleChanged","toolbarOpts","toolbarEditorPosition","position","validationMessage","Settings","Properties","onTeacherInstructionsChanged","onPromptChanged","onRationaleChanged","ALL_PLUGINS","type","options","duplicates","respAreaToolbar","node","onToolbarDone","onAddChoice","onCheck","onRemoveChoice","data","get","onSelectChoice","onChange","onBlur","React","Component","object","isRequired","disableSidePanel","shape","add","Styled"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;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G,sBAAU+J,MAAV,CAAiBC,UADf;AAEjBvG,EAAAA,KAAK,EAAEzD,sBAAU+J,MAAV,CAAiBC,UAFP;AAGjBC,EAAAA,gBAAgB,EAAEjK,sBAAUC,IAHX;AAIjBuD,EAAAA,cAAc,EAAExD,sBAAUE,IAAV,CAAe8J,UAJd;AAKjBlD,EAAAA,sBAAsB,EAAE9G,sBAAUE,IAAV,CAAe8J,UALtB;AAMjBpD,EAAAA,OAAO,EAAE5G,sBAAU+J,MAAV,CAAiBC,UANT;AAOjBjD,EAAAA,YAAY,EAAE/G,sBAAUkK,KAAV,CAAgB;AAC5BC,IAAAA,GAAG,EAAEnK,sBAAUE,IAAV,CAAe8J,UADQ;AAE5B,cAAQhK,sBAAUE,IAAV,CAAe8J;AAFK,GAAhB;AAPG,C;AAmfrB,IAAMI,MAAM,GAAG,wBAAWhK,MAAX,EAAmBgD,IAAnB,CAAf;eAEegH,M","sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport EditableHtml, { ALL_PLUGINS } from '@pie-lib/editable-html';\nimport { InputContainer, layout, settings } from '@pie-lib/config-ui';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport cloneDeep from 'lodash/cloneDeep';\nimport isEqual from 'lodash/isEqual';\nimport isUndefined from 'lodash/isUndefined';\nimport isEmpty from 'lodash/isEmpty';\nimport reduce from 'lodash/reduce';\nimport max from 'lodash/max';\nimport { withStyles } from '@material-ui/core/styles';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\nimport ExpansionPanel from '@material-ui/core/ExpansionPanel';\nimport ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary';\nimport ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport Info from '@material-ui/icons/Info';\nimport InlineDropdownToolbar from './inline-dropdown-toolbar';\nimport { generateValidationMessage } from './utils';\n\nconst { toggle, Panel } = settings;\n\nconst InfoDialog = ({ open, onCancel, onOk, title }) => (\n <Dialog open={open}>\n <DialogTitle>{title}</DialogTitle>\n <DialogActions>\n {onOk && (\n <Button onClick={onOk} color=\"primary\">\n OK\n </Button>\n )}\n {onCancel && (\n <Button onClick={onCancel} color=\"primary\">\n Cancel\n </Button>\n )}\n </DialogActions>\n </Dialog>\n);\n\nInfoDialog.propTypes = {\n open: PropTypes.bool,\n onCancel: PropTypes.func,\n onOk: PropTypes.func,\n title: PropTypes.string\n};\n\nconst styles = theme => ({\n promptHolder: {\n width: '100%',\n paddingBottom: theme.spacing.unit * 2,\n marginBottom: theme.spacing.unit * 2\n },\n prompt: {\n paddingTop: theme.spacing.unit * 2,\n width: '100%'\n },\n markup: {\n minHeight: '100px',\n paddingTop: theme.spacing.unit * 2,\n width: '100%',\n '& [data-slate-editor=\"true\"]': {\n minHeight: '100px'\n }\n },\n design: {\n paddingTop: theme.spacing.unit * 3\n },\n choiceConfiguration: {\n paddingTop: theme.spacing.unit * 2,\n paddingBottom: theme.spacing.unit * 2\n },\n switchElement: {\n justifyContent: 'space-between',\n margin: 0\n },\n addButton: {\n float: 'right'\n },\n text: {\n fontFamily: 'Cerebri Sans',\n fontSize: '16px',\n lineHeight: '19px',\n color: '#495B8F',\n marginRight: '5px'\n },\n rationaleLabel: {\n display: 'flex',\n whiteSpace: 'break-spaces'\n },\n rationaleChoices: {\n marginTop: '16px'\n },\n panelDetails: {\n display: 'block'\n },\n flexContainer: {\n display: 'flex',\n alignItems: 'center',\n marginBottom: '5px'\n },\n tooltip: {\n fontSize: '12px',\n whiteSpace: 'pre',\n maxWidth: '500px'\n },\n errorText: {\n fontSize: '12px',\n color: 'red',\n paddingTop: '5px',\n marginTop: '8px'\n }\n});\n\nconst createElementFromHTML = htmlString => {\n const div = document.createElement('div');\n\n div.innerHTML = (htmlString || '').trim();\n\n return div;\n};\n\nconst prepareVal = html => {\n const tmp = document.createElement('DIV');\n\n tmp.innerHTML = html;\n\n const value = tmp.textContent || tmp.innerText || '';\n\n return value.trim();\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n configuration: PropTypes.object.isRequired,\n model: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n classes: PropTypes.object.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired\n })\n };\n\n state = {\n dialog: {\n open: false\n }\n };\n\n componentDidMount() {\n const {\n model: { choices }\n } = this.props;\n\n this.setState({ respAreaChoices: cloneDeep(choices) });\n }\n\n UNSAFE_componentWillReceiveProps(nProps) {\n const newState = {};\n\n if (\n !isEqual(nProps.model.choices, this.props.model.choices) ||\n !isEqual(nProps.model.choices, this.state.respAreaChoices)\n ) {\n newState.respAreaChoices = cloneDeep(nProps.model.choices);\n }\n\n if (!isEmpty(newState)) {\n this.setState(newState);\n }\n }\n\n componentDidUpdate() {\n //eslint-disable-next-line\n const domNode = ReactDOM.findDOMNode(this);\n\n renderMath(domNode);\n }\n\n onModelChange = newVal => {\n this.props.onModelChanged({\n ...this.props.model,\n ...newVal\n });\n };\n\n onPromptChanged = prompt => {\n this.onModelChange({ prompt });\n };\n\n onRationaleChanged = rationale => {\n this.onModelChange({ rationale });\n };\n\n onChoiceRationaleChanged = (index, choice) => {\n const { model } = this.props;\n const indexOfChoice = model.choices && model.choices[index] && model.choices[index]\n .findIndex(elem => elem.label === choice.label && elem.value === choice.value);\n\n model.choices[index] && model.choices[index].splice(indexOfChoice, 1, choice);\n\n this.onModelChange(model);\n };\n\n onTeacherInstructionsChanged = teacherInstructions => {\n this.onModelChange({ teacherInstructions });\n };\n\n onMarkupChanged = slateMarkup => {\n this.onModelChange({ slateMarkup });\n };\n\n onCheck = callback => {\n this.setState({\n dialog: {\n open: true,\n message:\n 'Response areas with under 2 options or with no correct answers will be discarded',\n onOk: () => {\n this.setState(\n {\n dialog: {\n open: false\n }\n },\n callback\n );\n },\n onCancel: () =>\n this.setState({\n dialog: {\n open: false\n }\n })\n }\n });\n };\n\n onChange = markup => {\n const { respAreaChoices } = this.state;\n const domMarkup = createElementFromHTML(markup);\n const allRespAreas = domMarkup.querySelectorAll(\n '[data-type=\"inline_dropdown\"]'\n );\n\n const allChoices = {};\n\n allRespAreas.forEach(el => {\n allChoices[el.dataset.index] = el.dataset.value || '';\n });\n\n const existingRespAreaChoices = reduce(\n respAreaChoices,\n (obj, choices, key) => {\n if (!isUndefined(allChoices[key])) {\n obj[key] = respAreaChoices[key];\n }\n\n return obj;\n },\n {}\n );\n\n const newRespAreaChoices = {};\n let shouldWarn = false;\n\n allRespAreas.forEach((el, index) => {\n const newChoices = existingRespAreaChoices[el.dataset.index] || [];\n\n if (newChoices.length < 2 || !newChoices.find(c => c.correct)) {\n el.remove();\n shouldWarn = true;\n } else {\n newRespAreaChoices[index] =\n existingRespAreaChoices[el.dataset.index] || [];\n el.dataset.index = index;\n }\n });\n\n if (shouldWarn) {\n this.setState({\n dialog: {\n open: true,\n message:\n 'Response areas with under 2 options or with no correct answers will be discarded',\n onOk: () => {\n this.setState(\n {\n dialog: {\n open: false\n }\n },\n () =>\n this.onModelChange({\n choices: cloneDeep(newRespAreaChoices),\n slateMarkup: domMarkup.innerHTML\n })\n );\n },\n onCancel: () =>\n this.setState({\n dialog: {\n open: false\n }\n })\n }\n });\n } else {\n this.onModelChange({\n choices: cloneDeep(newRespAreaChoices),\n slateMarkup: domMarkup.innerHTML\n });\n }\n };\n\n onAddChoice = (index, label) => {\n const { respAreaChoices } = this.state;\n\n if (!respAreaChoices[index]) {\n respAreaChoices[index] = [];\n }\n\n if (\n (respAreaChoices[index] || []).find(\n r => prepareVal(r.label) === prepareVal(label)\n )\n ) {\n this.setState({\n dialog: {\n open: true,\n message: 'Duplicate answers are not allowed.',\n onOk: () => {\n this.setState({\n dialog: {\n open: false\n }\n });\n }\n }\n });\n\n return;\n }\n\n const value = (respAreaChoices[index] && max(respAreaChoices[index].map(c => parseInt(c.value)).filter(val => !isNaN(val)))) || 0;\n\n respAreaChoices[index].push({\n label,\n value: `${value + 1}`,\n correct: false\n });\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n onRemoveChoice = (respIndex, index) => {\n const { respAreaChoices } = this.state;\n\n respAreaChoices[respIndex].splice(index, 1);\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n onSelectChoice = (respIndex, selectedIndex) => {\n const { respAreaChoices } = this.state;\n\n respAreaChoices[respIndex] = respAreaChoices[respIndex].map(\n (ch, index) => ({ ...ch, correct: index === selectedIndex })\n );\n\n this.onModelChange({ choices: cloneDeep(respAreaChoices) });\n };\n\n render() {\n const { dialog } = this.state;\n const {\n classes,\n model,\n configuration,\n onConfigurationChanged,\n imageSupport\n } = this.props;\n const {\n prompt = {},\n partialScoring = {},\n lockChoiceOrder = {},\n rationale = {},\n choiceRationale = {},\n teacherInstructions = {},\n spellCheck = {},\n maxResponseAreas,\n maxImageWidth = {},\n maxImageHeight = {}\n } = configuration || {};\n const {\n rationaleEnabled,\n choiceRationaleEnabled,\n promptEnabled,\n teacherInstructionsEnabled,\n choices,\n spellCheckEnabled,\n errors\n } = model || {};\n const { responseAreasError } = errors || {};\n\n const defaultImageMaxWidth = maxImageWidth && maxImageWidth.prompt;\n const defaultImageMaxHeight = maxImageHeight && maxImageHeight.prompt;\n\n const renderChoiceRationale = () => (Object.keys(choices) || []).map(key =>\n <div key={key} className={classes.rationaleChoices}>\n <ExpansionPanel>\n <ExpansionPanelSummary expandIcon={<ExpandMoreIcon/>}>\n <Typography className={classes.text}>\n {`Rationale for response area #${parseInt(key) + 1}`}\n </Typography>\n </ExpansionPanelSummary>\n <ExpansionPanelDetails className={classes.panelDetails}>\n {(choices[key] || []).map(choice =>\n <InputContainer\n key={choice.label}\n label={\n <span\n className={classes.rationaleLabel}\n dangerouslySetInnerHTML={{\n __html:\n `${rationale.label} for ${choice.label} (${choice.correct ? 'correct' : 'incorrect'})`\n }}\n />\n }\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={choice.rationale || ''}\n spellCheck={spellCheckEnabled}\n onChange={c =>\n this.onChoiceRationaleChanged(key, {\n ...choice,\n rationale: c\n })\n }\n imageSupport={imageSupport}\n maxImageWidth={maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n </ExpansionPanelDetails>\n </ExpansionPanel>\n </div>\n )\n\n const toolbarOpts = {};\n\n switch (model.toolbarEditorPosition) {\n case 'top':\n toolbarOpts.position = 'top';\n break;\n default:\n toolbarOpts.position = 'bottom';\n break;\n }\n\n const validationMessage = generateValidationMessage(configuration);\n\n return (\n <div className={classes.design}>\n <layout.ConfigLayout\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={model => this.onModelChange(model)}\n onChangeConfiguration={configuration =>\n onConfigurationChanged(configuration, true)\n }\n groups={{\n Settings: {\n partialScoring:\n partialScoring.settings && toggle(partialScoring.label),\n lockChoiceOrder:\n lockChoiceOrder.settings && toggle(lockChoiceOrder.label)\n },\n Properties: {\n teacherInstructionsEnabled:\n teacherInstructions.settings &&\n toggle(teacherInstructions.label),\n rationaleEnabled:\n rationale.settings && toggle(rationale.label),\n choiceRationaleEnabled:\n choiceRationale.settings && toggle(choiceRationale.label),\n promptEnabled: prompt.settings && toggle(prompt.label),\n spellCheckEnabled:\n spellCheck.settings && toggle(spellCheck.label)\n }\n }}\n />\n }\n >\n <div>\n {teacherInstructionsEnabled && (\n <InputContainer\n label={teacherInstructions.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.teacherInstructions || ''}\n onChange={this.onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.teacherInstructions || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.teacherInstructions || defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n {promptEnabled && (\n <InputContainer\n label={prompt.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.prompt}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n disableUnderline\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n maxImageWidth={defaultImageMaxWidth}\n maxImageHeight={defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n {rationaleEnabled && (\n <InputContainer\n label={rationale.label}\n className={classes.promptHolder}\n >\n <EditableHtml\n className={classes.prompt}\n markup={model.rationale || ''}\n onChange={this.onRationaleChanged}\n imageSupport={imageSupport}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n maxImageWidth={maxImageWidth && maxImageWidth.rationale || defaultImageMaxWidth}\n maxImageHeight={maxImageHeight && maxImageHeight.rationale || defaultImageMaxHeight}\n />\n </InputContainer>\n )}\n\n <div className={classes.flexContainer}>\n <Typography className={classes.text}>\n Define Template, Choices, and Correct Responses\n </Typography>\n <Tooltip\n classes={{ tooltip: classes.tooltip }}\n disableFocusListener\n disableTouchListener\n placement={'right'}\n title={validationMessage}\n >\n <Info fontSize={'small'} color={'primary'}/>\n </Tooltip>\n </div>\n {responseAreasError && <div className={classes.errorText}>{responseAreasError}</div>}\n\n <InfoDialog\n open={dialog.open}\n title={dialog.message}\n onCancel={dialog.onCancel}\n onOk={dialog.onOk}\n />\n <EditableHtml\n activePlugins={ALL_PLUGINS}\n toolbarOpts={{ position: 'top' }}\n responseAreaProps={{\n type: 'inline-dropdown',\n options: {\n duplicates: true\n },\n maxResponseAreas: maxResponseAreas,\n respAreaToolbar: (node, value, onToolbarDone) => {\n const { respAreaChoices } = this.state;\n\n return () => (\n <InlineDropdownToolbar\n onAddChoice={this.onAddChoice}\n onCheck={this.onCheck}\n onRemoveChoice={index =>\n this.onRemoveChoice(node.data.get('index'), index)\n }\n onSelectChoice={index =>\n this.onSelectChoice(node.data.get('index'), index)\n }\n node={node}\n value={value}\n onToolbarDone={onToolbarDone}\n choices={respAreaChoices[node.data.get('index')]}\n spellCheck={spellCheckEnabled}\n />\n );\n }\n }}\n spellCheck={spellCheckEnabled}\n className={classes.markup}\n markup={model.slateMarkup || ''}\n onChange={this.onChange}\n imageSupport={imageSupport}\n onBlur={this.onBlur}\n disabled={false}\n highlightShape={false}\n error={responseAreasError}\n />\n <br />\n {choiceRationaleEnabled && renderChoiceRationale()}\n </div>\n </layout.ConfigLayout>\n </div>\n );\n }\n}\n\nconst Styled = withStyles(styles)(Main);\n\nexport default Styled;\n"],"file":"main.js"}
|
|
@@ -5,12 +5,19 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.removeUnwantedCharacters = exports.processMarkup = exports.createSlateMarkup = exports.createElementFromHTML = void 0;
|
|
9
9
|
|
|
10
10
|
var _escape = _interopRequireDefault(require("lodash/escape"));
|
|
11
11
|
|
|
12
|
+
// do not remove \t from \times, \triangle, \tan, \theta or \therefore
|
|
13
|
+
var tSymbols = 'imes|riangle|an|heta|herefore'; // do not remove \n from \nthroot, \nparallel, \ncong, \napprox, \neq, \ne or \nsim
|
|
14
|
+
|
|
15
|
+
var nSymbols = 'throot|parallel|cong|approx|eq|e|sim'; // match all \t and \n that are not part of math symbols that starts with \t or \n
|
|
16
|
+
|
|
17
|
+
var matchTabAndNewLine = new RegExp("(\\t(?!".concat(tSymbols, "))|(\\n(?!").concat(nSymbols, "))|(\\\\t(?!").concat(tSymbols, "))|(\\\\n(?!").concat(nSymbols, "))"), 'g');
|
|
18
|
+
|
|
12
19
|
var removeUnwantedCharacters = function removeUnwantedCharacters(markup) {
|
|
13
|
-
return markup.replace(
|
|
20
|
+
return markup.replace(matchTabAndNewLine, '').replace(/\\"/g, '"').replace(/\\\//g, '/');
|
|
14
21
|
};
|
|
15
22
|
|
|
16
23
|
exports.removeUnwantedCharacters = removeUnwantedCharacters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/markupUtils.js"],"names":["removeUnwantedCharacters","markup","replace","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","processMarkup","newMarkup","slateMarkup","querySelectorAll","forEach","s","replaceWith","dataset","index","REGEX","createSlateMarkup","choices","createSelect","correctChoice","find","c","correct","value","id","label","match","g"],"mappings":";;;;;;;;;AAAA;;
|
|
1
|
+
{"version":3,"sources":["../src/markupUtils.js"],"names":["tSymbols","nSymbols","matchTabAndNewLine","RegExp","removeUnwantedCharacters","markup","replace","createElementFromHTML","htmlString","div","document","createElement","innerHTML","trim","processMarkup","newMarkup","slateMarkup","querySelectorAll","forEach","s","replaceWith","dataset","index","REGEX","createSlateMarkup","choices","createSelect","correctChoice","find","c","correct","value","id","label","match","g"],"mappings":";;;;;;;;;AAAA;;AAEA;AACA,IAAMA,QAAQ,GAAG,+BAAjB,C,CACA;;AACA,IAAMC,QAAQ,GAAG,sCAAjB,C,CACA;;AACA,IAAMC,kBAAkB,GAAG,IAAIC,MAAJ,kBAAqBH,QAArB,uBAA0CC,QAA1C,yBAAiED,QAAjE,yBAAwFC,QAAxF,SAAsG,GAAtG,CAA3B;;AAEO,IAAMG,wBAAwB,GAAG,SAA3BA,wBAA2B,CAAAC,MAAM;AAAA,SAC5CA,MAAM,CAACC,OAAP,CAAeJ,kBAAf,EAAmC,EAAnC,EAAuCI,OAAvC,CAA+C,MAA/C,EAAuD,GAAvD,EAA4DA,OAA5D,CAAoE,OAApE,EAA6E,GAA7E,CAD4C;AAAA,CAAvC;;;;AA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AAxD,6BAA8E,wBAAOK,aAAa,CAACM,KAArB,CAA9E;AACD,GAZD;;AAcA,SAAOlB,SAAS,CAACT,OAAV,CAAkBiB,KAAlB,EAAyB,UAACW,KAAD,EAAQC,CAAR,EAAc;AAC5C,WAAOT,YAAY,CAACS,CAAD,CAAnB;AACD,GAFM,CAAP;AAGD,CAnBM","sourcesContent":["import escape from 'lodash/escape';\n\n// do not remove \\t from \\times, \\triangle, \\tan, \\theta or \\therefore\nconst tSymbols = 'imes|riangle|an|heta|herefore';\n// do not remove \\n from \\nthroot, \\nparallel, \\ncong, \\napprox, \\neq, \\ne or \\nsim\nconst nSymbols = 'throot|parallel|cong|approx|eq|e|sim';\n// match all \\t and \\n that are not part of math symbols that starts with \\t or \\n\nconst matchTabAndNewLine = new RegExp(`(\\\\t(?!${tSymbols}))|(\\\\n(?!${nSymbols}))|(\\\\\\\\t(?!${tSymbols}))|(\\\\\\\\n(?!${nSymbols}))`, 'g');\n\nexport const removeUnwantedCharacters = markup =>\n markup.replace(matchTabAndNewLine, '').replace(/\\\\\"/g, '\"').replace(/\\\\\\//g, '/');\n\nexport const createElementFromHTML = htmlString => {\n const div = document.createElement('div');\n\n div.innerHTML = htmlString.trim();\n\n return div;\n};\n\nexport const processMarkup = markup => {\n const newMarkup = removeUnwantedCharacters(markup);\n const slateMarkup = createElementFromHTML(newMarkup);\n\n slateMarkup.querySelectorAll('[data-type=\"inline_dropdown\"]').forEach(s => {\n s.replaceWith(`{{${s.dataset.index}}}`);\n });\n\n return slateMarkup.innerHTML;\n};\n\nconst REGEX = /\\{\\{(\\d+)\\}\\}/g;\n\nexport const createSlateMarkup = (markup, choices) => {\n const newMarkup = removeUnwantedCharacters(markup);\n const createSelect = index => {\n let correctChoice = choices[index] && choices[index].find(c => c.correct);\n\n if (!correctChoice || !correctChoice.value) {\n correctChoice = {\n id: '',\n value: '',\n label: ''\n };\n }\n\n return `<span data-type=\"inline_dropdown\" data-index=\"${index}\" data-value=\"${escape(correctChoice.label)}\"></span>`;\n };\n\n return newMarkup.replace(REGEX, (match, g) => {\n return createSelect(g);\n });\n};\n"],"file":"markupUtils.js"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.generateValidationMessage = void 0;
|
|
7
|
+
|
|
8
|
+
var generateValidationMessage = function generateValidationMessage(config) {
|
|
9
|
+
var maxResponseAreas = config.maxResponseAreas;
|
|
10
|
+
var responseAreasMessage = '\nThere should be at least 1 ' + (maxResponseAreas ? "and at most ".concat(maxResponseAreas, " ") : '') + 'response area' + (maxResponseAreas ? 's' : '') + ' defined.';
|
|
11
|
+
var message = 'Validation requirements:' + responseAreasMessage;
|
|
12
|
+
return message;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
exports.generateValidationMessage = generateValidationMessage;
|
|
16
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils.js"],"names":["generateValidationMessage","config","maxResponseAreas","responseAreasMessage","message"],"mappings":";;;;;;;AAAO,IAAMA,yBAAyB,GAAG,SAA5BA,yBAA4B,CAAAC,MAAM,EAAI;AACjD,MAAQC,gBAAR,GAA6BD,MAA7B,CAAQC,gBAAR;AAEA,MAAMC,oBAAoB,GAAG,mCAC1BD,gBAAgB,yBAAkBA,gBAAlB,SAAwC,EAD9B,IAE3B,eAF2B,IAERA,gBAAgB,GAAG,GAAH,GAAS,EAFjB,IAEuB,WAFpD;AAIA,MAAME,OAAO,GAAG,6BAA6BD,oBAA7C;AAEA,SAAOC,OAAP;AACD,CAVM","sourcesContent":["export const generateValidationMessage = config => {\n const { maxResponseAreas } = config;\n\n const responseAreasMessage = '\\nThere should be at least 1 ' +\n (maxResponseAreas ? `and at most ${maxResponseAreas} ` : '') +\n 'response area' + (maxResponseAreas ? 's' : '') + ' defined.';\n\n const message = 'Validation requirements:' + responseAreasMessage;\n\n return message;\n};\n"],"file":"utils.js"}
|
package/configure/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/inline-dropdown-configure",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.15",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"@material-ui/core": "^3.9.2",
|
|
9
9
|
"@material-ui/icons": "^3.0.1",
|
|
10
10
|
"@pie-framework/pie-configure-events": "^1.2.0",
|
|
11
|
-
"@pie-lib/config-ui": "^10.
|
|
12
|
-
"@pie-lib/editable-html": "^7.
|
|
13
|
-
"@pie-lib/math-rendering": "^2.3
|
|
11
|
+
"@pie-lib/config-ui": "^10.13.3",
|
|
12
|
+
"@pie-lib/editable-html": "^7.22.6",
|
|
13
|
+
"@pie-lib/math-rendering": "^2.4.3",
|
|
14
14
|
"classnames": "^2.2.6",
|
|
15
15
|
"debug": "^3.1.0",
|
|
16
16
|
"lodash": "^4.17.15",
|
package/controller/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,52 @@
|
|
|
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
|
+
## [3.3.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown-controller@3.3.4...@pie-element/inline-dropdown-controller@3.3.5) (2022-03-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @pie-element/inline-dropdown-controller
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.3.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown-controller@3.3.3...@pie-element/inline-dropdown-controller@3.3.4) (2022-03-08)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @pie-element/inline-dropdown-controller
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [3.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown-controller@3.2.17...@pie-element/inline-dropdown-controller@3.3.0) (2021-09-20)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **inline-dropdown:** add rationale at choice level PD-488 ([1d88366](https://github.com/pie-framework/pie-elements/commit/1d88366f857b90e4ffc5735fe3af78432aa8844c))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [3.2.17](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown-controller@3.2.15...@pie-element/inline-dropdown-controller@3.2.17) (2021-08-05)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* force bump ([5ea7295](https://github.com/pie-framework/pie-elements/commit/5ea7295e4755fbc492a76e7ec69e5fc35b196919))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
## [3.2.15](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown-controller@3.2.14...@pie-element/inline-dropdown-controller@3.2.15) (2021-06-29)
|
|
45
|
+
|
|
46
|
+
**Note:** Version bump only for package @pie-element/inline-dropdown-controller
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
6
52
|
## [3.2.14](https://github.com/pie-framework/pie-elements/compare/@pie-element/inline-dropdown-controller@3.2.11...@pie-element/inline-dropdown-controller@3.2.14) (2021-03-03)
|
|
7
53
|
|
|
8
54
|
**Note:** Version bump only for package @pie-element/inline-dropdown-controller
|