@contentful/experiences-visual-editor-react 3.7.2-dev-20250924T1519-77d453c.0 → 3.8.0-beta.1

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/renderApp.js CHANGED
@@ -42101,7 +42101,7 @@ const BREAKPOINT_QUERY_REGEX$1 = /^\*$|^[<>][0-9]+px$/;
42101
42101
  const BreakpointSchema$1 = z
42102
42102
  .object({
42103
42103
  id: propertyKeySchema$1,
42104
- // Can be replace with z.templateLiteral when upgrading to zod v4
42104
+ // Can be replaced with z.templateLiteral when upgrading to zod v4
42105
42105
  query: z.string().refine((s) => BREAKPOINT_QUERY_REGEX$1.test(s)),
42106
42106
  previewSize: z.string().optional(),
42107
42107
  displayName: z.string(),
@@ -42140,6 +42140,16 @@ const ComponentVariableSchema$1 = z.object({
42140
42140
  });
42141
42141
  const ComponentTreeNodeSchema$1 = BaseComponentTreeNodeSchema$1.extend({
42142
42142
  children: z.lazy(() => ComponentTreeNodeSchema$1.array()),
42143
+ }).superRefine(({ id, prebindingId, parameters }, ctx) => {
42144
+ // We don't fail if parameters are present but prebindingId is not because
42145
+ // older experiences (updated before 21-09-2025) always included parameters
42146
+ // and they will start failing if we do.
42147
+ if (prebindingId && !parameters) {
42148
+ ctx.addIssue({
42149
+ code: z.ZodIssueCode.custom,
42150
+ message: `Found "prebindingId" but no "parameters" for node with id: "${id}"`,
42151
+ });
42152
+ }
42143
42153
  });
42144
42154
  const ComponentTreeSchema$1 = z
42145
42155
  .object({
@@ -42242,8 +42252,7 @@ const ParameterDefinitionSchema$1 = z.object({
42242
42252
  contentTypes: z.array(z.string()).min(1),
42243
42253
  passToNodes: z
42244
42254
  .array(PassToNodeSchema$1)
42245
- .max(1, 'At most one "passToNodes" element is allowed per parameter definition.')
42246
- .optional(), // we might change this to be empty array for native parameter definitions, that's why we don't use .length(1)
42255
+ .max(1, 'At most one "passToNodes" element is allowed per parameter definition.'),
42247
42256
  });
42248
42257
  const ParameterDefinitionsSchema$1 = z.record(propertyKeySchema$1, ParameterDefinitionSchema$1);
42249
42258
  const VariableMappingsSchema$1 = z.record(propertyKeySchema$1, VariableMappingSchema$1);
@@ -42345,7 +42354,7 @@ const validatePassToNodes$1 = (rootChildren, componentSettings, ctx) => {
42345
42354
  return;
42346
42355
  }
42347
42356
  const { parameterDefinitions } = componentSettings.prebindingDefinitions[0];
42348
- let nodeIds = new Set();
42357
+ const nodeIds = new Set();
42349
42358
  for (const paramDef of Object.values(parameterDefinitions || {})) {
42350
42359
  paramDef.passToNodes?.forEach((n) => nodeIds.add(n.nodeId));
42351
42360
  }
@@ -43123,7 +43132,7 @@ const transformTextAlign = (value) => {
43123
43132
  return undefined;
43124
43133
  const sdkOptions = getSdkOptions();
43125
43134
  // New behavior: translate left/right to start/end
43126
- // Customer can opt-out by activating this global option toggle
43135
+ // Customer can opt out by activating this global option toggle
43127
43136
  if (!sdkOptions.__disableTextAlignmentTransform) {
43128
43137
  if (value === 'left')
43129
43138
  return 'start';
@@ -49911,7 +49920,7 @@ const BREAKPOINT_QUERY_REGEX = /^\*$|^[<>][0-9]+px$/;
49911
49920
  const BreakpointSchema = z
49912
49921
  .object({
49913
49922
  id: propertyKeySchema,
49914
- // Can be replace with z.templateLiteral when upgrading to zod v4
49923
+ // Can be replaced with z.templateLiteral when upgrading to zod v4
49915
49924
  query: z.string().refine((s) => BREAKPOINT_QUERY_REGEX.test(s)),
49916
49925
  previewSize: z.string().optional(),
49917
49926
  displayName: z.string(),
@@ -49950,6 +49959,16 @@ const ComponentVariableSchema = z.object({
49950
49959
  });
49951
49960
  const ComponentTreeNodeSchema = BaseComponentTreeNodeSchema.extend({
49952
49961
  children: z.lazy(() => ComponentTreeNodeSchema.array()),
49962
+ }).superRefine(({ id, prebindingId, parameters }, ctx) => {
49963
+ // We don't fail if parameters are present but prebindingId is not because
49964
+ // older experiences (updated before 21-09-2025) always included parameters
49965
+ // and they will start failing if we do.
49966
+ if (prebindingId && !parameters) {
49967
+ ctx.addIssue({
49968
+ code: z.ZodIssueCode.custom,
49969
+ message: `Found "prebindingId" but no "parameters" for node with id: "${id}"`,
49970
+ });
49971
+ }
49953
49972
  });
49954
49973
  const ComponentTreeSchema = z
49955
49974
  .object({
@@ -50052,8 +50071,7 @@ const ParameterDefinitionSchema = z.object({
50052
50071
  contentTypes: z.array(z.string()).min(1),
50053
50072
  passToNodes: z
50054
50073
  .array(PassToNodeSchema)
50055
- .max(1, 'At most one "passToNodes" element is allowed per parameter definition.')
50056
- .optional(), // we might change this to be empty array for native parameter definitions, that's why we don't use .length(1)
50074
+ .max(1, 'At most one "passToNodes" element is allowed per parameter definition.'),
50057
50075
  });
50058
50076
  const ParameterDefinitionsSchema = z.record(propertyKeySchema, ParameterDefinitionSchema);
50059
50077
  const VariableMappingsSchema = z.record(propertyKeySchema, VariableMappingSchema);
@@ -50155,7 +50173,7 @@ const validatePassToNodes = (rootChildren, componentSettings, ctx) => {
50155
50173
  return;
50156
50174
  }
50157
50175
  const { parameterDefinitions } = componentSettings.prebindingDefinitions[0];
50158
- let nodeIds = new Set();
50176
+ const nodeIds = new Set();
50159
50177
  for (const paramDef of Object.values(parameterDefinitions || {})) {
50160
50178
  paramDef.passToNodes?.forEach((n) => nodeIds.add(n.nodeId));
50161
50179
  }