@edifice.io/react 2.5.2-develop-integration.20251204110744 → 2.5.2-develop-b2school-actualites.20251205092254
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 +1 -0
- package/dist/components/Divider/Divider.d.ts +5 -0
- package/dist/components/Divider/Divider.js +21 -0
- package/dist/components/Divider/index.d.ts +1 -0
- package/dist/components/Flex/Flex.js +1 -1
- package/dist/components/Menu/components/MenuButton.d.ts +2 -0
- package/dist/components/Menu/components/MenuButton.js +13 -4
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +65 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +21 -0
- package/dist/components/SegmentedControl/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +6 -2
- package/dist/components/Select/Select.js +10 -4
- package/dist/components/SeparatedInfo/SeparatedInfo.d.ts +6 -0
- package/dist/components/SeparatedInfo/SeparatedInfo.js +13 -0
- package/dist/components/SeparatedInfo/index.d.ts +1 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/editor.js +40 -36
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useInfiniteScroll/index.d.ts +1 -0
- package/dist/hooks/useInfiniteScroll/useInfiniteScroll.d.ts +33 -0
- package/dist/hooks/useInfiniteScroll/useInfiniteScroll.js +20 -0
- package/dist/icons-apps.js +232 -234
- package/dist/icons.js +262 -262
- package/dist/index.js +146 -134
- package/dist/modals.js +8 -6
- package/dist/modules/comments/components/Comment.js +5 -3
- package/dist/modules/comments/components/CommentList.js +1 -1
- package/dist/modules/comments/components/DeleteModal.js +14 -8
- package/dist/modules/comments/constants.d.ts +4 -1
- package/dist/modules/comments/constants.js +2 -2
- package/dist/modules/comments/provider/CommentProvider.js +2 -2
- package/dist/modules/comments/types.d.ts +2 -2
- 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/icons/components/IconClockAlert.d.ts +7 -0
- package/dist/modules/icons/components/IconClockAlert.js +17 -0
- package/dist/modules/icons/components/apps/index.d.ts +0 -1
- package/dist/modules/icons/components/index.d.ts +1 -1
- package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +0 -1
- package/dist/modules/modals/ResourceModal/ResourceModal.js +3 -10
- package/dist/modules/modals/ShareModal/ShareBookmark.d.ts +1 -1
- package/dist/modules/modals/ShareModal/ShareBookmark.js +5 -2
- package/dist/modules/modals/ShareModal/ShareModal.d.ts +1 -11
- package/dist/modules/modals/ShareModal/ShareModal.js +13 -105
- package/dist/modules/modals/ShareModal/ShareResources.d.ts +173 -0
- package/dist/modules/modals/ShareModal/ShareResources.js +137 -0
- package/dist/modules/modals/ShareModal/hooks/useSearch.d.ts +2 -1
- package/dist/modules/modals/ShareModal/hooks/useSearch.js +3 -2
- package/dist/modules/modals/ShareModal/hooks/useShare.d.ts +12 -5
- package/dist/modules/modals/ShareModal/hooks/useShare.js +20 -13
- 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 +3 -1
- package/dist/style.css +1 -1
- package/dist/utilities/index.d.ts +1 -0
- package/dist/utilities/react-query/index.d.ts +1 -0
- package/dist/utilities/react-query/react-query-utils.d.ts +21 -0
- package/dist/utilities/react-query/react-query-utils.js +13 -0
- package/package.json +8 -7
- package/dist/modules/icons/components/IconUndoSlashed.d.ts +0 -7
- package/dist/modules/icons/components/IconUndoSlashed.js +0 -12
- package/dist/modules/icons/components/apps/IconAssistancetic.d.ts +0 -7
- package/dist/modules/icons/components/apps/IconAssistancetic.js +0 -14
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useState, useImperativeHandle, useEffect } from "react";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import SvgIconBookmark from "../../icons/components/IconBookmark.js";
|
|
5
|
+
import SvgIconInfoCircle from "../../icons/components/IconInfoCircle.js";
|
|
6
|
+
import SvgIconRafterDown from "../../icons/components/IconRafterDown.js";
|
|
7
|
+
import { ShareBookmark } from "./ShareBookmark.js";
|
|
8
|
+
import { ShareBookmarkLine } from "./ShareBookmarkLine.js";
|
|
9
|
+
import { useSearch } from "./hooks/useSearch.js";
|
|
10
|
+
import useShare from "./hooks/useShare.js";
|
|
11
|
+
import { useShareBookmark } from "./hooks/useShareBookmark.js";
|
|
12
|
+
import Heading from "../../../components/Heading/Heading.js";
|
|
13
|
+
import Tooltip from "../../../components/Tooltip/Tooltip.js";
|
|
14
|
+
import Combobox from "../../../components/Combobox/Combobox.js";
|
|
15
|
+
import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
|
|
16
|
+
import VisuallyHidden from "../../../components/VisuallyHidden/VisuallyHidden.js";
|
|
17
|
+
import Avatar from "../../../components/Avatar/Avatar.js";
|
|
18
|
+
import Checkbox from "../../../components/Checkbox/Checkbox.js";
|
|
19
|
+
import Button from "../../../components/Button/Button.js";
|
|
20
|
+
const ShareResources = /* @__PURE__ */ forwardRef(({
|
|
21
|
+
shareOptions,
|
|
22
|
+
shareResource,
|
|
23
|
+
onSuccess = () => {
|
|
24
|
+
},
|
|
25
|
+
onChange = () => {
|
|
26
|
+
},
|
|
27
|
+
onSubmit = () => {
|
|
28
|
+
},
|
|
29
|
+
classNameSearchInput = "col-6"
|
|
30
|
+
}, ref) => {
|
|
31
|
+
const {
|
|
32
|
+
resourceId,
|
|
33
|
+
resourceCreatorId,
|
|
34
|
+
resourceRights,
|
|
35
|
+
filteredActions,
|
|
36
|
+
shareUrls
|
|
37
|
+
} = shareOptions, [isLoading, setIsLoading] = useState(!0), [isSavingBookmark, setIsSavingBookmark] = useState(!1), {
|
|
38
|
+
state: {
|
|
39
|
+
isSharing,
|
|
40
|
+
shareRights,
|
|
41
|
+
shareRightActions
|
|
42
|
+
},
|
|
43
|
+
dispatch: shareDispatch,
|
|
44
|
+
myAvatar,
|
|
45
|
+
currentIsAuthor,
|
|
46
|
+
toggleRight,
|
|
47
|
+
handleShare,
|
|
48
|
+
handleDeleteRow,
|
|
49
|
+
isDirty
|
|
50
|
+
} = useShare({
|
|
51
|
+
resourceId,
|
|
52
|
+
resourceCreatorId,
|
|
53
|
+
resourceRights,
|
|
54
|
+
shareResource,
|
|
55
|
+
setIsLoading,
|
|
56
|
+
onSuccess,
|
|
57
|
+
filteredActions,
|
|
58
|
+
shareUrls
|
|
59
|
+
}), {
|
|
60
|
+
state: {
|
|
61
|
+
searchResults,
|
|
62
|
+
searchInputValue
|
|
63
|
+
},
|
|
64
|
+
showSearchAdmlHint,
|
|
65
|
+
showSearchLoading,
|
|
66
|
+
showSearchNoResults,
|
|
67
|
+
getSearchMinLength,
|
|
68
|
+
handleSearchInputChange,
|
|
69
|
+
handleSearchResultsChange
|
|
70
|
+
} = useSearch({
|
|
71
|
+
resourceId,
|
|
72
|
+
resourceCreatorId,
|
|
73
|
+
shareRights,
|
|
74
|
+
shareDispatch,
|
|
75
|
+
urlResourceRights: shareUrls == null ? void 0 : shareUrls.getResourceRights
|
|
76
|
+
}), {
|
|
77
|
+
refBookmark,
|
|
78
|
+
showBookmark,
|
|
79
|
+
handleBookmarkChange,
|
|
80
|
+
toggleBookmark,
|
|
81
|
+
bookmark,
|
|
82
|
+
handleOnSave,
|
|
83
|
+
showBookmarkInput,
|
|
84
|
+
toggleBookmarkInput
|
|
85
|
+
} = useShareBookmark({
|
|
86
|
+
shareRights,
|
|
87
|
+
shareDispatch
|
|
88
|
+
}), handleOnSaveBookmark = () => (setIsSavingBookmark(!0), handleOnSave().then(() => {
|
|
89
|
+
setIsSavingBookmark(!1);
|
|
90
|
+
}));
|
|
91
|
+
useImperativeHandle(ref, () => ({
|
|
92
|
+
handleShare
|
|
93
|
+
}), [handleShare]), useEffect(() => {
|
|
94
|
+
onChange(shareRights.rights, isDirty);
|
|
95
|
+
}, [isDirty, shareRights.rights, onChange]), useEffect(() => {
|
|
96
|
+
(isSavingBookmark || isSharing) && onSubmit();
|
|
97
|
+
}, [isSavingBookmark, isSharing, onSubmit]);
|
|
98
|
+
const {
|
|
99
|
+
t
|
|
100
|
+
} = useTranslation(), searchPlaceholder = showSearchAdmlHint() ? t("explorer.search.adml.hint") : t("explorer.modal.share.search.placeholder");
|
|
101
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
102
|
+
/* @__PURE__ */ jsxs(Heading, { headingStyle: "h4", level: "h3", className: "mb-16 d-flex align-items-center", children: [
|
|
103
|
+
/* @__PURE__ */ jsx("div", { className: "me-8", children: t("explorer.modal.share.search") }),
|
|
104
|
+
/* @__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" }) })
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ jsx("div", { className: "row mb-16", children: /* @__PURE__ */ jsx("div", { className: classNameSearchInput, children: /* @__PURE__ */ jsx(Combobox, { value: searchInputValue, placeholder: searchPlaceholder, isLoading: showSearchLoading(), noResult: showSearchNoResults(), options: searchResults, searchMinLength: getSearchMinLength(), onSearchInputChange: handleSearchInputChange, onSearchResultsChange: handleSearchResultsChange }) }) }),
|
|
107
|
+
/* @__PURE__ */ jsx("div", { className: "table-responsive", children: isLoading ? /* @__PURE__ */ jsx(LoadingScreen, {}) : /* @__PURE__ */ jsxs("table", { className: "table border align-middle mb-0 rounded-3", children: [
|
|
108
|
+
/* @__PURE__ */ jsx("thead", { className: "bg-blue-200", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
109
|
+
/* @__PURE__ */ jsx("th", { scope: "col", className: "w-32", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("explorer.modal.share.avatar.shared.alt") }) }),
|
|
110
|
+
/* @__PURE__ */ jsx("th", { scope: "col", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("explorer.modal.share.search.placeholder") }) }),
|
|
111
|
+
shareRightActions.map((shareRightAction) => /* @__PURE__ */ jsx("th", { scope: "col", className: "text-center text-gray-800", children: t(shareRightAction.displayName) }, shareRightAction.displayName)),
|
|
112
|
+
/* @__PURE__ */ jsx("th", { scope: "col", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("close") }) })
|
|
113
|
+
] }) }),
|
|
114
|
+
/* @__PURE__ */ jsxs("tbody", { children: [
|
|
115
|
+
currentIsAuthor() && /* @__PURE__ */ jsxs("tr", { children: [
|
|
116
|
+
/* @__PURE__ */ jsx("th", { scope: "row", children: /* @__PURE__ */ jsx(Avatar, { alt: t("explorer.modal.share.avatar.me.alt"), size: "xs", src: myAvatar, variant: "circle" }) }),
|
|
117
|
+
/* @__PURE__ */ jsx("td", { children: t("share.me") }),
|
|
118
|
+
shareRightActions.map((shareRightAction) => /* @__PURE__ */ jsx("td", { style: {
|
|
119
|
+
width: "80px"
|
|
120
|
+
}, className: "text-center text-white", children: /* @__PURE__ */ jsx(Checkbox, { checked: !0, disabled: !0 }) }, shareRightAction.displayName)),
|
|
121
|
+
/* @__PURE__ */ jsx("td", {})
|
|
122
|
+
] }),
|
|
123
|
+
/* @__PURE__ */ jsx(ShareBookmarkLine, { showBookmark, shareRightActions, shareRights, onDeleteRow: handleDeleteRow, toggleRight, toggleBookmark })
|
|
124
|
+
] })
|
|
125
|
+
] }) }),
|
|
126
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-16", children: [
|
|
127
|
+
/* @__PURE__ */ jsx(Button, { color: "tertiary", leftIcon: /* @__PURE__ */ jsx(SvgIconBookmark, {}), rightIcon: /* @__PURE__ */ jsx(SvgIconRafterDown, { title: t("show"), className: "w-16 min-w-0", style: {
|
|
128
|
+
transition: "rotate 0.2s ease-out",
|
|
129
|
+
rotate: showBookmarkInput ? "-180deg" : "0deg"
|
|
130
|
+
} }), type: "button", variant: "ghost", className: "fw-normal", onClick: () => toggleBookmarkInput(!showBookmarkInput), children: t("share.save.sharebookmark") }),
|
|
131
|
+
showBookmarkInput && /* @__PURE__ */ jsx(ShareBookmark, { refBookmark, bookmark, onBookmarkChange: handleBookmarkChange, onSave: handleOnSaveBookmark })
|
|
132
|
+
] })
|
|
133
|
+
] });
|
|
134
|
+
});
|
|
135
|
+
export {
|
|
136
|
+
ShareResources as default
|
|
137
|
+
};
|
|
@@ -3,11 +3,12 @@ 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, urlResourceRights, }: {
|
|
7
7
|
resourceId: ShareOptions["resourceCreatorId"];
|
|
8
8
|
resourceCreatorId: ShareOptions["resourceCreatorId"];
|
|
9
9
|
shareRights: ShareRightWithVisibles;
|
|
10
10
|
shareDispatch: Dispatch<ShareAction>;
|
|
11
|
+
urlResourceRights?: string;
|
|
11
12
|
}) => {
|
|
12
13
|
state: {
|
|
13
14
|
searchInputValue: string;
|
|
@@ -58,7 +58,8 @@ const defaultActions = [{
|
|
|
58
58
|
resourceId,
|
|
59
59
|
resourceCreatorId,
|
|
60
60
|
shareRights,
|
|
61
|
-
shareDispatch
|
|
61
|
+
shareDispatch,
|
|
62
|
+
urlResourceRights
|
|
62
63
|
}) => {
|
|
63
64
|
const [state, dispatch] = useReducer(reducer, initialState), debouncedSearchInputValue = useDebounce(state.searchInputValue, 500), {
|
|
64
65
|
isAdml
|
|
@@ -82,7 +83,7 @@ const defaultActions = [{
|
|
|
82
83
|
type: "isSearching",
|
|
83
84
|
payload: !0
|
|
84
85
|
}), !isAdml && debouncedSearchInputValue2.length >= 1 || isAdml && debouncedSearchInputValue2.length >= 3) {
|
|
85
|
-
const resSearchShareSubjects = await odeServices.share().searchShareSubjects(appCode, resourceId, debouncedSearchInputValue2);
|
|
86
|
+
const resSearchShareSubjects = await odeServices.share().searchShareSubjects(appCode, resourceId, debouncedSearchInputValue2, urlResourceRights);
|
|
86
87
|
dispatch({
|
|
87
88
|
type: "addApiResult",
|
|
88
89
|
payload: resSearchShareSubjects
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ShareRight, ShareRightAction, ShareRightActionDisplayName, ShareRightWithVisibles } from '@edifice.io/client';
|
|
2
|
-
import { ShareOptions, ShareResourceMutation } from '../
|
|
1
|
+
import { ShareRight, ShareRightAction, ShareRightActionDisplayName, ShareRightWithVisibles, ShareUrls } from '@edifice.io/client';
|
|
2
|
+
import { ShareOptions, ShareResourceMutation } from '../ShareResources';
|
|
3
3
|
interface UseShareResourceModalProps {
|
|
4
4
|
/**
|
|
5
5
|
* Resource ID (assetId)
|
|
@@ -15,10 +15,15 @@ interface UseShareResourceModalProps {
|
|
|
15
15
|
resourceCreatorId: ShareOptions['resourceCreatorId'];
|
|
16
16
|
shareResource?: ShareResourceMutation;
|
|
17
17
|
onSuccess: () => void;
|
|
18
|
-
setIsLoading
|
|
18
|
+
setIsLoading?: (value: boolean) => void;
|
|
19
|
+
resourceShareRights?: ShareRightWithVisibles;
|
|
20
|
+
resourceShareRightActions?: ShareRightAction[];
|
|
21
|
+
filteredActions?: ShareRightActionDisplayName[];
|
|
22
|
+
shareUrls?: ShareUrls;
|
|
19
23
|
}
|
|
20
24
|
type State = {
|
|
21
25
|
isSharing: boolean;
|
|
26
|
+
isDirty?: boolean;
|
|
22
27
|
shareRights: ShareRightWithVisibles;
|
|
23
28
|
shareRightActions: ShareRightAction[];
|
|
24
29
|
};
|
|
@@ -38,9 +43,10 @@ export type ShareAction = {
|
|
|
38
43
|
type: 'isSharing';
|
|
39
44
|
payload: boolean;
|
|
40
45
|
};
|
|
41
|
-
export default function useShare({ resourceId, resourceRights, resourceCreatorId, shareResource, setIsLoading, onSuccess, }: UseShareResourceModalProps): {
|
|
46
|
+
export default function useShare({ resourceId, resourceRights, resourceCreatorId, shareResource, setIsLoading, onSuccess, filteredActions, shareUrls, }: UseShareResourceModalProps): {
|
|
42
47
|
state: {
|
|
43
48
|
isSharing: boolean;
|
|
49
|
+
isDirty?: boolean;
|
|
44
50
|
shareRights: ShareRightWithVisibles;
|
|
45
51
|
shareRightActions: ShareRightAction[];
|
|
46
52
|
};
|
|
@@ -48,7 +54,8 @@ export default function useShare({ resourceId, resourceRights, resourceCreatorId
|
|
|
48
54
|
currentIsAuthor: () => boolean;
|
|
49
55
|
myAvatar: string;
|
|
50
56
|
handleDeleteRow: (shareRight: ShareRight) => void;
|
|
51
|
-
handleShare: () => Promise<void>;
|
|
57
|
+
handleShare: (notify?: boolean) => Promise<void>;
|
|
52
58
|
toggleRight: (shareRight: ShareRight, actionName: ShareRightActionDisplayName) => void;
|
|
59
|
+
isDirty: boolean;
|
|
53
60
|
};
|
|
54
61
|
export {};
|
|
@@ -6,6 +6,7 @@ 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,
|
|
9
10
|
shareRights: {
|
|
10
11
|
rights: [],
|
|
11
12
|
visibleBookmarks: [],
|
|
@@ -24,17 +25,20 @@ function reducer(state, action) {
|
|
|
24
25
|
case "deleteRow":
|
|
25
26
|
return {
|
|
26
27
|
...state,
|
|
27
|
-
shareRights: action.payload
|
|
28
|
+
shareRights: action.payload,
|
|
29
|
+
isDirty: !0
|
|
28
30
|
};
|
|
29
31
|
case "updateShareRights":
|
|
30
32
|
return {
|
|
31
33
|
...state,
|
|
32
|
-
shareRights: action.payload
|
|
34
|
+
shareRights: action.payload,
|
|
35
|
+
isDirty: !0
|
|
33
36
|
};
|
|
34
37
|
case "toggleRight":
|
|
35
38
|
return {
|
|
36
39
|
...state,
|
|
37
|
-
shareRights: action.payload
|
|
40
|
+
shareRights: action.payload,
|
|
41
|
+
isDirty: !0
|
|
38
42
|
};
|
|
39
43
|
case "isSharing":
|
|
40
44
|
return {
|
|
@@ -51,7 +55,9 @@ function useShare({
|
|
|
51
55
|
resourceCreatorId,
|
|
52
56
|
shareResource,
|
|
53
57
|
setIsLoading,
|
|
54
|
-
onSuccess
|
|
58
|
+
onSuccess,
|
|
59
|
+
filteredActions,
|
|
60
|
+
shareUrls
|
|
55
61
|
}) {
|
|
56
62
|
const {
|
|
57
63
|
appCode
|
|
@@ -64,18 +70,18 @@ function useShare({
|
|
|
64
70
|
useEffect(() => {
|
|
65
71
|
resourceId && (async () => {
|
|
66
72
|
try {
|
|
67
|
-
const [shareRightActions, shareRights] = await Promise.all([odeServices.share().getActionsForApp(appCode), odeServices.share().getRightsForResource(appCode, resourceId)]);
|
|
73
|
+
const [shareRightActions, shareRights] = await Promise.all([odeServices.share().getActionsForApp(appCode, shareUrls == null ? void 0 : shareUrls.getShareMapping), odeServices.share().getRightsForResource(appCode, resourceId, shareUrls)]), filteredShareRightActions = filteredActions ? shareRightActions.filter((action) => filteredActions.includes(action.id)) : shareRightActions;
|
|
68
74
|
dispatch({
|
|
69
75
|
type: "init",
|
|
70
76
|
payload: {
|
|
71
|
-
shareRightActions,
|
|
77
|
+
shareRightActions: filteredShareRightActions,
|
|
72
78
|
shareRights
|
|
73
79
|
}
|
|
74
80
|
});
|
|
75
81
|
} catch (error) {
|
|
76
82
|
console.error(error);
|
|
77
83
|
}
|
|
78
|
-
setIsLoading(!1);
|
|
84
|
+
setIsLoading == null || setIsLoading(!1);
|
|
79
85
|
})();
|
|
80
86
|
}, [resourceId]);
|
|
81
87
|
const toggleRight = (shareRight, actionName) => {
|
|
@@ -143,7 +149,7 @@ function useShare({
|
|
|
143
149
|
}
|
|
144
150
|
});
|
|
145
151
|
},
|
|
146
|
-
handleShare: async () => {
|
|
152
|
+
handleShare: async (notify = !0) => {
|
|
147
153
|
dispatch({
|
|
148
154
|
type: "isSharing",
|
|
149
155
|
payload: !0
|
|
@@ -169,12 +175,12 @@ function useShare({
|
|
|
169
175
|
resourceId,
|
|
170
176
|
rights: shares
|
|
171
177
|
});
|
|
172
|
-
notifySuccess(result);
|
|
178
|
+
notify && notifySuccess(result);
|
|
173
179
|
} else {
|
|
174
|
-
const result = await odeServices.share().saveRights(appCode, resourceId, shares);
|
|
175
|
-
notifySuccess(result);
|
|
180
|
+
const result = await odeServices.share().saveRights(appCode, resourceId, shares, shareUrls);
|
|
181
|
+
notify && notifySuccess(result);
|
|
176
182
|
}
|
|
177
|
-
onSuccess();
|
|
183
|
+
shareUrls != null && shareUrls.getResourceRights && odeServices.cache().clearCache(shareUrls.getResourceRights), onSuccess();
|
|
178
184
|
} catch (error) {
|
|
179
185
|
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);
|
|
180
186
|
} finally {
|
|
@@ -184,7 +190,8 @@ function useShare({
|
|
|
184
190
|
});
|
|
185
191
|
}
|
|
186
192
|
},
|
|
187
|
-
toggleRight
|
|
193
|
+
toggleRight,
|
|
194
|
+
isDirty: !!state.isDirty
|
|
188
195
|
};
|
|
189
196
|
}
|
|
190
197
|
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: () => void
|
|
19
|
+
handleOnSave: () => Promise<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
|
-
saveBookmark(inputValue);
|
|
59
|
+
return saveBookmark(inputValue);
|
|
60
60
|
},
|
|
61
61
|
toggleBookmark,
|
|
62
62
|
toggleBookmarkInput
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export { default as ShareModal } from './ShareModal';
|
|
2
1
|
export { default as ShareBlog } from './apps/ShareBlog';
|
|
3
2
|
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';
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
.segmented-control-wrapper.ant-segmented{border-radius:var(--edifice-border-radius-xl);--ant-segmented-track-padding: var(--edifice-spacer-4);--ant-control-height: var(--edifice-spacer-48);--ant-control-padding-horizontal: var(--edifice-spacer-8);--ant-line-width: var(--edifice-spacer-0);--ant-segmented-track-bg: var(--edifice-white);border:1px solid var(--edifice-secondary-200)}.segmented-control-wrapper.ant-segmented .ant-segmented-group{gap:var(--edifice-spacer-4)}.segmented-control-wrapper.ant-segmented .ant-segmented-item{border-radius:var(--edifice-border-radius-lg);--ant-segmented-item-color: var(--edifice-body-color)}.segmented-control-wrapper.ant-segmented .ant-segmented-item:hover{--ant-segmented-item-hover-color:var(--edifice-body-color);--ant-segmented-item-hover-bg: var(--edifice-gray-300)}.segmented-control-wrapper.ant-segmented .ant-segmented-item-selected{--ant-segmented-item-selected-bg: var(--edifice-secondary-200);--ant-segmented-item-selected-color: var(--edifice-body-color);box-shadow:none}.segmented-control-wrapper.ant-segmented .ant-segmented-thumb{--ant-segmented-item-selected-bg: var(--edifice-secondary-200);box-shadow:none;border-radius:var(--edifice-border-radius-lg)}:root .edifice{--ant-border-radius: var(--edifice-border-radius)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './react-query-utils';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InvalidateQueryFilters, QueryClient } from '../../node_modules/@tanstack/react-query';
|
|
2
|
+
/**
|
|
3
|
+
* Invalidates queries and resets infinite query data to only contain the first page.
|
|
4
|
+
*
|
|
5
|
+
* This utility function is useful when you want to invalidate a query but also ensure
|
|
6
|
+
* that any infinite query data is reset to show only the first page, removing any
|
|
7
|
+
* previously loaded subsequent pages.
|
|
8
|
+
*
|
|
9
|
+
* @param queryClient - The TanStack Query client instance used to manage queries
|
|
10
|
+
* @param options - The invalidate query filters that specify which queries to invalidate
|
|
11
|
+
* @returns The result of the invalidateQueries operation, or undefined if no queryKey is provided
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* // Invalidate user queries and reset to first page only
|
|
16
|
+
* invalidateQueriesWithFirstPage(queryClient, {
|
|
17
|
+
* queryKey: ['users']
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function invalidateQueriesWithFirstPage(queryClient: QueryClient, options: InvalidateQueryFilters): Promise<void> | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function invalidateQueriesWithFirstPage(queryClient, options) {
|
|
2
|
+
if (options.queryKey)
|
|
3
|
+
return queryClient.setQueriesData({
|
|
4
|
+
queryKey: options.queryKey
|
|
5
|
+
}, (oldData) => oldData != null && oldData.pages ? {
|
|
6
|
+
...oldData,
|
|
7
|
+
pages: [oldData.pages[0]],
|
|
8
|
+
pageParams: [oldData.pageParams[0]]
|
|
9
|
+
} : oldData), queryClient.invalidateQueries(options);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
invalidateQueriesWithFirstPage
|
|
13
|
+
};
|
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-b2school-actualites.20251205092254",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -65,7 +65,8 @@
|
|
|
65
65
|
"./widgets": {
|
|
66
66
|
"import": "./dist/widgets.js",
|
|
67
67
|
"types": "./dist/modules/widgets/index.d.ts"
|
|
68
|
-
}
|
|
68
|
+
},
|
|
69
|
+
"./dist/style.css": "./dist/style.css"
|
|
69
70
|
},
|
|
70
71
|
"module": "dist/index.js",
|
|
71
72
|
"types": "dist/index.d.ts",
|
|
@@ -133,9 +134,9 @@
|
|
|
133
134
|
"react-slugify": "^3.0.3",
|
|
134
135
|
"swiper": "^10.1.0",
|
|
135
136
|
"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-
|
|
137
|
+
"@edifice.io/bootstrap": "2.5.2-develop-b2school-actualites.20251205092254",
|
|
138
|
+
"@edifice.io/tiptap-extensions": "2.5.2-develop-b2school-actualites.20251205092254",
|
|
139
|
+
"@edifice.io/utilities": "2.5.2-develop-b2school-actualites.20251205092254"
|
|
139
140
|
},
|
|
140
141
|
"devDependencies": {
|
|
141
142
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -166,8 +167,8 @@
|
|
|
166
167
|
"vite": "^5.4.11",
|
|
167
168
|
"vite-plugin-dts": "^4.1.0",
|
|
168
169
|
"vite-tsconfig-paths": "^5.0.1",
|
|
169
|
-
"@edifice.io/
|
|
170
|
-
"@edifice.io/
|
|
170
|
+
"@edifice.io/client": "2.5.2-develop-b2school-actualites.20251205092254",
|
|
171
|
+
"@edifice.io/config": "2.5.2-develop-b2school-actualites.20251205092254"
|
|
171
172
|
},
|
|
172
173
|
"peerDependencies": {
|
|
173
174
|
"@react-spring/web": "^9.7.5",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SVGProps } from 'react';
|
|
2
|
-
interface SVGRProps {
|
|
3
|
-
title?: string;
|
|
4
|
-
titleId?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgIconUndoSlashed: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgIconUndoSlashed;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
const SvgIconUndoSlashed = ({
|
|
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__ */ jsx("path", { fill: "currentColor", d: "M19.775 8.466A5 5 0 0 1 22 12.625V21a1 1 0 0 1-2 0v-8.375c0-1.186-.69-2.208-1.689-2.695zM7.918 2.293a1 1 0 1 1 1.414 1.414L5.414 7.625h6.719l-2 2H5.414l2.36 2.36-1.415 1.414-4.066-4.067a1 1 0 0 1 0-1.414zM20.293 2.293a1 1 0 1 1 1.414 1.414l-17 17a1 1 0 1 1-1.414-1.414z" })
|
|
9
|
-
] });
|
|
10
|
-
export {
|
|
11
|
-
SvgIconUndoSlashed as default
|
|
12
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SVGProps } from 'react';
|
|
2
|
-
interface SVGRProps {
|
|
3
|
-
title?: string;
|
|
4
|
-
titleId?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgIconAssistancetic: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgIconAssistancetic;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
const SvgIconAssistancetic = ({
|
|
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 60 60", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
|
|
7
|
-
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
8
|
-
/* @__PURE__ */ jsx("path", { fill: "#ECBE30", d: "M0 8a8 8 0 0 1 8-8h44a8 8 0 0 1 8 8v44a8 8 0 0 1-8 8H8a8 8 0 0 1-8-8z" }),
|
|
9
|
-
/* @__PURE__ */ jsx("path", { fill: "#fff", fillRule: "evenodd", d: "M30 22.667c1.013 0 1.833.82 1.833 1.833v9.167a1.833 1.833 0 0 1-3.666 0V24.5c0-1.012.82-1.833 1.833-1.833M28.167 40.083c0-1.012.82-1.833 1.833-1.833h.018a1.833 1.833 0 0 1 0 3.667H30a1.833 1.833 0 0 1-1.833-1.834", clipRule: "evenodd" }),
|
|
10
|
-
/* @__PURE__ */ jsx("path", { fill: "#fff", fillRule: "evenodd", d: "M26.787 11.87c1.393-2.532 5.033-2.532 6.426 0L50.279 42.9c1.344 2.443-.424 5.433-3.213 5.433H12.934c-2.789 0-4.557-2.99-3.213-5.433zm20.28 32.796L30 13.638l-17.066 31.03z", clipRule: "evenodd" })
|
|
11
|
-
] });
|
|
12
|
-
export {
|
|
13
|
-
SvgIconAssistancetic as default
|
|
14
|
-
};
|