@edifice.io/react 2.3.2-develop-integration.20251007155128 → 2.3.2-develop-b2school-actualites.20251008121205
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/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 +0 -2
- package/dist/icons.js +294 -292
- package/dist/index.js +76 -76
- package/dist/modules/comments/components/Comment.js +1 -1
- package/dist/modules/comments/constants.d.ts +0 -1
- package/dist/modules/comments/constants.js +1 -2
- package/dist/modules/comments/provider/CommentProvider.js +1 -2
- package/dist/modules/comments/types.d.ts +0 -4
- 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/ResourceModal/ResourceModal.d.ts +0 -1
- package/dist/modules/modals/ResourceModal/ResourceModal.js +2 -8
- package/package.json +6 -6
- package/dist/hooks/useIsAdmc/index.d.ts +0 -1
- package/dist/hooks/useIsAdmc/useIsAdmc.d.ts +0 -3
- package/dist/hooks/useIsAdmc/useIsAdmc.js +0 -22
- package/dist/hooks/useIsAdmlcOrAdmc/index.d.ts +0 -1
- package/dist/hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.d.ts +0 -3
- package/dist/hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.js +0 -16
package/dist/index.js
CHANGED
|
@@ -63,51 +63,51 @@ import { default as default62 } from "./hooks/useHover/useHover.js";
|
|
|
63
63
|
import { default as default63 } from "./hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
64
64
|
import { default as default64 } from "./hooks/useImage/useImage.js";
|
|
65
65
|
import { default as default65 } from "./hooks/useIsAdml/useIsAdml.js";
|
|
66
|
-
import { default as default66 } from "./hooks/
|
|
67
|
-
import { default as default67 } from "./hooks/
|
|
68
|
-
import { default as default68 } from "./hooks/
|
|
69
|
-
import { default as default69 } from "./hooks/
|
|
70
|
-
import { default as default70 } from "./hooks/
|
|
71
|
-
import { default as default71 } from "./hooks/
|
|
72
|
-
import { default as default72 } from "./hooks/
|
|
73
|
-
import { default as default73 } from "./hooks/
|
|
74
|
-
import { default as default74 } from "./hooks/
|
|
75
|
-
import { default as default75 } from "./hooks/
|
|
76
|
-
import { default as default76 } from "./hooks/
|
|
77
|
-
import { default as default77 } from "./hooks/
|
|
78
|
-
import { default as default78 } from "./hooks/
|
|
79
|
-
import { default as default79 } from "./hooks/
|
|
80
|
-
import { default as default80 } from "./hooks/
|
|
81
|
-
import { default as default81 } from "./hooks/
|
|
82
|
-
import {
|
|
83
|
-
import { default as default83 } from "./hooks/
|
|
84
|
-
import { default as default84 } from "./
|
|
85
|
-
import { default as default85 } from "./
|
|
86
|
-
import { default as default86 } from "./modules/modals/
|
|
87
|
-
import { default as default87 } from "./modules/modals/
|
|
88
|
-
import { default as default88 } from "./modules/modals/
|
|
89
|
-
import { default as default89 } from "./modules/modals/
|
|
90
|
-
import { default as default90 } from "./modules/modals/
|
|
91
|
-
import { default as default91 } from "./modules/modals/ShareModal/
|
|
92
|
-
import { default as default92 } from "./modules/
|
|
93
|
-
import { default as default93 } from "./modules/
|
|
94
|
-
import { default as default94 } from "./modules/multimedia/
|
|
95
|
-
import { default as default95 } from "./modules/multimedia/
|
|
96
|
-
import { default as default96 } from "./modules/multimedia/
|
|
97
|
-
import { default as default97 } from "./modules/multimedia/
|
|
98
|
-
import { default as default98 } from "./modules/multimedia/
|
|
99
|
-
import { default as default99 } from "./modules/multimedia/
|
|
100
|
-
import { default as default100 } from "./modules/multimedia/
|
|
101
|
-
import { default as default101 } from "./modules/multimedia/
|
|
102
|
-
import { default as default102 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
103
|
-
import { default as default103 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
66
|
+
import { default as default66 } from "./hooks/useKeyPress/useKeyPress.js";
|
|
67
|
+
import { default as default67 } from "./hooks/useLibraryUrl/useLibraryUrl.js";
|
|
68
|
+
import { default as default68 } from "./hooks/useMediaLibrary/useMediaLibrary.js";
|
|
69
|
+
import { default as default69 } from "./hooks/useScrollToTop/useScrollToTop.js";
|
|
70
|
+
import { default as default70 } from "./hooks/useTitle/useTitle.js";
|
|
71
|
+
import { default as default71 } from "./hooks/useToast/useToast.js";
|
|
72
|
+
import { default as default72 } from "./hooks/useToggle/useToggle.js";
|
|
73
|
+
import { default as default73 } from "./hooks/useTrapFocus/useTrapFocus.js";
|
|
74
|
+
import { default as default74 } from "./hooks/useTrashedResource/useTrashedResource.js";
|
|
75
|
+
import { default as default75 } from "./hooks/useUpload/useUpload.js";
|
|
76
|
+
import { default as default76 } from "./hooks/useUploadFiles/useUploadFiles.js";
|
|
77
|
+
import { default as default77 } from "./hooks/useUser/useUser.js";
|
|
78
|
+
import { default as default78 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
|
|
79
|
+
import { default as default79 } from "./hooks/useWorkspaceFolders/useWorkspaceFolders.js";
|
|
80
|
+
import { WORKSPACE_SHARED_FOLDER_ID, WORKSPACE_USER_FOLDER_ID, default as default80 } from "./hooks/useWorkspaceFolders/useWorkspaceFoldersTree.js";
|
|
81
|
+
import { default as default81 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
82
|
+
import { default as default82 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
|
|
83
|
+
import { default as default83 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
84
|
+
import { default as default84 } from "./modules/modals/ConfirmModal/ConfirmModal.js";
|
|
85
|
+
import { default as default85 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
|
|
86
|
+
import { default as default86 } from "./modules/modals/PublishModal/PublishModal.js";
|
|
87
|
+
import { default as default87 } from "./modules/modals/ResourceModal/apps/BlogPublic.js";
|
|
88
|
+
import { default as default88 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
89
|
+
import { default as default89 } from "./modules/modals/ShareModal/ShareModal.js";
|
|
90
|
+
import { default as default90 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
|
|
91
|
+
import { default as default91 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
92
|
+
import { default as default92 } from "./modules/multimedia/AudioRecorder/AudioRecorder.js";
|
|
93
|
+
import { default as default93 } from "./modules/multimedia/Embed/Embed.js";
|
|
94
|
+
import { default as default94 } from "./modules/multimedia/ImageEditor/components/ImageEditor.js";
|
|
95
|
+
import { default as default95 } from "./modules/multimedia/ImagePicker/ImagePicker.js";
|
|
96
|
+
import { default as default96 } from "./modules/multimedia/FileCard/FileCard.js";
|
|
97
|
+
import { default as default97 } from "./modules/multimedia/MediaLibrary/MediaLibrary.js";
|
|
98
|
+
import { default as default98 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
|
|
99
|
+
import { default as default99 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
|
|
100
|
+
import { default as default100 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
101
|
+
import { default as default101 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
104
102
|
import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
|
|
103
|
+
import { Divider } from "./components/Divider/Divider.js";
|
|
105
104
|
import { DropzoneContext, useDropzoneContext } from "./components/Dropzone/DropzoneContext.js";
|
|
106
105
|
import { Column, Grid } from "./components/Grid/Grid.js";
|
|
107
106
|
import { Layout } from "./components/Layout/Layout.js";
|
|
108
107
|
import { List } from "./components/List/List.js";
|
|
109
108
|
import { Menu } from "./components/Menu/components/Menu.js";
|
|
110
109
|
import { Popover, PopoverBody, PopoverFooter, PopoverHeader } from "./components/Popover/Popover.js";
|
|
110
|
+
import { SeparatedInfo } from "./components/SeparatedInfo/SeparatedInfo.js";
|
|
111
111
|
import { Tabs } from "./components/Tabs/components/Tabs.js";
|
|
112
112
|
import { Toolbar } from "./components/Toolbar/Toolbar.js";
|
|
113
113
|
import { useTreeSortable } from "./components/Tree/hooks/useTreeSortable.js";
|
|
@@ -136,11 +136,11 @@ export {
|
|
|
136
136
|
default4 as AppHeader,
|
|
137
137
|
default5 as AppIcon,
|
|
138
138
|
default6 as Attachment,
|
|
139
|
-
|
|
139
|
+
default92 as AudioRecorder,
|
|
140
140
|
default7 as Avatar,
|
|
141
141
|
default8 as AvatarGroup,
|
|
142
142
|
default9 as Badge,
|
|
143
|
-
|
|
143
|
+
default87 as BlogPublic,
|
|
144
144
|
default10 as Breadcrumb,
|
|
145
145
|
default11 as Button,
|
|
146
146
|
default37 as ButtonSkeleton,
|
|
@@ -150,8 +150,9 @@ export {
|
|
|
150
150
|
default17 as ColorPickerItem,
|
|
151
151
|
Column,
|
|
152
152
|
default18 as Combobox,
|
|
153
|
-
|
|
153
|
+
default84 as ConfirmModal,
|
|
154
154
|
DefaultPalette,
|
|
155
|
+
Divider,
|
|
155
156
|
DndTree,
|
|
156
157
|
default19 as Dropdown,
|
|
157
158
|
default20 as Dropzone,
|
|
@@ -160,10 +161,10 @@ export {
|
|
|
160
161
|
EdificeClientProvider,
|
|
161
162
|
EdificeThemeContext,
|
|
162
163
|
EdificeThemeProvider,
|
|
163
|
-
|
|
164
|
+
default93 as Embed,
|
|
164
165
|
default21 as EmptyScreen,
|
|
165
166
|
ExternalLinker,
|
|
166
|
-
|
|
167
|
+
default96 as FileCard,
|
|
167
168
|
default22 as Flex,
|
|
168
169
|
default24 as FormControl,
|
|
169
170
|
default23 as FormText,
|
|
@@ -171,8 +172,8 @@ export {
|
|
|
171
172
|
default25 as Heading,
|
|
172
173
|
default12 as IconButton,
|
|
173
174
|
default26 as Image,
|
|
174
|
-
|
|
175
|
-
|
|
175
|
+
default94 as ImageEditor,
|
|
176
|
+
default95 as ImagePicker,
|
|
176
177
|
default27 as Input,
|
|
177
178
|
InternalLinker,
|
|
178
179
|
default28 as Label,
|
|
@@ -181,24 +182,25 @@ export {
|
|
|
181
182
|
default29 as Loading,
|
|
182
183
|
default30 as LoadingScreen,
|
|
183
184
|
default31 as Logo,
|
|
184
|
-
|
|
185
|
+
default97 as MediaLibrary,
|
|
185
186
|
Menu,
|
|
186
187
|
MockedProvider,
|
|
187
188
|
default32 as Modal,
|
|
188
|
-
|
|
189
|
+
default85 as OnboardingModal,
|
|
189
190
|
Popover,
|
|
190
191
|
PopoverBody,
|
|
191
192
|
PopoverFooter,
|
|
192
193
|
PopoverHeader,
|
|
193
194
|
default33 as PreventPropagation,
|
|
194
|
-
|
|
195
|
+
default86 as PublishModal,
|
|
195
196
|
default34 as Radio,
|
|
196
197
|
ResourceModal,
|
|
197
198
|
default35 as SearchBar,
|
|
198
199
|
default13 as SearchButton,
|
|
199
200
|
default36 as Select,
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
SeparatedInfo,
|
|
202
|
+
default90 as ShareBlog,
|
|
203
|
+
default89 as ShareModal,
|
|
202
204
|
default45 as SortableTree,
|
|
203
205
|
default39 as StackedGroup,
|
|
204
206
|
default40 as Stepper,
|
|
@@ -213,13 +215,13 @@ export {
|
|
|
213
215
|
TreeNode,
|
|
214
216
|
TreeNodeFolderWrapper,
|
|
215
217
|
default47 as TreeView,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
+
default98 as VideoEmbed,
|
|
219
|
+
default99 as VideoRecorder,
|
|
218
220
|
default48 as VisuallyHidden,
|
|
219
221
|
WORKSPACE_SHARED_FOLDER_ID,
|
|
220
222
|
WORKSPACE_USER_FOLDER_ID,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
+
default100 as Workspace,
|
|
224
|
+
default101 as WorkspaceFolders,
|
|
223
225
|
addNode,
|
|
224
226
|
arrayUnique,
|
|
225
227
|
buildTree,
|
|
@@ -267,30 +269,28 @@ export {
|
|
|
267
269
|
default62 as useHover,
|
|
268
270
|
default63 as useHttpErrorToast,
|
|
269
271
|
default64 as useImage,
|
|
270
|
-
default66 as useIsAdmc,
|
|
271
272
|
default65 as useIsAdml,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
default76 as useTrashedResource,
|
|
273
|
+
default66 as useKeyPress,
|
|
274
|
+
default67 as useLibraryUrl,
|
|
275
|
+
default68 as useMediaLibrary,
|
|
276
|
+
default69 as useScrollToTop,
|
|
277
|
+
default91 as useShareMutation,
|
|
278
|
+
default70 as useTitle,
|
|
279
|
+
default71 as useToast,
|
|
280
|
+
default72 as useToggle,
|
|
281
|
+
default73 as useTrapFocus,
|
|
282
|
+
default74 as useTrashedResource,
|
|
283
283
|
useTreeSortable,
|
|
284
284
|
useTreeView,
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
285
|
+
default88 as useUpdateMutation,
|
|
286
|
+
default75 as useUpload,
|
|
287
|
+
default76 as useUploadFiles,
|
|
288
|
+
default77 as useUser,
|
|
289
|
+
default78 as useWorkspaceFile,
|
|
290
|
+
default79 as useWorkspaceFolders,
|
|
291
|
+
default80 as useWorkspaceFoldersTree,
|
|
292
|
+
default81 as useWorkspaceSearch,
|
|
293
|
+
default82 as useXitiTrackPageLoad,
|
|
294
|
+
default83 as useZendeskGuide,
|
|
295
295
|
wrapTreeNode
|
|
296
296
|
};
|
|
@@ -71,7 +71,7 @@ const DeleteModal = /* @__PURE__ */ lazy(() => import("./DeleteModal.js")), Comm
|
|
|
71
71
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
72
72
|
/* @__PURE__ */ jsx("div", { className: "mt-8 mb-4", children: content }),
|
|
73
73
|
type === "edit" && /* @__PURE__ */ jsxs("div", { className: "ms-n8", children: [
|
|
74
|
-
!replyTo &&
|
|
74
|
+
!replyTo && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => handleReplyToComment(comment.id), children: t("comment.reply") }),
|
|
75
75
|
userId === authorId && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => {
|
|
76
76
|
handleModifyComment(comment.id), setValue(content);
|
|
77
77
|
}, children: t("comment.edit") }),
|
|
@@ -1,8 +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, 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;
|
|
2
2
|
export {
|
|
3
3
|
DEFAULT_ADD_COMMENTS,
|
|
4
4
|
DEFAULT_ADD_REPLIES,
|
|
5
|
-
DEFAULT_ALLOW_REPLIES,
|
|
6
5
|
DEFAULT_MAX_COMMENTS,
|
|
7
6
|
DEFAULT_MAX_COMMENT_LENGTH,
|
|
8
7
|
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 {
|
|
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";
|
|
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,7 +20,6 @@ const CommentProvider = ({
|
|
|
20
20
|
additionalComments: DEFAULT_ADD_COMMENTS,
|
|
21
21
|
maxReplies: DEFAULT_MAX_REPLIES,
|
|
22
22
|
additionalReplies: DEFAULT_ADD_REPLIES,
|
|
23
|
-
allowReplies: DEFAULT_ALLOW_REPLIES,
|
|
24
23
|
...commentOptions
|
|
25
24
|
}, {
|
|
26
25
|
type
|
|
@@ -104,10 +104,6 @@ export type CommentOptions = {
|
|
|
104
104
|
* Number of replies to load additionally in the limited list
|
|
105
105
|
*/
|
|
106
106
|
additionalReplies: number;
|
|
107
|
-
/**
|
|
108
|
-
* Allow replying to comments
|
|
109
|
-
*/
|
|
110
|
-
allowReplies: boolean;
|
|
111
107
|
};
|
|
112
108
|
export interface UserProfileResult {
|
|
113
109
|
/**
|
|
@@ -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", children: summaryContent }),
|
|
39
|
+
/* @__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 ", {
|
|
40
|
+
"d-none d-md-block": index >= 1
|
|
41
|
+
}), style: {
|
|
42
|
+
maxWidth: "150px"
|
|
43
|
+
}, children: [
|
|
44
|
+
/* @__PURE__ */ jsx(Image, { alt: media.alt, objectFit: "cover", ratio: "16", className: "rounded", 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';
|
|
@@ -54,8 +54,7 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
54
54
|
description: isUpdating ? resource == null ? void 0 : resource.description : "",
|
|
55
55
|
enablePublic: isUpdating ? resource == null ? void 0 : resource.public : !1,
|
|
56
56
|
title: isUpdating ? resource == null ? void 0 : resource.name : "",
|
|
57
|
-
formSlug: isUpdating ? resource == null ? void 0 : resource.slug : ""
|
|
58
|
-
allowReplies: isUpdating ? resource == null ? void 0 : resource.allowReplies : !0
|
|
57
|
+
formSlug: isUpdating ? resource == null ? void 0 : resource.slug : ""
|
|
59
58
|
}
|
|
60
59
|
}), {
|
|
61
60
|
ref: mediaLibraryRef,
|
|
@@ -76,8 +75,7 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
76
75
|
name: formData.title,
|
|
77
76
|
public: formData.enablePublic,
|
|
78
77
|
slug: formData.enablePublic && formData.formSlug || "",
|
|
79
|
-
thumbnail
|
|
80
|
-
allowReplies: formData.allowReplies
|
|
78
|
+
thumbnail
|
|
81
79
|
};
|
|
82
80
|
let result, param;
|
|
83
81
|
if (isCreating) {
|
|
@@ -143,10 +141,6 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
143
141
|
maxLength: textareaMaxLength
|
|
144
142
|
}), placeholder: ((_f = customT.placeholder) == null ? void 0 : _f.description) ?? t("explorer.resource.editModal.description.placeholder"), size: "md", maxLength: textareaMaxLength }),
|
|
145
143
|
watchedDescription && /* @__PURE__ */ jsx(TextareaCounter, { content: watchedDescription, maxLength: textareaMaxLength })
|
|
146
|
-
] }),
|
|
147
|
-
application === "blog" && /* @__PURE__ */ jsxs(FormControl, { id: "allowReplies", className: "d-flex gap-8 mt-16 mb-8", children: [
|
|
148
|
-
/* @__PURE__ */ jsx(FormControl.Input, { type: "checkbox", defaultChecked: isUpdating ? resource.allowReplies : !0, ...register("allowReplies"), className: "form-check-input mt-0", size: "sm" }),
|
|
149
|
-
/* @__PURE__ */ jsx(FormControl.Label, { className: "form-check-label mb-0", children: "Autoriser les réponses aux commentaires" })
|
|
150
144
|
] })
|
|
151
145
|
] })
|
|
152
146
|
] }),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.3.2-develop-
|
|
3
|
+
"version": "2.3.2-develop-b2school-actualites.20251008121205",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -131,9 +131,9 @@
|
|
|
131
131
|
"react-slugify": "^3.0.3",
|
|
132
132
|
"swiper": "^10.1.0",
|
|
133
133
|
"ua-parser-js": "^1.0.36",
|
|
134
|
-
"@edifice.io/bootstrap": "2.3.2-develop-
|
|
135
|
-
"@edifice.io/tiptap-extensions": "2.3.2-develop-
|
|
136
|
-
"@edifice.io/utilities": "2.3.2-develop-
|
|
134
|
+
"@edifice.io/bootstrap": "2.3.2-develop-b2school-actualites.20251008121205",
|
|
135
|
+
"@edifice.io/tiptap-extensions": "2.3.2-develop-b2school-actualites.20251008121205",
|
|
136
|
+
"@edifice.io/utilities": "2.3.2-develop-b2school-actualites.20251008121205"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
139
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -164,8 +164,8 @@
|
|
|
164
164
|
"vite": "^5.4.11",
|
|
165
165
|
"vite-plugin-dts": "^4.1.0",
|
|
166
166
|
"vite-tsconfig-paths": "^5.0.1",
|
|
167
|
-
"@edifice.io/client": "2.3.2-develop-
|
|
168
|
-
"@edifice.io/config": "2.3.2-develop-
|
|
167
|
+
"@edifice.io/client": "2.3.2-develop-b2school-actualites.20251008121205",
|
|
168
|
+
"@edifice.io/config": "2.3.2-develop-b2school-actualites.20251008121205"
|
|
169
169
|
},
|
|
170
170
|
"peerDependencies": {
|
|
171
171
|
"@react-spring/web": "^9.7.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as useIsAdmc } from './useIsAdmc';
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useCallback } from "react";
|
|
2
|
-
import { odeServices } from "@edifice.io/client";
|
|
3
|
-
function useIsAdmc() {
|
|
4
|
-
const [isAdmc, setIsAdmc] = useState(!1);
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
initIsAdmc();
|
|
7
|
-
}, []);
|
|
8
|
-
const initIsAdmc = useCallback(async () => {
|
|
9
|
-
try {
|
|
10
|
-
const user = await odeServices.session().getUser(), hasSuperAdmin = !!(user != null && user.functions && user.functions.SUPER_ADMIN);
|
|
11
|
-
setIsAdmc(!!hasSuperAdmin);
|
|
12
|
-
} catch {
|
|
13
|
-
setIsAdmc(!1);
|
|
14
|
-
}
|
|
15
|
-
}, []);
|
|
16
|
-
return {
|
|
17
|
-
isAdmc
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
useIsAdmc as default
|
|
22
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as useIsAdmlcOrAdmc } from './useIsAdmlcOrAdmc';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import useIsAdml from "../useIsAdml/useIsAdml.js";
|
|
3
|
-
import useIsAdmc from "../useIsAdmc/useIsAdmc.js";
|
|
4
|
-
function useIsAdmlcOrAdmc() {
|
|
5
|
-
const {
|
|
6
|
-
isAdml
|
|
7
|
-
} = useIsAdml(), {
|
|
8
|
-
isAdmc
|
|
9
|
-
} = useIsAdmc();
|
|
10
|
-
return {
|
|
11
|
-
isAdmlcOrAdmc: useMemo(() => !!(isAdml || isAdmc), [isAdml, isAdmc])
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
useIsAdmlcOrAdmc as default
|
|
16
|
-
};
|