@contentful/experiences-visual-editor-react 1.42.1-beta.0 → 1.42.2-beta.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
@@ -815,8 +815,13 @@ const VariableMappingSchema$1 = z.object({
815
815
  type: z.literal('ContentTypeMapping'),
816
816
  pathsByContentType: z.record(z.string(), z.object({ path: z.string() })),
817
817
  });
818
- // TODO: finalize schema structure before release
819
- // https://contentful.atlassian.net/browse/LUMOS-523
818
+ const PassToNodeSchema$1 = z
819
+ .object({
820
+ nodeId: propertyKeySchema$1,
821
+ parameterId: propertyKeySchema$1,
822
+ prebindingId: propertyKeySchema$1,
823
+ })
824
+ .strict();
820
825
  const ParameterDefinitionSchema$1 = z.object({
821
826
  defaultSource: z
822
827
  .strictObject({
@@ -838,18 +843,28 @@ const ParameterDefinitionSchema$1 = z.object({
838
843
  linkType: z.enum(['ContentType']),
839
844
  }),
840
845
  })),
846
+ passToNodes: z.array(PassToNodeSchema$1).optional(),
841
847
  });
842
848
  const ParameterDefinitionsSchema$1 = z.record(propertyKeySchema$1, ParameterDefinitionSchema$1);
843
849
  const VariableMappingsSchema$1 = z.record(propertyKeySchema$1, VariableMappingSchema$1);
844
850
  const ComponentVariablesSchema$1 = z.record(z.string().regex(/^[a-zA-Z0-9-_]{1,54}$/), // Here the key is <variableName>_<nanoidId> so we need to allow for a longer length
845
851
  ComponentVariableSchema$1);
846
- const ComponentSettingsSchema$1 = z.object({
852
+ const PrebindingDefinitionSchema$1 = z
853
+ .object({
854
+ id: propertyKeySchema$1,
855
+ parameterDefinitions: ParameterDefinitionsSchema$1,
856
+ variableMappings: VariableMappingsSchema$1.optional(),
857
+ allowedVariableOverrides: z.array(z.string()).optional(),
858
+ })
859
+ .strict();
860
+ const ComponentSettingsSchema$1 = z
861
+ .object({
847
862
  variableDefinitions: ComponentVariablesSchema$1,
848
863
  thumbnailId: z.enum(THUMBNAIL_IDS$1).optional(),
849
864
  category: z.string().max(50, 'Category must contain at most 50 characters').optional(),
850
- variableMappings: VariableMappingsSchema$1.optional(),
851
- parameterDefinitions: ParameterDefinitionsSchema$1.optional(),
852
- });
865
+ prebindingDefinitions: z.array(PrebindingDefinitionSchema$1).max(1).optional(),
866
+ })
867
+ .strict();
853
868
  z.object({
854
869
  componentTree: localeWrapper$1(ComponentTreeSchema$1),
855
870
  dataSource: localeWrapper$1(DataSourceSchema$1),
@@ -3658,8 +3673,13 @@ const VariableMappingSchema = z.object({
3658
3673
  type: z.literal('ContentTypeMapping'),
3659
3674
  pathsByContentType: z.record(z.string(), z.object({ path: z.string() })),
3660
3675
  });
3661
- // TODO: finalize schema structure before release
3662
- // https://contentful.atlassian.net/browse/LUMOS-523
3676
+ const PassToNodeSchema = z
3677
+ .object({
3678
+ nodeId: propertyKeySchema,
3679
+ parameterId: propertyKeySchema,
3680
+ prebindingId: propertyKeySchema,
3681
+ })
3682
+ .strict();
3663
3683
  const ParameterDefinitionSchema = z.object({
3664
3684
  defaultSource: z
3665
3685
  .strictObject({
@@ -3681,18 +3701,28 @@ const ParameterDefinitionSchema = z.object({
3681
3701
  linkType: z.enum(['ContentType']),
3682
3702
  }),
3683
3703
  })),
3704
+ passToNodes: z.array(PassToNodeSchema).optional(),
3684
3705
  });
3685
3706
  const ParameterDefinitionsSchema = z.record(propertyKeySchema, ParameterDefinitionSchema);
3686
3707
  const VariableMappingsSchema = z.record(propertyKeySchema, VariableMappingSchema);
3687
3708
  const ComponentVariablesSchema = z.record(z.string().regex(/^[a-zA-Z0-9-_]{1,54}$/), // Here the key is <variableName>_<nanoidId> so we need to allow for a longer length
3688
3709
  ComponentVariableSchema);
3689
- const ComponentSettingsSchema = z.object({
3710
+ const PrebindingDefinitionSchema = z
3711
+ .object({
3712
+ id: propertyKeySchema,
3713
+ parameterDefinitions: ParameterDefinitionsSchema,
3714
+ variableMappings: VariableMappingsSchema.optional(),
3715
+ allowedVariableOverrides: z.array(z.string()).optional(),
3716
+ })
3717
+ .strict();
3718
+ const ComponentSettingsSchema = z
3719
+ .object({
3690
3720
  variableDefinitions: ComponentVariablesSchema,
3691
3721
  thumbnailId: z.enum(THUMBNAIL_IDS).optional(),
3692
3722
  category: z.string().max(50, 'Category must contain at most 50 characters').optional(),
3693
- variableMappings: VariableMappingsSchema.optional(),
3694
- parameterDefinitions: ParameterDefinitionsSchema.optional(),
3695
- });
3723
+ prebindingDefinitions: z.array(PrebindingDefinitionSchema).max(1).optional(),
3724
+ })
3725
+ .strict();
3696
3726
  z.object({
3697
3727
  componentTree: localeWrapper(ComponentTreeSchema),
3698
3728
  dataSource: localeWrapper(DataSourceSchema),