@contentful/experiences-visual-editor-react 3.7.0-dev-20250917T1515-4c340b9.0 → 3.7.0-dev-20250918T1653-d735f6f.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 +8 -5
- package/dist/index.js.map +1 -1
- package/dist/renderApp.js +9243 -8690
- package/dist/renderApp.js.map +1 -1
- package/package.json +4 -5
package/dist/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import styleInject from 'style-inject';
|
|
2
2
|
import React, { useState, useEffect, useCallback, forwardRef, useMemo, useLayoutEffect, useRef } from 'react';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import
|
|
4
|
+
import cloneDeep from 'lodash.clonedeep';
|
|
5
5
|
import md5 from 'md5';
|
|
6
6
|
import { BLOCKS } from '@contentful/rich-text-types';
|
|
7
7
|
import { create, useStore } from 'zustand';
|
|
8
8
|
import { produce } from 'immer';
|
|
9
|
+
import { isEqual, get as get$2, debounce } from 'lodash-es';
|
|
9
10
|
import '@contentful/rich-text-react-renderer';
|
|
10
11
|
|
|
11
12
|
var css_248z$a = "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";
|
|
@@ -754,7 +755,7 @@ const BreakpointSchema$1 = z
|
|
|
754
755
|
id: propertyKeySchema$1,
|
|
755
756
|
// Can be replace with z.templateLiteral when upgrading to zod v4
|
|
756
757
|
query: z.string().refine((s) => BREAKPOINT_QUERY_REGEX$1.test(s)),
|
|
757
|
-
previewSize: z.string(),
|
|
758
|
+
previewSize: z.string().optional(),
|
|
758
759
|
displayName: z.string(),
|
|
759
760
|
displayIcon: z.enum(['desktop', 'tablet', 'mobile']).optional(),
|
|
760
761
|
})
|
|
@@ -1683,7 +1684,9 @@ const stylesToRemove = CF_STYLE_ATTRIBUTES.filter((style) => !stylesToKeep.inclu
|
|
|
1683
1684
|
// cfWrapColumns & cfWrapColumnsCount are no real style attributes as they are handled on the editor side
|
|
1684
1685
|
const propsToRemove = ['cfSsrClassName', 'cfWrapColumns', 'cfWrapColumnsCount'];
|
|
1685
1686
|
const sanitizeNodeProps = (nodeProps) => {
|
|
1686
|
-
|
|
1687
|
+
const keysToRemove = [...stylesToRemove, ...propsToRemove];
|
|
1688
|
+
const sanitizedProps = Object.fromEntries(Object.entries(nodeProps).filter(([key]) => !keysToRemove.includes(key)));
|
|
1689
|
+
return sanitizedProps;
|
|
1687
1690
|
};
|
|
1688
1691
|
|
|
1689
1692
|
/** Turn the visibility value into a style object that can be used for inline styles in React */
|
|
@@ -2162,7 +2165,7 @@ function getArrayValue(entryOrAsset, path, entityStore) {
|
|
|
2162
2165
|
}
|
|
2163
2166
|
const fieldName = path.split('/').slice(2, -1);
|
|
2164
2167
|
const arrayValue = get$1(entryOrAsset, fieldName);
|
|
2165
|
-
if (!isArray(arrayValue)) {
|
|
2168
|
+
if (!Array.isArray(arrayValue)) {
|
|
2166
2169
|
debug$1.warn(`[experiences-core::getArrayValue] A field '${fieldName}' of an entity was bound to an Array variable. Expected value of that field to be an array, but got: ${JSON.stringify(arrayValue)}`, { entity: entryOrAsset });
|
|
2167
2170
|
return;
|
|
2168
2171
|
}
|
|
@@ -3731,7 +3734,7 @@ const BreakpointSchema = z
|
|
|
3731
3734
|
id: propertyKeySchema,
|
|
3732
3735
|
// Can be replace with z.templateLiteral when upgrading to zod v4
|
|
3733
3736
|
query: z.string().refine((s) => BREAKPOINT_QUERY_REGEX.test(s)),
|
|
3734
|
-
previewSize: z.string(),
|
|
3737
|
+
previewSize: z.string().optional(),
|
|
3735
3738
|
displayName: z.string(),
|
|
3736
3739
|
displayIcon: z.enum(['desktop', 'tablet', 'mobile']).optional(),
|
|
3737
3740
|
})
|