@react-x11/components 0.12.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.
Files changed (150) hide show
  1. package/dist/html/controls.d.ts +41 -5
  2. package/dist/html/controls.d.ts.map +1 -1
  3. package/dist/html/controls.js +85 -57
  4. package/dist/html/controls.js.map +1 -1
  5. package/dist/html/css/cascade.d.ts +134 -20
  6. package/dist/html/css/cascade.d.ts.map +1 -1
  7. package/dist/html/css/cascade.js +545 -126
  8. package/dist/html/css/cascade.js.map +1 -1
  9. package/dist/html/css/color.d.ts +18 -0
  10. package/dist/html/css/color.d.ts.map +1 -1
  11. package/dist/html/css/color.js +27 -0
  12. package/dist/html/css/color.js.map +1 -1
  13. package/dist/html/css/parse.d.ts +47 -6
  14. package/dist/html/css/parse.d.ts.map +1 -1
  15. package/dist/html/css/parse.js +336 -30
  16. package/dist/html/css/parse.js.map +1 -1
  17. package/dist/html/css/style.d.ts +142 -15
  18. package/dist/html/css/style.d.ts.map +1 -1
  19. package/dist/html/css/style.js +563 -147
  20. package/dist/html/css/style.js.map +1 -1
  21. package/dist/html/css/transform.d.ts +85 -0
  22. package/dist/html/css/transform.d.ts.map +1 -0
  23. package/dist/html/css/transform.js +425 -0
  24. package/dist/html/css/transform.js.map +1 -0
  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 -9
  28. package/dist/html/css/ua.js.map +1 -1
  29. package/dist/html/css/values.d.ts +4 -0
  30. package/dist/html/css/values.d.ts.map +1 -1
  31. package/dist/html/css/values.js.map +1 -1
  32. package/dist/html/dom.d.ts.map +1 -1
  33. package/dist/html/dom.js +3 -1
  34. package/dist/html/dom.js.map +1 -1
  35. package/dist/html/fonts.d.ts +78 -4
  36. package/dist/html/fonts.d.ts.map +1 -1
  37. package/dist/html/fonts.js +373 -19
  38. package/dist/html/fonts.js.map +1 -1
  39. package/dist/html/form.d.ts +200 -0
  40. package/dist/html/form.d.ts.map +1 -0
  41. package/dist/html/form.js +801 -0
  42. package/dist/html/form.js.map +1 -0
  43. package/dist/html/index.d.ts +12 -0
  44. package/dist/html/index.d.ts.map +1 -1
  45. package/dist/html/index.js +30 -301
  46. package/dist/html/index.js.map +1 -1
  47. package/dist/html/layout/axes.d.ts +14 -0
  48. package/dist/html/layout/axes.d.ts.map +1 -0
  49. package/dist/html/layout/axes.js +28 -0
  50. package/dist/html/layout/axes.js.map +1 -0
  51. package/dist/html/layout/block.d.ts +93 -12
  52. package/dist/html/layout/block.d.ts.map +1 -1
  53. package/dist/html/layout/block.js +393 -39
  54. package/dist/html/layout/block.js.map +1 -1
  55. package/dist/html/layout/boxes.d.ts +90 -2
  56. package/dist/html/layout/boxes.d.ts.map +1 -1
  57. package/dist/html/layout/boxes.js +74 -10
  58. package/dist/html/layout/boxes.js.map +1 -1
  59. package/dist/html/layout/cache.d.ts +1 -1
  60. package/dist/html/layout/cache.d.ts.map +1 -1
  61. package/dist/html/layout/cache.js +6 -0
  62. package/dist/html/layout/cache.js.map +1 -1
  63. package/dist/html/layout/css-grid.d.ts.map +1 -1
  64. package/dist/html/layout/css-grid.js +90 -18
  65. package/dist/html/layout/css-grid.js.map +1 -1
  66. package/dist/html/layout/flex.d.ts.map +1 -1
  67. package/dist/html/layout/flex.js +574 -84
  68. package/dist/html/layout/flex.js.map +1 -1
  69. package/dist/html/layout/inline.d.ts +3 -0
  70. package/dist/html/layout/inline.d.ts.map +1 -1
  71. package/dist/html/layout/inline.js +154 -54
  72. package/dist/html/layout/inline.js.map +1 -1
  73. package/dist/html/layout/multicol.d.ts +42 -0
  74. package/dist/html/layout/multicol.d.ts.map +1 -0
  75. package/dist/html/layout/multicol.js +897 -0
  76. package/dist/html/layout/multicol.js.map +1 -0
  77. package/dist/html/layout/shaping.d.ts +7 -0
  78. package/dist/html/layout/shaping.d.ts.map +1 -1
  79. package/dist/html/layout/shaping.js +25 -20
  80. package/dist/html/layout/shaping.js.map +1 -1
  81. package/dist/html/layout/table.d.ts.map +1 -1
  82. package/dist/html/layout/table.js +62 -18
  83. package/dist/html/layout/table.js.map +1 -1
  84. package/dist/html/node.d.ts +90 -15
  85. package/dist/html/node.d.ts.map +1 -1
  86. package/dist/html/node.js +771 -186
  87. package/dist/html/node.js.map +1 -1
  88. package/dist/html/paint.d.ts +101 -5
  89. package/dist/html/paint.d.ts.map +1 -1
  90. package/dist/html/paint.js +1502 -160
  91. package/dist/html/paint.js.map +1 -1
  92. package/dist/html/svg.d.ts +15 -2
  93. package/dist/html/svg.d.ts.map +1 -1
  94. package/dist/html/svg.js +249 -17
  95. package/dist/html/svg.js.map +1 -1
  96. package/dist/html/widgets.d.ts +29 -0
  97. package/dist/html/widgets.d.ts.map +1 -0
  98. package/dist/html/widgets.js +700 -0
  99. package/dist/html/widgets.js.map +1 -0
  100. package/dist/html/woff2.d.ts +14 -0
  101. package/dist/html/woff2.d.ts.map +1 -0
  102. package/dist/html/woff2.js +608 -0
  103. package/dist/html/woff2.js.map +1 -0
  104. package/dist/index.d.ts +1 -1
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.js.map +1 -1
  107. package/dist/maps/controller.d.ts +17 -1
  108. package/dist/maps/controller.d.ts.map +1 -1
  109. package/dist/maps/controller.js +27 -7
  110. package/dist/maps/controller.js.map +1 -1
  111. package/dist/richtext/node.d.ts +8 -1
  112. package/dist/richtext/node.d.ts.map +1 -1
  113. package/dist/richtext/node.js +5 -1
  114. package/dist/richtext/node.js.map +1 -1
  115. package/dist/richtext/runs.d.ts +25 -6
  116. package/dist/richtext/runs.d.ts.map +1 -1
  117. package/dist/richtext/runs.js +240 -24
  118. package/dist/richtext/runs.js.map +1 -1
  119. package/package.json +2 -2
  120. package/src/html/controls.ts +114 -51
  121. package/src/html/css/cascade.ts +614 -140
  122. package/src/html/css/color.ts +29 -0
  123. package/src/html/css/parse.ts +388 -33
  124. package/src/html/css/style.ts +688 -150
  125. package/src/html/css/transform.ts +459 -0
  126. package/src/html/css/ua.ts +77 -10
  127. package/src/html/css/values.ts +4 -0
  128. package/src/html/dom.ts +3 -1
  129. package/src/html/fonts.ts +417 -24
  130. package/src/html/form.ts +962 -0
  131. package/src/html/index.ts +49 -338
  132. package/src/html/layout/axes.ts +62 -0
  133. package/src/html/layout/block.ts +447 -37
  134. package/src/html/layout/boxes.ts +143 -14
  135. package/src/html/layout/cache.ts +6 -0
  136. package/src/html/layout/css-grid.ts +95 -22
  137. package/src/html/layout/flex.ts +675 -78
  138. package/src/html/layout/inline.ts +159 -55
  139. package/src/html/layout/multicol.ts +977 -0
  140. package/src/html/layout/shaping.ts +27 -18
  141. package/src/html/layout/table.ts +62 -19
  142. package/src/html/node.ts +798 -172
  143. package/src/html/paint.ts +1742 -241
  144. package/src/html/svg.ts +277 -19
  145. package/src/html/widgets.ts +821 -0
  146. package/src/html/woff2.ts +612 -0
  147. package/src/index.ts +1 -0
  148. package/src/maps/controller.ts +28 -7
  149. package/src/richtext/node.ts +13 -2
  150. package/src/richtext/runs.ts +313 -35
