@100mslive/roomkit-react 0.3.22-alpha.1 → 0.3.22-alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/ConferenceScreen-5G5WGPIO.css +2780 -0
- package/dist/{HLSView-Z2JID2W7.css.map → ConferenceScreen-5G5WGPIO.css.map} +1 -1
- package/dist/ConferenceScreen-KS5URW6Z.js +1778 -0
- package/dist/ConferenceScreen-KS5URW6Z.js.map +7 -0
- package/dist/EmbedView-BCRQ3GHV.js +17 -0
- package/dist/EmbedView-BCRQ3GHV.js.map +7 -0
- package/dist/EmbedView-Y24VRONT.css +2780 -0
- package/dist/EmbedView-Y24VRONT.css.map +7 -0
- package/dist/EmojiReaction-NA5F5DWN.js +11 -0
- package/dist/EmojiReaction-NA5F5DWN.js.map +7 -0
- package/dist/{HLSView-Z2JID2W7.css → HLSView-DC43TOIW.css} +3 -3
- package/dist/HLSView-DC43TOIW.css.map +7 -0
- package/dist/{HLSView-LCFZPBH3.js → HLSView-XRGOWFRB.js} +38 -24
- package/dist/HLSView-XRGOWFRB.js.map +7 -0
- package/dist/LeaveScreen-3OZN3MU3.css +2780 -0
- package/dist/LeaveScreen-3OZN3MU3.css.map +7 -0
- package/dist/LeaveScreen-PC4KB6OG.js +556 -0
- package/dist/LeaveScreen-PC4KB6OG.js.map +7 -0
- package/dist/MoreSettings-KTRYHDB2.css +2780 -0
- package/dist/MoreSettings-KTRYHDB2.css.map +7 -0
- package/dist/MoreSettings-XLNYT7PW.js +16 -0
- package/dist/MoreSettings-XLNYT7PW.js.map +7 -0
- package/dist/PDFView-LJ7I3K3H.js +84 -0
- package/dist/PDFView-LJ7I3K3H.js.map +7 -0
- package/dist/PDFView-RJK44WVO.css +2780 -0
- package/dist/PDFView-RJK44WVO.css.map +7 -0
- package/dist/Polls-AULCHMLW.js +1584 -0
- package/dist/Polls-AULCHMLW.js.map +7 -0
- package/dist/Polls-K4GO5ZOC.css +2780 -0
- package/dist/Polls-K4GO5ZOC.css.map +7 -0
- package/dist/RaiseHand-E4OVMBW6.js +10 -0
- package/dist/RaiseHand-E4OVMBW6.js.map +7 -0
- package/dist/RoleProminence-LHUXHLVI.css +2780 -0
- package/dist/RoleProminence-LHUXHLVI.css.map +7 -0
- package/dist/RoleProminence-RWJP2Z36.js +116 -0
- package/dist/RoleProminence-RWJP2Z36.js.map +7 -0
- package/dist/RoomDetailsPane-6BM2FPWW.css +2780 -0
- package/dist/RoomDetailsPane-6BM2FPWW.css.map +7 -0
- package/dist/RoomDetailsPane-7OP2CNJW.js +53 -0
- package/dist/RoomDetailsPane-7OP2CNJW.js.map +7 -0
- package/dist/ScreenshareLayout-RHTD2PQT.css +2780 -0
- package/dist/ScreenshareLayout-RHTD2PQT.css.map +7 -0
- package/dist/ScreenshareLayout-TM7DLYLH.js +358 -0
- package/dist/ScreenshareLayout-TM7DLYLH.js.map +7 -0
- package/dist/SidePaneTabs-T7BKZ2AT.js +1354 -0
- package/dist/SidePaneTabs-T7BKZ2AT.js.map +7 -0
- package/dist/SidePaneTabs-TBUPHNAU.css +2780 -0
- package/dist/SidePaneTabs-TBUPHNAU.css.map +7 -0
- package/dist/VBPicker-M5VYFEUB.css +2780 -0
- package/dist/VBPicker-M5VYFEUB.css.map +7 -0
- package/dist/VBPicker-TQLIL3NC.js +322 -0
- package/dist/VBPicker-TQLIL3NC.js.map +7 -0
- package/dist/WaitingView-TLJ52XYA.js +10 -0
- package/dist/WaitingView-TLJ52XYA.js.map +7 -0
- package/dist/WhiteboardLayout-PZZTM2FW.css +2780 -0
- package/dist/WhiteboardLayout-PZZTM2FW.css.map +7 -0
- package/dist/WhiteboardLayout-YYZ5UVGG.js +96 -0
- package/dist/WhiteboardLayout-YYZ5UVGG.js.map +7 -0
- package/dist/android-perm-1.png +0 -0
- package/dist/audio-level.png +0 -0
- package/dist/chunk-42XPBCZO.js +487 -0
- package/dist/chunk-42XPBCZO.js.map +7 -0
- package/dist/chunk-4BQ3AMVG.js +16802 -0
- package/dist/chunk-4BQ3AMVG.js.map +7 -0
- package/dist/chunk-4L5OKEIV.js +90 -0
- package/dist/chunk-4L5OKEIV.js.map +7 -0
- package/dist/chunk-6BX3VCVC.js +6337 -0
- package/dist/chunk-6BX3VCVC.js.map +7 -0
- package/dist/chunk-A3COGXMF.js +114 -0
- package/dist/chunk-A3COGXMF.js.map +7 -0
- package/dist/chunk-B3HHL3ND.js +178 -0
- package/dist/chunk-B3HHL3ND.js.map +7 -0
- package/dist/chunk-B5NLX6N6.js +41 -0
- package/dist/chunk-B5NLX6N6.js.map +7 -0
- package/dist/chunk-BXBPZGSP.js +161 -0
- package/dist/chunk-BXBPZGSP.js.map +7 -0
- package/dist/chunk-DVVFWHQG.js +136 -0
- package/dist/chunk-DVVFWHQG.js.map +7 -0
- package/dist/chunk-GV2DTYSU.js +262 -0
- package/dist/chunk-GV2DTYSU.js.map +7 -0
- package/dist/chunk-KF2YEUWU.js +254 -0
- package/dist/chunk-KF2YEUWU.js.map +7 -0
- package/dist/chunk-KQXTIHI6.js +59 -0
- package/dist/chunk-KQXTIHI6.js.map +7 -0
- package/dist/chunk-MR3HE7HV.js +830 -0
- package/dist/chunk-MR3HE7HV.js.map +7 -0
- package/dist/chunk-OQBTPJPO.js +71 -0
- package/dist/chunk-OQBTPJPO.js.map +7 -0
- package/dist/chunk-P7OOTR7P.js +2595 -0
- package/dist/chunk-P7OOTR7P.js.map +7 -0
- package/dist/chunk-THDU2DKP.js +30 -0
- package/dist/chunk-THDU2DKP.js.map +7 -0
- package/dist/chunk-U4QYH2BP.js +98 -0
- package/dist/chunk-U4QYH2BP.js.map +7 -0
- package/dist/chunk-USEEH3QW.js +418 -0
- package/dist/chunk-USEEH3QW.js.map +7 -0
- package/dist/chunk-UZW3C3ML.js +171 -0
- package/dist/chunk-UZW3C3ML.js.map +7 -0
- package/dist/chunk-YDIB6WKJ.js +576 -0
- package/dist/chunk-YDIB6WKJ.js.map +7 -0
- package/dist/chunk-ZFTULCCP.js +62 -0
- package/dist/chunk-ZFTULCCP.js.map +7 -0
- package/dist/empty-chat.svg +12 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +22079 -22000
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +25 -15
- package/dist/ios-perm-0.png +0 -0
- package/dist/meta.cjs.json +5284 -5181
- package/dist/meta.esbuild.json +8930 -6329
- package/dist/pdf-share.png +0 -0
- package/dist/screen-share.png +0 -0
- package/dist/transaction_error.svg +12 -0
- package/package.json +7 -7
- package/src/Prebuilt/App.tsx +6 -2
- package/src/Prebuilt/components/Chat/Chat.tsx +12 -8
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +1 -1
- package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +43 -31
- package/src/Prebuilt/layouts/HLSView.jsx +1 -0
- package/src/Prebuilt/layouts/PDFView.jsx +1 -0
- package/src/Prebuilt/layouts/SidePane.tsx +12 -6
- package/src/Prebuilt/layouts/VideoStreamingSection.tsx +35 -34
- package/dist/HLSView-LCFZPBH3.js.map +0 -7
- package/dist/chunk-CRGZUJSX.js +0 -34811
- package/dist/chunk-CRGZUJSX.js.map +0 -7
@@ -0,0 +1,136 @@
|
|
1
|
+
import {
|
2
|
+
useVideoTileContext
|
3
|
+
} from "./chunk-B3HHL3ND.js";
|
4
|
+
import {
|
5
|
+
AudioVideoToggle,
|
6
|
+
VideoTile_default
|
7
|
+
} from "./chunk-4BQ3AMVG.js";
|
8
|
+
import {
|
9
|
+
Text
|
10
|
+
} from "./chunk-BXBPZGSP.js";
|
11
|
+
import {
|
12
|
+
Box,
|
13
|
+
Flex
|
14
|
+
} from "./chunk-4L5OKEIV.js";
|
15
|
+
import {
|
16
|
+
IconButton_default,
|
17
|
+
useSetAppDataByKey
|
18
|
+
} from "./chunk-6BX3VCVC.js";
|
19
|
+
import {
|
20
|
+
APP_DATA,
|
21
|
+
__spreadProps,
|
22
|
+
__spreadValues,
|
23
|
+
config,
|
24
|
+
init_define_process_env
|
25
|
+
} from "./chunk-YDIB6WKJ.js";
|
26
|
+
|
27
|
+
// src/Prebuilt/components/InsetTile.tsx
|
28
|
+
init_define_process_env();
|
29
|
+
import React, { useEffect, useRef } from "react";
|
30
|
+
import Draggable from "react-draggable";
|
31
|
+
import { useMedia } from "react-use";
|
32
|
+
import {
|
33
|
+
selectIsAllowedToPublish,
|
34
|
+
selectLocalPeer,
|
35
|
+
selectPeerByID,
|
36
|
+
selectVideoTrackByID,
|
37
|
+
useHMSStore
|
38
|
+
} from "@100mslive/react-sdk";
|
39
|
+
import { ExpandIcon } from "@100mslive/react-icons";
|
40
|
+
var MinimisedTile = ({ setMinimised }) => {
|
41
|
+
return /* @__PURE__ */ React.createElement(Flex, { align: "center", css: { gap: "$6", r: "$1", bg: "$surface_default", p: "$4", color: "$on_surface_high" } }, /* @__PURE__ */ React.createElement(AudioVideoToggle, { hideOptions: true }), /* @__PURE__ */ React.createElement(Text, null, "You"), /* @__PURE__ */ React.createElement(
|
42
|
+
IconButton_default,
|
43
|
+
{
|
44
|
+
className: "__cancel-drag-event",
|
45
|
+
onClick: () => setMinimised(false),
|
46
|
+
css: { bg: "transparent", border: "transparent" }
|
47
|
+
},
|
48
|
+
/* @__PURE__ */ React.createElement(ExpandIcon, null)
|
49
|
+
));
|
50
|
+
};
|
51
|
+
var insetHeightPx = 180;
|
52
|
+
var insetMaxWidthPx = 240;
|
53
|
+
var defaultMobileAspectRatio = 9 / 16;
|
54
|
+
var desktopAspectRatio = 1 / defaultMobileAspectRatio;
|
55
|
+
var InsetTile = ({ peerId }) => {
|
56
|
+
const isMobile = useMedia(config.media.md);
|
57
|
+
const isLandscape = useMedia(config.media.ls);
|
58
|
+
const selector = peerId ? selectPeerByID(peerId) : selectLocalPeer;
|
59
|
+
const peer = useHMSStore(selector);
|
60
|
+
const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);
|
61
|
+
const videoTrack = useHMSStore(selectVideoTrackByID(peer == null ? void 0 : peer.videoTrack));
|
62
|
+
const isAllowedToPublish = useHMSStore(selectIsAllowedToPublish);
|
63
|
+
const videoTileProps = useVideoTileContext();
|
64
|
+
let aspectRatio = isMobile ? defaultMobileAspectRatio : desktopAspectRatio;
|
65
|
+
if ((videoTrack == null ? void 0 : videoTrack.width) && (videoTrack == null ? void 0 : videoTrack.height) && !isMobile) {
|
66
|
+
aspectRatio = videoTrack.width / videoTrack.height;
|
67
|
+
}
|
68
|
+
let height = insetHeightPx;
|
69
|
+
let width = height * aspectRatio;
|
70
|
+
if (isLandscape && width > insetMaxWidthPx) {
|
71
|
+
width = 240;
|
72
|
+
height = width / aspectRatio;
|
73
|
+
}
|
74
|
+
const nodeRef = useRef(null);
|
75
|
+
useEffect(() => {
|
76
|
+
const node = nodeRef.current;
|
77
|
+
if (!node || !window.ResizeObserver) {
|
78
|
+
return;
|
79
|
+
}
|
80
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
81
|
+
entries.forEach((entry) => {
|
82
|
+
if (entry.target === node.parentElement) {
|
83
|
+
node.style.transform = `translate(0,0)`;
|
84
|
+
}
|
85
|
+
});
|
86
|
+
});
|
87
|
+
node.parentElement && resizeObserver.observe(node.parentElement);
|
88
|
+
return () => {
|
89
|
+
(node == null ? void 0 : node.parentElement) && (resizeObserver == null ? void 0 : resizeObserver.unobserve(node.parentElement));
|
90
|
+
resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
91
|
+
};
|
92
|
+
}, []);
|
93
|
+
if (!isAllowedToPublish.video && !isAllowedToPublish.audio) {
|
94
|
+
return null;
|
95
|
+
}
|
96
|
+
return /* @__PURE__ */ React.createElement(Draggable, { bounds: "parent", nodeRef, cancel: ".__cancel-drag-event" }, /* @__PURE__ */ React.createElement(
|
97
|
+
Box,
|
98
|
+
{
|
99
|
+
ref: nodeRef,
|
100
|
+
css: __spreadValues({
|
101
|
+
position: "absolute",
|
102
|
+
bottom: 0,
|
103
|
+
right: 0,
|
104
|
+
zIndex: 10,
|
105
|
+
boxShadow: "0 0 8px 0 rgba(0,0,0,0.3)",
|
106
|
+
r: "$2"
|
107
|
+
}, !minimised ? {
|
108
|
+
aspectRatio,
|
109
|
+
h: height
|
110
|
+
} : {})
|
111
|
+
},
|
112
|
+
minimised ? /* @__PURE__ */ React.createElement(MinimisedTile, { setMinimised }) : /* @__PURE__ */ React.createElement(
|
113
|
+
VideoTile_default,
|
114
|
+
__spreadProps(__spreadValues({
|
115
|
+
peerId: peer == null ? void 0 : peer.id,
|
116
|
+
trackId: peer == null ? void 0 : peer.videoTrack,
|
117
|
+
rootCSS: {
|
118
|
+
size: "100%",
|
119
|
+
padding: 0
|
120
|
+
},
|
121
|
+
width,
|
122
|
+
height,
|
123
|
+
containerCSS: { background: "$surface_default" },
|
124
|
+
canMinimise: true,
|
125
|
+
isDragabble: true
|
126
|
+
}, videoTileProps), {
|
127
|
+
hideParticipantNameOnTile: true
|
128
|
+
})
|
129
|
+
)
|
130
|
+
));
|
131
|
+
};
|
132
|
+
|
133
|
+
export {
|
134
|
+
InsetTile
|
135
|
+
};
|
136
|
+
//# sourceMappingURL=chunk-DVVFWHQG.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../src/Prebuilt/components/InsetTile.tsx"],
|
4
|
+
"sourcesContent": ["import React, { useEffect, useRef } from 'react';\nimport Draggable from 'react-draggable';\nimport { useMedia } from 'react-use';\nimport {\n selectIsAllowedToPublish,\n selectLocalPeer,\n selectPeerByID,\n selectVideoTrackByID,\n useHMSStore,\n} from '@100mslive/react-sdk';\nimport { ExpandIcon } from '@100mslive/react-icons';\nimport { Box, Flex } from '../../Layout';\nimport { Text } from '../../Text';\nimport { config as cssConfig } from '../../Theme';\n// @ts-ignore: No implicit Any\nimport IconButton from '../IconButton';\n// @ts-ignore: No implicit Any\nimport { AudioVideoToggle } from './AudioVideoToggle';\n// @ts-ignore: No implicit Any\nimport VideoTile from './VideoTile';\n// @ts-ignore: No implicit Any\nimport { useSetAppDataByKey } from './AppData/useUISettings';\nimport { useVideoTileContext } from './hooks/useVideoTileLayout';\n// @ts-ignore: No implicit Any\nimport { APP_DATA } from '../common/constants';\n\nconst MinimisedTile = ({ setMinimised }: { setMinimised: (value: boolean) => void }) => {\n return (\n <Flex align=\"center\" css={{ gap: '$6', r: '$1', bg: '$surface_default', p: '$4', color: '$on_surface_high' }}>\n <AudioVideoToggle hideOptions={true} />\n <Text>You</Text>\n <IconButton\n className=\"__cancel-drag-event\"\n onClick={() => setMinimised(false)}\n css={{ bg: 'transparent', border: 'transparent' }}\n >\n <ExpandIcon />\n </IconButton>\n </Flex>\n );\n};\n\nconst insetHeightPx = 180;\nconst insetMaxWidthPx = 240;\nconst defaultMobileAspectRatio = 9 / 16;\nconst desktopAspectRatio = 1 / defaultMobileAspectRatio;\n\nexport const InsetTile = ({ peerId }: { peerId?: string }) => {\n const isMobile = useMedia(cssConfig.media.md);\n const isLandscape = useMedia(cssConfig.media.ls);\n const selector = peerId ? selectPeerByID(peerId) : selectLocalPeer;\n const peer = useHMSStore(selector);\n const [minimised, setMinimised] = useSetAppDataByKey(APP_DATA.minimiseInset);\n const videoTrack = useHMSStore(selectVideoTrackByID(peer?.videoTrack));\n const isAllowedToPublish = useHMSStore(selectIsAllowedToPublish);\n const videoTileProps = useVideoTileContext();\n let aspectRatio = isMobile ? defaultMobileAspectRatio : desktopAspectRatio;\n if (videoTrack?.width && videoTrack?.height && !isMobile) {\n aspectRatio = videoTrack.width / videoTrack.height;\n }\n let height = insetHeightPx;\n let width = height * aspectRatio;\n // Convert to 16/9 in landscape mode with a max width of 240\n if (isLandscape && width > insetMaxWidthPx) {\n width = 240;\n height = width / aspectRatio;\n }\n\n const nodeRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const node = nodeRef.current;\n if (!node || !window.ResizeObserver) {\n return;\n }\n const resizeObserver = new ResizeObserver(entries => {\n entries.forEach(entry => {\n if (entry.target === node.parentElement) {\n // reset to original position on resize\n node.style.transform = `translate(0,0)`;\n }\n });\n });\n node.parentElement && resizeObserver.observe(node.parentElement);\n return () => {\n node?.parentElement && resizeObserver?.unobserve(node.parentElement);\n resizeObserver?.disconnect();\n };\n }, []);\n\n if (!isAllowedToPublish.video && !isAllowedToPublish.audio) {\n return null;\n }\n\n return (\n <Draggable bounds=\"parent\" nodeRef={nodeRef} cancel=\".__cancel-drag-event\">\n <Box\n ref={nodeRef}\n css={{\n position: 'absolute',\n bottom: 0,\n right: 0,\n zIndex: 10,\n boxShadow: '0 0 8px 0 rgba(0,0,0,0.3)',\n r: '$2',\n ...(!minimised\n ? {\n aspectRatio: aspectRatio,\n h: height,\n }\n : {}),\n }}\n >\n {minimised ? (\n <MinimisedTile setMinimised={setMinimised} />\n ) : (\n <VideoTile\n peerId={peer?.id}\n trackId={peer?.videoTrack}\n rootCSS={{\n size: '100%',\n padding: 0,\n }}\n width={width}\n height={height}\n containerCSS={{ background: '$surface_default' }}\n canMinimise\n isDragabble\n {...videoTileProps}\n hideParticipantNameOnTile\n />\n )}\n </Box>\n </Draggable>\n );\n};\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,SAAS,WAAW,cAAc;AACzC,OAAO,eAAe;AACtB,SAAS,gBAAgB;AACzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,kBAAkB;AAgB3B,IAAM,gBAAgB,CAAC,EAAE,aAAa,MAAkD;AACtF,SACE,oCAAC,QAAK,OAAM,UAAS,KAAK,EAAE,KAAK,MAAM,GAAG,MAAM,IAAI,oBAAoB,GAAG,MAAM,OAAO,mBAAmB,KACzG,oCAAC,oBAAiB,aAAa,MAAM,GACrC,oCAAC,YAAK,KAAG,GACT;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,SAAS,MAAM,aAAa,KAAK;AAAA,MACjC,KAAK,EAAE,IAAI,eAAe,QAAQ,c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,GAAG,CAAC,CAAC;AAEL,MAAI,CAAC,mBAAmB,SAAS,CAAC,mBAAmB,OAAO;AAC1D,WAAO;AAAA,EACT;AAEA,SACE,oCAAC,aAAU,QAAO,UAAS,SAAkB,QAAO,0BAClD;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,KAAK;AAAA,QACH,UAAU;AAAA,QACV,QAAQ;AAAA,QACR,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,WAAW;AAAA,QACX,GAAG;AAAA,SACC,CAAC,YACD;AAAA,QACE;AAAA,QACA,GAAG;AAAA,MACL,IACA,CAAC;AAAA;AAAA,IAGN,YACC,oCAAC,iBAAc,cAA4B,IAE3C;AAAA,MAAC;AAAA;AAAA,QACC,QAAQ,6BAAM;AAAA,QACd,SAAS,6BAAM;AAAA,QACf,SAAS;AAAA,UACP,MAAM;AAAA,UACN,SAAS;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,QACA,cAAc,EAAE,YAAY,mBAAmB;AAAA,QAC/C,aAAW;AAAA,QACX,aAAW;AAAA,SACP,iBAZL;AAAA,QAaC,2BAAyB;AAAA;AAAA,IAC3B;AAAA,EAEJ,CACF;AAEJ;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,262 @@
|
|
1
|
+
import {
|
2
|
+
LiveStatus,
|
3
|
+
RecordingPauseStatus,
|
4
|
+
RecordingStatus,
|
5
|
+
StreamActions
|
6
|
+
} from "./chunk-KF2YEUWU.js";
|
7
|
+
import {
|
8
|
+
HorizontalDivider,
|
9
|
+
Label,
|
10
|
+
Logo,
|
11
|
+
Sheet,
|
12
|
+
SpeakerTag,
|
13
|
+
useSheetToggle,
|
14
|
+
useSidepaneToggle
|
15
|
+
} from "./chunk-4BQ3AMVG.js";
|
16
|
+
import {
|
17
|
+
Text
|
18
|
+
} from "./chunk-BXBPZGSP.js";
|
19
|
+
import {
|
20
|
+
ToastManager
|
21
|
+
} from "./chunk-USEEH3QW.js";
|
22
|
+
import {
|
23
|
+
Box,
|
24
|
+
Flex
|
25
|
+
} from "./chunk-4L5OKEIV.js";
|
26
|
+
import {
|
27
|
+
IconButton_default,
|
28
|
+
useRoomLayoutHeader
|
29
|
+
} from "./chunk-6BX3VCVC.js";
|
30
|
+
import {
|
31
|
+
SHEET_OPTIONS,
|
32
|
+
SIDE_PANE_OPTIONS,
|
33
|
+
__async,
|
34
|
+
config,
|
35
|
+
init_define_process_env
|
36
|
+
} from "./chunk-YDIB6WKJ.js";
|
37
|
+
|
38
|
+
// src/Prebuilt/components/Header/Header.tsx
|
39
|
+
init_define_process_env();
|
40
|
+
import React3 from "react";
|
41
|
+
import { useMedia as useMedia2 } from "react-use";
|
42
|
+
import { HMSRoomState, selectRoomState, useHMSStore as useHMSStore2 } from "@100mslive/react-sdk";
|
43
|
+
|
44
|
+
// src/Prebuilt/components/Header/RoomDetailsHeader.tsx
|
45
|
+
init_define_process_env();
|
46
|
+
import React from "react";
|
47
|
+
import { useMedia } from "react-use";
|
48
|
+
import { ChevronRightIcon } from "@100mslive/react-icons";
|
49
|
+
var RoomDetailsHeader = () => {
|
50
|
+
const { title, description } = useRoomLayoutHeader();
|
51
|
+
const isMobile = useMedia(config.media.md);
|
52
|
+
const clipLength = 30;
|
53
|
+
const toggleDetailsPane = useSidepaneToggle(SIDE_PANE_OPTIONS.ROOM_DETAILS);
|
54
|
+
const toggleDetailsSheet = useSheetToggle(SHEET_OPTIONS.ROOM_DETAILS);
|
55
|
+
if (!title && !description || isMobile && !title) {
|
56
|
+
return null;
|
57
|
+
}
|
58
|
+
return /* @__PURE__ */ React.createElement(Flex, { direction: isMobile ? "row" : "column", css: { ml: "$8", alignItems: isMobile ? "center" : "start" } }, /* @__PURE__ */ React.createElement(Text, { variant: "sm", css: { c: "$on_surface_high", fontWeight: "$semiBold" } }, title), !isMobile && /* @__PURE__ */ React.createElement(Flex, { align: "end", css: { color: "$on_surface_high" } }, /* @__PURE__ */ React.createElement(Text, { variant: "xs", css: { c: "$on_surface_medium" } }, description.slice(0, clipLength)), description.length > clipLength ? /* @__PURE__ */ React.createElement(
|
59
|
+
"span",
|
60
|
+
{
|
61
|
+
style: { fontWeight: "600", fontSize: "12px", cursor: "pointer", lineHeight: "1rem" },
|
62
|
+
onClick: toggleDetailsPane
|
63
|
+
},
|
64
|
+
"\xA0...more"
|
65
|
+
) : null), isMobile && description ? /* @__PURE__ */ React.createElement(Flex, { css: { color: "$on_surface_medium" } }, /* @__PURE__ */ React.createElement(ChevronRightIcon, { height: 16, width: 16, onClick: toggleDetailsSheet })) : null);
|
66
|
+
};
|
67
|
+
|
68
|
+
// src/Prebuilt/components/Header/common.jsx
|
69
|
+
init_define_process_env();
|
70
|
+
import React2 from "react";
|
71
|
+
import {
|
72
|
+
DeviceType,
|
73
|
+
getAudioDeviceCategory,
|
74
|
+
HMSAudioDeviceCategory,
|
75
|
+
selectIsLocalVideoEnabled,
|
76
|
+
selectLocalVideoTrackID,
|
77
|
+
selectVideoTrackByID,
|
78
|
+
useDevices,
|
79
|
+
useHMSActions,
|
80
|
+
useHMSStore
|
81
|
+
} from "@100mslive/react-sdk";
|
82
|
+
import {
|
83
|
+
BluetoothIcon,
|
84
|
+
CameraFlipIcon,
|
85
|
+
CheckIcon,
|
86
|
+
CrossIcon,
|
87
|
+
HeadphonesIcon,
|
88
|
+
SpeakerIcon,
|
89
|
+
TelePhoneIcon
|
90
|
+
} from "@100mslive/react-icons";
|
91
|
+
var CamaraFlipActions = () => {
|
92
|
+
const actions = useHMSActions();
|
93
|
+
const { allDevices } = useDevices();
|
94
|
+
const { videoInput } = allDevices;
|
95
|
+
const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);
|
96
|
+
const videoTrackId = useHMSStore(selectLocalVideoTrackID);
|
97
|
+
const localVideoTrack = useHMSStore(selectVideoTrackByID(videoTrackId));
|
98
|
+
if (!videoInput || !(videoInput == null ? void 0 : videoInput.length) || !(localVideoTrack == null ? void 0 : localVideoTrack.facingMode)) {
|
99
|
+
return null;
|
100
|
+
}
|
101
|
+
return /* @__PURE__ */ React2.createElement(Box, null, /* @__PURE__ */ React2.createElement(
|
102
|
+
IconButton_default,
|
103
|
+
{
|
104
|
+
disabled: !isVideoOn,
|
105
|
+
onClick: () => __async(void 0, null, function* () {
|
106
|
+
try {
|
107
|
+
yield actions.switchCamera();
|
108
|
+
} catch (e) {
|
109
|
+
ToastManager.addToast({
|
110
|
+
title: `Error while flipping camera ${e.message || ""}`,
|
111
|
+
variant: "error"
|
112
|
+
});
|
113
|
+
}
|
114
|
+
})
|
115
|
+
},
|
116
|
+
/* @__PURE__ */ React2.createElement(CameraFlipIcon, null)
|
117
|
+
));
|
118
|
+
};
|
119
|
+
var AudioActions = () => {
|
120
|
+
const { allDevices, selectedDeviceIDs, updateDevice } = useDevices();
|
121
|
+
const shouldShowAudioOutput = "setSinkId" in HTMLMediaElement.prototype;
|
122
|
+
const { audioInput, audioOutput } = allDevices;
|
123
|
+
let availableAudioDevices = audioInput;
|
124
|
+
let selectedAudio = selectedDeviceIDs.audioInput;
|
125
|
+
if (shouldShowAudioOutput) {
|
126
|
+
availableAudioDevices = audioOutput;
|
127
|
+
selectedAudio = selectedDeviceIDs.audioOutput;
|
128
|
+
}
|
129
|
+
const hmsActions = useHMSActions();
|
130
|
+
const audioFiltered = availableAudioDevices == null ? void 0 : availableAudioDevices.find((item) => !!item.label);
|
131
|
+
const currentSelection = availableAudioDevices == null ? void 0 : availableAudioDevices.find((item) => item.deviceId === selectedAudio);
|
132
|
+
if (!audioFiltered) {
|
133
|
+
return null;
|
134
|
+
}
|
135
|
+
const deviceCategory = getAudioDeviceCategory(currentSelection == null ? void 0 : currentSelection.label);
|
136
|
+
let AudioIcon = /* @__PURE__ */ React2.createElement(SpeakerIcon, null);
|
137
|
+
if (deviceCategory === HMSAudioDeviceCategory.BLUETOOTH) {
|
138
|
+
AudioIcon = /* @__PURE__ */ React2.createElement(BluetoothIcon, null);
|
139
|
+
} else if (deviceCategory === HMSAudioDeviceCategory.WIRED) {
|
140
|
+
AudioIcon = /* @__PURE__ */ React2.createElement(HeadphonesIcon, null);
|
141
|
+
} else if (deviceCategory === HMSAudioDeviceCategory.EARPIECE) {
|
142
|
+
AudioIcon = /* @__PURE__ */ React2.createElement(TelePhoneIcon, null);
|
143
|
+
}
|
144
|
+
return /* @__PURE__ */ React2.createElement(
|
145
|
+
AudioSelectionSheet,
|
146
|
+
{
|
147
|
+
audioDevices: availableAudioDevices,
|
148
|
+
audioSelected: selectedAudio,
|
149
|
+
onChange: (deviceId) => __async(void 0, null, function* () {
|
150
|
+
try {
|
151
|
+
yield updateDevice({
|
152
|
+
deviceId,
|
153
|
+
deviceType: shouldShowAudioOutput ? DeviceType.audioOutput : DeviceType.audioInput
|
154
|
+
});
|
155
|
+
} catch (e) {
|
156
|
+
ToastManager.addToast({
|
157
|
+
title: `Error while changing audio device ${e.message || ""}`,
|
158
|
+
variant: "error"
|
159
|
+
});
|
160
|
+
}
|
161
|
+
})
|
162
|
+
},
|
163
|
+
/* @__PURE__ */ React2.createElement(
|
164
|
+
Box,
|
165
|
+
{
|
166
|
+
onClick: () => __async(void 0, null, function* () {
|
167
|
+
yield hmsActions.refreshDevices();
|
168
|
+
})
|
169
|
+
},
|
170
|
+
/* @__PURE__ */ React2.createElement(IconButton_default, null, AudioIcon)
|
171
|
+
)
|
172
|
+
);
|
173
|
+
};
|
174
|
+
var AudioSelectionSheet = ({ audioDevices, audioSelected, onChange, children }) => {
|
175
|
+
return /* @__PURE__ */ React2.createElement(Sheet.Root, null, /* @__PURE__ */ React2.createElement(Sheet.Trigger, { asChild: true }, children), /* @__PURE__ */ React2.createElement(Sheet.Content, null, /* @__PURE__ */ React2.createElement(Sheet.Title, { css: { py: "$10", px: "$8", alignItems: "center" } }, /* @__PURE__ */ React2.createElement(Flex, { direction: "row", justify: "between", css: { w: "100%" } }, /* @__PURE__ */ React2.createElement(Text, { variant: "h6", css: { display: "flex" } }, "Audio"), /* @__PURE__ */ React2.createElement(Sheet.Close, null, /* @__PURE__ */ React2.createElement(IconButton_default, { as: "div", "data-testid": "dialog_cross_icon" }, /* @__PURE__ */ React2.createElement(CrossIcon, null))))), /* @__PURE__ */ React2.createElement(HorizontalDivider, null), /* @__PURE__ */ React2.createElement(
|
176
|
+
Flex,
|
177
|
+
{
|
178
|
+
direction: "column",
|
179
|
+
css: {
|
180
|
+
px: "$8",
|
181
|
+
maxHeight: "80vh",
|
182
|
+
overflowY: "auto"
|
183
|
+
}
|
184
|
+
},
|
185
|
+
audioDevices.map((audioDevice) => {
|
186
|
+
return /* @__PURE__ */ React2.createElement(
|
187
|
+
SelectWithLabel,
|
188
|
+
{
|
189
|
+
key: audioDevice.deviceId,
|
190
|
+
label: audioDevice.label,
|
191
|
+
id: audioDevice.deviceId,
|
192
|
+
checked: audioDevice.deviceId === audioSelected,
|
193
|
+
onChange: () => onChange(audioDevice.deviceId)
|
194
|
+
}
|
195
|
+
);
|
196
|
+
})
|
197
|
+
)));
|
198
|
+
};
|
199
|
+
var SelectWithLabel = ({ label, icon = /* @__PURE__ */ React2.createElement(React2.Fragment, null), checked, id, onChange }) => {
|
200
|
+
return /* @__PURE__ */ React2.createElement(
|
201
|
+
Flex,
|
202
|
+
{
|
203
|
+
align: "center",
|
204
|
+
css: {
|
205
|
+
my: "$2",
|
206
|
+
py: "$8",
|
207
|
+
w: "100%",
|
208
|
+
borderBottom: "1px solid $border_default"
|
209
|
+
},
|
210
|
+
onClick: onChange
|
211
|
+
},
|
212
|
+
/* @__PURE__ */ React2.createElement(
|
213
|
+
Label,
|
214
|
+
{
|
215
|
+
htmlFor: id,
|
216
|
+
css: {
|
217
|
+
fontSize: "$md",
|
218
|
+
fontWeight: "$semiBold",
|
219
|
+
color: "$on_surface_high",
|
220
|
+
cursor: "pointer",
|
221
|
+
display: "flex",
|
222
|
+
alignItems: "center",
|
223
|
+
gap: "$8",
|
224
|
+
flex: "1 1 0"
|
225
|
+
}
|
226
|
+
},
|
227
|
+
icon,
|
228
|
+
label
|
229
|
+
),
|
230
|
+
checked && /* @__PURE__ */ React2.createElement(CheckIcon, { width: 24, height: 24 })
|
231
|
+
);
|
232
|
+
};
|
233
|
+
|
234
|
+
// src/Prebuilt/components/Header/Header.tsx
|
235
|
+
var Header = () => {
|
236
|
+
const roomState = useHMSStore2(selectRoomState);
|
237
|
+
const isMobile = useMedia2(config.media.md);
|
238
|
+
if (roomState !== HMSRoomState.Connected) {
|
239
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null);
|
240
|
+
}
|
241
|
+
return /* @__PURE__ */ React3.createElement(Flex, { justify: "between", align: "center", css: { position: "relative", height: "100%" } }, /* @__PURE__ */ React3.createElement(Flex, { align: "center", gap: "2", css: { position: "absolute", left: "$10" } }, /* @__PURE__ */ React3.createElement(Logo, null), /* @__PURE__ */ React3.createElement(RoomDetailsHeader, null), /* @__PURE__ */ React3.createElement(SpeakerTag, null), isMobile && /* @__PURE__ */ React3.createElement(Flex, { align: "center", css: { gap: "$4" } }, /* @__PURE__ */ React3.createElement(LiveStatus, null), /* @__PURE__ */ React3.createElement(RecordingStatus, null), /* @__PURE__ */ React3.createElement(RecordingPauseStatus, null))), /* @__PURE__ */ React3.createElement(
|
242
|
+
Flex,
|
243
|
+
{
|
244
|
+
align: "center",
|
245
|
+
css: {
|
246
|
+
position: "absolute",
|
247
|
+
right: "$10",
|
248
|
+
gap: "$4"
|
249
|
+
}
|
250
|
+
},
|
251
|
+
/* @__PURE__ */ React3.createElement(StreamActions, null),
|
252
|
+
isMobile ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(CamaraFlipActions, null), /* @__PURE__ */ React3.createElement(AudioActions, null)) : null
|
253
|
+
));
|
254
|
+
};
|
255
|
+
|
256
|
+
// src/Prebuilt/components/Header/index.tsx
|
257
|
+
init_define_process_env();
|
258
|
+
|
259
|
+
export {
|
260
|
+
Header
|
261
|
+
};
|
262
|
+
//# sourceMappingURL=chunk-GV2DTYSU.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../src/Prebuilt/components/Header/Header.tsx", "../src/Prebuilt/components/Header/RoomDetailsHeader.tsx", "../src/Prebuilt/components/Header/common.jsx", "../src/Prebuilt/components/Header/index.tsx"],
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useMedia } from 'react-use';\nimport { HMSRoomState, selectRoomState, useHMSStore } from '@100mslive/react-sdk';\nimport { config as cssConfig, Flex } from '../../..';\n// @ts-ignore: No implicit any\nimport { Logo, SpeakerTag } from './HeaderComponents';\n// @ts-ignore: No implicit any\nimport { RoomDetailsHeader } from './RoomDetailsHeader';\nimport { LiveStatus, RecordingPauseStatus, RecordingStatus, StreamActions } from './StreamActions';\n// @ts-ignore: No implicit any\nimport { AudioActions, CamaraFlipActions } from './common';\n\nexport const Header = () => {\n const roomState = useHMSStore(selectRoomState);\n const isMobile = useMedia(cssConfig.media.md);\n // Header should be present only inside the call - not in preview, leave room states\n if (roomState !== HMSRoomState.Connected) {\n return <></>;\n }\n return (\n <Flex justify=\"between\" align=\"center\" css={{ position: 'relative', height: '100%' }}>\n <Flex align=\"center\" gap=\"2\" css={{ position: 'absolute', left: '$10' }}>\n <Logo />\n <RoomDetailsHeader />\n <SpeakerTag />\n {isMobile && (\n <Flex align=\"center\" css={{ gap: '$4' }}>\n <LiveStatus />\n <RecordingStatus />\n <RecordingPauseStatus />\n </Flex>\n )}\n </Flex>\n <Flex\n align=\"center\"\n css={{\n position: 'absolute',\n right: '$10',\n gap: '$4',\n }}\n >\n <StreamActions />\n {isMobile ? (\n <>\n <CamaraFlipActions />\n <AudioActions />\n </>\n ) : null}\n </Flex>\n </Flex>\n );\n};\n", "import React from 'react';\nimport { useMedia } from 'react-use';\nimport { ChevronRightIcon } from '@100mslive/react-icons';\nimport { Flex } from '../../../Layout';\nimport { Text } from '../../../Text';\nimport { config as cssConfig } from '../../../Theme';\nimport { useRoomLayoutHeader } from '../../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';\nimport { useSheetToggle } from '../AppData/useSheet';\n// @ts-ignore\nimport { useSidepaneToggle } from '../AppData/useSidepane';\nimport { SHEET_OPTIONS, SIDE_PANE_OPTIONS } from '../../common/constants';\n\nexport const RoomDetailsHeader = () => {\n const { title, description } = useRoomLayoutHeader();\n const isMobile = useMedia(cssConfig.media.md);\n const clipLength = 30;\n const toggleDetailsPane = useSidepaneToggle(SIDE_PANE_OPTIONS.ROOM_DETAILS);\n const toggleDetailsSheet = useSheetToggle(SHEET_OPTIONS.ROOM_DETAILS);\n\n if ((!title && !description) || (isMobile && !title)) {\n return null;\n }\n\n return (\n <Flex direction={isMobile ? 'row' : 'column'} css={{ ml: '$8', alignItems: isMobile ? 'center' : 'start' }}>\n <Text variant=\"sm\" css={{ c: '$on_surface_high', fontWeight: '$semiBold' }}>\n {title}\n </Text>\n {!isMobile && (\n <Flex align=\"end\" css={{ color: '$on_surface_high' }}>\n <Text variant=\"xs\" css={{ c: '$on_surface_medium' }}>\n {description.slice(0, clipLength)}\n </Text>\n {description.length > clipLength ? (\n <span\n style={{ fontWeight: '600', fontSize: '12px', cursor: 'pointer', lineHeight: '1rem' }}\n onClick={toggleDetailsPane}\n >\n ...more\n </span>\n ) : null}\n </Flex>\n )}\n {isMobile && description ? (\n <Flex css={{ color: '$on_surface_medium' }}>\n <ChevronRightIcon height={16} width={16} onClick={toggleDetailsSheet} />\n </Flex>\n ) : null}\n </Flex>\n );\n};\n", "import React from 'react';\nimport {\n DeviceType,\n getAudioDeviceCategory,\n HMSAudioDeviceCategory,\n selectIsLocalVideoEnabled,\n selectLocalVideoTrackID,\n selectVideoTrackByID,\n useDevices,\n useHMSActions,\n useHMSStore,\n} from '@100mslive/react-sdk';\nimport {\n BluetoothIcon,\n CameraFlipIcon,\n CheckIcon,\n CrossIcon,\n HeadphonesIcon,\n SpeakerIcon,\n TelePhoneIcon,\n} from '@100mslive/react-icons';\nimport { HorizontalDivider } from '../../../Divider';\nimport { Label } from '../../../Label';\nimport { Box, Flex } from '../../../Layout';\nimport { Sheet } from '../../../Sheet';\nimport { Text } from '../../../Text';\nimport IconButton from '../../IconButton';\nimport { ToastManager } from '../Toast/ToastManager';\n\nexport const CamaraFlipActions = () => {\n const actions = useHMSActions();\n const { allDevices } = useDevices();\n const { videoInput } = allDevices;\n const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);\n\n const videoTrackId = useHMSStore(selectLocalVideoTrackID);\n const localVideoTrack = useHMSStore(selectVideoTrackByID(videoTrackId));\n if (!videoInput || !videoInput?.length || !localVideoTrack?.facingMode) {\n return null;\n }\n return (\n <Box>\n <IconButton\n disabled={!isVideoOn}\n onClick={async () => {\n try {\n await actions.switchCamera();\n } catch (e) {\n ToastManager.addToast({\n title: `Error while flipping camera ${e.message || ''}`,\n variant: 'error',\n });\n }\n }}\n >\n <CameraFlipIcon />\n </IconButton>\n </Box>\n );\n};\n\n// It will handle and show audio input devices in Mweb while audio output devices in desktop\nexport const AudioActions = () => {\n const { allDevices, selectedDeviceIDs, updateDevice } = useDevices();\n\n // don't show speaker selector where the API is not supported, and use\n // a generic word(\"Audio\") for Mic. In some cases(Chrome Android for example) this changes both mic and speaker keeping them in sync.\n const shouldShowAudioOutput = 'setSinkId' in HTMLMediaElement.prototype;\n const { audioInput, audioOutput } = allDevices;\n let availableAudioDevices = audioInput;\n let selectedAudio = selectedDeviceIDs.audioInput;\n if (shouldShowAudioOutput) {\n availableAudioDevices = audioOutput;\n selectedAudio = selectedDeviceIDs.audioOutput;\n }\n const hmsActions = useHMSActions();\n const audioFiltered = availableAudioDevices?.find(item => !!item.label);\n const currentSelection = availableAudioDevices?.find(item => item.deviceId === selectedAudio);\n\n if (!audioFiltered) {\n return null;\n }\n const deviceCategory = getAudioDeviceCategory(currentSelection?.label);\n let AudioIcon = <SpeakerIcon />;\n if (deviceCategory === HMSAudioDeviceCategory.BLUETOOTH) {\n AudioIcon = <BluetoothIcon />;\n } else if (deviceCategory === HMSAudioDeviceCategory.WIRED) {\n AudioIcon = <HeadphonesIcon />;\n } else if (deviceCategory === HMSAudioDeviceCategory.EARPIECE) {\n AudioIcon = <TelePhoneIcon />;\n }\n return (\n <AudioSelectionSheet\n audioDevices={availableAudioDevices}\n audioSelected={selectedAudio}\n onChange={async deviceId => {\n try {\n await updateDevice({\n deviceId,\n deviceType: shouldShowAudioOutput ? DeviceType.audioOutput : DeviceType.audioInput,\n });\n } catch (e) {\n ToastManager.addToast({\n title: `Error while changing audio device ${e.message || ''}`,\n variant: 'error',\n });\n }\n }}\n >\n <Box\n onClick={async () => {\n // refresh device as `devicechange` listener won't work in mobile device\n await hmsActions.refreshDevices();\n }}\n >\n <IconButton>{AudioIcon}</IconButton>\n </Box>\n </AudioSelectionSheet>\n );\n};\n\nconst AudioSelectionSheet = ({ audioDevices, audioSelected, onChange, children }) => {\n return (\n <Sheet.Root>\n <Sheet.Trigger asChild>{children}</Sheet.Trigger>\n <Sheet.Content>\n <Sheet.Title css={{ py: '$10', px: '$8', alignItems: 'center' }}>\n <Flex direction=\"row\" justify=\"between\" css={{ w: '100%' }}>\n <Text variant=\"h6\" css={{ display: 'flex' }}>\n Audio\n </Text>\n <Sheet.Close>\n <IconButton as=\"div\" data-testid=\"dialog_cross_icon\">\n <CrossIcon />\n </IconButton>\n </Sheet.Close>\n </Flex>\n </Sheet.Title>\n <HorizontalDivider />\n <Flex\n direction=\"column\"\n css={{\n px: '$8',\n maxHeight: '80vh',\n overflowY: 'auto',\n }}\n >\n {audioDevices.map(audioDevice => {\n return (\n <SelectWithLabel\n key={audioDevice.deviceId}\n label={audioDevice.label}\n id={audioDevice.deviceId}\n checked={audioDevice.deviceId === audioSelected}\n onChange={() => onChange(audioDevice.deviceId)}\n />\n );\n })}\n </Flex>\n </Sheet.Content>\n </Sheet.Root>\n );\n};\n\nconst SelectWithLabel = ({ label, icon = <></>, checked, id, onChange }) => {\n return (\n <Flex\n align=\"center\"\n css={{\n my: '$2',\n py: '$8',\n w: '100%',\n borderBottom: '1px solid $border_default',\n }}\n onClick={onChange}\n >\n <Label\n htmlFor={id}\n css={{\n fontSize: '$md',\n fontWeight: '$semiBold',\n color: '$on_surface_high',\n cursor: 'pointer',\n display: 'flex',\n alignItems: 'center',\n gap: '$8',\n flex: '1 1 0',\n }}\n >\n {icon}\n {label}\n </Label>\n {checked && <CheckIcon width={24} height={24} />}\n </Flex>\n );\n};\n", "export { Header } from './Header';\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAOA,YAAW;AAClB,SAAS,YAAAC,iBAAgB;AACzB,SAAS,cAAc,iBAAiB,eAAAC,oBAAmB;;;ACF3D;AAAA,OAAO,WAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,wBAAwB;AAU1B,IAAM,oBAAoB,MAAM;AACrC,QAAM,EAAE,OAAO,YAAY,IAAI,oBAAoB;AACnD,QAAM,WAAW,SAAS,OAAU,MAAM,EAAE;AAC5C,QAAM,aAAa;AACnB,QAAM,oBAAoB,kBAAkB,kBAAkB,YAAY;AAC1E,QAAM,qBAAqB,eAAe,cAAc,YAAY;AAEpE,MAAK,CAAC,SAAS,CAAC,eAAiB,YAAY,CAAC,OAAQ;AACpD,WAAO;AAAA,EACT;AAEA,SACE,oCAAC,QAAK,WAAW,WAAW,QAAQ,UAAU,KAAK,EAAE,IAAI,MAAM,YAAY,WAAW,WAAW,QAAQ,KACvG,oCAAC,QAAK,SAAQ,MAAK,KAAK,EAAE,GAAG,oBAAoB,YAAY,YAAY,KACtE,KACH,GACC,CAAC,YACA,oCAAC,QAAK,OAAM,OAAM,KAAK,EAAE,OAAO,mBAAmB,KACjD,oCAAC,QAAK,SAAQ,MAAK,KAAK,EAAE,GAAG,qBAAqB,KAC/C,YAAY,MAAM,GAAG,UAAU,CAClC,GACC,YAAY,SAAS,aACpB;AAAA,IAAC;AAAA;AAAA,MACC,OAAO,EAAE,YAAY,OAAO,UAAU,QAAQ,QAAQ,WAAW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