@openpresentation/gallery 1.0.0 → 3.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.
- package/CHANGELOG.md +21 -0
- package/README.md +94 -32
- package/dist/index.d.ts +5 -2
- package/dist/index.js +2 -2
- package/dist/previews.d.ts +13 -12
- package/dist/previews.js +5 -5
- package/package.json +7 -4
package/dist/previews.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
// @openpresentation/gallery/previews:
|
|
1
|
+
// @openpresentation/gallery/previews: one SVG preview per layout, for layout pickers.
|
|
2
2
|
//
|
|
3
|
-
// Each
|
|
4
|
-
//
|
|
5
|
-
//
|
|
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
|
|
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
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
30
|
+
/** The id of every layout that ships a preview, sorted. */
|
|
30
31
|
export declare const layoutPreviewSlugs: readonly string[];
|
|
31
|
-
/** Whether
|
|
32
|
+
/** Whether a preview exists for the layout id. */
|
|
32
33
|
export declare function hasLayoutPreview(slug: string): boolean;
|
|
33
|
-
/** The
|
|
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;
|