@edifice.io/react 2.5.24 → 2.6.0-develop-integration.20260710151131

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 (161) hide show
  1. package/dist/components/AppIcon/AppIcon.js +4 -1
  2. package/dist/components/Avatar/Avatar.d.ts +1 -1
  3. package/dist/components/Avatar/Avatar.js +2 -1
  4. package/dist/components/BetaSwitch/BetaSwitch.d.ts +13 -0
  5. package/dist/components/BetaSwitch/BetaSwitch.js +27 -0
  6. package/dist/components/BetaSwitch/index.d.ts +1 -0
  7. package/dist/components/ButtonBeta/ButtonBeta.d.ts +47 -0
  8. package/dist/components/ButtonBeta/ButtonBeta.js +34 -0
  9. package/dist/components/ButtonBeta/index.d.ts +2 -0
  10. package/dist/components/Flex/Flex.js +5 -1
  11. package/dist/components/Logo/index.d.ts +1 -1
  12. package/dist/components/LogoBeta/LogoBeta.d.ts +7 -0
  13. package/dist/components/LogoBeta/LogoBeta.js +14 -0
  14. package/dist/components/LogoBeta/index.d.ts +2 -0
  15. package/dist/components/PageLayout/PageLayout.d.ts +45 -0
  16. package/dist/components/PageLayout/PageLayout.js +94 -0
  17. package/dist/components/PageLayout/PageLayoutContext.d.ts +14 -0
  18. package/dist/components/PageLayout/PageLayoutContext.js +8 -0
  19. package/dist/components/PageLayout/components/PageLayoutBreadcrumb.d.ts +9 -0
  20. package/dist/components/PageLayout/components/PageLayoutBreadcrumb.js +10 -0
  21. package/dist/components/PageLayout/components/PageLayoutContent.d.ts +9 -0
  22. package/dist/components/PageLayout/components/PageLayoutContent.js +18 -0
  23. package/dist/components/PageLayout/components/PageLayoutHeader.d.ts +10 -0
  24. package/dist/components/PageLayout/components/PageLayoutHeader.js +18 -0
  25. package/dist/components/PageLayout/components/PageLayoutOverlay.d.ts +15 -0
  26. package/dist/components/PageLayout/components/PageLayoutOverlay.js +51 -0
  27. package/dist/components/PageLayout/components/PageLayoutSidebarLeft.d.ts +9 -0
  28. package/dist/components/PageLayout/components/PageLayoutSidebarLeft.js +18 -0
  29. package/dist/components/PageLayout/components/PageLayoutSidebarRight.d.ts +9 -0
  30. package/dist/components/PageLayout/components/PageLayoutSidebarRight.js +18 -0
  31. package/dist/components/PageLayout/hook/useOverlay.d.ts +5 -0
  32. package/dist/components/PageLayout/hook/useOverlay.js +15 -0
  33. package/dist/components/PageLayout/index.d.ts +4 -0
  34. package/dist/components/PageLayout/store/overlayStore.d.ts +15 -0
  35. package/dist/components/PageLayout/store/overlayStore.js +12 -0
  36. package/dist/components/index.d.ts +4 -0
  37. package/dist/homepage.js +34 -0
  38. package/dist/hooks/index.d.ts +2 -1
  39. package/dist/hooks/useEdificeIcons/useEdificeIcons.js +10 -9
  40. package/dist/hooks/useNextcloudSearch/index.d.ts +1 -0
  41. package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +9 -0
  42. package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +48 -0
  43. package/dist/icons-nav.js +38 -28
  44. package/dist/index.js +221 -202
  45. package/dist/modules/editor/components/Renderer/AttachmentRenderer.js +12 -3
  46. package/dist/modules/homepage/components/Favorites/Favorites.d.ts +6 -0
  47. package/dist/modules/homepage/components/Favorites/Favorites.js +28 -0
  48. package/dist/modules/homepage/components/Favorites/FavoritesContainer.d.ts +4 -0
  49. package/dist/modules/homepage/components/Favorites/FavoritesContainer.js +10 -0
  50. package/dist/modules/homepage/components/Favorites/index.d.ts +2 -0
  51. package/dist/modules/homepage/components/Header/Header.d.ts +9 -0
  52. package/dist/modules/homepage/components/Header/Header.js +80 -0
  53. package/dist/modules/homepage/components/Header/index.d.ts +2 -0
  54. package/dist/modules/homepage/components/HomeCard/HomeCard.d.ts +37 -0
  55. package/dist/modules/homepage/components/HomeCard/HomeCard.js +17 -0
  56. package/dist/modules/homepage/components/HomeCard/HomeCardContent.d.ts +7 -0
  57. package/dist/modules/homepage/components/HomeCard/HomeCardContent.js +10 -0
  58. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +18 -0
  59. package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +22 -0
  60. package/dist/modules/homepage/components/HomeCard/index.d.ts +4 -0
  61. package/dist/modules/homepage/components/LastInfos/LastInfos.d.ts +49 -0
  62. package/dist/modules/homepage/components/LastInfos/LastInfos.js +58 -0
  63. package/dist/modules/homepage/components/LastInfos/LastInfosContainer.d.ts +4 -0
  64. package/dist/modules/homepage/components/LastInfos/LastInfosContainer.js +37 -0
  65. package/dist/modules/homepage/components/LastInfos/LastInfosList.d.ts +13 -0
  66. package/dist/modules/homepage/components/LastInfos/LastInfosList.js +31 -0
  67. package/dist/modules/homepage/components/LastInfos/index.d.ts +4 -0
  68. package/dist/modules/homepage/components/LastInfos/useLastInfos.d.ts +18 -0
  69. package/dist/modules/homepage/components/LastInfos/useLastInfos.js +25 -0
  70. package/dist/modules/homepage/components/MessageFlashList/MessageFlash.d.ts +12 -0
  71. package/dist/modules/homepage/components/MessageFlashList/MessageFlash.js +65 -0
  72. package/dist/modules/homepage/components/MessageFlashList/MessageFlashList.d.ts +12 -0
  73. package/dist/modules/homepage/components/MessageFlashList/MessageFlashList.js +10 -0
  74. package/dist/modules/homepage/components/MessageFlashList/MessageFlashListContainer.d.ts +5 -0
  75. package/dist/modules/homepage/components/MessageFlashList/MessageFlashListContainer.js +14 -0
  76. package/dist/modules/homepage/components/MessageFlashList/hooks/useMessageFlashList.d.ts +16 -0
  77. package/dist/modules/homepage/components/MessageFlashList/hooks/useMessageFlashList.js +19 -0
  78. package/dist/modules/homepage/components/MessageFlashList/index.d.ts +4 -0
  79. package/dist/modules/homepage/components/MessageFlashList/services/api/index.d.ts +4 -0
  80. package/dist/modules/homepage/components/MessageFlashList/services/api/index.js +5 -0
  81. package/dist/modules/homepage/components/MessageFlashList/services/api/messagesFlashService.d.ts +20 -0
  82. package/dist/modules/homepage/components/MessageFlashList/services/api/messagesFlashService.js +21 -0
  83. package/dist/modules/homepage/components/MessageFlashList/services/queries/messagesFlash.d.ts +13 -0
  84. package/dist/modules/homepage/components/MessageFlashList/services/queries/messagesFlash.js +31 -0
  85. package/dist/modules/homepage/components/Notifications/NotificationItem.d.ts +20 -0
  86. package/dist/modules/homepage/components/Notifications/NotificationItem.js +16 -0
  87. package/dist/modules/homepage/components/Notifications/NotificationList.d.ts +18 -0
  88. package/dist/modules/homepage/components/Notifications/NotificationList.js +44 -0
  89. package/dist/modules/homepage/components/Notifications/NotificationListContainer.d.ts +9 -0
  90. package/dist/modules/homepage/components/Notifications/NotificationListContainer.js +20 -0
  91. package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.d.ts +5 -0
  92. package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.js +17 -0
  93. package/dist/modules/homepage/components/Notifications/NotificationSkeleton.d.ts +3 -0
  94. package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +19 -0
  95. package/dist/modules/homepage/components/Notifications/components/CommonNotificationItem.d.ts +24 -0
  96. package/dist/modules/homepage/components/Notifications/components/CommonNotificationItem.js +28 -0
  97. package/dist/modules/homepage/components/Notifications/components/NotificationItemResource.d.ts +15 -0
  98. package/dist/modules/homepage/components/Notifications/components/NotificationItemResource.js +19 -0
  99. package/dist/modules/homepage/components/Notifications/components/SystemNotificationItem.d.ts +15 -0
  100. package/dist/modules/homepage/components/Notifications/components/SystemNotificationItem.js +20 -0
  101. package/dist/modules/homepage/components/Notifications/components/UserNotificationItem.d.ts +15 -0
  102. package/dist/modules/homepage/components/Notifications/components/UserNotificationItem.js +25 -0
  103. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.d.ts +27 -0
  104. package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +53 -0
  105. package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.d.ts +20 -0
  106. package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +26 -0
  107. package/dist/modules/homepage/components/Notifications/index.d.ts +6 -0
  108. package/dist/modules/homepage/components/Notifications/services/api/index.d.ts +4 -0
  109. package/dist/modules/homepage/components/Notifications/services/api/index.js +5 -0
  110. package/dist/modules/homepage/components/Notifications/services/api/notificationService.d.ts +15 -0
  111. package/dist/modules/homepage/components/Notifications/services/api/notificationService.js +22 -0
  112. package/dist/modules/homepage/components/Notifications/services/queries/notification.d.ts +20 -0
  113. package/dist/modules/homepage/components/Notifications/services/queries/notification.js +40 -0
  114. package/dist/modules/homepage/components/SchoolSpace/SchoolSpace.d.ts +15 -0
  115. package/dist/modules/homepage/components/SchoolSpace/SchoolSpace.js +29 -0
  116. package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.d.ts +4 -0
  117. package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +13 -0
  118. package/dist/modules/homepage/components/SchoolSpace/index.d.ts +3 -0
  119. package/dist/modules/homepage/components/SchoolSpace/useUserSchools.d.ts +6 -0
  120. package/dist/modules/homepage/components/SchoolSpace/useUserSchools.js +39 -0
  121. package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +13 -0
  122. package/dist/modules/homepage/components/UserSpace/UserSpace.js +28 -0
  123. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +7 -0
  124. package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +19 -0
  125. package/dist/modules/homepage/components/UserSpace/index.d.ts +3 -0
  126. package/dist/modules/homepage/components/index.d.ts +8 -0
  127. package/dist/modules/homepage/hooks/useWidget.d.ts +6 -0
  128. package/dist/modules/homepage/hooks/useWidget.js +83 -0
  129. package/dist/modules/homepage/hooks/useWidgetPreferences.d.ts +6 -0
  130. package/dist/modules/homepage/hooks/useWidgetPreferences.js +34 -0
  131. package/dist/modules/homepage/index.d.ts +1 -0
  132. package/dist/modules/icons/components/nav/IconCommunitiesBeta.d.ts +7 -0
  133. package/dist/modules/icons/components/nav/IconCommunitiesBeta.js +18 -0
  134. package/dist/modules/icons/components/nav/IconHomeBeta.d.ts +7 -0
  135. package/dist/modules/icons/components/nav/IconHomeBeta.js +13 -0
  136. package/dist/modules/icons/components/{IconStarFavorite.d.ts → nav/IconMessagesBeta.d.ts} +2 -2
  137. package/dist/modules/icons/components/nav/IconMessagesBeta.js +18 -0
  138. package/dist/modules/icons/components/nav/IconMyAppsBeta.d.ts +7 -0
  139. package/dist/modules/icons/components/nav/IconMyAppsBeta.js +13 -0
  140. package/dist/modules/icons/components/nav/IconNotificationBeta.d.ts +7 -0
  141. package/dist/modules/icons/components/nav/IconNotificationBeta.js +14 -0
  142. package/dist/modules/icons/components/nav/index.d.ts +5 -0
  143. package/dist/modules/modals/OnboardingModal/index.d.ts +1 -1
  144. package/dist/modules/multimedia/FileCard/NextcloudFileCard.d.ts +25 -0
  145. package/dist/modules/multimedia/FileCard/NextcloudFileCard.js +105 -0
  146. package/dist/modules/multimedia/FileCard/index.d.ts +2 -0
  147. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +2 -2
  148. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +16 -3
  149. package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.d.ts +1 -0
  150. package/dist/modules/multimedia/MediaLibrary/innertabs/Nextcloud.js +22 -0
  151. package/dist/modules/multimedia/MediaLibrary/innertabs/index.d.ts +1 -0
  152. package/dist/modules/multimedia/MediaLibrary/innertabs/index.js +2 -0
  153. package/dist/modules/multimedia/Nextcloud/Nextcloud.d.ts +20 -0
  154. package/dist/modules/multimedia/Nextcloud/Nextcloud.js +88 -0
  155. package/dist/modules/multimedia/Nextcloud/index.d.ts +2 -0
  156. package/dist/modules/multimedia/index.d.ts +1 -0
  157. package/dist/multimedia.js +16 -12
  158. package/dist/providers/EdificeClientProvider/EdificeClientProvider.d.ts +0 -7
  159. package/dist/utilities/create-selectors/createSelectors.d.ts +10 -0
  160. package/dist/utilities/create-selectors/createSelectors.js +11 -0
  161. package/package.json +16 -10
