@symbiote-native/svelte 0.3.0 → 2.0.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 (107) hide show
  1. package/README.md +8 -10
  2. package/build/components/{activity-indicator/activity-indicator-props.d.ts → activity-indicator-props.d.ts} +1 -1
  3. package/build/components/flat-list/index.svelte +4 -4
  4. package/build/components/{image-background/image-background-props.d.ts → image-background-props.d.ts} +1 -1
  5. package/build/components/index.d.ts +6 -24
  6. package/build/components/index.js +0 -18
  7. package/build/components/keyboard-avoiding-view/index.svelte +6 -6
  8. package/build/components/modal/index.svelte +7 -7
  9. package/build/components/pressable/pressable-props.d.ts +1 -0
  10. package/build/components/refresh-control-props.d.ts +1 -0
  11. package/build/components/safe-area-view-props.d.ts +1 -0
  12. package/build/components/text-props.d.ts +1 -0
  13. package/build/components/virtualized-list/index.svelte +71 -250
  14. package/build/dom-shim/canonical-prop-names.d.ts +2 -0
  15. package/build/dom-shim/canonical-prop-names.js +320 -0
  16. package/build/dom-shim/document.js +1 -1
  17. package/build/dom-shim/element.d.ts +17 -5
  18. package/build/dom-shim/element.js +258 -40
  19. package/build/dom-shim/fold-host-bag.d.ts +1 -0
  20. package/build/dom-shim/fold-host-bag.js +7 -0
  21. package/build/dom-shim/patch-globals.js +35 -7
  22. package/build/dom-shim/shim-node.js +11 -0
  23. package/build/dom-shim/style-cache.d.ts +1 -0
  24. package/build/dom-shim/style-cache.js +27 -0
  25. package/build/dom-shim/text.js +2 -2
  26. package/build/host-instance.d.ts +2 -3
  27. package/build/host-instance.js +9 -4
  28. package/build/index.d.ts +8 -4
  29. package/build/index.js +21 -5
  30. package/build/intrinsic-elements.d.ts +63 -0
  31. package/build/modules/animated/index.d.ts +7 -27
  32. package/build/modules/animated/index.js +24 -34
  33. package/build/modules/image/index.d.ts +3 -0
  34. package/build/modules/image/index.js +15 -0
  35. package/build/preprocessor/scoped-styles.js +1 -1
  36. package/build/register.d.ts +1 -0
  37. package/build/register.js +15 -0
  38. package/build/root-element.js +1 -1
  39. package/metro-css-parser.cjs +2 -1
  40. package/metro-svelte-transformer.cjs +30 -12
  41. package/package.json +19 -9
  42. package/build/components/RefreshControl.svelte +0 -40
  43. package/build/components/RefreshControl.svelte.d.ts +0 -5
  44. package/build/components/SafeAreaView.svelte +0 -34
  45. package/build/components/SafeAreaView.svelte.d.ts +0 -5
  46. package/build/components/Text.svelte +0 -34
  47. package/build/components/Text.svelte.d.ts +0 -5
  48. package/build/components/View.svelte +0 -43
  49. package/build/components/View.svelte.d.ts +0 -5
  50. package/build/components/activity-indicator/activity-indicator-platform.android.d.ts +0 -3
  51. package/build/components/activity-indicator/activity-indicator-platform.android.js +0 -5
  52. package/build/components/activity-indicator/activity-indicator-platform.d.ts +0 -1
  53. package/build/components/activity-indicator/activity-indicator-platform.ios.d.ts +0 -3
  54. package/build/components/activity-indicator/activity-indicator-platform.ios.js +0 -6
  55. package/build/components/activity-indicator/activity-indicator-platform.js +0 -5
  56. package/build/components/activity-indicator/index.svelte +0 -63
  57. package/build/components/activity-indicator/index.svelte.d.ts +0 -5
  58. package/build/components/button.svelte +0 -76
  59. package/build/components/button.svelte.d.ts +0 -5
  60. package/build/components/image/image-logic.d.ts +0 -2
  61. package/build/components/image/image-logic.js +0 -135
  62. package/build/components/image/index.d.ts +0 -3
  63. package/build/components/image/index.js +0 -10
  64. package/build/components/image/index.svelte +0 -66
  65. package/build/components/image/index.svelte.d.ts +0 -5
  66. package/build/components/image-background/index.svelte +0 -87
  67. package/build/components/image-background/index.svelte.d.ts +0 -5
  68. package/build/components/input-accessory-view/index.svelte +0 -51
  69. package/build/components/input-accessory-view/index.svelte.d.ts +0 -5
  70. package/build/components/pressable/index.svelte +0 -167
  71. package/build/components/pressable/index.svelte.d.ts +0 -5
  72. package/build/components/scroll-view/index.svelte +0 -331
  73. package/build/components/scroll-view/index.svelte.d.ts +0 -18
  74. package/build/components/scroll-view/scroll-view-platform-types.d.ts +0 -3
  75. package/build/components/scroll-view/scroll-view-platform.android.d.ts +0 -3
  76. package/build/components/scroll-view/scroll-view-platform.android.js +0 -3
  77. package/build/components/scroll-view/scroll-view-platform.d.ts +0 -1
  78. package/build/components/scroll-view/scroll-view-platform.ios.d.ts +0 -3
  79. package/build/components/scroll-view/scroll-view-platform.ios.js +0 -3
  80. package/build/components/scroll-view/scroll-view-platform.js +0 -4
  81. package/build/components/scroll-view/scroll-view-sticky-context.d.ts +0 -7
  82. package/build/components/scroll-view/scroll-view-sticky-context.js +0 -1
  83. package/build/components/scroll-view/sticky-header-props.d.ts +0 -10
  84. package/build/components/scroll-view/sticky-header-props.js +0 -1
  85. package/build/components/scroll-view/sticky-header.svelte +0 -287
  86. package/build/components/scroll-view/sticky-header.svelte.d.ts +0 -5
  87. package/build/components/switch/index.svelte +0 -134
  88. package/build/components/switch/index.svelte.d.ts +0 -5
  89. package/build/components/text-input/index.svelte +0 -316
  90. package/build/components/text-input/index.svelte.d.ts +0 -12
  91. package/build/components/touchable-highlight/index.svelte +0 -138
  92. package/build/components/touchable-highlight/index.svelte.d.ts +0 -5
  93. package/build/components/touchable-native-feedback/index.d.ts +0 -9
  94. package/build/components/touchable-native-feedback/index.js +0 -14
  95. package/build/components/touchable-native-feedback/touchable-native-feedback.svelte +0 -49
  96. package/build/components/touchable-native-feedback/touchable-native-feedback.svelte.d.ts +0 -5
  97. package/build/components/touchable-opacity/index.svelte +0 -180
  98. package/build/components/touchable-opacity/index.svelte.d.ts +0 -5
  99. package/build/components/touchable-without-feedback/index.svelte +0 -74
  100. package/build/components/touchable-without-feedback/index.svelte.d.ts +0 -5
  101. package/build/modules/animated/animated-component-props.d.ts +0 -7
  102. package/build/modules/animated/animated-component-props.js +0 -1
  103. package/build/modules/animated/create-animated-component.d.ts +0 -5
  104. package/build/modules/animated/create-animated-component.js +0 -131
  105. /package/build/components/{activity-indicator/activity-indicator-props.js → activity-indicator-props.js} +0 -0
  106. /package/build/components/{image-background/image-background-props.js → image-background-props.js} +0 -0
  107. /package/build/{components/scroll-view/scroll-view-platform-types.js → intrinsic-elements.js} +0 -0
