@react-x11/components 0.11.0 → 0.13.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 (126) hide show
  1. package/dist/flow/node.d.ts +14 -6
  2. package/dist/flow/node.d.ts.map +1 -1
  3. package/dist/flow/node.js +82 -64
  4. package/dist/flow/node.js.map +1 -1
  5. package/dist/html/controls.d.ts +38 -10
  6. package/dist/html/controls.d.ts.map +1 -1
  7. package/dist/html/controls.js +43 -58
  8. package/dist/html/controls.js.map +1 -1
  9. package/dist/html/css/cascade.d.ts +134 -20
  10. package/dist/html/css/cascade.d.ts.map +1 -1
  11. package/dist/html/css/cascade.js +538 -128
  12. package/dist/html/css/cascade.js.map +1 -1
  13. package/dist/html/css/color.d.ts +19 -0
  14. package/dist/html/css/color.d.ts.map +1 -1
  15. package/dist/html/css/color.js +86 -0
  16. package/dist/html/css/color.js.map +1 -1
  17. package/dist/html/css/parse.d.ts +40 -2
  18. package/dist/html/css/parse.d.ts.map +1 -1
  19. package/dist/html/css/parse.js +391 -13
  20. package/dist/html/css/parse.js.map +1 -1
  21. package/dist/html/css/style.d.ts +52 -1
  22. package/dist/html/css/style.d.ts.map +1 -1
  23. package/dist/html/css/style.js +328 -11
  24. package/dist/html/css/style.js.map +1 -1
  25. package/dist/html/css/ua.d.ts +11 -1
  26. package/dist/html/css/ua.d.ts.map +1 -1
  27. package/dist/html/css/ua.js +73 -7
  28. package/dist/html/css/ua.js.map +1 -1
  29. package/dist/html/css/values.d.ts +10 -1
  30. package/dist/html/css/values.d.ts.map +1 -1
  31. package/dist/html/css/values.js +27 -2
  32. package/dist/html/css/values.js.map +1 -1
  33. package/dist/html/css/vars.d.ts +5 -0
  34. package/dist/html/css/vars.d.ts.map +1 -1
  35. package/dist/html/css/vars.js +2 -2
  36. package/dist/html/css/vars.js.map +1 -1
  37. package/dist/html/dom.d.ts.map +1 -1
  38. package/dist/html/dom.js +38 -3
  39. package/dist/html/dom.js.map +1 -1
  40. package/dist/html/fonts.d.ts +25 -1
  41. package/dist/html/fonts.d.ts.map +1 -1
  42. package/dist/html/fonts.js +99 -6
  43. package/dist/html/fonts.js.map +1 -1
  44. package/dist/html/form.d.ts +200 -0
  45. package/dist/html/form.d.ts.map +1 -0
  46. package/dist/html/form.js +801 -0
  47. package/dist/html/form.js.map +1 -0
  48. package/dist/html/index.d.ts +12 -0
  49. package/dist/html/index.d.ts.map +1 -1
  50. package/dist/html/index.js +30 -264
  51. package/dist/html/index.js.map +1 -1
  52. package/dist/html/layout/block.d.ts +11 -2
  53. package/dist/html/layout/block.d.ts.map +1 -1
  54. package/dist/html/layout/block.js +186 -19
  55. package/dist/html/layout/block.js.map +1 -1
  56. package/dist/html/layout/boxes.d.ts +65 -7
  57. package/dist/html/layout/boxes.d.ts.map +1 -1
  58. package/dist/html/layout/boxes.js +87 -22
  59. package/dist/html/layout/boxes.js.map +1 -1
  60. package/dist/html/layout/cache.d.ts +2 -2
  61. package/dist/html/layout/cache.d.ts.map +1 -1
  62. package/dist/html/layout/cache.js +8 -3
  63. package/dist/html/layout/cache.js.map +1 -1
  64. package/dist/html/layout/flex.js +4 -1
  65. package/dist/html/layout/flex.js.map +1 -1
  66. package/dist/html/layout/floats.d.ts +4 -0
  67. package/dist/html/layout/floats.d.ts.map +1 -1
  68. package/dist/html/layout/floats.js +26 -0
  69. package/dist/html/layout/floats.js.map +1 -1
  70. package/dist/html/layout/inline.d.ts +26 -2
  71. package/dist/html/layout/inline.d.ts.map +1 -1
  72. package/dist/html/layout/inline.js +1232 -115
  73. package/dist/html/layout/inline.js.map +1 -1
  74. package/dist/html/node.d.ts +120 -15
  75. package/dist/html/node.d.ts.map +1 -1
  76. package/dist/html/node.js +993 -174
  77. package/dist/html/node.js.map +1 -1
  78. package/dist/html/paint.d.ts +75 -2
  79. package/dist/html/paint.d.ts.map +1 -1
  80. package/dist/html/paint.js +836 -200
  81. package/dist/html/paint.js.map +1 -1
  82. package/dist/html/surfaces.d.ts +7 -2
  83. package/dist/html/surfaces.d.ts.map +1 -1
  84. package/dist/html/surfaces.js +16 -0
  85. package/dist/html/surfaces.js.map +1 -1
  86. package/dist/html/widgets.d.ts +29 -0
  87. package/dist/html/widgets.d.ts.map +1 -0
  88. package/dist/html/widgets.js +620 -0
  89. package/dist/html/widgets.js.map +1 -0
  90. package/dist/index.d.ts +1 -1
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js.map +1 -1
  93. package/dist/internal/window.d.ts +22 -0
  94. package/dist/internal/window.d.ts.map +1 -1
  95. package/dist/internal/window.js +35 -8
  96. package/dist/internal/window.js.map +1 -1
  97. package/dist/richtext/node.d.ts +7 -0
  98. package/dist/richtext/node.d.ts.map +1 -1
  99. package/dist/richtext/node.js.map +1 -1
  100. package/package.json +6 -4
  101. package/src/flow/node.ts +80 -64
  102. package/src/html/controls.ts +79 -58
  103. package/src/html/css/cascade.ts +610 -146
  104. package/src/html/css/color.ts +87 -0
  105. package/src/html/css/parse.ts +431 -13
  106. package/src/html/css/style.ts +367 -11
  107. package/src/html/css/ua.ts +76 -8
  108. package/src/html/css/values.ts +31 -3
  109. package/src/html/css/vars.ts +2 -2
  110. package/src/html/dom.ts +41 -3
  111. package/src/html/fonts.ts +116 -6
  112. package/src/html/form.ts +962 -0
  113. package/src/html/index.ts +49 -300
  114. package/src/html/layout/block.ts +231 -16
  115. package/src/html/layout/boxes.ts +133 -32
  116. package/src/html/layout/cache.ts +8 -3
  117. package/src/html/layout/flex.ts +4 -1
  118. package/src/html/layout/floats.ts +24 -0
  119. package/src/html/layout/inline.ts +1445 -108
  120. package/src/html/node.ts +1010 -166
  121. package/src/html/paint.ts +980 -270
  122. package/src/html/surfaces.ts +21 -1
  123. package/src/html/widgets.ts +735 -0
  124. package/src/index.ts +1 -0
  125. package/src/internal/window.ts +36 -8
  126. package/src/richtext/node.ts +7 -0
