@edifice.io/react 2.0.1-develop-hotfix.1736863177286 → 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/dist/components/AppIcon/AppIcon.js +1 -1
- package/dist/components/Layout/components/Header.js +1 -1
- package/dist/{hooks/useHeader → components/Layout/hooks}/useHeader.js +6 -6
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/hooks/index.d.ts +1 -5
- package/dist/hooks/useConversation/useConversation.js +1 -3
- package/dist/hooks/useHttpErrorToast/useHttpErrorToast.js +21 -0
- package/dist/hooks/useTrapFocus/useTrapFocus.d.ts +1 -1
- package/dist/hooks/useTrapFocus/useTrapFocus.js +2 -3
- package/dist/index.js +110 -118
- package/dist/modules/audience/ReactionModal.Card.js +4 -4
- package/dist/modules/comments/components/Comment.js +7 -10
- package/dist/modules/comments/context/Context.d.ts +0 -2
- package/dist/modules/comments/hooks/useComments.d.ts +1 -1
- package/dist/modules/comments/hooks/useComments.js +1 -1
- package/dist/modules/comments/hooks/useCommentsContext.d.ts +0 -1
- package/dist/modules/comments/provider/CommentProvider.js +1 -2
- package/dist/modules/comments/types.d.ts +1 -5
- package/dist/modules/editor/components/Renderer/AttachmentRenderer.js +4 -5
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +5 -1
- package/package.json +24 -24
- package/dist/hooks/useAvatar/index.d.ts +0 -1
- package/dist/hooks/useAvatar/useAvatar.d.ts +0 -6
- package/dist/hooks/useAvatar/useAvatar.js +0 -30
- package/dist/hooks/useHeader/index.d.ts +0 -1
- package/dist/hooks/useHeader/useHeader.d.ts +0 -5
- package/dist/modules/comments/components/DeleteModal.d.ts +0 -7
- package/dist/modules/comments/components/DeleteModal.js +0 -19
|
@@ -32,7 +32,7 @@ const AppIcon = /* @__PURE__ */ forwardRef(({
|
|
|
32
32
|
...iconSizes,
|
|
33
33
|
...iconVariant,
|
|
34
34
|
...iconFits,
|
|
35
|
-
[`bg-light-${appCode}`]:
|
|
35
|
+
[`bg-light-${appCode}`]: !isContain,
|
|
36
36
|
[`color-app-${appCode}`]: appCode
|
|
37
37
|
}, className), IconComponent = iconsApps[`Icon${appCode.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("")}`] ?? SvgIconPlaceholder;
|
|
38
38
|
if (isIconURL) {
|
|
@@ -14,6 +14,7 @@ import SvgIconNewRelease from "../../../modules/icons/components/nav/IconNewRele
|
|
|
14
14
|
import SvgIconOneMessaging from "../../../modules/icons/components/nav/IconOneMessaging.js";
|
|
15
15
|
import SvgIconOneProfile from "../../../modules/icons/components/nav/IconOneProfile.js";
|
|
16
16
|
import SvgIconUserbook from "../../../modules/icons/components/nav/IconUserbook.js";
|
|
17
|
+
import useHeader from "../hooks/useHeader.js";
|
|
17
18
|
import Help from "./Help.js";
|
|
18
19
|
import { Navbar } from "./Navbar.js";
|
|
19
20
|
import { NavBarNav } from "./NavbarNav.js";
|
|
@@ -25,7 +26,6 @@ import useConversation from "../../../hooks/useConversation/useConversation.js";
|
|
|
25
26
|
import useUser from "../../../hooks/useUser/useUser.js";
|
|
26
27
|
import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
27
28
|
import { useHelp } from "../hooks/useHelp.js";
|
|
28
|
-
import useHeader from "../../../hooks/useHeader/useHeader.js";
|
|
29
29
|
import Avatar from "../../Avatar/Avatar.js";
|
|
30
30
|
import Badge from "../../Badge/Badge.js";
|
|
31
31
|
import VisuallyHidden from "../../VisuallyHidden/VisuallyHidden.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useState, useId, useCallback, useMemo } from "react";
|
|
2
2
|
import { odeServices } from "@edifice.io/client";
|
|
3
|
+
import { useHover } from "@uidotdev/usehooks";
|
|
3
4
|
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { useEdificeClient } from "
|
|
5
|
-
import { useEdificeTheme } from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import useHasWorkflow from "../useHasWorkflow/useHasWorkflow.js";
|
|
5
|
+
import { useEdificeClient } from "../../../providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
6
|
+
import { useEdificeTheme } from "../../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
7
|
+
import useBookmark from "../../../hooks/useBookmark/useBookmark.js";
|
|
8
|
+
import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
9
9
|
function useHeader({
|
|
10
10
|
user,
|
|
11
11
|
avatar
|
|
@@ -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
|
|
@@ -20,7 +20,7 @@ const Root = /* @__PURE__ */ forwardRef((props, ref) => {
|
|
|
20
20
|
scrollable = !1,
|
|
21
21
|
focusId,
|
|
22
22
|
children
|
|
23
|
-
} = props, ariaLabelId = `aria_label_${id}`, ariaDescriptionId = `aria_desc_${id}`, modalRef = useClickOutside(onModalClose), trapRef = useTrapFocus(
|
|
23
|
+
} = props, ariaLabelId = `aria_label_${id}`, ariaDescriptionId = `aria_desc_${id}`, modalRef = useClickOutside(onModalClose), trapRef = useTrapFocus();
|
|
24
24
|
useKeyPress(onModalClose, ["Escape"]), useEffect(() => {
|
|
25
25
|
if (isOpen && (document.body.style.overflow = "hidden", focusId)) {
|
|
26
26
|
const elem = document.getElementById(focusId);
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
export * from './useAvatar';
|
|
2
1
|
export * from './useBookmark';
|
|
3
2
|
export * from './useBreakpoint';
|
|
4
3
|
export * from './useBrowserInfo';
|
|
5
4
|
export * from './useCantoo';
|
|
6
5
|
export * from './useCheckable';
|
|
7
6
|
export * from './useClickOutside';
|
|
8
|
-
export * from './useConf';
|
|
9
7
|
export * from './useConversation';
|
|
10
8
|
export * from './useDate';
|
|
11
9
|
export * from './useDebounce';
|
|
@@ -14,16 +12,14 @@ export * from './useDropdown';
|
|
|
14
12
|
export * from './useDropzone';
|
|
15
13
|
export * from './useEdificeIcons';
|
|
16
14
|
export * from './useHasWorkflow';
|
|
17
|
-
export * from './useHeader';
|
|
18
15
|
export * from './useHover';
|
|
16
|
+
export * from './useHttpErrorToast';
|
|
19
17
|
export * from './useImage';
|
|
20
18
|
export * from './useIsAdml';
|
|
21
19
|
export * from './useKeyPress';
|
|
22
20
|
export * from './useLibraryUrl';
|
|
23
21
|
export * from './useMediaLibrary';
|
|
24
|
-
export * from './useResourceSearch';
|
|
25
22
|
export * from './useScrollToTop';
|
|
26
|
-
export * from './useSession';
|
|
27
23
|
export * from './useTitle';
|
|
28
24
|
export * from './useToast';
|
|
29
25
|
export * from './useToggle';
|
|
@@ -10,9 +10,7 @@ const useConversation = () => {
|
|
|
10
10
|
try {
|
|
11
11
|
const {
|
|
12
12
|
count
|
|
13
|
-
} = await odeServices.
|
|
14
|
-
"Content-Type": "application/json"
|
|
15
|
-
}).http().get(url, {
|
|
13
|
+
} = await odeServices.http().get(url, {
|
|
16
14
|
queryParams
|
|
17
15
|
});
|
|
18
16
|
setMessages(count ?? 0);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { useRef, useEffect } from "react";
|
|
2
|
+
import { odeServices, LAYER_NAME } from "@edifice.io/client";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import useToast from "../useToast/useToast.js";
|
|
5
|
+
const useHttpErrorToast = (options) => {
|
|
6
|
+
const message = useRef(), toast = useToast(), {
|
|
7
|
+
t
|
|
8
|
+
} = useTranslation();
|
|
9
|
+
return useEffect(() => {
|
|
10
|
+
const subscription = odeServices.notify().events().subscribe(LAYER_NAME.TRANSPORT, (event) => {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
message.current = t(((_b = (_a = event == null ? void 0 : event.data) == null ? void 0 : _a.payload) == null ? void 0 : _b.error) || event.data.response.statusText), toast.error(/* @__PURE__ */ React.createElement("div", {
|
|
13
|
+
children: [message.current]
|
|
14
|
+
}), options);
|
|
15
|
+
});
|
|
16
|
+
return () => subscription.revoke();
|
|
17
|
+
}, [t, toast]), message.current;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
useHttpErrorToast as default
|
|
21
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function useTrapFocus(
|
|
1
|
+
export default function useTrapFocus(): import('react').MutableRefObject<HTMLElement | null>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useRef, useEffect } from "react";
|
|
2
|
-
function useTrapFocus(
|
|
2
|
+
function useTrapFocus() {
|
|
3
3
|
const ref = useRef(null), focusableElements = 'button:not([disabled]), [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
|
|
4
4
|
return useEffect(() => {
|
|
5
|
-
if (!isActive) return;
|
|
6
5
|
const node = ref.current, firstFocusableElement = node.querySelectorAll(focusableElements)[0], focusableContent = node.querySelectorAll(focusableElements), lastFocusableElement = ref && (focusableContent == null ? void 0 : focusableContent[focusableContent.length - 1]), handleKeydown = (event) => {
|
|
7
6
|
event.key === "Tab" && (event.shiftKey ? document.activeElement === firstFocusableElement && (lastFocusableElement.focus(), event.preventDefault()) : document.activeElement === lastFocusableElement && (firstFocusableElement.focus(), event.preventDefault()));
|
|
8
7
|
};
|
|
@@ -10,7 +9,7 @@ function useTrapFocus(isActive) {
|
|
|
10
9
|
return node.addEventListener("keydown", handleKeydown), () => {
|
|
11
10
|
node.removeEventListener("keydown", handleKeydown);
|
|
12
11
|
};
|
|
13
|
-
}, [
|
|
12
|
+
}, []), ref;
|
|
14
13
|
}
|
|
15
14
|
export {
|
|
16
15
|
useTrapFocus as default
|
package/dist/index.js
CHANGED
|
@@ -23,81 +23,77 @@ import { DndTree } from "./components/Tree/components/DndTree.js";
|
|
|
23
23
|
import { default as default23 } from "./components/Tree/components/SortableTree.js";
|
|
24
24
|
import { default as default24 } from "./components/Tree/components/Tree.js";
|
|
25
25
|
import { default as default25 } from "./components/TreeView/TreeView.js";
|
|
26
|
-
import { default as default26 } from "./hooks/
|
|
27
|
-
import { default as default27 } from "./hooks/
|
|
28
|
-
import { default as default28 } from "./hooks/
|
|
29
|
-
import { default as default29 } from "./hooks/
|
|
30
|
-
import { default as default30 } from "./hooks/
|
|
31
|
-
import { default as default31 } from "./hooks/
|
|
32
|
-
import { default as default32 } from "./hooks/
|
|
33
|
-
import { default as default33 } from "./hooks/
|
|
34
|
-
import { default as default34 } from "./hooks/
|
|
35
|
-
import { default as default35 } from "./hooks/
|
|
36
|
-
import { default as default36 } from "./hooks/
|
|
37
|
-
import { default as default37 } from "./hooks/
|
|
38
|
-
import { default as default38 } from "./hooks/
|
|
39
|
-
import { default as default39 } from "./hooks/
|
|
40
|
-
import { default as default40 } from "./hooks/
|
|
41
|
-
import { default as default41 } from "./hooks/
|
|
42
|
-
import { default as default42 } from "./hooks/
|
|
43
|
-
import { default as default43 } from "./hooks/
|
|
44
|
-
import { default as default44 } from "./hooks/
|
|
45
|
-
import { default as default45 } from "./hooks/
|
|
46
|
-
import { default as default46 } from "./hooks/
|
|
47
|
-
import { default as default47 } from "./hooks/
|
|
48
|
-
import { default as default48 } from "./hooks/
|
|
49
|
-
import { default as default49 } from "./hooks/
|
|
50
|
-
import { default as default50 } from "./hooks/
|
|
51
|
-
import { default as default51 } from "./hooks/
|
|
52
|
-
import { default as default52 } from "./hooks/
|
|
53
|
-
import { default as default53 } from "./hooks/
|
|
54
|
-
import { default as default54 } from "./hooks/
|
|
55
|
-
import { default as default55 } from "./
|
|
56
|
-
import { default as default56 } from "./
|
|
57
|
-
import { default as default57 } from "./components/
|
|
58
|
-
import { default as default58 } from "./components/
|
|
59
|
-
import { default as default59 } from "./components/Button/Button.js";
|
|
60
|
-
import { default as default60 } from "./components/Checkbox/Checkbox.js";
|
|
26
|
+
import { default as default26 } from "./hooks/useBookmark/useBookmark.js";
|
|
27
|
+
import { default as default27 } from "./hooks/useBreakpoint/useBreakpoint.js";
|
|
28
|
+
import { default as default28 } from "./hooks/useBrowserInfo/useBrowserInfo.js";
|
|
29
|
+
import { default as default29 } from "./hooks/useCantoo/useCantoo.js";
|
|
30
|
+
import { default as default30 } from "./hooks/useClickOutside/useClickOutside.js";
|
|
31
|
+
import { default as default31 } from "./hooks/useConversation/useConversation.js";
|
|
32
|
+
import { default as default32 } from "./hooks/useDate/useDate.js";
|
|
33
|
+
import { default as default33 } from "./hooks/useDebounce/useDebounce.js";
|
|
34
|
+
import { default as default34 } from "./hooks/useDirectory/useDirectory.js";
|
|
35
|
+
import { default as default35 } from "./hooks/useDropdown/useDropdown.js";
|
|
36
|
+
import { default as default36 } from "./hooks/useDropzone/useDropzone.js";
|
|
37
|
+
import { default as default37 } from "./hooks/useEdificeIcons/useEdificeIcons.js";
|
|
38
|
+
import { default as default38 } from "./hooks/useHover/useHover.js";
|
|
39
|
+
import { default as default39 } from "./hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
40
|
+
import { default as default40 } from "./hooks/useImage/useImage.js";
|
|
41
|
+
import { default as default41 } from "./hooks/useIsAdml/useIsAdml.js";
|
|
42
|
+
import { default as default42 } from "./hooks/useKeyPress/useKeyPress.js";
|
|
43
|
+
import { default as default43 } from "./hooks/useLibraryUrl/useLibraryUrl.js";
|
|
44
|
+
import { default as default44 } from "./hooks/useScrollToTop/useScrollToTop.js";
|
|
45
|
+
import { default as default45 } from "./hooks/useTitle/useTitle.js";
|
|
46
|
+
import { default as default46 } from "./hooks/useToggle/useToggle.js";
|
|
47
|
+
import { default as default47 } from "./hooks/useTrapFocus/useTrapFocus.js";
|
|
48
|
+
import { default as default48 } from "./hooks/useTrashedResource/useTrashedResource.js";
|
|
49
|
+
import { default as default49 } from "./hooks/useUpload/useUpload.js";
|
|
50
|
+
import { default as default50 } from "./hooks/useUploadFiles/useUploadFiles.js";
|
|
51
|
+
import { default as default51 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
|
|
52
|
+
import { default as default52 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
53
|
+
import { default as default53 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
|
|
54
|
+
import { default as default54 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
55
|
+
import { default as default55 } from "./components/Alert/Alert.js";
|
|
56
|
+
import { default as default56 } from "./components/Avatar/Avatar.js";
|
|
57
|
+
import { default as default57 } from "./components/Button/Button.js";
|
|
58
|
+
import { default as default58 } from "./components/Checkbox/Checkbox.js";
|
|
61
59
|
import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
|
|
62
|
-
import { default as
|
|
60
|
+
import { default as default59 } from "./components/Combobox/Combobox.js";
|
|
63
61
|
import { DropzoneContext, useDropzoneContext } from "./components/Dropzone/DropzoneContext.js";
|
|
64
|
-
import { default as
|
|
62
|
+
import { default as default60 } from "./components/Form/FormControl.js";
|
|
65
63
|
import { Column, Grid } from "./components/Grid/Grid.js";
|
|
66
|
-
import { default as
|
|
67
|
-
import { default as
|
|
68
|
-
import { default as
|
|
64
|
+
import { default as default61 } from "./components/Heading/Heading.js";
|
|
65
|
+
import { default as default62 } from "./components/Input/Input.js";
|
|
66
|
+
import { default as default63 } from "./components/Label/Label.js";
|
|
69
67
|
import { Layout } from "./components/Layout/Layout.js";
|
|
70
68
|
import { List } from "./components/List/List.js";
|
|
71
|
-
import { default as
|
|
69
|
+
import { default as default64 } from "./components/LoadingScreen/LoadingScreen.js";
|
|
72
70
|
import { Menu } from "./components/Menu/components/Menu.js";
|
|
73
|
-
import { default as
|
|
71
|
+
import { default as default65 } from "./components/Modal/Modal.js";
|
|
74
72
|
import { Popover, PopoverBody, PopoverFooter, PopoverHeader } from "./components/Popover/Popover.js";
|
|
75
|
-
import { default as
|
|
73
|
+
import { default as default66 } from "./components/Radio/Radio.js";
|
|
76
74
|
import { Tabs } from "./components/Tabs/components/Tabs.js";
|
|
77
|
-
import { default as
|
|
75
|
+
import { default as default67 } from "./components/TextArea/TextArea.js";
|
|
78
76
|
import { Toolbar } from "./components/Toolbar/Toolbar.js";
|
|
79
|
-
import { default as
|
|
77
|
+
import { default as default68 } from "./components/Tooltip/Tooltip.js";
|
|
80
78
|
import { useTreeSortable } from "./components/Tree/hooks/useTreeSortable.js";
|
|
81
79
|
import { buildTree, determineNewParentId, findItemIndexInTree, flattenNodes, flattenTree, generateUpdateData, getActiveAndOverNodes, getDragDepth, getIndicesToUpdate, getProjection, updateParentIds } from "./components/Tree/utilities/tree-sortable.js";
|
|
82
80
|
import { useTreeView } from "./components/TreeView/hooks/useTreeView.js";
|
|
83
81
|
import { TreeNode } from "./components/TreeView/TreeNode.js";
|
|
84
82
|
import { TreeNodeFolderWrapper, addNode, arrayUnique, deleteNode, findNodeById, findParentNode, findPathById, findTreeNode, getAncestors, hasChildren, modifyNode, moveNode, updateNode, wrapTreeNode } from "./components/TreeView/utilities/treeview.js";
|
|
85
|
-
import { default as
|
|
83
|
+
import { default as default69 } from "./components/VisuallyHidden/VisuallyHidden.js";
|
|
86
84
|
import { useCheckable } from "./hooks/useCheckable/useCheckable.js";
|
|
87
|
-
import { default as
|
|
88
|
-
import { default as
|
|
89
|
-
import { default as
|
|
90
|
-
import {
|
|
91
|
-
import { default as
|
|
92
|
-
import { default as
|
|
93
|
-
import { default as
|
|
94
|
-
import { default as
|
|
95
|
-
import { default as default79 } from "./modules/modals/ResourceModal/apps/BlogPublic.js";
|
|
96
|
-
import { default as default80 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
85
|
+
import { default as default70 } from "./hooks/useHasWorkflow/useHasWorkflow.js";
|
|
86
|
+
import { default as default71 } from "./hooks/useMediaLibrary/useMediaLibrary.js";
|
|
87
|
+
import { default as default72 } from "./hooks/useToast/useToast.js";
|
|
88
|
+
import { default as default73 } from "./hooks/useUser/useUser.js";
|
|
89
|
+
import { default as default74 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
|
|
90
|
+
import { default as default75 } from "./modules/modals/PublishModal/PublishModal.js";
|
|
91
|
+
import { default as default76 } from "./modules/modals/ResourceModal/apps/BlogPublic.js";
|
|
92
|
+
import { default as default77 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
97
93
|
import { ResourceModal } from "./modules/modals/ResourceModal/ResourceModal.js";
|
|
98
|
-
import { default as
|
|
99
|
-
import { default as
|
|
100
|
-
import { default as
|
|
94
|
+
import { default as default78 } from "./modules/modals/ShareModal/ShareModal.js";
|
|
95
|
+
import { default as default79 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
|
|
96
|
+
import { default as default80 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
101
97
|
import { EdificeClientProvider } from "./providers/EdificeClientProvider/EdificeClientProvider.js";
|
|
102
98
|
import { EdificeClientContext } from "./providers/EdificeClientProvider/EdificeClientProvider.context.js";
|
|
103
99
|
import { useEdificeClient } from "./providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
@@ -110,21 +106,21 @@ import { mergeRefs, setRef } from "./utilities/refs/ref.js";
|
|
|
110
106
|
export {
|
|
111
107
|
AccessiblePalette,
|
|
112
108
|
default2 as ActionBar,
|
|
113
|
-
|
|
109
|
+
default55 as Alert,
|
|
114
110
|
default3 as AppHeader,
|
|
115
111
|
default4 as AppIcon,
|
|
116
112
|
default5 as Attachment,
|
|
117
|
-
|
|
113
|
+
default56 as Avatar,
|
|
118
114
|
default6 as Badge,
|
|
119
|
-
|
|
115
|
+
default76 as BlogPublic,
|
|
120
116
|
default7 as Breadcrumb,
|
|
121
|
-
|
|
117
|
+
default57 as Button,
|
|
122
118
|
default10 as Card,
|
|
123
|
-
|
|
119
|
+
default58 as Checkbox,
|
|
124
120
|
default11 as ColorPicker,
|
|
125
121
|
default12 as ColorPickerItem,
|
|
126
122
|
Column,
|
|
127
|
-
|
|
123
|
+
default59 as Combobox,
|
|
128
124
|
DefaultPalette,
|
|
129
125
|
DndTree,
|
|
130
126
|
default13 as Dropdown,
|
|
@@ -135,45 +131,45 @@ export {
|
|
|
135
131
|
EdificeThemeContext,
|
|
136
132
|
EdificeThemeProvider,
|
|
137
133
|
default15 as EmptyScreen,
|
|
138
|
-
|
|
134
|
+
default60 as FormControl,
|
|
139
135
|
default16 as FormText,
|
|
140
136
|
Grid,
|
|
141
|
-
|
|
137
|
+
default61 as Heading,
|
|
142
138
|
default8 as IconButton,
|
|
143
139
|
default17 as Image,
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
default62 as Input,
|
|
141
|
+
default63 as Label,
|
|
146
142
|
Layout,
|
|
147
143
|
List,
|
|
148
144
|
default18 as Loading,
|
|
149
|
-
|
|
145
|
+
default64 as LoadingScreen,
|
|
150
146
|
default19 as Logo,
|
|
151
147
|
Menu,
|
|
152
|
-
|
|
153
|
-
|
|
148
|
+
default65 as Modal,
|
|
149
|
+
default74 as OnboardingModal,
|
|
154
150
|
Popover,
|
|
155
151
|
PopoverBody,
|
|
156
152
|
PopoverFooter,
|
|
157
153
|
PopoverHeader,
|
|
158
|
-
|
|
159
|
-
|
|
154
|
+
default75 as PublishModal,
|
|
155
|
+
default66 as Radio,
|
|
160
156
|
ResourceModal,
|
|
161
157
|
default20 as SearchBar,
|
|
162
158
|
default9 as SearchButton,
|
|
163
159
|
default21 as Select,
|
|
164
|
-
|
|
165
|
-
|
|
160
|
+
default79 as ShareBlog,
|
|
161
|
+
default78 as ShareModal,
|
|
166
162
|
default23 as SortableTree,
|
|
167
163
|
default22 as Table,
|
|
168
164
|
Tabs,
|
|
169
|
-
|
|
165
|
+
default67 as TextArea,
|
|
170
166
|
Toolbar,
|
|
171
|
-
|
|
167
|
+
default68 as Tooltip,
|
|
172
168
|
default24 as Tree,
|
|
173
169
|
TreeNode,
|
|
174
170
|
TreeNodeFolderWrapper,
|
|
175
171
|
default25 as TreeView,
|
|
176
|
-
|
|
172
|
+
default69 as VisuallyHidden,
|
|
177
173
|
addNode,
|
|
178
174
|
arrayUnique,
|
|
179
175
|
buildTree,
|
|
@@ -201,50 +197,46 @@ export {
|
|
|
201
197
|
setRef,
|
|
202
198
|
updateNode,
|
|
203
199
|
updateParentIds,
|
|
204
|
-
default26 as
|
|
205
|
-
default27 as
|
|
206
|
-
default28 as
|
|
207
|
-
default29 as
|
|
208
|
-
default30 as useCantoo,
|
|
200
|
+
default26 as useBookmark,
|
|
201
|
+
default27 as useBreakpoint,
|
|
202
|
+
default28 as useBrowserInfo,
|
|
203
|
+
default29 as useCantoo,
|
|
209
204
|
useCheckable,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
default38 as useDropzone,
|
|
205
|
+
default30 as useClickOutside,
|
|
206
|
+
default31 as useConversation,
|
|
207
|
+
default32 as useDate,
|
|
208
|
+
default33 as useDebounce,
|
|
209
|
+
default34 as useDirectory,
|
|
210
|
+
default35 as useDropdown,
|
|
211
|
+
default36 as useDropzone,
|
|
218
212
|
useDropzoneContext,
|
|
219
213
|
useEdificeClient,
|
|
220
|
-
|
|
214
|
+
default37 as useEdificeIcons,
|
|
221
215
|
useEdificeTheme,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
default48 as
|
|
237
|
-
default49 as useTrapFocus,
|
|
238
|
-
default50 as useTrashedResource,
|
|
216
|
+
default70 as useHasWorkflow,
|
|
217
|
+
default38 as useHover,
|
|
218
|
+
default39 as useHttpErrorToast,
|
|
219
|
+
default40 as useImage,
|
|
220
|
+
default41 as useIsAdml,
|
|
221
|
+
default42 as useKeyPress,
|
|
222
|
+
default43 as useLibraryUrl,
|
|
223
|
+
default71 as useMediaLibrary,
|
|
224
|
+
default44 as useScrollToTop,
|
|
225
|
+
default80 as useShareMutation,
|
|
226
|
+
default45 as useTitle,
|
|
227
|
+
default72 as useToast,
|
|
228
|
+
default46 as useToggle,
|
|
229
|
+
default47 as useTrapFocus,
|
|
230
|
+
default48 as useTrashedResource,
|
|
239
231
|
useTreeSortable,
|
|
240
232
|
useTreeView,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
233
|
+
default77 as useUpdateMutation,
|
|
234
|
+
default49 as useUpload,
|
|
235
|
+
default50 as useUploadFiles,
|
|
236
|
+
default73 as useUser,
|
|
237
|
+
default51 as useWorkspaceFile,
|
|
238
|
+
default52 as useWorkspaceSearch,
|
|
239
|
+
default53 as useXitiTrackPageLoad,
|
|
240
|
+
default54 as useZendeskGuide,
|
|
249
241
|
wrapTreeNode
|
|
250
242
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
3
|
import useReactionIcons from "./hooks/useReactionIcons.js";
|
|
4
|
-
import useAvatar from "../../hooks/useAvatar/useAvatar.js";
|
|
5
4
|
import Avatar from "../../components/Avatar/Avatar.js";
|
|
5
|
+
import useDirectory from "../../hooks/useDirectory/useDirectory.js";
|
|
6
6
|
function ReactionModalCard({
|
|
7
7
|
reaction
|
|
8
8
|
}) {
|
|
9
9
|
const {
|
|
10
10
|
t
|
|
11
11
|
} = useTranslation(), {
|
|
12
|
-
|
|
13
|
-
} =
|
|
12
|
+
getAvatarURL
|
|
13
|
+
} = useDirectory(), {
|
|
14
14
|
getReactionIcon,
|
|
15
15
|
getReactionLabel
|
|
16
16
|
} = useReactionIcons();
|
|
17
17
|
return /* @__PURE__ */ jsxs("div", { className: "reaction-modal-card w-100 d-flex gap-8", children: [
|
|
18
18
|
/* @__PURE__ */ jsxs("div", { className: "position-relative p-8", children: [
|
|
19
|
-
/* @__PURE__ */ jsx(Avatar, { variant: "circle", size: "md", src:
|
|
19
|
+
/* @__PURE__ */ jsx(Avatar, { variant: "circle", size: "md", src: getAvatarURL(reaction.userId, "user"), alt: reaction.displayName }),
|
|
20
20
|
/* @__PURE__ */ jsx("div", { className: "position-absolute end-0 bottom-0", children: getReactionIcon(reaction.reactionType, !0) })
|
|
21
21
|
] }),
|
|
22
22
|
/* @__PURE__ */ jsxs("div", { className: "d-flex flex-column w-100 pt-8", children: [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState
|
|
2
|
+
import { useState } from "react";
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import SvgIconSave from "../../icons/components/IconSave.js";
|
|
5
5
|
import { useAutosizeTextarea } from "../hooks/useAutosizeTextarea.js";
|
|
@@ -10,8 +10,7 @@ import { CommentDate } from "./CommentDate.js";
|
|
|
10
10
|
import { CommentTitle } from "./CommentTitle.js";
|
|
11
11
|
import { TextCounter } from "./TextCounter.js";
|
|
12
12
|
import Button from "../../../components/Button/Button.js";
|
|
13
|
-
|
|
14
|
-
const DeleteModal = /* @__PURE__ */ lazy(() => import("./DeleteModal.js")), Comment = ({
|
|
13
|
+
const Comment = ({
|
|
15
14
|
comment,
|
|
16
15
|
userId,
|
|
17
16
|
profile
|
|
@@ -23,13 +22,12 @@ const DeleteModal = /* @__PURE__ */ lazy(() => import("./DeleteModal.js")), Comm
|
|
|
23
22
|
createdAt,
|
|
24
23
|
updatedAt,
|
|
25
24
|
comment: content
|
|
26
|
-
} = comment, [ref, onFocus, resizeTextarea] = useAutosizeTextarea(!0),
|
|
25
|
+
} = comment, [ref, onFocus, resizeTextarea] = useAutosizeTextarea(!0), {
|
|
27
26
|
t
|
|
28
27
|
} = useTranslation(), {
|
|
29
28
|
editCommentId,
|
|
30
29
|
options,
|
|
31
30
|
type,
|
|
32
|
-
userRights,
|
|
33
31
|
handleDeleteComment: onDeleteComment,
|
|
34
32
|
handleModifyComment,
|
|
35
33
|
handleReset,
|
|
@@ -59,15 +57,14 @@ const DeleteModal = /* @__PURE__ */ lazy(() => import("./DeleteModal.js")), Comm
|
|
|
59
57
|
] })
|
|
60
58
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
61
59
|
/* @__PURE__ */ jsx("div", { className: "mt-8 mb-4", children: content }),
|
|
62
|
-
type === "edit" && /* @__PURE__ */ jsxs("div", { className: "ms-n8", children: [
|
|
63
|
-
|
|
60
|
+
userId === authorId && type === "edit" && /* @__PURE__ */ jsxs("div", { className: "ms-n8", children: [
|
|
61
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => {
|
|
64
62
|
handleModifyComment(comment.id), setValue(content);
|
|
65
63
|
}, children: t("comment.edit") }),
|
|
66
|
-
|
|
64
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => onDeleteComment(id), children: t("comment.remove") })
|
|
67
65
|
] })
|
|
68
66
|
] })
|
|
69
|
-
] })
|
|
70
|
-
/* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingScreen, { position: !1 }), children: isDeleteModalOpen && /* @__PURE__ */ jsx(DeleteModal, { isOpen: isDeleteModalOpen, onCancel: () => setIsDeleteModalOpen(!1), onSuccess: () => onDeleteComment(id) }) })
|
|
67
|
+
] })
|
|
71
68
|
] }, id);
|
|
72
69
|
};
|
|
73
70
|
export {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { RightRole } from '@edifice.io/client';
|
|
2
1
|
import { CommentOptions, CommentProps, CommentType, UserProfileResult } from '../types';
|
|
3
2
|
export declare const CommentContext: import('react').Context<{
|
|
4
3
|
comments: CommentProps[] | undefined;
|
|
@@ -7,7 +6,6 @@ export declare const CommentContext: import('react').Context<{
|
|
|
7
6
|
profiles: (UserProfileResult | undefined)[];
|
|
8
7
|
options: Partial<CommentOptions>;
|
|
9
8
|
type: CommentType;
|
|
10
|
-
userRights?: Record<RightRole, boolean>;
|
|
11
9
|
setEditCommentId: (value: string | null) => void;
|
|
12
10
|
handleModifyComment: (commentId: string) => void;
|
|
13
11
|
handleChangeContent: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
@@ -24,6 +24,6 @@ export declare const useComments: ({ defaultComments, options, type, callbacks,
|
|
|
24
24
|
handleDeleteComment: (id: string) => void;
|
|
25
25
|
handleCreateComment: (content: string) => void;
|
|
26
26
|
handleModifyComment: (commentId: string) => void;
|
|
27
|
-
handleUpdateComment: (comment: string) =>
|
|
27
|
+
handleUpdateComment: (comment: string) => void;
|
|
28
28
|
handleReset: () => void;
|
|
29
29
|
};
|
|
@@ -50,7 +50,7 @@ const useComments = ({
|
|
|
50
50
|
handleModifyComment: (commentId) => {
|
|
51
51
|
setEditCommentId(commentId);
|
|
52
52
|
},
|
|
53
|
-
handleUpdateComment:
|
|
53
|
+
handleUpdateComment: (comment) => {
|
|
54
54
|
editCommentId && (type === "edit" && (callbacks == null || callbacks.put({
|
|
55
55
|
comment,
|
|
56
56
|
commentId: editCommentId
|
|
@@ -5,7 +5,6 @@ export declare const useCommentsContext: () => {
|
|
|
5
5
|
profiles: (import('../types').UserProfileResult | undefined)[];
|
|
6
6
|
options: Partial<import('../types').CommentOptions>;
|
|
7
7
|
type: import('../types').CommentType;
|
|
8
|
-
userRights?: Record<import('@edifice.io/client').RightRole, boolean>;
|
|
9
8
|
setEditCommentId: (value: string | null) => void;
|
|
10
9
|
handleModifyComment: (commentId: string) => void;
|
|
11
10
|
handleChangeContent: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
@@ -46,7 +46,7 @@ const CommentProvider = ({
|
|
|
46
46
|
defaultComments,
|
|
47
47
|
callbacks: type == "edit" ? props.callbacks : null,
|
|
48
48
|
options
|
|
49
|
-
}),
|
|
49
|
+
}), values = useMemo(
|
|
50
50
|
() => ({
|
|
51
51
|
comments,
|
|
52
52
|
content,
|
|
@@ -54,7 +54,6 @@ const CommentProvider = ({
|
|
|
54
54
|
editCommentId,
|
|
55
55
|
options,
|
|
56
56
|
type,
|
|
57
|
-
userRights,
|
|
58
57
|
setEditCommentId,
|
|
59
58
|
handleCreateComment,
|
|
60
59
|
handleModifyComment,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UserProfile } from '@edifice.io/client';
|
|
2
2
|
export interface CommentProps {
|
|
3
3
|
/**
|
|
4
4
|
* Comment Id
|
|
@@ -61,10 +61,6 @@ interface EditRootProps extends BaseProps {
|
|
|
61
61
|
* Callbacks to perform CRUD on comment
|
|
62
62
|
*/
|
|
63
63
|
callbacks: CommentCallbacks;
|
|
64
|
-
/**
|
|
65
|
-
* Rights to perform CRUD on comment
|
|
66
|
-
*/
|
|
67
|
-
rights?: Record<RightRole, boolean>;
|
|
68
64
|
}
|
|
69
65
|
interface ReadRootProps extends BaseProps {
|
|
70
66
|
type: 'read';
|
|
@@ -12,12 +12,11 @@ const AttachmentRenderer = (props) => {
|
|
|
12
12
|
const {
|
|
13
13
|
t
|
|
14
14
|
} = useTranslation(), {
|
|
15
|
-
node
|
|
16
|
-
editor
|
|
15
|
+
node
|
|
17
16
|
} = props, {
|
|
18
17
|
editable
|
|
19
|
-
} = useEditorContext(), [attachmentArrayAttrs, setAttachmentArrayAttrs] = useState(node.attrs.links), handleDelete = (index
|
|
20
|
-
|
|
18
|
+
} = useEditorContext(), [attachmentArrayAttrs, setAttachmentArrayAttrs] = useState(node.attrs.links), handleDelete = (index) => {
|
|
19
|
+
setAttachmentArrayAttrs((oldAttachments) => oldAttachments.filter((_, i) => i !== index));
|
|
21
20
|
};
|
|
22
21
|
return attachmentArrayAttrs.length !== 0 && /* @__PURE__ */ jsx(NodeViewWrapper, { children: /* @__PURE__ */ jsxs("div", { style: {
|
|
23
22
|
backgroundColor: "#F2F2F2",
|
|
@@ -27,7 +26,7 @@ const AttachmentRenderer = (props) => {
|
|
|
27
26
|
/* @__PURE__ */ jsx("p", { className: "m-12 mt-0", children: t("tiptap.attachments.bloc") }),
|
|
28
27
|
/* @__PURE__ */ jsx(Grid, { children: attachmentArrayAttrs == null ? void 0 : attachmentArrayAttrs.map((attachment, index) => /* @__PURE__ */ jsx(Grid.Col, { sm: "6", children: /* @__PURE__ */ jsx(Attachment, { name: attachment.name, options: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29
28
|
/* @__PURE__ */ jsx("a", { href: attachment.href, download: !0, children: /* @__PURE__ */ jsx(IconButton, { "aria-label": t("tiptap.attachments.download"), color: "tertiary", type: "button", icon: /* @__PURE__ */ jsx(SvgIconDownload, {}), variant: "ghost" }) }),
|
|
30
|
-
editable && /* @__PURE__ */ jsx(IconButton, { "aria-label": t("tiptap.attachments.delete"), color: "danger", type: "button", icon: /* @__PURE__ */ jsx(SvgIconDelete, {}), variant: "ghost", onClick: () => handleDelete(index
|
|
29
|
+
editable && /* @__PURE__ */ jsx(IconButton, { "aria-label": t("tiptap.attachments.delete"), color: "danger", type: "button", icon: /* @__PURE__ */ jsx(SvgIconDelete, {}), variant: "ghost", onClick: () => handleDelete(index) })
|
|
31
30
|
] }) }) }, index)) })
|
|
32
31
|
] }) });
|
|
33
32
|
};
|
|
@@ -11,6 +11,7 @@ import SvgIconRecordVideo from "../../icons/components/IconRecordVideo.js";
|
|
|
11
11
|
import SvgIconSmartphone from "../../icons/components/IconSmartphone.js";
|
|
12
12
|
import { InnerTabs } from "./innertabs/index.js";
|
|
13
13
|
import { MediaLibraryContext } from "./MediaLibraryContext.js";
|
|
14
|
+
import useHttpErrorToast from "../../../hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
14
15
|
import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
15
16
|
import Modal from "../../../components/Modal/Modal.js";
|
|
16
17
|
import { Tabs } from "../../../components/Tabs/components/Tabs.js";
|
|
@@ -72,7 +73,10 @@ const orderedTabs = [
|
|
|
72
73
|
showLink,
|
|
73
74
|
type,
|
|
74
75
|
...refModal.current
|
|
75
|
-
}))
|
|
76
|
+
})), useHttpErrorToast({
|
|
77
|
+
isDismissible: !0,
|
|
78
|
+
duration: 1 / 0
|
|
79
|
+
});
|
|
76
80
|
const {
|
|
77
81
|
t
|
|
78
82
|
} = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"), [type, setType] = useState(null), availableTabs = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.0.1
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"@tiptap/react": "2.3.0",
|
|
106
106
|
"@tiptap/starter-kit": "2.3.0",
|
|
107
107
|
"@uidotdev/usehooks": "^2.4.1",
|
|
108
|
-
"clsx": "
|
|
108
|
+
"clsx": "^2.1.1",
|
|
109
109
|
"dayjs": "1.11.10",
|
|
110
110
|
"emoji-picker-react": "4.5.2",
|
|
111
111
|
"globals": "^15.11.0",
|
|
@@ -119,43 +119,43 @@
|
|
|
119
119
|
"react-slugify": "^3.0.3",
|
|
120
120
|
"swiper": "^10.1.0",
|
|
121
121
|
"ua-parser-js": "^1.0.36",
|
|
122
|
-
"@edifice.io/
|
|
123
|
-
"@edifice.io/tiptap-extensions": "2.0.1
|
|
124
|
-
"@edifice.io/
|
|
122
|
+
"@edifice.io/bootstrap": "2.0.1",
|
|
123
|
+
"@edifice.io/tiptap-extensions": "2.0.1",
|
|
124
|
+
"@edifice.io/utilities": "2.0.1"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
127
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
128
128
|
"@eslint/js": "^9.12.0",
|
|
129
129
|
"@react-spring/web": "^9.7.5",
|
|
130
130
|
"@svgr/cli": "^8.1.0",
|
|
131
|
-
"@tanstack/react-query": "
|
|
132
|
-
"@types/node": "
|
|
131
|
+
"@tanstack/react-query": "5.62.7",
|
|
132
|
+
"@types/node": "^22.9.1",
|
|
133
133
|
"@types/pako": "^2.0.3",
|
|
134
|
-
"@types/react": "
|
|
135
|
-
"@types/react-dom": "
|
|
134
|
+
"@types/react": "^18.2.33",
|
|
135
|
+
"@types/react-dom": "^18.2.14",
|
|
136
136
|
"@types/ua-parser-js": "^0.7.37",
|
|
137
|
-
"@vitejs/plugin-react": "
|
|
137
|
+
"@vitejs/plugin-react": "^4.3.2",
|
|
138
138
|
"eslint": "^9.12.0",
|
|
139
139
|
"eslint-plugin-react-hooks": "5.1.0-rc.0",
|
|
140
140
|
"eslint-plugin-react-refresh": "^0.4.12",
|
|
141
|
-
"react": "
|
|
142
|
-
"react-dom": "
|
|
143
|
-
"react-hook-form": "
|
|
144
|
-
"react-i18next": "
|
|
141
|
+
"react": "^18.3.1",
|
|
142
|
+
"react-dom": "^18.3.1",
|
|
143
|
+
"react-hook-form": "^7.53.0",
|
|
144
|
+
"react-i18next": "^14.1.0",
|
|
145
145
|
"rollup-plugin-pure": "^0.2.1",
|
|
146
|
-
"rollup-plugin-visualizer": "
|
|
146
|
+
"rollup-plugin-visualizer": "5.12.0",
|
|
147
147
|
"typescript-eslint": "^8.8.1",
|
|
148
|
-
"vite": "
|
|
149
|
-
"vite-plugin-dts": "
|
|
150
|
-
"@edifice.io/client": "2.0.1
|
|
148
|
+
"vite": "^5.4.11",
|
|
149
|
+
"vite-plugin-dts": "^4.1.0",
|
|
150
|
+
"@edifice.io/client": "2.0.1"
|
|
151
151
|
},
|
|
152
152
|
"peerDependencies": {
|
|
153
|
-
"@react-spring/web": "
|
|
154
|
-
"@tanstack/react-query": "
|
|
155
|
-
"react": "
|
|
156
|
-
"react-dom": "
|
|
157
|
-
"react-hook-form": "
|
|
158
|
-
"react-i18next": "
|
|
153
|
+
"@react-spring/web": "^9.7.5",
|
|
154
|
+
"@tanstack/react-query": "5.62.7",
|
|
155
|
+
"react": "^18.3.1",
|
|
156
|
+
"react-dom": "^18.3.1",
|
|
157
|
+
"react-hook-form": "^7.53.0",
|
|
158
|
+
"react-i18next": "^14.1.0"
|
|
159
159
|
},
|
|
160
160
|
"optionalDependencies": {
|
|
161
161
|
"@tiptap-pro/extension-mathematics": "2.2.1"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as useAvatar } from './useAvatar';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { odeServices } from "@edifice.io/client";
|
|
3
|
-
import { useMemo } from "react";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import Badge from "../../components/Badge/Badge.js";
|
|
6
|
-
function useAvatar(userId, userProfile) {
|
|
7
|
-
const {
|
|
8
|
-
t
|
|
9
|
-
} = useTranslation(), badge = useMemo(() => {
|
|
10
|
-
const profile = (userProfile == null ? void 0 : userProfile.toLowerCase()) ?? "guest";
|
|
11
|
-
return ["teacher", "student", "relative", "personnel"].includes(profile) ? /* @__PURE__ */ jsx(Badge, { variant: {
|
|
12
|
-
type: "user",
|
|
13
|
-
profile
|
|
14
|
-
}, children: t(profile) }) : null;
|
|
15
|
-
}, [userProfile, t]);
|
|
16
|
-
function getAvatarURL(userId2) {
|
|
17
|
-
return odeServices.directory().getAvatarUrl(userId2, "user");
|
|
18
|
-
}
|
|
19
|
-
function getUserbookURL(userId2) {
|
|
20
|
-
return odeServices.directory().getDirectoryUrl(userId2, "user");
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
badge,
|
|
24
|
-
avatarURL: getAvatarURL(userId),
|
|
25
|
-
userbookURL: getUserbookURL(userId)
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
useAvatar as default
|
|
30
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as useHeader } from './useHeader';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import Modal from "../../../components/Modal/Modal.js";
|
|
3
|
-
import Button from "../../../components/Button/Button.js";
|
|
4
|
-
const DeleteModal = ({
|
|
5
|
-
isOpen,
|
|
6
|
-
onCancel,
|
|
7
|
-
onSuccess
|
|
8
|
-
}) => /* @__PURE__ */ jsxs(Modal, { isOpen, onModalClose: onCancel, id: "delete-comment-modal", children: [
|
|
9
|
-
/* @__PURE__ */ jsx(Modal.Header, { onModalClose: onCancel, children: "Suppression de commentaire" }),
|
|
10
|
-
/* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx("p", { children: "Voulez-vous vraiment supprimer ce commentaire ?" }) }),
|
|
11
|
-
/* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
|
12
|
-
/* @__PURE__ */ jsx(Button, { color: "tertiary", onClick: onCancel, type: "button", variant: "ghost", children: "Annuler" }),
|
|
13
|
-
/* @__PURE__ */ jsx(Button, { color: "danger", onClick: onSuccess, type: "button", variant: "filled", children: "Supprimer le commentaire" })
|
|
14
|
-
] })
|
|
15
|
-
] });
|
|
16
|
-
export {
|
|
17
|
-
DeleteModal,
|
|
18
|
-
DeleteModal as default
|
|
19
|
-
};
|