@@ -0,0 +1,105 @@
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 NextcloudFileCard = ({
13
+ doc,
14
+ userId,
15
+ isClickable = !0,
16
+ isSelectable = !1,
17
+ isSelected = !1,
18
+ onClick,
19
+ className,
20
+ onSelect,
21
+ isFocused,
22
+ app,
23
+ customIcon,
24
+ customColor
25
+ }) => {
26
+ const ref = useRef(null), type = DocumentHelper.role(doc.contentType, !1);
27
+ function getRoleMap(type2) {
28
+ if (customIcon !== void 0 || customColor !== void 0)
29
+ return {
30
+ icon: customIcon || /* @__PURE__ */ jsx(SvgIconTextPage, { width: 22, height: 22 }),
31
+ color: customColor || "bg-gray-300",
32
+ hasShadow: !1
33
+ };
34
+ const roleMappings = {
35
+ csv: {
36
+ icon: ".CSV",
37
+ color: "bg-orange-200"
38
+ },
39
+ xls: {
40
+ icon: ".XLS",
41
+ color: "bg-green-200"
42
+ },
43
+ doc: {
44
+ icon: ".DOC",
45
+ color: "bg-blue-200"
46
+ },
47
+ txt: {
48
+ icon: ".TXT",
49
+ color: "bg-blue-200"
50
+ },
51
+ pdf: {
52
+ icon: ".PDF",
53
+ color: "bg-red-200"
54
+ },
55
+ audio: {
56
+ icon: /* @__PURE__ */ jsx(SvgIconMic, { width: 22, height: 22 }),
57
+ color: "bg-red-200"
58
+ },
59
+ ppt: {
60
+ icon: ".PPT",
61
+ color: "bg-red-200"
62
+ },
63
+ img: {
64
+ icon: /* @__PURE__ */ jsx(SvgIconLandscape, { width: 22, height: 22 }),
65
+ color: "bg-green-200"
66
+ },
67
+ video: {
68
+ icon: /* @__PURE__ */ jsx(SvgIconVideo, { width: 22, height: 22 }),
69
+ color: "bg-purple-200"
70
+ },
71
+ zip: {
72
+ icon: ".ZIP",
73
+ color: "bg-gray-300"
74
+ },
75
+ md: {
76
+ icon: ".MD",
77
+ color: "bg-blue-200"
78
+ },
79
+ unknown: {
80
+ icon: /* @__PURE__ */ jsx(SvgIconTextPage, { width: 22, height: 22 }),
81
+ color: "bg-gray-300"
82
+ }
83
+ };
84
+ return roleMappings[type2] || roleMappings.unknown;
85
+ }
86
+ const roleMap = getRoleMap(type ?? "unknown"), 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, {
87
+ ref
88
+ }), imageStyles = hasThumbnail && {
89
+ backgroundImage: `url(${mediaSrc})`,
90
+ backgroundSize: "cover"
91
+ };
92
+ return /* @__PURE__ */ jsx(Card, { className: clsx("card-file", className), isClickable, isSelectable, isSelected, onClick, app, isFocused, onSelect, children: /* @__PURE__ */ jsxs(Card.Body, { space: "8", children: [
93
+ /* @__PURE__ */ jsx("div", { ref, className: file, style: {
94
+ aspectRatio: "16/10",
95
+ ...imageStyles
96
+ }, children: type !== "img" || type === "img" && !hasThumbnail ? /* @__PURE__ */ jsx(FileIcon, { type, roleMap }) : null }),
97
+ /* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
98
+ /* @__PURE__ */ jsx(Card.Text, { children: doc.name }),
99
+ /* @__PURE__ */ jsx(Card.Text, { className: "text-black-50", children: doc == null ? void 0 : doc.ownerDisplayName })
100
+ ] })
101
+ ] }) });
102
+ };
103
+ export {
104
+ NextcloudFileCard as default
105
+ };
@@ -1,2 +1,4 @@
1
1
  export { default as FileCard } from './FileCard';
