@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
@@ -5,7 +5,6 @@ import { useTranslation } from "react-i18next";
5
5
  import SvgIconApplications from "../../icons/components/IconApplications.js";
6
6
  import SvgIconCode from "../../icons/components/IconCode.js";
7
7
  import SvgIconFolder from "../../icons/components/IconFolder.js";
8
- import SvgIconGlobe2 from "../../icons/components/IconGlobe2.js";
9
8
  import SvgIconGlobe from "../../icons/components/IconGlobe.js";
10
9
  import SvgIconMic from "../../icons/components/IconMic.js";
11
10
  import SvgIconRecordVideo from "../../icons/components/IconRecordVideo.js";
@@ -13,7 +12,6 @@ import SvgIconSmartphone from "../../icons/components/IconSmartphone.js";
13
12
  import { InnerTabs } from "./innertabs/index.js";
14
13
  import { MediaLibraryContext } from "./MediaLibraryContext.js";
15
14
  import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
16
- import usePublicConf from "../../../hooks/usePublicConf/usePublicConf.js";
17
15
  import useHttpErrorToast from "../../../hooks/useHttpErrorToast/useHttpErrorToast.js";
18
16
  import Modal from "../../../components/Modal/Modal.js";
19
17
  import { Tabs } from "../../../components/Tabs/components/Tabs.js";