@@ -92,60 +92,203 @@ export function paintRunBackgrounds(ctx, line, dx, dy, scale = 1) {
92
92
  * is one logical pixel thick — `scale` device pixels, so a link on a 2x
93
93
  * panel is underlined as heavily as on a 1x one, not with a hairline —
94
94
  * and an underline two below the baseline, where the run sets neither
95
- * (`underlineThickness`, `underlineOffset`, in device pixels by now).
95
+ * (`underlineThickness`, `underlineOffset`, in device pixels by now). A
96
+ * line through is a logical pixel as well where the run names no
97
+ * `strikeThickness`, and is drawn where its face puts it (`strikeTop`).
96
98
  * `rules` picks a pass: CSS draws an underline under the glyphs and a
97
99
  * line through over them (CSS 2.1 Appendix E), which is two passes around
98
- * the glyphs'; drawn in one, both go over. */
100
+ * the glyphs'; drawn in one, both go over.
101
+ *
102
+ * A rule is drawn a stretch at a time and not a run: a layout hands
103
+ * back a run a word, and a pattern begun again under each — dots spread
104
+ * from one end of their rule to the other, above all — is a pattern with
105
+ * a seam at every space. Runs that touch and draw the same rule share
106
+ * one. */
99
107
  export function paintRunRules(ctx, line, dx, dy, scale = 1, rules = 'all') {
100
108
  const t = ruleThickness(scale);
109
+ if (rules !== 'over') {
110
+ // the stretch being gathered: the span whose rule it is, and its ends
111
+ let ruled = null;
112
+ let from = 0;
113
+ let to = 0;
114
+ for (const r of line.runs) {
115
+ const span = r.span;
116
+ if (!span?.underline)
117
+ continue;
118
+ const end = r.x + r.width;
119
+ if (ruled &&
120
+ // on either side: a right-to-left stretch's runs come last first
121
+ (Math.abs(r.x - to) <= 0.5 || Math.abs(end - from) <= 0.5) &&
122
+ sameRule(ruled, span)) {
123
+ from = Math.min(from, r.x);
124
+ to = Math.max(to, end);
125
+ continue;
126
+ }
127
+ if (ruled)
128
+ stretchRule(ctx, ruled, line, dx + from, dx + to, dy, t);
129
+ ruled = span;
130
+ from = r.x;
131
+ to = end;
132
+ }
133
+ if (ruled)
134
+ stretchRule(ctx, ruled, line, dx + from, dx + to, dy, t);
135
+ }
136
+ if (rules === 'under')
137
+ return;
138
+ // A line through, gathered the same way, and ended as well where the
139
+ // font size changes: it is drawn across each size where that size has
140
+ // it (`strikeTop`). The faces of one size are one stretch, at the height
141
+ // they have it between them — a word the face has no glyphs for is set
142
+ // in another, and the rule does not step for it.
143
+ let struck = null;
144
+ let size;
145
+ let from = 0;
146
+ let to = 0;
147
+ // the stretch's ascent: its first run's, and its runs' by how much of
148
+ // the stretch each sets, which is read only where they are not all the
149
+ // first's
150
+ let ascent = 0;
151
+ let summed = 0;
152
+ let widths = 0;
153
+ let mixed = false;
101
154
  for (const r of line.runs) {
102
155
  const span = r.span;
103
- if (!span)
156
+ if (!span?.strike)
157
+ continue;
158
+ const own = inkExtent(r, line).ascent;
159
+ const end = r.x + r.width;
160
+ if (struck &&
161
+ r.run?.size === size &&
162
+ (Math.abs(r.x - to) <= 0.5 || Math.abs(end - from) <= 0.5) &&
163
+ sameStrike(struck, span)) {
164
+ from = Math.min(from, r.x);
165
+ to = Math.max(to, end);
166
+ summed += own * r.width;
167
+ widths += r.width;
168
+ if (own !== ascent)
169
+ mixed = true;
104
170
  continue;
105
- const underline = rules !== 'over' ? span.underline : undefined;
106
- const strike = rules !== 'under' ? span.strike : undefined;
107
- if (underline) {
108
- ctx.fillStyle = underline;
109
- underlineRule(ctx, Math.round(dx + line.x + r.x), Math.round(dy + line.baseline + (span.underlineOffset ?? 2 * t)), Math.ceil(r.width), span.underlineStyle ?? 'single', span.underlineThickness === undefined
110
- ? t
111
- : Math.max(1, Math.round(span.underlineThickness)));
112
171
  }
113
- if (strike) {
114
- const m = inkExtent(r, line);
115
- ctx.fillStyle = strike;
116
- ctx.fillRect(Math.round(dx + line.x + r.x), Math.round(dy + line.baseline - m.ascent * 0.38), Math.ceil(r.width), t);
172
+ if (struck) {
173
+ const mean = mixed && widths > 0 ? summed / widths : ascent;
174
+ strikeRule(ctx, struck, line, dx + from, dx + to, dy, mean, t);
117
175
  }
176
+ struck = span;
177
+ size = r.run?.size;
178
+ from = r.x;
179
+ to = end;
180
+ ascent = own;
181
+ summed = own * r.width;
182
+ widths = r.width;
183
+ mixed = false;
184
+ }
185
+ if (struck) {
186
+ const mean = mixed && widths > 0 ? summed / widths : ascent;
187
+ strikeRule(ctx, struck, line, dx + from, dx + to, dy, mean, t);
188
+ }
189
+ }
190
+ /** The underline of a stretch of a line, from `from` to `to` of it, as
191
+ * `span` has it; `t` is the thickness of a rule that names none. */
192
+ function stretchRule(ctx, span, line, from, to, dy, t) {
193
+ const left = Math.round(line.x + from);
194
+ ctx.fillStyle = span.underline;
195
+ underlineRule(ctx, left, Math.round(dy + line.baseline + (span.underlineOffset ?? 2 * t)), Math.ceil(line.x + to - left), span.underlineStyle ?? 'single', span.underlineThickness === undefined
196
+ ? t
197
+ : Math.max(1, Math.round(span.underlineThickness)), t);
198
+ }
199
+ /** How thick a run's line through is: what it says, on whole pixels, or
200
+ * `t`, a rule's own thickness. */
201
+ function strikeThickness(span, t) {
202
+ return span.strikeThickness === undefined
203
+ ? t
204
+ : Math.max(1, Math.round(span.strikeThickness));
205
+ }
206
+ /**
207
+ * Where the top of a line through is, across text whose faces' ascent is
208
+ * `ascent`. Through the middle of the letters with no ascender, which a
209
+ * face does not say the height of in a way both text engines report: a
210
+ * third of its ascent above the baseline, where Blink has it, and the
211
+ * rule's middle there, so that a thick one grows both ways from where a
212
+ * thin one is. The ascent is the text's own, and not that of the font the
213
+ * rule was set in: a line through is worked out again across text of
214
+ * another font size, from the metrics of the fonts that size is set in,
215
+ * so that the text is still crossed out (CSS Text Decoration 4, 2.5), and
216
+ * is not held to the one position an underline is (2.9). Blink measures
217
+ * the ascent of the font the rule was set in from the top of the text it
218
+ * crosses, which puts it near the top of larger text and under smaller.
219
+ * The curl is two levels and straddles the middle; a double rule's first
220
+ * line is the single one's, and its second under it, as Blink draws it.
221
+ *
222
+ * A run that names no thickness keeps the pixel it always had: the rule's
223
+ * top 38% of the ascent up, which at a text size is the same place, and a
224
+ * pixel off it at some.
225
+ */
226
+ function strikeTop(line, dy, span, ascent, t) {
227
+ if (span.strikeThickness === undefined) {
228
+ return Math.round(dy + line.baseline - ascent * 0.38);
118
229
  }
230
+ const thick = strikeThickness(span, t);
231
+ return Math.round(dy +
232
+ line.baseline -
233
+ ascent / 3 -
234
+ (span.strikeStyle === 'curly' ? thick : thick / 2));
235
+ }
236
+ /** The line through a stretch of a line, from `from` to `to` of it, as
237
+ * `span` has it, over faces whose ascent is `ascent`. */
238
+ function strikeRule(ctx, span, line, from, to, dy, ascent, t) {
239
+ const left = Math.round(line.x + from);
240
+ ctx.fillStyle = span.strike;
241
+ underlineRule(ctx, left, strikeTop(line, dy, span, ascent, t), Math.ceil(line.x + to - left), span.strikeStyle ?? 'single', strikeThickness(span, t), t);
242
+ }
243
+ /** Whether two spans are struck through with one rule: the same ink, style
244
+ * and thickness. Where it is drawn is their faces' to say (`strikeTop`). */
245
+ function sameStrike(a, b) {
246
+ return (a === b ||
247
+ (a.strike === b.strike &&
248
+ a.strikeStyle === b.strikeStyle &&
249
+ a.strikeThickness === b.strikeThickness));
250
+ }
251
+ /** Whether two spans are underlined with one rule: the same ink, style,
252
+ * place and thickness. */
253
+ function sameRule(a, b) {
254
+ return (a === b ||
255
+ (a.underline === b.underline &&
256
+ a.underlineStyle === b.underlineStyle &&
257
+ a.underlineOffset === b.underlineOffset &&
258
+ a.underlineThickness === b.underlineThickness));
119
259
  }
120
260
  /** One logical pixel on the device grid, never less than one device pixel. */
121
261
  function ruleThickness(scale) {
122
262
  return Math.max(1, Math.round(scale));
123
263
  }
124
264
  /**
125
- * The rule under a run, in one of SGR 4's five styles.
265
+ * The rule under a run, or through it, in one of SGR 4's five styles.
126
266
  *
127
267
  * All five are built from rectangles `t` pixels thick — one logical pixel —
128
268
  * rather than a stroked path: the mock backend has no path API, and a
129
269
  * hairline stroke on a text baseline is not worth an antialiased path even
130
270
  * where there is one. The curl is a two-level square wave — at a text size
131
271
  * it reads as a squiggle, which is the entire job. The dot pitch and the
132
- * dash length scale with the thickness, so the pattern is the pattern at
133
- * any display scale.
272
+ * dash length scale with the thickness (`dashedRule`), so the pattern is
273
+ * the pattern at any display scale. The one path is a thick dotted rule's
274
+ * (`dottedRule`): a square is a dot only while it is too small to be seen
275
+ * as a square.
276
+ *
277
+ * `gap` is what parts the two lines of a double rule: a logical pixel
278
+ * however thick they are, as Blink parts them, which for a rule of that
279
+ * thickness is the thickness between them it always was.
134
280
  */
135
- export function underlineRule(ctx, x, y, width, style, t = 1) {
281
+ export function underlineRule(ctx, x, y, width, style, t = 1, gap = t) {
136
282
  switch (style) {
137
283
  case 'double':
138
284
  ctx.fillRect(x, y, width, t);
139
- ctx.fillRect(x, y + 2 * t, width, t);
285
+ ctx.fillRect(x, y + t + gap, width, t);
140
286
  return;
141
287
  case 'dotted':
142
- for (let i = 0; i < width; i += 2 * t) {
143
- ctx.fillRect(x + i, y, Math.min(t, width - i), t);
144
- }
288
+ dottedRule(ctx, x, y, width, t);
145
289
  return;
146
290
  case 'dashed':
147
- for (let i = 0; i < width; i += 6 * t)
148
- ctx.fillRect(x + i, y, Math.min(3 * t, width - i), t);
291
+ dashedRule(ctx, x, y, width, t);
149
292
  return;
150
293
  case 'curly':
151
294
  for (let i = 0; i < width; i += 2 * t) {
@@ -157,6 +300,79 @@ export function underlineRule(ctx, x, y, width, style, t = 1) {
157
300
  return;
158
301
  }
159
302
  }
303
+ /** The thickness a dashed rule's dashes stop being the long ones of a thin
304
+ * rule at. */
305
+ const THIN_DASHES = 3;
306
+ /**
307
+ * A dashed rule, its dashes the lengths Blink's are: three times the rule's
308
+ * thickness and two apart while it is thin, where a shorter dash reads as
309
+ * a dot and a nearer one as no gap, and twice and one from three pixels up.
310
+ * The first dash starts the rule and the last ends it, with as many between
311
+ * as leave the gaps nearest that: a rule that stopped where its length ran
312
+ * out ended on a sliver of a dash, or on nothing. One with room for two
313
+ * dashes and less than their gap is two, scaled to fit, and one too short
314
+ * for two is a line.
315
+ */
316
+ function dashedRule(ctx, x, y, width, t) {
317
+ const thin = t < THIN_DASHES;
318
+ const dash = t * (thin ? 3 : 2);
319
+ const gap = t * (thin ? 2 : 1);
320
+ if (width <= 2 * dash) {
321
+ ctx.fillRect(x, y, width, t);
322
+ return;
323
+ }
324
+ if (width <= 2 * dash + gap) {
325
+ const each = Math.round((dash * width) / (2 * dash + gap));
326
+ ctx.fillRect(x, y, each, t);
327
+ ctx.fillRect(x + width - each, y, each, t);
328
+ return;
329
+ }
330
+ // the fewest dashes that gap fits between, and one more: whichever
331
+ // count's gap is nearer it
332
+ const few = Math.floor((width + gap) / (dash + gap));
333
+ const wide = (width - few * dash) / (few - 1);
334
+ const narrow = (width - (few + 1) * dash) / few;
335
+ const count = narrow <= 0 || Math.abs(wide - gap) < Math.abs(narrow - gap)
336
+ ? few
337
+ : few + 1;
338
+ const pitch = (width - dash) / (count - 1);
339
+ for (let i = 0; i < count; i += 1) {
340
+ ctx.fillRect(x + Math.round(i * pitch), y, dash, t);
341
+ }
342
+ }
343
+ /** The thickest a dotted rule's dots are squares at: past it a square
344
+ * reads as one. Where Blink's dotted stroke turns its caps round. */
345
+ const SQUARE_DOTS = 3;
346
+ /**
347
+ * A dotted rule: squares a thickness apart while it is thin, and round dots
348
+ * once it is thick enough for the shape to show — under a title, where the
349
+ * thickness follows the font size. The round ones are spread over the
350
+ * width, the first at its start and the last at its end, as many as leave
351
+ * the gap between two nearest to a dot's own width; a rule with room for
352
+ * fewer than two is one dot. A context with no path draws the squares.
353
+ */
354
+ function dottedRule(ctx, x, y, width, t) {
355
+ if (t <= SQUARE_DOTS || !ctx.beginPath || !ctx.roundRect || !ctx.fill) {
356
+ for (let i = 0; i < width; i += 2 * t) {
357
+ ctx.fillRect(x + i, y, Math.min(t, width - i), t);
358
+ }
359
+ return;
360
+ }
361
+ // the fewest dots a gap of their own width fits, and one more: whichever
362
+ // count's gap is nearer that width
363
+ const few = Math.max(1, Math.floor((width + t) / (2 * t)));
364
+ const wide = few > 1 ? (width - few * t) / (few - 1) : Infinity;
365
+ const narrow = (width - (few + 1) * t) / few;
366
+ const count = narrow <= 0 || Math.abs(wide - t) < Math.abs(narrow - t) ? few : few + 1;
367
+ const pitch = count > 1 ? (width - t) / (count - 1) : 0;
368
+ for (let i = 0; i < count; i += 1) {
369
+ // a path a dot: ntk knows a path that is one `roundRect` and fills it
370
+ // from its corners, where a path of them all is rasterized whole
371
+ ctx.beginPath();
372
+ ctx.roundRect(x + i * pitch, y, t, t, [t / 2]);
373
+ ctx.fill();
374
+ }
375
+ }
160
376
  /** A selected empty line still shows as a sliver, so a selection spanning a
161
377
  * blank line does not appear to skip it. Core's own width for the same. */
162
378
  export const EMPTY_LINE_BAND = 4;
@@ -1 +1 @@
1
- {"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/richtext/runs.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,2EAA2E;AAC3E,oEAAoE;AACpE,6EAA6E;AAC7E,UAAU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,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;YACzC,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;IACD,4EAA4E;IAC5E,yEAAyE;IACzE,gBAAgB;IAChB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClC,MAAM,GAAG,GAAmC,EAAE,CAAC;IAC/C,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;YACnC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YACjC,SAAS;QACX,CAAC;QACD,IAAI,KAAK,GAAG,IAAI;YAAE,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,EAAE,CAAC,CAAC;QAC7D,IAAI,IAAI;YAAE,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;IACjC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-x11/components",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "Components for react-x11 that do not belong in the core package",
5
5
  "keywords": [
6
6
  "react",
@@ -154,7 +154,7 @@
154
154
  "prebuild": "rm -rf dist",
155
155
  "build": "tsc -p tsconfig.build.json",
156
156
  "pretest": "npm run build",
157
- "test": "tsx --test test/*.test.ts",
157
+ "test": "tsx --test test/*.test.ts test/html/*.test.ts",
158
158
  "pretypecheck": "npm run build",
159
159
  "typecheck": "tsc -p tsconfig.json",
160
160
  "lint": "eslint .",
@@ -22,10 +22,19 @@
22
22
  import type { Element } from 'domhandler';
23
23
 
24
24
  import { attr, tagOf } from './dom.js';
25
+ import {
26
+ optionElements,
27
+ optionLabel,
28
+ optionValue,
29
+ selectedOptions,
30
+ } from './form.js';
25
31
  import type { ComputedStyle } from './css/style.js';
32
+ import { invert } from './css/transform.js';
26
33
  import { isTransparent } from './css/values.js';
34
+ import { placedMatrix } from './layout/block.js';
27
35
  import type { Box, BoxTree, ReplacedKind } from './layout/boxes.js';
28
36
  import type { FontsLike } from './layout/inline.js';
37
+ import { clipAround } from './paint.js';
29
38
 
30
39
  /** The palette numbers a control's box has to reserve room for. */
31
40
  export interface ControlChrome {
@@ -47,6 +56,14 @@ export interface ControlRect {
47
56
  y: number;
48
57
  width: number;
49
58
  height: number;
59
+ /**
60
+ * The element's computed face and size: what `measureControl` measured
61
+ * its box in, and so what the widget sets its text in. The palette's,
62
+ * from the UA sheet, unless the page set its own — `font: inherit`, which
63
+ * a CSS reset gives every control, for one.
64
+ */
65
+ fontFamily: string;
66
+ fontSize: number;
50
67
  /**
51
68
  * Set on a text field or a `<select>` whose own box the author styled —
52
69
  * gave it a border or a background (`styledField`). The document draws
@@ -63,6 +80,18 @@ export interface ControlRect {
63
80
  * invisible, over its label.
64
81
  */
65
82
  opacity?: number;
83
+ /**
84
+ * The part of the document the element shows through, where that is not
85
+ * all of its box: what its own `clip` and `clip-path` leave of it, and
86
+ * what the boxes that clip their overflow around it, and every
87
+ * `clip-path` above it, do (`clipAround`). The widget is cut to it, as
88
+ * the element's own drawing is. With no area, none of the element shows
89
+ * — a control a page hides for a screen reader alone, 1px square under
90
+ * `clip: rect(0, 0, 0, 0)` or `clip-path: inset(50%)`, beside the one it
91
+ * draws itself — and the widget is not seen and takes no press, and
92
+ * still takes the keyboard's focus, as the element does in a browser.
93
+ */
94
+ clip?: { x: number; y: number; width: number; height: number };
66
95
  }
67
96
 
68
97
  /** Where a styled field's widget goes, and how its text looks. */
@@ -72,7 +101,9 @@ export interface BareField {
72
101
  width: number;
73
102
  height: number;
74
103
  color: string;
104
+ /** @deprecated The rect's own `fontFamily`, which every rect carries. */
75
105
  fontFamily: string;
106
+ /** @deprecated The rect's own `fontSize`, which every rect carries. */
76
107
  fontSize: number;
77
108
  /**
78
109
  * A `<select>`'s: whether it draws its arrow. It does unless the page set
@@ -82,8 +113,9 @@ export interface BareField {
82
113
  chevron?: boolean;
83
114
  }
84
115
 
85
- /** The rectangles every control in a laid-out document landed on. */
86
- export function controlRectsOf(tree: BoxTree): ControlRect[] {
116
+ /** The rectangles every control in a laid-out document landed on. `scale`
117
+ * is the document's device pixels to a CSS one. */
118
+ export function controlRectsOf(tree: BoxTree, scale = 1): ControlRect[] {
87
119
  const out: ControlRect[] = [];
88
120
  for (const box of tree.controls) {
89
121
  if (!box.el) continue;
@@ -97,12 +129,30 @@ export function controlRectsOf(tree: BoxTree): ControlRect[] {
97
129
  y: box.y,
98
130
  width: box.width,
99
131
  height: box.height,
132
+ fontFamily: box.style.fontFamily,
133
+ fontSize: box.style.fontSize,
100
134
  };
101
135
  let opacity = 1;
136
+ // A box scaled to nothing draws nothing of what it holds (CSS
137
+ // Transforms 1, 6), which is how a page keeps a menu it has not opened.
138
+ // A widget in it is not mounted; one in a box turned or scaled to
139
+ // anything else is mounted where the box was laid out, as it is — a
140
+ // widget is a node of its own, which no matrix of the document's reaches.
141
+ let flattened = false;
102
142
  for (let at: Box | null = box; at; at = at.parent) {
103
143
  opacity *= at.style.opacity;
144
+ const matrix = placedMatrix(at);
145
+ if (matrix && !invert(matrix)) flattened = true;
104
146
  }
147
+ if (flattened) continue;
105
148
  if (opacity < 1) rect.opacity = Math.max(0, opacity);
149
+ // cut by the clips around it where they do not leave it whole, and by
150
+ // its own box where it clips itself
151
+ const shown = pixelsOf(box);
152
+ const around = clipAround(box, scale);
153
+ if (clipsItself(box)) {
154
+ rect.clip = around ? between(around, shown) : shown;
155
+ } else if (around && !covers(around, shown)) rect.clip = around;
106
156
  if (styledField(box.replaced, box.style)) {
107
157
  rect.bare = {
108
158
  x: box.contentX,
@@ -122,6 +172,57 @@ export function controlRectsOf(tree: BoxTree): ControlRect[] {
122
172
  return out;
123
173
  }
124
174
 
175
+ type Rect = { x: number; y: number; width: number; height: number };
176
+
177
+ /**
178
+ * Whether a control is cut to its own box: one the page gave an `overflow`
179
+ * other than `visible`, as an inline block's content is cut (CSS 2.1
180
+ * 11.1.1). A browser paints no control past its border box whatever its
181
+ * `overflow` says, scaling a checkbox into a box a pixel square; a widget
182
+ * has a size of its own, and is cut where the page said its box cuts. At
183
+ * the border box, which the widget's own frame is drawn in. A text field is
184
+ * left out: it cuts its own text, and a sheet that gives every `<textarea>`
185
+ * `overflow: auto`, as normalize.css does, asks for nothing here.
186
+ */
187
+ function clipsItself(box: Box): boolean {
188
+ if (box.replaced === 'input' || box.replaced === 'textarea') return false;
189
+ return box.style.overflowX !== 'visible' || box.style.overflowY !== 'visible';
190
+ }
191
+
192
+ /** A box's border box on the pixels it is drawn on. */
193
+ function pixelsOf(box: Box): Rect {
194
+ const x = Math.round(box.x);
195
+ const y = Math.round(box.y);
196
+ return {
197
+ x,
198
+ y,
199
+ width: Math.round(box.x + box.width) - x,
200
+ height: Math.round(box.y + box.height) - y,
201
+ };
202
+ }
203
+
204
+ /** What two rectangles share, of no area where they share nothing. */
205
+ export function between(a: Rect, b: Rect): Rect {
206
+ const x = Math.max(a.x, b.x);
207
+ const y = Math.max(a.y, b.y);
208
+ return {
209
+ x,
210
+ y,
211
+ width: Math.max(0, Math.min(a.x + a.width, b.x + b.width) - x),
212
+ height: Math.max(0, Math.min(a.y + a.height, b.y + b.height) - y),
213
+ };
214
+ }
215
+
216
+ /** Whether a clip leaves a rectangle whole. */
217
+ function covers(clip: Rect, rect: Rect): boolean {
218
+ return (
219
+ clip.x <= rect.x &&
220
+ clip.y <= rect.y &&
221
+ clip.x + clip.width >= rect.x + rect.width &&
222
+ clip.y + clip.height >= rect.y + rect.height
223
+ );
224
+ }
225
+
125
226
  /**
126
227
  * Whether a field's box is the author's to draw: one given a border or a
127
228
  * background of its own, which the UA sheet gives no control, or set to
@@ -261,9 +362,11 @@ export function buttonLabel(el: Element): string {
261
362
  const trimmed = text.trim();
262
363
  if (trimmed) return trimmed;
263
364
  }
365
+ const type = (attr(el, 'type') ?? '').trim().toLowerCase();
366
+ // an image button with no image yet says what the image would have
367
+ if (type === 'image') return attr(el, 'alt') || attr(el, 'value') || 'Submit';
264
368
  const value = attr(el, 'value');
265
369
  if (value) return value;
266
- const type = (attr(el, 'type') ?? '').toLowerCase();
267
370
  if (type === 'submit') return 'Submit';
268
371
  if (type === 'reset') return 'Reset';
269
372
  return attr(el, 'alt') ?? 'Button';
@@ -271,57 +374,17 @@ export function buttonLabel(el: Element): string {
271
374
 
272
375
  /** A `<select>`'s options, as the widget's item list. */
273
376
  export function optionsOf(el: Element): { value: string; label: string }[] {
274
- const out: { value: string; label: string }[] = [];
275
- const walk = (node: Element): void => {
276
- for (const child of node.children) {
277
- if (child.type !== 'tag') continue;
278
- const tag = tagOf(child);
279
- if (tag === 'option') {
280
- let label = '';
281
- for (const kid of child.children) {
282
- if (kid.type === 'text') label += kid.data;
283
- }
284
- const trimmed = label.trim();
285
- out.push({ value: attr(child, 'value') ?? trimmed, label: trimmed });
286
- } else if (tag === 'optgroup') {
287
- walk(child);
288
- }
289
- }
290
- };
291
- walk(el);
292
- return out;
377
+ return optionElements(el).map((option) => ({
378
+ value: optionValue(option),
379
+ label: optionLabel(option),
380
+ }));
293
381
  }
294
382
 
295
- /** Which option a `<select>` starts on: `selected`, else the first. */
383
+ /** Which option a `<select>` shows: the one it has selected, which is the
384
+ * first where none is marked (`selectedOptions`). */
296
385
  export function selectedOption(el: Element): string | null {
297
- const options = optionsOf(el);
298
- const walk = (node: Element): string | null => {
299
- for (const child of node.children) {
300
- if (child.type !== 'tag') continue;
301
- if (tagOf(child) === 'option' && attr(child, 'selected') !== undefined) {
302
- let label = '';
303
- for (const kid of child.children) {
304
- if (kid.type === 'text') label += kid.data;
305
- }
306
- return attr(child, 'value') ?? label.trim();
307
- }
308
- const nested = walk(child);
309
- if (nested !== null) return nested;
310
- }
311
- return null;
312
- };
313
- return walk(el) ?? options[0]?.value ?? null;
314
- }
315
-
316
- /** A `<textarea>`'s initial text — its content, not an attribute. */
317
- export function textareaValue(el: Element): string {
318
- let text = '';
319
- for (const child of el.children) {
320
- if (child.type === 'text') text += child.data;
321
- }
322
- // HTML drops one leading newline after the open tag, which is why a
323
- // pretty-printed `<textarea>` does not start with a blank line.
324
- return text.replace(/^\r?\n/, '');
386
+ const [option] = selectedOptions(el);
387
+ return option ? optionValue(option) : null;
325
388
  }
326
389
 
327
390
  function numberAttr(el: Element, name: string): number | null {