@wpnuxt/blocks 0.0.17 → 2.0.0-alpha.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/dist/module.d.mts +19 -4
- package/dist/module.json +1 -1
- package/dist/module.mjs +130 -37
- package/dist/runtime/components/BlockComponent.d.vue.ts +0 -7
- package/dist/runtime/components/BlockComponent.vue +6 -9
- package/dist/runtime/components/BlockComponent.vue.d.ts +0 -7
- package/dist/runtime/components/BlockRenderer.d.vue.ts +0 -7
- package/dist/runtime/components/BlockRenderer.vue +7 -3
- package/dist/runtime/components/BlockRenderer.vue.d.ts +0 -7
- package/dist/runtime/components/blocks/CoreButton.d.vue.ts +0 -7
- package/dist/runtime/components/blocks/CoreButton.vue +32 -5
- package/dist/runtime/components/blocks/CoreButton.vue.d.ts +0 -7
- package/dist/runtime/components/blocks/CoreButtons.d.vue.ts +0 -7
- package/dist/runtime/components/blocks/CoreButtons.vue +10 -8
- package/dist/runtime/components/blocks/CoreButtons.vue.d.ts +0 -7
- package/dist/runtime/components/blocks/CoreDetails.d.vue.ts +0 -0
- package/dist/runtime/components/blocks/CoreDetails.vue +25 -0
- package/dist/runtime/components/blocks/CoreDetails.vue.d.ts +0 -0
- package/dist/runtime/components/blocks/CoreGallery.d.vue.ts +0 -7
- package/dist/runtime/components/blocks/CoreGallery.vue +1 -1
- package/dist/runtime/components/blocks/CoreGallery.vue.d.ts +0 -7
- package/dist/runtime/components/blocks/CoreHeading.d.vue.ts +0 -7
- package/dist/runtime/components/blocks/CoreHeading.vue +12 -12
- package/dist/runtime/components/blocks/CoreHeading.vue.d.ts +0 -7
- package/dist/runtime/components/blocks/CoreImage.d.vue.ts +0 -7
- package/dist/runtime/components/blocks/CoreImage.vue +4 -4
- package/dist/runtime/components/blocks/CoreImage.vue.d.ts +0 -7
- package/dist/runtime/components/blocks/CoreParagraph.d.vue.ts +0 -7
- package/dist/runtime/components/blocks/CoreParagraph.vue +3 -3
- package/dist/runtime/components/blocks/CoreParagraph.vue.d.ts +0 -7
- package/dist/runtime/components/blocks/CoreQuote.d.vue.ts +0 -7
- package/dist/runtime/components/blocks/CoreQuote.vue +1 -1
- package/dist/runtime/components/blocks/CoreQuote.vue.d.ts +0 -7
- package/dist/runtime/components/blocks/CoreSpacer.d.vue.ts +0 -7
- package/dist/runtime/components/blocks/CoreSpacer.vue +2 -2
- package/dist/runtime/components/blocks/CoreSpacer.vue.d.ts +0 -7
- package/dist/runtime/components/blocks/EditorBlock.d.vue.ts +0 -7
- package/dist/runtime/components/blocks/EditorBlock.vue +1 -1
- package/dist/runtime/components/blocks/EditorBlock.vue.d.ts +0 -7
- package/dist/runtime/queries/fragments/CoreDetails.fragment.gql +15 -0
- package/dist/runtime/queries/fragments/EditorBlock.fragment.gql +7 -7
- package/dist/runtime/queries/fragments/NodeWithEditorBlocks.fragment.gql +1 -1
- package/dist/runtime/types/index.d.ts +0 -0
- package/dist/runtime/types/index.js +0 -0
- package/dist/runtime/util/attributeColor.d.ts +0 -1
- package/dist/runtime/util/attributeFontSize.d.ts +0 -1
- package/dist/runtime/util/index.d.ts +0 -4
- package/dist/types.d.mts +7 -1
- package/package.json +37 -39
- package/README.md +0 -70
- package/dist/runtime/queries/fragments/Page.fragment.gql +0 -17
- package/dist/runtime/queries/fragments/Post.fragment.gql +0 -13
- package/dist/runtime/server/tsconfig.json +0 -3
package/dist/module.d.mts
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
|
|
3
|
-
interface
|
|
4
|
-
|
|
3
|
+
interface WPNuxtBlocksConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Enable or disable the module
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
8
|
+
enabled?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Domains to allow for @nuxt/image
|
|
11
|
+
* @default []
|
|
12
|
+
*/
|
|
13
|
+
imageDomains?: string[];
|
|
14
|
+
/**
|
|
15
|
+
* Enable Nuxt UI integration for enhanced button styling
|
|
16
|
+
* Set to false to use native HTML elements
|
|
17
|
+
* @default 'auto' - uses Nuxt UI if available
|
|
18
|
+
*/
|
|
19
|
+
nuxtUI?: boolean | 'auto';
|
|
5
20
|
}
|
|
6
|
-
declare const _default: _nuxt_schema.NuxtModule<
|
|
21
|
+
declare const _default: _nuxt_schema.NuxtModule<WPNuxtBlocksConfig, WPNuxtBlocksConfig, false>;
|
|
7
22
|
|
|
8
23
|
export { _default as default };
|
|
9
|
-
export type {
|
|
24
|
+
export type { WPNuxtBlocksConfig };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
import { promises } from 'node:fs';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const name = "@wpnuxt/blocks";
|
|
6
|
-
const version = "0.0.17";
|
|
1
|
+
import { existsSync, cpSync, promises } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { defineNuxtModule, createResolver, hasNuxtModule, installModule, addComponentsDir, addTemplate } from '@nuxt/kit';
|
|
7
4
|
|
|
8
5
|
const module$1 = defineNuxtModule({
|
|
9
6
|
meta: {
|
|
10
|
-
name,
|
|
11
|
-
version,
|
|
7
|
+
name: "@wpnuxt/blocks",
|
|
12
8
|
configKey: "wpNuxtBlocks"
|
|
13
9
|
},
|
|
14
|
-
// Default configuration options of the Nuxt module
|
|
15
10
|
defaults: {
|
|
16
|
-
enabled: true
|
|
11
|
+
enabled: true,
|
|
12
|
+
imageDomains: [],
|
|
13
|
+
nuxtUI: "auto"
|
|
17
14
|
},
|
|
18
|
-
async setup(
|
|
15
|
+
async setup(options, nuxt) {
|
|
16
|
+
if (!options.enabled) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
19
|
const { resolve } = createResolver(import.meta.url);
|
|
20
20
|
const resolveRuntimeModule = (path) => resolve("./runtime", path);
|
|
21
|
-
console.log("::: Setting up @wpnuxt/blocks module");
|
|
22
21
|
nuxt.options.alias["#wpnuxt/blocks"] = resolve(nuxt.options.buildDir, "wpnuxt/blocks");
|
|
23
|
-
|
|
22
|
+
if (options.nuxtUI === true || options.nuxtUI === "auto" && hasNuxtModule("@nuxt/ui")) {
|
|
23
|
+
await installModule("@nuxt/ui");
|
|
24
|
+
}
|
|
24
25
|
await installModule("@nuxt/image", {
|
|
25
|
-
|
|
26
|
-
domains: ["wordpress.wpnuxt.com"]
|
|
26
|
+
domains: options.imageDomains
|
|
27
27
|
});
|
|
28
|
+
await installModule("@radya/nuxt-dompurify");
|
|
29
|
+
const blocksQueriesPath = resolveRuntimeModule("./queries");
|
|
30
|
+
const mergedQueriesFolder = join(nuxt.options.srcDir, ".queries");
|
|
31
|
+
if (existsSync(mergedQueriesFolder) && existsSync(blocksQueriesPath)) {
|
|
32
|
+
cpSync(blocksQueriesPath, mergedQueriesFolder, { recursive: true });
|
|
33
|
+
}
|
|
28
34
|
addComponentsDir({
|
|
29
35
|
path: resolveRuntimeModule("./components"),
|
|
30
36
|
pathPrefix: false,
|
|
@@ -47,31 +53,118 @@ const module$1 = defineNuxtModule({
|
|
|
47
53
|
});
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
|
-
const componentsContext = { components: [] };
|
|
51
|
-
nuxt.hook("components:extend", (newComponents) => {
|
|
52
|
-
const moduleBlocksDir = resolveRuntimeModule("./components");
|
|
53
|
-
const userBlocksDir = (nuxt.options.srcDir || nuxt.options.rootDir) + "/components/blocks";
|
|
54
|
-
componentsContext.components = newComponents.filter((c) => {
|
|
55
|
-
if (c.filePath.startsWith(moduleBlocksDir) || c.filePath.startsWith(userBlocksDir)) {
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
return false;
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
56
|
addTemplate({
|
|
62
57
|
write: true,
|
|
63
58
|
filename: "wpnuxt/blocks.mjs",
|
|
64
|
-
getContents(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
getContents() {
|
|
60
|
+
return `// Generated by @wpnuxt/blocks
|
|
61
|
+
export * from '#build/graphql-operations'
|
|
62
|
+
`;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
addTemplate({
|
|
66
|
+
write: true,
|
|
67
|
+
filename: "wpnuxt/blocks.d.ts",
|
|
68
|
+
getContents() {
|
|
69
|
+
return `// Generated by @wpnuxt/blocks
|
|
70
|
+
export * from '#build/graphql-operations'
|
|
71
|
+
|
|
72
|
+
export interface EditorBlock {
|
|
73
|
+
__typename?: string
|
|
74
|
+
name?: string | null
|
|
75
|
+
clientId?: string | null
|
|
76
|
+
parentClientId?: string | null
|
|
77
|
+
renderedHtml?: string | null
|
|
78
|
+
attributes?: Record<string, unknown> | null
|
|
79
|
+
innerBlocks?: (EditorBlock | null)[] | null
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface CoreParagraph extends EditorBlock {
|
|
83
|
+
__typename?: 'CoreParagraph'
|
|
84
|
+
attributes?: {
|
|
85
|
+
content?: string | null
|
|
86
|
+
anchor?: string | null
|
|
87
|
+
className?: string | null
|
|
88
|
+
fontSize?: string | null
|
|
89
|
+
textColor?: string | null
|
|
90
|
+
style?: string | null
|
|
91
|
+
} | null
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface CoreHeading extends EditorBlock {
|
|
95
|
+
__typename?: 'CoreHeading'
|
|
96
|
+
attributes: {
|
|
97
|
+
content?: string | null
|
|
98
|
+
level: number
|
|
99
|
+
anchor?: string | null
|
|
100
|
+
className?: string | null
|
|
101
|
+
fontSize?: string | null
|
|
102
|
+
textColor?: string | null
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface CoreImage extends EditorBlock {
|
|
107
|
+
__typename?: 'CoreImage'
|
|
108
|
+
attributes?: {
|
|
109
|
+
url?: string | null
|
|
110
|
+
alt?: string | null
|
|
111
|
+
width?: number | null
|
|
112
|
+
height?: number | null
|
|
113
|
+
scale?: string | null
|
|
114
|
+
caption?: string | null
|
|
115
|
+
className?: string | null
|
|
116
|
+
} | null
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface CoreButton extends EditorBlock {
|
|
120
|
+
__typename?: 'CoreButton'
|
|
121
|
+
attributes: {
|
|
122
|
+
url?: string | null
|
|
123
|
+
text?: string | null
|
|
124
|
+
linkTarget?: string | null
|
|
125
|
+
rel?: string | null
|
|
126
|
+
style?: string | null
|
|
127
|
+
fontSize?: string | null
|
|
128
|
+
className?: string | null
|
|
129
|
+
cssClassName?: string | null
|
|
130
|
+
metadata?: string | null
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface CoreButtons extends EditorBlock {
|
|
135
|
+
__typename?: 'CoreButtons'
|
|
136
|
+
innerBlocks?: (CoreButton | null)[] | null
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface CoreQuote extends EditorBlock {
|
|
140
|
+
__typename?: 'CoreQuote'
|
|
141
|
+
innerBlocks?: (CoreParagraph | null)[] | null
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface CoreGallery extends EditorBlock {
|
|
145
|
+
__typename?: 'CoreGallery'
|
|
146
|
+
innerBlocks?: (CoreImage | null)[] | null
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface CoreSpacer extends EditorBlock {
|
|
150
|
+
__typename?: 'CoreSpacer'
|
|
151
|
+
attributes?: {
|
|
152
|
+
spacerHeight?: string | null
|
|
153
|
+
spacerWidth?: string | null
|
|
154
|
+
className?: string | null
|
|
155
|
+
} | null
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface CoreDetails extends EditorBlock {
|
|
159
|
+
__typename?: 'CoreDetails'
|
|
160
|
+
attributes?: {
|
|
161
|
+
summary?: string | null
|
|
162
|
+
showContent?: boolean | null
|
|
163
|
+
className?: string | null
|
|
164
|
+
} | null
|
|
165
|
+
}
|
|
166
|
+
`;
|
|
167
|
+
}
|
|
75
168
|
});
|
|
76
169
|
}
|
|
77
170
|
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { EditorBlock } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: EditorBlock;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { pascalCase } from "scule";
|
|
3
3
|
import { resolveComponent } from "#imports";
|
|
4
|
-
const manifest = await import("#wpnuxt/blocks").catch(() => ({}));
|
|
5
4
|
const props = defineProps({
|
|
6
5
|
block: { type: null, required: true }
|
|
7
6
|
});
|
|
8
|
-
const
|
|
7
|
+
const componentToRender = (() => {
|
|
9
8
|
if (props.block.parentClientId === null || props.block.parentClientId === void 0) {
|
|
10
9
|
if (props.block.name) {
|
|
11
10
|
const componentName = pascalCase(props.block.name);
|
|
12
|
-
const
|
|
13
|
-
if (typeof
|
|
14
|
-
return
|
|
11
|
+
const resolved = resolveComponent(componentName);
|
|
12
|
+
if (typeof resolved !== "string") {
|
|
13
|
+
return resolved;
|
|
15
14
|
}
|
|
16
15
|
}
|
|
17
16
|
return resolveComponent("EditorBlock");
|
|
18
|
-
} else {
|
|
19
|
-
return void 0;
|
|
20
17
|
}
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
return void 0;
|
|
19
|
+
})();
|
|
23
20
|
</script>
|
|
24
21
|
|
|
25
22
|
<template>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { EditorBlock } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: EditorBlock;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { NodeWithEditorBlocksFragment } from '#build/graphql-operations';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
node: NodeWithEditorBlocksFragment;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -7,10 +7,14 @@ defineProps({
|
|
|
7
7
|
|
|
8
8
|
<template>
|
|
9
9
|
<div>
|
|
10
|
-
<
|
|
10
|
+
<template
|
|
11
11
|
v-for="block, index in node.editorBlocks"
|
|
12
12
|
:key="index"
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
>
|
|
14
|
+
<BlockComponent
|
|
15
|
+
v-if="block"
|
|
16
|
+
:block="block"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
15
19
|
</div>
|
|
16
20
|
</template>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { NodeWithEditorBlocksFragment } from '#build/graphql-operations';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
node: NodeWithEditorBlocksFragment;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreButton } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreButton;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,25 +1,52 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { convertFontSize, getCssClasses } from "../../util";
|
|
3
|
-
import { ref } from "#imports";
|
|
3
|
+
import { ref, useNuxtApp } from "#imports";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
block: { type: null, required: true }
|
|
6
6
|
});
|
|
7
7
|
const variant = ref("solid");
|
|
8
8
|
if (props.block.attributes?.metadata) {
|
|
9
|
-
|
|
9
|
+
const metadataVariant = props.block.attributes?.metadata?.replaceAll('"', "");
|
|
10
|
+
if (["solid", "outline", "soft", "subtle", "ghost", "link"].includes(metadataVariant)) {
|
|
11
|
+
variant.value = metadataVariant;
|
|
12
|
+
}
|
|
10
13
|
}
|
|
14
|
+
const nuxtApp = useNuxtApp();
|
|
15
|
+
const hasNuxtUI = !!nuxtApp.vueApp.component("UButton");
|
|
11
16
|
</script>
|
|
12
17
|
|
|
13
18
|
<template>
|
|
19
|
+
<!-- Use Nuxt UI UButton when available -->
|
|
14
20
|
<UButton
|
|
15
|
-
|
|
21
|
+
v-if="hasNuxtUI"
|
|
22
|
+
:to="block.attributes.url ?? void 0"
|
|
16
23
|
:target="block.attributes.linkTarget"
|
|
17
24
|
:rel="block.attributes.rel"
|
|
18
25
|
:style="block.attributes.style"
|
|
19
26
|
:variant
|
|
20
27
|
:class="getCssClasses(block)"
|
|
21
|
-
:size="convertFontSize(block.attributes?.fontSize, '', 'md')"
|
|
28
|
+
:size="convertFontSize(block.attributes?.fontSize ?? void 0, '', 'md')"
|
|
22
29
|
>
|
|
23
|
-
<span v-sanitize="block.attributes.text" />
|
|
30
|
+
<span v-sanitize-html="block.attributes.text" />
|
|
24
31
|
</UButton>
|
|
32
|
+
|
|
33
|
+
<!-- Fallback to native link/button when Nuxt UI is not available -->
|
|
34
|
+
<a
|
|
35
|
+
v-else-if="block.attributes.url"
|
|
36
|
+
:href="block.attributes.url"
|
|
37
|
+
:target="block.attributes.linkTarget ?? void 0"
|
|
38
|
+
:rel="block.attributes.rel ?? void 0"
|
|
39
|
+
:style="block.attributes.style"
|
|
40
|
+
:class="['wp-block-button__link', getCssClasses(block)]"
|
|
41
|
+
>
|
|
42
|
+
<span v-sanitize-html="block.attributes.text" />
|
|
43
|
+
</a>
|
|
44
|
+
<button
|
|
45
|
+
v-else
|
|
46
|
+
type="button"
|
|
47
|
+
:style="block.attributes.style"
|
|
48
|
+
:class="['wp-block-button__link', getCssClasses(block)]"
|
|
49
|
+
>
|
|
50
|
+
<span v-sanitize-html="block.attributes.text" />
|
|
51
|
+
</button>
|
|
25
52
|
</template>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreButton } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreButton;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreButtons } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreButtons;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -10,14 +10,16 @@ defineProps({
|
|
|
10
10
|
v-for="innerBlock, index in block.innerBlocks"
|
|
11
11
|
:key="index"
|
|
12
12
|
>
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
<template v-if="innerBlock">
|
|
14
|
+
<CoreButton
|
|
15
|
+
v-if="innerBlock.name === 'core/button'"
|
|
16
|
+
:block="innerBlock"
|
|
17
|
+
/>
|
|
18
|
+
<EditorBlock
|
|
19
|
+
v-else
|
|
20
|
+
:block="innerBlock"
|
|
21
|
+
/>
|
|
22
|
+
</template>
|
|
21
23
|
</template>
|
|
22
24
|
</div>
|
|
23
25
|
</template>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreButtons } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreButtons;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
block: { type: Object, required: true }
|
|
4
|
+
});
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<details
|
|
9
|
+
:open="block.attributes?.showContent ?? false"
|
|
10
|
+
:class="block.attributes?.className ?? void 0"
|
|
11
|
+
>
|
|
12
|
+
<summary v-sanitize-html="block.attributes?.summary" />
|
|
13
|
+
<div v-if="block.innerBlocks?.length">
|
|
14
|
+
<template
|
|
15
|
+
v-for="(innerBlock, index) in block.innerBlocks"
|
|
16
|
+
:key="innerBlock?.clientId ?? index"
|
|
17
|
+
>
|
|
18
|
+
<BlockComponent
|
|
19
|
+
v-if="innerBlock"
|
|
20
|
+
:block="innerBlock"
|
|
21
|
+
/>
|
|
22
|
+
</template>
|
|
23
|
+
</div>
|
|
24
|
+
</details>
|
|
25
|
+
</template>
|
|
File without changes
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreGallery } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreGallery;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -20,7 +20,7 @@ props.block?.innerBlocks?.forEach((innerBlock) => {
|
|
|
20
20
|
>
|
|
21
21
|
<div
|
|
22
22
|
v-if="imgBlock"
|
|
23
|
-
class="galleryImgWrapper rounded-lg overflow-hidden relative mb-4 md:mb-6
|
|
23
|
+
class="galleryImgWrapper rounded-lg overflow-hidden relative mb-4 md:mb-6 shadow-md hover:shadow-xl"
|
|
24
24
|
>
|
|
25
25
|
<CoreImage
|
|
26
26
|
:block="imgBlock"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreGallery } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreGallery;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreHeading } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreHeading;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -9,43 +9,43 @@ const cssClass = getCssClasses(props.block);
|
|
|
9
9
|
<template>
|
|
10
10
|
<template v-if="block.attributes.level === 1">
|
|
11
11
|
<h1
|
|
12
|
-
:id="block?.attributes?.anchor"
|
|
13
|
-
v-sanitize="block.attributes.content"
|
|
12
|
+
:id="block?.attributes?.anchor ?? void 0"
|
|
13
|
+
v-sanitize-html="block.attributes.content"
|
|
14
14
|
:class="cssClass"
|
|
15
15
|
/>
|
|
16
16
|
</template>
|
|
17
17
|
<template v-else-if="block.attributes.level === 2">
|
|
18
18
|
<h2
|
|
19
|
-
:id="block?.attributes?.anchor"
|
|
20
|
-
v-sanitize="block.attributes.content"
|
|
19
|
+
:id="block?.attributes?.anchor ?? void 0"
|
|
20
|
+
v-sanitize-html="block.attributes.content"
|
|
21
21
|
:class="cssClass"
|
|
22
22
|
/>
|
|
23
23
|
</template>
|
|
24
24
|
<template v-else-if="block.attributes.level === 3">
|
|
25
25
|
<h3
|
|
26
|
-
:id="block?.attributes?.anchor"
|
|
27
|
-
v-sanitize="block.attributes.content"
|
|
26
|
+
:id="block?.attributes?.anchor ?? void 0"
|
|
27
|
+
v-sanitize-html="block.attributes.content"
|
|
28
28
|
:class="cssClass"
|
|
29
29
|
/>
|
|
30
30
|
</template>
|
|
31
31
|
<template v-else-if="block.attributes.level === 4">
|
|
32
32
|
<h4
|
|
33
|
-
:id="block?.attributes?.anchor"
|
|
34
|
-
v-sanitize="block.attributes.content"
|
|
33
|
+
:id="block?.attributes?.anchor ?? void 0"
|
|
34
|
+
v-sanitize-html="block.attributes.content"
|
|
35
35
|
:class="cssClass"
|
|
36
36
|
/>
|
|
37
37
|
</template>
|
|
38
38
|
<template v-else-if="block.attributes.level === 5">
|
|
39
39
|
<h5
|
|
40
|
-
:id="block?.attributes?.anchor"
|
|
41
|
-
v-sanitize="block.attributes.content"
|
|
40
|
+
:id="block?.attributes?.anchor ?? void 0"
|
|
41
|
+
v-sanitize-html="block.attributes.content"
|
|
42
42
|
:class="cssClass"
|
|
43
43
|
/>
|
|
44
44
|
</template>
|
|
45
45
|
<template v-else-if="block.attributes.level === 6">
|
|
46
46
|
<h6
|
|
47
|
-
:id="block?.attributes?.anchor"
|
|
48
|
-
v-sanitize="block.attributes.content"
|
|
47
|
+
:id="block?.attributes?.anchor ?? void 0"
|
|
48
|
+
v-sanitize-html="block.attributes.content"
|
|
49
49
|
:class="cssClass"
|
|
50
50
|
/>
|
|
51
51
|
</template>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreHeading } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreHeading;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreImage } from '#graphql-operations';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreImage;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -11,13 +11,13 @@ const imgUrl = props.block?.attributes?.url;
|
|
|
11
11
|
v-if="imgUrl"
|
|
12
12
|
:src="imgUrl"
|
|
13
13
|
:alt="block?.attributes?.alt"
|
|
14
|
-
:width="block?.attributes?.width"
|
|
15
|
-
:height="block?.attributes?.height"
|
|
16
|
-
:fit="block?.attributes?.scale"
|
|
14
|
+
:width="block?.attributes?.width ?? void 0"
|
|
15
|
+
:height="block?.attributes?.height ?? void 0"
|
|
16
|
+
:fit="block?.attributes?.scale ?? void 0"
|
|
17
17
|
/>
|
|
18
18
|
<div
|
|
19
19
|
v-else
|
|
20
|
-
v-sanitize="block?.renderedHtml"
|
|
20
|
+
v-sanitize-html="block?.renderedHtml"
|
|
21
21
|
/>
|
|
22
22
|
</div>
|
|
23
23
|
</template>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreImage } from '#graphql-operations';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreImage;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreParagraph } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreParagraph;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -7,9 +7,9 @@ const props = defineProps({
|
|
|
7
7
|
|
|
8
8
|
<template>
|
|
9
9
|
<p
|
|
10
|
-
:id="block?.attributes?.anchor"
|
|
11
|
-
v-sanitize="block?.attributes?.content"
|
|
10
|
+
:id="block?.attributes?.anchor ?? void 0"
|
|
11
|
+
v-sanitize-html="block?.attributes?.content"
|
|
12
12
|
:class="getCssClasses(props.block)"
|
|
13
|
-
:style="block?.attributes?.style"
|
|
13
|
+
:style="block?.attributes?.style ?? void 0"
|
|
14
14
|
/>
|
|
15
15
|
</template>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreParagraph } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreParagraph;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreQuote } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreQuote;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreQuote } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreQuote;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreSpacer } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreSpacer;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -10,8 +10,8 @@ const cssClass = getCssClasses(props.block);
|
|
|
10
10
|
<div
|
|
11
11
|
:class="cssClass"
|
|
12
12
|
:style="{
|
|
13
|
-
height: block.attributes?.spacerHeight,
|
|
14
|
-
width: block.attributes?.spacerWidth
|
|
13
|
+
height: block.attributes?.spacerHeight ?? void 0,
|
|
14
|
+
width: block.attributes?.spacerWidth ?? void 0
|
|
15
15
|
}"
|
|
16
16
|
/>
|
|
17
17
|
</template>
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CoreSpacer } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: CoreSpacer;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { EditorBlock } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: EditorBlock;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { EditorBlock } from '#wpnuxt/blocks';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
block: EditorBlock;
|
|
4
|
-
};
|
|
5
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
-
declare const _default: typeof __VLS_export;
|
|
7
|
-
export default _default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#import
|
|
2
|
-
#import
|
|
3
|
-
#import
|
|
4
|
-
#import
|
|
5
|
-
#import
|
|
6
|
-
#import
|
|
7
|
-
#import
|
|
1
|
+
#import "~/.queries/fragments/CoreButton.fragment.gql"
|
|
2
|
+
#import "~/.queries/fragments/CoreGallery.fragment.gql"
|
|
3
|
+
#import "~/.queries/fragments/CoreHeading.fragment.gql"
|
|
4
|
+
#import "~/.queries/fragments/CoreImage.fragment.gql"
|
|
5
|
+
#import "~/.queries/fragments/CoreParagraph.fragment.gql"
|
|
6
|
+
#import "~/.queries/fragments/CoreQuote.fragment.gql"
|
|
7
|
+
#import "~/.queries/fragments/CoreSpacer.fragment.gql"
|
|
8
8
|
|
|
9
9
|
fragment EditorBlock on EditorBlock {
|
|
10
10
|
apiVersion
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getColor: (textColor?: string) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const convertFontSize: (fontSize: string, prefix?: string, defaultSize?: string) => string;
|
package/dist/types.d.mts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import type { NuxtModule } from '@nuxt/schema'
|
|
2
|
+
|
|
3
|
+
import type { default as Module } from './module.mjs'
|
|
4
|
+
|
|
5
|
+
export type ModuleOptions = typeof Module extends NuxtModule<infer O> ? Partial<O> : Record<string, any>
|
|
6
|
+
|
|
1
7
|
export { default } from './module.mjs'
|
|
2
8
|
|
|
3
|
-
export { type
|
|
9
|
+
export { type WPNuxtBlocksConfig } from './module.mjs'
|
package/package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wpnuxt/blocks",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "2.0.0-alpha.2",
|
|
4
|
+
"description": "Vue components for rendering WordPress Gutenberg blocks in Nuxt",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"nuxt",
|
|
7
|
+
"nuxt-module",
|
|
8
|
+
"wordpress",
|
|
9
|
+
"gutenberg",
|
|
10
|
+
"blocks",
|
|
11
|
+
"vue",
|
|
12
|
+
"typescript"
|
|
13
|
+
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/wpnuxt/wpnuxt.git",
|
|
17
|
+
"directory": "packages/blocks"
|
|
18
|
+
},
|
|
6
19
|
"license": "MIT",
|
|
7
20
|
"type": "module",
|
|
8
21
|
"exports": {
|
|
@@ -12,54 +25,39 @@
|
|
|
12
25
|
}
|
|
13
26
|
},
|
|
14
27
|
"main": "./dist/module.mjs",
|
|
28
|
+
"types": "./dist/types.d.mts",
|
|
15
29
|
"files": [
|
|
16
30
|
"dist"
|
|
17
31
|
],
|
|
18
32
|
"publishConfig": {
|
|
19
33
|
"access": "public"
|
|
20
34
|
},
|
|
21
|
-
"scripts": {
|
|
22
|
-
"prepack": "nuxt-module-build build",
|
|
23
|
-
"dev": "nuxi dev playground",
|
|
24
|
-
"dev:build": "nuxi build playground",
|
|
25
|
-
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
|
|
26
|
-
"release": "pnpm run lint && pnpm run test && pnpm run prepack; release-it --git.tagExclude='*[-edge]*'",
|
|
27
|
-
"release-edge": "pnpm run lint && pnpm run test && pnpm run prepack; release-it --preRelease=edge --config .release-it-edge.json",
|
|
28
|
-
"lint": "eslint .",
|
|
29
|
-
"lint:fix": "eslint . --fix",
|
|
30
|
-
"test": "vitest run",
|
|
31
|
-
"test:watch": "vitest watch",
|
|
32
|
-
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
|
|
33
|
-
"wp-env": "wp-env",
|
|
34
|
-
"wp-env:create": "wp-env start --update && ./wordpress/wp-env-cli.sh",
|
|
35
|
-
"start": "pnpm run wp-env:create && pnpm run dev"
|
|
36
|
-
},
|
|
37
35
|
"dependencies": {
|
|
36
|
+
"@nuxt/kit": "4.2.2",
|
|
38
37
|
"@nuxt/image": "^2.0.0",
|
|
39
|
-
"@nuxt
|
|
40
|
-
"
|
|
41
|
-
"@wpnuxt/core": "1.0.0-edge.30"
|
|
38
|
+
"@radya/nuxt-dompurify": "^1.0.5",
|
|
39
|
+
"scule": "^1.3.0"
|
|
42
40
|
},
|
|
43
41
|
"devDependencies": {
|
|
44
|
-
"@nuxt/devtools": "^3.1.1",
|
|
45
|
-
"@nuxt/eslint-config": "^1.12.1",
|
|
46
42
|
"@nuxt/module-builder": "^1.0.2",
|
|
47
|
-
"@nuxt/schema": "
|
|
48
|
-
"@nuxt/test-utils": "^3.21.0",
|
|
49
|
-
"@tailwindcss/typography": "^0.5.19",
|
|
43
|
+
"@nuxt/schema": "4.2.2",
|
|
50
44
|
"@types/node": "^25.0.3",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"eslint": "^9.39.2",
|
|
54
|
-
"nuxt": "^4.2.2",
|
|
55
|
-
"release-it": "^19.1.0",
|
|
56
|
-
"typescript": "5.9.3",
|
|
57
|
-
"vitest": "^4.0.16",
|
|
58
|
-
"vue-tsc": "^3.1.8"
|
|
45
|
+
"nuxt": "4.2.2",
|
|
46
|
+
"vue-tsc": "^3.2.1"
|
|
59
47
|
},
|
|
60
48
|
"peerDependencies": {
|
|
61
|
-
"
|
|
62
|
-
"
|
|
49
|
+
"nuxt": "^4.0.0",
|
|
50
|
+
"@nuxt/ui": "^4.0.0"
|
|
63
51
|
},
|
|
64
|
-
"
|
|
65
|
-
|
|
52
|
+
"peerDependenciesMeta": {
|
|
53
|
+
"@nuxt/ui": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "nuxt-module-build build",
|
|
59
|
+
"dev:prepare": "nuxt-module-build build --stub",
|
|
60
|
+
"typecheck": "vue-tsc --noEmit",
|
|
61
|
+
"clean": "rm -rf dist .nuxt node_modules"
|
|
62
|
+
}
|
|
63
|
+
}
|
package/README.md
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# WPNuxt Blocks
|
|
2
|
-
|
|
3
|
-
[![npm version][npm-version-src]][npm-version-href]
|
|
4
|
-
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
5
|
-
[![License][license-src]][license-href]
|
|
6
|
-
[![Nuxt][nuxt-src]][nuxt-href]
|
|
7
|
-
|
|
8
|
-
A set of components to render Gutenberg Blocks with the WPNuxt module
|
|
9
|
-
|
|
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.
|
|
11
|
-
|
|
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)
|
|
15
|
-
|
|
16
|
-
## Quick Setup
|
|
17
|
-
|
|
18
|
-
Install the module to your Nuxt application with one command:
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
npx nuxi module add @wpnuxt/blocks
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
That's it! You can now use WPNuxt Blocks in your Nuxt app ✨
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
## Contribution
|
|
28
|
-
|
|
29
|
-
<details>
|
|
30
|
-
<summary>Local development</summary>
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
# Install dependencies
|
|
34
|
-
pnpm install
|
|
35
|
-
|
|
36
|
-
# Generate type stubs
|
|
37
|
-
pnpm run dev:prepare
|
|
38
|
-
|
|
39
|
-
# Develop with the playground
|
|
40
|
-
pnpm run dev
|
|
41
|
-
|
|
42
|
-
# Build the playground
|
|
43
|
-
pnpm run dev:build
|
|
44
|
-
|
|
45
|
-
# Run ESLint
|
|
46
|
-
pnpm run lint
|
|
47
|
-
|
|
48
|
-
# Run Vitest
|
|
49
|
-
pnpm run test
|
|
50
|
-
pnpm run test:watch
|
|
51
|
-
|
|
52
|
-
# Release new version
|
|
53
|
-
pnpm run release
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
</details>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<!-- Badges -->
|
|
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
|
|
62
|
-
|
|
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
|
|
65
|
-
|
|
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
|
|
68
|
-
|
|
69
|
-
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
|
|
70
|
-
[nuxt-href]: https://nuxt.com
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#import '~/.queries/fragments/ContentNode.fragment.gql';
|
|
2
|
-
#import '~/.queries/fragments/NodeWithFeaturedImage.fragment.gql';
|
|
3
|
-
#import '~/.queries/fragments/NodeWithEditorBlocks.fragment.gql';
|
|
4
|
-
|
|
5
|
-
fragment Page on Page {
|
|
6
|
-
...ContentNode
|
|
7
|
-
...NodeWithFeaturedImage
|
|
8
|
-
...NodeWithEditorBlocks
|
|
9
|
-
content
|
|
10
|
-
isFrontPage
|
|
11
|
-
isPostsPage
|
|
12
|
-
isPreview
|
|
13
|
-
isPrivacyPage
|
|
14
|
-
isRestricted
|
|
15
|
-
isRevision
|
|
16
|
-
title
|
|
17
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#import "~/.queries/fragments/NodeWithExcerpt.fragment.gql";
|
|
2
|
-
#import '~/.queries/fragments/ContentNode.fragment.gql';
|
|
3
|
-
#import '~/.queries/fragments/NodeWithFeaturedImage.fragment.gql';
|
|
4
|
-
#import '~/.queries/fragments/NodeWithEditorBlocks.fragment.gql';
|
|
5
|
-
|
|
6
|
-
fragment Post on Post {
|
|
7
|
-
...NodeWithExcerpt
|
|
8
|
-
...ContentNode
|
|
9
|
-
...NodeWithFeaturedImage
|
|
10
|
-
...NodeWithEditorBlocks
|
|
11
|
-
content
|
|
12
|
-
title
|
|
13
|
-
}
|