@edifice.io/react 2.6.7-develop-b2school.20261002153216 → 2.6.7-develop-integration.20261003123008

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 (52) hide show
  1. package/dist/components/Layout/Layout.js +5 -17
  2. package/dist/components/Tree/utilities/tree.js +21 -1
  3. package/dist/homepage.js +0 -4
  4. package/dist/hooks/index.d.ts +2 -0
  5. package/dist/hooks/useGoogleDriveSearch/index.d.ts +1 -0
  6. package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.d.ts +14 -0
  7. package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.js +60 -0
  8. package/dist/hooks/useNextcloudSearch/index.d.ts +1 -0
  9. package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +14 -0
  10. package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +64 -0
  11. package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +1 -3
  12. package/dist/hooks/useZendeskGuide/useZendeskGuide.js +3 -10
  13. package/dist/icons.js +402 -404
  14. package/dist/index.js +194 -182
  15. package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +1 -3
  16. package/dist/modules/homepage/components/UserSpace/UserSpace.js +7 -13
  17. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +2 -4
  18. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +2 -3
  19. package/dist/modules/homepage/components/index.d.ts +1 -2
  20. package/dist/modules/icons/components/index.d.ts +0 -1
  21. package/dist/modules/multimedia/FileCard/GoogleDriveFileCard.d.ts +25 -0
  22. package/dist/modules/multimedia/FileCard/GoogleDriveFileCard.js +102 -0
  23. package/dist/modules/multimedia/FileCard/NextcloudFileCard.d.ts +25 -0
  24. package/dist/modules/multimedia/FileCard/NextcloudFileCard.js +102 -0
  25. package/dist/modules/multimedia/FileCard/index.d.ts +4 -0
  26. package/dist/modules/multimedia/GoogleDrive/GoogleDrive.d.ts +24 -0
  27. package/dist/modules/multimedia/GoogleDrive/GoogleDrive.js +100 -0
  28. package/dist/modules/multimedia/GoogleDrive/index.d.ts +2 -0
  29. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +7 -1
  30. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +2 -0
  31. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +2 -2
  32. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +48 -12
  33. package/dist/modules/multimedia/MediaLibrary/innertabs/GoogleDrive.d.ts +1 -0
  34. package/dist/modules/multimedia/MediaLibrary/innertabs/GoogleDrive.js +61 -0
  35. package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.d.ts +1 -0
  36. package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.js +48 -0
  37. package/dist/modules/multimedia/MediaLibrary/innertabs/index.d.ts +2 -0
  38. package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +4 -0
  39. package/dist/modules/multimedia/Nextcloud/Nextcloud.d.ts +24 -0
  40. package/dist/modules/multimedia/Nextcloud/Nextcloud.js +124 -0
  41. package/dist/modules/multimedia/Nextcloud/index.d.ts +2 -0
  42. package/dist/modules/multimedia/Workspace/Workspace.js +8 -5
  43. package/dist/modules/multimedia/index.d.ts +2 -0
  44. package/dist/multimedia.js +26 -18
  45. package/package.json +6 -6
  46. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +0 -16
  47. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +0 -15
  48. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +0 -21
  49. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +0 -47
  50. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +0 -2
  51. package/dist/modules/icons/components/IconAddWidget.d.ts +0 -7
  52. package/dist/modules/icons/components/IconAddWidget.js +0 -12
@@ -0,0 +1,48 @@
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
+ };
@@ -4,6 +4,8 @@ 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
+ GoogleDrive: () => import("react/jsx-runtime").JSX.Element;
7
9
  InternalLink: ({ target, resourceId, appPrefix, }: import('./InternalLink').InternalLinkTabProps) => import("react/jsx-runtime").JSX.Element;
8
10
  Iframe: () => import("react/jsx-runtime").JSX.Element;
9
11
  VideoEmbedder: () => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,9 @@
1
1
  import { Audio } from "./Audio.js";
2
2
  import { ExternalLink } from "./ExternalLink.js";
