@eternalheart/react-file-preview 1.2.0 → 1.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/README.md +67 -2
- package/README.zh-CN.md +67 -2
- package/lib/FilePreviewContent.d.ts +7 -0
- package/lib/FilePreviewContent.d.ts.map +1 -1
- package/lib/FilePreviewEmbed.d.ts +5 -0
- package/lib/FilePreviewEmbed.d.ts.map +1 -1
- package/lib/FilePreviewModal.d.ts +5 -0
- package/lib/FilePreviewModal.d.ts.map +1 -1
- package/lib/components/ResizableSplit.d.ts +29 -0
- package/lib/components/ResizableSplit.d.ts.map +1 -0
- package/lib/i18n/LocaleContext.d.ts +25 -0
- package/lib/i18n/LocaleContext.d.ts.map +1 -0
- package/lib/index.cjs +246 -53
- package/lib/index.cjs.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.mjs +27591 -32868
- package/lib/index.mjs.map +1 -1
- package/lib/renderers/Audio/index.d.ts.map +1 -1
- package/lib/renderers/Csv/index.d.ts +7 -0
- package/lib/renderers/Csv/index.d.ts.map +1 -0
- package/lib/renderers/Docx/index.d.ts.map +1 -1
- package/lib/renderers/Epub/index.d.ts +2 -2
- package/lib/renderers/Epub/index.d.ts.map +1 -1
- package/lib/renderers/Epub/toolbar.d.ts +2 -0
- package/lib/renderers/Epub/toolbar.d.ts.map +1 -1
- package/lib/renderers/Image/index.d.ts.map +1 -1
- package/lib/renderers/Image/toolbar.d.ts +2 -0
- package/lib/renderers/Image/toolbar.d.ts.map +1 -1
- package/lib/renderers/Json/index.d.ts.map +1 -1
- package/lib/renderers/Markdown/index.d.ts.map +1 -1
- package/lib/renderers/Mobi/index.d.ts +15 -0
- package/lib/renderers/Mobi/index.d.ts.map +1 -0
- package/lib/renderers/Mobi/toolbar.d.ts +13 -0
- package/lib/renderers/Mobi/toolbar.d.ts.map +1 -0
- package/lib/renderers/Msg/index.d.ts.map +1 -1
- package/lib/renderers/Pdf/index.d.ts.map +1 -1
- package/lib/renderers/Pdf/toolbar.d.ts +2 -0
- package/lib/renderers/Pdf/toolbar.d.ts.map +1 -1
- package/lib/renderers/Pptx/index.d.ts.map +1 -1
- package/lib/renderers/Subtitle/index.d.ts +7 -0
- package/lib/renderers/Subtitle/index.d.ts.map +1 -0
- package/lib/renderers/Text/index.d.ts +2 -0
- package/lib/renderers/Text/index.d.ts.map +1 -1
- package/lib/renderers/Text/toolbar.d.ts +12 -0
- package/lib/renderers/Text/toolbar.d.ts.map +1 -0
- package/lib/renderers/Unsupported/index.d.ts.map +1 -1
- package/lib/renderers/Video/index.d.ts.map +1 -1
- package/lib/renderers/Xlsx/index.d.ts.map +1 -1
- package/lib/renderers/Xml/index.d.ts +7 -0
- package/lib/renderers/Xml/index.d.ts.map +1 -0
- package/lib/renderers/Zip/index.d.ts +12 -0
- package/lib/renderers/Zip/index.d.ts.map +1 -0
- package/lib/renderers/Zip/toolbar.d.ts +13 -0
- package/lib/renderers/Zip/toolbar.d.ts.map +1 -0
- package/package.json +5 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Audio/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Audio/index.tsx"],"names":[],"mappings":"AAoJA,UAAU,kBAAkB;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA6VtD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Csv/index.tsx"],"names":[],"mappings":"AAKA,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAwGlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Docx/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Docx/index.tsx"],"names":[],"mappings":"AAIA,UAAU,iBAAiB;IACzB,GAAG,EAAE,MAAM,CAAC;CACb;AAeD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAyIpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Epub/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Epub/index.tsx"],"names":[],"mappings":"AAoBA,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,UAAU,iBAAiB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;CACpD;AA8BD,eAAO,MAAM,YAAY,kHAgWxB,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ToolbarGroup } from '../toolbar.types';
|
|
3
3
|
import type { EpubRendererHandle } from './index';
|
|
4
|
+
import type { Translator } from '@eternalheart/file-preview-core';
|
|
4
5
|
export interface EpubToolbarContext {
|
|
5
6
|
epubRef: React.RefObject<EpubRendererHandle | null>;
|
|
6
7
|
current: number;
|
|
7
8
|
total: number;
|
|
8
9
|
fullWidth: boolean;
|
|
10
|
+
t: Translator;
|
|
9
11
|
}
|
|
10
12
|
export declare function getEpubToolbarGroups(ctx: EpubToolbarContext): ToolbarGroup[];
|
|
11
13
|
//# sourceMappingURL=toolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/renderers/Epub/toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/renderers/Epub/toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,CAAC,EAAE,UAAU,CAAC;CACf;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,kBAAkB,GAAG,YAAY,EAAE,CAyB5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Image/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Image/index.tsx"],"names":[],"mappings":"AAIA,UAAU,kBAAkB;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA0LtD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ToolbarGroup } from '../toolbar.types';
|
|
2
|
+
import type { Translator } from '@eternalheart/file-preview-core';
|
|
2
3
|
export interface ImageToolbarContext {
|
|
3
4
|
zoom: number;
|
|
4
5
|
onZoomIn: () => void;
|
|
@@ -8,6 +9,7 @@ export interface ImageToolbarContext {
|
|
|
8
9
|
onRotateLeft: () => void;
|
|
9
10
|
onRotateRight: () => void;
|
|
10
11
|
onReset: () => void;
|
|
12
|
+
t: Translator;
|
|
11
13
|
}
|
|
12
14
|
export declare function getImageToolbarGroups(ctx: ImageToolbarContext): ToolbarGroup[];
|
|
13
15
|
//# sourceMappingURL=toolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/renderers/Image/toolbar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/renderers/Image/toolbar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAmBlE,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,CAAC,EAAE,UAAU,CAAC;CACf;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,mBAAmB,GAAG,YAAY,EAAE,CA2B9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Json/index.tsx"],"names":[],"mappings":"AAKA,UAAU,iBAAiB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Json/index.tsx"],"names":[],"mappings":"AAKA,UAAU,iBAAiB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAiHD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA8CpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Markdown/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Markdown/index.tsx"],"names":[],"mappings":"AASA,UAAU,qBAAqB;IAC7B,GAAG,EAAE,MAAM,CAAC;CACb;AAmCD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAsL5D,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import 'foliate-js/view.js';
|
|
2
|
+
export interface MobiRendererHandle {
|
|
3
|
+
prevPage: () => void;
|
|
4
|
+
nextPage: () => void;
|
|
5
|
+
toggleFullWidth: () => void;
|
|
6
|
+
toggleToc: () => void;
|
|
7
|
+
}
|
|
8
|
+
interface MobiRendererProps {
|
|
9
|
+
url: string;
|
|
10
|
+
onChapterChange?: (current: number, total: number) => void;
|
|
11
|
+
onFullWidthChange?: (isFullWidth: boolean) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const MobiRenderer: import("react").ForwardRefExoticComponent<MobiRendererProps & import("react").RefAttributes<MobiRendererHandle>>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Mobi/index.tsx"],"names":[],"mappings":"AASA,OAAO,oBAAoB,CAAC;AA8B5B,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,UAAU,iBAAiB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;CACpD;AAED,eAAO,MAAM,YAAY,kHAgQxB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ToolbarGroup } from '../toolbar.types';
|
|
3
|
+
import type { MobiRendererHandle } from './index';
|
|
4
|
+
import type { Translator } from '@eternalheart/file-preview-core';
|
|
5
|
+
export interface MobiToolbarContext {
|
|
6
|
+
mobiRef: React.RefObject<MobiRendererHandle | null>;
|
|
7
|
+
current: number;
|
|
8
|
+
total: number;
|
|
9
|
+
fullWidth: boolean;
|
|
10
|
+
t: Translator;
|
|
11
|
+
}
|
|
12
|
+
export declare function getMobiToolbarGroups(ctx: MobiToolbarContext): ToolbarGroup[];
|
|
13
|
+
//# sourceMappingURL=toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/renderers/Mobi/toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,CAAC,EAAE,UAAU,CAAC;CACf;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,kBAAkB,GAAG,YAAY,EAAE,CA8C5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Msg/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Msg/index.tsx"],"names":[],"mappings":"AAMA,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;CACb;AAoGD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAiSlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Pdf/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Pdf/index.tsx"],"names":[],"mappings":"AAKA,OAAO,uBAAuB,CAAC;AAE/B,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAiJlD,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ToolbarGroup } from '../toolbar.types';
|
|
2
|
+
import type { Translator } from '@eternalheart/file-preview-core';
|
|
2
3
|
export interface PdfToolbarContext {
|
|
3
4
|
zoom: number;
|
|
4
5
|
onZoomIn: () => void;
|
|
5
6
|
onZoomOut: () => void;
|
|
6
7
|
onReset: () => void;
|
|
8
|
+
t: Translator;
|
|
7
9
|
}
|
|
8
10
|
export declare function getPdfToolbarGroups(ctx: PdfToolbarContext): ToolbarGroup[];
|
|
9
11
|
//# sourceMappingURL=toolbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/renderers/Pdf/toolbar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/renderers/Pdf/toolbar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,CAAC,EAAE,UAAU,CAAC;CACf;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,iBAAiB,GAAG,YAAY,EAAE,CAe1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Pptx/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Pptx/index.tsx"],"names":[],"mappings":"AAKA,UAAU,iBAAiB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,yBAAyB;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA4UpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Subtitle/index.tsx"],"names":[],"mappings":"AAUA,UAAU,qBAAqB;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAkBD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAkI5D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Text/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Text/index.tsx"],"names":[],"mappings":"AAMA,UAAU,iBAAiB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AA4CD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAiGpD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ToolbarGroup } from '../toolbar.types';
|
|
2
|
+
import type { Translator } from '@eternalheart/file-preview-core';
|
|
3
|
+
export interface TextToolbarContext {
|
|
4
|
+
wordWrap: boolean;
|
|
5
|
+
onToggleWrap: () => void;
|
|
6
|
+
isHtml: boolean;
|
|
7
|
+
htmlPreview: boolean;
|
|
8
|
+
onToggleHtmlPreview: () => void;
|
|
9
|
+
t: Translator;
|
|
10
|
+
}
|
|
11
|
+
export declare function getTextToolbarGroups(ctx: TextToolbarContext): ToolbarGroup[];
|
|
12
|
+
//# sourceMappingURL=toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/renderers/Text/toolbar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,CAAC,EAAE,UAAU,CAAC;CACf;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,kBAAkB,GAAG,YAAY,EAAE,CA8B5E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Unsupported/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Unsupported/index.tsx"],"names":[],"mappings":"AAGA,UAAU,wBAAwB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA0BlE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Video/index.tsx"],"names":[],"mappings":"AAEA,OAAO,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Video/index.tsx"],"names":[],"mappings":"AAEA,OAAO,4BAA4B,CAAC;AAKpC,UAAU,kBAAkB;IAC1B,GAAG,EAAE,MAAM,CAAC;CACb;AAoBD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAgItD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Xlsx/index.tsx"],"names":[],"mappings":"AAIA,OAAO,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Xlsx/index.tsx"],"names":[],"mappings":"AAIA,OAAO,0CAA0C,CAAC;AAIlD,UAAU,iBAAiB;IACzB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAuOpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Xml/index.tsx"],"names":[],"mappings":"AAOA,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AA2CD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAyElD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ZipToolbarStats } from './toolbar';
|
|
3
|
+
interface ZipRendererProps {
|
|
4
|
+
url: string;
|
|
5
|
+
/** ZIP 嵌套深度(由 FilePreviewContent 传入) */
|
|
6
|
+
nestingDepth?: number;
|
|
7
|
+
/** 解析完成后向外回报统计信息(files / dirs / size),供工具栏展示 */
|
|
8
|
+
onStatsChange?: (stats: ZipToolbarStats | null) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const ZipRenderer: React.FC<ZipRendererProps>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/renderers/Zip/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuB1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAQjD,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,CAAC;CACzD;AA4HD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAwOlD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ToolbarGroup } from '../toolbar.types';
|
|
2
|
+
import type { Translator } from '@eternalheart/file-preview-core';
|
|
3
|
+
export interface ZipToolbarStats {
|
|
4
|
+
files: number;
|
|
5
|
+
dirs: number;
|
|
6
|
+
size: number;
|
|
7
|
+
}
|
|
8
|
+
export interface ZipToolbarContext {
|
|
9
|
+
stats: ZipToolbarStats | null;
|
|
10
|
+
t: Translator;
|
|
11
|
+
}
|
|
12
|
+
export declare function getZipToolbarGroups({ stats }: ZipToolbarContext): ToolbarGroup[];
|
|
13
|
+
//# sourceMappingURL=toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../src/renderers/Zip/toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9B,CAAC,EAAE,UAAU,CAAC;CACf;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,EAAE,iBAAiB,GAAG,YAAY,EAAE,CAahF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eternalheart/react-file-preview",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "A modern, feature-rich file preview component for React with support for images, videos, audio, PDFs, Office documents (Word, Excel, PowerPoint), Markdown, and code files.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.cjs",
|
|
@@ -78,7 +78,9 @@
|
|
|
78
78
|
"@types/react-syntax-highlighter": "^15.5.13",
|
|
79
79
|
"@videojs-player/react": "^1.0.0",
|
|
80
80
|
"docx-preview": "^0.3.2",
|
|
81
|
+
"foliate-js": "1.0.1",
|
|
81
82
|
"framer-motion": "^11.11.17",
|
|
83
|
+
"jszip": "^3.10.1",
|
|
82
84
|
"lucide-react": "^0.460.0",
|
|
83
85
|
"mammoth": "^1.8.0",
|
|
84
86
|
"pdfjs-dist": "4.8.69",
|
|
@@ -90,6 +92,7 @@
|
|
|
90
92
|
"video.js": "^8.23.4"
|
|
91
93
|
},
|
|
92
94
|
"devDependencies": {
|
|
95
|
+
"@eternalheart/file-preview-core": "workspace:*",
|
|
93
96
|
"@types/node": "^24.10.1",
|
|
94
97
|
"@types/react": "^18.3.12",
|
|
95
98
|
"@types/react-dom": "^18.3.1",
|
|
@@ -104,7 +107,6 @@
|
|
|
104
107
|
"typescript": "^5.6.3",
|
|
105
108
|
"vite": "^5.4.11",
|
|
106
109
|
"vite-plugin-static-copy": "^3.1.4",
|
|
107
|
-
"x-data-spreadsheet": "^1.1.9"
|
|
108
|
-
"@eternalheart/file-preview-core": "workspace:*"
|
|
110
|
+
"x-data-spreadsheet": "^1.1.9"
|
|
109
111
|
}
|
|
110
112
|
}
|