@lynx-js/web-elements 0.12.7 → 0.12.8

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,15 @@
1
1
  # @lynx-js/web-elements
2
2
 
3
+ ## 0.12.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Keep XList scroll offsets and automatic scrolling aligned with its configured orientation. ([#3357](https://github.com/lynx-family/lynx-stack/pull/3357))
8
+
9
+ - Updated dependency `dompurify` to `^3.4.13`. ([#3417](https://github.com/lynx-family/lynx-stack/pull/3417))
10
+
11
+ - Updated dependency `markdown-it` to `^15.0.0`. ([#3423](https://github.com/lynx-family/lynx-stack/pull/3423))
12
+
3
13
  ## 0.12.7
4
14
 
5
15
  ### Patch Changes
@@ -42,7 +42,7 @@ let XList = (() => {
42
42
  this.#getListContainer().scrollTop = val;
43
43
  }
44
44
  get scrollLeft() {
45
- return this.#getListContainer().scrollTop;
45
+ return this.#getListContainer().scrollLeft;
46
46
  }
47
47
  set scrollLeft(val) {
48
48
  this.#getListContainer().scrollLeft = val;
@@ -60,7 +60,7 @@ let XList = (() => {
60
60
  return super.scrollTop;
61
61
  }
62
62
  get __scrollLeft() {
63
- return super.scrollTop;
63
+ return super.scrollLeft;
64
64
  }
65
65
  scrollToPosition(params) {
66
66
  let offset;
@@ -110,15 +110,15 @@ let XList = (() => {
110
110
  const scrollContainer = this.#getListContainer();
111
111
  const deltaTime = timestamp - this.#autoScrollOptions.lastTimestamp;
112
112
  const tickDistance = (deltaTime / 1000) * this.#autoScrollOptions.rate;
113
+ const isScrollVertical = (this.getAttribute('scroll-orientation')
114
+ || 'vertical') === 'vertical';
113
115
  scrollContainer.scrollBy({
114
- left: tickDistance,
115
- top: tickDistance,
116
+ left: isScrollVertical ? 0 : tickDistance,
117
+ top: isScrollVertical ? tickDistance : 0,
116
118
  // smooth might cause lag when scrolling.
117
119
  behavior: 'auto',
118
120
  });
119
121
  this.#autoScrollOptions.lastTimestamp = timestamp;
120
- const isScrollVertical = (this.getAttribute('scroll-orientation')
121
- || 'vertical') === 'vertical';
122
122
  const isContainerScrollable = isScrollVertical
123
123
  ? scrollContainer.scrollTop + scrollContainer.clientHeight
124
124
  >= scrollContainer.scrollHeight
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-elements",
3
- "version": "0.12.7",
3
+ "version": "0.12.8",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -134,12 +134,12 @@
134
134
  "**/*.css"
135
135
  ],
136
136
  "dependencies": {
137
- "dompurify": "^3.4.12",
138
- "markdown-it": "^14.3.0"
137
+ "dompurify": "^3.4.13",
138
+ "markdown-it": "^15.0.0"
139
139
  },
140
140
  "devDependencies": {
141
141
  "@playwright/test": "^1.61.1",
142
- "@rsbuild/core": "2.1.7",
142
+ "@rsbuild/core": "2.1.10",
143
143
  "@rsbuild/plugin-source-build": "1.0.6",
144
144
  "@types/markdown-it": "^14.1.2",
145
145
  "@types/node": "^24.13.3",
@@ -192,10 +192,6 @@ x-list::part(lower-threshold-observer) {
192
192
  flex-direction: column-reverse;
193
193
  }
194
194
 
195
- x-list[vertical-orientation="false"]::part(lower-threshold-observer) {
196
- flex-direction: row-reverse;
197
- }
198
-
199
195
  /* list-type single */
200
196
  x-list {
201
197
  display: flex;