@ng-native/components 0.28.0 → 0.30.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 (123) hide show
  1. package/README.md +2 -2
  2. package/android/src/main/java/dev/ngnative/components/ColorSchemeModule.kt +116 -11
  3. package/dist/activity-indicator.js +3 -3
  4. package/dist/animated-style.js +3 -3
  5. package/dist/animations-web.js +3 -3
  6. package/dist/animations.js +3 -3
  7. package/dist/content-container.js +3 -3
  8. package/dist/context-menu.js +3 -3
  9. package/dist/drag-and-drop.js +6 -6
  10. package/dist/gestures-web.js +6 -6
  11. package/dist/gestures.js +6 -6
  12. package/dist/gradient-text.d.ts +1 -1
  13. package/dist/gradient-text.js +4 -4
  14. package/dist/gradient-text.js.map +1 -1
  15. package/dist/image-background.js +3 -3
  16. package/dist/image.js +3 -3
  17. package/dist/index.d.ts +3 -2
  18. package/dist/index.js +3 -2
  19. package/dist/index.js.map +1 -1
  20. package/dist/input-accessory-view.js +3 -3
  21. package/dist/keyboard-avoiding-view.js +3 -3
  22. package/dist/keyboard-dock.js +15 -15
  23. package/dist/markdown-blocks.d.ts +2 -1
  24. package/dist/markdown-blocks.js +22 -18
  25. package/dist/markdown-blocks.js.map +1 -1
  26. package/dist/markdown-columns.js +3 -3
  27. package/dist/markdown-stream.js +8 -5
  28. package/dist/markdown-stream.js.map +1 -1
  29. package/dist/markdown.js +5 -5
  30. package/dist/markdown.js.map +1 -1
  31. package/dist/menu.d.ts +11 -5
  32. package/dist/menu.js +24 -44
  33. package/dist/menu.js.map +1 -1
  34. package/dist/modal.js +8 -3
  35. package/dist/modal.js.map +1 -1
  36. package/dist/native-button.d.ts +25 -3
  37. package/dist/native-button.js +102 -8
  38. package/dist/native-button.js.map +1 -1
  39. package/dist/native-gesture.js +3 -3
  40. package/dist/native-ref.js +3 -3
  41. package/dist/press-menu.d.ts +38 -8
  42. package/dist/press-menu.js +80 -19
  43. package/dist/press-menu.js.map +1 -1
  44. package/dist/pressable.js +14 -13
  45. package/dist/pressable.js.map +1 -1
  46. package/dist/reanimated-web.js +6 -6
  47. package/dist/reanimated.js +6 -6
  48. package/dist/refresh-control.js +3 -3
  49. package/dist/safe-area-provider.js +3 -3
  50. package/dist/safe-area-view.js +3 -3
  51. package/dist/scroll-view-props.js +3 -3
  52. package/dist/scroll-view.d.ts +3 -1
  53. package/dist/scroll-view.js +10 -5
  54. package/dist/scroll-view.js.map +1 -1
  55. package/dist/section-list.d.ts +4 -4
  56. package/dist/section-list.js +37 -34
  57. package/dist/section-list.js.map +1 -1
  58. package/dist/shortcut.js +3 -3
  59. package/dist/sidebar-item.js +3 -3
  60. package/dist/sidebar-section.d.ts +12 -5
  61. package/dist/sidebar-section.js +32 -12
  62. package/dist/sidebar-section.js.map +1 -1
  63. package/dist/sidebar.d.ts +11 -3
  64. package/dist/sidebar.js +18 -8
  65. package/dist/sidebar.js.map +1 -1
  66. package/dist/split-view.d.ts +23 -2
  67. package/dist/split-view.js +36 -9
  68. package/dist/split-view.js.map +1 -1
  69. package/dist/stand-ins/animations.js +3 -3
  70. package/dist/sticky-headers.d.ts +19 -0
  71. package/dist/sticky-headers.js +67 -10
  72. package/dist/sticky-headers.js.map +1 -1
  73. package/dist/sticky-rows.d.ts +13 -11
  74. package/dist/sticky-rows.js +35 -21
  75. package/dist/sticky-rows.js.map +1 -1
  76. package/dist/svg-icon.d.ts +16 -2
  77. package/dist/svg-icon.js +19 -3
  78. package/dist/svg-icon.js.map +1 -1
  79. package/dist/switch.js +3 -3
  80. package/dist/template-slot.js +3 -3
  81. package/dist/text-input.js +3 -3
  82. package/dist/text.js +3 -3
  83. package/dist/touchable-opacity.js +3 -3
  84. package/dist/tray-icon.d.ts +7 -1
  85. package/dist/tray-icon.js +17 -5
  86. package/dist/tray-icon.js.map +1 -1
  87. package/dist/view-base.d.ts +18 -2
  88. package/dist/view-base.js +42 -10
  89. package/dist/view-base.js.map +1 -1
  90. package/dist/view.js +3 -3
  91. package/dist/virtual-list-layout.d.ts +5 -0
  92. package/dist/virtual-list-layout.js.map +1 -1
  93. package/dist/virtual-list-num-columns.d.ts +8 -4
  94. package/dist/virtual-list-num-columns.js +13 -5
  95. package/dist/virtual-list-num-columns.js.map +1 -1
  96. package/dist/virtual-list-sticky-level.d.ts +0 -6
  97. package/dist/virtual-list-sticky-level.js +5 -29
  98. package/dist/virtual-list-sticky-level.js.map +1 -1
  99. package/dist/virtual-list.d.ts +72 -11
  100. package/dist/virtual-list.js +285 -74
  101. package/dist/virtual-list.js.map +1 -1
  102. package/dist/visual-effect.d.ts +37 -0
  103. package/dist/visual-effect.js +60 -0
  104. package/dist/visual-effect.js.map +1 -0
  105. package/dist/worklet-scroll.js +3 -3
  106. package/dist/worklet-style.js +3 -3
  107. package/dist/written-props.js +9 -0
  108. package/dist/written-props.js.map +1 -1
  109. package/ios/NgNativeButtonComponentView.mm +8 -4
  110. package/ios/NgNativeButtonMetrics.h +9 -2
  111. package/ios/NgNativeButtonMetrics.mm +33 -4
  112. package/ios/NgNativeButtonShadowNode.h +2 -0
  113. package/ios/NgNativeButtonShadowNode.mm +5 -1
  114. package/ios/NgNativeComponents.podspec +2 -2
  115. package/ios/NgNativeKeyboardFocus.h +21 -0
  116. package/ios/NgNativeKeyboardFocus.mm +28 -0
  117. package/ios/NgNativeKeyboardFocusModule.mm +203 -0
  118. package/ios/NgNativeMenus.mm +62 -2
  119. package/ios/NgNativePressMenu.h +36 -0
  120. package/ios/NgNativePressMenu.mm +79 -0
  121. package/ios/NgNativeViewBinder.h +5 -0
  122. package/ios/NgNativeViewBinder.mm +31 -4
  123. package/package.json +6 -6
