@edifice.io/react 2.0.0-develop-rc.4 → 2.0.0-develop-rc.7

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 (78) hide show
  1. package/README.md +17 -88
  2. package/dist/components/Alert/Alert.js +5 -5
  3. package/dist/components/Table/TableExplorer.js +2 -2
  4. package/dist/components/TextArea/TextArea.js +2 -2
  5. package/dist/core/useConversation/useConversation.js +2 -2
  6. package/dist/core/useHasWorkflow/useHasWorkflow.js +1 -1
  7. package/dist/core/useHeader/useHeader.js +3 -3
  8. package/dist/core/useLibraryUrl/useLibraryUrl.js +2 -2
  9. package/dist/core/useMediaLibrary/useMediaLibrary.js +2 -2
  10. package/dist/core/useOdeIcons/useOdeIcons.d.ts +1 -1
  11. package/dist/core/useResource/useResource.d.ts +0 -1
  12. package/dist/core/useTrashedResource/useTrashedResource.js +2 -2
  13. package/dist/core/useUpload/useUpload.d.ts +4 -5
  14. package/dist/core/useUpload/useUpload.js +1 -1
  15. package/dist/core/useUploadFiles/useUploadFiles.d.ts +5 -5
  16. package/dist/core/useUploadFiles/useUploadFiles.js +3 -3
  17. package/dist/core/useWorkspaceFile/useWorkspaceFile.d.ts +4 -4
  18. package/dist/core/useWorkspaceFile/useWorkspaceFile.js +2 -2
  19. package/dist/core/useWorkspaceSearch/useWorkspaceSearch.d.ts +2 -2
  20. package/dist/core/useWorkspaceSearch/useWorkspaceSearch.js +1 -1
  21. package/dist/editor.js +3 -3
  22. package/dist/hooks/useBrowserInfo/useBrowserInfo.js +1 -1
  23. package/dist/hooks/useDropdown/useDropdown.d.ts +1 -1
  24. package/dist/hooks/useDropdown/useDropdown.js +2 -2
  25. package/dist/hooks/useDropzone/useDropzone.js +2 -2
  26. package/dist/hooks/useToast/useToast.js +1 -1
  27. package/dist/index.js +66 -66
  28. package/dist/modals.js +4 -4
  29. package/dist/modules/audience/ReactionChoice.js +2 -2
  30. package/dist/modules/audience/ReactionModal.js +1 -2
  31. package/dist/modules/audience/ReactionSummary.js +2 -2
  32. package/dist/modules/audience/ViewsCounter.js +2 -2
  33. package/dist/modules/audience/ViewsModal.js +2 -2
  34. package/dist/modules/audience/hooks/useReactions.d.ts +3 -5
  35. package/dist/modules/audience/hooks/useViews.d.ts +3 -3
  36. package/dist/modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js +2 -2
  37. package/dist/modules/editor/components/Editor/Editor.js +3 -3
  38. package/dist/modules/editor/components/Editor/MathsModal.d.ts +0 -1
  39. package/dist/modules/editor/components/Editor/MathsModal.js +1 -1
  40. package/dist/modules/editor/components/NodeView/AttachmentNodeView.js +2 -2
  41. package/dist/modules/editor/components/NodeView/AudioNodeView.js +2 -2
  42. package/dist/modules/editor/components/NodeView/ImageNodeView.js +2 -2
  43. package/dist/modules/editor/components/NodeView/LinkerNodeView.js +2 -2
  44. package/dist/modules/editor/components/NodeView/VideoNodeView.js +2 -2
  45. package/dist/modules/editor/components/Renderer/LinkerRenderer.js +1 -1
  46. package/dist/modules/editor/components/Renderer/MediaRenderer.js +1 -1
  47. package/dist/modules/editor/components/Toolbar/LinkToolbar.d.ts +1 -1
  48. package/dist/modules/editor/components/Toolbar/LinkToolbar.js +4 -4
  49. package/dist/modules/editor/components/Toolbar/TableToolbar.d.ts +1 -1
  50. package/dist/modules/editor/components/Toolbar/TableToolbar.js +5 -5
  51. package/dist/modules/editor/hooks/useImageModal.d.ts +1 -2
  52. package/dist/modules/modals/OnboardingModal/OnboardingModal.d.ts +0 -1
  53. package/dist/modules/modals/OnboardingModal/OnboardingModal.js +2 -2
  54. package/dist/modules/modals/PublishModal/components/PublishModalFooter.js +1 -1
  55. package/dist/modules/modals/ResourceModal/ResourceModal.js +1 -1
  56. package/dist/modules/modals/ShareModal/ShareBookmarkLine.d.ts +1 -1
  57. package/dist/modules/modals/ShareModal/hooks/useShare.d.ts +2 -2
  58. package/dist/modules/modals/ShareModal/utils/hasRight.d.ts +0 -1
  59. package/dist/modules/modals/ShareModal/utils/showShareRightLine.d.ts +0 -1
  60. package/dist/modules/multimedia/AudioRecorder/AudioRecorder.js +2 -2
  61. package/dist/modules/multimedia/Embed/Embed.js +2 -2
  62. package/dist/modules/multimedia/ImageEditor/components/ImageEditor.js +2 -2
  63. package/dist/modules/multimedia/ImageEditor/hooks/useHistoryTool.js +36 -38
  64. package/dist/modules/multimedia/Linker/ExternalLinker.js +5 -5
  65. package/dist/modules/multimedia/Linker/InternalLinker.js +2 -2
  66. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +2 -2
  67. package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.d.ts +3 -3
  68. package/dist/modules/multimedia/MediaLibrary/innertabs/Workspace.js +2 -2
  69. package/dist/modules/multimedia/UploadFiles/UploadFiles.d.ts +1 -1
  70. package/dist/modules/multimedia/VideoEmbed/VideoEmbed.js +2 -2
  71. package/dist/modules/multimedia/VideoRecorder/VideoRecorder.js +2 -2
  72. package/dist/modules/multimedia/Workspace/Workspace.js +4 -4
  73. package/dist/multimedia.js +16 -16
  74. package/dist/portal/Help/Help.d.ts +0 -1
  75. package/dist/portal/Layout/Layout.js +3 -3
  76. package/dist/utils/fileSize.js +1 -1
  77. package/dist/widgets/BookmarkedApps/BookmarkedApps.js +2 -2
  78. package/package.json +19 -28
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Edifice React Components
1
+ # Edifice React Library
2
2
 
