-
Build UI interfaces using HTML5 Canvas/WebGL and React
+
Build UI interfaces using WebAssembly, Canvas and React
React Ape lets you build Canvas apps using React. React Ape uses the
same design as React, letting you compose a rich UI from declarative
@@ -107,18 +107,17 @@ const DefinitionCallout = () =>
{`\`\`\`javascript
import React, { Component } from 'react';
-import { Text, View } from 'react-ape';
+import { Text, View, Platform } from 'react-ape';
class ReactApeComponent extends Component {
render() {
return (
- Render this text on Canvas
+ Render this text with WASM on Canvas
- You just use React Ape components like 'View' and 'Text',
- just like React Native.
+ { Platform('webos') && 'You are rendering in a LG WebOS' }
);
diff --git a/scripts/prettier/index.js b/scripts/prettier/index.js
index 28c7c77..17c8d7d 100644
--- a/scripts/prettier/index.js
+++ b/scripts/prettier/index.js
@@ -62,7 +62,7 @@ const changedFiles = new Set(
]).match(/[^\0]+/g)
);
-Object.keys(config).forEach((key) => {
+Object.keys(config).forEach(key => {
const patterns = config[key].patterns;
const options = config[key].options;
const ignore = config[key].ignore;
@@ -71,14 +71,14 @@ Object.keys(config).forEach((key) => {
patterns.length > 1 ? `{${patterns.join(',')}}` : `${patterns.join(',')}`;
const files = glob
.sync(globPattern, {ignore})
- .filter((f) => !onlyChanged || changedFiles.has(f));
+ .filter(f => !onlyChanged || changedFiles.has(f));
if (!files.length) {
return;
}
const args = Object.keys(defaultOptions).map(
- (k) => `--${k}=${(options && options[k]) || defaultOptions[k]}`
+ k => `--${k}=${(options && options[k]) || defaultOptions[k]}`
);
args.push(`--${shouldWrite ? 'write' : 'l'}`);
diff --git a/scripts/rollup/index.js b/scripts/rollup/index.js
index 82cc9ce..125753c 100644
--- a/scripts/rollup/index.js
+++ b/scripts/rollup/index.js
@@ -95,7 +95,7 @@ function createBundle({entryPath, bundleType, destName}) {
external: ['react'],
input: entryPath,
plugins: plugins,
- }).then((bundle) => {
+ }).then(bundle => {
tasks.push(
bundle.write({
format: 'umd',
@@ -110,17 +110,17 @@ function createBundle({entryPath, bundleType, destName}) {
}
createBundle({
- entryPath: `${packagePath}/reactApeEntry.js`,
+ entryPath: `${packagePath}/entry.js`,
bundleType: 'production',
destName: 'react-ape.production.js',
});
createBundle({
- entryPath: `${packagePath}/reactApeEntry.js`,
+ entryPath: `${packagePath}/entry.js`,
bundleType: 'development',
destName: 'react-ape.development.js',
});
-Promise.all(tasks).catch((error) => {
+Promise.all(tasks).catch(error => {
Promise.reject(error);
});
diff --git a/scripts/rollup/plugins/closure-plugin.js b/scripts/rollup/plugins/closure-plugin.js
index cd200ad..9ad96b1 100644
--- a/scripts/rollup/plugins/closure-plugin.js
+++ b/scripts/rollup/plugins/closure-plugin.js
@@ -7,7 +7,7 @@ const writeFileAsync = promisify(fs.writeFile);
function compile(flags) {
return new Promise((resolve, reject) => {
const closureCompiler = new ClosureCompiler(flags);
- closureCompiler.run(function (exitCode, stdOut, stdErr) {
+ closureCompiler.run(function(exitCode, stdOut, stdErr) {
if (!stdErr) {
resolve(stdOut);
} else {
diff --git a/specs/images/view-spec-relative-root.png b/specs/images/view-spec-relative-root.png
new file mode 100644
index 0000000..a281108
Binary files /dev/null and b/specs/images/view-spec-relative-root.png differ
diff --git a/specs/view-spec.md b/specs/view-spec.md
new file mode 100644
index 0000000..977215e
--- /dev/null
+++ b/specs/view-spec.md
@@ -0,0 +1,27 @@
+# View
+
+## Defaults
+
+- `position: relative`
+
+## Specs
+
+### 01 - Relative should be respected in Views of the same root level
+
+- [See the test code](https://github.com/raphamorim/react-ape/blob/main/packages/react-ape/__tests__/specs/view-test.js)
+
+```jsx
+return [
+ ,
+ ,
+
+];
+```
+
+
\ No newline at end of file