@tarojs/plugin-platform-harmony-ets 4.0.0-canary.11 → 4.0.0-canary.13

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 (98) hide show
  1. package/dist/apis/base/system.ts +26 -6
  2. package/dist/apis/device/clipboard.ts +16 -8
  3. package/dist/apis/index.ts +2 -6
  4. package/dist/apis/media/image/index.ts +1 -1
  5. package/dist/apis/storage/index.ts +91 -165
  6. package/dist/apis/ui/animation/animation.ts +70 -29
  7. package/dist/apis/ui/background.ts +2 -1
  8. package/dist/apis/ui/interaction/index.ts +42 -59
  9. package/dist/apis/ui/navigation-bar/index.ts +1 -1
  10. package/dist/apis/ui/pull-down-refresh.ts +9 -3
  11. package/dist/apis/ui/scroll/index.ts +5 -5
  12. package/dist/apis/ui/tab-bar.ts +3 -3
  13. package/dist/apis/utils/index.ts +1 -0
  14. package/dist/apis/wxml/selectorQuery.ts +10 -6
  15. package/dist/components-harmony-ets/button.ets +46 -32
  16. package/dist/components-harmony-ets/checkbox.ets +60 -57
  17. package/dist/components-harmony-ets/form.ets +35 -28
  18. package/dist/components-harmony-ets/icon.ets +14 -19
  19. package/dist/components-harmony-ets/image.ets +17 -12
  20. package/dist/components-harmony-ets/index.ets +21 -3
  21. package/dist/components-harmony-ets/input.ets +45 -40
  22. package/dist/components-harmony-ets/label.ets +55 -43
  23. package/dist/components-harmony-ets/listView.ets +31 -0
  24. package/dist/components-harmony-ets/movableArea.ets +92 -62
  25. package/dist/components-harmony-ets/movableView.ets +68 -49
  26. package/dist/components-harmony-ets/navigationBar.ets +65 -0
  27. package/dist/components-harmony-ets/pageMeta.ets +94 -0
  28. package/dist/components-harmony-ets/picker.ets +15 -17
  29. package/dist/components-harmony-ets/progress.ets +22 -24
  30. package/dist/components-harmony-ets/pseudo.ets +1 -1
  31. package/dist/components-harmony-ets/radio.ets +62 -59
  32. package/dist/components-harmony-ets/richText.ets +7 -9
  33. package/dist/components-harmony-ets/scrollList.ets +94 -0
  34. package/dist/components-harmony-ets/scrollView.ets +52 -50
  35. package/dist/components-harmony-ets/slider.ets +11 -10
  36. package/dist/components-harmony-ets/stickySection.ets +42 -0
  37. package/dist/components-harmony-ets/style.ets +176 -63
  38. package/dist/components-harmony-ets/swiper.ets +46 -19
  39. package/dist/components-harmony-ets/switch.ets +30 -30
  40. package/dist/components-harmony-ets/tag.ts +6 -0
  41. package/dist/components-harmony-ets/text.ets +97 -43
  42. package/dist/components-harmony-ets/textArea.ets +43 -31
  43. package/dist/components-harmony-ets/utils/DynamicCenter.ts +1 -1
  44. package/dist/components-harmony-ets/utils/flexManager.ets +42 -13
  45. package/dist/components-harmony-ets/utils/helper.ets +15 -1
  46. package/dist/components-harmony-ets/utils/index.ts +6 -1
  47. package/dist/components-harmony-ets/utils/styles.ets +6 -0
  48. package/dist/components-harmony-ets/video.ets +18 -21
  49. package/dist/components-harmony-ets/view.ets +44 -34
  50. package/dist/components-harmony-ets/webView.ets +30 -32
  51. package/dist/index.d.ts +1 -1
  52. package/dist/index.js +16 -8
  53. package/dist/index.js.map +1 -1
  54. package/dist/runtime-ets/bom/document.ts +6 -8
  55. package/dist/runtime-ets/bom/getComputedStyle.ts +2 -2
  56. package/dist/runtime-ets/dom/bind.ts +10 -8
  57. package/dist/runtime-ets/dom/class-list.ts +2 -2
  58. package/dist/runtime-ets/dom/cssNesting.ts +87 -61
  59. package/dist/runtime-ets/dom/cssStyleDeclaration.ts +19 -5
  60. package/dist/runtime-ets/dom/document.ts +7 -11
  61. package/dist/runtime-ets/dom/element/element.ts +208 -18
  62. package/dist/runtime-ets/dom/element/form.ts +16 -8
  63. package/dist/runtime-ets/dom/element/index.ts +13 -1
  64. package/dist/runtime-ets/dom/element/movableArea.ts +0 -1
  65. package/dist/runtime-ets/dom/element/movableView.ts +67 -16
  66. package/dist/runtime-ets/dom/element/normal.ts +18 -9
  67. package/dist/runtime-ets/dom/element/progress.ts +0 -1
  68. package/dist/runtime-ets/dom/element/video.ts +0 -1
  69. package/dist/runtime-ets/dom/element/webView.ts +4 -5
  70. package/dist/runtime-ets/dom/event.ts +2 -3
  71. package/dist/runtime-ets/dom/eventTarget.ts +2 -0
  72. package/dist/runtime-ets/dom/node.ts +21 -10
  73. package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +99 -14
  74. package/dist/runtime-ets/dom/stylesheet/index.ts +2 -4
  75. package/dist/runtime-ets/dom/stylesheet/type.ts +28 -2
  76. package/dist/runtime-ets/utils/index.ts +53 -25
  77. package/dist/runtime-ets/utils/info.ts +1 -1
  78. package/dist/runtime-framework/react/app.ts +2 -2
  79. package/dist/runtime-framework/react/hooks.ts +0 -1
  80. package/dist/runtime-framework/react/native-page.ts +132 -65
  81. package/dist/runtime-framework/solid/reconciler/props.ts +6 -6
  82. package/dist/runtime-utils.d.ts +6 -6
  83. package/dist/runtime-utils.js +250 -233
  84. package/dist/runtime-utils.js.map +1 -1
  85. package/dist/runtime.js +250 -233
  86. package/dist/runtime.js.map +1 -1
  87. package/package.json +9 -9
  88. package/static/media/cancel.svg +1 -1
  89. package/static/media/circle.svg +1 -1
  90. package/static/media/clear.svg +1 -1
  91. package/static/media/download.svg +1 -1
  92. package/static/media/info.svg +1 -1
  93. package/static/media/info_circle.svg +1 -1
  94. package/static/media/search.svg +1 -1
  95. package/static/media/success.svg +1 -1
  96. package/static/media/success_no_circle.svg +1 -1
  97. package/static/media/warn.svg +1 -1
  98. package/types/harmony.d.ts +4 -0
