@pie-element/match-list 7.2.0 → 7.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
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
+ ## [7.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/match-list@7.2.0...@pie-element/match-list@7.2.1) (2026-08-26)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **match-list:** match dragged item to droppable by containment, not reconstructed center PIE-920 PIE-921 ([f77c20c](https://github.com/pie-framework/pie-elements/commit/f77c20cedae8628fdd9675c2bec29373d7939a3c))
11
+
6
12
  # [7.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/match-list@7.1.9...@pie-element/match-list@7.2.0) (2026-08-21)
7
13
 
8
14
  ### Bug Fixes
package/lib/answer.js CHANGED
@@ -219,7 +219,18 @@ function DragAndDropAnswer(props) {
219
219
  } = (0, _core.useDraggable)({
220
220
  id: dragId,
221
221
  data: activeData,
222
- disabled: !draggable || disabled
222
+ disabled: !draggable || disabled,
223
+ // dnd-kit's own `attributes` default tabIndex to 0 unconditionally, even when
224
+ // `disabled` — so a non-draggable (empty) tile stays a native Tab stop of its own.
225
+ // For a drop-zone (dropId set), that duplicates the outer wrapper's own tab stop
226
+ // (see isNativeTabStop below) at the exact same position, so Tab/Shift+Tab has to
227
+ // pass through both to move anywhere visibly, making every other press look like a
228
+ // no-op. Drop it out of the tab order here whenever it isn't independently
229
+ // reachable/interactive, leaving the outer wrapper (for an empty drop-zone) or
230
+ // nothing (for a disabled choice) as the sole stop.
231
+ attributes: {
232
+ tabIndex: draggable && !disabled ? 0 : -1
233
+ }
223
234
  });