3
3
  ![npm](https://img.shields.io/npm/v/@edifice.io/react?style=flat-square)
4
4
  ![bundlephobia](https://img.shields.io/bundlephobia/min/@edifice.io/react?style=flat-square)
@@ -7,104 +7,33 @@
7
7
 
8
8
  We follow [WAI ARIA](https://www.w3.org/WAI/ARIA/apg/patterns/) rules and [Bootstrap 5](https://getbootstrap.com/docs/5.0/components/accordion/) guidelines when making our components
9
9
 
10
- ### Build
10
+ ### Install
11
11
 
12
- ```bash
13
- pnpm run build
14
12
  ```
15
-
16
- ### Lint
17
-
18
- ```bash
19
- pnpm run lint
13
+ pnpm add @edifice.io/react
20
14
  ```
21
15
 
22
- If `pnpm run lint` shows issues, run this command to fix them.
16
+ ### Modules
23
17
 
24
- ```bash
25
- pnpm run fix
26
- ```
18
+ Optional modules are available as `sub-imports`. You can use them in specific applications:
27
19
 
28
- ### Prettier
29
-
30
- ```bash
31
- pnpm run format
32
- ```
20
+ #### Audience
33
21
 
34
- ## Structure
22
+ Module to track views or reactions on a resource in a specific application (e.g: Blog)
35
23
 
36
- ### Component Folder
24
+ #### Editor
37
25
 
38
- - Folder name always in PascalCase: `Button`
39
- - Component file in PascalCase: `Button.tsx`
40
- - Export types & interfaces inside Component file
41
- - Stories file in PascalCase + `*.stories.tsx` : `Button.stories.tsx`
26
+ Rich Text Editor using Tiptap and our `multimedia` module.
42
27
 
43
- ```bash
44
- src
45
- -- ComponentFolder
46
- -- Component.tsx
47
- -- Component.stories.tsx
48
- -- index.ts
49
- ```
50
-
51
- - Re-export the Component inside his own `index` file: `index.ts`
52
- - Export everything if Component has types & interfaces
53
-
54
- ```jsx
55
- export { default as Component } from './Component';
56
- export * from './Component';
57
- ```
28
+ #### Modals
58
29
 
59
- ### Component Guideline
30
+ - Onboarding Modal to greet user and give him some useful informations about an application.
31
+ - Publish Modal to publish a resource to the BPR application.
32
+ - Resource Modal can be used to create or edit information about a resource
33
+ - Share Modal allows a user to share one of his resource with specific roles to users
60
34
 
61
- - Always document basic guideline of Component with JSDoc format. Used by Storybook to generate documentation.
62
-
63
- ```jsx
64
- /**
65
- * Primary UI component for user interaction
66
- */
67
- ```
68
-
69
- ### Interface description
70
-
71
- - Always document typescript types and interface with JSDoc syntax. Used by Storybook to generate documentation.
72
-
73
- ```jsx
74
- // Interface description (e.g: TreeViewProps.tsx)
75
- export interface ButtonProps {
76
- /**
77
- * Is this the principal call to action on the page?
78
- */
79
- primary?: boolean;
80
- /**
81
- * What background color to use
82
- */
83
- backgroundColor?: string;
84
- /**
85
- * How large should the button be?
86
- */
87
- size?: "small" | "medium" | "large";
88
- /**
89
- * Button contents
90
- */
91
- label: string;
92
- /**
93
- * Optional click handler
94
- */
95
- onClick?: () => void;
96
- }
97
- ```
98
-
99
- ### Index file inside `src` folder
100
-
101
- - Entry point of this React Library.
102
- - Import your component inside `index.ts` file.
103
-
104
- ```jsx
105
- export * from './Button';
106
- ```
35
+ #### Multimedia
107
36
 
108
- ## Dev
37
+ All our multimedia components to use in applications or in modules.
109
38
 
110
- You can build your component using `Storybook`. See [README](../../docs//README.md)
39
+ - Linker, AudioRecorder, VideoRecorder, Iframe, Embed component, ...
@@ -1,4 +1,4 @@
1
- import { jsx, Fragment, jsxs } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useState, useRef, useCallback, useImperativeHandle, useLayoutEffect, useEffect } from "react";
3
3
  import clsx from "clsx";
4
4
  import { useTranslation } from "react-i18next";
@@ -59,7 +59,7 @@ const Alert = /* @__PURE__ */ forwardRef(({
59
59
  }, confirmClasses = {
60
60
  "is-confirm": isConfirm
61
61
  }, divContainerClasses = clsx("alert gap-12", mapping[type].classModifier, toastClasses, confirmClasses, position, className);
62
- return /* @__PURE__ */ jsx(Fragment, { children: isVisible ? /* @__PURE__ */ jsxs("div", { ref: refAlert, className: divContainerClasses, role: "alert", children: [
62
+ return isVisible ? /* @__PURE__ */ jsxs("div", { ref: refAlert, className: divContainerClasses, role: "alert", children: [
63
63
  !isConfirm && mapping[type].icon,
64
64
  /* @__PURE__ */ jsx("div", { className: "alert-content small", children }),
65
65
  button && /* @__PURE__ */ jsxs("div", { className: "ms-12", children: [
@@ -71,9 +71,9 @@ const Alert = /* @__PURE__ */ forwardRef(({
71
71
  autoClose && /* @__PURE__ */ jsx("div", { className: "alert-progress", style: {
72
72
  transform: "scaleX(0)"
73
73
  } })
74
- ] }) : null });
75
- }), Alert$1 = Alert;
74
+ ] }) : null;
75
+ });
76
76
  export {
77
77
  Alert,
78
- Alert$1 as default
78
+ Alert as default
79
79
  };
@@ -1,8 +1,8 @@
1
- import { jsx, Fragment } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  const TableExplorer = /* @__PURE__ */ forwardRef(({
4
4
  children
5
- }, ref) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("table", { ref, className: "table-explorer", children }) }));
5
+ }, ref) => /* @__PURE__ */ jsx("table", { ref, className: "table-explorer", children }));
6
6
  export {
7
7
  TableExplorer,
8
8
  TableExplorer as default
@@ -1,4 +1,4 @@
1
- import { jsx, Fragment } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import clsx from "clsx";
4
4
  import { useFormControl } from "../Form/FormContext.js";
@@ -27,7 +27,7 @@ const TextArea = /* @__PURE__ */ forwardRef(({
27
27
  "form-control-plaintext": isReadOnly,
28
28
  "no-validation-icon": noValidationIcon
29
29
  }, className);
30
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("textarea", { ref, id, className: classes, placeholder, required: isRequired, readOnly: isReadOnly, ...restProps }) });
30
+ return /* @__PURE__ */ jsx("textarea", { ref, id, className: classes, placeholder, required: isRequired, readOnly: isReadOnly, ...restProps });
31
31
  });
