isomorfeus-preact 10.9.0 → 22.9.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (266) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +14 -3
  3. data/README.md +23 -39
  4. data/lib/browser/delegate_native.rb +94 -72
  5. data/lib/browser/document.rb +38 -0
  6. data/lib/browser/element.rb +160 -176
  7. data/lib/browser/event.rb +99 -94
  8. data/lib/browser/history.rb +40 -20
  9. data/lib/browser/location.rb +59 -0
  10. data/lib/browser/window.rb +58 -0
  11. data/lib/data_uri/open_uri.rb +18 -0
  12. data/lib/data_uri/uri.rb +61 -0
  13. data/lib/data_uri.rb +4 -0
  14. data/lib/isomorfeus/preact/config.rb +42 -54
  15. data/lib/isomorfeus/preact/imports.rb +5 -20
  16. data/lib/isomorfeus/preact/ssr.rb +34 -0
  17. data/lib/isomorfeus/preact/thread_local_component_cache.rb +9 -11
  18. data/lib/isomorfeus/preact/version.rb +5 -0
  19. data/lib/isomorfeus/preact/view_helper.rb +72 -0
  20. data/lib/isomorfeus/props/validator.rb +19 -11
  21. data/lib/isomorfeus/top_level.rb +55 -33
  22. data/lib/isomorfeus-preact.rb +78 -103
  23. data/lib/link.rb +52 -0
  24. data/lib/lucid_app.rb +117 -0
  25. data/lib/lucid_component.rb +154 -0
  26. data/lib/nano_css.rb +282 -465
  27. data/lib/preact/component.rb +222 -0
  28. data/lib/preact/component_resolution.rb +49 -83
  29. data/lib/preact/context.rb +68 -0
  30. data/lib/preact/elements.rb +2 -9
  31. data/lib/preact/module_component_resolution.rb +50 -0
  32. data/lib/preact/prop_declaration_mixin.rb +73 -0
  33. data/lib/preact.rb +1548 -257
  34. data/lib/redirect.rb +34 -0
  35. data/lib/route.rb +15 -0
  36. data/lib/router.rb +145 -0
  37. data/lib/switch.rb +70 -0
  38. data/opal/iso_uri.rb +29 -0
  39. data/opal/uri/common.rb +18 -0
  40. data/opal/uri/generic.rb +47 -0
  41. metadata +45 -309
  42. data/lib/isomorfeus/preact/memcached_component_cache.rb +0 -19
  43. data/lib/isomorfeus/preact/redis_component_cache.rb +0 -19
  44. data/lib/isomorfeus/preact/ssr/history.rb +0 -23
  45. data/lib/isomorfeus/preact/ssr/render_core.rb +0 -117
  46. data/lib/isomorfeus/preact/ssr/top_level.rb +0 -37
  47. data/lib/isomorfeus/preact_view_helper.rb +0 -129
  48. data/lib/isomorfeus_preact/lucid_app/api.rb +0 -38
  49. data/lib/isomorfeus_preact/lucid_app/base.rb +0 -7
  50. data/lib/isomorfeus_preact/lucid_app/mixin.rb +0 -14
  51. data/lib/isomorfeus_preact/lucid_app/native_component_constructor.rb +0 -101
  52. data/lib/isomorfeus_preact/lucid_component/api.rb +0 -123
  53. data/lib/isomorfeus_preact/lucid_component/app_store_proxy.rb +0 -32
  54. data/lib/isomorfeus_preact/lucid_component/base.rb +0 -7
  55. data/lib/isomorfeus_preact/lucid_component/class_store_proxy.rb +0 -37
  56. data/lib/isomorfeus_preact/lucid_component/initializer.rb +0 -9
  57. data/lib/isomorfeus_preact/lucid_component/mixin.rb +0 -13
  58. data/lib/isomorfeus_preact/lucid_component/native_component_constructor.rb +0 -87
  59. data/lib/isomorfeus_preact/lucid_component/styles_wrapper.rb +0 -40
  60. data/lib/isomorfeus_preact/lucid_func/base.rb +0 -7
  61. data/lib/isomorfeus_preact/lucid_func/initializer.rb +0 -8
  62. data/lib/isomorfeus_preact/lucid_func/mixin.rb +0 -10
  63. data/lib/isomorfeus_preact/lucid_func/native_component_constructor.rb +0 -56
  64. data/lib/isomorfeus_preact/preact/function_component/api.rb +0 -164
  65. data/lib/isomorfeus_preact/preact/function_component/base.rb +0 -7
  66. data/lib/isomorfeus_preact/preact/function_component/initializer.rb +0 -6
  67. data/lib/isomorfeus_preact/preact/function_component/mixin.rb +0 -8
  68. data/lib/isomorfeus_preact/preact/function_component/native_component_constructor.rb +0 -47
  69. data/lib/lucid_app/context.rb +0 -24
  70. data/lib/lucid_prop_declaration/mixin.rb +0 -126
  71. data/lib/preact/component/api.rb +0 -137
  72. data/lib/preact/component/base.rb +0 -7
  73. data/lib/preact/component/callbacks.rb +0 -111
  74. data/lib/preact/component/initializer.rb +0 -7
  75. data/lib/preact/component/mixin.rb +0 -11
  76. data/lib/preact/component/native_component_constructor.rb +0 -77
  77. data/lib/preact/context_wrapper.rb +0 -48
  78. data/lib/preact/native_constant_wrapper.rb +0 -29
  79. data/lib/preact/option_hooks.rb +0 -98
  80. data/lib/preact/params.rb +0 -16
  81. data/lib/preact/props.rb +0 -69
  82. data/lib/preact/ref.rb +0 -17
  83. data/lib/preact/state.rb +0 -87
  84. data/lib/preact/version.rb +0 -3
  85. data/node_modules/.package-lock.json +0 -38
  86. data/node_modules/preact/LICENSE +0 -21
  87. data/node_modules/preact/README.md +0 -188
  88. data/node_modules/preact/compat/LICENSE +0 -21
  89. data/node_modules/preact/compat/client.js +0 -19
  90. data/node_modules/preact/compat/client.mjs +0 -17
  91. data/node_modules/preact/compat/dist/compat.js +0 -2
  92. data/node_modules/preact/compat/dist/compat.js.map +0 -1
  93. data/node_modules/preact/compat/dist/compat.mjs +0 -2
  94. data/node_modules/preact/compat/dist/compat.module.js +0 -2
  95. data/node_modules/preact/compat/dist/compat.module.js.map +0 -1
  96. data/node_modules/preact/compat/dist/compat.umd.js +0 -2
  97. data/node_modules/preact/compat/dist/compat.umd.js.map +0 -1
  98. data/node_modules/preact/compat/jsx-dev-runtime.js +0 -3
  99. data/node_modules/preact/compat/jsx-dev-runtime.mjs +0 -3
  100. data/node_modules/preact/compat/jsx-runtime.js +0 -3
  101. data/node_modules/preact/compat/jsx-runtime.mjs +0 -3
  102. data/node_modules/preact/compat/package.json +0 -49
  103. data/node_modules/preact/compat/scheduler.js +0 -15
  104. data/node_modules/preact/compat/scheduler.mjs +0 -23
  105. data/node_modules/preact/compat/server.browser.js +0 -4
  106. data/node_modules/preact/compat/server.js +0 -15
  107. data/node_modules/preact/compat/server.mjs +0 -4
  108. data/node_modules/preact/compat/src/Children.js +0 -21
  109. data/node_modules/preact/compat/src/PureComponent.js +0 -15
  110. data/node_modules/preact/compat/src/forwardRef.js +0 -44
  111. data/node_modules/preact/compat/src/index.d.ts +0 -164
  112. data/node_modules/preact/compat/src/index.js +0 -223
  113. data/node_modules/preact/compat/src/internal.d.ts +0 -47
  114. data/node_modules/preact/compat/src/memo.js +0 -34
  115. data/node_modules/preact/compat/src/portals.js +0 -82
  116. data/node_modules/preact/compat/src/render.js +0 -238
  117. data/node_modules/preact/compat/src/suspense-list.d.ts +0 -14
  118. data/node_modules/preact/compat/src/suspense-list.js +0 -126
  119. data/node_modules/preact/compat/src/suspense.d.ts +0 -15
  120. data/node_modules/preact/compat/src/suspense.js +0 -270
  121. data/node_modules/preact/compat/src/util.js +0 -28
  122. data/node_modules/preact/compat/test-utils.js +0 -1
  123. data/node_modules/preact/debug/LICENSE +0 -21
  124. data/node_modules/preact/debug/dist/debug.js +0 -2
  125. data/node_modules/preact/debug/dist/debug.js.map +0 -1
  126. data/node_modules/preact/debug/dist/debug.mjs +0 -2
  127. data/node_modules/preact/debug/dist/debug.module.js +0 -2
  128. data/node_modules/preact/debug/dist/debug.module.js.map +0 -1
  129. data/node_modules/preact/debug/dist/debug.umd.js +0 -2
  130. data/node_modules/preact/debug/dist/debug.umd.js.map +0 -1
  131. data/node_modules/preact/debug/package.json +0 -26
  132. data/node_modules/preact/debug/src/check-props.js +0 -54
  133. data/node_modules/preact/debug/src/component-stack.js +0 -146
  134. data/node_modules/preact/debug/src/constants.js +0 -3
  135. data/node_modules/preact/debug/src/debug.js +0 -437
  136. data/node_modules/preact/debug/src/index.js +0 -6
  137. data/node_modules/preact/debug/src/internal.d.ts +0 -82
  138. data/node_modules/preact/debug/src/util.js +0 -11
  139. data/node_modules/preact/devtools/LICENSE +0 -21
  140. data/node_modules/preact/devtools/dist/devtools.js +0 -2
  141. data/node_modules/preact/devtools/dist/devtools.js.map +0 -1
  142. data/node_modules/preact/devtools/dist/devtools.mjs +0 -2
  143. data/node_modules/preact/devtools/dist/devtools.module.js +0 -2
  144. data/node_modules/preact/devtools/dist/devtools.module.js.map +0 -1
  145. data/node_modules/preact/devtools/dist/devtools.umd.js +0 -2
  146. data/node_modules/preact/devtools/dist/devtools.umd.js.map +0 -1
  147. data/node_modules/preact/devtools/package.json +0 -25
  148. data/node_modules/preact/devtools/src/devtools.js +0 -10
  149. data/node_modules/preact/devtools/src/index.d.ts +0 -8
  150. data/node_modules/preact/devtools/src/index.js +0 -15
  151. data/node_modules/preact/dist/preact.js +0 -2
  152. data/node_modules/preact/dist/preact.js.map +0 -1
  153. data/node_modules/preact/dist/preact.min.js +0 -2
  154. data/node_modules/preact/dist/preact.min.js.map +0 -1
  155. data/node_modules/preact/dist/preact.mjs +0 -2
  156. data/node_modules/preact/dist/preact.module.js +0 -2
  157. data/node_modules/preact/dist/preact.module.js.map +0 -1
  158. data/node_modules/preact/dist/preact.umd.js +0 -2
  159. data/node_modules/preact/dist/preact.umd.js.map +0 -1
  160. data/node_modules/preact/hooks/LICENSE +0 -21
  161. data/node_modules/preact/hooks/dist/hooks.js +0 -2
  162. data/node_modules/preact/hooks/dist/hooks.js.map +0 -1
  163. data/node_modules/preact/hooks/dist/hooks.mjs +0 -2
  164. data/node_modules/preact/hooks/dist/hooks.module.js +0 -2
  165. data/node_modules/preact/hooks/dist/hooks.module.js.map +0 -1
  166. data/node_modules/preact/hooks/dist/hooks.umd.js +0 -2
  167. data/node_modules/preact/hooks/dist/hooks.umd.js.map +0 -1
  168. data/node_modules/preact/hooks/package.json +0 -35
  169. data/node_modules/preact/hooks/src/index.d.ts +0 -139
  170. data/node_modules/preact/hooks/src/index.js +0 -417
  171. data/node_modules/preact/hooks/src/internal.d.ts +0 -78
  172. data/node_modules/preact/jsx-runtime/LICENSE +0 -21
  173. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.js +0 -2
  174. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.js.map +0 -1
  175. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.mjs +0 -2
  176. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js +0 -2
  177. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js.map +0 -1
  178. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.umd.js +0 -2
  179. data/node_modules/preact/jsx-runtime/dist/jsxRuntime.umd.js.map +0 -1
  180. data/node_modules/preact/jsx-runtime/package.json +0 -28
  181. data/node_modules/preact/jsx-runtime/src/index.d.ts +0 -50
  182. data/node_modules/preact/jsx-runtime/src/index.js +0 -77
  183. data/node_modules/preact/package.json +0 -304
  184. data/node_modules/preact/src/cjs.js +0 -3
  185. data/node_modules/preact/src/clone-element.js +0 -34
  186. data/node_modules/preact/src/component.js +0 -225
  187. data/node_modules/preact/src/constants.js +0 -3
  188. data/node_modules/preact/src/create-context.js +0 -68
  189. data/node_modules/preact/src/create-element.js +0 -98
  190. data/node_modules/preact/src/diff/catch-error.js +0 -40
  191. data/node_modules/preact/src/diff/children.js +0 -335
  192. data/node_modules/preact/src/diff/index.js +0 -533
  193. data/node_modules/preact/src/diff/props.js +0 -158
  194. data/node_modules/preact/src/index.d.ts +0 -317
  195. data/node_modules/preact/src/index.js +0 -13
  196. data/node_modules/preact/src/internal.d.ts +0 -155
  197. data/node_modules/preact/src/jsx.d.ts +0 -1014
  198. data/node_modules/preact/src/options.js +0 -16
  199. data/node_modules/preact/src/render.js +0 -75
  200. data/node_modules/preact/src/util.js +0 -27
  201. data/node_modules/preact/test-utils/dist/testUtils.js +0 -2
  202. data/node_modules/preact/test-utils/dist/testUtils.js.map +0 -1
  203. data/node_modules/preact/test-utils/dist/testUtils.mjs +0 -2
  204. data/node_modules/preact/test-utils/dist/testUtils.module.js +0 -2
  205. data/node_modules/preact/test-utils/dist/testUtils.module.js.map +0 -1
  206. data/node_modules/preact/test-utils/dist/testUtils.umd.js +0 -2
  207. data/node_modules/preact/test-utils/dist/testUtils.umd.js.map +0 -1
  208. data/node_modules/preact/test-utils/package.json +0 -28
  209. data/node_modules/preact/test-utils/src/index.d.ts +0 -3
  210. data/node_modules/preact/test-utils/src/index.js +0 -118
  211. data/node_modules/preact-render-to-string/LICENSE +0 -21
  212. data/node_modules/preact-render-to-string/README.md +0 -102
  213. data/node_modules/preact-render-to-string/dist/commonjs.js +0 -2
  214. data/node_modules/preact-render-to-string/dist/commonjs.js.map +0 -1
  215. data/node_modules/preact-render-to-string/dist/index.d.ts +0 -16
  216. data/node_modules/preact-render-to-string/dist/index.js +0 -1
  217. data/node_modules/preact-render-to-string/dist/index.js.map +0 -1
  218. data/node_modules/preact-render-to-string/dist/index.mjs +0 -2
  219. data/node_modules/preact-render-to-string/dist/index.module.js +0 -2
  220. data/node_modules/preact-render-to-string/dist/index.module.js.map +0 -1
  221. data/node_modules/preact-render-to-string/dist/jsx-entry.js +0 -2
  222. data/node_modules/preact-render-to-string/dist/jsx-entry.js.map +0 -1
  223. data/node_modules/preact-render-to-string/dist/jsx.d.ts +0 -13
  224. data/node_modules/preact-render-to-string/dist/jsx.js +0 -1
  225. data/node_modules/preact-render-to-string/dist/jsx.js.map +0 -1
  226. data/node_modules/preact-render-to-string/dist/jsx.mjs +0 -2
  227. data/node_modules/preact-render-to-string/dist/jsx.modern.js +0 -2
  228. data/node_modules/preact-render-to-string/dist/jsx.modern.js.map +0 -1
  229. data/node_modules/preact-render-to-string/dist/jsx.module.js +0 -2
  230. data/node_modules/preact-render-to-string/dist/jsx.module.js.map +0 -1
  231. data/node_modules/preact-render-to-string/dist/preact-render-to-string-tests.d.ts +0 -1
  232. data/node_modules/preact-render-to-string/jsx.js +0 -1
  233. data/node_modules/preact-render-to-string/package.json +0 -142
  234. data/node_modules/preact-render-to-string/src/index.d.ts +0 -16
  235. data/node_modules/preact-render-to-string/src/index.js +0 -462
  236. data/node_modules/preact-render-to-string/src/jsx.d.ts +0 -13
  237. data/node_modules/preact-render-to-string/src/jsx.js +0 -76
  238. data/node_modules/preact-render-to-string/src/polyfills.js +0 -8
  239. data/node_modules/preact-render-to-string/src/preact-render-to-string-tests.d.ts +0 -1
  240. data/node_modules/preact-render-to-string/src/util.js +0 -78
  241. data/node_modules/preact-render-to-string/typings.json +0 -5
  242. data/node_modules/pretty-format/.npmignore +0 -3
  243. data/node_modules/pretty-format/LICENSE.md +0 -15
  244. data/node_modules/pretty-format/README.md +0 -94
  245. data/node_modules/pretty-format/index.js +0 -343
  246. data/node_modules/pretty-format/package.json +0 -26
  247. data/node_modules/pretty-format/plugins/ReactElement.js +0 -74
  248. data/node_modules/pretty-format/plugins/ReactTestComponent.js +0 -58
  249. data/node_modules/pretty-format/printString.js +0 -7
  250. data/node_modules/wouter-preact/cjs/index.js +0 -180
  251. data/node_modules/wouter-preact/cjs/matcher.js +0 -72
  252. data/node_modules/wouter-preact/cjs/package.json +0 -1
  253. data/node_modules/wouter-preact/cjs/react-deps.js +0 -75
  254. data/node_modules/wouter-preact/cjs/static-location.js +0 -21
  255. data/node_modules/wouter-preact/cjs/use-location.js +0 -94
  256. data/node_modules/wouter-preact/index.d.ts +0 -110
  257. data/node_modules/wouter-preact/index.js +0 -178
  258. data/node_modules/wouter-preact/matcher.d.ts +0 -30
  259. data/node_modules/wouter-preact/matcher.js +0 -66
  260. data/node_modules/wouter-preact/package.json +0 -33
  261. data/node_modules/wouter-preact/react-deps.js +0 -15
  262. data/node_modules/wouter-preact/static-location.d.ts +0 -16
  263. data/node_modules/wouter-preact/static-location.js +0 -17
  264. data/node_modules/wouter-preact/use-location.d.ts +0 -43
  265. data/node_modules/wouter-preact/use-location.js +0 -86
  266. data/package.json +0 -8