224
235
  const droppable = (0, _core.useDroppable)({
225
236
  id: dropId,
package/lib/answer.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"answer.js","names":["_core","require","_propTypes","_interopRequireDefault","_react","_interopRequireWildcard","_debug","_styles","_drag","_lodashEs","_renderUi","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","log","debug","HolderNumber","styled","theme","width","fontSize","textAlign","color","palette","common","black","Holder","index","isOver","disabled","type","createElement","PlaceHolder","extraStyles","display","padding","alignItems","justifyContent","height","undefined","propTypes","PropTypes","number","bool","string","AnswerContentContainer","isDragging","isSelected","outcome","text","backgroundColor","white","border","correct","incorrect","cursor","boxSizing","overflow","transition","wordBreak","opacity","touchAction","AnswerContent","props","title","empty","guideIndex","dangerouslySetInnerHTML","__html","AnswerContainer","minHeight","minWidth","margin","spacing","Answer","React","Component","constructor","args","_defineProperty2","componentDidMount","ref","addEventListener","handleTouchStart","passive","componentWillUnmount","removeEventListener","render","id","className","isEmpty","exports","any","DragAndDropAnswer","instanceId","promptId","draggable","selectedAnswer","onSelectClick","onPlacementClick","dragId","dropId","activeData","value","dropZoneData","attributes","listeners","setNodeRef","setDragRef","transform","useDraggable","data","droppable","useDroppable","setDropRef","isHovered","setIsHovered","useState","hasSelection","showsHoverEffect","transformStyle","x","y","handleResponseAreaClick","isNativeTabStop","handleResponseAreaKeyDown","code","preventDefault","role","tabIndex","onClick","onKeyDown","onMouseEnter","onMouseLeave","style","flex","_extends2","handleChoiceClick","stopPropagation","object","func","_default"],"sources":["../src/answer.jsx"],"sourcesContent":["import { useDraggable, useDroppable } from '@dnd-kit/core';\nimport PropTypes from 'prop-types';\nimport React, { useState } from 'react';\nimport debug from 'debug';\nimport { styled } from '@mui/material/styles';\nimport { PlaceHolder } from '@pie-lib/drag';\nimport { isEmpty } from 'lodash-es';\nimport { color } from '@pie-lib/render-ui';\n\nconst log = debug('pie-elements:match-title:answer');\n\nconst HolderNumber = styled('div')(({ theme }) => ({\n width: '100%',\n fontSize: '18px',\n textAlign: 'center',\n color: `rgba(${theme.palette.common.black}, 0.6)`,\n}));\n\nconst Holder = ({ index, isOver, disabled, type }) => (\n <PlaceHolder\n extraStyles={{\n display: 'flex',\n padding: '0',\n alignItems: 'center',\n justifyContent: 'center',\n height: '40px',\n }}\n disabled={disabled}\n isOver={isOver}\n type={type}\n >\n {index !== undefined && <HolderNumber>{index}</HolderNumber>}\n </PlaceHolder>\n);\n\nHolder.propTypes = {\n index: PropTypes.number,\n isOver: PropTypes.bool,\n disabled: PropTypes.bool,\n type: PropTypes.string,\n};\n\nconst AnswerContentContainer = styled('div')(({ isDragging, isSelected, isOver, disabled, outcome }) => ({\n color: color.text(),\n backgroundColor: color.white(),\n border: `1px solid ${\n outcome === 'correct' ? color.correct() : outcome === 'incorrect' ? color.incorrect() : color.border()\n }`,\n cursor: disabled ? 'not-allowed' : 'pointer',\n width: '100%',\n padding: '10px',\n boxSizing: 'border-box',\n overflow: 'hidden',\n transition: 'opacity 200ms linear',\n wordBreak: 'break-word',\n opacity: (isDragging || isSelected) && !disabled ? 0.5 : isOver && !disabled ? 0.2 : 1,\n touchAction: 'none',\n}));\n\nconst AnswerContent = (props) => {\n const { isDragging, isSelected, isOver, title, disabled, empty, outcome, guideIndex, type } = props;\n\n if (empty) {\n return <Holder index={guideIndex} isOver={isOver} disabled={disabled} type={type} />;\n } else {\n return (\n <AnswerContentContainer\n isDragging={isDragging}\n isSelected={isSelected}\n isOver={isOver}\n disabled={disabled}\n outcome={outcome}\n dangerouslySetInnerHTML={{ __html: title }}\n />\n );\n }\n};\n\nconst AnswerContainer = styled('div')(({ correct, theme }) => ({\n boxSizing: 'border-box',\n minHeight: 40,\n minWidth: '200px',\n overflow: 'hidden',\n margin: theme.spacing(0.5),\n padding: '0px',\n textAlign: 'center',\n height: 'initial',\n border:\n correct === true\n ? `1px solid var(--feedback-correct-bg-color, ${color.correct()})`\n : correct === false\n ? `1px solid var(--feedback-incorrect-bg-color, ${color.incorrect()})`\n : 'none',\n}));\n\nexport class Answer extends React.Component {\n static propTypes = {\n className: PropTypes.string,\n isDragging: PropTypes.bool,\n isSelected: PropTypes.bool,\n id: PropTypes.any,\n title: PropTypes.string,\n isOver: PropTypes.bool,\n empty: PropTypes.bool,\n type: PropTypes.string,\n disabled: PropTypes.bool,\n correct: PropTypes.bool,\n };\n\n componentDidMount() {\n if (this.ref) {\n // NOTE: preventing default on touchstart can block dnd-kit pointer handling on some devices.\n // Consider removing this if you have issues on touch devices.\n this.ref.addEventListener('touchstart', this.handleTouchStart, { passive: true });\n }\n }\n\n componentWillUnmount() {\n if (this.ref) {\n this.ref.removeEventListener('touchstart', this.handleTouchStart);\n }\n }\n\n handleTouchStart = (e) => {\n // do NOT call e.preventDefault() here — it prevents pointer events necessary for dnd-kit.\n // Keep this handler empty or remove it if you don't need it.\n // e.preventDefault();\n };\n\n render() {\n const {\n id,\n title,\n isDragging = false,\n isSelected = false,\n className,\n disabled,\n isOver = false,\n type,\n correct,\n } = this.props;\n\n log('[render], props: ', this.props);\n\n return (\n <AnswerContainer correct={correct} className={className} ref={(ref) => (this.ref = ref)}>\n <AnswerContent\n title={title}\n id={id}\n isOver={isOver}\n empty={isEmpty(title)}\n isDragging={isDragging}\n isSelected={isSelected}\n disabled={disabled}\n type={type}\n />\n </AnswerContainer>\n );\n }\n}\n\nfunction DragAndDropAnswer(props) {\n const {\n id,\n instanceId,\n promptId,\n draggable = true,\n disabled = false,\n type,\n selectedAnswer,\n onSelectClick,\n onPlacementClick,\n } = props;\n\n const dragId = `${type || 'answer'}-${id}`;\n // droppable only if promptId exists\n const dropId = promptId !== undefined && promptId !== null ? `drop-${promptId}` : undefined;\n\n // Built once and reused for both dnd-kit's own data and the click handlers below, so\n // a click carries exactly the same shape dnd-kit's onDragStart/onDragEnd would.\n const activeData = {\n type: type || 'answer',\n id,\n instanceId,\n value: props.title,\n promptId,\n };\n const dropZoneData = dropId\n ? {\n type: 'drop-zone',\n promptId,\n instanceId,\n }\n : undefined;\n\n const {\n attributes,\n listeners,\n setNodeRef: setDragRef,\n transform,\n transition,\n isDragging,\n } = useDraggable({\n id: dragId,\n data: activeData,\n disabled: !draggable || disabled,\n });\n\n const droppable = useDroppable({\n id: dropId,\n data: dropZoneData,\n disabled: disabled || !dropId,\n });\n\n const setDropRef = droppable.setNodeRef;\n const isOver = droppable.isOver;\n\n // dnd-kit's own isOver only reflects real collision detection during an active drag,\n // so it stays false while an answer is merely click-selected (no drag in progress).\n // Track hovering locally and fold it into the same isOver signal used everywhere\n // below, so hovering a response area while something is selected gets the exact same\n // treatment as hovering it during a real drag — one code path, no duplicated CSS.\n const [isHovered, setIsHovered] = useState(false);\n const hasSelection = !!selectedAnswer;\n const showsHoverEffect = isOver || (hasSelection && isHovered && !disabled);\n\n const isSelected =\n !!selectedAnswer &&\n selectedAnswer.type === activeData.type &&\n selectedAnswer.id === activeData.id &&\n selectedAnswer.promptId === activeData.promptId;\n\n // compute style: apply transform to the element that actually moves\n const transformStyle = transform ? `translate3d(${transform.x}px, ${transform.y}px, 0)` : undefined;\n\n // If this item is a drop-zone (prompt slot), we render an outer droppable wrapper.\n // The outer wrapper's rect is what dnd-kit measures for this slot's own droppable\n // (\"drop-{promptId}\"), so it must stay untransformed — applying the drag transform\n // there would make the slot's own droppable rect chase the dragged item during the\n // drag, corrupting collision/keyboard-navigation results. The transform belongs on\n // the inner draggable node instead.\n if (dropId) {\n const handleResponseAreaClick = () => {\n if (disabled) return;\n\n if (isSelected) {\n // Clicking the already-selected placed answer again deselects it, same as\n // for a choice in the pool.\n onSelectClick?.(activeData);\n } else if (selectedAnswer) {\n // Something else is selected — place it here, same whether this area is\n // currently empty or already occupied.\n onPlacementClick?.(dropZoneData);\n } else if (draggable) {\n // Nothing selected yet, and this response area holds an answer — clicking it\n // selects that answer for moving elsewhere, the same way Tab+Space/Enter does.\n onSelectClick?.(activeData);\n }\n\n // Empty response area clicked with nothing selected: nothing to place or select.\n };\n\n // An empty response area isn't draggable, so dnd-kit's own attributes (only\n // applied to the inner node, and only when draggable) never make it tabbable —\n // this outer wrapper needs its own focus/activation handling so \"select a choice,\n // then Tab to a response area and press Space/Enter\" works even when the area is\n // empty. This is independent of, and doesn't change, the existing in-drag\n // Tab-cycling (that's driven by an active dnd-kit drag, not native focus).\n //\n // Only made a native Tab stop when NOT draggable (i.e. empty): when the target 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,\n // outer Tab stop for the same visual tile would add an extra stop to the existing\n // Tab order. Placing into an occupied area is still fully reachable by mouse click\n // here, or by the existing keyboard drag flow (Tab+Space/Enter on the choice,\n // Tab-cycle to the occupied target, Space/Enter to swap).\n const isNativeTabStop = !draggable && !disabled;\n\n const handleResponseAreaKeyDown = (e) => {\n if (e.code === 'Space' || e.code === 'Enter') {\n e.preventDefault();\n handleResponseAreaClick();\n }\n };\n\n return (\n <div\n ref={setDropRef}\n role=\"button\"\n tabIndex={isNativeTabStop ? 0 : -1}\n onClick={handleResponseAreaClick}\n onKeyDown={isNativeTabStop ? handleResponseAreaKeyDown : undefined}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n style={{\n flex: 1,\n opacity: isDragging || isSelected ? 0.5 : 1,\n backgroundColor: isDragging || isSelected || showsHoverEffect ? 'rgba(0,0,0,0.05)' : 'transparent',\n cursor: hasSelection && !disabled ? 'pointer' : undefined,\n }}\n >\n <div ref={setDragRef} {...listeners} {...attributes} style={{ transform: transformStyle, transition }}>\n <Answer {...props} isDragging={isDragging} isSelected={isSelected} isOver={showsHoverEffect} />\n </div>\n </div>\n );\n }\n\n const handleChoiceClick = (e) => {\n if (disabled) {\n return;\n }\n\n e.stopPropagation();\n onSelectClick?.(activeData);\n };\n\n // if there is NO dropId (this is a choice / draggable-only), render only draggable node and apply transform to it.\n return (\n <div\n ref={setDragRef}\n {...listeners}\n {...attributes}\n onClick={handleChoiceClick}\n style={{\n transform: transformStyle,\n transition,\n cursor: disabled ? 'not-allowed' : 'grab',\n opacity: isDragging || isSelected ? 0.5 : 1,\n touchAction: draggable && !disabled ? 'none' : 'auto',\n }}\n >\n <Answer {...props} isDragging={isDragging} isSelected={isSelected} isOver={false} />\n </div>\n );\n}\n\nDragAndDropAnswer.propTypes = {\n id: PropTypes.any,\n instanceId: PropTypes.string,\n promptId: PropTypes.any,\n title: PropTypes.string,\n draggable: PropTypes.bool,\n disabled: PropTypes.bool,\n type: PropTypes.string,\n selectedAnswer: PropTypes.object,\n onSelectClick: PropTypes.func,\n onPlacementClick: PropTypes.func,\n};\n\nexport default DragAndDropAnswer;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAA2C,SAAAI,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,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EvB,kBAAS,CAACG,MAAM;EACvBoD,SAAS,EAAEvD,kBAAS,CAACE,IAAI;EACzBd,QAAQ,EAAEY,kBAAS,CAACE,IAAI;EACxBb,IAAI,EAAEW,kBAAS,CAACG,MAAM;EACtBqD,cAAc,EAAExD,kBAAS,CAACkG,MAAM;EAChCzC,aAAa,EAAEzD,kBAAS,CAACmG,IAAI;EAC7BzC,gBAAgB,EAAE1D,kBAAS,CAACmG;AAC9B,CAAC;AAAC,IAAAC,QAAA,GAAAlD,OAAA,CAAAtF,OAAA,GAEawF,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"answer.js","names":["_core","require","_propTypes","_interopRequireDefault","_react","_interopRequireWildcard","_debug","_styles","_drag","_lodashEs","_renderUi","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","log","debug","HolderNumber","styled","theme","width","fontSize","textAlign","color","palette","common","black","Holder","index","isOver","disabled","type","createElement","PlaceHolder","extraStyles","display","padding","alignItems","justifyContent","height","undefined","propTypes","PropTypes","number","bool","string","AnswerContentContainer","isDragging","isSelected","outcome","text","backgroundColor","white","border","correct","incorrect","cursor","boxSizing","overflow","transition","wordBreak","opacity","touchAction","AnswerContent","props","title","empty","guideIndex","dangerouslySetInnerHTML","__html","AnswerContainer","minHeight","minWidth","margin","spacing","Answer","React","Component","constructor","args","_defineProperty2","componentDidMount","ref","addEventListener","handleTouchStart","passive","componentWillUnmount","removeEventListener","render","id","className","isEmpty","exports","any","DragAndDropAnswer","instanceId","promptId","draggable","selectedAnswer","onSelectClick","onPlacementClick","dragId","dropId","activeData","value","dropZoneData","attributes","listeners","setNodeRef","setDragRef","transform","useDraggable","data","tabIndex","droppable","useDroppable","setDropRef","isHovered","setIsHovered","useState","hasSelection","showsHoverEffect","transformStyle","x","y","handleResponseAreaClick","isNativeTabStop","handleResponseAreaKeyDown","code","preventDefault","role","onClick","onKeyDown","onMouseEnter","onMouseLeave","style","flex","_extends2","handleChoiceClick","stopPropagation","object","func","_default"],"sources":["../src/answer.jsx"],"sourcesContent":["import { useDraggable, useDroppable } from '@dnd-kit/core';\nimport PropTypes from 'prop-types';\nimport React, { useState } from 'react';\nimport debug from 'debug';\nimport { styled } from '@mui/material/styles';\nimport { PlaceHolder } from '@pie-lib/drag';\nimport { isEmpty } from 'lodash-es';\nimport { color } from '@pie-lib/render-ui';\n\nconst log = debug('pie-elements:match-title:answer');\n\nconst HolderNumber = styled('div')(({ theme }) => ({\n width: '100%',\n fontSize: '18px',\n textAlign: 'center',\n color: `rgba(${theme.palette.common.black}, 0.6)`,\n}));\n\nconst Holder = ({ index, isOver, disabled, type }) => (\n <PlaceHolder\n extraStyles={{\n display: 'flex',\n padding: '0',\n alignItems: 'center',\n justifyContent: 'center',\n height: '40px',\n }}\n disabled={disabled}\n isOver={isOver}\n type={type}\n >\n {index !== undefined && <HolderNumber>{index}</HolderNumber>}\n </PlaceHolder>\n);\n\nHolder.propTypes = {\n index: PropTypes.number,\n isOver: PropTypes.bool,\n disabled: PropTypes.bool,\n type: PropTypes.string,\n};\n\nconst AnswerContentContainer = styled('div')(({ isDragging, isSelected, isOver, disabled, outcome }) => ({\n color: color.text(),\n backgroundColor: color.white(),\n border: `1px solid ${\n outcome === 'correct' ? color.correct() : outcome === 'incorrect' ? color.incorrect() : color.border()\n }`,\n cursor: disabled ? 'not-allowed' : 'pointer',\n width: '100%',\n padding: '10px',\n boxSizing: 'border-box',\n overflow: 'hidden',\n transition: 'opacity 200ms linear',\n wordBreak: 'break-word',\n opacity: (isDragging || isSelected) && !disabled ? 0.5 : isOver && !disabled ? 0.2 : 1,\n touchAction: 'none',\n}));\n\nconst AnswerContent = (props) => {\n const { isDragging, isSelected, isOver, title, disabled, empty, outcome, guideIndex, type } = props;\n\n if (empty) {\n return <Holder index={guideIndex} isOver={isOver} disabled={disabled} type={type} />;\n } else {\n return (\n <AnswerContentContainer\n isDragging={isDragging}\n isSelected={isSelected}\n isOver={isOver}\n disabled={disabled}\n outcome={outcome}\n dangerouslySetInnerHTML={{ __html: title }}\n />\n );\n }\n};\n\nconst AnswerContainer = styled('div')(({ correct, theme }) => ({\n boxSizing: 'border-box',\n minHeight: 40,\n minWidth: '200px',\n overflow: 'hidden',\n margin: theme.spacing(0.5),\n padding: '0px',\n textAlign: 'center',\n height: 'initial',\n border:\n correct === true\n ? `1px solid var(--feedback-correct-bg-color, ${color.correct()})`\n : correct === false\n ? `1px solid var(--feedback-incorrect-bg-color, ${color.incorrect()})`\n : 'none',\n}));\n\nexport class Answer extends React.Component {\n static propTypes = {\n className: PropTypes.string,\n isDragging: PropTypes.bool,\n isSelected: PropTypes.bool,\n id: PropTypes.any,\n title: PropTypes.string,\n isOver: PropTypes.bool,\n empty: PropTypes.bool,\n type: PropTypes.string,\n disabled: PropTypes.bool,\n correct: PropTypes.bool,\n };\n\n componentDidMount() {\n if (this.ref) {\n // NOTE: preventing default on touchstart can block dnd-kit pointer handling on some devices.\n // Consider removing this if you have issues on touch devices.\n this.ref.addEventListener('touchstart', this.handleTouchStart, { passive: true });\n }\n }\n\n componentWillUnmount() {\n if (this.ref) {\n this.ref.removeEventListener('touchstart', this.handleTouchStart);\n }\n }\n\n handleTouchStart = (e) => {\n // do NOT call e.preventDefault() here — it prevents pointer events necessary for dnd-kit.\n // Keep this handler empty or remove it if you don't need it.\n // e.preventDefault();\n };\n\n render() {\n const {\n id,\n title,\n isDragging = false,\n isSelected = false,\n className,\n disabled,\n isOver = false,\n type,\n correct,\n } = this.props;\n\n log('[render], props: ', this.props);\n\n return (\n <AnswerContainer correct={correct} className={className} ref={(ref) => (this.ref = ref)}>\n <AnswerContent\n title={title}\n id={id}\n isOver={isOver}\n empty={isEmpty(title)}\n isDragging={isDragging}\n isSelected={isSelected}\n disabled={disabled}\n type={type}\n />\n </AnswerContainer>\n );\n }\n}\n\nfunction DragAndDropAnswer(props) {\n const {\n id,\n instanceId,\n promptId,\n draggable = true,\n disabled = false,\n type,\n selectedAnswer,\n onSelectClick,\n onPlacementClick,\n } = props;\n\n const dragId = `${type || 'answer'}-${id}`;\n // droppable only if promptId exists\n const dropId = promptId !== undefined && promptId !== null ? `drop-${promptId}` : undefined;\n\n // Built once and reused for both dnd-kit's own data and the click handlers below, so\n // a click carries exactly the same shape dnd-kit's onDragStart/onDragEnd would.\n const activeData = {\n type: type || 'answer',\n id,\n instanceId,\n value: props.title,\n promptId,\n };\n const dropZoneData = dropId\n ? {\n type: 'drop-zone',\n promptId,\n instanceId,\n }\n : undefined;\n\n const {\n attributes,\n listeners,\n setNodeRef: setDragRef,\n transform,\n transition,\n isDragging,\n } = useDraggable({\n id: dragId,\n data: activeData,\n disabled: !draggable || disabled,\n // dnd-kit's own `attributes` default tabIndex to 0 unconditionally, even when\n // `disabled` — so a non-draggable (empty) tile stays a native Tab stop of its own.\n // For a drop-zone (dropId set), 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 drop-zone) or\n // nothing (for a disabled choice) as the sole stop.\n attributes: { tabIndex: draggable && !disabled ? 0 : -1 },\n });\n\n const droppable = useDroppable({\n id: dropId,\n data: dropZoneData,\n disabled: disabled || !dropId,\n });\n\n const setDropRef = droppable.setNodeRef;\n const isOver = droppable.isOver;\n\n // dnd-kit's own isOver only reflects real collision detection during an active drag,\n // so it stays false while an answer is merely click-selected (no drag in progress).\n // Track hovering locally and fold it into the same isOver signal used everywhere\n // below, so hovering a response area while something is selected gets the exact same\n // treatment as hovering it during a real drag — one code path, no duplicated CSS.\n const [isHovered, setIsHovered] = useState(false);\n const hasSelection = !!selectedAnswer;\n const showsHoverEffect = isOver || (hasSelection && isHovered && !disabled);\n\n const isSelected =\n !!selectedAnswer &&\n selectedAnswer.type === activeData.type &&\n selectedAnswer.id === activeData.id &&\n selectedAnswer.promptId === activeData.promptId;\n\n // compute style: apply transform to the element that actually moves\n const transformStyle = transform ? `translate3d(${transform.x}px, ${transform.y}px, 0)` : undefined;\n\n // If this item is a drop-zone (prompt slot), we render an outer droppable wrapper.\n // The outer wrapper's rect is what dnd-kit measures for this slot's own droppable\n // (\"drop-{promptId}\"), so it must stay untransformed — applying the drag transform\n // there would make the slot's own droppable rect chase the dragged item during the\n // drag, corrupting collision/keyboard-navigation results. The transform belongs on\n // the inner draggable node instead.\n if (dropId) {\n const handleResponseAreaClick = () => {\n if (disabled) return;\n\n if (isSelected) {\n // Clicking the already-selected placed answer again deselects it, same as\n // for a choice in the pool.\n onSelectClick?.(activeData);\n } else if (selectedAnswer) {\n // Something else is selected — place it here, same whether this area is\n // currently empty or already occupied.\n onPlacementClick?.(dropZoneData);\n } else if (draggable) {\n // Nothing selected yet, and this response area holds an answer — clicking it\n // selects that answer for moving elsewhere, the same way Tab+Space/Enter does.\n onSelectClick?.(activeData);\n }\n\n // Empty response area clicked with nothing selected: nothing to place or select.\n };\n\n // An empty response area isn't draggable, so dnd-kit's own attributes (only\n // applied to the inner node, and only when draggable) never make it tabbable —\n // this outer wrapper needs its own focus/activation handling so \"select a choice,\n // then Tab to a response area and press Space/Enter\" works even when the area is\n // empty. This is independent of, and doesn't change, the existing in-drag\n // Tab-cycling (that's driven by an active dnd-kit drag, not native focus).\n //\n // Only made a native Tab stop when NOT draggable (i.e. empty): when the target 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,\n // outer Tab stop for the same visual tile would add an extra stop to the existing\n // Tab order. Placing into an occupied area is still fully reachable by mouse click\n // here, or by the existing keyboard drag flow (Tab+Space/Enter on the choice,\n // Tab-cycle to the occupied target, Space/Enter to swap).\n const isNativeTabStop = !draggable && !disabled;\n\n const handleResponseAreaKeyDown = (e) => {\n if (e.code === 'Space' || e.code === 'Enter') {\n e.preventDefault();\n handleResponseAreaClick();\n }\n };\n\n return (\n <div\n ref={setDropRef}\n role=\"button\"\n tabIndex={isNativeTabStop ? 0 : -1}\n onClick={handleResponseAreaClick}\n onKeyDown={isNativeTabStop ? handleResponseAreaKeyDown : undefined}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n style={{\n flex: 1,\n opacity: isDragging || isSelected ? 0.5 : 1,\n backgroundColor: isDragging || isSelected || showsHoverEffect ? 'rgba(0,0,0,0.05)' : 'transparent',\n cursor: hasSelection && !disabled ? 'pointer' : undefined,\n }}\n >\n <div ref={setDragRef} {...listeners} {...attributes} style={{ transform: transformStyle, transition }}>\n <Answer {...props} isDragging={isDragging} isSelected={isSelected} isOver={showsHoverEffect} />\n </div>\n </div>\n );\n }\n\n const handleChoiceClick = (e) => {\n if (disabled) {\n return;\n }\n\n e.stopPropagation();\n onSelectClick?.(activeData);\n };\n\n // if there is NO dropId (this is a choice / draggable-only), render only draggable node and apply transform to it.\n return (\n <div\n ref={setDragRef}\n {...listeners}\n {...attributes}\n onClick={handleChoiceClick}\n style={{\n transform: transformStyle,\n transition,\n cursor: disabled ? 'not-allowed' : 'grab',\n opacity: isDragging || isSelected ? 0.5 : 1,\n touchAction: draggable && !disabled ? 'none' : 'auto',\n }}\n >\n <Answer {...props} isDragging={isDragging} isSelected={isSelected} isOver={false} />\n </div>\n );\n}\n\nDragAndDropAnswer.propTypes = {\n id: PropTypes.any,\n instanceId: PropTypes.string,\n promptId: PropTypes.any,\n title: PropTypes.string,\n draggable: PropTypes.bool,\n disabled: PropTypes.bool,\n type: PropTypes.string,\n selectedAnswer: PropTypes.object,\n onSelectClick: PropTypes.func,\n onPlacementClick: PropTypes.func,\n};\n\nexport default DragAndDropAnswer;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AAC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}
@@ -67,21 +67,6 @@ const closestDroppableKeyboardCoordinates = (event, {
67
67
  return currentCoordinates;
68
68
  }
69
69
 
70
- // `currentCoordinates` is the top-left of the dragged item's collision rect (not its
71
- // center), so derive the dragged item's center in the same frame before comparing it
72
- // against droppable centers below. Returning a droppable's *center* as the next
73
- // coordinates (as opposed to its top-left) would shift the dragged item's top-left to
74
- // that center, overshooting the target by roughly half its size and causing
75
- // dnd-kit to resolve collisions against a neighboring droppable instead.
76
- const draggedHalfSize = {
77
- x: (collisionRect?.width || 0) / 2,
78
- y: (collisionRect?.height || 0) / 2
79
- };
80
- const currentCenter = {
81
- x: currentCoordinates.x + draggedHalfSize.x,
82
- y: currentCoordinates.y + draggedHalfSize.y
83
- };
84
-
85
70
  // A placed answer ("target") is itself a droppable for its own prompt slot
86
71
  // ("drop-{promptId}"). That self drop-zone must never be treated as a navigable
87
72
  // target: it sits under the dragged item, so a tiny (even sub-pixel) discrepancy
@@ -91,7 +76,7 @@ const closestDroppableKeyboardCoordinates = (event, {
91
76
  const activeData = active?.data?.current;
92
77
  const ownDropId = activeData?.promptId != null ? `drop-${activeData.promptId}` : undefined;
93
78
 
94
- // Collect top-left and center of all enabled droppable containers
79
+ // Collect rect, top-left and center of all enabled droppable containers
95
80
  const targets = [];
96
81
  for (const [id, container] of droppableContainers) {
97
82
  if (container?.disabled) continue;
@@ -110,6 +95,7 @@ const closestDroppableKeyboardCoordinates = (event, {
110
95
  };
111
96
  targets.push({
112
97
  id,
98
+ rect,
113
99
  dropPosition,
114
100
  center
115
101
  });
@@ -127,14 +113,35 @@ const closestDroppableKeyboardCoordinates = (event, {
127
113
  return a.center.x - b.center.x;
128
114
  });
129
115
 
130
- // Find the current target (closest to current coordinates)
131
- let currentIndex = 0;
132
- let minDist = Infinity;
133
- for (let i = 0; i < targets.length; i++) {
134
- const dist = distance(currentCenter, targets[i].center);
135
- if (dist < minDist) {
136
- minDist = dist;
137
- currentIndex = i;
116
+ // Find the current target. Whichever target the dragged item's own center point
117
+ // actually falls inside of is the current target — this is what "currently sitting
118
+ // on a target" means, and it holds regardless of how the dragged item's size compares
119
+ // to the target's: a compact answer tile landed (per `dropPosition` above) at a wide
120
+ // response row's left edge is still contained within that row's rect.
121
+ //
122
+ // Comparing distances between the dragged item's *center* and each target's *center*
123
+ // (as this used to) breaks down for exactly that shape (a small tile in a much wider
124
+ // row): the dragged item's own center sits well short of the row's true center, by
125
+ // roughly half the width difference — enough that a completely different droppable
126
+ // (e.g. the choices pool) can end up "closer", so once the item is actually sitting on
127
+ // a target, the next press re-matches the position as if it were still somewhere
128
+ // else, and keeps recomputing the same move instead of advancing.
129
+ const draggedCenter = collisionRect ? {
130
+ x: collisionRect.left + collisionRect.width / 2,
131
+ y: collisionRect.top + collisionRect.height / 2
132
+ } : currentCoordinates;
133
+ let currentIndex = targets.findIndex(t => draggedCenter.x >= t.rect.left && draggedCenter.x <= t.rect.right && draggedCenter.y >= t.rect.top && draggedCenter.y <= t.rect.bottom);
134
+
135
+ // Fall back to nearest-by-dropPosition if the dragged item's center isn't strictly
136
+ // inside any target (e.g. mid-flight after a free arrow-key move).
137
+ if (currentIndex === -1) {
138
+ let minDist = Infinity;
139
+ for (let i = 0; i < targets.length; i++) {
140
+ const dist = distance(currentCoordinates, targets[i].dropPosition);
141
+ if (dist < minDist) {
142
+ minDist = dist;
143
+ currentIndex = i;
144
+ }
138
145
  }
139
146
  }
140
147
 
@@ -1 +1 @@
1
- {"version":3,"file":"keyboard-coordinates.js","names":["_core","require","ARROW_STEP","closestDroppableKeyboardCoordinates","event","active","context","currentCoordinates","code","isTab","isArrow","KeyboardCode","Down","Up","Left","Right","undefined","preventDefault","y","x","droppableRects","droppableContainers","collisionRect","size","draggedHalfSize","width","height","currentCenter","activeData","data","current","ownDropId","promptId","targets","id","container","disabled","rect","get","center","left","top","dropPosition","push","length","reverse","shiftKey","sort","a","b","Math","abs","currentIndex","minDist","Infinity","i","dist","distance","nextIndex","exports","sqrt"],"sources":["../src/keyboard-coordinates.js"],"sourcesContent":["import { KeyboardCode } from '@dnd-kit/core';\n\nconst ARROW_STEP = 25;\n\n/**\n * Custom keyboard coordinate getter for non-sortable drag-and-drop.\n *\n * Tab/Shift+Tab cycle the dragged item directly onto the next/previous droppable\n * (response area or the choices pool), in DOM order, placing the dragged item's own\n * top-left corner at the target's center-left point. Arrow keys are left doing plain\n * free-form movement (nudging the dragged item by a fixed step, same as dnd-kit's own\n * default keyboard behavior) rather than jumping between droppables — collision\n * detection (rectIntersection) still picks up whatever the item ends up actually\n * overlapping.\n */\nexport const closestDroppableKeyboardCoordinates = (event, { active, context, currentCoordinates }) => {\n const { code } = event;\n const isTab = code === 'Tab';\n const isArrow =\n code === KeyboardCode.Down || code === KeyboardCode.Up || code === KeyboardCode.Left || code === KeyboardCode.Right;\n\n if (!isTab && !isArrow) {\n return undefined;\n }\n\n event.preventDefault();\n\n if (isArrow) {\n switch (code) {\n case KeyboardCode.Down:\n return { ...currentCoordinates, y: currentCoordinates.y + ARROW_STEP };\n\n case KeyboardCode.Up:\n return { ...currentCoordinates, y: currentCoordinates.y - ARROW_STEP };\n\n case KeyboardCode.Right:\n return { ...currentCoordinates, x: currentCoordinates.x + ARROW_STEP };\n\n case KeyboardCode.Left:\n return { ...currentCoordinates, x: currentCoordinates.x - ARROW_STEP };\n\n default:\n return currentCoordinates;\n }\n }\n\n const { droppableRects, droppableContainers, collisionRect } = context;\n\n if (!droppableRects || droppableRects.size === 0) {\n return currentCoordinates;\n }\n\n // `currentCoordinates` is the top-left of the dragged item's collision rect (not its\n // center), so derive the dragged item's center in the same frame before comparing it\n // against droppable centers below. Returning a droppable's *center* as the next\n // coordinates (as opposed to its top-left) would shift the dragged item's top-left to\n // that center, overshooting the target by roughly half its size and causing\n // dnd-kit to resolve collisions against a neighboring droppable instead.\n const draggedHalfSize = {\n x: (collisionRect?.width || 0) / 2,\n y: (collisionRect?.height || 0) / 2,\n };\n const currentCenter = {\n x: currentCoordinates.x + draggedHalfSize.x,\n y: currentCoordinates.y + draggedHalfSize.y,\n };\n\n // A placed answer (\"target\") is itself a droppable for its own prompt slot\n // (\"drop-{promptId}\"). That self drop-zone must never be treated as a navigable\n // target: it sits under the dragged item, so a tiny (even sub-pixel) discrepancy\n // between its measured rect and the dragged item's own rect is enough to make it\n // register as the \"closest\" candidate, which reads as the drag being stuck.\n // Exclude it outright rather than relying on a distance threshold.\n const activeData = active?.data?.current;\n const ownDropId = activeData?.promptId != null ? `drop-${activeData.promptId}` : undefined;\n\n // Collect top-left and center of all enabled droppable containers\n const targets = [];\n\n for (const [id, container] of droppableContainers) {\n if (container?.disabled) continue;\n\n if (id === ownDropId) continue;\n\n const rect = droppableRects.get(id);\n\n if (!rect) continue;\n\n const center = {\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n };\n // Land the dragged item's own top-left corner at the target's center-left point,\n // rather than at the target's own top-left corner.\n const dropPosition = {\n x: rect.left,\n y: rect.top + rect.height / 2,\n };\n\n targets.push({ id, dropPosition, center });\n }\n\n if (targets.length === 0) {\n return currentCoordinates;\n }\n\n // Tab/Shift+Tab: cycle through targets in DOM order (sorted top-to-bottom, left-to-right)\n const reverse = event.shiftKey;\n\n // Sort targets by position (top to bottom, then left to right)\n targets.sort((a, b) => {\n if (Math.abs(a.center.y - b.center.y) > 10) return a.center.y - b.center.y;\n return a.center.x - b.center.x;\n });\n\n // Find the current target (closest to current coordinates)\n let currentIndex = 0;\n let minDist = Infinity;\n\n for (let i = 0; i < targets.length; i++) {\n const dist = distance(currentCenter, targets[i].center);\n\n if (dist < minDist) {\n minDist = dist;\n currentIndex = i;\n }\n }\n\n // Move to next/previous\n const nextIndex = reverse\n ? (currentIndex - 1 + targets.length) % targets.length\n : (currentIndex + 1) % targets.length;\n\n return targets[nextIndex].dropPosition;\n};\n\nconst distance = (a, b) => Math.sqrt((a.x - b.x) ** 2 + (a.y - b.y) ** 2);\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,MAAMC,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EAEvC,OAAOX,OAAO,CAACyB,SAAS,CAAC,CAAChB,YAAY;AACxC,CAAC;AAACiB,OAAA,CAAAxD,mCAAA,GAAAA,mCAAA;AAEF,MAAMsD,QAAQ,GAAGA,CAACT,CAAC,EAAEC,CAAC,KAAKC,IAAI,CAACU,IAAI,CAAC,CAACZ,CAAC,CAAC7B,CAAC,GAAG8B,CAAC,CAAC9B,CAAC,KAAK,CAAC,GAAG,CAAC6B,CAAC,CAAC9B,CAAC,GAAG+B,CAAC,CAAC/B,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"keyboard-coordinates.js","names":["_core","require","ARROW_STEP","closestDroppableKeyboardCoordinates","event","active","context","currentCoordinates","code","isTab","isArrow","KeyboardCode","Down","Up","Left","Right","undefined","preventDefault","y","x","droppableRects","droppableContainers","collisionRect","size","activeData","data","current","ownDropId","promptId","targets","id","container","disabled","rect","get","center","left","width","top","height","dropPosition","push","length","reverse","shiftKey","sort","a","b","Math","abs","draggedCenter","currentIndex","findIndex","t","right","bottom","minDist","Infinity","i","dist","distance","nextIndex","exports","sqrt"],"sources":["../src/keyboard-coordinates.js"],"sourcesContent":["import { KeyboardCode } from '@dnd-kit/core';\n\nconst ARROW_STEP = 25;\n\n/**\n * Custom keyboard coordinate getter for non-sortable drag-and-drop.\n *\n * Tab/Shift+Tab cycle the dragged item directly onto the next/previous droppable\n * (response area or the choices pool), in DOM order, placing the dragged item's own\n * top-left corner at the target's center-left point. Arrow keys are left doing plain\n * free-form movement (nudging the dragged item by a fixed step, same as dnd-kit's own\n * default keyboard behavior) rather than jumping between droppables — collision\n * detection (rectIntersection) still picks up whatever the item ends up actually\n * overlapping.\n */\nexport const closestDroppableKeyboardCoordinates = (event, { active, context, currentCoordinates }) => {\n const { code } = event;\n const isTab = code === 'Tab';\n const isArrow =\n code === KeyboardCode.Down || code === KeyboardCode.Up || code === KeyboardCode.Left || code === KeyboardCode.Right;\n\n if (!isTab && !isArrow) {\n return undefined;\n }\n\n event.preventDefault();\n\n if (isArrow) {\n switch (code) {\n case KeyboardCode.Down:\n return { ...currentCoordinates, y: currentCoordinates.y + ARROW_STEP };\n\n case KeyboardCode.Up:\n return { ...currentCoordinates, y: currentCoordinates.y - ARROW_STEP };\n\n case KeyboardCode.Right:\n return { ...currentCoordinates, x: currentCoordinates.x + ARROW_STEP };\n\n case KeyboardCode.Left:\n return { ...currentCoordinates, x: currentCoordinates.x - ARROW_STEP };\n\n default:\n return currentCoordinates;\n }\n }\n\n const { droppableRects, droppableContainers, collisionRect } = context;\n\n if (!droppableRects || droppableRects.size === 0) {\n return currentCoordinates;\n }\n\n // A placed answer (\"target\") is itself a droppable for its own prompt slot\n // (\"drop-{promptId}\"). That self drop-zone must never be treated as a navigable\n // target: it sits under the dragged item, so a tiny (even sub-pixel) discrepancy\n // between its measured rect and the dragged item's own rect is enough to make it\n // register as the \"closest\" candidate, which reads as the drag being stuck.\n // Exclude it outright rather than relying on a distance threshold.\n const activeData = active?.data?.current;\n const ownDropId = activeData?.promptId != null ? `drop-${activeData.promptId}` : undefined;\n\n // Collect rect, top-left and center of all enabled droppable containers\n const targets = [];\n\n for (const [id, container] of droppableContainers) {\n if (container?.disabled) continue;\n\n if (id === ownDropId) continue;\n\n const rect = droppableRects.get(id);\n\n if (!rect) continue;\n\n const center = {\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n };\n // Land the dragged item's own top-left corner at the target's center-left point,\n // rather than at the target's own top-left corner.\n const dropPosition = {\n x: rect.left,\n y: rect.top + rect.height / 2,\n };\n\n targets.push({ id, rect, dropPosition, center });\n }\n\n if (targets.length === 0) {\n return currentCoordinates;\n }\n\n // Tab/Shift+Tab: cycle through targets in DOM order (sorted top-to-bottom, left-to-right)\n const reverse = event.shiftKey;\n\n // Sort targets by position (top to bottom, then left to right)\n targets.sort((a, b) => {\n if (Math.abs(a.center.y - b.center.y) > 10) return a.center.y - b.center.y;\n return a.center.x - b.center.x;\n });\n\n // Find the current target. Whichever target the dragged item's own center point\n // actually falls inside of is the current target — this is what \"currently sitting\n // on a target\" means, and it holds regardless of how the dragged item's size compares\n // to the target's: a compact answer tile landed (per `dropPosition` above) at a wide\n // response row's left edge is still contained within that row's rect.\n //\n // Comparing distances between the dragged item's *center* and each target's *center*\n // (as this used to) breaks down for exactly that shape (a small tile in a much wider\n // row): the dragged item's own center sits well short of the row's true center, by\n // roughly half the width difference — enough that a completely different droppable\n // (e.g. the choices pool) can end up \"closer\", so once the item is actually sitting on\n // a target, the next press re-matches the position as if it were still somewhere\n // else, and keeps recomputing the same move instead of advancing.\n const draggedCenter = collisionRect\n ? { x: collisionRect.left + collisionRect.width / 2, y: collisionRect.top + collisionRect.height / 2 }\n : currentCoordinates;\n\n let currentIndex = targets.findIndex(\n (t) => draggedCenter.x >= t.rect.left && draggedCenter.x <= t.rect.right && draggedCenter.y >= t.rect.top && draggedCenter.y <= t.rect.bottom,\n );\n\n // Fall back to nearest-by-dropPosition if the dragged item's center isn't strictly\n // inside any target (e.g. mid-flight after a free arrow-key move).\n if (currentIndex === -1) {\n let minDist = Infinity;\n\n for (let i = 0; i < targets.length; i++) {\n const dist = distance(currentCoordinates, targets[i].dropPosition);\n\n if (dist < minDist) {\n minDist = dist;\n currentIndex = i;\n }\n }\n }\n\n // Move to next/previous\n const nextIndex = reverse\n ? (currentIndex - 1 + targets.length) % targets.length\n : (currentIndex + 1) % targets.length;\n\n return targets[nextIndex].dropPosition;\n};\n\nconst distance = (a, b) => Math.sqrt((a.x - b.x) ** 2 + (a.y - b.y) ** 2);\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,MAAMC,UAAU,GAAG,EAAE;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,mCAAmC,GAAGA,CAACC,KAAK,EAAE;EAAEC,MAAM;EAAEC,OAAO;EAAEC;AAAmB,CAAC,KAAK;EACrG,MAAM;IAAEC;EAAK,CAAC,GAAGJ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b,OAAO,CAACa,MAAM,GACpD,CAACS,YAAY,GAAG,CAAC,IAAItB,OAAO,CAACa,MAAM;EAEvC,OAAOb,OAAO,CAACgC,SAAS,CAAC,CAACrB,YAAY;AACxC,CAAC;AAACsB,OAAA,CAAA3D,mCAAA,GAAAA,mCAAA;AAEF,MAAMyD,QAAQ,GAAGA,CAACd,CAAC,EAAEC,CAAC,KAAKC,IAAI,CAACe,IAAI,CAAC,CAACjB,CAAC,CAAC3B,CAAC,GAAG4B,CAAC,CAAC5B,CAAC,KAAK,CAAC,GAAG,CAAC2B,CAAC,CAAC5B,CAAC,GAAG6B,CAAC,CAAC7B,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "7.2.0",
7
+ "version": "7.2.1",
8
8
  "description": "",
9
9
  "scripts": {
10
10
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -18,10 +18,10 @@
18
18
  "@mui/icons-material": "^7.3.4",
19
19
  "@mui/material": "^7.3.4",
20
20
  "@pie-framework/pie-player-events": "^0.1.0",
21
- "@pie-lib/correct-answer-toggle": "4.0.6",
22
- "@pie-lib/drag": "4.1.1",
21
+ "@pie-lib/correct-answer-toggle": "4.0.7",
22
+ "@pie-lib/drag": "4.1.2",
23
23
  "@pie-lib/math-rendering": "5.1.0",
24
- "@pie-lib/render-ui": "7.0.0",
24
+ "@pie-lib/render-ui": "7.0.1",
25
25
  "debug": "^4.1.1",
26
26
  "lodash-es": "^4.17.23",
27
27
  "prop-types": "^15.8.1",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "author": "",
32
32
  "license": "ISC",
33
- "gitHead": "e299866c75466c3c3f12469e783c129c800f24fb",
33
+ "gitHead": "5635523a84dd61f007275dcb853627b1ff0c6792",
34
34
  "main": "lib/index.js",
35
35
  "module": "src/index.js"
36
36
  }