@tarojs/plugin-platform-harmony-ets 4.0.0-beta.0 → 4.0.0-beta.2

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.
Files changed (65) hide show
  1. package/dist/apis/device/memory.ts +10 -3
  2. package/dist/apis/media/video/VideoContext.ts +56 -7
  3. package/dist/apis/media/video/index.ts +3 -2
  4. package/dist/components-harmony-ets/button.ets +57 -27
  5. package/dist/components-harmony-ets/checkbox.ets +237 -72
  6. package/dist/components-harmony-ets/form.ets +143 -27
  7. package/dist/components-harmony-ets/icon.ets +53 -19
  8. package/dist/components-harmony-ets/image.ets +53 -19
  9. package/dist/components-harmony-ets/input.ets +57 -18
  10. package/dist/components-harmony-ets/label.ets +155 -33
  11. package/dist/components-harmony-ets/picker.ets +155 -41
  12. package/dist/components-harmony-ets/radio.ets +240 -75
  13. package/dist/components-harmony-ets/richText.ets +52 -18
  14. package/dist/components-harmony-ets/scrollView.ets +103 -45
  15. package/dist/components-harmony-ets/slider.ets +57 -18
  16. package/dist/components-harmony-ets/swiper.ets +52 -18
  17. package/dist/components-harmony-ets/switch.ets +92 -41
  18. package/dist/components-harmony-ets/text.ets +60 -23
  19. package/dist/components-harmony-ets/textArea.ets +58 -19
  20. package/dist/components-harmony-ets/utils/DynamicCenter.ts +2 -11
  21. package/dist/components-harmony-ets/utils/flexManager.ets +44 -7
  22. package/dist/components-harmony-ets/utils/helper.ets +1 -1
  23. package/dist/components-harmony-ets/utils/styles.ets +57 -20
  24. package/dist/components-harmony-ets/video.ets +52 -18
  25. package/dist/components-harmony-ets/view.ets +111 -46
  26. package/dist/components-harmony-ets/webView.ets +113 -0
  27. package/dist/index.js +101 -4
  28. package/dist/index.js.map +1 -1
  29. package/dist/runtime-ets/dom/cssStyleDeclaration.ts +30 -6
  30. package/dist/runtime-ets/dom/element/element.ts +1 -0
  31. package/dist/runtime-ets/dom/element/form.ts +11 -2
  32. package/dist/runtime-ets/dom/element/index.ts +4 -1
  33. package/dist/runtime-ets/dom/element/normal.ts +1 -0
  34. package/dist/runtime-ets/dom/element/webView.ts +61 -0
  35. package/dist/runtime-ets/dom/node.ts +29 -16
  36. package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +624 -0
  37. package/dist/runtime-ets/dom/stylesheet/index.ts +216 -354
  38. package/dist/runtime-ets/dom/stylesheet/type.ts +46 -11
  39. package/dist/runtime-ets/dom/stylesheet/util.ts +58 -6
  40. package/dist/runtime-ets/interface/event.ts +2 -1
  41. package/dist/runtime-ets/utils/index.ts +6 -1
  42. package/dist/runtime-ets/utils/info.ts +3 -1
  43. package/dist/runtime-framework/react/app.ts +12 -22
  44. package/dist/runtime-framework/react/index.ts +1 -0
  45. package/dist/runtime-framework/react/native-page.ts +344 -0
  46. package/dist/runtime-framework/react/page.ts +2 -2
  47. package/dist/runtime-utils.js +56 -15
  48. package/dist/runtime-utils.js.map +1 -1
  49. package/dist/runtime.js +56 -15
  50. package/dist/runtime.js.map +1 -1
  51. package/package.json +10 -9
  52. package/static/media/cancel.svg +1 -0
  53. package/static/media/circle.svg +1 -0
  54. package/static/media/clear.svg +1 -0
  55. package/static/media/download.svg +1 -0
  56. package/static/media/info.svg +1 -0
  57. package/static/media/info_circle.svg +1 -0
  58. package/static/media/search.svg +1 -0
  59. package/static/media/success.svg +1 -0
  60. package/static/media/success_no_circle.svg +1 -0
  61. package/static/media/taro_arrow_left.svg +1 -0
  62. package/static/media/taro_home.svg +1 -0
  63. package/static/media/waiting.svg +1 -0
  64. package/static/media/warn.svg +1 -0
  65. package/types/runtime.d.ts +2 -0
