@starrykit/slides-core 0.1.26
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/deck-slide-operations.d.ts +5 -0
- package/dist/export-filenames.d.ts +1 -0
- package/dist/generated-deck.d.ts +8 -0
- package/dist/group-operations.d.ts +28 -0
- package/dist/history.d.ts +20 -0
- package/dist/html-export.d.ts +20 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +1749 -0
- package/dist/layout.d.ts +36 -0
- package/dist/pdf-export.d.ts +20 -0
- package/dist/presentation.d.ts +7 -0
- package/dist/slide-contract.d.ts +56 -0
- package/dist/slide-document.d.ts +7 -0
- package/dist/slide-html-base.d.ts +2 -0
- package/dist/slide-html-document.d.ts +3 -0
- package/dist/slide-operation-reducer.d.ts +4 -0
- package/dist/slide-operation-types.d.ts +123 -0
- package/dist/slide-operations-helpers.d.ts +14 -0
- package/dist/slide-operations.d.ts +5 -0
- package/package.json +22 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SlideModel } from "./slide-contract.js";
|
|
2
|
+
export declare function createUniqueSlideId(slides: SlideModel[], preferredId: string): string;
|
|
3
|
+
export declare function createUniqueSlideSourceFile(slides: SlideModel[], preferredFile: string): string;
|
|
4
|
+
export declare function createBlankSlide(slides: SlideModel[], insertIndex: number): SlideModel;
|
|
5
|
+
export declare function createDuplicatedSlide(slides: SlideModel[], sourceSlide: SlideModel): SlideModel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createSafeExportFilenameBase(value: string, fallback?: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ImportedSlideDeck } from "./slide-contract.js";
|
|
2
|
+
export interface LoadSlidesFromManifestOptions {
|
|
3
|
+
manifestUrl: string;
|
|
4
|
+
fetchImpl?: typeof fetch;
|
|
5
|
+
requestInit?: RequestInit;
|
|
6
|
+
slideIdPrefix?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function loadSlidesFromManifest({ manifestUrl, fetchImpl, requestInit, slideIdPrefix, }: LoadSlidesFromManifestOptions): Promise<ImportedSlideDeck | null>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { GroupCreateOperation, GroupUngroupOperation } from "./slide-operation-types.js";
|
|
2
|
+
export type GroupElementRectMap = Record<string, {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}>;
|
|
8
|
+
export type ElementPresentationStyleMap = Record<string, Partial<Record<"color" | "fontSize" | "fontWeight" | "fontStyle" | "lineHeight" | "textAlign" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "listStylePosition" | "listStyleType", string>>>;
|
|
9
|
+
export declare function createGroupCreateOperation({ html, slideId, groupElementId, elementIds, elementRects, timestamp, }: {
|
|
10
|
+
html: string;
|
|
11
|
+
slideId: string;
|
|
12
|
+
groupElementId: string;
|
|
13
|
+
elementIds: string[];
|
|
14
|
+
elementRects?: GroupElementRectMap;
|
|
15
|
+
timestamp?: number;
|
|
16
|
+
}): GroupCreateOperation | null;
|
|
17
|
+
export declare function createGroupUngroupOperation({ html, slideId, groupElementId, elementRects, elementPresentationStyles, timestamp, parentPosition, }: {
|
|
18
|
+
html: string;
|
|
19
|
+
slideId: string;
|
|
20
|
+
groupElementId: string;
|
|
21
|
+
elementRects?: GroupElementRectMap;
|
|
22
|
+
elementPresentationStyles?: ElementPresentationStyleMap;
|
|
23
|
+
timestamp?: number;
|
|
24
|
+
parentPosition?: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
};
|
|
28
|
+
}): GroupUngroupOperation | null;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SlideModel } from "./slide-contract.js";
|
|
2
|
+
import { type SlideOperation } from "./slide-operations.js";
|
|
3
|
+
export interface HistoryState {
|
|
4
|
+
slides: SlideModel[];
|
|
5
|
+
undoStack: SlideOperation[];
|
|
6
|
+
redoStack: SlideOperation[];
|
|
7
|
+
}
|
|
8
|
+
export type HistoryAction = {
|
|
9
|
+
type: "history.reset";
|
|
10
|
+
slides: SlideModel[];
|
|
11
|
+
} | {
|
|
12
|
+
type: "history.commit";
|
|
13
|
+
operation: SlideOperation;
|
|
14
|
+
} | {
|
|
15
|
+
type: "history.undo";
|
|
16
|
+
} | {
|
|
17
|
+
type: "history.redo";
|
|
18
|
+
};
|
|
19
|
+
export declare function createHistoryState(slides: SlideModel[]): HistoryState;
|
|
20
|
+
export declare function reduceHistory(state: HistoryState, action: HistoryAction): HistoryState;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type SlideDeckManifestEntry } from "./slide-contract.js";
|
|
2
|
+
export interface HtmlExportSlide extends SlideDeckManifestEntry {
|
|
3
|
+
htmlSource: string;
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ResolvedHtmlExportSlide {
|
|
8
|
+
file: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
htmlSource: string;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
}
|
|
14
|
+
export interface HtmlExportDocumentOptions {
|
|
15
|
+
title?: string;
|
|
16
|
+
slides: HtmlExportSlide[];
|
|
17
|
+
}
|
|
18
|
+
export declare function planHtmlExportSlides(slides: HtmlExportSlide[]): HtmlExportSlide[];
|
|
19
|
+
export declare function resolveHtmlExportSlides(slides: HtmlExportSlide[]): ResolvedHtmlExportSlide[];
|
|
20
|
+
export declare function createSingleHtmlExportDocument({ title, slides, }: HtmlExportDocumentOptions): string;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from "./slide-contract.js";
|
|
2
|
+
export * from "./slide-document.js";
|
|
3
|
+
export * from "./slide-html-base.js";
|
|
4
|
+
export * from "./slide-html-document.js";
|
|
5
|
+
export * from "./layout.js";
|
|
6
|
+
export * from "./slide-operations.js";
|
|
7
|
+
export * from "./deck-slide-operations.js";
|
|
8
|
+
export * from "./history.js";
|
|
9
|
+
export * from "./generated-deck.js";
|
|
10
|
+
export * from "./pdf-export.js";
|
|
11
|
+
export * from "./html-export.js";
|
|
12
|
+
export * from "./presentation.js";
|
|
13
|
+
export * from "./export-filenames.js";
|
|
14
|
+
export * from "./slide-operation-reducer.js";
|
|
15
|
+
export * from "./slide-operation-types.js";
|
|
16
|
+
export * from "./slide-operations-helpers.js";
|
|
17
|
+
export * from "./group-operations.js";
|