@contentful/experiences-visual-editor-react 3.4.1-dev-20250901T1349-8f11176.0 → 3.4.1-dev-20250901T1444-62c96a8.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 +23 -31
- package/dist/index.js.map +1 -1
- package/dist/renderApp.js +23 -31
- 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
|
|
|
@@ -44985,13 +44985,7 @@ function buildTemplate({ template, context, }) {
|
|
|
44985
44985
|
const stylesToKeep = ['cfImageAsset'];
|
|
44986
44986
|
const stylesToRemove = CF_STYLE_ATTRIBUTES.filter((style) => !stylesToKeep.includes(style));
|
|
44987
44987
|
// cfWrapColumns & cfWrapColumnsCount are no real style attributes as they are handled on the editor side
|
|
44988
|
-
const propsToRemove = [
|
|
44989
|
-
'cfHyperlink',
|
|
44990
|
-
'cfOpenInNewTab',
|
|
44991
|
-
'cfSsrClassName',
|
|
44992
|
-
'cfWrapColumns',
|
|
44993
|
-
'cfWrapColumnsCount',
|
|
44994
|
-
];
|
|
44988
|
+
const propsToRemove = ['cfSsrClassName', 'cfWrapColumns', 'cfWrapColumnsCount'];
|
|
44995
44989
|
const sanitizeNodeProps = (nodeProps) => {
|
|
44996
44990
|
return omit(nodeProps, stylesToRemove, propsToRemove);
|
|
44997
44991
|
};
|
|
@@ -47348,10 +47342,6 @@ const cloneDeepAsPOJO = (obj) => {
|
|
|
47348
47342
|
return JSON.parse(JSON.stringify(obj));
|
|
47349
47343
|
};
|
|
47350
47344
|
|
|
47351
|
-
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";
|
|
47352
|
-
var styles$2 = {"rootContainer":"RootRenderer-module_rootContainer__9UawM"};
|
|
47353
|
-
styleInject(css_248z$a);
|
|
47354
|
-
|
|
47355
47345
|
// TODO: In order to support integrations without React, we should extract this heavy logic into simple
|
|
47356
47346
|
// functions that we can reuse in other frameworks.
|
|
47357
47347
|
/*
|
|
@@ -49728,8 +49718,8 @@ var VisualEditorMode;
|
|
|
49728
49718
|
VisualEditorMode["InjectScript"] = "injectScript";
|
|
49729
49719
|
})(VisualEditorMode || (VisualEditorMode = {}));
|
|
49730
49720
|
|
|
49731
|
-
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}";
|
|
49732
|
-
styleInject(css_248z$2);
|
|
49721
|
+
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}";
|
|
49722
|
+
styleInject(css_248z$2$1);
|
|
49733
49723
|
|
|
49734
49724
|
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) => {
|
|
49735
49725
|
return (React$1.createElement("div", { id: id, ref: ref, style: {
|
|
@@ -50062,9 +50052,9 @@ const MissingComponentPlaceholder = ({ blockId }) => {
|
|
|
50062
50052
|
"'"));
|
|
50063
50053
|
};
|
|
50064
50054
|
|
|
50065
|
-
var css_248z$
|
|
50055
|
+
var css_248z$2 = ".EditorBlock-module_emptySlot__za-Bi {\n min-height: 80px;\n min-width: 80px;\n}\n";
|
|
50066
50056
|
var styles$1 = {"emptySlot":"EditorBlock-module_emptySlot__za-Bi"};
|
|
50067
|
-
styleInject(css_248z$
|
|
50057
|
+
styleInject(css_248z$2);
|
|
50068
50058
|
|
|
50069
50059
|
const useComponentRegistration = (node) => {
|
|
50070
50060
|
return reactExports.useMemo(() => {
|
|
@@ -50328,23 +50318,23 @@ const useComponentProps = ({ node, entityStore, areEntitiesFetched, resolveDesig
|
|
|
50328
50318
|
'data-cf-node-block-type': node.type,
|
|
50329
50319
|
className: props.cfSsrClassName ?? cfCsrClassName,
|
|
50330
50320
|
};
|
|
50331
|
-
// Only pass `editorMode` and `node` to structure components and assembly root nodes.
|
|
50332
|
-
const isStructureComponent = isContentfulStructureComponent(node.data.blockId);
|
|
50333
|
-
if (isStructureComponent) {
|
|
50334
|
-
return {
|
|
50335
|
-
...sharedProps,
|
|
50336
|
-
editorMode: true,
|
|
50337
|
-
node,
|
|
50338
|
-
};
|
|
50339
|
-
}
|
|
50340
50321
|
return {
|
|
50341
50322
|
...sharedProps,
|
|
50342
50323
|
// Allows custom components to render differently in the editor. This needs to be activated
|
|
50343
50324
|
// through options as the component has to be aware of this prop to not cause any React warnings.
|
|
50344
50325
|
...(options?.enableCustomEditorView ? { isInExpEditorMode: true } : {}),
|
|
50326
|
+
...(options?.editorProperties?.isEditorMode ? { isEditorMode: true } : {}),
|
|
50327
|
+
...(options?.editorProperties?.node ? { node } : {}),
|
|
50345
50328
|
...sanitizeNodeProps(props),
|
|
50346
50329
|
};
|
|
50347
|
-
}, [
|
|
50330
|
+
}, [
|
|
50331
|
+
cfCsrClassName,
|
|
50332
|
+
node,
|
|
50333
|
+
options?.editorProperties?.isEditorMode,
|
|
50334
|
+
options?.editorProperties?.node,
|
|
50335
|
+
options?.enableCustomEditorView,
|
|
50336
|
+
props,
|
|
50337
|
+
]);
|
|
50348
50338
|
return { componentProps };
|
|
50349
50339
|
};
|
|
50350
50340
|
|
|
@@ -50389,9 +50379,9 @@ const RegistrationComponent = ({ node, resolveDesignValue, componentRegistration
|
|
|
50389
50379
|
return React$1.createElement(ImportedComponentErrorBoundary, { componentId: node.data.blockId }, React$1.createElement(componentRegistration.component, { ...componentProps, ...slotNodes }, children));
|
|
50390
50380
|
};
|
|
50391
50381
|
|
|
50392
|
-
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";
|
|
50382
|
+
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";
|
|
50393
50383
|
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"};
|
|
50394
|
-
styleInject(css_248z);
|
|
50384
|
+
styleInject(css_248z$1);
|
|
50395
50385
|
|
|
50396
50386
|
const EmptyCanvasMessage = () => {
|
|
50397
50387
|
return (React$1.createElement("div", { className: styles['empty-canvas-container'], "data-type": "empty-container" },
|
|
@@ -50584,6 +50574,9 @@ function findAllImages() {
|
|
|
50584
50574
|
return Array.from(document.querySelectorAll('img'));
|
|
50585
50575
|
}
|
|
50586
50576
|
|
|
50577
|
+
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";
|
|
50578
|
+
styleInject(css_248z);
|
|
50579
|
+
|
|
50587
50580
|
const RootRenderer = ({ inMemoryEntitiesStore, canvasMode }) => {
|
|
50588
50581
|
useEditorSubscriber(inMemoryEntitiesStore);
|
|
50589
50582
|
const tree = useTreeStore((state) => state.tree);
|
|
@@ -50596,8 +50589,7 @@ const RootRenderer = ({ inMemoryEntitiesStore, canvasMode }) => {
|
|
|
50596
50589
|
const wrappingPatternIds = rootBlockId !== ROOT_ID ? new Set([rootBlockId]) : new Set();
|
|
50597
50590
|
const entityStore = inMemoryEntitiesStore((state) => state.entityStore);
|
|
50598
50591
|
const areEntitiesFetched = inMemoryEntitiesStore((state) => state.areEntitiesFetched);
|
|
50599
|
-
return (React$1.createElement(React$1.Fragment, null,
|
|
50600
|
-
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 })))))));
|
|
50592
|
+
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 }))))));
|
|
50601
50593
|
};
|
|
50602
50594
|
|
|
50603
50595
|
const useInitializeEditor = (inMemoryEntitiesStore) => {
|