@edifice.io/react 2.5.2-develop-pedago.20251201132016 → 2.5.2-develop.20251201160304
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/modules/editor/components/Renderer/MediaRenderer.js +2 -2
- package/dist/modules/editor/hooks/useResizeMedia.js +3 -3
- package/dist/modules/multimedia/FileCard/FileCard.js +1 -1
- package/dist/modules/multimedia/FileCard/FileIcon.js +1 -1
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +1 -4
- package/package.json +6 -6
|
@@ -18,7 +18,7 @@ const MediaRenderer = (props) => {
|
|
|
18
18
|
startVerticalResize,
|
|
19
19
|
stopVerticalResize,
|
|
20
20
|
isVerticalResizeActive
|
|
21
|
-
} = useResizeMedia(props, resizableMedia), alignContent = (textalign) => {
|
|
21
|
+
} = useResizeMedia(props, resizableMedia), width = node.attrs.width || 560, height = node.attrs.height || Math.round(width * 9 / 16), alignContent = (textalign) => {
|
|
22
22
|
switch (textalign) {
|
|
23
23
|
case "center":
|
|
24
24
|
case "justify":
|
|
@@ -66,7 +66,7 @@ const MediaRenderer = (props) => {
|
|
|
66
66
|
case "iframe":
|
|
67
67
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
68
|
/* @__PURE__ */ jsx("div", { className: "iframe-node-view" }),
|
|
69
|
-
/* @__PURE__ */ jsx("iframe", { ref: resizableMedia, src: node.attrs.src, width
|
|
69
|
+
/* @__PURE__ */ jsx("iframe", { ref: resizableMedia, src: node.attrs.src, width, height, allowFullScreen: node.attrs.allowfullscreen ?? !0 })
|
|
70
70
|
] });
|
|
71
71
|
default:
|
|
72
72
|
return null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef, useEffect } from "react";
|
|
2
|
-
const useResizeMedia = (props, refResizable, forcedAspectRatio) => {
|
|
3
|
-
const aspectRatio = useRef(0), lastCursorX = useRef(-1), isVerticalResizeActive = useRef(!1), proseMirrorContainerWidth = useRef(0), readCurrentPixelWidth = () => {
|
|
2
|
+
const MIN_WIDTH = 80, useResizeMedia = (props, refResizable, forcedAspectRatio) => {
|
|
3
|
+
const aspectRatio = useRef(0), lastCursorX = useRef(-1), isVerticalResizeActive = useRef(!1), proseMirrorContainerWidth = useRef(0), limitWidth = (width) => width < MIN_WIDTH, readCurrentPixelWidth = () => {
|
|
4
4
|
const el = refResizable.current;
|
|
5
5
|
if (!el) return 0;
|
|
6
6
|
const rect = el.getBoundingClientRect();
|
|
@@ -22,7 +22,7 @@ const useResizeMedia = (props, refResizable, forcedAspectRatio) => {
|
|
|
22
22
|
}, []);
|
|
23
23
|
const clampWidth = (w) => {
|
|
24
24
|
let width = w;
|
|
25
|
-
return proseMirrorContainerWidth.current > 0 && width > proseMirrorContainerWidth.current && (width = proseMirrorContainerWidth.current), Math.round(width);
|
|
25
|
+
return proseMirrorContainerWidth.current > 0 && width > proseMirrorContainerWidth.current && (width = proseMirrorContainerWidth.current), limitWidth(width) && (width = MIN_WIDTH), Math.round(width);
|
|
26
26
|
}, onVerticalResize = (direction, diff) => {
|
|
27
27
|
const currWidth = readCurrentPixelWidth();
|
|
28
28
|
if (!currWidth) return;
|
|
@@ -82,7 +82,7 @@ const FileCard = ({
|
|
|
82
82
|
};
|
|
83
83
|
return roleMappings[type2] || roleMappings.unknown;
|
|
84
84
|
}
|
|
85
|
-
const roleMap = getRoleMap(type ?? "unknown"), file = clsx("file position-relative rounded", (roleMap == null ? void 0 : roleMap.color) ?? "bg-yellow-200"), mediaSrc =
|
|
85
|
+
const roleMap = getRoleMap(type ?? "unknown"), file = clsx("file position-relative rounded", (roleMap == null ? void 0 : roleMap.color) ?? "bg-yellow-200"), mediaSrc = type === "img" || type === "video" ? odeServices.workspace().getThumbnailUrl(doc) : null, hasThumbnail = useThumbnail(mediaSrc, {
|
|
86
86
|
ref
|
|
87
87
|
}), imageStyles = hasThumbnail && {
|
|
88
88
|
backgroundImage: `url(${mediaSrc})`,
|
|
@@ -5,7 +5,7 @@ const FileIcon = ({
|
|
|
5
5
|
type,
|
|
6
6
|
roleMap
|
|
7
7
|
}) => {
|
|
8
|
-
const hasShadow = typeof (roleMap == null ? void 0 : roleMap.icon) != "string" && type !== "unknown" && (roleMap == null ? void 0 : roleMap.hasShadow) !== !1, fileicon = clsx("position-absolute
|
|
8
|
+
const hasShadow = typeof (roleMap == null ? void 0 : roleMap.icon) != "string" && type !== "unknown" && (roleMap == null ? void 0 : roleMap.hasShadow) !== !1, fileicon = clsx("position-absolute top-50 start-50 translate-middle", {
|
|
9
9
|
"p-12 rounded-circle shadow": hasShadow
|
|
10
10
|
}, roleMap == null ? void 0 : roleMap.color);
|
|
11
11
|
return /* @__PURE__ */ jsx("div", { className: fileicon, children: (roleMap == null ? void 0 : roleMap.icon) ?? /* @__PURE__ */ jsx(SvgIconPaperclip, {}) });
|
|
@@ -111,10 +111,7 @@ const InternalLinker = ({
|
|
|
111
111
|
}, [resources]), /* @__PURE__ */ jsxs("div", { className: "d-flex flex-column flex-fill overflow-hidden", children: [
|
|
112
112
|
/* @__PURE__ */ jsxs("div", { className: "search d-flex bg-light rounded-top border border-bottom-0", children: [
|
|
113
113
|
showApplicationSelector && /* @__PURE__ */ jsx("div", { className: "flex-shrink-1 px-8 py-12 border-end", children: /* @__PURE__ */ jsxs(Dropdown, { overflow: !0, children: [
|
|
114
|
-
/* @__PURE__ */ jsx(Dropdown.Trigger, { icon: /* @__PURE__ */ jsx("div", { className: "pe-8", children: (selectedApplication == null ? void 0 : selectedApplication.icon) || /* @__PURE__ */ jsx(SvgIconApplications, {}) }), label:
|
|
115
|
-
" ",
|
|
116
|
-
t((selectedApplication == null ? void 0 : selectedApplication.displayName) || "bbm.linker.int.choose")
|
|
117
|
-
] }), variant: "ghost", size: "md" }),
|
|
114
|
+
/* @__PURE__ */ jsx(Dropdown.Trigger, { icon: /* @__PURE__ */ jsx("div", { className: "pe-8", children: (selectedApplication == null ? void 0 : selectedApplication.icon) || /* @__PURE__ */ jsx(SvgIconApplications, {}) }), label: t((selectedApplication == null ? void 0 : selectedApplication.displayName) || "bbm.linker.int.choose"), variant: "ghost", size: "md" }),
|
|
118
115
|
/* @__PURE__ */ jsx(Dropdown.Menu, { children: options == null ? void 0 : options.map((option) => /* @__PURE__ */ jsx(Dropdown.Item, { icon: option.icon, onClick: () => handleOptionClick(option), children: option.displayName }, option.application)) })
|
|
119
116
|
] }) }),
|
|
120
117
|
/* @__PURE__ */ jsx("div", { className: "flex-grow-1 align-self-center", children: /* @__PURE__ */ jsx("form", { className: "gap-16 d-flex w-100 align-items-center px-16 py-8", onSubmit: handleSubmit, children: /* @__PURE__ */ jsx(SearchBar, { isVariant: !0, placeholder: t("search"), size: "lg", className: "w-100", disabled: !selectedApplication, onChange: handleSearchChange }) }) })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.5.2-develop
|
|
3
|
+
"version": "2.5.2-develop.20251201160304",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -133,9 +133,9 @@
|
|
|
133
133
|
"react-slugify": "^3.0.3",
|
|
134
134
|
"swiper": "^10.1.0",
|
|
135
135
|
"ua-parser-js": "^1.0.36",
|
|
136
|
-
"@edifice.io/bootstrap": "2.5.2-develop
|
|
137
|
-
"@edifice.io/tiptap-extensions": "2.5.2-develop
|
|
138
|
-
"@edifice.io/utilities": "2.5.2-develop
|
|
136
|
+
"@edifice.io/bootstrap": "2.5.2-develop.20251201160304",
|
|
137
|
+
"@edifice.io/tiptap-extensions": "2.5.2-develop.20251201160304",
|
|
138
|
+
"@edifice.io/utilities": "2.5.2-develop.20251201160304"
|
|
139
139
|
},
|
|
140
140
|
"devDependencies": {
|
|
141
141
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -166,8 +166,8 @@
|
|
|
166
166
|
"vite": "^5.4.11",
|
|
167
167
|
"vite-plugin-dts": "^4.1.0",
|
|
168
168
|
"vite-tsconfig-paths": "^5.0.1",
|
|
169
|
-
"@edifice.io/client": "2.5.2-develop
|
|
170
|
-
"@edifice.io/config": "2.5.2-develop
|
|
169
|
+
"@edifice.io/client": "2.5.2-develop.20251201160304",
|
|
170
|
+
"@edifice.io/config": "2.5.2-develop.20251201160304"
|
|
171
171
|
},
|
|
172
172
|
"peerDependencies": {
|
|
173
173
|
"@react-spring/web": "^9.7.5",
|