@lofcz/pptist 2.0.17 → 2.0.19
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 +18 -13
- package/dist/embed/agentic-manifest.json +3 -3
- package/dist/embed/fonts/LXGWNeoXiHei.woff2 +0 -0
- package/dist/embed/fonts/LXGWNeoZhiSong.woff2 +0 -0
- package/dist/embed/fonts/Lato.woff2 +0 -0
- package/dist/embed/mocks/slides.json +332 -179
- package/dist/embed/mocks/template_8.json +1 -1
- package/dist/embed/pptist-embed.css +1 -1
- package/dist/embed/pptist-embed.js +19643 -19482
- package/dist/types/configs/exportTabs.d.ts +11 -0
- package/dist/types/configs/font.d.ts +3 -0
- package/dist/types/embed/index.d.ts +1 -0
- package/dist/types/embed/types.d.ts +6 -0
- package/dist/types/i18n/i18n-types.d.ts +24 -0
- package/dist/types/store/main.d.ts +4 -0
- package/dist/types/store/slides.d.ts +8 -0
- package/dist/types/types/slides.d.ts +6 -0
- package/dist/types/utils/element.d.ts +2 -0
- package/dist/types/utils/font.d.ts +1 -0
- package/docs/EMBED.md +18 -0
- package/package.json +1 -1
- package/dist/embed/fonts/CangerXiaowanzi.woff2 +0 -0
- package/dist/embed/fonts/FengguangMingrui.woff2 +0 -0
- package/dist/embed/fonts/RuiziZhenyan.woff2 +0 -0
- package/dist/embed/fonts/ShetuModernSquare.woff2 +0 -0
- package/dist/embed/fonts/SucaiJishiCoolSquare.woff2 +0 -0
- package/dist/embed/fonts/SucaiJishiKangkang.woff2 +0 -0
- package/dist/embed/fonts/TuniuRounded.woff2 +0 -0
- package/dist/embed/fonts/YousheTitleBlack.woff2 +0 -0
- package/dist/embed/fonts/ZcoolHappy.woff2 +0 -0
- package/dist/embed/fonts/ZizhiQuXiMai.woff2 +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DialogForExportTypes } from '../types/export';
|
|
2
|
+
/** Non-empty export dialog tab ids. */
|
|
3
|
+
export type ExportTabId = Exclude<DialogForExportTypes, ''>;
|
|
4
|
+
export type PptistExportTabsConfig = Partial<Record<ExportTabId, boolean>>;
|
|
5
|
+
/** Configure which export dialog tabs are available in an embedded host. Omitted keys stay enabled. */
|
|
6
|
+
export declare function setPptistExportTabs(config?: PptistExportTabsConfig): void;
|
|
7
|
+
export declare function getPptistExportTabs(): Readonly<Record<ExportTabId, boolean>>;
|
|
8
|
+
export declare function isExportTabEnabled(tab: ExportTabId): boolean;
|
|
9
|
+
export declare function getEnabledExportTabs(): ExportTabId[];
|
|
10
|
+
/** Resolve a requested export tab to an enabled one, or close the dialog when none are enabled. */
|
|
11
|
+
export declare function resolveExportDialogType(type: DialogForExportTypes): DialogForExportTypes;
|
|
@@ -2,6 +2,9 @@ export interface FontOption {
|
|
|
2
2
|
label: string;
|
|
3
3
|
value: string;
|
|
4
4
|
}
|
|
5
|
+
export declare const FONT_VALUES: readonly ["", "SourceHanSans", "SourceHanSerif", "WenDingPLKaiTi", "WenDingPLSongTi", "ZhuqueFangSong", "LXGWWenKai", "LXGWNeoZhiSong", "LXGWNeoXiHei", "AlibabaPuHuiTi", "MiSans", "DeYiHei", "SourceSerif4", "JetBrainsMono", "Literata", "Inter", "Roboto", "OpenSans", "Montserrat", "SourceSansPro", "Merriweather", "Lato"];
|
|
5
6
|
export declare const EASTERN_EXTRAS_FONT_VALUES: string[];
|
|
7
|
+
/** @deprecated Use FONT_VALUES — kept for loadGoogleFonts preset detection */
|
|
8
|
+
export declare const FONTS: FontOption[];
|
|
6
9
|
export declare function getFonts(): FontOption[];
|
|
7
10
|
export declare function useFonts(): import("vue").ComputedRef<FontOption[]>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { mountPptist, unmountPptist } from './mount';
|
|
2
2
|
export type { PptistController, PptistDocument, PptistMountOptions, PptistMountResult, PptistDocumentLoader, PptistStarterPresentationOptions, PptistTemplateLoader, PptistTemplatePayload, } from './types';
|
|
3
|
+
export type { ExportTabId, PptistExportTabsConfig } from '../configs/exportTabs';
|
|
3
4
|
export type * from './agentic/types';
|
|
4
5
|
export type { Locales as PptistLocales } from '../i18n/locale';
|
|
5
6
|
export type { ChartData, ChartOptions, ChartType, Note, NoteReply, PPTAnimation, PPTAudioElement, PPTChartElement, PPTElement, PPTElementLink, PPTImageElement, PPTLatexElement, PPTLineElement, PPTShapeElement, PPTTableElement, PPTTextElement, PPTVideoElement, ShapeText, Slide, SlideBackground, SlideTemplate, SlideTheme, TableCell, TableCellStyle, TextAlign, TurningMode, } from '../types/slides';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PptistExportTabsConfig } from '../configs/exportTabs';
|
|
1
2
|
import type { Locales } from '../i18n/locale';
|
|
2
3
|
import type { Slide, SlideTheme, SlideTemplate } from '../types/slides';
|
|
3
4
|
import type { PptistAgentApi, PptistSlideReference } from './agentic/types';
|
|
@@ -58,6 +59,11 @@ export interface PptistMountOptions {
|
|
|
58
59
|
onChangeDebounceMs?: number;
|
|
59
60
|
/** Fired when PPTist enters or exits slideshow/presentation mode. */
|
|
60
61
|
onPresentationModeChange?: (screening: boolean) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Toggle export dialog tabs (`pptx`, `image`, `json`, `pdf`, `pptist`).
|
|
64
|
+
* Omitted keys stay enabled. The `pptist` tab also requires `PPTIST_EXTRAS_ENABLED=true` at build time.
|
|
65
|
+
*/
|
|
66
|
+
exportTabs?: PptistExportTabsConfig;
|
|
61
67
|
}
|
|
62
68
|
/** Public embed controller: legacy host methods plus the generic command and domain APIs. */
|
|
63
69
|
export interface PptistController extends PptistAgentApi {
|
|
@@ -1796,6 +1796,14 @@ export type NamespaceConfigsTranslation = {
|
|
|
1796
1796
|
* LXGW WenKai
|
|
1797
1797
|
*/
|
|
1798
1798
|
lxgwwenKai: string;
|
|
1799
|
+
/**
|
|
1800
|
+
* LXGW Neo ZhiSong
|
|
1801
|
+
*/
|
|
1802
|
+
lxgwNeoZhiSong: string;
|
|
1803
|
+
/**
|
|
1804
|
+
* LXGW Neo XiHei
|
|
1805
|
+
*/
|
|
1806
|
+
lxgwNeoXiHei: string;
|
|
1799
1807
|
/**
|
|
1800
1808
|
* Alibaba PuHuiTi
|
|
1801
1809
|
*/
|
|
@@ -1884,6 +1892,10 @@ export type NamespaceConfigsTranslation = {
|
|
|
1884
1892
|
* Merriweather
|
|
1885
1893
|
*/
|
|
1886
1894
|
merriweather: string;
|
|
1895
|
+
/**
|
|
1896
|
+
* Lato
|
|
1897
|
+
*/
|
|
1898
|
+
lato: string;
|
|
1887
1899
|
};
|
|
1888
1900
|
};
|
|
1889
1901
|
export type NamespaceEditorTranslation = {
|
|
@@ -6373,6 +6385,14 @@ export type TranslationFunctions = {
|
|
|
6373
6385
|
* LXGW WenKai
|
|
6374
6386
|
*/
|
|
6375
6387
|
lxgwwenKai: () => LocalizedString;
|
|
6388
|
+
/**
|
|
6389
|
+
* LXGW Neo ZhiSong
|
|
6390
|
+
*/
|
|
6391
|
+
lxgwNeoZhiSong: () => LocalizedString;
|
|
6392
|
+
/**
|
|
6393
|
+
* LXGW Neo XiHei
|
|
6394
|
+
*/
|
|
6395
|
+
lxgwNeoXiHei: () => LocalizedString;
|
|
6376
6396
|
/**
|
|
6377
6397
|
* Alibaba PuHuiTi
|
|
6378
6398
|
*/
|
|
@@ -6461,6 +6481,10 @@ export type TranslationFunctions = {
|
|
|
6461
6481
|
* Merriweather
|
|
6462
6482
|
*/
|
|
6463
6483
|
merriweather: () => LocalizedString;
|
|
6484
|
+
/**
|
|
6485
|
+
* Lato
|
|
6486
|
+
*/
|
|
6487
|
+
lato: () => LocalizedString;
|
|
6464
6488
|
};
|
|
6465
6489
|
};
|
|
6466
6490
|
editor: {
|
|
@@ -176,6 +176,8 @@ export declare const useMainStore: import("pinia").StoreDefinition<"main", MainS
|
|
|
176
176
|
vertical?: boolean | undefined;
|
|
177
177
|
textType?: import("../types/slides").TextType | undefined;
|
|
178
178
|
inset?: [number, number, number, number] | undefined;
|
|
179
|
+
fixedHeight?: boolean | undefined;
|
|
180
|
+
vAlign?: import("../types/slides").TextAlignVertical | undefined;
|
|
179
181
|
id: string;
|
|
180
182
|
left: number;
|
|
181
183
|
top: number;
|
|
@@ -603,6 +605,8 @@ export declare const useMainStore: import("pinia").StoreDefinition<"main", MainS
|
|
|
603
605
|
vertical?: boolean | undefined;
|
|
604
606
|
textType?: import("../types/slides").TextType | undefined;
|
|
605
607
|
inset?: [number, number, number, number] | undefined;
|
|
608
|
+
fixedHeight?: boolean | undefined;
|
|
609
|
+
vAlign?: import("../types/slides").TextAlignVertical | undefined;
|
|
606
610
|
id: string;
|
|
607
611
|
left: number;
|
|
608
612
|
top: number;
|
|
@@ -73,6 +73,8 @@ export declare const useSlidesStore: import("pinia").StoreDefinition<"slides", S
|
|
|
73
73
|
vertical?: boolean | undefined;
|
|
74
74
|
textType?: import("../types/slides").TextType | undefined;
|
|
75
75
|
inset?: [number, number, number, number] | undefined;
|
|
76
|
+
fixedHeight?: boolean | undefined;
|
|
77
|
+
vAlign?: import("../types/slides").TextAlignVertical | undefined;
|
|
76
78
|
id: string;
|
|
77
79
|
left: number;
|
|
78
80
|
top: number;
|
|
@@ -446,6 +448,8 @@ export declare const useSlidesStore: import("pinia").StoreDefinition<"slides", S
|
|
|
446
448
|
vertical?: boolean | undefined;
|
|
447
449
|
textType?: import("../types/slides").TextType | undefined;
|
|
448
450
|
inset?: [number, number, number, number] | undefined;
|
|
451
|
+
fixedHeight?: boolean | undefined;
|
|
452
|
+
vAlign?: import("../types/slides").TextAlignVertical | undefined;
|
|
449
453
|
id: string;
|
|
450
454
|
left: number;
|
|
451
455
|
top: number;
|
|
@@ -830,6 +834,8 @@ export declare const useSlidesStore: import("pinia").StoreDefinition<"slides", S
|
|
|
830
834
|
vertical?: boolean | undefined;
|
|
831
835
|
textType?: import("../types/slides").TextType | undefined;
|
|
832
836
|
inset?: [number, number, number, number] | undefined;
|
|
837
|
+
fixedHeight?: boolean | undefined;
|
|
838
|
+
vAlign?: import("../types/slides").TextAlignVertical | undefined;
|
|
833
839
|
id: string;
|
|
834
840
|
left: number;
|
|
835
841
|
top: number;
|
|
@@ -1231,6 +1237,8 @@ export declare const useSlidesStore: import("pinia").StoreDefinition<"slides", S
|
|
|
1231
1237
|
vertical?: boolean | undefined;
|
|
1232
1238
|
textType?: import("../types/slides").TextType | undefined;
|
|
1233
1239
|
inset?: [number, number, number, number] | undefined;
|
|
1240
|
+
fixedHeight?: boolean | undefined;
|
|
1241
|
+
vAlign?: import("../types/slides").TextAlignVertical | undefined;
|
|
1234
1242
|
id: string;
|
|
1235
1243
|
left: number;
|
|
1236
1244
|
top: number;
|
|
@@ -164,6 +164,10 @@ export type TextInset = [number, number, number, number];
|
|
|
164
164
|
* textType?: 文本类型
|
|
165
165
|
*
|
|
166
166
|
* inset?: 内边距(上、右、下、左),默认[10, 10, 10, 10]
|
|
167
|
+
*
|
|
168
|
+
* fixedHeight?: 固定文本框自适应轴尺寸,横排文本固定高度,竖排文本固定宽度
|
|
169
|
+
*
|
|
170
|
+
* vAlign?: 文本框内垂直对齐方向,仅fixedHeight为真时有效,默认top
|
|
167
171
|
*/
|
|
168
172
|
export interface PPTTextElement extends PPTBaseElement {
|
|
169
173
|
type: 'text';
|
|
@@ -184,6 +188,8 @@ export interface PPTTextElement extends PPTBaseElement {
|
|
|
184
188
|
vertical?: boolean;
|
|
185
189
|
textType?: TextType;
|
|
186
190
|
inset?: TextInset;
|
|
191
|
+
fixedHeight?: boolean;
|
|
192
|
+
vAlign?: TextAlignVertical;
|
|
187
193
|
}
|
|
188
194
|
/**
|
|
189
195
|
* 图片翻转、形状翻转
|
|
@@ -105,6 +105,8 @@ export declare const rotateRectLikeElement: (element: Exclude<PPTElement, PPTLin
|
|
|
105
105
|
vertical?: boolean;
|
|
106
106
|
textType?: import("../types/slides").TextType;
|
|
107
107
|
inset?: import("../types/slides").TextInset;
|
|
108
|
+
fixedHeight?: boolean;
|
|
109
|
+
vAlign?: import("../types/slides").TextAlignVertical;
|
|
108
110
|
id: string;
|
|
109
111
|
lock?: boolean;
|
|
110
112
|
groupId?: string;
|
package/docs/EMBED.md
CHANGED
|
@@ -216,6 +216,24 @@ const result = await controller.execute<PptistDocument>({ type: 'export.json' })
|
|
|
216
216
|
|
|
217
217
|
`export.json()` and the `export.json` command return the serializable `PptistDocument` model and do not require the editor DOM. PDF, PPTX, and image exports depend on rendered slide DOM, browser canvas/image loading, and the existing export dialogs/hooks, so they are intentionally outside the agentic bridge. Hosts that need those formats should drive PPTist's UI/export workflow in a browser context or add a dedicated DOM-aware integration boundary.
|
|
218
218
|
|
|
219
|
+
### Export dialog tabs
|
|
220
|
+
|
|
221
|
+
Hosts can hide export formats they do not want to expose. Pass `exportTabs` to `mountPptist()`; omitted keys stay enabled. The native `.pptist` tab also requires `PPTIST_EXTRAS_ENABLED=true` at build time.
|
|
222
|
+
|
|
223
|
+
```ts
|
|
224
|
+
await mountPptist(host, {
|
|
225
|
+
exportTabs: {
|
|
226
|
+
pptx: true,
|
|
227
|
+
image: false,
|
|
228
|
+
json: false,
|
|
229
|
+
pdf: false,
|
|
230
|
+
pptist: false,
|
|
231
|
+
},
|
|
232
|
+
})
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
When only one tab is enabled, the tab bar is hidden and the export dialog opens directly to that format.
|
|
236
|
+
|
|
219
237
|
## sciobot-next wiring
|
|
220
238
|
|
|
221
239
|
1. **package.json** — `"@lofcz/pptist": "^2.0.0"` after the package is published. During local development, sciobot's Vite config can fall back to the sibling `../PPTist/dist/embed` build.
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|