@uniformdev/uniform-nuxt 17.4.1-alpha.37 → 17.5.1-alpha.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/LICENSE.txt +2 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/plugin.mjs +9 -3
- package/package.json +11 -11
package/LICENSE.txt
ADDED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -21,7 +21,7 @@ const module = defineNuxtModule({
|
|
|
21
21
|
setup(options, nuxt) {
|
|
22
22
|
options.apiHost;
|
|
23
23
|
if (!options.projectId || !options.readOnlyApiKey) {
|
|
24
|
-
throw new Error("uniform-nuxt: The module options 'projectId' and 'readOnlyApiKey' are required");
|
|
24
|
+
throw new Error("uniform-nuxt: The module options 'projectId' and 'readOnlyApiKey' are required.");
|
|
25
25
|
}
|
|
26
26
|
optimizeDeps(["rfdc"]);
|
|
27
27
|
nuxt.options.runtimeConfig.public["$uniform"] = { ...options };
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -29,6 +29,8 @@ import {
|
|
|
29
29
|
onRouteChange,
|
|
30
30
|
useUniformContext
|
|
31
31
|
} from "@uniformdev/context-vue";
|
|
32
|
+
const log = process.env.NODE_ENV === "development" ? (...args) => console.log(...args) : () => {
|
|
33
|
+
};
|
|
32
34
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
33
35
|
if (nuxtApp.$uniformIsSetup) {
|
|
34
36
|
return;
|
|
@@ -64,7 +66,7 @@ function setupContext(nuxtApp) {
|
|
|
64
66
|
);
|
|
65
67
|
}
|
|
66
68
|
if (!uniformContext && options.manifest) {
|
|
67
|
-
|
|
69
|
+
log("uniform-nuxt: \u{1F4DC} found a manifest, will initialize Context");
|
|
68
70
|
const manifestAsSimpleObject = toRaw(options.manifest);
|
|
69
71
|
uniformContext = new Context({
|
|
70
72
|
defaultConsent: Boolean(options.defaultConsent),
|
|
@@ -116,7 +118,7 @@ function setupPreview() {
|
|
|
116
118
|
const route = useRoute();
|
|
117
119
|
let preview;
|
|
118
120
|
if (route.query.preview === "true") {
|
|
119
|
-
|
|
121
|
+
log("uniform-nuxt: \u{1F575}\uFE0F Entering preview mode");
|
|
120
122
|
preview = {
|
|
121
123
|
slug: route.query.slug,
|
|
122
124
|
compositionId: route.query.id
|
|
@@ -161,8 +163,12 @@ function setupUseComposition(uniformCanvasClient, currentCompositionId, preview)
|
|
|
161
163
|
const { data, pending, error } = await useAsyncData(`composition-${slug || compositionId}`, async () => {
|
|
162
164
|
if (slug) {
|
|
163
165
|
return await uniformCanvasClient.getCompositionBySlug({ slug, state });
|
|
166
|
+
} else if (compositionId) {
|
|
167
|
+
return await uniformCanvasClient.getCompositionById({ compositionId, state });
|
|
164
168
|
}
|
|
165
|
-
|
|
169
|
+
log(
|
|
170
|
+
"uniform-nuxt: `useComposition` requires either a `slug` or a `compositionId`, but none were provided."
|
|
171
|
+
);
|
|
166
172
|
});
|
|
167
173
|
currentCompositionId.value = data.value?.composition._id ?? "";
|
|
168
174
|
return { data, pending, error };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/uniform-nuxt",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.5.1-alpha.6+56c22015c",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"format": "prettier --write \"src/**/*.{js,ts,tsx}\""
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@nuxt/kit": "
|
|
25
|
+
"@nuxt/kit": "3.0.0",
|
|
26
26
|
"vue-demi": "^0.13.11"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@nuxt/module-builder": "0.2.0",
|
|
36
|
-
"@nuxt/schema": "3.0.0
|
|
36
|
+
"@nuxt/schema": "3.0.0",
|
|
37
37
|
"@nuxtjs/eslint-config-typescript": "11.0.0",
|
|
38
|
-
"@uniformdev/canvas": "^17.
|
|
39
|
-
"@uniformdev/canvas-vue": "^17.
|
|
40
|
-
"@uniformdev/context": "^17.
|
|
41
|
-
"@uniformdev/context-vue": "^17.
|
|
42
|
-
"esbuild": "0.15.
|
|
38
|
+
"@uniformdev/canvas": "^17.5.1-alpha.6+56c22015c",
|
|
39
|
+
"@uniformdev/canvas-vue": "^17.5.1-alpha.6+56c22015c",
|
|
40
|
+
"@uniformdev/context": "^17.5.1-alpha.6+56c22015c",
|
|
41
|
+
"@uniformdev/context-vue": "^17.5.1-alpha.6+56c22015c",
|
|
42
|
+
"esbuild": "0.15.13",
|
|
43
43
|
"eslint": "latest",
|
|
44
|
-
"nuxt": "3.0.0
|
|
45
|
-
"vue": "3.2.
|
|
44
|
+
"nuxt": "3.0.0",
|
|
45
|
+
"vue": "3.2.45",
|
|
46
46
|
"vue-router": "4.1.5"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "56c22015c4959f040eb9d2cd02edadd53e122ca9"
|
|
52
52
|
}
|