@contentful/experiences-visual-editor-react 2.0.0-prerelease-20250703T1150-c529c88.0 → 2.0.0-prerelease-20250704T1125-6c39a4b.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/renderApp.js CHANGED
@@ -37,8 +37,8 @@ function styleInject(css, ref) {
37
37
  }
38
38
  }
39
39
 
40
- var css_248z$4 = "html,\nbody {\n margin: 0;\n padding: 0;\n}\n\n/*\n * All of these variables are tokens from Forma-36 and should not be adjusted as these\n * are global variables that may affect multiple places.\n * As our customers may use other design libraries, we try to avoid overlapping global\n * variables by always using the prefix `--exp-builder-` inside this SDK.\n */\n\n:root {\n /* Color tokens from Forma 36: https://f36.contentful.com/tokens/color-system */\n --exp-builder-blue100: #e8f5ff;\n --exp-builder-blue200: #ceecff;\n --exp-builder-blue300: #98cbff;\n --exp-builder-blue400: #40a0ff;\n --exp-builder-blue500: #036fe3;\n --exp-builder-blue600: #0059c8;\n --exp-builder-blue700: #0041ab;\n --exp-builder-blue800: #003298;\n --exp-builder-blue900: #002a8e;\n --exp-builder-gray100: #f7f9fa;\n --exp-builder-gray200: #e7ebee;\n --exp-builder-gray300: #cfd9e0;\n --exp-builder-gray400: #aec1cc;\n --exp-builder-gray500: #67728a;\n --exp-builder-gray600: #5a657c;\n --exp-builder-gray700: #414d63;\n --exp-builder-gray800: #1b273a;\n --exp-builder-gray900: #111b2b;\n --exp-builder-purple600: #6c3ecf;\n --exp-builder-red200: #ffe0e0;\n --exp-builder-red800: #7f0010;\n --exp-builder-color-white: #ffffff;\n --exp-builder-glow-primary: 0px 0px 0px 3px #e8f5ff;\n\n /* RGB colors for applying opacity */\n --exp-builder-blue100-rgb: 232, 245, 255;\n --exp-builder-blue300-rgb: 152, 203, 255;\n\n /* Spacing tokens from Forma 36: https://f36.contentful.com/tokens/spacing */\n --exp-builder-spacing-s: 0.75rem;\n --exp-builder-spacing-2xs: 0.25rem;\n\n /* Typography tokens from Forma 36: https://f36.contentful.com/tokens/typography */\n --exp-builder-font-size-l: 1rem;\n --exp-builder-font-size-m: 0.875rem;\n --exp-builder-font-stack-primary: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial,\n sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;\n --exp-builder-line-height-condensed: 1.25;\n}\n";
41
- styleInject(css_248z$4);
40
+ var css_248z$b = "html,\nbody {\n margin: 0;\n padding: 0;\n}\n\n/*\n * All of these variables are tokens from Forma-36 and should not be adjusted as these\n * are global variables that may affect multiple places.\n * As our customers may use other design libraries, we try to avoid overlapping global\n * variables by always using the prefix `--exp-builder-` inside this SDK.\n */\n\n:root {\n /* Color tokens from Forma 36: https://f36.contentful.com/tokens/color-system */\n --exp-builder-blue100: #e8f5ff;\n --exp-builder-blue200: #ceecff;\n --exp-builder-blue300: #98cbff;\n --exp-builder-blue400: #40a0ff;\n --exp-builder-blue500: #036fe3;\n --exp-builder-blue600: #0059c8;\n --exp-builder-blue700: #0041ab;\n --exp-builder-blue800: #003298;\n --exp-builder-blue900: #002a8e;\n --exp-builder-gray100: #f7f9fa;\n --exp-builder-gray200: #e7ebee;\n --exp-builder-gray300: #cfd9e0;\n --exp-builder-gray400: #aec1cc;\n --exp-builder-gray500: #67728a;\n --exp-builder-gray600: #5a657c;\n --exp-builder-gray700: #414d63;\n --exp-builder-gray800: #1b273a;\n --exp-builder-gray900: #111b2b;\n --exp-builder-purple600: #6c3ecf;\n --exp-builder-red200: #ffe0e0;\n --exp-builder-red800: #7f0010;\n --exp-builder-color-white: #ffffff;\n --exp-builder-glow-primary: 0px 0px 0px 3px #e8f5ff;\n\n /* RGB colors for applying opacity */\n --exp-builder-blue100-rgb: 232, 245, 255;\n --exp-builder-blue300-rgb: 152, 203, 255;\n\n /* Spacing tokens from Forma 36: https://f36.contentful.com/tokens/spacing */\n --exp-builder-spacing-s: 0.75rem;\n --exp-builder-spacing-2xs: 0.25rem;\n\n /* Typography tokens from Forma 36: https://f36.contentful.com/tokens/typography */\n --exp-builder-font-size-l: 1rem;\n --exp-builder-font-size-m: 0.875rem;\n --exp-builder-font-stack-primary: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial,\n sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;\n --exp-builder-line-height-condensed: 1.25;\n}\n";
41
+ styleInject(css_248z$b);
42
42
 
