@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.
- package/LICENSE +21 -0
- package/README.md +161 -0
- package/build/bootstrap.d.ts +7 -0
- package/build/bootstrap.js +17 -0
- package/build/class-value.d.ts +6 -0
- package/build/class-value.js +81 -0
- package/build/components/RefreshControl.svelte +38 -0
- package/build/components/RefreshControl.svelte.d.ts +5 -0
- package/build/components/SafeAreaView.svelte +34 -0
- package/build/components/SafeAreaView.svelte.d.ts +5 -0
- package/build/components/Text.svelte +25 -0
- package/build/components/Text.svelte.d.ts +5 -0
- package/build/components/View.svelte +41 -0
- package/build/components/View.svelte.d.ts +5 -0
- package/build/components/activity-indicator/activity-indicator-platform.android.d.ts +3 -0
- package/build/components/activity-indicator/activity-indicator-platform.android.js +5 -0
- package/build/components/activity-indicator/activity-indicator-platform.d.ts +1 -0
- package/build/components/activity-indicator/activity-indicator-platform.ios.d.ts +3 -0
- package/build/components/activity-indicator/activity-indicator-platform.ios.js +6 -0
- package/build/components/activity-indicator/activity-indicator-platform.js +5 -0
- package/build/components/activity-indicator/activity-indicator-props.d.ts +5 -0
- package/build/components/activity-indicator/activity-indicator-props.js +1 -0
- package/build/components/activity-indicator/index.svelte +57 -0
- package/build/components/activity-indicator/index.svelte.d.ts +5 -0
- package/build/components/button-props.d.ts +5 -0
- package/build/components/button-props.js +1 -0
- package/build/components/button.svelte +71 -0
- package/build/components/button.svelte.d.ts +5 -0
- package/build/components/flat-list/flat-list-props.d.ts +10 -0
- package/build/components/flat-list/flat-list-props.js +1 -0
- package/build/components/flat-list/index.svelte +254 -0
- package/build/components/flat-list/index.svelte.d.ts +79 -0
- package/build/components/image/image-logic.d.ts +2 -0
- package/build/components/image/image-logic.js +125 -0
- package/build/components/image/image-props.d.ts +5 -0
- package/build/components/image/image-props.js +1 -0
- package/build/components/image/index.d.ts +3 -0
- package/build/components/image/index.js +10 -0
- package/build/components/image/index.svelte +66 -0
- package/build/components/image/index.svelte.d.ts +5 -0
- package/build/components/image-background/image-background-props.d.ts +10 -0
- package/build/components/image-background/image-background-props.js +1 -0
- package/build/components/image-background/index.svelte +81 -0
- package/build/components/image-background/index.svelte.d.ts +5 -0
- package/build/components/index.d.ts +50 -0
- package/build/components/index.js +24 -0
- package/build/components/input-accessory-view/index.svelte +48 -0
- package/build/components/input-accessory-view/index.svelte.d.ts +5 -0
- package/build/components/input-accessory-view/input-accessory-view-props.d.ts +11 -0
- package/build/components/input-accessory-view/input-accessory-view-props.js +1 -0
- package/build/components/keyboard-avoiding-view/index.svelte +135 -0
- package/build/components/keyboard-avoiding-view/index.svelte.d.ts +5 -0
- package/build/components/keyboard-avoiding-view/keyboard-avoiding-view-props.d.ts +15 -0
- package/build/components/keyboard-avoiding-view/keyboard-avoiding-view-props.js +1 -0
- package/build/components/modal/index.svelte +126 -0
- package/build/components/modal/index.svelte.d.ts +5 -0
- package/build/components/modal/modal-props.d.ts +24 -0
- package/build/components/modal/modal-props.js +1 -0
- package/build/components/pressable/index.svelte +160 -0
- package/build/components/pressable/index.svelte.d.ts +5 -0
- package/build/components/pressable/pressable-props.d.ts +27 -0
- package/build/components/pressable/pressable-props.js +1 -0
- package/build/components/refresh-control-props.d.ts +19 -0
- package/build/components/refresh-control-props.js +1 -0
- package/build/components/safe-area-view-props.d.ts +10 -0
- package/build/components/safe-area-view-props.js +1 -0
- package/build/components/scroll-view/index.svelte +298 -0
- package/build/components/scroll-view/index.svelte.d.ts +18 -0
- package/build/components/scroll-view/scroll-view-platform-types.d.ts +3 -0
- package/build/components/scroll-view/scroll-view-platform-types.js +1 -0
- package/build/components/scroll-view/scroll-view-platform.android.d.ts +3 -0
- package/build/components/scroll-view/scroll-view-platform.android.js +3 -0
- package/build/components/scroll-view/scroll-view-platform.d.ts +1 -0
- package/build/components/scroll-view/scroll-view-platform.ios.d.ts +3 -0
- package/build/components/scroll-view/scroll-view-platform.ios.js +3 -0
- package/build/components/scroll-view/scroll-view-platform.js +4 -0
- package/build/components/scroll-view/scroll-view-props.d.ts +78 -0
- package/build/components/scroll-view/scroll-view-props.js +1 -0
- package/build/components/scroll-view/scroll-view-sticky-context.d.ts +7 -0
- package/build/components/scroll-view/scroll-view-sticky-context.js +1 -0
- package/build/components/scroll-view/sticky-header-props.d.ts +10 -0
- package/build/components/scroll-view/sticky-header-props.js +1 -0
- package/build/components/scroll-view/sticky-header.svelte +254 -0
- package/build/components/scroll-view/sticky-header.svelte.d.ts +5 -0
- package/build/components/section-list/index.svelte +107 -0
- package/build/components/section-list/index.svelte.d.ts +57 -0
- package/build/components/section-list/section-list-props.d.ts +1 -0
- package/build/components/section-list/section-list-props.js +1 -0
- package/build/components/switch/index.svelte +123 -0
- package/build/components/switch/index.svelte.d.ts +5 -0
- package/build/components/switch/switch-platform-types.d.ts +5 -0
- package/build/components/switch/switch-platform-types.js +1 -0
- package/build/components/switch/switch-platform.android.d.ts +3 -0
- package/build/components/switch/switch-platform.android.js +8 -0
- package/build/components/switch/switch-platform.d.ts +1 -0
- package/build/components/switch/switch-platform.ios.d.ts +3 -0
- package/build/components/switch/switch-platform.ios.js +7 -0
- package/build/components/switch/switch-platform.js +5 -0
- package/build/components/switch/switch-props.d.ts +5 -0
- package/build/components/switch/switch-props.js +1 -0
- package/build/components/text-input/index.svelte +300 -0
- package/build/components/text-input/index.svelte.d.ts +12 -0
- package/build/components/text-input/text-input-props.d.ts +5 -0
- package/build/components/text-input/text-input-props.js +1 -0
- package/build/components/text-props.d.ts +23 -0
- package/build/components/text-props.js +1 -0
- package/build/components/touchable-base-props.d.ts +10 -0
- package/build/components/touchable-base-props.js +1 -0
- package/build/components/touchable-highlight/index.svelte +39 -0
- package/build/components/touchable-highlight/index.svelte.d.ts +5 -0
- package/build/components/touchable-highlight/touchable-highlight-props.d.ts +5 -0
- package/build/components/touchable-highlight/touchable-highlight-props.js +1 -0
- package/build/components/touchable-native-feedback/index.d.ts +9 -0
- package/build/components/touchable-native-feedback/index.js +14 -0
- package/build/components/touchable-native-feedback/touchable-native-feedback-props.d.ts +8 -0
- package/build/components/touchable-native-feedback/touchable-native-feedback-props.js +1 -0
- package/build/components/touchable-native-feedback/touchable-native-feedback.svelte +44 -0
- package/build/components/touchable-native-feedback/touchable-native-feedback.svelte.d.ts +5 -0
- package/build/components/touchable-opacity/index.svelte +124 -0
- package/build/components/touchable-opacity/index.svelte.d.ts +5 -0
- package/build/components/touchable-opacity/touchable-opacity-props.d.ts +5 -0
- package/build/components/touchable-opacity/touchable-opacity-props.js +1 -0
- package/build/components/touchable-without-feedback/index.svelte +19 -0
- package/build/components/touchable-without-feedback/index.svelte.d.ts +5 -0
- package/build/components/touchable-without-feedback/touchable-without-feedback-props.d.ts +2 -0
- package/build/components/touchable-without-feedback/touchable-without-feedback-props.js +1 -0
- package/build/components/view-props.d.ts +29 -0
- package/build/components/view-props.js +1 -0
- package/build/components/virtualized-list/index.svelte +702 -0
- package/build/components/virtualized-list/index.svelte.d.ts +79 -0
- package/build/components/virtualized-list/virtualized-list-props.d.ts +70 -0
- package/build/components/virtualized-list/virtualized-list-props.js +73 -0
- package/build/components/virtualized-section-list/index.svelte +206 -0
- package/build/components/virtualized-section-list/index.svelte.d.ts +57 -0
- package/build/components/virtualized-section-list/virtualized-section-list-props.d.ts +62 -0
- package/build/components/virtualized-section-list/virtualized-section-list-props.js +1 -0
- package/build/create-tunnel/index.d.ts +3 -0
- package/build/create-tunnel/index.js +3 -0
- package/build/create-tunnel/tunnel-in.svelte +24 -0
- package/build/create-tunnel/tunnel-in.svelte.d.ts +9 -0
- package/build/create-tunnel/tunnel-out.svelte +14 -0
- package/build/create-tunnel/tunnel-out.svelte.d.ts +7 -0
- package/build/create-tunnel/tunnel.d.ts +9 -0
- package/build/create-tunnel/tunnel.js +9 -0
- package/build/descriptor-to-svelte.d.ts +7 -0
- package/build/descriptor-to-svelte.js +104 -0
- package/build/dom-shim/comment.d.ts +9 -0
- package/build/dom-shim/comment.js +24 -0
- package/build/dom-shim/document-fragment.d.ts +8 -0
- package/build/dom-shim/document-fragment.js +23 -0
- package/build/dom-shim/document.d.ts +23 -0
- package/build/dom-shim/document.js +61 -0
- package/build/dom-shim/element.d.ts +22 -0
- package/build/dom-shim/element.js +130 -0
- package/build/dom-shim/index.d.ts +5 -0
- package/build/dom-shim/index.js +7 -0
- package/build/dom-shim/patch-globals.d.ts +2 -0
- package/build/dom-shim/patch-globals.js +94 -0
- package/build/dom-shim/shim-node.d.ts +30 -0
- package/build/dom-shim/shim-node.js +207 -0
- package/build/dom-shim/text.d.ts +14 -0
- package/build/dom-shim/text.js +97 -0
- package/build/host-instance.d.ts +5 -0
- package/build/host-instance.js +48 -0
- package/build/index.d.ts +28 -0
- package/build/index.js +77 -0
- package/build/modules/accessibility-info/index.android.d.ts +2 -0
- package/build/modules/accessibility-info/index.android.js +4 -0
- package/build/modules/accessibility-info/index.d.ts +1 -0
- package/build/modules/accessibility-info/index.ios.d.ts +2 -0
- package/build/modules/accessibility-info/index.ios.js +3 -0
- package/build/modules/accessibility-info/index.js +5 -0
- package/build/modules/animated/AnimatedImage.svelte +115 -0
- package/build/modules/animated/AnimatedImage.svelte.d.ts +5 -0
- package/build/modules/animated/AnimatedScrollView.svelte +92 -0
- package/build/modules/animated/AnimatedScrollView.svelte.d.ts +17 -0
- package/build/modules/animated/AnimatedText.svelte +58 -0
- package/build/modules/animated/AnimatedText.svelte.d.ts +5 -0
- package/build/modules/animated/AnimatedView.svelte +95 -0
- package/build/modules/animated/AnimatedView.svelte.d.ts +5 -0
- package/build/modules/animated/animated-component-props.d.ts +7 -0
- package/build/modules/animated/animated-component-props.js +1 -0
- package/build/modules/animated/index.d.ts +58 -0
- package/build/modules/animated/index.js +69 -0
- package/build/modules/app-registry/index.d.ts +7 -0
- package/build/modules/app-registry/index.js +28 -0
- package/build/modules/status-bar/index.d.ts +5 -0
- package/build/modules/status-bar/index.js +21 -0
- package/build/modules/status-bar/index.svelte +20 -0
- package/build/modules/status-bar/index.svelte.d.ts +4 -0
- package/build/native-view-bridge.d.ts +4 -0
- package/build/native-view-bridge.js +27 -0
- package/build/preprocessor/forbid-web-only-constructs.d.ts +8 -0
- package/build/preprocessor/forbid-web-only-constructs.js +204 -0
- package/build/preprocessor/scoped-styles.d.ts +10 -0
- package/build/preprocessor/scoped-styles.js +399 -0
- package/build/render.d.ts +7 -0
- package/build/render.js +46 -0
- package/build/root-element.d.ts +3 -0
- package/build/root-element.js +27 -0
- package/build/runes/attachments.d.ts +5 -0
- package/build/runes/attachments.js +73 -0
- package/build/runes/dimensions-value.d.ts +4 -0
- package/build/runes/dimensions-value.js +30 -0
- package/build/runes/media-query.d.ts +8 -0
- package/build/runes/media-query.js +38 -0
- package/build/runes/use-color-scheme.svelte.d.ts +4 -0
- package/build/runes/use-color-scheme.svelte.js +25 -0
- package/build/runes/use-window-dimensions.svelte.d.ts +4 -0
- package/build/runes/use-window-dimensions.svelte.js +43 -0
- package/build/runes/window.d.ts +6 -0
- package/build/runes/window.js +28 -0
- package/build/scope-token.d.ts +2 -0
- package/build/scope-token.js +33 -0
- package/build/style-scope.d.ts +1 -0
- package/build/style-scope.js +29 -0
- package/metro-css-parser.cjs +9 -0
- package/metro-svelte-transformer.cjs +156 -0
- package/package.json +83 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { IVirtualizedListProps, IVirtualizedListHandle } from './virtualized-list-props';
|
|
2
|
+
export type { IVirtualizedListProps, IVirtualizedListHandle };
|
|
3
|
+
import { type IScrollViewHandle } from '@symbiote-native/components';
|
|
4
|
+
import { type ISymbioteNode } from '@symbiote-native/engine';
|
|
5
|
+
import { type IVirtualizedListProps as IProps } from './virtualized-list-props';
|
|
6
|
+
declare function $$render<ItemT>(): {
|
|
7
|
+
props: IProps<ItemT>;
|
|
8
|
+
exports: {
|
|
9
|
+
scrollToOffset: (params: {
|
|
10
|
+
offset: number;
|
|
11
|
+
animated?: boolean;
|
|
12
|
+
}) => void;
|
|
13
|
+
scrollToIndex: (params: {
|
|
14
|
+
index: number;
|
|
15
|
+
animated?: boolean;
|
|
16
|
+
viewOffset?: number;
|
|
17
|
+
viewPosition?: number;
|
|
18
|
+
}) => void;
|
|
19
|
+
scrollToItem: (params: {
|
|
20
|
+
item: unknown;
|
|
21
|
+
animated?: boolean;
|
|
22
|
+
viewPosition?: number;
|
|
23
|
+
}) => void;
|
|
24
|
+
scrollToEnd: (params?: {
|
|
25
|
+
animated?: boolean;
|
|
26
|
+
}) => void;
|
|
27
|
+
flashScrollIndicators: () => void;
|
|
28
|
+
getNativeScrollRef: () => IScrollViewHandle | null;
|
|
29
|
+
getScrollableNode: () => IScrollViewHandle | null;
|
|
30
|
+
getScrollResponder: () => IScrollViewHandle | null;
|
|
31
|
+
getScrollNode: () => ISymbioteNode | null;
|
|
32
|
+
recordInteraction: () => void;
|
|
33
|
+
};
|
|
34
|
+
bindings: "";
|
|
35
|
+
slots: {};
|
|
36
|
+
events: {};
|
|
37
|
+
};
|
|
38
|
+
declare class __sveltets_Render<ItemT> {
|
|
39
|
+
props(): ReturnType<typeof $$render<ItemT>>['props'];
|
|
40
|
+
events(): ReturnType<typeof $$render<ItemT>>['events'];
|
|
41
|
+
slots(): ReturnType<typeof $$render<ItemT>>['slots'];
|
|
42
|
+
bindings(): "";
|
|
43
|
+
exports(): {
|
|
44
|
+
scrollToOffset: (params: {
|
|
45
|
+
offset: number;
|
|
46
|
+
animated?: boolean;
|
|
47
|
+
}) => void;
|
|
48
|
+
scrollToIndex: (params: {
|
|
49
|
+
index: number;
|
|
50
|
+
animated?: boolean;
|
|
51
|
+
viewOffset?: number;
|
|
52
|
+
viewPosition?: number;
|
|
53
|
+
}) => void;
|
|
54
|
+
scrollToItem: (params: {
|
|
55
|
+
item: unknown;
|
|
56
|
+
animated?: boolean;
|
|
57
|
+
viewPosition?: number;
|
|
58
|
+
}) => void;
|
|
59
|
+
scrollToEnd: (params?: {
|
|
60
|
+
animated?: boolean;
|
|
61
|
+
} | undefined) => void;
|
|
62
|
+
flashScrollIndicators: () => void;
|
|
63
|
+
getNativeScrollRef: () => IScrollViewHandle | null;
|
|
64
|
+
getScrollableNode: () => IScrollViewHandle | null;
|
|
65
|
+
getScrollResponder: () => IScrollViewHandle | null;
|
|
66
|
+
getScrollNode: () => ISymbioteNode | null;
|
|
67
|
+
recordInteraction: () => void;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
interface $$IsomorphicComponent {
|
|
71
|
+
new <ItemT>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<ItemT>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<ItemT>['props']>, ReturnType<__sveltets_Render<ItemT>['events']>, ReturnType<__sveltets_Render<ItemT>['slots']>> & {
|
|
72
|
+
$$bindings?: ReturnType<__sveltets_Render<ItemT>['bindings']>;
|
|
73
|
+
} & ReturnType<__sveltets_Render<ItemT>['exports']>;
|
|
74
|
+
<ItemT>(internal: unknown, props: ReturnType<__sveltets_Render<ItemT>['props']> & {}): ReturnType<__sveltets_Render<ItemT>['exports']>;
|
|
75
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
76
|
+
}
|
|
77
|
+
declare const Index: $$IsomorphicComponent;
|
|
78
|
+
type Index<ItemT> = InstanceType<typeof Index<ItemT>>;
|
|
79
|
+
export default Index;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { IStyleProp, ISymbioteEvent, ISymbioteNode, IViewStyle } from '@symbiote-native/engine';
|
|
3
|
+
import { type IAccessibilityProps, type IAriaProps, type ISeparatorProps, type ISeparators, type IViewabilityConfig, type IViewabilityConfigCallbackPair, type IViewableItemsChangedInfo, type IVirtualizedListHandle } from '@symbiote-native/components';
|
|
4
|
+
import type { ISvelteClassValue } from '../../class-value';
|
|
5
|
+
export type { IVirtualizedListHandle };
|
|
6
|
+
export interface IVirtualizedListProps<ItemT> extends IAccessibilityProps, IAriaProps {
|
|
7
|
+
data: unknown;
|
|
8
|
+
getItem: (data: unknown, index: number) => ItemT;
|
|
9
|
+
getItemCount: (data: unknown) => number;
|
|
10
|
+
item: Snippet<[{
|
|
11
|
+
item: ItemT;
|
|
12
|
+
index: number;
|
|
13
|
+
separators: ISeparators;
|
|
14
|
+
}]>;
|
|
15
|
+
separator?: Snippet<[ISeparatorProps<ItemT>]>;
|
|
16
|
+
header?: Snippet;
|
|
17
|
+
footer?: Snippet;
|
|
18
|
+
empty?: Snippet;
|
|
19
|
+
keyExtractor?: (item: ItemT, index: number) => string;
|
|
20
|
+
getItemLayout?: (data: unknown, index: number) => {
|
|
21
|
+
length: number;
|
|
22
|
+
offset: number;
|
|
23
|
+
index: number;
|
|
24
|
+
};
|
|
25
|
+
horizontal?: boolean;
|
|
26
|
+
inverted?: boolean;
|
|
27
|
+
extraData?: unknown;
|
|
28
|
+
onEndReached?: (info: {
|
|
29
|
+
distanceFromEnd: number;
|
|
30
|
+
}) => void;
|
|
31
|
+
onEndReachedThreshold?: number;
|
|
32
|
+
onStartReached?: (info: {
|
|
33
|
+
distanceFromStart: number;
|
|
34
|
+
}) => void;
|
|
35
|
+
onStartReachedThreshold?: number;
|
|
36
|
+
onRefresh?: () => void;
|
|
37
|
+
refreshing?: boolean | null;
|
|
38
|
+
progressViewOffset?: number;
|
|
39
|
+
onViewableItemsChanged?: (info: IViewableItemsChangedInfo<ItemT>) => void;
|
|
40
|
+
viewabilityConfig?: IViewabilityConfig;
|
|
41
|
+
viewabilityConfigCallbackPairs?: IViewabilityConfigCallbackPair<ItemT>[];
|
|
42
|
+
onScrollToIndexFailed?: (info: {
|
|
43
|
+
index: number;
|
|
44
|
+
highestMeasuredFrameIndex: number;
|
|
45
|
+
averageItemLength: number;
|
|
46
|
+
}) => void;
|
|
47
|
+
initialNumToRender?: number;
|
|
48
|
+
initialScrollIndex?: number;
|
|
49
|
+
maxToRenderPerBatch?: number;
|
|
50
|
+
updateCellsBatchingPeriod?: number;
|
|
51
|
+
windowSize?: number;
|
|
52
|
+
stickyHeaderIndices?: number[];
|
|
53
|
+
maintainVisibleContentPosition?: {
|
|
54
|
+
minIndexForVisible: number;
|
|
55
|
+
autoscrollToTopThreshold?: number;
|
|
56
|
+
};
|
|
57
|
+
onScroll?: (event: ISymbioteEvent) => void;
|
|
58
|
+
onScrollBeginDrag?: (event: ISymbioteEvent) => void;
|
|
59
|
+
onScrollEndDrag?: (event: ISymbioteEvent) => void;
|
|
60
|
+
onMomentumScrollBegin?: (event: ISymbioteEvent) => void;
|
|
61
|
+
onMomentumScrollEnd?: (event: ISymbioteEvent) => void;
|
|
62
|
+
scrollEventThrottle?: number;
|
|
63
|
+
keyboardShouldPersistTaps?: boolean | 'always' | 'never' | 'handled';
|
|
64
|
+
keyboardDismissMode?: 'none' | 'on-drag' | 'interactive';
|
|
65
|
+
style?: IStyleProp<IViewStyle>;
|
|
66
|
+
contentContainerStyle?: IStyleProp<IViewStyle>;
|
|
67
|
+
class?: ISvelteClassValue;
|
|
68
|
+
}
|
|
69
|
+
export type { ISeparators, ISeparatorProps, ISymbioteEvent, ISymbioteNode };
|
|
70
|
+
export declare function pickAccessibilityProps<T extends IAccessibilityProps & IAriaProps>(props: T): IAccessibilityProps;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { resolveAccessibilityProps, } from '@symbiote-native/components';
|
|
2
|
+
// Every IAccessibilityProps field, named explicitly (the object-bag convention this adapter's
|
|
3
|
+
// custom-element host tags require — svelte-adapter-dom-shim skill §3g(c) — forbids a raw
|
|
4
|
+
// `...rest` spread landing on a symbiote-* tag, so this mirrors React's `...accessibilityRest`
|
|
5
|
+
// field-by-field instead of reusing its spread). Shared by every list component (VirtualizedList's
|
|
6
|
+
// own host-bag construction AND FlatList's/VirtualizedSectionList's/SectionList's component-to-
|
|
7
|
+
// component forwarding down to VirtualizedList) so the field list lives in exactly one place.
|
|
8
|
+
// resolveAccessibilityProps folds aria-*/role into their accessibility* twins first (idempotent —
|
|
9
|
+
// calling it twice, once per forwarding hop, is a documented no-op once the aria keys are gone).
|
|
10
|
+
export function pickAccessibilityProps(props) {
|
|
11
|
+
const resolved = resolveAccessibilityProps(props);
|
|
12
|
+
const picked = {};
|
|
13
|
+
if (resolved.testID !== undefined)
|
|
14
|
+
picked.testID = resolved.testID;
|
|
15
|
+
if (resolved.nativeID !== undefined)
|
|
16
|
+
picked.nativeID = resolved.nativeID;
|
|
17
|
+
if (resolved.accessible !== undefined)
|
|
18
|
+
picked.accessible = resolved.accessible;
|
|
19
|
+
if (resolved.accessibilityLabel !== undefined)
|
|
20
|
+
picked.accessibilityLabel = resolved.accessibilityLabel;
|
|
21
|
+
if (resolved.accessibilityHint !== undefined)
|
|
22
|
+
picked.accessibilityHint = resolved.accessibilityHint;
|
|
23
|
+
if (resolved.accessibilityRole !== undefined)
|
|
24
|
+
picked.accessibilityRole = resolved.accessibilityRole;
|
|
25
|
+
if (resolved.accessibilityState !== undefined)
|
|
26
|
+
picked.accessibilityState = resolved.accessibilityState;
|
|
27
|
+
if (resolved.accessibilityValue !== undefined)
|
|
28
|
+
picked.accessibilityValue = resolved.accessibilityValue;
|
|
29
|
+
if (resolved.accessibilityActions !== undefined)
|
|
30
|
+
picked.accessibilityActions = resolved.accessibilityActions;
|
|
31
|
+
if (resolved.accessibilityLabelledBy !== undefined) {
|
|
32
|
+
picked.accessibilityLabelledBy = resolved.accessibilityLabelledBy;
|
|
33
|
+
}
|
|
34
|
+
if (resolved.importantForAccessibility !== undefined) {
|
|
35
|
+
picked.importantForAccessibility = resolved.importantForAccessibility;
|
|
36
|
+
}
|
|
37
|
+
if (resolved.accessibilityLiveRegion !== undefined) {
|
|
38
|
+
picked.accessibilityLiveRegion = resolved.accessibilityLiveRegion;
|
|
39
|
+
}
|
|
40
|
+
if (resolved.screenReaderFocusable !== undefined) {
|
|
41
|
+
picked.screenReaderFocusable = resolved.screenReaderFocusable;
|
|
42
|
+
}
|
|
43
|
+
if (resolved.accessibilityViewIsModal !== undefined) {
|
|
44
|
+
picked.accessibilityViewIsModal = resolved.accessibilityViewIsModal;
|
|
45
|
+
}
|
|
46
|
+
if (resolved.accessibilityElementsHidden !== undefined) {
|
|
47
|
+
picked.accessibilityElementsHidden = resolved.accessibilityElementsHidden;
|
|
48
|
+
}
|
|
49
|
+
if (resolved.accessibilityIgnoresInvertColors !== undefined) {
|
|
50
|
+
picked.accessibilityIgnoresInvertColors = resolved.accessibilityIgnoresInvertColors;
|
|
51
|
+
}
|
|
52
|
+
if (resolved.accessibilityLanguage !== undefined) {
|
|
53
|
+
picked.accessibilityLanguage = resolved.accessibilityLanguage;
|
|
54
|
+
}
|
|
55
|
+
if (resolved.accessibilityRespondsToUserInteraction !== undefined) {
|
|
56
|
+
picked.accessibilityRespondsToUserInteraction = resolved.accessibilityRespondsToUserInteraction;
|
|
57
|
+
}
|
|
58
|
+
if (resolved.accessibilityShowsLargeContentViewer !== undefined) {
|
|
59
|
+
picked.accessibilityShowsLargeContentViewer = resolved.accessibilityShowsLargeContentViewer;
|
|
60
|
+
}
|
|
61
|
+
if (resolved.accessibilityLargeContentTitle !== undefined) {
|
|
62
|
+
picked.accessibilityLargeContentTitle = resolved.accessibilityLargeContentTitle;
|
|
63
|
+
}
|
|
64
|
+
if (resolved.onAccessibilityAction !== undefined)
|
|
65
|
+
picked.onAccessibilityAction = resolved.onAccessibilityAction;
|
|
66
|
+
if (resolved.onAccessibilityTap !== undefined)
|
|
67
|
+
picked.onAccessibilityTap = resolved.onAccessibilityTap;
|
|
68
|
+
if (resolved.onMagicTap !== undefined)
|
|
69
|
+
picked.onMagicTap = resolved.onMagicTap;
|
|
70
|
+
if (resolved.onAccessibilityEscape !== undefined)
|
|
71
|
+
picked.onAccessibilityEscape = resolved.onAccessibilityEscape;
|
|
72
|
+
return picked;
|
|
73
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
// VirtualizedSectionList: sections flattened into one virtualized stream over VirtualizedList.
|
|
3
|
+
// Each section contributes a header row, its item rows, then a footer row (RN counts 2 per
|
|
4
|
+
// section); the flattened tagged sequence feeds VirtualizedList as one list, so headers, items,
|
|
5
|
+
// and footers are all windowed by the same machinery. The flattening, entry keying,
|
|
6
|
+
// separator-item unwrap, and scrollToLocation mapping are shared verbatim from
|
|
7
|
+
// @symbiote-native/components; this file wires only Svelte's lifecycle (typed prop inputs +
|
|
8
|
+
// handle delegation + the per-entry render dispatch) — the Svelte twin of the React/Vue
|
|
9
|
+
// VirtualizedSectionList.
|
|
10
|
+
import type {
|
|
11
|
+
IVirtualizedSectionListProps,
|
|
12
|
+
IVirtualizedSectionListHandle,
|
|
13
|
+
ISection,
|
|
14
|
+
} from './virtualized-section-list-props';
|
|
15
|
+
|
|
16
|
+
export type { IVirtualizedSectionListProps, IVirtualizedSectionListHandle, ISection };
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script lang="ts" generics="ItemT">
|
|
20
|
+
import {
|
|
21
|
+
flattenSections,
|
|
22
|
+
resolveStickySectionHeaders,
|
|
23
|
+
scrollLocationToFlatIndex,
|
|
24
|
+
sectionEntryKey,
|
|
25
|
+
unwrapEntryItem,
|
|
26
|
+
type ISectionEntry,
|
|
27
|
+
type ISeparatorProps,
|
|
28
|
+
type ISeparators,
|
|
29
|
+
} from '@symbiote-native/components';
|
|
30
|
+
import { Platform, dlog, type ISymbioteNode } from '@symbiote-native/engine';
|
|
31
|
+
import VirtualizedList from '../virtualized-list/index.svelte';
|
|
32
|
+
import { pickAccessibilityProps } from '../virtualized-list/virtualized-list-props';
|
|
33
|
+
import type { IVirtualizedListHandle, IScrollViewHandle } from '../virtualized-list/virtualized-list-props';
|
|
34
|
+
import type { IVirtualizedSectionListProps as IProps } from './virtualized-section-list-props';
|
|
35
|
+
import { pickAttachmentProps } from '../../runes/attachments';
|
|
36
|
+
|
|
37
|
+
let props: IProps<ItemT> = $props();
|
|
38
|
+
|
|
39
|
+
let inner = $state.raw<IVirtualizedListHandle | null>(null);
|
|
40
|
+
|
|
41
|
+
// Forwarded as a component-prop spread onto the inner VirtualizedList (a compiled Svelte
|
|
42
|
+
// component, not a symbiote-* host tag — see flat-list/index.svelte's identical comment).
|
|
43
|
+
const accessibilityProps = $derived(pickAccessibilityProps(props));
|
|
44
|
+
|
|
45
|
+
const flattened = $derived.by(() =>
|
|
46
|
+
flattenSections(props.sections, props.sectionSeparator !== undefined),
|
|
47
|
+
);
|
|
48
|
+
const entries = $derived(flattened.entries);
|
|
49
|
+
const headerIndices = $derived(flattened.headerIndices);
|
|
50
|
+
|
|
51
|
+
// RN sticks section headers by default only on iOS; Android does not unless asked.
|
|
52
|
+
const stickyHeaderIndices = $derived(
|
|
53
|
+
resolveStickySectionHeaders(props.stickySectionHeadersEnabled, headerIndices, Platform.OS),
|
|
54
|
+
);
|
|
55
|
+
// DIAGNOSTIC (2026-08-13, tracking why stickyHeaderIndices comes back undefined on Android
|
|
56
|
+
// despite the demo passing the bare `stickySectionHeadersEnabled` shorthand): the previous
|
|
57
|
+
// logging only showed the RESULT (VirtualizedList's own dlog), never the INPUTS this $derived
|
|
58
|
+
// actually read — isolated verification proved bare-shorthand forwarding through this exact
|
|
59
|
+
// two-hop generic-component chain works correctly in a standalone repro, so this must show
|
|
60
|
+
// what differs in the real component tree.
|
|
61
|
+
$effect(() => {
|
|
62
|
+
dlog(
|
|
63
|
+
`VirtualizedSectionList sticky-inputs enabled=${String(props.stickySectionHeadersEnabled)} ` +
|
|
64
|
+
`platformOS=${Platform.OS} headerIndices=${JSON.stringify(headerIndices)} ` +
|
|
65
|
+
`resolved=${JSON.stringify(stickyHeaderIndices)}`,
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
$effect(() => {
|
|
70
|
+
dlog(
|
|
71
|
+
`VirtualizedSectionList: ${props.sections.length} sections flattened to ${entries.length} entries`,
|
|
72
|
+
);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
function getEntry(_source: unknown, index: number): ISectionEntry<ItemT> {
|
|
76
|
+
return entries[index];
|
|
77
|
+
}
|
|
78
|
+
function getEntryCount(): number {
|
|
79
|
+
return entries.length;
|
|
80
|
+
}
|
|
81
|
+
function entryKeyExtractor(entry: ISectionEntry<ItemT>, index: number): string {
|
|
82
|
+
return sectionEntryKey(entry, index, props.keyExtractor);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function entrySeparatorProps(entryProps: ISeparatorProps<ISectionEntry<ItemT>>): ISeparatorProps<ItemT> {
|
|
86
|
+
return {
|
|
87
|
+
...entryProps,
|
|
88
|
+
leadingItem: unwrapEntryItem(entryProps.leadingItem),
|
|
89
|
+
trailingItem: unwrapEntryItem(entryProps.trailingItem),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// ---- imperative handle: scrollToLocation resolves (sectionIndex, itemIndex) to the flattened
|
|
94
|
+
// entry index and forwards to the inner VirtualizedList; everything else routes straight
|
|
95
|
+
// through, the Svelte twin of the shared IScrollRoutingHandle tail. ----
|
|
96
|
+
export function scrollToLocation(params: {
|
|
97
|
+
sectionIndex: number;
|
|
98
|
+
itemIndex: number;
|
|
99
|
+
viewOffset?: number;
|
|
100
|
+
viewPosition?: number;
|
|
101
|
+
animated?: boolean;
|
|
102
|
+
}): void {
|
|
103
|
+
const flatIndex = scrollLocationToFlatIndex(headerIndices, params.sectionIndex, params.itemIndex);
|
|
104
|
+
if (flatIndex === undefined) {
|
|
105
|
+
dlog(`VirtualizedSectionList scrollToLocation: section ${params.sectionIndex} out of range`);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
dlog(
|
|
109
|
+
`VirtualizedSectionList scrollToLocation section=${params.sectionIndex} item=${params.itemIndex} -> flat ${flatIndex}`,
|
|
110
|
+
);
|
|
111
|
+
inner?.scrollToIndex({
|
|
112
|
+
index: flatIndex,
|
|
113
|
+
viewOffset: params.viewOffset,
|
|
114
|
+
viewPosition: params.viewPosition,
|
|
115
|
+
animated: params.animated,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
export function flashScrollIndicators(): void {
|
|
119
|
+
inner?.flashScrollIndicators();
|
|
120
|
+
}
|
|
121
|
+
export function getNativeScrollRef(): IScrollViewHandle | null {
|
|
122
|
+
return inner?.getNativeScrollRef() ?? null;
|
|
123
|
+
}
|
|
124
|
+
export function getScrollableNode(): IScrollViewHandle | null {
|
|
125
|
+
return inner?.getScrollableNode() ?? null;
|
|
126
|
+
}
|
|
127
|
+
export function getScrollResponder(): IScrollViewHandle | null {
|
|
128
|
+
return inner?.getScrollResponder() ?? null;
|
|
129
|
+
}
|
|
130
|
+
export function getScrollNode(): ISymbioteNode | null {
|
|
131
|
+
return inner?.getScrollNode() ?? null;
|
|
132
|
+
}
|
|
133
|
+
export function recordInteraction(): void {
|
|
134
|
+
inner?.recordInteraction();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// `{@attach}` arrives as a symbol-keyed prop, which naming individual props below drops.
|
|
138
|
+
// Re-spread just those onto the inner list, which owns the real host node.
|
|
139
|
+
const attachments = $derived(pickAttachmentProps(props));
|
|
140
|
+
</script>
|
|
141
|
+
|
|
142
|
+
{#snippet entryItem({
|
|
143
|
+
item: entry,
|
|
144
|
+
index,
|
|
145
|
+
separators,
|
|
146
|
+
}: {
|
|
147
|
+
item: ISectionEntry<ItemT>;
|
|
148
|
+
index: number;
|
|
149
|
+
separators: ISeparators;
|
|
150
|
+
})}
|
|
151
|
+
{#if entry.kind === 'header'}
|
|
152
|
+
{@render props.sectionHeader?.({ section: entry.section })}
|
|
153
|
+
{:else if entry.kind === 'footer'}
|
|
154
|
+
{@render props.sectionFooter?.({ section: entry.section })}
|
|
155
|
+
{:else if entry.kind === 'section-separator'}
|
|
156
|
+
{@render props.sectionSeparator?.()}
|
|
157
|
+
{:else}
|
|
158
|
+
{@render props.item({ item: entry.item, index: entry.itemIndex, section: entry.section, separators })}
|
|
159
|
+
{/if}
|
|
160
|
+
{/snippet}
|
|
161
|
+
|
|
162
|
+
{#snippet entrySeparator(entryProps: ISeparatorProps<ISectionEntry<ItemT>>)}
|
|
163
|
+
{@render props.separator?.(entrySeparatorProps(entryProps))}
|
|
164
|
+
{/snippet}
|
|
165
|
+
|
|
166
|
+
<VirtualizedList
|
|
167
|
+
bind:this={inner}
|
|
168
|
+
{...accessibilityProps}
|
|
169
|
+
{...attachments}
|
|
170
|
+
data={entries}
|
|
171
|
+
getItem={getEntry}
|
|
172
|
+
getItemCount={getEntryCount}
|
|
173
|
+
item={entryItem}
|
|
174
|
+
separator={props.separator ? entrySeparator : undefined}
|
|
175
|
+
header={props.header}
|
|
176
|
+
footer={props.footer}
|
|
177
|
+
empty={props.empty}
|
|
178
|
+
keyExtractor={entryKeyExtractor}
|
|
179
|
+
stickyHeaderIndices={stickyHeaderIndices}
|
|
180
|
+
inverted={props.inverted}
|
|
181
|
+
extraData={props.extraData}
|
|
182
|
+
onEndReached={props.onEndReached}
|
|
183
|
+
onEndReachedThreshold={props.onEndReachedThreshold}
|
|
184
|
+
onStartReached={props.onStartReached}
|
|
185
|
+
onStartReachedThreshold={props.onStartReachedThreshold}
|
|
186
|
+
onRefresh={props.onRefresh}
|
|
187
|
+
refreshing={props.refreshing}
|
|
188
|
+
progressViewOffset={props.progressViewOffset}
|
|
189
|
+
initialNumToRender={props.initialNumToRender}
|
|
190
|
+
initialScrollIndex={props.initialScrollIndex}
|
|
191
|
+
maxToRenderPerBatch={props.maxToRenderPerBatch}
|
|
192
|
+
updateCellsBatchingPeriod={props.updateCellsBatchingPeriod}
|
|
193
|
+
windowSize={props.windowSize}
|
|
194
|
+
maintainVisibleContentPosition={props.maintainVisibleContentPosition}
|
|
195
|
+
onScroll={props.onScroll}
|
|
196
|
+
onScrollBeginDrag={props.onScrollBeginDrag}
|
|
197
|
+
onScrollEndDrag={props.onScrollEndDrag}
|
|
198
|
+
onMomentumScrollBegin={props.onMomentumScrollBegin}
|
|
199
|
+
onMomentumScrollEnd={props.onMomentumScrollEnd}
|
|
200
|
+
scrollEventThrottle={props.scrollEventThrottle}
|
|
201
|
+
keyboardShouldPersistTaps={props.keyboardShouldPersistTaps}
|
|
202
|
+
keyboardDismissMode={props.keyboardDismissMode}
|
|
203
|
+
style={props.style}
|
|
204
|
+
contentContainerStyle={props.contentContainerStyle}
|
|
205
|
+
class={props.class}
|
|
206
|
+
/>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { IVirtualizedSectionListProps, IVirtualizedSectionListHandle, ISection } from './virtualized-section-list-props';
|
|
2
|
+
export type { IVirtualizedSectionListProps, IVirtualizedSectionListHandle, ISection };
|
|
3
|
+
import { type ISymbioteNode } from '@symbiote-native/engine';
|
|
4
|
+
import type { IScrollViewHandle } from '../virtualized-list/virtualized-list-props';
|
|
5
|
+
import type { IVirtualizedSectionListProps as IProps } from './virtualized-section-list-props';
|
|
6
|
+
declare function $$render<ItemT>(): {
|
|
7
|
+
props: IProps<ItemT>;
|
|
8
|
+
exports: {
|
|
9
|
+
scrollToLocation: (params: {
|
|
10
|
+
sectionIndex: number;
|
|
11
|
+
itemIndex: number;
|
|
12
|
+
viewOffset?: number;
|
|
13
|
+
viewPosition?: number;
|
|
14
|
+
animated?: boolean;
|
|
15
|
+
}) => void;
|
|
16
|
+
flashScrollIndicators: () => void;
|
|
17
|
+
getNativeScrollRef: () => IScrollViewHandle | null;
|
|
18
|
+
getScrollableNode: () => IScrollViewHandle | null;
|
|
19
|
+
getScrollResponder: () => IScrollViewHandle | null;
|
|
20
|
+
getScrollNode: () => ISymbioteNode | null;
|
|
21
|
+
recordInteraction: () => void;
|
|
22
|
+
};
|
|
23
|
+
bindings: "";
|
|
24
|
+
slots: {};
|
|
25
|
+
events: {};
|
|
26
|
+
};
|
|
27
|
+
declare class __sveltets_Render<ItemT> {
|
|
28
|
+
props(): ReturnType<typeof $$render<ItemT>>['props'];
|
|
29
|
+
events(): ReturnType<typeof $$render<ItemT>>['events'];
|
|
30
|
+
slots(): ReturnType<typeof $$render<ItemT>>['slots'];
|
|
31
|
+
bindings(): "";
|
|
32
|
+
exports(): {
|
|
33
|
+
scrollToLocation: (params: {
|
|
34
|
+
sectionIndex: number;
|
|
35
|
+
itemIndex: number;
|
|
36
|
+
viewOffset?: number;
|
|
37
|
+
viewPosition?: number;
|
|
38
|
+
animated?: boolean;
|
|
39
|
+
}) => void;
|
|
40
|
+
flashScrollIndicators: () => void;
|
|
41
|
+
getNativeScrollRef: () => IScrollViewHandle | null;
|
|
42
|
+
getScrollableNode: () => IScrollViewHandle | null;
|
|
43
|
+
getScrollResponder: () => IScrollViewHandle | null;
|
|
44
|
+
getScrollNode: () => ISymbioteNode | null;
|
|
45
|
+
recordInteraction: () => void;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
interface $$IsomorphicComponent {
|
|
49
|
+
new <ItemT>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<ItemT>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<ItemT>['props']>, ReturnType<__sveltets_Render<ItemT>['events']>, ReturnType<__sveltets_Render<ItemT>['slots']>> & {
|
|
50
|
+
$$bindings?: ReturnType<__sveltets_Render<ItemT>['bindings']>;
|
|
51
|
+
} & ReturnType<__sveltets_Render<ItemT>['exports']>;
|
|
52
|
+
<ItemT>(internal: unknown, props: ReturnType<__sveltets_Render<ItemT>['props']> & {}): ReturnType<__sveltets_Render<ItemT>['exports']>;
|
|
53
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
54
|
+
}
|
|
55
|
+
declare const Index: $$IsomorphicComponent;
|
|
56
|
+
type Index<ItemT> = InstanceType<typeof Index<ItemT>>;
|
|
57
|
+
export default Index;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { IStyleProp, ISymbioteEvent, IViewStyle } from '@symbiote-native/engine';
|
|
3
|
+
import type { IAccessibilityProps, IAriaProps, ISection, ISeparatorProps, ISeparators, IVirtualizedSectionListHandle } from '@symbiote-native/components';
|
|
4
|
+
import type { ISvelteClassValue } from '../../class-value';
|
|
5
|
+
export type { ISection, IVirtualizedSectionListHandle };
|
|
6
|
+
export interface IVirtualizedSectionListProps<ItemT> extends IAccessibilityProps, IAriaProps {
|
|
7
|
+
sections: ReadonlyArray<ISection<ItemT>>;
|
|
8
|
+
item: Snippet<[
|
|
9
|
+
{
|
|
10
|
+
item: ItemT;
|
|
11
|
+
index: number;
|
|
12
|
+
section: ISection<ItemT>;
|
|
13
|
+
separators: ISeparators;
|
|
14
|
+
}
|
|
15
|
+
]>;
|
|
16
|
+
sectionHeader?: Snippet<[{
|
|
17
|
+
section: ISection<ItemT>;
|
|
18
|
+
}]>;
|
|
19
|
+
sectionFooter?: Snippet<[{
|
|
20
|
+
section: ISection<ItemT>;
|
|
21
|
+
}]>;
|
|
22
|
+
sectionSeparator?: Snippet;
|
|
23
|
+
separator?: Snippet<[ISeparatorProps<ItemT>]>;
|
|
24
|
+
header?: Snippet;
|
|
25
|
+
footer?: Snippet;
|
|
26
|
+
empty?: Snippet;
|
|
27
|
+
keyExtractor?: (item: ItemT, index: number) => string;
|
|
28
|
+
stickySectionHeadersEnabled?: boolean;
|
|
29
|
+
extraData?: unknown;
|
|
30
|
+
onEndReached?: (info: {
|
|
31
|
+
distanceFromEnd: number;
|
|
32
|
+
}) => void;
|
|
33
|
+
onEndReachedThreshold?: number;
|
|
34
|
+
onStartReached?: (info: {
|
|
35
|
+
distanceFromStart: number;
|
|
36
|
+
}) => void;
|
|
37
|
+
onStartReachedThreshold?: number;
|
|
38
|
+
onRefresh?: () => void;
|
|
39
|
+
refreshing?: boolean | null;
|
|
40
|
+
progressViewOffset?: number;
|
|
41
|
+
initialNumToRender?: number;
|
|
42
|
+
initialScrollIndex?: number;
|
|
43
|
+
maxToRenderPerBatch?: number;
|
|
44
|
+
updateCellsBatchingPeriod?: number;
|
|
45
|
+
windowSize?: number;
|
|
46
|
+
inverted?: boolean;
|
|
47
|
+
maintainVisibleContentPosition?: {
|
|
48
|
+
minIndexForVisible: number;
|
|
49
|
+
autoscrollToTopThreshold?: number;
|
|
50
|
+
};
|
|
51
|
+
onScroll?: (event: ISymbioteEvent) => void;
|
|
52
|
+
onScrollBeginDrag?: (event: ISymbioteEvent) => void;
|
|
53
|
+
onScrollEndDrag?: (event: ISymbioteEvent) => void;
|
|
54
|
+
onMomentumScrollBegin?: (event: ISymbioteEvent) => void;
|
|
55
|
+
onMomentumScrollEnd?: (event: ISymbioteEvent) => void;
|
|
56
|
+
scrollEventThrottle?: number;
|
|
57
|
+
keyboardShouldPersistTaps?: boolean | 'always' | 'never' | 'handled';
|
|
58
|
+
keyboardDismissMode?: 'none' | 'on-drag' | 'interactive';
|
|
59
|
+
style?: IStyleProp<IViewStyle>;
|
|
60
|
+
contentContainerStyle?: IStyleProp<IViewStyle>;
|
|
61
|
+
class?: ISvelteClassValue;
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// Registers the default `children` snippet under `tunnel` — mount this anywhere, any surface.
|
|
3
|
+
// See tunnel.ts's header for why `tunnel` is an explicit prop rather than an `<In>` closured
|
|
4
|
+
// per createTunnel() call the way React/Vue's is.
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
|
+
import type { ITunnel } from './tunnel';
|
|
7
|
+
|
|
8
|
+
let { tunnel, children }: { tunnel: ITunnel; children: Snippet } = $props();
|
|
9
|
+
|
|
10
|
+
// Reserved once at component init (stable for this instance's whole lifetime), not inside the
|
|
11
|
+
// effect — an effect re-running (e.g. because `children` changed) must update the SAME
|
|
12
|
+
// registry slot, never mint a new id and leave the old one orphaned.
|
|
13
|
+
const id = tunnel.reserveId();
|
|
14
|
+
|
|
15
|
+
$effect(() => {
|
|
16
|
+
// Reads `children` — re-runs (updating the same slot) if the caller passes a new snippet
|
|
17
|
+
// reference; the common case (a stable inline snippet whose CLOSED-OVER values change) needs
|
|
18
|
+
// no re-run at all, since re-rendering happens naturally where TunnelOut renders it.
|
|
19
|
+
tunnel.items.set(id, children);
|
|
20
|
+
return () => {
|
|
21
|
+
tunnel.items.delete(id);
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { ITunnel } from './tunnel';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
tunnel: ITunnel;
|
|
5
|
+
children: Snippet;
|
|
6
|
+
};
|
|
7
|
+
declare const TunnelIn: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
|
+
type TunnelIn = ReturnType<typeof TunnelIn>;
|
|
9
|
+
export default TunnelIn;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// Renders everything currently tunneled in, in registration order. Mount this in the
|
|
3
|
+
// component that should actually paint the content. `tunnel.items` is a SvelteMap
|
|
4
|
+
// (svelte/reactivity) — iterating it here inside the template is a tracked read, so this
|
|
5
|
+
// re-renders whenever TunnelIn adds/updates/removes an entry, on whichever surface THIS
|
|
6
|
+
// component happens to be mounted on.
|
|
7
|
+
import type { ITunnel } from './tunnel';
|
|
8
|
+
|
|
9
|
+
let { tunnel }: { tunnel: ITunnel } = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
{#each tunnel.items as [id, snippet] (id)}
|
|
13
|
+
{@render snippet()}
|
|
14
|
+
{/each}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import { SvelteMap } from 'svelte/reactivity';
|
|
3
|
+
export interface ITunnel {
|
|
4
|
+
/** The shared registry TunnelIn writes into and TunnelOut reads from. */
|
|
5
|
+
readonly items: SvelteMap<number, Snippet>;
|
|
6
|
+
/** A fresh, stable id for one TunnelIn instance to key its registry entry by. */
|
|
7
|
+
reserveId(): number;
|
|
8
|
+
}
|
|
9
|
+
export declare function createTunnel(): ITunnel;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IDescriptorChild } from '@symbiote-native/components';
|
|
2
|
+
import type { ShimElement } from './dom-shim';
|
|
3
|
+
export type IDescriptorChildrenMount = {
|
|
4
|
+
update(children: IDescriptorChild[]): void;
|
|
5
|
+
};
|
|
6
|
+
export declare function mountDescriptorChildren(parent: ShimElement, children: IDescriptorChild[]): IDescriptorChildrenMount;
|
|
7
|
+
export declare function createDescriptorChildrenSync(): (hostShim: ShimElement | null, children: IDescriptorChild[]) => void;
|