@uniformdev/uniform-nuxt 16.0.1-nuxt.146 → 16.0.1-nuxt.157

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,3 +1,11 @@
1
1
  # Uniform Nuxt Module
2
2
 
3
+ Documentation will be added very soon!
4
+
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
+
8
+
9
+ -----
10
+
3
11
  part of the [Uniform Platform](https://uniform.app). See our [documentation](https://docs.uniform.app) for more details.
package/dist/module.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
1
  import { ManifestV2 } from '@uniformdev/context';
3
2
 
4
3
  interface ModuleOptions {
@@ -6,7 +5,8 @@ interface ModuleOptions {
6
5
  readOnlyApiKey?: string;
7
6
  apiHost?: string;
8
7
  manifest?: ManifestV2;
8
+ outputType?: string;
9
9
  }
10
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
10
+ declare const _default: NuxtModule<OptionsT>;
11
11
 
12
12
  export { ModuleOptions, _default as default };
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "nuxt-uniform",
3
3
  "configKey": "uniform",
4
- "version": "16.0.1-nuxt.146+04197b8d4"
4
+ "version": "16.0.1-nuxt.157+183b5f5f5"
5
5
  }
package/dist/module.mjs CHANGED
@@ -11,7 +11,8 @@ const module = defineNuxtModule({
11
11
  projectId: void 0,
12
12
  readOnlyApiKey: void 0,
13
13
  apiHost: "https://uniform.app",
14
- manifest: void 0
14
+ manifest: void 0,
15
+ outputType: void 0
15
16
  },
16
17
  setup(options, nuxt) {
17
18
  nuxt.options.runtimeConfig.public["$uniform"] = { ...options };
@@ -1,11 +1,24 @@
1
- import { defineNuxtPlugin, useRoute, useRuntimeConfig, useHead } from "#app";
2
- import { watch, ref } from "vue";
1
+ import {
2
+ defineNuxtPlugin,
3
+ useRoute,
4
+ useRuntimeConfig,
5
+ useHead,
6
+ refreshNuxtData,
7
+ useAsyncData,
8
+ useState,
9
+ useCookie
10
+ } from "#app";
11
+ import { watch } from "vue-demi";
3
12
  import {
4
13
  CanvasClient,
5
14
  CANVAS_DRAFT_STATE,
6
15
  CANVAS_PUBLISHED_STATE
7
16
  } from "@uniformdev/canvas";
8
- import { Context } from "@uniformdev/context";
17
+ import {
18
+ Context,
19
+ CookieTransitionDataStore,
20
+ UNIFORM_DEFAULT_COOKIE_NAME
21
+ } from "@uniformdev/context";
9
22
  import { Composition, SlotContent, useCompositionEventEffect } from "@uniformdev/canvas-vue";
10
23
  import {
11
24
  provideUniformContext,
@@ -16,7 +29,7 @@ export default defineNuxtPlugin((nuxtApp) => {
16
29
  if (nuxtApp.$uniformIsSetup) {
17
30
  return;
18
31
  }
19
- const currentCompositionId = ref();
32
+ const currentCompositionId = useState("currentCompositionId", () => "");
20
33
  const preview = setupPreview();
21
34
  const uniformContext = setupContext(nuxtApp);
22
35
  const uniformCanvasClient = setupCanvas(nuxtApp);
@@ -35,12 +48,16 @@ export default defineNuxtPlugin((nuxtApp) => {
35
48
  });
36
49
  function setupContext(nuxtApp) {
37
50
  const options = useRuntimeConfig().public.$uniform;
51
+ const uniformCookie = useCookie(UNIFORM_DEFAULT_COOKIE_NAME).value;
38
52
  let uniformContext;
39
53
  if (options.manifest) {
40
- console.log("\u{1F4DC} found a manifest, will initialize Context");
54
+ console.log("uniform-nuxt: \u{1F4DC} found a manifest, will initialize Context");
41
55
  uniformContext = new Context({
42
56
  defaultConsent: true,
43
- manifest: options.manifest
57
+ manifest: options.manifest,
58
+ transitionStore: new CookieTransitionDataStore({
59
+ serverCookieValue: uniformCookie
60
+ })
44
61
  });
45
62
  }
46
63
  provideUniformContext({
@@ -69,7 +86,7 @@ function setupPreview() {
69
86
  const route = useRoute();
70
87
  let preview;
71
88
  if (route.query.preview === "true") {
72
- console.log("\u{1F575}\uFE0F Entering preview mode");
89
+ console.log("uniform-nuxt: \u{1F575}\uFE0F Entering preview mode");
73
90
  preview = {
74
91
  slug: route.query.slug
75
92
  };
@@ -92,6 +109,507 @@ function setupLivePreview(currentCompositionId, isPreview = false) {
92
109
  effect: onCompositionChange
93
110
  });
94
111
  }
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
+ };
95
613
  function setupUseComposition(uniformCanvasClient, currentCompositionId, preview) {
96
614
  const useComposition = async (options) => {
97
615
  const { data, pending, error } = await useAsyncData(`composition-${options.slug || options.compositionId}`, async () => await uniformCanvasClient[options.slug ? "getCompositionBySlug" : "getCompositionById"]({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/uniform-nuxt",
3
- "version": "16.0.1-nuxt.146+04197b8d4",
3
+ "version": "16.0.1-nuxt.157+183b5f5f5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -22,23 +22,24 @@
22
22
  "@nuxt/kit": "^3.0.0-rc.4"
23
23
  },
24
24
  "peerDependencies": {
25
- "@uniformdev/canvas": ">16.1.0",
26
- "@uniformdev/canvas-vue": ">16.1.0",
27
- "@uniformdev/context": ">16.1.0",
28
- "@uniformdev/context-vue": ">16.1.0"
25
+ "@uniformdev/canvas": ">=16.0.0",
26
+ "@uniformdev/canvas-vue": ">=16.0.0",
27
+ "@uniformdev/context": ">=16.0.0",
28
+ "@uniformdev/context-vue": ">=16.0.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@nuxt/module-builder": "latest",
32
- "@nuxtjs/eslint-config-typescript": "latest",
33
- "@uniformdev/canvas": "^16.0.1-nuxt.146+04197b8d4",
34
- "@uniformdev/canvas-vue": "^16.0.1-nuxt.146+04197b8d4",
35
- "@uniformdev/context": "^16.0.1-nuxt.146+04197b8d4",
36
- "@uniformdev/context-vue": "^16.0.1-nuxt.146+04197b8d4",
31
+ "@nuxt/module-builder": "0.1.7",
32
+ "@nuxtjs/eslint-config-typescript": "10.0.0",
33
+ "@uniformdev/canvas": "^16.0.1-nuxt.157+183b5f5f5",
34
+ "@uniformdev/canvas-vue": "^16.0.1-nuxt.157+183b5f5f5",
35
+ "@uniformdev/context": "^16.0.1-nuxt.157+183b5f5f5",
36
+ "@uniformdev/context-vue": "^16.0.1-nuxt.157+183b5f5f5",
37
+ "esbuild": "0.13.15",
37
38
  "eslint": "latest",
38
39
  "nuxt": "^3.0.0-rc.4"
39
40
  },
40
41
  "publishConfig": {
41
42
  "access": "public"
42
43
  },
43
- "gitHead": "04197b8d483707f49939875b690b902f48f1ccfe"
44
+ "gitHead": "183b5f5f5de269c8391c31799d18f0dbcefbaea7"
44
45
  }