@pie-element/drag-in-the-blank 10.2.2-beta.5 → 10.2.2-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
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
+ ## [10.2.2-beta.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank@10.2.2-beta.5...@pie-element/drag-in-the-blank@10.2.2-beta.6) (2026-09-24)
7
+
8
+ **Note:** Version bump only for package @pie-element/drag-in-the-blank
9
+
6
10
  ## [10.2.2-beta.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank@10.2.2-beta.4...@pie-element/drag-in-the-blank@10.2.2-beta.5) (2026-09-17)
7
11
 
8
12
  **Note:** Version bump only for package @pie-element/drag-in-the-blank
@@ -3,6 +3,10 @@
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
+ # [9.4.0-beta.12](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-configure@9.4.0-beta.11...@pie-element/drag-in-the-blank-configure@9.4.0-beta.12) (2026-09-24)
7
+
8
+ **Note:** Version bump only for package @pie-element/drag-in-the-blank-configure
9
+
6
10
  # [9.4.0-beta.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-configure@9.4.0-beta.10...@pie-element/drag-in-the-blank-configure@9.4.0-beta.11) (2026-09-17)
7
11
 
8
12
  **Note:** Version bump only for package @pie-element/drag-in-the-blank-configure
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/drag-in-the-blank-configure",
3
- "version": "9.4.0-beta.11",
3
+ "version": "9.4.0-beta.12",
4
4
  "private": true,
5
5
  "main": "lib/index.js",
6
6
  "module": "src/index.js",
@@ -12,9 +12,9 @@
12
12
  "@mui/icons-material": "^7.3.4",
13
13
  "@mui/material": "^7.3.4",
14
14
  "@pie-framework/pie-configure-events": "^1.3.0",
15
- "@pie-lib/config-ui": "13.1.0-beta.9",
15
+ "@pie-lib/config-ui": "13.0.22-beta.1",
16
16
  "@pie-lib/drag": "4.0.6",
17
- "@pie-lib/editable-html-tip-tap": "2.2.0-beta.9",
17
+ "@pie-lib/editable-html-tip-tap": "2.1.20-beta.1",
18
18
  "@pie-lib/math-rendering": "5.1.0",
19
19
  "debug": "^4.1.1",
20
20
  "lodash-es": "^4.17.23",
@@ -3,6 +3,10 @@
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
+ # [9.4.0-beta.12](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-controller@9.4.0-beta.11...@pie-element/drag-in-the-blank-controller@9.4.0-beta.12) (2026-09-24)
7
+
8
+ **Note:** Version bump only for package @pie-element/drag-in-the-blank-controller
9
+
6
10
  # [9.4.0-beta.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/drag-in-the-blank-controller@9.4.0-beta.10...@pie-element/drag-in-the-blank-controller@9.4.0-beta.11) (2026-09-17)
7
11
 
8
12
  **Note:** Version bump only for package @pie-element/drag-in-the-blank-controller
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/drag-in-the-blank-controller",
3
3
  "private": true,
4
- "version": "9.4.0-beta.11",
4
+ "version": "9.4.0-beta.12",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "10.2.2-beta.5",
7
+ "version": "10.2.2-beta.6",
8
8
  "description": "",
9
9
  "scripts": {
10
10
  "postpublish": "../../scripts/postpublish"
@@ -17,7 +17,7 @@
17
17
  "@pie-framework/pie-player-events": "^0.1.0",
18
18
  "@pie-lib/correct-answer-toggle": "4.0.5",
19
19
  "@pie-lib/drag": "4.0.6",
20
- "@pie-lib/mask-markup": "3.1.0-beta.9",
20
+ "@pie-lib/mask-markup": "3.1.6-beta.1",
21
21
  "@pie-lib/math-rendering": "5.1.0",
22
22
  "@pie-lib/render-ui": "6.1.3",
23
23
  "lodash-es": "^4.17.23",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "author": "",
29
29
  "license": "ISC",
30
- "gitHead": "3ab74b232732b96875e87537dfa2b8715cd553b6",
30
+ "gitHead": "c6bbb21417c58eaf8f617143437fb3ff85ae1cb4",
31
31
  "main": "lib/index.js",
32
32
  "module": "src/index.js"
33
33
  }
