@lynx-js/web-elements 0.8.0 → 0.8.1

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,21 @@
1
1
  # @lynx-js/web-elements
2
2
 
3
+ ## 0.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: indicator dots' bg-color on safari 26 ([#1298](https://github.com/lynx-family/lynx-stack/pull/1298))
8
+
9
+ https://bugs.webkit.org/show_bug.cgi?id=296048
10
+ The animation name should be defined in the template
11
+
12
+ - fix: list may only render only one column in ReactLynx. ([#1280](https://github.com/lynx-family/lynx-stack/pull/1280))
13
+
14
+ This is because `span-count` may not be specified when `list-type` is specified, resulting in layout according to `span-count="1"`. Postponing the acquisition of `span-count` until layoutListItem can solve this problem.
15
+
16
+ - Updated dependencies [[`443f3d5`](https://github.com/lynx-family/lynx-stack/commit/443f3d57fc9ac41c3e845bdba5adfa4df16e5519)]:
17
+ - @lynx-js/web-elements-template@0.8.1
18
+
3
19
  ## 0.8.0
4
20
 
5
21
  ### Minor Changes
@@ -17,20 +17,15 @@ let XListWaterfall = (() => {
17
17
  _private_handlerListType_decorators = [registerAttributeHandler('list-type', true)];
18
18
  __esDecorate(this, _private_handlerListType_descriptor = { value: __setFunctionName(function (newVal) {
19
19
  if (newVal === 'waterfall') {
20
- const spanCount = parseFloat(this.#dom.getAttribute('span-count')
21
- || this.#dom.getAttribute('column-count')
22
- || '') || 1;
23
- const scrollOrientation = this.#dom.getAttribute('scroll-orientation')
24
- || 'vertical';
25
20
  this.#createWaterfallContainer();
26
21
  if (!this.#resizeObserver) {
27
- this.#resizeObserverInit(spanCount, scrollOrientation === 'vertical');
22
+ this.#resizeObserverInit();
28
23
  }
29
24
  if (!this.#childrenObserver) {
30
25
  this.#childrenObserver = new MutationObserver((mutationList) => {
31
26
  const mutation = mutationList?.[0];
32
27
  if (mutation?.type === 'childList') {
33
- this.#resizeObserverInit(spanCount, scrollOrientation === 'vertical');
28
+ this.#resizeObserverInit();
34
29
  }
35
30
  });
36
31
  this.#childrenObserver.observe(this.#dom, {
@@ -65,7 +60,12 @@ let XListWaterfall = (() => {
65
60
  this.#dom.shadowRoot?.querySelector('[part=upper-threshold-observer]')
66
61
  ?.insertAdjacentElement('afterend', waterfallSlot);
67
62
  };
68
- #layoutListItem = (spanCount, isScrollVertical) => {
63
+ #layoutListItem = () => {
64
+ const spanCount = parseFloat(this.#dom.getAttribute('span-count')
65
+ || this.#dom.getAttribute('column-count')
66
+ || '') || 1;
67
+ const isScrollVertical = (this.#dom.getAttribute('scroll-orientation')
68
+ || 'vertical') === 'vertical';
69
69
  const measurements = new Array(spanCount).fill(0);
70
70
  for (let i = 0; i < this.#dom.children.length; i++) {
71
71
  const listItem = this.#dom.children[i];
@@ -149,13 +149,13 @@ let XListWaterfall = (() => {
149
149
  constructor(dom) {
150
150
  this.#dom = dom;
151
151
  }
152
- #resizeObserverInit = (spanCount, isScrollVertical) => {
152
+ #resizeObserverInit = () => {
153
153
  this.#resizeObserver?.disconnect();
154
154
  this.#resizeObserver = new ResizeObserver(() => {
155
155
  // may cause: Resizeobserver loop completed with undelivered notifications
156
156
  // https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver#observation_errors
157
157
  requestAnimationFrame(() => {
158
- this.#layoutListItem(spanCount, isScrollVertical);
158
+ this.#layoutListItem();
159
159
  });
160
160
  });
161
161
  Array.from(this.#dom.children).forEach(element => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-elements",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -101,7 +101,7 @@
101
101
  ],
102
102
  "dependencies": {
103
103
  "@lynx-js/web-elements-reactive": "0.2.2",
104
- "@lynx-js/web-elements-template": "0.8.0"
104
+ "@lynx-js/web-elements-template": "0.8.1"
105
105
  },
106
106
  "devDependencies": {
107
107
  "tslib": "^2.8.1"
@@ -171,8 +171,6 @@ x-swiper::part(indicator-item) {
171
171
  flex: 0 0 var(--indicator-size);
172
172
  margin: 0 calc(var(--indicator-size) / 5) 0 calc(var(--indicator-size) / 5);
173
173
  border-radius: 100%;
174
- animation-name: indicator-dot;
175
- animation-duration: 100ms;
176
174
  }
177
175
 
178
176
  x-swiper[vertical]::part(indicator-item) {