43
43
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
44
44
 
@@ -43964,13 +43964,7 @@ const ParameterDefinitionSchema$1 = z.object({
43964
43964
  }),
43965
43965
  })
43966
43966
  .optional(),
43967
- contentTypes: z.record(z.string(), z.object({
43968
- sys: z.object({
43969
- type: z.literal('Link'),
43970
- id: z.string(),
43971
- linkType: z.enum(['ContentType']),
43972
- }),
43973
- })),
43967
+ contentTypes: z.array(z.string()),
43974
43968
  passToNodes: z.array(PassToNodeSchema$1).optional(),
43975
43969
  });
43976
43970
  const ParameterDefinitionsSchema$1 = z.record(propertyKeySchema$1, ParameterDefinitionSchema$1);
@@ -43990,7 +43984,7 @@ const ComponentSettingsSchema$1 = z
43990
43984
  variableDefinitions: ComponentVariablesSchema$1,
43991
43985
  thumbnailId: z.enum(THUMBNAIL_IDS$1).optional(),
43992
43986
  category: z.string().max(50, 'Category must contain at most 50 characters').optional(),
43993
- prebindingDefinitions: z.array(PrebindingDefinitionSchema$1).max(1).optional(),
43987
+ prebindingDefinitions: z.array(PrebindingDefinitionSchema$1).length(1).optional(),
43994
43988
  })
43995
43989
  .strict();
