@symbiote-native/engine 0.1.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 +21 -0
- package/README.md +124 -0
- package/build/accessibility-info/index.android.d.ts +3 -0
- package/build/accessibility-info/index.android.js +166 -0
- package/build/accessibility-info/index.d.ts +1 -0
- package/build/accessibility-info/index.ios.d.ts +3 -0
- package/build/accessibility-info/index.ios.js +219 -0
- package/build/accessibility-info/index.js +5 -0
- package/build/accessibility-info/shared.d.ts +34 -0
- package/build/accessibility-info/shared.js +13 -0
- package/build/action-sheet-ios/index.d.ts +36 -0
- package/build/action-sheet-ios/index.js +74 -0
- package/build/alert/index.android.d.ts +5 -0
- package/build/alert/index.android.js +117 -0
- package/build/alert/index.d.ts +1 -0
- package/build/alert/index.ios.d.ts +7 -0
- package/build/alert/index.ios.js +83 -0
- package/build/alert/index.js +8 -0
- package/build/alert/shared.d.ts +19 -0
- package/build/alert/shared.js +17 -0
- package/build/animated/animated-component-shared.d.ts +5 -0
- package/build/animated/animated-component-shared.js +54 -0
- package/build/animated/animation.d.ts +9 -0
- package/build/animated/animation.js +6 -0
- package/build/animated/animations/base.d.ts +27 -0
- package/build/animated/animations/base.js +90 -0
- package/build/animated/animations/composition.d.ts +38 -0
- package/build/animated/animations/composition.js +236 -0
- package/build/animated/animations/decay.d.ts +22 -0
- package/build/animated/animations/decay.js +65 -0
- package/build/animated/animations/raf.d.ts +5 -0
- package/build/animated/animations/raf.js +39 -0
- package/build/animated/animations/spring-config.d.ts +6 -0
- package/build/animated/animations/spring-config.js +55 -0
- package/build/animated/animations/spring.d.ts +50 -0
- package/build/animated/animations/spring.js +207 -0
- package/build/animated/animations/timing.d.ts +27 -0
- package/build/animated/animations/timing.js +101 -0
- package/build/animated/animations/tracking.d.ts +14 -0
- package/build/animated/animations/tracking.js +43 -0
- package/build/animated/bezier.d.ts +1 -0
- package/build/animated/bezier.js +101 -0
- package/build/animated/color.d.ts +37 -0
- package/build/animated/color.js +183 -0
- package/build/animated/easing.d.ts +20 -0
- package/build/animated/easing.js +96 -0
- package/build/animated/event.d.ts +36 -0
- package/build/animated/event.js +252 -0
- package/build/animated/graph.d.ts +38 -0
- package/build/animated/graph.js +227 -0
- package/build/animated/index.d.ts +20 -0
- package/build/animated/index.js +28 -0
- package/build/animated/interpolation-node.d.ts +16 -0
- package/build/animated/interpolation-node.js +57 -0
- package/build/animated/interpolation.d.ts +22 -0
- package/build/animated/interpolation.js +199 -0
- package/build/animated/mock.d.ts +56 -0
- package/build/animated/mock.js +127 -0
- package/build/animated/native/native-animated.d.ts +43 -0
- package/build/animated/native/native-animated.js +146 -0
- package/build/animated/operators.d.ts +80 -0
- package/build/animated/operators.js +266 -0
- package/build/animated/props.d.ts +20 -0
- package/build/animated/props.js +187 -0
- package/build/animated/style.d.ts +26 -0
- package/build/animated/style.js +187 -0
- package/build/animated/value-xy.d.ts +35 -0
- package/build/animated/value-xy.js +106 -0
- package/build/animated/value.d.ts +36 -0
- package/build/animated/value.js +185 -0
- package/build/app-registry/index.d.ts +40 -0
- package/build/app-registry/index.js +144 -0
- package/build/app-state/index.d.ts +16 -0
- package/build/app-state/index.js +105 -0
- package/build/appearance/index.d.ts +12 -0
- package/build/appearance/index.js +84 -0
- package/build/back-handler/index.d.ts +14 -0
- package/build/back-handler/index.js +106 -0
- package/build/commit.d.ts +16 -0
- package/build/commit.js +678 -0
- package/build/debug.d.ts +5 -0
- package/build/debug.js +18 -0
- package/build/dimensions/index.d.ts +28 -0
- package/build/dimensions/index.js +148 -0
- package/build/dispatch.d.ts +2 -0
- package/build/dispatch.js +18 -0
- package/build/events/index.d.ts +1 -0
- package/build/events/index.js +691 -0
- package/build/fabric.d.ts +32 -0
- package/build/fabric.js +59 -0
- package/build/host-instance/index.d.ts +11 -0
- package/build/host-instance/index.js +49 -0
- package/build/i18n-manager/index.d.ts +13 -0
- package/build/i18n-manager/index.js +91 -0
- package/build/index.d.ts +80 -0
- package/build/index.js +72 -0
- package/build/interaction-manager/index.d.ts +45 -0
- package/build/interaction-manager/index.js +222 -0
- package/build/keyboard/index.d.ts +31 -0
- package/build/keyboard/index.js +142 -0
- package/build/layout-animation/index.d.ts +66 -0
- package/build/layout-animation/index.js +183 -0
- package/build/linking/index.android.d.ts +2 -0
- package/build/linking/index.android.js +18 -0
- package/build/linking/index.d.ts +1 -0
- package/build/linking/index.ios.d.ts +2 -0
- package/build/linking/index.ios.js +9 -0
- package/build/linking/index.js +6 -0
- package/build/linking/shared.d.ts +32 -0
- package/build/linking/shared.js +98 -0
- package/build/native-events.d.ts +24 -0
- package/build/native-events.js +129 -0
- package/build/native-modules.d.ts +6 -0
- package/build/native-modules.js +57 -0
- package/build/node.d.ts +36 -0
- package/build/node.js +194 -0
- package/build/pan-responder/index.d.ts +53 -0
- package/build/pan-responder/index.js +353 -0
- package/build/permissions-android/index.d.ts +115 -0
- package/build/permissions-android/index.js +185 -0
- package/build/pixel-ratio/index.d.ts +8 -0
- package/build/pixel-ratio/index.js +27 -0
- package/build/platform/index.android.d.ts +22 -0
- package/build/platform/index.android.js +60 -0
- package/build/platform/index.d.ts +1 -0
- package/build/platform/index.ios.d.ts +18 -0
- package/build/platform/index.ios.js +62 -0
- package/build/platform/index.js +5 -0
- package/build/platform/shared.d.ts +25 -0
- package/build/platform/shared.js +41 -0
- package/build/platform-color.d.ts +19 -0
- package/build/platform-color.js +25 -0
- package/build/post-commit.d.ts +4 -0
- package/build/post-commit.js +16 -0
- package/build/process-aspect-ratio.d.ts +1 -0
- package/build/process-aspect-ratio.js +34 -0
- package/build/process-background-image/index.d.ts +28 -0
- package/build/process-background-image/index.js +557 -0
- package/build/process-box-shadow/index.d.ts +11 -0
- package/build/process-box-shadow/index.js +193 -0
- package/build/process-filter.d.ts +31 -0
- package/build/process-filter.js +304 -0
- package/build/process-font-variant.d.ts +1 -0
- package/build/process-font-variant.js +17 -0
- package/build/process-transform/index.d.ts +5 -0
- package/build/process-transform/index.js +120 -0
- package/build/process-transform-origin/index.d.ts +3 -0
- package/build/process-transform-origin/index.js +108 -0
- package/build/registry.d.ts +31 -0
- package/build/registry.js +145 -0
- package/build/settings/index.d.ts +8 -0
- package/build/settings/index.js +126 -0
- package/build/share/index.android.d.ts +3 -0
- package/build/share/index.android.js +56 -0
- package/build/share/index.d.ts +1 -0
- package/build/share/index.ios.d.ts +3 -0
- package/build/share/index.ios.js +47 -0
- package/build/share/index.js +6 -0
- package/build/share/shared.d.ts +32 -0
- package/build/share/shared.js +32 -0
- package/build/status-bar/index.android.d.ts +5 -0
- package/build/status-bar/index.android.js +83 -0
- package/build/status-bar/index.d.ts +1 -0
- package/build/status-bar/index.ios.d.ts +5 -0
- package/build/status-bar/index.ios.js +66 -0
- package/build/status-bar/index.js +4 -0
- package/build/status-bar/shared.d.ts +22 -0
- package/build/status-bar/shared.js +22 -0
- package/build/style/index.d.ts +1 -0
- package/build/style/index.js +30 -0
- package/build/style-registry/index.d.ts +11 -0
- package/build/style-registry/index.js +165 -0
- package/build/style-sheet/index.d.ts +20 -0
- package/build/style-sheet/index.js +121 -0
- package/build/styles.d.ts +220 -0
- package/build/styles.js +7 -0
- package/build/surface.d.ts +16 -0
- package/build/surface.js +67 -0
- package/build/tags.d.ts +1 -0
- package/build/tags.js +10 -0
- package/build/text-input-state.d.ts +5 -0
- package/build/text-input-state.js +29 -0
- package/build/toast-android/index.d.ts +10 -0
- package/build/toast-android/index.js +108 -0
- package/build/vibration/index.android.d.ts +2 -0
- package/build/vibration/index.android.js +18 -0
- package/build/vibration/index.d.ts +1 -0
- package/build/vibration/index.ios.d.ts +2 -0
- package/build/vibration/index.ios.js +54 -0
- package/build/vibration/index.js +6 -0
- package/build/vibration/shared.d.ts +15 -0
- package/build/vibration/shared.js +68 -0
- package/build/view-config.d.ts +1 -0
- package/build/view-config.js +114 -0
- package/package.json +41 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// Per-native-component event declarations: symbiote's slimmed ViewConfigRegistry.
|
|
2
|
+
// Mirrors React Native's ViewConfig: each Fabric component declares which event
|
|
3
|
+
// names it can emit. This is native-component knowledge (a Switch fires `change`,
|
|
4
|
+
// a ScrollView fires `scroll`), shared by every adapter, so it lives here, not in
|
|
5
|
+
// any one framework adapter.
|
|
6
|
+
//
|
|
7
|
+
// Flat-bag adapters (React / Vue / Solid) hand props and handlers mixed together
|
|
8
|
+
// and must split them. They consult this registry to tell an event handler
|
|
9
|
+
// (`onChange` -> `change`, a declared event) from a native prop that merely looks
|
|
10
|
+
// like one (`onTintColor` -> `tintColor`, NOT a declared event -> stays a prop and
|
|
11
|
+
// reaches Fabric). Structural adapters (Svelte `addEventListener`, Angular
|
|
12
|
+
// `Renderer2.listen`) deliver events pre-separated and call `setEventListener`
|
|
13
|
+
// directly, bypassing this entirely.
|
|
14
|
+
import { isRegisteredEvent } from './registry';
|
|
15
|
+
// Accessibility events from RN's base ViewConfig: every view can emit them.
|
|
16
|
+
// accessibilityAction fires on iOS + Android; the other three are iOS-only and inert
|
|
17
|
+
// on Android (no native producer), exactly like `scrollToTop` below.
|
|
18
|
+
const A11Y_EVENTS = [
|
|
19
|
+
'accessibilityAction',
|
|
20
|
+
'accessibilityTap',
|
|
21
|
+
'magicTap',
|
|
22
|
+
'accessibilityEscape',
|
|
23
|
+
];
|
|
24
|
+
// Events every view can emit, from RN's base ViewConfig. `press`/`pressIn`/`pressOut`/
|
|
25
|
+
// `longPress` are synthesized from the touch stream (see events.ts); `layout` is
|
|
26
|
+
// universal; `focus`/`blur` are RN's bubbling focus events declared on the base View
|
|
27
|
+
// (ViewPropTypes.js FocusEventProps), so any view can emit them; the accessibility
|
|
28
|
+
// events are base too, so they reach every component.
|
|
29
|
+
const BASE_EVENTS = [
|
|
30
|
+
'press',
|
|
31
|
+
'pressIn',
|
|
32
|
+
'pressOut',
|
|
33
|
+
'longPress',
|
|
34
|
+
'layout',
|
|
35
|
+
'focus',
|
|
36
|
+
'blur',
|
|
37
|
+
...A11Y_EVENTS,
|
|
38
|
+
];
|
|
39
|
+
// An event set is platform-invariant: a text input emits `change` on iOS and Android
|
|
40
|
+
// alike; only the native component NAME differs (iOS RCTSinglelineTextInputView vs
|
|
41
|
+
// Android AndroidTextInput, iOS Switch vs Android AndroidSwitch). So each primitive's
|
|
42
|
+
// events are declared ONCE and keyed under BOTH platform names below. The table is
|
|
43
|
+
// consulted by the resolved native name (SymbioteNode.component), and only one
|
|
44
|
+
// platform's names ever exist at runtime, so the other platform's keys are inert (no
|
|
45
|
+
// Platform.OS branch), the names simply coexist. Missing the Android keys is what made
|
|
46
|
+
// onValueChange (and Switch/Modal/RefreshControl events) silently dead on Android: the
|
|
47
|
+
// onX prop failed isEventFor, fell to setProp, and no listener was ever registered.
|
|
48
|
+
const TEXT_INPUT_EVENTS = [
|
|
49
|
+
'change',
|
|
50
|
+
'focus',
|
|
51
|
+
'blur',
|
|
52
|
+
'endEditing',
|
|
53
|
+
'submitEditing',
|
|
54
|
+
'keyPress',
|
|
55
|
+
'selectionChange',
|
|
56
|
+
'contentSizeChange',
|
|
57
|
+
];
|
|
58
|
+
const MODAL_EVENTS = ['show', 'dismiss', 'requestClose', 'orientationChange'];
|
|
59
|
+
// A scroll view's events are the same on both axes and both platforms; only the native
|
|
60
|
+
// NAME differs (iOS RCTScrollView for both; Android RCTScrollView vertical vs
|
|
61
|
+
// AndroidHorizontalScrollView horizontal). Declared once, keyed under each name below. The
|
|
62
|
+
// Android horizontal name was missing, so a horizontal FlatList's onScroll never fired and
|
|
63
|
+
// its windowing stalled: same failure mode as the text-input keys.
|
|
64
|
+
const SCROLL_EVENTS = [
|
|
65
|
+
'scroll',
|
|
66
|
+
'scrollBeginDrag',
|
|
67
|
+
'scrollEndDrag',
|
|
68
|
+
'momentumScrollBegin',
|
|
69
|
+
'momentumScrollEnd',
|
|
70
|
+
'contentSizeChange',
|
|
71
|
+
// iOS-only: emitted when the user taps the status bar to scroll to top. Inert on
|
|
72
|
+
// Android (no native producer), so keying it here is harmless cross-platform.
|
|
73
|
+
'scrollToTop',
|
|
74
|
+
];
|
|
75
|
+
// Text emits a glyph-layout event (onTextLayout) beyond the base press/layout set.
|
|
76
|
+
const TEXT_EVENTS = ['textLayout'];
|
|
77
|
+
// Fabric component name -> the events it emits beyond the base set. The keys match
|
|
78
|
+
// SymbioteNode.component (what createNode is called with). A component absent here
|
|
79
|
+
// still gets BASE_EVENTS, so a new primitive has working press/layout for free.
|
|
80
|
+
const COMPONENT_EVENTS = {
|
|
81
|
+
RCTImageView: ['loadStart', 'load', 'loadEnd', 'error', 'progress', 'partialLoad'],
|
|
82
|
+
RCTScrollView: SCROLL_EVENTS,
|
|
83
|
+
AndroidHorizontalScrollView: SCROLL_EVENTS,
|
|
84
|
+
RCTSinglelineTextInputView: TEXT_INPUT_EVENTS,
|
|
85
|
+
RCTMultilineTextInputView: TEXT_INPUT_EVENTS,
|
|
86
|
+
AndroidTextInput: TEXT_INPUT_EVENTS,
|
|
87
|
+
RCTText: TEXT_EVENTS,
|
|
88
|
+
Switch: ['change'],
|
|
89
|
+
AndroidSwitch: ['change'],
|
|
90
|
+
ModalHostView: MODAL_EVENTS,
|
|
91
|
+
RCTModalHostView: MODAL_EVENTS,
|
|
92
|
+
PullToRefreshView: ['refresh'],
|
|
93
|
+
AndroidSwipeRefreshLayout: ['refresh'],
|
|
94
|
+
};
|
|
95
|
+
const configCache = new Map();
|
|
96
|
+
// The built-in event names `component` can emit (its own + the base set). Cached;
|
|
97
|
+
// the registry layer is consulted live in isEventFor so a later registration is
|
|
98
|
+
// never masked by a stale cache entry.
|
|
99
|
+
function eventNamesFor(component) {
|
|
100
|
+
let set = configCache.get(component);
|
|
101
|
+
if (set === undefined) {
|
|
102
|
+
set = new Set([...BASE_EVENTS, ...(COMPONENT_EVENTS[component] ?? [])]);
|
|
103
|
+
configCache.set(component, set);
|
|
104
|
+
}
|
|
105
|
+
return set;
|
|
106
|
+
}
|
|
107
|
+
// True when `listenerName` is an event `component` emits, false when it is an
|
|
108
|
+
// ordinary native prop. This is the single authority for the event-vs-prop split:
|
|
109
|
+
// the name alone never decides. Built-ins first, then any third-party registration.
|
|
110
|
+
export function isEventFor(component, listenerName) {
|
|
111
|
+
if (eventNamesFor(component).has(listenerName))
|
|
112
|
+
return true;
|
|
113
|
+
return isRegisteredEvent(component, listenerName);
|
|
114
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@symbiote-native/engine",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SymbioteJS's retained shadow-tree engine — clone-on-write commit path + event normalization over React Native Fabric, shared by every framework adapter.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/OneEyed1366/symbiote-native.git",
|
|
8
|
+
"directory": "core/engine"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/OneEyed1366/symbiote-native/tree/master/core/engine#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/OneEyed1366/symbiote-native/issues"
|
|
13
|
+
},
|
|
14
|
+
"author": "Andrey Prokopenko <psevdoproger@gmail.com>",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./build/index.js",
|
|
17
|
+
"module": "./build/index.js",
|
|
18
|
+
"types": "./build/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./build/index.d.ts",
|
|
22
|
+
"default": "./build/index.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"build"
|
|
27
|
+
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"react-native": ">=0.86"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@symbiote-native/test-utils": "0.0.0"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"typecheck": "tsc --build",
|
|
39
|
+
"format": "prettier --write \"src/**/*.{ts,tsx}\""
|
|
40
|
+
}
|
|
41
|
+
}
|