@@ -27,6 +27,14 @@ let windowRect
27
27
 
28
28
  try {
29
29
  display = _display.getDefaultDisplaySync()
30
+
31
+ setSafeArea({
32
+ top: statusBarHeight,
33
+ left: 0,
34
+ right: display.width,
35
+ bottom: navigationIndicatorRect?.top
36
+ })
37
+
30
38
  // @ts-ignore
31
39
  display.getCutoutInfo((err, { boundingRects = [], waterfallDisplayAreaRects = {} }: _display.CutoutInfo = {}) => {
32
40
  if (err?.code) {
@@ -35,17 +43,16 @@ let windowRect
35
43
  }
36
44
 
37
45
  const top = Math.max(...boundingRects.map(rect => rect.top + rect.height), waterfallDisplayAreaRects.top?.top + waterfallDisplayAreaRects.top?.height, statusBarHeight)
38
- const bottom = display.height - Math.min(waterfallDisplayAreaRects.bottom?.top, navigationIndicatorRect?.top)
46
+ const bottom = Math.min(display.height - waterfallDisplayAreaRects.bottom?.top, navigationIndicatorRect?.top)
39
47
  const left = waterfallDisplayAreaRects.left?.left + waterfallDisplayAreaRects.left?.width
40
48
  const right = display.width - waterfallDisplayAreaRects.right?.left
41
- safeArea = {
49
+
50
+ setSafeArea({
42
51
  top,
43
- bottom,
44
52
  left,
45
53
  right,
46
- height: bottom - top,
47
- width: right - left,
48
- }
54
+ bottom
55
+ })
49
56
  })
50
57
  } catch (e) {
51
58
  console.error('Failed to get display', e)
@@ -53,6 +60,19 @@ let windowRect
53
60
  })
54
61
  })
55
62
 
