@eternalheart/vue-file-preview 1.6.13 → 1.7.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 +2 -0
- package/README.zh-CN.md +2 -0
- package/lib/FilePreviewContent.vue.d.ts +17 -6
- package/lib/FilePreviewEmbed.vue.d.ts +14 -6
- package/lib/FilePreviewModal.vue.d.ts +14 -6
- package/lib/chunks/{EmptyState.vue_vue_type_script_setup_true_lang-C7qk6wj0.mjs → EmptyState.vue_vue_type_script_setup_true_lang--ZOobbGi.mjs} +1 -1
- package/lib/chunks/{avifLoader-CAUzjn-d-C0KRpetN.mjs → avifLoader-CAUzjn-d-CnJpGYJ2.mjs} +1 -1
- package/lib/chunks/{heicLoader-D_9PukkA-Czof_5FJ.mjs → heicLoader-D_9PukkA-g_dLrWLP.mjs} +1 -1
- package/lib/chunks/index-6XZXYqbp.mjs +125 -0
- package/lib/chunks/{index-B21EAyWz.mjs → index-BPSzwMOC.mjs} +51 -51
- package/lib/chunks/index-BYQ9S7Mk.mjs +104 -0
- package/lib/chunks/{index-8Vpbg2kS.mjs → index-Bf94DwQu.mjs} +105 -104
- package/lib/chunks/index-BfOWoMpY.mjs +359 -0
- package/lib/chunks/index-Bg8poMIm.mjs +117 -0
- package/lib/chunks/index-BzwJ0VWu.mjs +108 -0
- package/lib/chunks/index-C41YET0_.mjs +51 -0
- package/lib/chunks/{index-BvBqDq3O.mjs → index-C4hIk6pa.mjs} +2023 -2023
- package/lib/chunks/{index-BASg1cr4.mjs → index-C8lyQPe3.mjs} +1018 -1018
- package/lib/chunks/{index-C9mAajbD.mjs → index-CWPdNhoe.mjs} +200 -200
- package/lib/chunks/{index-BuqPb5mP.mjs → index-CrVQPnFj.mjs} +112 -112
- package/lib/chunks/{index-D30L8tm9.mjs → index-D5IF9F-D.mjs} +57 -57
- package/lib/chunks/{index-DN4Ui0Gh.mjs → index-DFeKS8tR.mjs} +120 -120
- package/lib/chunks/index-DM8Dfl-m.mjs +52 -0
- package/lib/chunks/index-DZe0BxAB.mjs +90 -0
- package/lib/chunks/{index-BlrFFeqc.mjs → index-GFcSJEwj.mjs} +75 -75
- package/lib/chunks/{index-Dkro_8Fy.mjs → index-LPGxJDnT.mjs} +32 -32
- package/lib/chunks/index-aKiIuKKx.mjs +157 -0
- package/lib/chunks/{index-DZZN3kYi.mjs → index-c-pYJEmH.mjs} +1589 -1394
- package/lib/chunks/{index-CxKZKUJj.mjs → index-z9RqL2wI.mjs} +1651 -1651
- package/lib/chunks/index-zLQlyNR2.mjs +383 -0
- package/lib/chunks/{jp2Loader-Dig19xyo-CKUaGhPl.mjs → jp2Loader-Dig19xyo-fCO1knZ0.mjs} +1 -1
- package/lib/chunks/{psdLoader-C0tKUXXl-CYWoQis5.mjs → psdLoader-C0tKUXXl-DihMskai.mjs} +1 -1
- package/lib/chunks/{rawLoader-C-tPeFAB-C35zC8nZ.mjs → rawLoader-C-tPeFAB-BSfDPl-z.mjs} +5 -5
- package/lib/chunks/{tiffLoader-BlhByX8w-BOxg_Du5.mjs → tiffLoader-BlhByX8w-JY5DaTre.mjs} +1 -1
- package/lib/chunks/{useShikiHighlight-BPmcxA-h.mjs → useShikiHighlight-C-ztcJBE.mjs} +1 -1
- package/lib/composables/useAudioPlayer.d.ts +1 -1
- package/lib/composables/usePreviewEvents.d.ts +27 -0
- package/lib/composables/useRequest.d.ts +16 -4
- package/lib/composables/useThemeMode.d.ts +1 -1
- package/lib/composables/useTranslator.d.ts +2 -2
- package/lib/core/events.d.ts +52 -0
- package/lib/core/i18n/index.d.ts +29 -0
- package/lib/core/i18n/messages/en-US.d.ts +5 -0
- package/lib/core/i18n/messages/index.d.ts +9 -0
- package/lib/core/i18n/messages/zh-CN.d.ts +5 -0
- package/lib/core/i18n/types.d.ts +23 -0
- package/lib/core/index.d.ts +34 -0
- package/lib/core/loaders/avifLoader.d.ts +22 -0
- package/lib/core/loaders/heicLoader.d.ts +21 -0
- package/lib/core/loaders/jp2Loader.d.ts +16 -0
- package/lib/core/loaders/jp2Worker.d.ts +1 -0
- package/lib/core/loaders/psdLoader.d.ts +14 -0
- package/lib/core/loaders/rawLoader.d.ts +14 -0
- package/lib/core/loaders/registry.d.ts +32 -0
- package/lib/core/loaders/tiffLoader.d.ts +28 -0
- package/lib/core/loaders/types.d.ts +56 -0
- package/lib/core/types.d.ts +89 -0
- package/lib/core/utils/csvParser.d.ts +31 -0
- package/lib/core/utils/emptyState.d.ts +28 -0
- package/lib/core/utils/excelDataConverter.d.ts +61 -0
- package/lib/core/utils/fileNormalizer.d.ts +21 -0
- package/lib/core/utils/fileType.d.ts +21 -0
- package/lib/core/utils/legacy-office/doc.d.ts +25 -0
- package/lib/core/utils/legacy-office/index.d.ts +8 -0
- package/lib/core/utils/legacy-office/ole.d.ts +8 -0
- package/lib/core/utils/legacy-office/ppt.d.ts +79 -0
- package/lib/core/utils/legacy-office/xls.d.ts +28 -0
- package/lib/core/utils/mimeTypes.d.ts +29 -0
- package/lib/core/utils/ooxml/docx.d.ts +17 -0
- package/lib/core/utils/ooxml/index.d.ts +4 -0
- package/lib/core/utils/ooxml/pptx.d.ts +7 -0
- package/lib/core/utils/ooxml/xml.d.ts +15 -0
- package/lib/core/utils/ooxml/zip.d.ts +3 -0
- package/lib/core/utils/pdfWorker.d.ts +61 -0
- package/lib/core/utils/previewMode.d.ts +7 -0
- package/lib/core/utils/request.d.ts +49 -0
- package/lib/core/utils/subtitleParser.d.ts +44 -0
- package/lib/core/utils/textDecoder.d.ts +30 -0
- package/lib/core/utils/uint8ArrayPolyfill.d.ts +18 -0
- package/lib/core/utils/zipReader.d.ts +51 -0
- package/lib/core/workers/imageDecoder.worker.d.ts +31 -0
- package/lib/core/workers/workerClient.d.ts +14 -0
- package/lib/i18n/localeKey.d.ts +1 -1
- package/lib/index.cjs +60 -60
- package/lib/index.css +1 -1
- package/lib/index.d.ts +11 -9
- package/lib/index.mjs +15 -12
- package/lib/renderers/Audio/index.vue.d.ts +1 -1
- package/lib/renderers/Cad/index.vue.d.ts +1 -1
- package/lib/renderers/Cad/toolbar.d.ts +2 -2
- package/lib/renderers/Csv/index.vue.d.ts +1 -1
- package/lib/renderers/Doc/index.vue.d.ts +1 -1
- package/lib/renderers/Docx/index.vue.d.ts +1 -1
- package/lib/renderers/Epub/index.vue.d.ts +1 -1
- package/lib/renderers/Font/index.vue.d.ts +1 -1
- package/lib/renderers/Image/index.vue.d.ts +2 -2
- package/lib/renderers/Json/index.vue.d.ts +2 -2
- package/lib/renderers/Markdown/index.vue.d.ts +1 -1
- package/lib/renderers/Mobi/index.vue.d.ts +1 -1
- package/lib/renderers/Msg/index.vue.d.ts +1 -1
- package/lib/renderers/Pdf/index.vue.d.ts +1 -1
- package/lib/renderers/Ppt/index.vue.d.ts +1 -1
- package/lib/renderers/Pptx/index.vue.d.ts +2 -2
- package/lib/renderers/Subtitle/index.vue.d.ts +1 -1
- package/lib/renderers/Text/index.vue.d.ts +2 -2
- package/lib/renderers/Unsupported/index.vue.d.ts +1 -1
- package/lib/renderers/Video/index.vue.d.ts +1 -1
- package/lib/renderers/Xlsx/index.vue.d.ts +2 -2
- package/lib/renderers/Xml/index.vue.d.ts +1 -1
- package/lib/renderers/Zip/TreeItem.vue.d.ts +1 -1
- package/lib/renderers/Zip/index.vue.d.ts +1 -1
- package/lib/renderers/base.types.d.ts +1 -1
- package/lib/renderers/registry.d.ts +1 -1
- package/lib/types.d.ts +3 -3
- package/package.json +2 -2
- package/lib/chunks/index--612Smof.mjs +0 -383
- package/lib/chunks/index-BB0i4QqI.mjs +0 -117
- package/lib/chunks/index-BVdrGK3Q.mjs +0 -356
- package/lib/chunks/index-Bp9CuvMZ.mjs +0 -157
- package/lib/chunks/index-Bxpf9v5j.mjs +0 -104
- package/lib/chunks/index-CDg6vIbT.mjs +0 -51
- package/lib/chunks/index-CWE-hKSs.mjs +0 -90
- package/lib/chunks/index-CY3xzGgt.mjs +0 -108
- package/lib/chunks/index-VdzIFJJW.mjs +0 -118
- package/lib/chunks/index-aoXgVLBb.mjs +0 -52
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
export declare const VERSION: string;
|
|
3
|
-
export { default as FilePreviewModal } from './FilePreviewModal.vue';
|
|
4
|
-
export { default as FilePreviewEmbed } from './FilePreviewEmbed.vue';
|
|
5
|
-
export { default as FilePreviewContent } from './FilePreviewContent.vue';
|
|
6
|
-
export type { PreviewFile, PreviewFileLink, PreviewFileInput, FileType, PreviewState, ToolbarAction, CustomRenderer, CustomRendererContext, CustomRendererEventPayload, RequestHandler, RequestInitFactory, RequestOptions, Fetcher, ShouldFetchAsBlob, } from './types';
|
|
7
|
-
export { normalizeFile, normalizeFiles, getFileType, configurePdfWorker, SUPPORTED_FILE_TYPES, } from '
|
|
8
|
-
export type { PdfWorkerOptions } from '
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export
|
|
3
|
+
export { default as FilePreviewModal } from './FilePreviewModal.vue.js';
|
|
4
|
+
export { default as FilePreviewEmbed } from './FilePreviewEmbed.vue.js';
|
|
5
|
+
export { default as FilePreviewContent } from './FilePreviewContent.vue.js';
|
|
6
|
+
export type { PreviewFile, PreviewFileLink, PreviewFileInput, FileType, PreviewState, ToolbarAction, CustomRenderer, CustomRendererContext, CustomRendererEventPayload, RequestHandler, RequestInitFactory, RequestOptions, Fetcher, ShouldFetchAsBlob, FileContent, FileLoader, } from './types.js';
|
|
7
|
+
export { normalizeFile, normalizeFiles, getFileType, configurePdfWorker, SUPPORTED_FILE_TYPES, PreviewRequestError, withHeaders, } from './core/index.js';
|
|
8
|
+
export type { PdfWorkerOptions } from './core/index.js';
|
|
9
|
+
export type { PreviewErrorStage, PreviewErrorPayload, PreviewReporter, } from './core/index.js';
|
|
10
|
+
export { usePreviewEvents } from './composables/usePreviewEvents.js';
|
|
11
|
+
export { useTranslator, provideLocale } from './composables/useTranslator.js';
|
|
12
|
+
export { LOCALE_KEY } from './i18n/localeKey.js';
|
|
13
|
+
export type { EmptyHintMode, Locale, Messages, Translator, Theme } from './core/index.js';
|
package/lib/index.mjs
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { G as s, I as r, K as i, i as o, M as l, O as P, P as E, n, S as t, Y as v, Z as F, a0 as w, b as d, u, a1 as m } from "./chunks/index-c-pYJEmH.mjs";
|
|
2
2
|
export {
|
|
3
3
|
s as FilePreviewContent,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
P as
|
|
9
|
-
E as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
r as FilePreviewEmbed,
|
|
5
|
+
i as FilePreviewModal,
|
|
6
|
+
o as LOCALE_KEY,
|
|
7
|
+
l as PreviewRequestError,
|
|
8
|
+
P as SUPPORTED_FILE_TYPES,
|
|
9
|
+
E as VERSION,
|
|
10
|
+
n as configurePdfWorker,
|
|
11
|
+
t as getFileType,
|
|
12
|
+
v as normalizeFile,
|
|
13
|
+
F as normalizeFiles,
|
|
14
|
+
w as provideLocale,
|
|
15
|
+
d as usePreviewEvents,
|
|
16
|
+
u as useTranslator,
|
|
17
|
+
m as withHeaders
|
|
15
18
|
};
|
|
@@ -5,7 +5,7 @@ interface Props {
|
|
|
5
5
|
baseUrl?: string;
|
|
6
6
|
}
|
|
7
7
|
declare const _default: import("vue").DefineComponent<Props, {
|
|
8
|
-
getToolbarGroups: () => import("../toolbar.types").ToolbarGroup[];
|
|
8
|
+
getToolbarGroups: () => import("../toolbar.types.js").ToolbarGroup[];
|
|
9
9
|
onToolbarChange?: (listener: () => void) => (() => void);
|
|
10
10
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
11
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ToolbarGroup } from '../toolbar.types';
|
|
2
|
-
import type { Translator } from '
|
|
1
|
+
import type { ToolbarGroup } from '../toolbar.types.js';
|
|
2
|
+
import type { Translator } from '../../core/index.js';
|
|
3
3
|
export interface CadToolbarContext {
|
|
4
4
|
cadRef: {
|
|
5
5
|
resetView: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PreviewFile } from '
|
|
2
|
-
import type { ToolbarGroup } from '../toolbar.types';
|
|
1
|
+
import type { PreviewFile } from '../../core/index.js';
|
|
2
|
+
import type { ToolbarGroup } from '../toolbar.types.js';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
url: string;
|
|
5
5
|
fileSize?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ToolbarGroup } from '../toolbar.types';
|
|
2
|
-
import { type EmptyHintMode } from '
|
|
1
|
+
import type { ToolbarGroup } from '../toolbar.types.js';
|
|
2
|
+
import { type EmptyHintMode } from '../../core/index.js';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<{
|
|
4
4
|
url: string;
|
|
5
5
|
fileName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type EmptyHintMode } from '
|
|
2
|
-
import type { ToolbarGroup } from '../toolbar.types';
|
|
1
|
+
import { type EmptyHintMode } from '../../core/index.js';
|
|
2
|
+
import type { ToolbarGroup } from '../toolbar.types.js';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
url: string;
|
|
5
5
|
tiled?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type EmptyHintMode } from '
|
|
2
|
-
import type { ToolbarGroup } from '../toolbar.types';
|
|
1
|
+
import { type EmptyHintMode } from '../../core/index.js';
|
|
2
|
+
import type { ToolbarGroup } from '../toolbar.types.js';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
url: string;
|
|
5
5
|
fileName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type EmptyHintMode } from '
|
|
2
|
-
import type { ToolbarGroup } from '../toolbar.types';
|
|
1
|
+
import { type EmptyHintMode } from '../../core/index.js';
|
|
2
|
+
import type { ToolbarGroup } from '../toolbar.types.js';
|
|
3
3
|
type __VLS_Props = {
|
|
4
4
|
url: string;
|
|
5
5
|
/** 保留通用预览参数;空 Excel 始终展示默认工作簿。 */
|
package/lib/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type { PreviewFile, PreviewFileLink, PreviewFileInput, FileType, PreviewState, CustomRendererEventPayload, RequestHandler, RequestInitFactory, RequestOptions, Fetcher, ShouldFetchAsBlob, } from '
|
|
2
|
-
import type { PreviewFile, Locale, Translator } from '
|
|
1
|
+
export type { PreviewFile, PreviewFileLink, PreviewFileInput, FileType, PreviewState, CustomRendererEventPayload, RequestHandler, RequestInitFactory, RequestOptions, Fetcher, ShouldFetchAsBlob, FileContent, FileLoader, } from './core/index.js';
|
|
2
|
+
import type { PreviewFile, Locale, Translator } from './core/index.js';
|
|
3
3
|
import type { Component, VNode } from 'vue';
|
|
4
|
-
import type { ToolbarGroup } from './renderers/toolbar.types';
|
|
4
|
+
import type { ToolbarGroup } from './renderers/toolbar.types.js';
|
|
5
5
|
/**
|
|
6
6
|
* 工具栏自定义动作
|
|
7
7
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eternalheart/vue-file-preview",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "A modern, feature-rich file preview component for Vue 3 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",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build:esm": "vite build --mode esm",
|
|
61
61
|
"build:cjs": "vite build --mode cjs",
|
|
62
|
-
"build": "pnpm --filter @eternalheart/file-preview-core build && pnpm build:esm && pnpm build:cjs && vue-tsc --project tsconfig.json --emitDeclarationOnly",
|
|
62
|
+
"build": "pnpm --filter @eternalheart/file-preview-core build && pnpm build:esm && pnpm build:cjs && vue-tsc --project tsconfig.json --emitDeclarationOnly && node ../../scripts/patch-lib-types.mjs vue-file-preview",
|
|
63
63
|
"dev": "vite build --mode esm --watch --emptyOutDir false",
|
|
64
64
|
"prepublishOnly": "pnpm build",
|
|
65
65
|
"version:patch": "npm version patch",
|