@contentful/experiences-core 3.8.0-beta.0 → 3.8.0-prerelease-20250922T2329-e132272.0

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/index.js CHANGED
@@ -181,6 +181,7 @@ const builtInStyles = {
181
181
  },
182
182
  type: 'Text',
183
183
  group: 'style',
184
+ description: 'The vertical alignment of the section',
184
185
  defaultValue: 'center',
185
186
  displayName: 'Vertical alignment',
186
187
  },
@@ -207,6 +208,7 @@ const builtInStyles = {
207
208
  },
208
209
  type: 'Text',
209
210
  group: 'style',
211
+ description: 'The horizontal alignment of the section',
210
212
  defaultValue: 'center',
211
213
  displayName: 'Horizontal alignment',
212
214
  },
@@ -215,71 +217,83 @@ const builtInStyles = {
215
217
  type: 'Boolean',
216
218
  group: 'style',
217
219
  defaultValue: true,
220
+ description: 'The visibility of the component',
218
221
  },
219
222
  cfMargin: {
220
223
  displayName: 'Margin',
221
224
  type: 'Text',
222
225
  group: 'style',
226
+ description: 'The margin of the section',
223
227
  defaultValue: '0 0 0 0',
224
228
  },
225
229
  cfPadding: {
226
230
  displayName: 'Padding',
227
231
  type: 'Text',
228
232
  group: 'style',
233
+ description: 'The padding of the section',
229
234
  defaultValue: '0 0 0 0',
230
235
  },
231
236
  cfBackgroundColor: {
232
237
  displayName: 'Background color',
233
238
  type: 'Text',
234
239
  group: 'style',
240
+ description: 'The background color of the section',
235
241
  defaultValue: 'rgba(0, 0, 0, 0)',
236
242
  },
237
243
  cfWidth: {
238
244
  displayName: 'Width',
239
245
  type: 'Text',
240
246
  group: 'style',
247
+ description: 'The width of the section',
241
248
  defaultValue: '100%',
242
249
  },
243
250
  cfHeight: {
244
251
  displayName: 'Height',
245
252
  type: 'Text',
246
253
  group: 'style',
254
+ description: 'The height of the section',
247
255
  defaultValue: 'fit-content',
248
256
  },
249
257
  cfMaxWidth: {
250
258
  displayName: 'Max width',
251
259
  type: 'Text',
252
260
  group: 'style',
261
+ description: 'The max-width of the section',
253
262
  defaultValue: 'none',
254
263
  },
255
264
  cfFlexDirection: {
256
265
  displayName: 'Direction',
257
266
  type: 'Text',
258
267
  group: 'style',
268
+ description: 'The orientation of the section',
259
269
  defaultValue: 'column',
260
270
  },
261
271
  cfFlexReverse: {
262
272
  displayName: 'Reverse Direction',
263
273
  type: 'Boolean',
264
274
  group: 'style',
275
+ description: 'Toggle the flex direction to be reversed',
265
276
  defaultValue: false,
266
277
  },
267
278
  cfFlexWrap: {
268
279
  displayName: 'Wrap objects',
269
280
  type: 'Text',
270
281
  group: 'style',
282
+ description: 'Wrap objects',
271
283
  defaultValue: 'nowrap',
272
284
  },
273
285
  cfBorder: {
274
286
  displayName: 'Border',
275
287
  type: 'Text',
276
288
  group: 'style',
289
+ description: 'The border of the section',
277
290
  defaultValue: '0px solid rgba(0, 0, 0, 0)',
278
291
  },
279
292
  cfGap: {
280
293
  displayName: 'Gap',
281
294
  type: 'Text',
282
295
  group: 'style',
296
+ description: 'The spacing between the elements of the section',
283
297
  defaultValue: '0px',
284
298
  },
