@symbiote-native/engine 0.1.1 → 0.1.3

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 (85) hide show
  1. package/README.md +10 -0
  2. package/build/accessibility-info/index.android.js +8 -9
  3. package/build/accessibility-info/index.ios.js +8 -9
  4. package/build/accessibility-info/index.js +1 -1
  5. package/build/accessibility-info/shared.js +2 -1
  6. package/build/action-sheet-ios/index.js +4 -4
  7. package/build/alert/index.android.js +9 -9
  8. package/build/alert/index.ios.js +5 -5
  9. package/build/alert/index.js +2 -2
  10. package/build/alert/shared.js +1 -1
  11. package/build/animated/animated-component-shared.js +3 -4
  12. package/build/animated/animations/base.js +5 -5
  13. package/build/animated/animations/composition.js +9 -9
  14. package/build/animated/animations/decay.js +5 -5
  15. package/build/animated/animations/spring.js +5 -5
  16. package/build/animated/animations/timing.js +5 -5
  17. package/build/animated/animations/tracking.js +1 -1
  18. package/build/animated/color.js +2 -2
  19. package/build/animated/easing.js +1 -1
  20. package/build/animated/event.js +5 -5
  21. package/build/animated/graph.js +3 -4
  22. package/build/animated/index.js +24 -24
  23. package/build/animated/interpolation-node.js +2 -2
  24. package/build/animated/interpolation.js +2 -2
  25. package/build/animated/mock.js +8 -8
  26. package/build/animated/native/native-animated.js +6 -6
  27. package/build/animated/operators.js +4 -4
  28. package/build/animated/props.js +10 -10
  29. package/build/animated/style.js +5 -5
  30. package/build/animated/value-xy.js +2 -2
  31. package/build/animated/value.js +4 -4
  32. package/build/app-registry/index.js +2 -2
  33. package/build/app-state/index.js +3 -3
  34. package/build/appearance/index.js +3 -3
  35. package/build/back-handler/index.js +5 -6
  36. package/build/commit.js +21 -21
  37. package/build/dimensions/index.js +4 -5
  38. package/build/events/index.js +5 -5
  39. package/build/fabric.js +1 -1
  40. package/build/host-instance/index.js +3 -3
  41. package/build/i18n-manager/index.js +4 -5
  42. package/build/index.js +49 -49
  43. package/build/interaction-manager/index.js +1 -1
  44. package/build/keyboard/index.js +5 -5
  45. package/build/layout-animation/index.js +3 -4
  46. package/build/linking/index.android.js +2 -2
  47. package/build/linking/index.ios.js +1 -1
  48. package/build/linking/index.js +2 -2
  49. package/build/linking/shared.js +4 -4
  50. package/build/native-events.js +3 -3
  51. package/build/native-modules.js +2 -2
  52. package/build/node.js +5 -4
  53. package/build/pan-responder/index.js +1 -1
  54. package/build/permissions-android/index.js +5 -6
  55. package/build/pixel-ratio/index.js +1 -1
  56. package/build/platform/index.android.js +2 -2
  57. package/build/platform/index.ios.js +2 -2
  58. package/build/platform/index.js +1 -2
  59. package/build/platform/shared.js +2 -3
  60. package/build/process-aspect-ratio.js +1 -1
  61. package/build/process-background-image/index.js +3 -3
  62. package/build/process-box-shadow/index.js +3 -3
  63. package/build/process-filter.js +3 -3
  64. package/build/process-transform/index.js +1 -1
  65. package/build/process-transform-origin/index.js +1 -1
  66. package/build/settings/index.js +5 -7
  67. package/build/share/index.android.js +4 -5
  68. package/build/share/index.ios.js +4 -4
  69. package/build/share/index.js +2 -2
  70. package/build/share/shared.js +1 -1
  71. package/build/status-bar/index.android.js +5 -5
  72. package/build/status-bar/index.ios.js +4 -5
  73. package/build/status-bar/index.js +1 -1
  74. package/build/status-bar/shared.js +1 -1
  75. package/build/style-registry/index.js +12 -16
  76. package/build/style-sheet/index.js +3 -3
  77. package/build/surface.js +3 -3
  78. package/build/text-input-state.js +2 -2
  79. package/build/toast-android/index.js +5 -5
  80. package/build/vibration/index.android.js +2 -3
  81. package/build/vibration/index.ios.js +1 -1
  82. package/build/vibration/index.js +2 -2
  83. package/build/vibration/shared.js +6 -7
  84. package/build/view-config.js +1 -1
  85. package/package.json +2 -2
@@ -2,10 +2,10 @@
2
2
  // `transform` whose entries may themselves be AnimatedNodes. Ported from RN's
3
3
  // AnimatedStyle.js + AnimatedTransform.js, NUMERIC path only: the native-driver