3
+ import { GoogleDrive } from "./GoogleDrive.js";
3
4
  import { Iframe } from "./Iframe.js";
4
5
  import { InternalLink } from "./InternalLink.js";
6
+ import { Nextcloud } from "./Nextcloud.js";
5
7
  import { Upload } from "./Upload.js";
6
8
  import { Video } from "./Video.js";
7
9
  import { VideoEmbedder } from "./VideoEmbedder.js";
@@ -12,6 +14,8 @@ const InnerTabs = {
12
14
  Upload,
13
15
  ExternalLink,
14
16
  Workspace,
17
+ Nextcloud,
18
+ GoogleDrive,
15
19
  InternalLink,
16
20
  Iframe,
17
21
  VideoEmbedder
@@ -0,0 +1,24 @@
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;
@@ -0,0 +1,124 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useRef, useState, useCallback, useEffect, useMemo } from "react";
3
+ import { DocumentHelper } from "@edifice.io/client";
4
+ import clsx from "clsx";
5
+ import { useTranslation } from "react-i18next";
6
+ import { findNodeById } from "../../../components/Tree/utilities/tree.js";
7
+ import SvgIconSortAscendingLetters from "../../icons/components/IconSortAscendingLetters.js";
8
+ import SvgIconSortDescendingLetters from "../../icons/components/IconSortDescendingLetters.js";
9
+ import SvgIconSortTime from "../../icons/components/IconSortTime.js";
10
+ import illuError from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-error.svg";
11
+ import illuNoContentInFolder from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-no-content-in-folder.svg";
12
+ import illuTrash from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-trash.svg";
13
+ import useUser from "../../../hooks/useUser/useUser.js";
14
+ import useToast from "../../../hooks/useToast/useToast.js";
15
+ import useNextcloudSearch from "../../../hooks/useNextcloudSearch/useNextcloudSearch.js";
16
+ import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
17
+ import Flex from "../../../components/Flex/Flex.js";
18
+ import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
19
+ import Button from "../../../components/Button/Button.js";
20
+ import { Grid } from "../../../components/Grid/Grid.js";
21
+ import Tree from "../../../components/Tree/components/Tree.js";
22
+ import SearchBar from "../../../components/SearchBar/SearchBar.js";
23
+ import Dropdown from "../../../components/Dropdown/Dropdown.js";
24
+ import NextcloudFileCard from "../FileCard/NextcloudFileCard.js";
25
+ const ROOT_ID = "root";
26
+ function compare(a, b) {
27
+ return a === b ? 0 : a === void 0 ? -1 : b === void 0 ? 1 : a.localeCompare(b);
28
+ }
29
+ const Nextcloud = ({
30
+ onSelect,
31
+ multiple = !0,
32
+ roles,
33
+ className
34
+ }) => {
35
+ const {
36
+ t
37
+ } = useTranslation(), {
38
+ user
39
+ } = useUser(), toast = useToast(), {
40
+ root,
41
+ needsAuth,
42
+ isCheckingAuth,
43
+ isAuthError,
44
+ refetchAuthStatus,
45
+ loadContent,
46
+ loadError
47
+ } = useNextcloudSearch(ROOT_ID, t("nextcloud"), user == null ? void 0 : user.userId), popupRef = useRef(null), [currentNodeId, setCurrentNodeId] = useState(ROOT_ID), currentNode = findNodeById(root, currentNodeId) ?? root, [searchTerm, setSearchTerm] = useState(void 0), [sortOrder, setSortOrder] = useState(["modified", "desc"]), [selectedDocuments, setSelectedDocuments] = useState([]), handleTreeItemChange = useCallback((nodeId) => {
48
+ setCurrentNodeId(nodeId), loadContent(nodeId);
49
+ }, [loadContent]);
50
+ useEffect(() => {
51
+ needsAuth || loadContent(ROOT_ID);
52
+ }, [loadContent, needsAuth]);
53
+ const documents = useMemo(() => {
54
+ if (!currentNode.files) return;
55
+ const matchesRole = (doc) => {
56
+ if (!roles) return !0;
57
+ const role = DocumentHelper.role(doc.contentType, !1);
58
+ return Array.isArray(roles) ? roles.includes(role) : roles === role;
59
+ }, normalizedSearchTerm = searchTerm == null ? void 0 : searchTerm.toLowerCase(), list = currentNode.files.filter((f) => (!normalizedSearchTerm || f.name.toLowerCase().includes(normalizedSearchTerm)) && matchesRole(f));
60
+ let sortFunction;
61
+ return sortOrder[0] === "name" ? sortFunction = sortOrder[1] === "asc" ? (a, b) => compare(a.name, b.name) : (a, b) => compare(b.name, a.name) : sortFunction = (a, b) => compare(b.lastModified, a.lastModified), list.sort(sortFunction);
62
+ }, [currentNode, searchTerm, sortOrder, roles]), selectedPaths = useMemo(() => new Set(selectedDocuments.map((d) => d.path)), [selectedDocuments]), handleSearchChange = useCallback((e) => {
63
+ setSearchTerm(e.target.value);
64
+ }, [setSearchTerm]);
65
+ function getSortOrderLabel() {
66
+ return sortOrder[0] === "name" ? sortOrder[1] === "asc" ? t("sort.order.alpha.asc") : t("sort.order.alpha.desc") : t("sort.order.modify.desc");
67
+ }
68
+ function handleSelectDoc(doc) {
69
+ let currentDocuments = [...selectedDocuments];
70
+ multiple ? currentDocuments.some((selectedDocument) => selectedDocument.path === doc.path) ? currentDocuments = currentDocuments.filter((selectedDocument) => selectedDocument.path !== doc.path) : currentDocuments = [...currentDocuments, doc] : currentDocuments = [doc], setSelectedDocuments(currentDocuments), onSelect(currentDocuments);
71
+ }
72
+ const nextcloud = clsx("workspace flex-grow-1 gap-0", className), openLoginPopup = () => {
73
+ popupRef.current = window.open(`${window.location.origin}/nextcloud/user/oauth2/init`, "", "popup, height=600, width=400"), popupRef.current || toast.error(t("nextcloud.auth.popupBlocked"));
74
+ };
75
+ return useEffect(() => {
76
+ function handleMessage(event) {
77
+ var _a;
78
+ event.origin !== window.location.origin || ((_a = event.data) == null ? void 0 : _a.type) !== "nextcloud-connected" || (popupRef.current && !popupRef.current.closed && popupRef.current.close(), refetchAuthStatus());
79
+ }
80
+ return window.addEventListener("message", handleMessage), () => window.removeEventListener("message", handleMessage);
81
+ }, [refetchAuthStatus]), isCheckingAuth ? /* @__PURE__ */ jsx(LoadingScreen, {}) : isAuthError ? /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", className: "h-full w-100", justify: "center", align: "center", children: [
82
+ /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuError, title: t("nextcloud.error.title"), text: t("nextcloud.error.description") }),
83
+ /* @__PURE__ */ jsx(Button, { onClick: () => refetchAuthStatus(), children: t("retry") })
84
+ ] }) : needsAuth ? /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", className: "h-full w-100", justify: "center", align: "center", children: [
85
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "8", justify: "center", align: "center", children: [
86
+ /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuNoContentInFolder }),
87
+ /* @__PURE__ */ jsx("h2", { className: "h2 text-secondary mb-8", children: t("nextcloud.auth.title") }),
88
+ /* @__PURE__ */ jsx("div", { className: "text", children: t("nextcloud.auth.description") })
89
+ ] }),
90
+ /* @__PURE__ */ jsx(Button, { onClick: openLoginPopup, children: t("nextcloud.auth.connect") })
91
+ ] }) : /* @__PURE__ */ jsxs(Grid, { className: nextcloud, children: [
92
+ /* @__PURE__ */ jsx(Grid.Col, { sm: "12", md: "3", xl: "4", className: "workspace-folders p-12 pt-0 gap-12", children: /* @__PURE__ */ jsx("div", { style: {
93
+ position: "sticky",
94
+ top: 0,
95
+ paddingTop: "1.2rem"
96
+ }, children: /* @__PURE__ */ jsx(Tree, { nodes: root, selectedNodeId: currentNodeId, showIcon: !0, onTreeItemClick: handleTreeItemChange, onTreeItemUnfold: handleTreeItemChange }) }) }),
97
+ /* @__PURE__ */ jsx(Grid.Col, { sm: "12", md: "5", xl: "8", children: /* @__PURE__ */ jsxs(Grid, { className: "flex-grow-1 gap-0", children: [
98
+ /* @__PURE__ */ jsxs(Grid.Col, { sm: "4", md: "8", xl: "12", children: [
99
+ /* @__PURE__ */ jsx("div", { className: "workspace-search px-16 py-8 ", children: /* @__PURE__ */ jsx(SearchBar, { isVariant: !0, className: "gap-16", onChange: handleSearchChange }) }),
100
+ /* @__PURE__ */ jsxs(Flex, { className: "px-8 py-4", align: "center", justify: "end", children: [
101
+ /* @__PURE__ */ jsx("small", { className: "text-muted", children: t("workspace.search.order") }),
102
+ /* @__PURE__ */ jsxs(Dropdown, { children: [
103
+ /* @__PURE__ */ jsx(Dropdown.Trigger, { size: "sm", label: getSortOrderLabel(), variant: "ghost" }),
104
+ /* @__PURE__ */ jsxs(Dropdown.Menu, { children: [
105
+ /* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortTime, {}), onClick: () => setSortOrder(["modified", "desc"]), children: t("sort.order.modify.desc") }),
106
+ /* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortAscendingLetters, {}), onClick: () => setSortOrder(["name", "asc"]), children: t("sort.order.alpha.asc") }),
107
+ /* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortDescendingLetters, {}), onClick: () => setSortOrder(["name", "desc"]), children: t("sort.order.alpha.desc") })
108
+ ] })
109
+ ] })
110
+ ] })
111
+ ] }),
112
+ /* @__PURE__ */ jsx(Grid.Col, { sm: "4", md: "8", xl: "12", className: "p-8 gap-8", children: loadError ? /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", className: "h-full w-100", justify: "center", align: "center", children: [
113
+ /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuError, title: t("nextcloud.error.title"), text: t("nextcloud.error.description") }),
114
+ /* @__PURE__ */ jsx(Button, { onClick: () => loadContent(currentNodeId), children: t("retry") })
115
+ ] }) : documents ? documents.length !== 0 ? /* @__PURE__ */ jsx("div", { className: "grid grid-workspace", children: documents.map((doc) => {
116
+ const isSelected = selectedPaths.has(doc.path);
117
+ return /* @__PURE__ */ jsx(NextcloudFileCard, { doc, userId: user.userId, isSelected, onClick: () => handleSelectDoc(doc) }, doc.path);
118
+ }) }) : /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuTrash, text: t("workspace.empty.docSpace"), title: t("explorer.emptyScreen.trash.title") }) : /* @__PURE__ */ jsx(LoadingScreen, {}) })
119
+ ] }) })
120
+ ] });
121
+ };
122
+ export {
123
+ Nextcloud as default
124
+ };
@@ -0,0 +1,2 @@
1
+ export { default as Nextcloud } from './Nextcloud';
2
+ export * from './Nextcloud';
@@ -6,6 +6,7 @@ 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";
9
10
  import useWorkspaceSearch from "../../../hooks/useWorkspaceSearch/useWorkspaceSearch.js";
10
11
  import { Grid } from "../../../components/Grid/Grid.js";
11
12
  import TreeView from "../../../components/TreeView/TreeView.js";
@@ -15,7 +16,7 @@ import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
15
16
  import FileCard from "../FileCard/FileCard.js";
16
17
  import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
17
18
  import { findTreeNode } from "../../../components/TreeView/utilities/treeview.js";
18
- const Workspace = ({
19
+ const WORKSPACE_VIEW_WORKFLOW = "org.entcore.workspace.controllers.WorkspaceController|view", Workspace = ({
19
20
  roles,
20
21
  onSelect,
21
22
  multiple = !0,
@@ -25,7 +26,7 @@ const Workspace = ({
25
26
  }) => {
26
27
  const {
27
28
  t
28
- } = useTranslation(), {
29
+ } = useTranslation(), hasWorkspaceViewRight = useHasWorkflow(WORKSPACE_VIEW_WORKFLOW), canViewPersonalFolders = !!hasWorkspaceViewRight, {
29
30
  root: ownerRoot,
30
31
  loadContent: loadOwnerDocs
31
32
  } = useWorkspaceSearch("root", t("workspace.tree.owner"), "owner", roles), {
@@ -111,7 +112,9 @@ const Workspace = ({
111
112
  return;
112
113
  }
113
114
  (_a = ref == null ? void 0 : ref.current) == null || _a.select("root");
114
- }, [currentFilter]), useEffect(loadContent, [loadContent]), useEffect(() => {
115
+ }, [currentFilter]), useEffect(() => {
116
+ hasWorkspaceViewRight === !1 && (currentFilter === "owner" || currentFilter === "shared") && selectAndLoadContent("protected", "root");
117
+ }, [hasWorkspaceViewRight]), useEffect(loadContent, [loadContent]), useEffect(() => {
115
118
  if (currentNode.files) {
116
119
  let list = [].concat(currentNode.files);
117
120
  searchTerm && (list = list.filter((f) => f.name.indexOf(searchTerm) >= 0));
@@ -140,8 +143,8 @@ const Workspace = ({
140
143
  top: 0,
141
144
  paddingTop: "1.2rem"
142
145
  }, children: [
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) }),
146
+ canViewPersonalFolders && /* @__PURE__ */ jsx(TreeView, { ref: ownerRef, data: ownerRoot, onTreeItemClick: (nodeId) => selectAndLoadContent("owner", nodeId), onTreeItemUnfold: (nodeId) => selectAndLoadContent("owner", nodeId) }),
147
+ canViewPersonalFolders && /* @__PURE__ */ jsx(TreeView, { ref: sharedRef, data: sharedRoot, onTreeItemClick: (nodeId) => selectAndLoadContent("shared", nodeId), onTreeItemUnfold: (nodeId) => selectAndLoadContent("shared", nodeId) }),
145
148
  /* @__PURE__ */ jsx(TreeView, { ref: protectRef, data: protectRoot, onTreeItemClick: (nodeId) => selectAndLoadContent("protected", nodeId), onTreeItemUnfold: (nodeId) => selectAndLoadContent("protected", nodeId) }),
146
149
  showPublicFolder && /* @__PURE__ */ jsx(TreeView, { ref: publicRef, data: publicRoot, onTreeItemClick: (nodeId) => selectAndLoadContent("public", nodeId), onTreeItemUnfold: (nodeId) => selectAndLoadContent("public", nodeId) })
147
150
  ] }) }),
@@ -5,6 +5,8 @@ export * from './ImagePicker';
5
5
  export * from './FileCard';
6
6
  export * from './Linker';
7
7
  export * from './MediaLibrary';
8
+ export * from './GoogleDrive';
9
+ export * from './Nextcloud';
8
10
  export * from './UploadCard';
9
11
  export * from './VideoEmbed';
10
12
  export * from './VideoRecorder';
@@ -1,15 +1,19 @@
1
1
  import { default as default2 } from "./modules/multimedia/AudioRecorder/AudioRecorder.js";
2
2
  import { default as default3 } from "./modules/multimedia/Embed/Embed.js";
3
3
  import { default as default4 } from "./modules/multimedia/FileCard/FileCard.js";
4
- import { default as default5 } from "./modules/multimedia/ImageEditor/components/ImageEditor.js";
5
- import { default as default6 } from "./modules/multimedia/ImagePicker/ImagePicker.js";
6
- import { default as default7 } from "./modules/multimedia/MediaLibrary/MediaLibrary.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";
4
+ import { default as default5 } from "./modules/multimedia/GoogleDrive/GoogleDrive.js";
5
+ import { default as default6 } from "./modules/multimedia/FileCard/GoogleDriveFileCard.js";
6
+ import { default as default7 } from "./modules/multimedia/ImageEditor/components/ImageEditor.js";
7
+ import { default as default8 } from "./modules/multimedia/ImagePicker/ImagePicker.js";
8
+ import { default as default9 } from "./modules/multimedia/MediaLibrary/MediaLibrary.js";
9
+ import { default as default10 } from "./modules/multimedia/Nextcloud/Nextcloud.js";
10
+ import { default as default11 } from "./modules/multimedia/FileCard/NextcloudFileCard.js";
11
+ import { default as default12 } from "./modules/multimedia/UploadCard/UploadCard.js";
12
+ import { default as default13 } from "./modules/multimedia/UploadFiles/UploadFiles.js";
13
+ import { default as default14 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
14
+ import { default as default15 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
15
+ import { default as default16 } from "./modules/multimedia/Workspace/Workspace.js";
16
+ import { default as default17 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
13
17
  import { ExternalLinker } from "./modules/multimedia/Linker/ExternalLinker/ExternalLinker.js";
14
18
  import { InternalLinker } from "./modules/multimedia/Linker/InternalLinker/InternalLinker.js";
15
19
  import { Upload } from "./modules/multimedia/MediaLibrary/innertabs/Upload.js";
@@ -18,15 +22,19 @@ export {
18
22
  default3 as Embed,
19
23
  ExternalLinker,
20
24
  default4 as FileCard,
21
- default5 as ImageEditor,
22
- default6 as ImagePicker,
25
+ default5 as GoogleDrive,
26
+ default6 as GoogleDriveFileCard,
27
+ default7 as ImageEditor,
28
+ default8 as ImagePicker,
23
29
  InternalLinker,
24
- default7 as MediaLibrary,
30
+ default9 as MediaLibrary,
31
+ default10 as Nextcloud,
32
+ default11 as NextcloudFileCard,
25
33
  Upload,
26
- default8 as UploadCard,
27
- default9 as UploadFiles,
28
- default10 as VideoEmbed,
29
- default11 as VideoRecorder,
30
- default12 as Workspace,
31
- default13 as WorkspaceFolders
34
+ default12 as UploadCard,
35
+ default13 as UploadFiles,
36
+ default14 as VideoEmbed,
37
+ default15 as VideoRecorder,
38
+ default16 as Workspace,
39
+ default17 as WorkspaceFolders
32
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.6.7-develop-b2school.20261002153216",
3
+ "version": "2.6.7-develop-integration.20261003123008",
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.7-develop-b2school.20261002153216",
144
- "@edifice.io/tiptap-extensions": "2.6.7-develop-b2school.20261002153216",
145
- "@edifice.io/utilities": "2.6.7-develop-b2school.20261002153216"
143
+ "@edifice.io/bootstrap": "2.6.7-develop-integration.20261003123008",
144
+ "@edifice.io/utilities": "2.6.7-develop-integration.20261003123008",
145
+ "@edifice.io/tiptap-extensions": "2.6.7-develop-integration.20261003123008"
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.7-develop-b2school.20261002153216",
177
- "@edifice.io/config": "2.6.7-develop-b2school.20261002153216"
176
+ "@edifice.io/config": "2.6.7-develop-integration.20261003123008",
177
+ "@edifice.io/client": "2.6.7-develop-integration.20261003123008"
178
178
  },
179
179
  "peerDependencies": {
180
180
  "@react-spring/web": "9.7.5",
@@ -1,16 +0,0 @@
1
- import { ComponentPropsWithoutRef } from 'react';
2
- export interface WidgetToggleProps extends Omit<ComponentPropsWithoutRef<'button'>, 'onClick' | 'type' | 'role' | 'aria-checked'> {
3
- 'checked': boolean;
4
- 'onChange': () => void;
5
- 'aria-label': string;
6
- }
7
- /**
8
- * Dedicated on/off control for a widget row in `WidgetsPersonalizationPanel`.
9
- * The generic `Switch` component doesn't match this panel's design (size,
10
- * filled-vs-outlined states), so this is a small purpose-built control
11
- * rather than a `Switch` variant.
12
- */
13
- export declare function WidgetToggle({ checked, onChange, disabled, ...rest }: WidgetToggleProps): import("react/jsx-runtime").JSX.Element;
14
- export declare namespace WidgetToggle {
15
- var displayName: string;
16
- }
@@ -1,15 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import clsx from "clsx";
3
- function WidgetToggle({
4
- checked,
5
- onChange,
6
- disabled,
7
- ...rest
8
- }) {
9
- return /* @__PURE__ */ jsx("button", { type: "button", role: "switch", "aria-checked": checked, disabled, className: clsx("widget-toggle", {
10
- "widget-toggle--checked": checked
11
- }), onClick: onChange, ...rest, children: /* @__PURE__ */ jsx("span", { className: "widget-toggle__knob" }) });
12
- }
13
- export {
14
- WidgetToggle
15
- };
@@ -1,21 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export interface WidgetPersonalizationItem {
3
- id: string;
4
- label: string;
5
- icon: ReactNode;
6
- checked: boolean;
7
- /** When true, the widget is pinned by an admin: no toggle, lock icon instead. */
8
- locked?: boolean;
9
- }
10
- export interface WidgetsPersonalizationPanelProps {
11
- items: WidgetPersonalizationItem[];
12
- isLoading?: boolean;
13
- onToggle: (id: string) => void;
14
- onClose: () => void;
15
- title?: string;
16
- description?: string;
17
- }
18
- export declare function WidgetsPersonalizationPanel({ items, isLoading, onToggle, onClose, title, description, }: WidgetsPersonalizationPanelProps): import("react/jsx-runtime").JSX.Element;
19
- export declare namespace WidgetsPersonalizationPanel {
20
- var displayName: string;
21
- }
@@ -1,47 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useTranslation } from "react-i18next";
3
- import clsx from "clsx";
4
- import SvgIconClose from "../../../icons/components/IconClose.js";
5
- import SvgIconLock from "../../../icons/components/IconLock.js";
6
- import { WidgetToggle } from "./WidgetToggle.js";
7
- import Heading from "../../../../components/Heading/Heading.js";
8
- import IconButton from "../../../../components/Button/IconButton.js";
9
- import TextSkeleton from "../../../../components/Skeleton/TextSkeleton.js";
10
- const SKELETON_ROWS = 5;
11
- function WidgetsPersonalizationPanel({
12
- items,
13
- isLoading = !1,
14
- onToggle,
15
- onClose,
16
- title,
17
- description
18
- }) {
19
- const {
20
- t
21
- } = useTranslation();
22
- return /* @__PURE__ */ jsxs("div", { className: "widgets-personalization-panel", children: [
23
- /* @__PURE__ */ jsxs("div", { className: "widgets-personalization-panel__header", children: [
24
- /* @__PURE__ */ jsx(Heading, { level: "h2", headingStyle: "h5", className: "widgets-personalization-panel__title", children: title ?? t("homepage.widgetsPersonalization.title") }),
25
- /* @__PURE__ */ jsx(IconButton, { icon: /* @__PURE__ */ jsx(SvgIconClose, {}), variant: "ghost", color: "tertiary", "aria-label": t("close"), onClick: onClose, "data-testid": "widgetspersonalization-button-close" })
26
- ] }),
27
- /* @__PURE__ */ jsx("p", { className: "widgets-personalization-panel__description", children: description ?? t("homepage.widgetsPersonalization.description") }),
28
- isLoading ? /* @__PURE__ */ jsx("ul", { className: "widgets-personalization-panel__list", "aria-hidden": "true", children: Array.from({
29
- length: SKELETON_ROWS
30
- }).map((_, index) => /* @__PURE__ */ jsxs("li", { className: "widgets-personalization-panel__item widgets-personalization-panel__item--skeleton", children: [
31
- /* @__PURE__ */ jsx(TextSkeleton, { className: "widgets-personalization-panel__item-icon-skeleton" }),
32
- /* @__PURE__ */ jsx(TextSkeleton, { className: "widgets-personalization-panel__item-label-skeleton" })
33
- ] }, index)) }) : items.length === 0 ? /* @__PURE__ */ jsx("div", { className: "widgets-personalization-panel__empty", children: /* @__PURE__ */ jsx("p", { className: "widgets-personalization-panel__empty-text", children: t("homepage.widgetsPersonalization.empty") }) }) : /* @__PURE__ */ jsx("ul", { className: "widgets-personalization-panel__list", children: items.map((item) => /* @__PURE__ */ jsxs("li", { className: clsx("widgets-personalization-panel__item", {
34
- "widgets-personalization-panel__item--checked": item.checked && !item.locked,
35
- "widgets-personalization-panel__item--locked": item.locked
36
- }), "data-testid": `widgetspersonalization-item-${item.id}`, children: [
37
- /* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-icon", "aria-hidden": "true", children: item.icon }),
38
- /* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-label", children: item.label }),
39
- item.locked ? /* @__PURE__ */ jsx("span", { className: "widgets-personalization-panel__item-lock", role: "img", "aria-label": t("homepage.widgetsPersonalization.locked"), "data-testid": `widgetspersonalization-lock-${item.id}`, children: /* @__PURE__ */ jsx(SvgIconLock, {}) }) : /* @__PURE__ */ jsx(WidgetToggle, { checked: item.checked, onChange: () => onToggle(item.id), "aria-label": t("homepage.widgetsPersonalization.toggle", {
40
- label: item.label
41
- }), "data-testid": `widgetspersonalization-toggle-${item.id}` })
42
- ] }, item.id)) })
43
- ] });
44
- }
45
- export {
46
- WidgetsPersonalizationPanel
47
- };
@@ -1,2 +0,0 @@
1
- export * from './WidgetsPersonalizationPanel';
2
- export * from './WidgetToggle';
@@ -1,7 +0,0 @@
1
- import { SVGProps } from 'react';
2
- interface SVGRProps {
3
- title?: string;
4
- titleId?: string;
5
- }
6
- declare const SvgIconAddWidget: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
7
- export default SvgIconAddWidget;
@@ -1,12 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- const SvgIconAddWidget = ({
3
- title,
4
- titleId,
5
- ...props
6
- }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 20 20", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
7
- title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
8
- /* @__PURE__ */ jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M15.834 10.833c.46 0 .833.373.833.834v2.5h2.5a.833.833 0 0 1 0 1.666h-2.5v2.5a.833.833 0 0 1-1.667 0v-2.5h-2.5a.833.833 0 0 1 0-1.666H15v-2.5c0-.46.373-.834.834-.834M8.333 3.333A.833.833 0 0 0 7.5 2.5h-5a.833.833 0 0 0-.833.833v13.334c0 .46.373.833.833.833h5c.46 0 .833-.373.833-.833zM10 16.667a2.5 2.5 0 0 1-2.5 2.5h-5a2.5 2.5 0 0 1-2.5-2.5V3.333a2.5 2.5 0 0 1 2.5-2.5h5a2.5 2.5 0 0 1 2.5 2.5zM18.334 3.333A.833.833 0 0 0 17.5 2.5h-3.333a.833.833 0 0 0-.833.833v3.334c0 .46.373.833.833.833H17.5c.46 0 .834-.373.834-.833zM20 6.667a2.5 2.5 0 0 1-2.5 2.5h-3.333a2.5 2.5 0 0 1-2.5-2.5V3.333a2.5 2.5 0 0 1 2.5-2.5H17.5a2.5 2.5 0 0 1 2.5 2.5z", clipRule: "evenodd" })
9
- ] });
10
- export {
11
- SvgIconAddWidget as default
12
- };