@storyblok/svelte 2.1.0 → 2.1.3
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/README.md +18 -0
- package/dist/types.d.ts +1 -1
- package/package.json +3 -2
- package/types.ts +35 -0
package/README.md
CHANGED
|
@@ -203,6 +203,24 @@ For background information on the [Storyblok JS Bridge](https://www.storyblok.co
|
|
|
203
203
|
|
|
204
204
|
This plugin is for Svelte. Thus, it supports the [same browsers as Svelte 3](https://github.com/sveltejs/svelte/issues/558). In short: all modern browsers and IE10+.
|
|
205
205
|
|
|
206
|
+
## Troubleshooting
|
|
207
|
+
|
|
208
|
+
### Working with a Component Library
|
|
209
|
+
|
|
210
|
+
When working with a component library, create an alias pointing '@storyblok/svelte' to './node_modules/@storyblok/svelte'. This will ensure the imported module will use the local version of storyblok. In your `svelte.config.js`, include:
|
|
211
|
+
|
|
212
|
+
```js
|
|
213
|
+
kit: {
|
|
214
|
+
alias: {
|
|
215
|
+
'@storyblok/svelte': './node_modules/@storyblok/svelte'
|
|
216
|
+
},
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Any module importing @storyblok/svelte will now get it from the aliased location. For more information and alternatives to this solution, please see [npm link, peerDependencies and webpack](https://penx.medium.com/managing-dependencies-in-a-node-package-so-that-they-are-compatible-with-npm-link-61befa5aaca7).
|
|
221
|
+
|
|
222
|
+
Another option might also be using npm / yarn workspaces.
|
|
223
|
+
|
|
206
224
|
## 🔗 Related Links
|
|
207
225
|
|
|
208
226
|
- **[Add a headless CMS to Svelte in 5 minutes](https://www.storyblok.com/tp/add-a-headless-cms-to-svelte-in-5-minutes?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-svelte)**: Quick-start guide on getting up and running with Storyblok and Vue.
|
package/dist/types.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export interface SbSvelteComponentsMap {
|
|
|
6
6
|
export interface SbSvelteSDKOptions extends SbSDKOptions {
|
|
7
7
|
components?: SbSvelteComponentsMap;
|
|
8
8
|
}
|
|
9
|
-
export type { AlternateObject, Richtext, RichtextInstance, SbBlokData, SbBlokKeyDataTypes, SbSDKOptions, Stories, StoriesParams, Story, StoryData, StoryParams, StoryblokBridgeConfigV2, StoryblokBridgeV2, StoryblokCache, StoryblokCacheProvider, StoryblokClient, StoryblokConfig, StoryblokManagmentApiResult, StoryblokResult, apiPlugin, useStoryblokBridge, } from "@storyblok/js";
|
|
9
|
+
export type { AlternateObject, Richtext, RichtextInstance, SbBlokData, SbBlokKeyDataTypes, SbSDKOptions, Stories, StoriesParams, Story, StoryData, StoryParams, StoryblokBridgeConfigV2, StoryblokBridgeV2, StoryblokCache, StoryblokCacheProvider, StoryblokClient, StoryblokComponentType, StoryblokConfig, StoryblokManagmentApiResult, StoryblokResult, apiPlugin, useStoryblokBridge, } from "@storyblok/js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyblok/svelte",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Storyblok SDK to connect Storyblok with Svelte",
|
|
5
5
|
"main": "./dist/storyblok-svelte.js",
|
|
6
6
|
"module": "./dist/storyblok-svelte.mjs",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"dist",
|
|
11
11
|
"index.ts",
|
|
12
|
+
"types.ts",
|
|
12
13
|
"StoryblokComponent.svelte"
|
|
13
14
|
],
|
|
14
15
|
"exports": {
|
|
@@ -41,7 +42,7 @@
|
|
|
41
42
|
"jest": "^27.5.1",
|
|
42
43
|
"svelte-preprocess": "^4.10.7",
|
|
43
44
|
"typescript": "^4.7.3",
|
|
44
|
-
"vite": "^2.9.
|
|
45
|
+
"vite": "^2.9.13"
|
|
45
46
|
},
|
|
46
47
|
"eslintConfig": {
|
|
47
48
|
"env": {
|
package/types.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { SbSDKOptions } from "@storyblok/js";
|
|
2
|
+
import type { SvelteComponent } from "svelte";
|
|
3
|
+
|
|
4
|
+
export interface SbSvelteComponentsMap {
|
|
5
|
+
[name: string]: typeof SvelteComponent;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface SbSvelteSDKOptions extends SbSDKOptions {
|
|
9
|
+
components?: SbSvelteComponentsMap;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type {
|
|
13
|
+
AlternateObject,
|
|
14
|
+
Richtext,
|
|
15
|
+
RichtextInstance,
|
|
16
|
+
SbBlokData,
|
|
17
|
+
SbBlokKeyDataTypes,
|
|
18
|
+
SbSDKOptions,
|
|
19
|
+
Stories,
|
|
20
|
+
StoriesParams,
|
|
21
|
+
Story,
|
|
22
|
+
StoryData,
|
|
23
|
+
StoryParams,
|
|
24
|
+
StoryblokBridgeConfigV2,
|
|
25
|
+
StoryblokBridgeV2,
|
|
26
|
+
StoryblokCache,
|
|
27
|
+
StoryblokCacheProvider,
|
|
28
|
+
StoryblokClient,
|
|
29
|
+
StoryblokComponentType,
|
|
30
|
+
StoryblokConfig,
|
|
31
|
+
StoryblokManagmentApiResult,
|
|
32
|
+
StoryblokResult,
|
|
33
|
+
apiPlugin,
|
|
34
|
+
useStoryblokBridge,
|
|
35
|
+
} from "@storyblok/js";
|