@@ -1,2 +0,0 @@
1
- import{options as r,Fragment as _}from"preact";export{Fragment}from"preact";var o=0;function e(_,e,n,t,f){var l,s,u={};for(s in e)"ref"==s?l=e[s]:u[s]=e[s];var a={type:_,props:u,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--o,__source:f,__self:t};if("function"==typeof _&&(l=_.defaultProps))for(s in l)void 0===u[s]&&(u[s]=l[s]);return r.vnode&&r.vnode(a),a}export{e as jsx,e as jsxs,e as jsxDEV};
2
- //# sourceMappingURL=jsxRuntime.module.js.map
@@ -1,2 +0,0 @@
1
- import{options as r,Fragment as _}from"preact";export{Fragment}from"preact";var o=0;function e(_,e,n,t,f){var l,s,u={};for(s in e)"ref"==s?l=e[s]:u[s]=e[s];var a={type:_,props:u,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--o,__source:f,__self:t};if("function"==typeof _&&(l=_.defaultProps))for(s in l)void 0===u[s]&&(u[s]=l[s]);return r.vnode&&r.vnode(a),a}export{e as jsx,e as jsxs,e as jsxDEV};
2
- //# sourceMappingURL=jsxRuntime.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsxRuntime.module.js","sources":["../src/index.js"],"sourcesContent":["import { options, Fragment } from 'preact';\n\n/** @typedef {import('preact').VNode} VNode */\n\nlet vnodeId = 0;\n\n/**\n * @fileoverview\n * This file exports various methods that implement Babel's \"automatic\" JSX runtime API:\n * - jsx(type, props, key)\n * - jsxs(type, props, key)\n * - jsxDEV(type, props, key, __source, __self)\n *\n * The implementation of createVNode here is optimized for performance.\n * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3\n */\n\n/**\n * JSX.Element factory used by Babel's {runtime:\"automatic\"} JSX transform\n * @param {VNode['type']} type\n * @param {VNode['props']} props\n * @param {VNode['key']} [key]\n * @param {string} [__self]\n * @param {string} [__source]\n */\nfunction createVNode(type, props, key, __self, __source) {\n\t// We'll want to preserve `ref` in props to get rid of the need for\n\t// forwardRef components in the future, but that should happen via\n\t// a separate PR.\n\tlet normalizedProps = {},\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'ref') {\n\t\t\tref = props[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tconst vnode = {\n\t\ttype,\n\t\tprops: normalizedProps,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\t_hydrating: null,\n\t\tconstructor: undefined,\n\t\t_original: --vnodeId,\n\t\t__source,\n\t\t__self\n\t};\n\n\t// If a Component VNode, check for and apply defaultProps.\n\t// Note: `type` is often a String, and can be `undefined` in development.\n\tif (typeof type === 'function' && (ref = type.defaultProps)) {\n\t\tfor (i in ref)\n\t\t\tif (typeof normalizedProps[i] === 'undefined') {\n\t\t\t\tnormalizedProps[i] = ref[i];\n\t\t\t}\n\t}\n\n\tif (options.vnode) options.vnode(vnode);\n\treturn vnode;\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment\n};\n"],"names":["vnodeId","createVNode","type","props","key","__self","__source","ref","i","normalizedProps","vnode","undefined","constructor","defaultProps","options"],"mappings":"4EAIA,IAAIA,EAAU,EAqBd,SAASC,EAAYC,EAAMC,EAAOC,EAAKC,EAAQC,OAK7CC,EACAC,EAFGC,EAAkB,OAGjBD,KAAKL,EACA,OAALK,EACHD,EAAMJ,EAAMK,GAEZC,EAAgBD,GAAKL,EAAMK,OAIvBE,EAAQ,CACbR,KAAAA,EACAC,MAAOM,EACPL,IAAAA,EACAG,IAAAA,MACW,QACF,SACD,MACF,cACII,MACE,SACA,KACZC,iBAAaD,QACAX,EACbM,SAAAA,EACAD,OAAAA,MAKmB,mBAATH,IAAwBK,EAAML,EAAKW,kBACxCL,KAAKD,OACyB,IAAvBE,EAAgBD,KAC1BC,EAAgBD,GAAKD,EAAIC,WAIxBM,EAAQJ,OAAOI,EAAQJ,MAAMA,GAC1BA"}
@@ -1,2 +0,0 @@
1
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("preact")):"function"==typeof define&&define.amd?define(["exports","preact"],n):n(e.jsxRuntime={},e.preact)}(this,function(e,n){var o=0;function r(e,r,t,_,f){var i,u,c={};for(u in r)"ref"==u?i=r[u]:c[u]=r[u];var l={type:e,props:c,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--o,__source:f,__self:_};if("function"==typeof e&&(i=e.defaultProps))for(u in i)void 0===c[u]&&(c[u]=i[u]);return n.options.vnode&&n.options.vnode(l),l}e.Fragment=n.Fragment,e.jsx=r,e.jsxs=r,e.jsxDEV=r});
2
- //# sourceMappingURL=jsxRuntime.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsxRuntime.umd.js","sources":["../src/index.js"],"sourcesContent":["import { options, Fragment } from 'preact';\n\n/** @typedef {import('preact').VNode} VNode */\n\nlet vnodeId = 0;\n\n/**\n * @fileoverview\n * This file exports various methods that implement Babel's \"automatic\" JSX runtime API:\n * - jsx(type, props, key)\n * - jsxs(type, props, key)\n * - jsxDEV(type, props, key, __source, __self)\n *\n * The implementation of createVNode here is optimized for performance.\n * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3\n */\n\n/**\n * JSX.Element factory used by Babel's {runtime:\"automatic\"} JSX transform\n * @param {VNode['type']} type\n * @param {VNode['props']} props\n * @param {VNode['key']} [key]\n * @param {string} [__self]\n * @param {string} [__source]\n */\nfunction createVNode(type, props, key, __self, __source) {\n\t// We'll want to preserve `ref` in props to get rid of the need for\n\t// forwardRef components in the future, but that should happen via\n\t// a separate PR.\n\tlet normalizedProps = {},\n\t\tref,\n\t\ti;\n\tfor (i in props) {\n\t\tif (i == 'ref') {\n\t\t\tref = props[i];\n\t\t} else {\n\t\t\tnormalizedProps[i] = props[i];\n\t\t}\n\t}\n\n\tconst vnode = {\n\t\ttype,\n\t\tprops: normalizedProps,\n\t\tkey,\n\t\tref,\n\t\t_children: null,\n\t\t_parent: null,\n\t\t_depth: 0,\n\t\t_dom: null,\n\t\t_nextDom: undefined,\n\t\t_component: null,\n\t\t_hydrating: null,\n\t\tconstructor: undefined,\n\t\t_original: --vnodeId,\n\t\t__source,\n\t\t__self\n\t};\n\n\t// If a Component VNode, check for and apply defaultProps.\n\t// Note: `type` is often a String, and can be `undefined` in development.\n\tif (typeof type === 'function' && (ref = type.defaultProps)) {\n\t\tfor (i in ref)\n\t\t\tif (typeof normalizedProps[i] === 'undefined') {\n\t\t\t\tnormalizedProps[i] = ref[i];\n\t\t\t}\n\t}\n\n\tif (options.vnode) options.vnode(vnode);\n\treturn vnode;\n}\n\nexport {\n\tcreateVNode as jsx,\n\tcreateVNode as jsxs,\n\tcreateVNode as jsxDEV,\n\tFragment\n};\n"],"names":["vnodeId","createVNode","type","props","key","__self","__source","ref","i","normalizedProps","vnode","undefined","constructor","defaultProps","options"],"mappings":"sNAIA,IAAIA,EAAU,EAqBd,SAASC,EAAYC,EAAMC,EAAOC,EAAKC,EAAQC,OAK7CC,EACAC,EAFGC,EAAkB,OAGjBD,KAAKL,EACA,OAALK,EACHD,EAAMJ,EAAMK,GAEZC,EAAgBD,GAAKL,EAAMK,OAIvBE,EAAQ,CACbR,KAAAA,EACAC,MAAOM,EACPL,IAAAA,EACAG,IAAAA,MACW,QACF,SACD,MACF,cACII,MACE,SACA,KACZC,iBAAaD,QACAX,EACbM,SAAAA,EACAD,OAAAA,MAKmB,mBAATH,IAAwBK,EAAML,EAAKW,kBACxCL,KAAKD,OACyB,IAAvBE,EAAgBD,KAC1BC,EAAgBD,GAAKD,EAAIC,WAIxBM,UAAQJ,OAAOI,UAAQJ,MAAMA,GAC1BA"}
@@ -1,28 +0,0 @@
1
- {
2
- "name": "jsx-runtime",
3
- "amdName": "jsxRuntime",
4
- "version": "1.0.0",
5
- "private": true,
6
- "description": "Preact JSX runtime",
7
- "main": "dist/jsxRuntime.js",
8
- "module": "dist/jsxRuntime.module.js",
9
- "umd:main": "dist/jsxRuntime.umd.js",
10
- "source": "src/index.js",
11
- "types": "src/index.d.ts",
12
- "license": "MIT",
13
- "peerDependencies": {
14
- "preact": "^10.0.0"
15
- },
16
- "mangle": {
17
- "regex": "^_"
18
- },
19
- "exports": {
20
- ".": {
21
- "types": "./src/index.d.ts",
22
- "browser": "./dist/jsxRuntime.module.js",
23
- "umd": "./dist/jsxRuntime.umd.js",
24
- "import": "./dist/jsxRuntime.mjs",
25
- "require": "./dist/jsxRuntime.js"
26
- }
27
- }
28
- }
@@ -1,50 +0,0 @@
1
- export { Fragment } from '../../';
2
- import {
3
- ComponentType,
4
- ComponentChild,
5
- ComponentChildren,
6
- VNode,
7
- Attributes
8
- } from '../../';
9
- import { JSXInternal } from '../../src/jsx';
10
-
11
- export function jsx(
12
- type: string,
13
- props: JSXInternal.HTMLAttributes &
14
- JSXInternal.SVGAttributes &
15
- Record<string, any> & { children?: ComponentChild },
16
- key?: string
17
- ): VNode<any>;
18
- export function jsx<P>(
19
- type: ComponentType<P>,
20
- props: Attributes & P & { children?: ComponentChild },
21
- key?: string
22
- ): VNode<any>;
23
-
24
- export function jsxs(
25
- type: string,
26
- props: JSXInternal.HTMLAttributes &
27
- JSXInternal.SVGAttributes &
28
- Record<string, any> & { children?: ComponentChild[] },
29
- key?: string
30
- ): VNode<any>;
31
- export function jsxs<P>(
32
- type: ComponentType<P>,
33
- props: Attributes & P & { children?: ComponentChild[] },
34
- key?: string
35
- ): VNode<any>;
36
-
37
- export function jsxDEV(
38
- type: string,
39
- props: JSXInternal.HTMLAttributes &
40
- JSXInternal.SVGAttributes &
41
- Record<string, any> & { children?: ComponentChildren },
42
- key?: string
43
- ): VNode<any>;
44
- export function jsxDEV<P>(
45
- type: ComponentType<P>,
46
- props: Attributes & P & { children?: ComponentChildren },
47
- key?: string
48
- ): VNode<any>;
49
-
50
- export { JSXInternal as JSX };
@@ -1,77 +0,0 @@
1
- import { options, Fragment } from 'preact';
2
-
3
- /** @typedef {import('preact').VNode} VNode */
4
-
5
- let vnodeId = 0;
6
-
7
- /**
8
- * @fileoverview
9
- * This file exports various methods that implement Babel's "automatic" JSX runtime API:
10
- * - jsx(type, props, key)
11
- * - jsxs(type, props, key)
12
- * - jsxDEV(type, props, key, __source, __self)
13
- *
14
- * The implementation of createVNode here is optimized for performance.
15
- * Benchmarks: https://esbench.com/bench/5f6b54a0b4632100a7dcd2b3
16
- */
17
-
18
- /**
19
- * JSX.Element factory used by Babel's {runtime:"automatic"} JSX transform
20
- * @param {VNode['type']} type
21
- * @param {VNode['props']} props
22
- * @param {VNode['key']} [key]
23
- * @param {string} [__self]
24
- * @param {string} [__source]
25
- */
26
- function createVNode(type, props, key, __self, __source) {
27
- // We'll want to preserve `ref` in props to get rid of the need for
28
- // forwardRef components in the future, but that should happen via
29
- // a separate PR.
30
- let normalizedProps = {},
31
- ref,
32
- i;
33
- for (i in props) {
34
- if (i == 'ref') {
35
- ref = props[i];
36
- } else {
37
- normalizedProps[i] = props[i];
38
- }
39
- }
40
-
41
- const vnode = {
42
- type,
43
- props: normalizedProps,
44
- key,
45
- ref,
46
- _children: null,
47
- _parent: null,
48
- _depth: 0,
49
- _dom: null,
50
- _nextDom: undefined,
51
- _component: null,
52
- _hydrating: null,
53
- constructor: undefined,
54
- _original: --vnodeId,
55
- __source,
56
- __self
57
- };
58
-
59
- // If a Component VNode, check for and apply defaultProps.
60
- // Note: `type` is often a String, and can be `undefined` in development.
61
- if (typeof type === 'function' && (ref = type.defaultProps)) {
62
- for (i in ref)
63
- if (typeof normalizedProps[i] === 'undefined') {
64
- normalizedProps[i] = ref[i];
65
- }
66
- }
67
-
68
- if (options.vnode) options.vnode(vnode);
69
- return vnode;
70
- }
71
-
72
- export {
73
- createVNode as jsx,
74
- createVNode as jsxs,
75
- createVNode as jsxDEV,
76
- Fragment
77
- };
@@ -1,304 +0,0 @@
1
- {
2
- "name": "preact",
3
- "amdName": "preact",
4
- "version": "10.9.0",
5
- "private": false,
6
- "description": "Fast 3kb React-compatible Virtual DOM library.",
7
- "main": "dist/preact.js",
8
- "module": "dist/preact.module.js",
9
- "umd:main": "dist/preact.umd.js",
10
- "unpkg": "dist/preact.min.js",
11
- "source": "src/index.js",
12
- "exports": {
13
- ".": {
14
- "types": "./src/index.d.ts",
15
- "browser": "./dist/preact.module.js",
16
- "umd": "./dist/preact.umd.js",
17
- "import": "./dist/preact.mjs",
18
- "require": "./dist/preact.js"
19
- },
20
- "./compat": {
21
- "types": "./compat/src/index.d.ts",
22
- "browser": "./compat/dist/compat.module.js",
23
- "umd": "./compat/dist/compat.umd.js",
24
- "import": "./compat/dist/compat.mjs",
25
- "require": "./compat/dist/compat.js"
26
- },
27
- "./debug": {
28
- "browser": "./debug/dist/debug.module.js",
29
- "umd": "./debug/dist/debug.umd.js",
30
- "import": "./debug/dist/debug.mjs",
31
- "require": "./debug/dist/debug.js"
32
- },
33
- "./devtools": {
34
- "types": "./devtools/src/index.d.ts",
35
- "browser": "./devtools/dist/devtools.module.js",
36
- "umd": "./devtools/dist/devtools.umd.js",
37
- "import": "./devtools/dist/devtools.mjs",
38
- "require": "./devtools/dist/devtools.js"
39
- },
40
- "./hooks": {
41
- "types": "./hooks/src/index.d.ts",
42
- "browser": "./hooks/dist/hooks.module.js",
43
- "umd": "./hooks/dist/hooks.umd.js",
44
- "import": "./hooks/dist/hooks.mjs",
45
- "require": "./hooks/dist/hooks.js"
46
- },
47
- "./test-utils": {
48
- "types": "./test-utils/src/index.d.ts",
49
- "browser": "./test-utils/dist/testUtils.module.js",
50
- "umd": "./test-utils/dist/testUtils.umd.js",
51
- "import": "./test-utils/dist/testUtils.mjs",
52
- "require": "./test-utils/dist/testUtils.js"
53
- },
54
- "./jsx-runtime": {
55
- "types": "./jsx-runtime/src/index.d.ts",
56
- "browser": "./jsx-runtime/dist/jsxRuntime.module.js",
57
- "umd": "./jsx-runtime/dist/jsxRuntime.umd.js",
58
- "import": "./jsx-runtime/dist/jsxRuntime.mjs",
59
- "require": "./jsx-runtime/dist/jsxRuntime.js"
60
- },
61
- "./jsx-dev-runtime": {
62
- "browser": "./jsx-runtime/dist/jsxRuntime.module.js",
63
- "umd": "./jsx-runtime/dist/jsxRuntime.umd.js",
64
- "import": "./jsx-runtime/dist/jsxRuntime.mjs",
65
- "require": "./jsx-runtime/dist/jsxRuntime.js"
66
- },
67
- "./compat/client": {
68
- "import": "./compat/client.mjs",
69
- "require": "./compat/client.js"
70
- },
71
- "./compat/server": {
72
- "browser": "./compat/server.browser.js",
73
- "import": "./compat/server.mjs",
74
- "require": "./compat/server.js"
75
- },
76
- "./compat/jsx-runtime": {
77
- "import": "./compat/jsx-runtime.mjs",
78
- "require": "./compat/jsx-runtime.js"
79
- },
80
- "./compat/jsx-dev-runtime": {
81
- "import": "./compat/jsx-dev-runtime.mjs",
82
- "require": "./compat/jsx-dev-runtime.js"
83
- },
84
- "./compat/scheduler": {
85
- "import": "./compat/scheduler.mjs",
86
- "require": "./compat/scheduler.js"
87
- },
88
- "./package.json": "./package.json",
89
- "./compat/package.json": "./compat/package.json",
90
- "./debug/package.json": "./debug/package.json",
91
- "./devtools/package.json": "./devtools/package.json",
92
- "./hooks/package.json": "./hooks/package.json",
93
- "./test-utils/package.json": "./test-utils/package.json",
94
- "./jsx-runtime/package.json": "./jsx-runtime/package.json"
95
- },
96
- "license": "MIT",
97
- "funding": {
98
- "type": "opencollective",
99
- "url": "https://opencollective.com/preact"
100
- },
101
- "types": "src/index.d.ts",
102
- "scripts": {
103
- "prepare": "run-s build && check-export-map",
104
- "build": "npm-run-all --parallel build:*",
105
- "build:core": "microbundle build --raw",
106
- "build:core-min": "microbundle build --raw -f iife src/cjs.js -o dist/preact.min.js",
107
- "build:debug": "microbundle build --raw --cwd debug",
108
- "build:devtools": "microbundle build --raw --cwd devtools",
109
- "build:hooks": "microbundle build --raw --cwd hooks",
110
- "build:test-utils": "microbundle build --raw --cwd test-utils",
111
- "build:compat": "microbundle build src/index.js src/scheduler.js --raw --cwd compat --globals 'preact/hooks=preactHooks'",
112
- "build:jsx": "microbundle build --raw --cwd jsx-runtime",
113
- "postbuild": "node ./config/node-13-exports.js && node ./config/compat-entries.js",
114
- "dev": "microbundle watch --raw --format cjs",
115
- "dev:hooks": "microbundle watch --raw --format cjs --cwd hooks",
116
- "dev:compat": "microbundle watch --raw --format cjs --cwd compat --globals 'preact/hooks=preactHooks'",
117
- "test": "npm-run-all build lint test:unit",
118
- "test:unit": "run-p test:mocha test:karma:minify test:ts",
119
- "test:ts": "run-p test:ts:*",
120
- "test:ts:core": "tsc -p test/ts/ && mocha --require \"@babel/register\" test/ts/**/*-test.js",
121
- "test:ts:compat": "tsc -p compat/test/ts/",
122
- "test:mocha": "mocha --recursive --require \"@babel/register\" test/shared test/node",
123
- "test:mocha:watch": "npm run test:mocha -- --watch",
124
- "test:karma": "cross-env COVERAGE=true BABEL_NO_MODULES=true karma start karma.conf.js --single-run",
125
- "test:karma:minify": "cross-env COVERAGE=true MINIFY=true BABEL_NO_MODULES=true karma start karma.conf.js --single-run",
126
- "test:karma:watch": "cross-env BABEL_NO_MODULES=true karma start karma.conf.js --no-single-run",
127
- "test:karma:hooks": "cross-env COVERAGE=false BABEL_NO_MODULES=true karma start karma.conf.js --grep=hooks/test/browser/**.js --no-single-run",
128
- "test:karma:test-utils": "cross-env PERFORMANCE=false COVERAGE=false BABEL_NO_MODULES=true karma start karma.conf.js --grep=test-utils/test/shared/**.js --no-single-run",
129
- "test:karma:bench": "cross-env PERFORMANCE=true COVERAGE=false BABEL_NO_MODULES=true karma start karma.conf.js --grep=test/benchmarks/**.js --single-run",
130
- "benchmark": "npm run test:karma:bench -- no-single-run",
131
- "lint": "eslint src test debug compat hooks test-utils"
132
- },
133
- "eslintConfig": {
134
- "extends": [
135
- "developit",
136
- "prettier"
137
- ],
138
- "settings": {
139
- "react": {
140
- "pragma": "createElement"
141
- }
142
- },
143
- "rules": {
144
- "camelcase": [
145
- 1,
146
- {
147
- "allow": [
148
- "__test__*",
149
- "unstable_*",
150
- "UNSAFE_*"
151
- ]
152
- }
153
- ],
154
- "no-unused-vars": [
155
- 2,
156
- {
157
- "args": "none",
158
- "varsIgnorePattern": "^h|React$"
159
- }
160
- ],
161
- "prefer-rest-params": 0,
162
- "prefer-spread": 0,
163
- "no-cond-assign": 0,
164
- "react/jsx-no-bind": 0,
165
- "react/no-danger": "off",
166
- "react/prefer-stateless-function": 0,
167
- "react/sort-comp": 0,
168
- "jest/valid-expect": 0,
169
- "jest/no-disabled-tests": 0,
170
- "jest/no-test-callback": 0,
171
- "jest/expect-expect": 0,
172
- "jest/no-standalone-expect": 0,
173
- "jest/no-export": 0,
174
- "react/no-find-dom-node": 0
175
- }
176
- },
177
- "eslintIgnore": [
178
- "test/fixtures",
179
- "test/ts/",
180
- "*.ts",
181
- "dist"
182
- ],
183
- "prettier": {
184
- "singleQuote": true,
185
- "trailingComma": "none",
186
- "useTabs": true,
187
- "tabWidth": 2
188
- },
189
- "lint-staged": {
190
- "**/*.{js,jsx,ts,tsx,yml}": [
191
- "prettier --write"
192
- ]
193
- },
194
- "husky": {
195
- "hooks": {
196
- "pre-commit": "lint-staged"
197
- }
198
- },
199
- "files": [
200
- "src",
201
- "dist",
202
- "compat/dist",
203
- "compat/src",
204
- "compat/client.js",
205
- "compat/client.mjs",
206
- "compat/server.browser.js",
207
- "compat/server.js",
208
- "compat/server.mjs",
209
- "compat/scheduler.js",
210
- "compat/scheduler.mjs",
211
- "compat/test-utils.js",
212
- "compat/jsx-runtime.js",
213
- "compat/jsx-runtime.mjs",
214
- "compat/jsx-dev-runtime.js",
215
- "compat/jsx-dev-runtime.mjs",
216
- "compat/package.json",
217
- "debug/dist",
218
- "debug/src",
219
- "debug/package.json",
220
- "devtools/dist",
221
- "devtools/src",
222
- "devtools/package.json",
223
- "hooks/dist",
224
- "hooks/src",
225
- "hooks/package.json",
226
- "jsx-runtime/dist",
227
- "jsx-runtime/src",
228
- "jsx-runtime/package.json",
229
- "test-utils/src",
230
- "test-utils/package.json",
231
- "test-utils/dist"
232
- ],
233
- "keywords": [
234
- "preact",
235
- "react",
236
- "ui",
237
- "user interface",
238
- "virtual dom",
239
- "vdom",
240
- "components",
241
- "dom diff",
242
- "front-end",
243
- "framework"
244
- ],
245
- "authors": [
246
- "The Preact Authors (https://github.com/preactjs/preact/contributors)"
247
- ],
248
- "repository": "preactjs/preact",
249
- "bugs": "https://github.com/preactjs/preact/issues",
250
- "homepage": "https://preactjs.com",
251
- "devDependencies": {
252
- "@actions/github": "^5.0.0",
253
- "@actions/glob": "^0.2.0",
254
- "@babel/core": "^7.7.0",
255
- "@babel/plugin-proposal-object-rest-spread": "^7.6.2",
256
- "@babel/plugin-transform-react-jsx": "^7.7.0",
257
- "@babel/plugin-transform-react-jsx-source": "^7.7.4",
258
- "@babel/preset-env": "^7.7.1",
259
- "@babel/register": "^7.7.0",
260
- "@types/chai": "^4.1.2",
261
- "@types/mocha": "^5.0.0",
262
- "@types/node": "^14.14.10",
263
- "babel-plugin-istanbul": "^6.0.0",
264
- "babel-plugin-transform-async-to-promises": "^0.8.15",
265
- "babel-plugin-transform-rename-properties": "0.1.0",
266
- "benchmark": "^2.1.4",
267
- "chai": "^4.1.2",
268
- "check-export-map": "^1.3.0",
269
- "coveralls": "^3.0.0",
270
- "cross-env": "^7.0.2",
271
- "diff": "^5.0.0",
272
- "errorstacks": "^2.4.0",
273
- "esbuild": "^0.14.25",
274
- "eslint": "5.15.1",
275
- "eslint-config-developit": "^1.1.1",
276
- "eslint-config-prettier": "^6.5.0",
277
- "eslint-plugin-react": "7.12.4",
278
- "husky": "^4.3.0",
279
- "karma": "^6.3.16",
280
- "karma-chai-sinon": "^0.1.5",
281
- "karma-chrome-launcher": "^3.1.0",
282
- "karma-coverage": "^2.1.0",
283
- "karma-esbuild": "^2.2.4",
284
- "karma-mocha": "^2.0.1",
285
- "karma-mocha-reporter": "^2.2.5",
286
- "karma-sauce-launcher": "^4.3.4",
287
- "karma-sinon": "^1.0.5",
288
- "karma-sourcemap-loader": "^0.3.7",
289
- "kolorist": "^1.2.10",
290
- "lint-staged": "^10.5.2",
291
- "lodash": "^4.17.20",
292
- "microbundle": "^0.11.0",
293
- "mocha": "^8.2.1",
294
- "npm-merge-driver-install": "^1.1.1",
295
- "npm-run-all": "^4.0.0",
296
- "prettier": "^1.18.2",
297
- "prop-types": "^15.7.2",
298
- "sade": "^1.7.4",
299
- "sinon": "^9.2.3",
300
- "sinon-chai": "^3.5.0",
301
- "typescript": "4.4.2",
302
- "undici": "^4.12.0"
303
- }
304
- }
@@ -1,3 +0,0 @@
1
- import * as preact from './index.js';
2
- if (typeof module < 'u') module.exports = preact;
3
- else self.preact = preact;
@@ -1,34 +0,0 @@
1
- import { assign, slice } from './util';
2
- import { createVNode } from './create-element';
3
-
4
- /**
5
- * Clones the given VNode, optionally adding attributes/props and replacing its children.
6
- * @param {import('./internal').VNode} vnode The virtual DOM element to clone
7
- * @param {object} props Attributes/props to add when cloning
8
- * @param {Array<import('./internal').ComponentChildren>} rest Any additional arguments will be used as replacement children.
9
- * @returns {import('./internal').VNode}
10
- */
11
- export function cloneElement(vnode, props, children) {
12
- let normalizedProps = assign({}, vnode.props),
13
- key,
14
- ref,
15
- i;
16
- for (i in props) {
17
- if (i == 'key') key = props[i];
18
- else if (i == 'ref') ref = props[i];
19
- else normalizedProps[i] = props[i];
20
- }
21
-
22
- if (arguments.length > 2) {
23
- normalizedProps.children =
24
- arguments.length > 3 ? slice.call(arguments, 2) : children;
25
- }
26
-
27
- return createVNode(
28
- vnode.type,
29
- normalizedProps,
30
- key || vnode.key,
31
- ref || vnode.ref,
32
- null
33
- );
34
- }