@dotcms/react 0.0.1-alpha.12 → 0.0.1-alpha.13

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.
Files changed (2) hide show
  1. package/index.esm.js +16 -30
  2. package/package.json +2 -2
package/index.esm.js CHANGED
@@ -1749,29 +1749,6 @@ var css_248z = ".column-module_col-start-1__GK-q- {\n grid-column-start: 1;\n
1749
1749
  var styles = {"col-start-1":"column-module_col-start-1__GK-q-","col-start-2":"column-module_col-start-2__1DmkY","col-start-3":"column-module_col-start-3__HNEPh","col-start-4":"column-module_col-start-4__oCAwh","col-start-5":"column-module_col-start-5__re1rB","col-start-6":"column-module_col-start-6__dkB4w","col-start-7":"column-module_col-start-7__kEfJb","col-start-8":"column-module_col-start-8__Yx31z","col-start-9":"column-module_col-start-9__9YiVY","col-start-10":"column-module_col-start-10__6AFbk","col-start-11":"column-module_col-start-11__LP24D","col-start-12":"column-module_col-start-12__8p0QS","col-end-1":"column-module_col-end-1__G9axv","col-end-2":"column-module_col-end-2__pYjHG","col-end-3":"column-module_col-end-3__4woe6","col-end-4":"column-module_col-end-4__zlBaT","col-end-5":"column-module_col-end-5__aC-y8","col-end-6":"column-module_col-end-6__YljAP","col-end-7":"column-module_col-end-7__lpQrW","col-end-8":"column-module_col-end-8__F6UVd","col-end-9":"column-module_col-end-9__kvQ3T","col-end-10":"column-module_col-end-10__XJhrd","col-end-11":"column-module_col-end-11__nx-lF","col-end-12":"column-module_col-end-12__LIRnk","col-end-13":"column-module_col-end-13__0p7YI"};
1750
1750
  styleInject(css_248z);
1751
1751
 
1752
- const FAKE_CONTENLET = {
1753
- identifier: 'TEMP_EMPTY_CONTENTLET',
1754
- title: 'TEMP_EMPTY_CONTENTLET',
1755
- contentType: 'TEMP_EMPTY_CONTENTLET_TYPE',
1756
- inode: 'TEMPY_EMPTY_CONTENTLET_INODE',
1757
- widgetTitle: 'TEMP_EMPTY_CONTENTLET',
1758
- onNumberOfPages: 1
1759
- };
1760
- function EmptyContainer() {
1761
- return jsx("div", {
1762
- "data-testid": "empty-container",
1763
- style: {
1764
- width: '100%',
1765
- backgroundColor: '#ECF0FD',
1766
- display: 'flex',
1767
- justifyContent: 'center',
1768
- alignItems: 'center',
1769
- color: '#030E32',
1770
- height: '10rem'
1771
- },
1772
- children: "This container is empty."
1773
- });
1774
- }
1775
1752
  function NoContent({
1776
1753
  contentType
1777
1754
  }) {
@@ -1802,7 +1779,6 @@ function Container({
1802
1779
  variantId,
1803
1780
  path
1804
1781
  } = getContainersData(containers, containerRef);
1805
- const updatedContentlets = contentlets.length === 0 && isInsideEditor ? [FAKE_CONTENLET] : contentlets;
1806
1782
  const container = {
1807
1783
  acceptTypes,
1808
1784
  identifier: path != null ? path : identifier,
@@ -1810,9 +1786,17 @@ function Container({
1810
1786
  variantId,
1811
1787
  uuid
1812
1788
  };
1813
- const renderContentlets = updatedContentlets.map(contentlet => {
1814
- const ContentTypeComponent = components[contentlet.contentType] || NoContent;
1815
- const Component = contentlet.identifier === 'TEMP_EMPTY_CONTENTLET' ? EmptyContainer : ContentTypeComponent;
1789
+ const containerStyles = contentlets.length ? undefined : {
1790
+ width: '100%',
1791
+ backgroundColor: '#ECF0FD',
1792
+ display: 'flex',
1793
+ justifyContent: 'center',
1794
+ alignItems: 'center',
1795
+ color: '#030E32',
1796
+ height: '10rem'
1797
+ };
1798
+ const ContainerChildren = contentlets.map(contentlet => {
1799
+ const Component = components[contentlet.contentType] || NoContent;
1816
1800
  return isInsideEditor ? jsx("div", {
1817
1801
  "data-dot-object": "contentlet",
1818
1802
  "data-dot-identifier": contentlet.identifier,
@@ -1827,16 +1811,18 @@ function Container({
1827
1811
  })));
1828
1812
  });
1829
1813
  return isInsideEditor ? jsx("div", {
1814
+ "data-testid": "dot-container",
1830
1815
  "data-dot-object": "container",
1831
1816
  "data-dot-accept-types": acceptTypes,
1832
1817
  "data-dot-identifier": path != null ? path : identifier,
1833
1818
  "data-max-contentlets": maxContentlets,
1834
- "data-uuid": uuid,
1835
- children: renderContentlets
1819
+ "data-dot-uuid": uuid,
1820
+ style: containerStyles,
1821
+ children: ContainerChildren.length ? ContainerChildren : 'This container is empty.'
1836
1822
  }) :
1837
1823
  // eslint-disable-next-line react/jsx-no-useless-fragment
1838
1824
  jsx(Fragment, {
1839
- children: renderContentlets
1825
+ children: ContainerChildren
1840
1826
  });
1841
1827
  }
1842
1828
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dotcms/react",
3
- "version": "0.0.1-alpha.12",
3
+ "version": "0.0.1-alpha.13",
4
4
  "peerDependencies": {
5
5
  "react": ">=18",
6
6
  "react-dom": ">=18",
7
- "@dotcms/client": "0.0.1-alpha.12"
7
+ "@dotcms/client": "0.0.1-alpha.13"
8
8
  },
9
9
  "description": "Official React Components library to render a dotCMS page.",
10
10
  "repository": {