285
299
  cfHyperlink: {
@@ -290,6 +304,7 @@ const builtInStyles = {
290
304
  format: 'URL',
291
305
  bindingSourceType: ['entry', 'experience', 'manual'],
292
306
  },
307
+ description: 'hyperlink for section or container',
293
308
  },
294
309
  cfOpenInNewTab: {
295
310
  displayName: 'URL behaviour',
@@ -303,6 +318,7 @@ const optionalBuiltInStyles = {
303
318
  displayName: 'Font Size',
304
319
  type: 'Text',
305
320
  group: 'style',
321
+ description: 'The font size of the element',
306
322
  defaultValue: '16px',
307
323
  },
308
324
  cfFontWeight: {
@@ -325,11 +341,13 @@ const optionalBuiltInStyles = {
325
341
  displayName: 'Font Weight',
326
342
  type: 'Text',
327
343
  group: 'style',
344
+ description: 'The font weight of the element',
328
345
  defaultValue: '400',
329
346
  },
330
347
  cfImageAsset: {
331
348
  displayName: 'Image',
332
349
  type: 'Media',
350
+ description: 'Image to display',
333
351
  validations: {
334
352
  bindingSourceType: ['asset', 'entry', 'manual'],
335
353
  },
@@ -348,11 +366,13 @@ const optionalBuiltInStyles = {
348
366
  displayName: 'Background color',
349
367
  type: 'Text',
350
368
  group: 'style',
369
+ description: 'The background color of the element',
351
370
  defaultValue: 'rgba(0, 0, 0, 0)',
352
371
  },
353
372
  cfBackgroundImageUrl: {
354
373
  displayName: 'Background image',
355
374
  type: 'Media',
375
+ description: 'Background image for component',
356
376
  validations: {
357
377
  bindingSourceType: ['asset', 'entry', 'manual'],
358
378
  },
@@ -371,24 +391,28 @@ const optionalBuiltInStyles = {
371
391
  displayName: 'Border Radius',
372
392
  type: 'Text',
373
393
  group: 'style',
394
+ description: 'The border radius of the section',
374
395
  defaultValue: '0px',
375
396
  },
376
397
  cfLineHeight: {
377
398
  displayName: 'Line Height',
378
399
  type: 'Text',
379
400
  group: 'style',
401
+ description: 'The line height of the element',
380
402
  defaultValue: '20px',
381
403
  },
382
404
  cfLetterSpacing: {
383
405
  displayName: 'Letter Spacing',
384
406
  type: 'Text',
385
407
  group: 'style',
408
+ description: 'The letter spacing of the element',
386
409
  defaultValue: '0px',
387
410
  },
388
411
  cfTextColor: {
389
412
  displayName: 'Text Color',
390
413
  type: 'Text',
391
414
  group: 'style',
415
+ description: 'The text color of the element',
392
416
  defaultValue: 'rgba(0, 0, 0, 1)',
393
417
  },
394
418
  cfTextAlign: {
@@ -411,6 +435,7 @@ const optionalBuiltInStyles = {
411
435
  displayName: 'Text Align',
412
436
  type: 'Text',
413
437
  group: 'style',
438
+ description: 'The text alignment of the element',
414
439
  defaultValue: 'start',
415
440
  },
416
441
  cfTextTransform: {
@@ -437,24 +462,28 @@ const optionalBuiltInStyles = {
437
462
  displayName: 'Text Transform',
438
463
  type: 'Text',
439
464
  group: 'style',
465
+ description: 'The text transform of the element',
440
466
  defaultValue: 'none',
441
467
  },
442
468
  cfTextBold: {
443
469
  displayName: 'Bold',
444
470
  type: 'Boolean',
445
471
  group: 'style',
472
+ description: 'The text bold of the element',
446
473
  defaultValue: false,
447
474
  },
448
475
  cfTextItalic: {
449
476
  displayName: 'Italic',
450
477
  type: 'Boolean',
451
478
  group: 'style',
479
+ description: 'The text italic of the element',
452
480
  defaultValue: false,
453
481
  },
454
482
  cfTextUnderline: {
455
483
  displayName: 'Underline',
456
484
  type: 'Boolean',
457
485
  group: 'style',
486
+ description: 'The text underline of the element',
458
487
  defaultValue: false,
459
488
  },
460
489
  };
@@ -473,6 +502,7 @@ const containerBuiltInStyles = {
473
502
  displayName: 'Margin',
474
503
  type: 'Text',
475
504
  group: 'style',
505
+ description: 'The margin of the container',
476
506
  // Note: The UI overwrites '0 Auto 0 Auto' as the default value for top-level containers
477
507
  defaultValue: '0 0 0 0',
478
508
  },
@@ -480,6 +510,7 @@ const containerBuiltInStyles = {
480
510
  displayName: 'Max Width',
481
511
  type: 'Text',
482
512
  group: 'style',
513
+ description: 'The max-width of the section',
483
514
  defaultValue: '1192px',
484
515
  },
485
516
  };
@@ -490,30 +521,35 @@ const dividerBuiltInStyles = {
490
521
  displayName: 'Margin',
491
522
  type: 'Text',
492
523
  group: 'style',
524
+ description: 'The margin of the divider',
493
525
  defaultValue: '20px 0px 20px 0px',
494
526
  },
495
527
  cfWidth: {
496
528
  displayName: 'Width',
497
529
  type: 'Text',
498
530
  group: 'style',
531
+ description: 'The width of the divider',
499
532
  defaultValue: '100%',
500
533
  },
501
534
  cfHeight: {
502
535
  displayName: 'Height',
503
536
  type: 'Text',
504
537
  group: 'style',
538
+ description: 'The height of the divider',
505
539
  defaultValue: '1px',
506
540
  },
507
541
  cfMaxWidth: {
508
542
  displayName: 'Max width',
509
543
  type: 'Text',
510
544
  group: 'style',
545
+ description: 'The max-width of the divider',
511
546
  defaultValue: 'none',
512
547
  },
513
548
  cfBackgroundColor: {
514
549
  displayName: 'Background color',
515
550
  type: 'Text',
516
551
  group: 'style',
552
+ description: 'The background color of the divider',
517
553
  defaultValue: 'rgba(204, 204, 204, 1)',
518
554
  },
519
555
  };
@@ -546,6 +582,7 @@ const singleColumnBuiltInStyles = {
546
582
  },
547
583
  type: 'Text',
548
584
  group: 'style',
585
+ description: 'The vertical alignment of the column',
549
586
  defaultValue: 'center',
550
587
  displayName: 'Vertical alignment',
551
588
  },
@@ -572,6 +609,7 @@ const singleColumnBuiltInStyles = {
572
609
  },
573
610
  type: 'Text',
574
611
  group: 'style',
612
+ description: 'The horizontal alignment of the column',
575
613
  defaultValue: 'center',
576
614
  displayName: 'Horizontal alignment',
577
615
  },
@@ -579,30 +617,35 @@ const singleColumnBuiltInStyles = {
579
617
  displayName: 'Padding',
580
618
  type: 'Text',
581
619
  group: 'style',
620
+ description: 'The padding of the column',
582
621
  defaultValue: '0 0 0 0',
583
622
  },
584
623
  cfFlexDirection: {
585
624
  displayName: 'Direction',
586
625
  type: 'Text',
587
626
  group: 'style',
627
+ description: 'The orientation of the column',
588
628
  defaultValue: 'column',
589
629
  },
590
630
  cfFlexWrap: {
591
631
  displayName: 'Wrap objects',
592
632
  type: 'Text',
593
633
  group: 'style',
634
+ description: 'Wrap objects',
594
635
  defaultValue: 'nowrap',
595
636
  },
596
637
  cfBorder: {
597
638
  displayName: 'Border',
598
639
  type: 'Text',
599
640
  group: 'style',
641
+ description: 'The border of the column',
600
642
  defaultValue: '0px solid rgba(0, 0, 0, 0)',
601
643
  },
602
644
  cfGap: {
603
645
  displayName: 'Gap',
604
646
  type: 'Text',
605
647
  group: 'style',
648
+ description: 'The spacing between the elements of the column',
606
649
  defaultValue: '0px',
607
650
  },
608
651
  cfColumnSpan: {
@@ -626,6 +669,7 @@ const columnsBuiltInStyles = {
626
669
  displayName: 'Margin',
627
670
  type: 'Text',
628
671
  group: 'style',
672
+ description: 'The margin of the columns',
629
673
  // Note: The UI overwrites '0 Auto 0 Auto' as the default value for top-level columns
630
674
  defaultValue: '0 0 0 0',
631
675
  },
@@ -633,30 +677,35 @@ const columnsBuiltInStyles = {
633
677
  displayName: 'Width',
634
678
  type: 'Text',
635
679
  group: 'style',
680
+ description: 'The width of the columns',
636
681
  defaultValue: '100%',
637
682
  },
638
683
  cfMaxWidth: {
639
684
  displayName: 'Max width',
640
685
  type: 'Text',
641
686
  group: 'style',
687
+ description: 'The max-width of the columns',
642
688
  defaultValue: '1192px',
643
689
  },
644
690
  cfPadding: {
645
691
  displayName: 'Padding',
646
692
  type: 'Text',
647
693
  group: 'style',
694
+ description: 'The padding of the columns',
648
695
  defaultValue: '10px 10px 10px 10px',
649
696
  },
650
697
  cfBorder: {
651
698
  displayName: 'Border',
652
699
  type: 'Text',
653
700
  group: 'style',
701
+ description: 'The border of the columns',
654
702
  defaultValue: '0px solid rgba(0, 0, 0, 0)',
655
703
  },
656
704
  cfGap: {
657
705
  displayName: 'Gap',
658
706
  type: 'Text',
659
707
  group: 'style',
708
+ description: 'The spacing between the elements of the columns',
660
709
  defaultValue: '10px 10px',
661
710
  },
662
711
  cfColumns: {
@@ -988,6 +1037,19 @@ const ComponentVariableSchema = z.object({
988
1037
  });
989
1038
  const ComponentTreeNodeSchema = BaseComponentTreeNodeSchema.extend({
990
1039
  children: z.lazy(() => ComponentTreeNodeSchema.array()),
1040
+ }).superRefine(({ id, prebindingId, parameters }, ctx) => {
1041
+ if (prebindingId && !parameters) {
1042
+ ctx.addIssue({
1043
+ code: z.ZodIssueCode.custom,
1044
+ message: `Found "prebindingId" but no "parameters" for node with id: "${id}"`,
1045
+ });
1046
+ }
1047
+ if (parameters && !prebindingId) {
1048
+ ctx.addIssue({
1049
+ code: z.ZodIssueCode.custom,
1050
+ message: `Found "parameters" but no "prebindingId" for node with id: "${id}"`,
1051
+ });
1052
+ }
991
1053
  });
992
1054
  const ComponentTreeSchema = z
993
1055
  .object({
@@ -1091,6 +1153,7 @@ const ParameterDefinitionSchema = z.object({
1091
1153
  passToNodes: z
1092
1154
  .array(PassToNodeSchema)
1093
1155
  .max(1, 'At most one "passToNodes" element is allowed per parameter definition.'),
1156
+ // we might change this to be empty array for native parameter definitions, that's why we don't use .length(1)
1094
1157
  });
1095
1158
  const ParameterDefinitionsSchema = z.record(propertyKeySchema, ParameterDefinitionSchema);
1096
1159
  const VariableMappingsSchema = z.record(propertyKeySchema, VariableMappingSchema);