@@ -31,8 +29,6 @@ const orderedTabs = [
31
29
  // Filesystem browser + drag'n'drop of files
32
30
  "workspace",
33
31
  // Media browser
34
- "nextcloud",
35
- // Nextcloud media browser
36
32
  "video-embedder"
37
33
  // Link to a hosted video
38
34
  ], mediaLibraryTypes = {
@@ -74,7 +70,7 @@ const orderedTabs = [
74
70
  onCancel,
75
71
  onTabChange
76
72
  }, ref) => {
77
- var _a, _b;
73
+ var _a;
78
74
  const linkTabProps = useRef(), refModal = useRef(null);
79
75
  useImperativeHandle(ref, () => ({
80
76
  show,
@@ -85,9 +81,7 @@ const orderedTabs = [
85
81
  }));
86
82
  const {
87
83
  t
88
- } = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"), nextcloudViewWorkflow = useHasWorkflow("fr.openent.nextcloud.controller.NextcloudController|view"), {
89
- data: workspacePublicConf
90
- } = usePublicConf("workspace"), enableNextcloudTab = ((_a = workspacePublicConf == null ? void 0 : workspacePublicConf["folder-service"]) == null ? void 0 : _a.includes("nextcloud")) && nextcloudViewWorkflow, [type, setType] = useState(null);
84
+ } = useTranslation(), workspaceCreateWorkflow = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"), videoCaptureWorkflow = useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"), [type, setType] = useState(null);
91
85
  useHttpErrorToast({
92
86
  active: !!type,
93
87
  isDismissible: !0,
@@ -102,14 +96,6 @@ const orderedTabs = [
102
96
  availableFor: ["audio", "video", "image", "attachment"],
103
97
  isEnable: null
104
98
  },
105
- nextcloud: {
106
- id: "nextcloud",
107
- icon: /* @__PURE__ */ jsx(SvgIconGlobe2, {}),
108
- label: t("bbm.nextcloud"),
109
- content: /* @__PURE__ */ jsx(InnerTabs.Nextcloud, {}),
110
- availableFor: ["audio", "video", "image", "attachment"],
111
- isEnable: () => !!enableNextcloudTab
112
- },
113
99
  upload: {
114
100
  id: "upload",
115
101
  icon: /* @__PURE__ */ jsx(SvgIconSmartphone, {}),
@@ -191,17 +177,17 @@ const orderedTabs = [
191
177
  linkTabProps.current = props, "resourceId" in props || "appPrefix" in props || setDefaultTabId("external-link"), setType("hyperlink");
192
178
  };
193
179
  useEffect(() => {
194
- var _a2, _b2;
180
+ var _a2, _b;
195
181
  const typeKey = type || "none";
196
- !defaultTabId && typeof ((_a2 = mediaLibraryTypes[typeKey]) == null ? void 0 : _a2.defaultTab) == "string" && setDefaultTabId((_b2 = mediaLibraryTypes[typeKey]) == null ? void 0 : _b2.defaultTab);
182
+ !defaultTabId && typeof ((_a2 = mediaLibraryTypes[typeKey]) == null ? void 0 : _a2.defaultTab) == "string" && setDefaultTabId((_b = mediaLibraryTypes[typeKey]) == null ? void 0 : _b.defaultTab);
197
183
  }, [defaultTabId, type]);
198
- const modalHeader = t(((_b = mediaLibraryTypes[type ?? "none"]) == null ? void 0 : _b.title) ?? "bbm"), resetState = () => {
184
+ const modalHeader = t(((_a = mediaLibraryTypes[type ?? "none"]) == null ? void 0 : _a.title) ?? "bbm"), resetState = () => {
199
185
  linkTabProps.current = void 0, setResult(void 0), setResultCounter(void 0), setDefaultTabId(void 0), setPreSuccess(void 0), setDeletionsOnCancel([]);
200
186
  }, handleTabChange = (tab) => {
201
187
  onTabChange == null || onTabChange(tab, deletionsOnCancel), resetState();
202
- }, isWorkspaceElementArray = (result2) => Array.isArray(result2) && (result2.length === 0 || "eType" in result2[0]), handleOnSuccess = useCallback(() => {
188
+ }, handleOnSuccess = useCallback(() => {
203
189
  const triggerSuccess = async (result2) => {
204
- isWorkspaceElementArray(result2) && ["protected", "public"].findIndex((v) => v === visibility) >= 0 && (result2 = await odeServices.workspace().transferDocuments(result2, appCode ?? "media-library", visibility)), onSuccess(result2);
190
+ result2 instanceof Array && ["protected", "public"].findIndex((v) => v === visibility) >= 0 && (result2 = await odeServices.workspace().transferDocuments(result2, appCode ?? "media-library", visibility)), onSuccess(result2);
205
191
  };
206
192
  onSuccessAction ? onSuccessAction().then((result2) => {
207
193
  triggerSuccess(result2);
@@ -4,7 +4,6 @@ export declare const InnerTabs: {
4
4
  Upload: () => import("react/jsx-runtime").JSX.Element;
5
5
  ExternalLink: ({ link, multiNodeSelected, }: import('./ExternalLink').ExternalLinkTabProps) => import("react/jsx-runtime").JSX.Element;
6
6
  Workspace: () => import("react/jsx-runtime").JSX.Element;
7
- Nextcloud: () => import("react/jsx-runtime").JSX.Element;
8
7
  InternalLink: ({ target, resourceId, appPrefix, }: import('./InternalLink').InternalLinkTabProps) => import("react/jsx-runtime").JSX.Element;
9
8
  Iframe: () => import("react/jsx-runtime").JSX.Element;
10
9
  VideoEmbedder: () => import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,6 @@ 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";
6
5
  import { Upload } from "./Upload.js";
7
6
  import { Video } from "./Video.js";
8
7
  import { VideoEmbedder } from "./VideoEmbedder.js";
@@ -13,7 +12,6 @@ const InnerTabs = {
13
12
  Upload,
14
13
  ExternalLink,
15
14
  Workspace,
16
- Nextcloud,
17
15
  InternalLink,
18
16
  Iframe,
19
17
  VideoEmbedder
@@ -5,7 +5,6 @@ export * from './ImagePicker';
5
5
  export * from './FileCard';
6
6
  export * from './Linker';
7
7
  export * from './MediaLibrary';
8
- export * from './Nextcloud';
9
8
  export * from './UploadCard';
10
9
  export * from './VideoEmbed';
11
10
  export * from './VideoRecorder';
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Doubles for the browser capture APIs the recorders rely on, none of which
3
+ * jsdom implements: `navigator.mediaDevices`, `MediaStream`, `MediaRecorder`,
4
+ * and the playback methods of `HTMLMediaElement`.
5
+ *
6
+ * Shared by the audio and the video recorder specs. The Web Audio doubles
7
+ * (`AudioContext`, `AudioWorkletNode`, `Worker`) sit in the second half of this
8
+ * file, behind `installWebAudioHarness`: only `useAudioRecorder` needs them,
9
+ * but both of its specs do.
10
+ */
11
+ /** A track the component can stop to release the device. */
12
+ export declare function fakeTrack(kind?: 'audio' | 'video'): MediaStreamTrack;
13
+ /**
14
+ * `MediaStream` has to exist as a constructor, not just as a shape:
15
+ * <VideoRecorder> narrows with `srcObject instanceof MediaStream` before
16
+ * resetting it.
17
+ */
18
+ export declare class FakeMediaStream {
19
+ id: string;
20
+ private tracks;
21
+ constructor(tracks?: MediaStreamTrack[]);
22
+ static created: number;
23
+ getTracks(): MediaStreamTrack[];
24
+ }
25
+ export type FakeMediaStreamInstance = FakeMediaStream & MediaStream;
26
+ /** Records what the component asked of it, and lets a test push data back. */
27
+ export declare class FakeMediaRecorder {
28
+ static instances: FakeMediaRecorder[];
29
+ /** Mime types rejected by `isTypeSupported`, to exercise the fallbacks. */
30
+ static unsupported: string[];
31
+ state: 'inactive' | 'recording' | 'paused';
32
+ ondataavailable: ((event: {
33
+ data: Blob;
34
+ }) => void) | null;
35
+ onerror: ((event: unknown) => void) | null;
36
+ readonly stream: MediaStream;
37
+ readonly mimeType: string;
38
+ readonly start: import('vitest').Mock<(timeslice?: number) => void>;
39
+ readonly stop: import('vitest').Mock<() => void>;
40
+ readonly requestData: import('vitest').Mock<(...args: any[]) => any>;
41
+ timeslice?: number;
42
+ constructor(stream: MediaStream, options?: {
43
+ mimeType?: string;
44
+ });
45
+ static isTypeSupported(type: string): boolean;
46
+ /** Hands a chunk to the component, as the browser would every timeslice. */
47
+ emitData(blob: Blob): void;
48
+ emitError(event?: unknown): void;
49
+ }
50
+ export type MediaHarness = {
51
+ /** The stream handed over by `getUserMedia`. */
52
+ stream: FakeMediaStreamInstance;
53
+ getUserMedia: ReturnType<typeof vi.fn>;
54
+ enumerateDevices: ReturnType<typeof vi.fn>;
55
+ createObjectURL: ReturnType<typeof vi.fn>;
56
+ revokeObjectURL: ReturnType<typeof vi.fn>;
57
+ /** Every MediaRecorder built since the harness was installed. */
58
+ recorders: FakeMediaRecorder[];
59
+ /** The recorder currently in use, i.e. the last one built. */
60
+ recorder: () => FakeMediaRecorder;
61
+ };
62
+ export declare function videoInput(deviceId: string, label?: string): MediaDeviceInfo;
63
+ export declare function audioInput(deviceId?: string): MediaDeviceInfo;
64
+ /**
65
+ * Installs every double on the global scope. Call from `beforeEach`; the stubs
66
+ * are torn down by the `restoreMocks`/`unstubGlobals` handling of the runner,
67
+ * so nothing has to be undone by hand.
68
+ *
69
+ * @param devices what `enumerateDevices` should report
70
+ * @param stream the stream `getUserMedia` should resolve to
71
+ */
72
+ export declare function installMediaHarness({ devices, stream, }?: {
73
+ devices?: MediaDeviceInfo[];
74
+ stream?: FakeMediaStreamInstance;
75
+ }): MediaHarness;
76
+ /**
77
+ * Replaces the playback methods jsdom leaves unimplemented, and makes
78
+ * `currentTime` writable so the components can rewind their media element.
79
+ */
80
+ export declare function installMediaElementStubs(): void;
81
+ export declare class FakeAudioWorkletNode {
82
+ readonly context: FakeAudioContext;
83
+ readonly processorName: string;
84
+ static instances: FakeAudioWorkletNode[];
85
+ readonly connect: import('vitest').Mock<(...args: any[]) => any>;
86
+ readonly disconnect: import('vitest').Mock<(...args: any[]) => any>;
87
+ /**
88
+ * The `MessagePort` is driven by hand: the hook subscribes with
89
+ * `addEventListener`, so the listeners are replayed by `emitSamples`.
90
+ */
91
+ readonly port: {
92
+ addEventListener: import('vitest').Mock<(...args: any[]) => any>;
93
+ removeEventListener: import('vitest').Mock<(...args: any[]) => any>;
94
+ close: import('vitest').Mock<(...args: any[]) => any>;
95
+ start: import('vitest').Mock<(...args: any[]) => any>;
96
+ postMessage: import('vitest').Mock<(...args: any[]) => any>;
97
+ };
98
+ constructor(context: FakeAudioContext, processorName: string);
99
+ /** Replays a block of samples, as the AudioWorkletProcessor would. */
100
+ emitSamples(inputs: unknown): void;
101
+ }
102
+ export declare class FakeAudioContext {
103
+ static instances: FakeAudioContext[];
104
+ /** Replaceable, to exercise the addModule failure path. */
105
+ static addModule: import('vitest').Mock<(moduleURL: string) => Promise<void>>;
106
+ readonly sampleRate: number;
107
+ /** Writable: the hook reads it to compute the elapsed recording time. */
108
+ currentTime: number;
109
+ readonly destination: {
110
+ connect: import('vitest').Mock<(...args: any[]) => any>;
111
+ disconnect: import('vitest').Mock<(...args: any[]) => any>;
112
+ };
113
+ readonly close: import('vitest').Mock<(...args: any[]) => any>;
114
+ readonly suspend: import('vitest').Mock<(...args: any[]) => any>;
115
+ readonly resume: import('vitest').Mock<(...args: any[]) => any>;
116
+ readonly createMediaStreamSource: import('vitest').Mock<() => {
117
+ connect: import('vitest').Mock<(...args: any[]) => any>;
118
+ disconnect: import('vitest').Mock<(...args: any[]) => any>;
119
+ }>;
120
+ readonly audioWorklet: {
121
+ addModule: (path: string) => Promise<void>;
122
+ };
123
+ constructor(options?: {
124
+ sampleRate?: number;
125
+ });
126
+ }
127
+ export declare class FakeWorker {
128
+ readonly url: string;
129
+ static instances: FakeWorker[];
130
+ readonly postMessage: import('vitest').Mock<(...args: any[]) => any>;
131
+ readonly terminate: import('vitest').Mock<(...args: any[]) => any>;
132
+ onmessage: ((event: {
133
+ data: unknown;
134
+ }) => void) | null;
135
+ constructor(url: string);
136
+ /** Answers the last `postMessage`, as the encoder worker would. */
137
+ emit(data: unknown): void;
138
+ /** The payload of the last message the hook sent, e.g. ['wav', …]. */
139
+ lastMessage(): any;
140
+ }
141
+ export type WebAudioHarness = {
142
+ /** The context opened by the current recording. */
143
+ context: () => FakeAudioContext;
144
+ /** The worklet node processing the current recording. */
145
+ workletNode: () => FakeAudioWorkletNode;
146
+ /** The encoder worker, created once on mount. */
147
+ worker: () => FakeWorker;
148
+ addModule: typeof FakeAudioContext.addModule;
149
+ };
150
+ /**
151
+ * Installs the Web Audio doubles. Combine with `installMediaHarness`, which
152
+ * provides `getUserMedia` and the blob URL factory the encoder result needs.
153
+ */
154
+ export declare function installWebAudioHarness(): WebAudioHarness;
@@ -4,14 +4,12 @@ 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/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";
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";
15
13
  import { ExternalLinker } from "./modules/multimedia/Linker/ExternalLinker/ExternalLinker.js";
16
14
  import { InternalLinker } from "./modules/multimedia/Linker/InternalLinker/InternalLinker.js";
17
15
  import { Upload } from "./modules/multimedia/MediaLibrary/innertabs/Upload.js";
@@ -24,13 +22,11 @@ export {
24
22
  default6 as ImagePicker,
25
23
  InternalLinker,
26
24
  default7 as MediaLibrary,
27
- default8 as Nextcloud,
28
- default9 as NextcloudFileCard,
29
25
  Upload,
30
- default10 as UploadCard,
31
- default11 as UploadFiles,
32
- default12 as VideoEmbed,
33
- default13 as VideoRecorder,
34
- default14 as Workspace,
35
- default15 as WorkspaceFolders
26
+ default8 as UploadCard,
27
+ default9 as UploadFiles,
28
+ default10 as VideoEmbed,
29
+ default11 as VideoRecorder,
30
+ default12 as Workspace,
31
+ default13 as WorkspaceFolders
36
32
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.6.2-feat-INTEG-1924-port-react-nextcloud-filetree.20260824153355",
3
+ "version": "2.6.3-develop-enabling.20260825190837",
4
4
  "description": "Edifice React Library",
5
5
  "keywords": [
6
6
  "react",
@@ -140,9 +140,9 @@
140
140
  "swiper": "10.1.0",
141
141
  "ua-parser-js": "1.0.36",
142
142
  "zustand": "4.5.7",
143
- "@edifice.io/tiptap-extensions": "2.6.2-feat-INTEG-1924-port-react-nextcloud-filetree.20260824153355",
144
- "@edifice.io/utilities": "2.6.2-feat-INTEG-1924-port-react-nextcloud-filetree.20260824153355",
145
- "@edifice.io/bootstrap": "2.6.2-feat-INTEG-1924-port-react-nextcloud-filetree.20260824153355"
143
+ "@edifice.io/bootstrap": "2.6.3-develop-enabling.20260825190837",
144
+ "@edifice.io/tiptap-extensions": "2.6.3-develop-enabling.20260825190837",
145
+ "@edifice.io/utilities": "2.6.3-develop-enabling.20260825190837"
146
146
  },
147
147
  "devDependencies": {
148
148
  "@babel/plugin-transform-react-pure-annotations": "7.27.1",
@@ -173,8 +173,8 @@
173
173
  "vite": "5.4.14",
174
174
  "vite-plugin-dts": "4.5.4",
175
175
  "vite-tsconfig-paths": "5.1.4",
176
- "@edifice.io/client": "2.6.2-feat-INTEG-1924-port-react-nextcloud-filetree.20260824153355",
177
- "@edifice.io/config": "2.6.2-feat-INTEG-1924-port-react-nextcloud-filetree.20260824153355"
176
+ "@edifice.io/client": "2.6.3-develop-enabling.20260825190837",
177
+ "@edifice.io/config": "2.6.3-develop-enabling.20260825190837"
178
178
  },
179
179
  "peerDependencies": {
180
180
  "@react-spring/web": "9.7.5",
@@ -1 +0,0 @@
1
- export { default as useNextcloudSearch } from './useNextcloudSearch';
@@ -1,12 +0,0 @@
1
- import { ID, NextcloudDocument } from '@edifice.io/client';
2
- import { TreeItem } from '../../components/Tree/types';
3
- export type NextcloudFolderNode = TreeItem & {
4
- files?: NextcloudDocument[];
5
- };
6
- export default function useNextcloudSearch(rootId: string, rootName: string, userId?: string): {
7
- root: NextcloudFolderNode;
8
- needsAuth: boolean;
9
- isCheckingAuth: boolean;
10
- refetchAuthStatus: () => void;
11
- loadContent: (folderId?: ID) => void;
12
- };
@@ -1,57 +0,0 @@
1
- import { useState, useCallback } from "react";
2
- import { odeServices } from "@edifice.io/client";
3
- import { useQueryClient, useQuery } from "@tanstack/react-query";
4
- import { findNodeById, modifyNode } from "../../components/Tree/utilities/tree.js";
5
- function useNextcloudSearch(rootId, rootName, userId) {
6
- var _a;
7
- const [root, setRoot] = useState({
8
- id: rootId,
9
- name: rootName,
10
- section: !0
11
- }), updateFolder = useCallback((folderId, subfolders, files) => {
12
- setRoot((prev) => {
13
- const node = findNodeById(prev, folderId);
14
- if (!node) return prev;
15
- const children = subfolders.map((f) => {
16
- var _a2;
17
- const existing = (_a2 = node.children) == null ? void 0 : _a2.find((c) => c.id === f.path);
18
- return existing ? {
19
- ...existing,
20
- name: f.name
21
- } : {
22
- id: f.path,
23
- name: f.name
24
- };
25
- });
26
- return modifyNode(prev, (n) => n.id === node.id ? {
27
- ...n,
28
- children,
29
- files
30
- } : n);
31
- });
32
- }, []), queryClient = useQueryClient(), oauth2StatusQuery = useQuery({
33
- queryKey: ["nextcloud", "oauth2-status", userId],
34
- queryFn: () => odeServices.nextcloud().getOauth2Status(userId),
35
- enabled: !!userId
36
- }), needsAuth = !((_a = oauth2StatusQuery.data) != null && _a.connected), loadContent = useCallback(async (folderId) => {
37
- if (!userId) return;
38
- const path = folderId === rootId ? void 0 : folderId, payload = await queryClient.fetchQuery({
39
- queryKey: ["nextcloud", "documents", userId, path ?? "/"],
40
- queryFn: () => odeServices.nextcloud().listDocuments(userId, path),
41
- staleTime: 6e4
42
- }), subfolders = [], files = [], currentPath = path ?? "/";
43
- payload.filter((doc) => doc.path !== currentPath).forEach((doc) => {
44
- doc.isFolder ? subfolders.push(doc) : files.push(doc);
45
- }), updateFolder(folderId, subfolders, files);
46
- }, [rootId, userId, queryClient, updateFolder]);
47
- return {
48
- root,
49
- needsAuth,
50
- isCheckingAuth: oauth2StatusQuery.isLoading,
51
- refetchAuthStatus: oauth2StatusQuery.refetch,
52
- loadContent
53
- };
54
- }
55
- export {
56
- useNextcloudSearch as default
57
- };
@@ -1,25 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { NextcloudDocument } from '@edifice.io/client';
3
- import { CardProps } from '../../../components/Card';
4
- export interface NextcloudFileCardProps extends CardProps {
5
- doc: NextcloudDocument;
6
- /**
7
- * Id of the user who owns the Nextcloud document, used to build the preview URL.
8
- */
9
- userId: string;
10
- /**
11
- * Custom icon to override the default based on file type
12
- * Can be a string or a React node
13
- */
14
- customIcon?: ReactNode;
15
- /**
16
- * Custom color class to override the default based on file type
17
- * Example: "bg-purple-300" or any valid CSS class
18
- */
19
- customColor?: string;
20
- }
21
- declare const NextcloudFileCard: {
22
- ({ doc, userId, isClickable, isSelectable, isSelected, onClick, className, onSelect, isFocused, app, customIcon, customColor, }: NextcloudFileCardProps): import("react/jsx-runtime").JSX.Element;
23
- displayName: string;
24
- };
25
- export default NextcloudFileCard;
@@ -1,102 +0,0 @@
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 roleMappings = {
13
- csv: {
14
- icon: ".CSV",
15
- color: "bg-orange-200"
16
- },
17
- xls: {
18
- icon: ".XLS",
19
- color: "bg-green-200"
20
- },
21
- doc: {
22
- icon: ".DOC",
23
- color: "bg-blue-200"
24
- },
25
- txt: {
26
- icon: ".TXT",
27
- color: "bg-blue-200"
28
- },
29
- pdf: {
30
- icon: ".PDF",
31
- color: "bg-red-200"
32
- },
33
- audio: {
34
- icon: /* @__PURE__ */ jsx(SvgIconMic, { width: 22, height: 22 }),
35
- color: "bg-red-200"
36
- },
37
- ppt: {
38
- icon: ".PPT",
39
- color: "bg-red-200"
40
- },
41
- img: {
42
- icon: /* @__PURE__ */ jsx(SvgIconLandscape, { width: 22, height: 22 }),
43
- color: "bg-green-200"
44
- },
45
- video: {
46
- icon: /* @__PURE__ */ jsx(SvgIconVideo, { width: 22, height: 22 }),
47
- color: "bg-purple-200"
48
- },
49
- zip: {
50
- icon: ".ZIP",
51
- color: "bg-gray-300"
52
- },
53
- md: {
54
- icon: ".MD",
55
- color: "bg-blue-200"
56
- },
57
- unknown: {
58
- icon: /* @__PURE__ */ jsx(SvgIconTextPage, { width: 22, height: 22 }),
59
- color: "bg-gray-300"
60
- }
61
- };
62
- function getRoleMap(type, customIcon, customColor) {
63
- return customIcon !== void 0 || customColor !== void 0 ? {
64
- icon: customIcon || /* @__PURE__ */ jsx(SvgIconTextPage, { width: 22, height: 22 }),
65
- color: customColor || "bg-gray-300",
66
- hasShadow: !1
67
- } : roleMappings[type] ?? roleMappings.unknown;
68
- }
69
- const NextcloudFileCard = ({
70
- doc,
71
- userId,
72
- isClickable = !0,
73
- isSelectable = !1,
74
- isSelected = !1,
75
- onClick,
76
- className,
77
- onSelect,
78
- isFocused,
79
- app,
80
- customIcon,
81
- customColor
82
- }) => {
83
- const ref = useRef(null), type = DocumentHelper.role(doc.contentType, !1), roleMap = getRoleMap(type ?? "unknown", customIcon, customColor), 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, {
84
- ref
85
- }), imageStyles = hasThumbnail && {
86
- backgroundImage: `url(${mediaSrc})`,
87
- backgroundSize: "cover"
88
- };
89
- return /* @__PURE__ */ jsx(Card, { className: clsx("card-file", className), isClickable, isSelectable, isSelected, onClick, app, isFocused, onSelect, children: /* @__PURE__ */ jsxs(Card.Body, { space: "8", children: [
90
- /* @__PURE__ */ jsx("div", { ref, className: file, style: {
91
- aspectRatio: "16/10",
92
- ...imageStyles
93
- }, children: type !== "img" || !hasThumbnail ? /* @__PURE__ */ jsx(FileIcon, { type, roleMap }) : null }),
94
- /* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
95
- /* @__PURE__ */ jsx(Card.Text, { children: doc.name }),
96
- /* @__PURE__ */ jsx(Card.Text, { className: "text-black-50", children: doc == null ? void 0 : doc.ownerDisplayName })
97
- ] })
98
- ] }) });
99
- };
100
- export {
101
- NextcloudFileCard as default
102
- };
@@ -1,8 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { default as LinkerCard } from './LinkerCard';
3
- declare const meta: Meta<typeof LinkerCard>;
4
- export default meta;
5
- type Story = StoryObj<typeof LinkerCard>;
6
- export declare const Base: Story;
7
- export declare const TimelineGenerator: Story;
8
- export declare const Blog: Story;
@@ -1 +0,0 @@
1
- export declare const Nextcloud: () => import("react/jsx-runtime").JSX.Element;
@@ -1,35 +0,0 @@
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
- type,
9
- setResultCounter,
10
- setResult,
11
- setPreSuccess,
12
- multiple
13
- } = useMediaLibraryContext(), {
14
- user
15
- } = useUser();
16
- function getDocumentRoleFilter() {
17
- switch (type) {
18
- case "image":
19
- return "img";
20
- case "audio":
21
- return "audio";
22
- case "video":
23
- return "video";
24
- default:
25
- return null;
26
- }
27
- }
28
- function handleSelect(result) {
29
- 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));
30
- }
31
- return /* @__PURE__ */ jsx(Nextcloud$1, { roles: getDocumentRoleFilter(), onSelect: handleSelect, multiple, className: "border rounded overflow-y-auto" });
32
- };
33
- export {
34
- Nextcloud
35
- };
@@ -1,24 +0,0 @@
1
- import { NextcloudDocument, Role } from '@edifice.io/client';
2
- /**
3
- * Nextcloud component properties
4
- */
5
- export interface NextcloudProps {
6
- /**
7
- * Notify parent when media elements are successfully selected.
8
- */
9
- onSelect: (result: NextcloudDocument[]) => void;
10
- /**
11
- * Boolean to know if we can select 1 or many files.
12
- */
13
- multiple?: boolean | undefined;
14
- /**
15
- * Document roles to filter files by; null (default) shows all roles.
16
- */
17
- roles?: Role | Role[] | null;
18
- /**
19
- * Optional class for styling purpose
20
- */
21
- className?: string;
22
- }
23
- declare const Nextcloud: ({ onSelect, multiple, roles, className, }: NextcloudProps) => import("react/jsx-runtime").JSX.Element;
24
- export default Nextcloud;