@wulperstudio/editor-render 0.0.9-beta → 0.0.11-beta

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.
@@ -7,5 +7,5 @@ interface LinkProps extends LinkRootProps {
7
7
  description?: string;
8
8
  siteName?: string;
9
9
  }
10
- export declare const Link: ({ id, image, title, description, siteName, sx, ...props }: LinkProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const Link: ({ id, image, title, description, siteName, href, sx, ...props }: LinkProps) => import("react/jsx-runtime").JSX.Element;
11
11
  export {};
@@ -8,4 +8,4 @@ export interface DelimiterNodeProps {
8
8
  Delimiter?: DelimiterRootProps;
9
9
  Container?: RootContainerProps;
10
10
  }
11
- export declare const DelimiterNode: ({ type, id, Delimiter, Container }: DelimiterNodeProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const DelimiterNode: ({ type, id, Delimiter, Container, }: DelimiterNodeProps) => import("react/jsx-runtime").JSX.Element;
package/dist/cjs/index.js CHANGED
@@ -1373,7 +1373,7 @@ function requireReactJsxRuntime_development () {
1373
1373
  var RootContainer = material.styled('div', {
1374
1374
  name: 'RootContainer',
1375
1375
  label: 'root__container',
1376
- shouldForwardProp: function (prop) { return prop !== 'as' && prop !== 'stretched'; },
1376
+ shouldForwardProp: function (prop) { return prop !== 'as' && prop !== 'stretched' && prop !== 'sx'; },
1377
1377
  })(function (_a) {
1378
1378
  var stretched = _a.stretched;
1379
1379
  return (tslib.__assign({ width: '100%', maxWidth: 700, height: 'auto', margin: '0 auto' }, (stretched && {
@@ -1776,8 +1776,8 @@ var SiteName = material.styled('span')(function (_a) {
1776
1776
  });
1777
1777
 
1778
1778
  var Link = function (_a) {
1779
- var id = _a.id, image = _a.image, title = _a.title, description = _a.description, siteName = _a.siteName, sx = _a.sx, props = tslib.__rest(_a, ["id", "image", "title", "description", "siteName", "sx"]);
1780
- return (jsxRuntime.exports.jsxs(RootLink, tslib.__assign({ id: id, target: "_blank", rel: "nofollow noindex noreferrer", sx: sx }, props, { children: [jsxRuntime.exports.jsx(ImageFloat, { image: image }), jsxRuntime.exports.jsx(Title, { children: title }), jsxRuntime.exports.jsx(Description, { children: description }), jsxRuntime.exports.jsx(SiteName, { children: siteName })] }), id));
1779
+ var id = _a.id, image = _a.image, title = _a.title, description = _a.description, siteName = _a.siteName, href = _a.href, sx = _a.sx, props = tslib.__rest(_a, ["id", "image", "title", "description", "siteName", "href", "sx"]);
1780
+ return (jsxRuntime.exports.jsxs(RootLink, tslib.__assign({ as: href ? 'a' : 'div', id: id, href: href || undefined, target: href ? '_blank' : undefined, rel: href ? 'nofollow noindex noreferrer' : undefined, sx: sx }, props, { children: [jsxRuntime.exports.jsx(ImageFloat, { image: image }), jsxRuntime.exports.jsx(Title, { children: title }), jsxRuntime.exports.jsx(Description, { children: description }), jsxRuntime.exports.jsx(SiteName, { children: siteName })] }), id));
1781
1781
  };
1782
1782
 
1783
1783
  var RootCheckList = material.styled('div', {
@@ -1874,13 +1874,15 @@ var RecursiveNode = function (_a) {
1874
1874
  var ParagraphNode = function (_a) {
1875
1875
  var type = _a.type, data = _a.data, id = _a.id, Container$1 = _a.Container, Paragraph$1 = _a.Paragraph;
1876
1876
  var text = data.text;
1877
- return (jsxRuntime.exports.jsx(Container, tslib.__assign({}, Container$1, { children: jsxRuntime.exports.jsx(Paragraph, tslib.__assign({ id: ForkIdWithType(id, type) }, Paragraph$1, { children: jsxRuntime.exports.jsx(RecursiveNode, { html: text, id: id }) })) }), id));
1877
+ var _b = Container$1 || {}, sx = _b.sx, containerProps = tslib.__rest(_b, ["sx"]);
1878
+ return (jsxRuntime.exports.jsx(Container, tslib.__assign({ sx: sx }, containerProps, { children: jsxRuntime.exports.jsx(Paragraph, tslib.__assign({ id: ForkIdWithType(id, type) }, Paragraph$1, { children: jsxRuntime.exports.jsx(RecursiveNode, { html: text, id: id }) })) }), id));
1878
1879
  };
1879
1880
 
1880
1881
  var HeaderNode = function (_a) {
1881
1882
  var type = _a.type, data = _a.data, id = _a.id, Container$1 = _a.Container, Header$1 = _a.Header;
1882
1883
  var text = data.text;
1883
- return (jsxRuntime.exports.jsx(Container, tslib.__assign({}, Container$1, { children: jsxRuntime.exports.jsx(Header, tslib.__assign({ id: ForkIdWithType(id, type), level: data.level }, Header$1, { children: jsxRuntime.exports.jsx(RecursiveNode, { html: text, id: id }) })) }), id));
1884
+ var _b = Container$1 || {}, sx = _b.sx, containerProps = tslib.__rest(_b, ["sx"]);
1885
+ return (jsxRuntime.exports.jsx(Container, tslib.__assign({ sx: sx }, containerProps, { children: jsxRuntime.exports.jsx(Header, tslib.__assign({ id: ForkIdWithType(id, type), level: data.level }, Header$1, { children: jsxRuntime.exports.jsx(RecursiveNode, { html: text, id: id }) })) }), id));
1884
1886
  };
1885
1887
 
1886
1888
  // SizeTypes = 'one-column' | 'two-columns' | 'three-columns';
@@ -1888,7 +1890,8 @@ var DEFAULT_GAP$1 = 20;
1888
1890
  var ListNode = function (_a) {
1889
1891
  var type = _a.type, data = _a.data, id = _a.id, tunes = _a.tunes, Container$1 = _a.Container, List$1 = _a.List, Item = _a.Item;
1890
1892
  var style = data.style;
1891
- return (jsxRuntime.exports.jsx(Container, tslib.__assign({}, Container$1, { children: jsxRuntime.exports.jsx(List, tslib.__assign({ id: ForkIdWithType(id, type) }, List$1, { sx: tslib.__assign({ display: 'flex', flexWrap: 'wrap', gap: "".concat(DEFAULT_GAP$1, "px") }, List$1 === null || List$1 === void 0 ? void 0 : List$1.sx) }, { children: data.items.map(function (item, idx) {
1893
+ var _b = Container$1 || {}, sx = _b.sx, containerProps = tslib.__rest(_b, ["sx"]);
1894
+ return (jsxRuntime.exports.jsx(Container, tslib.__assign({ sx: sx }, containerProps, { children: jsxRuntime.exports.jsx(List, tslib.__assign({ id: ForkIdWithType(id, type) }, List$1, { sx: tslib.__assign({ display: 'flex', flexWrap: 'wrap', gap: "".concat(DEFAULT_GAP$1, "px") }, List$1 === null || List$1 === void 0 ? void 0 : List$1.sx) }, { children: data.items.map(function (item, idx) {
1892
1895
  var _a, _b;
1893
1896
  return (jsxRuntime.exports.jsxs(ListItem, tslib.__assign({}, Item, { sx: tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign(tslib.__assign({ padding: '20px', borderRadius: '25px', backgroundColor: function (_) { return _.palette.background.default; }, border: '1px solid #EFF3FE', display: 'flex', flexWrap: 'nowrap', alignItems: 'center', columnGap: '5px', flexGrow: 0 }, (style === 'ordered' && {
1894
1897
  alignItems: 'center',
@@ -1906,13 +1909,15 @@ var ListNode = function (_a) {
1906
1909
  var ImageNode = function (_a) {
1907
1910
  var type = _a.type, data = _a.data, id = _a.id, Container$1 = _a.Container, Image$1 = _a.Image;
1908
1911
  var file = data.file, caption = data.caption, withBorder = data.withBorder, stretched = data.stretched, withBackground = data.withBackground;
1909
- return (jsxRuntime.exports.jsx(Container, tslib.__assign({ stretched: stretched }, Container$1, { children: jsxRuntime.exports.jsx(Image, tslib.__assign({ id: ForkIdWithType(id, type), src: file === null || file === void 0 ? void 0 : file.url, alt: caption, caption: caption, withBorder: withBorder, stretched: stretched, withBackground: withBackground }, Image$1), ForkIdWithType(id, type)) }), id));
1912
+ var _b = Container$1 || {}, sx = _b.sx, containerProps = tslib.__rest(_b, ["sx"]);
1913
+ return (jsxRuntime.exports.jsx(Container, tslib.__assign({ stretched: stretched, sx: sx }, containerProps, { children: jsxRuntime.exports.jsx(Image, tslib.__assign({ id: ForkIdWithType(id, type), src: file === null || file === void 0 ? void 0 : file.url, alt: caption, caption: caption, withBorder: withBorder, stretched: stretched, withBackground: withBackground }, Image$1), ForkIdWithType(id, type)) }), id));
1910
1914
  };
1911
1915
 
1912
1916
  var TableNode = function (_a) {
1913
1917
  var type = _a.type, data = _a.data, id = _a.id, Container$1 = _a.Container;
1914
1918
  var content = data.content;
1915
- return (jsxRuntime.exports.jsx(Container, tslib.__assign({}, Container$1, { children: jsxRuntime.exports.jsx(Table, tslib.__assign({ id: ForkIdWithType(id, type) }, { children: content.map(function (row, rowIdx) { return (
1919
+ var _b = Container$1 || {}, sx = _b.sx, containerProps = tslib.__rest(_b, ["sx"]);
1920
+ return (jsxRuntime.exports.jsx(Container, tslib.__assign({ sx: sx }, containerProps, { children: jsxRuntime.exports.jsx(Table, tslib.__assign({ id: ForkIdWithType(id, type) }, { children: content.map(function (row, rowIdx) { return (
1916
1921
  // eslint-disable-next-line react/no-array-index-key
1917
1922
  jsxRuntime.exports.jsx(TableRow, { children: row.map(function (cell, cellIdx) { return (
1918
1923
  // eslint-disable-next-line react/no-array-index-key
@@ -1921,43 +1926,51 @@ var TableNode = function (_a) {
1921
1926
 
1922
1927
  var DelimiterNode = function (_a) {
1923
1928
  var type = _a.type, id = _a.id, Delimiter$1 = _a.Delimiter, Container$1 = _a.Container;
1924
- return (jsxRuntime.exports.jsx(Container, tslib.__assign({}, Container$1, { children: jsxRuntime.exports.jsx(Delimiter, tslib.__assign({ id: ForkIdWithType(id, type) }, Delimiter$1)) }), id));
1929
+ var _b = Container$1 || {}, sx = _b.sx, containerProps = tslib.__rest(_b, ["sx"]);
1930
+ return (jsxRuntime.exports.jsx(Container, tslib.__assign({ sx: sx }, containerProps, { children: jsxRuntime.exports.jsx(Delimiter, tslib.__assign({ id: ForkIdWithType(id, type) }, Delimiter$1)) }), id));
1925
1931
  };
1926
1932
 
1927
1933
  var EmbedNode = function (_a) {
1928
1934
  var type = _a.type, data = _a.data, id = _a.id, Container$1 = _a.Container, Embed$1 = _a.Embed;
1929
1935
  // eslint-disable-next-line no-unused-vars
1930
1936
  data.service; data.source; var embed = data.embed, width = data.width, height = data.height; data.caption;
1931
- return (jsxRuntime.exports.jsx(Container, tslib.__assign({}, Container$1, { children: jsxRuntime.exports.jsx(Embed, tslib.__assign({ id: ForkIdWithType(id, type), src: embed, width: width, height: height }, Embed$1)) }), id));
1937
+ var _b = Container$1 || {}, sx = _b.sx, containerProps = tslib.__rest(_b, ["sx"]);
1938
+ return (jsxRuntime.exports.jsx(Container, tslib.__assign({ sx: sx }, containerProps, { children: jsxRuntime.exports.jsx(Embed, tslib.__assign({ id: ForkIdWithType(id, type), src: embed, width: width, height: height }, Embed$1)) }), id));
1932
1939
  };
1933
1940
 
1934
1941
  var RawNode = function (_a) {
1935
1942
  var type = _a.type, data = _a.data, id = _a.id, Container$1 = _a.Container, Raw$1 = _a.Raw;
1936
- return (jsxRuntime.exports.jsx(Container, tslib.__assign({}, Container$1, { children: jsxRuntime.exports.jsx(Raw, tslib.__assign({ id: ForkIdWithType(id, type) }, Raw$1, { children: data.html })) }), id));
1943
+ var _b = Container$1 || {}, sx = _b.sx, containerProps = tslib.__rest(_b, ["sx"]);
1944
+ return (jsxRuntime.exports.jsx(Container, tslib.__assign({ sx: sx }, containerProps, { children: jsxRuntime.exports.jsx(Raw, tslib.__assign({ id: ForkIdWithType(id, type) }, Raw$1, { children: data.html })) }), id));
1937
1945
  };
1938
1946
 
1939
1947
  var QuoteNode = function (_a) {
1940
1948
  var type = _a.type, data = _a.data, id = _a.id, Container$1 = _a.Container, Quote$1 = _a.Quote;
1941
- return (jsxRuntime.exports.jsx(Container, tslib.__assign({}, Container$1, { children: jsxRuntime.exports.jsx(Quote, tslib.__assign({ id: ForkIdWithType(id, type) }, Quote$1, { children: data.text })) }), id));
1949
+ var _b = Container$1 || {}, sx = _b.sx, containerProps = tslib.__rest(_b, ["sx"]);
1950
+ return (jsxRuntime.exports.jsx(Container, tslib.__assign({ sx: sx }, containerProps, { children: jsxRuntime.exports.jsx(Quote, tslib.__assign({ id: ForkIdWithType(id, type) }, Quote$1, { children: data.text })) }), id));
1942
1951
  };
1943
1952
 
1944
1953
  var CodeNode = function (_a) {
1945
1954
  var type = _a.type, data = _a.data, id = _a.id, Container$1 = _a.Container, Code$1 = _a.Code;
1946
1955
  var code = data.code;
1947
- return (jsxRuntime.exports.jsx(Container, tslib.__assign({}, Container$1, { children: jsxRuntime.exports.jsx(Code, tslib.__assign({ id: ForkIdWithType(id, type) }, Code$1, { children: code })) }), id));
1956
+ var _b = Container$1 || {}, sx = _b.sx, containerProps = tslib.__rest(_b, ["sx"]);
1957
+ return (jsxRuntime.exports.jsx(Container, tslib.__assign({ sx: sx }, containerProps, { children: jsxRuntime.exports.jsx(Code, tslib.__assign({ id: ForkIdWithType(id, type) }, Code$1, { children: code })) }), id));
1948
1958
  };
1949
1959
 
1950
1960
  var LinkNode = function (_a) {
1961
+ var _b;
1951
1962
  var type = _a.type, data = _a.data, id = _a.id, Container$1 = _a.Container, Link$1 = _a.Link;
1952
- var _b = data.meta, image = _b.image, title = _b.title, description = _b.description, site_name = _b.site_name, link = data.link;
1953
- return (jsxRuntime.exports.jsx(Container, tslib.__assign({}, Container$1, { children: jsxRuntime.exports.jsx(Link, tslib.__assign({ id: ForkIdWithType(id, type), image: image.url, title: title, description: description, siteName: site_name, href: link }, Link$1)) }), id));
1963
+ var _c = data.meta, image = _c.image, title = _c.title, description = _c.description, site_name = _c.site_name, link = data.link;
1964
+ var _d = Container$1 || {}, sx = _d.sx, containerProps = tslib.__rest(_d, ["sx"]);
1965
+ return (jsxRuntime.exports.jsx(Container, tslib.__assign({ sx: sx }, containerProps, { children: jsxRuntime.exports.jsx(Link, tslib.__assign({ id: ForkIdWithType(id, type), image: (_b = image === null || image === void 0 ? void 0 : image.url) !== null && _b !== void 0 ? _b : '', title: title !== null && title !== void 0 ? title : '', description: description !== null && description !== void 0 ? description : '', siteName: site_name, href: link !== null && link !== void 0 ? link : '' }, Link$1)) }), id));
1954
1966
  };
1955
1967
 
1956
1968
  var DEFAULT_GAP = 10;
1957
1969
  var CheckListNode = function (_a) {
1958
1970
  var type = _a.type, data = _a.data, id = _a.id, tunes = _a.tunes, Container$1 = _a.Container, CheckList$1 = _a.CheckList, Item = _a.Item;
1959
1971
  var items = data.items;
1960
- return (jsxRuntime.exports.jsx(Container, tslib.__assign({}, Container$1, { children: jsxRuntime.exports.jsx(CheckList, tslib.__assign({ id: ForkIdWithType(id, type) }, CheckList$1, { sx: tslib.__assign({ display: 'flex', flexWrap: 'wrap', gap: "".concat(DEFAULT_GAP, "px"), borderRadius: '25px', padding: '20px', backgroundColor: function (_) { return _.palette.background.default; }, border: '1px solid #EFF3FE' }, CheckList$1 === null || CheckList$1 === void 0 ? void 0 : CheckList$1.sx) }, { children: items.map(function (_a, idx) {
1972
+ var _b = Container$1 || {}, sx = _b.sx, containerProps = tslib.__rest(_b, ["sx"]);
1973
+ return (jsxRuntime.exports.jsx(Container, tslib.__assign({ sx: sx }, containerProps, { children: jsxRuntime.exports.jsx(CheckList, tslib.__assign({ id: ForkIdWithType(id, type) }, CheckList$1, { sx: tslib.__assign({ display: 'flex', flexWrap: 'wrap', gap: "".concat(DEFAULT_GAP, "px"), borderRadius: '25px', padding: '20px', backgroundColor: function (_) { return _.palette.background.default; }, border: '1px solid #EFF3FE' }, CheckList$1 === null || CheckList$1 === void 0 ? void 0 : CheckList$1.sx) }, { children: items.map(function (_a, idx) {
1961
1974
  var _b, _c;
1962
1975
  var checked = _a.checked, text = _a.text;
1963
1976
  return (jsxRuntime.exports.jsxs(CheckListItem, tslib.__assign({}, Item, { sx: tslib.__assign(tslib.__assign(tslib.__assign({ display: 'flex', alignItems: 'center', flexWrap: 'nowrap', flexGrow: 0, columnGap: '5px', flexBasis: getFlexBasis(1, DEFAULT_GAP) }, (((_b = tunes === null || tunes === void 0 ? void 0 : tunes.columnTune) === null || _b === void 0 ? void 0 : _b.size) === 'two-columns' && {