@pushwoosh/dumb-components 1.0.58 → 1.0.60

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.
@@ -48,6 +48,7 @@ export function PushPreview(props) {
48
48
  view: view,
49
49
  locked: !content
50
50
  }, !content ? 'Message is empty…' : React.createElement(RichMessageViewer, {
51
+ flat: view === 'compact',
51
52
  value: content
52
53
  }))));
53
54
  }
@@ -22,9 +22,21 @@ const DynamicContentElementComponent = ({
22
22
  "$onClose": event => {
23
23
  event.preventDefault();
24
24
  event.stopPropagation();
25
- const path = findPath(editor.children, element);
25
+ const [paragraphIndex, elementIndex] = findPath(editor.children, element);
26
+ if (selected) {
27
+ var _editor$children$para;
28
+ const prevOffset = ((_editor$children$para = editor.children[paragraphIndex].children[elementIndex - 1]) === null || _editor$children$para === void 0 ? void 0 : _editor$children$para.text.length) || 0;
29
+ const point = {
30
+ path: [paragraphIndex, elementIndex - 1],
31
+ offset: prevOffset
32
+ };
33
+ Transforms.select(editor, {
34
+ anchor: point,
35
+ focus: point
36
+ });
37
+ }
26
38
  Transforms.delete(editor, {
27
- at: path
39
+ at: [paragraphIndex, elementIndex]
28
40
  });
29
41
  }
30
42
  }, React.createElement("span", null, tagName || 'Not set'), children);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.0.58",
3
+ "version": "1.0.60",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",