@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.
Files changed (195) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +124 -0
  3. package/build/accessibility-info/index.android.d.ts +3 -0
  4. package/build/accessibility-info/index.android.js +166 -0
  5. package/build/accessibility-info/index.d.ts +1 -0
  6. package/build/accessibility-info/index.ios.d.ts +3 -0
  7. package/build/accessibility-info/index.ios.js +219 -0
  8. package/build/accessibility-info/index.js +5 -0
  9. package/build/accessibility-info/shared.d.ts +34 -0
  10. package/build/accessibility-info/shared.js +13 -0
  11. package/build/action-sheet-ios/index.d.ts +36 -0
  12. package/build/action-sheet-ios/index.js +74 -0
  13. package/build/alert/index.android.d.ts +5 -0
  14. package/build/alert/index.android.js +117 -0
  15. package/build/alert/index.d.ts +1 -0
  16. package/build/alert/index.ios.d.ts +7 -0
  17. package/build/alert/index.ios.js +83 -0
  18. package/build/alert/index.js +8 -0
  19. package/build/alert/shared.d.ts +19 -0
  20. package/build/alert/shared.js +17 -0
  21. package/build/animated/animated-component-shared.d.ts +5 -0
  22. package/build/animated/animated-component-shared.js +54 -0
  23. package/build/animated/animation.d.ts +9 -0
  24. package/build/animated/animation.js +6 -0
  25. package/build/animated/animations/base.d.ts +27 -0
  26. package/build/animated/animations/base.js +90 -0
  27. package/build/animated/animations/composition.d.ts +38 -0
  28. package/build/animated/animations/composition.js +236 -0
  29. package/build/animated/animations/decay.d.ts +22 -0
  30. package/build/animated/animations/decay.js +65 -0
  31. package/build/animated/animations/raf.d.ts +5 -0
  32. package/build/animated/animations/raf.js +39 -0
  33. package/build/animated/animations/spring-config.d.ts +6 -0
  34. package/build/animated/animations/spring-config.js +55 -0
  35. package/build/animated/animations/spring.d.ts +50 -0
  36. package/build/animated/animations/spring.js +207 -0
  37. package/build/animated/animations/timing.d.ts +27 -0
  38. package/build/animated/animations/timing.js +101 -0
  39. package/build/animated/animations/tracking.d.ts +14 -0
  40. package/build/animated/animations/tracking.js +43 -0
  41. package/build/animated/bezier.d.ts +1 -0
  42. package/build/animated/bezier.js +101 -0
  43. package/build/animated/color.d.ts +37 -0
  44. package/build/animated/color.js +183 -0
  45. package/build/animated/easing.d.ts +20 -0
  46. package/build/animated/easing.js +96 -0
  47. package/build/animated/event.d.ts +36 -0
  48. package/build/animated/event.js +252 -0
  49. package/build/animated/graph.d.ts +38 -0
  50. package/build/animated/graph.js +227 -0
  51. package/build/animated/index.d.ts +20 -0
  52. package/build/animated/index.js +28 -0
  53. package/build/animated/interpolation-node.d.ts +16 -0
  54. package/build/animated/interpolation-node.js +57 -0
  55. package/build/animated/interpolation.d.ts +22 -0
  56. package/build/animated/interpolation.js +199 -0
  57. package/build/animated/mock.d.ts +56 -0
  58. package/build/animated/mock.js +127 -0
  59. package/build/animated/native/native-animated.d.ts +43 -0
  60. package/build/animated/native/native-animated.js +146 -0
  61. package/build/animated/operators.d.ts +80 -0
  62. package/build/animated/operators.js +266 -0
  63. package/build/animated/props.d.ts +20 -0
  64. package/build/animated/props.js +187 -0
  65. package/build/animated/style.d.ts +26 -0
  66. package/build/animated/style.js +187 -0
  67. package/build/animated/value-xy.d.ts +35 -0
  68. package/build/animated/value-xy.js +106 -0
  69. package/build/animated/value.d.ts +36 -0
  70. package/build/animated/value.js +185 -0
  71. package/build/app-registry/index.d.ts +40 -0
  72. package/build/app-registry/index.js +144 -0
  73. package/build/app-state/index.d.ts +16 -0
  74. package/build/app-state/index.js +105 -0
  75. package/build/appearance/index.d.ts +12 -0
  76. package/build/appearance/index.js +84 -0
  77. package/build/back-handler/index.d.ts +14 -0
  78. package/build/back-handler/index.js +106 -0
  79. package/build/commit.d.ts +16 -0
  80. package/build/commit.js +678 -0
  81. package/build/debug.d.ts +5 -0
  82. package/build/debug.js +18 -0
  83. package/build/dimensions/index.d.ts +28 -0
  84. package/build/dimensions/index.js +148 -0
  85. package/build/dispatch.d.ts +2 -0
  86. package/build/dispatch.js +18 -0
  87. package/build/events/index.d.ts +1 -0
  88. package/build/events/index.js +691 -0
  89. package/build/fabric.d.ts +32 -0
  90. package/build/fabric.js +59 -0
  91. package/build/host-instance/index.d.ts +11 -0
  92. package/build/host-instance/index.js +49 -0
  93. package/build/i18n-manager/index.d.ts +13 -0
  94. package/build/i18n-manager/index.js +91 -0
  95. package/build/index.d.ts +80 -0
  96. package/build/index.js +72 -0
  97. package/build/interaction-manager/index.d.ts +45 -0
  98. package/build/interaction-manager/index.js +222 -0
  99. package/build/keyboard/index.d.ts +31 -0
  100. package/build/keyboard/index.js +142 -0
  101. package/build/layout-animation/index.d.ts +66 -0
  102. package/build/layout-animation/index.js +183 -0
  103. package/build/linking/index.android.d.ts +2 -0
  104. package/build/linking/index.android.js +18 -0
  105. package/build/linking/index.d.ts +1 -0
  106. package/build/linking/index.ios.d.ts +2 -0
  107. package/build/linking/index.ios.js +9 -0
  108. package/build/linking/index.js +6 -0
  109. package/build/linking/shared.d.ts +32 -0
  110. package/build/linking/shared.js +98 -0
  111. package/build/native-events.d.ts +24 -0
  112. package/build/native-events.js +129 -0
  113. package/build/native-modules.d.ts +6 -0
  114. package/build/native-modules.js +57 -0
  115. package/build/node.d.ts +36 -0
  116. package/build/node.js +194 -0
  117. package/build/pan-responder/index.d.ts +53 -0
  118. package/build/pan-responder/index.js +353 -0
  119. package/build/permissions-android/index.d.ts +115 -0
  120. package/build/permissions-android/index.js +185 -0
  121. package/build/pixel-ratio/index.d.ts +8 -0
  122. package/build/pixel-ratio/index.js +27 -0
  123. package/build/platform/index.android.d.ts +22 -0
  124. package/build/platform/index.android.js +60 -0
  125. package/build/platform/index.d.ts +1 -0
  126. package/build/platform/index.ios.d.ts +18 -0
  127. package/build/platform/index.ios.js +62 -0
  128. package/build/platform/index.js +5 -0
  129. package/build/platform/shared.d.ts +25 -0
  130. package/build/platform/shared.js +41 -0
  131. package/build/platform-color.d.ts +19 -0
  132. package/build/platform-color.js +25 -0
  133. package/build/post-commit.d.ts +4 -0
  134. package/build/post-commit.js +16 -0
  135. package/build/process-aspect-ratio.d.ts +1 -0
  136. package/build/process-aspect-ratio.js +34 -0
  137. package/build/process-background-image/index.d.ts +28 -0
  138. package/build/process-background-image/index.js +557 -0
  139. package/build/process-box-shadow/index.d.ts +11 -0
  140. package/build/process-box-shadow/index.js +193 -0
  141. package/build/process-filter.d.ts +31 -0
  142. package/build/process-filter.js +304 -0
  143. package/build/process-font-variant.d.ts +1 -0
  144. package/build/process-font-variant.js +17 -0
  145. package/build/process-transform/index.d.ts +5 -0
  146. package/build/process-transform/index.js +120 -0
  147. package/build/process-transform-origin/index.d.ts +3 -0
  148. package/build/process-transform-origin/index.js +108 -0
  149. package/build/registry.d.ts +31 -0
  150. package/build/registry.js +145 -0
  151. package/build/settings/index.d.ts +8 -0
  152. package/build/settings/index.js +126 -0
  153. package/build/share/index.android.d.ts +3 -0
  154. package/build/share/index.android.js +56 -0
  155. package/build/share/index.d.ts +1 -0
  156. package/build/share/index.ios.d.ts +3 -0
  157. package/build/share/index.ios.js +47 -0
  158. package/build/share/index.js +6 -0
  159. package/build/share/shared.d.ts +32 -0
  160. package/build/share/shared.js +32 -0
  161. package/build/status-bar/index.android.d.ts +5 -0
  162. package/build/status-bar/index.android.js +83 -0
  163. package/build/status-bar/index.d.ts +1 -0
  164. package/build/status-bar/index.ios.d.ts +5 -0
  165. package/build/status-bar/index.ios.js +66 -0
  166. package/build/status-bar/index.js +4 -0
  167. package/build/status-bar/shared.d.ts +22 -0
  168. package/build/status-bar/shared.js +22 -0
  169. package/build/style/index.d.ts +1 -0
  170. package/build/style/index.js +30 -0
  171. package/build/style-registry/index.d.ts +11 -0
  172. package/build/style-registry/index.js +165 -0
  173. package/build/style-sheet/index.d.ts +20 -0
  174. package/build/style-sheet/index.js +121 -0
  175. package/build/styles.d.ts +220 -0
  176. package/build/styles.js +7 -0
  177. package/build/surface.d.ts +16 -0
  178. package/build/surface.js +67 -0
  179. package/build/tags.d.ts +1 -0
  180. package/build/tags.js +10 -0
  181. package/build/text-input-state.d.ts +5 -0
  182. package/build/text-input-state.js +29 -0
  183. package/build/toast-android/index.d.ts +10 -0
  184. package/build/toast-android/index.js +108 -0
  185. package/build/vibration/index.android.d.ts +2 -0
  186. package/build/vibration/index.android.js +18 -0
  187. package/build/vibration/index.d.ts +1 -0
  188. package/build/vibration/index.ios.d.ts +2 -0
  189. package/build/vibration/index.ios.js +54 -0
  190. package/build/vibration/index.js +6 -0
  191. package/build/vibration/shared.d.ts +15 -0
  192. package/build/vibration/shared.js +68 -0
  193. package/build/view-config.d.ts +1 -0
  194. package/build/view-config.js +114 -0
  195. package/package.json +41 -0
