@storyblok/astro 2.0.0 → 2.0.2
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/StoryblokComponent.astro +1 -1
- package/dist/index.d.ts +39 -0
- package/dist/node_modules/camelcase/index.d.ts +102 -0
- package/dist/node_modules/esbuild/lib/main.d.ts +611 -0
- package/dist/node_modules/rollup/dist/rollup.d.ts +936 -0
- package/dist/node_modules/vite/client.d.ts +272 -0
- package/dist/node_modules/vite/dist/node/index.d.ts +3281 -0
- package/dist/node_modules/vite/types/customEvent.d.ts +23 -0
- package/dist/node_modules/vite/types/hmrPayload.d.ts +61 -0
- package/dist/node_modules/vite/types/hot.d.ts +32 -0
- package/dist/node_modules/vite/types/importGlob.d.ts +97 -0
- package/dist/node_modules/vite/types/importMeta.d.ts +28 -0
- package/dist/types.d.ts +12 -0
- package/dist/vite-plugin-storyblok-components.d.ts +5 -0
- package/dist/vite-plugin-storyblok-init.d.ts +5 -0
- package/package.json +7 -6
package/StoryblokComponent.astro
CHANGED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { StoryblokClient } from "@storyblok/js";
|
|
2
|
+
import type { AstroIntegration } from "astro";
|
|
3
|
+
import type { ISbConfig, ISbRichtext, SbRichTextOptions } from "./types";
|
|
4
|
+
export { storyblokEditable, loadStoryblokBridge, RichTextResolver, RichTextSchema, } from "@storyblok/js";
|
|
5
|
+
export declare function useStoryblokApi(): StoryblokClient;
|
|
6
|
+
export declare function renderRichText(data: ISbRichtext, options?: SbRichTextOptions): string;
|
|
7
|
+
export interface IntegrationOptions {
|
|
8
|
+
/**
|
|
9
|
+
* The access token from your space.
|
|
10
|
+
*/
|
|
11
|
+
accessToken: string;
|
|
12
|
+
/**
|
|
13
|
+
* 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.
|
|
14
|
+
*/
|
|
15
|
+
useCustomApi?: false;
|
|
16
|
+
/**
|
|
17
|
+
* Set custom API options here (cache, region, and more). All options are documented [here](https://github.com/storyblok/storyblok-js-client#class-storyblok).
|
|
18
|
+
*/
|
|
19
|
+
apiOptions?: ISbConfig;
|
|
20
|
+
/**
|
|
21
|
+
* A boolean to enable/disable the Storyblok JavaScript Bridge. Enabled by default.
|
|
22
|
+
*/
|
|
23
|
+
bridge?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* An object containing your Astro components to their Storyblok equivalents.
|
|
26
|
+
* Example:
|
|
27
|
+
* ```js
|
|
28
|
+
* components: {
|
|
29
|
+
* page: "storyblok/Page",
|
|
30
|
+
* feature: "storyblok/Feature",
|
|
31
|
+
* grid: "storyblok/Grid",
|
|
32
|
+
* teaser: "storyblok/Teaser",
|
|
33
|
+
* },
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
components?: object;
|
|
37
|
+
}
|
|
38
|
+
export default function storyblokIntegration(options?: IntegrationOptions): AstroIntegration;
|
|
39
|
+
export * from "./types";
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export type Options = {
|
|
2
|
+
/**
|
|
3
|
+
Uppercase the first character: `foo-bar` → `FooBar`.
|
|
4
|
+
|
|
5
|
+
@default false
|
|
6
|
+
*/
|
|
7
|
+
readonly pascalCase?: boolean;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
Preserve consecutive uppercase characters: `foo-BAR` → `FooBAR`.
|
|
11
|
+
|
|
12
|
+
@default false
|
|
13
|
+
*/
|
|
14
|
+
readonly preserveConsecutiveUppercase?: boolean;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
The locale parameter indicates the locale to be used to convert to upper/lower case according to any locale-specific case mappings. If multiple locales are given in an array, the best available locale is used.
|
|
18
|
+
|
|
19
|
+
Setting `locale: false` ignores the platform locale and uses the [Unicode Default Case Conversion](https://unicode-org.github.io/icu/userguide/transforms/casemappings.html#simple-single-character-case-mapping) algorithm.
|
|
20
|
+
|
|
21
|
+
Default: The host environment’s current locale.
|
|
22
|
+
|
|
23
|
+
@example
|
|
24
|
+
```
|
|
25
|
+
import camelCase from 'camelcase';
|
|
26
|
+
|
|
27
|
+
camelCase('lorem-ipsum', {locale: 'en-US'});
|
|
28
|
+
//=> 'loremIpsum'
|
|
29
|
+
|
|
30
|
+
camelCase('lorem-ipsum', {locale: 'tr-TR'});
|
|
31
|
+
//=> 'loremİpsum'
|
|
32
|
+
|
|
33
|
+
camelCase('lorem-ipsum', {locale: ['en-US', 'en-GB']});
|
|
34
|
+
//=> 'loremIpsum'
|
|
35
|
+
|
|
36
|
+
camelCase('lorem-ipsum', {locale: ['tr', 'TR', 'tr-TR']});
|
|
37
|
+
//=> 'loremİpsum'
|
|
38
|
+
```
|
|
39
|
+
*/
|
|
40
|
+
readonly locale?: false | string | readonly string[];
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`.
|
|
45
|
+
|
|
46
|
+
Correctly handles Unicode strings.
|
|
47
|
+
|
|
48
|
+
@param input - String to convert to camel case.
|
|
49
|
+
|
|
50
|
+
@example
|
|
51
|
+
```
|
|
52
|
+
import camelCase from 'camelcase';
|
|
53
|
+
|
|
54
|
+
camelCase('foo-bar');
|
|
55
|
+
//=> 'fooBar'
|
|
56
|
+
|
|
57
|
+
camelCase('foo_bar');
|
|
58
|
+
//=> 'fooBar'
|
|
59
|
+
|
|
60
|
+
camelCase('Foo-Bar');
|
|
61
|
+
//=> 'fooBar'
|
|
62
|
+
|
|
63
|
+
camelCase('розовый_пушистый_единорог');
|
|
64
|
+
//=> 'розовыйПушистыйЕдинорог'
|
|
65
|
+
|
|
66
|
+
camelCase('Foo-Bar', {pascalCase: true});
|
|
67
|
+
//=> 'FooBar'
|
|
68
|
+
|
|
69
|
+
camelCase('--foo.bar', {pascalCase: false});
|
|
70
|
+
//=> 'fooBar'
|
|
71
|
+
|
|
72
|
+
camelCase('Foo-BAR', {preserveConsecutiveUppercase: true});
|
|
73
|
+
//=> 'fooBAR'
|
|
74
|
+
|
|
75
|
+
camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true}));
|
|
76
|
+
//=> 'FooBAR'
|
|
77
|
+
|
|
78
|
+
camelCase('foo bar');
|
|
79
|
+
//=> 'fooBar'
|
|
80
|
+
|
|
81
|
+
console.log(process.argv[3]);
|
|
82
|
+
//=> '--foo-bar'
|
|
83
|
+
camelCase(process.argv[3]);
|
|
84
|
+
//=> 'fooBar'
|
|
85
|
+
|
|
86
|
+
camelCase(['foo', 'bar']);
|
|
87
|
+
//=> 'fooBar'
|
|
88
|
+
|
|
89
|
+
camelCase(['__foo__', '--bar'], {pascalCase: true});
|
|
90
|
+
//=> 'FooBar'
|
|
91
|
+
|
|
92
|
+
camelCase(['foo', 'BAR'], {pascalCase: true, preserveConsecutiveUppercase: true})
|
|
93
|
+
//=> 'FooBAR'
|
|
94
|
+
|
|
95
|
+
camelCase('lorem-ipsum', {locale: 'en-US'});
|
|
96
|
+
//=> 'loremIpsum'
|
|
97
|
+
```
|
|
98
|
+
*/
|
|
99
|
+
export default function camelcase(
|
|
100
|
+
input: string | readonly string[],
|
|
101
|
+
options?: Options
|
|
102
|
+
): string;
|