4
4
  // config (__makeNative / __getNativeConfig / allowlist) and the web/string/color
5
- // branches are stripped (ADR 0016). On __getValue() each node re-pulls its
5
+ // branches are stripped. On __getValue() each node re-pulls its
6
6
  // animated entries into a plain flat object the props leaf hoists onto the view.
7
- import { AnimatedNode, AnimatedWithChildren } from './graph';
8
- import { flattenStyle } from '../style';
7
+ import { AnimatedNode, AnimatedWithChildren } from './graph.js';
8
+ import { flattenStyle } from '../style/index.js';
9
9
  function isAnimatedNode(value) {
10
10
  return value instanceof AnimatedNode;
11
11
  }
@@ -88,7 +88,7 @@ export class AnimatedTransform extends AnimatedWithChildren {
88
88
  super.__detach();
89
89
  }
90
90
  // Native: one entry per transform, animated entries pointing at their value's
91
- // native tag, static ones carrying the (angle-normalized) literal (ADR 0017).
91
+ // native tag, static ones carrying the (angle-normalized) literal.
92
92
  __getNativeConfig() {
93
93
  const transforms = [];
94
94
  for (const entry of this.transforms) {
@@ -171,7 +171,7 @@ export class AnimatedStyle extends AnimatedWithChildren {
171
171
  node.__removeChild(this);
172
172
  super.__detach();
173
173
  }
174
- // Native: map each animated style key to its value's native tag (ADR 0017).
174
+ // Native: map each animated style key to its value's native tag.
175
175
  // Static keys are not in the native style node. The view already carries them.
176
176
  __getNativeConfig() {
177
177
  const style = {};
@@ -2,9 +2,9 @@
2
2
  // driving node itself: it multiplexes two ordinary AnimatedValues (x, y), so the
3
3
  // same clone-on-write and listener machinery that powers AnimatedValue applies
4
4
  // per-axis. Ported from RN's AnimatedValueXY.js with the native-driver and
5
- // platform-config branches removed (ADR 0016). The two child values carry their
5
+ // platform-config branches removed. The two child values carry their
6
6
  // own native state if they are ever made native.
7
- import { AnimatedValue } from './value';
7
+ import { AnimatedValue } from './value.js';
8
8
  let nextListenerId = 1;
9
9
  function isAnimatedValuePair(value) {
10
10
  return value.x instanceof AnimatedValue && value.y instanceof AnimatedValue;
@@ -1,11 +1,11 @@
1
1
  // AnimatedValue: the standard driving value. One value can drive many props in
2
2
  // sync but is driven by one mechanism at a time: a new mechanism (a fresh
3
3
  // animation, or setValue) stops the previous one. Ported from RN's
4
- // AnimatedValue.js with the native-driver branches removed (ADR 0016); tracking
4
+ // AnimatedValue.js with the native-driver branches removed; tracking
5
5
  // (animating toward another animated node) is deferred.
6
- import { AnimatedWithChildren, flushValue } from './graph';
7
- import { AnimatedInterpolation } from './interpolation-node';
8
- import { nativeAnimated, } from './native/native-animated';
6
+ import { AnimatedWithChildren, flushValue } from './graph.js';
7
+ import { AnimatedInterpolation } from './interpolation-node.js';
8
+ import { nativeAnimated, } from './native/native-animated.js';
9
9
  export class AnimatedValue extends AnimatedWithChildren {
10
10
  value;
11
11
  startingValue;
@@ -11,8 +11,8 @@
11
11
  // registrar. Reached the same way shared reaches processColor: a dependency-injected seam
12
12
  // (setHostRegistrar), so the core stays react-native-free and the app glue wires the host once
13
13
  // at startup.
14
- import { getNativeModule } from '../native-modules';
15
- import { dlog } from '../debug';
14
+ import { getNativeModule } from '../native-modules.js';
15
+ import { dlog } from '../debug.js';
16
16
  const HEADLESS_TASK_MODULE = 'HeadlessJsTaskSupport';
17
17
  // Builds one adapter's AppRegistry. `runnableFor` is the sole framework-specific seam: given a
18
18
  // component provider and a getter for the CURRENT wrapper-component provider (read at mount
@@ -5,9 +5,9 @@
5
5
  // NativeEventEmitter bound to the AppState native module and maps them onto the
6
6
  // public 'change'/'memoryWarning'/'focus'/'blur' listeners, mirroring RN's
7
7
  // Libraries/AppState/AppState.js.
8
- import { getNativeModule } from '../native-modules';
9
- import { installDeviceEventHub, NativeEventEmitter, } from '../native-events';
10
- import { dlog } from '../debug';
8
+ import { getNativeModule } from '../native-modules.js';
9
+ import { installDeviceEventHub, NativeEventEmitter, } from '../native-events.js';
10
+ import { dlog } from '../debug.js';
11
11
  // The native module name RN registers AppState under, confirmed from its spec
12
12
  // (specs_DEPRECATED/modules/INativeAppState.js, `TurboModuleRegistry.getEnforcing('AppState')`).
13
13
  const APP_STATE_MODULE = 'AppState';
@@ -4,9 +4,9 @@
4
4
  // native module (which RN keys its appearance events off of) and re-broadcasts to
5
5
  // JS listeners as a plain `{ colorScheme }` payload. Mirrors RN's
6
6
  // Libraries/Utilities/Appearance.js, slimmed to the parts we need.
7
- import { getNativeModule } from '../native-modules';
8
- import { installDeviceEventHub, NativeEventEmitter, } from '../native-events';
9
- import { dlog } from '../debug';
7
+ import { getNativeModule } from '../native-modules.js';
8
+ import { installDeviceEventHub, NativeEventEmitter, } from '../native-events.js';
9
+ import { dlog } from '../debug.js';
10
10
  // The native module name RN registers the appearance module under, confirmed from
11
11
  // its spec (specs_DEPRECATED/modules/INativeAppearance.js, `TurboModuleRegistry.get('Appearance')`).
12
12
  const APPEARANCE_MODULE = 'Appearance';
@@ -6,15 +6,14 @@
6
6
  // Android-only by intent: iOS has no hardware back button, so the whole module
7
7
  // degrades to a no-op when the native module is absent, matching RN's
8
8
  // BackHandler.ios.js stub. Mirrors RN's Libraries/Utilities/BackHandler.android.js.
9
- import { getNativeModule } from '../native-modules';
10
- import { installDeviceEventHub, NativeEventEmitter, } from '../native-events';
11
- import { dlog } from '../debug';
9
+ import { getNativeModule } from '../native-modules.js';
10
+ import { installDeviceEventHub, NativeEventEmitter, } from '../native-events.js';
11
+ import { dlog } from '../debug.js';
12
12
  // The native module name RN registers this under. NOTE: this is the name the
13
13
  // INativeDeviceEventManager spec resolves via
14
14
  // `TurboModuleRegistry.get('DeviceEventManager')`, NOT the spec filename
15
- // `INativeDeviceEventManager`. Per the symbiote invariant, a module name is only
16
- // provable on a real host (a headless fake answers to any name); this name is
17
- // device-verify-pending (Android). See .docs/native-module-platform-routing.md.
15
+ // `INativeDeviceEventManager`. A module name is only provable on a real host (a
16
+ // headless fake answers to any name); this name is device-verify-pending (Android).
18
17
  const DEVICE_EVENT_MANAGER_MODULE = 'DeviceEventManager';
19
18
  // The device event native emits when the hardware back button is pressed.
20
19
  const DEVICE_BACK_EVENT = 'hardwareBackPress';
package/build/commit.js CHANGED
@@ -12,21 +12,21 @@
12
12
  // forces each ancestor to re-clone too, because a persistent parent holds
13
13
  // references to specific child handles. That bubble is inherent to a persistent
14
14
  // tree and is exactly what React's own Fabric renderer does.
15
- import { getSlot, } from './fabric';
16
- import { createElement, isAnchor, RAW_TEXT_COMPONENT, VIRTUAL_TEXT_COMPONENT, } from './node';
17
- import { dlog, isDebug } from './debug';
18
- import { flattenStyle } from './style';
19
- import { registeredProcessor } from './registry';
20
- import { nextTag } from './tags';
21
- import { isOpaqueColorValue } from './platform-color';
22
- import { processBoxShadow } from './process-box-shadow';
23
- import { registerPostCommit, runPostCommitHooks } from './post-commit';
24
- import { processFilter } from './process-filter';
25
- import { processTransformOrigin } from './process-transform-origin';
26
- import { processTransform } from './process-transform';
27
- import { processAspectRatio } from './process-aspect-ratio';
28
- import { processFontVariant } from './process-font-variant';
29
- import { processBackgroundImage } from './process-background-image';
15
+ import { getSlot, } from './fabric.js';
16
+ import { createElement, isAnchor, RAW_TEXT_COMPONENT, VIRTUAL_TEXT_COMPONENT, } from './node.js';
17
+ import { dlog, isDebug } from './debug.js';
18
+ import { flattenStyle } from './style/index.js';
19
+ import { registeredProcessor } from './registry.js';
20
+ import { nextTag } from './tags.js';
21
+ import { isOpaqueColorValue } from './platform-color.js';
22
+ import { processBoxShadow } from './process-box-shadow/index.js';
23
+ import { registerPostCommit, runPostCommitHooks } from './post-commit.js';
24
+ import { processFilter } from './process-filter.js';
25
+ import { processTransformOrigin } from './process-transform-origin/index.js';
26
+ import { processTransform } from './process-transform/index.js';
27
+ import { processAspectRatio } from './process-aspect-ratio.js';
28
+ import { processFontVariant } from './process-font-variant.js';
29
+ import { processBackgroundImage } from './process-background-image/index.js';
30
30
  // Per-commit work counters, surfaced via dlog so a device run can prove the
31
31
  // engine is incremental (created=0 with clones after the first mount).
32
32
  const stats = { created: 0, cloneProps: 0, cloneChildren: 0, reused: 0 };
@@ -553,13 +553,13 @@ function commitContainer(rootTag) {
553
553
  `cloneChildren=${stats.cloneChildren} reused=${stats.reused}`);
554
554
  }
555
555
  }
556
- // Targeted per-frame prop write for the JS-driven Animated path (ADR 0016). RN
557
- // flushes an animation frame with an in-place `instance.setNativeProps(...)`; we have
558
- // no in-place mutation (Fabric is persistent), so a frame is one scoped commit: mutate
556
+ // Targeted per-frame prop write for the JS-driven Animated path. RN flushes an
557
+ // animation frame with an in-place `instance.setNativeProps(...)`; we have no
558
+ // in-place mutation (Fabric is persistent), so a frame is one scoped commit: mutate
559
559
  // the node's desired props, then re-reconcile its surface. The engine clones only this
560
560
  // node (props differ), bubbles the re-clone to the root, reuses every sibling subtree
561
561
  // by reference, and emits a single completeRoot. This is the "slow tier", viable for a
562
- // single shallow animation; the native driver (ADR 0017) is the answer for scale.
562
+ // single shallow animation; driving the animation natively is the answer for scale.
563
563
  export function setNativeProps(node, partial) {
564
564
  const record = mirror.get(node);
565
565
  if (record === undefined) {
@@ -581,8 +581,8 @@ export function setNativeProps(node, partial) {
581
581
  commitContainer(record.rootTag);
582
582
  }
583
583
  // The committed reactTag of a node (stable across clone-on-write), for binding the
584
- // Animated native driver via connectAnimatedNodeToView (ADR 0017). Undefined until the
585
- // node has been committed at least once.
584
+ // native Animated driver via connectAnimatedNodeToView. Undefined until the node
585
+ // has been committed at least once.
586
586
  export function getNativeTag(node) {
587
587
  return mirror.get(node)?.tag;
588
588
  }
@@ -5,16 +5,15 @@
5
5
  // event whose payload IS a fresh IDimensionsPayload. We cache the metrics and notify
6
6
  // 'change' listeners on each update, exactly as RN does.
7
7
  //
8
- // The native contract is confirmed from RN's TurboModule spec at
9
- // .vendors/.../specs_DEPRECATED/modules/INativeDeviceInfo.js:
8
+ // The native contract mirrors React Native's TurboModule spec for DeviceInfo:
10
9
  // getConstants(): { Dimensions: { window?, screen?, windowPhysicalPixels?,
11
10
  // screenPhysicalPixels? } }
12
11
  // We resolve it through the same generic native-module bridge as Platform
13
12
  // (getNativeModule), so this module stays importable headless before a fake proxy
14
13
  // is installed.
15
- import { getNativeModule } from '../native-modules';
16
- import { installDeviceEventHub, NativeEventEmitter, } from '../native-events';
17
- import { dlog } from '../debug';
14
+ import { getNativeModule } from '../native-modules.js';
15
+ import { installDeviceEventHub, NativeEventEmitter, } from '../native-events.js';
16
+ import { dlog } from '../debug.js';
18
17
  // The native module name RN registers device metrics under.
19
18
  const DEVICE_INFO_MODULE = 'DeviceInfo';
20
19
  // The device event native emits when metrics change; its payload is a fresh
@@ -5,11 +5,11 @@
5
5
  // node it started on (or a descendant). Bubbling events walk target -> root,
6
6
  // invoking each ancestor's listener until one calls stopPropagation. Layout is a
7
7
  // direct event in RN and is delivered only to its own target.
8
- import { dlog } from '../debug';
9
- import { runWrapped } from '../dispatch';
10
- import { getSlot } from '../fabric';
11
- import { isAnchor, isSymbioteNode } from '../node';
12
- import { registeredNativeEvent } from '../registry';
8
+ import { dlog } from '../debug.js';
9
+ import { runWrapped } from '../dispatch.js';
10
+ import { getSlot } from '../fabric.js';
11
+ import { isAnchor, isSymbioteNode } from '../node.js';
12
+ import { registeredNativeEvent } from '../registry.js';
13
13
  // Raw Fabric event name -> listener name. Generic bubbling events live here; press
14
14
  // is synthesized from a touch sequence and layout is direct, so both are handled
15
15
  // outside this table.
package/build/fabric.js CHANGED
@@ -4,7 +4,7 @@
4
4
  //
5
5
  // The live object is a lazy caching proxy: every property access mints a fresh
6
6
  // host function, so we read each method once and cache a plain facade.
7
- import { dlog } from './debug';
7
+ import { dlog } from './debug.js';
8
8
  let cached;
9
9
  export function getSlot() {
10
10
  if (cached)
@@ -8,9 +8,9 @@
8
8
  // This lives in the engine, not an adapter: it depends only on engine internals (the commit
9
9
  // free functions + the retained node), so every adapter inherits the SAME public instance for
10
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';
11
+ import { measure as engineMeasure, measureInWindow as engineMeasureInWindow, measureLayout as engineMeasureLayout, setNativeProps as engineSetNativeProps, dispatchViewCommand, } from '../commit.js';
12
+ import { isSymbioteNode } from '../node.js';
13
+ import { dlog } from '../debug.js';
14
14
  const FOCUS_COMMAND = 'focus';
15
15
  const BLUR_COMMAND = 'blur';
16
16
  function isHostInstance(node) {
@@ -12,12 +12,11 @@
12
12
  // allowRTL(allowRTL: boolean)
13
13
  // forceRTL(forceRTL: boolean)
14
14
  // swapLeftAndRightInRTL(flipStyles: boolean)
15
- import { dlog } from '../debug';
16
- import { getNativeModule } from '../native-modules';
15
+ import { dlog } from '../debug.js';
16
+ import { getNativeModule } from '../native-modules.js';
17
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.
18
+ // platforms). A module name is only provable on a real host — a headless fake
19
+ // answers to any name — so this name is still pending verification on device.
21
20
  const I18N_MANAGER_MODULE = 'I18nManager';
22
21
  // RN's fallback constants when no native module is linked (headless / not yet on
23
22
  // device): not RTL, and the iOS default of swapping in RTL.
package/build/index.js CHANGED
@@ -2,71 +2,71 @@
2
2
  // Every framework adapter drives this tiny mutation API; all Fabric-specific
3
3
  // logic (tag allocation, view-name resolution, clone-on-write, event
4
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';
5
+ export { createElement, createRawText, createAnchor, isAnchor, appendChild, insertBefore, removeChild, setProp, setEventListener, routeProp, getExplicitStyle, setText, isSymbioteNode, RAW_TEXT_COMPONENT, } from './node.js';
6
+ export { isEventFor } from './view-config.js';
7
+ export { registerComponent, setNativeViewConfigSource } from './registry.js';
8
8
  // InteractionManager: pure JS (timers + emitter), framework-agnostic, so it lives
9
9
  // here; every adapter re-exports it.
10
- export { InteractionManager, Events as InteractionManagerEvents } from './interaction-manager';
10
+ export { InteractionManager, Events as InteractionManagerEvents } from './interaction-manager/index.js';
11
11
  // PanResponder: pure JS gesture recognition over the View responder props,
12
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';
13
+ export { default as PanResponder } from './pan-responder/index.js';
14
+ export { SymbioteSurface, createSurface } from './surface.js';
15
+ export { setEventDispatcher } from './dispatch.js';
16
+ export { setColorProcessor, processColor, dispatchViewCommand, sendAccessibilityEvent, setNativeProps, getNativeTag, getNativeNode, whenCommitted, measure, measureInWindow, measureLayout, disposeRoot, } from './commit.js';
17
17
  // The public instance grafted onto a host node by every adapter (React's getPublicInstance,
18
18
  // the Vue renderer's createElement): the imperative measure/setNativeProps/focus API. Lives
19
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';
20
+ export { toPublicInstance } from './host-instance/index.js';
21
+ export { PlatformColor, DynamicColorIOS, isOpaqueColorValue } from './platform-color.js';
22
22
  // CSS-style processors (boxShadow/filter): RN parses these in JS before native because
23
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';
24
+ export { processBoxShadow } from './process-box-shadow/index.js';
25
+ export { processFilter } from './process-filter.js';
26
+ export { processTransformOrigin } from './process-transform-origin/index.js';
27
+ export { processTransform } from './process-transform/index.js';
28
+ export { processAspectRatio } from './process-aspect-ratio.js';
29
+ export { processFontVariant } from './process-font-variant.js';
30
+ export { processBackgroundImage } from './process-background-image/index.js';
31
+ export { flattenStyle } from './style/index.js';
32
+ export { StyleSheet, computeHairlineWidth } from './style-sheet/index.js';
33
+ export { registerStyles, resolveClassName, clearGlobalStyles, scopeClassName, isClassNameValue, } from './style-registry/index.js';
34
+ export { Platform } from './platform/index.js';
35
+ export { dlog, isDebug } from './debug.js';
36
+ export { getNativeModule, getEnforcingNativeModule } from './native-modules.js';
37
+ export { installDeviceEventHub, NativeEventEmitter, setDeviceEventSource } from './native-events.js';
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/index.js';
39
+ export { getSlot } from './fabric.js';
40
40
  // Imperative runtime modules: framework-agnostic native-bridge consumers (no visual, no
41
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';
42
+ // The native module a JS API talks to is chosen per platform and can only be confirmed on a
43
+ // real device or simulator, not headless (a headless fake resolves any module name).
44
+ export { Alert } from './alert/index.js';
45
+ export { Share } from './share/index.js';
46
+ export { ActionSheetIOS } from './action-sheet-ios/index.js';
47
+ export { Linking } from './linking/index.js';
48
+ export { Vibration } from './vibration/index.js';
49
+ export { ToastAndroid } from './toast-android/index.js';
50
+ export { Settings } from './settings/index.js';
51
+ export { I18nManager } from './i18n-manager/index.js';
52
52
  // Device-state / event modules (Dimensions, Appearance, AppState, Keyboard, …).
53
- export { Dimensions } from './dimensions';
53
+ export { Dimensions } from './dimensions/index.js';
54
54
  // PixelRatio: derives from the Dimensions singleton, framework-agnostic, so it lives
55
55
  // here; every adapter re-exports it.
56
- export { PixelRatio } from './pixel-ratio';
57
- export { Appearance } from './appearance';
58
- export { AppState } from './app-state';
56
+ export { PixelRatio } from './pixel-ratio/index.js';
57
+ export { Appearance } from './appearance/index.js';
58
+ export { AppState } from './app-state/index.js';
59
59
  // AppRegistry core: registry bookkeeping + host-registrar bridge + headless tasks, shared by
60
60
  // every adapter. Each adapter calls createAppRegistry with its own runnableFor (the one
61
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';
62
+ export { createAppRegistry } from './app-registry/index.js';
63
+ export { Keyboard, KEYBOARD_EVENT } from './keyboard/index.js';
64
+ export { currentlyFocusedInput, setInputFocused, setInputBlurred, blurTextInput, } from './text-input-state.js';
65
+ export { LayoutAnimation } from './layout-animation/index.js';
66
+ export { BackHandler } from './back-handler/index.js';
67
+ export { PermissionsAndroid, PERMISSIONS, RESULTS } from './permissions-android/index.js';
68
+ export { AccessibilityInfo } from './accessibility-info/index.js';
69
69
  // StatusBar: values from the platform-selected './status-bar', types from '-shared' (the
70
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';
71
+ export { applyStatusBarProps, statusBarImperative, statusBarCurrentHeight } from './status-bar/index.js';
72
+ export { hideTransition, STATUS_BAR_MANAGER, ANIMATED_HIDE_TRANSITION, STATIC_HIDE_TRANSITION, } from './status-bar/shared.js';
@@ -12,7 +12,7 @@
12
12
  // count that blocks the flush; `clearInteractionHandle` decrements it and, when the
13
13
  // last handle clears, schedules a flush on the next tick. `interactionStart` /
14
14
  // `interactionComplete` fire as the count crosses 0.
15
- import { dlog } from '../debug';
15
+ import { dlog } from '../debug.js';
16
16
  // A positive deadline (ms) makes the flush yield via setTimeout once that much event-
17
17
  // loop time has elapsed within one batch, letting touches interrupt; 0 (default) runs
18
18
  // the whole batch in one setImmediate.
@@ -3,11 +3,11 @@
3
3
  // subscribes through a NativeEventEmitter bound to the KeyboardObserver native
4
4
  // module, which RN keys its keyboard events off of. Mirrors RN's
5
5
  // Libraries/Components/Keyboard/Keyboard.js, slimmed to the parts we need.
6
- import { getNativeModule } from '../native-modules';
7
- import { installDeviceEventHub, NativeEventEmitter, } from '../native-events';
8
- import { dlog } from '../debug';
9
- import { blurTextInput, currentlyFocusedInput } from '../text-input-state';
10
- import { LayoutAnimation } from '../layout-animation';
6
+ import { getNativeModule } from '../native-modules.js';
7
+ import { installDeviceEventHub, NativeEventEmitter, } from '../native-events.js';
8
+ import { dlog } from '../debug.js';
9
+ import { blurTextInput, currentlyFocusedInput } from '../text-input-state.js';
10
+ import { LayoutAnimation } from '../layout-animation/index.js';
11
11
  // RN's scheduleLayoutAnimation falls back to the 'keyboard' animation type when the
12
12
  // event's easing string isn't a known LayoutAnimation type (Keyboard.js:200).
13
13
  const KEYBOARD_ANIMATION_TYPE = 'keyboard';
@@ -7,14 +7,13 @@
7
7
  //
8
8
  // It is a native-bridge consumer (RN's `Platform`/`StyleSheet` purity split puts
9
9
  // these in the adapter, not in shared, like Keyboard / StatusBar).
10
- import { getNativeModule } from '../native-modules';
11
- import { dlog } from '../debug';
10
+ import { getNativeModule } from '../native-modules.js';
11
+ import { dlog } from '../debug.js';
12
12
  // ---- native module routing ----------------------------------------------
13
13
  // DEVICE-VERIFY-PENDING: on bridgeless Fabric the layout-animation configure call
14
14
  // is exposed by RN through the UIManager surface (RN's non-Fabric path calls
15
15
  // `UIManager.configureNextLayoutAnimation`; the Fabric path routes the same args
16
- // onto `global.nativeFabricUIManager.configureNextLayoutAnimation`). Per
17
- // .docs/decisions/0012 and .docs/native-module-platform-routing.md the native
16
+ // onto `global.nativeFabricUIManager.configureNextLayoutAnimation`). The native
18
17
  // MODULE NAME is platform-specific and a headless fake answers to ANY name, so
19
18
  // the name below is the most plausible bridgeless candidate, NOT proven. Only the
20
19
  // simulator/device resolution log can confirm it; the fallback list is tried in
@@ -5,8 +5,8 @@
5
5
  //
6
6
  // device-verify-pending: the `IntentAndroid` name and routing are confirmed from RN
7
7
  // source but not yet exercised on a real Android host; only a bridgeless resolution
8
- // log there can prove the name. See .docs/native-module-platform-routing.md.
9
- import { createLinking } from './shared';
8
+ // log there can prove the name.
9
+ import { createLinking } from './shared.js';
10
10
  export const Linking = createLinking({
11
11
  moduleName: 'IntentAndroid',
12
12
  sendIntent: (module, action, extras) => {
@@ -2,7 +2,7 @@
2
2
  // (RN's TurboModuleRegistry.get('LinkingManager')); iOS has no `sendIntent`, so per
3
3
  // RN's Linking.js it rejects 'Unsupported'. Everything else is the shared core. Metro
4
4
  // picks this file on an iOS host; the base linking.ts re-exports it for web/headless.
5
- import { createLinking } from './shared';
5
+ import { createLinking } from './shared.js';
6
6
  export const Linking = createLinking({
7
7
  moduleName: 'LinkingManager',
8
8
  sendIntent: () => Promise.reject(new Error('Unsupported')),
@@ -2,5 +2,5 @@
2
2
  // platform file). Metro overrides this with linking.ios.ts / linking.android.ts on a
3
3
  // real iOS/Android host; off those, the iOS build is the fallback (its LinkingManager
4
4
  // resolves null elsewhere → graceful no-op). The barrel imports './linking', which
5
- // resolves here under tsc/tsx and to the platform file under Metro. See ADR 0019.
6
- export * from './index.ios';
5
+ // resolves here under tsc/tsx and to the platform file under Metro.
6
+ export * from './index.ios.js';
@@ -6,10 +6,10 @@
6
6
  //
7
7
  // Metro selects the platform file on a real host (linking.android.ts > linking.ts);
8
8
  // the base linking.ts re-exports the iOS build for web/headless. There is no runtime
9
- // `Platform.OS` read; the filename is the selector. See ADR 0019.
10
- import { installDeviceEventHub, NativeEventEmitter, } from '../native-events';
11
- import { getNativeModule } from '../native-modules';
12
- import { dlog } from '../debug';
9
+ // `Platform.OS` read; the filename is the selector.
10
+ import { installDeviceEventHub, NativeEventEmitter, } from '../native-events.js';
11
+ import { getNativeModule } from '../native-modules.js';
12
+ import { dlog } from '../debug.js';
13
13
  // The one event symbiote observes: an incoming deep link. RN's LinkingEventDefinitions.
14
14
  const URL_EVENT = 'url';
15
15
  // RN's _validateURL: a typo / empty URL must fail loudly at the call, not reach native.
@@ -6,9 +6,9 @@
6
6
  // second registration is a silent no-op. So we do NOT register our own hub on a
7
7
  // real host: the app injects RN's DeviceEventEmitter (the bus native actually
8
8
  // calls) via `setDeviceEventSource`, exactly like setColorProcessor. The built-in
9
- // hub below stays as the fallback bus for headless/non-RN runs. See .docs/decisions/0012.
10
- import { dlog } from './debug';
11
- import { runWrapped } from './dispatch';
9
+ // hub below stays as the fallback bus for headless/non-RN runs.
10
+ import { dlog } from './debug.js';
11
+ import { runWrapped } from './dispatch.js';
12
12
  // The single device-event bus. Native pushes into `emit`; subscribers (wrapped by
13
13
  // NativeEventEmitter) live in `listeners`, keyed by event name.
14
14
  const listeners = new Map();
@@ -7,8 +7,8 @@
7
7
  // This is first-party access, for symbiote's own modules (StatusBarManager,
8
8
  // KeyboardObserver, …). Third-party RN packages import `TurboModuleRegistry` from
9
9
  // `'react-native'` and read the same global themselves; they do not go through
10
- // here. See .docs/decisions/0012.
11
- import { dlog } from './debug';
10
+ // here.
11
+ import { dlog } from './debug.js';
12
12
  // The native module value crosses from an untyped HostObject into our types here;
13
13
  // the caller vouches for its shape via T (the single trust-boundary narrowing, no
14
14
  // per-call `as`). Native modules are always non-null objects.
package/build/node.js CHANGED
@@ -1,10 +1,11 @@
1
1
  // The retained shadow-tree. Adapters mutate this cheap in-memory tree through a
2
2
  // tiny API; the commit engine (commit.ts) later walks it and translates the
3
3
  // whole thing into Fabric's clone-on-write child sets. Keeping the retained
4
- // tree mutable while the Fabric mirror stays persistent is the core R2 trick,
5
- // and it lives here in shared so no adapter re-implements it.
6
- import { isEventFor } from './view-config';
7
- import { isClassNameValue, resolveClassName } from './style-registry';
4
+ // tree mutable while the Fabric mirror stays persistent lets every adapter mutate
5
+ // freely without touching Fabric's clone-on-write protocol directly, and it
6
+ // lives here in shared so no adapter re-implements it.
7
+ import { isEventFor } from './view-config.js';
8
+ import { isClassNameValue, resolveClassName } from './style-registry/index.js';
8
9
  const BRAND = Symbol('symbiote.node');
9
10
  // A node carries the Fabric view name directly, so adding a primitive (Image,
10
11
  // ScrollView, TextInput) is just a new string from the adapter, no core change.
@@ -11,7 +11,7 @@
11
11
  // events instead carry the live touches on `event.nativeEvent.touches` (and the
12
12
  // changed ones on `changedTouches`), so the centroid/velocity math here reads
13
13
  // those directly while keeping RN's accumulate-deltas-over-time behavior.
14
- import { dlog } from '../debug';
14
+ import { dlog } from '../debug.js';
15
15
  const SINGLE_TOUCH_COUNT = 1;
16
16
  // onShouldBlockNativeResponder defaults to true (RN: block native by default).
17
17
  const DEFAULT_BLOCK_NATIVE_RESPONDER = true;
@@ -17,13 +17,12 @@
17
17
  // requestPermission(permission): Promise<string>
18
18
  // shouldShowRequestPermissionRationale(permission): Promise<boolean>
19
19
  // requestMultiplePermissions(permissions): Promise<{[permission]: string}>
20
- import { getNativeModule } from '../native-modules';
21
- import { dlog } from '../debug';
20
+ import { getNativeModule } from '../native-modules.js';
21
+ import { dlog } from '../debug.js';
22
22
  // The native module name RN registers this TurboModule under
23
- // (`TurboModuleRegistry.get<Spec>('PermissionsAndroid')`). NOTE: per the
24
- // symbiote invariant, a module name is only provable on a real host (a headless
25
- // fake answers to any name); this name is device-verify-pending. See
26
- // .docs/native-module-platform-routing.md.
23
+ // (`TurboModuleRegistry.get<Spec>('PermissionsAndroid')`). NOTE: a module name is
24
+ // only provable on a real host (a headless fake answers to any name); this name
25
+ // is device-verify-pending.
27
26
  const PERMISSIONS_ANDROID_MODULE = 'PermissionsAndroid';
28
27
  // The runtime-permission result strings Android can return. Modeled as a frozen
29
28
  // `as const` map: the generated-style constant-map exception to "no magic
@@ -4,7 +4,7 @@
4
4
  // text-size factor (falling back to scale when unset), and the two conversion
5
5
  // helpers snap layout sizes (dp) onto the physical pixel grid. iOS-only
6
6
  // startDetecting() is a no-op, kept for API parity.
7
- import { Dimensions } from '../dimensions';
7
+ import { Dimensions } from '../dimensions/index.js';
8
8
  export const PixelRatio = {
9
9
  get() {
10
10
  return Dimensions.get('window').scale;
@@ -2,8 +2,8 @@
2
2
  // `OS` is the static 'android'; `Version` is the numeric API level and the rest come
3
3
  // from the PlatformConstants native module (RN spec NativePlatformConstantsAndroid.js,
4
4
  // a different payload from iOS). Metro picks this on an Android host. The module name is
5
- // the same 'PlatformConstants'; only the shape differs. See .docs/decisions/0022.
6
- import { createConstantsResolver } from './shared';
5
+ // the same 'PlatformConstants'; only the shape differs.
6
+ import { createConstantsResolver } from './shared.js';
7
7
  // The filename already selected this host: 'android' is a literal, not a probe.
8
8
  const OS_ANDROID = 'android';
9
9
  // RN reads isTV off the uiMode constant.