@pie-element/image-cloze-association 9.1.2-next.3 → 9.1.2-next.5

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,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [9.1.2-next.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/image-cloze-association@9.1.2-next.4...@pie-element/image-cloze-association@9.1.2-next.5) (2026-03-12)
7
+
8
+ ### Bug Fixes
9
+
10
+ - bump libs, update mathquill, switch interface PD-5791 ([686a7c0](https://github.com/pie-framework/pie-elements/commit/686a7c0d41ff82f5ddad7cecd93cc0c18324a81b))
11
+
12
+ ## [9.1.2-next.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/image-cloze-association@9.1.2-next.3...@pie-element/image-cloze-association@9.1.2-next.4) (2026-03-09)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **image-cloze:** clear touchmove issues PD-5416 ([3ebaf9b](https://github.com/pie-framework/pie-elements/commit/3ebaf9b44500240ce604e13a77a90d91266753dd))
17
+
6
18
  ## [9.1.2-next.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/image-cloze-association@9.1.2-next.2...@pie-element/image-cloze-association@9.1.2-next.3) (2026-03-06)
7
19
 
8
20
  **Note:** Version bump only for package @pie-element/image-cloze-association
@@ -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
+ ## [8.1.1-next.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/image-cloze-association-configure@8.1.1-next.3...@pie-element/image-cloze-association-configure@8.1.1-next.4) (2026-03-12)
7
+
8
+ ### Bug Fixes
9
+
10
+ - bump libs, update mathquill, switch interface PD-5791 ([686a7c0](https://github.com/pie-framework/pie-elements/commit/686a7c0d41ff82f5ddad7cecd93cc0c18324a81b))
11
+
6
12
  ## [8.1.1-next.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/image-cloze-association-configure@8.1.1-next.2...@pie-element/image-cloze-association-configure@8.1.1-next.3) (2026-03-06)
7
13
 
8
14
  **Note:** Version bump only for package @pie-element/image-cloze-association-configure
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/image-cloze-association-configure",
3
3
  "private": true,
4
- "version": "8.1.1-next.3",
4
+ "version": "8.1.1-next.4",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -12,8 +12,8 @@
12
12
  "@mui/icons-material": "^7.3.4",
13
13
  "@mui/material": "^7.3.4",
14
14
  "@pie-framework/pie-configure-events": "^1.3.0",
15
- "@pie-lib/config-ui": "12.2.0-next.13",
16
- "@pie-lib/editable-html-tip-tap": "1.2.0-next.13",
15
+ "@pie-lib/config-ui": "12.2.0-next.17",
16
+ "@pie-lib/editable-html-tip-tap": "1.2.0-next.16",
17
17
  "debug": "^4.1.1",
18
18
  "prop-types": "^15.8.1",
19
19
  "react": "18.3.1",
@@ -100,7 +100,9 @@ const PossibleResponse = ({
100
100
  passive: false
101
101
  });
102
102
  node.addEventListener('touchend', handleTouchEnd);
103
- node.addEventListener('touchmove', handleTouchMove);
103
+ node.addEventListener('touchmove', handleTouchMove, {
104
+ passive: false
105
+ });
104
106
  return () => {
105
107
  node.removeEventListener('touchstart', handleTouchStart);
106
108
  node.removeEventListener('touchend', handleTouchEnd);
@@ -1 +1 @@
1
- {"version":3,"file":"possible-response.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_classnames","_styles","_core","_renderUi","_evaluationIcon","_staticHtmlSpan","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BaseContainer","styled","position","backgroundColor","color","white","border","borderDark","display","alignItems","justifyContent","minHeight","width","pointerEvents","padding","margin","transparent","correct","incorrect","StyledSpan","StaticHTMLSpan","cursor","background","visibility","PossibleResponse","canDrag","containerStyle","data","onDragBegin","answerChoiceTransparency","isOverlay","rootRef","useRef","longPressTimer","setNodeRef","attributes","listeners","isDragging","useDraggable","id","value","containerIndex","disabled","handleTouchEnd","clearTimeout","current","handleTouchMove","handleTouchStart","preventDefault","setTimeout","useEffect","node","addEventListener","passive","removeEventListener","isCorrect","evaluationStyle","fontSize","bottom","right","correctnessClass","undefined","imgRegex","containsImage","test","containerClassNames","classNames","textAnswerChoiceStyle","promptClassNames","hiddenSpan","hidden","createElement","_extends2","className","style","ref","html","propTypes","PropTypes","bool","isRequired","object","func","defaultProps","_default","exports"],"sources":["../src/possible-response.jsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { styled } from '@mui/material/styles';\nimport { useDraggable } from '@dnd-kit/core';\nimport { color } from '@pie-lib/render-ui';\n\nimport EvaluationIcon from './evaluation-icon';\nimport StaticHTMLSpan from './static-html-span';\n\nconst BaseContainer = styled('div')(() => ({\n position: 'relative',\n backgroundColor: color.white(),\n border: `1px solid ${color.borderDark()}`,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: '28px',\n width: 'fit-content',\n '& span img': {\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 },\n '&.textAnswerChoiceStyle': {\n padding: '0 10px',\n margin: '4px 6px !important',\n },\n '&.answerChoiceTransparency': {\n border: 'none',\n backgroundColor: `${color.transparent()}`,\n '&:hover': {\n border: `1px solid ${color.borderDark()}`,\n },\n },\n '&.baseCorrect': {\n border: `2px solid ${color.correct()} !important`,\n },\n '&.baseIncorrect': {\n border: `2px solid ${color.incorrect()} !important`,\n },\n}));\n\nconst StyledSpan = styled(StaticHTMLSpan)(() => ({\n cursor: 'grab',\n backgroundColor: color.background(),\n '&.hiddenSpan': {\n visibility: 'hidden',\n },\n}));\n\nconst PossibleResponse = ({ canDrag, containerStyle, data, onDragBegin, answerChoiceTransparency, isOverlay }) => {\n const rootRef = useRef(null);\n const longPressTimer = useRef(null);\n\n const { setNodeRef, attributes, listeners, isDragging } = useDraggable({\n id: `possible-response-${data.id}`,\n data: {\n id: data.id,\n value: data.value,\n containerIndex: data.containerIndex,\n },\n disabled: !canDrag,\n });\n\n const handleTouchEnd = () => {\n clearTimeout(longPressTimer.current);\n };\n\n const handleTouchMove = () => {\n clearTimeout(longPressTimer.current);\n };\n\n const handleTouchStart = (e) => {\n e.preventDefault();\n longPressTimer.current = setTimeout(() => {\n if (canDrag && rootRef.current) {\n onDragBegin(data);\n }\n }, 500); // start drag after 500ms (touch and hold duration) for chromebooks and other touch devices\n };\n\n useEffect(() => {\n const node = rootRef.current;\n\n if (!node) return;\n\n node.addEventListener('touchstart', handleTouchStart, { passive: false });\n node.addEventListener('touchend', handleTouchEnd);\n node.addEventListener('touchmove', handleTouchMove);\n\n return () => {\n node.removeEventListener('touchstart', handleTouchStart);\n node.removeEventListener('touchend', handleTouchEnd);\n node.removeEventListener('touchmove', handleTouchMove);\n };\n }, [canDrag, data]);\n\n const { isCorrect } = data || {};\n const evaluationStyle = {\n fontSize: 14,\n position: 'absolute',\n bottom: '3px',\n right: '3px',\n };\n const correctnessClass = isCorrect === true ? 'baseCorrect' : isCorrect === false ? 'baseIncorrect' : undefined;\n\n const imgRegex = /<img[^>]+src=\"([^\">]+)\"/;\n const containsImage = imgRegex.test(data.value);\n\n const containerClassNames = classNames({\n answerChoiceTransparency: answerChoiceTransparency && !isDragging,\n [correctnessClass]: !!correctnessClass,\n textAnswerChoiceStyle: !containsImage && !isOverlay,\n });\n\n const promptClassNames = classNames({ hiddenSpan: data.hidden });\n\n return (\n <BaseContainer\n className={containerClassNames}\n style={containerStyle}\n ref={(ref) => {\n rootRef.current = ref;\n setNodeRef(ref);\n }}\n {...listeners}\n {...attributes}\n >\n <StyledSpan html={data.value} className={promptClassNames} />\n <EvaluationIcon isCorrect={data.isCorrect} containerStyle={evaluationStyle} />\n </BaseContainer>\n );\n};\n\nPossibleResponse.propTypes = {\n canDrag: PropTypes.bool.isRequired,\n containerStyle: PropTypes.object,\n data: PropTypes.object.isRequired,\n onDragBegin: PropTypes.func.isRequired,\n answerChoiceTransparency: PropTypes.bool,\n isOverlay: PropTypes.bool,\n};\n\nPossibleResponse.defaultProps = {\n containerStyle: {},\n answerChoiceTransparency: false,\n isOverlay: false,\n};\n\nexport default PossibleResponse;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAEA,IAAAO,eAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,eAAA,GAAAN,sBAAA,CAAAF,OAAA;AAAgD,SAAAD,wBAAAU,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAZ,uBAAA,YAAAA,CAAAU,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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ACb,CAAC;AAAC,IAAAsD,QAAA,GAAAC,OAAA,CAAA9F,OAAA,GAEaiC,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"possible-response.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_classnames","_styles","_core","_renderUi","_evaluationIcon","_staticHtmlSpan","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BaseContainer","styled","position","backgroundColor","color","white","border","borderDark","display","alignItems","justifyContent","minHeight","width","pointerEvents","padding","margin","transparent","correct","incorrect","StyledSpan","StaticHTMLSpan","cursor","background","visibility","PossibleResponse","canDrag","containerStyle","data","onDragBegin","answerChoiceTransparency","isOverlay","rootRef","useRef","longPressTimer","setNodeRef","attributes","listeners","isDragging","useDraggable","id","value","containerIndex","disabled","handleTouchEnd","clearTimeout","current","handleTouchMove","handleTouchStart","preventDefault","setTimeout","useEffect","node","addEventListener","passive","removeEventListener","isCorrect","evaluationStyle","fontSize","bottom","right","correctnessClass","undefined","imgRegex","containsImage","test","containerClassNames","classNames","textAnswerChoiceStyle","promptClassNames","hiddenSpan","hidden","createElement","_extends2","className","style","ref","html","propTypes","PropTypes","bool","isRequired","object","func","defaultProps","_default","exports"],"sources":["../src/possible-response.jsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { styled } from '@mui/material/styles';\nimport { useDraggable } from '@dnd-kit/core';\nimport { color } from '@pie-lib/render-ui';\n\nimport EvaluationIcon from './evaluation-icon';\nimport StaticHTMLSpan from './static-html-span';\n\nconst BaseContainer = styled('div')(() => ({\n position: 'relative',\n backgroundColor: color.white(),\n border: `1px solid ${color.borderDark()}`,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n minHeight: '28px',\n width: 'fit-content',\n '& span img': {\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 },\n '&.textAnswerChoiceStyle': {\n padding: '0 10px',\n margin: '4px 6px !important',\n },\n '&.answerChoiceTransparency': {\n border: 'none',\n backgroundColor: `${color.transparent()}`,\n '&:hover': {\n border: `1px solid ${color.borderDark()}`,\n },\n },\n '&.baseCorrect': {\n border: `2px solid ${color.correct()} !important`,\n },\n '&.baseIncorrect': {\n border: `2px solid ${color.incorrect()} !important`,\n },\n}));\n\nconst StyledSpan = styled(StaticHTMLSpan)(() => ({\n cursor: 'grab',\n backgroundColor: color.background(),\n '&.hiddenSpan': {\n visibility: 'hidden',\n },\n}));\n\nconst PossibleResponse = ({ canDrag, containerStyle, data, onDragBegin, answerChoiceTransparency, isOverlay }) => {\n const rootRef = useRef(null);\n const longPressTimer = useRef(null);\n\n const { setNodeRef, attributes, listeners, isDragging } = useDraggable({\n id: `possible-response-${data.id}`,\n data: {\n id: data.id,\n value: data.value,\n containerIndex: data.containerIndex,\n },\n disabled: !canDrag,\n });\n\n const handleTouchEnd = () => {\n clearTimeout(longPressTimer.current);\n };\n\n const handleTouchMove = () => {\n clearTimeout(longPressTimer.current);\n };\n\n const handleTouchStart = (e) => {\n e.preventDefault();\n longPressTimer.current = setTimeout(() => {\n if (canDrag && rootRef.current) {\n onDragBegin(data);\n }\n }, 500); // start drag after 500ms (touch and hold duration) for chromebooks and other touch devices\n };\n\n useEffect(() => {\n const node = rootRef.current;\n\n if (!node) return;\n\n node.addEventListener('touchstart', handleTouchStart, { passive: false });\n node.addEventListener('touchend', handleTouchEnd);\n node.addEventListener('touchmove', handleTouchMove, { passive: false });\n\n return () => {\n node.removeEventListener('touchstart', handleTouchStart);\n node.removeEventListener('touchend', handleTouchEnd);\n node.removeEventListener('touchmove', handleTouchMove);\n };\n }, [canDrag, data]);\n\n const { isCorrect } = data || {};\n const evaluationStyle = {\n fontSize: 14,\n position: 'absolute',\n bottom: '3px',\n right: '3px',\n };\n const correctnessClass = isCorrect === true ? 'baseCorrect' : isCorrect === false ? 'baseIncorrect' : undefined;\n\n const imgRegex = /<img[^>]+src=\"([^\">]+)\"/;\n const containsImage = imgRegex.test(data.value);\n\n const containerClassNames = classNames({\n answerChoiceTransparency: answerChoiceTransparency && !isDragging,\n [correctnessClass]: !!correctnessClass,\n textAnswerChoiceStyle: !containsImage && !isOverlay,\n });\n\n const promptClassNames = classNames({ hiddenSpan: data.hidden });\n\n return (\n <BaseContainer\n className={containerClassNames}\n style={containerStyle}\n ref={(ref) => {\n rootRef.current = ref;\n setNodeRef(ref);\n }}\n {...listeners}\n {...attributes}\n >\n <StyledSpan html={data.value} className={promptClassNames} />\n <EvaluationIcon isCorrect={data.isCorrect} containerStyle={evaluationStyle} />\n </BaseContainer>\n );\n};\n\nPossibleResponse.propTypes = {\n canDrag: PropTypes.bool.isRequired,\n containerStyle: PropTypes.object,\n data: PropTypes.object.isRequired,\n onDragBegin: PropTypes.func.isRequired,\n answerChoiceTransparency: PropTypes.bool,\n isOverlay: PropTypes.bool,\n};\n\nPossibleResponse.defaultProps = {\n containerStyle: {},\n answerChoiceTransparency: false,\n isOverlay: false,\n};\n\nexport default PossibleResponse;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAEA,IAAAO,eAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,eAAA,GAAAN,sBAAA,CAAAF,OAAA;AAAgD,SAAAD,wBAAAU,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAZ,uBAAA,YAAAA,CAAAU,CAAA,EAAAC,CAAA,SAAAA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3BpD,OAAO,EAAEqD,kBAAS,CAACC,IAAI,CAACC,UAAU;EAClCtD,cAAc,EAAEoD,kBAAS,CAACG,MAAM;EAChCtD,IAAI,EAAEmD,kBAAS,CAACG,MAAM,CAACD,UAAU;EACjCpD,WAAW,EAAEkD,kBAAS,CAACI,IAAI,CAACF,UAAU;EACtCnD,wBAAwB,EAAEiD,kBAAS,CAACC,IAAI;EACxCjD,SAAS,EAAEgD,kBAAS,CAACC;AACvB,CAAC;AAEDvD,gBAAgB,CAAC2D,YAAY,GAAG;EAC9BzD,cAAc,EAAE,CAAC,CAAC;EAClBG,wBAAwB,EAAE,KAAK;EAC/BC,SAAS,EAAE;AACb,CAAC;AAAC,IAAAsD,QAAA,GAAAC,OAAA,CAAA9F,OAAA,GAEaiC,gBAAgB","ignoreList":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/image-cloze-association",
3
3
  "repository": "pie-framework/pie-elements",
4
- "version": "9.1.2-next.3",
4
+ "version": "9.1.2-next.5",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "author": "pie framework developers",
28
28
  "license": "ISC",
29
- "gitHead": "15d380e035464a06537eea3aae5cd741f5319659",
29
+ "gitHead": "40a7ed35e8d7ede93ebb571fff94e0539294403f",
30
30
  "scripts": {
31
31
  "postpublish": "../../scripts/postpublish"
32
32
  },
@@ -88,7 +88,7 @@ const PossibleResponse = ({ canDrag, containerStyle, data, onDragBegin, answerCh
88
88
 
89
89
  node.addEventListener('touchstart', handleTouchStart, { passive: false });
90
90
  node.addEventListener('touchend', handleTouchEnd);
91
- node.addEventListener('touchmove', handleTouchMove);
91
+ node.addEventListener('touchmove', handleTouchMove, { passive: false });
92
92
 
93
93
  return () => {
94
94
  node.removeEventListener('touchstart', handleTouchStart);