@symbiote-native/svelte 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 (219) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +161 -0
  3. package/build/bootstrap.d.ts +7 -0
  4. package/build/bootstrap.js +17 -0
  5. package/build/class-value.d.ts +6 -0
  6. package/build/class-value.js +81 -0
  7. package/build/components/RefreshControl.svelte +38 -0
  8. package/build/components/RefreshControl.svelte.d.ts +5 -0
  9. package/build/components/SafeAreaView.svelte +34 -0
  10. package/build/components/SafeAreaView.svelte.d.ts +5 -0
  11. package/build/components/Text.svelte +25 -0
  12. package/build/components/Text.svelte.d.ts +5 -0
  13. package/build/components/View.svelte +41 -0
  14. package/build/components/View.svelte.d.ts +5 -0
  15. package/build/components/activity-indicator/activity-indicator-platform.android.d.ts +3 -0
  16. package/build/components/activity-indicator/activity-indicator-platform.android.js +5 -0
  17. package/build/components/activity-indicator/activity-indicator-platform.d.ts +1 -0
  18. package/build/components/activity-indicator/activity-indicator-platform.ios.d.ts +3 -0
  19. package/build/components/activity-indicator/activity-indicator-platform.ios.js +6 -0
  20. package/build/components/activity-indicator/activity-indicator-platform.js +5 -0
  21. package/build/components/activity-indicator/activity-indicator-props.d.ts +5 -0
  22. package/build/components/activity-indicator/activity-indicator-props.js +1 -0
  23. package/build/components/activity-indicator/index.svelte +57 -0
  24. package/build/components/activity-indicator/index.svelte.d.ts +5 -0
  25. package/build/components/button-props.d.ts +5 -0
  26. package/build/components/button-props.js +1 -0
  27. package/build/components/button.svelte +71 -0
  28. package/build/components/button.svelte.d.ts +5 -0
  29. package/build/components/flat-list/flat-list-props.d.ts +10 -0
  30. package/build/components/flat-list/flat-list-props.js +1 -0
  31. package/build/components/flat-list/index.svelte +254 -0
  32. package/build/components/flat-list/index.svelte.d.ts +79 -0
  33. package/build/components/image/image-logic.d.ts +2 -0
  34. package/build/components/image/image-logic.js +125 -0
  35. package/build/components/image/image-props.d.ts +5 -0
  36. package/build/components/image/image-props.js +1 -0
  37. package/build/components/image/index.d.ts +3 -0
  38. package/build/components/image/index.js +10 -0
  39. package/build/components/image/index.svelte +66 -0
  40. package/build/components/image/index.svelte.d.ts +5 -0
  41. package/build/components/image-background/image-background-props.d.ts +10 -0
  42. package/build/components/image-background/image-background-props.js +1 -0
  43. package/build/components/image-background/index.svelte +81 -0
  44. package/build/components/image-background/index.svelte.d.ts +5 -0
  45. package/build/components/index.d.ts +50 -0
  46. package/build/components/index.js +24 -0
  47. package/build/components/input-accessory-view/index.svelte +48 -0
  48. package/build/components/input-accessory-view/index.svelte.d.ts +5 -0
  49. package/build/components/input-accessory-view/input-accessory-view-props.d.ts +11 -0
  50. package/build/components/input-accessory-view/input-accessory-view-props.js +1 -0
  51. package/build/components/keyboard-avoiding-view/index.svelte +135 -0
  52. package/build/components/keyboard-avoiding-view/index.svelte.d.ts +5 -0
  53. package/build/components/keyboard-avoiding-view/keyboard-avoiding-view-props.d.ts +15 -0
  54. package/build/components/keyboard-avoiding-view/keyboard-avoiding-view-props.js +1 -0
  55. package/build/components/modal/index.svelte +126 -0
  56. package/build/components/modal/index.svelte.d.ts +5 -0
  57. package/build/components/modal/modal-props.d.ts +24 -0
  58. package/build/components/modal/modal-props.js +1 -0
  59. package/build/components/pressable/index.svelte +160 -0
  60. package/build/components/pressable/index.svelte.d.ts +5 -0
  61. package/build/components/pressable/pressable-props.d.ts +27 -0
  62. package/build/components/pressable/pressable-props.js +1 -0
  63. package/build/components/refresh-control-props.d.ts +19 -0
  64. package/build/components/refresh-control-props.js +1 -0
  65. package/build/components/safe-area-view-props.d.ts +10 -0
  66. package/build/components/safe-area-view-props.js +1 -0
  67. package/build/components/scroll-view/index.svelte +298 -0
  68. package/build/components/scroll-view/index.svelte.d.ts +18 -0
  69. package/build/components/scroll-view/scroll-view-platform-types.d.ts +3 -0
  70. package/build/components/scroll-view/scroll-view-platform-types.js +1 -0
  71. package/build/components/scroll-view/scroll-view-platform.android.d.ts +3 -0
  72. package/build/components/scroll-view/scroll-view-platform.android.js +3 -0
  73. package/build/components/scroll-view/scroll-view-platform.d.ts +1 -0
  74. package/build/components/scroll-view/scroll-view-platform.ios.d.ts +3 -0
  75. package/build/components/scroll-view/scroll-view-platform.ios.js +3 -0
  76. package/build/components/scroll-view/scroll-view-platform.js +4 -0
  77. package/build/components/scroll-view/scroll-view-props.d.ts +78 -0
  78. package/build/components/scroll-view/scroll-view-props.js +1 -0
  79. package/build/components/scroll-view/scroll-view-sticky-context.d.ts +7 -0
  80. package/build/components/scroll-view/scroll-view-sticky-context.js +1 -0
  81. package/build/components/scroll-view/sticky-header-props.d.ts +10 -0
  82. package/build/components/scroll-view/sticky-header-props.js +1 -0
  83. package/build/components/scroll-view/sticky-header.svelte +254 -0
  84. package/build/components/scroll-view/sticky-header.svelte.d.ts +5 -0
  85. package/build/components/section-list/index.svelte +107 -0
  86. package/build/components/section-list/index.svelte.d.ts +57 -0
  87. package/build/components/section-list/section-list-props.d.ts +1 -0
  88. package/build/components/section-list/section-list-props.js +1 -0
  89. package/build/components/switch/index.svelte +123 -0
  90. package/build/components/switch/index.svelte.d.ts +5 -0
  91. package/build/components/switch/switch-platform-types.d.ts +5 -0
  92. package/build/components/switch/switch-platform-types.js +1 -0
  93. package/build/components/switch/switch-platform.android.d.ts +3 -0
  94. package/build/components/switch/switch-platform.android.js +8 -0
  95. package/build/components/switch/switch-platform.d.ts +1 -0
  96. package/build/components/switch/switch-platform.ios.d.ts +3 -0
  97. package/build/components/switch/switch-platform.ios.js +7 -0
  98. package/build/components/switch/switch-platform.js +5 -0
  99. package/build/components/switch/switch-props.d.ts +5 -0
  100. package/build/components/switch/switch-props.js +1 -0
  101. package/build/components/text-input/index.svelte +300 -0
  102. package/build/components/text-input/index.svelte.d.ts +12 -0
  103. package/build/components/text-input/text-input-props.d.ts +5 -0
  104. package/build/components/text-input/text-input-props.js +1 -0
  105. package/build/components/text-props.d.ts +23 -0
  106. package/build/components/text-props.js +1 -0
  107. package/build/components/touchable-base-props.d.ts +10 -0
  108. package/build/components/touchable-base-props.js +1 -0
  109. package/build/components/touchable-highlight/index.svelte +39 -0
  110. package/build/components/touchable-highlight/index.svelte.d.ts +5 -0
  111. package/build/components/touchable-highlight/touchable-highlight-props.d.ts +5 -0
  112. package/build/components/touchable-highlight/touchable-highlight-props.js +1 -0
  113. package/build/components/touchable-native-feedback/index.d.ts +9 -0
  114. package/build/components/touchable-native-feedback/index.js +14 -0
  115. package/build/components/touchable-native-feedback/touchable-native-feedback-props.d.ts +8 -0
  116. package/build/components/touchable-native-feedback/touchable-native-feedback-props.js +1 -0
  117. package/build/components/touchable-native-feedback/touchable-native-feedback.svelte +44 -0
  118. package/build/components/touchable-native-feedback/touchable-native-feedback.svelte.d.ts +5 -0
  119. package/build/components/touchable-opacity/index.svelte +124 -0
  120. package/build/components/touchable-opacity/index.svelte.d.ts +5 -0
  121. package/build/components/touchable-opacity/touchable-opacity-props.d.ts +5 -0
  122. package/build/components/touchable-opacity/touchable-opacity-props.js +1 -0
  123. package/build/components/touchable-without-feedback/index.svelte +19 -0
  124. package/build/components/touchable-without-feedback/index.svelte.d.ts +5 -0
  125. package/build/components/touchable-without-feedback/touchable-without-feedback-props.d.ts +2 -0
  126. package/build/components/touchable-without-feedback/touchable-without-feedback-props.js +1 -0
  127. package/build/components/view-props.d.ts +29 -0
  128. package/build/components/view-props.js +1 -0
  129. package/build/components/virtualized-list/index.svelte +702 -0
  130. package/build/components/virtualized-list/index.svelte.d.ts +79 -0
  131. package/build/components/virtualized-list/virtualized-list-props.d.ts +70 -0
  132. package/build/components/virtualized-list/virtualized-list-props.js +73 -0
  133. package/build/components/virtualized-section-list/index.svelte +206 -0
  134. package/build/components/virtualized-section-list/index.svelte.d.ts +57 -0
  135. package/build/components/virtualized-section-list/virtualized-section-list-props.d.ts +62 -0
  136. package/build/components/virtualized-section-list/virtualized-section-list-props.js +1 -0
  137. package/build/create-tunnel/index.d.ts +3 -0
  138. package/build/create-tunnel/index.js +3 -0
  139. package/build/create-tunnel/tunnel-in.svelte +24 -0
  140. package/build/create-tunnel/tunnel-in.svelte.d.ts +9 -0
  141. package/build/create-tunnel/tunnel-out.svelte +14 -0
  142. package/build/create-tunnel/tunnel-out.svelte.d.ts +7 -0
  143. package/build/create-tunnel/tunnel.d.ts +9 -0
  144. package/build/create-tunnel/tunnel.js +9 -0
  145. package/build/descriptor-to-svelte.d.ts +7 -0
  146. package/build/descriptor-to-svelte.js +104 -0
  147. package/build/dom-shim/comment.d.ts +9 -0
  148. package/build/dom-shim/comment.js +24 -0
  149. package/build/dom-shim/document-fragment.d.ts +8 -0
  150. package/build/dom-shim/document-fragment.js +23 -0
  151. package/build/dom-shim/document.d.ts +23 -0
  152. package/build/dom-shim/document.js +61 -0
  153. package/build/dom-shim/element.d.ts +22 -0
  154. package/build/dom-shim/element.js +130 -0
  155. package/build/dom-shim/index.d.ts +5 -0
  156. package/build/dom-shim/index.js +7 -0
  157. package/build/dom-shim/patch-globals.d.ts +2 -0
  158. package/build/dom-shim/patch-globals.js +94 -0
  159. package/build/dom-shim/shim-node.d.ts +30 -0
  160. package/build/dom-shim/shim-node.js +207 -0
  161. package/build/dom-shim/text.d.ts +14 -0
  162. package/build/dom-shim/text.js +97 -0
  163. package/build/host-instance.d.ts +5 -0
  164. package/build/host-instance.js +48 -0
  165. package/build/index.d.ts +28 -0
  166. package/build/index.js +77 -0
  167. package/build/modules/accessibility-info/index.android.d.ts +2 -0
  168. package/build/modules/accessibility-info/index.android.js +4 -0
  169. package/build/modules/accessibility-info/index.d.ts +1 -0
  170. package/build/modules/accessibility-info/index.ios.d.ts +2 -0
  171. package/build/modules/accessibility-info/index.ios.js +3 -0
  172. package/build/modules/accessibility-info/index.js +5 -0
  173. package/build/modules/animated/AnimatedImage.svelte +115 -0
  174. package/build/modules/animated/AnimatedImage.svelte.d.ts +5 -0
  175. package/build/modules/animated/AnimatedScrollView.svelte +92 -0
  176. package/build/modules/animated/AnimatedScrollView.svelte.d.ts +17 -0
  177. package/build/modules/animated/AnimatedText.svelte +58 -0
  178. package/build/modules/animated/AnimatedText.svelte.d.ts +5 -0
  179. package/build/modules/animated/AnimatedView.svelte +95 -0
  180. package/build/modules/animated/AnimatedView.svelte.d.ts +5 -0
  181. package/build/modules/animated/animated-component-props.d.ts +7 -0
  182. package/build/modules/animated/animated-component-props.js +1 -0
  183. package/build/modules/animated/index.d.ts +58 -0
  184. package/build/modules/animated/index.js +69 -0
  185. package/build/modules/app-registry/index.d.ts +7 -0
  186. package/build/modules/app-registry/index.js +28 -0
  187. package/build/modules/status-bar/index.d.ts +5 -0
  188. package/build/modules/status-bar/index.js +21 -0
  189. package/build/modules/status-bar/index.svelte +20 -0
  190. package/build/modules/status-bar/index.svelte.d.ts +4 -0
  191. package/build/native-view-bridge.d.ts +4 -0
  192. package/build/native-view-bridge.js +27 -0
  193. package/build/preprocessor/forbid-web-only-constructs.d.ts +8 -0
  194. package/build/preprocessor/forbid-web-only-constructs.js +204 -0
  195. package/build/preprocessor/scoped-styles.d.ts +10 -0
  196. package/build/preprocessor/scoped-styles.js +399 -0
  197. package/build/render.d.ts +7 -0
  198. package/build/render.js +46 -0
  199. package/build/root-element.d.ts +3 -0
  200. package/build/root-element.js +27 -0
  201. package/build/runes/attachments.d.ts +5 -0
  202. package/build/runes/attachments.js +73 -0
  203. package/build/runes/dimensions-value.d.ts +4 -0
  204. package/build/runes/dimensions-value.js +30 -0
  205. package/build/runes/media-query.d.ts +8 -0
  206. package/build/runes/media-query.js +38 -0
  207. package/build/runes/use-color-scheme.svelte.d.ts +4 -0
  208. package/build/runes/use-color-scheme.svelte.js +25 -0
  209. package/build/runes/use-window-dimensions.svelte.d.ts +4 -0
  210. package/build/runes/use-window-dimensions.svelte.js +43 -0
  211. package/build/runes/window.d.ts +6 -0
  212. package/build/runes/window.js +28 -0
  213. package/build/scope-token.d.ts +2 -0
  214. package/build/scope-token.js +33 -0
  215. package/build/style-scope.d.ts +1 -0
  216. package/build/style-scope.js +29 -0
  217. package/metro-css-parser.cjs +9 -0
  218. package/metro-svelte-transformer.cjs +156 -0
  219. package/package.json +83 -0
