@symbiote-native/vue 3.3.0 → 3.5.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 (49) hide show
  1. package/build/components/flat-list/index.d.ts +4 -3
  2. package/build/components/flat-list/index.js +18 -21
  3. package/build/components/input-accessory-view-props.d.ts +4 -4
  4. package/build/components/keyboard-avoiding-view.d.ts +11 -3
  5. package/build/components/keyboard-avoiding-view.js +38 -69
  6. package/build/components/layout-conformance-props.d.ts +4 -0
  7. package/build/components/layout-conformance-props.js +1 -0
  8. package/build/components/modal/index.d.ts +18 -5
  9. package/build/components/modal/index.js +53 -24
  10. package/build/components/refresh-control-props.d.ts +7 -7
  11. package/build/components/scroll-view/scroll-view-props.d.ts +8 -5
  12. package/build/components/section-list/index.d.ts +1 -1
  13. package/build/components/section-list/index.js +2 -6
  14. package/build/components/text-props.d.ts +3 -3
  15. package/build/components/touchable-props.d.ts +6 -6
  16. package/build/components/virtualized-list/index.d.ts +5 -75
  17. package/build/components/virtualized-list/index.js +130 -558
  18. package/build/components/virtualized-list/list-children.d.ts +18 -0
  19. package/build/components/virtualized-list/list-children.js +81 -0
  20. package/build/components/virtualized-list/list-elements.d.ts +7 -0
  21. package/build/components/virtualized-list/list-elements.js +29 -0
  22. package/build/components/virtualized-list/list-scroll-props.d.ts +20 -0
  23. package/build/components/virtualized-list/list-scroll-props.js +9 -0
  24. package/build/components/virtualized-list/narrow-props.d.ts +79 -0
  25. package/build/components/virtualized-list/narrow-props.js +89 -0
  26. package/build/components/virtualized-list/nested-scope.d.ts +3 -0
  27. package/build/components/virtualized-list/nested-scope.js +12 -0
  28. package/build/components/virtualized-list/user-handlers.d.ts +3 -0
  29. package/build/components/virtualized-list/user-handlers.js +24 -0
  30. package/build/components/virtualized-list/virtualized-list-props.d.ts +82 -0
  31. package/build/components/virtualized-list/virtualized-list-props.js +41 -0
  32. package/build/components/virtualized-section-list/index.d.ts +20 -5
  33. package/build/components/virtualized-section-list/index.js +81 -95
  34. package/build/components/virtualized-section-list/section-item-cell.d.ts +18 -0
  35. package/build/components/virtualized-section-list/section-item-cell.js +52 -0
  36. package/build/composables/use-animated-value.d.ts +7 -0
  37. package/build/composables/use-animated-value.js +14 -0
  38. package/build/composables/use-color-scheme.d.ts +1 -1
  39. package/build/create-transition/index.d.ts +2 -2
  40. package/build/create-transition/index.js +1 -1
  41. package/build/index.d.ts +13 -4
  42. package/build/index.js +16 -31
  43. package/build/modules/animated/index.d.ts +54 -41
  44. package/build/modules/animated/index.js +2 -26
  45. package/build/modules/app-registry/index.d.ts +3 -3
  46. package/build/modules/app-registry/index.js +2 -2
  47. package/build/modules/status-bar.js +22 -24
  48. package/metro-vue-transformer.cjs +177 -229
  49. package/package.json +6 -6
@@ -12,10 +12,11 @@
12
12
  // refresh) stay GATED on listener presence so the inner VirtualizedList keeps building
13
13
  // RefreshControl / computing edge-reached strictly on demand.
14
14
  import { defineComponent, getCurrentInstance, h, shallowRef, } from '@vue/runtime-core';
15
- import { flattenSections, resolveStickySectionHeaders, scrollLocationToFlatIndex, sectionEntryKey, unwrapEntryItem, } from '@symbiote-native/components';
15
+ import { cellGapsFor, createSeparatorBoard, flattenSections, layoutOverSections, renderSectionEntry, resolveScrollLocation, resolveStickySectionHeaders, routeScrollHandle, sectionEntryKey, } from '@symbiote-native/components';
16
16
  import { Platform, dlog, } from '@symbiote-native/engine';
17
17
  import { VirtualizedList } from '../virtualized-list/index.js';
18
18
  import { normalizeVueAttrs } from '../../utils/normalize-attrs.js';
19
+ import { SectionItemCell } from './section-item-cell.js';
19
20
  // VirtualizedList's generic construct signature can't be resolved by h()'s overloads, so drive
20
21
  // it through a loose functional-component handle instead.
21
22
  const VirtualizedListHost = VirtualizedList;