@@ -22,34 +22,63 @@ export interface ControlRect {
22
22
  width: number;
23
23
  height: number;
24
24
  /**
25
- * Set on a text field whose own box the author styled — gave it a border
26
- * or a background (`styledField`). The document draws that box, and the
27
- * widget goes bare inside its content box, here, with no frame or fill
28
- * of its own and its text in the element's colour and font.
25
+ * The element's computed face and size: what `measureControl` measured
26
+ * its box in, and so what the widget sets its text in. The palette's,
27
+ * from the UA sheet, unless the page set its own — `font: inherit`, which
28
+ * a CSS reset gives every control, for one.
29
+ */
30
+ fontFamily: string;
31
+ fontSize: number;
32
+ /**
33
+ * Set on a text field or a `<select>` whose own box the author styled —
34
+ * gave it a border or a background (`styledField`). The document draws
35
+ * that box, and the widget goes bare inside its content box, here, with
36
+ * no frame or fill of its own and its text in the element's colour and
37
+ * font.
29
38
  */
30
39
  bare?: BareField;
40
+ /**
41
+ * How opaque the widget is drawn, where it is less than 1: the element's
42
+ * own `opacity` times every ancestor's, since each fades what is in it as
43
+ * a group. At 0 the widget is not seen and still takes a press, as the
44
+ * element does in a browser — the checkbox a CSS-only dropdown lays,
45
+ * invisible, over its label.
46
+ */
47
+ opacity?: number;
31
48
  }
