lt-ppt 1.0.26 → 1.0.28
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/{InnerApp-D8mU98_u.js → InnerApp-BkVsQnm2.js} +9113 -9077
- package/dist/{index-CQot7iN3.js → index-e8Js74-o.js} +1 -1
- package/dist/{index-D5u0ETgN.js → index-vmpIx8K7.js} +1 -1
- package/dist/index.browser-Wq18ov6h.js +24 -0
- package/dist/{lib-B0z78_t3.js → lib-9k4fJaGf.js} +191 -98
- package/dist/lt-ppt.css +1 -1
- package/dist/lt-ppt.es.js +1 -1
- package/dist/lt-ppt.umd.js +128 -128
- package/dist/{screen-CacUF2YF.js → screen-Brvtzttu.js} +558 -575
- package/dist/types/src/LtPPT.vue.d.ts +10 -3
- package/dist/types/src/lib.d.ts +2 -2
- package/dist/types/src/types/lt-ppt.d.ts +57 -1
- package/package.json +1 -1
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { LtPPTProps, SupportedLocale, ThemeMode } from './types/lt-ppt';
|
|
2
|
-
import { Slide } from './types/slides';
|
|
1
|
+
import { ImageAIEntryClickParams, InsertImageParams, LtPPTProps, ReplaceImageParams, SupportedLocale, ThemeMode } from './types/lt-ppt';
|
|
2
|
+
import { PPTElement, PPTImageElement, Slide } from './types/slides';
|
|
3
3
|
declare const _default: import('vue').DefineComponent<LtPPTProps, {
|
|
4
4
|
getSlides: () => Slide[];
|
|
5
|
+
getSelectedElements: () => PPTElement[];
|
|
5
6
|
setSlides: (slides: Slide[]) => void;
|
|
6
7
|
startScreening: () => void;
|
|
7
8
|
getCurrentIndex: () => number;
|
|
8
|
-
|
|
9
|
+
insertImage: (params: InsertImageParams) => Promise<PPTImageElement | null>;
|
|
10
|
+
replaceImage: (params: ReplaceImageParams) => Promise<PPTImageElement | null>;
|
|
11
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
12
|
+
"image-ai-entry-click": (payload: ImageAIEntryClickParams) => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<LtPPTProps> & Readonly<{
|
|
14
|
+
"onImage-ai-entry-click"?: ((payload: ImageAIEntryClickParams) => any) | undefined;
|
|
15
|
+
}>, {
|
|
9
16
|
height: string;
|
|
10
17
|
width: string;
|
|
11
18
|
locale: SupportedLocale;
|
package/dist/types/src/lib.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as LtPPT } from './LtPPT.vue';
|
|
2
2
|
export { LtPPT };
|
|
3
|
-
export type { LtPPTProps, LtPPTInstance, InitData, UploadFileParams, SaveCallbackParams, SupportedLocale, ThemeMode } from './types/lt-ppt';
|
|
4
|
-
export type { Slide, PPTElement, SlideTheme } from './types/slides';
|
|
3
|
+
export type { LtPPTProps, LtPPTInstance, InitData, UploadFileParams, SaveCallbackParams, ImageAIEntryClickParams, InsertImageParams, ReplaceImageParams, SupportedLocale, ThemeMode } from './types/lt-ppt';
|
|
4
|
+
export type { Slide, PPTElement, PPTImageElement, SlideTheme } from './types/slides';
|
|
5
5
|
export { loadFonts } from './utils/fonts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Slide } from './slides';
|
|
1
|
+
import { PPTElement, PPTImageElement, Slide } from './slides';
|
|
2
2
|
export type SupportedLocale = 'zh-CN' | 'en';
|
|
3
3
|
export type ThemeMode = 'dark' | 'light';
|
|
4
4
|
export interface InitData {
|
|
@@ -21,6 +21,54 @@ export interface SaveCallbackParams {
|
|
|
21
21
|
/** 幻灯片图片 URL 列表 */
|
|
22
22
|
slideImages: string[];
|
|
23
23
|
}
|
|
24
|
+
export interface ImageAIEntryClickParams {
|
|
25
|
+
/** 当前触发 AI 入口的图片元素 */
|
|
26
|
+
element: PPTImageElement;
|
|
27
|
+
}
|
|
28
|
+
export interface InsertImageParams {
|
|
29
|
+
/** 图片地址,支持 URL、base64 dataURL、blob URL */
|
|
30
|
+
src: string;
|
|
31
|
+
/** 目标页面 ID;优先级高于 slideIndex */
|
|
32
|
+
slideId?: string;
|
|
33
|
+
/** 目标页面索引,默认当前页 */
|
|
34
|
+
slideIndex?: number;
|
|
35
|
+
/** 图片左上角横坐标,默认居中 */
|
|
36
|
+
left?: number;
|
|
37
|
+
/** 图片左上角纵坐标,默认居中 */
|
|
38
|
+
top?: number;
|
|
39
|
+
/** 图片宽度,未传时使用图片原始宽度并自动适配画布 */
|
|
40
|
+
width?: number;
|
|
41
|
+
/** 图片高度,未传时按原图比例计算或自动适配画布 */
|
|
42
|
+
height?: number;
|
|
43
|
+
/** 是否锁定宽高比例,默认 true */
|
|
44
|
+
fixedRatio?: boolean;
|
|
45
|
+
/** 旋转角度,默认 0 */
|
|
46
|
+
rotate?: number;
|
|
47
|
+
/** 插入后是否选中该图片,默认 true */
|
|
48
|
+
select?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface ReplaceImageParams {
|
|
51
|
+
/** 新图片地址,支持 URL、base64 dataURL、blob URL */
|
|
52
|
+
src: string;
|
|
53
|
+
/** 被替换的图片元素 ID;不传则替换当前选中的图片 */
|
|
54
|
+
elementId?: string;
|
|
55
|
+
/** 目标页面 ID;优先级高于 slideIndex */
|
|
56
|
+
slideId?: string;
|
|
57
|
+
/** 目标页面索引,默认当前页;当传入 elementId 且未传页面信息时会自动查找 */
|
|
58
|
+
slideIndex?: number;
|
|
59
|
+
/** 是否保持原图片元素尺寸和位置,默认 false;默认保持左上角和宽度,高度按新图比例自适应 */
|
|
60
|
+
keepSize?: boolean;
|
|
61
|
+
/** 新宽度;默认使用原图片元素宽度 */
|
|
62
|
+
width?: number;
|
|
63
|
+
/** 新高度;不传时按新图片比例自适应 */
|
|
64
|
+
height?: number;
|
|
65
|
+
/** 是否锁定宽高比例,不传则沿用原元素配置 */
|
|
66
|
+
fixedRatio?: boolean;
|
|
67
|
+
/** 是否清除原图片裁剪信息,默认 false;尺寸自适应时会自动清除裁剪 */
|
|
68
|
+
resetClip?: boolean;
|
|
69
|
+
/** 替换后是否选中该图片,默认 true */
|
|
70
|
+
select?: boolean;
|
|
71
|
+
}
|
|
24
72
|
export interface LtPPTProps {
|
|
25
73
|
/** 初始化数据 */
|
|
26
74
|
initData?: InitData;
|
|
@@ -44,14 +92,22 @@ export interface LtPPTProps {
|
|
|
44
92
|
theme?: ThemeMode;
|
|
45
93
|
/** 返回按钮回调,传入后头部左侧显示返回图标 */
|
|
46
94
|
onReturn?: () => void;
|
|
95
|
+
/** 点击图片 AI 入口时触发 */
|
|
96
|
+
onImageAIEntryClick?: (params: ImageAIEntryClickParams) => void;
|
|
47
97
|
}
|
|
48
98
|
export interface LtPPTInstance {
|
|
49
99
|
/** 获取当前幻灯片数据 */
|
|
50
100
|
getSlides: () => Slide[];
|
|
101
|
+
/** 获取当前页选中的元素 */
|
|
102
|
+
getSelectedElements: () => PPTElement[];
|
|
51
103
|
/** 设置幻灯片数据 */
|
|
52
104
|
setSlides: (slides: Slide[]) => void;
|
|
53
105
|
/** 进入放映模式 */
|
|
54
106
|
startScreening: () => void;
|
|
55
107
|
/** 获取当前幻灯片索引 */
|
|
56
108
|
getCurrentIndex: () => number;
|
|
109
|
+
/** 向指定页面插入图片 */
|
|
110
|
+
insertImage: (params: InsertImageParams) => Promise<PPTImageElement | null>;
|
|
111
|
+
/** 替换指定图片元素,未指定元素时替换当前选中图片 */
|
|
112
|
+
replaceImage: (params: ReplaceImageParams) => Promise<PPTImageElement | null>;
|
|
57
113
|
}
|