@contentful/experiences-visual-editor-react 3.7.0 → 3.7.1-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
@@ -795,6 +795,19 @@ const ComponentVariableSchema$1 = z.object({
795
795
  });
796
796
  const ComponentTreeNodeSchema$1 = BaseComponentTreeNodeSchema$1.extend({
797
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
+ }
798
811
  });
799
812
  const ComponentTreeSchema$1 = z
800
813
  .object({
@@ -4033,6 +4046,19 @@ const ComponentVariableSchema = z.object({
4033
4046
  });
4034
4047
  const ComponentTreeNodeSchema = BaseComponentTreeNodeSchema.extend({
4035
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
+ }
4036
4062
  });
4037
4063
  const ComponentTreeSchema = z
4038
4064
  .object({