deepsea-components 5.18.5 → 5.18.7

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 (105) hide show
  1. package/README.md +23 -23
  2. package/dist/components/AutoFit.cjs +9 -5
  3. package/dist/components/AutoFit.d.ts +1 -1
  4. package/dist/components/AutoScroll.cjs +9 -5
  5. package/dist/components/AutoScroll.d.ts +2 -2
  6. package/dist/components/AutoSizeTextarea.cjs +9 -5
  7. package/dist/components/AutoSizeTextarea.d.ts +1 -1
  8. package/dist/components/CircleText.cjs +9 -5
  9. package/dist/components/CircleText.d.ts +1 -1
  10. package/dist/components/CopyButton.cjs +11 -10
  11. package/dist/components/CopyButton.d.ts +3 -3
  12. package/dist/components/CopyButton.js +2 -2
  13. package/dist/components/DraggableGrid.cjs +9 -5
  14. package/dist/components/DraggableGrid.d.ts +2 -2
  15. package/dist/components/DraggableGrid.module.cjs +9 -5
  16. package/dist/components/Echart.cjs +9 -5
  17. package/dist/components/Echart.d.ts +3 -3
  18. package/dist/components/Flow.cjs +9 -5
  19. package/dist/components/Flow.d.ts +1 -1
  20. package/dist/components/FormLabel.cjs +9 -5
  21. package/dist/components/FormLabel.d.ts +1 -1
  22. package/dist/components/HlsPlayer.cjs +9 -5
  23. package/dist/components/HlsPlayer.d.ts +1 -1
  24. package/dist/components/IconFileType.cjs +9 -5
  25. package/dist/components/IconFileType.d.ts +1 -1
  26. package/dist/components/InfiniteScroll.cjs +9 -5
  27. package/dist/components/InfiniteScroll.d.ts +1 -1
  28. package/dist/components/InputFile.cjs +9 -5
  29. package/dist/components/InputFile.d.ts +1 -1
  30. package/dist/components/InputFileButton.cjs +9 -5
  31. package/dist/components/InputFileButton.d.ts +2 -2
  32. package/dist/components/LoopSwiper.cjs +9 -5
  33. package/dist/components/LoopSwiper.d.ts +1 -1
  34. package/dist/components/ReadExcel.cjs +9 -5
  35. package/dist/components/ReadExcel.d.ts +1 -1
  36. package/dist/components/ReadSheet.cjs +9 -5
  37. package/dist/components/ReadSheet.d.ts +2 -2
  38. package/dist/components/Ring.cjs +9 -5
  39. package/dist/components/Ring.d.ts +1 -1
  40. package/dist/components/RtspPlayer.cjs +9 -5
  41. package/dist/components/RtspPlayer.d.ts +1 -1
  42. package/dist/components/Scroll.cjs +14 -9
  43. package/dist/components/Scroll.d.ts +1 -1
  44. package/dist/components/ScrollMask.cjs +9 -5
  45. package/dist/components/ScrollMask.d.ts +1 -1
  46. package/dist/components/ScrollMask.module.cjs +9 -5
  47. package/dist/components/SectionRing.cjs +9 -5
  48. package/dist/components/SectionRing.d.ts +1 -1
  49. package/dist/components/Skeleton.cjs +9 -5
  50. package/dist/components/Skeleton.d.ts +1 -1
  51. package/dist/components/Title.cjs +9 -5
  52. package/dist/components/Title.d.ts +1 -1
  53. package/dist/components/TransitionBox.cjs +9 -5
  54. package/dist/components/TransitionBox.d.ts +1 -1
  55. package/dist/components/TransitionNum.cjs +9 -5
  56. package/dist/components/TransitionNum.d.ts +1 -1
  57. package/dist/components/Trapezium.cjs +9 -5
  58. package/dist/components/Trapezium.d.ts +1 -1
  59. package/dist/components/Unify.cjs +9 -5
  60. package/dist/components/Unify.d.ts +1 -1
  61. package/dist/components/WriteExcel.cjs +9 -5
  62. package/dist/components/WriteExcel.d.ts +1 -1
  63. package/dist/components/WriteSheet.cjs +9 -5
  64. package/dist/components/WriteSheet.d.ts +2 -2
  65. package/dist/components/rtspPlayer/reader.cjs +12 -8
  66. package/dist/index.cjs +9 -5
  67. package/dist/utils/getReactVersion.cjs +9 -5
  68. package/dist/utils/index.cjs +14 -10
  69. package/dist/utils/index.d.ts +1 -1
  70. package/package.json +7 -7
  71. package/src/components/AutoFit.tsx +1 -1
  72. package/src/components/AutoScroll.tsx +3 -3
  73. package/src/components/AutoSizeTextarea.tsx +1 -1
  74. package/src/components/CircleText.tsx +81 -81
  75. package/src/components/CopyButton.tsx +4 -3
  76. package/src/components/DraggableGrid.tsx +3 -2
  77. package/src/components/Echart.tsx +63 -62
  78. package/src/components/Flow.tsx +5 -1
  79. package/src/components/FormLabel.tsx +1 -1
  80. package/src/components/HlsPlayer.tsx +1 -1
  81. package/src/components/IconFileType.tsx +1 -1
  82. package/src/components/InfiniteScroll.tsx +10 -1
  83. package/src/components/InputFile.tsx +3 -1
  84. package/src/components/InputFileButton.tsx +13 -13
  85. package/src/components/LoopSwiper.tsx +1 -1
  86. package/src/components/ReadExcel.tsx +13 -13
  87. package/src/components/ReadSheet.tsx +2 -2
  88. package/src/components/Ring.tsx +1 -1
  89. package/src/components/RtspPlayer.tsx +3 -4
  90. package/src/components/Scroll.tsx +12 -1
  91. package/src/components/ScrollMask.module.css +87 -87
  92. package/src/components/ScrollMask.tsx +1 -1
  93. package/src/components/SectionRing.tsx +2 -2
  94. package/src/components/Skeleton.tsx +1 -1
  95. package/src/components/Title.tsx +1 -1
  96. package/src/components/TransitionBox.tsx +1 -1
  97. package/src/components/TransitionNum.tsx +1 -1
  98. package/src/components/Trapezium.tsx +1 -1
  99. package/src/components/Unify.tsx +11 -1
  100. package/src/components/WriteExcel.tsx +13 -13
  101. package/src/components/WriteSheet.tsx +2 -2
  102. package/src/components/rtspPlayer/reader.ts +6 -9
  103. package/src/utils/getReactVersion.ts +7 -7
  104. package/src/utils/index.ts +33 -33
  105. package/tsconfig.json +6 -13
