@100mslive/roomkit-react 0.4.3-alpha.0 → 0.4.3-alpha.2

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.
Files changed (69) hide show
  1. package/dist/Prebuilt/App.d.ts +1 -0
  2. package/dist/Prebuilt/AppContext.d.ts +1 -0
  3. package/dist/index.cjs.css +2 -2
  4. package/dist/index.cjs.css.map +1 -1
  5. package/dist/index.cjs.js +79 -11
  6. package/dist/index.cjs.js.map +3 -3
  7. package/dist/index.css +2 -2
  8. package/dist/index.css.map +1 -1
  9. package/dist/index.js +79 -11
  10. package/dist/index.js.map +3 -3
  11. package/dist/meta.cjs.json +22 -17
  12. package/dist/meta.esbuild.json +22 -17
  13. package/package.json +8 -20
  14. package/src/Prebuilt/App.tsx +6 -1
  15. package/src/Prebuilt/AppContext.tsx +1 -0
  16. package/src/Prebuilt/layouts/HLSView.jsx +51 -4
  17. package/src/Accordion/Accordion.stories.tsx +0 -50
  18. package/src/Avatar/Avatar.stories.tsx +0 -33
  19. package/src/Button/Button.mdx +0 -43
  20. package/src/Button/Button.stories.tsx +0 -52
  21. package/src/Chat/Chat.mdx +0 -39
  22. package/src/Chat/Chat.stories.tsx +0 -39
  23. package/src/Checkbox/Checkbox.stories.tsx +0 -61
  24. package/src/Divider/HorizontalDivider.stories.tsx +0 -34
  25. package/src/Divider/VerticalDivider.stories.tsx +0 -40
  26. package/src/Dropdown/Dropdown.stories.tsx +0 -94
  27. package/src/Fieldset/Fieldset.stories.tsx +0 -29
  28. package/src/Footer/Footer.stories.tsx +0 -61
  29. package/src/Icons/Icons.stories.mdx +0 -10
  30. package/src/Icons/IconsList.jsx +0 -17
  31. package/src/Input/Input.stories.tsx +0 -25
  32. package/src/Input/PasswordInput.stories.tsx +0 -53
  33. package/src/Introduction/Integrating.stories.mdx +0 -100
  34. package/src/Introduction/Introduction.stories.mdx +0 -9
  35. package/src/Link/Link.stories.tsx +0 -18
  36. package/src/Loading/Loading.mdx +0 -15
  37. package/src/Loading/Loading.stories.tsx +0 -37
  38. package/src/Modal/Dialog.mdx +0 -19
  39. package/src/Modal/Dialog.stories.tsx +0 -68
  40. package/src/Pagination/StyledPagination.stories.tsx +0 -80
  41. package/src/Popover/Popover.mdx +0 -9
  42. package/src/Popover/Popover.stories.tsx +0 -95
  43. package/src/Prebuilt/Prebuilt.stories.tsx +0 -46
  44. package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.stories.tsx +0 -40
  45. package/src/QRCode/QRCode.mdx +0 -9
  46. package/src/QRCode/QRCode.stories.tsx +0 -29
  47. package/src/RadioGroup/RadioGroup.stories.tsx +0 -32
  48. package/src/ReactSelect/ReactSelect.stories.tsx +0 -83
  49. package/src/Select/Select.stories.tsx +0 -33
  50. package/src/Sheet/Sheet.mdx +0 -19
  51. package/src/Sheet/Sheet.stories.tsx +0 -103
  52. package/src/Slider/Slider.stories.tsx +0 -21
  53. package/src/Switch/Switch.mdx +0 -11
  54. package/src/Switch/Switch.stories.tsx +0 -46
  55. package/src/Tabs/Tabs.stories.tsx +0 -77
  56. package/src/Text/Text.stories.tsx +0 -21
  57. package/src/Theme/Theme.stories.mdx +0 -8
  58. package/src/Theme/ThemeStory.jsx +0 -56
  59. package/src/Toast/AppToast.stories.tsx +0 -56
  60. package/src/Toast/Toast.mdx +0 -19
  61. package/src/Toast/Toast.stories.tsx +0 -57
  62. package/src/Tooltip/Tooltip.stories.tsx +0 -62
  63. package/src/Video/UseVideo.mdx +0 -22
  64. package/src/Video/UseVideo.stories.tsx +0 -26
  65. package/src/Video/Video.mdx +0 -24
  66. package/src/Video/Video.stories.tsx +0 -27
  67. package/src/VideoList/VideoList.stories.tsx +0 -92
  68. package/src/VideoTile/VideoTile.mdx +0 -28
  69. package/src/VideoTile/VideoTile.stories.tsx +0 -32
