@pie-lib/mask-markup 3.1.4 → 4.0.0-next.37

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.
Files changed (113) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +4 -0
  2. package/dist/choices/choice.d.ts +28 -0
  3. package/dist/choices/choice.js +92 -0
  4. package/dist/choices/index.d.ts +29 -0
  5. package/dist/choices/index.js +59 -0
  6. package/dist/componentize.d.ts +12 -0
  7. package/dist/componentize.js +4 -0
  8. package/dist/components/blank.d.ts +45 -0
  9. package/dist/components/blank.js +273 -0
  10. package/dist/components/correct-input.d.ts +11 -0
  11. package/dist/components/dropdown.d.ts +37 -0
  12. package/dist/components/dropdown.js +311 -0
  13. package/dist/components/input.d.ts +37 -0
  14. package/dist/constructed-response.d.ts +44 -0
  15. package/dist/constructed-response.js +56 -0
  16. package/dist/customizable.d.ts +43 -0
  17. package/dist/customizable.js +8 -0
  18. package/dist/drag-in-the-blank.d.ts +47 -0
  19. package/dist/drag-in-the-blank.js +220 -0
  20. package/dist/index.d.ts +15 -0
  21. package/dist/index.js +7 -0
  22. package/dist/inline-dropdown.d.ts +44 -0
  23. package/dist/inline-dropdown.js +24 -0
  24. package/dist/keyboard-coordinates.d.ts +25 -0
  25. package/dist/keyboard-coordinates.js +49 -0
  26. package/dist/mask.d.ts +30 -0
  27. package/dist/mask.js +95 -0
  28. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
  29. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/index.js +17 -0
  30. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssPrefix.js +9 -0
  31. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssUnitless.js +26 -0
  32. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/hasOwn.js +11 -0
  33. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isFunction.js +11 -0
  34. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isObject.js +11 -0
  35. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixInfo.js +24 -0
  36. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixProperties.js +32 -0
  37. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixer.js +29 -0
  38. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/camelize.js +14 -0
  39. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenRe.js +8 -0
  40. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenate.js +12 -0
  41. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/separate.js +11 -0
  42. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toLowerFirst.js +10 -0
  43. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toUpperFirst.js +10 -0
  44. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleObject.js +55 -0
  45. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleString.js +16 -0
  46. package/dist/serialization.d.ts +34 -0
  47. package/dist/serialization.js +132 -0
  48. package/dist/with-mask.d.ts +55 -0
  49. package/dist/with-mask.js +45 -0
  50. package/package.json +35 -19
  51. package/CHANGELOG.json +0 -17
  52. package/CHANGELOG.md +0 -1357
  53. package/LICENSE.md +0 -5
  54. package/lib/choices/choice.js +0 -138
  55. package/lib/choices/choice.js.map +0 -1
  56. package/lib/choices/index.js +0 -126
  57. package/lib/choices/index.js.map +0 -1
  58. package/lib/componentize.js +0 -21
  59. package/lib/componentize.js.map +0 -1
  60. package/lib/components/blank.js +0 -489
  61. package/lib/components/blank.js.map +0 -1
  62. package/lib/components/correct-input.js +0 -94
  63. package/lib/components/correct-input.js.map +0 -1
  64. package/lib/components/dropdown.js +0 -480
  65. package/lib/components/dropdown.js.map +0 -1
  66. package/lib/components/input.js +0 -50
  67. package/lib/components/input.js.map +0 -1
  68. package/lib/constructed-response.js +0 -101
  69. package/lib/constructed-response.js.map +0 -1
  70. package/lib/customizable.js +0 -42
  71. package/lib/customizable.js.map +0 -1
  72. package/lib/drag-in-the-blank.js +0 -363
  73. package/lib/drag-in-the-blank.js.map +0 -1
  74. package/lib/index.js +0 -55
  75. package/lib/index.js.map +0 -1
  76. package/lib/inline-dropdown.js +0 -40
  77. package/lib/inline-dropdown.js.map +0 -1
  78. package/lib/keyboard-coordinates.js +0 -156
  79. package/lib/keyboard-coordinates.js.map +0 -1
  80. package/lib/mask.js +0 -203
  81. package/lib/mask.js.map +0 -1
  82. package/lib/serialization.js +0 -261
  83. package/lib/serialization.js.map +0 -1
  84. package/lib/with-mask.js +0 -97
  85. package/lib/with-mask.js.map +0 -1
  86. package/src/__tests__/drag-in-the-blank.test.js +0 -256
  87. package/src/__tests__/index.test.js +0 -38
  88. package/src/__tests__/keyboard-coordinates.test.js +0 -202
  89. package/src/__tests__/mask.test.js +0 -479
  90. package/src/__tests__/serialization.test.js +0 -54
  91. package/src/__tests__/utils.js +0 -1
  92. package/src/__tests__/with-mask.test.js +0 -76
  93. package/src/choices/__tests__/index.test.js +0 -212
  94. package/src/choices/choice.jsx +0 -113
  95. package/src/choices/index.jsx +0 -88
  96. package/src/componentize.js +0 -13
  97. package/src/components/__tests__/blank.test.js +0 -413
  98. package/src/components/__tests__/correct-input.test.js +0 -90
  99. package/src/components/__tests__/dropdown.test.js +0 -129
  100. package/src/components/__tests__/input.test.js +0 -102
  101. package/src/components/blank.jsx +0 -504
  102. package/src/components/correct-input.jsx +0 -82
  103. package/src/components/dropdown.jsx +0 -421
  104. package/src/components/input.jsx +0 -48
  105. package/src/constructed-response.jsx +0 -87
  106. package/src/customizable.jsx +0 -34
  107. package/src/drag-in-the-blank.jsx +0 -351
  108. package/src/index.js +0 -16
  109. package/src/inline-dropdown.jsx +0 -29
  110. package/src/keyboard-coordinates.js +0 -147
  111. package/src/mask.jsx +0 -174
  112. package/src/serialization.js +0 -260
  113. package/src/with-mask.jsx +0 -75
