@edifice.io/react 2.4.2-develop-b2school-actualites.20251126112549 → 2.4.2-develop-pedago.20251126113601

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.
Files changed (58) hide show
  1. package/dist/components/AppIcon/index.d.ts +0 -1
  2. package/dist/components/Flex/Flex.js +1 -1
  3. package/dist/components/Menu/components/MenuButton.d.ts +0 -2
  4. package/dist/components/Menu/components/MenuButton.js +4 -13
  5. package/dist/components/Select/Select.d.ts +2 -6
  6. package/dist/components/Select/Select.js +4 -10
  7. package/dist/components/index.d.ts +0 -2
  8. package/dist/editor.js +36 -40
  9. package/dist/hooks/index.d.ts +0 -1
  10. package/dist/icons.js +292 -294
  11. package/dist/index.js +74 -84
  12. package/dist/modals.js +6 -8
  13. package/dist/modules/comments/components/Comment.js +3 -5
  14. package/dist/modules/comments/components/CommentList.js +1 -1
  15. package/dist/modules/comments/constants.d.ts +0 -4
  16. package/dist/modules/comments/constants.js +1 -2
  17. package/dist/modules/comments/hooks/useProfileQueries.js +2 -1
  18. package/dist/modules/comments/provider/CommentProvider.js +1 -2
  19. package/dist/modules/comments/types.d.ts +0 -4
  20. package/dist/modules/editor/components/Editor/index.d.ts +0 -2
  21. package/dist/modules/editor/components/Renderer/MediaRenderer.js +2 -2
  22. package/dist/modules/icons/components/index.d.ts +0 -1
  23. package/dist/modules/modals/ShareModal/ShareBookmark.d.ts +1 -1
  24. package/dist/modules/modals/ShareModal/ShareBookmark.js +2 -5
  25. package/dist/modules/modals/ShareModal/ShareModal.d.ts +11 -1
  26. package/dist/modules/modals/ShareModal/ShareModal.js +105 -13
  27. package/dist/modules/modals/ShareModal/hooks/useSearch.d.ts +1 -2
  28. package/dist/modules/modals/ShareModal/hooks/useSearch.js +2 -3
  29. package/dist/modules/modals/ShareModal/hooks/useShare.d.ts +5 -12
  30. package/dist/modules/modals/ShareModal/hooks/useShare.js +13 -20
  31. package/dist/modules/modals/ShareModal/hooks/useShareBookmark.d.ts +1 -1
  32. package/dist/modules/modals/ShareModal/hooks/useShareBookmark.js +1 -1
  33. package/dist/modules/modals/ShareModal/index.d.ts +1 -3
  34. package/dist/modules/multimedia/FileCard/FileCard.js +1 -1
  35. package/dist/modules/multimedia/FileCard/FileIcon.js +1 -1
  36. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +4 -1
  37. package/dist/utilities/index.d.ts +0 -1
  38. package/package.json +6 -6
  39. package/dist/components/Divider/Divider.d.ts +0 -5
  40. package/dist/components/Divider/Divider.js +0 -21
  41. package/dist/components/Divider/index.d.ts +0 -1
  42. package/dist/components/SeparatedInfo/SeparatedInfo.d.ts +0 -6
  43. package/dist/components/SeparatedInfo/SeparatedInfo.js +0 -13
  44. package/dist/components/SeparatedInfo/index.d.ts +0 -1
  45. package/dist/hooks/useInfiniteScroll/index.d.ts +0 -1
  46. package/dist/hooks/useInfiniteScroll/useInfiniteScroll.d.ts +0 -33
  47. package/dist/hooks/useInfiniteScroll/useInfiniteScroll.js +0 -20
  48. package/dist/modules/editor/components/Editor/EditorPreview.d.ts +0 -14
  49. package/dist/modules/editor/components/Editor/EditorPreview.js +0 -56
  50. package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.d.ts +0 -8
  51. package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.js +0 -24
  52. package/dist/modules/icons/components/IconClockAlert.d.ts +0 -7
  53. package/dist/modules/icons/components/IconClockAlert.js +0 -17
  54. package/dist/modules/modals/ShareModal/ShareResources.d.ts +0 -164
  55. package/dist/modules/modals/ShareModal/ShareResources.js +0 -133
  56. package/dist/utilities/react-query/index.d.ts +0 -1
  57. package/dist/utilities/react-query/react-query-utils.d.ts +0 -21
  58. package/dist/utilities/react-query/react-query-utils.js +0 -13
