@tempots/dom 9.0.2 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/{components → dom}/animatable.d.ts +7 -1
- package/dom/attr.d.ts +73 -0
- package/dom/dom-context.d.ts +108 -0
- package/dom/dom-utils.d.ts +21 -0
- package/dom/handle-anchor-click.d.ts +13 -0
- package/dom/ssr-tracker.d.ts +1 -0
- package/dom/ssr.d.ts +8 -0
- package/index.cjs +1 -0
- package/index.d.ts +52 -34
- package/index.js +1397 -31
- package/mountable/appearance.d.ts +38 -0
- package/mountable/async.d.ts +7 -0
- package/mountable/attribute.d.ts +489 -0
- package/mountable/autofocus.d.ts +3 -0
- package/mountable/autoselect.d.ts +3 -0
- package/mountable/bind.d.ts +16 -0
- package/mountable/conjunction.d.ts +8 -0
- package/mountable/consumers.d.ts +12 -0
- package/mountable/ctx.d.ts +3 -0
- package/mountable/domel.d.ts +3 -0
- package/mountable/element.d.ts +236 -0
- package/mountable/empty.d.ts +3 -0
- package/mountable/ensure.d.ts +4 -0
- package/mountable/foreach.d.ts +5 -0
- package/mountable/fragment.d.ts +3 -0
- package/mountable/handler.d.ts +102 -0
- package/mountable/hidden-when-empty.d.ts +3 -0
- package/mountable/html-title.d.ts +3 -0
- package/mountable/inviewport.d.ts +6 -0
- package/mountable/map-signal.d.ts +4 -0
- package/mountable/not-empty.d.ts +4 -0
- package/mountable/ondispose.d.ts +4 -0
- package/mountable/oneof.d.ts +22 -0
- package/mountable/onmount.d.ts +3 -0
- package/mountable/portal.d.ts +4 -0
- package/mountable/providers.d.ts +16 -0
- package/mountable/render.d.ts +8 -0
- package/mountable/repeat.d.ts +5 -0
- package/mountable/size.d.ts +8 -0
- package/mountable/style.d.ts +504 -0
- package/mountable/task.d.ts +7 -0
- package/mountable/text.d.ts +6 -0
- package/mountable/when.d.ts +4 -0
- package/package.json +15 -8
- package/std/interpolate.d.ts +5 -0
- package/std/position.d.ts +9 -0
- package/std/signal.d.ts +120 -0
- package/types/aria-attributes.d.ts +50 -0
- package/types/css-styles.d.ts +3 -0
- package/types/domain.d.ts +14 -0
- package/types/html-attributes.d.ts +115 -0
- package/types/html-events.d.ts +89 -0
- package/types/html-tags.d.ts +113 -0
- package/types/mathml-attributes.d.ts +50 -0
- package/types/mathml-tags.d.ts +30 -0
- package/types/svg-attributes.d.ts +243 -0
- package/types/svg-tags.d.ts +64 -0
- package/clean.d.ts +0 -2
- package/clean.js +0 -1
- package/components/Attribute.d.ts +0 -15
- package/components/Attribute.js +0 -16
- package/components/Autofocus.d.ts +0 -2
- package/components/Autofocus.js +0 -4
- package/components/BooleanAttribute.d.ts +0 -15
- package/components/BooleanAttribute.js +0 -16
- package/components/ClassName.d.ts +0 -13
- package/components/ClassName.js +0 -14
- package/components/El.d.ts +0 -15
- package/components/El.js +0 -21
- package/components/FadeIn.d.ts +0 -20
- package/components/FadeIn.js +0 -54
- package/components/FadeOut.d.ts +0 -16
- package/components/FadeOut.js +0 -39
- package/components/For.d.ts +0 -18
- package/components/For.js +0 -27
- package/components/Fragment.d.ts +0 -12
- package/components/Fragment.js +0 -16
- package/components/HiddenWhenEmpty.d.ts +0 -7
- package/components/HiddenWhenEmpty.js +0 -13
- package/components/If.d.ts +0 -14
- package/components/If.js +0 -19
- package/components/InnerHTML.d.ts +0 -13
- package/components/InnerHTML.js +0 -23
- package/components/Lifecycle.d.ts +0 -14
- package/components/Lifecycle.js +0 -18
- package/components/NotEmpty.d.ts +0 -9
- package/components/NotEmpty.js +0 -11
- package/components/On.d.ts +0 -15
- package/components/On.js +0 -14
- package/components/OnRemove.d.ts +0 -6
- package/components/OnRemove.js +0 -4
- package/components/OneOf.d.ts +0 -62
- package/components/OneOf.js +0 -68
- package/components/Portal.d.ts +0 -15
- package/components/Portal.js +0 -20
- package/components/Property.d.ts +0 -15
- package/components/Property.js +0 -16
- package/components/Provider.d.ts +0 -28
- package/components/Provider.js +0 -44
- package/components/Repeat.d.ts +0 -28
- package/components/Repeat.js +0 -146
- package/components/Show.d.ts +0 -15
- package/components/Show.js +0 -8
- package/components/Text.d.ts +0 -15
- package/components/Text.js +0 -33
- package/components/TextContent.d.ts +0 -13
- package/components/TextContent.js +0 -23
- package/components/animatable.js +0 -283
- package/dom-context.d.ts +0 -39
- package/dom-context.js +0 -263
- package/helpers/handle-anchor-click.d.ts +0 -4
- package/helpers/handle-anchor-click.js +0 -43
- package/helpers/handle-text-input.d.ts +0 -1
- package/helpers/handle-text-input.js +0 -4
- package/helpers/is-empty-element.d.ts +0 -2
- package/helpers/is-empty-element.js +0 -8
- package/jsx-dev-runtime.d.ts +0 -1
- package/jsx-dev-runtime.js +0 -1
- package/jsx-runtime.d.ts +0 -9
- package/jsx-runtime.js +0 -157
- package/jsx.d.ts +0 -806
- package/jsx.js +0 -1
- package/prop.d.ts +0 -58
- package/prop.js +0 -256
- package/render.d.ts +0 -3
- package/render.js +0 -7
- package/renderable.d.ts +0 -5
- package/renderable.js +0 -1
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
export type SVGAttributes = {
|
|
2
|
+
accentHeight: number;
|
|
3
|
+
accumulate: 'none' | 'sum';
|
|
4
|
+
additive: 'replace' | 'sum';
|
|
5
|
+
alignmentBaseline: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit';
|
|
6
|
+
allowReorder: 'no' | 'yes';
|
|
7
|
+
alphabetic: number;
|
|
8
|
+
amplitude: number;
|
|
9
|
+
arabicForm: 'initial' | 'medial' | 'terminal' | 'isolated';
|
|
10
|
+
ascent: number;
|
|
11
|
+
attributeName: string;
|
|
12
|
+
attributeType: string;
|
|
13
|
+
autoReverse: 'true' | 'false';
|
|
14
|
+
azimuth: number;
|
|
15
|
+
baseFrequency: number;
|
|
16
|
+
baseProfile: string;
|
|
17
|
+
baselineShift: number;
|
|
18
|
+
bbox: number;
|
|
19
|
+
begin: number;
|
|
20
|
+
bias: number;
|
|
21
|
+
by: number;
|
|
22
|
+
calcMode: string;
|
|
23
|
+
capHeight: number;
|
|
24
|
+
clip: number;
|
|
25
|
+
clipPath: string;
|
|
26
|
+
clipPathUnits: string;
|
|
27
|
+
clipRule: string;
|
|
28
|
+
colorInterpolation: string;
|
|
29
|
+
colorInterpolationFilters: 'auto' | 'sRGB' | 'linearRGB' | 'inherit';
|
|
30
|
+
colorProfile: string;
|
|
31
|
+
colorRendering: string;
|
|
32
|
+
contentScriptType: string;
|
|
33
|
+
contentStyleType: string;
|
|
34
|
+
cursor: string;
|
|
35
|
+
cx: number;
|
|
36
|
+
cy: number;
|
|
37
|
+
d: string;
|
|
38
|
+
decelerate: number;
|
|
39
|
+
descent: number;
|
|
40
|
+
diffuseConstant: number;
|
|
41
|
+
direction: string;
|
|
42
|
+
display: string;
|
|
43
|
+
divisor: number;
|
|
44
|
+
dominantBaseline: string;
|
|
45
|
+
dur: number;
|
|
46
|
+
dx: number;
|
|
47
|
+
dy: number;
|
|
48
|
+
edgeMode: string;
|
|
49
|
+
elevation: number;
|
|
50
|
+
enableBackground: string;
|
|
51
|
+
end: number;
|
|
52
|
+
exponent: number;
|
|
53
|
+
externalResourcesRequired: 'true' | 'false';
|
|
54
|
+
fill: string;
|
|
55
|
+
fillOpacity: number;
|
|
56
|
+
fillRule: string;
|
|
57
|
+
filter: string;
|
|
58
|
+
filterRes: number;
|
|
59
|
+
filterUnits: string;
|
|
60
|
+
floodColor: string;
|
|
61
|
+
floodOpacity: number;
|
|
62
|
+
focusable: 'true' | 'false' | 'auto';
|
|
63
|
+
fontFamily: string;
|
|
64
|
+
fontSize: number;
|
|
65
|
+
fontSizeAdjust: number;
|
|
66
|
+
fontStretch: string;
|
|
67
|
+
fontStyle: string;
|
|
68
|
+
fontVariant: string;
|
|
69
|
+
fontWeight: string;
|
|
70
|
+
format: string;
|
|
71
|
+
from: number;
|
|
72
|
+
fx: number;
|
|
73
|
+
fy: number;
|
|
74
|
+
g1: number;
|
|
75
|
+
g2: number;
|
|
76
|
+
glyphName: string;
|
|
77
|
+
glyphOrientationHorizontal: number;
|
|
78
|
+
glyphOrientationVertical: number;
|
|
79
|
+
glyphRef: string;
|
|
80
|
+
gradientTransform: string;
|
|
81
|
+
gradientUnits: string;
|
|
82
|
+
hanging: number;
|
|
83
|
+
height: number;
|
|
84
|
+
horizAdvX: number;
|
|
85
|
+
horizOriginX: number;
|
|
86
|
+
ideographic: number;
|
|
87
|
+
imageRendering: string;
|
|
88
|
+
in: string;
|
|
89
|
+
in2: string;
|
|
90
|
+
intercept: number;
|
|
91
|
+
k: number;
|
|
92
|
+
k1: number;
|
|
93
|
+
k2: number;
|
|
94
|
+
k3: number;
|
|
95
|
+
k4: number;
|
|
96
|
+
kernelMatrix: string;
|
|
97
|
+
kernelUnitLength: number;
|
|
98
|
+
kerning: number;
|
|
99
|
+
keyPoints: string;
|
|
100
|
+
keySplines: string;
|
|
101
|
+
keyTimes: string;
|
|
102
|
+
lengthAdjust: string;
|
|
103
|
+
letterSpacing: number;
|
|
104
|
+
lightingColor: string;
|
|
105
|
+
limitingConeAngle: number;
|
|
106
|
+
local: number;
|
|
107
|
+
markerEnd: string;
|
|
108
|
+
markerHeight: number;
|
|
109
|
+
markerMid: string;
|
|
110
|
+
markerStart: string;
|
|
111
|
+
markerUnits: string;
|
|
112
|
+
markerWidth: number;
|
|
113
|
+
mask: string;
|
|
114
|
+
maskContentUnits: string;
|
|
115
|
+
maskUnits: string;
|
|
116
|
+
mathematical: number;
|
|
117
|
+
mode: string;
|
|
118
|
+
numOctaves: number;
|
|
119
|
+
offset: number;
|
|
120
|
+
opacity: number;
|
|
121
|
+
operator: string;
|
|
122
|
+
order: number;
|
|
123
|
+
orient: string;
|
|
124
|
+
orientation: number;
|
|
125
|
+
origin: number;
|
|
126
|
+
overflow: string;
|
|
127
|
+
overlinePosition: number;
|
|
128
|
+
overlineThickness: number;
|
|
129
|
+
paintOrder: string;
|
|
130
|
+
panose1: number;
|
|
131
|
+
pathLength: number;
|
|
132
|
+
patternContentUnits: string;
|
|
133
|
+
patternTransform: string;
|
|
134
|
+
patternUnits: string;
|
|
135
|
+
pointerEvents: string;
|
|
136
|
+
points: string;
|
|
137
|
+
pointsAtX: number;
|
|
138
|
+
pointsAtY: number;
|
|
139
|
+
pointsAtZ: number;
|
|
140
|
+
preserveAlpha: 'true' | 'false';
|
|
141
|
+
preserveAspectRatio: string;
|
|
142
|
+
primitiveUnits: string;
|
|
143
|
+
r: number;
|
|
144
|
+
radius: number;
|
|
145
|
+
refX: number;
|
|
146
|
+
refY: number;
|
|
147
|
+
renderingIntent: string;
|
|
148
|
+
repeatCount: number;
|
|
149
|
+
repeatDur: number;
|
|
150
|
+
requiredExtensions: string;
|
|
151
|
+
requiredFeatures: string;
|
|
152
|
+
restart: string;
|
|
153
|
+
result: string;
|
|
154
|
+
rotate: number;
|
|
155
|
+
rx: number;
|
|
156
|
+
ry: number;
|
|
157
|
+
scale: number;
|
|
158
|
+
seed: number;
|
|
159
|
+
shapeRendering: string;
|
|
160
|
+
slope: number;
|
|
161
|
+
spacing: number;
|
|
162
|
+
specularConstant: number;
|
|
163
|
+
specularExponent: number;
|
|
164
|
+
speed: number;
|
|
165
|
+
spreadMethod: string;
|
|
166
|
+
startOffset: number;
|
|
167
|
+
stdDeviation: number;
|
|
168
|
+
stemh: number;
|
|
169
|
+
stemv: number;
|
|
170
|
+
stitchTiles: string;
|
|
171
|
+
stopColor: string;
|
|
172
|
+
stopOpacity: number;
|
|
173
|
+
strikethroughPosition: number;
|
|
174
|
+
strikethroughThickness: number;
|
|
175
|
+
string: string;
|
|
176
|
+
stroke: string;
|
|
177
|
+
strokeDasharray: string;
|
|
178
|
+
strokeDashoffset: number;
|
|
179
|
+
strokeLinecap: string;
|
|
180
|
+
strokeLinejoin: string;
|
|
181
|
+
strokeMiterlimit: number;
|
|
182
|
+
strokeOpacity: number;
|
|
183
|
+
strokeWidth: number;
|
|
184
|
+
surfaceScale: number;
|
|
185
|
+
systemLanguage: string;
|
|
186
|
+
tableValues: string;
|
|
187
|
+
targetX: number;
|
|
188
|
+
targetY: number;
|
|
189
|
+
textAnchor: string;
|
|
190
|
+
textDecoration: string;
|
|
191
|
+
textLength: number;
|
|
192
|
+
textRendering: string;
|
|
193
|
+
to: number;
|
|
194
|
+
transform: string;
|
|
195
|
+
u1: number;
|
|
196
|
+
u2: number;
|
|
197
|
+
underlinePosition: number;
|
|
198
|
+
underlineThickness: number;
|
|
199
|
+
unicode: number;
|
|
200
|
+
unicodeBidi: string;
|
|
201
|
+
unicodeRange: string;
|
|
202
|
+
unitsPerEm: number;
|
|
203
|
+
vAlphabetic: number;
|
|
204
|
+
values: string;
|
|
205
|
+
vectorEffect: string;
|
|
206
|
+
version: string;
|
|
207
|
+
vertAdvY: number;
|
|
208
|
+
vertOriginX: number;
|
|
209
|
+
vertOriginY: number;
|
|
210
|
+
vHanging: number;
|
|
211
|
+
vIdeographic: number;
|
|
212
|
+
viewBox: string;
|
|
213
|
+
viewTarget: number;
|
|
214
|
+
visibility: string;
|
|
215
|
+
vMathematical: number;
|
|
216
|
+
width: number;
|
|
217
|
+
widths: number;
|
|
218
|
+
wordSpacing: number;
|
|
219
|
+
writingMode: string;
|
|
220
|
+
x1: number;
|
|
221
|
+
x2: number;
|
|
222
|
+
x: number;
|
|
223
|
+
xChannelSelector: string;
|
|
224
|
+
xHeight: number;
|
|
225
|
+
xlinkActuate: string;
|
|
226
|
+
xlinkArcrole: string;
|
|
227
|
+
xlinkHref: string;
|
|
228
|
+
xlinkRole: string;
|
|
229
|
+
xlinkShow: string;
|
|
230
|
+
xlinkTitle: string;
|
|
231
|
+
xlinkType: string;
|
|
232
|
+
xmlBase: string;
|
|
233
|
+
xmlLang: string;
|
|
234
|
+
xmlns: string;
|
|
235
|
+
xmlnsXlink: string;
|
|
236
|
+
xmlSpace: string;
|
|
237
|
+
y1: number;
|
|
238
|
+
y2: number;
|
|
239
|
+
y: number;
|
|
240
|
+
yChannelSelector: string;
|
|
241
|
+
z: number;
|
|
242
|
+
zoomAndPan: string;
|
|
243
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export type SVGTags = {
|
|
2
|
+
a: SVGAElement;
|
|
3
|
+
animate: SVGAnimateElement;
|
|
4
|
+
animateMotion: SVGAnimateMotionElement;
|
|
5
|
+
animateTransform: SVGAnimateTransformElement;
|
|
6
|
+
circle: SVGCircleElement;
|
|
7
|
+
clipPath: SVGClipPathElement;
|
|
8
|
+
defs: SVGDefsElement;
|
|
9
|
+
desc: SVGDescElement;
|
|
10
|
+
ellipse: SVGEllipseElement;
|
|
11
|
+
feBlend: SVGFEBlendElement;
|
|
12
|
+
feColorMatrix: SVGFEColorMatrixElement;
|
|
13
|
+
feComponentTransfer: SVGFEComponentTransferElement;
|
|
14
|
+
feComposite: SVGFECompositeElement;
|
|
15
|
+
feConvolveMatrix: SVGFEConvolveMatrixElement;
|
|
16
|
+
feDiffuseLighting: SVGFEDiffuseLightingElement;
|
|
17
|
+
feDisplacementMap: SVGFEDisplacementMapElement;
|
|
18
|
+
feDistantLight: SVGFEDistantLightElement;
|
|
19
|
+
feDropShadow: SVGFEDropShadowElement;
|
|
20
|
+
feFlood: SVGFEFloodElement;
|
|
21
|
+
feFuncA: SVGFEFuncAElement;
|
|
22
|
+
feFuncB: SVGFEFuncBElement;
|
|
23
|
+
feFuncG: SVGFEFuncGElement;
|
|
24
|
+
feFuncR: SVGFEFuncRElement;
|
|
25
|
+
feGaussianBlur: SVGFEGaussianBlurElement;
|
|
26
|
+
feImage: SVGFEImageElement;
|
|
27
|
+
feMerge: SVGFEMergeElement;
|
|
28
|
+
feMergeNode: SVGFEMergeNodeElement;
|
|
29
|
+
feMorphology: SVGFEMorphologyElement;
|
|
30
|
+
feOffset: SVGFEOffsetElement;
|
|
31
|
+
fePointLight: SVGFEPointLightElement;
|
|
32
|
+
feSpecularLighting: SVGFESpecularLightingElement;
|
|
33
|
+
feSpotLight: SVGFESpotLightElement;
|
|
34
|
+
feTile: SVGFETileElement;
|
|
35
|
+
feTurbulence: SVGFETurbulenceElement;
|
|
36
|
+
filter: SVGFilterElement;
|
|
37
|
+
foreignObject: SVGForeignObjectElement;
|
|
38
|
+
g: SVGGElement;
|
|
39
|
+
image: SVGImageElement;
|
|
40
|
+
line: SVGLineElement;
|
|
41
|
+
linearGradient: SVGLinearGradientElement;
|
|
42
|
+
marker: SVGMarkerElement;
|
|
43
|
+
mask: SVGMaskElement;
|
|
44
|
+
metadata: SVGMetadataElement;
|
|
45
|
+
mpath: SVGMPathElement;
|
|
46
|
+
path: SVGPathElement;
|
|
47
|
+
pattern: SVGPatternElement;
|
|
48
|
+
polygon: SVGPolygonElement;
|
|
49
|
+
polyline: SVGPolylineElement;
|
|
50
|
+
radialGradient: SVGRadialGradientElement;
|
|
51
|
+
rect: SVGRectElement;
|
|
52
|
+
script: SVGScriptElement;
|
|
53
|
+
set: SVGSetElement;
|
|
54
|
+
stop: SVGStopElement;
|
|
55
|
+
style: SVGStyleElement;
|
|
56
|
+
svg: SVGSVGElement;
|
|
57
|
+
switch: SVGSwitchElement;
|
|
58
|
+
symbol: SVGSymbolElement;
|
|
59
|
+
text: SVGTextElement;
|
|
60
|
+
textPath: SVGTextPathElement;
|
|
61
|
+
title: SVGTitleElement;
|
|
62
|
+
tspan: SVGTSpanElement;
|
|
63
|
+
use: SVGUseElement;
|
|
64
|
+
};
|
package/clean.d.ts
DELETED
package/clean.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type DOMContext } from '../dom-context';
|
|
2
|
-
import { type Signal } from '../prop';
|
|
3
|
-
import { type Clear } from '../clean';
|
|
4
|
-
import { type Renderable } from '../renderable';
|
|
5
|
-
export declare class AttributeImpl implements Renderable {
|
|
6
|
-
private readonly name;
|
|
7
|
-
private readonly value;
|
|
8
|
-
constructor(name: string, value: Signal<string>);
|
|
9
|
-
readonly appendTo: (ctx: DOMContext) => Clear;
|
|
10
|
-
}
|
|
11
|
-
export interface AttributeProps {
|
|
12
|
-
name: string;
|
|
13
|
-
value: Signal<string>;
|
|
14
|
-
}
|
|
15
|
-
export declare function Attribute({ name, value }: AttributeProps): Renderable;
|
package/components/Attribute.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { subscribeToSignal } from './Text';
|
|
2
|
-
export class AttributeImpl {
|
|
3
|
-
name;
|
|
4
|
-
value;
|
|
5
|
-
constructor(name, value) {
|
|
6
|
-
this.name = name;
|
|
7
|
-
this.value = value;
|
|
8
|
-
}
|
|
9
|
-
appendTo = (ctx) => {
|
|
10
|
-
const [set, clear] = ctx.createAttribute(this.name, this.value.get());
|
|
11
|
-
return subscribeToSignal(this.value, set, clear);
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export function Attribute({ name, value }) {
|
|
15
|
-
return new AttributeImpl(name, value);
|
|
16
|
-
}
|
package/components/Autofocus.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type DOMContext } from '../dom-context';
|
|
2
|
-
import { type Signal } from '../prop';
|
|
3
|
-
import { type Clear } from '../clean';
|
|
4
|
-
import { type Renderable } from '../renderable';
|
|
5
|
-
export declare class BooleanAttributeImpl implements Renderable {
|
|
6
|
-
private readonly name;
|
|
7
|
-
private readonly value;
|
|
8
|
-
constructor(name: string, value: Signal<boolean>);
|
|
9
|
-
readonly appendTo: (ctx: DOMContext) => Clear;
|
|
10
|
-
}
|
|
11
|
-
export interface BooleanAttributeProps {
|
|
12
|
-
name: string;
|
|
13
|
-
value: Signal<boolean>;
|
|
14
|
-
}
|
|
15
|
-
export declare function BooleanAttribute({ name, value }: BooleanAttributeProps): Renderable;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { subscribeToSignal } from './Text';
|
|
2
|
-
export class BooleanAttributeImpl {
|
|
3
|
-
name;
|
|
4
|
-
value;
|
|
5
|
-
constructor(name, value) {
|
|
6
|
-
this.name = name;
|
|
7
|
-
this.value = value;
|
|
8
|
-
}
|
|
9
|
-
appendTo = (ctx) => {
|
|
10
|
-
const [set, clear] = ctx.createBooleanAttribute(this.name, this.value.get());
|
|
11
|
-
return subscribeToSignal(this.value, set, clear);
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export function BooleanAttribute({ name, value }) {
|
|
15
|
-
return new BooleanAttributeImpl(name, value);
|
|
16
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type Signal } from '../prop';
|
|
2
|
-
import { type Renderable } from '../renderable';
|
|
3
|
-
import { type Clear } from '../clean';
|
|
4
|
-
import { type DOMContext } from '../dom-context';
|
|
5
|
-
export declare class ClassNameImpl implements Renderable {
|
|
6
|
-
private readonly cls;
|
|
7
|
-
constructor(cls: Signal<string> | Signal<string | undefined>);
|
|
8
|
-
readonly appendTo: (ctx: DOMContext) => Clear;
|
|
9
|
-
}
|
|
10
|
-
export interface ClassNameProps {
|
|
11
|
-
value: Signal<string> | Signal<string | undefined>;
|
|
12
|
-
}
|
|
13
|
-
export declare function ClassName({ value }: ClassNameProps): Renderable;
|
package/components/ClassName.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { subscribeToSignal } from './Text';
|
|
2
|
-
export class ClassNameImpl {
|
|
3
|
-
cls;
|
|
4
|
-
constructor(cls) {
|
|
5
|
-
this.cls = cls;
|
|
6
|
-
}
|
|
7
|
-
appendTo = (ctx) => {
|
|
8
|
-
const [set, clear] = ctx.createClass(this.cls.get() ?? '');
|
|
9
|
-
return subscribeToSignal(this.cls.map(v => v ?? ''), set, clear);
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export function ClassName({ value }) {
|
|
13
|
-
return new ClassNameImpl(value);
|
|
14
|
-
}
|
package/components/El.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type DOMContext } from '../dom-context';
|
|
2
|
-
import { type Clear } from '../clean';
|
|
3
|
-
import { type Renderable } from '../renderable';
|
|
4
|
-
import { type JSX } from '../jsx';
|
|
5
|
-
export declare class ElImpl implements Renderable {
|
|
6
|
-
private readonly tagName;
|
|
7
|
-
private readonly children;
|
|
8
|
-
constructor(tagName: string, children: Renderable[]);
|
|
9
|
-
readonly appendTo: (ctx: DOMContext) => Clear;
|
|
10
|
-
}
|
|
11
|
-
export interface ElProps {
|
|
12
|
-
tagName: string;
|
|
13
|
-
children?: JSX.DOMNode;
|
|
14
|
-
}
|
|
15
|
-
export declare function El({ tagName, children }: ElProps): Renderable;
|
package/components/El.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { makeRenderables } from '../jsx-runtime';
|
|
2
|
-
export class ElImpl {
|
|
3
|
-
tagName;
|
|
4
|
-
children;
|
|
5
|
-
constructor(tagName, children) {
|
|
6
|
-
this.tagName = tagName;
|
|
7
|
-
this.children = children;
|
|
8
|
-
}
|
|
9
|
-
appendTo = (ctx) => {
|
|
10
|
-
const newCtx = ctx.makeElement(this.tagName);
|
|
11
|
-
const clears = this.children.map(child => child.appendTo(newCtx));
|
|
12
|
-
return (removeTree) => {
|
|
13
|
-
newCtx.requestClear(removeTree, () => {
|
|
14
|
-
clears.forEach(clear => { clear(false); });
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export function El({ tagName, children }) {
|
|
20
|
-
return new ElImpl(tagName, makeRenderables(children));
|
|
21
|
-
}
|
package/components/FadeIn.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type Clear } from '../clean';
|
|
2
|
-
import { type DOMContext } from '../dom-context';
|
|
3
|
-
import { type Renderable } from '../renderable';
|
|
4
|
-
import { type Animatable } from './animatable';
|
|
5
|
-
export declare class FadeInImpl implements Renderable {
|
|
6
|
-
private readonly end;
|
|
7
|
-
private readonly start;
|
|
8
|
-
private readonly easing;
|
|
9
|
-
private readonly duration;
|
|
10
|
-
private readonly delay;
|
|
11
|
-
constructor(end: Animatable, start: Animatable | undefined, easing: (t: number) => number, duration: number, delay: number);
|
|
12
|
-
appendTo(ctx: DOMContext): Clear;
|
|
13
|
-
}
|
|
14
|
-
export interface FadeInProps extends Animatable {
|
|
15
|
-
start?: Animatable;
|
|
16
|
-
duration?: number;
|
|
17
|
-
easing?: (t: number) => number;
|
|
18
|
-
delay?: number;
|
|
19
|
-
}
|
|
20
|
-
export declare function FadeIn(props: FadeInProps): Renderable;
|
package/components/FadeIn.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { getComputedAnimatable, applyInterpolatedAnimatable, applyAnimatable } from './animatable';
|
|
2
|
-
export class FadeInImpl {
|
|
3
|
-
end;
|
|
4
|
-
start;
|
|
5
|
-
easing;
|
|
6
|
-
duration;
|
|
7
|
-
delay;
|
|
8
|
-
constructor(end, start, easing, duration, delay) {
|
|
9
|
-
this.end = end;
|
|
10
|
-
this.start = start;
|
|
11
|
-
this.easing = easing;
|
|
12
|
-
this.duration = duration;
|
|
13
|
-
this.delay = delay;
|
|
14
|
-
}
|
|
15
|
-
appendTo(ctx) {
|
|
16
|
-
const el = ctx.getElement();
|
|
17
|
-
const start = (() => {
|
|
18
|
-
if (this.start != null) {
|
|
19
|
-
applyAnimatable(el, this.start);
|
|
20
|
-
return this.start;
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
return getComputedAnimatable(el, this.end);
|
|
24
|
-
}
|
|
25
|
-
})();
|
|
26
|
-
const startTime = Date.now() + this.delay;
|
|
27
|
-
const { duration, end, easing } = this;
|
|
28
|
-
let nextFrameId = null;
|
|
29
|
-
function frame() {
|
|
30
|
-
const now = Date.now();
|
|
31
|
-
if (now < startTime) {
|
|
32
|
-
nextFrameId = requestAnimationFrame(frame);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const progress = Math.min((now - startTime) / duration, 1);
|
|
36
|
-
applyInterpolatedAnimatable(el, start, end, easing(progress));
|
|
37
|
-
if (progress < 1) {
|
|
38
|
-
nextFrameId = requestAnimationFrame(frame);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
nextFrameId = null;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
frame();
|
|
45
|
-
return (_) => {
|
|
46
|
-
if (nextFrameId != null)
|
|
47
|
-
cancelAnimationFrame(nextFrameId);
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
export function FadeIn(props) {
|
|
52
|
-
const { start, duration, easing, delay, ...end } = props;
|
|
53
|
-
return new FadeInImpl(end, start, easing ?? (v => v), duration ?? 200, delay ?? 0);
|
|
54
|
-
}
|
package/components/FadeOut.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type Clear } from '../clean';
|
|
2
|
-
import { type DOMContext } from '../dom-context';
|
|
3
|
-
import { type Renderable } from '../renderable';
|
|
4
|
-
import { type Animatable } from './animatable';
|
|
5
|
-
export declare class FadeOutImpl implements Renderable {
|
|
6
|
-
private readonly end;
|
|
7
|
-
private readonly duration;
|
|
8
|
-
private readonly delay;
|
|
9
|
-
constructor(end: Animatable, duration: number, delay: number);
|
|
10
|
-
appendTo(ctx: DOMContext): Clear;
|
|
11
|
-
}
|
|
12
|
-
export interface FadeOutProps extends Animatable {
|
|
13
|
-
duration?: number;
|
|
14
|
-
delay?: number;
|
|
15
|
-
}
|
|
16
|
-
export declare function FadeOut(props: FadeOutProps): Renderable;
|
package/components/FadeOut.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { getComputedAnimatable, applyInterpolatedAnimatable } from './animatable';
|
|
2
|
-
export class FadeOutImpl {
|
|
3
|
-
end;
|
|
4
|
-
duration;
|
|
5
|
-
delay;
|
|
6
|
-
constructor(end, duration, delay) {
|
|
7
|
-
this.end = end;
|
|
8
|
-
this.duration = duration;
|
|
9
|
-
this.delay = delay;
|
|
10
|
-
}
|
|
11
|
-
appendTo(ctx) {
|
|
12
|
-
const el = ctx.getElement();
|
|
13
|
-
const { duration, end } = this;
|
|
14
|
-
return ctx.delayClear((removeTree, clear) => {
|
|
15
|
-
const start = getComputedAnimatable(el, this.end);
|
|
16
|
-
const startTime = Date.now() + this.delay;
|
|
17
|
-
function frame() {
|
|
18
|
-
const now = Date.now();
|
|
19
|
-
if (now < startTime) {
|
|
20
|
-
requestAnimationFrame(frame);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const progress = Math.min((now - startTime) / duration, 1);
|
|
24
|
-
applyInterpolatedAnimatable(el, start, end, progress);
|
|
25
|
-
if (progress < 1) {
|
|
26
|
-
requestAnimationFrame(frame);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
clear();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
requestAnimationFrame(frame);
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export function FadeOut(props) {
|
|
37
|
-
const { duration, delay, ...end } = props;
|
|
38
|
-
return new FadeOutImpl(end, duration ?? 200, delay ?? 0);
|
|
39
|
-
}
|
package/components/For.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { type Signal } from '../prop';
|
|
2
|
-
import { type PositionProps } from './Repeat';
|
|
3
|
-
import { type JSX } from '../jsx-runtime';
|
|
4
|
-
export interface ForProps<T> {
|
|
5
|
-
of: Signal<T[]>;
|
|
6
|
-
separator?: (value: Signal<PositionProps>) => JSX.DOMNode;
|
|
7
|
-
children?: (value: Signal<T>, pos: Signal<PositionProps>) => JSX.DOMNode;
|
|
8
|
-
}
|
|
9
|
-
export declare function For<T>({ of, children: render, separator }: ForProps<T>): JSX.DOMNode;
|
|
10
|
-
export interface ForWithPositionProps<T> {
|
|
11
|
-
of: Signal<T[]>;
|
|
12
|
-
separator?: (value: Signal<PositionProps>) => JSX.DOMNode;
|
|
13
|
-
children?: (data: Signal<{
|
|
14
|
-
value: T;
|
|
15
|
-
pos: PositionProps;
|
|
16
|
-
}>) => JSX.DOMNode;
|
|
17
|
-
}
|
|
18
|
-
export declare function ForWithPosition<T>({ of, children: render, separator }: ForWithPositionProps<T>): JSX.DOMNode;
|
package/components/For.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { RepeatImpl } from './Repeat';
|
|
2
|
-
import { makeRenderable } from '../jsx-runtime';
|
|
3
|
-
import { FragmentImpl } from './Fragment';
|
|
4
|
-
import { OnRemove } from './OnRemove';
|
|
5
|
-
// <For of={values} separator={() => ", "}>{(value) => <span>{value}</span>}</For>
|
|
6
|
-
export function For({ of, children: render, separator }) {
|
|
7
|
-
const times = of.map(v => v.length);
|
|
8
|
-
return new RepeatImpl(times, (pos) => {
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
10
|
-
const value = of.combine(pos, (arr, { index }) => arr.at(index));
|
|
11
|
-
return new FragmentImpl([
|
|
12
|
-
makeRenderable(render?.(value, pos)),
|
|
13
|
-
OnRemove({ clear: value.clean })
|
|
14
|
-
]);
|
|
15
|
-
}, separator);
|
|
16
|
-
}
|
|
17
|
-
export function ForWithPosition({ of, children: render, separator }) {
|
|
18
|
-
const times = of.map(v => v.length);
|
|
19
|
-
return new RepeatImpl(times, (pos) => {
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
21
|
-
const value = of.combine(pos, (arr, { index }) => arr.at(index));
|
|
22
|
-
return new FragmentImpl([
|
|
23
|
-
makeRenderable(render?.(value.combine(pos, (v, p) => ({ value: v, pos: p })))),
|
|
24
|
-
OnRemove({ clear: value.clean })
|
|
25
|
-
]);
|
|
26
|
-
}, separator);
|
|
27
|
-
}
|
package/components/Fragment.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type Renderable } from '../renderable';
|
|
2
|
-
import { type Clear } from '../clean';
|
|
3
|
-
import { type DOMContext } from '../dom-context';
|
|
4
|
-
import { type JSX } from '../jsx';
|
|
5
|
-
export declare class FragmentImpl implements Renderable {
|
|
6
|
-
private readonly children;
|
|
7
|
-
constructor(children: Renderable[]);
|
|
8
|
-
readonly appendTo: (ctx: DOMContext) => Clear;
|
|
9
|
-
}
|
|
10
|
-
export declare function Fragment({ children }: {
|
|
11
|
-
children: JSX.DOMNode;
|
|
12
|
-
}): Renderable;
|
package/components/Fragment.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { makeRenderables } from '../jsx-runtime';
|
|
2
|
-
export class FragmentImpl {
|
|
3
|
-
children;
|
|
4
|
-
constructor(children) {
|
|
5
|
-
this.children = children;
|
|
6
|
-
}
|
|
7
|
-
appendTo = (ctx) => {
|
|
8
|
-
const clears = this.children.map(child => child.appendTo(ctx));
|
|
9
|
-
return (removeTree) => {
|
|
10
|
-
clears.forEach(clear => { clear(removeTree); });
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export function Fragment({ children }) {
|
|
15
|
-
return new FragmentImpl(makeRenderables(children));
|
|
16
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type Renderable } from '../renderable';
|
|
2
|
-
import { type DOMContext } from '../dom-context';
|
|
3
|
-
import { type Clear } from '../clean';
|
|
4
|
-
export declare class HiddenWhenEmptyImpl implements Renderable {
|
|
5
|
-
appendTo(ctx: DOMContext): Clear;
|
|
6
|
-
}
|
|
7
|
-
export declare function HiddenWhenEmpty(): HiddenWhenEmptyImpl;
|