deepsea-components 5.18.5 → 5.18.6
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/README.md +23 -23
- package/dist/components/AutoFit.d.ts +1 -1
- package/dist/components/AutoScroll.d.ts +2 -2
- package/dist/components/AutoSizeTextarea.d.ts +1 -1
- package/dist/components/CircleText.d.ts +1 -1
- package/dist/components/CopyButton.cjs +2 -5
- package/dist/components/CopyButton.d.ts +3 -3
- package/dist/components/CopyButton.js +2 -2
- package/dist/components/DraggableGrid.d.ts +2 -2
- package/dist/components/Echart.d.ts +3 -3
- package/dist/components/Flow.d.ts +1 -1
- package/dist/components/FormLabel.d.ts +1 -1
- package/dist/components/HlsPlayer.d.ts +1 -1
- package/dist/components/IconFileType.d.ts +1 -1
- package/dist/components/InfiniteScroll.d.ts +1 -1
- package/dist/components/InputFile.d.ts +1 -1
- package/dist/components/InputFileButton.d.ts +2 -2
- package/dist/components/LoopSwiper.d.ts +1 -1
- package/dist/components/ReadExcel.d.ts +1 -1
- package/dist/components/ReadSheet.d.ts +2 -2
- package/dist/components/Ring.d.ts +1 -1
- package/dist/components/RtspPlayer.d.ts +1 -1
- package/dist/components/Scroll.d.ts +1 -1
- package/dist/components/ScrollMask.d.ts +1 -1
- package/dist/components/SectionRing.d.ts +1 -1
- package/dist/components/Skeleton.d.ts +1 -1
- package/dist/components/Title.d.ts +1 -1
- package/dist/components/TransitionBox.d.ts +1 -1
- package/dist/components/TransitionNum.d.ts +1 -1
- package/dist/components/Trapezium.d.ts +1 -1
- package/dist/components/Unify.d.ts +1 -1
- package/dist/components/WriteExcel.d.ts +1 -1
- package/dist/components/WriteSheet.d.ts +2 -2
- package/dist/utils/index.d.ts +1 -1
- package/package.json +6 -6
- package/src/components/AutoFit.tsx +1 -1
- package/src/components/AutoScroll.tsx +3 -3
- package/src/components/AutoSizeTextarea.tsx +1 -1
- package/src/components/CircleText.tsx +81 -81
- package/src/components/CopyButton.tsx +4 -3
- package/src/components/DraggableGrid.tsx +3 -2
- package/src/components/Echart.tsx +63 -62
- package/src/components/Flow.tsx +5 -1
- package/src/components/FormLabel.tsx +1 -1
- package/src/components/HlsPlayer.tsx +1 -1
- package/src/components/IconFileType.tsx +1 -1
- package/src/components/InfiniteScroll.tsx +10 -1
- package/src/components/InputFile.tsx +3 -1
- package/src/components/InputFileButton.tsx +13 -13
- package/src/components/LoopSwiper.tsx +1 -1
- package/src/components/ReadExcel.tsx +13 -13
- package/src/components/ReadSheet.tsx +2 -2
- package/src/components/Ring.tsx +1 -1
- package/src/components/RtspPlayer.tsx +3 -4
- package/src/components/Scroll.tsx +12 -1
- package/src/components/ScrollMask.module.css +87 -87
- package/src/components/ScrollMask.tsx +1 -1
- package/src/components/SectionRing.tsx +2 -2
- package/src/components/Skeleton.tsx +1 -1
- package/src/components/Title.tsx +1 -1
- package/src/components/TransitionBox.tsx +1 -1
- package/src/components/TransitionNum.tsx +1 -1
- package/src/components/Trapezium.tsx +1 -1
- package/src/components/Unify.tsx +11 -1
- package/src/components/WriteExcel.tsx +13 -13
- package/src/components/WriteSheet.tsx +2 -2
- package/src/components/rtspPlayer/reader.ts +6 -9
- package/src/utils/getReactVersion.ts +7 -7
- package/src/utils/index.ts +33 -33
- package/tsconfig.json +6 -13
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import {
|
|
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,
|
|
5
|
+
import { type ComponentProps, type JSX, type JSXElementConstructor, type MouseEvent as ReactMouseEvent, createElement } from "react"
|
|
6
6
|
|
|
7
|
-
import {
|
|
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
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
23
|
-
"types.d.ts"
|
|
24
|
-
]
|
|
25
|
-
}
|
|
17
|
+
"include": ["src", "types.d.ts"]
|
|
18
|
+
}
|