react-jsbox
Advanced tools
Comparing version 1.1.5-beta to 1.1.5
{ | ||
"name": "react-jsbox", | ||
"version": "1.1.5-beta", | ||
"version": "1.1.5", | ||
"description": "A custom React renderer for writing JSBox apps in React.", | ||
@@ -27,9 +27,9 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/core": "^7.10.3", | ||
"@babel/plugin-proposal-class-properties": "^7.10.1", | ||
"@babel/plugin-proposal-decorators": "^7.10.3", | ||
"@babel/plugin-transform-runtime": "^7.10.3", | ||
"@babel/preset-env": "^7.10.3", | ||
"@babel/preset-react": "^7.10.1", | ||
"@babel/runtime": "^7.10.3", | ||
"@babel/core": "^7.10.4", | ||
"@babel/plugin-proposal-class-properties": "^7.10.4", | ||
"@babel/plugin-proposal-decorators": "^7.10.4", | ||
"@babel/plugin-transform-runtime": "^7.10.4", | ||
"@babel/preset-env": "^7.10.4", | ||
"@babel/preset-react": "^7.10.4", | ||
"@babel/runtime": "^7.10.4", | ||
"babel-eslint": "^10.1.0", | ||
@@ -39,9 +39,9 @@ "babel-plugin-annotate-pure-calls": "^0.4.0", | ||
"eslint": "^7.3.1", | ||
"eslint-plugin-babel": "^5.3.0", | ||
"eslint-plugin-babel": "^5.3.1", | ||
"eslint-plugin-import": "^2.22.0", | ||
"eslint-plugin-jsbox": "^0.1.1", | ||
"eslint-plugin-react-hooks": "^4.0.4", | ||
"eslint-plugin-react-hooks": "^4.0.5", | ||
"husky": "^4.2.5", | ||
"react": "^16.13.1", | ||
"rollup": "^2.18.1", | ||
"rollup": "^2.18.2", | ||
"rollup-plugin-babel": "^4.4.0", | ||
@@ -48,0 +48,0 @@ "rollup-plugin-cleanup": "^3.1.1", |
import {hasOwnProperty} from '../helper' | ||
import {HIGHLIGHT_UPDATES_COLORS} from '../constants' | ||
export default class View { | ||
constructor(type, props) { | ||
const {layout, events, animate, borderWidth = 0, borderColor = null} = props | ||
const {layout, events, animate} = props | ||
this._element = $ui.create({ | ||
@@ -13,4 +12,2 @@ type, | ||
this._animate = animate | ||
this._borderWidth = borderWidth | ||
this._borderColor = borderColor | ||
} | ||
@@ -22,6 +19,2 @@ | ||
_borderWidth = null | ||
_borderColor = null | ||
get element() { | ||
@@ -32,3 +25,3 @@ return this._element | ||
appendChild(child) { | ||
this.element.ocValue().$addSubview(child.element) | ||
this.element.add(child.element) | ||
} | ||
@@ -41,3 +34,3 @@ | ||
insertBefore(child, beforeChild) { | ||
this.element.ocValue().$insertSubview_belowSubview(child.element, beforeChild.element) | ||
this.element.insertBelow(child.element, beforeChild.element) | ||
} | ||
@@ -47,18 +40,2 @@ | ||
const element = this.element | ||
const __REACT_JSBOX_HIGHLIGHT_UPDATES__ = global.__REACT_JSBOX_HIGHLIGHT_UPDATES__ | ||
if (__REACT_JSBOX_HIGHLIGHT_UPDATES__) { | ||
if (hasOwnProperty.call(updatePayload, 'borderWidth')) { | ||
this._borderWidth = updatePayload.borderWidth | ||
} | ||
if (hasOwnProperty.call(updatePayload, 'borderColor')) { | ||
this._borderColor = updatePayload._borderColor | ||
} | ||
const color = HIGHLIGHT_UPDATES_COLORS[0] | ||
element.borderWidth = Math.max(this._borderWidth, 1) | ||
element.borderColor = $color(color) | ||
setTimeout(() => { | ||
element.borderWidth = this._borderWidth | ||
element.borderColor = this._borderColor | ||
}, 300) | ||
} | ||
if (hasOwnProperty.call(updatePayload, 'animate')) { | ||
@@ -65,0 +42,0 @@ this._animate = updatePayload.animate |
@@ -81,3 +81,3 @@ import view from './components/view' | ||
const parent = parentInstance.element || parentInstance | ||
parent.ocValue().$addSubview(child.element) | ||
parent.add(child.element) | ||
}, | ||
@@ -101,3 +101,3 @@ | ||
const parent = parentInstance.element || parentInstance | ||
parent.ocValue().$insertSubview_belowSubview(child.element, beforeChild.element) | ||
parent.insertBelow(child.element, beforeChild.element) | ||
}, | ||
@@ -104,0 +104,0 @@ |
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2
109208
23
716