@@ -1,164 +0,0 @@
1
- import { ID, PutShareResponse, RightStringified, ShareRight, ShareRightActionDisplayName, ShareUrls } from '@edifice.io/client';
2
- import { UseMutationResult } from '../../../node_modules/@tanstack/react-query';
3
- /**
4
- * Configuration options for sharing a resource
5
- *
6
- * @typedef {Object} ShareOptions
7
- * @property {ID} resourceId - Unique identifier of the resource to share
8
- * @property {RightStringified[]} resourceRights - Current rights assigned to the resource
9
- * @property {string} resourceCreatorId - User ID of the resource creator
10
- * @property {ShareRightActionDisplayName[]} [filteredActions] - Optional list of allowed actions to display
11
- * @property {ShareUrls} [urls] - Optional custom URLs for API endpoints related to sharing operations
12
- *
13
- * @example Example related to sharing thread resources:
14
- * ```ts
15
- * const shareOptions: ShareOptions = {
16
- * resourceId: '12345',
17
- * resourceRights: [],
18
- * resourceCreatorId: 'user-67890',
19
- * filteredActions: ['read', 'contrib'],
20
- * urls: {
21
- * getResourceRights: '/api/V1/thread/shares', (get endpoint)
22
- * saveResourceRights: '/api/V1/thread/shares', (put endpoint)
23
- * getShareMapping: '/api/V1/rights/sharing'
24
- * }
25
- * };
26
- * ```
27
- *
28
- * @example Example related to sharing info resources:
29
- * ```ts
30
- * const shareOptions: ShareOptions = {
31
- * resourceId: '12345',
32
- * resourceRights: [],
33
- * resourceCreatorId: 'user-67890',
34
- * filteredActions: ['read', 'contrib'],
35
- * urls: {
36
- * getResourceRights: '/api/V1/info/shares', (get endpoint)
37
- * saveResourceRights: '/api/V1/info/shares', (put endpoint)
38
- * getShareMapping: '/api/V1/rights/sharing'
39
- * }
40
- * };
41
- * ```
42
- */
43
- export type ShareOptions = {
44
- resourceId: ID;
45
- resourceRights: RightStringified[];
46
- resourceCreatorId: string;
47
- filteredActions?: ShareRightActionDisplayName[];
48
- urls?: ShareUrls;
49
- };
50
- /**
51
- * React Query mutation result for share operations
52
- *
53
- * @typedef {UseMutationResult<PutShareResponse, unknown, {resourceId: string; rights: ShareRight[]}, unknown>} ShareResourceMutation
54
- */
55
- export type ShareResourceMutation = UseMutationResult<PutShareResponse, unknown, {
56
- resourceId: string;
57
- rights: ShareRight[];
58
- }, unknown>;
59
- /**
60
- * Props for the ShareResources component
61
- *
62
- * @interface ShareResourceProps
63
- * @property {ShareOptions} shareOptions - Configuration for the resource being shared
64
- * @property {ShareResourceMutation} [shareResource] - Optional React Query mutation for optimistic UI updates
65
- * @property {() => void} [onSuccess] - Callback fired after successful share operation
66
- * @property {(shareRights: ShareRight[], isDirty: boolean) => void} [onChange] - Callback fired when share rights change
67
- * @property {string} [classNameSearchInput] - Optional CSS class for the search input wrapper (default: 'col-6')
68
- */
69
- interface ShareResourceProps {
70
- /**
71
- * Expect resourceId,
72
- * new rights array (replace shared array),
73
- * creatorId
74
- * of a resource */
75
- shareOptions: ShareOptions;
76
- /**
77
- * Use the `shareResource` props when you need to do Optimistic UI
78
- * otherwise ShareModal handles everything
79
- * Must use React Query */
80
- shareResource?: ShareResourceMutation;
81
- /**
82
- * onSuccess callback when a resource is successfully shared
83
- */
84
- onSuccess?: () => void;
85
- /**
86
- * Callback when share rights change
87
- */
88
- onChange?: (shareRights: ShareRight[], isDirty: boolean, isSaving: boolean) => void;
89
- /**
90
- * Optional className for the search input
91
- */
92
- classNameSearchInput?: string;
93
- }
94
- /**
95
- * Ref interface exposed by ShareResources component
96
- *
97
- * @interface ShareResourcesRef
98
- * @property {() => void} handleShare - Method to trigger the share operation
99
- * @property {() => boolean} isSharing - Method to check if sharing is in progress
100
- *
101
- * @example
102
- * ```tsx
103
- * const ref = useRef<ShareResourcesRef>(null);
104
- *
105
- * // Trigger share programmatically
106
- * ref.current?.handleShare();
107
- *
108
- * // Check sharing status
109
- * const sharing = ref.current?.isSharing();
110
- * ```
111
- */
112
- export interface ShareResourcesRef {
113
- handleShare: (notify?: boolean) => void;
114
- }
115
- /**
116
- * ShareResources Component
117
- *
118
- * A component for managing resource sharing permissions with users and groups.
119
- * Provides search functionality, bookmark management, and granular rights control.
120
- *
121
- * @example
122
- * ```tsx
123
- * import { useRef } from 'react';
124
- * import ShareResources, { ShareResourcesRef, ShareOptions } from './ShareResources';
125
- *
126
- * function MyComponent() {
127
- * const shareRef = useRef<ShareResourcesRef>(null);
128
- *
129
- * const shareOptions: ShareOptions = {
130
- * resourceId: '123',
131
- * resourceRights: [],
132
- * resourceCreatorId: 'user-456',
133
- * filteredActions: ['read', 'contrib'],
134
- * urls: {
135
- * getResourceRights: '/api/share/rights',
136
- * putResourceRights: '/api/share/update'
137
- * }
138
- * };
139
- *
140
- * const handleSave = () => {
141
- * if (shareRef.current) {
142
- * shareRef.current.handleShare();
143
- * }
144
- * };
145
- *
146
- * return (
147
- * <>
148
- * <ShareResources
149
- * ref={shareRef}
150
- * shareOptions={shareOptions}
151
- * onSuccess={() => console.log('Shared successfully')}
152
- * onChange={(rights, isDirty, isSaving) => console.log('Rights changed:', isDirty)}
153
- * />
154
- * <button onClick={handleSave}>Save Changes</button>
155
- * </>
156
- * );
157
- * }
158
- * ```
159
- *
160
- * @component
161
- * @forwardRef
162
- */
163
- declare const ShareResources: import('react').ForwardRefExoticComponent<ShareResourceProps & import('react').RefAttributes<ShareResourcesRef>>;
164
- export default ShareResources;
@@ -1,133 +0,0 @@
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
- classNameSearchInput = "col-6"
28
- }, ref) => {
29
- const {
30
- resourceId,
31
- resourceCreatorId,
32
- resourceRights,
33
- filteredActions,
34
- urls
35
- } = shareOptions, [isLoading, setIsLoading] = useState(!0), [isSavingBookmark, setIsSavingBookmark] = useState(!1), {
36
- state: {
37
- isSharing,
38
- shareRights,
39
- shareRightActions
40
- },
41
- dispatch: shareDispatch,
42
- myAvatar,
43
- currentIsAuthor,
44
- toggleRight,
45
- handleShare,
46
- handleDeleteRow,
47
- isDirty
48
- } = useShare({
49
- resourceId,
50
- resourceCreatorId,
51
- resourceRights,
52
- shareResource,
53
- setIsLoading,
54
- onSuccess,
55
- filteredActions,
56
- urls
57
- }), {
58
- state: {
59
- searchResults,
60
- searchInputValue
61
- },
62
- showSearchAdmlHint,
63
- showSearchLoading,
64
- showSearchNoResults,
65
- getSearchMinLength,
66
- handleSearchInputChange,
67
- handleSearchResultsChange
68
- } = useSearch({
69
- resourceId,
70
- resourceCreatorId,
71
- shareRights,
72
- shareDispatch,
73
- urlResourceRights: urls == null ? void 0 : urls.getResourceRights
74
- }), {
75
- refBookmark,
76
- showBookmark,
77
- handleBookmarkChange,
78
- toggleBookmark,
79
- bookmark,
80
- handleOnSave,
81
- showBookmarkInput,
82
- toggleBookmarkInput
83
- } = useShareBookmark({
84
- shareRights,
85
- shareDispatch
86
- }), handleOnSaveBookmark = () => (setIsSavingBookmark(!0), handleOnSave().then(() => {
87
- setIsSavingBookmark(!1);
88
- }));
89
- useImperativeHandle(ref, () => ({
90
- handleShare
91
- }), [handleShare]), useEffect(() => {
92
- onChange(shareRights.rights, isDirty, isSavingBookmark || isSharing);
93
- }, [isDirty, shareRights.rights, onChange, isSavingBookmark, isSharing]);
94
- const {
95
- t
96
- } = useTranslation(), searchPlaceholder = showSearchAdmlHint() ? t("explorer.search.adml.hint") : t("explorer.modal.share.search.placeholder");
97
- return /* @__PURE__ */ jsxs("div", { children: [
98
- /* @__PURE__ */ jsxs(Heading, { headingStyle: "h4", level: "h3", className: "mb-16 d-flex align-items-center", children: [
99
- /* @__PURE__ */ jsx("div", { className: "me-8", children: t("explorer.modal.share.search") }),
100
- /* @__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" }) })
101
- ] }),
102
- /* @__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 }) }) }),
103
- /* @__PURE__ */ jsx("div", { className: "table-responsive", children: isLoading ? /* @__PURE__ */ jsx(LoadingScreen, {}) : /* @__PURE__ */ jsxs("table", { className: "table border align-middle mb-0 rounded-3", children: [
104
- /* @__PURE__ */ jsx("thead", { className: "bg-blue-200", children: /* @__PURE__ */ jsxs("tr", { children: [
105
- /* @__PURE__ */ jsx("th", { scope: "col", className: "w-32", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("explorer.modal.share.avatar.shared.alt") }) }),
106
- /* @__PURE__ */ jsx("th", { scope: "col", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("explorer.modal.share.search.placeholder") }) }),
107
- shareRightActions.map((shareRightAction) => /* @__PURE__ */ jsx("th", { scope: "col", className: "text-center text-gray-800", children: t(shareRightAction.displayName) }, shareRightAction.displayName)),
108
- /* @__PURE__ */ jsx("th", { scope: "col", children: /* @__PURE__ */ jsx(VisuallyHidden, { children: t("close") }) })
109
- ] }) }),
110
- /* @__PURE__ */ jsxs("tbody", { children: [
111
- currentIsAuthor() && /* @__PURE__ */ jsxs("tr", { children: [
112
- /* @__PURE__ */ jsx("th", { scope: "row", children: /* @__PURE__ */ jsx(Avatar, { alt: t("explorer.modal.share.avatar.me.alt"), size: "xs", src: myAvatar, variant: "circle" }) }),
113
- /* @__PURE__ */ jsx("td", { children: t("share.me") }),
114
- shareRightActions.map((shareRightAction) => /* @__PURE__ */ jsx("td", { style: {
115
- width: "80px"
116
- }, className: "text-center text-white", children: /* @__PURE__ */ jsx(Checkbox, { checked: !0, disabled: !0 }) }, shareRightAction.displayName)),
117
- /* @__PURE__ */ jsx("td", {})
118
- ] }),
119
- /* @__PURE__ */ jsx(ShareBookmarkLine, { showBookmark, shareRightActions, shareRights, onDeleteRow: handleDeleteRow, toggleRight, toggleBookmark })
120
- ] })
121
- ] }) }),
122
- /* @__PURE__ */ jsxs("div", { className: "mt-16", children: [
123
- /* @__PURE__ */ jsx(Button, { color: "tertiary", leftIcon: /* @__PURE__ */ jsx(SvgIconBookmark, {}), rightIcon: /* @__PURE__ */ jsx(SvgIconRafterDown, { title: t("show"), className: "w-16 min-w-0", style: {
124
- transition: "rotate 0.2s ease-out",
125
- rotate: showBookmarkInput ? "-180deg" : "0deg"
126
- } }), type: "button", variant: "ghost", className: "fw-normal", onClick: () => toggleBookmarkInput(!showBookmarkInput), children: t("share.save.sharebookmark") }),
127
- showBookmarkInput && /* @__PURE__ */ jsx(ShareBookmark, { refBookmark, bookmark, onBookmarkChange: handleBookmarkChange, onSave: handleOnSaveBookmark })
128
- ] })
129
- ] });
130
- });
131
- export {
132
- ShareResources as default
133
- };
@@ -1 +0,0 @@
1
- export * from './react-query-utils';
@@ -1,21 +0,0 @@
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;
@@ -1,13 +0,0 @@
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
- };