ode-explorer 1.3.2-dev.202401091605 → 1.3.2-dev.202401091744

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 (79) hide show
  1. package/dist/version.txt +1 -1
  2. package/explorer.d.ts +1 -0
  3. package/lib/ActionBarContainer.js +375 -0
  4. package/lib/AppAction.js +47 -0
  5. package/lib/DeleteModal.js +60 -0
  6. package/lib/DisableModal.js +20 -0
  7. package/lib/EmptyScreenApp.js +53 -0
  8. package/lib/EmptyScreenError.js +13 -0
  9. package/lib/EmptyScreenNoContentInFolder.js +20 -0
  10. package/lib/EmptyScreenSearch.js +20 -0
  11. package/lib/EmptyScreenTrash.js +18 -0
  12. package/lib/FolderModal.js +138 -0
  13. package/lib/FoldersList.js +77 -0
  14. package/lib/Library.js +19 -0
  15. package/lib/MoveModal.js +94 -0
  16. package/lib/ResourcesList.js +261 -0
  17. package/lib/TrashModal.js +20 -0
  18. package/lib/app/root/index.d.ts +2 -0
  19. package/lib/components/AppAction/AppAction.d.ts +1 -0
  20. package/lib/components/EmptyScreens/EmptyScreenApp.d.ts +2 -0
  21. package/lib/components/EmptyScreens/EmptyScreenError.d.ts +2 -0
  22. package/lib/components/EmptyScreens/EmptyScreenNoContentInFolder.d.ts +2 -0
  23. package/lib/components/EmptyScreens/EmptyScreenSearch.d.ts +2 -0
  24. package/lib/components/EmptyScreens/EmptyScreenTrash.d.ts +1 -0
  25. package/lib/components/Explorer.d.ts +5 -0
  26. package/lib/components/ExplorerBreadcrumb.d.ts +1 -0
  27. package/lib/components/LoadMore.d.ts +3 -0
  28. package/lib/config/getExplorerConfig.d.ts +11 -0
  29. package/lib/config/index.d.ts +3 -0
  30. package/lib/features/AccessControl/AccessControl.d.ts +12 -0
  31. package/lib/features/AccessControl/useAccessControl.d.ts +14 -0
  32. package/lib/features/ActionBar/ActionBarContainer.d.ts +1 -0
  33. package/lib/features/ActionBar/Delete/DeleteModal.d.ts +8 -0
  34. package/lib/features/ActionBar/Delete/useDeleteModal.d.ts +8 -0
  35. package/lib/features/ActionBar/Disable/DisableModal.d.ts +5 -0
  36. package/lib/features/ActionBar/Disable/useDisableModal.d.ts +4 -0
  37. package/lib/features/ActionBar/Folder/FolderModal.d.ts +9 -0
  38. package/lib/features/ActionBar/Folder/useFolderModal.d.ts +22 -0
  39. package/lib/features/ActionBar/Move/MoveModal.d.ts +8 -0
  40. package/lib/features/ActionBar/Move/useMoveModal.d.ts +12 -0
  41. package/lib/features/ActionBar/Trash/TrashModal.d.ts +5 -0
  42. package/lib/features/ActionBar/Trash/useTrashModal.d.ts +4 -0
  43. package/lib/features/ActionBar/useActionBar.d.ts +30 -0
  44. package/lib/features/List/FolderCard.d.ts +17 -0
  45. package/lib/features/List/FoldersList.d.ts +7 -0
  46. package/lib/features/List/List.d.ts +1 -0
  47. package/lib/features/List/ResourceCard.d.ts +22 -0
  48. package/lib/features/List/ResourcesList.d.ts +8 -0
  49. package/lib/features/SearchForm/SearchForm.d.ts +1 -0
  50. package/lib/features/SearchForm/useSearchForm.d.ts +8 -0
  51. package/lib/features/SearchForm/useSelectedFilters.d.ts +8 -0
  52. package/lib/features/SideBar/Library/Library.d.ts +2 -0
  53. package/lib/features/SideBar/TrashButton.d.ts +7 -0
  54. package/lib/features/SideBar/TreeViewContainer.d.ts +1 -0
  55. package/lib/i18n.d.ts +2 -0
  56. package/lib/index.d.ts +1 -0
  57. package/lib/index.js +13 -0
  58. package/lib/index2.js +1867 -0
  59. package/lib/main.d.ts +0 -0
  60. package/lib/services/api/index.d.ts +129 -0
  61. package/lib/store/index.d.ts +98 -0
  62. package/lib/style.css +410 -0
  63. package/lib/utils/TreeNodeFolderWrapper.d.ts +12 -0
  64. package/lib/utils/addNode.d.ts +6 -0
  65. package/lib/utils/arrayUnique.d.ts +1 -0
  66. package/lib/utils/capitalizeFirstLetter.d.ts +1 -0
  67. package/lib/utils/deleteNode.d.ts +4 -0
  68. package/lib/utils/findNodeById.d.ts +2 -0
  69. package/lib/utils/fullTextSearch.d.ts +1 -0
  70. package/lib/utils/getAncestors.d.ts +2 -0
  71. package/lib/utils/getAppParams.d.ts +10 -0
  72. package/lib/utils/hasChildren.d.ts +2 -0
  73. package/lib/utils/isResourceShared.d.ts +2 -0
  74. package/lib/utils/modifyNode.d.ts +2 -0
  75. package/lib/utils/moveNode.d.ts +5 -0
  76. package/lib/utils/scrollToTop.d.ts +1 -0
  77. package/lib/utils/updateNode.d.ts +6 -0
  78. package/lib/utils/wrapTreeNode.d.ts +3 -0
  79. package/package.json +33 -3
