lt-ppt 1.0.4 → 1.0.6

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.
@@ -1,6 +1,6 @@
1
1
  import { defineStore as Js } from "./pinia-CVat9nJz.js";
2
2
  import { createI18n as Uy } from "./vue-i18n-R6dI71u7.js";
3
- import { e as Jy, z as Gy } from "./lib-dWAlX6ww.js";
3
+ import { e as Jy, z as Gy } from "./lib-5ZJTu6rs.js";
4
4
  const Hy = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
5
5
  let $y = (u) => crypto.getRandomValues(new Uint8Array(u)), jy = (u, t, n) => {
6
6
  let i = (2 << Math.log2(u.length - 1)) - 1, a = -~(1.6 * i * t / u.length);
@@ -12773,8 +12773,8 @@ export {
12773
12773
  qi as c,
12774
12774
  aw as d,
12775
12775
  ii as e,
12776
- V0 as f,
12777
- m0 as g,
12776
+ m0 as f,
12777
+ V0 as g,
12778
12778
  fe as h,
12779
12779
  Ru as i,
12780
12780
  R0 as j,
@@ -1,10 +1,11 @@
1
- import { Slide, SlideTheme } from './types/slides';
1
+ import { Slide } from './types/slides';
2
+ import { InitData, UploadFileParams, SaveCallbackParams } from './types/lt-ppt';
2
3
  type __VLS_Props = {
3
- initialData?: Slide[];
4
- initialTheme?: Partial<SlideTheme>;
4
+ initData?: InitData;
5
+ onUploadFile?: (params: UploadFileParams) => Promise<string>;
5
6
  readonly?: boolean;
6
7
  onChange?: (slides: Slide[]) => void;
7
- onSave?: (slides: Slide[]) => void;
8
+ onSave?: (params: SaveCallbackParams) => void;
8
9
  };
9
10
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
10
11
  export default _default;
@@ -1,4 +1,4 @@
1
- import { LtPPTProps } from './types/lt-ppt';
1
+ import { LtPPTProps, SaveCallbackParams } from './types/lt-ppt';
2
2
  import { Slide } from './types/slides';
3
3
  declare const _default: import('vue').DefineComponent<LtPPTProps, {
4
4
  getSlides: () => Slide[];
@@ -7,10 +7,10 @@ declare const _default: import('vue').DefineComponent<LtPPTProps, {
7
7
  getCurrentIndex: () => number;
8
8
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
9
9
  change: (slides: Slide[]) => any;
10
- save: (slides: Slide[]) => any;
10
+ save: (params: SaveCallbackParams) => any;
11
11
  }, string, import('vue').PublicProps, Readonly<LtPPTProps> & Readonly<{
12
12
  onChange?: ((slides: Slide[]) => any) | undefined;
13
- onSave?: ((slides: Slide[]) => any) | undefined;
13
+ onSave?: ((params: SaveCallbackParams) => any) | undefined;
14
14
  }>, {
15
15
  height: string;
16
16
  width: string;
@@ -1,5 +1,5 @@
1
1
  import { default as LtPPT } from './LtPPT.vue';
2
2
  export { LtPPT };
3
- export type { LtPPTProps, LtPPTEmits, LtPPTInstance, SupportedLocale } from './types/lt-ppt';
3
+ export type { LtPPTProps, LtPPTEmits, LtPPTInstance, InitData, UploadFileParams, SaveCallbackParams, SupportedLocale } from './types/lt-ppt';
4
4
  export type { Slide, PPTElement, SlideTheme } from './types/slides';
5
5
  export { loadFonts } from './utils/fonts';
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  loading: string;
15
15
  exporting: string;
16
16
  importing: string;
17
+ saving: string;
17
18
  success: string;
18
19
  error: string;
19
20
  warning: string;
@@ -18,6 +18,7 @@ declare const i18n: import('vue-i18n').I18n<{
18
18
  loading: string;
19
19
  exporting: string;
20
20
  importing: string;
21
+ saving: string;
21
22
  success: string;
22
23
  error: string;
23
24
  warning: string;
@@ -904,6 +905,7 @@ declare const i18n: import('vue-i18n').I18n<{
904
905
  loading: string;
905
906
  exporting: string;
906
907
  importing: string;
908
+ saving: string;
907
909
  success: string;
908
910
  error: string;
909
911
  warning: string;
@@ -14,6 +14,7 @@ declare const _default: {
14
14
  loading: string;
15
15
  exporting: string;
16
16
  importing: string;
17
+ saving: string;
17
18
  success: string;
18
19
  error: string;
19
20
  warning: string;
@@ -1,10 +1,30 @@
1
- import { Slide, SlideTheme } from './slides';
1
+ import { Slide } from './slides';
2
2
  export type SupportedLocale = 'zh-CN' | 'en';
3
+ export interface InitData {
4
+ /** JSON 数据(包含 slides, theme 等) */
5
+ json?: Record<string, any>;
6
+ /** PPTX 文件 URL */
7
+ pptUrl?: string;
8
+ }
9
+ export interface UploadFileParams {
10
+ /** File 对象 */
11
+ file?: File;
12
+ /** base64 字符串 */
13
+ base64?: string;
14
+ }
15
+ export interface SaveCallbackParams {
16
+ /** PPTX 文件 URL */
17
+ pptUrl: string;
18
+ /** JSON 数据 */
19
+ json: Record<string, any>;
20
+ /** 幻灯片图片 URL 列表 */
21
+ slideImages: string[];
22
+ }
3
23
  export interface LtPPTProps {
4
- /** 初始幻灯片数据 */
5
- data?: Slide[];
6
- /** 初始主题 */
7
- theme?: Partial<SlideTheme>;
24
+ /** 初始化数据 */
25
+ initData?: InitData;
26
+ /** 文件上传方法,接受包含 file 或 base64 的对象,返回资源的网络链接 */
27
+ onUploadFile?: (params: UploadFileParams) => Promise<string>;
8
28
  /** 语言设置 */
9
29
  locale?: SupportedLocale;
10
30
  /** 容器宽度(CSS 值,如 '100%' 或 '1200px') */
@@ -16,7 +36,7 @@ export interface LtPPTProps {
16
36
  }
17
37
  export interface LtPPTEmits {
18
38
  (e: 'change', slides: Slide[]): void;
19
- (e: 'save', slides: Slide[]): void;
39
+ (e: 'save', params: SaveCallbackParams): void;
20
40
  }
21
41
  export interface LtPPTInstance {
22
42
  /** 获取当前幻灯片数据 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lt-ppt",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/lt-ppt.umd.js",
@@ -32,7 +32,7 @@
32
32
  "docker:run": "docker compose up -d",
33
33
  "docker:stop": "docker compose down",
34
34
  "docker:deploy": "docker compose build && docker compose up -d --force-recreate --no-deps pptist",
35
- "build:lib": "rm -rf dist && vite build --config vite.lib.config.ts"
35
+ "build:lib": "rm -rf dist tsconfig.app.tsbuildinfo && vite build --config vite.lib.config.ts"
36
36
  },
37
37
  "author": "pipipi_pikachu@163.com",
38
38
  "homepage": "https://github.com/pipipi-pikachu/PPTist",