@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,81 @@
1
+ <script lang="ts" module>
2
+ // ImageBackground: render-only composition (absolute-fill Image behind, children on top).
3
+ // Calls renderImageBackground() straight from core/components for the absolute-fill
4
+ // positioning + wrapper-dimension proxy onto the inner Image — both tags stay literal (the
5
+ // wrapper hosts `{@render children?.()}` as a live sibling after the image, which the
6
+ // generic descriptorToSvelte bridge can't safely own: appending the image inside an $effect
7
+ // would race Svelte's own placement of the live children and could reorder them — see
8
+ // svelte-adapter-dom-shim skill §19), so `.props`/`.children[0].props` are destructured onto
9
+ // the two known host tags, same pattern as Modal/index.svelte.
10
+ import type { IImageBackgroundProps } from './image-background-props';
11
+
12
+ export type { IImageBackgroundProps };
13
+ </script>
14
+
15
+ <script lang="ts">
16
+ import { renderImageBackground, resolveAccessibilityProps } from '@symbiote-native/components';
17
+ import { resolveClassName } from '@symbiote-native/engine';
18
+ import { createAttachmentsSync } from '../../runes/attachments';
19
+ import type { ShimElement } from '../../dom-shim';
20
+
21
+ let {
22
+ children,
23
+ style,
24
+ imageStyle,
25
+ class: className,
26
+ source,
27
+ defaultSource,
28
+ loadingIndicatorSource,
29
+ resizeMode,
30
+ tintColor,
31
+ src,
32
+ srcSet,
33
+ alt,
34
+ width,
35
+ height,
36
+ crossOrigin,
37
+ referrerPolicy,
38
+ ...passthrough
39
+ }: IImageBackgroundProps = $props();
40
+
41
+ const resolvedImageStyle = $derived(
42
+ typeof imageStyle === 'string' ? resolveClassName(imageStyle) : imageStyle,
43
+ );
44
+
45
+ const descriptor = $derived(
46
+ renderImageBackground({
47
+ style,
48
+ imageStyle: resolvedImageStyle,
49
+ image: {
50
+ source,
51
+ defaultSource,
52
+ loadingIndicatorSource,
53
+ resizeMode,
54
+ tintColor,
55
+ src,
56
+ srcSet,
57
+ alt,
58
+ width,
59
+ height,
60
+ crossOrigin,
61
+ referrerPolicy,
62
+ passthrough: resolveAccessibilityProps(passthrough),
63
+ },
64
+ }),
65
+ );
66
+ const imageBag = $derived.by(() => {
67
+ const child = descriptor.children[0];
68
+ return typeof child === 'string' ? {} : child.props;
69
+ });
70
+ const wrapperBag = $derived({ ...descriptor.props, class: className });
71
+
72
+ // See View.svelte's note on `{@attach}` — the attachment binds to the OUTER wrapper, the node
73
+ // this component's own `class`/`style` land on and the one a caller means by "this component".
74
+ let hostShim = $state.raw<ShimElement | null>(null);
75
+ const syncAttachments = createAttachmentsSync();
76
+ $effect(() => {
77
+ syncAttachments(hostShim, passthrough);
78
+ });
79
+ </script>
80
+
81
+ <symbiote-view p={wrapperBag} bind:this={hostShim}><symbiote-image p={imageBag} />{@render children?.()}</symbiote-view>
@@ -0,0 +1,5 @@
1
+ import type { IImageBackgroundProps } from './image-background-props';
2
+ export type { IImageBackgroundProps };
3
+ declare const Index: import("svelte").Component<IImageBackgroundProps, {}, "">;
4
+ type Index = ReturnType<typeof Index>;
5
+ export default Index;
@@ -0,0 +1,50 @@
1
+ export { default as View } from './View.svelte';
2
+ export { default as Text } from './Text.svelte';
3
+ export type { IViewProps } from './view-props';
4
+ export type { ITextProps } from './text-props';
5
+ export { default as ActivityIndicator } from './activity-indicator/index.svelte';
6
+ export type { IActivityIndicatorProps } from './activity-indicator/activity-indicator-props';
7
+ export { Image } from './image';
8
+ export type { IImageProps, IImageStatics } from './image';
9
+ export { default as ImageBackground } from './image-background/index.svelte';
10
+ export type { IImageBackgroundProps } from './image-background/image-background-props';
11
+ export { default as InputAccessoryView } from './input-accessory-view/index.svelte';
12
+ export type { IInputAccessoryViewProps } from './input-accessory-view/input-accessory-view-props';
13
+ export { default as KeyboardAvoidingView } from './keyboard-avoiding-view/index.svelte';
14
+ export type { IKeyboardAvoidingViewProps, IKeyboardAvoidingBehavior, } from './keyboard-avoiding-view/keyboard-avoiding-view-props';
15
+ export { default as Switch } from './switch/index.svelte';
16
+ export type { ISwitchProps } from './switch/switch-props';
17
+ export { default as TextInput } from './text-input/index.svelte';
18
+ export type { ITextInputProps } from './text-input/text-input-props';
19
+ export type { ITextInputHandle } from '@symbiote-native/components';
20
+ export { default as Modal } from './modal/index.svelte';
21
+ export type { IModalProps } from './modal/modal-props';
22
+ export { default as SafeAreaView } from './SafeAreaView.svelte';
23
+ export type { ISafeAreaViewProps } from './safe-area-view-props';
24
+ export { default as RefreshControl } from './RefreshControl.svelte';
25
+ export type { IRefreshControlProps } from './refresh-control-props';
26
+ export { default as Pressable } from './pressable/index.svelte';
27
+ export type { IPressableProps } from './pressable/pressable-props';
28
+ export { default as TouchableOpacity } from './touchable-opacity/index.svelte';
29
+ export type { ITouchableOpacityProps } from './touchable-opacity/touchable-opacity-props';
30
+ export { default as TouchableHighlight } from './touchable-highlight/index.svelte';
31
+ export type { ITouchableHighlightProps } from './touchable-highlight/touchable-highlight-props';
32
+ export { default as TouchableWithoutFeedback } from './touchable-without-feedback/index.svelte';
33
+ export type { ITouchableWithoutFeedbackProps } from './touchable-without-feedback/touchable-without-feedback-props';
34
+ export { TouchableNativeFeedback } from './touchable-native-feedback';
35
+ export type { ITouchableNativeFeedbackProps } from './touchable-native-feedback';
36
+ export { default as Button } from './button.svelte';
37
+ export type { IButtonProps } from './button-props';
38
+ export { default as ScrollView } from './scroll-view/index.svelte';
39
+ export type { IScrollViewProps } from './scroll-view/scroll-view-props';
40
+ export type { IScrollViewHandle } from '@symbiote-native/components';
41
+ export { default as ScrollViewStickyHeader } from './scroll-view/sticky-header.svelte';
42
+ export type { IStickyHeaderComponentProps } from './scroll-view/sticky-header-props';
43
+ export { default as VirtualizedList } from './virtualized-list/index.svelte';
44
+ export type { IVirtualizedListProps, IVirtualizedListHandle, } from './virtualized-list/virtualized-list-props';
45
+ export { default as FlatList } from './flat-list/index.svelte';
46
+ export type { IFlatListProps, IFlatListHandle } from './flat-list/flat-list-props';
47
+ export { default as VirtualizedSectionList } from './virtualized-section-list/index.svelte';
48
+ export type { IVirtualizedSectionListProps } from './virtualized-section-list/virtualized-section-list-props';
49
+ export { default as SectionList } from './section-list/index.svelte';
50
+ export type { ISectionListProps, ISection } from './section-list/section-list-props';
@@ -0,0 +1,24 @@
1
+ export { default as View } from './View.svelte';
2
+ export { default as Text } from './Text.svelte';
3
+ export { default as ActivityIndicator } from './activity-indicator/index.svelte';
4
+ export { Image } from './image/index.js';
5
+ export { default as ImageBackground } from './image-background/index.svelte';
6
+ export { default as InputAccessoryView } from './input-accessory-view/index.svelte';
7
+ export { default as KeyboardAvoidingView } from './keyboard-avoiding-view/index.svelte';
8
+ export { default as Switch } from './switch/index.svelte';
9
+ export { default as TextInput } from './text-input/index.svelte';
10
+ export { default as Modal } from './modal/index.svelte';
11
+ export { default as SafeAreaView } from './SafeAreaView.svelte';
12
+ export { default as RefreshControl } from './RefreshControl.svelte';
13
+ export { default as Pressable } from './pressable/index.svelte';
14
+ export { default as TouchableOpacity } from './touchable-opacity/index.svelte';
15
+ export { default as TouchableHighlight } from './touchable-highlight/index.svelte';
16
+ export { default as TouchableWithoutFeedback } from './touchable-without-feedback/index.svelte';
17
+ export { TouchableNativeFeedback } from './touchable-native-feedback/index.js';
18
+ export { default as Button } from './button.svelte';
19
+ export { default as ScrollView } from './scroll-view/index.svelte';
20
+ export { default as ScrollViewStickyHeader } from './scroll-view/sticky-header.svelte';
21
+ export { default as VirtualizedList } from './virtualized-list/index.svelte';
22
+ export { default as FlatList } from './flat-list/index.svelte';
23
+ export { default as VirtualizedSectionList } from './virtualized-section-list/index.svelte';
24
+ export { default as SectionList } from './section-list/index.svelte';
@@ -0,0 +1,48 @@
1
+ <script lang="ts" module>
2
+ // InputAccessoryView: render-only host assembly (iOS). Calls the shared
3
+ // core/components/src/view/render-input-accessory-view.ts's renderInputAccessoryView()
4
+ // directly (nativeID/backgroundColor/style -> the host node, everything else passthrough) —
5
+ // the same calling convention as keyboard-avoiding-view/index.svelte's shared-render-fn call,
6
+ // rather than hand-duplicating its prop-assembly logic (per the svelte-adapter-dom-shim
7
+ // skill's §15/§19 correction: a fixed-shape Descriptor still has to be CALLED, not
8
+ // re-derived). The root tag stays literal below since renderInputAccessoryView always paints
9
+ // the same 'symbiote-input-accessory-view' host — no dynamic <svelte:element> needed. The
10
+ // host has no structural children of its own; the user's children nest directly under it.
11
+ import type { IInputAccessoryViewProps } from './input-accessory-view-props';
12
+
13
+ export type { IInputAccessoryViewProps };
14
+ </script>
15
+
16
+ <script lang="ts">
17
+ import { renderInputAccessoryView, resolveAccessibilityProps } from '@symbiote-native/components';
18
+ import { createAttachmentsSync } from '../../runes/attachments';
19
+ import type { ShimElement } from '../../dom-shim';
20
+
21
+ let {
22
+ nativeID,
23
+ backgroundColor,
24
+ style,
25
+ children,
26
+ ...passthrough
27
+ }: IInputAccessoryViewProps = $props();
28
+
29
+ const descriptor = $derived(
30
+ renderInputAccessoryView({
31
+ nativeID,
32
+ backgroundColor,
33
+ style,
34
+ passthrough: resolveAccessibilityProps(passthrough),
35
+ }),
36
+ );
37
+
38
+ // See View.svelte's note on `{@attach}`.
39
+ let hostShim = $state.raw<ShimElement | null>(null);
40
+ const syncAttachments = createAttachmentsSync();
41
+ $effect(() => {
42
+ syncAttachments(hostShim, passthrough);
43
+ });
44
+ </script>
45
+
46
+ <symbiote-input-accessory-view p={descriptor.props} bind:this={hostShim}>
47
+ {@render children?.()}
48
+ </symbiote-input-accessory-view>
@@ -0,0 +1,5 @@
1
+ import type { IInputAccessoryViewProps } from './input-accessory-view-props';
2
+ export type { IInputAccessoryViewProps };
3
+ declare const Index: import("svelte").Component<IInputAccessoryViewProps, {}, "">;
4
+ type Index = ReturnType<typeof Index>;
5
+ export default Index;
@@ -0,0 +1,11 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { IStyleProp, IViewStyle } from '@symbiote-native/engine';
3
+ import type { IAccessibilityProps, IAriaProps } from '@symbiote-native/components';
4
+ import type { ISvelteClassValue } from '../../class-value';
5
+ export interface IInputAccessoryViewProps extends IAccessibilityProps, IAriaProps {
6
+ nativeID?: string;
7
+ backgroundColor?: string;
8
+ style?: IStyleProp<IViewStyle>;
9
+ class?: ISvelteClassValue;
10
+ children?: Snippet;
11
+ }
@@ -0,0 +1,135 @@
1
+ <script lang="ts" module>
2
+ // KeyboardAvoidingView: composes a wrapper View and shifts it as the keyboard shows/hides. The
3
+ // inset math + the behavior -> style/structure decision live framework-agnostic in
4
+ // @symbiote-native/components (render-keyboard-avoiding-view, shared verbatim with React/Vue);
5
+ // this adapter supplies only the lifecycle: $state for the inset, a mutable frame/initialHeight
6
+ // pair (NOT $state — changing them alone shouldn't re-render, same non-reactive-ref shape as
7
+ // React's frameRef/initialHeightRef and Vue's plain `let frame`), an $effect subscribing to the
8
+ // Keyboard module (mirrors React's useEffect / Vue's onMounted+onUnmounted pair), and the
9
+ // wrapper assembly around the Snippet children.
10
+ //
11
+ // render-keyboard-avoiding-view.ts does NOT return a Descriptor here (by its own design — it
12
+ // returns a layout DESCRIPTION instead, because KAV wraps arbitrary user children the Descriptor
13
+ // model can't carry), so there is no Descriptor-consumption question for this component at all;
14
+ // the two structural shapes ('nested' vs 'wrapper') are written directly as the two markup
15
+ // branches below.
16
+ import type { IKeyboardAvoidingViewProps } from './keyboard-avoiding-view-props';
17
+
18
+ export type { IKeyboardAvoidingViewProps };
19
+ </script>
20
+
21
+ <script lang="ts">
22
+ import {
23
+ Keyboard,
24
+ KEYBOARD_EVENT,
25
+ dlog,
26
+ type IEventSubscription,
27
+ type ISymbioteEvent,
28
+ } from '@symbiote-native/engine';
29
+ import { createAttachmentsSync } from '../../runes/attachments';
30
+ import type { ShimElement } from '../../dom-shim';
31
+ import {
32
+ computeInset,
33
+ readKeyboardFrame,
34
+ readLayoutFrame,
35
+ resolveKeyboardAvoidingLayout,
36
+ resolveAccessibilityProps,
37
+ DEFAULT_VERTICAL_OFFSET,
38
+ type IMeasuredFrame,
39
+ } from '@symbiote-native/components';
40
+
41
+ let {
42
+ behavior,
43
+ enabled = true,
44
+ keyboardVerticalOffset = DEFAULT_VERTICAL_OFFSET,
45
+ contentContainerStyle,
46
+ style,
47
+ children,
48
+ onLayout,
49
+ class: className,
50
+ ...passthrough
51
+ }: IKeyboardAvoidingViewProps = $props();
52
+
53
+ let inset = $state(0);
54
+ // Mutable, not $state: changing the measured frame alone shouldn't re-render; it only feeds the
55
+ // next keyboard event's inset math.
56
+ let frame: IMeasuredFrame | undefined;
57
+ let initialHeight: number | undefined;
58
+
59
+ function onShow(payload: unknown): void {
60
+ const keyboard = readKeyboardFrame(payload);
61
+ const next = computeInset(frame, keyboard, keyboardVerticalOffset);
62
+ dlog(`KeyboardAvoidingView show -> inset ${next}`);
63
+ inset = next;
64
+ }
65
+ function onHide(): void {
66
+ dlog('KeyboardAvoidingView hide -> inset 0');
67
+ inset = 0;
68
+ }
69
+
70
+ // No reactive state is read synchronously in this callback body (only inside onShow/onHide,
71
+ // which run later at event-time via closures over the live `keyboardVerticalOffset` prop), so
72
+ // this effect has zero tracked dependencies and runs exactly once per mount/unmount — the same
73
+ // subscribe-once/cleanup-once shape as Vue's onMounted+onUnmounted pair.
74
+ $effect(() => {
75
+ const subscriptions: IEventSubscription[] = [
76
+ Keyboard.addListener(KEYBOARD_EVENT.didShow, onShow),
77
+ Keyboard.addListener(KEYBOARD_EVENT.didChangeFrame, onShow),
78
+ Keyboard.addListener(KEYBOARD_EVENT.didHide, onHide),
79
+ ];
80
+ return () => {
81
+ for (const subscription of subscriptions) subscription.remove();
82
+ };
83
+ });
84
+
85
+ function handleLayout(event: ISymbioteEvent): void {
86
+ const measured = readLayoutFrame(event.nativeEvent.layout);
87
+ if (measured !== undefined) {
88
+ frame = measured;
89
+ if (initialHeight === undefined) initialHeight = measured.height;
90
+ }
91
+ onLayout?.(event);
92
+ }
93
+
94
+ // When disabled the inset is forced to 0, so every behavior mode renders the view untouched.
95
+ const effectiveInset = $derived(enabled ? inset : 0);
96
+
97
+ const layout = $derived(
98
+ resolveKeyboardAvoidingLayout({
99
+ behavior,
100
+ effectiveInset,
101
+ initialHeight,
102
+ style,
103
+ contentContainerStyle,
104
+ }),
105
+ );
106
+
107
+ const wrapperBag = $derived({
108
+ ...resolveAccessibilityProps(passthrough),
109
+ style: layout.wrapperStyle,
110
+ class: className,
111
+ onLayout: handleLayout,
112
+ });
113
+
114
+ const innerBag = $derived(layout.kind === 'nested' ? { style: layout.innerStyle } : undefined);
115
+
116
+ // See View.svelte's note on `{@attach}` — bound to the OUTER wrapper, which is the node
117
+ // this component's own style lands on in both the nested and flat layouts.
118
+ let hostShim = $state.raw<ShimElement | null>(null);
119
+ const syncAttachments = createAttachmentsSync();
120
+ $effect(() => {
121
+ syncAttachments(hostShim, passthrough);
122
+ });
123
+ </script>
124
+
125
+ {#if layout.kind === 'nested'}
126
+ <symbiote-view p={wrapperBag} bind:this={hostShim}>
127
+ <symbiote-view p={innerBag}>
128
+ {@render children?.()}
129
+ </symbiote-view>
130
+ </symbiote-view>
131
+ {:else}
132
+ <symbiote-view p={wrapperBag} bind:this={hostShim}>
133
+ {@render children?.()}
134
+ </symbiote-view>
135
+ {/if}
@@ -0,0 +1,5 @@
1
+ import type { IKeyboardAvoidingViewProps } from './keyboard-avoiding-view-props';
2
+ export type { IKeyboardAvoidingViewProps };
3
+ declare const Index: import("svelte").Component<IKeyboardAvoidingViewProps, {}, "">;
4
+ type Index = ReturnType<typeof Index>;
5
+ export default Index;
@@ -0,0 +1,15 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { ISymbioteEvent, IStyleProp, IViewStyle } from '@symbiote-native/engine';
3
+ import type { IAccessibilityProps, IAriaProps, IKeyboardAvoidingBehavior } from '@symbiote-native/components';
4
+ import type { ISvelteClassValue } from '../../class-value';
5
+ export type { IKeyboardAvoidingBehavior } from '@symbiote-native/components';
6
+ export interface IKeyboardAvoidingViewProps extends IAccessibilityProps, IAriaProps {
7
+ behavior?: IKeyboardAvoidingBehavior;
8
+ enabled?: boolean;
9
+ keyboardVerticalOffset?: number;
10
+ contentContainerStyle?: IStyleProp<IViewStyle>;
11
+ style?: IStyleProp<IViewStyle>;
12
+ class?: ISvelteClassValue;
13
+ children?: Snippet;
14
+ onLayout?: (event: ISymbioteEvent) => void;
15
+ }
@@ -0,0 +1,126 @@
1
+ <script lang="ts" module>
2
+ // Modal: the Svelte lifecycle half. RCTModalHostView is an ordinary Fabric host node
3
+ // committing through the SAME childSet as the rest of the tree (no second JS surface). The
4
+ // style math (backdrop override, container/host styles, presentationStyle default), the
5
+ // visible gate, and the iOS keep-alive reducer all live framework-agnostic in
6
+ // @symbiote-native/components and are shared verbatim with React/Vue (core/components/src/
7
+ // state/modal.ts + view/render-modal.ts); Svelte supplies only the lifecycle:
8
+ // - $state over the keep-alive reducer (switchReducer's twin: modalReducer)
9
+ // - a POST-render $effect driving the visible->hidden transition (Svelte's $effect runs
10
+ // after the DOM update, the same "one keep-alive frame survives" timing as React's
11
+ // useEffect / Vue's flush:'post' watch)
12
+ // - the descriptor bridge: renderModal() always paints the SAME fixed shape (one
13
+ // symbiote-modal host wrapping one symbiote-view container — only prop VALUES vary,
14
+ // never structure, per svelte-adapter-dom-shim skill §15), so rather than building a
15
+ // generic Descriptor->Svelte walker (there is none, and none is needed) this hand-authors
16
+ // the two literal host tags and reads renderModal()'s computed props off the fixed
17
+ // `root.props` / `root.children[0].props` positions, exactly like React's createElement
18
+ // chain and Vue's h() chain do.
19
+ import type { IModalProps } from './modal-props';
20
+
21
+ export type { IModalProps };
22
+ </script>
23
+
24
+ <script lang="ts">
25
+ import {
26
+ createInitialModalState,
27
+ modalReducer,
28
+ renderModal,
29
+ resolveAccessibilityProps,
30
+ shouldRenderModal,
31
+ } from '@symbiote-native/components';
32
+ import { dlog } from '@symbiote-native/engine';
33
+ import { createAttachmentsSync } from '../../runes/attachments';
34
+ import type { ShimElement } from '../../dom-shim';
35
+
36
+ let rawProps: IModalProps = $props();
37
+
38
+ let state = $state(createInitialModalState(rawProps.visible === true));
39
+
40
+ const resolved = $derived(resolveAccessibilityProps(rawProps));
41
+ const isVisible = $derived(resolved.visible === true);
42
+ const shouldRender = $derived(shouldRenderModal(isVisible, state));
43
+
44
+ // POST-render, mirroring state/modal.ts's contract: fires after the DOM update following the
45
+ // render that used the OLD state, so a visible->hidden transition keeps the node mounted one
46
+ // more frame (state.isRendered still true) before the NEXT render drops it. The reducer is
47
+ // identity-stable, so a no-op transition — including this effect's own first run on mount —
48
+ // triggers no extra render.
49
+ //
50
+ // Under this adapter's microtask-coalesced requestCommit() (element.ts's `p` setter), Svelte
51
+ // settles the whole visible->hidden cascade within the SAME microtask flush that processes the
52
+ // triggering prop change, so the keep-alive frame genuinely happens (a render sees
53
+ // isVisible=false with isRendered still true before this effect flips it) but isn't observable
54
+ // as its own committed Fabric frame the way React's per-render synchronous commit makes it.
55
+ $effect(() => {
56
+ state = modalReducer(state, isVisible ? { type: 'show' } : { type: 'hide' });
57
+ });
58
+
59
+ $effect(() => {
60
+ if (!shouldRender) dlog('Modal hidden -> no node committed');
61
+ });
62
+
63
+ // Owns its host element (symbiote-modal), so it folds aria/role via `resolved` above; the
64
+ // resolved fields ride the host node via `...passthrough` — includes onShow/onDismiss/
65
+ // onRequestClose/onOrientationChange (real ViewConfig DirectEvents) and every accessibility*
66
+ // field, untouched, exactly like React's `...passthrough`.
67
+ const root = $derived.by(() => {
68
+ const {
69
+ visible,
70
+ transparent,
71
+ backdropColor,
72
+ animationType,
73
+ presentationStyle,
74
+ supportedOrientations,
75
+ hardwareAccelerated,
76
+ statusBarTranslucent,
77
+ navigationBarTranslucent,
78
+ allowSwipeDismissal,
79
+ style,
80
+ class: className,
81
+ children: _children,
82
+ ...passthrough
83
+ } = resolved;
84
+
85
+ const descriptor = renderModal({
86
+ visible,
87
+ transparent,
88
+ backdropColor,
89
+ animationType,
90
+ presentationStyle,
91
+ supportedOrientations,
92
+ hardwareAccelerated,
93
+ statusBarTranslucent,
94
+ navigationBarTranslucent,
95
+ allowSwipeDismissal,
96
+ style,
97
+ passthrough,
98
+ });
99
+
100
+ // root = symbiote-modal > [container]; the children snippet nests UNDER the container View,
101
+ // never as a direct sibling of the host (RN's modal content layout) — see render-modal.ts.
102
+ const [container] = descriptor.children;
103
+ const containerProps = typeof container === 'string' ? {} : container.props;
104
+
105
+ return {
106
+ hostBag: descriptor.props,
107
+ containerBag: { ...containerProps, class: className },
108
+ };
109
+ });
110
+
111
+ // See View.svelte's note on `{@attach}` — bound to the modal host itself, the node this
112
+ // component owns (the inner container view is Modal's own structural child).
113
+ let hostShim = $state.raw<ShimElement | null>(null);
114
+ const syncAttachments = createAttachmentsSync();
115
+ $effect(() => {
116
+ syncAttachments(hostShim, rawProps);
117
+ });
118
+ </script>
119
+
120
+ {#if shouldRender}
121
+ <symbiote-modal p={root.hostBag} bind:this={hostShim}>
122
+ <symbiote-view p={root.containerBag}>
123
+ {@render rawProps.children?.()}
124
+ </symbiote-view>
125
+ </symbiote-modal>
126
+ {/if}
@@ -0,0 +1,5 @@
1
+ import type { IModalProps } from './modal-props';
2
+ export type { IModalProps };
3
+ declare const Index: import("svelte").Component<IModalProps, {}, "">;
4
+ type Index = ReturnType<typeof Index>;
5
+ export default Index;
@@ -0,0 +1,24 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { IStyleProp, ISymbioteEvent, IViewStyle } from '@symbiote-native/engine';
3
+ import type { IAccessibilityProps, IAriaProps, IModalAnimationType, IModalOrientation, IModalPresentationStyle } from '@symbiote-native/components';
4
+ import type { ISvelteClassValue } from '../../class-value';
5
+ export type { IModalAnimationType, IModalOrientation, IModalOrientationChangeEvent, IModalPresentationStyle, } from '@symbiote-native/components';
6
+ export interface IModalProps extends IAccessibilityProps, IAriaProps {
7
+ visible?: boolean;
8
+ transparent?: boolean;
9
+ backdropColor?: string;
10
+ animationType?: IModalAnimationType;
11
+ presentationStyle?: IModalPresentationStyle;
12
+ supportedOrientations?: ReadonlyArray<IModalOrientation>;
13
+ hardwareAccelerated?: boolean;
14
+ statusBarTranslucent?: boolean;
15
+ navigationBarTranslucent?: boolean;
16
+ allowSwipeDismissal?: boolean;
17
+ onShow?: () => void;
18
+ onDismiss?: () => void;
19
+ onRequestClose?: () => void;
20
+ onOrientationChange?: (event: ISymbioteEvent) => void;
21
+ style?: IStyleProp<IViewStyle>;
22
+ class?: ISvelteClassValue;
23
+ children?: Snippet;
24
+ }
@@ -0,0 +1 @@
1
+ export {};