@react-x11/components 0.14.1 → 0.16.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 (96) hide show
  1. package/dist/code-editor/node.d.ts +13 -0
  2. package/dist/code-editor/node.d.ts.map +1 -1
  3. package/dist/code-editor/node.js +23 -5
  4. package/dist/code-editor/node.js.map +1 -1
  5. package/dist/html/css/cascade.d.ts +171 -26
  6. package/dist/html/css/cascade.d.ts.map +1 -1
  7. package/dist/html/css/cascade.js +616 -216
  8. package/dist/html/css/cascade.js.map +1 -1
  9. package/dist/html/css/color.d.ts +25 -0
  10. package/dist/html/css/color.d.ts.map +1 -1
  11. package/dist/html/css/color.js +307 -19
  12. package/dist/html/css/color.js.map +1 -1
  13. package/dist/html/css/content.d.ts +11 -6
  14. package/dist/html/css/content.d.ts.map +1 -1
  15. package/dist/html/css/content.js +171 -12
  16. package/dist/html/css/content.js.map +1 -1
  17. package/dist/html/css/parse.d.ts.map +1 -1
  18. package/dist/html/css/parse.js +62 -9
  19. package/dist/html/css/parse.js.map +1 -1
  20. package/dist/html/css/shapes.d.ts +18 -0
  21. package/dist/html/css/shapes.d.ts.map +1 -1
  22. package/dist/html/css/shapes.js +21 -1
  23. package/dist/html/css/shapes.js.map +1 -1
  24. package/dist/html/css/style.d.ts +42 -5
  25. package/dist/html/css/style.d.ts.map +1 -1
  26. package/dist/html/css/style.js +74 -12
  27. package/dist/html/css/style.js.map +1 -1
  28. package/dist/html/css/ua.js +15 -0
  29. package/dist/html/css/ua.js.map +1 -1
  30. package/dist/html/css/values.d.ts +5 -0
  31. package/dist/html/css/values.d.ts.map +1 -1
  32. package/dist/html/css/values.js +18 -9
  33. package/dist/html/css/values.js.map +1 -1
  34. package/dist/html/index.d.ts.map +1 -1
  35. package/dist/html/index.js +7 -0
  36. package/dist/html/index.js.map +1 -1
  37. package/dist/html/layout/block.d.ts +29 -9
  38. package/dist/html/layout/block.d.ts.map +1 -1
  39. package/dist/html/layout/block.js +141 -52
  40. package/dist/html/layout/block.js.map +1 -1
  41. package/dist/html/layout/boxes.d.ts +16 -2
  42. package/dist/html/layout/boxes.d.ts.map +1 -1
  43. package/dist/html/layout/boxes.js +144 -23
  44. package/dist/html/layout/boxes.js.map +1 -1
  45. package/dist/html/layout/css-grid.d.ts.map +1 -1
  46. package/dist/html/layout/css-grid.js +11 -9
  47. package/dist/html/layout/css-grid.js.map +1 -1
  48. package/dist/html/layout/flex.d.ts.map +1 -1
  49. package/dist/html/layout/flex.js +1631 -221
  50. package/dist/html/layout/flex.js.map +1 -1
  51. package/dist/html/layout/inline.d.ts +15 -3
  52. package/dist/html/layout/inline.d.ts.map +1 -1
  53. package/dist/html/layout/inline.js +23 -8
  54. package/dist/html/layout/inline.js.map +1 -1
  55. package/dist/html/layout/table.d.ts +27 -1
  56. package/dist/html/layout/table.d.ts.map +1 -1
  57. package/dist/html/layout/table.js +886 -324
  58. package/dist/html/layout/table.js.map +1 -1
  59. package/dist/html/node.d.ts +35 -4
  60. package/dist/html/node.d.ts.map +1 -1
  61. package/dist/html/node.js +118 -26
  62. package/dist/html/node.js.map +1 -1
  63. package/dist/html/paint.d.ts.map +1 -1
  64. package/dist/html/paint.js +558 -178
  65. package/dist/html/paint.js.map +1 -1
  66. package/dist/html/resources.js +14 -1
  67. package/dist/html/resources.js.map +1 -1
  68. package/dist/html/svg.d.ts +23 -7
  69. package/dist/html/svg.d.ts.map +1 -1
  70. package/dist/html/svg.js +264 -59
  71. package/dist/html/svg.js.map +1 -1
  72. package/dist/html/widgets.d.ts.map +1 -1
  73. package/dist/html/widgets.js +57 -4
  74. package/dist/html/widgets.js.map +1 -1
  75. package/package.json +3 -3
  76. package/src/code-editor/node.ts +24 -5
  77. package/src/html/css/cascade.ts +697 -221
  78. package/src/html/css/color.ts +345 -18
  79. package/src/html/css/content.ts +173 -15
  80. package/src/html/css/parse.ts +60 -8
  81. package/src/html/css/shapes.ts +35 -1
  82. package/src/html/css/style.ts +122 -17
  83. package/src/html/css/ua.ts +15 -0
  84. package/src/html/css/values.ts +23 -9
  85. package/src/html/index.ts +7 -0
  86. package/src/html/layout/block.ts +149 -58
  87. package/src/html/layout/boxes.ts +171 -27
  88. package/src/html/layout/css-grid.ts +12 -9
  89. package/src/html/layout/flex.ts +1843 -212
  90. package/src/html/layout/inline.ts +27 -7
  91. package/src/html/layout/table.ts +961 -332
  92. package/src/html/node.ts +151 -27
  93. package/src/html/paint.ts +692 -234
  94. package/src/html/resources.ts +13 -1
  95. package/src/html/svg.ts +299 -56
  96. package/src/html/widgets.ts +61 -4