@@ -1,87 +1,87 @@
1
- .scroll-mask {
2
- position: sticky;
3
- z-index: 10;
4
- pointer-events: none;
5
- }
6
-
7
- .top-scroll-mask {
8
- width: 100%;
9
- height: 0;
10
- top: 0;
11
- right: 0;
12
- bottom: 100%;
13
- left: 0;
14
- }
15
-
16
- .scroll-mask-content {
17
- position: absolute;
18
- background-image: linear-gradient(
19
- to var(--scroll-mask-direction),
20
- var(--scroll-mask-color-from, rgba(0, 0, 0, 0.1)),
21
- var(--scroll-mask-color-to, rgba(0, 0, 0, 0))
22
- );
23
- clip-path: var(--scroll-mask-clip-path, none);
24
- }
25
-
26
- .top-scroll-mask-content {
27
- width: 100%;
28
- height: var(--scroll-mask-size, 8px);
29
- top: 0;
30
- right: 50%;
31
- transform: translateX(50%);
32
- --scroll-mask-direction: bottom;
33
- }
34
-
35
- .bottom-scroll-mask {
36
- width: 100%;
37
- height: 0;
38
- top: 100%;
39
- right: 0;
40
- bottom: 0;
41
- left: 0;
42
- }
43
-
44
- .bottom-scroll-mask-content {
45
- width: 100%;
46
- height: var(--scroll-mask-size, 8px);
47
- bottom: 0;
48
- left: 50%;
49
- transform: translateX(-50%);
50
- --scroll-mask-direction: top;
51
- }
52
-
53
- .left-scroll-mask {
54
- width: 0;
55
- height: 100%;
56
- top: 0;
57
- right: 100%;
58
- bottom: 0;
59
- left: 0;
60
- }
61
-
62
- .left-scroll-mask-content {
63
- width: var(--scroll-mask-size, 8px);
64
- height: 100%;
65
- left: 0;
66
- top: 50%;
67
- transform: translateY(-50%);
68
- --scroll-mask-direction: right;
69
- }
70
-
71
- .right-scroll-mask {
72
- width: 0;
73
- height: 100%;
74
- top: 0;
75
- right: 0;
76
- bottom: 0;
77
- left: 100%;
78
- }
79
-
80
- .right-scroll-mask-content {
81
- width: var(--scroll-mask-size, 8px);
82
- height: 100%;
83
- right: 0;
84
- bottom: 50%;
85
- transform: translateY(50%);
86
- --scroll-mask-direction: left;
87
- }
1
+ .scroll-mask {
2
+ position: sticky;
3
+ z-index: 10;
4
+ pointer-events: none;
5
+ }
6
+
7
+ .top-scroll-mask {
8
+ width: 100%;
9
+ height: 0;
10
+ top: 0;
11
+ right: 0;
12
+ bottom: 100%;
13
+ left: 0;
14
+ }
15
+
16
+ .scroll-mask-content {
17
+ position: absolute;
18
+ background-image: linear-gradient(
19
+ to var(--scroll-mask-direction),
20
+ var(--scroll-mask-color-from, rgba(0, 0, 0, 0.1)),
21
+ var(--scroll-mask-color-to, rgba(0, 0, 0, 0))
22
+ );
23
+ clip-path: var(--scroll-mask-clip-path, none);
24
+ }
25
+
26
+ .top-scroll-mask-content {
27
+ width: 100%;
28
+ height: var(--scroll-mask-size, 8px);
29
+ top: 0;
30
+ right: 50%;
31
+ transform: translateX(50%);
32
+ --scroll-mask-direction: bottom;
33
+ }
34
+
35
+ .bottom-scroll-mask {
36
+ width: 100%;
37
+ height: 0;
38
+ top: 100%;
39
+ right: 0;
40
+ bottom: 0;
41
+ left: 0;
42
+ }
43
+
44
+ .bottom-scroll-mask-content {
45
+ width: 100%;
46
+ height: var(--scroll-mask-size, 8px);
47
+ bottom: 0;
48
+ left: 50%;
49
+ transform: translateX(-50%);
50
+ --scroll-mask-direction: top;
51
+ }
52
+
53
+ .left-scroll-mask {
54
+ width: 0;
55
+ height: 100%;
56
+ top: 0;
57
+ right: 100%;
58
+ bottom: 0;
59
+ left: 0;
60
+ }
61
+
62
+ .left-scroll-mask-content {
63
+ width: var(--scroll-mask-size, 8px);
64
+ height: 100%;
65
+ left: 0;
66
+ top: 50%;
67
+ transform: translateY(-50%);
68
+ --scroll-mask-direction: right;
69
+ }
70
+
71
+ .right-scroll-mask {
72
+ width: 0;
73
+ height: 100%;
74
+ top: 0;
75
+ right: 0;
76
+ bottom: 0;
77
+ left: 100%;
78
+ }
79
+
80
+ .right-scroll-mask-content {
81
+ width: var(--scroll-mask-size, 8px);
82
+ height: 100%;
83
+ right: 0;
84
+ bottom: 50%;
85
+ transform: translateY(50%);
86
+ --scroll-mask-direction: left;
87
+ }
@@ -1,4 +1,4 @@
1
- import { ComponentProps, CSSProperties, FC, useRef } from "react"
1
+ import { type ComponentProps, type CSSProperties, type FC, useRef } from "react"
2
2
 