package/README.md CHANGED
@@ -59,22 +59,20 @@ import { name as appName } from './app.json';
59
59
  createApp(App).mount(appName);
60
60
  ```
61
61
 
62
- The app is ordinary Svelte 5 — it just imports primitives from `@symbiote-native/svelte` instead of
63
- `react-native`. A tap→increment counter, using runes:
62
+ The app is ordinary Svelte 5 — the native primitives are plain intrinsic tags, no import needed.
63
+ A tap→increment counter, using runes:
64
64
 
65
65
  ```svelte
66
66
  <script lang="ts">
67
- import { View, Text, Pressable } from '@symbiote-native/svelte';
68
-
69
67
  let count = $state(0);
70
68
  </script>
71
69
 
72
- <View style={{ padding: 24 }}>
73
- <Text>Taps: {count}</Text>
74
- <Pressable onPress={() => count++}>
75
- <Text>Tap me</Text>
76
- </Pressable>
77
- </View>
70
+ <view style={{ padding: 24 }}>
71
+ <text>Taps: {count}</text>
72
+ <pressable onPress={() => count++}>
73
+ <text>Tap me</text>
74
+ </pressable>
75
+ </view>
78
76
  ```
79
77
 
80
78
  The full canary is [`examples/svelte`](../../examples/svelte) — a stock RN 0.86 app whose
@@ -1,5 +1,5 @@
1
1
  import type { IActivityIndicatorProps as IActivityIndicatorBaseProps } from '@symbiote-native/components';
2
- import type { ISvelteClassValue } from '../../class-value';
2
+ import type { ISvelteClassValue } from '../class-value';
3
3
  export type IActivityIndicatorProps = IActivityIndicatorBaseProps & {
4
4
  class?: ISvelteClassValue;
5
5
  };
@@ -173,17 +173,17 @@
173
173
  index: number;
174
174
  separators: ISeparators;
175
175
  })}
176
- <symbiote-view p={{ style: rowStyle }}>
176
+ <view p={{ style: rowStyle }}>
177
177
  {#each row.items as rowItem, column (props.keyExtractor ? props.keyExtractor(rowItem, row.startIndex + column) : String(row.startIndex + column))}
178
- <symbiote-view p={{ style: { flex: 1 } }}>
178
+ <view p={{ style: { flex: 1 } }}>
179
179
  {@render props.item({
180
180
  item: rowItem,
181
181
  index: row.startIndex + column,
182
182
  separators,
183
183
  })}
184
- </symbiote-view>
184
+ </view>
185
185
  {/each}
186
- </symbiote-view>
186
+ </view>
187
187
  {/snippet}
188
188
 
189
189
  {#snippet rowSeparator(entryProps: ISeparatorProps<IRow<ItemT>>)}
@@ -1,7 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  import type { IStyleProp, IViewStyle } from '@symbiote-native/engine';
3
3
  import type { IImageProps } from '@symbiote-native/components';
4
- import type { ISvelteClassValue } from '../../class-value';
4
+ import type { ISvelteClassValue } from '../class-value';
5
5
  export interface IImageBackgroundProps extends Omit<IImageProps, 'style'> {
6
6
  style?: IStyleProp<IViewStyle>;
7
7
  imageStyle?: IStyleProp<IViewStyle> | string;
@@ -1,45 +1,27 @@
1
- export { default as View } from './View.svelte';
2
- export { default as Text } from './Text.svelte';
3
1
  export type { IViewProps } from './view-props';
4
2
  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';
3
+ export type { IActivityIndicatorProps } from './activity-indicator-props';
4
+ export type { IImageProps } from './image/image-props';
5
+ export type { IImageBackgroundProps } from './image-background-props';
12
6
  export type { IInputAccessoryViewProps } from './input-accessory-view/input-accessory-view-props';
13
7
  export { default as KeyboardAvoidingView } from './keyboard-avoiding-view/index.svelte';
14
8
  export type { IKeyboardAvoidingViewProps, IKeyboardAvoidingBehavior, } from './keyboard-avoiding-view/keyboard-avoiding-view-props';
15
- export { default as Switch } from './switch/index.svelte';
16
9
  export type { ISwitchProps } from './switch/switch-props';
17
- export { default as TextInput } from './text-input/index.svelte';
10
+ export type { ISwitchChangeEvent } from '@symbiote-native/components';
18
11
  export type { ITextInputProps } from './text-input/text-input-props';
19
- export type { ITextInputHandle } from '@symbiote-native/components';
12
+ export type { ITextInputHandle, ITextInputChangeEvent, } from '@symbiote-native/components';
20
13
  export { default as Modal } from './modal/index.svelte';
21
14
  export type { IModalProps } from './modal/modal-props';
22
- export { default as SafeAreaView } from './SafeAreaView.svelte';
23
15
  export type { ISafeAreaViewProps } from './safe-area-view-props';
24
- export { default as RefreshControl } from './RefreshControl.svelte';
25
16
  export type { IRefreshControlProps } from './refresh-control-props';
26
- export { default as Pressable } from './pressable/index.svelte';
27
17
  export type { IPressableProps } from './pressable/pressable-props';
28
- export { default as TouchableOpacity } from './touchable-opacity/index.svelte';
29
18
  export type { ITouchableOpacityProps } from './touchable-opacity/touchable-opacity-props';
30
- export { default as TouchableHighlight } from './touchable-highlight/index.svelte';
31
19
  export type { ITouchableHighlightProps } from './touchable-highlight/touchable-highlight-props';
32
- export { default as TouchableWithoutFeedback } from './touchable-without-feedback/index.svelte';
33
20
  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';
21
+ export type { ITouchableNativeFeedbackProps } from './touchable-native-feedback/touchable-native-feedback-props';
37
22
  export type { IButtonProps } from './button-props';
38
- export { default as ScrollView } from './scroll-view/index.svelte';
39
23
  export type { IScrollViewProps } from './scroll-view/scroll-view-props';
40
24
  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
25
  export { default as VirtualizedList } from './virtualized-list/index.svelte';
44
26
  export type { IVirtualizedListProps, IVirtualizedListHandle, } from './virtualized-list/virtualized-list-props';
45
27
  export { default as FlatList } from './flat-list/index.svelte';
@@ -1,23 +1,5 @@
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
1
  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
2
  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
3
  export { default as VirtualizedList } from './virtualized-list/index.svelte';
22
4
  export { default as FlatList } from './flat-list/index.svelte';
23
5
  export { default as VirtualizedSectionList } from './virtualized-section-list/index.svelte';
@@ -146,13 +146,13 @@
146
146
  </script>
147
147
 
148
148
  {#if layout.kind === 'nested'}
149
- <symbiote-view p={wrapperBag} bind:this={hostShim}>
150
- <symbiote-view p={innerBag}>
149
+ <view p={wrapperBag} bind:this={hostShim}>
150
+ <view p={innerBag}>
151
151
  {@render children?.()}
152
- </symbiote-view>
153
- </symbiote-view>
152
+ </view>
153
+ </view>
154
154
  {:else}
155
- <symbiote-view p={wrapperBag} bind:this={hostShim}>
155
+ <view p={wrapperBag} bind:this={hostShim}>
156
156
  {@render children?.()}
157
- </symbiote-view>
157
+ </view>
158
158
  {/if}
@@ -10,7 +10,7 @@
10
10
  // after the DOM update, the same "one keep-alive frame survives" timing as React's
11
11
  // useEffect / Vue's flush:'post' watch)
12
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,
13
+ // modal host wrapping one view container — only prop VALUES vary,
14
14
  // never structure, per svelte-adapter-dom-shim skill §15), so rather than building a
15
15
  // generic Descriptor->Svelte walker (there is none, and none is needed) this hand-authors
16
16
  // the two literal host tags and reads renderModal()'s computed props off the fixed
@@ -63,7 +63,7 @@
63
63
  if (!shouldRender) dlog('Modal hidden -> no node committed');
64
64
  });
65
65
 
66
- // Owns its host element (symbiote-modal), so it folds aria/role via `resolved` above; the
66
+ // Owns its host element (modal), so it folds aria/role via `resolved` above; the
67
67
  // resolved fields ride the host node via `...passthrough` — includes onShow/onDismiss/
68
68
  // onRequestClose/onOrientationChange (real ViewConfig DirectEvents) and every accessibility*
69
69
  // field, untouched, exactly like React's `...passthrough`.
@@ -100,7 +100,7 @@
100
100
  passthrough,
101
101
  });
102
102
 
103
- // root = symbiote-modal > [container]; the children snippet nests UNDER the container View,
103
+ // root = modal > [container]; the children snippet nests UNDER the container View,
104
104
  // never as a direct sibling of the host (RN's modal content layout) — see render-modal.ts.
105
105
  const [container] = descriptor.children;
106
106
  const containerProps = typeof container === 'string' ? {} : container.props;
@@ -121,9 +121,9 @@
121
121
  </script>
122
122
 
123
123
  {#if shouldRender}
124
- <symbiote-modal p={root.hostBag} bind:this={hostShim}>
125
- <symbiote-view p={root.containerBag}>
124
+ <modal p={root.hostBag} bind:this={hostShim}>
125
+ <view p={root.containerBag}>
126
126
  {@render rawProps.children?.()}
127
- </symbiote-view>
128
- </symbiote-modal>
127
+ </view>
128
+ </modal>
129
129
  {/if}
@@ -11,6 +11,7 @@ export interface IPressableProps extends IAccessibilityProps, IAriaProps {
11
11
  onLongPress?: IPressHandler;
12
12
  delayLongPress?: number;
13
13
  disabled?: boolean;
14
+ focusable?: boolean;
14
15
  cancelable?: boolean;
15
16
  hitSlop?: IRectOffset;
16
17
  pressRetentionOffset?: IRectOffset;
@@ -4,6 +4,7 @@ import type { IAccessibilityProps, IAriaProps } from '@symbiote-native/component
4
4
  import type { ISvelteClassValue } from '../class-value';
5
5
  export interface IRefreshControlProps extends IAccessibilityProps, IAriaProps {
6
6
  refreshing: boolean;
7
+ id?: string;
7
8
  onRefresh?: () => void | Promise<void>;
8
9
  tintColor?: string;
9
10
  title?: string;
@@ -4,6 +4,7 @@ import type { IAccessibilityProps, IAriaProps } from '@symbiote-native/component
4
4
  import type { ISvelteClassValue } from '../class-value';
5
5
  export interface ISafeAreaViewProps extends IAccessibilityProps, IAriaProps {
6
6
  style?: IStyleProp<IViewStyle>;
7
+ id?: string;
7
8
  class?: ISvelteClassValue;
8
9
  onLayout?: (event: ISymbioteEvent) => void;
9
10
  children?: Snippet;
@@ -14,6 +14,7 @@ export interface ITextProps extends IAccessibilityProps, IAriaProps {
14
14
  numberOfLines?: number;
15
15
  ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip';
16
16
  selectable?: boolean;
17
+ disabled?: boolean;
17
18
  adjustsFontSizeToFit?: boolean;
18
19
  minimumFontScale?: number;
19
20
  allowFontScaling?: boolean;