@ng-native/fabric 0.5.0 → 0.6.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/dist/engine.d.ts CHANGED
@@ -589,6 +589,14 @@ export declare class Engine implements HostEngine {
589
589
  * does, a child list can move without anything else needing to be looked at again.
590
590
  */
591
591
  private structuralSheets;
592
+ /** How many children after a change in a list one of them reaches. See `siblingReach`. */
593
+ private structuralAfter;
594
+ /** Whether one of them reaches the children before it. */
595
+ private structuralBefore;
596
+ /** The compounds of theirs that read an element's place from under it. See `markPlace`. */
597
+ private readonly placeElsewhere;
598
+ /** The sheets `watchStructure` has read, which it is asked about once an element. */
599
+ private readonly watchedStructure;
592
600
  /** Whether any sheet uses `:has()`. See `markBeneath`. */
593
601
  private hasSheets;
594
602
  private readonly resolveAssetSource;
@@ -647,6 +655,12 @@ export declare class Engine implements HostEngine {
647
655
  * `replacing` is a sheet added before that this one takes the place of, after a hot swap.
648
656
  */
649
657
  addGlobalSheet(sheet: StyleSheet, replacing?: StyleSheet): boolean;
658
+ /**
659
+ * Have styled again each node a sheet just added could match. The rest keep the style they
660
+ * have, which the resolver lets stand for a node none of the sheet's rules is written for,
661
+ * so a commit steps over them: the walk here is what finds the ones it must not step over.
662
+ */
663
+ private markWrittenFor;
650
664
  /**
651
665
  * Stop matching a sheet `addGlobalSheet` added, and restyle everything; false, and nothing
652
666
  * done, when it is not one. A hot swap that leaves a None component no rules, or makes it scoped.
@@ -743,6 +757,21 @@ export declare class Engine implements HostEngine {
743
757
  createElement(name: string, sheet?: StyleSheet | null): EngineNode;
744
758
  addClass(node: EngineNode, name: string): void;
745
759
  removeClass(node: EngineNode, name: string): void;
760
+ /**
761
+ * Mark a node whose classes changed, by what the rules that name those classes can restyle.
762
+ *
763
+ * A class no selector names changes no style: a library's own marker, of an overlay that is
764
+ * animating or a control that was touched. One named only as what a rule's element is
765
+ * inside, `.animating .close`, restyles the elements under the node that such rules are for.
766
+ * Either way a whole subtree is not styled again for a class that has no say in it. Any other
767
+ * class restyles the node and everything under it, as any other change to it does.
768
+ *
769
+ * A sheet that names a class later restyles what it is for as it arrives, and a node not yet
770
+ * committed is styled when it is, with the class as it is then.
771
+ */
772
+ private markClasses;
773
+ /** Have styled again each element under a node that one of `subjects`' rules could be for. */
774
+ private markUnder;
746
775
  /**
747
776
  * The sheet of the component `node` hosts, whose `:host` rules it matches. Set again when a hot
748
777
  * swap replaces the component's sheet, which recreates the views inside but not the host, so the
@@ -853,6 +882,7 @@ export declare class Engine implements HostEngine {
853
882
  */
854
883
  setCustomProperty(node: EngineNode, name: string, value: unknown): void;
855
884
  setText(node: EngineNode, value: string): void;
885
+ private markFilled;
856
886
  setEventListener(node: EngineNode, topLevelType: string, fn: (event: unknown) => void): () => void;
857
887
  private markProps;
858
888
  /** Start matching ancestors again on a change, once a sheet that uses `:has()` is in play. */
@@ -864,8 +894,38 @@ export declare class Engine implements HostEngine {
864
894
  */
865
895
  private markBeneath;
866
896
  private markLaterSiblings;
867
- /** `node`'s child list changed: `moved` came into it or went out of it. */
897
+ /** `node`'s child list changed: `moved` came into it at `at`, or went out of it from there. */
868
898
  private markStructure;
899
+ /**
900
+ * Mark the children whose place in a child list that changed at `at` a sheet could read
901
+ * differently. The two at each end always, which are the old first and last and the new. Those
902
+ * from `at` on where some sheet counts from the start or asks about any one before, since a
903
+ * child's place from the start hangs only on those before it; and those before `at` where one
904
+ * counts from the end. Styling one again resolves everything under it again, so a long list
905
+ * gaining a row at its end is not the whole list.
906
+ *
907
+ * Where the sheets ask no further than the element just before (`+`), a rule steps a known
908
+ * number of elements along from one whose own match changed, and those are all there is to
909
+ * mark: that many after the change, and that many after the two at the start, either of which
910
+ * may have stopped or started being first. Nothing comes after the two at the end.
911
+ */
912
+ private markRepositioned;
913
+ /**
914
+ * A child's place in its list changed, which is all that changed about it. It is matched
915
+ * again, and keeps its style and all that is under it unless it now matches other rules: its
916
+ * place is read by the rules that style it and by no other. Not where a rule reads the place
917
+ * of an element like it from under it, `.row:nth-child(odd) .label`: that changes more than
918
+ * the element itself, which is then styled again with everything under it, as is a child
919
+ * that is no element.
920
+ */
921
+ private markPlace;
922
+ /**
923
+ * Whether a rule could read this element's place from another element. By its classes alone,
924
+ * which every such compound it could be asks for: a compound with none could be any element.
925
+ */
926
+ private placeReadFromUnder;
927
+ /** Note what a sheet coming into play asks about a child list. None is unset: see `structural`. */
928
+ private watchStructure;
869
929
  /** Walk up until we hit a node already known to have a dirty subtree. */
870
930
  private markPath;
871
931
  private isClean;
@@ -876,6 +936,15 @@ export declare class Engine implements HostEngine {
876
936
  * optimisation.
877
937
  */
878
938
  commit(): boolean;
939
+ private beforeCommit;
940
+ private announceCommit;
941
+ /**
942
+ * Run `run` once, as the next commit hands its tree to the host and before the host has it: the
943
+ * moment for something the host applies to its next commit, which is only this one from here.
944
+ * A pass that changes nothing commits nothing and runs nothing, so a request waits until it is
945
+ * taken back with the function returned. A later request replaces an earlier one.
946
+ */
947
+ beforeNextCommit(run: () => void): () => void;
879
948
  /** The first commit whose new views have not been drawn yet, while `commitUnseen` runs. */
880
949
  private unseen;
881
950
  /**
@@ -929,18 +998,30 @@ export declare class Engine implements HostEngine {
929
998
  * a tree that changes halfway through being walked is the one thing a commit cannot survive.
930
999
  */
931
1000
  private flushTransitionEvents;
1001
+ /**
1002
+ * The nodes whose animation has ended with no fill and is still held at its last frame, until
1003
+ * its `animationend` has been heard. A browser runs that listener before it paints again, and
1004
+ * an exit animation's listener takes the element away: it is never seen back at rest. Here the
1005
+ * listener runs after the commit, so the commit that ends the animation paints the last frame,
1006
+ * and the element goes back to rest once the listener has run and left it there.
1007
+ */
1008
+ private readonly lettingGo;
1009
+ private letGo;
932
1010
  /** Anchors take part in sibling ordering but never reach Fabric. */
933
1011
  private visibleChildren;
934
1012
  /**
935
1013
  * Everything a node renders with, unprocessed. Precedence, weakest first: native defaults, the
936
1014
  * node's `defaultStyle`, matched CSS, explicit props, inline style, a component's
937
- * `styleOverride`. Inline wins over CSS for the same reason it does on the web.
1015
+ * `styleOverride`. Inline wins over CSS as it does on the web, but for a declaration marked
1016
+ * `!important`, which stands over it: see `inlineOf`.
938
1017
  *
939
1018
  * Raw, because this is what the next commit diffs against. Colours and asset ids are converted
940
1019
  * on the way out instead (`processed`), and only for the keys that changed: the converters
941
1020
  * return fresh objects, so diffing their output would re-send every image and shadow on every
942
1021
  * unrelated change.
943
1022
  */
1023
+ /** What a touch on an element that keeps a drag holds off, while it lasts: see `holdSwipe`. */
1024
+ private heldFor;
944
1025
  private mergeProps;
945
1026
  /**
946
1027
  * Leave a node's background out of what it commits when a child paints it, and give that child
@@ -1045,6 +1126,27 @@ export declare class Engine implements HostEngine {
1045
1126
  * runs it frame by frame, and JavaScript hears of it again when it ends. Anything else is
1046
1127
  * played from here, a commit a frame. See `NativeScrollDriver.play`.
1047
1128
  */
1129
+ /**
1130
+ * The nodes whose animation moves them by a share of their own size and had no size yet when
1131
+ * it started, each with the style it rests at: asked again once the commit has laid them out.
1132
+ */
1133
+ private readonly unsized;
1134
+ /**
1135
+ * An animation's frames as native can interpolate them: a move by a share of the box,
1136
+ * `translateX(200%)`, as the points that is of the size the view is laid out at. Nothing where
1137
+ * the view has no size yet, which is every view until its first commit: it is played from
1138
+ * JavaScript, and handed over once that commit has laid it out. See `playSized`.
1139
+ *
1140
+ * ponytail: the size it had when it started. A box that changes size goes on moving by the
1141
+ * points of the old one until the animation starts again; restart it from the box's layout
1142
+ * event if a bar that resizes mid-animation comes up.
1143
+ */
1144
+ private sized;
1145
+ /**
1146
+ * Hand to native each animation that was waiting for its view to have a size. The commit just
1147
+ * made painted its first frame, so its clock starts here: no frame of it has been seen move.
1148
+ */
1149
+ private playSized;
1048
1150
  private playNatively;
1049
1151
  /**
1050
1152
  * Native reached the end of an animation it was playing. The frame it ends at, or the resting
@@ -1112,6 +1214,13 @@ export declare class Engine implements HostEngine {
1112
1214
  private reportHeld;
1113
1215
  private reportMissingKeyframes;
1114
1216
  private transitioned;
1217
+ /**
1218
+ * Whether an animation that has finished goes on holding its last frame. With a forwards fill
1219
+ * it does, for good: without one the element falls back to whatever the cascade gives it, and
1220
+ * 'backwards' fills the start only. Heard, it holds until whoever listens has been told: see
1221
+ * `lettingGo`.
1222
+ */
1223
+ private keeps;
1115
1224
  /** One `@keyframes` player, one frame on. */
1116
1225
  private advancePlayer;
1117
1226
  /**
@@ -1207,6 +1316,20 @@ export declare class Engine implements HostEngine {
1207
1316
  * when it is shown again, as Modal.js creates it afresh. Committed again, it ignores every touch.
1208
1317
  */
1209
1318
  private withheld;
1319
+ /**
1320
+ * Whether an element is `display: none`, which has no box and so no view, nor has anything
1321
+ * in it. A view that is committed and not displayed looks the same, but Yoga marks one as
1322
+ * laid out each time it measures what holds it, and React Native clears the mark only where it
1323
+ * reads that parent's layout: a debug build stops at the mark, on a later commit that has the
1324
+ * parent's layout already. Shown again it is made again, as an element put back in the tree
1325
+ * is: what its views held of their own, a scroll offset, is not kept.
1326
+ */
1327
+ private undisplayed;
1328
+ /**
1329
+ * Whether a node hoisted into `target` is not displayed where it was written: it, or a box
1330
+ * between it and the child of `target` it was written in. That child is asked before this is.
1331
+ */
1332
+ private undisplayedUnder;
1210
1333
  /**
1211
1334
  * `reconcileChildren` for a node other nodes hoist into: its own children, each followed by
1212
1335
  * the hoisted nodes written inside it, then those written in it directly, then the views it
@@ -1444,6 +1567,43 @@ export declare class Engine implements HostEngine {
1444
1567
  * bubble for the rest, as in the DOM.
1445
1568
  */
1446
1569
  dispatchEvent(instanceHandle: unknown, topLevelType: string, nativeEvent: unknown): void;
1570
+ /** The screen whose swipe back is held off while a finger is on what keeps a sideways drag. */
1571
+ private swipeHeld;
1572
+ /**
1573
+ * Hold a screen's swipe back off for a touch that starts on an element whose `touch-action`
1574
+ * keeps a drag to the side for itself, and give it back when the last finger lifts. From iOS
1575
+ * 26 the swipe starts anywhere on a screen once a finger has moved a little to the right, and
1576
+ * takes the touch from whatever was following it: a slider's thumb stops and the screen
1577
+ * leaves. The screen is told before the finger has moved that far.
1578
+ */
1579
+ private holdSwipe;
1580
+ /**
1581
+ * A touch on an element that keeps a drag to the side: where it began, and whether native's
1582
+ * own gestures are held off for it. Held from the start where the element keeps a drag down
1583
+ * the page too (`none`); from the moment the finger sets off across where it leaves that one
1584
+ * to the page (`pan-y`), and never for that touch where it sets off down.
1585
+ */
1586
+ private drag;
1587
+ private holdFrom;
1588
+ /** The scroll view whose scrolling is off while a drag over it is an element's own. */
1589
+ private scrollHeld;
1590
+ /**
1591
+ * Stop the scroll view a node is in from scrolling, until the touch ends. Telling native who
1592
+ * holds the touch does this on Android. On iOS a scroll view is held off only by a responder
1593
+ * that is over it, never one inside it, so it is told not to scroll.
1594
+ */
1595
+ private holdScroll;
1596
+ /** Settle which way a drag set off, and hold native's own off one that set off across. */
1597
+ private settleDrag;
1598
+ /** Give the swipe back once the last finger has lifted. */
1599
+ private releaseSwipe;
1600
+ /**
1601
+ * Commit a screen or a scroll view again now, not with whatever next changes: the swipe begins
1602
+ * once the finger has moved ten points or so, which is a frame or two after it came down.
1603
+ */
1604
+ private tellScreen;
1605
+ /** The screen of a native stack a node is on, or nothing where it is on none. */
1606
+ private screenOf;
1447
1607
  /** A presented modal host has finished leaving, so a hidden one can come out of the tree. */
1448
1608
  private dismissed;
1449
1609
  private reportEventError;