@builder.io/sdk-react-native 0.0.1-37 → 0.0.1-38
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.
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.0.1-
|
|
4
|
+
"version": "0.0.1-38",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"release:dev": "npm version prerelease --no-git-tag-version && npm publish --tag dev --access public"
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { evaluate } from './evaluate';
|
|
3
|
-
|
|
4
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
5
|
-
}
|
|
3
|
+
import { getEventHandlerName } from './name-event-handlers';
|
|
6
4
|
function getBlockActions(options) {
|
|
7
5
|
const obj = {};
|
|
8
6
|
if (options.block.actions) {
|
|
@@ -11,7 +9,7 @@ function getBlockActions(options) {
|
|
|
11
9
|
continue;
|
|
12
10
|
}
|
|
13
11
|
const value = options.block.actions[key];
|
|
14
|
-
obj[
|
|
12
|
+
obj[getEventHandlerName(key)] = (event) =>
|
|
15
13
|
evaluate({
|
|
16
14
|
code: value,
|
|
17
15
|
context: options.context,
|
|
@@ -26,8 +26,10 @@ var __spreadValues = (a, b) => {
|
|
|
26
26
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
27
27
|
import { evaluate } from './evaluate';
|
|
28
28
|
import { set } from './set';
|
|
29
|
+
import { transformBlock } from './transform-block';
|
|
29
30
|
function getProcessedBlock(options) {
|
|
30
|
-
const {
|
|
31
|
+
const { state, context } = options;
|
|
32
|
+
const block = transformBlock(options.block);
|
|
31
33
|
if (!block.bindings) {
|
|
32
34
|
return block;
|
|
33
35
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) =>
|
|
9
|
+
key in obj
|
|
10
|
+
? __defProp(obj, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
writable: true,
|
|
14
|
+
value,
|
|
15
|
+
})
|
|
16
|
+
: (obj[key] = value);
|
|
17
|
+
var __spreadValues = (a, b) => {
|
|
18
|
+
for (var prop in b || (b = {}))
|
|
19
|
+
if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
20
|
+
if (__getOwnPropSymbols)
|
|
21
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
22
|
+
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
|
|
23
|
+
}
|
|
24
|
+
return a;
|
|
25
|
+
};
|
|
26
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
27
|
+
function transformBlock(block) {
|
|
28
|
+
if (block.id.startsWith('builder-pixel-')) {
|
|
29
|
+
return __spreadProps(__spreadValues({}, block), {
|
|
30
|
+
component: {
|
|
31
|
+
name: 'Image',
|
|
32
|
+
options: {
|
|
33
|
+
image: block.properties.src,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return block;
|
|
39
|
+
}
|
|
40
|
+
export { transformBlock };
|
package/src/index.js
CHANGED
|
@@ -6,21 +6,25 @@ if (isEditing()) {
|
|
|
6
6
|
import { default as default2 } from './blocks/columns';
|
|
7
7
|
import { default as default3 } from './blocks/image';
|
|
8
8
|
import { default as default4 } from './blocks/text';
|
|
9
|
-
import { default as default5 } from './blocks/
|
|
10
|
-
import { default as default6 } from './blocks/
|
|
11
|
-
import { default as default7 } from './blocks/
|
|
12
|
-
import { default as default8 } from './
|
|
9
|
+
import { default as default5 } from './blocks/video';
|
|
10
|
+
import { default as default6 } from './blocks/symbol';
|
|
11
|
+
import { default as default7 } from './blocks/button';
|
|
12
|
+
import { default as default8 } from './blocks/section';
|
|
13
|
+
import { default as default9 } from './blocks/fragment';
|
|
14
|
+
import { default as default10 } from './components/render-content';
|
|
13
15
|
export * from './functions/is-editing';
|
|
14
16
|
export * from './functions/register-component';
|
|
15
17
|
export * from './functions/register';
|
|
16
18
|
export * from './functions/set-editor-settings';
|
|
17
19
|
export * from './functions/get-content';
|
|
18
20
|
export {
|
|
21
|
+
default7 as Button,
|
|
19
22
|
default2 as Columns,
|
|
20
|
-
|
|
23
|
+
default9 as Fragment,
|
|
21
24
|
default3 as Image,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
default10 as RenderContent,
|
|
26
|
+
default8 as Section,
|
|
27
|
+
default6 as Symbol,
|
|
25
28
|
default4 as Text,
|
|
29
|
+
default5 as Video,
|
|
26
30
|
};
|