@@ -0,0 +1,32 @@
1
+ export type IRootTag = number;
2
+ export interface IFabricNode {
3
+ readonly __fabricNode: unique symbol;
4
+ }
5
+ export interface IFabricChildSet {
6
+ readonly __fabricChildSet: unique symbol;
7
+ }
8
+ export type IFabricProps = Record<string, unknown>;
9
+ export type IFabricEventHandler = (instanceHandle: unknown, topLevelType: string, nativeEvent: Record<string, unknown>) => void;
10
+ export type IMeasureOnSuccess = (x: number, y: number, width: number, height: number, pageX: number, pageY: number) => void;
11
+ export type IMeasureInWindowOnSuccess = (x: number, y: number, width: number, height: number) => void;
12
+ export type IMeasureLayoutOnSuccess = (left: number, top: number, width: number, height: number) => void;
13
+ export interface IFabricSlot {
14
+ createNode(reactTag: number, viewName: string, rootTag: IRootTag, props: IFabricProps, instanceHandle: unknown): IFabricNode;
15
+ cloneNodeWithNewProps(node: IFabricNode, newProps: IFabricProps): IFabricNode;
16
+ cloneNodeWithNewChildren(node: IFabricNode): IFabricNode;
17
+ cloneNodeWithNewChildrenAndProps(node: IFabricNode, newProps: IFabricProps): IFabricNode;
18
+ createChildSet(rootTag: IRootTag): IFabricChildSet;
19
+ appendChild(parent: IFabricNode, child: IFabricNode): IFabricNode;
20
+ appendChildToSet(childSet: IFabricChildSet, child: IFabricNode): void;
21
+ completeRoot(rootTag: IRootTag, childSet: IFabricChildSet): void;
22
+ registerEventHandler(handler: IFabricEventHandler): void;
23
+ dispatchCommand(node: IFabricNode, commandName: string, args: readonly unknown[]): void;
24
+ sendAccessibilityEvent(node: IFabricNode, eventType: string): void;
25
+ measure(node: IFabricNode, callback: IMeasureOnSuccess): void;
26
+ measureInWindow(node: IFabricNode, callback: IMeasureInWindowOnSuccess): void;
27
+ measureLayout(node: IFabricNode, relativeToNode: IFabricNode, onFail: () => void, onSuccess: IMeasureLayoutOnSuccess): void;
28
+ }
29
+ declare global {
30
+ var nativeFabricUIManager: IFabricSlot | undefined;
31
+ }
32
+ export declare function getSlot(): IFabricSlot;
@@ -0,0 +1,59 @@
1
+ // The one seam symbiote drives. `global.nativeFabricUIManager` is the
2
+ // framework-agnostic, JSI-bound mutation API that Fabric exposes; React's
3
+ // renderer is just one client of it. We bind to it directly.
4
+ //
5
+ // The live object is a lazy caching proxy: every property access mints a fresh
6
+ // host function, so we read each method once and cache a plain facade.
7
+ import { dlog } from './debug';
8
+ let cached;
9
+ export function getSlot() {
10
+ if (cached)
11
+ return cached;
12
+ const host = globalThis.nativeFabricUIManager;
13
+ if (host === undefined) {
14
+ throw new Error('nativeFabricUIManager is not installed on the global. ' +
15
+ 'Is this running on a Fabric (New Architecture) host with InitializeCore loaded?');
16
+ }
17
+ // Read each method exactly once: the live binding re-mints host functions on
18
+ // every property access, so caching the references avoids that churn.
19
+ const { createNode } = host;
20
+ const { cloneNodeWithNewProps } = host;
21
+ const { cloneNodeWithNewChildren } = host;
22
+ const { cloneNodeWithNewChildrenAndProps } = host;
23
+ const { createChildSet } = host;
24
+ const { appendChild } = host;
25
+ const { appendChildToSet } = host;
26
+ const { completeRoot } = host;
27
+ const { registerEventHandler } = host;
28
+ const { dispatchCommand } = host;
29
+ // Optional on some hosts: read it off the live binding and feature-detect below so an
30
+ // older slot without it degrades to a logged no-op instead of throwing.
31
+ const { sendAccessibilityEvent } = host;
32
+ const { measure } = host;
33
+ const { measureInWindow } = host;
34
+ const { measureLayout } = host;
35
+ cached = {
36
+ createNode: (reactTag, viewName, rootTag, props, instanceHandle) => createNode(reactTag, viewName, rootTag, props, instanceHandle),
37
+ cloneNodeWithNewProps: (node, newProps) => cloneNodeWithNewProps(node, newProps),
38
+ cloneNodeWithNewChildren: node => cloneNodeWithNewChildren(node),
39
+ cloneNodeWithNewChildrenAndProps: (node, newProps) => cloneNodeWithNewChildrenAndProps(node, newProps),
40
+ createChildSet: rootTag => createChildSet(rootTag),
41
+ appendChild: (parent, child) => appendChild(parent, child),
42
+ appendChildToSet: (childSet, child) => appendChildToSet(childSet, child),
43
+ completeRoot: (rootTag, childSet) => completeRoot(rootTag, childSet),
44
+ registerEventHandler: handler => registerEventHandler(handler),
45
+ dispatchCommand: (node, commandName, args) => dispatchCommand(node, commandName, args),
46
+ sendAccessibilityEvent: (node, eventType) => {
47
+ if (typeof sendAccessibilityEvent !== 'function') {
48
+ dlog(`sendAccessibilityEvent("${eventType}") -> host lacks the method (no-op)`);
49
+ return;
50
+ }
51
+ sendAccessibilityEvent(node, eventType);
52
+ },
53
+ measure: (node, callback) => measure(node, callback),
54
+ measureInWindow: (node, callback) => measureInWindow(node, callback),
55
+ measureLayout: (node, relativeToNode, onFail, onSuccess) => measureLayout(node, relativeToNode, onFail, onSuccess),
56
+ };
57
+ dlog('slot bound to nativeFabricUIManager');
58
+ return cached;
59
+ }
@@ -0,0 +1,11 @@
1
+ import { type ISymbioteNode } from '../node';
2
+ import type { IMeasureOnSuccess, IMeasureInWindowOnSuccess, IMeasureLayoutOnSuccess } from '../fabric';
3
+ export interface IHostInstance extends ISymbioteNode {
4
+ measure(callback: IMeasureOnSuccess): void;
5
+ measureInWindow(callback: IMeasureInWindowOnSuccess): void;
6
+ measureLayout(relativeToNativeNode: IHostInstance | number, onSuccess: IMeasureLayoutOnSuccess, onFail?: () => void): void;
7
+ setNativeProps(nativeProps: Record<string, unknown>): void;
8
+ focus(): void;
9
+ blur(): void;
10
+ }
11
+ export declare function toPublicInstance(node: ISymbioteNode): IHostInstance;
@@ -0,0 +1,49 @@
1
+ // The public instance a host ref hands back, RN's ReactFabricHostComponent. toPublicInstance
2
+ // augments the retained node with the imperative API libraries reach through (reanimated,
3
+ // gesture-handler, react-navigation): measure / measureInWindow / measureLayout /
4
+ // setNativeProps / focus / blur. The methods are attached onto the node object itself (not its
5
+ // props, so they never reach Fabric); each resolves the node's CURRENT committed handle at call
6
+ // time through the engine, so a clone-on-write commit between calls is transparent.
7
+ //
8
+ // This lives in the engine, not an adapter: it depends only on engine internals (the commit
9
+ // free functions + the retained node), so every adapter inherits the SAME public instance for
10
+ // free — React's getPublicInstance and the Vue renderer both graft this onto their host nodes.
11
+ import { measure as engineMeasure, measureInWindow as engineMeasureInWindow, measureLayout as engineMeasureLayout, setNativeProps as engineSetNativeProps, dispatchViewCommand, } from '../commit';
12
+ import { isSymbioteNode } from '../node';
13
+ import { dlog } from '../debug';
14
+ const FOCUS_COMMAND = 'focus';
15
+ const BLUR_COMMAND = 'blur';
16
+ function isHostInstance(node) {
17
+ return typeof Reflect.get(node, 'measure') === 'function';
18
+ }
19
+ // Augment the retained node with the public-instance methods, once. The same node
20
+ // instance persists across commits, so attaching once is enough, every method reads
21
+ // the live handle through the engine on each call.
22
+ export function toPublicInstance(node) {
23
+ if (isHostInstance(node))
24
+ return node;
25
+ return Object.assign(node, {
26
+ measure(callback) {
27
+ engineMeasure(node, callback);
28
+ },
29
+ measureInWindow(callback) {
30
+ engineMeasureInWindow(node, callback);
31
+ },
32
+ measureLayout(relativeToNativeNode, onSuccess, onFail) {
33
+ if (!isSymbioteNode(relativeToNativeNode)) {
34
+ dlog('measureLayout: relative target must be a host ref');
35
+ return;
36
+ }
37
+ engineMeasureLayout(node, relativeToNativeNode, onSuccess, onFail);
38
+ },
39
+ setNativeProps(nativeProps) {
40
+ engineSetNativeProps(node, nativeProps);
41
+ },
42
+ focus() {
43
+ dispatchViewCommand(node, FOCUS_COMMAND, []);
44
+ },
45
+ blur() {
46
+ dispatchViewCommand(node, BLUR_COMMAND, []);
47
+ },
48
+ });
49
+ }
@@ -0,0 +1,13 @@
1
+ export type II18nManagerConstants = {
2
+ isRTL: boolean;
3
+ doLeftAndRightSwapInRTL: boolean;
4
+ localeIdentifier?: string;
5
+ };
6
+ export declare const I18nManager: {
7
+ isRTL: boolean;
8
+ doLeftAndRightSwapInRTL: boolean;
9
+ getConstants(): II18nManagerConstants;
10
+ allowRTL(allow: boolean): void;
11
+ forceRTL(force: boolean): void;
12
+ swapLeftAndRightInRTL(swap: boolean): void;
13
+ };
@@ -0,0 +1,91 @@
1
+ // I18nManager module: exposes RTL (right-to-left) layout state and lets the app
2
+ // allow / force / swap-left-and-right RTL. Mirrors RN's
3
+ // Libraries/ReactNative/I18nManager.js, iOS path only. RN reads the native
4
+ // constants eagerly at module load (a synchronous getConstants) and exposes them
5
+ // both via getConstants() and as the plain `isRTL` / `doLeftAndRightSwapInRTL`
6
+ // fields; we keep that shape. The setters are imperative JS->native calls with no
7
+ // Fabric view of their own, like Vibration / Keyboard.
8
+ //
9
+ // The native contract is confirmed from RN's TurboModule spec at
10
+ // specs_DEPRECATED/modules/INativeI18nManager.js (`'I18nManager'`):
11
+ // getConstants(): { doLeftAndRightSwapInRTL, isRTL, localeIdentifier? }
12
+ // allowRTL(allowRTL: boolean)
13
+ // forceRTL(forceRTL: boolean)
14
+ // swapLeftAndRightInRTL(flipStyles: boolean)
15
+ import { dlog } from '../debug';
16
+ import { getNativeModule } from '../native-modules';
17
+ // The iOS native module name RN registers this under (the same name on both
18
+ // platforms). NOTE: per the symbiote invariant, a module name is only provable on
19
+ // a real host (a headless fake answers to any name); this name is
20
+ // device-verify-pending. See .docs/native-module-platform-routing.md.
21
+ const I18N_MANAGER_MODULE = 'I18nManager';
22
+ // RN's fallback constants when no native module is linked (headless / not yet on
23
+ // device): not RTL, and the iOS default of swapping in RTL.
24
+ const DEFAULT_CONSTANTS = {
25
+ isRTL: false,
26
+ doLeftAndRightSwapInRTL: true,
27
+ };
28
+ function isBoolean(value) {
29
+ return typeof value === 'boolean';
30
+ }
31
+ function isOptionalString(value) {
32
+ return value === undefined || typeof value === 'string';
33
+ }
34
+ // Narrow the untyped native getConstants() return into our type: a runtime guard
35
+ // at the trust boundary rather than an `as`. Falls back to the defaults if any
36
+ // field is missing or the wrong type.
37
+ function readConstants(module) {
38
+ const raw = module.getConstants();
39
+ if (typeof raw !== 'object' || raw === null)
40
+ return DEFAULT_CONSTANTS;
41
+ const isRTL = Reflect.get(raw, 'isRTL');
42
+ const doLeftAndRightSwapInRTL = Reflect.get(raw, 'doLeftAndRightSwapInRTL');
43
+ const localeIdentifier = Reflect.get(raw, 'localeIdentifier');
44
+ if (!isBoolean(isRTL) || !isBoolean(doLeftAndRightSwapInRTL))
45
+ return DEFAULT_CONSTANTS;
46
+ const constants = { isRTL, doLeftAndRightSwapInRTL };
47
+ if (isOptionalString(localeIdentifier) && localeIdentifier !== undefined) {
48
+ constants.localeIdentifier = localeIdentifier;
49
+ }
50
+ return constants;
51
+ }
52
+ // Resolved once, at module load: RN reads the constants eagerly via a single
53
+ // synchronous getConstants. `null` when the module isn't linked.
54
+ const i18nModule = getNativeModule(I18N_MANAGER_MODULE);
55
+ dlog(`I18nManager: module ${i18nModule ? 'resolved' : 'NOT resolved (null)'}`);
56
+ const constants = i18nModule === null ? DEFAULT_CONSTANTS : readConstants(i18nModule);
57
+ export const I18nManager = {
58
+ isRTL: constants.isRTL,
59
+ doLeftAndRightSwapInRTL: constants.doLeftAndRightSwapInRTL,
60
+ getConstants() {
61
+ return constants;
62
+ },
63
+ // Allow the app to render RTL when the device locale is RTL. No-op (logged)
64
+ // without a module: a missing native module must never throw on a device.
65
+ allowRTL(allow) {
66
+ if (i18nModule === null) {
67
+ dlog('I18nManager.allowRTL -> I18nManager native module unavailable, no-op');
68
+ return;
69
+ }
70
+ dlog(`I18nManager.allowRTL -> ${allow}`);
71
+ i18nModule.allowRTL(allow);
72
+ },
73
+ // Force RTL regardless of the device locale (takes effect after an app reload).
74
+ forceRTL(force) {
75
+ if (i18nModule === null) {
76
+ dlog('I18nManager.forceRTL -> I18nManager native module unavailable, no-op');
77
+ return;
78
+ }
79
+ dlog(`I18nManager.forceRTL -> ${force}`);
80
+ i18nModule.forceRTL(force);
81
+ },
82
+ // Control whether left/right style properties flip in RTL.
83
+ swapLeftAndRightInRTL(swap) {
84
+ if (i18nModule === null) {
85
+ dlog('I18nManager.swapLeftAndRightInRTL -> I18nManager native module unavailable, no-op');
86
+ return;
87
+ }
88
+ dlog(`I18nManager.swapLeftAndRightInRTL -> ${swap}`);
89
+ i18nModule.swapLeftAndRightInRTL(swap);
90
+ },
91
+ };
@@ -0,0 +1,80 @@
1
+ export { createElement, createRawText, createAnchor, isAnchor, appendChild, insertBefore, removeChild, setProp, setEventListener, routeProp, getExplicitStyle, setText, isSymbioteNode, RAW_TEXT_COMPONENT, } from './node';
2
+ export { isEventFor } from './view-config';
3
+ export { registerComponent, setNativeViewConfigSource } from './registry';
4
+ export { InteractionManager, Events as InteractionManagerEvents } from './interaction-manager';
5
+ export type { IInteractionEvent, ISimpleTask, IPromiseTask, ITask, IHandle, ICancellable, } from './interaction-manager';
6
+ export { default as PanResponder } from './pan-responder';
7
+ export type { IPanResponderGestureState, IPanResponderCallbacks, IGestureResponderHandlers, IPanResponderInstance, } from './pan-responder';
8
+ export type { IComponentRegistration, INativeEventBinding, INativeViewConfig, INativeViewConfigSource, IPropProcessor, } from './registry';
9
+ export type { ISymbioteNode, ISymbioteEvent, IListener } from './node';
10
+ export { SymbioteSurface, createSurface } from './surface';
11
+ export { setEventDispatcher } from './dispatch';
12
+ export { setColorProcessor, processColor, dispatchViewCommand, sendAccessibilityEvent, setNativeProps, getNativeTag, getNativeNode, whenCommitted, measure, measureInWindow, measureLayout, disposeRoot, } from './commit';
13
+ export { toPublicInstance } from './host-instance';
14
+ export type { IHostInstance } from './host-instance';
15
+ export { PlatformColor, DynamicColorIOS, isOpaqueColorValue } from './platform-color';
16
+ export type { IColorValue, IOpaqueColorValue, IDynamicColorIOSTuple } from './platform-color';
17
+ export { processBoxShadow } from './process-box-shadow';
18
+ export type { IParsedBoxShadow } from './process-box-shadow';
19
+ export { processFilter } from './process-filter';
20
+ export type { IParsedFilter, IParsedDropShadow } from './process-filter';
21
+ export { processTransformOrigin } from './process-transform-origin';
22
+ export { processTransform } from './process-transform';
23
+ export { processAspectRatio } from './process-aspect-ratio';
24
+ export { processFontVariant } from './process-font-variant';
25
+ export { processBackgroundImage } from './process-background-image';
26
+ export type { IParsedBackgroundImage } from './process-background-image';
27
+ export { flattenStyle } from './style';
28
+ export type { IViewStyle, ITextStyle, IStyleProp, IDimensionValue, IFlexAlign, IFlexJustify, ITransformProp, IBoxShadowValue, IDropShadowValue, IFilterFunction, IColorStopValue, ILinearGradientValue, IRadialGradientValue, IRadialGradientPosition, IRadialGradientShape, IRadialGradientSize, IBackgroundImageValue, IBlendMode, } from './styles';
29
+ export { StyleSheet, computeHairlineWidth } from './style-sheet';
30
+ export { registerStyles, resolveClassName, clearGlobalStyles, scopeClassName, isClassNameValue, } from './style-registry';
31
+ export type { IClassNameValue, IClassToggleMap, IScopableClassValue } from './style-registry';
32
+ export { Platform } from './platform';
33
+ export type { IPlatformStatic, IPlatformOSType, IPlatformSelectSpec } from './platform';
34
+ export type { IPlatformConstantsIOS } from './platform/index.ios';
35
+ export type { IPlatformConstantsAndroid } from './platform/index.android';
36
+ export { dlog, isDebug } from './debug';
37
+ export { getNativeModule, getEnforcingNativeModule } from './native-modules';
38
+ export { installDeviceEventHub, NativeEventEmitter, setDeviceEventSource } from './native-events';
39
+ export type { IEventSubscription, IEventEmitterModule, INativeEventListener, IDeviceEventSource, } from './native-events';
40
+ export { AnimatedNode, AnimatedWithChildren, AnimatedValue, AnimatedValueXY, AnimatedColor, AnimatedInterpolation, AnimatedAddition, AnimatedSubtraction, AnimatedMultiplication, AnimatedDivision, AnimatedModulo, AnimatedDiffClamp, AnimatedEvent, add, subtract, multiply, divide, modulo, diffClamp, event, forkEvent, unforkEvent, attachNativeEvent, attachNativeEventHandler, flushValue, Easing, createNumericInterpolation, checkValidRanges, TimingAnimation, SpringAnimation, DecayAnimation, AnimatedTracking, timing, spring, decay, parallel, sequence, stagger, loop, delay, nativeAnimated, isNativeAnimatedAvailable, AnimatedProps, AnimatedStyle, AnimatedTransform, AnimatedMock, reduceProps, isAnimatedNode, readPassthroughStyle, resolveHostNode, } from './animated';
41
+ export type { IValueXY, IRgbaValue, IColorInput, IEventConfig, IEventListener, IAnimatedEventHandler, INativeEventAttachment, IValueListener, IEasingFunction, IInterpolationConfig, IExtrapolateType, IAnimation, IEndCallback, IEndResult, ICompositeAnimation, ITimingConfig, ISpringConfig, IDecayConfig, IParallelConfig, ILoopAnimationConfig, INativeNodeConfig, INativeAnimationConfig, INativeEventMapping, IPlatformConfig, } from './animated';
42
+ export { getSlot } from './fabric';
43
+ export type { IFabricSlot, IFabricNode, IFabricChildSet, IFabricProps, IFabricEventHandler, IRootTag, IMeasureOnSuccess, IMeasureInWindowOnSuccess, IMeasureLayoutOnSuccess, } from './fabric';
44
+ export { Alert } from './alert';
45
+ export type { IAlertType, IAlertButtonStyle, IAlertButton, IAlertButtons, IAlertOptions, } from './alert';
46
+ export { Share } from './share';
47
+ export type { IShareContent, IShareOptions, IShareAction } from './share';
48
+ export { ActionSheetIOS } from './action-sheet-ios';
49
+ export type { IActionSheetIOSOptions, IShareActionSheetIOSOptions, IShareActionSheetError, } from './action-sheet-ios';
50
+ export { Linking } from './linking';
51
+ export type { IUrlEvent } from './linking';
52
+ export { Vibration } from './vibration';
53
+ export { ToastAndroid } from './toast-android';
54
+ export { Settings } from './settings';
55
+ export { I18nManager } from './i18n-manager';
56
+ export type { II18nManagerConstants } from './i18n-manager';
57
+ export { Dimensions } from './dimensions';
58
+ export type { IDisplayMetrics, IDisplayMetricsAndroid, IDimensionsPayload, IDimensionsSet, IDimensionsKey, IDimensionsChangeListener, IDimensionsStatic, } from './dimensions';
59
+ export { PixelRatio } from './pixel-ratio';
60
+ export type { IPixelRatioStatic } from './pixel-ratio';
61
+ export { Appearance } from './appearance';
62
+ export type { IColorSchemeName, IColorSchemePreference } from './appearance';
63
+ export { AppState } from './app-state';
64
+ export type { IAppStateStatus, IAppStateEvent } from './app-state';
65
+ export { createAppRegistry } from './app-registry';
66
+ export type { IAppRegistry, ICreateAppRegistryResult, IAppParameters, IRunnable, IHostRegistrar, IRegistry, IHeadlessTask, ITaskProvider, ITaskCanceller, ITaskCancelProvider, } from './app-registry';
67
+ export { Keyboard, KEYBOARD_EVENT } from './keyboard';
68
+ export type { IKeyboardEventName, IKeyboardEvent, IKeyboardMetrics } from './keyboard';
69
+ export { currentlyFocusedInput, setInputFocused, setInputBlurred, blurTextInput, } from './text-input-state';
70
+ export { LayoutAnimation } from './layout-animation';
71
+ export type { ILayoutAnimationType, ILayoutAnimationProperty, ILayoutAnimationConfig, ILayoutAnimationAnim, ILayoutAnimationTypes, ILayoutAnimationProperties, } from './layout-animation';
72
+ export { BackHandler } from './back-handler';
73
+ export type { IBackPressEventName, IBackPressHandler } from './back-handler';
74
+ export { PermissionsAndroid, PERMISSIONS, RESULTS } from './permissions-android';
75
+ export type { IPermission, IPermissionStatus, IRationale } from './permissions-android';
76
+ export { AccessibilityInfo } from './accessibility-info';
77
+ export type { IAccessibilityChangeEvent, IAccessibilityChangeEventName, IAccessibilityChangeEventHandler, IAccessibilityAnnouncementFinishedEvent, IAnnounceForAccessibilityOptions, IAccessibilityInfoStatic, IAccessibilityEventType, IAccessibilityHandle, } from './accessibility-info/shared';
78
+ export { applyStatusBarProps, statusBarImperative, statusBarCurrentHeight } from './status-bar';
79
+ export { hideTransition, STATUS_BAR_MANAGER, ANIMATED_HIDE_TRANSITION, STATIC_HIDE_TRANSITION, } from './status-bar/shared';
80
+ export type { IStatusBarProps, IStatusBarStyle, IStatusBarAnimation, IStatusBarImperative, } from './status-bar/shared';
package/build/index.js ADDED
@@ -0,0 +1,72 @@
1
+ // @symbiote-native/engine: the retained shadow-tree + clone-on-write commit engine.
2
+ // Every framework adapter drives this tiny mutation API; all Fabric-specific
3
+ // logic (tag allocation, view-name resolution, clone-on-write, event
4
+ // normalization) lives behind it, in one place.
5
+ export { createElement, createRawText, createAnchor, isAnchor, appendChild, insertBefore, removeChild, setProp, setEventListener, routeProp, getExplicitStyle, setText, isSymbioteNode, RAW_TEXT_COMPONENT, } from './node';
6
+ export { isEventFor } from './view-config';
7
+ export { registerComponent, setNativeViewConfigSource } from './registry';
8
+ // InteractionManager: pure JS (timers + emitter), framework-agnostic, so it lives
9
+ // here; every adapter re-exports it.
10
+ export { InteractionManager, Events as InteractionManagerEvents } from './interaction-manager';
11
+ // PanResponder: pure JS gesture recognition over the View responder props,
12
+ // framework-agnostic, so it lives here; every adapter re-exports it.
13
+ export { default as PanResponder } from './pan-responder';
14
+ export { SymbioteSurface, createSurface } from './surface';
15
+ export { setEventDispatcher } from './dispatch';
16
+ export { setColorProcessor, processColor, dispatchViewCommand, sendAccessibilityEvent, setNativeProps, getNativeTag, getNativeNode, whenCommitted, measure, measureInWindow, measureLayout, disposeRoot, } from './commit';
17
+ // The public instance grafted onto a host node by every adapter (React's getPublicInstance,
18
+ // the Vue renderer's createElement): the imperative measure/setNativeProps/focus API. Lives
19
+ // here because it depends only on engine internals, so all adapters inherit it identically.
20
+ export { toPublicInstance } from './host-instance';
21
+ export { PlatformColor, DynamicColorIOS, isOpaqueColorValue } from './platform-color';
22
+ // CSS-style processors (boxShadow/filter): RN parses these in JS before native because
23
+ // enableNativeCSSParsing() defaults to false. Exported so an adapter / test can reuse them.
24
+ export { processBoxShadow } from './process-box-shadow';
25
+ export { processFilter } from './process-filter';
26
+ export { processTransformOrigin } from './process-transform-origin';
27
+ export { processTransform } from './process-transform';
28
+ export { processAspectRatio } from './process-aspect-ratio';
29
+ export { processFontVariant } from './process-font-variant';
30
+ export { processBackgroundImage } from './process-background-image';
31
+ export { flattenStyle } from './style';
32
+ export { StyleSheet, computeHairlineWidth } from './style-sheet';
33
+ export { registerStyles, resolveClassName, clearGlobalStyles, scopeClassName, isClassNameValue, } from './style-registry';
34
+ export { Platform } from './platform';
35
+ export { dlog, isDebug } from './debug';
36
+ export { getNativeModule, getEnforcingNativeModule } from './native-modules';
37
+ export { installDeviceEventHub, NativeEventEmitter, setDeviceEventSource } from './native-events';
38
+ export { AnimatedNode, AnimatedWithChildren, AnimatedValue, AnimatedValueXY, AnimatedColor, AnimatedInterpolation, AnimatedAddition, AnimatedSubtraction, AnimatedMultiplication, AnimatedDivision, AnimatedModulo, AnimatedDiffClamp, AnimatedEvent, add, subtract, multiply, divide, modulo, diffClamp, event, forkEvent, unforkEvent, attachNativeEvent, attachNativeEventHandler, flushValue, Easing, createNumericInterpolation, checkValidRanges, TimingAnimation, SpringAnimation, DecayAnimation, AnimatedTracking, timing, spring, decay, parallel, sequence, stagger, loop, delay, nativeAnimated, isNativeAnimatedAvailable, AnimatedProps, AnimatedStyle, AnimatedTransform, AnimatedMock, reduceProps, isAnimatedNode, readPassthroughStyle, resolveHostNode, } from './animated';
39
+ export { getSlot } from './fabric';
40
+ // Imperative runtime modules: framework-agnostic native-bridge consumers (no visual, no
41
+ // lifecycle), moved here from @symbiote-native/react so every adapter re-exports the SAME module.
42
+ // Native module names are platform-selected and device-verified, not headless (CLAUDE.md
43
+ // <native_module_name_is_platform_specific>).
44
+ export { Alert } from './alert';
45
+ export { Share } from './share';
46
+ export { ActionSheetIOS } from './action-sheet-ios';
47
+ export { Linking } from './linking';
48
+ export { Vibration } from './vibration';
49
+ export { ToastAndroid } from './toast-android';
50
+ export { Settings } from './settings';
51
+ export { I18nManager } from './i18n-manager';
52
+ // Device-state / event modules (Dimensions, Appearance, AppState, Keyboard, …).
53
+ export { Dimensions } from './dimensions';
54
+ // PixelRatio: derives from the Dimensions singleton, framework-agnostic, so it lives
55
+ // here; every adapter re-exports it.
56
+ export { PixelRatio } from './pixel-ratio';
57
+ export { Appearance } from './appearance';
58
+ export { AppState } from './app-state';
59
+ // AppRegistry core: registry bookkeeping + host-registrar bridge + headless tasks, shared by
60
+ // every adapter. Each adapter calls createAppRegistry with its own runnableFor (the one
61
+ // framework-specific seam — how to build a runnable from a component provider).
62
+ export { createAppRegistry } from './app-registry';
63
+ export { Keyboard, KEYBOARD_EVENT } from './keyboard';
64
+ export { currentlyFocusedInput, setInputFocused, setInputBlurred, blurTextInput, } from './text-input-state';
65
+ export { LayoutAnimation } from './layout-animation';
66
+ export { BackHandler } from './back-handler';
67
+ export { PermissionsAndroid, PERMISSIONS, RESULTS } from './permissions-android';
68
+ export { AccessibilityInfo } from './accessibility-info';
69
+ // StatusBar: values from the platform-selected './status-bar', types from '-shared' (the
70
+ // .ios re-export would otherwise duplicate-export the type symbols).
71
+ export { applyStatusBarProps, statusBarImperative, statusBarCurrentHeight } from './status-bar';
72
+ export { hideTransition, STATUS_BAR_MANAGER, ANIMATED_HIDE_TRANSITION, STATIC_HIDE_TRANSITION, } from './status-bar/shared';
@@ -0,0 +1,45 @@
1
+ export declare const Events: {
2
+ readonly interactionStart: "interactionStart";
3
+ readonly interactionComplete: "interactionComplete";
4
+ };
5
+ export type IInteractionEvent = (typeof Events)[keyof typeof Events];
6
+ export type ISimpleTask = {
7
+ name: string;
8
+ run: () => void;
9
+ };
10
+ export type IPromiseTask = {
11
+ name: string;
12
+ gen: () => Promise<unknown>;
13
+ };
14
+ export type ITask = ISimpleTask | IPromiseTask | (() => void);
15
+ export type IHandle = number;
16
+ export type ICancellable<T> = {
17
+ then: Promise<T>['then'];
18
+ done: (onDone?: () => void) => void;
19
+ cancel: () => void;
20
+ };
21
+ type IEventListener = (...args: unknown[]) => void;
22
+ declare class InteractionManagerImpl {
23
+ readonly Events: {
24
+ readonly interactionStart: "interactionStart";
25
+ readonly interactionComplete: "interactionComplete";
26
+ };
27
+ private emitter;
28
+ private taskQueue;
29
+ private interactionHandleCount;
30
+ private nextHandle;
31
+ private deadline;
32
+ private flushScheduled;
33
+ addListener(eventType: IInteractionEvent, listener: IEventListener): {
34
+ remove: () => void;
35
+ };
36
+ runAfterInteractions(task?: ITask): ICancellable<void>;
37
+ createInteractionHandle(): IHandle;
38
+ clearInteractionHandle(handle: IHandle): void;
39
+ setDeadline(deadline: number): void;
40
+ private runTask;
41
+ private scheduleFlush;
42
+ private flushQueue;
43
+ }
44
+ export declare const InteractionManager: InteractionManagerImpl;
45
+ export {};