32
32
  export {
33
33
  TextArea,
@@ -37,7 +37,7 @@ const useConversation = () => {
37
37
  msgLink,
38
38
  zimbraWorkflow
39
39
  };
40
- }, useConversation$1 = useConversation;
40
+ };
41
41
  export {
42
- useConversation$1 as default
42
+ useConversation as default
43
43
  };
@@ -10,7 +10,7 @@ function useHasWorkflow(workflow) {
10
10
  if (typeof workflow == "string")
11
11
  response = await mock.hasWorkflow(workflow);
12
12
  else
13
- throw "not.implemented.yet)";
13
+ throw new Error("not.implemented.yet)");
14
14
  else
15
15
  typeof workflow == "string" ? response = await odeServices.rights().sessionHasWorkflowRight(workflow) : response = await odeServices.rights().sessionHasWorkflowRights(workflow);
16
16
  setState(response);
@@ -20,9 +20,9 @@ function useHeader({
20
20
  username: user == null ? void 0 : user.firstName
21
21
  }), bookmarkedApps = useBookmark(), communityWorkflow = useHasWorkflow("net.atos.entng.community.controllers.CommunityController|view"), conversationWorflow = useHasWorkflow("org.entcore.conversation.controllers.ConversationController|view"), searchWorkflow = useHasWorkflow("fr.openent.searchengine.controllers.SearchEngineController|view"), toggleCollapsedNav = useCallback(() => {
22
22
  setIsCollapsed(!isCollapsed);
23
- }, [isCollapsed]), handleLogout = async () => {
23
+ }, [isCollapsed]), handleLogout = useCallback(async () => {
24
24
  await odeServices.session().logout(), window.location.href = (theme == null ? void 0 : theme.logoutCallback) ?? "/auth/login";
25
- };
25
+ }, [theme == null ? void 0 : theme.logoutCallback]);
26
26
  return useMemo(() => ({
27
27
  title,
28
28
  bookmarkedApps,
@@ -39,7 +39,7 @@ function useHeader({
39
39
  isCollapsed,
40
40
  toggleCollapsedNav,
41
41
  handleLogout
42
- }), [appsRef, bookmarkedApps, communityWorkflow, conversationWorflow, isAppsHovered, isCollapsed, popoverAppsId, popoverSearchId, searchWorkflow, title, toggleCollapsedNav, userAvatar, userName, welcomeUser]);
42
+ }), [appsRef, bookmarkedApps, communityWorkflow, conversationWorflow, handleLogout, isAppsHovered, isCollapsed, popoverAppsId, popoverSearchId, searchWorkflow, title, toggleCollapsedNav, userAvatar, userName, welcomeUser]);
43
43
  }