@@ -1,489 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports["default"] = void 0;
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
- var _react = _interopRequireWildcard(require("react"));
13
- var _propTypes = _interopRequireDefault(require("prop-types"));
14
- var _mathRendering = require("@pie-lib/math-rendering");
15
- var _debug = _interopRequireDefault(require("debug"));
16
- var _core = require("@dnd-kit/core");
17
- var _styles = require("@mui/material/styles");
18
- var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
19
- var _classnames = _interopRequireDefault(require("classnames"));
20
- var _renderUi = require("@pie-lib/render-ui");
21
- var _colors = require("@mui/material/colors");
22
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
23
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
24
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
25
- var log = (0, _debug["default"])('pie-lib:mask-markup:blank');
26
- var StyledContent = (0, _styles.styled)('span')(function (_ref) {
27
- var dragged = _ref.dragged,
28
- over = _ref.over,
29
- selected = _ref.selected,
30
- showsPointerCursor = _ref.showsPointerCursor;
31
- return _objectSpread(_objectSpread(_objectSpread({
32
- border: "solid 0px ".concat(_renderUi.color.primary()),
33
- minWidth: '200px',
34
- overflow: 'hidden',
35
- whiteSpace: 'nowrap',
36
- opacity: 1,
37
- cursor: 'default'
38
- }, over && {
39
- whiteSpace: 'nowrap',
40
- overflow: 'hidden'
41
- }), (dragged || selected) && {
42
- opacity: 0.5
43
- }), showsPointerCursor && {
44
- '&:hover': {
45
- cursor: 'pointer'
46
- }
47
- });
48
- });
49
- var StyledDragHandle = (0, _styles.styled)('span')({
50
- display: 'inline-flex',
51
- touchAction: 'none'
52
- });
53
- var StyledChip = (0, _styles.styled)(_Chip["default"])(function () {
54
- return {
55
- backgroundColor: _renderUi.color.background(),
56
- border: "2px dashed ".concat(_renderUi.color.text()),
57
- touchAction: 'none',
58
- color: _renderUi.color.text(),
59
- fontSize: 'inherit',
60
- maxWidth: '374px',
61
- position: 'relative',
62
- borderRadius: '3px',
63
- '&.over': {
64
- whiteSpace: 'nowrap',
65
- overflow: 'hidden'
66
- },
67
- '&.parentOver': {
68
- border: "1px solid ".concat(_colors.grey[500]),
69
- backgroundColor: "".concat(_colors.grey[300])
70
- },
71
- '&.correct': {
72
- border: "solid 1px ".concat(_renderUi.color.correct())
73
- },
74
- '&.incorrect': {
75
- border: "solid 1px ".concat(_renderUi.color.incorrect())
76
- },
77
- '&.Mui-disabled': {
78
- opacity: 1
79
- }
80
- };
81
- });
82
- var StyledChipLabel = (0, _styles.styled)('span')(function () {
83
- return {
84
- whiteSpace: 'normal',
85
- // Added for touch devices, for image content.
86
- // This will prevent the context menu from appearing and not allowing other interactions with the image.
87
- // If interactions with the image in the token will be requested we should handle only the context Menu.
88
- pointerEvents: 'none',
89
- '& img': {
90
- display: 'block',
91
- padding: '2px 0'
92
- },
93
- // Remove default <p> margins to ensure consistent spacing across all wrapped content (p, span, div, math)
94
- // Padding for top and bottom will instead be controlled by the container for consistent layout
95
- // Ensures consistent behavior with pie-api-browser, where marginTop is already removed by a Bootstrap stylesheet
96
- '& p': {
97
- marginTop: '0',
98
- marginBottom: '0'
99
- },
100
- '& mjx-frac': {
101
- fontSize: '120% !important'
102
- },
103
- '& mjx-mn:has(~ mjx-mfrac), mjx-mfrac ~ mjx-mn': {
104
- fontSize: '120% !important'
105
- },
106
- '&.over': {
107
- whiteSpace: 'nowrap',
108
- overflow: 'hidden'
109
- },
110
- '&.hidden': {
111
- color: 'transparent',
112
- opacity: 0
113
- },
114
- '&.dragged': {
115
- position: 'absolute',
116
- left: 16,
117
- maxWidth: '60px',
118
- top: '50%',
119
- transform: 'translateY(-50%)'
120
- }
121
- };
122
- });
123
- function BlankContent(_ref2) {
124
- var _dragItem$choice, _frozenRef$current, _frozenRef$current2;
125
- var disabled = _ref2.disabled,
126
- choice = _ref2.choice,
127
- isOver = _ref2.isOver,
128
- isDragging = _ref2.isDragging,
129
- dragItem = _ref2.dragItem,
130
- correct = _ref2.correct,
131
- emptyResponseAreaWidth = _ref2.emptyResponseAreaWidth,
132
- emptyResponseAreaHeight = _ref2.emptyResponseAreaHeight;
133
- var rootRef = (0, _react.useRef)(null);
134
- var spanRef = (0, _react.useRef)(null);
135
- var frozenRef = (0, _react.useRef)(null); // to use during dragging to prevent flickering
136
- var measuringRef = (0, _react.useRef)(false); // guard against ResizeObserver feedback loops
137
- var _useState = (0, _react.useState)({
138
- height: 0,
139
- width: 0
140
- }),
141
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
142
- dimensions = _useState2[0],
143
- setDimensions = _useState2[1];
144
- var handleImageLoad = function handleImageLoad() {
145
- updateDimensions();
146
- };
147
- var handleElements = function handleElements() {
148
- var _spanRef$current;
149
- var imageElement = (_spanRef$current = spanRef.current) === null || _spanRef$current === void 0 ? void 0 : _spanRef$current.querySelector('img');
150
- if (imageElement) {
151
- imageElement.onload = handleImageLoad;
152
- } else {
153
- setTimeout(function () {
154
- updateDimensions();
155
- }, 300);
156
- }
157
- };
158
- var getMeasureNode = function getMeasureNode() {
159
- if (!spanRef.current) {
160
- return null;
161
- }
162
- var mjx = spanRef.current.querySelector('mjx-container');
163
- if (mjx && spanRef.current.parentElement) {
164
- return spanRef.current.parentElement;
165
- }
166
- var img = spanRef.current.querySelector('img');
167
- if (img) {
168
- // If there's text alongside the image, measure the full span to capture both dimensions
169
- var hasTextContent = spanRef.current.textContent.trim().length > 0;
170
- return hasTextContent ? spanRef.current : img;
171
- }
172
- return spanRef.current;
173
- };
174
- var updateDimensions = function updateDimensions() {
175
- if (spanRef.current && rootRef.current && !measuringRef.current) {
176
- measuringRef.current = true;
177
- // Temporarily set rootRef width to 'auto' for natural measurement
178
- rootRef.current.style.width = 'auto';
179
- rootRef.current.style.height = 'auto';
180
- rootRef.current.offsetHeight;
181
- var measureNode = getMeasureNode();
182
- var node = measureNode || spanRef.current;
183
- var rect = node.getBoundingClientRect();
184
- var width = node.offsetWidth || rect.width || 0;
185
- var height = Math.max(node.offsetHeight || 0, rect.height || 0, node.scrollHeight || 0, spanRef.current.scrollHeight || 0);
186
- var PADDING = 12;
187
- var BORDER_WIDTH = 2;
188
- var ADDITIONAL_SPACE = 1;
189
- // padding and border on each side
190
- var widthWithPadding = width + 2 * PADDING + 2 * BORDER_WIDTH + ADDITIONAL_SPACE;
191
- // padding and border on top and bottom
192
- var heightWithPadding = height + 2 * PADDING + 2 * BORDER_WIDTH + ADDITIONAL_SPACE;
193
- var responseAreaWidth = parseFloat(emptyResponseAreaWidth) || 0;
194
- var responseAreaHeight = parseFloat(emptyResponseAreaHeight) || 0;
195
- var adjustedWidth = widthWithPadding <= responseAreaWidth ? responseAreaWidth : widthWithPadding;
196
- var adjustedHeight = heightWithPadding <= responseAreaHeight ? responseAreaHeight : heightWithPadding;
197
- setDimensions(function (prevState) {
198
- return {
199
- width: adjustedWidth > responseAreaWidth ? adjustedWidth : prevState.width,
200
- height: adjustedHeight > responseAreaHeight ? adjustedHeight : prevState.height
201
- };
202
- });
203
- var nextWidth = "".concat(adjustedWidth, "px");
204
- var nextHeight = "".concat(adjustedHeight, "px");
205
- if (rootRef.current.style.width !== nextWidth) {
206
- rootRef.current.style.width = nextWidth;
207
- }
208
- if (rootRef.current.style.height !== nextHeight) {
209
- rootRef.current.style.height = nextHeight;
210
- }
211
- measuringRef.current = false;
212
- }
213
- };
214
- var getRootDimensions = function getRootDimensions() {
215
- // Handle potential non-numeric values
216
- var responseAreaWidth = !isNaN(parseFloat(emptyResponseAreaWidth)) ? parseFloat(emptyResponseAreaWidth) : 0;
217
- var responseAreaHeight = !isNaN(parseFloat(emptyResponseAreaHeight)) ? parseFloat(emptyResponseAreaHeight) : 0;
218
- var rootStyle = {
219
- height: dimensions.height || responseAreaHeight,
220
- width: dimensions.width || responseAreaWidth
221
- };
222
-
223
- // add minWidth, minHeight if width and height are not defined
224
- return _objectSpread(_objectSpread(_objectSpread({}, rootStyle), responseAreaWidth ? {} : {
225
- minWidth: 90
226
- }), responseAreaHeight ? {} : {
227
- minHeight: 32
228
- });
229
- };
230
- (0, _react.useEffect)(function () {
231
- handleElements();
232
- }, []);
233
-
234
- // Re-measure when the element first becomes visible — covers the tabbed-view case
235
- // where the initial measurement happened while the tab was hidden (size 0).
236
- (0, _react.useEffect)(function () {
237
- if (typeof IntersectionObserver === 'undefined' || !rootRef.current) return undefined;
238
- var io = new IntersectionObserver(function (entries) {
239
- if (entries.some(function (e) {
240
- return e.isIntersecting;
241
- })) updateDimensions();
242
- }, {
243
- threshold: 0
244
- });
245
- io.observe(rootRef.current);
246
- return function () {
247
- return io.disconnect();
248
- };
249
- }, []);
250
-
251
- // Render math for the placeholder/preview when dragging over
252
- (0, _react.useEffect)(function () {
253
- if (rootRef.current) {
254
- (0, _mathRendering.renderMath)(rootRef.current);
255
- }
256
- }, [correct, isOver, dragItem === null || dragItem === void 0 || (_dragItem$choice = dragItem.choice) === null || _dragItem$choice === void 0 ? void 0 : _dragItem$choice.value]);
257
- (0, _react.useEffect)(function () {
258
- if (!choice) {
259
- setDimensions({
260
- height: 0,
261
- width: 0
262
- });
263
- return;
264
- }
265
- handleElements();
266
- }, [choice === null || choice === void 0 ? void 0 : choice.value]);
267
- (0, _react.useEffect)(function () {
268
- if (!isOver && !isDragging) {
269
- frozenRef.current = {
270
- width: rootRef.current.offsetWidth,
271
- height: rootRef.current.offsetHeight
272
- };
273
- }
274
- }, [choice, isOver, isDragging]);
275
- var draggedLabel = dragItem && isOver && dragItem.choice && dragItem.choice.value;
276
- var label = choice && choice.value;
277
- var style = isOver || isDragging ? {
278
- width: (_frozenRef$current = frozenRef.current) === null || _frozenRef$current === void 0 ? void 0 : _frozenRef$current.width,
279
- height: (_frozenRef$current2 = frozenRef.current) === null || _frozenRef$current2 === void 0 ? void 0 : _frozenRef$current2.height
280
- } : getRootDimensions();
281
- return /*#__PURE__*/_react["default"].createElement(StyledChip, {
282
- clickable: false,
283
- disabled: disabled,
284
- ref: rootRef,
285
- component: "span",
286
- label: /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(StyledChipLabel, {
287
- ref: spanRef,
288
- draggable: true,
289
- className: (0, _classnames["default"])({
290
- over: isOver,
291
- hidden: draggedLabel
292
- }),
293
- dangerouslySetInnerHTML: {
294
- __html: label || ''
295
- }
296
- }), draggedLabel && /*#__PURE__*/_react["default"].createElement(StyledChipLabel, {
297
- draggable: true,
298
- className: (0, _classnames["default"])({
299
- over: isOver,
300
- dragged: true
301
- }),
302
- dangerouslySetInnerHTML: {
303
- __html: draggedLabel || ''
304
- }
305
- })),
306
- className: (0, _classnames["default"])({
307
- over: isOver,
308
- parentOver: isOver,
309
- correct: correct !== undefined && correct,
310
- incorrect: correct !== undefined && !correct
311
- }),
312
- variant: disabled ? 'outlined' : undefined,
313
- style: style
314
- });
315
- }
316
- BlankContent.defaultProps = {
317
- emptyResponseAreaWidth: 0,
318
- emptyResponseAreaHeight: 0
319
- };
320
- BlankContent.propTypes = {
321
- id: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
322
- disabled: _propTypes["default"].bool,
323
- duplicates: _propTypes["default"].bool,
324
- choice: _propTypes["default"].object,
325
- isOver: _propTypes["default"].bool,
326
- dragItem: _propTypes["default"].object,
327
- correct: _propTypes["default"].bool,
328
- onChange: _propTypes["default"].func,
329
- emptyResponseAreaWidth: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
330
- emptyResponseAreaHeight: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
331
- instanceId: _propTypes["default"].string
332
- };
333
-
334
- // New functional component using @dnd-kit hooks
335
- function DragDropBlank(_ref3) {
336
- var _dragItem$data;
337
- var id = _ref3.id,
338
- disabled = _ref3.disabled,
339
- duplicates = _ref3.duplicates,
340
- choice = _ref3.choice,
341
- correct = _ref3.correct,
342
- onChange = _ref3.onChange,
343
- emptyResponseAreaWidth = _ref3.emptyResponseAreaWidth,
344
- emptyResponseAreaHeight = _ref3.emptyResponseAreaHeight,
345
- instanceId = _ref3.instanceId,
346
- selectedItem = _ref3.selectedItem,
347
- onSelectClick = _ref3.onSelectClick,
348
- onPlacementClick = _ref3.onPlacementClick;
349
- var _useState3 = (0, _react.useState)(false),
350
- _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
351
- isHovered = _useState4[0],
352
- setIsHovered = _useState4[1];
353
- var dragData = {
354
- id: id,
355
- choice: choice,
356
- instanceId: instanceId,
357
- fromChoice: false,
358
- // This is from a blank, not from choices
359
- type: 'MaskBlank'
360
- };
361
-
362
- // Setup draggable functionality
363
- var _useDraggable = (0, _core.useDraggable)({
364
- id: "mask-blank-drag-".concat(id),
365
- disabled: disabled || !choice,
366
- data: dragData,
367
- // dnd-kit's own `attributes` default tabIndex to 0 unconditionally, even when
368
- // `disabled` — so a non-draggable (empty) blank stays a native Tab stop of its own.
369
- // For a drop-zone (droppable blank), that duplicates the outer wrapper's own tab stop
370
- // (see isNativeTabStop below) at the exact same position, so Tab/Shift+Tab has to
371
- // pass through both to move anywhere visibly, making every other press look like a
372
- // no-op. Drop it out of the tab order here whenever it isn't independently
373
- // reachable/interactive, leaving the outer wrapper (for an empty blank) or
374
- // nothing (for a disabled blank) as the sole stop.
375
- attributes: {
376
- tabIndex: choice && !disabled ? 0 : -1
377
- }
378
- }),
379
- dragAttributes = _useDraggable.attributes,
380
- dragListeners = _useDraggable.listeners,
381
- setDragNodeRef = _useDraggable.setNodeRef,
382
- isDragging = _useDraggable.isDragging;
383
-
384
- // Setup droppable functionality
385
- var _useDroppable = (0, _core.useDroppable)({
386
- id: "mask-blank-drop-".concat(id),
387
- data: {
388
- id: id,
389
- accepts: ['MaskBlank'],
390
- instanceId: instanceId
391
- }
392
- }),
393
- setDropNodeRef = _useDroppable.setNodeRef,
394
- isOver = _useDroppable.isOver,
395
- dragItem = _useDroppable.active;
396
- var isSelected = !!selectedItem && selectedItem.fromChoice === false && selectedItem.id === id;
397
- var handleClick = function handleClick() {
398
- if (disabled) return;
399
- if (isSelected) {
400
- // Clicking this blank's already-selected content again deselects it.
401
- onSelectClick === null || onSelectClick === void 0 || onSelectClick(dragData);
402
- } else if (selectedItem) {
403
- // Something else is selected — place it here, whether this blank is currently
404
- // empty or already filled (the same commitPlacement logic drag-and-drop uses).
405
- onPlacementClick === null || onPlacementClick === void 0 || onPlacementClick(id);
406
- } else if (choice) {
407
- // Nothing selected yet, and this blank holds an answer — select it for moving
408
- // elsewhere, the same way Tab+Space/Enter does.
409
- onSelectClick === null || onSelectClick === void 0 || onSelectClick(dragData);
410
- }
411
-
412
- // Empty blank clicked with nothing selected: nothing to place or select.
413
- };
414
-
415
- // An empty blank isn't draggable, so dnd-kit's own attributes (only applied to the
416
- // inner node, and only when draggable) never make it tabbable — this outer wrapper
417
- // needs its own focus/activation handling so "select a choice, then Tab to a blank
418
- // and press Space/Enter" works even when the blank is empty. This is independent of,
419
- // and doesn't change, the existing in-drag Tab-cycling (that's driven by an active
420
- // dnd-kit drag, not native focus).
421
- //
422
- // Only made a native Tab stop when NOT draggable (i.e. empty): when the blank is
423
- // filled, the inner node is already independently tabbable via dnd-kit's own
424
- // attributes for the existing pick-up-to-move gesture, and adding a second, outer Tab
425
- // stop for the same visual chip would add an extra stop to the existing Tab order —
426
- // the same double-tab-stop bug already found and fixed once in match-list/image-
427
- // cloze-association's equivalent code.
428
- var isNativeTabStop = !choice && !disabled;
429
- var isInnerDraggable = !!choice && !disabled;
430
- var handleKeyDown = function handleKeyDown(e) {
431
- if (e.code === 'Space' || e.code === 'Enter') {
432
- e.preventDefault();
433
- handleClick();
434
- }
435
- };
436
- var hasSelection = !!selectedItem;
437
- var showsHoverEffect = isOver || hasSelection && isHovered && !disabled;
438
- return /*#__PURE__*/_react["default"].createElement(StyledContent, {
439
- ref: setDropNodeRef,
440
- role: isNativeTabStop ? 'button' : undefined,
441
- tabIndex: isNativeTabStop ? 0 : -1,
442
- onClick: handleClick,
443
- onKeyDown: isNativeTabStop ? handleKeyDown : undefined,
444
- onMouseEnter: function onMouseEnter() {
445
- return setIsHovered(true);
446
- },
447
- onMouseLeave: function onMouseLeave() {
448
- return setIsHovered(false);
449
- },
450
- dragged: isDragging,
451
- over: showsHoverEffect,
452
- selected: isSelected,
453
- showsPointerCursor: hasSelection && !disabled
454
- }, /*#__PURE__*/_react["default"].createElement(StyledDragHandle, (0, _extends2["default"])({
455
- ref: setDragNodeRef
456
- }, isInnerDraggable ? dragAttributes : {}, dragListeners), /*#__PURE__*/_react["default"].createElement(BlankContent, {
457
- id: id,
458
- disabled: disabled,
459
- duplicates: duplicates,
460
- choice: choice,
461
- isOver: showsHoverEffect,
462
- dragItem: dragItem === null || dragItem === void 0 || (_dragItem$data = dragItem.data) === null || _dragItem$data === void 0 ? void 0 : _dragItem$data.current,
463
- correct: correct,
464
- onChange: onChange,
465
- emptyResponseAreaWidth: emptyResponseAreaWidth,
466
- emptyResponseAreaHeight: emptyResponseAreaHeight,
467
- instanceId: instanceId
468
- })));
469
- }
470
- DragDropBlank.defaultProps = {
471
- emptyResponseAreaWidth: 0,
472
- emptyResponseAreaHeight: 0
473
- };
474
- DragDropBlank.propTypes = {
475
- id: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
476
- disabled: _propTypes["default"].bool,
477
- duplicates: _propTypes["default"].bool,
478
- choice: _propTypes["default"].object,
479
- correct: _propTypes["default"].bool,
480
- onChange: _propTypes["default"].func,
481
- emptyResponseAreaWidth: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
482
- emptyResponseAreaHeight: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
483
- instanceId: _propTypes["default"].string,
484
- selectedItem: _propTypes["default"].object,
485
- onSelectClick: _propTypes["default"].func,
486
- onPlacementClick: _propTypes["default"].func
487
- };
488
- var _default = exports["default"] = DragDropBlank;
489
- //# sourceMappingURL=blank.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blank.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_mathRendering","_debug","_core","_styles","_Chip","_classnames","_renderUi","_colors","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","log","debug","StyledContent","styled","_ref","dragged","over","selected","showsPointerCursor","border","concat","color","primary","minWidth","overflow","whiteSpace","opacity","cursor","StyledDragHandle","display","touchAction","StyledChip","Chip","backgroundColor","background","text","fontSize","maxWidth","position","borderRadius","grey","correct","incorrect","StyledChipLabel","pointerEvents","padding","marginTop","marginBottom","left","top","transform","BlankContent","_ref2","_dragItem$choice","_frozenRef$current","_frozenRef$current2","disabled","choice","isOver","isDragging","dragItem","emptyResponseAreaWidth","emptyResponseAreaHeight","rootRef","useRef","spanRef","frozenRef","measuringRef","_useState","useState","height","width","_useState2","_slicedToArray2","dimensions","setDimensions","handleImageLoad","updateDimensions","handleElements","_spanRef$current","imageElement","current","querySelector","onload","setTimeout","getMeasureNode","mjx","parentElement","img","hasTextContent","textContent","trim","style","offsetHeight","measureNode","node","rect","getBoundingClientRect","offsetWidth","Math","max","scrollHeight","PADDING","BORDER_WIDTH","ADDITIONAL_SPACE","widthWithPadding","heightWithPadding","responseAreaWidth","parseFloat","responseAreaHeight","adjustedWidth","adjustedHeight","prevState","nextWidth","nextHeight","getRootDimensions","isNaN","rootStyle","minHeight","useEffect","IntersectionObserver","undefined","io","entries","some","isIntersecting","threshold","observe","disconnect","renderMath","value","draggedLabel","label","createElement","clickable","ref","component","Fragment","draggable","className","classnames","hidden","dangerouslySetInnerHTML","__html","parentOver","variant","defaultProps","propTypes","id","PropTypes","oneOfType","string","number","bool","duplicates","object","onChange","func","instanceId","DragDropBlank","_ref3","_dragItem$data","selectedItem","onSelectClick","onPlacementClick","_useState3","_useState4","isHovered","setIsHovered","dragData","fromChoice","type","_useDraggable","useDraggable","data","attributes","tabIndex","dragAttributes","dragListeners","listeners","setDragNodeRef","setNodeRef","_useDroppable","useDroppable","accepts","setDropNodeRef","active","isSelected","handleClick","isNativeTabStop","isInnerDraggable","handleKeyDown","code","preventDefault","hasSelection","showsHoverEffect","role","onClick","onKeyDown","onMouseEnter","onMouseLeave","_extends2","_default","exports"],"sources":["../../src/components/blank.jsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport debug from 'debug';\nimport { useDraggable, useDroppable } from '@dnd-kit/core';\nimport { styled } from '@mui/material/styles';\nimport Chip from '@mui/material/Chip';\nimport classnames from 'classnames';\nimport { color } from '@pie-lib/render-ui';\nimport { grey } from '@mui/material/colors';\n\nconst log = debug('pie-lib:mask-markup:blank');\n\nconst StyledContent = styled('span')(({ dragged, over, selected, showsPointerCursor }) => ({\n border: `solid 0px ${color.primary()}`,\n minWidth: '200px',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n opacity: 1,\n cursor: 'default',\n ...(over && {\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n }),\n ...((dragged || selected) && {\n opacity: 0.5,\n }),\n ...(showsPointerCursor && {\n '&:hover': {\n cursor: 'pointer',\n },\n }),\n}));\n\nconst StyledDragHandle = styled('span')({\n display: 'inline-flex',\n touchAction: 'none',\n});\n\nconst StyledChip = styled(Chip)(() => ({\n backgroundColor: color.background(),\n border: `2px dashed ${color.text()}`,\n touchAction: 'none',\n color: color.text(),\n fontSize: 'inherit',\n maxWidth: '374px',\n position: 'relative',\n borderRadius: '3px',\n '&.over': {\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n },\n '&.parentOver': {\n border: `1px solid ${grey[500]}`,\n backgroundColor: `${grey[300]}`,\n },\n '&.correct': {\n border: `solid 1px ${color.correct()}`,\n },\n '&.incorrect': {\n border: `solid 1px ${color.incorrect()}`,\n },\n '&.Mui-disabled': {\n opacity: 1,\n },\n}));\n\nconst StyledChipLabel = styled('span')(() => ({\n whiteSpace: 'normal',\n // Added for touch devices, for image content.\n // This will prevent the context menu from appearing and not allowing other interactions with the image.\n // If interactions with the image in the token will be requested we should handle only the context Menu.\n pointerEvents: 'none',\n '& img': {\n display: 'block',\n padding: '2px 0',\n },\n // Remove default <p> margins to ensure consistent spacing across all wrapped content (p, span, div, math)\n // Padding for top and bottom will instead be controlled by the container for consistent layout\n // Ensures consistent behavior with pie-api-browser, where marginTop is already removed by a Bootstrap stylesheet\n '& p': {\n marginTop: '0',\n marginBottom: '0',\n },\n '& mjx-frac': {\n fontSize: '120% !important',\n },\n '& mjx-mn:has(~ mjx-mfrac), mjx-mfrac ~ mjx-mn': {\n fontSize: '120% !important',\n },\n '&.over': {\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n },\n '&.hidden': {\n color: 'transparent',\n opacity: 0,\n },\n '&.dragged': {\n position: 'absolute',\n left: 16,\n maxWidth: '60px',\n top: '50%',\n transform: 'translateY(-50%)',\n },\n}));\n\nfunction BlankContent({\n disabled,\n choice,\n isOver,\n isDragging,\n dragItem,\n correct,\n emptyResponseAreaWidth,\n emptyResponseAreaHeight,\n}) {\n const rootRef = useRef(null);\n const spanRef = useRef(null);\n const frozenRef = useRef(null); // to use during dragging to prevent flickering\n const measuringRef = useRef(false); // guard against ResizeObserver feedback loops\n const [dimensions, setDimensions] = useState({ height: 0, width: 0 });\n\n const handleImageLoad = () => {\n updateDimensions();\n };\n\n const handleElements = () => {\n const imageElement = spanRef.current?.querySelector('img');\n if (imageElement) {\n imageElement.onload = handleImageLoad;\n } else {\n setTimeout(() => {\n updateDimensions();\n }, 300);\n }\n };\n\n const getMeasureNode = () => {\n if (!spanRef.current) {\n return null;\n }\n\n const mjx = spanRef.current.querySelector('mjx-container');\n\n if (mjx && spanRef.current.parentElement) {\n return spanRef.current.parentElement;\n }\n\n const img = spanRef.current.querySelector('img');\n\n if (img) {\n // If there's text alongside the image, measure the full span to capture both dimensions\n const hasTextContent = spanRef.current.textContent.trim().length > 0;\n\n return hasTextContent ? spanRef.current : img;\n }\n\n return spanRef.current;\n };\n\n const updateDimensions = () => {\n if (spanRef.current && rootRef.current && !measuringRef.current) {\n measuringRef.current = true;\n // Temporarily set rootRef width to 'auto' for natural measurement\n rootRef.current.style.width = 'auto';\n rootRef.current.style.height = 'auto';\n rootRef.current.offsetHeight;\n\n const measureNode = getMeasureNode();\n const node = measureNode || spanRef.current;\n const rect = node.getBoundingClientRect();\n const width = node.offsetWidth || rect.width || 0;\n const height = Math.max(\n node.offsetHeight || 0,\n rect.height || 0,\n node.scrollHeight || 0,\n spanRef.current.scrollHeight || 0,\n );\n\n const PADDING = 12;\n const BORDER_WIDTH = 2;\n const ADDITIONAL_SPACE = 1;\n // padding and border on each side\n const widthWithPadding = width + 2 * PADDING + 2 * BORDER_WIDTH + ADDITIONAL_SPACE;\n // padding and border on top and bottom\n const heightWithPadding = height + 2 * PADDING + 2 * BORDER_WIDTH + ADDITIONAL_SPACE;\n\n const responseAreaWidth = parseFloat(emptyResponseAreaWidth) || 0;\n const responseAreaHeight = parseFloat(emptyResponseAreaHeight) || 0;\n\n const adjustedWidth = widthWithPadding <= responseAreaWidth ? responseAreaWidth : widthWithPadding;\n const adjustedHeight = heightWithPadding <= responseAreaHeight ? responseAreaHeight : heightWithPadding;\n\n setDimensions((prevState) => ({\n width: adjustedWidth > responseAreaWidth ? adjustedWidth : prevState.width,\n height: adjustedHeight > responseAreaHeight ? adjustedHeight : prevState.height,\n }));\n\n const nextWidth = `${adjustedWidth}px`;\n const nextHeight = `${adjustedHeight}px`;\n if (rootRef.current.style.width !== nextWidth) {\n rootRef.current.style.width = nextWidth;\n }\n if (rootRef.current.style.height !== nextHeight) {\n rootRef.current.style.height = nextHeight;\n }\n measuringRef.current = false;\n }\n };\n\n const getRootDimensions = () => {\n // Handle potential non-numeric values\n const responseAreaWidth = !isNaN(parseFloat(emptyResponseAreaWidth)) ? parseFloat(emptyResponseAreaWidth) : 0;\n const responseAreaHeight = !isNaN(parseFloat(emptyResponseAreaHeight)) ? parseFloat(emptyResponseAreaHeight) : 0;\n\n const rootStyle = {\n height: dimensions.height || responseAreaHeight,\n width: dimensions.width || responseAreaWidth,\n };\n\n // add minWidth, minHeight if width and height are not defined\n return {\n ...rootStyle,\n ...(responseAreaWidth ? {} : { minWidth: 90 }),\n ...(responseAreaHeight ? {} : { minHeight: 32 }),\n };\n };\n\n useEffect(() => {\n handleElements();\n }, []);\n\n // Re-measure when the element first becomes visible — covers the tabbed-view case\n // where the initial measurement happened while the tab was hidden (size 0).\n useEffect(() => {\n if (typeof IntersectionObserver === 'undefined' || !rootRef.current) return undefined;\n const io = new IntersectionObserver(\n (entries) => {\n if (entries.some((e) => e.isIntersecting)) updateDimensions();\n },\n { threshold: 0 },\n );\n io.observe(rootRef.current);\n return () => io.disconnect();\n }, []);\n\n // Render math for the placeholder/preview when dragging over\n useEffect(() => {\n if (rootRef.current) {\n renderMath(rootRef.current);\n }\n }, [correct, isOver, dragItem?.choice?.value]);\n\n useEffect(() => {\n if (!choice) {\n setDimensions({ height: 0, width: 0 });\n return;\n }\n handleElements();\n }, [choice?.value]);\n\n useEffect(() => {\n if (!isOver && !isDragging) {\n frozenRef.current = {\n width: rootRef.current.offsetWidth,\n height: rootRef.current.offsetHeight,\n };\n }\n }, [choice, isOver, isDragging]);\n\n const draggedLabel = dragItem && isOver && dragItem.choice && dragItem.choice.value;\n const label = choice && choice.value;\n const style =\n isOver || isDragging\n ? {\n width: frozenRef.current?.width,\n height: frozenRef.current?.height,\n }\n : getRootDimensions();\n\n return (\n <StyledChip\n clickable={false}\n disabled={disabled}\n ref={rootRef}\n component=\"span\"\n label={\n <React.Fragment>\n <StyledChipLabel\n ref={spanRef}\n draggable={true}\n className={classnames({\n over: isOver,\n hidden: draggedLabel,\n })}\n dangerouslySetInnerHTML={{ __html: label || '' }}\n />\n {draggedLabel && (\n <StyledChipLabel\n draggable={true}\n className={classnames({\n over: isOver,\n dragged: true,\n })}\n dangerouslySetInnerHTML={{ __html: draggedLabel || '' }}\n />\n )}\n </React.Fragment>\n }\n className={classnames({\n over: isOver,\n parentOver: isOver,\n correct: correct !== undefined && correct,\n incorrect: correct !== undefined && !correct,\n })}\n variant={disabled ? 'outlined' : undefined}\n style={style}\n />\n );\n}\n\nBlankContent.defaultProps = {\n emptyResponseAreaWidth: 0,\n emptyResponseAreaHeight: 0,\n};\n\nBlankContent.propTypes = {\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n disabled: PropTypes.bool,\n duplicates: PropTypes.bool,\n choice: PropTypes.object,\n isOver: PropTypes.bool,\n dragItem: PropTypes.object,\n correct: PropTypes.bool,\n onChange: PropTypes.func,\n emptyResponseAreaWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n emptyResponseAreaHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n instanceId: PropTypes.string,\n};\n\n// New functional component using @dnd-kit hooks\nfunction DragDropBlank({\n id,\n disabled,\n duplicates,\n choice,\n correct,\n onChange,\n emptyResponseAreaWidth,\n emptyResponseAreaHeight,\n instanceId,\n selectedItem,\n onSelectClick,\n onPlacementClick,\n}) {\n const [isHovered, setIsHovered] = useState(false);\n\n const dragData = {\n id,\n choice,\n instanceId,\n fromChoice: false, // This is from a blank, not from choices\n type: 'MaskBlank',\n };\n\n // Setup draggable functionality\n const {\n attributes: dragAttributes,\n listeners: dragListeners,\n setNodeRef: setDragNodeRef,\n isDragging,\n } = useDraggable({\n id: `mask-blank-drag-${id}`,\n disabled: disabled || !choice,\n data: dragData,\n // dnd-kit's own `attributes` default tabIndex to 0 unconditionally, even when\n // `disabled` — so a non-draggable (empty) blank stays a native Tab stop of its own.\n // For a drop-zone (droppable blank), that duplicates the outer wrapper's own tab stop\n // (see isNativeTabStop below) at the exact same position, so Tab/Shift+Tab has to\n // pass through both to move anywhere visibly, making every other press look like a\n // no-op. Drop it out of the tab order here whenever it isn't independently\n // reachable/interactive, leaving the outer wrapper (for an empty blank) or\n // nothing (for a disabled blank) as the sole stop.\n attributes: {\n tabIndex: choice && !disabled ? 0 : -1,\n },\n });\n\n // Setup droppable functionality\n const {\n setNodeRef: setDropNodeRef,\n isOver,\n active: dragItem,\n } = useDroppable({\n id: `mask-blank-drop-${id}`,\n data: {\n id: id,\n accepts: ['MaskBlank'],\n instanceId: instanceId,\n },\n });\n\n const isSelected = !!selectedItem && selectedItem.fromChoice === false && selectedItem.id === id;\n\n const handleClick = () => {\n if (disabled) return;\n\n if (isSelected) {\n // Clicking this blank's already-selected content again deselects it.\n onSelectClick?.(dragData);\n } else if (selectedItem) {\n // Something else is selected — place it here, whether this blank is currently\n // empty or already filled (the same commitPlacement logic drag-and-drop uses).\n onPlacementClick?.(id);\n } else if (choice) {\n // Nothing selected yet, and this blank holds an answer — select it for moving\n // elsewhere, the same way Tab+Space/Enter does.\n onSelectClick?.(dragData);\n }\n\n // Empty blank clicked with nothing selected: nothing to place or select.\n };\n\n // An empty blank isn't draggable, so dnd-kit's own attributes (only applied to the\n // inner node, and only when draggable) never make it tabbable — this outer wrapper\n // needs its own focus/activation handling so \"select a choice, then Tab to a blank\n // and press Space/Enter\" works even when the blank is empty. This is independent of,\n // and doesn't change, the existing in-drag Tab-cycling (that's driven by an active\n // dnd-kit drag, not native focus).\n //\n // Only made a native Tab stop when NOT draggable (i.e. empty): when the blank is\n // filled, the inner node is already independently tabbable via dnd-kit's own\n // attributes for the existing pick-up-to-move gesture, and adding a second, outer Tab\n // stop for the same visual chip would add an extra stop to the existing Tab order —\n // the same double-tab-stop bug already found and fixed once in match-list/image-\n // cloze-association's equivalent code.\n const isNativeTabStop = !choice && !disabled;\n const isInnerDraggable = !!choice && !disabled;\n\n const handleKeyDown = (e) => {\n if (e.code === 'Space' || e.code === 'Enter') {\n e.preventDefault();\n handleClick();\n }\n };\n\n const hasSelection = !!selectedItem;\n const showsHoverEffect = isOver || (hasSelection && isHovered && !disabled);\n\n return (\n <StyledContent\n ref={setDropNodeRef}\n role={isNativeTabStop ? 'button' : undefined}\n tabIndex={isNativeTabStop ? 0 : -1}\n onClick={handleClick}\n onKeyDown={isNativeTabStop ? handleKeyDown : undefined}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n dragged={isDragging}\n over={showsHoverEffect}\n selected={isSelected}\n showsPointerCursor={hasSelection && !disabled}\n >\n <StyledDragHandle ref={setDragNodeRef} {...(isInnerDraggable ? dragAttributes : {})} {...dragListeners}>\n <BlankContent\n id={id}\n disabled={disabled}\n duplicates={duplicates}\n choice={choice}\n isOver={showsHoverEffect}\n dragItem={dragItem?.data?.current}\n correct={correct}\n onChange={onChange}\n emptyResponseAreaWidth={emptyResponseAreaWidth}\n emptyResponseAreaHeight={emptyResponseAreaHeight}\n instanceId={instanceId}\n />\n </StyledDragHandle>\n </StyledContent>\n );\n}\n\nDragDropBlank.defaultProps = {\n emptyResponseAreaWidth: 0,\n emptyResponseAreaHeight: 0,\n};\n\nDragDropBlank.propTypes = {\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n disabled: PropTypes.bool,\n duplicates: PropTypes.bool,\n choice: PropTypes.object,\n correct: PropTypes.bool,\n onChange: PropTypes.func,\n emptyResponseAreaWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n emptyResponseAreaHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n instanceId: PropTypes.string,\n selectedItem: PropTypes.object,\n onSelectClick: PropTypes.func,\n onPlacementClick: PropTypes.func,\n};\n\nexport default DragDropBlank;\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,WAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AAA4C,SAAAD,wBAAAY,CAAA,EAAAC,CAA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,EAAEA,uBAAwB;IACjDgG,UAAU,EAAEA;EAAW,CACxB,CACe,CACL,CAAC;AAEpB;AAEAC,aAAa,CAACb,YAAY,GAAG;EAC3BrF,sBAAsB,EAAE,CAAC;EACzBC,uBAAuB,EAAE;AAC3B,CAAC;AAEDiG,aAAa,CAACZ,SAAS,GAAG;EACxBC,EAAE,EAAEC,qBAAS,CAACC,SAAS,CAAC,CAACD,qBAAS,CAACE,MAAM,EAAEF,qBAAS,CAACG,MAAM,CAAC,CAAC;EAC7DhG,QAAQ,EAAE6F,qBAAS,CAACI,IAAI;EACxBC,UAAU,EAAEL,qBAAS,CAACI,IAAI;EAC1BhG,MAAM,EAAE4F,qBAAS,CAACM,MAAM;EACxBlH,OAAO,EAAE4G,qBAAS,CAACI,IAAI;EACvBG,QAAQ,EAAEP,qBAAS,CAACQ,IAAI;EACxBhG,sBAAsB,EAAEwF,qBAAS,CAACC,SAAS,CAAC,CAACD,qBAAS,CAACE,MAAM,EAAEF,qBAAS,CAACG,MAAM,CAAC,CAAC;EACjF1F,uBAAuB,EAAEuF,qBAAS,CAACC,SAAS,CAAC,CAACD,qBAAS,CAACE,MAAM,EAAEF,qBAAS,CAACG,MAAM,CAAC,CAAC;EAClFM,UAAU,EAAET,qBAAS,CAACE,MAAM;EAC5BW,YAAY,EAAEb,qBAAS,CAACM,MAAM;EAC9BQ,aAAa,EAAEd,qBAAS,CAACQ,IAAI;EAC7BO,gBAAgB,EAAEf,qBAAS,CAACQ;AAC9B,CAAC;AAAC,IAAA6C,QAAA,GAAAC,OAAA,cAEa5C,aAAa","ignoreList":[]}
@@ -1,94 +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"] = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
11
- var _react = _interopRequireDefault(require("react"));
12
- var _OutlinedInput = _interopRequireDefault(require("@mui/material/OutlinedInput"));
13
- var _classnames2 = _interopRequireDefault(require("classnames"));
14
- var _styles = require("@mui/material/styles");
15
- var _renderUi = require("@pie-lib/render-ui");
16
- var _excluded = ["correct", "charactersLimit", "disabled", "isBox", "isConstructedResponse", "width", "spellCheck"];
17
- var StyledOutlinedInput = (0, _styles.styled)(_OutlinedInput["default"])(function () {
18
- return {
19
- padding: '2px',
20
- borderRadius: '4px',
21
- fontSize: 'inherit',
22
- display: 'inline-block',
23
- verticalAlign: 'middle',
24
- '& fieldset': {
25
- border: 0
26
- },
27
- '& .MuiOutlinedInput-input': {
28
- color: _renderUi.color.text(),
29
- backgroundColor: _renderUi.color.background(),
30
- borderRadius: '4px !important',
31
- borderWidth: '1px',
32
- borderStyle: 'solid',
33
- padding: '10px 20px 10px 10px',
34
- '&:disabled': {
35
- opacity: 0.8,
36
- cursor: 'not-allowed !important'
37
- },
38
- '&:hover': {
39
- borderColor: _renderUi.color.primary(),
40
- '&:disabled': {
41
- borderColor: 'initial'
42
- }
43
- },
44
- '&.Mui-focused': {
45
- borderColor: _renderUi.color.primaryDark()
46
- },
47
- '&.crInput': {
48
- padding: '8px !important'
49
- },
50
- '&.correct': {
51
- borderColor: "".concat(_renderUi.color.correct(), " !important")
52
- },
53
- '&.incorrect': {
54
- borderColor: "".concat(_renderUi.color.incorrect(), " !important")
55
- }
56
- }
57
- };
58
- });
59
- var CorrectInput = function CorrectInput(props) {
60
- var correct = props.correct,
61
- charactersLimit = props.charactersLimit,
62
- disabled = props.disabled,
63
- isBox = props.isBox,
64
- isConstructedResponse = props.isConstructedResponse,
65
- width = props.width,
66
- spellCheck = props.spellCheck,
67
- rest = (0, _objectWithoutProperties2["default"])(props, _excluded);
68
- var label = typeof correct === 'boolean' ? correct ? 'correct' : 'incorrect' : undefined;
69
- var inputProps = charactersLimit ? {
70
- maxLength: charactersLimit,
71
- 'aria-label': 'Enter answer'
72
- } : {
73
- 'aria-label': 'Enter answer'
74
- };
75
- if (width) {
76
- inputProps.style = {
77
- width: "".concat(width + Math.round(width / 10) + 1, "ch") // added some extra space for capital letters
78
- };
79
- }
80
- return /*#__PURE__*/_react["default"].createElement(StyledOutlinedInput, (0, _extends2["default"])({
81
- className: (0, _classnames2["default"])({
82
- disabledInput: disabled,
83
- box: isBox
84
- }),
85
- classes: {
86
- input: (0, _classnames2["default"])((0, _defineProperty2["default"])((0, _defineProperty2["default"])({}, label, label), "crInput", isConstructedResponse))
87
- },
88
- inputProps: inputProps,
89
- disabled: disabled,
90
- spellCheck: spellCheck
91
- }, rest));
92
- };
93
- var _default = exports["default"] = CorrectInput;
94
- //# sourceMappingURL=correct-input.js.map