32
- /** Where a styled text field's widget goes, and how its text looks. */
49
+ /** Where a styled field's widget goes, and how its text looks. */
33
50
  export interface BareField {
34
51
  x: number;
35
52
  y: number;
36
53
  width: number;
37
54
  height: number;
38
55
  color: string;
56
+ /** @deprecated The rect's own `fontFamily`, which every rect carries. */
39
57
  fontFamily: string;
58
+ /** @deprecated The rect's own `fontSize`, which every rect carries. */
40
59
  fontSize: number;
60
+ /**
61
+ * A `<select>`'s: whether it draws its arrow. It does unless the page set
62
+ * `appearance: none`, which is how a page that draws its own arrow — as a
63
+ * background image, most often — says so.
64
+ */
65
+ chevron?: boolean;
41
66
  }
42
67
  /** The rectangles every control in a laid-out document landed on. */
43
68
  export declare function controlRectsOf(tree: BoxTree): ControlRect[];
44
69
  /**
45
- * Whether a text field's box is the author's to draw: one given a border or
46
- * a background of its own, which the UA sheet gives no control, or set to
70
+ * Whether a field's box is the author's to draw: one given a border or a
71
+ * background of its own, which the UA sheet gives no control, or set to
47
72
  * `appearance: none`, which says so outright. A browser drops a field's
48
73
  * native look for the author's then (CSS UI 4 7.1, `appearance`), and so
49
74
  * does this: the widget's frame and fill would hide the author's, and what
50
75
  * they would draw is the theme's rather than the page's. `appearance: none`
51
76
  * is how a design system writes every field it has — meetup.com's search
52
77
  * pill holds two with no background, only one of them with a border.
78
+ *
79
+ * A `<select>` is one too. A browser keeps its arrow when the page gave it a
80
+ * border or a background (Blink's `menulist-button`), and leaves that out
81
+ * as well at `appearance: none` — `BareField.chevron`.
53
82
  */
54
83
  export declare function styledField(kind: ReplacedKind, style: ComputedStyle): boolean;
55
84
  /**
@@ -72,8 +101,7 @@ export declare function optionsOf(el: Element): {
72
101
  value: string;
73
102
  label: string;
74
103
  }[];
75
- /** Which option a `<select>` starts on: `selected`, else the first. */
104
+ /** Which option a `<select>` shows: the one it has selected, which is the
105
+ * first where none is marked (`selectedOptions`). */
76
106
  export declare function selectedOption(el: Element): string | null;
77
- /** A `<textarea>`'s initial text — its content, not an attribute. */
78
- export declare function textareaValue(el: Element): string;
79
107
  //# sourceMappingURL=controls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../src/html/controls.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,mEAAmE;AACnE,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;qCAGqC;AACrC,MAAM,WAAW,WAA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,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,qEAAqE;AACrE,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,EAAE,CAuC3D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,GAAG,OAAO,CAe7E;AAMD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,EAAE,EAAE,OAAO,EACX,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,SAAS,GAAG,IAAI,EACvB,IAAI,EAAE,aAAa,GAClB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CA6EnC;AAED,gEAAgE;AAChE,wBAAgB,WAAW,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAiB/C;AAED,yDAAyD;AACzD,wBAAgB,SAAS,CAAC,EAAE,EAAE,OAAO,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAKzE;AAED;sDACsD;AACtD,wBAAgB,cAAc,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAGzD"}
@@ -1,4 +1,5 @@
1
1
  import { attr, tagOf } from './dom.js';
2
+ import { optionElements, optionLabel, optionValue, selectedOptions, } from './form.js';
2
3
  import { isTransparent } from './css/values.js';
3
4
  /** The rectangles every control in a laid-out document landed on. */
