@contentful/experiences-components-react 2.0.0-prerelease-20250703T1150-c529c88.0 → 2.0.0-prerelease-20250704T1603-11d76eb.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.d.ts +30 -85
- package/dist/index.js +64 -84
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/index.css +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { ComponentDefinition, OptimizedImageAsset,
|
|
2
|
-
import React
|
|
1
|
+
import { ComponentDefinition, OptimizedImageAsset, StructureComponentProps, StyleProps } from '@contentful/experiences-core/types';
|
|
2
|
+
import React, { HTMLAttributes } from 'react';
|
|
3
3
|
import { Document } from '@contentful/rich-text-types';
|
|
4
|
-
import { EntityStore } from '@contentful/experiences-core';
|
|
5
4
|
|
|
6
|
-
interface ButtonProps extends React
|
|
5
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
6
|
/**
|
|
8
7
|
* The URL to navigate to when the button is clicked. When provided, the button will be wrapped in an anchor tag.
|
|
9
8
|
* @default undefined
|
|
@@ -60,13 +59,13 @@ interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
60
59
|
* <Button>Go</Button>
|
|
61
60
|
* ```
|
|
62
61
|
*/
|
|
63
|
-
children?: React
|
|
62
|
+
children?: React.ReactNode;
|
|
64
63
|
}
|
|
65
|
-
declare const Button: React
|
|
64
|
+
declare const Button: React.FC<ButtonProps>;
|
|
66
65
|
|
|
67
66
|
declare const ButtonComponentDefinition: ComponentDefinition;
|
|
68
67
|
|
|
69
|
-
interface HeadingProps extends React
|
|
68
|
+
interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
70
69
|
/**
|
|
71
70
|
* The text to display in the heading. If not provided, children will be used instead.
|
|
72
71
|
* @default undefined
|
|
@@ -86,7 +85,7 @@ interface HeadingProps extends React$1.HTMLAttributes<HTMLHeadingElement> {
|
|
|
86
85
|
* <Heading>My Heading</Heading>
|
|
87
86
|
* ```
|
|
88
87
|
*/
|
|
89
|
-
children?: React
|
|
88
|
+
children?: React.ReactNode;
|
|
90
89
|
/**
|
|
91
90
|
* The type of heading to render
|
|
92
91
|
* @default h1
|
|
@@ -98,11 +97,11 @@ interface HeadingProps extends React$1.HTMLAttributes<HTMLHeadingElement> {
|
|
|
98
97
|
*/
|
|
99
98
|
type?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
100
99
|
}
|
|
101
|
-
declare const Heading: React
|
|
100
|
+
declare const Heading: React.FC<HeadingProps>;
|
|
102
101
|
|
|
103
102
|
declare const HeadingComponentDefinition: ComponentDefinition;
|
|
104
103
|
|
|
105
|
-
interface RichTextProps extends Omit<React
|
|
104
|
+
interface RichTextProps extends Omit<React.HTMLAttributes<HTMLElement>, 'value'> {
|
|
106
105
|
/**
|
|
107
106
|
* Renders the text in a specific HTML tag.
|
|
108
107
|
* @default p
|
|
@@ -132,11 +131,11 @@ interface RichTextProps extends Omit<React$1.HTMLAttributes<HTMLElement>, 'value
|
|
|
132
131
|
*/
|
|
133
132
|
value: Document;
|
|
134
133
|
}
|
|
135
|
-
declare const RichText: React
|
|
134
|
+
declare const RichText: React.FC<RichTextProps>;
|
|
136
135
|
|
|
137
136
|
declare const RichTextComponentDefinition: ComponentDefinition;
|
|
138
137
|
|
|
139
|
-
interface TextProps extends React
|
|
138
|
+
interface TextProps extends React.HTMLAttributes<HTMLElement> {
|
|
140
139
|
/**
|
|
141
140
|
* The URL to navigate to when the text is clicked. When provided, the text will be wrapped in an anchor tag.
|
|
142
141
|
* @default undefined
|
|
@@ -194,7 +193,7 @@ interface TextProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
|
194
193
|
* <Text>My Text</Text>
|
|
195
194
|
* ```
|
|
196
195
|
*/
|
|
197
|
-
children?: React
|
|
196
|
+
children?: React.ReactNode;
|
|
198
197
|
/**
|
|
199
198
|
* Renders the text in a specific HTML tag.
|
|
200
199
|
* @default p
|
|
@@ -206,38 +205,24 @@ interface TextProps extends React$1.HTMLAttributes<HTMLElement> {
|
|
|
206
205
|
*/
|
|
207
206
|
as?: 'p' | 'span' | 'div' | 'label' | 'caption' | 'small' | 'strong' | 'em';
|
|
208
207
|
}
|
|
209
|
-
declare const Text: React
|
|
208
|
+
declare const Text: React.FC<TextProps>;
|
|
210
209
|
|
|
211
210
|
declare const TextComponentDefinition: ComponentDefinition;
|
|
212
211
|
|
|
213
|
-
interface ImageProps extends React
|
|
212
|
+
interface ImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
|
|
214
213
|
cfImageAsset?: OptimizedImageAsset | string;
|
|
215
214
|
}
|
|
216
|
-
declare const Image: React
|
|
215
|
+
declare const Image: React.FC<ImageProps>;
|
|
217
216
|
|
|
218
217
|
declare const ImageComponentDefinition: ComponentDefinition;
|
|
219
218
|
|
|
220
|
-
type ContentfulContainerAsHyperlinkProps
|
|
221
|
-
editorMode?: EditorMode;
|
|
222
|
-
node: ExperienceTreeNode;
|
|
223
|
-
dataSource?: ExperienceDataSource;
|
|
224
|
-
unboundValues?: ExperienceUnboundValues;
|
|
225
|
-
resolveDesignValue?: any;
|
|
226
|
-
entityStore?: RefObject<EntityStore>;
|
|
227
|
-
areEntitiesFetched?: boolean;
|
|
228
|
-
renderDropzone: (node: ExperienceTreeNode, props?: Record<string, any>) => React$1.ReactNode;
|
|
229
|
-
} : {
|
|
230
|
-
editorMode: EditorMode;
|
|
231
|
-
}) & {
|
|
232
|
-
children?: React$1.ReactNode;
|
|
219
|
+
type ContentfulContainerAsHyperlinkProps = StructureComponentProps<{
|
|
233
220
|
className?: string;
|
|
234
221
|
cfHyperlink?: StyleProps['cfHyperlink'];
|
|
235
222
|
cfOpenInNewTab?: StyleProps['cfOpenInNewTab'];
|
|
236
|
-
|
|
237
|
-
dragProps?: DragWrapperProps;
|
|
238
|
-
};
|
|
223
|
+
}>;
|
|
239
224
|
|
|
240
|
-
declare const ContentfulContainer: React
|
|
225
|
+
declare const ContentfulContainer: React.FC<ContentfulContainerAsHyperlinkProps>;
|
|
241
226
|
|
|
242
227
|
declare const containerDefinition: ComponentDefinition;
|
|
243
228
|
declare const sectionDefinition: ComponentDefinition;
|
|
@@ -246,71 +231,31 @@ type ContentfulDividerProps = {
|
|
|
246
231
|
className?: string;
|
|
247
232
|
dragProps?: unknown;
|
|
248
233
|
};
|
|
249
|
-
declare const ContentfulDivider: ({ className, dragProps: _, ...props }: ContentfulDividerProps) => React
|
|
234
|
+
declare const ContentfulDivider: ({ className, dragProps: _, ...props }: ContentfulDividerProps) => React.JSX.Element;
|
|
250
235
|
|
|
251
236
|
declare const dividerDefinition: ComponentDefinition;
|
|
252
237
|
|
|
253
|
-
|
|
254
|
-
editorMode: boolean;
|
|
238
|
+
type ColumnsProps = StructureComponentProps<{
|
|
255
239
|
className?: string;
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
interface ColumnsEditorModeProps extends ColumnsBaseProps {
|
|
259
|
-
editorMode: true;
|
|
260
|
-
cfColumns: string;
|
|
261
|
-
node: ExperienceTreeNode;
|
|
262
|
-
renderDropzone: (node: ExperienceTreeNode, props?: Record<string, unknown>) => React.ReactNode;
|
|
263
|
-
dragProps?: unknown;
|
|
264
|
-
}
|
|
265
|
-
interface ColumnsDeliveryModeProps extends ColumnsBaseProps {
|
|
266
|
-
editorMode: false;
|
|
267
|
-
}
|
|
268
|
-
interface SingleColumnEditorModeProps extends ColumnsBaseProps {
|
|
269
|
-
editorMode: true;
|
|
270
|
-
node: ExperienceTreeNode;
|
|
271
|
-
renderDropzone: (node: ExperienceTreeNode, props?: Record<string, unknown>) => React.ReactNode;
|
|
272
|
-
cfColumnSpan: string;
|
|
273
|
-
dragProps?: unknown;
|
|
274
|
-
['data-ctfl-draggable-id']: string;
|
|
275
|
-
style?: CSSProperties;
|
|
276
|
-
className: string;
|
|
277
|
-
onMouseOver: (e: SyntheticEvent<Element, Event>) => void;
|
|
278
|
-
onMouseOut: (e: SyntheticEvent<Element, Event>) => void;
|
|
279
|
-
onMouseDown: (e: SyntheticEvent<Element, Event>) => void;
|
|
280
|
-
onMouseUp: (e: SyntheticEvent<Element, Event>) => void;
|
|
281
|
-
onClick: (e: SyntheticEvent<Element, Event>) => void;
|
|
282
|
-
}
|
|
283
|
-
interface SingleColumnDeliveryModeProps extends ColumnsBaseProps {
|
|
284
|
-
editorMode: false;
|
|
285
|
-
}
|
|
286
|
-
type ColumnsProps = ColumnsEditorModeProps | ColumnsDeliveryModeProps;
|
|
287
|
-
type SingleColumnProps = SingleColumnEditorModeProps | SingleColumnDeliveryModeProps;
|
|
240
|
+
}>;
|
|
241
|
+
declare const Columns: ({ className, children, ...otherProps }: ColumnsProps) => React.JSX.Element;
|
|
288
242
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
243
|
+
type SingleColumnProps = StructureComponentProps<{
|
|
244
|
+
className?: string;
|
|
245
|
+
}>;
|
|
246
|
+
declare const SingleColumn: React.FC<SingleColumnProps>;
|
|
292
247
|
|
|
293
248
|
declare const columnsDefinition: ComponentDefinition;
|
|
294
249
|
declare const singleColumnDefinition: ComponentDefinition;
|
|
295
250
|
|
|
296
|
-
type AssemblyProps
|
|
297
|
-
|
|
298
|
-
className?: string;
|
|
299
|
-
cfHyperlink?: StyleProps['cfHyperlink'];
|
|
300
|
-
cfOpenInNewTab?: StyleProps['cfOpenInNewTab'];
|
|
301
|
-
editorMode?: EditorMode;
|
|
302
|
-
node: ExperienceTreeNode;
|
|
303
|
-
resolveDesignValue?: ResolveDesignValueType;
|
|
304
|
-
dragProps?: Record<string, any>;
|
|
305
|
-
renderDropzone: (node: ExperienceTreeNode, props?: Record<string, any>) => React$1.ReactNode;
|
|
306
|
-
} : Record<string, any>;
|
|
307
|
-
declare const Assembly: React$1.FC<AssemblyProps>;
|
|
251
|
+
type AssemblyProps = StructureComponentProps<HTMLAttributes<HTMLDivElement>>;
|
|
252
|
+
declare const Assembly: React.FC<AssemblyProps>;
|
|
308
253
|
|
|
309
254
|
interface CarouselProps {
|
|
310
255
|
className?: string;
|
|
311
|
-
children?: React
|
|
256
|
+
children?: React.ReactNode;
|
|
312
257
|
}
|
|
313
|
-
declare const Carousel: React
|
|
258
|
+
declare const Carousel: React.FC<CarouselProps>;
|
|
314
259
|
|
|
315
260
|
declare const carouselDefinition: ComponentDefinition;
|
|
316
261
|
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import styleInject from 'style-inject';
|
|
1
2
|
import React, { forwardRef } from 'react';
|
|
2
3
|
import { documentToReactComponents } from '@contentful/rich-text-react-renderer';
|
|
3
4
|
import { BLOCKS } from '@contentful/rich-text-types';
|
|
@@ -6,6 +7,10 @@ import 'lodash-es';
|
|
|
6
7
|
import 'md5';
|
|
7
8
|
import { create } from 'zustand';
|
|
8
9
|
|
|
10
|
+
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}";
|
|
11
|
+
styleInject(css_248z$8);
|
|
12
|
+
|
|
13
|
+
/** @deprecated will be removed when dropping backward compatibility for old DND */
|
|
9
14
|
/**
|
|
10
15
|
* These modes are ONLY intended to be internally used within the context of
|
|
11
16
|
* editing an experience inside of Contentful Studio. i.e. these modes
|
|
@@ -78,6 +83,9 @@ function combineClasses(...classes) {
|
|
|
78
83
|
.join(' ');
|
|
79
84
|
}
|
|
80
85
|
|
|
86
|
+
var css_248z$7 = ".cf-button:empty:before{content:\"\";display:inline-block}";
|
|
87
|
+
styleInject(css_248z$7);
|
|
88
|
+
|
|
81
89
|
const Button = ({ children, className, label, onClick, onNavigate, target, url, ...props }) => {
|
|
82
90
|
const classes = combineClasses('cf-button', className);
|
|
83
91
|
const handleClick = (event) => {
|
|
@@ -190,6 +198,9 @@ const ButtonComponentDefinition = {
|
|
|
190
198
|
},
|
|
191
199
|
};
|
|
192
200
|
|
|
201
|
+
var css_248z$6 = ".cf-heading{white-space:pre-line}";
|
|
202
|
+
styleInject(css_248z$6);
|
|
203
|
+
|
|
193
204
|
const Heading = ({ children, className, text, type = 'h1', ...props }) => {
|
|
194
205
|
const Tag = type;
|
|
195
206
|
const classes = combineClasses('cf-heading', className);
|
|
@@ -276,6 +287,9 @@ const HeadingComponentDefinition = {
|
|
|
276
287
|
},
|
|
277
288
|
};
|
|
278
289
|
|
|
290
|
+
var css_248z$5 = ".cf-richtext{white-space:pre-line}.cf-richtext>:first-child{margin-top:0}.cf-richtext>:last-child{margin-bottom:0}";
|
|
291
|
+
styleInject(css_248z$5);
|
|
292
|
+
|
|
279
293
|
const RichText = ({ as = 'p', className, value, ...props }) => {
|
|
280
294
|
const Tag = as;
|
|
281
295
|
return (React.createElement("div", { className: combineClasses('cf-richtext', className), ...props }, documentToReactComponents(value, {
|
|
@@ -363,6 +377,9 @@ const RichTextComponentDefinition = {
|
|
|
363
377
|
},
|
|
364
378
|
};
|
|
365
379
|
|
|
380
|
+
var css_248z$4 = ".cf-text{white-space:pre-line}.cf-text-link .cf-text{margin:0}";
|
|
381
|
+
styleInject(css_248z$4);
|
|
382
|
+
|
|
366
383
|
const Text = ({ as = 'p', children, className, value, url, target, onNavigate, onClick, ...props }) => {
|
|
367
384
|
const Tag = as;
|
|
368
385
|
if (url) {
|
|
@@ -454,6 +471,9 @@ const TextComponentDefinition = {
|
|
|
454
471
|
},
|
|
455
472
|
};
|
|
456
473
|
|
|
474
|
+
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)}";
|
|
475
|
+
styleInject(css_248z$3);
|
|
476
|
+
|
|
457
477
|
const Image = ({ className = '', src, cfImageAsset, ...props }) => {
|
|
458
478
|
if (!cfImageAsset && !src) {
|
|
459
479
|
return (React.createElement("div", { className: combineClasses('cf-placeholder-wrapper', className) },
|
|
@@ -1390,13 +1410,7 @@ const ParameterDefinitionSchema = z.object({
|
|
|
1390
1410
|
}),
|
|
1391
1411
|
})
|
|
1392
1412
|
.optional(),
|
|
1393
|
-
contentTypes: z.
|
|
1394
|
-
sys: z.object({
|
|
1395
|
-
type: z.literal('Link'),
|
|
1396
|
-
id: z.string(),
|
|
1397
|
-
linkType: z.enum(['ContentType']),
|
|
1398
|
-
}),
|
|
1399
|
-
})),
|
|
1413
|
+
contentTypes: z.array(z.string()),
|
|
1400
1414
|
passToNodes: z.array(PassToNodeSchema).optional(),
|
|
1401
1415
|
});
|
|
1402
1416
|
const ParameterDefinitionsSchema = z.record(propertyKeySchema, ParameterDefinitionSchema);
|
|
@@ -1416,7 +1430,7 @@ const ComponentSettingsSchema = z
|
|
|
1416
1430
|
variableDefinitions: ComponentVariablesSchema,
|
|
1417
1431
|
thumbnailId: z.enum(THUMBNAIL_IDS).optional(),
|
|
1418
1432
|
category: z.string().max(50, 'Category must contain at most 50 characters').optional(),
|
|
1419
|
-
prebindingDefinitions: z.array(PrebindingDefinitionSchema).
|
|
1433
|
+
prebindingDefinitions: z.array(PrebindingDefinitionSchema).length(1).optional(),
|
|
1420
1434
|
})
|
|
1421
1435
|
.strict();
|
|
1422
1436
|
z.object({
|
|
@@ -2041,6 +2055,9 @@ var VisualEditorMode;
|
|
|
2041
2055
|
VisualEditorMode["InjectScript"] = "injectScript";
|
|
2042
2056
|
})(VisualEditorMode || (VisualEditorMode = {}));
|
|
2043
2057
|
|
|
2058
|
+
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}";
|
|
2059
|
+
styleInject(css_248z$2);
|
|
2060
|
+
|
|
2044
2061
|
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) => {
|
|
2045
2062
|
return (React.createElement("div", { id: id, ref: ref, style: {
|
|
2046
2063
|
display: 'flex',
|
|
@@ -2063,31 +2080,29 @@ const Flex = forwardRef(({ id, children, onMouseEnter, onMouseUp, onMouseLeave,
|
|
|
2063
2080
|
});
|
|
2064
2081
|
Flex.displayName = 'Flex';
|
|
2065
2082
|
|
|
2066
|
-
|
|
2083
|
+
function extractRenderProps(props) {
|
|
2084
|
+
if (props.editorMode) {
|
|
2085
|
+
const { editorMode, node, children, ...renderProps } = props;
|
|
2086
|
+
return renderProps;
|
|
2087
|
+
}
|
|
2088
|
+
const { editorMode, children, ...renderProps } = props;
|
|
2089
|
+
return renderProps;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2067
2092
|
const ContentfulContainerAsHyperlink = (props) => {
|
|
2068
|
-
const { cfHyperlink, cfOpenInNewTab, editorMode, className, children } = props;
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
rel: 'noopener noreferrer',
|
|
2075
|
-
};
|
|
2093
|
+
const { cfHyperlink, cfOpenInNewTab, editorMode, className, children, ...otherProps } = props;
|
|
2094
|
+
const eventHandlingProps = editorMode === true ? { onClick: stopEventPropagation } : {};
|
|
2095
|
+
const anchorTagProps = cfOpenInNewTab
|
|
2096
|
+
? {
|
|
2097
|
+
target: '_blank',
|
|
2098
|
+
rel: 'noopener noreferrer',
|
|
2076
2099
|
}
|
|
2077
|
-
|
|
2078
|
-
}
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
};
|
|
2084
|
-
return renderDropzone(node, {
|
|
2085
|
-
['data-test-id']: 'contentful-container',
|
|
2086
|
-
className: combineClasses(className, 'contentful-container', 'contentful-container-link'),
|
|
2087
|
-
zoneId: node.data.id,
|
|
2088
|
-
WrapperComponent: 'a',
|
|
2089
|
-
onClick: stopPropagationInEditorMode,
|
|
2090
|
-
});
|
|
2100
|
+
: {};
|
|
2101
|
+
return (React.createElement("a", { className: combineClasses(className, 'contentful-container', 'contentful-container-link'), href: cfHyperlink, ...anchorTagProps, ...eventHandlingProps, ...extractRenderProps(otherProps) }, children));
|
|
2102
|
+
};
|
|
2103
|
+
const stopEventPropagation = (event) => {
|
|
2104
|
+
event.stopPropagation();
|
|
2105
|
+
event.preventDefault();
|
|
2091
2106
|
};
|
|
2092
2107
|
|
|
2093
2108
|
/* eslint-disable */
|
|
@@ -2096,21 +2111,14 @@ const ContentfulContainer = (props) => {
|
|
|
2096
2111
|
if (cfHyperlink) {
|
|
2097
2112
|
return React.createElement(ContentfulContainerAsHyperlink, { ...props }, children);
|
|
2098
2113
|
}
|
|
2099
|
-
if (editorMode
|
|
2114
|
+
if (!editorMode) {
|
|
2100
2115
|
return (React.createElement(Flex, { "data-test-id": "contentful-container", className: combineClasses(className, 'contentful-container') }, children));
|
|
2101
2116
|
}
|
|
2102
2117
|
// Extract properties that are only available in editor mode
|
|
2103
|
-
const {
|
|
2118
|
+
const { node } = props;
|
|
2104
2119
|
const isEmpty = !node.children.length;
|
|
2105
2120
|
const isSection = node.data.blockId === CONTENTFUL_COMPONENTS$1.section.id;
|
|
2106
|
-
return
|
|
2107
|
-
...editorModeProps,
|
|
2108
|
-
['data-test-id']: 'contentful-container',
|
|
2109
|
-
id: 'ContentfulContainer',
|
|
2110
|
-
className: combineClasses('contentful-container', className, isEmpty ? (isSection ? 'contentful-section-label' : 'contentful-container-label') : ''),
|
|
2111
|
-
WrapperComponent: Flex,
|
|
2112
|
-
dragProps,
|
|
2113
|
-
});
|
|
2121
|
+
return (React.createElement(Flex, { "data-test-id": "contentful-container", ...extractRenderProps(props), className: combineClasses(className, 'contentful-container', isEmpty ? (isSection ? 'contentful-section-label' : 'contentful-container-label') : '') }, children));
|
|
2114
2122
|
};
|
|
2115
2123
|
|
|
2116
2124
|
const containerDefinition = {
|
|
@@ -2134,6 +2142,9 @@ const sectionDefinition = {
|
|
|
2134
2142
|
},
|
|
2135
2143
|
};
|
|
2136
2144
|
|
|
2145
|
+
var css_248z$1 = ".cf-divider{display:contents;height:100%;position:relative;width:100%}.cf-divider hr{border:none}";
|
|
2146
|
+
styleInject(css_248z$1);
|
|
2147
|
+
|
|
2137
2148
|
const ContentfulDivider = ({ className = '',
|
|
2138
2149
|
// We have to exclude this explicitly from rendering as withComponentWrapper is not used
|
|
2139
2150
|
dragProps: _, ...props }) => {
|
|
@@ -2152,45 +2163,25 @@ const dividerDefinition = {
|
|
|
2152
2163
|
},
|
|
2153
2164
|
};
|
|
2154
2165
|
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2166
|
+
var css_248z = ".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{position:relative}.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\"}";
|
|
2167
|
+
styleInject(css_248z);
|
|
2168
|
+
|
|
2169
|
+
const Columns = ({ className, children, ...otherProps }) => {
|
|
2170
|
+
return (React.createElement("div", { className: combineClasses(className, 'cf-columns'), style: {
|
|
2158
2171
|
display: 'grid',
|
|
2159
2172
|
gridTemplateColumns: 'repeat(12, [col-start] 1fr)',
|
|
2160
|
-
} },
|
|
2161
|
-
});
|
|
2162
|
-
ColumnWrapper.displayName = 'ColumnWrapper';
|
|
2163
|
-
const Columns = (props) => {
|
|
2164
|
-
const { editorMode, className, children } = props;
|
|
2165
|
-
if (!editorMode) {
|
|
2166
|
-
return (React.createElement(ColumnWrapper, { className: combineClasses(className, 'cf-columns') }, children));
|
|
2167
|
-
}
|
|
2168
|
-
const { node, renderDropzone, dragProps = {}, ...rest } = props;
|
|
2169
|
-
return renderDropzone(node, {
|
|
2170
|
-
...rest,
|
|
2171
|
-
['data-test-id']: 'contentful-columns',
|
|
2172
|
-
id: 'ContentfulContainer',
|
|
2173
|
-
className: combineClasses('cf-columns', className),
|
|
2174
|
-
WrapperComponent: ColumnWrapper,
|
|
2175
|
-
dragProps,
|
|
2176
|
-
});
|
|
2173
|
+
}, ...extractRenderProps(otherProps) }, children));
|
|
2177
2174
|
};
|
|
2178
2175
|
|
|
2179
2176
|
const SingleColumn = (props) => {
|
|
2180
|
-
const { className, editorMode
|
|
2181
|
-
if (editorMode
|
|
2182
|
-
return React.createElement(Flex, { className: className }, children);
|
|
2177
|
+
const { className, editorMode } = props;
|
|
2178
|
+
if (!editorMode) {
|
|
2179
|
+
return React.createElement(Flex, { className: className }, props.children);
|
|
2183
2180
|
}
|
|
2184
|
-
const {
|
|
2181
|
+
const { node, children } = props;
|
|
2185
2182
|
const isEmpty = !node.children.length;
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
id: 'ContentfulSingleColumn',
|
|
2189
|
-
className: combineClasses('cf-single-column-wrapper', className, isEmpty ? 'cf-single-column-label' : ''),
|
|
2190
|
-
WrapperComponent: Flex,
|
|
2191
|
-
dragProps,
|
|
2192
|
-
...editorProps,
|
|
2193
|
-
});
|
|
2183
|
+
const mixedClassName = combineClasses('cf-single-column-wrapper', className, isEmpty ? 'cf-single-column-label' : '');
|
|
2184
|
+
return (React.createElement(Flex, { ...extractRenderProps(props), className: mixedClassName }, children));
|
|
2194
2185
|
};
|
|
2195
2186
|
|
|
2196
2187
|
const columnsDefinition = {
|
|
@@ -2212,18 +2203,7 @@ const singleColumnDefinition = {
|
|
|
2212
2203
|
};
|
|
2213
2204
|
|
|
2214
2205
|
const assemblyStyle = { display: 'contents' };
|
|
2215
|
-
// Feel free to do any magic as regards variable definitions for assemblies
|
|
2216
|
-
// Or if this isn't necessary by the time we figure that part out, we can bid this part farewell
|
|
2217
2206
|
const Assembly = (props) => {
|
|
2218
|
-
if (props.editorMode) {
|
|
2219
|
-
const { node, dragProps, ...editorModeProps } = props;
|
|
2220
|
-
return props.renderDropzone(node, {
|
|
2221
|
-
...editorModeProps,
|
|
2222
|
-
['data-test-id']: 'contentful-assembly',
|
|
2223
|
-
className: props.className,
|
|
2224
|
-
dragProps,
|
|
2225
|
-
});
|
|
2226
|
-
}
|
|
2227
2207
|
// Using a display contents so assembly content/children
|
|
2228
2208
|
// can appear as if they are direct children of the div wrapper's parent
|
|
2229
2209
|
return React.createElement("div", { "data-test-id": "assembly", ...props, style: assemblyStyle });
|