@tarojs/plugin-platform-harmony-cpp 4.1.0 → 4.1.1-alpha.0

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 (223) hide show
  1. package/dist/index.js +1237 -0
  2. package/dist/runtime/apis/apis.ts +20 -0
  3. package/dist/runtime/apis/base/crypto.ts +4 -0
  4. package/dist/runtime/apis/base/debug.ts +5 -0
  5. package/dist/runtime/apis/base/index.ts +13 -0
  6. package/dist/runtime/apis/base/performance.ts +8 -0
  7. package/dist/runtime/apis/base/system.ts +181 -0
  8. package/dist/runtime/apis/base/update.ts +5 -0
  9. package/dist/runtime/apis/base/weapp/app-event.ts +75 -0
  10. package/dist/runtime/apis/base/weapp/life-cycle.ts +21 -0
  11. package/dist/runtime/apis/canvas/index.ts +27 -0
  12. package/dist/runtime/apis/data-analysis/index.ts +6 -0
  13. package/dist/runtime/apis/device/accelerometer.ts +79 -0
  14. package/dist/runtime/apis/device/accessibility.ts +4 -0
  15. package/dist/runtime/apis/device/battery.ts +24 -0
  16. package/dist/runtime/apis/device/bluetooth-ble.ts +19 -0
  17. package/dist/runtime/apis/device/bluetooth-peripheral.ts +6 -0
  18. package/dist/runtime/apis/device/bluetooth.ts +16 -0
  19. package/dist/runtime/apis/device/calendar.ts +5 -0
  20. package/dist/runtime/apis/device/clipboard.ts +85 -0
  21. package/dist/runtime/apis/device/compass.ts +21 -0
  22. package/dist/runtime/apis/device/contact.ts +5 -0
  23. package/dist/runtime/apis/device/crypto.ts +4 -0
  24. package/dist/runtime/apis/device/gyroscope.ts +77 -0
  25. package/dist/runtime/apis/device/iBeacon.ts +10 -0
  26. package/dist/runtime/apis/device/index.ts +24 -0
  27. package/dist/runtime/apis/device/keyboard.ts +63 -0
  28. package/dist/runtime/apis/device/memory.ts +11 -0
  29. package/dist/runtime/apis/device/motion.ts +6 -0
  30. package/dist/runtime/apis/device/network.ts +123 -0
  31. package/dist/runtime/apis/device/nfc.ts +10 -0
  32. package/dist/runtime/apis/device/phone.ts +44 -0
  33. package/dist/runtime/apis/device/scan.ts +4 -0
  34. package/dist/runtime/apis/device/screen.ts +80 -0
  35. package/dist/runtime/apis/device/sms.ts +4 -0
  36. package/dist/runtime/apis/device/vibrate.ts +32 -0
  37. package/dist/runtime/apis/device/wifi.ts +15 -0
  38. package/dist/runtime/apis/ext/index.ts +5 -0
  39. package/dist/runtime/apis/files/index.ts +136 -0
  40. package/dist/runtime/apis/files/manager.ts +942 -0
  41. package/dist/runtime/apis/framework/index.ts +48 -0
  42. package/dist/runtime/apis/harmony/task-pool.ts +39 -0
  43. package/dist/runtime/apis/index.ts +61 -0
  44. package/dist/runtime/apis/location/index.ts +133 -0
  45. package/dist/runtime/apis/media/EditorContext.ts +32 -0
  46. package/dist/runtime/apis/media/audio/index.ts +36 -0
  47. package/dist/runtime/apis/media/background-audio/index.ts +16 -0
  48. package/dist/runtime/apis/media/camera.ts +16 -0
  49. package/dist/runtime/apis/media/common.ts +58 -0
  50. package/dist/runtime/apis/media/image/index.ts +291 -0
  51. package/dist/runtime/apis/media/index.ts +13 -0
  52. package/dist/runtime/apis/media/live.ts +5 -0
  53. package/dist/runtime/apis/media/map.ts +4 -0
  54. package/dist/runtime/apis/media/media-recorder.ts +4 -0
  55. package/dist/runtime/apis/media/recorder.ts +6 -0
  56. package/dist/runtime/apis/media/video/VideoContext.ts +67 -0
  57. package/dist/runtime/apis/media/video/index.ts +45 -0
  58. package/dist/runtime/apis/media/video-decoder.ts +4 -0
  59. package/dist/runtime/apis/media/video-processing.ts +4 -0
  60. package/dist/runtime/apis/media/voip.ts +19 -0
  61. package/dist/runtime/apis/navigate/index.ts +8 -0
  62. package/dist/runtime/apis/network/downloadFile.ts +85 -0
  63. package/dist/runtime/apis/network/index.ts +7 -0
  64. package/dist/runtime/apis/network/mdns.ts +13 -0
  65. package/dist/runtime/apis/network/request.ts +140 -0
  66. package/dist/runtime/apis/network/tcp.ts +4 -0
  67. package/dist/runtime/apis/network/udp.ts +4 -0
  68. package/dist/runtime/apis/network/uploadFile.ts +105 -0
  69. package/dist/runtime/apis/network/webSocket.ts +126 -0
  70. package/dist/runtime/apis/open-api/account.ts +4 -0
  71. package/dist/runtime/apis/open-api/address.ts +4 -0
  72. package/dist/runtime/apis/open-api/authorize.ts +5 -0
  73. package/dist/runtime/apis/open-api/card.ts +5 -0
  74. package/dist/runtime/apis/open-api/channels-live.ts +11 -0
  75. package/dist/runtime/apis/open-api/customer-service.ts +4 -0
  76. package/dist/runtime/apis/open-api/device-voip.ts +5 -0
  77. package/dist/runtime/apis/open-api/facial.ts +7 -0
  78. package/dist/runtime/apis/open-api/favorites.ts +5 -0
  79. package/dist/runtime/apis/open-api/group.ts +4 -0
  80. package/dist/runtime/apis/open-api/index.ts +21 -0
  81. package/dist/runtime/apis/open-api/invoice.ts +5 -0
  82. package/dist/runtime/apis/open-api/license-plate.ts +4 -0
  83. package/dist/runtime/apis/open-api/login.ts +6 -0
  84. package/dist/runtime/apis/open-api/my-miniprogram.ts +4 -0
  85. package/dist/runtime/apis/open-api/privacy.ts +7 -0
  86. package/dist/runtime/apis/open-api/red-package.ts +4 -0
  87. package/dist/runtime/apis/open-api/settings.ts +5 -0
  88. package/dist/runtime/apis/open-api/soter.ts +6 -0
  89. package/dist/runtime/apis/open-api/subscribe-message.ts +6 -0
  90. package/dist/runtime/apis/open-api/user-info.ts +70 -0
  91. package/dist/runtime/apis/open-api/werun.ts +5 -0
  92. package/dist/runtime/apis/payment/index.ts +6 -0
  93. package/dist/runtime/apis/route/index.ts +88 -0
  94. package/dist/runtime/apis/share/index.ts +33 -0
  95. package/dist/runtime/apis/storage/background-fetch.ts +7 -0
  96. package/dist/runtime/apis/storage/cache-manager.ts +4 -0
  97. package/dist/runtime/apis/storage/index.ts +203 -0
  98. package/dist/runtime/apis/ui/animation/animation.ts +264 -0
  99. package/dist/runtime/apis/ui/animation/index.ts +7 -0
  100. package/dist/runtime/apis/ui/background.ts +20 -0
  101. package/dist/runtime/apis/ui/custom-component.ts +1 -0
  102. package/dist/runtime/apis/ui/fonts.ts +4 -0
  103. package/dist/runtime/apis/ui/index.ts +12 -0
  104. package/dist/runtime/apis/ui/interaction/index.ts +198 -0
  105. package/dist/runtime/apis/ui/menu.ts +4 -0
  106. package/dist/runtime/apis/ui/navigation-bar/index.ts +72 -0
  107. package/dist/runtime/apis/ui/pull-down-refresh.ts +47 -0
  108. package/dist/runtime/apis/ui/scroll/index.ts +82 -0
  109. package/dist/runtime/apis/ui/sticky.ts +4 -0
  110. package/dist/runtime/apis/ui/tab-bar.ts +144 -0
  111. package/dist/runtime/apis/ui/window.ts +20 -0
  112. package/dist/runtime/apis/utils/constant.ts +1 -0
  113. package/dist/runtime/apis/utils/handler.ts +117 -0
  114. package/dist/runtime/apis/utils/index.ts +105 -0
  115. package/dist/runtime/apis/utils/permissions.ts +6 -0
  116. package/dist/runtime/apis/utils/types.ts +12 -0
  117. package/dist/runtime/apis/utils/unit.ts +104 -0
  118. package/dist/runtime/apis/utils/validate.ts +87 -0
  119. package/dist/runtime/apis/worker/index.ts +4 -0
  120. package/dist/runtime/apis/wxml/index.ts +17 -0
  121. package/dist/runtime/apis/wxml/intersectionObserver.ts +100 -0
  122. package/dist/runtime/apis/wxml/nodesRef.ts +58 -0
  123. package/dist/runtime/apis/wxml/selectorQuery.ts +221 -0
  124. package/dist/runtime/apischunk/index.d.ts +802 -0
  125. package/dist/runtime/apischunk/index.js +5054 -0
  126. package/dist/runtime/components/deprecated.ets +43 -0
  127. package/dist/runtime/components/index.ets +49 -0
  128. package/dist/runtime/components/innerHtml.ets +16 -0
  129. package/dist/runtime/components/navigationBar.ets +65 -0
  130. package/dist/runtime/components/pageMeta.ets +94 -0
  131. package/dist/runtime/components/richText.ets +24 -0
  132. package/dist/runtime/components/slider.ets +119 -0
  133. package/dist/runtime/components/style.ets +286 -0
  134. package/dist/runtime/components/switch.ets +73 -0
  135. package/dist/runtime/components/tag.ts +58 -0
  136. package/dist/runtime/components/utils/AttributeManager.ets +252 -0
  137. package/dist/runtime/components/utils/DynamicCenter.ts +41 -0
  138. package/dist/runtime/components/utils/constant/event.ets +25 -0
  139. package/dist/runtime/components/utils/constant/style.ets +91 -0
  140. package/dist/runtime/components/utils/events.ts +26 -0
  141. package/dist/runtime/components/utils/flexManager.ets +49 -0
  142. package/dist/runtime/components/utils/helper.ets +51 -0
  143. package/dist/runtime/components/utils/htmlParser/HarmonyHTMLParser.ts +100 -0
  144. package/dist/runtime/components/utils/htmlParser/index.ts +58 -0
  145. package/dist/runtime/components/utils/index.ts +77 -0
  146. package/dist/runtime/components/utils/styles.ets +41 -0
  147. package/dist/runtime/components/video.ets +119 -0
  148. package/dist/runtime/components/webView.ets +55 -0
  149. package/dist/runtime/components/xComponent.ets +89 -0
  150. package/dist/runtime/framework/app.ts +248 -0
  151. package/dist/runtime/framework/connect.ts +24 -0
  152. package/dist/runtime/framework/constant.ts +3 -0
  153. package/dist/runtime/framework/hooks.ts +99 -0
  154. package/dist/runtime/framework/index.ts +15 -0
  155. package/dist/runtime/framework/native-page.ts +511 -0
  156. package/dist/runtime/framework/page.ts +256 -0
  157. package/dist/runtime/framework/utils/index.ts +17 -0
  158. package/dist/runtime/framework/utils/is.ts +26 -0
  159. package/dist/runtime/framework-reconciler/componentTree.ts +81 -0
  160. package/dist/runtime/framework-reconciler/constant.ts +86 -0
  161. package/dist/runtime/framework-reconciler/domInput.ts +90 -0
  162. package/dist/runtime/framework-reconciler/event.ts +108 -0
  163. package/dist/runtime/framework-reconciler/index.ts +99 -0
  164. package/dist/runtime/framework-reconciler/inputValueTracking.ts +106 -0
  165. package/dist/runtime/framework-reconciler/props.ts +132 -0
  166. package/dist/runtime/framework-reconciler/reconciler.ts +202 -0
  167. package/dist/runtime/framework-reconciler/render.ts +139 -0
  168. package/dist/runtime/framework-reconciler/workTags.ts +53 -0
  169. package/dist/runtime/runtime-cpp/bom/URL.ts +2 -0
  170. package/dist/runtime/runtime-cpp/bom/document.ts +45 -0
  171. package/dist/runtime/runtime-cpp/bom/history.ts +1 -0
  172. package/dist/runtime/runtime-cpp/bom/location.ts +1 -0
  173. package/dist/runtime/runtime-cpp/bom/navigator.ts +1 -0
  174. package/dist/runtime/runtime-cpp/bom/raf.ts +1 -0
  175. package/dist/runtime/runtime-cpp/bom/window.ts +57 -0
  176. package/dist/runtime/runtime-cpp/constant.ts +29 -0
  177. package/dist/runtime/runtime-cpp/current.ts +48 -0
  178. package/dist/runtime/runtime-cpp/dom/class-list.ts +41 -0
  179. package/dist/runtime/runtime-cpp/dom/comment.ts +9 -0
  180. package/dist/runtime/runtime-cpp/dom/dataSource.ts +87 -0
  181. package/dist/runtime/runtime-cpp/dom/document.ts +113 -0
  182. package/dist/runtime/runtime-cpp/dom/element/canvas.ts +285 -0
  183. package/dist/runtime/runtime-cpp/dom/element/element.ts +262 -0
  184. package/dist/runtime/runtime-cpp/dom/element/form.ts +371 -0
  185. package/dist/runtime/runtime-cpp/dom/element/index.ts +129 -0
  186. package/dist/runtime/runtime-cpp/dom/element/movable.ts +250 -0
  187. package/dist/runtime/runtime-cpp/dom/element/normal.ts +123 -0
  188. package/dist/runtime/runtime-cpp/dom/element/scroll_view.ts +32 -0
  189. package/dist/runtime/runtime-cpp/dom/element/text.ts +9 -0
  190. package/dist/runtime/runtime-cpp/dom/element/video.ts +66 -0
  191. package/dist/runtime/runtime-cpp/dom/element/web_view.ts +72 -0
  192. package/dist/runtime/runtime-cpp/dom/event-source.ts +1 -0
  193. package/dist/runtime/runtime-cpp/dom/event.ts +187 -0
  194. package/dist/runtime/runtime-cpp/dom/eventTarget.ts +81 -0
  195. package/dist/runtime/runtime-cpp/dom/node.ts +307 -0
  196. package/dist/runtime/runtime-cpp/dom/style.ts +44 -0
  197. package/dist/runtime/runtime-cpp/dom/stylesheet/index.ts +379 -0
  198. package/dist/runtime/runtime-cpp/dom/stylesheet/type.ts +212 -0
  199. package/dist/runtime/runtime-cpp/dom/stylesheet/util.ts +186 -0
  200. package/dist/runtime/runtime-cpp/emitter/emitter.ts +29 -0
  201. package/dist/runtime/runtime-cpp/env.ts +1 -0
  202. package/dist/runtime/runtime-cpp/harmony-library.ts +1 -0
  203. package/dist/runtime/runtime-cpp/index.ts +79 -0
  204. package/dist/runtime/runtime-cpp/interface/event.ts +10 -0
  205. package/dist/runtime/runtime-cpp/interface/index.ts +7 -0
  206. package/dist/runtime/runtime-cpp/next-tick.ts +14 -0
  207. package/dist/runtime/runtime-cpp/system.ts +213 -0
  208. package/dist/runtime/runtime-cpp/utils/index.ts +63 -0
  209. package/dist/runtime/runtime-cpp/utils/info.ts +123 -0
  210. package/dist/runtime/runtime-cpp/utils/page.ts +12 -0
  211. package/dist/runtime/runtime-cpp/utils/router.ts +1 -0
  212. package/dist/runtime/runtime-harmony/apis/helper.ets +33 -0
  213. package/dist/runtime/runtime-harmony/apis/network/common.ets +41 -0
  214. package/dist/runtime/runtime-harmony/apis/network/downloadFile.ets +327 -0
  215. package/dist/runtime/runtime-harmony/apis/network/index.ets +58 -0
  216. package/dist/runtime/runtime-harmony/apis/network/request.ets +206 -0
  217. package/dist/runtime/runtime-harmony/apis/network/uploadFile.ets +190 -0
  218. package/dist/runtime/runtime-harmony/apis/route.ets +110 -0
  219. package/dist/runtime/runtime-harmony/apis/taskpool.ets +149 -0
  220. package/dist/runtime/runtime-harmony/index.ets +41 -0
  221. package/dist/runtime/runtime-harmony/utils.ts +53 -0
  222. package/package.json +24 -23
  223. package/LICENSE +0 -174
