@lynx-js/web-core-canary 0.19.1 → 0.19.2-canary-20251216-e38e21a1

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,17 @@
1
1
  # @lynx-js/web-core
2
2
 
3
+ ## 0.19.2-canary-20251216115050-e38e21a13bc43472da91f99f6cc60266d7e0de8b
4
+
5
+ ### Patch Changes
6
+
7
+ - fix csp issue for mts realm ([#1998](https://github.com/lynx-family/lynx-stack/pull/1998))
8
+
9
+ - Updated dependencies []:
10
+ - @lynx-js/web-constants@0.19.2-canary-20251216115050-e38e21a13bc43472da91f99f6cc60266d7e0de8b
11
+ - @lynx-js/web-mainthread-apis@0.19.2-canary-20251216115050-e38e21a13bc43472da91f99f6cc60266d7e0de8b
12
+ - @lynx-js/web-worker-rpc@0.19.2-canary-20251216115050-e38e21a13bc43472da91f99f6cc60266d7e0de8b
13
+ - @lynx-js/web-worker-runtime@0.19.2-canary-20251216115050-e38e21a13bc43472da91f99f6cc60266d7e0de8b
14
+
3
15
  ## 0.19.1
4
16
 
5
17
  ### Patch Changes
@@ -428,25 +440,25 @@
428
440
  lynxView.initI18nResources = [
429
441
  {
430
442
  options: {
431
- locale: 'en',
432
- channel: '1',
433
- fallback_url: '',
443
+ locale: "en",
444
+ channel: "1",
445
+ fallback_url: "",
434
446
  },
435
447
  resource: {
436
- hello: 'hello',
437
- lynx: 'lynx web platform1',
448
+ hello: "hello",
449
+ lynx: "lynx web platform1",
438
450
  },
439
451
  },
440
452
  ];
441
- lynxView.addEventListener('i18nResourceMissed', (e) => {
453
+ lynxView.addEventListener("i18nResourceMissed", (e) => {
442
454
  console.log(e);
443
455
  });
444
456
 
445
457
  // mts
446
458
  _I18nResourceTranslation({
447
- locale: 'en',
448
- channel: '1',
449
- fallback_url: '',
459
+ locale: "en",
460
+ channel: "1",
461
+ fallback_url: "",
450
462
  });
451
463
  ```
452
464
 
@@ -854,8 +866,8 @@
854
866
  }
855
867
  };`,
856
868
  ],
857
- { type: 'text/javascript' },
858
- ),
869
+ { type: "text/javascript" }
870
+ )
859
871
  ),
860
872
  };
861
873
  lynxView.nativeModulesMap = nativeModulesMap;
@@ -970,8 +982,8 @@
970
982
  };
971
983
  };`,
972
984
  ],
973
- { type: 'text/javascript' },
974
- ),
985
+ { type: "text/javascript" }
986
+ )
975
987
  );
976
988
 
977
989
  const color_methods = URL.createObjectURL(
@@ -986,8 +998,8 @@
986
998
  };
987
999
  };`,
988
1000
  ],
989
- { type: 'text/javascript' },
990
- ),
1001
+ { type: "text/javascript" }
1002
+ )
991
1003
  );
992
1004
 
993
1005
  lynxView.napiModuleMap = {
@@ -1004,7 +1016,7 @@
1004
1016
 
1005
1017
  ```js
1006
1018
  lynxView.onNapiModulesCall = (name, data, moduleName) => {
1007
- if (name === 'getColor' && moduleName === 'color_methods') {
1019
+ if (name === "getColor" && moduleName === "color_methods") {
1008
1020
  return data.color;
1009
1021
  }
1010
1022
  };
@@ -1083,8 +1095,8 @@
1083
1095
  }
1084
1096
  };`,
1085
1097
  ],
1086
- { type: 'text/javascript' },
1087
- ),
1098
+ { type: "text/javascript" }
1099
+ )
1088
1100
  );
1089
1101
  ```
1090
1102
 
@@ -1096,7 +1108,7 @@
1096
1108
 
1097
1109
  ```js
