@contember/react-board-dnd-kit 2.1.0-alpha.30 → 2.1.0-alpha.36
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/package.json +14 -14
- package/src/components/BoardSortable.tsx +5 -8
- package/src/components/BoardSortableColumnDragOverlay.tsx +7 -6
- package/src/components/BoardSortableEachColumn.tsx +2 -3
- package/src/components/BoardSortableEachItem.tsx +2 -3
- package/src/internal/multipleContainersKeyboardCoordinates.ts +1 -7
- package/dist/development/index.cjs +0 -30
- package/dist/development/index.cjs.map +0 -1
- package/dist/development/index.js +0 -30
- package/dist/development/index.js.map +0 -1
- package/dist/development/src/components/BoardSortable.cjs +0 -84
- package/dist/development/src/components/BoardSortable.cjs.map +0 -1
- package/dist/development/src/components/BoardSortable.js +0 -84
- package/dist/development/src/components/BoardSortable.js.map +0 -1
- package/dist/development/src/components/BoardSortableActivator.cjs +0 -15
- package/dist/development/src/components/BoardSortableActivator.cjs.map +0 -1
- package/dist/development/src/components/BoardSortableActivator.js +0 -15
- package/dist/development/src/components/BoardSortableActivator.js.map +0 -1
- package/dist/development/src/components/BoardSortableColumnDragOverlay.cjs +0 -38
- package/dist/development/src/components/BoardSortableColumnDragOverlay.cjs.map +0 -1
- package/dist/development/src/components/BoardSortableColumnDragOverlay.js +0 -38
- package/dist/development/src/components/BoardSortableColumnDragOverlay.js.map +0 -1
- package/dist/development/src/components/BoardSortableColumnDropIndicator.cjs +0 -20
- package/dist/development/src/components/BoardSortableColumnDropIndicator.cjs.map +0 -1
- package/dist/development/src/components/BoardSortableColumnDropIndicator.js +0 -20
- package/dist/development/src/components/BoardSortableColumnDropIndicator.js.map +0 -1
- package/dist/development/src/components/BoardSortableEachColumn.cjs +0 -57
- package/dist/development/src/components/BoardSortableEachColumn.cjs.map +0 -1
- package/dist/development/src/components/BoardSortableEachColumn.js +0 -57
- package/dist/development/src/components/BoardSortableEachColumn.js.map +0 -1
- package/dist/development/src/components/BoardSortableEachItem.cjs +0 -58
- package/dist/development/src/components/BoardSortableEachItem.cjs.map +0 -1
- package/dist/development/src/components/BoardSortableEachItem.js +0 -58
- package/dist/development/src/components/BoardSortableEachItem.js.map +0 -1
- package/dist/development/src/components/BoardSortableItemDragOverlay.cjs +0 -37
- package/dist/development/src/components/BoardSortableItemDragOverlay.cjs.map +0 -1
- package/dist/development/src/components/BoardSortableItemDragOverlay.js +0 -37
- package/dist/development/src/components/BoardSortableItemDragOverlay.js.map +0 -1
- package/dist/development/src/components/BoardSortableItemDropIndicator.cjs +0 -19
- package/dist/development/src/components/BoardSortableItemDropIndicator.cjs.map +0 -1
- package/dist/development/src/components/BoardSortableItemDropIndicator.js +0 -19
- package/dist/development/src/components/BoardSortableItemDropIndicator.js.map +0 -1
- package/dist/development/src/components/BoardSortableNode.cjs +0 -28
- package/dist/development/src/components/BoardSortableNode.cjs.map +0 -1
- package/dist/development/src/components/BoardSortableNode.js +0 -28
- package/dist/development/src/components/BoardSortableNode.js.map +0 -1
- package/dist/development/src/components/BoardSortableNullColumn.cjs +0 -34
- package/dist/development/src/components/BoardSortableNullColumn.cjs.map +0 -1
- package/dist/development/src/components/BoardSortableNullColumn.js +0 -34
- package/dist/development/src/components/BoardSortableNullColumn.js.map +0 -1
- package/dist/development/src/contexts.cjs +0 -19
- package/dist/development/src/contexts.cjs.map +0 -1
- package/dist/development/src/contexts.js +0 -19
- package/dist/development/src/contexts.js.map +0 -1
- package/dist/development/src/internal/multipleContainersKeyboardCoordinates.cjs +0 -92
- package/dist/development/src/internal/multipleContainersKeyboardCoordinates.cjs.map +0 -1
- package/dist/development/src/internal/multipleContainersKeyboardCoordinates.js +0 -92
- package/dist/development/src/internal/multipleContainersKeyboardCoordinates.js.map +0 -1
- package/dist/production/index.cjs +0 -30
- package/dist/production/index.cjs.map +0 -1
- package/dist/production/index.js +0 -30
- package/dist/production/index.js.map +0 -1
- package/dist/production/src/components/BoardSortable.cjs +0 -68
- package/dist/production/src/components/BoardSortable.cjs.map +0 -1
- package/dist/production/src/components/BoardSortable.js +0 -68
- package/dist/production/src/components/BoardSortable.js.map +0 -1
- package/dist/production/src/components/BoardSortableActivator.cjs +0 -11
- package/dist/production/src/components/BoardSortableActivator.cjs.map +0 -1
- package/dist/production/src/components/BoardSortableActivator.js +0 -11
- package/dist/production/src/components/BoardSortableActivator.js.map +0 -1
- package/dist/production/src/components/BoardSortableColumnDragOverlay.cjs +0 -18
- package/dist/production/src/components/BoardSortableColumnDragOverlay.cjs.map +0 -1
- package/dist/production/src/components/BoardSortableColumnDragOverlay.js +0 -18
- package/dist/production/src/components/BoardSortableColumnDragOverlay.js.map +0 -1
- package/dist/production/src/components/BoardSortableColumnDropIndicator.cjs +0 -16
- package/dist/production/src/components/BoardSortableColumnDropIndicator.cjs.map +0 -1
- package/dist/production/src/components/BoardSortableColumnDropIndicator.js +0 -16
- package/dist/production/src/components/BoardSortableColumnDropIndicator.js.map +0 -1
- package/dist/production/src/components/BoardSortableEachColumn.cjs +0 -33
- package/dist/production/src/components/BoardSortableEachColumn.cjs.map +0 -1
- package/dist/production/src/components/BoardSortableEachColumn.js +0 -33
- package/dist/production/src/components/BoardSortableEachColumn.js.map +0 -1
- package/dist/production/src/components/BoardSortableEachItem.cjs +0 -34
- package/dist/production/src/components/BoardSortableEachItem.cjs.map +0 -1
- package/dist/production/src/components/BoardSortableEachItem.js +0 -34
- package/dist/production/src/components/BoardSortableEachItem.js.map +0 -1
- package/dist/production/src/components/BoardSortableItemDragOverlay.cjs +0 -17
- package/dist/production/src/components/BoardSortableItemDragOverlay.cjs.map +0 -1
- package/dist/production/src/components/BoardSortableItemDragOverlay.js +0 -17
- package/dist/production/src/components/BoardSortableItemDragOverlay.js.map +0 -1
- package/dist/production/src/components/BoardSortableItemDropIndicator.cjs +0 -15
- package/dist/production/src/components/BoardSortableItemDropIndicator.cjs.map +0 -1
- package/dist/production/src/components/BoardSortableItemDropIndicator.js +0 -15
- package/dist/production/src/components/BoardSortableItemDropIndicator.js.map +0 -1
- package/dist/production/src/components/BoardSortableNode.cjs +0 -20
- package/dist/production/src/components/BoardSortableNode.cjs.map +0 -1
- package/dist/production/src/components/BoardSortableNode.js +0 -20
- package/dist/production/src/components/BoardSortableNode.js.map +0 -1
- package/dist/production/src/components/BoardSortableNullColumn.cjs +0 -22
- package/dist/production/src/components/BoardSortableNullColumn.cjs.map +0 -1
- package/dist/production/src/components/BoardSortableNullColumn.js +0 -22
- package/dist/production/src/components/BoardSortableNullColumn.js.map +0 -1
- package/dist/production/src/contexts.cjs +0 -19
- package/dist/production/src/contexts.cjs.map +0 -1
- package/dist/production/src/contexts.js +0 -19
- package/dist/production/src/contexts.js.map +0 -1
- package/dist/production/src/internal/multipleContainersKeyboardCoordinates.cjs +0 -92
- package/dist/production/src/internal/multipleContainersKeyboardCoordinates.cjs.map +0 -1
- package/dist/production/src/internal/multipleContainersKeyboardCoordinates.js +0 -92
- package/dist/production/src/internal/multipleContainersKeyboardCoordinates.js.map +0 -1
- package/dist/types/components/BoardSortable.d.ts +0 -5
- package/dist/types/components/BoardSortable.d.ts.map +0 -1
- package/dist/types/components/BoardSortableActivator.d.ts +0 -5
- package/dist/types/components/BoardSortableActivator.d.ts.map +0 -1
- package/dist/types/components/BoardSortableColumnDragOverlay.d.ts +0 -5
- package/dist/types/components/BoardSortableColumnDragOverlay.d.ts.map +0 -1
- package/dist/types/components/BoardSortableColumnDropIndicator.d.ts +0 -6
- package/dist/types/components/BoardSortableColumnDropIndicator.d.ts.map +0 -1
- package/dist/types/components/BoardSortableEachColumn.d.ts +0 -10
- package/dist/types/components/BoardSortableEachColumn.d.ts.map +0 -1
- package/dist/types/components/BoardSortableEachItem.d.ts +0 -10
- package/dist/types/components/BoardSortableEachItem.d.ts.map +0 -1
- package/dist/types/components/BoardSortableItemDragOverlay.d.ts +0 -5
- package/dist/types/components/BoardSortableItemDragOverlay.d.ts.map +0 -1
- package/dist/types/components/BoardSortableItemDropIndicator.d.ts +0 -6
- package/dist/types/components/BoardSortableItemDropIndicator.d.ts.map +0 -1
- package/dist/types/components/BoardSortableNode.d.ts +0 -5
- package/dist/types/components/BoardSortableNode.d.ts.map +0 -1
- package/dist/types/components/BoardSortableNullColumn.d.ts +0 -3
- package/dist/types/components/BoardSortableNullColumn.d.ts.map +0 -1
- package/dist/types/components/index.d.ts +0 -11
- package/dist/types/components/index.d.ts.map +0 -1
- package/dist/types/contexts.d.ts +0 -63
- package/dist/types/contexts.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/internal/multipleContainersKeyboardCoordinates.d.ts +0 -12
- package/dist/types/internal/multipleContainersKeyboardCoordinates.d.ts.map +0 -1
- package/dist/types/tsconfig.tsbuildinfo +0 -1
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useBoardColumns, BoardEachColumn, useBoardCurrentColumn } from "@contember/react-board";
|
|
3
|
-
import { SortableContext, horizontalListSortingStrategy, useSortable } from "@dnd-kit/sortable";
|
|
4
|
-
import { BoardSortableNodeContext } from "../contexts.js";
|
|
5
|
-
const BoardSortableEachColumn = ({ children }) => {
|
|
6
|
-
const columns = useBoardColumns();
|
|
7
|
-
return /* @__PURE__ */ jsx(
|
|
8
|
-
SortableContext,
|
|
9
|
-
{
|
|
10
|
-
items: columns,
|
|
11
|
-
strategy: horizontalListSortingStrategy,
|
|
12
|
-
children: /* @__PURE__ */ jsx(BoardEachColumn, { children: /* @__PURE__ */ jsx(BoardSortableEachColumnInner, { children }) })
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
BoardSortableEachColumn.staticRender = ({ children }) => {
|
|
17
|
-
return /* @__PURE__ */ jsx(BoardEachColumn, { children });
|
|
18
|
-
};
|
|
19
|
-
const BoardSortableEachColumnInner = ({ children }) => {
|
|
20
|
-
const currentColumn = useBoardCurrentColumn();
|
|
21
|
-
const sortableProps = useSortable({
|
|
22
|
-
id: currentColumn.id,
|
|
23
|
-
data: {
|
|
24
|
-
type: "column",
|
|
25
|
-
column: currentColumn
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
return /* @__PURE__ */ jsx(BoardSortableNodeContext.Provider, { value: sortableProps, children });
|
|
29
|
-
};
|
|
30
|
-
export {
|
|
31
|
-
BoardSortableEachColumn
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=BoardSortableEachColumn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BoardSortableEachColumn.js","sources":["../../../../../packages/react-board-dnd-kit/src/components/BoardSortableEachColumn.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport { BoardEachColumn, useBoardColumns, useBoardCurrentColumn } from '@contember/react-board'\nimport { horizontalListSortingStrategy, SortableContext, useSortable } from '@dnd-kit/sortable'\nimport { BoardSortableNodeContext } from '../contexts'\n\nexport const BoardSortableEachColumn = ({ children }: {\n\tchildren: ReactNode\n}) => {\n\tconst columns = useBoardColumns()\n\n\treturn (\n\t\t<SortableContext\n\t\t\titems={columns}\n\t\t\tstrategy={horizontalListSortingStrategy}\n\t\t>\n\t\t\t<BoardEachColumn>\n\t\t\t\t<BoardSortableEachColumnInner>\n\t\t\t\t\t{children}\n\t\t\t\t</BoardSortableEachColumnInner>\n\t\t\t</BoardEachColumn>\n\n\t\t</SortableContext>)\n\n}\nBoardSortableEachColumn.staticRender = ({ children }: { children: ReactNode }) => {\n\treturn <BoardEachColumn>{children}</BoardEachColumn>\n}\nconst BoardSortableEachColumnInner = ({ children }: {\n\tchildren: ReactNode\n}) => {\n\tconst currentColumn = useBoardCurrentColumn()\n\tconst sortableProps = useSortable({\n\t\tid: currentColumn.id,\n\t\tdata: {\n\t\t\ttype: 'column',\n\t\t\tcolumn: currentColumn,\n\t\t},\n\t})\n\n\treturn (\n\t\t<BoardSortableNodeContext.Provider value={sortableProps}>\n\t\t\t{children}\n\t\t</BoardSortableNodeContext.Provider>\n\t)\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,0BAA0B,CAAC,EAAE,eAEpC;AACL,QAAM,UAAU,gBAAgB;AAG/B,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,OAAO;AAAA,MACP,UAAU;AAAA,MAEV,UAAC,oBAAA,iBAAA,EACA,UAAC,oBAAA,8BAAA,EACC,UACF,EACD,CAAA;AAAA,IAAA;AAAA,EAED;AAEF;AACA,wBAAwB,eAAe,CAAC,EAAE,eAAwC;AAC1E,SAAA,oBAAC,mBAAiB,UAAS;AACnC;AACA,MAAM,+BAA+B,CAAC,EAAE,eAElC;AACL,QAAM,gBAAgB,sBAAsB;AAC5C,QAAM,gBAAgB,YAAY;AAAA,IACjC,IAAI,cAAc;AAAA,IAClB,MAAM;AAAA,MACL,MAAM;AAAA,MACN,QAAQ;AAAA,IAAA;AAAA,EACT,CACA;AAED,6BACE,yBAAyB,UAAzB,EAAkC,OAAO,eACxC,UACF;AAEF;"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const reactBoard = require("@contember/react-board");
|
|
5
|
-
const sortable = require("@dnd-kit/sortable");
|
|
6
|
-
const contexts = require("../contexts.cjs");
|
|
7
|
-
const BoardSortableEachItem = ({ children }) => {
|
|
8
|
-
const currentColumn = reactBoard.useBoardCurrentColumn();
|
|
9
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
-
sortable.SortableContext,
|
|
11
|
-
{
|
|
12
|
-
items: currentColumn.items,
|
|
13
|
-
strategy: sortable.verticalListSortingStrategy,
|
|
14
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactBoard.BoardEachItem, { children: /* @__PURE__ */ jsxRuntime.jsx(BoardSortableEachItemInner, { children }) })
|
|
15
|
-
}
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
BoardSortableEachItem.staticRender = ({ children }) => {
|
|
19
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactBoard.BoardEachItem, { children });
|
|
20
|
-
};
|
|
21
|
-
const BoardSortableEachItemInner = ({ children }) => {
|
|
22
|
-
const currentItem = reactBoard.useBoardCurrentItem();
|
|
23
|
-
const sortableProps = sortable.useSortable({
|
|
24
|
-
id: currentItem.id,
|
|
25
|
-
data: {
|
|
26
|
-
type: "item",
|
|
27
|
-
item: currentItem,
|
|
28
|
-
column: currentItem.column
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return /* @__PURE__ */ jsxRuntime.jsx(contexts.BoardSortableNodeContext.Provider, { value: sortableProps, children });
|
|
32
|
-
};
|
|
33
|
-
exports.BoardSortableEachItem = BoardSortableEachItem;
|
|
34
|
-
//# sourceMappingURL=BoardSortableEachItem.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BoardSortableEachItem.cjs","sources":["../../../../../packages/react-board-dnd-kit/src/components/BoardSortableEachItem.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport { BoardEachItem, useBoardCurrentColumn, useBoardCurrentItem } from '@contember/react-board'\nimport { SortableContext, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable'\nimport { BoardSortableNodeContext } from '../contexts'\n\nexport const BoardSortableEachItem = ({ children }: {\n\tchildren: ReactNode\n}) => {\n\tconst currentColumn = useBoardCurrentColumn()\n\n\treturn (\n\t\t<SortableContext\n\t\t\titems={currentColumn.items}\n\t\t\tstrategy={verticalListSortingStrategy}\n\t\t>\n\t\t\t<BoardEachItem>\n\t\t\t\t<BoardSortableEachItemInner>\n\t\t\t\t\t{children}\n\t\t\t\t</BoardSortableEachItemInner>\n\t\t\t</BoardEachItem>\n\n\t\t</SortableContext>)\n\n}\nBoardSortableEachItem.staticRender = ({ children }: { children: ReactNode }) => {\n\treturn <BoardEachItem>{children}</BoardEachItem>\n}\n\nconst BoardSortableEachItemInner = ({ children }: {\n\tchildren: ReactNode\n}) => {\n\tconst currentItem = useBoardCurrentItem()\n\tconst sortableProps = useSortable({\n\t\tid: currentItem.id,\n\t\tdata: {\n\t\t\ttype: 'item',\n\t\t\titem: currentItem,\n\t\t\tcolumn: currentItem.column,\n\t\t},\n\t})\n\n\treturn (\n\t\t<BoardSortableNodeContext.Provider value={sortableProps}>\n\t\t\t{children}\n\t\t</BoardSortableNodeContext.Provider>\n\t)\n}\n"],"names":["useBoardCurrentColumn","jsx","SortableContext","verticalListSortingStrategy","BoardEachItem","useBoardCurrentItem","useSortable","BoardSortableNodeContext"],"mappings":";;;;;;AAKO,MAAM,wBAAwB,CAAC,EAAE,eAElC;AACL,QAAM,gBAAgBA,WAAAA,sBAAsB;AAG3C,SAAAC,2BAAA;AAAA,IAACC,SAAA;AAAA,IAAA;AAAA,MACA,OAAO,cAAc;AAAA,MACrB,UAAUC,SAAA;AAAA,MAEV,UAACF,2BAAAA,IAAAG,WAAAA,eAAA,EACA,UAACH,2BAAAA,IAAA,4BAAA,EACC,UACF,EACD,CAAA;AAAA,IAAA;AAAA,EAED;AAEF;AACA,sBAAsB,eAAe,CAAC,EAAE,eAAwC;AACxE,SAAAA,+BAACG,WAAAA,iBAAe,UAAS;AACjC;AAEA,MAAM,6BAA6B,CAAC,EAAE,eAEhC;AACL,QAAM,cAAcC,WAAAA,oBAAoB;AACxC,QAAM,gBAAgBC,SAAAA,YAAY;AAAA,IACjC,IAAI,YAAY;AAAA,IAChB,MAAM;AAAA,MACL,MAAM;AAAA,MACN,MAAM;AAAA,MACN,QAAQ,YAAY;AAAA,IAAA;AAAA,EACrB,CACA;AAED,wCACEC,SAAAA,yBAAyB,UAAzB,EAAkC,OAAO,eACxC,UACF;AAEF;;"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useBoardCurrentColumn, BoardEachItem, useBoardCurrentItem } from "@contember/react-board";
|
|
3
|
-
import { SortableContext, verticalListSortingStrategy, useSortable } from "@dnd-kit/sortable";
|
|
4
|
-
import { BoardSortableNodeContext } from "../contexts.js";
|
|
5
|
-
const BoardSortableEachItem = ({ children }) => {
|
|
6
|
-
const currentColumn = useBoardCurrentColumn();
|
|
7
|
-
return /* @__PURE__ */ jsx(
|
|
8
|
-
SortableContext,
|
|
9
|
-
{
|
|
10
|
-
items: currentColumn.items,
|
|
11
|
-
strategy: verticalListSortingStrategy,
|
|
12
|
-
children: /* @__PURE__ */ jsx(BoardEachItem, { children: /* @__PURE__ */ jsx(BoardSortableEachItemInner, { children }) })
|
|
13
|
-
}
|
|
14
|
-
);
|
|
15
|
-
};
|
|
16
|
-
BoardSortableEachItem.staticRender = ({ children }) => {
|
|
17
|
-
return /* @__PURE__ */ jsx(BoardEachItem, { children });
|
|
18
|
-
};
|
|
19
|
-
const BoardSortableEachItemInner = ({ children }) => {
|
|
20
|
-
const currentItem = useBoardCurrentItem();
|
|
21
|
-
const sortableProps = useSortable({
|
|
22
|
-
id: currentItem.id,
|
|
23
|
-
data: {
|
|
24
|
-
type: "item",
|
|
25
|
-
item: currentItem,
|
|
26
|
-
column: currentItem.column
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return /* @__PURE__ */ jsx(BoardSortableNodeContext.Provider, { value: sortableProps, children });
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
BoardSortableEachItem
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=BoardSortableEachItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BoardSortableEachItem.js","sources":["../../../../../packages/react-board-dnd-kit/src/components/BoardSortableEachItem.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport { BoardEachItem, useBoardCurrentColumn, useBoardCurrentItem } from '@contember/react-board'\nimport { SortableContext, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable'\nimport { BoardSortableNodeContext } from '../contexts'\n\nexport const BoardSortableEachItem = ({ children }: {\n\tchildren: ReactNode\n}) => {\n\tconst currentColumn = useBoardCurrentColumn()\n\n\treturn (\n\t\t<SortableContext\n\t\t\titems={currentColumn.items}\n\t\t\tstrategy={verticalListSortingStrategy}\n\t\t>\n\t\t\t<BoardEachItem>\n\t\t\t\t<BoardSortableEachItemInner>\n\t\t\t\t\t{children}\n\t\t\t\t</BoardSortableEachItemInner>\n\t\t\t</BoardEachItem>\n\n\t\t</SortableContext>)\n\n}\nBoardSortableEachItem.staticRender = ({ children }: { children: ReactNode }) => {\n\treturn <BoardEachItem>{children}</BoardEachItem>\n}\n\nconst BoardSortableEachItemInner = ({ children }: {\n\tchildren: ReactNode\n}) => {\n\tconst currentItem = useBoardCurrentItem()\n\tconst sortableProps = useSortable({\n\t\tid: currentItem.id,\n\t\tdata: {\n\t\t\ttype: 'item',\n\t\t\titem: currentItem,\n\t\t\tcolumn: currentItem.column,\n\t\t},\n\t})\n\n\treturn (\n\t\t<BoardSortableNodeContext.Provider value={sortableProps}>\n\t\t\t{children}\n\t\t</BoardSortableNodeContext.Provider>\n\t)\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,wBAAwB,CAAC,EAAE,eAElC;AACL,QAAM,gBAAgB,sBAAsB;AAG3C,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,OAAO,cAAc;AAAA,MACrB,UAAU;AAAA,MAEV,UAAC,oBAAA,eAAA,EACA,UAAC,oBAAA,4BAAA,EACC,UACF,EACD,CAAA;AAAA,IAAA;AAAA,EAED;AAEF;AACA,sBAAsB,eAAe,CAAC,EAAE,eAAwC;AACxE,SAAA,oBAAC,iBAAe,UAAS;AACjC;AAEA,MAAM,6BAA6B,CAAC,EAAE,eAEhC;AACL,QAAM,cAAc,oBAAoB;AACxC,QAAM,gBAAgB,YAAY;AAAA,IACjC,IAAI,YAAY;AAAA,IAChB,MAAM;AAAA,MACL,MAAM;AAAA,MACN,MAAM;AAAA,MACN,QAAQ,YAAY;AAAA,IAAA;AAAA,EACrB,CACA;AAED,6BACE,yBAAyB,UAAzB,EAAkC,OAAO,eACxC,UACF;AAEF;"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const reactPortal = require("@radix-ui/react-portal");
|
|
5
|
-
const core = require("@dnd-kit/core");
|
|
6
|
-
const reactBinding = require("@contember/react-binding");
|
|
7
|
-
const contexts = require("../contexts.cjs");
|
|
8
|
-
const BoardSortableItemDragOverlay = ({ children }) => {
|
|
9
|
-
const activeItem = contexts.useBoardActiveItem();
|
|
10
|
-
const accessorTreeState = reactBinding.useAccessorTreeState();
|
|
11
|
-
if (!activeItem) {
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactPortal.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(core.DragOverlay, { children: /* @__PURE__ */ jsxRuntime.jsx(contexts.BoardActiveItemContext.Provider, { value: activeItem, children: /* @__PURE__ */ jsxRuntime.jsx(reactBinding.AccessorTree, { state: accessorTreeState, children: /* @__PURE__ */ jsxRuntime.jsx(reactBinding.Entity, { accessor: activeItem.value, children }) }) }) }) });
|
|
15
|
-
};
|
|
16
|
-
exports.BoardSortableItemDragOverlay = BoardSortableItemDragOverlay;
|
|
17
|
-
//# sourceMappingURL=BoardSortableItemDragOverlay.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BoardSortableItemDragOverlay.cjs","sources":["../../../../../packages/react-board-dnd-kit/src/components/BoardSortableItemDragOverlay.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { Portal } from '@radix-ui/react-portal'\nimport { DragOverlay } from '@dnd-kit/core'\nimport { AccessorTree, Entity, useAccessorTreeState } from '@contember/react-binding'\nimport { BoardActiveItemContext, useBoardActiveItem } from '../contexts'\n\nexport const BoardSortableItemDragOverlay = ({ children }: {\n\tchildren: ReactNode\n}) => {\n\tconst activeItem = useBoardActiveItem()\n\tconst accessorTreeState = useAccessorTreeState()\n\tif (!activeItem) {\n\t\treturn null\n\t}\n\treturn (\n\t\t<Portal>\n\t\t\t<DragOverlay>\n\t\t\t\t<BoardActiveItemContext.Provider value={activeItem}>\n\t\t\t\t\t<AccessorTree state={accessorTreeState}>\n\t\t\t\t\t\t<Entity accessor={activeItem.value}>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</Entity>\n\t\t\t\t\t</AccessorTree>\n\t\t\t\t</BoardActiveItemContext.Provider>\n\t\t\t</DragOverlay>\n\t\t</Portal>\n\t)\n}\n"],"names":["useBoardActiveItem","useAccessorTreeState","jsx","Portal","DragOverlay","BoardActiveItemContext","AccessorTree","Entity"],"mappings":";;;;;;;AAMO,MAAM,+BAA+B,CAAC,EAAE,eAEzC;AACL,QAAM,aAAaA,SAAAA,mBAAmB;AACtC,QAAM,oBAAoBC,aAAAA,qBAAqB;AAC/C,MAAI,CAAC,YAAY;AACT,WAAA;AAAA,EAAA;AAGP,SAAAC,2BAAAA,IAACC,YAAAA,UACA,UAACD,2BAAA,IAAAE,KAAA,aAAA,EACA,yCAACC,SAAAA,uBAAuB,UAAvB,EAAgC,OAAO,YACvC,UAAAH,2BAAA,IAACI,6BAAa,OAAO,mBACpB,UAACJ,2BAAAA,IAAAK,aAAAA,QAAA,EAAO,UAAU,WAAW,OAC3B,SACF,CAAA,EAAA,CACD,EACD,CAAA,EAAA,CACD,EACD,CAAA;AAEF;;"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Portal } from "@radix-ui/react-portal";
|
|
3
|
-
import { DragOverlay } from "@dnd-kit/core";
|
|
4
|
-
import { useAccessorTreeState, AccessorTree, Entity } from "@contember/react-binding";
|
|
5
|
-
import { useBoardActiveItem, BoardActiveItemContext } from "../contexts.js";
|
|
6
|
-
const BoardSortableItemDragOverlay = ({ children }) => {
|
|
7
|
-
const activeItem = useBoardActiveItem();
|
|
8
|
-
const accessorTreeState = useAccessorTreeState();
|
|
9
|
-
if (!activeItem) {
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
12
|
-
return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(DragOverlay, { children: /* @__PURE__ */ jsx(BoardActiveItemContext.Provider, { value: activeItem, children: /* @__PURE__ */ jsx(AccessorTree, { state: accessorTreeState, children: /* @__PURE__ */ jsx(Entity, { accessor: activeItem.value, children }) }) }) }) });
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
BoardSortableItemDragOverlay
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=BoardSortableItemDragOverlay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BoardSortableItemDragOverlay.js","sources":["../../../../../packages/react-board-dnd-kit/src/components/BoardSortableItemDragOverlay.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { Portal } from '@radix-ui/react-portal'\nimport { DragOverlay } from '@dnd-kit/core'\nimport { AccessorTree, Entity, useAccessorTreeState } from '@contember/react-binding'\nimport { BoardActiveItemContext, useBoardActiveItem } from '../contexts'\n\nexport const BoardSortableItemDragOverlay = ({ children }: {\n\tchildren: ReactNode\n}) => {\n\tconst activeItem = useBoardActiveItem()\n\tconst accessorTreeState = useAccessorTreeState()\n\tif (!activeItem) {\n\t\treturn null\n\t}\n\treturn (\n\t\t<Portal>\n\t\t\t<DragOverlay>\n\t\t\t\t<BoardActiveItemContext.Provider value={activeItem}>\n\t\t\t\t\t<AccessorTree state={accessorTreeState}>\n\t\t\t\t\t\t<Entity accessor={activeItem.value}>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</Entity>\n\t\t\t\t\t</AccessorTree>\n\t\t\t\t</BoardActiveItemContext.Provider>\n\t\t\t</DragOverlay>\n\t\t</Portal>\n\t)\n}\n"],"names":[],"mappings":";;;;;AAMO,MAAM,+BAA+B,CAAC,EAAE,eAEzC;AACL,QAAM,aAAa,mBAAmB;AACtC,QAAM,oBAAoB,qBAAqB;AAC/C,MAAI,CAAC,YAAY;AACT,WAAA;AAAA,EAAA;AAGP,SAAA,oBAAC,UACA,UAAC,oBAAA,aAAA,EACA,8BAAC,uBAAuB,UAAvB,EAAgC,OAAO,YACvC,UAAA,oBAAC,gBAAa,OAAO,mBACpB,UAAC,oBAAA,QAAA,EAAO,UAAU,WAAW,OAC3B,SACF,CAAA,EAAA,CACD,EACD,CAAA,EAAA,CACD,EACD,CAAA;AAEF;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const contexts = require("../contexts.cjs");
|
|
5
|
-
const BoardSortableItemDropIndicator = ({ children, position }) => {
|
|
6
|
-
const sortable = contexts.useBoardSortableNode();
|
|
7
|
-
const { isOver, active, data } = sortable;
|
|
8
|
-
const showDropIndicator = isOver && active?.data.current?.type === "item" && active?.data.current?.item?.id !== data?.item?.id;
|
|
9
|
-
const activeSortable = active?.data.current?.sortable;
|
|
10
|
-
const isAfter = data?.sortable.containerId === activeSortable?.containerId && (data?.sortable.index ?? 0) > activeSortable?.index;
|
|
11
|
-
const renderedPosition = isAfter ? "after" : "before";
|
|
12
|
-
return renderedPosition === position && showDropIndicator ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children }) : null;
|
|
13
|
-
};
|
|
14
|
-
exports.BoardSortableItemDropIndicator = BoardSortableItemDropIndicator;
|
|
15
|
-
//# sourceMappingURL=BoardSortableItemDropIndicator.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BoardSortableItemDropIndicator.cjs","sources":["../../../../../packages/react-board-dnd-kit/src/components/BoardSortableItemDropIndicator.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useBoardSortableNode } from '../contexts'\n\nexport const BoardSortableItemDropIndicator = ({ children, position }: {\n\tchildren: ReactNode\n\tposition: 'before' | 'after'\n}) => {\n\tconst sortable = useBoardSortableNode()\n\n\tconst { isOver, active, data } = sortable\n\tconst showDropIndicator = isOver\n\t\t&& active?.data.current?.type === 'item'\n\t\t&& active?.data.current?.item?.id !== data?.item?.id\n\tconst activeSortable = active?.data.current?.sortable\n\tconst isAfter = data?.sortable.containerId === activeSortable?.containerId\n\t\t&& (data?.sortable.index ?? 0) > activeSortable?.index\n\n\tconst renderedPosition = isAfter ? 'after' : 'before'\n\n\treturn renderedPosition === position && showDropIndicator ? <>{children}</> : null\n}\n"],"names":["useBoardSortableNode","jsx","Fragment"],"mappings":";;;;AAGO,MAAM,iCAAiC,CAAC,EAAE,UAAU,eAGrD;AACL,QAAM,WAAWA,SAAAA,qBAAqB;AAEtC,QAAM,EAAE,QAAQ,QAAQ,KAAS,IAAA;AACjC,QAAM,oBAAoB,UACtB,QAAQ,KAAK,SAAS,SAAS,UAC/B,QAAQ,KAAK,SAAS,MAAM,OAAO,MAAM,MAAM;AAC7C,QAAA,iBAAiB,QAAQ,KAAK,SAAS;AACvC,QAAA,UAAU,MAAM,SAAS,gBAAgB,gBAAgB,gBAC1D,MAAM,SAAS,SAAS,KAAK,gBAAgB;AAE5C,QAAA,mBAAmB,UAAU,UAAU;AAE7C,SAAO,qBAAqB,YAAY,oBAAoBC,2BAAAA,IAAAC,WAAAA,UAAA,EAAG,SAAS,CAAA,IAAM;AAC/E;;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useBoardSortableNode } from "../contexts.js";
|
|
3
|
-
const BoardSortableItemDropIndicator = ({ children, position }) => {
|
|
4
|
-
const sortable = useBoardSortableNode();
|
|
5
|
-
const { isOver, active, data } = sortable;
|
|
6
|
-
const showDropIndicator = isOver && active?.data.current?.type === "item" && active?.data.current?.item?.id !== data?.item?.id;
|
|
7
|
-
const activeSortable = active?.data.current?.sortable;
|
|
8
|
-
const isAfter = data?.sortable.containerId === activeSortable?.containerId && (data?.sortable.index ?? 0) > activeSortable?.index;
|
|
9
|
-
const renderedPosition = isAfter ? "after" : "before";
|
|
10
|
-
return renderedPosition === position && showDropIndicator ? /* @__PURE__ */ jsx(Fragment, { children }) : null;
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
BoardSortableItemDropIndicator
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=BoardSortableItemDropIndicator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BoardSortableItemDropIndicator.js","sources":["../../../../../packages/react-board-dnd-kit/src/components/BoardSortableItemDropIndicator.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useBoardSortableNode } from '../contexts'\n\nexport const BoardSortableItemDropIndicator = ({ children, position }: {\n\tchildren: ReactNode\n\tposition: 'before' | 'after'\n}) => {\n\tconst sortable = useBoardSortableNode()\n\n\tconst { isOver, active, data } = sortable\n\tconst showDropIndicator = isOver\n\t\t&& active?.data.current?.type === 'item'\n\t\t&& active?.data.current?.item?.id !== data?.item?.id\n\tconst activeSortable = active?.data.current?.sortable\n\tconst isAfter = data?.sortable.containerId === activeSortable?.containerId\n\t\t&& (data?.sortable.index ?? 0) > activeSortable?.index\n\n\tconst renderedPosition = isAfter ? 'after' : 'before'\n\n\treturn renderedPosition === position && showDropIndicator ? <>{children}</> : null\n}\n"],"names":[],"mappings":";;AAGO,MAAM,iCAAiC,CAAC,EAAE,UAAU,eAGrD;AACL,QAAM,WAAW,qBAAqB;AAEtC,QAAM,EAAE,QAAQ,QAAQ,KAAS,IAAA;AACjC,QAAM,oBAAoB,UACtB,QAAQ,KAAK,SAAS,SAAS,UAC/B,QAAQ,KAAK,SAAS,MAAM,OAAO,MAAM,MAAM;AAC7C,QAAA,iBAAiB,QAAQ,KAAK,SAAS;AACvC,QAAA,UAAU,MAAM,SAAS,gBAAgB,gBAAgB,gBAC1D,MAAM,SAAS,SAAS,KAAK,gBAAgB;AAE5C,QAAA,mBAAmB,UAAU,UAAU;AAE7C,SAAO,qBAAqB,YAAY,oBAAoB,oBAAA,UAAA,EAAG,SAAS,CAAA,IAAM;AAC/E;"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const contexts = require("../contexts.cjs");
|
|
5
|
-
const reactSlot = require("@radix-ui/react-slot");
|
|
6
|
-
const utilities = require("@contember/utilities");
|
|
7
|
-
const BoardSortableNode = ({ children }) => {
|
|
8
|
-
const { setNodeRef, isOver, isDragging, active } = contexts.useBoardSortableNode();
|
|
9
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
-
reactSlot.Slot,
|
|
11
|
-
{
|
|
12
|
-
ref: setNodeRef,
|
|
13
|
-
"data-sortable-over": utilities.dataAttribute(isOver ? active?.data.current?.type : void 0),
|
|
14
|
-
"data-sortable-dragging": utilities.dataAttribute(isDragging),
|
|
15
|
-
children
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
exports.BoardSortableNode = BoardSortableNode;
|
|
20
|
-
//# sourceMappingURL=BoardSortableNode.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BoardSortableNode.cjs","sources":["../../../../../packages/react-board-dnd-kit/src/components/BoardSortableNode.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useBoardSortableNode } from '../contexts'\nimport { Slot } from '@radix-ui/react-slot'\nimport { dataAttribute } from '@contember/utilities'\n\nexport const BoardSortableNode = ({ children }: {\n\tchildren: ReactNode\n}) => {\n\tconst { setNodeRef, isOver, isDragging, active } = useBoardSortableNode()\n\treturn (\n\t\t<Slot\n\t\t\tref={setNodeRef}\n\t\t\tdata-sortable-over={dataAttribute(isOver ? active?.data.current?.type : undefined)}\n\t\t\tdata-sortable-dragging={dataAttribute(isDragging)}\n\t\t>\n\t\t\t{children}\n\t\t</Slot>\n\t)\n}\n"],"names":["useBoardSortableNode","jsx","Slot","dataAttribute"],"mappings":";;;;;;AAKO,MAAM,oBAAoB,CAAC,EAAE,eAE9B;AACL,QAAM,EAAE,YAAY,QAAQ,YAAY,OAAA,IAAWA,SAAAA,qBAAqB;AAEvE,SAAAC,2BAAA;AAAA,IAACC,UAAA;AAAA,IAAA;AAAA,MACA,KAAK;AAAA,MACL,sBAAoBC,UAAAA,cAAc,SAAS,QAAQ,KAAK,SAAS,OAAO,MAAS;AAAA,MACjF,0BAAwBA,wBAAc,UAAU;AAAA,MAE/C;AAAA,IAAA;AAAA,EACF;AAEF;;"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useBoardSortableNode } from "../contexts.js";
|
|
3
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
-
import { dataAttribute } from "@contember/utilities";
|
|
5
|
-
const BoardSortableNode = ({ children }) => {
|
|
6
|
-
const { setNodeRef, isOver, isDragging, active } = useBoardSortableNode();
|
|
7
|
-
return /* @__PURE__ */ jsx(
|
|
8
|
-
Slot,
|
|
9
|
-
{
|
|
10
|
-
ref: setNodeRef,
|
|
11
|
-
"data-sortable-over": dataAttribute(isOver ? active?.data.current?.type : void 0),
|
|
12
|
-
"data-sortable-dragging": dataAttribute(isDragging),
|
|
13
|
-
children
|
|
14
|
-
}
|
|
15
|
-
);
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
BoardSortableNode
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=BoardSortableNode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BoardSortableNode.js","sources":["../../../../../packages/react-board-dnd-kit/src/components/BoardSortableNode.tsx"],"sourcesContent":["import React, { ReactNode } from 'react'\nimport { useBoardSortableNode } from '../contexts'\nimport { Slot } from '@radix-ui/react-slot'\nimport { dataAttribute } from '@contember/utilities'\n\nexport const BoardSortableNode = ({ children }: {\n\tchildren: ReactNode\n}) => {\n\tconst { setNodeRef, isOver, isDragging, active } = useBoardSortableNode()\n\treturn (\n\t\t<Slot\n\t\t\tref={setNodeRef}\n\t\t\tdata-sortable-over={dataAttribute(isOver ? active?.data.current?.type : undefined)}\n\t\t\tdata-sortable-dragging={dataAttribute(isDragging)}\n\t\t>\n\t\t\t{children}\n\t\t</Slot>\n\t)\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,oBAAoB,CAAC,EAAE,eAE9B;AACL,QAAM,EAAE,YAAY,QAAQ,YAAY,OAAA,IAAW,qBAAqB;AAEvE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,KAAK;AAAA,MACL,sBAAoB,cAAc,SAAS,QAAQ,KAAK,SAAS,OAAO,MAAS;AAAA,MACjF,0BAAwB,cAAc,UAAU;AAAA,MAE/C;AAAA,IAAA;AAAA,EACF;AAEF;"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const reactBoard = require("@contember/react-board");
|
|
5
|
-
const sortable = require("@dnd-kit/sortable");
|
|
6
|
-
const contexts = require("../contexts.cjs");
|
|
7
|
-
const BoardSortableNullColumn = ({ children }) => {
|
|
8
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactBoard.BoardNullColumn, { children: /* @__PURE__ */ jsxRuntime.jsx(BoardSortableNullColumnInner, { children }) });
|
|
9
|
-
};
|
|
10
|
-
const BoardSortableNullColumnInner = ({ children }) => {
|
|
11
|
-
const currentColumn = reactBoard.useBoardCurrentColumn();
|
|
12
|
-
const sortableProps = sortable.useSortable({
|
|
13
|
-
id: currentColumn.id,
|
|
14
|
-
data: {
|
|
15
|
-
type: "column",
|
|
16
|
-
column: currentColumn
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
return /* @__PURE__ */ jsxRuntime.jsx(contexts.BoardSortableNodeContext.Provider, { value: sortableProps, children });
|
|
20
|
-
};
|
|
21
|
-
exports.BoardSortableNullColumn = BoardSortableNullColumn;
|
|
22
|
-
//# sourceMappingURL=BoardSortableNullColumn.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BoardSortableNullColumn.cjs","sources":["../../../../../packages/react-board-dnd-kit/src/components/BoardSortableNullColumn.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport { BoardNullColumn, BoardNullColumnProps, useBoardCurrentColumn } from '@contember/react-board'\nimport { useSortable } from '@dnd-kit/sortable'\nimport { BoardSortableNodeContext } from '../contexts'\n\nexport const BoardSortableNullColumn = ({ children }: BoardNullColumnProps) => {\n\treturn (\n\t\t<BoardNullColumn>\n\t\t\t<BoardSortableNullColumnInner>\n\t\t\t\t{children}\n\t\t\t</BoardSortableNullColumnInner>\n\t\t</BoardNullColumn>\n\t)\n}\nconst BoardSortableNullColumnInner = ({ children }: {\n\tchildren: ReactNode\n}) => {\n\tconst currentColumn = useBoardCurrentColumn()\n\tconst sortableProps = useSortable({\n\t\tid: currentColumn.id,\n\t\tdata: {\n\t\t\ttype: 'column',\n\t\t\tcolumn: currentColumn,\n\t\t},\n\t})\n\n\treturn (\n\t\t<BoardSortableNodeContext.Provider value={sortableProps}>\n\t\t\t{children}\n\t\t</BoardSortableNodeContext.Provider>\n\t)\n}\n"],"names":["jsx","BoardNullColumn","useBoardCurrentColumn","useSortable","BoardSortableNodeContext"],"mappings":";;;;;;AAKO,MAAM,0BAA0B,CAAC,EAAE,eAAqC;AAC9E,SACEA,2BAAA,IAAAC,WAAA,iBAAA,EACA,UAACD,2BAAA,IAAA,8BAAA,EACC,SACF,CAAA,GACD;AAEF;AACA,MAAM,+BAA+B,CAAC,EAAE,eAElC;AACL,QAAM,gBAAgBE,WAAAA,sBAAsB;AAC5C,QAAM,gBAAgBC,SAAAA,YAAY;AAAA,IACjC,IAAI,cAAc;AAAA,IAClB,MAAM;AAAA,MACL,MAAM;AAAA,MACN,QAAQ;AAAA,IAAA;AAAA,EACT,CACA;AAED,wCACEC,SAAAA,yBAAyB,UAAzB,EAAkC,OAAO,eACxC,UACF;AAEF;;"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { BoardNullColumn, useBoardCurrentColumn } from "@contember/react-board";
|
|
3
|
-
import { useSortable } from "@dnd-kit/sortable";
|
|
4
|
-
import { BoardSortableNodeContext } from "../contexts.js";
|
|
5
|
-
const BoardSortableNullColumn = ({ children }) => {
|
|
6
|
-
return /* @__PURE__ */ jsx(BoardNullColumn, { children: /* @__PURE__ */ jsx(BoardSortableNullColumnInner, { children }) });
|
|
7
|
-
};
|
|
8
|
-
const BoardSortableNullColumnInner = ({ children }) => {
|
|
9
|
-
const currentColumn = useBoardCurrentColumn();
|
|
10
|
-
const sortableProps = useSortable({
|
|
11
|
-
id: currentColumn.id,
|
|
12
|
-
data: {
|
|
13
|
-
type: "column",
|
|
14
|
-
column: currentColumn
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
return /* @__PURE__ */ jsx(BoardSortableNodeContext.Provider, { value: sortableProps, children });
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
BoardSortableNullColumn
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=BoardSortableNullColumn.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BoardSortableNullColumn.js","sources":["../../../../../packages/react-board-dnd-kit/src/components/BoardSortableNullColumn.tsx"],"sourcesContent":["import { ReactNode } from 'react'\nimport { BoardNullColumn, BoardNullColumnProps, useBoardCurrentColumn } from '@contember/react-board'\nimport { useSortable } from '@dnd-kit/sortable'\nimport { BoardSortableNodeContext } from '../contexts'\n\nexport const BoardSortableNullColumn = ({ children }: BoardNullColumnProps) => {\n\treturn (\n\t\t<BoardNullColumn>\n\t\t\t<BoardSortableNullColumnInner>\n\t\t\t\t{children}\n\t\t\t</BoardSortableNullColumnInner>\n\t\t</BoardNullColumn>\n\t)\n}\nconst BoardSortableNullColumnInner = ({ children }: {\n\tchildren: ReactNode\n}) => {\n\tconst currentColumn = useBoardCurrentColumn()\n\tconst sortableProps = useSortable({\n\t\tid: currentColumn.id,\n\t\tdata: {\n\t\t\ttype: 'column',\n\t\t\tcolumn: currentColumn,\n\t\t},\n\t})\n\n\treturn (\n\t\t<BoardSortableNodeContext.Provider value={sortableProps}>\n\t\t\t{children}\n\t\t</BoardSortableNodeContext.Provider>\n\t)\n}\n"],"names":[],"mappings":";;;;AAKO,MAAM,0BAA0B,CAAC,EAAE,eAAqC;AAC9E,SACE,oBAAA,iBAAA,EACA,UAAC,oBAAA,8BAAA,EACC,SACF,CAAA,GACD;AAEF;AACA,MAAM,+BAA+B,CAAC,EAAE,eAElC;AACL,QAAM,gBAAgB,sBAAsB;AAC5C,QAAM,gBAAgB,YAAY;AAAA,IACjC,IAAI,cAAc;AAAA,IAClB,MAAM;AAAA,MACL,MAAM;AAAA,MACN,QAAQ;AAAA,IAAA;AAAA,EACT,CACA;AAED,6BACE,yBAAyB,UAAzB,EAAkC,OAAO,eACxC,UACF;AAEF;"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const reactUtils = require("@contember/react-utils");
|
|
4
|
-
const BoardSortableNodeContext_ = reactUtils.createRequiredContext("BoardSortableNodeContext");
|
|
5
|
-
const BoardSortableNodeContext = BoardSortableNodeContext_[0];
|
|
6
|
-
const useBoardSortableNode = BoardSortableNodeContext_[1];
|
|
7
|
-
const BoardActiveItemContext_ = reactUtils.createContext("BoardActiveItemContext", void 0);
|
|
8
|
-
const BoardActiveItemContext = BoardActiveItemContext_[0];
|
|
9
|
-
const useBoardActiveItem = BoardActiveItemContext_[1];
|
|
10
|
-
const BoardActiveColumnContext_ = reactUtils.createContext("BoardActiveColumnContext", void 0);
|
|
11
|
-
const BoardActiveColumnContext = BoardActiveColumnContext_[0];
|
|
12
|
-
const useBoardActiveColumn = BoardActiveColumnContext_[1];
|
|
13
|
-
exports.BoardActiveColumnContext = BoardActiveColumnContext;
|
|
14
|
-
exports.BoardActiveItemContext = BoardActiveItemContext;
|
|
15
|
-
exports.BoardSortableNodeContext = BoardSortableNodeContext;
|
|
16
|
-
exports.useBoardActiveColumn = useBoardActiveColumn;
|
|
17
|
-
exports.useBoardActiveItem = useBoardActiveItem;
|
|
18
|
-
exports.useBoardSortableNode = useBoardSortableNode;
|
|
19
|
-
//# sourceMappingURL=contexts.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contexts.cjs","sources":["../../../../packages/react-board-dnd-kit/src/contexts.ts"],"sourcesContent":["import { createContext, createRequiredContext } from '@contember/react-utils'\nimport { useSortable } from '@dnd-kit/sortable'\nimport { BoardColumnNode, BoardItemNode } from '@contember/react-board'\n\nconst BoardSortableNodeContext_ = createRequiredContext<ReturnType<typeof useSortable>>('BoardSortableNodeContext')\n/** @internal */\nexport const BoardSortableNodeContext = BoardSortableNodeContext_[0]\nexport const useBoardSortableNode = BoardSortableNodeContext_[1]\n\nconst BoardActiveItemContext_ = createContext<BoardItemNode & { column: BoardColumnNode } | undefined>('BoardActiveItemContext', undefined)\n/** @internal */\nexport const BoardActiveItemContext = BoardActiveItemContext_[0]\nexport const useBoardActiveItem = BoardActiveItemContext_[1]\n\nconst BoardActiveColumnContext_ = createContext<BoardColumnNode | undefined>('BoardActiveColumnContext', undefined)\n/** @internal */\nexport const BoardActiveColumnContext = BoardActiveColumnContext_[0]\nexport const useBoardActiveColumn = BoardActiveColumnContext_[1]\n"],"names":["createRequiredContext","createContext"],"mappings":";;;AAIA,MAAM,4BAA4BA,iCAAsD,0BAA0B;AAErG,MAAA,2BAA2B,0BAA0B,CAAC;AACtD,MAAA,uBAAuB,0BAA0B,CAAC;AAE/D,MAAM,0BAA0BC,WAAuE,cAAA,0BAA0B,MAAS;AAE7H,MAAA,yBAAyB,wBAAwB,CAAC;AAClD,MAAA,qBAAqB,wBAAwB,CAAC;AAE3D,MAAM,4BAA4BA,WAA2C,cAAA,4BAA4B,MAAS;AAErG,MAAA,2BAA2B,0BAA0B,CAAC;AACtD,MAAA,uBAAuB,0BAA0B,CAAC;;;;;;;"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { createRequiredContext, createContext } from "@contember/react-utils";
|
|
2
|
-
const BoardSortableNodeContext_ = createRequiredContext("BoardSortableNodeContext");
|
|
3
|
-
const BoardSortableNodeContext = BoardSortableNodeContext_[0];
|
|
4
|
-
const useBoardSortableNode = BoardSortableNodeContext_[1];
|
|
5
|
-
const BoardActiveItemContext_ = createContext("BoardActiveItemContext", void 0);
|
|
6
|
-
const BoardActiveItemContext = BoardActiveItemContext_[0];
|
|
7
|
-
const useBoardActiveItem = BoardActiveItemContext_[1];
|
|
8
|
-
const BoardActiveColumnContext_ = createContext("BoardActiveColumnContext", void 0);
|
|
9
|
-
const BoardActiveColumnContext = BoardActiveColumnContext_[0];
|
|
10
|
-
const useBoardActiveColumn = BoardActiveColumnContext_[1];
|
|
11
|
-
export {
|
|
12
|
-
BoardActiveColumnContext,
|
|
13
|
-
BoardActiveItemContext,
|
|
14
|
-
BoardSortableNodeContext,
|
|
15
|
-
useBoardActiveColumn,
|
|
16
|
-
useBoardActiveItem,
|
|
17
|
-
useBoardSortableNode
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=contexts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contexts.js","sources":["../../../../packages/react-board-dnd-kit/src/contexts.ts"],"sourcesContent":["import { createContext, createRequiredContext } from '@contember/react-utils'\nimport { useSortable } from '@dnd-kit/sortable'\nimport { BoardColumnNode, BoardItemNode } from '@contember/react-board'\n\nconst BoardSortableNodeContext_ = createRequiredContext<ReturnType<typeof useSortable>>('BoardSortableNodeContext')\n/** @internal */\nexport const BoardSortableNodeContext = BoardSortableNodeContext_[0]\nexport const useBoardSortableNode = BoardSortableNodeContext_[1]\n\nconst BoardActiveItemContext_ = createContext<BoardItemNode & { column: BoardColumnNode } | undefined>('BoardActiveItemContext', undefined)\n/** @internal */\nexport const BoardActiveItemContext = BoardActiveItemContext_[0]\nexport const useBoardActiveItem = BoardActiveItemContext_[1]\n\nconst BoardActiveColumnContext_ = createContext<BoardColumnNode | undefined>('BoardActiveColumnContext', undefined)\n/** @internal */\nexport const BoardActiveColumnContext = BoardActiveColumnContext_[0]\nexport const useBoardActiveColumn = BoardActiveColumnContext_[1]\n"],"names":[],"mappings":";AAIA,MAAM,4BAA4B,sBAAsD,0BAA0B;AAErG,MAAA,2BAA2B,0BAA0B,CAAC;AACtD,MAAA,uBAAuB,0BAA0B,CAAC;AAE/D,MAAM,0BAA0B,cAAuE,0BAA0B,MAAS;AAE7H,MAAA,yBAAyB,wBAAwB,CAAC;AAClD,MAAA,qBAAqB,wBAAwB,CAAC;AAE3D,MAAM,4BAA4B,cAA2C,4BAA4B,MAAS;AAErG,MAAA,2BAA2B,0BAA0B,CAAC;AACtD,MAAA,uBAAuB,0BAA0B,CAAC;"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const core = require("@dnd-kit/core");
|
|
4
|
-
const directions = [
|
|
5
|
-
core.KeyboardCode.Down,
|
|
6
|
-
core.KeyboardCode.Right,
|
|
7
|
-
core.KeyboardCode.Up,
|
|
8
|
-
core.KeyboardCode.Left
|
|
9
|
-
];
|
|
10
|
-
const coordinateGetter = (event, { context: { active, droppableRects, droppableContainers, collisionRect } }) => {
|
|
11
|
-
if (directions.includes(event.code)) {
|
|
12
|
-
event.preventDefault();
|
|
13
|
-
if (!active || !collisionRect) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
const filteredContainers = [];
|
|
17
|
-
droppableContainers.getEnabled().forEach((entry) => {
|
|
18
|
-
if (!entry || entry?.disabled) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const rect = droppableRects.get(entry.id);
|
|
22
|
-
if (!rect) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
const data = entry.data.current;
|
|
26
|
-
if (data) {
|
|
27
|
-
const { type, children } = data;
|
|
28
|
-
if (type === "container" && children?.length > 0) {
|
|
29
|
-
if (active.data.current?.type !== "container") {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
switch (event.code) {
|
|
35
|
-
case core.KeyboardCode.Down:
|
|
36
|
-
if (collisionRect.top < rect.top) {
|
|
37
|
-
filteredContainers.push(entry);
|
|
38
|
-
}
|
|
39
|
-
break;
|
|
40
|
-
case core.KeyboardCode.Up:
|
|
41
|
-
if (collisionRect.top > rect.top) {
|
|
42
|
-
filteredContainers.push(entry);
|
|
43
|
-
}
|
|
44
|
-
break;
|
|
45
|
-
case core.KeyboardCode.Left:
|
|
46
|
-
if (collisionRect.left >= rect.left + rect.width) {
|
|
47
|
-
filteredContainers.push(entry);
|
|
48
|
-
}
|
|
49
|
-
break;
|
|
50
|
-
case core.KeyboardCode.Right:
|
|
51
|
-
if (collisionRect.left + collisionRect.width <= rect.left) {
|
|
52
|
-
filteredContainers.push(entry);
|
|
53
|
-
}
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
const collisions = core.closestCorners({
|
|
58
|
-
active,
|
|
59
|
-
collisionRect,
|
|
60
|
-
droppableRects,
|
|
61
|
-
droppableContainers: filteredContainers,
|
|
62
|
-
pointerCoordinates: null
|
|
63
|
-
});
|
|
64
|
-
const closestId = core.getFirstCollision(collisions, "id");
|
|
65
|
-
if (closestId != null) {
|
|
66
|
-
const newDroppable = droppableContainers.get(closestId);
|
|
67
|
-
const newNode = newDroppable?.node.current;
|
|
68
|
-
const newRect = newDroppable?.rect.current;
|
|
69
|
-
if (newNode && newRect) {
|
|
70
|
-
if (newDroppable.id === "placeholder") {
|
|
71
|
-
return {
|
|
72
|
-
x: newRect.left + (newRect.width - collisionRect.width) / 2,
|
|
73
|
-
y: newRect.top + (newRect.height - collisionRect.height) / 2
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
if (newDroppable.data.current?.type === "container") {
|
|
77
|
-
return {
|
|
78
|
-
x: newRect.left + 20,
|
|
79
|
-
y: newRect.top + 74
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
return {
|
|
83
|
-
x: newRect.left,
|
|
84
|
-
y: newRect.top
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return void 0;
|
|
90
|
-
};
|
|
91
|
-
exports.coordinateGetter = coordinateGetter;
|
|
92
|
-
//# sourceMappingURL=multipleContainersKeyboardCoordinates.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multipleContainersKeyboardCoordinates.cjs","sources":["../../../../../packages/react-board-dnd-kit/src/internal/multipleContainersKeyboardCoordinates.ts"],"sourcesContent":["/**\n * Copied from https://github.com/clauderic/dnd-kit/blob/master/stories/2%20-%20Presets/Sortable/multipleContainersKeyboardCoordinates.ts\n *\n * MIT License\n *\n * @copyright (c) 2021, Claudéric Demers\n *\n * see https://github.com/clauderic/dnd-kit/blob/master/LICENSE\n */\n\nimport {\n\tclosestCorners,\n\tgetFirstCollision,\n\tKeyboardCode,\n\tDroppableContainer,\n\tKeyboardCoordinateGetter,\n} from '@dnd-kit/core'\n\nconst directions: string[] = [\n\tKeyboardCode.Down,\n\tKeyboardCode.Right,\n\tKeyboardCode.Up,\n\tKeyboardCode.Left,\n]\n\nexport const coordinateGetter: KeyboardCoordinateGetter = (\n\tevent,\n\t{ context: { active, droppableRects, droppableContainers, collisionRect } },\n) => {\n\tif (directions.includes(event.code)) {\n\t\tevent.preventDefault()\n\n\t\tif (!active || !collisionRect) {\n\t\t\treturn\n\t\t}\n\n\t\tconst filteredContainers: DroppableContainer[] = []\n\n\t\tdroppableContainers.getEnabled().forEach(entry => {\n\t\t\tif (!entry || entry?.disabled) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst rect = droppableRects.get(entry.id)\n\n\t\t\tif (!rect) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst data = entry.data.current\n\n\t\t\tif (data) {\n\t\t\t\tconst { type, children } = data\n\n\t\t\t\tif (type === 'container' && children?.length > 0) {\n\t\t\t\t\tif (active.data.current?.type !== 'container') {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch (event.code) {\n\t\t\t\tcase KeyboardCode.Down:\n\t\t\t\t\tif (collisionRect.top < rect.top) {\n\t\t\t\t\t\tfilteredContainers.push(entry)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase KeyboardCode.Up:\n\t\t\t\t\tif (collisionRect.top > rect.top) {\n\t\t\t\t\t\tfilteredContainers.push(entry)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase KeyboardCode.Left:\n\t\t\t\t\tif (collisionRect.left >= rect.left + rect.width) {\n\t\t\t\t\t\tfilteredContainers.push(entry)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase KeyboardCode.Right:\n\t\t\t\t\tif (collisionRect.left + collisionRect.width <= rect.left) {\n\t\t\t\t\t\tfilteredContainers.push(entry)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t})\n\n\t\tconst collisions = closestCorners({\n\t\t\tactive,\n\t\t\tcollisionRect: collisionRect,\n\t\t\tdroppableRects,\n\t\t\tdroppableContainers: filteredContainers,\n\t\t\tpointerCoordinates: null,\n\t\t})\n\t\tconst closestId = getFirstCollision(collisions, 'id')\n\n\t\tif (closestId != null) {\n\t\t\tconst newDroppable = droppableContainers.get(closestId)\n\t\t\tconst newNode = newDroppable?.node.current\n\t\t\tconst newRect = newDroppable?.rect.current\n\n\t\t\tif (newNode && newRect) {\n\t\t\t\tif (newDroppable.id === 'placeholder') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tx: newRect.left + (newRect.width - collisionRect.width) / 2,\n\t\t\t\t\t\ty: newRect.top + (newRect.height - collisionRect.height) / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (newDroppable.data.current?.type === 'container') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tx: newRect.left + 20,\n\t\t\t\t\t\ty: newRect.top + 74,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tx: newRect.left,\n\t\t\t\t\ty: newRect.top,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn undefined\n}\n"],"names":["KeyboardCode","closestCorners","getFirstCollision"],"mappings":";;;AAkBA,MAAM,aAAuB;AAAA,EAC5BA,KAAAA,aAAa;AAAA,EACbA,KAAAA,aAAa;AAAA,EACbA,KAAAA,aAAa;AAAA,EACbA,kBAAa;AACd;AAEa,MAAA,mBAA6C,CACzD,OACA,EAAE,SAAS,EAAE,QAAQ,gBAAgB,qBAAqB,cAAc,QACpE;AACJ,MAAI,WAAW,SAAS,MAAM,IAAI,GAAG;AACpC,UAAM,eAAe;AAEjB,QAAA,CAAC,UAAU,CAAC,eAAe;AAC9B;AAAA,IAAA;AAGD,UAAM,qBAA2C,CAAC;AAE9B,wBAAA,WAAA,EAAa,QAAQ,CAAS,UAAA;AAC7C,UAAA,CAAC,SAAS,OAAO,UAAU;AAC9B;AAAA,MAAA;AAGD,YAAM,OAAO,eAAe,IAAI,MAAM,EAAE;AAExC,UAAI,CAAC,MAAM;AACV;AAAA,MAAA;AAGK,YAAA,OAAO,MAAM,KAAK;AAExB,UAAI,MAAM;AACH,cAAA,EAAE,MAAM,SAAA,IAAa;AAE3B,YAAI,SAAS,eAAe,UAAU,SAAS,GAAG;AACjD,cAAI,OAAO,KAAK,SAAS,SAAS,aAAa;AAC9C;AAAA,UAAA;AAAA,QACD;AAAA,MACD;AAGD,cAAQ,MAAM,MAAM;AAAA,QACnB,KAAKA,KAAa,aAAA;AACb,cAAA,cAAc,MAAM,KAAK,KAAK;AACjC,+BAAmB,KAAK,KAAK;AAAA,UAAA;AAE9B;AAAA,QACD,KAAKA,KAAa,aAAA;AACb,cAAA,cAAc,MAAM,KAAK,KAAK;AACjC,+BAAmB,KAAK,KAAK;AAAA,UAAA;AAE9B;AAAA,QACD,KAAKA,KAAa,aAAA;AACjB,cAAI,cAAc,QAAQ,KAAK,OAAO,KAAK,OAAO;AACjD,+BAAmB,KAAK,KAAK;AAAA,UAAA;AAE9B;AAAA,QACD,KAAKA,KAAa,aAAA;AACjB,cAAI,cAAc,OAAO,cAAc,SAAS,KAAK,MAAM;AAC1D,+BAAmB,KAAK,KAAK;AAAA,UAAA;AAE9B;AAAA,MAAA;AAAA,IACF,CACA;AAED,UAAM,aAAaC,KAAAA,eAAe;AAAA,MACjC;AAAA,MACA;AAAA,MACA;AAAA,MACA,qBAAqB;AAAA,MACrB,oBAAoB;AAAA,IAAA,CACpB;AACK,UAAA,YAAYC,KAAAA,kBAAkB,YAAY,IAAI;AAEpD,QAAI,aAAa,MAAM;AAChB,YAAA,eAAe,oBAAoB,IAAI,SAAS;AAChD,YAAA,UAAU,cAAc,KAAK;AAC7B,YAAA,UAAU,cAAc,KAAK;AAEnC,UAAI,WAAW,SAAS;AACnB,YAAA,aAAa,OAAO,eAAe;AAC/B,iBAAA;AAAA,YACN,GAAG,QAAQ,QAAQ,QAAQ,QAAQ,cAAc,SAAS;AAAA,YAC1D,GAAG,QAAQ,OAAO,QAAQ,SAAS,cAAc,UAAU;AAAA,UAC5D;AAAA,QAAA;AAGD,YAAI,aAAa,KAAK,SAAS,SAAS,aAAa;AAC7C,iBAAA;AAAA,YACN,GAAG,QAAQ,OAAO;AAAA,YAClB,GAAG,QAAQ,MAAM;AAAA,UAClB;AAAA,QAAA;AAGM,eAAA;AAAA,UACN,GAAG,QAAQ;AAAA,UACX,GAAG,QAAQ;AAAA,QACZ;AAAA,MAAA;AAAA,IACD;AAAA,EACD;AAGM,SAAA;AACR;;"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { KeyboardCode, closestCorners, getFirstCollision } from "@dnd-kit/core";
|
|
2
|
-
const directions = [
|
|
3
|
-
KeyboardCode.Down,
|
|
4
|
-
KeyboardCode.Right,
|
|
5
|
-
KeyboardCode.Up,
|
|
6
|
-
KeyboardCode.Left
|
|
7
|
-
];
|
|
8
|
-
const coordinateGetter = (event, { context: { active, droppableRects, droppableContainers, collisionRect } }) => {
|
|
9
|
-
if (directions.includes(event.code)) {
|
|
10
|
-
event.preventDefault();
|
|
11
|
-
if (!active || !collisionRect) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const filteredContainers = [];
|
|
15
|
-
droppableContainers.getEnabled().forEach((entry) => {
|
|
16
|
-
if (!entry || entry?.disabled) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const rect = droppableRects.get(entry.id);
|
|
20
|
-
if (!rect) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const data = entry.data.current;
|
|
24
|
-
if (data) {
|
|
25
|
-
const { type, children } = data;
|
|
26
|
-
if (type === "container" && children?.length > 0) {
|
|
27
|
-
if (active.data.current?.type !== "container") {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
switch (event.code) {
|
|
33
|
-
case KeyboardCode.Down:
|
|
34
|
-
if (collisionRect.top < rect.top) {
|
|
35
|
-
filteredContainers.push(entry);
|
|
36
|
-
}
|
|
37
|
-
break;
|
|
38
|
-
case KeyboardCode.Up:
|
|
39
|
-
if (collisionRect.top > rect.top) {
|
|
40
|
-
filteredContainers.push(entry);
|
|
41
|
-
}
|
|
42
|
-
break;
|
|
43
|
-
case KeyboardCode.Left:
|
|
44
|
-
if (collisionRect.left >= rect.left + rect.width) {
|
|
45
|
-
filteredContainers.push(entry);
|
|
46
|
-
}
|
|
47
|
-
break;
|
|
48
|
-
case KeyboardCode.Right:
|
|
49
|
-
if (collisionRect.left + collisionRect.width <= rect.left) {
|
|
50
|
-
filteredContainers.push(entry);
|
|
51
|
-
}
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
const collisions = closestCorners({
|
|
56
|
-
active,
|
|
57
|
-
collisionRect,
|
|
58
|
-
droppableRects,
|
|
59
|
-
droppableContainers: filteredContainers,
|
|
60
|
-
pointerCoordinates: null
|
|
61
|
-
});
|
|
62
|
-
const closestId = getFirstCollision(collisions, "id");
|
|
63
|
-
if (closestId != null) {
|
|
64
|
-
const newDroppable = droppableContainers.get(closestId);
|
|
65
|
-
const newNode = newDroppable?.node.current;
|
|
66
|
-
const newRect = newDroppable?.rect.current;
|
|
67
|
-
if (newNode && newRect) {
|
|
68
|
-
if (newDroppable.id === "placeholder") {
|
|
69
|
-
return {
|
|
70
|
-
x: newRect.left + (newRect.width - collisionRect.width) / 2,
|
|
71
|
-
y: newRect.top + (newRect.height - collisionRect.height) / 2
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
if (newDroppable.data.current?.type === "container") {
|
|
75
|
-
return {
|
|
76
|
-
x: newRect.left + 20,
|
|
77
|
-
y: newRect.top + 74
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
return {
|
|
81
|
-
x: newRect.left,
|
|
82
|
-
y: newRect.top
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return void 0;
|
|
88
|
-
};
|
|
89
|
-
export {
|
|
90
|
-
coordinateGetter
|
|
91
|
-
};
|
|
92
|
-
//# sourceMappingURL=multipleContainersKeyboardCoordinates.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multipleContainersKeyboardCoordinates.js","sources":["../../../../../packages/react-board-dnd-kit/src/internal/multipleContainersKeyboardCoordinates.ts"],"sourcesContent":["/**\n * Copied from https://github.com/clauderic/dnd-kit/blob/master/stories/2%20-%20Presets/Sortable/multipleContainersKeyboardCoordinates.ts\n *\n * MIT License\n *\n * @copyright (c) 2021, Claudéric Demers\n *\n * see https://github.com/clauderic/dnd-kit/blob/master/LICENSE\n */\n\nimport {\n\tclosestCorners,\n\tgetFirstCollision,\n\tKeyboardCode,\n\tDroppableContainer,\n\tKeyboardCoordinateGetter,\n} from '@dnd-kit/core'\n\nconst directions: string[] = [\n\tKeyboardCode.Down,\n\tKeyboardCode.Right,\n\tKeyboardCode.Up,\n\tKeyboardCode.Left,\n]\n\nexport const coordinateGetter: KeyboardCoordinateGetter = (\n\tevent,\n\t{ context: { active, droppableRects, droppableContainers, collisionRect } },\n) => {\n\tif (directions.includes(event.code)) {\n\t\tevent.preventDefault()\n\n\t\tif (!active || !collisionRect) {\n\t\t\treturn\n\t\t}\n\n\t\tconst filteredContainers: DroppableContainer[] = []\n\n\t\tdroppableContainers.getEnabled().forEach(entry => {\n\t\t\tif (!entry || entry?.disabled) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst rect = droppableRects.get(entry.id)\n\n\t\t\tif (!rect) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst data = entry.data.current\n\n\t\t\tif (data) {\n\t\t\t\tconst { type, children } = data\n\n\t\t\t\tif (type === 'container' && children?.length > 0) {\n\t\t\t\t\tif (active.data.current?.type !== 'container') {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch (event.code) {\n\t\t\t\tcase KeyboardCode.Down:\n\t\t\t\t\tif (collisionRect.top < rect.top) {\n\t\t\t\t\t\tfilteredContainers.push(entry)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase KeyboardCode.Up:\n\t\t\t\t\tif (collisionRect.top > rect.top) {\n\t\t\t\t\t\tfilteredContainers.push(entry)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase KeyboardCode.Left:\n\t\t\t\t\tif (collisionRect.left >= rect.left + rect.width) {\n\t\t\t\t\t\tfilteredContainers.push(entry)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\tcase KeyboardCode.Right:\n\t\t\t\t\tif (collisionRect.left + collisionRect.width <= rect.left) {\n\t\t\t\t\t\tfilteredContainers.push(entry)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t})\n\n\t\tconst collisions = closestCorners({\n\t\t\tactive,\n\t\t\tcollisionRect: collisionRect,\n\t\t\tdroppableRects,\n\t\t\tdroppableContainers: filteredContainers,\n\t\t\tpointerCoordinates: null,\n\t\t})\n\t\tconst closestId = getFirstCollision(collisions, 'id')\n\n\t\tif (closestId != null) {\n\t\t\tconst newDroppable = droppableContainers.get(closestId)\n\t\t\tconst newNode = newDroppable?.node.current\n\t\t\tconst newRect = newDroppable?.rect.current\n\n\t\t\tif (newNode && newRect) {\n\t\t\t\tif (newDroppable.id === 'placeholder') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tx: newRect.left + (newRect.width - collisionRect.width) / 2,\n\t\t\t\t\t\ty: newRect.top + (newRect.height - collisionRect.height) / 2,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (newDroppable.data.current?.type === 'container') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tx: newRect.left + 20,\n\t\t\t\t\t\ty: newRect.top + 74,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tx: newRect.left,\n\t\t\t\t\ty: newRect.top,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn undefined\n}\n"],"names":[],"mappings":";AAkBA,MAAM,aAAuB;AAAA,EAC5B,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AACd;AAEa,MAAA,mBAA6C,CACzD,OACA,EAAE,SAAS,EAAE,QAAQ,gBAAgB,qBAAqB,cAAc,QACpE;AACJ,MAAI,WAAW,SAAS,MAAM,IAAI,GAAG;AACpC,UAAM,eAAe;AAEjB,QAAA,CAAC,UAAU,CAAC,eAAe;AAC9B;AAAA,IAAA;AAGD,UAAM,qBAA2C,CAAC;AAE9B,wBAAA,WAAA,EAAa,QAAQ,CAAS,UAAA;AAC7C,UAAA,CAAC,SAAS,OAAO,UAAU;AAC9B;AAAA,MAAA;AAGD,YAAM,OAAO,eAAe,IAAI,MAAM,EAAE;AAExC,UAAI,CAAC,MAAM;AACV;AAAA,MAAA;AAGK,YAAA,OAAO,MAAM,KAAK;AAExB,UAAI,MAAM;AACH,cAAA,EAAE,MAAM,SAAA,IAAa;AAE3B,YAAI,SAAS,eAAe,UAAU,SAAS,GAAG;AACjD,cAAI,OAAO,KAAK,SAAS,SAAS,aAAa;AAC9C;AAAA,UAAA;AAAA,QACD;AAAA,MACD;AAGD,cAAQ,MAAM,MAAM;AAAA,QACnB,KAAK,aAAa;AACb,cAAA,cAAc,MAAM,KAAK,KAAK;AACjC,+BAAmB,KAAK,KAAK;AAAA,UAAA;AAE9B;AAAA,QACD,KAAK,aAAa;AACb,cAAA,cAAc,MAAM,KAAK,KAAK;AACjC,+BAAmB,KAAK,KAAK;AAAA,UAAA;AAE9B;AAAA,QACD,KAAK,aAAa;AACjB,cAAI,cAAc,QAAQ,KAAK,OAAO,KAAK,OAAO;AACjD,+BAAmB,KAAK,KAAK;AAAA,UAAA;AAE9B;AAAA,QACD,KAAK,aAAa;AACjB,cAAI,cAAc,OAAO,cAAc,SAAS,KAAK,MAAM;AAC1D,+BAAmB,KAAK,KAAK;AAAA,UAAA;AAE9B;AAAA,MAAA;AAAA,IACF,CACA;AAED,UAAM,aAAa,eAAe;AAAA,MACjC;AAAA,MACA;AAAA,MACA;AAAA,MACA,qBAAqB;AAAA,MACrB,oBAAoB;AAAA,IAAA,CACpB;AACK,UAAA,YAAY,kBAAkB,YAAY,IAAI;AAEpD,QAAI,aAAa,MAAM;AAChB,YAAA,eAAe,oBAAoB,IAAI,SAAS;AAChD,YAAA,UAAU,cAAc,KAAK;AAC7B,YAAA,UAAU,cAAc,KAAK;AAEnC,UAAI,WAAW,SAAS;AACnB,YAAA,aAAa,OAAO,eAAe;AAC/B,iBAAA;AAAA,YACN,GAAG,QAAQ,QAAQ,QAAQ,QAAQ,cAAc,SAAS;AAAA,YAC1D,GAAG,QAAQ,OAAO,QAAQ,SAAS,cAAc,UAAU;AAAA,UAC5D;AAAA,QAAA;AAGD,YAAI,aAAa,KAAK,SAAS,SAAS,aAAa;AAC7C,iBAAA;AAAA,YACN,GAAG,QAAQ,OAAO;AAAA,YAClB,GAAG,QAAQ,MAAM;AAAA,UAClB;AAAA,QAAA;AAGM,eAAA;AAAA,UACN,GAAG,QAAQ;AAAA,UACX,GAAG,QAAQ;AAAA,QACZ;AAAA,MAAA;AAAA,IACD;AAAA,EACD;AAGM,SAAA;AACR;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BoardSortable.d.ts","sourceRoot":"","sources":["../../../src/components/BoardSortable.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAkC,MAAM,OAAO,CAAA;AAsCxE,eAAO,MAAM,aAAa,GAAI,cAAc;IAC3C,QAAQ,EAAE,SAAS,CAAA;CACnB,4CAoEA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BoardSortableActivator.d.ts","sourceRoot":"","sources":["../../../src/components/BoardSortableActivator.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIxC,eAAO,MAAM,sBAAsB,GAAI,cAAc;IACpD,QAAQ,EAAE,SAAS,CAAA;CACnB,4CAGA,CAAA"}
|