@plus45/types 1.2.35 → 1.3.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.
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Describes the inherent properties that all page builder components must have.
|
|
3
|
+
* Optional properties such as alignment may not be used by all components.
|
|
4
|
+
*/
|
|
5
|
+
type InherentPageBuilderProperties = {
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
type Alignable = {
|
|
9
|
+
alignment: "left" | "right" | "center";
|
|
10
|
+
};
|
|
11
|
+
export type Page = {
|
|
12
|
+
id: string;
|
|
13
|
+
/** URL slug: /o/:orgKey/:slug */
|
|
14
|
+
slug: string;
|
|
15
|
+
/** Display name (optional, useful for nav + editor) */
|
|
16
|
+
title?: string;
|
|
17
|
+
/** SEO */
|
|
18
|
+
seo: {
|
|
19
|
+
title?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
noIndex?: boolean;
|
|
22
|
+
};
|
|
23
|
+
/** Ordered list of renderable components */
|
|
24
|
+
components: PageBuilderComponent[];
|
|
25
|
+
draftComponents?: PageBuilderComponent[];
|
|
26
|
+
/** Publishing */
|
|
27
|
+
published: boolean;
|
|
28
|
+
publishedAt?: string;
|
|
29
|
+
/** Metadata */
|
|
30
|
+
updatedAt: string;
|
|
31
|
+
schemaVersion: 1;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Renders a simple block with a title and body text.
|
|
35
|
+
*/
|
|
36
|
+
export type TitleBodyBlockData = Alignable & InherentPageBuilderProperties & {
|
|
37
|
+
type: "title_body";
|
|
38
|
+
title: string;
|
|
39
|
+
body: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Renders a title and optional subtitle.
|
|
43
|
+
*/
|
|
44
|
+
export type PageTitleBlock = Alignable & InherentPageBuilderProperties & {
|
|
45
|
+
type: "page_title";
|
|
46
|
+
title: string;
|
|
47
|
+
subtitle?: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* A component that can be utilized by the Page Builder to render components.
|
|
51
|
+
* A PageBuilderComponent object merely stores the data used by the object.
|
|
52
|
+
* Rendering is up to the frontend.
|
|
53
|
+
*/
|
|
54
|
+
export type PageBuilderComponent = TitleBodyBlockData | PageTitleBlock;
|
|
55
|
+
export {};
|