@edifice.io/react 2.3.2-develop-b2school-actualites.20251008140719 → 2.3.2-develop-b2school.20251010100849

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.
Files changed (32) hide show
  1. package/dist/components/AppIcon/index.d.ts +0 -1
  2. package/dist/components/Flex/Flex.js +1 -1
  3. package/dist/components/Select/Select.js +2 -2
  4. package/dist/components/index.d.ts +0 -2
  5. package/dist/editor.js +36 -40
  6. package/dist/hooks/index.d.ts +2 -0
  7. package/dist/hooks/useHttpErrorToast/useHttpErrorToast.d.ts +3 -1
  8. package/dist/hooks/useHttpErrorToast/useHttpErrorToast.js +25 -19
  9. package/dist/hooks/useIsAdmc/index.d.ts +1 -0
  10. package/dist/hooks/useIsAdmc/useIsAdmc.d.ts +3 -0
  11. package/dist/hooks/useIsAdmc/useIsAdmc.js +22 -0
  12. package/dist/hooks/useIsAdmlcOrAdmc/index.d.ts +1 -0
  13. package/dist/hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.d.ts +3 -0
  14. package/dist/hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.js +16 -0
  15. package/dist/icons.js +292 -294
  16. package/dist/index.js +82 -82
  17. package/dist/modules/editor/components/Editor/index.d.ts +0 -2
  18. package/dist/modules/icons/components/index.d.ts +0 -1
  19. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +8 -5
  20. package/package.json +6 -6
  21. package/dist/components/Divider/Divider.d.ts +0 -5
  22. package/dist/components/Divider/Divider.js +0 -21
  23. package/dist/components/Divider/index.d.ts +0 -1
  24. package/dist/components/SeparatedInfo/SeparatedInfo.d.ts +0 -6
  25. package/dist/components/SeparatedInfo/SeparatedInfo.js +0 -13
  26. package/dist/components/SeparatedInfo/index.d.ts +0 -1
  27. package/dist/modules/editor/components/Editor/EditorPreview.d.ts +0 -14
  28. package/dist/modules/editor/components/Editor/EditorPreview.js +0 -56
  29. package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.d.ts +0 -8
  30. package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.js +0 -24
  31. package/dist/modules/icons/components/IconClockAlert.d.ts +0 -7
  32. package/dist/modules/icons/components/IconClockAlert.js +0 -17
package/dist/index.js CHANGED
@@ -60,54 +60,54 @@ import { default as default59 } from "./hooks/useDropzone/useDropzone.js";
60
60
  import { default as default60 } from "./hooks/useEdificeIcons/useEdificeIcons.js";
61
61
  import { default as default61 } from "./hooks/useHasWorkflow/useHasWorkflow.js";
62
62
  import { default as default62 } from "./hooks/useHover/useHover.js";
