@wpnuxt/blocks 0.0.4 → 0.0.6
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 +23 -37
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/BlockComponent.vue +2 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,41 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
Get your module up and running quickly.
|
|
3
|
-
|
|
4
|
-
Find and replace all on all files (CMD+SHIFT+F):
|
|
5
|
-
- Name: My Module
|
|
6
|
-
- Package name: my-module
|
|
7
|
-
- Description: My new Nuxt module
|
|
8
|
-
-->
|
|
9
|
-
|
|
10
|
-
# My Module
|
|
1
|
+
# WPNuxt Blocks
|
|
11
2
|
|
|
12
3
|
[![npm version][npm-version-src]][npm-version-href]
|
|
13
4
|
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
14
5
|
[![License][license-src]][license-href]
|
|
15
6
|
[![Nuxt][nuxt-src]][nuxt-href]
|
|
16
7
|
|
|
17
|
-
|
|
8
|
+
A set of components to render Gutenberg Blocks with the WPNuxt module
|
|
18
9
|
|
|
19
|
-
|
|
20
|
-
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
|
|
21
|
-
<!-- - [📖 Documentation](https://example.com) -->
|
|
10
|
+
Allows to override each block component to be overriden by a custom component to have full control over how every Gutenberg Block is rendered in Nuxt.
|
|
22
11
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- ⛰ Foo
|
|
27
|
-
- 🚠 Bar
|
|
28
|
-
- 🌲 Baz
|
|
12
|
+
- [✨ Release Notes](/CHANGELOG.md)
|
|
13
|
+
- [🏀 Online playground](https://stackblitz.com/github/wpnuxt/wpnuxt-blocks?file=playground%2Fapp%2Fpages%2F%5B...slug%5D.vue)
|
|
14
|
+
- [📖 Documentation](https://wpnuxt.com)
|
|
29
15
|
|
|
30
16
|
## Quick Setup
|
|
31
17
|
|
|
32
18
|
Install the module to your Nuxt application with one command:
|
|
33
19
|
|
|
34
20
|
```bash
|
|
35
|
-
npx nuxi module add
|
|
21
|
+
npx nuxi module add @wpnuxt/blocks
|
|
36
22
|
```
|
|
37
23
|
|
|
38
|
-
That's it! You can now use
|
|
24
|
+
That's it! You can now use WPNuxt Blocks in your Nuxt app ✨
|
|
39
25
|
|
|
40
26
|
|
|
41
27
|
## Contribution
|
|
@@ -45,40 +31,40 @@ That's it! You can now use My Module in your Nuxt app ✨
|
|
|
45
31
|
|
|
46
32
|
```bash
|
|
47
33
|
# Install dependencies
|
|
48
|
-
|
|
34
|
+
pnpm install
|
|
49
35
|
|
|
50
36
|
# Generate type stubs
|
|
51
|
-
|
|
37
|
+
pnpm run dev:prepare
|
|
52
38
|
|
|
53
39
|
# Develop with the playground
|
|
54
|
-
|
|
40
|
+
pnpm run dev
|
|
55
41
|
|
|
56
42
|
# Build the playground
|
|
57
|
-
|
|
43
|
+
pnpm run dev:build
|
|
58
44
|
|
|
59
45
|
# Run ESLint
|
|
60
|
-
|
|
46
|
+
pnpm run lint
|
|
61
47
|
|
|
62
48
|
# Run Vitest
|
|
63
|
-
|
|
64
|
-
|
|
49
|
+
pnpm run test
|
|
50
|
+
pnpm run test:watch
|
|
65
51
|
|
|
66
52
|
# Release new version
|
|
67
|
-
|
|
53
|
+
pnpm run release
|
|
68
54
|
```
|
|
69
55
|
|
|
70
56
|
</details>
|
|
71
57
|
|
|
72
58
|
|
|
73
59
|
<!-- Badges -->
|
|
74
|
-
[npm-version-src]: https://img.shields.io/npm/v/
|
|
75
|
-
[npm-version-href]: https://npmjs.com/package/
|
|
60
|
+
[npm-version-src]: https://img.shields.io/npm/v/@wpnuxt/core/latest.svg?style=flat&colorA=020420&colorB=00DC82
|
|
61
|
+
[npm-version-href]: https://www.npmjs.com/package/@wpnuxt/core
|
|
76
62
|
|
|
77
|
-
[npm-downloads-src]: https://img.shields.io/npm/dm/
|
|
78
|
-
[npm-downloads-href]: https://npmjs.com/package/
|
|
63
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/@wpnuxt/core.svg?style=flat&colorA=020420&colorB=00DC82
|
|
64
|
+
[npm-downloads-href]: https://npmjs.com/package/@wpnuxt/core
|
|
79
65
|
|
|
80
|
-
[license-src]: https://img.shields.io/npm/l/
|
|
81
|
-
[license-href]: https://npmjs.com/package/
|
|
66
|
+
[license-src]: https://img.shields.io/npm/l/@wpnuxt/core.svg?style=flat&colorA=020420&colorB=00DC82
|
|
67
|
+
[license-href]: https://npmjs.com/package/@wpnuxt/core
|
|
82
68
|
|
|
83
|
-
[nuxt-src]: https://img.shields.io/badge/Nuxt-
|
|
69
|
+
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
|
|
84
70
|
[nuxt-href]: https://nuxt.com
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { pascalCase } from 'scule'
|
|
3
|
-
import { resolveComponent
|
|
3
|
+
import { resolveComponent } from '#imports'
|
|
4
4
|
import type { EditorBlock } from '#wpnuxt/blocks'
|
|
5
5
|
|
|
6
6
|
const manifest = await import('#wpnuxt/blocks').catch(() => ({}))
|
|
7
7
|
|
|
8
|
-
const config = useRuntimeConfig()
|
|
9
|
-
|
|
10
8
|
const props = defineProps<{
|
|
11
9
|
block: EditorBlock
|
|
12
10
|
}>()
|
|
13
11
|
const findComponentToRender = async () => {
|
|
14
12
|
// only process top level blocks
|
|
15
13
|
if (props.block.parentClientId === null || props.block.parentClientId === undefined) {
|
|
16
|
-
if (
|
|
14
|
+
if (props.block.name) {
|
|
17
15
|
const componentName = pascalCase(props.block.name)
|
|
18
16
|
const componentImporter = manifest[componentName]
|
|
19
17
|
if (typeof componentImporter === 'function') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wpnuxt/blocks",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "WPNuxt Blocks",
|
|
5
5
|
"repository": "wpnuxt/wpnuxt-blocks",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@nuxt/image": "^1.7.0",
|
|
38
38
|
"@nuxt/kit": "^3.12.4",
|
|
39
39
|
"@nuxt/ui": "^2.18.4",
|
|
40
|
-
"@wpnuxt/core": "^1.0.0-edge.
|
|
40
|
+
"@wpnuxt/core": "^1.0.0-edge.6"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@nuxt/devtools": "^1.3.9",
|