@zero-library/common 2.3.0 → 2.3.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/dist/index.d.mts CHANGED
@@ -85,10 +85,8 @@ interface FilePreviewProps {
85
85
  /** 页码变化回调 */
86
86
  onSetPageNo?: (pageNo: number) => void;
87
87
  };
88
- /** 文件参数 */
89
- fileParams?: ObjectType<string>;
90
88
  /** 密码设置成功回调 */
91
- onSetPassword?: () => void;
89
+ onSetPassword?: (password: string) => void;
92
90
  }
93
91
  /**
94
92
  * 文件预览组件
@@ -254,6 +252,7 @@ interface LazyComponentProps {
254
252
  */
255
253
  declare const _default$h: ({ type, customComponents, unknownContent, ...rest }: LazyComponentProps) => string | number | true | react_jsx_runtime.JSX.Element | Iterable<react.ReactNode>;
256
254
 
255
+ declare const ANNOTATION_ATTRS: readonly ["annotation-id", "user-name", "user-id", "update-time", "content"];
257
256
  /**
258
257
  * 批注功能配置
259
258
  */
@@ -272,22 +271,18 @@ interface AnnotationsProps {
272
271
  /** 受控属性:批注列表可见性改变回调 */
273
272
  onVisibleChange?: (visible: boolean) => void;
274
273
  }
275
-
276
- declare module "@tiptap/core" {
277
- interface Commands<ReturnType> {
278
- annotation: {
279
- selectAnnotation: (id: string) => any;
280
- moveCursorToAnnotation: (id: string) => any;
281
- };
282
- }
283
- }
284
-
285
274
  /**
286
275
  * 批注功能配置接口
287
276
  */
288
277
  interface AnnotationConfig extends AnnotationsProps {
289
278
  getContainer?: () => HTMLElement | null;
290
279
  }
280
+ type AnnotationType = {
281
+ from: number;
282
+ to: number;
283
+ } & {
284
+ [key in (typeof ANNOTATION_ATTRS)[number]]: string;
285
+ };
291
286
 
292
287
  declare const COLLECTION_ATTRS: readonly ["collection-id", "user-name", "user-id", "update-time", "page-no"];
293
288
  type CollectionType = {
@@ -336,7 +331,6 @@ interface CollectionsProps {
336
331
  onDelete: () => void;
337
332
  }) => React.ReactNode;
338
333
  }
339
-
340
334
  /**
341
335
  * 收录功能配置接口
342
336
  */
@@ -2475,4 +2469,4 @@ declare function createTokenManager({ key, storage }: TokenManagerProps): {
2475
2469
  clear: () => void;
2476
2470
  };
2477
2471
 
