@builder.io/sdk-react-native 0.5.6-1 → 0.5.7

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.
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- const SDK_VERSION = "UNKNOWN_VERSION";
5
- exports.SDK_VERSION = SDK_VERSION;
4
+ exports.SDK_VERSION = "0.5.7";
@@ -6,12 +6,16 @@ const react_dom_1 = require("react-dom");
6
6
  function transformBlockProperties(block) {
7
7
  block.className = block.class;
8
8
  delete block.class;
9
+ const id = block["builder-id"];
10
+ if (!id && (0, is_editing_js_1.isEditing)()) {
11
+ console.warn("No builder-id found on block", block);
12
+ }
9
13
  block.ref = (ref) => {
10
14
  if ((0, is_editing_js_1.isEditing)()) {
11
15
  const el = (0, react_dom_1.findDOMNode)(ref);
12
16
  if (el) {
13
- el.setAttribute("builder-id", block.id);
14
- el.classList.add(block.id);
17
+ el.setAttribute("builder-id", id);
18
+ el.classList.add(id);
15
19
  }
16
20
  }
17
21
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-react-native",
3
3
  "description": "Builder.io SDK for React Native",
4
- "version": "0.5.6-1",
4
+ "version": "0.5.7",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -1,2 +1 @@
1
- const SDK_VERSION = "UNKNOWN_VERSION";
2
- export { SDK_VERSION }
1
+ export const SDK_VERSION = "0.5.7"
@@ -3,12 +3,16 @@ import { findDOMNode } from "react-dom";
3
3
  function transformBlockProperties(block) {
4
4
  block.className = block.class;
5
5
  delete block.class;
6
+ const id = block["builder-id"];
7
+ if (!id && isEditing()) {
8
+ console.warn("No builder-id found on block", block);
9
+ }
6
10
  block.ref = (ref) => {
7
11
  if (isEditing()) {
8
12
  const el = findDOMNode(ref);
9
13
  if (el) {
10
- el.setAttribute("builder-id", block.id);
11
- el.classList.add(block.id);
14
+ el.setAttribute("builder-id", id);
15
+ el.classList.add(id);
12
16
  }
13
17
  }
14
18
  };