Skip to content

Commit

Permalink
chore: bumps version
Browse files Browse the repository at this point in the history
  • Loading branch information
sashamilenkovic committed Jan 2, 2025
1 parent 9fe37cc commit 692e0e3
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 72 deletions.
5 changes: 1 addition & 4 deletions dist/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,6 @@ function dragAndDrop({
dragEffectAllowed: config.dragEffectAllowed ?? "move",
draggedNodes,
dragstartClasses,
deepCopyStyles: config.deepCopyStyles ?? false,
handleNodeKeydown,
handleParentKeydown,
handleDragstart,
Expand Down Expand Up @@ -2360,6 +2359,7 @@ function initSynthDrag(node, parent, e, _state, draggedNodes2) {
for (const node2 of draggedNodes2) {
const clonedNode = node2.el.cloneNode(true);
clonedNode.style.pointerEvents = "none";
clonedNode.style.margin = "0";
wrapper.append(clonedNode);
}
display = wrapper.style.display;
Expand Down Expand Up @@ -2444,12 +2444,9 @@ function moveNode(e, state2, scrollX2 = 0, scrollY2 = 0) {
state2.coordinates.x = x;
const startLeft = state2.startLeft ?? 0;
const startTop = state2.startTop ?? 0;
console.log("window scroll y", window.scrollY);
console.log("start top", startTop);
const translateX = x - startLeft + window.scrollX;
const translateY = y - startTop + window.scrollY;
state2.clonedDraggedNode.style.transform = `translate(${translateX + scrollX2}px, ${translateY + scrollY2}px)`;
console.log("translate y", translateY + scrollY2);
if (e.cancelable) pd(e);
pointermoveClasses(state2, state2.initialParent.data.config);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.cjs.map

Large diffs are not rendered by default.

27 changes: 17 additions & 10 deletions dist/index.d.cts
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,9 @@ interface ParentConfig<T> {
* Called when the value of the parent is changed and the nodes are remapped.
*/
tearDownNodeRemap: TearDownNode;
/**
* Property to identify the parent record who is the ancestor of the current parent.
*/
treeAncestor?: boolean;
/**
* Property to identify which group of tree descendants the current parent belongs to.
*/
treeGroup?: string;
/**
* The threshold for a drag to be considered a valid sort
* operation.
Expand All @@ -280,11 +275,6 @@ interface ParentConfig<T> {
* When a node receives focus, this class is applied to the node.
*/
synthActiveDescendantClass?: string;
/**
* Config option to allow recursive copying of computed styles of dragged
* element to the cloned one that will be dragged (only for synthetic drag).
*/
deepCopyStyles?: boolean;
/**
* Callback function for when a sort operation is performed.
*/
Expand Down Expand Up @@ -969,11 +959,28 @@ declare function setDragState<T>(dragStateProps: (SynthDragStateProps & DragStat
*/
declare function dragAndDrop<T>({ parent, getValues, setValues, config, }: DragAndDrop<T>): void;
declare function dragStateProps<T>(node: NodeRecord<T>, parent: ParentRecord<T>, e: PointerEvent | DragEvent, draggedNodes: Array<NodeRecord<T>>, offsetX?: number, offsetY?: number): DragStateProps<T>;
/**
* Perform the sort of the nodes.
*
* @param {ParentRecord<T>} parent - The parent record.
* @param {Array<NodeRecord<T>>} draggedNodes - The dragged nodes.
* @param {Array<NodeRecord<T>>} targetNodes - The target nodes.
*
* @returns void
*/
declare function performSort<T>({ parent, draggedNodes, targetNodes, }: {
parent: ParentRecord<T>;
draggedNodes: Array<NodeRecord<T>>;
targetNodes: Array<NodeRecord<T>>;
}): void;
/**
* Handle the parent focus event.
*
* @param {ParentEventData<T>} data - The parent event data.
* @param {BaseDragState<T> | DragState<T> | SynthDragState<T>} state - The drag state.
*
* @returns void
*/
declare function handleParentFocus<T>(data: ParentEventData<T>, state: BaseDragState<T> | DragState<T> | SynthDragState<T>): void;
/**
* Perform the transfer of the nodes.
Expand Down
27 changes: 17 additions & 10 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,9 @@ interface ParentConfig<T> {
* Called when the value of the parent is changed and the nodes are remapped.
*/
tearDownNodeRemap: TearDownNode;
/**
* Property to identify the parent record who is the ancestor of the current parent.
*/
treeAncestor?: boolean;
/**
* Property to identify which group of tree descendants the current parent belongs to.
*/
treeGroup?: string;
/**
* The threshold for a drag to be considered a valid sort
* operation.
Expand All @@ -280,11 +275,6 @@ interface ParentConfig<T> {
* When a node receives focus, this class is applied to the node.
*/
synthActiveDescendantClass?: string;
/**
* Config option to allow recursive copying of computed styles of dragged
* element to the cloned one that will be dragged (only for synthetic drag).
*/
deepCopyStyles?: boolean;
/**
* Callback function for when a sort operation is performed.
*/
Expand Down Expand Up @@ -969,11 +959,28 @@ declare function setDragState<T>(dragStateProps: (SynthDragStateProps & DragStat
*/
declare function dragAndDrop<T>({ parent, getValues, setValues, config, }: DragAndDrop<T>): void;
declare function dragStateProps<T>(node: NodeRecord<T>, parent: ParentRecord<T>, e: PointerEvent | DragEvent, draggedNodes: Array<NodeRecord<T>>, offsetX?: number, offsetY?: number): DragStateProps<T>;
/**
* Perform the sort of the nodes.
*
* @param {ParentRecord<T>} parent - The parent record.
* @param {Array<NodeRecord<T>>} draggedNodes - The dragged nodes.
* @param {Array<NodeRecord<T>>} targetNodes - The target nodes.
*
* @returns void
*/
declare function performSort<T>({ parent, draggedNodes, targetNodes, }: {
parent: ParentRecord<T>;
draggedNodes: Array<NodeRecord<T>>;
targetNodes: Array<NodeRecord<T>>;
}): void;
/**
* Handle the parent focus event.
*
* @param {ParentEventData<T>} data - The parent event data.
* @param {BaseDragState<T> | DragState<T> | SynthDragState<T>} state - The drag state.
*
* @returns void
*/
declare function handleParentFocus<T>(data: ParentEventData<T>, state: BaseDragState<T> | DragState<T> | SynthDragState<T>): void;
/**
* Perform the transfer of the nodes.
Expand Down
5 changes: 1 addition & 4 deletions dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,6 @@ function dragAndDrop({
dragEffectAllowed: config.dragEffectAllowed ?? "move",
draggedNodes,
dragstartClasses,
deepCopyStyles: config.deepCopyStyles ?? false,
handleNodeKeydown,
handleParentKeydown,
handleDragstart,
Expand Down Expand Up @@ -2271,6 +2270,7 @@ function initSynthDrag(node, parent, e, _state, draggedNodes2) {
for (const node2 of draggedNodes2) {
const clonedNode = node2.el.cloneNode(true);
clonedNode.style.pointerEvents = "none";
clonedNode.style.margin = "0";
wrapper.append(clonedNode);
}
display = wrapper.style.display;
Expand Down Expand Up @@ -2355,12 +2355,9 @@ function moveNode(e, state2, scrollX2 = 0, scrollY2 = 0) {
state2.coordinates.x = x;
const startLeft = state2.startLeft ?? 0;
const startTop = state2.startTop ?? 0;
console.log("window scroll y", window.scrollY);
console.log("start top", startTop);
const translateX = x - startLeft + window.scrollX;
const translateY = y - startTop + window.scrollY;
state2.clonedDraggedNode.style.transform = `translate(${translateX + scrollX2}px, ${translateY + scrollY2}px)`;
console.log("translate y", translateY + scrollY2);
if (e.cancelable) pd(e);
pointermoveClasses(state2, state2.initialParent.data.config);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.mjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@formkit/drag-and-drop",
"version": "0.2.6",
"version": "0.3.0",
"description": "Drag and drop package.",
"main": "./index.cjs",
"types": "./index.d.cts",
Expand Down
10 changes: 0 additions & 10 deletions dist/react/index.d.cts
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,9 @@ interface ParentConfig<T> {
* Called when the value of the parent is changed and the nodes are remapped.
*/
tearDownNodeRemap: TearDownNode;
/**
* Property to identify the parent record who is the ancestor of the current parent.
*/
treeAncestor?: boolean;
/**
* Property to identify which group of tree descendants the current parent belongs to.
*/
treeGroup?: string;
/**
* The threshold for a drag to be considered a valid sort
* operation.
Expand All @@ -261,11 +256,6 @@ interface ParentConfig<T> {
* When a node receives focus, this class is applied to the node.
*/
synthActiveDescendantClass?: string;
/**
* Config option to allow recursive copying of computed styles of dragged
* element to the cloned one that will be dragged (only for synthetic drag).
*/
deepCopyStyles?: boolean;
/**
* Callback function for when a sort operation is performed.
*/
Expand Down
10 changes: 0 additions & 10 deletions dist/react/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,9 @@ interface ParentConfig<T> {
* Called when the value of the parent is changed and the nodes are remapped.
*/
tearDownNodeRemap: TearDownNode;
/**
* Property to identify the parent record who is the ancestor of the current parent.
*/
treeAncestor?: boolean;
/**
* Property to identify which group of tree descendants the current parent belongs to.
*/
treeGroup?: string;
/**
* The threshold for a drag to be considered a valid sort
* operation.
Expand All @@ -261,11 +256,6 @@ interface ParentConfig<T> {
* When a node receives focus, this class is applied to the node.
*/
synthActiveDescendantClass?: string;
/**
* Config option to allow recursive copying of computed styles of dragged
* element to the cloned one that will be dragged (only for synthetic drag).
*/
deepCopyStyles?: boolean;
/**
* Callback function for when a sort operation is performed.
*/
Expand Down
10 changes: 0 additions & 10 deletions dist/vue/index.d.cts
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,9 @@ interface ParentConfig<T> {
* Called when the value of the parent is changed and the nodes are remapped.
*/
tearDownNodeRemap: TearDownNode;
/**
* Property to identify the parent record who is the ancestor of the current parent.
*/
treeAncestor?: boolean;
/**
* Property to identify which group of tree descendants the current parent belongs to.
*/
treeGroup?: string;
/**
* The threshold for a drag to be considered a valid sort
* operation.
Expand All @@ -261,11 +256,6 @@ interface ParentConfig<T> {
* When a node receives focus, this class is applied to the node.
*/
synthActiveDescendantClass?: string;
/**
* Config option to allow recursive copying of computed styles of dragged
* element to the cloned one that will be dragged (only for synthetic drag).
*/
deepCopyStyles?: boolean;
/**
* Callback function for when a sort operation is performed.
*/
Expand Down
10 changes: 0 additions & 10 deletions dist/vue/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,9 @@ interface ParentConfig<T> {
* Called when the value of the parent is changed and the nodes are remapped.
*/
tearDownNodeRemap: TearDownNode;
/**
* Property to identify the parent record who is the ancestor of the current parent.
*/
treeAncestor?: boolean;
/**
* Property to identify which group of tree descendants the current parent belongs to.
*/
treeGroup?: string;
/**
* The threshold for a drag to be considered a valid sort
* operation.
Expand All @@ -261,11 +256,6 @@ interface ParentConfig<T> {
* When a node receives focus, this class is applied to the node.
*/
synthActiveDescendantClass?: string;
/**
* Config option to allow recursive copying of computed styles of dragged
* element to the cloned one that will be dragged (only for synthetic drag).
*/
deepCopyStyles?: boolean;
/**
* Callback function for when a sort operation is performed.
*/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.2.6",
"version": "0.3.0",
"private": true,
"description": "Drag and drop package.",
"main": "./index.cjs",
Expand Down

0 comments on commit 692e0e3

Please sign in to comment.