treege 2.0.0 โ†’ 2.0.1

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/CHANGELOG.md CHANGED
@@ -1,29 +1,8 @@
1
1
  # [Versions](https://github.com/Tracktor/treege/releases)
2
2
 
3
- ## v2.0.0
3
+ ## v2.0.1
4
4
 
5
- ### ๐Ÿš€ New Features
5
+ ### ๐Ÿงน Chore
6
6
 
7
- - Introduced components to assign and receive values from ancestor nodes in tree-based forms, improving dynamic data binding and API parameterization.
8
- - Added an object mapping example component to aid in key path selection within nested objects.
9
-
10
- ### โœจ Enhancements
11
-
12
- - Redesigned form layouts with a responsive two-column grid and enhanced large modal handling.
13
- - Expanded English and French localization with detailed guidance on dynamic data, ancestor values, and API parameters.
14
- - Upgraded multiple dependencies to latest versions for improved stability and features.
15
-
16
- ### ๐Ÿ› Bug Fixes
17
-
18
- - Improved modal and dialog behaviors for better accessibility and consistency.
19
-
20
- ### ๐Ÿ”จ Refactor
21
-
22
- - Removed legacy components and utilities related to ancestor and tree name extraction.
23
- - Consolidated and simplified ancestor retrieval utilities.
24
- - Cleaned up ancestor references when removing nodes from the tree.
25
-
26
- ### ๐Ÿงน Chores
27
-
28
- - Deleted unused files and tests tied to deprecated tree utilities.
29
- - Added new tests validating updated ancestor retrieval and node removal functionality.
7
+ - Migration to React 19 and Vite v7.
8
+ - Updated dependencies and configuration for compatibility.
@@ -3,7 +3,7 @@ declare const useTree: () => {
3
3
  height: number;
4
4
  width: number;
5
5
  };
6
- refContainer: (ref: null | Element) => Element | null;
6
+ refContainer: (ref: null | HTMLDivElement) => void;
7
7
  translate: {
8
8
  x: number;
9
9
  y: number;
@@ -1,6 +1,7 @@
1
1
  import { CurrentTree, ModalType, TreeNode, TreePath } from '@tracktor/types-treege';
2
2
  import { HierarchyPointNode } from 'd3-hierarchy';
3
- import { ReactNode, ReducerAction, SetStateAction } from 'react';
3
+ import { Dispatch, ReactNode, SetStateAction } from 'react';
4
+ import { TreeReducerAction } from '../../../src/features/Treege/reducer/treeReducer';
4
5
  import { BackendConfig } from '../../../src/features/Treege/Treege';
5
6
  interface TreegeProviderProps {
6
7
  children: ReactNode;
@@ -55,15 +56,15 @@ export interface TreeDefaultValue {
55
56
  * This is the tree node dispatch function
56
57
  * @param state
57
58
  */
58
- dispatchTree(state: ReducerAction<any>): void;
59
+ dispatchTree: Dispatch<TreeReducerAction>;
59
60
  /**
60
61
  * This is the function to set the modal open state
61
62
  * @param state
62
63
  */
63
64
  setCurrentHierarchyPointNode(state: SetStateAction<null | HierarchyPointNode<TreeNode>>): void;
64
65
  /**
65
- * This is the function to set the current tree information
66
- * Not the node to display tree
66
+ * This is the function to set the current tree information,
67
+ * Not the node to display a tree
67
68
  * @param state
68
69
  */
69
70
  setCurrentTree(state: SetStateAction<CurrentTree>): void;
@@ -6,29 +6,30 @@ export declare const treeReducerActionType: {
6
6
  readonly resetTree: "resetTree";
7
7
  readonly setTree: "setTree";
8
8
  };
9
- export declare const appendTreeCard: (path: string | null, uuid: string, children: TreeNode) => {
10
- children: TreeNode;
9
+ export type TreeReducerAction = {
10
+ type: typeof treeReducerActionType.appendTreeCard;
11
11
  path: string | null;
12
- type: "appendTreeCard";
13
12
  uuid: string;
14
- };
15
- export declare const replaceTreeCard: (path: string | null, uuid: string, children: TreeNode) => {
16
13
  children: TreeNode;
17
- path: string | null;
18
- type: "replaceTreeCard";
14
+ } | {
15
+ type: typeof treeReducerActionType.deleteTreeCard;
16
+ path: string | "";
19
17
  uuid: string;
20
- };
21
- export declare const deleteTreeCard: (path: string | "", uuid: string) => {
22
- path: string;
23
- type: "deleteTreeCard";
18
+ } | {
19
+ type: typeof treeReducerActionType.replaceTreeCard;
20
+ path: string | null;
24
21
  uuid: string;
22
+ children: TreeNode;
23
+ } | {
24
+ type: typeof treeReducerActionType.resetTree;
25
+ } | {
26
+ type: typeof treeReducerActionType.setTree;
27
+ tree: TreeNode | null;
25
28
  };
26
- export declare const resetTree: () => {
27
- type: "resetTree";
28
- };
29
- export declare const setTree: (tree: TreeNode) => {
30
- tree: TreeNode;
31
- type: "setTree";
32
- };
33
- declare const treeReducer: (tree: TreeNode, action: any) => any;
29
+ export declare const appendTreeCard: (path: string | null, uuid: string, children: TreeNode) => TreeReducerAction;
30
+ export declare const replaceTreeCard: (path: string | null, uuid: string, children: TreeNode) => TreeReducerAction;
31
+ export declare const deleteTreeCard: (path: string | "", uuid: string) => TreeReducerAction;
32
+ export declare const resetTree: () => TreeReducerAction;
33
+ export declare const setTree: (tree: TreeNode | null) => TreeReducerAction;
34
+ declare const treeReducer: (tree: TreeNode | null, action: any) => any;
34
35
  export default treeReducer;