@lynx-js/web-elements 0.12.5 → 0.12.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @lynx-js/web-elements
2
2
 
3
+ ## 0.12.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix `x-text` custom inline truncation so inline `x-view` children are measured as one inline box instead of double-counting their descendants as extra lines. ([#2917](https://github.com/lynx-family/lynx-stack/pull/2917))
8
+
3
9
  ## 0.12.5
4
10
 
5
11
  ### Patch Changes
@@ -543,6 +543,12 @@ class LazyNodesList {
543
543
  #treeWalker;
544
544
  constructor(dom) {
545
545
  this.#treeWalker = document.createTreeWalker(dom, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT, (node) => {
546
+ for (let element = node.parentElement; element && element !== dom; element = element.parentElement) {
547
+ if (element.tagName === 'X-VIEW') {
548
+ // x-view is measured as a single inline box, so skip its subtree.
549
+ return NodeFilter.FILTER_REJECT;
550
+ }
551
+ }
546
552
  if (node.nodeType === Node.ELEMENT_NODE) {
547
553
  const tagName = node.tagName;
548
554
  if (tagName === 'X-TEXT'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-elements",
3
- "version": "0.12.5",
3
+ "version": "0.12.6",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -139,7 +139,7 @@
139
139
  },
140
140
  "devDependencies": {
141
141
  "@playwright/test": "^1.61.1",
142
- "@rsbuild/core": "2.0.11",
142
+ "@rsbuild/core": "2.1.4",
143
143
  "@rsbuild/plugin-source-build": "1.0.5",
144
144
  "@types/markdown-it": "^14.1.1",
145
145
  "nyc": "^17.1.0",