@contentful/experiences-visual-editor-react 3.4.1-dev-20250901T1444-72c17a2.0 → 3.5.0-dev-20250902T0640-ab0b512.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 +14 -14
- package/dist/index.js.map +1 -1
- package/dist/renderApp.js +14 -14
- package/dist/renderApp.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -8,8 +8,8 @@ import { create, useStore } from 'zustand';
|
|
|
8
8
|
import { produce } from 'immer';
|
|
9
9
|
import '@contentful/rich-text-react-renderer';
|
|
10
10
|
|
|
11
|
-
var css_248z$
|
|
12
|
-
styleInject(css_248z$
|
|
11
|
+
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";
|
|
12
|
+
styleInject(css_248z$a);
|
|
13
13
|
|
|
14
14
|
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
15
15
|
const INCOMING_EVENTS$1 = {
|
|
@@ -763,6 +763,7 @@ const BreakpointSchema$1 = z
|
|
|
763
763
|
const BaseComponentTreeNodeSchema$1 = z.object({
|
|
764
764
|
id: ComponentTreeNodeIdSchema$1.optional(),
|
|
765
765
|
definitionId: DefinitionPropertyKeySchema$1,
|
|
766
|
+
prebindingId: z.string().optional(),
|
|
766
767
|
displayName: z.string().optional(),
|
|
767
768
|
slotId: z.string().optional(),
|
|
768
769
|
variables: z.record(propertyKeySchema$1, ComponentPropertyValueSchema$1),
|
|
@@ -3172,10 +3173,6 @@ const cloneDeepAsPOJO = (obj) => {
|
|
|
3172
3173
|
return JSON.parse(JSON.stringify(obj));
|
|
3173
3174
|
};
|
|
3174
3175
|
|
|
3175
|
-
var css_248z$a = ".RootRenderer-module_rootContainer__9UawM {\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";
|
|
3176
|
-
var styles$2 = {"rootContainer":"RootRenderer-module_rootContainer__9UawM"};
|
|
3177
|
-
styleInject(css_248z$a);
|
|
3178
|
-
|
|
3179
3176
|
// TODO: In order to support integrations without React, we should extract this heavy logic into simple
|
|
3180
3177
|
// functions that we can reuse in other frameworks.
|
|
3181
3178
|
/*
|
|
@@ -3581,6 +3578,7 @@ const BreakpointSchema = z
|
|
|
3581
3578
|
const BaseComponentTreeNodeSchema = z.object({
|
|
3582
3579
|
id: ComponentTreeNodeIdSchema.optional(),
|
|
3583
3580
|
definitionId: DefinitionPropertyKeySchema,
|
|
3581
|
+
prebindingId: z.string().optional(),
|
|
3584
3582
|
displayName: z.string().optional(),
|
|
3585
3583
|
slotId: z.string().optional(),
|
|
3586
3584
|
variables: z.record(propertyKeySchema, ComponentPropertyValueSchema),
|
|
@@ -4326,8 +4324,8 @@ var VisualEditorMode;
|
|
|
4326
4324
|
VisualEditorMode["InjectScript"] = "injectScript";
|
|
4327
4325
|
})(VisualEditorMode || (VisualEditorMode = {}));
|
|
4328
4326
|
|
|
4329
|
-
var css_248z$2 = ".contentful-container{display:flex;pointer-events:all;position:relative}.contentful-container::-webkit-scrollbar{display:none}.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}";
|
|
4330
|
-
styleInject(css_248z$2);
|
|
4327
|
+
var css_248z$2$1 = ".contentful-container{display:flex;pointer-events:all;position:relative}.contentful-container::-webkit-scrollbar{display:none}.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}";
|
|
4328
|
+
styleInject(css_248z$2$1);
|
|
4331
4329
|
|
|
4332
4330
|
const Flex = 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) => {
|
|
4333
4331
|
return (React.createElement("div", { id: id, ref: ref, style: {
|
|
@@ -4660,9 +4658,9 @@ const MissingComponentPlaceholder = ({ blockId }) => {
|
|
|
4660
4658
|
"'"));
|
|
4661
4659
|
};
|
|
4662
4660
|
|
|
4663
|
-
var css_248z$
|
|
4661
|
+
var css_248z$2 = ".EditorBlock-module_emptySlot__za-Bi {\n min-height: 80px;\n min-width: 80px;\n}\n";
|
|
4664
4662
|
var styles$1 = {"emptySlot":"EditorBlock-module_emptySlot__za-Bi"};
|
|
4665
|
-
styleInject(css_248z$
|
|
4663
|
+
styleInject(css_248z$2);
|
|
4666
4664
|
|
|
4667
4665
|
const useComponentRegistration = (node) => {
|
|
4668
4666
|
return useMemo(() => {
|
|
@@ -4987,9 +4985,9 @@ const RegistrationComponent = ({ node, resolveDesignValue, componentRegistration
|
|
|
4987
4985
|
return React.createElement(ImportedComponentErrorBoundary, { componentId: node.data.blockId }, React.createElement(componentRegistration.component, { ...componentProps, ...slotNodes }, children));
|
|
4988
4986
|
};
|
|
4989
4987
|
|
|
4990
|
-
var css_248z = ".EmptyCanvasMessage-module_empty-canvas-container__7K-0l {\n height: 200px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n flex-direction: row;\n transition: all 0.2s;\n color: var(--exp-builder-gray400);\n font-size: var(--exp-builder-font-size-l);\n font-family: var(--exp-builder-font-stack-primary);\n outline: 2px dashed var(--exp-builder-gray400);\n outline-offset: -2px;\n}\n\n.EmptyCanvasMessage-module_empty-canvas-icon__EztFr rect {\n fill: var(--exp-builder-gray400);\n}\n\n.EmptyCanvasMessage-module_empty-canvas-label__cbIrR {\n margin-left: var(--exp-builder-spacing-s);\n}\n";
|
|
4988
|
+
var css_248z$1 = ".EmptyCanvasMessage-module_empty-canvas-container__7K-0l {\n height: 200px;\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n flex-direction: row;\n transition: all 0.2s;\n color: var(--exp-builder-gray400);\n font-size: var(--exp-builder-font-size-l);\n font-family: var(--exp-builder-font-stack-primary);\n outline: 2px dashed var(--exp-builder-gray400);\n outline-offset: -2px;\n}\n\n.EmptyCanvasMessage-module_empty-canvas-icon__EztFr rect {\n fill: var(--exp-builder-gray400);\n}\n\n.EmptyCanvasMessage-module_empty-canvas-label__cbIrR {\n margin-left: var(--exp-builder-spacing-s);\n}\n";
|
|
4991
4989
|
var styles = {"empty-canvas-container":"EmptyCanvasMessage-module_empty-canvas-container__7K-0l","empty-canvas-icon":"EmptyCanvasMessage-module_empty-canvas-icon__EztFr","empty-canvas-label":"EmptyCanvasMessage-module_empty-canvas-label__cbIrR"};
|
|
4992
|
-
styleInject(css_248z);
|
|
4990
|
+
styleInject(css_248z$1);
|
|
4993
4991
|
|
|
4994
4992
|
const EmptyCanvasMessage = () => {
|
|
4995
4993
|
return (React.createElement("div", { className: styles['empty-canvas-container'], "data-type": "empty-container" },
|
|
@@ -5182,6 +5180,9 @@ function findAllImages() {
|
|
|
5182
5180
|
return Array.from(document.querySelectorAll('img'));
|
|
5183
5181
|
}
|
|
5184
5182
|
|
|
5183
|
+
var css_248z = "body {\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";
|
|
5184
|
+
styleInject(css_248z);
|
|
5185
|
+
|
|
5185
5186
|
const RootRenderer = ({ inMemoryEntitiesStore, canvasMode }) => {
|
|
5186
5187
|
useEditorSubscriber(inMemoryEntitiesStore);
|
|
5187
5188
|
const tree = useTreeStore((state) => state.tree);
|
|
@@ -5194,8 +5195,7 @@ const RootRenderer = ({ inMemoryEntitiesStore, canvasMode }) => {
|
|
|
5194
5195
|
const wrappingPatternIds = rootBlockId !== ROOT_ID ? new Set([rootBlockId]) : new Set();
|
|
5195
5196
|
const entityStore = inMemoryEntitiesStore((state) => state.entityStore);
|
|
5196
5197
|
const areEntitiesFetched = inMemoryEntitiesStore((state) => state.areEntitiesFetched);
|
|
5197
|
-
return (React.createElement(React.Fragment, null,
|
|
5198
|
-
React.createElement("div", { "data-ctfl-root": true, className: styles$2.rootContainer }, !tree.root.children.length ? (React.createElement(EmptyCanvasMessage, null)) : (tree.root.children.map((topLevelChildNode) => (React.createElement(EditorBlock, { key: topLevelChildNode.data.id, node: topLevelChildNode, resolveDesignValue: resolveDesignValue, wrappingPatternIds: wrappingPatternIds, entityStore: entityStore, areEntitiesFetched: areEntitiesFetched })))))));
|
|
5198
|
+
return (React.createElement(React.Fragment, null, !tree.root.children.length ? (React.createElement(EmptyCanvasMessage, null)) : (tree.root.children.map((topLevelChildNode) => (React.createElement(EditorBlock, { key: topLevelChildNode.data.id, node: topLevelChildNode, resolveDesignValue: resolveDesignValue, wrappingPatternIds: wrappingPatternIds, entityStore: entityStore, areEntitiesFetched: areEntitiesFetched }))))));
|
|
5199
5199
|
};
|
|
5200
5200
|
|
|
5201
5201
|
const useInitializeEditor = (inMemoryEntitiesStore) => {
|