@dotcms/react 1.3.0-next.1 → 1.3.0-next.2

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.
@@ -11,11 +11,38 @@ const DotCMSImage = ({
11
11
  }) => {
12
12
  const {
13
13
  src,
14
- alt
14
+ alt,
15
+ textWrap,
16
+ textAlign
15
17
  } = node.attrs;
16
- return jsx("img", {
17
- alt: alt,
18
- src: src
18
+ let wrapperStyle = {};
19
+ if (textWrap === 'left') {
20
+ wrapperStyle = {
21
+ float: 'left',
22
+ width: '50%',
23
+ margin: '0 1rem 1rem 0'
24
+ };
25
+ } else if (textWrap === 'right') {
26
+ wrapperStyle = {
27
+ float: 'right',
28
+ width: '50%',
29
+ margin: '0 0 1rem 1rem'
30
+ };
31
+ } else if (textAlign) {
32
+ wrapperStyle = {
33
+ textAlign: textAlign
34
+ };
35
+ }
36
+ return jsx("figure", {
37
+ style: wrapperStyle,
38
+ children: jsx("img", {
39
+ alt: alt,
40
+ src: src,
41
+ style: textWrap ? {
42
+ maxWidth: '100%',
43
+ height: 'auto'
44
+ } : undefined
45
+ })
19
46
  });
20
47
  };
21
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcms/react",
3
- "version": "1.3.0-next.1",
3
+ "version": "1.3.0-next.2",
4
4
  "peerDependencies": {
5
5
  "react": ">=18",
6
6
  "react-dom": ">=18"