@lofcz/pptist 2.0.16 → 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/README.md +14 -7
- package/dist/embed/agentic-manifest.json +12 -8
- package/dist/embed/pptist-embed.css +1 -1
- package/dist/embed/pptist-embed.js +21387 -20106
- package/dist/types/configs/exportTabs.d.ts +11 -0
- package/dist/types/embed/agentic/layouts.d.ts +1 -1
- package/dist/types/embed/agentic/types.d.ts +2 -0
- package/dist/types/embed/index.d.ts +1 -0
- package/dist/types/embed/types.d.ts +6 -0
- package/dist/types/hooks/useExport.d.ts +1 -1
- package/dist/types/i18n/i18n-types.d.ts +82 -2
- package/dist/types/utils/emitter.d.ts +7 -0
- package/dist/types/utils/markdown.d.ts +34 -3
- package/dist/types/views/Editor/CanvasTool/SVGPathEditor.vue.d.ts +9 -0
- package/dist/types/views/components/element/TableElement/EditableTable.vue.d.ts +1 -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;
|
|
@@ -20,7 +20,7 @@ export type PptistLayoutBackgroundMode = 'auto' | 'feature' | 'plain';
|
|
|
20
20
|
export interface PptistLayoutSlotDef {
|
|
21
21
|
name: string;
|
|
22
22
|
/** Coarse shape of the value the agent should pass for this slot. */
|
|
23
|
-
type: 'text' | 'bullets' | 'image' | 'chart' | 'stats' | 'rows';
|
|
23
|
+
type: 'text' | 'bullets' | 'image' | 'chart' | 'stats' | 'rows' | 'cards' | 'steps';
|
|
24
24
|
required: boolean;
|
|
25
25
|
description: string;
|
|
26
26
|
}
|
|
@@ -472,6 +472,8 @@ export interface PptistCreateFromLayoutInput {
|
|
|
472
472
|
export interface PptistCreateFromLayoutResult {
|
|
473
473
|
slideId: string;
|
|
474
474
|
layoutId: string;
|
|
475
|
+
/** True when this slide replaced the deck's lone pristine blank starter. */
|
|
476
|
+
replacedStarter?: boolean;
|
|
475
477
|
elementIds: string[];
|
|
476
478
|
textElementIds: string[];
|
|
477
479
|
}
|
|
@@ -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 {
|
|
@@ -5,6 +5,6 @@ declare const _default: () => {
|
|
|
5
5
|
exportImagePPTX: (domRefs: NodeListOf<Element>) => void;
|
|
6
6
|
exportJSON: () => void;
|
|
7
7
|
exportSpecificFile: (_slides: Slide[]) => void;
|
|
8
|
-
exportPPTX: (_slides: Slide[], masterOverwrite: boolean, ignoreMedia: boolean) => void
|
|
8
|
+
exportPPTX: (_slides: Slide[], masterOverwrite: boolean, ignoreMedia: boolean) => Promise<void>;
|
|
9
9
|
};
|
|
10
10
|
export default _default;
|
|
@@ -2157,6 +2157,10 @@ export type NamespaceEditorTranslation = {
|
|
|
2157
2157
|
* Preset shapes
|
|
2158
2158
|
*/
|
|
2159
2159
|
presetShapes: string;
|
|
2160
|
+
/**
|
|
2161
|
+
* Path draw
|
|
2162
|
+
*/
|
|
2163
|
+
pathDraw: string;
|
|
2160
2164
|
/**
|
|
2161
2165
|
* Free draw
|
|
2162
2166
|
*/
|
|
@@ -3120,6 +3124,38 @@ export type NamespaceEditorTranslation = {
|
|
|
3120
3124
|
* Columns:
|
|
3121
3125
|
*/
|
|
3122
3126
|
columns: string;
|
|
3127
|
+
/**
|
|
3128
|
+
* Add row
|
|
3129
|
+
*/
|
|
3130
|
+
addRow: string;
|
|
3131
|
+
/**
|
|
3132
|
+
* Add above
|
|
3133
|
+
*/
|
|
3134
|
+
addAbove: string;
|
|
3135
|
+
/**
|
|
3136
|
+
* Add below
|
|
3137
|
+
*/
|
|
3138
|
+
addBelow: string;
|
|
3139
|
+
/**
|
|
3140
|
+
* Delete row
|
|
3141
|
+
*/
|
|
3142
|
+
deleteRow: string;
|
|
3143
|
+
/**
|
|
3144
|
+
* Add column
|
|
3145
|
+
*/
|
|
3146
|
+
addColumn: string;
|
|
3147
|
+
/**
|
|
3148
|
+
* Add left
|
|
3149
|
+
*/
|
|
3150
|
+
addLeft: string;
|
|
3151
|
+
/**
|
|
3152
|
+
* Add right
|
|
3153
|
+
*/
|
|
3154
|
+
addRight: string;
|
|
3155
|
+
/**
|
|
3156
|
+
* Delete column
|
|
3157
|
+
*/
|
|
3158
|
+
deleteColumn: string;
|
|
3123
3159
|
/**
|
|
3124
3160
|
* Enable themed table:
|
|
3125
3161
|
*/
|
|
@@ -3995,6 +4031,10 @@ export type NamespaceExportTranslation = {
|
|
|
3995
4031
|
* Export failed
|
|
3996
4032
|
*/
|
|
3997
4033
|
exportFailed: string;
|
|
4034
|
+
/**
|
|
4035
|
+
* Export finished, but some media could not be embedded
|
|
4036
|
+
*/
|
|
4037
|
+
exportPartial: string;
|
|
3998
4038
|
/**
|
|
3999
4039
|
* Series {index}
|
|
4000
4040
|
* @param {number} index
|
|
@@ -4098,7 +4138,7 @@ export type NamespaceExportTranslation = {
|
|
|
4098
4138
|
*/
|
|
4099
4139
|
overwriteMaster: string;
|
|
4100
4140
|
/**
|
|
4101
|
-
* Tip: 1. Supported formats: avi, mp4, mov, wmv, mp3, wav; 2.
|
|
4141
|
+
* Tip: 1. Supported formats: avi, mp4, mov, wmv, mp3, wav; 2. Media from other origins is fetched in your browser before export — if a source blocks the fetch, it will be skipped.
|
|
4102
4142
|
*/
|
|
4103
4143
|
mediaExportTip: string;
|
|
4104
4144
|
/**
|
|
@@ -6695,6 +6735,10 @@ export type TranslationFunctions = {
|
|
|
6695
6735
|
* Preset shapes
|
|
6696
6736
|
*/
|
|
6697
6737
|
presetShapes: () => LocalizedString;
|
|
6738
|
+
/**
|
|
6739
|
+
* Path draw
|
|
6740
|
+
*/
|
|
6741
|
+
pathDraw: () => LocalizedString;
|
|
6698
6742
|
/**
|
|
6699
6743
|
* Free draw
|
|
6700
6744
|
*/
|
|
@@ -7664,6 +7708,38 @@ export type TranslationFunctions = {
|
|
|
7664
7708
|
* Columns:
|
|
7665
7709
|
*/
|
|
7666
7710
|
columns: () => LocalizedString;
|
|
7711
|
+
/**
|
|
7712
|
+
* Add row
|
|
7713
|
+
*/
|
|
7714
|
+
addRow: () => LocalizedString;
|
|
7715
|
+
/**
|
|
7716
|
+
* Add above
|
|
7717
|
+
*/
|
|
7718
|
+
addAbove: () => LocalizedString;
|
|
7719
|
+
/**
|
|
7720
|
+
* Add below
|
|
7721
|
+
*/
|
|
7722
|
+
addBelow: () => LocalizedString;
|
|
7723
|
+
/**
|
|
7724
|
+
* Delete row
|
|
7725
|
+
*/
|
|
7726
|
+
deleteRow: () => LocalizedString;
|
|
7727
|
+
/**
|
|
7728
|
+
* Add column
|
|
7729
|
+
*/
|
|
7730
|
+
addColumn: () => LocalizedString;
|
|
7731
|
+
/**
|
|
7732
|
+
* Add left
|
|
7733
|
+
*/
|
|
7734
|
+
addLeft: () => LocalizedString;
|
|
7735
|
+
/**
|
|
7736
|
+
* Add right
|
|
7737
|
+
*/
|
|
7738
|
+
addRight: () => LocalizedString;
|
|
7739
|
+
/**
|
|
7740
|
+
* Delete column
|
|
7741
|
+
*/
|
|
7742
|
+
deleteColumn: () => LocalizedString;
|
|
7667
7743
|
/**
|
|
7668
7744
|
* Enable themed table:
|
|
7669
7745
|
*/
|
|
@@ -8545,6 +8621,10 @@ export type TranslationFunctions = {
|
|
|
8545
8621
|
* Export failed
|
|
8546
8622
|
*/
|
|
8547
8623
|
exportFailed: () => LocalizedString;
|
|
8624
|
+
/**
|
|
8625
|
+
* Export finished, but some media could not be embedded
|
|
8626
|
+
*/
|
|
8627
|
+
exportPartial: () => LocalizedString;
|
|
8548
8628
|
/**
|
|
8549
8629
|
* Series {index}
|
|
8550
8630
|
*/
|
|
@@ -8650,7 +8730,7 @@ export type TranslationFunctions = {
|
|
|
8650
8730
|
*/
|
|
8651
8731
|
overwriteMaster: () => LocalizedString;
|
|
8652
8732
|
/**
|
|
8653
|
-
* Tip: 1. Supported formats: avi, mp4, mov, wmv, mp3, wav; 2.
|
|
8733
|
+
* Tip: 1. Supported formats: avi, mp4, mov, wmv, mp3, wav; 2. Media from other origins is fetched in your browser before export — if a source blocks the fetch, it will be skipped.
|
|
8654
8734
|
*/
|
|
8655
8735
|
mediaExportTip: () => LocalizedString;
|
|
8656
8736
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Emitter } from 'mitt';
|
|
2
2
|
export declare const enum EmitterEvents {
|
|
3
3
|
RICH_TEXT_COMMAND = "RICH_TEXT_COMMAND",
|
|
4
|
+
TABLE_COMMAND = "TABLE_COMMAND",
|
|
4
5
|
SYNC_RICH_TEXT_ATTRS_TO_STORE = "SYNC_RICH_TEXT_ATTRS_TO_STORE",
|
|
5
6
|
OPEN_CHART_DATA_EDITOR = "OPEN_CHART_DATA_EDITOR",
|
|
6
7
|
OPEN_LATEX_EDITOR = "OPEN_LATEX_EDITOR"
|
|
@@ -13,8 +14,14 @@ export interface RichTextCommand {
|
|
|
13
14
|
target?: string;
|
|
14
15
|
action: RichTextAction | RichTextAction[];
|
|
15
16
|
}
|
|
17
|
+
export interface TableCommand {
|
|
18
|
+
targetId: string;
|
|
19
|
+
command: 'insert-row' | 'insert-col' | 'delete-row' | 'delete-col';
|
|
20
|
+
position?: 'before' | 'after';
|
|
21
|
+
}
|
|
16
22
|
type Events = {
|
|
17
23
|
[EmitterEvents.RICH_TEXT_COMMAND]: RichTextCommand;
|
|
24
|
+
[EmitterEvents.TABLE_COMMAND]: TableCommand;
|
|
18
25
|
[EmitterEvents.SYNC_RICH_TEXT_ATTRS_TO_STORE]: void;
|
|
19
26
|
[EmitterEvents.OPEN_CHART_DATA_EDITOR]: void;
|
|
20
27
|
[EmitterEvents.OPEN_LATEX_EDITOR]: void;
|
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
/** True when a string carries math delimiters the math parser should handle. */
|
|
2
2
|
export declare function containsMath(source: string): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* A run of either plain text or a single math span, in source order. `raw` is
|
|
5
|
+
* the exact source slice (delimiters included for math); `value` is the inner
|
|
6
|
+
* formula for math (delimiters stripped) and equals `raw` for text.
|
|
7
|
+
*/
|
|
8
|
+
export interface ContentSegment {
|
|
9
|
+
type: 'text' | 'math';
|
|
10
|
+
raw: string;
|
|
11
|
+
value: string;
|
|
12
|
+
/** Math only: display (block) vs inline. */
|
|
13
|
+
display: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Split `source` into ordered text and math segments. This is the robust core
|
|
17
|
+
* behind both line-splitting and inline rendering: it scans once, picking the
|
|
18
|
+
* earliest opener at each position (longest on ties, so `$$` beats `$`), honors
|
|
19
|
+
* backslash escapes (`\$`, `\\`), skips inline code spans (so `` `$x` `` is not
|
|
20
|
+
* read as math) and keeps unterminated openers as literal text (graceful for
|
|
21
|
+
* partial/streamed content). Inline math may not span newlines; display math
|
|
22
|
+
* (`$$`, `\[`, `\begin{}`) may.
|
|
23
|
+
*/
|
|
24
|
+
export declare function tokenizeMath(source: string): ContentSegment[];
|
|
25
|
+
export declare function splitLinesPreservingMath(value: string): string[];
|
|
3
26
|
export declare function markdownToHtml(markdown: string): Promise<string>;
|
|
4
27
|
/**
|
|
5
28
|
* Preload the math-capable markdown parser (lazy KaTeX + texmath) so
|
|
@@ -9,8 +32,16 @@ export declare function markdownToHtml(markdown: string): Promise<string>;
|
|
|
9
32
|
export declare function ensureInlineMathReady(): Promise<void>;
|
|
10
33
|
/**
|
|
11
34
|
* Render one line of markdown to inline HTML (no `<p>` wrapper) using the same
|
|
12
|
-
* CommonMark + texmath pipeline as {@link markdownToHtml}.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
35
|
+
* CommonMark + texmath pipeline as {@link markdownToHtml}.
|
|
36
|
+
*
|
|
37
|
+
* Plain (math-free) lines use markdown-it's inline renderer directly. Lines that
|
|
38
|
+
* carry math are rendered through the full *block* pipeline and then unwrapped
|
|
39
|
+
* from their single `<p>`: this is what makes display math correct. texmath
|
|
40
|
+
* exposes `\[…\]` and `\begin{env}…\end{env}` only as block rules, so the inline
|
|
41
|
+
* renderer would emit them verbatim; routing through the block parser renders
|
|
42
|
+
* every delimiter (`$…$`, `$$…$$`, `\(…\)`, `\[…\]`, environments), and matches
|
|
43
|
+
* the `text.setMarkdown` output byte-for-byte. Math renders only when the parser
|
|
44
|
+
* has been preloaded via {@link ensureInlineMathReady}; otherwise delimiters
|
|
45
|
+
* read as literal text.
|
|
15
46
|
*/
|
|
16
47
|
export declare function renderInlineMarkdown(markdown: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
2
|
+
close: () => any;
|
|
3
|
+
insert: (path: string) => any;
|
|
4
|
+
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
5
|
+
onClose?: (() => any) | undefined;
|
|
6
|
+
onInsert?: ((path: string) => any) | undefined;
|
|
7
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
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.
|