2478
- export { _default$r as AudioPlayer, type AudioPlayerProps, BusinessCode, type CacheMessage, type ComponentMapType, DEFAULT_DATE_FORMAT, DEFAULT_DATE_TIME_FORMAT, DEFAULT_YEAR_MONTH_DAY_FORMAT, DEFAULT_YEAR_MONTH_FORMAT, _default$q as DocxPreview, type DocxPreviewProps, _default$p as FileIcon, type FileIconProps, _default$o as FilePreview, _default$n as FilePreviewDrawer, type FilePreviewDrawerProps, type FilePreviewProps, type FindTreeNodesOptions, type FormatSizeOptions, HttpStatus, _default$i as Iframe, type IframeProps, _default$h as LazyComponent, type LazyComponentProps, _default$f as MarkDrawing, _default$g as MarkdownEditor, type MarkdownEditorProps, _default$m as MarkdownPreview, type MarkdownPreviewProps, MultiEmailValidator, _default$l as PdfImagePreview, type PdfImagePreviewProps, _default$k as PdfPreview, type PdfPreviewProps, PhoneOrMobileValidator, RegBankCardNo, RegDetailAddress, RegEmail, RegFixedTelePhone, RegIdentityCardNo, RegMobile, RegNumNo, RegPassword, RegSmsCode, RegTaxNo, RegTelePhone, type RenderControl, _default$e as RenderMarkdown, type RenderMarkdownProps, _default$d as RenderWrapper, type RenderWrapperProps, type RequestConfig, type SecureManagerProps, type SetIntervalType, type SizeUnit, _default$b as SpeechButton, type SpeechPermission, type SpeechProps, ThanNumLengthValidator, ThanNumValidator, type TokenManagerProps, _default$a as UserAvatar, type UserAvatarProps, _default$j 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$8 as useAutoRefresh, _default$7 as useCountDown, _default$6 as useCreateValtioContext, _default$5 as useDebounce, _default$4 as useDeepEffect, _default$9 as useIframeRelayBridge, _default$3 as useRefState, _default$c as useSpeech, _default$2 as useSyncInput, _default$1 as useThrottle, _default as useWebSocket };
2472
+ export { type AnnotationConfig, type AnnotationType, _default$r 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$q as DocxPreview, type DocxPreviewProps, _default$p as FileIcon, type FileIconProps, _default$o as FilePreview, _default$n as FilePreviewDrawer, type FilePreviewDrawerProps, type FilePreviewProps, type FindTreeNodesOptions, type FormatSizeOptions, HttpStatus, _default$i as Iframe, type IframeProps, _default$h as LazyComponent, type LazyComponentProps, _default$f as MarkDrawing, _default$g as MarkdownEditor, type MarkdownEditorProps, _default$m as MarkdownPreview, type MarkdownPreviewProps, MultiEmailValidator, _default$l as PdfImagePreview, type PdfImagePreviewProps, _default$k as PdfPreview, type PdfPreviewProps, PhoneOrMobileValidator, RegBankCardNo, RegDetailAddress, RegEmail, RegFixedTelePhone, RegIdentityCardNo, RegMobile, RegNumNo, RegPassword, RegSmsCode, RegTaxNo, RegTelePhone, type RenderControl, _default$e as RenderMarkdown, type RenderMarkdownProps, _default$d as RenderWrapper, type RenderWrapperProps, type RequestConfig, type SecureManagerProps, type SetIntervalType, type SizeUnit, _default$b as SpeechButton, type SpeechPermission, type SpeechProps, ThanNumLengthValidator, ThanNumValidator, type TokenManagerProps, _default$a as UserAvatar, type UserAvatarProps, _default$j 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$8 as useAutoRefresh, _default$7 as useCountDown, _default$6 as useCreateValtioContext, _default$5 as useDebounce, _default$4 as useDeepEffect, _default$9 as useIframeRelayBridge, _default$3 as useRefState, _default$c as useSpeech, _default$2 as useSyncInput, _default$1 as useThrottle, _default as useWebSocket };
package/dist/index.d.ts CHANGED
@@ -85,10 +85,8 @@ interface FilePreviewProps {
85
85
  /** 页码变化回调 */
86
86
  onSetPageNo?: (pageNo: number) => void;
87
87
  };
88
- /** 文件参数 */
89
- fileParams?: ObjectType<string>;
90
88
  /** 密码设置成功回调 */
91
- onSetPassword?: () => void;
89
+ onSetPassword?: (password: string) => void;
92
90
  }
93
91
  /**
94
92
  * 文件预览组件
@@ -254,6 +252,7 @@ interface LazyComponentProps {
254
252
  */
255
253
  declare const _default$h: ({ type, customComponents, unknownContent, ...rest }: LazyComponentProps) => string | number | true | react_jsx_runtime.JSX.Element | Iterable<react.ReactNode>;
256
254
 
255
+ declare const ANNOTATION_ATTRS: readonly ["annotation-id", "user-name", "user-id", "update-time", "content"];
257
256
  /**
258
257
  * 批注功能配置
259
258
  */
@@ -272,22 +271,18 @@ interface AnnotationsProps {
272
271
  /** 受控属性:批注列表可见性改变回调 */
273
272
  onVisibleChange?: (visible: boolean) => void;
274
273
  }
275
-
276
- declare module "@tiptap/core" {
277
- interface Commands<ReturnType> {
278
- annotation: {
279
- selectAnnotation: (id: string) => any;
280
- moveCursorToAnnotation: (id: string) => any;
281
- };
282
- }
283
- }
284
-
285
274
  /**
286
275
  * 批注功能配置接口
287
276
  */
288
277
  interface AnnotationConfig extends AnnotationsProps {
289
278
  getContainer?: () => HTMLElement | null;
290
279
  }
280
+ type AnnotationType = {
281
+ from: number;
282
+ to: number;
283
+ } & {
284
+ [key in (typeof ANNOTATION_ATTRS)[number]]: string;
285
+ };
291
286
 
292
287
  declare const COLLECTION_ATTRS: readonly ["collection-id", "user-name", "user-id", "update-time", "page-no"];
