@edifice.io/react 2.6.2-develop-b2school.20260807165427 → 2.6.2-develop-enabling.20260807165823
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.
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +0 -5
- package/dist/components/DatePicker/DatePicker.js +0 -2
- package/dist/components/Layout/components/NavLink.d.ts +1 -1
- package/dist/components/Layout/components/NavLink.js +2 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -1
- package/dist/hooks/useClickOutside/useClickOutside.js +1 -1
- package/dist/icons.js +338 -340
- package/dist/modules/editor/test-utils/createTestEditor.d.ts +10 -0
- package/dist/modules/homepage/components/HomeCard/HomeCard.d.ts +1 -5
- package/dist/modules/homepage/components/HomeCard/HomeCard.js +2 -10
- package/dist/modules/homepage/components/LastInfos/LastInfosList.js +2 -2
- package/dist/modules/homepage/components/Notifications/NotificationList.js +1 -1
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpace.js +11 -20
- package/dist/modules/homepage/components/UserSpace/UserSpace.js +2 -5
- package/dist/modules/icons/components/index.d.ts +0 -1
- package/dist/modules/multimedia/testing/mediaHarness.d.ts +154 -0
- package/package.json +6 -6
- package/dist/modules/homepage/components/Communities/Communities.d.ts +0 -10
- package/dist/modules/homepage/components/Communities/CommunitiesContainer.d.ts +0 -9
- package/dist/modules/homepage/components/Communities/CommunitiesSkeleton.d.ts +0 -5
- package/dist/modules/homepage/components/Communities/CommunityItem.d.ts +0 -11
- package/dist/modules/homepage/components/Communities/index.d.ts +0 -8
- package/dist/modules/homepage/components/Communities/useCommunities.d.ts +0 -13
- package/dist/modules/homepage/components/UserSpace/hooks/useChildren.d.ts +0 -14
- package/dist/modules/homepage/components/UserSpace/hooks/useChildren.js +0 -23
- package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.d.ts +0 -8
- package/dist/modules/homepage/components/UserSpace/hooks/useProfileLinks.js +0 -65
- package/dist/modules/icons/components/IconClass.d.ts +0 -7
- package/dist/modules/icons/components/IconClass.js +0 -13
- package/dist/modules/multimedia/LinkerCard/LinkerCard._.d.ts +0 -8
- package/dist/modules/multimedia/UploadCard/UploadCard._.d.ts +0 -9
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Editor, EditorOptions, Extensions } from '@tiptap/core';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a real, headless (uncoupled from React) tiptap `Editor` for
|
|
4
|
+
* component specs that need genuine ProseMirror state - selection, commands,
|
|
5
|
+
* `isActive` - rather than a hand-rolled mock. Callers should call
|
|
6
|
+
* `.destroy()` in `afterEach` to avoid leaking editor instances across tests.
|
|
7
|
+
*/
|
|
8
|
+
export declare const createTestEditor: (overrides?: {
|
|
9
|
+
extensions?: Extensions;
|
|
10
|
+
} & Partial<EditorOptions>) => Editor;
|
|
@@ -20,13 +20,9 @@ export interface HomeCardProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
20
20
|
* `HomeCard.Header` is rendered with these props.
|
|
21
21
|
*/
|
|
22
22
|
headerProps?: HomeCardHeaderProps;
|
|
23
|
-
/**
|
|
24
|
-
* Optional footer
|
|
25
|
-
*/
|
|
26
|
-
footer?: ReactNode;
|
|
27
23
|
}
|
|
28
24
|
declare const HomeCard: {
|
|
29
|
-
({ variant, children, headerProps,
|
|
25
|
+
({ variant, children, headerProps, className, ...rest }: HomeCardProps): import("react/jsx-runtime").JSX.Element;
|
|
30
26
|
displayName: string;
|
|
31
27
|
} & {
|
|
32
28
|
Header: {
|
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
import { jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import HomeCardContent from "./HomeCardContent.js";
|
|
4
4
|
import HomeCardHeader from "./HomeCardHeader.js";
|
|
5
|
-
import Flex from "../../../../components/Flex/Flex.js";
|
|
6
5
|
const Root = ({
|
|
7
6
|
variant = "user",
|
|
8
7
|
children,
|
|
9
8
|
headerProps,
|
|
10
|
-
footer,
|
|
11
9
|
className,
|
|
12
10
|
...rest
|
|
13
|
-
}) => {
|
|
14
|
-
const classNames = clsx("home-card", `home-card--${variant}`, className), content = /* @__PURE__ */ jsx("div", { "data-testid": "home-card", "data-variant": variant, className: classNames, ...rest, children: headerProps && !children ? /* @__PURE__ */ jsx(HomeCardHeader, { ...headerProps }) : children });
|
|
15
|
-
return footer ? /* @__PURE__ */ jsxs("div", { className: "home-card--with-footer", children: [
|
|
16
|
-
content,
|
|
17
|
-
/* @__PURE__ */ jsx(Flex, { direction: "row", gap: "8", className: "px-16 py-4 home-card-footer", children: footer })
|
|
18
|
-
] }) : content;
|
|
19
|
-
}, HomeCard = Object.assign(Root, {
|
|
11
|
+
}) => /* @__PURE__ */ jsx("div", { "data-testid": "home-card", "data-variant": variant, className: clsx("home-card", `home-card--${variant}`, className), ...rest, children: headerProps && !children ? /* @__PURE__ */ jsx(HomeCardHeader, { ...headerProps }) : children }), HomeCard = Object.assign(Root, {
|
|
20
12
|
Header: HomeCardHeader,
|
|
21
13
|
Content: HomeCardContent
|
|
22
14
|
});
|
|
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
3
|
import SvgIconArrowRight from "../../../icons/components/IconArrowRight.js";
|
|
4
4
|
import LastInfos from "./LastInfos.js";
|
|
5
|
-
import illuLastInfosEmptyScreen from "@edifice.io/bootstrap/dist/images/homepage/illu-
|
|
5
|
+
import illuLastInfosEmptyScreen from "@edifice.io/bootstrap/dist/images/homepage/illu-last-infos-beta.svg";
|
|
6
6
|
import Flex from "../../../../components/Flex/Flex.js";
|
|
7
7
|
import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
|
|
8
8
|
import EmptyScreen from "../../../../components/EmptyScreen/EmptyScreen.js";
|
|
@@ -23,7 +23,7 @@ function LastInfosList({
|
|
|
23
23
|
/* @__PURE__ */ jsx("h2", { className: "last-infos-list-title", children: t("homepage.last-infos-list.title") }),
|
|
24
24
|
/* @__PURE__ */ jsx(ButtonBeta, { color: "tertiary", variant: "ghost", className: "last-infos-list-seemore", rightIcon: /* @__PURE__ */ jsx(SvgIconArrowRight, {}), onClick: handleSeeMoreClick, children: t("homepage.last-infos-list.see.more") })
|
|
25
25
|
] }),
|
|
26
|
-
/* @__PURE__ */ jsx("
|
|
26
|
+
/* @__PURE__ */ jsx(Flex, { gap: "16", direction: "column", className: "last-infos-list-body", children: infos.length === 0 ? /* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuLastInfosEmptyScreen, size: 64, text: t("homepage.last-infos-list.empty") }) : infos.map((infosProps) => /* @__PURE__ */ jsx(LastInfos, { onClick: handleInfoClick, ...infosProps }, infosProps.id)) })
|
|
27
27
|
] });
|
|
28
28
|
}
|
|
29
29
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import illuEmptyNotification from "@edifice.io/bootstrap/dist/images/
|
|
2
|
+
import illuEmptyNotification from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-notifications.png";
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import SvgIconClose from "../../../icons/components/IconClose.js";
|
|
5
5
|
import NotificationItem from "./NotificationItem.js";
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
3
|
import SvgIconRafterUp from "../../../icons/components/IconRafterUp.js";
|
|
4
|
-
import SvgIconUserSearch from "../../../icons/components/IconUserSearch.js";
|
|
5
4
|
import useToggle from "../../../../hooks/useToggle/useToggle.js";
|
|
6
5
|
import Flex from "../../../../components/Flex/Flex.js";
|
|
7
6
|
import Dropdown from "../../../../components/Dropdown/Dropdown.js";
|
|
8
7
|
import IconButton from "../../../../components/Button/IconButton.js";
|
|
9
|
-
import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
|
|
10
8
|
import { getRotateTransitionStyle } from "../../../../utilities/rotate-transition-style/get-rotate-transition-style.js";
|
|
11
9
|
const SchoolSpace = ({
|
|
12
10
|
schools,
|
|
@@ -15,23 +13,16 @@ const SchoolSpace = ({
|
|
|
15
13
|
}) => {
|
|
16
14
|
const [isExpanded, toggleExpanded] = useToggle(!1), {
|
|
17
15
|
t
|
|
18
|
-
} = useTranslation();
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
/* @__PURE__ */ jsx("
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
degrees: 180
|
|
29
|
-
}) }) }),
|
|
30
|
-
/* @__PURE__ */ jsx(Dropdown.Menu, { children: schools.map((school) => /* @__PURE__ */ jsx(Dropdown.Item, { onClick: () => onSelectedSchoolChange == null ? void 0 : onSelectedSchoolChange(school), children: /* @__PURE__ */ jsx(Flex, { direction: "column", children: /* @__PURE__ */ jsx("p", { children: school.name }) }) }, school.id)) })
|
|
31
|
-
] }) })
|
|
32
|
-
] }),
|
|
33
|
-
/* @__PURE__ */ jsx(ButtonBeta, { variant: "outline", className: "school-space-directory-button", leftIcon: /* @__PURE__ */ jsx(SvgIconUserSearch, {}), onClick: () => window.location.href = directoryUrl, children: t("homepage.school-space.directory") })
|
|
34
|
-
] });
|
|
16
|
+
} = useTranslation(), hasManySchools = schools && schools.length > 1;
|
|
17
|
+
return selectedSchool ? /* @__PURE__ */ jsx("div", { className: "school-space", children: /* @__PURE__ */ jsxs(Flex, { className: "school-space-container", justify: "center", gap: "4", align: "center", children: [
|
|
18
|
+
/* @__PURE__ */ jsx("b", { children: selectedSchool.name }),
|
|
19
|
+
hasManySchools && /* @__PURE__ */ jsx(Dropdown, { placement: "bottom-end", onToggle: toggleExpanded, children: (triggerProps) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
|
+
/* @__PURE__ */ jsx(IconButton, { ...triggerProps, "aria-label": t("show"), color: "tertiary", variant: "ghost", icon: /* @__PURE__ */ jsx(SvgIconRafterUp, { className: "w-16 min-w-0", style: getRotateTransitionStyle(isExpanded, {
|
|
21
|
+
degrees: 180
|
|
22
|
+
}) }) }),
|
|
23
|
+
/* @__PURE__ */ jsx(Dropdown.Menu, { children: schools.map((school) => /* @__PURE__ */ jsx(Dropdown.Item, { onClick: () => onSelectedSchoolChange == null ? void 0 : onSelectedSchoolChange(school), children: /* @__PURE__ */ jsx(Flex, { direction: "column", children: /* @__PURE__ */ jsx("p", { children: school.name }) }) }, school.id)) })
|
|
24
|
+
] }) })
|
|
25
|
+
] }) }) : null;
|
|
35
26
|
};
|
|
36
27
|
export {
|
|
37
28
|
SchoolSpace as default
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
-
import SvgIconClass from "../../../icons/components/IconClass.js";
|
|
4
|
-
import { useProfileLinks } from "./hooks/useProfileLinks.js";
|
|
5
3
|
import HomeCard from "../HomeCard/HomeCard.js";
|
|
6
4
|
import Flex from "../../../../components/Flex/Flex.js";
|
|
7
5
|
import Avatar from "../../../../components/Avatar/Avatar.js";
|
|
8
|
-
import ButtonBeta from "../../../../components/ButtonBeta/ButtonBeta.js";
|
|
9
6
|
function UserSpace({
|
|
10
7
|
name,
|
|
11
8
|
avatar,
|
|
@@ -14,8 +11,8 @@ function UserSpace({
|
|
|
14
11
|
}) {
|
|
15
12
|
const {
|
|
16
13
|
t
|
|
17
|
-
} = useTranslation()
|
|
18
|
-
return /* @__PURE__ */ jsxs(HomeCard, { variant: "user",
|
|
14
|
+
} = useTranslation();
|
|
15
|
+
return /* @__PURE__ */ jsxs(HomeCard, { variant: "user", children: [
|
|
19
16
|
/* @__PURE__ */ jsxs(Flex, { className: "user-space", direction: "row", gap: "8", children: [
|
|
20
17
|
/* @__PURE__ */ jsx(Avatar, { className: "user-space--avatar", size: "auto", alt: name, src: avatar, variant: "circle" }),
|
|
21
18
|
/* @__PURE__ */ jsxs(Flex, { direction: "column", children: [
|
|
@@ -30,7 +30,6 @@ export { default as IconCantoo } from './IconCantoo';
|
|
|
30
30
|
export { default as IconCenter } from './IconCenter';
|
|
31
31
|
export { default as IconCheck } from './IconCheck';
|
|
32
32
|
export { default as IconChecklist } from './IconChecklist';
|
|
33
|
-
export { default as IconClass } from './IconClass';
|
|
34
33
|
export { default as IconClockAlert } from './IconClockAlert';
|
|
35
34
|
export { default as IconClock } from './IconClock';
|
|
36
35
|
export { default as IconCloseFullScreen } from './IconCloseFullScreen';
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.6.2-develop-
|
|
3
|
+
"version": "2.6.2-develop-enabling.20260807165823",
|
|
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/bootstrap": "2.6.2-develop-
|
|
144
|
-
"@edifice.io/tiptap-extensions": "2.6.2-develop-
|
|
145
|
-
"@edifice.io/utilities": "2.6.2-develop-
|
|
143
|
+
"@edifice.io/bootstrap": "2.6.2-develop-enabling.20260807165823",
|
|
144
|
+
"@edifice.io/tiptap-extensions": "2.6.2-develop-enabling.20260807165823",
|
|
145
|
+
"@edifice.io/utilities": "2.6.2-develop-enabling.20260807165823"
|
|
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-develop-
|
|
177
|
-
"@edifice.io/config": "2.6.2-develop-
|
|
176
|
+
"@edifice.io/client": "2.6.2-develop-enabling.20260807165823",
|
|
177
|
+
"@edifice.io/config": "2.6.2-develop-enabling.20260807165823"
|
|
178
178
|
},
|
|
179
179
|
"peerDependencies": {
|
|
180
180
|
"@react-spring/web": "9.7.5",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CommunityItemProps } from './CommunityItem';
|
|
2
|
-
export interface CommunitiesProps {
|
|
3
|
-
communitiesList?: CommunityItemProps[];
|
|
4
|
-
handleActionClick: () => void;
|
|
5
|
-
}
|
|
6
|
-
declare const Communities: {
|
|
7
|
-
({ communitiesList, handleActionClick, }: CommunitiesProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
displayName: string;
|
|
9
|
-
};
|
|
10
|
-
export default Communities;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CommunitiesModel } from './useCommunities';
|
|
2
|
-
export type CommunitiesContainerProps = {
|
|
3
|
-
onCommunityClick?: (community: CommunitiesModel) => void;
|
|
4
|
-
onHeaderActionClick: () => void;
|
|
5
|
-
};
|
|
6
|
-
export declare function CommunitiesContainer({ onCommunityClick, onHeaderActionClick, }: CommunitiesContainerProps): import("react/jsx-runtime").JSX.Element | "An error occurred while loading communities.";
|
|
7
|
-
export declare namespace CommunitiesContainer {
|
|
8
|
-
var displayName: string;
|
|
9
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface CommunityItemProps {
|
|
2
|
-
title: string;
|
|
3
|
-
communityImage: string;
|
|
4
|
-
onActionClick: () => void;
|
|
5
|
-
nbNotifications?: number;
|
|
6
|
-
}
|
|
7
|
-
declare const CommunityItem: {
|
|
8
|
-
({ title, communityImage, nbNotifications, onActionClick, }: CommunityItemProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
displayName: string;
|
|
10
|
-
};
|
|
11
|
-
export default CommunityItem;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './Communities';
|
|
2
|
-
export { default as Communities } from './Communities';
|
|
3
|
-
export * from './CommunitiesContainer';
|
|
4
|
-
export * from './CommunitiesSkeleton';
|
|
5
|
-
export { default as CommunitiesSkeleton } from './CommunitiesSkeleton';
|
|
6
|
-
export * from './CommunityItem';
|
|
7
|
-
export { default as CommunitiesItem } from './CommunityItem';
|
|
8
|
-
export * from './useCommunities';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface CommunitiesModel {
|
|
2
|
-
id: number | string;
|
|
3
|
-
title: string;
|
|
4
|
-
communityImage?: string;
|
|
5
|
-
icon?: string;
|
|
6
|
-
nbNotifications?: number;
|
|
7
|
-
notifications?: number;
|
|
8
|
-
}
|
|
9
|
-
export declare function useCommunities(): {
|
|
10
|
-
communities: CommunitiesModel[];
|
|
11
|
-
isLoading: boolean;
|
|
12
|
-
error: Error | null;
|
|
13
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Child, StructureChildren } from '@edifice.io/client';
|
|
2
|
-
export declare const childrenQueryKeys: {
|
|
3
|
-
all: (userId: string) => readonly ["children", string];
|
|
4
|
-
};
|
|
5
|
-
export declare const childrenQueryOptions: (userId: string | undefined, enabled: boolean) => import('@tanstack/react-query').OmitKeyof<import('@tanstack/react-query').UseQueryOptions<StructureChildren[], Error, Child[], import('@tanstack/react-query').QueryKey>, "queryFn"> & {
|
|
6
|
-
queryFn?: import('@tanstack/react-query').QueryFunction<StructureChildren[], import('@tanstack/react-query').QueryKey, never> | undefined;
|
|
7
|
-
} & {
|
|
8
|
-
queryKey: import('@tanstack/react-query').DataTag<import('@tanstack/react-query').QueryKey, StructureChildren[]>;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Fetches the children of a "Relative" user across all their structures,
|
|
12
|
-
* merged into a single list.
|
|
13
|
-
*/
|
|
14
|
-
export declare function useChildren(userId: string | undefined, enabled: boolean): import('@tanstack/react-query').UseQueryResult<Child[], Error>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { odeServices } from "@edifice.io/client";
|
|
2
|
-
import { useQuery, queryOptions } from "@tanstack/react-query";
|
|
3
|
-
const childrenQueryKeys = {
|
|
4
|
-
all: (userId) => ["children", userId]
|
|
5
|
-
};
|
|
6
|
-
function flattenChildrenByStructure(structures) {
|
|
7
|
-
const seenIds = /* @__PURE__ */ new Set();
|
|
8
|
-
return structures.flatMap((structure) => structure.children).filter((child) => seenIds.has(child.id) ? !1 : (seenIds.add(child.id), !0));
|
|
9
|
-
}
|
|
10
|
-
const childrenQueryOptions = (userId, enabled) => queryOptions({
|
|
11
|
-
queryKey: childrenQueryKeys.all(userId ?? ""),
|
|
12
|
-
queryFn: () => odeServices.directory().getChildren(userId),
|
|
13
|
-
enabled: enabled && !!userId,
|
|
14
|
-
select: flattenChildrenByStructure
|
|
15
|
-
});
|
|
16
|
-
function useChildren(userId, enabled) {
|
|
17
|
-
return useQuery(childrenQueryOptions(userId, enabled));
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
childrenQueryKeys,
|
|
21
|
-
childrenQueryOptions,
|
|
22
|
-
useChildren
|
|
23
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { UserProfile } from '@edifice.io/client';
|
|
2
|
-
type ProfileLink = {
|
|
3
|
-
url: string;
|
|
4
|
-
text: string;
|
|
5
|
-
};
|
|
6
|
-
/** Generates user's links to show in the UserSpace home component. */
|
|
7
|
-
export declare function useProfileLinks(profile: UserProfile[number]): Array<ProfileLink> | undefined;
|
|
8
|
-
export {};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { useTranslation } from "react-i18next";
|
|
2
|
-
import { useEdificeClient } from "../../../../../providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
3
|
-
import { useChildren } from "./useChildren.js";
|
|
4
|
-
function useProfileLinks(profile) {
|
|
5
|
-
var _a;
|
|
6
|
-
const {
|
|
7
|
-
user
|
|
8
|
-
} = useEdificeClient(), {
|
|
9
|
-
t
|
|
10
|
-
} = useTranslation(), isRelative = profile === "Relative", {
|
|
11
|
-
data: children
|
|
12
|
-
} = useChildren(user == null ? void 0 : user.userId, isRelative), structureId = (_a = user == null ? void 0 : user.structures) == null ? void 0 : _a[0];
|
|
13
|
-
if (structureId && profile) {
|
|
14
|
-
const baseUrl = "/userbook/annuaire#/search", buildStructureGroupsUrl = () => {
|
|
15
|
-
const params = new URLSearchParams({
|
|
16
|
-
filters: "groups",
|
|
17
|
-
structure: structureId
|
|
18
|
-
});
|
|
19
|
-
return `${baseUrl}?${params.toString()}`;
|
|
20
|
-
}, buildClassesUrl = (classIds = []) => {
|
|
21
|
-
const params = new URLSearchParams({
|
|
22
|
-
filters: "groups",
|
|
23
|
-
structure: structureId
|
|
24
|
-
});
|
|
25
|
-
return classIds.forEach((c) => params.append("class", String(c))), `${baseUrl}?${params.toString()}`;
|
|
26
|
-
};
|
|
27
|
-
switch (profile) {
|
|
28
|
-
case "Teacher":
|
|
29
|
-
return [{
|
|
30
|
-
text: t("homepage.userspace.teacher.link.classes"),
|
|
31
|
-
url: buildClassesUrl(user.classes)
|
|
32
|
-
}];
|
|
33
|
-
case "Student":
|
|
34
|
-
return [{
|
|
35
|
-
text: t("homepage.userspace.student.link.teachers"),
|
|
36
|
-
url: "/userbook/annuaire#/search?filters=groups&profile=Teacher"
|
|
37
|
-
}, {
|
|
38
|
-
text: t("homepage.userspace.student.link.classes"),
|
|
39
|
-
url: buildClassesUrl(user.classes)
|
|
40
|
-
}];
|
|
41
|
-
case "Relative":
|
|
42
|
-
return children != null && children.length ? children.map((child) => {
|
|
43
|
-
var _a2;
|
|
44
|
-
return {
|
|
45
|
-
text: t("homepage.userspace.relative.link.classes", {
|
|
46
|
-
childName: child.firstName
|
|
47
|
-
}),
|
|
48
|
-
url: buildClassesUrl((_a2 = child.classes) == null ? void 0 : _a2.map(({
|
|
49
|
-
id
|
|
50
|
-
}) => id))
|
|
51
|
-
};
|
|
52
|
-
}) : void 0;
|
|
53
|
-
case "Personnel":
|
|
54
|
-
return [{
|
|
55
|
-
text: t("homepage.userspace.personnel.link.classesAndGroups"),
|
|
56
|
-
url: buildStructureGroupsUrl()
|
|
57
|
-
}];
|
|
58
|
-
case "Guest":
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
export {
|
|
64
|
-
useProfileLinks
|
|
65
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SVGProps } from 'react';
|
|
2
|
-
interface SVGRProps {
|
|
3
|
-
title?: string;
|
|
4
|
-
titleId?: string;
|
|
5
|
-
}
|
|
6
|
-
declare const SvgIconClass: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default SvgIconClass;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
const SvgIconClass = ({
|
|
3
|
-
title,
|
|
4
|
-
titleId,
|
|
5
|
-
...props
|
|
6
|
-
}) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
|
|
7
|
-
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
8
|
-
/* @__PURE__ */ jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M2.074 17.258c.707-.837 1.705-1.349 2.79-1.349h5.727c1.085 0 2.083.512 2.79 1.35.701.831 1.073 1.928 1.073 3.044V22a1 1 0 1 1-2 0v-1.697c0-.684-.23-1.314-.603-1.755-.367-.436-.826-.639-1.26-.639H4.864c-.434 0-.893.203-1.261.64-.372.44-.603 1.07-.603 1.754V22a1 1 0 1 1-2 0v-1.697c0-1.116.372-2.213 1.074-3.045M7.728 8.5a2.182 2.182 0 1 0 0 4.364 2.182 2.182 0 0 0 0-4.364m-4.182 2.182a4.182 4.182 0 1 1 8.364 0 4.182 4.182 0 0 1-8.364 0", clipRule: "evenodd" }),
|
|
9
|
-
/* @__PURE__ */ jsx("path", { fill: "currentColor", fillRule: "evenodd", d: "M0 5a3 3 0 0 1 3-3h18a3 3 0 0 1 3 3v11a3 3 0 0 1-3 3h-5a1 1 0 1 1 0-2h5a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v10a1 1 0 1 1-2 0z", clipRule: "evenodd" })
|
|
10
|
-
] });
|
|
11
|
-
export {
|
|
12
|
-
SvgIconClass as default
|
|
13
|
-
};
|
|
@@ -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,9 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { default as UploadCard } from './UploadCard';
|
|
3
|
-
declare const meta: Meta<typeof UploadCard>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof UploadCard>;
|
|
6
|
-
export declare const Base: Story;
|
|
7
|
-
export declare const IsLoading: Story;
|
|
8
|
-
export declare const IsSuccess: Story;
|
|
9
|
-
export declare const IsError: Story;
|