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

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 (54) hide show
  1. package/dist/components/Layout/Layout.js +21 -8
  2. package/dist/components/Tree/utilities/tree.js +1 -21
  3. package/dist/homepage.js +4 -0
  4. package/dist/hooks/index.d.ts +0 -2
  5. package/dist/hooks/useBackground/useBackground.d.ts +1 -0
  6. package/dist/hooks/useBackground/useBackground.js +2 -0
  7. package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +3 -1
  8. package/dist/hooks/useZendeskGuide/useZendeskGuide.js +10 -3
  9. package/dist/icons.js +404 -402
  10. package/dist/index.js +182 -194
  11. package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +3 -1
  12. package/dist/modules/homepage/components/UserSpace/UserSpace.js +13 -7
  13. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +4 -2
  14. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +3 -2
  15. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +16 -0
  16. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +15 -0
  17. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +21 -0
  18. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +47 -0
  19. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +2 -0
  20. package/dist/modules/homepage/components/index.d.ts +2 -1
  21. package/dist/modules/icons/components/IconAddWidget.d.ts +7 -0
  22. package/dist/modules/icons/components/IconAddWidget.js +12 -0
  23. package/dist/modules/icons/components/index.d.ts +1 -0
  24. package/dist/modules/multimedia/FileCard/index.d.ts +0 -4
  25. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +1 -7
  26. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +0 -2
  27. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +2 -2
  28. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +12 -48
  29. package/dist/modules/multimedia/MediaLibrary/innertabs/index.d.ts +0 -2
  30. package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +0 -4
  31. package/dist/modules/multimedia/Workspace/Workspace.js +5 -8
  32. package/dist/modules/multimedia/index.d.ts +0 -2
  33. package/dist/multimedia.js +18 -26
  34. package/package.json +6 -6
  35. package/dist/hooks/useGoogleDriveSearch/index.d.ts +0 -1
  36. package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.d.ts +0 -14
  37. package/dist/hooks/useGoogleDriveSearch/useGoogleDriveSearch.js +0 -60
  38. package/dist/hooks/useNextcloudSearch/index.d.ts +0 -1
  39. package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +0 -14
  40. package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +0 -64
  41. package/dist/modules/multimedia/FileCard/GoogleDriveFileCard.d.ts +0 -25
  42. package/dist/modules/multimedia/FileCard/GoogleDriveFileCard.js +0 -102
  43. package/dist/modules/multimedia/FileCard/NextcloudFileCard.d.ts +0 -25
  44. package/dist/modules/multimedia/FileCard/NextcloudFileCard.js +0 -102
  45. package/dist/modules/multimedia/GoogleDrive/GoogleDrive.d.ts +0 -24
  46. package/dist/modules/multimedia/GoogleDrive/GoogleDrive.js +0 -100
  47. package/dist/modules/multimedia/GoogleDrive/index.d.ts +0 -2
  48. package/dist/modules/multimedia/MediaLibrary/innertabs/GoogleDrive.d.ts +0 -1
  49. package/dist/modules/multimedia/MediaLibrary/innertabs/GoogleDrive.js +0 -61
  50. package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.d.ts +0 -1
  51. package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.js +0 -48
  52. package/dist/modules/multimedia/Nextcloud/Nextcloud.d.ts +0 -24
  53. package/dist/modules/multimedia/Nextcloud/Nextcloud.js +0 -124
  54. package/dist/modules/multimedia/Nextcloud/index.d.ts +0 -2
@@ -1,124 +0,0 @@
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
- };
@@ -1,2 +0,0 @@
1
- export { default as Nextcloud } from './Nextcloud';
2
- export * from './Nextcloud';