2
2
  export * from './FileCard';
3
+ export { default as NextcloudFileCard } from './NextcloudFileCard';
4
+ export * from './NextcloudFileCard';
@@ -1,4 +1,4 @@
1
- import { WorkspaceElement, WorkspaceVisibility } from '@edifice.io/client';
1
+ import { NextcloudDocument, 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 | InternalLinkTabResult | string | /*TODO type des autres résultats ?*/ any;
57
+ export type MediaLibraryResult = WorkspaceElement[] | WorkspaceElement | NextcloudDocument[] | InternalLinkTabResult | string | /*TODO type des autres résultats ?*/ any;
58
58
  /**
59
59
  * MediaLibrary component properties
60
60
  */
@@ -12,6 +12,7 @@ import SvgIconSmartphone from "../../icons/components/IconSmartphone.js";
12
12
  import { InnerTabs } from "./innertabs/index.js";
13
13
  import { MediaLibraryContext } from "./MediaLibraryContext.js";
14
14
  import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
15
+ import usePublicConf from "../../../hooks/usePublicConf/usePublicConf.js";
15
16
  import useHttpErrorToast from "../../../hooks/useHttpErrorToast/useHttpErrorToast.js";
16
17
  import Modal from "../../../components/Modal/Modal.js";
17
18
  import { Tabs } from "../../../components/Tabs/components/Tabs.js";
@@ -29,6 +30,8 @@ const orderedTabs = [
29
30
  // Filesystem browser + drag'n'drop of files
30
31
  "workspace",
31
32
  // Media browser
33
+ "nextcloud",
34
+ // Nextcloud media browser
32
35
  "video-embedder"
33
36
  // Link to a hosted video
34
37
  ], mediaLibraryTypes = {
@@ -81,7 +84,9 @@ const orderedTabs = [
81
84
  }));
