@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.
package/FallbackComponent.astro
CHANGED
package/StoryblokComponent.astro
CHANGED
|
@@ -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
|
*/
|