63
- import { default as default63 } from "./hooks/useHttpErrorToast/useHttpErrorToast.js";
64
- import { default as default64 } from "./hooks/useImage/useImage.js";
65
- import { default as default65 } from "./hooks/useIsAdml/useIsAdml.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";
63
+ import { useHttpErrorToast } from "./hooks/useHttpErrorToast/useHttpErrorToast.js";
64
+ import { default as default63 } from "./hooks/useImage/useImage.js";
65
+ import { default as default64 } from "./hooks/useIsAdml/useIsAdml.js";
66
+ import { default as default65 } from "./hooks/useIsAdmc/useIsAdmc.js";
67
+ import { default as default66 } from "./hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.js";
68
+ import { default as default67 } from "./hooks/useKeyPress/useKeyPress.js";
69
+ import { default as default68 } from "./hooks/useLibraryUrl/useLibraryUrl.js";
70
+ import { default as default69 } from "./hooks/useMediaLibrary/useMediaLibrary.js";
71
+ import { default as default70 } from "./hooks/useScrollToTop/useScrollToTop.js";
72
+ import { default as default71 } from "./hooks/useTitle/useTitle.js";
73
+ import { default as default72 } from "./hooks/useToast/useToast.js";
74
+ import { default as default73 } from "./hooks/useToggle/useToggle.js";
75
+ import { default as default74 } from "./hooks/useTrapFocus/useTrapFocus.js";
76
+ import { default as default75 } from "./hooks/useTrashedResource/useTrashedResource.js";
77
+ import { default as default76 } from "./hooks/useUpload/useUpload.js";
78
+ import { default as default77 } from "./hooks/useUploadFiles/useUploadFiles.js";
79
+ import { default as default78 } from "./hooks/useUser/useUser.js";
80
+ import { default as default79 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
81
+ import { default as default80 } from "./hooks/useWorkspaceFolders/useWorkspaceFolders.js";
82
+ import { WORKSPACE_SHARED_FOLDER_ID, WORKSPACE_USER_FOLDER_ID, default as default81 } from "./hooks/useWorkspaceFolders/useWorkspaceFoldersTree.js";
83
+ import { default as default82 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
84
+ import { default as default83 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
85
+ import { default as default84 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
86
+ import { default as default85 } from "./modules/modals/ConfirmModal/ConfirmModal.js";
87
+ import { default as default86 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
88
+ import { default as default87 } from "./modules/modals/PublishModal/PublishModal.js";
89
+ import { default as default88 } from "./modules/modals/ResourceModal/apps/BlogPublic.js";
90
+ import { default as default89 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
91
+ import { default as default90 } from "./modules/modals/ShareModal/ShareModal.js";
92
+ import { default as default91 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
93
+ import { default as default92 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
94
+ import { default as default93 } from "./modules/multimedia/AudioRecorder/AudioRecorder.js";
95
+ import { default as default94 } from "./modules/multimedia/Embed/Embed.js";
96
+ import { default as default95 } from "./modules/multimedia/ImageEditor/components/ImageEditor.js";
97
+ import { default as default96 } from "./modules/multimedia/ImagePicker/ImagePicker.js";
98
+ import { default as default97 } from "./modules/multimedia/FileCard/FileCard.js";
99
+ import { default as default98 } from "./modules/multimedia/MediaLibrary/MediaLibrary.js";
100
+ import { default as default99 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
101
+ import { default as default100 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
102
+ import { default as default101 } from "./modules/multimedia/Workspace/Workspace.js";
103
+ import { default as default102 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
102
104
  import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
103
- import { Divider } from "./components/Divider/Divider.js";
104
105
  import { DropzoneContext, useDropzoneContext } from "./components/Dropzone/DropzoneContext.js";
105
106
  import { Column, Grid } from "./components/Grid/Grid.js";
106
107
  import { Layout } from "./components/Layout/Layout.js";
107
108
  import { List } from "./components/List/List.js";
108
109
  import { Menu } from "./components/Menu/components/Menu.js";
109
110
  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
- default92 as AudioRecorder,
139
+ default93 as AudioRecorder,
140
140
  default7 as Avatar,
141
141
  default8 as AvatarGroup,
142
142
  default9 as Badge,
143
- default87 as BlogPublic,
143
+ default88 as BlogPublic,
144
144
  default10 as Breadcrumb,
145
145
  default11 as Button,
146
146
  default37 as ButtonSkeleton,
@@ -150,9 +150,8 @@ export {
150
150
  default17 as ColorPickerItem,
151
151
  Column,
152
152
  default18 as Combobox,
153
- default84 as ConfirmModal,
153
+ default85 as ConfirmModal,
154
154
  DefaultPalette,
155
- Divider,
156
155
  DndTree,
157
156
  default19 as Dropdown,
158
157
  default20 as Dropzone,
@@ -161,10 +160,10 @@ export {
161
160
  EdificeClientProvider,
162
161
  EdificeThemeContext,
163
162
  EdificeThemeProvider,
164
- default93 as Embed,
163
+ default94 as Embed,
165
164
  default21 as EmptyScreen,
166
165
  ExternalLinker,
167
- default96 as FileCard,
166
+ default97 as FileCard,
168
167
  default22 as Flex,
169
168
  default24 as FormControl,
170
169
  default23 as FormText,
@@ -172,8 +171,8 @@ export {
172
171
  default25 as Heading,
173
172
  default12 as IconButton,
174
173
  default26 as Image,
175
- default94 as ImageEditor,
176
- default95 as ImagePicker,
174
+ default95 as ImageEditor,
175
+ default96 as ImagePicker,
177
176
  default27 as Input,
178
177
  InternalLinker,
179
178
  default28 as Label,
@@ -182,25 +181,24 @@ export {
182
181
  default29 as Loading,
183
182
  default30 as LoadingScreen,
184
183
  default31 as Logo,
185
- default97 as MediaLibrary,
184
+ default98 as MediaLibrary,
186
185
  Menu,
187
186
  MockedProvider,
188
187
  default32 as Modal,
189
- default85 as OnboardingModal,
188
+ default86 as OnboardingModal,
190
189
  Popover,
191
190
  PopoverBody,
192
191
  PopoverFooter,
193
192
  PopoverHeader,
194
193
  default33 as PreventPropagation,
195
- default86 as PublishModal,
194
+ default87 as PublishModal,
196
195
  default34 as Radio,
197
196
  ResourceModal,
198
197
  default35 as SearchBar,
199
198
  default13 as SearchButton,
200
199
  default36 as Select,
201
- SeparatedInfo,
202
- default90 as ShareBlog,
203
- default89 as ShareModal,
200
+ default91 as ShareBlog,
201
+ default90 as ShareModal,
204
202
  default45 as SortableTree,
205
203
  default39 as StackedGroup,
206
204
  default40 as Stepper,
@@ -215,13 +213,13 @@ export {
215
213
  TreeNode,
216
214
  TreeNodeFolderWrapper,
217
215
  default47 as TreeView,
218
- default98 as VideoEmbed,
219
- default99 as VideoRecorder,
216
+ default99 as VideoEmbed,
217
+ default100 as VideoRecorder,
220
218
  default48 as VisuallyHidden,
221
219
  WORKSPACE_SHARED_FOLDER_ID,
222
220
  WORKSPACE_USER_FOLDER_ID,
223
- default100 as Workspace,
224
- default101 as WorkspaceFolders,
221
+ default101 as Workspace,
222
+ default102 as WorkspaceFolders,
225
223
  addNode,
226
224
  arrayUnique,
227
225
  buildTree,
@@ -267,30 +265,32 @@ export {
267
265
  useEdificeTheme,
268
266
  default61 as useHasWorkflow,
269
267
  default62 as useHover,
270
- default63 as useHttpErrorToast,
271
- default64 as useImage,
272
- default65 as useIsAdml,
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,
268
+ useHttpErrorToast,
269
+ default63 as useImage,
270
+ default65 as useIsAdmc,
271
+ default64 as useIsAdml,
272
+ default66 as useIsAdmlcOrAdmc,
273
+ default67 as useKeyPress,
274
+ default68 as useLibraryUrl,
275
+ default69 as useMediaLibrary,
276
+ default70 as useScrollToTop,
277
+ default92 as useShareMutation,
278
+ default71 as useTitle,
279
+ default72 as useToast,
280
+ default73 as useToggle,
281
+ default74 as useTrapFocus,
282
+ default75 as useTrashedResource,
283
283
  useTreeSortable,
284
284
  useTreeView,
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,
285
+ default89 as useUpdateMutation,
286
+ default76 as useUpload,
287
+ default77 as useUploadFiles,
288
+ default78 as useUser,
289
+ default79 as useWorkspaceFile,
290
+ default80 as useWorkspaceFolders,
291
+ default81 as useWorkspaceFoldersTree,
292
+ default82 as useWorkspaceSearch,
293
+ default83 as useXitiTrackPageLoad,
294
+ default84 as useZendeskGuide,
295
295
  wrapTreeNode
296
296
  };
@@ -1,5 +1,3 @@
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';
5
3
  export { default as EditorSkeleton } from './EditorSkeleton';
@@ -24,7 +24,6 @@ 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';
28
27
  export { default as IconClock } from './IconClock';
29
28
  export { default as IconCloseFullScreen } from './IconCloseFullScreen';
30
29
  export { default as IconClose } from './IconClose';
@@ -11,8 +11,8 @@ import SvgIconRecordVideo from "../../icons/components/IconRecordVideo.js";
11
11
  import SvgIconSmartphone from "../../icons/components/IconSmartphone.js";
12
12
  import { InnerTabs } from "./innertabs/index.js";
13
13
  import { MediaLibraryContext } from "./MediaLibraryContext.js";
14
- import useHttpErrorToast from "../../../hooks/useHttpErrorToast/useHttpErrorToast.js";
15
14
  import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
15
+ import { useHttpErrorToast } from "../../../hooks/useHttpErrorToast/useHttpErrorToast.js";
16
16
  import Modal from "../../../components/Modal/Modal.js";
17
17
  import { Tabs } from "../../../components/Tabs/components/Tabs.js";
18
18
  import Button from "../../../components/Button/Button.js";
@@ -78,13 +78,16 @@ const orderedTabs = [
78
78
  showLink,
79
79
  type,
80
80
  ...refModal.current
81
- })), useHttpErrorToast({
81
+ }));
82
+ const {
83
+ t
84
+ } = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"), [type, setType] = useState(null);
85
+ useHttpErrorToast({
86
+ active: !!type,
82
87
  isDismissible: !0,
83
88
  duration: 1 / 0
84
89
  });
85
- const {
86
- t
87
- } = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"), [type, setType] = useState(null), availableTabs = {
90
+ const availableTabs = {
88
91
  workspace: {
89
92
  id: "workspace",
90
93
  icon: /* @__PURE__ */ jsx(SvgIconFolder, {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.3.2-develop-b2school-actualites.20251008140719",
3
+ "version": "2.3.2-develop-b2school.20251010100849",
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-b2school-actualites.20251008140719",
135
- "@edifice.io/tiptap-extensions": "2.3.2-develop-b2school-actualites.20251008140719",
136
- "@edifice.io/utilities": "2.3.2-develop-b2school-actualites.20251008140719"
134
+ "@edifice.io/bootstrap": "2.3.2-develop-b2school.20251010100849",
135
+ "@edifice.io/tiptap-extensions": "2.3.2-develop-b2school.20251010100849",
136
+ "@edifice.io/utilities": "2.3.2-develop-b2school.20251010100849"
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-b2school-actualites.20251008140719",
168
- "@edifice.io/config": "2.3.2-develop-b2school-actualites.20251008140719"
167
+ "@edifice.io/client": "2.3.2-develop-b2school.20251010100849",
168
+ "@edifice.io/config": "2.3.2-develop-b2school.20251010100849"
169
169
  },
170
170
  "peerDependencies": {
171
171
  "@react-spring/web": "^9.7.5",
@@ -1,5 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export declare function Divider({ children, color, }: {
3
- children: ReactNode[];
4
- color: string;
5
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,21 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import Flex from "../Flex/Flex.js";
3
- function Divider({
4
- children,
5
- color = "var(--edifice-gray-400)"
6
- }) {
7
- return /* @__PURE__ */ jsxs(Flex, { align: "center", justify: "around", gap: "16", wrap: "nowrap", className: "flex-fill", children: [
8
- /* @__PURE__ */ jsx("hr", { className: "divider m-12 ms-0 flex-fill", style: {
9
- borderColor: color
10
- } }),
11
- /* @__PURE__ */ jsxs(Flex, { gap: "12", align: "center", justify: "around", children: [
12
- ...children
13
- ] }),
14
- /* @__PURE__ */ jsx("hr", { className: "divider m-12 me-0 flex-fill", style: {
15
- borderColor: color
16
- } })
17
- ] });
18
- }
19
- export {
20
- Divider
21
- };
@@ -1 +0,0 @@
1
- export * from './Divider';
@@ -1,6 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export type SeparatedInfoProps = {
3
- children: ReactNode[];
4
- className?: string;
5
- };
6
- export declare function SeparatedInfo({ children, className }: SeparatedInfoProps): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +0,0 @@
1
- import { jsxs } from "react/jsx-runtime";
2
- import Flex from "../Flex/Flex.js";
3
- function SeparatedInfo({
4
- children,
5
- className
6
- }) {
7
- return /* @__PURE__ */ jsxs(Flex, { direction: "row", className: `separated-info ${className}`, children: [
8
- ...children
9
- ] });
10
- }
11
- export {
12
- SeparatedInfo
13
- };
@@ -1 +0,0 @@
1
- export * from './SeparatedInfo';
@@ -1,14 +0,0 @@
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;
@@ -1,56 +0,0 @@
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
- };
@@ -1,8 +0,0 @@
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;
@@ -1,24 +0,0 @@
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,7 +0,0 @@
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;
@@ -1,17 +0,0 @@
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
- };