@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 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
- My new Nuxt module for doing amazing things.
8
+ A set of components to render Gutenberg Blocks with the WPNuxt module
18
9
 
19
- - [✨ &nbsp;Release Notes](/CHANGELOG.md)
20
- <!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
21
- <!-- - [📖 &nbsp;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
- ## Features
24
-
25
- <!-- Highlight some of the features your module provide here -->
26
- - ⛰ &nbsp;Foo
27
- - 🚠 &nbsp;Bar
28
- - 🌲 &nbsp;Baz
12
+ - [✨ &nbsp;Release Notes](/CHANGELOG.md)
13
+ - [🏀 Online playground](https://stackblitz.com/github/wpnuxt/wpnuxt-blocks?file=playground%2Fapp%2Fpages%2F%5B...slug%5D.vue)
14
+ - [📖 &nbsp;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 my-module
21
+ npx nuxi module add @wpnuxt/blocks
36
22
  ```
37
23
 
38
- That's it! You can now use My Module in your Nuxt app ✨
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
- npm install
34
+ pnpm install
49
35
 
50
36
  # Generate type stubs
51
- npm run dev:prepare
37
+ pnpm run dev:prepare
52
38
 
53
39
  # Develop with the playground
54
- npm run dev
40
+ pnpm run dev
55
41
 
56
42
  # Build the playground
57
- npm run dev:build
43
+ pnpm run dev:build
58
44
 
59
45
  # Run ESLint
60
- npm run lint
46
+ pnpm run lint
61
47
 
62
48
  # Run Vitest
63
- npm run test
64
- npm run test:watch
49
+ pnpm run test
50
+ pnpm run test:watch
65
51
 
66
52
  # Release new version
67
- npm run release
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/my-module/latest.svg?style=flat&colorA=020420&colorB=00DC82
75
- [npm-version-href]: https://npmjs.com/package/my-module
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/my-module.svg?style=flat&colorA=020420&colorB=00DC82
78
- [npm-downloads-href]: https://npmjs.com/package/my-module
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/my-module.svg?style=flat&colorA=020420&colorB=00DC82
81
- [license-href]: https://npmjs.com/package/my-module
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-020420?logo=nuxt.js
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wpnuxt/blocks",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "configKey": "wpNuxtBlocks",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.1",
package/dist/module.mjs CHANGED
@@ -3,7 +3,7 @@ import { defineNuxtModule, createResolver, installModule, addComponentsDir, addC
3
3
  import { genDynamicImport } from 'knitwork';
4
4
 
5
5
  const name = "@wpnuxt/blocks";
6
- const version = "0.0.4";
6
+ const version = "0.0.6";
7
7
 
8
8
  const module = defineNuxtModule({
9
9
  meta: {
@@ -1,19 +1,17 @@
1
1
  <script setup lang="ts">
2
2
  import { pascalCase } from 'scule'
3
- import { resolveComponent, useRuntimeConfig } from '#imports'
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 (config.public.wpNuxt.blocks && props.block.name) {
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.4",
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.4"
40
+ "@wpnuxt/core": "^1.0.0-edge.6"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@nuxt/devtools": "^1.3.9",