@edifice.io/react 2.5.1 → 2.5.2-develop-b2school-actualites.20251127174432
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/index.d.ts +1 -0
- package/dist/components/Divider/Divider.d.ts +5 -0
- package/dist/components/Divider/Divider.js +21 -0
- package/dist/components/Divider/index.d.ts +1 -0
- package/dist/components/Flex/Flex.js +1 -1
- package/dist/components/Menu/components/MenuButton.d.ts +2 -0
- package/dist/components/Menu/components/MenuButton.js +13 -4
- package/dist/components/Select/Select.d.ts +6 -2
- package/dist/components/Select/Select.js +10 -4
- package/dist/components/SeparatedInfo/SeparatedInfo.d.ts +6 -0
- package/dist/components/SeparatedInfo/SeparatedInfo.js +13 -0
- package/dist/components/SeparatedInfo/index.d.ts +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/editor.js +40 -36
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useInfiniteScroll/index.d.ts +1 -0
- package/dist/hooks/useInfiniteScroll/useInfiniteScroll.d.ts +33 -0
- package/dist/hooks/useInfiniteScroll/useInfiniteScroll.js +20 -0
- package/dist/icons.js +294 -292
- package/dist/index.js +86 -74
- package/dist/modals.js +8 -6
- package/dist/modules/comments/components/Comment.js +5 -3
- package/dist/modules/comments/components/CommentList.js +1 -1
- package/dist/modules/comments/constants.d.ts +4 -0
- package/dist/modules/comments/constants.js +2 -1
- package/dist/modules/comments/hooks/useProfileQueries.js +2 -1
- package/dist/modules/comments/provider/CommentProvider.js +2 -1
- package/dist/modules/comments/types.d.ts +4 -0
- package/dist/modules/editor/components/Editor/EditorPreview.d.ts +14 -0
- package/dist/modules/editor/components/Editor/EditorPreview.js +56 -0
- package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.d.ts +8 -0
- package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.js +24 -0
- package/dist/modules/editor/components/Editor/index.d.ts +2 -0
- package/dist/modules/icons/components/IconClockAlert.d.ts +7 -0
- package/dist/modules/icons/components/IconClockAlert.js +17 -0
- package/dist/modules/icons/components/index.d.ts +1 -0
- package/dist/modules/modals/ShareModal/ShareBookmark.d.ts +1 -1
- package/dist/modules/modals/ShareModal/ShareBookmark.js +5 -2
- package/dist/modules/modals/ShareModal/ShareModal.d.ts +1 -11
- package/dist/modules/modals/ShareModal/ShareModal.js +13 -105
- package/dist/modules/modals/ShareModal/ShareResources.d.ts +168 -0
- package/dist/modules/modals/ShareModal/ShareResources.js +137 -0
- package/dist/modules/modals/ShareModal/hooks/useSearch.d.ts +2 -1
- package/dist/modules/modals/ShareModal/hooks/useSearch.js +3 -2
- package/dist/modules/modals/ShareModal/hooks/useShare.d.ts +12 -5
- package/dist/modules/modals/ShareModal/hooks/useShare.js +20 -13
- package/dist/modules/modals/ShareModal/hooks/useShareBookmark.d.ts +1 -1
- package/dist/modules/modals/ShareModal/hooks/useShareBookmark.js +1 -1
- package/dist/modules/modals/ShareModal/index.d.ts +3 -1
- package/dist/providers/AntThemeProvider/AntProvider.d.ts +10 -0
- package/dist/providers/AntThemeProvider/AntProvider.js +11 -0
- package/dist/providers/AntThemeProvider/antThemeConfig.d.ts +7 -0
- package/dist/providers/AntThemeProvider/antThemeConfig.js +10 -0
- package/dist/providers/EdificeThemeProvider/EdificeThemeProvider.js +2 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/style.css +1 -0
- package/dist/utilities/index.d.ts +1 -0
- package/dist/utilities/react-query/index.d.ts +1 -0
- package/dist/utilities/react-query/react-query-utils.d.ts +21 -0
- package/dist/utilities/react-query/react-query-utils.js +13 -0
- package/package.json +8 -6
package/dist/index.js
CHANGED
|
@@ -63,52 +63,56 @@ import { default as default62 } from "./hooks/useHasWorkflow/useHasWorkflow.js";
|
|
|
63
63
|
import { default as default63 } from "./hooks/useHover/useHover.js";
|
|
64
64
|
import { useHttpErrorToast } from "./hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
65
65
|
import { default as default64 } from "./hooks/useImage/useImage.js";
|
|
66
|
-
import { default as default65 } from "./hooks/
|
|
67
|
-
import { default as default66 } from "./hooks/
|
|
68
|
-
import { default as default67 } from "./hooks/
|
|
69
|
-
import { default as default68 } from "./hooks/
|
|
70
|
-
import { default as default69 } from "./hooks/
|
|
71
|
-
import { default as default70 } from "./hooks/
|
|
72
|
-
import { default as default71 } from "./hooks/
|
|
73
|
-
import { default as default72 } from "./hooks/
|
|
74
|
-
import { default as default73 } from "./hooks/
|
|
75
|
-
import { default as default74 } from "./hooks/
|
|
76
|
-
import { default as default75 } from "./hooks/
|
|
77
|
-
import { default as default76 } from "./hooks/
|
|
78
|
-
import { default as default77 } from "./hooks/
|
|
79
|
-
import { default as default78 } from "./hooks/
|
|
80
|
-
import { default as default79 } from "./hooks/
|
|
81
|
-
import { default as default80 } from "./hooks/
|
|
82
|
-
import { default as default81 } from "./hooks/
|
|
83
|
-
import {
|
|
84
|
-
import { default as default83 } from "./hooks/
|
|
85
|
-
import { default as default84 } from "./hooks/
|
|
86
|
-
import { default as default85 } from "./hooks/
|
|
87
|
-
import { default as default86 } from "./
|
|
88
|
-
import { default as default87 } from "./modules/modals/
|
|
89
|
-
import { default as default88 } from "./modules/modals/
|
|
90
|
-
import { default as default89 } from "./modules/modals/
|
|
91
|
-
import { default as default90 } from "./modules/modals/ResourceModal/
|
|
92
|
-
import { default as default91 } from "./modules/modals/
|
|
66
|
+
import { default as default65 } from "./hooks/useInfiniteScroll/useInfiniteScroll.js";
|
|
67
|
+
import { default as default66 } from "./hooks/useIsAdml/useIsAdml.js";
|
|
68
|
+
import { default as default67 } from "./hooks/useIsAdmc/useIsAdmc.js";
|
|
69
|
+
import { default as default68 } from "./hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.js";
|
|
70
|
+
import { default as default69 } from "./hooks/useKeyPress/useKeyPress.js";
|
|
71
|
+
import { default as default70 } from "./hooks/useLibraryUrl/useLibraryUrl.js";
|
|
72
|
+
import { default as default71 } from "./hooks/useMediaLibrary/useMediaLibrary.js";
|
|
73
|
+
import { default as default72 } from "./hooks/useScrollToTop/useScrollToTop.js";
|
|
74
|
+
import { default as default73 } from "./hooks/useTitle/useTitle.js";
|
|
75
|
+
import { default as default74 } from "./hooks/useToast/useToast.js";
|
|
76
|
+
import { default as default75 } from "./hooks/useToggle/useToggle.js";
|
|
77
|
+
import { default as default76 } from "./hooks/useTrapFocus/useTrapFocus.js";
|
|
78
|
+
import { default as default77 } from "./hooks/useTrashedResource/useTrashedResource.js";
|
|
79
|
+
import { default as default78 } from "./hooks/useUpload/useUpload.js";
|
|
80
|
+
import { default as default79 } from "./hooks/useUploadFiles/useUploadFiles.js";
|
|
81
|
+
import { default as default80 } from "./hooks/useUser/useUser.js";
|
|
82
|
+
import { default as default81 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
|
|
83
|
+
import { default as default82 } from "./hooks/useWorkspaceFolders/useWorkspaceFolders.js";
|
|
84
|
+
import { WORKSPACE_SHARED_FOLDER_ID, WORKSPACE_USER_FOLDER_ID, default as default83 } from "./hooks/useWorkspaceFolders/useWorkspaceFoldersTree.js";
|
|
85
|
+
import { default as default84 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
86
|
+
import { default as default85 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
|
|
87
|
+
import { default as default86 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
88
|
+
import { default as default87 } from "./modules/modals/ConfirmModal/ConfirmModal.js";
|
|
89
|
+
import { default as default88 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
|
|
90
|
+
import { default as default89 } from "./modules/modals/PublishModal/PublishModal.js";
|
|
91
|
+
import { default as default90 } from "./modules/modals/ResourceModal/apps/BlogPublic.js";
|
|
92
|
+
import { default as default91 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
93
93
|
import { default as default92 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
|
|
94
94
|
import { default as default93 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
95
|
-
import { default as default94 } from "./modules/
|
|
96
|
-
import { default as default95 } from "./modules/
|
|
97
|
-
import { default as default96 } from "./modules/multimedia/
|
|
98
|
-
import { default as default97 } from "./modules/multimedia/
|
|
99
|
-
import { default as default98 } from "./modules/multimedia/
|
|
100
|
-
import { default as default99 } from "./modules/multimedia/
|
|
101
|
-
import { default as default100 } from "./modules/multimedia/
|
|
102
|
-
import { default as default101 } from "./modules/multimedia/
|
|
103
|
-
import { default as default102 } from "./modules/multimedia/
|
|
104
|
-
import { default as default103 } from "./modules/multimedia/
|
|
95
|
+
import { default as default94 } from "./modules/modals/ShareModal/ShareModal.js";
|
|
96
|
+
import { default as default95 } from "./modules/modals/ShareModal/ShareResources.js";
|
|
97
|
+
import { default as default96 } from "./modules/multimedia/AudioRecorder/AudioRecorder.js";
|
|
98
|
+
import { default as default97 } from "./modules/multimedia/Embed/Embed.js";
|
|
99
|
+
import { default as default98 } from "./modules/multimedia/ImageEditor/components/ImageEditor.js";
|
|
100
|
+
import { default as default99 } from "./modules/multimedia/ImagePicker/ImagePicker.js";
|
|
101
|
+
import { default as default100 } from "./modules/multimedia/FileCard/FileCard.js";
|
|
102
|
+
import { default as default101 } from "./modules/multimedia/MediaLibrary/MediaLibrary.js";
|
|
103
|
+
import { default as default102 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
|
|
104
|
+
import { default as default103 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
|
|
105
|
+
import { default as default104 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
106
|
+
import { default as default105 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
105
107
|
import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
|
|
108
|
+
import { Divider } from "./components/Divider/Divider.js";
|
|
106
109
|
import { DropzoneContext, useDropzoneContext } from "./components/Dropzone/DropzoneContext.js";
|
|
107
110
|
import { Column, Grid } from "./components/Grid/Grid.js";
|
|
108
111
|
import { Layout } from "./components/Layout/Layout.js";
|
|
109
112
|
import { List } from "./components/List/List.js";
|
|
110
113
|
import { Menu } from "./components/Menu/components/Menu.js";
|
|
111
114
|
import { Popover, PopoverBody, PopoverFooter, PopoverHeader } from "./components/Popover/Popover.js";
|
|
115
|
+
import { SeparatedInfo } from "./components/SeparatedInfo/SeparatedInfo.js";
|
|
112
116
|
import { Tabs } from "./components/Tabs/components/Tabs.js";
|
|
113
117
|
import { Toolbar } from "./components/Toolbar/Toolbar.js";
|
|
114
118
|
import { useTreeSortable } from "./components/Tree/hooks/useTreeSortable.js";
|
|
@@ -120,6 +124,7 @@ import { useCheckable } from "./hooks/useCheckable/useCheckable.js";
|
|
|
120
124
|
import { ResourceModal } from "./modules/modals/ResourceModal/ResourceModal.js";
|
|
121
125
|
import { ExternalLinker } from "./modules/multimedia/Linker/ExternalLinker/ExternalLinker.js";
|
|
122
126
|
import { InternalLinker } from "./modules/multimedia/Linker/InternalLinker/InternalLinker.js";
|
|
127
|
+
import { AntProvider } from "./providers/AntThemeProvider/AntProvider.js";
|
|
123
128
|
import { EdificeClientProvider } from "./providers/EdificeClientProvider/EdificeClientProvider.js";
|
|
124
129
|
import { EdificeClientContext } from "./providers/EdificeClientProvider/EdificeClientProvider.context.js";
|
|
125
130
|
import { useEdificeClient } from "./providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
@@ -129,19 +134,21 @@ import { useEdificeTheme } from "./providers/EdificeThemeProvider/EdificeThemePr
|
|
|
129
134
|
import { MockedProvider } from "./providers/MockedProvider/MockedProvider.js";
|
|
130
135
|
import { checkUserRight } from "./utilities/check-user-rights/check-user-rights.js";
|
|
131
136
|
import { emptyScreenMapping } from "./utilities/emptyscreen-mapping/emptyscreen-mapping.js";
|
|
137
|
+
import { invalidateQueriesWithFirstPage } from "./utilities/react-query/react-query-utils.js";
|
|
132
138
|
import { mergeRefs, setRef } from "./utilities/refs/ref.js";
|
|
133
139
|
export {
|
|
134
140
|
AccessiblePalette,
|
|
135
141
|
default2 as ActionBar,
|
|
136
142
|
default3 as Alert,
|
|
143
|
+
AntProvider,
|
|
137
144
|
default4 as AppHeader,
|
|
138
145
|
default5 as AppIcon,
|
|
139
146
|
default6 as Attachment,
|
|
140
|
-
|
|
147
|
+
default96 as AudioRecorder,
|
|
141
148
|
default7 as Avatar,
|
|
142
149
|
default8 as AvatarGroup,
|
|
143
150
|
default9 as Badge,
|
|
144
|
-
|
|
151
|
+
default90 as BlogPublic,
|
|
145
152
|
default10 as Breadcrumb,
|
|
146
153
|
default11 as Button,
|
|
147
154
|
default38 as ButtonSkeleton,
|
|
@@ -151,8 +158,9 @@ export {
|
|
|
151
158
|
default17 as ColorPickerItem,
|
|
152
159
|
Column,
|
|
153
160
|
default18 as Combobox,
|
|
154
|
-
|
|
161
|
+
default87 as ConfirmModal,
|
|
155
162
|
DefaultPalette,
|
|
163
|
+
Divider,
|
|
156
164
|
DndTree,
|
|
157
165
|
default19 as Dropdown,
|
|
158
166
|
default20 as Dropzone,
|
|
@@ -161,10 +169,10 @@ export {
|
|
|
161
169
|
EdificeClientProvider,
|
|
162
170
|
EdificeThemeContext,
|
|
163
171
|
EdificeThemeProvider,
|
|
164
|
-
|
|
172
|
+
default97 as Embed,
|
|
165
173
|
default21 as EmptyScreen,
|
|
166
174
|
ExternalLinker,
|
|
167
|
-
|
|
175
|
+
default100 as FileCard,
|
|
168
176
|
default22 as Flex,
|
|
169
177
|
default24 as FormControl,
|
|
170
178
|
default23 as FormText,
|
|
@@ -172,8 +180,8 @@ export {
|
|
|
172
180
|
default25 as Heading,
|
|
173
181
|
default12 as IconButton,
|
|
174
182
|
default26 as Image,
|
|
175
|
-
|
|
176
|
-
|
|
183
|
+
default98 as ImageEditor,
|
|
184
|
+
default99 as ImagePicker,
|
|
177
185
|
default27 as Input,
|
|
178
186
|
InternalLinker,
|
|
179
187
|
default28 as Label,
|
|
@@ -182,25 +190,27 @@ export {
|
|
|
182
190
|
default29 as Loading,
|
|
183
191
|
default30 as LoadingScreen,
|
|
184
192
|
default31 as Logo,
|
|
185
|
-
|
|
193
|
+
default101 as MediaLibrary,
|
|
186
194
|
Menu,
|
|
187
195
|
MockedProvider,
|
|
188
196
|
default32 as Modal,
|
|
189
|
-
|
|
197
|
+
default88 as OnboardingModal,
|
|
190
198
|
Popover,
|
|
191
199
|
PopoverBody,
|
|
192
200
|
PopoverFooter,
|
|
193
201
|
PopoverHeader,
|
|
194
202
|
default33 as PreventPropagation,
|
|
195
|
-
|
|
203
|
+
default89 as PublishModal,
|
|
196
204
|
default34 as Radio,
|
|
197
205
|
default35 as RadioCard,
|
|
198
206
|
ResourceModal,
|
|
199
207
|
default36 as SearchBar,
|
|
200
208
|
default13 as SearchButton,
|
|
201
209
|
default37 as Select,
|
|
210
|
+
SeparatedInfo,
|
|
202
211
|
default92 as ShareBlog,
|
|
203
|
-
|
|
212
|
+
default94 as ShareModal,
|
|
213
|
+
default95 as ShareResources,
|
|
204
214
|
default46 as SortableTree,
|
|
205
215
|
default40 as StackedGroup,
|
|
206
216
|
default41 as Stepper,
|
|
@@ -215,13 +225,13 @@ export {
|
|
|
215
225
|
TreeNode,
|
|
216
226
|
TreeNodeFolderWrapper,
|
|
217
227
|
default48 as TreeView,
|
|
218
|
-
|
|
219
|
-
|
|
228
|
+
default102 as VideoEmbed,
|
|
229
|
+
default103 as VideoRecorder,
|
|
220
230
|
default49 as VisuallyHidden,
|
|
221
231
|
WORKSPACE_SHARED_FOLDER_ID,
|
|
222
232
|
WORKSPACE_USER_FOLDER_ID,
|
|
223
|
-
|
|
224
|
-
|
|
233
|
+
default104 as Workspace,
|
|
234
|
+
default105 as WorkspaceFolders,
|
|
225
235
|
addNode,
|
|
226
236
|
arrayUnique,
|
|
227
237
|
buildTree,
|
|
@@ -243,6 +253,7 @@ export {
|
|
|
243
253
|
getIndicesToUpdate,
|
|
244
254
|
getProjection,
|
|
245
255
|
hasChildren,
|
|
256
|
+
invalidateQueriesWithFirstPage,
|
|
246
257
|
mergeRefs,
|
|
247
258
|
modifyNode,
|
|
248
259
|
moveNode,
|
|
@@ -269,30 +280,31 @@ export {
|
|
|
269
280
|
default63 as useHover,
|
|
270
281
|
useHttpErrorToast,
|
|
271
282
|
default64 as useImage,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
default68 as
|
|
276
|
-
default69 as
|
|
277
|
-
default70 as
|
|
278
|
-
default71 as
|
|
283
|
+
default65 as useInfiniteScroll,
|
|
284
|
+
default67 as useIsAdmc,
|
|
285
|
+
default66 as useIsAdml,
|
|
286
|
+
default68 as useIsAdmlcOrAdmc,
|
|
287
|
+
default69 as useKeyPress,
|
|
288
|
+
default70 as useLibraryUrl,
|
|
289
|
+
default71 as useMediaLibrary,
|
|
290
|
+
default72 as useScrollToTop,
|
|
279
291
|
default93 as useShareMutation,
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
292
|
+
default73 as useTitle,
|
|
293
|
+
default74 as useToast,
|
|
294
|
+
default75 as useToggle,
|
|
295
|
+
default76 as useTrapFocus,
|
|
296
|
+
default77 as useTrashedResource,
|
|
285
297
|
useTreeSortable,
|
|
286
298
|
useTreeView,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
299
|
+
default91 as useUpdateMutation,
|
|
300
|
+
default78 as useUpload,
|
|
301
|
+
default79 as useUploadFiles,
|
|
302
|
+
default80 as useUser,
|
|
303
|
+
default81 as useWorkspaceFile,
|
|
304
|
+
default82 as useWorkspaceFolders,
|
|
305
|
+
default83 as useWorkspaceFoldersTree,
|
|
306
|
+
default84 as useWorkspaceSearch,
|
|
307
|
+
default85 as useXitiTrackPageLoad,
|
|
308
|
+
default86 as useZendeskGuide,
|
|
297
309
|
wrapTreeNode
|
|
298
310
|
};
|
package/dist/modals.js
CHANGED
|
@@ -3,9 +3,10 @@ import { default as default3 } from "./modules/modals/OnboardingModal/Onboarding
|
|
|
3
3
|
import { default as default4 } from "./modules/modals/PublishModal/PublishModal.js";
|
|
4
4
|
import { default as default5 } from "./modules/modals/ResourceModal/apps/BlogPublic.js";
|
|
5
5
|
import { default as default6 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
6
|
-
import { default as default7 } from "./modules/modals/ShareModal/
|
|
7
|
-
import { default as default8 } from "./modules/modals/ShareModal/
|
|
8
|
-
import { default as default9 } from "./modules/modals/ShareModal/
|
|
6
|
+
import { default as default7 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
|
|
7
|
+
import { default as default8 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
8
|
+
import { default as default9 } from "./modules/modals/ShareModal/ShareModal.js";
|
|
9
|
+
import { default as default10 } from "./modules/modals/ShareModal/ShareResources.js";
|
|
9
10
|
import { ResourceModal } from "./modules/modals/ResourceModal/ResourceModal.js";
|
|
10
11
|
export {
|
|
11
12
|
default5 as BlogPublic,
|
|
@@ -13,8 +14,9 @@ export {
|
|
|
13
14
|
default3 as OnboardingModal,
|
|
14
15
|
default4 as PublishModal,
|
|
15
16
|
ResourceModal,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
default7 as ShareBlog,
|
|
18
|
+
default9 as ShareModal,
|
|
19
|
+
default10 as ShareResources,
|
|
20
|
+
default8 as useShareMutation,
|
|
19
21
|
default6 as useUpdateMutation
|
|
20
22
|
};
|
|
@@ -8,9 +8,9 @@ import { BadgeProfile } from "./BadgeProfile.js";
|
|
|
8
8
|
import { CommentAvatar } from "./CommentAvatar.js";
|
|
9
9
|
import { CommentDate } from "./CommentDate.js";
|
|
10
10
|
import { CommentTitle } from "./CommentTitle.js";
|
|
11
|
-
import { TextCounter } from "./TextCounter.js";
|
|
12
11
|
import { CommentDeleted } from "./CommentDeleted.js";
|
|
13
12
|
import { CommentReplies } from "./CommentReplies.js";
|
|
13
|
+
import { TextCounter } from "./TextCounter.js";
|
|
14
14
|
import Button from "../../../components/Button/Button.js";
|
|
15
15
|
import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
|
|
16
16
|
const DeleteModal = /* @__PURE__ */ lazy(() => import("./DeleteModal.js")), Comment = ({
|
|
@@ -41,6 +41,8 @@ const DeleteModal = /* @__PURE__ */ lazy(() => import("./DeleteModal.js")), Comm
|
|
|
41
41
|
handleReplyToComment
|
|
42
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) => {
|
|
43
43
|
resizeTextarea(), setValue(event.target.value);
|
|
44
|
+
}, handleDeleteComment = (id2) => {
|
|
45
|
+
onDeleteComment(id2), setIsDeleteModalOpen(!1);
|
|
44
46
|
};
|
|
45
47
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
46
48
|
comment.deleted && hasReplies && !hasAllDeletedReplies && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -73,7 +75,7 @@ const DeleteModal = /* @__PURE__ */ lazy(() => import("./DeleteModal.js")), Comm
|
|
|
73
75
|
whiteSpace: "pre-line"
|
|
74
76
|
}, children: content }),
|
|
75
77
|
type === "edit" && /* @__PURE__ */ jsxs("div", { className: "ms-n8", children: [
|
|
76
|
-
!replyTo && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => handleReplyToComment(comment.id), children: t("comment.reply") }),
|
|
78
|
+
!(replyTo || options.disableReply) && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => handleReplyToComment(comment.id), children: t("comment.reply") }),
|
|
77
79
|
userId === authorId && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => {
|
|
78
80
|
handleModifyComment(comment.id), setValue(content);
|
|
79
81
|
}, children: t("comment.edit") }),
|
|
@@ -83,7 +85,7 @@ const DeleteModal = /* @__PURE__ */ lazy(() => import("./DeleteModal.js")), Comm
|
|
|
83
85
|
] })
|
|
84
86
|
] }, id),
|
|
85
87
|
/* @__PURE__ */ jsx(CommentReplies, { parentComment: comment }),
|
|
86
|
-
/* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingScreen, { position: !1 }), children: isDeleteModalOpen && /* @__PURE__ */ jsx(DeleteModal, { isOpen: isDeleteModalOpen, onCancel: () => setIsDeleteModalOpen(!1), onSuccess: () =>
|
|
88
|
+
/* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingScreen, { position: !1 }), children: isDeleteModalOpen && /* @__PURE__ */ jsx(DeleteModal, { isOpen: isDeleteModalOpen, onCancel: () => setIsDeleteModalOpen(!1), onSuccess: () => handleDeleteComment(id) }) })
|
|
87
89
|
] })
|
|
88
90
|
] });
|
|
89
91
|
};
|
|
@@ -14,7 +14,7 @@ function CommentList() {
|
|
|
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("div", { children: /* @__PURE__ */ jsx(Comment, { comment, profile, userId: user == null ? void 0 : user.userId }) }, comment.id);
|
|
17
|
+
return /* @__PURE__ */ jsx("div", { id: `comment-${comment.id}`, children: /* @__PURE__ */ jsx(Comment, { comment, profile, userId: user == null ? void 0 : user.userId }) }, comment.id);
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
export {
|
|
@@ -22,3 +22,7 @@ export declare const DEFAULT_MAX_REPLIES = 5;
|
|
|
22
22
|
* Number of comments to add when adding more comment in the limited list
|
|
23
23
|
*/
|
|
24
24
|
export declare const DEFAULT_ADD_REPLIES = 5;
|
|
25
|
+
/**
|
|
26
|
+
* Forbid replying to a comment. Defaults to false.
|
|
27
|
+
*/
|
|
28
|
+
export declare const DEFAULT_DISABLE_REPLY = false;
|
|
@@ -1,7 +1,8 @@
|
|
|
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;
|
|
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, DEFAULT_DISABLE_REPLY = !1;
|
|
2
2
|
export {
|
|
3
3
|
DEFAULT_ADD_COMMENTS,
|
|
4
4
|
DEFAULT_ADD_REPLIES,
|
|
5
|
+
DEFAULT_DISABLE_REPLY,
|
|
5
6
|
DEFAULT_MAX_COMMENTS,
|
|
6
7
|
DEFAULT_MAX_COMMENT_LENGTH,
|
|
7
8
|
DEFAULT_MAX_REPLIES,
|
|
@@ -3,7 +3,7 @@ import { useMemo } from "react";
|
|
|
3
3
|
import { CommentForm } from "../components/CommentForm.js";
|
|
4
4
|
import { CommentHeader } from "../components/CommentHeader.js";
|
|
5
5
|
import { CommentList } from "../components/CommentList.js";
|
|
6
|
-
import { DEFAULT_ADD_REPLIES, DEFAULT_MAX_REPLIES, DEFAULT_ADD_COMMENTS, DEFAULT_MAX_COMMENTS, DEFAULT_MAX_REPLY_LENGTH, DEFAULT_MAX_COMMENT_LENGTH } from "../constants.js";
|
|
6
|
+
import { DEFAULT_DISABLE_REPLY, DEFAULT_ADD_REPLIES, DEFAULT_MAX_REPLIES, DEFAULT_ADD_COMMENTS, DEFAULT_MAX_COMMENTS, DEFAULT_MAX_REPLY_LENGTH, DEFAULT_MAX_COMMENT_LENGTH } from "../constants.js";
|
|
7
7
|
import { CommentContext } from "../context/Context.js";
|
|
8
8
|
import { useComments } from "../hooks/useComments.js";
|
|
9
9
|
import Button from "../../../components/Button/Button.js";
|
|
@@ -20,6 +20,7 @@ const CommentProvider = ({
|
|
|
20
20
|
additionalComments: DEFAULT_ADD_COMMENTS,
|
|
21
21
|
maxReplies: DEFAULT_MAX_REPLIES,
|
|
22
22
|
additionalReplies: DEFAULT_ADD_REPLIES,
|
|
23
|
+
disableReply: DEFAULT_DISABLE_REPLY,
|
|
23
24
|
...commentOptions
|
|
24
25
|
}, {
|
|
25
26
|
type
|
|
@@ -104,6 +104,10 @@ export type CommentOptions = {
|
|
|
104
104
|
* Number of replies to load additionally in the limited list
|
|
105
105
|
*/
|
|
106
106
|
additionalReplies: number;
|
|
107
|
+
/**
|
|
108
|
+
* Forbid replying to a comment. Defaults to false.
|
|
109
|
+
*/
|
|
110
|
+
disableReply: boolean;
|
|
107
111
|
};
|
|
108
112
|
export interface UserProfileResult {
|
|
109
113
|
/**
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Editor component properties
|
|
3
|
+
*/
|
|
4
|
+
export interface EditorPreviewProps {
|
|
5
|
+
/** Rich content to render. */
|
|
6
|
+
content: string;
|
|
7
|
+
/** Display with or without a border */
|
|
8
|
+
variant?: 'outline' | 'ghost';
|
|
9
|
+
onDetailClick?: () => void;
|
|
10
|
+
onMediaClick?: () => void;
|
|
11
|
+
maxMediaDisplayed?: number;
|
|
12
|
+
}
|
|
13
|
+
declare const EditorPreview: ({ content, variant, onDetailClick, onMediaClick, maxMediaDisplayed, }: EditorPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default EditorPreview;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { getThumbnail } from "@edifice.io/utilities";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
import Image from "../../../../components/Image/Image.js";
|
|
7
|
+
const EditorPreview = ({
|
|
8
|
+
content,
|
|
9
|
+
variant = "outline",
|
|
10
|
+
onDetailClick,
|
|
11
|
+
onMediaClick,
|
|
12
|
+
maxMediaDisplayed = 3
|
|
13
|
+
}) => {
|
|
14
|
+
const {
|
|
15
|
+
t
|
|
16
|
+
} = useTranslation(), [summaryContent, setSummaryContent] = useState(""), [medias, setMedias] = useState([]), borderClass = clsx(variant === "outline" && "border rounded-3 py-12 px-16"), hasMediaCallback = onDetailClick || onMediaClick, handleMediaClick = (e) => {
|
|
17
|
+
onMediaClick && (e.stopPropagation(), onMediaClick());
|
|
18
|
+
};
|
|
19
|
+
return useEffect(() => {
|
|
20
|
+
const contentHTML = content;
|
|
21
|
+
if (contentHTML) {
|
|
22
|
+
const doc = new DOMParser().parseFromString(contentHTML, "text/html"), mediaElements = Array.from(doc.querySelectorAll("img, video, iframe, audio, embed"));
|
|
23
|
+
setMedias(mediaElements.filter((el) => el.tagName.toLowerCase() === "img").map((el) => {
|
|
24
|
+
const image = el;
|
|
25
|
+
return image.src ? {
|
|
26
|
+
url: getThumbnail(image.src, 0, 300),
|
|
27
|
+
alt: image.alt
|
|
28
|
+
} : {
|
|
29
|
+
url: "",
|
|
30
|
+
alt: ""
|
|
31
|
+
};
|
|
32
|
+
})), mediaElements.forEach((el) => {
|
|
33
|
+
var _a;
|
|
34
|
+
return (_a = el.parentNode) == null ? void 0 : _a.removeChild(el);
|
|
35
|
+
}), setSummaryContent(doc.body.textContent || "");
|
|
36
|
+
}
|
|
37
|
+
}, [content]), /* @__PURE__ */ jsxs("div", { className: borderClass, "data-testid": "editor-preview", onClick: onDetailClick, tabIndex: onDetailClick ? -1 : void 0, role: onDetailClick ? "button" : void 0, children: [
|
|
38
|
+
/* @__PURE__ */ jsx("div", { className: "flex-fill text-truncate text-truncate-2 post-preview-content overflow-hidden", style: {
|
|
39
|
+
overflowWrap: "anywhere"
|
|
40
|
+
}, children: summaryContent }),
|
|
41
|
+
/* @__PURE__ */ jsx("div", { onClick: handleMediaClick, tabIndex: hasMediaCallback ? -1 : void 0, role: hasMediaCallback ? "button" : void 0, className: "d-flex align-items-center justify-content-center gap-24 px-32 pt-16", children: medias.slice(0, maxMediaDisplayed).map((media, index) => /* @__PURE__ */ jsxs("div", { className: clsx("position-relative col-12 col-md-4 ", {
|
|
42
|
+
"d-none d-md-block": index >= 1
|
|
43
|
+
}), children: [
|
|
44
|
+
/* @__PURE__ */ jsx(Image, { alt: media.alt, objectFit: "cover", ratio: "16", className: "rounded", loading: "lazy", src: media.url, sizes: "" }),
|
|
45
|
+
(index === 0 || index === 2) && medias.length - (index + 1) > 0 && /* @__PURE__ */ jsx("div", { className: clsx("position-absolute top-0 bottom-0 start-0 end-0 d-flex justify-content-center align-items-center rounded text-light bg-dark bg-opacity-50", {
|
|
46
|
+
"d-flex d-md-none": index === 0,
|
|
47
|
+
"d-none d-md-flex": index === 2
|
|
48
|
+
}), children: t("editor.preview.moreMedia", {
|
|
49
|
+
mediaCount: medias.length - (index + 1)
|
|
50
|
+
}) })
|
|
51
|
+
] }, media.url)) })
|
|
52
|
+
] });
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
EditorPreview as default
|
|
56
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Editor component properties
|
|
3
|
+
*/
|
|
4
|
+
export interface EditorPreviewSkeletonProps {
|
|
5
|
+
variant?: 'outline' | 'ghost';
|
|
6
|
+
}
|
|
7
|
+
declare const EditorPreview: ({ variant }: EditorPreviewSkeletonProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default EditorPreview;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
|
|
4
|
+
import Image from "../../../../components/Image/Image.js";
|
|
5
|
+
const EditorPreview = ({
|
|
6
|
+
variant = "outline"
|
|
7
|
+
}) => {
|
|
8
|
+
const borderClass = clsx(variant === "outline" && "border rounded-3"), contentClass = clsx("mt-16", variant === "outline" && "my-12 mx-16");
|
|
9
|
+
return /* @__PURE__ */ jsx("div", { className: borderClass, "data-testid": "editor-preview", children: /* @__PURE__ */ jsxs("div", { className: contentClass, children: [
|
|
10
|
+
/* @__PURE__ */ jsx(TextSkeleton, { className: "col-12" }),
|
|
11
|
+
/* @__PURE__ */ jsx(TextSkeleton, { className: "col-12" }),
|
|
12
|
+
/* @__PURE__ */ jsxs("div", { className: "d-flex justify-content-center gap-24 px-32 pt-16", children: [
|
|
13
|
+
/* @__PURE__ */ jsx("div", { style: {
|
|
14
|
+
maxWidth: "150px"
|
|
15
|
+
}, className: "col-12 col-md-4", children: /* @__PURE__ */ jsx(Image, { alt: "", objectFit: "cover", ratio: "16", className: "rounded placeholder", src: "", sizes: "" }) }),
|
|
16
|
+
/* @__PURE__ */ jsx("div", { style: {
|
|
17
|
+
maxWidth: "150px"
|
|
18
|
+
}, className: "col-12 col-md-4", children: /* @__PURE__ */ jsx(Image, { alt: "", objectFit: "cover", ratio: "16", className: "rounded placeholder", src: "", sizes: "" }) })
|
|
19
|
+
] })
|
|
20
|
+
] }) });
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
EditorPreview as default
|
|
24
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export * from './Editor';
|
|
2
2
|
export { default as Editor } from './Editor';
|
|
3
|
+
export { default as EditorPreview } from './EditorPreview';
|
|
4
|
+
export { default as EditorPreviewSkeleton } from './EditorPreviewSkeleton';
|
|
3
5
|
export { default as EditorSkeleton } from './EditorSkeleton';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
interface SVGRProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
titleId?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const SvgIconClockAlert: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default SvgIconClockAlert;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
const SvgIconClockAlert = ({
|
|
3
|
+
title,
|
|
4
|
+
titleId,
|
|
5
|
+
...props
|
|
6
|
+
}) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
|
|
7
|
+
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
8
|
+
/* @__PURE__ */ jsxs("g", { fill: "currentColor", clipPath: "url(#icon-clock-alert_svg__a)", children: [
|
|
9
|
+
/* @__PURE__ */ jsx("path", { d: "M0 10.075C0 4.51 4.51 0 10.075 0c4.573 0 8.431 3.046 9.663 7.217a1 1 0 0 1-1.918.566A8.075 8.075 0 1 0 7.783 17.82a1 1 0 0 1-.566 1.918C3.046 18.506 0 14.648 0 10.075" }),
|
|
10
|
+
/* @__PURE__ */ jsx("path", { d: "M10.075 4.108a1 1 0 0 1 1 1v5.43a1 1 0 0 1-.357.767L7.83 13.728a1 1 0 1 1-1.286-1.532l2.53-2.123V5.108a1 1 0 0 1 1-1M17 13.3a1 1 0 0 1 1 1v2.2a1 1 0 1 1-2 0v-2.2a1 1 0 0 1 1-1M17 18.4a1 1 0 1 0 0 2h.006a1 1 0 1 0 0-2z" }),
|
|
11
|
+
/* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M17 10a7 7 0 1 0 0 14 7 7 0 0 0 0-14m-5 7a5 5 0 1 1 10 0 5 5 0 0 1-10 0", clipRule: "evenodd" })
|
|
12
|
+
] }),
|
|
13
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "icon-clock-alert_svg__a", children: /* @__PURE__ */ jsx("path", { fill: "#fff", d: "M0 0h24v24H0z" }) }) })
|
|
14
|
+
] });
|
|
15
|
+
export {
|
|
16
|
+
SvgIconClockAlert as default
|
|
17
|
+
};
|
|
@@ -24,6 +24,7 @@ export { default as IconCantoo } from './IconCantoo';
|
|
|
24
24
|
export { default as IconCenter } from './IconCenter';
|
|
25
25
|
export { default as IconCheck } from './IconCheck';
|
|
26
26
|
export { default as IconChecklist } from './IconChecklist';
|
|
27
|
+
export { default as IconClockAlert } from './IconClockAlert';
|
|
27
28
|
export { default as IconClock } from './IconClock';
|
|
28
29
|
export { default as IconCloseFullScreen } from './IconCloseFullScreen';
|
|
29
30
|
export { default as IconClose } from './IconClose';
|
|
@@ -4,5 +4,5 @@ export declare const ShareBookmark: ({ bookmark, refBookmark, onBookmarkChange,
|
|
|
4
4
|
bookmark: BookmarkProps;
|
|
5
5
|
refBookmark: Ref<HTMLInputElement>;
|
|
6
6
|
onBookmarkChange: () => void;
|
|
7
|
-
onSave: () => void
|
|
7
|
+
onSave: () => Promise<void>;
|
|
8
8
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
2
3
|
import { useTranslation } from "react-i18next";
|
|
3
4
|
import SvgIconSave from "../../icons/components/IconSave.js";
|
|
4
5
|
import FormControl from "../../../components/Form/FormControl.js";
|
|
@@ -11,10 +12,12 @@ const ShareBookmark = ({
|
|
|
11
12
|
}) => {
|
|
12
13
|
const {
|
|
13
14
|
t
|
|
14
|
-
} = useTranslation()
|
|
15
|
+
} = useTranslation(), [isSaving, setIsSaving] = useState(!1), handleSaveClick = async () => {
|
|
16
|
+
setIsSaving(!0), await onSave(), setIsSaving(!1);
|
|
17
|
+
};
|
|
15
18
|
return /* @__PURE__ */ jsx("div", { className: "mt-16", children: /* @__PURE__ */ jsxs(FormControl, { id: "bookmarkName", className: "d-flex flex-wrap align-items-center gap-16", children: [
|
|
16
19
|
/* @__PURE__ */ jsx("div", { className: "flex-fill", children: /* @__PURE__ */ jsx(FormControl.Input, { ref: refBookmark, onChange: onBookmarkChange, placeholder: t("explorer.modal.share.sharebookmark.placeholder"), size: "sm", type: "text" }, bookmark.id) }),
|
|
17
|
-
/* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "ghost", disabled: bookmark.name.length === 0, leftIcon: /* @__PURE__ */ jsx(SvgIconSave, {}), onClick:
|
|
20
|
+
/* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "ghost", disabled: bookmark.name.length === 0 || isSaving, leftIcon: /* @__PURE__ */ jsx(SvgIconSave, {}), onClick: handleSaveClick, className: "text-nowrap", isLoading: isSaving, children: t("explorer.modal.share.sharebookmark.save") })
|
|
18
21
|
] }) });
|
|
19
22
|
};
|
|
20
23
|
export {
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { UseMutationResult } from '../../../node_modules/@tanstack/react-query';
|
|
4
|
-
export type ShareOptions = {
|
|
5
|
-
resourceId: ID;
|
|
6
|
-
resourceRights: RightStringified[];
|
|
7
|
-
resourceCreatorId: string;
|
|
8
|
-
};
|
|
9
|
-
export type ShareResourceMutation = UseMutationResult<PutShareResponse, unknown, {
|
|
10
|
-
resourceId: string;
|
|
11
|
-
rights: ShareRight[];
|
|
12
|
-
}, unknown>;
|
|
2
|
+
import { ShareOptions, ShareResourceMutation } from './ShareResources';
|
|
13
3
|
interface ShareResourceModalProps {
|
|
14
4
|
/** Handle open/close state */
|
|
15
5
|
isOpen: boolean;
|