44
44
  export {
45
45
  useHeader as default
@@ -15,7 +15,7 @@ const useLibraryUrl = () => {
15
15
  libraryHost.endsWith("/") || (libraryHost = `${libraryHost}/`);
16
16
  const platformURLParam = libraryUrlSplit == null ? void 0 : libraryUrlSplit[1], searchParams = `application%5B0%5D=${appName}&page=1&sort_field=views&sort_order=desc`;
17
17
  return `${libraryHost}search/?${platformURLParam}&${searchParams}`;
18
- }, useLibraryUrl$1 = useLibraryUrl;
18
+ };
19
19
  export {
20
- useLibraryUrl$1 as default
20
+ useLibraryUrl as default
21
21
  };
@@ -52,7 +52,7 @@ const useMediaLibrary = () => {
52
52
  (_a = mediaLibraryRef.current) != null && _a.type && uploads && uploads.length > 0 && await remove(uploads);
53
53
  }
54
54
  };
55
- }, useMediaLibrary$1 = useMediaLibrary;
55
+ };
56
56
  export {
57
- useMediaLibrary$1 as default
57
+ useMediaLibrary as default
58
58
  };
@@ -1,4 +1,4 @@
1
- import { IWidget, IWebApp } from 'edifice-ts-client';
1
+ import { IWebApp } from 'edifice-ts-client';
2
2
  export default function useOdeIcons(): {
3
3
  getIconClass: (app: IWebApp | string) => string;
4
4
  getBackgroundIconClass: (app: IWebApp | string) => string;
@@ -1,3 +1,2 @@
1
- import { IResource } from 'edifice-ts-client';
2
1
  declare const useResource: (application: string, id: string) => IResource;
3
2
  export default useResource;
@@ -21,7 +21,7 @@ const useTrashedResource = (id) => {
21
21
  statusText: "Not Found"
22
22
  });