82
85
  const {
83
86
  t
84
- } = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"), [type, setType] = useState(null);
87
+ } = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"), {
88
+ data: publicConf
89
+ } = usePublicConf("workspace"), enableNextcloud = (publicConf == null ? void 0 : publicConf["enable-nextcloud"]) === !0, [type, setType] = useState(null);
85
90
  useHttpErrorToast({
86
91
  active: !!type,
87
92
  isDismissible: !0,
@@ -96,6 +101,14 @@ const orderedTabs = [
96
101
  availableFor: ["audio", "video", "image", "attachment"],
97
102
  isEnable: null
98
103
  },
104
+ nextcloud: {
105
+ id: "nextcloud",
106
+ icon: /* @__PURE__ */ jsx(SvgIconGlobe, {}),
107
+ label: t("bbm.nextcloud"),
108
+ content: /* @__PURE__ */ jsx(InnerTabs.Nextcloud, {}),
109
+ availableFor: ["audio", "video", "image", "attachment"],
110
+ isEnable: () => enableNextcloud
111
+ },
99
112
  upload: {
100
113
  id: "upload",
101
114
  icon: /* @__PURE__ */ jsx(SvgIconSmartphone, {}),
@@ -185,9 +198,9 @@ const orderedTabs = [
185
198
  linkTabProps.current = void 0, setResult(void 0), setResultCounter(void 0), setDefaultTabId(void 0), setPreSuccess(void 0), setDeletionsOnCancel([]);
186
199
  }, handleTabChange = (tab) => {
187
200
  onTabChange == null || onTabChange(tab, deletionsOnCancel), resetState();
188
- }, handleOnSuccess = useCallback(() => {
201
+ }, isWorkspaceElementArray = (result2) => Array.isArray(result2) && (result2.length === 0 || "eType" in result2[0]), handleOnSuccess = useCallback(() => {
189
202
  const triggerSuccess = async (result2) => {
190
- result2 instanceof Array && ["protected", "public"].findIndex((v) => v === visibility) >= 0 && (result2 = await odeServices.workspace().transferDocuments(result2, appCode ?? "media-library", visibility)), onSuccess(result2);
203
+ isWorkspaceElementArray(result2) && ["protected", "public"].findIndex((v) => v === visibility) >= 0 && (result2 = await odeServices.workspace().transferDocuments(result2, appCode ?? "media-library", visibility)), onSuccess(result2);
191
204
  };
192
205
  onSuccessAction ? onSuccessAction().then((result2) => {
193
206
  triggerSuccess(result2);
@@ -0,0 +1 @@
1
+ export declare const Nextcloud: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
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
+ setResultCounter,
9
+ setResult,
10
+ setPreSuccess,
11
+ multiple
12
+ } = useMediaLibraryContext(), {
13
+ user
14
+ } = useUser();
15
+ function handleSelect(result) {
16
+ setResultCounter(result.length), result.length ? (setResult(result), setPreSuccess(() => () => user != null && user.userId ? odeServices.nextcloud().copyDocumentToWorkspace(user.userId, result.map((doc) => doc.path)) : Promise.resolve([]))) : (setResult(), setPreSuccess(void 0));
17
+ }
18
+ return /* @__PURE__ */ jsx(Nextcloud$1, { onSelect: handleSelect, multiple, className: "border rounded overflow-y-auto" });
19
+ };
20
+ export {
21
+ Nextcloud
22
+ };
@@ -4,6 +4,7 @@ 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;
7
8
  InternalLink: ({ target, resourceId, appPrefix, }: import('./InternalLink').InternalLinkTabProps) => import("react/jsx-runtime").JSX.Element;
8
9
  Iframe: () => import("react/jsx-runtime").JSX.Element;
9
10
  VideoEmbedder: () => import("react/jsx-runtime").JSX.Element;
@@ -2,6 +2,7 @@ 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";
5
6
  import { Upload } from "./Upload.js";
6
7
  import { Video } from "./Video.js";
7
8
  import { VideoEmbedder } from "./VideoEmbedder.js";
@@ -12,6 +13,7 @@ const InnerTabs = {
12
13
  Upload,
13
14
  ExternalLink,
14
15
  Workspace,
16
+ Nextcloud,
15
17
  InternalLink,
16
18
  Iframe,
17
19
  VideoEmbedder
@@ -0,0 +1,20 @@
1
+ import { NextcloudDocument } 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
+ * Optional class for styling purpose
16
+ */
17
+ className?: string;
18
+ }
19
+ declare const Nextcloud: ({ onSelect, multiple, className, }: NextcloudProps) => import("react/jsx-runtime").JSX.Element;
20
+ export default Nextcloud;
@@ -0,0 +1,88 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState, useCallback, useEffect, useMemo } from "react";
3
+ import clsx from "clsx";
4
+ import { useTranslation } from "react-i18next";
5
+ import { findNodeById } from "../../../components/Tree/utilities/tree.js";
6
+ import SvgIconSortAscendingLetters from "../../icons/components/IconSortAscendingLetters.js";
7
+ import SvgIconSortDescendingLetters from "../../icons/components/IconSortDescendingLetters.js";
8
+ import SvgIconSortTime from "../../icons/components/IconSortTime.js";
9
+ import illuNoContentInFolder from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-no-content-in-folder.svg";
10
+ import useUser from "../../../hooks/useUser/useUser.js";
11
+ import useNextcloudSearch from "../../../hooks/useNextcloudSearch/useNextcloudSearch.js";
12
+ import { Grid } from "../../../components/Grid/Grid.js";
13
+ import Tree from "../../../components/Tree/components/Tree.js";
14
+ import SearchBar from "../../../components/SearchBar/SearchBar.js";
15
+ import Dropdown from "../../../components/Dropdown/Dropdown.js";
16
+ import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
17
+ import NextcloudFileCard from "../FileCard/NextcloudFileCard.js";
18
+ import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
19
+ const ROOT_ID = "root";
20
+ function compare(a, b) {
21
+ return a ? b ? a.localeCompare(b) : 1 : -1;
22
+ }
23
+ const Nextcloud = ({
24
+ onSelect,
25
+ multiple = !0,
26
+ className
27
+ }) => {
28
+ const {
29
+ t
30
+ } = useTranslation(), {
31
+ user
32
+ } = useUser(), {
33
+ root,
34
+ loadContent
35
+ } = useNextcloudSearch(ROOT_ID, t("nextcloud.tree.root"), user == null ? void 0 : user.userId), [currentNodeId, setCurrentNodeId] = useState(ROOT_ID), treeRoot = root, currentNode = findNodeById(treeRoot, currentNodeId) ?? root, [searchTerm, setSearchTerm] = useState(null), [sortOrder, setSortOrder] = useState(["modified", "desc"]), [selectedDocuments, setSelectedDocuments] = useState([]), handleTreeItemChange = useCallback((nodeId) => {
36
+ setCurrentNodeId(nodeId), loadContent(nodeId);
37
+ }, [loadContent]);
38
+ useEffect(() => {
39
+ loadContent(ROOT_ID);
40
+ }, [loadContent]);
41
+ const documents = useMemo(() => {
42
+ if (!currentNode.files) return;
43
+ let list = [].concat(currentNode.files);
44
+ searchTerm && (list = list.filter((f) => f.name.indexOf(searchTerm) >= 0));
45
+ const sortFunction = sortOrder[0] === "name" ? sortOrder[1] === "asc" ? (a, b) => compare(a.name, b.name) : (a, b) => compare(b.name, a.name) : (a, b) => compare(b.lastModified, a.lastModified);
46
+ return list.sort(sortFunction);
47
+ }, [root, currentNode, searchTerm, sortOrder]), selectedPaths = useMemo(() => new Set(selectedDocuments.map((d) => d.path)), [selectedDocuments]), handleSearchChange = useCallback((e) => {
48
+ setSearchTerm(e.target.value);
49
+ }, [setSearchTerm]);
50
+ function getSortOrderLabel() {
51
+ return sortOrder[0] === "name" ? sortOrder[1] === "asc" ? t("sort.order.alpha.asc") : t("sort.order.alpha.desc") : t("sort.order.modify.desc");
52
+ }
53
+ function handleSelectDoc(doc) {
54
+ let currentDocuments = [...selectedDocuments];
55
+ multiple ? currentDocuments.includes(doc) ? currentDocuments = currentDocuments.filter((selectedDocument) => selectedDocument.path !== doc.path) : currentDocuments = [...currentDocuments, doc] : currentDocuments = [doc], setSelectedDocuments(currentDocuments), onSelect(currentDocuments);
56
+ }
57
+ const nextcloud = clsx("workspace flex-grow-1 gap-0", className);
58
+ return /* @__PURE__ */ jsxs(Grid, { className: nextcloud, children: [
59
+ /* @__PURE__ */ jsx(Grid.Col, { sm: "12", md: "3", xl: "4", className: "workspace-folders p-12 pt-0 gap-12", children: /* @__PURE__ */ jsx("div", { style: {
60
+ position: "sticky",
61
+ top: 0,
62
+ paddingTop: "1.2rem"
63
+ }, children: /* @__PURE__ */ jsx(Tree, { nodes: treeRoot, selectedNodeId: currentNodeId, showIcon: !0, onTreeItemClick: handleTreeItemChange, onTreeItemUnfold: handleTreeItemChange }) }) }),
64
+ /* @__PURE__ */ jsx(Grid.Col, { sm: "12", md: "5", xl: "8", children: /* @__PURE__ */ jsxs(Grid, { className: "flex-grow-1 gap-0", children: [
65
+ /* @__PURE__ */ jsxs(Grid.Col, { sm: "4", md: "8", xl: "12", children: [
66
+ /* @__PURE__ */ jsx("div", { className: "workspace-search px-16 py-8 ", children: /* @__PURE__ */ jsx(SearchBar, { isVariant: !0, className: "gap-16", onChange: handleSearchChange }) }),
67
+ /* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center justify-content-end px-8 py-4", children: [
68
+ /* @__PURE__ */ jsx("small", { className: "text-muted", children: t("workspace.search.order") }),
69
+ /* @__PURE__ */ jsxs(Dropdown, { children: [
70
+ /* @__PURE__ */ jsx(Dropdown.Trigger, { size: "sm", label: getSortOrderLabel(), variant: "ghost" }),
71
+ /* @__PURE__ */ jsxs(Dropdown.Menu, { children: [
72
+ /* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortTime, {}), onClick: () => setSortOrder(["modified", "desc"]), children: t("sort.order.modify.desc") }),
73
+ /* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortAscendingLetters, {}), onClick: () => setSortOrder(["name", "asc"]), children: t("sort.order.alpha.asc") }),
74
+ /* @__PURE__ */ jsx(Dropdown.Item, { icon: /* @__PURE__ */ jsx(SvgIconSortDescendingLetters, {}), onClick: () => setSortOrder(["name", "desc"]), children: t("sort.order.alpha.desc") })
75
+ ] })
76
+ ] })
77
+ ] })
78
+ ] }),
79
+ /* @__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) => {
80
+ const isSelected = selectedPaths.has(doc.path);
81
+ return /* @__PURE__ */ jsx(NextcloudFileCard, { doc, userId: user.userId, isSelected, onClick: () => handleSelectDoc(doc) }, doc.path);
82
+ }) }) : /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuNoContentInFolder, size: 64, text: t("nextcloud.empty.docSpace") }) : /* @__PURE__ */ jsx(LoadingScreen, {}) })
83
+ ] }) })
84
+ ] });
85
+ };
86
+ export {
87
+ Nextcloud as default
88
+ };
@@ -0,0 +1,2 @@
1
+ export { default as Nextcloud } from './Nextcloud';
2
+ export * from './Nextcloud';
@@ -5,6 +5,7 @@ export * from './ImagePicker';
5
5
  export * from './FileCard';