@@ -0,0 +1,379 @@
1
+ // @ts-nocheck
2
+ import { BORDER_STYLE_MAP, FlexManager } from './util'
3
+
4
+ import type { HarmonyStyle, HarmonyType, TaroStyleType, TaroTextStyleType } from './type'
5
+
6
+ export { HarmonyStyle, HarmonyType, TaroStyleType, TaroTextStyleType }
7
+
8
+ export default class StyleSheet {
9
+ public hmStyle: HarmonyStyle = {}
10
+
11
+ get display () {
12
+ return this.hmStyle.display
13
+ }
14
+
15
+ get position () {
16
+ return this.hmStyle.position
17
+ }
18
+
19
+ get padding () {
20
+ return `${this.hmStyle.paddingTop} ${this.hmStyle.paddingRight} ${this.hmStyle.paddingBottom} ${this.hmStyle.paddingLeft}`
21
+ }
22
+
23
+ get paddingTop () {
24
+ return this.hmStyle.paddingTop
25
+ }
26
+
27
+ get paddingBottom () {
28
+ return this.hmStyle.paddingBottom
29
+ }
30
+
31
+ get paddingLeft () {
32
+ return this.hmStyle.paddingLeft
33
+ }
34
+
35
+ get paddingRight () {
36
+ return this.hmStyle.paddingRight
37
+ }
38
+
39
+ get margin () {
40
+ return `${this.hmStyle.marginTop} ${this.hmStyle.marginRight} ${this.hmStyle.marginBottom} ${this.hmStyle.marginLeft}`
41
+ }
42
+
43
+ get marginTop () {
44
+ return this.hmStyle.marginTop
45
+ }
46
+
47
+ get marginBottom () {
48
+ return this.hmStyle.marginBottom
49
+ }
50
+
51
+ get marginLeft () {
52
+ return this.hmStyle.marginLeft
53
+ }
54
+
55
+ get marginRight () {
56
+ return this.hmStyle.marginRight
57
+ }
58
+
59
+ get top () {
60
+ return this.hmStyle.top
61
+ }
62
+
63
+ get left () {
64
+ return this.hmStyle.left
65
+ }
66
+
67
+ get right () {
68
+ return this.hmStyle.right
69
+ }
70
+
71
+ get bottom () {
72
+ return this.hmStyle.bottom
73
+ }
74
+
75
+ get flex () {
76
+ return `${this.hmStyle.flexGrow} ${this.hmStyle.flexShrink} ${this.hmStyle.flexBasis}`
77
+ }
78
+
79
+ get flexBasis () {
80
+ return this.hmStyle.flexBasis
81
+ }
82
+
83
+ get flexGrow () {
84
+ return Number(this.hmStyle.flexGrow)
85
+ }
86
+
87
+ get flexShrink () {
88
+ return Number(this.hmStyle.flexShrink)
89
+ }
90
+
91
+ get alignSelf () {
92
+ return FlexManager.reverseItemAlign(this.hmStyle.alignSelf)
93
+ }
94
+
95
+ get flexDirection () {
96
+ return FlexManager.reverseDirection(this.hmStyle.flexDirection)
97
+ }
98
+
99
+ get justifyContent () {
100
+ return FlexManager.reverseFlexAlign(this.hmStyle.justifyContent)
101
+ }
102
+
103
+ get alignItems () {
104
+ return FlexManager.reverseItemAlign(this.hmStyle.alignItems)
105
+ }
106
+
107
+ get alignContent () {
108
+ return FlexManager.reverseFlexAlign(this.hmStyle.alignContent)
109
+ }
110
+
111
+ get flexWrap () {
112
+ return FlexManager.reverseFlexWrap(this.hmStyle.flexWrap)
113
+ }
114
+
115
+ get width () {
116
+ return this.hmStyle.width
117
+ }
118
+
119
+ get height () {
120
+ return this.hmStyle.height
121
+ }
122
+
123
+ get minHeight () {
124
+ return this.hmStyle.minHeight
125
+ }
126
+
127
+ get maxHeight () {
128
+ return this.hmStyle.maxHeight
129
+ }
130
+
131
+ get minWidth () {
132
+ return this.hmStyle.minWidth
133
+ }
134
+
135
+ get maxWidth () {
136
+ return this.hmStyle.maxWidth
137
+ }
138
+
139
+ get background () {
140
+ return `${this.backgroundColor} ${this.backgroundImage} ${this.backgroundRepeat} ${this.backgroundSize}`.trim()
141
+ }
142
+
143
+ get backgroundColor () {
144
+ return this.hmStyle.backgroundColor
145
+ }
146
+
147
+ get backgroundImage () {
148
+ return this.hmStyle.backgroundImage && `url(${this.hmStyle.backgroundImage})`
149
+ }
150
+
151
+ get backgroundRepeat () {
152
+ if (this.hmStyle.backgroundRepeat) {
153
+ switch (this.hmStyle.backgroundRepeat) {
154
+ case ImageRepeat.X: return 'repeat-x'; break
155
+ case ImageRepeat.Y: return 'repeat-y'; break
156
+ case ImageRepeat.XY: return 'repeat'; break
157
+ case ImageRepeat.NoRepeat: return 'no-repeat'; break
158
+ }
159
+ }
160
+ }
161
+
162
+ get backgroundSize () {
163
+ if (this.hmStyle.backgroundImage) {
164
+ return [this.hmStyle.backgroundSize.width, this.hmStyle.backgroundSize.height].join(' ')
165
+ }
166
+ }
167
+
168
+ get backgroundPosition () {
169
+ if (this.hmStyle.backgroundPosition) {
170
+ switch (this.hmStyle.backgroundPosition) {
171
+ case Alignment.TopStart: return 'left top'; break
172
+ case Alignment.Top: return 'center top'; break
173
+ case Alignment.TopEnd: return 'right top'; break
174
+ case Alignment.Start: return 'left center'; break
175
+ case Alignment.Center: return 'center center'; break
176
+ case Alignment.End: return 'right center'; break
177
+ case Alignment.BottomStart: return 'left bottom'; break
178
+ case Alignment.Bottom: return 'center bottom'; break
179
+ case Alignment.BottomEnd: return 'right bottom'; break
180
+ default: {
181
+ if (this.hmStyle.backgroundPosition) {
182
+ return [this.hmStyle.backgroundPosition, this.hmStyle.backgroundPosition.y].join(' ')
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+
189
+ get border () {
190
+ return [this.borderWidth, this.borderStyle, this.borderColor].join(' ')
191
+ }
192
+
193
+ get borderWidth () {
194
+ return this.hmStyle.borderWidth
195
+ }
196
+
197
+ get borderLeftWidth () {
198
+ return this.hmStyle.borderLeftWidth
199
+ }
200
+
201
+ get borderRightWidth () {
202
+ return this.hmStyle.borderRightWidth
203
+ }
204
+
205
+ get borderTopWidth () {
206
+ return this.hmStyle.borderTopWidth
207
+ }
208
+
209
+ get borderBottomWidth () {
210
+ return this.hmStyle.borderBottomWidth
211
+ }
212
+
213
+ get borderColor () {
214
+ return this.hmStyle.borderColor
215
+ }
216
+
217
+ get borderLeftColor () {
218
+ return this.hmStyle.borderLeftColor
219
+ }
220
+
221
+ get borderRightColor () {
222
+ return this.hmStyle.borderRightColor
223
+ }
224
+
225
+ get borderTopColor () {
226
+ return this.hmStyle.borderTopColor
227
+ }
228
+
229
+ get borderBottomColor () {
230
+ return this.hmStyle.borderBottomColor
231
+ }
232
+
233
+ get borderStyle () {
234
+ return BORDER_STYLE_MAP.reverse(this.hmStyle.borderStyle)
235
+ }
236
+
237
+ get borderLeftStyle () {
238
+ return BORDER_STYLE_MAP.reverse(this.hmStyle.borderLeftStyle)
239
+ }
240
+
241
+ get borderRightStyle () {
242
+ return BORDER_STYLE_MAP.reverse(this.hmStyle.borderRightStyle)
243
+ }
244
+
245
+ get borderTopStyle () {
246
+ return BORDER_STYLE_MAP.reverse(this.hmStyle.borderTopStyle)
247
+ }
248
+
249
+ get borderBottomStyle () {
250
+ return BORDER_STYLE_MAP.reverse(this.hmStyle.borderBottomStyle)
251
+ }
252
+
253
+ get borderRadius () {
254
+ return this.hmStyle.borderRadius
255
+ }
256
+
257
+ get borderTopLeftRadius () {
258
+ return this.hmStyle.borderTopLeftRadius
259
+ }
260
+
261
+ get borderTopRightRadius () {
262
+ return this.hmStyle.borderTopRightRadius
263
+ }
264
+
265
+ get borderBottomLeftRadius () {
266
+ return this.hmStyle.borderBottomLeftRadius
267
+ }
268
+
269
+ get borderBottomRightRadius () {
270
+ return this.hmStyle.borderBottomRightRadius
271
+ }
272
+
273
+ get zIndex () {
274
+ return this.hmStyle.zIndex
275
+ }
276
+
277
+ get opacity () {
278
+ return this.hmStyle.opacity
279
+ }
280
+
281
+ get overflow () {
282
+ return this.hmStyle.overflow ? 'hidden' : 'visible'
283
+ }
284
+
285
+ get focus () {
286
+ return !!this.hmStyle.focus
287
+ }
288
+
289
+ // 文本相关
290
+ get color () {
291
+ return this.hmStyle.color
292
+ }
293
+
294
+ get fontSize () {
295
+ return this.hmStyle.fontSize
296
+ }
297
+
298
+ get fontWeight () {
299
+ return this.hmStyle.fontWeight
300
+ }
301
+
302
+ get fontStyle () {
303
+ switch (this.hmStyle.fontStyle) {
304
+ case FontStyle.Italic: return 'italic'; break
305
+ case FontStyle.Normal: return 'normal'; break
306
+ default: return ''
307
+ }
308
+ }
309
+
310
+ get fontFamily () {
311
+ return this.hmStyle.fontFamily
312
+ }
313
+
314
+ get textAlign () {
315
+ switch (this.hmStyle.textAlign) {
316
+ case TextAlign.End: return 'right'; break
317
+ case TextAlign.Center: return 'center'; break
318
+ case TextAlign.Start: return 'left'; break
319
+ default: return ''
320
+ }
321
+ }
322
+
323
+ get verticalAlign() {
324
+ switch (this.hmStyle.verticalAlign) {
325
+ case Alignment.Center: return 'middle'; break
326
+ case Alignment.Top: return 'top'; break
327
+ case Alignment.Bottom: return 'bottom'; break
328
+ default: return ''
329
+ }
330
+ }
331
+
332
+ get lineHeight () {
333
+ return this.hmStyle.lineHeight
334
+ }
335
+
336
+ get letterSpacing () {
337
+ return this.hmStyle.letterSpacing
338
+ }
339
+
340
+ get textDecoration () {
341
+ if (this.hmStyle.textDecoration) {
342
+ switch (this.hmStyle.textDecoration.type) {
343
+ case TextDecorationType.Underline: return 'underline'; break
344
+ case TextDecorationType.Overline: return 'overline'; break
345
+ case TextDecorationType.LineThrough: return 'line-through'; break
346
+ case TextDecorationType.None: return 'none'; break
347
+ default: return ''
348
+ }
349
+ }
350
+ return ''
351
+ }
352
+
353
+ get textOverflow () {
354
+ if (this.hmStyle.textOverflow) {
355
+ switch (this.hmStyle.textOverflow.overflow) {
356
+ case TextOverflow.Clip: return 'clip'; break
357
+ case TextOverflow.Ellipsis: return 'ellipsis'; break
358
+ case TextOverflow.MARQUEE: return 'marquee'; break
359
+ default: return 'none'
360
+ }
361
+ }
362
+ }
363
+
364
+ get WebkitLineClamp () {
365
+ return Number(this.hmStyle.WebkitLineClamp)
366
+ }
367
+
368
+ get transform () {
369
+ return this.hmStyle.transform
370
+ }
371
+
372
+ get transformOrigin () {
373
+ return this.hmStyle.transformOrigin
374
+ }
375
+
376
+ get content () {
377
+ return this.hmStyle._content
378
+ }
379
+ }
@@ -0,0 +1,212 @@
1
+ // @ts-nocheck
2
+ export interface HarmonyStyle extends TaroStyleType {
3
+ textAlign?: TextAlign
4
+ textOverflow?: HarmonyType.Overflow
5
+ WebkitLineClamp?: number
6
+ whiteSpace?: string
7
+ letterSpacing?: number | string
8
+ verticalAlign?: Alignment
9
+ lineHeight?: Length
10
+ wordBreak?: string
11
+ }
12
+
13
+ export interface TaroStyleType {
14
+ id?: string
15
+
16
+ paddingTop?: Length
17
+ paddingRight?: Length
18
+ paddingBottom?: Length
19
+ paddingLeft?: Length
20
+
21
+ marginTop?: Length
22
+ marginRight?: Length
23
+ marginBottom?: Length
24
+ marginLeft?: Length
25
+
26
+ width?: Length
27
+ height?: Length
28
+
29
+ minHeight?: Length
30
+ maxHeight?: Length
31
+ minWidth?: Length
32
+ maxWidth?: Length
33
+
34
+ display?: 'flex' | 'block' | 'none'
35
+ visibility?: 'visible' | 'hidden'
36
+
37
+ // position
38
+ position?: 'relative' | 'absolute' | 'fixed'
39
+ top?: Dimension
40
+ left?: Dimension
41
+ bottom?: Dimension
42
+ right?: Dimension
43
+
44
+ // flex
45
+ flexBasis?: number | string
46
+ flexGrow?: number
47
+ flexShrink?: number
48
+ alignSelf?: ItemAlign
49
+ flexDirection?: FlexDirection
50
+ justifyContent?: FlexAlign
51
+ alignItems?: ItemAlign
52
+ flexWrap?: FlexWrap
53
+ alignContent?: FlexAlign
54
+
55
+ // background
56
+ backgroundColor?: ResourceColor
57
+ backgroundImage?: HarmonyType.Background.BackgroundImage
58
+ backgroundRepeat?: ImageRepeat
59
+ backgroundSize?: SizeOptions | ImageSize
60
+ backgroundPosition?: Position | Alignment
61
+
62
+ // 渐变
63
+ linearGradient?: HarmonyType.LinearGradient
64
+ radialGradient?: HarmonyType.RadialGradient
65
+
66
+ // transform
67
+ rotate?: HarmonyType.Transform.Rotate
68
+ translate?: HarmonyType.Transform.Translate
69
+ scale?: HarmonyType.Transform.Scale
70
+ transform?: HarmonyType.Transform.Transform
71
+ transformOrigin?: HarmonyType.Transform.Origin
72
+
73
+ // border
74
+ borderWidth?: Length | EdgeWidths
75
+ borderLeftWidth?: Length
76
+ borderRightWidth?: Length
77
+ borderTopWidth?: Length
78
+ borderBottomWidth?: Length
79
+ borderColor?: ResourceColor | EdgeColors
80
+ borderLeftColor?: ResourceColor
81
+ borderRightColor?: ResourceColor
82
+ borderTopColor?: ResourceColor
83
+ borderBottomColor?: ResourceColor
84
+ borderStyle?: BorderStyle | EdgeStyles
85
+ borderLeftStyle?: BorderStyle
86
+ borderRightStyle?: BorderStyle
87
+ borderTopStyle?: BorderStyle
88
+ borderBottomStyle?: BorderStyle
89
+ borderRadius?: Length | BorderRadiuses
90
+ borderTopLeftRadius?: Length
91
+ borderTopRightRadius?: Length
92
+ borderBottomLeftRadius?: Length
93
+ borderBottomRightRadius?: Length
94
+
95
+ // text
96
+ color?: ResourceColor
97
+ fontSize?: number | string | Resource
98
+ fontStyle?: FontStyle
99
+ fontWeight?: number | FontWeight | string
100
+ fontFamily?: string | Resource
101
+ textDecoration?: {
102
+ type: TextDecorationType
103
+ }
104
+
105
+ // animation
106
+ animationName?: {
107
+ percentage: number
108
+ event: TaroStyleType
109
+ }[]
110
+ animationDuration?: number
111
+ animationTimingFunction?: string
112
+ animationDelay?: number
113
+ animationIterationCount?: number
114
+
115
+ // shadow
116
+ boxShadow?: {
117
+ radius: number
118
+ color?: string
119
+ offsetX?: number
120
+ offsetY?: number
121
+ fill?: boolean
122
+ }
123
+
124
+ // other
125
+ opacity?: number | Resource
126
+ zIndex?: number
127
+ overflow?: string
128
+ focus?: boolean
129
+ content?: string
130
+ }
131
+
132
+ export interface TaroTextStyleType {
133
+ textAlign?: TextAlign
134
+ textOverflow?: HarmonyType.Overflow
135
+ WebkitLineClamp?: number
136
+ whiteSpace?: string
137
+ letterSpacing?: number | string
138
+ verticalAlign?: Alignment
139
+ lineHeight?: string | number | Resource
140
+ wordBreak?: WordBreak
141
+ }
142
+
143
+ export namespace HarmonyType {
144
+ export interface FlexOptions {
145
+ direction?: FlexDirection
146
+ justifyContent?: FlexAlign
147
+ alignItems?: ItemAlign
148
+ }
149
+ export interface LinearGradient {
150
+ angle?: number | string
151
+ direction?: GradientDirection
152
+ colors: Array<[ResourceColor, number]>
153
+ repeating?: boolean
154
+ }
155
+ export interface RadialGradient {
156
+ center: any
157
+ radius: number | string
158
+ colors: Array<[ResourceColor, number]>
159
+ repeating?: boolean
160
+ }
161
+ export interface Overflow {
162
+ overflow: TextOverflow
163
+ }
164
+ export interface RadioStyle {
165
+ checkedBackgroundColor?: ResourceColor
166
+ uncheckedBorderColor?: ResourceColor
167
+ indicatorColor?: ResourceColor
168
+ }
169
+ export namespace Background {
170
+ export type backgroundColor = ResourceColor
171
+ export interface backgroundImage {
172
+ src: ResourceStr
173
+ repeat?: ImageRepeat
174
+ }
175
+ export type backgroundImageSize = SizeOptions | ImageSize
176
+ export type backgroundImagePosition = Position | Alignment
177
+ }
178
+ export namespace Transform {
179
+ export interface Origin {
180
+ x?: number
181
+ y?: number
182
+ }
183
+ export interface Rotate {
184
+ x?: number
185
+ y?: number
186
+ z?: number
187
+ angle: number | string
188
+ centerX?: number | string
189
+ centerY?: number | string
190
+ center?: number
191
+ perspective?: number
192
+ }
193
+ export interface Translate {
194
+ x?: number | string
195
+ y?: number | string
196
+ z? : number | string
197
+ }
198
+ export interface Scale {
199
+ x?: number
200
+ y?: number
201
+ z?: number
202
+ centerX?: number | string
203
+ centerY?: number | string
204
+ }
205
+ // export type Transform = matrix4.Matrix4Transit
206
+ export type Transform = {
207
+ Translate?: Translate
208
+ Scale?: Scale
209
+ Rotate?: Rotate
210
+ }
211
+ }
212
+ }