@edifice.io/react 2.2.2 → 2.2.3
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/Avatar/Avatar.d.ts +21 -0
- package/dist/components/Avatar/Avatar.js +15 -2
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +24 -0
- package/dist/components/AvatarGroup/AvatarGroup.js +24 -0
- package/dist/components/AvatarGroup/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +3 -1
- package/dist/components/Card/CardBody.d.ts +3 -1
- package/dist/components/Card/CardBody.js +4 -2
- package/dist/components/Dropdown/Dropdown.d.ts +6 -2
- package/dist/components/Dropdown/Dropdown.js +2 -0
- package/dist/components/Dropdown/DropdownItem.d.ts +5 -1
- package/dist/components/Dropdown/DropdownItem.js +7 -2
- package/dist/components/Dropdown/DropdownTrigger.d.ts +31 -2
- package/dist/components/Dropdown/DropdownTrigger.js +23 -3
- package/dist/components/PreventPropagation/PreventPropagation.d.ts +10 -0
- package/dist/components/PreventPropagation/PreventPropagation.js +9 -0
- package/dist/components/PreventPropagation/index.d.ts +2 -0
- package/dist/components/StackedGroup/StackedGroup.d.ts +23 -0
- package/dist/components/StackedGroup/StackedGroup.js +21 -0
- package/dist/components/StackedGroup/index.d.ts +1 -0
- package/dist/components/Switch/Switch.d.ts +29 -0
- package/dist/components/Switch/Switch.js +27 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/editor.js +16 -12
- package/dist/hooks/useConf/useConf.d.ts +1 -1
- package/dist/hooks/useSession/useSession.d.ts +1 -1
- package/dist/icons.js +178 -176
- package/dist/index.js +154 -146
- package/dist/modules/comments/components/Comment.js +49 -34
- package/dist/modules/comments/components/CommentDeleted.d.ts +1 -0
- package/dist/modules/comments/components/CommentDeleted.js +11 -0
- package/dist/modules/comments/components/CommentForm.d.ts +2 -1
- package/dist/modules/comments/components/CommentForm.js +12 -8
- package/dist/modules/comments/components/CommentList.js +3 -3
- package/dist/modules/comments/components/CommentReplies.d.ts +4 -0
- package/dist/modules/comments/components/CommentReplies.js +33 -0
- package/dist/modules/comments/constants.d.ts +4 -0
- package/dist/modules/comments/constants.js +2 -1
- package/dist/modules/comments/context/Context.d.ts +6 -4
- package/dist/modules/comments/hooks/useCommentReplies.d.ts +12 -0
- package/dist/modules/comments/hooks/useCommentReplies.js +36 -0
- package/dist/modules/comments/hooks/useComments.d.ts +7 -7
- package/dist/modules/comments/hooks/useComments.js +24 -19
- package/dist/modules/comments/hooks/useCommentsContext.d.ts +6 -4
- package/dist/modules/comments/provider/CommentProvider.js +16 -13
- package/dist/modules/comments/types.d.ts +14 -1
- package/dist/modules/editor/components/BubbleMenuEditInformationPane/BubbleMenuEditInformationPane.d.ts +6 -0
- package/dist/modules/editor/components/BubbleMenuEditInformationPane/BubbleMenuEditInformationPane.js +136 -0
- package/dist/modules/editor/components/BubbleMenuEditInformationPane/index.d.ts +1 -0
- package/dist/modules/editor/components/Editor/Editor.js +6 -2
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +12 -0
- package/dist/modules/editor/components/NodeView/InformationPaneNodeView.d.ts +2 -0
- package/dist/modules/editor/components/NodeView/InformationPaneNodeView.js +10 -0
- package/dist/modules/editor/components/NodeView/index.d.ts +1 -0
- package/dist/modules/editor/components/Renderer/InformationPaneRenderer.d.ts +3 -0
- package/dist/modules/editor/components/Renderer/InformationPaneRenderer.js +33 -0
- package/dist/modules/editor/components/Renderer/index.d.ts +1 -0
- package/dist/modules/editor/hooks/useTipTapEditor.js +3 -1
- package/dist/modules/icons/components/IconInfoRectangle.d.ts +7 -0
- package/dist/modules/icons/components/IconInfoRectangle.js +13 -0
- package/dist/modules/icons/components/index.d.ts +1 -0
- package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +1 -1
- package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.d.ts +1 -1
- package/dist/modules/modals/ShareModal/ShareModal.d.ts +1 -1
- package/dist/modules/modals/ShareModal/apps/ShareBlog.d.ts +1 -1
- package/dist/modules/modals/ShareModal/hooks/useShareMutation.d.ts +1 -1
- package/dist/providers/EdificeClientProvider/EdificeClientProvider.context.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -4,80 +4,84 @@ import { default as default4 } from "./components/AppHeader/AppHeader.js";
|
|
|
4
4
|
import { default as default5 } from "./components/AppIcon/AppIcon.js";
|
|
5
5
|
import { default as default6 } from "./components/Attachment/Attachment.js";
|
|
6
6
|
import { default as default7 } from "./components/Avatar/Avatar.js";
|
|
7
|
-
import { default as default8 } from "./components/
|
|
8
|
-
import { default as default9 } from "./components/
|
|
9
|
-
import { default as default10 } from "./components/
|
|
10
|
-
import { default as default11 } from "./components/Button/
|
|
11
|
-
import { default as default12 } from "./components/Button/
|
|
12
|
-
import { default as default13 } from "./components/
|
|
13
|
-
import { default as default14 } from "./components/
|
|
14
|
-
import { default as default15 } from "./components/
|
|
15
|
-
import { default as default16 } from "./components/ColorPicker/
|
|
16
|
-
import { default as default17 } from "./components/
|
|
17
|
-
import { default as default18 } from "./components/
|
|
18
|
-
import { default as default19 } from "./components/
|
|
19
|
-
import { default as default20 } from "./components/
|
|
20
|
-
import { default as default21 } from "./components/
|
|
21
|
-
import { default as default22 } from "./components/Form/
|
|
22
|
-
import { default as default23 } from "./components/
|
|
23
|
-
import { default as default24 } from "./components/
|
|
24
|
-
import { default as default25 } from "./components/
|
|
25
|
-
import { default as default26 } from "./components/
|
|
26
|
-
import { default as default27 } from "./components/
|
|
27
|
-
import { default as default28 } from "./components/
|
|
28
|
-
import { default as default29 } from "./components/
|
|
29
|
-
import { default as default30 } from "./components/
|
|
30
|
-
import { default as default31 } from "./components/
|
|
31
|
-
import { default as default32 } from "./components/
|
|
32
|
-
import { default as default33 } from "./components/
|
|
33
|
-
import { default as default34 } from "./components/
|
|
34
|
-
import { default as default35 } from "./components/
|
|
35
|
-
import { default as default36 } from "./components/
|
|
7
|
+
import { default as default8 } from "./components/AvatarGroup/AvatarGroup.js";
|
|
8
|
+
import { default as default9 } from "./components/Badge/Badge.js";
|
|
9
|
+
import { default as default10 } from "./components/Breadcrumb/Breadcrumb.js";
|
|
10
|
+
import { default as default11 } from "./components/Button/Button.js";
|
|
11
|
+
import { default as default12 } from "./components/Button/IconButton.js";
|
|
12
|
+
import { default as default13 } from "./components/Button/SearchButton.js";
|
|
13
|
+
import { default as default14 } from "./components/Card/Card.js";
|
|
14
|
+
import { default as default15 } from "./components/Checkbox/Checkbox.js";
|
|
15
|
+
import { default as default16 } from "./components/ColorPicker/ColorPicker.js";
|
|
16
|
+
import { default as default17 } from "./components/ColorPicker/ColorPickerItem.js";
|
|
17
|
+
import { default as default18 } from "./components/Combobox/Combobox.js";
|
|
18
|
+
import { default as default19 } from "./components/Dropdown/Dropdown.js";
|
|
19
|
+
import { default as default20 } from "./components/Dropzone/Dropzone.js";
|
|
20
|
+
import { default as default21 } from "./components/EmptyScreen/EmptyScreen.js";
|
|
21
|
+
import { default as default22 } from "./components/Form/FormText.js";
|
|
22
|
+
import { default as default23 } from "./components/Form/FormControl.js";
|
|
23
|
+
import { default as default24 } from "./components/Heading/Heading.js";
|
|
24
|
+
import { default as default25 } from "./components/Image/Image.js";
|
|
25
|
+
import { default as default26 } from "./components/Input/Input.js";
|
|
26
|
+
import { default as default27 } from "./components/Label/Label.js";
|
|
27
|
+
import { default as default28 } from "./components/Loading/Loading.js";
|
|
28
|
+
import { default as default29 } from "./components/LoadingScreen/LoadingScreen.js";
|
|
29
|
+
import { default as default30 } from "./components/Logo/Logo.js";
|
|
30
|
+
import { default as default31 } from "./components/Modal/Modal.js";
|
|
31
|
+
import { default as default32 } from "./components/PreventPropagation/PreventPropagation.js";
|
|
32
|
+
import { default as default33 } from "./components/Radio/Radio.js";
|
|
33
|
+
import { default as default34 } from "./components/SearchBar/SearchBar.js";
|
|
34
|
+
import { default as default35 } from "./components/Select/Select.js";
|
|
35
|
+
import { default as default36 } from "./components/StackedGroup/StackedGroup.js";
|
|
36
|
+
import { default as default37 } from "./components/Switch/Switch.js";
|
|
37
|
+
import { default as default38 } from "./components/Table/components/Table.js";
|
|
38
|
+
import { default as default39 } from "./components/TextArea/TextArea.js";
|
|
39
|
+
import { default as default40 } from "./components/Tooltip/Tooltip.js";
|
|
36
40
|
import { DndTree } from "./components/Tree/components/DndTree.js";
|
|
37
|
-
import { default as
|
|
38
|
-
import { default as
|
|
39
|
-
import { default as
|
|
40
|
-
import { default as
|
|
41
|
-
import { default as
|
|
42
|
-
import { default as
|
|
43
|
-
import { default as
|
|
44
|
-
import { default as
|
|
45
|
-
import { default as
|
|
46
|
-
import { default as
|
|
47
|
-
import { default as
|
|
48
|
-
import { default as
|
|
49
|
-
import { default as
|
|
50
|
-
import { default as
|
|
51
|
-
import { default as
|
|
52
|
-
import { default as
|
|
53
|
-
import { default as
|
|
54
|
-
import { default as
|
|
55
|
-
import { default as
|
|
56
|
-
import { default as
|
|
57
|
-
import { default as
|
|
58
|
-
import { default as
|
|
59
|
-
import { default as
|
|
60
|
-
import { default as
|
|
61
|
-
import { default as
|
|
62
|
-
import { default as
|
|
63
|
-
import { default as
|
|
64
|
-
import { default as
|
|
65
|
-
import { default as
|
|
66
|
-
import { default as
|
|
67
|
-
import { default as
|
|
68
|
-
import { default as
|
|
69
|
-
import { default as
|
|
70
|
-
import { default as
|
|
71
|
-
import { default as
|
|
72
|
-
import { default as
|
|
73
|
-
import { default as
|
|
74
|
-
import { default as
|
|
75
|
-
import { default as
|
|
76
|
-
import { default as
|
|
77
|
-
import { default as
|
|
78
|
-
import { default as
|
|
79
|
-
import { default as
|
|
80
|
-
import { default as
|
|
41
|
+
import { default as default41 } from "./components/Tree/components/SortableTree.js";
|
|
42
|
+
import { default as default42 } from "./components/Tree/components/Tree.js";
|
|
43
|
+
import { default as default43 } from "./components/TreeView/TreeView.js";
|
|
44
|
+
import { default as default44 } from "./components/VisuallyHidden/VisuallyHidden.js";
|
|
45
|
+
import { default as default45 } from "./hooks/useBookmark/useBookmark.js";
|
|
46
|
+
import { default as default46 } from "./hooks/useBreakpoint/useBreakpoint.js";
|
|
47
|
+
import { default as default47 } from "./hooks/useBrowserInfo/useBrowserInfo.js";
|
|
48
|
+
import { default as default48 } from "./hooks/useCantoo/useCantoo.js";
|
|
49
|
+
import { default as default49 } from "./hooks/useClickOutside/useClickOutside.js";
|
|
50
|
+
import { default as default50 } from "./hooks/useConversation/useConversation.js";
|
|
51
|
+
import { default as default51 } from "./hooks/useDate/useDate.js";
|
|
52
|
+
import { default as default52 } from "./hooks/useDebounce/useDebounce.js";
|
|
53
|
+
import { default as default53 } from "./hooks/useDirectory/useDirectory.js";
|
|
54
|
+
import { default as default54 } from "./hooks/useDropdown/useDropdown.js";
|
|
55
|
+
import { default as default55 } from "./hooks/useDropzone/useDropzone.js";
|
|
56
|
+
import { default as default56 } from "./hooks/useEdificeIcons/useEdificeIcons.js";
|
|
57
|
+
import { default as default57 } from "./hooks/useHasWorkflow/useHasWorkflow.js";
|
|
58
|
+
import { default as default58 } from "./hooks/useHover/useHover.js";
|
|
59
|
+
import { default as default59 } from "./hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
60
|
+
import { default as default60 } from "./hooks/useImage/useImage.js";
|
|
61
|
+
import { default as default61 } from "./hooks/useIsAdml/useIsAdml.js";
|
|
62
|
+
import { default as default62 } from "./hooks/useKeyPress/useKeyPress.js";
|
|
63
|
+
import { default as default63 } from "./hooks/useLibraryUrl/useLibraryUrl.js";
|
|
64
|
+
import { default as default64 } from "./hooks/useMediaLibrary/useMediaLibrary.js";
|
|
65
|
+
import { default as default65 } from "./hooks/useScrollToTop/useScrollToTop.js";
|
|
66
|
+
import { default as default66 } from "./hooks/useTitle/useTitle.js";
|
|
67
|
+
import { default as default67 } from "./hooks/useToast/useToast.js";
|
|
68
|
+
import { default as default68 } from "./hooks/useToggle/useToggle.js";
|
|
69
|
+
import { default as default69 } from "./hooks/useTrapFocus/useTrapFocus.js";
|
|
70
|
+
import { default as default70 } from "./hooks/useTrashedResource/useTrashedResource.js";
|
|
71
|
+
import { default as default71 } from "./hooks/useUpload/useUpload.js";
|
|
72
|
+
import { default as default72 } from "./hooks/useUploadFiles/useUploadFiles.js";
|
|
73
|
+
import { default as default73 } from "./hooks/useUser/useUser.js";
|
|
74
|
+
import { default as default74 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
|
|
75
|
+
import { default as default75 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
76
|
+
import { default as default76 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
|
|
77
|
+
import { default as default77 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
78
|
+
import { default as default78 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
|
|
79
|
+
import { default as default79 } from "./modules/modals/PublishModal/PublishModal.js";
|
|
80
|
+
import { default as default80 } from "./modules/modals/ResourceModal/apps/BlogPublic.js";
|
|
81
|
+
import { default as default81 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
82
|
+
import { default as default82 } from "./modules/modals/ShareModal/ShareModal.js";
|
|
83
|
+
import { default as default83 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
|
|
84
|
+
import { default as default84 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
81
85
|
import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
|
|
82
86
|
import { DropzoneContext, useDropzoneContext } from "./components/Dropzone/DropzoneContext.js";
|
|
83
87
|
import { Column, Grid } from "./components/Grid/Grid.js";
|
|
@@ -112,66 +116,70 @@ export {
|
|
|
112
116
|
default5 as AppIcon,
|
|
113
117
|
default6 as Attachment,
|
|
114
118
|
default7 as Avatar,
|
|
115
|
-
default8 as
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
default10 as
|
|
119
|
-
|
|
120
|
-
default14 as
|
|
121
|
-
default15 as
|
|
122
|
-
default16 as
|
|
119
|
+
default8 as AvatarGroup,
|
|
120
|
+
default9 as Badge,
|
|
121
|
+
default80 as BlogPublic,
|
|
122
|
+
default10 as Breadcrumb,
|
|
123
|
+
default11 as Button,
|
|
124
|
+
default14 as Card,
|
|
125
|
+
default15 as Checkbox,
|
|
126
|
+
default16 as ColorPicker,
|
|
127
|
+
default17 as ColorPickerItem,
|
|
123
128
|
Column,
|
|
124
|
-
|
|
129
|
+
default18 as Combobox,
|
|
125
130
|
DefaultPalette,
|
|
126
131
|
DndTree,
|
|
127
|
-
|
|
128
|
-
|
|
132
|
+
default19 as Dropdown,
|
|
133
|
+
default20 as Dropzone,
|
|
129
134
|
DropzoneContext,
|
|
130
135
|
EdificeClientContext,
|
|
131
136
|
EdificeClientProvider,
|
|
132
137
|
EdificeThemeContext,
|
|
133
138
|
EdificeThemeProvider,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
139
|
+
default21 as EmptyScreen,
|
|
140
|
+
default23 as FormControl,
|
|
141
|
+
default22 as FormText,
|
|
137
142
|
Grid,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
default24 as Heading,
|
|
144
|
+
default12 as IconButton,
|
|
145
|
+
default25 as Image,
|
|
146
|
+
default26 as Input,
|
|
147
|
+
default27 as Label,
|
|
143
148
|
Layout,
|
|
144
149
|
List,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
150
|
+
default28 as Loading,
|
|
151
|
+
default29 as LoadingScreen,
|
|
152
|
+
default30 as Logo,
|
|
148
153
|
Menu,
|
|
149
154
|
MockedProvider,
|
|
150
|
-
|
|
151
|
-
|
|
155
|
+
default31 as Modal,
|
|
156
|
+
default78 as OnboardingModal,
|
|
152
157
|
Popover,
|
|
153
158
|
PopoverBody,
|
|
154
159
|
PopoverFooter,
|
|
155
160
|
PopoverHeader,
|
|
156
|
-
|
|
157
|
-
|
|
161
|
+
default32 as PreventPropagation,
|
|
162
|
+
default79 as PublishModal,
|
|
163
|
+
default33 as Radio,
|
|
158
164
|
ResourceModal,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
default34 as SearchBar,
|
|
166
|
+
default13 as SearchButton,
|
|
167
|
+
default35 as Select,
|
|
168
|
+
default83 as ShareBlog,
|
|
169
|
+
default82 as ShareModal,
|
|
170
|
+
default41 as SortableTree,
|
|
171
|
+
default36 as StackedGroup,
|
|
172
|
+
default37 as Switch,
|
|
173
|
+
default38 as Table,
|
|
166
174
|
Tabs,
|
|
167
|
-
|
|
175
|
+
default39 as TextArea,
|
|
168
176
|
Toolbar,
|
|
169
|
-
|
|
170
|
-
|
|
177
|
+
default40 as Tooltip,
|
|
178
|
+
default42 as Tree,
|
|
171
179
|
TreeNode,
|
|
172
180
|
TreeNodeFolderWrapper,
|
|
173
|
-
|
|
174
|
-
|
|
181
|
+
default43 as TreeView,
|
|
182
|
+
default44 as VisuallyHidden,
|
|
175
183
|
addNode,
|
|
176
184
|
arrayUnique,
|
|
177
185
|
buildTree,
|
|
@@ -199,46 +207,46 @@ export {
|
|
|
199
207
|
setRef,
|
|
200
208
|
updateNode,
|
|
201
209
|
updateParentIds,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
210
|
+
default45 as useBookmark,
|
|
211
|
+
default46 as useBreakpoint,
|
|
212
|
+
default47 as useBrowserInfo,
|
|
213
|
+
default48 as useCantoo,
|
|
206
214
|
useCheckable,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
215
|
+
default49 as useClickOutside,
|
|
216
|
+
default50 as useConversation,
|
|
217
|
+
default51 as useDate,
|
|
218
|
+
default52 as useDebounce,
|
|
219
|
+
default53 as useDirectory,
|
|
220
|
+
default54 as useDropdown,
|
|
221
|
+
default55 as useDropzone,
|
|
214
222
|
useDropzoneContext,
|
|
215
223
|
useEdificeClient,
|
|
216
|
-
|
|
224
|
+
default56 as useEdificeIcons,
|
|
217
225
|
useEdificeTheme,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
226
|
+
default57 as useHasWorkflow,
|
|
227
|
+
default58 as useHover,
|
|
228
|
+
default59 as useHttpErrorToast,
|
|
229
|
+
default60 as useImage,
|
|
230
|
+
default61 as useIsAdml,
|
|
231
|
+
default62 as useKeyPress,
|
|
232
|
+
default63 as useLibraryUrl,
|
|
233
|
+
default64 as useMediaLibrary,
|
|
234
|
+
default65 as useScrollToTop,
|
|
235
|
+
default84 as useShareMutation,
|
|
236
|
+
default66 as useTitle,
|
|
237
|
+
default67 as useToast,
|
|
238
|
+
default68 as useToggle,
|
|
239
|
+
default69 as useTrapFocus,
|
|
240
|
+
default70 as useTrashedResource,
|
|
233
241
|
useTreeSortable,
|
|
234
242
|
useTreeView,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
+
default81 as useUpdateMutation,
|
|
244
|
+
default71 as useUpload,
|
|
245
|
+
default72 as useUploadFiles,
|
|
246
|
+
default73 as useUser,
|
|
247
|
+
default74 as useWorkspaceFile,
|
|
248
|
+
default75 as useWorkspaceSearch,
|
|
249
|
+
default76 as useXitiTrackPageLoad,
|
|
250
|
+
default77 as useZendeskGuide,
|
|
243
251
|
wrapTreeNode
|
|
244
252
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs,
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, Suspense, lazy } from "react";
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import SvgIconSave from "../../icons/components/IconSave.js";
|
|
@@ -9,6 +9,8 @@ import { CommentAvatar } from "./CommentAvatar.js";
|
|
|
9
9
|
import { CommentDate } from "./CommentDate.js";
|
|
10
10
|
import { CommentTitle } from "./CommentTitle.js";
|
|
11
11
|
import { TextCounter } from "./TextCounter.js";
|
|
12
|
+
import { CommentDeleted } from "./CommentDeleted.js";
|
|
13
|
+
import { CommentReplies } from "./CommentReplies.js";
|
|
12
14
|
import Button from "../../../components/Button/Button.js";
|
|
13
15
|
import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
|
|
14
16
|
const DeleteModal = /* @__PURE__ */ lazy(() => import("./DeleteModal.js")), Comment = ({
|
|
@@ -22,10 +24,12 @@ const DeleteModal = /* @__PURE__ */ lazy(() => import("./DeleteModal.js")), Comm
|
|
|
22
24
|
authorName,
|
|
23
25
|
createdAt,
|
|
24
26
|
updatedAt,
|
|
25
|
-
comment: content
|
|
27
|
+
comment: content,
|
|
28
|
+
replyTo
|
|
26
29
|
} = comment, [ref, onFocus, resizeTextarea] = useAutosizeTextarea(!0), [isDeleteModalOpen, setIsDeleteModalOpen] = useState(!1), {
|
|
27
30
|
t
|
|
28
31
|
} = useTranslation(), {
|
|
32
|
+
defaultComments,
|
|
29
33
|
editCommentId,
|
|
30
34
|
options,
|
|
31
35
|
type,
|
|
@@ -33,42 +37,53 @@ const DeleteModal = /* @__PURE__ */ lazy(() => import("./DeleteModal.js")), Comm
|
|
|
33
37
|
handleDeleteComment: onDeleteComment,
|
|
34
38
|
handleModifyComment,
|
|
35
39
|
handleReset,
|
|
36
|
-
handleUpdateComment
|
|
37
|
-
|
|
40
|
+
handleUpdateComment,
|
|
41
|
+
handleReplyToComment
|
|
42
|
+
} = useCommentsContext(), replies = (defaultComments == null ? void 0 : defaultComments.filter((comm) => comm.replyTo === comment.id)) ?? [], hasReplies = replies.length > 0, hasAllDeletedReplies = replies.every((reply) => reply.deleted), isEditing = editCommentId === comment.id, handleChangeContent = (event) => {
|
|
38
43
|
resizeTextarea(), setValue(event.target.value);
|
|
39
44
|
};
|
|
40
|
-
return /* @__PURE__ */ jsxs(
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
46
|
+
comment.deleted && hasReplies && !hasAllDeletedReplies && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
47
|
+
/* @__PURE__ */ jsx(CommentDeleted, {}),
|
|
48
|
+
/* @__PURE__ */ jsx(CommentReplies, { parentComment: comment })
|
|
49
|
+
] }),
|
|
50
|
+
!comment.deleted && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
51
|
+
/* @__PURE__ */ jsxs("div", { className: `${isEditing ? "border rounded-3 p-12 pb-8 d-flex gap-12 bg-gray-200 my-16" : "border rounded-3 p-12 pb-8 d-flex gap-12 mt-16"}`, children: [
|
|
52
|
+
/* @__PURE__ */ jsx(CommentAvatar, { id: authorId }),
|
|
53
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-fill", children: [
|
|
54
|
+
/* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center gap-12", children: [
|
|
55
|
+
/* @__PURE__ */ jsx(CommentTitle, { children: authorName }),
|
|
56
|
+
/* @__PURE__ */ jsx(BadgeProfile, { profile }),
|
|
57
|
+
/* @__PURE__ */ jsx(CommentDate, { createdAt, updatedAt })
|
|
58
|
+
] }),
|
|
59
|
+
isEditing ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60
|
+
/* @__PURE__ */ jsx("div", { className: "mt-8 mb-4", children: /* @__PURE__ */ jsx("textarea", { id: "update-comment", ref, value, className: "form-control", placeholder: t("comment.placeholder"), maxLength: options.maxCommentLength, onChange: handleChangeContent, rows: 1, style: {
|
|
61
|
+
resize: "none",
|
|
62
|
+
overflow: "hidden"
|
|
63
|
+
}, onFocus }) }),
|
|
64
|
+
/* @__PURE__ */ jsxs("div", { className: "d-flex justify-content-between align-items-center", children: [
|
|
65
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: handleReset, children: t("comment.cancel") }),
|
|
66
|
+
/* @__PURE__ */ jsxs("div", { className: "d-flex justify-content-end align-items-center gap-4", children: [
|
|
67
|
+
/* @__PURE__ */ jsx(TextCounter, { content: value, maxLength: options.maxCommentLength }),
|
|
68
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", variant: "ghost", size: "sm", leftIcon: /* @__PURE__ */ jsx(SvgIconSave, {}), disabled: !(content != null && content.length), onClick: () => handleUpdateComment(value), children: t("comment.save") })
|
|
69
|
+
] })
|
|
70
|
+
] })
|
|
71
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
72
|
+
/* @__PURE__ */ jsx("div", { className: "mt-8 mb-4", children: content }),
|
|
73
|
+
type === "edit" && /* @__PURE__ */ jsxs("div", { className: "ms-n8", children: [
|
|
74
|
+
!replyTo && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => handleReplyToComment(comment.id), children: t("comment.reply") }),
|
|
75
|
+
userId === authorId && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => {
|
|
76
|
+
handleModifyComment(comment.id), setValue(content);
|
|
77
|
+
}, children: t("comment.edit") }),
|
|
78
|
+
(userId === authorId || (userRights == null ? void 0 : userRights.manager)) && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => setIsDeleteModalOpen(!0), children: t("comment.remove") })
|
|
79
|
+
] })
|
|
58
80
|
] })
|
|
59
81
|
] })
|
|
60
|
-
] })
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, children: t("comment.edit") }),
|
|
66
|
-
(userId === authorId || (userRights == null ? void 0 : userRights.manager)) && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => setIsDeleteModalOpen(!0), children: t("comment.remove") })
|
|
67
|
-
] })
|
|
68
|
-
] })
|
|
69
|
-
] }),
|
|
70
|
-
/* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingScreen, { position: !1 }), children: isDeleteModalOpen && /* @__PURE__ */ jsx(DeleteModal, { isOpen: isDeleteModalOpen, onCancel: () => setIsDeleteModalOpen(!1), onSuccess: () => onDeleteComment(id) }) })
|
|
71
|
-
] }, id);
|
|
82
|
+
] }, id),
|
|
83
|
+
/* @__PURE__ */ jsx(CommentReplies, { parentComment: comment }),
|
|
84
|
+
/* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingScreen, { position: !1 }), children: isDeleteModalOpen && /* @__PURE__ */ jsx(DeleteModal, { isOpen: isDeleteModalOpen, onCancel: () => setIsDeleteModalOpen(!1), onSuccess: () => onDeleteComment(id) }) })
|
|
85
|
+
] })
|
|
86
|
+
] });
|
|
72
87
|
};
|
|
73
88
|
export {
|
|
74
89
|
Comment
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CommentDeleted: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
const CommentDeleted = () => {
|
|
4
|
+
const {
|
|
5
|
+
t
|
|
6
|
+
} = useTranslation();
|
|
7
|
+
return /* @__PURE__ */ jsx("div", { className: "border rounded-3 p-12 pb-8 d-flex gap-12 bg-gray-200 my-16", children: t("comment.deleted") });
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
CommentDeleted
|
|
11
|
+
};
|
|
@@ -5,19 +5,23 @@ import { useAutosizeTextarea } from "../hooks/useAutosizeTextarea.js";
|
|
|
5
5
|
import { useCommentsContext } from "../hooks/useCommentsContext.js";
|
|
6
6
|
import { CommentAvatar } from "./CommentAvatar.js";
|
|
7
7
|
import { TextCounter } from "./TextCounter.js";
|
|
8
|
+
import { useState } from "react";
|
|
8
9
|
import Button from "../../../components/Button/Button.js";
|
|
9
10
|
const CommentForm = ({
|
|
10
|
-
userId
|
|
11
|
+
userId,
|
|
12
|
+
replyTo
|
|
11
13
|
}) => {
|
|
12
|
-
const {
|
|
13
|
-
t
|
|
14
|
-
} = useTranslation(), {
|
|
15
|
-
content,
|
|
16
|
-
handleChangeContent,
|
|
14
|
+
const [content, setContent] = useState(""), {
|
|
17
15
|
handleCreateComment,
|
|
18
16
|
options,
|
|
19
17
|
type
|
|
20
|
-
} = useCommentsContext(), [ref, onFocus] = useAutosizeTextarea()
|
|
18
|
+
} = useCommentsContext(), [ref, onFocus] = useAutosizeTextarea(), {
|
|
19
|
+
t
|
|
20
|
+
} = useTranslation(), handleChangeContent = (event) => {
|
|
21
|
+
setContent(event.target.value);
|
|
22
|
+
}, handleSubmit = () => {
|
|
23
|
+
handleCreateComment(content, replyTo), setContent("");
|
|
24
|
+
};
|
|
21
25
|
return /* @__PURE__ */ jsx(Fragment, { children: type === "edit" && /* @__PURE__ */ jsxs("div", { className: "border rounded-3 p-12 pb-8 d-flex gap-12 bg-gray-200", children: [
|
|
22
26
|
/* @__PURE__ */ jsx(CommentAvatar, { id: userId }),
|
|
23
27
|
/* @__PURE__ */ jsxs("div", { className: "d-flex flex-column flex-fill gap-4", children: [
|
|
@@ -27,7 +31,7 @@ const CommentForm = ({
|
|
|
27
31
|
} }),
|
|
28
32
|
/* @__PURE__ */ jsxs("div", { className: "d-flex justify-content-end align-items-center gap-4", children: [
|
|
29
33
|
/* @__PURE__ */ jsx(TextCounter, { content, maxLength: options.maxCommentLength }),
|
|
30
|
-
/* @__PURE__ */ jsx(Button, { type: "submit", variant: "ghost", size: "sm", leftIcon: /* @__PURE__ */ jsx(SvgIconSend, {}), disabled: !(content != null && content.length), onClick:
|
|
34
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", variant: "ghost", size: "sm", leftIcon: /* @__PURE__ */ jsx(SvgIconSend, {}), disabled: !(content != null && content.length), onClick: handleSubmit, children: t("comment.post") })
|
|
31
35
|
] })
|
|
32
36
|
] })
|
|
33
37
|
] }) });
|
|
@@ -6,15 +6,15 @@ function CommentList() {
|
|
|
6
6
|
const {
|
|
7
7
|
user
|
|
8
8
|
} = useEdificeClient(), {
|
|
9
|
-
|
|
9
|
+
displayedComments,
|
|
10
10
|
profiles
|
|
11
11
|
} = useCommentsContext();
|
|
12
|
-
return
|
|
12
|
+
return displayedComments == null ? void 0 : displayedComments.map((comment) => {
|
|
13
13
|
var _a;
|
|
14
14
|
const {
|
|
15
15
|
authorId
|
|
16
16
|
} = comment, profile = ((_a = profiles == null ? void 0 : profiles.find((user2) => (user2 == null ? void 0 : user2.userId) === authorId)) == null ? void 0 : _a.profile) ?? "Guest";
|
|
17
|
-
return /* @__PURE__ */ jsx(Comment, { comment, profile, userId: user == null ? void 0 : user.userId }, comment.id);
|
|
17
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Comment, { comment, profile, userId: user == null ? void 0 : user.userId }) }, comment.id);
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
export {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Comment } from "./Comment.js";
|
|
3
|
+
import { CommentForm } from "./CommentForm.js";
|
|
4
|
+
import { useCommentReplies } from "../hooks/useCommentReplies.js";
|
|
5
|
+
import Button from "../../../components/Button/Button.js";
|
|
6
|
+
const CommentReplies = ({
|
|
7
|
+
parentComment
|
|
8
|
+
}) => {
|
|
9
|
+
const {
|
|
10
|
+
t,
|
|
11
|
+
profiles,
|
|
12
|
+
user,
|
|
13
|
+
displayedReplies,
|
|
14
|
+
showCommentForm,
|
|
15
|
+
showMoreReplies,
|
|
16
|
+
handleMoreReplies
|
|
17
|
+
} = useCommentReplies({
|
|
18
|
+
parentComment
|
|
19
|
+
});
|
|
20
|
+
return /* @__PURE__ */ jsxs("div", { className: "comments-replies-container", children: [
|
|
21
|
+
showCommentForm && /* @__PURE__ */ jsx("div", { className: "comments-replies-form", children: /* @__PURE__ */ jsx(CommentForm, { userId: user == null ? void 0 : user.userId, replyTo: parentComment.id }) }),
|
|
22
|
+
/* @__PURE__ */ jsx("div", { className: "comments-replies-list", children: displayedReplies.map((reply) => {
|
|
23
|
+
var _a;
|
|
24
|
+
const profile = ((_a = profiles == null ? void 0 : profiles.find((user2) => (user2 == null ? void 0 : user2.userId) === reply.authorId)) == null ? void 0 : _a.profile) ?? "Guest";
|
|
25
|
+
if (!reply.deleted)
|
|
26
|
+
return /* @__PURE__ */ jsx("div", { className: "comments-replies-reply", children: /* @__PURE__ */ jsx(Comment, { comment: reply, profile, userId: user == null ? void 0 : user.userId }) }, reply.id);
|
|
27
|
+
}) }),
|
|
28
|
+
showMoreReplies && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", onClick: handleMoreReplies, className: "ms-24", children: t("comment.more.replies") })
|
|
29
|
+
] });
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
CommentReplies
|
|
33
|
+
};
|
|
@@ -18,3 +18,7 @@ export declare const DEFAULT_ADD_COMMENTS = 5;
|
|
|
18
18
|
* Limit to display replies of a comment
|
|
19
19
|
*/
|
|
20
20
|
export declare const DEFAULT_MAX_REPLIES = 5;
|
|
21
|
+
/**
|
|
22
|
+
* Number of comments to add when adding more comment in the limited list
|
|
23
|
+
*/
|
|
24
|
+
export declare const DEFAULT_ADD_REPLIES = 5;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
const DEFAULT_MAX_COMMENT_LENGTH = 200, DEFAULT_MAX_REPLY_LENGTH = 200, DEFAULT_MAX_COMMENTS = 4, DEFAULT_ADD_COMMENTS = 5, DEFAULT_MAX_REPLIES = 5;
|
|
1
|
+
const DEFAULT_MAX_COMMENT_LENGTH = 200, DEFAULT_MAX_REPLY_LENGTH = 200, DEFAULT_MAX_COMMENTS = 4, DEFAULT_ADD_COMMENTS = 5, DEFAULT_MAX_REPLIES = 5, DEFAULT_ADD_REPLIES = 5;
|
|
2
2
|
export {
|
|
3
3
|
DEFAULT_ADD_COMMENTS,
|
|
4
|
+
DEFAULT_ADD_REPLIES,
|
|
4
5
|
DEFAULT_MAX_COMMENTS,
|
|
5
6
|
DEFAULT_MAX_COMMENT_LENGTH,
|
|
6
7
|
DEFAULT_MAX_REPLIES,
|