23
23
  }, [trashed]);
24
- }, useTrashedResource$1 = useTrashedResource;
24
+ };
25
25
  export {
26
- useTrashedResource$1 as default
26
+ useTrashedResource as default
27
27
  };
@@ -1,18 +1,17 @@
1
- import { WorkspaceElement, WorkspaceVisibility } from 'edifice-ts-client';
2
1
  import { Status } from '../../types';
3
- declare const useUpload: (visibility?: WorkspaceVisibility, application?: string) => {
2
+ declare const useUpload: (visibility?: any, application?: string) => {
4
3
  getUploadStatus: (upload: File | Blob) => Status | undefined;
5
4
  setUploadStatus: (blob: File | Blob, status: Status) => void;
6
5
  clearUploadStatus: (blob: File | Blob) => void;
7
6
  uploadFile: (file: File, metadata?: {
8
7
  duration: number;
9
- }) => Promise<WorkspaceElement | null>;
8
+ }) => Promise<any>;
10
9
  uploadAlternateFile: (original: File, replacement: File, metadata?: {
11
10
  duration: number;
12
- }) => Promise<WorkspaceElement | null>;
11
+ }) => Promise<any>;
13
12
  uploadBlob: (blob: Blob, metadata?: {
14
13
  filename?: string;
15
14
  duration?: number;
16
- }) => Promise<WorkspaceElement | null>;
15
+ }) => Promise<any>;
17
16
  };
18
17
  export default useUpload;
@@ -1,8 +1,8 @@
1
1
  import { useState, useCallback } from "react";
2
2
  import { ERROR_CODE, odeServices } from "edifice-ts-client";
3
3
  import useBrowserInfo from "../../hooks/useBrowserInfo/useBrowserInfo.js";
4
- import useWorkspaceFile from "../useWorkspaceFile/useWorkspaceFile.js";
5
4
  import { getOrGenerateBlobId } from "../../utils/blob.js";
