@storyblok/astro 2.2.1 → 2.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.
@@ -1,5 +1,5 @@
1
1
  ---
2
- import type { SbBlokData } from "./types";
2
+ import type { SbBlokData } from "./dist/types";
3
3
 
4
4
  interface Props {
5
5
  blok: SbBlokData;
@@ -2,7 +2,7 @@
2
2
  import components from "virtual:storyblok-components";
3
3
  import options from "virtual:storyblok-options";
4
4
  import camelcase from "camelcase";
5
- import type { SbBlokData } from "./types";
5
+ import type { SbBlokData } from "./dist/types";
6
6
  import type { AstroComponentFactory } from "astro/dist/runtime/server";
7
7
 
8
8
  interface Props {
@@ -12,6 +12,12 @@ interface Props {
12
12
 
13
13
  const { blok, ...props } = Astro.props;
14
14
 
15
+ if (!blok) {
16
+ throw new Error(
17
+ "Cannot render StoryblokComponent. 'blok' prop is undefined."
18
+ );
19
+ }
20
+
15
21
  /**
16
22
  * convert blok components to camel case to match vite-plugin-storyblok-components
17
23
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storyblok/astro",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Official Astro integration for the Storyblok Headless CMS",
5
5
  "main": "./dist/storyblok-astro.js",
6
6
  "module": "./dist/storyblok-astro.mjs",