embedded-react 0.1.1 → 0.2.0
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/LICENSE +201 -201
- package/README.md +268 -238
- package/aot/compile.mjs +2 -2
- package/aot/screenshot-smoke.mjs +110 -110
- package/assets/emit-pack.mjs +1 -1
- package/cli.mjs +147 -0
- package/package.json +12 -5
- package/persist-transform.mjs +1 -1
- package/sim/embedded-react.js +2 -0
- package/sim/embedded-react.wasm +0 -0
- package/sim/index.html +387 -0
- package/sim-server.mjs +242 -0
- package/src/embedded-react/Animated.js +357 -352
- package/src/embedded-react/AppRegistry.js +49 -49
- package/src/embedded-react/Easing.js +39 -39
- package/src/embedded-react/LayoutAnimation.js +45 -45
- package/src/embedded-react/Platform.js +26 -26
- package/src/embedded-react/StyleSheet.js +36 -36
- package/src/embedded-react/components.js +44 -44
- package/src/embedded-react/index.js +52 -52
- package/src/embedded-react/layout-anim-config.js +91 -91
- package/src/embedded-react/split-style.js +58 -58
- package/src/embedded-react/usePersistentState.js +2 -2
- package/src/host-config.js +196 -196
- package/src/native-ui.js +24 -24
- package/src/props.js +183 -183
- package/src/renderer.js +57 -57
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2026 Cory Lamming
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
// AppRegistry — the RN entry point. An app registers a root component; the runtime mounts it into
|
|
18
|
-
// a screen-sized container.
|
|
19
|
-
//
|
|
20
|
-
// In React Native the native side calls runApplication when the activity starts. Our host model is
|
|
21
|
-
// "running the bundle IS starting the app", so registerComponent mounts immediately into a root
|
|
22
|
-
// sized from the host-injected `screen` global. (A host-driven runApplication can be split out
|
|
23
|
-
// later when the C host owns app lifecycle.)
|
|
24
|
-
import { createElement } from 'react';
|
|
25
|
-
import { createRoot } from '../renderer.js';
|
|
26
|
-
|
|
27
|
-
let registered = null;
|
|
28
|
-
|
|
29
|
-
export const AppRegistry = {
|
|
30
|
-
/**
|
|
31
|
-
* Registers a root component and mounts it. `componentProvider` is a zero-arg function returning
|
|
32
|
-
* the component (RN signature), so the component module isn't evaluated until registration.
|
|
33
|
-
*/
|
|
34
|
-
registerComponent(appKey, componentProvider) {
|
|
35
|
-
registered = { appKey, Component: componentProvider() };
|
|
36
|
-
AppRegistry.runApplication(appKey);
|
|
37
|
-
return appKey;
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Mounts the registered root component into a fresh screen-sized container.
|
|
42
|
-
*/
|
|
43
|
-
runApplication(appKey) {
|
|
44
|
-
if (!registered) return;
|
|
45
|
-
if (appKey && appKey !== registered.appKey) return;
|
|
46
|
-
const root = createRoot({ width: screen.width, height: screen.height });
|
|
47
|
-
root.render(createElement(registered.Component));
|
|
48
|
-
},
|
|
49
|
-
};
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Cory Lamming
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// AppRegistry — the RN entry point. An app registers a root component; the runtime mounts it into
|
|
18
|
+
// a screen-sized container.
|
|
19
|
+
//
|
|
20
|
+
// In React Native the native side calls runApplication when the activity starts. Our host model is
|
|
21
|
+
// "running the bundle IS starting the app", so registerComponent mounts immediately into a root
|
|
22
|
+
// sized from the host-injected `screen` global. (A host-driven runApplication can be split out
|
|
23
|
+
// later when the C host owns app lifecycle.)
|
|
24
|
+
import { createElement } from 'react';
|
|
25
|
+
import { createRoot } from '../renderer.js';
|
|
26
|
+
|
|
27
|
+
let registered = null;
|
|
28
|
+
|
|
29
|
+
export const AppRegistry = {
|
|
30
|
+
/**
|
|
31
|
+
* Registers a root component and mounts it. `componentProvider` is a zero-arg function returning
|
|
32
|
+
* the component (RN signature), so the component module isn't evaluated until registration.
|
|
33
|
+
*/
|
|
34
|
+
registerComponent(appKey, componentProvider) {
|
|
35
|
+
registered = { appKey, Component: componentProvider() };
|
|
36
|
+
AppRegistry.runApplication(appKey);
|
|
37
|
+
return appKey;
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Mounts the registered root component into a fresh screen-sized container.
|
|
42
|
+
*/
|
|
43
|
+
runApplication(appKey) {
|
|
44
|
+
if (!registered) return;
|
|
45
|
+
if (appKey && appKey !== registered.appKey) return;
|
|
46
|
+
const root = createRoot({ width: screen.width, height: screen.height });
|
|
47
|
+
root.render(createElement(registered.Component));
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2026 Cory Lamming
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
// Easing tokens. The engine implements a fixed set of easing curves (ERAnimEasing), so unlike RN's
|
|
18
|
-
// composable Easing functions these are string tokens the bridge maps to the engine enum. `bezier`
|
|
19
|
-
// returns a control-point object the bridge reads as a custom cubic-bezier curve.
|
|
20
|
-
export const Easing = {
|
|
21
|
-
linear: 'linear',
|
|
22
|
-
ease: 'ease',
|
|
23
|
-
easeIn: 'easeIn',
|
|
24
|
-
easeOut: 'easeOut',
|
|
25
|
-
easeInOut: 'easeInOut',
|
|
26
|
-
quadIn: 'quadIn',
|
|
27
|
-
quadOut: 'quadOut',
|
|
28
|
-
quadInOut: 'quadInOut',
|
|
29
|
-
cubicIn: 'cubicIn',
|
|
30
|
-
cubicOut: 'cubicOut',
|
|
31
|
-
cubicInOut: 'cubicInOut',
|
|
32
|
-
bounceOut: 'bounceOut',
|
|
33
|
-
elasticOut: 'elasticOut',
|
|
34
|
-
|
|
35
|
-
/** Custom cubic-bezier curve via control points. */
|
|
36
|
-
bezier(x1, y1, x2, y2) {
|
|
37
|
-
return { x1, y1, x2, y2 };
|
|
38
|
-
},
|
|
39
|
-
};
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Cory Lamming
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// Easing tokens. The engine implements a fixed set of easing curves (ERAnimEasing), so unlike RN's
|
|
18
|
+
// composable Easing functions these are string tokens the bridge maps to the engine enum. `bezier`
|
|
19
|
+
// returns a control-point object the bridge reads as a custom cubic-bezier curve.
|
|
20
|
+
export const Easing = {
|
|
21
|
+
linear: 'linear',
|
|
22
|
+
ease: 'ease',
|
|
23
|
+
easeIn: 'easeIn',
|
|
24
|
+
easeOut: 'easeOut',
|
|
25
|
+
easeInOut: 'easeInOut',
|
|
26
|
+
quadIn: 'quadIn',
|
|
27
|
+
quadOut: 'quadOut',
|
|
28
|
+
quadInOut: 'quadInOut',
|
|
29
|
+
cubicIn: 'cubicIn',
|
|
30
|
+
cubicOut: 'cubicOut',
|
|
31
|
+
cubicInOut: 'cubicInOut',
|
|
32
|
+
bounceOut: 'bounceOut',
|
|
33
|
+
elasticOut: 'elasticOut',
|
|
34
|
+
|
|
35
|
+
/** Custom cubic-bezier curve via control points. */
|
|
36
|
+
bezier(x1, y1, x2, y2) {
|
|
37
|
+
return { x1, y1, x2, y2 };
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2026 Cory Lamming
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
// LayoutAnimation — the React Native analog. Calling configureNext(...) before a state update that
|
|
18
|
-
// changes layout makes the engine tween every node whose computed rect moved (instead of snapping)
|
|
19
|
-
// on the next commit. Backed by the engine's er_layout_anim_configure_next; the tween advances in C
|
|
20
|
-
// each frame (er_layout_anim_tick), so there's no per-frame JS.
|
|
21
|
-
import { NativeUI } from '../native-ui.js';
|
|
22
|
-
import { Types, Properties, Presets, toEngineConfig, create } from './layout-anim-config.js';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Arms a layout animation for the next commit. Call right before the setState that changes layout.
|
|
26
|
-
* onAnimationDidEnd is approximated with a timer (the engine config carries no completion hook).
|
|
27
|
-
*/
|
|
28
|
-
export function configureNext(config, onAnimationDidEnd) {
|
|
29
|
-
NativeUI.configureNextLayoutAnimation(toEngineConfig(config));
|
|
30
|
-
if (typeof onAnimationDidEnd === 'function') {
|
|
31
|
-
const ms = config && typeof config.duration === 'number' ? config.duration : 300;
|
|
32
|
-
setTimeout(onAnimationDidEnd, ms);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const LayoutAnimation = {
|
|
37
|
-
configureNext,
|
|
38
|
-
create,
|
|
39
|
-
Types,
|
|
40
|
-
Properties,
|
|
41
|
-
Presets,
|
|
42
|
-
easeInEaseOut: (onDone) => configureNext(Presets.easeInEaseOut, onDone),
|
|
43
|
-
linear: (onDone) => configureNext(Presets.linear, onDone),
|
|
44
|
-
spring: (onDone) => configureNext(Presets.spring, onDone),
|
|
45
|
-
};
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Cory Lamming
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// LayoutAnimation — the React Native analog. Calling configureNext(...) before a state update that
|
|
18
|
+
// changes layout makes the engine tween every node whose computed rect moved (instead of snapping)
|
|
19
|
+
// on the next commit. Backed by the engine's er_layout_anim_configure_next; the tween advances in C
|
|
20
|
+
// each frame (er_layout_anim_tick), so there's no per-frame JS.
|
|
21
|
+
import { NativeUI } from '../native-ui.js';
|
|
22
|
+
import { Types, Properties, Presets, toEngineConfig, create } from './layout-anim-config.js';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Arms a layout animation for the next commit. Call right before the setState that changes layout.
|
|
26
|
+
* onAnimationDidEnd is approximated with a timer (the engine config carries no completion hook).
|
|
27
|
+
*/
|
|
28
|
+
export function configureNext(config, onAnimationDidEnd) {
|
|
29
|
+
NativeUI.configureNextLayoutAnimation(toEngineConfig(config));
|
|
30
|
+
if (typeof onAnimationDidEnd === 'function') {
|
|
31
|
+
const ms = config && typeof config.duration === 'number' ? config.duration : 300;
|
|
32
|
+
setTimeout(onAnimationDidEnd, ms);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const LayoutAnimation = {
|
|
37
|
+
configureNext,
|
|
38
|
+
create,
|
|
39
|
+
Types,
|
|
40
|
+
Properties,
|
|
41
|
+
Presets,
|
|
42
|
+
easeInEaseOut: (onDone) => configureNext(Presets.easeInEaseOut, onDone),
|
|
43
|
+
linear: (onDone) => configureNext(Presets.linear, onDone),
|
|
44
|
+
spring: (onDone) => configureNext(Presets.spring, onDone),
|
|
45
|
+
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2026 Cory Lamming
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
// Platform — minimal RN analog. OS is "embedded"; select() picks the embedded entry (falling back
|
|
18
|
-
// to default) so apps can write Platform.select({ embedded: ..., default: ... }).
|
|
19
|
-
export const Platform = {
|
|
20
|
-
OS: 'embedded',
|
|
21
|
-
select(specifics) {
|
|
22
|
-
if (specifics == null) return undefined;
|
|
23
|
-
if ('embedded' in specifics) return specifics.embedded;
|
|
24
|
-
return specifics.default;
|
|
25
|
-
},
|
|
26
|
-
};
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Cory Lamming
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// Platform — minimal RN analog. OS is "embedded"; select() picks the embedded entry (falling back
|
|
18
|
+
// to default) so apps can write Platform.select({ embedded: ..., default: ... }).
|
|
19
|
+
export const Platform = {
|
|
20
|
+
OS: 'embedded',
|
|
21
|
+
select(specifics) {
|
|
22
|
+
if (specifics == null) return undefined;
|
|
23
|
+
if ('embedded' in specifics) return specifics.embedded;
|
|
24
|
+
return specifics.default;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2026 Cory Lamming
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
// StyleSheet — the React Native analog. `create` is an identity pass-through (styles are plain
|
|
18
|
-
// objects the host config flattens at setProps time); `flatten` collapses nested arrays/objects.
|
|
19
|
-
export const StyleSheet = {
|
|
20
|
-
create(styles) {
|
|
21
|
-
return styles;
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
flatten(style) {
|
|
25
|
-
if (!style) return {};
|
|
26
|
-
if (Array.isArray(style)) {
|
|
27
|
-
const out = {};
|
|
28
|
-
for (const s of style) Object.assign(out, StyleSheet.flatten(s));
|
|
29
|
-
return out;
|
|
30
|
-
}
|
|
31
|
-
return style;
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
hairlineWidth: 1,
|
|
35
|
-
absoluteFill: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 },
|
|
36
|
-
};
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Cory Lamming
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// StyleSheet — the React Native analog. `create` is an identity pass-through (styles are plain
|
|
18
|
+
// objects the host config flattens at setProps time); `flatten` collapses nested arrays/objects.
|
|
19
|
+
export const StyleSheet = {
|
|
20
|
+
create(styles) {
|
|
21
|
+
return styles;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
flatten(style) {
|
|
25
|
+
if (!style) return {};
|
|
26
|
+
if (Array.isArray(style)) {
|
|
27
|
+
const out = {};
|
|
28
|
+
for (const s of style) Object.assign(out, StyleSheet.flatten(s));
|
|
29
|
+
return out;
|
|
30
|
+
}
|
|
31
|
+
return style;
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
hairlineWidth: 1,
|
|
35
|
+
absoluteFill: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 },
|
|
36
|
+
};
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2026 Cory Lamming
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
// Host components. Each is the string tag the reconciler passes to NativeUI.createNode(), which
|
|
18
|
-
// maps it onto an ERNodeType. JSX `<View/>` → createElement('View', ...) → createInstance('View').
|
|
19
|
-
export const View = 'View';
|
|
20
|
-
export const Text = 'Text';
|
|
21
|
-
export const Image = 'Image';
|
|
22
|
-
export const ScrollView = 'ScrollView';
|
|
23
|
-
export const FlatList = 'FlatList';
|
|
24
|
-
export const Pressable = 'Pressable';
|
|
25
|
-
// TouchableOpacity is RN's press-with-opacity wrapper; for now it maps to the same Pressable node.
|
|
26
|
-
export const TouchableOpacity = 'Pressable';
|
|
27
|
-
export const TextInput = 'TextInput';
|
|
28
|
-
export const Switch = 'Switch';
|
|
29
|
-
export const ActivityIndicator = 'ActivityIndicator';
|
|
30
|
-
export const Modal = 'Modal';
|
|
31
|
-
|
|
32
|
-
// SVG surface. <Svg> is the only host node (→ ER_NODE_VECTOR); the shape tags below are descriptive
|
|
33
|
-
// children that the host config flattens into the Svg node's op-tape (they are never mounted on their
|
|
34
|
-
// own — like raw text inside <Text>). Use them only inside an <Svg>.
|
|
35
|
-
export const Svg = 'Svg';
|
|
36
|
-
export const Path = 'Path';
|
|
37
|
-
export const Circle = 'Circle';
|
|
38
|
-
export const Ellipse = 'Ellipse';
|
|
39
|
-
export const Rect = 'Rect';
|
|
40
|
-
export const Line = 'Line';
|
|
41
|
-
export const G = 'G';
|
|
42
|
-
// Arc convenience primitive (not a standard SVG element): a circular arc given a center, radius, and
|
|
43
|
-
// start/end angles in DEGREES clockwise from 12 o'clock. Flattens to a native arc op — cheap to update.
|
|
44
|
-
export const Arc = 'Arc';
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Cory Lamming
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// Host components. Each is the string tag the reconciler passes to NativeUI.createNode(), which
|
|
18
|
+
// maps it onto an ERNodeType. JSX `<View/>` → createElement('View', ...) → createInstance('View').
|
|
19
|
+
export const View = 'View';
|
|
20
|
+
export const Text = 'Text';
|
|
21
|
+
export const Image = 'Image';
|
|
22
|
+
export const ScrollView = 'ScrollView';
|
|
23
|
+
export const FlatList = 'FlatList';
|
|
24
|
+
export const Pressable = 'Pressable';
|
|
25
|
+
// TouchableOpacity is RN's press-with-opacity wrapper; for now it maps to the same Pressable node.
|
|
26
|
+
export const TouchableOpacity = 'Pressable';
|
|
27
|
+
export const TextInput = 'TextInput';
|
|
28
|
+
export const Switch = 'Switch';
|
|
29
|
+
export const ActivityIndicator = 'ActivityIndicator';
|
|
30
|
+
export const Modal = 'Modal';
|
|
31
|
+
|
|
32
|
+
// SVG surface. <Svg> is the only host node (→ ER_NODE_VECTOR); the shape tags below are descriptive
|
|
33
|
+
// children that the host config flattens into the Svg node's op-tape (they are never mounted on their
|
|
34
|
+
// own — like raw text inside <Text>). Use them only inside an <Svg>.
|
|
35
|
+
export const Svg = 'Svg';
|
|
36
|
+
export const Path = 'Path';
|
|
37
|
+
export const Circle = 'Circle';
|
|
38
|
+
export const Ellipse = 'Ellipse';
|
|
39
|
+
export const Rect = 'Rect';
|
|
40
|
+
export const Line = 'Line';
|
|
41
|
+
export const G = 'G';
|
|
42
|
+
// Arc convenience primitive (not a standard SVG element): a circular arc given a center, radius, and
|
|
43
|
+
// start/end angles in DEGREES clockwise from 12 o'clock. Flattens to a native arc op — cheap to update.
|
|
44
|
+
export const Arc = 'Arc';
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2026 Cory Lamming
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
// Public 'embedded-react' surface — the React Native analog. App authors import components, styling,
|
|
18
|
-
// and the entry point from here; React hooks still come from 'react' (as in RN).
|
|
19
|
-
//
|
|
20
|
-
// import { useState } from 'react';
|
|
21
|
-
// import { View, Text, StyleSheet, AppRegistry } from 'embedded-react';
|
|
22
|
-
//
|
|
23
|
-
// Resolves as a Node package self-reference (see package.json "name"/"exports").
|
|
24
|
-
export {
|
|
25
|
-
View,
|
|
26
|
-
Text,
|
|
27
|
-
Image,
|
|
28
|
-
ScrollView,
|
|
29
|
-
FlatList,
|
|
30
|
-
Pressable,
|
|
31
|
-
TouchableOpacity,
|
|
32
|
-
TextInput,
|
|
33
|
-
Switch,
|
|
34
|
-
ActivityIndicator,
|
|
35
|
-
Modal,
|
|
36
|
-
Svg,
|
|
37
|
-
Path,
|
|
38
|
-
Circle,
|
|
39
|
-
Ellipse,
|
|
40
|
-
Rect,
|
|
41
|
-
Line,
|
|
42
|
-
G,
|
|
43
|
-
Arc,
|
|
44
|
-
} from './components.js';
|
|
45
|
-
export { updateVector, updateText, setKeyboardConfig } from './imperative.js';
|
|
46
|
-
export { StyleSheet } from './StyleSheet.js';
|
|
47
|
-
export { Platform } from './Platform.js';
|
|
48
|
-
export { AppRegistry } from './AppRegistry.js';
|
|
49
|
-
export { Animated, useAnimatedValue } from './Animated.js';
|
|
50
|
-
export { usePersistentState } from './usePersistentState.js';
|
|
51
|
-
export { Easing } from './Easing.js';
|
|
52
|
-
export { LayoutAnimation } from './LayoutAnimation.js';
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Cory Lamming
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
// Public 'embedded-react' surface — the React Native analog. App authors import components, styling,
|
|
18
|
+
// and the entry point from here; React hooks still come from 'react' (as in RN).
|
|
19
|
+
//
|
|
20
|
+
// import { useState } from 'react';
|
|
21
|
+
// import { View, Text, StyleSheet, AppRegistry } from 'embedded-react';
|
|
22
|
+
//
|
|
23
|
+
// Resolves as a Node package self-reference (see package.json "name"/"exports").
|
|
24
|
+
export {
|
|
25
|
+
View,
|
|
26
|
+
Text,
|
|
27
|
+
Image,
|
|
28
|
+
ScrollView,
|
|
29
|
+
FlatList,
|
|
30
|
+
Pressable,
|
|
31
|
+
TouchableOpacity,
|
|
32
|
+
TextInput,
|
|
33
|
+
Switch,
|
|
34
|
+
ActivityIndicator,
|
|
35
|
+
Modal,
|
|
36
|
+
Svg,
|
|
37
|
+
Path,
|
|
38
|
+
Circle,
|
|
39
|
+
Ellipse,
|
|
40
|
+
Rect,
|
|
41
|
+
Line,
|
|
42
|
+
G,
|
|
43
|
+
Arc,
|
|
44
|
+
} from './components.js';
|
|
45
|
+
export { updateVector, updateText, setKeyboardConfig } from './imperative.js';
|
|
46
|
+
export { StyleSheet } from './StyleSheet.js';
|
|
47
|
+
export { Platform } from './Platform.js';
|
|
48
|
+
export { AppRegistry } from './AppRegistry.js';
|
|
49
|
+
export { Animated, useAnimatedValue } from './Animated.js';
|
|
50
|
+
export { usePersistentState } from './usePersistentState.js';
|
|
51
|
+
export { Easing } from './Easing.js';
|
|
52
|
+
export { LayoutAnimation } from './LayoutAnimation.js';
|