@contentful/experiences-visual-editor-react 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
@@ -180,6 +180,7 @@ const builtInStyles = {
180
180
  },
181
181
  type: 'Text',
182
182
  group: 'style',
183
+ description: 'The vertical alignment of the section',
183
184
  defaultValue: 'center',
184
185
  displayName: 'Vertical alignment',
185
186
  },
@@ -206,6 +207,7 @@ const builtInStyles = {
206
207
  },
207
208
  type: 'Text',
208
209
  group: 'style',
210
+ description: 'The horizontal alignment of the section',
209
211
  defaultValue: 'center',
210
212
  displayName: 'Horizontal alignment',
211
213
  },
@@ -214,71 +216,83 @@ const builtInStyles = {
214
216
  type: 'Boolean',
215
217
  group: 'style',
216
218
  defaultValue: true,
219
+ description: 'The visibility of the component',
217
220
  },
218
221
  cfMargin: {
219
222
  displayName: 'Margin',
220
223
  type: 'Text',
221
224
  group: 'style',
225
+ description: 'The margin of the section',
222
226
  defaultValue: '0 0 0 0',
223
227
  },
224
228
  cfPadding: {
225
229
  displayName: 'Padding',
226
230
  type: 'Text',
227
231
  group: 'style',
232
+ description: 'The padding of the section',
228
233
  defaultValue: '0 0 0 0',
229
234
  },
230
235
  cfBackgroundColor: {
231
236
  displayName: 'Background color',
232
237
  type: 'Text',
233
238
  group: 'style',
239
+ description: 'The background color of the section',
234
240
  defaultValue: 'rgba(0, 0, 0, 0)',
235
241
  },
236
242
  cfWidth: {
237
243
  displayName: 'Width',
238
244
  type: 'Text',
239
245
  group: 'style',
246
+ description: 'The width of the section',
240
247
  defaultValue: '100%',
241
248
  },
242
249
  cfHeight: {
243
250
  displayName: 'Height',
244
251
  type: 'Text',
245
252
  group: 'style',
253
+ description: 'The height of the section',
246
254
  defaultValue: 'fit-content',
247
255
  },
248
256
  cfMaxWidth: {
249
257
  displayName: 'Max width',
250
258
  type: 'Text',
251
259
  group: 'style',
260
+ description: 'The max-width of the section',
252
261
  defaultValue: 'none',
253
262
  },
254
263
  cfFlexDirection: {
255
264
  displayName: 'Direction',
256
265
  type: 'Text',
257
266
  group: 'style',
267
+ description: 'The orientation of the section',
258
268
  defaultValue: 'column',
259
269
  },
260
270
  cfFlexReverse: {
261
271
  displayName: 'Reverse Direction',
262
272
  type: 'Boolean',
263
273
  group: 'style',
274
+ description: 'Toggle the flex direction to be reversed',
264
275
  defaultValue: false,
265
276
  },
266
277
  cfFlexWrap: {
267
278
  displayName: 'Wrap objects',
268
279
  type: 'Text',
269
280
  group: 'style',
281
+ description: 'Wrap objects',
270
282
  defaultValue: 'nowrap',
271
283
  },
272
284
  cfBorder: {
273
285
  displayName: 'Border',
274
286
  type: 'Text',
275
287
  group: 'style',
288
+ description: 'The border of the section',
276
289
  defaultValue: '0px solid rgba(0, 0, 0, 0)',
277
290
  },
278
291
  cfGap: {
279
292
  displayName: 'Gap',
280
293
  type: 'Text',
281
294
  group: 'style',
295
+ description: 'The spacing between the elements of the section',
282
296
  defaultValue: '0px',
283
297
  },
284
298
  cfHyperlink: {
@@ -289,6 +303,7 @@ const builtInStyles = {
289
303
  format: 'URL',
290
304
  bindingSourceType: ['entry', 'experience', 'manual'],
291
305
  },
306
+ description: 'hyperlink for section or container',
292
307
  },
