@snapcall/stream-ui 1.29.0 → 1.29.1
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/stream-ui.esm.js +13 -27
- package/dist/stream-ui.js +13 -27
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/stream-ui.esm.js
CHANGED
|
@@ -5,6 +5,7 @@ import {QueryClient as $3Sbms$QueryClient, QueryClientProvider as $3Sbms$QueryCl
|
|
|
5
5
|
import $3Sbms$reacthottoast, {toast as $3Sbms$toast, Toaster as $3Sbms$Toaster1, ToastBar as $3Sbms$ToastBar} from "react-hot-toast";
|
|
6
6
|
import $3Sbms$styledcomponents, {keyframes as $3Sbms$keyframes, ThemeProvider as $3Sbms$ThemeProvider, ThemeContext as $3Sbms$ThemeContext, css as $3Sbms$css, createGlobalStyle as $3Sbms$createGlobalStyle} from "styled-components";
|
|
7
7
|
import {useState as $3Sbms$useState, useRef as $3Sbms$useRef, useCallback as $3Sbms$useCallback, useEffect as $3Sbms$useEffect, useContext as $3Sbms$useContext, useMemo as $3Sbms$useMemo, createContext as $3Sbms$createContext, useReducer as $3Sbms$useReducer, useLayoutEffect as $3Sbms$useLayoutEffect, cloneElement as $3Sbms$cloneElement, forwardRef as $3Sbms$forwardRef} from "react";
|
|
8
|
+
import $3Sbms$classnames from "classnames";
|
|
8
9
|
import {TooltipProvider as $3Sbms$TooltipProvider, Toaster as $3Sbms$Toaster, Select as $3Sbms$Select, SelectTrigger as $3Sbms$SelectTrigger, SelectValue as $3Sbms$SelectValue, SelectContent as $3Sbms$SelectContent, SelectGroup as $3Sbms$SelectGroup, SelectItem as $3Sbms$SelectItem, useToast as $3Sbms$useToast, Dialog as $3Sbms$Dialog, DialogContent as $3Sbms$DialogContent, DialogHeader as $3Sbms$DialogHeader, DialogTitle as $3Sbms$DialogTitle, Tabs as $3Sbms$Tabs, TabsList as $3Sbms$TabsList, TabsTrigger as $3Sbms$TabsTrigger, TabsContent as $3Sbms$TabsContent, Input as $3Sbms$Input, Button as $3Sbms$Button, CreatableSelect as $3Sbms$CreatableSelect, Textarea as $3Sbms$Textarea, ToastAction as $3Sbms$ToastAction, Avatar as $3Sbms$Avatar, Tooltip as $3Sbms$Tooltip, TooltipContent as $3Sbms$TooltipContent, TooltipTrigger as $3Sbms$TooltipTrigger, AlertDialog as $3Sbms$AlertDialog, AlertDialogContent as $3Sbms$AlertDialogContent, AlertDialogFooter as $3Sbms$AlertDialogFooter, AlertDialogCancel as $3Sbms$AlertDialogCancel, AlertDialogAction as $3Sbms$AlertDialogAction, RawToast as $3Sbms$RawToast, ToastContent as $3Sbms$ToastContent, Sheet as $3Sbms$Sheet, DialogTrigger as $3Sbms$DialogTrigger, SheetTrigger as $3Sbms$SheetTrigger, SheetHeader as $3Sbms$SheetHeader, SheetClose as $3Sbms$SheetClose, SheetContent as $3Sbms$SheetContent, SheetTitle as $3Sbms$SheetTitle, DialogDescription as $3Sbms$DialogDescription, SheetDescription as $3Sbms$SheetDescription, DialogFooter as $3Sbms$DialogFooter, AlertDialogHeader as $3Sbms$AlertDialogHeader, AlertDialogTitle as $3Sbms$AlertDialogTitle, AlertDialogDescription as $3Sbms$AlertDialogDescription} from "@snapcall/design-system";
|
|
9
10
|
import "inobounce";
|
|
10
11
|
import {useTranslation as $3Sbms$useTranslation, initReactI18next as $3Sbms$initReactI18next, Trans as $3Sbms$Trans} from "react-i18next";
|
|
@@ -22,7 +23,6 @@ import {Buffer as $3Sbms$Buffer} from "buffer";
|
|
|
22
23
|
import {Form as $3Sbms$Form, FormField as $3Sbms$FormField, FormItem as $3Sbms$FormItem, FormLabel as $3Sbms$FormLabel, FormControl as $3Sbms$FormControl, FormMessage as $3Sbms$FormMessage} from "@snapcall/design-system/form";
|
|
23
24
|
import {useForm as $3Sbms$useForm} from "react-hook-form";
|
|
24
25
|
import {createPortal as $3Sbms$createPortal} from "react-dom";
|
|
25
|
-
import $3Sbms$classnames from "classnames";
|
|
26
26
|
import {toCanvas as $3Sbms$toCanvas, toDataURL as $3Sbms$toDataURL} from "qrcode";
|
|
27
27
|
|
|
28
28
|
|
|
@@ -344,6 +344,7 @@ const $35b37252690084e8$export$1cbfb36c1655a9a = (root, element)=>{
|
|
|
344
344
|
|
|
345
345
|
|
|
346
346
|
|
|
347
|
+
|
|
347
348
|
const $a3e657fb86ae23f3$export$604ba5624273df44 = ()=>{
|
|
348
349
|
try {
|
|
349
350
|
const storedTheme = localStorage.getItem('stream_ui_language');
|
|
@@ -1325,7 +1326,7 @@ const $120418cdeb6706cf$export$de363e709c412c8a = (fn, wait = 300)=>{
|
|
|
1325
1326
|
|
|
1326
1327
|
|
|
1327
1328
|
|
|
1328
|
-
const $07e4bc01ab825269$export$6ad2c48011488f7 = async (apiUrl, { file: file, token: token })=>{
|
|
1329
|
+
const $07e4bc01ab825269$export$6ad2c48011488f7 = async (apiUrl, { file: file, token: token, type: type })=>{
|
|
1329
1330
|
if (!file) throw new Error(`Missing file on "${file}"`);
|
|
1330
1331
|
const upload = await fetch(`${apiUrl}/public/streams/${token}/events/upload`, {
|
|
1331
1332
|
method: 'POST',
|
|
@@ -1334,7 +1335,8 @@ const $07e4bc01ab825269$export$6ad2c48011488f7 = async (apiUrl, { file: file, to
|
|
|
1334
1335
|
},
|
|
1335
1336
|
body: JSON.stringify({
|
|
1336
1337
|
filename: file.name,
|
|
1337
|
-
contentLength: file.size
|
|
1338
|
+
contentLength: file.size,
|
|
1339
|
+
type: type
|
|
1338
1340
|
})
|
|
1339
1341
|
});
|
|
1340
1342
|
const { url: url, headers: headers, filename: filename } = await upload.json();
|
|
@@ -2767,9 +2769,10 @@ class $c31e3fb4360572af$export$2e2bcd8739ae039 extends $c31e3fb4360572af$var$Str
|
|
|
2767
2769
|
base64Image: base64Image
|
|
2768
2770
|
});
|
|
2769
2771
|
}
|
|
2770
|
-
async uploadAsset(file) {
|
|
2772
|
+
async uploadAsset(file, type) {
|
|
2771
2773
|
return (0, $07e4bc01ab825269$export$6ad2c48011488f7)(this.config.apiUrl, {
|
|
2772
2774
|
token: this.roomId,
|
|
2775
|
+
type: type,
|
|
2773
2776
|
file: file
|
|
2774
2777
|
});
|
|
2775
2778
|
}
|
|
@@ -10949,14 +10952,6 @@ const $946223bbb2c552ef$export$5a5695b638d078e7 = ()=>{
|
|
|
10949
10952
|
|
|
10950
10953
|
|
|
10951
10954
|
|
|
10952
|
-
const $20431dc869bb21e0$var$fileToDataUrl = (file)=>{
|
|
10953
|
-
return new Promise((resolve, reject)=>{
|
|
10954
|
-
const reader = new FileReader();
|
|
10955
|
-
reader.addEventListener('load', ()=>resolve(reader.result));
|
|
10956
|
-
reader.addEventListener('error', ()=>reject(reader.error));
|
|
10957
|
-
reader.readAsDataURL(file);
|
|
10958
|
-
});
|
|
10959
|
-
};
|
|
10960
10955
|
const $20431dc869bb21e0$var$generateVideoThumbnail = (file)=>{
|
|
10961
10956
|
return new Promise((resolve)=>{
|
|
10962
10957
|
const canvas = document.createElement('canvas');
|
|
@@ -10996,21 +10991,12 @@ const $20431dc869bb21e0$export$b3fd96a52c80b3af = ()=>{
|
|
|
10996
10991
|
});
|
|
10997
10992
|
openAssetsModal();
|
|
10998
10993
|
try {
|
|
10999
|
-
let url;
|
|
11000
10994
|
let thumbnailUrl;
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
|
|
11006
|
-
filename = data.filename;
|
|
11007
|
-
} else {
|
|
11008
|
-
const data = await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).uploadAsset(file);
|
|
11009
|
-
url = data.url;
|
|
11010
|
-
filename = data.filename;
|
|
11011
|
-
if (type === 'video') thumbnailUrl = await $20431dc869bb21e0$var$generateVideoThumbnail(file);
|
|
11012
|
-
if (!url || !filename) throw new Error('upload failed');
|
|
11013
|
-
}
|
|
10995
|
+
const data = await (0, $c9e496369b59be7a$export$2f377c2162fd02b2).uploadAsset(file, type);
|
|
10996
|
+
const url = data.url;
|
|
10997
|
+
const filename = data.filename;
|
|
10998
|
+
if (type === 'video') thumbnailUrl = await $20431dc869bb21e0$var$generateVideoThumbnail(file);
|
|
10999
|
+
if (!url || !filename) throw new Error('upload failed');
|
|
11014
11000
|
addAsset({
|
|
11015
11001
|
filename: filename,
|
|
11016
11002
|
mode: mode,
|
|
@@ -14641,7 +14627,7 @@ const $26ed036cbc17809a$var$StreamUI = ({ options: baseOptions })=>{
|
|
|
14641
14627
|
/*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$TooltipProvider), {
|
|
14642
14628
|
children: /*#__PURE__*/ (0, $3Sbms$jsxs)((0, $4fb4815baa04b470$export$914ddf2021ea8ee6), {
|
|
14643
14629
|
ref: streamUIContainerRef,
|
|
14644
|
-
className:
|
|
14630
|
+
className: (0, $3Sbms$classnames)('bg-white', streamState === 'greeting' ? 'light-theme' : 'dark-theme'),
|
|
14645
14631
|
children: [
|
|
14646
14632
|
/*#__PURE__*/ (0, $3Sbms$jsx)((0, $3a42b2ef7646d035$export$2e2bcd8739ae039), {}),
|
|
14647
14633
|
/*#__PURE__*/ (0, $3Sbms$jsx)((0, $3Sbms$Toaster), {
|
package/dist/stream-ui.js
CHANGED
|
@@ -5,6 +5,7 @@ var $jQDcL$tanstackreactquery = require("@tanstack/react-query");
|
|
|
5
5
|
var $jQDcL$reacthottoast = require("react-hot-toast");
|
|
6
6
|
var $jQDcL$styledcomponents = require("styled-components");
|
|
7
7
|
var $jQDcL$react = require("react");
|
|
8
|
+
var $jQDcL$classnames = require("classnames");
|
|
8
9
|
var $jQDcL$snapcalldesignsystem = require("@snapcall/design-system");
|
|
9
10
|
require("inobounce");
|
|
10
11
|
var $jQDcL$reacti18next = require("react-i18next");
|
|
@@ -22,7 +23,6 @@ var $jQDcL$buffer = require("buffer");
|
|
|
22
23
|
var $jQDcL$snapcalldesignsystemform = require("@snapcall/design-system/form");
|
|
23
24
|
var $jQDcL$reacthookform = require("react-hook-form");
|
|
24
25
|
var $jQDcL$reactdom = require("react-dom");
|
|
25
|
-
var $jQDcL$classnames = require("classnames");
|
|
26
26
|
var $jQDcL$qrcode = require("qrcode");
|
|
27
27
|
|
|
28
28
|
|
|
@@ -350,6 +350,7 @@ const $57b7750d9786bf6f$export$1cbfb36c1655a9a = (root, element)=>{
|
|
|
350
350
|
|
|
351
351
|
|
|
352
352
|
|
|
353
|
+
|
|
353
354
|
const $393bda1b33846dfc$export$604ba5624273df44 = ()=>{
|
|
354
355
|
try {
|
|
355
356
|
const storedTheme = localStorage.getItem('stream_ui_language');
|
|
@@ -1331,7 +1332,7 @@ const $3898fb88b880f5ba$export$de363e709c412c8a = (fn, wait = 300)=>{
|
|
|
1331
1332
|
|
|
1332
1333
|
|
|
1333
1334
|
|
|
1334
|
-
const $987c962fd22b0c93$export$6ad2c48011488f7 = async (apiUrl, { file: file, token: token })=>{
|
|
1335
|
+
const $987c962fd22b0c93$export$6ad2c48011488f7 = async (apiUrl, { file: file, token: token, type: type })=>{
|
|
1335
1336
|
if (!file) throw new Error(`Missing file on "${file}"`);
|
|
1336
1337
|
const upload = await fetch(`${apiUrl}/public/streams/${token}/events/upload`, {
|
|
1337
1338
|
method: 'POST',
|
|
@@ -1340,7 +1341,8 @@ const $987c962fd22b0c93$export$6ad2c48011488f7 = async (apiUrl, { file: file, to
|
|
|
1340
1341
|
},
|
|
1341
1342
|
body: JSON.stringify({
|
|
1342
1343
|
filename: file.name,
|
|
1343
|
-
contentLength: file.size
|
|
1344
|
+
contentLength: file.size,
|
|
1345
|
+
type: type
|
|
1344
1346
|
})
|
|
1345
1347
|
});
|
|
1346
1348
|
const { url: url, headers: headers, filename: filename } = await upload.json();
|
|
@@ -2773,9 +2775,10 @@ class $1dedebd5ff3002eb$export$2e2bcd8739ae039 extends $1dedebd5ff3002eb$var$Str
|
|
|
2773
2775
|
base64Image: base64Image
|
|
2774
2776
|
});
|
|
2775
2777
|
}
|
|
2776
|
-
async uploadAsset(file) {
|
|
2778
|
+
async uploadAsset(file, type) {
|
|
2777
2779
|
return (0, $987c962fd22b0c93$export$6ad2c48011488f7)(this.config.apiUrl, {
|
|
2778
2780
|
token: this.roomId,
|
|
2781
|
+
type: type,
|
|
2779
2782
|
file: file
|
|
2780
2783
|
});
|
|
2781
2784
|
}
|
|
@@ -10955,14 +10958,6 @@ const $8dfcca373a03b9e8$export$5a5695b638d078e7 = ()=>{
|
|
|
10955
10958
|
|
|
10956
10959
|
|
|
10957
10960
|
|
|
10958
|
-
const $ccbd73eb953b0bd0$var$fileToDataUrl = (file)=>{
|
|
10959
|
-
return new Promise((resolve, reject)=>{
|
|
10960
|
-
const reader = new FileReader();
|
|
10961
|
-
reader.addEventListener('load', ()=>resolve(reader.result));
|
|
10962
|
-
reader.addEventListener('error', ()=>reject(reader.error));
|
|
10963
|
-
reader.readAsDataURL(file);
|
|
10964
|
-
});
|
|
10965
|
-
};
|
|
10966
10961
|
const $ccbd73eb953b0bd0$var$generateVideoThumbnail = (file)=>{
|
|
10967
10962
|
return new Promise((resolve)=>{
|
|
10968
10963
|
const canvas = document.createElement('canvas');
|
|
@@ -11002,21 +10997,12 @@ const $ccbd73eb953b0bd0$export$b3fd96a52c80b3af = ()=>{
|
|
|
11002
10997
|
});
|
|
11003
10998
|
openAssetsModal();
|
|
11004
10999
|
try {
|
|
11005
|
-
let url;
|
|
11006
11000
|
let thumbnailUrl;
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
|
|
11012
|
-
filename = data.filename;
|
|
11013
|
-
} else {
|
|
11014
|
-
const data = await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).uploadAsset(file);
|
|
11015
|
-
url = data.url;
|
|
11016
|
-
filename = data.filename;
|
|
11017
|
-
if (type === 'video') thumbnailUrl = await $ccbd73eb953b0bd0$var$generateVideoThumbnail(file);
|
|
11018
|
-
if (!url || !filename) throw new Error('upload failed');
|
|
11019
|
-
}
|
|
11001
|
+
const data = await (0, $c48c1ecc38fed4e9$export$2f377c2162fd02b2).uploadAsset(file, type);
|
|
11002
|
+
const url = data.url;
|
|
11003
|
+
const filename = data.filename;
|
|
11004
|
+
if (type === 'video') thumbnailUrl = await $ccbd73eb953b0bd0$var$generateVideoThumbnail(file);
|
|
11005
|
+
if (!url || !filename) throw new Error('upload failed');
|
|
11020
11006
|
addAsset({
|
|
11021
11007
|
filename: filename,
|
|
11022
11008
|
mode: mode,
|
|
@@ -14647,7 +14633,7 @@ const $ee8cb448c2c74888$var$StreamUI = ({ options: baseOptions })=>{
|
|
|
14647
14633
|
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $jQDcL$snapcalldesignsystem.TooltipProvider), {
|
|
14648
14634
|
children: /*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsxs)((0, $e3bb2c5d0e5b45b5$export$914ddf2021ea8ee6), {
|
|
14649
14635
|
ref: streamUIContainerRef,
|
|
14650
|
-
className:
|
|
14636
|
+
className: (0, ($parcel$interopDefault($jQDcL$classnames)))('bg-white', streamState === 'greeting' ? 'light-theme' : 'dark-theme'),
|
|
14651
14637
|
children: [
|
|
14652
14638
|
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $e66cc5db58913155$export$2e2bcd8739ae039), {}),
|
|
14653
14639
|
/*#__PURE__*/ (0, $jQDcL$reactjsxruntime.jsx)((0, $jQDcL$snapcalldesignsystem.Toaster), {
|
package/dist/types.d.ts
CHANGED
|
@@ -541,7 +541,7 @@ declare class StreamerClient extends StreamerEventTargetType implements AudioLev
|
|
|
541
541
|
url: string;
|
|
542
542
|
filename: string;
|
|
543
543
|
}>;
|
|
544
|
-
uploadAsset(file: any): Promise<{
|
|
544
|
+
uploadAsset(file: any, type: 'image' | 'video' | 'audio'): Promise<{
|
|
545
545
|
url?: string;
|
|
546
546
|
filename: string;
|
|
547
547
|
}>;
|