@typed/ui 0.3.5 → 0.3.7
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.
- package/dist/cjs/Link.js +2 -2
- package/dist/cjs/Link.js.map +1 -1
- package/dist/cjs/Props.js.map +1 -1
- package/dist/cjs/hyperscript.js +484 -0
- package/dist/cjs/hyperscript.js.map +1 -0
- package/dist/cjs/index.js +0 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/dts/Link.d.ts +2 -2
- package/dist/dts/Link.d.ts.map +1 -1
- package/dist/dts/Props.d.ts +7 -0
- package/dist/dts/Props.d.ts.map +1 -1
- package/dist/dts/dom-properties.d.ts +129 -0
- package/dist/dts/dom-properties.d.ts.map +1 -1
- package/dist/dts/hyperscript.d.ts +460 -0
- package/dist/dts/hyperscript.d.ts.map +1 -0
- package/dist/dts/index.d.ts +0 -4
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/esm/Link.js +2 -2
- package/dist/esm/Link.js.map +1 -1
- package/dist/esm/Props.js.map +1 -1
- package/dist/esm/hyperscript.js +470 -0
- package/dist/esm/hyperscript.js.map +1 -0
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +1 -1
- package/hyperscript/package.json +6 -0
- package/package.json +20 -28
- package/src/Link.ts +4 -3
- package/src/Props.ts +10 -0
- package/src/dom-properties.ts +130 -0
- package/src/hyperscript.ts +646 -0
- package/src/index.ts +0 -5
- package/Anchor/package.json +0 -6
- package/Component/package.json +0 -6
- package/dist/cjs/Anchor.js +0 -17
- package/dist/cjs/Anchor.js.map +0 -1
- package/dist/cjs/Component.js +0 -6
- package/dist/cjs/Component.js.map +0 -1
- package/dist/dts/Anchor.d.ts +0 -15
- package/dist/dts/Anchor.d.ts.map +0 -1
- package/dist/dts/Component.d.ts +0 -16
- package/dist/dts/Component.d.ts.map +0 -1
- package/dist/esm/Anchor.js +0 -9
- package/dist/esm/Anchor.js.map +0 -1
- package/dist/esm/Component.js +0 -5
- package/dist/esm/Component.js.map +0 -1
- package/src/Anchor.ts +0 -18
- package/src/Component.ts +0 -24
package/src/Link.ts
CHANGED
|
@@ -14,13 +14,14 @@ import type { RenderEvent } from "@typed/template/RenderEvent"
|
|
|
14
14
|
import type { RenderTemplate } from "@typed/template/RenderTemplate"
|
|
15
15
|
import * as Effect from "effect/Effect"
|
|
16
16
|
import type * as Scope from "effect/Scope"
|
|
17
|
-
import {
|
|
17
|
+
import { a } from "./hyperscript.js"
|
|
18
|
+
import type { TypedPropertiesMap } from "./Props.js"
|
|
18
19
|
import { getEventHandler } from "./Props.js"
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* @since 1.0.0
|
|
22
23
|
*/
|
|
23
|
-
export type LinkProps = Omit<
|
|
24
|
+
export type LinkProps = Omit<TypedPropertiesMap["a"], keyof URL> & {
|
|
24
25
|
readonly to: string | Placeholder.Any<string>
|
|
25
26
|
readonly relative?: boolean | Placeholder.Any<boolean>
|
|
26
27
|
readonly replace?: boolean | Placeholder.Any<boolean>
|
|
@@ -81,6 +82,6 @@ export function Link<Props extends LinkProps, Children extends ReadonlyArray<Ren
|
|
|
81
82
|
|
|
82
83
|
const allProps = { ...props, href, state: stateRef, onClick: onClickEventHandler }
|
|
83
84
|
|
|
84
|
-
return
|
|
85
|
+
return a(allProps as any as Props, ...children)
|
|
85
86
|
})
|
|
86
87
|
}
|
package/src/Props.ts
CHANGED
|
@@ -10,6 +10,7 @@ import type { Placeholder } from "@typed/template/Placeholder"
|
|
|
10
10
|
import type { Rendered } from "@typed/wire"
|
|
11
11
|
import { Effect } from "effect"
|
|
12
12
|
import type { ReadonlyRecord } from "effect"
|
|
13
|
+
import type { HTMLPropertiesMap } from "./dom-properties.js"
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* @since 1.0.0
|
|
@@ -93,3 +94,12 @@ export function getEventHandler<R, E, Ev extends Event = Event>(
|
|
|
93
94
|
return handler
|
|
94
95
|
}
|
|
95
96
|
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @since 1.0.0
|
|
100
|
+
*/
|
|
101
|
+
export type TypedPropertiesMap = {
|
|
102
|
+
readonly [K in keyof HTMLPropertiesMap]: K extends keyof HTMLElementTagNameMap
|
|
103
|
+
? TypedProps<HTMLPropertiesMap[K], HTMLElementTagNameMap[K]>
|
|
104
|
+
: TypedProps<HTMLPropertiesMap[K], HTMLElement>
|
|
105
|
+
}
|
package/src/dom-properties.ts
CHANGED
|
@@ -1000,3 +1000,133 @@ export type HTMLVideoElementProperties =
|
|
|
1000
1000
|
poster?: string
|
|
1001
1001
|
width?: number
|
|
1002
1002
|
}
|
|
1003
|
+
|
|
1004
|
+
/**
|
|
1005
|
+
* @since 1.0.0
|
|
1006
|
+
*/
|
|
1007
|
+
export interface HTMLPropertiesMap {
|
|
1008
|
+
a: HTMLAnchorElementProperties
|
|
1009
|
+
abbr: HTMLElementProperties
|
|
1010
|
+
address: HTMLElementProperties
|
|
1011
|
+
applet: HTMLAppletElementProperties
|
|
1012
|
+
area: HTMLAreaElementProperties
|
|
1013
|
+
article: HTMLElementProperties
|
|
1014
|
+
aside: HTMLElementProperties
|
|
1015
|
+
audio: HTMLAudioElementProperties
|
|
1016
|
+
b: HTMLElementProperties
|
|
1017
|
+
base: HTMLBaseElementProperties
|
|
1018
|
+
basefont: HTMLBaseFontElementProperties
|
|
1019
|
+
bdi: HTMLElementProperties
|
|
1020
|
+
bdo: HTMLElementProperties
|
|
1021
|
+
big: HTMLElementProperties
|
|
1022
|
+
blockquote: HTMLElementProperties
|
|
1023
|
+
body: HTMLBodyElementProperties
|
|
1024
|
+
br: HTMLBRElementProperties
|
|
1025
|
+
button: HTMLButtonElementProperties
|
|
1026
|
+
canvas: HTMLCanvasElementProperties
|
|
1027
|
+
caption: HTMLElementProperties
|
|
1028
|
+
center: HTMLElementProperties
|
|
1029
|
+
cite: HTMLElementProperties
|
|
1030
|
+
code: HTMLElementProperties
|
|
1031
|
+
col: HTMLTableColElementProperties
|
|
1032
|
+
colgroup: HTMLTableColElementProperties
|
|
1033
|
+
data: HTMLDataElementProperties
|
|
1034
|
+
datalist: HTMLDataListElementProperties
|
|
1035
|
+
dd: HTMLElementProperties
|
|
1036
|
+
del: HTMLModElementProperties
|
|
1037
|
+
details: HTMLElementProperties
|
|
1038
|
+
dfn: HTMLElementProperties
|
|
1039
|
+
dialog: HTMLElementProperties
|
|
1040
|
+
dir: HTMLDirectoryElementProperties
|
|
1041
|
+
div: HTMLDivElementProperties
|
|
1042
|
+
dl: HTMLDListElementProperties
|
|
1043
|
+
dt: HTMLElementProperties
|
|
1044
|
+
em: HTMLElementProperties
|
|
1045
|
+
embed: HTMLEmbedElementProperties
|
|
1046
|
+
fieldset: HTMLFieldSetElementProperties
|
|
1047
|
+
figcaption: HTMLElementProperties
|
|
1048
|
+
figure: HTMLElementProperties
|
|
1049
|
+
font: HTMLFontElementProperties
|
|
1050
|
+
footer: HTMLElementProperties
|
|
1051
|
+
form: HTMLFormElementProperties
|
|
1052
|
+
frame: HTMLFrameElementProperties
|
|
1053
|
+
frameset: HTMLFrameSetElementProperties
|
|
1054
|
+
h1: HTMLHeadingElementProperties
|
|
1055
|
+
h2: HTMLHeadingElementProperties
|
|
1056
|
+
h3: HTMLHeadingElementProperties
|
|
1057
|
+
h4: HTMLHeadingElementProperties
|
|
1058
|
+
h5: HTMLHeadingElementProperties
|
|
1059
|
+
h6: HTMLHeadingElementProperties
|
|
1060
|
+
head: HTMLHeadElementProperties
|
|
1061
|
+
header: HTMLElementProperties
|
|
1062
|
+
hgroup: HTMLElementProperties
|
|
1063
|
+
hr: HTMLHRElementProperties
|
|
1064
|
+
html: HTMLHtmlElementProperies
|
|
1065
|
+
i: HTMLElementProperties
|
|
1066
|
+
iframe: HTMLIFrameElementProperties
|
|
1067
|
+
img: HTMLImageElementProperties
|
|
1068
|
+
input: HTMLInputElementProperties
|
|
1069
|
+
ins: HTMLModElementProperties
|
|
1070
|
+
kbd: HTMLElementProperties
|
|
1071
|
+
label: HTMLLabelElementProperties
|
|
1072
|
+
legend: HTMLLegendElementProperties
|
|
1073
|
+
li: HTMLLIElementProperties
|
|
1074
|
+
link: HTMLLinkElementProperties
|
|
1075
|
+
main: HTMLElementProperties
|
|
1076
|
+
map: HTMLMapElementProperties
|
|
1077
|
+
mark: HTMLElementProperties
|
|
1078
|
+
marquee: HTMLMarqueeElementProperties
|
|
1079
|
+
menu: HTMLMenuElementProperties
|
|
1080
|
+
menuitem: HTMLElementProperties
|
|
1081
|
+
meta: HTMLMetaElementProperties
|
|
1082
|
+
meter: HTMLMeterElementProperties
|
|
1083
|
+
nav: HTMLElementProperties
|
|
1084
|
+
noframes: HTMLElementProperties
|
|
1085
|
+
noscript: HTMLElementProperties
|
|
1086
|
+
object: HTMLObjectElementProperties
|
|
1087
|
+
ol: HTMLOListElementProperteis
|
|
1088
|
+
optgroup: HTMLOptGroupElementProperties
|
|
1089
|
+
option: HTMLOptionElementProperties
|
|
1090
|
+
output: HTMLOutputElementProperties
|
|
1091
|
+
p: HTMLParagraphElementProperties
|
|
1092
|
+
param: HTMLParamElementProperties
|
|
1093
|
+
picture: HTMLElementProperties
|
|
1094
|
+
pre: HTMLPreElementProperties
|
|
1095
|
+
progress: HTMLProgressElementProperties
|
|
1096
|
+
q: HTMLQuoteElementProperties
|
|
1097
|
+
rp: HTMLElementProperties
|
|
1098
|
+
rt: HTMLElementProperties
|
|
1099
|
+
ruby: HTMLElementProperties
|
|
1100
|
+
s: HTMLElementProperties
|
|
1101
|
+
samp: HTMLElementProperties
|
|
1102
|
+
script: HTMLScriptElementProperties
|
|
1103
|
+
section: HTMLElementProperties
|
|
1104
|
+
select: HTMLSelectElementProperties
|
|
1105
|
+
small: HTMLElementProperties
|
|
1106
|
+
source: HTMLSourceElementProperties
|
|
1107
|
+
span: HTMLSpanElementProperties
|
|
1108
|
+
strike: HTMLElementProperties
|
|
1109
|
+
strong: HTMLElementProperties
|
|
1110
|
+
style: HTMLStyleElementProperties
|
|
1111
|
+
sub: HTMLElementProperties
|
|
1112
|
+
summary: HTMLElementProperties
|
|
1113
|
+
sup: HTMLElementProperties
|
|
1114
|
+
table: HTMLTableElementProperties
|
|
1115
|
+
tbody: HTMLTableSectionElementProperties
|
|
1116
|
+
td: HTMLTableCellElementProperties
|
|
1117
|
+
template: HTMLTemplateElementProperties
|
|
1118
|
+
textarea: HTMLTextAreaElementProperties
|
|
1119
|
+
tfoot: HTMLTableSectionElementProperties
|
|
1120
|
+
th: HTMLTableHeaderCellElementProperties
|
|
1121
|
+
thead: HTMLTableSectionElementProperties
|
|
1122
|
+
time: HTMLTimeElementProperties
|
|
1123
|
+
title: HTMLTitleElementProperties
|
|
1124
|
+
tr: HTMLTableRowElementProperties
|
|
1125
|
+
track: HTMLTrackElementProperties
|
|
1126
|
+
tt: HTMLElementProperties
|
|
1127
|
+
u: HTMLElementProperties
|
|
1128
|
+
ul: HTMLUListElementProperties
|
|
1129
|
+
var: HTMLElementProperties
|
|
1130
|
+
video: HTMLVideoElementProperties
|
|
1131
|
+
wbr: HTMLElementProperties
|
|
1132
|
+
}
|