@b10cks/nuxt 0.10.5 → 0.10.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/dist/module.json +1 -1
- package/dist/runtime/plugin.js +1 -17
- package/package.json +2 -2
package/dist/module.json
CHANGED
package/dist/runtime/plugin.js
CHANGED
|
@@ -1,29 +1,13 @@
|
|
|
1
1
|
import { useState } from "#app";
|
|
2
2
|
import { ApiClient } from "@b10cks/client";
|
|
3
|
-
import {
|
|
3
|
+
import { B10cksVue, previewBridge } from "@b10cks/vue";
|
|
4
4
|
import { defineNuxtPlugin, useRequestURL, useRuntimeConfig } from "nuxt/app";
|
|
5
|
-
import { resolveComponent } from "vue";
|
|
6
5
|
let rv = 0;
|
|
7
6
|
export default defineNuxtPlugin({
|
|
8
7
|
name: "b10cks",
|
|
9
8
|
setup(nuxtApp) {
|
|
10
9
|
const config = useRuntimeConfig();
|
|
11
10
|
const url = useRequestURL();
|
|
12
|
-
nuxtApp.vueApp.provide(B10cksComponentResolverKey, (componentName) => {
|
|
13
|
-
const pascalCaseBlockType = componentName.replace(/^([a-z])/, (match) => match.toUpperCase()).replace(/([a-z])([A-Z])/g, "$1$2");
|
|
14
|
-
return new Promise((resolve, reject) => {
|
|
15
|
-
try {
|
|
16
|
-
const component = resolveComponent(pascalCaseBlockType, false);
|
|
17
|
-
if (typeof component === "string") {
|
|
18
|
-
reject(new Error(`Component "${pascalCaseBlockType}" not found`));
|
|
19
|
-
} else {
|
|
20
|
-
resolve(component);
|
|
21
|
-
}
|
|
22
|
-
} catch (error) {
|
|
23
|
-
reject(error);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
11
|
nuxtApp.vueApp.use(B10cksVue);
|
|
28
12
|
if (previewBridge.isInPreviewMode()) {
|
|
29
13
|
if (import.meta.client) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@b10cks/nuxt",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.6",
|
|
4
4
|
"description": "b10cks Nuxt module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Michael Wallner @ Coder's Cantina",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@b10cks/client": "^0.10.2",
|
|
28
|
-
"@b10cks/vue": "^0.10.
|
|
28
|
+
"@b10cks/vue": "^0.10.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@nuxt/kit": "^4.2.1",
|