@lynx-js/web-elements-canary 0.8.1-canary-20250719-fb2ed8d0 → 0.8.2-canary-20250724-3788b611

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,6 +1,21 @@
1
1
  # @lynx-js/web-elements
2
2
 
3
- ## 0.8.1-canary-20250719032935-fb2ed8d080ee4e2ca16671238c0b3a081e81017a
3
+ ## 0.8.2-canary-20250724095727-3788b611514fdd1953dacde1617b2c4e0f776ae7
4
+
5
+ ### Patch Changes
6
+
7
+ - Add crossorigin attribute support to x-image component ([#1340](https://github.com/lynx-family/lynx-stack/pull/1340))
8
+
9
+ - Added `crossorigin` to the `observedAttributes` array in `ImageSrc.ts`
10
+ - Implemented `#handleCrossorigin` handler using the `bindToAttribute` helper to forward the crossorigin attribute from the custom element to the internal `<img>` element
11
+ - Added comprehensive test coverage to verify the attribute is properly passed through to the shadow DOM
12
+
13
+ This enables CORS-enabled image loading when using `<x-image crossorigin="anonymous">` or similar configurations.
14
+
15
+ - Updated dependencies []:
16
+ - @lynx-js/web-elements-template@0.8.2-canary-20250724095727-3788b611514fdd1953dacde1617b2c4e0f776ae7
17
+
18
+ ## 0.8.1
4
19
 
5
20
  ### Patch Changes
6
21
 
@@ -14,7 +29,7 @@
14
29
  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
30
 
16
31
  - Updated dependencies [[`443f3d5`](https://github.com/lynx-family/lynx-stack/commit/443f3d57fc9ac41c3e845bdba5adfa4df16e5519)]:
17
- - @lynx-js/web-elements-template@0.8.1-canary-20250719032935-fb2ed8d080ee4e2ca16671238c0b3a081e81017a
32
+ - @lynx-js/web-elements-template@0.8.1
18
33
 
19
34
  ## 0.8.0
20
35
 
@@ -15,12 +15,16 @@ let ImageSrc = (() => {
15
15
  let _private_handleBlurRadius_decorators;
16
16
  let _private_handleBlurRadius_initializers = [];
17
17
  let _private_handleBlurRadius_extraInitializers = [];
18
+ let _private_handleCrossorigin_decorators;
19
+ let _private_handleCrossorigin_initializers = [];
20
+ let _private_handleCrossorigin_extraInitializers = [];
18
21
  return class ImageSrc {
19
22
  static {
20
23
  const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
21
24
  _private_handleSrc_decorators = [registerAttributeHandler('src', true)];
22
25
  _private_preloadPlaceholder_decorators = [registerAttributeHandler('placeholder', true)];
23
26
  _private_handleBlurRadius_decorators = [registerAttributeHandler('blur-radius', true)];
27
+ _private_handleCrossorigin_decorators = [registerAttributeHandler('crossorigin', true)];
24
28
  __esDecorate(this, _private_preloadPlaceholder_descriptor = { value: __setFunctionName(function (newVal) {
25
29
  if (newVal) {
26
30
  new Image().src = newVal;
@@ -28,9 +32,15 @@ let ImageSrc = (() => {
28
32
  }, "#preloadPlaceholder") }, _private_preloadPlaceholder_decorators, { kind: "method", name: "#preloadPlaceholder", static: false, private: true, access: { has: obj => #preloadPlaceholder in obj, get: obj => obj.#preloadPlaceholder }, metadata: _metadata }, null, _instanceExtraInitializers);
29
33
  __esDecorate(null, null, _private_handleSrc_decorators, { kind: "field", name: "#handleSrc", static: false, private: true, access: { has: obj => #handleSrc in obj, get: obj => obj.#handleSrc, set: (obj, value) => { obj.#handleSrc = value; } }, metadata: _metadata }, _private_handleSrc_initializers, _private_handleSrc_extraInitializers);
30
34
  __esDecorate(null, null, _private_handleBlurRadius_decorators, { kind: "field", name: "#handleBlurRadius", static: false, private: true, access: { has: obj => #handleBlurRadius in obj, get: obj => obj.#handleBlurRadius, set: (obj, value) => { obj.#handleBlurRadius = value; } }, metadata: _metadata }, _private_handleBlurRadius_initializers, _private_handleBlurRadius_extraInitializers);
35
+ __esDecorate(null, null, _private_handleCrossorigin_decorators, { kind: "field", name: "#handleCrossorigin", static: false, private: true, access: { has: obj => #handleCrossorigin in obj, get: obj => obj.#handleCrossorigin, set: (obj, value) => { obj.#handleCrossorigin = value; } }, metadata: _metadata }, _private_handleCrossorigin_initializers, _private_handleCrossorigin_extraInitializers);
31
36
  if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
32
37
  }
33
- static observedAttributes = ['src', 'placeholder', 'blur-radius'];
38
+ static observedAttributes = [
39
+ 'src',
40
+ 'placeholder',
41
+ 'blur-radius',
42
+ 'crossorigin',
43
+ ];
34
44
  #dom = __runInitializers(this, _instanceExtraInitializers);
35
45
  #getImg = genDomGetter(() => this.#dom.shadowRoot, '#img');
36
46
  #handleSrc = __runInitializers(this, _private_handleSrc_initializers, bindToAttribute(this.#getImg, 'src', (newval) => {
@@ -38,7 +48,8 @@ let ImageSrc = (() => {
38
48
  }));
39
49
  get #preloadPlaceholder() { return _private_preloadPlaceholder_descriptor.value; }
40
50
  #handleBlurRadius = (__runInitializers(this, _private_handleSrc_extraInitializers), __runInitializers(this, _private_handleBlurRadius_initializers, bindToStyle(this.#getImg, '--blur-radius', undefined, true)));
41
- #onImageError = (__runInitializers(this, _private_handleBlurRadius_extraInitializers), () => {
51
+ #handleCrossorigin = (__runInitializers(this, _private_handleBlurRadius_extraInitializers), __runInitializers(this, _private_handleCrossorigin_initializers, bindToAttribute(this.#getImg, 'crossorigin')));
52
+ #onImageError = (__runInitializers(this, _private_handleCrossorigin_extraInitializers), () => {
42
53
  const currentSrc = this.#getImg().src;
43
54
  const placeholder = this.#dom.getAttribute('placeholder');
44
55
  if (placeholder && currentSrc !== placeholder) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-elements-canary",
3
- "version": "0.8.1-canary-20250719-fb2ed8d0",
3
+ "version": "0.8.2-canary-20250724-3788b611",
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": "npm:@lynx-js/web-elements-reactive-canary@0.2.2",
104
- "@lynx-js/web-elements-template": "npm:@lynx-js/web-elements-template-canary@0.8.1-canary-20250719-fb2ed8d0"
104
+ "@lynx-js/web-elements-template": "npm:@lynx-js/web-elements-template-canary@0.8.2-canary-20250724-3788b611"
105
105
  },
106
106
  "devDependencies": {
107
107
  "tslib": "^2.8.1"