@uniformdev/uniform-nuxt 16.0.1-nuxt.159 → 16.0.1-nuxt.181
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 +91 -4
- package/dist/module.d.ts +9 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +35 -4
- package/dist/runtime/plugin.mjs +43 -531
- package/dist/types.d.ts +1 -5
- package/package.json +11 -8
package/README.md
CHANGED
|
@@ -1,9 +1,96 @@
|
|
|
1
|
-
# Uniform Nuxt
|
|
1
|
+
# Uniform Nuxt module
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Getting started
|
|
4
|
+
|
|
5
|
+
Install the peer dependencies of the module (if you haven't already):
|
|
6
|
+
```
|
|
7
|
+
npm i @uniformdev/canvas @uniformdev/canvas-vue @uniformdev/context @uniformdev/context-vue
|
|
8
|
+
```
|
|
9
|
+
Install the module
|
|
10
|
+
```
|
|
11
|
+
npm i @uniformdev/uniform-nuxt
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Add the module to you Nuxt config:
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { defineNuxtConfig } from 'nuxt';
|
|
18
|
+
|
|
19
|
+
export default defineNuxtConfig({
|
|
20
|
+
transpile: ['@uniformdev/canvas-vue', '@uniformdev/context-vue'],
|
|
21
|
+
modules: [
|
|
22
|
+
[
|
|
23
|
+
'@uniformdev/uniform-nuxt',
|
|
24
|
+
{
|
|
25
|
+
projectId: process.env.UNIFORM_PROJECT_ID,
|
|
26
|
+
readOnlyApiKey: process.env.UNIFORM_API_KEY,
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
],
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Features
|
|
34
|
+
|
|
35
|
+
- Auto-registers the needed Uniform components.
|
|
36
|
+
- Creates a Canvas client automatically.
|
|
37
|
+
- Creates a Uniform Context instance and provides it through the whole app, without the need of a wrapping component.
|
|
38
|
+
- Provides a handy `$useComposition` composable, build on top of Nuxt's [useAsyncData](https://v3.nuxtjs.org/api/composables/use-async-data).
|
|
39
|
+
- Handle Live Preview.
|
|
40
|
+
- Watches query string change, which Nuxt doesn't do by default.
|
|
41
|
+
|
|
42
|
+
## API reference
|
|
43
|
+
|
|
44
|
+
### Options
|
|
45
|
+
These are the option you pass to the module in `nuxt.config.ts`.
|
|
46
|
+
|
|
47
|
+
| Option | Type | Description |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| `projectId`* | string | The ID of the Uniform project you want to use in your app. |
|
|
50
|
+
| `readOnlyApiKey`* | string | An API key that has read permissions to your Uniform project. ⚠️ Make sure the API key has only read access, because it's used in Nuxt's public runtime config |
|
|
51
|
+
| `manifest` | ManifestV2 | The Uniform Context manifest. This one is usually fetched right before the app is started using Uniform's CLI. Uniform Context won't be enabled if a manifest is missing. |
|
|
52
|
+
| `outputType` | 'standard' \| 'edge' | Set it to 'edge' when building the app for the edge using [NESI technology](https://docs.uniform.app/context/reference/netlify). Defaults to 'standard' |
|
|
53
|
+
| `apiHost` | string | The host to be used when calling the API. Defaults to 'https://uniform.app' |
|
|
54
|
+
\* Required
|
|
55
|
+
|
|
56
|
+
### Injected in the Nuxt instance
|
|
57
|
+
These are the properties that the module injects in the Nuxt app instance, so you can use them anywhere in your app.
|
|
58
|
+
|
|
59
|
+
| Property | Type | Description |
|
|
60
|
+
|---|---|---|
|
|
61
|
+
| `$useComposition` | function | A compasable that you can use to fetch a Canvas composition. It's preview-aware, it will automatically fetch the draft composition if the app is in preview mode, otherwise it will return the published one. It uses Suspense under the hood, so you can have access to the error and pending states of the request |
|
|
62
|
+
| `$useUniformContext` | function | A compasable that returns the current Uniform Context instance which allows you interact with the context such updating the scores and so on. It also returns other provided properties such as `outputType` |
|
|
63
|
+
| `$preview` | object \| undefined | This object is only defined in preview mode, so you can use it to adjust your app if it's in preview mode. It contains the slug of the current composition. |
|
|
64
|
+
| `$uniformCanvasClient` | CanvasClient | Returns the Canvas client which you can use to fetch or update compositions. For composition fetching, it's recommended to use `$useComposition` instead. |
|
|
65
|
+
| `uniformCanvasClient` | CanvasClient | Returns the Canvas client which you can use to fetch or update compositions. For composition fetching, it's recommended to use `$useComposition` instead. |
|
|
66
|
+
|
|
67
|
+
### Components
|
|
68
|
+
These are the components that the module auto registers for you, so you can use them without import.
|
|
69
|
+
|
|
70
|
+
#### <Composition />
|
|
71
|
+
This component wraps the whole composition, it
|
|
72
|
+
|
|
73
|
+
| Prop | Type | Description |
|
|
74
|
+
|---|---|---|
|
|
75
|
+
| `data`* | string | The data of the composition to be rendered, this is usually the `composition` object that you get from `$useComposition` |
|
|
76
|
+
| `resolveRenderer` | function | This function is responsible of mapping Canvas components to Vue components. It takes a ComponentInstance object and should return a Vue component (usually based on the component `type`). If no resolver is provided, it will try to resolve the componnet in on the global context of the app, so if you have globally defined components, it will try to map them based on the `name` of the Vue component and the `type` of Canvas component|
|
|
77
|
+
|
|
78
|
+
* Required
|
|
79
|
+
|
|
80
|
+
#### <SlotContent />
|
|
81
|
+
This component is used to render the slots of a composition, and it can be only used inside a `<Composition />`.
|
|
82
|
+
You can nest `<SlotContent />` inside each other if you have nested slots.
|
|
83
|
+
|
|
84
|
+
| Prop | Type | Description |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| `name` | string | The name of the Canvas slot to render. If no name is provided, all the slots will be rendered. This is not recommended as the order is not guaranteed |
|
|
87
|
+
|
|
88
|
+
## Example
|
|
89
|
+
|
|
90
|
+
Here are some example where the module is used:
|
|
91
|
+
- https://github.com/uniformdev/uniformconf-nuxt
|
|
92
|
+
- https://github.com/uniformdev/nuxt-canvas-nuxt
|
|
4
93
|
|
|
5
|
-
In the meantime, here is a working example on how to use the module:
|
|
6
|
-
https://github.com/uniformdev/uniformconf-nuxt/blob/main/nuxt.config.ts
|
|
7
94
|
|
|
8
95
|
|
|
9
96
|
-----
|
package/dist/module.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import * as _nuxt_schema from '@nuxt/schema';
|
|
1
2
|
import { ManifestV2 } from '@uniformdev/context';
|
|
2
3
|
|
|
3
|
-
interface
|
|
4
|
-
projectId
|
|
5
|
-
readOnlyApiKey
|
|
4
|
+
interface UniformModuleOptions {
|
|
5
|
+
projectId: string;
|
|
6
|
+
readOnlyApiKey: string;
|
|
6
7
|
apiHost?: string;
|
|
7
8
|
manifest?: ManifestV2;
|
|
8
9
|
outputType?: string;
|
|
10
|
+
uniformContextPath?: string;
|
|
11
|
+
defaultConsent?: boolean;
|
|
12
|
+
enableContextDevTools?: boolean;
|
|
9
13
|
}
|
|
10
|
-
declare const _default: NuxtModule<
|
|
14
|
+
declare const _default: _nuxt_schema.NuxtModule<UniformModuleOptions>;
|
|
11
15
|
|
|
12
|
-
export {
|
|
16
|
+
export { UniformModuleOptions, _default as default };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,25 +1,56 @@
|
|
|
1
1
|
import { resolve } from 'path';
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
|
-
import { defineNuxtModule, addPlugin } from '@nuxt/kit';
|
|
3
|
+
import { defineNuxtModule, resolveAlias, addTemplate, addPlugin, extendViteConfig } from '@nuxt/kit';
|
|
4
4
|
|
|
5
|
+
const uniformContextProxyPath = "uniform/context/instance.ts";
|
|
5
6
|
const module = defineNuxtModule({
|
|
6
7
|
meta: {
|
|
7
8
|
name: "nuxt-uniform",
|
|
8
9
|
configKey: "uniform"
|
|
9
10
|
},
|
|
10
11
|
defaults: {
|
|
11
|
-
projectId:
|
|
12
|
-
readOnlyApiKey:
|
|
12
|
+
projectId: "",
|
|
13
|
+
readOnlyApiKey: "",
|
|
13
14
|
apiHost: "https://uniform.app",
|
|
14
15
|
manifest: void 0,
|
|
15
|
-
outputType: void 0
|
|
16
|
+
outputType: void 0,
|
|
17
|
+
uniformContextPath: void 0,
|
|
18
|
+
defaultConsent: false,
|
|
19
|
+
enableContextDevTools: true
|
|
16
20
|
},
|
|
17
21
|
setup(options, nuxt) {
|
|
22
|
+
if (!options.projectId || !options.readOnlyApiKey) {
|
|
23
|
+
throw new Error("uniform-nuxt: The module options 'projectId' and 'readOnlyApiKey' are required");
|
|
24
|
+
}
|
|
25
|
+
optimizeDeps(["rfdc"]);
|
|
18
26
|
nuxt.options.runtimeConfig.public["$uniform"] = { ...options };
|
|
27
|
+
if (options.uniformContextPath) {
|
|
28
|
+
const resolvedUserContextPath = resolveConfigFilePath(nuxt, options.uniformContextPath);
|
|
29
|
+
addTemplate({
|
|
30
|
+
filename: uniformContextProxyPath,
|
|
31
|
+
getContents: () => `export { default } from '${resolvedUserContextPath}';`
|
|
32
|
+
});
|
|
33
|
+
} else {
|
|
34
|
+
addTemplate({
|
|
35
|
+
filename: uniformContextProxyPath,
|
|
36
|
+
getContents: () => `export default undefined;`
|
|
37
|
+
});
|
|
38
|
+
}
|
|
19
39
|
const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url));
|
|
20
40
|
nuxt.options.build.transpile.push(runtimeDir);
|
|
21
41
|
addPlugin(resolve(runtimeDir, "plugin"));
|
|
22
42
|
}
|
|
23
43
|
});
|
|
44
|
+
function resolveConfigFilePath(nuxt, filePath) {
|
|
45
|
+
return resolve(nuxt.options.rootDir, resolveAlias(filePath));
|
|
46
|
+
}
|
|
47
|
+
function optimizeDeps(deps) {
|
|
48
|
+
extendViteConfig((config) => {
|
|
49
|
+
config.optimizeDeps = {
|
|
50
|
+
...config.optimizeDeps,
|
|
51
|
+
include: [...config.optimizeDeps?.include ?? [], ...deps]
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
}
|
|
24
55
|
|
|
25
56
|
export { module as default };
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
useState,
|
|
9
9
|
useCookie
|
|
10
10
|
} from "#app";
|
|
11
|
-
import
|
|
11
|
+
import userProvidedContextInstance from "#build/uniform/context/instance";
|
|
12
|
+
import { watch, toRaw } from "vue-demi";
|
|
12
13
|
import {
|
|
13
14
|
CanvasClient,
|
|
14
15
|
CANVAS_DRAFT_STATE,
|
|
@@ -17,62 +18,71 @@ import {
|
|
|
17
18
|
import {
|
|
18
19
|
Context,
|
|
19
20
|
CookieTransitionDataStore,
|
|
21
|
+
enableContextDevTools,
|
|
20
22
|
UNIFORM_DEFAULT_COOKIE_NAME
|
|
21
23
|
} from "@uniformdev/context";
|
|
22
24
|
import { Composition, SlotContent, useCompositionEventEffect } from "@uniformdev/canvas-vue";
|
|
23
25
|
import {
|
|
24
26
|
provideUniformContext,
|
|
25
|
-
onRouteChange
|
|
26
|
-
useUniformContext
|
|
27
|
+
onRouteChange
|
|
27
28
|
} from "@uniformdev/context-vue";
|
|
28
29
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
29
30
|
if (nuxtApp.$uniformIsSetup) {
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
try {
|
|
34
|
+
const currentCompositionId = useState("currentCompositionId", () => "");
|
|
35
|
+
const preview = setupPreview();
|
|
36
|
+
const uniformContextData = setupContext(nuxtApp);
|
|
37
|
+
const uniformCanvasClient = setupCanvas(nuxtApp);
|
|
38
|
+
setupLivePreview(currentCompositionId, Boolean(preview));
|
|
39
|
+
const useComposition = setupUseComposition(uniformCanvasClient, currentCompositionId, preview);
|
|
40
|
+
return {
|
|
41
|
+
provide: {
|
|
42
|
+
uniformIsSetup: true,
|
|
43
|
+
preview,
|
|
44
|
+
uniformCanvasClient,
|
|
45
|
+
uniformContext: uniformContextData.context,
|
|
46
|
+
useComposition
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
} catch (e) {
|
|
50
|
+
console.log("uniform-nuxt: An error occurred while initializing the Uniform plugin", e);
|
|
51
|
+
}
|
|
48
52
|
});
|
|
49
53
|
function setupContext(nuxtApp) {
|
|
50
|
-
const options =
|
|
54
|
+
const options = getModuleOptions();
|
|
51
55
|
const uniformCookie = useCookie(UNIFORM_DEFAULT_COOKIE_NAME).value;
|
|
52
|
-
let uniformContext;
|
|
53
|
-
if (
|
|
56
|
+
let uniformContext = userProvidedContextInstance;
|
|
57
|
+
if (uniformContext !== void 0 && !uniformContext.manifest) {
|
|
58
|
+
throw new Error(`uniform-nuxt: The Uniform Context instance returned by ${options.uniformContextPath} is not valid`);
|
|
59
|
+
}
|
|
60
|
+
if (!uniformContext && options.manifest) {
|
|
54
61
|
console.log("uniform-nuxt: \u{1F4DC} found a manifest, will initialize Context");
|
|
62
|
+
const manifestAsSimpleObject = toRaw(options.manifest);
|
|
55
63
|
uniformContext = new Context({
|
|
56
|
-
defaultConsent:
|
|
57
|
-
manifest:
|
|
64
|
+
defaultConsent: Boolean(options.defaultConsent),
|
|
65
|
+
manifest: manifestAsSimpleObject,
|
|
58
66
|
transitionStore: new CookieTransitionDataStore({
|
|
59
67
|
serverCookieValue: uniformCookie
|
|
60
|
-
})
|
|
68
|
+
}),
|
|
69
|
+
plugins: options.enableContextDevTools ? [enableContextDevTools()] : void 0
|
|
61
70
|
});
|
|
62
71
|
}
|
|
63
72
|
provideUniformContext({
|
|
64
73
|
context: uniformContext,
|
|
65
74
|
outputType: options.outputType,
|
|
66
|
-
|
|
75
|
+
vueAppInstance: nuxtApp.vueApp
|
|
67
76
|
});
|
|
68
77
|
const route = useRoute();
|
|
69
78
|
watch(() => JSON.stringify(route.query), () => {
|
|
70
|
-
|
|
79
|
+
if (uniformContext)
|
|
80
|
+
onRouteChange(uniformContext);
|
|
71
81
|
});
|
|
72
|
-
return uniformContext;
|
|
82
|
+
return { context: uniformContext, outputType: options.outputType };
|
|
73
83
|
}
|
|
74
84
|
function setupCanvas(nuxtApp) {
|
|
75
|
-
const options =
|
|
85
|
+
const options = getModuleOptions();
|
|
76
86
|
nuxtApp.vueApp.component("Composition", Composition);
|
|
77
87
|
nuxtApp.vueApp.component("SlotContent", SlotContent);
|
|
78
88
|
const uniformCanvasClient = new CanvasClient({
|
|
@@ -94,7 +104,7 @@ function setupPreview() {
|
|
|
94
104
|
return preview;
|
|
95
105
|
}
|
|
96
106
|
function setupLivePreview(currentCompositionId, isPreview = false) {
|
|
97
|
-
const { projectId } =
|
|
107
|
+
const { projectId } = getModuleOptions();
|
|
98
108
|
const enabled = isPreview;
|
|
99
109
|
const onCompositionChange = async () => {
|
|
100
110
|
await refreshNuxtData();
|
|
@@ -109,507 +119,6 @@ function setupLivePreview(currentCompositionId, isPreview = false) {
|
|
|
109
119
|
effect: onCompositionChange
|
|
110
120
|
});
|
|
111
121
|
}
|
|
112
|
-
const SAMPLE_COMPOSITION_RESPONSE = {
|
|
113
|
-
composition: {
|
|
114
|
-
_id: "ecf48923-00c6-4d2b-8493-b1e0895d2807",
|
|
115
|
-
type: "page",
|
|
116
|
-
_name: "Home",
|
|
117
|
-
_slug: "/",
|
|
118
|
-
slots: {
|
|
119
|
-
footer: [
|
|
120
|
-
{
|
|
121
|
-
type: "footer",
|
|
122
|
-
parameters: {}
|
|
123
|
-
}
|
|
124
|
-
],
|
|
125
|
-
header: [
|
|
126
|
-
{
|
|
127
|
-
type: "header",
|
|
128
|
-
parameters: {
|
|
129
|
-
text: {
|
|
130
|
-
type: "text",
|
|
131
|
-
value: "V1"
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
],
|
|
136
|
-
content: [
|
|
137
|
-
{
|
|
138
|
-
type: "$personalization",
|
|
139
|
-
slots: {
|
|
140
|
-
pz: [
|
|
141
|
-
{
|
|
142
|
-
type: "hero",
|
|
143
|
-
parameters: {
|
|
144
|
-
text: {
|
|
145
|
-
type: "text",
|
|
146
|
-
value: "Now check out the conference sessions and add them to your agenda"
|
|
147
|
-
},
|
|
148
|
-
image: {
|
|
149
|
-
type: "text",
|
|
150
|
-
value: "/images/registration-hero.svg"
|
|
151
|
-
},
|
|
152
|
-
title: {
|
|
153
|
-
type: "text",
|
|
154
|
-
value: "Thank you for joining!"
|
|
155
|
-
},
|
|
156
|
-
$pzCrit: {
|
|
157
|
-
type: "$pzCrit",
|
|
158
|
-
value: {
|
|
159
|
-
crit: [
|
|
160
|
-
{
|
|
161
|
-
l: "registrationComplete",
|
|
162
|
-
r: 50,
|
|
163
|
-
op: ">"
|
|
164
|
-
}
|
|
165
|
-
]
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
intentTag: {
|
|
169
|
-
type: "intentTag",
|
|
170
|
-
value: null
|
|
171
|
-
},
|
|
172
|
-
buttonText: {
|
|
173
|
-
type: "text",
|
|
174
|
-
value: "See sessions"
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
type: "hero",
|
|
180
|
-
parameters: {
|
|
181
|
-
text: {
|
|
182
|
-
type: "text",
|
|
183
|
-
value: "We can't wait to receive your talk submission!"
|
|
184
|
-
},
|
|
185
|
-
image: {
|
|
186
|
-
type: "text",
|
|
187
|
-
value: "/images/call-for-papers-hero.svg"
|
|
188
|
-
},
|
|
189
|
-
title: {
|
|
190
|
-
type: "text",
|
|
191
|
-
value: "Call for papers open now!"
|
|
192
|
-
},
|
|
193
|
-
$pzCrit: {
|
|
194
|
-
type: "$pzCrit",
|
|
195
|
-
value: {
|
|
196
|
-
crit: [
|
|
197
|
-
{
|
|
198
|
-
l: "submitCallForPapers",
|
|
199
|
-
r: 50,
|
|
200
|
-
op: ">="
|
|
201
|
-
}
|
|
202
|
-
]
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
intentTag: {
|
|
206
|
-
type: "intentTag",
|
|
207
|
-
value: null
|
|
208
|
-
},
|
|
209
|
-
buttonText: {
|
|
210
|
-
type: "text",
|
|
211
|
-
value: "Submit your talk"
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
type: "hero",
|
|
217
|
-
parameters: {
|
|
218
|
-
text: {
|
|
219
|
-
type: "text",
|
|
220
|
-
value: "We think you might be interested in this content."
|
|
221
|
-
},
|
|
222
|
-
image: {
|
|
223
|
-
type: "text",
|
|
224
|
-
value: "/images/developer-hero.svg"
|
|
225
|
-
},
|
|
226
|
-
title: {
|
|
227
|
-
type: "text",
|
|
228
|
-
value: "Hey, developer!"
|
|
229
|
-
},
|
|
230
|
-
$pzCrit: {
|
|
231
|
-
type: "$pzCrit",
|
|
232
|
-
value: {
|
|
233
|
-
crit: [
|
|
234
|
-
{
|
|
235
|
-
l: "techies",
|
|
236
|
-
op: "+"
|
|
237
|
-
}
|
|
238
|
-
]
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
intentTag: {
|
|
242
|
-
type: "intentTag",
|
|
243
|
-
value: null
|
|
244
|
-
},
|
|
245
|
-
buttonText: {
|
|
246
|
-
type: "text",
|
|
247
|
-
value: null
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
type: "hero",
|
|
253
|
-
parameters: {
|
|
254
|
-
text: {
|
|
255
|
-
type: "text",
|
|
256
|
-
value: "We think you may be a marketer. This might be of interest to you!"
|
|
257
|
-
},
|
|
258
|
-
image: {
|
|
259
|
-
type: "text",
|
|
260
|
-
value: "/images/marketer-hero.svg"
|
|
261
|
-
},
|
|
262
|
-
title: {
|
|
263
|
-
type: "text",
|
|
264
|
-
value: "Howdy, Marketer!"
|
|
265
|
-
},
|
|
266
|
-
$pzCrit: {
|
|
267
|
-
type: "$pzCrit",
|
|
268
|
-
value: {
|
|
269
|
-
crit: [
|
|
270
|
-
{
|
|
271
|
-
l: "nonTechies",
|
|
272
|
-
op: "+"
|
|
273
|
-
}
|
|
274
|
-
]
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
intentTag: {
|
|
278
|
-
type: "intentTag",
|
|
279
|
-
value: null
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
type: "hero",
|
|
285
|
-
parameters: {
|
|
286
|
-
text: {
|
|
287
|
-
type: "text",
|
|
288
|
-
value: "Whether you are a developer or a marketer, we got great content for you."
|
|
289
|
-
},
|
|
290
|
-
image: {
|
|
291
|
-
type: "text",
|
|
292
|
-
value: "/images/default-hero.svg"
|
|
293
|
-
},
|
|
294
|
-
title: {
|
|
295
|
-
type: "text",
|
|
296
|
-
value: "Welcome to UniformConf"
|
|
297
|
-
},
|
|
298
|
-
buttonLink: {
|
|
299
|
-
type: "text",
|
|
300
|
-
value: "/registration"
|
|
301
|
-
},
|
|
302
|
-
buttonText: {
|
|
303
|
-
type: "text",
|
|
304
|
-
value: "Register"
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
]
|
|
309
|
-
},
|
|
310
|
-
parameters: {
|
|
311
|
-
trackingEventName: {
|
|
312
|
-
type: "text",
|
|
313
|
-
value: "Home Hero"
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
type: "$personalization",
|
|
319
|
-
slots: {
|
|
320
|
-
pz: [
|
|
321
|
-
{
|
|
322
|
-
type: "talklist",
|
|
323
|
-
slots: {
|
|
324
|
-
talks: [
|
|
325
|
-
{
|
|
326
|
-
type: "talk",
|
|
327
|
-
parameters: {
|
|
328
|
-
title: {
|
|
329
|
-
type: "text",
|
|
330
|
-
value: "Jamstack 101"
|
|
331
|
-
},
|
|
332
|
-
audience: {
|
|
333
|
-
type: "select",
|
|
334
|
-
value: "Marketers"
|
|
335
|
-
},
|
|
336
|
-
intentTag: {
|
|
337
|
-
type: "intentTag",
|
|
338
|
-
value: null
|
|
339
|
-
},
|
|
340
|
-
description: {
|
|
341
|
-
type: "text",
|
|
342
|
-
value: "Learn what Jamstack is in this introductory course for both developers and marketers."
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
},
|
|
346
|
-
{
|
|
347
|
-
type: "talk",
|
|
348
|
-
parameters: {
|
|
349
|
-
title: {
|
|
350
|
-
type: "text",
|
|
351
|
-
value: "Personalization the Jamstack way"
|
|
352
|
-
},
|
|
353
|
-
audience: {
|
|
354
|
-
type: "select",
|
|
355
|
-
value: "Marketers"
|
|
356
|
-
},
|
|
357
|
-
description: {
|
|
358
|
-
type: "text",
|
|
359
|
-
value: "Marketers can learn about the basics of personalization and how to do it the Jamstack way."
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
type: "talk",
|
|
365
|
-
parameters: {
|
|
366
|
-
title: {
|
|
367
|
-
type: "text",
|
|
368
|
-
value: "3rd party scripts and performance"
|
|
369
|
-
},
|
|
370
|
-
audience: {
|
|
371
|
-
type: "select",
|
|
372
|
-
value: "Marketers"
|
|
373
|
-
},
|
|
374
|
-
description: {
|
|
375
|
-
type: "text",
|
|
376
|
-
value: "The effect of 3rd party scripts on performance can be huge and the additional JavaScript payload coming from 3rd party scripts can easily exceed the amount of JavaScript you need to render your site."
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
]
|
|
381
|
-
},
|
|
382
|
-
parameters: {
|
|
383
|
-
title: {
|
|
384
|
-
type: "text",
|
|
385
|
-
value: "Personalized talks for marketers"
|
|
386
|
-
},
|
|
387
|
-
$pzCrit: {
|
|
388
|
-
type: "$pzCrit",
|
|
389
|
-
value: {
|
|
390
|
-
crit: [
|
|
391
|
-
{
|
|
392
|
-
l: "nonTechies",
|
|
393
|
-
op: "+"
|
|
394
|
-
}
|
|
395
|
-
]
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
},
|
|
400
|
-
{
|
|
401
|
-
type: "talklist",
|
|
402
|
-
slots: {
|
|
403
|
-
talks: [
|
|
404
|
-
{
|
|
405
|
-
type: "talk",
|
|
406
|
-
parameters: {
|
|
407
|
-
title: {
|
|
408
|
-
type: "text",
|
|
409
|
-
value: "What's next in Next.js?"
|
|
410
|
-
},
|
|
411
|
-
audience: {
|
|
412
|
-
type: "select",
|
|
413
|
-
value: "Developers"
|
|
414
|
-
},
|
|
415
|
-
description: {
|
|
416
|
-
type: "text",
|
|
417
|
-
value: "Find out what's new in the latest Next.js release. Find out in this content packed session!"
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
},
|
|
421
|
-
{
|
|
422
|
-
type: "talk",
|
|
423
|
-
parameters: {
|
|
424
|
-
title: {
|
|
425
|
-
type: "text",
|
|
426
|
-
value: "Edge-side computing basics"
|
|
427
|
-
},
|
|
428
|
-
audience: {
|
|
429
|
-
type: "select",
|
|
430
|
-
value: "Developers"
|
|
431
|
-
},
|
|
432
|
-
description: {
|
|
433
|
-
type: "text",
|
|
434
|
-
value: "Learn how to take the static to the new realm by adding edge-side logic to your application."
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
type: "talk",
|
|
440
|
-
parameters: {
|
|
441
|
-
title: {
|
|
442
|
-
type: "text",
|
|
443
|
-
value: "Personalization the for developers"
|
|
444
|
-
},
|
|
445
|
-
audience: {
|
|
446
|
-
type: "select",
|
|
447
|
-
value: "Developers"
|
|
448
|
-
},
|
|
449
|
-
description: {
|
|
450
|
-
type: "text",
|
|
451
|
-
value: "Developers should know the basics of personalization and how to do it the Jamstack way."
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
]
|
|
456
|
-
},
|
|
457
|
-
parameters: {
|
|
458
|
-
title: {
|
|
459
|
-
type: "text",
|
|
460
|
-
value: "Personalized talks for developers"
|
|
461
|
-
},
|
|
462
|
-
$pzCrit: {
|
|
463
|
-
type: "$pzCrit",
|
|
464
|
-
value: {
|
|
465
|
-
crit: [
|
|
466
|
-
{
|
|
467
|
-
l: "techies",
|
|
468
|
-
op: "+"
|
|
469
|
-
}
|
|
470
|
-
]
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
},
|
|
475
|
-
{
|
|
476
|
-
type: "talklist",
|
|
477
|
-
slots: {
|
|
478
|
-
talks: [
|
|
479
|
-
{
|
|
480
|
-
type: "talk",
|
|
481
|
-
parameters: {
|
|
482
|
-
title: {
|
|
483
|
-
type: "text",
|
|
484
|
-
value: "What's next in Next.js?"
|
|
485
|
-
},
|
|
486
|
-
audience: {
|
|
487
|
-
type: "select",
|
|
488
|
-
value: "Developers"
|
|
489
|
-
},
|
|
490
|
-
description: {
|
|
491
|
-
type: "text",
|
|
492
|
-
value: "Find out what's new in the latest Next.js release. Find out in this content packed session!"
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
type: "talk",
|
|
498
|
-
parameters: {
|
|
499
|
-
title: {
|
|
500
|
-
type: "text",
|
|
501
|
-
value: "Personalization the Jamstack way"
|
|
502
|
-
},
|
|
503
|
-
audience: {
|
|
504
|
-
type: "select",
|
|
505
|
-
value: "Marketers"
|
|
506
|
-
},
|
|
507
|
-
description: {
|
|
508
|
-
type: "text",
|
|
509
|
-
value: "Marketers can learn about the basics of personalization and how to do it the Jamstack way."
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
},
|
|
513
|
-
{
|
|
514
|
-
type: "talk",
|
|
515
|
-
parameters: {
|
|
516
|
-
title: {
|
|
517
|
-
type: "text",
|
|
518
|
-
value: "Personalization the for developers"
|
|
519
|
-
},
|
|
520
|
-
audience: {
|
|
521
|
-
type: "select",
|
|
522
|
-
value: "Developers"
|
|
523
|
-
},
|
|
524
|
-
description: {
|
|
525
|
-
type: "text",
|
|
526
|
-
value: "Developers should know the basics of personalization and how to do it the Jamstack way."
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
]
|
|
531
|
-
},
|
|
532
|
-
parameters: {
|
|
533
|
-
title: {
|
|
534
|
-
type: "text",
|
|
535
|
-
value: "Our conference talks for everyone"
|
|
536
|
-
},
|
|
537
|
-
$pzCrit: {
|
|
538
|
-
type: "$pzCrit",
|
|
539
|
-
value: null
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
]
|
|
544
|
-
},
|
|
545
|
-
parameters: {
|
|
546
|
-
trackingEventName: {
|
|
547
|
-
type: "text",
|
|
548
|
-
value: "Home page talks"
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
},
|
|
552
|
-
{
|
|
553
|
-
type: "$test",
|
|
554
|
-
slots: {
|
|
555
|
-
test: [
|
|
556
|
-
{
|
|
557
|
-
type: "whyattend",
|
|
558
|
-
variant: "whyattendright",
|
|
559
|
-
parameters: {
|
|
560
|
-
text: {
|
|
561
|
-
type: "text",
|
|
562
|
-
value: "This conference has something to offer developers and marketers alike. From basics to advanced, learn more about:\n\n1. Enterprise JAMstack Personalization\n2. Uniform Personalization\n3. Uniform DXP\n\nExpand your knowledge on these subjects and engage with professionals from all over the world."
|
|
563
|
-
},
|
|
564
|
-
image: {
|
|
565
|
-
type: "text",
|
|
566
|
-
value: "/images/crowd.jpg"
|
|
567
|
-
},
|
|
568
|
-
title: {
|
|
569
|
-
type: "text",
|
|
570
|
-
value: "Why You Should Attend"
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
},
|
|
574
|
-
{
|
|
575
|
-
type: "whyattend",
|
|
576
|
-
variant: "whyattendleft",
|
|
577
|
-
parameters: {
|
|
578
|
-
text: {
|
|
579
|
-
type: "text",
|
|
580
|
-
value: "This conference has something to offer developers and marketers alike. From basics to advanced, learn more about:\n\n1. Enterprise JAMstack Personalization\n2. Uniform Personalization\n3. Uniform DXP\n\nExpand your knowledge on these subjects and engage with professionals from all over the world."
|
|
581
|
-
},
|
|
582
|
-
image: {
|
|
583
|
-
type: "text",
|
|
584
|
-
value: "/images/crowd.jpg"
|
|
585
|
-
},
|
|
586
|
-
title: {
|
|
587
|
-
type: "text",
|
|
588
|
-
value: "Why You Should Attend"
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
]
|
|
593
|
-
},
|
|
594
|
-
parameters: {
|
|
595
|
-
test: {
|
|
596
|
-
type: "testSelect",
|
|
597
|
-
value: "whyAttendTest"
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
]
|
|
602
|
-
},
|
|
603
|
-
parameters: {},
|
|
604
|
-
_permissions: [],
|
|
605
|
-
_use_team_permissions: true
|
|
606
|
-
},
|
|
607
|
-
projectId: "e132b5d8-2e49-4352-b2f6-640ab581784f",
|
|
608
|
-
state: 64,
|
|
609
|
-
created: "2022-06-02T10:42:50.973477+00:00",
|
|
610
|
-
modified: "2022-06-16T14:13:05.324643+00:00",
|
|
611
|
-
pattern: false
|
|
612
|
-
};
|
|
613
122
|
function setupUseComposition(uniformCanvasClient, currentCompositionId, preview) {
|
|
614
123
|
const useComposition = async (options) => {
|
|
615
124
|
const { data, pending, error } = await useAsyncData(`composition-${options.slug || options.compositionId}`, async () => await uniformCanvasClient[options.slug ? "getCompositionBySlug" : "getCompositionById"]({
|
|
@@ -621,3 +130,6 @@ function setupUseComposition(uniformCanvasClient, currentCompositionId, preview)
|
|
|
621
130
|
};
|
|
622
131
|
return useComposition;
|
|
623
132
|
}
|
|
133
|
+
function getModuleOptions() {
|
|
134
|
+
return useRuntimeConfig().public.$uniform;
|
|
135
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import { } from './module'
|
|
3
3
|
|
|
4
|
-
declare module '@nuxt/schema' {
|
|
5
|
-
interface NuxtConfig { ['uniform']?: Partial<ModuleOptions> }
|
|
6
|
-
interface NuxtOptions { ['uniform']?: ModuleOptions }
|
|
7
|
-
}
|
|
8
4
|
|
|
9
5
|
|
|
10
6
|
export { default } from './module'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/uniform-nuxt",
|
|
3
|
-
"version": "16.0.1-nuxt.
|
|
3
|
+
"version": "16.0.1-nuxt.181+d2c9a0bbf",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"build": "nuxt-module-build"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@nuxt/kit": "^3.0.0-rc.4"
|
|
22
|
+
"@nuxt/kit": "^3.0.0-rc.4",
|
|
23
|
+
"vue-demi": "^0.12.5"
|
|
23
24
|
},
|
|
24
25
|
"peerDependencies": {
|
|
25
26
|
"@uniformdev/canvas": ">15",
|
|
@@ -29,17 +30,19 @@
|
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@nuxt/module-builder": "0.1.7",
|
|
33
|
+
"@nuxt/schema": "3.0.0-rc.4",
|
|
32
34
|
"@nuxtjs/eslint-config-typescript": "10.0.0",
|
|
33
|
-
"@uniformdev/canvas": "^16.0.1-nuxt.
|
|
34
|
-
"@uniformdev/canvas-vue": "^16.0.1-nuxt.
|
|
35
|
-
"@uniformdev/context": "^16.0.1-nuxt.
|
|
36
|
-
"@uniformdev/context-vue": "^16.0.1-nuxt.
|
|
35
|
+
"@uniformdev/canvas": "^16.0.1-nuxt.181+d2c9a0bbf",
|
|
36
|
+
"@uniformdev/canvas-vue": "^16.0.1-nuxt.181+d2c9a0bbf",
|
|
37
|
+
"@uniformdev/context": "^16.0.1-nuxt.181+d2c9a0bbf",
|
|
38
|
+
"@uniformdev/context-vue": "^16.0.1-nuxt.181+d2c9a0bbf",
|
|
37
39
|
"esbuild": "0.13.15",
|
|
38
40
|
"eslint": "latest",
|
|
39
|
-
"nuxt": "^3.0.0-rc.4"
|
|
41
|
+
"nuxt": "^3.0.0-rc.4",
|
|
42
|
+
"vue": "3.2.37"
|
|
40
43
|
},
|
|
41
44
|
"publishConfig": {
|
|
42
45
|
"access": "public"
|
|
43
46
|
},
|
|
44
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "d2c9a0bbf7c8a640213fee2f6eae7c1cfdd08b02"
|
|
45
48
|
}
|