3
3
  import { clsx, isNonNullable } from "deepsea-tools"
4
4
  import { useSize } from "soda-hooks"
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
 
3
- import { forwardRef, HTMLAttributes } from "react"
3
+ import { type HTMLAttributes, forwardRef } from "react"
4
4
 
5
- import { drawArc, DrawArcOptions } from "deepsea-tools"
5
+ import { type DrawArcOptions, drawArc } from "deepsea-tools"
6
6
 
7
7
  export interface SectionRingProps extends HTMLAttributes<HTMLDivElement> {
8
8
  outerRadius: number
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
 
3
- import { forwardRef, HTMLAttributes } from "react"
3
+ import { type HTMLAttributes, forwardRef } from "react"
4
4
 
5
5
  import { css } from "@emotion/css"
6
6
  import { clsx } from "deepsea-tools"
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
 
3
- import { ComponentProps, FC, useImperativeHandle, useLayoutEffect, useRef } from "react"
3
+ import { type ComponentProps, type FC, useImperativeHandle, useLayoutEffect, useRef } from "react"
4
4
  import { createPortal } from "react-dom"
5
5
  import { renderToString } from "react-dom/server"
6
6
 
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
 
3
- import { CSSProperties, FC, forwardRef, HTMLAttributes, useEffect, useRef, useState } from "react"
3
+ import { type CSSProperties, type FC, type HTMLAttributes, forwardRef, useEffect, useRef, useState } from "react"
4
4
 
5
5
  import { useSize } from "soda-hooks"
6
6
 
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
 
3
- import { ForwardedRef, forwardRef, HTMLAttributes, useEffect, useImperativeHandle, useRef } from "react"
3
+ import { type ForwardedRef, type HTMLAttributes, forwardRef, useEffect, useImperativeHandle, useRef } from "react"
4
4
 
5
5
  import { setFrameInterval } from "deepsea-tools"
6
6
 
@@ -1,6 +1,6 @@
1
1
  "use client"
2
2
 
3
- import { forwardRef, HTMLAttributes } from "react"
3
+ import { type HTMLAttributes, forwardRef } from "react"
4
4
 
5
5
  import { css } from "@emotion/css"
6
6
  import { clsx } from "deepsea-tools"
@@ -2,7 +2,17 @@
2
2
 
3
3
  /* eslint-disable no-restricted-syntax */
4
4
 
5
- import { ComponentProps, createContext, createElement, CSSProperties, FC, JSX, JSXElementConstructor, ReactNode, useContext } from "react"
5
+ import {
6
+ type ComponentProps,
7
+ type CSSProperties,
8
+ type FC,
9
+ type JSX,
10
+ type JSXElementConstructor,
11
+ type ReactNode,
12
+ createContext,
13
+ createElement,
14
+ useContext,
15
+ } from "react"
6
16
 
7
17
  import { clsx } from "deepsea-tools"
8
18
 
@@ -1,13 +1,13 @@
1
- "use client"
2
-
3
- import { WriteSheet, WriteSheetProps } from "./WriteSheet"
4
-
5
- /**
6
- * @deprecated 请使用 WriteSheetProps 代替
7
- */
8
- export type WriteExcelProps = WriteSheetProps
9
-
10
- /**
11
- * @deprecated 请使用 WriteSheet 代替
12
- */
13
- export const WriteExcel = WriteSheet
1
+ "use client"
2
+
3
+ import { type WriteSheetProps, WriteSheet } from "./WriteSheet"
4
+
5
+ /**
6
+ * @deprecated 请使用 WriteSheetProps 代替
7
+ */
8
+ export type WriteExcelProps = WriteSheetProps
9
+
10
+ /**
11
+ * @deprecated 请使用 WriteSheet 代替
12
+ */
13
+ export const WriteExcel = WriteSheet
@@ -2,9 +2,9 @@
2
2
 
3
3
  /* eslint-disable no-restricted-syntax */
4
4
 
5
- import { ComponentProps, createElement, JSX, JSXElementConstructor, MouseEvent as ReactMouseEvent } from "react"
5
+ import { type ComponentProps, type JSX, type JSXElementConstructor, type MouseEvent as ReactMouseEvent, createElement } from "react"
6
6
 
7
- import { writeSheet, WriteSheetParams } from "deepsea-tools"
7
+ import { type WriteSheetParams, writeSheet } from "deepsea-tools"
8
8
 
9
9
  export type WriteSheetProps<AS extends keyof JSX.IntrinsicElements | JSXElementConstructor<any> = "button"> = Omit<ComponentProps<AS>, "as" | "excel"> & {
10
10
  as?: AS
@@ -86,12 +86,14 @@ export class MediaMTXWebRTCReader {
86
86
  let payloadType = ""
87
87
 
88
88
  pc.addTransceiver(mediaType, { direction: "recvonly" })
89
+
89
90
  pc.createOffer()
90
91
  .then(offer => {
91
92
  if (offer.sdp === undefined) throw new Error("SDP not present")
92
93
  if (offer.sdp.includes(` ${codec}`)) throw new Error("already present")
93
94
 
94
95
  const sections = offer.sdp.split(`m=${mediaType}`)
96
+
95
97
  const payloadTypes = sections
96
98
  .slice(1)
97
99
  .map(section => section.split("\r\n")[0].split(" ").slice(3))
@@ -128,8 +130,7 @@ export class MediaMTXWebRTCReader {
128
130
  `a=rtpmap:${payloadType} ${codec}\r\n` +
129
131
  (fmtp !== undefined ? `a=fmtp:${payloadType} ${fmtp}\r\n` : ""),
130
132
  }),
131
- ),
132
- )
133
+ ))
133
134
  .then(() => resolve(true))
