@openpresentation/gallery 1.0.0 → 2.0.0

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.
@@ -1,20 +1,21 @@
1
- // @openpresentation/gallery/previews: the static HTML layout previews pptx.gallery renders for pickers (RR-78).
1
+ // @openpresentation/gallery/previews: one SVG preview per layout, for layout pickers.
2
2
  //
3
- // Each snippet is a self-contained Tailwind-styled fragment that fills a 16:9 thumbnail container. It uses the CSS
4
- // variables --background, --foreground, --card, --muted, --muted-foreground, --accent and --border; set them on a parent
5
- // element (or import the pptx.gallery design tokens).
3
+ // Each preview is a self-contained <svg> element with a 16:9 viewBox, keyed by the layout id (`pillars`,
4
+ // `chart-beside`, ...): the layout drawn with sample content in every region by the @openpresentation/opf-render this
5
+ // package pins (scripts/render-previews.mjs), with the engine's default design. Scale it to any thumbnail; inline it in
6
+ // HTML or serve it as image/svg+xml.
6
7
 
7
8
  /** One preview of the index. */
8
9
  export interface LayoutPreviewRecord {
9
- /** The preview slug. */
10
+ /** The layout id. */
10
11
  readonly id: string;
11
12
  /** The file name the preview was rendered to. */
12
13
  readonly file: string;
13
- /** UTF-8 byte length of the HTML. */
14
+ /** UTF-8 byte length of the SVG file. */
14
15
  readonly bytes: number;
15
16
  }
16
17
 
17
- /** The preview index (schema https://openpresentation.org/schema/opf-layout-preview-index/v1). */
18
+ /** The preview index (schema https://openpresentation.org/schema/opf-layout-preview-index/v1, version "2"). */
18
19
  export interface LayoutPreviewIndex {
19
20
  readonly $schema: string;
20
21
  readonly version: string;
@@ -22,13 +23,13 @@ export interface LayoutPreviewIndex {
22
23
  readonly records: readonly LayoutPreviewRecord[];
23
24
  }
24
25
 
25
- /** Static HTML for each preview slug. */
26
+ /** The SVG preview of each layout, keyed by the layout id. */
26
27
  export declare const layoutPreviews: Readonly<Record<string, string>>;
27
- /** The preview index. */
28
+ /** The preview index, in catalog order. */
28
29
  export declare const layoutPreviewIndex: LayoutPreviewIndex;
29
- /** Slugs of every layout that ships an HTML preview, sorted. */
30
+ /** The id of every layout that ships a preview, sorted. */
30
31
  export declare const layoutPreviewSlugs: readonly string[];
31
- /** Whether an HTML preview exists for the slug. */
32
+ /** Whether a preview exists for the layout id. */
32
33
  export declare function hasLayoutPreview(slug: string): boolean;
33
- /** The HTML preview for a slug, or undefined when none ships (fall back to a generic thumbnail). */
34
+ /** The SVG preview of a layout id, or undefined when none ships (fall back to a generic thumbnail). */
34
35
  export declare function getLayoutPreview(slug: string): string | undefined;