@@ -0,0 +1,3 @@
1
+ import clsx from "clsx";
2
+ import dayjs from "dayjs";
3
+ export { clsx, dayjs };
@@ -0,0 +1,12 @@
1
+ import { type ReactNode, type ReactElement } from "react";
2
+ import { IAction, RightRole } from "edifice-ts-client";
3
+ import { IObjectWithRights } from './useAccessControl';
4
+ interface AccessControlProps {
5
+ roleExpected: RightRole | RightRole[];
6
+ resourceRights: string | string[] | IObjectWithRights | IObjectWithRights[];
7
+ action: IAction;
8
+ children: ReactNode;
9
+ renderWhenForbidden?: () => ReactElement;
10
+ }
11
+ export declare function AccessControl({ resourceRights, roleExpected, action, children, renderWhenForbidden, }: AccessControlProps): ReactElement;
12
+ export {};
@@ -0,0 +1,14 @@
1
+ import { type RightRole } from "edifice-ts-client";
2
+ export interface IObjectWithRights {
3
+ rights: string[];
4
+ }
5
+ interface AccessControlProps {
6
+ roles: RightRole | RightRole[];
7
+ rights: string | string[] | IObjectWithRights | IObjectWithRights[];
8
+ action: string | undefined;
9
+ }
10
+ export declare function useAccessControl({ roles, rights, action, }: AccessControlProps): {
11
+ visible: boolean;
12
+ refreshState: () => Promise<void>;
13
+ };
14
+ export {};
@@ -0,0 +1 @@
1
+ export default function ActionBarContainer(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ interface ModalProps {
3
+ isOpen: boolean;
4
+ onSuccess?: () => void;
5
+ onCancel?: () => void;
6
+ }
7
+ export default function DeleteModal({ isOpen, onSuccess, onCancel, }: ModalProps): import("react").ReactPortal;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ interface ModalProps {
2
+ onSuccess?: () => void;
3
+ }
4
+ export declare function useDeleteModal({ onSuccess }: ModalProps): {
5
+ isTrashFolder: boolean;
6
+ onDelete: () => Promise<void>;
7
+ };
8
+ export {};
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export default function ActionResourceDisableModal({ isOpen, onCancel, }: {
3
+ isOpen: boolean;
4
+ onCancel?: () => void;
5
+ }): import("react").ReactPortal;
@@ -0,0 +1,4 @@
1
+ export declare const useDisableModal: () => {
2
+ isActionDisableModalOpen: boolean;
3
+ onActionDisableCancel: () => void;
4
+ };
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface FolderModalProps {
3
+ isOpen: boolean;
4
+ edit: boolean;
5
+ onSuccess?: () => void;
6
+ onCancel: () => void;
7
+ }
8
+ export default function FolderModal({ isOpen, edit, onSuccess, onCancel: onClose, }: FolderModalProps): import("react").ReactPortal | null;
9
+ export {};
@@ -0,0 +1,22 @@
1
+ import { type SubmitHandler } from "react-hook-form";
2
+ interface useFolderModalProps {
3
+ edit: boolean;
4
+ onSuccess?: () => void;
5
+ onClose: () => void;
6
+ }
7
+ interface HandlerProps {
8
+ name: string;
9
+ }
10
+ export declare function useFolderModal({ edit, onSuccess, onClose, }: useFolderModalProps): {
11
+ formId: string;
12
+ errors: import("react-hook-form").FieldErrors<HandlerProps>;
13
+ isSubmitting: boolean;
14
+ isDirty: boolean;
15
+ isValid: boolean;
16
+ register: import("react-hook-form").UseFormRegister<HandlerProps>;
17
+ setFocus: import("react-hook-form").UseFormSetFocus<HandlerProps>;
18
+ handleSubmit: import("react-hook-form").UseFormHandleSubmit<HandlerProps, undefined>;
19
+ onCancel: () => void;
20
+ onSubmit: SubmitHandler<HandlerProps>;
21
+ };
22
+ export {};
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ interface MoveModalProps {
3
+ isOpen: boolean;
4
+ onSuccess: () => void;
5
+ onCancel: () => void;
6
+ }
7
+ export default function MoveModal({ isOpen, onSuccess, onCancel, }: MoveModalProps): import("react").ReactPortal;
8
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type ID } from "edifice-ts-client";
2
+ interface ModalProps {
3
+ onSuccess?: () => void;
4
+ }
5
+ export declare function useMoveModal({ onSuccess }: ModalProps): {
6
+ disableSubmit: boolean;
7
+ handleTreeItemSelect: (folderId: string) => void;
8
+ handleTreeItemFold: (folderId: string) => void;
9
+ handleTreeItemUnfold: (folderId: ID) => Promise<void>;
10
+ onMove: () => void;
11
+ };
12
+ export {};
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export default function TrashedResourceModal({ isOpen, onCancel, }: {
3
+ isOpen: boolean;
4
+ onCancel?: () => void;
5
+ }): import("react").ReactPortal;
@@ -0,0 +1,4 @@
1
+ export declare const useTrashModal: () => {
2
+ isTrashedModalOpen: boolean;
3
+ onTrashedCancel: () => void;
4
+ };
@@ -0,0 +1,30 @@
1
+ import { type IAction } from "edifice-ts-client";
2
+ export default function useActionBar(): {
3
+ onRestore: () => Promise<void>;
4
+ actions: IAction[] | undefined;
5
+ selectedElement: (import("edifice-ts-client").IFolder | import("edifice-ts-client").IResource)[];
6
+ currentFolderId: string | undefined;
7
+ overrideLabel: (action: IAction) => string;
8
+ handleClick: (action: IAction) => Promise<void>;
9
+ isActivable: (action: IAction) => boolean;
10
+ isActionBarOpen: boolean;
11
+ isMoveModalOpen: boolean;
12
+ onMoveCancel: () => void;
13
+ onMoveSuccess: () => void;
14
+ isDeleteModalOpen: boolean;
15
+ onDeleteCancel: () => void;
16
+ onDeleteSuccess: () => void;
17
+ isPublishModalOpen: boolean;
18
+ onPublishCancel: () => void;
19
+ onPublishSuccess: () => void;
20
+ isEditFolderOpen: boolean;
21
+ onEditFolderCancel: () => void;
22
+ onEditFolderSuccess: () => void;
23
+ isEditResourceOpen: boolean;
24
+ onEditResourceCancel: () => void;
25
+ onEditResourceSuccess: () => void;
26
+ isShareResourceOpen: boolean;
27
+ onShareResourceCancel: () => void;
28
+ onShareResourceSuccess: () => void;
29
+ onClearActionBar: () => void;
30
+ };
@@ -0,0 +1,17 @@
1
+ import { CardProps } from "@edifice-ui/react";
2
+ import { IWebApp } from "edifice-ts-client";
3
+ export interface FolderCardProps extends Omit<CardProps, "children"> {
4
+ /**
5
+ * IWeb App
6
+ */
7
+ app?: IWebApp | undefined;
8
+ /**
9
+ * Folder's name
10
+ */
11
+ name: string;
12
+ }
13
+ declare const FolderCard: {
14
+ ({ app, name, isSelected, isSelectable, onClick, onSelect, }: FolderCardProps): import("react/jsx-runtime").JSX.Element;
15
+ displayName: string;
16
+ };
17
+ export default FolderCard;
@@ -0,0 +1,7 @@
1
+ import { InfiniteData } from "@tanstack/react-query";
2
+ import { ISearchResults } from "edifice-ts-client";
3
+ declare const FoldersList: ({ data, }: {
4
+ data: InfiniteData<ISearchResults> | undefined;
5
+ isFetching: boolean;
6
+ }) => import("react/jsx-runtime").JSX.Element | null;
7
+ export default FoldersList;
@@ -0,0 +1 @@
1
+ export declare const List: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { CardProps } from "@edifice-ui/react";
2
+ import { IResource, IWebApp } from "edifice-ts-client";
3
+ type OmitChildren = Omit<CardProps, "children">;
4
+ export interface ResourceCardProps extends OmitChildren {
5
+ /**
6
+ * IWeb App
7
+ */
8
+ app?: IWebApp | undefined;
9
+ /**
10
+ * Resource
11
+ */
12
+ resource: Partial<IResource>;
13
+ /**
14
+ * Updated date
15
+ */
16
+ time: string;
17
+ }
18
+ declare const ResourceCard: {
19
+ ({ app, resource, time, isSelected, isSelectable, onClick, onSelect, }: ResourceCardProps): import("react/jsx-runtime").JSX.Element;
20
+ displayName: string;
21
+ };
22
+ export default ResourceCard;
@@ -0,0 +1,8 @@
1
+ import { InfiniteData } from "@tanstack/react-query";
2
+ import { ISearchResults } from "edifice-ts-client";
3
+ declare const ResourcesList: ({ data, fetchNextPage, }: {
4
+ data: InfiniteData<ISearchResults> | undefined;
5
+ isFetching: boolean;
6
+ fetchNextPage: () => void;
7
+ }) => JSX.Element | null;
8
+ export default ResourcesList;
@@ -0,0 +1 @@
1
+ export declare const SearchForm: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare const useSearchForm: () => {
3
+ formRef: import("react").MutableRefObject<null>;
4
+ inputSearch: string;
5
+ handleInputSearchChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
6
+ handleKeyPress: (event: React.KeyboardEvent) => void;
7
+ handleSearchSubmit: (e: React.MouseEvent) => void;
8
+ };
@@ -0,0 +1,8 @@
1
+ export declare const useSelectedFilters: () => {
2
+ selectedFilters: string;
3
+ options: {
4
+ label: string;
5
+ value: string;
6
+ }[];
7
+ handleOnSelectFilter: (value: string) => void;
8
+ };
@@ -0,0 +1,2 @@
1
+ declare const Library: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Library;
@@ -0,0 +1,7 @@
1
+ export interface TrashButtonProps {
2
+ id: string;
3
+ selected: boolean;
4
+ onSelect: () => void;
5
+ }
6
+ export declare const TrashButton: ({ id, selected, onSelect, }: TrashButtonProps) => JSX.Element | null;
7
+ export default TrashButton;
@@ -0,0 +1 @@
1
+ export declare const TreeViewContainer: () => import("react/jsx-runtime").JSX.Element;
package/lib/i18n.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import i18n from "i18next";
2
+ export default i18n;
package/lib/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { default as Explorer } from "./components/Explorer";
package/lib/index.js ADDED
@@ -0,0 +1,13 @@
1
+ import { E } from "./index2.js";
2
+ import "react/jsx-runtime";
3
+ import "react";
4
+ import "@edifice-ui/react";
5
+ import "@edifice-ui/icons";
6
+ import "react-i18next";
7
+ import "edifice-ts-client";
8
+ import "i18next";
9
+ import "zustand";
10
+ import "@tanstack/react-query";
11
+ export {
12
+ E as Explorer
13
+ };