@@ -1,5 +1,6 @@
1
1
  import { TemplateRef } from '@angular/core';
2
2
  import { type NativeSyntheticEvent } from '@ng-native/fabric';
3
+ import type { Size } from './events.ts';
3
4
  import { type KeyboardShouldPersistTaps } from './keyboard-taps.ts';
4
5
  import { ScrollViewProps } from './scroll-view-props.ts';
5
6
  import * as i0 from "@angular/core";
@@ -220,6 +221,8 @@ export declare class VirtualList<T> extends ScrollViewProps {
220
221
  readonly endReached: import("@angular/core").OutputEmitterRef<{
221
222
  distanceFromEnd: number;
222
223
  }>;
224
+ /** The content's size changed: the header, the rows and the footer together, as `<scroll-view>` reports its own. */
225
+ readonly contentSizeChange: import("@angular/core").OutputEmitterRef<Size>;
223
226
  /** Which rows are on screen, and what changed since last time. */
224
227
  readonly viewableItemsChanged: import("@angular/core").OutputEmitterRef<{
225
228
  viewable: readonly VirtualRow<T>[];
@@ -242,7 +245,8 @@ export declare class VirtualList<T> extends ScrollViewProps {
242
245
  private readonly measuredGaps;
243
246
  protected readonly separator: import("@angular/core").Signal<VirtualListSeparator<T> | undefined>;
244
247
  private readonly refreshControl;
245
- /** See ScrollView: inside Android's swipe layout the list must see a drag first. */
248
+ private readonly inSheet;
249
+ /** See ScrollView: inside Android's swipe layout or a form sheet the list must see a drag first. */
246
250
  protected readonly nestedScroll: import("@angular/core").Signal<true | undefined>;
247
251
  /** Viewports filled past the overscan, before and after the visible rows in index order. */
248
252
  private readonly fill;
@@ -356,6 +360,19 @@ export declare class VirtualList<T> extends ScrollViewProps {
356
360
  * rows' own space, after the header, or the very start of the list.
357
361
  */
358
362
  private pendingScroll;
363
+ /**
364
+ * The app's last scroll, kept for the render its handler schedules. Native makes the scroll with
365
+ * the rows it has, and that render may be what gives the list its new ones.
366
+ */
367
+ private asked;
368
+ private askedTimer;
369
+ /** The rows' extent at the last render, and what native is sure to have mounted of it. */
370
+ private renderedExtent;
371
+ private mountedExtent;
372
+ /** Counts the times the rows got shorter, after which an earlier render's extent is stale. */
373
+ private shortened;
374
+ /** Counts the scrolls sent, so one waiting to be made again gives way to what came after it. */
375
+ private scrollsSent;
359
376
  /** What moves the rows: which items, and where each one is. */
360
377
  private readonly placement;
361
378
  /**
@@ -398,8 +415,20 @@ export declare class VirtualList<T> extends ScrollViewProps {
398
415
  * on, and holding it by something off screen would be holding it by nothing the user saw.
399
416
  */
400
417
  private successorOf;
401
- /** Make a queued correction, after the commit that moved the rows has gone to native. */
418
+ /**
419
+ * Make a queued correction, after the commit that moved the rows has gone to native, and then
420
+ * the app's scroll again when the correction would undo it, or when it was to past the end the
421
+ * new items have. A jump takes the correction's place; an animation starts from it.
422
+ */
402
423
  private flushScroll;
424
+ /** Whether the items given since a scroll end before where it was going. */
425
+ private endsBefore;
426
+ /**
427
+ * Keep a scroll the app made, to `offset`, for the next render. A jump is there already, so the
428
+ * list is too. An animation has yet to leave: the rows stay those on screen, and follow it.
429
+ */
430
+ private ask;
431
+ private forgetAsked;
403
432
  /** In development, a list with rows that stays at zero size; see `ZeroSizeWarning`. */
404
433
  private readonly zeroSize;
405
434
  constructor();
@@ -434,14 +463,31 @@ export declare class VirtualList<T> extends ScrollViewProps {
434
463
  height: number;
435
464
  width?: undefined;
436
465
  }>;
437
- /** The rows from `first` up to `last`, and the pinned rows above them if there are any. */
466
+ /**
467
+ * Where the first row rendered in flow starts: `first`'s place, less each row rendered ahead of
468
+ * it, or where native moves them, the first of those rows' own place. Less than nothing where a
469
+ * negative gap overlaps the rows not rendered, which the spacer cannot be: the first row takes
470
+ * the rest as a margin (`rowsFor`).
471
+ */
472
+ private flowStart;
473
+ /**
474
+ * The rows rendered ahead of the window: the pinned rows it has left behind, and where native
475
+ * moves rows in flow, the row before each pinned row after the outermost. Flow places a row
476
+ * after the row before it, so with that row rendered too, a pinned row is at its own place
477
+ * with no margin of its own, and its props stay as they are as the window moves past it.
478
+ */
479
+ private readonly rendersAhead;
480
+ /** The rows from `first` up to `last`, and the rows ahead of them if there are any. */
438
481
  private rowsFor;
482
+ /** Start the first row in flow at `start`, below zero, where the spacer cannot reach. */
483
+ private startBefore;
439
484
  /**
440
- * A pinned row native moves stays at its own place, so the rows between it and the window are
441
- * made up before the window rather than after the row: new props on a view native is moving
442
- * put its transform back for a frame.
485
+ * A pinned row native moves stays at its own place, so the rows that are not rendered between
486
+ * it and the next are made up by a margin on the next row that is not pinned, up to the
487
+ * window's first, a negative one where a negative gap overlaps them: new props on a view native
488
+ * is moving put its transform back for a frame.
443
489
  */
444
- private leadWindow;
490
+ private placeAhead;
445
491
  private styleFor;
446
492
  /**
447
493
  * Hand each rendered sticky row's view to native to move. The rows' views are the canvas's
@@ -557,6 +603,18 @@ export declare class VirtualList<T> extends ScrollViewProps {
557
603
  scrollToEnd(options?: {
558
604
  animated?: boolean;
559
605
  }): void;
606
+ private sendScrollTo;
607
+ private sendScrollToEnd;
608
+ /** Send a scroll, and again once the rows are mounted if it stops short without them. */
609
+ private dispatchScroll;
610
+ /**
611
+ * Whether native may stop a scroll to `offset` short, `before` the bottom of the rows it has
612
+ * mounted. Android runs the commands it has waiting before it mounts the views it has waiting,
613
+ * so one sent after a render can run on the rows before it. iOS keeps them in order.
614
+ */
615
+ private stopsShort;
616
+ /** Follow what native has mounted: less at once, and more once the frames for it have run. */
617
+ private trackMounted;
560
618
  private slotStyle;
561
619
  protected onScroll(event: NativeSyntheticEvent<{
562
620
  contentOffset?: {
@@ -632,9 +690,12 @@ export declare class VirtualList<T> extends ScrollViewProps {
632
690
  * outside change detection and nothing else may be about to render.
633
691
  */
634
692
  private holdPastHeader;
635
- protected onContentSize(event: NativeSyntheticEvent<{
636
- width?: number;
637
- height?: number;
693
+ /**
694
+ * The content view was laid out: its size is the scroll view's content size, footer and all, as
695
+ * ScrollView.js reads it. Native sends a scroll view no `contentSizeChange` of its own.
696
+ */
697
+ protected onContentLayout(event: NativeSyntheticEvent<{
698
+ layout?: Size;
638
699
  }>): void;
639
700
  /** The scroll view's content along the axis, header and all. */
640
701
  private contentExtent;
@@ -649,7 +710,7 @@ export declare class VirtualList<T> extends ScrollViewProps {
649
710
  private reachable;
650
711
  private checkEnd;
651
712
  static ɵfac: i0.ɵɵFactoryDeclaration<VirtualList<any>, never>;
652
- static ɵcmp: i0.ɵɵComponentDeclaration<VirtualList<any>, "virtual-list", ["virtualList"], { "items": { "alias": "items"; "required": true; "isSignal": true; }; "itemHeight": { "alias": "itemHeight"; "required": false; "isSignal": true; }; "estimatedItemHeight": { "alias": "estimatedItemHeight"; "required": false; "isSignal": true; }; "contentPadding": { "alias": "contentPadding"; "required": false; "isSignal": true; }; "rowGap": { "alias": "rowGap"; "required": false; "isSignal": true; }; "keyExtractor": { "alias": "keyExtractor"; "required": false; "isSignal": true; }; "itemType": { "alias": "itemType"; "required": false; "isSignal": true; }; "maintainVisibleContentPosition": { "alias": "maintainVisibleContentPosition"; "required": false; "isSignal": true; }; "overscan": { "alias": "overscan"; "required": false; "isSignal": true; }; "windowSize": { "alias": "windowSize"; "required": false; "isSignal": true; }; "velocityLead": { "alias": "velocityLead"; "required": false; "isSignal": true; }; "endReachedThreshold": { "alias": "endReachedThreshold"; "required": false; "isSignal": true; }; "horizontal": { "alias": "horizontal"; "required": false; "isSignal": true; }; "inverted": { "alias": "inverted"; "required": false; "isSignal": true; }; "stickyIndices": { "alias": "stickyIndices"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; "keyboardShouldPersistTaps": { "alias": "keyboardShouldPersistTaps"; "required": false; "isSignal": true; }; "itemVisiblePercentThreshold": { "alias": "itemVisiblePercentThreshold"; "required": false; "isSignal": true; }; }, { "endReached": "endReached"; "viewableItemsChanged": "viewableItemsChanged"; }, ["separator", "refreshControl"], ["refresh-control", "[listHeader]", "*", "[listFooter]"], true, never>;
713
+ static ɵcmp: i0.ɵɵComponentDeclaration<VirtualList<any>, "virtual-list", ["virtualList"], { "items": { "alias": "items"; "required": true; "isSignal": true; }; "itemHeight": { "alias": "itemHeight"; "required": false; "isSignal": true; }; "estimatedItemHeight": { "alias": "estimatedItemHeight"; "required": false; "isSignal": true; }; "contentPadding": { "alias": "contentPadding"; "required": false; "isSignal": true; }; "rowGap": { "alias": "rowGap"; "required": false; "isSignal": true; }; "keyExtractor": { "alias": "keyExtractor"; "required": false; "isSignal": true; }; "itemType": { "alias": "itemType"; "required": false; "isSignal": true; }; "maintainVisibleContentPosition": { "alias": "maintainVisibleContentPosition"; "required": false; "isSignal": true; }; "overscan": { "alias": "overscan"; "required": false; "isSignal": true; }; "windowSize": { "alias": "windowSize"; "required": false; "isSignal": true; }; "velocityLead": { "alias": "velocityLead"; "required": false; "isSignal": true; }; "endReachedThreshold": { "alias": "endReachedThreshold"; "required": false; "isSignal": true; }; "horizontal": { "alias": "horizontal"; "required": false; "isSignal": true; }; "inverted": { "alias": "inverted"; "required": false; "isSignal": true; }; "stickyIndices": { "alias": "stickyIndices"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; "keyboardShouldPersistTaps": { "alias": "keyboardShouldPersistTaps"; "required": false; "isSignal": true; }; "itemVisiblePercentThreshold": { "alias": "itemVisiblePercentThreshold"; "required": false; "isSignal": true; }; }, { "endReached": "endReached"; "contentSizeChange": "contentSizeChange"; "viewableItemsChanged": "viewableItemsChanged"; }, ["separator", "refreshControl"], ["refresh-control", "[listHeader]", "*", "[listFooter]"], true, never>;
653
714
  }
654
715
  /**
655
716
  * Put on each row's view: `<view [virtualListRow]="row">`. Applies the row's style, and reports