@storyblok/astro 5.1.2 → 6.0.0-next.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.
- package/dist/index.d.ts +3 -56
- package/dist/lib/helpers.d.ts +8 -0
- package/dist/lib/storyblok-integration.d.ts +51 -0
- package/dist/storyblok-astro.es.js +407 -1036
- package/dist/storyblok-astro.umd.js +36 -41
- package/dist/types.d.ts +1 -1
- package/package.json +3 -5
- package/dist/utils/generateFinalBridgeObject.d.ts +0 -3
- package/dist/utils/parseAstCode.d.ts +0 -7
- package/dist/vite-plugins/vite-plugin-storyblok-bridge.d.ts +0 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,60 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { default as storyblokIntegration } from './lib/storyblok-integration';
|
|
2
|
+
export { getLiveStory, renderRichText, useStoryblokApi } from './lib/helpers';
|
|
3
3
|
export { handleStoryblokMessage } from './live-preview/handleStoryblokMessage';
|
|
4
4
|
export * from './types';
|
|
5
5
|
export { toCamelCase } from './utils/toCamelCase';
|
|
6
6
|
export { loadStoryblokBridge, RichTextResolver, RichTextSchema, storyblokEditable, } from '@storyblok/js';
|
|
7
|
-
export
|
|
8
|
-
export declare function useStoryblok(slug: string, apiOptions: ISbStoriesParams | undefined, _: StoryblokBridgeConfigV2 | undefined, Astro: AstroGlobal): Promise<ISbStoryData<import('@storyblok/js').StoryblokComponentType<string> & {
|
|
9
|
-
[index: string]: any;
|
|
10
|
-
}> | null>;
|
|
11
|
-
export declare function renderRichText(data?: ISbRichtext, options?: SbRichTextOptions): string;
|
|
12
|
-
export interface IntegrationOptions {
|
|
13
|
-
/**
|
|
14
|
-
* The access token from your space.
|
|
15
|
-
*/
|
|
16
|
-
accessToken: string;
|
|
17
|
-
/**
|
|
18
|
-
* If you want to use your own method to fetch data from Storyblok, you can disable this behavior by setting `useCustomApi` to `true`, resulting in an optimized final bundle.
|
|
19
|
-
*/
|
|
20
|
-
useCustomApi?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Set custom API options here (cache, region, and more). All options are documented [here](https://github.com/storyblok/storyblok-js-client#class-storyblok).
|
|
23
|
-
*/
|
|
24
|
-
apiOptions?: ISbConfig;
|
|
25
|
-
/**
|
|
26
|
-
* A boolean to enable/disable the Storyblok JavaScript Bridge or provide a StoryblokBridgeConfigV2 configuration object. Enabled by default.
|
|
27
|
-
*/
|
|
28
|
-
bridge?: boolean | StoryblokBridgeConfigV2;
|
|
29
|
-
/**
|
|
30
|
-
* An object containing your Astro components to their Storyblok equivalents.
|
|
31
|
-
* Example:
|
|
32
|
-
* ```js
|
|
33
|
-
* components: {
|
|
34
|
-
* page: "storyblok/Page",
|
|
35
|
-
* feature: "storyblok/Feature",
|
|
36
|
-
* grid: "storyblok/Grid",
|
|
37
|
-
* teaser: "storyblok/Teaser",
|
|
38
|
-
* },
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
components?: Record<string, string>;
|
|
42
|
-
/**
|
|
43
|
-
* The directory containing your Astro components are. Defaults to "src".
|
|
44
|
-
*/
|
|
45
|
-
componentsDir?: string;
|
|
46
|
-
/**
|
|
47
|
-
* Show a fallback component in your frontend if a component is not registered properly.
|
|
48
|
-
*/
|
|
49
|
-
enableFallbackComponent?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Provide a path to a custom fallback component, e.g. "storyblok/customFallback".
|
|
52
|
-
* Please note: the path takes into account the `componentsDir` option.
|
|
53
|
-
*/
|
|
54
|
-
customFallbackComponent?: string;
|
|
55
|
-
/**
|
|
56
|
-
* A boolean to enable/disable the Experimental Live Preview feature. Disabled by default.
|
|
57
|
-
*/
|
|
58
|
-
livePreview?: boolean;
|
|
59
|
-
}
|
|
60
|
-
export default function storyblokIntegration(options: IntegrationOptions): AstroIntegration;
|
|
7
|
+
export { storyblokIntegration as storyblok };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ISbRichtext, ISbStoryData, SbRichTextOptions, StoryblokBridgeConfigV2, StoryblokClient } from '../types';
|
|
2
|
+
import { AstroGlobal } from 'astro';
|
|
3
|
+
export declare function useStoryblokApi(): StoryblokClient;
|
|
4
|
+
export declare function getLiveStory(Astro: AstroGlobal): Promise<ISbStoryData<import('@storyblok/js').StoryblokComponentType<string> & {
|
|
5
|
+
[index: string]: any;
|
|
6
|
+
}> | null>;
|
|
7
|
+
export declare function renderRichText(data?: ISbRichtext, options?: SbRichTextOptions): string;
|
|
8
|
+
export declare function initStoryblokBridge(config: boolean | StoryblokBridgeConfigV2): string;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ISbConfig, StoryblokBridgeConfigV2 } from '@storyblok/js';
|
|
2
|
+
import { AstroIntegration } from 'astro';
|
|
3
|
+
export interface IntegrationOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The access token from your space.
|
|
6
|
+
*/
|
|
7
|
+
accessToken: string;
|
|
8
|
+
/**
|
|
9
|
+
* If you want to use your own method to fetch data from Storyblok, you can disable this behavior by setting `useCustomApi` to `true`, resulting in an optimized final bundle.
|
|
10
|
+
*/
|
|
11
|
+
useCustomApi?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Set custom API options here (cache, region, and more). All options are documented [here](https://github.com/storyblok/storyblok-js-client#class-storyblok).
|
|
14
|
+
*/
|
|
15
|
+
apiOptions?: ISbConfig;
|
|
16
|
+
/**
|
|
17
|
+
* A boolean to enable/disable the Storyblok JavaScript Bridge or provide a StoryblokBridgeConfigV2 configuration object. Enabled by default.
|
|
18
|
+
*/
|
|
19
|
+
bridge?: boolean | StoryblokBridgeConfigV2;
|
|
20
|
+
/**
|
|
21
|
+
* An object containing your Astro components to their Storyblok equivalents.
|
|
22
|
+
* Example:
|
|
23
|
+
* ```js
|
|
24
|
+
* components: {
|
|
25
|
+
* page: "storyblok/Page",
|
|
26
|
+
* feature: "storyblok/Feature",
|
|
27
|
+
* grid: "storyblok/Grid",
|
|
28
|
+
* teaser: "storyblok/Teaser",
|
|
29
|
+
* },
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
components?: Record<string, string>;
|
|
33
|
+
/**
|
|
34
|
+
* The directory containing your Astro components are. Defaults to "src".
|
|
35
|
+
*/
|
|
36
|
+
componentsDir?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Show a fallback component in your frontend if a component is not registered properly.
|
|
39
|
+
*/
|
|
40
|
+
enableFallbackComponent?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Provide a path to a custom fallback component, e.g. "storyblok/customFallback".
|
|
43
|
+
* Please note: the path takes into account the `componentsDir` option.
|
|
44
|
+
*/
|
|
45
|
+
customFallbackComponent?: string;
|
|
46
|
+
/**
|
|
47
|
+
* A boolean to enable/disable the Experimental Live Preview feature. Disabled by default.
|
|
48
|
+
*/
|
|
49
|
+
livePreview?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export default function storyblokIntegration(options: IntegrationOptions): AstroIntegration;
|