@pie-lib/drag 3.2.0-next.6 → 3.2.0-next.7
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
|
+
# [3.2.0-next.7](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@3.2.0-next.6...@pie-lib/drag@3.2.0-next.7) (2026-03-25)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **drag:** set margin for draggable choice with p tag PD-5669 ([c430a21](https://github.com/pie-framework/pie-lib/commit/c430a21788138edfa522b42230120133943bcb1f))
|
|
11
|
+
|
|
6
12
|
# [3.2.0-next.6](https://github.com/pie-framework/pie-lib/compare/@pie-lib/drag@3.2.0-next.5...@pie-lib/drag@3.2.0-next.6) (2026-03-18)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @pie-lib/drag
|
package/lib/draggable-choice.js
CHANGED
|
@@ -24,6 +24,12 @@ var StyledChoice = (0, _styles.styled)('div')(function (_ref) {
|
|
|
24
24
|
minWidth: theme.spacing(20),
|
|
25
25
|
maxWidth: theme.spacing(75),
|
|
26
26
|
cursor: 'grab',
|
|
27
|
+
'& p': {
|
|
28
|
+
margin: 0
|
|
29
|
+
},
|
|
30
|
+
'& p *': {
|
|
31
|
+
margin: 0
|
|
32
|
+
},
|
|
27
33
|
'&:active': {
|
|
28
34
|
cursor: 'grabbing'
|
|
29
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draggable-choice.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_core","_colors","DRAG_TYPE","exports","StyledChoice","styled","_ref","theme","backgroundColor","palette","background","paper","border","concat","grey","padding","spacing","minHeight","minWidth","maxWidth","cursor","DraggableChoice","_ref2","choice","children","className","disabled","category","alternateResponseIndex","choiceIndex","onRemoveChoice","type","id","_useDraggable","useDraggable","categoryId","data","value","choiceId","from","attributes","listeners","setNodeRef","isDragging","createElement","_extends2","ref","propTypes","PropTypes","shape","oneOfType","string","number","isRequired","any","arrayOf","node","bool","func","_default"],"sources":["../src/draggable-choice.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { useDraggable } from '@dnd-kit/core';\nimport { grey } from '@mui/material/colors';\n\nexport const DRAG_TYPE = 'CHOICE';\n\nconst StyledChoice = styled('div')(({ theme }) => ({\n backgroundColor: theme.palette.background.paper,\n border: `solid 1px ${grey[400]}`,\n padding: theme.spacing(1),\n minHeight: '30px',\n minWidth: theme.spacing(20),\n maxWidth: theme.spacing(75),\n cursor: 'grab',\n '&:active': {\n cursor: 'grabbing',\n },\n}));\n\nexport function DraggableChoice({\n choice,\n children,\n className,\n disabled,\n category,\n alternateResponseIndex,\n choiceIndex,\n onRemoveChoice,\n type,\n id,\n}) {\n const { attributes, listeners, setNodeRef, isDragging } = useDraggable({\n id: id || choice.id, // id to be used for dnd-kit\n disabled: disabled,\n categoryId: category?.id,\n alternateResponseIndex,\n data: {\n id: choice.id,\n value: choice.value,\n choiceId: choice.id,\n from: category?.id,\n categoryId: category?.id,\n alternateResponseIndex,\n choiceIndex,\n onRemoveChoice,\n type,\n },\n });\n\n return (\n <StyledChoice ref={setNodeRef} className={className} isDragging={isDragging} {...attributes} {...listeners}>\n {children}\n </StyledChoice>\n );\n}\n\nDraggableChoice.propTypes = {\n choice: PropTypes.shape({\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n value: PropTypes.any,\n }).isRequired,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n className: PropTypes.string,\n disabled: PropTypes.bool,\n category: PropTypes.shape({\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n }),\n alternateResponseIndex: PropTypes.number,\n choiceIndex: PropTypes.number,\n onRemoveChoice: PropTypes.func,\n type: PropTypes.string,\n id: PropTypes.string,\n};\n\nexport default DraggableChoice;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEO,IAAMK,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,QAAQ;AAEjC,IAAME,YAAY,GAAG,IAAAC,cAAM,EAAC,KAAK,CAAC,CAAC,UAAAC,IAAA;EAAA,IAAGC,KAAK,GAAAD,IAAA,CAALC,KAAK;EAAA,OAAQ;IACjDC,eAAe,EAAED,KAAK,CAACE,OAAO,CAACC,UAAU,CAACC,KAAK;IAC/CC,MAAM,eAAAC,MAAA,CAAeC,YAAI,CAAC,GAAG,CAAC,CAAE;IAChCC,OAAO,EAAER,KAAK,CAACS,OAAO,CAAC,CAAC,CAAC;IACzBC,SAAS,EAAE,MAAM;IACjBC,QAAQ,EAAEX,KAAK,CAACS,OAAO,CAAC,EAAE,CAAC;IAC3BG,QAAQ,EAAEZ,KAAK,CAACS,OAAO,CAAC,EAAE,CAAC;IAC3BI,MAAM,EAAE,MAAM;IACd,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"draggable-choice.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_core","_colors","DRAG_TYPE","exports","StyledChoice","styled","_ref","theme","backgroundColor","palette","background","paper","border","concat","grey","padding","spacing","minHeight","minWidth","maxWidth","cursor","margin","DraggableChoice","_ref2","choice","children","className","disabled","category","alternateResponseIndex","choiceIndex","onRemoveChoice","type","id","_useDraggable","useDraggable","categoryId","data","value","choiceId","from","attributes","listeners","setNodeRef","isDragging","createElement","_extends2","ref","propTypes","PropTypes","shape","oneOfType","string","number","isRequired","any","arrayOf","node","bool","func","_default"],"sources":["../src/draggable-choice.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { useDraggable } from '@dnd-kit/core';\nimport { grey } from '@mui/material/colors';\n\nexport const DRAG_TYPE = 'CHOICE';\n\nconst StyledChoice = styled('div')(({ theme }) => ({\n backgroundColor: theme.palette.background.paper,\n border: `solid 1px ${grey[400]}`,\n padding: theme.spacing(1),\n minHeight: '30px',\n minWidth: theme.spacing(20),\n maxWidth: theme.spacing(75),\n cursor: 'grab',\n '& p': {\n margin: 0,\n },\n '& p *': {\n margin: 0,\n },\n '&:active': {\n cursor: 'grabbing',\n },\n}));\n\nexport function DraggableChoice({\n choice,\n children,\n className,\n disabled,\n category,\n alternateResponseIndex,\n choiceIndex,\n onRemoveChoice,\n type,\n id,\n}) {\n const { attributes, listeners, setNodeRef, isDragging } = useDraggable({\n id: id || choice.id, // id to be used for dnd-kit\n disabled: disabled,\n categoryId: category?.id,\n alternateResponseIndex,\n data: {\n id: choice.id,\n value: choice.value,\n choiceId: choice.id,\n from: category?.id,\n categoryId: category?.id,\n alternateResponseIndex,\n choiceIndex,\n onRemoveChoice,\n type,\n },\n });\n\n return (\n <StyledChoice ref={setNodeRef} className={className} isDragging={isDragging} {...attributes} {...listeners}>\n {children}\n </StyledChoice>\n );\n}\n\nDraggableChoice.propTypes = {\n choice: PropTypes.shape({\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n value: PropTypes.any,\n }).isRequired,\n children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),\n className: PropTypes.string,\n disabled: PropTypes.bool,\n category: PropTypes.shape({\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n }),\n alternateResponseIndex: PropTypes.number,\n choiceIndex: PropTypes.number,\n onRemoveChoice: PropTypes.func,\n type: PropTypes.string,\n id: PropTypes.string,\n};\n\nexport default DraggableChoice;\n"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AAS,CAAC,CAACF,qBAAS,CAACG,MAAM,EAAEH,qBAAS,CAACI,MAAM,CAAC,CAAC,CAACC,UAAU;IACxEhB,KAAK,EAAEW,qBAAS,CAACM;EACnB,CAAC,CAAC,CAACD,UAAU;EACb7B,QAAQ,EAAEwB,qBAAS,CAACE,SAAS,CAAC,CAACF,qBAAS,CAACO,OAAO,CAACP,qBAAS,CAACQ,IAAI,CAAC,EAAER,qBAAS,CAACQ,IAAI,CAAC,CAAC;EAClF/B,SAAS,EAAEuB,qBAAS,CAACG,MAAM;EAC3BzB,QAAQ,EAAEsB,qBAAS,CAACS,IAAI;EACxB9B,QAAQ,EAAEqB,qBAAS,CAACC,KAAK,CAAC;IACxBjB,EAAE,EAAEgB,qBAAS,CAACE,SAAS,CAAC,CAACF,qBAAS,CAACG,MAAM,EAAEH,qBAAS,CAACI,MAAM,CAAC;EAC9D,CAAC,CAAC;EACFxB,sBAAsB,EAAEoB,qBAAS,CAACI,MAAM;EACxCvB,WAAW,EAAEmB,qBAAS,CAACI,MAAM;EAC7BtB,cAAc,EAAEkB,qBAAS,CAACU,IAAI;EAC9B3B,IAAI,EAAEiB,qBAAS,CAACG,MAAM;EACtBnB,EAAE,EAAEgB,qBAAS,CAACG;AAChB,CAAC;AAAC,IAAAQ,QAAA,GAAAzD,OAAA,cAEamB,eAAe","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/drag",
|
|
3
|
-
"version": "3.2.0-next.
|
|
3
|
+
"version": "3.2.0-next.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@mui/icons-material": "^7.3.4",
|
|
15
15
|
"@mui/material": "^7.3.4",
|
|
16
16
|
"@pie-lib/math-rendering": "^4.2.0-next.3",
|
|
17
|
-
"@pie-lib/render-ui": "^5.2.0-next.
|
|
17
|
+
"@pie-lib/render-ui": "^5.2.0-next.7",
|
|
18
18
|
"classnames": "^2.2.6",
|
|
19
19
|
"lodash-es": "^4.17.23",
|
|
20
20
|
"prop-types": "^15.7.2",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"scripts": {},
|
|
27
27
|
"author": "",
|
|
28
28
|
"license": "ISC",
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "79aade202d70c1bccdd504fb37934ef3954e934e"
|
|
30
30
|
}
|
package/src/draggable-choice.jsx
CHANGED