@lofcz/pptist 2.0.14 → 2.0.16
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 +7 -7
- package/dist/embed/pptist-embed.js +12060 -12028
- package/dist/types/embed/agentic/helpers.d.ts +16 -0
- package/dist/types/embed/agentic/layouts.d.ts +4 -1
- package/dist/types/embed/agentic/types.d.ts +1 -1
- package/dist/types/embed/mount.d.ts +1 -1
- package/dist/types/embed/types.d.ts +2 -2
- package/dist/types/i18n/locale.d.ts +1 -1
- package/dist/types/i18n/useI18nContext.d.ts +1 -1
- package/dist/types/utils/markdown.d.ts +15 -0
- package/package.json +1 -1
|
@@ -78,6 +78,22 @@ export declare function normalizeAudioPatch(patch: PptistAudioElementPatch): Par
|
|
|
78
78
|
export declare function resolveShapeFormula(element: PPTShapeElement): PPTShapeElement;
|
|
79
79
|
export declare function normalizeShapeElement(element?: Partial<PPTShapeElement>): PPTShapeElement;
|
|
80
80
|
export declare function mergeShapeElement(base: PPTShapeElement, patch: Partial<PPTShapeElement>): PPTShapeElement;
|
|
81
|
+
export interface LatexGeometry {
|
|
82
|
+
path: string;
|
|
83
|
+
viewBox: [number, number];
|
|
84
|
+
width: number;
|
|
85
|
+
height: number;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Render a LaTeX formula to its SVG path + intrinsic box via hfmath — the EXACT
|
|
89
|
+
* pipeline the interactive LaTeXEditor uses (`new hfmath(latex).pathd()/box()`).
|
|
90
|
+
*
|
|
91
|
+
* The agent supplies only the `latex` string; it cannot pre-compute the SVG
|
|
92
|
+
* `path`. Without a path the `<svg>` renders nothing, so a "latex" element from
|
|
93
|
+
* the agent shows up blank. Deriving the path here makes agent-authored formulas
|
|
94
|
+
* render identically to ones drawn through the editor UI.
|
|
95
|
+
*/
|
|
96
|
+
export declare function deriveLatexGeometry(latex: string): LatexGeometry;
|
|
81
97
|
export declare function normalizeLatexElement(element: PptistLatexElementInput): PPTLatexElement;
|
|
82
98
|
export declare function normalizeLineElement(element: Partial<PPTLineElement> & {
|
|
83
99
|
type?: 'line';
|
|
@@ -48,9 +48,12 @@ export interface PptistLayoutBuildResult {
|
|
|
48
48
|
* non-fatal warnings (e.g. a missing optional image). Text is auto-fit to each
|
|
49
49
|
* box via pretext, so content never overflows. Throws on missing required slots
|
|
50
50
|
* or an unknown layout.
|
|
51
|
+
*
|
|
52
|
+
* Async because slots may carry inline math; KaTeX is lazy-loaded up front (only
|
|
53
|
+
* when math is present) so the otherwise-synchronous builders can render it.
|
|
51
54
|
*/
|
|
52
55
|
export declare function buildLayoutSlide(layoutId: string, slots: Slots, preset: PptistStylePreset, viewport: {
|
|
53
56
|
width: number;
|
|
54
57
|
height: number;
|
|
55
|
-
}, backgroundMode?: PptistLayoutBackgroundMode): PptistLayoutBuildResult
|
|
58
|
+
}, backgroundMode?: PptistLayoutBackgroundMode): Promise<PptistLayoutBuildResult>;
|
|
56
59
|
export {};
|
|
@@ -258,7 +258,7 @@ export interface PptistLatexElementSizing {
|
|
|
258
258
|
height?: number;
|
|
259
259
|
rotate?: number;
|
|
260
260
|
}
|
|
261
|
-
export type PptistLatexElementInput = PptistLatexElementSizing & Pick<PPTLatexElement, 'latex'
|
|
261
|
+
export type PptistLatexElementInput = PptistLatexElementSizing & Pick<PPTLatexElement, 'latex'> & Partial<Pick<PPTLatexElement, 'path' | 'id' | 'color' | 'strokeWidth' | 'viewBox' | 'fixedRatio' | 'link' | 'name' | 'lock' | 'groupId'>>;
|
|
262
262
|
export type PptistLatexElementPatch = Partial<PptistLatexElementSizing & Pick<PPTLatexElement, 'latex' | 'path' | 'color' | 'strokeWidth' | 'viewBox' | 'fixedRatio' | 'link' | 'name' | 'lock' | 'groupId'>>;
|
|
263
263
|
export interface PptistCreateLatexElementInput {
|
|
264
264
|
slideId?: string;
|
|
@@ -5,7 +5,7 @@ import '../assets/styles/global.scss';
|
|
|
5
5
|
import '../assets/styles/font.scss';
|
|
6
6
|
import type { PptistMountOptions, PptistMountResult } from './types';
|
|
7
7
|
/**
|
|
8
|
-
* Mount PPTist into a DOM node (for
|
|
8
|
+
* Mount PPTist into a DOM node (for React / other embedding hosts).
|
|
9
9
|
* Vue + Pinia are bundled in the embed build — the host does not need Vue installed.
|
|
10
10
|
*/
|
|
11
11
|
export declare function mountPptist(target: HTMLElement | string, options?: PptistMountOptions): Promise<PptistMountResult>;
|
|
@@ -24,14 +24,14 @@ export interface PptistStarterPresentationOptions {
|
|
|
24
24
|
fontColor?: string;
|
|
25
25
|
backgroundColor?: string;
|
|
26
26
|
}
|
|
27
|
-
/** Serializable deck passed between
|
|
27
|
+
/** Serializable deck passed between the embedding host and PPTist. */
|
|
28
28
|
export interface PptistDocument {
|
|
29
29
|
title: string;
|
|
30
30
|
slides: Slide[];
|
|
31
31
|
theme?: Partial<SlideTheme>;
|
|
32
32
|
}
|
|
33
33
|
export interface PptistMountOptions {
|
|
34
|
-
/** UI locale
|
|
34
|
+
/** UI locale (`cs` | `en` | `sk` | `pl`). */
|
|
35
35
|
locale?: Locales;
|
|
36
36
|
/** Initial deck; takes precedence over `loadDocument` and the starter slide. */
|
|
37
37
|
document?: PptistDocument;
|
|
@@ -2,7 +2,7 @@ import type { Locales } from './i18n-types';
|
|
|
2
2
|
export type { Locales };
|
|
3
3
|
declare global {
|
|
4
4
|
interface Window {
|
|
5
|
-
/** Set by
|
|
5
|
+
/** Set by the embedding host (e.g. a React app) before PPTist mount in embed mode */
|
|
6
6
|
__PPTIST_LOCALE__?: string;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -1 +1,16 @@
|
|
|
1
|
+
/** True when a string carries math delimiters the math parser should handle. */
|
|
2
|
+
export declare function containsMath(source: string): boolean;
|
|
1
3
|
export declare function markdownToHtml(markdown: string): Promise<string>;
|
|
4
|
+
/**
|
|
5
|
+
* Preload the math-capable markdown parser (lazy KaTeX + texmath) so
|
|
6
|
+
* `renderInlineMarkdown` can render `$…$` math synchronously afterwards. No-op
|
|
7
|
+
* once loaded; call before rendering content that may contain math.
|
|
8
|
+
*/
|
|
9
|
+
export declare function ensureInlineMathReady(): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Render one line of markdown to inline HTML (no `<p>` wrapper) using the same
|
|
12
|
+
* CommonMark + texmath pipeline as {@link markdownToHtml}. Inline math (`$…$`)
|
|
13
|
+
* renders only when the math parser has been preloaded via
|
|
14
|
+
* {@link ensureInlineMathReady}; otherwise math delimiters read as literal text.
|
|
15
|
+
*/
|
|
16
|
+
export declare function renderInlineMarkdown(markdown: string): string;
|