4
5
  export function controlRectsOf(tree) {
@@ -8,6 +9,9 @@ export function controlRectsOf(tree) {
8
9
  continue;
9
10
  if (box.width <= 0 || box.height <= 0)
10
11
  continue;
12
+ // a hidden element draws nothing and takes no press (CSS 2.1 11.2)
13
+ if (box.style.visibility !== 'visible')
14
+ continue;
11
15
  const rect = {
12
16
  element: box.el,
13
17
  kind: box.replaced,
@@ -15,7 +19,15 @@ export function controlRectsOf(tree) {
15
19
  y: box.y,
16
20
  width: box.width,
17
21
  height: box.height,
22
+ fontFamily: box.style.fontFamily,
23
+ fontSize: box.style.fontSize,
18
24
  };
25
+ let opacity = 1;
26
+ for (let at = box; at; at = at.parent) {
27
+ opacity *= at.style.opacity;
28
+ }
29
+ if (opacity < 1)
30
+ rect.opacity = Math.max(0, opacity);
19
31
  if (styledField(box.replaced, box.style)) {
20
32
  rect.bare = {
21
33
  x: box.contentX,
@@ -25,6 +37,9 @@ export function controlRectsOf(tree) {
25
37
  color: box.style.color,
26
38
  fontFamily: box.style.fontFamily,
27
39
  fontSize: box.style.fontSize,
40
+ ...(box.replaced === 'select' && {
41
+ chevron: box.style.appearance !== 'none',
42
+ }),
28
43
  };
29
44
  }
30
45
  out.push(rect);
@@ -32,18 +47,23 @@ export function controlRectsOf(tree) {
32
47
  return out;
33
48
  }
34
49
  /**
35
- * Whether a text field's box is the author's to draw: one given a border or
36
- * a background of its own, which the UA sheet gives no control, or set to
50
+ * Whether a field's box is the author's to draw: one given a border or a
51
+ * background of its own, which the UA sheet gives no control, or set to
37
52
  * `appearance: none`, which says so outright. A browser drops a field's
38
53
  * native look for the author's then (CSS UI 4 7.1, `appearance`), and so
39
54
  * does this: the widget's frame and fill would hide the author's, and what
40
55
  * they would draw is the theme's rather than the page's. `appearance: none`
41
56
  * is how a design system writes every field it has — meetup.com's search
42
57
  * pill holds two with no background, only one of them with a border.
58
+ *
59
+ * A `<select>` is one too. A browser keeps its arrow when the page gave it a
60
+ * border or a background (Blink's `menulist-button`), and leaves that out
61
+ * as well at `appearance: none` — `BareField.chevron`.
43
62
  */
44
63
  export function styledField(kind, style) {
45
- if (kind !== 'input' && kind !== 'textarea')
64
+ if (kind !== 'input' && kind !== 'textarea' && kind !== 'select') {
46
65
  return false;
66
+ }
47
67
  return (style.appearance === 'none' ||
48
68
  !isTransparent(style.backgroundColor) ||
49
69
  !!style.backgroundImage ||
@@ -89,6 +109,14 @@ export function measureControl(el, kind, style, fonts, look) {
89
109
  }
90
110
  case 'select': {
91
111
  const widest = optionWidths(el);
112
+ // a select the page styled is its widest option and its arrow, and
113
+ // the room around them is the page's
114
+ if (styledField(kind, style)) {
115
+ return {
116
+ width: Math.round(ch * widest + (style.appearance === 'none' ? 0 : em)),
117
+ height: lineHeight,
118
+ };
119
+ }
92
120
  // The room for the chevron is the widget's, not the document's, but
93
121
  // the document has to reserve it or the last letter of the widest
94
122
  // option sits under it.
@@ -139,10 +167,13 @@ export function buttonLabel(el) {
139
167
  if (trimmed)
140
168
  return trimmed;
141
169
  }
170
+ const type = (attr(el, 'type') ?? '').trim().toLowerCase();
171
+ // an image button with no image yet says what the image would have
172
+ if (type === 'image')
173
+ return attr(el, 'alt') || attr(el, 'value') || 'Submit';
142
174
  const value = attr(el, 'value');
143
175
  if (value)
144
176
  return value;
145
- const type = (attr(el, 'type') ?? '').toLowerCase();
146
177
  if (type === 'submit')
147
178
  return 'Submit';
148
179
  if (type === 'reset')
@@ -151,62 +182,16 @@ export function buttonLabel(el) {
151
182
  }
152
183
  /** A `<select>`'s options, as the widget's item list. */
153
184
  export function optionsOf(el) {
154
- const out = [];
155
- const walk = (node) => {
156
- for (const child of node.children) {
157
- if (child.type !== 'tag')
158
- continue;
159
- const tag = tagOf(child);
160
- if (tag === 'option') {
161
- let label = '';
162
- for (const kid of child.children) {
163
- if (kid.type === 'text')
164
- label += kid.data;
165
- }
166
- const trimmed = label.trim();
167
- out.push({ value: attr(child, 'value') ?? trimmed, label: trimmed });
168
- }
169
- else if (tag === 'optgroup') {
170
- walk(child);
171
- }
172
- }
173
- };
174
- walk(el);
175
- return out;
185
+ return optionElements(el).map((option) => ({
186
+ value: optionValue(option),
187
+ label: optionLabel(option),
188
+ }));
176
189
  }
177
- /** Which option a `<select>` starts on: `selected`, else the first. */
190
+ /** Which option a `<select>` shows: the one it has selected, which is the
191
+ * first where none is marked (`selectedOptions`). */
178
192
  export function selectedOption(el) {
179
- const options = optionsOf(el);
180
- const walk = (node) => {
181
- for (const child of node.children) {
182
- if (child.type !== 'tag')
183
- continue;
184
- if (tagOf(child) === 'option' && attr(child, 'selected') !== undefined) {
185
- let label = '';
186
- for (const kid of child.children) {
187
- if (kid.type === 'text')
188
- label += kid.data;
189
- }
190
- return attr(child, 'value') ?? label.trim();
191
- }
192
- const nested = walk(child);
193
- if (nested !== null)
194
- return nested;
195
- }
196
- return null;
197
- };
198
- return walk(el) ?? options[0]?.value ?? null;
199
- }
200
- /** A `<textarea>`'s initial text — its content, not an attribute. */
201
- export function textareaValue(el) {
202
- let text = '';
203
- for (const child of el.children) {
204
- if (child.type === 'text')
205
- text += child.data;
206
- }
207
- // HTML drops one leading newline after the open tag, which is why a
208
- // pretty-printed `<textarea>` does not start with a blank line.
209
- return text.replace(/^\r?\n/, '');
193
+ const [option] = selectedOptions(el);
194
+ return option ? optionValue(option) : null;
210
195
  }
211
196
  function numberAttr(el, name) {
212
197
  const raw = attr(el, name);
@@ -1 +1 @@
1
- {"version":3,"file":"controls.js","sourceRoot":"","sources":["../../src/html/controls.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AA4ChD,qEAAqE;AACrE,MAAM,UAAU,cAAc,CAAC,IAAa;IAC1C,MAAM,GAAG,GAAkB,EAAE,CAAC;IAC9B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChC,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,SAAS;QACtB,IAAI,GAAG,CAAC,KAAK,IAAI,CAAC,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC;YAAE,SAAS;QAChD,MAAM,IAAI,GAAgB;YACxB,OAAO,EAAE,GAAG,CAAC,EAAE;YACf,IAAI,EAAE,GAAG,CAAC,QAAQ;YAClB,CAAC,EAAE,GAAG,C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OAAO,IAAI,CAAC;IACtB,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5B,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAChD,CAAC;AAED,SAAS,YAAY,CAAC,EAAW;IAC/B,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,MAAM,IAAI,SAAS,CAAC,EAAE,CAAC;QAChC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACjD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;+CAE+C;AAC/C,SAAS,SAAS,CAAC,KAAoB,EAAE,KAAuB;IAC9D,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IACzC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE;YACzC,IAAI,EAAE,KAAK,CAAC,QAAQ;YACpB,MAAM,EAAE,KAAK,CAAC,UAAU;YACxB,KAAK,EAAE,KAAK,CAAC,SAAS;SACvB,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC7C,uEAAuE;QACvE,gCAAgC;QAChC,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC/B,CAAC;AACH,CAAC"}
@@ -9,25 +9,73 @@ export interface SharedStyle {
9
9
  style: ComputedStyle;
10
10
  key: number;
11
11
  }
12
+ /**
13
+ * The styles of the build before, for a build that only some elements'
14
+ * styles can differ in (`Cascade.beginSharing`): what each element's came
15
+ * to, and the elements to style again — `restyle`, each with everything in
16
+ * it, since a style is its parent's and the rules', and a rule reads an
17
+ * element's ancestors.
18
+ */
19
+ export interface KeptStyles {
20
+ styles: ReadonlyMap<Element, {
21
+ style: ComputedStyle;
22
+ inFlex: boolean;
23
+ }>;
24
+ restyle: ReadonlySet<Element>;
25
+ }
26
+ /** What the pointer entering or leaving an element can change
27
+ * (`Cascade.hoverTouches`): nothing, the element and what is in it, or
28
+ * those and the siblings after it. */
29
+ export type HoverTouch = 0 | 1 | 2;
30
+ export declare const HOVER_UNTOUCHED = 0;
31
+ export declare const HOVER_TOUCHED = 1;
32
+ export declare const HOVER_FOLLOWED = 2;
33
+ /** Which pseudo-elements' rules test the pointer (`Cascade.hoverPseudo`). */
34
+ export declare const HOVER_PSEUDO_NONE = 0;
35
+ export declare const HOVER_PSEUDO_GENERATED = 1;
36
+ export declare const HOVER_PSEUDO_OTHER = 2;
37
+ /**
38
+ * What a `::selection` makes of the text it covers (CSS Pseudo 4, 3.2): the
39
+ * colour the text is drawn in, null for its own, and the band under it,
40
+ * null for none.
41
+ */
42
+ export interface SelectionStyle {
43
+ color: string | null;
44
+ background: string | null;
45
+ }
12
46
  /**
13
47
  * The compounds of a selector that test `:hover`, each without it (and
14
48
  * without an `:active` beside it), and whether one is followed by a sibling
15
- * combinator, which reaches the element's later siblings. `nested` where a
16
- * `:hover` sits inside a functional pseudo-class — `:not(:hover)`,
17
- * `:is(:hover)` — and reaches elements no compound names.
49
+ * combinator, which reaches the element's later siblings.
50
+ *
51
+ * A `:hover` inside `:is()`, `:where()` or `:not()` is found where it is:
52
+ * each takes a selector list and matches the element it is written on, so
53
+ * a list entry of one compound tests that element — `a:not(:hover)` is a
54
+ * compound of `a`'s that tests the pointer — and an entry with combinators
55
+ * in it names an ancestor or an earlier sibling, as it would outside.
56
+ * Tailwind 4 writes every `group-hover:` that way, `:is(:where(.group):hover
57
+ * *)`, and a page of them built its document again on every move. Whatever
58
+ * the nesting, the element whose hover changed is one a compound found here
59
+ * matches, and what changes with it is itself, what is in it, and what
60
+ * follows it where a sibling combinator is in play: a selector reads an
61
+ * element, its ancestors and the siblings before each of them, and nothing
62
+ * else. `nested` is left for a function this cannot read a selector list
63
+ * in — `:nth-child(… of :hover)`, `:host()` — which reaches elements no
64
+ * compound names.
18
65
  *
19
- * A `:hover` in a compound's `:has()` is the one exception, since what it
20
- * reaches is known: the compound, without its `:has()`, is an ancestor of
66
+ * A `:hover` in a compound's `:has()` is the other way about, since what
67
+ * it tests is below: the compound, without its `:has()`, is an ancestor of
21
68
  * the element the pointer is over — or an earlier sibling of it or of an
22
69
  * ancestor, where the argument starts at a sibling (Selectors 4, 4.5). So
23
- * it is given as an anchor (`has`) rather than making the rule `nested`.
70
+ * it is given as an anchor (`has`).
24
71
  *
25
72
  * `:active` is not the pointer's here: nothing sets it (`setPointer` is
26
73
  * handed none), so a selector that tests only it never changes as the
27
74
  * pointer moves — Wikipedia's buttons' `:focus:not(:active)` among them.
28
75
  * A press that sets it would have to be counted here too.
29
76
  */
30
- export declare function pointerCompounds(selector: string): {
77
+ export declare function pointerCompounds(selector: string): PointerCompounds;
78
+ export interface PointerCompounds {
31
79
  compounds: string[];
32
80
  siblings: boolean;
33
81
  nested: boolean;
@@ -35,7 +83,10 @@ export declare function pointerCompounds(selector: string): {
35
83
  anchor: string;
36
84
  siblings: boolean;
37
85
  }[];
38
- };
86
+ /** The compounds and anchors a sibling combinator follows: the ones
87
+ * whose elements' later siblings change with them. */
88
+ followed: string[];
89
+ }
39
90
  /** What `Cascade.firstLetterRules` found for an element. */
40
91
  export interface FirstLetterRules {
41
92
  readonly el: Element;
@@ -81,11 +132,9 @@ export declare class Cascade {
81
132
  * pointer inside a functional pseudo-class, which reaches elements no
82
133
  * compound names. */
83
134
  hoverLocal: boolean;
84
- /** Whether a compound that tests the pointer is followed by a sibling
85
- * combinator, so an element's later siblings restyle with it. */
86
- hoverSiblings: boolean;
87
- /** The compounds whose `:has()` tests the pointer, each without it, and
88
- * whether its argument starts at a sibling (`hoverAnchors`). */
135
+ /** The compounds whose `:has()` tests the pointer, each without it,
136
+ * whether its argument starts at a sibling, and whether a sibling
137
+ * combinator follows it (`hoverAnchors`). */
89
138
  private _hoverAnchors;
90
139
  private _anchorMatchers;
91
140
  private _pointer;
@@ -125,6 +174,12 @@ export declare class Cascade {
125
174
  /** The families the document loads itself (`fonts.ts`), or null for a
126
175
  * document with no `@font-face`. */
127
176
  private _families;
177
+ /** The root element's computed style: its `font-size` is what a `rem`
178
+ * is and its line height what an `rlh` is (CSS Values 4, 6.1.1), in
179
+ * every element but the root, whose own declarations measure them from
180
+ * the initial values. Set as the root's style is computed, which a build
181
+ * does ahead of every element under it. */
182
+ private _root;
128
183
  private _mapFamilies;
129
184
  /** Whether any declaration has a length in `lh` or `rlh`: only then is
130
185
  * the line height settled ahead of the declarations that read it. */
@@ -136,21 +191,35 @@ export declare class Cascade {
136
191
  /** Whether a pointer move can change what this cascade produces. */
137
192
  get hoverSensitive(): boolean;
138
193
  setPointer(pointer: PointerState): void;
194
+ /**
195
+ * Which pseudo-elements' rules test the pointer: none's
196
+ * (`HOVER_PSEUDO_NONE`); a `::before`'s or an `::after`'s only
197
+ * (`HOVER_PSEUDO_GENERATED`), whose boxes a move restyles where they are
198
+ * as it does an element's; or a `::first-line`'s, a `::first-letter`'s
199
+ * or a `::marker`'s (`HOVER_PSEUDO_OTHER`), which layout styles and a
200
+ * move cannot.
201
+ */
202
+ get hoverPseudo(): 0 | 1 | 2;
139
203
  /**
140
204
  * Whether the pointer entering or leaving `el` can change a style: one of
141
205
  * the compounds a selector tests the pointer in matches it, the pointer
142
206
  * aside. A move between two paragraphs of a page whose only such rule is
143
- * `a:hover` touches nothing, and restyles nothing.
207
+ * `a:hover` touches nothing, and restyles nothing. `HOVER_FOLLOWED`
208
+ * where a sibling combinator follows one that matches, so the element's
209
+ * later siblings can change with it — those rules' elements alone: a
210
+ * sheet with one `.peer:hover ~ *` in it does not make every row of a
211
+ * table restyle the rows after it.
144
212
  */
145
- hoverTouches(el: Element): boolean;
213
+ hoverTouches(el: Element): HoverTouch;
146
214
  /**
147
215
  * The elements whose `:has()` may have changed its answer as `el` was
148
216
  * hovered or left: the ancestors of it a compound whose `:has()` tests
149
217
  * the pointer names, and their earlier siblings and its own where the
150
218
  * argument starts at a sibling — a superset, which is restyled and found
151
- * the same where it did not. Into `into`.
219
+ * the same where it did not. Into `into`, each with whether its later
220
+ * siblings can change with it (`hoverTouches`).
152
221
  */
153
- hoverAnchors(el: Element, into: Element[]): void;
222
+ hoverAnchors(el: Element, into: Map<Element, HoverTouch>): void;
154
223
  private _noteHover;
155
224
  /** A selector compiled as a rule's is, or null where css-select refuses
156
225
  * it, as a rule it refuses drops out of the cascade. */
@@ -169,9 +238,23 @@ export declare class Cascade {
169
238
  private _customs;
170
239
  private _ids;
171
240
  private _nextId;
172
- /** A box tree is about to be built: the styles shared in the last build
173
- * were computed against a pointer and a viewport that may have moved. */
174
- beginSharing(): void;
241
+ /** The styles kept from the build before, while a build that keeps them
242
+ * runs, and what each kept element shares under in this one. */
243
+ private _kept;
244
+ private _keptShared;
245
+ /**
246
+ * A box tree is about to be built: the styles shared in the last build
247
+ * were computed against a pointer and a viewport that may have moved.
248
+ *
249
+ * With `kept`, only its `restyle` elements are matched: a build the
250
+ * pointer asked for — a hover that moved something — changes the styles
251
+ * of the elements the move reached, and every other element's is what it
252
+ * was. Matching them all again was most of such a build: a frame of 550 ms
253
+ * on a page with a Tailwind sheet, and 150 without it.
254
+ */
255
+ beginSharing(kept?: KeptStyles | null): void;
256
+ /** The build is over: nothing later is answered from what it kept. */
257
+ endSharing(): void;
175
258
  /**
176
259
  * An element's custom properties: its parent's, or its own over them —
177
260
  * shared by every element whose parent has the same ones and whose own
@@ -249,6 +332,24 @@ export declare class Cascade {
249
332
  * a number is set in, and a `content` it is set as instead.
250
333
  */
251
334
  markerStyle(el: Element, style: ComputedStyle): ComputedStyle | null;
335
+ /** Whether any rule styles a `::selection`: a document with none draws
336
+ * a selection in the palette's colour, and asks nothing. */
337
+ get hasSelection(): boolean;
338
+ /**
339
+ * An element's `::selection`, over its parent's (`parent`, null for the
340
+ * palette's own): the colour and the background the rules that reach it
341
+ * set, and its parent's for either they leave alone. Both inherit along
342
+ * the chain of highlights rather than the elements' (CSS Pseudo 4, 3.5,
343
+ * "highlight inheritance"), which is what Chrome draws: a `<span>` in a
344
+ * `div::selection { background: red }` is selected in red, and a `<p>`
345
+ * whose own rule sets only a colour keeps the red under it.
346
+ *
347
+ * The palette's highlight is taken only where no rule has set either
348
+ * (3.6, "paired defaults"): one that sets a colour and no background is
349
+ * selected over none, as Chrome has it. A rule that sets neither — a
350
+ * `text-shadow` only — leaves the element where its parent was.
351
+ */
352
+ selectionStyle(el: Element, style: ComputedStyle, parent: SelectionStyle | null): SelectionStyle | null;
252
353
  /**
253
354
  * An element's `::first-line` style, inheriting from its own, or null
254
355
  * when no rule reaches it (CSS 2.1 5.12.1).
@@ -302,6 +403,19 @@ export declare class Cascade {
302
403
  style: ComputedStyle;
303
404
  html: ComputedStyle | null;
304
405
  };
406
+ /**
407
+ * Whether the pointer's move from `was` to where it is changed which
408
+ * rules match `el`, or its `::before`, `::after` or another of its
409
+ * pseudo-elements: the rules that test `:hover` asked under both, and
410
+ * nothing else, since no other rule's answer is the pointer's. An element
411
+ * they answer the same for, under a parent whose style is what it was, has
412
+ * the style it had — which is most of what a move reaches: the rows of a
413
+ * hovered table body, what is in a hovered card.
414
+ */
415
+ pointerChanged(el: Element, was: PointerState): boolean;
416
+ /** The ids of the rules testing the pointer that match `el` as things
417
+ * stand, the element's and each pseudo-element's. */
418
+ private _pointerAnswers;
305
419
  /** The rules of `index` that match `el`, pushed onto `out` as candidates,
306
420
  * and their ids onto `matched` in the order they were tried. */
307
421
  private _matchInto;
@@ -1 +1 @@
1
- {"version":3,"file":"cascade.d.ts","sourceRoot":"","sources":["../../../src/html/css/cascade.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