@edifice.io/react 2.1.1-develop-b2school.20250328142432 → 2.1.1-develop-b2school.20250402115617
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/hooks/index.d.ts +1 -0
- package/dist/hooks/useWorkspaceFolders/index.d.ts +1 -0
- package/dist/hooks/useWorkspaceFolders/useWorkspaceFolders.d.ts +13 -0
- package/dist/hooks/useWorkspaceFolders/useWorkspaceFolders.js +37 -0
- package/dist/index.js +26 -22
- package/dist/modals.js +18 -16
- package/dist/modules/modals/AddAttachmentToWorkspaceModal/AddAttachmentToWorkspaceModal.d.ts +20 -0
- package/dist/modules/modals/AddAttachmentToWorkspaceModal/AddAttachmentToWorkspaceModal.js +31 -0
- package/dist/modules/modals/AddAttachmentToWorkspaceModal/components/WorkspaceFoldersTree.d.ts +5 -0
- package/dist/modules/modals/AddAttachmentToWorkspaceModal/components/WorkspaceFoldersTree.js +20 -0
- package/dist/modules/modals/AddAttachmentToWorkspaceModal/index.d.ts +1 -0
- package/dist/modules/modals/ConfirmModal/ConfirmModal.js +1 -1
- package/dist/modules/modals/PublishModal/hooks/usePublishModal.d.ts +2 -2
- package/dist/modules/modals/index.d.ts +1 -0
- package/package.json +6 -6
package/dist/hooks/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export * from './useUpload';
|
|
|
29
29
|
export * from './useUploadFiles';
|
|
30
30
|
export * from './useUser';
|
|
31
31
|
export * from './useWorkspaceFile';
|
|
32
|
+
export * from './useWorkspaceFolders';
|
|
32
33
|
export * from './useWorkspaceSearch';
|
|
33
34
|
export * from './useXitiTrackPageLoad';
|
|
34
35
|
export * from './useZendeskGuide';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as useWorkspaceFolders } from './useWorkspaceFolders';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface FolderTreeNode {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
children?: FolderTreeNode[];
|
|
5
|
+
}
|
|
6
|
+
declare function useWorkspaceFolders(): {
|
|
7
|
+
folderTree: {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
children: FolderTreeNode[];
|
|
11
|
+
}[];
|
|
12
|
+
};
|
|
13
|
+
export default useWorkspaceFolders;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { odeServices } from "@edifice.io/client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
function useWorkspaceFolders() {
|
|
6
|
+
const {
|
|
7
|
+
t
|
|
8
|
+
} = useTranslation(), {
|
|
9
|
+
data: folderData
|
|
10
|
+
} = useQuery({
|
|
11
|
+
queryKey: ["workspace-folders"],
|
|
12
|
+
queryFn: () => odeServices.workspace().listFolder("owner", !0)
|
|
13
|
+
});
|
|
14
|
+
return {
|
|
15
|
+
folderTree: useMemo(() => {
|
|
16
|
+
const buildWorkspaceTree = (data) => [{
|
|
17
|
+
id: "my-documents",
|
|
18
|
+
name: t("workspace.myDocuments"),
|
|
19
|
+
children: data
|
|
20
|
+
}];
|
|
21
|
+
if (!folderData) return buildWorkspaceTree([]);
|
|
22
|
+
const nodes = /* @__PURE__ */ new Map(), tree = [];
|
|
23
|
+
return folderData.forEach((item) => {
|
|
24
|
+
nodes.set(item._id, {
|
|
25
|
+
id: item._id,
|
|
26
|
+
name: item.name,
|
|
27
|
+
children: []
|
|
28
|
+
});
|
|
29
|
+
}), folderData.forEach((item) => {
|
|
30
|
+
item.eParent && nodes.has(item.eParent) ? nodes.get(item.eParent).children.push(nodes.get(item._id)) : tree.push(nodes.get(item._id));
|
|
31
|
+
}), buildWorkspaceTree(tree);
|
|
32
|
+
}, [folderData])
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
useWorkspaceFolders as default
|
|
37
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -68,17 +68,19 @@ import { default as default67 } from "./hooks/useUpload/useUpload.js";
|
|
|
68
68
|
import { default as default68 } from "./hooks/useUploadFiles/useUploadFiles.js";
|
|
69
69
|
import { default as default69 } from "./hooks/useUser/useUser.js";
|
|
70
70
|
import { default as default70 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
|
|
71
|
-
import { default as default71 } from "./hooks/
|
|
72
|
-
import { default as default72 } from "./hooks/
|
|
73
|
-
import { default as default73 } from "./hooks/
|
|
74
|
-
import { default as default74 } from "./
|
|
75
|
-
import { default as default75 } from "./modules/modals/
|
|
76
|
-
import { default as default76 } from "./modules/modals/
|
|
77
|
-
import { default as default77 } from "./modules/modals/
|
|
78
|
-
import { default as default78 } from "./modules/modals/
|
|
79
|
-
import { default as default79 } from "./modules/modals/
|
|
80
|
-
import { default as default80 } from "./modules/modals/
|
|
81
|
-
import { default as default81 } from "./modules/modals/ShareModal/
|
|
71
|
+
import { default as default71 } from "./hooks/useWorkspaceFolders/useWorkspaceFolders.js";
|
|
72
|
+
import { default as default72 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
73
|
+
import { default as default73 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
|
|
74
|
+
import { default as default74 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
75
|
+
import { default as default75 } from "./modules/modals/AddAttachmentToWorkspaceModal/AddAttachmentToWorkspaceModal.js";
|
|
76
|
+
import { default as default76 } from "./modules/modals/ConfirmModal/ConfirmModal.js";
|
|
77
|
+
import { default as default77 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
|
|
78
|
+
import { default as default78 } from "./modules/modals/PublishModal/PublishModal.js";
|
|
79
|
+
import { default as default79 } from "./modules/modals/ResourceModal/apps/BlogPublic.js";
|
|
80
|
+
import { default as default80 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
81
|
+
import { default as default81 } from "./modules/modals/ShareModal/ShareModal.js";
|
|
82
|
+
import { default as default82 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
|
|
83
|
+
import { default as default83 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
82
84
|
import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
|
|
83
85
|
import { DropzoneContext, useDropzoneContext } from "./components/Dropzone/DropzoneContext.js";
|
|
84
86
|
import { Column, Grid } from "./components/Grid/Grid.js";
|
|
@@ -108,13 +110,14 @@ import { mergeRefs, setRef } from "./utilities/refs/ref.js";
|
|
|
108
110
|
export {
|
|
109
111
|
AccessiblePalette,
|
|
110
112
|
default2 as ActionBar,
|
|
113
|
+
default75 as AddAttachmentToWorkspaceModal,
|
|
111
114
|
default3 as Alert,
|
|
112
115
|
default4 as AppHeader,
|
|
113
116
|
default5 as AppIcon,
|
|
114
117
|
default6 as Attachment,
|
|
115
118
|
default7 as Avatar,
|
|
116
119
|
default8 as Badge,
|
|
117
|
-
|
|
120
|
+
default79 as BlogPublic,
|
|
118
121
|
default9 as Breadcrumb,
|
|
119
122
|
default10 as Button,
|
|
120
123
|
default13 as Card,
|
|
@@ -123,7 +126,7 @@ export {
|
|
|
123
126
|
default16 as ColorPickerItem,
|
|
124
127
|
Column,
|
|
125
128
|
default17 as Combobox,
|
|
126
|
-
|
|
129
|
+
default76 as ConfirmModal,
|
|
127
130
|
DefaultPalette,
|
|
128
131
|
DndTree,
|
|
129
132
|
default18 as Dropdown,
|
|
@@ -150,19 +153,19 @@ export {
|
|
|
150
153
|
Menu,
|
|
151
154
|
MockedProvider,
|
|
152
155
|
default30 as Modal,
|
|
153
|
-
|
|
156
|
+
default77 as OnboardingModal,
|
|
154
157
|
Popover,
|
|
155
158
|
PopoverBody,
|
|
156
159
|
PopoverFooter,
|
|
157
160
|
PopoverHeader,
|
|
158
|
-
|
|
161
|
+
default78 as PublishModal,
|
|
159
162
|
default31 as Radio,
|
|
160
163
|
ResourceModal,
|
|
161
164
|
default32 as SearchBar,
|
|
162
165
|
default12 as SearchButton,
|
|
163
166
|
default33 as Select,
|
|
164
|
-
|
|
165
|
-
|
|
167
|
+
default82 as ShareBlog,
|
|
168
|
+
default81 as ShareModal,
|
|
166
169
|
default37 as SortableTree,
|
|
167
170
|
default34 as Table,
|
|
168
171
|
Tabs,
|
|
@@ -226,7 +229,7 @@ export {
|
|
|
226
229
|
default59 as useLibraryUrl,
|
|
227
230
|
default60 as useMediaLibrary,
|
|
228
231
|
default61 as useScrollToTop,
|
|
229
|
-
|
|
232
|
+
default83 as useShareMutation,
|
|
230
233
|
default62 as useTitle,
|
|
231
234
|
default63 as useToast,
|
|
232
235
|
default64 as useToggle,
|
|
@@ -234,13 +237,14 @@ export {
|
|
|
234
237
|
default66 as useTrashedResource,
|
|
235
238
|
useTreeSortable,
|
|
236
239
|
useTreeView,
|
|
237
|
-
|
|
240
|
+
default80 as useUpdateMutation,
|
|
238
241
|
default67 as useUpload,
|
|
239
242
|
default68 as useUploadFiles,
|
|
240
243
|
default69 as useUser,
|
|
241
244
|
default70 as useWorkspaceFile,
|
|
242
|
-
default71 as
|
|
243
|
-
default72 as
|
|
244
|
-
default73 as
|
|
245
|
+
default71 as useWorkspaceFolders,
|
|
246
|
+
default72 as useWorkspaceSearch,
|
|
247
|
+
default73 as useXitiTrackPageLoad,
|
|
248
|
+
default74 as useZendeskGuide,
|
|
245
249
|
wrapTreeNode
|
|
246
250
|
};
|
package/dist/modals.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { default as default2 } from "./modules/modals/
|
|
2
|
-
import { default as default3 } from "./modules/modals/
|
|
3
|
-
import { default as default4 } from "./modules/modals/
|
|
4
|
-
import { default as default5 } from "./modules/modals/
|
|
5
|
-
import { default as default6 } from "./modules/modals/ResourceModal/
|
|
6
|
-
import { default as default7 } from "./modules/modals/
|
|
7
|
-
import { default as default8 } from "./modules/modals/ShareModal/
|
|
8
|
-
import { default as default9 } from "./modules/modals/ShareModal/
|
|
1
|
+
import { default as default2 } from "./modules/modals/AddAttachmentToWorkspaceModal/AddAttachmentToWorkspaceModal.js";
|
|
2
|
+
import { default as default3 } from "./modules/modals/ConfirmModal/ConfirmModal.js";
|
|
3
|
+
import { default as default4 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
|
|
4
|
+
import { default as default5 } from "./modules/modals/PublishModal/PublishModal.js";
|
|
5
|
+
import { default as default6 } from "./modules/modals/ResourceModal/apps/BlogPublic.js";
|
|
6
|
+
import { default as default7 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
7
|
+
import { default as default8 } from "./modules/modals/ShareModal/ShareModal.js";
|
|
8
|
+
import { default as default9 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
|
|
9
|
+
import { default as default10 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
9
10
|
import { ResourceModal } from "./modules/modals/ResourceModal/ResourceModal.js";
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
default3 as
|
|
14
|
-
default4 as
|
|
12
|
+
default2 as AddAttachmentToWorkspaceModal,
|
|
13
|
+
default6 as BlogPublic,
|
|
14
|
+
default3 as ConfirmModal,
|
|
15
|
+
default4 as OnboardingModal,
|
|
16
|
+
default5 as PublishModal,
|
|
15
17
|
ResourceModal,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
default9 as ShareBlog,
|
|
19
|
+
default8 as ShareModal,
|
|
20
|
+
default10 as useShareMutation,
|
|
21
|
+
default7 as useUpdateMutation
|
|
20
22
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface AddAttachmentToWorkspaceModalProps {
|
|
2
|
+
/**
|
|
3
|
+
* Modal id (useful when multiple modal on the same page)
|
|
4
|
+
*/
|
|
5
|
+
id?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Is Modal Open
|
|
8
|
+
*/
|
|
9
|
+
isOpen?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Function to call when success button proceed
|
|
12
|
+
*/
|
|
13
|
+
onSuccess?: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* Function to call when closing modal
|
|
16
|
+
*/
|
|
17
|
+
onCancel?: () => void;
|
|
18
|
+
}
|
|
19
|
+
export default function AddAttachmentToWorkspaceModal({ id, isOpen, onSuccess, onCancel, }: AddAttachmentToWorkspaceModalProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import WorkspaceFoldersTree from "./components/WorkspaceFoldersTree.js";
|
|
4
|
+
import { useState, useEffect } from "react";
|
|
5
|
+
import Modal from "../../../components/Modal/Modal.js";
|
|
6
|
+
import Button from "../../../components/Button/Button.js";
|
|
7
|
+
function AddAttachmentToWorkspaceModal({
|
|
8
|
+
id = "add-attachment-to-workspace-modal",
|
|
9
|
+
isOpen = !1,
|
|
10
|
+
onSuccess = () => ({}),
|
|
11
|
+
onCancel = () => ({})
|
|
12
|
+
}) {
|
|
13
|
+
const {
|
|
14
|
+
t
|
|
15
|
+
} = useTranslation(), [selectedFolderId, setSelectedFolderId] = useState(), [disabled, setDisabled] = useState(!1), handleFolderSelected = (folderId) => {
|
|
16
|
+
setSelectedFolderId(folderId);
|
|
17
|
+
};
|
|
18
|
+
return useEffect(() => {
|
|
19
|
+
setDisabled(!selectedFolderId);
|
|
20
|
+
}, [selectedFolderId]), /* @__PURE__ */ jsxs(Modal, { isOpen, onModalClose: onCancel, id, size: "md", children: [
|
|
21
|
+
/* @__PURE__ */ jsx(Modal.Header, { onModalClose: onCancel, children: t("attachments.add.to.folder.modal") }),
|
|
22
|
+
/* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx(WorkspaceFoldersTree, { onFolderSelected: handleFolderSelected }) }),
|
|
23
|
+
/* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
|
24
|
+
/* @__PURE__ */ jsx(Button, { type: "button", color: "tertiary", variant: "ghost", onClick: onCancel, children: t("cancel") }),
|
|
25
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", color: "primary", variant: "filled", onClick: onSuccess, disabled, children: t("add") })
|
|
26
|
+
] })
|
|
27
|
+
] });
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
AddAttachmentToWorkspaceModal as default
|
|
31
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import useWorkspaceFolders from "../../../../hooks/useWorkspaceFolders/useWorkspaceFolders.js";
|
|
4
|
+
import Tree from "../../../../components/Tree/components/Tree.js";
|
|
5
|
+
function WorkspaceFoldersTree({
|
|
6
|
+
onFolderSelected
|
|
7
|
+
}) {
|
|
8
|
+
const {
|
|
9
|
+
t
|
|
10
|
+
} = useTranslation(), {
|
|
11
|
+
folderTree
|
|
12
|
+
} = useWorkspaceFolders();
|
|
13
|
+
return /* @__PURE__ */ jsxs("div", { className: "d-flex flex-column gap-12", children: [
|
|
14
|
+
/* @__PURE__ */ jsx("p", { children: t("attachments.add.to.folder.modal.description") }),
|
|
15
|
+
/* @__PURE__ */ jsx("div", { className: "border border-gray-400 rounded", children: /* @__PURE__ */ jsx("div", { className: "p-12", children: /* @__PURE__ */ jsx(Tree, { nodes: folderTree, onTreeItemClick: onFolderSelected, shouldExpandAllNodes: !0 }) }) })
|
|
16
|
+
] });
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
WorkspaceFoldersTree as default
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AddAttachmentToWorkspaceModal } from './AddAttachmentToWorkspaceModal';
|
|
@@ -15,7 +15,7 @@ export interface FormDataProps {
|
|
|
15
15
|
keyWords: string;
|
|
16
16
|
}
|
|
17
17
|
export default function usePublishModal({ onSuccess, resource }: ModalProps): {
|
|
18
|
-
control: import('react-hook-form').Control<FormDataProps, any>;
|
|
18
|
+
control: import('react-hook-form').Control<FormDataProps, any, FormDataProps>;
|
|
19
19
|
cover: string | File | Blob;
|
|
20
20
|
formState: {
|
|
21
21
|
errors: import('react-hook-form').FieldErrors<FormDataProps>;
|
|
@@ -25,7 +25,7 @@ export default function usePublishModal({ onSuccess, resource }: ModalProps): {
|
|
|
25
25
|
};
|
|
26
26
|
handleDeleteImage: () => void;
|
|
27
27
|
handlePublish: SubmitHandler<FormDataProps>;
|
|
28
|
-
handleSubmit: import('react-hook-form').UseFormHandleSubmit<FormDataProps,
|
|
28
|
+
handleSubmit: import('react-hook-form').UseFormHandleSubmit<FormDataProps, FormDataProps>;
|
|
29
29
|
handleUploadImage: (file: File | string) => void;
|
|
30
30
|
register: import('react-hook-form').UseFormRegister<FormDataProps>;
|
|
31
31
|
selectActivities: (value: string | number) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.1.1-develop-b2school.
|
|
3
|
+
"version": "2.1.1-develop-b2school.20250402115617",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -118,9 +118,9 @@
|
|
|
118
118
|
"react-slugify": "^3.0.3",
|
|
119
119
|
"swiper": "^10.1.0",
|
|
120
120
|
"ua-parser-js": "^1.0.36",
|
|
121
|
-
"@edifice.io/bootstrap": "2.1.1-develop-b2school.
|
|
122
|
-
"@edifice.io/tiptap-extensions": "2.1.1-develop-b2school.
|
|
123
|
-
"@edifice.io/utilities": "2.1.1-develop-b2school.
|
|
121
|
+
"@edifice.io/bootstrap": "2.1.1-develop-b2school.20250402115617",
|
|
122
|
+
"@edifice.io/tiptap-extensions": "2.1.1-develop-b2school.20250402115617",
|
|
123
|
+
"@edifice.io/utilities": "2.1.1-develop-b2school.20250402115617"
|
|
124
124
|
},
|
|
125
125
|
"devDependencies": {
|
|
126
126
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -151,8 +151,8 @@
|
|
|
151
151
|
"vite": "^5.4.11",
|
|
152
152
|
"vite-plugin-dts": "^4.1.0",
|
|
153
153
|
"vite-tsconfig-paths": "^5.0.1",
|
|
154
|
-
"@edifice.io/client": "2.1.1-develop-b2school.
|
|
155
|
-
"@edifice.io/config": "2.1.1-develop-b2school.
|
|
154
|
+
"@edifice.io/client": "2.1.1-develop-b2school.20250402115617",
|
|
155
|
+
"@edifice.io/config": "2.1.1-develop-b2school.20250402115617"
|
|
156
156
|
},
|
|
157
157
|
"peerDependencies": {
|
|
158
158
|
"@react-spring/web": "^9.7.5",
|