@contentful/experiences-visual-editor-react 3.6.1-dev-20250904T1450-0286e47.0 → 3.6.1-dev-20250909T1146-4eefde4.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
@@ -892,8 +892,20 @@ z.object({
892
892
  componentSettings: localeWrapper$1(ComponentSettingsSchema$1),
893
893
  });
894
894
 
895
- z.object({
895
+ z
896
+ .object({
896
897
  id: DefinitionPropertyKeySchema$1,
898
+ name: z.string(),
899
+ category: z.string().optional(),
900
+ thumbnailUrl: z.string().optional(),
901
+ thumbnailId: z.string().optional(),
902
+ hyperlinkPattern: z.string().optional(),
903
+ children: z.boolean().optional(),
904
+ slots: z
905
+ .record(DefinitionPropertyKeySchema$1, z.object({ displayName: z.string().optional() }))
906
+ .optional(),
907
+ builtInStyles: z.array(z.string()).optional(),
908
+ tooltip: z.object({ imageUrl: z.string().optional(), description: z.string() }).optional(),
897
909
  variables: z.record(DefinitionPropertyKeySchema$1, ComponentVariableSchema$1.extend({
898
910
  defaultValue: PrimitiveValueSchema$1.optional(),
899
911
  }).superRefine((val, ctx) => {
@@ -999,6 +1011,27 @@ z.object({
999
1011
  break;
1000
1012
  }
1001
1013
  })),
1014
+ })
1015
+ .superRefine((val, ctx) => {
1016
+ if (val.children === true && (!!val.variables.children || !!val.slots?.children)) {
1017
+ ctx.addIssue({
1018
+ code: z.ZodIssueCode.custom,
1019
+ message: `Cannot activate 'children: true' and name a variable or slot 'children' at the same time`,
1020
+ fatal: false,
1021
+ });
1022
+ }
1023
+ // Ensure that slots and variables don't use the same names
1024
+ if (val.variables && val.slots) {
1025
+ Object.keys(val.variables).forEach((name) => {
1026
+ if (val.slots[name]) {
1027
+ ctx.addIssue({
1028
+ code: z.ZodIssueCode.custom,
1029
+ message: `Variable and slot cannot have the same name: ${name}`,
1030
+ fatal: false,
1031
+ });
1032
+ }
1033
+ });
1034
+ }
1002
1035
  });
1003
1036
 
1004
1037
  var CodeNames$1;
@@ -3276,7 +3309,7 @@ const useEditorStore = create((set, get) => ({
3276
3309
  },
3277
3310
  }));
3278
3311
 
3279
- var css_248z$8 = "@import url(https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,400;0,500;0,600;1,400;1,600&display=swap);:root{--cf-color-white:#fff;--cf-color-black:#000;--cf-color-gray100:#f7f9fa;--cf-color-gray400:#aec1cc;--cf-color-gray400-rgb:174,193,204;--cf-spacing-0:0rem;--cf-spacing-1:0.125rem;--cf-spacing-2:0.25rem;--cf-spacing-3:0.375rem;--cf-spacing-4:0.5rem;--cf-spacing-5:0.625rem;--cf-spacing-6:0.75rem;--cf-spacing-7:0.875rem;--cf-spacing-8:1rem;--cf-spacing-9:1.25rem;--cf-spacing-10:1.5rem;--cf-spacing-11:1.75rem;--cf-spacing-12:2rem;--cf-spacing-13:2.25rem;--cf-text-xs:0.75rem;--cf-text-sm:0.875rem;--cf-text-base:1rem;--cf-text-lg:1.125rem;--cf-text-xl:1.25rem;--cf-text-2xl:1.5rem;--cf-text-3xl:2rem;--cf-text-4xl:2.75rem;--cf-font-light:300;--cf-font-normal:400;--cf-font-medium:500;--cf-font-semibold:600;--cf-font-bold:700;--cf-font-extra-bold:800;--cf-font-black:900;--cf-border-radius-none:0px;--cf-border-radius-sm:0.125rem;--cf-border-radius:0.25rem;--cf-border-radius-md:0.375rem;--cf-border-radius-lg:0.5rem;--cf-border-radius-xl:0.75rem;--cf-border-radius-2xl:1rem;--cf-border-radius-3xl:1.5rem;--cf-border-radius-full:9999px;--cf-font-family-sans:Archivo,Helvetica,Arial,sans-serif;--cf-font-family-serif:Georgia,Cambria,Times New Roman,Times,serif;--cf-max-width-full:100%;--cf-button-bg:var(--cf-color-black);--cf-button-color:var(--cf-color-white);--cf-text-color:var(--cf-color-black)}*{box-sizing:border-box}";
3312
+ var css_248z$8 = ":root{--cf-color-white:#fff;--cf-color-black:#000;--cf-color-gray100:#f7f9fa;--cf-color-gray400:#aec1cc;--cf-color-gray400-rgb:174,193,204;--cf-spacing-0:0rem;--cf-spacing-1:0.125rem;--cf-spacing-2:0.25rem;--cf-spacing-3:0.375rem;--cf-spacing-4:0.5rem;--cf-spacing-5:0.625rem;--cf-spacing-6:0.75rem;--cf-spacing-7:0.875rem;--cf-spacing-8:1rem;--cf-spacing-9:1.25rem;--cf-spacing-10:1.5rem;--cf-spacing-11:1.75rem;--cf-spacing-12:2rem;--cf-spacing-13:2.25rem;--cf-text-xs:0.75rem;--cf-text-sm:0.875rem;--cf-text-base:1rem;--cf-text-lg:1.125rem;--cf-text-xl:1.25rem;--cf-text-2xl:1.5rem;--cf-text-3xl:2rem;--cf-text-4xl:2.75rem;--cf-font-light:300;--cf-font-normal:400;--cf-font-medium:500;--cf-font-semibold:600;--cf-font-bold:700;--cf-font-extra-bold:800;--cf-font-black:900;--cf-border-radius-none:0px;--cf-border-radius-sm:0.125rem;--cf-border-radius:0.25rem;--cf-border-radius-md:0.375rem;--cf-border-radius-lg:0.5rem;--cf-border-radius-xl:0.75rem;--cf-border-radius-2xl:1rem;--cf-border-radius-3xl:1.5rem;--cf-border-radius-full:9999px;--cf-max-width-full:100%;--cf-button-bg:var(--cf-color-black);--cf-button-color:var(--cf-color-white);--cf-text-color:var(--cf-color-black)}*{box-sizing:border-box}";
3280
3313
  styleInject(css_248z$8);
3281
3314
 
3282
3315
  /** @deprecated will be removed when dropping backward compatibility for old DND */
@@ -3707,8 +3740,20 @@ z.object({
3707
3740
  componentSettings: localeWrapper(ComponentSettingsSchema),
3708
3741
  });
3709
3742
 
3710
- z.object({
3743
+ z
3744
+ .object({
3711
3745
  id: DefinitionPropertyKeySchema,
3746
+ name: z.string(),
3747
+ category: z.string().optional(),
3748
+ thumbnailUrl: z.string().optional(),
3749
+ thumbnailId: z.string().optional(),
3750
+ hyperlinkPattern: z.string().optional(),
3751
+ children: z.boolean().optional(),
3752
+ slots: z
3753
+ .record(DefinitionPropertyKeySchema, z.object({ displayName: z.string().optional() }))
3754
+ .optional(),
3755
+ builtInStyles: z.array(z.string()).optional(),
3756
+ tooltip: z.object({ imageUrl: z.string().optional(), description: z.string() }).optional(),
3712
3757
  variables: z.record(DefinitionPropertyKeySchema, ComponentVariableSchema.extend({
3713
3758
  defaultValue: PrimitiveValueSchema.optional(),
3714
3759
  }).superRefine((val, ctx) => {
@@ -3814,6 +3859,27 @@ z.object({
3814
3859
  break;
3815
3860
  }
3816
3861
  })),
3862
+ })
3863
+ .superRefine((val, ctx) => {
3864
+ if (val.children === true && (!!val.variables.children || !!val.slots?.children)) {
3865
+ ctx.addIssue({
3866
+ code: z.ZodIssueCode.custom,
3867
+ message: `Cannot activate 'children: true' and name a variable or slot 'children' at the same time`,
3868
+ fatal: false,
3869
+ });
3870
+ }
3871
+ // Ensure that slots and variables don't use the same names
3872
+ if (val.variables && val.slots) {
3873
+ Object.keys(val.variables).forEach((name) => {
3874
+ if (val.slots[name]) {
3875
+ ctx.addIssue({
3876
+ code: z.ZodIssueCode.custom,
3877
+ message: `Variable and slot cannot have the same name: ${name}`,
3878
+ fatal: false,
3879
+ });
3880
+ }
3881
+ });
3882
+ }
3817
3883
  });
3818
3884
 
3819
3885
  var CodeNames;