@tarojs/plugin-platform-harmony-ets 3.7.0-alpha.27 → 4.0.0-alpha.10

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 (239) hide show
  1. package/dist/apis/apis.ts +6 -2
  2. package/dist/apis/base/crypto.ts +4 -0
  3. package/dist/apis/base/debug.ts +5 -0
  4. package/dist/apis/base/index.ts +9 -1
  5. package/dist/apis/base/performance.ts +8 -0
  6. package/dist/apis/base/system.ts +74 -21
  7. package/dist/apis/base/update.ts +5 -0
  8. package/dist/apis/base/weapp/app-event.ts +75 -0
  9. package/dist/apis/base/weapp/life-cycle.ts +21 -0
  10. package/dist/apis/canvas/index.ts +27 -0
  11. package/dist/apis/data-analysis/index.ts +6 -0
  12. package/dist/apis/device/accelerometer.ts +2 -1
  13. package/dist/apis/device/accessibility.ts +4 -0
  14. package/dist/apis/device/battery.ts +2 -2
  15. package/dist/apis/device/bluetooth-ble.ts +19 -0
  16. package/dist/apis/device/bluetooth-peripheral.ts +6 -0
  17. package/dist/apis/device/bluetooth.ts +16 -0
  18. package/dist/apis/device/calendar.ts +5 -0
  19. package/dist/apis/device/clipboard.ts +17 -9
  20. package/dist/apis/device/compass.ts +21 -0
  21. package/dist/apis/device/contact.ts +5 -0
  22. package/dist/apis/device/crypto.ts +4 -0
  23. package/dist/apis/device/gyroscope.ts +7 -0
  24. package/dist/apis/device/iBeacon.ts +10 -0
  25. package/dist/apis/device/index.ts +15 -0
  26. package/dist/apis/device/keyboard.ts +2 -1
  27. package/dist/apis/device/memory.ts +10 -3
  28. package/dist/apis/device/motion.ts +6 -0
  29. package/dist/apis/device/network.ts +26 -9
  30. package/dist/apis/device/nfc.ts +10 -0
  31. package/dist/apis/device/phone.ts +2 -1
  32. package/dist/apis/device/scan.ts +4 -0
  33. package/dist/apis/device/screen.ts +2 -1
  34. package/dist/apis/device/sms.ts +4 -0
  35. package/dist/apis/device/vibrate.ts +19 -11
  36. package/dist/apis/device/wifi.ts +15 -0
  37. package/dist/apis/ext/index.ts +5 -0
  38. package/dist/apis/files/index.ts +2 -1
  39. package/dist/apis/files/manager.ts +2 -1
  40. package/dist/apis/framework/index.ts +3 -8
  41. package/dist/apis/index.ts +27 -17
  42. package/dist/apis/location/index.ts +61 -68
  43. package/dist/apis/media/EditorContext.ts +32 -0
  44. package/dist/apis/media/audio/index.ts +18 -0
  45. package/dist/apis/media/background-audio/index.ts +16 -0
  46. package/dist/apis/media/camera.ts +16 -0
  47. package/dist/apis/media/common.ts +2 -1
  48. package/dist/apis/media/{image.ts → image/index.ts} +4 -3
  49. package/dist/apis/media/index.ts +10 -0
  50. package/dist/apis/media/live.ts +5 -0
  51. package/dist/apis/media/map.ts +4 -0
  52. package/dist/apis/media/media-recorder.ts +4 -0
  53. package/dist/apis/media/recorder.ts +6 -0
  54. package/dist/apis/media/video/VideoContext.ts +68 -0
  55. package/dist/apis/media/{video.ts → video/index.ts} +13 -2
  56. package/dist/apis/media/video-decoder.ts +4 -0
  57. package/dist/apis/media/video-processing.ts +4 -0
  58. package/dist/apis/media/voip.ts +19 -0
  59. package/dist/apis/network/index.ts +3 -0
  60. package/dist/apis/network/mdns.ts +13 -0
  61. package/dist/apis/network/request.ts +7 -6
  62. package/dist/apis/network/tcp.ts +4 -0
  63. package/dist/apis/network/udp.ts +4 -0
  64. package/dist/apis/network/webSocket.ts +2 -6
  65. package/dist/apis/open-api/account.ts +4 -0
  66. package/dist/apis/open-api/address.ts +4 -0
  67. package/dist/apis/open-api/authorize.ts +5 -0
  68. package/dist/apis/open-api/card.ts +5 -0
  69. package/dist/apis/open-api/channels-live.ts +11 -0
  70. package/dist/apis/open-api/customer-service.ts +4 -0
  71. package/dist/apis/open-api/device-voip.ts +5 -0
  72. package/dist/apis/open-api/facial.ts +7 -0
  73. package/dist/apis/open-api/favorites.ts +5 -0
  74. package/dist/apis/open-api/group.ts +4 -0
  75. package/dist/apis/open-api/index.ts +20 -6
  76. package/dist/apis/open-api/invoice.ts +5 -0
  77. package/dist/apis/open-api/license-plate.ts +4 -0
  78. package/dist/apis/open-api/login.ts +6 -0
  79. package/dist/apis/open-api/my-miniprogram.ts +4 -0
  80. package/dist/apis/open-api/privacy.ts +7 -0
  81. package/dist/apis/open-api/red-package.ts +4 -0
  82. package/dist/apis/open-api/settings.ts +5 -0
  83. package/dist/apis/open-api/soter.ts +6 -0
  84. package/dist/apis/open-api/subscribe-message.ts +6 -0
  85. package/dist/apis/open-api/{user-info/index.ts → user-info.ts} +1 -16
  86. package/dist/apis/open-api/werun.ts +5 -0
  87. package/dist/apis/payment/index.ts +6 -0
  88. package/dist/apis/route/index.ts +19 -28
  89. package/dist/apis/share/index.ts +33 -0
  90. package/dist/apis/storage/background-fetch.ts +7 -0
  91. package/dist/apis/storage/cache-manager.ts +4 -0
  92. package/dist/apis/storage/index.ts +158 -88
  93. package/dist/apis/ui/{animation.ts → animation/animation.ts} +73 -31
  94. package/dist/apis/ui/animation/index.ts +7 -0
  95. package/dist/apis/ui/background.ts +4 -19
  96. package/dist/apis/ui/custom-component.ts +8 -0
  97. package/dist/apis/ui/fonts.ts +4 -0
  98. package/dist/apis/ui/index.ts +8 -10
  99. package/dist/apis/ui/interaction/index.ts +45 -59
  100. package/dist/apis/ui/menu.ts +4 -0
  101. package/dist/apis/ui/navigation-bar/index.ts +60 -21
  102. package/dist/apis/ui/pull-down-refresh.ts +10 -4
  103. package/dist/apis/{page → ui/scroll}/index.ts +32 -27
  104. package/dist/apis/ui/sticky.ts +4 -0
  105. package/dist/apis/{tabbar/index.ts → ui/tab-bar.ts} +6 -8
  106. package/dist/apis/ui/window.ts +20 -0
  107. package/dist/apis/utils/handler.ts +4 -4
  108. package/dist/apis/utils/index.ts +1 -1
  109. package/dist/apis/worker/index.ts +4 -0
  110. package/dist/apis/wxml/IntersectionObserver.ts +24 -25
  111. package/dist/apis/wxml/index.ts +7 -2
  112. package/dist/apis/wxml/nodesRef.ts +2 -2
  113. package/dist/apis/wxml/selectorQuery.ts +29 -17
  114. package/dist/components-harmony-ets/button.ets +106 -80
  115. package/dist/components-harmony-ets/canvas.ets +51 -0
  116. package/dist/components-harmony-ets/checkbox.ets +82 -148
  117. package/dist/components-harmony-ets/form.ets +45 -132
  118. package/dist/components-harmony-ets/icon.ets +66 -69
  119. package/dist/components-harmony-ets/image.ets +26 -61
  120. package/dist/components-harmony-ets/index.ets +92 -0
  121. package/dist/components-harmony-ets/innerHtml.ets +7 -70
  122. package/dist/components-harmony-ets/input.ets +60 -146
  123. package/dist/components-harmony-ets/label.ets +86 -92
  124. package/dist/components-harmony-ets/listView.ets +26 -0
  125. package/dist/components-harmony-ets/movableArea.ets +124 -0
  126. package/dist/components-harmony-ets/movableView.ets +93 -0
  127. package/dist/components-harmony-ets/navigationBar.ets +65 -0
  128. package/dist/components-harmony-ets/pageMeta.ets +94 -0
  129. package/dist/components-harmony-ets/picker.ets +172 -198
  130. package/dist/components-harmony-ets/progress.ets +52 -0
  131. package/dist/components-harmony-ets/pseudo.ets +80 -0
  132. package/dist/components-harmony-ets/radio.ets +85 -155
  133. package/dist/components-harmony-ets/richText.ets +15 -87
  134. package/dist/components-harmony-ets/scrollList.ets +94 -0
  135. package/dist/components-harmony-ets/scrollView.ets +81 -149
  136. package/dist/components-harmony-ets/slider.ets +47 -94
  137. package/dist/components-harmony-ets/stickySection.ets +42 -0
  138. package/dist/components-harmony-ets/style.ets +396 -0
  139. package/dist/components-harmony-ets/swiper.ets +51 -151
  140. package/dist/components-harmony-ets/switch.ets +35 -76
  141. package/dist/components-harmony-ets/{index.ts → tag.ts} +6 -0
  142. package/dist/components-harmony-ets/text.ets +131 -76
  143. package/dist/components-harmony-ets/textArea.ets +64 -140
  144. package/dist/components-harmony-ets/utils/AttributeManager.ets +1 -1
  145. package/dist/components-harmony-ets/utils/DynamicCenter.ts +4 -13
  146. package/dist/components-harmony-ets/utils/constant/style.ets +9 -6
  147. package/dist/components-harmony-ets/utils/flexManager.ets +68 -85
  148. package/dist/components-harmony-ets/utils/helper.ets +18 -65
  149. package/dist/components-harmony-ets/utils/htmlParser/HarmonyHTMLParser.ts +1 -2
  150. package/dist/components-harmony-ets/utils/htmlParser/index.ts +1 -1
  151. package/dist/components-harmony-ets/utils/index.ts +55 -51
  152. package/dist/components-harmony-ets/utils/styles.ets +177 -65
  153. package/dist/components-harmony-ets/video.ets +70 -116
  154. package/dist/components-harmony-ets/view.ets +58 -64
  155. package/dist/components-harmony-ets/webView.ets +56 -0
  156. package/dist/index.d.ts +152 -0
  157. package/dist/index.js +230 -60
  158. package/dist/index.js.map +1 -1
  159. package/dist/runtime-ets/bom/document.ts +6 -4
  160. package/dist/runtime-ets/bom/getComputedStyle.ts +2 -2
  161. package/dist/runtime-ets/bom/window.ts +9 -2
  162. package/dist/runtime-ets/current.ts +3 -0
  163. package/dist/runtime-ets/dom/bind.ts +96 -0
  164. package/dist/runtime-ets/dom/class-list.ts +4 -6
  165. package/dist/runtime-ets/dom/comment.ts +1 -2
  166. package/dist/runtime-ets/dom/cssNesting.ts +409 -0
  167. package/dist/runtime-ets/dom/cssStyleDeclaration.ts +30 -20
  168. package/dist/runtime-ets/dom/dataSource.ts +64 -0
  169. package/dist/runtime-ets/dom/document.ts +36 -51
  170. package/dist/runtime-ets/dom/element/canvas.ts +136 -0
  171. package/dist/runtime-ets/dom/element/element.ts +439 -0
  172. package/dist/runtime-ets/dom/element/form.ts +403 -0
  173. package/dist/runtime-ets/dom/element/index.ts +120 -0
  174. package/dist/runtime-ets/dom/element/movableArea.ts +11 -0
  175. package/dist/runtime-ets/dom/element/movableView.ts +242 -0
  176. package/dist/runtime-ets/dom/element/normal.ts +103 -0
  177. package/dist/runtime-ets/dom/element/progress.ts +11 -0
  178. package/dist/runtime-ets/dom/element/scrollView.ts +15 -0
  179. package/dist/runtime-ets/dom/element/text.ts +10 -0
  180. package/dist/runtime-ets/dom/element/video.ts +50 -0
  181. package/dist/runtime-ets/dom/element/webView.ts +68 -0
  182. package/dist/runtime-ets/dom/event.ts +26 -5
  183. package/dist/runtime-ets/dom/eventTarget.ts +3 -3
  184. package/dist/runtime-ets/dom/node.ts +114 -49
  185. package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +805 -0
  186. package/dist/runtime-ets/dom/stylesheet/index.ts +122 -429
  187. package/dist/runtime-ets/dom/stylesheet/type.ts +93 -17
  188. package/dist/runtime-ets/dom/stylesheet/util.ts +145 -17
  189. package/dist/runtime-ets/index.ts +2 -3
  190. package/dist/runtime-ets/interface/event.ts +3 -2
  191. package/dist/runtime-ets/utils/index.ts +87 -17
  192. package/dist/runtime-ets/utils/info.ts +21 -47
  193. package/dist/runtime-framework/react/app.ts +20 -28
  194. package/dist/runtime-framework/react/hooks.ts +3 -4
  195. package/dist/runtime-framework/react/index.ts +1 -2
  196. package/dist/runtime-framework/react/native-page.ts +421 -0
  197. package/dist/runtime-framework/react/page.ts +5 -17
  198. package/dist/runtime-framework/solid/app.ts +25 -45
  199. package/dist/runtime-framework/solid/connect.ts +21 -3
  200. package/dist/runtime-framework/solid/hooks.ts +17 -12
  201. package/dist/runtime-framework/solid/index.ts +6 -2
  202. package/dist/runtime-framework/solid/page.ts +84 -36
  203. package/dist/runtime-framework/solid/reconciler/props.ts +70 -25
  204. package/dist/runtime-framework/solid/reconciler/render.ts +16 -6
  205. package/dist/runtime-framework/solid/reconciler/use.ts +0 -1
  206. package/dist/runtime-framework/solid/utils/index.ts +0 -2
  207. package/dist/runtime-utils.d.ts +827 -0
  208. package/dist/runtime-utils.js +1633 -549
  209. package/dist/runtime-utils.js.map +1 -1
  210. package/dist/runtime.d.ts +1 -0
  211. package/dist/runtime.js +1633 -549
  212. package/dist/runtime.js.map +1 -1
  213. package/index.js +3 -1
  214. package/package.json +14 -15
  215. package/static/media/cancel.svg +1 -0
  216. package/static/media/circle.svg +1 -0
  217. package/static/media/clear.svg +1 -0
  218. package/static/media/download.svg +1 -0
  219. package/static/media/info.svg +1 -0
  220. package/static/media/info_circle.svg +1 -0
  221. package/static/media/search.svg +1 -0
  222. package/static/media/success.svg +1 -0
  223. package/static/media/success_no_circle.svg +1 -0
  224. package/static/media/taro_arrow_left.svg +1 -0
  225. package/static/media/taro_home.svg +1 -0
  226. package/static/media/waiting.svg +1 -0
  227. package/static/media/warn.svg +1 -0
  228. package/types/harmony.d.ts +4 -0
  229. package/types/index.d.ts +4 -0
  230. package/types/runtime.d.ts +7 -1
  231. package/LICENSE +0 -160
  232. package/dist/components-harmony-ets/base.ets +0 -63
  233. package/dist/components-harmony-ets/element.ets +0 -223
  234. package/dist/components-harmony-ets/utils/constant/icon.ts +0 -19
  235. package/dist/runtime-ets/dom/element.ts +0 -457
  236. package/dist/runtime-ets/dom/text.ts +0 -19
  237. package/dist/runtime-ets/utils/bind.ts +0 -35
  238. package/types/api.d.ts +0 -4
  239. /package/dist/runtime-framework/solid/{contant.ts → constant.ts} +0 -0
