@edifice.io/react 2.6.12-develop-integration-crna.20261101211105 → 2.6.12-develop-b2school.20261102112143

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 (195) hide show
  1. package/dist/components/Checkbox/Checkbox.js +1 -1
  2. package/dist/components/Dropdown/Dropdown.js +14 -20
  3. package/dist/components/Dropdown/DropdownContext.d.ts +0 -5
  4. package/dist/components/Dropdown/DropdownItem.js +17 -1
  5. package/dist/components/Dropdown/DropdownMenuGroup.js +6 -23
  6. package/dist/components/Dropdown/DropdownSearchInput.js +8 -16
  7. package/dist/components/Dropdown/DropdownTrigger.js +8 -24
  8. package/dist/components/Dropdown/useDropdownItemFilter.js +2 -2
  9. package/dist/components/Layout/Layout.js +12 -4
  10. package/dist/components/Masonry/Masonry.d.ts +40 -0
  11. package/dist/components/Masonry/Masonry.js +50 -0
  12. package/dist/components/Masonry/index.d.ts +2 -0
  13. package/dist/components/SearchBar/SearchBar.js +17 -26
  14. package/dist/components/Select/Select.d.ts +1 -14
  15. package/dist/components/Select/Select.js +5 -11
  16. package/dist/components/Tree/components/Tree.d.ts +2 -5
  17. package/dist/components/Tree/components/Tree.js +10 -7
  18. package/dist/components/Tree/hooks/useTree.d.ts +1 -0
  19. package/dist/components/Tree/hooks/useTree.js +6 -2
  20. package/dist/components/Tree/types/index.d.ts +7 -0
  21. package/dist/components/index.d.ts +1 -0
  22. package/dist/homepage.js +87 -24
  23. package/dist/hooks/useDropdown/useDropdown.d.ts +0 -5
  24. package/dist/hooks/useDropdown/useDropdown.js +7 -17
  25. package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +1 -1
  26. package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +2 -2
  27. package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +2 -6
  28. package/dist/hooks/useZendeskGuide/useZendeskGuide.js +11 -8
  29. package/dist/icons.js +406 -404
  30. package/dist/index.js +158 -158
  31. package/dist/modules/HelpZone/HelpZone.js +6 -8
  32. package/dist/modules/HelpZone/HelpZoneContainer.js +2 -5
  33. package/dist/modules/editor/components/Editor/Editor.d.ts +5 -0
  34. package/dist/modules/editor/components/Editor/Editor.js +3 -0
  35. package/dist/modules/homepage/components/Agenda/Agenda.d.ts +10 -0
  36. package/dist/modules/homepage/components/Agenda/Agenda.js +54 -0
  37. package/dist/modules/homepage/components/Agenda/AgendaContainer.d.ts +1 -0
  38. package/dist/modules/homepage/components/Agenda/AgendaContainer.js +14 -0
  39. package/dist/modules/homepage/components/Agenda/AgendaEventCard.d.ts +10 -0
  40. package/dist/modules/homepage/components/Agenda/AgendaEventCard.js +30 -0
  41. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.d.ts +14 -0
  42. package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.js +27 -0
  43. package/dist/modules/homepage/components/Agenda/index.d.ts +3 -0
  44. package/dist/modules/homepage/components/Agenda/services/api/agendaService.d.ts +24 -0
  45. package/dist/modules/homepage/components/Agenda/services/api/agendaService.js +45 -0
  46. package/dist/modules/homepage/components/Agenda/services/api/index.d.ts +4 -0
  47. package/dist/modules/homepage/components/Agenda/services/api/index.js +5 -0
  48. package/dist/modules/homepage/components/Agenda/services/queries/agenda.d.ts +19 -0
  49. package/dist/modules/homepage/components/Agenda/services/queries/agenda.js +26 -0
  50. package/dist/modules/homepage/components/BriefMe/BriefMe.d.ts +9 -0
  51. package/dist/modules/homepage/components/BriefMe/BriefMe.js +59 -0
  52. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.d.ts +4 -0
  53. package/dist/modules/homepage/components/BriefMe/BriefMeContainer.js +17 -0
  54. package/dist/modules/homepage/components/BriefMe/index.d.ts +4 -0
  55. package/dist/modules/homepage/components/BriefMe/types.d.ts +17 -0
  56. package/dist/modules/homepage/components/BriefMe/types.js +8 -0
  57. package/dist/modules/homepage/components/BriefMe/useBriefMe.d.ts +31 -0
  58. package/dist/modules/homepage/components/BriefMe/useBriefMe.js +51 -0
  59. package/dist/modules/homepage/components/Cantine/Cantine.d.ts +7 -0
  60. package/dist/modules/homepage/components/Cantine/Cantine.js +44 -0
  61. package/dist/modules/homepage/components/Cantine/CantineContainer.d.ts +4 -0
  62. package/dist/modules/homepage/components/Cantine/CantineContainer.js +18 -0
  63. package/dist/modules/homepage/components/Cantine/CantineModal.d.ts +24 -0
  64. package/dist/modules/homepage/components/Cantine/CantineModal.js +88 -0
  65. package/dist/modules/homepage/components/Cantine/CantineModalContainer.d.ts +7 -0
  66. package/dist/modules/homepage/components/Cantine/CantineModalContainer.js +12 -0
  67. package/dist/modules/homepage/components/Cantine/components/CantineLegend.d.ts +5 -0
  68. package/dist/modules/homepage/components/Cantine/components/CantineLegend.js +22 -0
  69. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.d.ts +6 -0
  70. package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.js +28 -0
  71. package/dist/modules/homepage/components/Cantine/components/cantineLabels.d.ts +12 -0
  72. package/dist/modules/homepage/components/Cantine/components/cantineLabels.js +60 -0
  73. package/dist/modules/homepage/components/Cantine/hooks/useCantine.d.ts +11 -0
  74. package/dist/modules/homepage/components/Cantine/hooks/useCantine.js +20 -0
  75. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.d.ts +24 -0
  76. package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.js +65 -0
  77. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.d.ts +23 -0
  78. package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.js +43 -0
  79. package/dist/modules/homepage/components/Cantine/index.d.ts +7 -0
  80. package/dist/modules/homepage/components/Cantine/types.d.ts +42 -0
  81. package/dist/modules/homepage/components/Edumalin/Edumalin.d.ts +9 -0
  82. package/dist/modules/homepage/components/Edumalin/Edumalin.js +65 -0
  83. package/dist/modules/homepage/components/Edumalin/EdumalinContainer.d.ts +4 -0
  84. package/dist/modules/homepage/components/Edumalin/EdumalinContainer.js +21 -0
  85. package/dist/modules/homepage/components/Edumalin/EdumalinModal.d.ts +8 -0
  86. package/dist/modules/homepage/components/Edumalin/EdumalinModal.js +62 -0
  87. package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.d.ts +5 -0
  88. package/dist/modules/homepage/components/Edumalin/components/EdumalinBadge.js +38 -0
  89. package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.d.ts +5 -0
  90. package/dist/modules/homepage/components/Edumalin/components/EdumalinPicture.js +12 -0
  91. package/dist/modules/homepage/components/Edumalin/index.d.ts +7 -0
  92. package/dist/modules/homepage/components/Edumalin/types.d.ts +24 -0
  93. package/dist/modules/homepage/components/Edumalin/types.js +4 -0
  94. package/dist/modules/homepage/components/Edumalin/useEdumalin.d.ts +16 -0
  95. package/dist/modules/homepage/components/Edumalin/useEdumalin.js +35 -0
  96. package/dist/modules/homepage/components/Edumalin/utils.d.ts +28 -0
  97. package/dist/modules/homepage/components/Edumalin/utils.js +56 -0
  98. package/dist/modules/homepage/components/Favorites/Favorites.js +4 -1
  99. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.d.ts +16 -0
  100. package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +65 -0
  101. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.d.ts +4 -0
  102. package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.js +12 -0
  103. package/dist/modules/homepage/components/GenerationHdf/formatSolde.d.ts +1 -0
  104. package/dist/modules/homepage/components/GenerationHdf/formatSolde.js +6 -0
  105. package/dist/modules/homepage/components/GenerationHdf/index.d.ts +3 -0
  106. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.d.ts +10 -0
  107. package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.js +69 -0
  108. package/dist/modules/homepage/components/Header/Header.js +9 -21
  109. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +5 -1
  110. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
  111. package/dist/modules/homepage/components/Notifications/NotificationList.js +7 -8
  112. package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.js +7 -12
  113. package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +7 -4
  114. package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +11 -13
  115. package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +6 -12
  116. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +12 -10
  117. package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +9 -10
  118. package/dist/modules/homepage/components/Qwant/Qwant.d.ts +4 -0
  119. package/dist/modules/homepage/components/Qwant/Qwant.js +41 -0
  120. package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +1 -0
  121. package/dist/modules/homepage/components/Qwant/QwantContainer.js +10 -0
  122. package/dist/modules/homepage/components/Qwant/index.d.ts +3 -0
  123. package/dist/modules/homepage/components/Rss/Rss.d.ts +11 -0
  124. package/dist/modules/homepage/components/Rss/Rss.js +64 -0
  125. package/dist/modules/homepage/components/Rss/RssContainer.d.ts +1 -0
  126. package/dist/modules/homepage/components/Rss/RssContainer.js +45 -0
  127. package/dist/modules/homepage/components/Rss/RssFeedForm.d.ts +13 -0
  128. package/dist/modules/homepage/components/Rss/RssFeedForm.js +69 -0
  129. package/dist/modules/homepage/components/Rss/RssFeedsModal.d.ts +11 -0
  130. package/dist/modules/homepage/components/Rss/RssFeedsModal.js +58 -0
  131. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.d.ts +25 -0
  132. package/dist/modules/homepage/components/Rss/hooks/useRssContainer.js +43 -0
  133. package/dist/modules/homepage/components/Rss/index.d.ts +6 -0
  134. package/dist/modules/homepage/components/Rss/services/api/index.d.ts +5 -0
  135. package/dist/modules/homepage/components/Rss/services/api/index.js +5 -0
  136. package/dist/modules/homepage/components/Rss/services/api/rssService.d.ts +38 -0
  137. package/dist/modules/homepage/components/Rss/services/api/rssService.js +51 -0
  138. package/dist/modules/homepage/components/Rss/services/queries/rss.d.ts +28 -0
  139. package/dist/modules/homepage/components/Rss/services/queries/rss.js +71 -0
  140. package/dist/modules/homepage/components/Rss/types.d.ts +25 -0
  141. package/dist/modules/homepage/components/Rss/utils.d.ts +7 -0
  142. package/dist/modules/homepage/components/Rss/utils.js +19 -0
  143. package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +1 -1
  144. package/dist/modules/homepage/components/TabsKids/components/TabsKids.d.ts +43 -0
  145. package/dist/modules/homepage/components/TabsKids/components/TabsKids.js +23 -0
  146. package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.d.ts +34 -0
  147. package/dist/modules/homepage/components/TabsKids/components/TabsKidsItem.js +26 -0
  148. package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.d.ts +14 -0
  149. package/dist/modules/homepage/components/TabsKids/components/TabsKidsList.js +64 -0
  150. package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.d.ts +20 -0
  151. package/dist/modules/homepage/components/TabsKids/hooks/useTabsKidsOverflow.js +43 -0
  152. package/dist/modules/homepage/components/TabsKids/index.d.ts +3 -0
  153. package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.d.ts +15 -0
  154. package/dist/modules/homepage/components/TabsKids/utils/visibleTabs.js +21 -0
  155. package/dist/modules/homepage/components/Universalis/Universalis.d.ts +8 -0
  156. package/dist/modules/homepage/components/Universalis/Universalis.js +62 -0
  157. package/dist/modules/homepage/components/Universalis/UniversalisContainer.d.ts +1 -0
  158. package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +16 -0
  159. package/dist/modules/homepage/components/Universalis/index.d.ts +3 -0
  160. package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +2 -2
  161. package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +2 -2
  162. package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +3 -1
  163. package/dist/modules/homepage/components/UserSpace/UserSpace.js +13 -7
  164. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +4 -2
  165. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +3 -2
  166. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +16 -0
  167. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +15 -0
  168. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +21 -0
  169. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +47 -0
  170. package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +2 -0
  171. package/dist/modules/homepage/components/index.d.ts +11 -1
  172. package/dist/modules/homepage/{components/SchoolSpace → hooks}/useUserSchools.d.ts +2 -2
  173. package/dist/modules/homepage/{components/SchoolSpace → hooks}/useUserSchools.js +4 -4
  174. package/dist/modules/icons/components/IconAddWidget.d.ts +7 -0
  175. package/dist/modules/icons/components/IconAddWidget.js +12 -0
  176. package/dist/modules/icons/components/index.d.ts +1 -0
  177. package/dist/modules/icons/components/nav/IconCommunitiesBeta.js +5 -7
  178. package/dist/modules/icons/components/nav/IconHomeBeta.js +6 -3
  179. package/dist/modules/icons/components/nav/IconMessagesBeta.js +7 -7
  180. package/dist/modules/icons/components/nav/IconMyAppsBeta.js +2 -3
  181. package/dist/modules/icons/components/nav/IconNotificationBeta.js +2 -4
  182. package/dist/modules/multimedia/Nextcloud/Nextcloud.js +19 -7
  183. package/dist/modules/multimedia/Workspace/Workspace.js +1 -1
  184. package/dist/modules/multimedia/index.d.ts +0 -1
  185. package/dist/multimedia.js +12 -14
  186. package/package.json +6 -6
  187. package/dist/components/Dropdown/useMatchRegistry.d.ts +0 -13
  188. package/dist/components/Dropdown/useMatchRegistry.js +0 -20
  189. package/dist/modules/multimedia/Nextcloud/NextcloudLogin.d.ts +0 -12
  190. package/dist/modules/multimedia/Nextcloud/NextcloudLogin.js +0 -33
  191. package/dist/modules/multimedia/NextcloudFolders/NextcloudFolders.d.ts +0 -12
  192. package/dist/modules/multimedia/NextcloudFolders/NextcloudFolders.js +0 -51
  193. package/dist/modules/multimedia/NextcloudFolders/components/NewFolderForm.d.ts +0 -16
  194. package/dist/modules/multimedia/NextcloudFolders/components/NewFolderForm.js +0 -51
  195. package/dist/modules/multimedia/NextcloudFolders/index.d.ts +0 -1
