@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.
Files changed (88) hide show
  1. package/package.json +13 -13
  2. package/src/components/RepeaterSortable.tsx +14 -2
  3. package/src/components/RepeaterSortableEachItem.tsx +0 -1
  4. package/src/contexts.ts +1 -1
  5. package/src/index.ts +0 -1
  6. package/dist/development/index.cjs +0 -27
  7. package/dist/development/index.cjs.map +0 -1
  8. package/dist/development/index.js +0 -21
  9. package/dist/development/index.js.map +0 -1
  10. package/dist/development/src/components/RepeaterSortable.cjs +0 -77
  11. package/dist/development/src/components/RepeaterSortable.cjs.map +0 -1
  12. package/dist/development/src/components/RepeaterSortable.js +0 -77
  13. package/dist/development/src/components/RepeaterSortable.js.map +0 -1
  14. package/dist/development/src/components/RepeaterSortableDragOverlay.cjs +0 -38
  15. package/dist/development/src/components/RepeaterSortableDragOverlay.cjs.map +0 -1
  16. package/dist/development/src/components/RepeaterSortableDragOverlay.js +0 -38
  17. package/dist/development/src/components/RepeaterSortableDragOverlay.js.map +0 -1
  18. package/dist/development/src/components/RepeaterSortableDropIndicator.cjs +0 -18
  19. package/dist/development/src/components/RepeaterSortableDropIndicator.cjs.map +0 -1
  20. package/dist/development/src/components/RepeaterSortableDropIndicator.js +0 -18
  21. package/dist/development/src/components/RepeaterSortableDropIndicator.js.map +0 -1
  22. package/dist/development/src/components/RepeaterSortableEachItem.cjs +0 -36
  23. package/dist/development/src/components/RepeaterSortableEachItem.cjs.map +0 -1
  24. package/dist/development/src/components/RepeaterSortableEachItem.js +0 -36
  25. package/dist/development/src/components/RepeaterSortableEachItem.js.map +0 -1
  26. package/dist/development/src/components/RepeaterSortableItemActivator.cjs +0 -17
  27. package/dist/development/src/components/RepeaterSortableItemActivator.cjs.map +0 -1
  28. package/dist/development/src/components/RepeaterSortableItemActivator.js +0 -17
  29. package/dist/development/src/components/RepeaterSortableItemActivator.js.map +0 -1
  30. package/dist/development/src/components/RepeaterSortableItemNode.cjs +0 -15
  31. package/dist/development/src/components/RepeaterSortableItemNode.cjs.map +0 -1
  32. package/dist/development/src/components/RepeaterSortableItemNode.js +0 -15
  33. package/dist/development/src/components/RepeaterSortableItemNode.js.map +0 -1
  34. package/dist/development/src/contexts.cjs +0 -14
  35. package/dist/development/src/contexts.cjs.map +0 -1
  36. package/dist/development/src/contexts.js +0 -14
  37. package/dist/development/src/contexts.js.map +0 -1
  38. package/dist/production/index.cjs +0 -27
  39. package/dist/production/index.cjs.map +0 -1
  40. package/dist/production/index.js +0 -21
  41. package/dist/production/index.js.map +0 -1
  42. package/dist/production/src/components/RepeaterSortable.cjs +0 -61
  43. package/dist/production/src/components/RepeaterSortable.cjs.map +0 -1
  44. package/dist/production/src/components/RepeaterSortable.js +0 -61
  45. package/dist/production/src/components/RepeaterSortable.js.map +0 -1
  46. package/dist/production/src/components/RepeaterSortableDragOverlay.cjs +0 -18
  47. package/dist/production/src/components/RepeaterSortableDragOverlay.cjs.map +0 -1
  48. package/dist/production/src/components/RepeaterSortableDragOverlay.js +0 -18
  49. package/dist/production/src/components/RepeaterSortableDragOverlay.js.map +0 -1
  50. package/dist/production/src/components/RepeaterSortableDropIndicator.cjs +0 -14
  51. package/dist/production/src/components/RepeaterSortableDropIndicator.cjs.map +0 -1
  52. package/dist/production/src/components/RepeaterSortableDropIndicator.js +0 -14
  53. package/dist/production/src/components/RepeaterSortableDropIndicator.js.map +0 -1
  54. package/dist/production/src/components/RepeaterSortableEachItem.cjs +0 -20
  55. package/dist/production/src/components/RepeaterSortableEachItem.cjs.map +0 -1
  56. package/dist/production/src/components/RepeaterSortableEachItem.js +0 -20
  57. package/dist/production/src/components/RepeaterSortableEachItem.js.map +0 -1
  58. package/dist/production/src/components/RepeaterSortableItemActivator.cjs +0 -13
  59. package/dist/production/src/components/RepeaterSortableItemActivator.cjs.map +0 -1
  60. package/dist/production/src/components/RepeaterSortableItemActivator.js +0 -13
  61. package/dist/production/src/components/RepeaterSortableItemActivator.js.map +0 -1
  62. package/dist/production/src/components/RepeaterSortableItemNode.cjs +0 -11
  63. package/dist/production/src/components/RepeaterSortableItemNode.cjs.map +0 -1
  64. package/dist/production/src/components/RepeaterSortableItemNode.js +0 -11
  65. package/dist/production/src/components/RepeaterSortableItemNode.js.map +0 -1
  66. package/dist/production/src/contexts.cjs +0 -14
  67. package/dist/production/src/contexts.cjs.map +0 -1
  68. package/dist/production/src/contexts.js +0 -14
  69. package/dist/production/src/contexts.js.map +0 -1
  70. package/dist/types/components/RepeaterSortable.d.ts +0 -37
  71. package/dist/types/components/RepeaterSortable.d.ts.map +0 -1
  72. package/dist/types/components/RepeaterSortableDragOverlay.d.ts +0 -8
  73. package/dist/types/components/RepeaterSortableDragOverlay.d.ts.map +0 -1
  74. package/dist/types/components/RepeaterSortableDropIndicator.d.ts +0 -9
  75. package/dist/types/components/RepeaterSortableDropIndicator.d.ts.map +0 -1
  76. package/dist/types/components/RepeaterSortableEachItem.d.ts +0 -9
  77. package/dist/types/components/RepeaterSortableEachItem.d.ts.map +0 -1
  78. package/dist/types/components/RepeaterSortableItemActivator.d.ts +0 -8
  79. package/dist/types/components/RepeaterSortableItemActivator.d.ts.map +0 -1
  80. package/dist/types/components/RepeaterSortableItemNode.d.ts +0 -8
  81. package/dist/types/components/RepeaterSortableItemNode.d.ts.map +0 -1
  82. package/dist/types/components/index.d.ts +0 -7
  83. package/dist/types/components/index.d.ts.map +0 -1
  84. package/dist/types/contexts.d.ts +0 -62
  85. package/dist/types/contexts.d.ts.map +0 -1
  86. package/dist/types/index.d.ts +0 -4
  87. package/dist/types/index.d.ts.map +0 -1
  88. 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"}
@@ -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"}
@@ -1,4 +0,0 @@
1
- export * from './components';
2
- export * from './contexts';
3
- export * from '@contember/react-repeater';
4
- //# sourceMappingURL=index.d.ts.map
@@ -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"}