@tempots/dom 5.0.0 → 5.0.1

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 (191) hide show
  1. package/dist/clean.d.ts +2 -0
  2. package/dist/clean.js +1 -0
  3. package/dist/components/Attribute.d.ts +15 -0
  4. package/dist/components/Attribute.js +16 -0
  5. package/dist/components/BooleanAttribute.d.ts +15 -0
  6. package/dist/components/BooleanAttribute.js +16 -0
  7. package/dist/components/ClassName.d.ts +13 -0
  8. package/dist/components/ClassName.js +14 -0
  9. package/dist/components/El.d.ts +15 -0
  10. package/dist/components/El.js +21 -0
  11. package/dist/components/FadeIn.d.ts +18 -0
  12. package/dist/components/FadeIn.js +52 -0
  13. package/dist/components/FadeOut.d.ts +16 -0
  14. package/dist/components/FadeOut.js +39 -0
  15. package/dist/components/For.d.ts +7 -0
  16. package/dist/components/For.js +15 -0
  17. package/dist/components/Fragment.d.ts +12 -0
  18. package/dist/components/Fragment.js +16 -0
  19. package/dist/components/HiddenWhenEmpty.d.ts +7 -0
  20. package/dist/components/HiddenWhenEmpty.js +12 -0
  21. package/dist/components/If.d.ts +14 -0
  22. package/dist/components/If.js +19 -0
  23. package/dist/components/InnerHTML.d.ts +13 -0
  24. package/dist/components/InnerHTML.js +23 -0
  25. package/dist/components/Lifecycle.d.ts +14 -0
  26. package/dist/components/Lifecycle.js +18 -0
  27. package/dist/components/Match.d.ts +33 -0
  28. package/dist/components/Match.js +44 -0
  29. package/dist/components/NotEmpty.d.ts +10 -0
  30. package/dist/components/NotEmpty.js +11 -0
  31. package/dist/components/On.d.ts +15 -0
  32. package/dist/components/On.js +14 -0
  33. package/dist/components/OnRemove.d.ts +11 -0
  34. package/dist/components/OnRemove.js +14 -0
  35. package/dist/components/OneOf.d.ts +20 -0
  36. package/dist/components/OneOf.js +45 -0
  37. package/dist/components/Portal.d.ts +15 -0
  38. package/dist/components/Portal.js +20 -0
  39. package/dist/components/Property.d.ts +15 -0
  40. package/dist/components/Property.js +16 -0
  41. package/dist/components/Provider.d.ts +28 -0
  42. package/dist/components/Provider.js +44 -0
  43. package/dist/components/Repeat.d.ts +15 -0
  44. package/dist/components/Repeat.js +33 -0
  45. package/dist/components/Shadow.d.ts +0 -0
  46. package/dist/components/Shadow.js +1 -0
  47. package/dist/components/Show.d.ts +20 -0
  48. package/dist/components/Show.js +22 -0
  49. package/dist/components/Text.d.ts +15 -0
  50. package/dist/components/Text.js +33 -0
  51. package/dist/components/TextContent.d.ts +13 -0
  52. package/dist/components/TextContent.js +23 -0
  53. package/dist/components/Tween.d.ts +75 -0
  54. package/dist/components/Tween.js +242 -0
  55. package/dist/components/animatable.d.ts +53 -0
  56. package/dist/components/animatable.js +156 -0
  57. package/dist/dom-context.d.ts +38 -0
  58. package/dist/dom-context.js +260 -0
  59. package/dist/helpers/handle-anchor-click.d.ts +4 -0
  60. package/dist/helpers/handle-anchor-click.js +43 -0
  61. package/dist/helpers/handle-text-input.d.ts +1 -0
  62. package/dist/helpers/handle-text-input.js +4 -0
  63. package/dist/helpers/is-empty-element.d.ts +2 -0
  64. package/dist/helpers/is-empty-element.js +8 -0
  65. package/dist/index.d.ts +36 -0
  66. package/dist/jsx-dev-runtime.d.ts +1 -0
  67. package/dist/jsx-dev-runtime.js +1 -0
  68. package/dist/jsx-runtime.d.ts +9 -0
  69. package/dist/jsx-runtime.js +157 -0
  70. package/dist/jsx.d.ts +806 -0
  71. package/dist/jsx.js +1 -0
  72. package/dist/prop.d.ts +43 -0
  73. package/dist/prop.js +174 -0
  74. package/dist/render.d.ts +3 -0
  75. package/dist/render.js +7 -0
  76. package/dist/renderable.d.ts +5 -0
  77. package/dist/renderable.js +1 -0
  78. package/dist/types/clean.d.ts +2 -0
  79. package/dist/types/clean.js +1 -0
  80. package/dist/types/idom-context.d.ts +27 -0
  81. package/dist/types/idom-context.js +3 -0
  82. package/dist/types/renderable.d.ts +5 -0
  83. package/dist/types/renderable.js +1 -0
  84. package/package.json +5 -1
  85. package/.eslintignore +0 -10
  86. package/.eslintrc.cjs +0 -28
  87. package/coverage/clover.xml +0 -39
  88. package/coverage/coverage-final.json +0 -2
  89. package/coverage/lcov-report/OneOf.ts.html +0 -256
  90. package/coverage/lcov-report/base.css +0 -224
  91. package/coverage/lcov-report/block-navigation.js +0 -87
  92. package/coverage/lcov-report/dom-context.ts.html +0 -928
  93. package/coverage/lcov-report/favicon.png +0 -0
  94. package/coverage/lcov-report/index.html +0 -116
  95. package/coverage/lcov-report/prettify.css +0 -1
  96. package/coverage/lcov-report/prettify.js +0 -2
  97. package/coverage/lcov-report/prop.ts.html +0 -691
  98. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  99. package/coverage/lcov-report/sorter.js +0 -196
  100. package/coverage/lcov-report/src/components/Attribute.ts.html +0 -154
  101. package/coverage/lcov-report/src/components/BooleanAttribute.ts.html +0 -154
  102. package/coverage/lcov-report/src/components/ClassName.ts.html +0 -151
  103. package/coverage/lcov-report/src/components/El.ts.html +0 -166
  104. package/coverage/lcov-report/src/components/FadeIn.ts.html +0 -262
  105. package/coverage/lcov-report/src/components/FadeOut.ts.html +0 -226
  106. package/coverage/lcov-report/src/components/For.ts.html +0 -151
  107. package/coverage/lcov-report/src/components/Fragment.ts.html +0 -142
  108. package/coverage/lcov-report/src/components/HiddenWhenEmpty.ts.html +0 -133
  109. package/coverage/lcov-report/src/components/If.ts.html +0 -217
  110. package/coverage/lcov-report/src/components/InnerHTML.ts.html +0 -178
  111. package/coverage/lcov-report/src/components/Lifecycle.ts.html +0 -157
  112. package/coverage/lcov-report/src/components/Match.ts.html +0 -286
  113. package/coverage/lcov-report/src/components/NotEmpty.tsx.html +0 -184
  114. package/coverage/lcov-report/src/components/On.ts.html +0 -151
  115. package/coverage/lcov-report/src/components/OnRemove.ts.html +0 -145
  116. package/coverage/lcov-report/src/components/OneOf.ts.html +0 -256
  117. package/coverage/lcov-report/src/components/Portal.ts.html +0 -175
  118. package/coverage/lcov-report/src/components/Property.ts.html +0 -154
  119. package/coverage/lcov-report/src/components/Provider.ts.html +0 -244
  120. package/coverage/lcov-report/src/components/Repeat.ts.html +0 -223
  121. package/coverage/lcov-report/src/components/Show.tsx.html +0 -190
  122. package/coverage/lcov-report/src/components/Text.ts.html +0 -229
  123. package/coverage/lcov-report/src/components/TextContent.ts.html +0 -178
  124. package/coverage/lcov-report/src/components/Tween.tsx.html +0 -943
  125. package/coverage/lcov-report/src/components/animatable.ts.html +0 -619
  126. package/coverage/lcov-report/src/components/index.html +0 -476
  127. package/coverage/lcov-report/src/dom-context.ts.html +0 -928
  128. package/coverage/lcov-report/src/helpers/handle-anchor-click.ts.html +0 -277
  129. package/coverage/lcov-report/src/helpers/handle-text-input.ts.html +0 -100
  130. package/coverage/lcov-report/src/helpers/index.html +0 -146
  131. package/coverage/lcov-report/src/helpers/is-empty-element.ts.html +0 -112
  132. package/coverage/lcov-report/src/index.html +0 -176
  133. package/coverage/lcov-report/src/index.ts.html +0 -412
  134. package/coverage/lcov-report/src/jsx-runtime.ts.html +0 -601
  135. package/coverage/lcov-report/src/prop.ts.html +0 -691
  136. package/coverage/lcov-report/src/render.ts.html +0 -112
  137. package/coverage/lcov-report/src/types/idom-context.ts.html +0 -184
  138. package/coverage/lcov-report/src/types/index.html +0 -116
  139. package/coverage/lcov-report/test/common.ts.html +0 -112
  140. package/coverage/lcov-report/test/index.html +0 -116
  141. package/coverage/lcov.info +0 -57
  142. package/jest.config.js +0 -5
  143. package/src/clean.ts +0 -2
  144. package/src/components/Attribute.ts +0 -23
  145. package/src/components/BooleanAttribute.ts +0 -23
  146. package/src/components/ClassName.ts +0 -22
  147. package/src/components/El.ts +0 -27
  148. package/src/components/FadeIn.ts +0 -59
  149. package/src/components/FadeOut.ts +0 -47
  150. package/src/components/For.ts +0 -22
  151. package/src/components/Fragment.ts +0 -19
  152. package/src/components/HiddenWhenEmpty.ts +0 -16
  153. package/src/components/If.ts +0 -44
  154. package/src/components/InnerHTML.ts +0 -31
  155. package/src/components/Lifecycle.ts +0 -24
  156. package/src/components/Match.ts +0 -67
  157. package/src/components/NotEmpty.tsx +0 -33
  158. package/src/components/On.ts +0 -22
  159. package/src/components/OnRemove.ts +0 -20
  160. package/src/components/OneOf.ts +0 -57
  161. package/src/components/Portal.ts +0 -30
  162. package/src/components/Property.ts +0 -23
  163. package/src/components/Provider.ts +0 -53
  164. package/src/components/Repeat.ts +0 -46
  165. package/src/components/Show.tsx +0 -35
  166. package/src/components/Text.ts +0 -48
  167. package/src/components/TextContent.ts +0 -31
  168. package/src/components/animatable.ts +0 -178
  169. package/src/dom-context.ts +0 -281
  170. package/src/helpers/handle-anchor-click.ts +0 -64
  171. package/src/helpers/handle-text-input.ts +0 -5
  172. package/src/helpers/is-empty-element.ts +0 -9
  173. package/src/index.ts +0 -109
  174. package/src/jsx-dev-runtime.ts +0 -8
  175. package/src/jsx-runtime.ts +0 -172
  176. package/src/jsx.ts +0 -1046
  177. package/src/prop.ts +0 -202
  178. package/src/render.ts +0 -9
  179. package/src/renderable.ts +0 -6
  180. package/test/common.ts +0 -9
  181. package/test/component.spec.tsx +0 -27
  182. package/test/domcontext.spec.ts +0 -36
  183. package/test/fadein.spec.tsx +0 -36
  184. package/test/fadeout.spec.tsx +0 -41
  185. package/test/if.spec.tsx +0 -30
  186. package/test/innerhtml.spec.tsx +0 -45
  187. package/test/prop.spec.ts +0 -10
  188. package/test/render.spec.tsx +0 -19
  189. package/test/textcontent.spec.tsx +0 -45
  190. package/test/when.spec.tsx +0 -30
  191. package/tsconfig.json +0 -21
