@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/css.d.ts CHANGED
@@ -30,7 +30,7 @@ export interface Compound {
30
30
  readonly not?: readonly Compound[];
31
31
  /** `:host`: the node must be the host of the component whose sheet is being evaluated. */
32
32
  readonly host?: true;
33
- /** `:host-context()`: the host, or one of its ancestors, must match one of these. */
33
+ /** `:host-context()`, once for each written: the host, or one of its ancestors, must match it. */
34
34
  readonly hostContext?: readonly Compound[];
35
35
  /**
36
36
  * `:is(<compound> *)`: every one of these must match some ancestor, the node itself excluded.
@@ -51,6 +51,11 @@ export interface Compound {
51
51
  readonly nth?: readonly NthTest[];
52
52
  /** `:empty`: no children at all, text included. */
53
53
  readonly empty?: true;
54
+ /**
55
+ * What a `::ng-deep` is written after: an element of the component the sheet is of, or its
56
+ * host. A rule with one is for what is under it, in other components' views too.
57
+ */
58
+ readonly own?: true;
54
59
  /** `:has()`: every one of these must find a match beneath the node. */
55
60
  readonly has?: readonly HasTest[];
56
61
  }
@@ -65,6 +70,8 @@ export interface NthTest {
65
70
  readonly a: number;
66
71
  readonly b: number;
67
72
  readonly fromEnd?: true;
73
+ /** Counted among the siblings with the node's own element name: `:nth-of-type()`. */
74
+ readonly ofType?: true;
68
75
  }
69
76
  export type Combinator = 'descendant' | 'child' | 'next-sibling' | 'later-sibling';
