@lynx-js/web-elements-canary 0.11.2 → 0.11.3

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.11.3
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
@@ -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
- * rex unit: chrome 111, safari 17.2, firefox no
43
- * https://developer.mozilla.org/en-US/docs/Web/CSS/length
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('width:1rex')
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, boostedQueueMicrotask, } from '../../element-reactive/index.js';
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
- boostedQueueMicrotask(() => {
106
- this.#getIndicatorContainer().children[this.#dom.currentIndex]?.style.setProperty('background-color', 'var(--indicator-active-color)', 'important');
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() {
@@ -1,4 +1,2 @@
1
1
  export declare const useScrollEnd: boolean;
2
- export declare const isChromium: boolean;
3
- export declare const isWebkit: boolean;
4
2
  export declare const scrollContainerDom: unique symbol;
@@ -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/g;
94
+ const XSSDetector = /<\s*script/;
89
95
  export const templateXImage = (attributes) => {
90
96
  const { src } = attributes;
91
97
  if (src && XSSDetector.test(src)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-elements-canary",
3
- "version": "0.11.2",
3
+ "version": "0.11.3",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",