Skip to content

Commit

Permalink
chore(release): 1.3.1
Browse files Browse the repository at this point in the history
## [1.3.1](v1.3.0...v1.3.1) (2022-04-25)

### Bug Fixes

* fix node component failing to update on property changes ([#14](#14)) ([1bde4fd](1bde4fd))
  • Loading branch information
semantic-release-bot committed Apr 25, 2022
1 parent 1bde4fd commit 05b2353
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 150 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.3.1](https://github.com/jaredLunde/exploration/compare/v1.3.0...v1.3.1) (2022-04-25)


### Bug Fixes

* fix node component failing to update on property changes ([#14](https://github.com/jaredLunde/exploration/issues/14)) ([1bde4fd](https://github.com/jaredLunde/exploration/commit/1bde4fd0fc99bb8b8287dab6b6ac84e82da58612))

# [1.3.0](https://github.com/jaredLunde/exploration/compare/v1.2.0...v1.3.0) (2022-04-24)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "exploration",
"version": "1.3.0",
"version": "1.3.1",
"description": "",
"license": "MIT",
"author": "Jared Lunde <[email protected]> (https://jaredlunde.com/)",
Expand Down
2 changes: 1 addition & 1 deletion types/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

165 changes: 78 additions & 87 deletions types/use-dnd.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,96 +12,87 @@ import type { WindowRef } from "./types";
* @param config.dragOverExpandTimeout - Timeout for expanding a directory when a draggable
* element enters it.
*/
export declare function useDnd<Meta>(
fileTree: FileTree<Meta>,
config: UseDndConfig
): UseDndPlugin<Meta>;
export declare type DndEvent<Meta> =
| {
type: "start";
/**
* The node that is being dragged
*/
node: FileTreeNode<Meta>;
}
| {
type: "end";
/**
* The node that is being dragged
*/
node: FileTreeNode<Meta>;
}
| {
type: "enter";
/**
* The node that is being dragged
*/
node: FileTreeNode<Meta>;
/**
* The directory that the node is being dragged over
*/
dir: Dir<Meta>;
}
| {
type: "expanded";
/**
* The node that is being dragged
*/
node: FileTreeNode<Meta>;
/**
* The directory that the node is being dragged over
*/
dir: Dir<Meta>;
}
| {
type: "leave";
/**
* The node that is being dragged
*/
node: FileTreeNode<Meta>;
/**
* The directory that the node was being dragged over
*/
dir: Dir<Meta>;
}
| {
type: "drop";
/**
* The node that is being dragged
*/
node: FileTreeNode<Meta>;
/**
* The directory that the node is being dragged over
*/
dir: Dir<Meta>;
};
export declare function useDnd<Meta>(fileTree: FileTree<Meta>, config: UseDndConfig): UseDndPlugin<Meta>;
export declare type DndEvent<Meta> = {
type: "start";
/**
* The node that is being dragged
*/
node: FileTreeNode<Meta>;
} | {
type: "end";
/**
* The node that is being dragged
*/
node: FileTreeNode<Meta>;
} | {
type: "enter";
/**
* The node that is being dragged
*/
node: FileTreeNode<Meta>;
/**
* The directory that the node is being dragged over
*/
dir: Dir<Meta>;
} | {
type: "expanded";
/**
* The node that is being dragged
*/
node: FileTreeNode<Meta>;
/**
* The directory that the node is being dragged over
*/
dir: Dir<Meta>;
} | {
type: "leave";
/**
* The node that is being dragged
*/
node: FileTreeNode<Meta>;
/**
* The directory that the node was being dragged over
*/
dir: Dir<Meta>;
} | {
type: "drop";
/**
* The node that is being dragged
*/
node: FileTreeNode<Meta>;
/**
* The directory that the node is being dragged over
*/
dir: Dir<Meta>;
};
export interface DndProps {
draggable: true;
onDragStart: React.MouseEventHandler<HTMLElement>;
onDragEnd: React.MouseEventHandler<HTMLElement>;
onDragOver: React.MouseEventHandler<HTMLElement>;
onDragEnter: React.MouseEventHandler<HTMLElement>;
onDragLeave: React.MouseEventHandler<HTMLElement>;
onDrop: React.MouseEventHandler<HTMLElement>;
draggable: true;
onDragStart: React.MouseEventHandler<HTMLElement>;
onDragEnd: React.MouseEventHandler<HTMLElement>;
onDragOver: React.MouseEventHandler<HTMLElement>;
onDragEnter: React.MouseEventHandler<HTMLElement>;
onDragLeave: React.MouseEventHandler<HTMLElement>;
onDrop: React.MouseEventHandler<HTMLElement>;
}
export interface UseDndConfig {
/**
* Timeout for expanding a directory when a draggable element enters it.
*/
dragOverExpandTimeout?: number;
/**
* A React ref created by useRef() or an HTML element for the container viewport
* you're rendering the list inside of.
*/
windowRef: WindowRef;
/**
* Timeout for expanding a directory when a draggable element enters it.
*/
dragOverExpandTimeout?: number;
/**
* A React ref created by useRef() or an HTML element for the container viewport
* you're rendering the list inside of.
*/
windowRef: WindowRef;
}
export interface UseDndPlugin<Meta> {
/**
* A subject that emits drag 'n drop events.
*/
didChange: Subject<DndEvent<Meta> | null>;
/**
* Get the drag 'n drop props for a given node ID.
*/
getProps: (nodeId: number) => DndProps | React.HTMLAttributes<HTMLElement>;
/**
* A subject that emits drag 'n drop events.
*/
didChange: Subject<DndEvent<Meta> | null>;
/**
* Get the drag 'n drop props for a given node ID.
*/
getProps: (nodeId: number) => DndProps | React.HTMLAttributes<HTMLElement>;
}
25 changes: 11 additions & 14 deletions types/use-node-plugins.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,16 @@ import type { Subject } from "./tree/subject";
* return <div {...props}>...</div>
* ```
*/
export declare function useNodePlugins(
nodeId: number,
plugins?: NodePlugin[]
): React.HTMLAttributes<HTMLElement>;
export declare function useNodePlugins(nodeId: number, plugins?: NodePlugin[]): React.HTMLAttributes<HTMLElement>;
export declare type NodePlugin<T = unknown> = {
/**
* A subject that the `useNodePlugins()` hook will observe to.
*/
didChange: Subject<T>;
/**
* A function that returns React props based on a node ID.
*
* @param nodeId - The ID of a node in the file tree.
*/
getProps(nodeId: number): React.HTMLAttributes<HTMLElement>;
/**
* A subject that the `useNodePlugins()` hook will observe to.
*/
didChange: Subject<T>;
/**
* A function that returns React props based on a node ID.
*
* @param nodeId - The ID of a node in the file tree.
*/
getProps(nodeId: number): React.HTMLAttributes<HTMLElement>;
};
89 changes: 43 additions & 46 deletions types/use-selections.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,50 @@ import type { Subject } from "./tree/subject";
* nodes to this option. By default, `useVirtualize()` uses the nodes returned by
* `useVisibleNodes()`
*/
export declare function useSelections<Meta>(
fileTree: FileTree<Meta>,
nodes?: number[]
): UseSelectionsPlugin;
export declare function useSelections<Meta>(fileTree: FileTree<Meta>, nodes?: number[]): UseSelectionsPlugin;
export interface SelectionsProps {
onClick: React.MouseEventHandler<HTMLElement>;
onClick: React.MouseEventHandler<HTMLElement>;
}
export interface UseSelectionsPlugin {
/**
* A subject that you can use to observe to changes to selections.
*/
didChange: Subject<Set<number>>;
/**
* Get the React props for a given node ID.
*
* @param nodeId - A node ID
*/
getProps(nodeId: number): SelectionsProps;
/**
* The head of the selections list
*/
get head(): number | null;
/**
* The tail of the selections list
*/
get tail(): number | null;
/**
* Select given node ids
*
* @param nodeIds - Node IDs
*/
select(...nodeIds: number[]): void;
/**
* Deselect given node ids
*
* @param nodeIds - Node IDs
*/
deselect(...nodeIds: number[]): void;
/**
* Clear all of the selections
*/
clear(): void;
/**
* A utility function that yields nodes from a set of selections if they
* don't have a parent node in the set.
*
* @yields {number} - A node id
*/
narrow(): Generator<number, void, unknown>;
/**
* A subject that you can use to observe to changes to selections.
*/
didChange: Subject<Set<number>>;
/**
* Get the React props for a given node ID.
*
* @param nodeId - A node ID
*/
getProps(nodeId: number): SelectionsProps;
/**
* The head of the selections list
*/
get head(): number | null;
/**
* The tail of the selections list
*/
get tail(): number | null;
/**
* Select given node ids
*
* @param nodeIds - Node IDs
*/
select(...nodeIds: number[]): void;
/**
* Deselect given node ids
*
* @param nodeIds - Node IDs
*/
deselect(...nodeIds: number[]): void;
/**
* Clear all of the selections
*/
clear(): void;
/**
* A utility function that yields nodes from a set of selections if they
* don't have a parent node in the set.
*
* @yields {number} - A node id
*/
narrow(): Generator<number, void, unknown>;
}
1 change: 0 additions & 1 deletion types/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export declare function mergeProps<T extends Props[]>(args: T): UnionToIntersect
*/
export declare function chain<Args extends any[]>(...callbacks: Args): (...args: Args) => void;
export declare function throttle<CallbackArguments extends any[]>(callback: (...args: CallbackArguments) => void, fps?: number, leading?: boolean): (...args: CallbackArguments) => void;
export declare const perf: Performance | DateConstructor;
export declare function shallowEqual<A extends Record<string | number | symbol, unknown> | null, B extends Record<string | number | symbol, unknown> | null>(objA: A, objB: B | A): boolean;
interface Props {
[key: string]: any;
Expand Down

0 comments on commit 05b2353

Please sign in to comment.