@pie-element/placement-ordering 14.2.1 → 14.3.0

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,17 @@
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
+ # [14.3.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/placement-ordering@14.2.1...@pie-element/placement-ordering@14.3.0) (2026-08-21)
7
+
8
+ ### Bug Fixes
9
+
10
+ - move [@pie-lib](https://github.com/pie-lib) deps back to latest, off next prereleases PIE-927 ([a53e012](https://github.com/pie-framework/pie-elements/commit/a53e0127eb4ac95ece54e1e2bd669ae4974f4251))
11
+ - **theming:** move the grey palette reads onto --pie-\* tokens PIE-856 ([d7d005b](https://github.com/pie-framework/pie-elements/commit/d7d005bf081843335b4b0377852f2ecd075cb62d)), closes [#000000](https://github.com/pie-framework/pie-elements/issues/000000) [#E0E1E6](https://github.com/pie-framework/pie-elements/issues/E0E1E6) [#646464](https://github.com/pie-framework/pie-elements/issues/646464) [#616161](https://github.com/pie-framework/pie-elements/issues/616161) [#E0E1E6](https://github.com/pie-framework/pie-elements/issues/E0E1E6) [#C0C3](https://github.com/pie-framework/pie-elements/issues/C0C3)
12
+
13
+ ### Features
14
+
15
+ - bump libs PIE-856, PIE-681, PIE-927 ([cb26d7a](https://github.com/pie-framework/pie-elements/commit/cb26d7afa6c99522533c321d5ff8ce3148a66e9e))
16
+
6
17
  ## [14.2.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/placement-ordering@14.2.0...@pie-element/placement-ordering@14.2.1) (2026-08-19)
7
18
 
8
19
  ### Bug Fixes
@@ -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
+ # [11.2.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/placement-ordering-configure@11.1.11...@pie-element/placement-ordering-configure@11.2.0) (2026-08-21)
7
+
8
+ ### Features
9
+
10
+ - bump libs PIE-856, PIE-681, PIE-927 ([cb26d7a](https://github.com/pie-framework/pie-elements/commit/cb26d7afa6c99522533c321d5ff8ce3148a66e9e))
11
+
6
12
  ## [11.1.11](https://github.com/pie-framework/pie-elements/compare/@pie-element/placement-ordering-configure@11.1.10...@pie-element/placement-ordering-configure@11.1.11) (2026-08-19)
7
13
 
8
14
  ### Bug Fixes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/placement-ordering-configure",
3
- "version": "11.1.11",
3
+ "version": "11.2.0",
4
4
  "private": true,
5
5
  "main": "lib/index.js",
6
6
  "module": "src/index.js",
@@ -11,10 +11,10 @@
11
11
  "@mui/icons-material": "^7.3.4",
12
12
  "@mui/material": "^7.3.4",
13
13
  "@pie-framework/pie-configure-events": "^1.3.0",
14
- "@pie-lib/config-ui": "13.0.15",
15
- "@pie-lib/drag": "4.1.0",
16
- "@pie-lib/editable-html-tip-tap": "2.1.13",
17
- "@pie-lib/render-ui": "6.1.3",
14
+ "@pie-lib/config-ui": "13.0.16",
15
+ "@pie-lib/drag": "4.1.1",
16
+ "@pie-lib/editable-html-tip-tap": "2.1.14",
17
+ "@pie-lib/render-ui": "7.0.0",
18
18
  "debug": "^4.1.1",
19
19
  "lodash-es": "^4.17.23",
20
20
  "nested-property": "^0.0.7",
package/lib/tile.js CHANGED
@@ -54,7 +54,7 @@ const StyledTileContent = (0, _styles.styled)('div')(({
54
54
  padding: '10px',
55
55
  boxSizing: 'border-box',
56
56
  overflow: 'hidden',
57
- border: type === 'choice' || type === 'target' ? `1px solid ${theme.palette.grey[400]}` : '1px solid transparent',
57
+ border: type === 'choice' || type === 'target' ? `1px solid ${_renderUi.color.border()}` : '1px solid transparent',
58
58
  backgroundColor: type === 'choice' || type === 'target' ? _renderUi.color.background() : 'transparent',
59
59
  transition: type === 'choice' || type === 'target' ? 'background-color 150ms ease, border-color 150ms ease, opacity 150ms ease' : 'none',
60
60
  pointerEvents: 'none',
@@ -62,7 +62,9 @@ const StyledTileContent = (0, _styles.styled)('div')(({
62
62
  ...((type === 'choice' || type === 'target') && {
63
63
  '&:hover': {
64
64
  backgroundColor: disabled ? _renderUi.color.background() : _renderUi.color.secondary(),
65
- borderColor: disabled ? theme.palette.grey[400] : theme.palette.primary.main,
65
+ // The disabled branch says "disabled", so it takes the disabled token rather
66
+ // than the neutral stroke the resting state uses.
67
+ borderColor: disabled ? _renderUi.color.disabled() : theme.palette.primary.main,
66
68
  transform: disabled ? 'none' : 'scale(1.02)'
67
69
  }
68
70
  }),
package/lib/tile.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tile.js","names":["_react","_interopRequireDefault","require","_propTypes","_debug","_core","_styles","_drag","_renderUi","log","debug","StyledNumberContainer","styled","theme","width","fontSize","typography","textAlign","color","palette","common","black","Holder","type","index","isOver","disabled","default","createElement","PlaceHolder","undefined","propTypes","PropTypes","string","number","bool","StyledTileContent","isDragging","isSelected","outcome","label","cursor","height","padding","boxSizing","overflow","border","grey","backgroundColor","background","transition","pointerEvents","userSelect","secondary","borderColor","primary","main","transform","opacity","primaryLight","borderStyle","secondaryLight","boxShadow","incorrect","correct","TileContent","props","empty","guideIndex","dangerouslySetInnerHTML","__html","Tile","id","instanceId","draggable","tileIndex","selectedChoice","onChoiceClick","onPlacementClick","dragId","dropId","tileData","value","attributes","listeners","setNodeRef","setDragRef","useDraggable","data","setDropRef","dropIsOver","useDroppable","isHovered","setIsHovered","React","useState","hasSelection","showsHoverEffect","handleClick","isNativeTabStop","handleKeyDown","e","code","preventDefault","ref","useRef","useEffect","currentRef","current","handleTouchStart","addEventListener","passive","removeEventListener","setRefs","element","style","x","y","margin","zIndex","willChange","_extends2","role","tabIndex","onKeyDown","onClick","onMouseEnter","onMouseLeave","exports","any","object","func","_default"],"sources":["../src/tile.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport { useDraggable, useDroppable } from '@dnd-kit/core';\nimport { styled } from '@mui/material/styles';\n\nimport { PlaceHolder } from '@pie-lib/drag';\nimport { color } from '@pie-lib/render-ui';\n\nconst log = debug('pie-elements:placement-ordering:tile');\n\nconst StyledNumberContainer = styled('div')(({ theme }) => ({\n width: '100%',\n fontSize: theme.typography.fontSize + 4,\n textAlign: 'center',\n color: `rgba(${theme.palette.common.black}, 0.6)`,\n}));\n\nconst Holder = ({ type, index, isOver, disabled }) => (\n <PlaceHolder type={type} isOver={isOver} disabled={disabled}>\n {type === 'target' && index !== undefined && <StyledNumberContainer>{index}</StyledNumberContainer>}\n </PlaceHolder>\n);\n\nHolder.propTypes = {\n type: PropTypes.string,\n index: PropTypes.number,\n isOver: PropTypes.bool,\n disabled: PropTypes.bool,\n};\n\nconst StyledTileContent = styled('div')(\n ({ theme, isDragging, isSelected, isOver, disabled, outcome, label, type }) => ({\n cursor: disabled ? 'not-allowed' : 'grab',\n width: '100%',\n height: '100%',\n padding: '10px',\n boxSizing: 'border-box',\n overflow: 'hidden',\n border: type === 'choice' || type === 'target' ? `1px solid ${theme.palette.grey[400]}` : '1px solid transparent',\n backgroundColor: type === 'choice' || type === 'target' ? color.background() : 'transparent',\n transition:\n type === 'choice' || type === 'target'\n ? 'background-color 150ms ease, border-color 150ms ease, opacity 150ms ease'\n : 'none',\n pointerEvents: 'none',\n userSelect: 'none',\n\n ...((type === 'choice' || type === 'target') && {\n '&:hover': {\n backgroundColor: disabled ? color.background() : color.secondary(),\n borderColor: disabled ? theme.palette.grey[400] : theme.palette.primary.main,\n transform: disabled ? 'none' : 'scale(1.02)',\n },\n }),\n\n // Apply conditional styles based on props (only if not empty spacing tile)\n ...((type === 'choice' || type === 'target') &&\n isOver &&\n !disabled && {\n opacity: 0.4,\n backgroundColor: color.primaryLight(),\n borderColor: theme.palette.primary.main,\n borderStyle: 'dashed',\n transform: 'scale(1.05)',\n }),\n\n ...((type === 'choice' || type === 'target') &&\n (isDragging || isSelected) &&\n !disabled && {\n opacity: 0.6,\n backgroundColor: color.secondaryLight(),\n transform: 'scale(1.05) rotate(2deg)',\n boxShadow: '0 8px 16px rgba(0,0,0,0.2)',\n cursor: 'grabbing',\n }),\n\n ...((type === 'choice' || type === 'target') &&\n disabled && {\n cursor: 'not-allowed',\n '&:hover': {\n backgroundColor: color.background(),\n transform: 'none',\n },\n }),\n\n ...((type === 'choice' || type === 'target') &&\n outcome === 'incorrect' && {\n border: `1px solid ${color.incorrect()}`,\n }),\n\n ...((type === 'choice' || type === 'target') &&\n outcome === 'correct' && {\n border: `1px solid ${color.correct()}`,\n }),\n\n ...(!label && {\n border: 'none',\n '&:hover': {\n backgroundColor: 'unset',\n },\n }),\n }),\n);\n\nconst TileContent = (props) => {\n const { type, isDragging, isSelected, empty, isOver, label, disabled, outcome, guideIndex } = props;\n\n if (empty) {\n return <Holder type={type} index={guideIndex} isOver={isOver} disabled={disabled} />;\n } else {\n return (\n <StyledTileContent\n type={type}\n isDragging={isDragging}\n isSelected={isSelected}\n isOver={isOver}\n disabled={disabled}\n outcome={outcome}\n label={label}\n dangerouslySetInnerHTML={{ __html: label }}\n />\n );\n }\n};\n\nexport const Tile = (props) => {\n const {\n label,\n type,\n id,\n empty,\n disabled,\n outcome,\n index,\n guideIndex,\n instanceId,\n draggable,\n tileIndex,\n selectedChoice,\n onChoiceClick,\n onPlacementClick,\n } = props;\n\n // Use type + tileIndex in the IDs to guarantee uniqueness in all modes.\n // In includeTargets mode, a choice (id:'c1', type:'choice') and a target (id:'c1', type:'target')\n // can coexist — the type differentiates them.\n // tileIndex (array position from tiler) ensures empty placeholders are also unique.\n const dragId = `tile-${type}-${id != null ? id : 'empty'}-${tileIndex}-${instanceId}`;\n const dropId = `drop-${type}-${id != null ? id : 'empty'}-${tileIndex}-${instanceId}`;\n\n // Built once and reused for dnd-kit's own drag/drop data and for the click handlers\n // below, so a click carries exactly the same shape a real drag would.\n const tileData = { id, type, instanceId, value: label, index };\n\n const {\n attributes,\n listeners,\n setNodeRef: setDragRef,\n transform,\n isDragging,\n } = useDraggable({\n id: dragId,\n data: tileData,\n disabled: !draggable || disabled,\n });\n\n const { setNodeRef: setDropRef, isOver: dropIsOver } = useDroppable({\n id: dropId,\n data: tileData,\n // Disable droppable on the tile currently being dragged so closestCenter\n // cannot pick it as the drop target (prevents self-collision and wrong matches).\n disabled: isDragging,\n });\n\n const isSelected =\n !!selectedChoice &&\n selectedChoice.type === tileData.type &&\n selectedChoice.id === tileData.id &&\n selectedChoice.index === tileData.index;\n\n // dnd-kit's own isOver (dropIsOver) only reflects real collision detection during an\n // active drag, so it stays false while a placement area is merely a candidate for a\n // pending click-based placement. Track hovering locally and fold it into the same\n // isOver signal the styling below already uses, so hovering a response area while\n // something is selected gets the exact same treatment as hovering it during a real\n // drag — one code path, no duplicated CSS.\n const [isHovered, setIsHovered] = React.useState(false);\n const hasSelection = !!selectedChoice && !disabled;\n const showsHoverEffect = dropIsOver || (type === 'target' && hasSelection && isHovered);\n\n // Click-to-select/click-to-place (both choices and targets are handled by this same\n // component, differentiated by `type`):\n // - Choice tile: selects/switches/deselects it, UNLESS a placed answer (a \"target\")\n // is currently selected, in which case clicking any choice-row tile returns it to\n // the choices column/row (choice -> choice has no placement meaning in the\n // reducer, so there's no ambiguity there).\n // - Target tile: clicking the already-selected placed answer again deselects it;\n // clicking it while something else is selected places that selection here\n // (empty or occupied); clicking a filled target with nothing selected selects\n // that placed answer for moving, the same way Tab+Space/Enter does. An empty\n // target with nothing selected is a no-op.\n const handleClick = () => {\n if (disabled) return;\n\n if (type === 'choice') {\n if (selectedChoice?.type === 'target') {\n onPlacementClick?.(tileData);\n } else if (draggable) {\n onChoiceClick?.(tileData);\n }\n } else if (type === 'target') {\n if (isSelected) {\n onChoiceClick?.(tileData);\n } else if (selectedChoice) {\n onPlacementClick?.(tileData);\n } else if (draggable) {\n onChoiceClick?.(tileData);\n }\n }\n };\n\n // dnd-kit's own draggable attributes (spread below) already make a draggable tile a\n // native Tab stop with its own Space/Enter activation. An empty tile is never\n // draggable, so without this it wouldn't be reachable by Tab at all — needed for\n // \"select a choice, then Tab to a placement area and press Space/Enter\" to work.\n // Gated to non-draggable tiles specifically so it never overrides dnd-kit's own\n // keydown handling (see the conditional spread order below).\n const isNativeTabStop = !(draggable && !disabled) && !disabled;\n\n const handleKeyDown = (e) => {\n if (e.code === 'Space' || e.code === 'Enter') {\n e.preventDefault();\n handleClick();\n }\n };\n\n const ref = React.useRef(null);\n\n React.useEffect(() => {\n const currentRef = ref.current;\n\n const handleTouchStart = (e) => {\n e.preventDefault(); // Prevent the default touch event behavior\n };\n\n if (currentRef) {\n currentRef.addEventListener('touchstart', handleTouchStart, { passive: false });\n }\n\n return () => {\n if (currentRef) {\n currentRef.removeEventListener('touchstart', handleTouchStart);\n }\n };\n }, []);\n\n const setRefs = (element) => {\n ref.current = element;\n setDragRef(element);\n setDropRef(element);\n };\n\n log('[render], props: ', props);\n\n const style = {\n transform: transform ? `translate3d(${transform.x}px, ${transform.y}px, 0)` : undefined,\n boxSizing: 'border-box',\n overflow: 'visible',\n padding: 0,\n margin: 0,\n textAlign: 'center',\n pointerEvents: 'auto',\n cursor: disabled ? 'not-allowed' : type === 'target' && hasSelection ? 'pointer' : isDragging ? 'grabbing' : 'grab',\n zIndex: isDragging ? 1000 : 'auto',\n willChange: isDragging ? 'transform' : 'auto',\n };\n\n return (\n <div\n ref={setRefs}\n style={style}\n role={isNativeTabStop ? 'button' : undefined}\n tabIndex={isNativeTabStop ? 0 : undefined}\n onKeyDown={isNativeTabStop ? handleKeyDown : undefined}\n onClick={handleClick}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n {...(draggable && !disabled ? { ...listeners, ...attributes } : {})}\n >\n <TileContent\n label={label}\n id={id}\n empty={empty}\n index={index}\n guideIndex={guideIndex}\n isOver={showsHoverEffect}\n isDragging={isDragging}\n isSelected={isSelected}\n disabled={disabled}\n outcome={outcome}\n type={type}\n />\n </div>\n );\n};\n\nTile.propTypes = {\n id: PropTypes.any,\n label: PropTypes.string,\n isOver: PropTypes.bool,\n type: PropTypes.string,\n empty: PropTypes.bool,\n disabled: PropTypes.bool,\n outcome: PropTypes.string,\n index: PropTypes.number,\n guideIndex: PropTypes.number,\n instanceId: PropTypes.any,\n draggable: PropTypes.bool,\n tileIndex: PropTypes.number,\n selectedChoice: PropTypes.object,\n onChoiceClick: PropTypes.func,\n onPlacementClick: PropTypes.func,\n};\n\nexport default Tile;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAEA,MAAMO,GAAG,GAAG,IAAAC,cAAK,EAAC,sCAAsC,CAAC;AAEzD,MAAMC,qBAAqB,GAAG,IAAAC,cAAM,EAAC,KAAK,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EAC1DC,KAAK,EAAE,MAAM;EACbC,QAAQ,EAAEF,KAAK,CAACG,UAAU,CAACD,QAAQ,GAAG,CAAC;EACvCE,SAAS,EAAE,QAAQ;EACnBC,KAAK,EAAE,QAAQL,KAAK,CAACM,OAAO,CAACC,MAAM,CAACC,KAAK;AAC3C,CAAC,CAAC,CAAC;AAEH,MAAMC,MAAM,GAAGA,CAAC;EAAEC,IAAI;EAAEC,KAAK;EAAEC,MAAM;EAAEC;AAAS,CAAC,kBAC/C1B,MAAA,CAAA2B,OAAA,CAAAC,aAAA,CAACrB,KAAA,CAAAsB,WAAW;EAACN,IAAI,EAAEA,IAAK;EAACE,MAAM,EAAEA,MAAO;EAACC,QAAQ,EAAEA;AAAS,GACzDH,IAAI,KAAK,QAAQ,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AAS,CAACC,MAAM;EACzBT,KAAK,EAAEQ,kBAAS,CAACE,MAAM;EACvBkC,UAAU,EAAEpC,kBAAS,CAACE,MAAM;EAC5BuC,UAAU,EAAEzC,kBAAS,CAACiG,GAAG;EACzBvD,SAAS,EAAE1C,kBAAS,CAACG,IAAI;EACzBwC,SAAS,EAAE3C,kBAAS,CAACE,MAAM;EAC3B0C,cAAc,EAAE5C,kBAAS,CAACkG,MAAM;EAChCrD,aAAa,EAAE7C,kBAAS,CAACmG,IAAI;EAC7BrD,gBAAgB,EAAE9C,kBAAS,CAACmG;AAC9B,CAAC;AAAC,IAAAC,QAAA,GAAAJ,OAAA,CAAArG,OAAA,GAEa4C,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"tile.js","names":["_react","_interopRequireDefault","require","_propTypes","_debug","_core","_styles","_drag","_renderUi","log","debug","StyledNumberContainer","styled","theme","width","fontSize","typography","textAlign","color","palette","common","black","Holder","type","index","isOver","disabled","default","createElement","PlaceHolder","undefined","propTypes","PropTypes","string","number","bool","StyledTileContent","isDragging","isSelected","outcome","label","cursor","height","padding","boxSizing","overflow","border","backgroundColor","background","transition","pointerEvents","userSelect","secondary","borderColor","primary","main","transform","opacity","primaryLight","borderStyle","secondaryLight","boxShadow","incorrect","correct","TileContent","props","empty","guideIndex","dangerouslySetInnerHTML","__html","Tile","id","instanceId","draggable","tileIndex","selectedChoice","onChoiceClick","onPlacementClick","dragId","dropId","tileData","value","attributes","listeners","setNodeRef","setDragRef","useDraggable","data","setDropRef","dropIsOver","useDroppable","isHovered","setIsHovered","React","useState","hasSelection","showsHoverEffect","handleClick","isNativeTabStop","handleKeyDown","e","code","preventDefault","ref","useRef","useEffect","currentRef","current","handleTouchStart","addEventListener","passive","removeEventListener","setRefs","element","style","x","y","margin","zIndex","willChange","_extends2","role","tabIndex","onKeyDown","onClick","onMouseEnter","onMouseLeave","exports","any","object","func","_default"],"sources":["../src/tile.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport debug from 'debug';\nimport { useDraggable, useDroppable } from '@dnd-kit/core';\nimport { styled } from '@mui/material/styles';\n\nimport { PlaceHolder } from '@pie-lib/drag';\nimport { color } from '@pie-lib/render-ui';\n\nconst log = debug('pie-elements:placement-ordering:tile');\n\nconst StyledNumberContainer = styled('div')(({ theme }) => ({\n width: '100%',\n fontSize: theme.typography.fontSize + 4,\n textAlign: 'center',\n color: `rgba(${theme.palette.common.black}, 0.6)`,\n}));\n\nconst Holder = ({ type, index, isOver, disabled }) => (\n <PlaceHolder type={type} isOver={isOver} disabled={disabled}>\n {type === 'target' && index !== undefined && <StyledNumberContainer>{index}</StyledNumberContainer>}\n </PlaceHolder>\n);\n\nHolder.propTypes = {\n type: PropTypes.string,\n index: PropTypes.number,\n isOver: PropTypes.bool,\n disabled: PropTypes.bool,\n};\n\nconst StyledTileContent = styled('div')(\n ({ theme, isDragging, isSelected, isOver, disabled, outcome, label, type }) => ({\n cursor: disabled ? 'not-allowed' : 'grab',\n width: '100%',\n height: '100%',\n padding: '10px',\n boxSizing: 'border-box',\n overflow: 'hidden',\n border: type === 'choice' || type === 'target' ? `1px solid ${color.border()}` : '1px solid transparent',\n backgroundColor: type === 'choice' || type === 'target' ? color.background() : 'transparent',\n transition:\n type === 'choice' || type === 'target'\n ? 'background-color 150ms ease, border-color 150ms ease, opacity 150ms ease'\n : 'none',\n pointerEvents: 'none',\n userSelect: 'none',\n\n ...((type === 'choice' || type === 'target') && {\n '&:hover': {\n backgroundColor: disabled ? color.background() : color.secondary(),\n // The disabled branch says \"disabled\", so it takes the disabled token rather\n // than the neutral stroke the resting state uses.\n borderColor: disabled ? color.disabled() : theme.palette.primary.main,\n transform: disabled ? 'none' : 'scale(1.02)',\n },\n }),\n\n // Apply conditional styles based on props (only if not empty spacing tile)\n ...((type === 'choice' || type === 'target') &&\n isOver &&\n !disabled && {\n opacity: 0.4,\n backgroundColor: color.primaryLight(),\n borderColor: theme.palette.primary.main,\n borderStyle: 'dashed',\n transform: 'scale(1.05)',\n }),\n\n ...((type === 'choice' || type === 'target') &&\n (isDragging || isSelected) &&\n !disabled && {\n opacity: 0.6,\n backgroundColor: color.secondaryLight(),\n transform: 'scale(1.05) rotate(2deg)',\n boxShadow: '0 8px 16px rgba(0,0,0,0.2)',\n cursor: 'grabbing',\n }),\n\n ...((type === 'choice' || type === 'target') &&\n disabled && {\n cursor: 'not-allowed',\n '&:hover': {\n backgroundColor: color.background(),\n transform: 'none',\n },\n }),\n\n ...((type === 'choice' || type === 'target') &&\n outcome === 'incorrect' && {\n border: `1px solid ${color.incorrect()}`,\n }),\n\n ...((type === 'choice' || type === 'target') &&\n outcome === 'correct' && {\n border: `1px solid ${color.correct()}`,\n }),\n\n ...(!label && {\n border: 'none',\n '&:hover': {\n backgroundColor: 'unset',\n },\n }),\n }),\n);\n\nconst TileContent = (props) => {\n const { type, isDragging, isSelected, empty, isOver, label, disabled, outcome, guideIndex } = props;\n\n if (empty) {\n return <Holder type={type} index={guideIndex} isOver={isOver} disabled={disabled} />;\n } else {\n return (\n <StyledTileContent\n type={type}\n isDragging={isDragging}\n isSelected={isSelected}\n isOver={isOver}\n disabled={disabled}\n outcome={outcome}\n label={label}\n dangerouslySetInnerHTML={{ __html: label }}\n />\n );\n }\n};\n\nexport const Tile = (props) => {\n const {\n label,\n type,\n id,\n empty,\n disabled,\n outcome,\n index,\n guideIndex,\n instanceId,\n draggable,\n tileIndex,\n selectedChoice,\n onChoiceClick,\n onPlacementClick,\n } = props;\n\n // Use type + tileIndex in the IDs to guarantee uniqueness in all modes.\n // In includeTargets mode, a choice (id:'c1', type:'choice') and a target (id:'c1', type:'target')\n // can coexist — the type differentiates them.\n // tileIndex (array position from tiler) ensures empty placeholders are also unique.\n const dragId = `tile-${type}-${id != null ? id : 'empty'}-${tileIndex}-${instanceId}`;\n const dropId = `drop-${type}-${id != null ? id : 'empty'}-${tileIndex}-${instanceId}`;\n\n // Built once and reused for dnd-kit's own drag/drop data and for the click handlers\n // below, so a click carries exactly the same shape a real drag would.\n const tileData = { id, type, instanceId, value: label, index };\n\n const {\n attributes,\n listeners,\n setNodeRef: setDragRef,\n transform,\n isDragging,\n } = useDraggable({\n id: dragId,\n data: tileData,\n disabled: !draggable || disabled,\n });\n\n const { setNodeRef: setDropRef, isOver: dropIsOver } = useDroppable({\n id: dropId,\n data: tileData,\n // Disable droppable on the tile currently being dragged so closestCenter\n // cannot pick it as the drop target (prevents self-collision and wrong matches).\n disabled: isDragging,\n });\n\n const isSelected =\n !!selectedChoice &&\n selectedChoice.type === tileData.type &&\n selectedChoice.id === tileData.id &&\n selectedChoice.index === tileData.index;\n\n // dnd-kit's own isOver (dropIsOver) only reflects real collision detection during an\n // active drag, so it stays false while a placement area is merely a candidate for a\n // pending click-based placement. Track hovering locally and fold it into the same\n // isOver signal the styling below already uses, so hovering a response area while\n // something is selected gets the exact same treatment as hovering it during a real\n // drag — one code path, no duplicated CSS.\n const [isHovered, setIsHovered] = React.useState(false);\n const hasSelection = !!selectedChoice && !disabled;\n const showsHoverEffect = dropIsOver || (type === 'target' && hasSelection && isHovered);\n\n // Click-to-select/click-to-place (both choices and targets are handled by this same\n // component, differentiated by `type`):\n // - Choice tile: selects/switches/deselects it, UNLESS a placed answer (a \"target\")\n // is currently selected, in which case clicking any choice-row tile returns it to\n // the choices column/row (choice -> choice has no placement meaning in the\n // reducer, so there's no ambiguity there).\n // - Target tile: clicking the already-selected placed answer again deselects it;\n // clicking it while something else is selected places that selection here\n // (empty or occupied); clicking a filled target with nothing selected selects\n // that placed answer for moving, the same way Tab+Space/Enter does. An empty\n // target with nothing selected is a no-op.\n const handleClick = () => {\n if (disabled) return;\n\n if (type === 'choice') {\n if (selectedChoice?.type === 'target') {\n onPlacementClick?.(tileData);\n } else if (draggable) {\n onChoiceClick?.(tileData);\n }\n } else if (type === 'target') {\n if (isSelected) {\n onChoiceClick?.(tileData);\n } else if (selectedChoice) {\n onPlacementClick?.(tileData);\n } else if (draggable) {\n onChoiceClick?.(tileData);\n }\n }\n };\n\n // dnd-kit's own draggable attributes (spread below) already make a draggable tile a\n // native Tab stop with its own Space/Enter activation. An empty tile is never\n // draggable, so without this it wouldn't be reachable by Tab at all — needed for\n // \"select a choice, then Tab to a placement area and press Space/Enter\" to work.\n // Gated to non-draggable tiles specifically so it never overrides dnd-kit's own\n // keydown handling (see the conditional spread order below).\n const isNativeTabStop = !(draggable && !disabled) && !disabled;\n\n const handleKeyDown = (e) => {\n if (e.code === 'Space' || e.code === 'Enter') {\n e.preventDefault();\n handleClick();\n }\n };\n\n const ref = React.useRef(null);\n\n React.useEffect(() => {\n const currentRef = ref.current;\n\n const handleTouchStart = (e) => {\n e.preventDefault(); // Prevent the default touch event behavior\n };\n\n if (currentRef) {\n currentRef.addEventListener('touchstart', handleTouchStart, { passive: false });\n }\n\n return () => {\n if (currentRef) {\n currentRef.removeEventListener('touchstart', handleTouchStart);\n }\n };\n }, []);\n\n const setRefs = (element) => {\n ref.current = element;\n setDragRef(element);\n setDropRef(element);\n };\n\n log('[render], props: ', props);\n\n const style = {\n transform: transform ? `translate3d(${transform.x}px, ${transform.y}px, 0)` : undefined,\n boxSizing: 'border-box',\n overflow: 'visible',\n padding: 0,\n margin: 0,\n textAlign: 'center',\n pointerEvents: 'auto',\n cursor: disabled ? 'not-allowed' : type === 'target' && hasSelection ? 'pointer' : isDragging ? 'grabbing' : 'grab',\n zIndex: isDragging ? 1000 : 'auto',\n willChange: isDragging ? 'transform' : 'auto',\n };\n\n return (\n <div\n ref={setRefs}\n style={style}\n role={isNativeTabStop ? 'button' : undefined}\n tabIndex={isNativeTabStop ? 0 : undefined}\n onKeyDown={isNativeTabStop ? handleKeyDown : undefined}\n onClick={handleClick}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n {...(draggable && !disabled ? { ...listeners, ...attributes } : {})}\n >\n <TileContent\n label={label}\n id={id}\n empty={empty}\n index={index}\n guideIndex={guideIndex}\n isOver={showsHoverEffect}\n isDragging={isDragging}\n isSelected={isSelected}\n disabled={disabled}\n outcome={outcome}\n type={type}\n />\n </div>\n );\n};\n\nTile.propTypes = {\n id: PropTypes.any,\n label: PropTypes.string,\n isOver: PropTypes.bool,\n type: PropTypes.string,\n empty: PropTypes.bool,\n disabled: PropTypes.bool,\n outcome: PropTypes.string,\n index: PropTypes.number,\n guideIndex: PropTypes.number,\n instanceId: PropTypes.any,\n draggable: PropTypes.bool,\n tileIndex: PropTypes.number,\n selectedChoice: PropTypes.object,\n onChoiceClick: PropTypes.func,\n onPlacementClick: PropTypes.func,\n};\n\nexport default Tile;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAEA,MAAMO,GAAG,GAAG,IAAAC,cAAK,EAAC,sCAAsC,CAAC;AAEzD,MAAMC,qBAAqB,GAAG,IAAAC,cAAM,EAAC,KAAK,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EAC1DC,KAAK,EAAE,MAAM;EACbC,QAAQ,EAAEF,KAAK,CAACG,UAAU,CAACD,QAAQ,GAAG,CAAC;EACvCE,SAAS,EAAE,QAAQ;EACnBC,KAAK,EAAE,QAAQL,KAAK,CAACM,OAAO,CAACC,MAAM,CAACC,KAAK;AAC3C,CAAC,CAAC,CAAC;AAEH,MAAMC,MAAM,GAAGA,CAAC;EAAEC,IAAI;EAAEC,KAAK;EAAEC,MAAM;EAAEC;AAAS,CAAC,kBAC/C1B,MAAA,CAAA2B,OAAA,CAAAC,aAAA,CAACrB,KAAA,CAAAsB,WAAW;EAACN,IAAI,EAAEA,IAAK;EAACE,MAAM,EAAEA,MAAO;EAAC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BI,OAAO,EAAEP,kBAAS,CAACC,MAAM;EACzBT,KAAK,EAAEQ,kBAAS,CAACE,MAAM;EACvBiC,UAAU,EAAEnC,kBAAS,CAACE,MAAM;EAC5BsC,UAAU,EAAExC,kBAAS,CAACgG,GAAG;EACzBvD,SAAS,EAAEzC,kBAAS,CAACG,IAAI;EACzBuC,SAAS,EAAE1C,kBAAS,CAACE,MAAM;EAC3ByC,cAAc,EAAE3C,kBAAS,CAACiG,MAAM;EAChCrD,aAAa,EAAE5C,kBAAS,CAACkG,IAAI;EAC7BrD,gBAAgB,EAAE7C,kBAAS,CAACkG;AAC9B,CAAC;AAAC,IAAAC,QAAA,GAAAJ,OAAA,CAAApG,OAAA,GAEa2C,IAAI","ignoreList":[]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/placement-ordering",
3
3
  "repository": "pie-framework/pie-elements",
4
- "version": "14.2.1",
4
+ "version": "14.3.0",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -14,10 +14,10 @@
14
14
  "@mui/icons-material": "^7.3.4",
15
15
  "@mui/material": "^7.3.4",
16
16
  "@pie-framework/pie-player-events": "^0.1.0",
17
- "@pie-lib/correct-answer-toggle": "4.0.5",
18
- "@pie-lib/drag": "4.1.0",
17
+ "@pie-lib/correct-answer-toggle": "4.0.6",
18
+ "@pie-lib/drag": "4.1.1",
19
19
  "@pie-lib/math-rendering": "5.1.0",
20
- "@pie-lib/render-ui": "6.1.3",
20
+ "@pie-lib/render-ui": "7.0.0",
21
21
  "@pie-lib/translator": "4.0.2",
22
22
  "debug": "^4.1.1",
23
23
  "decimal.js": "^10.0.0",
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "author": "",
31
31
  "license": "ISC",
32
- "gitHead": "0f939adae5927fe0a54d21a4a98e224775562406",
32
+ "gitHead": "e299866c75466c3c3f12469e783c129c800f24fb",
33
33
  "scripts": {
34
34
  "postpublish": "../../scripts/postpublish"
35
35
  },