@ng-native/fabric 0.8.0 → 0.10.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
@@ -206,6 +206,8 @@ export interface EngineNode extends HostNode {
206
206
  styleCache: StyleCache | null;
207
207
  /** Set when something that could change what this node matches has changed. */
208
208
  styleDirty: boolean;
209
+ /** See `StyleTarget.ownDirty`. */
210
+ ownDirty: boolean;
209
211
  /** See `StyleTarget.hasDirty`. */
210
212
  hasDirty: boolean;
211
213
  /** See `StyleTarget.stateDirty`. */
@@ -321,6 +323,10 @@ export interface EngineNode extends HostNode {
321
323
  baselineFields?: Set<EngineNode>;
322
324
  /** Commit this node again with its children so Fabric measures it again. `remeasureText`. */
323
325
  remeasure?: true;
326
+ /** On a paragraph, whether its text was one word when it was last merged: `wholeWords`. */
327
+ oneWord?: boolean;
328
+ /** The z-index this view is drawn at for a box in it, where it has none: `Engine.raise`. */
329
+ raised?: number;
324
330
  /**
325
331
  * A modal host committed as visible on iOS whose dismissal native has not yet reported. It
326
332
  * stays committed after `visible` goes false until `topDismiss`, as React Native's Modal.js
@@ -777,16 +783,21 @@ export declare class Engine implements HostEngine {
777
783
  * Mark a node whose classes changed, by what the rules that name those classes can restyle.
778
784
  *
779
785
  * A class no selector names changes no style: a library's own marker, of an overlay that is
780
- * animating or a control that was touched. One named only as what a rule's element is
781
- * inside, `.animating .close`, restyles the elements under the node that such rules are for.
782
- * Either way a whole subtree is not styled again for a class that has no say in it. Any other
783
- * class restyles the node and everything under it, as any other change to it does.
786
+ * animating or a control that was touched. One a rule is for the element of, `.on`, has that
787
+ * element matched again, and one named as what a rule's element is inside, `.animating .close`
788
+ * or `.close:is(.animating *)`, the elements under the node that such rules are for. What is
789
+ * under any of those is styled again from the rules it matched, for what it inherits: a `dark`
790
+ * class on the root finds no rule again for an element no `dark` rule is for. Any other class
791
+ * has the node and everything under it matched again, as any other change to it does.
784
792
  *
785
793
  * A sheet that names a class later restyles what it is for as it arrives, and a node not yet
786
794
  * committed is styled when it is, with the class as it is then.
787
795
  */
788
796
  private markClasses;
789
- /** Have styled again each element under a node that one of `subjects`' rules could be for. */
797
+ /**
798
+ * Have matched again each element under a node that one of `subjects`' rules could be for. One
799
+ * under another is marked too: what is under an element marked this way keeps its rules.
800
+ */
790
801
  private markUnder;
791
802
  /**
792
803
  * The sheet of the component `node` hosts, whose `:host` rules it matches. Set again when a hot
@@ -800,19 +811,35 @@ export declare class Engine implements HostEngine {
800
811
  * the web's mount point has, unless the app's `:host` sizes it otherwise.
801
812
  */
802
813
  setDefaultStyle(node: EngineNode, style: Readonly<Record<string, unknown>> | undefined): void;
803
- /** `class="a b"` from a template. Replaces the set rather than adding to it. */
814
+ /**
815
+ * `class="a b"` from a template. Replaces the set rather than adding to it. The same classes in
816
+ * another order are a change too, to a selector that reads the class attribute, `[class^="a"]`.
817
+ */
804
818
  setClasses(node: EngineNode, value: string): void;
805
819
  /** Angular's `@if`/`@for`/`ViewContainerRef` markers. Ordered, never committed. */
806
820
  createAnchor(): EngineNode;
807
821
  createText(value: string): EngineNode;
808
822
  appendChild(parent: EngineNode, child: EngineNode): void;
809
823
  insertBefore(parent: EngineNode, child: EngineNode, ref: EngineNode | null): void;
824
+ /**
825
+ * A node coming under a parent other than the one it is under, or under any once it has been
826
+ * taken out: what is over it may be other than it was styled under. The resolver sees that for
827
+ * itself by the parent's cache, except between two boxes that share one, where it is told here.
828
+ * Moved within its own parent, a row of a list reordered, it is styled as it was.
829
+ */
830
+ private markAdopted;
810
831
  removeChild(parent: EngineNode | null, child: EngineNode): void;
811
832
  /**
812
833
  * A child came or went under a view that takes its text as a prop: that prop changed. A span
813
834
  * changes it too, by keeping or dropping the space before it.
814
835
  */
815
836
  private markTextContent;
837
+ /**
838
+ * Text came, went or changed in a paragraph: where it has become one word, or stopped being
839
+ * one, the paragraph is merged again, since that is one line or as many as it takes. Asked
840
+ * of the paragraph's outermost element, which is the view; any other change leaves it be.
841
+ */
842
+ private markWords;
816
843
  /** A subtree that went out of the tree is back in: its hoisted nodes commit again. */
817
844
  private wakeHoists;
818
845
  /**
@@ -853,6 +880,11 @@ export declare class Engine implements HostEngine {
853
880
  parentNode(node: EngineNode): EngineNode | null;
854
881
  nextSibling(node: EngineNode): EngineNode | null;
855
882
  setProp(node: EngineNode, key: string, value: unknown): void;
883
+ /**
884
+ * Have the paragraph a run of text is in merged again: it is as tall as the tallest line of
885
+ * its runs, by a line height or a text scaling set on one of them. See `lineTall`.
886
+ */
887
+ private markParagraph;
856
888
  /**
857
889
  * Paint a node's background on one of its children instead of on the node: the node keeps its
858
890
  * `background-color` and `background-image` in the cascade, where a stylesheet wrote them, and
@@ -909,6 +941,23 @@ export declare class Engine implements HostEngine {
909
941
  * which would restyle everything under them. Only sheets that use `:has()` pay.
910
942
  */
911
943
  private markBeneath;
944
+ /**
945
+ * The boxes rules ask `:has()` of above the node they style, `.card:has(.x) .title`, by the
946
+ * sheet that asks: a sheet replaced or taken away asks no more.
947
+ */
948
+ private readonly hasReaders;
949
+ /** The nodes something changed beneath since the last commit, where any sheet has such a rule. */
950
+ private readonly changedBeneath;
951
+ /**
952
+ * Have matched again what is under each box that changed beneath and that such a rule could
953
+ * be asking: the nodes the rule is for, and no other. Once for a commit, however many changes
954
+ * there were beneath the box: a table gains its rows one at a time.
955
+ */
956
+ private markUnderHas;
957
+ /**
958
+ * What `node` matches changed, which the elements after it can read: as many of them as a rule
959
+ * steps along from one, every one for a `~`, and none where no sheet steps at all.
960
+ */
912
961
  private markLaterSiblings;
913
962
  /** `node`'s child list changed: `moved` came into it at `at`, or went out of it from there. */
914
963
  private markStructure;
@@ -1039,6 +1088,40 @@ export declare class Engine implements HostEngine {
1039
1088
  /** What a touch on an element that keeps a drag holds off, while it lasts: see `holdSwipe`. */
1040
1089
  private heldFor;
1041
1090
  private mergeProps;
1091
+ /**
1092
+ * The z-index a view is drawn at for the boxes in it: the highest of theirs. A browser draws a
1093
+ * box with a z-index over what follows the boxes it is in, and a native view is ordered among
1094
+ * the views beside it and no further, so each view the box is in is raised as far. Read from
1095
+ * what its children committed, which for a raised child is what raised it. A child with a
1096
+ * z-index of its own answers with that and nothing from inside it, as the stacking context it
1097
+ * is. Only a plain view is raised: a scroll view clips what is in it, and a screen is ordered
1098
+ * by its stack.
1099
+ *
1100
+ * ponytail: a z-index is the one thing read as making a stacking context. Opacity and a
1101
+ * transform make one in a browser too; read them here if a box is ever raised past one.
1102
+ */
1103
+ private raisedBy;
1104
+ /** Read how far a view is raised, once its children are committed: its props are, if it moved. */
1105
+ private raise;
1106
+ /**
1107
+ * Draw a border that has a width and no colour in the colour of the text, as a browser does:
1108
+ * `border-color` starts as `currentColor`, and native starts it as black. Each side with a
1109
+ * width, where nothing gave that side a colour. Left to native where there is no text colour
1110
+ * to take, which is black in a browser too.
1111
+ */
1112
+ private borderInText;
1113
+ /**
1114
+ * The tallest line, as the system text size draws it, of the runs of text in a paragraph:
1115
+ * none is 0. A run scales as what it is in does, `within`, but for what it says of that
1116
+ * itself: one that does not scale, or stops at a size, beside text that does.
1117
+ */
1118
+ private tallestRun;
1119
+ /**
1120
+ * Keep a paragraph whose text has nowhere to wrap on one line, as a browser does: a word is
1121
+ * not broken inside, and what does not fit is past the edge. Native breaks a word wider than
1122
+ * its line between any two letters. Cut at the edge, where no rule says how it ends.
1123
+ */
1124
+ private wholeWords;
1042
1125
  /**
1043
1126
  * Leave a node's background out of what it commits when a child paints it, and give that child
1044
1127
  * its parent's: the cascade's, and over it the parent's inline style.
@@ -1122,6 +1205,24 @@ export declare class Engine implements HostEngine {
1122
1205
  * own frames, which is what lets an element animate in without differing from anything.
1123
1206
  */
1124
1207
  private animated;
1208
+ /**
1209
+ * The keyframes a node's animation names: those of its own component's sheet where it has
1210
+ * some by that name, as Angular scopes a component's keyframes in a browser, and otherwise
1211
+ * whichever sheet has them, since any other is global.
1212
+ *
1213
+ * ponytail: a host is asked of the sheet it is written in before its own component's, so
1214
+ * a `:host` animation is played by its parent's frames where both have the name.
1215
+ */
1216
+ private keyframesOf;
1217
+ /** Each node's frames as they settle on it, kept for as long as they settle the same. */
1218
+ private readonly settledFrames;
1219
+ /**
1220
+ * An animation's frames for the node playing it: those with a value that waits for the node,
1221
+ * a `var()` it sets, settled against it. The same frames are answered while they settle the
1222
+ * same, and others once a variable changes, which is what an animation under way is played
1223
+ * on from: see `reframe`.
1224
+ */
1225
+ private framesFor;
1125
1226
  /**
1126
1227
  * A clock animation the scroll plays instead: the same animation where only the timeline moved,
1127
1228
  * and one cancelled where the name changed.
@@ -1179,6 +1280,8 @@ export declare class Engine implements HostEngine {
1179
1280
  private backToScript;
1180
1281
  /** Start the clock on an animation, unless the node is already playing this one. */
1181
1282
  private startPlaying;
1283
+ /** Play an animation that has just started: by native's layout, by native's driver, or here. */
1284
+ private playSomewhere;
1182
1285
  /**
1183
1286
  * The colour `node` inherits, for frames that set `color: currentColor`, which is that colour
1184
1287
  * wherever the animation has got to, as in CSS. Undefined for frames that do not.
@@ -1258,12 +1361,27 @@ export declare class Engine implements HostEngine {
1258
1361
  * A width eased from JavaScript is a commit a frame, and a commit lays the whole screen out.
1259
1362
  */
1260
1363
  private layEased;
1364
+ /** The animations this commit lays out at their last frame, for native to move the views to. */
1365
+ private laidPlayed;
1366
+ /**
1367
+ * Whether an animation that has just started is one native can play by laying the view out
1368
+ * at its last frame: two frames of sizes or places, played once from where the view is drawn
1369
+ * now, which is where native moves it from. It is then committed at that frame; see `layOut`.
1370
+ */
1371
+ private layPlayed;
1372
+ /** Go on from JavaScript with an animation native was to lay out, by the clock it started on. */
1373
+ private playLaidHere;
1374
+ /** An animation native laid out has had its time: it is at its last frame, and says so. */
1375
+ private endLaidPlayed;
1261
1376
  /**
1262
- * Before a commit is handed over: ask native to move what it lays out, or take the
1263
- * transitions back to ease them from JavaScript where the commit moves anything else, and
1264
- * where they would not all take as long. Answers whether the tree has to be reconciled again.
1377
+ * Before a commit is handed over: ask native to move what it lays out, and take back to
1378
+ * ease from JavaScript whatever it cannot: all of it where the commit moves anything else,
1379
+ * and otherwise what would not take as long as the longest. Answers whether the tree has to
1380
+ * be reconciled again.
1265
1381
  */
1266
1382
  private layOut;
1383
+ /** Ask native to move what the commit lays out over `duration`, and end each when it is up. */
1384
+ private askLayout;
1267
1385
  /**
1268
1386
  * Note a commit that resizes or moves a box in no transition native lays out: a prop of one
1269
1387
  * that moves boxes, children that came or went, text longer or shorter than it was.