@storyblok/vue 8.0.8 â 8.0.9-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/README.md +28 -27
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -33,14 +33,15 @@
|
|
|
33
33
|
> **Note**
|
|
34
34
|
> This plugin is for Vue 3. [Check out the docs for Vue 2 version](https://github.com/storyblok/storyblok-vue-2).
|
|
35
35
|
|
|
36
|
-
##
|
|
36
|
+
## Kickstart a new project
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
Are you eager to dive into coding? **[Follow these steps to kickstart a new project with Storyblok and Vue](https://www.storyblok.com/technologies#vue?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-vue)**, and get started in just a few minutes!
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
## 5-minute Tutorial
|
|
41
|
+
|
|
42
|
+
Are you looking for a hands-on, step-by-step tutorial? The **[Vue 5-minute Tutorial](https://www.storyblok.com/tp/add-a-headless-CMS-to-vuejs-in-5-minutes?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-vue)** has you covered! It provides comprehensive instructions on how to set up a Storyblok space and connect it to your Vue project.
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
## Installation
|
|
44
45
|
|
|
45
46
|
Install `@storyblok/vue`
|
|
46
47
|
|
|
@@ -80,7 +81,7 @@ Install the file from the CDN and access the methods via `window.storyblokVue`:
|
|
|
80
81
|
<script src="https://unpkg.com/@storyblok/vue"></script>
|
|
81
82
|
```
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
## Getting started
|
|
84
85
|
|
|
85
86
|
`@storyblok/vue` does three actions when you initialize it:
|
|
86
87
|
|
|
@@ -88,7 +89,7 @@ Install the file from the CDN and access the methods via `window.storyblokVue`:
|
|
|
88
89
|
- Loads [Storyblok Bridge](https://www.storyblok.com/docs/Guides/storyblok-latest-js?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-vue) for real-time visual updates
|
|
89
90
|
- Provides a `v-editable` directive to link editable components to the Storyblok Visual Editor
|
|
90
91
|
|
|
91
|
-
|
|
92
|
+
### Short Form
|
|
92
93
|
|
|
93
94
|
Load globally the Vue components you want to link to Storyblok in your _main.js_ file:
|
|
94
95
|
|
|
@@ -127,7 +128,7 @@ The simplest way is by using the `useStoryblok` one-liner composable. Where you
|
|
|
127
128
|
|
|
128
129
|
Check the available [apiOptions](https://www.storyblok.com/docs/api/content-delivery/v2#core-resources/stories/retrieve-one-story?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-vue) in our API docs and [bridgeOptions](https://www.storyblok.com/docs/Guides/storyblok-latest-js?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-vue) passed to the Storyblok Bridge.
|
|
129
130
|
|
|
130
|
-
|
|
131
|
+
### Rendering Rich Text
|
|
131
132
|
|
|
132
133
|
You can easily render rich text by using the `renderRichText` function that comes with `@storyblok/vue` and a Vue computed property:
|
|
133
134
|
|
|
@@ -190,9 +191,9 @@ renderRichText(blok.richTextField, {
|
|
|
190
191
|
});
|
|
191
192
|
```
|
|
192
193
|
|
|
193
|
-
|
|
194
|
+
### Long Form
|
|
194
195
|
|
|
195
|
-
|
|
196
|
+
#### 1. Fetching Content
|
|
196
197
|
|
|
197
198
|
Inject `storyblokApi` when using Composition API:
|
|
198
199
|
|
|
@@ -217,7 +218,7 @@ Inject `storyblokApi` when using Composition API:
|
|
|
217
218
|
> **Note**
|
|
218
219
|
> You can skip using `apiPlugin` if you prefer your own method or function to fetch your data.
|
|
219
220
|
|
|
220
|
-
|
|
221
|
+
#### 2. Listen to Storyblok Visual Editor events
|
|
221
222
|
|
|
222
223
|
Use `useStoryBridge` to get the new story every time is triggered a `change` event from the Visual Editor. You need to pass the story id as first param, and a callback function as second param to update the new story:
|
|
223
224
|
|
|
@@ -252,7 +253,7 @@ useStoryblokBridge(
|
|
|
252
253
|
);
|
|
253
254
|
```
|
|
254
255
|
|
|
255
|
-
|
|
256
|
+
#### 3. Link your components to Storyblok Visual Editor
|
|
256
257
|
|
|
257
258
|
For every component you've defined in your Storyblok space, add the `v-editable` directive with the blok content:
|
|
258
259
|
|
|
@@ -266,11 +267,11 @@ Where `blok` is the actual blok data coming from [Storblok's Content Delivery AP
|
|
|
266
267
|
|
|
267
268
|
Check out the [playground](/../../tree/next/playground) for a full example.
|
|
268
269
|
|
|
269
|
-
|
|
270
|
+
## Features and API
|
|
270
271
|
|
|
271
272
|
You can **choose the features to use** when you initialize the plugin. In that way, you can improve Web Performance by optimizing your page load and save some bytes.
|
|
272
273
|
|
|
273
|
-
|
|
274
|
+
### useStoryblok(pathToStory, apiOptions = {}, bridgeOptions = {})
|
|
274
275
|
|
|
275
276
|
This example of `useStoryblok`:
|
|
276
277
|
|
|
@@ -311,7 +312,7 @@ Is equivalent to the following, using `useStoryblokBridge` and `useStoryblokApi`
|
|
|
311
312
|
|
|
312
313
|
Check the available [apiOptions](https://www.storyblok.com/docs/api/content-delivery/v2#core-resources/stories/retrieve-one-story?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-vue) (passed to `storyblok-js-client`) and [bridgeOptions](https://www.storyblok.com/docs/Guides/storyblok-latest-js?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-vue) (passed to the Storyblok Bridge).
|
|
313
314
|
|
|
314
|
-
|
|
315
|
+
### Storyblok API
|
|
315
316
|
|
|
316
317
|
You can use an `apiOptions` object. This is passed down to the [storyblok-js-client config object](https://github.com/storyblok/storyblok-js-client#class-storyblok).
|
|
317
318
|
|
|
@@ -332,7 +333,7 @@ If you prefer to use your own fetch method, just remove the `apiPlugin` and `sto
|
|
|
332
333
|
app.use(StoryblokVue);
|
|
333
334
|
```
|
|
334
335
|
|
|
335
|
-
|
|
336
|
+
## Region parameter
|
|
336
337
|
|
|
337
338
|
Possible values:
|
|
338
339
|
|
|
@@ -357,7 +358,7 @@ app.use(StoryblokVue, {
|
|
|
357
358
|
> **Important**
|
|
358
359
|
> For spaces created in the United States or China, the `region` parameter **must** be specified.
|
|
359
360
|
|
|
360
|
-
|
|
361
|
+
## Storyblok Bridge
|
|
361
362
|
|
|
362
363
|
You can conditionally load it by using the `bridge` option. Very useful if you want to disable it in production:
|
|
363
364
|
|
|
@@ -377,7 +378,7 @@ sbBridge.on(["input", "published", "change"], (event) => {
|
|
|
377
378
|
});
|
|
378
379
|
```
|
|
379
380
|
|
|
380
|
-
|
|
381
|
+
## Using Fallback components
|
|
381
382
|
|
|
382
383
|
By default, `@storyblok/vue` show a `console.error` if a component is not implemented. Setting `enableFallbackComponent` to `true` bypasses that behavior, rendering a fallback component in the frontend instead.
|
|
383
384
|
|
|
@@ -402,7 +403,7 @@ app.use(StoryblokVue, {
|
|
|
402
403
|
app.component("MyCustomFallback", MyCustomFallback);
|
|
403
404
|
```
|
|
404
405
|
|
|
405
|
-
|
|
406
|
+
## Compatibility
|
|
406
407
|
|
|
407
408
|
This plugin is for Vue 3. Thus, it supports the [same browsers as Vue 3](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0038-vue3-ie11-support.md). In short: all modern browsers, dropping IE support.
|
|
408
409
|
|
|
@@ -410,20 +411,20 @@ This plugin is for Vue 3. Thus, it supports the [same browsers as Vue 3](https:/
|
|
|
410
411
|
|
|
411
412
|

|
|
412
413
|
|
|
413
|
-
##
|
|
414
|
-
|
|
415
|
-
- **[Add a headless CMS to Vue.js in 5 minutes](https://www.storyblok.com/tp/add-a-headless-CMS-to-vuejs-in-5-minutes?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-vue)**: Quick-start guide on getting up and running with Storyblok and Vue.
|
|
416
|
-
- **[Storyblok & Vue.js on GitHub](https://github.com/search?q=org%3Astoryblok+topic%3Avue)**: Check all of our Vue.js open source repos.
|
|
417
|
-
- **[Storyblok CLI](https://github.com/storyblok/storyblok)**: A simple CLI for scaffolding Storyblok projects and fieldtypes.
|
|
414
|
+
## Further Resources
|
|
418
415
|
|
|
419
|
-
|
|
416
|
+
- [Quick Start](https://www.storyblok.com/technologies?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-vue)
|
|
417
|
+
- [API Documentation](https://www.storyblok.com/docs/api?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-vue)
|
|
418
|
+
- [Developer Tutorials](https://www.storyblok.com/tutorials?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-vue)
|
|
419
|
+
- [Developer Guides](https://www.storyblok.com/docs/guide/introduction?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-vue)
|
|
420
|
+
- [FAQs](https://www.storyblok.com/faqs?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-vue)
|
|
420
421
|
|
|
421
|
-
|
|
422
|
+
## Support
|
|
422
423
|
|
|
423
424
|
- Bugs or Feature Requests? [Submit an issue](/../../issues/new).
|
|
424
425
|
- Do you have questions about Storyblok or you need help? [Join our Discord Community](https://discord.gg/jKrbAMz).
|
|
425
426
|
|
|
426
|
-
|
|
427
|
+
## Contributing
|
|
427
428
|
|
|
428
429
|
Please see our [contributing guidelines](https://github.com/storyblok/.github/blob/master/contributing.md) and our [code of conduct](https://www.storyblok.com/trust-center#code-of-conduct?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-vue).
|
|
429
430
|
This project use [semantic-release](https://semantic-release.gitbook.io/semantic-release/) for generate new versions by using commit messages and we use the Angular Convention to naming the commits. Check [this question](https://semantic-release.gitbook.io/semantic-release/support/faq#how-can-i-change-the-type-of-commits-that-trigger-a-release) about it in semantic-release FAQ.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyblok/vue",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.9-next.1",
|
|
4
4
|
"description": "Storyblok directive for get editable elements.",
|
|
5
5
|
"main": "./dist/storyblok-vue.js",
|
|
6
6
|
"module": "./dist/storyblok-vue.mjs",
|
|
@@ -28,22 +28,22 @@
|
|
|
28
28
|
"@storyblok/js": "^3.0.8"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@babel/core": "^7.24.
|
|
32
|
-
"@cypress/vite-dev-server": "^5.0
|
|
31
|
+
"@babel/core": "^7.24.7",
|
|
32
|
+
"@cypress/vite-dev-server": "^5.1.0",
|
|
33
33
|
"@cypress/vue": "^6.0.0",
|
|
34
|
-
"@vitejs/plugin-vue": "^5.0.
|
|
34
|
+
"@vitejs/plugin-vue": "^5.0.5",
|
|
35
35
|
"@vue/babel-preset-app": "^5.0.8",
|
|
36
|
-
"@vue/test-utils": "2.4.
|
|
36
|
+
"@vue/test-utils": "2.4.6",
|
|
37
37
|
"@vue/tsconfig": "^0.1.3",
|
|
38
38
|
"@vue/vue3-jest": "^29.2.6",
|
|
39
39
|
"babel-jest": "^29.4.3",
|
|
40
|
-
"cypress": "^13.
|
|
40
|
+
"cypress": "^13.11.0",
|
|
41
41
|
"eslint-plugin-cypress": "^2.15.1",
|
|
42
|
-
"eslint-plugin-jest": "^28.
|
|
42
|
+
"eslint-plugin-jest": "^28.5.0",
|
|
43
43
|
"jest": "^29.6.4",
|
|
44
44
|
"typescript": "^4.9.5",
|
|
45
|
-
"vite": "^5.2.
|
|
46
|
-
"vue": "^3.4.
|
|
45
|
+
"vite": "^5.2.12",
|
|
46
|
+
"vue": "^3.4.27",
|
|
47
47
|
"vue-tsc": "^1.8.0"
|
|
48
48
|
},
|
|
49
49
|
"babel": {
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"vue",
|
|
71
71
|
"storyblok"
|
|
72
72
|
],
|
|
73
|
-
"author": "Alexander Feiglstorfer",
|
|
73
|
+
"author": "Alexander Feiglstorfer (CTO)",
|
|
74
74
|
"bugs": {
|
|
75
75
|
"url": "https://github.com/storyblok/storyblok-vue/issues"
|
|
76
76
|
},
|