@@ -1,20 +0,0 @@
1
- import { useState, useRef, useCallback } from "react";
2
- const useMatchRegistry = () => {
3
- const [hasMatches, setHasMatches] = useState(!0), matchMapRef = useRef(/* @__PURE__ */ new Map()), reportMatch = useCallback((id, isMatch) => {
4
- matchMapRef.current.set(id, isMatch);
5
- const next = [...matchMapRef.current.values()].some(Boolean);
6
- setHasMatches((prev) => prev !== next ? next : prev);
7
- }, []), unregisterMatch = useCallback((id) => {
8
- matchMapRef.current.delete(id);
9
- const next = matchMapRef.current.size === 0 || [...matchMapRef.current.values()].some(Boolean);
10
- setHasMatches((prev) => prev !== next ? next : prev);
11
- }, []);
12
- return {
13
- hasMatches,
14
- reportMatch,
15
- unregisterMatch
16
- };
17
- };
18
- export {
19
- useMatchRegistry
20
- };
@@ -1,12 +0,0 @@
1
- export interface NextcloudLoginProps {
2
- /**
3
- * Called once the user is connected through the OAuth2 popup.
4
- */
5
- onConnected: () => void;
6
- /**
7
- * Replaces the default description, which is about inserting Nextcloud files.
8
- */
9
- description?: string;
10
- }
11
- declare const NextcloudLogin: ({ onConnected, description }: NextcloudLoginProps) => import("react/jsx-runtime").JSX.Element;
12
- export default NextcloudLogin;
@@ -1,33 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useRef, useEffect } from "react";
3
- import { useTranslation } from "react-i18next";
4
- import illuConnectionLost from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-connection-lost.svg";
5
- import useToast from "../../../hooks/useToast/useToast.js";
6
- import Flex from "../../../components/Flex/Flex.js";
7
- import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
8
- import Button from "../../../components/Button/Button.js";
9
- const NextcloudLogin = ({
10
- onConnected,
11
- description
12
- }) => {
13
- const {
14
- t
15
- } = useTranslation(), toast = useToast(), popupRef = useRef(null);
16
- useEffect(() => {
17
- function handleMessage(event) {
18
- var _a;
19
- event.origin !== window.location.origin || ((_a = event.data) == null ? void 0 : _a.type) !== "nextcloud-connected" || (popupRef.current && !popupRef.current.closed && popupRef.current.close(), onConnected());
20
- }
21
- return window.addEventListener("message", handleMessage), () => window.removeEventListener("message", handleMessage);
22
- }, [onConnected]);
23
- const openLoginPopup = () => {
24
- popupRef.current = window.open(`${window.location.origin}/nextcloud/user/oauth2/init`, "", "popup, height=600, width=400"), popupRef.current || toast.error(t("nextcloud.auth.popupBlocked"));
25
- };
26
- return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", className: "h-full w-100", justify: "center", align: "center", children: [
27
- /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuConnectionLost, title: t("nextcloud.auth.title"), text: description ?? t("nextcloud.auth.description") }),
28
- /* @__PURE__ */ jsx(Button, { onClick: openLoginPopup, children: t("nextcloud.auth.connect") })
29
- ] });
30
- };
31
- export {
32
- NextcloudLogin as default
33
- };
@@ -1,12 +0,0 @@
1
- interface NextcloudFoldersProps {
2
- /**
3
- * Function called with the path of the selected folder, relative to the user's Nextcloud root
4
- */
5
- onFolderSelected: (path: string) => void;
6
- /**
7
- * Description of the login screen shown when the user is not connected to Nextcloud
8
- */
9
- loginDescription?: string;
10
- }
11
- export default function NextcloudFolders({ onFolderSelected, loginDescription, }: NextcloudFoldersProps): import("react/jsx-runtime").JSX.Element;
12
- export {};
@@ -1,51 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect } from "react";
3
- import { useTranslation } from "react-i18next";
4
- import SvgIconFolderAdd from "../../icons/components/IconFolderAdd.js";
5
- import NextcloudLogin from "../Nextcloud/NextcloudLogin.js";
6
- import NewFolderForm from "./components/NewFolderForm.js";
7
- import illuError from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-error.svg";
8
- import useUser from "../../../hooks/useUser/useUser.js";
9
- import useNextcloudSearch from "../../../hooks/useNextcloudSearch/useNextcloudSearch.js";
10
- import Loading from "../../../components/Loading/Loading.js";
11
- import Flex from "../../../components/Flex/Flex.js";
12
- import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
13
- import Button from "../../../components/Button/Button.js";
14
- import Tree from "../../../components/Tree/components/Tree.js";
15
- const ROOT_ID = "root", ROOT_PATH = "/";
16
- function NextcloudFolders({
17
- onFolderSelected,
18
- loginDescription
19
- }) {
20
- const {
21
- t
22
- } = useTranslation(), {
23
- user
24
- } = useUser(), {
25
- root,
26
- needsAuth,
27
- isCheckingAuth,
28
- isAuthError,
29
- refetchAuthStatus,
30
- loadContent,
31
- loadError
32
- } = useNextcloudSearch(ROOT_ID, t("nextcloud"), user == null ? void 0 : user.userId), [selectedFolderId, setSelectedFolderId] = useState(), [showNewFolderForm, setShowNewFolderForm] = useState(!1), selectedPath = selectedFolderId === ROOT_ID ? ROOT_PATH : selectedFolderId;
33
- useEffect(() => {
34
- needsAuth || loadContent(ROOT_ID);
35
- }, [loadContent, needsAuth]);
36
- const handleFolderSelected = (folderId) => {
37
- setShowNewFolderForm(!1), setSelectedFolderId(folderId), loadContent(folderId), onFolderSelected(folderId === ROOT_ID ? ROOT_PATH : folderId);
38
- }, handleFolderCreated = (path) => {
39
- loadContent(selectedFolderId, !0), setSelectedFolderId(path), onFolderSelected(path);
40
- }, handleRetry = () => isAuthError ? refetchAuthStatus() : loadContent(selectedFolderId ?? ROOT_ID, !0);
41
- return isCheckingAuth ? /* @__PURE__ */ jsx(Loading, { isLoading: !0, className: "justify-content-center" }) : isAuthError || loadError ? /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", align: "center", children: [
42
- /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuError, title: t("nextcloud.error.title"), text: t("nextcloud.error.description") }),
43
- /* @__PURE__ */ jsx(Button, { onClick: handleRetry, children: t("retry") })
44
- ] }) : needsAuth ? /* @__PURE__ */ jsx(NextcloudLogin, { onConnected: refetchAuthStatus, description: loginDescription }) : /* @__PURE__ */ jsxs("div", { className: "border border-gray-400 rounded", children: [
45
- /* @__PURE__ */ jsx("div", { className: "p-12", children: /* @__PURE__ */ jsx(Tree, { nodes: root, selectedNodeId: selectedFolderId, showIcon: !0, onTreeItemClick: handleFolderSelected, onTreeItemUnfold: (nodeId) => loadContent(nodeId) }) }),
46
- /* @__PURE__ */ jsx("div", { className: "d-flex justify-content-end border-top border-gray-400 px-8 py-4", children: showNewFolderForm && selectedPath ? /* @__PURE__ */ jsx(NewFolderForm, { parentPath: selectedPath, onClose: () => setShowNewFolderForm(!1), onFolderCreated: handleFolderCreated }) : /* @__PURE__ */ jsx(Button, { color: "primary", variant: "ghost", leftIcon: /* @__PURE__ */ jsx(SvgIconFolderAdd, {}), onClick: () => setShowNewFolderForm(!0), disabled: !selectedPath, children: t("workspace.folder.create") }) })
47
- ] });
48
- }
49
- export {
50
- NextcloudFolders as default
51
- };
@@ -1,16 +0,0 @@
1
- type Props = {
2
- /**
3
- * Path of the folder in which the new folder is created
4
- */
5
- parentPath: string;
6
- /**
7
- * Function called when the form is closed
8
- */
9
- onClose: () => void;
10
- /**
11
- * Function called with the path of the created folder
12
- */
13
- onFolderCreated: (path: string) => void;
14
- };
15
- export default function NewFolderForm({ parentPath, onClose, onFolderCreated, }: Props): import("react/jsx-runtime").JSX.Element;
16
- export {};
@@ -1,51 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useRef, useEffect } from "react";
3
- import { odeServices } from "@edifice.io/client";
4
- import { useMutation } from "@tanstack/react-query";
5
- import { useTranslation } from "react-i18next";
6
- import SvgIconSave from "../../../icons/components/IconSave.js";
7
- import useUser from "../../../../hooks/useUser/useUser.js";
8
- import useToast from "../../../../hooks/useToast/useToast.js";
9
- import FormControl from "../../../../components/Form/FormControl.js";
10
- import IconButton from "../../../../components/Button/IconButton.js";
11
- function NewFolderForm({
12
- parentPath,
13
- onClose,
14
- onFolderCreated
15
- }) {
16
- const {
17
- t
18
- } = useTranslation(), {
19
- user
20
- } = useUser(), toast = useToast(), refInputName = useRef(null), createFolderMutation = useMutation({
21
- mutationFn: ({
22
- userId,
23
- path
24
- }) => odeServices.nextcloud().createFolder(userId, path)
25
- });
26
- return useEffect(() => {
27
- var _a;
28
- (_a = refInputName.current) == null || _a.focus();
29
- }, []), /* @__PURE__ */ jsx("form", { id: "modalNextcloudNewFolderForm", onSubmit: (event) => {
30
- var _a;
31
- event.preventDefault();
32
- const folderName = (_a = refInputName.current) == null ? void 0 : _a.value.trim().replace(/\//g, "-");
33
- if (!folderName || !user) return;
34
- const path = `${parentPath.replace(/\/?$/, "/")}${folderName}/`;
35
- createFolderMutation.mutate({
36
- userId: user.userId,
37
- path
38
- }, {
39
- onSuccess: () => {
40
- onFolderCreated(path), onClose();
41
- },
42
- onError: () => toast.error(t("e400"))
43
- });
44
- }, children: /* @__PURE__ */ jsxs("div", { className: "d-flex gap-4 flex-row", children: [
45
- /* @__PURE__ */ jsx(FormControl, { id: "modalNextcloudNewFolderForm", isRequired: !0, children: /* @__PURE__ */ jsx(FormControl.Input, { ref: refInputName, size: "md", type: "text", placeholder: t("workspace.folder.new.placeholder") }) }),
46
- /* @__PURE__ */ jsx(IconButton, { type: "submit", color: "primary", variant: "ghost", title: t("workspace.folder.new.create"), disabled: createFolderMutation.isPending, isLoading: createFolderMutation.isPending, icon: /* @__PURE__ */ jsx(SvgIconSave, {}) })
47
- ] }) });
48
- }
49
- export {
50
- NewFolderForm as default
51
- };
@@ -1 +0,0 @@
1
- export { default as NextcloudFolders } from './NextcloudFolders';