@realsee/live 0.1.1 → 0.3.0-alpha.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.
Files changed (102) hide show
  1. package/README.md +111 -58
  2. package/docs/.nojekyll +1 -0
  3. package/docs/assets/custom.css +43 -0
  4. package/docs/assets/highlight.css +127 -0
  5. package/docs/assets/icons.css +1043 -0
  6. package/docs/assets/{images/icons.png → icons.png} +0 -0
  7. package/docs/assets/{images/icons@2x.png → icons@2x.png} +0 -0
  8. package/docs/assets/main.js +52 -0
  9. package/docs/assets/search.js +1 -0
  10. package/docs/assets/style.css +1388 -0
  11. package/docs/assets/{images/widgets.png → widgets.png} +0 -0
  12. package/docs/assets/{images/widgets@2x.png → widgets@2x.png} +0 -0
  13. package/docs/classes/RTCProtocol.BrowserRTC.html +60 -0
  14. package/docs/classes/RTCProtocol.BrowserRTC4Chime.html +66 -0
  15. package/docs/classes/RTCProtocol.RTCExample.html +62 -814
  16. package/docs/classes/RTCProtocol.VRWebViewRTC.html +60 -0
  17. package/docs/classes/shared_utils.Subscribe.html +55 -596
  18. package/docs/enums/RTCProtocol.RTCJoinedInfoCodeEnum.html +9 -0
  19. package/docs/enums/RTCProtocol.RTCType.html +1 -185
  20. package/docs/enums/live.BuiltinActionType.html +15 -325
  21. package/docs/enums/live.BuiltinEventType.html +7 -268
  22. package/docs/enums/live.Command.html +7 -346
  23. package/docs/enums/live.MemUserStatus.html +1 -307
  24. package/docs/enums/live.MicroStatus.html +3 -258
  25. package/docs/enums/live.UserStatus.html +9 -287
  26. package/docs/enums/live.WebSocketCloseError.html +19 -382
  27. package/docs/enums/live.WebSocketErrorType.html +1 -307
  28. package/docs/enums/live.WebSocketState.html +13 -325
  29. package/docs/index.html +356 -510
  30. package/docs/interfaces/RTCProtocol.GetVoiceSignReturnType.html +1 -0
  31. package/docs/interfaces/RTCProtocol.RTCJoinedInfo.html +1 -0
  32. package/docs/interfaces/RTCProtocol.RTCProtocol-1.html +60 -765
  33. package/docs/interfaces/RTCProtocol.VRWebViewRTCOptions.html +1 -0
  34. package/docs/interfaces/live.Live.html +119 -1302
  35. package/docs/interfaces/live.LiveOptions.html +22 -499
  36. package/docs/interfaces/live.LiveReact.html +52 -984
  37. package/docs/modules/RTCProtocol.html +17 -361
  38. package/docs/modules/live.html +103 -1219
  39. package/docs/modules/shared_utils.html +10 -248
  40. package/docs/modules.html +1 -125
  41. package/lib/RTC/BrowserRTC.d.ts +30 -0
  42. package/lib/RTC/BrowserRTC.js +169 -0
  43. package/lib/RTC/BrowserRTC.js.map +1 -0
  44. package/lib/RTC/BrowserRTC4Chime.d.ts +53 -0
  45. package/lib/RTC/BrowserRTC4Chime.js +299 -0
  46. package/lib/RTC/BrowserRTC4Chime.js.map +1 -0
  47. package/lib/RTC/VRWebViewRTC.d.ts +23 -0
  48. package/lib/RTC/VRWebViewRTC.js +124 -0
  49. package/lib/RTC/VRWebViewRTC.js.map +1 -0
  50. package/lib/RTC/index.d.ts +22 -0
  51. package/lib/{RTCProtocol → RTC}/index.js +3 -7
  52. package/lib/RTC/index.js.map +1 -0
  53. package/lib/createLive.d.ts +1 -1
  54. package/lib/createLive.js +50 -22
  55. package/lib/createLive.js.map +1 -1
  56. package/lib/createLiveReact.d.ts +11 -10
  57. package/lib/createLiveReact.js +4 -6
  58. package/lib/createLiveReact.js.map +1 -1
  59. package/lib/shared-utils/Subscribe.d.ts +1 -1
  60. package/lib/typings/Chime/AttendeeResponse.d.ts +5 -0
  61. package/lib/typings/Chime/AttendeeResponse.js +3 -0
  62. package/lib/typings/Chime/AttendeeResponse.js.map +1 -0
  63. package/lib/typings/Chime/MeetingResponse.d.ts +12 -0
  64. package/lib/typings/Chime/MeetingResponse.js +3 -0
  65. package/lib/typings/Chime/MeetingResponse.js.map +1 -0
  66. package/lib/typings/Chime/MeetingSessionConfigurationOptions.d.ts +16 -0
  67. package/lib/typings/Chime/MeetingSessionConfigurationOptions.js +3 -0
  68. package/lib/typings/Chime/MeetingSessionConfigurationOptions.js.map +1 -0
  69. package/lib/typings/EventType.d.ts +10 -0
  70. package/lib/typings/GetVoiceSign.d.ts +11 -0
  71. package/lib/typings/GetVoiceSign.js +3 -0
  72. package/lib/typings/GetVoiceSign.js.map +1 -0
  73. package/lib/typings/Live.d.ts +6 -4
  74. package/lib/typings/LiveMsg.d.ts +4 -0
  75. package/lib/typings/LiveMsg.js +4 -0
  76. package/lib/typings/LiveMsg.js.map +1 -1
  77. package/lib/typings/LiveOptions.d.ts +3 -7
  78. package/lib/typings/RTCEventType.d.ts +2 -14
  79. package/lib/typings/RTCEventType.js +0 -7
  80. package/lib/typings/RTCEventType.js.map +1 -1
  81. package/lib/typings/RTCJoinedInfo.d.ts +28 -0
  82. package/lib/typings/RTCJoinedInfo.js +23 -0
  83. package/lib/typings/RTCJoinedInfo.js.map +1 -0
  84. package/lib/{RTCProtocol/index.d.ts → typings/RTCProtocol.d.ts} +1 -19
  85. package/lib/typings/RTCProtocol.js +9 -0
  86. package/lib/typings/RTCProtocol.js.map +1 -0
  87. package/lib/typings/VRWebViewRTCOptions.d.ts +6 -0
  88. package/lib/typings/VRWebViewRTCOptions.js +3 -0
  89. package/lib/typings/VRWebViewRTCOptions.js.map +1 -0
  90. package/lib/typings/WebSocket.d.ts +2 -1
  91. package/lib/typings/WebSocket.js +1 -0
  92. package/lib/typings/WebSocket.js.map +1 -1
  93. package/package.json +8 -3
  94. package/umd/{RTCProtocol.046933a5.js → RTCProtocol.543610f0.js} +1 -1
  95. package/umd/createLive.a6edf473.js +1 -0
  96. package/umd/createLiveReact.e21b4514.js +1 -0
  97. package/docs/assets/css/main.css +0 -2787
  98. package/docs/assets/js/main.js +0 -248
  99. package/docs/assets/js/search.js +0 -1
  100. package/lib/RTCProtocol/index.js.map +0 -1
  101. package/umd/createLive.6845145e.js +0 -1
  102. package/umd/createLiveReact.406cf5a3.js +0 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 功能说明
