@starlightcms/js-sdk 1.1.0 → 2.0.1

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.
@@ -41,6 +41,13 @@ export interface QuoteBlock extends BlockData {
41
41
  caption: string;
42
42
  alignment: 'left' | 'center';
43
43
  }
44
+ /**
45
+ * Represents the possible block widths, used by some blocks.
46
+ *
47
+ * @group Visual Data Blocks
48
+ * @internal
49
+ */
50
+ declare type BlockWidth = 'auto' | 'justify' | 'max' | string;
44
51
  /**
45
52
  * Represents an image file, used in Image blocks.
46
53
  *
@@ -57,12 +64,14 @@ declare type ImageFile = {
57
64
  * @group Visual Data Blocks
58
65
  */
59
66
  export interface ImageBlock extends BlockData {
60
- id: number;
67
+ id: number | undefined;
61
68
  url: string;
62
69
  files: ImageFile[];
63
70
  caption?: string;
64
71
  alt?: string;
65
72
  href?: string;
73
+ width: BlockWidth;
74
+ variation: string | undefined;
66
75
  }
67
76
  /**
68
77
  * Represents an HTML block, which is used to render custom HTML code. Mainly
@@ -92,6 +101,27 @@ export interface ListBlock extends BlockData {
92
101
  style: 'ordered' | 'unordered';
93
102
  items: ListItem[];
94
103
  }
104
+ /**
105
+ * Represents the current supported video services, used in Video blocks.
106
+ *
107
+ * @group Visual Data Blocks
108
+ * @internal
109
+ */
110
+ export declare type SupportedServices = 'youtube' | 'vimeo';
111
+ /**
112
+ * Represents a Video block, which is used to render embed video elements.
113
+ *
114
+ * @group Visual Data Blocks
115
+ */
116
+ export declare type VideoBlock = {
117
+ type: 'embed';
118
+ service: SupportedServices;
119
+ videoId: string;
120
+ url: string;
121
+ html: string;
122
+ width: BlockWidth;
123
+ caption?: string;
124
+ };
95
125
  /**
96
126
  * A VisualDataBlock object represents a piece of content. Each block has a
97
127
  * specific type and some data associated with it. For instance, a Paragraph
@@ -1 +1 @@
1
- {"version":3,"file":"visual.d.ts","sourceRoot":"","sources":["../../../src/types/visual.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;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C,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"visual.js","sourceRoot":"","sources":["../../../src/types/visual.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * All supported block types.\n *\n * @group Visual Data Blocks\n * @internal\n */\nexport type BlockType =\n | 'paragraph'\n | 'quote'\n | 'header'\n | 'image'\n | 'raw'\n | 'list'\n\n/**\n * Base interface for types that represent block data.\n *\n * @group Visual Data Blocks\n */\nexport interface BlockData {\n [key: string]: unknown\n}\n\n/**\n * Represents a Paragraph block, which is the default block type used\n * for text content in the Visual Editor.\n *\n * @group Visual Data Blocks\n */\nexport interface ParagraphBlock extends BlockData {\n text: string | null\n}\n\n/**\n * Represents a Header block, which is used to render h1 through h6 HTML elements.\n *\n * @group Visual Data Blocks\n */\nexport interface HeaderBlock extends BlockData {\n text: string\n level: number\n}\n\n/**\n * Represents a Quote block, which is used to render a blockquote HTML element.\n *\n * @group Visual Data Blocks\n */\nexport interface QuoteBlock extends BlockData {\n text: string\n caption: string\n alignment: 'left' | 'center'\n}\n\n/**\n * Represents an image file, used in Image blocks.\n *\n * @group Visual Data Blocks\n * @internal\n */\ntype ImageFile = {\n url: string\n width: number\n}\n\n/**\n * Represents an Image block, which is used to render img or picture HTML elements.\n *\n * @group Visual Data Blocks\n */\nexport interface ImageBlock extends BlockData {\n id: number\n url: string\n files: ImageFile[]\n caption?: string\n alt?: string\n href?: string\n}\n\n/**\n * Represents an HTML block, which is used to render custom HTML code. Mainly\n * used to place embeds or heavily customized content structures.\n *\n * @group Visual Data Blocks\n */\nexport interface HTMLBlock extends BlockData {\n html: string\n}\n\n/**\n * Represents a list item, which is used by List blocks.\n *\n * @group Visual Data Blocks\n * @internal\n */\nexport interface ListItem {\n content: string\n items?: ListItem[]\n}\n\n/**\n * Represents a List block, which is used to render ol or ul HTML elements.\n *\n * @group Visual Data Blocks\n */\nexport interface ListBlock extends BlockData {\n style: 'ordered' | 'unordered'\n items: ListItem[]\n}\n\n/**\n * A VisualDataBlock object represents a piece of content. Each block has a\n * specific type and some data associated with it. For instance, a Paragraph\n * block has text data, an Image block has a file path and image metadata, etc.\n *\n * @group Visual Data Blocks\n */\nexport interface VisualDataBlock<D extends BlockData = BlockData> {\n id: string\n type: BlockType\n data: D\n}\n\n/**\n * VisualData represents content generated by Starlight using a \"Visual Editor\"\n * field. It's an object-based data representation made out of \"blocks\". Each\n * block has a type string and some data associated with it.\n *\n * @group Visual Data Blocks\n */\nexport interface VisualData {\n time?: number\n version?: string\n blocks: VisualDataBlock[]\n}\n"]}
1
+ {"version":3,"file":"visual.js","sourceRoot":"","sources":["../../../src/types/visual.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * All supported block types.\n *\n * @group Visual Data Blocks\n * @internal\n */\nexport type BlockType =\n | 'paragraph'\n | 'quote'\n | 'header'\n | 'image'\n | 'raw'\n | 'list'\n\n/**\n * Base interface for types that represent block data.\n *\n * @group Visual Data Blocks\n */\nexport interface BlockData {\n [key: string]: unknown\n}\n\n/**\n * Represents a Paragraph block, which is the default block type used\n * for text content in the Visual Editor.\n *\n * @group Visual Data Blocks\n */\nexport interface ParagraphBlock extends BlockData {\n text: string | null\n}\n\n/**\n * Represents a Header block, which is used to render h1 through h6 HTML elements.\n *\n * @group Visual Data Blocks\n */\nexport interface HeaderBlock extends BlockData {\n text: string\n level: number\n}\n\n/**\n * Represents a Quote block, which is used to render a blockquote HTML element.\n *\n * @group Visual Data Blocks\n */\nexport interface QuoteBlock extends BlockData {\n text: string\n caption: string\n alignment: 'left' | 'center'\n}\n\n/**\n * Represents the possible block widths, used by some blocks.\n *\n * @group Visual Data Blocks\n * @internal\n */\ntype BlockWidth = 'auto' | 'justify' | 'max' | string\n\n/**\n * Represents an image file, used in Image blocks.\n *\n * @group Visual Data Blocks\n * @internal\n */\ntype ImageFile = {\n url: string\n width: number\n}\n\n/**\n * Represents an Image block, which is used to render img or picture HTML elements.\n *\n * @group Visual Data Blocks\n */\nexport interface ImageBlock extends BlockData {\n id: number | undefined\n url: string\n files: ImageFile[]\n caption?: string\n alt?: string\n href?: string\n width: BlockWidth\n variation: string | undefined\n}\n\n/**\n * Represents an HTML block, which is used to render custom HTML code. Mainly\n * used to place embeds or heavily customized content structures.\n *\n * @group Visual Data Blocks\n */\nexport interface HTMLBlock extends BlockData {\n html: string\n}\n\n/**\n * Represents a list item, which is used by List blocks.\n *\n * @group Visual Data Blocks\n * @internal\n */\nexport interface ListItem {\n content: string\n items?: ListItem[]\n}\n\n/**\n * Represents a List block, which is used to render ol or ul HTML elements.\n *\n * @group Visual Data Blocks\n */\nexport interface ListBlock extends BlockData {\n style: 'ordered' | 'unordered'\n items: ListItem[]\n}\n\n/**\n * Represents the current supported video services, used in Video blocks.\n *\n * @group Visual Data Blocks\n * @internal\n */\nexport type SupportedServices = 'youtube' | 'vimeo'\n\n/**\n * Represents a Video block, which is used to render embed video elements.\n *\n * @group Visual Data Blocks\n */\nexport type VideoBlock = {\n type: 'embed'\n service: SupportedServices\n videoId: string\n url: string\n html: string\n width: BlockWidth\n caption?: string\n}\n\n/**\n * A VisualDataBlock object represents a piece of content. Each block has a\n * specific type and some data associated with it. For instance, a Paragraph\n * block has text data, an Image block has a file path and image metadata, etc.\n *\n * @group Visual Data Blocks\n */\nexport interface VisualDataBlock<D extends BlockData = BlockData> {\n id: string\n type: BlockType\n data: D\n}\n\n/**\n * VisualData represents content generated by Starlight using a \"Visual Editor\"\n * field. It's an object-based data representation made out of \"blocks\". Each\n * block has a type string and some data associated with it.\n *\n * @group Visual Data Blocks\n */\nexport interface VisualData {\n time?: number\n version?: string\n blocks: VisualDataBlock[]\n}\n"]}
@@ -41,6 +41,13 @@ export interface QuoteBlock extends BlockData {
41
41
  caption: string;
42
42
  alignment: 'left' | 'center';
43
43
  }
