@q9labsai/chalk-react-native 4.1.12 → 4.1.13
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/android.js +2 -2
- package/dist/{chunk-FVHH65FR.js → chunk-4NLA35HE.js} +1 -1
- package/dist/{chunk-LZ67SXGB.js → chunk-MK6OO4V7.js} +6 -0
- package/dist/client.js +1 -1
- package/dist/index.js +2 -2
- package/dist/ios-pad.js +2 -2
- package/dist/ios-phone.js +2 -2
- package/dist/ios.js +2 -2
- package/dist/macos.js +2 -2
- package/package.json +4 -4
- package/src/callkit/callkit.test.ts +12 -10
- package/src/space-client/create-native-space-client.ts +8 -0
- package/dist/test-support/test-renderer.d.ts +0 -20
- package/dist/test-support/test-renderer.d.ts.map +0 -1
- package/src/android/connection-service.test.ts +0 -114
- package/src/callkit/resolve-space-callkit-options.test.ts +0 -68
- package/src/client.test.ts +0 -12
- package/src/clipboard.test.ts +0 -79
- package/src/components/Chalk.test.tsx +0 -223
- package/src/components/EmbeddedWhiteboard.test.tsx +0 -92
- package/src/components/Entrance.test.tsx +0 -26
- package/src/components/EntranceView.android.test.tsx +0 -100
- package/src/components/EntranceView.ios-pad.test.tsx +0 -160
- package/src/components/EntranceView.ios-phone.test.tsx +0 -137
- package/src/components/EntranceView.test.tsx +0 -15
- package/src/components/ReactionPicker.test.tsx +0 -19
- package/src/components/RtcVideoView.test.tsx +0 -12
- package/src/components/SpaceView.android.test.tsx +0 -11
- package/src/components/SpaceView.ios-pad.test.tsx +0 -11
- package/src/components/SpaceView.ios-phone.test.tsx +0 -11
- package/src/components/SpaceView.macos.test.tsx +0 -11
- package/src/components/SpaceView.shared.test.tsx +0 -116
- package/src/components/SpaceView.test.tsx +0 -15
- package/src/components/android-connection-service-controller.test.ts +0 -80
- package/src/components/episode-diagnostic-render-observer.test.ts +0 -24
- package/src/components/logo/Logo.test.tsx +0 -144
- package/src/components/native-animation-controller.test.ts +0 -47
- package/src/components/native-chat.test.ts +0 -22
- package/src/components/native-entrance/entrance-controller-store.test.ts +0 -75
- package/src/components/native-media-visibility.test.ts +0 -77
- package/src/components/native-space-callkit-controller.test.ts +0 -62
- package/src/components/native-space-view/AppearanceSettings.test.tsx +0 -56
- package/src/components/native-space-view/ParticipantActionSheet.test.tsx +0 -18
- package/src/components/native-space-view/SettingsSheet.test.tsx +0 -17
- package/src/components/native-space-view/SpaceActionMenu.test.tsx +0 -126
- package/src/components/native-space-view/SpaceBottomDock.android.test.tsx +0 -61
- package/src/components/native-space-view/SpaceChatSheet.test.tsx +0 -18
- package/src/components/native-space-view/SpaceMoreSheet.test.tsx +0 -15
- package/src/components/native-space-view/SpacePanelSheet.test.tsx +0 -15
- package/src/components/native-space-view/SpacePeopleSheet.test.tsx +0 -13
- package/src/components/native-space-view/SpaceSurfacePrimitives.test.tsx +0 -12
- package/src/components/native-space-view/SpaceTopBar.android.test.tsx +0 -50
- package/src/components/native-space-view/SpaceWhiteboardSurface.test.tsx +0 -85
- package/src/components/native-space-view/diagnostics.test.ts +0 -31
- package/src/components/native-space-view/format-space-duration.test.ts +0 -13
- package/src/components/native-space-view/native-space-grid-keys.test.ts +0 -11
- package/src/components/native-space-view/native-space-page-store.test.ts +0 -23
- package/src/components/native-space-view/space-chat-attachments.test.ts +0 -33
- package/src/components/native-space-view/space-progressive-surface-helpers.test.ts +0 -24
- package/src/components/native-space-view/useSpaceViewController.contract.test.ts +0 -10
- package/src/components/native-space-view/useSpaceViewController.test.ts +0 -106
- package/src/components/native-space-view/useSpaceViewDerived.test.ts +0 -58
- package/src/components/native-space-view/useSpaceViewPanels.controlled.test.ts +0 -40
- package/src/components/native-space-view/useSpaceViewPanels.test.ts +0 -73
- package/src/components/space-lifecycle.test.ts +0 -19
- package/src/context/space-client-context.test.tsx +0 -10
- package/src/diagnostics.test.ts +0 -29
- package/src/hooks/entrance-preview-store.test.ts +0 -79
- package/src/hooks/space-hooks.test.ts +0 -76
- package/src/hooks/useLayout.test.ts +0 -16
- package/src/invites.test.ts +0 -51
- package/src/public-surface.test.ts +0 -26
- package/src/runtime.test.ts +0 -83
- package/src/space-client/cloudflare-rtk-native.test.ts +0 -118
- package/src/space-client/create-native-space-client.test.ts +0 -300
- package/src/telemetry.test.ts +0 -143
- package/src/test-support/test-renderer.test.ts +0 -9
- package/src/test-support/test-renderer.ts +0 -28
- package/src/ui/appearance.test.ts +0 -61
- package/src/ui/native-appearance-context.controlled.test.tsx +0 -41
- package/src/ui/native-appearance-context.test.tsx +0 -14
- package/src/ui/native-theme.test.ts +0 -34
- package/src/ui/native-theme.test.tsx +0 -14
- package/src/ui/participant-avatar.test.ts +0 -29
- package/src/ui/theme-tokens.test.ts +0 -14
- package/src/ui/theme.test.ts +0 -36
- package/src/utils/build-chalk-invite-link.test.ts +0 -12
- package/src/utils/ios-simulator.test.ts +0 -96
- package/src/utils/native-space-layout.test.ts +0 -170
- package/src/whiteboard/embedded-whiteboard-assets.test.ts +0 -31
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import type { NativeParticipantState } from "../ui/native-types";
|
|
3
|
-
import { buildCompactParticipantPages, normalizeStageParticipants, resolveNativeSpaceLayout } from "./native-space-layout";
|
|
4
|
-
|
|
5
|
-
type SpaceParticipant = NativeParticipantState["participants"][number];
|
|
6
|
-
|
|
7
|
-
function track(readyState: "live" | "ended" = "live"): MediaStreamTrack {
|
|
8
|
-
return { readyState } as MediaStreamTrack;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function participant(overrides: Partial<SpaceParticipant> = {}): SpaceParticipant {
|
|
12
|
-
return {
|
|
13
|
-
id: overrides.id ?? "participant-1",
|
|
14
|
-
displayName: overrides.displayName ?? "Participant",
|
|
15
|
-
role: overrides.role ?? "participant",
|
|
16
|
-
isLocal: overrides.isLocal ?? false,
|
|
17
|
-
videoEnabled: overrides.videoEnabled ?? false,
|
|
18
|
-
audioEnabled: overrides.audioEnabled ?? true,
|
|
19
|
-
isScreenSharing: overrides.isScreenSharing ?? false,
|
|
20
|
-
isSpeaking: overrides.isSpeaking ?? false,
|
|
21
|
-
handRaised: overrides.handRaised ?? false,
|
|
22
|
-
connectionQuality: overrides.connectionQuality ?? 100,
|
|
23
|
-
videoTrack: overrides.videoTrack ?? undefined,
|
|
24
|
-
audioTrack: overrides.audioTrack ?? undefined,
|
|
25
|
-
screenShareTrack: overrides.screenShareTrack ?? undefined,
|
|
26
|
-
screenShareAudioTrack: overrides.screenShareAudioTrack ?? undefined,
|
|
27
|
-
joinedAt: overrides.joinedAt ?? new Date(),
|
|
28
|
-
metadata: overrides.metadata ?? {},
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
describe("native-space-layout", () => {
|
|
33
|
-
it("normalizes participants to local-first without duplication", () => {
|
|
34
|
-
const local = participant({ id: "local", isLocal: true });
|
|
35
|
-
const remote = participant({ id: "remote" });
|
|
36
|
-
|
|
37
|
-
expect(normalizeStageParticipants([remote, local], local).map((item) => item.id)).toEqual(["local", "remote"]);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it("builds compact grid pages for higher participant counts", () => {
|
|
41
|
-
const participants = Array.from({ length: 9 }, (_, index) => participant({ id: `p-${index + 1}` }));
|
|
42
|
-
|
|
43
|
-
expect(buildCompactParticipantPages(participants).map((page) => page.length)).toEqual([4, 4, 1]);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it("stays in grid mode without whiteboard or a live screen share track", () => {
|
|
47
|
-
const local = participant({ id: "local", isLocal: true });
|
|
48
|
-
|
|
49
|
-
const result = resolveNativeSpaceLayout({
|
|
50
|
-
participants: [local],
|
|
51
|
-
localParticipant: local,
|
|
52
|
-
screenShare: {
|
|
53
|
-
isActive: false,
|
|
54
|
-
isLocalSharing: false,
|
|
55
|
-
sharerParticipantId: null,
|
|
56
|
-
videoTrack: null,
|
|
57
|
-
},
|
|
58
|
-
isWhiteboardOpen: false,
|
|
59
|
-
isCompactViewport: true,
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
expect(result.primaryContent).toBe("grid");
|
|
63
|
-
expect(result.isStageMode).toBe(false);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it("uses remote screen share as stage content when a live track exists", () => {
|
|
67
|
-
const local = participant({ id: "local", isLocal: true });
|
|
68
|
-
const remote = participant({ id: "remote", isScreenSharing: true, screenShareTrack: track() });
|
|
69
|
-
|
|
70
|
-
const result = resolveNativeSpaceLayout({
|
|
71
|
-
participants: [local, remote],
|
|
72
|
-
localParticipant: local,
|
|
73
|
-
screenShare: {
|
|
74
|
-
isActive: true,
|
|
75
|
-
isLocalSharing: false,
|
|
76
|
-
sharerParticipantId: "remote",
|
|
77
|
-
videoTrack: track(),
|
|
78
|
-
},
|
|
79
|
-
isWhiteboardOpen: false,
|
|
80
|
-
isCompactViewport: true,
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
expect(result.primaryContent).toBe("screen-share");
|
|
84
|
-
expect(result.screenSharer?.id).toBe("remote");
|
|
85
|
-
expect(result.isStageMode).toBe(true);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it("suppresses local screen share into a placeholder stage mode", () => {
|
|
89
|
-
const local = participant({ id: "local", isLocal: true, isScreenSharing: true, screenShareTrack: track() });
|
|
90
|
-
|
|
91
|
-
const result = resolveNativeSpaceLayout({
|
|
92
|
-
participants: [local],
|
|
93
|
-
localParticipant: local,
|
|
94
|
-
screenShare: {
|
|
95
|
-
isActive: true,
|
|
96
|
-
isLocalSharing: true,
|
|
97
|
-
sharerParticipantId: "local",
|
|
98
|
-
videoTrack: track(),
|
|
99
|
-
},
|
|
100
|
-
isWhiteboardOpen: false,
|
|
101
|
-
isCompactViewport: true,
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
expect(result.primaryContent).toBe("screen-share-placeholder");
|
|
105
|
-
expect(result.isLocalScreenShare).toBe(true);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it("prefers whiteboard over screen share on compact view", () => {
|
|
109
|
-
const local = participant({ id: "local", isLocal: true });
|
|
110
|
-
const remote = participant({ id: "remote", isScreenSharing: true, screenShareTrack: track() });
|
|
111
|
-
|
|
112
|
-
const result = resolveNativeSpaceLayout({
|
|
113
|
-
participants: [local, remote],
|
|
114
|
-
localParticipant: local,
|
|
115
|
-
screenShare: {
|
|
116
|
-
isActive: true,
|
|
117
|
-
isLocalSharing: false,
|
|
118
|
-
sharerParticipantId: "remote",
|
|
119
|
-
videoTrack: track(),
|
|
120
|
-
},
|
|
121
|
-
isWhiteboardOpen: true,
|
|
122
|
-
isCompactViewport: true,
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
expect(result.primaryContent).toBe("whiteboard");
|
|
126
|
-
expect(result.isSplit).toBe(false);
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it("uses split stage for whiteboard plus screen share on wide view", () => {
|
|
130
|
-
const local = participant({ id: "local", isLocal: true });
|
|
131
|
-
const remote = participant({ id: "remote", isScreenSharing: true, screenShareTrack: track() });
|
|
132
|
-
|
|
133
|
-
const result = resolveNativeSpaceLayout({
|
|
134
|
-
participants: [local, remote],
|
|
135
|
-
localParticipant: local,
|
|
136
|
-
screenShare: {
|
|
137
|
-
isActive: true,
|
|
138
|
-
isLocalSharing: false,
|
|
139
|
-
sharerParticipantId: "remote",
|
|
140
|
-
videoTrack: track(),
|
|
141
|
-
},
|
|
142
|
-
isWhiteboardOpen: true,
|
|
143
|
-
isCompactViewport: false,
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
expect(result.primaryContent).toBe("split");
|
|
147
|
-
expect(result.isSplit).toBe(true);
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
it("ignores stale screen share state when no live track exists", () => {
|
|
151
|
-
const local = participant({ id: "local", isLocal: true });
|
|
152
|
-
const remote = participant({ id: "remote", isScreenSharing: true, screenShareTrack: track("ended") });
|
|
153
|
-
|
|
154
|
-
const result = resolveNativeSpaceLayout({
|
|
155
|
-
participants: [local, remote],
|
|
156
|
-
localParticipant: local,
|
|
157
|
-
screenShare: {
|
|
158
|
-
isActive: true,
|
|
159
|
-
isLocalSharing: false,
|
|
160
|
-
sharerParticipantId: "remote",
|
|
161
|
-
videoTrack: null,
|
|
162
|
-
},
|
|
163
|
-
isWhiteboardOpen: false,
|
|
164
|
-
isCompactViewport: true,
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
expect(result.primaryContent).toBe("grid");
|
|
168
|
-
expect(result.showScreenShare).toBe(false);
|
|
169
|
-
});
|
|
170
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
vi.mock("react-native", () => ({
|
|
4
|
-
NativeModules: {},
|
|
5
|
-
Platform: { OS: "android" },
|
|
6
|
-
}));
|
|
7
|
-
|
|
8
|
-
import { isEmbeddedWhiteboardNavigationAllowed, rendererURLWithContext } from "./embedded-whiteboard-assets";
|
|
9
|
-
|
|
10
|
-
describe("embedded whiteboard asset policy", () => {
|
|
11
|
-
it("adds only non-credential bridge context to the local renderer URL", () => {
|
|
12
|
-
const url = rendererURLWithContext("file:///android_asset/chalk-whiteboard/index.html", {
|
|
13
|
-
journeyId: "journey-1",
|
|
14
|
-
rendererGeneration: "generation-1",
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
expect(url).toBe("file:///android_asset/chalk-whiteboard/index.html?journeyId=journey-1&rendererGeneration=generation-1");
|
|
18
|
-
expect(url).not.toMatch(/token|credential|signature/iu);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it("allows renderer-local assets and rejects every remote navigation", () => {
|
|
22
|
-
const renderer = "file:///android_asset/chalk-whiteboard/index.html";
|
|
23
|
-
|
|
24
|
-
expect(isEmbeddedWhiteboardNavigationAllowed(renderer, renderer)).toBe(true);
|
|
25
|
-
expect(isEmbeddedWhiteboardNavigationAllowed("file:///android_asset/chalk-whiteboard/fonts/Assistant/Assistant-Regular.woff2", renderer)).toBe(true);
|
|
26
|
-
expect(isEmbeddedWhiteboardNavigationAllowed("file:///android_asset/chalk-whiteboard/../../data/user/0/secret", renderer)).toBe(false);
|
|
27
|
-
expect(isEmbeddedWhiteboardNavigationAllowed("file:///android_asset/chalk-whiteboard/%2e%2e/%2e%2e/data/user/0/secret", renderer)).toBe(false);
|
|
28
|
-
expect(isEmbeddedWhiteboardNavigationAllowed("https://cdn.jsdelivr.net/npm/@excalidraw/excalidraw/index.css", renderer)).toBe(false);
|
|
29
|
-
expect(isEmbeddedWhiteboardNavigationAllowed("javascript:alert(1)", renderer)).toBe(false);
|
|
30
|
-
});
|
|
31
|
-
});
|