@@ -36,39 +37,85 @@ function isRecord(value) {
36
37
  function isVirtualizedListHandle(value) {
37
38
  return isRecord(value) && typeof value.scrollToOffset === 'function';
38
39
  }
39
- function buildSectionDelegate(getInner, getHeaderIndices) {
40
+ function buildSectionDelegate(getInner, locate) {
40
41
  return {
41
42
  scrollToLocation: (params) => {
42
- const flatIndex = scrollLocationToFlatIndex(getHeaderIndices(), params.sectionIndex, params.itemIndex);
43
- if (flatIndex === undefined) {
43
+ const target = locate(params);
44
+ if (target === undefined) {
44
45
  dlog(`Vue VirtualizedSectionList scrollToLocation: section ${params.sectionIndex} out of range`);
45
46
  return;
46
47
  }
47
48
  dlog(`Vue VirtualizedSectionList scrollToLocation section=${params.sectionIndex} ` +
48
- `item=${params.itemIndex} -> flat ${flatIndex}`);
49
- getInner()?.scrollToIndex({
50
- index: flatIndex,
51
- viewOffset: params.viewOffset,
52
- viewPosition: params.viewPosition,
53
- animated: params.animated,
49
+ `item=${params.itemIndex} -> flat ${target.index}`);
50
+ getInner()?.scrollToIndex(target);
51
+ },
52
+ ...routeScrollHandle(getInner),
53
+ };
54
+ }
55
+ // The separator slot for a gap: the section one, or the item one where a section's own beats
56
+ // the list's
57
+ function separatorRenderFor(gap, slots) {
58
+ if (gap.props === undefined)
59
+ return undefined;
60
+ const { props } = gap;
61
+ const slot = gap.kind === 'section'
62
+ ? slots.sectionSeparator
63
+ : (props.section.ItemSeparatorComponent ?? slots.separator);
64
+ if (slot === undefined)
65
+ return undefined;
66
+ return ({ isHighlighted, override }) => slot({ highlighted: isHighlighted, ...props, ...override });
67
+ }
68
+ // The inner list's #item slot: each flattened entry goes to the matching consumer slot, an item
69
+ // to a cell that paints its own separators. A slot the consumer left off renders nothing
70
+ function entryRendererFor(rendering) {
71
+ const { slots, entries, board, keyOf } = rendering;
72
+ return info => renderSectionEntry({
73
+ header: ({ section }) => slots.sectionHeader?.({ section }) ?? [],
74
+ footer: ({ section }) => slots.sectionFooter?.({ section }) ?? [],
75
+ item: entry => {
76
+ const gaps = cellGapsFor(entries, info.index);
77
+ const previous = entries[info.index - 1];
78
+ const render = entry.section.renderItem ?? slots.item;
79
+ return h(SectionItemCell, {
80
+ board,
81
+ cellKey: keyOf(entry),
82
+ prevCellKey: previous === undefined ? undefined : keyOf(previous),
83
+ renderItem: separators => render?.({
84
+ item: entry.item,
85
+ index: entry.itemIndex,
86
+ section: entry.section,
87
+ separators,
88
+ }) ?? [],
89
+ leadingSeparator: separatorRenderFor(gaps.leading, slots),
90
+ trailingSeparator: separatorRenderFor(gaps.trailing, slots),
91
+ inverted: rendering.isInverted,
54
92
  });
55
93
  },
56
- flashScrollIndicators: () => getInner()?.flashScrollIndicators(),
57
- getNativeScrollRef: () => getInner()?.getNativeScrollRef() ?? null,
58
- getScrollableNode: () => getInner()?.getScrollableNode() ?? null,
59
- getScrollResponder: () => getInner()?.getScrollResponder() ?? null,
60
- getScrollNode: () => getInner()?.getScrollNode() ?? null,
61
- recordInteraction: () => getInner()?.recordInteraction(),
94
+ }, info.item);
95
+ }
96
+ // The three synthesized events become inner-list handlers ONLY when listened, so the inner list
97
+ // keeps gating (no parasitic RefreshControl / edge-reached work for an unlistened event)
98
+ function synthesizedEvents(listens, emit) {
99
+ return {
100
+ onEndReached: listens('onEndReached')
101
+ ? (eventInfo) => emit('endReached', eventInfo)
102
+ : undefined,
103
+ onStartReached: listens('onStartReached')
104
+ ? (eventInfo) => emit('startReached', eventInfo)
105
+ : undefined,
106
+ onRefresh: listens('onRefresh') ? () => emit('refresh') : undefined,
62
107
  };
63
108
  }
64
- export const VirtualizedSectionList = defineComponent((props, { attrs, expose, emit, slots, }) => {
109
+ export const VirtualizedSectionList = defineComponent((props, { attrs, expose, emit, slots }) => {
110
+ const board = createSeparatorBoard();
65
111
  const inner = shallowRef(null);
66
112
  const setInner = (instance) => {
67
113
  inner.value = isVirtualizedListHandle(instance) ? instance : null;
68
114
  };
69
- // headerIndices change each render (sections may change); the delegate reads them lazily.
115
+ // Both change every render (sections may change), the delegate reads them lazily
70
116
  let headerIndices = [];
71
- expose(buildSectionDelegate(() => inner.value, () => headerIndices));
117
+ let stickyHeaderIndices;
118
+ expose(buildSectionDelegate(() => inner.value, params => resolveScrollLocation(headerIndices, stickyHeaderIndices, params)));
72
119
  // Emits are stripped from $attrs by Vue; detect listener presence off the instance's own
73
120
  // vnode props instead, so an emit bridge is wired ONLY when the consumer actually listens.
74
121
  const instance = getCurrentInstance();
@@ -80,92 +127,31 @@ export const VirtualizedSectionList = defineComponent((props, { attrs, expose, e
80
127
  const sections = Array.isArray(props.sections)
81
128
  ? props.sections
82
129
  : [];
83
- const keyExtractor = props.keyExtractor;
84
- // The passthrough tail: declared props + declared emits' onX are already removed from $attrs,
85
- // so what's left is the VirtualizedList passthrough (kebab-folded for the inner list).
86
- const forwarded = normalizeVueAttrs(attrs);
87
- const { entries, headerIndices: indices } = flattenSections(sections, slots.sectionSeparator !== undefined);
130
+ const { entries, headerIndices: indices } = flattenSections(sections);
88
131
  headerIndices = indices;
132
+ const keyOf = (entry) => sectionEntryKey(entry, props.keyExtractor);
89
133
  // RN sticks section headers by default only on iOS; Android does not unless asked.
90
- const stickyHeaderIndices = resolveStickySectionHeaders(props.stickySectionHeadersEnabled, indices, Platform.OS);
134
+ stickyHeaderIndices = resolveStickySectionHeaders(props.stickySectionHeadersEnabled, indices, Platform.OS);
91
135
  dlog(`Vue VirtualizedSectionList: ${sections.length} sections flattened to ${entries.length} entries`);
92
- // The inner list's #item slot: dispatch each flattened entry to the matching consumer slot,
93
- // returning its VNode[] (empty when the consumer left that slot off).
94
- const renderEntry = (info) => {
95
- const entry = info.item;
96
- if (entry.kind === 'header') {
97
- return slots.sectionHeader
98
- ? slots.sectionHeader({ section: entry.section })
99
- : [];
100
- }
101
- if (entry.kind === 'footer') {
102
- return slots.sectionFooter
103
- ? slots.sectionFooter({ section: entry.section })
104
- : [];
105
- }
106
- if (entry.kind === 'section-separator') {
107
- return slots.sectionSeparator ? slots.sectionSeparator() : [];
108
- }
109
- return slots.item
110
- ? slots.item({
111
- item: entry.item,
112
- index: entry.itemIndex,
113
- section: entry.section,
114
- separators: info.separators,
115
- })
116
- : [];
117
- };
118
- // The user's #separator is typed on ItemT, but the inner stream is the entry wrapper; unwrap
119
- // each entry back to its ItemT (shared unwrapEntryItem) before the inner list invokes it.
120
- const entrySeparatorSlot = slots.separator === undefined
121
- ? undefined
122
- : (entryProps) => slots.separator({
123
- ...entryProps,
124
- leadingItem: unwrapEntryItem(entryProps.leadingItem),
125
- trailingItem: unwrapEntryItem(entryProps.trailingItem),
126
- });
127
- const entryKeyExtractor = (entry, index) => sectionEntryKey(entry, index, keyExtractor);
128
- // Hand the callback `sections`, not the entries: RN's inner VirtualizedList gets
129
- // `data={this.props.sections}` (VirtualizedSectionList.js:216) while ours streams the
130
- // FLATTENED entries, so the same user code would otherwise see a different argument here
131
- // than on RN.
132
- //
133
- // UPSTREAM-DIVERGENCE(react-native): the flat INDEX matches RN's (two rows per section,
134
- // header and footer) only while the #sectionSeparator slot is unset. With it,
135
- // flattenSections emits an extra 'section-separator' row per boundary that RN renders inside
136
- // the neighbouring cell, so indices shift by one per boundary from the second section on.
137
- // Deliberate - that row is how this adapter paints the separator; a caller combining the two
138
- // must account for it.
139
- const getItemLayout = props.getItemLayout;
140
- const entryItemLayout = getItemLayout === undefined
141
- ? undefined
142
- : (_entries, index) => getItemLayout(sections, index);
143
- // The three synthesized events become inner-VL handlers ONLY when listened, so the inner list
144
- // keeps gating (no parasitic RefreshControl / edge-reached work for an unlistened event).
145
- const endReached = listens('onEndReached')
146
- ? (eventInfo) => emit('endReached', eventInfo)
147
- : undefined;
148
- const startReached = listens('onStartReached')
149
- ? (eventInfo) => emit('startReached', eventInfo)
150
- : undefined;
151
- const refresh = listens('onRefresh')
152
- ? () => emit('refresh')
153
- : undefined;
154
136
  return h(VirtualizedListHost, {
155
- ...forwarded,
137
+ // The passthrough tail: declared props and emits are already out of $attrs
138
+ ...normalizeVueAttrs(attrs),
156
139
  ref: setInner,
157
140
  data: entries,
158
141
  getItem: (_source, index) => entries[index],
159
142
  getItemCount: () => entries.length,
160
- keyExtractor: entryKeyExtractor,
161
- getItemLayout: entryItemLayout,
143
+ keyExtractor: keyOf,
144
+ getItemLayout: layoutOverSections(props.getItemLayout, sections),
162
145
  stickyHeaderIndices,
163
- onEndReached: endReached,
164
- onStartReached: startReached,
165
- onRefresh: refresh,
146
+ ...synthesizedEvents(listens, emit),
166
147
  }, {
167
- item: renderEntry,
168
- separator: entrySeparatorSlot,
148
+ item: entryRendererFor({
149
+ slots,
150
+ entries,
151
+ board,
152
+ keyOf,
153
+ isInverted: attrs.inverted === true,
154
+ }),
169
155
  header: slots.header,
170
156
  footer: slots.footer,
171
157
  empty: slots.empty,
@@ -0,0 +1,18 @@
1
+ import { type VNode } from '@vue/runtime-core';
2
+ import { type ISeparatorBoard, type ISeparators } from '@symbiote-native/components';
3
+ type IRendered = VNode[] | VNode;
4
+ export type ISeparatorState = {
5
+ isHighlighted: boolean;
6
+ override: Record<string, unknown> | undefined;
7
+ };
8
+ export type ISectionItemCellProps = {
9
+ board: ISeparatorBoard<Record<string, unknown>>;
10
+ cellKey: string;
11
+ prevCellKey: string | undefined;
12
+ renderItem: (separators: ISeparators) => IRendered;
13
+ leadingSeparator: ((state: ISeparatorState) => IRendered) | undefined;
14
+ trailingSeparator: ((state: ISeparatorState) => IRendered) | undefined;
15
+ inverted: boolean;
16
+ };
17
+ export declare const SectionItemCell: import("vue").DefineSetupFnComponent<ISectionItemCellProps, {}, {}, ISectionItemCellProps & {}, import("vue").PublicProps>;
18
+ export {};
@@ -0,0 +1,52 @@
1
+ // Item cell with its separators around it, as in RN's `ItemWithSeparator`
2
+ // Their state sits in a shared board, т.к. `highlight()` also lights the previous cell's one
3
+ import { defineComponent, Fragment, h, shallowRef, watch, } from '@vue/runtime-core';
4
+ import { createCellSeparators, } from '@symbiote-native/components';
5
+ const CELL_PROPS = [
6
+ 'board',
7
+ 'cellKey',
8
+ 'prevCellKey',
9
+ 'renderItem',
10
+ 'leadingSeparator',
11
+ 'trailingSeparator',
12
+ 'inverted',
13
+ ];
14
+ export const SectionItemCell = defineComponent((props) => {
15
+ const state = shallowRef(props.board.read(props.cellKey));
16
+ watch(() => [props.board, props.cellKey], ([board, cellKey], _previous, onCleanup) => {
17
+ state.value = board.read(cellKey);
18
+ const unsubscribe = board.subscribe(cellKey, () => {
19
+ state.value = board.read(cellKey);
20
+ });
21
+ onCleanup(() => {
22
+ unsubscribe();
23
+ board.release(cellKey);
24
+ });
25
+ }, { immediate: true, flush: 'sync' });
26
+ const separators = createCellSeparators(props.board, () => ({
27
+ cellKey: props.cellKey,
28
+ prevCellKey: props.prevCellKey,
29
+ has: {
30
+ leading: props.leadingSeparator !== undefined,
31
+ trailing: props.trailingSeparator !== undefined,
32
+ },
33
+ }));
34
+ return () => {
35
+ const { leadingHighlighted, leadingOverride } = state.value;
36
+ const { trailingHighlighted, trailingOverride } = state.value;
37
+ const leading = props.leadingSeparator?.({
38
+ isHighlighted: leadingHighlighted,
39
+ override: leadingOverride,
40
+ }) ?? [];
41
+ const trailing = props.trailingSeparator?.({
42
+ isHighlighted: trailingHighlighted,
43
+ override: trailingOverride,
44
+ }) ?? [];
45
+ const element = props.renderItem(separators);
46
+ return h(Fragment, [
47
+ props.inverted ? trailing : leading,
48
+ element,
49
+ props.inverted ? leading : trailing,
50
+ ]);
51
+ };
52
+ }, { name: 'SectionItemCell', props: CELL_PROPS });
@@ -0,0 +1,7 @@
1
+ import { type AnimatedColor, type AnimatedValue, type AnimatedValueXY, type IAnimatedValueConfig, type IColorInput } from '@symbiote-native/engine';
2
+ export declare function useAnimatedValue(initialValue: number, config?: IAnimatedValueConfig): AnimatedValue;
3
+ export declare function useAnimatedValueXY(initialValue: {
4
+ x: number;
5
+ y: number;
6
+ }, config?: IAnimatedValueConfig): AnimatedValueXY;
7
+ export declare function useAnimatedColor(inputValue?: IColorInput, config?: IAnimatedValueConfig): AnimatedColor;
@@ -0,0 +1,14 @@
1
+ // RN's `useAnimatedValue`, `useAnimatedValueXY` and `useAnimatedColor` as composables: `setup()`
2
+ // runs once per component, so each call is the one instance. `markRaw` keeps `reactive()` from
3
+ // wrapping the node in a Proxy
4
+ import { markRaw } from '@vue/runtime-core';
5
+ import { createAnimatedColor, createAnimatedValue, createAnimatedValueXY, } from '@symbiote-native/engine';
6
+ export function useAnimatedValue(initialValue, config) {
7
+ return markRaw(createAnimatedValue(initialValue, config));
8
+ }
9
+ export function useAnimatedValueXY(initialValue, config) {
10
+ return markRaw(createAnimatedValueXY(initialValue, config));
11
+ }
12
+ export function useAnimatedColor(inputValue, config) {
13
+ return markRaw(createAnimatedColor(inputValue, config));
14
+ }
@@ -1,3 +1,3 @@
1
1
  import { type Ref } from '@vue/runtime-core';
2
2
  import { type IColorSchemeName } from '@symbiote-native/engine';
3
- export declare function useColorScheme(): Ref<IColorSchemeName | null>;
3
+ export declare function useColorScheme(): Ref<IColorSchemeName | null | undefined>;
@@ -1,8 +1,8 @@
1
1
  import { type VNode } from '@vue/runtime-core';
2
- export interface ITransitionProps {
2
+ export type ITransitionProps = {
3
3
  duration?: number;
4
4
  appear?: boolean;
5
- }
5
+ };
6
6
  export declare const Transition: import("vue").DefineComponent<{
7
7
  duration: number;
8
8
  appear: boolean;
@@ -21,7 +21,7 @@ function animatedOpacity(el, initial) {
21
21
  }
22
22
  function fadeTo(el, toValue, duration, done) {
23
23
  const value = opacityOf.get(el) ?? animatedOpacity(el, toValue === 1 ? 0 : 1);
24
- timing(value, { toValue, duration }).start(({ finished }) => {
24
+ timing(value, { toValue, duration, useNativeDriver: false }).start(({ finished }) => {
25
25
  if (finished)
26
26
  done();
27
27
  });
package/build/index.d.ts CHANGED
@@ -29,6 +29,8 @@ export type { ICheckboxProps } from './components/checkbox-props';
29
29
  export type { ITextInputProps } from './components/text-input/text-input-props';
30
30
  export type { ITextInputHandle, ITextInputChangeEvent, } from '@symbiote-native/components';
31
31
  export { VirtualizedList } from './components/virtualized-list';
32
+ export { useVirtualizedListScope } from './components/virtualized-list/nested-scope';
33
+ export type { IListScope } from '@symbiote-native/components';
32
34
  export type { IVirtualizedListProps, IVirtualizedListSlots, IVirtualizedListEmits, IVirtualizedListHandle, ISeparators, ISeparatorProps, IViewToken, IViewableItemsChangedInfo, IViewabilityConfig, IViewabilityConfigCallbackPair, ICellLayout, } from './components/virtualized-list';
33
35
  export { FlatList } from './components/flat-list';
34
36
  export type { IFlatListProps, IFlatListSlots, IFlatListEmits, IFlatListHandle, } from './components/flat-list';
@@ -37,6 +39,8 @@ export type { IVirtualizedSectionListProps, IVirtualizedSectionListSlots, IVirtu
37
39
  export { SectionList } from './components/section-list';
38
40
  export type { ISection, ISectionListProps, ISectionListSlots, ISectionListEmits, ISectionListHandle, } from './components/section-list';
39
41
  export type { ISafeAreaViewProps } from './components/safe-area-view-props';
42
+ export type { ILayoutConformanceProps } from './components/layout-conformance-props';
43
+ export type { ILayoutConformanceMode } from '@symbiote-native/components';
40
44
  export type { IRefreshControlProps } from './components/refresh-control-props';
41
45
  export { descriptorToVue } from './descriptor-to-vue';
42
46
  export { normalizeVueAttrs } from './utils/normalize-attrs';
@@ -51,21 +55,22 @@ export { KeyboardAvoidingView } from './components/keyboard-avoiding-view';
51
55
  export type { IKeyboardAvoidingBehavior, IKeyboardAvoidingViewProps, IKeyboardAvoidingViewEmits, } from './components/keyboard-avoiding-view';
52
56
  export { StatusBar } from './modules/status-bar';
53
57
  export type { IStatusBarProps, IStatusBarStyle } from './modules/status-bar';
54
- export { AppRegistry, setHostRegistrar } from './modules/app-registry';
55
- export type { IComponentProvider, IAppParameters, IRunnable, IHostRegistrar, IWrapperComponentProvider, IRegistry, IHeadlessTask, ITaskProvider, ITaskCanceller, ITaskCancelProvider, } from './modules/app-registry';
58
+ export { AppRegistry, HeadlessJsTaskError, setHostRegistrar, } from './modules/app-registry';
59
+ export type { IComponentProvider, IAppConfig, IAppParameters, IRunnable, IHostRegistrar, IWrapperComponentProvider, IRegistry, IHeadlessTask, ITaskProvider, ITaskCanceller, ITaskCancelProvider, } from './modules/app-registry';
56
60
  export { useColorScheme } from './composables/use-color-scheme';
61
+ export { useAnimatedColor, useAnimatedValue, useAnimatedValueXY, } from './composables/use-animated-value';
57
62
  export { useWindowDimensions } from './composables/use-window-dimensions';
58
63
  export { createPermissionHook } from './composables/create-permission-hook';
59
64
  export { createResourceHook } from './composables/create-resource-hook';
60
65
  export { defineNativeViewComponent } from './composables/define-native-view-component';
61
66
  export { createEventValueHook } from './composables/create-event-value-hook';
62
67
  export { useEvent, useEventListener } from './composables/use-event';
63
- export { Alert, Share, ActionSheetIOS, Linking, Vibration, ToastAndroid, Settings, I18nManager, Dimensions, Appearance, AppState, Keyboard, KEYBOARD_EVENT, BackHandler, PermissionsAndroid, PERMISSIONS, RESULTS, AccessibilityInfo, LayoutAnimation, } from '@symbiote-native/engine';
68
+ export { Alert, Share, ActionSheetIOS, Linking, Vibration, ToastAndroid, Settings, I18nManager, Dimensions, Appearance, AppState, Keyboard, KEYBOARD_EVENT, TextInputState, BackHandler, PermissionsAndroid, PERMISSIONS, RESULTS, AccessibilityInfo, LayoutAnimation, } from '@symbiote-native/engine';
64
69
  export type { IAlertType, IAlertButtonStyle, IAlertButton, IAlertButtons, IAlertOptions, IShareContent, IShareOptions, IShareAction, IActionSheetIOSOptions, IShareActionSheetIOSOptions, IShareActionSheetError, IUrlEvent, II18nManagerConstants, IDisplayMetrics, IDisplayMetricsAndroid, IDimensionsPayload, IDimensionsSet, IDimensionsKey, IDimensionsChangeListener, IDimensionsStatic, IColorSchemeName, IColorSchemePreference, IAppStateStatus, IAppStateEvent, IKeyboardEventName, IKeyboardEvent, IKeyboardMetrics, IBackPressEventName, IBackPressHandler, IPermission, IPermissionStatus, IRationale, IAccessibilityChangeEvent, IAccessibilityChangeEventName, IAccessibilityChangeEventHandler, IAccessibilityAnnouncementFinishedEvent, IAnnounceForAccessibilityOptions, IAccessibilityEventType, ILayoutAnimationType, ILayoutAnimationProperty, ILayoutAnimationConfig, ILayoutAnimationAnim, } from '@symbiote-native/engine';
65
70
  export { Platform, StyleSheet, processColor, setColorProcessor, dlog, isDebug, } from '@symbiote-native/engine';
66
71
  export type { ISymbioteEvent, ISymbioteNode, IRootTag, } from '@symbiote-native/engine';
67
72
  export type { IViewStyle, ITextStyle, IFlexAlign, IFlexJustify, IPlatformStatic, IPlatformOSType, IPlatformConstantsIOS, IPlatformConstantsAndroid, IPlatformSelectSpec, } from '@symbiote-native/engine';
68
- export { setNativeViewConfigSource, setDeviceEventSource, } from '@symbiote-native/engine';
73
+ export { setNativeViewConfigSource } from '@symbiote-native/engine';
69
74
  export type { INativeViewConfig, INativeViewConfigSource, } from '@symbiote-native/engine';
70
75
  export type { IEnterKeyHint, IInputMode, ISubmitBehavior, ITextInputSelection, IImageStatics, } from '@symbiote-native/components';
71
76
  export { PixelRatio, PanResponder, PlatformColor, DynamicColorIOS, InteractionManager, } from '@symbiote-native/engine';
@@ -73,3 +78,7 @@ export type { IPixelRatioStatic } from '@symbiote-native/engine';
73
78
  export type { IPanResponderGestureState, IPanResponderCallbacks, IGestureResponderHandlers, IPanResponderInstance, } from '@symbiote-native/engine';
74
79
  export type { IColorValue, IOpaqueColorValue, IDynamicColorIOSTuple, } from '@symbiote-native/engine';
75
80
  export type { IInteractionEvent, ISimpleTask, IPromiseTask, ITask, IHandle, } from '@symbiote-native/engine';
81
+ export { DeviceEventEmitter, Easing, EventEmitter, NativeAppEventEmitter, NativeEventEmitter, } from '@symbiote-native/engine';
82
+ export type { IEasing, IEasingFunction, IEmitterSubscription, IEventEmitter, IEventEmitterModule, IEventSubscription, INativeEventListener, } from '@symbiote-native/engine';
83
+ export { codegenNativeCommands, codegenNativeComponent, DevMenu, DevSettings, LogBox, NativeComponentRegistry, NativeModules, Networking, PushNotificationIOS, ReactNativeVersion, registerCallableModule, requireNativeComponent, Systrace, Touchable, TurboModuleRegistry, UIManager, UTFSequence, } from '@symbiote-native/engine';
84
+ export type { IDevSettings } from '@symbiote-native/engine';
package/build/index.js CHANGED
@@ -6,34 +6,13 @@
6
6
  // import sitting beside a re-export of the same specifier both go lazy under Metro's production
7
7
  // `inlineRequires` and the registration silently never runs in a release build. See register.ts.
8
8
  import './register.js';
9
- // Re-exports Vue's ENTIRE public API (ref, computed, defineComponent, unref, …), which looks like
10
- // scope creep on an otherwise carefully curated barrel — it is not ergonomics, it is what makes
11
- // `vueCompilerOptions.lib: "@symbiote-native/vue"` (examples/*/tsconfig.typecheck.json) safe to
12
- // set. Volar/`@vue/language-core` generates virtual TS referencing `import(lib).unref`,
13
- // `import(lib).GlobalComponents`, `.GlobalDirectives`, `.ShallowRef`, `.ObjectDirective` — always
14
- // off `lib`'s ROOT import, never a subpath — so pointing `lib` at us without this line breaks
15
- // EVERY `.vue` SFC's template check with `Cannot find name` the moment Volar's codegen touches any
16
- // of them. `lib`'s other consumer, `optionsWrapper`'s `(await import(lib)).defineComponent(...)`,
17
- // only fires for a plain `<script>` `export default {}` block (`isExportRawObject`,
18
- // `@vue/language-core/lib/codegen/script/index.js`) — every `.vue` file in this repo uses
19
- // `<script setup>`, so that branch never runs and defineComponent needing to resolve from here too
20
- // is moot in practice, not something this wildcard has to get right on its own.
21
- //
22
- // WHY `lib` NEEDS TO BE US AT ALL: plain `"vue"` (Volar's default) types `__VLS_IntrinsicElements`
23
- // and `GlobalComponents` off `vue`'s own `jsx-runtime`/ambient augmentation — the SAME
24
- // `view`/`text`/`image`/`switch`-collide-with-real-SVG-elements problem documented in
25
- // `jsx-runtime.ts` and `intrinsic-elements.ts`, but for `.vue` TEMPLATES rather than TSX. Volar's
26
- // native-vs-component branch (`!isNativeTag(tag)`) reads `IntrinsicElements` from
27
- // `import('${lib}/jsx-runtime')`, so redirecting `lib` to our own package is what finally reaches
28
- // OUR jsx-runtime.ts (real `IViewProps`/`ITextProps`/… on all 4 collision tags) for those four.
9
+ // Volar reads `unref`, `GlobalComponents` and the rest off the ROOT import of `lib`, which is this
10
+ // package (`vueCompilerOptions.lib`), so the barrel re-exports all of `vue`
11
+ // Pointing `lib` here also routes `.vue` template tags to our `jsx-runtime.ts` and its prop types
29
12
  export * from 'vue';
30
13
  export { mount, unmount, setAppConfigurator } from './render.js';
31
- // The portal: Vue's own <Teleport>, guarded so `to` must be a node/surface this renderer actually
32
- // mounted (there is no querySelector). It MOVES host nodes, so it reaches any already-mounted
33
- // target in the SAME surface — including one you only hold a ref to — and keeps the content's
34
- // reactive owner at the call site (provide/inject resolve from where it was written). Reaching a
35
- // second, independently mount()ed surface is a different mechanism: createTunnel, which copies
36
- // into an <Out/> the destination has to render. See create-portal/index.ts.
14
+ // Vue's `Teleport` moves host nodes within one surface, `to` must be a node this renderer mounted
15
+ // Another `mount()`ed surface is the job of `createTunnel`, see create-portal/index.ts
37
16
  export { Teleport } from './create-portal/index.js';
38
17
  export { createTunnel } from './create-tunnel/index.js';
39
18
  // Vue's own Transition/TransitionGroup are runtime-dom-only (CSS class toggling) and
@@ -53,6 +32,7 @@ export { setImageSourceResolver } from '@symbiote-native/components';
53
32
  // `TouchableNativeFeedback.Ripple(…)` / `.SelectableBackground(…)` are unchanged.
54
33
  export { TouchableNativeFeedback } from '@symbiote-native/components';
55
34
  export { VirtualizedList } from './components/virtualized-list/index.js';
35
+ export { useVirtualizedListScope } from './components/virtualized-list/nested-scope.js';
56
36
  export { FlatList } from './components/flat-list/index.js';
57
37
  export { VirtualizedSectionList } from './components/virtualized-section-list/index.js';
58
38
  export { SectionList } from './components/section-list/index.js';
@@ -69,9 +49,10 @@ export { KeyboardAvoidingView } from './components/keyboard-avoiding-view.js';
69
49
  export { StatusBar } from './modules/status-bar.js';
70
50
  // RN's app entry point over `mount`. setHostRegistrar wires RN's own registrar so the native
71
51
  // Fabric host finds our runnable by app key.
72
- export { AppRegistry, setHostRegistrar } from './modules/app-registry/index.js';
52
+ export { AppRegistry, HeadlessJsTaskError, setHostRegistrar, } from './modules/app-registry/index.js';
73
53
  // Vue composables over the core device-state modules.
74
54
  export { useColorScheme } from './composables/use-color-scheme.js';
55
+ export { useAnimatedColor, useAnimatedValue, useAnimatedValueXY, } from './composables/use-animated-value.js';
75
56
  export { useWindowDimensions } from './composables/use-window-dimensions.js';
76
57
  export { createPermissionHook } from './composables/create-permission-hook.js';
77
58
  export { createResourceHook } from './composables/create-resource-hook.js';
@@ -79,13 +60,17 @@ export { defineNativeViewComponent } from './composables/define-native-view-comp
79
60
  export { createEventValueHook } from './composables/create-event-value-hook.js';
80
61
  export { useEvent, useEventListener } from './composables/use-event.js';
81
62
  // Imperative runtime modules: the SAME module both adapters share, re-exported from @symbiote-native/engine.
82
- export { Alert, Share, ActionSheetIOS, Linking, Vibration, ToastAndroid, Settings, I18nManager, Dimensions, Appearance, AppState, Keyboard, KEYBOARD_EVENT, BackHandler, PermissionsAndroid, PERMISSIONS, RESULTS, AccessibilityInfo, LayoutAnimation, } from '@symbiote-native/engine';
63
+ export { Alert, Share, ActionSheetIOS, Linking, Vibration, ToastAndroid, Settings, I18nManager, Dimensions, Appearance, AppState, Keyboard, KEYBOARD_EVENT, TextInputState, BackHandler, PermissionsAndroid, PERMISSIONS, RESULTS, AccessibilityInfo, LayoutAnimation, } from '@symbiote-native/engine';
83
64
  // Re-export the framework-agnostic engine surface (pure utilities + diagnostics).
84
65
  export { Platform, StyleSheet, processColor, setColorProcessor, dlog, isDebug, } from '@symbiote-native/engine';
85
66
  // Wired once by the app entry on a real host (like setColorProcessor): hands the engine
86
- // RN's ViewConfig registry so third-party Fabric views auto-derive their metadata.
87
- // setDeviceEventSource is the third seam of the same set and travels with them.
88
- export { setNativeViewConfigSource, setDeviceEventSource, } from '@symbiote-native/engine';
67
+ // RN's ViewConfig registry so third-party Fabric views auto-derive their metadata
68
+ export { setNativeViewConfigSource } from '@symbiote-native/engine';
89
69
  // Pure utilities that moved to the engine (single source, both adapters re-export):
90
70
  // PixelRatio + PanResponder, plus the color builders and the interaction scheduler.
91
71
  export { PixelRatio, PanResponder, PlatformColor, DynamicColorIOS, InteractionManager, } from '@symbiote-native/engine';
72
+ // The device event bus and the easing curves, shared verbatim from the engine
73
+ export { DeviceEventEmitter, Easing, EventEmitter, NativeAppEventEmitter, NativeEventEmitter, } from '@symbiote-native/engine';
74
+ // RN's dev and native-module utilities, shared verbatim from the engine. The ones RN owns forward
75
+ // to its own module, which `registerApp` hands over
76
+ export { codegenNativeCommands, codegenNativeComponent, DevMenu, DevSettings, LogBox, NativeComponentRegistry, NativeModules, Networking, PushNotificationIOS, ReactNativeVersion, registerCallableModule, requireNativeComponent, Systrace, Touchable, TurboModuleRegistry, UIManager, UTFSequence, } from '@symbiote-native/engine';
@@ -1,28 +1,37 @@
1
- import { AnimatedValue, AnimatedValueXY, AnimatedColor, timing, spring, decay, parallel, sequence, stagger, loop, delay, add, subtract, multiply, divide, modulo, diffClamp, event, forkEvent, unforkEvent } from '@symbiote-native/engine';
2
1
  import { createAnimatedComponent } from './create-animated-component';
3
2
  export { createAnimatedComponent } from './create-animated-component';
4
3
  export declare const Animated: {
5
- Value: typeof AnimatedValue;
6
- ValueXY: typeof AnimatedValueXY;
7
- Color: typeof AnimatedColor;
4
+ timing: {
5
+ (value: import("@symbiote-native/engine").AnimatedValue, config: import("@symbiote-native/engine").ITimingConfig): import("@symbiote-native/engine").ICompositeAnimation;
6
+ (value: import("@symbiote-native/engine").IVectorValue, config: import("@symbiote-native/engine").IVectorTimingConfig): import("@symbiote-native/engine").ICompositeAnimation;
7
+ };
8
+ spring: {
9
+ (value: import("@symbiote-native/engine").AnimatedValue, config: import("@symbiote-native/engine").ISpringConfig): import("@symbiote-native/engine").ICompositeAnimation;
10
+ (value: import("@symbiote-native/engine").IVectorValue, config: import("@symbiote-native/engine").IVectorSpringConfig): import("@symbiote-native/engine").ICompositeAnimation;
11
+ };
12
+ decay: (_value: import("@symbiote-native/engine").AnimatedValue, _config: import("@symbiote-native/engine").IDecayConfig) => import("@symbiote-native/engine").ICompositeAnimation;
13
+ parallel: (animations: import("@symbiote-native/engine").ICompositeAnimation[], _config?: import("@symbiote-native/engine").IParallelConfig) => import("@symbiote-native/engine").ICompositeAnimation;
14
+ sequence: (animations: import("@symbiote-native/engine").ICompositeAnimation[]) => import("@symbiote-native/engine").ICompositeAnimation;
15
+ stagger: (_time: number, animations: import("@symbiote-native/engine").ICompositeAnimation[]) => import("@symbiote-native/engine").ICompositeAnimation;
16
+ loop: (_animation: import("@symbiote-native/engine").ICompositeAnimation) => import("@symbiote-native/engine").ICompositeAnimation;
17
+ delay: (_time: number) => import("@symbiote-native/engine").ICompositeAnimation;
18
+ Value: typeof import("@symbiote-native/engine").AnimatedValue;
19
+ ValueXY: typeof import("@symbiote-native/engine").AnimatedValueXY;
20
+ Color: typeof import("@symbiote-native/engine").AnimatedColor;
21
+ Interpolation: typeof import("@symbiote-native/engine").AnimatedInterpolation;
22
+ Node: typeof import("@symbiote-native/engine").AnimatedNode;
8
23
  Easing: import("@symbiote-native/engine").IEasing;
9
- timing: typeof timing;
10
- spring: typeof spring;
11
- decay: typeof decay;
12
- parallel: typeof parallel;
13
- sequence: typeof sequence;
14
- stagger: typeof stagger;
15
- loop: typeof loop;
16
- delay: typeof delay;
17
- add: typeof add;
18
- subtract: typeof subtract;
19
- multiply: typeof multiply;
20
- divide: typeof divide;
21
- modulo: typeof modulo;
22
- diffClamp: typeof diffClamp;
23
- event: typeof event;
24
- forkEvent: typeof forkEvent;
25
- unforkEvent: typeof unforkEvent;
24
+ add: typeof import("@symbiote-native/engine").add;
25
+ subtract: typeof import("@symbiote-native/engine").subtract;
26
+ multiply: typeof import("@symbiote-native/engine").multiply;
27
+ divide: typeof import("@symbiote-native/engine").divide;
28
+ modulo: typeof import("@symbiote-native/engine").modulo;
29
+ diffClamp: typeof import("@symbiote-native/engine").diffClamp;
30
+ event: typeof import("@symbiote-native/engine").event;
31
+ attachNativeEvent: typeof import("@symbiote-native/engine").attachNativeEvent;
32
+ forkEvent: typeof import("@symbiote-native/engine").forkEvent;
33
+ unforkEvent: typeof import("@symbiote-native/engine").unforkEvent;
34
+ Event: typeof import("@symbiote-native/engine").AnimatedEvent;
26
35
  View: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
27
36
  [key: string]: any;
28
37
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -39,27 +48,31 @@ export declare const Animated: {
39
48
  SectionList: ReturnType<typeof createAnimatedComponent>;
40
49
  createAnimatedComponent: typeof createAnimatedComponent;
41
50
  } | {
42
- Value: typeof AnimatedValue;
43
- ValueXY: typeof AnimatedValueXY;
44
- Color: typeof AnimatedColor;
51
+ Value: typeof import("@symbiote-native/engine").AnimatedValue;
52
+ ValueXY: typeof import("@symbiote-native/engine").AnimatedValueXY;
53
+ Color: typeof import("@symbiote-native/engine").AnimatedColor;
54
+ Interpolation: typeof import("@symbiote-native/engine").AnimatedInterpolation;
55
+ Node: typeof import("@symbiote-native/engine").AnimatedNode;
45
56
  Easing: import("@symbiote-native/engine").IEasing;
46
- timing: (value: AnimatedValue, config: import("@symbiote-native/engine").ITimingConfig) => import("@symbiote-native/engine").ICompositeAnimation;
47
- spring: (value: AnimatedValue, config: import("@symbiote-native/engine").ISpringConfig) => import("@symbiote-native/engine").ICompositeAnimation;
48
- decay: (_value: AnimatedValue, _config: import("@symbiote-native/engine").IDecayConfig) => import("@symbiote-native/engine").ICompositeAnimation;
49
- parallel: (animations: import("@symbiote-native/engine").ICompositeAnimation[], _config?: import("@symbiote-native/engine").IParallelConfig) => import("@symbiote-native/engine").ICompositeAnimation;
50
- sequence: (animations: import("@symbiote-native/engine").ICompositeAnimation[]) => import("@symbiote-native/engine").ICompositeAnimation;
51
- stagger: (_time: number, animations: import("@symbiote-native/engine").ICompositeAnimation[]) => import("@symbiote-native/engine").ICompositeAnimation;
52
- loop: (_animation: import("@symbiote-native/engine").ICompositeAnimation) => import("@symbiote-native/engine").ICompositeAnimation;
53
- delay: (_time: number) => import("@symbiote-native/engine").ICompositeAnimation;
54
- add: typeof add;
55
- subtract: typeof subtract;
56
- multiply: typeof multiply;
57
- divide: typeof divide;
58
- modulo: typeof modulo;
59
- diffClamp: typeof diffClamp;
60
- event: typeof event;
61
- forkEvent: typeof forkEvent;
62
- unforkEvent: typeof unforkEvent;
57
+ timing: typeof import("@symbiote-native/engine").timing;
58
+ spring: typeof import("@symbiote-native/engine").spring;
59
+ decay: typeof import("@symbiote-native/engine").decay;
60
+ parallel: typeof import("@symbiote-native/engine").parallel;
61
+ sequence: typeof import("@symbiote-native/engine").sequence;
62
+ stagger: typeof import("@symbiote-native/engine").stagger;
63
+ loop: typeof import("@symbiote-native/engine").loop;
64
+ delay: typeof import("@symbiote-native/engine").delay;
65
+ add: typeof import("@symbiote-native/engine").add;
66
+ subtract: typeof import("@symbiote-native/engine").subtract;
67
+ multiply: typeof import("@symbiote-native/engine").multiply;
68
+ divide: typeof import("@symbiote-native/engine").divide;
69
+ modulo: typeof import("@symbiote-native/engine").modulo;
70
+ diffClamp: typeof import("@symbiote-native/engine").diffClamp;
71
+ event: typeof import("@symbiote-native/engine").event;
72
+ attachNativeEvent: typeof import("@symbiote-native/engine").attachNativeEvent;
73
+ forkEvent: typeof import("@symbiote-native/engine").forkEvent;
74
+ unforkEvent: typeof import("@symbiote-native/engine").unforkEvent;
75
+ Event: typeof import("@symbiote-native/engine").AnimatedEvent;
63
76
  View: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
64
77
  [key: string]: any;
65
78
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;