@lofcz/pptist 2.0.17 → 2.0.18
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/embed/agentic-manifest.json +2 -2
- package/dist/embed/pptist-embed.css +1 -1
- package/dist/embed/pptist-embed.js +16932 -16901
- package/dist/types/configs/exportTabs.d.ts +11 -0
- package/dist/types/embed/index.d.ts +1 -0
- package/dist/types/embed/types.d.ts +6 -0
- package/docs/EMBED.md +18 -0
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -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 {
|
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.
|