@elliemae/ds-drag-and-drop 3.33.1 → 3.34.0-next.2
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/tree/types.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import type {\n Active,\n Announcements,\n CollisionDetection,\n DragCancelEvent,\n DragEndEvent,\n DragMoveEvent,\n DragOverEvent,\n DragStartEvent,\n DroppableContainers,\n MeasuringConfiguration,\n Modifier,\n Over,\n ClientRect,\n UniqueIdentifier,\n SensorDescriptor,\n SensorOptions,\n} from '@dnd-kit/core';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { SortingStrategy } from '@dnd-kit/sortable';\nimport type { RectMap } from '@dnd-kit/core/dist/store';\nimport type { Coordinates } from '@dnd-kit/core/dist/types';\nimport type { Dispatch, SetStateAction, MutableRefObject } from 'react';\nimport type { DropIndicatorPosition } from './constants.js';\n\nexport namespace DnDKitTree {\n export type DropIndicatorPositionValues = TypescriptHelpersT.ObjectValues<typeof DropIndicatorPosition>;\n\n export type Item<T> = {\n uid: UniqueIdentifier;\n depth: number;\n parentId: UniqueIdentifier | null;\n realIndex: number;\n childrenCount: number;\n original: T;\n container?: string;\n subitems: Item<T>[];\n index: number;\n collapsed?: boolean;\n };\n\n export type DragEventData = {\n dropIndicatorPosition: DropIndicatorPositionValues;\n };\n\n type OnDragStart = (e: DragStartEvent) => void;\n type OnDragMove = (e: DragMoveEvent) => void;\n type OnDragOver = (e: DragOverEvent) => void;\n type OnDragEnd = (e: DragEndEvent) => void;\n type OnDragCancel = (e: DragCancelEvent) => void;\n\n export type GetIsDropValid<T> = (\n active: Item<T>,\n over: Item<T>,\n dropIndicatorPosition: DropIndicatorPositionValues,\n ) => boolean;\n\n export type OnReorder<T> = (\n active: Item<T>,\n targetIndex: number,\n metadata: {\n over: Item<T>;\n fromIndex: number;\n considerExpanding: UniqueIdentifier | null;\n movedData: Record<string, Item<T>[]>;\n overContainer: UniqueIdentifier;\n projectedMove: {\n depth: number;\n parentId: UniqueIdentifier | null;\n position
|
|
4
|
+
"sourcesContent": ["import type {\n Active,\n Announcements,\n CollisionDetection,\n DragCancelEvent,\n DragEndEvent,\n DragMoveEvent,\n DragOverEvent,\n DragStartEvent,\n DroppableContainers,\n MeasuringConfiguration,\n Modifier,\n Over,\n ClientRect,\n UniqueIdentifier,\n SensorDescriptor,\n SensorOptions,\n} from '@dnd-kit/core';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type { SortingStrategy } from '@dnd-kit/sortable';\nimport type { RectMap } from '@dnd-kit/core/dist/store';\nimport type { Coordinates } from '@dnd-kit/core/dist/types';\nimport type { Dispatch, SetStateAction, MutableRefObject } from 'react';\nimport type { DropIndicatorPosition } from './constants.js';\n\nexport namespace DnDKitTree {\n export type DropIndicatorPositionValues = TypescriptHelpersT.ObjectValues<typeof DropIndicatorPosition>;\n\n export type Item<T> = {\n uid: UniqueIdentifier;\n depth: number;\n parentId: UniqueIdentifier | null;\n realIndex: number;\n childrenCount: number;\n original: T;\n container?: string;\n subitems: Item<T>[];\n index: number;\n collapsed?: boolean;\n };\n\n export type DragEventData = {\n dropIndicatorPosition: DropIndicatorPositionValues;\n };\n\n type OnDragStart = (e: DragStartEvent) => void;\n type OnDragMove = (e: DragMoveEvent) => void;\n type OnDragOver = (e: DragOverEvent) => void;\n type OnDragEnd = (e: DragEndEvent) => void;\n type OnDragCancel = (e: DragCancelEvent) => void;\n\n export type GetIsDropValid<T> = (\n active: Item<T>,\n over: Item<T>,\n dropIndicatorPosition: DropIndicatorPositionValues,\n ) => boolean;\n\n export type OnReorder<T> = (\n active: Item<T>,\n targetIndex: number,\n metadata: {\n over: Item<T>;\n fromIndex: number;\n considerExpanding: UniqueIdentifier | null;\n movedData: Record<string, Item<T>[]>;\n overContainer: UniqueIdentifier;\n projectedMove: {\n depth: number;\n parentId: UniqueIdentifier | null;\n position?: number;\n };\n flattenedItems: Record<string, Item<T>[]>;\n },\n ) => void;\n\n // =============================================================================\n // PREVIEW HANDLERS HOOK ARGUMENTS AND RETURN TYPES\n // =============================================================================\n\n export type UseTreePreviewHandlersArgs = {\n setActive: Dispatch<SetStateAction<Active | null>>;\n setOver: Dispatch<SetStateAction<Over | null>>;\n setDropIndicatorPosition: Dispatch<SetStateAction<DropIndicatorPositionValues>>;\n };\n\n export type UseTreePreviewHandlersReturn = {\n handlePreviewDragStart: OnDragStart;\n handlePreviewDragMove: OnDragMove;\n handlePreviewDragOver: OnDragOver;\n handlePreviewDragEnd: OnDragEnd;\n handlePreviewDragCancel: OnDragCancel;\n };\n\n // =============================================================================\n // ACTION HANDLERS HOOK ARGUMENTS AND RETURN TYPES\n // =============================================================================\n\n export type UseTreeActionHandlersArgs<T> = UseTreePreviewHandlersReturn & {\n dropIndicatorPosition: DropIndicatorPositionValues;\n flattenedItems: Record<string, Item<T>[]>;\n projected: {\n depth: number;\n parentId: UniqueIdentifier | null;\n position?: number;\n } | null;\n onReorder: OnReorder<T>;\n isDropValid: boolean;\n flattenedItemsDictionary: Record<UniqueIdentifier, Item<T>>;\n containersRef: React.MutableRefObject<UniqueIdentifier[]>;\n };\n\n export type UseTreeActionHandlersReturn = {\n onDragStart: OnDragStart;\n onDragMove: OnDragMove;\n onDragOver: OnDragOver;\n onDragEnd: OnDragEnd;\n onDragCancel: OnDragCancel;\n };\n\n // =============================================================================\n // DND, SORTABLE AND SENSOR CONTEXT PROPS TYPES\n // =============================================================================\n\n export type DndContextPropsType = {\n accessibility: { announcements: Announcements; container: HTMLElement };\n modifiers: Modifier[];\n sensors: SensorDescriptor<SensorOptions>[];\n measuring: Partial<MeasuringConfiguration>;\n collisionDetection: CollisionDetection;\n } & UseTreeActionHandlersReturn;\n\n export type SortableContextPropsType = {\n items: UniqueIdentifier[];\n strategy: SortingStrategy;\n };\n\n export type SensorContext<T> = MutableRefObject<{\n items: Record<string, Item<T>[]>;\n dropIndicatorPosition: DropIndicatorPositionValues;\n isHorizontalDnD: boolean;\n maxDragAndDropLevel: number;\n active: Active | null;\n flattenedItemsDictionary: Record<UniqueIdentifier, Item<T>>;\n containersRef: React.MutableRefObject<UniqueIdentifier[]>;\n }>;\n\n // =============================================================================\n // KEYBOARD GETTER TYPE\n // =============================================================================\n\n export type GetKeyboardCoordinatesArgs<T> = {\n flattenedItems: Record<string, Item<T>[]>;\n active: Active;\n over: Over;\n event: KeyboardEvent;\n currentCoordinates: Coordinates;\n droppableRects: RectMap;\n droppableContainers: DroppableContainers;\n collisionRect: ClientRect;\n dropIndicatorPosition: DropIndicatorPositionValues;\n maxDragAndDropLevel: number;\n flattenedItemsDictionary: Record<UniqueIdentifier, Item<T>>;\n };\n\n // =============================================================================\n // TREE DNDKIT HOOK ARGUMENTS AND RETURN TYPES\n // =============================================================================\n\n export type UseMultiTreeConfigArgs<T> = {\n flattenedItems: Record<string, Item<T>[]>;\n onReorder: OnReorder<T>;\n isHorizontalDnD?: boolean;\n isExpandable?: boolean;\n getIsDropValid?: GetIsDropValid<T>;\n maxDragAndDropLevel?: number;\n };\n\n export type UseTreeConfigArgs<T> = {\n flattenedItems: Record<string, Item<T>[]> | Omit<Item<T>, 'container'>[];\n onReorder: OnReorder<T>;\n isHorizontalDnD?: boolean;\n isExpandable?: boolean;\n getIsDropValid?: GetIsDropValid<T>;\n maxDragAndDropLevel?: number;\n };\n\n export type UseTreeConfigReturn<T> = {\n dndContextProps: DndContextPropsType;\n sortableContextProps: Record<string, SortableContextPropsType>;\n active: Active | null;\n activeItem: DnDKitTree.Item<T> | null;\n over: Over | null;\n overItem: DnDKitTree.Item<T> | null;\n dropIndicatorPosition: DropIndicatorPositionValues;\n isDropValid: boolean;\n };\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/tree/useTreeDndkitConfig.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { useMemo } from 'react';\nimport { useMultiTreeDndkitConfig } from './useMultiTreeDndkitConfig.js';\nimport type { DnDKitTree } from './types.js';\n\nexport const useTreeDndkitConfig = <T,>({\n flattenedItems: flattenedItemsProp,\n onReorder,\n isHorizontalDnD = false,\n isExpandable = false,\n getIsDropValid = () => true,\n maxDragAndDropLevel = Infinity,\n}: DnDKitTree.UseTreeConfigArgs<T>): DnDKitTree.UseTreeConfigReturn<T> => {\n const flattenedItems: Record<string, DnDKitTree.Item<T>[]> = useMemo(() => {\n if (Array.isArray(flattenedItemsProp)) {\n return {\n root: flattenedItemsProp,\n }
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { useMemo } from 'react';\nimport { useMultiTreeDndkitConfig } from './useMultiTreeDndkitConfig.js';\nimport type { DnDKitTree } from './types.js';\n\nexport const useTreeDndkitConfig = <T,>({\n flattenedItems: flattenedItemsProp,\n onReorder,\n isHorizontalDnD = false,\n isExpandable = false,\n getIsDropValid = () => true,\n maxDragAndDropLevel = Infinity,\n}: DnDKitTree.UseTreeConfigArgs<T>): DnDKitTree.UseTreeConfigReturn<T> => {\n const flattenedItems: Record<string, DnDKitTree.Item<T>[]> = useMemo(() => {\n if (Array.isArray(flattenedItemsProp)) {\n return {\n root: flattenedItemsProp,\n } as Record<string, DnDKitTree.Item<T>[]>;\n } else return flattenedItemsProp;\n }, [flattenedItemsProp]);\n\n return useMultiTreeDndkitConfig({\n flattenedItems,\n onReorder,\n isHorizontalDnD,\n isExpandable,\n getIsDropValid,\n maxDragAndDropLevel,\n });\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAwB;AACxB,sCAAyC;AAGlC,MAAM,sBAAsB,CAAK;AAAA,EACtC,gBAAgB;AAAA,EAChB;AAAA,EACA,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,iBAAiB,MAAM;AAAA,EACvB,sBAAsB;AACxB,MAA0E;AACxE,QAAM,qBAAuD,sBAAQ,MAAM;AACzE,QAAI,MAAM,QAAQ,kBAAkB,GAAG;AACrC,aAAO;AAAA,QACL,MAAM;AAAA,MACR;AAAA,IACF;AAAO,aAAO;AAAA,EAChB,GAAG,CAAC,kBAAkB,CAAC;AAEvB,aAAO,0DAAyB;AAAA,IAC9B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/tree/useTreeDndkitConfig.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { useMemo } from 'react';\nimport { useMultiTreeDndkitConfig } from './useMultiTreeDndkitConfig.js';\nimport type { DnDKitTree } from './types.js';\n\nexport const useTreeDndkitConfig = <T,>({\n flattenedItems: flattenedItemsProp,\n onReorder,\n isHorizontalDnD = false,\n isExpandable = false,\n getIsDropValid = () => true,\n maxDragAndDropLevel = Infinity,\n}: DnDKitTree.UseTreeConfigArgs<T>): DnDKitTree.UseTreeConfigReturn<T> => {\n const flattenedItems: Record<string, DnDKitTree.Item<T>[]> = useMemo(() => {\n if (Array.isArray(flattenedItemsProp)) {\n return {\n root: flattenedItemsProp,\n }
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable max-lines */\nimport { useMemo } from 'react';\nimport { useMultiTreeDndkitConfig } from './useMultiTreeDndkitConfig.js';\nimport type { DnDKitTree } from './types.js';\n\nexport const useTreeDndkitConfig = <T,>({\n flattenedItems: flattenedItemsProp,\n onReorder,\n isHorizontalDnD = false,\n isExpandable = false,\n getIsDropValid = () => true,\n maxDragAndDropLevel = Infinity,\n}: DnDKitTree.UseTreeConfigArgs<T>): DnDKitTree.UseTreeConfigReturn<T> => {\n const flattenedItems: Record<string, DnDKitTree.Item<T>[]> = useMemo(() => {\n if (Array.isArray(flattenedItemsProp)) {\n return {\n root: flattenedItemsProp,\n } as Record<string, DnDKitTree.Item<T>[]>;\n } else return flattenedItemsProp;\n }, [flattenedItemsProp]);\n\n return useMultiTreeDndkitConfig({\n flattenedItems,\n onReorder,\n isHorizontalDnD,\n isExpandable,\n getIsDropValid,\n maxDragAndDropLevel,\n });\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,eAAe;AACxB,SAAS,gCAAgC;AAGlC,MAAM,sBAAsB,CAAK;AAAA,EACtC,gBAAgB;AAAA,EAChB;AAAA,EACA,kBAAkB;AAAA,EAClB,eAAe;AAAA,EACf,iBAAiB,MAAM;AAAA,EACvB,sBAAsB;AACxB,MAA0E;AACxE,QAAM,iBAAuD,QAAQ,MAAM;AACzE,QAAI,MAAM,QAAQ,kBAAkB,GAAG;AACrC,aAAO;AAAA,QACL,MAAM;AAAA,MACR;AAAA,IACF;AAAO,aAAO;AAAA,EAChB,GAAG,CAAC,kBAAkB,CAAC;AAEvB,SAAO,yBAAyB;AAAA,IAC9B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -37,7 +37,7 @@ export declare namespace DnDKitTree {
|
|
|
37
37
|
projectedMove: {
|
|
38
38
|
depth: number;
|
|
39
39
|
parentId: UniqueIdentifier | null;
|
|
40
|
-
position
|
|
40
|
+
position?: number;
|
|
41
41
|
};
|
|
42
42
|
flattenedItems: Record<string, Item<T>[]>;
|
|
43
43
|
}) => void;
|
|
@@ -59,6 +59,7 @@ export declare namespace DnDKitTree {
|
|
|
59
59
|
projected: {
|
|
60
60
|
depth: number;
|
|
61
61
|
parentId: UniqueIdentifier | null;
|
|
62
|
+
position?: number;
|
|
62
63
|
} | null;
|
|
63
64
|
onReorder: OnReorder<T>;
|
|
64
65
|
isDropValid: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-drag-and-drop",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.34.0-next.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Drag And Drop",
|
|
6
6
|
"files": [
|
|
@@ -110,15 +110,15 @@
|
|
|
110
110
|
"@dnd-kit/core": "~6.0.8",
|
|
111
111
|
"@dnd-kit/modifiers": "~6.0.1",
|
|
112
112
|
"@dnd-kit/sortable": "~7.0.2",
|
|
113
|
-
"@elliemae/ds-fast-list": "3.
|
|
114
|
-
"@elliemae/ds-
|
|
115
|
-
"@elliemae/ds-
|
|
116
|
-
"@elliemae/ds-
|
|
113
|
+
"@elliemae/ds-fast-list": "3.34.0-next.2",
|
|
114
|
+
"@elliemae/ds-system": "3.34.0-next.2",
|
|
115
|
+
"@elliemae/ds-tree-model": "3.34.0-next.2",
|
|
116
|
+
"@elliemae/ds-typescript-helpers": "3.34.0-next.2"
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|
|
119
119
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
120
120
|
"styled-components": "~5.3.9",
|
|
121
|
-
"@elliemae/ds-monorepo-devops": "3.
|
|
121
|
+
"@elliemae/ds-monorepo-devops": "3.34.0-next.2"
|
|
122
122
|
},
|
|
123
123
|
"peerDependencies": {
|
|
124
124
|
"lodash": "^4.17.21",
|