@canvas-components/react-drag-any 2.0.1 → 2.0.3
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/README.md +2 -0
- package/dist/index.cjs +6 -1
- package/dist/index.js +6 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -55,6 +55,8 @@ export function TaskQueue({ initial }: { initial: Task[] }) {
|
|
|
55
55
|
|
|
56
56
|
卡片内容可直接写 JSX,也可通过 `<UI.Content value={content} />` 嵌入 Canvas UI 内容文档。`Drag.Source` 支持 `disabled` 和 `disabledStyle`,目标的 `canDrop` 可以按锚点拒绝插入。
|
|
57
57
|
|
|
58
|
+
在 `Drag.Target` 上设置可选的 `dragOverStyle` 可以自定义可放入时的容器背景和阴影。默认沿用容器自身样式。灰底与内阴影可配置为 `{ backgroundColor: "#e9ebee", boxShadow: { inset: true, color: "rgba(0,0,0,0.24)", blur: 8, offsetY: 2 } }`。
|
|
59
|
+
|
|
58
60
|
## 拖拽边缘滚动
|
|
59
61
|
|
|
60
62
|
指针进入滚动容器的边缘并停留时,容器会持续滚动。沿同一边停留时,速度在 1.5 秒内从每秒 480 像素逐渐提高到 1440 像素。指针越过视口或画布边界后,原容器会沿该方向继续加速滚动,直到滚到尽头或松手。回到视口中部会停止滚动,换向或切换滚动容器后重新起速。在画布外松手会取消投放。角落的横纵两轴独立加速。固定表头、行头和空白处也可以触发滚动。使用 `autoScrollEdge={32}` 可将四边的触发距离设为 32 CSS 像素,也可按边设置。省略的边默认 16 像素,设为 0 可关闭该边。
|
package/dist/index.cjs
CHANGED
|
@@ -653,7 +653,12 @@ var decorators = /* @__PURE__ */ new Map([
|
|
|
653
653
|
[
|
|
654
654
|
targetId,
|
|
655
655
|
(props, node) => dragAny.drag.target(
|
|
656
|
-
{
|
|
656
|
+
{
|
|
657
|
+
id: props.id,
|
|
658
|
+
canDrop: props.canDrop,
|
|
659
|
+
dragOverStyle: props.dragOverStyle,
|
|
660
|
+
slot: props.slot
|
|
661
|
+
},
|
|
657
662
|
node
|
|
658
663
|
)
|
|
659
664
|
]
|
package/dist/index.js
CHANGED
|
@@ -651,7 +651,12 @@ var decorators = /* @__PURE__ */ new Map([
|
|
|
651
651
|
[
|
|
652
652
|
targetId,
|
|
653
653
|
(props, node) => drag.target(
|
|
654
|
-
{
|
|
654
|
+
{
|
|
655
|
+
id: props.id,
|
|
656
|
+
canDrop: props.canDrop,
|
|
657
|
+
dragOverStyle: props.dragOverStyle,
|
|
658
|
+
slot: props.slot
|
|
659
|
+
},
|
|
655
660
|
node
|
|
656
661
|
)
|
|
657
662
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canvas-components/react-drag-any",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "通用 Canvas 拖拽的 React 适配包。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"react-dom": ">=18.3.1"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@canvas-components/react-canvas-ui": "1.0.
|
|
43
|
-
"@canvas-components/drag-any": "2.0.
|
|
42
|
+
"@canvas-components/react-canvas-ui": "1.0.6",
|
|
43
|
+
"@canvas-components/drag-any": "2.0.3"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "tsup --config tsup.config.ts"
|