@symbiote-native/vue 3.2.0 → 3.4.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 (59) hide show
  1. package/build/components/checkbox-props.d.ts +3 -0
  2. package/build/components/checkbox-props.js +1 -0
  3. package/build/components/flat-list/index.d.ts +4 -3
  4. package/build/components/flat-list/index.js +18 -21
  5. package/build/components/input-accessory-view-props.d.ts +4 -4
  6. package/build/components/keyboard-avoiding-view.d.ts +11 -3
  7. package/build/components/keyboard-avoiding-view.js +38 -69
  8. package/build/components/layout-conformance-props.d.ts +4 -0
  9. package/build/components/layout-conformance-props.js +1 -0
  10. package/build/components/modal/index.d.ts +18 -5
  11. package/build/components/modal/index.js +53 -24
  12. package/build/components/refresh-control-props.d.ts +7 -7
  13. package/build/components/scroll-view/scroll-view-props.d.ts +8 -5
  14. package/build/components/section-list/index.d.ts +1 -1
  15. package/build/components/section-list/index.js +2 -6
  16. package/build/components/text-props.d.ts +3 -3
  17. package/build/components/touchable-props.d.ts +6 -6
  18. package/build/components/virtualized-list/index.d.ts +5 -75
  19. package/build/components/virtualized-list/index.js +130 -558
  20. package/build/components/virtualized-list/list-children.d.ts +18 -0
  21. package/build/components/virtualized-list/list-children.js +81 -0
  22. package/build/components/virtualized-list/list-elements.d.ts +7 -0
  23. package/build/components/virtualized-list/list-elements.js +29 -0
  24. package/build/components/virtualized-list/list-scroll-props.d.ts +20 -0
  25. package/build/components/virtualized-list/list-scroll-props.js +9 -0
  26. package/build/components/virtualized-list/narrow-props.d.ts +79 -0
  27. package/build/components/virtualized-list/narrow-props.js +89 -0
  28. package/build/components/virtualized-list/nested-scope.d.ts +3 -0
  29. package/build/components/virtualized-list/nested-scope.js +12 -0
  30. package/build/components/virtualized-list/user-handlers.d.ts +3 -0
  31. package/build/components/virtualized-list/user-handlers.js +24 -0
  32. package/build/components/virtualized-list/virtualized-list-props.d.ts +82 -0
  33. package/build/components/virtualized-list/virtualized-list-props.js +41 -0
  34. package/build/components/virtualized-section-list/index.d.ts +20 -5
  35. package/build/components/virtualized-section-list/index.js +81 -95
  36. package/build/components/virtualized-section-list/section-item-cell.d.ts +18 -0
  37. package/build/components/virtualized-section-list/section-item-cell.js +52 -0
  38. package/build/composables/define-native-view-component.d.ts +3 -0
  39. package/build/composables/define-native-view-component.js +23 -0
  40. package/build/composables/use-animated-value.d.ts +7 -0
  41. package/build/composables/use-animated-value.js +14 -0
  42. package/build/composables/use-color-scheme.d.ts +1 -1
  43. package/build/composables/use-event.d.ts +6 -0
  44. package/build/composables/use-event.js +22 -0
  45. package/build/create-transition/index.d.ts +2 -2
  46. package/build/create-transition/index.js +1 -1
  47. package/build/descriptor-to-vue.d.ts +1 -1
  48. package/build/descriptor-to-vue.js +6 -2
  49. package/build/index.d.ts +16 -4
  50. package/build/index.js +18 -31
  51. package/build/jsx-runtime.d.ts +2 -0
  52. package/build/modules/animated/index.d.ts +54 -41
  53. package/build/modules/animated/index.js +2 -26
  54. package/build/modules/app-registry/index.d.ts +3 -3
  55. package/build/modules/app-registry/index.js +2 -2
  56. package/build/modules/status-bar.js +22 -24
  57. package/build/utils/normalize-attrs.js +10 -4
  58. package/metro-vue-transformer.cjs +165 -224
  59. package/package.json +6 -6
@@ -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>;
@@ -3,7 +3,7 @@
3
3
  // from @symbiote-native/engine (framework-agnostic, JS-driven), spread in verbatim. Both halves
4
4
  // meet here so `Animated.timing(new Animated.Value(0), ...).start()` works against the
5
5
  // Vue-driven engine.
6
- import { AnimatedValue, AnimatedValueXY, AnimatedColor, AnimatedMock, Easing, Platform, timing, spring, decay, parallel, sequence, stagger, loop, delay, add, subtract, multiply, divide, modulo, diffClamp, event, forkEvent, unforkEvent, } from '@symbiote-native/engine';
6
+ import { AnimatedDrivers, AnimatedMock, Platform, } from '@symbiote-native/engine';
7
7
  import { FlatList } from '../../components/flat-list/index.js';
8
8
  import { SectionList } from '../../components/section-list/index.js';
9
9
  import { createAnimatedComponent } from './create-animated-component.js';
