@edifice.io/react 2.6.0-develop-integration.20260710151131 → 2.6.0-develop-b2school.20260715152922
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/ButtonBeta/ButtonBeta.d.ts +5 -0
- package/dist/components/ButtonBeta/ButtonBeta.js +5 -2
- package/dist/hooks/index.d.ts +0 -1
- package/dist/index.js +144 -150
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
- package/dist/modules/homepage/components/MessageFlashList/MessageFlash.js +2 -2
- package/dist/modules/homepage/components/Notifications/services/api/notificationService.js +1 -2
- package/dist/modules/homepage/components/UserSpace/UserSpace.js +2 -2
- package/dist/modules/multimedia/FileCard/index.d.ts +0 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +2 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +3 -16
- package/dist/modules/multimedia/MediaLibrary/innertabs/index.d.ts +0 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +0 -2
- package/dist/modules/multimedia/index.d.ts +0 -1
- package/dist/multimedia.js +12 -16
- package/package.json +6 -6
- package/dist/hooks/useNextcloudSearch/index.d.ts +0 -1
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +0 -9
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +0 -48
- package/dist/modules/multimedia/FileCard/NextcloudFileCard.d.ts +0 -25
- package/dist/modules/multimedia/FileCard/NextcloudFileCard.js +0 -105
- package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.d.ts +0 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.js +0 -22
- package/dist/modules/multimedia/Nextcloud/Nextcloud.d.ts +0 -20
- package/dist/modules/multimedia/Nextcloud/Nextcloud.js +0 -88
- package/dist/modules/multimedia/Nextcloud/index.d.ts +0 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export type ButtonBetaRef = HTMLButtonElement;
|
|
3
3
|
export type ButtonBetaColor = 'default' | 'destructive' | 'secondary' | 'tertiary';
|
|
4
|
+
export type ButtonBetaSizes = 'sm' | 'md';
|
|
4
5
|
export type ButtonBetaVariant = 'filled' | 'outline' | 'ghost';
|
|
5
6
|
export interface ButtonBetaProps extends React.ComponentPropsWithRef<'button'> {
|
|
6
7
|
/**
|
|
@@ -15,6 +16,10 @@ export interface ButtonBetaProps extends React.ComponentPropsWithRef<'button'> {
|
|
|
15
16
|
* `filled`, `outline` or `ghost`
|
|
16
17
|
*/
|
|
17
18
|
variant?: ButtonBetaVariant;
|
|
19
|
+
/**
|
|
20
|
+
* `sm` or `md`
|
|
21
|
+
*/
|
|
22
|
+
size?: ButtonBetaSizes;
|
|
18
23
|
/**
|
|
19
24
|
* Does it has a text ?
|
|
20
25
|
*/
|
|
@@ -5,6 +5,7 @@ import Loading from "../Loading/Loading.js";
|
|
|
5
5
|
const ButtonBeta = /* @__PURE__ */ forwardRef(({
|
|
6
6
|
color = "default",
|
|
7
7
|
type = "button",
|
|
8
|
+
size = "md",
|
|
8
9
|
variant = "filled",
|
|
9
10
|
children,
|
|
10
11
|
isLoading,
|
|
@@ -13,11 +14,13 @@ const ButtonBeta = /* @__PURE__ */ forwardRef(({
|
|
|
13
14
|
className,
|
|
14
15
|
...restProps
|
|
15
16
|
}, ref) => {
|
|
16
|
-
const
|
|
17
|
+
const classes = clsx("btn-beta", `btn-beta-${color}`, {
|
|
17
18
|
"btn-beta--outline": variant === "outline",
|
|
18
19
|
"btn-beta--ghost": variant === "ghost",
|
|
20
|
+
"btn-beta--small": size === "sm",
|
|
19
21
|
"btn-beta--icon-only": !children,
|
|
20
|
-
"btn-beta--with-icon":
|
|
22
|
+
"btn-beta--with-left-icon": !!(leftIcon && children),
|
|
23
|
+
"btn-beta--with-right-icon": !!(rightIcon && children),
|
|
21
24
|
"btn-beta--loading": isLoading
|
|
22
25
|
}, className);
|
|
23
26
|
return /* @__PURE__ */ jsxs("button", { ref, "data-testid": "button-beta", className: classes, type, ...restProps, children: [
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -22,7 +22,6 @@ export * from './useIsAdmlcOrAdmc';
|
|
|
22
22
|
export * from './useKeyPress';
|
|
23
23
|
export * from './useLibraryUrl';
|
|
24
24
|
export * from './useMediaLibrary';
|
|
25
|
-
export * from './useNextcloudSearch';
|
|
26
25
|
export * from './usePublicConf';
|
|
27
26
|
export * from './useScreeb';
|
|
28
27
|
export * from './useScrollToTop';
|
package/dist/index.js
CHANGED
|
@@ -44,81 +44,78 @@ import { default as default42 } from "./components/LogoBeta/LogoBeta.js";
|
|
|
44
44
|
import { default as default43 } from "./modules/multimedia/MediaLibrary/MediaLibrary.js";
|
|
45
45
|
import { default as default44 } from "./components/MediaViewer/MediaViewer.js";
|
|
46
46
|
import { default as default45 } from "./components/Modal/Modal.js";
|
|
47
|
-
import { default as default46 } from "./modules/
|
|
48
|
-
import { default as default47 } from "./
|
|
49
|
-
import { default as default48 } from "./
|
|
50
|
-
import { default as default49 } from "./components/
|
|
51
|
-
import { default as default50 } from "./
|
|
52
|
-
import { default as default51
|
|
53
|
-
import { default as default52 } from "./
|
|
54
|
-
import { default as default53 } from "./components/
|
|
55
|
-
import { default as default54 } from "./components/
|
|
56
|
-
import { default as default55 } from "./components/
|
|
57
|
-
import { default as default56 } from "./components/
|
|
58
|
-
import { default as default57 } from "./
|
|
59
|
-
import { default as default58 } from "./
|
|
60
|
-
import { default as default59 } from "./modules/modals/ShareModal/
|
|
61
|
-
import { default as default60 } from "./
|
|
62
|
-
import { default as default61 } from "./
|
|
63
|
-
import { default as default62 } from "./components/
|
|
64
|
-
import { default as default63 } from "./components/
|
|
65
|
-
import { default as default64 } from "./components/
|
|
66
|
-
import { default as default65 } from "./components/
|
|
67
|
-
import { default as default66 } from "./components/
|
|
68
|
-
import { default as default67 } from "./components/
|
|
69
|
-
import { default as default68 } from "./components/
|
|
70
|
-
import { default as default69 } from "./components/
|
|
71
|
-
import { default as default70 } from "./
|
|
72
|
-
import { default as default71 } from "./
|
|
73
|
-
import { default as default72 } from "./modules/multimedia/
|
|
74
|
-
import { default as default73 } from "./modules/multimedia/
|
|
75
|
-
import { default as default74 } from "./
|
|
76
|
-
import { default as default75 } from "./modules/multimedia/
|
|
77
|
-
import { default as default76 } from "./
|
|
78
|
-
import { default as default77 } from "./
|
|
79
|
-
import { default as default78 } from "./
|
|
80
|
-
import { default as default79 } from "./hooks/
|
|
81
|
-
import { default as default80 } from "./hooks/
|
|
82
|
-
import { default as default81 } from "./hooks/
|
|
83
|
-
import { default as default82 } from "./hooks/
|
|
84
|
-
import { default as default83 } from "./hooks/
|
|
85
|
-
import { default as default84 } from "./hooks/
|
|
86
|
-
import { default as default85 } from "./hooks/
|
|
87
|
-
import { default as default86 } from "./hooks/
|
|
88
|
-
import { default as default87 } from "./hooks/
|
|
89
|
-
import { default as default88 } from "./hooks/
|
|
90
|
-
import { default as default89 } from "./hooks/
|
|
91
|
-
import { default as default90 } from "./hooks/
|
|
92
|
-
import { default as default91 } from "./hooks/
|
|
93
|
-
import { default as default92 } from "./hooks/
|
|
94
|
-
import { default as default93 } from "./hooks/
|
|
95
|
-
import { default as default94 } from "./hooks/
|
|
96
|
-
import { default as default95 } from "./hooks/
|
|
97
|
-
import { default as default96 } from "./hooks/
|
|
98
|
-
import { default as default97 } from "./hooks/
|
|
99
|
-
import { default as default98 } from "./hooks/
|
|
100
|
-
import { default as default99 } from "./hooks/
|
|
101
|
-
import { default as default100 } from "./hooks/
|
|
102
|
-
import { default as default101 } from "./hooks/
|
|
103
|
-
import { default as default102 } from "./hooks/
|
|
104
|
-
import { default as default103 } from "./hooks/
|
|
105
|
-
import { default as default104 } from "./hooks/
|
|
106
|
-
import { default as default105 } from "./
|
|
107
|
-
import { default as default106 } from "./hooks/
|
|
108
|
-
import { default as default107 } from "./hooks/
|
|
109
|
-
import { default as default108 } from "./hooks/
|
|
110
|
-
import { default as default109 } from "./hooks/
|
|
111
|
-
import { default as default110 } from "./hooks/
|
|
112
|
-
import { default as default111 } from "./
|
|
113
|
-
import { default as default112 } from "./hooks/
|
|
114
|
-
import { default as default113 } from "./hooks/
|
|
115
|
-
import { default as default114 } from "./hooks/
|
|
116
|
-
import { default as default115 } from "./hooks/
|
|
117
|
-
import { default as default116 } from "./hooks/
|
|
118
|
-
import {
|
|
119
|
-
import { default as default118 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
120
|
-
import { default as default119 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
|
|
121
|
-
import { default as default120 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
47
|
+
import { default as default46 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
|
|
48
|
+
import { default as default47 } from "./components/PageLayout/PageLayout.js";
|
|
49
|
+
import { default as default48 } from "./components/PreventPropagation/PreventPropagation.js";
|
|
50
|
+
import { default as default49, Root } from "./components/PromotionCard/PromotionCard.js";
|
|
51
|
+
import { default as default50 } from "./modules/modals/PublishModal/PublishModal.js";
|
|
52
|
+
import { default as default51 } from "./components/Radio/Radio.js";
|
|
53
|
+
import { default as default52 } from "./components/RadioCard/RadioCard.js";
|
|
54
|
+
import { default as default53 } from "./components/SearchBar/SearchBar.js";
|
|
55
|
+
import { default as default54 } from "./components/Button/SearchButton.js";
|
|
56
|
+
import { default as default55 } from "./components/SegmentedControl/SegmentedControl.js";
|
|
57
|
+
import { default as default56 } from "./components/Select/Select.js";
|
|
58
|
+
import { default as default57 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
|
|
59
|
+
import { default as default58 } from "./modules/modals/ShareModal/ShareModal.js";
|
|
60
|
+
import { default as default59 } from "./modules/modals/ShareModal/ShareResources.js";
|
|
61
|
+
import { default as default60 } from "./components/Tree/components/SortableTree.js";
|
|
62
|
+
import { default as default61 } from "./components/StackedGroup/StackedGroup.js";
|
|
63
|
+
import { default as default62 } from "./components/Stepper/Stepper.js";
|
|
64
|
+
import { default as default63 } from "./components/Switch/Switch.js";
|
|
65
|
+
import { default as default64 } from "./components/Table/components/Table.js";
|
|
66
|
+
import { default as default65 } from "./components/TextArea/TextArea.js";
|
|
67
|
+
import { default as default66 } from "./components/Skeleton/TextSkeleton.js";
|
|
68
|
+
import { default as default67 } from "./components/Tooltip/Tooltip.js";
|
|
69
|
+
import { default as default68 } from "./components/Tree/components/Tree.js";
|
|
70
|
+
import { default as default69 } from "./components/TreeView/TreeView.js";
|
|
71
|
+
import { default as default70 } from "./modules/multimedia/UploadCard/UploadCard.js";
|
|
72
|
+
import { default as default71 } from "./modules/multimedia/UploadFiles/UploadFiles.js";
|
|
73
|
+
import { default as default72 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
|
|
74
|
+
import { default as default73 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
|
|
75
|
+
import { default as default74 } from "./components/VisuallyHidden/VisuallyHidden.js";
|
|
76
|
+
import { default as default75 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
77
|
+
import { default as default76 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
78
|
+
import { default as default77 } from "./hooks/useBookmark/useBookmark.js";
|
|
79
|
+
import { default as default78 } from "./hooks/useBreakpoint/useBreakpoint.js";
|
|
80
|
+
import { default as default79 } from "./hooks/useBrowserInfo/useBrowserInfo.js";
|
|
81
|
+
import { default as default80 } from "./hooks/useCantoo/useCantoo.js";
|
|
82
|
+
import { default as default81 } from "./hooks/useClickOutside/useClickOutside.js";
|
|
83
|
+
import { default as default82 } from "./hooks/useConversation/useConversation.js";
|
|
84
|
+
import { default as default83 } from "./hooks/useDate/useDate.js";
|
|
85
|
+
import { default as default84 } from "./hooks/useDebounce/useDebounce.js";
|
|
86
|
+
import { default as default85 } from "./hooks/useDirectory/useDirectory.js";
|
|
87
|
+
import { default as default86 } from "./hooks/useDropdown/useDropdown.js";
|
|
88
|
+
import { default as default87 } from "./hooks/useDropzone/useDropzone.js";
|
|
89
|
+
import { default as default88 } from "./hooks/useEdificeIcons/useEdificeIcons.js";
|
|
90
|
+
import { default as default89 } from "./hooks/useHasWorkflow/useHasWorkflow.js";
|
|
91
|
+
import { default as default90 } from "./hooks/useHover/useHover.js";
|
|
92
|
+
import { default as default91 } from "./hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
93
|
+
import { default as default92 } from "./hooks/useImage/useImage.js";
|
|
94
|
+
import { default as default93 } from "./hooks/useInfiniteScroll/useInfiniteScroll.js";
|
|
95
|
+
import { default as default94 } from "./hooks/useIsAdmc/useIsAdmc.js";
|
|
96
|
+
import { default as default95 } from "./hooks/useIsAdml/useIsAdml.js";
|
|
97
|
+
import { default as default96 } from "./hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.js";
|
|
98
|
+
import { default as default97 } from "./hooks/useKeyPress/useKeyPress.js";
|
|
99
|
+
import { default as default98 } from "./hooks/useLibraryUrl/useLibraryUrl.js";
|
|
100
|
+
import { default as default99 } from "./hooks/useMediaLibrary/useMediaLibrary.js";
|
|
101
|
+
import { default as default100 } from "./hooks/usePublicConf/usePublicConf.js";
|
|
102
|
+
import { default as default101 } from "./hooks/useScrollToTop/useScrollToTop.js";
|
|
103
|
+
import { default as default102 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
104
|
+
import { default as default103 } from "./hooks/useTitle/useTitle.js";
|
|
105
|
+
import { default as default104 } from "./hooks/useToast/useToast.js";
|
|
106
|
+
import { default as default105 } from "./hooks/useToggle/useToggle.js";
|
|
107
|
+
import { default as default106 } from "./hooks/useTrapFocus/useTrapFocus.js";
|
|
108
|
+
import { default as default107 } from "./hooks/useTrashedResource/useTrashedResource.js";
|
|
109
|
+
import { default as default108 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
110
|
+
import { default as default109 } from "./hooks/useUpload/useUpload.js";
|
|
111
|
+
import { default as default110 } from "./hooks/useUploadFiles/useUploadFiles.js";
|
|
112
|
+
import { default as default111 } from "./hooks/useUser/useUser.js";
|
|
113
|
+
import { default as default112 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
|
|
114
|
+
import { default as default113 } from "./hooks/useWorkspaceFolders/useWorkspaceFolders.js";
|
|
115
|
+
import { WORKSPACE_SHARED_FOLDER_ID, WORKSPACE_USER_FOLDER_ID, default as default114 } from "./hooks/useWorkspaceFolders/useWorkspaceFoldersTree.js";
|
|
116
|
+
import { default as default115 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
117
|
+
import { default as default116 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
|
|
118
|
+
import { default as default117 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
122
119
|
import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
|
|
123
120
|
import { AntProvider } from "./providers/AntThemeProvider/AntProvider.js";
|
|
124
121
|
import { BetaSwitch } from "./components/BetaSwitch/BetaSwitch.js";
|
|
@@ -226,57 +223,55 @@ export {
|
|
|
226
223
|
Menu,
|
|
227
224
|
MockedProvider,
|
|
228
225
|
default45 as Modal,
|
|
229
|
-
default46 as
|
|
230
|
-
default47 as
|
|
231
|
-
default48 as OnboardingModal,
|
|
232
|
-
default49 as PageLayout,
|
|
226
|
+
default46 as OnboardingModal,
|
|
227
|
+
default47 as PageLayout,
|
|
233
228
|
PageLayoutContext,
|
|
234
229
|
Pagination,
|
|
235
230
|
Popover,
|
|
236
231
|
PopoverBody,
|
|
237
232
|
PopoverFooter,
|
|
238
233
|
PopoverHeader,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
234
|
+
default48 as PreventPropagation,
|
|
235
|
+
default49 as PromotionCard,
|
|
236
|
+
default50 as PublishModal,
|
|
237
|
+
default51 as Radio,
|
|
238
|
+
default52 as RadioCard,
|
|
244
239
|
ResourceModal,
|
|
245
240
|
Root,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
241
|
+
default53 as SearchBar,
|
|
242
|
+
default54 as SearchButton,
|
|
243
|
+
default55 as SegmentedControl,
|
|
244
|
+
default56 as Select,
|
|
245
|
+
default57 as ShareBlog,
|
|
246
|
+
default58 as ShareModal,
|
|
247
|
+
default59 as ShareResources,
|
|
248
|
+
default60 as SortableTree,
|
|
249
|
+
default61 as StackedGroup,
|
|
250
|
+
default62 as Stepper,
|
|
251
|
+
default63 as Switch,
|
|
252
|
+
default64 as Table,
|
|
258
253
|
Tabs,
|
|
259
|
-
|
|
260
|
-
|
|
254
|
+
default65 as TextArea,
|
|
255
|
+
default66 as TextSkeleton,
|
|
261
256
|
Toolbar,
|
|
262
|
-
|
|
263
|
-
|
|
257
|
+
default67 as Tooltip,
|
|
258
|
+
default68 as Tree,
|
|
264
259
|
TreeNode,
|
|
265
260
|
TreeNodeFolderWrapper,
|
|
266
|
-
|
|
261
|
+
default69 as TreeView,
|
|
267
262
|
Upload,
|
|
268
|
-
|
|
269
|
-
|
|
263
|
+
default70 as UploadCard,
|
|
264
|
+
default71 as UploadFiles,
|
|
270
265
|
UserRightsList,
|
|
271
266
|
UserSearch,
|
|
272
|
-
|
|
273
|
-
|
|
267
|
+
default72 as VideoEmbed,
|
|
268
|
+
default73 as VideoRecorder,
|
|
274
269
|
VisibleType,
|
|
275
|
-
|
|
270
|
+
default74 as VisuallyHidden,
|
|
276
271
|
WORKSPACE_SHARED_FOLDER_ID,
|
|
277
272
|
WORKSPACE_USER_FOLDER_ID,
|
|
278
|
-
|
|
279
|
-
|
|
273
|
+
default75 as Workspace,
|
|
274
|
+
default76 as WorkspaceFolders,
|
|
280
275
|
addNode,
|
|
281
276
|
arrayUnique,
|
|
282
277
|
buildTree,
|
|
@@ -306,57 +301,56 @@ export {
|
|
|
306
301
|
setRef,
|
|
307
302
|
updateNode,
|
|
308
303
|
updateParentIds,
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
304
|
+
default77 as useBookmark,
|
|
305
|
+
default78 as useBreakpoint,
|
|
306
|
+
default79 as useBrowserInfo,
|
|
307
|
+
default80 as useCantoo,
|
|
313
308
|
useCheckable,
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
309
|
+
default81 as useClickOutside,
|
|
310
|
+
default82 as useConversation,
|
|
311
|
+
default83 as useDate,
|
|
312
|
+
default84 as useDebounce,
|
|
313
|
+
default85 as useDirectory,
|
|
314
|
+
default86 as useDropdown,
|
|
315
|
+
default87 as useDropzone,
|
|
321
316
|
useDropzoneContext,
|
|
322
317
|
useEdificeClient,
|
|
323
|
-
|
|
318
|
+
default88 as useEdificeIcons,
|
|
324
319
|
useEdificeTheme,
|
|
325
320
|
useFileToAttachment,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
default102 as useNextcloudSearch,
|
|
321
|
+
default89 as useHasWorkflow,
|
|
322
|
+
default90 as useHover,
|
|
323
|
+
default91 as useHttpErrorToast,
|
|
324
|
+
default92 as useImage,
|
|
325
|
+
default93 as useInfiniteScroll,
|
|
326
|
+
default94 as useIsAdmc,
|
|
327
|
+
default95 as useIsAdml,
|
|
328
|
+
default96 as useIsAdmlcOrAdmc,
|
|
329
|
+
default97 as useKeyPress,
|
|
330
|
+
default98 as useLibraryUrl,
|
|
331
|
+
default99 as useMediaLibrary,
|
|
338
332
|
useOverlay,
|
|
339
333
|
usePageLayout,
|
|
340
|
-
|
|
334
|
+
default100 as usePublicConf,
|
|
341
335
|
useScreeb,
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
336
|
+
default101 as useScrollToTop,
|
|
337
|
+
default102 as useShareMutation,
|
|
338
|
+
default103 as useTitle,
|
|
339
|
+
default104 as useToast,
|
|
340
|
+
default105 as useToggle,
|
|
341
|
+
default106 as useTrapFocus,
|
|
342
|
+
default107 as useTrashedResource,
|
|
349
343
|
useTreeSortable,
|
|
350
344
|
useTreeView,
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
345
|
+
default108 as useUpdateMutation,
|
|
346
|
+
default109 as useUpload,
|
|
347
|
+
default110 as useUploadFiles,
|
|
348
|
+
default111 as useUser,
|
|
349
|
+
default112 as useWorkspaceFile,
|
|
350
|
+
default113 as useWorkspaceFolders,
|
|
351
|
+
default114 as useWorkspaceFoldersTree,
|
|
352
|
+
default115 as useWorkspaceSearch,
|
|
353
|
+
default116 as useXitiTrackPageLoad,
|
|
354
|
+
default117 as useZendeskGuide,
|
|
361
355
|
wrapTreeNode
|
|
362
356
|
};
|
|
@@ -14,7 +14,7 @@ const HomeCardHeader = ({
|
|
|
14
14
|
const hasAction = !!actionLabel && !!onActionClick;
|
|
15
15
|
return /* @__PURE__ */ jsxs(Flex, { align: "center", justify: "between", gap: "8", className: clsx("home-card-header", className), ...rest, children: [
|
|
16
16
|
/* @__PURE__ */ jsx("h3", { className: "home-card-header-title", children: title }),
|
|
17
|
-
hasAction && /* @__PURE__ */ jsx(ButtonBeta, { color: "
|
|
17
|
+
hasAction && /* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", size: "sm", variant: "ghost", onClick: onActionClick, leftIcon: actionLeftIcon, rightIcon: actionRightIcon, "data-testid": "home-card-header-action", children: actionLabel })
|
|
18
18
|
] });
|
|
19
19
|
};
|
|
20
20
|
export {
|
|
@@ -20,7 +20,7 @@ const MessageFlash = ({
|
|
|
20
20
|
} = useEdificeClient(), [isCollapsed, setIsCollapsed] = useState(!0), [hasOverflow, setHasOverflow] = useState(!1), contentRef = useRef(null), checkContentTimeoutRef = useRef(void 0), {
|
|
21
21
|
t
|
|
22
22
|
} = useTranslation(), {
|
|
23
|
-
|
|
23
|
+
lg
|
|
24
24
|
} = useBreakpoint();
|
|
25
25
|
let content = "";
|
|
26
26
|
message.contents && (currentLanguage && message.contents[currentLanguage] ? content = message.contents[currentLanguage] : message.contents.fr ? content = message.contents.fr : content = Object.keys(message.contents).map((key) => message.contents[key]).filter((cont) => cont !== null)[0]), useEffect(() => {
|
|
@@ -53,7 +53,7 @@ const MessageFlash = ({
|
|
|
53
53
|
/* @__PURE__ */ jsx("div", { ref: contentRef, className: classesContent, dangerouslySetInnerHTML: {
|
|
54
54
|
__html: content
|
|
55
55
|
} }),
|
|
56
|
-
/* @__PURE__ */ jsxs(Flex, { direction:
|
|
56
|
+
/* @__PURE__ */ jsxs(Flex, { direction: lg ? "row" : "column", justify: "between", className: "message-flash-footer", children: [
|
|
57
57
|
/* @__PURE__ */ jsx("div", { className: "fst-italic", children: message.signature || "" }),
|
|
58
58
|
hasOverflow && /* @__PURE__ */ jsx(ButtonBeta, { "data-testid": isCollapsed ? "message-flash-view-more-button" : "message-flash-view-less-button", color: "default", variant: "ghost", onClick: handleCollapse, "aria-controls": `message-flash-${message.id}-content`, "aria-expanded": !isCollapsed, className: "message-flash-collapse-button", children: t(isCollapsed ? "read.more" : "read.less") })
|
|
59
59
|
] })
|
|
@@ -6,8 +6,7 @@ const createNotificationService = (baseURL) => ({
|
|
|
6
6
|
*/
|
|
7
7
|
getNotifications(types, page) {
|
|
8
8
|
const searchParams = new URLSearchParams({
|
|
9
|
-
page: page.toString()
|
|
10
|
-
mine: "1"
|
|
9
|
+
page: page.toString()
|
|
11
10
|
});
|
|
12
11
|
return types.forEach((type) => {
|
|
13
12
|
searchParams.append("type", type);
|
|
@@ -13,13 +13,13 @@ function UserSpace({
|
|
|
13
13
|
t
|
|
14
14
|
} = useTranslation();
|
|
15
15
|
return /* @__PURE__ */ jsxs(HomeCard, { variant: "user", children: [
|
|
16
|
-
/* @__PURE__ */
|
|
16
|
+
/* @__PURE__ */ jsxs(Flex, { className: "user-space", direction: "row", gap: "8", children: [
|
|
17
17
|
/* @__PURE__ */ jsx(Avatar, { className: "user-space--avatar", size: "auto", alt: name, src: avatar, variant: "circle" }),
|
|
18
18
|
/* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
|
|
19
19
|
/* @__PURE__ */ jsx("div", { "data-testid": "user-space-name", className: "user-space--name", children: name }),
|
|
20
20
|
/* @__PURE__ */ jsx("div", { "data-testid": "user-space-profile", className: "user-space--profile", children: t(profile) })
|
|
21
21
|
] })
|
|
22
|
-
] })
|
|
22
|
+
] }),
|
|
23
23
|
children && /* @__PURE__ */ jsx(HomeCard.Content, { children })
|
|
24
24
|
] });
|
|
25
25
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WorkspaceElement, WorkspaceVisibility } from '@edifice.io/client';
|
|
2
2
|
import { TabsItemProps } from '../../../components';
|
|
3
3
|
import { ExternalLinkTabProps } from './innertabs/ExternalLink';
|
|
4
4
|
import { InternalLinkTabProps, InternalLinkTabResult } from './innertabs/InternalLink';
|
|
@@ -54,7 +54,7 @@ export interface MediaLibraryRef {
|
|
|
54
54
|
/**
|
|
55
55
|
* The resulting type depends on the actual selected Tab when modal is closed.
|
|
56
56
|
*/
|
|
57
|
-
export type MediaLibraryResult = WorkspaceElement[] | WorkspaceElement |
|
|
57
|
+
export type MediaLibraryResult = WorkspaceElement[] | WorkspaceElement | InternalLinkTabResult | string | /*TODO type des autres résultats ?*/ any;
|
|
58
58
|
/**
|
|
59
59
|
* MediaLibrary component properties
|
|
60
60
|
*/
|
|
@@ -12,7 +12,6 @@ import SvgIconSmartphone from "../../icons/components/IconSmartphone.js";
|
|
|
12
12
|
import { InnerTabs } from "./innertabs/index.js";
|
|
13
13
|
import { MediaLibraryContext } from "./MediaLibraryContext.js";
|
|
14
14
|
import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
15
|
-
import usePublicConf from "../../../hooks/usePublicConf/usePublicConf.js";
|
|
16
15
|
import useHttpErrorToast from "../../../hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
17
16
|
import Modal from "../../../components/Modal/Modal.js";
|
|
18
17
|
import { Tabs } from "../../../components/Tabs/components/Tabs.js";
|
|
@@ -30,8 +29,6 @@ const orderedTabs = [
|
|
|
30
29
|
// Filesystem browser + drag'n'drop of files
|
|
31
30
|
"workspace",
|
|
32
31
|
// Media browser
|
|
33
|
-
"nextcloud",
|
|
34
|
-
// Nextcloud media browser
|
|
35
32
|
"video-embedder"
|
|
36
33
|
// Link to a hosted video
|
|
37
34
|
], mediaLibraryTypes = {
|
|
@@ -84,9 +81,7 @@ const orderedTabs = [
|
|
|
84
81
|
}));
|
|
85
82
|
const {
|
|
86
83
|
t
|
|
87
|
-
} = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"),
|
|
88
|
-
data: publicConf
|
|
89
|
-
} = usePublicConf("workspace"), enableNextcloud = (publicConf == null ? void 0 : publicConf["enable-nextcloud"]) === !0, [type, setType] = useState(null);
|
|
84
|
+
} = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"), [type, setType] = useState(null);
|
|
90
85
|
useHttpErrorToast({
|
|
91
86
|
active: !!type,
|
|
92
87
|
isDismissible: !0,
|
|
@@ -101,14 +96,6 @@ const orderedTabs = [
|
|
|
101
96
|
availableFor: ["audio", "video", "image", "attachment"],
|
|
102
97
|
isEnable: null
|
|
103
98
|
},
|
|
104
|
-
nextcloud: {
|
|
105
|
-
id: "nextcloud",
|
|
106
|
-
icon: /* @__PURE__ */ jsx(SvgIconGlobe, {}),
|
|
107
|
-
label: t("bbm.nextcloud"),
|
|
108
|
-
content: /* @__PURE__ */ jsx(InnerTabs.Nextcloud, {}),
|
|
109
|
-
availableFor: ["audio", "video", "image", "attachment"],
|
|
110
|
-
isEnable: () => enableNextcloud
|
|
111
|
-
},
|
|
112
99
|
upload: {
|
|
113
100
|
id: "upload",
|
|
114
101
|
icon: /* @__PURE__ */ jsx(SvgIconSmartphone, {}),
|
|
@@ -198,9 +185,9 @@ const orderedTabs = [
|
|
|
198
185
|
linkTabProps.current = void 0, setResult(void 0), setResultCounter(void 0), setDefaultTabId(void 0), setPreSuccess(void 0), setDeletionsOnCancel([]);
|
|
199
186
|
}, handleTabChange = (tab) => {
|
|
200
187
|
onTabChange == null || onTabChange(tab, deletionsOnCancel), resetState();
|
|
201
|
-
},
|
|
188
|
+
}, handleOnSuccess = useCallback(() => {
|
|
202
189
|
const triggerSuccess = async (result2) => {
|
|
203
|
-
|
|
190
|
+
result2 instanceof Array && ["protected", "public"].findIndex((v) => v === visibility) >= 0 && (result2 = await odeServices.workspace().transferDocuments(result2, appCode ?? "media-library", visibility)), onSuccess(result2);
|
|
204
191
|
};
|
|
205
192
|
onSuccessAction ? onSuccessAction().then((result2) => {
|
|
206
193
|
triggerSuccess(result2);
|
|
@@ -4,7 +4,6 @@ export declare const InnerTabs: {
|
|
|
4
4
|
Upload: () => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
ExternalLink: ({ link, multiNodeSelected, }: import('./ExternalLink').ExternalLinkTabProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
Workspace: () => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
Nextcloud: () => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
InternalLink: ({ target, resourceId, appPrefix, }: import('./InternalLink').InternalLinkTabProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
Iframe: () => import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
VideoEmbedder: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,6 @@ import { Audio } from "./Audio.js";
|
|
|
2
2
|
import { ExternalLink } from "./ExternalLink.js";
|
|
3
3
|
import { Iframe } from "./Iframe.js";
|
|
4
4
|
import { InternalLink } from "./InternalLink.js";
|
|
5
|
-
import { Nextcloud } from "./Nextcloud.js";
|
|
6
5
|
import { Upload } from "./Upload.js";
|
|
7
6
|
import { Video } from "./Video.js";
|
|
8
7
|
import { VideoEmbedder } from "./VideoEmbedder.js";
|
|
@@ -13,7 +12,6 @@ const InnerTabs = {
|
|
|
13
12
|
Upload,
|
|
14
13
|
ExternalLink,
|
|
15
14
|
Workspace,
|
|
16
|
-
Nextcloud,
|
|
17
15
|
InternalLink,
|
|
18
16
|
Iframe,
|
|
19
17
|
VideoEmbedder
|
package/dist/multimedia.js
CHANGED
|
@@ -4,14 +4,12 @@ import { default as default4 } from "./modules/multimedia/FileCard/FileCard.js";
|
|
|
4
4
|
import { default as default5 } from "./modules/multimedia/ImageEditor/components/ImageEditor.js";
|
|
5
5
|
import { default as default6 } from "./modules/multimedia/ImagePicker/ImagePicker.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/
|
|
12
|
-
import { default as default13 } from "./modules/multimedia/
|
|
13
|
-
import { default as default14 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
14
|
-
import { default as default15 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
7
|
+
import { default as default8 } from "./modules/multimedia/UploadCard/UploadCard.js";
|
|
8
|
+
import { default as default9 } from "./modules/multimedia/UploadFiles/UploadFiles.js";
|
|
9
|
+
import { default as default10 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
|
|
10
|
+
import { default as default11 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
|
|
11
|
+
import { default as default12 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
12
|
+
import { default as default13 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
15
13
|
import { ExternalLinker } from "./modules/multimedia/Linker/ExternalLinker/ExternalLinker.js";
|
|
16
14
|
import { InternalLinker } from "./modules/multimedia/Linker/InternalLinker/InternalLinker.js";
|
|
17
15
|
import { Upload } from "./modules/multimedia/MediaLibrary/innertabs/Upload.js";
|
|
@@ -24,13 +22,11 @@ export {
|
|
|
24
22
|
default6 as ImagePicker,
|
|
25
23
|
InternalLinker,
|
|
26
24
|
default7 as MediaLibrary,
|
|
27
|
-
default8 as Nextcloud,
|
|
28
|
-
default9 as NextcloudFileCard,
|
|
29
25
|
Upload,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
default8 as UploadCard,
|
|
27
|
+
default9 as UploadFiles,
|
|
28
|
+
default10 as VideoEmbed,
|
|
29
|
+
default11 as VideoRecorder,
|
|
30
|
+
default12 as Workspace,
|
|
31
|
+
default13 as WorkspaceFolders
|
|
36
32
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.6.0-develop-
|
|
3
|
+
"version": "2.6.0-develop-b2school.20260715152922",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -140,9 +140,9 @@
|
|
|
140
140
|
"swiper": "10.1.0",
|
|
141
141
|
"ua-parser-js": "1.0.36",
|
|
142
142
|
"zustand": "4.5.7",
|
|
143
|
-
"@edifice.io/bootstrap": "2.6.0-develop-
|
|
144
|
-
"@edifice.io/
|
|
145
|
-
"@edifice.io/
|
|
143
|
+
"@edifice.io/bootstrap": "2.6.0-develop-b2school.20260715152922",
|
|
144
|
+
"@edifice.io/utilities": "2.6.0-develop-b2school.20260715152922",
|
|
145
|
+
"@edifice.io/tiptap-extensions": "2.6.0-develop-b2school.20260715152922"
|
|
146
146
|
},
|
|
147
147
|
"devDependencies": {
|
|
148
148
|
"@babel/plugin-transform-react-pure-annotations": "7.27.1",
|
|
@@ -173,8 +173,8 @@
|
|
|
173
173
|
"vite": "5.4.14",
|
|
174
174
|
"vite-plugin-dts": "4.5.4",
|
|
175
175
|
"vite-tsconfig-paths": "5.1.4",
|
|
176
|
-
"@edifice.io/
|
|
177
|
-
"@edifice.io/
|
|
176
|
+
"@edifice.io/client": "2.6.0-develop-b2school.20260715152922",
|
|
177
|
+
"@edifice.io/config": "2.6.0-develop-b2school.20260715152922"
|
|
178
178
|
},
|
|
179
179
|
"peerDependencies": {
|
|
180
180
|
"@react-spring/web": "9.7.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as useNextcloudSearch } from './useNextcloudSearch';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ID, NextcloudDocument } from '@edifice.io/client';
|
|
2
|
-
import { TreeData } from '../../types';
|
|
3
|
-
export type NextcloudFolderNode = TreeData & {
|
|
4
|
-
files?: NextcloudDocument[];
|
|
5
|
-
};
|
|
6
|
-
export default function useNextcloudSearch(rootId: string, rootName: string, userId?: string): {
|
|
7
|
-
root: NextcloudFolderNode;
|
|
8
|
-
loadContent: (folderId?: ID) => void;
|
|
9
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { useReducer, useCallback } from "react";
|
|
2
|
-
import { odeServices } from "@edifice.io/client";
|
|
3
|
-
import { useQueryClient } from "@tanstack/react-query";
|
|
4
|
-
import { findNodeById } from "../../components/TreeView/utilities/treeview.js";
|
|
5
|
-
function useNextcloudSearch(rootId, rootName, userId) {
|
|
6
|
-
function treeReducer(state, action) {
|
|
7
|
-
switch (action.type) {
|
|
8
|
-
case "update": {
|
|
9
|
-
const node = findNodeById(state, action.folderId);
|
|
10
|
-
return node && (node.children = action.subfolders.map((f) => ({
|
|
11
|
-
id: f.path,
|
|
12
|
-
name: f.name
|
|
13
|
-
})), node.files = action.files), {
|
|
14
|
-
...state
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
default:
|
|
18
|
-
throw Error("[useNextcloudSearch] Unknown action type: " + action.type);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const [root, dispatch] = useReducer(treeReducer, {
|
|
22
|
-
id: rootId,
|
|
23
|
-
name: rootName,
|
|
24
|
-
section: !0
|
|
25
|
-
}), queryClient = useQueryClient(), loadContent = useCallback(async (folderId) => {
|
|
26
|
-
if (!userId) return;
|
|
27
|
-
const path = folderId === rootId ? void 0 : folderId, payload = await queryClient.fetchQuery({
|
|
28
|
-
queryKey: ["nextcloud", "documents", userId, path ?? "/"],
|
|
29
|
-
queryFn: () => odeServices.nextcloud().listDocuments(userId, path),
|
|
30
|
-
staleTime: 6e4
|
|
31
|
-
}), subfolders = [], files = [], currentPath = path ?? "/";
|
|
32
|
-
payload.filter((doc) => doc.path !== currentPath).forEach((doc) => {
|
|
33
|
-
doc.isFolder ? subfolders.push(doc) : files.push(doc);
|
|
34
|
-
}), dispatch({
|
|
35
|
-
folderId,
|
|
36
|
-
subfolders,
|
|
37
|
-
files,
|
|
38
|
-
type: "update"
|
|
39
|
-
});
|
|
40
|
-
}, [rootId, userId, queryClient]);
|
|
41
|
-
return {
|
|
42
|
-
root,
|
|
43
|
-
loadContent
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
useNextcloudSearch as default
|
|
48
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { NextcloudDocument } from '@edifice.io/client';
|
|
3
|
-
import { CardProps } from '../../../components/Card';
|
|
4
|
-
export interface NextcloudFileCardProps extends CardProps {
|
|
5
|
-
doc: NextcloudDocument;
|
|
6
|
-
/**
|
|
7
|
-
* Id of the user who owns the Nextcloud document, used to build the preview URL.
|
|
8
|
-
*/
|
|
9
|
-
userId: string;
|
|
10
|
-
/**
|
|
11
|
-
* Custom icon to override the default based on file type
|
|
12
|
-
* Can be a string or a React node
|
|
13
|
-
*/
|
|
14
|
-
customIcon?: ReactNode;
|
|
15
|
-
/**
|
|
16
|
-
* Custom color class to override the default based on file type
|
|
17
|
-
* Example: "bg-purple-300" or any valid CSS class
|
|
18
|
-
*/
|
|
19
|
-
customColor?: string;
|
|
20
|
-
}
|
|
21
|
-
declare const NextcloudFileCard: {
|
|
22
|
-
({ doc, userId, isClickable, isSelectable, isSelected, onClick, className, onSelect, isFocused, app, customIcon, customColor, }: NextcloudFileCardProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
displayName: string;
|
|
24
|
-
};
|
|
25
|
-
export default NextcloudFileCard;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useRef } from "react";
|
|
3
|
-
import { DocumentHelper, odeServices } from "@edifice.io/client";
|
|
4
|
-
import clsx from "clsx";
|
|
5
|
-
import SvgIconLandscape from "../../icons/components/IconLandscape.js";
|
|
6
|
-
import SvgIconMic from "../../icons/components/IconMic.js";
|
|
7
|
-
import SvgIconTextPage from "../../icons/components/IconTextPage.js";
|
|
8
|
-
import SvgIconVideo from "../../icons/components/IconVideo.js";
|
|
9
|
-
import FileIcon from "./FileIcon.js";
|
|
10
|
-
import useThumbnail from "../../../hooks/useThumbnail/useThumbnail.js";
|
|
11
|
-
import Card from "../../../components/Card/Card.js";
|
|
12
|
-
const NextcloudFileCard = ({
|
|
13
|
-
doc,
|
|
14
|
-
userId,
|
|
15
|
-
isClickable = !0,
|
|
16
|
-
isSelectable = !1,
|
|
17
|
-
isSelected = !1,
|
|
18
|
-
onClick,
|
|
19
|
-
className,
|
|
20
|
-
onSelect,
|
|
21
|
-
isFocused,
|
|
22
|
-
app,
|
|
23
|
-
customIcon,
|
|
24
|
-
customColor
|
|
25
|
-
}) => {
|
|
26
|
-
const ref = useRef(null), type = DocumentHelper.role(doc.contentType, !1);
|
|
27
|
-
function getRoleMap(type2) {
|
|
28
|
-
if (customIcon !== void 0 || customColor !== void 0)
|
|
29
|
-
return {
|
|
30
|
-
icon: customIcon || /* @__PURE__ */ jsx(SvgIconTextPage, { width: 22, height: 22 }),
|
|
31
|
-
color: customColor || "bg-gray-300",
|
|
32
|
-
hasShadow: !1
|
|
33
|
-
};
|
|
34
|
-
const roleMappings = {
|
|
35
|
-
csv: {
|
|
36
|
-
icon: ".CSV",
|
|
37
|
-
color: "bg-orange-200"
|
|
38
|
-
},
|
|
39
|
-
xls: {
|
|
40
|
-
icon: ".XLS",
|
|
41
|
-
color: "bg-green-200"
|
|
42
|
-
},
|
|
43
|
-
doc: {
|
|
44
|
-
icon: ".DOC",
|
|
45
|
-
color: "bg-blue-200"
|
|
46
|
-
},
|
|
47
|
-
txt: {
|
|
48
|
-
icon: ".TXT",
|
|
49
|
-
color: "bg-blue-200"
|
|
50
|
-
},
|
|
51
|
-
pdf: {
|
|
52
|
-
icon: ".PDF",
|
|
53
|
-
color: "bg-red-200"
|
|
54
|
-
},
|
|
55
|
-
audio: {
|
|
56
|
-
icon: /* @__PURE__ */ jsx(SvgIconMic, { width: 22, height: 22 }),
|
|
57
|
-
color: "bg-red-200"
|
|
58
|
-
},
|
|
59
|
-
ppt: {
|
|
60
|
-
icon: ".PPT",
|
|
61
|
-
color: "bg-red-200"
|
|
62
|
-
},
|
|
63
|
-
img: {
|
|
64
|
-
icon: /* @__PURE__ */ jsx(SvgIconLandscape, { width: 22, height: 22 }),
|
|
65
|
-
color: "bg-green-200"
|
|
66
|
-
},
|
|
67
|
-
video: {
|
|
68
|
-
icon: /* @__PURE__ */ jsx(SvgIconVideo, { width: 22, height: 22 }),
|
|
69
|
-
color: "bg-purple-200"
|
|
70
|
-
},
|
|
71
|
-
zip: {
|
|
72
|
-
icon: ".ZIP",
|
|
73
|
-
color: "bg-gray-300"
|
|
74
|
-
},
|
|
75
|
-
md: {
|
|
76
|
-
icon: ".MD",
|
|
77
|
-
color: "bg-blue-200"
|
|
78
|
-
},
|
|
79
|
-
unknown: {
|
|
80
|
-
icon: /* @__PURE__ */ jsx(SvgIconTextPage, { width: 22, height: 22 }),
|
|
81
|
-
color: "bg-gray-300"
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
return roleMappings[type2] || roleMappings.unknown;
|
|
85
|
-
}
|
|
86
|
-
const roleMap = getRoleMap(type ?? "unknown"), file = clsx("file position-relative rounded", (roleMap == null ? void 0 : roleMap.color) ?? "bg-yellow-200"), mediaSrc = type === "img" ? odeServices.nextcloud().getFileUrl(userId, doc) : null, hasThumbnail = useThumbnail(mediaSrc, {
|
|
87
|
-
ref
|
|
88
|
-
}), imageStyles = hasThumbnail && {
|
|
89
|
-
backgroundImage: `url(${mediaSrc})`,
|
|
90
|
-
backgroundSize: "cover"
|
|
91
|
-
};
|
|
92
|
-
return /* @__PURE__ */ jsx(Card, { className: clsx("card-file", className), isClickable, isSelectable, isSelected, onClick, app, isFocused, onSelect, children: /* @__PURE__ */ jsxs(Card.Body, { space: "8", children: [
|
|
93
|
-
/* @__PURE__ */ jsx("div", { ref, className: file, style: {
|
|
94
|
-
aspectRatio: "16/10",
|
|
95
|
-
...imageStyles
|
|
96
|
-
}, children: type !== "img" || type === "img" && !hasThumbnail ? /* @__PURE__ */ jsx(FileIcon, { type, roleMap }) : null }),
|
|
97
|
-
/* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
|
|
98
|
-
/* @__PURE__ */ jsx(Card.Text, { children: doc.name }),
|
|
99
|
-
/* @__PURE__ */ jsx(Card.Text, { className: "text-black-50", children: doc == null ? void 0 : doc.ownerDisplayName })
|
|
100
|
-
] })
|
|
101
|
-
] }) });
|
|
102
|
-
};
|
|
103
|
-
export {
|
|
104
|
-
NextcloudFileCard as default
|
|
105
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Nextcloud: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { odeServices } from "@edifice.io/client";
|
|
3
|
-
import { useMediaLibraryContext } from "../MediaLibraryContext.js";
|
|
4
|
-
import useUser from "../../../../hooks/useUser/useUser.js";
|
|
5
|
-
import Nextcloud$1 from "../../Nextcloud/Nextcloud.js";
|
|
6
|
-
const Nextcloud = () => {
|
|
7
|
-
const {
|
|
8
|
-
setResultCounter,
|
|
9
|
-
setResult,
|
|
10
|
-
setPreSuccess,
|
|
11
|
-
multiple
|
|
12
|
-
} = useMediaLibraryContext(), {
|
|
13
|
-
user
|
|
14
|
-
} = useUser();
|
|
15
|
-
function handleSelect(result) {
|
|
16
|
-
setResultCounter(result.length), result.length ? (setResult(result), setPreSuccess(() => () => user != null && user.userId ? odeServices.nextcloud().copyDocumentToWorkspace(user.userId, result.map((doc) => doc.path)) : Promise.resolve([]))) : (setResult(), setPreSuccess(void 0));
|
|
17
|
-
}
|
|
18
|
-
return /* @__PURE__ */ jsx(Nextcloud$1, { onSelect: handleSelect, multiple, className: "border rounded overflow-y-auto" });
|
|
19
|
-
};
|
|
20
|
-
export {
|
|
21
|
-
Nextcloud
|
|
22
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { NextcloudDocument } from '@edifice.io/client';
|
|
2
|
-
/**
|
|
3
|
-
* Nextcloud component properties
|
|
4
|
-
*/
|
|
5
|
-
export interface NextcloudProps {
|
|
6
|
-
/**
|
|
7
|
-
* Notify parent when media elements are successfully selected.
|
|
8
|
-
*/
|
|
9
|
-
onSelect: (result: NextcloudDocument[]) => void;
|
|
10
|
-
/**
|
|
11
|
-
* Boolean to know if we can select 1 or many files.
|
|
12
|
-
*/
|
|
13
|
-
multiple?: boolean | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Optional class for styling purpose
|
|
16
|
-
*/
|
|
17
|
-
className?: string;
|
|
18
|
-
}
|
|
19
|
-
declare const Nextcloud: ({ onSelect, multiple, className, }: NextcloudProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export default Nextcloud;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useCallback, useEffect, useMemo } from "react";
|
|
3
|
-
import clsx from "clsx";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { findNodeById } from "../../../components/Tree/utilities/tree.js";
|
|
6
|
-
import SvgIconSortAscendingLetters from "../../icons/components/IconSortAscendingLetters.js";
|
|
7
|
-
import SvgIconSortDescendingLetters from "../../icons/components/IconSortDescendingLetters.js";
|
|
8
|
-
import SvgIconSortTime from "../../icons/components/IconSortTime.js";
|
|
9
|
-
import illuNoContentInFolder from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-no-content-in-folder.svg";
|
|
10
|
-
import useUser from "../../../hooks/useUser/useUser.js";
|
|
11
|
-
import useNextcloudSearch from "../../../hooks/useNextcloudSearch/useNextcloudSearch.js";
|
|
12
|
-
import { Grid } from "../../../components/Grid/Grid.js";
|
|
13
|
-
import Tree from "../../../components/Tree/components/Tree.js";
|
|
14
|
-
import SearchBar from "../../../components/SearchBar/SearchBar.js";
|
|
15
|
-
import Dropdown from "../../../components/Dropdown/Dropdown.js";
|
|
16
|
-
import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
|
|
17
|
-
import NextcloudFileCard from "../FileCard/NextcloudFileCard.js";
|
|
18
|
-
import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
|
|
19
|
-
const ROOT_ID = "root";
|
|
20
|
-
function compare(a, b) {
|
|
21
|
-
return a ? b ? a.localeCompare(b) : 1 : -1;
|
|
22
|
-
}
|
|
23
|
-
const Nextcloud = ({
|
|
24
|
-
onSelect,
|
|
25
|
-
multiple = !0,
|
|
26
|
-
className
|
|
27
|
-
}) => {
|
|
28
|
-
const {
|
|
29
|
-
t
|
|
30
|
-
} = useTranslation(), {
|
|
31
|
-
user
|
|
32
|
-
} = useUser(), {
|
|
33
|
-
root,
|
|
34
|
-
loadContent
|
|
35
|
-
} = useNextcloudSearch(ROOT_ID, t("nextcloud.tree.root"), user == null ? void 0 : user.userId), [currentNodeId, setCurrentNodeId] = useState(ROOT_ID), treeRoot = root, currentNode = findNodeById(treeRoot, currentNodeId) ?? root, [searchTerm, setSearchTerm] = useState(null), [sortOrder, setSortOrder] = useState(["modified", "desc"]), [selectedDocuments, setSelectedDocuments] = useState([]), handleTreeItemChange = useCallback((nodeId) => {
|
|
36
|
-
setCurrentNodeId(nodeId), loadContent(nodeId);
|
|
37
|
-
}, [loadContent]);
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
loadContent(ROOT_ID);
|
|
40
|
-
}, [loadContent]);
|
|
41
|
-
const documents = useMemo(() => {
|
|
42
|
-
if (!currentNode.files) return;
|
|
43
|
-
let list = [].concat(currentNode.files);
|
|
44
|
-
searchTerm && (list = list.filter((f) => f.name.indexOf(searchTerm) >= 0));
|
|
45
|
-
const sortFunction = sortOrder[0] === "name" ? sortOrder[1] === "asc" ? (a, b) => compare(a.name, b.name) : (a, b) => compare(b.name, a.name) : (a, b) => compare(b.lastModified, a.lastModified);
|
|
46
|
-
return list.sort(sortFunction);
|
|
47
|
-
}, [root, currentNode, searchTerm, sortOrder]), selectedPaths = useMemo(() => new Set(selectedDocuments.map((d) => d.path)), [selectedDocuments]), handleSearchChange = useCallback((e) => {
|
|
48
|
-
setSearchTerm(e.target.value);
|
|
49
|
-
}, [setSearchTerm]);
|
|
50
|
-
function getSortOrderLabel() {
|
|
51
|
-
return sortOrder[0] === "name" ? sortOrder[1] === "asc" ? t("sort.order.alpha.asc") : t("sort.order.alpha.desc") : t("sort.order.modify.desc");
|
|
52
|
-
}
|
|
53
|
-
function handleSelectDoc(doc) {
|
|
54
|
-
let currentDocuments = [...selectedDocuments];
|
|
55
|
-
multiple ? currentDocuments.includes(doc) ? currentDocuments = currentDocuments.filter((selectedDocument) => selectedDocument.path !== doc.path) : currentDocuments = [...currentDocuments, doc] : currentDocuments = [doc], setSelectedDocuments(currentDocuments), onSelect(currentDocuments);
|
|
56
|
-
}
|
|
57
|
-
const nextcloud = clsx("workspace flex-grow-1 gap-0", className);
|
|
58
|
-
return /* @__PURE__ */ jsxs(Grid, { className: nextcloud, children: [
|
|
59
|
-
/* @__PURE__ */ jsx(Grid.Col, { sm: "12", md: "3", xl: "4", className: "workspace-folders p-12 pt-0 gap-12", children: /* @__PURE__ */ jsx("div", { style: {
|
|
60
|
-
position: "sticky",
|
|
61
|
-
top: 0,
|
|
62
|
-
paddingTop: "1.2rem"
|
|
63
|
-
}, children: /* @__PURE__ */ jsx(Tree, { nodes: treeRoot, selectedNodeId: currentNodeId, showIcon: !0, onTreeItemClick: handleTreeItemChange, onTreeItemUnfold: handleTreeItemChange }) }) }),
|
|
64
|
-
/* @__PURE__ */ jsx(Grid.Col, { sm: "12", md: "5", xl: "8", children: /* @__PURE__ */ jsxs(Grid, { className: "flex-grow-1 gap-0", children: [
|
|
65
|
-
/* @__PURE__ */ jsxs(Grid.Col, { sm: "4", md: "8", xl: "12", children: [
|
|
66
|
-
/* @__PURE__ */ jsx("div", { className: "workspace-search px-16 py-8 ", children: /* @__PURE__ */ jsx(SearchBar, { isVariant: !0, className: "gap-16", onChange: handleSearchChange }) }),
|
|
67
|
-
/* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center justify-content-end px-8 py-4", children: [
|
|
68
|
-
/* @__PURE__ */ jsx("small", { className: "text-muted", children: t("workspace.search.order") }),
|
|
69
|
-
/* @__PURE__ */ jsxs(Dropdown, { children: [
|
|
70
|
-
/* @__PURE__ */ jsx(Dropdown.Trigger, { size: "sm", label: getSortOrderLabel(), variant: "ghost" }),
|
|
71
|
-
/* @__PURE__ */ jsxs(Dropdown.Menu, { children: [
|
|
72
|
-
/* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortTime, {}), onClick: () => setSortOrder(["modified", "desc"]), children: t("sort.order.modify.desc") }),
|
|
73
|
-
/* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortAscendingLetters, {}), onClick: () => setSortOrder(["name", "asc"]), children: t("sort.order.alpha.asc") }),
|
|
74
|
-
/* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortDescendingLetters, {}), onClick: () => setSortOrder(["name", "desc"]), children: t("sort.order.alpha.desc") })
|
|
75
|
-
] })
|
|
76
|
-
] })
|
|
77
|
-
] })
|
|
78
|
-
] }),
|
|
79
|
-
/* @__PURE__ */ jsx(Grid.Col, { sm: "4", md: "8", xl: "12", className: "p-8 gap-8", children: documents ? documents.length !== 0 ? /* @__PURE__ */ jsx("div", { className: "grid grid-workspace", children: documents.map((doc) => {
|
|
80
|
-
const isSelected = selectedPaths.has(doc.path);
|
|
81
|
-
return /* @__PURE__ */ jsx(NextcloudFileCard, { doc, userId: user.userId, isSelected, onClick: () => handleSelectDoc(doc) }, doc.path);
|
|
82
|
-
}) }) : /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuNoContentInFolder, size: 64, text: t("nextcloud.empty.docSpace") }) : /* @__PURE__ */ jsx(LoadingScreen, {}) })
|
|
83
|
-
] }) })
|
|
84
|
-
] });
|
|
85
|
-
};
|
|
86
|
-
export {
|
|
87
|
-
Nextcloud as default
|
|
88
|
-
};
|