@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/renderApp.js
CHANGED
|
@@ -37,8 +37,8 @@ function styleInject(css, ref) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
var css_248z$
|
|
41
|
-
styleInject(css_248z$
|
|
40
|
+
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";
|
|
41
|
+
styleInject(css_248z$a);
|
|
42
42
|
|
|
43
43
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
44
44
|
|
|
@@ -44227,6 +44227,7 @@ const BreakpointSchema$1 = z
|
|
|
44227
44227
|
const BaseComponentTreeNodeSchema$1 = z.object({
|
|
44228
44228
|
id: ComponentTreeNodeIdSchema$1.optional(),
|
|
44229
44229
|
definitionId: DefinitionPropertyKeySchema$1,
|
|
44230
|
+
prebindingId: z.string().optional(),
|
|
44230
44231
|
displayName: z.string().optional(),
|
|
44231
44232
|
slotId: z.string().optional(),
|
|
44232
44233
|
variables: z.record(propertyKeySchema$1, ComponentPropertyValueSchema$1),
|
|
@@ -47342,10 +47343,6 @@ const cloneDeepAsPOJO = (obj) => {
|
|
|
47342
47343
|
return JSON.parse(JSON.stringify(obj));
|
|
47343
47344
|
};
|
|
47344
47345
|
|
|
47345
|
-
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";
|
|
47346
|
-
var styles$2 = {"rootContainer":"RootRenderer-module_rootContainer__9UawM"};
|
|
47347
|
-
styleInject(css_248z$a);
|
|
47348
|
-
|
|
47349
47346
|
// TODO: In order to support integrations without React, we should extract this heavy logic into simple
|
|
47350
47347
|
// functions that we can reuse in other frameworks.
|
|
47351
47348
|
/*
|
|
@@ -48977,6 +48974,7 @@ const BreakpointSchema = z
|
|
|
48977
48974
|
const BaseComponentTreeNodeSchema = z.object({
|
|
48978
48975
|
id: ComponentTreeNodeIdSchema.optional(),
|
|
48979
48976
|
definitionId: DefinitionPropertyKeySchema,
|
|
48977
|
+
prebindingId: z.string().optional(),
|
|
48980
48978
|
displayName: z.string().optional(),
|
|
48981
48979
|
slotId: z.string().optional(),
|
|
48982
48980
|
variables: z.record(propertyKeySchema, ComponentPropertyValueSchema),
|
|
@@ -49722,8 +49720,8 @@ var VisualEditorMode;
|
|
|
49722
49720
|
VisualEditorMode["InjectScript"] = "injectScript";
|
|
49723
49721
|
})(VisualEditorMode || (VisualEditorMode = {}));
|
|
49724
49722
|
|
|
49725
|
-
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}";
|
|
49726
|
-
styleInject(css_248z$2);
|
|
49723
|
+
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}";
|
|
49724
|
+
styleInject(css_248z$2$1);
|
|
49727
49725
|
|
|
49728
49726
|
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) => {
|
|
49729
49727
|
return (React$1.createElement("div", { id: id, ref: ref, style: {
|
|
@@ -50056,9 +50054,9 @@ const MissingComponentPlaceholder = ({ blockId }) => {
|
|
|
50056
50054
|
"'"));
|
|
50057
50055
|
};
|
|
50058
50056
|
|
|
50059
|
-
var css_248z$
|
|
50057
|
+
var css_248z$2 = ".EditorBlock-module_emptySlot__za-Bi {\n min-height: 80px;\n min-width: 80px;\n}\n";
|
|
50060
50058
|
var styles$1 = {"emptySlot":"EditorBlock-module_emptySlot__za-Bi"};
|
|
50061
|
-
styleInject(css_248z$
|
|
50059
|
+
styleInject(css_248z$2);
|
|
50062
50060
|
|
|
50063
50061
|
const useComponentRegistration = (node) => {
|
|
50064
50062
|
return reactExports.useMemo(() => {
|
|
@@ -50383,9 +50381,9 @@ const RegistrationComponent = ({ node, resolveDesignValue, componentRegistration
|
|
|
50383
50381
|
return React$1.createElement(ImportedComponentErrorBoundary, { componentId: node.data.blockId }, React$1.createElement(componentRegistration.component, { ...componentProps, ...slotNodes }, children));
|
|
50384
50382
|
};
|
|
50385
50383
|
|
|
50386
|
-
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";
|
|
50384
|
+
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";
|
|
50387
50385
|
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"};
|
|
50388
|
-
styleInject(css_248z);
|
|
50386
|
+
styleInject(css_248z$1);
|
|
50389
50387
|
|
|
50390
50388
|
const EmptyCanvasMessage = () => {
|
|
50391
50389
|
return (React$1.createElement("div", { className: styles['empty-canvas-container'], "data-type": "empty-container" },
|
|
@@ -50578,6 +50576,9 @@ function findAllImages() {
|
|
|
50578
50576
|
return Array.from(document.querySelectorAll('img'));
|
|
50579
50577
|
}
|
|
50580
50578
|
|
|
50579
|
+
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";
|
|
50580
|
+
styleInject(css_248z);
|
|
50581
|
+
|
|
50581
50582
|
const RootRenderer = ({ inMemoryEntitiesStore, canvasMode }) => {
|
|
50582
50583
|
useEditorSubscriber(inMemoryEntitiesStore);
|
|
50583
50584
|
const tree = useTreeStore((state) => state.tree);
|
|
@@ -50590,8 +50591,7 @@ const RootRenderer = ({ inMemoryEntitiesStore, canvasMode }) => {
|
|
|
50590
50591
|
const wrappingPatternIds = rootBlockId !== ROOT_ID ? new Set([rootBlockId]) : new Set();
|
|
50591
50592
|
const entityStore = inMemoryEntitiesStore((state) => state.entityStore);
|
|
50592
50593
|
const areEntitiesFetched = inMemoryEntitiesStore((state) => state.areEntitiesFetched);
|
|
50593
|
-
return (React$1.createElement(React$1.Fragment, null,
|
|
50594
|
-
React$1.createElement("div", { "data-ctfl-root": true, className: styles$2.rootContainer }, !tree.root.children.length ? (React$1.createElement(EmptyCanvasMessage, null)) : (tree.root.children.map((topLevelChildNode) => (React$1.createElement(EditorBlock, { key: topLevelChildNode.data.id, node: topLevelChildNode, resolveDesignValue: resolveDesignValue, wrappingPatternIds: wrappingPatternIds, entityStore: entityStore, areEntitiesFetched: areEntitiesFetched })))))));
|
|
50594
|
+
return (React$1.createElement(React$1.Fragment, null, !tree.root.children.length ? (React$1.createElement(EmptyCanvasMessage, null)) : (tree.root.children.map((topLevelChildNode) => (React$1.createElement(EditorBlock, { key: topLevelChildNode.data.id, node: topLevelChildNode, resolveDesignValue: resolveDesignValue, wrappingPatternIds: wrappingPatternIds, entityStore: entityStore, areEntitiesFetched: areEntitiesFetched }))))));
|
|
50595
50595
|
};
|
|
50596
50596
|
|
|
50597
50597
|
const useInitializeEditor = (inMemoryEntitiesStore) => {
|