@@ -29,35 +29,11 @@ const AnimatedScrollView = createAnimatedComponent('scroll-view');
29
29
  // `undefined` and rendering nothing.
30
30
  let animatedFlatList;
31
31
  let animatedSectionList;
32
- // The live, JS-driven driver namespace (real frames). RN's AnimatedImplementation.
33
- const liveDrivers = {
34
- Value: AnimatedValue,
35
- ValueXY: AnimatedValueXY,
36
- Color: AnimatedColor,
37
- Easing,
38
- timing,
39
- spring,
40
- decay,
41
- parallel,
42
- sequence,
43
- stagger,
44
- loop,
45
- delay,
46
- add,
47
- subtract,
48
- multiply,
49
- divide,
50
- modulo,
51
- diffClamp,
52
- event,
53
- forkEvent,
54
- unforkEvent,
55
- };
56
32
  // RN swaps the WHOLE driver namespace for the mock when the host reports isDisableAnimations
57
33
  // (reduced motion/test env): the mock keeps the same surface but jumps each animation to its
58
34
  // final value synchronously, no frames. The animated COMPONENTS stay live in both branches; only
59
35
  // the drivers/value/operators/events half is swapped.
60
- const drivers = Platform.isDisableAnimations ? AnimatedMock : liveDrivers;
36
+ const drivers = Platform.isDisableAnimations ? AnimatedMock : AnimatedDrivers;
61
37
  export const Animated = {
62
38
  View: AnimatedView,
63
39
  Text: AnimatedText,
@@ -1,7 +1,7 @@
1
1
  import { type Component } from '@vue/runtime-core';
2
- import { type IAppParameters } from '@symbiote-native/engine';
2
+ import { HeadlessJsTaskError, type IAppParameters } from '@symbiote-native/engine';
3
3
  export type IComponentProvider = () => Component;
4
4
  export type IWrapperComponentProvider = (appParameters: IAppParameters) => Component;
5
5
  declare const AppRegistry: import("@symbiote-native/engine").IAppRegistry<IComponentProvider, IWrapperComponentProvider>, setHostRegistrar: (registrar: import("@symbiote-native/engine").IHostRegistrar) => void;
6
- export { AppRegistry, setHostRegistrar };
7
- export type { IAppParameters, IRunnable, IHostRegistrar, IRegistry, IHeadlessTask, ITaskProvider, ITaskCanceller, ITaskCancelProvider, } from '@symbiote-native/engine';
6
+ export { AppRegistry, HeadlessJsTaskError, setHostRegistrar };
7
+ export type { IAppConfig, IAppParameters, IRunnable, IHostRegistrar, IRegistry, IHeadlessTask, ITaskProvider, ITaskCanceller, ITaskCancelProvider, } from '@symbiote-native/engine';
@@ -6,7 +6,7 @@
6
6
  // functional root (h() has no createElement-style prop/children spread of its own targets, so
7
7
  // the wrap step is a render function rather than an object merge).
8
8
  import { h, } from '@vue/runtime-core';
9
- import { createAppRegistry, dlog, } from '@symbiote-native/engine';
9
+ import { createAppRegistry, dlog, HeadlessJsTaskError, } from '@symbiote-native/engine';
10
10
  import { mount } from '../../render.js';
11
11
  function runnableFor(componentProvider, getWrapperComponentProvider) {
12
12
  return appParameters => {
@@ -27,4 +27,4 @@ function runnableFor(componentProvider, getWrapperComponentProvider) {
27
27
  };
28
28
  }
29
29
  const { AppRegistry, setHostRegistrar } = createAppRegistry(runnableFor);
30
- export { AppRegistry, setHostRegistrar };
30
+ export { AppRegistry, HeadlessJsTaskError, setHostRegistrar };
@@ -1,14 +1,13 @@
1
- // StatusBar, the Vue lifecycle half. The native StatusBarManager driving (applyStatusBarProps),
2
- // the imperative statics, and the Android bar-height constant all live in @symbiote-native/engine,
3
- // shared verbatim with React; Metro selects the engine's status-bar.ios.ts/.android.ts per host,
4
- // so platform divergence never reaches this file. Vue supplies only the declarative shape: a
5
- // component that renders NOTHING and re-applies the props through a watchEffect on mount + every
6
- // prop change, with the imperative statics attached to the component object.
7
- //
8
- // Inputs arrive as attrs (untyped) and run through normalizeVueAttrs before each is narrowed by a guard.
9
- import { defineComponent, watchEffect, } from '@vue/runtime-core';
10
- import { applyStatusBarProps, statusBarImperative, statusBarCurrentHeight, isOpaqueColorValue, } from '@symbiote-native/engine';
1
+ // Vue half of StatusBar, the props stack and statics live in the engine. It renders nothing, keeps
2
+ // one stack entry through `watchEffect` and releases it on unmount
3
+ import { defineComponent, onUnmounted, watchEffect, } from '@vue/runtime-core';
4
+ import { createStatusBarEntry, statusBarImperative, statusBarCurrentHeight, isProcessableColor, } from '@symbiote-native/engine';
11
5
  import { normalizeVueAttrs } from '../utils/normalize-attrs.js';
6
+ const TRANSITIONS = [
7
+ 'none',
8
+ 'fade',
9
+ 'slide',
10
+ ];
12
11
  function asBoolean(value) {
13
12
  return typeof value === 'boolean' ? value : undefined;
14
13
  }
@@ -19,20 +18,19 @@ function asBarStyle(value) {
19
18
  ? value
20
19
  : undefined;
21
20
  }
22
- function asColorValue(value) {
23
- if (typeof value === 'string')
24
- return value;
25
- if (isOpaqueColorValue(value))
26
- return value;
27
- return undefined;
21
+ function asTransition(value) {
22
+ return TRANSITIONS.find(transition => transition === value);
28
23
  }
29
24
  function buildProps(attrs) {
30
25
  return {
31
26
  barStyle: asBarStyle(attrs.barStyle),
32
27
  hidden: asBoolean(attrs.hidden),
33
28
  animated: asBoolean(attrs.animated),
29
+ showHideTransition: asTransition(attrs.showHideTransition),
34
30
  networkActivityIndicatorVisible: asBoolean(attrs.networkActivityIndicatorVisible),
35
- backgroundColor: asColorValue(attrs.backgroundColor),
31
+ backgroundColor: isProcessableColor(attrs.backgroundColor)
32
+ ? attrs.backgroundColor
33
+ : undefined,
36
34
  translucent: asBoolean(attrs.translucent),
37
35
  };
38
36
  }
@@ -40,21 +38,21 @@ const StatusBarComponent = defineComponent({
40
38
  name: 'StatusBar',
41
39
  inheritAttrs: false,
42
40
  setup(_props, { attrs: rawAttrs }) {
43
- // watchEffect tracks rawAttrs (reactive), so reading it here re-applies on every prop change.
44
- // Resolution is lazy inside the engine (a missing StatusBarManager is a no-op).
41
+ const entry = createStatusBarEntry();
42
+ // `rawAttrs` is reactive, so every prop change replaces this entry
45
43
  watchEffect(() => {
46
- applyStatusBarProps(buildProps(normalizeVueAttrs(rawAttrs)));
44
+ entry.apply(buildProps(normalizeVueAttrs(rawAttrs)));
47
45
  });
46
+ // Popping restores what the stack held below this entry
47
+ onUnmounted(() => entry.release());
48
48
  return () => null;
49
49
  },
50
50
  });
51
51
  const StatusBarWithStatics = Object.assign(StatusBarComponent, statusBarImperative);
52
- // Android exposes the bar height as a native constant; undefined on iOS / when absent. Read lazily
53
- // (getter) so nothing touches native at import time; the Android engine impl resolves on access.
52
+ // A getter, not a value, so nothing touches native at import time
54
53
  Object.defineProperty(StatusBarWithStatics, 'currentHeight', {
55
54
  get: statusBarCurrentHeight,
56
55
  enumerable: true,
57
56
  });
58
- // currentHeight is optional, so the defineProperty-added accessor doesn't need to appear on the
59
- // runtime object's inferred type for this assignment to hold (no cast).
57
+ // `currentHeight` is optional, so the accessor need not appear on the inferred type (no cast)
60
58
  export const StatusBar = StatusBarWithStatics;
@@ -9,14 +9,20 @@
9
9
  // and `data-*`. Event keys are already `onXxx` (Vue folds `@value-change` → onValueChange, no
10
10
  // dash) so they pass through untouched.
11
11
  const KEBAB_SEGMENT = /-([a-z])/g;
12
+ // The template compiler keys a native tag's `@valueChange` as `on:valueChange`, to keep its case
13
+ const NATIVE_EVENT_PREFIX = 'on:';
14
+ function foldNativeEventKey(key) {
15
+ const name = key.slice(NATIVE_EVENT_PREFIX.length);
16
+ return `on${name.charAt(0).toUpperCase()}${name.slice(1)}`;
17
+ }
12
18
  function toCamel(key) {
13
19
  return key.replace(KEBAB_SEGMENT, (_match, char) => char.toUpperCase());
14
20
  }
15
- // The per-KEY half, for the path that never sees a whole attrs bag: an intrinsic tag reaches the
16
- // renderer one patchProp call at a time, with no component in between to fold the bag. Returns the
17
- // key unchanged (same string identity)
18
- // whenever there is nothing to convert, which is every key on the hot path.
21
+ // The per-KEY half, for an intrinsic tag: `patchProp` hands over one key with no bag to fold
22
+ // Returns the same string when nothing converts, which is every key on the hot path
19
23
  export function normalizeVueAttrKey(key) {
24
+ if (key.startsWith(NATIVE_EVENT_PREFIX))
25
+ return foldNativeEventKey(key);
20
26
  if (!key.includes('-'))
21
27
  return key;
22
28
  if (key.startsWith('aria-') || key.startsWith('data-'))