@@ -5,27 +5,32 @@ import type { Style, TaroElement } from '@tarojs/runtime'
5
5
 
6
6
  export type Props = Record<string, unknown>
7
7
 
8
+ const isHarmony = process.env.TARO_PLATFORM === 'harmony'
9
+ const IS_NON_DIMENSIONAL = /max|aspect|acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i
10
+
8
11
  function isEventName (s: string) {
9
12
  return s[0] === 'o' && s[1] === 'n'
10
13
  }
11
14
 
12
- const IS_NON_DIMENSIONAL = /max|aspect|acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i
15
+ function isEqual (obj1, obj2) {
16
+ return JSON.stringify(obj1) === JSON.stringify(obj2)
17
+ }
13
18
 
14
19
  export function updateProps (dom: TaroElement, oldProps: Props, newProps: Props) {
15
20
  const updatePayload = getUpdatePayload(dom, oldProps, newProps)
16
- if (updatePayload){
21
+ if (updatePayload) {
17
22
  updatePropsByPayload(dom, oldProps, updatePayload)
18
23
  }
19
24
  }
20
25
 
21
- export function updatePropsByPayload (dom: TaroElement, oldProps: Props, updatePayload: any[]){
22
- for (let i = 0; i < updatePayload.length; i += 2){ // key, value 成对出现
23
- const key = updatePayload[i]; const newProp = updatePayload[i+1]; const oldProp = oldProps[key]
26
+ export function updatePropsByPayload (dom: TaroElement, oldProps: Props, updatePayload: any[]) {
27
+ for (let i = 0; i < updatePayload.length; i += 2) { // key, value 成对出现
28
+ const key = updatePayload[i]; const newProp = updatePayload[i + 1]; const oldProp = oldProps[key]
24
29
  setProperty(dom, key, newProp, oldProp)
25
30
  }
26
31
  }
27
32
 
28
- export function getUpdatePayload (dom: TaroElement, oldProps: Props, newProps: Props){
33
+ export function getUpdatePayload (dom: TaroElement, oldProps: Props, newProps: Props) {
29
34
  let i: string
30
35
  let updatePayload: any[] | null = null
31
36
 
@@ -59,12 +64,11 @@ function setEvent (dom: TaroElement, name: string, value: unknown, oldValue?: un
59
64
 
60
65
  const compName = capitalize(toCamelCase(dom.tagName.toLowerCase()))
61
66
 
62
- if (eventName === 'click' && compName in internalComponents) {
67
+ if (eventName === 'click' && !isHarmony && compName in internalComponents) {
63
68
  eventName = 'tap'
64
69
  }
65
70
 
66
71
  if (isFunction(value)) {
67
- const isHarmony = process.env.TARO_PLATFORM === 'harmony'
68
72
  if (oldValue) {
69
73
  dom.removeEventListener(eventName, oldValue as any, !isHarmony ? false : undefined)
70
74
  dom.addEventListener(eventName, value, !isHarmony ? { isCapture, sideEffect: false } : undefined)
@@ -76,19 +80,24 @@ function setEvent (dom: TaroElement, name: string, value: unknown, oldValue?: un
76
80
  }
77
81
  }
78
82
 
79
- function setStyle (style: Style, key: string, value: string | number) {
80
- if (key[0] === '-') {
81
- style.setProperty(key, value.toString())
83
+ function setStyle (style: Style, key: string, value: unknown) {
84
+ if (key[0] === '-' && !isHarmony) {
82
85
  // css variables need not further judgment
86
+ style.setProperty(key, (value as string).toString())
83
87
  return
84
88
  }
85
89
 
86
- style[key] =
87
- isNumber(value) && IS_NON_DIMENSIONAL.test(key) === false
88
- ? convertNumber2PX(value)
89
- : value == null
90
- ? ''
91
- : value
90
+ if (isHarmony && key.startsWith('_')) {
91
+ // harmony样式已处理
92
+ style[key] = value == null ? '' : value
93
+ } else {
94
+ style[key] =
95
+ isNumber(value) && IS_NON_DIMENSIONAL.test(key) === false
96
+ ? convertNumber2PX(value)
97
+ : value == null
98
+ ? ''
99
+ : value
100
+ }
92
101
  }
93
102
 
94
103
  type StyleValue = Record<string, string | number>
@@ -99,13 +108,9 @@ interface DangerouslySetInnerHTML {
99
108
  export function setProperty (dom: TaroElement, name: string, value: unknown, oldValue?: unknown) {
100
109
  name = name === 'className' ? 'class' : name
101
110
 
102
- if (
103
- name === 'key' ||
104
- name === 'children' ||
105
- name === 'ref'
106
- ) {
107
- // skip
108
- } else if (name === 'style') {
111
+ if (['key', 'children', 'ref'].includes(name)) return
112
+
113
+ if (name === 'style') {
109
114
  const style = dom.style
110
115
  if (isString(value)) {
111
116
  style.cssText = value
@@ -118,6 +123,7 @@ export function setProperty (dom: TaroElement, name: string, value: unknown, old
118
123
  if (isObject<StyleValue>(oldValue)) {
119
124
  for (const i in oldValue) {
120
125
  if (!(value && i in (value as StyleValue))) {
126
+ // harmony设置style,路径设置路径如下:dom.style => cssStyleDeclaration.setProperty => convertWebStyle2HmStyle => dom._st.hmStyle
121
127
  setStyle(style, i, '')
122
128
  }
123
129
  }
@@ -125,12 +131,40 @@ export function setProperty (dom: TaroElement, name: string, value: unknown, old
125
131
 
126
132
  if (isObject<StyleValue>(value)) {
127
133
  for (const i in value) {
128
- if (!oldValue || value[i] !== (oldValue as StyleValue)[i]) {
134
+ if (!oldValue || !isEqual(value[i], (oldValue as StyleValue)[i])) {
129
135
  setStyle(style, i, value[i])
130
136
  }
131
137
  }
132
138
  }
133
139
  }
140
+ } else if (name === '__hmStyle') {
141
+ // 鸿蒙样式特殊处理
142
+ // @ts-ignore
143
+ const style = dom._st.hmStyle // __hmStyle是已经被处理过的鸿蒙样式,可以直接塞进hmStyle对象内
144
+ if (isObject<StyleValue>(oldValue)) {
145
+ for (const i in oldValue) {
146
+ if (!(value && i in (value as StyleValue))) {
147
+ // 鸿蒙伪类特殊处理
148
+ if (isHarmony && (i === '::after' || i === '::before')) {
149
+ setPseudo(dom, i, null)
150
+ } else {
151
+ style[i] = ''
152
+ }
153
+ }
154
+ }
155
+ }
156
+ if (isObject<StyleValue>(value)) {
157
+ for (const i in value) {
158
+ if (!oldValue || !isEqual(value[i], (oldValue as StyleValue)[i])) {
159
+ // 鸿蒙伪类特殊处理
160
+ if (isHarmony && (i === '::after' || i === '::before')) {
161
+ setPseudo(dom, i, value[i] as unknown as StyleValue)
162
+ } else {
163
+ style[i] = value[i]
164
+ }
165
+ }
166
+ }
167
+ }
134
168
  } else if (isEventName(name)) {
135
169
  setEvent(dom, name, value, oldValue)
136
170
  } else if (name === 'dangerouslySetInnerHTML') {
@@ -149,3 +183,14 @@ export function setProperty (dom: TaroElement, name: string, value: unknown, old
149
183
  }
150
184
  }
151
185
  }
186
+
187
+ // 设置鸿蒙伪类属性(特殊设置)
188
+ function setPseudo(dom: TaroElement, name: '::after' | '::before', value: StyleValue | null) {
189
+ if (name === '::after') {
190
+ // @ts-ignore
191
+ dom.set_pseudo_after(value)
192
+ } else if (name === '::before') {
193
+ // @ts-ignore
194
+ dom.set_pseudo_before(value)
195
+ }
196
+ }
@@ -1,5 +1,7 @@
1
- import TaroText from '@tarojs/components/text'
1
+ // @ts-ignore
2
+ import { TaroText } from '@tarojs/components'
2
3
  import { document } from '@tarojs/runtime'
4
+ import { isFunction, isString } from '@tarojs/shared'
3
5
  import { createRenderer } from 'solid-js/universal'
4
6
 
5
7
  import { h } from './h'
@@ -46,11 +48,10 @@ const renderer = createRenderer<TaroNode>({
46
48
  export const render = renderer.render
47
49
  export const effect = renderer.effect
48
50
  export const memo = renderer.memo
49
- export const createComponent = (type, props) => {
50
- if (typeof type === 'string') {
51
- return h(type, props)
52
- }
53
- return renderer.createComponent(type, props)
51
+ export const createComponent = (type, props?) => {
52
+ if (isString(type)) return h(type, props)
53
+ if (isFunction(type)) return renderer.createComponent(type, props)
54
+ return renderer.createComponent(Fragment, props)
54
55
  }
55
56
  export const createElement = renderer.createElement
56
57
  export const createTextNode = renderer.createTextNode
@@ -59,3 +60,12 @@ export const insert = renderer.insert
59
60
  export const spread = renderer.spread
60
61
  export const setProp = renderer.setProp
61
62
  export const mergeProps = renderer.mergeProps
63
+
64
+ function Fragment(props) {
65
+ return props.children
66
+ }
67
+ function jsx(type, props) {
68
+ return createComponent(type, props)
69
+ }
70
+
71
+ export { Fragment, jsx, jsx as jsxDEV, jsx as jsxs }
@@ -5,4 +5,3 @@ export function use(fn, ele, accessor) {
5
5
  fn(ele, accessor)
6
6
  })
7
7
  }
8
-
@@ -45,5 +45,3 @@ export function setRouterParams(options) {
45
45
  ...options,
46
46
  }
47
47
  }
48
-
49
-