@edifice.io/react 2.3.1-develop-b2school-actualites.20250911101750 → 2.3.1-develop-b2school-actualites.20250911174726
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/editor.js +38 -34
- 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/modals/OnboardingModal/OnboardingModal.js +1 -1
- package/package.json +6 -6
package/dist/editor.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { EditorContent, Editor, useEditor } from "@tiptap/react";
|
|
2
2
|
import { default as default2 } from "@tiptap/starter-kit";
|
|
3
3
|
import { default as default3 } from "./modules/editor/components/Editor/Editor.js";
|
|
4
|
-
import { default as default4 } from "./modules/editor/components/Editor/
|
|
5
|
-
import { default as default5 } from "./modules/editor/components/
|
|
6
|
-
import { default as default6 } from "./modules/editor/components/
|
|
7
|
-
import { default as default7 } from "./modules/editor/components/
|
|
8
|
-
import { default as default8 } from "./modules/editor/components/NodeView/
|
|
9
|
-
import { default as default9 } from "./modules/editor/components/NodeView/
|
|
10
|
-
import { default as default10 } from "./modules/editor/components/NodeView/
|
|
11
|
-
import { default as default11 } from "./modules/editor/components/NodeView/
|
|
12
|
-
import { default as default12 } from "./modules/editor/components/NodeView/
|
|
13
|
-
import { default as default13 } from "./modules/editor/components/
|
|
14
|
-
import { default as default14 } from "./modules/editor/components/
|
|
15
|
-
import { default as default15 } from "./modules/editor/components/Renderer/
|
|
16
|
-
import { default as default16 } from "./modules/editor/components/Renderer/
|
|
17
|
-
import { default as default17 } from "./modules/editor/components/Renderer/
|
|
18
|
-
import { default as default18 } from "./modules/editor/components/Renderer/
|
|
19
|
-
import { default as default19 } from "./modules/editor/components/
|
|
20
|
-
import { default as default20 } from "./modules/editor/components/
|
|
4
|
+
import { default as default4 } from "./modules/editor/components/Editor/EditorPreview.js";
|
|
5
|
+
import { default as default5 } from "./modules/editor/components/Editor/EditorPreviewSkeleton.js";
|
|
6
|
+
import { default as default6 } from "./modules/editor/components/Editor/EditorSkeleton.js";
|
|
7
|
+
import { default as default7 } from "./modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js";
|
|
8
|
+
import { default as default8 } from "./modules/editor/components/NodeView/AttachmentNodeView.js";
|
|
9
|
+
import { default as default9 } from "./modules/editor/components/NodeView/AudioNodeView.js";
|
|
10
|
+
import { default as default10 } from "./modules/editor/components/NodeView/ConversationHistoryNodeView.js";
|
|
11
|
+
import { default as default11 } from "./modules/editor/components/NodeView/ImageNodeView.js";
|
|
12
|
+
import { default as default12 } from "./modules/editor/components/NodeView/LinkerNodeView.js";
|
|
13
|
+
import { default as default13 } from "./modules/editor/components/NodeView/VideoNodeView.js";
|
|
14
|
+
import { default as default14 } from "./modules/editor/components/NodeView/InformationPaneNodeView.js";
|
|
15
|
+
import { default as default15 } from "./modules/editor/components/Renderer/AttachmentRenderer.js";
|
|
16
|
+
import { default as default16 } from "./modules/editor/components/Renderer/AudioRenderer.js";
|
|
17
|
+
import { default as default17 } from "./modules/editor/components/Renderer/ConversationHistoryRenderer.js";
|
|
18
|
+
import { default as default18 } from "./modules/editor/components/Renderer/LinkerRenderer.js";
|
|
19
|
+
import { default as default19 } from "./modules/editor/components/Renderer/MediaRenderer.js";
|
|
20
|
+
import { default as default20 } from "./modules/editor/components/Renderer/InformationPaneRenderer.js";
|
|
21
|
+
import { default as default21 } from "./modules/editor/components/Toolbar/TableToolbar.js";
|
|
22
|
+
import { default as default22 } from "./modules/editor/components/Toolbar/LinkToolbar.js";
|
|
21
23
|
import { EditorToolbar } from "./modules/editor/components/EditorToolbar/EditorToolbar.js";
|
|
22
24
|
import { useActionOptions } from "./modules/editor/hooks/useActionOptions.js";
|
|
23
25
|
import { useCommentEditor } from "./modules/editor/hooks/useCommentEditor.js";
|
|
@@ -33,29 +35,31 @@ import { useSpeechSynthetisis } from "./modules/editor/hooks/useSpeechSynthetisi
|
|
|
33
35
|
import { useTipTapEditor } from "./modules/editor/hooks/useTipTapEditor.js";
|
|
34
36
|
import { useCantooEditor } from "./modules/editor/hooks/useCantooEditor.js";
|
|
35
37
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
default8 as AttachmentNodeView,
|
|
39
|
+
default15 as AttachmentRenderer,
|
|
40
|
+
default9 as AudioNodeView,
|
|
41
|
+
default16 as AudioRenderer,
|
|
42
|
+
default7 as BubbleMenuEditImage,
|
|
43
|
+
default10 as ConversationHistoryNodeView,
|
|
44
|
+
default17 as ConversationHistoryRenderer,
|
|
43
45
|
default3 as Editor,
|
|
44
46
|
EditorContent,
|
|
45
47
|
EditorContext,
|
|
46
48
|
Editor as EditorInstance,
|
|
47
|
-
default4 as
|
|
49
|
+
default4 as EditorPreview,
|
|
50
|
+
default5 as EditorPreviewSkeleton,
|
|
51
|
+
default6 as EditorSkeleton,
|
|
48
52
|
EditorToolbar,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
default11 as ImageNodeView,
|
|
54
|
+
default14 as InformationPaneNodeView,
|
|
55
|
+
default20 as InformationPaneRenderer,
|
|
56
|
+
default22 as LinkToolbar,
|
|
57
|
+
default12 as LinkerNodeView,
|
|
58
|
+
default18 as LinkerRenderer,
|
|
59
|
+
default19 as MediaRenderer,
|
|
56
60
|
default2 as StarterKit,
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
default21 as TableToolbar,
|
|
62
|
+
default13 as VideoNodeView,
|
|
59
63
|
useActionOptions,
|
|
60
64
|
useCantooEditor,
|
|
61
65
|
useCommentEditor,
|
|
@@ -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';
|
|
@@ -66,7 +66,7 @@ const OnboardingModal = /* @__PURE__ */ forwardRef(({
|
|
|
66
66
|
isOnboarding ? handleCloseWithPreference() : handleCloseWithoutPreference();
|
|
67
67
|
}, children: t(closeText || "explorer.modal.onboarding.trash.close") })
|
|
68
68
|
] })
|
|
69
|
-
] }), document.getElementById("portal"));
|
|
69
|
+
] }), document.getElementById("portal") || document.body);
|
|
70
70
|
});
|
|
71
71
|
export {
|
|
72
72
|
OnboardingModal as default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.3.1-develop-b2school-actualites.
|
|
3
|
+
"version": "2.3.1-develop-b2school-actualites.20250911174726",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -130,9 +130,9 @@
|
|
|
130
130
|
"react-slugify": "^3.0.3",
|
|
131
131
|
"swiper": "^10.1.0",
|
|
132
132
|
"ua-parser-js": "^1.0.36",
|
|
133
|
-
"@edifice.io/bootstrap": "2.3.1-develop-b2school-actualites.
|
|
134
|
-
"@edifice.io/tiptap-extensions": "2.3.1-develop-b2school-actualites.
|
|
135
|
-
"@edifice.io/utilities": "2.3.1-develop-b2school-actualites.
|
|
133
|
+
"@edifice.io/bootstrap": "2.3.1-develop-b2school-actualites.20250911174726",
|
|
134
|
+
"@edifice.io/tiptap-extensions": "2.3.1-develop-b2school-actualites.20250911174726",
|
|
135
|
+
"@edifice.io/utilities": "2.3.1-develop-b2school-actualites.20250911174726"
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
138
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -163,8 +163,8 @@
|
|
|
163
163
|
"vite": "^5.4.11",
|
|
164
164
|
"vite-plugin-dts": "^4.1.0",
|
|
165
165
|
"vite-tsconfig-paths": "^5.0.1",
|
|
166
|
-
"@edifice.io/client": "2.3.1-develop-b2school-actualites.
|
|
167
|
-
"@edifice.io/config": "2.3.1-develop-b2school-actualites.
|
|
166
|
+
"@edifice.io/client": "2.3.1-develop-b2school-actualites.20250911174726",
|
|
167
|
+
"@edifice.io/config": "2.3.1-develop-b2school-actualites.20250911174726"
|
|
168
168
|
},
|
|
169
169
|
"peerDependencies": {
|
|
170
170
|
"@react-spring/web": "^9.7.5",
|