@zero-library/common 2.3.12 → 2.4.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.
- 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 +72 -62
- package/dist/index.d.ts +72 -62
- 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
|
/**
|
|
@@ -353,6 +353,16 @@ interface CollectionConfig extends CollectionsProps {
|
|
|
353
353
|
*/
|
|
354
354
|
type ToolbarItem = 'undo-redo' | 'heading' | 'list' | 'block' | 'format' | 'script' | 'align';
|
|
355
355
|
|
|
356
|
+
/**
|
|
357
|
+
* 分页功能配置接口
|
|
358
|
+
*/
|
|
359
|
+
interface PageNoConfig {
|
|
360
|
+
/** 是否启用分页功能,默认为false */
|
|
361
|
+
enabled: boolean;
|
|
362
|
+
/** 页面滚动回调 */
|
|
363
|
+
onScrollPage?: (pageIndex: number) => void;
|
|
364
|
+
}
|
|
365
|
+
|
|
356
366
|
/**
|
|
357
367
|
* Markdown编辑器组件属性接口
|
|
358
368
|
*/
|
|
@@ -379,12 +389,7 @@ interface MarkdownEditorProps {
|
|
|
379
389
|
annotationConfig?: AnnotationConfig;
|
|
380
390
|
/** 摘录功能专属配置,不与批注混淆 */
|
|
381
391
|
collectionConfig?: CollectionConfig;
|
|
382
|
-
pageNoConfig?:
|
|
383
|
-
/** 是否启用分页功能,默认为false */
|
|
384
|
-
enabled: boolean;
|
|
385
|
-
/** 页面滚动回调 */
|
|
386
|
-
onScrollPage?: (pageIndex: number) => void;
|
|
387
|
-
};
|
|
392
|
+
pageNoConfig?: PageNoConfig;
|
|
388
393
|
}
|
|
389
394
|
/**
|
|
390
395
|
* Markdown编辑器组件
|
|
@@ -392,7 +397,7 @@ interface MarkdownEditorProps {
|
|
|
392
397
|
* 提供丰富的编辑功能:格式化、链接、图片、表格、高亮等
|
|
393
398
|
* @param props - 组件属性
|
|
394
399
|
*/
|
|
395
|
-
declare const _default$
|
|
400
|
+
declare const _default$f: ({ value, onChange, searchValue, disabled, extraNav, fixedToolbar, floatToolbar, onQuote, onDownloadFile, annotationConfig, collectionConfig, pageNoConfig }: MarkdownEditorProps) => react_jsx_runtime.JSX.Element;
|
|
396
401
|
|
|
397
402
|
interface Detection {
|
|
398
403
|
bbox: [number, number, number, number];
|
|
@@ -417,7 +422,7 @@ interface MarkDrawingProps {
|
|
|
417
422
|
* @param originalSize - 原始尺寸信息
|
|
418
423
|
* @param scopeRender - 可选的作用域渲染函数
|
|
419
424
|
*/
|
|
420
|
-
declare const _default$
|
|
425
|
+
declare const _default$e: ({ children, detections, originalSize, scopeRender }: MarkDrawingProps) => react_jsx_runtime.JSX.Element;
|
|
421
426
|
|
|
422
427
|
/**
|
|
423
428
|
* Markdown渲染组件属性接口
|
|
@@ -438,7 +443,7 @@ interface RenderMarkdownProps {
|
|
|
438
443
|
* 支持自定义组件、搜索高亮等功能
|
|
439
444
|
* @param RenderMarkdownProps - 组件属性
|
|
440
445
|
*/
|
|
441
|
-
declare const _default$
|
|
446
|
+
declare const _default$d: ({ content, searchValue, customComponents, ...rest }: RenderMarkdownProps) => react_jsx_runtime.JSX.Element;
|
|
442
447
|
|
|
443
448
|
/**
|
|
444
449
|
* 渲染控制对象类型
|
|
@@ -490,7 +495,7 @@ interface RenderWrapperProps<C, P> {
|
|
|
490
495
|
* @param props - 组件属性
|
|
491
496
|
* @returns 渲染的组件或null
|
|
492
497
|
*/
|
|
493
|
-
declare const _default$
|
|
498
|
+
declare const _default$c: react.ForwardRefExoticComponent<RenderWrapperProps<unknown, unknown> & react.RefAttributes<unknown>>;
|
|
494
499
|
|
|
495
500
|
/**
|
|
496
501
|
* 判断是否应该渲染组件
|
|
@@ -510,44 +515,6 @@ declare function propsMerge(control?: RenderControl<any, any> | null, props?: Ob
|
|
|
510
515
|
props: any;
|
|
511
516
|
};
|
|
512
517
|
|
|
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
518
|
/**
|
|
552
519
|
* 用户头像组件属性接口
|
|
553
520
|
*/
|
|
@@ -564,7 +531,7 @@ interface UserAvatarProps {
|
|
|
564
531
|
* 如果没有头像图片,则显示用户名首字母作为头像
|
|
565
532
|
* @param props - 组件属性
|
|
566
533
|
*/
|
|
567
|
-
declare const _default$
|
|
534
|
+
declare const _default$b: ({ size, avatarSrc, userName }: UserAvatarProps) => react_jsx_runtime.JSX.Element;
|
|
568
535
|
|
|
569
536
|
/**
|
|
570
537
|
* iframe 消息参数类型
|
|
@@ -621,11 +588,54 @@ type Handler<P = Params> = (params: P, source?: MessageEventSource | null, origi
|
|
|
621
588
|
* off('custom-event', handleMessage)
|
|
622
589
|
* ```
|
|
623
590
|
*/
|
|
624
|
-
declare const _default$
|
|
591
|
+
declare const _default$a: (allowedOrigins?: string[]) => {
|
|
625
592
|
on: (type: string, handler: Handler<Params>) => void;
|
|
626
593
|
off: (type: string, handler: Handler<Params>) => void;
|
|
627
594
|
};
|
|
628
595
|
|
|
596
|
+
/**
|
|
597
|
+
* 队列任务定义
|
|
598
|
+
* - func:任务函数(可同步/异步)
|
|
599
|
+
* - args:任务参数(透传给 func)
|
|
600
|
+
*/
|
|
601
|
+
type QueueTask = {
|
|
602
|
+
func: (...args: any[]) => Promise<void> | void;
|
|
603
|
+
args: any[];
|
|
604
|
+
};
|
|
605
|
+
/**
|
|
606
|
+
* 异步队列 Hook
|
|
607
|
+
* 用于按顺序串行执行一组异步任务(FIFO),避免并发导致的竞态问题。
|
|
608
|
+
*
|
|
609
|
+
* 设计目标:
|
|
610
|
+
* - 同一时刻只执行一个任务,后续任务自动排队
|
|
611
|
+
* - 支持暂停/恢复执行
|
|
612
|
+
* - 保持 API 简单,具体任务逻辑由调用方提供
|
|
613
|
+
* - 默认不丢任务:任务入队后会一直等待,直到执行完成或被清空
|
|
614
|
+
*
|
|
615
|
+
* @returns 队列控制方法与状态
|
|
616
|
+
* - addToQueue:入队一个任务
|
|
617
|
+
* - executeQueue:暂停/恢复队列的自动执行
|
|
618
|
+
* - clearQueue:清空等待中的任务(不影响当前正在执行的任务)
|
|
619
|
+
* - queueSize:当前等待队列长度(不含正在执行中的任务)
|
|
620
|
+
* - enabled:当前是否允许自动执行
|
|
621
|
+
* - running:当前是否正在执行任务
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* const { addToQueue, executeQueue } = useAsyncQueue()
|
|
625
|
+
* addToQueue(async (id) => await fetchById(id), '1')
|
|
626
|
+
* addToQueue(async () => await refresh())
|
|
627
|
+
* executeQueue(false) // 暂停执行(默认即为 true)
|
|
628
|
+
*
|
|
629
|
+
*/
|
|
630
|
+
declare const _default$9: () => {
|
|
631
|
+
addToQueue: (func: QueueTask["func"], ...args: QueueTask["args"]) => void;
|
|
632
|
+
executeQueue: (nextEnabled: boolean) => void;
|
|
633
|
+
clearQueue: () => void;
|
|
634
|
+
queueSize: number;
|
|
635
|
+
enabled: boolean;
|
|
636
|
+
running: boolean;
|
|
637
|
+
};
|
|
638
|
+
|
|
629
639
|
/**
|
|
630
640
|
* 通用的自动刷新 Hook
|
|
631
641
|
* 监听指定值的变化,当满足条件时自动触发回调函数
|
|
@@ -2489,4 +2499,4 @@ declare function createTokenManager({ key, storage }: TokenManagerProps): {
|
|
|
2489
2499
|
clear: () => void;
|
|
2490
2500
|
};
|
|
2491
2501
|
|
|
2492
|
-
export { type AnnotationConfig, type AnnotationType, _default$
|
|
2502
|
+
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
|
/**
|
|
@@ -353,6 +353,16 @@ interface CollectionConfig extends CollectionsProps {
|
|
|
353
353
|
*/
|
|
354
354
|
type ToolbarItem = 'undo-redo' | 'heading' | 'list' | 'block' | 'format' | 'script' | 'align';
|
|
355
355
|
|
|
356
|
+
/**
|
|
357
|
+
* 分页功能配置接口
|
|
358
|
+
*/
|
|
359
|
+
interface PageNoConfig {
|
|
360
|
+
/** 是否启用分页功能,默认为false */
|
|
361
|
+
enabled: boolean;
|
|
362
|
+
/** 页面滚动回调 */
|
|
363
|
+
onScrollPage?: (pageIndex: number) => void;
|
|
364
|
+
}
|
|
365
|
+
|
|
356
366
|
/**
|
|
357
367
|
* Markdown编辑器组件属性接口
|
|
358
368
|
*/
|
|
@@ -379,12 +389,7 @@ interface MarkdownEditorProps {
|
|
|
379
389
|
annotationConfig?: AnnotationConfig;
|
|
380
390
|
/** 摘录功能专属配置,不与批注混淆 */
|
|
381
391
|
collectionConfig?: CollectionConfig;
|
|
382
|
-
pageNoConfig?:
|
|
383
|
-
/** 是否启用分页功能,默认为false */
|
|
384
|
-
enabled: boolean;
|
|
385
|
-
/** 页面滚动回调 */
|
|
386
|
-
onScrollPage?: (pageIndex: number) => void;
|
|
387
|
-
};
|
|
392
|
+
pageNoConfig?: PageNoConfig;
|
|
388
393
|
}
|
|
389
394
|
/**
|
|
390
395
|
* Markdown编辑器组件
|
|
@@ -392,7 +397,7 @@ interface MarkdownEditorProps {
|
|
|
392
397
|
* 提供丰富的编辑功能:格式化、链接、图片、表格、高亮等
|
|
393
398
|
* @param props - 组件属性
|
|
394
399
|
*/
|
|
395
|
-
declare const _default$
|
|
400
|
+
declare const _default$f: ({ value, onChange, searchValue, disabled, extraNav, fixedToolbar, floatToolbar, onQuote, onDownloadFile, annotationConfig, collectionConfig, pageNoConfig }: MarkdownEditorProps) => react_jsx_runtime.JSX.Element;
|
|
396
401
|
|
|
397
402
|
interface Detection {
|
|
398
403
|
bbox: [number, number, number, number];
|
|
@@ -417,7 +422,7 @@ interface MarkDrawingProps {
|
|
|
417
422
|
* @param originalSize - 原始尺寸信息
|
|
418
423
|
* @param scopeRender - 可选的作用域渲染函数
|
|
419
424
|
*/
|
|
420
|
-
declare const _default$
|
|
425
|
+
declare const _default$e: ({ children, detections, originalSize, scopeRender }: MarkDrawingProps) => react_jsx_runtime.JSX.Element;
|
|
421
426
|
|
|
422
427
|
/**
|
|
423
428
|
* Markdown渲染组件属性接口
|
|
@@ -438,7 +443,7 @@ interface RenderMarkdownProps {
|
|
|
438
443
|
* 支持自定义组件、搜索高亮等功能
|
|
439
444
|
* @param RenderMarkdownProps - 组件属性
|
|
440
445
|
*/
|
|
441
|
-
declare const _default$
|
|
446
|
+
declare const _default$d: ({ content, searchValue, customComponents, ...rest }: RenderMarkdownProps) => react_jsx_runtime.JSX.Element;
|
|
442
447
|
|
|
443
448
|
/**
|
|
444
449
|
* 渲染控制对象类型
|
|
@@ -490,7 +495,7 @@ interface RenderWrapperProps<C, P> {
|
|
|
490
495
|
* @param props - 组件属性
|
|
491
496
|
* @returns 渲染的组件或null
|
|
492
497
|
*/
|
|
493
|
-
declare const _default$
|
|
498
|
+
declare const _default$c: react.ForwardRefExoticComponent<RenderWrapperProps<unknown, unknown> & react.RefAttributes<unknown>>;
|
|
494
499
|
|
|
495
500
|
/**
|
|
496
501
|
* 判断是否应该渲染组件
|
|
@@ -510,44 +515,6 @@ declare function propsMerge(control?: RenderControl<any, any> | null, props?: Ob
|
|
|
510
515
|
props: any;
|
|
511
516
|
};
|
|
512
517
|
|
|
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
518
|
/**
|
|
552
519
|
* 用户头像组件属性接口
|
|
553
520
|
*/
|
|
@@ -564,7 +531,7 @@ interface UserAvatarProps {
|
|
|
564
531
|
* 如果没有头像图片,则显示用户名首字母作为头像
|
|
565
532
|
* @param props - 组件属性
|
|
566
533
|
*/
|
|
567
|
-
declare const _default$
|
|
534
|
+
declare const _default$b: ({ size, avatarSrc, userName }: UserAvatarProps) => react_jsx_runtime.JSX.Element;
|
|
568
535
|
|
|
569
536
|
/**
|
|
570
537
|
* iframe 消息参数类型
|
|
@@ -621,11 +588,54 @@ type Handler<P = Params> = (params: P, source?: MessageEventSource | null, origi
|
|
|
621
588
|
* off('custom-event', handleMessage)
|
|
622
589
|
* ```
|
|
623
590
|
*/
|
|
624
|
-
declare const _default$
|
|
591
|
+
declare const _default$a: (allowedOrigins?: string[]) => {
|
|
625
592
|
on: (type: string, handler: Handler<Params>) => void;
|
|
626
593
|
off: (type: string, handler: Handler<Params>) => void;
|
|
627
594
|
};
|
|
628
595
|
|
|
596
|
+
/**
|
|
597
|
+
* 队列任务定义
|
|
598
|
+
* - func:任务函数(可同步/异步)
|
|
599
|
+
* - args:任务参数(透传给 func)
|
|
600
|
+
*/
|
|
601
|
+
type QueueTask = {
|
|
602
|
+
func: (...args: any[]) => Promise<void> | void;
|
|
603
|
+
args: any[];
|
|
604
|
+
};
|
|
605
|
+
/**
|
|
606
|
+
* 异步队列 Hook
|
|
607
|
+
* 用于按顺序串行执行一组异步任务(FIFO),避免并发导致的竞态问题。
|
|
608
|
+
*
|
|
609
|
+
* 设计目标:
|
|
610
|
+
* - 同一时刻只执行一个任务,后续任务自动排队
|
|
611
|
+
* - 支持暂停/恢复执行
|
|
612
|
+
* - 保持 API 简单,具体任务逻辑由调用方提供
|
|
613
|
+
* - 默认不丢任务:任务入队后会一直等待,直到执行完成或被清空
|
|
614
|
+
*
|
|
615
|
+
* @returns 队列控制方法与状态
|
|
616
|
+
* - addToQueue:入队一个任务
|
|
617
|
+
* - executeQueue:暂停/恢复队列的自动执行
|
|
618
|
+
* - clearQueue:清空等待中的任务(不影响当前正在执行的任务)
|
|
619
|
+
* - queueSize:当前等待队列长度(不含正在执行中的任务)
|
|
620
|
+
* - enabled:当前是否允许自动执行
|
|
621
|
+
* - running:当前是否正在执行任务
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* const { addToQueue, executeQueue } = useAsyncQueue()
|
|
625
|
+
* addToQueue(async (id) => await fetchById(id), '1')
|
|
626
|
+
* addToQueue(async () => await refresh())
|
|
627
|
+
* executeQueue(false) // 暂停执行(默认即为 true)
|
|
628
|
+
*
|
|
629
|
+
*/
|
|
630
|
+
declare const _default$9: () => {
|
|
631
|
+
addToQueue: (func: QueueTask["func"], ...args: QueueTask["args"]) => void;
|
|
632
|
+
executeQueue: (nextEnabled: boolean) => void;
|
|
633
|
+
clearQueue: () => void;
|
|
634
|
+
queueSize: number;
|
|
635
|
+
enabled: boolean;
|
|
636
|
+
running: boolean;
|
|
637
|
+
};
|
|
638
|
+
|
|
629
639
|
/**
|
|
630
640
|
* 通用的自动刷新 Hook
|
|
631
641
|
* 监听指定值的变化,当满足条件时自动触发回调函数
|
|
@@ -2489,4 +2499,4 @@ declare function createTokenManager({ key, storage }: TokenManagerProps): {
|
|
|
2489
2499
|
clear: () => void;
|
|
2490
2500
|
};
|
|
2491
2501
|
|
|
2492
|
-
export { type AnnotationConfig, type AnnotationType, _default$
|
|
2502
|
+
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 };
|