5
+ import useWorkspaceFile from "../useWorkspaceFile/useWorkspaceFile.js";
6
6
  const useUpload = (visibility, application = "media-library") => {
7
7
  const [status, setStatus] = useState({}), {
8
8
  browser,
@@ -1,7 +1,7 @@
1
1
  import { WorkspaceElement, WorkspaceVisibility } from 'edifice-ts-client';
2
2
  declare const useUploadFiles: ({ handleOnChange, visibility, application, }: {
3
3
  handleOnChange: (uploadedFiles: WorkspaceElement[]) => void;
4
- visibility?: WorkspaceVisibility | undefined;
4
+ visibility?: any;
5
5
  application?: string | undefined;
6
6
  }) => {
7
7
  /** List of files added from device */
@@ -9,9 +9,9 @@ declare const useUploadFiles: ({ handleOnChange, visibility, application, }: {
9
9
  getUploadStatus: (upload: Blob | File) => import('../../types').Status | undefined;
10
10
  clearUploadStatus: (blob: Blob | File) => void;
11
11
  uploadedFiles: WorkspaceElement[];
12
- editingImage: WorkspaceElement | undefined;
13
- setEditingImage: import('react').Dispatch<import('react').SetStateAction<WorkspaceElement | undefined>>;
14
- getUrl: (resource?: WorkspaceElement, timestamp?: boolean) => string;
12
+ editingImage: any;
13
+ setEditingImage: import('react').Dispatch<any>;
14
+ getUrl: (resource?: any, timestamp?: boolean) => string;
15
15
  updateImage: ({ blob, legend, altText: alt, }: {
16
16
  blob: Blob;
17
17
  legend: string;
@@ -19,7 +19,7 @@ declare const useUploadFiles: ({ handleOnChange, visibility, application, }: {
19
19
  }) => Promise<void>;
20
20
  uploadFile: (file: File, metadata?: {
21
21
  duration: number;
22
- } | undefined) => Promise<WorkspaceElement | null>;
22
+ } | undefined) => Promise<any>;
23
23
  removeFile: (file: File) => Promise<void>;
24
24
  };
25
25
  export default useUploadFiles;
@@ -1,9 +1,9 @@
1
1
  import { useState, useCallback, useEffect } from "react";
2
2
  import { useDropzoneContext } from "../../components/Dropzone/DropzoneContext.js";
3
- import useWorkspaceFile from "../useWorkspaceFile/useWorkspaceFile.js";
4
3
  import useUpload from "../useUpload/useUpload.js";
5
4
  import useImageResizer from "../../hooks/useImageResizer/useImageResizer.js";
6
5
  import { addTimestampToImageUrl } from "../../utils/addTimestampToUrl.js";
6
+ import useWorkspaceFile from "../useWorkspaceFile/useWorkspaceFile.js";
7
7
  const useUploadFiles = ({
8
8
  handleOnChange,
9
9
  visibility,
@@ -95,7 +95,7 @@ const useUploadFiles = ({
95
95
  uploadFile,
96
96
  removeFile
97
97
  };
98
- }, useUploadFiles$1 = useUploadFiles;
98
+ };
99
99
  export {
100
- useUploadFiles$1 as default
100
+ useUploadFiles as default
101
101
  };
@@ -7,15 +7,15 @@ declare const useWorkspaceFile: () => {
7
7
  legend?: string | undefined;
8
8
  application?: string | undefined;
9
9
  parentId?: string | undefined;
10
- visibility?: WorkspaceVisibility | undefined;
10
+ visibility?: any;
11
11
  }) => Promise<string | {
12
- file: WorkspaceElement;
12
+ file: any;
13
13
  src: string;
14
14
  }>;
15
15
  create: (file: File, params?: {
16
16
  visibility?: WorkspaceVisibility;
17
17
  application?: string | undefined;
18
- }) => Promise<WorkspaceElement>;
19
- remove: (file: WorkspaceElement | WorkspaceElement[]) => Promise<void>;
18
+ }) => Promise<any>;
19
+ remove: (file: WorkspaceElement | WorkspaceElement[]) => Promise<any>;
20
20
  };
21
21
  export default useWorkspaceFile;
@@ -43,7 +43,7 @@ const useWorkspaceFile = () => ({
43
43
  create: async (file, params) => await odeServices.workspace().saveFile(file, params),
44
44
  // put,
45
45
  remove: async (file) => !file || Array.isArray(file) && file.length === 0 ? Promise.resolve() : await odeServices.workspace().deleteFile(Array.isArray(file) ? file : [file])
46
- }), useWorkspaceFile$1 = useWorkspaceFile;
46
+ });
47
47
  export {
48
- useWorkspaceFile$1 as default
48
+ useWorkspaceFile as default
49
49
  };
@@ -1,9 +1,9 @@
1
- import { Role, ID, WorkspaceElement, WorkspaceSearchFilter } from 'edifice-ts-client';
1
+ import { ID, Role, WorkspaceElement, WorkspaceSearchFilter } from 'edifice-ts-client';
2
2
  import { TreeNode } from '../../components';
3
3
  export type FolderNode = TreeNode & {
4
4
  files?: WorkspaceElement[];
5
5
  };
6
6
  export default function useWorkspaceSearch(rootId: string, rootName: string, filter: WorkspaceSearchFilter, format: Role | Role[] | null): {
7
7
  root: FolderNode;
8
- loadContent: (folderId?: ID) => void;
8
+ loadContent: (folderId?: any) => void;
9
9
  };
@@ -32,7 +32,7 @@ function useWorkspaceSearch(rootId, rootName, filter, format) {
32
32
  ...result,
33
33
  _id: "" + Math.round(Math.random() * 9999)
34
34
  };
35
- return ret.name = result.eType == "folder" ? "folder id=" + ret._id : "file id=" + ret._id, ret;
35
+ return ret.name = result.eType === "folder" ? "folder id=" + ret._id : "file id=" + ret._id, ret;
36
36
  }))) : await odeServices.workspace().listDocuments(filter, realWorkspaceId), subfolders = [], files = [];