@@ -1,64 +0,0 @@
1
- function shouldNotApplyCallback(
2
- e: MouseEvent,
3
- checkExtension: boolean,
4
- checkExternalUrl: boolean
5
- ): boolean {
6
- let target = e.target as HTMLElement | null
7
- while ((target != null) && !(target instanceof HTMLAnchorElement)) {
8
- target = target.parentElement
9
- }
10
- if (target == null) return true
11
-
12
- const anchor = target
13
-
14
- // Check for modifier keys and non-left-button, which indicate the user wants to control
15
- // navigation
16
- if (e.button !== 0 || e.ctrlKey || e.metaKey) {
17
- return true
18
- }
19
-
20
- // If there is a target and it is not `_self` then we take this
21
- // as a signal that it doesn't want to be intercepted.
22
- if (anchor.target !== '_self') {
23
- return true
24
- }
25
-
26
- if (anchor.getAttribute('download') != null) {
27
- return true // let the download happen
28
- }
29
-
30
- if (checkExternalUrl) {
31
- const { pathname, search, hash } = anchor
32
- const relativeUrl = pathname + search + hash
33
-
34
- // don't navigate if external link or has extension
35
- if (
36
- anchor.getAttribute('href') !== relativeUrl ||
37
- (checkExtension && !/\/[^/.]*$/.test(pathname))
38
- ) {
39
- return true
40
- }
41
- }
42
-
43
- return false
44
- }
45
-
46
- export const handleAnchorClick =
47
- (
48
- callback: () => boolean,
49
- options: { checkExtension?: boolean, checkExternalUrl?: boolean } = {
50
- checkExtension: true,
51
- checkExternalUrl: true
52
- }
53
- ) =>
54
- (e: MouseEvent) => {
55
- const { checkExtension, checkExternalUrl } = options
56
- if (
57
- shouldNotApplyCallback(
58
- e,
59
- checkExtension === true,
60
- checkExternalUrl === true
61
- )
62
- ) { return }
63
- if (callback()) e.preventDefault()
64
- }
@@ -1,5 +0,0 @@
1
- export const handleTextInput =
2
- (f: (input: string) => void) => (e: Event) => {
3
- const input = e.target as HTMLInputElement | null
4
- f(input?.value ?? '')
5
- }
@@ -1,9 +0,0 @@
1
- import { type JSX } from '../jsx-runtime'
2
-
3
- export function isEmptyElement(element: JSX.DOMNode): boolean {
4
- if (Array.isArray(element)) {
5
- if (element.length === 0) return true
6
- return element.every(isEmptyElement)
7
- }
8
- return element == null || element === ''
9
- }
package/src/index.ts DELETED
@@ -1,109 +0,0 @@
1
- import { type Clear, type Clean } from './clean'
2
- import { makeProviderMark, DOMContext, type ProviderMark } from './dom-context'
3
- import { Prop, Signal } from './prop'
4
- import { render } from './render'
5
- import { type Renderable } from './renderable'
6
- import { isEmptyElement } from './helpers/is-empty-element'
7
- import { handleTextInput } from './helpers/handle-text-input'
8
- import { handleAnchorClick } from './helpers/handle-anchor-click'
9
- import { Animatable, applyInterpolatedAnimatableProp, applyInterpolatedAnimatable, applyAnimatableProp, applyAnimatable, getComputedAnimatableProp, getComputedAnimatable } from './components/animatable'
10
-
11
- import { AttributeImpl, Attribute, type AttributeProps } from './components/Attribute'
12
- import { BooleanAttributeImpl, BooleanAttribute, type BooleanAttributeProps } from './components/BooleanAttribute'
13
- import { ClassNameImpl, ClassName, type ClassNameProps } from './components/ClassName'
14
- import { ConsumerImpl, Consumer, type ConsumerProps, ProviderImpl, Provider, type ProviderProps } from './components/Provider'
15
- import { ElImpl, El, type ElProps } from './components/El'
16
- import { FadeIn, FadeInImpl, FadeInProps } from './components/FadeIn'
17
- import { FadeOut, FadeOutImpl, FadeOutProps } from './components/FadeOut'
18
- import { For, type ForProps } from './components/For'
19
- import { FragmentImpl, Fragment } from './components/Fragment'
20
- import { HiddenWhenEmptyImpl, HiddenWhenEmpty } from './components/HiddenWhenEmpty'
21
- import { If, type IfProps, Unless, When, type WhenProps } from './components/If'
22
- import { InnerHTMLImpl, InnerHTML, type InnerHTMLProps } from './components/InnerHTML'
23
- import { Lifecycle, LifecycleImpl, type LifecycleProps } from './components/Lifecycle'
24
- import { MatchImpl, Match, type MatchProps } from './components/Match'
25
- import { NotEmpty, type NotEmptyProps } from './components/NotEmpty'
26
- import { OnImpl, On, type OnProps } from './components/On'
27
- import { OnRemoveImpl, OnRemove, type OnRemoveProps } from './components/OnRemove'
28
- import { OneOfImpl, OneOf, type OneOfProps } from './components/OneOf'
29
- import { PortalImpl, Portal, type PortalProps } from './components/Portal'
30
- import { PropertyImpl, Property, type PropertyProps } from './components/Property'
31
- import { RepeatImpl, Repeat, type RepeatProps } from './components/Repeat'
32
- import { ShowImpl, Show, type ShowProps } from './components/Show'
33
- import { TextImpl, Text, type TextProps } from './components/Text'
34
- import { TextContentImpl, TextContent, type TextContentProps } from './components/TextContent'
35
-
36
- import type { JSX } from './jsx-runtime'
37
-
38
- export {
39
- applyInterpolatedAnimatableProp, applyInterpolatedAnimatable, applyAnimatableProp, applyAnimatable, getComputedAnimatableProp, getComputedAnimatable,
40
-
41
- AttributeImpl, Attribute,
42
- BooleanAttributeImpl, BooleanAttribute,
43
- ClassNameImpl, ClassName,
44
- ConsumerImpl, Consumer,
45
- DOMContext,
46
- ElImpl, El,
47
- FadeIn, FadeInImpl,
48
- FadeOut, FadeOutImpl,
49
- For,
50
- FragmentImpl, Fragment,
51
- handleTextInput,
52
- handleAnchorClick,
53
- HiddenWhenEmptyImpl, HiddenWhenEmpty,
54
- If,
55
- InnerHTMLImpl, InnerHTML,
56
- isEmptyElement,
57
- Lifecycle, LifecycleImpl,
58
- makeProviderMark,
59
- MatchImpl, Match,
60
- NotEmpty,
61
- OnImpl, On,
62
- OnRemoveImpl, OnRemove,
63
- OneOfImpl, OneOf,
64
- PortalImpl, Portal,
65
- Prop,
66
- PropertyImpl, Property,
67
- ProviderImpl, Provider,
68
- render,
69
- RepeatImpl, Repeat,
70
- ShowImpl, Show,
71
- Signal,
72
- TextImpl, Text,
73
- TextContentImpl, TextContent,
74
- Unless,
75
- When
76
- }
77
-
78
- export type {
79
- AttributeProps,
80
- BooleanAttributeProps,
81
- ClassNameProps,
82
- Clean,
83
- Clear,
84
- ConsumerProps,
85
- ElProps,
86
- FadeInProps,
87
- FadeOutProps,
88
- ForProps,
89
- InnerHTMLProps,
90
- IfProps,
91
- JSX,
92
- LifecycleProps,
93
- MatchProps,
94
- NotEmptyProps,
95
- OnProps,
96
- OnRemoveProps,
97
- OneOfProps,
98
- PortalProps,
99
- PropertyProps,
100
- ProviderMark,
101
- ProviderProps,
102
- Renderable,
103
- RepeatProps,
104
- ShowProps,
105
- TextProps,
106
- TextContentProps,
107
- Animatable,
108
- WhenProps
109
- }
@@ -1,8 +0,0 @@
1
- export {
2
- Fragment,
3
- jsx,
4
- jsxs,
5
- jsxDEV,
6
- makeRenderable,
7
- makeRenderables
8
- } from './jsx-runtime'
@@ -1,172 +0,0 @@
1
- import { type JSX } from './jsx'
2
- import { type Renderable } from './renderable'
3
- import { ElImpl } from './components/El'
4
- import { AttributeImpl } from './components/Attribute'
5
- import { BooleanAttributeImpl } from './components/BooleanAttribute'
6
- import { PropertyImpl } from './components/Property'
7
- import { ClassNameImpl } from './components/ClassName'
8
- import { Prop, Signal } from './prop'
9
- import { TextImpl } from './components/Text'
10
- import { OnImpl } from './components/On'
11
- import { FragmentImpl } from './components/Fragment'
12
-
13
- const domBooleanAttributes = new Set([
14
- 'allowfullscreen',
15
- 'allowpaymentrequest',
16
- 'async',
17
- 'autofocus',
18
- 'autoplay',
19
- 'capture',
20
- 'controls',
21
- 'default',
22
- 'defer',
23
- 'disabled',
24
- 'disablepictureinpicture',
25
- 'disableremoteplayback',
26
- 'download',
27
- 'draggable',
28
- 'formnovalidate',
29
- 'hidden',
30
- 'ismap',
31
- 'itemscope',
32
- 'loop',
33
- 'nomodule',
34
- 'novalidate',
35
- 'open',
36
- 'playsinline',
37
- 'readonly',
38
- 'required',
39
- 'reversed',
40
- 'scoped',
41
- 'seamless',
42
- 'spellcheck',
43
- 'truespeed'
44
- ])
45
-
46
- const domProperties = new Set([
47
- 'checked',
48
- 'checked',
49
- 'classList',
50
- 'className',
51
- 'contentEditable',
52
- 'dataset',
53
- 'innerHTML',
54
- 'multiple',
55
- 'muted',
56
- 'scrollLeft',
57
- 'scrollTop',
58
- 'selected',
59
- 'style',
60
- 'tabIndex',
61
- 'textContent',
62
- 'value'
63
- ])
64
-
65
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
66
- function isPrimitive(value: any): value is string | number | boolean | Date | bigint {
67
- return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' || typeof value === 'bigint' || value instanceof Date
68
- }
69
-
70
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
71
- export function makeRenderables(value: any): Renderable[] {
72
- if (value == null) {
73
- return []
74
- }
75
- if (Array.isArray(value)) {
76
- return value.flatMap(makeRenderables)
77
- }
78
- if (typeof value === 'string') {
79
- return [new TextImpl(new Prop(value))]
80
- }
81
- if (Signal.isSignal(value)) {
82
- return [new TextImpl(value as Prop<string>)]
83
- }
84
- if (typeof value === 'object' && 'appendTo' in value) {
85
- return [value]
86
- }
87
- if (isPrimitive(value)) {
88
- return [new TextImpl(new Prop(value).map(String))]
89
- }
90
- throw new Error(`Unkwown renderable: ${String(value)}`)
91
- }
92
-
93
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
94
- export function makeRenderable(value: any): Renderable {
95
- const renderables = makeRenderables(value)
96
- if (renderables.length === 0) {
97
- return new FragmentImpl([])
98
- }
99
- if (renderables.length === 1) {
100
- return renderables[0]
101
- }
102
- return new FragmentImpl(renderables)
103
- }
104
-
105
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
106
- function isNamedConstructor(obj: any): boolean {
107
- return obj.prototype?.constructor?.name != null
108
- }
109
-
110
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
111
- function makeFragment({ children }: { children: any[] }): Renderable {
112
- if (Array.isArray(children)) {
113
- return new FragmentImpl(children.flatMap(makeRenderables))
114
- } else {
115
- return makeRenderable(children)
116
- }
117
- }
118
-
119
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
120
- function makeElement(Name: any, ...args: any[]): Renderable {
121
- if (typeof Name === 'function') {
122
- if (isNamedConstructor(Name)) {
123
- const el = new Name(...args)
124
- return el
125
- } else {
126
- const el = Name(...args)
127
- return el
128
- }
129
- }
130
- const { children: untypedChildren, ...rest } = args[0] ?? {}
131
- const children: Renderable[] = []
132
- if (Array.isArray(untypedChildren)) {
133
- children.push(...(untypedChildren.flatMap(makeRenderables)))
134
- } else if (untypedChildren !== undefined) {
135
- children.push(...makeRenderables(untypedChildren))
136
- }
137
- for (const [key, value] of Object.entries(rest)) {
138
- if (key.startsWith('on')) {
139
- const eventName = key.slice(2).toLowerCase()
140
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
141
- children.push(new OnImpl(eventName, value as any))
142
- continue
143
- }
144
- if (value == null) {
145
- continue
146
- }
147
- const prop: Prop<unknown> = isPrimitive(value) ? new Prop(value) as Prop<unknown> : value as Prop<unknown>
148
- if (key === 'class' || key === 'className') {
149
- children.push(new ClassNameImpl(prop as Prop<string>))
150
- continue
151
- }
152
- if (domProperties.has(key)) {
153
- children.push(new PropertyImpl(key, prop))
154
- continue
155
- }
156
- if (domBooleanAttributes.has(key)) {
157
- children.push(new BooleanAttributeImpl(key, prop as Prop<boolean>))
158
- continue
159
- }
160
- children.push(new AttributeImpl(key, prop as Prop<string>))
161
- }
162
-
163
- return new ElImpl(Name, children)
164
- }
165
-
166
- export {
167
- makeElement as jsx,
168
- makeElement as jsxs,
169
- makeElement as jsxDEV,
170
- makeFragment as Fragment,
171
- type JSX
172
- }