@edifice.io/react 2.6.7-feat-INTEG-1924-port-react-nextcloud-filetree.20260929125646 → 2.6.8
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/Alert/Alert.js +47 -23
- package/dist/components/AppIcon/AppIcon.js +11 -5
- package/dist/components/Form/FormText.js +11 -6
- package/dist/components/Image/Image.js +5 -2
- package/dist/components/Input/Input.d.ts +11 -2
- package/dist/components/Input/Input.js +43 -21
- package/dist/components/Label/Label.js +4 -4
- package/dist/components/Layout/Layout.js +15 -11
- package/dist/components/LinkPill/LinkPill.d.ts +41 -0
- package/dist/components/LinkPill/LinkPill.js +28 -0
- package/dist/components/LinkPill/index.d.ts +2 -0
- package/dist/components/ModalBeta/ModalBeta.d.ts +47 -0
- package/dist/components/ModalBeta/ModalBeta.js +62 -0
- package/dist/components/ModalBeta/ModalBetaBody.d.ts +19 -0
- package/dist/components/ModalBeta/ModalBetaBody.js +15 -0
- package/dist/components/ModalBeta/ModalBetaContext.d.ts +7 -0
- package/dist/components/ModalBeta/ModalBetaContext.js +15 -0
- package/dist/components/ModalBeta/ModalBetaFooter.d.ts +13 -0
- package/dist/components/ModalBeta/ModalBetaFooter.js +7 -0
- package/dist/components/ModalBeta/ModalBetaHeader.d.ts +23 -0
- package/dist/components/ModalBeta/ModalBetaHeader.js +31 -0
- package/dist/components/ModalBeta/index.d.ts +2 -0
- package/dist/components/PageLayout/PageLayout.d.ts +4 -0
- package/dist/components/PageLayout/PageLayout.js +37 -14
- package/dist/components/PageLayout/components/PageLayoutContent.js +5 -1
- package/dist/components/PageLayout/components/PageLayoutHelpZone.d.ts +12 -0
- package/dist/components/PageLayout/components/PageLayoutHelpZone.js +6 -0
- package/dist/components/Table/components/Table.d.ts +2 -2
- package/dist/components/Table/components/TableTd.d.ts +1 -1
- package/dist/components/Table/components/TableTh.d.ts +1 -1
- package/dist/components/Tree/utilities/tree.js +1 -21
- package/dist/components/index.d.ts +2 -0
- package/dist/homepage.js +12 -1
- package/dist/hooks/index.d.ts +2 -1
- package/dist/hooks/useBackground/index.d.ts +1 -0
- package/dist/hooks/useBackground/useBackground.d.ts +8 -0
- package/dist/hooks/useBackground/useBackground.js +18 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -1
- package/dist/hooks/useClickOutside/useClickOutside.js +3 -2
- package/dist/hooks/useToast/useToast.d.ts +1 -0
- package/dist/hooks/useToast/useToast.js +12 -9
- package/dist/hooks/useUserPreferences/index.d.ts +1 -0
- package/dist/hooks/useUserPreferences/useUserPreferences.d.ts +9 -0
- package/dist/hooks/useUserPreferences/useUserPreferences.js +40 -0
- package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +14 -2
- package/dist/hooks/useZendeskGuide/useZendeskGuide.js +51 -24
- package/dist/index.js +60 -58
- package/dist/modules/HelpZone/HelpZone.d.ts +13 -0
- package/dist/modules/HelpZone/HelpZone.js +52 -0
- package/dist/modules/HelpZone/HelpZoneContainer.d.ts +4 -0
- package/dist/modules/HelpZone/HelpZoneContainer.js +18 -0
- package/dist/modules/HelpZone/index.d.ts +3 -0
- package/dist/modules/homepage/components/Favorites/Favorites.js +2 -2
- package/dist/modules/homepage/components/Header/Header.js +11 -4
- package/dist/modules/homepage/components/HomeCard/HomeCard.d.ts +1 -1
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +15 -1
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +2 -1
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +36 -26
- package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +1 -1
- package/dist/modules/homepage/components/Notifications/services/queries/notification.js +9 -2
- package/dist/modules/homepage/components/UsefulLinks/LinkForm.d.ts +13 -0
- package/dist/modules/homepage/components/UsefulLinks/LinkForm.js +67 -0
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.d.ts +6 -0
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +31 -0
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksContainer.d.ts +1 -0
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksContainer.js +40 -0
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.d.ts +11 -0
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +65 -0
- package/dist/modules/homepage/components/UsefulLinks/hooks/useUsefulLinksContainer.d.ts +19 -0
- package/dist/modules/homepage/components/UsefulLinks/hooks/useUsefulLinksContainer.js +26 -0
- package/dist/modules/homepage/components/UsefulLinks/index.d.ts +5 -0
- package/dist/modules/homepage/components/UsefulLinks/services/api/index.d.ts +6 -0
- package/dist/modules/homepage/components/UsefulLinks/services/api/index.js +5 -0
- package/dist/modules/homepage/components/UsefulLinks/services/api/usefulLinksService.d.ts +31 -0
- package/dist/modules/homepage/components/UsefulLinks/services/api/usefulLinksService.js +50 -0
- package/dist/modules/homepage/components/UsefulLinks/services/queries/usefulLinks.d.ts +20 -0
- package/dist/modules/homepage/components/UsefulLinks/services/queries/usefulLinks.js +65 -0
- package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.js +18 -8
- package/dist/modules/homepage/components/index.d.ts +1 -0
- package/dist/modules/icons/components/logo/IconLogoEdificeFull.d.ts +7 -0
- package/dist/modules/icons/components/logo/IconLogoEdificeFull.js +26 -0
- package/dist/modules/icons/components/logo/IconLogoEdificeSmall.d.ts +7 -0
- package/dist/modules/icons/components/logo/IconLogoEdificeSmall.js +17 -0
- package/dist/modules/icons/components/logo/index.d.ts +2 -0
- package/dist/modules/multimedia/FileCard/index.d.ts +0 -2
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +1 -7
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +0 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +2 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +11 -36
- 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/Workspace/Workspace.js +5 -8
- package/dist/modules/multimedia/index.d.ts +0 -1
- package/dist/modules/widgets/index.d.ts +1 -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 -14
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +0 -64
- package/dist/modules/multimedia/FileCard/NextcloudFileCard.d.ts +0 -25
- package/dist/modules/multimedia/FileCard/NextcloudFileCard.js +0 -102
- package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.d.ts +0 -1
- package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.js +0 -48
- package/dist/modules/multimedia/Nextcloud/Nextcloud.d.ts +0 -24
- package/dist/modules/multimedia/Nextcloud/Nextcloud.js +0 -124
- package/dist/modules/multimedia/Nextcloud/index.d.ts +0 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import { App, ILinkedResource } from '@edifice.io/client';
|
|
3
2
|
/**
|
|
4
3
|
* Definition of an internal link.
|
|
@@ -33,11 +32,6 @@ export interface InternalLinkerProps {
|
|
|
33
32
|
applicationList?: ApplicationOption[];
|
|
34
33
|
/** Whether to show the application selector */
|
|
35
34
|
showApplicationSelector?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Rendered on the search row, where the application selector sits, for
|
|
38
|
-
* consumers that hide that selector but still need a filter of their own.
|
|
39
|
-
*/
|
|
40
|
-
searchFilter?: ReactNode;
|
|
41
35
|
/** Disable application selecetor */
|
|
42
36
|
disableApplicationSelector?: boolean;
|
|
43
37
|
/** Optional callback to filter resources after loading. Applied in addition to search filters. */
|
|
@@ -55,5 +49,5 @@ export interface InternalLinkerProps {
|
|
|
55
49
|
/** Label for the "load more" button. Defaults to the `bbm.linker.see.more` i18n key. */
|
|
56
50
|
loadMoreLabel?: string;
|
|
57
51
|
}
|
|
58
|
-
export declare const InternalLinker: ({ appCode, defaultAppCode, defaultResourceId, onChange, onSelect, multiple, resourceList, applicationList, showApplicationSelector,
|
|
52
|
+
export declare const InternalLinker: ({ appCode, defaultAppCode, defaultResourceId, onChange, onSelect, multiple, resourceList, applicationList, showApplicationSelector, disableApplicationSelector, resourceFilter, onSearch, hasMoreResources, onLoadMore, loadMoreLabel, }: InternalLinkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
59
53
|
export default InternalLinker;
|
|
@@ -23,7 +23,6 @@ const InternalLinker = ({
|
|
|
23
23
|
resourceList,
|
|
24
24
|
applicationList,
|
|
25
25
|
showApplicationSelector = !0,
|
|
26
|
-
searchFilter,
|
|
27
26
|
disableApplicationSelector = !1,
|
|
28
27
|
resourceFilter,
|
|
29
28
|
onSearch,
|
|
@@ -132,7 +131,6 @@ const InternalLinker = ({
|
|
|
132
131
|
] }), variant: "ghost", size: "md", disabled: disableApplicationSelector }),
|
|
133
132
|
/* @__PURE__ */ jsx(Dropdown.Menu, { children: options == null ? void 0 : options.map((option) => /* @__PURE__ */ jsx(Dropdown.Item, { icon: option.icon, onClick: () => handleOptionClick(option), children: option.displayName }, option.application)) })
|
|
134
133
|
] }) }),
|
|
135
|
-
!showApplicationSelector && searchFilter && /* @__PURE__ */ jsx("div", { className: "flex-shrink-1 px-8 py-12 border-end align-self-center", children: searchFilter }),
|
|
136
134
|
/* @__PURE__ */ jsx("div", { className: "flex-grow-1 align-self-center", children: /* @__PURE__ */ jsx("form", { className: "gap-16 d-flex w-100 align-items-center px-16 py-8", onSubmit: handleSubmit, children: /* @__PURE__ */ jsx(SearchBar, { isVariant: !0, placeholder: t("search"), size: "lg", className: "w-100", disabled: !selectedApplication, onChange: handleSearchChange }) }) })
|
|
137
135
|
] }),
|
|
138
136
|
/* @__PURE__ */ jsxs("div", { className: "internal-linker flex-grow-1 w-100 rounded-bottom border gap-0 overflow-auto", children: [
|
|
@@ -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
|
*/
|
|
@@ -5,7 +5,6 @@ import { useTranslation } from "react-i18next";
|
|
|
5
5
|
import SvgIconApplications from "../../icons/components/IconApplications.js";
|
|
6
6
|
import SvgIconCode from "../../icons/components/IconCode.js";
|
|
7
7
|
import SvgIconFolder from "../../icons/components/IconFolder.js";
|
|
8
|
-
import SvgIconGlobe2 from "../../icons/components/IconGlobe2.js";
|
|
9
8
|
import SvgIconGlobe from "../../icons/components/IconGlobe.js";
|
|
10
9
|
import SvgIconMic from "../../icons/components/IconMic.js";
|
|
11
10
|
import SvgIconRecordVideo from "../../icons/components/IconRecordVideo.js";
|
|
@@ -13,7 +12,6 @@ import SvgIconSmartphone from "../../icons/components/IconSmartphone.js";
|
|
|
13
12
|
import { InnerTabs } from "./innertabs/index.js";
|
|
14
13
|
import { MediaLibraryContext } from "./MediaLibraryContext.js";
|
|
15
14
|
import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
16
|
-
import usePublicConf from "../../../hooks/usePublicConf/usePublicConf.js";
|
|
17
15
|
import useHttpErrorToast from "../../../hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
18
16
|
import Modal from "../../../components/Modal/Modal.js";
|
|
19
17
|
import { Tabs } from "../../../components/Tabs/components/Tabs.js";
|
|
@@ -31,8 +29,6 @@ const orderedTabs = [
|
|
|
31
29
|
// Filesystem browser + drag'n'drop of files
|
|
32
30
|
"workspace",
|
|
33
31
|
// Media browser
|
|
34
|
-
"nextcloud",
|
|
35
|
-
// Nextcloud media browser
|
|
36
32
|
"video-embedder"
|
|
37
33
|
// Link to a hosted video
|
|
38
34
|
], mediaLibraryTypes = {
|
|
@@ -74,7 +70,7 @@ const orderedTabs = [
|
|
|
74
70
|
onCancel,
|
|
75
71
|
onTabChange
|
|
76
72
|
}, ref) => {
|
|
77
|
-
var _a
|
|
73
|
+
var _a;
|
|
78
74
|
const linkTabProps = useRef(), refModal = useRef(null);
|
|
79
75
|
useImperativeHandle(ref, () => ({
|
|
80
76
|
show,
|
|
@@ -85,9 +81,7 @@ const orderedTabs = [
|
|
|
85
81
|
}));
|
|
86
82
|
const {
|
|
87
83
|
t
|
|
88
|
-
} = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"),
|
|
89
|
-
data: workspacePublicConf
|
|
90
|
-
} = usePublicConf("workspace"), enableNextcloudTab = ((_a = workspacePublicConf == null ? void 0 : workspacePublicConf["folder-service"]) == null ? void 0 : _a.includes("nextcloud")) && nextcloudViewWorkflow, [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);
|
|
91
85
|
useHttpErrorToast({
|
|
92
86
|
active: !!type,
|
|
93
87
|
isDismissible: !0,
|
|
@@ -102,14 +96,6 @@ const orderedTabs = [
|
|
|
102
96
|
availableFor: ["audio", "video", "image", "attachment"],
|
|
103
97
|
isEnable: null
|
|
104
98
|
},
|
|
105
|
-
nextcloud: {
|
|
106
|
-
id: "nextcloud",
|
|
107
|
-
icon: /* @__PURE__ */ jsx(SvgIconGlobe2, {}),
|
|
108
|
-
label: t("bbm.nextcloud"),
|
|
109
|
-
content: /* @__PURE__ */ jsx(InnerTabs.Nextcloud, {}),
|
|
110
|
-
availableFor: ["audio", "video", "image", "attachment"],
|
|
111
|
-
isEnable: () => !!enableNextcloudTab
|
|
112
|
-
},
|
|
113
99
|
upload: {
|
|
114
100
|
id: "upload",
|
|
115
101
|
icon: /* @__PURE__ */ jsx(SvgIconSmartphone, {}),
|
|
@@ -176,7 +162,7 @@ const orderedTabs = [
|
|
|
176
162
|
), [defaultTabId, setDefaultTabId] = useState(), defaultTabIdx = useMemo(() => {
|
|
177
163
|
const index = tabs.findIndex((t2) => t2.id === defaultTabId);
|
|
178
164
|
return 0 > index || index >= tabs.length ? 0 : index;
|
|
179
|
-
}, [tabs, defaultTabId]), [resultCounter, setResultCounter] = useState(), [result, setResult] = useState(), [deletionsOnCancel, setDeletionsOnCancel] = useState([]), [onSuccessAction, setPreSuccess] = useState()
|
|
165
|
+
}, [tabs, defaultTabId]), [resultCounter, setResultCounter] = useState(), [result, setResult] = useState(), [deletionsOnCancel, setDeletionsOnCancel] = useState([]), [onSuccessAction, setPreSuccess] = useState();
|
|
180
166
|
function setVisibleTab(tab) {
|
|
181
167
|
throw tabs.findIndex((t2) => t2.id === tab) < 0 ? "tab.not.visible" : "not.implemented.yet";
|
|
182
168
|
}
|
|
@@ -191,33 +177,22 @@ const orderedTabs = [
|
|
|
191
177
|
linkTabProps.current = props, "resourceId" in props || "appPrefix" in props || setDefaultTabId("external-link"), setType("hyperlink");
|
|
192
178
|
};
|
|
193
179
|
useEffect(() => {
|
|
194
|
-
var _a2,
|
|
180
|
+
var _a2, _b;
|
|
195
181
|
const typeKey = type || "none";
|
|
196
|
-
!defaultTabId && typeof ((_a2 = mediaLibraryTypes[typeKey]) == null ? void 0 : _a2.defaultTab) == "string" && setDefaultTabId((
|
|
182
|
+
!defaultTabId && typeof ((_a2 = mediaLibraryTypes[typeKey]) == null ? void 0 : _a2.defaultTab) == "string" && setDefaultTabId((_b = mediaLibraryTypes[typeKey]) == null ? void 0 : _b.defaultTab);
|
|
197
183
|
}, [defaultTabId, type]);
|
|
198
|
-
const modalHeader = t(((
|
|
184
|
+
const modalHeader = t(((_a = mediaLibraryTypes[type ?? "none"]) == null ? void 0 : _a.title) ?? "bbm"), resetState = () => {
|
|
199
185
|
linkTabProps.current = void 0, setResult(void 0), setResultCounter(void 0), setDefaultTabId(void 0), setPreSuccess(void 0), setDeletionsOnCancel([]);
|
|
200
186
|
}, handleTabChange = (tab) => {
|
|
201
187
|
onTabChange == null || onTabChange(tab, deletionsOnCancel), resetState();
|
|
202
188
|
}, handleOnSuccess = useCallback(() => {
|
|
203
|
-
if (isSubmitting) return;
|
|
204
189
|
const triggerSuccess = async (result2) => {
|
|
205
190
|
result2 instanceof Array && ["protected", "public"].findIndex((v) => v === visibility) >= 0 && (result2 = await odeServices.workspace().transferDocuments(result2, appCode ?? "media-library", visibility)), onSuccess(result2);
|
|
206
191
|
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
const asyncResult = await onSuccessAction();
|
|
212
|
-
await triggerSuccess(asyncResult);
|
|
213
|
-
} else result && await triggerSuccess(result);
|
|
214
|
-
resetState();
|
|
215
|
-
} catch {
|
|
216
|
-
} finally {
|
|
217
|
-
setIsSubmitting(!1);
|
|
218
|
-
}
|
|
219
|
-
})();
|
|
220
|
-
}, [isSubmitting, onSuccessAction, result, onSuccess, visibility, appCode]), handleOnCancel = () => {
|
|
192
|
+
onSuccessAction ? onSuccessAction().then((result2) => {
|
|
193
|
+
triggerSuccess(result2);
|
|
194
|
+
}) : result && triggerSuccess(result), resetState();
|
|
195
|
+
}, [onSuccessAction, result, onSuccess, visibility, appCode]), handleOnCancel = () => {
|
|
221
196
|
onCancel(deletionsOnCancel), resetState();
|
|
222
197
|
};
|
|
223
198
|
return type && /* @__PURE__ */ jsx(MediaLibraryContext.Provider, { value: {
|
|
@@ -239,7 +214,7 @@ const orderedTabs = [
|
|
|
239
214
|
] }) }),
|
|
240
215
|
/* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
|
241
216
|
/* @__PURE__ */ jsx(Button, { type: "button", color: "tertiary", variant: "ghost", onClick: handleOnCancel, children: t("cancel") }),
|
|
242
|
-
/* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "filled", disabled: typeof result > "u"
|
|
217
|
+
/* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "filled", disabled: typeof result > "u", onClick: handleOnSuccess, children: resultCounter && resultCounter > 1 ? t("addMultiple", {
|
|
243
218
|
number: resultCounter
|
|
244
219
|
}) : t("add") })
|
|
245
220
|
] })
|
|
@@ -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
|
|
@@ -6,7 +6,6 @@ import SvgIconSortAscendingLetters from "../../icons/components/IconSortAscendin
|
|
|
6
6
|
import SvgIconSortDescendingLetters from "../../icons/components/IconSortDescendingLetters.js";
|
|
7
7
|
import SvgIconSortTime from "../../icons/components/IconSortTime.js";
|
|
8
8
|
import illuTrash from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-trash.svg";
|
|
9
|
-
import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
10
9
|
import useWorkspaceSearch from "../../../hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
11
10
|
import { Grid } from "../../../components/Grid/Grid.js";
|
|
12
11
|
import TreeView from "../../../components/TreeView/TreeView.js";
|
|
@@ -16,7 +15,7 @@ import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
|
|
|
16
15
|
import FileCard from "../FileCard/FileCard.js";
|
|
17
16
|
import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
|
|
18
17
|
import { findTreeNode } from "../../../components/TreeView/utilities/treeview.js";
|
|
19
|
-
const
|
|
18
|
+
const Workspace = ({
|
|
20
19
|
roles,
|
|
21
20
|
onSelect,
|
|
22
21
|
multiple = !0,
|
|
@@ -26,7 +25,7 @@ const WORKSPACE_VIEW_WORKFLOW = "org.entcore.workspace.controllers.WorkspaceCont
|
|
|
26
25
|
}) => {
|
|
27
26
|
const {
|
|
28
27
|
t
|
|
29
|
-
} = useTranslation(),
|
|
28
|
+
} = useTranslation(), {
|
|
30
29
|
root: ownerRoot,
|
|
31
30
|
loadContent: loadOwnerDocs
|
|
32
31
|
} = useWorkspaceSearch("root", t("workspace.tree.owner"), "owner", roles), {
|
|
@@ -112,9 +111,7 @@ const WORKSPACE_VIEW_WORKFLOW = "org.entcore.workspace.controllers.WorkspaceCont
|
|
|
112
111
|
return;
|
|
113
112
|
}
|
|
114
113
|
(_a = ref == null ? void 0 : ref.current) == null || _a.select("root");
|
|
115
|
-
}, [currentFilter]), useEffect(() => {
|
|
116
|
-
hasWorkspaceViewRight === !1 && (currentFilter === "owner" || currentFilter === "shared") && selectAndLoadContent("protected", "root");
|
|
117
|
-
}, [hasWorkspaceViewRight]), useEffect(loadContent, [loadContent]), useEffect(() => {
|
|
114
|
+
}, [currentFilter]), useEffect(loadContent, [loadContent]), useEffect(() => {
|
|
118
115
|
if (currentNode.files) {
|
|
119
116
|
let list = [].concat(currentNode.files);
|
|
120
117
|
searchTerm && (list = list.filter((f) => f.name.indexOf(searchTerm) >= 0));
|
|
@@ -143,8 +140,8 @@ const WORKSPACE_VIEW_WORKFLOW = "org.entcore.workspace.controllers.WorkspaceCont
|
|
|
143
140
|
top: 0,
|
|
144
141
|
paddingTop: "1.2rem"
|
|
145
142
|
}, children: [
|
|
146
|
-
|
|
147
|
-
|
|
143
|
+
/* @__PURE__ */ jsx(TreeView, { ref: ownerRef, data: ownerRoot, onTreeItemClick: (nodeId) => selectAndLoadContent("owner", nodeId), onTreeItemUnfold: (nodeId) => selectAndLoadContent("owner", nodeId) }),
|
|
144
|
+
/* @__PURE__ */ jsx(TreeView, { ref: sharedRef, data: sharedRoot, onTreeItemClick: (nodeId) => selectAndLoadContent("shared", nodeId), onTreeItemUnfold: (nodeId) => selectAndLoadContent("shared", nodeId) }),
|
|
148
145
|
/* @__PURE__ */ jsx(TreeView, { ref: protectRef, data: protectRoot, onTreeItemClick: (nodeId) => selectAndLoadContent("protected", nodeId), onTreeItemUnfold: (nodeId) => selectAndLoadContent("protected", nodeId) }),
|
|
149
146
|
showPublicFolder && /* @__PURE__ */ jsx(TreeView, { ref: publicRef, data: publicRoot, onTreeItemClick: (nodeId) => selectAndLoadContent("public", nodeId), onTreeItemUnfold: (nodeId) => selectAndLoadContent("public", nodeId) })
|
|
150
147
|
] }) }),
|
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.
|
|
3
|
+
"version": "2.6.8",
|
|
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.
|
|
144
|
-
"@edifice.io/tiptap-extensions": "2.6.
|
|
145
|
-
"@edifice.io/utilities": "2.6.
|
|
143
|
+
"@edifice.io/bootstrap": "2.6.8",
|
|
144
|
+
"@edifice.io/tiptap-extensions": "2.6.8",
|
|
145
|
+
"@edifice.io/utilities": "2.6.8"
|
|
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/client": "2.6.
|
|
177
|
-
"@edifice.io/config": "2.6.
|
|
176
|
+
"@edifice.io/client": "2.6.8",
|
|
177
|
+
"@edifice.io/config": "2.6.8"
|
|
178
178
|
},
|
|
179
179
|
"peerDependencies": {
|
|
180
180
|
"@react-spring/web": "9.7.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as useNextcloudSearch } from './useNextcloudSearch';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ID, NextcloudDocument } from '@edifice.io/client';
|
|
2
|
-
import { TreeItem } from '../../components/Tree/types';
|
|
3
|
-
export type NextcloudFolderNode = TreeItem & {
|
|
4
|
-
files?: NextcloudDocument[];
|
|
5
|
-
};
|
|
6
|
-
export default function useNextcloudSearch(rootId: string, rootName: string, userId?: string): {
|
|
7
|
-
root: NextcloudFolderNode;
|
|
8
|
-
needsAuth: boolean;
|
|
9
|
-
isCheckingAuth: boolean;
|
|
10
|
-
isAuthError: boolean;
|
|
11
|
-
refetchAuthStatus: () => void;
|
|
12
|
-
loadContent: (folderId?: ID) => void;
|
|
13
|
-
loadError: unknown;
|
|
14
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from "react";
|
|
2
|
-
import { odeServices } from "@edifice.io/client";
|
|
3
|
-
import { useQueryClient, useQuery } from "@tanstack/react-query";
|
|
4
|
-
import { findNodeById, modifyNode } from "../../components/Tree/utilities/tree.js";
|
|
5
|
-
function useNextcloudSearch(rootId, rootName, userId) {
|
|
6
|
-
var _a;
|
|
7
|
-
const [root, setRoot] = useState({
|
|
8
|
-
id: rootId,
|
|
9
|
-
name: rootName,
|
|
10
|
-
section: !0
|
|
11
|
-
}), updateFolder = useCallback((folderId, subfolders, files) => {
|
|
12
|
-
setRoot((prev) => {
|
|
13
|
-
const node = findNodeById(prev, folderId);
|
|
14
|
-
if (!node) return prev;
|
|
15
|
-
const children = subfolders.map((f) => {
|
|
16
|
-
var _a2;
|
|
17
|
-
const existing = (_a2 = node.children) == null ? void 0 : _a2.find((c) => c.id === f.path);
|
|
18
|
-
return existing ? {
|
|
19
|
-
...existing,
|
|
20
|
-
name: f.name
|
|
21
|
-
} : {
|
|
22
|
-
id: f.path,
|
|
23
|
-
name: f.name
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
return modifyNode(prev, (n) => n.id === node.id ? {
|
|
27
|
-
...n,
|
|
28
|
-
children,
|
|
29
|
-
files
|
|
30
|
-
} : n);
|
|
31
|
-
});
|
|
32
|
-
}, []), queryClient = useQueryClient(), oauth2StatusQuery = useQuery({
|
|
33
|
-
queryKey: ["nextcloud", "oauth2-status", userId],
|
|
34
|
-
queryFn: () => odeServices.nextcloud().getOauth2Status(userId),
|
|
35
|
-
enabled: !!userId
|
|
36
|
-
}), needsAuth = !((_a = oauth2StatusQuery.data) != null && _a.connected), [loadError, setLoadError] = useState(null), loadContent = useCallback(async (folderId) => {
|
|
37
|
-
if (!userId) return;
|
|
38
|
-
const path = folderId === rootId ? void 0 : folderId;
|
|
39
|
-
try {
|
|
40
|
-
const payload = await queryClient.fetchQuery({
|
|
41
|
-
queryKey: ["nextcloud", "documents", userId, path ?? "/"],
|
|
42
|
-
queryFn: () => odeServices.nextcloud().listDocuments(userId, path),
|
|
43
|
-
staleTime: 6e4
|
|
44
|
-
}), subfolders = [], files = [], currentPath = path ?? "/";
|
|
45
|
-
payload.filter((doc) => doc.path !== currentPath).forEach((doc) => {
|
|
46
|
-
doc.isFolder ? subfolders.push(doc) : files.push(doc);
|
|
47
|
-
}), setLoadError(null), updateFolder(folderId, subfolders, files);
|
|
48
|
-
} catch (error) {
|
|
49
|
-
setLoadError(error);
|
|
50
|
-
}
|
|
51
|
-
}, [rootId, userId, queryClient, updateFolder]);
|
|
52
|
-
return {
|
|
53
|
-
root,
|
|
54
|
-
needsAuth,
|
|
55
|
-
isCheckingAuth: oauth2StatusQuery.isLoading,
|
|
56
|
-
isAuthError: oauth2StatusQuery.isError,
|
|
57
|
-
refetchAuthStatus: oauth2StatusQuery.refetch,
|
|
58
|
-
loadContent,
|
|
59
|
-
loadError
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
export {
|
|
63
|
-
useNextcloudSearch as default
|
|
64
|
-
};
|
|
@@ -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,102 +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 roleMappings = {
|
|
13
|
-
csv: {
|
|
14
|
-
icon: ".CSV",
|
|
15
|
-
color: "bg-orange-200"
|
|
16
|
-
},
|
|
17
|
-
xls: {
|
|
18
|
-
icon: ".XLS",
|
|
19
|
-
color: "bg-green-200"
|
|
20
|
-
},
|
|
21
|
-
doc: {
|
|
22
|
-
icon: ".DOC",
|
|
23
|
-
color: "bg-blue-200"
|
|
24
|
-
},
|
|
25
|
-
txt: {
|
|
26
|
-
icon: ".TXT",
|
|
27
|
-
color: "bg-blue-200"
|
|
28
|
-
},
|
|
29
|
-
pdf: {
|
|
30
|
-
icon: ".PDF",
|
|
31
|
-
color: "bg-red-200"
|
|
32
|
-
},
|
|
33
|
-
audio: {
|
|
34
|
-
icon: /* @__PURE__ */ jsx(SvgIconMic, { width: 22, height: 22 }),
|
|
35
|
-
color: "bg-red-200"
|
|
36
|
-
},
|
|
37
|
-
ppt: {
|
|
38
|
-
icon: ".PPT",
|
|
39
|
-
color: "bg-red-200"
|
|
40
|
-
},
|
|
41
|
-
img: {
|
|
42
|
-
icon: /* @__PURE__ */ jsx(SvgIconLandscape, { width: 22, height: 22 }),
|
|
43
|
-
color: "bg-green-200"
|
|
44
|
-
},
|
|
45
|
-
video: {
|
|
46
|
-
icon: /* @__PURE__ */ jsx(SvgIconVideo, { width: 22, height: 22 }),
|
|
47
|
-
color: "bg-purple-200"
|
|
48
|
-
},
|
|
49
|
-
zip: {
|
|
50
|
-
icon: ".ZIP",
|
|
51
|
-
color: "bg-gray-300"
|
|
52
|
-
},
|
|
53
|
-
md: {
|
|
54
|
-
icon: ".MD",
|
|
55
|
-
color: "bg-blue-200"
|
|
56
|
-
},
|
|
57
|
-
unknown: {
|
|
58
|
-
icon: /* @__PURE__ */ jsx(SvgIconTextPage, { width: 22, height: 22 }),
|
|
59
|
-
color: "bg-gray-300"
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
function getRoleMap(type, customIcon, customColor) {
|
|
63
|
-
return customIcon !== void 0 || customColor !== void 0 ? {
|
|
64
|
-
icon: customIcon || /* @__PURE__ */ jsx(SvgIconTextPage, { width: 22, height: 22 }),
|
|
65
|
-
color: customColor || "bg-gray-300",
|
|
66
|
-
hasShadow: !1
|
|
67
|
-
} : roleMappings[type] ?? roleMappings.unknown;
|
|
68
|
-
}
|
|
69
|
-
const NextcloudFileCard = ({
|
|
70
|
-
doc,
|
|
71
|
-
userId,
|
|
72
|
-
isClickable = !0,
|
|
73
|
-
isSelectable = !1,
|
|
74
|
-
isSelected = !1,
|
|
75
|
-
onClick,
|
|
76
|
-
className,
|
|
77
|
-
onSelect,
|
|
78
|
-
isFocused,
|
|
79
|
-
app,
|
|
80
|
-
customIcon,
|
|
81
|
-
customColor
|
|
82
|
-
}) => {
|
|
83
|
-
const ref = useRef(null), type = DocumentHelper.role(doc.contentType, !1), roleMap = getRoleMap(type ?? "unknown", customIcon, customColor), 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, {
|
|
84
|
-
ref
|
|
85
|
-
}), imageStyles = hasThumbnail && {
|
|
86
|
-
backgroundImage: `url(${mediaSrc})`,
|
|
87
|
-
backgroundSize: "cover"
|
|
88
|
-
};
|
|
89
|
-
return /* @__PURE__ */ jsx(Card, { className: clsx("card-file", className), isClickable, isSelectable, isSelected, onClick, app, isFocused, onSelect, children: /* @__PURE__ */ jsxs(Card.Body, { space: "8", children: [
|
|
90
|
-
/* @__PURE__ */ jsx("div", { ref, className: file, style: {
|
|
91
|
-
aspectRatio: "16/10",
|
|
92
|
-
...imageStyles
|
|
93
|
-
}, children: type !== "img" || !hasThumbnail ? /* @__PURE__ */ jsx(FileIcon, { type, roleMap }) : null }),
|
|
94
|
-
/* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
|
|
95
|
-
/* @__PURE__ */ jsx(Card.Text, { children: doc.name }),
|
|
96
|
-
/* @__PURE__ */ jsx(Card.Text, { className: "text-black-50", children: doc == null ? void 0 : doc.ownerDisplayName })
|
|
97
|
-
] })
|
|
98
|
-
] }) });
|
|
99
|
-
};
|
|
100
|
-
export {
|
|
101
|
-
NextcloudFileCard as default
|
|
102
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Nextcloud: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,48 +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
|
-
appCode,
|
|
9
|
-
visibility,
|
|
10
|
-
type,
|
|
11
|
-
setResultCounter,
|
|
12
|
-
setResult,
|
|
13
|
-
setPreSuccess,
|
|
14
|
-
multiple
|
|
15
|
-
} = useMediaLibraryContext(), {
|
|
16
|
-
user
|
|
17
|
-
} = useUser();
|
|
18
|
-
function getDocumentRoleFilter() {
|
|
19
|
-
switch (type) {
|
|
20
|
-
case "image":
|
|
21
|
-
return "img";
|
|
22
|
-
case "audio":
|
|
23
|
-
return "audio";
|
|
24
|
-
case "video":
|
|
25
|
-
return "video";
|
|
26
|
-
default:
|
|
27
|
-
return null;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function handleSelect(result) {
|
|
31
|
-
setResultCounter(result.length), result.length ? (setResult(result), setPreSuccess(() => () => user != null && user.userId ? odeServices.nextcloud().copyDocumentToWorkspace(
|
|
32
|
-
user.userId,
|
|
33
|
-
result.map((doc) => doc.path),
|
|
34
|
-
void 0,
|
|
35
|
-
// Copy the documents straight to their final place, the way an
|
|
36
|
-
// upload does, instead of leaving a copy in the user's own
|
|
37
|
-
// documents for the modal to transfer afterwards.
|
|
38
|
-
{
|
|
39
|
-
application: appCode,
|
|
40
|
-
visibility
|
|
41
|
-
}
|
|
42
|
-
) : Promise.resolve([]))) : (setResult(), setPreSuccess(void 0));
|
|
43
|
-
}
|
|
44
|
-
return /* @__PURE__ */ jsx(Nextcloud$1, { roles: getDocumentRoleFilter(), onSelect: handleSelect, multiple, className: "border rounded overflow-y-auto" });
|
|
45
|
-
};
|
|
46
|
-
export {
|
|
47
|
-
Nextcloud
|
|
48
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { NextcloudDocument, Role } 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
|
-
* Document roles to filter files by; null (default) shows all roles.
|
|
16
|
-
*/
|
|
17
|
-
roles?: Role | Role[] | null;
|
|
18
|
-
/**
|
|
19
|
-
* Optional class for styling purpose
|
|
20
|
-
*/
|
|
21
|
-
className?: string;
|
|
22
|
-
}
|
|
23
|
-
declare const Nextcloud: ({ onSelect, multiple, roles, className, }: NextcloudProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
export default Nextcloud;
|