43996
43990
  z.object({
@@ -44235,7 +44229,10 @@ propertyName, resolveDesignTokens = true) => {
44235
44229
  };
44236
44230
  /** Overwrites the default value breakpoint by breakpoint. If a breakpoint
44237
44231
  * is not overwritten, it will fall back to the default. */
44238
- const mergeDesignValuesByBreakpoint = (defaultValue, overwriteValue) => {
44232
+ function mergeDesignValuesByBreakpoint(defaultValue, overwriteValue) {
44233
+ if (!defaultValue || !overwriteValue) {
44234
+ return defaultValue ?? overwriteValue;
44235
+ }
44239
44236
  const mergedValuesByBreakpoint = { ...defaultValue.valuesByBreakpoint };
44240
44237
  for (const [breakpointId, value] of Object.entries(overwriteValue.valuesByBreakpoint)) {
44241
44238
  if (!isValidBreakpointValue(value)) {
@@ -44247,7 +44244,7 @@ const mergeDesignValuesByBreakpoint = (defaultValue, overwriteValue) => {
44247
44244
  type: 'DesignValue',
44248
44245
  valuesByBreakpoint: mergedValuesByBreakpoint,
44249
44246
  };
44250
- };
44247
+ }
44251
44248
 
44252
44249
  const CF_DEBUG_KEY$1 = 'cf_debug';
44253
44250
  /**
@@ -56974,9 +56971,9 @@ const cloneDeepAsPOJO = (obj) => {
56974
56971
  return JSON.parse(JSON.stringify(obj));
56975
56972
  };
56976
56973
 
56977
- var css_248z$3 = ".render-module_hitbox__l4ysJ {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 10px;\n z-index: 1000000;\n}\n\n.render-module_hitboxLower__tgsA1 {\n position: absolute;\n bottom: -20px;\n left: 0;\n width: 100%;\n height: 20px;\n z-index: 1000000;\n}\n\n.render-module_canvasBottomSpacer__JuxVh {\n position: absolute;\n width: 100%;\n height: 50px;\n}\n\n.render-module_container__-C3d7 {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n\nbody {\n margin: 0;\n}\n\nhtml {\n -ms-overflow-style: none; /* Internet Explorer 10+ */\n scrollbar-width: none; /* Firefox */\n}\n\nhtml::-webkit-scrollbar {\n display: none;\n}\n";
56974
+ var css_248z$a = ".render-module_hitbox__l4ysJ {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 10px;\n z-index: 1000000;\n}\n\n.render-module_hitboxLower__tgsA1 {\n position: absolute;\n bottom: -20px;\n left: 0;\n width: 100%;\n height: 20px;\n z-index: 1000000;\n}\n\n.render-module_canvasBottomSpacer__JuxVh {\n position: absolute;\n width: 100%;\n height: 50px;\n}\n\n.render-module_container__-C3d7 {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n\nbody {\n margin: 0;\n}\n\nhtml {\n -ms-overflow-style: none; /* Internet Explorer 10+ */\n scrollbar-width: none; /* Firefox */\n}\n\nhtml::-webkit-scrollbar {\n display: none;\n}\n";
56978
56975
  var styles$3 = {"hitbox":"render-module_hitbox__l4ysJ","hitboxLower":"render-module_hitboxLower__tgsA1","canvasBottomSpacer":"render-module_canvasBottomSpacer__JuxVh","container":"render-module_container__-C3d7"};
56979
- styleInject(css_248z$3);
56976
+ styleInject(css_248z$a);
56980
56977
 
56981
56978
  // TODO: In order to support integrations without React, we should extract this heavy logic into simple
56982
56979
  // functions that we can reuse in other frameworks.
@@ -58369,6 +58366,9 @@ function getSchemaWithNodeType(nodeType) {
58369
58366
 
58370
58367
  } (dist));
58371
58368
 
58369
+ 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}";
58370
+ styleInject(css_248z$8);
58371
+
58372
58372
  /**
58373
58373
  * These modes are ONLY intended to be internally used within the context of
58374
58374
  * editing an experience inside of Contentful Studio. i.e. these modes
@@ -58386,6 +58386,21 @@ var PostMessageMethods$1;
58386
58386
  PostMessageMethods["REQUESTED_ENTITIES"] = "REQUESTED_ENTITIES";
58387
58387
  })(PostMessageMethods$1 || (PostMessageMethods$1 = {}));
58388
58388
 
58389
+ var css_248z$7 = ".cf-button:empty:before{content:\"\";display:inline-block}";
58390
+ styleInject(css_248z$7);
58391
+
58392
+ var css_248z$6 = ".cf-heading{white-space:pre-line}";
58393
+ styleInject(css_248z$6);
58394
+
58395
+ var css_248z$5 = ".cf-richtext{white-space:pre-line}.cf-richtext>:first-child{margin-top:0}.cf-richtext>:last-child{margin-bottom:0}";
58396
+ styleInject(css_248z$5);
58397
+
58398
+ var css_248z$4 = ".cf-text{white-space:pre-line}.cf-text-link .cf-text{margin:0}";
58399
+ styleInject(css_248z$4);
58400
+
58401
+ var css_248z$3 = "div.cf-placeholder-wrapper{position:relative}img.cf-placeholder-image{background-color:var(--cf-color-gray100);height:100%;outline:2px solid rgba(var(--cf-color-gray400-rgb),.5);outline-offset:-2px;width:100%}svg.cf-placeholder-icon{height:var(--cf-text-3xl);left:50%;max-height:100%;max-width:100%;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--cf-text-3xl)}svg.cf-placeholder-icon path{fill:var(--cf-color-gray400)}";
58402
+ styleInject(css_248z$3);
58403
+
58389
58404
  /**
58390
58405
  * These modes are ONLY intended to be internally used within the context of
58391
58406
  * editing an experience inside of Contentful Studio. i.e. these modes
@@ -58713,13 +58728,7 @@ const ParameterDefinitionSchema = z.object({
58713
58728
  }),
58714
58729
  })
58715
58730
  .optional(),
58716
- contentTypes: z.record(z.string(), z.object({
58717
- sys: z.object({
58718
- type: z.literal('Link'),
58719
- id: z.string(),
58720
- linkType: z.enum(['ContentType']),
58721
- }),
58722
- })),
58731
+ contentTypes: z.array(z.string()),
58723
58732
  passToNodes: z.array(PassToNodeSchema).optional(),
58724
58733
  });
58725
58734
  const ParameterDefinitionsSchema = z.record(propertyKeySchema, ParameterDefinitionSchema);
@@ -58739,7 +58748,7 @@ const ComponentSettingsSchema = z
58739
58748
  variableDefinitions: ComponentVariablesSchema,
58740
58749
  thumbnailId: z.enum(THUMBNAIL_IDS).optional(),
58741
58750
  category: z.string().max(50, 'Category must contain at most 50 characters').optional(),
58742
- prebindingDefinitions: z.array(PrebindingDefinitionSchema).max(1).optional(),
58751
+ prebindingDefinitions: z.array(PrebindingDefinitionSchema).length(1).optional(),
58743
58752
  })
58744
58753
  .strict();
58745
58754
  z.object({
@@ -59364,6 +59373,9 @@ var VisualEditorMode;
59364
59373
  VisualEditorMode["InjectScript"] = "injectScript";
59365
59374
  })(VisualEditorMode || (VisualEditorMode = {}));
59366
59375
 
59376
+ var css_248z$2$1 = ".contentful-container{display:flex;pointer-events:all;position:relative}.contentful-container::-webkit-scrollbar{display:none}.cf-single-column-wrapper{position:relative}.cf-container-wrapper{position:relative;width:100%}.contentful-container:after{align-items:center;bottom:0;color:var(--exp-builder-gray400);content:\"\";display:block;display:flex;font-family:var(--exp-builder-font-stack-primary);font-size:12px;justify-content:center;left:0;overflow-x:clip;pointer-events:none;position:absolute;right:0;top:0;z-index:1}.contentful-section-label:after{content:\"Section\"}.contentful-container-label:after{content:\"Container\"}.contentful-container-link,.contentful-container-link:active,.contentful-container-link:focus-visible,.contentful-container-link:hover,.contentful-container-link:read-write,.contentful-container-link:visited{color:inherit;outline:unset;text-decoration:unset}";
59377
+ styleInject(css_248z$2$1);
59378
+
59367
59379
  const Flex = reactExports.forwardRef(({ id, children, onMouseEnter, onMouseUp, onMouseLeave, onMouseDown, onClick, flex, flexBasis, flexShrink, flexDirection, gap, justifyContent, justifyItems, justifySelf, alignItems, alignSelf, alignContent, order, flexWrap, flexGrow, className, cssStyles, ...props }, ref) => {
59368
59380
  return (React$1.createElement("div", { id: id, ref: ref, style: {
59369
59381
  display: 'flex',
@@ -59386,6 +59398,12 @@ const Flex = reactExports.forwardRef(({ id, children, onMouseEnter, onMouseUp, o
59386
59398
  });
59387
59399
  Flex.displayName = 'Flex';
59388
59400
 
59401
+ var css_248z$1$1 = ".cf-divider{display:contents;height:100%;position:relative;width:100%}.cf-divider hr{border:none}[data-ctfl-zone-id=root] .cf-divider:before{bottom:-5px;content:\"\";left:-5px;pointer-events:all;position:absolute;right:-5px;top:-5px}";
59402
+ styleInject(css_248z$1$1);
59403
+
59404
+ var css_248z$9 = ".cf-columns{display:flex;flex-direction:column;gap:24px;grid-template-columns:repeat(12,1fr);min-height:0;min-width:0}@media (min-width:768px){.cf-columns{display:grid}}.cf-single-column-wrapper{display:flex;position:relative}.cf-single-column{pointer-events:all}.cf-single-column-wrapper:after{align-items:center;bottom:0;color:var(--exp-builder-gray400);content:\"\";display:block;display:flex;font-family:var(--exp-builder-font-stack-primary);font-size:12px;justify-content:center;left:0;overflow-x:clip;pointer-events:none;position:absolute;right:0;top:0;z-index:1}.cf-single-column-label:after{content:\"Column\"}";
59405
+ styleInject(css_248z$9);
59406
+
59389
59407
  const ColumnWrapper = reactExports.forwardRef((props, ref) => {
59390
59408
  return (React$1.createElement("div", { ref: ref, ...props, style: {
59391
59409
  ...(props.style || {}),
@@ -60235,7 +60253,7 @@ const maybeMergePatternDefaultDesignValues = ({ variableName, variableMapping, n
60235
60253
  parentPatternNode = findNodeById(parentPatternNode.data.pattern?.nodeId);
60236
60254
  }
60237
60255
  const mergedDesignValue = mergeDesignValuesByBreakpoint(exposedDefaultValue, variableMapping);
60238
- return mergedDesignValue.valuesByBreakpoint;
60256
+ return mergedDesignValue?.valuesByBreakpoint;
60239
60257
  }
60240
60258
  return variableMapping.valuesByBreakpoint;
60241
60259
  };