@@ -0,0 +1,92 @@
1
+ <script lang="ts" module>
2
+ // Animated.ScrollView — unlike View/Text/Image, ScrollView.svelte already exposes an
3
+ // imperative handle (scrollTo/scrollToEnd/flashScrollIndicators/getScrollNode, the SAME
4
+ // IScrollViewHandle shape createAnimatedComponent's resolveHostNode expects on Vue/React) via
5
+ // its own top-level `export function`s. That is exactly what `bind:this` needs, so this
6
+ // component WRAPS the real ScrollView.svelte directly rather than hand-authoring a reduced
7
+ // host tag — the only way to keep ScrollView's full feature surface (sticky headers,
8
+ // RefreshControl, maintainVisibleContentPosition, native scroll-attach) per
9
+ // <adapters_reach_full_feature_parity>; a hand-authored duplicate would silently lose all of
10
+ // it. getScrollNode() IS this adapter's resolveHostNode() equivalent for a scroll container.
11
+ import type { IAnimatedComponentProps } from './animated-component-props';
12
+
13
+ export type { IAnimatedComponentProps };
14
+ </script>
15
+
16
+ <script lang="ts">
17
+ import {
18
+ createAnimatedLeafLifecycle,
19
+ isNativeAnimatedAvailable,
20
+ reduceProps,
21
+ readPassthroughStyle,
22
+ } from '@symbiote-native/engine';
23
+ import type { ISymbioteNode } from '@symbiote-native/engine';
24
+ import type { IScrollViewHandle } from '@symbiote-native/components';
25
+ import ScrollView from '../../components/scroll-view/index.svelte';
26
+ import type { IScrollViewProps } from '../../components/scroll-view/scroll-view-props';
27
+ import { pickAttachmentProps } from '../../runes/attachments';
28
+
29
+ let {
30
+ children,
31
+ passthroughAnimatedPropExplicitValues: passthrough,
32
+ ...rest
33
+ }: IAnimatedComponentProps = $props();
34
+
35
+ // The wrapped ScrollView's own instance — its exported functions ARE its public handle
36
+ // (svelte-adapter-dom-shim skill's ScrollView precedent), captured by IDENTITY via bind:this,
37
+ // never $state (a deep proxy would still work here since it's just function references, but
38
+ // $state.raw stays consistent with every other imperative-handle capture in this adapter).
39
+ let scrollRef = $state.raw<IScrollViewHandle | null>(null);
40
+
41
+ const wantsNative = $derived(passthrough != null && isNativeAnimatedAvailable());
42
+
43
+ // reduceProps returns Record<string, unknown> — every field is `unknown` even though it is,
44
+ // at runtime, exactly IScrollViewProps' shape. Bridged back without an `as` cast via the same
45
+ // Object.assign(Object.create(null), …) pattern AnimatedImage.svelte uses (and React's
46
+ // create-animated-component.tsx already establishes): Object.create(null) types as `any`, so
47
+ // the assignment result does too, and TS allows binding `any` into a typed variable.
48
+ const reduced = $derived.by(() => {
49
+ const resolved = reduceProps(rest);
50
+ const passthroughStyle = readPassthroughStyle(passthrough);
51
+ if (passthroughStyle !== undefined) {
52
+ resolved.style =
53
+ resolved.style === undefined ? passthroughStyle : [resolved.style, passthroughStyle];
54
+ }
55
+ const props: IScrollViewProps = Object.assign(Object.create(null), resolved);
56
+ return props;
57
+ });
58
+
59
+ const runtime = createAnimatedLeafLifecycle('AnimatedScrollView');
60
+
61
+ $effect(() => {
62
+ const currentRest = rest;
63
+ const node: ISymbioteNode | null = scrollRef?.getScrollNode() ?? null;
64
+ runtime.reconcile(currentRest, node, wantsNative);
65
+ });
66
+
67
+ $effect(() => () => runtime.teardown());
68
+
69
+ // Forward the imperative handle: a parent's `bind:this` on <Animated.ScrollView> gets the
70
+ // same scrollTo/scrollToEnd/flashScrollIndicators/getScrollNode surface plain ScrollView
71
+ // exposes — the Svelte twin of Vue's delegating Proxy `expose()`.
72
+ export function scrollTo(options?: { x?: number; y?: number; animated?: boolean }): void {
73
+ scrollRef?.scrollTo(options);
74
+ }
75
+ export function scrollToEnd(options?: { animated?: boolean }): void {
76
+ scrollRef?.scrollToEnd(options);
77
+ }
78
+ export function flashScrollIndicators(): void {
79
+ scrollRef?.flashScrollIndicators();
80
+ }
81
+ export function getScrollNode(): ISymbioteNode | null {
82
+ return scrollRef?.getScrollNode() ?? null;
83
+ }
84
+
85
+ // `reduceProps` rebuilds a plain string-keyed Record, so `{@attach}`'s symbol keys do not
86
+ // survive it — forward them explicitly onto the wrapped ScrollView, which owns the host node.
87
+ const attachments = $derived(pickAttachmentProps(rest));
88
+ </script>
89
+
90
+ <ScrollView {...reduced} {...attachments} bind:this={scrollRef}>
91
+ {@render children?.()}
92
+ </ScrollView>
@@ -0,0 +1,17 @@
1
+ import type { IAnimatedComponentProps } from './animated-component-props';
2
+ export type { IAnimatedComponentProps };
3
+ import type { ISymbioteNode } from '@symbiote-native/engine';
4
+ declare const AnimatedScrollView: import("svelte").Component<IAnimatedComponentProps, {
5
+ scrollTo: (options?: {
6
+ x?: number;
7
+ y?: number;
8
+ animated?: boolean;
9
+ }) => void;
10
+ scrollToEnd: (options?: {
11
+ animated?: boolean;
12
+ }) => void;
13
+ flashScrollIndicators: () => void;
14
+ getScrollNode: () => ISymbioteNode | null;
15
+ }, "">;
16
+ type AnimatedScrollView = ReturnType<typeof AnimatedScrollView>;
17
+ export default AnimatedScrollView;
@@ -0,0 +1,58 @@
1
+ <script lang="ts" module>
2
+ // Animated.Text — see AnimatedView.svelte's header comment for the shared design rationale
3
+ // (hand-authored root tag, shared reconcile runtime). Text.svelte is likewise a pure
4
+ // pass-through bag, so hand-authoring loses no logic.
5
+ import type { IAnimatedComponentProps } from './animated-component-props';
6
+
7
+ export type { IAnimatedComponentProps };
8
+ </script>
9
+
10
+ <script lang="ts">
11
+ import {
12
+ createAnimatedLeafLifecycle,
13
+ isNativeAnimatedAvailable,
14
+ reduceProps,
15
+ readPassthroughStyle,
16
+ } from '@symbiote-native/engine';
17
+ import { createAttachmentsSync } from '../../runes/attachments';
18
+ import type { ShimElement } from '../../dom-shim';
19
+
20
+ let {
21
+ children,
22
+ passthroughAnimatedPropExplicitValues: passthrough,
23
+ ...rest
24
+ }: IAnimatedComponentProps = $props();
25
+
26
+ let hostShim = $state.raw<ShimElement | null>(null);
27
+
28
+ const wantsNative = $derived(passthrough != null && isNativeAnimatedAvailable());
29
+
30
+ const reduced = $derived.by(() => {
31
+ const out = reduceProps(rest);
32
+ const passthroughStyle = readPassthroughStyle(passthrough);
33
+ if (passthroughStyle !== undefined) {
34
+ out.style = out.style === undefined ? passthroughStyle : [out.style, passthroughStyle];
35
+ }
36
+ return out;
37
+ });
38
+
39
+ const runtime = createAnimatedLeafLifecycle('AnimatedText');
40
+
41
+ $effect(() => {
42
+ const currentRest = rest;
43
+ const node = hostShim?.engineNode ?? null;
44
+ runtime.reconcile(currentRest, node, wantsNative);
45
+ });
46
+
47
+ $effect(() => () => runtime.teardown());
48
+
49
+ // See View.svelte's note on `{@attach}`.
50
+ const syncAttachments = createAttachmentsSync();
51
+ $effect(() => {
52
+ syncAttachments(hostShim, rest);
53
+ });
54
+ </script>
55
+
56
+ <symbiote-text p={reduced} bind:this={hostShim}>
57
+ {@render children?.()}
58
+ </symbiote-text>
@@ -0,0 +1,5 @@
1
+ import type { IAnimatedComponentProps } from './animated-component-props';
2
+ export type { IAnimatedComponentProps };
3
+ declare const AnimatedText: import("svelte").Component<IAnimatedComponentProps, {}, "">;
4
+ type AnimatedText = ReturnType<typeof AnimatedText>;
5
+ export default AnimatedText;
@@ -0,0 +1,95 @@
1
+ <script lang="ts" module>
2
+ // Animated.View: wraps @symbiote-native/engine's Animated value graph around a
3
+ // symbiote-view host tag. Hand-authors its own root tag rather than composing View.svelte —
4
+ // View.svelte exposes no host-node escape hatch (no bind:this on its own root, nothing
5
+ // exported), so there is nothing to capture a ref onto; the pattern instead mirrors
6
+ // Pressable/ScrollView, the adapter's existing precedent for a component that needs the raw
7
+ // ShimElement (svelte-adapter-dom-shim skill). Since View.svelte does no prop transformation
8
+ // of its own (it is a pure pass-through bag), hand-authoring here loses no logic — unlike
9
+ // AnimatedImage, which reuses Image's buildImageBag for exactly that reason.
10
+ //
11
+ // The reactive plumbing (leaf lifecycle, native-driver opt-in, native event attach) is shared
12
+ // with AnimatedText/AnimatedImage/AnimatedScrollView via animated-props-runtime.ts — see this
13
+ // module's index.ts for why that is a shared HELPER rather than one generic
14
+ // createAnimatedComponent(Component) the way Vue/React have: Svelte has no h()/createElement
15
+ // to parametrize an arbitrary base component at runtime.
16
+ import type { IAnimatedComponentProps } from './animated-component-props';
17
+
18
+ export type { IAnimatedComponentProps };
19
+ </script>
20
+
21
+ <script lang="ts">
22
+ import {
23
+ createAnimatedLeafLifecycle,
24
+ dlog,
25
+ isNativeAnimatedAvailable,
26
+ reduceProps,
27
+ readPassthroughStyle,
28
+ } from '@symbiote-native/engine';
29
+ import { createAttachmentsSync } from '../../runes/attachments';
30
+ import type { ShimElement } from '../../dom-shim';
31
+
32
+ let {
33
+ children,
34
+ passthroughAnimatedPropExplicitValues: passthrough,
35
+ ...rest
36
+ }: IAnimatedComponentProps = $props();
37
+
38
+ // $state.raw, NOT $state — same identity rule every stateful component in this adapter
39
+ // follows (Switch/Pressable/ScrollView): a deep $state proxy would make the engine's
40
+ // WeakMap-keyed node lookups miss.
41
+ let hostShim = $state.raw<ShimElement | null>(null);
42
+
43
+ const wantsNative = $derived(passthrough != null && isNativeAnimatedAvailable());
44
+
45
+ // Reduced (rasterized) props for the declarative bag: every animated node replaced by its
46
+ // current value, so the first paint (and every non-animated re-render) carries concrete
47
+ // values — the per-FRAME path is separate (the runtime's reconcile below), driven straight
48
+ // off the raw `rest` object, never through this derivation.
49
+ let reducedCallCount = 0;
50
+ const reduced = $derived.by(() => {
51
+ const out = reduceProps(rest);
52
+ const passthroughStyle = readPassthroughStyle(passthrough);
53
+ if (passthroughStyle !== undefined) {
54
+ out.style = out.style === undefined ? passthroughStyle : [out.style, passthroughStyle];
55
+ }
56
+ dlog(`AnimatedView reduced#${++reducedCallCount} wantsNative=${wantsNative}`);
57
+ return out;
58
+ });
59
+
60
+ const runtime = createAnimatedLeafLifecycle('AnimatedView');
61
+
62
+ // DIAGNOSTIC (2026-08-13, tracking the effect_update_depth_exceeded device crash): isolates
63
+ // whether `bind:this={hostShim}` below EVER re-fires after the initial mount. If it does — a
64
+ // custom-element `p` prop commit re-triggering the ref callback — that reassignment would make
65
+ // THIS effect's `hostShim?.engineNode` read see a "new" dependency and re-run, independent of
66
+ // whatever else changed, which is a plausible source of a same-flush synchronous loop that has
67
+ // no equivalent in React (ref callbacks)/Vue (template refs)/Angular (ViewChild). Reads ONLY
68
+ // hostShim, deliberately excluding `rest`, so it is unambiguous which one retriggered it.
69
+ let hostShimChangeCount = 0;
70
+ $effect(() => {
71
+ void hostShim;
72
+ dlog(`AnimatedView hostShim identity change #${++hostShimChangeCount} isNull=${hostShim === null}`);
73
+ });
74
+
75
+ // `rest` and `hostShim` are read unconditionally before any branch — the dependency-tracking
76
+ // discipline every $effect in this adapter follows (a guarded read drops that dependency from
77
+ // future re-runs; svelte-adapter-dom-shim skill). reconcile() itself handles a null node.
78
+ $effect(() => {
79
+ const currentRest = rest;
80
+ const node = hostShim?.engineNode ?? null;
81
+ runtime.reconcile(currentRest, node, wantsNative);
82
+ });
83
+
84
+ $effect(() => () => runtime.teardown());
85
+
86
+ // See View.svelte's note on `{@attach}`.
87
+ const syncAttachments = createAttachmentsSync();
88
+ $effect(() => {
89
+ syncAttachments(hostShim, rest);
90
+ });
91
+ </script>
92
+
93
+ <symbiote-view p={reduced} bind:this={hostShim}>
94
+ {@render children?.()}
95
+ </symbiote-view>
@@ -0,0 +1,5 @@
1
+ import type { IAnimatedComponentProps } from './animated-component-props';
2
+ export type { IAnimatedComponentProps };
3
+ declare const AnimatedView: import("svelte").Component<IAnimatedComponentProps, {}, "">;
4
+ type AnimatedView = ReturnType<typeof AnimatedView>;
5
+ export default AnimatedView;
@@ -0,0 +1,7 @@
1
+ import type { Snippet } from 'svelte';
2
+ export interface IAnimatedComponentProps {
3
+ style?: unknown;
4
+ children?: Snippet;
5
+ passthroughAnimatedPropExplicitValues?: unknown;
6
+ [key: string]: unknown;
7
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,58 @@
1
+ import { AnimatedValue, AnimatedValueXY, AnimatedColor, timing, spring, decay, parallel, sequence, stagger, loop, delay, add, subtract, multiply, divide, modulo, diffClamp, event, forkEvent, unforkEvent } from '@symbiote-native/engine';
2
+ export type { IAnimatedComponentProps } from './animated-component-props';
3
+ export declare const Animated: {
4
+ Value: typeof AnimatedValue;
5
+ ValueXY: typeof AnimatedValueXY;
6
+ Color: typeof AnimatedColor;
7
+ Easing: {
8
+ step0(n: number): number;
9
+ step1(n: number): number;
10
+ linear(t: number): number;
11
+ ease(t: number): number;
12
+ quad(t: number): number;
13
+ cubic(t: number): number;
14
+ poly(n: number): import("@symbiote-native/engine").IEasingFunction;
15
+ sin(t: number): number;
16
+ circle(t: number): number;
17
+ exp(t: number): number;
18
+ elastic(bounciness?: number): import("@symbiote-native/engine").IEasingFunction;
19
+ back(s?: number): import("@symbiote-native/engine").IEasingFunction;
20
+ bounce(t: number): number;
21
+ bezier(x1: number, y1: number, x2: number, y2: number): import("@symbiote-native/engine").IEasingFunction;
22
+ in(easing: import("@symbiote-native/engine").IEasingFunction): import("@symbiote-native/engine").IEasingFunction;
23
+ out(easing: import("@symbiote-native/engine").IEasingFunction): import("@symbiote-native/engine").IEasingFunction;
24
+ inOut(easing: import("@symbiote-native/engine").IEasingFunction): import("@symbiote-native/engine").IEasingFunction;
25
+ };
26
+ timing: typeof timing;
27
+ spring: typeof spring;
28
+ decay: typeof decay;
29
+ parallel: typeof parallel;
30
+ sequence: typeof sequence;
31
+ stagger: typeof stagger;
32
+ loop: typeof loop;
33
+ delay: typeof delay;
34
+ add: typeof add;
35
+ subtract: typeof subtract;
36
+ multiply: typeof multiply;
37
+ divide: typeof divide;
38
+ modulo: typeof modulo;
39
+ diffClamp: typeof diffClamp;
40
+ event: typeof event;
41
+ forkEvent: typeof forkEvent;
42
+ unforkEvent: typeof unforkEvent;
43
+ View: import("svelte").Component<import("./animated-component-props").IAnimatedComponentProps, {}, "">;
44
+ Text: import("svelte").Component<import("./animated-component-props").IAnimatedComponentProps, {}, "">;
45
+ Image: import("svelte").Component<import("./animated-component-props").IAnimatedComponentProps, {}, "">;
46
+ ScrollView: import("svelte").Component<import("./animated-component-props").IAnimatedComponentProps, {
47
+ scrollTo: (options?: {
48
+ x?: number;
49
+ y?: number;
50
+ animated?: boolean;
51
+ }) => void;
52
+ scrollToEnd: (options?: {
53
+ animated?: boolean;
54
+ }) => void;
55
+ flashScrollIndicators: () => void;
56
+ getScrollNode: () => import("@symbiote-native/engine").ISymbioteNode | null;
57
+ }, "">;
58
+ };
@@ -0,0 +1,69 @@
1
+ // The Animated namespace for @symbiote-native/svelte: the Svelte twin of
2
+ // adapters/vue/src/modules/animated/index.ts (the primary reference — Svelte 5's runes are much
3
+ // closer to Vue's reactivity model than to React's hooks). The value graph, easing,
4
+ // interpolation and drivers come from @symbiote-native/engine (framework-agnostic, JS-driven),
5
+ // spread in verbatim.
6
+ //
7
+ // Unlike Vue/React, there is NO generic `createAnimatedComponent(Component)` here. Vue wraps an
8
+ // arbitrary base component via `h(Component, reducedProps)`; React via `createElement(Component,
9
+ // childProps)` — both are ordinary runtime function calls that work on any component reference.
10
+ // Svelte has no equivalent: a compiled Svelte component is not a plain function you can invoke
11
+ // generically with a fresh prop bag and get back something you can further compose — wrapping
12
+ // one means literally writing `<Component {...props} bind:this={ref}>` inside another `.svelte`
13
+ // file. So each of the four components below (View/Text/Image/ScrollView) is its own hand-
14
+ // authored `.svelte` file sharing only the non-visual reconcile logic
15
+ // (animated-props-runtime.ts). `Animated.createAnimatedComponent` is a genuine, documented scope
16
+ // boundary, not an oversight — see this module's own report for the full reasoning. A consumer
17
+ // wanting to animate their OWN custom component should follow the same four-file pattern (rebuild
18
+ // an AnimatedProps leaf from its props, reconcile on every render into the component's own host
19
+ // node/handle, expose that host node via bind:this) rather than reach for a generic wrapper that
20
+ // does not exist on this adapter.
21
+ //
22
+ // Animated.FlatList / Animated.SectionList are also NOT implemented in this pass. Vue omits them
23
+ // because it has no FlatList/SectionList base component at all; Svelte DOES have both, so this is
24
+ // a narrower, more honest gap than Vue's — flagged as follow-up work, not silently dropped (see
25
+ // the module's own report). Wrapping them would follow the exact same
26
+ // wrap-the-real-component-via-its-exported-handle shape as AnimatedScrollView, once each exposes
27
+ // (or is confirmed to need) an equivalent handle.
28
+ import { AnimatedValue, AnimatedValueXY, AnimatedColor, AnimatedMock, Easing, Platform, timing, spring, decay, parallel, sequence, stagger, loop, delay, add, subtract, multiply, divide, modulo, diffClamp, event, forkEvent, unforkEvent, } from '@symbiote-native/engine';
29
+ import AnimatedViewComponent from './AnimatedView.svelte';
30
+ import AnimatedTextComponent from './AnimatedText.svelte';
31
+ import AnimatedImageComponent from './AnimatedImage.svelte';
32
+ import AnimatedScrollViewComponent from './AnimatedScrollView.svelte';
33
+ // The live, JS-driven driver namespace (real frames). RN's AnimatedImplementation.
34
+ const liveDrivers = {
35
+ Value: AnimatedValue,
36
+ ValueXY: AnimatedValueXY,
37
+ Color: AnimatedColor,
38
+ Easing,
39
+ timing,
40
+ spring,
41
+ decay,
42
+ parallel,
43
+ sequence,
44
+ stagger,
45
+ loop,
46
+ delay,
47
+ add,
48
+ subtract,
49
+ multiply,
50
+ divide,
51
+ modulo,
52
+ diffClamp,
53
+ event,
54
+ forkEvent,
55
+ unforkEvent,
56
+ };
57
+ // RN swaps the WHOLE driver namespace for the mock when the host reports isDisableAnimations
58
+ // (reduced motion / test env): the mock keeps the same surface but jumps each animation to its
59
+ // final value synchronously, no frames. The animated COMPONENTS (View/Text/Image/ScrollView) are
60
+ // live in both branches; only the drivers/value/operators/events half is swapped, exactly like
61
+ // RN spreading `...Animated` (impl or mock) over the same component references.
62
+ const drivers = Platform.isDisableAnimations ? AnimatedMock : liveDrivers;
63
+ export const Animated = {
64
+ View: AnimatedViewComponent,
65
+ Text: AnimatedTextComponent,
66
+ Image: AnimatedImageComponent,
67
+ ScrollView: AnimatedScrollViewComponent,
68
+ ...drivers,
69
+ };
@@ -0,0 +1,7 @@
1
+ import type { Component } from 'svelte';
2
+ import { type IAppParameters } from '@symbiote-native/engine';
3
+ export type IComponentProvider = () => Component;
4
+ export type IWrapperComponentProvider = (appParameters: IAppParameters) => Component;
5
+ declare const AppRegistry: import("@symbiote-native/engine").IAppRegistry<IComponentProvider, IWrapperComponentProvider>, setHostRegistrar: (registrar: import("@symbiote-native/engine").IHostRegistrar) => void;
6
+ export { AppRegistry, setHostRegistrar };
7
+ export type { IAppParameters, IRunnable, IHostRegistrar, IRegistry, IHeadlessTask, ITaskProvider, ITaskCanceller, ITaskCancelProvider, } from '@symbiote-native/engine';
@@ -0,0 +1,28 @@
1
+ // AppRegistry: the JS entry point RN apps already use:
2
+ // AppRegistry.registerComponent(appKey, () => App)
3
+ // The registry bookkeeping (sections, host-registrar bridge, headless tasks) is
4
+ // framework-agnostic and lives in @symbiote-native/engine's createAppRegistry, the same one
5
+ // every other adapter uses; this file supplies only the one Svelte-specific seam.
6
+ //
7
+ // KNOWN GAP, not silently dropped: `IWrapperComponentProvider` (wrapping the app root in a
8
+ // context-provider-style component from native) has no implementation here yet. Vue composes
9
+ // it with `h(wrapper, null, { default: renderRoot })` — Svelte has no equivalent JS-level
10
+ // composition of two independently-authored components (a Svelte component is compiled
11
+ // output, not a value you can nest via a function call the way Vue's `h()` nests vnodes).
12
+ // Closing this needs its own design pass (a synthetic wrapper snippet, most likely) — tracked
13
+ // in the svelte-adapter-dom-shim skill, not solved here. `setWrapperComponentProvider` is
14
+ // re-exported (parity with the engine's API surface) but a set provider is currently ignored.
15
+ import { mount } from '../../render.js';
16
+ import { createAppRegistry, dlog, } from '@symbiote-native/engine';
17
+ function runnableFor(componentProvider, getWrapperComponentProvider) {
18
+ return appParameters => {
19
+ dlog(`AppRegistry: mounting on rootTag ${String(appParameters.rootTag)}`);
20
+ if (getWrapperComponentProvider() !== undefined) {
21
+ dlog('AppRegistry: wrapperComponentProvider is set but not yet supported on Svelte — ignored');
22
+ }
23
+ const RootComponent = componentProvider();
24
+ mount(appParameters.rootTag, RootComponent, appParameters.initialProps);
25
+ };
26
+ }
27
+ const { AppRegistry, setHostRegistrar } = createAppRegistry(runnableFor);
28
+ export { AppRegistry, setHostRegistrar };
@@ -0,0 +1,5 @@
1
+ export type { IStatusBarProps, IStatusBarStyle } from '@symbiote-native/engine';
2
+ declare const StatusBarWithStatics: import("svelte").Component<import("@symbiote-native/engine").IStatusBarProps, {}, ""> & import("@symbiote-native/engine").IStatusBarImperative;
3
+ export declare const StatusBar: typeof StatusBarWithStatics & {
4
+ readonly currentHeight?: number;
5
+ };
@@ -0,0 +1,21 @@
1
+ // StatusBar statics (setHidden/setBarStyle/setNetworkActivityIndicatorVisible/
2
+ // setBackgroundColor/setTranslucent + the Android-only currentHeight getter) attach onto the
3
+ // component value, mirroring RN's `StatusBar.setHidden` static surface — shared verbatim via
4
+ // @symbiote-native/engine's statusBarImperative, the same source React's and Vue's StatusBar
5
+ // use. A `.svelte` file's own module type resolves through svelte's ambient
6
+ // `declare module '*.svelte'` fallback (a bare value export), so the statics are attached here
7
+ // in a plain sibling `.ts` file rather than inside `index.svelte` itself — same pattern as
8
+ // components/image/index.ts.
9
+ import StatusBarComponent from './index.svelte';
10
+ import { statusBarImperative, statusBarCurrentHeight } from '@symbiote-native/engine';
11
+ const StatusBarWithStatics = Object.assign(StatusBarComponent, statusBarImperative);
12
+ // Android exposes the bar height as a native constant; undefined on iOS / when absent. Read
13
+ // lazily (getter) so nothing touches native at import time; the Android engine impl resolves
14
+ // on access.
15
+ Object.defineProperty(StatusBarWithStatics, 'currentHeight', {
16
+ get: statusBarCurrentHeight,
17
+ enumerable: true,
18
+ });
19
+ // currentHeight is optional, so the defineProperty-added accessor doesn't need to appear on
20
+ // the runtime object's inferred type for this assignment to hold (no cast).
21
+ export const StatusBar = StatusBarWithStatics;
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ // StatusBar, the Svelte lifecycle half. The native StatusBarManager driving
3
+ // (applyStatusBarProps), the imperative statics, and the Android bar-height constant all
4
+ // live in @symbiote-native/engine, shared verbatim with React/Vue; Metro selects the
5
+ // engine's status-bar.ios.ts / status-bar.android.ts per host, so the platform divergence
6
+ // never reaches this file. Svelte supplies only the declarative shape: a component that
7
+ // renders no Fabric view (empty template) and re-applies the props through an `$effect` on
8
+ // mount + every prop change — the Svelte twin of Vue's watchEffect / React's useEffect.
9
+ //
10
+ // Unlike Vue's twin (status-bar.ts), no untyped-attrs guard layer is needed: Svelte's
11
+ // `$props()` already destructures real typed fields straight from the compiler, so there is
12
+ // no kebab-case-attrs normalization step to run first.
13
+ import { applyStatusBarProps, type IStatusBarProps } from '@symbiote-native/engine';
14
+
15
+ let props: IStatusBarProps = $props();
16
+
17
+ $effect(() => {
18
+ applyStatusBarProps(props);
19
+ });
20
+ </script>
@@ -0,0 +1,4 @@
1
+ import { type IStatusBarProps } from '@symbiote-native/engine';
2
+ declare const Index: import("svelte").Component<IStatusBarProps, {}, "">;
3
+ type Index = ReturnType<typeof Index>;
4
+ export default Index;
@@ -0,0 +1,4 @@
1
+ export { mount, unmount } from './render';
2
+ export { mountDescriptorChildren, createDescriptorChildrenSync } from './descriptor-to-svelte';
3
+ export type { IDescriptorChildrenMount } from './descriptor-to-svelte';
4
+ export type { ShimElement } from './dom-shim';
@@ -0,0 +1,27 @@
1
+ // The subset of this adapter a downstream THIRD-PARTY-native-view package
2
+ // (@symbiote-native/slider, packages/slider/src/svelte — see symbiote-third-party-native-view
3
+ // skill) needs, both at runtime and in its own tests. Lives OUTSIDE the main barrel
4
+ // (./index.ts) for the same reason bootstrap.ts does: `./index.ts` re-exports `./components`,
5
+ // whose files are real `.svelte` sources — importing it (even for a single named export)
6
+ // forces the whole module graph to load, and Vite/vitest's plain transform (no svelte plugin is
7
+ // registered for this repo's tests — see svelte-adapter-dom-shim skill §15, deliberately: unit
8
+ // tests compile a `.svelte` file explicitly via `svelte/compiler` instead of a live import
9
+ // pipeline) cannot parse `.svelte` syntax, failing with "Failed to parse source for import
10
+ // analysis". Every export below resolves through a `.svelte`-free graph (render.ts,
11
+ // descriptor-to-svelte.ts, dom-shim/*), confirmed by grepping each for a `.svelte` import.
12
+ //
13
+ // `mount`/`unmount`: the same pair every framework-agnostic third-party-view package's own test
14
+ // needs to bootstrap a surface — the twin of adapters/svelte's OWN internal tests importing them
15
+ // from the relative `./render` (unreachable from outside this package; a downstream package must
16
+ // go through the export map instead).
17
+ //
18
+ // `mountDescriptorChildren`/`createDescriptorChildrenSync`: the generic Descriptor -> shim-tree
19
+ // bridge (svelte-adapter-dom-shim skill §19), the Svelte twin of Vue's `descriptorToVue` /
20
+ // React's `descriptorToReact` (both exported from their own adapter's main barrel — Svelte's
21
+ // bridge lives here instead, precisely because its own home module is `.svelte`-free but the
22
+ // main barrel that would otherwise re-export it is not). Needed by a third-party-view package to
23
+ // mount a Descriptor whose `type` is a raw, non-`symbiote-`-prefixed Fabric name (e.g.
24
+ // 'RNCSlider') that cannot be written as a literal Svelte template tag — see
25
+ // packages/slider/src/svelte/slider/index.svelte's header for the full reasoning.
26
+ export { mount, unmount } from './render.js';
27
+ export { mountDescriptorChildren, createDescriptorChildrenSync } from './descriptor-to-svelte.js';
@@ -0,0 +1,8 @@
1
+ export declare function forbidWebOnlyConstructs(): {
2
+ markup(input: {
3
+ content: string;
4
+ filename?: string;
5
+ }): {
6
+ code: string;
7
+ };
8
+ };