@dxos/plugin-thread 0.8.4-main.67995b8 → 0.8.4-main.f5c0578
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/lib/browser/ChannelContainer-O2SFQJU7.mjs +16 -0
- package/dist/lib/browser/{ChatContainer-AIGIWAUG.mjs → ChatContainer-PVT3DUZJ.mjs} +4 -4
- package/dist/lib/browser/{app-graph-builder-N7BE5TYW.mjs → app-graph-builder-AF3M7UWN.mjs} +5 -5
- package/dist/lib/browser/app-graph-builder-AF3M7UWN.mjs.map +7 -0
- package/dist/lib/browser/{call-manager-NIPDYUVD.mjs → call-manager-XRRCAVLI.mjs} +4 -4
- package/dist/lib/browser/call-manager-XRRCAVLI.mjs.map +7 -0
- package/dist/lib/browser/chunk-2CWJBXBH.mjs +21 -0
- package/dist/lib/browser/{chunk-LGSDKXPF.mjs → chunk-4APCDRSH.mjs} +1 -1
- package/dist/lib/browser/{chunk-LGSDKXPF.mjs.map → chunk-4APCDRSH.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-GCLD5ESP.mjs → chunk-DW7JD64V.mjs} +1 -1
- package/dist/lib/browser/{chunk-GCLD5ESP.mjs.map → chunk-DW7JD64V.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-3SGRT4NM.mjs → chunk-FY4ZRD5X.mjs} +8 -8
- package/dist/lib/{node-esm/chunk-FLBFYGBK.mjs.map → browser/chunk-FY4ZRD5X.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-VUWC4IJM.mjs → chunk-J3JO5NWO.mjs} +26 -28
- package/dist/lib/browser/chunk-J3JO5NWO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6NSMBO3B.mjs → chunk-JGKMMI65.mjs} +2 -2
- package/dist/lib/browser/{chunk-6NSMBO3B.mjs.map → chunk-JGKMMI65.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-ZE7KWN36.mjs → chunk-TUFWPOVS.mjs} +92 -63
- package/dist/lib/browser/chunk-TUFWPOVS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ERWASUQK.mjs → chunk-X5PIP5YR.mjs} +3 -3
- package/dist/lib/browser/{chunk-ERWASUQK.mjs.map → chunk-X5PIP5YR.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-KWPRNHTK.mjs → chunk-ZJ7QBXK6.mjs} +225 -225
- package/dist/lib/browser/chunk-ZJ7QBXK6.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +7 -7
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-JFGLZ6VI.mjs → intent-resolver-DCY4P4OX.mjs} +8 -8
- package/dist/lib/browser/intent-resolver-DCY4P4OX.mjs.map +7 -0
- package/dist/lib/browser/{markdown-M3FMR7OD.mjs → markdown-WZSXCEZJ.mjs} +4 -4
- package/dist/lib/browser/markdown-WZSXCEZJ.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-JEUSQXI6.mjs → react-root-QXPALOUQ.mjs} +9 -9
- package/dist/lib/browser/{react-surface-XWS6GIZY.mjs → react-surface-PYAMIADB.mjs} +9 -9
- package/dist/lib/browser/react-surface-PYAMIADB.mjs.map +7 -0
- package/dist/lib/browser/{settings-E32MTL7A.mjs → settings-AC6YSASL.mjs} +2 -2
- package/dist/lib/browser/{state-H6CYONWE.mjs → state-2T4KDWBX.mjs} +2 -2
- package/dist/lib/browser/{state-H6CYONWE.mjs.map → state-2T4KDWBX.mjs.map} +2 -2
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{ChannelContainer-7FXCKO7X.mjs → ChannelContainer-B2ZGAE4P.mjs} +7 -7
- package/dist/lib/node-esm/{ChatContainer-IQUWU426.mjs → ChatContainer-2CT4PJ7I.mjs} +4 -4
- package/dist/lib/node-esm/{app-graph-builder-VCW76Z6V.mjs → app-graph-builder-OLSJVCWY.mjs} +5 -5
- package/dist/lib/node-esm/app-graph-builder-OLSJVCWY.mjs.map +7 -0
- package/dist/lib/node-esm/{call-manager-D6O5ZJJ4.mjs → call-manager-EI7FXRAU.mjs} +4 -4
- package/dist/lib/node-esm/call-manager-EI7FXRAU.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-IHDNQLLR.mjs → chunk-4TME3BR4.mjs} +92 -63
- package/dist/lib/node-esm/chunk-4TME3BR4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6CRHHOST.mjs +23 -0
- package/dist/lib/node-esm/{chunk-FLBFYGBK.mjs → chunk-BF4UKS55.mjs} +8 -8
- package/dist/lib/node-esm/chunk-BF4UKS55.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-75RJ5DJI.mjs → chunk-PYTVBN5J.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-75RJ5DJI.mjs.map → chunk-PYTVBN5J.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-OU5BYIDO.mjs → chunk-QBHKLWGR.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-OU5BYIDO.mjs.map → chunk-QBHKLWGR.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-25ABSYP2.mjs → chunk-SED3O2XO.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-25ABSYP2.mjs.map → chunk-SED3O2XO.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-2MFNK53T.mjs → chunk-VNG6M2IY.mjs} +26 -28
- package/dist/lib/node-esm/chunk-VNG6M2IY.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TDFHTCZZ.mjs → chunk-XVKWHTH4.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-TDFHTCZZ.mjs.map → chunk-XVKWHTH4.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-C3XFMUAY.mjs → chunk-YIDU3DXK.mjs} +225 -225
- package/dist/lib/node-esm/chunk-YIDU3DXK.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +7 -7
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-OXGNQ44Y.mjs → intent-resolver-QGTPU6QB.mjs} +8 -8
- package/dist/lib/node-esm/intent-resolver-QGTPU6QB.mjs.map +7 -0
- package/dist/lib/node-esm/{markdown-INKTE4MH.mjs → markdown-3MZXUGUA.mjs} +4 -4
- package/dist/lib/node-esm/markdown-3MZXUGUA.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-root-XYYY2JXZ.mjs → react-root-7ZFJYVUZ.mjs} +9 -9
- package/dist/lib/node-esm/{react-surface-MJ33KPYE.mjs → react-surface-UJFCSFNO.mjs} +9 -9
- package/dist/lib/node-esm/react-surface-UJFCSFNO.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-SJ24YG7M.mjs → settings-N52O7MLS.mjs} +2 -2
- package/dist/lib/node-esm/{state-D7WNDT3N.mjs → state-62TQKQVB.mjs} +2 -2
- package/dist/lib/node-esm/{state-D7WNDT3N.mjs.map → state-62TQKQVB.mjs.map} +2 -2
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/calls/call-manager.d.ts.map +1 -1
- package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
- package/dist/types/src/calls/media-manager.d.ts.map +1 -1
- package/dist/types/src/calls/types.d.ts +1 -1
- package/dist/types/src/calls/types.d.ts.map +1 -1
- package/dist/types/src/calls/util/calls-service.d.ts +1 -1
- package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
- package/dist/types/src/calls/util/stub-media-streams.d.ts.map +1 -1
- package/dist/types/src/calls-service.stories.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/call-manager.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +2 -2
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/markdown.d.ts +1 -1
- package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/components/Call/Call.d.ts.map +1 -1
- package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/CallDebugPanel.d.ts.map +1 -1
- package/dist/types/src/components/CallSidebar.d.ts.map +1 -1
- package/dist/types/src/components/ChannelContainer.d.ts.map +1 -1
- package/dist/types/src/components/ChannelContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chat.stories.d.ts.map +1 -1
- package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
- package/dist/types/src/components/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/components/CommentsContainer.d.ts.map +1 -1
- package/dist/types/src/components/CommentsThreadContainer.d.ts.map +1 -1
- package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
- package/dist/types/src/components/Media/VideoObject.d.ts +1 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts +1 -1
- package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
- package/dist/types/src/components/MessageContainer.d.ts.map +1 -1
- package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +1 -1
- package/dist/types/src/extensions/threads.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +7 -5
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +8 -6
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +49 -49
- package/src/ThreadPlugin.tsx +2 -2
- package/src/calls/call-manager.ts +1 -1
- package/src/calls/call-swarm-synchronizer.ts +1 -1
- package/src/calls/media-manager.ts +2 -2
- package/src/calls/types.ts +1 -1
- package/src/calls/util/calls-service.ts +4 -3
- package/src/calls/util/stub-media-streams.ts +2 -2
- package/src/calls-service.stories.tsx +3 -3
- package/src/capabilities/app-graph-builder.ts +6 -5
- package/src/capabilities/call-manager.ts +3 -2
- package/src/capabilities/capabilities.ts +2 -2
- package/src/capabilities/intent-resolver.ts +4 -3
- package/src/capabilities/markdown.ts +4 -3
- package/src/capabilities/react-surface.tsx +5 -4
- package/src/capabilities/state.ts +2 -1
- package/src/components/Call/Call.tsx +3 -2
- package/src/components/Call/Toolbar.tsx +2 -2
- package/src/components/CallDebugPanel.tsx +1 -1
- package/src/components/CallSidebar.tsx +2 -1
- package/src/components/ChannelContainer.stories.tsx +3 -2
- package/src/components/ChannelContainer.tsx +7 -6
- package/src/components/Chat.stories.tsx +3 -2
- package/src/components/ChatContainer.tsx +4 -3
- package/src/components/Comments.stories.tsx +4 -3
- package/src/components/CommentsContainer.tsx +2 -1
- package/src/components/CommentsThreadContainer.tsx +3 -2
- package/src/components/Lobby/Lobby.tsx +1 -1
- package/src/components/Media/VideoObject.stories.tsx +4 -3
- package/src/components/MessageContainer.tsx +4 -3
- package/src/components/Participant/ParticipantGrid.tsx +2 -1
- package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +4 -3
- package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +4 -3
- package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +1 -1
- package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +2 -2
- package/src/components/ThreadComplementary.tsx +1 -1
- package/src/components/command-extension.ts +1 -1
- package/src/extensions/threads.ts +3 -3
- package/src/hooks/useDebugMode.ts +1 -1
- package/src/testing/stories.ts +2 -2
- package/src/types/types.ts +2 -1
- package/src/typings.d.ts +8 -0
- package/dist/lib/browser/ChannelContainer-3GIE7ASU.mjs +0 -16
- package/dist/lib/browser/app-graph-builder-N7BE5TYW.mjs.map +0 -7
- package/dist/lib/browser/call-manager-NIPDYUVD.mjs.map +0 -7
- package/dist/lib/browser/chunk-3SGRT4NM.mjs.map +0 -7
- package/dist/lib/browser/chunk-FR7KJPNY.mjs +0 -21
- package/dist/lib/browser/chunk-KWPRNHTK.mjs.map +0 -7
- package/dist/lib/browser/chunk-VUWC4IJM.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZE7KWN36.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-JFGLZ6VI.mjs.map +0 -7
- package/dist/lib/browser/markdown-M3FMR7OD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-XWS6GIZY.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-VCW76Z6V.mjs.map +0 -7
- package/dist/lib/node-esm/call-manager-D6O5ZJJ4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2CXOK2TD.mjs +0 -23
- package/dist/lib/node-esm/chunk-2MFNK53T.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-C3XFMUAY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-IHDNQLLR.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-OXGNQ44Y.mjs.map +0 -7
- package/dist/lib/node-esm/markdown-INKTE4MH.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-MJ33KPYE.mjs.map +0 -7
- /package/dist/lib/browser/{ChannelContainer-3GIE7ASU.mjs.map → ChannelContainer-O2SFQJU7.mjs.map} +0 -0
- /package/dist/lib/browser/{ChatContainer-AIGIWAUG.mjs.map → ChatContainer-PVT3DUZJ.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-FR7KJPNY.mjs.map → chunk-2CWJBXBH.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-JEUSQXI6.mjs.map → react-root-QXPALOUQ.mjs.map} +0 -0
- /package/dist/lib/browser/{settings-E32MTL7A.mjs.map → settings-AC6YSASL.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChannelContainer-7FXCKO7X.mjs.map → ChannelContainer-B2ZGAE4P.mjs.map} +0 -0
- /package/dist/lib/node-esm/{ChatContainer-IQUWU426.mjs.map → ChatContainer-2CT4PJ7I.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-2CXOK2TD.mjs.map → chunk-6CRHHOST.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-root-XYYY2JXZ.mjs.map → react-root-7ZFJYVUZ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{settings-SJ24YG7M.mjs.map → settings-N52O7MLS.mjs.map} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ThreadCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4APCDRSH.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ChatContainer_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-J3JO5NWO.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useDebugMode
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-X5PIP5YR.mjs";
|
|
10
10
|
import {
|
|
11
11
|
meta
|
|
12
12
|
} from "./chunk-EV4JWI7L.mjs";
|
|
@@ -22,9 +22,9 @@ import { log } from "@dxos/log";
|
|
|
22
22
|
import { useClient } from "@dxos/react-client";
|
|
23
23
|
import { fullyQualifiedId as fullyQualifiedId2, getSpace } from "@dxos/react-client/echo";
|
|
24
24
|
import { useIdentity } from "@dxos/react-client/halo";
|
|
25
|
-
import { useTranslation as useTranslation3
|
|
26
|
-
import { ControlGroup,
|
|
27
|
-
import {
|
|
25
|
+
import { ElevationProvider, Input, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
26
|
+
import { ControlGroup, ControlGroupButton, ControlItemInput } from "@dxos/react-ui-form";
|
|
27
|
+
import { MenuProvider, ToolbarMenu, createMenuAction, createMenuItemGroup, useMenuActions } from "@dxos/react-ui-menu";
|
|
28
28
|
import { useSoundEffect } from "@dxos/react-ui-sfx";
|
|
29
29
|
import { StackItem } from "@dxos/react-ui-stack";
|
|
30
30
|
|
|
@@ -33,153 +33,11 @@ import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking"
|
|
|
33
33
|
import React9 from "react";
|
|
34
34
|
import { useCapability as useCapability3 } from "@dxos/app-framework";
|
|
35
35
|
|
|
36
|
-
// src/components/Call/Toolbar.tsx
|
|
37
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
38
|
-
import React from "react";
|
|
39
|
-
import { useAppGraph, useCapability } from "@dxos/app-framework";
|
|
40
|
-
import { useNode, useActions } from "@dxos/plugin-graph";
|
|
41
|
-
import { fullyQualifiedId } from "@dxos/react-client/echo";
|
|
42
|
-
import { Icon, IconButton, Toolbar as NativeToolbar, toLocalizedString, useTranslation } from "@dxos/react-ui";
|
|
43
|
-
import { groupHoverControlItemWithTransition, mx } from "@dxos/react-ui-theme";
|
|
44
|
-
var Toolbar = ({ classNames, channel, participants, autoHideControls = true, onJoin, onLeave }) => {
|
|
45
|
-
var _effect = _useSignals();
|
|
46
|
-
try {
|
|
47
|
-
const { t } = useTranslation(meta.id);
|
|
48
|
-
const { graph } = useAppGraph();
|
|
49
|
-
const call = useCapability(ThreadCapabilities.CallManager);
|
|
50
|
-
const node = useNode(graph, channel && fullyQualifiedId(channel));
|
|
51
|
-
const actions = useActions(graph, node?.id).filter((action) => action.properties.disposition === "toolbar");
|
|
52
|
-
const isScreensharing = call.media.screenshareTrack !== void 0;
|
|
53
|
-
const canSharescreen = typeof navigator.mediaDevices !== "undefined" && navigator.mediaDevices.getDisplayMedia !== void 0;
|
|
54
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
55
|
-
className: mx("z-20 flex justify-center m-8", autoHideControls && groupHoverControlItemWithTransition)
|
|
56
|
-
}, /* @__PURE__ */ React.createElement(NativeToolbar.Root, {
|
|
57
|
-
classNames: [
|
|
58
|
-
"p-2 bg-modalSurface rounded-md shadow-md",
|
|
59
|
-
classNames
|
|
60
|
-
]
|
|
61
|
-
}, /* @__PURE__ */ React.createElement(ToggleButton, {
|
|
62
|
-
active: call.media.audioEnabled,
|
|
63
|
-
state: {
|
|
64
|
-
on: {
|
|
65
|
-
icon: "ph--microphone--regular",
|
|
66
|
-
label: t("mic off"),
|
|
67
|
-
onClick: () => call.turnAudioOff(),
|
|
68
|
-
classNames: "bg-callActive"
|
|
69
|
-
},
|
|
70
|
-
off: {
|
|
71
|
-
icon: "ph--microphone-slash--duotone",
|
|
72
|
-
label: t("mic on"),
|
|
73
|
-
onClick: () => call.turnAudioOn(),
|
|
74
|
-
classNames: [
|
|
75
|
-
call.joined && "bg-callAlert"
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}), /* @__PURE__ */ React.createElement(ToggleButton, {
|
|
80
|
-
active: call.media.videoEnabled,
|
|
81
|
-
state: {
|
|
82
|
-
on: {
|
|
83
|
-
icon: "ph--video-camera--regular",
|
|
84
|
-
label: t("camera off"),
|
|
85
|
-
onClick: () => call.turnVideoOff()
|
|
86
|
-
},
|
|
87
|
-
off: {
|
|
88
|
-
icon: "ph--video-camera-slash--duotone",
|
|
89
|
-
label: t("camera on"),
|
|
90
|
-
onClick: () => call.turnVideoOn()
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}), participants !== void 0 && /* @__PURE__ */ React.createElement("div", {
|
|
94
|
-
className: "flex justify-center items-center gap-2 is-[5rem] text-xs text-subdued"
|
|
95
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
96
|
-
icon: "ph--users--regular",
|
|
97
|
-
size: 4
|
|
98
|
-
}), /* @__PURE__ */ React.createElement("div", null, participants)) || /* @__PURE__ */ React.createElement(NativeToolbar.Separator, {
|
|
99
|
-
variant: "gap"
|
|
100
|
-
}), call.joined && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(ToggleButton, {
|
|
101
|
-
disabled: !canSharescreen,
|
|
102
|
-
active: isScreensharing,
|
|
103
|
-
state: {
|
|
104
|
-
on: {
|
|
105
|
-
icon: "ph--monitor--regular",
|
|
106
|
-
label: t("screenshare off"),
|
|
107
|
-
onClick: () => call.turnScreenshareOff()
|
|
108
|
-
},
|
|
109
|
-
off: {
|
|
110
|
-
icon: "ph--monitor-arrow-up--duotone",
|
|
111
|
-
label: t("screenshare on"),
|
|
112
|
-
onClick: () => call.turnScreenshareOn()
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}), actions.map((action) => /* @__PURE__ */ React.createElement(IconButton, {
|
|
116
|
-
key: action.id,
|
|
117
|
-
...defaultButtonProps,
|
|
118
|
-
icon: action.properties.icon,
|
|
119
|
-
label: toLocalizedString(action.properties.label, t),
|
|
120
|
-
classNames: action.properties.classNames,
|
|
121
|
-
onClick: () => action.data({
|
|
122
|
-
node
|
|
123
|
-
})
|
|
124
|
-
})), /* @__PURE__ */ React.createElement(ToggleButton, {
|
|
125
|
-
active: call.raisedHand,
|
|
126
|
-
state: {
|
|
127
|
-
on: {
|
|
128
|
-
icon: "ph--hand-waving--regular",
|
|
129
|
-
label: t("lower hand"),
|
|
130
|
-
onClick: () => call.setRaisedHand(false),
|
|
131
|
-
classNames: [
|
|
132
|
-
call.joined && "bg-callAlert"
|
|
133
|
-
]
|
|
134
|
-
},
|
|
135
|
-
off: {
|
|
136
|
-
icon: "ph--hand-palm--duotone",
|
|
137
|
-
label: t("raise hand"),
|
|
138
|
-
onClick: () => call.setRaisedHand(true)
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
})), call.joined ? /* @__PURE__ */ React.createElement(IconButton, {
|
|
142
|
-
variant: "destructive",
|
|
143
|
-
icon: "ph--phone-x--regular",
|
|
144
|
-
label: t("leave call"),
|
|
145
|
-
onClick: onLeave
|
|
146
|
-
}) : /* @__PURE__ */ React.createElement(IconButton, {
|
|
147
|
-
variant: "primary",
|
|
148
|
-
icon: "ph--phone-incoming--regular",
|
|
149
|
-
label: t("join call"),
|
|
150
|
-
onClick: onJoin
|
|
151
|
-
})));
|
|
152
|
-
} finally {
|
|
153
|
-
_effect.f();
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
Toolbar.displayName = "MeetingToolbar";
|
|
157
|
-
var defaultButtonProps = {
|
|
158
|
-
size: 5,
|
|
159
|
-
iconOnly: true
|
|
160
|
-
};
|
|
161
|
-
var ToggleButton = ({ active, state }) => {
|
|
162
|
-
var _effect = _useSignals();
|
|
163
|
-
try {
|
|
164
|
-
return /* @__PURE__ */ React.createElement(IconButton, {
|
|
165
|
-
...defaultButtonProps,
|
|
166
|
-
classNames: [
|
|
167
|
-
active ? state.on.classNames ?? "bg-callActive" : state.off.classNames
|
|
168
|
-
],
|
|
169
|
-
icon: active ? state.on.icon : state.off.icon,
|
|
170
|
-
label: active ? state.on.label : state.off.label,
|
|
171
|
-
onClick: active ? state.on.onClick : state.off.onClick
|
|
172
|
-
});
|
|
173
|
-
} finally {
|
|
174
|
-
_effect.f();
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
|
|
178
36
|
// src/components/Media/AudioStream.tsx
|
|
179
|
-
import { useSignals as
|
|
180
|
-
import
|
|
37
|
+
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
38
|
+
import React, { useEffect, useRef } from "react";
|
|
181
39
|
var AudioStream = ({ tracks }) => {
|
|
182
|
-
var _effect =
|
|
40
|
+
var _effect = _useSignals();
|
|
183
41
|
try {
|
|
184
42
|
const mediaStreamRef = useRef(new MediaStream());
|
|
185
43
|
const ref = useRef(null);
|
|
@@ -202,10 +60,10 @@ var AudioStream = ({ tracks }) => {
|
|
|
202
60
|
});
|
|
203
61
|
audio.srcObject = mediaStream;
|
|
204
62
|
};
|
|
205
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("audio", {
|
|
206
64
|
ref,
|
|
207
65
|
autoPlay: true
|
|
208
|
-
}), tracks.map((track) => /* @__PURE__ */
|
|
66
|
+
}), tracks.map((track) => /* @__PURE__ */ React.createElement(AudioTrack, {
|
|
209
67
|
key: track.id,
|
|
210
68
|
track,
|
|
211
69
|
mediaStream: mediaStreamRef.current,
|
|
@@ -232,11 +90,11 @@ var AudioTrack = ({ track, mediaStream, resetSrcObject }) => {
|
|
|
232
90
|
};
|
|
233
91
|
|
|
234
92
|
// src/components/Media/VideoObject.tsx
|
|
235
|
-
import { useSignals as
|
|
236
|
-
import
|
|
237
|
-
import { mx
|
|
93
|
+
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
94
|
+
import React2, { forwardRef, memo, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
95
|
+
import { mx } from "@dxos/react-ui-theme";
|
|
238
96
|
var VideoObject = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ videoStream, classNames, flip, contain, ...rest }, ref) => {
|
|
239
|
-
var _effect =
|
|
97
|
+
var _effect = _useSignals2();
|
|
240
98
|
try {
|
|
241
99
|
const internalRef = useRef2(null);
|
|
242
100
|
useEffect2(() => {
|
|
@@ -250,8 +108,8 @@ var VideoObject = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ videoStream
|
|
|
250
108
|
videoStream,
|
|
251
109
|
internalRef.current
|
|
252
110
|
]);
|
|
253
|
-
return /* @__PURE__ */
|
|
254
|
-
className:
|
|
111
|
+
return /* @__PURE__ */ React2.createElement("video", {
|
|
112
|
+
className: mx("w-full aspect-video", flip && "scale-x-[-1]", contain ? "object-contain" : "object-cover", classNames),
|
|
255
113
|
ref: (v) => {
|
|
256
114
|
internalRef.current = v;
|
|
257
115
|
if (ref === null) {
|
|
@@ -272,28 +130,28 @@ var VideoObject = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ videoStream
|
|
|
272
130
|
VideoObject.displayName = "VideoObject";
|
|
273
131
|
|
|
274
132
|
// src/components/Participant/Participant.tsx
|
|
275
|
-
import { useSignals as
|
|
276
|
-
import
|
|
277
|
-
import { useCapability
|
|
133
|
+
import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
|
|
134
|
+
import React6, { memo as memo2, useMemo as useMemo2 } from "react";
|
|
135
|
+
import { useCapability } from "@dxos/app-framework";
|
|
278
136
|
|
|
279
137
|
// src/components/ResponsiveGrid/ResponsiveContainer.tsx
|
|
280
|
-
import { useSignals as
|
|
281
|
-
import
|
|
282
|
-
import { mx as
|
|
138
|
+
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
139
|
+
import React3 from "react";
|
|
140
|
+
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
283
141
|
var ResponsiveContainer = ({ children }) => {
|
|
284
|
-
var _effect =
|
|
142
|
+
var _effect = _useSignals3();
|
|
285
143
|
try {
|
|
286
144
|
return (
|
|
287
145
|
// Outer container that takes full size of parent.
|
|
288
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ React3.createElement("div", {
|
|
289
147
|
role: "none",
|
|
290
148
|
className: "relative flex w-full h-full"
|
|
291
|
-
}, /* @__PURE__ */
|
|
149
|
+
}, /* @__PURE__ */ React3.createElement("div", {
|
|
292
150
|
role: "none",
|
|
293
151
|
className: "absolute inset-0 flex justify-center items-center"
|
|
294
|
-
}, /* @__PURE__ */
|
|
152
|
+
}, /* @__PURE__ */ React3.createElement("div", {
|
|
295
153
|
role: "none",
|
|
296
|
-
className:
|
|
154
|
+
className: mx2("max-h-full max-w-full w-auto h-auto aspect-video")
|
|
297
155
|
}, children)))
|
|
298
156
|
);
|
|
299
157
|
} finally {
|
|
@@ -302,11 +160,11 @@ var ResponsiveContainer = ({ children }) => {
|
|
|
302
160
|
};
|
|
303
161
|
|
|
304
162
|
// src/components/ResponsiveGrid/ResponsiveGrid.tsx
|
|
305
|
-
import { useSignals as
|
|
306
|
-
import
|
|
163
|
+
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
164
|
+
import React4, { useCallback, useEffect as useEffect3, useLayoutEffect, useMemo, useState } from "react";
|
|
307
165
|
import { useResizeDetector } from "react-resize-detector";
|
|
308
166
|
import { invariant } from "@dxos/invariant";
|
|
309
|
-
import { mx as
|
|
167
|
+
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
310
168
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-thread/src/components/ResponsiveGrid/ResponsiveGrid.tsx";
|
|
311
169
|
var ASPECT_RATIO = 16 / 9;
|
|
312
170
|
var MIN_GALLERY_HEIGHT = 250;
|
|
@@ -314,7 +172,7 @@ var DEFAULT_GAP = 8;
|
|
|
314
172
|
var maxImageSize = "w-[2560px] h-[1440px]";
|
|
315
173
|
var defaultGetId = (item) => item.id;
|
|
316
174
|
var ResponsiveGrid = ({ classNames, Cell, gap = DEFAULT_GAP, getId: getId2 = defaultGetId, items, pinned, autoHideGallery = false, debug, onPinnedChange }) => {
|
|
317
|
-
var _effect =
|
|
175
|
+
var _effect = _useSignals4();
|
|
318
176
|
try {
|
|
319
177
|
const { width: containerWidth = 0, height: containerHeight = 0, ref: containerRef } = useResizeDetector({
|
|
320
178
|
refreshRate: 100
|
|
@@ -401,47 +259,47 @@ var ResponsiveGrid = ({ classNames, Cell, gap = DEFAULT_GAP, getId: getId2 = def
|
|
|
401
259
|
pinned,
|
|
402
260
|
onPinnedChange
|
|
403
261
|
]);
|
|
404
|
-
return /* @__PURE__ */
|
|
262
|
+
return /* @__PURE__ */ React4.createElement("div", {
|
|
405
263
|
ref: containerRef,
|
|
406
|
-
className:
|
|
407
|
-
}, /* @__PURE__ */
|
|
264
|
+
className: mx3("relative w-full h-full", classNames)
|
|
265
|
+
}, /* @__PURE__ */ React4.createElement("div", {
|
|
408
266
|
className: "absolute inset-0 flex flex-col grow gap-2"
|
|
409
|
-
}, pinnedItem && /* @__PURE__ */
|
|
410
|
-
className:
|
|
267
|
+
}, pinnedItem && /* @__PURE__ */ React4.createElement("div", {
|
|
268
|
+
className: mx3("flex grow-[2] shrink overflow-hidden justify-center items-center", hideGallery && "h-full"),
|
|
411
269
|
style: hideGallery ? {} : {
|
|
412
270
|
height: dividerHeight
|
|
413
271
|
}
|
|
414
|
-
}, /* @__PURE__ */
|
|
272
|
+
}, /* @__PURE__ */ React4.createElement(SoloItem, {
|
|
415
273
|
id: getId2(pinnedItem),
|
|
416
274
|
debug
|
|
417
|
-
})), !hideGallery && /* @__PURE__ */
|
|
275
|
+
})), !hideGallery && /* @__PURE__ */ React4.createElement("div", {
|
|
418
276
|
ref: gridContainerRef,
|
|
419
277
|
className: "flex grow-[1] overflow-hidden justify-center items-center",
|
|
420
278
|
style: hideGallery ? {} : {
|
|
421
279
|
minHeight: MIN_GALLERY_HEIGHT
|
|
422
280
|
}
|
|
423
|
-
}, mainItems.length === 1 && /* @__PURE__ */
|
|
281
|
+
}, mainItems.length === 1 && /* @__PURE__ */ React4.createElement("div", {
|
|
424
282
|
style: {
|
|
425
283
|
width: cellWidth
|
|
426
284
|
},
|
|
427
285
|
className: "flex h-full"
|
|
428
|
-
}, /* @__PURE__ */
|
|
286
|
+
}, /* @__PURE__ */ React4.createElement(SoloItem, {
|
|
429
287
|
id: getId2(mainItems[0]),
|
|
430
288
|
debug
|
|
431
|
-
})), mainItems.length > 1 && columns > 0 && /* @__PURE__ */
|
|
289
|
+
})), mainItems.length > 1 && columns > 0 && /* @__PURE__ */ React4.createElement("div", {
|
|
432
290
|
role: "grid",
|
|
433
291
|
style: {
|
|
434
292
|
display: "grid",
|
|
435
293
|
gridTemplateColumns: `repeat(${columns}, ${cellWidth}px)`,
|
|
436
294
|
gap: `${gap}px`
|
|
437
295
|
}
|
|
438
|
-
}, mainItems.map((item) => /* @__PURE__ */
|
|
296
|
+
}, mainItems.map((item) => /* @__PURE__ */ React4.createElement("div", {
|
|
439
297
|
key: getId2(item),
|
|
440
298
|
"data-grid-item": getId2(item),
|
|
441
|
-
className:
|
|
442
|
-
}))))), /* @__PURE__ */
|
|
443
|
-
className:
|
|
444
|
-
}, bounds.map(([item, bounds2]) => /* @__PURE__ */
|
|
299
|
+
className: mx3("aspect-video max-h-full max-w-full w-auto h-auto", debug && "border border-primary-500")
|
|
300
|
+
}))))), /* @__PURE__ */ React4.createElement("div", {
|
|
301
|
+
className: mx3(debug && "opacity-10")
|
|
302
|
+
}, bounds.map(([item, bounds2]) => /* @__PURE__ */ React4.createElement(Cell, {
|
|
445
303
|
key: getId2(item),
|
|
446
304
|
classNames: "absolute transition-all duration-500",
|
|
447
305
|
item,
|
|
@@ -454,14 +312,14 @@ var ResponsiveGrid = ({ classNames, Cell, gap = DEFAULT_GAP, getId: getId2 = def
|
|
|
454
312
|
}
|
|
455
313
|
};
|
|
456
314
|
var SoloItem = ({ debug, id }) => {
|
|
457
|
-
var _effect =
|
|
315
|
+
var _effect = _useSignals4();
|
|
458
316
|
try {
|
|
459
|
-
return /* @__PURE__ */
|
|
317
|
+
return /* @__PURE__ */ React4.createElement(ResponsiveContainer, null, /* @__PURE__ */ React4.createElement("div", {
|
|
460
318
|
"data-grid-item": id,
|
|
461
|
-
className:
|
|
462
|
-
}, /* @__PURE__ */
|
|
319
|
+
className: mx3("aspect-video overflow-hidden", debug && "z-20 border-2 border-primary-500")
|
|
320
|
+
}, /* @__PURE__ */ React4.createElement("img", {
|
|
463
321
|
alt: "placeholder video",
|
|
464
|
-
className:
|
|
322
|
+
className: mx3("opacity-0", maxImageSize)
|
|
465
323
|
})));
|
|
466
324
|
} finally {
|
|
467
325
|
_effect.f();
|
|
@@ -531,15 +389,15 @@ var fitAspectRatio = (outerWidth, outerHeight, aspectRatio) => {
|
|
|
531
389
|
};
|
|
532
390
|
|
|
533
391
|
// src/components/ResponsiveGrid/ResponsiveGridItem.tsx
|
|
534
|
-
import { useSignals as
|
|
535
|
-
import
|
|
536
|
-
import { Icon
|
|
392
|
+
import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
|
|
393
|
+
import React5, { useEffect as useEffect4, useState as useState2 } from "react";
|
|
394
|
+
import { Icon, IconButton, useTranslation } from "@dxos/react-ui";
|
|
537
395
|
import { Waveform } from "@dxos/react-ui-sfx";
|
|
538
|
-
import { groupHoverControlItemWithTransition
|
|
396
|
+
import { groupHoverControlItemWithTransition, mx as mx4 } from "@dxos/react-ui-theme";
|
|
539
397
|
var ResponsiveGridItem = ({ children, classNames, item, style, name, self, pinned, screenshare, video, mute, wave, speaking, onClick }) => {
|
|
540
|
-
var _effect =
|
|
398
|
+
var _effect = _useSignals5();
|
|
541
399
|
try {
|
|
542
|
-
const { t } =
|
|
400
|
+
const { t } = useTranslation(meta.id);
|
|
543
401
|
const iconProps = {
|
|
544
402
|
wave: {
|
|
545
403
|
icon: "ph--hand-waving--duotone",
|
|
@@ -565,32 +423,32 @@ var ResponsiveGridItem = ({ children, classNames, item, style, name, self, pinne
|
|
|
565
423
|
}, [
|
|
566
424
|
speaking
|
|
567
425
|
]);
|
|
568
|
-
return /* @__PURE__ */
|
|
569
|
-
className:
|
|
426
|
+
return /* @__PURE__ */ React5.createElement("div", {
|
|
427
|
+
className: mx4("relative w-full h-full group", "rounded-md outline outline-2 outline-neutral-900 transition-[outline-color] duration-500", speakingIndicator ? "outline-green-500" : !video && "outline-separator", classNames),
|
|
570
428
|
style
|
|
571
|
-
}, children, onClick && /* @__PURE__ */
|
|
429
|
+
}, children, onClick && /* @__PURE__ */ React5.createElement("div", {
|
|
572
430
|
className: "z-10 absolute top-1 right-1 flex"
|
|
573
|
-
}, /* @__PURE__ */
|
|
574
|
-
classNames:
|
|
431
|
+
}, /* @__PURE__ */ React5.createElement(IconButton, {
|
|
432
|
+
classNames: mx4("p-1 min-bs-1 rounded", groupHoverControlItemWithTransition),
|
|
575
433
|
iconOnly: true,
|
|
576
434
|
icon: pinned ? "ph--x--regular" : "ph--arrows-out--regular",
|
|
577
435
|
size: pinned ? 5 : 4,
|
|
578
436
|
label: pinned ? t("icon unpin") : t("icon pin"),
|
|
579
437
|
onClick: () => onClick?.(item)
|
|
580
|
-
})), name && /* @__PURE__ */
|
|
438
|
+
})), name && /* @__PURE__ */ React5.createElement("div", {
|
|
581
439
|
className: "z-10 absolute bottom-1 left-8 right-1 flex justify-end gap-1 items-center"
|
|
582
|
-
}, screenshare && /* @__PURE__ */
|
|
440
|
+
}, screenshare && /* @__PURE__ */ React5.createElement(Icon, {
|
|
583
441
|
icon: "ph--broadcast--regular",
|
|
584
442
|
size: pinned ? 5 : 4
|
|
585
|
-
}), /* @__PURE__ */
|
|
586
|
-
className:
|
|
587
|
-
}, name)), /* @__PURE__ */
|
|
443
|
+
}), /* @__PURE__ */ React5.createElement("div", {
|
|
444
|
+
className: mx4("bg-neutral-800 text-neutral-100 py-0.5 truncate rounded", pinned ? "px-2" : "px-1 text-xs")
|
|
445
|
+
}, name)), /* @__PURE__ */ React5.createElement("div", {
|
|
588
446
|
className: "z-10 absolute bottom-1 left-1 flex"
|
|
589
|
-
}, speaking && /* @__PURE__ */
|
|
447
|
+
}, speaking && /* @__PURE__ */ React5.createElement(Waveform, {
|
|
590
448
|
active: true,
|
|
591
449
|
size: pinned ? 5 : 4
|
|
592
|
-
}) || props && /* @__PURE__ */
|
|
593
|
-
classNames:
|
|
450
|
+
}) || props && /* @__PURE__ */ React5.createElement(IconButton, {
|
|
451
|
+
classNames: mx4("p-1 min-bs-1 rounded", props?.classNames),
|
|
594
452
|
icon: props?.icon,
|
|
595
453
|
label: props?.label,
|
|
596
454
|
size: pinned ? 5 : 4,
|
|
@@ -604,9 +462,9 @@ var ResponsiveGridItem = ({ children, classNames, item, style, name, self, pinne
|
|
|
604
462
|
// src/components/Participant/Participant.tsx
|
|
605
463
|
var SCREENSHARE_SUFFIX = "_screenshare";
|
|
606
464
|
var Participant = /* @__PURE__ */ memo2(({ item: user, debug, ...props }) => {
|
|
607
|
-
var _effect =
|
|
465
|
+
var _effect = _useSignals6();
|
|
608
466
|
try {
|
|
609
|
-
const call =
|
|
467
|
+
const call = useCapability(ThreadCapabilities.CallManager);
|
|
610
468
|
const isSelf = call.self.id !== void 0 && user.id !== void 0 && user.id.startsWith(call.self.id);
|
|
611
469
|
const isScreenshare = user.id?.endsWith(SCREENSHARE_SUFFIX);
|
|
612
470
|
const pulledVideoStream = call.getVideoStream(isScreenshare || !isSelf ? user.tracks?.video : void 0);
|
|
@@ -625,7 +483,7 @@ var Participant = /* @__PURE__ */ memo2(({ item: user, debug, ...props }) => {
|
|
|
625
483
|
call.media.screenshareVideoStream,
|
|
626
484
|
pulledVideoStream
|
|
627
485
|
]);
|
|
628
|
-
return /* @__PURE__ */
|
|
486
|
+
return /* @__PURE__ */ React6.createElement(ResponsiveGridItem, {
|
|
629
487
|
...props,
|
|
630
488
|
item: user,
|
|
631
489
|
name: user.name,
|
|
@@ -636,7 +494,7 @@ var Participant = /* @__PURE__ */ memo2(({ item: user, debug, ...props }) => {
|
|
|
636
494
|
wave: user.raisedHand,
|
|
637
495
|
speaking: user.speaking,
|
|
638
496
|
debug
|
|
639
|
-
}, /* @__PURE__ */
|
|
497
|
+
}, /* @__PURE__ */ React6.createElement(VideoObject, {
|
|
640
498
|
videoStream,
|
|
641
499
|
flip: isSelf && !isScreenshare,
|
|
642
500
|
contain: !!isScreenshare,
|
|
@@ -649,11 +507,11 @@ var Participant = /* @__PURE__ */ memo2(({ item: user, debug, ...props }) => {
|
|
|
649
507
|
Participant.displayName = "Participant";
|
|
650
508
|
|
|
651
509
|
// src/components/Participant/ParticipantGrid.tsx
|
|
652
|
-
import { useSignals as
|
|
653
|
-
import
|
|
510
|
+
import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
|
|
511
|
+
import React7, { useEffect as useEffect5, useMemo as useMemo3, useState as useState3 } from "react";
|
|
654
512
|
var getId = (user) => user.id;
|
|
655
513
|
var ParticipantGrid = ({ classNames, self, users, fullscreen, debug }) => {
|
|
656
|
-
var _effect =
|
|
514
|
+
var _effect = _useSignals7();
|
|
657
515
|
try {
|
|
658
516
|
const [pinned, setPinned] = useState3();
|
|
659
517
|
const allUsers = useMemo3(() => {
|
|
@@ -707,7 +565,7 @@ var ParticipantGrid = ({ classNames, self, users, fullscreen, debug }) => {
|
|
|
707
565
|
return 0;
|
|
708
566
|
}
|
|
709
567
|
});
|
|
710
|
-
return /* @__PURE__ */
|
|
568
|
+
return /* @__PURE__ */ React7.createElement(ResponsiveGrid, {
|
|
711
569
|
classNames,
|
|
712
570
|
Cell: Participant,
|
|
713
571
|
debug,
|
|
@@ -722,6 +580,148 @@ var ParticipantGrid = ({ classNames, self, users, fullscreen, debug }) => {
|
|
|
722
580
|
}
|
|
723
581
|
};
|
|
724
582
|
|
|
583
|
+
// src/components/Call/Toolbar.tsx
|
|
584
|
+
import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
|
|
585
|
+
import React8 from "react";
|
|
586
|
+
import { useAppGraph, useCapability as useCapability2 } from "@dxos/app-framework";
|
|
587
|
+
import { useActions, useNode } from "@dxos/plugin-graph";
|
|
588
|
+
import { fullyQualifiedId } from "@dxos/react-client/echo";
|
|
589
|
+
import { Icon as Icon2, IconButton as IconButton2, Toolbar as NativeToolbar, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
590
|
+
import { groupHoverControlItemWithTransition as groupHoverControlItemWithTransition2, mx as mx5 } from "@dxos/react-ui-theme";
|
|
591
|
+
var Toolbar = ({ classNames, channel, participants, autoHideControls = true, onJoin, onLeave }) => {
|
|
592
|
+
var _effect = _useSignals8();
|
|
593
|
+
try {
|
|
594
|
+
const { t } = useTranslation2(meta.id);
|
|
595
|
+
const { graph } = useAppGraph();
|
|
596
|
+
const call = useCapability2(ThreadCapabilities.CallManager);
|
|
597
|
+
const node = useNode(graph, channel && fullyQualifiedId(channel));
|
|
598
|
+
const actions = useActions(graph, node?.id).filter((action) => action.properties.disposition === "toolbar");
|
|
599
|
+
const isScreensharing = call.media.screenshareTrack !== void 0;
|
|
600
|
+
const canSharescreen = typeof navigator.mediaDevices !== "undefined" && navigator.mediaDevices.getDisplayMedia !== void 0;
|
|
601
|
+
return /* @__PURE__ */ React8.createElement("div", {
|
|
602
|
+
className: mx5("z-20 flex justify-center m-8", autoHideControls && groupHoverControlItemWithTransition2)
|
|
603
|
+
}, /* @__PURE__ */ React8.createElement(NativeToolbar.Root, {
|
|
604
|
+
classNames: [
|
|
605
|
+
"p-2 bg-modalSurface rounded-md shadow-md",
|
|
606
|
+
classNames
|
|
607
|
+
]
|
|
608
|
+
}, /* @__PURE__ */ React8.createElement(ToggleButton, {
|
|
609
|
+
active: call.media.audioEnabled,
|
|
610
|
+
state: {
|
|
611
|
+
on: {
|
|
612
|
+
icon: "ph--microphone--regular",
|
|
613
|
+
label: t("mic off"),
|
|
614
|
+
onClick: () => call.turnAudioOff(),
|
|
615
|
+
classNames: "bg-callActive"
|
|
616
|
+
},
|
|
617
|
+
off: {
|
|
618
|
+
icon: "ph--microphone-slash--duotone",
|
|
619
|
+
label: t("mic on"),
|
|
620
|
+
onClick: () => call.turnAudioOn(),
|
|
621
|
+
classNames: [
|
|
622
|
+
call.joined && "bg-callAlert"
|
|
623
|
+
]
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}), /* @__PURE__ */ React8.createElement(ToggleButton, {
|
|
627
|
+
active: call.media.videoEnabled,
|
|
628
|
+
state: {
|
|
629
|
+
on: {
|
|
630
|
+
icon: "ph--video-camera--regular",
|
|
631
|
+
label: t("camera off"),
|
|
632
|
+
onClick: () => call.turnVideoOff()
|
|
633
|
+
},
|
|
634
|
+
off: {
|
|
635
|
+
icon: "ph--video-camera-slash--duotone",
|
|
636
|
+
label: t("camera on"),
|
|
637
|
+
onClick: () => call.turnVideoOn()
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}), participants !== void 0 && /* @__PURE__ */ React8.createElement("div", {
|
|
641
|
+
className: "flex justify-center items-center gap-2 is-[5rem] text-xs text-subdued"
|
|
642
|
+
}, /* @__PURE__ */ React8.createElement(Icon2, {
|
|
643
|
+
icon: "ph--users--regular",
|
|
644
|
+
size: 4
|
|
645
|
+
}), /* @__PURE__ */ React8.createElement("div", null, participants)) || /* @__PURE__ */ React8.createElement(NativeToolbar.Separator, {
|
|
646
|
+
variant: "gap"
|
|
647
|
+
}), call.joined && /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(ToggleButton, {
|
|
648
|
+
disabled: !canSharescreen,
|
|
649
|
+
active: isScreensharing,
|
|
650
|
+
state: {
|
|
651
|
+
on: {
|
|
652
|
+
icon: "ph--monitor--regular",
|
|
653
|
+
label: t("screenshare off"),
|
|
654
|
+
onClick: () => call.turnScreenshareOff()
|
|
655
|
+
},
|
|
656
|
+
off: {
|
|
657
|
+
icon: "ph--monitor-arrow-up--duotone",
|
|
658
|
+
label: t("screenshare on"),
|
|
659
|
+
onClick: () => call.turnScreenshareOn()
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}), actions.map((action) => /* @__PURE__ */ React8.createElement(IconButton2, {
|
|
663
|
+
key: action.id,
|
|
664
|
+
...defaultButtonProps,
|
|
665
|
+
icon: action.properties.icon,
|
|
666
|
+
label: toLocalizedString(action.properties.label, t),
|
|
667
|
+
classNames: action.properties.classNames,
|
|
668
|
+
onClick: () => action.data({
|
|
669
|
+
node
|
|
670
|
+
})
|
|
671
|
+
})), /* @__PURE__ */ React8.createElement(ToggleButton, {
|
|
672
|
+
active: call.raisedHand,
|
|
673
|
+
state: {
|
|
674
|
+
on: {
|
|
675
|
+
icon: "ph--hand-waving--regular",
|
|
676
|
+
label: t("lower hand"),
|
|
677
|
+
onClick: () => call.setRaisedHand(false),
|
|
678
|
+
classNames: [
|
|
679
|
+
call.joined && "bg-callAlert"
|
|
680
|
+
]
|
|
681
|
+
},
|
|
682
|
+
off: {
|
|
683
|
+
icon: "ph--hand-palm--duotone",
|
|
684
|
+
label: t("raise hand"),
|
|
685
|
+
onClick: () => call.setRaisedHand(true)
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
})), call.joined ? /* @__PURE__ */ React8.createElement(IconButton2, {
|
|
689
|
+
variant: "destructive",
|
|
690
|
+
icon: "ph--phone-x--regular",
|
|
691
|
+
label: t("leave call"),
|
|
692
|
+
onClick: onLeave
|
|
693
|
+
}) : /* @__PURE__ */ React8.createElement(IconButton2, {
|
|
694
|
+
variant: "primary",
|
|
695
|
+
icon: "ph--phone-incoming--regular",
|
|
696
|
+
label: t("join call"),
|
|
697
|
+
onClick: onJoin
|
|
698
|
+
})));
|
|
699
|
+
} finally {
|
|
700
|
+
_effect.f();
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
Toolbar.displayName = "MeetingToolbar";
|
|
704
|
+
var defaultButtonProps = {
|
|
705
|
+
size: 5,
|
|
706
|
+
iconOnly: true
|
|
707
|
+
};
|
|
708
|
+
var ToggleButton = ({ active, state }) => {
|
|
709
|
+
var _effect = _useSignals8();
|
|
710
|
+
try {
|
|
711
|
+
return /* @__PURE__ */ React8.createElement(IconButton2, {
|
|
712
|
+
...defaultButtonProps,
|
|
713
|
+
classNames: [
|
|
714
|
+
active ? state.on.classNames ?? "bg-callActive" : state.off.classNames
|
|
715
|
+
],
|
|
716
|
+
icon: active ? state.on.icon : state.off.icon,
|
|
717
|
+
label: active ? state.on.label : state.off.label,
|
|
718
|
+
onClick: active ? state.on.onClick : state.off.onClick
|
|
719
|
+
});
|
|
720
|
+
} finally {
|
|
721
|
+
_effect.f();
|
|
722
|
+
}
|
|
723
|
+
};
|
|
724
|
+
|
|
725
725
|
// src/components/Call/Call.tsx
|
|
726
726
|
var CallRoot = ({ children }) => {
|
|
727
727
|
var _effect = _useSignals9();
|
|
@@ -801,7 +801,7 @@ var ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }) => {
|
|
|
801
801
|
useEffect6(() => {
|
|
802
802
|
const ctx = new Context(void 0, {
|
|
803
803
|
F: __dxlog_file2,
|
|
804
|
-
L:
|
|
804
|
+
L: 49
|
|
805
805
|
});
|
|
806
806
|
callManager.left.on(ctx, (roomId2) => {
|
|
807
807
|
extensions.forEach((extension) => {
|
|
@@ -843,7 +843,7 @@ var ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }) => {
|
|
|
843
843
|
} catch (err) {
|
|
844
844
|
log.catch(err, void 0, {
|
|
845
845
|
F: __dxlog_file2,
|
|
846
|
-
L:
|
|
846
|
+
L: 93,
|
|
847
847
|
S: void 0,
|
|
848
848
|
C: (f, a) => f(...a)
|
|
849
849
|
});
|
|
@@ -859,7 +859,7 @@ var ChannelContainer = ({ channel, roomId: _roomId, role, fullscreen }) => {
|
|
|
859
859
|
} catch (err) {
|
|
860
860
|
log.catch(err, void 0, {
|
|
861
861
|
F: __dxlog_file2,
|
|
862
|
-
L:
|
|
862
|
+
L: 105,
|
|
863
863
|
S: void 0,
|
|
864
864
|
C: (f, a) => f(...a)
|
|
865
865
|
});
|
|
@@ -981,4 +981,4 @@ export {
|
|
|
981
981
|
ChannelContainer,
|
|
982
982
|
ChannelContainer_default
|
|
983
983
|
};
|
|
984
|
-
//# sourceMappingURL=chunk-
|
|
984
|
+
//# sourceMappingURL=chunk-ZJ7QBXK6.mjs.map
|