lt-ppt 1.0.42 → 1.0.44

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,5 +1,5 @@
1
1
  import { defineStore as d } from "./pinia-CVat9nJz.js";
2
- import { a as r, u as S, d as a } from "./database-cQQ-a-Yz.js";
2
+ import { a as r, u as S, d as a } from "./database-DdqchTdA.js";
3
3
  const u = d("snapshot", {
4
4
  state: () => ({
5
5
  snapshotCursor: -1,
@@ -1,5 +1,5 @@
1
1
  import { default as LtPPT } from './LtPPT.vue';
2
2
  export { LtPPT };
3
- export type { LtPPTProps, LtPPTInstance, LtPPTMode, InitData, UploadFileParams, SaveCallbackParams, ImageAIEntryElement, ImageAIEntryClickParams, InsertImageParams, ReplaceImageParams, InsertVideoParams, ReplaceVideoParams, SupportedLocale, ThemeMode } from './types/lt-ppt';
3
+ export type { LtPPTProps, LtPPTInstance, LtPPTMode, InitData, UploadFileParams, CustomImageSource, SaveCallbackParams, ImageAIEntryElement, ImageAIEntryClickParams, InsertImageParams, ReplaceImageParams, InsertVideoParams, ReplaceVideoParams, SupportedLocale, ThemeMode } from './types/lt-ppt';
4
4
  export type { Slide, PPTElement, PPTImageElement, PPTVideoElement, SlideTheme } from './types/slides';
5
5
  export { loadFonts } from './utils/fonts';
@@ -63,6 +63,7 @@ declare const _default: {
63
63
  insertImage: string;
64
64
  image: string;
65
65
  uploadImage: string;
66
+ uploadLocalImage: string;
66
67
  onlineLibrary: string;
67
68
  insertLine: string;
68
69
  line: string;
@@ -67,6 +67,7 @@ declare const i18n: import('./useLocale.ts').I18n<{
67
67
  insertImage: string;
68
68
  image: string;
69
69
  uploadImage: string;
70
+ uploadLocalImage: string;
70
71
  onlineLibrary: string;
71
72
  insertLine: string;
72
73
  line: string;
@@ -1197,6 +1198,7 @@ declare const i18n: import('./useLocale.ts').I18n<{
1197
1198
  insertImage: string;
1198
1199
  image: string;
1199
1200
  uploadImage: string;
1201
+ uploadLocalImage: string;
1200
1202
  onlineLibrary: string;
1201
1203
  insertLine: string;
1202
1204
  line: string;
@@ -63,6 +63,7 @@ declare const _default: {
63
63
  insertImage: string;
64
64
  image: string;
65
65
  uploadImage: string;
66
+ uploadLocalImage: string;
66
67
  onlineLibrary: string;
67
68
  insertLine: string;
68
69
  line: string;
@@ -1,5 +1,5 @@
1
1
  import { InjectionKey, Ref } from 'vue';
2
- import { SaveCallbackParams, UploadFileParams } from './lt-ppt';
2
+ import { CustomImageSource, SaveCallbackParams, UploadFileParams } from './lt-ppt';
3
3
  export type SlideScale = Ref<number>;
4
4
  export type SlideId = Ref<string>;
5
5
  export type RadioGroupValue = {
@@ -17,9 +17,14 @@ export interface PresentationSaveBridge {
17
17
  waitUntilReady: () => Promise<void>;
18
18
  markReady: () => void;
19
19
  }
20
+ export interface CustomImageSourcesContext {
21
+ sources: Readonly<Ref<readonly CustomImageSource[]>>;
22
+ select: (source: CustomImageSource) => void | Promise<void>;
23
+ }
20
24
  export type PresentationSaveHandler = () => Promise<void>;
21
25
  export declare const injectKeySlideScale: InjectionKey<SlideScale>;
22
26
  export declare const injectKeySlideId: InjectionKey<SlideId>;
23
27
  export declare const injectKeyRadioGroupValue: InjectionKey<RadioGroupValue>;
28
+ export declare const injectKeyCustomImageSources: InjectionKey<CustomImageSourcesContext>;
24
29
  export declare const injectKeyPresentationSave: InjectionKey<PresentationSaveBridge>;
25
30
  export declare const injectKeyPresentationSaveHandler: InjectionKey<PresentationSaveHandler>;
@@ -14,6 +14,12 @@ export interface UploadFileParams {
14
14
  /** base64 字符串 */
15
15
  base64?: string;
16
16
  }
17
+ export interface CustomImageSource {
18
+ /** 展示在图片来源菜单中的名称 */
19
+ name: string;
20
+ /** 接入方定义的唯一标识 */
21
+ key: string;
22
+ }
17
23
  export interface SaveCallbackParams {
18
24
  /** PPTX 文件 URL */
19
25
  pptUrl: string;
@@ -129,6 +135,10 @@ export interface LtPPTProps {
129
135
  initData?: InitData;
130
136
  /** 文件上传方法,接受包含 file 或 base64 的对象,返回资源的网络链接 */
131
137
  onUploadFile?: (params: UploadFileParams) => Promise<string>;
138
+ /** 自定义图片来源;非空时图片按钮展示来源菜单 */
139
+ customImageSources?: readonly CustomImageSource[];
140
+ /** 用户选择自定义图片来源时调用 */
141
+ onCustomImageSourceSelect?: (source: CustomImageSource) => void | Promise<void>;
132
142
  /** 幻灯片内容变更回调 */
133
143
  onChange?: (slides: Slide[]) => void;
134
144
  /** 保存回调 */
@@ -0,0 +1,24 @@
1
+ type __VLS_Props = {
2
+ offset?: number;
3
+ };
4
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
5
+ change: (payload: FileList) => any;
6
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
7
+ onChange?: ((payload: FileList) => any) | undefined;
8
+ }>, {
9
+ offset: number;
10
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>, Readonly<{
11
+ default(props: {
12
+ menuEnabled: boolean;
13
+ }): unknown;
14
+ }> & {
15
+ default(props: {
16
+ menuEnabled: boolean;
17
+ }): unknown;
18
+ }>;
19
+ export default _default;
20
+ type __VLS_WithTemplateSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };
@@ -3,8 +3,8 @@ var iA = (e, r, t) => r in e ? aA(e, r, { enumerable: !0, configurable: !0, writ
3
3
  var ft = (e, r, t) => iA(e, typeof r != "symbol" ? r + "" : r, t);
4
4
  import { markRaw as ma, openBlock as nt, createElementBlock as gt, createElementVNode as Re, defineComponent as vi, ref as vl, onBeforeMount as oA, onMounted as sA, createBlock as Yr, Transition as lA, withCtx as cA, createCommentVNode as Lr, toDisplayString as q0, createVNode as po, render as ra, normalizeStyle as na, computed as Tt, Fragment as X0, renderList as j0, unref as Xr, normalizeClass as fA } from "vue";
5
5
  import { storeToRefs as Bu } from "./pinia-CVat9nJz.js";
6
- import { g as $l, a as Be, b as uA, _ as e0, l as gl } from "./lib-BbZgyBtw.js";
7
- import { a as Du } from "./database-cQQ-a-Yz.js";
6
+ import { g as $l, a as Be, b as uA, _ as e0, l as gl } from "./lib-C6hhLFWJ.js";
7
+ import { a as Du } from "./database-DdqchTdA.js";
8
8
  import { nanoid as xl } from "./index.browser-Wq18ov6h.js";
9
9
  function Ia(e) {
10
10
  throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lt-ppt",
3
- "version": "1.0.42",
3
+ "version": "1.0.44",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/lt-ppt.umd.js",