@buildinams/react-storyblok
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -9,3 +9,2 @@ import { ContentTypeData, StoryData } from "../../types"; | ||
*/ | ||
declare const storyblokBridge: <T extends ContentTypeData>(storyID: number, resolveRelations: string[] | undefined, callback: (newData: StoryData<T>) => void) => void; | ||
export { storyblokBridge }; | ||
export declare const storyblokBridge: <T extends ContentTypeData>(storyID: number, resolveRelations: string[] | undefined, callback: (newData: StoryData<T>) => void) => void; |
{ | ||
"name": "@buildinams/react-storyblok", | ||
"description": "Opinionated Reactjs Storyblok wrapper", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"license": "MIT", | ||
"author": "Build in Amsterdam <development@buildinamsterdam.com> (https://www.buildinamsterdam.com/)", | ||
"main": "dist/client/index.js", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"exports": { | ||
".": "./dist/client/index.js", | ||
"./server": "./dist/server/index.js", | ||
"./client": "./dist/client/index.js" | ||
".": "./dist/index.js", | ||
"./client": "./client.js", | ||
"./server": "./server.js" | ||
}, | ||
@@ -14,0 +14,0 @@ "homepage": "https://github.com/buildinamsterdam/react-storyblok#readme", |
@@ -54,3 +54,3 @@ # react-storyblok | ||
const storyblokAdaptor = new StoryblokAdaptor({ | ||
export const storyblokAdaptor = new StoryblokAdaptor({ | ||
field_types: { | ||
@@ -78,4 +78,2 @@ asset: assetAdaptor, | ||
}); | ||
export default storyblokAdaptor; | ||
``` | ||
@@ -93,8 +91,6 @@ | ||
```ts | ||
const exampleAdaptor: Adaptor<any, any> = (data) => { | ||
export const exampleAdaptor: Adaptor<any, any> = (data) => { | ||
// Do something with the data | ||
return adaptedData; | ||
}; | ||
export default exampleAdaptor; | ||
``` | ||
@@ -113,5 +109,5 @@ | ||
const storyblokFetcher = new StoryblokFetcher({ accessToken: ACCESS_TOKEN }); | ||
export default storyblokFetcher; | ||
export const storyblokFetcher = new StoryblokFetcher({ | ||
accessToken: ACCESS_TOKEN, | ||
}); | ||
``` | ||
@@ -198,7 +194,5 @@ | ||
const withStoryblokPreview = (PageComponent) => { | ||
export const withStoryblokPreview = (PageComponent) => { | ||
return withStoryblokPreviewHOC(PageComponent, () => import("./adaptor")); | ||
}; | ||
export default withStoryblokPreview; | ||
``` | ||
@@ -215,3 +209,3 @@ | ||
import HomePage from "~/scopes/HomePage"; | ||
import storyblokFetcher from "~/server/fetcher"; | ||
import { storyblokFetcher } from "~/server/fetcher"; | ||
@@ -218,0 +212,0 @@ export const getStaticProps = async ({ preview = null }) => { |
@@ -14,3 +14,3 @@ import { loadStoryblokBridge, useStoryblokBridge } from "@storyblok/js"; | ||
*/ | ||
const storyblokBridge = <T extends ContentTypeData>( | ||
export const storyblokBridge = <T extends ContentTypeData>( | ||
storyID: number, | ||
@@ -23,3 +23,1 @@ resolveRelations: string[] | undefined, | ||
}; | ||
export { storyblokBridge }; |
98319
56
1869
279