70
77
  export interface StyleRule {
@@ -72,6 +79,8 @@ export interface StyleRule {
72
79
  /** Between compounds; length is `compounds.length - 1`. */
73
80
  readonly combinators: readonly Combinator[];
74
81
  readonly specificity: number;
82
+ /** Written with `::ng-deep`: for what is under its component, in other components' views too. */
83
+ readonly deep?: true;
75
84
  /**
76
85
  * The cascade layer the rule is in, as its place in its sheet's `layers`, or nothing for a rule
77
86
  * in no layer, which beats every layered one whatever their specificity.
@@ -162,6 +171,16 @@ export interface TokenValue {
162
171
  readonly lineHeight?: {
163
172
  readonly __defer: DeferredDeclaration['compute'];
164
173
  };
174
+ /**
175
+ * Two to four lengths, which a shorthand of sides or corners takes a value each from:
176
+ * `padding: var(--list-padding)` of `--list-padding: 0.25rem 0.5rem`.
177
+ */
178
+ readonly lengths?: readonly (number | string)[];
179
+ /**
180
+ * The same where a part is a `var()`, each such part as the alias a token that is one is:
181
+ * `0 var(--modal-padding) var(--modal-padding)`. Worked out into `lengths` where it is defined.
182
+ */
183
+ readonly deferredLengths?: readonly (number | string | TokenValue)[];
165
184
  /** A whole shadow list, in the processed shape `boxShadow` takes. */
166
185
  readonly shadow?: readonly unknown[];
167
186
  /** One filter function, as the one-entry list `filter` takes: a slot of Tailwind's filters. */
@@ -485,6 +504,18 @@ export interface StyleCache {
485
504
  context: object;
486
505
  /** The parent's `context` this was computed from. */
487
506
  parentContext: object;
507
+ /**
508
+ * Identity token standing for what an element under this node could match differently: minted
509
+ * when the node is styled for a change that can alter that, and kept when it is styled again
510
+ * for one that cannot, a custom property of its own or an inherited value from above. An
511
+ * element whose parent's is the one it was last styled under matches the rules it did, so it
512
+ * is styled from those it kept and they are not found again.
513
+ */
514
+ scope: object;
515
+ /** The parent's `scope` this was computed from. */
516
+ parentScope: object;
517
+ /** The rules the node matched, for a styling that finds its parent's `scope` as it was. */
518
+ rules?: readonly StyleRule[];
488
519
  /** The conditions version this was resolved under. */
489
520
  generation: number;
490
521
  style: Record<string, unknown>;
@@ -570,6 +601,12 @@ export interface StyleTarget {
570
601
  styleCache: StyleCache | null;
571
602
  /** Set when something that could change what this node matches has changed. */
572
603
  styleDirty: boolean;
604
+ /**
605
+ * Set when what this node matches, or a custom property it holds, may have changed, and nothing
606
+ * that an element under it is matched by: the node is matched and styled again, and those under
607
+ * it are styled from the rules they matched. Absent on a hand-built target.
608
+ */
609
+ ownDirty?: boolean;
573
610
  /**
574
611
  * Set when something beneath this node changed and a sheet uses `:has()`: the node is matched
575
612
  * again, and restyled only if the rules it matches came out different. Absent on a hand-built
@@ -656,6 +693,15 @@ export interface SiblingReach {
656
693
  * Where no sheet reaches either way, only the elements at the two ends can match differently.
657
694
  */
658
695
  export declare function siblingReach(sheet: StyleSheet): SiblingReach;
696
+ /**
697
+ * A compound whose element's place is read from another element, with the classes the rule asks
698
+ * of what that element is in: its parent's where `child`, and otherwise of anything above it.
699
+ */
700
+ export interface PlaceReader {
701
+ readonly compound: Compound;
702
+ readonly above?: readonly string[];
703
+ readonly child?: boolean;
704
+ }
659
705
  /**
660
706
  * Each compound in a sheet whose element's place among its siblings is read from another
661
707
  * element: one with something under it in the rule, `.row:nth-child(odd) .label` and
@@ -669,7 +715,7 @@ export declare function siblingReach(sheet: StyleSheet): SiblingReach;
669
715
  * A place read by the element a rule styles, or by the elements before it that the rule steps
670
716
  * from (`.a:first-child + .b`), is that element's own: the rules it matches say.
671
717
  */
672
- export declare function placeReadElsewhere(sheet: StyleSheet): readonly Compound[];
718
+ export declare function placeReadElsewhere(sheet: StyleSheet): readonly PlaceReader[];
673
719
  /** One rule in a cascade: the sheet it came from, which `:host` needs, and its weight here. */
674
720
  interface RuleEntry {
675
721
  readonly rule: StyleRule;
@@ -733,7 +779,23 @@ export interface Subjects {
733
779
  readonly inside: Set<string>;
734
780
  /** A rule for anything anywhere: no class, no name, and no such box to be in. */
735
781
  any: boolean;
782
+ /**
783
+ * In what a class reaches: a rule is for the element that has the class, `.on`, which is then
784
+ * matched again itself. Unset where the rules are only for elements under it.
785
+ */
786
+ own?: boolean;
736
787
  }
788
+ /**
789
+ * A box a rule asks `:has()` of that is not the node it styles, `.card:has(.x) .title`, by the
790
+ * classes the rule asks of that box, with what the rule is for: the nodes under such a box to
791
+ * match again when what is in it changes.
792
+ */
793
+ export interface HasAbove {
794
+ readonly classes: readonly string[];
795
+ readonly subjects: Subjects;
796
+ }
797
+ /** Each box a sheet's rules ask `:has()` of above the node they style. */
798
+ export declare function hasAbove(sheet: StyleSheet): readonly HasAbove[];
737
799
  /** Whether an inline style sets a property children inherit. Allocates nothing: it runs per set. */
738
800
  export declare function setsInherited(style: unknown): boolean;
739
801
  /**
@@ -855,6 +917,12 @@ export declare class StyleResolver {
855
917
  /** The tests of the `class` attribute itself in those sheets, which any class may answer. */
856
918
  private readonly classTests;
857
919
  private readonly noted;
920
+ /**
921
+ * The sheets with a rule written with `::ng-deep`, which is for what is under the component
922
+ * in the views of the components it holds. None in most apps, and nothing is asked then.
923
+ */
924
+ private readonly deepSheets;
925
+ private readonly deepIndexes;
858
926
  /** Read the classes a sheet names, once, as soon as any node is given it. */
859
927
  noteSheet(sheet: StyleSheet | null | undefined): void;
860
928
  /** The props a selector of some sheet asks about: an id, and each attribute by its name. */
@@ -865,10 +933,13 @@ export declare class StyleResolver {
865
933
  */
866
934
  reads(prop: string): boolean;
867
935
  private noteReach;
936
+ /** Whether a class's reach names any element under the one that has it. */
937
+ reachesUnder(subjects: Subjects): boolean;
868
938
  /**
869
939
  * What classes coming to an element or going from it can restyle: `true` for it and all
870
- * under it and after it, as any change to it does; the elements under it to restyle, by what
871
- * rules are for; or null, where no rule names any of them and nothing is styled again.
940
+ * under it and after it, as any change to it does; the element itself, where `own`, and the
941
+ * elements under it to match again, by what rules are for; or null, where no rule names any
942
+ * of them and nothing is styled again.
872
943
  */
873
944
  reachOf(classes: Iterable<string>): true | Subjects | null;
874
945
  /** Whether one of the rules `subjects` stands for could be for a node. */
@@ -889,6 +960,15 @@ export declare class StyleResolver {
889
960
  * resolves at most once however many descendants ask for its inherited values.
890
961
  */
891
962
  resolve(node: StyleTarget, epoch: number): StyleCache;
963
+ /** A node styled now, from the rules found for it or from those it kept: see `matchesStand`. */
964
+ private styledAgain;
965
+ /**
966
+ * Whether what an element could match is as it was when it was last styled: nothing that can
967
+ * change it was marked on the element, its parent's `scope` is the one it was styled under,
968
+ * and no sheet that could match it has come since. It is being styled again all the same, for
969
+ * a change of its own that alters nothing under it, or for what it inherits.
970
+ */
971
+ private matchesStand;
892
972
  /**
893
973
  * A cache of a node just styled, with a context of its own. It keeps the rules the node
894
974
  * matched, for the node to be compared with, once a sheet has a use for them: see `tracksHas`.
@@ -925,6 +1005,12 @@ export declare class StyleResolver {
925
1005
  * without resolving it. What lets a commit step over a clean child in one comparison.
926
1006
  */
927
1007
  holds(node: StyleTarget, parentContext: object): boolean;
1008
+ /**
1009
+ * Whether a node was last styled under a box holding the one cache shared by every box with
1010
+ * nothing to style. Such boxes hand the same `context` down, so the node cannot tell one from
1011
+ * another by it: moved under another box, it has to be told.
1012
+ */
1013
+ styledUnderShared(node: StyleTarget): boolean;
928
1014
  /**
929
1015
  * Whether a previous result still stands: nothing about the node changed, nothing above it
930
1016
  * moved, and the conditions have not.
@@ -945,6 +1031,8 @@ export declare class StyleResolver {
945
1031
  * token the device had seeded.
946
1032
  */
947
1033
  private unstyled;
1034
+ /** The one cache of every node with nothing to style and nothing to hand down, given to one more. */
1035
+ private sharedEmpty;
948
1036
  /**
949
1037
  * The rules worth trying against a node, in cascade order.
950
1038
  *
@@ -966,6 +1054,13 @@ export declare class StyleResolver {
966
1054
  * it, so it loses to their extra attribute and wins a tie with them.
967
1055
  */
968
1056
  private rulesFor;
1057
+ /**
1058
+ * Add the `::ng-deep` rules of each component a node is in whose sheet is not the node's own:
1059
+ * a node is tried against its own component's rules already, those among them.
1060
+ */
1061
+ private reachedFromAbove;
1062
+ /** A sheet's `::ng-deep` rules alone, filed as a component's own are. */
1063
+ private deepIndex;
969
1064
  /** Weakest first: by layer where any sheet has one, then by weight, then as they were filed. */
970
1065
  private readonly cascadeOrder;
971
1066
  /** A component's sheet as the rules of a host or of a creator, which differ only in their place. */
@@ -1006,6 +1101,8 @@ export declare class StyleResolver {
1006
1101
  * edge the inline style sets takes the other form of it out, as a later rule would.
1007
1102
  */
1008
1103
  overOtherForms(inline: Readonly<Record<string, unknown>>, style: Record<string, unknown>): void;
1104
+ /** Whether a settled style is of an element read right to left: by its own, or the app's. */
1105
+ readsRightToLeft(style: Readonly<Record<string, unknown>>): boolean;
1009
1106
  /**
1010
1107
  * The direction an element is laid out in: the last `direction` its own rules give it, the one
1011
1108
  * it inherits, or the app's. A logical corner is a different physical one in each.
@@ -1030,6 +1127,11 @@ export declare class StyleResolver {
1030
1127
  * A declaration with no token and no usable fallback is dropped rather than written as
1031
1128
  * undefined, which is what a browser does with a value it cannot resolve.
1032
1129
  */
1130
+ /**
1131
+ * What declarations that wait for a node's tokens come to on it, where no rule of the node's
1132
+ * carries them: a keyframe's, which is settled against the element that plays it.
1133
+ */
1134
+ settleFor(node: StyleTarget, deferred: readonly DeferredDeclaration[], epoch: number): Record<string, unknown>;
1033
1135
  private applyDeferred;
1034
1136
  /** Note what the node being resolved takes an `inherit` from, and that its parent has an heir. */
1035
1137
  private heir;