@ng-native/fabric 0.13.0 → 0.14.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
@@ -186,8 +186,8 @@ interface Committed {
186
186
  export interface EngineNode extends HostNode {
187
187
  readonly kind: NodeKind;
188
188
  /** Lowercase template spelling, e.g. `view`. Never the native view name. */
189
- readonly name: string;
190
- /** `name` again, for Angular 22.0, which reads it on a component's host element. */
189
+ readonly tag: string;
190
+ /** `tag` again, for Angular 22.0, which reads it on a component's host element. */
191
191
  readonly tagName: string;
192
192
  props: Record<string, unknown>;
193
193
  text: string;
@@ -269,6 +269,14 @@ export interface EngineNode extends HostNode {
269
269
  playing?: RunningAnimation;
270
270
  /** An animation played by a scroll view's offset rather than the clock. See `scrollAnimated`. */
271
271
  scrolled?: ScrollAnimation;
272
+ /**
273
+ * The props a native animated graph has set on the view with this tag, which no commit
274
+ * changes again: see `Touched`. A view made again has another tag, and starts with none.
275
+ */
276
+ owned?: {
277
+ readonly tag: number;
278
+ readonly keys: Set<string>;
279
+ };
272
280
  /**
273
281
  * The last `transform` built from the individual transform properties, and what it was built
274
282
  * from. Reused while the parts are the same objects, so an unrelated change does not re-send it.
@@ -403,7 +411,16 @@ export interface ViewNameOptions {
403
411
  * element is the engine's own, as the paragraph a view is given for its loose text is.
404
412
  */
405
413
  readonly looseText?: string;
414
+ /**
415
+ * Where a view's own props name a font that must reach native by another name, as SwiftUI's
416
+ * `font` modifier must name a face by its file's PostScript name: rewrites `props` in place,
417
+ * given that name for each name the app's `@font-face` faces are registered under. Called on
418
+ * every commit of the view, and again for each view when the faces change.
419
+ */
420
+ readonly fontNames?: (props: Record<string, unknown>, postScriptName: PostScriptNames) => void;
406
421
  }
422
+ /** The PostScript name of the face a name is registered under, where the build read it. */
423
+ export type PostScriptNames = (name: string) => string | undefined;
407
424
  /**
408
425
  * A view whose native name differs by platform. Chosen when the view is looked up rather than when
409
426
  * it is registered, so it does not matter which ran first: an app's imports register the router's
@@ -457,6 +474,25 @@ export interface HoistOptions {
457
474
  * another, so what the native side sees is one config that is updated, never one that goes.
458
475
  */
459
476
  standIn?: Record<string, unknown>;
477
+ /**
478
+ * Have the ancestor commit the elements hoisted into it and nothing else, in the order they
479
+ * were written.
480
+ *
481
+ * For a native component that takes children of one type only. `RNSScreenStackHeaderConfig`
482
+ * takes `RNSScreenStackHeaderSubview`s: iOS logs an error and drops any other child, and Android
483
+ * throws. A header item written inside a component of the header reached it inside that
484
+ * component's host view.
485
+ */
486
+ only?: boolean;
487
+ /**
488
+ * Ancestor names the element never hoists past: met before the ancestor it commits into, it
489
+ * commits where it is, as one with no such ancestor does.
490
+ *
491
+ * For an ancestor the target is not meant to reach through. A tab's page with no stack of its
492
+ * own has no screen of its own, and the screen above its tab is the one that holds the whole
493
+ * tab bar, so a header written in that page must not configure it.
494
+ */
495
+ stopAt?: readonly string[];
460
496
  }
461
497
  /** A native view an ancestor keeps for a hoisted name with a stand-in, and who it is for now. */
462
498
  interface KeptHoist {
@@ -467,7 +503,7 @@ interface KeptHoist {
467
503
  /** The part of a node `viewNameOf` reads: an engine node, or any host's mirror of one. */
468
504
  export interface ViewNameNode {
469
505
  readonly kind: string;
470
- readonly name: string;
506
+ readonly tag: string;
471
507
  readonly parent: ViewNameNode | null;
472
508
  /** Whether a component is mounted on it, and whether that component is the native view. */
473
509
  readonly componentHost?: boolean;
@@ -650,6 +686,8 @@ export declare class Engine implements HostEngine {
650
686
  * binding, so nothing marks an Angular view dirty and no change-detection pass would follow.
651
687
  */
652
688
  private setActiveChain;
689
+ /** The nodes a press has set `:active` on, to clear whatever happens to the tree meanwhile. */
690
+ private readonly activeNodes;
653
691
  /** Whether any sheet styles a pressed element, and each compound that asks about one from another. */
654
692
  private activeUse;
655
693
  /** What each sheet in play asks about a pressed element: `activeUse` is all of them together. */
@@ -800,6 +838,20 @@ export declare class Engine implements HostEngine {
800
838
  * committed is styled when it is, with the class as it is then.
801
839
  */
802
840
  private markClasses;
841
+ /**
842
+ * How many class changes have restyled what is under an element. `markUnder` walks the tree as
843
+ * it is, so an element out of it then is not reached: one that comes back after any is matched
844
+ * again, with all that is under it.
845
+ */
846
+ private classesAbove;
847
+ /**
848
+ * The count when each element went out of the tree, for the ones still out. `detach` sets it
849
+ * for a node that only moves too, so `markReturned` runs after it and clears that.
850
+ */
851
+ private readonly outSince;
852
+ /** Have matched again a node coming back into the tree that missed a class change above it. */
853
+ private markReturned;
854
+ private markAllUnder;
803
855
  /**
804
856
  * Have matched again each element under a node that one of `subjects`' rules could be for. One
805
857
  * under another is marked too: what is under an element marked this way keeps its rules.
@@ -873,6 +925,13 @@ export declare class Engine implements HostEngine {
873
925
  * forgetting walks each subtree that left once.
874
926
  */
875
927
  private releaseDetached;
928
+ /** A pressed node out of the tree gets no release: native has no view to end the touch on. */
929
+ private dropDetachedPress;
930
+ /**
931
+ * Forget the focused node, which has left the tree without a blur: off the node as well as the
932
+ * engine, or a `:focus` rule styles it again when it is put back.
933
+ */
934
+ private dropFocus;
876
935
  /** Forget the committed views of each node removed since the last commit that is still out. */
877
936
  private forgetDetached;
878
937
  /** The root of the tree a node is in: the engine's root while it is attached. */
@@ -885,6 +944,18 @@ export declare class Engine implements HostEngine {
885
944
  destroyNode(node: EngineNode): void;
886
945
  parentNode(node: EngineNode): EngineNode | null;
887
946
  nextSibling(node: EngineNode): EngineNode | null;
947
+ /**
948
+ * Whether any declaration the engine was given transitions or animates: until one does, a
949
+ * node's style is committed as it is, with nothing asked of what eases it. See `eased`.
950
+ */
951
+ private eases;
952
+ private noteEasing;
953
+ /** A node's style as its transitions and animation have it: a declaration asks for one. */
954
+ private eased;
955
+ /** Note a sheet any of whose rules transitions or animates: see `eases`. */
956
+ private noteSheetEasing;
957
+ /** Note a prop, or a style set as one, that transitions or animates: see `eases`. */
958
+ private noteEasingProp;
888
959
  setProp(node: EngineNode, key: string, value: unknown): void;
889
960
  /**
890
961
  * Have the paragraph a run of text is in merged again: it is as tall as the tallest line of
@@ -922,11 +993,15 @@ export declare class Engine implements HostEngine {
922
993
  */
923
994
  styleChanged(node: EngineNode): void;
924
995
  /**
925
- * A bound declaration, `[style.color]`, whose value may be a `var()`. One that is, is kept as a
926
- * declaration the cascade settles with the node's tokens, as a rule's is, and true is answered:
927
- * the text is no value to put in the node's style. Any other value forgets what was kept.
996
+ * A bound declaration, `[style.color]`, whose value may be a `var()`, or a length in `em` or a
997
+ * viewport unit. One that is, is kept as a declaration the cascade settles with the node's
998
+ * tokens, font size and viewport, as a rule's is, and true is answered: the text is no value to
999
+ * put in the node's style. A negative `line-height` is dropped, with a warning, and true is
1000
+ * answered too. Any other value forgets what was kept.
928
1001
  */
929
1002
  setBoundStyle(node: EngineNode, prop: string, value: unknown): boolean;
1003
+ /** Whether a bound value is one CSS has none of, which is dropped with a warning. */
1004
+ private refusedBound;
930
1005
  /**
931
1006
  * Set a custom property on a node, `--tint` from `[style.--tint]`, or remove it with `null`.
932
1007
  *
@@ -1007,6 +1082,9 @@ export declare class Engine implements HostEngine {
1007
1082
  * optimisation.
1008
1083
  */
1009
1084
  commit(): boolean;
1085
+ /** A field went out of view focused, in the commit running: see `undisplayed`. */
1086
+ private blurAfterCommit;
1087
+ private blurHidden;
1010
1088
  private beforeCommit;
1011
1089
  private announceCommit;
1012
1090
  /**
@@ -1193,6 +1271,7 @@ export declare class Engine implements HostEngine {
1193
1271
  private markAnimated;
1194
1272
  /** Every `@font-face` seen, global as on the web: a face declared in one sheet serves all. */
1195
1273
  private readonly fontFaces;
1274
+ private readonly postScriptName;
1196
1275
  /** Whether a sheet first used in this commit declared a face. See `rematchFonts`. */
1197
1276
  private facesAdded;
1198
1277
  /**
@@ -1273,10 +1352,24 @@ export declare class Engine implements HostEngine {
1273
1352
  private playNatively;
1274
1353
  /**
1275
1354
  * Native reached the end of an animation it was playing. The frame it ends at, or the resting
1276
- * style where it does not fill, is committed before the view is let go, so nothing shows of
1277
- * the frame it started at, which is what the view had been committed with.
1355
+ * style where it does not fill, is committed, and set on native where the animation set the
1356
+ * prop (see `setOwned`). The view is let go first, which puts nothing back on Fabric: it is
1357
+ * drawn where the animation left it until then.
1278
1358
  */
1279
1359
  private endedNatively;
1360
+ /** A graph of native's was connected to a view: see `Touched`. */
1361
+ private touchedNatively;
1362
+ /**
1363
+ * Set on native a change of a prop a graph of native's has set on the view before, while no
1364
+ * graph of its holds it: the commit cannot change it (see `Touched`). The payload is committed
1365
+ * as well, so the shadow node is as the view is drawn. A transform native cannot take as
1366
+ * numbers, a matrix, is left committed alone.
1367
+ */
1368
+ private setOwned;
1369
+ /** The size a view is laid out at, where it has been. */
1370
+ private boxSize;
1371
+ /** Forget the props native set on a node's view, which is gone or made again. */
1372
+ private disown;
1280
1373
  /** Take an animation back from native, which stops it there. The caller plays it on, or not. */
1281
1374
  private stopNative;
1282
1375
  /**
@@ -1339,6 +1432,13 @@ export declare class Engine implements HostEngine {
1339
1432
  private reportHeld;
1340
1433
  private reportMissingKeyframes;
1341
1434
  private transitioned;
1435
+ /**
1436
+ * What a view was last painted with, by property, for a transition that arrives with the change
1437
+ * it eases: CSS takes the transition from the style after the change and eases from the value
1438
+ * before it. Nothing for a view nobody has seen yet, which starts where it is. The individual
1439
+ * transforms are read back from the parts the painted transform was put together from.
1440
+ */
1441
+ private paintedBefore;
1342
1442
  /** Nobody saw what the last commit gave a view it created, so this is where the view starts. */
1343
1443
  private unseenTransitions;
1344
1444
  /** The elements native is playing a transition of. */
@@ -1367,6 +1467,17 @@ export declare class Engine implements HostEngine {
1367
1467
  * A width eased from JavaScript is a commit a frame, and a commit lays the whole screen out.
1368
1468
  */
1369
1469
  private layEased;
1470
+ /** When each size in transition was last started, and how many starts in a row came soon. */
1471
+ private readonly laidStarts;
1472
+ /**
1473
+ * Whether a transition of a size is one sent on again and again, each before the last had
1474
+ * ended: a progress bar that steps every 50ms and eases each step over 150. Native moves the
1475
+ * view, and lays the screen out, every frame while a layout animation runs, so one started at
1476
+ * every step is one that never stops. The first, and one sent back before it ends, are
1477
+ * played; from the second sent on in a row, each is committed where it ends, and the steps
1478
+ * are the motion. Played again once the size has been left alone for as long as it lasts.
1479
+ */
1480
+ private sentOnAgain;
1370
1481
  /** The animations this commit lays out at their last frame, for native to move the views to. */
1371
1482
  private laidPlayed;
1372
1483
  /**
@@ -1427,6 +1538,8 @@ export declare class Engine implements HostEngine {
1427
1538
  * `lettingGo`.
1428
1539
  */
1429
1540
  private keeps;
1541
+ /** Whether a node, or an element it is in, is `display: none`. */
1542
+ private boxless;
1430
1543
  /** One `@keyframes` player, one frame on. */
1431
1544
  private advancePlayer;
1432
1545
  /**
@@ -1563,6 +1676,11 @@ export declare class Engine implements HostEngine {
1563
1676
  * keeps for hoisted nodes that are gone.
1564
1677
  */
1565
1678
  private reconcileHoistTarget;
1679
+ /**
1680
+ * `reconcileHoistTarget` for a node that commits only what is hoisted into it
1681
+ * (`HoistOptions.only`): those nodes, in the order they were written, and none of its own.
1682
+ */
1683
+ private reconcileOnlyHoisted;
1566
1684
  /**
1567
1685
  * A child's handle as a child of `parent`, created again when it was committed under another.
1568
1686
  *
@@ -1596,6 +1714,17 @@ export declare class Engine implements HostEngine {
1596
1714
  * itself so the native side sees an update rather than a removal.
1597
1715
  */
1598
1716
  private standIn;
1717
+ /**
1718
+ * What a hoist target takes of a child written in it: the child's handle, `direct` for one
1719
+ * hoisted into it, which goes after its siblings, or null for none.
1720
+ */
1721
+ private takenByTarget;
1722
+ /**
1723
+ * A clean element's handle under `parent`, before anything else is asked of it: one committed
1724
+ * there and unchanged since was displayed and in its place, and is still. The siblings of what
1725
+ * changed are most of what a commit steps over: a list one row of which ticks.
1726
+ */
1727
+ private cleanUnder;
1599
1728
  /** A clean child's committed handle, when its style still holds under its parent's. */
1600
1729
  private stillCommitted;
1601
1730
  /**
@@ -1622,6 +1751,12 @@ export declare class Engine implements HostEngine {
1622
1751
  private readonly undefinedTokens;
1623
1752
  /** Said once per name: a phone has no inspector to show the declaration struck out. */
1624
1753
  private reportUndefinedToken;
1754
+ private readonly droppedDeclarations;
1755
+ /**
1756
+ * A declaration in a style, written or bound, that is no value its property takes, so it is
1757
+ * dropped as a browser drops it. Said once per element name and declaration, in development.
1758
+ */
1759
+ reportDroppedDeclaration(prop: string, value: string, on: string, why: string): void;
1625
1760
  private readonly unreadDisplays;
1626
1761
  /**
1627
1762
  * Said once per token and value: the compiler refuses `display: grid` written out, but a token