134
135
  .catch(() => resolve(false))
135
136
  .finally(() => pc.close())
@@ -296,6 +297,7 @@ export class MediaMTXWebRTCReader {
296
297
 
297
298
  private static editOffer(sdp: string, nonAdvertisedCodecs: string[]) {
298
299
  const sections = sdp.split("m=")
300
+
299
301
  const payloadTypes = sections
300
302
  .slice(1)
301
303
  .map(section => section.split("\r\n")[0].split(" ").slice(3))
@@ -373,16 +375,11 @@ export class MediaMTXWebRTCReader {
373
375
 
374
376
  private getNonAdvertisedCodecs() {
375
377
  Promise.all(
376
- [
377
- ["pcma/8000/2"],
378
- ["multiopus/48000/6", "channel_mapping=0,4,1,2,3,5;num_streams=4;coupled_streams=2"],
379
- ["L16/48000/2"],
380
- ].map(codec =>
378
+ [["pcma/8000/2"], ["multiopus/48000/6", "channel_mapping=0,4,1,2,3,5;num_streams=4;coupled_streams=2"], ["L16/48000/2"]].map(codec =>
381
379
  MediaMTXWebRTCReader.supportsNonAdvertisedCodec(codec[0], codec[1]).then(isSupported => {
382
380
  if (!isSupported) return false
383
381
  return codec[0]
384
- }),
385
- ),
382
+ })),
386
383
  )
387
384
  .then(codecs => codecs.filter((codec): codec is string => codec !== false))
388
385
  .then(codecs => {
@@ -1,7 +1,7 @@
1
- import { version } from "react"
2
-
3
- const reg = /(\d+)\.(\d+)\.(\d+)/
4
-
5
- export function getReactVersion() {
6
- return version.match(reg)!.slice(1).map(Number)
7
- }
1
+ import { version } from "react"
2
+
3
+ const reg = /(\d+)\.(\d+)\.(\d+)/
4
+
5
+ export function getReactVersion() {
6
+ return version.match(reg)!.slice(1).map(Number)
7
+ }
@@ -1,33 +1,33 @@
1
- import { CSSProperties } from "react"
2
-
3
- export type CSSVariableName = `--${string}`
4
-
5
- export type CSSVariableValue = string | number | undefined
6
-
7
- export interface StyleWithCSSVariable extends CSSProperties {
8
- [X: CSSVariableName]: CSSVariableValue
9
- }
10
-
11
- const cssVariableReg = /[A-Z]/
12
-
13
- function addCSSVariableLine(match: string): string {
14
- return `-${match}`
15
- }
16
-
17
- export function transformCSSVariableName(name: string): CSSVariableName {
18
- return `--${name.replace(cssVariableReg, addCSSVariableLine).toLowerCase()}`
19
- }
20
-
21
- export function transformCSSVariable(style: Partial<Record<string, CSSVariableValue>>, style2?: CSSProperties): CSSProperties {
22
- return Object.assign(
23
- Object.entries(style).reduce((acc: StyleWithCSSVariable, [key, value]) => {
24
- acc[transformCSSVariableName(key)] = value
25
- return acc
26
- }, {}),
27
- style2,
28
- )
29
- }
30
-
31
- export function px(value: string | number | undefined): string | undefined {
32
- return typeof value === "number" ? `${value}px` : value
33
- }
1
+ import type { CSSProperties } from "react"
2
+
3
+ export type CSSVariableName = `--${string}`
4
+
5
+ export type CSSVariableValue = string | number | undefined
6
+
7
+ export interface StyleWithCSSVariable extends CSSProperties {
8
+ [X: CSSVariableName]: CSSVariableValue
9
+ }
10
+
11
+ const cssVariableReg = /[A-Z]/
12
+
13
+ function addCSSVariableLine(match: string): string {
14
+ return `-${match}`
15
+ }
16
+
17
+ export function transformCSSVariableName(name: string): CSSVariableName {
18
+ return `--${name.replace(cssVariableReg, addCSSVariableLine).toLowerCase()}`
19
+ }
20
+
21
+ export function transformCSSVariable(style: Partial<Record<string, CSSVariableValue>>, style2?: CSSProperties): CSSProperties {
22
+ return Object.assign(
23
+ Object.entries(style).reduce((acc: StyleWithCSSVariable, [key, value]) => {
24
+ acc[transformCSSVariableName(key)] = value
25
+ return acc
26
+ }, {}),
27
+ style2,
28
+ )
29
+ }
30
+
31
+ export function px(value: string | number | undefined): string | undefined {
32
+ return typeof value === "number" ? `${value}px` : value
33
+ }
package/tsconfig.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
+ "rootDir": "src",
3
4
  "strict": true,
4
5
  "declaration": true,
5
6
  "skipLibCheck": true,
@@ -7,19 +8,11 @@
7
8
  "target": "ESNext",
8
9
  "module": "ESNext",
9
10
  "moduleResolution": "Bundler",
10
- "types": [
11
- "node",
12
- "react",
13
- "react-dom"
14
- ],
11
+ "types": ["node", "react", "react-dom"],
12
+ "verbatimModuleSyntax": true,
15
13
  "paths": {
16
- "@/*": [
17
- "./src/*"
18
- ]
14
+ "@/*": ["./src/*"]
19
15
  }
20
16
  },
21
- "include": [
22
- "src",
23
- "types.d.ts"
24
- ]
25
- }
17
+ "include": ["src", "types.d.ts"]
18
+ }