@edifice.io/react 2.6.2-feat-INTEG-1924-port-react-nextcloud-filetree.20260824153355 → 2.6.3-develop-enabling.20260825190837

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 (97) hide show
  1. package/dist/components/Alert/Alert.js +1 -1
  2. package/dist/components/DatePicker/DatePicker.d.ts +5 -0
  3. package/dist/components/DatePicker/DatePicker.js +2 -0
  4. package/dist/components/Layout/Layout.js +5 -3
  5. package/dist/components/Layout/components/NavLink.d.ts +1 -1
  6. package/dist/components/Layout/components/NavLink.js +2 -0
  7. package/dist/components/Tree/utilities/tree.js +1 -21
  8. package/dist/hooks/index.d.ts +0 -1
  9. package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -1
  10. package/dist/hooks/useClickOutside/useClickOutside.js +1 -1
  11. package/dist/icons-apps.js +112 -100
  12. package/dist/icons.js +340 -338
  13. package/dist/index.js +146 -152
  14. package/dist/modules/editor/test-utils/createTestEditor.d.ts +10 -0
  15. package/dist/modules/homepage/components/Communities/Communities.d.ts +10 -0
  16. package/dist/modules/homepage/components/Communities/CommunitiesContainer.d.ts +9 -0
  17. package/dist/modules/homepage/components/Communities/CommunitiesSkeleton.d.ts +5 -0
  18. package/dist/modules/homepage/components/Communities/CommunityItem.d.ts +11 -0
  19. package/dist/modules/homepage/components/Communities/index.d.ts +8 -0
  20. package/dist/modules/homepage/components/Communities/useCommunities.d.ts +13 -0
  21. package/dist/modules/homepage/components/Favorites/Favorites.js +7 -4
  22. package/dist/modules/homepage/components/Header/Header.js +20 -2
  23. package/dist/modules/homepage/components/HomeCard/HomeCard.d.ts +5 -1
  24. package/dist/modules/homepage/components/HomeCard/HomeCard.js +10 -2
  25. package/dist/modules/homepage/components/LastInfos/LastInfosList.js +2 -2
  26. package/dist/modules/homepage/components/Notifications/NotificationItem.js +5 -4
  27. package/dist/modules/homepage/components/Notifications/NotificationList.d.ts +7 -1
  28. package/dist/modules/homepage/components/Notifications/NotificationList.js +10 -3
  29. package/dist/modules/homepage/components/Notifications/NotificationListContainer.js +4 -1
  30. package/dist/modules/homepage/components/Notifications/components/CommonNotificationItem.d.ts +2 -1
  31. package/dist/modules/homepage/components/Notifications/components/CommonNotificationItem.js +14 -10
  32. package/dist/modules/homepage/components/Notifications/components/NotificationFilterMenu.d.ts +16 -0
  33. package/dist/modules/homepage/components/Notifications/components/NotificationFilterMenu.js +29 -0
  34. package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.d.ts +18 -0
  35. package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +67 -0
  36. package/dist/modules/homepage/components/Notifications/components/NotificationItemResource.d.ts +2 -1
  37. package/dist/modules/homepage/components/Notifications/components/NotificationItemResource.js +3 -2
  38. package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.d.ts +12 -0
  39. package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.js +42 -0
  40. package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.d.ts +13 -0
  41. package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +31 -0
  42. package/dist/modules/homepage/components/Notifications/components/SystemNotificationItem.d.ts +3 -1
  43. package/dist/modules/homepage/components/Notifications/components/SystemNotificationItem.js +3 -2
  44. package/dist/modules/homepage/components/Notifications/components/UserNotificationItem.d.ts +3 -1
  45. package/dist/modules/homepage/components/Notifications/components/UserNotificationItem.js +3 -2
  46. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.d.ts +22 -7
  47. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +31 -13
  48. package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.d.ts +11 -1
  49. package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +34 -2
  50. package/dist/modules/homepage/components/Notifications/services/api/index.d.ts +2 -0
  51. package/dist/modules/homepage/components/Notifications/services/api/notificationService.d.ts +8 -0
  52. package/dist/modules/homepage/components/Notifications/services/api/notificationService.js +12 -0
  53. package/dist/modules/homepage/components/Notifications/services/queries/notification.d.ts +13 -1
  54. package/dist/modules/homepage/components/Notifications/services/queries/notification.js +41 -4
  55. package/dist/modules/homepage/components/SchoolSpace/SchoolSpace.js +20 -11
  56. package/dist/modules/homepage/components/UserSpace/UserSpace.js +5 -2
  57. package/dist/modules/homepage/components/UserSpace/hooks/useChildren.d.ts +14 -0
  58. package/dist/modules/homepage/components/UserSpace/hooks/useChildren.js +23 -0
  59. package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.d.ts +8 -0
  60. package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.js +65 -0
  61. package/dist/modules/icons/components/IconClass.d.ts +7 -0
  62. package/dist/modules/icons/components/IconClass.js +13 -0
  63. package/dist/modules/icons/components/apps/IconNextcloudDeck.d.ts +7 -0
  64. package/dist/modules/icons/components/apps/IconNextcloudDeck.js +12 -0
  65. package/dist/modules/icons/components/apps/IconNextcloudFiles.d.ts +7 -0
  66. package/dist/modules/icons/components/apps/IconNextcloudFiles.js +12 -0
  67. package/dist/modules/icons/components/apps/IconNextcloudForms.d.ts +7 -0
  68. package/dist/modules/icons/components/apps/IconNextcloudForms.js +12 -0
  69. package/dist/modules/icons/components/apps/IconNextcloudNotes.d.ts +7 -0
  70. package/dist/modules/icons/components/apps/IconNextcloudNotes.js +12 -0
  71. package/dist/modules/icons/components/apps/IconNextcloudTalk.d.ts +7 -0
  72. package/dist/modules/icons/components/apps/IconNextcloudTalk.js +12 -0
  73. package/dist/modules/icons/components/apps/IconPeertube.d.ts +7 -0
  74. package/dist/modules/icons/components/apps/IconPeertube.js +21 -0
  75. package/dist/modules/icons/components/apps/index.d.ts +6 -0
  76. package/dist/modules/icons/components/index.d.ts +1 -0
  77. package/dist/modules/multimedia/FileCard/index.d.ts +0 -2
  78. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +2 -2
  79. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +7 -21
  80. package/dist/modules/multimedia/MediaLibrary/innertabs/index.d.ts +0 -1
  81. package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +0 -2
  82. package/dist/modules/multimedia/index.d.ts +0 -1
  83. package/dist/modules/multimedia/testing/mediaHarness.d.ts +154 -0
  84. package/dist/multimedia.js +12 -16
  85. package/package.json +6 -6
  86. package/dist/hooks/useNextcloudSearch/index.d.ts +0 -1
  87. package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +0 -12
  88. package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +0 -57
  89. package/dist/modules/multimedia/FileCard/NextcloudFileCard.d.ts +0 -25
  90. package/dist/modules/multimedia/FileCard/NextcloudFileCard.js +0 -102
  91. package/dist/modules/multimedia/LinkerCard/LinkerCard._.d.ts +0 -8
  92. package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.d.ts +0 -1
  93. package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.js +0 -35
  94. package/dist/modules/multimedia/Nextcloud/Nextcloud.d.ts +0 -24
  95. package/dist/modules/multimedia/Nextcloud/Nextcloud.js +0 -114
  96. package/dist/modules/multimedia/Nextcloud/index.d.ts +0 -2
  97. package/dist/modules/multimedia/UploadCard/UploadCard._.d.ts +0 -9
