@contember/react-repeater-dnd-kit 2.1.0-alpha.3 → 2.1.0-alpha.35
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 +13 -13
- package/src/components/RepeaterSortable.tsx +14 -2
- package/src/components/RepeaterSortableEachItem.tsx +0 -1
- package/src/contexts.ts +1 -1
- package/src/index.ts +0 -1
- package/dist/development/index.cjs +0 -27
- package/dist/development/index.cjs.map +0 -1
- package/dist/development/index.js +0 -21
- package/dist/development/index.js.map +0 -1
- package/dist/development/src/components/RepeaterSortable.cjs +0 -77
- package/dist/development/src/components/RepeaterSortable.cjs.map +0 -1
- package/dist/development/src/components/RepeaterSortable.js +0 -77
- package/dist/development/src/components/RepeaterSortable.js.map +0 -1
- package/dist/development/src/components/RepeaterSortableDragOverlay.cjs +0 -38
- package/dist/development/src/components/RepeaterSortableDragOverlay.cjs.map +0 -1
- package/dist/development/src/components/RepeaterSortableDragOverlay.js +0 -38
- package/dist/development/src/components/RepeaterSortableDragOverlay.js.map +0 -1
- package/dist/development/src/components/RepeaterSortableDropIndicator.cjs +0 -18
- package/dist/development/src/components/RepeaterSortableDropIndicator.cjs.map +0 -1
- package/dist/development/src/components/RepeaterSortableDropIndicator.js +0 -18
- package/dist/development/src/components/RepeaterSortableDropIndicator.js.map +0 -1
- package/dist/development/src/components/RepeaterSortableEachItem.cjs +0 -36
- package/dist/development/src/components/RepeaterSortableEachItem.cjs.map +0 -1
- package/dist/development/src/components/RepeaterSortableEachItem.js +0 -36
- package/dist/development/src/components/RepeaterSortableEachItem.js.map +0 -1
- package/dist/development/src/components/RepeaterSortableItemActivator.cjs +0 -17
- package/dist/development/src/components/RepeaterSortableItemActivator.cjs.map +0 -1
- package/dist/development/src/components/RepeaterSortableItemActivator.js +0 -17
- package/dist/development/src/components/RepeaterSortableItemActivator.js.map +0 -1
- package/dist/development/src/components/RepeaterSortableItemNode.cjs +0 -15
- package/dist/development/src/components/RepeaterSortableItemNode.cjs.map +0 -1
- package/dist/development/src/components/RepeaterSortableItemNode.js +0 -15
- package/dist/development/src/components/RepeaterSortableItemNode.js.map +0 -1
- package/dist/development/src/contexts.cjs +0 -14
- package/dist/development/src/contexts.cjs.map +0 -1
- package/dist/development/src/contexts.js +0 -14
- package/dist/development/src/contexts.js.map +0 -1
- package/dist/production/index.cjs +0 -27
- package/dist/production/index.cjs.map +0 -1
- package/dist/production/index.js +0 -21
- package/dist/production/index.js.map +0 -1
- package/dist/production/src/components/RepeaterSortable.cjs +0 -61
- package/dist/production/src/components/RepeaterSortable.cjs.map +0 -1
- package/dist/production/src/components/RepeaterSortable.js +0 -61
- package/dist/production/src/components/RepeaterSortable.js.map +0 -1
- package/dist/production/src/components/RepeaterSortableDragOverlay.cjs +0 -18
- package/dist/production/src/components/RepeaterSortableDragOverlay.cjs.map +0 -1
- package/dist/production/src/components/RepeaterSortableDragOverlay.js +0 -18
- package/dist/production/src/components/RepeaterSortableDragOverlay.js.map +0 -1
- package/dist/production/src/components/RepeaterSortableDropIndicator.cjs +0 -14
- package/dist/production/src/components/RepeaterSortableDropIndicator.cjs.map +0 -1
- package/dist/production/src/components/RepeaterSortableDropIndicator.js +0 -14
- package/dist/production/src/components/RepeaterSortableDropIndicator.js.map +0 -1
- package/dist/production/src/components/RepeaterSortableEachItem.cjs +0 -20
- package/dist/production/src/components/RepeaterSortableEachItem.cjs.map +0 -1
- package/dist/production/src/components/RepeaterSortableEachItem.js +0 -20
- package/dist/production/src/components/RepeaterSortableEachItem.js.map +0 -1
- package/dist/production/src/components/RepeaterSortableItemActivator.cjs +0 -13
- package/dist/production/src/components/RepeaterSortableItemActivator.cjs.map +0 -1
- package/dist/production/src/components/RepeaterSortableItemActivator.js +0 -13
- package/dist/production/src/components/RepeaterSortableItemActivator.js.map +0 -1
- package/dist/production/src/components/RepeaterSortableItemNode.cjs +0 -11
- package/dist/production/src/components/RepeaterSortableItemNode.cjs.map +0 -1
- package/dist/production/src/components/RepeaterSortableItemNode.js +0 -11
- package/dist/production/src/components/RepeaterSortableItemNode.js.map +0 -1
- package/dist/production/src/contexts.cjs +0 -14
- package/dist/production/src/contexts.cjs.map +0 -1
- package/dist/production/src/contexts.js +0 -14
- package/dist/production/src/contexts.js.map +0 -1
- package/dist/types/components/RepeaterSortable.d.ts +0 -37
- package/dist/types/components/RepeaterSortable.d.ts.map +0 -1
- package/dist/types/components/RepeaterSortableDragOverlay.d.ts +0 -8
- package/dist/types/components/RepeaterSortableDragOverlay.d.ts.map +0 -1
- package/dist/types/components/RepeaterSortableDropIndicator.d.ts +0 -9
- package/dist/types/components/RepeaterSortableDropIndicator.d.ts.map +0 -1
- package/dist/types/components/RepeaterSortableEachItem.d.ts +0 -9
- package/dist/types/components/RepeaterSortableEachItem.d.ts.map +0 -1
- package/dist/types/components/RepeaterSortableItemActivator.d.ts +0 -8
- package/dist/types/components/RepeaterSortableItemActivator.d.ts.map +0 -1
- package/dist/types/components/RepeaterSortableItemNode.d.ts +0 -8
- package/dist/types/components/RepeaterSortableItemNode.d.ts.map +0 -1
- package/dist/types/components/index.d.ts +0 -7
- package/dist/types/components/index.d.ts.map +0 -1
- package/dist/types/contexts.d.ts +0 -62
- package/dist/types/contexts.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -4
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/tsconfig.tsbuildinfo +0 -1
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { DndContextProps } from '@dnd-kit/core';
|
|
3
|
-
/**
|
|
4
|
-
* Initializes dnd-kit based sorting for the repeater.
|
|
5
|
-
* Using the props, you can customize the behavior of the sorting and hook into the drag events.
|
|
6
|
-
*
|
|
7
|
-
* ## Example
|
|
8
|
-
* ```tsx
|
|
9
|
-
* <Repeater {...}>
|
|
10
|
-
* <RepeaterSortable>
|
|
11
|
-
* <RepeaterSortableEachItem>
|
|
12
|
-
* <div>
|
|
13
|
-
* <RepeaterSortableDropIndicator position={'before'}><div>Drop here</div></RepeaterSortableDropIndicator>
|
|
14
|
-
* <RepeaterSortableItemNode>
|
|
15
|
-
* <div>
|
|
16
|
-
* <RepeaterSortableItemActivator>
|
|
17
|
-
* <span/>
|
|
18
|
-
* </RepeaterSortableItemActivator>
|
|
19
|
-
* {children}
|
|
20
|
-
* </div>
|
|
21
|
-
* </RepeaterSortableItemNode>
|
|
22
|
-
* <RepeaterSortableDropIndicator position={'afer'}><div>Drop here</div></RepeaterSortableDropIndicator>
|
|
23
|
-
* </div>
|
|
24
|
-
* </RepeaterSortableEachItem>
|
|
25
|
-
* <RepeaterSortableDragOverlay>
|
|
26
|
-
* <div>
|
|
27
|
-
* {children}
|
|
28
|
-
* </div>
|
|
29
|
-
* </RepeaterSortableDragOverlay>
|
|
30
|
-
* </RepeaterSortable>
|
|
31
|
-
* </Repeater>
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export declare const RepeaterSortable: ({ children, onDragStart, onDragEnd: onDragEndIn, onDragCancel: onDragCancelIn, ...props }: {
|
|
35
|
-
children: ReactNode;
|
|
36
|
-
} & DndContextProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
//# sourceMappingURL=RepeaterSortable.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RepeaterSortable.d.ts","sourceRoot":"","sources":["../../../src/components/RepeaterSortable.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAkC,MAAM,OAAO,CAAA;AAExE,OAAO,EAA6B,eAAe,EAAuI,MAAM,eAAe,CAAA;AAK/M;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,gBAAgB,GAAI,2FAA2F;IAC3H,QAAQ,EAAE,SAAS,CAAA;CACnB,GAAG,eAAe,4CA4DlB,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Component for rendering the repeater item being dragged.
|
|
4
|
-
*/
|
|
5
|
-
export declare const RepeaterSortableDragOverlay: ({ children }: {
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
-
//# sourceMappingURL=RepeaterSortableDragOverlay.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RepeaterSortableDragOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/RepeaterSortableDragOverlay.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOxC;;GAEG;AACH,eAAO,MAAM,2BAA2B,GAAI,cAAc;IACzD,QAAQ,EAAE,SAAS,CAAA;CACnB,mDAmBA,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Renders a child element when the repeater item is being dragged over the drop indicator.
|
|
4
|
-
*/
|
|
5
|
-
export declare const RepeaterSortableDropIndicator: ({ children, position }: {
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
position: "before" | "after";
|
|
8
|
-
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
-
//# sourceMappingURL=RepeaterSortableDropIndicator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RepeaterSortableDropIndicator.d.ts","sourceRoot":"","sources":["../../../src/components/RepeaterSortableDropIndicator.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGxC;;GAEG;AACH,eAAO,MAAM,6BAA6B,GAAI,wBAAwB;IACrE,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAA;CAC5B,mDAQA,CAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Iterates over all entities in the repeater and renders the children for each entity.
|
|
4
|
-
* Also sets up the dnd-kit sortable context for the repeater items.
|
|
5
|
-
*/
|
|
6
|
-
export declare const RepeaterSortableEachItem: ({ children }: {
|
|
7
|
-
children: ReactNode;
|
|
8
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
//# sourceMappingURL=RepeaterSortableEachItem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RepeaterSortableEachItem.d.ts","sourceRoot":"","sources":["../../../src/components/RepeaterSortableEachItem.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMxC;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GAAI,cAAc;IACtD,QAAQ,EAAE,SAAS,CAAA;CACnB,4CAaA,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Slot for the repeater item activator, which is the element that triggers the drag and drop interaction (e.g. a handle).
|
|
4
|
-
*/
|
|
5
|
-
export declare const RepeaterSortableItemActivator: React.ForwardRefExoticComponent<{
|
|
6
|
-
children: ReactElement;
|
|
7
|
-
} & React.RefAttributes<HTMLElement>>;
|
|
8
|
-
//# sourceMappingURL=RepeaterSortableItemActivator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RepeaterSortableItemActivator.d.ts","sourceRoot":"","sources":["../../../src/components/RepeaterSortableItemActivator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,YAAY,EAAa,MAAM,OAAO,CAAA;AAKlE;;GAEG;AACH,eAAO,MAAM,6BAA6B;cAC/B,YAAY;qCAIrB,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Slot for the repeater item node, which is the element that is being dragged.
|
|
4
|
-
*/
|
|
5
|
-
export declare const RepeaterSortableItemNode: ({ children }: {
|
|
6
|
-
children: ReactElement;
|
|
7
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
//# sourceMappingURL=RepeaterSortableItemNode.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RepeaterSortableItemNode.d.ts","sourceRoot":"","sources":["../../../src/components/RepeaterSortableItemNode.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAI3C;;GAEG;AACH,eAAO,MAAM,wBAAwB,GAAI,cAAc;IACtD,QAAQ,EAAE,YAAY,CAAA;CACtB,4CAGA,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from './RepeaterSortable';
|
|
2
|
-
export * from './RepeaterSortableDragOverlay';
|
|
3
|
-
export * from './RepeaterSortableDropIndicator';
|
|
4
|
-
export * from './RepeaterSortableItemActivator';
|
|
5
|
-
export * from './RepeaterSortableItemNode';
|
|
6
|
-
export * from './RepeaterSortableEachItem';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,4BAA4B,CAAA"}
|
package/dist/types/contexts.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { EntityAccessor } from '@contember/react-binding';
|
|
2
|
-
/** @internal */
|
|
3
|
-
export declare const RepeaterSortableItemContext: import("react").Context<{
|
|
4
|
-
active: import("@dnd-kit/core").Active | null;
|
|
5
|
-
activeIndex: number;
|
|
6
|
-
attributes: import("@dnd-kit/core").DraggableAttributes;
|
|
7
|
-
data: import("@dnd-kit/sortable").SortableData & {
|
|
8
|
-
[x: string]: any;
|
|
9
|
-
};
|
|
10
|
-
rect: import("react").MutableRefObject<import("@dnd-kit/core").ClientRect | null>;
|
|
11
|
-
index: number;
|
|
12
|
-
newIndex: number;
|
|
13
|
-
items: import("@dnd-kit/core").UniqueIdentifier[];
|
|
14
|
-
isOver: boolean;
|
|
15
|
-
isSorting: boolean;
|
|
16
|
-
isDragging: boolean;
|
|
17
|
-
listeners: import("@dnd-kit/core/dist/hooks/utilities").SyntheticListenerMap | undefined;
|
|
18
|
-
node: import("react").MutableRefObject<HTMLElement | null>;
|
|
19
|
-
overIndex: number;
|
|
20
|
-
over: import("@dnd-kit/core").Over | null;
|
|
21
|
-
setNodeRef: (node: HTMLElement | null) => void;
|
|
22
|
-
setActivatorNodeRef: (element: HTMLElement | null) => void;
|
|
23
|
-
setDroppableNodeRef: (element: HTMLElement | null) => void;
|
|
24
|
-
setDraggableNodeRef: (element: HTMLElement | null) => void;
|
|
25
|
-
transform: import("@dnd-kit/utilities").Transform | null;
|
|
26
|
-
transition: string | undefined;
|
|
27
|
-
}>;
|
|
28
|
-
/**
|
|
29
|
-
* Returns the sortable context from dnd-kit (e.g. isDragging, isOver, setNodeRef) for the repeater item.
|
|
30
|
-
*/
|
|
31
|
-
export declare const useRepeaterSortableItem: () => {
|
|
32
|
-
active: import("@dnd-kit/core").Active | null;
|
|
33
|
-
activeIndex: number;
|
|
34
|
-
attributes: import("@dnd-kit/core").DraggableAttributes;
|
|
35
|
-
data: import("@dnd-kit/sortable").SortableData & {
|
|
36
|
-
[x: string]: any;
|
|
37
|
-
};
|
|
38
|
-
rect: import("react").MutableRefObject<import("@dnd-kit/core").ClientRect | null>;
|
|
39
|
-
index: number;
|
|
40
|
-
newIndex: number;
|
|
41
|
-
items: import("@dnd-kit/core").UniqueIdentifier[];
|
|
42
|
-
isOver: boolean;
|
|
43
|
-
isSorting: boolean;
|
|
44
|
-
isDragging: boolean;
|
|
45
|
-
listeners: import("@dnd-kit/core/dist/hooks/utilities").SyntheticListenerMap | undefined;
|
|
46
|
-
node: import("react").MutableRefObject<HTMLElement | null>;
|
|
47
|
-
overIndex: number;
|
|
48
|
-
over: import("@dnd-kit/core").Over | null;
|
|
49
|
-
setNodeRef: (node: HTMLElement | null) => void;
|
|
50
|
-
setActivatorNodeRef: (element: HTMLElement | null) => void;
|
|
51
|
-
setDroppableNodeRef: (element: HTMLElement | null) => void;
|
|
52
|
-
setDraggableNodeRef: (element: HTMLElement | null) => void;
|
|
53
|
-
transform: import("@dnd-kit/utilities").Transform | null;
|
|
54
|
-
transition: string | undefined;
|
|
55
|
-
};
|
|
56
|
-
/** @internal */
|
|
57
|
-
export declare const RepeaterActiveEntityContext: import("react").Context<EntityAccessor | undefined>;
|
|
58
|
-
/**
|
|
59
|
-
* Returns the entity that is currently being dragged in the repeater.
|
|
60
|
-
*/
|
|
61
|
-
export declare const useRepeaterActiveEntity: () => EntityAccessor | undefined;
|
|
62
|
-
//# sourceMappingURL=contexts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../src/contexts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAIzD,gBAAgB;AAChB,eAAO,MAAM,2BAA2B;mBAUkB,eACxD;;uBAC+D,eACxD;;;;iBAAwG,OAAO,0BAA0B,eAAe;;;kBAAoF,eAAe;;;;sBAAsH,oCAAoC;iBAAsD,OAAO;;iBAAkF,eAAe;;;;;sBAA8R,oBAAoB;;EAbpyB,CAAA;AAC1E;;GAEG;AACH,eAAO,MAAM,uBAAuB;mBAMsB,eACxD;;uBAC+D,eACxD;;;;iBAAwG,OAAO,0BAA0B,eAAe;;;kBAAoF,eAAe;;;;sBAAsH,oCAAoC;iBAAsD,OAAO;;iBAAkF,eAAe;;;;;sBAA8R,oBAAoB;;CATxyB,CAAA;AAGtE,gBAAgB;AAChB,eAAO,MAAM,2BAA2B,qDAAkC,CAAA;AAC1E;;GAEG;AACH,eAAO,MAAM,uBAAuB,kCAAkC,CAAA"}
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAG1B,cAAc,2BAA2B,CAAA"}
|