293
308
  cfOpenInNewTab: {
294
309
  displayName: 'URL behaviour',
@@ -302,6 +317,7 @@ const optionalBuiltInStyles = {
302
317
  displayName: 'Font Size',
303
318
  type: 'Text',
304
319
  group: 'style',
320
+ description: 'The font size of the element',
305
321
  defaultValue: '16px',
306
322
  },
307
323
  cfFontWeight: {
@@ -324,11 +340,13 @@ const optionalBuiltInStyles = {
324
340
  displayName: 'Font Weight',
325
341
  type: 'Text',
326
342
  group: 'style',
343
+ description: 'The font weight of the element',
327
344
  defaultValue: '400',
328
345
  },
329
346
  cfImageAsset: {
330
347
  displayName: 'Image',
331
348
  type: 'Media',
349
+ description: 'Image to display',
332
350
  validations: {
333
351
  bindingSourceType: ['asset', 'entry', 'manual'],
334
352
  },
@@ -347,11 +365,13 @@ const optionalBuiltInStyles = {
347
365
  displayName: 'Background color',
348
366
  type: 'Text',
349
367
  group: 'style',
368
+ description: 'The background color of the element',
350
369
  defaultValue: 'rgba(0, 0, 0, 0)',
351
370
  },
352
371
  cfBackgroundImageUrl: {
353
372
  displayName: 'Background image',
354
373
  type: 'Media',
374
+ description: 'Background image for component',
355
375
  validations: {
356
376
  bindingSourceType: ['asset', 'entry', 'manual'],
357
377
  },
@@ -370,24 +390,28 @@ const optionalBuiltInStyles = {
370
390
  displayName: 'Border Radius',
371
391
  type: 'Text',
372
392
  group: 'style',
393
+ description: 'The border radius of the section',
373
394
  defaultValue: '0px',
374
395
  },
375
396
  cfLineHeight: {
376
397
  displayName: 'Line Height',
377
398
  type: 'Text',
378
399
  group: 'style',
400
+ description: 'The line height of the element',
379
401
  defaultValue: '20px',
380
402
  },
381
403
  cfLetterSpacing: {
382
404
  displayName: 'Letter Spacing',
383
405
  type: 'Text',
384
406
  group: 'style',
407
+ description: 'The letter spacing of the element',
385
408
  defaultValue: '0px',
386
409
  },
387
410
  cfTextColor: {
388
411
  displayName: 'Text Color',
389
412
  type: 'Text',
390
413
  group: 'style',
414
+ description: 'The text color of the element',
391
415
  defaultValue: 'rgba(0, 0, 0, 1)',
392
416
  },
393
417
  cfTextAlign: {
@@ -410,6 +434,7 @@ const optionalBuiltInStyles = {
410
434
  displayName: 'Text Align',
411
435
  type: 'Text',
412
436
  group: 'style',
437
+ description: 'The text alignment of the element',
413
438
  defaultValue: 'start',
414
439
  },
415
440
  cfTextTransform: {
@@ -436,24 +461,28 @@ const optionalBuiltInStyles = {
436
461
  displayName: 'Text Transform',
437
462
  type: 'Text',
438
463
  group: 'style',
464
+ description: 'The text transform of the element',
439
465
  defaultValue: 'none',
440
466
  },
441
467
  cfTextBold: {
442
468
  displayName: 'Bold',
443
469
  type: 'Boolean',
444
470
  group: 'style',
471
+ description: 'The text bold of the element',
445
472
  defaultValue: false,
446
473
  },
447
474
  cfTextItalic: {
448
475
  displayName: 'Italic',
449
476
  type: 'Boolean',
450
477
  group: 'style',
478
+ description: 'The text italic of the element',
451
479
  defaultValue: false,
452
480
  },
453
481
  cfTextUnderline: {
454
482
  displayName: 'Underline',
455
483
  type: 'Boolean',
456
484
  group: 'style',
485
+ description: 'The text underline of the element',
457
486
  defaultValue: false,
458
487
  },
459
488
  };
@@ -766,6 +795,19 @@ const ComponentVariableSchema$1 = z.object({
766
795
  });
767
796
  const ComponentTreeNodeSchema$1 = BaseComponentTreeNodeSchema$1.extend({
768
797
  children: z.lazy(() => ComponentTreeNodeSchema$1.array()),
798
+ }).superRefine(({ id, prebindingId, parameters }, ctx) => {
799
+ if (prebindingId && !parameters) {
800
+ ctx.addIssue({
801
+ code: z.ZodIssueCode.custom,
802
+ message: `Found "prebindingId" but no "parameters" for node with id: "${id}"`,
803
+ });
804
+ }
805
+ if (parameters && !prebindingId) {
806
+ ctx.addIssue({
807
+ code: z.ZodIssueCode.custom,
808
+ message: `Found "parameters" but no "prebindingId" for node with id: "${id}"`,
809
+ });
810
+ }
769
811
  });
770
812
  const ComponentTreeSchema$1 = z
771
813
  .object({
@@ -869,6 +911,7 @@ const ParameterDefinitionSchema$1 = z.object({
869
911
  passToNodes: z
870
912
  .array(PassToNodeSchema$1)
871
913
  .max(1, 'At most one "passToNodes" element is allowed per parameter definition.'),
914
+ // we might change this to be empty array for native parameter definitions, that's why we don't use .length(1)
872
915
  });
873
916
  const ParameterDefinitionsSchema$1 = z.record(propertyKeySchema$1, ParameterDefinitionSchema$1);
874
917
  const VariableMappingsSchema$1 = z.record(propertyKeySchema$1, VariableMappingSchema$1);
@@ -4003,6 +4046,19 @@ const ComponentVariableSchema = z.object({
4003
4046
  });
4004
4047
  const ComponentTreeNodeSchema = BaseComponentTreeNodeSchema.extend({
4005
4048
  children: z.lazy(() => ComponentTreeNodeSchema.array()),
4049
+ }).superRefine(({ id, prebindingId, parameters }, ctx) => {
4050
+ if (prebindingId && !parameters) {
4051
+ ctx.addIssue({
4052
+ code: z.ZodIssueCode.custom,
4053
+ message: `Found "prebindingId" but no "parameters" for node with id: "${id}"`,
4054
+ });
4055
+ }
4056
+ if (parameters && !prebindingId) {
4057
+ ctx.addIssue({
4058
+ code: z.ZodIssueCode.custom,
4059
+ message: `Found "parameters" but no "prebindingId" for node with id: "${id}"`,
4060
+ });
4061
+ }
4006
4062
  });
4007
4063
  const ComponentTreeSchema = z
4008
4064
  .object({
@@ -4106,6 +4162,7 @@ const ParameterDefinitionSchema = z.object({
4106
4162
  passToNodes: z
4107
4163
  .array(PassToNodeSchema)
4108
4164
  .max(1, 'At most one "passToNodes" element is allowed per parameter definition.'),
4165
+ // we might change this to be empty array for native parameter definitions, that's why we don't use .length(1)
4109
4166
  });
4110
4167
  const ParameterDefinitionsSchema = z.record(propertyKeySchema, ParameterDefinitionSchema);
4111
4168
  const VariableMappingsSchema = z.record(propertyKeySchema, VariableMappingSchema);