@@ -2115,7 +2115,7 @@
2115
2115
  "format": "esm"
2116
2116
  },
2117
2117
  "../../node_modules/lodash/lodash.js": {
2118
- "bytes": 544098,
2118
+ "bytes": 545267,
2119
2119
  "imports": [
2120
2120
  {
2121
2121
  "path": "<define:process.env>",
@@ -2369,7 +2369,7 @@
2369
2369
  "format": "esm"
2370
2370
  },
2371
2371
  "src/Prebuilt/AppContext.tsx": {
2372
- "bytes": 881,
2372
+ "bytes": 909,
2373
2373
  "imports": [
2374
2374
  {
2375
2375
  "path": "react",
@@ -11311,7 +11311,7 @@
11311
11311
  ],
11312
11312
  "format": "esm"
11313
11313
  },
11314
- "../../../../../../../tmp/tmp-3217-x1SptFJQkNkc/19c650369c53/tldraw.css": {
11314
+ "../../../../../../../tmp/tmp-3260-PUBvZrZvdKvu/19cae6f743b3/tldraw.css": {
11315
11315
  "bytes": 80111,
11316
11316
  "imports": [
11317
11317
  {
@@ -11361,7 +11361,7 @@
11361
11361
  }
11362
11362
  ]
11363
11363
  },
11364
- "../../../../../../../tmp/tmp-3217-x1SptFJQkNkc/19c650369ab1/index.css": {
11364
+ "../../../../../../../tmp/tmp-3260-PUBvZrZvdKvu/19cae6f742e1/index.css": {
11365
11365
  "bytes": 597,
11366
11366
  "imports": [
11367
11367
  {
@@ -11370,7 +11370,7 @@
11370
11370
  "external": true
11371
11371
  },
11372
11372
  {
11373
- "path": "../../../../../../../tmp/tmp-3217-x1SptFJQkNkc/19c650369c53/tldraw.css",
11373
+ "path": "../../../../../../../tmp/tmp-3260-PUBvZrZvdKvu/19cae6f743b3/tldraw.css",
11374
11374
  "kind": "import-rule",
11375
11375
  "original": "@tldraw/tldraw/tldraw.css"
11376
11376
  }
@@ -11445,7 +11445,7 @@
11445
11445
  "original": "../../common/constants"
11446
11446
  },
11447
11447
  {
11448
- "path": "../../../../../../../tmp/tmp-3217-x1SptFJQkNkc/19c650369ab1/index.css",
11448
+ "path": "../../../../../../../tmp/tmp-3260-PUBvZrZvdKvu/19cae6f742e1/index.css",
11449
11449
  "kind": "import-statement",
11450
11450
  "original": "@100mslive/hms-whiteboard/index.css"
11451
11451
  },
@@ -12168,7 +12168,7 @@
12168
12168
  "format": "esm"
12169
12169
  },
12170
12170
  "src/Prebuilt/layouts/HLSView.jsx": {
12171
- "bytes": 28662,
12171
+ "bytes": 30184,
12172
12172
  "imports": [
12173
12173
  {
12174
12174
  "path": "react",
@@ -12295,6 +12295,11 @@
12295
12295
  "kind": "import-statement",
12296
12296
  "original": "../../Tooltip"
12297
12297
  },
12298
+ {
12299
+ "path": "src/Prebuilt/AppContext.tsx",
12300
+ "kind": "import-statement",
12301
+ "original": "../AppContext"
12302
+ },
12298
12303
  {
12299
12304
  "path": "src/Prebuilt/layouts/WaitingView.tsx",
12300
12305
  "kind": "import-statement",
@@ -14591,7 +14596,7 @@
14591
14596
  "format": "esm"
14592
14597
  },
14593
14598
  "src/Prebuilt/App.tsx": {
14594
- "bytes": 10920,
14599
+ "bytes": 11117,
14595
14600
  "imports": [
14596
14601
  {
14597
14602
  "path": "react",
@@ -15709,7 +15714,7 @@
15709
15714
  "imports": [],
15710
15715
  "exports": [],
15711
15716
  "inputs": {},
15712
- "bytes": 3693889
15717
+ "bytes": 3698218
15713
15718
  },
15714
15719
  "dist/index.cjs.js": {
15715
15720
  "imports": [
@@ -19042,10 +19047,10 @@
19042
19047
  "cssBundle": "dist/index.cjs.css",
19043
19048
  "inputs": {
19044
19049
  "<define:process.env>": {
19045
- "bytesInOutput": 22381
19050
+ "bytesInOutput": 21789
19046
19051
  },
19047
19052
  "../../node_modules/lodash/lodash.js": {
19048
- "bytesInOutput": 224317
19053
+ "bytesInOutput": 225096
19049
19054
  },
19050
19055
  "../../node_modules/lodash.isequal/index.js": {
19051
19056
  "bytesInOutput": 26597
@@ -19321,7 +19326,7 @@
19321
19326
  "bytesInOutput": 925
19322
19327
  },
19323
19328
  "src/Prebuilt/App.tsx": {
19324
- "bytesInOutput": 8536
19329
+ "bytesInOutput": 8704
19325
19330
  },
19326
19331
  "src/Prebuilt/components/AppData/AppData.tsx": {
19327
19332
  "bytesInOutput": 6918
@@ -19920,7 +19925,7 @@
19920
19925
  "src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx": {
19921
19926
  "bytesInOutput": 3051
19922
19927
  },
19923
- "../../../../../../../tmp/tmp-3217-x1SptFJQkNkc/19c650369ab1/index.css": {
19928
+ "../../../../../../../tmp/tmp-3260-PUBvZrZvdKvu/19cae6f742e1/index.css": {
19924
19929
  "bytesInOutput": 0
19925
19930
  },
19926
19931
  "src/Prebuilt/common/PeersSorter.ts": {
@@ -19930,7 +19935,7 @@
19930
19935
  "bytesInOutput": 2922
19931
19936
  },
19932
19937
  "src/Prebuilt/layouts/HLSView.jsx": {
19933
- "bytesInOutput": 30000
19938
+ "bytesInOutput": 31534
19934
19939
  },
19935
19940
  "src/Prebuilt/components/HlsStatsOverlay.jsx": {
19936
19941
  "bytesInOutput": 3395
@@ -20155,7 +20160,7 @@
20155
20160
  "bytesInOutput": 2777
20156
20161
  }
20157
20162
  },
20158
- "bytes": 1522889
20163
+ "bytes": 1524778
20159
20164
  },
20160
20165
  "dist/index.cjs.css.map": {
20161
20166
  "imports": [],
@@ -20217,10 +20222,10 @@
20217
20222
  }
20218
20223
  ],
20219
20224
  "inputs": {
20220
- "../../../../../../../tmp/tmp-3217-x1SptFJQkNkc/19c650369c53/tldraw.css": {
20225
+ "../../../../../../../tmp/tmp-3260-PUBvZrZvdKvu/19cae6f743b3/tldraw.css": {
20221
20226
  "bytesInOutput": 75223
20222
20227
  },
20223
- "../../../../../../../tmp/tmp-3217-x1SptFJQkNkc/19c650369ab1/index.css": {
20228
+ "../../../../../../../tmp/tmp-3260-PUBvZrZvdKvu/19cae6f742e1/index.css": {
20224
20229
  "bytesInOutput": 401
20225
20230
  }
20226
20231
  },
@@ -2115,7 +2115,7 @@
2115
2115
  "format": "esm"
2116
2116
  },
2117
2117
  "../../node_modules/lodash/lodash.js": {
2118
- "bytes": 544098,
2118
+ "bytes": 545267,
2119
2119
  "imports": [
2120
2120
  {
2121
2121
  "path": "<define:process.env>",
@@ -2369,7 +2369,7 @@
2369
2369
  "format": "esm"
2370
2370
  },
2371
2371
  "src/Prebuilt/AppContext.tsx": {
2372
- "bytes": 881,
2372
+ "bytes": 909,
2373
2373
  "imports": [
2374
2374
  {
2375
2375
  "path": "react",
@@ -11311,7 +11311,7 @@
11311
11311
  ],
11312
11312
  "format": "esm"
11313
11313
  },
11314
- "../../../../../../../tmp/tmp-3217-WBrHgiOoX1zP/19c650369c42/tldraw.css": {
11314
+ "../../../../../../../tmp/tmp-3260-F7uOIFgAcFyi/19cae6f743b2/tldraw.css": {
11315
11315
  "bytes": 80111,
11316
11316
  "imports": [
11317
11317
  {
@@ -11361,7 +11361,7 @@
11361
11361
  }
11362
11362
  ]
11363
11363
  },
11364
- "../../../../../../../tmp/tmp-3217-WBrHgiOoX1zP/19c650369660/index.css": {
11364
+ "../../../../../../../tmp/tmp-3260-F7uOIFgAcFyi/19cae6f73df0/index.css": {
11365
11365
  "bytes": 597,
11366
11366
  "imports": [
11367
11367
  {
@@ -11370,7 +11370,7 @@
11370
11370
  "external": true
11371
11371
  },
11372
11372
  {
11373
- "path": "../../../../../../../tmp/tmp-3217-WBrHgiOoX1zP/19c650369c42/tldraw.css",
11373
+ "path": "../../../../../../../tmp/tmp-3260-F7uOIFgAcFyi/19cae6f743b2/tldraw.css",
11374
11374
  "kind": "import-rule",
11375
11375
  "original": "@tldraw/tldraw/tldraw.css"
11376
11376
  }
@@ -11445,7 +11445,7 @@
11445
11445
  "original": "../../common/constants"
11446
11446
  },
11447
11447
  {
11448
- "path": "../../../../../../../tmp/tmp-3217-WBrHgiOoX1zP/19c650369660/index.css",
11448
+ "path": "../../../../../../../tmp/tmp-3260-F7uOIFgAcFyi/19cae6f73df0/index.css",
11449
11449
  "kind": "import-statement",
11450
11450
  "original": "@100mslive/hms-whiteboard/index.css"
11451
11451
  },
@@ -12168,7 +12168,7 @@
12168
12168
  "format": "esm"
12169
12169
  },
12170
12170
  "src/Prebuilt/layouts/HLSView.jsx": {
12171
- "bytes": 28662,
12171
+ "bytes": 30184,
12172
12172
  "imports": [
12173
12173
  {
12174
12174
  "path": "react",
@@ -12295,6 +12295,11 @@
12295
12295
  "kind": "import-statement",
12296
12296
  "original": "../../Tooltip"
12297
12297
  },
12298
+ {
12299
+ "path": "src/Prebuilt/AppContext.tsx",
12300
+ "kind": "import-statement",
12301
+ "original": "../AppContext"
12302
+ },
12298
12303
  {
12299
12304
  "path": "src/Prebuilt/layouts/WaitingView.tsx",
12300
12305
  "kind": "import-statement",
@@ -14591,7 +14596,7 @@
14591
14596
  "format": "esm"
14592
14597
  },
14593
14598
  "src/Prebuilt/App.tsx": {
14594
- "bytes": 10920,
14599
+ "bytes": 11117,
14595
14600
  "imports": [
14596
14601
  {
14597
14602
  "path": "react",
@@ -15709,7 +15714,7 @@
15709
15714
  "imports": [],
15710
15715
  "exports": [],
15711
15716
  "inputs": {},
15712
- "bytes": 3733859
15717
+ "bytes": 3738197
15713
15718
  },
15714
15719
  "dist/index.js": {
15715
15720
  "imports": [
@@ -19108,10 +19113,10 @@
19108
19113
  "cssBundle": "dist/index.css",
19109
19114
  "inputs": {
19110
19115
  "<define:process.env>": {
19111
- "bytesInOutput": 22381
19116
+ "bytesInOutput": 21789
19112
19117
  },
19113
19118
  "../../node_modules/lodash/lodash.js": {
19114
- "bytesInOutput": 224312
19119
+ "bytesInOutput": 225091
19115
19120
  },
19116
19121
  "../../node_modules/lodash.isequal/index.js": {
19117
19122
  "bytesInOutput": 26591
@@ -19387,7 +19392,7 @@
19387
19392
  "bytesInOutput": 887
19388
19393
  },
19389
19394
  "src/Prebuilt/App.tsx": {
19390
- "bytesInOutput": 8036
19395
+ "bytesInOutput": 8204
19391
19396
  },
19392
19397
  "src/Prebuilt/components/AppData/AppData.tsx": {
19393
19398
  "bytesInOutput": 6633
@@ -19986,7 +19991,7 @@
19986
19991
  "src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx": {
19987
19992
  "bytesInOutput": 2830
19988
19993
  },
19989
- "../../../../../../../tmp/tmp-3217-WBrHgiOoX1zP/19c650369660/index.css": {
19994
+ "../../../../../../../tmp/tmp-3260-F7uOIFgAcFyi/19cae6f73df0/index.css": {
19990
19995
  "bytesInOutput": 0
19991
19996
  },
19992
19997
  "src/Prebuilt/common/PeersSorter.ts": {
@@ -19996,7 +20001,7 @@
19996
20001
  "bytesInOutput": 2787
19997
20002
  },
19998
20003
  "src/Prebuilt/layouts/HLSView.jsx": {
19999
- "bytesInOutput": 28045
20004
+ "bytesInOutput": 29541
20000
20005
  },
20001
20006
  "src/Prebuilt/components/HlsStatsOverlay.jsx": {
20002
20007
  "bytesInOutput": 3171
@@ -20221,7 +20226,7 @@
20221
20226
  "bytesInOutput": 2632
20222
20227
  }
20223
20228
  },
20224
- "bytes": 1468015
20229
+ "bytes": 1469866
20225
20230
  },
20226
20231
  "dist/index.css.map": {
20227
20232
  "imports": [],
@@ -20283,10 +20288,10 @@
20283
20288
  }
20284
20289
  ],
20285
20290
  "inputs": {
20286
- "../../../../../../../tmp/tmp-3217-WBrHgiOoX1zP/19c650369c42/tldraw.css": {
20291
+ "../../../../../../../tmp/tmp-3260-F7uOIFgAcFyi/19cae6f743b2/tldraw.css": {
20287
20292
  "bytesInOutput": 75223
20288
20293
  },
20289
- "../../../../../../../tmp/tmp-3217-WBrHgiOoX1zP/19c650369660/index.css": {
20294
+ "../../../../../../../tmp/tmp-3260-F7uOIFgAcFyi/19cae6f73df0/index.css": {
20290
20295
  "bytesInOutput": 401
20291
20296
  }
20292
20297
  },
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.4.3-alpha.0",
13
+ "version": "0.4.3-alpha.2",
14
14
  "author": "100ms",
15
15
  "license": "MIT",
16
16
  "repository": {
@@ -42,8 +42,6 @@
42
42
  "lint": "eslint -c .eslintrc --no-error-on-unmatched-pattern src --ext .js --ext .jsx --ext .ts --ext .tsx",
43
43
  "lint:fix": "yarn lint --fix",
44
44
  "format": "prettier -w src/**",
45
- "storybook": "sb dev -p 6006",
46
- "build-storybook": "sb build",
47
45
  "babel": "npx storybook@latest babelrc"
48
46
  },
49
47
  "devDependencies": {
@@ -51,15 +49,6 @@
51
49
  "@babel/preset-env": "^7.22.5",
52
50
  "@babel/preset-react": "^7.22.5",
53
51
  "@babel/preset-typescript": "^7.22.5",
54
- "@storybook/addon-a11y": "^7.0.27",
55
- "@storybook/addon-actions": "^7.0.27",
56
- "@storybook/addon-essentials": "^7.0.27",
57
- "@storybook/addon-interactions": "^7.0.27",
58
- "@storybook/addon-links": "^7.0.27",
59
- "@storybook/cli": "^7.0.27",
60
- "@storybook/react": "^7.0.27",
61
- "@storybook/react-webpack5": "^7.0.27",
62
- "@storybook/testing-library": "^0.2.0",
63
52
  "@types/lodash.merge": "^4.6.6",
64
53
  "@types/mdx": "2.0.2",
65
54
  "@types/react": "^18.1.0",
@@ -68,19 +57,18 @@
68
57
  "babel-plugin-react-require": "3.1.3",
69
58
  "esbuild-loader": "^4.0.2",
70
59
  "knip": "^5.11.0",
71
- "react": "^18.1.0",
72
- "storybook-dark-mode": "^3.0.0"
60
+ "react": "^18.1.0"
73
61
  },
74
62
  "peerDependencies": {
75
63
  "react": ">=17.0.2 <19.0.0"
76
64
  },
77
65
  "dependencies": {
78
- "@100mslive/hls-player": "0.4.3-alpha.0",
66
+ "@100mslive/hls-player": "0.4.3-alpha.2",
79
67
  "@100mslive/hms-noise-cancellation": "0.0.2",
80
- "@100mslive/hms-virtual-background": "1.14.3-alpha.0",
81
- "@100mslive/hms-whiteboard": "0.1.3-alpha.0",
82
- "@100mslive/react-icons": "0.11.3-alpha.0",
83
- "@100mslive/react-sdk": "0.11.3-alpha.0",
68
+ "@100mslive/hms-virtual-background": "1.14.3-alpha.2",
69
+ "@100mslive/hms-whiteboard": "0.1.3-alpha.2",
70
+ "@100mslive/react-icons": "0.11.3-alpha.2",
71
+ "@100mslive/react-sdk": "0.11.3-alpha.2",
84
72
  "@100mslive/types-prebuilt": "0.12.12",
85
73
  "@emoji-mart/data": "^1.0.6",
86
74
  "@emoji-mart/react": "^1.0.1",
@@ -117,5 +105,5 @@
117
105
  "uuid": "^8.3.2",
118
106
  "worker-timers": "^7.0.40"
119
107
  },
120
- "gitHead": "f1f1e1e72eb47deed22698a3c7a1fd10d9dcd0af"
108
+ "gitHead": "b2be1a31b8d79a33a3e2f4f2475a483d68fdffbb"
121
109
  }
@@ -57,6 +57,7 @@ export type HMSPrebuiltOptions = {
57
57
  userId?: string;
58
58
  endpoints?: object;
59
59
  effectsSDKKey?: string;
60
+ managementToken?: string;
60
61
  };
61
62
 
62
63
  export type HMSPrebuiltProps = {
@@ -93,7 +94,7 @@ export const HMSPrebuilt = React.forwardRef<HMSPrebuiltRefType, HMSPrebuiltProps
93
94
  logo,
94
95
  typography,
95
96
  themes,
96
- options: { userName = '', userId = '', endpoints } = {},
97
+ options: { userName = '', userId = '', endpoints, managementToken } = {},
97
98
  screens,
98
99
  leaveOnUnload = true,
99
100
  onLeave,
@@ -141,12 +142,14 @@ export const HMSPrebuilt = React.forwardRef<HMSPrebuiltRefType, HMSPrebuiltProps
141
142
  tokenByRoomCode: string;
142
143
  roomLayout: string;
143
144
  event: string;
145
+ passport: string;
144
146
  }
145
147
  | undefined;
146
148
  const tokenByRoomCodeEndpoint = endpointsObj?.tokenByRoomCode;
147
149
  const initEndpoint = endpointsObj?.init;
148
150
  const eventEndpoint = endpointsObj?.event;
149
151
  const roomLayoutEndpoint = endpointsObj?.roomLayout;
152
+ const passportEndpoint = endpointsObj?.passport;
150
153
 
151
154
  const overrideLayout: Partial<Layout> = {
152
155
  logo,
@@ -180,11 +183,13 @@ export const HMSPrebuilt = React.forwardRef<HMSPrebuiltRefType, HMSPrebuiltProps
180
183
  onJoin,
181
184
  userName,
182
185
  userId,
186
+ managementToken,
183
187
  endpoints: {
184
188
  tokenByRoomCode: tokenByRoomCodeEndpoint,
185
189
  init: initEndpoint,
186
190
  roomLayout: roomLayoutEndpoint,
187
191
  event: eventEndpoint,
192
+ passport: passportEndpoint,
188
193
  },
189
194
  }}
190
195
  >
@@ -8,6 +8,7 @@ type HMSPrebuiltContextType = {
8
8
  userId?: string;
9
9
  containerSelector: string;
10
10
  endpoints?: Record<string, string | undefined>;
11
+ managementToken?: string;
11
12
  onLeave?: () => void;
12
13
  onJoin?: () => void;
13
14
  };
@@ -34,6 +34,7 @@ import { Loading } from '../../Loading';
34
34
  import { Text } from '../../Text';
35
35
  import { config, theme, useTheme } from '../../Theme';
36
36
  import { Tooltip } from '../../Tooltip';
37
+ import { useHMSPrebuiltContext } from '../AppContext';
37
38
  import { WaitingView } from './WaitingView';
38
39
  import { useSidepaneToggle } from '../components/AppData/useSidepane';
39
40
  import { useRoomLayoutConferencingScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
@@ -79,6 +80,8 @@ const HLSView = () => {
79
80
  const [streamEnded, setStreamEnded] = useState(false);
80
81
  let [hlsStatsState, setHlsStatsState] = useState(null);
81
82
  const hlsUrl = hlsState.variants[0]?.url;
83
+ const { endpoints, managementToken } = useHMSPrebuiltContext();
84
+ const [resolvedHlsUrl, setResolvedHlsUrl] = useState(null);
82
85
  const [availableLayers, setAvailableLayers] = useState([]);
83
86
  const [isVideoLive, setIsVideoLive] = useState(true);
84
87
  const [isCaptionEnabled, setIsCaptionEnabled] = useState(true);
@@ -92,7 +95,7 @@ const HLSView = () => {
92
95
  });
93
96
  const [isPaused, setIsPaused] = useState(false);
94
97
  const [show, toggle] = useToggle(false);
95
- const lastHlsUrl = usePrevious(hlsUrl);
98
+ const lastHlsUrl = usePrevious(resolvedHlsUrl);
96
99
  const vanillaStore = useHMSVanillaStore();
97
100
  const [controlsVisible, setControlsVisible] = useState(true);
98
101
  const [isUserSelectedAuto, setIsUserSelectedAuto] = useState(true);
@@ -133,6 +136,50 @@ const HLSView = () => {
133
136
  }
134
137
  }, [hlsUrl, streamEnded, lastHlsUrl]);
135
138
 
139
+ // Fetch signed URL from passport-api for authenticated CDN streams
140
+ useEffect(() => {
141
+ if (!hlsUrl) {
142
+ setResolvedHlsUrl(null);
143
+ return;
144
+ }
145
+ if (!hlsUrl.includes('/s/')) {
146
+ setResolvedHlsUrl(hlsUrl);
147
+ return;
148
+ }
149
+ const passportEndpoint = endpoints?.passport;
150
+ if (!passportEndpoint || !managementToken) {
151
+ setResolvedHlsUrl(hlsUrl);
152
+ return;
153
+ }
154
+ let cancelled = false;
155
+ const fetchSignedUrl = async () => {
156
+ try {
157
+ const resp = await fetch(`${passportEndpoint}/token`, {
158
+ method: 'POST',
159
+ headers: {
160
+ 'Content-Type': 'application/json',
161
+ Authorization: `Bearer ${managementToken}`,
162
+ },
163
+ body: JSON.stringify({ url: hlsUrl }),
164
+ });
165
+ if (!resp.ok) throw new Error(`passport-api returned ${resp.status}`);
166
+ const data = await resp.json();
167
+ if (!cancelled) {
168
+ setResolvedHlsUrl(data.tokenized_url || hlsUrl);
169
+ }
170
+ } catch (err) {
171
+ console.error('[HLSView] Failed to fetch signed URL from passport-api:', err);
172
+ if (!cancelled) {
173
+ setResolvedHlsUrl(hlsUrl);
174
+ }
175
+ }
176
+ };
177
+ fetchSignedUrl();
178
+ return () => {
179
+ cancelled = true;
180
+ };
181
+ }, [hlsUrl, endpoints?.passport, managementToken]);
182
+
136
183
  useEffect(() => {
137
184
  if (!notification) return;
138
185
  const toastID = toastMap?.[notification.data.id];
@@ -261,8 +308,8 @@ const HLSView = () => {
261
308
  };
262
309
 
263
310
  const handleAutoplayBlock = data => setIsHlsAutoplayBlocked(!!data);
264
- if (videoEl && hlsUrl) {
265
- hlsPlayer = new HMSHLSPlayer(hlsUrl, videoEl);
311
+ if (videoEl && resolvedHlsUrl) {
312
+ hlsPlayer = new HMSHLSPlayer(resolvedHlsUrl, videoEl);
266
313
  hlsPlayer.on(HMSHLSPlayerEvents.SEEK_POS_BEHIND_LIVE_EDGE, handleNoLongerLive);
267
314
  hlsPlayer.on(HMSHLSPlayerEvents.TIMED_METADATA_LOADED, metadataLoadedHandler);
268
315
  hlsPlayer.on(HMSHLSPlayerEvents.ERROR, handleError);
@@ -286,7 +333,7 @@ const HLSView = () => {
286
333
  };
287
334
  }
288
335
  // eslint-disable-next-line react-hooks/exhaustive-deps
289
- }, [hlsUrl, vanillaStore, hmsActions]);
336
+ }, [resolvedHlsUrl, vanillaStore, hmsActions]);
290
337
 
291
338
  /**
292
339
  * initialize and subscribe to hlsState
@@ -1,50 +0,0 @@
1
- import React from 'react';
2
- import { ComponentMeta, ComponentStory } from '@storybook/react';
3
- import { Accordion } from '.';
4
-
5
- export default {
6
- title: 'UI Components/Accordion',
7
- component: Accordion.Root,
8
- } as ComponentMeta<typeof Accordion.Root>;
9
-
10
- function AccordionItem({ value, header, content }: { value: string; header: string; content: string }) {
11
- return (
12
- <Accordion.Item value={value}>
13
- <Accordion.Header css={{ padding: '$8 $9' }}>{header}</Accordion.Header>
14
- <Accordion.Content contentStyles={{ padding: '$8 $9' }}>
15
- <>
16
- {content}
17
- <Accordion.Item value={value + '1'}>
18
- <Accordion.Header css={{ padding: '$8 $9' }}>nested header</Accordion.Header>
19
- <Accordion.Content contentStyles={{ padding: '$8 $9' }}>nested item</Accordion.Content>
20
- </Accordion.Item>
21
- </>
22
- </Accordion.Content>
23
- </Accordion.Item>
24
- );
25
- }
26
-
27
- const Template = () => {
28
- return (
29
- <Accordion.Root type="multiple" defaultValue={['item-1']} css={{ width: '300px' }}>
30
- <AccordionItem
31
- value="item-1"
32
- header="Is it accessible?"
33
- content="Yes. It adheres to the WAI-ARIA design pattern."
34
- />
35
- <AccordionItem
36
- value="item-2"
37
- header="Is it unstyled?"
38
- content="Yes. It's unstyled by default, giving you freedom over the look and feel."
39
- />
40
- <AccordionItem
41
- value="item-3"
42
- header="Can it be animated?"
43
- content="Yes! You can animate the Accordion. with CSS or JavaScript."
44
- />
45
- </Accordion.Root>
46
- );
47
- };
48
-
49
- export const AccordionContent: ComponentStory<typeof Accordion.Root> = Template.bind({});
50
- AccordionContent.storyName = 'Accordion';
@@ -1,33 +0,0 @@
1
- import React from 'react';
2
- import { ComponentMeta, ComponentStory } from '@storybook/react';
3
- import { Avatar } from '.';
4
-
5
- export default {
6
- title: 'UI Components/Avatar',
7
- component: Avatar,
8
- argTypes: {
9
- ref: { table: { disable: true } },
10
- },
11
- args: {
12
- name: '100ms',
13
- },
14
- } as ComponentMeta<typeof Avatar>;
15
-
16
- export const Square: ComponentStory<typeof Avatar> = args => {
17
- return <Avatar css={{ width: '50px', height: '50px' }} shape="square" {...args} />;
18
- };
19
-
20
- export const Circle: ComponentStory<typeof Avatar> = args => {
21
- return <Avatar css={{ width: '50px', height: '50px' }} shape="circle" {...args} />;
22
- };
23
-
24
- export const Playground = ({ height = 50, width = 50, css = {}, shape = 'circle' as const, name = '' }) => {
25
- return <Avatar css={{ width: width, height: height, ...css }} name={name} shape={shape} />;
26
- };
27
-
28
- Playground.storyName = 'Avatar';
29
- Playground.argTypes = {
30
- height: { control: { type: 'number' } },
31
- width: { control: { type: 'number' } },
32
- shape: { options: ['square', 'circle'], defaultValue: 'square', control: { type: 'select' } },
33
- };
@@ -1,43 +0,0 @@
1
- import { Story, Props, Preview } from '@storybook/addon-docs';
2
-
3
- import { Button } from '.';
4
- import { HangUpIcon } from '@100mslive/react-icons';
5
-
6
- ## Button
7
-
8
- The button has three possible variants,
9
-
10
- - Primary,
11
- - Standard, and
12
- - Danger
13
-
14
- Button can also have an icon, you can add the icon as a children of that Button. The `icon` attribute will add a padding
15
- between those children elements.
16
-
17
- A Button also have an attribute `outlined` which will add an outline to that Button.
18
-
19
- ### Primary
20
-
21
- <Preview>
22
- <Story id="ui-components-button--primary" />
23
- </Preview>
24
-
25
- ### Standard
26
-
27
- <Preview>
28
- <Story id="ui-components-button--standard" />
29
- </Preview>
30
-
31
- ### Danger
32
-
33
- <Preview>
34
- <Story id="ui-components-button--danger" />
35
- </Preview>
36
-
37
- ### With Icon
38
-
39
- <Preview>
40
- <Story id="ui-components-button--with-icon" />
41
- </Preview>
42
-
43
- <Props />