37
37
  payload.filter((f) => {
38
38
  if (!format || f.eType === "folder") return !0;
package/dist/editor.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import { EditorContent, useEditor } from "@tiptap/react";
2
2
  import { default as default2 } from "./modules/editor/components/Editor/Editor.js";
3
- import { EditorToolbar } from "./modules/editor/components/EditorToolbar/EditorToolbar.js";
4
3
  import { default as default3 } from "./modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js";
5
4
  import { default as default4 } from "./modules/editor/components/NodeView/AudioNodeView.js";
6
5
  import { default as default5 } from "./modules/editor/components/NodeView/AttachmentNodeView.js";
7
6
  import { default as default6 } from "./modules/editor/components/NodeView/ImageNodeView.js";
8
7
  import { default as default7 } from "./modules/editor/components/NodeView/LinkerNodeView.js";
9
8
  import { default as default8 } from "./modules/editor/components/NodeView/VideoNodeView.js";
9
+ import { default as default9 } from "./modules/editor/components/Toolbar/TableToolbar.js";
10
+ import { default as default10 } from "./modules/editor/components/Toolbar/LinkToolbar.js";
11
+ import { EditorToolbar } from "./modules/editor/components/EditorToolbar/EditorToolbar.js";
10
12
  import { AttachmentRenderer } from "./modules/editor/components/Renderer/AttachmentRenderer.js";
11
13
  import { AudioRenderer } from "./modules/editor/components/Renderer/AudioRenderer.js";
12
14
  import { LinkerRenderer } from "./modules/editor/components/Renderer/LinkerRenderer.js";
13
15
  import { MediaRenderer } from "./modules/editor/components/Renderer/MediaRenderer.js";
14
- import { default as default9 } from "./modules/editor/components/Toolbar/TableToolbar.js";
15
- import { default as default10 } from "./modules/editor/components/Toolbar/LinkToolbar.js";
16
16
  import { useActionOptions } from "./modules/editor/hooks/useActionOptions.js";
17
17
  import { useCommentEditor } from "./modules/editor/hooks/useCommentEditor.js";
18
18
  import { EditorContext, useEditorContext } from "./modules/editor/hooks/useEditorContext.js";
@@ -1,7 +1,7 @@
1
1
  import UAParser from "ua-parser-js";
2
2
  function useBrowserInfo(userAgent) {
3
3
  var _a, _b, _c;
4
- const uaParser = new UAParser(userAgent), os = uaParser.getOS(), device = uaParser.getDevice(), browser = uaParser.getBrowser(), isIphone = ((_a = device.model) == null ? void 0 : _a.indexOf("iPhone")) != -1, isIpod = ((_b = device.model) == null ? void 0 : _b.indexOf("iPod")) != -1, isIpad = ((_c = device.model) == null ? void 0 : _c.indexOf("iPad")) != -1;
4
+ const uaParser = new UAParser(userAgent), os = uaParser.getOS(), device = uaParser.getDevice(), browser = uaParser.getBrowser(), isIphone = ((_a = device.model) == null ? void 0 : _a.indexOf("iPhone")) !== -1, isIpod = ((_b = device.model) == null ? void 0 : _b.indexOf("iPod")) !== -1, isIpad = ((_c = device.model) == null ? void 0 : _c.indexOf("iPad")) !== -1;
5
5
  return {
6
6
  os,
7
7
  device,
@@ -1,4 +1,4 @@
1
- import { MutableRefObject, Dispatch, SetStateAction } from 'react';
1
+ import { Dispatch, MutableRefObject, SetStateAction } from 'react';
2
2
  import { Placement } from '@floating-ui/react';
3
3
  export declare enum KEYS {
4
4
  Enter = "Enter",
@@ -152,7 +152,7 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
152
152
  },
153
153
  setVisible
154
154
  };
155
- }, useDropdown$1 = useDropdown;
155
+ };
156
156
  export {
157
- useDropdown$1 as default
157
+ useDropdown as default
158
158
  };
@@ -70,7 +70,7 @@ const useDropzone = (props) => {
70
70
  /** Callback to attach to your `input[type=file]` HTMLElement. */
71
71
  handleOnChange
72
72
  };
73
- }, useDropzone$1 = useDropzone;
73
+ };
74
74
  export {
75
- useDropzone$1 as default
75
+ useDropzone as default
76
76
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import toast from "react-hot-toast";
3
- import Alert from "../../components/Alert/Alert.js";
3
+ import { Alert } from "../../components/Alert/Alert.js";
4
4
  const DEFAULT_POSITION = "top-right";
5
5
  function useToast() {
6
6
  return {