63
+
64
+ function setSafeArea({ top, left, right, bottom }) {
65
+ safeArea = {
66
+ top,
67
+ bottom,
68
+ left,
69
+ right,
70
+ height: bottom - top,
71
+ width: right - left,
72
+ }
73
+ }
74
+
75
+
56
76
  /* 同步版本 */
57
77
  export const getSystemInfoSync: typeof Taro.getSystemInfoSync = function () {
58
78
  const res: any = {}
@@ -1,5 +1,6 @@
1
1
  // 从 API Version 6 开始支持
2
2
  import pasteboard from '@ohos.pasteboard'
3
+ import promptAction from '@ohos.promptAction'
3
4
  import { isString } from '@tarojs/shared'
4
5
 
5
6
  import { callAsyncFail, getParameterError, object2String } from '../utils'
@@ -27,9 +28,20 @@ export const setClipboardData: typeof Taro.setClipboardData = function (options)
27
28
 
28
29
  return new Promise((resolve, reject) => {
29
30
  const systemPasteboard = pasteboard.getSystemPasteboard()
30
- const pasteData = pasteboard.createPlainTextData(data)
31
+ const pasteData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, data)
31
32
 
32
- systemPasteboard.setPasteData(pasteData, (error, data) => { // callback形式调用异步接口
33
+ try {
34
+ systemPasteboard.setDataSync(pasteData)
35
+ promptAction.showToast({
36
+ message: '内容已复制',
37
+ duration: 1500,
38
+ bottom: '50%',
39
+ showMode: 1 // 设置弹窗显示模式,显示在应用之上。
40
+ })
41
+ return handle.success({
42
+ data,
43
+ }, { resolve, reject })
44
+ } catch (error) {
33
45
  if (error) {
34
46
  console.error('Failed to set PasteData. Cause: ' + JSON.stringify(error))
35
47
  res = {
@@ -37,12 +49,8 @@ export const setClipboardData: typeof Taro.setClipboardData = function (options)
37
49
  error: error
38
50
  }
39
51
  callAsyncFail(reject, res, options)
40
- } else {
41
- return handle.success({
42
- data,
43
- }, { resolve, reject })
44
52
  }
45
- })
53
+ }
46
54
  })
47
55
  }
48
56
 
@@ -54,7 +62,7 @@ export const getClipboardData: typeof Taro.getClipboardData = function (options)
54
62
  const handle = new MethodHandler({ name: 'getClipboardData', success, fail, complete })
