@edifice.io/react 2.3.0-develop-pedago.20250910173402 → 2.3.0-develop-pedago.20250911160039
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 +5 -10
- package/dist/modules/modals/ShareModal/ShareBookmarkLine.js +6 -3
- package/dist/modules/modals/ShareModal/hooks/useShareRightDisabled.d.ts +8 -0
- package/dist/modules/modals/ShareModal/hooks/useShareRightDisabled.js +11 -0
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useRef,
|
|
2
|
+
import { useRef, useEffect } from "react";
|
|
3
3
|
import { odeServices } from "@edifice.io/client";
|
|
4
4
|
import { NodeViewWrapper } from "@tiptap/react";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
@@ -18,7 +18,7 @@ const MediaRenderer = (props) => {
|
|
|
18
18
|
startVerticalResize,
|
|
19
19
|
stopVerticalResize,
|
|
20
20
|
isVerticalResizeActive
|
|
21
|
-
} = useResizeMedia(props, resizableMedia),
|
|
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":
|
|
@@ -65,12 +65,7 @@ const MediaRenderer = (props) => {
|
|
|
65
65
|
return /* @__PURE__ */ jsx("video", { ref: resizableMedia, controls: node.attrs.controls === "true", src: node.attrs.src, width: node.attrs.width, height: node.attrs.height, "data-video-resolution": `${node.attrs.width}x${node.attrs.height}`, "data-document-id": node.attrs.documentId, "data-document-is-captation": node.attrs.isCaptation, children: /* @__PURE__ */ jsx("source", { src: node.attrs.src }) });
|
|
66
66
|
case "iframe":
|
|
67
67
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
-
|
|
69
|
-
position: "absolute",
|
|
70
|
-
inset: 0,
|
|
71
|
-
cursor: "ew-resize",
|
|
72
|
-
zIndex: 2
|
|
73
|
-
} }),
|
|
68
|
+
/* @__PURE__ */ jsx("div", { className: "iframe-node-view" }),
|
|
74
69
|
/* @__PURE__ */ jsx("iframe", { ref: resizableMedia, src: node.attrs.src, width, height, allowFullScreen: node.attrs.allowfullscreen ?? !0, style: node.attrs.style })
|
|
75
70
|
] });
|
|
76
71
|
default:
|
|
@@ -78,9 +73,9 @@ const MediaRenderer = (props) => {
|
|
|
78
73
|
}
|
|
79
74
|
})() }),
|
|
80
75
|
/* @__PURE__ */ jsx("div", { className: `vertical-resize-handle ${isVerticalResizeActive ? "vertical-resize-active" : ""}`, title: t("tiptap.media.resize"), onMouseDown: (e) => {
|
|
81
|
-
e.stopPropagation(),
|
|
76
|
+
e.stopPropagation(), startVerticalResize(e);
|
|
82
77
|
}, onMouseUp: (e) => {
|
|
83
|
-
e.stopPropagation(),
|
|
78
|
+
e.stopPropagation(), stopVerticalResize();
|
|
84
79
|
} })
|
|
85
80
|
] }) });
|
|
86
81
|
};
|
|
@@ -6,6 +6,7 @@ import SvgIconRafterDown from "../../icons/components/IconRafterDown.js";
|
|
|
6
6
|
import SvgIconUsers from "../../icons/components/IconUsers.js";
|
|
7
7
|
import { hasRight } from "./utils/hasRight.js";
|
|
8
8
|
import { showShareRightLine } from "./utils/showShareRightLine.js";
|
|
9
|
+
import { useShareRightDisabled } from "./hooks/useShareRightDisabled.js";
|
|
9
10
|
import Avatar from "../../../components/Avatar/Avatar.js";
|
|
10
11
|
import Button from "../../../components/Button/Button.js";
|
|
11
12
|
import Checkbox from "../../../components/Checkbox/Checkbox.js";
|
|
@@ -20,13 +21,15 @@ const ShareBookmarkLine = ({
|
|
|
20
21
|
}) => {
|
|
21
22
|
const {
|
|
22
23
|
t
|
|
23
|
-
} = useTranslation()
|
|
24
|
+
} = useTranslation(), {
|
|
25
|
+
isShareRightDisabled
|
|
26
|
+
} = useShareRightDisabled();
|
|
24
27
|
return shareRights == null ? void 0 : shareRights.rights.map((shareRight) => {
|
|
25
28
|
const selectedAvatar = {
|
|
26
29
|
user: /* @__PURE__ */ jsx(Avatar, { alt: t("explorer.modal.share.avatar.shared.alt"), size: "xs", src: shareRight.avatarUrl, variant: "circle" }),
|
|
27
30
|
group: /* @__PURE__ */ jsx("div", { className: "avatar-xs bg-primary-200 justify-content-center d-flex rounded-circle", children: /* @__PURE__ */ jsx(SvgIconUsers, { width: 16 }) }),
|
|
28
31
|
sharebookmark: /* @__PURE__ */ jsx(SvgIconBookmark, {})
|
|
29
|
-
}[shareRight.type] || null, isTypeBookmark = shareRight.type === "sharebookmark", isTypeUser = shareRight.type === "user";
|
|
32
|
+
}[shareRight.type] || null, isTypeBookmark = shareRight.type === "sharebookmark", isTypeUser = shareRight.type === "user", isDisabled = isShareRightDisabled(shareRight, shareRights);
|
|
30
33
|
return showShareRightLine(shareRight, showBookmark) && /* @__PURE__ */ jsxs("tr", { className: shareRight.isBookmarkMember ? "bg-light" : "", children: [
|
|
31
34
|
/* @__PURE__ */ jsx("td", { children: selectedAvatar }),
|
|
32
35
|
/* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsxs("div", { className: "d-flex", children: [
|
|
@@ -39,7 +42,7 @@ const ShareBookmarkLine = ({
|
|
|
39
42
|
] }) }),
|
|
40
43
|
shareRightActions.map((shareRightAction) => /* @__PURE__ */ jsx("td", { style: {
|
|
41
44
|
width: "80px"
|
|
42
|
-
}, className: "text-center text-white", children: /* @__PURE__ */ jsx(Checkbox, { checked: hasRight(shareRight, shareRightAction), onChange: () => toggleRight(shareRight, shareRightAction.id) }) }, shareRightAction.displayName)),
|
|
45
|
+
}, className: "text-center text-white", children: /* @__PURE__ */ jsx(Checkbox, { checked: hasRight(shareRight, shareRightAction), onChange: () => toggleRight(shareRight, shareRightAction.id), disabled: isDisabled }) }, shareRightAction.displayName)),
|
|
43
46
|
/* @__PURE__ */ jsx("td", { children: !shareRight.isBookmarkMember && /* @__PURE__ */ jsx(IconButton, { "aria-label": t("close"), color: "tertiary", icon: /* @__PURE__ */ jsx(SvgIconClose, {}), type: "button", variant: "ghost", title: t("close"), onClick: () => onDeleteRow(shareRight) }) })
|
|
44
47
|
] }, shareRight.id);
|
|
45
48
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ShareRight, ShareRightWithVisibles } from '@edifice.io/client';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to determine if a share right should be disabled
|
|
4
|
+
* @returns function to check if a specific share right should be disabled
|
|
5
|
+
*/
|
|
6
|
+
export declare const useShareRightDisabled: () => {
|
|
7
|
+
isShareRightDisabled: (shareRight: ShareRight, shareRights: ShareRightWithVisibles) => boolean;
|
|
8
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const DISABLED_GROUP_LABELS = ["CommunityMemberGroup", "CommunityAdminGroup"], useShareRightDisabled = () => ({
|
|
2
|
+
isShareRightDisabled: (shareRight, shareRights) => {
|
|
3
|
+
if (shareRight.type !== "group")
|
|
4
|
+
return !1;
|
|
5
|
+
const group = shareRights.visibleGroups.find((g) => g.id === shareRight.id);
|
|
6
|
+
return !group || !group.labels || !Array.isArray(group.labels) ? !1 : !!group.labels.some((label) => DISABLED_GROUP_LABELS.includes(label));
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export {
|
|
10
|
+
useShareRightDisabled
|
|
11
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.3.0-develop-pedago.
|
|
3
|
+
"version": "2.3.0-develop-pedago.20250911160039",
|
|
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.0-develop-pedago.
|
|
134
|
-
"@edifice.io/
|
|
135
|
-
"@edifice.io/
|
|
133
|
+
"@edifice.io/bootstrap": "2.3.0-develop-pedago.20250911160039",
|
|
134
|
+
"@edifice.io/utilities": "2.3.0-develop-pedago.20250911160039",
|
|
135
|
+
"@edifice.io/tiptap-extensions": "2.3.0-develop-pedago.20250911160039"
|
|
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.0-develop-pedago.
|
|
167
|
-
"@edifice.io/config": "2.3.0-develop-pedago.
|
|
166
|
+
"@edifice.io/client": "2.3.0-develop-pedago.20250911160039",
|
|
167
|
+
"@edifice.io/config": "2.3.0-develop-pedago.20250911160039"
|
|
168
168
|
},
|
|
169
169
|
"peerDependencies": {
|
|
170
170
|
"@react-spring/web": "^9.7.5",
|