@@ -136,7 +136,8 @@ export function createPageConfig (component: any, pageName?: string, pageConfig?
136
136
  window.trigger(CONTEXT_ACTIONS.INIT, $taroPath)
137
137
 
138
138
  const mount = () => {
139
- Current.app!.mount!(component, $taroPath, () => {
139
+ // @ts-ignore
140
+ Current.app!.mount!(component, $taroPath, null, () => {
140
141
  pageElement = document.getElementById($taroPath)
141
142
 
142
143
  if (!pageElement) {
@@ -183,7 +184,6 @@ export function createPageConfig (component: any, pageName?: string, pageConfig?
183
184
  safeExecute(this.$taroPath, ON_READY)
184
185
  // 通过事件触发子组件的生命周期
185
186
  requestAnimationFrame(() => eventCenter.trigger(getOnReadyEventKey(id)))
186
- this.onReady.called = true
187
187
  })
188
188
  },
189
189
  [ONSHOW] (options = {}) {
@@ -1,6 +1,6 @@
1
1
  import { isFunction, isString, isArray, isObject, isNull, isNumber, isUndefined, queryToJson, PLATFORM_TYPE, singleQuote, internalComponents } from '@tarojs/shared';
2
2
  import _display from '@ohos.display';
3
- import { Current, window, getPageScrollerOrNode, findChildNodeWithDFS, setNodeEventCallbackAndTriggerComponentUpdate, AREA_CHANGE_EVENT_NAME, disconnectEvent, VISIBLE_CHANGE_EVENT_NAME, hooks } from '@tarojs/runtime';
3
+ import { Current, window, hooks, document as document$1, getPageScrollerOrNode, findChildNodeWithDFS, setNodeEventCallbackAndTriggerComponentUpdate, AREA_CHANGE_EVENT_NAME, disconnectEvent, VISIBLE_CHANGE_EVENT_NAME } from '@tarojs/runtime';
4
4
  import { eventCenter, Events, History } from '@tarojs/runtime/dist/runtime.esm';
5
5
  import deviceInfo from '@ohos.deviceInfo';
6
6
  import i18n from '@ohos.i18n';
@@ -509,7 +509,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
509
509
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
510
510
  PERFORMANCE OF THIS SOFTWARE.
511
511
  ***************************************************************************** */
512
- /* global Reflect, Promise */
512
+ /* global Reflect, Promise, SuppressedError, Symbol */
513
513
 
514
514
 
515
515
  function __awaiter(thisArg, _arguments, P, generator) {
@@ -520,7 +520,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
520
520
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
521
521
  step((generator = generator.apply(thisArg, _arguments || [])).next());
522
522
  });
523
- }
523
+ }
524
+
525
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
526
+ var e = new Error(message);
527
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
528
+ };
524
529
 
525
530
  // 电量
526
531
  const getBatteryInfoSync = () => ({
@@ -731,8 +736,14 @@ const hideKeyboard = function (options) {
731
736
  };
732
737
  const getSelectedTextRange = /* @__PURE__ */ temporarilyNotSupport('getSelectedTextRange');
733
738
 
734
- const onMemoryWarning = temporarilyNotSupport('onMemoryWarning');
735
- const offMemoryWarning = temporarilyNotSupport('offMemoryWarning');
739
+ const onMemoryWarning = (listener) => {
740
+ hooks.tap('getMemoryLevel', (res) => {
741
+ listener(res);
742
+ });
743
+ };
744
+ const offMemoryWarning = (listener) => {
745
+ hooks.off('getMemoryLevel', listener);
746
+ };
736
747
 
737
748
  const stopDeviceMotionListening = temporarilyNotSupport('stopDeviceMotionListening');
738
749
  const startDeviceMotionListening = temporarilyNotSupport('startDeviceMotionListening');
@@ -2306,21 +2317,51 @@ const stopRecord = /* @__PURE__ */ temporarilyNotSupport('stopRecord');
2306
2317
  const startRecord = /* @__PURE__ */ temporarilyNotSupport('startRecord');
2307
2318
  const getRecorderManager = /* @__PURE__ */ temporarilyNotSupport('getRecorderManager');
2308
2319
 
2320
+ // @ts-nocheck
2309
2321
  class VideoContext {
2310
- constructor() {
2322
+ constructor(id) {
2323
+ this.requestBackgroundPlayback = temporarilyNotSupport('VideoContext.requestBackgroundPlayback');
2311
2324
  this.exitBackgroundPlayback = temporarilyNotSupport('VideoContext.exitBackgroundPlayback');
2312
- this.exitFullScreen = temporarilyNotSupport('VideoContext.exitFullScreen');
2313
2325
  this.exitPictureInPicture = temporarilyNotSupport('VideoContext.exitPictureInPicture');
2314
2326
  this.hideStatusBar = temporarilyNotSupport('VideoContext.hideStatusBar');
2315
- this.pause = temporarilyNotSupport('VideoContext.pause');
2316
- this.play = temporarilyNotSupport('VideoContext.play');
2317
2327
  this.playbackRate = temporarilyNotSupport('VideoContext.playbackRate');
2318
- this.requestBackgroundPlayback = temporarilyNotSupport('VideoContext.requestBackgroundPlayback');
2319
- this.requestFullScreen = temporarilyNotSupport('VideoContext.requestFullScreen');
2320
- this.seek = temporarilyNotSupport('VideoContext.seek');
2321
2328
  this.sendDanmu = temporarilyNotSupport('VideoContext.sendDanmu');
2322
2329
  this.showStatusBar = temporarilyNotSupport('VideoContext.showStatusBar');
2323
- this.stop = temporarilyNotSupport('VideoContext.stop');
2330
+ this.id = id;
2331
+ this.video = document$1.getElementById(id);
2332
+ if (this.video) {
2333
+ this.controller = this.video.controller;
2334
+ }
2335
+ }
2336
+ play() {
2337
+ if (!this.controller)
2338
+ return;
2339
+ this.controller.play();
2340
+ }
2341
+ pause() {
2342
+ if (!this.controller)
2343
+ return;
2344
+ this.controller.pause();
2345
+ }
2346
+ stop() {
2347
+ if (!this.controller)
2348
+ return;
2349
+ this.controller.stop();
2350
+ }
2351
+ seek(position) {
2352
+ if (!this.controller)
2353
+ return;
2354
+ this.controller.setCurrentTime(position);
2355
+ }
2356
+ requestFullScreen() {
2357
+ if (!this.controller)
2358
+ return;
2359
+ this.controller.requestFullscreen(true);
2360
+ }
2361
+ exitFullScreen() {
2362
+ if (!this.controller)
2363
+ return;
2364
+ this.controller.exitFullscreen();
2324
2365
  }
2325
2366
  }
2326
2367
 
@@ -2349,8 +2390,8 @@ class VideoContext {
2349
2390
  const saveVideoToPhotosAlbumSchema = {
2350
2391
  filePath: 'String'
2351
2392
  };
2352
- const createVideoContext = () => {
2353
- return new VideoContext();
2393
+ const createVideoContext = (id, _) => {
2394
+ return new VideoContext(id);
2354
2395
  };
2355
2396
  // TODO: 1.返回属性补全
2356
2397
  // TODO: 2.只支持从相册选择,补充摄像头拍摄功能,需要HarmonyOS提供选择组件