55
63
  return new Promise((resolve, reject) => {
56
64
  const systemPasteboard = pasteboard.getSystemPasteboard()
57
- systemPasteboard.getPasteData((error, pasteData) => { // callback 形式调用异步接口
65
+ systemPasteboard.getData((error, pasteData) => { // callback 形式调用异步接口
58
66
  if (error) {
59
67
  console.error('Failed to obtain PasteData. Cause: ' + JSON.stringify(error))
60
68
  return handle.fail({
@@ -62,7 +62,6 @@ let displayWidth = display.width
62
62
  let ratioCache: number | false = false
63
63
  let designWidthFunc: (input: number) => number
64
64
  let designWidth = defaultDesignWidth
65
- let deviceRatio = defaultDesignRatio
66
65
  function getRatio (value: number) {
67
66
  // Note: 提前调用 display 可能无法获取正确值
68
67
  if (ratioCache === false || displayWidth !== display.width) {
@@ -72,13 +71,9 @@ function getRatio (value: number) {
72
71
  ? config.designWidth
73
72
  : () => config.designWidth
74
73
  designWidth = designWidthFunc(value) || defaultDesignWidth
75
- deviceRatio = config.deviceRatio || defaultDesignRatio
76
- if (!(designWidth in deviceRatio)) {
77
- throw new Error(`deviceRatio 配置中不存在 ${designWidth} 的设置!`)
78
- }
79
74
  }
80
75
  displayWidth = display.width
81
- ratioCache = Math.min(display.width, display.height) / designWidth / deviceRatio[designWidth]
76
+ ratioCache = Math.min(display.width, display.height) / designWidth
82
77
  }
83
78
 
84
79
  return ratioCache
@@ -113,6 +108,7 @@ export function pxTransform (size: number): number | string {
113
108
  switch (targetUnit) {
114
109
  case 'vp':
115
110
  return pxTransformHelper(size, 'px')
111
+ // return `${size}lpx`
116
112
  default:
117
113
  // NOTE: 鸿蒙环境下 style 会自动完成设计稿转换,无需在方法内二次调整
118
114
  }
@@ -112,7 +112,7 @@ export const chooseImage: typeof Taro.chooseImage = function (options) {
112
112
  photoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE // 过滤选择媒体文件类型为IMAGE
113
113
 
114
114
  photoViewPicker.select(photoSelectOptions).then((photoSelectResult) => {
115
- callAsyncSuccess(resolve, { tempFilePaths: photoSelectResult.photoUris })
115
+ callAsyncSuccess(resolve, { tempFilePaths: photoSelectResult.photoUris }, options)
116
116
  }).catch((error) => {
117
117
  callAsyncFail(reject, error, options)
118
118
  })
@@ -3,8 +3,7 @@
3
3
  * https://developer.harmonyos.com/cn/docs/documentation/doc-references-V3/js-apis-data-preferences-0000001427745052-V3
4
4
  */
5
5
  import bundleManager from '@ohos.bundle.bundleManager'
6
- import dataPreferences from '@ohos.data.preferences'
7
- import hilog from '@ohos.hilog'
6
+ import distributedKVStore from '@ohos.data.distributedKVStore'
8
7
  import { Current } from '@tarojs/runtime'
9
8
 
10
9
  import { temporarilyNotSupport, validateParams } from '../utils'
@@ -13,25 +12,50 @@ import { MethodHandler } from '../utils/handler'
13
12
  import type Taro from '@tarojs/taro/types'
14
13
 
15
14
  let context
16
- let preferences: any
15
+ let kvManager: distributedKVStore.KVManager
16
+ let kvStore: distributedKVStore.SingleKVStore
17
+ let kvStorePromise: Promise<void>
17
18
 
18
19
  (Current as any).contextPromise.then((ctx) => {
19
20
  context = ctx
20
- return context
21
- })
21
+ const kvManagerConfig: distributedKVStore.KVManagerConfig = {
22
+ context: context,
23
+ bundleName: 'com.example.taro'
24
+ }
22
25
 
23
- function getPreferences () {
24
26
  try {
25
- if (!preferences && context) {
26
- const data = bundleManager.getBundleInfoForSelfSync(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION)
27
- preferences = dataPreferences.getPreferencesSync(context, { name: `${data.appInfo.uid}Store` })
27
+ // 创建KVManager实例
28
+ kvManager = distributedKVStore.createKVManager(kvManagerConfig)
29
+ // 继续创建获取数据库
30
+ const options: distributedKVStore.Options = {
31
+ createIfMissing: true,
32
+ encrypt: false,
33
+ backup: false,
34
+ autoSync: false,
35
+ // kvStoreType不填时,默认创建多设备协同数据库
36
+ kvStoreType: distributedKVStore.KVStoreType.SINGLE_VERSION,
37
+ // 多设备协同数据库:kvStoreType: distributedKVStore.KVStoreType.DEVICE_COLLABORATION,
38
+ securityLevel: distributedKVStore.SecurityLevel.S1
28
39
  }
29
- } catch (error) {
30
- hilog.error(0x0000, 'TaroFailedTag', 'Failed to load the storage. Cause: %{public}s', error.code ? JSON.stringify(error) : error.message || error)
40
+
41
+ const data = bundleManager.getBundleInfoForSelfSync(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION)
42
+ kvStorePromise = new Promise(resolve => {
43
+ kvManager.getKVStore<distributedKVStore.SingleKVStore>(`${data.appInfo.uid}Store`, options, (err, store: distributedKVStore.SingleKVStore) => {
44
+ if (err) {
45
+ console.error(`Failed to get KVStore: Code:${err.code},message:${err.message}`)
46
+ return
47
+ }
48
+ kvStore = store
49
+ // 请确保获取到键值数据库实例后,再进行相关数据操作
50
+ resolve()
51
+ })
52
+ })
53
+ } catch (e) {
54
+ console.error(`Failed to create KVManager. Code:${e.code},message:${e.message}`)
31
55
  }
32
56
 
33
- return preferences
34
- }
57
+ return context
58
+ })
35
59
 
36
60
  const storageSchema = {
37
61
  key: 'String'
@@ -71,52 +95,27 @@ export function getStorage<T = any> (options: Taro.getStorage.Option<T>) {
71
95
  const handle = new MethodHandler<{data: any}>({ name, success, fail, complete })
72
96
 
73
97
  return new Promise((resolve, reject) => {
74
- try {
75
- validateParams(name, options, storageSchema)
76
- } catch (error) {
77
- const res = { errMsg: error.message }
78
- return handle.fail(res, { resolve, reject })
79
- }
98
+ kvStorePromise.then(() => {
99
+ try {
100
+ validateParams(name, options, storageSchema)
101
+ } catch (error) {
102
+ const res = { errMsg: error.message }
103
+ return handle.fail(res, { resolve, reject })
104
+ }
80
105
 
81
- const preferences = getPreferences()
82
-
83
- if (!preferences) return handle.fail({}, { resolve, reject })
106
+ kvStore = kvStore as distributedKVStore.SingleKVStore
107
+ kvStore.get(key, (err, data) => {
108
+ if (err) {
109
+ handle.fail({ errMsg: `Failed to get data. Code:${err.code},message:${err.message}` }, { resolve, reject })
110
+ return
111
+ }
84
112
 
85
- const data = preferences.getSync(key, null)
86
- if (data) {
87
- return handle.success({ data }, { resolve, reject })
88
- } else {
89
- return handle.success({ errMsg: 'data not found' }, { resolve, reject })
90
- }
113
+ handle.success({ data }, { resolve, reject })
114
+ })
115
+ })
91
116
  })
92
117
  }
93
118
 
94
- export function getStorageSync (key: string) {
95
- const name = 'getStorageSync'
96
- const { isExist, error } = checkContextExist(name, false)
97
-
98
- if (!isExist) {
99
- return error
100
- }
101
-
102
- if (!key) {
103
- throw new Error(`${name}:fail parameter error: parameter should be String`)
104
- }
105
-
106
- const preferences = getPreferences()
107
-
108
- if (!preferences) {
109
- throw new Error(`${name}:fail:preferences is null`)
110
- }
111
-
112
- const data = preferences.getSync(key, null)
113
- if (data) {
114
- return data
115
- } else {
116
- throw new Error('data not found')
117
- }
118
- }
119
-
120
119
  export function setStorage (options: Taro.setStorage.Option) {
121
120
  const name = 'setStorage'
122
121
  const { isExist, error } = checkContextExist(name, true)
@@ -129,46 +128,27 @@ export function setStorage (options: Taro.setStorage.Option) {
129
128
  const handle = new MethodHandler({ name, success, fail, complete })
130
129
 
131
130
  return new Promise((resolve, reject) => {
132
- try {
133
- validateParams(name, options, storageSchema)
134
- } catch (error) {
135
- const res = { errMsg: error.message }
136
- return handle.fail(res, { resolve, reject })
137
- }
138
-
139
- const preferences = getPreferences()
140
-
141
- if (!preferences) return handle.fail({}, { resolve, reject })
131
+ kvStorePromise.then(() => {
132
+ try {
133
+ validateParams(name, options, storageSchema)
134
+ } catch (error) {
135
+ const res = { errMsg: error.message }
136
+ return handle.fail(res, { resolve, reject })
137
+ }
142
138
 
143
- preferences.putSync(key, data)
144
- preferences.flush()
139
+ kvStore = kvStore as distributedKVStore.SingleKVStore
140
+ kvStore.put(key, data, (err) => {
141
+ if (err) {
142
+ handle.fail({ errMsg: `Failed to put data. Code:${err.code},message:${err.message}` }, { resolve, reject })
143
+ return
144
+ }
145
145
 
146
- return handle.success({}, { resolve, reject })
146
+ handle.success({}, { resolve, reject })
147
+ })
148
+ })
147
149
  })
148
150
  }
149
151
 
150
- export function setStorageSync (key: string, data: any) {
151
- const name = 'setStorageSync'
152
- const { isExist, error } = checkContextExist(name, false)
153
-
154
- if (!isExist) {
155
- return error
156
- }
157
-
158
- if (!key) {
159
- throw new Error(`${name}:fail key error: key should be String`)
160
- }
161
-
162
- const preferences = getPreferences()
163
-
164
- if (!preferences) {
165
- throw new Error(`${name}:fail:preferences is null`)
166
- }
167
-
168
- preferences.putSync(key, data)
169
- preferences.flush()
170
- }
171
-
172
152
  export function removeStorage (options: Taro.removeStorage.Option) {
173
153
  const name = 'removeStorage'
174
154
  const { isExist, error } = checkContextExist(name, true)
@@ -181,87 +161,27 @@ export function removeStorage (options: Taro.removeStorage.Option) {
181
161
  const handle = new MethodHandler({ name, success, fail, complete })
182
162
 
183
163
  return new Promise((resolve, reject) => {
184
- try {
185
- validateParams(name, options, storageSchema)
186
- } catch (error) {
187
- const res = { errMsg: error.message }
188
- return handle.fail(res, { resolve, reject })
189
- }
190
-
191
- const preferences = getPreferences()
192
-
193
- if (!preferences) return handle.fail({}, { resolve, reject })
194
-
195
- preferences.deleteSync(key)
196
- preferences.flush()
197
-
198
- return handle.success({}, { resolve, reject })
199
- })
200
- }
201
-
202
- export function removeStorageSync (key: string) {
203
- const name = 'removeStorageSync'
204
- const { isExist, error } = checkContextExist(name, false)
205
-
206
- if (!isExist) {
207
- return error
208
- }
209
-
210
- if (!key) {
211
- throw new Error(`${name}:fail key error: key should be String`)
212
- }
213
-
214
- const preferences = getPreferences()
215
-
216
- if (!preferences) {
217
- throw new Error(`${name}:fail:preferences is null`)
218
- }
219
-
220
- preferences.deleteSync(key)
221
- preferences.flush()
222
- }
223
-
224
- export function clearStorage (options: Taro.clearStorage.Option) {
225
- const name = 'clearStorage'
226
- const { isExist, error } = checkContextExist(name, true)
227
-
228
- if (!isExist) {
229
- return error
230
- }
231
-
232
- const { success, fail, complete } = options || {}
233
- const handle = new MethodHandler({ name, success, fail, complete })
234
-
235
- return new Promise((resolve, reject) => {
236
- const preferences = getPreferences()
164
+ kvStorePromise.then(() => {
165
+ try {
166
+ validateParams(name, options, storageSchema)
167
+ } catch (error) {
168
+ const res = { errMsg: error.message }
169
+ return handle.fail(res, { resolve, reject })
170
+ }
237
171
 
238
- if (!preferences) return handle.fail({}, { resolve, reject })
172
+ kvStore = kvStore as distributedKVStore.SingleKVStore
173
+ kvStore.delete(key, (err) => {
174
+ if (err) {
175
+ handle.fail({ errMsg: `Failed to delete data. Code:${err.code},message:${err.message}` }, { resolve, reject })
176
+ return
177
+ }
239
178
 
240
- preferences.clearSync()
241
- preferences.flush()
242
-
243
- return handle.success({}, { resolve, reject })
179
+ handle.success({}, { resolve, reject })
180
+ })
181
+ })
244
182
  })
245
183
  }
246
184
 
247
- export function clearStorageSync () {
248
- const name = 'clearStorageSync'
249
- const { isExist, error } = checkContextExist(name, false)
250
-
251
- if (!isExist) {
252
- return error
253
- }
254
-
255
- const preferences = getPreferences()
256
-
257
- if (!preferences) {
258
- throw new Error(`${name}:fail:preferences is null`)
259
- }
260
-
261
- preferences.clearSync()
262
- preferences.flush()
263
- }
264
-
265
185
  export const getStorageInfoSync = temporarilyNotSupport('getStorageInfoSync')
266
186
  export const getStorageInfo = temporarilyNotSupport('getStorageInfo')
267
187
 
@@ -273,5 +193,11 @@ export const batchSetStorage = /* @__PURE__ */ temporarilyNotSupport('batchSetSt
273
193
  export const batchGetStorageSync = /* @__PURE__ */ temporarilyNotSupport('batchGetStorageSync')
274
194
  export const batchGetStorage = /* @__PURE__ */ temporarilyNotSupport('batchGetStorage')
275
195
 
196
+ export const clearStorage = temporarilyNotSupport('clearStorage')
197
+ export const getStorageSync = temporarilyNotSupport('getStorageSync', 'getStorage')
198
+ export const setStorageSync = temporarilyNotSupport('setStorageSync', 'setStorage')
199
+ export const clearStorageSync = temporarilyNotSupport('clearStorageSync', 'clearStorage')
200
+ export const removeStorageSync = temporarilyNotSupport('removeStorageSync', 'removeStorage')
201
+
276
202
  export * from './background-fetch'
277
203
  export * from './cache-manager'
@@ -23,7 +23,6 @@ type TStep = {
23
23
  type TRule = Record<string, any>
24
24
 
25
25
  export class Animation implements Taro.Animation {
26
-
27
26
  unit: string
28
27
  DEFAULT: IAnimationAttr
29
28
 
@@ -72,6 +71,9 @@ export class Animation implements Taro.Animation {
72
71
  transformOrigin,
73
72
  rule: Object.assign({}, this.rule)
74
73
  })
74
+ if (this.rule.transform) {
75
+ this.rule.transform = Object.assign({}, this.rule.transform)
76
+ }
75
77
  return this
76
78
  }
77
79
 
@@ -86,92 +88,137 @@ export class Animation implements Taro.Animation {
86
88
  }
87
89
 
88
90
  rotate (angle: number): Taro.Animation {
89
- this.rule.rotate = { x: 0, y: 0, z: 1, angle }
91
+ if (!this.rule.transform) {
92
+ this.rule.transform = {}
93
+ }
94
+ this.rule.transform.Rotate = { x: 0, y: 0, z: 1, angle }
90
95
  return this
91
96
  }
92
97
 
93
98
  rotate3d (x: number, y?: number | undefined, z?: number | undefined, angle?: number | undefined): Taro.Animation {
94
- this.rule.rotate = { x, y, z, angle }
99
+ if (!this.rule.transform) {
100
+ this.rule.transform = {}
101
+ }
102
+ this.rule.transform.Rotate = { x, y, z, angle }
95
103
  return this
96
104
  }
97
105
 
98
106
  rotateX (angle: number): Taro.Animation {
99
- this.rule.rotate = { x: 1, y: 0, z: 0, angle }
107
+ if (!this.rule.transform) {
108
+ this.rule.transform = {}
109
+ }
110
+ this.rule.transform.Rotate = { x: 1, y: 0, z: 0, angle }
100
111
  return this
101
112
  }
102
113
 
103
114
  rotateY (angle: number): Taro.Animation {
104
- this.rule.rotate = { x: 0, y: 1, z: 0, angle }
115
+ if (!this.rule.transform) {
116
+ this.rule.transform = {}
117
+ }
118
+ this.rule.transform.Rotate = { x: 0, y: 1, z: 0, angle }
105
119
  return this
106
120
  }
107
121
 
108
122
  rotateZ (angle: number): Taro.Animation {
109
- this.rule.rotate = { x: 0, y: 0, z: 1, angle }
123
+ if (!this.rule.transform) {
124
+ this.rule.transform = {}
125
+ }
126
+ this.rule.transform.Rotate = { x: 0, y: 0, z: 1, angle }
110
127
  return this
111
128
  }
112
129
 
113
130
  scale (sx: number, sy?: number | undefined): Taro.Animation {
114
- this.rule.scale = { x: sx, y: isUndefined(sy) ? sx : sy }
131
+ if (!this.rule.transform) {
132
+ this.rule.transform = {}
133
+ }
134
+ this.rule.transform.Scale = { x: sx, y: isUndefined(sy) ? sx : sy }
115
135
  return this
116
136
  }
117
137
 
118
138
  scale3d (sx: number, sy: number, sz: number): Taro.Animation {
119
- this.rule.scale = { x: sx, y: sy, z: sz }
139
+ if (!this.rule.transform) {
140
+ this.rule.transform = {}
141
+ }
142
+ this.rule.transform.Scale = { x: sx, y: sy, z: sz }
120
143
  return this
121
144
  }
122
145
 
123
146
  scaleX (scale: number): Taro.Animation {
124
- this.rule.scale = { x: scale }
147
+ if (!this.rule.transform) {
148
+ this.rule.transform = {}
149
+ }
150
+ this.rule.transform.Scale = { x: scale }
125
151
  return this
126
152
  }
127
153
 
128
154
  scaleY (scale: number): Taro.Animation {
129
- this.rule.scale = { y: scale }
155
+ if (!this.rule.transform) {
156
+ this.rule.transform = {}
157
+ }
158
+ this.rule.transform.Scale = { y: scale }
130
159
  return this
131
160
  }
132
161
 
133
162
  scaleZ (scale: number): Taro.Animation {
134
- this.rule.scale = { z: scale }
163
+ if (!this.rule.transform) {
164
+ this.rule.transform = {}
165
+ }
166
+ this.rule.transform.Scale = { z: scale }
135
167
  return this
136
168
  }
137
169
 
138
170
  skew (ax: number, ay: number): Taro.Animation {
139
- this.rule.skew = { x: ax, y: ay }
171
+ temporarilyNotSupport('animation.skew:' + `${ax}, ${ay}`)(ax, ay)
140
172
  return this
141
173
  }
142
174
 
143
175
  skewX (angle: number): Taro.Animation {
144
- this.rule.skew = { x: angle }
176
+ temporarilyNotSupport('animation.skewX:' + angle)(angle)
145
177
  return this
146
178
  }
147
179
 
148
180
  skewY (angle: number): Taro.Animation {
149
- this.rule.skew = { y: angle }
181
+ temporarilyNotSupport('animation.skewY:' + angle)(angle)
150
182
  return this
151
183
  }
152
184
 
153
185
  translate (tx?: number | undefined, ty?: number | undefined): Taro.Animation {
154
- this.rule.translate = { x: tx, y: ty }
186
+ if (!this.rule.transform) {
187
+ this.rule.transform = {}
188
+ }
189
+ this.rule.transform.Translate = { x: tx, y: ty }
155
190
  return this
156
191
  }
157
192
 
158
193
  translate3d (tx?: number | undefined, ty?: number | undefined, tz?: number | undefined): Taro.Animation {
159
- this.rule.translate = { x: tx, y: ty, z: tz }
194
+ if (!this.rule.transform) {
195
+ this.rule.transform = {}
196
+ }
197
+ this.rule.transform.Translate = { x: tx, y: ty, z: tz }
160
198
  return this
161
199
  }
162
200
 
163
201
  translateX (translation: number): Taro.Animation {
164
- this.rule.translate = { x: translation }
202
+ if (!this.rule.transform) {
203
+ this.rule.transform = {}
204
+ }
205
+ this.rule.transform.Translate = { x: translation }
165
206
  return this
166
207
  }
167
208
 
168
209
  translateY (translation: number): Taro.Animation {
169
- this.rule.translate = { y: translation }
210
+ if (!this.rule.transform) {
211
+ this.rule.transform = {}
212
+ }
213
+ this.rule.transform.Translate = { y: translation }
170
214
  return this
171
215
  }
172
216
 
173
217
  translateZ (translation: number): Taro.Animation {
174
- this.rule.translate = { z: translation }
218
+ if (!this.rule.transform) {
219
+ this.rule.transform = {}
220
+ }
221
+ this.rule.transform.Translate = { z: translation }
175
222
  return this
176
223
  }
177
224
 
@@ -186,23 +233,17 @@ export class Animation implements Taro.Animation {
186
233
  }
187
234
 
188
235
  width (value: string | number): Taro.Animation {
189
- this.rule.size = {
190
- ...this.rule.size,
191
- width: value
192
- }
236
+ this.rule.width = value
193
237
  return this
194
238
  }
195
239
 
196
240
  height (value: string | number): Taro.Animation {
197
- this.rule.size = {
198
- ...this.rule.size,
199
- height: value
200
- }
241
+ this.rule.height = value
201
242
  return this
202
243
  }
203
244
 
204
245
  left (value: string | number): Taro.Animation {
205
- temporarilyNotSupport('animation.left:' + value)(value)
246
+ this.rule.left = value
206
247
  return this
207
248
  }
208
249
 
@@ -212,7 +253,7 @@ export class Animation implements Taro.Animation {
212
253
  }
213
254
 
214
255
  top (value: string | number): Taro.Animation {
215
- temporarilyNotSupport('animation.top:' + value)(value)
256
+ this.rule.top = value
216
257
  return this
217
258
  }
218
259
 
@@ -11,7 +11,8 @@ export function setBackgroundColor(options: Taro.setBackgroundColor.Option) {
11
11
 
12
12
  return new Promise((resolve, reject) => {
13
13
  eventCenter.trigger('__taroPageStyle', {
14
- backgroundColor: options.backgroundColor || options.backgroundColorTop || options.backgroundColorBottom,
14
+ backgroundColor: options.backgroundColorBottom || options.backgroundColor,
15
+ backgroundColorContext: options.backgroundColorTop || options.backgroundColor
15
16
  })
16
17
 
17
18
  return handle.success({}, { resolve, reject })