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