@@ -1,114 +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 illuNoContentInFolder from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-no-content-in-folder.svg";
11
- import illuTrash from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-trash.svg";
12
- import useUser from "../../../hooks/useUser/useUser.js";
13
- import useNextcloudSearch from "../../../hooks/useNextcloudSearch/useNextcloudSearch.js";
14
- import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
15
- import Flex from "../../../components/Flex/Flex.js";
16
- import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
17
- import Button from "../../../components/Button/Button.js";
18
- import { Grid } from "../../../components/Grid/Grid.js";
19
- import Tree from "../../../components/Tree/components/Tree.js";
20
- import SearchBar from "../../../components/SearchBar/SearchBar.js";
21
- import Dropdown from "../../../components/Dropdown/Dropdown.js";
22
- import NextcloudFileCard from "../FileCard/NextcloudFileCard.js";
23
- const ROOT_ID = "root";
24
- function compare(a, b) {
25
- return a ? b ? a.localeCompare(b) : 1 : -1;
26
- }
27
- const Nextcloud = ({
28
- onSelect,
29
- multiple = !0,
30
- roles,
31
- className
32
- }) => {
33
- const {
34
- t
35
- } = useTranslation(), {
36
- user
37
- } = useUser(), {
38
- root,
39
- needsAuth,
40
- isCheckingAuth,
41
- refetchAuthStatus,
42
- loadContent
43
- } = 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(null), [sortOrder, setSortOrder] = useState(["modified", "desc"]), [selectedDocuments, setSelectedDocuments] = useState([]), handleTreeItemChange = useCallback((nodeId) => {
44
- setCurrentNodeId(nodeId), loadContent(nodeId);
45
- }, [loadContent]);
46
- useEffect(() => {
47
- needsAuth || loadContent(ROOT_ID);
48
- }, [loadContent, needsAuth]);
49
- const documents = useMemo(() => {
50
- if (!currentNode.files) return;
51
- const matchesRole = (doc) => {
52
- if (!roles) return !0;
53
- const role = DocumentHelper.role(doc.contentType, !1);
54
- return Array.isArray(roles) ? roles.includes(role) : roles === role;
55
- }, list = currentNode.files.filter((f) => (!searchTerm || f.name.indexOf(searchTerm) >= 0) && matchesRole(f));
56
- let sortFunction;
57
- 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);
58
- }, [currentNode, searchTerm, sortOrder, roles]), selectedPaths = useMemo(() => new Set(selectedDocuments.map((d) => d.path)), [selectedDocuments]), handleSearchChange = useCallback((e) => {
59
- setSearchTerm(e.target.value);
60
- }, [setSearchTerm]);
61
- function getSortOrderLabel() {
62
- return sortOrder[0] === "name" ? sortOrder[1] === "asc" ? t("sort.order.alpha.asc") : t("sort.order.alpha.desc") : t("sort.order.modify.desc");
63
- }
64
- function handleSelectDoc(doc) {
65
- let currentDocuments = [...selectedDocuments];
66
- multiple ? currentDocuments.includes(doc) ? currentDocuments = currentDocuments.filter((selectedDocument) => selectedDocument.path !== doc.path) : currentDocuments = [...currentDocuments, doc] : currentDocuments = [doc], setSelectedDocuments(currentDocuments), onSelect(currentDocuments);
67
- }
68
- const nextcloud = clsx("workspace flex-grow-1 gap-0", className), openLoginPopup = () => {
69
- popupRef.current = window.open(`${window.location.origin}/nextcloud/user/oauth2/init`, "", "popup, height=600, width=400");
70
- };
71
- return useEffect(() => {
72
- function handleMessage(event) {
73
- var _a;
74
- event.origin !== window.location.origin || ((_a = event.data) == null ? void 0 : _a.type) !== "nextcloud-connected" || (popupRef.current && !popupRef.current.closed && popupRef.current.close(), refetchAuthStatus());
75
- }
76
- return window.addEventListener("message", handleMessage), () => window.removeEventListener("message", handleMessage);
77
- }, [refetchAuthStatus]), isCheckingAuth ? /* @__PURE__ */ jsx(LoadingScreen, {}) : needsAuth ? /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", className: "h-full w-100", justify: "center", align: "center", children: [
78
- /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "8", justify: "center", align: "center", children: [
79
- /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuNoContentInFolder }),
80
- /* @__PURE__ */ jsx("h2", { className: "h2 text-secondary mb-8", children: "Connectez vos Documents Synchronisés" }),
81
- /* @__PURE__ */ jsx("div", { className: "text", children: "Connectez-vous pour parcourir vos Documents Synchronisés et les insérer ici." })
82
- ] }),
83
- /* @__PURE__ */ jsx(Button, { onClick: openLoginPopup, children: "Se connecter" })
84
- ] }) : /* @__PURE__ */ jsxs(Grid, { className: nextcloud, children: [
85
- /* @__PURE__ */ jsx(Grid.Col, { sm: "12", md: "3", xl: "4", className: "workspace-folders p-12 pt-0 gap-12", children: /* @__PURE__ */ jsx("div", { style: {
86
- position: "sticky",
87
- top: 0,
88
- paddingTop: "1.2rem"
89
- }, children: /* @__PURE__ */ jsx(Tree, { nodes: root, selectedNodeId: currentNodeId, showIcon: !0, onTreeItemClick: handleTreeItemChange, onTreeItemUnfold: handleTreeItemChange }) }) }),
90
- /* @__PURE__ */ jsx(Grid.Col, { sm: "12", md: "5", xl: "8", children: /* @__PURE__ */ jsxs(Grid, { className: "flex-grow-1 gap-0", children: [
91
- /* @__PURE__ */ jsxs(Grid.Col, { sm: "4", md: "8", xl: "12", children: [
92
- /* @__PURE__ */ jsx("div", { className: "workspace-search px-16 py-8 ", children: /* @__PURE__ */ jsx(SearchBar, { isVariant: !0, className: "gap-16", onChange: handleSearchChange }) }),
93
- /* @__PURE__ */ jsxs(Flex, { className: "px-8 py-4", align: "center", justify: "end", children: [
94
- /* @__PURE__ */ jsx("small", { className: "text-muted", children: t("workspace.search.order") }),
95
- /* @__PURE__ */ jsxs(Dropdown, { children: [
96
- /* @__PURE__ */ jsx(Dropdown.Trigger, { size: "sm", label: getSortOrderLabel(), variant: "ghost" }),
97
- /* @__PURE__ */ jsxs(Dropdown.Menu, { children: [
98
- /* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortTime, {}), onClick: () => setSortOrder(["modified", "desc"]), children: t("sort.order.modify.desc") }),
99
- /* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortAscendingLetters, {}), onClick: () => setSortOrder(["name", "asc"]), children: t("sort.order.alpha.asc") }),
100
- /* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortDescendingLetters, {}), onClick: () => setSortOrder(["name", "desc"]), children: t("sort.order.alpha.desc") })
101
- ] })
102
- ] })
103
- ] })
104
- ] }),
105
- /* @__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) => {
106
- const isSelected = selectedPaths.has(doc.path);
107
- return /* @__PURE__ */ jsx(NextcloudFileCard, { doc, userId: user.userId, isSelected, onClick: () => handleSelectDoc(doc) }, doc.path);
108
- }) }) : /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuTrash, text: t("workspace.empty.docSpace"), title: t("explorer.emptyScreen.trash.title") }) : /* @__PURE__ */ jsx(LoadingScreen, {}) })
109
- ] }) })
110
- ] });
111
- };
112
- export {
113
- Nextcloud as default
114
- };
@@ -1,2 +0,0 @@
1
- export { default as Nextcloud } from './Nextcloud';
2
- export * from './Nextcloud';
@@ -1,9 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { default as UploadCard } from './UploadCard';
3
- declare const meta: Meta<typeof UploadCard>;
4
- export default meta;
5
- type Story = StoryObj<typeof UploadCard>;
6
- export declare const Base: Story;
7
- export declare const IsLoading: Story;
8
- export declare const IsSuccess: Story;
9
- export declare const IsError: Story;