@zero-library/common 2.3.12 → 2.4.0
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 +43 -0
- package/dist/index.cjs.js +192 -255
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +0 -92
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +61 -56
- package/dist/index.d.ts +61 -56
- package/dist/index.esm.js +164 -225
- package/dist/index.esm.js.map +1 -1
- package/package.json +14 -2
package/dist/index.d.mts
CHANGED
|
@@ -20,7 +20,7 @@ interface AudioPlayerProps {
|
|
|
20
20
|
* 提供基本的音频播放功能
|
|
21
21
|
* @param props - 组件属性
|
|
22
22
|
*/
|
|
23
|
-
declare const _default$
|
|
23
|
+
declare const _default$q: ({ fileUrl }: AudioPlayerProps) => react_jsx_runtime.JSX.Element;
|
|
24
24
|
|
|
25
25
|
/** Docx文档预览组件的属性接口 */
|
|
26
26
|
interface DocxPreviewProps {
|
|
@@ -33,7 +33,7 @@ interface DocxPreviewProps {
|
|
|
33
33
|
* Docx文档预览组件
|
|
34
34
|
* @param props - 组件属性
|
|
35
35
|
*/
|
|
36
|
-
declare const _default$
|
|
36
|
+
declare const _default$p: ({ fileUrl, scale }: DocxPreviewProps) => react_jsx_runtime.JSX.Element;
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* 文件图标组件属性接口
|
|
@@ -59,7 +59,7 @@ interface FileIconProps {
|
|
|
59
59
|
* @param props - 组件属性
|
|
60
60
|
* @returns 对应文件类型的图标
|
|
61
61
|
*/
|
|
62
|
-
declare const _default$
|
|
62
|
+
declare const _default$o: ({ suffix, fontSize }: FileIconProps) => react_jsx_runtime.JSX.Element;
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* 文件预览组件属性接口
|
|
@@ -93,7 +93,7 @@ interface FilePreviewProps {
|
|
|
93
93
|
* 支持图片、PDF、视频、音频、Markdown等文件格式的预览
|
|
94
94
|
* @param props - 组件属性
|
|
95
95
|
*/
|
|
96
|
-
declare const _default$
|
|
96
|
+
declare const _default$n: ({ suffix, fileUrl, pdfParams, password, searchValue, emptyProps, onSetPassword }: FilePreviewProps) => react_jsx_runtime.JSX.Element;
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* 文件预览抽屉组件属性接口
|
|
@@ -123,7 +123,7 @@ interface FilePreviewDrawerProps extends FilePreviewProps {
|
|
|
123
123
|
* @param props - 组件属性
|
|
124
124
|
* @returns 文件预览抽屉组件
|
|
125
125
|
*/
|
|
126
|
-
declare const _default$
|
|
126
|
+
declare const _default$m: ({ open, title, onClose, ...props }: FilePreviewDrawerProps) => react_jsx_runtime.JSX.Element;
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* Markdown预览组件属性接口
|
|
@@ -139,7 +139,7 @@ interface MarkdownPreviewProps {
|
|
|
139
139
|
* 从指定URL获取Markdown内容并渲染显示
|
|
140
140
|
* @param props - 组件属性
|
|
141
141
|
*/
|
|
142
|
-
declare const _default$
|
|
142
|
+
declare const _default$l: ({ fileUrl, searchValue }: MarkdownPreviewProps) => react_jsx_runtime.JSX.Element;
|
|
143
143
|
|
|
144
144
|
interface PdfImagePreviewProps {
|
|
145
145
|
/** PDF文件URL地址 */
|
|
@@ -159,7 +159,7 @@ interface PdfImagePreviewProps {
|
|
|
159
159
|
* @param props - 组件属性
|
|
160
160
|
* 适用于大量PDF页面的高效展示
|
|
161
161
|
*/
|
|
162
|
-
declare const _default$
|
|
162
|
+
declare const _default$k: ({ fileUrl, pageNo, scale, isHasThumbnails, onSetPageNo }: PdfImagePreviewProps) => react_jsx_runtime.JSX.Element;
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
165
|
* PDF预览组件属性接口
|
|
@@ -187,7 +187,7 @@ interface PdfPreviewProps {
|
|
|
187
187
|
* @param props - 组件属性
|
|
188
188
|
* TODO 放大缩小会丢失分页
|
|
189
189
|
*/
|
|
190
|
-
declare const _default$
|
|
190
|
+
declare const _default$j: ({ password, fileUrl, pageNo, scale, isHasThumbnails, onSetPassword, onSetPageNo }: PdfPreviewProps) => react_jsx_runtime.JSX.Element;
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
193
|
* 视频播放器组件属性接口
|
|
@@ -201,7 +201,7 @@ interface VideoPlayerProps {
|
|
|
201
201
|
* 提供基本的视频播放功能
|
|
202
202
|
* @param props - 组件属性
|
|
203
203
|
*/
|
|
204
|
-
declare const _default$
|
|
204
|
+
declare const _default$i: ({ fileUrl }: VideoPlayerProps) => react_jsx_runtime.JSX.Element;
|
|
205
205
|
|
|
206
206
|
/**
|
|
207
207
|
* Iframe组件属性接口
|
|
@@ -223,7 +223,7 @@ interface IframeProps {
|
|
|
223
223
|
* 支持加载状态、URL参数处理、防缓存等功能
|
|
224
224
|
* @param props - 组件属性
|
|
225
225
|
*/
|
|
226
|
-
declare const _default$
|
|
226
|
+
declare const _default$h: react.ForwardRefExoticComponent<IframeProps & react.RefAttributes<HTMLIFrameElement>>;
|
|
227
227
|
|
|
228
228
|
/**
|
|
229
229
|
* 组件映射类型,用于延时加载
|
|
@@ -250,7 +250,7 @@ interface LazyComponentProps {
|
|
|
250
250
|
* 使用示例:<LazyComponent type="renderMarkdown" data={{}} loading={true} />
|
|
251
251
|
* @param props - 组件属性
|
|
252
252
|
*/
|
|
253
|
-
declare const _default$
|
|
253
|
+
declare const _default$g: ({ type, customComponents, unknownContent, ...rest }: LazyComponentProps) => string | number | true | react_jsx_runtime.JSX.Element | Iterable<react.ReactNode>;
|
|
254
254
|
|
|
255
255
|
declare const ANNOTATION_ATTRS: readonly ["annotation-id", "user-name", "user-id", "update-time", "content"];
|
|
256
256
|
/**
|
|
@@ -392,7 +392,7 @@ interface MarkdownEditorProps {
|
|
|
392
392
|
* 提供丰富的编辑功能:格式化、链接、图片、表格、高亮等
|
|
393
393
|
* @param props - 组件属性
|
|
394
394
|
*/
|
|
395
|
-
declare const _default$
|
|
395
|
+
declare const _default$f: ({ value, onChange, searchValue, disabled, extraNav, fixedToolbar, floatToolbar, onQuote, onDownloadFile, annotationConfig, collectionConfig, pageNoConfig }: MarkdownEditorProps) => react_jsx_runtime.JSX.Element;
|
|
396
396
|
|
|
397
397
|
interface Detection {
|
|
398
398
|
bbox: [number, number, number, number];
|
|
@@ -417,7 +417,7 @@ interface MarkDrawingProps {
|
|
|
417
417
|
* @param originalSize - 原始尺寸信息
|
|
418
418
|
* @param scopeRender - 可选的作用域渲染函数
|
|
419
419
|
*/
|
|
420
|
-
declare const _default$
|
|
420
|
+
declare const _default$e: ({ children, detections, originalSize, scopeRender }: MarkDrawingProps) => react_jsx_runtime.JSX.Element;
|
|
421
421
|
|
|
422
422
|
/**
|
|
423
423
|
* Markdown渲染组件属性接口
|
|
@@ -438,7 +438,7 @@ interface RenderMarkdownProps {
|
|
|
438
438
|
* 支持自定义组件、搜索高亮等功能
|
|
439
439
|
* @param RenderMarkdownProps - 组件属性
|
|
440
440
|
*/
|
|
441
|
-
declare const _default$
|
|
441
|
+
declare const _default$d: ({ content, searchValue, customComponents, ...rest }: RenderMarkdownProps) => react_jsx_runtime.JSX.Element;
|
|
442
442
|
|
|
443
443
|
/**
|
|
444
444
|
* 渲染控制对象类型
|
|
@@ -490,7 +490,7 @@ interface RenderWrapperProps<C, P> {
|
|
|
490
490
|
* @param props - 组件属性
|
|
491
491
|
* @returns 渲染的组件或null
|
|
492
492
|
*/
|
|
493
|
-
declare const _default$
|
|
493
|
+
declare const _default$c: react.ForwardRefExoticComponent<RenderWrapperProps<unknown, unknown> & react.RefAttributes<unknown>>;
|
|
494
494
|
|
|
495
495
|
/**
|
|
496
496
|
* 判断是否应该渲染组件
|
|
@@ -510,44 +510,6 @@ declare function propsMerge(control?: RenderControl<any, any> | null, props?: Ob
|
|
|
510
510
|
props: any;
|
|
511
511
|
};
|
|
512
512
|
|
|
513
|
-
type SpeechPermission = 'granted' | 'denied' | 'prompt' | 'unsupported';
|
|
514
|
-
type SpeechProps = {
|
|
515
|
-
/**
|
|
516
|
-
* 识别结果回调函数
|
|
517
|
-
*/
|
|
518
|
-
onResult: (text: string) => void;
|
|
519
|
-
/**
|
|
520
|
-
* 语言,默认为中文
|
|
521
|
-
*/
|
|
522
|
-
lang?: string;
|
|
523
|
-
};
|
|
524
|
-
/**
|
|
525
|
-
* 语音识别 Hook
|
|
526
|
-
* @param onResult 识别结果回调函数
|
|
527
|
-
* @param lang 语言,默认为中文
|
|
528
|
-
* @returns 返回权限状态、录音状态和控制方法
|
|
529
|
-
*/
|
|
530
|
-
declare const _default$c: ({ onResult, lang }: SpeechProps) => {
|
|
531
|
-
/**
|
|
532
|
-
* 权限状态
|
|
533
|
-
*/
|
|
534
|
-
permission: SpeechPermission;
|
|
535
|
-
/**
|
|
536
|
-
* 录音状态
|
|
537
|
-
*/
|
|
538
|
-
isRecording: boolean;
|
|
539
|
-
/** 开始语音识别 */
|
|
540
|
-
start: () => void;
|
|
541
|
-
/** 停止语音识别 */
|
|
542
|
-
stop: () => void;
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
* 语音按钮
|
|
547
|
-
* @param SpeechProps
|
|
548
|
-
*/
|
|
549
|
-
declare const _default$b: (props: SpeechProps) => react_jsx_runtime.JSX.Element;
|
|
550
|
-
|
|
551
513
|
/**
|
|
552
514
|
* 用户头像组件属性接口
|
|
553
515
|
*/
|
|
@@ -564,7 +526,7 @@ interface UserAvatarProps {
|
|
|
564
526
|
* 如果没有头像图片,则显示用户名首字母作为头像
|
|
565
527
|
* @param props - 组件属性
|
|
566
528
|
*/
|
|
567
|
-
declare const _default$
|
|
529
|
+
declare const _default$b: ({ size, avatarSrc, userName }: UserAvatarProps) => react_jsx_runtime.JSX.Element;
|
|
568
530
|
|
|
569
531
|
/**
|
|
570
532
|
* iframe 消息参数类型
|
|
@@ -621,11 +583,54 @@ type Handler<P = Params> = (params: P, source?: MessageEventSource | null, origi
|
|
|
621
583
|
* off('custom-event', handleMessage)
|
|
622
584
|
* ```
|
|
623
585
|
*/
|
|
624
|
-
declare const _default$
|
|
586
|
+
declare const _default$a: (allowedOrigins?: string[]) => {
|
|
625
587
|
on: (type: string, handler: Handler<Params>) => void;
|
|
626
588
|
off: (type: string, handler: Handler<Params>) => void;
|
|
627
589
|
};
|
|
628
590
|
|
|
591
|
+
/**
|
|
592
|
+
* 队列任务定义
|
|
593
|
+
* - func:任务函数(可同步/异步)
|
|
594
|
+
* - args:任务参数(透传给 func)
|
|
595
|
+
*/
|
|
596
|
+
type QueueTask = {
|
|
597
|
+
func: (...args: any[]) => Promise<void> | void;
|
|
598
|
+
args: any[];
|
|
599
|
+
};
|
|
600
|
+
/**
|
|
601
|
+
* 异步队列 Hook
|
|
602
|
+
* 用于按顺序串行执行一组异步任务(FIFO),避免并发导致的竞态问题。
|
|
603
|
+
*
|
|
604
|
+
* 设计目标:
|
|
605
|
+
* - 同一时刻只执行一个任务,后续任务自动排队
|
|
606
|
+
* - 支持暂停/恢复执行
|
|
607
|
+
* - 保持 API 简单,具体任务逻辑由调用方提供
|
|
608
|
+
* - 默认不丢任务:任务入队后会一直等待,直到执行完成或被清空
|
|
609
|
+
*
|
|
610
|
+
* @returns 队列控制方法与状态
|
|
611
|
+
* - addToQueue:入队一个任务
|
|
612
|
+
* - executeQueue:暂停/恢复队列的自动执行
|
|
613
|
+
* - clearQueue:清空等待中的任务(不影响当前正在执行的任务)
|
|
614
|
+
* - queueSize:当前等待队列长度(不含正在执行中的任务)
|
|
615
|
+
* - enabled:当前是否允许自动执行
|
|
616
|
+
* - running:当前是否正在执行任务
|
|
617
|
+
*
|
|
618
|
+
* @example
|
|
619
|
+
* const { addToQueue, executeQueue } = useAsyncQueue()
|
|
620
|
+
* addToQueue(async (id) => await fetchById(id), '1')
|
|
621
|
+
* addToQueue(async () => await refresh())
|
|
622
|
+
* executeQueue(false) // 暂停执行(默认即为 true)
|
|
623
|
+
*
|
|
624
|
+
*/
|
|
625
|
+
declare const _default$9: () => {
|
|
626
|
+
addToQueue: (func: QueueTask["func"], ...args: QueueTask["args"]) => void;
|
|
627
|
+
executeQueue: (nextEnabled: boolean) => void;
|
|
628
|
+
clearQueue: () => void;
|
|
629
|
+
queueSize: number;
|
|
630
|
+
enabled: boolean;
|
|
631
|
+
running: boolean;
|
|
632
|
+
};
|
|
633
|
+
|
|
629
634
|
/**
|
|
630
635
|
* 通用的自动刷新 Hook
|
|
631
636
|
* 监听指定值的变化,当满足条件时自动触发回调函数
|
|
@@ -2489,4 +2494,4 @@ declare function createTokenManager({ key, storage }: TokenManagerProps): {
|
|
|
2489
2494
|
clear: () => void;
|
|
2490
2495
|
};
|
|
2491
2496
|
|
|
2492
|
-
export { type AnnotationConfig, type AnnotationType, _default$
|
|
2497
|
+
export { type AnnotationConfig, type AnnotationType, _default$q as AudioPlayer, type AudioPlayerProps, BusinessCode, type CacheMessage, type CollectionConfig, type CollectionType, type ComponentMapType, DEFAULT_DATE_FORMAT, DEFAULT_DATE_TIME_FORMAT, DEFAULT_YEAR_MONTH_DAY_FORMAT, DEFAULT_YEAR_MONTH_FORMAT, _default$p as DocxPreview, type DocxPreviewProps, _default$o as FileIcon, type FileIconProps, _default$n as FilePreview, _default$m as FilePreviewDrawer, type FilePreviewDrawerProps, type FilePreviewProps, type FindTreeNodesOptions, type FormatSizeOptions, HttpStatus, _default$h as Iframe, type IframeProps, _default$g as LazyComponent, type LazyComponentProps, _default$e as MarkDrawing, type MarkDrawingProps, _default$f as MarkdownEditor, type MarkdownEditorProps, _default$l as MarkdownPreview, type MarkdownPreviewProps, MultiEmailValidator, _default$k as PdfImagePreview, type PdfImagePreviewProps, _default$j as PdfPreview, type PdfPreviewProps, PhoneOrMobileValidator, RegBankCardNo, RegDetailAddress, RegEmail, RegFixedTelePhone, RegIdentityCardNo, RegMobile, RegNumNo, RegPassword, RegSmsCode, RegTaxNo, RegTelePhone, type RenderControl, _default$d as RenderMarkdown, type RenderMarkdownProps, _default$c as RenderWrapper, type RenderWrapperProps, type RequestConfig, type SecureManagerProps, type SetIntervalType, type SizeUnit, ThanNumLengthValidator, ThanNumValidator, type TokenManagerProps, _default$b as UserAvatar, type UserAvatarProps, _default$i as VideoPlayer, type VideoPlayerProps, type WebSocketProps, type WebSocketType, absVal, addUrlLastSlash, aesDecrypt, aesEncrypt, arrToObj, buildUrlParams, cachedMessage, calculate, compareNum, convertCurrency, convertNewlineToBr, copyText, createRequest, createSecureManager, createTokenManager, decimalPlaces, deepCopy, deepEqual, deepMerge, dividedBy, downloadFile, emit, emitToChild, executeScript, findTreeNodesByIds, formatDate, formatNumberWithCommas, formatSize, genNonDuplicateID, generateRandomNumbers, getAllUrlParams, getDeviceId, getEndOfTimestamp, getFileName, getFileSuffixName, getRowSpanCount, getStartOfTimestamp, getTimestamp, getWebSocketUrl, htmlToMarkdown, htmlToText, importThirdPartyFile, is, isArray, isBlob, isBoolean, isDate, isDef, isElement, isEmpty, isEmptyObj, isExpire, isExternal, isFunction, isInteger, isJson, isLocalhost, isMap, isNegative, isNull, isNullOrUnDef, isNumber, isNumberNoNaN, isObject, isPromise, isReferenceType, isRegExp, isScriptSafe, isSet, isString, isUnDef, isWindow, markdownToText, minus, objToOptions, plus, precision, processItemList, propsMerge, setInterval, setUrlMainSource, shouldRender, times, toFixed, transform, transforms, _default$9 as useAsyncQueue, _default$8 as useAutoRefresh, _default$7 as useCountDown, _default$6 as useCreateValtioContext, _default$5 as useDebounce, _default$4 as useDeepEffect, _default$a as useIframeRelayBridge, _default$3 as useRefState, _default$2 as useSyncInput, _default$1 as useThrottle, _default as useWebSocket };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ interface AudioPlayerProps {
|
|
|
20
20
|
* 提供基本的音频播放功能
|
|
21
21
|
* @param props - 组件属性
|
|
22
22
|
*/
|
|
23
|
-
declare const _default$
|
|
23
|
+
declare const _default$q: ({ fileUrl }: AudioPlayerProps) => react_jsx_runtime.JSX.Element;
|
|
24
24
|
|
|
25
25
|
/** Docx文档预览组件的属性接口 */
|
|
26
26
|
interface DocxPreviewProps {
|
|
@@ -33,7 +33,7 @@ interface DocxPreviewProps {
|
|
|
33
33
|
* Docx文档预览组件
|
|
34
34
|
* @param props - 组件属性
|
|
35
35
|
*/
|
|
36
|
-
declare const _default$
|
|
36
|
+
declare const _default$p: ({ fileUrl, scale }: DocxPreviewProps) => react_jsx_runtime.JSX.Element;
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* 文件图标组件属性接口
|
|
@@ -59,7 +59,7 @@ interface FileIconProps {
|
|
|
59
59
|
* @param props - 组件属性
|
|
60
60
|
* @returns 对应文件类型的图标
|
|
61
61
|
*/
|
|
62
|
-
declare const _default$
|
|
62
|
+
declare const _default$o: ({ suffix, fontSize }: FileIconProps) => react_jsx_runtime.JSX.Element;
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* 文件预览组件属性接口
|
|
@@ -93,7 +93,7 @@ interface FilePreviewProps {
|
|
|
93
93
|
* 支持图片、PDF、视频、音频、Markdown等文件格式的预览
|
|
94
94
|
* @param props - 组件属性
|
|
95
95
|
*/
|
|
96
|
-
declare const _default$
|
|
96
|
+
declare const _default$n: ({ suffix, fileUrl, pdfParams, password, searchValue, emptyProps, onSetPassword }: FilePreviewProps) => react_jsx_runtime.JSX.Element;
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* 文件预览抽屉组件属性接口
|
|
@@ -123,7 +123,7 @@ interface FilePreviewDrawerProps extends FilePreviewProps {
|
|
|
123
123
|
* @param props - 组件属性
|
|
124
124
|
* @returns 文件预览抽屉组件
|
|
125
125
|
*/
|
|
126
|
-
declare const _default$
|
|
126
|
+
declare const _default$m: ({ open, title, onClose, ...props }: FilePreviewDrawerProps) => react_jsx_runtime.JSX.Element;
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* Markdown预览组件属性接口
|
|
@@ -139,7 +139,7 @@ interface MarkdownPreviewProps {
|
|
|
139
139
|
* 从指定URL获取Markdown内容并渲染显示
|
|
140
140
|
* @param props - 组件属性
|
|
141
141
|
*/
|
|
142
|
-
declare const _default$
|
|
142
|
+
declare const _default$l: ({ fileUrl, searchValue }: MarkdownPreviewProps) => react_jsx_runtime.JSX.Element;
|
|
143
143
|
|
|
144
144
|
interface PdfImagePreviewProps {
|
|
145
145
|
/** PDF文件URL地址 */
|
|
@@ -159,7 +159,7 @@ interface PdfImagePreviewProps {
|
|
|
159
159
|
* @param props - 组件属性
|
|
160
160
|
* 适用于大量PDF页面的高效展示
|
|
161
161
|
*/
|
|
162
|
-
declare const _default$
|
|
162
|
+
declare const _default$k: ({ fileUrl, pageNo, scale, isHasThumbnails, onSetPageNo }: PdfImagePreviewProps) => react_jsx_runtime.JSX.Element;
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
165
|
* PDF预览组件属性接口
|
|
@@ -187,7 +187,7 @@ interface PdfPreviewProps {
|
|
|
187
187
|
* @param props - 组件属性
|
|
188
188
|
* TODO 放大缩小会丢失分页
|
|
189
189
|
*/
|
|
190
|
-
declare const _default$
|
|
190
|
+
declare const _default$j: ({ password, fileUrl, pageNo, scale, isHasThumbnails, onSetPassword, onSetPageNo }: PdfPreviewProps) => react_jsx_runtime.JSX.Element;
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
193
|
* 视频播放器组件属性接口
|
|
@@ -201,7 +201,7 @@ interface VideoPlayerProps {
|
|
|
201
201
|
* 提供基本的视频播放功能
|
|
202
202
|
* @param props - 组件属性
|
|
203
203
|
*/
|
|
204
|
-
declare const _default$
|
|
204
|
+
declare const _default$i: ({ fileUrl }: VideoPlayerProps) => react_jsx_runtime.JSX.Element;
|
|
205
205
|
|
|
206
206
|
/**
|
|
207
207
|
* Iframe组件属性接口
|
|
@@ -223,7 +223,7 @@ interface IframeProps {
|
|
|
223
223
|
* 支持加载状态、URL参数处理、防缓存等功能
|
|
224
224
|
* @param props - 组件属性
|
|
225
225
|
*/
|
|
226
|
-
declare const _default$
|
|
226
|
+
declare const _default$h: react.ForwardRefExoticComponent<IframeProps & react.RefAttributes<HTMLIFrameElement>>;
|
|
227
227
|
|
|
228
228
|
/**
|
|
229
229
|
* 组件映射类型,用于延时加载
|
|
@@ -250,7 +250,7 @@ interface LazyComponentProps {
|
|
|
250
250
|
* 使用示例:<LazyComponent type="renderMarkdown" data={{}} loading={true} />
|
|
251
251
|
* @param props - 组件属性
|
|
252
252
|
*/
|
|
253
|
-
declare const _default$
|
|
253
|
+
declare const _default$g: ({ type, customComponents, unknownContent, ...rest }: LazyComponentProps) => string | number | true | react_jsx_runtime.JSX.Element | Iterable<react.ReactNode>;
|
|
254
254
|
|
|
255
255
|
declare const ANNOTATION_ATTRS: readonly ["annotation-id", "user-name", "user-id", "update-time", "content"];
|
|
256
256
|
/**
|
|
@@ -392,7 +392,7 @@ interface MarkdownEditorProps {
|
|
|
392
392
|
* 提供丰富的编辑功能:格式化、链接、图片、表格、高亮等
|
|
393
393
|
* @param props - 组件属性
|
|
394
394
|
*/
|
|
395
|
-
declare const _default$
|
|
395
|
+
declare const _default$f: ({ value, onChange, searchValue, disabled, extraNav, fixedToolbar, floatToolbar, onQuote, onDownloadFile, annotationConfig, collectionConfig, pageNoConfig }: MarkdownEditorProps) => react_jsx_runtime.JSX.Element;
|
|
396
396
|
|
|
397
397
|
interface Detection {
|
|
398
398
|
bbox: [number, number, number, number];
|
|
@@ -417,7 +417,7 @@ interface MarkDrawingProps {
|
|
|
417
417
|
* @param originalSize - 原始尺寸信息
|
|
418
418
|
* @param scopeRender - 可选的作用域渲染函数
|
|
419
419
|
*/
|
|
420
|
-
declare const _default$
|
|
420
|
+
declare const _default$e: ({ children, detections, originalSize, scopeRender }: MarkDrawingProps) => react_jsx_runtime.JSX.Element;
|
|
421
421
|
|
|
422
422
|
/**
|
|
423
423
|
* Markdown渲染组件属性接口
|
|
@@ -438,7 +438,7 @@ interface RenderMarkdownProps {
|
|
|
438
438
|
* 支持自定义组件、搜索高亮等功能
|
|
439
439
|
* @param RenderMarkdownProps - 组件属性
|
|
440
440
|
*/
|
|
441
|
-
declare const _default$
|
|
441
|
+
declare const _default$d: ({ content, searchValue, customComponents, ...rest }: RenderMarkdownProps) => react_jsx_runtime.JSX.Element;
|
|
442
442
|
|
|
443
443
|
/**
|
|
444
444
|
* 渲染控制对象类型
|
|
@@ -490,7 +490,7 @@ interface RenderWrapperProps<C, P> {
|
|
|
490
490
|
* @param props - 组件属性
|
|
491
491
|
* @returns 渲染的组件或null
|
|
492
492
|
*/
|
|
493
|
-
declare const _default$
|
|
493
|
+
declare const _default$c: react.ForwardRefExoticComponent<RenderWrapperProps<unknown, unknown> & react.RefAttributes<unknown>>;
|
|
494
494
|
|
|
495
495
|
/**
|
|
496
496
|
* 判断是否应该渲染组件
|
|
@@ -510,44 +510,6 @@ declare function propsMerge(control?: RenderControl<any, any> | null, props?: Ob
|
|
|
510
510
|
props: any;
|
|
511
511
|
};
|
|
512
512
|
|
|
513
|
-
type SpeechPermission = 'granted' | 'denied' | 'prompt' | 'unsupported';
|
|
514
|
-
type SpeechProps = {
|
|
515
|
-
/**
|
|
516
|
-
* 识别结果回调函数
|
|
517
|
-
*/
|
|
518
|
-
onResult: (text: string) => void;
|
|
519
|
-
/**
|
|
520
|
-
* 语言,默认为中文
|
|
521
|
-
*/
|
|
522
|
-
lang?: string;
|
|
523
|
-
};
|
|
524
|
-
/**
|
|
525
|
-
* 语音识别 Hook
|
|
526
|
-
* @param onResult 识别结果回调函数
|
|
527
|
-
* @param lang 语言,默认为中文
|
|
528
|
-
* @returns 返回权限状态、录音状态和控制方法
|
|
529
|
-
*/
|
|
530
|
-
declare const _default$c: ({ onResult, lang }: SpeechProps) => {
|
|
531
|
-
/**
|
|
532
|
-
* 权限状态
|
|
533
|
-
*/
|
|
534
|
-
permission: SpeechPermission;
|
|
535
|
-
/**
|
|
536
|
-
* 录音状态
|
|
537
|
-
*/
|
|
538
|
-
isRecording: boolean;
|
|
539
|
-
/** 开始语音识别 */
|
|
540
|
-
start: () => void;
|
|
541
|
-
/** 停止语音识别 */
|
|
542
|
-
stop: () => void;
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
* 语音按钮
|
|
547
|
-
* @param SpeechProps
|
|
548
|
-
*/
|
|
549
|
-
declare const _default$b: (props: SpeechProps) => react_jsx_runtime.JSX.Element;
|
|
550
|
-
|
|
551
513
|
/**
|
|
552
514
|
* 用户头像组件属性接口
|
|
553
515
|
*/
|
|
@@ -564,7 +526,7 @@ interface UserAvatarProps {
|
|
|
564
526
|
* 如果没有头像图片,则显示用户名首字母作为头像
|
|
565
527
|
* @param props - 组件属性
|
|
566
528
|
*/
|
|
567
|
-
declare const _default$
|
|
529
|
+
declare const _default$b: ({ size, avatarSrc, userName }: UserAvatarProps) => react_jsx_runtime.JSX.Element;
|
|
568
530
|
|
|
569
531
|
/**
|
|
570
532
|
* iframe 消息参数类型
|
|
@@ -621,11 +583,54 @@ type Handler<P = Params> = (params: P, source?: MessageEventSource | null, origi
|
|
|
621
583
|
* off('custom-event', handleMessage)
|
|
622
584
|
* ```
|
|
623
585
|
*/
|
|
624
|
-
declare const _default$
|
|
586
|
+
declare const _default$a: (allowedOrigins?: string[]) => {
|
|
625
587
|
on: (type: string, handler: Handler<Params>) => void;
|
|
626
588
|
off: (type: string, handler: Handler<Params>) => void;
|
|
627
589
|
};
|
|
628
590
|
|
|
591
|
+
/**
|
|
592
|
+
* 队列任务定义
|
|
593
|
+
* - func:任务函数(可同步/异步)
|
|
594
|
+
* - args:任务参数(透传给 func)
|
|
595
|
+
*/
|
|
596
|
+
type QueueTask = {
|
|
597
|
+
func: (...args: any[]) => Promise<void> | void;
|
|
598
|
+
args: any[];
|
|
599
|
+
};
|
|
600
|
+
/**
|
|
601
|
+
* 异步队列 Hook
|
|
602
|
+
* 用于按顺序串行执行一组异步任务(FIFO),避免并发导致的竞态问题。
|
|
603
|
+
*
|
|
604
|
+
* 设计目标:
|
|
605
|
+
* - 同一时刻只执行一个任务,后续任务自动排队
|
|
606
|
+
* - 支持暂停/恢复执行
|
|
607
|
+
* - 保持 API 简单,具体任务逻辑由调用方提供
|
|
608
|
+
* - 默认不丢任务:任务入队后会一直等待,直到执行完成或被清空
|
|
609
|
+
*
|
|
610
|
+
* @returns 队列控制方法与状态
|
|
611
|
+
* - addToQueue:入队一个任务
|
|
612
|
+
* - executeQueue:暂停/恢复队列的自动执行
|
|
613
|
+
* - clearQueue:清空等待中的任务(不影响当前正在执行的任务)
|
|
614
|
+
* - queueSize:当前等待队列长度(不含正在执行中的任务)
|
|
615
|
+
* - enabled:当前是否允许自动执行
|
|
616
|
+
* - running:当前是否正在执行任务
|
|
617
|
+
*
|
|
618
|
+
* @example
|
|
619
|
+
* const { addToQueue, executeQueue } = useAsyncQueue()
|
|
620
|
+
* addToQueue(async (id) => await fetchById(id), '1')
|
|
621
|
+
* addToQueue(async () => await refresh())
|
|
622
|
+
* executeQueue(false) // 暂停执行(默认即为 true)
|
|
623
|
+
*
|
|
624
|
+
*/
|
|
625
|
+
declare const _default$9: () => {
|
|
626
|
+
addToQueue: (func: QueueTask["func"], ...args: QueueTask["args"]) => void;
|
|
627
|
+
executeQueue: (nextEnabled: boolean) => void;
|
|
628
|
+
clearQueue: () => void;
|
|
629
|
+
queueSize: number;
|
|
630
|
+
enabled: boolean;
|
|
631
|
+
running: boolean;
|
|
632
|
+
};
|
|
633
|
+
|
|
629
634
|
/**
|
|
630
635
|
* 通用的自动刷新 Hook
|
|
631
636
|
* 监听指定值的变化,当满足条件时自动触发回调函数
|
|
@@ -2489,4 +2494,4 @@ declare function createTokenManager({ key, storage }: TokenManagerProps): {
|
|
|
2489
2494
|
clear: () => void;
|
|
2490
2495
|
};
|
|
2491
2496
|
|
|
2492
|
-
export { type AnnotationConfig, type AnnotationType, _default$
|
|
2497
|
+
export { type AnnotationConfig, type AnnotationType, _default$q as AudioPlayer, type AudioPlayerProps, BusinessCode, type CacheMessage, type CollectionConfig, type CollectionType, type ComponentMapType, DEFAULT_DATE_FORMAT, DEFAULT_DATE_TIME_FORMAT, DEFAULT_YEAR_MONTH_DAY_FORMAT, DEFAULT_YEAR_MONTH_FORMAT, _default$p as DocxPreview, type DocxPreviewProps, _default$o as FileIcon, type FileIconProps, _default$n as FilePreview, _default$m as FilePreviewDrawer, type FilePreviewDrawerProps, type FilePreviewProps, type FindTreeNodesOptions, type FormatSizeOptions, HttpStatus, _default$h as Iframe, type IframeProps, _default$g as LazyComponent, type LazyComponentProps, _default$e as MarkDrawing, type MarkDrawingProps, _default$f as MarkdownEditor, type MarkdownEditorProps, _default$l as MarkdownPreview, type MarkdownPreviewProps, MultiEmailValidator, _default$k as PdfImagePreview, type PdfImagePreviewProps, _default$j as PdfPreview, type PdfPreviewProps, PhoneOrMobileValidator, RegBankCardNo, RegDetailAddress, RegEmail, RegFixedTelePhone, RegIdentityCardNo, RegMobile, RegNumNo, RegPassword, RegSmsCode, RegTaxNo, RegTelePhone, type RenderControl, _default$d as RenderMarkdown, type RenderMarkdownProps, _default$c as RenderWrapper, type RenderWrapperProps, type RequestConfig, type SecureManagerProps, type SetIntervalType, type SizeUnit, ThanNumLengthValidator, ThanNumValidator, type TokenManagerProps, _default$b as UserAvatar, type UserAvatarProps, _default$i as VideoPlayer, type VideoPlayerProps, type WebSocketProps, type WebSocketType, absVal, addUrlLastSlash, aesDecrypt, aesEncrypt, arrToObj, buildUrlParams, cachedMessage, calculate, compareNum, convertCurrency, convertNewlineToBr, copyText, createRequest, createSecureManager, createTokenManager, decimalPlaces, deepCopy, deepEqual, deepMerge, dividedBy, downloadFile, emit, emitToChild, executeScript, findTreeNodesByIds, formatDate, formatNumberWithCommas, formatSize, genNonDuplicateID, generateRandomNumbers, getAllUrlParams, getDeviceId, getEndOfTimestamp, getFileName, getFileSuffixName, getRowSpanCount, getStartOfTimestamp, getTimestamp, getWebSocketUrl, htmlToMarkdown, htmlToText, importThirdPartyFile, is, isArray, isBlob, isBoolean, isDate, isDef, isElement, isEmpty, isEmptyObj, isExpire, isExternal, isFunction, isInteger, isJson, isLocalhost, isMap, isNegative, isNull, isNullOrUnDef, isNumber, isNumberNoNaN, isObject, isPromise, isReferenceType, isRegExp, isScriptSafe, isSet, isString, isUnDef, isWindow, markdownToText, minus, objToOptions, plus, precision, processItemList, propsMerge, setInterval, setUrlMainSource, shouldRender, times, toFixed, transform, transforms, _default$9 as useAsyncQueue, _default$8 as useAutoRefresh, _default$7 as useCountDown, _default$6 as useCreateValtioContext, _default$5 as useDebounce, _default$4 as useDeepEffect, _default$a as useIframeRelayBridge, _default$3 as useRefState, _default$2 as useSyncInput, _default$1 as useThrottle, _default as useWebSocket };
|