1098
1110
  lynxView.onNativeModulesCall = (name, data, callback) => {
1099
- if (name === 'getColor') {
1111
+ if (name === "getColor") {
1100
1112
  callback(data.color);
1101
1113
  }
1102
1114
  };
@@ -1106,7 +1118,7 @@
1106
1118
 
1107
1119
  ```js
1108
1120
  lynxView.onNativeModulesCall = (name, data, moduleName) => {
1109
- if (name === 'getColor' && moduleName === 'bridge') {
1121
+ if (name === "getColor" && moduleName === "bridge") {
1110
1122
  return data.color;
1111
1123
  }
1112
1124
  };
@@ -1464,7 +1476,7 @@
1464
1476
  This flag changes the behaviour of cascading. It provide a way to do this
1465
1477
 
1466
1478
  ```jsx
1467
- <view class='class-a class-b' />;
1479
+ <view class="class-a class-b" />
1468
1480
  ```
1469
1481
 
1470
1482
  The class-b will override (cascading) styles of class-a.
@@ -1564,11 +1576,11 @@
1564
1576
  There is also a simple way to use this feature
1565
1577
 
1566
1578
  ```javascript
1567
- import { LynxCard } from '@lynx-js/web-core';
1568
- import { loadElement } from '@lynx-js/web-elements/lazy';
1569
- import '@lynx-js/web-elements/index.css';
1570
- import '@lynx-js/web-core/index.css';
1571
- import './index.css';
1579
+ import { LynxCard } from "@lynx-js/web-core";
1580
+ import { loadElement } from "@lynx-js/web-elements/lazy";
1581
+ import "@lynx-js/web-elements/index.css";
1582
+ import "@lynx-js/web-core/index.css";
1583
+ import "./index.css";
1572
1584
 
1573
1585
  const lynxcard = new LynxCard({
1574
1586
  ...beforeConfigs,
@@ -6,7 +6,8 @@ import { Rpc } from '@lynx-js/web-worker-rpc';
6
6
  import { dispatchLynxViewEvent } from '../utils/dispatchLynxViewEvent.js';
7
7
  import { createExposureMonitor } from './crossThreadHandlers/createExposureMonitor.js';
8
8
  const existingScript = document.querySelector('script[nonce]');
9
- const nonce = existingScript?.nonce || existingScript?.getAttribute('nonce');
9
+ const nonce = existingScript?.nonce || existingScript?.getAttribute('nonce')
10
+ || '';
10
11
  const { prepareMainThreadAPIs, } = await import(
11
12
  /* webpackChunkName: "web-core-main-thread-apis" */
12
13
  /* webpackMode: "lazy-once" */
@@ -31,7 +32,7 @@ async function createIFrameRealm(parent) {
31
32
  });
32
33
  iframe.style.display = 'none';
33
34
  iframe.srcdoc =
34
- '<!DOCTYPE html><html><head><script>parent.postMessage("lynx:mtsready","*")</script></head><body style="display:none"></body></html>';
35
+ `<!DOCTYPE html><html><head><script nonce="${nonce}">parent.postMessage("lynx:mtsready","*")</script></head><body style="display:none"></body></html>`;
35
36
  iframe.sandbox = 'allow-same-origin allow-scripts'; // Restrict capabilities for security
36
37
  iframe.loading = 'eager';
37
38
  parent.appendChild(iframe);
@@ -42,7 +43,7 @@ async function createIFrameRealm(parent) {
42
43
  script.fetchPriority = 'high';
43
44
  script.defer = true;
44
45
  script.async = false;
45
- script.nonce = nonce || '';
46
+ script.nonce = nonce;
46
47
  iframe.contentDocument.head.appendChild(script);
47
48
  return new Promise(async (resolve, reject) => {
48
49
  script.onload = () => {
@@ -63,6 +64,7 @@ async function createIFrameRealm(parent) {
63
64
  xhr.send(null);
64
65
  if (xhr.status === 200) {
65
66
  const script = iframe.contentDocument.createElement('script');
67
+ script.nonce = nonce;
66
68
  script.textContent = xhr.responseText;
67
69
  // @ts-expect-error
68
70
  iframeWindow.module = { exports: undefined };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-core-canary",
3
- "version": "0.19.1",
3
+ "version": "0.19.2-canary-20251216-e38e21a1",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [],
@@ -25,10 +25,10 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "@lynx-js/offscreen-document": "npm:@lynx-js/offscreen-document-canary@0.1.4",
28
- "@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.1",
29
- "@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.1",
30
- "@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.1",
31
- "@lynx-js/web-worker-runtime": "npm:@lynx-js/web-worker-runtime-canary@0.19.1"
28
+ "@lynx-js/web-constants": "npm:@lynx-js/web-constants-canary@0.19.2-canary-20251216-e38e21a1",
29
+ "@lynx-js/web-mainthread-apis": "npm:@lynx-js/web-mainthread-apis-canary@0.19.2-canary-20251216-e38e21a1",
30
+ "@lynx-js/web-worker-rpc": "npm:@lynx-js/web-worker-rpc-canary@0.19.2-canary-20251216-e38e21a1",
31
+ "@lynx-js/web-worker-runtime": "npm:@lynx-js/web-worker-runtime-canary@0.19.2-canary-20251216-e38e21a1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@lynx-js/lynx-core": "0.1.3",