@lynx-js/web-core-server 0.19.7 → 0.19.9

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,9 @@
1
1
  # @lynx-js/web-core-server
2
2
 
3
+ ## 0.19.9
4
+
5
+ ## 0.19.8
6
+
3
7
  ## 0.19.7
4
8
 
5
9
  ## 0.19.6
package/dist/131.js CHANGED
@@ -152,6 +152,7 @@ __webpack_require__.add({
152
152
  OE: ()=>_constants_js__rspack_import_0.OE,
153
153
  Pb: ()=>_constants_js__rspack_import_0.Pb,
154
154
  SP: ()=>"l-uid",
155
+ Uc: ()=>_types_index_js__rspack_import_3.Uc,
155
156
  Ve: ()=>_endpoints_js__rspack_import_2.Ve,
156
157
  WS: ()=>_endpoints_js__rspack_import_2.WS,
157
158
  Yx: ()=>_utils_index_js__rspack_import_4.Yx,
@@ -180,7 +181,10 @@ __webpack_require__.add({
180
181
  var _types_index_js__rspack_import_3 = __webpack_require__("../web-constants/dist/types/index.js");
181
182
  var _utils_index_js__rspack_import_4 = __webpack_require__("../web-constants/dist/utils/index.js");
182
183
  },
183
- "../web-constants/dist/types/Element.js" () {
184
+ "../web-constants/dist/types/Element.js" (__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
185
+ __webpack_require__.d(__webpack_exports__, {
186
+ U: ()=>AnimationOperation
187
+ });
184
188
  var AnimationOperation;
185
189
  (function(AnimationOperation) {
186
190
  AnimationOperation[AnimationOperation["START"] = 0] = "START";
@@ -249,11 +253,12 @@ __webpack_require__.add({
249
253
  __webpack_require__.d(__webpack_exports__, {
250
254
  HO: ()=>_I18n_js__rspack_import_3.HO,
251
255
  O4: ()=>_NativeApp_js__rspack_import_0.O,
256
+ Uc: ()=>_Element_js__rspack_import_2.U,
252
257
  gI: ()=>_I18n_js__rspack_import_3.gI
253
258
  });
254
259
  var _NativeApp_js__rspack_import_0 = __webpack_require__("../web-constants/dist/types/NativeApp.js");
255
260
  __webpack_require__("../web-constants/dist/types/UpdateDataOptions.js");
256
- __webpack_require__("../web-constants/dist/types/Element.js");
261
+ var _Element_js__rspack_import_2 = __webpack_require__("../web-constants/dist/types/Element.js");
257
262
  var _I18n_js__rspack_import_3 = __webpack_require__("../web-constants/dist/types/I18n.js");
258
263
  },
259
264
  "../web-constants/dist/utils/LynxCrossThreadContext.js" (__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
@@ -940,11 +945,11 @@ const templateScrollView = `<style>
940
945
  part="bot-fade-mask"
941
946
  ></div>`;
942
947
  const templateXAudioTT = '<audio id="audio"></audio>';
943
- const XSSDetector = /<\s*script/g;
948
+ const XSSDetector = /<\s*script/;
944
949
  const templateXImage = (attributes)=>{
945
950
  const { src } = attributes;
946
951
  if (src && XSSDetector.test(src)) throw new Error("detected <script, this is a potential XSS attack, please check your src");
947
- return `<img part="img" alt="" loading="lazy" id="img" ${src ? `src="${src}"` : ''}/> `;
952
+ return `<img part="img" alt="" id="img" ${src ? `src="${src}"` : ''}/> `;
948
953
  };
949
954
  const templateFilterImage = templateXImage;
950
955
  const templateXInput = `<style>
package/dist/27.js CHANGED
@@ -597,6 +597,48 @@ __webpack_require__.add({
597
597
  }
598
598
  return el;
599
599
  };
600
+ const animationMap = new Map();
601
+ const mapTimingOptions = (options)=>{
602
+ if (!options) return;
603
+ const result = {};
604
+ if ('duration' in options) result.duration = Number(options['duration']);
605
+ if ('delay' in options) result.delay = Number(options['delay']);
606
+ if ('direction' in options) result.direction = options['direction'];
607
+ if ('iterationCount' in options) result.iterations = 'infinite' === options['iterationCount'] ? 1 / 0 : Number(options['iterationCount']);
608
+ if ('fillMode' in options) result.fill = options['fillMode'];
609
+ if ('timingFunction' in options) result.easing = options['timingFunction'];
610
+ return result;
611
+ };
612
+ const __ElementAnimate = (element, args)=>{
613
+ const [operation, name] = args;
614
+ switch(operation){
615
+ case _lynx_js_web_constants__rspack_import_0.Uc.START:
616
+ {
617
+ const keyframes = args[2];
618
+ const options = args[3];
619
+ animationMap.get(name)?.cancel();
620
+ const animation = element.animate(keyframes, mapTimingOptions(options));
621
+ animation.oncancel = animation.onfinish = ()=>{
622
+ if (animationMap.get(name) === animation) animationMap.delete(name);
623
+ };
624
+ animationMap.set(name, animation);
625
+ break;
626
+ }
627
+ case _lynx_js_web_constants__rspack_import_0.Uc.PLAY:
628
+ animationMap.get(name)?.play();
629
+ break;
630
+ case _lynx_js_web_constants__rspack_import_0.Uc.PAUSE:
631
+ animationMap.get(name)?.pause();
632
+ break;
633
+ case _lynx_js_web_constants__rspack_import_0.Uc.CANCEL:
634
+ animationMap.get(name)?.cancel();
635
+ animationMap.delete(name);
636
+ break;
637
+ case _lynx_js_web_constants__rspack_import_0.Uc.FINISH:
638
+ animationMap.get(name)?.finish();
639
+ break;
640
+ }
641
+ };
600
642
  const __GetPageElement = ()=>pageElement;
601
643
  const templateIdToTemplate = {};
602
644
  const createElementForElementTemplateData = (data, parentComponentUniId)=>{
@@ -726,7 +768,8 @@ __webpack_require__.add({
726
768
  _AddEventListener: ()=>{},
727
769
  renderPage: void 0,
728
770
  __InvokeUIMethod,
729
- __QuerySelector
771
+ __QuerySelector,
772
+ __ElementAnimate
730
773
  };
731
774
  Object.assign(mtsRealm.globalWindow, mtsGlobalThis);
732
775
  Object.defineProperty(mtsRealm.globalWindow, 'renderPage', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/web-core-server",
3
- "version": "0.19.7",
3
+ "version": "0.19.9",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "keywords": [],
@@ -23,13 +23,13 @@
23
23
  "README.md"
24
24
  ],
25
25
  "devDependencies": {
26
- "rsbuild-plugin-arethetypeswrong": "0.1.1",
26
+ "rsbuild-plugin-arethetypeswrong": "0.2.0",
27
27
  "rsbuild-plugin-publint": "0.3.4",
28
28
  "@lynx-js/offscreen-document": "0.1.4",
29
- "@lynx-js/web-constants": "0.19.7",
30
- "@lynx-js/web-elements": "0.11.1",
31
- "@lynx-js/web-mainthread-apis": "0.19.7",
32
- "@lynx-js/web-worker-rpc": "0.19.7"
29
+ "@lynx-js/web-constants": "0.19.9",
30
+ "@lynx-js/web-elements": "0.12.0",
31
+ "@lynx-js/web-mainthread-apis": "0.19.9",
32
+ "@lynx-js/web-worker-rpc": "0.19.9"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "rslib build",