6
6
  export * from './Linker';
7
7
  export * from './MediaLibrary';
8
+ export * from './Nextcloud';
8
9
  export * from './UploadCard';
9
10
  export * from './VideoEmbed';
10
11
  export * from './VideoRecorder';
@@ -4,12 +4,14 @@ 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/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";
7
+ import { default as default8 } from "./modules/multimedia/Nextcloud/Nextcloud.js";
8
+ import { default as default9 } from "./modules/multimedia/FileCard/NextcloudFileCard.js";
9
+ import { default as default10 } from "./modules/multimedia/UploadCard/UploadCard.js";
10
+ import { default as default11 } from "./modules/multimedia/UploadFiles/UploadFiles.js";
11
+ import { default as default12 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
12
+ import { default as default13 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
13
+ import { default as default14 } from "./modules/multimedia/Workspace/Workspace.js";
14
+ import { default as default15 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
13
15
  import { ExternalLinker } from "./modules/multimedia/Linker/ExternalLinker/ExternalLinker.js";
14
16
  import { InternalLinker } from "./modules/multimedia/Linker/InternalLinker/InternalLinker.js";
15
17
  import { Upload } from "./modules/multimedia/MediaLibrary/innertabs/Upload.js";
@@ -22,11 +24,13 @@ export {
22
24
  default6 as ImagePicker,
23
25
  InternalLinker,
24
26
  default7 as MediaLibrary,
27
+ default8 as Nextcloud,
28
+ default9 as NextcloudFileCard,
25
29
  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
30
+ default10 as UploadCard,
31
+ default11 as UploadFiles,
32
+ default12 as VideoEmbed,
33
+ default13 as VideoRecorder,
34
+ default14 as Workspace,
35
+ default15 as WorkspaceFolders
32
36
  };
@@ -1,9 +1,2 @@
1
- import { App } from '@edifice.io/client';
2
1
  import { EdificeClientProviderProps } from './EdificeClientProvider.context';
3
- export interface OdeProviderParams {
4
- alternativeApp?: boolean;
5
- app: App;
6
- cdnDomain?: string | null;
7
- version?: string | null;
8
- }
9
2
  export declare function EdificeClientProvider({ children, params, }: EdificeClientProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { StoreApi, UseBoundStore } from 'zustand';
2
+ type WithSelectors<S> = S extends {
3
+ getState: () => infer T;
4
+ } ? S & {
5
+ use: {
6
+ [K in keyof T]: () => T[K];
7
+ };
8
+ } : never;
9
+ export declare const createSelectors: <S extends UseBoundStore<StoreApi<object>>>(_store: S) => WithSelectors<S>;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ const createSelectors = (_store) => {
2
+ const store = _store;
3
+ store.use = {};
4
+ const selectorMap = store.use;
5
+ for (const k of Object.keys(store.getState()))
6
+ selectorMap[k] = () => store((s) => s[k]);
7
+ return store;
8
+ };
9
+ export {
10
+ createSelectors
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.5.24",
3
+ "version": "2.6.0-develop-integration.20260710151131",
4
4
  "description": "Edifice React Library",
5
5
  "keywords": [
6
6
  "react",
@@ -65,6 +65,10 @@
65
65
  "./widgets": {
66
66
  "import": "./dist/widgets.js",
67
67
  "types": "./dist/modules/widgets/index.d.ts"
68
+ },
69
+ "./homepage": {
70
+ "import": "./dist/homepage.js",
71
+ "types": "./dist/modules/homepage/index.d.ts"
68
72
  }
69
73
  },
70
74
  "module": "dist/index.js",
@@ -74,13 +78,13 @@
74
78
  ],
75
79
  "dependencies": {
76
80
  "@ant-design/icons": "5.4.0",
77
- "@screeb/sdk-browser": "0.5.0",
78
- "@screeb/sdk-react": "0.6.0",
79
81
  "@dnd-kit/core": "6.3.1",
80
82
  "@dnd-kit/sortable": "8.0.0",
81
83
  "@dnd-kit/utilities": "3.2.2",
82
84
  "@floating-ui/react": "0.26.0",
83
85
  "@popperjs/core": "2.11.8",
86
+ "@screeb/sdk-browser": "0.5.0",
87
+ "@screeb/sdk-react": "0.6.0",
84
88
  "@tiptap/core": "2.11.0",
85
89
  "@tiptap/extension-blockquote": "2.11.0",
86
90
  "@tiptap/extension-bullet-list": "2.11.0",
@@ -135,9 +139,10 @@
135
139
  "react-slugify": "3.0.3",
136
140
  "swiper": "10.1.0",
137
141
  "ua-parser-js": "1.0.36",
138
- "@edifice.io/bootstrap": "2.5.24",
139
- "@edifice.io/utilities": "2.5.24",
140
- "@edifice.io/tiptap-extensions": "2.5.24"
142
+ "zustand": "4.5.7",
143
+ "@edifice.io/bootstrap": "2.6.0-develop-integration.20260710151131",
144
+ "@edifice.io/tiptap-extensions": "2.6.0-develop-integration.20260710151131",
145
+ "@edifice.io/utilities": "2.6.0-develop-integration.20260710151131"
141
146
  },
142
147
  "devDependencies": {
143
148
  "@babel/plugin-transform-react-pure-annotations": "7.27.1",
@@ -168,8 +173,8 @@
168
173
  "vite": "5.4.14",
169
174
  "vite-plugin-dts": "4.5.4",
170
175
  "vite-tsconfig-paths": "5.1.4",
171
- "@edifice.io/client": "2.5.24",
172
- "@edifice.io/config": "2.5.24"
176
+ "@edifice.io/config": "2.6.0-develop-integration.20260710151131",
177
+ "@edifice.io/client": "2.6.0-develop-integration.20260710151131"
173
178
  },
174
179
  "peerDependencies": {
175
180
  "@react-spring/web": "9.7.5",
@@ -184,9 +189,10 @@
184
189
  },
185
190
  "gitHead": "3e1c3f5b48505564db1b70aab22063a70336f3b0",
186
191
  "scripts": {
187
- "build": "pnpm build:icons && vite build",
188
- "build:icons": "svgr src/modules/icons/assets --config-file ./svgr.config.cjs",
192
+ "build": "vite build",
189
193
  "build:analyze": "vite build --mode analyze",
194
+ "generate:icons": "rm -rf src/modules/icons/components && svgr src/modules/icons/assets --config-file ./svgr.config.cjs --silent",
195
+ "icons:check": "pnpm generate:icons && git add --intent-to-add -- src/modules/icons/components && git diff --exit-code -- src/modules/icons/components",
190
196
  "fix": "eslint --fix --report-unused-disable-directives --max-warnings 0",
191
197
  "format": "prettier --check \"src/**/*.{ts,tsx}\"",
192
198
  "format:write": "prettier --write \"src/**/*.{ts,tsx}\"",