@contentful/experiences-components-react 1.42.3-dev-20250701T1530-7e94407.0 → 1.42.3-dev-20250701T1751-c516f4d.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 +28 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/index.css +0 -1
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';
|
|
@@ -5,6 +6,9 @@ import { z } from 'zod';
|
|
|
5
6
|
import 'lodash-es';
|
|
6
7
|
import 'md5';
|
|
7
8
|
|
|
9
|
+
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}";
|
|
10
|
+
styleInject(css_248z$8);
|
|
11
|
+
|
|
8
12
|
/**
|
|
9
13
|
* These modes are ONLY intended to be internally used within the context of
|
|
10
14
|
* editing an experience inside of Contentful Studio. i.e. these modes
|
|
@@ -77,6 +81,9 @@ function combineClasses(...classes) {
|
|
|
77
81
|
.join(' ');
|
|
78
82
|
}
|
|
79
83
|
|
|
84
|
+
var css_248z$7 = ".cf-button:empty:before{content:\"\";display:inline-block}";
|
|
85
|
+
styleInject(css_248z$7);
|
|
86
|
+
|
|
80
87
|
const Button = ({ children, className, label, onClick, onNavigate, target, url, ...props }) => {
|
|
81
88
|
const classes = combineClasses('cf-button', className);
|
|
82
89
|
const handleClick = (event) => {
|
|
@@ -189,6 +196,9 @@ const ButtonComponentDefinition = {
|
|
|
189
196
|
},
|
|
190
197
|
};
|
|
191
198
|
|
|
199
|
+
var css_248z$6 = ".cf-heading{white-space:pre-line}";
|
|
200
|
+
styleInject(css_248z$6);
|
|
201
|
+
|
|
192
202
|
const Heading = ({ children, className, text, type = 'h1', ...props }) => {
|
|
193
203
|
const Tag = type;
|
|
194
204
|
const classes = combineClasses('cf-heading', className);
|
|
@@ -275,6 +285,9 @@ const HeadingComponentDefinition = {
|
|
|
275
285
|
},
|
|
276
286
|
};
|
|
277
287
|
|
|
288
|
+
var css_248z$5 = ".cf-richtext{white-space:pre-line}.cf-richtext>:first-child{margin-top:0}.cf-richtext>:last-child{margin-bottom:0}";
|
|
289
|
+
styleInject(css_248z$5);
|
|
290
|
+
|
|
278
291
|
const RichText = ({ as = 'p', className, value, ...props }) => {
|
|
279
292
|
const Tag = as;
|
|
280
293
|
return (React.createElement("div", { className: combineClasses('cf-richtext', className), ...props }, documentToReactComponents(value, {
|
|
@@ -362,6 +375,9 @@ const RichTextComponentDefinition = {
|
|
|
362
375
|
},
|
|
363
376
|
};
|
|
364
377
|
|
|
378
|
+
var css_248z$4 = ".cf-text{white-space:pre-line}.cf-text-link .cf-text{margin:0}";
|
|
379
|
+
styleInject(css_248z$4);
|
|
380
|
+
|
|
365
381
|
const Text = ({ as = 'p', children, className, value, url, target, onNavigate, onClick, ...props }) => {
|
|
366
382
|
const Tag = as;
|
|
367
383
|
if (url) {
|
|
@@ -453,6 +469,9 @@ const TextComponentDefinition = {
|
|
|
453
469
|
},
|
|
454
470
|
};
|
|
455
471
|
|
|
472
|
+
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)}";
|
|
473
|
+
styleInject(css_248z$3);
|
|
474
|
+
|
|
456
475
|
const Image = ({ className = '', src, cfImageAsset, ...props }) => {
|
|
457
476
|
if (!cfImageAsset && !src) {
|
|
458
477
|
return (React.createElement("div", { className: combineClasses('cf-placeholder-wrapper', className) },
|
|
@@ -1627,6 +1646,9 @@ var VisualEditorMode;
|
|
|
1627
1646
|
VisualEditorMode["InjectScript"] = "injectScript";
|
|
1628
1647
|
})(VisualEditorMode || (VisualEditorMode = {}));
|
|
1629
1648
|
|
|
1649
|
+
var css_248z$2 = ".contentful-container{display:flex;pointer-events:all;position:relative}.contentful-container::-webkit-scrollbar{display:none}.cf-single-column-wrapper{position:relative}.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}";
|
|
1650
|
+
styleInject(css_248z$2);
|
|
1651
|
+
|
|
1630
1652
|
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) => {
|
|
1631
1653
|
return (React.createElement("div", { id: id, ref: ref, style: {
|
|
1632
1654
|
display: 'flex',
|
|
@@ -1720,6 +1742,9 @@ const sectionDefinition = {
|
|
|
1720
1742
|
},
|
|
1721
1743
|
};
|
|
1722
1744
|
|
|
1745
|
+
var css_248z$1 = ".cf-divider{display:contents;height:100%;position:relative;width:100%}.cf-divider hr{border:none}[data-ctfl-zone-id=root] .cf-divider:before{bottom:-5px;content:\"\";left:-5px;pointer-events:all;position:absolute;right:-5px;top:-5px}";
|
|
1746
|
+
styleInject(css_248z$1);
|
|
1747
|
+
|
|
1723
1748
|
const ContentfulDivider = ({ className = '',
|
|
1724
1749
|
// We have to exclude this explicitly from rendering as withComponentWrapper is not used
|
|
1725
1750
|
dragProps: _, ...props }) => {
|
|
@@ -1738,6 +1763,9 @@ const dividerDefinition = {
|
|
|
1738
1763
|
},
|
|
1739
1764
|
};
|
|
1740
1765
|
|
|
1766
|
+
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{display:flex;position:relative}.cf-single-column{pointer-events:all}.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\"}";
|
|
1767
|
+
styleInject(css_248z);
|
|
1768
|
+
|
|
1741
1769
|
const ColumnWrapper = forwardRef((props, ref) => {
|
|
1742
1770
|
return (React.createElement("div", { ref: ref, ...props, style: {
|
|
1743
1771
|
...(props.style || {}),
|