44
+ /**
45
+ * Represents the possible block widths, used by some blocks.
46
+ *
47
+ * @group Visual Data Blocks
48
+ * @internal
49
+ */
50
+ declare type BlockWidth = 'auto' | 'justify' | 'max' | string;
44
51
  /**
45
52
  * Represents an image file, used in Image blocks.
46
53
  *
@@ -57,12 +64,14 @@ declare type ImageFile = {
57
64
  * @group Visual Data Blocks
58
65
  */
59
66
  export interface ImageBlock extends BlockData {
60
- id: number;
67
+ id: number | undefined;
61
68
  url: string;
62
69
  files: ImageFile[];
63
70
  caption?: string;
64
71
  alt?: string;
65
72
  href?: string;
73
+ width: BlockWidth;
74
+ variation: string | undefined;
66
75
  }
67
76
  /**
68
77
  * Represents an HTML block, which is used to render custom HTML code. Mainly
@@ -92,6 +101,27 @@ export interface ListBlock extends BlockData {
92
101
  style: 'ordered' | 'unordered';
93
102
  items: ListItem[];
94
103
  }
104
+ /**
105
+ * Represents the current supported video services, used in Video blocks.
106
+ *
107
+ * @group Visual Data Blocks
108
+ * @internal
109
+ */
110
+ export declare type SupportedServices = 'youtube' | 'vimeo';
111
+ /**
112
+ * Represents a Video block, which is used to render embed video elements.
113
+ *
114
+ * @group Visual Data Blocks
115
+ */
116
+ export declare type VideoBlock = {
117
+ type: 'embed';
118
+ service: SupportedServices;
119
+ videoId: string;
120
+ url: string;
121
+ html: string;
122
+ width: BlockWidth;
123
+ caption?: string;
124
+ };
95
125
  /**
96
126
  * A VisualDataBlock object represents a piece of content. Each block has a
97
127
  * specific type and some data associated with it. For instance, a Paragraph
@@ -1 +1 @@
1
- {"version":3,"file":"visual.d.ts","sourceRoot":"","sources":["../../../src/types/visual.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oBAAY,SAAS,GACjB,WAAW,GACX,OAAO,GACP,QAAQ,GACR,OAAO,GACP,KAAK,GACL,MAAM,CAAA;AAEV;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,IAAI,EAAE,MAAM,GAA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,UAAU,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAA;CACnB;AAED;;;;GAIG;AACH,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,KAAK,EAAE,SAAS,GAAG,WAAW,CAAA;IAC9B,KAAK,EAAE,QAAQ,EAAE,CAAA;CAClB;AAED;;;;;GAKG;AACH,oBAAY,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAAA;AAEnD;;;;GAIG;AACH,oBAAY,UAAU,GAAG;IACvB,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,iBAAiB,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,UAAU,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IAC9D,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,SAAS,CAAA;IACf,IAAI,EAAE,CAAC,CAAA;CACR;AAED;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,eAAe,EAAE,CAAA;CAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"visual.js","sourceRoot":"","sources":["../../../src/types/visual.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * All supported block types.\n *\n * @group Visual Data Blocks\n * @internal\n */\nexport type BlockType =\n | 'paragraph'\n | 'quote'\n | 'header'\n | 'image'\n | 'raw'\n | 'list'\n\n/**\n * Base interface for types that represent block data.\n *\n * @group Visual Data Blocks\n */\nexport interface BlockData {\n [key: string]: unknown\n}\n\n/**\n * Represents a Paragraph block, which is the default block type used\n * for text content in the Visual Editor.\n *\n * @group Visual Data Blocks\n */\nexport interface ParagraphBlock extends BlockData {\n text: string | null\n}\n\n/**\n * Represents a Header block, which is used to render h1 through h6 HTML elements.\n *\n * @group Visual Data Blocks\n */\nexport interface HeaderBlock extends BlockData {\n text: string\n level: number\n}\n\n/**\n * Represents a Quote block, which is used to render a blockquote HTML element.\n *\n * @group Visual Data Blocks\n */\nexport interface QuoteBlock extends BlockData {\n text: string\n caption: string\n alignment: 'left' | 'center'\n}\n\n/**\n * Represents an image file, used in Image blocks.\n *\n * @group Visual Data Blocks\n * @internal\n */\ntype ImageFile = {\n url: string\n width: number\n}\n\n/**\n * Represents an Image block, which is used to render img or picture HTML elements.\n *\n * @group Visual Data Blocks\n */\nexport interface ImageBlock extends BlockData {\n id: number\n url: string\n files: ImageFile[]\n caption?: string\n alt?: string\n href?: string\n}\n\n/**\n * Represents an HTML block, which is used to render custom HTML code. Mainly\n * used to place embeds or heavily customized content structures.\n *\n * @group Visual Data Blocks\n */\nexport interface HTMLBlock extends BlockData {\n html: string\n}\n\n/**\n * Represents a list item, which is used by List blocks.\n *\n * @group Visual Data Blocks\n * @internal\n */\nexport interface ListItem {\n content: string\n items?: ListItem[]\n}\n\n/**\n * Represents a List block, which is used to render ol or ul HTML elements.\n *\n * @group Visual Data Blocks\n */\nexport interface ListBlock extends BlockData {\n style: 'ordered' | 'unordered'\n items: ListItem[]\n}\n\n/**\n * A VisualDataBlock object represents a piece of content. Each block has a\n * specific type and some data associated with it. For instance, a Paragraph\n * block has text data, an Image block has a file path and image metadata, etc.\n *\n * @group Visual Data Blocks\n */\nexport interface VisualDataBlock<D extends BlockData = BlockData> {\n id: string\n type: BlockType\n data: D\n}\n\n/**\n * VisualData represents content generated by Starlight using a \"Visual Editor\"\n * field. It's an object-based data representation made out of \"blocks\". Each\n * block has a type string and some data associated with it.\n *\n * @group Visual Data Blocks\n */\nexport interface VisualData {\n time?: number\n version?: string\n blocks: VisualDataBlock[]\n}\n"]}
1
+ {"version":3,"file":"visual.js","sourceRoot":"","sources":["../../../src/types/visual.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * All supported block types.\n *\n * @group Visual Data Blocks\n * @internal\n */\nexport type BlockType =\n | 'paragraph'\n | 'quote'\n | 'header'\n | 'image'\n | 'raw'\n | 'list'\n\n/**\n * Base interface for types that represent block data.\n *\n * @group Visual Data Blocks\n */\nexport interface BlockData {\n [key: string]: unknown\n}\n\n/**\n * Represents a Paragraph block, which is the default block type used\n * for text content in the Visual Editor.\n *\n * @group Visual Data Blocks\n */\nexport interface ParagraphBlock extends BlockData {\n text: string | null\n}\n\n/**\n * Represents a Header block, which is used to render h1 through h6 HTML elements.\n *\n * @group Visual Data Blocks\n */\nexport interface HeaderBlock extends BlockData {\n text: string\n level: number\n}\n\n/**\n * Represents a Quote block, which is used to render a blockquote HTML element.\n *\n * @group Visual Data Blocks\n */\nexport interface QuoteBlock extends BlockData {\n text: string\n caption: string\n alignment: 'left' | 'center'\n}\n\n/**\n * Represents the possible block widths, used by some blocks.\n *\n * @group Visual Data Blocks\n * @internal\n */\ntype BlockWidth = 'auto' | 'justify' | 'max' | string\n\n/**\n * Represents an image file, used in Image blocks.\n *\n * @group Visual Data Blocks\n * @internal\n */\ntype ImageFile = {\n url: string\n width: number\n}\n\n/**\n * Represents an Image block, which is used to render img or picture HTML elements.\n *\n * @group Visual Data Blocks\n */\nexport interface ImageBlock extends BlockData {\n id: number | undefined\n url: string\n files: ImageFile[]\n caption?: string\n alt?: string\n href?: string\n width: BlockWidth\n variation: string | undefined\n}\n\n/**\n * Represents an HTML block, which is used to render custom HTML code. Mainly\n * used to place embeds or heavily customized content structures.\n *\n * @group Visual Data Blocks\n */\nexport interface HTMLBlock extends BlockData {\n html: string\n}\n\n/**\n * Represents a list item, which is used by List blocks.\n *\n * @group Visual Data Blocks\n * @internal\n */\nexport interface ListItem {\n content: string\n items?: ListItem[]\n}\n\n/**\n * Represents a List block, which is used to render ol or ul HTML elements.\n *\n * @group Visual Data Blocks\n */\nexport interface ListBlock extends BlockData {\n style: 'ordered' | 'unordered'\n items: ListItem[]\n}\n\n/**\n * Represents the current supported video services, used in Video blocks.\n *\n * @group Visual Data Blocks\n * @internal\n */\nexport type SupportedServices = 'youtube' | 'vimeo'\n\n/**\n * Represents a Video block, which is used to render embed video elements.\n *\n * @group Visual Data Blocks\n */\nexport type VideoBlock = {\n type: 'embed'\n service: SupportedServices\n videoId: string\n url: string\n html: string\n width: BlockWidth\n caption?: string\n}\n\n/**\n * A VisualDataBlock object represents a piece of content. Each block has a\n * specific type and some data associated with it. For instance, a Paragraph\n * block has text data, an Image block has a file path and image metadata, etc.\n *\n * @group Visual Data Blocks\n */\nexport interface VisualDataBlock<D extends BlockData = BlockData> {\n id: string\n type: BlockType\n data: D\n}\n\n/**\n * VisualData represents content generated by Starlight using a \"Visual Editor\"\n * field. It's an object-based data representation made out of \"blocks\". Each\n * block has a type string and some data associated with it.\n *\n * @group Visual Data Blocks\n */\nexport interface VisualData {\n time?: number\n version?: string\n blocks: VisualDataBlock[]\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starlightcms/js-sdk",
3
- "version": "1.1.0",
3
+ "version": "2.0.1",
4
4
  "description": "The Starlight SDK for JavaScript",
5
5
  "workspaces": [
6
6
  "website"