6
6
 
7
- **Live** 是 [如视开发者中心VRTC服务](https://developers.realsee.com/docs/#/docs/live/README) 的核心客户端 Web SDK,搭配 Live Container
7
+ **Live** 是 [如视开发者中心 VRTC 服务](https://developers.realsee.com/docs/#/docs/live/README) 的核心客户端 Web SDK,搭配 Live Container
8
8
  SDKs(iOS/Android/微信小程序)和 Live API 可以快速实现实时同屏、实时语音、IM 等功能。
9
9
 
10
10
  ### 名词释义
@@ -26,15 +26,17 @@ SDKs(iOS/Android/微信小程序)和 Live API 可以快速实现实时同屏
26
26
 
27
27
  ### 安装 SDK
28
28
 
29
- 可以通过Node包管理工具 [npm](https://www.npmjs.com/) 或 [yarn](https://yarnpkg.com/) 安装**Live**:
29
+ 可以通过 Node 包管理工具 [npm](https://www.npmjs.com/) 或 [yarn](https://yarnpkg.com/) 安装**Live**:
30
30
 
31
31
  ```bash
32
32
  # npm
33
- npm i @realsee/live
33
+ npm i @realsee/live tslib
34
34
  # yarn
35
- yarn add @realsee/live
35
+ yarn add @realsee/live tslib
36
36
  ```
37
37
 
38
+ > **Live** 通过 [TypeScript](http://www.typescriptlang.org/) 编写,依赖 [tslib]() 运行时,如果你的项目不是由 [TypeScript](http://www.typescriptlang.org/) 构成,请安装此运行时。
39
+
38
40
  ### 如何使用
39
41
 
40
42
  简单使用样例(先不考虑实时语音能力):
@@ -43,10 +45,11 @@ yarn add @realsee/live
43
45
  import { createLive } from '@realsee/live'
44
46
 
45
47
  const live = createLive({
46
- url: 'wss://ws-access.realsee.com/***/?=xxx', /* 连接 WebSocket 服务的 URL */
47
- getTicket: async () => {/* 获取带看"门票"的回调函数 */},
48
+ url: 'wss://ws-access.realsee.com/***/?=xxx' /* 连接 WebSocket 服务的 URL */,
49
+ getTicket: async () => {
50
+ /* 获取带看"门票"的回调函数 */
51
+ },
48
52
  })
49
-
50
53
  ```
51
54
 
52
55
  在创建 `live` 实例时配置了两个参数:
@@ -136,7 +139,7 @@ live.on('broadcast', (data /* 广播的数据 */) => {})
136
139
 
137
140
  ```ts
138
141
  live.on('ws.readyStateUpdate', (readyState: WebSocketState) => {
139
- console.log(readyState) // readyState 即是最新的 WebScoket 状态
142
+ console.log(readyState) // readyState 即是最新的 WebScoket 状态
140
143
  })
141
144
  ```
142
145
 
@@ -199,7 +202,7 @@ live.on('ws.readyStateUpdate', (readyState: WebSocketState) => {
199
202
 
200
203
  ```ts
201
204
  live.$RTC.on('userVolumes', (userVolumes: UserVolume[]) => {
202
- console.log(userVolumes) // userVolumes 正在说话的用户及其音量数据。
205
+ console.log(userVolumes) // userVolumes 正在说话的用户及其音量数据。
203
206
  })
204
207
  ```
205
208
 
@@ -222,17 +225,17 @@ live.$RTC.on('userVolumes', (userVolumes: UserVolume[]) => {
222
225
 
223
226
  与 WebSocket 通信的结构体`LiveMsg`格式如下:
224
227
 
225
- | 名称 | 类型 | 描述 |
226
- | --------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------- |
228
+ | 名称 | 类型 | 描述 |
229
+ | --------------- | ------------------- | ----------------------------------------------------------------------------------------------------- |
227
230
  | appId | string |
228
- | code | string | 返回码,详情参照[服务端 API Code 码表](https://developers.realsee.com/docs/#/docs/live/server/README) |
229
- | command | 指令 | WebSocket 通信指令类型,详情请查看[Live API](https://unpkg.com/@realsee/live/docs/index.html) 文档 |
230
- | data | Record<string, any> | 本条指令对应的业务数据 |
231
- | frontRequestId: | string | 前端的请求 ID,由 WS 服务原样透传回前端 |
232
- | message | string | 返回描述 |
233
- | requestId | string | 后端请求 ID |
234
- | roomCode | string | 带看房间号 |
235
- | triggerUserId | string | 触发指令的用户 ID |
231
+ | code | string | 返回码,详情参照[服务端 API Code 码表](https://developers.realsee.com/docs/#/docs/live/server/README) |
232
+ | command | 指令 | WebSocket 通信指令类型,详情请查看[Live API](https://unpkg.com/@realsee/live/docs/index.html) 文档 |
233
+ | data | Record<string, any> | 本条指令对应的业务数据 |
234
+ | frontRequestId: | string | 前端的请求 ID,由 WS 服务原样透传回前端 |
235
+ | message | string | 返回描述 |
236
+ | requestId | string | 后端请求 ID |
237
+ | roomCode | string | 带看房间号 |
238
+ | triggerUserId | string | 触发指令的用户 ID |
236
239
 
237
240
  当 WebSocket 推送的数据结构体不满足 `LiveMsg` 或者 `code` 值不为 `SUCCESS` 时会以 `error` 事件的形式抛出来。
238
241
 
@@ -244,33 +247,29 @@ live.$RTC.on('userVolumes', (userVolumes: UserVolume[]) => {
244
247
 
245
248
  语音能力需依赖 WebView/Browser 容器,即需要容器端实现 RTC 能力。
246
249
 
247
- 为了方便开发者接入,**如视开发者中心VRTC服务** 为主流平台提供 [容器SDK](https://developers.realsee.com/docs/#/docs/live/client/container/README )
250
+ 为了方便开发者接入,**如视开发者中心 VRTC 服务** 为主流平台提供 [容器 SDK](https://developers.realsee.com/docs/#/docs/live/client/container/README)
248
251
  和 [jsbridge-x](https://www.npmjs.com/package/@realsee/jsbridge-x) 。
249
252
 
250
- **Live** 通过 **jsbridge-x** 与 集成了**容器SDK** 的客户端应用或微信小程序应用程序桥接,实现原生能力的调用。这个 `jsbridge-x`
253
+ **Live** 通过 **jsbridge-x** 与 集成了**容器 SDK** 的客户端应用或微信小程序应用程序桥接,实现原生能力的调用。这个 `jsbridge-x`
251
254
  实例需作为配置参数提供给`createLive()`。
252
255
 
253
- 如果是 iOS/Android App(已接入如视VRTC容器SDK)
256
+ 如果是 iOS/Android App(已接入如视 VRTC 容器 SDK)
254
257
 
255
258
  ```js
256
- import AppBridge from '@realsee/jsbridge-x/lib/cjs/app'
259
+ import { JSBridgeApp } from '@realsee/jsbridge-x/lib/app'
257
260
  import { createLive } from '@realsee/live'
261
+ import { VRWebViewRTC } from '@realsee/live/RTC/VRWebViewRTC'
258
262
 
259
- const live = createLive({
260
- rtc: new AppBridge(),
261
- getTicket: async () => ''
262
- })
263
- ```
264
-
265
- 如果是 微信小程序(已接入如视VRTC容器SDK)
263
+ const jsBridgeInstance = new JSBridgeApp()
266
264
 
267
- ```js
268
- import MiniprogramBridge from '@realsee/jsbridge-x/lib/cjs/miniprogram'
269
- import { createLive } from '@realsee/live'
265
+ const rtcInstance = new VRWebViewRTC({
266
+ jsBridge,
267
+ getVoiceSign: () => {},
268
+ })
270
269
 
271
270
  const live = createLive({
272
- rtc: new MiniprogramBridge(),
273
- getTicket: async () => ''
271
+ rtc: rtcInstance,
272
+ getTicket: async () => '',
274
273
  })
275
274
  ```
276
275
 
@@ -285,6 +284,62 @@ live.$RTC.micro
285
284
  live.$RTC.on('userVolumes', (userVolumes) => {})
286
285
  ```
287
286
 
287
+ ## 浏览器端支持
288
+
289
+ 不同于客户端(Android\iOS) 已经内置 **RTC** 能力,浏览器端需要我们自己安装 第三方 **RTC SDK** 依赖。 **Live** 内置 腾讯[TRTC](https://github.com/tencentyun/TRTCSDK/blob/HEAD/Web/README-zh_CN.md) 和 亚马逊[Chime](https://github.com/aws/amazon-chime-sdk-js) 两个语音能力集成实现。
290
+
291
+ > 纯浏览器端不需要 **Native** 中转能力,没有 **jsBridge** 依赖。
292
+
293
+ ### TRTC
294
+
295
+ 安装依赖:
296
+
297
+ ```shell
298
+ # 需要您自行安装
299
+ yarn add trtc-js-sdk
300
+ ```
301
+
302
+ 使用方式:
303
+
304
+ ```tsx
305
+ import { createLive } from '@realsee/live'
306
+ import { BrowserRTC } from '@realsee/live/RTC/BrowserRTC'
307
+
308
+ const rtcInstance = new VRWebViewRTC({
309
+ getVoiceSign: () => {},
310
+ })
311
+
312
+ const live = createLive({
313
+ rtc: rtcInstance,
314
+ getTicket: async () => '',
315
+ })
316
+ ```
317
+
318
+ ### Chime
319
+
320
+ 安装依赖:
321
+
322
+ ```shell
323
+ # 需要您自行安装
324
+ yarn add amazon-chime-sdk-js
325
+ ```
326
+
327
+ 使用方式:
328
+
329
+ ```tsx
330
+ import { createLive } from '@realsee/live'
331
+ import { BrowserRTC4Chime } from '@realsee/live/RTC/BrowserRTC4Chime'
332
+
333
+ const rtcInstance = new BrowserRTC4Chime({
334
+ getVoiceSign: () => {},
335
+ })
336
+
337
+ const live = createLive({
338
+ rtc: rtcInstance,
339
+ getTicket: async () => '',
340
+ })
341
+ ```
342
+
288
343
  ## TypeScript & React 支持
289
344
 
290
345
  **Live** 有完整的 [TypeScript Generics](https://www.typescriptlang.org/docs/handbook/2/generics.html)
@@ -295,30 +350,24 @@ live.$RTC.on('userVolumes', (userVolumes) => {})
295
350
  步骤一:新建文件 `LiveReact.ts` 并创建您自己的 `LiveReact` 实例。
296
351
 
297
352
  ```tsx
298
- import {createLiveReact} from '@realsee/live'
353
+ import { createLiveReact } from '@realsee/live'
299
354
 
300
355
  /** 定义帧数据快照结构 */
301
356
  interface Snapshot {
302
- /** 以 Five 状态快照为例 */
303
- five: {
304
- panoIndex: number,
305
- fov: number,
306
- mode: 'Panorama' | 'Model',
307
- latitude: number,
308
- longitude: number,
309
- }
310
- }
311
-
312
- /** 定义异步获取 `Ticket` 回调参数结构 */
313
- interface TicketArgs {
314
- /* 没有特殊参数 */
357
+ /** 以 Five 状态快照为例 */
358
+ five: {
359
+ panoIndex: number
360
+ fov: number
361
+ mode: 'Panorama' | 'Model'
362
+ latitude: number
363
+ longitude: number
364
+ }
315
365
  }
316
366
 
367
+ /** 通过 `createLiveReact()` 函数创建实例*/
317
368
 
318
- /** 通过 `createLiveReact()` 函数创建实例,注意必须提供 `getTicket` 配置参数 */
319
-
320
- const LiveReact = createLiveReact<Snapshot, TicketArgs>({
321
- getTicket: async () => '', /* 必须提供 */
369
+ const LiveReact = createLiveReact<Snapshot>({
370
+ getTicket: async () => '' /* 必须提供 */,
322
371
  })
323
372
 
324
373
  export default LiveReact
@@ -328,7 +377,6 @@ export const LiveProvider = LiveReact.LiveProvider
328
377
  export const useConnect = LiveReact.useConnect
329
378
  export const useKeyframe = LiveReact.useKeyframe
330
379
  // export ..
331
-
332
380
  ```
333
381
 
334
382
  步骤二:通过 `LiveProvider` 将 `live` 实例集成到 `React` 的 [Context](https://reactjs.org/docs/context.html) 上下文环境中。
@@ -336,7 +384,12 @@ export const useKeyframe = LiveReact.useKeyframe
336
384
  ```jsx
337
385
  import { LiveProvider } from './LiveReact'
338
386
 
339
- ReactDOM.render(<LiveProvider><RootApp/></LiveProvider>, containter)
387
+ ReactDOM.render(
388
+ <LiveProvider>
389
+ <RootApp />
390
+ </LiveProvider>,
391
+ containter
392
+ )
340
393
  ```
341
394
 
342
395
  步骤三:在您的 `React` 函数组件中使用相关 `Hooks` 函数。
@@ -344,7 +397,7 @@ ReactDOM.render(<LiveProvider><RootApp/></LiveProvider>, containter)
344
397
  ```jsx
345
398
  import { useConnect } from './LiveReact'
346
399
 
347
- function ReconnectBtn () {
400
+ function ReconnectBtn() {
348
401
  const connect = useConnect()
349
402
 
350
403
  return <button onClick={() => connect()}>重新连接</button>
@@ -359,5 +412,5 @@ function ReconnectBtn () {
359
412
  ## 相关文档链接
360
413
 
361
414
  - [@realsee/five](https://www.npmjs.com/package/@realsee/five)
362
- - [@realsee/jsbridge-x](https://www.npmjs.com/package/@realsee/jsbridge-x)
363
- - [如视开发者中心VRTC服务](https://developers.realsee.com/docs/#/docs/live/README)
415
+ - [@realsee/jsbridge](https://www.npmjs.com/package/@realsee/jsbridge)
416
+ - [如视开发者中心 VRTC 服务](https://developers.realsee.com/docs/#/docs/live/README)
package/docs/.nojekyll ADDED
@@ -0,0 +1 @@
1
+ TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
@@ -0,0 +1,43 @@
1
+ body {
2
+ font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
3
+ }
4
+ blockquote {
5
+ border-left: 4px solid rgb(128 128 128 / 50%);
6
+ color: rgb(0 0 0 / 60%);
7
+ line-height: 2;
8
+ font-size: 0.85rem;
9
+ padding: 3px 0px 3px 1em;
10
+ }
11
+
12
+ .tsd-typography {
13
+ font-size: 14px;
14
+ }
15
+
16
+ .tsd-typography h4 {
17
+ line-height: 2;
18
+ }
19
+
20
+ .hljs {
21
+ background-color: transparent;
22
+ font-family: monospace;
23
+ }
24
+ code {
25
+ font-size: 12px;
26
+ background-color: rgb(96 125 139 / 10%);
27
+ }
28
+
29
+ pre {
30
+ background-color: rgb(205 220 57 / 8%);
31
+ }
32
+
33
+ p {
34
+ line-height: 1.5;
35
+ }
36
+
37
+ a {
38
+ color: #3832cf;
39
+ }
40
+
41
+ a:hover {
42
+ color: darkred;
43
+ }
@@ -0,0 +1,127 @@
1
+ :root {
2
+ --light-hl-0: #008000;
3
+ --dark-hl-0: #6A9955;
4
+ --light-hl-1: #000000;
5
+ --dark-hl-1: #D4D4D4;
6
+ --light-hl-2: #AF00DB;
7
+ --dark-hl-2: #C586C0;
8
+ --light-hl-3: #001080;
9
+ --dark-hl-3: #9CDCFE;
10
+ --light-hl-4: #A31515;
11
+ --dark-hl-4: #CE9178;
12
+ --light-hl-5: #0000FF;
13
+ --dark-hl-5: #569CD6;
14
+ --light-hl-6: #0070C1;
15
+ --dark-hl-6: #4FC1FF;
16
+ --light-hl-7: #795E26;
17
+ --dark-hl-7: #DCDCAA;
18
+ --light-hl-8: #098658;
19
+ --dark-hl-8: #B5CEA8;
20
+ --light-hl-9: #267F99;
21
+ --dark-hl-9: #4EC9B0;
22
+ --light-hl-10: #800000;
23
+ --dark-hl-10: #808080;
24
+ --light-hl-11: #800000;
25
+ --dark-hl-11: #569CD6;
26
+ --light-hl-12: #FF0000;
27
+ --dark-hl-12: #9CDCFE;
28
+ --light-hl-13: #000000FF;
29
+ --dark-hl-13: #D4D4D4;
30
+ --light-hl-14: #000000;
31
+ --dark-hl-14: #C8C8C8;
32
+ --light-code-background: #FFFFFF;
33
+ --dark-code-background: #1E1E1E;
34
+ }
35
+
36
+ @media (prefers-color-scheme: light) { :root {
37
+ --hl-0: var(--light-hl-0);
38
+ --hl-1: var(--light-hl-1);
39
+ --hl-2: var(--light-hl-2);
40
+ --hl-3: var(--light-hl-3);
41
+ --hl-4: var(--light-hl-4);
42
+ --hl-5: var(--light-hl-5);
43
+ --hl-6: var(--light-hl-6);
44
+ --hl-7: var(--light-hl-7);
45
+ --hl-8: var(--light-hl-8);
46
+ --hl-9: var(--light-hl-9);
47
+ --hl-10: var(--light-hl-10);
48
+ --hl-11: var(--light-hl-11);
49
+ --hl-12: var(--light-hl-12);
50
+ --hl-13: var(--light-hl-13);
51
+ --hl-14: var(--light-hl-14);
52
+ --code-background: var(--light-code-background);
53
+ } }
54
+
55
+ @media (prefers-color-scheme: dark) { :root {
56
+ --hl-0: var(--dark-hl-0);
57
+ --hl-1: var(--dark-hl-1);
58
+ --hl-2: var(--dark-hl-2);
59
+ --hl-3: var(--dark-hl-3);
60
+ --hl-4: var(--dark-hl-4);
61
+ --hl-5: var(--dark-hl-5);
62
+ --hl-6: var(--dark-hl-6);
63
+ --hl-7: var(--dark-hl-7);
64
+ --hl-8: var(--dark-hl-8);
65
+ --hl-9: var(--dark-hl-9);
66
+ --hl-10: var(--dark-hl-10);
67
+ --hl-11: var(--dark-hl-11);
68
+ --hl-12: var(--dark-hl-12);
69
+ --hl-13: var(--dark-hl-13);
70
+ --hl-14: var(--dark-hl-14);
71
+ --code-background: var(--dark-code-background);
72
+ } }
73
+
74
+ body.light {
75
+ --hl-0: var(--light-hl-0);
76
+ --hl-1: var(--light-hl-1);
77
+ --hl-2: var(--light-hl-2);
78
+ --hl-3: var(--light-hl-3);
79
+ --hl-4: var(--light-hl-4);
80
+ --hl-5: var(--light-hl-5);
81
+ --hl-6: var(--light-hl-6);
82
+ --hl-7: var(--light-hl-7);
83
+ --hl-8: var(--light-hl-8);
84
+ --hl-9: var(--light-hl-9);
85
+ --hl-10: var(--light-hl-10);
86
+ --hl-11: var(--light-hl-11);
87
+ --hl-12: var(--light-hl-12);
88
+ --hl-13: var(--light-hl-13);
89
+ --hl-14: var(--light-hl-14);
90
+ --code-background: var(--light-code-background);
91
+ }
92
+
93
+ body.dark {
94
+ --hl-0: var(--dark-hl-0);
95
+ --hl-1: var(--dark-hl-1);
96
+ --hl-2: var(--dark-hl-2);
97
+ --hl-3: var(--dark-hl-3);
98
+ --hl-4: var(--dark-hl-4);
99
+ --hl-5: var(--dark-hl-5);
100
+ --hl-6: var(--dark-hl-6);
101
+ --hl-7: var(--dark-hl-7);
102
+ --hl-8: var(--dark-hl-8);
103
+ --hl-9: var(--dark-hl-9);
104
+ --hl-10: var(--dark-hl-10);
105
+ --hl-11: var(--dark-hl-11);
106
+ --hl-12: var(--dark-hl-12);
107
+ --hl-13: var(--dark-hl-13);
108
+ --hl-14: var(--dark-hl-14);
109
+ --code-background: var(--dark-code-background);
110
+ }
111
+
112
+ .hl-0 { color: var(--hl-0); }
113
+ .hl-1 { color: var(--hl-1); }
114
+ .hl-2 { color: var(--hl-2); }
115
+ .hl-3 { color: var(--hl-3); }
116
+ .hl-4 { color: var(--hl-4); }
117
+ .hl-5 { color: var(--hl-5); }
118
+ .hl-6 { color: var(--hl-6); }
119
+ .hl-7 { color: var(--hl-7); }
120
+ .hl-8 { color: var(--hl-8); }
121
+ .hl-9 { color: var(--hl-9); }
122
+ .hl-10 { color: var(--hl-10); }
123
+ .hl-11 { color: var(--hl-11); }
124
+ .hl-12 { color: var(--hl-12); }
125
+ .hl-13 { color: var(--hl-13); }
126
+ .hl-14 { color: var(--hl-14); }
127
+ pre, code { background: var(--code-background); }