@edifice.io/react 2.5.5-develop.20260112150307 → 2.5.6
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 +0 -1
- package/dist/components/Badge/Badge.d.ts +1 -12
- package/dist/components/Badge/Badge.js +2 -15
- package/dist/components/Flex/Flex.js +1 -1
- package/dist/components/Layout/components/Header.js +6 -1
- package/dist/components/Menu/components/MenuButton.d.ts +0 -2
- package/dist/components/Menu/components/MenuButton.js +4 -13
- package/dist/components/Select/Select.d.ts +2 -6
- package/dist/components/Select/Select.js +4 -10
- package/dist/components/index.d.ts +0 -2
- package/dist/editor.js +36 -40
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/useDropzone/useDropzone.d.ts +2 -2
- package/dist/hooks/useDropzone/useDropzone.js +5 -20
- package/dist/icons.js +298 -300
- package/dist/index.js +170 -186
- package/dist/modals.js +6 -8
- package/dist/modules/comments/components/Comment.js +2 -4
- package/dist/modules/comments/components/CommentList.js +1 -1
- package/dist/modules/comments/components/DeleteModal.js +8 -14
- package/dist/modules/editor/components/Editor/index.d.ts +0 -2
- package/dist/modules/editor/components/Renderer/AttachmentRenderer.js +1 -1
- package/dist/modules/editor/hooks/useMediaLibraryEditor.js +3 -4
- package/dist/modules/icons/components/index.d.ts +0 -1
- package/dist/modules/modals/ShareModal/ShareBookmark.d.ts +1 -1
- package/dist/modules/modals/ShareModal/ShareBookmark.js +2 -5
- package/dist/modules/modals/ShareModal/ShareModal.d.ts +11 -1
- package/dist/modules/modals/ShareModal/ShareModal.js +105 -13
- package/dist/modules/modals/ShareModal/hooks/useSearch.d.ts +1 -2
- package/dist/modules/modals/ShareModal/hooks/useSearch.js +2 -3
- package/dist/modules/modals/ShareModal/hooks/useShare.d.ts +5 -12
- package/dist/modules/modals/ShareModal/hooks/useShare.js +13 -20
- package/dist/modules/modals/ShareModal/hooks/useShareBookmark.d.ts +1 -1
- package/dist/modules/modals/ShareModal/hooks/useShareBookmark.js +1 -1
- package/dist/modules/modals/ShareModal/index.d.ts +1 -3
- package/dist/modules/multimedia/MediaLibrary/index.d.ts +0 -2
- package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +1 -1
- package/dist/modules/multimedia/index.d.ts +0 -1
- package/dist/multimedia.js +8 -14
- package/dist/style.css +1 -1
- package/dist/utilities/index.d.ts +0 -1
- package/package.json +6 -7
- package/dist/components/Divider/Divider.d.ts +0 -38
- package/dist/components/Divider/Divider.js +0 -11
- package/dist/components/Divider/index.d.ts +0 -2
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +0 -59
- package/dist/components/SegmentedControl/SegmentedControl.js +0 -21
- package/dist/components/SegmentedControl/index.d.ts +0 -2
- package/dist/hooks/useInfiniteScroll/index.d.ts +0 -1
- package/dist/hooks/useInfiniteScroll/useInfiniteScroll.d.ts +0 -33
- package/dist/hooks/useInfiniteScroll/useInfiniteScroll.js +0 -20
- package/dist/modules/editor/components/Editor/EditorPreview.d.ts +0 -14
- package/dist/modules/editor/components/Editor/EditorPreview.js +0 -56
- package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.d.ts +0 -8
- package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.js +0 -24
- package/dist/modules/icons/components/IconClockAlert.d.ts +0 -7
- package/dist/modules/icons/components/IconClockAlert.js +0 -17
- package/dist/modules/modals/ShareModal/ShareResources.d.ts +0 -174
- package/dist/modules/modals/ShareModal/ShareResources.js +0 -137
- package/dist/utilities/react-query/index.d.ts +0 -1
- package/dist/utilities/react-query/react-query-utils.d.ts +0 -21
- package/dist/utilities/react-query/react-query-utils.js +0 -13
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
2
|
import { useTranslation } from "react-i18next";
|
|
4
3
|
import SvgIconSave from "../../icons/components/IconSave.js";
|
|
5
4
|
import FormControl from "../../../components/Form/FormControl.js";
|
|
@@ -12,12 +11,10 @@ const ShareBookmark = ({
|
|
|
12
11
|
}) => {
|
|
13
12
|
const {
|
|
14
13
|
t
|
|
15
|
-
} = useTranslation()
|
|
16
|
-
setIsSaving(!0), await onSave(), setIsSaving(!1);
|
|
17
|
-
};
|
|
14
|
+
} = useTranslation();
|
|
18
15
|
return /* @__PURE__ */ jsx("div", { className: "mt-16", children: /* @__PURE__ */ jsxs(FormControl, { id: "bookmarkName", className: "d-flex flex-wrap align-items-center gap-16", children: [
|
|
19
16
|
/* @__PURE__ */ jsx("div", { className: "flex-fill", children: /* @__PURE__ */ jsx(FormControl.Input, { ref: refBookmark, onChange: onBookmarkChange, placeholder: t("explorer.modal.share.sharebookmark.placeholder"), size: "sm", type: "text" }, bookmark.id) }),
|
|
20
|
-
/* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "ghost", disabled: bookmark.name.length === 0
|
|
17
|
+
/* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "ghost", disabled: bookmark.name.length === 0, leftIcon: /* @__PURE__ */ jsx(SvgIconSave, {}), onClick: onSave, className: "text-nowrap", children: t("explorer.modal.share.sharebookmark.save") })
|
|
21
18
|
] }) });
|
|
22
19
|
};
|
|
23
20
|
export {
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ID, PutShareResponse, RightStringified, ShareRight } from '@edifice.io/client';
|
|
3
|
+
import { UseMutationResult } from '../../../node_modules/@tanstack/react-query';
|
|
4
|
+
export type ShareOptions = {
|
|
5
|
+
resourceId: ID;
|
|
6
|
+
resourceRights: RightStringified[];
|
|
7
|
+
resourceCreatorId: string;
|
|
8
|
+
};
|
|
9
|
+
export type ShareResourceMutation = UseMutationResult<PutShareResponse, unknown, {
|
|
10
|
+
resourceId: string;
|
|
11
|
+
rights: ShareRight[];
|
|
12
|
+
}, unknown>;
|
|
3
13
|
interface ShareResourceModalProps {
|
|
4
14
|
/** Handle open/close state */
|
|
5
15
|
isOpen: boolean;
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useState } from "react";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
|
-
import
|
|
5
|
+
import SvgIconBookmark from "../../icons/components/IconBookmark.js";
|
|
6
|
+
import SvgIconInfoCircle from "../../icons/components/IconInfoCircle.js";
|
|
7
|
+
import SvgIconRafterDown from "../../icons/components/IconRafterDown.js";
|
|
8
|
+
import { ShareBookmark } from "./ShareBookmark.js";
|
|
9
|
+
import { ShareBookmarkLine } from "./ShareBookmarkLine.js";
|
|
10
|
+
import { useSearch } from "./hooks/useSearch.js";
|
|
11
|
+
import useShare from "./hooks/useShare.js";
|
|
12
|
+
import { useShareBookmark } from "./hooks/useShareBookmark.js";
|
|
6
13
|
import Modal from "../../../components/Modal/Modal.js";
|
|
7
14
|
import Alert from "../../../components/Alert/Alert.js";
|
|
15
|
+
import Heading from "../../../components/Heading/Heading.js";
|
|
16
|
+
import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
|
|
17
|
+
import VisuallyHidden from "../../../components/VisuallyHidden/VisuallyHidden.js";
|
|
18
|
+
import Avatar from "../../../components/Avatar/Avatar.js";
|
|
19
|
+
import Checkbox from "../../../components/Checkbox/Checkbox.js";
|
|
8
20
|
import Button from "../../../components/Button/Button.js";
|
|
21
|
+
import Tooltip from "../../../components/Tooltip/Tooltip.js";
|
|
22
|
+
import Combobox from "../../../components/Combobox/Combobox.js";
|
|
9
23
|
function ShareResourceModal({
|
|
10
24
|
isOpen,
|
|
11
25
|
shareOptions,
|
|
@@ -14,26 +28,104 @@ function ShareResourceModal({
|
|
|
14
28
|
onSuccess,
|
|
15
29
|
onCancel
|
|
16
30
|
}) {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
31
|
+
const {
|
|
32
|
+
resourceId,
|
|
33
|
+
resourceCreatorId,
|
|
34
|
+
resourceRights
|
|
35
|
+
} = shareOptions, [isLoading, setIsLoading] = useState(!0), {
|
|
36
|
+
state: {
|
|
37
|
+
isSharing,
|
|
38
|
+
shareRights,
|
|
39
|
+
shareRightActions
|
|
40
|
+
},
|
|
41
|
+
dispatch: shareDispatch,
|
|
42
|
+
myAvatar,
|
|
43
|
+
currentIsAuthor,
|
|
44
|
+
handleShare,
|
|
45
|
+
toggleRight,
|
|
46
|
+
handleDeleteRow
|
|
47
|
+
} = useShare({
|
|
48
|
+
resourceId,
|
|
49
|
+
resourceCreatorId,
|
|
50
|
+
resourceRights,
|
|
51
|
+
shareResource,
|
|
52
|
+
setIsLoading,
|
|
53
|
+
onSuccess
|
|
54
|
+
}), {
|
|
55
|
+
state: {
|
|
56
|
+
searchResults,
|
|
57
|
+
searchInputValue
|
|
58
|
+
},
|
|
59
|
+
showSearchAdmlHint,
|
|
60
|
+
showSearchLoading,
|
|
61
|
+
showSearchNoResults,
|
|
62
|
+
getSearchMinLength,
|
|
63
|
+
handleSearchInputChange,
|
|
64
|
+
handleSearchResultsChange
|
|
65
|
+
} = useSearch({
|
|
66
|
+
resourceId,
|
|
67
|
+
resourceCreatorId,
|
|
68
|
+
shareRights,
|
|
69
|
+
shareDispatch
|
|
70
|
+
}), {
|
|
71
|
+
refBookmark,
|
|
72
|
+
showBookmark,
|
|
73
|
+
handleBookmarkChange,
|
|
74
|
+
toggleBookmark,
|
|
75
|
+
bookmark,
|
|
76
|
+
handleOnSave,
|
|
77
|
+
showBookmarkInput,
|
|
78
|
+
toggleBookmarkInput
|
|
79
|
+
} = useShareBookmark({
|
|
80
|
+
shareRights,
|
|
81
|
+
shareDispatch
|
|
82
|
+
}), {
|
|
21
83
|
t
|
|
22
|
-
} = useTranslation(),
|
|
23
|
-
setIsSaving(isSaving2);
|
|
24
|
-
};
|
|
84
|
+
} = useTranslation(), searchPlaceholder = showSearchAdmlHint() ? t("explorer.search.adml.hint") : t("explorer.modal.share.search.placeholder");
|
|
25
85
|
return /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs(Modal, { id: "share_modal", size: "lg", isOpen, onModalClose: onCancel, children: [
|
|
26
86
|
/* @__PURE__ */ jsx(Modal.Header, { onModalClose: onCancel, children: t("share.title") }),
|
|
27
87
|
/* @__PURE__ */ jsxs(Modal.Body, { children: [
|
|
28
88
|
/* @__PURE__ */ jsx(Alert, { type: "info", className: "mb-16", children: t("explorer.modal.share.alert.community") }),
|
|
29
|
-
/* @__PURE__ */ jsx(
|
|
89
|
+
/* @__PURE__ */ jsx(Heading, { headingStyle: "h4", level: "h3", className: "mb-16", children: t("explorer.modal.share.usersWithAccess") }),
|
|
90
|
+
/* @__PURE__ */ jsx("div", { className: "table-responsive", children: isLoading ? /* @__PURE__ */ jsx(LoadingScreen, {}) : /* @__PURE__ */ jsxs("table", { className: "table border align-middle mb-0", children: [
|
|
91
|
+
/* @__PURE__ */ jsx("thead", { className: "bg-secondary", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
92
|
+
/* @__PURE__ */ jsx("th", { scope: "col", className: "w-32", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("explorer.modal.share.avatar.shared.alt") }) }),
|
|
93
|
+
/* @__PURE__ */ jsx("th", { scope: "col", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("explorer.modal.share.search.placeholder") }) }),
|
|
94
|
+
shareRightActions.map((shareRightAction) => /* @__PURE__ */ jsx("th", { scope: "col", className: "text-center text-white", children: t(shareRightAction.displayName) }, shareRightAction.displayName)),
|
|
95
|
+
/* @__PURE__ */ jsx("th", { scope: "col", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("close") }) })
|
|
96
|
+
] }) }),
|
|
97
|
+
/* @__PURE__ */ jsxs("tbody", { children: [
|
|
98
|
+
currentIsAuthor() && /* @__PURE__ */ jsxs("tr", { children: [
|
|
99
|
+
/* @__PURE__ */ jsx("th", { scope: "row", children: /* @__PURE__ */ jsx(Avatar, { alt: t("explorer.modal.share.avatar.me.alt"), size: "xs", src: myAvatar, variant: "circle" }) }),
|
|
100
|
+
/* @__PURE__ */ jsx("td", { children: t("share.me") }),
|
|
101
|
+
shareRightActions.map((shareRightAction) => /* @__PURE__ */ jsx("td", { style: {
|
|
102
|
+
width: "80px"
|
|
103
|
+
}, className: "text-center text-white", children: /* @__PURE__ */ jsx(Checkbox, { checked: !0, disabled: !0 }) }, shareRightAction.displayName)),
|
|
104
|
+
/* @__PURE__ */ jsx("td", {})
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ jsx(ShareBookmarkLine, { showBookmark, shareRightActions, shareRights, onDeleteRow: handleDeleteRow, toggleRight, toggleBookmark })
|
|
107
|
+
] })
|
|
108
|
+
] }) }),
|
|
109
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-16", children: [
|
|
110
|
+
/* @__PURE__ */ jsx(Button, { color: "tertiary", leftIcon: /* @__PURE__ */ jsx(SvgIconBookmark, {}), rightIcon: /* @__PURE__ */ jsx(SvgIconRafterDown, { title: t("show"), className: "w-16 min-w-0", style: {
|
|
111
|
+
transition: "rotate 0.2s ease-out",
|
|
112
|
+
rotate: showBookmarkInput ? "-180deg" : "0deg"
|
|
113
|
+
} }), type: "button", variant: "ghost", className: "fw-normal", onClick: () => toggleBookmarkInput(!showBookmarkInput), children: t("share.save.sharebookmark") }),
|
|
114
|
+
showBookmarkInput && /* @__PURE__ */ jsx(ShareBookmark, { refBookmark, bookmark, onBookmarkChange: handleBookmarkChange, onSave: handleOnSave })
|
|
115
|
+
] }),
|
|
116
|
+
/* @__PURE__ */ jsx("hr", {}),
|
|
117
|
+
/* @__PURE__ */ jsxs(Heading, { headingStyle: "h4", level: "h3", className: "mb-16 d-flex align-items-center", children: [
|
|
118
|
+
/* @__PURE__ */ jsx("div", { className: "me-8", children: t("explorer.modal.share.search") }),
|
|
119
|
+
/* @__PURE__ */ jsx(Tooltip, { message: "Vos favoris de partage s’affichent en priorité dans votre liste lorsque vous recherchez un groupe ou une personne, vous pouvez les retrouver dans l’annuaire.", placement: "top", children: /* @__PURE__ */ jsx(SvgIconInfoCircle, { className: "c-pointer", height: "18" }) })
|
|
120
|
+
] }),
|
|
121
|
+
/* @__PURE__ */ jsx("div", { className: "row", children: /* @__PURE__ */ jsx("div", { className: "col-10", children: /* @__PURE__ */ jsx(Combobox, { value: searchInputValue, placeholder: searchPlaceholder, isLoading: showSearchLoading(), noResult: showSearchNoResults(), options: searchResults, searchMinLength: getSearchMinLength(), onSearchInputChange: handleSearchInputChange, onSearchResultsChange: handleSearchResultsChange }) }) }),
|
|
30
122
|
children
|
|
31
123
|
] }),
|
|
32
124
|
/* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
|
33
|
-
/* @__PURE__ */ jsx(Button, { type: "button", color: "tertiary", variant: "ghost", onClick: onCancel,
|
|
34
|
-
/* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "filled", isLoading:
|
|
125
|
+
/* @__PURE__ */ jsx(Button, { type: "button", color: "tertiary", variant: "ghost", onClick: onCancel, children: t("explorer.cancel") }),
|
|
126
|
+
/* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "filled", isLoading: isSharing, onClick: handleShare, disabled: isSharing, children: t("share") })
|
|
35
127
|
] })
|
|
36
|
-
] }), document.getElementById("portal")
|
|
128
|
+
] }), document.getElementById("portal"));
|
|
37
129
|
}
|
|
38
130
|
export {
|
|
39
131
|
ShareResourceModal as default
|
|
@@ -3,12 +3,11 @@ import { ShareRightWithVisibles, ShareSubject } from '@edifice.io/client';
|
|
|
3
3
|
import { OptionListItemType } from '../../../../components';
|
|
4
4
|
import { ShareOptions } from '../ShareModal';
|
|
5
5
|
import { ShareAction } from './useShare';
|
|
6
|
-
export declare const useSearch: ({ resourceId, resourceCreatorId, shareRights, shareDispatch,
|
|
6
|
+
export declare const useSearch: ({ resourceId, resourceCreatorId, shareRights, shareDispatch, }: {
|
|
7
7
|
resourceId: ShareOptions["resourceCreatorId"];
|
|
8
8
|
resourceCreatorId: ShareOptions["resourceCreatorId"];
|
|
9
9
|
shareRights: ShareRightWithVisibles;
|
|
10
10
|
shareDispatch: Dispatch<ShareAction>;
|
|
11
|
-
urlResourceRights?: string;
|
|
12
11
|
}) => {
|
|
13
12
|
state: {
|
|
14
13
|
searchInputValue: string;
|
|
@@ -58,8 +58,7 @@ const defaultActions = [{
|
|
|
58
58
|
resourceId,
|
|
59
59
|
resourceCreatorId,
|
|
60
60
|
shareRights,
|
|
61
|
-
shareDispatch
|
|
62
|
-
urlResourceRights
|
|
61
|
+
shareDispatch
|
|
63
62
|
}) => {
|
|
64
63
|
const [state, dispatch] = useReducer(reducer, initialState), debouncedSearchInputValue = useDebounce(state.searchInputValue, 500), {
|
|
65
64
|
isAdml
|
|
@@ -83,7 +82,7 @@ const defaultActions = [{
|
|
|
83
82
|
type: "isSearching",
|
|
84
83
|
payload: !0
|
|
85
84
|
}), !isAdml && debouncedSearchInputValue2.length >= 1 || isAdml && debouncedSearchInputValue2.length >= 3) {
|
|
86
|
-
const resSearchShareSubjects = await odeServices.share().searchShareSubjects(appCode, resourceId, debouncedSearchInputValue2
|
|
85
|
+
const resSearchShareSubjects = await odeServices.share().searchShareSubjects(appCode, resourceId, debouncedSearchInputValue2);
|
|
87
86
|
dispatch({
|
|
88
87
|
type: "addApiResult",
|
|
89
88
|
payload: resSearchShareSubjects
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ShareRight, ShareRightAction, ShareRightActionDisplayName, ShareRightWithVisibles
|
|
2
|
-
import { ShareOptions, ShareResourceMutation } from '../
|
|
1
|
+
import { ShareRight, ShareRightAction, ShareRightActionDisplayName, ShareRightWithVisibles } from '@edifice.io/client';
|
|
2
|
+
import { ShareOptions, ShareResourceMutation } from '../ShareModal';
|
|
3
3
|
interface UseShareResourceModalProps {
|
|
4
4
|
/**
|
|
5
5
|
* Resource ID (assetId)
|
|
@@ -15,15 +15,10 @@ interface UseShareResourceModalProps {
|
|
|
15
15
|
resourceCreatorId: ShareOptions['resourceCreatorId'];
|
|
16
16
|
shareResource?: ShareResourceMutation;
|
|
17
17
|
onSuccess: () => void;
|
|
18
|
-
setIsLoading
|
|
19
|
-
resourceShareRights?: ShareRightWithVisibles;
|
|
20
|
-
resourceShareRightActions?: ShareRightAction[];
|
|
21
|
-
filteredActions?: ShareRightActionDisplayName[];
|
|
22
|
-
shareUrls?: ShareUrls;
|
|
18
|
+
setIsLoading: (value: boolean) => void;
|
|
23
19
|
}
|
|
24
20
|
type State = {
|
|
25
21
|
isSharing: boolean;
|
|
26
|
-
isDirty?: boolean;
|
|
27
22
|
shareRights: ShareRightWithVisibles;
|
|
28
23
|
shareRightActions: ShareRightAction[];
|
|
29
24
|
};
|
|
@@ -43,10 +38,9 @@ export type ShareAction = {
|
|
|
43
38
|
type: 'isSharing';
|
|
44
39
|
payload: boolean;
|
|
45
40
|
};
|
|
46
|
-
export default function useShare({ resourceId, resourceRights, resourceCreatorId, shareResource, setIsLoading, onSuccess,
|
|
41
|
+
export default function useShare({ resourceId, resourceRights, resourceCreatorId, shareResource, setIsLoading, onSuccess, }: UseShareResourceModalProps): {
|
|
47
42
|
state: {
|
|
48
43
|
isSharing: boolean;
|
|
49
|
-
isDirty?: boolean;
|
|
50
44
|
shareRights: ShareRightWithVisibles;
|
|
51
45
|
shareRightActions: ShareRightAction[];
|
|
52
46
|
};
|
|
@@ -54,8 +48,7 @@ export default function useShare({ resourceId, resourceRights, resourceCreatorId
|
|
|
54
48
|
currentIsAuthor: () => boolean;
|
|
55
49
|
myAvatar: string;
|
|
56
50
|
handleDeleteRow: (shareRight: ShareRight) => void;
|
|
57
|
-
handleShare: (
|
|
51
|
+
handleShare: () => Promise<void>;
|
|
58
52
|
toggleRight: (shareRight: ShareRight, actionName: ShareRightActionDisplayName) => void;
|
|
59
|
-
isDirty: boolean;
|
|
60
53
|
};
|
|
61
54
|
export {};
|
|
@@ -6,7 +6,6 @@ import useUser from "../../../../hooks/useUser/useUser.js";
|
|
|
6
6
|
import useToast from "../../../../hooks/useToast/useToast.js";
|
|
7
7
|
const initialState = {
|
|
8
8
|
isSharing: !1,
|
|
9
|
-
isDirty: !1,
|
|
10
9
|
shareRights: {
|
|
11
10
|
rights: [],
|
|
12
11
|
visibleBookmarks: [],
|
|
@@ -25,20 +24,17 @@ function reducer(state, action) {
|
|
|
25
24
|
case "deleteRow":
|
|
26
25
|
return {
|
|
27
26
|
...state,
|
|
28
|
-
shareRights: action.payload
|
|
29
|
-
isDirty: !0
|
|
27
|
+
shareRights: action.payload
|
|
30
28
|
};
|
|
31
29
|
case "updateShareRights":
|
|
32
30
|
return {
|
|
33
31
|
...state,
|
|
34
|
-
shareRights: action.payload
|
|
35
|
-
isDirty: !0
|
|
32
|
+
shareRights: action.payload
|
|
36
33
|
};
|
|
37
34
|
case "toggleRight":
|
|
38
35
|
return {
|
|
39
36
|
...state,
|
|
40
|
-
shareRights: action.payload
|
|
41
|
-
isDirty: !0
|
|
37
|
+
shareRights: action.payload
|
|
42
38
|
};
|
|
43
39
|
case "isSharing":
|
|
44
40
|
return {
|
|
@@ -55,9 +51,7 @@ function useShare({
|
|
|
55
51
|
resourceCreatorId,
|
|
56
52
|
shareResource,
|
|
57
53
|
setIsLoading,
|
|
58
|
-
onSuccess
|
|
59
|
-
filteredActions,
|
|
60
|
-
shareUrls
|
|
54
|
+
onSuccess
|
|
61
55
|
}) {
|
|
62
56
|
const {
|
|
63
57
|
appCode
|
|
@@ -70,18 +64,18 @@ function useShare({
|
|
|
70
64
|
useEffect(() => {
|
|
71
65
|
resourceId && (async () => {
|
|
72
66
|
try {
|
|
73
|
-
const [shareRightActions, shareRights] = await Promise.all([odeServices.share().getActionsForApp(appCode
|
|
67
|
+
const [shareRightActions, shareRights] = await Promise.all([odeServices.share().getActionsForApp(appCode), odeServices.share().getRightsForResource(appCode, resourceId)]);
|
|
74
68
|
dispatch({
|
|
75
69
|
type: "init",
|
|
76
70
|
payload: {
|
|
77
|
-
shareRightActions
|
|
71
|
+
shareRightActions,
|
|
78
72
|
shareRights
|
|
79
73
|
}
|
|
80
74
|
});
|
|
81
75
|
} catch (error) {
|
|
82
76
|
console.error(error);
|
|
83
77
|
}
|
|
84
|
-
setIsLoading
|
|
78
|
+
setIsLoading(!1);
|
|
85
79
|
})();
|
|
86
80
|
}, [resourceId]);
|
|
87
81
|
const toggleRight = (shareRight, actionName) => {
|
|
@@ -149,7 +143,7 @@ function useShare({
|
|
|
149
143
|
}
|
|
150
144
|
});
|
|
151
145
|
},
|
|
152
|
-
handleShare: async (
|
|
146
|
+
handleShare: async () => {
|
|
153
147
|
dispatch({
|
|
154
148
|
type: "isSharing",
|
|
155
149
|
payload: !0
|
|
@@ -175,12 +169,12 @@ function useShare({
|
|
|
175
169
|
resourceId,
|
|
176
170
|
rights: shares
|
|
177
171
|
});
|
|
178
|
-
|
|
172
|
+
notifySuccess(result);
|
|
179
173
|
} else {
|
|
180
|
-
const result = await odeServices.share().saveRights(appCode, resourceId, shares
|
|
181
|
-
|
|
174
|
+
const result = await odeServices.share().saveRights(appCode, resourceId, shares);
|
|
175
|
+
notifySuccess(result);
|
|
182
176
|
}
|
|
183
|
-
|
|
177
|
+
onSuccess();
|
|
184
178
|
} catch (error) {
|
|
185
179
|
typeof error == "string" && toast.error(t("explorer.shared.status.error")), typeof error == "object" && toast.error(t((error == null ? void 0 : error.error) || "explorer.shared.status.error")), console.error("Failed to save share", error);
|
|
186
180
|
} finally {
|
|
@@ -190,8 +184,7 @@ function useShare({
|
|
|
190
184
|
});
|
|
191
185
|
}
|
|
192
186
|
},
|
|
193
|
-
toggleRight
|
|
194
|
-
isDirty: !!state.isDirty
|
|
187
|
+
toggleRight
|
|
195
188
|
};
|
|
196
189
|
}
|
|
197
190
|
export {
|
|
@@ -16,7 +16,7 @@ export declare const useShareBookmark: ({ shareRights, shareDispatch, }: UseShar
|
|
|
16
16
|
bookmark: BookmarkProps;
|
|
17
17
|
handleBookmarkChange: () => void;
|
|
18
18
|
setBookmark: Dispatch<import('react').SetStateAction<BookmarkProps>>;
|
|
19
|
-
handleOnSave: () =>
|
|
19
|
+
handleOnSave: () => void;
|
|
20
20
|
toggleBookmark: () => void;
|
|
21
21
|
toggleBookmarkInput: Dispatch<import('react').SetStateAction<boolean>>;
|
|
22
22
|
};
|
|
@@ -56,7 +56,7 @@ const useShareBookmark = ({
|
|
|
56
56
|
handleOnSave: () => {
|
|
57
57
|
var _a;
|
|
58
58
|
const inputValue = ((_a = refBookmark.current) == null ? void 0 : _a.value) || "";
|
|
59
|
-
|
|
59
|
+
saveBookmark(inputValue);
|
|
60
60
|
},
|
|
61
61
|
toggleBookmark,
|
|
62
62
|
toggleBookmarkInput
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
+
export { default as ShareModal } from './ShareModal';
|
|
1
2
|
export { default as ShareBlog } from './apps/ShareBlog';
|
|
2
3
|
export { default as useShareMutation } from './hooks/useShareMutation';
|
|
3
|
-
export { default as ShareModal } from './ShareModal';
|
|
4
|
-
export * from './ShareResources';
|
|
5
|
-
export { default as ShareResources } from './ShareResources';
|
|
@@ -14,7 +14,7 @@ const acceptedTypes = (type) => {
|
|
|
14
14
|
acceptedTypes2.push("video/*");
|
|
15
15
|
break;
|
|
16
16
|
case "image":
|
|
17
|
-
acceptedTypes2.push("image/png"), acceptedTypes2.push("image/jpeg"), acceptedTypes2.push("image/webp"), acceptedTypes2.push("image/gif"), acceptedTypes2.push("image/avif")
|
|
17
|
+
acceptedTypes2.push("image/png"), acceptedTypes2.push("image/jpeg"), acceptedTypes2.push("image/webp"), acceptedTypes2.push("image/gif"), acceptedTypes2.push("image/avif");
|
|
18
18
|
break;
|
|
19
19
|
}
|
|
20
20
|
return acceptedTypes2;
|
package/dist/multimedia.js
CHANGED
|
@@ -4,15 +4,12 @@ import { default as default4 } from "./modules/multimedia/ImageEditor/components
|
|
|
4
4
|
import { default as default5 } from "./modules/multimedia/ImagePicker/ImagePicker.js";
|
|
5
5
|
import { default as default6 } from "./modules/multimedia/FileCard/FileCard.js";
|
|
6
6
|
import { default as default7 } from "./modules/multimedia/MediaLibrary/MediaLibrary.js";
|
|
7
|
-
import { default as default8 } from "./modules/multimedia/
|
|
8
|
-
import { default as default9 } from "./modules/multimedia/
|
|
9
|
-
import { default as default10 } from "./modules/multimedia/
|
|
10
|
-
import { default as default11 } from "./modules/multimedia/
|
|
11
|
-
import { default as default12 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
12
|
-
import { default as default13 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
7
|
+
import { default as default8 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
|
|
8
|
+
import { default as default9 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
|
|
9
|
+
import { default as default10 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
10
|
+
import { default as default11 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
13
11
|
import { ExternalLinker } from "./modules/multimedia/Linker/ExternalLinker/ExternalLinker.js";
|
|
14
12
|
import { InternalLinker } from "./modules/multimedia/Linker/InternalLinker/InternalLinker.js";
|
|
15
|
-
import { Upload } from "./modules/multimedia/MediaLibrary/innertabs/Upload.js";
|
|
16
13
|
export {
|
|
17
14
|
default2 as AudioRecorder,
|
|
18
15
|
default3 as Embed,
|
|
@@ -22,11 +19,8 @@ export {
|
|
|
22
19
|
default5 as ImagePicker,
|
|
23
20
|
InternalLinker,
|
|
24
21
|
default7 as MediaLibrary,
|
|
25
|
-
|
|
26
|
-
default9 as
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
default11 as VideoRecorder,
|
|
30
|
-
default12 as Workspace,
|
|
31
|
-
default13 as WorkspaceFolders
|
|
22
|
+
default8 as VideoEmbed,
|
|
23
|
+
default9 as VideoRecorder,
|
|
24
|
+
default10 as Workspace,
|
|
25
|
+
default11 as WorkspaceFolders
|
|
32
26
|
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root .edifice{--ant-
|
|
1
|
+
:root .edifice{--ant-color-primary: var(--edifice-primary);--ant-color-success: var(--edifice-success);--ant-color-warning: var(--edifice-warning);--ant-blue: var(--edifice-blue);--ant-purple: var(--edifice-purple);--ant-cyan: var(--edifice-cyan);--ant-green: var(--edifice-green);--ant-magenta: var(--edifice-magenta);--ant-pink: var(--edifice-pink);--ant-red: var(--edifice-red);--ant-orange: var(--edifice-orange);--ant-yellow: var(--edifice-yellow);--ant-color-text-base: var(--edifice-body-color);--ant-color-bg-base: var(--edifice-body-bg)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.6",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -123,7 +123,6 @@
|
|
|
123
123
|
"clsx": "^2.1.1",
|
|
124
124
|
"dayjs": "1.11.10",
|
|
125
125
|
"emoji-picker-react": "4.5.2",
|
|
126
|
-
"heic2any": "0.0.4",
|
|
127
126
|
"html-react-parser": "4.2.1",
|
|
128
127
|
"ohash": "1.1.3",
|
|
129
128
|
"pako": "2.1.0",
|
|
@@ -134,9 +133,9 @@
|
|
|
134
133
|
"react-slugify": "^3.0.3",
|
|
135
134
|
"swiper": "^10.1.0",
|
|
136
135
|
"ua-parser-js": "^1.0.36",
|
|
137
|
-
"@edifice.io/bootstrap": "2.5.
|
|
138
|
-
"@edifice.io/tiptap-extensions": "2.5.
|
|
139
|
-
"@edifice.io/utilities": "2.5.
|
|
136
|
+
"@edifice.io/bootstrap": "2.5.6",
|
|
137
|
+
"@edifice.io/tiptap-extensions": "2.5.6",
|
|
138
|
+
"@edifice.io/utilities": "2.5.6"
|
|
140
139
|
},
|
|
141
140
|
"devDependencies": {
|
|
142
141
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -167,8 +166,8 @@
|
|
|
167
166
|
"vite": "^5.4.11",
|
|
168
167
|
"vite-plugin-dts": "^4.1.0",
|
|
169
168
|
"vite-tsconfig-paths": "^5.0.1",
|
|
170
|
-
"@edifice.io/client": "2.5.
|
|
171
|
-
"@edifice.io/config": "2.5.
|
|
169
|
+
"@edifice.io/client": "2.5.6",
|
|
170
|
+
"@edifice.io/config": "2.5.6"
|
|
172
171
|
},
|
|
173
172
|
"peerDependencies": {
|
|
174
173
|
"@react-spring/web": "^9.7.5",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* A divider component that renders a horizontal or vertical line to separate content.
|
|
4
|
-
*
|
|
5
|
-
* @param props - The component props
|
|
6
|
-
* @param props.children - Content to be displayed inside the divider
|
|
7
|
-
* @param props.vertical - Whether the divider is vertical. Defaults to false
|
|
8
|
-
* @param props.className - Optional CSS class name for additional styling of the divider
|
|
9
|
-
* @default 'border-gray-500'
|
|
10
|
-
* @param props.style - Optional inline styles for the divider
|
|
11
|
-
*
|
|
12
|
-
* @returns A React component that renders a divider with the specified properties
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```tsx
|
|
16
|
-
* // Basic horizontal divider
|
|
17
|
-
* <Divider />
|
|
18
|
-
*
|
|
19
|
-
* // Divider with text content
|
|
20
|
-
* <Divider>Section Title</Divider>
|
|
21
|
-
*
|
|
22
|
-
* // Vertical divider
|
|
23
|
-
* <Divider vertical />
|
|
24
|
-
*
|
|
25
|
-
* // Custom colored divider
|
|
26
|
-
* <Divider className="border-red-500" />
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
declare const Divider: {
|
|
30
|
-
({ children, vertical, className, style, }: {
|
|
31
|
-
children?: ReactNode;
|
|
32
|
-
vertical?: boolean;
|
|
33
|
-
className?: string;
|
|
34
|
-
style?: React.CSSProperties;
|
|
35
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
36
|
-
displayName: string;
|
|
37
|
-
};
|
|
38
|
-
export default Divider;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Divider as Divider$1 } from "antd";
|
|
3
|
-
const Divider = ({
|
|
4
|
-
children,
|
|
5
|
-
vertical = !1,
|
|
6
|
-
className = "border-gray-500",
|
|
7
|
-
style
|
|
8
|
-
}) => /* @__PURE__ */ jsx(Divider$1, { plain: !0, children, type: vertical ? "vertical" : "horizontal", className, orientation: "center", style });
|
|
9
|
-
export {
|
|
10
|
-
Divider as default
|
|
11
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Simple option for SegmentedControl
|
|
3
|
-
*/
|
|
4
|
-
export interface SegmentedOption {
|
|
5
|
-
/**
|
|
6
|
-
* Option label
|
|
7
|
-
*/
|
|
8
|
-
label: string;
|
|
9
|
-
/**
|
|
10
|
-
* Option value
|
|
11
|
-
*/
|
|
12
|
-
value: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* SegmentedControl component props
|
|
16
|
-
*
|
|
17
|
-
* Minimal interface that only exposes what is necessary.
|
|
18
|
-
* Ant Design implementation is hidden and no Ant Design-specific props are exposed.
|
|
19
|
-
* Standard HTML div attributes are supported (passed through to the underlying DOM element).
|
|
20
|
-
*/
|
|
21
|
-
export interface SegmentedControlProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
22
|
-
/**
|
|
23
|
-
* Segmented control options
|
|
24
|
-
*/
|
|
25
|
-
options: SegmentedOption[];
|
|
26
|
-
/**
|
|
27
|
-
* Selected value
|
|
28
|
-
*/
|
|
29
|
-
value?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Callback called when value changes
|
|
32
|
-
*/
|
|
33
|
-
onChange?: (value: string) => void;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* SegmentedControl component
|
|
37
|
-
*
|
|
38
|
-
* Segmented control component for selecting between multiple options.
|
|
39
|
-
*
|
|
40
|
-
* **Note:** This component uses Ant Design's Segmented component internally.
|
|
41
|
-
* Only the props defined in SegmentedControlProps are allowed to prevent
|
|
42
|
-
* dependency on Ant Design-specific features. To replace the implementation,
|
|
43
|
-
* modify the component body below.
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```tsx
|
|
47
|
-
* <SegmentedControl
|
|
48
|
-
* options={[
|
|
49
|
-
* { label: 'List', value: 'list' },
|
|
50
|
-
* { label: 'Kanban', value: 'kanban' },
|
|
51
|
-
* { label: 'Table', value: 'table' }
|
|
52
|
-
* ]}
|
|
53
|
-
* value={value}
|
|
54
|
-
* onChange={(val) => setValue(val)}
|
|
55
|
-
* />
|
|
56
|
-
* ```
|
|
57
|
-
*/
|
|
58
|
-
declare const SegmentedControl: import('react').ForwardRefExoticComponent<SegmentedControlProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
59
|
-
export default SegmentedControl;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { Segmented } from "antd";
|
|
4
|
-
const SegmentedControl = /* @__PURE__ */ forwardRef(({
|
|
5
|
-
options,
|
|
6
|
-
value,
|
|
7
|
-
onChange,
|
|
8
|
-
...htmlProps
|
|
9
|
-
}, ref) => {
|
|
10
|
-
const antProps = {
|
|
11
|
-
options,
|
|
12
|
-
value,
|
|
13
|
-
onChange,
|
|
14
|
-
ref,
|
|
15
|
-
...htmlProps
|
|
16
|
-
};
|
|
17
|
-
return /* @__PURE__ */ jsx(Segmented, { ...antProps });
|
|
18
|
-
});
|
|
19
|
-
export {
|
|
20
|
-
SegmentedControl as default
|
|
21
|
-
};
|