@@ -483,7 +483,7 @@ function linesOf(
483
483
  // text a box's background shows through (`background-clip: text`): its
484
484
  // layouts are made through a recorder, so paint can lay the same text out
485
485
  // again with no ink of its own and fill it with that background
486
- if (options.clipText && clipsText(block, items)) {
486
+ if (options.clipText && clipsText(items)) {
487
487
  CLIPPED_TEXT.add(block);
488
488
  fonts = recording(fonts);
489
489
  }
@@ -5333,6 +5333,22 @@ function alignShift(
5333
5333
  }
5334
5334
  }
5335
5335
 
5336
+ /**
5337
+ * Where an empty line in `style`'s block sets the point it holds, between
5338
+ * `left` and `right`: an absolutely positioned box that was inline-level
5339
+ * before it was made a block has its static position there, as though it
5340
+ * were all its line held (CSS 2.1 10.3.7, as browsers place it). Such a
5341
+ * line is its block's last, which `text-align-last` sets.
5342
+ */
5343
+ export function emptyLinePoint(
5344
+ style: ComputedStyle,
5345
+ left: number,
5346
+ right: number,
5347
+ ): number {
5348
+ const shift = alignShift(lastAlignOf(style), style.direction === 'rtl');
5349
+ return left + (right - left) * shift;
5350
+ }
5351
+
5336
5352
  /** How far a line of a layout moves to where it belongs in its box. */
5337
5353
  type LinePlacer = (line: { x: number; width: number }) => number;
5338
5354
 
@@ -5392,9 +5408,9 @@ export function inklessLayout(layout: object): TextLayoutLike | null {
5392
5408
  }
5393
5409
 
5394
5410
  /** Whether any of a block's text is text a background shows through. */
5395
- function clipsText(block: Box, items: Item[]): boolean {
5411
+ function clipsText(items: Item[]): boolean {
5396
5412
  for (const item of items) {
5397
- if (item.kind === 'text' && !item.control && clipBoxOf(item.box, block)) {
5413
+ if (item.kind === 'text' && !item.control && clipBoxOf(item.box)) {
5398
5414
  return true;
5399
5415
  }
5400
5416
  }
@@ -5402,12 +5418,16 @@ function clipsText(block: Box, items: Item[]): boolean {
5402
5418
  }
5403
5419
 
5404
5420
  /** The box whose background a text box's glyphs show: the nearest element
5405
- * box from it up to the block its lines are in with `background-clip:
5406
- * text`, or null. */
5407
- export function clipBoxOf(box: Box | null, block: Box): Box | null {
5421
+ * box from it up with `background-clip: text`, or null. That is past the
5422
+ * block its lines are in: an ancestor's background is clipped to the text
5423
+ * of its descendants in flow and floating, a block, an inline-block, a
5424
+ * flex item or a table cell's among them (CSS Backgrounds 4, 3.7), and
5425
+ * `bg-clip-text` on a `<div>` round a heading showed nothing through it.
5426
+ * Not past an absolutely positioned box, whose text is its own. */
5427
+ export function clipBoxOf(box: Box | null): Box | null {
5408
5428
  for (let at = box; at; at = at.parent) {
5409
5429
  if (at.kind !== 'text' && at.style.backgroundClipText) return at;
5410
- if (at === block) break;
5430
+ if (at.outOfFlow) return null;
5411
5431
  }
5412
5432
  return null;
5413
5433
  }