@zero-library/common 2.1.0 → 2.1.2
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.cjs.js +10 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.esm.js +11 -12
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -124,7 +124,7 @@ interface RenderWrapperProps<C, P> {
|
|
|
124
124
|
ctx?: C;
|
|
125
125
|
DefaultComponent?: React.ReactNode | ((props: P) => React.ReactNode);
|
|
126
126
|
}
|
|
127
|
-
declare
|
|
127
|
+
declare const RenderWrapper: react.ForwardRefExoticComponent<RenderWrapperProps<unknown, unknown> & react.RefAttributes<unknown>>;
|
|
128
128
|
declare const shouldRender: (control?: RenderControl<any, any> | null) => boolean;
|
|
129
129
|
declare function propsMerge(control?: RenderControl<any, any> | null, props?: ObjectType<any>): {
|
|
130
130
|
props: any;
|
|
@@ -347,7 +347,6 @@ declare const isInteger: (num: Decimal.Value) => boolean;
|
|
|
347
347
|
declare const isNegative: (num: Decimal.Value) => boolean;
|
|
348
348
|
|
|
349
349
|
declare const OK = 200;
|
|
350
|
-
declare const OK2 = "S0000";
|
|
351
350
|
declare const ERROR = 500;
|
|
352
351
|
declare const MISSING_PARAMETER = 400;
|
|
353
352
|
declare const UNAUTHORIZED = 401;
|
|
@@ -382,4 +381,4 @@ declare function getSignPath(): string;
|
|
|
382
381
|
declare const LgPrimaryColor: string;
|
|
383
382
|
declare const themeConfig: ThemeConfig;
|
|
384
383
|
|
|
385
|
-
export { _default$c as AudioPlayer, DateFormatType, DateFormatType2, ERROR, FORBIDDEN, FacePastCode, _default$b as FileIcon, _default$a as FilePreview, _default$9 as FilePreviewDrawer, ILLEGAL_PARAMETER, _default$5 as Iframe, _default$4 as LazyComponent, LgPrimaryColor, LoginPastCode, MISSING_PARAMETER, _default$3 as MarkdownEditor, _default$8 as MarkdownPreview, NOT_FOUND, type NsSetIntervalReturnType, OK,
|
|
384
|
+
export { _default$c as AudioPlayer, DateFormatType, DateFormatType2, ERROR, FORBIDDEN, FacePastCode, _default$b as FileIcon, _default$a as FilePreview, _default$9 as FilePreviewDrawer, ILLEGAL_PARAMETER, _default$5 as Iframe, _default$4 as LazyComponent, LgPrimaryColor, LoginPastCode, MISSING_PARAMETER, _default$3 as MarkdownEditor, _default$8 as MarkdownPreview, NOT_FOUND, type NsSetIntervalReturnType, OK, PERMISSION_DENIED, type Params, _default$7 as PdfPreview, type RenderControl, type RenderControlObj, _default$2 as RenderMarkdown, RenderWrapper, TOKEN_KEY, UNAUTHORIZED, _default$1 as UserAvatar, type UserInfo, _default$6 as VideoPlayer, absVal, addUrlLastSlash, arrToObj, buildUrlParams, calculate, clearCurrentUser, clearToken, compareNum, copyText, decimalPlaces, deepCopy, deepEqual, deepMerge, dividedBy, downloadFile, emit, emitToChild, formType, formatDate, formatNumberWithCommas, genNonDuplicateID, generateRandomNumbers, getCurrentUser, getDeviceId, getEndOfTimestamp, getFileName, getFileSuffixName, getSignPath, getStartOfTimestamp, getTimestamp, getToken, getUrlMainSource, getUrlToken, getWebSocketUrl, is, isArray, isBlob, isBoolean, isClient, isDate, isDef, isElement, isEmpty, isEmptyObj, isExpire, isExternal, isFunction, isInteger, isLocalhost, isMap, isNegative, isNull, isNullOrUnDef, isNumber, isNumberNoNaN, isObject, isPromise, isRegExp, isServer, isString, isUnDef, isWindow, jsonType, minus, nsSetInterval, objToOptions, plus, precision, propsMerge, _default as request, setCurrentUser, setToken, shouldRender, textAreaView, themeConfig, times, toFixed, useCreateValtioContext, useDebounce, useDeepEffect, useIframeRelayBridge, useRefState, useSyncInput, useThrottle, useWebSocket };
|
package/dist/index.d.ts
CHANGED
|
@@ -124,7 +124,7 @@ interface RenderWrapperProps<C, P> {
|
|
|
124
124
|
ctx?: C;
|
|
125
125
|
DefaultComponent?: React.ReactNode | ((props: P) => React.ReactNode);
|
|
126
126
|
}
|
|
127
|
-
declare
|
|
127
|
+
declare const RenderWrapper: react.ForwardRefExoticComponent<RenderWrapperProps<unknown, unknown> & react.RefAttributes<unknown>>;
|
|
128
128
|
declare const shouldRender: (control?: RenderControl<any, any> | null) => boolean;
|
|
129
129
|
declare function propsMerge(control?: RenderControl<any, any> | null, props?: ObjectType<any>): {
|
|
130
130
|
props: any;
|
|
@@ -347,7 +347,6 @@ declare const isInteger: (num: Decimal.Value) => boolean;
|
|
|
347
347
|
declare const isNegative: (num: Decimal.Value) => boolean;
|
|
348
348
|
|
|
349
349
|
declare const OK = 200;
|
|
350
|
-
declare const OK2 = "S0000";
|
|
351
350
|
declare const ERROR = 500;
|
|
352
351
|
declare const MISSING_PARAMETER = 400;
|
|
353
352
|
declare const UNAUTHORIZED = 401;
|
|
@@ -382,4 +381,4 @@ declare function getSignPath(): string;
|
|
|
382
381
|
declare const LgPrimaryColor: string;
|
|
383
382
|
declare const themeConfig: ThemeConfig;
|
|
384
383
|
|
|
385
|
-
export { _default$c as AudioPlayer, DateFormatType, DateFormatType2, ERROR, FORBIDDEN, FacePastCode, _default$b as FileIcon, _default$a as FilePreview, _default$9 as FilePreviewDrawer, ILLEGAL_PARAMETER, _default$5 as Iframe, _default$4 as LazyComponent, LgPrimaryColor, LoginPastCode, MISSING_PARAMETER, _default$3 as MarkdownEditor, _default$8 as MarkdownPreview, NOT_FOUND, type NsSetIntervalReturnType, OK,
|
|
384
|
+
export { _default$c as AudioPlayer, DateFormatType, DateFormatType2, ERROR, FORBIDDEN, FacePastCode, _default$b as FileIcon, _default$a as FilePreview, _default$9 as FilePreviewDrawer, ILLEGAL_PARAMETER, _default$5 as Iframe, _default$4 as LazyComponent, LgPrimaryColor, LoginPastCode, MISSING_PARAMETER, _default$3 as MarkdownEditor, _default$8 as MarkdownPreview, NOT_FOUND, type NsSetIntervalReturnType, OK, PERMISSION_DENIED, type Params, _default$7 as PdfPreview, type RenderControl, type RenderControlObj, _default$2 as RenderMarkdown, RenderWrapper, TOKEN_KEY, UNAUTHORIZED, _default$1 as UserAvatar, type UserInfo, _default$6 as VideoPlayer, absVal, addUrlLastSlash, arrToObj, buildUrlParams, calculate, clearCurrentUser, clearToken, compareNum, copyText, decimalPlaces, deepCopy, deepEqual, deepMerge, dividedBy, downloadFile, emit, emitToChild, formType, formatDate, formatNumberWithCommas, genNonDuplicateID, generateRandomNumbers, getCurrentUser, getDeviceId, getEndOfTimestamp, getFileName, getFileSuffixName, getSignPath, getStartOfTimestamp, getTimestamp, getToken, getUrlMainSource, getUrlToken, getWebSocketUrl, is, isArray, isBlob, isBoolean, isClient, isDate, isDef, isElement, isEmpty, isEmptyObj, isExpire, isExternal, isFunction, isInteger, isLocalhost, isMap, isNegative, isNull, isNullOrUnDef, isNumber, isNumberNoNaN, isObject, isPromise, isRegExp, isServer, isString, isUnDef, isWindow, jsonType, minus, nsSetInterval, objToOptions, plus, precision, propsMerge, _default as request, setCurrentUser, setToken, shouldRender, textAreaView, themeConfig, times, toFixed, useCreateValtioContext, useDebounce, useDeepEffect, useIframeRelayBridge, useRefState, useSyncInput, useThrottle, useWebSocket };
|
package/dist/index.esm.js
CHANGED
|
@@ -950,7 +950,6 @@ function getSignPath() {
|
|
|
950
950
|
|
|
951
951
|
// src/utils/request.ts
|
|
952
952
|
var OK = 200;
|
|
953
|
-
var OK2 = "S0000";
|
|
954
953
|
var ERROR = 500;
|
|
955
954
|
var MISSING_PARAMETER = 400;
|
|
956
955
|
var UNAUTHORIZED = 401;
|
|
@@ -990,7 +989,7 @@ axios.interceptors.response.use(
|
|
|
990
989
|
if (isBlob(response.data)) {
|
|
991
990
|
return response;
|
|
992
991
|
}
|
|
993
|
-
if (response.data?.code !== OK
|
|
992
|
+
if (response.data?.code !== OK) {
|
|
994
993
|
const isPermission = response.data?.code === PERMISSION_DENIED;
|
|
995
994
|
if (response.config?.showError !== false) {
|
|
996
995
|
showMessage({
|
|
@@ -1313,7 +1312,7 @@ var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumb
|
|
|
1313
1312
|
}, 500);
|
|
1314
1313
|
onSetPageNo?.(currentPage + 1);
|
|
1315
1314
|
}, [currentPage]);
|
|
1316
|
-
return /* @__PURE__ */ jsx("div", { ref: embedRef, className: styles_module_default.nsPreviewPdf, children: /* @__PURE__ */ jsx(Worker, { workerUrl:
|
|
1315
|
+
return /* @__PURE__ */ jsx("div", { ref: embedRef, className: styles_module_default.nsPreviewPdf, children: /* @__PURE__ */ jsx(Worker, { workerUrl: `logosdata.cn/public/pdf/pdf.worker.min.js`, children: /* @__PURE__ */ jsxs(Splitter, { onResize: setSizes, children: [
|
|
1317
1316
|
isHasThumbnails && /* @__PURE__ */ jsx(Splitter.Panel, { resizable: false, size: sizes[0], min: 250, max: 500, collapsible: true, children: /* @__PURE__ */ jsx(Thumbnails, {}) }),
|
|
1318
1317
|
/* @__PURE__ */ jsx(Splitter.Panel, { children: /* @__PURE__ */ jsxs("div", { className: "height-full", children: [
|
|
1319
1318
|
/* @__PURE__ */ jsx(
|
|
@@ -1334,13 +1333,13 @@ var PdfPreview_default = ({ password, fileUrl, pageNo = 1, scale = 1, isHasThumb
|
|
|
1334
1333
|
// 启用 CMap 支持,解决中文字体显示问题
|
|
1335
1334
|
// cMapUrl: 指定 CMap 文件的 URL,用于处理非拉丁字符(如中文)
|
|
1336
1335
|
// cMapPacked: 使用压缩的 CMap 文件以提高性能
|
|
1337
|
-
cMapUrl: "/
|
|
1336
|
+
cMapUrl: "logosdata.cn/public/pdf/pdfjs-dist@3.2.146/cmaps/",
|
|
1338
1337
|
// 使用可用的源
|
|
1339
1338
|
cMapPacked: true,
|
|
1340
1339
|
// 禁用字体子集化,确保完整字体加载
|
|
1341
1340
|
disableFontFace: false,
|
|
1342
1341
|
// 启用标准字体支持
|
|
1343
|
-
standardFontDataUrl: "/
|
|
1342
|
+
standardFontDataUrl: "logosdata.cn/public/pdf/pdfjs-dist@3.2.146/standard_fonts/",
|
|
1344
1343
|
// 设置字体回退策略
|
|
1345
1344
|
fallbackFontName: "Helvetica"
|
|
1346
1345
|
});
|
|
@@ -5184,22 +5183,22 @@ var MarkdownEditor_default = ({ value = "", onChange, onScrollPage, searchValue,
|
|
|
5184
5183
|
function isRenderFn(node) {
|
|
5185
5184
|
return isFunction(node) || isObject(node) && !isNull(node) && "$$typeof" in node && node.$$typeof === Symbol.for("react.forward_ref");
|
|
5186
5185
|
}
|
|
5187
|
-
function renderDefault(DefaultComponent, props) {
|
|
5186
|
+
function renderDefault(DefaultComponent, ref, props) {
|
|
5188
5187
|
if (!DefaultComponent) return null;
|
|
5189
|
-
return isRenderFn(DefaultComponent) ? /* @__PURE__ */ jsx(DefaultComponent, { ...props }) : DefaultComponent;
|
|
5188
|
+
return isRenderFn(DefaultComponent) ? /* @__PURE__ */ jsx(DefaultComponent, { ref, ...props }) : DefaultComponent;
|
|
5190
5189
|
}
|
|
5191
|
-
|
|
5190
|
+
var RenderWrapper = forwardRef(function RenderWrapper2({ control = true, ctx, DefaultComponent }, ref) {
|
|
5192
5191
|
if (control === false || isNull(control)) return null;
|
|
5193
5192
|
if (control === true || control === void 0) {
|
|
5194
|
-
return renderDefault(DefaultComponent);
|
|
5193
|
+
return renderDefault(DefaultComponent, ref);
|
|
5195
5194
|
}
|
|
5196
5195
|
const { visible = true, render, props } = control;
|
|
5197
5196
|
if (!visible) return null;
|
|
5198
5197
|
if (render) {
|
|
5199
5198
|
return typeof render === "function" ? render(ctx) : render;
|
|
5200
5199
|
}
|
|
5201
|
-
return renderDefault(DefaultComponent, props);
|
|
5202
|
-
}
|
|
5200
|
+
return renderDefault(DefaultComponent, ref, props);
|
|
5201
|
+
});
|
|
5203
5202
|
var shouldRender = (control) => control != null && (isBoolean(control) ? control : control?.visible !== false);
|
|
5204
5203
|
function propsMerge(control, props) {
|
|
5205
5204
|
if (control === true || control === void 0) {
|
|
@@ -5221,6 +5220,6 @@ var UserAvatar_default = ({ size, avatarSrc, userName }) => {
|
|
|
5221
5220
|
return avatarSrc ? /* @__PURE__ */ jsx(Avatar, { size, src: avatarSrc }) : /* @__PURE__ */ jsx(Avatar, { size, className: "cursor-pointer", style: { backgroundColor: LgPrimaryColor }, children: userName?.slice(0, 1)?.toLocaleUpperCase() });
|
|
5222
5221
|
};
|
|
5223
5222
|
|
|
5224
|
-
export { AudioPlayer_default as AudioPlayer, DateFormatType, DateFormatType2, ERROR, FORBIDDEN, FacePastCode, FileIcon_default as FileIcon, FilePreview_default as FilePreview, FilePreviewDrawer_default as FilePreviewDrawer, ILLEGAL_PARAMETER, Iframe_default as Iframe, LazyComponent_default as LazyComponent, LgPrimaryColor, LoginPastCode, MISSING_PARAMETER, MarkdownEditor_default as MarkdownEditor, MarkdownPreview_default as MarkdownPreview, NOT_FOUND, OK,
|
|
5223
|
+
export { AudioPlayer_default as AudioPlayer, DateFormatType, DateFormatType2, ERROR, FORBIDDEN, FacePastCode, FileIcon_default as FileIcon, FilePreview_default as FilePreview, FilePreviewDrawer_default as FilePreviewDrawer, ILLEGAL_PARAMETER, Iframe_default as Iframe, LazyComponent_default as LazyComponent, LgPrimaryColor, LoginPastCode, MISSING_PARAMETER, MarkdownEditor_default as MarkdownEditor, MarkdownPreview_default as MarkdownPreview, NOT_FOUND, OK, PERMISSION_DENIED, PdfPreview_default as PdfPreview, RenderMarkdown_default as RenderMarkdown, RenderWrapper, TOKEN_KEY, UNAUTHORIZED, UserAvatar_default as UserAvatar, VideoPlayer_default as VideoPlayer, absVal, addUrlLastSlash, arrToObj, buildUrlParams, calculate, clearCurrentUser, clearToken, compareNum, copyText, decimalPlaces, deepCopy, deepEqual, deepMerge, dividedBy, downloadFile, emit, emitToChild, formType, formatDate, formatNumberWithCommas, genNonDuplicateID, generateRandomNumbers, getCurrentUser, getDeviceId, getEndOfTimestamp, getFileName, getFileSuffixName, getSignPath, getStartOfTimestamp, getTimestamp, getToken, getUrlMainSource, getUrlToken, getWebSocketUrl, is, isArray, isBlob, isBoolean, isClient, isDate, isDef, isElement, isEmpty, isEmptyObj, isExpire, isExternal, isFunction, isInteger, isLocalhost, isMap, isNegative, isNull, isNullOrUnDef, isNumber, isNumberNoNaN, isObject, isPromise, isRegExp, isServer, isString, isUnDef, isWindow, jsonType, minus, nsSetInterval, objToOptions, plus, precision, propsMerge, request_default as request, setCurrentUser, setToken, shouldRender, textAreaView, themeConfig, times, toFixed, useCreateValtioContext, useDebounce, useDeepEffect, useIframeRelayBridge, useRefState, useSyncInput, useThrottle, useWebSocket_default as useWebSocket };
|
|
5225
5224
|
//# sourceMappingURL=index.esm.js.map
|
|
5226
5225
|
//# sourceMappingURL=index.esm.js.map
|