@q9labsai/chalk-react-native 4.1.11 → 4.1.12
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 +3 -1
- package/dist/{chunk-MMBE2BVK.js → chunk-FVHH65FR.js} +648 -406
- package/dist/components/Entrance.d.ts.map +1 -1
- package/dist/components/logo/Logo.d.ts +11 -0
- package/dist/components/logo/Logo.d.ts.map +1 -0
- package/dist/components/native-space-view/SpaceTopBar.android.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/ios-pad.js +3 -1
- package/dist/ios-phone.js +3 -1
- package/dist/ios.js +3 -1
- package/dist/macos.js +3 -1
- package/package.json +4 -4
- package/src/components/Entrance.test.tsx +7 -0
- package/src/components/Entrance.tsx +2 -1
- package/src/components/logo/Logo.test.tsx +144 -0
- package/src/components/logo/Logo.tsx +309 -0
- package/src/components/native-space-view/SpaceTopBar.android.test.tsx +7 -0
- package/src/components/native-space-view/SpaceTopBar.android.tsx +2 -1
- package/src/index.ts +2 -0
- package/dist/components/LogoElements.d.ts +0 -6
- package/dist/components/LogoElements.d.ts.map +0 -1
- package/src/components/LogoElements.test.tsx +0 -60
- package/src/components/LogoElements.tsx +0 -119
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
} from "./chunk-LZ67SXGB.js";
|
|
16
16
|
|
|
17
17
|
// src/components/Chalk.tsx
|
|
18
|
-
import { useCallback as useCallback9, useEffect as
|
|
19
|
-
import { Pressable as
|
|
18
|
+
import { useCallback as useCallback9, useEffect as useEffect9, useMemo as useMemo15, useRef as useRef6, useState as useState10 } from "react";
|
|
19
|
+
import { Pressable as Pressable17, StyleSheet as StyleSheet25, Text as Text19, View as View24 } from "react-native";
|
|
20
20
|
|
|
21
21
|
// src/context/space-client-context.tsx
|
|
22
22
|
import { createContext, useContext, useMemo } from "react";
|
|
@@ -1277,19 +1277,260 @@ var styles8 = StyleSheet9.create({
|
|
|
1277
1277
|
import UserGroupIcon from "@hugeicons/core-free-icons/dist/esm/UserGroupIcon";
|
|
1278
1278
|
import { HugeiconsIcon as HugeiconsIcon4 } from "@hugeicons/react-native";
|
|
1279
1279
|
import { Image as Image2, Platform as Platform4, StyleSheet as StyleSheet10, Text as Text6, View as View10 } from "react-native";
|
|
1280
|
+
|
|
1281
|
+
// src/components/logo/Logo.tsx
|
|
1282
|
+
import { useEffect as useEffect3, useId, useRef as useRef2, useState as useState3 } from "react";
|
|
1283
|
+
import { AccessibilityInfo, Animated, Pressable as Pressable4 } from "react-native";
|
|
1284
|
+
import Svg, { Defs, Ellipse, G, LinearGradient, Path, Stop, Text as SvgText } from "react-native-svg";
|
|
1280
1285
|
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1286
|
+
var AnimatedG = Animated.createAnimatedComponent(G);
|
|
1287
|
+
var STICK_MOTIONS = [
|
|
1288
|
+
{
|
|
1289
|
+
transform: "rotate(-15 20 60)",
|
|
1290
|
+
originX: 15,
|
|
1291
|
+
originY: 42,
|
|
1292
|
+
orbitRotation: [0, -5, 0, 0],
|
|
1293
|
+
orbitX: [0, -4, 0, 0],
|
|
1294
|
+
orbitY: [0, 3, 0, 0],
|
|
1295
|
+
burstRotation: -8,
|
|
1296
|
+
burstScale: 1.14,
|
|
1297
|
+
burstSettleRotation: 2,
|
|
1298
|
+
burstSettleScale: 0.98,
|
|
1299
|
+
burstSettleX: -2,
|
|
1300
|
+
burstSettleY: 2,
|
|
1301
|
+
burstX: -14,
|
|
1302
|
+
burstY: -9
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
transform: "rotate(-8 32 55)",
|
|
1306
|
+
originX: 29,
|
|
1307
|
+
originY: 38,
|
|
1308
|
+
orbitRotation: [0, 4, 0, 0],
|
|
1309
|
+
orbitX: [0, 3, 0, 0],
|
|
1310
|
+
orbitY: [0, -4, 0, 0],
|
|
1311
|
+
burstRotation: -4,
|
|
1312
|
+
burstScale: 1.14,
|
|
1313
|
+
burstSettleRotation: 1,
|
|
1314
|
+
burstSettleScale: 0.98,
|
|
1315
|
+
burstSettleX: 1,
|
|
1316
|
+
burstSettleY: 1,
|
|
1317
|
+
burstX: -4,
|
|
1318
|
+
burstY: -14
|
|
1319
|
+
},
|
|
1320
|
+
{
|
|
1321
|
+
transform: "rotate(12 60 30)",
|
|
1322
|
+
originX: 42,
|
|
1323
|
+
originY: 32,
|
|
1324
|
+
orbitRotation: [0, 5, 0, 0],
|
|
1325
|
+
orbitX: [0, 5, 0, 0],
|
|
1326
|
+
orbitY: [0, 2, 0, 0],
|
|
1327
|
+
burstRotation: 8,
|
|
1328
|
+
burstScale: 1.16,
|
|
1329
|
+
burstSettleRotation: -2,
|
|
1330
|
+
burstSettleScale: 0.98,
|
|
1331
|
+
burstSettleX: 2,
|
|
1332
|
+
burstSettleY: 1,
|
|
1333
|
+
burstX: 14,
|
|
1334
|
+
burstY: -6
|
|
1335
|
+
},
|
|
1336
|
+
{
|
|
1337
|
+
transform: "rotate(5 55 50)",
|
|
1338
|
+
originX: 55,
|
|
1339
|
+
originY: 50,
|
|
1340
|
+
orbitRotation: [0, -4, 0, 0],
|
|
1341
|
+
orbitX: [0, -3, 0, 0],
|
|
1342
|
+
orbitY: [0, -3, 0, 0],
|
|
1343
|
+
burstRotation: 7,
|
|
1344
|
+
burstScale: 1.13,
|
|
1345
|
+
burstSettleRotation: -1,
|
|
1346
|
+
burstSettleScale: 0.98,
|
|
1347
|
+
burstSettleX: 1,
|
|
1348
|
+
burstSettleY: -1,
|
|
1349
|
+
burstX: 11,
|
|
1350
|
+
burstY: 12
|
|
1351
|
+
}
|
|
1352
|
+
];
|
|
1353
|
+
var ORBIT_DURATION = 4800;
|
|
1354
|
+
var BURST_DURATION = 1100;
|
|
1355
|
+
var DEFAULT_COLOR = "#1A332B";
|
|
1356
|
+
var DEFAULT_HEIGHT = 32;
|
|
1357
|
+
var DEFAULT_MOTION = "orbit-burst";
|
|
1358
|
+
var DEFAULT_VARIANT = "wordmark";
|
|
1359
|
+
var WORDMARK_VIEW_BOX = "0 0 200 80";
|
|
1360
|
+
var MARK_VIEW_BOX = "0 0 68 80";
|
|
1361
|
+
function createStickAnimationValues() {
|
|
1362
|
+
return [
|
|
1363
|
+
{ rotation: new Animated.Value(0), scaleX: new Animated.Value(1), scaleY: new Animated.Value(1), translateX: new Animated.Value(0), translateY: new Animated.Value(0) },
|
|
1364
|
+
{ rotation: new Animated.Value(0), scaleX: new Animated.Value(1), scaleY: new Animated.Value(1), translateX: new Animated.Value(0), translateY: new Animated.Value(0) },
|
|
1365
|
+
{ rotation: new Animated.Value(0), scaleX: new Animated.Value(1), scaleY: new Animated.Value(1), translateX: new Animated.Value(0), translateY: new Animated.Value(0) },
|
|
1366
|
+
{ rotation: new Animated.Value(0), scaleX: new Animated.Value(1), scaleY: new Animated.Value(1), translateX: new Animated.Value(0), translateY: new Animated.Value(0) }
|
|
1367
|
+
];
|
|
1368
|
+
}
|
|
1369
|
+
function createOrbitAnimation(stick, motion, index) {
|
|
1370
|
+
const keyframes = [
|
|
1371
|
+
Animated.parallel([
|
|
1372
|
+
Animated.timing(stick.rotation, { duration: ORBIT_DURATION / 2, toValue: motion.orbitRotation[1], useNativeDriver: true }),
|
|
1373
|
+
Animated.timing(stick.translateX, { duration: ORBIT_DURATION / 2, toValue: motion.orbitX[1], useNativeDriver: true }),
|
|
1374
|
+
Animated.timing(stick.translateY, { duration: ORBIT_DURATION / 2, toValue: motion.orbitY[1], useNativeDriver: true })
|
|
1375
|
+
]),
|
|
1376
|
+
Animated.parallel([
|
|
1377
|
+
Animated.timing(stick.rotation, { duration: ORBIT_DURATION / 2, toValue: motion.orbitRotation[2], useNativeDriver: true }),
|
|
1378
|
+
Animated.timing(stick.translateX, { duration: ORBIT_DURATION / 2, toValue: motion.orbitX[2], useNativeDriver: true }),
|
|
1379
|
+
Animated.timing(stick.translateY, { duration: ORBIT_DURATION / 2, toValue: motion.orbitY[2], useNativeDriver: true })
|
|
1380
|
+
])
|
|
1381
|
+
];
|
|
1382
|
+
return Animated.sequence([Animated.delay(index * 90), Animated.loop(Animated.sequence(keyframes))]);
|
|
1383
|
+
}
|
|
1384
|
+
function createBurstAnimation(stick, motion) {
|
|
1385
|
+
return Animated.loop(
|
|
1386
|
+
Animated.sequence([
|
|
1387
|
+
Animated.parallel([
|
|
1388
|
+
Animated.timing(stick.rotation, { duration: BURST_DURATION * 0.24, toValue: motion.burstRotation, useNativeDriver: true }),
|
|
1389
|
+
Animated.timing(stick.scaleX, { duration: BURST_DURATION * 0.24, toValue: motion.burstScale, useNativeDriver: true }),
|
|
1390
|
+
Animated.timing(stick.scaleY, { duration: BURST_DURATION * 0.24, toValue: motion.burstScale, useNativeDriver: true }),
|
|
1391
|
+
Animated.timing(stick.translateX, { duration: BURST_DURATION * 0.24, toValue: motion.burstX, useNativeDriver: true }),
|
|
1392
|
+
Animated.timing(stick.translateY, { duration: BURST_DURATION * 0.24, toValue: motion.burstY, useNativeDriver: true })
|
|
1393
|
+
]),
|
|
1394
|
+
Animated.parallel([
|
|
1395
|
+
Animated.timing(stick.rotation, { duration: BURST_DURATION * 0.25, toValue: motion.burstSettleRotation, useNativeDriver: true }),
|
|
1396
|
+
Animated.timing(stick.scaleX, { duration: BURST_DURATION * 0.25, toValue: motion.burstSettleScale, useNativeDriver: true }),
|
|
1397
|
+
Animated.timing(stick.scaleY, { duration: BURST_DURATION * 0.25, toValue: motion.burstSettleScale, useNativeDriver: true }),
|
|
1398
|
+
Animated.timing(stick.translateX, { duration: BURST_DURATION * 0.25, toValue: motion.burstSettleX, useNativeDriver: true }),
|
|
1399
|
+
Animated.timing(stick.translateY, { duration: BURST_DURATION * 0.25, toValue: motion.burstSettleY, useNativeDriver: true })
|
|
1400
|
+
]),
|
|
1401
|
+
Animated.parallel([
|
|
1402
|
+
Animated.timing(stick.rotation, { duration: BURST_DURATION * 0.33, toValue: 0, useNativeDriver: true }),
|
|
1403
|
+
Animated.timing(stick.scaleX, { duration: BURST_DURATION * 0.33, toValue: 1, useNativeDriver: true }),
|
|
1404
|
+
Animated.timing(stick.scaleY, { duration: BURST_DURATION * 0.33, toValue: 1, useNativeDriver: true }),
|
|
1405
|
+
Animated.timing(stick.translateX, { duration: BURST_DURATION * 0.33, toValue: 0, useNativeDriver: true }),
|
|
1406
|
+
Animated.timing(stick.translateY, { duration: BURST_DURATION * 0.33, toValue: 0, useNativeDriver: true })
|
|
1407
|
+
])
|
|
1408
|
+
])
|
|
1409
|
+
);
|
|
1410
|
+
}
|
|
1411
|
+
function resetStickAnimationValues(values) {
|
|
1412
|
+
for (const stick of values) {
|
|
1413
|
+
stick.rotation.stopAnimation();
|
|
1414
|
+
stick.scaleX.stopAnimation();
|
|
1415
|
+
stick.scaleY.stopAnimation();
|
|
1416
|
+
stick.translateX.stopAnimation();
|
|
1417
|
+
stick.translateY.stopAnimation();
|
|
1418
|
+
stick.rotation.setValue(0);
|
|
1419
|
+
stick.scaleX.setValue(1);
|
|
1420
|
+
stick.scaleY.setValue(1);
|
|
1421
|
+
stick.translateX.setValue(0);
|
|
1422
|
+
stick.translateY.setValue(0);
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
function Logo({ accessibilityLabel = "Chalk", color = DEFAULT_COLOR, height = DEFAULT_HEIGHT, motion = DEFAULT_MOTION, variant = DEFAULT_VARIANT }) {
|
|
1426
|
+
const [reducedMotion, setReducedMotion] = useState3(null);
|
|
1427
|
+
const [interaction, setInteraction] = useState3({ focus: false, hover: false, press: false });
|
|
1428
|
+
const idPrefix = `chalk-logo-${useId().replace(/[^a-zA-Z0-9_-]/gu, "")}`;
|
|
1429
|
+
const animationValues = useRef2(null);
|
|
1430
|
+
if (animationValues.current === null) {
|
|
1431
|
+
animationValues.current = createStickAnimationValues();
|
|
1432
|
+
}
|
|
1433
|
+
const sticks = animationValues.current;
|
|
1434
|
+
const interactionActive = interaction.focus || interaction.hover || interaction.press;
|
|
1435
|
+
const animate = motion === "orbit-burst" && reducedMotion === false;
|
|
1436
|
+
useEffect3(() => {
|
|
1437
|
+
let cancelled = false;
|
|
1438
|
+
const subscription = AccessibilityInfo.addEventListener("reduceMotionChanged", setReducedMotion);
|
|
1439
|
+
void AccessibilityInfo.isReduceMotionEnabled().then((enabled) => {
|
|
1440
|
+
if (!cancelled) {
|
|
1441
|
+
setReducedMotion(enabled);
|
|
1442
|
+
}
|
|
1443
|
+
});
|
|
1444
|
+
return () => {
|
|
1445
|
+
cancelled = true;
|
|
1446
|
+
subscription.remove();
|
|
1447
|
+
};
|
|
1448
|
+
}, []);
|
|
1449
|
+
useEffect3(() => {
|
|
1450
|
+
if (!animate) {
|
|
1451
|
+
resetStickAnimationValues(sticks);
|
|
1452
|
+
return;
|
|
1453
|
+
}
|
|
1454
|
+
const animations = interactionActive ? [createBurstAnimation(sticks[0], STICK_MOTIONS[0]), createBurstAnimation(sticks[1], STICK_MOTIONS[1]), createBurstAnimation(sticks[2], STICK_MOTIONS[2]), createBurstAnimation(sticks[3], STICK_MOTIONS[3])] : [createOrbitAnimation(sticks[0], STICK_MOTIONS[0], 0), createOrbitAnimation(sticks[1], STICK_MOTIONS[1], 1), createOrbitAnimation(sticks[2], STICK_MOTIONS[2], 2), createOrbitAnimation(sticks[3], STICK_MOTIONS[3], 3)];
|
|
1455
|
+
const animation = Animated.parallel(animations);
|
|
1456
|
+
animation.start();
|
|
1457
|
+
return () => {
|
|
1458
|
+
animation.stop();
|
|
1459
|
+
};
|
|
1460
|
+
}, [animate, interactionActive, sticks]);
|
|
1461
|
+
const setInteractionFlag = (key, value) => {
|
|
1462
|
+
setInteraction((current) => current[key] === value ? current : { ...current, [key]: value });
|
|
1463
|
+
};
|
|
1464
|
+
const width = variant === "wordmark" ? height * 2.5 : height * (68 / 80);
|
|
1465
|
+
const viewBox = variant === "wordmark" ? WORDMARK_VIEW_BOX : MARK_VIEW_BOX;
|
|
1466
|
+
const accessible = accessibilityLabel !== null;
|
|
1467
|
+
return /* @__PURE__ */ jsx13(
|
|
1468
|
+
Pressable4,
|
|
1469
|
+
{
|
|
1470
|
+
accessible: false,
|
|
1471
|
+
onBlur: () => setInteractionFlag("focus", false),
|
|
1472
|
+
onFocus: () => setInteractionFlag("focus", true),
|
|
1473
|
+
onHoverIn: () => setInteractionFlag("hover", true),
|
|
1474
|
+
onHoverOut: () => setInteractionFlag("hover", false),
|
|
1475
|
+
onPressIn: () => setInteractionFlag("press", true),
|
|
1476
|
+
onPressOut: () => setInteractionFlag("press", false),
|
|
1477
|
+
children: /* @__PURE__ */ jsxs8(Svg, { accessibilityLabel: accessible ? accessibilityLabel ?? void 0 : void 0, accessible, color, fill: "none", focusable: false, height, viewBox, width, children: [
|
|
1478
|
+
/* @__PURE__ */ jsxs8(Defs, { children: [
|
|
1479
|
+
/* @__PURE__ */ jsxs8(LinearGradient, { id: `${idPrefix}-green`, x1: "0%", x2: "100%", y1: "0%", y2: "0%", children: [
|
|
1480
|
+
/* @__PURE__ */ jsx13(Stop, { offset: "0%", stopColor: "#C5E5C0" }),
|
|
1481
|
+
/* @__PURE__ */ jsx13(Stop, { offset: "100%", stopColor: "#80B879" })
|
|
1482
|
+
] }),
|
|
1483
|
+
/* @__PURE__ */ jsxs8(LinearGradient, { id: `${idPrefix}-yellow`, x1: "0%", x2: "100%", y1: "0%", y2: "0%", children: [
|
|
1484
|
+
/* @__PURE__ */ jsx13(Stop, { offset: "0%", stopColor: "#FCEAB3" }),
|
|
1485
|
+
/* @__PURE__ */ jsx13(Stop, { offset: "100%", stopColor: "#D9B641" })
|
|
1486
|
+
] }),
|
|
1487
|
+
/* @__PURE__ */ jsxs8(LinearGradient, { id: `${idPrefix}-blue`, x1: "0%", x2: "100%", y1: "0%", y2: "0%", children: [
|
|
1488
|
+
/* @__PURE__ */ jsx13(Stop, { offset: "0%", stopColor: "#B2E0F0" }),
|
|
1489
|
+
/* @__PURE__ */ jsx13(Stop, { offset: "100%", stopColor: "#55AAC9" })
|
|
1490
|
+
] }),
|
|
1491
|
+
/* @__PURE__ */ jsxs8(LinearGradient, { id: `${idPrefix}-pink`, x1: "0%", x2: "100%", y1: "0%", y2: "0%", children: [
|
|
1492
|
+
/* @__PURE__ */ jsx13(Stop, { offset: "0%", stopColor: "#F8CACA" }),
|
|
1493
|
+
/* @__PURE__ */ jsx13(Stop, { offset: "100%", stopColor: "#D67B7B" })
|
|
1494
|
+
] })
|
|
1495
|
+
] }),
|
|
1496
|
+
/* @__PURE__ */ jsxs8(G, { transform: "translate(2, 2) scale(0.95)", children: [
|
|
1497
|
+
/* @__PURE__ */ jsxs8(AnimatedG, { originX: STICK_MOTIONS[0].originX, originY: STICK_MOTIONS[0].originY, rotation: sticks[0].rotation, scaleX: sticks[0].scaleX, scaleY: sticks[0].scaleY, transform: STICK_MOTIONS[0].transform, translateX: sticks[0].translateX, translateY: sticks[0].translateY, children: [
|
|
1498
|
+
/* @__PURE__ */ jsx13(Path, { d: "M9,20 L21,20 L22,63 A7,7 0 0 1 8,63 Z", fill: `url(#${idPrefix}-green)` }),
|
|
1499
|
+
/* @__PURE__ */ jsx13(Ellipse, { cx: "15", cy: "20", fill: "#D8ECD4", rx: "6", ry: "2.5" })
|
|
1500
|
+
] }),
|
|
1501
|
+
/* @__PURE__ */ jsxs8(AnimatedG, { originX: STICK_MOTIONS[1].originX, originY: STICK_MOTIONS[1].originY, rotation: sticks[1].rotation, scaleX: sticks[1].scaleX, scaleY: sticks[1].scaleY, transform: STICK_MOTIONS[1].transform, translateX: sticks[1].translateX, translateY: sticks[1].translateY, children: [
|
|
1502
|
+
/* @__PURE__ */ jsx13(Path, { d: "M23,15 L35,15 L36,60 A7,7 0 0 1 22,60 Z", fill: `url(#${idPrefix}-yellow)` }),
|
|
1503
|
+
/* @__PURE__ */ jsx13(Ellipse, { cx: "29", cy: "15", fill: "#FEF3D1", rx: "6", ry: "2.5" })
|
|
1504
|
+
] }),
|
|
1505
|
+
/* @__PURE__ */ jsxs8(AnimatedG, { originX: STICK_MOTIONS[2].originX, originY: STICK_MOTIONS[2].originY, rotation: sticks[2].rotation, scaleX: sticks[2].scaleX, scaleY: sticks[2].scaleY, transform: STICK_MOTIONS[2].transform, translateX: sticks[2].translateX, translateY: sticks[2].translateY, children: [
|
|
1506
|
+
/* @__PURE__ */ jsx13(Path, { d: "M36,8 L48,8 L49,56 A7,7 0 0 1 35,56 Z", fill: `url(#${idPrefix}-blue)` }),
|
|
1507
|
+
/* @__PURE__ */ jsx13(Ellipse, { cx: "42", cy: "8", fill: "#D0EDF8", rx: "6", ry: "2.5" })
|
|
1508
|
+
] }),
|
|
1509
|
+
/* @__PURE__ */ jsxs8(AnimatedG, { originX: STICK_MOTIONS[3].originX, originY: STICK_MOTIONS[3].originY, rotation: sticks[3].rotation, scaleX: sticks[3].scaleX, scaleY: sticks[3].scaleY, transform: STICK_MOTIONS[3].transform, translateX: sticks[3].translateX, translateY: sticks[3].translateY, children: [
|
|
1510
|
+
/* @__PURE__ */ jsx13(Path, { d: "M49,70 L61,70 L62,29 A7,7 0 0 0 48,29 Z", fill: `url(#${idPrefix}-pink)` }),
|
|
1511
|
+
/* @__PURE__ */ jsx13(Ellipse, { cx: "55", cy: "70", fill: "#FBE4E4", rx: "6", ry: "2.5" })
|
|
1512
|
+
] })
|
|
1513
|
+
] }),
|
|
1514
|
+
variant === "wordmark" ? /* @__PURE__ */ jsx13(SvgText, { fill: "currentColor", fontFamily: "system-ui, -apple-system, BlinkMacSystemFont, sans-serif", fontSize: "38", fontWeight: "600", letterSpacing: "-0.02em", x: "90", y: "52", children: "chalk" }) : null
|
|
1515
|
+
] })
|
|
1516
|
+
}
|
|
1517
|
+
);
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
// src/components/native-space-view/SpaceTopBar.android.tsx
|
|
1521
|
+
import { jsx as jsx14, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1281
1522
|
function SpaceTopBarAndroid({ spaceName, participantCount, formattedDuration, logoUrl }) {
|
|
1282
1523
|
const theme = useNativeTheme();
|
|
1283
|
-
return /* @__PURE__ */
|
|
1284
|
-
/* @__PURE__ */
|
|
1285
|
-
logoUrl ? /* @__PURE__ */
|
|
1286
|
-
/* @__PURE__ */
|
|
1287
|
-
/* @__PURE__ */
|
|
1288
|
-
/* @__PURE__ */
|
|
1524
|
+
return /* @__PURE__ */ jsxs9(View10, { style: [styles9.topBar, { backgroundColor: theme.colors.darkCanvas, borderColor: theme.colors.border }], children: [
|
|
1525
|
+
/* @__PURE__ */ jsxs9(View10, { style: styles9.topBarLeft, children: [
|
|
1526
|
+
logoUrl ? /* @__PURE__ */ jsx14(Image2, { accessibilityLabel: "Chalk", source: { uri: logoUrl }, style: styles9.logo }) : /* @__PURE__ */ jsx14(Logo, { height: 24, variant: "mark" }),
|
|
1527
|
+
/* @__PURE__ */ jsx14(View10, { style: [styles9.connectionDot, { backgroundColor: theme.colors.success }] }),
|
|
1528
|
+
/* @__PURE__ */ jsx14(Text6, { style: [styles9.topBarSpaceName, { color: theme.colors.foreground }], numberOfLines: 1, children: spaceName }),
|
|
1529
|
+
/* @__PURE__ */ jsx14(View10, { style: [styles9.timerBadge, { backgroundColor: theme.colors.surface }], children: /* @__PURE__ */ jsx14(Text6, { style: [styles9.timerText, { color: theme.colors.mutedForeground }], children: formattedDuration }) })
|
|
1289
1530
|
] }),
|
|
1290
|
-
/* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1292
|
-
/* @__PURE__ */
|
|
1531
|
+
/* @__PURE__ */ jsxs9(View10, { style: [styles9.topBarRight, { backgroundColor: theme.colors.surface }], children: [
|
|
1532
|
+
/* @__PURE__ */ jsx14(HugeiconsIcon4, { icon: UserGroupIcon, size: 14, color: theme.colors.foreground }),
|
|
1533
|
+
/* @__PURE__ */ jsx14(Text6, { style: [styles9.topBarCount, { color: theme.colors.foreground }], children: participantCount })
|
|
1293
1534
|
] })
|
|
1294
1535
|
] });
|
|
1295
1536
|
}
|
|
@@ -1360,8 +1601,8 @@ import { StyleSheet as StyleSheet12 } from "react-native";
|
|
|
1360
1601
|
|
|
1361
1602
|
// src/components/EmbeddedWhiteboard.tsx
|
|
1362
1603
|
import { ChalkWhiteboardController } from "@q9labsai/chalk-whiteboard/embedded";
|
|
1363
|
-
import { useCallback as useCallback4, useEffect as
|
|
1364
|
-
import { ActivityIndicator, Pressable as
|
|
1604
|
+
import { useCallback as useCallback4, useEffect as useEffect4, useMemo as useMemo8, useRef as useRef3, useState as useState4 } from "react";
|
|
1605
|
+
import { ActivityIndicator, Pressable as Pressable5, StyleSheet as StyleSheet11, Text as Text7, useWindowDimensions as useWindowDimensions2, View as View11 } from "react-native";
|
|
1365
1606
|
import WebView from "react-native-webview";
|
|
1366
1607
|
|
|
1367
1608
|
// src/whiteboard/embedded-whiteboard-assets.ts
|
|
@@ -1398,7 +1639,7 @@ function requireLocalRendererURL(value) {
|
|
|
1398
1639
|
}
|
|
1399
1640
|
|
|
1400
1641
|
// src/components/EmbeddedWhiteboard.tsx
|
|
1401
|
-
import { jsx as
|
|
1642
|
+
import { jsx as jsx15, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1402
1643
|
var embeddedWhiteboardWebViewSecurityPolicy = Object.freeze({
|
|
1403
1644
|
allowFileAccess: true,
|
|
1404
1645
|
allowFileAccessFromFileURLs: false,
|
|
@@ -1415,17 +1656,17 @@ var embeddedWhiteboardWebViewSecurityPolicy = Object.freeze({
|
|
|
1415
1656
|
function EmbeddedWhiteboard({ transport, journeyId, traceparent, tracestate, canDraw, canClear, theme: themeOverride, localParticipantColor, rendererURL: rendererURLOverride, style, testID, onMetric, onError, onUserExport }) {
|
|
1416
1657
|
const nativeTheme = useNativeTheme();
|
|
1417
1658
|
const theme = themeOverride ?? nativeTheme.colorScheme;
|
|
1418
|
-
const webViewRef =
|
|
1419
|
-
const controllerRef =
|
|
1420
|
-
const listenersRef =
|
|
1421
|
-
const onMetricRef =
|
|
1422
|
-
const onErrorRef =
|
|
1423
|
-
const onUserExportRef =
|
|
1424
|
-
const [rendererURL, setRendererURL] =
|
|
1425
|
-
const [rendererGeneration, setRendererGeneration] =
|
|
1426
|
-
const [loadAttempt, setLoadAttempt] =
|
|
1427
|
-
const [loadError, setLoadError] =
|
|
1428
|
-
const [compatibilityNotice, setCompatibilityNotice] =
|
|
1659
|
+
const webViewRef = useRef3(null);
|
|
1660
|
+
const controllerRef = useRef3(null);
|
|
1661
|
+
const listenersRef = useRef3(/* @__PURE__ */ new Set());
|
|
1662
|
+
const onMetricRef = useRef3(onMetric);
|
|
1663
|
+
const onErrorRef = useRef3(onError);
|
|
1664
|
+
const onUserExportRef = useRef3(onUserExport);
|
|
1665
|
+
const [rendererURL, setRendererURL] = useState4(null);
|
|
1666
|
+
const [rendererGeneration, setRendererGeneration] = useState4(createRendererGeneration);
|
|
1667
|
+
const [loadAttempt, setLoadAttempt] = useState4(0);
|
|
1668
|
+
const [loadError, setLoadError] = useState4(null);
|
|
1669
|
+
const [compatibilityNotice, setCompatibilityNotice] = useState4(null);
|
|
1429
1670
|
const { width, height, scale } = useWindowDimensions2();
|
|
1430
1671
|
onMetricRef.current = onMetric;
|
|
1431
1672
|
onErrorRef.current = onError;
|
|
@@ -1443,7 +1684,7 @@ function EmbeddedWhiteboard({ transport, journeyId, traceparent, tracestate, can
|
|
|
1443
1684
|
const handleControllerError = useCallback4((error) => onErrorRef.current?.(error), []);
|
|
1444
1685
|
const handleControllerMetric = useCallback4((metric) => onMetricRef.current?.(metric), []);
|
|
1445
1686
|
const handleControllerUserExport = useCallback4((value) => onUserExportRef.current?.(value), []);
|
|
1446
|
-
|
|
1687
|
+
useEffect4(() => {
|
|
1447
1688
|
let active = true;
|
|
1448
1689
|
setLoadError(null);
|
|
1449
1690
|
void resolveEmbeddedWhiteboardRendererURL(rendererURLOverride).then((url) => {
|
|
@@ -1458,7 +1699,7 @@ function EmbeddedWhiteboard({ transport, journeyId, traceparent, tracestate, can
|
|
|
1458
1699
|
active = false;
|
|
1459
1700
|
};
|
|
1460
1701
|
}, [loadAttempt, onError, rendererURLOverride]);
|
|
1461
|
-
|
|
1702
|
+
useEffect4(() => {
|
|
1462
1703
|
setCompatibilityNotice(null);
|
|
1463
1704
|
const controller = new ChalkWhiteboardController({
|
|
1464
1705
|
renderer: rendererPort,
|
|
@@ -1482,11 +1723,11 @@ function EmbeddedWhiteboard({ transport, journeyId, traceparent, tracestate, can
|
|
|
1482
1723
|
controller.stop();
|
|
1483
1724
|
};
|
|
1484
1725
|
}, [handleControllerError, handleControllerMetric, handleControllerUserExport, journeyId, localParticipantColor, rendererPort, theme, traceparent, tracestate, transport]);
|
|
1485
|
-
|
|
1726
|
+
useEffect4(() => {
|
|
1486
1727
|
controllerRef.current?.setCapabilities({ canDraw, canClear });
|
|
1487
1728
|
}, [canClear, canDraw]);
|
|
1488
1729
|
const viewport = useMemo8(() => ({ width, height, scale }), [height, scale, width]);
|
|
1489
|
-
|
|
1730
|
+
useEffect4(() => {
|
|
1490
1731
|
controllerRef.current?.setViewport(viewport);
|
|
1491
1732
|
}, [viewport]);
|
|
1492
1733
|
const sourceURL = rendererURL ? rendererURLWithContext(rendererURL, { journeyId, rendererGeneration }) : null;
|
|
@@ -1514,20 +1755,20 @@ function EmbeddedWhiteboard({ transport, journeyId, traceparent, tracestate, can
|
|
|
1514
1755
|
reloadRenderer();
|
|
1515
1756
|
};
|
|
1516
1757
|
if (loadError) {
|
|
1517
|
-
return /* @__PURE__ */
|
|
1518
|
-
/* @__PURE__ */
|
|
1519
|
-
/* @__PURE__ */
|
|
1520
|
-
/* @__PURE__ */
|
|
1758
|
+
return /* @__PURE__ */ jsxs10(View11, { style: [styles10.status, { backgroundColor: nativeTheme.colors.lightSurface }, style], testID, children: [
|
|
1759
|
+
/* @__PURE__ */ jsx15(Text7, { style: [styles10.errorTitle, { color: nativeTheme.colors.lightText }], children: "Whiteboard unavailable" }),
|
|
1760
|
+
/* @__PURE__ */ jsx15(Text7, { style: [styles10.errorMessage, { color: nativeTheme.colors.lightSubtleText }], children: loadError }),
|
|
1761
|
+
/* @__PURE__ */ jsx15(Pressable5, { accessibilityRole: "button", onPress: retryRenderer, style: ({ pressed }) => [styles10.retryButton, { backgroundColor: nativeTheme.colors.info }, pressed && styles10.retryButtonPressed], children: /* @__PURE__ */ jsx15(Text7, { style: [styles10.retryButtonText, { color: nativeTheme.colors.onDark }], children: "Retry" }) })
|
|
1521
1762
|
] });
|
|
1522
1763
|
}
|
|
1523
1764
|
if (!sourceURL || !rendererURL) {
|
|
1524
|
-
return /* @__PURE__ */
|
|
1525
|
-
/* @__PURE__ */
|
|
1526
|
-
/* @__PURE__ */
|
|
1765
|
+
return /* @__PURE__ */ jsxs10(View11, { style: [styles10.status, { backgroundColor: nativeTheme.colors.lightSurface }, style], testID, children: [
|
|
1766
|
+
/* @__PURE__ */ jsx15(ActivityIndicator, { color: nativeTheme.colors.info }),
|
|
1767
|
+
/* @__PURE__ */ jsx15(Text7, { style: [styles10.loadingMessage, { color: nativeTheme.colors.lightMutedText }], children: "Loading whiteboard\u2026" })
|
|
1527
1768
|
] });
|
|
1528
1769
|
}
|
|
1529
|
-
return /* @__PURE__ */
|
|
1530
|
-
/* @__PURE__ */
|
|
1770
|
+
return /* @__PURE__ */ jsxs10(View11, { style: [styles10.container, style], testID, children: [
|
|
1771
|
+
/* @__PURE__ */ jsx15(
|
|
1531
1772
|
WebView,
|
|
1532
1773
|
{
|
|
1533
1774
|
ref: webViewRef,
|
|
@@ -1552,7 +1793,7 @@ function EmbeddedWhiteboard({ transport, journeyId, traceparent, tracestate, can
|
|
|
1552
1793
|
},
|
|
1553
1794
|
rendererGeneration
|
|
1554
1795
|
),
|
|
1555
|
-
compatibilityNotice ? /* @__PURE__ */
|
|
1796
|
+
compatibilityNotice ? /* @__PURE__ */ jsx15(View11, { pointerEvents: "none", style: [styles10.compatibilityNotice, { backgroundColor: nativeTheme.colors.dangerSurfaceOverlay94 }], children: /* @__PURE__ */ jsx15(Text7, { style: [styles10.compatibilityNoticeText, { color: nativeTheme.colors.onDark }], children: compatibilityNotice }) }) : null
|
|
1556
1797
|
] });
|
|
1557
1798
|
}
|
|
1558
1799
|
function createRendererGeneration() {
|
|
@@ -1614,7 +1855,7 @@ var styles10 = StyleSheet11.create({
|
|
|
1614
1855
|
});
|
|
1615
1856
|
|
|
1616
1857
|
// src/components/native-space-view/SpaceWhiteboardSurface.tsx
|
|
1617
|
-
import { jsx as
|
|
1858
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1618
1859
|
function shouldRenderNativeSpaceWhiteboard(whiteboard) {
|
|
1619
1860
|
return whiteboard.isOpen && whiteboard.transport !== null;
|
|
1620
1861
|
}
|
|
@@ -1643,7 +1884,7 @@ function SpaceWhiteboardSurface({ whiteboard }) {
|
|
|
1643
1884
|
[whiteboard.onMetric]
|
|
1644
1885
|
);
|
|
1645
1886
|
if (!shouldRenderNativeSpaceWhiteboard(whiteboard)) return null;
|
|
1646
|
-
return /* @__PURE__ */
|
|
1887
|
+
return /* @__PURE__ */ jsx16(
|
|
1647
1888
|
EmbeddedWhiteboard,
|
|
1648
1889
|
{
|
|
1649
1890
|
canClear: whiteboard.canClear,
|
|
@@ -1674,37 +1915,37 @@ import Speaker01Icon from "@hugeicons/core-free-icons/dist/esm/Speaker01Icon";
|
|
|
1674
1915
|
import Video01Icon2 from "@hugeicons/core-free-icons/dist/esm/Video01Icon";
|
|
1675
1916
|
import VideoOffIcon2 from "@hugeicons/core-free-icons/dist/esm/VideoOffIcon";
|
|
1676
1917
|
import { HugeiconsIcon as HugeiconsIcon7 } from "@hugeicons/react-native";
|
|
1677
|
-
import { useEffect as
|
|
1678
|
-
import { Modal as Modal3, Platform as Platform6, Pressable as
|
|
1918
|
+
import { useEffect as useEffect5, useState as useState5 } from "react";
|
|
1919
|
+
import { Modal as Modal3, Platform as Platform6, Pressable as Pressable8, ScrollView, StyleSheet as StyleSheet15, Text as Text10, View as View14 } from "react-native";
|
|
1679
1920
|
|
|
1680
1921
|
// src/components/native-space-view/SpaceSurfacePrimitives.tsx
|
|
1681
1922
|
import { HugeiconsIcon as HugeiconsIcon5 } from "@hugeicons/react-native";
|
|
1682
|
-
import { Pressable as
|
|
1683
|
-
import { jsx as
|
|
1923
|
+
import { Pressable as Pressable6, StyleSheet as StyleSheet13, Text as Text8, View as View12 } from "react-native";
|
|
1924
|
+
import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1684
1925
|
function SheetGrip() {
|
|
1685
|
-
return /* @__PURE__ */
|
|
1926
|
+
return /* @__PURE__ */ jsx17(View12, { accessibilityElementsHidden: true, style: styles12.grip });
|
|
1686
1927
|
}
|
|
1687
1928
|
function CloseButton({ label, onPress }) {
|
|
1688
|
-
return /* @__PURE__ */
|
|
1929
|
+
return /* @__PURE__ */ jsx17(Pressable6, { accessibilityLabel: label, accessibilityRole: "button", hitSlop: 6, onPress, style: ({ pressed }) => [styles12.closeButton, pressed && styles12.pressed], children: /* @__PURE__ */ jsx17(Text8, { style: styles12.closeGlyph, children: "\xD7" }) });
|
|
1689
1930
|
}
|
|
1690
1931
|
function SurfaceHeader({ title, count, subtitle, onClose, closeLabel }) {
|
|
1691
|
-
return /* @__PURE__ */
|
|
1692
|
-
/* @__PURE__ */
|
|
1693
|
-
/* @__PURE__ */
|
|
1694
|
-
/* @__PURE__ */
|
|
1695
|
-
count !== void 0 ? /* @__PURE__ */
|
|
1932
|
+
return /* @__PURE__ */ jsxs11(View12, { style: styles12.header, children: [
|
|
1933
|
+
/* @__PURE__ */ jsxs11(View12, { style: styles12.headerCopy, children: [
|
|
1934
|
+
/* @__PURE__ */ jsxs11(View12, { style: styles12.titleRow, children: [
|
|
1935
|
+
/* @__PURE__ */ jsx17(Text8, { style: styles12.title, children: title }),
|
|
1936
|
+
count !== void 0 ? /* @__PURE__ */ jsx17(View12, { style: styles12.countPill, children: /* @__PURE__ */ jsx17(Text8, { style: styles12.countText, children: count }) }) : null
|
|
1696
1937
|
] }),
|
|
1697
|
-
subtitle ? /* @__PURE__ */
|
|
1938
|
+
subtitle ? /* @__PURE__ */ jsx17(Text8, { style: styles12.subtitle, children: subtitle }) : null
|
|
1698
1939
|
] }),
|
|
1699
|
-
/* @__PURE__ */
|
|
1940
|
+
/* @__PURE__ */ jsx17(CloseButton, { label: closeLabel, onPress: onClose })
|
|
1700
1941
|
] });
|
|
1701
1942
|
}
|
|
1702
1943
|
function InitialsAvatar({ name, size = 52, style }) {
|
|
1703
1944
|
const color = getParticipantColor(name);
|
|
1704
|
-
return /* @__PURE__ */
|
|
1945
|
+
return /* @__PURE__ */ jsx17(View12, { style: [styles12.avatar, { backgroundColor: color.primary, borderRadius: size / 2, height: size, width: size }, style], children: /* @__PURE__ */ jsx17(Text8, { allowFontScaling: false, style: [styles12.avatarText, { fontSize: Math.max(16, Math.round(size * 0.34)) }], children: getParticipantInitials(name) }) });
|
|
1705
1946
|
}
|
|
1706
1947
|
function IconTile({ icon, symbol, color = Theme.colors.ink, wash = Theme.colors.surface }) {
|
|
1707
|
-
return /* @__PURE__ */
|
|
1948
|
+
return /* @__PURE__ */ jsx17(View12, { style: [styles12.iconTile, { backgroundColor: wash }], children: icon ? /* @__PURE__ */ jsx17(HugeiconsIcon5, { color, icon, size: 22 }) : /* @__PURE__ */ jsx17(Text8, { style: [styles12.symbol, { color }], children: symbol }) });
|
|
1708
1949
|
}
|
|
1709
1950
|
var styles12 = StyleSheet13.create({
|
|
1710
1951
|
grip: { alignSelf: "center", backgroundColor: Theme.colors.lineStrong, borderRadius: Theme.radius.full, height: 5, marginTop: Theme.spacing.sm, width: 48 },
|
|
@@ -1727,20 +1968,20 @@ var styles12 = StyleSheet13.create({
|
|
|
1727
1968
|
// src/components/native-space-view/AppearanceSettings.tsx
|
|
1728
1969
|
import CheckmarkCircle01Icon from "@hugeicons/core-free-icons/dist/esm/CheckmarkCircle01Icon";
|
|
1729
1970
|
import { HugeiconsIcon as HugeiconsIcon6 } from "@hugeicons/react-native";
|
|
1730
|
-
import { Pressable as
|
|
1731
|
-
import { jsx as
|
|
1971
|
+
import { Pressable as Pressable7, StyleSheet as StyleSheet14, Text as Text9, View as View13 } from "react-native";
|
|
1972
|
+
import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1732
1973
|
function AppearanceSettings() {
|
|
1733
1974
|
const { appearance, setPalette, setTexture } = useNativeAppearance();
|
|
1734
1975
|
const theme = useNativeTheme();
|
|
1735
|
-
return /* @__PURE__ */
|
|
1736
|
-
/* @__PURE__ */
|
|
1737
|
-
["light", "dark"].map((mode) => /* @__PURE__ */
|
|
1738
|
-
/* @__PURE__ */
|
|
1739
|
-
/* @__PURE__ */
|
|
1740
|
-
/* @__PURE__ */
|
|
1976
|
+
return /* @__PURE__ */ jsxs12(View13, { style: styles13.section, children: [
|
|
1977
|
+
/* @__PURE__ */ jsx18(Text9, { style: [styles13.intro, { color: theme.colors.ink2 }], children: "Choose a complete color family, then layer in a material texture. Every combination is available on mobile." }),
|
|
1978
|
+
["light", "dark"].map((mode) => /* @__PURE__ */ jsx18(PaletteGroup, { mode, selectedPalette: appearance.palette, theme, onSelect: setPalette }, mode)),
|
|
1979
|
+
/* @__PURE__ */ jsxs12(View13, { style: styles13.textureSection, children: [
|
|
1980
|
+
/* @__PURE__ */ jsx18(Text9, { style: styles13.groupLabel, children: "Texture" }),
|
|
1981
|
+
/* @__PURE__ */ jsx18(View13, { style: styles13.textureGrid, children: THEME_TEXTURES.map((texture) => {
|
|
1741
1982
|
const selected = texture.value === appearance.texture;
|
|
1742
|
-
return /* @__PURE__ */
|
|
1743
|
-
|
|
1983
|
+
return /* @__PURE__ */ jsxs12(
|
|
1984
|
+
Pressable7,
|
|
1744
1985
|
{
|
|
1745
1986
|
accessibilityLabel: `Use ${texture.label} texture`,
|
|
1746
1987
|
accessibilityRole: "button",
|
|
@@ -1748,8 +1989,8 @@ function AppearanceSettings() {
|
|
|
1748
1989
|
onPress: () => setTexture(texture.value),
|
|
1749
1990
|
style: ({ pressed }) => [styles13.texture, { backgroundColor: theme.colors.surfaceMuted, borderColor: theme.colors.line }, selected && [styles13.selected, { borderColor: theme.colors.primary }], pressed && styles13.pressed],
|
|
1750
1991
|
children: [
|
|
1751
|
-
/* @__PURE__ */
|
|
1752
|
-
/* @__PURE__ */
|
|
1992
|
+
/* @__PURE__ */ jsx18(TexturePreview, { kind: texture.value, background: appearance.tokens.stage, foreground: appearance.tokens.textMuted }),
|
|
1993
|
+
/* @__PURE__ */ jsx18(Text9, { numberOfLines: 1, style: [styles13.textureLabel, { color: theme.colors.ink }], children: texture.label })
|
|
1753
1994
|
]
|
|
1754
1995
|
},
|
|
1755
1996
|
texture.value
|
|
@@ -1759,12 +2000,12 @@ function AppearanceSettings() {
|
|
|
1759
2000
|
] });
|
|
1760
2001
|
}
|
|
1761
2002
|
function PaletteGroup({ mode, selectedPalette, theme, onSelect }) {
|
|
1762
|
-
return /* @__PURE__ */
|
|
1763
|
-
/* @__PURE__ */
|
|
1764
|
-
/* @__PURE__ */
|
|
2003
|
+
return /* @__PURE__ */ jsxs12(View13, { style: styles13.group, children: [
|
|
2004
|
+
/* @__PURE__ */ jsx18(Text9, { style: styles13.groupLabel, children: mode === "light" ? "Light palettes" : "Dark palettes" }),
|
|
2005
|
+
/* @__PURE__ */ jsx18(View13, { style: styles13.paletteGrid, children: THEME_PALETTES.filter((palette) => palette.mode === mode).map((palette) => {
|
|
1765
2006
|
const selected = palette.value === selectedPalette;
|
|
1766
|
-
return /* @__PURE__ */
|
|
1767
|
-
|
|
2007
|
+
return /* @__PURE__ */ jsxs12(
|
|
2008
|
+
Pressable7,
|
|
1768
2009
|
{
|
|
1769
2010
|
accessibilityLabel: `Use ${palette.label} palette`,
|
|
1770
2011
|
accessibilityRole: "button",
|
|
@@ -1772,12 +2013,12 @@ function PaletteGroup({ mode, selectedPalette, theme, onSelect }) {
|
|
|
1772
2013
|
onPress: () => onSelect(palette.value),
|
|
1773
2014
|
style: ({ pressed }) => [styles13.palette, { backgroundColor: theme.colors.surfaceMuted, borderColor: theme.colors.line }, selected && [styles13.selected, { borderColor: theme.colors.primary }], pressed && styles13.pressed],
|
|
1774
2015
|
children: [
|
|
1775
|
-
/* @__PURE__ */
|
|
1776
|
-
/* @__PURE__ */
|
|
1777
|
-
/* @__PURE__ */
|
|
1778
|
-
/* @__PURE__ */
|
|
2016
|
+
/* @__PURE__ */ jsx18(View13, { style: styles13.swatches, children: palette.swatch.map((color) => /* @__PURE__ */ jsx18(View13, { style: [styles13.swatch, { backgroundColor: color }] }, color)) }),
|
|
2017
|
+
/* @__PURE__ */ jsxs12(View13, { style: styles13.paletteCopy, children: [
|
|
2018
|
+
/* @__PURE__ */ jsx18(Text9, { numberOfLines: 1, style: [styles13.paletteLabel, { color: theme.colors.ink }], children: palette.label }),
|
|
2019
|
+
/* @__PURE__ */ jsx18(Text9, { numberOfLines: 1, style: [styles13.family, { color: theme.colors.ink3 }], children: palette.family })
|
|
1779
2020
|
] }),
|
|
1780
|
-
selected ? /* @__PURE__ */
|
|
2021
|
+
selected ? /* @__PURE__ */ jsx18(HugeiconsIcon6, { color: theme.colors.success, icon: CheckmarkCircle01Icon, size: 18 }) : null
|
|
1781
2022
|
]
|
|
1782
2023
|
},
|
|
1783
2024
|
palette.value
|
|
@@ -1786,9 +2027,9 @@ function PaletteGroup({ mode, selectedPalette, theme, onSelect }) {
|
|
|
1786
2027
|
] });
|
|
1787
2028
|
}
|
|
1788
2029
|
function TexturePreview({ background, foreground, kind }) {
|
|
1789
|
-
return /* @__PURE__ */
|
|
1790
|
-
kind === "paper" ? Array.from({ length: 11 }, (_, index) => /* @__PURE__ */
|
|
1791
|
-
kind === "slate" ? Array.from({ length: 5 }, (_, index) => /* @__PURE__ */
|
|
2030
|
+
return /* @__PURE__ */ jsxs12(View13, { style: [styles13.texturePreview, { backgroundColor: background }], children: [
|
|
2031
|
+
kind === "paper" ? Array.from({ length: 11 }, (_, index) => /* @__PURE__ */ jsx18(View13, { style: [styles13.grain, { backgroundColor: foreground, left: `${index * 29 % 91}%`, top: `${index * 43 % 88}%` }] }, index)) : null,
|
|
2032
|
+
kind === "slate" ? Array.from({ length: 5 }, (_, index) => /* @__PURE__ */ jsx18(View13, { style: [styles13.slateLine, { backgroundColor: foreground, top: 4 + index * 8 }] }, index)) : null
|
|
1792
2033
|
] });
|
|
1793
2034
|
}
|
|
1794
2035
|
var styles13 = StyleSheet14.create({
|
|
@@ -1815,77 +2056,77 @@ var styles13 = StyleSheet14.create({
|
|
|
1815
2056
|
});
|
|
1816
2057
|
|
|
1817
2058
|
// src/components/native-space-view/SettingsSheet.tsx
|
|
1818
|
-
import { jsx as
|
|
2059
|
+
import { jsx as jsx19, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1819
2060
|
function SettingsSheet({ controller, isOpen, onClose }) {
|
|
1820
|
-
const [tab, setTab] =
|
|
1821
|
-
|
|
2061
|
+
const [tab, setTab] = useState5("devices");
|
|
2062
|
+
useEffect5(() => {
|
|
1822
2063
|
if (!isOpen) setTab("devices");
|
|
1823
2064
|
}, [isOpen]);
|
|
1824
|
-
return /* @__PURE__ */
|
|
1825
|
-
/* @__PURE__ */
|
|
1826
|
-
/* @__PURE__ */
|
|
1827
|
-
/* @__PURE__ */
|
|
1828
|
-
/* @__PURE__ */
|
|
1829
|
-
/* @__PURE__ */
|
|
1830
|
-
/* @__PURE__ */
|
|
2065
|
+
return /* @__PURE__ */ jsx19(Modal3, { animationType: "slide", onRequestClose: onClose, transparent: true, visible: isOpen, children: /* @__PURE__ */ jsxs13(View14, { style: styles14.modalRoot, children: [
|
|
2066
|
+
/* @__PURE__ */ jsx19(Pressable8, { accessibilityLabel: "Close Settings", onPress: onClose, style: styles14.backdrop }),
|
|
2067
|
+
/* @__PURE__ */ jsxs13(View14, { style: styles14.sheet, children: [
|
|
2068
|
+
/* @__PURE__ */ jsx19(SheetGrip, {}),
|
|
2069
|
+
/* @__PURE__ */ jsxs13(View14, { style: styles14.header, children: [
|
|
2070
|
+
/* @__PURE__ */ jsx19(Text10, { style: styles14.title, children: "Settings" }),
|
|
2071
|
+
/* @__PURE__ */ jsx19(CloseButton, { label: "Close Settings", onPress: onClose })
|
|
1831
2072
|
] }),
|
|
1832
|
-
/* @__PURE__ */
|
|
1833
|
-
/* @__PURE__ */
|
|
1834
|
-
tab === "devices" ? /* @__PURE__ */
|
|
1835
|
-
tab === "appearance" ? /* @__PURE__ */
|
|
1836
|
-
tab === "space" ? /* @__PURE__ */
|
|
2073
|
+
/* @__PURE__ */ jsx19(View14, { accessibilityRole: "tablist", style: styles14.tabs, children: ["devices", "appearance", "space"].map((nextTab) => /* @__PURE__ */ jsx19(Pressable8, { accessibilityRole: "tab", accessibilityState: { selected: tab === nextTab }, onPress: () => setTab(nextTab), style: ({ pressed }) => [styles14.tab, tab === nextTab && styles14.tabSelected, pressed && styles14.pressed], children: /* @__PURE__ */ jsx19(Text10, { style: [styles14.tabText, tab === nextTab && styles14.tabTextSelected], children: nextTab[0].toUpperCase() + nextTab.slice(1) }) }, nextTab)) }),
|
|
2074
|
+
/* @__PURE__ */ jsxs13(ScrollView, { contentContainerStyle: styles14.content, showsVerticalScrollIndicator: false, children: [
|
|
2075
|
+
tab === "devices" ? /* @__PURE__ */ jsx19(DevicesSettings, { controller }) : null,
|
|
2076
|
+
tab === "appearance" ? /* @__PURE__ */ jsx19(AppearanceSettings, {}) : null,
|
|
2077
|
+
tab === "space" ? /* @__PURE__ */ jsx19(SpaceSettings, { controller }) : null
|
|
1837
2078
|
] }),
|
|
1838
|
-
/* @__PURE__ */
|
|
2079
|
+
/* @__PURE__ */ jsx19(Pressable8, { accessibilityRole: "button", onPress: onClose, style: ({ pressed }) => [styles14.doneButton, pressed && styles14.pressed], children: /* @__PURE__ */ jsx19(Text10, { style: styles14.doneText, children: "Done" }) })
|
|
1839
2080
|
] })
|
|
1840
2081
|
] }) });
|
|
1841
2082
|
}
|
|
1842
2083
|
function DevicesSettings({ controller }) {
|
|
1843
2084
|
const microphoneEnabled = !controller.isMuted;
|
|
1844
2085
|
const cameraEnabled = !controller.isCameraOff;
|
|
1845
|
-
return /* @__PURE__ */
|
|
1846
|
-
/* @__PURE__ */
|
|
1847
|
-
/* @__PURE__ */
|
|
1848
|
-
/* @__PURE__ */
|
|
1849
|
-
/* @__PURE__ */
|
|
1850
|
-
/* @__PURE__ */
|
|
1851
|
-
/* @__PURE__ */
|
|
1852
|
-
/* @__PURE__ */
|
|
1853
|
-
/* @__PURE__ */
|
|
2086
|
+
return /* @__PURE__ */ jsxs13(View14, { style: styles14.section, children: [
|
|
2087
|
+
/* @__PURE__ */ jsx19(Text10, { style: styles14.sectionIntro, children: "Use the controls below to set what you share in this Episode." }),
|
|
2088
|
+
/* @__PURE__ */ jsx19(DeviceControl, { disabled: controller.simulatorMediaDisabled, enabled: microphoneEnabled, icon: microphoneEnabled ? Mic01Icon2 : MicOff01Icon4, label: "Microphone", onPress: controller.toggleAudio, value: microphoneEnabled ? "On" : "Off" }),
|
|
2089
|
+
/* @__PURE__ */ jsx19(DeviceControl, { disabled: controller.simulatorMediaDisabled, enabled: cameraEnabled, icon: cameraEnabled ? Video01Icon2 : VideoOffIcon2, label: "Camera", onPress: controller.toggleVideo, value: cameraEnabled ? "On" : "Off" }),
|
|
2090
|
+
/* @__PURE__ */ jsxs13(View14, { style: styles14.deviceRow, children: [
|
|
2091
|
+
/* @__PURE__ */ jsx19(IconTile, { icon: Speaker01Icon }),
|
|
2092
|
+
/* @__PURE__ */ jsxs13(View14, { style: styles14.rowCopy, children: [
|
|
2093
|
+
/* @__PURE__ */ jsx19(Text10, { style: styles14.rowLabel, children: "Speaker" }),
|
|
2094
|
+
/* @__PURE__ */ jsx19(Text10, { style: styles14.rowMeta, children: "System audio output" })
|
|
1854
2095
|
] }),
|
|
1855
|
-
/* @__PURE__ */
|
|
2096
|
+
/* @__PURE__ */ jsx19(Text10, { style: styles14.rowValue, children: "Automatic" })
|
|
1856
2097
|
] }),
|
|
1857
|
-
/* @__PURE__ */
|
|
1858
|
-
/* @__PURE__ */
|
|
1859
|
-
/* @__PURE__ */
|
|
2098
|
+
/* @__PURE__ */ jsxs13(View14, { style: styles14.readyCard, children: [
|
|
2099
|
+
/* @__PURE__ */ jsx19(HugeiconsIcon7, { color: Theme.colors.success, icon: CheckmarkCircle01Icon2, size: 22 }),
|
|
2100
|
+
/* @__PURE__ */ jsx19(Text10, { style: styles14.readyText, children: controller.simulatorMediaDisabled ? "Device controls are unavailable here" : "Devices are ready" })
|
|
1860
2101
|
] })
|
|
1861
2102
|
] });
|
|
1862
2103
|
}
|
|
1863
2104
|
function DeviceControl({ disabled, enabled, icon, label, onPress, value }) {
|
|
1864
|
-
return /* @__PURE__ */
|
|
1865
|
-
/* @__PURE__ */
|
|
1866
|
-
/* @__PURE__ */
|
|
1867
|
-
/* @__PURE__ */
|
|
1868
|
-
/* @__PURE__ */
|
|
2105
|
+
return /* @__PURE__ */ jsxs13(Pressable8, { accessibilityLabel: `${label} ${value}`, accessibilityRole: "button", disabled, onPress, style: ({ pressed }) => [styles14.deviceRow, disabled && styles14.disabled, pressed && styles14.pressed], children: [
|
|
2106
|
+
/* @__PURE__ */ jsx19(IconTile, { icon, color: enabled ? Theme.colors.ink : Theme.colors.error, wash: enabled ? Theme.colors.surface : Theme.colors.washPink }),
|
|
2107
|
+
/* @__PURE__ */ jsxs13(View14, { style: styles14.rowCopy, children: [
|
|
2108
|
+
/* @__PURE__ */ jsx19(Text10, { style: styles14.rowLabel, children: label }),
|
|
2109
|
+
/* @__PURE__ */ jsx19(Text10, { style: styles14.rowMeta, children: disabled ? "Unavailable on this device" : "Tap to change state" })
|
|
1869
2110
|
] }),
|
|
1870
|
-
/* @__PURE__ */
|
|
2111
|
+
/* @__PURE__ */ jsx19(Text10, { style: [styles14.rowValue, !enabled && styles14.valueOff], children: value })
|
|
1871
2112
|
] });
|
|
1872
2113
|
}
|
|
1873
2114
|
function SpaceSettings({ controller }) {
|
|
1874
|
-
return /* @__PURE__ */
|
|
1875
|
-
/* @__PURE__ */
|
|
1876
|
-
/* @__PURE__ */
|
|
1877
|
-
/* @__PURE__ */
|
|
1878
|
-
/* @__PURE__ */
|
|
1879
|
-
/* @__PURE__ */
|
|
1880
|
-
/* @__PURE__ */
|
|
1881
|
-
/* @__PURE__ */
|
|
2115
|
+
return /* @__PURE__ */ jsxs13(View14, { style: styles14.section, children: [
|
|
2116
|
+
/* @__PURE__ */ jsx19(Text10, { style: styles14.sectionIntro, children: "Canonical information about this Space and its current Episode." }),
|
|
2117
|
+
/* @__PURE__ */ jsx19(InfoRow, { label: "Space", value: "Current Space" }),
|
|
2118
|
+
/* @__PURE__ */ jsx19(InfoRow, { label: "Episode", value: controller.formattedDuration }),
|
|
2119
|
+
/* @__PURE__ */ jsx19(InfoRow, { label: "People", value: String(controller.participantCount) }),
|
|
2120
|
+
/* @__PURE__ */ jsxs13(View14, { style: styles14.infoCard, children: [
|
|
2121
|
+
/* @__PURE__ */ jsx19(Text10, { style: styles14.infoTitle, children: "Space content stays here" }),
|
|
2122
|
+
/* @__PURE__ */ jsx19(Text10, { style: styles14.infoText, children: "Chat and Board content belong to this Space and remain available across Episodes." })
|
|
1882
2123
|
] })
|
|
1883
2124
|
] });
|
|
1884
2125
|
}
|
|
1885
2126
|
function InfoRow({ label, value }) {
|
|
1886
|
-
return /* @__PURE__ */
|
|
1887
|
-
/* @__PURE__ */
|
|
1888
|
-
/* @__PURE__ */
|
|
2127
|
+
return /* @__PURE__ */ jsxs13(View14, { style: styles14.infoRow, children: [
|
|
2128
|
+
/* @__PURE__ */ jsx19(Text10, { style: styles14.rowLabel, children: label }),
|
|
2129
|
+
/* @__PURE__ */ jsx19(Text10, { numberOfLines: 1, style: styles14.infoValue, children: value || "\u2014" })
|
|
1889
2130
|
] });
|
|
1890
2131
|
}
|
|
1891
2132
|
var styles14 = StyleSheet15.create({
|
|
@@ -1936,14 +2177,14 @@ var styles14 = StyleSheet15.create({
|
|
|
1936
2177
|
});
|
|
1937
2178
|
|
|
1938
2179
|
// src/components/native-space-view/SpacePanelSheet.tsx
|
|
1939
|
-
import { Modal as Modal5, Platform as Platform9, Pressable as
|
|
2180
|
+
import { Modal as Modal5, Platform as Platform9, Pressable as Pressable12, SafeAreaView, StyleSheet as StyleSheet19, View as View18 } from "react-native";
|
|
1940
2181
|
|
|
1941
2182
|
// src/components/native-space-view/SpaceChatSheet.tsx
|
|
1942
2183
|
import Message01Icon from "@hugeicons/core-free-icons/dist/esm/Message01Icon";
|
|
1943
2184
|
import Navigation03Icon from "@hugeicons/core-free-icons/dist/esm/Navigation03Icon";
|
|
1944
2185
|
import { HugeiconsIcon as HugeiconsIcon8 } from "@hugeicons/react-native";
|
|
1945
2186
|
import { useMemo as useMemo9 } from "react";
|
|
1946
|
-
import { FlatList as FlatList3, KeyboardAvoidingView, Platform as Platform7, Pressable as
|
|
2187
|
+
import { FlatList as FlatList3, KeyboardAvoidingView, Platform as Platform7, Pressable as Pressable9, StyleSheet as StyleSheet16, Text as Text11, TextInput, View as View15 } from "react-native";
|
|
1947
2188
|
|
|
1948
2189
|
// src/components/native-space-view/space-progressive-surface-helpers.ts
|
|
1949
2190
|
function buildParticipantActionDescriptors(availability) {
|
|
@@ -1964,52 +2205,52 @@ function formatChatTimestamp(timestamp) {
|
|
|
1964
2205
|
}
|
|
1965
2206
|
|
|
1966
2207
|
// src/components/native-space-view/SpaceChatSheet.tsx
|
|
1967
|
-
import { jsx as
|
|
2208
|
+
import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1968
2209
|
function SpaceChatSheet({ controller }) {
|
|
1969
2210
|
const localParticipantId = controller.participants.localParticipant?.id ?? null;
|
|
1970
2211
|
const sendDisabled = !controller.chatDraft.trim() && controller.chatAttachments.length === 0 || controller.chatAttachmentUploading;
|
|
1971
2212
|
const messages = useMemo9(() => controller.chat.messages, [controller.chat.messages]);
|
|
1972
|
-
return /* @__PURE__ */
|
|
1973
|
-
controller.chat.hasMore ? /* @__PURE__ */
|
|
1974
|
-
/* @__PURE__ */
|
|
2213
|
+
return /* @__PURE__ */ jsxs14(View15, { style: styles15.content, children: [
|
|
2214
|
+
controller.chat.hasMore ? /* @__PURE__ */ jsx20(Pressable9, { accessibilityRole: "button", disabled: controller.chat.isLoadingOlder, onPress: () => void controller.chat.loadOlderMessages(), style: ({ pressed }) => [styles15.loadOlder, pressed && styles15.pressed], children: /* @__PURE__ */ jsx20(Text11, { style: styles15.loadOlderText, children: controller.chat.isLoadingOlder ? "Loading\u2026" : "Load earlier messages" }) }) : null,
|
|
2215
|
+
/* @__PURE__ */ jsx20(
|
|
1975
2216
|
FlatList3,
|
|
1976
2217
|
{
|
|
1977
2218
|
accessibilityLabel: "Chat messages",
|
|
1978
2219
|
contentContainerStyle: styles15.messageList,
|
|
1979
2220
|
data: messages,
|
|
1980
2221
|
keyExtractor: (message) => message.id,
|
|
1981
|
-
ListEmptyComponent: /* @__PURE__ */
|
|
2222
|
+
ListEmptyComponent: /* @__PURE__ */ jsx20(EmptyChat, {}),
|
|
1982
2223
|
onViewableItemsChanged: ({ viewableItems }) => {
|
|
1983
2224
|
const sequence = viewableItems.at(-1)?.item.sequence;
|
|
1984
2225
|
if (sequence) controller.markChatMessageVisible(sequence);
|
|
1985
2226
|
},
|
|
1986
|
-
renderItem: ({ item }) => /* @__PURE__ */
|
|
2227
|
+
renderItem: ({ item }) => /* @__PURE__ */ jsx20(ChatMessage, { isLocal: item.senderId === localParticipantId, message: item, onOpenAttachment: controller.openChatAttachment }),
|
|
1987
2228
|
showsVerticalScrollIndicator: false
|
|
1988
2229
|
}
|
|
1989
2230
|
),
|
|
1990
|
-
controller.chat.pendingMessages.map((message) => /* @__PURE__ */
|
|
1991
|
-
/* @__PURE__ */
|
|
1992
|
-
/* @__PURE__ */
|
|
1993
|
-
message.state === "failed" ? /* @__PURE__ */
|
|
2231
|
+
controller.chat.pendingMessages.map((message) => /* @__PURE__ */ jsxs14(View15, { style: styles15.pendingMessage, children: [
|
|
2232
|
+
/* @__PURE__ */ jsx20(Text11, { style: styles15.pendingText, children: message.text }),
|
|
2233
|
+
/* @__PURE__ */ jsx20(Text11, { style: styles15.pendingMeta, children: message.state === "sending" ? "Sending\u2026" : message.error?.message ?? "Send failed" }),
|
|
2234
|
+
message.state === "failed" ? /* @__PURE__ */ jsx20(Pressable9, { accessibilityRole: "button", onPress: () => void controller.chat.retryMessage(message.clientMessageId), children: /* @__PURE__ */ jsx20(Text11, { style: styles15.retry, children: "Retry" }) }) : null
|
|
1994
2235
|
] }, message.clientMessageId)),
|
|
1995
|
-
controller.chatAttachments.length ? /* @__PURE__ */
|
|
1996
|
-
/* @__PURE__ */
|
|
1997
|
-
/* @__PURE__ */
|
|
2236
|
+
controller.chatAttachments.length ? /* @__PURE__ */ jsx20(View15, { accessibilityLabel: "Selected attachments", style: styles15.selectedAttachments, children: controller.chatAttachments.map((attachment, index) => /* @__PURE__ */ jsxs14(View15, { style: styles15.selectedAttachment, children: [
|
|
2237
|
+
/* @__PURE__ */ jsx20(Text11, { numberOfLines: 1, style: styles15.selectedAttachmentText, children: attachment.fileName }),
|
|
2238
|
+
/* @__PURE__ */ jsx20(Pressable9, { accessibilityLabel: `Remove ${attachment.fileName}`, accessibilityRole: "button", disabled: controller.chatAttachmentUploading, onPress: () => controller.removeChatAttachment(index), children: /* @__PURE__ */ jsx20(Text11, { style: styles15.removeAttachment, children: "Remove" }) })
|
|
1998
2239
|
] }, `${attachment.fileName}-${index}`)) }) : null,
|
|
1999
|
-
controller.chatAttachmentError ? /* @__PURE__ */
|
|
2000
|
-
/* @__PURE__ */
|
|
2001
|
-
controller.canPickChatFiles ? /* @__PURE__ */
|
|
2002
|
-
|
|
2240
|
+
controller.chatAttachmentError ? /* @__PURE__ */ jsx20(Text11, { accessibilityLiveRegion: "polite", style: styles15.attachmentError, children: controller.chatAttachmentError }) : null,
|
|
2241
|
+
/* @__PURE__ */ jsx20(KeyboardAvoidingView, { behavior: Platform7.OS === "ios" ? "padding" : void 0, keyboardVerticalOffset: Platform7.OS === "ios" ? 12 : 0, children: /* @__PURE__ */ jsxs14(View15, { style: styles15.composer, children: [
|
|
2242
|
+
controller.canPickChatFiles ? /* @__PURE__ */ jsx20(
|
|
2243
|
+
Pressable9,
|
|
2003
2244
|
{
|
|
2004
2245
|
accessibilityLabel: "Attach file",
|
|
2005
2246
|
accessibilityRole: "button",
|
|
2006
2247
|
disabled: controller.chatAttachmentPicking || controller.chatAttachmentUploading,
|
|
2007
2248
|
onPress: () => void controller.pickChatFiles(),
|
|
2008
2249
|
style: ({ pressed }) => [styles15.composerButton, (controller.chatAttachmentPicking || controller.chatAttachmentUploading) && styles15.sendDisabled, pressed && styles15.pressed],
|
|
2009
|
-
children: /* @__PURE__ */
|
|
2250
|
+
children: /* @__PURE__ */ jsx20(Text11, { style: styles15.composerButtonText, children: controller.chatAttachmentPicking ? "Choosing\u2026" : "Attach" })
|
|
2010
2251
|
}
|
|
2011
2252
|
) : null,
|
|
2012
|
-
/* @__PURE__ */
|
|
2253
|
+
/* @__PURE__ */ jsx20(
|
|
2013
2254
|
TextInput,
|
|
2014
2255
|
{
|
|
2015
2256
|
accessibilityLabel: "Message the Space",
|
|
@@ -2023,34 +2264,34 @@ function SpaceChatSheet({ controller }) {
|
|
|
2023
2264
|
value: controller.chatDraft
|
|
2024
2265
|
}
|
|
2025
2266
|
),
|
|
2026
|
-
/* @__PURE__ */
|
|
2267
|
+
/* @__PURE__ */ jsx20(Pressable9, { accessibilityLabel: "Send message", accessibilityRole: "button", disabled: sendDisabled, onPress: controller.sendChatMessage, style: ({ pressed }) => [styles15.sendButton, sendDisabled && styles15.sendDisabled, pressed && styles15.pressed], children: controller.chatAttachmentUploading ? /* @__PURE__ */ jsx20(Text11, { style: styles15.uploadingText, children: "\u2026" }) : /* @__PURE__ */ jsx20(HugeiconsIcon8, { color: Theme.colors.primaryForeground, icon: Navigation03Icon, size: 21 }) })
|
|
2027
2268
|
] }) })
|
|
2028
2269
|
] });
|
|
2029
2270
|
}
|
|
2030
2271
|
function ChatMessage({ isLocal, message, onOpenAttachment }) {
|
|
2031
2272
|
const timestamp = formatChatTimestamp(message.timestamp);
|
|
2032
|
-
return /* @__PURE__ */
|
|
2033
|
-
!isLocal ? /* @__PURE__ */
|
|
2034
|
-
/* @__PURE__ */
|
|
2035
|
-
/* @__PURE__ */
|
|
2036
|
-
/* @__PURE__ */
|
|
2037
|
-
message.text ? /* @__PURE__ */
|
|
2038
|
-
message.attachments.map((attachment) => /* @__PURE__ */
|
|
2273
|
+
return /* @__PURE__ */ jsxs14(View15, { style: [styles15.messageRow, isLocal && styles15.messageRowLocal], children: [
|
|
2274
|
+
!isLocal ? /* @__PURE__ */ jsx20(InitialsAvatar, { name: message.senderName, size: 42 }) : null,
|
|
2275
|
+
/* @__PURE__ */ jsxs14(View15, { style: [styles15.messageCopy, isLocal && styles15.messageCopyLocal], children: [
|
|
2276
|
+
/* @__PURE__ */ jsx20(Text11, { style: [styles15.sender, isLocal && styles15.senderLocal], children: isLocal ? `${message.senderName} (You)` : message.senderName }),
|
|
2277
|
+
/* @__PURE__ */ jsxs14(View15, { style: [styles15.bubble, isLocal ? styles15.localBubble : styles15.remoteBubble], children: [
|
|
2278
|
+
message.text ? /* @__PURE__ */ jsx20(Text11, { style: [styles15.messageText, isLocal && styles15.localMessageText], children: message.text }) : null,
|
|
2279
|
+
message.attachments.map((attachment) => /* @__PURE__ */ jsx20(Pressable9, { accessibilityRole: "link", onPress: () => onOpenAttachment(attachment.attachmentId), style: ({ pressed }) => [styles15.attachmentLink, pressed && styles15.pressed], children: /* @__PURE__ */ jsx20(Text11, { numberOfLines: 1, style: [styles15.attachment, isLocal && styles15.localMessageText], children: attachment.fileName }) }, attachment.attachmentId))
|
|
2039
2280
|
] }),
|
|
2040
|
-
/* @__PURE__ */
|
|
2041
|
-
message.readBy.length ? /* @__PURE__ */
|
|
2281
|
+
/* @__PURE__ */ jsx20(Text11, { style: [styles15.timestamp, isLocal && styles15.timestampLocal], children: timestamp }),
|
|
2282
|
+
message.readBy.length ? /* @__PURE__ */ jsxs14(Text11, { style: [styles15.readBy, isLocal && styles15.timestampLocal], children: [
|
|
2042
2283
|
"Read by ",
|
|
2043
2284
|
message.readBy.map((reader) => reader.displayName).join(", ")
|
|
2044
2285
|
] }) : null
|
|
2045
2286
|
] }),
|
|
2046
|
-
isLocal ? /* @__PURE__ */
|
|
2287
|
+
isLocal ? /* @__PURE__ */ jsx20(InitialsAvatar, { name: message.senderName, size: 42 }) : null
|
|
2047
2288
|
] });
|
|
2048
2289
|
}
|
|
2049
2290
|
function EmptyChat() {
|
|
2050
|
-
return /* @__PURE__ */
|
|
2051
|
-
/* @__PURE__ */
|
|
2052
|
-
/* @__PURE__ */
|
|
2053
|
-
/* @__PURE__ */
|
|
2291
|
+
return /* @__PURE__ */ jsxs14(View15, { style: styles15.emptyState, children: [
|
|
2292
|
+
/* @__PURE__ */ jsx20(View15, { style: styles15.emptyIcon, children: /* @__PURE__ */ jsx20(HugeiconsIcon8, { color: Theme.colors.ink2, icon: Message01Icon, size: 26 }) }),
|
|
2293
|
+
/* @__PURE__ */ jsx20(Text11, { style: styles15.emptyTitle, children: "No messages yet" }),
|
|
2294
|
+
/* @__PURE__ */ jsx20(Text11, { style: styles15.emptyText, children: "Send a message to start the conversation." })
|
|
2054
2295
|
] });
|
|
2055
2296
|
}
|
|
2056
2297
|
var styles15 = StyleSheet16.create({
|
|
@@ -2104,8 +2345,8 @@ import MoreHorizontalIcon2 from "@hugeicons/core-free-icons/dist/esm/MoreHorizon
|
|
|
2104
2345
|
import Video01Icon4 from "@hugeicons/core-free-icons/dist/esm/Video01Icon";
|
|
2105
2346
|
import VideoOffIcon3 from "@hugeicons/core-free-icons/dist/esm/VideoOffIcon";
|
|
2106
2347
|
import { HugeiconsIcon as HugeiconsIcon10 } from "@hugeicons/react-native";
|
|
2107
|
-
import { useState as
|
|
2108
|
-
import { Pressable as
|
|
2348
|
+
import { useState as useState6 } from "react";
|
|
2349
|
+
import { Pressable as Pressable11, ScrollView as ScrollView2, StyleSheet as StyleSheet18, Text as Text13, View as View17 } from "react-native";
|
|
2109
2350
|
|
|
2110
2351
|
// src/components/native-space-view/ParticipantActionSheet.tsx
|
|
2111
2352
|
import CancelCircleIcon from "@hugeicons/core-free-icons/dist/esm/CancelCircleIcon";
|
|
@@ -2113,8 +2354,8 @@ import MicOff01Icon5 from "@hugeicons/core-free-icons/dist/esm/MicOff01Icon";
|
|
|
2113
2354
|
import UserIcon from "@hugeicons/core-free-icons/dist/esm/UserIcon";
|
|
2114
2355
|
import Video01Icon3 from "@hugeicons/core-free-icons/dist/esm/Video01Icon";
|
|
2115
2356
|
import { HugeiconsIcon as HugeiconsIcon9 } from "@hugeicons/react-native";
|
|
2116
|
-
import { Modal as Modal4, Platform as Platform8, Pressable as
|
|
2117
|
-
import { jsx as
|
|
2357
|
+
import { Modal as Modal4, Platform as Platform8, Pressable as Pressable10, StyleSheet as StyleSheet17, Text as Text12, View as View16 } from "react-native";
|
|
2358
|
+
import { jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2118
2359
|
function ParticipantActionSheet({ controller, participantId, onClose }) {
|
|
2119
2360
|
const participant = participantId ? controller.participants.participants.find((item) => item.id === participantId) : void 0;
|
|
2120
2361
|
const descriptors = buildParticipantActionDescriptors({
|
|
@@ -2134,28 +2375,28 @@ function ParticipantActionSheet({ controller, participantId, onClose }) {
|
|
|
2134
2375
|
if (descriptor.kind === "stopScreenShare") controller.stopParticipantScreenShare(participantId);
|
|
2135
2376
|
if (descriptor.kind === "remove") controller.removeParticipant(participantId);
|
|
2136
2377
|
};
|
|
2137
|
-
return /* @__PURE__ */
|
|
2138
|
-
/* @__PURE__ */
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
2141
|
-
participant ? /* @__PURE__ */
|
|
2142
|
-
/* @__PURE__ */
|
|
2143
|
-
/* @__PURE__ */
|
|
2378
|
+
return /* @__PURE__ */ jsx21(Modal4, { animationType: "fade", onRequestClose: onClose, transparent: true, visible: participantId !== null, children: /* @__PURE__ */ jsxs15(View16, { style: styles16.modalRoot, children: [
|
|
2379
|
+
/* @__PURE__ */ jsx21(Pressable10, { accessibilityLabel: "Close Participant actions", onPress: onClose, style: styles16.backdrop }),
|
|
2380
|
+
/* @__PURE__ */ jsxs15(View16, { style: styles16.card, children: [
|
|
2381
|
+
/* @__PURE__ */ jsxs15(View16, { style: styles16.cardHeader, children: [
|
|
2382
|
+
participant ? /* @__PURE__ */ jsx21(InitialsAvatar, { name: participant.displayName, size: 44 }) : /* @__PURE__ */ jsx21(IconTile, { icon: UserIcon }),
|
|
2383
|
+
/* @__PURE__ */ jsx21(View16, { style: styles16.headerCopy, children: /* @__PURE__ */ jsx21(Text12, { numberOfLines: 1, style: styles16.name, children: participant?.displayName ?? "Participant" }) }),
|
|
2384
|
+
/* @__PURE__ */ jsx21(CloseButton, { label: "Close Participant actions", onPress: onClose })
|
|
2144
2385
|
] }),
|
|
2145
|
-
/* @__PURE__ */
|
|
2146
|
-
descriptors.filter((descriptor) => !descriptor.destructive).map((descriptor) => /* @__PURE__ */
|
|
2147
|
-
descriptors.some((descriptor) => descriptor.destructive) ? /* @__PURE__ */
|
|
2148
|
-
descriptors.filter((descriptor) => descriptor.destructive).map((descriptor) => /* @__PURE__ */
|
|
2386
|
+
/* @__PURE__ */ jsxs15(View16, { style: styles16.actions, children: [
|
|
2387
|
+
descriptors.filter((descriptor) => !descriptor.destructive).map((descriptor) => /* @__PURE__ */ jsx21(ParticipantActionRow, { descriptor, onPress: () => run(descriptor) }, descriptor.kind)),
|
|
2388
|
+
descriptors.some((descriptor) => descriptor.destructive) ? /* @__PURE__ */ jsx21(View16, { style: styles16.divider }) : null,
|
|
2389
|
+
descriptors.filter((descriptor) => descriptor.destructive).map((descriptor) => /* @__PURE__ */ jsx21(ParticipantActionRow, { descriptor, onPress: () => run(descriptor) }, descriptor.kind))
|
|
2149
2390
|
] }),
|
|
2150
|
-
!descriptors.length ? /* @__PURE__ */
|
|
2391
|
+
!descriptors.length ? /* @__PURE__ */ jsx21(Text12, { style: styles16.emptyText, children: "No actions are available for this Participant." }) : null
|
|
2151
2392
|
] })
|
|
2152
2393
|
] }) });
|
|
2153
2394
|
}
|
|
2154
2395
|
function ParticipantActionRow({ descriptor, onPress }) {
|
|
2155
2396
|
const icon = descriptor.kind === "mute" || descriptor.kind === "requestUnmute" ? MicOff01Icon5 : descriptor.kind === "requestCamera" || descriptor.kind === "stopCamera" ? Video01Icon3 : CancelCircleIcon;
|
|
2156
|
-
return /* @__PURE__ */
|
|
2157
|
-
/* @__PURE__ */
|
|
2158
|
-
/* @__PURE__ */
|
|
2397
|
+
return /* @__PURE__ */ jsxs15(Pressable10, { accessibilityLabel: descriptor.label, accessibilityRole: "button", onPress, style: ({ pressed }) => [styles16.actionRow, descriptor.destructive && styles16.destructiveRow, pressed && styles16.pressed], children: [
|
|
2398
|
+
/* @__PURE__ */ jsx21(HugeiconsIcon9, { color: descriptor.destructive ? Theme.colors.error : Theme.colors.ink, icon, size: 21 }),
|
|
2399
|
+
/* @__PURE__ */ jsx21(Text12, { style: [styles16.actionLabel, descriptor.destructive && styles16.destructiveText], children: descriptor.label })
|
|
2159
2400
|
] });
|
|
2160
2401
|
}
|
|
2161
2402
|
var styles16 = StyleSheet17.create({
|
|
@@ -2176,60 +2417,60 @@ var styles16 = StyleSheet17.create({
|
|
|
2176
2417
|
});
|
|
2177
2418
|
|
|
2178
2419
|
// src/components/native-space-view/SpacePeopleSheet.tsx
|
|
2179
|
-
import { jsx as
|
|
2420
|
+
import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2180
2421
|
function SpacePeopleSheet({ controller }) {
|
|
2181
|
-
const [actionParticipantId, setActionParticipantId] =
|
|
2422
|
+
const [actionParticipantId, setActionParticipantId] = useState6(null);
|
|
2182
2423
|
const closeActions = () => {
|
|
2183
2424
|
setActionParticipantId(null);
|
|
2184
2425
|
};
|
|
2185
2426
|
const openActions = (participantId) => {
|
|
2186
2427
|
setActionParticipantId(participantId);
|
|
2187
2428
|
};
|
|
2188
|
-
return /* @__PURE__ */
|
|
2189
|
-
/* @__PURE__ */
|
|
2190
|
-
controller.admissionRequests.map((request) => /* @__PURE__ */
|
|
2191
|
-
/* @__PURE__ */
|
|
2192
|
-
/* @__PURE__ */
|
|
2193
|
-
/* @__PURE__ */
|
|
2194
|
-
/* @__PURE__ */
|
|
2429
|
+
return /* @__PURE__ */ jsxs16(View17, { style: styles17.content, children: [
|
|
2430
|
+
/* @__PURE__ */ jsxs16(ScrollView2, { contentContainerStyle: styles17.list, showsVerticalScrollIndicator: false, children: [
|
|
2431
|
+
controller.admissionRequests.map((request) => /* @__PURE__ */ jsxs16(View17, { style: styles17.admissionRequest, children: [
|
|
2432
|
+
/* @__PURE__ */ jsx22(InitialsAvatar, { name: request.displayName, size: 48 }),
|
|
2433
|
+
/* @__PURE__ */ jsxs16(View17, { style: styles17.rowCopy, children: [
|
|
2434
|
+
/* @__PURE__ */ jsx22(Text13, { numberOfLines: 1, style: styles17.name, children: request.displayName }),
|
|
2435
|
+
/* @__PURE__ */ jsx22(Text13, { style: styles17.meta, children: "At the Entrance" })
|
|
2195
2436
|
] }),
|
|
2196
|
-
controller.canManageAdmission ? /* @__PURE__ */
|
|
2197
|
-
/* @__PURE__ */
|
|
2198
|
-
/* @__PURE__ */
|
|
2437
|
+
controller.canManageAdmission ? /* @__PURE__ */ jsxs16(View17, { style: styles17.admissionActions, children: [
|
|
2438
|
+
/* @__PURE__ */ jsx22(Pressable11, { accessibilityRole: "button", onPress: () => controller.denyAdmission(request.requestId), style: ({ pressed }) => [styles17.denyButton, pressed && styles17.pressed], children: /* @__PURE__ */ jsx22(Text13, { style: styles17.denyText, children: "Deny" }) }),
|
|
2439
|
+
/* @__PURE__ */ jsx22(Pressable11, { accessibilityRole: "button", onPress: () => controller.admitParticipant(request.requestId), style: ({ pressed }) => [styles17.admitButton, pressed && styles17.pressed], children: /* @__PURE__ */ jsx22(Text13, { style: styles17.admitText, children: "Admit" }) })
|
|
2199
2440
|
] }) : null
|
|
2200
2441
|
] }, request.requestId)),
|
|
2201
2442
|
controller.participants.participants.map((participant) => {
|
|
2202
2443
|
const local = participant.id === controller.participants.localParticipant?.id;
|
|
2203
2444
|
const canAct = !local && canActOnParticipant(controller);
|
|
2204
|
-
return /* @__PURE__ */
|
|
2205
|
-
/* @__PURE__ */
|
|
2206
|
-
/* @__PURE__ */
|
|
2445
|
+
return /* @__PURE__ */ jsxs16(View17, { style: styles17.participantRow, children: [
|
|
2446
|
+
/* @__PURE__ */ jsx22(InitialsAvatar, { name: participant.displayName, size: 54 }),
|
|
2447
|
+
/* @__PURE__ */ jsx22(View17, { style: styles17.rowCopy, children: /* @__PURE__ */ jsxs16(Text13, { numberOfLines: 1, style: styles17.name, children: [
|
|
2207
2448
|
participant.displayName,
|
|
2208
2449
|
local ? " (You)" : ""
|
|
2209
2450
|
] }) }),
|
|
2210
|
-
/* @__PURE__ */
|
|
2211
|
-
/* @__PURE__ */
|
|
2212
|
-
/* @__PURE__ */
|
|
2451
|
+
/* @__PURE__ */ jsxs16(View17, { style: styles17.mediaStatus, children: [
|
|
2452
|
+
/* @__PURE__ */ jsx22(HugeiconsIcon10, { color: participant.audioEnabled ? Theme.colors.success : Theme.colors.error, icon: participant.audioEnabled ? Mic01Icon3 : MicOff01Icon6, size: 22 }),
|
|
2453
|
+
/* @__PURE__ */ jsx22(View17, { style: [styles17.statusDot, { backgroundColor: participant.audioEnabled ? Theme.colors.chalkGreen : Theme.colors.chalkPink }] })
|
|
2213
2454
|
] }),
|
|
2214
|
-
/* @__PURE__ */
|
|
2215
|
-
/* @__PURE__ */
|
|
2216
|
-
/* @__PURE__ */
|
|
2455
|
+
/* @__PURE__ */ jsxs16(View17, { style: styles17.mediaStatus, children: [
|
|
2456
|
+
/* @__PURE__ */ jsx22(HugeiconsIcon10, { color: participant.videoEnabled ? Theme.colors.success : Theme.colors.error, icon: participant.videoEnabled ? Video01Icon4 : VideoOffIcon3, size: 22 }),
|
|
2457
|
+
/* @__PURE__ */ jsx22(View17, { style: [styles17.statusDot, { backgroundColor: participant.videoEnabled ? Theme.colors.chalkGreen : Theme.colors.chalkPink }] })
|
|
2217
2458
|
] }),
|
|
2218
|
-
canAct ? /* @__PURE__ */
|
|
2459
|
+
canAct ? /* @__PURE__ */ jsx22(Pressable11, { accessibilityLabel: `Actions for ${participant.displayName}`, accessibilityRole: "button", onPress: () => openActions(participant.id), style: ({ pressed }) => [styles17.moreButton, pressed && styles17.pressed], children: /* @__PURE__ */ jsx22(HugeiconsIcon10, { color: Theme.colors.ink, icon: MoreHorizontalIcon2, size: 22 }) }) : null
|
|
2219
2460
|
] }, participant.id);
|
|
2220
2461
|
}),
|
|
2221
|
-
!controller.participants.participants.length && !controller.admissionRequests.length ? /* @__PURE__ */
|
|
2462
|
+
!controller.participants.participants.length && !controller.admissionRequests.length ? /* @__PURE__ */ jsx22(EmptyPeople, {}) : null
|
|
2222
2463
|
] }),
|
|
2223
|
-
/* @__PURE__ */
|
|
2464
|
+
/* @__PURE__ */ jsx22(ParticipantActionSheet, { controller, onClose: closeActions, participantId: actionParticipantId })
|
|
2224
2465
|
] });
|
|
2225
2466
|
}
|
|
2226
2467
|
function canActOnParticipant(controller) {
|
|
2227
2468
|
return controller.canMuteParticipants || controller.canRequestMedia || controller.canStopParticipantCamera || controller.canStopParticipantScreenShare || controller.canRemoveParticipants;
|
|
2228
2469
|
}
|
|
2229
2470
|
function EmptyPeople() {
|
|
2230
|
-
return /* @__PURE__ */
|
|
2231
|
-
/* @__PURE__ */
|
|
2232
|
-
/* @__PURE__ */
|
|
2471
|
+
return /* @__PURE__ */ jsxs16(View17, { style: styles17.emptyState, children: [
|
|
2472
|
+
/* @__PURE__ */ jsx22(Text13, { style: styles17.emptyTitle, children: "No People yet" }),
|
|
2473
|
+
/* @__PURE__ */ jsx22(Text13, { style: styles17.emptyText, children: "People will appear here as they join the Space." })
|
|
2233
2474
|
] });
|
|
2234
2475
|
}
|
|
2235
2476
|
var styles17 = StyleSheet18.create({
|
|
@@ -2255,17 +2496,17 @@ var styles17 = StyleSheet18.create({
|
|
|
2255
2496
|
});
|
|
2256
2497
|
|
|
2257
2498
|
// src/components/native-space-view/SpacePanelSheet.tsx
|
|
2258
|
-
import { jsx as
|
|
2499
|
+
import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2259
2500
|
function SpacePanelSheet({ controller }) {
|
|
2260
2501
|
const visible = controller.panel !== null;
|
|
2261
2502
|
const close = controller.closePanel;
|
|
2262
2503
|
const isChat = controller.panel === "chat";
|
|
2263
|
-
return /* @__PURE__ */
|
|
2264
|
-
/* @__PURE__ */
|
|
2265
|
-
/* @__PURE__ */
|
|
2266
|
-
/* @__PURE__ */
|
|
2267
|
-
/* @__PURE__ */
|
|
2268
|
-
isChat ? /* @__PURE__ */
|
|
2504
|
+
return /* @__PURE__ */ jsx23(Modal5, { animationType: "slide", onRequestClose: close, transparent: true, visible, children: /* @__PURE__ */ jsxs17(View18, { style: styles18.modalRoot, children: [
|
|
2505
|
+
/* @__PURE__ */ jsx23(Pressable12, { accessibilityLabel: "Close panel", onPress: close, style: styles18.backdrop }),
|
|
2506
|
+
/* @__PURE__ */ jsxs17(SafeAreaView, { style: styles18.sheet, children: [
|
|
2507
|
+
/* @__PURE__ */ jsx23(SheetGrip, {}),
|
|
2508
|
+
/* @__PURE__ */ jsx23(SurfaceHeader, { closeLabel: `Close ${isChat ? "Chat" : "People"}`, count: !isChat ? controller.participantCount : void 0, onClose: close, title: isChat ? "Chat" : "People" }),
|
|
2509
|
+
isChat ? /* @__PURE__ */ jsx23(SpaceChatSheet, { controller }) : /* @__PURE__ */ jsx23(SpacePeopleSheet, { controller })
|
|
2269
2510
|
] })
|
|
2270
2511
|
] }) });
|
|
2271
2512
|
}
|
|
@@ -2290,7 +2531,7 @@ var styles18 = StyleSheet19.create({
|
|
|
2290
2531
|
});
|
|
2291
2532
|
|
|
2292
2533
|
// src/components/native-space-view/useSpaceViewController.ts
|
|
2293
|
-
import { useCallback as useCallback8, useEffect as
|
|
2534
|
+
import { useCallback as useCallback8, useEffect as useEffect8, useMemo as useMemo12, useState as useState9 } from "react";
|
|
2294
2535
|
import { Alert as Alert2, Linking } from "react-native";
|
|
2295
2536
|
|
|
2296
2537
|
// src/components/native-space-view/diagnostics.ts
|
|
@@ -2427,16 +2668,16 @@ function useSpaceViewDerived({ participants, localParticipant, screenShare, isWh
|
|
|
2427
2668
|
}
|
|
2428
2669
|
|
|
2429
2670
|
// src/components/native-space-view/useSpaceViewPanels.ts
|
|
2430
|
-
import { useCallback as useCallback7, useEffect as
|
|
2671
|
+
import { useCallback as useCallback7, useEffect as useEffect7, useMemo as useMemo11, useRef as useRef4, useState as useState8 } from "react";
|
|
2431
2672
|
import { Alert, Share } from "react-native";
|
|
2432
2673
|
|
|
2433
2674
|
// src/hooks/useLayout.ts
|
|
2434
|
-
import { useCallback as useCallback6, useEffect as
|
|
2675
|
+
import { useCallback as useCallback6, useEffect as useEffect6, useState as useState7 } from "react";
|
|
2435
2676
|
function useLayout({ layout: controlledLayout, onLayoutChange } = {}) {
|
|
2436
|
-
const [uncontrolledLayout, setUncontrolledLayout] =
|
|
2437
|
-
const [isFullscreen, setFullscreen] =
|
|
2677
|
+
const [uncontrolledLayout, setUncontrolledLayout] = useState7(controlledLayout ?? "focus");
|
|
2678
|
+
const [isFullscreen, setFullscreen] = useState7(false);
|
|
2438
2679
|
const layout = controlledLayout ?? uncontrolledLayout;
|
|
2439
|
-
|
|
2680
|
+
useEffect6(() => {
|
|
2440
2681
|
if (controlledLayout) setUncontrolledLayout(controlledLayout);
|
|
2441
2682
|
}, [controlledLayout]);
|
|
2442
2683
|
const setLayout = useCallback6(
|
|
@@ -2462,14 +2703,14 @@ var emptyParticipants = Object.freeze([]);
|
|
|
2462
2703
|
function useSpaceViewPanels({ spaceName, inviteLink, layout: controlledLayout, onLayoutChange, canWhiteboard, canDraw, canClear, canEndEpisode, transport, onLeave, onEndEpisode, run, journeyContext, initialState, controlledState }) {
|
|
2463
2704
|
const fixtureLayout = controlledState?.layout ?? initialState?.layout ?? controlledLayout;
|
|
2464
2705
|
const layout = useLayout({ layout: fixtureLayout, onLayoutChange });
|
|
2465
|
-
const [panel, setPanel] =
|
|
2466
|
-
const [actionsOpen, setActionsOpen] =
|
|
2467
|
-
const [reactionPickerOpen, setReactionPickerOpen] =
|
|
2468
|
-
const [secondsElapsed, setSecondsElapsed] =
|
|
2469
|
-
const [settingsOpen, setSettingsOpen] =
|
|
2470
|
-
const [whiteboardOpen, setWhiteboardOpen] =
|
|
2471
|
-
const generatedJourneyId =
|
|
2472
|
-
|
|
2706
|
+
const [panel, setPanel] = useState8(initialState?.panel ?? null);
|
|
2707
|
+
const [actionsOpen, setActionsOpen] = useState8(initialState?.actionsOpen ?? false);
|
|
2708
|
+
const [reactionPickerOpen, setReactionPickerOpen] = useState8(initialState?.reactionPickerOpen ?? false);
|
|
2709
|
+
const [secondsElapsed, setSecondsElapsed] = useState8(0);
|
|
2710
|
+
const [settingsOpen, setSettingsOpen] = useState8(initialState?.settingsOpen ?? false);
|
|
2711
|
+
const [whiteboardOpen, setWhiteboardOpen] = useState8(initialState?.whiteboardOpen ?? false);
|
|
2712
|
+
const generatedJourneyId = useRef4(globalThis.crypto?.randomUUID?.() ?? `native-whiteboard-${Date.now()}-${Math.random().toString(36).slice(2)}`);
|
|
2713
|
+
useEffect7(() => {
|
|
2473
2714
|
const durationSeconds = Math.max(0, Math.floor(controlledState?.durationSeconds ?? initialState?.durationSeconds ?? 0));
|
|
2474
2715
|
const startedAt = Date.now() - durationSeconds * 1e3;
|
|
2475
2716
|
const update = () => setSecondsElapsed(Math.max(0, Math.floor((Date.now() - startedAt) / 1e3)));
|
|
@@ -2477,7 +2718,7 @@ function useSpaceViewPanels({ spaceName, inviteLink, layout: controlledLayout, o
|
|
|
2477
2718
|
const timer = globalThis.setInterval(update, 1e3);
|
|
2478
2719
|
return () => globalThis.clearInterval(timer);
|
|
2479
2720
|
}, [controlledState?.durationSeconds, initialState?.durationSeconds]);
|
|
2480
|
-
|
|
2721
|
+
useEffect7(() => {
|
|
2481
2722
|
if (controlledState?.panel !== void 0) setPanel(controlledState.panel ?? null);
|
|
2482
2723
|
if (controlledState?.actionsOpen !== void 0) setActionsOpen(controlledState.actionsOpen);
|
|
2483
2724
|
if (controlledState?.reactionPickerOpen !== void 0) setReactionPickerOpen(controlledState.reactionPickerOpen);
|
|
@@ -2602,13 +2843,13 @@ function useSpaceViewController({ spaceName, inviteLink, layout: controlledLayou
|
|
|
2602
2843
|
const reactionSlice = useReactions();
|
|
2603
2844
|
const whiteboardSlice = useWhiteboard();
|
|
2604
2845
|
const journeyContext = getNativeJourneyContext(client);
|
|
2605
|
-
const [actionsOpen, setActionsOpen] =
|
|
2606
|
-
const [reactionPickerOpen, setReactionPickerOpen] =
|
|
2607
|
-
const [chatDraft, setChatDraft] =
|
|
2608
|
-
const [chatAttachments, setChatAttachments] =
|
|
2609
|
-
const [chatAttachmentError, setChatAttachmentError] =
|
|
2610
|
-
const [chatAttachmentPicking, setChatAttachmentPicking] =
|
|
2611
|
-
const [chatAttachmentUploading, setChatAttachmentUploading] =
|
|
2846
|
+
const [actionsOpen, setActionsOpen] = useState9(false);
|
|
2847
|
+
const [reactionPickerOpen, setReactionPickerOpen] = useState9(false);
|
|
2848
|
+
const [chatDraft, setChatDraft] = useState9("");
|
|
2849
|
+
const [chatAttachments, setChatAttachments] = useState9([]);
|
|
2850
|
+
const [chatAttachmentError, setChatAttachmentError] = useState9(null);
|
|
2851
|
+
const [chatAttachmentPicking, setChatAttachmentPicking] = useState9(false);
|
|
2852
|
+
const [chatAttachmentUploading, setChatAttachmentUploading] = useState9(false);
|
|
2612
2853
|
const run = useCallback8(async (action) => {
|
|
2613
2854
|
try {
|
|
2614
2855
|
await action();
|
|
@@ -2777,7 +3018,7 @@ function useSpaceViewController({ spaceName, inviteLink, layout: controlledLayou
|
|
|
2777
3018
|
journeyContext
|
|
2778
3019
|
});
|
|
2779
3020
|
const derived = useSpaceViewDerived({ participants, localParticipant, screenShare, isWhiteboardOpen: spacePanels.whiteboard.isOpen });
|
|
2780
|
-
|
|
3021
|
+
useEffect8(() => {
|
|
2781
3022
|
const request = media.incomingRequests[0];
|
|
2782
3023
|
if (!request) return;
|
|
2783
3024
|
Alert2.alert(request.kind === "unmute" ? "Unmute request" : "Camera request", `${request.actorDisplayName ?? "A Space organizer"} is asking you to ${request.kind === "unmute" ? "unmute" : "start your camera"}.`, [
|
|
@@ -2807,7 +3048,7 @@ function useSpaceViewController({ spaceName, inviteLink, layout: controlledLayou
|
|
|
2807
3048
|
}),
|
|
2808
3049
|
[capabilities, chat.unreadCount, interactionState.raisedHandCount, spaceParticipants.participantCount, screenShare.isActive, screenShare.isLocalSharing, screenShare.sharerParticipantId, screenShareAvailability]
|
|
2809
3050
|
);
|
|
2810
|
-
|
|
3051
|
+
useEffect8(() => onDiagnosticsChange?.(spaceDiagnostics), [onDiagnosticsChange, spaceDiagnostics]);
|
|
2811
3052
|
const pickChatFiles = useCallback8(async () => {
|
|
2812
3053
|
if (!pickChatFilesInput) return;
|
|
2813
3054
|
setChatAttachmentPicking(true);
|
|
@@ -2950,7 +3191,7 @@ function sequenceAtOrAfter(value, floor) {
|
|
|
2950
3191
|
}
|
|
2951
3192
|
|
|
2952
3193
|
// src/components/SpaceView.shared.tsx
|
|
2953
|
-
import { jsx as
|
|
3194
|
+
import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2954
3195
|
function SpaceViewShared(props) {
|
|
2955
3196
|
const controller = useSpaceViewController(props);
|
|
2956
3197
|
const theme = useNativeTheme();
|
|
@@ -2961,10 +3202,10 @@ function SpaceViewShared(props) {
|
|
|
2961
3202
|
}
|
|
2962
3203
|
action();
|
|
2963
3204
|
};
|
|
2964
|
-
return /* @__PURE__ */
|
|
2965
|
-
/* @__PURE__ */
|
|
2966
|
-
props.reconnecting ? /* @__PURE__ */
|
|
2967
|
-
/* @__PURE__ */
|
|
3205
|
+
return /* @__PURE__ */ jsxs18(View19, { style: [styles19.space, { backgroundColor: theme.colors.darkCanvas }], children: [
|
|
3206
|
+
/* @__PURE__ */ jsx24(SpaceTopBarAndroid, { formattedDuration: controller.formattedDuration, logoUrl: props.logoUrl, participantCount: controller.participantCount, spaceName: controller.spaceName }),
|
|
3207
|
+
props.reconnecting ? /* @__PURE__ */ jsx24(View19, { accessibilityLiveRegion: "polite", style: [styles19.recovery, { backgroundColor: theme.colors.primary }], children: /* @__PURE__ */ jsx24(Text14, { style: [styles19.recoveryText, { color: theme.colors.primaryForeground }], children: "Reconnecting\u2026 controls will resume shortly." }) }) : null,
|
|
3208
|
+
/* @__PURE__ */ jsx24(View19, { style: styles19.stage, children: controller.whiteboard.isOpen ? /* @__PURE__ */ jsx24(SpaceWhiteboardSurface, { whiteboard: controller.whiteboard }) : controller.derived.isStageMode || controller.layout.layout !== "grid" ? /* @__PURE__ */ jsx24(
|
|
2968
3209
|
SpaceStageAndroid,
|
|
2969
3210
|
{
|
|
2970
3211
|
activeReactions: controller.activeReactions,
|
|
@@ -2985,8 +3226,8 @@ function SpaceViewShared(props) {
|
|
|
2985
3226
|
participantCount: controller.whiteboard.openParticipants.length
|
|
2986
3227
|
}
|
|
2987
3228
|
}
|
|
2988
|
-
) : /* @__PURE__ */
|
|
2989
|
-
/* @__PURE__ */
|
|
3229
|
+
) : /* @__PURE__ */ jsx24(SpaceGridAndroid, { gridPages: controller.derived.gridPages, participants: controller.derived.allParticipants }) }),
|
|
3230
|
+
/* @__PURE__ */ jsx24(
|
|
2990
3231
|
SpaceBottomDockAndroid,
|
|
2991
3232
|
{
|
|
2992
3233
|
isCameraOff: controller.isCameraOff,
|
|
@@ -3000,9 +3241,9 @@ function SpaceViewShared(props) {
|
|
|
3000
3241
|
unreadChatCount: controller.chat.unreadCount
|
|
3001
3242
|
}
|
|
3002
3243
|
),
|
|
3003
|
-
/* @__PURE__ */
|
|
3004
|
-
controller.panel === "settings" ? /* @__PURE__ */
|
|
3005
|
-
/* @__PURE__ */
|
|
3244
|
+
/* @__PURE__ */ jsx24(SpaceActionMenu, { controller, onOpenDiagnostics: props.onOpenDiagnostics }),
|
|
3245
|
+
controller.panel === "settings" ? /* @__PURE__ */ jsx24(SettingsSheet, { controller, isOpen: true, onClose: controller.closePanel }) : /* @__PURE__ */ jsx24(SpacePanelSheet, { controller }),
|
|
3246
|
+
/* @__PURE__ */ jsx24(ReactionPicker, { isOpen: controller.reactionPickerOpen, onClose: () => controller.setReactionPickerOpen(false), onSelect: (reaction) => selectSpaceReaction(controller, reaction) })
|
|
3006
3247
|
] });
|
|
3007
3248
|
}
|
|
3008
3249
|
var styles19 = StyleSheet20.create({
|
|
@@ -3013,19 +3254,19 @@ var styles19 = StyleSheet20.create({
|
|
|
3013
3254
|
});
|
|
3014
3255
|
|
|
3015
3256
|
// src/components/SpaceView.tsx
|
|
3016
|
-
import { jsx as
|
|
3257
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
3017
3258
|
function SpaceView(props) {
|
|
3018
3259
|
switch (resolvePlatformVariant()) {
|
|
3019
3260
|
case "ios-pad":
|
|
3020
|
-
return /* @__PURE__ */
|
|
3261
|
+
return /* @__PURE__ */ jsx25(SpaceViewShared, { ...props });
|
|
3021
3262
|
case "ios-phone":
|
|
3022
|
-
return /* @__PURE__ */
|
|
3263
|
+
return /* @__PURE__ */ jsx25(SpaceViewShared, { ...props });
|
|
3023
3264
|
case "macos":
|
|
3024
|
-
return /* @__PURE__ */
|
|
3265
|
+
return /* @__PURE__ */ jsx25(SpaceViewShared, { ...props });
|
|
3025
3266
|
case "tvos":
|
|
3026
3267
|
case "android":
|
|
3027
3268
|
default:
|
|
3028
|
-
return /* @__PURE__ */
|
|
3269
|
+
return /* @__PURE__ */ jsx25(SpaceViewShared, { ...props });
|
|
3029
3270
|
}
|
|
3030
3271
|
}
|
|
3031
3272
|
|
|
@@ -3037,7 +3278,7 @@ import UserIcon2 from "@hugeicons/core-free-icons/dist/esm/UserIcon";
|
|
|
3037
3278
|
import Video01Icon5 from "@hugeicons/core-free-icons/dist/esm/Video01Icon";
|
|
3038
3279
|
import VideoOffIcon4 from "@hugeicons/core-free-icons/dist/esm/VideoOffIcon";
|
|
3039
3280
|
import { HugeiconsIcon as HugeiconsIcon11 } from "@hugeicons/react-native";
|
|
3040
|
-
import { KeyboardAvoidingView as KeyboardAvoidingView2, Platform as Platform10, Pressable as
|
|
3281
|
+
import { KeyboardAvoidingView as KeyboardAvoidingView2, Platform as Platform10, Pressable as Pressable13, StyleSheet as StyleSheet21, Text as Text15, TextInput as TextInput2, View as View20 } from "react-native";
|
|
3041
3282
|
|
|
3042
3283
|
// src/components/native-entrance/useEntranceController.ts
|
|
3043
3284
|
import { useMemo as useMemo14, useSyncExternalStore as useSyncExternalStore4 } from "react";
|
|
@@ -3244,26 +3485,26 @@ function useEntranceController({ displayName = "", initialAudioEnabled = false,
|
|
|
3244
3485
|
}
|
|
3245
3486
|
|
|
3246
3487
|
// src/components/EntranceView.android.tsx
|
|
3247
|
-
import { jsx as
|
|
3488
|
+
import { jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3248
3489
|
function EntranceViewAndroid({ spaceName, error, joinDisabled = false, onCancel, ...props }) {
|
|
3249
3490
|
const controller = useEntranceController({ ...props, joinDisabled });
|
|
3250
3491
|
const theme = useNativeTheme();
|
|
3251
3492
|
const canJoin = controller.displayName.trim().length > 0 && !joinDisabled && !controller.isSubmitting;
|
|
3252
|
-
return /* @__PURE__ */
|
|
3253
|
-
/* @__PURE__ */
|
|
3254
|
-
/* @__PURE__ */
|
|
3255
|
-
controller.previewStream && controller.videoEnabled ? /* @__PURE__ */
|
|
3256
|
-
onCancel ? /* @__PURE__ */
|
|
3493
|
+
return /* @__PURE__ */ jsx26(KeyboardAvoidingView2, { behavior: Platform10.OS === "ios" ? "padding" : "height", style: [styles20.screen, { backgroundColor: theme.colors.background }], children: /* @__PURE__ */ jsxs19(View20, { style: styles20.content, children: [
|
|
3494
|
+
/* @__PURE__ */ jsxs19(View20, { style: styles20.previewContainer, children: [
|
|
3495
|
+
/* @__PURE__ */ jsxs19(View20, { style: [styles20.previewSurface, { backgroundColor: theme.colors.raisedSurface, borderColor: theme.colors.border }], children: [
|
|
3496
|
+
controller.previewStream && controller.videoEnabled ? /* @__PURE__ */ jsx26(RTCView, { mirror: true, objectFit: "cover", streamURL: controller.previewStream.toURL(), style: styles20.previewVideo, zOrder: 0 }) : /* @__PURE__ */ jsx26(View20, { style: [styles20.avatarContainer, { backgroundColor: theme.colors.insetSurface }], children: /* @__PURE__ */ jsx26(FaceAvatar, { name: controller.displayName, size: 140, textSize: 52 }) }),
|
|
3497
|
+
onCancel ? /* @__PURE__ */ jsx26(Pressable13, { accessibilityLabel: "Cancel and leave Entrance", accessibilityRole: "button", onPress: onCancel, style: ({ pressed }) => [styles20.floatingBack, { backgroundColor: theme.colors.surface, borderColor: theme.colors.border }, pressed && styles20.topIconButtonPressed], children: /* @__PURE__ */ jsx26(HugeiconsIcon11, { icon: ArrowLeft01Icon, size: 22, color: theme.colors.foreground }) }) : null
|
|
3257
3498
|
] }),
|
|
3258
|
-
controller.previewError && controller.videoEnabled ? /* @__PURE__ */
|
|
3259
|
-
controller.simulatorMediaDisabled ? /* @__PURE__ */
|
|
3499
|
+
controller.previewError && controller.videoEnabled ? /* @__PURE__ */ jsx26(Text15, { style: styles20.previewError, children: controller.previewError }) : null,
|
|
3500
|
+
controller.simulatorMediaDisabled ? /* @__PURE__ */ jsx26(Text15, { style: styles20.previewHint, children: getIosSimulatorMediaMessage() }) : null
|
|
3260
3501
|
] }),
|
|
3261
|
-
/* @__PURE__ */
|
|
3262
|
-
/* @__PURE__ */
|
|
3263
|
-
/* @__PURE__ */
|
|
3264
|
-
/* @__PURE__ */
|
|
3265
|
-
/* @__PURE__ */
|
|
3266
|
-
/* @__PURE__ */
|
|
3502
|
+
/* @__PURE__ */ jsxs19(View20, { style: [styles20.sheetContainer, { backgroundColor: theme.colors.card, borderColor: theme.colors.border, shadowColor: theme.colors.darkCanvas }], children: [
|
|
3503
|
+
/* @__PURE__ */ jsx26(View20, { style: styles20.sheetHandle }),
|
|
3504
|
+
/* @__PURE__ */ jsx26(View20, { style: styles20.sheetHeader, children: /* @__PURE__ */ jsx26(Text15, { style: [styles20.spaceName, { color: theme.colors.foreground }], numberOfLines: 1, children: spaceName }) }),
|
|
3505
|
+
/* @__PURE__ */ jsxs19(View20, { style: [styles20.inputCard, { backgroundColor: theme.colors.surface, borderColor: controller.isInputFocused ? theme.colors.ring : theme.colors.border }], children: [
|
|
3506
|
+
/* @__PURE__ */ jsx26(HugeiconsIcon11, { icon: UserIcon2, size: 18, color: controller.isInputFocused ? theme.colors.primary : theme.colors.mutedForeground, style: styles20.inputIcon }),
|
|
3507
|
+
/* @__PURE__ */ jsx26(
|
|
3267
3508
|
TextInput2,
|
|
3268
3509
|
{
|
|
3269
3510
|
onChangeText: controller.setDisplayName,
|
|
@@ -3279,28 +3520,28 @@ function EntranceViewAndroid({ spaceName, error, joinDisabled = false, onCancel,
|
|
|
3279
3520
|
}
|
|
3280
3521
|
)
|
|
3281
3522
|
] }),
|
|
3282
|
-
/* @__PURE__ */
|
|
3283
|
-
/* @__PURE__ */
|
|
3284
|
-
|
|
3523
|
+
/* @__PURE__ */ jsxs19(View20, { style: styles20.mediaRow, children: [
|
|
3524
|
+
/* @__PURE__ */ jsx26(
|
|
3525
|
+
Pressable13,
|
|
3285
3526
|
{
|
|
3286
3527
|
disabled: controller.simulatorMediaDisabled,
|
|
3287
3528
|
onPress: controller.toggleAudio,
|
|
3288
3529
|
style: ({ pressed }) => [styles20.controlCircle, { backgroundColor: controller.audioEnabled ? theme.colors.controlsBackground : theme.colors.error, borderColor: theme.colors.border }, controller.simulatorMediaDisabled && styles20.toggleCircleDisabled, pressed && styles20.togglePressed],
|
|
3289
|
-
children: /* @__PURE__ */
|
|
3530
|
+
children: /* @__PURE__ */ jsx26(HugeiconsIcon11, { icon: controller.audioEnabled ? Mic01Icon4 : MicOff01Icon7, size: 24, color: theme.colors.primaryForeground })
|
|
3290
3531
|
}
|
|
3291
3532
|
),
|
|
3292
|
-
/* @__PURE__ */
|
|
3293
|
-
|
|
3533
|
+
/* @__PURE__ */ jsx26(
|
|
3534
|
+
Pressable13,
|
|
3294
3535
|
{
|
|
3295
3536
|
disabled: controller.simulatorMediaDisabled,
|
|
3296
3537
|
onPress: controller.toggleVideo,
|
|
3297
3538
|
style: ({ pressed }) => [styles20.controlCircle, { backgroundColor: controller.videoEnabled ? theme.colors.controlsBackground : theme.colors.error, borderColor: theme.colors.border }, controller.simulatorMediaDisabled && styles20.toggleCircleDisabled, pressed && styles20.togglePressed],
|
|
3298
|
-
children: /* @__PURE__ */
|
|
3539
|
+
children: /* @__PURE__ */ jsx26(HugeiconsIcon11, { icon: controller.videoEnabled ? Video01Icon5 : VideoOffIcon4, size: 24, color: theme.colors.primaryForeground })
|
|
3299
3540
|
}
|
|
3300
3541
|
)
|
|
3301
3542
|
] }),
|
|
3302
|
-
error ? /* @__PURE__ */
|
|
3303
|
-
/* @__PURE__ */
|
|
3543
|
+
error ? /* @__PURE__ */ jsx26(Text15, { style: [styles20.globalError, { color: theme.colors.error }], children: error }) : null,
|
|
3544
|
+
/* @__PURE__ */ jsx26(Pressable13, { disabled: !canJoin, onPress: controller.handleJoin, style: ({ pressed }) => [styles20.joinButton, { backgroundColor: canJoin ? theme.colors.primary : theme.colors.muted }, !canJoin && styles20.joinButtonDisabled, pressed && styles20.togglePressed], children: /* @__PURE__ */ jsx26(Text15, { style: [styles20.joinButtonText, { color: theme.colors.primaryForeground }], children: controller.isSubmitting || joinDisabled ? "Joining..." : "Enter Space" }) })
|
|
3304
3545
|
] })
|
|
3305
3546
|
] }) });
|
|
3306
3547
|
}
|
|
@@ -3489,7 +3730,7 @@ import VideoOffIcon5 from "@hugeicons/core-free-icons/dist/esm/VideoOffIcon";
|
|
|
3489
3730
|
import ArrowRight02Icon from "@hugeicons/core-free-icons/dist/esm/ArrowRight02Icon";
|
|
3490
3731
|
import CancelCircleIcon2 from "@hugeicons/core-free-icons/dist/esm/CancelCircleIcon";
|
|
3491
3732
|
import { HugeiconsIcon as HugeiconsIcon12 } from "@hugeicons/react-native";
|
|
3492
|
-
import { KeyboardAvoidingView as KeyboardAvoidingView3, Platform as Platform11, Pressable as
|
|
3733
|
+
import { KeyboardAvoidingView as KeyboardAvoidingView3, Platform as Platform11, Pressable as Pressable14, StyleSheet as StyleSheet22, Text as Text16, TextInput as TextInput3, View as View21, Animated as Animated2, ActivityIndicator as ActivityIndicator2 } from "react-native";
|
|
3493
3734
|
|
|
3494
3735
|
// src/components/native-animation-controller.ts
|
|
3495
3736
|
function createAnimationRefController(createAnimations) {
|
|
@@ -3519,24 +3760,24 @@ function createAnimationRefController(createAnimations) {
|
|
|
3519
3760
|
}
|
|
3520
3761
|
|
|
3521
3762
|
// src/components/EntranceView.ios-pad.tsx
|
|
3522
|
-
import { useRef as
|
|
3523
|
-
import { jsx as
|
|
3763
|
+
import { useRef as useRef5 } from "react";
|
|
3764
|
+
import { jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3524
3765
|
function EntranceViewIosPad({ spaceName, error, joinDisabled = false, onCancel, ...props }) {
|
|
3525
3766
|
const controller = useEntranceController({ ...props, joinDisabled });
|
|
3526
3767
|
const theme = useNativeTheme();
|
|
3527
3768
|
const canRenderPreview = hasRtcVideoView();
|
|
3528
|
-
const entryAnim =
|
|
3529
|
-
const islandAnim =
|
|
3530
|
-
const animationRef =
|
|
3769
|
+
const entryAnim = useRef5(new Animated2.Value(0)).current;
|
|
3770
|
+
const islandAnim = useRef5(new Animated2.Value(0)).current;
|
|
3771
|
+
const animationRef = useRef5(null);
|
|
3531
3772
|
const attachEntryAnimation = animationRef.current ?? (animationRef.current = createAnimationRefController(() => [
|
|
3532
|
-
|
|
3533
|
-
|
|
3773
|
+
Animated2.stagger(300, [
|
|
3774
|
+
Animated2.spring(entryAnim, {
|
|
3534
3775
|
toValue: 1,
|
|
3535
3776
|
tension: 20,
|
|
3536
3777
|
friction: 8,
|
|
3537
3778
|
useNativeDriver: true
|
|
3538
3779
|
}),
|
|
3539
|
-
|
|
3780
|
+
Animated2.spring(islandAnim, {
|
|
3540
3781
|
toValue: 1,
|
|
3541
3782
|
tension: 25,
|
|
3542
3783
|
friction: 9,
|
|
@@ -3547,20 +3788,20 @@ function EntranceViewIosPad({ spaceName, error, joinDisabled = false, onCancel,
|
|
|
3547
3788
|
const canJoin = controller.displayName.trim().length > 0 && !joinDisabled && !controller.isSubmitting;
|
|
3548
3789
|
const showPreview = Boolean(controller.previewStream && controller.videoEnabled && canRenderPreview);
|
|
3549
3790
|
const previewStreamURL = showPreview && controller.previewStream ? controller.previewStream.toURL() : null;
|
|
3550
|
-
return /* @__PURE__ */
|
|
3551
|
-
/* @__PURE__ */
|
|
3552
|
-
previewStreamURL ? /* @__PURE__ */
|
|
3553
|
-
showPreview ? /* @__PURE__ */
|
|
3791
|
+
return /* @__PURE__ */ jsxs20(KeyboardAvoidingView3, { behavior: Platform11.OS === "ios" ? "padding" : "height", style: [styles21.screen, { backgroundColor: theme.colors.background }], children: [
|
|
3792
|
+
/* @__PURE__ */ jsxs20(View21, { style: [styles21.immersiveContainer, { backgroundColor: theme.colors.darkCanvas }], children: [
|
|
3793
|
+
previewStreamURL ? /* @__PURE__ */ jsx27(RtcVideoView, { mirror: true, objectFit: "cover", streamURL: previewStreamURL, style: styles21.fullScreenVideo, zOrder: -1 }) : /* @__PURE__ */ jsx27(View21, { style: [styles21.immersiveAvatarContainer, { backgroundColor: theme.colors.background }], children: /* @__PURE__ */ jsx27(FaceAvatar, { name: controller.displayName, size: 200, textSize: 80 }) }),
|
|
3794
|
+
showPreview ? /* @__PURE__ */ jsx27(View21, { style: styles21.frostOverlay }) : null
|
|
3554
3795
|
] }),
|
|
3555
|
-
/* @__PURE__ */
|
|
3556
|
-
/* @__PURE__ */
|
|
3557
|
-
onCancel ? /* @__PURE__ */
|
|
3558
|
-
/* @__PURE__ */
|
|
3559
|
-
/* @__PURE__ */
|
|
3796
|
+
/* @__PURE__ */ jsxs20(View21, { style: styles21.hudLayer, children: [
|
|
3797
|
+
/* @__PURE__ */ jsxs20(View21, { style: styles21.topHud, children: [
|
|
3798
|
+
onCancel ? /* @__PURE__ */ jsx27(Pressable14, { accessibilityLabel: "Cancel and leave Entrance", accessibilityRole: "button", onPress: onCancel, style: ({ pressed }) => [styles21.backPuck, { backgroundColor: theme.colors.surface, borderColor: theme.colors.border }, pressed && styles21.pressed], children: /* @__PURE__ */ jsx27(HugeiconsIcon12, { icon: ArrowLeft01Icon2, size: 22, color: theme.colors.foreground }) }) : null,
|
|
3799
|
+
/* @__PURE__ */ jsx27(View21, { style: styles21.spaceInfo, children: /* @__PURE__ */ jsx27(Text16, { style: [styles21.spaceTitle, { color: theme.colors.foreground }], numberOfLines: 1, children: spaceName }) }),
|
|
3800
|
+
/* @__PURE__ */ jsx27(View21, { style: styles21.topHudSpacer })
|
|
3560
3801
|
] }),
|
|
3561
|
-
/* @__PURE__ */
|
|
3562
|
-
/* @__PURE__ */
|
|
3563
|
-
|
|
3802
|
+
/* @__PURE__ */ jsx27(View21, { style: styles21.flexFill }),
|
|
3803
|
+
/* @__PURE__ */ jsxs20(
|
|
3804
|
+
Animated2.View,
|
|
3564
3805
|
{
|
|
3565
3806
|
ref: attachEntryAnimation,
|
|
3566
3807
|
style: [
|
|
@@ -3571,10 +3812,10 @@ function EntranceViewIosPad({ spaceName, error, joinDisabled = false, onCancel,
|
|
|
3571
3812
|
}
|
|
3572
3813
|
],
|
|
3573
3814
|
children: [
|
|
3574
|
-
/* @__PURE__ */
|
|
3575
|
-
/* @__PURE__ */
|
|
3576
|
-
/* @__PURE__ */
|
|
3577
|
-
|
|
3815
|
+
/* @__PURE__ */ jsxs20(View21, { style: [styles21.launchPad, { backgroundColor: theme.colors.card, borderColor: theme.colors.border, shadowColor: theme.colors.darkCanvas }], children: [
|
|
3816
|
+
/* @__PURE__ */ jsxs20(View21, { style: styles21.mediaGroup, children: [
|
|
3817
|
+
/* @__PURE__ */ jsx27(
|
|
3818
|
+
Pressable14,
|
|
3578
3819
|
{
|
|
3579
3820
|
accessibilityLabel: controller.audioEnabled ? "Mute microphone" : "Unmute microphone",
|
|
3580
3821
|
accessibilityRole: "button",
|
|
@@ -3582,11 +3823,11 @@ function EntranceViewIosPad({ spaceName, error, joinDisabled = false, onCancel,
|
|
|
3582
3823
|
disabled: controller.simulatorMediaDisabled,
|
|
3583
3824
|
onPress: controller.toggleAudio,
|
|
3584
3825
|
style: ({ pressed }) => [styles21.mediaToggle, { backgroundColor: controller.audioEnabled ? theme.colors.controlsBackground : theme.colors.error, borderColor: theme.colors.border }, pressed && styles21.pressed],
|
|
3585
|
-
children: /* @__PURE__ */
|
|
3826
|
+
children: /* @__PURE__ */ jsx27(HugeiconsIcon12, { icon: controller.audioEnabled ? Mic01Icon5 : MicOff01Icon8, size: 22, color: theme.colors.primaryForeground })
|
|
3586
3827
|
}
|
|
3587
3828
|
),
|
|
3588
|
-
/* @__PURE__ */
|
|
3589
|
-
|
|
3829
|
+
/* @__PURE__ */ jsx27(
|
|
3830
|
+
Pressable14,
|
|
3590
3831
|
{
|
|
3591
3832
|
accessibilityLabel: controller.videoEnabled ? "Turn camera off" : "Turn camera on",
|
|
3592
3833
|
accessibilityRole: "button",
|
|
@@ -3594,13 +3835,13 @@ function EntranceViewIosPad({ spaceName, error, joinDisabled = false, onCancel,
|
|
|
3594
3835
|
disabled: controller.simulatorMediaDisabled,
|
|
3595
3836
|
onPress: controller.toggleVideo,
|
|
3596
3837
|
style: ({ pressed }) => [styles21.mediaToggle, { backgroundColor: controller.videoEnabled ? theme.colors.controlsBackground : theme.colors.error, borderColor: theme.colors.border }, pressed && styles21.pressed],
|
|
3597
|
-
children: /* @__PURE__ */
|
|
3838
|
+
children: /* @__PURE__ */ jsx27(HugeiconsIcon12, { icon: controller.videoEnabled ? Video01Icon6 : VideoOffIcon5, size: 22, color: theme.colors.primaryForeground })
|
|
3598
3839
|
}
|
|
3599
3840
|
)
|
|
3600
3841
|
] }),
|
|
3601
|
-
/* @__PURE__ */
|
|
3602
|
-
/* @__PURE__ */
|
|
3603
|
-
/* @__PURE__ */
|
|
3842
|
+
/* @__PURE__ */ jsx27(View21, { style: styles21.islandDivider }),
|
|
3843
|
+
/* @__PURE__ */ jsxs20(View21, { style: [styles21.identityArea, { backgroundColor: theme.colors.surface, borderColor: controller.isInputFocused ? theme.colors.ring : theme.colors.border }, controller.isInputFocused && styles21.identityAreaFocused], children: [
|
|
3844
|
+
/* @__PURE__ */ jsx27(
|
|
3604
3845
|
TextInput3,
|
|
3605
3846
|
{
|
|
3606
3847
|
accessibilityLabel: "Your name",
|
|
@@ -3616,10 +3857,10 @@ function EntranceViewIosPad({ spaceName, error, joinDisabled = false, onCancel,
|
|
|
3616
3857
|
onSubmitEditing: controller.handleJoin
|
|
3617
3858
|
}
|
|
3618
3859
|
),
|
|
3619
|
-
controller.displayName.length > 0 && /* @__PURE__ */
|
|
3860
|
+
controller.displayName.length > 0 && /* @__PURE__ */ jsx27(Pressable14, { accessibilityLabel: "Clear name", accessibilityRole: "button", onPress: () => controller.setDisplayName(""), style: styles21.clearAction, children: /* @__PURE__ */ jsx27(HugeiconsIcon12, { icon: CancelCircleIcon2, size: 18, color: theme.colors.mutedForeground }) })
|
|
3620
3861
|
] }),
|
|
3621
|
-
/* @__PURE__ */
|
|
3622
|
-
|
|
3862
|
+
/* @__PURE__ */ jsx27(
|
|
3863
|
+
Pressable14,
|
|
3623
3864
|
{
|
|
3624
3865
|
accessibilityLabel: "Enter Space",
|
|
3625
3866
|
accessibilityRole: "button",
|
|
@@ -3638,12 +3879,12 @@ function EntranceViewIosPad({ spaceName, error, joinDisabled = false, onCancel,
|
|
|
3638
3879
|
pressed && canJoin && styles21.pressed,
|
|
3639
3880
|
controller.isSubmitting && styles21.disabled
|
|
3640
3881
|
],
|
|
3641
|
-
children: controller.isSubmitting ? /* @__PURE__ */
|
|
3882
|
+
children: controller.isSubmitting ? /* @__PURE__ */ jsx27(ActivityIndicator2, { color: theme.colors.primaryForeground, size: "small" }) : /* @__PURE__ */ jsx27(HugeiconsIcon12, { icon: ArrowRight02Icon, size: 28, color: canJoin ? theme.colors.primaryForeground : theme.colors.mutedForeground })
|
|
3642
3883
|
}
|
|
3643
3884
|
)
|
|
3644
3885
|
] }),
|
|
3645
|
-
error ? /* @__PURE__ */
|
|
3646
|
-
controller.simulatorMediaDisabled && /* @__PURE__ */
|
|
3886
|
+
error ? /* @__PURE__ */ jsx27(Text16, { style: [styles21.immersiveError, { color: theme.colors.error }], children: error }) : null,
|
|
3887
|
+
controller.simulatorMediaDisabled && /* @__PURE__ */ jsx27(Text16, { style: [styles21.simulatorHintText, { color: theme.colors.mutedForeground }], children: getIosSimulatorMediaMessage() })
|
|
3647
3888
|
]
|
|
3648
3889
|
}
|
|
3649
3890
|
)
|
|
@@ -3811,27 +4052,27 @@ import UserIcon3 from "@hugeicons/core-free-icons/dist/esm/UserIcon";
|
|
|
3811
4052
|
import Video01Icon7 from "@hugeicons/core-free-icons/dist/esm/Video01Icon";
|
|
3812
4053
|
import VideoOffIcon6 from "@hugeicons/core-free-icons/dist/esm/VideoOffIcon";
|
|
3813
4054
|
import { HugeiconsIcon as HugeiconsIcon13 } from "@hugeicons/react-native";
|
|
3814
|
-
import { KeyboardAvoidingView as KeyboardAvoidingView4, Platform as Platform12, Pressable as
|
|
3815
|
-
import { jsx as
|
|
4055
|
+
import { KeyboardAvoidingView as KeyboardAvoidingView4, Platform as Platform12, Pressable as Pressable15, StyleSheet as StyleSheet23, Text as Text17, TextInput as TextInput4, View as View22 } from "react-native";
|
|
4056
|
+
import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3816
4057
|
function EntranceViewIosPhone({ spaceName, error, joinDisabled = false, onCancel, ...props }) {
|
|
3817
4058
|
const controller = useEntranceController({ ...props, joinDisabled });
|
|
3818
4059
|
const theme = useNativeTheme();
|
|
3819
4060
|
const canJoin = controller.displayName.trim().length > 0 && !joinDisabled && !controller.isSubmitting;
|
|
3820
|
-
return /* @__PURE__ */
|
|
3821
|
-
/* @__PURE__ */
|
|
3822
|
-
/* @__PURE__ */
|
|
3823
|
-
controller.previewStream && controller.videoEnabled ? /* @__PURE__ */
|
|
3824
|
-
onCancel ? /* @__PURE__ */
|
|
4061
|
+
return /* @__PURE__ */ jsx28(KeyboardAvoidingView4, { behavior: Platform12.OS === "ios" ? "padding" : "height", style: [styles22.screen, { backgroundColor: theme.colors.background }], children: /* @__PURE__ */ jsxs21(View22, { style: styles22.content, children: [
|
|
4062
|
+
/* @__PURE__ */ jsxs21(View22, { style: styles22.previewContainer, children: [
|
|
4063
|
+
/* @__PURE__ */ jsxs21(View22, { style: [styles22.previewSurface, { backgroundColor: theme.colors.raisedSurface, borderColor: theme.colors.border }], children: [
|
|
4064
|
+
controller.previewStream && controller.videoEnabled ? /* @__PURE__ */ jsx28(RTCView, { mirror: true, objectFit: "cover", streamURL: controller.previewStream.toURL(), style: styles22.previewVideo, zOrder: 0 }) : /* @__PURE__ */ jsx28(View22, { style: [styles22.avatarContainer, { backgroundColor: theme.colors.insetSurface }], children: /* @__PURE__ */ jsx28(FaceAvatar, { name: controller.displayName, size: 140, textSize: 52 }) }),
|
|
4065
|
+
onCancel ? /* @__PURE__ */ jsx28(Pressable15, { accessibilityLabel: "Cancel and leave Entrance", accessibilityRole: "button", onPress: onCancel, style: ({ pressed }) => [styles22.floatingBack, { backgroundColor: theme.colors.surface, borderColor: theme.colors.border }, pressed && styles22.topIconButtonPressed], children: /* @__PURE__ */ jsx28(HugeiconsIcon13, { icon: ArrowLeft01Icon3, size: 22, color: theme.colors.foreground }) }) : null
|
|
3825
4066
|
] }),
|
|
3826
|
-
controller.previewError && controller.videoEnabled ? /* @__PURE__ */
|
|
3827
|
-
controller.simulatorMediaDisabled ? /* @__PURE__ */
|
|
4067
|
+
controller.previewError && controller.videoEnabled ? /* @__PURE__ */ jsx28(Text17, { style: styles22.previewError, children: controller.previewError }) : null,
|
|
4068
|
+
controller.simulatorMediaDisabled ? /* @__PURE__ */ jsx28(Text17, { style: styles22.previewHint, children: getIosSimulatorMediaMessage() }) : null
|
|
3828
4069
|
] }),
|
|
3829
|
-
/* @__PURE__ */
|
|
3830
|
-
/* @__PURE__ */
|
|
3831
|
-
/* @__PURE__ */
|
|
3832
|
-
/* @__PURE__ */
|
|
3833
|
-
/* @__PURE__ */
|
|
3834
|
-
/* @__PURE__ */
|
|
4070
|
+
/* @__PURE__ */ jsxs21(View22, { style: [styles22.sheetContainer, { backgroundColor: theme.colors.card, borderColor: theme.colors.border, shadowColor: theme.colors.darkCanvas }], children: [
|
|
4071
|
+
/* @__PURE__ */ jsx28(View22, { style: styles22.sheetHandle }),
|
|
4072
|
+
/* @__PURE__ */ jsx28(View22, { style: styles22.sheetHeader, children: /* @__PURE__ */ jsx28(Text17, { style: [styles22.spaceName, { color: theme.colors.foreground }], numberOfLines: 1, children: spaceName }) }),
|
|
4073
|
+
/* @__PURE__ */ jsxs21(View22, { style: [styles22.inputCard, { backgroundColor: theme.colors.surface, borderColor: controller.isInputFocused ? theme.colors.ring : theme.colors.border }], children: [
|
|
4074
|
+
/* @__PURE__ */ jsx28(HugeiconsIcon13, { icon: UserIcon3, size: 18, color: controller.isInputFocused ? theme.colors.primary : theme.colors.mutedForeground, style: styles22.inputIcon }),
|
|
4075
|
+
/* @__PURE__ */ jsx28(
|
|
3835
4076
|
TextInput4,
|
|
3836
4077
|
{
|
|
3837
4078
|
onChangeText: controller.setDisplayName,
|
|
@@ -3847,28 +4088,28 @@ function EntranceViewIosPhone({ spaceName, error, joinDisabled = false, onCancel
|
|
|
3847
4088
|
}
|
|
3848
4089
|
)
|
|
3849
4090
|
] }),
|
|
3850
|
-
/* @__PURE__ */
|
|
3851
|
-
/* @__PURE__ */
|
|
3852
|
-
|
|
4091
|
+
/* @__PURE__ */ jsxs21(View22, { style: styles22.mediaRow, children: [
|
|
4092
|
+
/* @__PURE__ */ jsx28(
|
|
4093
|
+
Pressable15,
|
|
3853
4094
|
{
|
|
3854
4095
|
disabled: controller.simulatorMediaDisabled,
|
|
3855
4096
|
onPress: controller.toggleAudio,
|
|
3856
4097
|
style: ({ pressed }) => [styles22.controlCircle, { backgroundColor: controller.audioEnabled ? theme.colors.controlsBackground : theme.colors.error, borderColor: theme.colors.border }, controller.simulatorMediaDisabled && styles22.toggleCircleDisabled, pressed && styles22.togglePressed],
|
|
3857
|
-
children: /* @__PURE__ */
|
|
4098
|
+
children: /* @__PURE__ */ jsx28(HugeiconsIcon13, { icon: controller.audioEnabled ? Mic01Icon6 : MicOff01Icon9, size: 24, color: theme.colors.primaryForeground })
|
|
3858
4099
|
}
|
|
3859
4100
|
),
|
|
3860
|
-
/* @__PURE__ */
|
|
3861
|
-
|
|
4101
|
+
/* @__PURE__ */ jsx28(
|
|
4102
|
+
Pressable15,
|
|
3862
4103
|
{
|
|
3863
4104
|
disabled: controller.simulatorMediaDisabled,
|
|
3864
4105
|
onPress: controller.toggleVideo,
|
|
3865
4106
|
style: ({ pressed }) => [styles22.controlCircle, { backgroundColor: controller.videoEnabled ? theme.colors.controlsBackground : theme.colors.error, borderColor: theme.colors.border }, controller.simulatorMediaDisabled && styles22.toggleCircleDisabled, pressed && styles22.togglePressed],
|
|
3866
|
-
children: /* @__PURE__ */
|
|
4107
|
+
children: /* @__PURE__ */ jsx28(HugeiconsIcon13, { icon: controller.videoEnabled ? Video01Icon7 : VideoOffIcon6, size: 24, color: theme.colors.primaryForeground })
|
|
3867
4108
|
}
|
|
3868
4109
|
)
|
|
3869
4110
|
] }),
|
|
3870
|
-
error ? /* @__PURE__ */
|
|
3871
|
-
/* @__PURE__ */
|
|
4111
|
+
error ? /* @__PURE__ */ jsx28(Text17, { style: [styles22.globalError, { color: theme.colors.error }], children: error }) : null,
|
|
4112
|
+
/* @__PURE__ */ jsx28(Pressable15, { disabled: !canJoin, onPress: controller.handleJoin, style: ({ pressed }) => [styles22.joinButton, { backgroundColor: canJoin ? theme.colors.primary : theme.colors.muted }, !canJoin && styles22.joinButtonDisabled, pressed && styles22.togglePressed], children: /* @__PURE__ */ jsx28(Text17, { style: [styles22.joinButtonText, { color: theme.colors.primaryForeground }], children: controller.isSubmitting || joinDisabled ? "Joining..." : "Enter Space" }) })
|
|
3872
4113
|
] })
|
|
3873
4114
|
] }) });
|
|
3874
4115
|
}
|
|
@@ -4055,8 +4296,8 @@ import UserIcon4 from "@hugeicons/core-free-icons/dist/esm/UserIcon";
|
|
|
4055
4296
|
import Video01Icon8 from "@hugeicons/core-free-icons/dist/esm/Video01Icon";
|
|
4056
4297
|
import VideoOffIcon7 from "@hugeicons/core-free-icons/dist/esm/VideoOffIcon";
|
|
4057
4298
|
import { HugeiconsIcon as HugeiconsIcon14 } from "@hugeicons/react-native";
|
|
4058
|
-
import { KeyboardAvoidingView as KeyboardAvoidingView5, Platform as Platform13, Pressable as
|
|
4059
|
-
import { jsx as
|
|
4299
|
+
import { KeyboardAvoidingView as KeyboardAvoidingView5, Platform as Platform13, Pressable as Pressable16, StyleSheet as StyleSheet24, Text as Text18, TextInput as TextInput5, View as View23 } from "react-native";
|
|
4300
|
+
import { jsx as jsx29, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4060
4301
|
function EntranceViewMacos({ spaceName, error, joinDisabled = false, onCancel, ...props }) {
|
|
4061
4302
|
const controller = useEntranceController({ ...props, joinDisabled });
|
|
4062
4303
|
const theme = useNativeTheme();
|
|
@@ -4065,21 +4306,21 @@ function EntranceViewMacos({ spaceName, error, joinDisabled = false, onCancel, .
|
|
|
4065
4306
|
const showPreview = Boolean(controller.previewStream && controller.videoEnabled && canRenderPreview);
|
|
4066
4307
|
const previewStreamURL = showPreview && controller.previewStream ? controller.previewStream.toURL() : null;
|
|
4067
4308
|
const previewStatusMessage = controller.videoEnabled && controller.previewStream && !canRenderPreview ? "Camera preview is unavailable on this device." : controller.previewError;
|
|
4068
|
-
return /* @__PURE__ */
|
|
4069
|
-
/* @__PURE__ */
|
|
4070
|
-
/* @__PURE__ */
|
|
4071
|
-
previewStreamURL ? /* @__PURE__ */
|
|
4072
|
-
onCancel ? /* @__PURE__ */
|
|
4309
|
+
return /* @__PURE__ */ jsx29(KeyboardAvoidingView5, { behavior: Platform13.OS === "ios" ? "padding" : "height", style: [styles23.screen, { backgroundColor: theme.colors.background }], children: /* @__PURE__ */ jsxs22(View23, { style: styles23.content, children: [
|
|
4310
|
+
/* @__PURE__ */ jsxs22(View23, { style: styles23.previewContainer, children: [
|
|
4311
|
+
/* @__PURE__ */ jsxs22(View23, { style: [styles23.previewSurface, { backgroundColor: theme.colors.raisedSurface, borderColor: theme.colors.border }], children: [
|
|
4312
|
+
previewStreamURL ? /* @__PURE__ */ jsx29(RtcVideoView, { mirror: true, objectFit: "cover", streamURL: previewStreamURL, style: styles23.previewVideo, zOrder: 0 }) : /* @__PURE__ */ jsx29(View23, { style: [styles23.avatarContainer, { backgroundColor: theme.colors.insetSurface }], children: /* @__PURE__ */ jsx29(FaceAvatar, { name: controller.displayName, size: 140, textSize: 52 }) }),
|
|
4313
|
+
onCancel ? /* @__PURE__ */ jsx29(Pressable16, { accessibilityLabel: "Cancel and leave Entrance", accessibilityRole: "button", onPress: onCancel, style: ({ pressed }) => [styles23.floatingBack, { backgroundColor: theme.colors.surface, borderColor: theme.colors.border }, pressed && styles23.topIconButtonPressed], children: /* @__PURE__ */ jsx29(HugeiconsIcon14, { icon: ArrowLeft01Icon4, size: 22, color: theme.colors.foreground }) }) : null
|
|
4073
4314
|
] }),
|
|
4074
|
-
previewStatusMessage ? /* @__PURE__ */
|
|
4075
|
-
controller.simulatorMediaDisabled ? /* @__PURE__ */
|
|
4315
|
+
previewStatusMessage ? /* @__PURE__ */ jsx29(Text18, { style: styles23.previewError, children: previewStatusMessage }) : null,
|
|
4316
|
+
controller.simulatorMediaDisabled ? /* @__PURE__ */ jsx29(Text18, { style: styles23.previewHint, children: getIosSimulatorMediaMessage() }) : null
|
|
4076
4317
|
] }),
|
|
4077
|
-
/* @__PURE__ */
|
|
4078
|
-
/* @__PURE__ */
|
|
4079
|
-
/* @__PURE__ */
|
|
4080
|
-
/* @__PURE__ */
|
|
4081
|
-
/* @__PURE__ */
|
|
4082
|
-
/* @__PURE__ */
|
|
4318
|
+
/* @__PURE__ */ jsxs22(View23, { style: [styles23.sheetContainer, { backgroundColor: theme.colors.card, borderColor: theme.colors.border, shadowColor: theme.colors.darkCanvas }], children: [
|
|
4319
|
+
/* @__PURE__ */ jsx29(View23, { style: styles23.sheetHandle }),
|
|
4320
|
+
/* @__PURE__ */ jsx29(View23, { style: styles23.sheetHeader, children: /* @__PURE__ */ jsx29(Text18, { style: [styles23.spaceName, { color: theme.colors.foreground }], numberOfLines: 1, children: spaceName }) }),
|
|
4321
|
+
/* @__PURE__ */ jsxs22(View23, { style: [styles23.inputCard, { backgroundColor: theme.colors.surface, borderColor: controller.isInputFocused ? theme.colors.ring : theme.colors.border }], children: [
|
|
4322
|
+
/* @__PURE__ */ jsx29(HugeiconsIcon14, { icon: UserIcon4, size: 18, color: controller.isInputFocused ? theme.colors.primary : theme.colors.mutedForeground, style: styles23.inputIcon }),
|
|
4323
|
+
/* @__PURE__ */ jsx29(
|
|
4083
4324
|
TextInput5,
|
|
4084
4325
|
{
|
|
4085
4326
|
onChangeText: controller.setDisplayName,
|
|
@@ -4095,28 +4336,28 @@ function EntranceViewMacos({ spaceName, error, joinDisabled = false, onCancel, .
|
|
|
4095
4336
|
}
|
|
4096
4337
|
)
|
|
4097
4338
|
] }),
|
|
4098
|
-
/* @__PURE__ */
|
|
4099
|
-
/* @__PURE__ */
|
|
4100
|
-
|
|
4339
|
+
/* @__PURE__ */ jsxs22(View23, { style: styles23.mediaRow, children: [
|
|
4340
|
+
/* @__PURE__ */ jsx29(
|
|
4341
|
+
Pressable16,
|
|
4101
4342
|
{
|
|
4102
4343
|
disabled: controller.simulatorMediaDisabled,
|
|
4103
4344
|
onPress: controller.toggleAudio,
|
|
4104
4345
|
style: ({ pressed }) => [styles23.controlCircle, { backgroundColor: controller.audioEnabled ? theme.colors.controlsBackground : theme.colors.error, borderColor: theme.colors.border }, controller.simulatorMediaDisabled && styles23.toggleCircleDisabled, pressed && styles23.togglePressed],
|
|
4105
|
-
children: /* @__PURE__ */
|
|
4346
|
+
children: /* @__PURE__ */ jsx29(HugeiconsIcon14, { icon: controller.audioEnabled ? Mic01Icon7 : MicOff01Icon10, size: 24, color: theme.colors.primaryForeground })
|
|
4106
4347
|
}
|
|
4107
4348
|
),
|
|
4108
|
-
/* @__PURE__ */
|
|
4109
|
-
|
|
4349
|
+
/* @__PURE__ */ jsx29(
|
|
4350
|
+
Pressable16,
|
|
4110
4351
|
{
|
|
4111
4352
|
disabled: controller.simulatorMediaDisabled,
|
|
4112
4353
|
onPress: controller.toggleVideo,
|
|
4113
4354
|
style: ({ pressed }) => [styles23.controlCircle, { backgroundColor: controller.videoEnabled ? theme.colors.controlsBackground : theme.colors.error, borderColor: theme.colors.border }, controller.simulatorMediaDisabled && styles23.toggleCircleDisabled, pressed && styles23.togglePressed],
|
|
4114
|
-
children: /* @__PURE__ */
|
|
4355
|
+
children: /* @__PURE__ */ jsx29(HugeiconsIcon14, { icon: controller.videoEnabled ? Video01Icon8 : VideoOffIcon7, size: 24, color: theme.colors.primaryForeground })
|
|
4115
4356
|
}
|
|
4116
4357
|
)
|
|
4117
4358
|
] }),
|
|
4118
|
-
error ? /* @__PURE__ */
|
|
4119
|
-
/* @__PURE__ */
|
|
4359
|
+
error ? /* @__PURE__ */ jsx29(Text18, { style: [styles23.globalError, { color: theme.colors.error }], children: error }) : null,
|
|
4360
|
+
/* @__PURE__ */ jsx29(Pressable16, { disabled: !canJoin, onPress: controller.handleJoin, style: ({ pressed }) => [styles23.joinButton, { backgroundColor: canJoin ? theme.colors.primary : theme.colors.muted }, !canJoin && styles23.joinButtonDisabled, pressed && styles23.togglePressed], children: /* @__PURE__ */ jsx29(Text18, { style: [styles23.joinButtonText, { color: theme.colors.primaryForeground }], children: controller.isSubmitting || joinDisabled ? "Joining..." : "Enter Space" }) })
|
|
4120
4361
|
] })
|
|
4121
4362
|
] }) });
|
|
4122
4363
|
}
|
|
@@ -4297,34 +4538,34 @@ var styles23 = StyleSheet24.create({
|
|
|
4297
4538
|
});
|
|
4298
4539
|
|
|
4299
4540
|
// src/components/EntranceView.tsx
|
|
4300
|
-
import { jsx as
|
|
4541
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
4301
4542
|
function EntranceView(props) {
|
|
4302
4543
|
switch (resolvePlatformVariant()) {
|
|
4303
4544
|
case "ios-pad":
|
|
4304
|
-
return /* @__PURE__ */
|
|
4545
|
+
return /* @__PURE__ */ jsx30(EntranceViewIosPad, { ...props });
|
|
4305
4546
|
case "ios-phone":
|
|
4306
|
-
return /* @__PURE__ */
|
|
4547
|
+
return /* @__PURE__ */ jsx30(EntranceViewIosPhone, { ...props });
|
|
4307
4548
|
case "macos":
|
|
4308
|
-
return /* @__PURE__ */
|
|
4549
|
+
return /* @__PURE__ */ jsx30(EntranceViewMacos, { ...props });
|
|
4309
4550
|
case "tvos":
|
|
4310
4551
|
case "android":
|
|
4311
4552
|
default:
|
|
4312
|
-
return /* @__PURE__ */
|
|
4553
|
+
return /* @__PURE__ */ jsx30(EntranceViewAndroid, { ...props });
|
|
4313
4554
|
}
|
|
4314
4555
|
}
|
|
4315
4556
|
|
|
4316
4557
|
// src/components/Entrance.tsx
|
|
4317
4558
|
import { Image as Image3 } from "react-native";
|
|
4318
|
-
import { jsx as
|
|
4559
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
4319
4560
|
function Entrance({ spaceName, logoUrl, defaultDisplayName, defaults, error, joining = false, onCancel, onJoin }) {
|
|
4320
|
-
return /* @__PURE__ */
|
|
4561
|
+
return /* @__PURE__ */ jsx31(
|
|
4321
4562
|
EntranceView,
|
|
4322
4563
|
{
|
|
4323
4564
|
error,
|
|
4324
4565
|
initialAudioEnabled: defaults?.microphone ?? true,
|
|
4325
4566
|
initialVideoEnabled: defaults?.camera ?? true,
|
|
4326
4567
|
joinDisabled: joining,
|
|
4327
|
-
logo: logoUrl ? /* @__PURE__ */
|
|
4568
|
+
logo: logoUrl ? /* @__PURE__ */ jsx31(Image3, { accessibilityLabel: "Chalk", source: { uri: logoUrl }, style: { height: 32, width: 120 } }) : /* @__PURE__ */ jsx31(Logo, { height: 32, variant: "wordmark" }),
|
|
4328
4569
|
onCancel,
|
|
4329
4570
|
onJoin: ({ displayName, microphoneEnabled, cameraEnabled }) => void onJoin({ displayName, microphone: microphoneEnabled, camera: cameraEnabled }),
|
|
4330
4571
|
spaceName,
|
|
@@ -4334,14 +4575,14 @@ function Entrance({ spaceName, logoUrl, defaultDisplayName, defaults, error, joi
|
|
|
4334
4575
|
}
|
|
4335
4576
|
|
|
4336
4577
|
// src/components/Chalk.tsx
|
|
4337
|
-
import { jsx as
|
|
4578
|
+
import { jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4338
4579
|
function Chalk(props) {
|
|
4339
4580
|
const suppliedClient = props.client;
|
|
4340
4581
|
const space = props.space;
|
|
4341
4582
|
const getAccess = props.getAccess;
|
|
4342
|
-
const getAccessRef =
|
|
4583
|
+
const getAccessRef = useRef6(getAccess);
|
|
4343
4584
|
getAccessRef.current = getAccess;
|
|
4344
|
-
const defaults =
|
|
4585
|
+
const defaults = useRef6(props.defaults).current;
|
|
4345
4586
|
const getLatestAccess = useCallback9((...args) => {
|
|
4346
4587
|
const currentGetAccess = getAccessRef.current;
|
|
4347
4588
|
if (!currentGetAccess) throw new Error("Chalk requires getAccess when it creates the SpaceClient.");
|
|
@@ -4357,27 +4598,27 @@ function Chalk(props) {
|
|
|
4357
4598
|
[getLatestAccess, space, suppliedClient]
|
|
4358
4599
|
);
|
|
4359
4600
|
const client = suppliedClient ?? ownedClient;
|
|
4360
|
-
|
|
4601
|
+
useEffect9(() => {
|
|
4361
4602
|
if (!ownedClient) return;
|
|
4362
4603
|
return () => {
|
|
4363
4604
|
void ownedClient.leave().catch(() => void 0).finally(() => ownedClient.dispose());
|
|
4364
4605
|
};
|
|
4365
4606
|
}, [ownedClient]);
|
|
4366
|
-
return /* @__PURE__ */
|
|
4607
|
+
return /* @__PURE__ */ jsx32(NativeAppearanceProvider, { initialAppearance: { palette: props.theme?.palette, texture: props.theme?.texture }, children: /* @__PURE__ */ jsx32(AppearanceThemeBridge, { theme: props.theme, children: /* @__PURE__ */ jsx32(ChalkProvider, { client, children: /* @__PURE__ */ jsx32(SpaceExperience, { ...props }) }) }) });
|
|
4367
4608
|
}
|
|
4368
4609
|
function AppearanceThemeBridge({ children, theme }) {
|
|
4369
4610
|
const { appearance } = useNativeAppearance();
|
|
4370
|
-
return /* @__PURE__ */
|
|
4611
|
+
return /* @__PURE__ */ jsx32(NativeThemeProvider, { appearance, theme, children });
|
|
4371
4612
|
}
|
|
4372
4613
|
function SpaceExperience(props) {
|
|
4373
4614
|
const client = useSpaceClient();
|
|
4374
4615
|
const connection = useConnection();
|
|
4375
|
-
const previousStatus =
|
|
4376
|
-
const hasObservedStatus =
|
|
4377
|
-
const hasBeenLive =
|
|
4378
|
-
const autoJoinAttempted =
|
|
4379
|
-
const previousClient =
|
|
4380
|
-
const [joinError, setJoinError] =
|
|
4616
|
+
const previousStatus = useRef6(connection.status);
|
|
4617
|
+
const hasObservedStatus = useRef6(false);
|
|
4618
|
+
const hasBeenLive = useRef6(connection.status === "live" || connection.status === "reconnecting");
|
|
4619
|
+
const autoJoinAttempted = useRef6(false);
|
|
4620
|
+
const previousClient = useRef6(client);
|
|
4621
|
+
const [joinError, setJoinError] = useState10(null);
|
|
4381
4622
|
if (previousClient.current !== client) {
|
|
4382
4623
|
previousClient.current = client;
|
|
4383
4624
|
previousStatus.current = connection.status;
|
|
@@ -4402,10 +4643,10 @@ function SpaceExperience(props) {
|
|
|
4402
4643
|
autoJoinAttempted.current = true;
|
|
4403
4644
|
void join(defaultJoinOptions(props));
|
|
4404
4645
|
}, [join, props]);
|
|
4405
|
-
|
|
4646
|
+
useEffect9(() => {
|
|
4406
4647
|
setJoinError(null);
|
|
4407
4648
|
}, [client]);
|
|
4408
|
-
|
|
4649
|
+
useEffect9(() => {
|
|
4409
4650
|
const subscriptions = [
|
|
4410
4651
|
props.onEpisodeEnded && client.on("episodeEnded", props.onEpisodeEnded),
|
|
4411
4652
|
props.onParticipantJoined && client.on("participantJoined", props.onParticipantJoined),
|
|
@@ -4416,13 +4657,13 @@ function SpaceExperience(props) {
|
|
|
4416
4657
|
].filter((unsubscribe) => Boolean(unsubscribe));
|
|
4417
4658
|
return () => subscriptions.forEach((unsubscribe) => unsubscribe());
|
|
4418
4659
|
}, [client, props.onEpisodeEnded, props.onError, props.onParticipantJoined, props.onParticipantLeft, props.onScreenShareStarted, props.onScreenShareStopped]);
|
|
4419
|
-
|
|
4660
|
+
useEffect9(() => {
|
|
4420
4661
|
if (!entrance && connection.status === "idle" && !autoJoinAttempted.current) {
|
|
4421
4662
|
autoJoinAttempted.current = true;
|
|
4422
4663
|
void join(defaultJoinOptions(props));
|
|
4423
4664
|
}
|
|
4424
4665
|
}, [connection.status, entrance, join, props.defaults?.camera, props.defaults?.microphone, props.displayName]);
|
|
4425
|
-
|
|
4666
|
+
useEffect9(() => {
|
|
4426
4667
|
const previous = previousStatus.current;
|
|
4427
4668
|
if (hasObservedStatus.current) {
|
|
4428
4669
|
if (connection.status === "live" && previous !== "live" && previous !== "reconnecting") props.onJoined?.();
|
|
@@ -4433,27 +4674,27 @@ function SpaceExperience(props) {
|
|
|
4433
4674
|
if (connection.status === "live" || connection.status === "reconnecting") hasBeenLive.current = true;
|
|
4434
4675
|
}, [connection.status, props.onJoined, props.onLeft]);
|
|
4435
4676
|
if (connection.status === "idle" && entrance) {
|
|
4436
|
-
return /* @__PURE__ */
|
|
4677
|
+
return /* @__PURE__ */ jsx32(AppearanceLayer, { children: /* @__PURE__ */ jsx32(Entrance, { defaultDisplayName: props.displayName, defaults: props.defaults, error: joinError ?? void 0, logoUrl: props.logoUrl, onJoin: join, spaceName }) });
|
|
4437
4678
|
}
|
|
4438
4679
|
if (connection.status === "idle") {
|
|
4439
|
-
return /* @__PURE__ */
|
|
4680
|
+
return /* @__PURE__ */ jsx32(AppearanceLayer, { children: /* @__PURE__ */ jsx32(SpaceStatus, { message: joinError ?? `Entering ${spaceName}\u2026`, onRetry: joinError ? retryAutomaticJoin : void 0 }) });
|
|
4440
4681
|
}
|
|
4441
4682
|
if (connection.status === "joining") {
|
|
4442
4683
|
if (!entrance)
|
|
4443
|
-
return /* @__PURE__ */
|
|
4444
|
-
return /* @__PURE__ */
|
|
4684
|
+
return /* @__PURE__ */ jsx32(AppearanceLayer, { children: /* @__PURE__ */ jsx32(SpaceStatus, { message: `Entering ${spaceName}\u2026` }) });
|
|
4685
|
+
return /* @__PURE__ */ jsx32(AppearanceLayer, { children: /* @__PURE__ */ jsx32(Entrance, { defaultDisplayName: props.displayName, defaults: props.defaults, joining: true, logoUrl: props.logoUrl, onJoin: join, spaceName }) });
|
|
4445
4686
|
}
|
|
4446
4687
|
if (connection.status === "failed") {
|
|
4447
4688
|
if (!hasBeenLive.current && entrance) {
|
|
4448
|
-
return /* @__PURE__ */
|
|
4689
|
+
return /* @__PURE__ */ jsx32(AppearanceLayer, { children: /* @__PURE__ */ jsx32(Entrance, { defaultDisplayName: props.displayName, defaults: props.defaults, error: connection.lastError?.message ?? "Unable to enter this Space.", logoUrl: props.logoUrl, onJoin: join, spaceName }) });
|
|
4449
4690
|
}
|
|
4450
|
-
return /* @__PURE__ */
|
|
4691
|
+
return /* @__PURE__ */ jsx32(AppearanceLayer, { children: /* @__PURE__ */ jsx32(SpaceStatus, { message: connection.lastError?.message ?? "This Space is unavailable.", onRetry: () => void join(defaultJoinOptions(props)) }) });
|
|
4451
4692
|
}
|
|
4452
4693
|
if (connection.status === "leaving")
|
|
4453
|
-
return /* @__PURE__ */
|
|
4694
|
+
return /* @__PURE__ */ jsx32(AppearanceLayer, { children: /* @__PURE__ */ jsx32(SpaceStatus, { message: `Leaving ${spaceName}\u2026` }) });
|
|
4454
4695
|
if (connection.status === "left")
|
|
4455
|
-
return /* @__PURE__ */
|
|
4456
|
-
return /* @__PURE__ */
|
|
4696
|
+
return /* @__PURE__ */ jsx32(AppearanceLayer, { children: /* @__PURE__ */ jsx32(SpaceStatus, { message: "You have left this Space.", onRetry: () => void join(defaultJoinOptions(props)) }) });
|
|
4697
|
+
return /* @__PURE__ */ jsx32(
|
|
4457
4698
|
NativeSpaceView,
|
|
4458
4699
|
{
|
|
4459
4700
|
features: props.features,
|
|
@@ -4479,8 +4720,8 @@ function defaultJoinOptions(props) {
|
|
|
4479
4720
|
function NativeSpaceView({ features, inviteLink, layout, logoUrl, onLayoutChange, onOpenDiagnostics, pickChatFiles, reconnecting, spaceName }) {
|
|
4480
4721
|
const client = useSpaceClient();
|
|
4481
4722
|
const theme = useNativeTheme();
|
|
4482
|
-
return /* @__PURE__ */
|
|
4483
|
-
/* @__PURE__ */
|
|
4723
|
+
return /* @__PURE__ */ jsxs23(View24, { style: [styles24.space, { backgroundColor: theme.colors.background }], children: [
|
|
4724
|
+
/* @__PURE__ */ jsx32(
|
|
4484
4725
|
SpaceView,
|
|
4485
4726
|
{
|
|
4486
4727
|
features,
|
|
@@ -4496,21 +4737,21 @@ function NativeSpaceView({ features, inviteLink, layout, logoUrl, onLayoutChange
|
|
|
4496
4737
|
spaceName
|
|
4497
4738
|
}
|
|
4498
4739
|
),
|
|
4499
|
-
/* @__PURE__ */
|
|
4740
|
+
/* @__PURE__ */ jsx32(NativeTextureOverlay, {})
|
|
4500
4741
|
] });
|
|
4501
4742
|
}
|
|
4502
4743
|
function AppearanceLayer({ children }) {
|
|
4503
4744
|
const theme = useNativeTheme();
|
|
4504
|
-
return /* @__PURE__ */
|
|
4745
|
+
return /* @__PURE__ */ jsxs23(View24, { style: [styles24.appearanceLayer, { backgroundColor: theme.colors.background }], children: [
|
|
4505
4746
|
children,
|
|
4506
|
-
/* @__PURE__ */
|
|
4747
|
+
/* @__PURE__ */ jsx32(NativeTextureOverlay, {})
|
|
4507
4748
|
] });
|
|
4508
4749
|
}
|
|
4509
4750
|
function SpaceStatus({ message, onRetry }) {
|
|
4510
4751
|
const theme = useNativeTheme();
|
|
4511
|
-
return /* @__PURE__ */
|
|
4512
|
-
/* @__PURE__ */
|
|
4513
|
-
onRetry ? /* @__PURE__ */
|
|
4752
|
+
return /* @__PURE__ */ jsxs23(View24, { accessibilityLiveRegion: "polite", style: [styles24.status, { backgroundColor: theme.colors.background }], children: [
|
|
4753
|
+
/* @__PURE__ */ jsx32(Text19, { style: [styles24.statusText, { color: theme.colors.foreground }], children: message }),
|
|
4754
|
+
onRetry ? /* @__PURE__ */ jsx32(Pressable17, { accessibilityRole: "button", onPress: onRetry, style: [styles24.retry, { backgroundColor: theme.colors.primary }], children: /* @__PURE__ */ jsx32(Text19, { style: [styles24.retryText, { color: theme.colors.primaryForeground }], children: "Try again" }) }) : null
|
|
4514
4755
|
] });
|
|
4515
4756
|
}
|
|
4516
4757
|
var styles24 = StyleSheet25.create({
|
|
@@ -4541,6 +4782,7 @@ export {
|
|
|
4541
4782
|
useReactions,
|
|
4542
4783
|
useWhiteboard,
|
|
4543
4784
|
useCan,
|
|
4785
|
+
Logo,
|
|
4544
4786
|
Entrance,
|
|
4545
4787
|
Chalk,
|
|
4546
4788
|
buildChalkInviteLink
|