@@ -1,137 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.BlankContent = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
- var _MoreVert = _interopRequireDefault(require("@mui/icons-material/MoreVert"));
12
- var _Delete = _interopRequireDefault(require("@mui/icons-material/Delete"));
13
- var _core = require("@dnd-kit/core");
14
- var _styles = require("@mui/material/styles");
15
- var _markupUtils = require("./markupUtils");
16
- const GripIcon = ({
17
- style
18
- }) => /*#__PURE__*/_react.default.createElement("span", {
19
- style: style
20
- }, /*#__PURE__*/_react.default.createElement(_MoreVert.default, {
21
- style: {
22
- margin: '0 -16px'
23
- }
24
- }), /*#__PURE__*/_react.default.createElement(_MoreVert.default, null));
25
- GripIcon.propTypes = {
26
- style: _propTypes.default.object
27
- };
28
- const StyledChoice = (0, _styles.styled)('div', {
29
- shouldForwardProp: prop => !['error', 'isDragging'].includes(prop)
30
- })(({
31
- theme,
32
- error
33
- }) => ({
34
- display: 'inline-flex',
35
- minWidth: '178px',
36
- minHeight: '36px',
37
- background: theme.palette.common.white,
38
- boxSizing: 'border-box',
39
- borderRadius: '3px',
40
- overflow: 'hidden',
41
- position: 'relative',
42
- padding: '8px 35px 8px 35px',
43
- cursor: 'grab',
44
- border: `1px solid ${error ? '#f44336' : '#C0C3CF'}`,
45
- '& img': {
46
- display: 'flex'
47
- },
48
- // browser adds extra marrgin for p tags by default
49
- '& p': {
50
- margin: 0
51
- },
52
- '& mjx-frac': {
53
- fontSize: '120% !important'
54
- }
55
- }));
56
- const StyledDeleteIcon = (0, _styles.styled)(_Delete.default)(({
57
- theme
58
- }) => ({
59
- position: 'absolute',
60
- top: '6px',
61
- right: '0',
62
- color: theme.palette.grey[500],
63
- zIndex: 2,
64
- '&:hover': {
65
- cursor: 'pointer',
66
- color: theme.palette.common.black
67
- }
68
- }));
69
- const BlankContent = props => {
70
- const {
71
- choice,
72
- onClick,
73
- onRemoveChoice,
74
- error,
75
- instanceId,
76
- disabled
77
- } = props;
78
- const {
79
- attributes,
80
- listeners,
81
- setNodeRef,
82
- isDragging
83
- } = (0, _core.useDraggable)({
84
- id: `choice-${choice.id}-${instanceId || 'default'}`,
85
- data: {
86
- type: 'drag-in-the-blank-choice',
87
- id: choice.id,
88
- value: choice,
89
- instanceId: instanceId
90
- },
91
- disabled: disabled || (0, _markupUtils.choiceIsEmpty)(choice)
92
- });
93
- const handleDragStart = e => {
94
- if ((0, _markupUtils.choiceIsEmpty)(choice)) {
95
- e.preventDefault();
96
- alert('You need to define a value for an answer choice before it can be associated with a response area.');
97
- return;
98
- }
99
- };
100
- return /*#__PURE__*/_react.default.createElement(StyledChoice, (0, _extends2.default)({
101
- ref: setNodeRef,
102
- error: error,
103
- isDragging: isDragging,
104
- onClick: onClick
105
- }, attributes, listeners, {
106
- onDragStart: handleDragStart
107
- }), /*#__PURE__*/_react.default.createElement(GripIcon, {
108
- style: {
109
- position: 'absolute',
110
- top: '6px',
111
- left: '15px',
112
- color: '#9e9e9e',
113
- zIndex: 2
114
- }
115
- }), /*#__PURE__*/_react.default.createElement("span", {
116
- dangerouslySetInnerHTML: {
117
- __html: choice.value
118
- }
119
- }), /*#__PURE__*/_react.default.createElement(StyledDeleteIcon, {
120
- onClick: e => {
121
- e.preventDefault();
122
- e.stopPropagation();
123
- onRemoveChoice(e);
124
- }
125
- }));
126
- };
127
- exports.BlankContent = BlankContent;
128
- BlankContent.propTypes = {
129
- choice: _propTypes.default.object.isRequired,
130
- onClick: _propTypes.default.func,
131
- onRemoveChoice: _propTypes.default.func.isRequired,
132
- error: _propTypes.default.bool,
133
- instanceId: _propTypes.default.string,
134
- disabled: _propTypes.default.bool
135
- };
136
- var _default = exports.default = BlankContent;
137
- //# sourceMappingURL=choice.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"choice.js","names":["_react","_interopRequireDefault","require","_propTypes","_MoreVert","_Delete","_core","_styles","_markupUtils","GripIcon","style","default","createElement","margin","propTypes","PropTypes","object","StyledChoice","styled","shouldForwardProp","prop","includes","theme","error","display","minWidth","minHeight","background","palette","common","white","boxSizing","borderRadius","overflow","position","padding","cursor","border","fontSize","StyledDeleteIcon","Delete","top","right","color","grey","zIndex","black","BlankContent","props","choice","onClick","onRemoveChoice","instanceId","disabled","attributes","listeners","setNodeRef","isDragging","useDraggable","id","data","type","value","choiceIsEmpty","handleDragStart","e","preventDefault","alert","_extends2","ref","onDragStart","left","dangerouslySetInnerHTML","__html","stopPropagation","exports","isRequired","func","bool","string","_default"],"sources":["../src/choice.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport MoreVert from '@mui/icons-material/MoreVert';\nimport Delete from '@mui/icons-material/Delete';\nimport { useDraggable } from '@dnd-kit/core';\nimport { styled } from '@mui/material/styles';\nimport { choiceIsEmpty } from './markupUtils';\n\nconst GripIcon = ({ style }) => (\n <span style={style}>\n <MoreVert style={{ margin: '0 -16px' }} />\n <MoreVert />\n </span>\n);\n\nGripIcon.propTypes = {\n style: PropTypes.object,\n};\n\nconst StyledChoice = styled('div', {\n shouldForwardProp: (prop) => !['error', 'isDragging'].includes(prop),\n})(({ theme, error }) => ({\n display: 'inline-flex',\n minWidth: '178px',\n minHeight: '36px',\n background: theme.palette.common.white,\n boxSizing: 'border-box',\n borderRadius: '3px',\n overflow: 'hidden',\n position: 'relative',\n padding: '8px 35px 8px 35px',\n cursor: 'grab',\n border: `1px solid ${error ? '#f44336' : '#C0C3CF'}`,\n '& img': {\n display: 'flex',\n },\n // browser adds extra marrgin for p tags by default\n '& p': {\n margin: 0,\n },\n '& mjx-frac': {\n fontSize: '120% !important',\n },\n}));\n\nconst StyledDeleteIcon = styled(Delete)(({ theme }) => ({\n position: 'absolute',\n top: '6px',\n right: '0',\n color: theme.palette.grey[500],\n zIndex: 2,\n '&:hover': {\n cursor: 'pointer',\n color: theme.palette.common.black,\n },\n}));\n\nexport const BlankContent = (props) => {\n const { choice, onClick, onRemoveChoice, error, instanceId, disabled } = props;\n const { attributes, listeners, setNodeRef, isDragging } = useDraggable({\n id: `choice-${choice.id}-${instanceId || 'default'}`,\n data: {\n type: 'drag-in-the-blank-choice',\n id: choice.id,\n value: choice,\n instanceId: instanceId,\n },\n disabled: disabled || choiceIsEmpty(choice),\n });\n\n const handleDragStart = (e) => {\n if (choiceIsEmpty(choice)) {\n e.preventDefault();\n alert('You need to define a value for an answer choice before it can be associated with a response area.');\n return;\n }\n };\n\n return (\n <StyledChoice\n ref={setNodeRef}\n error={error}\n isDragging={isDragging}\n onClick={onClick}\n {...attributes}\n {...listeners}\n onDragStart={handleDragStart}\n >\n <GripIcon\n style={{\n position: 'absolute',\n top: '6px',\n left: '15px',\n color: '#9e9e9e',\n zIndex: 2,\n }}\n />\n\n <span dangerouslySetInnerHTML={{ __html: choice.value }} />\n\n <StyledDeleteIcon\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n\n onRemoveChoice(e);\n }}\n />\n </StyledChoice>\n );\n};\n\nBlankContent.propTypes = {\n choice: PropTypes.object.isRequired,\n onClick: PropTypes.func,\n onRemoveChoice: PropTypes.func.isRequ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,CAACD,UAAU;EACzCrD,KAAK,EAAER,kBAAS,CAAC+D,IAAI;EACrB1B,UAAU,EAAErC,kBAAS,CAACgE,MAAM;EAC5B1B,QAAQ,EAAEtC,kBAAS,CAAC+D;AACtB,CAAC;AAAC,IAAAE,QAAA,GAAAL,OAAA,CAAAhE,OAAA,GAEaoC,YAAY","ignoreList":[]}
@@ -1,332 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.Choices = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
- var _editableHtmlTipTap = _interopRequireDefault(require("@pie-lib/editable-html-tip-tap"));
12
- var _configUi = require("@pie-lib/config-ui");
13
- var _Button = _interopRequireDefault(require("@mui/material/Button"));
14
- var _styles = require("@mui/material/styles");
15
- var _choice = _interopRequireDefault(require("./choice"));
16
- var _markupUtils = require("./markupUtils");
17
- var _mathRendering = require("@pie-lib/math-rendering");
18
- const StyledDesign = (0, _styles.styled)('div')(({
19
- theme
20
- }) => ({
21
- display: 'flex',
22
- flexDirection: 'column',
23
- marginBottom: theme.spacing(1.5)
24
- }));
25
- const StyledAddButton = (0, _styles.styled)(_Button.default)({
26
- marginLeft: 'auto'
27
- });
28
- const StyledAltChoices = (0, _styles.styled)('div')(({
29
- theme
30
- }) => ({
31
- alignItems: 'flex-start',
32
- display: 'flex',
33
- flexWrap: 'wrap',
34
- justifyContent: 'space-evenly',
35
- marginTop: theme.spacing(1),
36
- '& > *': {
37
- margin: theme.spacing(1)
38
- }
39
- }));
40
- const ErrorText = (0, _styles.styled)('div')(({
41
- theme
42
- }) => ({
43
- fontSize: theme.typography.fontSize - 2,
44
- color: theme.palette.error.main,
45
- paddingBottom: theme.spacing(2)
46
- }));
47
- class Choices extends _react.default.Component {
48
- constructor(...args) {
49
- super(...args);
50
- (0, _defineProperty2.default)(this, "state", {
51
- warning: {
52
- open: false
53
- }
54
- });
55
- (0, _defineProperty2.default)(this, "preventDone", false);
56
- (0, _defineProperty2.default)(this, "wrapperRef", /*#__PURE__*/_react.default.createRef(null));
57
- (0, _defineProperty2.default)(this, "onChoiceChanged", (prevValue, val, key) => {
58
- const {
59
- onChange,
60
- model
61
- } = this.props;
62
- const {
63
- choices,
64
- correctResponse,
65
- alternateResponses
66
- } = model;
67
- if ((0, _markupUtils.choiceIsEmpty)({
68
- value: prevValue
69
- }) && (0, _markupUtils.choiceIsEmpty)({
70
- value: val
71
- })) {
72
- return;
73
- }
74
- const duplicatedValue = (choices || []).find(c => c.value === val && c.id !== key);
75
-
76
- // discard the new added choice or the changes if the choice would be a duplicate to one that already exists
77
- if (duplicatedValue) {
78
- if (prevValue === '') {
79
- // remove the new added choice from choices
80
- const newChoices = (choices || []).filter(c => c.id !== key);
81
- onChange(newChoices);
82
- }
83
- this.setState({
84
- warning: {
85
- open: true,
86
- text: 'Identical answer choices are not allowed and the changes will be discarded.'
87
- }
88
- });
89
- return;
90
- }
91
- const newChoices = choices?.map(choice => choice.id === key ? {
92
- ...choice,
93
- value: val
94
- } : choice) || [];
95
- if (!(0, _markupUtils.choiceIsEmpty)({
96
- value: val
97
- })) {
98
- onChange(newChoices);
99
- return;
100
- }
101
-
102
- // if the edited content is empty, its usage has to be searched in the correct response definitions
103
- let usedForResponse = false;
104
- if (correctResponse) {
105
- Object.keys(correctResponse).forEach(responseKey => {
106
- if (correctResponse[responseKey] === key) {
107
- usedForResponse = true;
108
- }
109
- });
110
- }
111
- if (alternateResponses && !usedForResponse) {
112
- Object.values(alternateResponses).forEach(alternate => {
113
- if (alternate.indexOf(key) >= 0) {
114
- usedForResponse = true;
115
- }
116
- });
117
- }
118
- if (usedForResponse) {
119
- this.setState({
120
- warning: {
121
- open: true,
122
- text: 'Answer choices cannot be blank and the changes will be discarded.'
123
- }
124
- });
125
- return;
126
- }
127
- onChange(newChoices);
128
- });
129
- (0, _defineProperty2.default)(this, "onChoiceDone", (choiceId, latestValue) => {
130
- const {
131
- onChange,
132
- model
133
- } = this.props;
134
- const {
135
- choices
136
- } = model;
137
- const currentChoice = (choices || []).find(c => c.id === choiceId);
138
-
139
- // model.choices[i].value can be stale when the editor's onChange did not fire for the most recent edit
140
- // (for example, image uploads). In that case, we want to use the latest value from the editor.
141
- const effectiveValue = latestValue !== undefined ? latestValue : currentChoice && currentChoice.value;
142
- if (!currentChoice || !(0, _markupUtils.choiceIsEmpty)({
143
- value: effectiveValue
144
- })) {
145
- if (currentChoice && currentChoice.value !== effectiveValue) {
146
- const newChoices = (choices || []).map(c => c.id === choiceId ? {
147
- ...c,
148
- value: effectiveValue
149
- } : c);
150
- onChange(newChoices);
151
- }
152
- this.setState({
153
- focusedEl: undefined
154
- });
155
- return;
156
- }
157
- onChange((choices || []).filter(c => c.id !== choiceId));
158
- this.setState({
159
- focusedEl: undefined,
160
- warning: {
161
- open: true,
162
- text: 'Answer choices cannot be blank.'
163
- }
164
- });
165
- });
166
- (0, _defineProperty2.default)(this, "onChoiceFocus", id => this.setState({
167
- focusedEl: id
168
- }));
169
- (0, _defineProperty2.default)(this, "onAddChoice", () => {
170
- const {
171
- model: {
172
- choices: oldChoices
173
- },
174
- onChange
175
- } = this.props;
176
-
177
- // find the maximum existing id and add 1 to generate the new id so we avoid duplicates
178
- const maxId = oldChoices.length > 0 ? Math.max(...oldChoices.map(choice => parseInt(choice.id, 10) || 0)) : -1;
179
- const newId = `${maxId + 1}`;
180
- this.setState({
181
- focusedEl: newId
182
- }, () => {
183
- onChange([...oldChoices, {
184
- id: newId,
185
- value: ''
186
- }]);
187
- });
188
- });
189
- (0, _defineProperty2.default)(this, "onChoiceRemove", id => {
190
- const {
191
- onChange,
192
- model: {
193
- choices
194
- }
195
- } = this.props;
196
- const newChoices = (choices || []).filter(choice => choice.id !== id);
197
- onChange(newChoices);
198
- });
199
- (0, _defineProperty2.default)(this, "getVisibleChoices", () => {
200
- const {
201
- duplicates,
202
- model: {
203
- choices,
204
- correctResponse
205
- }
206
- } = this.props;
207
- if (!choices) {
208
- return [];
209
- }
210
- if (duplicates) {
211
- return choices;
212
- }
213
-
214
- // if duplicates not allowed, remove the choices that are used to define the correct response
215
- return choices.filter(choice => !(correctResponse && Object.values(correctResponse).includes(choice.id)));
216
- });
217
- }
218
- componentDidUpdate() {
219
- if (this.focusedNodeRef) {
220
- this.focusedNodeRef.focus('end');
221
- }
222
- (0, _mathRendering.renderMath)(this.wrapperRef.current);
223
- }
224
- render() {
225
- const {
226
- focusedEl,
227
- warning
228
- } = this.state;
229
- const {
230
- duplicates,
231
- error,
232
- mathMlOptions = {},
233
- maxChoices,
234
- model: {
235
- choices
236
- },
237
- toolbarOpts,
238
- uploadSoundSupport,
239
- imageSupport = {},
240
- pluginProps = {},
241
- maxImageWidth,
242
- maxImageHeight,
243
- maxLength
244
- } = this.props;
245
- const visibleChoices = this.getVisibleChoices() || [];
246
- return /*#__PURE__*/_react.default.createElement(StyledDesign, {
247
- ref: this.wrapperRef
248
- }, /*#__PURE__*/_react.default.createElement(StyledAddButton, {
249
- variant: "contained",
250
- color: "primary",
251
- onClick: this.onAddChoice,
252
- disabled: maxChoices && choices && maxChoices === choices.length
253
- }, "Add Choice"), /*#__PURE__*/_react.default.createElement(StyledAltChoices, null, visibleChoices.map((choice, index) => {
254
- if (!choice || !choice.id) {
255
- return null;
256
- }
257
- return focusedEl === choice.id ? /*#__PURE__*/_react.default.createElement("div", {
258
- key: index,
259
- style: {
260
- minWidth: '100%',
261
- zIndex: '100'
262
- }
263
- }, /*#__PURE__*/_react.default.createElement(_editableHtmlTipTap.default, {
264
- ref: ref => this.focusedNodeRef = ref,
265
- autoFocus: true,
266
- imageSupport: imageSupport,
267
- markup: choice.value,
268
- pluginProps: pluginProps,
269
- languageCharactersProps: [{
270
- language: 'spanish'
271
- }, {
272
- language: 'special'
273
- }],
274
- onChange: val => {
275
- if (this.preventDone) {
276
- return;
277
- }
278
- this.onChoiceChanged(choice.value, val, choice.id);
279
- },
280
- onDone: val => {
281
- if (this.preventDone) {
282
- return;
283
- }
284
- this.onChoiceDone(choice.id, val);
285
- },
286
- onBlur: e => {
287
- const inInInsertCharacter = e.relatedTarget && e.relatedTarget.closest('.insert-character-dialog');
288
- this.preventDone = inInInsertCharacter;
289
- },
290
- disableUnderline: true,
291
- toolbarOpts: toolbarOpts,
292
- uploadSoundSupport: uploadSoundSupport,
293
- mathMlOptions: mathMlOptions,
294
- maxImageHeight: maxImageHeight,
295
- maxImageWidth: maxImageWidth,
296
- charactersLimit: maxLength
297
- })) : /*#__PURE__*/_react.default.createElement(_choice.default, {
298
- key: index,
299
- duplicates: duplicates,
300
- choice: choice,
301
- error: error,
302
- onClick: () => this.onChoiceFocus(choice.id),
303
- onRemoveChoice: () => this.onChoiceRemove(choice.id)
304
- });
305
- })), error && /*#__PURE__*/_react.default.createElement(ErrorText, null, error), /*#__PURE__*/_react.default.createElement(_configUi.AlertDialog, {
306
- open: warning.open,
307
- title: "Warning",
308
- text: warning.text,
309
- onConfirm: () => this.setState({
310
- warning: {
311
- open: false
312
- }
313
- })
314
- }));
315
- }
316
- }
317
- exports.Choices = Choices;
318
- (0, _defineProperty2.default)(Choices, "propTypes", {
319
- duplicates: _propTypes.default.bool,
320
- error: _propTypes.default.string,
321
- model: _propTypes.default.object.isRequired,
322
- onChange: _propTypes.default.func.isRequired,
323
- toolbarOpts: _propTypes.default.object,
324
- pluginProps: _propTypes.default.object,
325
- maxChoices: _propTypes.default.number,
326
- uploadSoundSupport: _propTypes.default.object,
327
- maxImageWidth: _propTypes.default.number,
328
- maxImageHeight: _propTypes.default.number,
329
- maxLength: _propTypes.default.number
330
- });
331
- var _default = exports.default = Choices;
332
- //# sourceMappingURL=choices.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"choices.js","names":["_react","_interopRequireDefault","require","_propTypes","_editableHtmlTipTap","_configUi","_Button","_styles","_choice","_markupUtils","_mathRendering","StyledDesign","styled","theme","display","flexDirection","marginBottom","spacing","StyledAddButton","Button","marginLeft","StyledAltChoices","alignItems","flexWrap","justifyContent","marginTop","margin","ErrorText","fontSize","typography","color","palette","error","main","paddingBottom","Choices","React","Component","constructor","args","_defineProperty2","default","warning","open","createRef","prevValue","val","key","onChange","model","props","choices","correctResponse","alternateResponses","choiceIsEmpty","value","duplicatedValue","find","c","id","newChoices","filter","setState","text","map","choice","usedForResponse","Object","keys","forEach","responseKey","values","alternate","indexOf","choiceId","latestValue","currentChoice","effectiveValue","undefined","focusedEl","oldChoices","maxId","length","Math","max","parseInt","newId","duplicates","includes","componentDidUpdate","focusedNodeRef","focus","renderMath","wrapperRef","current","render","state","mathMlOptions","maxChoices","toolbarOpts","uploadSoundSupport","imageSupport","pluginProps","maxImageWidth","maxImageHeight","maxLength","visibleChoices","getVisibleChoices","createElement","ref","variant","onClick","onAddChoice","disabled","index","style","minWidth","zIndex","autoFocus","markup","languageCharactersProps","language","preventDone","onChoiceChanged","onDone","onChoiceDone","onBlur","e","inInInsertCharacter","relatedTarget","closest","disableUnderline","charactersLimit","onChoiceFocus","onRemoveChoice","onChoiceRemove","AlertDialog","title","onConfirm","exports","PropTypes","bool","string","object","isRequired","func","number","_default"],"sources":["../src/choices.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport { AlertDialog } from '@pie-lib/config-ui';\nimport Button from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\n\nimport Choice from './choice';\nimport { choiceIsEmpty } from './markupUtils';\nimport { renderMath } from '@pie-lib/math-rendering';\n\nconst StyledDesign = styled('div')(({ theme }) => ({\n display: 'flex',\n flexDirection: 'column',\n marginBottom: theme.spacing(1.5),\n}));\n\nconst StyledAddButton = styled(Button)({\n marginLeft: 'auto',\n});\n\nconst StyledAltChoices = styled('div')(({ theme }) => ({\n alignItems: 'flex-start',\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: 'space-evenly',\n marginTop: theme.spacing(1),\n\n '& > *': {\n margin: theme.spacing(1),\n },\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingBottom: theme.spacing(2),\n}));\n\nexport class Choices extends React.Component {\n static propTypes = {\n duplicates: PropTypes.bool,\n error: PropTypes.string,\n model: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n toolbarOpts: PropTypes.object,\n pluginProps: PropTypes.object,\n maxChoices: PropTypes.number,\n uploadSoundSupport: PropTypes.object,\n maxImageWidth: PropTypes.number,\n maxImageHeight: PropTypes.number,\n maxLength: PropTypes.number,\n };\n\n state = { warning: { open: false } };\n preventDone = false;\n wrapperRef = React.createRef(null);\n\n componentDidUpdate() {\n if (this.focusedNodeRef) {\n this.focusedNodeRef.focus('end');\n }\n\n renderMath(this.wrapperRef.current);\n }\n\n onChoiceChanged = (prevValue, val, key) => {\n const { onChange, model } = this.props;\n const { choices, correctResponse, alternateResponses } = model;\n\n if (choiceIsEmpty({ value: prevValue }) && choiceIsEmpty({ value: val })) {\n return;\n }\n\n const duplicatedValue = (choices || []).find((c) => c.value === val && c.id !== key);\n\n // discard the new added choice or the changes if the choice would be a duplicate to one that already exists\n if (duplicatedValue) {\n if (prevValue === '') {\n // remove the new added choice from choices\n const newChoices = (choices || []).filter((c) => c.id !== key);\n\n onChange(newChoices);\n }\n\n this.setState({\n warning: {\n open: true,\n text: 'Identical answer choices are not allowed and the changes will be discarded.',\n },\n });\n\n return;\n }\n\n const newChoices = choices?.map((choice) => (choice.id === key ? { ...choice, value: val } : choice)) || [];\n\n if (!choiceIsEmpty({ value: val })) {\n onChange(newChoices);\n\n return;\n }\n\n // if the edited content is empty, its usage has to be searched in the correct response definitions\n let usedForResponse = false;\n\n if (correctResponse) {\n Object.keys(correctResponse).forEach((responseKey) => {\n if (correctResponse[responseKey] === key) {\n usedForResponse = true;\n }\n });\n }\n\n if (alternateResponses && !usedForResponse) {\n Object.values(alternateResponses).forEach((alternate) => {\n if (alternate.indexOf(key) >= 0) {\n usedForResponse = true;\n }\n });\n }\n\n if (usedForResponse) {\n this.setState({\n warning: {\n open: true,\n text: 'Answer choices cannot be blank and the changes will be discarded.',\n },\n });\n\n return;\n }\n\n onChange(newChoices);\n };\n\n onChoiceDone = (choiceId, latestValue) => {\n const { onChange, model } = this.props;\n const { choices } = model;\n const currentChoice = (choices || []).find((c) => c.id === choiceId);\n\n // model.choices[i].value can be stale when the editor's onChange did not fire for the most recent edit \n // (for example, image uploads). In that case, we want to use the latest value from the editor.\n const effectiveValue = latestValue !== undefined ? latestValue : currentChoice && currentChoice.value;\n\n if (!currentChoice || !choiceIsEmpty({ value: effectiveValue })) {\n if (currentChoice && currentChoice.value !== effectiveValue) {\n const newChoices = (choices || []).map((c) => (c.id === choiceId ? { ...c, value: effectiveValue } : c));\n onChange(newChoices);\n }\n this.setState({ focusedEl: undefined });\n return;\n }\n\n onChange((choices || []).filter((c) => c.id !== choiceId));\n\n this.setState({\n focusedEl: undefined,\n warning: {\n open: true,\n text: 'Answer choices cannot be blank.',\n },\n });\n };\n\n onChoiceFocus = (id) =>\n this.setState({\n focusedEl: id,\n });\n\n onAddChoice = () => {\n const {\n model: { choices: oldChoices },\n onChange,\n } = this.props;\n\n // find the maximum existing id and add 1 to generate the new id so we avoid duplicates\n const maxId = oldChoices.length > 0 ? Math.max(...oldChoices.map((choice) => parseInt(choice.id, 10) || 0)) : -1;\n const newId = `${maxId + 1}`;\n\n this.setState(\n {\n focusedEl: newId,\n },\n () => {\n onChange([\n ...oldChoices,\n {\n id: newId,\n value: '',\n },\n ]);\n },\n );\n };\n\n onChoiceRemove = (id) => {\n const {\n onChange,\n model: { choices },\n } = this.props;\n const newChoices = (choices || []).filter((choice) => choice.id !== id);\n\n onChange(newChoices);\n };\n\n getVisibleChoices = () => {\n const {\n duplicates,\n model: { choices, correctResponse },\n } = this.props;\n\n if (!choices) {\n return [];\n }\n\n if (duplicates) {\n return choices;\n }\n\n // if duplicates not allowed, remove the choices that are used to define the correct response\n return choices.filter((choice) => !(correctResponse && Object.values(correctResponse).includes(choice.id)));\n };\n\n render() {\n const { focusedEl, warning } = this.state;\n const {\n duplicates,\n error,\n mathMlOptions = {},\n maxChoices,\n model: { choices },\n toolbarOpts,\n uploadSoundSupport,\n imageSupport = {},\n pluginProps = {},\n maxImageWidth,\n maxImageHeight,\n maxLength,\n } = this.props;\n const visibleChoices = this.getVisibleChoices() || [];\n return (\n <StyledDesign ref={this.wrapperRef}>\n <StyledAddButton\n variant=\"contained\"\n color=\"primary\"\n onClick={this.onAddChoice}\n disabled={maxChoices && choices && maxChoices === choices.length}\n >\n Add Choice\n </StyledAddButton>\n\n <StyledAltChoices>\n {visibleChoices.map((choice, index) => {\n if (!choice || !choice.id) {\n return null;\n }\n\n return focusedEl === choice.id ? (\n <div\n key={index}\n style={{\n minWidth: '100%',\n zIndex: '100',\n }}\n >\n <EditableHtml\n ref={(ref) => (this.focusedNodeRef = ref)}\n autoFocus\n imageSupport={imageSupport}\n markup={choice.value}\n pluginProps={pluginProps}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n onChange={(val) => {\n if (this.preventDone) {\n return;\n }\n\n this.onChoiceChanged(choice.value, val, choice.id);\n }}\n onDone={(val) => {\n if (this.preventDone) {\n return;\n }\n\n this.onChoiceDone(choice.id, val);\n }}\n onBlur={(e) => {\n const inInInsertCharacter = e.relatedTarget && e.relatedTarget.closest('.insert-character-dialog');\n\n this.preventDone = inInInsertCharacter;\n }}\n disableUnderline\n toolbarOpts={toolbarOpts}\n uploadSoundSupport={uploadSoundSupport}\n mathMlOptions={mathMlOptions}\n maxImageHeight={maxImageHeight}\n maxImageWidth={maxImageWidth}\n charactersLimit={maxLength}\n />\n </div>\n ) : (\n <Choice\n key={index}\n duplicates={duplicates}\n choice={choice}\n error={error}\n onClick={() => this.onChoiceFocus(choice.id)}\n onRemoveChoice={() => this.onChoiceRemove(choice.id)}\n />\n );\n })}\n </StyledAltChoices>\n {error && <ErrorText>{error}</ErrorText>}\n\n <AlertDialog\n open={warning.open}\n title=\"Warning\"\n text={warning.text}\n onConfirm={() => this.setState({ warning: { open: false } })}\n />\n </StyledDesign>\n );\n }\n}\n\nexport default Choices;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,mBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEA,IAAAM,OAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,cAAA,GAAAR,OAAA;AAEA,MAAMS,YAAY,GAAG,IAAAC,cAAM,EAAC,KAAK,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EACjDC,OAAO,EAAE,MAAM;EACfC,aAAa,EAAE,QAAQ;EACvBC,YAAY,EAAEH,KAAK,CAACI,OAAO,CAAC,GAAG;AACjC,CAAC,CAAC,CAAC;AAEH,MAAMC,eAAe,GAAG,IAAAN,cAAM,EAACO,eAAM,CAAC,CAAC;EACrCC,UAAU,EAAE;AACd,CAAC,CAAC;AAEF,MAAMC,gBAAgB,GAAG,IAAAT,cAAM,EAAC,KAAK,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EACrDS,UAAU,EAAE,YAAY;EACxBR,OAAO,EAAE,MAAM;EACfS,QAAQ,EAAE,MAAM;EAChBC,cAAc,EAAE,cAAc;EAC9BC,SAAS,EAAEZ,KAAK,CAACI,OAAO,CAAC,CAAC,CAAC;EAE3B,OAAO,EAAE;IACPS,MAAM,EAAEb,KAAK,CAACI,OAAO,CAAC,CAAC;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