ode-explorer 1.4.18 → 1.4.19-develop.202410251618
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/dist/index.html +48 -48
- package/dist/index.js +1387 -76618
- package/dist/version.txt +1 -1
- package/explorer.d.ts +1 -1
- package/lib/ActionBarContainer.js +175 -175
- package/lib/AppAction.js +26 -30
- package/lib/DeleteModal.js +8 -14
- package/lib/DraggableCard.js +25 -0
- package/lib/EmptyScreenApp.js +22 -25
- package/lib/ExportModal.js +24 -30
- package/lib/FolderModal.js +14 -18
- package/lib/FoldersList.js +84 -47
- package/lib/Library.js +25 -27
- package/lib/MoveModal.js +65 -56
- package/lib/ResourcesList.js +98 -81
- package/lib/components/EmptyScreens/EmptyScreenApp.d.ts +0 -1
- package/lib/components/EmptyScreens/EmptyScreenError.d.ts +0 -1
- package/lib/components/EmptyScreens/EmptyScreenNoContentInFolder.d.ts +0 -1
- package/lib/components/EmptyScreens/EmptyScreenSearch.d.ts +0 -1
- package/lib/components/Explorer.d.ts +1 -1
- package/lib/components/LoadMore.d.ts +1 -2
- package/lib/components/OnboardingModal.d.ts +1 -1
- package/lib/config/dndkit.d.ts +2 -0
- package/lib/config/{getExplorerConfig.d.ts → explorer.d.ts} +5 -1
- package/lib/config/index.d.ts +2 -0
- package/lib/features/AccessControl/AccessControl.d.ts +2 -2
- package/lib/features/AccessControl/useAccessControl.d.ts +1 -1
- package/lib/features/ActionBar/Delete/DeleteModal.d.ts +1 -2
- package/lib/features/ActionBar/Disable/DisableModal.d.ts +1 -2
- package/lib/features/ActionBar/Export/ExportModal.d.ts +1 -2
- package/lib/features/ActionBar/Folder/FolderModal.d.ts +1 -2
- package/lib/features/ActionBar/Folder/useFolderModal.d.ts +5 -5
- package/lib/features/ActionBar/Move/MoveModal.d.ts +1 -2
- package/lib/features/ActionBar/Move/useMoveModal.d.ts +3 -4
- package/lib/features/ActionBar/Publish/PublishModal.d.ts +1 -1
- package/lib/features/ActionBar/Resource/ResourceModal.d.ts +1 -1
- package/lib/features/ActionBar/Share/ShareModal.d.ts +1 -1
- package/lib/features/ActionBar/Trash/TrashModal.d.ts +1 -2
- package/lib/features/ActionBar/useActionBar.d.ts +2 -2
- package/lib/features/DndKit/useDndKit.d.ts +7 -0
- package/lib/features/List/DraggableCard.d.ts +6 -0
- package/lib/features/List/FolderCard.d.ts +8 -4
- package/lib/features/List/FoldersList.d.ts +2 -2
- package/lib/features/List/ResourceCard.d.ts +3 -3
- package/lib/features/List/ResourcesList.d.ts +2 -2
- package/lib/features/SearchForm/useSearchForm.d.ts +1 -2
- package/lib/i18n.d.ts +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +3 -12
- package/lib/index2.js +1018 -951
- package/lib/providers/index.d.ts +6 -0
- package/lib/services/api/index.d.ts +16 -16
- package/lib/services/queries/actions.d.ts +18 -0
- package/lib/services/queries/index.d.ts +46 -0
- package/lib/services/resource/service.d.ts +11 -0
- package/lib/store/index.d.ts +89 -35
- package/lib/utils/getChildrenIds.d.ts +2 -0
- package/lib/utils/isResourceShared.d.ts +1 -1
- package/package.json +52 -53
- package/lib/utils/TreeNodeFolderWrapper.d.ts +0 -12
- package/lib/utils/addNode.d.ts +0 -6
- package/lib/utils/deleteNode.d.ts +0 -4
- package/lib/utils/findNodeById.d.ts +0 -2
- package/lib/utils/getAncestors.d.ts +0 -2
- package/lib/utils/hasChildren.d.ts +0 -2
- package/lib/utils/modifyNode.d.ts +0 -2
- package/lib/utils/moveNode.d.ts +0 -5
- package/lib/utils/updateNode.d.ts +0 -6
- package/lib/utils/wrapTreeNode.d.ts +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ISearchParameters, ID, ShareRight, UpdateParameters, IFolder, CreateParameters, IActionParameters, GetContextParameters, PublishParameters } from 'edifice-ts-client';
|
|
2
2
|
/**
|
|
3
3
|
* searchContext API
|
|
4
4
|
* @param searchParams
|
|
@@ -6,11 +6,11 @@ import { type ISearchParameters, type ID, type ShareRight, type UpdateParameters
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const searchContext: (searchParams: GetContextParameters) => Promise<{
|
|
8
8
|
folders: IFolder[];
|
|
9
|
-
pagination: import(
|
|
10
|
-
resources: import(
|
|
9
|
+
pagination: import('edifice-ts-client').IPagination;
|
|
10
|
+
resources: import('edifice-ts-client').IResource[];
|
|
11
11
|
searchConfig?: {
|
|
12
12
|
minLength: number;
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
14
|
}>;
|
|
15
15
|
/**
|
|
16
16
|
* createFolder API
|
|
@@ -21,7 +21,7 @@ export declare const createFolder: ({ searchParams, name, parentId, }: {
|
|
|
21
21
|
searchParams: ISearchParameters & IActionParameters;
|
|
22
22
|
name: string;
|
|
23
23
|
parentId: ID;
|
|
24
|
-
}) => Promise<import(
|
|
24
|
+
}) => Promise<import('edifice-ts-client').CreateFolderResult>;
|
|
25
25
|
/**
|
|
26
26
|
* updateFolder API
|
|
27
27
|
* @param searchParams, folderId, parentId, name
|
|
@@ -32,7 +32,7 @@ export declare const updateFolder: ({ folderId, searchParams, parentId, name, }:
|
|
|
32
32
|
searchParams: ISearchParameters & IActionParameters;
|
|
33
33
|
parentId: ID;
|
|
34
34
|
name: string;
|
|
35
|
-
}) => Promise<import(
|
|
35
|
+
}) => Promise<import('edifice-ts-client').CreateFolderResult>;
|
|
36
36
|
/**
|
|
37
37
|
* trashAll API
|
|
38
38
|
* @param searchParams, resourceIds, folderIds
|
|
@@ -43,7 +43,7 @@ export declare const trashAll: ({ searchParams, resourceIds, useAssetIds, folder
|
|
|
43
43
|
resourceIds: ID[];
|
|
44
44
|
useAssetIds: boolean;
|
|
45
45
|
folderIds: ID[];
|
|
46
|
-
}) => Promise<import(
|
|
46
|
+
}) => Promise<import('edifice-ts-client').IActionResult>;
|
|
47
47
|
/**
|
|
48
48
|
* deleteAll API
|
|
49
49
|
* @param searchParams, resourceIds, folderIds
|
|
@@ -54,7 +54,7 @@ export declare const deleteAll: ({ searchParams, resourceIds, useAssetIds, folde
|
|
|
54
54
|
resourceIds: ID[];
|
|
55
55
|
useAssetIds: boolean;
|
|
56
56
|
folderIds: ID[];
|
|
57
|
-
}) => Promise<import(
|
|
57
|
+
}) => Promise<import('edifice-ts-client').IActionResult>;
|
|
58
58
|
/**
|
|
59
59
|
* restoreAll API
|
|
60
60
|
* @param searchParams, resourceIds, folderIds
|
|
@@ -65,14 +65,14 @@ export declare const restoreAll: ({ searchParams, resourceIds, folderIds, useAss
|
|
|
65
65
|
resourceIds: ID[];
|
|
66
66
|
useAssetIds: boolean;
|
|
67
67
|
folderIds: ID[];
|
|
68
|
-
}) => Promise<import(
|
|
68
|
+
}) => Promise<import('edifice-ts-client').IActionResult>;
|
|
69
69
|
/**
|
|
70
70
|
* copyResource API.
|
|
71
71
|
* @param searchParams searchParams to retrieve the application name.
|
|
72
72
|
* @param resourceId the resource id to copy.
|
|
73
73
|
* @returns copied ressource id and message.
|
|
74
74
|
*/
|
|
75
|
-
export declare const copyResource: (searchParams: ISearchParameters & IActionParameters, resourceId: ID) => Promise<import(
|
|
75
|
+
export declare const copyResource: (searchParams: ISearchParameters & IActionParameters, resourceId: ID) => Promise<import('edifice-ts-client').CopyResult>;
|
|
76
76
|
/**
|
|
77
77
|
* moveToFolder API
|
|
78
78
|
* @param searchParams, resourceIds, folderIds, folderId
|
|
@@ -84,7 +84,7 @@ export declare const moveToFolder: ({ searchParams, resourceIds, folderId, folde
|
|
|
84
84
|
resourceIds: ID[];
|
|
85
85
|
useAssetIds: boolean;
|
|
86
86
|
folderIds: ID[];
|
|
87
|
-
}) => Promise<import(
|
|
87
|
+
}) => Promise<import('edifice-ts-client').IActionResult>;
|
|
88
88
|
/**
|
|
89
89
|
* shareResource API
|
|
90
90
|
* @param searchParams, entId, shares
|
|
@@ -94,7 +94,7 @@ export declare const shareResource: ({ application, resourceId, rights, }: {
|
|
|
94
94
|
application: string;
|
|
95
95
|
resourceId: ID;
|
|
96
96
|
rights: ShareRight[];
|
|
97
|
-
}) => Promise<import(
|
|
97
|
+
}) => Promise<import('edifice-ts-client').PutShareResponse>;
|
|
98
98
|
/**
|
|
99
99
|
* updateResource API
|
|
100
100
|
* @param searchParams, params
|
|
@@ -103,7 +103,7 @@ export declare const shareResource: ({ application, resourceId, rights, }: {
|
|
|
103
103
|
export declare const updateResource: ({ application, params, }: {
|
|
104
104
|
application: string;
|
|
105
105
|
params: UpdateParameters;
|
|
106
|
-
}) => Promise<import(
|
|
106
|
+
}) => Promise<import('edifice-ts-client').UpdateResult>;
|
|
107
107
|
/**
|
|
108
108
|
* sessionHasWorkflowRights API
|
|
109
109
|
* @param actionRights
|
|
@@ -117,14 +117,14 @@ export declare const goToResource: ({ searchParams, assetId, }: {
|
|
|
117
117
|
export declare const createResource: ({ searchParams, params, }: {
|
|
118
118
|
searchParams: ISearchParameters & IActionParameters;
|
|
119
119
|
params: CreateParameters;
|
|
120
|
-
}) => Promise<import(
|
|
120
|
+
}) => Promise<import('edifice-ts-client').CreateResult>;
|
|
121
121
|
export declare const printResource: ({ searchParams, assetId, }: {
|
|
122
122
|
searchParams: ISearchParameters & IActionParameters;
|
|
123
123
|
assetId: ID;
|
|
124
124
|
}) => Window | null;
|
|
125
125
|
export declare const goToCreate: ({ searchParams, folderId, }: {
|
|
126
126
|
searchParams: ISearchParameters & IActionParameters;
|
|
127
|
-
folderId?:
|
|
127
|
+
folderId?: ID;
|
|
128
128
|
}) => Window | null;
|
|
129
129
|
export declare const goToEdit: ({ searchParams, assetId, }: {
|
|
130
130
|
searchParams: ISearchParameters & IActionParameters;
|
|
@@ -137,7 +137,7 @@ export declare const goToExport: ({ searchParams, assetId, }: {
|
|
|
137
137
|
export declare const publishResource: ({ searchParams, params, }: {
|
|
138
138
|
searchParams: ISearchParameters & IActionParameters;
|
|
139
139
|
params: PublishParameters;
|
|
140
|
-
}) => Promise<import(
|
|
140
|
+
}) => Promise<import('edifice-ts-client').PublishResult>;
|
|
141
141
|
/**
|
|
142
142
|
* getPreference API
|
|
143
143
|
* @returns check onboarding trash param
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IAction } from 'edifice-ts-client';
|
|
2
|
+
import { AppParams } from '../../config';
|
|
3
|
+
/**
|
|
4
|
+
* actionsQueryOptions: check action availability depending on workflow right
|
|
5
|
+
* @param actions (expects an array of actions)
|
|
6
|
+
* @returns queryOptions with key, fn, and selected data
|
|
7
|
+
*/
|
|
8
|
+
export declare const actionsQueryOptions: (actions: IAction[], config: AppParams | undefined) => import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<Record<string, boolean>, Error, IAction[], string[]>, "queryFn"> & {
|
|
9
|
+
queryFn?: import('@tanstack/react-query').QueryFunction<Record<string, boolean>, string[], never> | undefined;
|
|
10
|
+
} & {
|
|
11
|
+
queryKey: import('@tanstack/react-query').DataTag<string[], Record<string, boolean>>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* useActions query
|
|
15
|
+
* set actions correctly with workflow rights
|
|
16
|
+
* @returns actions data
|
|
17
|
+
*/
|
|
18
|
+
export declare const useActions: (actions: IAction[]) => import('@tanstack/react-query').UseQueryResult<IAction[], Error>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { UseMutationOptions, UseMutationResult, InfiniteData } from '@tanstack/react-query';
|
|
2
|
+
import { CreateParameters, PutShareResponse, UpdateParameters, UpdateResult, IResource, ISearchResults, ShareRight } from 'edifice-ts-client';
|
|
3
|
+
export * from './actions';
|
|
4
|
+
/**
|
|
5
|
+
* useSearchContext query
|
|
6
|
+
* update state according to currentFolder ID
|
|
7
|
+
* @returns infinite query to load resources
|
|
8
|
+
*/
|
|
9
|
+
export declare const useSearchContext: () => import('@tanstack/react-query').UseInfiniteQueryResult<InfiniteData<ISearchResults, unknown>, Error>;
|
|
10
|
+
/**
|
|
11
|
+
* useTrash query
|
|
12
|
+
* Optimistic UI when resource or folder is trashed
|
|
13
|
+
*/
|
|
14
|
+
export declare const useTrash: () => UseMutationResult<import('edifice-ts-client').IActionResult, Error, void, unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* useRestore query
|
|
17
|
+
* Optimistic UI when resource is restored
|
|
18
|
+
*/
|
|
19
|
+
export declare const useRestore: () => UseMutationResult<import('edifice-ts-client').IActionResult, Error, void, unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* useDelete query
|
|
22
|
+
* Optimistic UI when resource is deleted
|
|
23
|
+
*/
|
|
24
|
+
export declare const useDelete: () => UseMutationResult<import('edifice-ts-client').IActionResult, Error, void, unknown>;
|
|
25
|
+
/**
|
|
26
|
+
* useCopyResource query.
|
|
27
|
+
* Optimistic UI when resource is copied.
|
|
28
|
+
*/
|
|
29
|
+
export declare const useCopyResource: () => UseMutationResult<import('edifice-ts-client').CopyResult, Error, IResource, unknown>;
|
|
30
|
+
export declare const useMoveItem: () => UseMutationResult<import('edifice-ts-client').IActionResult, Error, string, unknown>;
|
|
31
|
+
export declare const useCreateFolder: () => UseMutationResult<import('edifice-ts-client').CreateFolderResult, Error, {
|
|
32
|
+
name: string;
|
|
33
|
+
parentId: string;
|
|
34
|
+
}, unknown>;
|
|
35
|
+
export declare const useUpdatefolder: () => UseMutationResult<import('edifice-ts-client').CreateFolderResult, Error, {
|
|
36
|
+
folderId: string;
|
|
37
|
+
name: string;
|
|
38
|
+
parentId: string;
|
|
39
|
+
}, unknown>;
|
|
40
|
+
export declare const useShareResource: (application: string) => UseMutationResult<PutShareResponse, Error, {
|
|
41
|
+
resourceId: string;
|
|
42
|
+
rights: ShareRight[];
|
|
43
|
+
}>;
|
|
44
|
+
export declare const useUpdateResource: (application: string) => UseMutationResult<UpdateResult, Error, UpdateParameters>;
|
|
45
|
+
export declare const useCustomMutation: <TData = unknown, TError = unknown, TVariables = void, TContext = unknown>(options: UseMutationOptions<TData, TError, TVariables, TContext>) => UseMutationResult<TData, TError, TVariables, TContext>;
|
|
46
|
+
export declare const useCreateResource: () => UseMutationResult<import('edifice-ts-client').CreateResult, Error, CreateParameters, unknown>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BlogUpdate, CreateParameters, CreateResult, ResourceService, ResourceType, UpdateResult } from 'edifice-ts-client';
|
|
2
|
+
export declare class BlogResourceService extends ResourceService {
|
|
3
|
+
getEditUrl(): string;
|
|
4
|
+
create(parameters: CreateParameters): Promise<CreateResult>;
|
|
5
|
+
update(parameters: BlogUpdate): Promise<UpdateResult>;
|
|
6
|
+
getResourceType(): ResourceType;
|
|
7
|
+
getApplication(): string;
|
|
8
|
+
getFormUrl(folderId?: string): string;
|
|
9
|
+
getViewUrl(resourceId: string): string;
|
|
10
|
+
getPrintUrl(resourceId: string): string;
|
|
11
|
+
}
|
package/lib/store/index.d.ts
CHANGED
|
@@ -1,100 +1,154 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { TreeData } from '@edifice-ui/react';
|
|
2
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
3
|
+
import { IActionParameters, ID, IFolder, IResource, ISearchParameters } from 'edifice-ts-client';
|
|
4
|
+
import { useStore } from 'zustand';
|
|
5
|
+
import { AppParams } from '../config';
|
|
6
|
+
export type ExtractState<S> = S extends {
|
|
7
|
+
getState: () => infer T;
|
|
8
|
+
} ? T : never;
|
|
9
|
+
type Params<U> = Parameters<typeof useStore<typeof store, U>>;
|
|
10
|
+
interface ElementDrag {
|
|
11
|
+
isDrag: boolean;
|
|
12
|
+
elementDrag: ID | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface ElementOver {
|
|
15
|
+
isOver: boolean;
|
|
16
|
+
isTreeview: boolean;
|
|
17
|
+
canMove?: boolean;
|
|
18
|
+
overId: ID | undefined;
|
|
19
|
+
}
|
|
20
|
+
type State = {
|
|
21
|
+
config: AppParams | undefined;
|
|
7
22
|
searchParams: ISearchParameters & IActionParameters;
|
|
8
|
-
treeData:
|
|
9
|
-
|
|
23
|
+
treeData: TreeData;
|
|
24
|
+
selectedNodeId: string | undefined;
|
|
10
25
|
currentFolder: Partial<IFolder>;
|
|
11
26
|
selectedFolders: IFolder[];
|
|
12
27
|
selectedResources: IResource[];
|
|
13
28
|
folderIds: ID[];
|
|
14
29
|
resourceIds: ID[];
|
|
15
30
|
resourceIsTrash: boolean;
|
|
31
|
+
resourceOrFolderIsDraggable: ElementDrag;
|
|
32
|
+
elementDragOver: ElementOver;
|
|
16
33
|
resourceActionDisable: boolean;
|
|
17
34
|
searchConfig: {
|
|
18
35
|
minLength: number;
|
|
19
36
|
};
|
|
20
37
|
status: string | undefined;
|
|
21
|
-
}
|
|
38
|
+
};
|
|
22
39
|
type Action = {
|
|
23
|
-
|
|
40
|
+
actions: {
|
|
24
41
|
setConfig: (config: AppParams) => void;
|
|
25
42
|
setSearchConfig: (config: {
|
|
26
43
|
minLength: number;
|
|
27
44
|
}) => void;
|
|
28
|
-
setTreeData: (treeData:
|
|
45
|
+
setTreeData: (treeData: TreeData) => void;
|
|
29
46
|
setSearchParams: (searchParams: Partial<ISearchParameters & IActionParameters>) => void;
|
|
30
|
-
setCurrentFolder: (folder: Partial<IFolder>) => void;
|
|
31
47
|
setSelectedFolders: (selectedFolders: IFolder[]) => void;
|
|
32
48
|
setSelectedResources: (selectedResources: IResource[]) => void;
|
|
33
49
|
setFolderIds: (folderIds: ID[]) => void;
|
|
34
50
|
setResourceIds: (resourceIds: ID[]) => void;
|
|
35
51
|
setResourceIsTrash: (resourceIsTrash: boolean) => void;
|
|
52
|
+
setResourceOrFolderIsDraggable: (resourceOrFolderIsDraggable: ElementDrag) => void;
|
|
53
|
+
setElementDragOver: (elementDragOver: ElementOver) => void;
|
|
36
54
|
setResourceActionDisable: (resourceActionDisable: boolean) => void;
|
|
37
55
|
clearSelectedItems: () => void;
|
|
38
56
|
clearSelectedIds: () => void;
|
|
39
57
|
openResource: (resource: IResource) => void;
|
|
40
58
|
printSelectedResource: () => void;
|
|
41
|
-
openFolder: ({ folderId, folder, }: {
|
|
59
|
+
openFolder: ({ folderId, folder, queryClient, }: {
|
|
42
60
|
folderId: ID;
|
|
43
61
|
folder?: IFolder;
|
|
62
|
+
queryClient?: QueryClient;
|
|
44
63
|
}) => void;
|
|
45
64
|
foldTreeItem: (folderId: string) => void;
|
|
46
|
-
selectTreeItem: (folderId: string) => void;
|
|
47
|
-
|
|
65
|
+
selectTreeItem: (folderId: string, queryClient: QueryClient) => void;
|
|
66
|
+
fetchTreeData: (folderId: string, queryClient: QueryClient) => Promise<void>;
|
|
48
67
|
gotoPreviousFolder: () => void;
|
|
49
68
|
goToTrash: () => void;
|
|
50
69
|
};
|
|
51
70
|
};
|
|
52
|
-
|
|
53
|
-
export declare
|
|
54
|
-
export declare const
|
|
55
|
-
export declare const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
71
|
+
declare const store: import('zustand').StoreApi<State & Action>;
|
|
72
|
+
export declare function useStoreContext<U>(selector: Params<U>[1]): U;
|
|
73
|
+
export declare const getTreeData: () => TreeData;
|
|
74
|
+
export declare const getStoreActions: () => {
|
|
75
|
+
setConfig: (config: AppParams) => void;
|
|
76
|
+
setSearchConfig: (config: {
|
|
77
|
+
minLength: number;
|
|
78
|
+
}) => void;
|
|
79
|
+
setTreeData: (treeData: TreeData) => void;
|
|
80
|
+
setSearchParams: (searchParams: Partial<ISearchParameters & IActionParameters>) => void;
|
|
81
|
+
setSelectedFolders: (selectedFolders: IFolder[]) => void;
|
|
82
|
+
setSelectedResources: (selectedResources: IResource[]) => void;
|
|
83
|
+
setFolderIds: (folderIds: ID[]) => void;
|
|
84
|
+
setResourceIds: (resourceIds: ID[]) => void;
|
|
85
|
+
setResourceIsTrash: (resourceIsTrash: boolean) => void;
|
|
86
|
+
setResourceOrFolderIsDraggable: (resourceOrFolderIsDraggable: ElementDrag) => void;
|
|
87
|
+
setElementDragOver: (elementDragOver: ElementOver) => void;
|
|
88
|
+
setResourceActionDisable: (resourceActionDisable: boolean) => void;
|
|
89
|
+
clearSelectedItems: () => void;
|
|
90
|
+
clearSelectedIds: () => void;
|
|
91
|
+
openResource: (resource: IResource) => void;
|
|
92
|
+
printSelectedResource: () => void;
|
|
93
|
+
openFolder: ({ folderId, folder, queryClient, }: {
|
|
94
|
+
folderId: ID;
|
|
95
|
+
folder?: IFolder;
|
|
96
|
+
queryClient?: QueryClient;
|
|
97
|
+
}) => void;
|
|
98
|
+
foldTreeItem: (folderId: string) => void;
|
|
99
|
+
selectTreeItem: (folderId: string, queryClient: QueryClient) => void;
|
|
100
|
+
fetchTreeData: (folderId: string, queryClient: QueryClient) => Promise<void>;
|
|
101
|
+
gotoPreviousFolder: () => void;
|
|
102
|
+
goToTrash: () => void;
|
|
60
103
|
};
|
|
61
|
-
export declare const
|
|
62
|
-
export declare const useResourceIds: () => string[];
|
|
63
|
-
export declare const useResourceAssetIds: () => string[];
|
|
64
|
-
export declare const useResourceWithoutIds: () => IResource[];
|
|
65
|
-
export declare const useCurrentFolder: () => Partial<IFolder>;
|
|
104
|
+
export declare const useTreeData: () => TreeData;
|
|
66
105
|
export declare const useStoreActions: () => {
|
|
67
106
|
setConfig: (config: AppParams) => void;
|
|
68
107
|
setSearchConfig: (config: {
|
|
69
108
|
minLength: number;
|
|
70
109
|
}) => void;
|
|
71
|
-
setTreeData: (treeData:
|
|
110
|
+
setTreeData: (treeData: TreeData) => void;
|
|
72
111
|
setSearchParams: (searchParams: Partial<ISearchParameters & IActionParameters>) => void;
|
|
73
|
-
setCurrentFolder: (folder: Partial<IFolder>) => void;
|
|
74
112
|
setSelectedFolders: (selectedFolders: IFolder[]) => void;
|
|
75
113
|
setSelectedResources: (selectedResources: IResource[]) => void;
|
|
76
114
|
setFolderIds: (folderIds: ID[]) => void;
|
|
77
115
|
setResourceIds: (resourceIds: ID[]) => void;
|
|
78
116
|
setResourceIsTrash: (resourceIsTrash: boolean) => void;
|
|
117
|
+
setResourceOrFolderIsDraggable: (resourceOrFolderIsDraggable: ElementDrag) => void;
|
|
118
|
+
setElementDragOver: (elementDragOver: ElementOver) => void;
|
|
79
119
|
setResourceActionDisable: (resourceActionDisable: boolean) => void;
|
|
80
120
|
clearSelectedItems: () => void;
|
|
81
121
|
clearSelectedIds: () => void;
|
|
82
122
|
openResource: (resource: IResource) => void;
|
|
83
123
|
printSelectedResource: () => void;
|
|
84
|
-
openFolder: ({ folderId, folder, }: {
|
|
124
|
+
openFolder: ({ folderId, folder, queryClient, }: {
|
|
85
125
|
folderId: ID;
|
|
86
|
-
folder?: IFolder
|
|
126
|
+
folder?: IFolder;
|
|
127
|
+
queryClient?: QueryClient;
|
|
87
128
|
}) => void;
|
|
88
129
|
foldTreeItem: (folderId: string) => void;
|
|
89
|
-
selectTreeItem: (folderId: string) => void;
|
|
90
|
-
|
|
130
|
+
selectTreeItem: (folderId: string, queryClient: QueryClient) => void;
|
|
131
|
+
fetchTreeData: (folderId: string, queryClient: QueryClient) => Promise<void>;
|
|
91
132
|
gotoPreviousFolder: () => void;
|
|
92
133
|
goToTrash: () => void;
|
|
93
134
|
};
|
|
135
|
+
export declare const useSearchParams: () => ISearchParameters & IActionParameters;
|
|
136
|
+
export declare const useSelectedNodeId: () => string | undefined;
|
|
137
|
+
export declare const useSelectedFolders: () => IFolder[];
|
|
138
|
+
export declare const useSelectedResources: () => IResource[];
|
|
139
|
+
export declare const useSearchConfig: () => {
|
|
140
|
+
minLength: number;
|
|
141
|
+
};
|
|
142
|
+
export declare const useFolderIds: () => string[];
|
|
143
|
+
export declare const useResourceIds: () => string[];
|
|
144
|
+
export declare const useResourceAssetIds: () => string[];
|
|
145
|
+
export declare const useResourceWithoutIds: () => IResource[];
|
|
146
|
+
export declare const useCurrentFolder: () => Partial<IFolder>;
|
|
94
147
|
export declare const useIsTrash: () => boolean;
|
|
95
148
|
export declare const useResourceIsTrash: () => boolean;
|
|
149
|
+
export declare const useResourceOrFolderIsDraggable: () => ElementDrag;
|
|
150
|
+
export declare const useElementDragOver: () => ElementOver;
|
|
96
151
|
export declare const useResourceActionDisable: () => boolean;
|
|
97
152
|
export declare const useIsRoot: () => boolean;
|
|
98
|
-
export declare const useHasSelectedNodes: () => boolean;
|
|
99
153
|
export declare const useTreeStatus: () => string | undefined;
|
|
100
154
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IResource } from 'edifice-ts-client';
|
|
2
2
|
export declare function isResourceShared(resource: IResource): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ode-explorer",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.19-develop.202410251618",
|
|
4
4
|
"description": "Edifice Explorer",
|
|
5
5
|
"homepage": "https://github.com/edificeio/explorer#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -31,77 +31,76 @@
|
|
|
31
31
|
},
|
|
32
32
|
"lint-staged": {
|
|
33
33
|
"**/*.{ts,tsx}": [
|
|
34
|
-
"pnpm format",
|
|
35
|
-
"pnpm
|
|
34
|
+
"pnpm run format",
|
|
35
|
+
"pnpm run lint"
|
|
36
36
|
]
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"
|
|
39
|
+
"@dnd-kit/core": "^6.1.0",
|
|
40
|
+
"@dnd-kit/modifiers": "^7.0.0",
|
|
41
|
+
"@edifice-ui/icons": "develop",
|
|
42
|
+
"@edifice-ui/react": "develop",
|
|
43
|
+
"@react-spring/web": "^9.7.3",
|
|
44
|
+
"@tanstack/react-query": "^5.59.13",
|
|
45
|
+
"clsx": "^2.1.1",
|
|
44
46
|
"dayjs": "1.11.10",
|
|
45
47
|
"i18next": "23.8.1",
|
|
46
48
|
"i18next-http-backend": "2.4.2",
|
|
47
|
-
"react": "18.
|
|
48
|
-
"react-dom": "18.
|
|
49
|
-
"react-error-boundary": "4.0.
|
|
50
|
-
"react-hook-form": "7.
|
|
49
|
+
"react": "^18.3.1",
|
|
50
|
+
"react-dom": "^18.3.1",
|
|
51
|
+
"react-error-boundary": "4.0.13",
|
|
52
|
+
"react-hook-form": "^7.53.0",
|
|
51
53
|
"react-i18next": "14.1.0",
|
|
52
|
-
"react-
|
|
53
|
-
"zustand": "4.5.0"
|
|
54
|
+
"react-router-dom": "^6.23.1",
|
|
55
|
+
"zustand": "^4.5.0"
|
|
54
56
|
},
|
|
55
57
|
"devDependencies": {
|
|
56
|
-
"@axe-core/react": "4.
|
|
58
|
+
"@axe-core/react": "^4.10.0",
|
|
57
59
|
"@babel/plugin-transform-react-pure-annotations": "7.23.3",
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
63
|
-
"@
|
|
64
|
-
"@
|
|
65
|
-
"@
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"edifice-
|
|
70
|
-
"
|
|
71
|
-
"eslint
|
|
72
|
-
"eslint-plugin-
|
|
73
|
-
"eslint-plugin-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"vite
|
|
60
|
+
"@eslint/js": "^9.11.1",
|
|
61
|
+
"@tanstack/react-query-devtools": "^5.59.13",
|
|
62
|
+
"@testing-library/jest-dom": "^6.5.0",
|
|
63
|
+
"@testing-library/react": "^16.0.1",
|
|
64
|
+
"@testing-library/user-event": "^14.5.2",
|
|
65
|
+
"@types/node": "^18.16.9",
|
|
66
|
+
"@types/react": "^18.3.10",
|
|
67
|
+
"@types/react-dom": "^18.3.0",
|
|
68
|
+
"@vitejs/plugin-react": "^4.3.2",
|
|
69
|
+
"@vitest/coverage-v8": "^2.1.2",
|
|
70
|
+
"@vitest/ui": "^2.1.2",
|
|
71
|
+
"edifice-bootstrap": "develop",
|
|
72
|
+
"edifice-ts-client": "develop",
|
|
73
|
+
"eslint": "^9.11.1",
|
|
74
|
+
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
|
|
75
|
+
"eslint-plugin-react-refresh": "^0.4.12",
|
|
76
|
+
"globals": "^15.9.0",
|
|
77
|
+
"husky": "^9.1.6",
|
|
78
|
+
"jsdom": "^25.0.1",
|
|
79
|
+
"lint-staged": "15.2.9",
|
|
80
|
+
"msw": "^2.4.10",
|
|
81
|
+
"nx": "19.6.0",
|
|
82
|
+
"prettier": "^3.3.3",
|
|
83
|
+
"typescript": "^5.4.5",
|
|
84
|
+
"typescript-eslint": "^8.7.0",
|
|
85
|
+
"vite": "5.4.1",
|
|
86
|
+
"vite-plugin-dts": "^4.2.4",
|
|
87
|
+
"vite-tsconfig-paths": "^5.0.1",
|
|
88
|
+
"vitest": "^2.1.2"
|
|
84
89
|
},
|
|
85
90
|
"engines": {
|
|
86
91
|
"node": "18 || 20"
|
|
87
92
|
},
|
|
93
|
+
"nx": {},
|
|
88
94
|
"scripts": {
|
|
89
95
|
"build": "vite build && vite build --mode lib",
|
|
90
|
-
"clean": "concurrently \"pnpm:clean:*\"",
|
|
91
|
-
"clean:dist": "rm -rf dist",
|
|
92
|
-
"clean:lighthouse": "rm -rf .lighthouseci",
|
|
93
|
-
"clean:modules": "rm -rf node_modules",
|
|
94
|
-
"clean:package": "rm -f pnpm-lock.yaml && rm -f package.json",
|
|
95
96
|
"dev": "vite",
|
|
96
|
-
"
|
|
97
|
-
"format": "pnpm format:write && pnpm format:check",
|
|
98
|
-
"format:check": "npx prettier --check .",
|
|
99
|
-
"format:write": "npx prettier --write .",
|
|
100
|
-
"preinstall": "npx only-allow pnpm",
|
|
101
|
-
"lighthouse": "pnpm clean:lighthouse && lhci autorun",
|
|
97
|
+
"format": "prettier --write .",
|
|
102
98
|
"lint": "eslint .",
|
|
103
99
|
"pre-commit": "lint-staged",
|
|
104
100
|
"preview": "vite preview",
|
|
105
|
-
"
|
|
101
|
+
"test": "vitest",
|
|
102
|
+
"test:coverage": "vitest run --coverage",
|
|
103
|
+
"test:ui": "vitest --ui",
|
|
104
|
+
"test:watch": "vitest --watch"
|
|
106
105
|
}
|
|
107
106
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TreeNode } from "@edifice-ui/react";
|
|
2
|
-
import { type IFolder } from "edifice-ts-client";
|
|
3
|
-
/** Utility inner class that wraps an IFolder into a TreeNode. */
|
|
4
|
-
export default class TreeNodeFolderWrapper implements TreeNode {
|
|
5
|
-
readonly folder: IFolder;
|
|
6
|
-
constructor(folder: IFolder);
|
|
7
|
-
readonly id: string;
|
|
8
|
-
readonly name: string;
|
|
9
|
-
readonly childNumber: number;
|
|
10
|
-
section: boolean;
|
|
11
|
-
readonly children: TreeNode[];
|
|
12
|
-
}
|
package/lib/utils/addNode.d.ts
DELETED
package/lib/utils/moveNode.d.ts
DELETED