293
288
  type CollectionType = {
@@ -336,7 +331,6 @@ interface CollectionsProps {
336
331
  onDelete: () => void;
337
332
  }) => React.ReactNode;
338
333
  }
339
-
340
334
  /**
341
335
  * 收录功能配置接口
342
336
  */
@@ -2475,4 +2469,4 @@ declare function createTokenManager({ key, storage }: TokenManagerProps): {
2475
2469
  clear: () => void;
2476
2470
  };
2477
2471
 
2478
- export { _default$r as AudioPlayer, type AudioPlayerProps, BusinessCode, type CacheMessage, type ComponentMapType, DEFAULT_DATE_FORMAT, DEFAULT_DATE_TIME_FORMAT, DEFAULT_YEAR_MONTH_DAY_FORMAT, DEFAULT_YEAR_MONTH_FORMAT, _default$q as DocxPreview, type DocxPreviewProps, _default$p as FileIcon, type FileIconProps, _default$o as FilePreview, _default$n as FilePreviewDrawer, type FilePreviewDrawerProps, type FilePreviewProps, type FindTreeNodesOptions, type FormatSizeOptions, HttpStatus, _default$i as Iframe, type IframeProps, _default$h as LazyComponent, type LazyComponentProps, _default$f as MarkDrawing, _default$g as MarkdownEditor, type MarkdownEditorProps, _default$m as MarkdownPreview, type MarkdownPreviewProps, MultiEmailValidator, _default$l as PdfImagePreview, type PdfImagePreviewProps, _default$k as PdfPreview, type PdfPreviewProps, PhoneOrMobileValidator, RegBankCardNo, RegDetailAddress, RegEmail, RegFixedTelePhone, RegIdentityCardNo, RegMobile, RegNumNo, RegPassword, RegSmsCode, RegTaxNo, RegTelePhone, type RenderControl, _default$e as RenderMarkdown, type RenderMarkdownProps, _default$d as RenderWrapper, type RenderWrapperProps, type RequestConfig, type SecureManagerProps, type SetIntervalType, type SizeUnit, _default$b as SpeechButton, type SpeechPermission, type SpeechProps, ThanNumLengthValidator, ThanNumValidator, type TokenManagerProps, _default$a as UserAvatar, type UserAvatarProps, _default$j 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$8 as useAutoRefresh, _default$7 as useCountDown, _default$6 as useCreateValtioContext, _default$5 as useDebounce, _default$4 as useDeepEffect, _default$9 as useIframeRelayBridge, _default$3 as useRefState, _default$c as useSpeech, _default$2 as useSyncInput, _default$1 as useThrottle, _default as useWebSocket };
2472
+ export { type AnnotationConfig, type AnnotationType, _default$r 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$q as DocxPreview, type DocxPreviewProps, _default$p as FileIcon, type FileIconProps, _default$o as FilePreview, _default$n as FilePreviewDrawer, type FilePreviewDrawerProps, type FilePreviewProps, type FindTreeNodesOptions, type FormatSizeOptions, HttpStatus, _default$i as Iframe, type IframeProps, _default$h as LazyComponent, type LazyComponentProps, _default$f as MarkDrawing, _default$g as MarkdownEditor, type MarkdownEditorProps, _default$m as MarkdownPreview, type MarkdownPreviewProps, MultiEmailValidator, _default$l as PdfImagePreview, type PdfImagePreviewProps, _default$k as PdfPreview, type PdfPreviewProps, PhoneOrMobileValidator, RegBankCardNo, RegDetailAddress, RegEmail, RegFixedTelePhone, RegIdentityCardNo, RegMobile, RegNumNo, RegPassword, RegSmsCode, RegTaxNo, RegTelePhone, type RenderControl, _default$e as RenderMarkdown, type RenderMarkdownProps, _default$d as RenderWrapper, type RenderWrapperProps, type RequestConfig, type SecureManagerProps, type SetIntervalType, type SizeUnit, _default$b as SpeechButton, type SpeechPermission, type SpeechProps, ThanNumLengthValidator, ThanNumValidator, type TokenManagerProps, _default$a as UserAvatar, type UserAvatarProps, _default$j 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$8 as useAutoRefresh, _default$7 as useCountDown, _default$6 as useCreateValtioContext, _default$5 as useDebounce, _default$4 as useDeepEffect, _default$9 as useIframeRelayBridge, _default$3 as useRefState, _default$c as useSpeech, _default$2 as useSyncInput, _default$1 as useThrottle, _default as useWebSocket };