@lynx-js/web-elements-canary 0.11.2 → 0.11.3-canary-20260228-94e57796
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 +19 -36
- package/dist/compat/LinearContainer/LinearContainer.d.ts +0 -1
- package/dist/compat/LinearContainer/LinearContainer.js +3 -4
- package/dist/elements/XSwiper/XSwiperIndicator.js +3 -4
- package/dist/elements/common/constants.d.ts +0 -2
- package/dist/elements/common/constants.js +0 -7
- package/dist/elements/htmlTemplates.js +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @lynx-js/web-elements
|
|
2
2
|
|
|
3
|
+
## 0.11.3-canary-20260228060137-94e57796c39e9cab1f3790a1986aeacea6a7484e
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix: firefox 147+ layout issue ([#2205](https://github.com/lynx-family/lynx-stack/pull/2205))
|
|
8
|
+
|
|
3
9
|
## 0.11.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -29,11 +35,11 @@
|
|
|
29
35
|
Now we integrated the `LinearCompat` into @lynx-js/web-elements. Developers can safely remove the following imports:
|
|
30
36
|
|
|
31
37
|
```js
|
|
32
|
-
import
|
|
38
|
+
import "@lynx-js/web-elements/compat/LinearContainer";
|
|
33
39
|
```
|
|
34
40
|
|
|
35
41
|
```js
|
|
36
|
-
import
|
|
42
|
+
import "@lynx-js/web-elements-compat/LinearContainer";
|
|
37
43
|
```
|
|
38
44
|
|
|
39
45
|
### Patch Changes
|
|
@@ -59,21 +65,20 @@
|
|
|
59
65
|
### Before
|
|
60
66
|
|
|
61
67
|
```js
|
|
62
|
-
import
|
|
63
|
-
import
|
|
68
|
+
import "@lynx-js/web-elements-template";
|
|
69
|
+
import "@lynx-js/web-elements-compat/LinearContainer";
|
|
64
70
|
```
|
|
65
71
|
|
|
66
72
|
### After
|
|
67
73
|
|
|
68
74
|
```js
|
|
69
|
-
import
|
|
70
|
-
import
|
|
75
|
+
import "@lynx-js/web-elements/html-templates";
|
|
76
|
+
import "@lynx-js/web-elements/compat/LinearContainer";
|
|
71
77
|
```
|
|
72
78
|
|
|
73
79
|
### Patch Changes
|
|
74
80
|
|
|
75
81
|
- refactor: change code structure for improved readability and maintainability ([#2004](https://github.com/lynx-family/lynx-stack/pull/2004))
|
|
76
|
-
|
|
77
82
|
- enable noUnusedLocals for web-elements
|
|
78
83
|
- add source field for supporting @rsbuild/plugin-source-build
|
|
79
84
|
|
|
@@ -108,7 +113,6 @@
|
|
|
108
113
|
- fix: define x-foldview-slot-drag-ng typo. ([#1915](https://github.com/lynx-family/lynx-stack/pull/1915))
|
|
109
114
|
|
|
110
115
|
- feat: 1. Added support for the list `estimated-main-axis-size-px` property; the width and height of `list-item` are no longer required. ([#1911](https://github.com/lynx-family/lynx-stack/pull/1911))
|
|
111
|
-
|
|
112
116
|
2. Fixed an issue where the list `lower-threshold-item-count` event would not trigger when using a horizontal layout under a waterfall layout.
|
|
113
117
|
|
|
114
118
|
3. Fixed an issue where calling the list `autoScroll` method in `useEffect` might not scroll.
|
|
@@ -136,7 +140,6 @@
|
|
|
136
140
|
### Patch Changes
|
|
137
141
|
|
|
138
142
|
- fix: ([#1837](https://github.com/lynx-family/lynx-stack/pull/1837))
|
|
139
|
-
|
|
140
143
|
1. `LynxView.updateData()` cannot trigger `dataProcessor`.
|
|
141
144
|
|
|
142
145
|
2. **This is a break change:** The second parameter of `LynxView.updateData()` has been changed from `UpdateDataType` to `string`, which is the `processorName` (default is `default` which will use `defaultDataProcessor`). This change is to better align with Native. The current complete type is as follows:
|
|
@@ -162,7 +165,6 @@
|
|
|
162
165
|
### Patch Changes
|
|
163
166
|
|
|
164
167
|
- fix: 1. svg use image tag to render, to differentiate background-image styles ([#1668](https://github.com/lynx-family/lynx-stack/pull/1668))
|
|
165
|
-
|
|
166
168
|
1. use blob instead of raw data-uri
|
|
167
169
|
|
|
168
170
|
> Not using data-uri(data:image/svg+xml;utf8,${props.content})
|
|
@@ -213,7 +215,6 @@
|
|
|
213
215
|
### Patch Changes
|
|
214
216
|
|
|
215
217
|
- Add crossorigin attribute support to x-image component ([#1340](https://github.com/lynx-family/lynx-stack/pull/1340))
|
|
216
|
-
|
|
217
218
|
- Added `crossorigin` to the `observedAttributes` array in `ImageSrc.ts`
|
|
218
219
|
- Implemented `#handleCrossorigin` handler using the `bindToAttribute` helper to forward the crossorigin attribute from the custom element to the internal `<img>` element
|
|
219
220
|
- Added comprehensive test coverage to verify the attribute is properly passed through to the shadow DOM
|
|
@@ -376,7 +377,6 @@
|
|
|
376
377
|
### Minor Changes
|
|
377
378
|
|
|
378
379
|
- fix: ([#629](https://github.com/lynx-family/lynx-stack/pull/629))
|
|
379
|
-
|
|
380
380
|
- typo of `initial-scroll-offset` in scroll-view.
|
|
381
381
|
- scroll-view's `initial-scroll-index` is changed to `initial-scroll-to-index`.
|
|
382
382
|
|
|
@@ -403,7 +403,6 @@
|
|
|
403
403
|
- feat: improve compatibility for chrome 108 & support linear-gradient for nested x-text ([#590](https://github.com/lynx-family/lynx-stack/pull/590))
|
|
404
404
|
|
|
405
405
|
**This is a breaking change**
|
|
406
|
-
|
|
407
406
|
- Please upgrade your `@lynx-js/web-elements` to >=0.6.0
|
|
408
407
|
- Please upgrade your `@lynx-js/web-core` to >=0.12.0
|
|
409
408
|
- The compiled lynx template json won't be impacted.
|
|
@@ -426,7 +425,6 @@
|
|
|
426
425
|
- feat: fully support MTS ([#569](https://github.com/lynx-family/lynx-stack/pull/569))
|
|
427
426
|
|
|
428
427
|
Now use support the following usage
|
|
429
|
-
|
|
430
428
|
- mainthread event
|
|
431
429
|
- mainthread ref
|
|
432
430
|
- runOnMainThread/runOnBackground
|
|
@@ -441,7 +439,6 @@
|
|
|
441
439
|
- fix: refactor foldview slot offset logic ([#575](https://github.com/lynx-family/lynx-stack/pull/575))
|
|
442
440
|
|
|
443
441
|
- fix: improve x-foldview-ng ([#513](https://github.com/lynx-family/lynx-stack/pull/513))
|
|
444
|
-
|
|
445
442
|
- support fling for touch event driven scrolling
|
|
446
443
|
- allow the height of `x-foldview-slot-ng` + `x-foldview-toolbar-ng` > `x-foldview-ng`
|
|
447
444
|
- do not prevent horizontal gesture. After this commit we only allow one direction gesture for one touch (start -> end)
|
|
@@ -492,7 +489,6 @@
|
|
|
492
489
|
### Minor Changes
|
|
493
490
|
|
|
494
491
|
- feat: 1. list adds support for the `sticky` attribute. Now sticky-offset, sticky-top, and sticky-bottom will only take effect when `sticky` is `true`. ([#257](https://github.com/lynx-family/lynx-stack/pull/257))
|
|
495
|
-
|
|
496
492
|
2. Added support for `list-main-axis-gap`, `list-cross-axis-gap`.
|
|
497
493
|
|
|
498
494
|
- feat(web): The list element supports list-type with **flow**. ([#240](https://github.com/lynx-family/lynx-stack/pull/240))
|
|
@@ -506,7 +502,6 @@
|
|
|
506
502
|
### Minor Changes
|
|
507
503
|
|
|
508
504
|
- refactor: remove web-elements/lazy and loadNewTag ([#123](https://github.com/lynx-family/lynx-stack/pull/123))
|
|
509
|
-
|
|
510
505
|
- remove @lynx-js/web-elements/lazy
|
|
511
506
|
- remove loadElement
|
|
512
507
|
- remove loadNewTag callback
|
|
@@ -657,11 +652,9 @@
|
|
|
657
652
|
Before this commit, those parent text element with style `color:linear-gradient()` will cause empty content in children inline-text element
|
|
658
653
|
|
|
659
654
|
- f650509: fix: browser compatibility issues
|
|
660
|
-
|
|
661
655
|
1. safari 17.2~18.0 issue
|
|
662
656
|
|
|
663
657
|
`display:linear` doesn't work
|
|
664
|
-
|
|
665
658
|
2. chrome < 99 issue
|
|
666
659
|
|
|
667
660
|
text may be blank on these browsers
|
|
@@ -722,12 +715,10 @@
|
|
|
722
715
|
## 3. Tests not implemented
|
|
723
716
|
|
|
724
717
|
### HTML Tests
|
|
725
|
-
|
|
726
718
|
1. event-layoutcomplete skipped webkit, firefox due to contentvisibilityautostatechange not propagate
|
|
727
719
|
2. get-visible-cells skipped webkit, firefox due to contentvisibilityautostatechange not propagate
|
|
728
720
|
|
|
729
721
|
### React Tests
|
|
730
|
-
|
|
731
722
|
1. lynx.createQuery not supported.
|
|
732
723
|
|
|
733
724
|
- b323923: feat(web): support **ReplaceElement, **CreateImage, \_\_CreateScrollView
|
|
@@ -752,8 +743,8 @@
|
|
|
752
743
|
For compating usage, `@lynx-js/web-elements-compat/LinearContainer` is provided.
|
|
753
744
|
|
|
754
745
|
```javascript
|
|
755
|
-
import
|
|
756
|
-
import
|
|
746
|
+
import "@lynx-js/web-elements-compat/LinearContainer";
|
|
747
|
+
import "@lynx-js/web-elements/all";
|
|
757
748
|
```
|
|
758
749
|
|
|
759
750
|
- f8d1d98: break: rename the `blur` and `focus` event to `lynxblur` and `lynxfocus` for x-input element
|
|
@@ -775,11 +766,11 @@
|
|
|
775
766
|
There is also a simple way to use this feature
|
|
776
767
|
|
|
777
768
|
```javascript
|
|
778
|
-
import { LynxCard } from
|
|
779
|
-
import { loadElement } from
|
|
780
|
-
import
|
|
781
|
-
import
|
|
782
|
-
import
|
|
769
|
+
import { LynxCard } from "@lynx-js/web-core";
|
|
770
|
+
import { loadElement } from "@lynx-js/web-elements/lazy";
|
|
771
|
+
import "@lynx-js/web-elements/index.css";
|
|
772
|
+
import "@lynx-js/web-core/index.css";
|
|
773
|
+
import "./index.css";
|
|
783
774
|
|
|
784
775
|
const lynxcard = new LynxCard({
|
|
785
776
|
...beforeConfigs,
|
|
@@ -792,36 +783,30 @@
|
|
|
792
783
|
- 1fe49a2: feat(web): add custom element x-audio-tt
|
|
793
784
|
|
|
794
785
|
## The behavior is different from the native x-audio-tt:
|
|
795
|
-
|
|
796
786
|
- When src changes, resources will not be loaded immediately. Resources will only be loaded when the play and prepare methods are triggered.
|
|
797
787
|
|
|
798
788
|
> This is because resource loading and decoding are two steps in native lynx, while only resource loading can be controlled in web.
|
|
799
789
|
> So loading and decoding are handled on one side.
|
|
800
|
-
|
|
801
790
|
- The code returned by the binderror event does not include -4
|
|
802
791
|
|
|
803
792
|
## Unimplemented properties:
|
|
804
|
-
|
|
805
793
|
- autoplay
|
|
806
794
|
- playertype
|
|
807
795
|
- experimental-ios-async-prepare
|
|
808
796
|
|
|
809
797
|
## Unimplemented methods:
|
|
810
|
-
|
|
811
798
|
- requestFocus
|
|
812
799
|
- releaseFocus
|
|
813
800
|
|
|
814
801
|
### Patch Changes
|
|
815
802
|
|
|
816
803
|
- 987da15: fix: x-foldview-ng scrolling behavior
|
|
817
|
-
|
|
818
804
|
- fix scrolling behavior on its sub dom-tree has x-refresh-view
|
|
819
805
|
- fix scrolling behavior on its sub dom-tree has x-viewpager-ng
|
|
820
806
|
|
|
821
807
|
- 3e66349: fix: x-viewpager bindchange use scrollEnd to trigger; bindoffsetchange use scroll to trigger.
|
|
822
808
|
- 2b7a4fe: fix: exposure should track the interaction with the closest scroll able ancestor
|
|
823
809
|
- 461d965: fix(web): swiper specifies current and bindchange, may cause jitter problem and some layout problems.
|
|
824
|
-
|
|
825
810
|
1. swiper specifies current and bindchange, may cause jitter problem.
|
|
826
811
|
2. When there are current not 0 && circular, the first layout is not correct.
|
|
827
812
|
3. When there are circular mode='carousel' attributes, the first paint position is not correct.
|
|
@@ -829,7 +814,6 @@
|
|
|
829
814
|
|
|
830
815
|
- 7ee0dc1: fix(web): rename swiper-item to x-swiper-item
|
|
831
816
|
- 7c752d9: fix(web): two bugs of x-textarea and x-input:
|
|
832
|
-
|
|
833
817
|
1. When inputting Chinese characters, you need to send an input event again after the input is completed.
|
|
834
818
|
|
|
835
819
|
2. When the business input event is bound to the input event inside web-elements, the input event will be triggered twice by mistake, so stopImmediatePropagation needs to be prevented in the form
|
|
@@ -854,7 +838,6 @@
|
|
|
854
838
|
- 532380d: fix: ::part()::after selector not work on chrome 100
|
|
855
839
|
- a41965d: fix: foldview horizontal scroll in safari
|
|
856
840
|
- a7a222b: fix(web): x-view-pager-ng
|
|
857
|
-
|
|
858
841
|
1. select-index, initial-select-index should only selectTab if the element has a connectedCallback.
|
|
859
842
|
2. add scroll-snap-stop to x-view-pager-ng, to slide only one element at one time.
|
|
860
843
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type AttributeReactiveClass } from '../../element-reactive/index.js';
|
|
2
|
-
import '../../../src/compat/LinearContainer/linear-compat.css';
|
|
3
2
|
declare class LinearContainerImpl implements InstanceType<AttributeReactiveClass<typeof HTMLElement>> {
|
|
4
3
|
#private;
|
|
5
4
|
static readonly observedAttributes: never[];
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
import { bindToAttribute, } from '../../element-reactive/index.js';
|
|
5
|
-
import '../../../src/compat/LinearContainer/linear-compat.css';
|
|
6
5
|
/** For @container
|
|
7
6
|
* chrome 111, safari 18, firefox no
|
|
8
7
|
*
|
|
@@ -39,15 +38,15 @@ import '../../../src/compat/LinearContainer/linear-compat.css';
|
|
|
39
38
|
* it fixed in 116.0.5806.0, detail: https://issues.chromium.org/issues/40270007
|
|
40
39
|
*
|
|
41
40
|
* so we limit this feature to chrome 117, safari 18, firefox no:
|
|
42
|
-
*
|
|
43
|
-
* https://developer.mozilla.org/en-US/docs/Web/CSS/
|
|
41
|
+
* -webkit-box-reflect: chrome 4, safari 4, firefox no
|
|
42
|
+
* https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/-webkit-box-reflect
|
|
44
43
|
* transition-behavior:allow-discrete: chrome 117, safari 18, firefox 125
|
|
45
44
|
* https://developer.mozilla.org/en-US/docs/Web/CSS/transition-behavior
|
|
46
45
|
* https://caniuse.com/mdn-css_properties_display_is_transitionable
|
|
47
46
|
*
|
|
48
47
|
* update this once firefox supports this.
|
|
49
48
|
*/
|
|
50
|
-
const supportContainerStyleQuery = CSS.supports('
|
|
49
|
+
const supportContainerStyleQuery = CSS.supports('-webkit-box-reflect: above')
|
|
51
50
|
&& CSS.supports('transition-behavior:allow-discrete')
|
|
52
51
|
&& CSS.supports('content-visibility: auto');
|
|
53
52
|
class LinearContainerImpl {
|
|
@@ -4,7 +4,7 @@ import { __esDecorate, __runInitializers } from "tslib";
|
|
|
4
4
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import { genDomGetter, registerAttributeHandler, bindToStyle,
|
|
7
|
+
import { genDomGetter, registerAttributeHandler, bindToStyle, } from '../../element-reactive/index.js';
|
|
8
8
|
let XSwiperIndicator = (() => {
|
|
9
9
|
let __handleIndicatorColor_decorators;
|
|
10
10
|
let __handleIndicatorColor_initializers = [];
|
|
@@ -102,9 +102,8 @@ let XSwiperIndicator = (() => {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
}).bind(this));
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
});
|
|
105
|
+
const firstPaintIndex = parseFloat(this.#dom.getAttribute('current') ?? '0');
|
|
106
|
+
this.#getIndicatorContainer().children[firstPaintIndex]?.style.setProperty('background-color', 'var(--indicator-active-color)', 'important');
|
|
108
107
|
}
|
|
109
108
|
}
|
|
110
109
|
dispose() {
|
|
@@ -3,12 +3,5 @@
|
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
// safari cannot use scrollend event
|
|
5
5
|
export const useScrollEnd = 'onscrollend' in document;
|
|
6
|
-
const UA = window.navigator.userAgent;
|
|
7
|
-
export const isChromium = UA.includes('Chrome');
|
|
8
|
-
export const isWebkit = /\b(iPad|iPhone|iPod|OS X)\b/.test(UA)
|
|
9
|
-
&& !/Edge/.test(UA)
|
|
10
|
-
&& /WebKit/.test(UA)
|
|
11
|
-
// @ts-expect-error
|
|
12
|
-
&& !window.MSStream;
|
|
13
6
|
export const scrollContainerDom = Symbol.for('lynx-scroll-container-dom');
|
|
14
7
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
// Copyright 2024 The Lynx Authors. All rights reserved.
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
|
+
// --- IMPORTANT SYNCHRONIZATION NOTICE ---
|
|
5
|
+
// The templates defined in this file are mirrored in the pure Rust library `web_elements`.
|
|
6
|
+
// If you modify, add, or remove any template in this file, you MUST ALSO update
|
|
7
|
+
// the corresponding Rust implementation in `src/template.rs` to ensure they
|
|
8
|
+
// remain exactly synchronized. Tests enforce this parity.
|
|
9
|
+
// ----------------------------------------
|
|
4
10
|
export const templateScrollView = `<style>
|
|
5
11
|
.placeholder-dom {
|
|
6
12
|
display: none;
|
|
@@ -85,7 +91,7 @@ export const templateScrollView = `<style>
|
|
|
85
91
|
part="bot-fade-mask"
|
|
86
92
|
></div>`;
|
|
87
93
|
export const templateXAudioTT = `<audio id="audio"></audio>`;
|
|
88
|
-
const XSSDetector = /<\s*script
|
|
94
|
+
const XSSDetector = /<\s*script/;
|
|
89
95
|
export const templateXImage = (attributes) => {
|
|
90
96
|
const { src } = attributes;
|
|
91
97
|
if (src && XSSDetector.test(src)) {
|