@backtickjs/jsx-solid 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +105 -2
- package/dist/jsx-runtime.d.ts +242 -0
- package/dist/jsx-runtime.js +31 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/plugin.d.ts +11 -0
- package/dist/plugin.js +24 -0
- package/dist/plugin.js.map +1 -0
- package/package.json +78 -3
- package/src/babel-preset-solid.d.ts +5 -0
- package/src/jsx-runtime.ts +357 -0
- package/src/plugin.ts +28 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jean-François Bisson
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,106 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @backtickjs/jsx-solid
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Solid's JSX for [Backtick](https://backtickjs.com): a JSX runtime that type-checks the JSX in your server components against Solid's own types, and a compile plugin that runs Solid's compiler on each script at build time. Solid itself is imported for the client, as any other package is: `import { createSignal } from "solid-js" with { backtick: "client" }`. Solid is a peer dependency: this package is built against Solid 1.9.14, and works with any later 1.x.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install solid-js @backtickjs/jsx-solid @backtickjs/core @backtickjs/bundler @backtickjs/node-plugin
|
|
9
|
+
npm install -D @backtickjs/tsc
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The [repository's README](https://github.com/backtickjs/backtick#packages) says what each package is.
|
|
13
|
+
|
|
14
|
+
## Setup
|
|
15
|
+
|
|
16
|
+
In `tsconfig.json`, point JSX at this package and keep imports as written:
|
|
17
|
+
|
|
18
|
+
```jsonc
|
|
19
|
+
{
|
|
20
|
+
"compilerOptions": {
|
|
21
|
+
"verbatimModuleSyntax": true,
|
|
22
|
+
"jsx": "react-jsx",
|
|
23
|
+
"jsxImportSource": "@backtickjs/jsx-solid",
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`verbatimModuleSyntax` keeps the import of a name you only splice, such as a client component from another file, which TypeScript would otherwise drop as unused. `"jsx": "react-jsx"` only applies to the JSX in your server components; scripts are compiled by Solid's compiler.
|
|
29
|
+
|
|
30
|
+
In `package.json`, name the compile plugin:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"backtick": {
|
|
35
|
+
"plugins": ["@backtickjs/jsx-solid/plugin"]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Run your server with `node --import @backtickjs/node-plugin server/index.tsx`.
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
A client component, with Solid's signal imported for the client, and a server component that draws it beside a server value:
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
// server/Home.tsx
|
|
48
|
+
import { cs } from "@backtickjs/core";
|
|
49
|
+
import { createSignal } from "solid-js" with { backtick: "client" };
|
|
50
|
+
|
|
51
|
+
const Counter = cs`() => {
|
|
52
|
+
const [count, setCount] = $createSignal(0);
|
|
53
|
+
return (
|
|
54
|
+
<button onClick={() => setCount(count() + 1)}>
|
|
55
|
+
Clicked {count()} times
|
|
56
|
+
</button>
|
|
57
|
+
);
|
|
58
|
+
}`;
|
|
59
|
+
|
|
60
|
+
export async function Home() {
|
|
61
|
+
const assembledAt = new Date().toLocaleTimeString();
|
|
62
|
+
return cs`(
|
|
63
|
+
<main>
|
|
64
|
+
<$Counter />
|
|
65
|
+
<p>Your server assembled this page at {$assembledAt}.</p>
|
|
66
|
+
</main>
|
|
67
|
+
)`;
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
On each request, bundle it for the Solid version the page loads, and serve the result as a `<script type="module">`, with an import map that resolves `solid-js`, `solid-js/web` and `solid-js/store`:
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { bundler } from "@backtickjs/bundler";
|
|
75
|
+
import { cs } from "@backtickjs/core";
|
|
76
|
+
import { render } from "solid-js/web" with { backtick: "client" };
|
|
77
|
+
import { Home } from "./Home.js";
|
|
78
|
+
|
|
79
|
+
const element = <Home />;
|
|
80
|
+
const bundle = await bundler.build({
|
|
81
|
+
input: cs`$render(() => $element, document.getElementById("app")!)`,
|
|
82
|
+
modules: {
|
|
83
|
+
"solid-js": "1.9.14",
|
|
84
|
+
"solid-js/store": "1.9.14",
|
|
85
|
+
"solid-js/web": "1.9.14",
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
const { code } = bundle.generate({ format: "es" });
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## What it exports
|
|
92
|
+
|
|
93
|
+
- `@backtickjs/jsx-solid/jsx-runtime` and `@backtickjs/jsx-solid/jsx-dev-runtime`: the JSX runtime for server components, and its `JSX` namespace.
|
|
94
|
+
- `@backtickjs/jsx-solid/plugin`: the compile plugin, Solid's compiler (`babel-preset-solid`, DOM output).
|
|
95
|
+
|
|
96
|
+
## Related
|
|
97
|
+
|
|
98
|
+
- [`@backtickjs/core`](https://github.com/backtickjs/backtick/tree/main/packages/core): the `cs` tag
|
|
99
|
+
- [`@backtickjs/bundler`](https://github.com/backtickjs/backtick/tree/main/packages/bundler): builds bundles
|
|
100
|
+
- [`@backtickjs/jsx-react`](https://github.com/backtickjs/backtick/tree/main/packages/jsx-react): React's JSX
|
|
101
|
+
- [Thinking in Backtick](https://backtickjs.com/docs/thinking-in-backtick/)
|
|
102
|
+
- [How it works](https://backtickjs.com/docs/how-it-works/)
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
|
|
106
|
+
MIT
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { type Client, type JsxElementOf, type JsxElementTypeOf } from "@backtickjs/core";
|
|
2
|
+
import type { JSX as Solid } from "solid-js";
|
|
3
|
+
export declare namespace JSX {
|
|
4
|
+
type FunctionMaybe<T = unknown> = Solid.FunctionMaybe<T>;
|
|
5
|
+
type FunctionElement = Solid.FunctionElement;
|
|
6
|
+
type Element = JsxElementOf<Solid.Element>;
|
|
7
|
+
type ElementType = JsxElementTypeOf<Solid.Element>;
|
|
8
|
+
type ArrayElement = Solid.ArrayElement;
|
|
9
|
+
type ElementClass = Solid.ElementClass;
|
|
10
|
+
type ElementAttributesProperty = Solid.ElementAttributesProperty;
|
|
11
|
+
type ElementChildrenAttribute = Solid.ElementChildrenAttribute;
|
|
12
|
+
type EventHandler<T, E extends Event> = Solid.EventHandler<T, E>;
|
|
13
|
+
type BoundEventHandler<T, E extends Event, EHandler extends EventHandler<T, any> = EventHandler<T, E>> = Solid.BoundEventHandler<T, E, EHandler>;
|
|
14
|
+
type EventHandlerUnion<T, E extends Event, EHandler extends EventHandler<T, any> = EventHandler<T, E>> = Solid.EventHandlerUnion<T, E, EHandler>;
|
|
15
|
+
type EventHandlerWithOptions<T, E extends Event, EHandler = EventHandler<T, E>> = Solid.EventHandlerWithOptions<T, E, EHandler>;
|
|
16
|
+
type EventHandlerWithOptionsUnion<T, E extends Event, EHandler extends EventHandler<T, any> = EventHandler<T, E>> = Solid.EventHandlerWithOptionsUnion<T, E, EHandler>;
|
|
17
|
+
type InputEventHandler<T, E extends InputEvent> = Solid.InputEventHandler<T, E>;
|
|
18
|
+
type InputEventHandlerUnion<T, E extends InputEvent> = Solid.InputEventHandlerUnion<T, E>;
|
|
19
|
+
type ChangeEventHandler<T, E extends Event> = Solid.ChangeEventHandler<T, E>;
|
|
20
|
+
type ChangeEventHandlerUnion<T, E extends Event> = Solid.ChangeEventHandlerUnion<T, E>;
|
|
21
|
+
type FocusEventHandler<T, E extends FocusEvent> = Solid.FocusEventHandler<T, E>;
|
|
22
|
+
type FocusEventHandlerUnion<T, E extends FocusEvent> = Solid.FocusEventHandlerUnion<T, E>;
|
|
23
|
+
type SerializableAttributeValue = Solid.SerializableAttributeValue;
|
|
24
|
+
type IntrinsicAttributes = Solid.IntrinsicAttributes;
|
|
25
|
+
type ClassList = Solid.ClassList;
|
|
26
|
+
type CustomAttributes<T> = Solid.CustomAttributes<T>;
|
|
27
|
+
type Accessor<T> = Solid.Accessor<T>;
|
|
28
|
+
type Directives = Solid.Directives;
|
|
29
|
+
type DirectiveFunctions = Solid.DirectiveFunctions;
|
|
30
|
+
type ExplicitProperties = Solid.ExplicitProperties;
|
|
31
|
+
type ExplicitAttributes = Solid.ExplicitAttributes;
|
|
32
|
+
type ExplicitBoolAttributes = Solid.ExplicitBoolAttributes;
|
|
33
|
+
type CustomEvents = Solid.CustomEvents;
|
|
34
|
+
type CustomCaptureEvents = Solid.CustomCaptureEvents;
|
|
35
|
+
type DirectiveAttributes = Solid.DirectiveAttributes;
|
|
36
|
+
type DirectiveFunctionAttributes<T> = Solid.DirectiveFunctionAttributes<T>;
|
|
37
|
+
type PropAttributes = Solid.PropAttributes;
|
|
38
|
+
type AttrAttributes = Solid.AttrAttributes;
|
|
39
|
+
type BoolAttributes = Solid.BoolAttributes;
|
|
40
|
+
type OnAttributes<T> = Solid.OnAttributes<T>;
|
|
41
|
+
type OnCaptureAttributes<T> = Solid.OnCaptureAttributes<T>;
|
|
42
|
+
type WindowEventMap<T> = Solid.WindowEventMap<T>;
|
|
43
|
+
type CustomEventHandlersCamelCase<T> = Solid.CustomEventHandlersCamelCase<T>;
|
|
44
|
+
type CustomEventHandlersLowerCase<T> = Solid.CustomEventHandlersLowerCase<T>;
|
|
45
|
+
type CustomEventHandlersNamespaced<T> = Solid.CustomEventHandlersNamespaced<T>;
|
|
46
|
+
type DOMAttributes<T> = Solid.DOMAttributes<T>;
|
|
47
|
+
type CSSProperties = Solid.CSSProperties;
|
|
48
|
+
type HTMLAutocapitalize = Solid.HTMLAutocapitalize;
|
|
49
|
+
type HTMLAutocomplete = Solid.HTMLAutocomplete;
|
|
50
|
+
type HTMLDir = Solid.HTMLDir;
|
|
51
|
+
type HTMLFormEncType = Solid.HTMLFormEncType;
|
|
52
|
+
type HTMLFormMethod = Solid.HTMLFormMethod;
|
|
53
|
+
type HTMLCrossorigin = Solid.HTMLCrossorigin;
|
|
54
|
+
type HTMLReferrerPolicy = Solid.HTMLReferrerPolicy;
|
|
55
|
+
type HTMLIframeSandbox = Solid.HTMLIframeSandbox;
|
|
56
|
+
type HTMLLinkAs = Solid.HTMLLinkAs;
|
|
57
|
+
type AriaAttributes = Solid.AriaAttributes;
|
|
58
|
+
type HTMLAttributes<T> = Solid.HTMLAttributes<T>;
|
|
59
|
+
type AnchorHTMLAttributes<T> = Solid.AnchorHTMLAttributes<T>;
|
|
60
|
+
type AudioHTMLAttributes<T> = Solid.AudioHTMLAttributes<T>;
|
|
61
|
+
type AreaHTMLAttributes<T> = Solid.AreaHTMLAttributes<T>;
|
|
62
|
+
type BaseHTMLAttributes<T> = Solid.BaseHTMLAttributes<T>;
|
|
63
|
+
type BdoHTMLAttributes<T> = Solid.BdoHTMLAttributes<T>;
|
|
64
|
+
type BlockquoteHTMLAttributes<T> = Solid.BlockquoteHTMLAttributes<T>;
|
|
65
|
+
type BodyHTMLAttributes<T> = Solid.BodyHTMLAttributes<T>;
|
|
66
|
+
type ButtonHTMLAttributes<T> = Solid.ButtonHTMLAttributes<T>;
|
|
67
|
+
type CanvasHTMLAttributes<T> = Solid.CanvasHTMLAttributes<T>;
|
|
68
|
+
type CaptionHTMLAttributes<T> = Solid.CaptionHTMLAttributes<T>;
|
|
69
|
+
type ColHTMLAttributes<T> = Solid.ColHTMLAttributes<T>;
|
|
70
|
+
type ColgroupHTMLAttributes<T> = Solid.ColgroupHTMLAttributes<T>;
|
|
71
|
+
type DataHTMLAttributes<T> = Solid.DataHTMLAttributes<T>;
|
|
72
|
+
type DetailsHtmlAttributes<T> = Solid.DetailsHtmlAttributes<T>;
|
|
73
|
+
type DialogHtmlAttributes<T> = Solid.DialogHtmlAttributes<T>;
|
|
74
|
+
type EmbedHTMLAttributes<T> = Solid.EmbedHTMLAttributes<T>;
|
|
75
|
+
type FieldsetHTMLAttributes<T> = Solid.FieldsetHTMLAttributes<T>;
|
|
76
|
+
type FormHTMLAttributes<T> = Solid.FormHTMLAttributes<T>;
|
|
77
|
+
type IframeHTMLAttributes<T> = Solid.IframeHTMLAttributes<T>;
|
|
78
|
+
type ImgHTMLAttributes<T> = Solid.ImgHTMLAttributes<T>;
|
|
79
|
+
type InputHTMLAttributes<T> = Solid.InputHTMLAttributes<T>;
|
|
80
|
+
type ModHTMLAttributes<T> = Solid.ModHTMLAttributes<T>;
|
|
81
|
+
type KeygenHTMLAttributes<T> = Solid.KeygenHTMLAttributes<T>;
|
|
82
|
+
type LabelHTMLAttributes<T> = Solid.LabelHTMLAttributes<T>;
|
|
83
|
+
type LiHTMLAttributes<T> = Solid.LiHTMLAttributes<T>;
|
|
84
|
+
type LinkHTMLAttributes<T> = Solid.LinkHTMLAttributes<T>;
|
|
85
|
+
type MapHTMLAttributes<T> = Solid.MapHTMLAttributes<T>;
|
|
86
|
+
type MediaHTMLAttributes<T> = Solid.MediaHTMLAttributes<T>;
|
|
87
|
+
type MenuHTMLAttributes<T> = Solid.MenuHTMLAttributes<T>;
|
|
88
|
+
type MetaHTMLAttributes<T> = Solid.MetaHTMLAttributes<T>;
|
|
89
|
+
type MeterHTMLAttributes<T> = Solid.MeterHTMLAttributes<T>;
|
|
90
|
+
type QuoteHTMLAttributes<T> = Solid.QuoteHTMLAttributes<T>;
|
|
91
|
+
type ObjectHTMLAttributes<T> = Solid.ObjectHTMLAttributes<T>;
|
|
92
|
+
type OlHTMLAttributes<T> = Solid.OlHTMLAttributes<T>;
|
|
93
|
+
type OptgroupHTMLAttributes<T> = Solid.OptgroupHTMLAttributes<T>;
|
|
94
|
+
type OptionHTMLAttributes<T> = Solid.OptionHTMLAttributes<T>;
|
|
95
|
+
type OutputHTMLAttributes<T> = Solid.OutputHTMLAttributes<T>;
|
|
96
|
+
type ParamHTMLAttributes<T> = Solid.ParamHTMLAttributes<T>;
|
|
97
|
+
type ProgressHTMLAttributes<T> = Solid.ProgressHTMLAttributes<T>;
|
|
98
|
+
type ScriptHTMLAttributes<T> = Solid.ScriptHTMLAttributes<T>;
|
|
99
|
+
type SelectHTMLAttributes<T> = Solid.SelectHTMLAttributes<T>;
|
|
100
|
+
type HTMLSlotElementAttributes<T> = Solid.HTMLSlotElementAttributes<T>;
|
|
101
|
+
type SourceHTMLAttributes<T> = Solid.SourceHTMLAttributes<T>;
|
|
102
|
+
type StyleHTMLAttributes<T> = Solid.StyleHTMLAttributes<T>;
|
|
103
|
+
type TdHTMLAttributes<T> = Solid.TdHTMLAttributes<T>;
|
|
104
|
+
type TemplateHTMLAttributes<T> = Solid.TemplateHTMLAttributes<T>;
|
|
105
|
+
type TextareaHTMLAttributes<T> = Solid.TextareaHTMLAttributes<T>;
|
|
106
|
+
type ThHTMLAttributes<T> = Solid.ThHTMLAttributes<T>;
|
|
107
|
+
type TimeHTMLAttributes<T> = Solid.TimeHTMLAttributes<T>;
|
|
108
|
+
type TrackHTMLAttributes<T> = Solid.TrackHTMLAttributes<T>;
|
|
109
|
+
type VideoHTMLAttributes<T> = Solid.VideoHTMLAttributes<T>;
|
|
110
|
+
type WebViewHTMLAttributes<T> = Solid.WebViewHTMLAttributes<T>;
|
|
111
|
+
type SVGPreserveAspectRatio = Solid.SVGPreserveAspectRatio;
|
|
112
|
+
type ImagePreserveAspectRatio = Solid.ImagePreserveAspectRatio;
|
|
113
|
+
type SVGUnits = Solid.SVGUnits;
|
|
114
|
+
type CoreSVGAttributes<T> = Solid.CoreSVGAttributes<T>;
|
|
115
|
+
type StylableSVGAttributes = Solid.StylableSVGAttributes;
|
|
116
|
+
type TransformableSVGAttributes = Solid.TransformableSVGAttributes;
|
|
117
|
+
type ConditionalProcessingSVGAttributes = Solid.ConditionalProcessingSVGAttributes;
|
|
118
|
+
type ExternalResourceSVGAttributes = Solid.ExternalResourceSVGAttributes;
|
|
119
|
+
type AnimationTimingSVGAttributes = Solid.AnimationTimingSVGAttributes;
|
|
120
|
+
type AnimationValueSVGAttributes = Solid.AnimationValueSVGAttributes;
|
|
121
|
+
type AnimationAdditionSVGAttributes = Solid.AnimationAdditionSVGAttributes;
|
|
122
|
+
type AnimationAttributeTargetSVGAttributes = Solid.AnimationAttributeTargetSVGAttributes;
|
|
123
|
+
type PresentationSVGAttributes = Solid.PresentationSVGAttributes;
|
|
124
|
+
type AnimationElementSVGAttributes<T> = Solid.AnimationElementSVGAttributes<T>;
|
|
125
|
+
type ContainerElementSVGAttributes<T> = Solid.ContainerElementSVGAttributes<T>;
|
|
126
|
+
type FilterPrimitiveElementSVGAttributes<T> = Solid.FilterPrimitiveElementSVGAttributes<T>;
|
|
127
|
+
type SingleInputFilterSVGAttributes = Solid.SingleInputFilterSVGAttributes;
|
|
128
|
+
type DoubleInputFilterSVGAttributes = Solid.DoubleInputFilterSVGAttributes;
|
|
129
|
+
type FitToViewBoxSVGAttributes = Solid.FitToViewBoxSVGAttributes;
|
|
130
|
+
type GradientElementSVGAttributes<T> = Solid.GradientElementSVGAttributes<T>;
|
|
131
|
+
type GraphicsElementSVGAttributes<T> = Solid.GraphicsElementSVGAttributes<T>;
|
|
132
|
+
type LightSourceElementSVGAttributes<T> = Solid.LightSourceElementSVGAttributes<T>;
|
|
133
|
+
type NewViewportSVGAttributes<T> = Solid.NewViewportSVGAttributes<T>;
|
|
134
|
+
type ShapeElementSVGAttributes<T> = Solid.ShapeElementSVGAttributes<T>;
|
|
135
|
+
type TextContentElementSVGAttributes<T> = Solid.TextContentElementSVGAttributes<T>;
|
|
136
|
+
type ZoomAndPanSVGAttributes = Solid.ZoomAndPanSVGAttributes;
|
|
137
|
+
type AnimateSVGAttributes<T> = Solid.AnimateSVGAttributes<T>;
|
|
138
|
+
type AnimateMotionSVGAttributes<T> = Solid.AnimateMotionSVGAttributes<T>;
|
|
139
|
+
type AnimateTransformSVGAttributes<T> = Solid.AnimateTransformSVGAttributes<T>;
|
|
140
|
+
type CircleSVGAttributes<T> = Solid.CircleSVGAttributes<T>;
|
|
141
|
+
type ClipPathSVGAttributes<T> = Solid.ClipPathSVGAttributes<T>;
|
|
142
|
+
type DefsSVGAttributes<T> = Solid.DefsSVGAttributes<T>;
|
|
143
|
+
type DescSVGAttributes<T> = Solid.DescSVGAttributes<T>;
|
|
144
|
+
type EllipseSVGAttributes<T> = Solid.EllipseSVGAttributes<T>;
|
|
145
|
+
type FeBlendSVGAttributes<T> = Solid.FeBlendSVGAttributes<T>;
|
|
146
|
+
type FeColorMatrixSVGAttributes<T> = Solid.FeColorMatrixSVGAttributes<T>;
|
|
147
|
+
type FeComponentTransferSVGAttributes<T> = Solid.FeComponentTransferSVGAttributes<T>;
|
|
148
|
+
type FeCompositeSVGAttributes<T> = Solid.FeCompositeSVGAttributes<T>;
|
|
149
|
+
type FeConvolveMatrixSVGAttributes<T> = Solid.FeConvolveMatrixSVGAttributes<T>;
|
|
150
|
+
type FeDiffuseLightingSVGAttributes<T> = Solid.FeDiffuseLightingSVGAttributes<T>;
|
|
151
|
+
type FeDisplacementMapSVGAttributes<T> = Solid.FeDisplacementMapSVGAttributes<T>;
|
|
152
|
+
type FeDistantLightSVGAttributes<T> = Solid.FeDistantLightSVGAttributes<T>;
|
|
153
|
+
type FeDropShadowSVGAttributes<T> = Solid.FeDropShadowSVGAttributes<T>;
|
|
154
|
+
type FeFloodSVGAttributes<T> = Solid.FeFloodSVGAttributes<T>;
|
|
155
|
+
type FeFuncSVGAttributes<T> = Solid.FeFuncSVGAttributes<T>;
|
|
156
|
+
type FeGaussianBlurSVGAttributes<T> = Solid.FeGaussianBlurSVGAttributes<T>;
|
|
157
|
+
type FeImageSVGAttributes<T> = Solid.FeImageSVGAttributes<T>;
|
|
158
|
+
type FeMergeSVGAttributes<T> = Solid.FeMergeSVGAttributes<T>;
|
|
159
|
+
type FeMergeNodeSVGAttributes<T> = Solid.FeMergeNodeSVGAttributes<T>;
|
|
160
|
+
type FeMorphologySVGAttributes<T> = Solid.FeMorphologySVGAttributes<T>;
|
|
161
|
+
type FeOffsetSVGAttributes<T> = Solid.FeOffsetSVGAttributes<T>;
|
|
162
|
+
type FePointLightSVGAttributes<T> = Solid.FePointLightSVGAttributes<T>;
|
|
163
|
+
type FeSpecularLightingSVGAttributes<T> = Solid.FeSpecularLightingSVGAttributes<T>;
|
|
164
|
+
type FeSpotLightSVGAttributes<T> = Solid.FeSpotLightSVGAttributes<T>;
|
|
165
|
+
type FeTileSVGAttributes<T> = Solid.FeTileSVGAttributes<T>;
|
|
166
|
+
type FeTurbulanceSVGAttributes<T> = Solid.FeTurbulanceSVGAttributes<T>;
|
|
167
|
+
type FilterSVGAttributes<T> = Solid.FilterSVGAttributes<T>;
|
|
168
|
+
type ForeignObjectSVGAttributes<T> = Solid.ForeignObjectSVGAttributes<T>;
|
|
169
|
+
type GSVGAttributes<T> = Solid.GSVGAttributes<T>;
|
|
170
|
+
type ImageSVGAttributes<T> = Solid.ImageSVGAttributes<T>;
|
|
171
|
+
type LineSVGAttributes<T> = Solid.LineSVGAttributes<T>;
|
|
172
|
+
type LinearGradientSVGAttributes<T> = Solid.LinearGradientSVGAttributes<T>;
|
|
173
|
+
type MarkerSVGAttributes<T> = Solid.MarkerSVGAttributes<T>;
|
|
174
|
+
type MaskSVGAttributes<T> = Solid.MaskSVGAttributes<T>;
|
|
175
|
+
type MetadataSVGAttributes<T> = Solid.MetadataSVGAttributes<T>;
|
|
176
|
+
type MPathSVGAttributes<T> = Solid.MPathSVGAttributes<T>;
|
|
177
|
+
type PathSVGAttributes<T> = Solid.PathSVGAttributes<T>;
|
|
178
|
+
type PatternSVGAttributes<T> = Solid.PatternSVGAttributes<T>;
|
|
179
|
+
type PolygonSVGAttributes<T> = Solid.PolygonSVGAttributes<T>;
|
|
180
|
+
type PolylineSVGAttributes<T> = Solid.PolylineSVGAttributes<T>;
|
|
181
|
+
type RadialGradientSVGAttributes<T> = Solid.RadialGradientSVGAttributes<T>;
|
|
182
|
+
type RectSVGAttributes<T> = Solid.RectSVGAttributes<T>;
|
|
183
|
+
type SetSVGAttributes<T> = Solid.SetSVGAttributes<T>;
|
|
184
|
+
type StopSVGAttributes<T> = Solid.StopSVGAttributes<T>;
|
|
185
|
+
type SvgSVGAttributes<T> = Solid.SvgSVGAttributes<T>;
|
|
186
|
+
type SwitchSVGAttributes<T> = Solid.SwitchSVGAttributes<T>;
|
|
187
|
+
type SymbolSVGAttributes<T> = Solid.SymbolSVGAttributes<T>;
|
|
188
|
+
type TextSVGAttributes<T> = Solid.TextSVGAttributes<T>;
|
|
189
|
+
type TextPathSVGAttributes<T> = Solid.TextPathSVGAttributes<T>;
|
|
190
|
+
type TSpanSVGAttributes<T> = Solid.TSpanSVGAttributes<T>;
|
|
191
|
+
type UseSVGAttributes<T> = Solid.UseSVGAttributes<T>;
|
|
192
|
+
type ViewSVGAttributes<T> = Solid.ViewSVGAttributes<T>;
|
|
193
|
+
type MathMLAttributes<T> = Solid.MathMLAttributes<T>;
|
|
194
|
+
type MathMLAnnotationElementAttributes<T> = Solid.MathMLAnnotationElementAttributes<T>;
|
|
195
|
+
type MathMLAnnotationXmlElementAttributes<T> = Solid.MathMLAnnotationXmlElementAttributes<T>;
|
|
196
|
+
type MathMLMactionElementAttributes<T> = Solid.MathMLMactionElementAttributes<T>;
|
|
197
|
+
type MathMLMathElementAttributes<T> = Solid.MathMLMathElementAttributes<T>;
|
|
198
|
+
type MathMLMerrorElementAttributes<T> = Solid.MathMLMerrorElementAttributes<T>;
|
|
199
|
+
type MathMLMfracElementAttributes<T> = Solid.MathMLMfracElementAttributes<T>;
|
|
200
|
+
type MathMLMiElementAttributes<T> = Solid.MathMLMiElementAttributes<T>;
|
|
201
|
+
type MathMLMmultiscriptsElementAttributes<T> = Solid.MathMLMmultiscriptsElementAttributes<T>;
|
|
202
|
+
type MathMLMnElementAttributes<T> = Solid.MathMLMnElementAttributes<T>;
|
|
203
|
+
type MathMLMoElementAttributes<T> = Solid.MathMLMoElementAttributes<T>;
|
|
204
|
+
type MathMLMoverElementAttributes<T> = Solid.MathMLMoverElementAttributes<T>;
|
|
205
|
+
type MathMLMpaddedElementAttributes<T> = Solid.MathMLMpaddedElementAttributes<T>;
|
|
206
|
+
type MathMLMphantomElementAttributes<T> = Solid.MathMLMphantomElementAttributes<T>;
|
|
207
|
+
type MathMLMprescriptsElementAttributes<T> = Solid.MathMLMprescriptsElementAttributes<T>;
|
|
208
|
+
type MathMLMrootElementAttributes<T> = Solid.MathMLMrootElementAttributes<T>;
|
|
209
|
+
type MathMLMrowElementAttributes<T> = Solid.MathMLMrowElementAttributes<T>;
|
|
210
|
+
type MathMLMsElementAttributes<T> = Solid.MathMLMsElementAttributes<T>;
|
|
211
|
+
type MathMLMspaceElementAttributes<T> = Solid.MathMLMspaceElementAttributes<T>;
|
|
212
|
+
type MathMLMsqrtElementAttributes<T> = Solid.MathMLMsqrtElementAttributes<T>;
|
|
213
|
+
type MathMLMstyleElementAttributes<T> = Solid.MathMLMstyleElementAttributes<T>;
|
|
214
|
+
type MathMLMsubElementAttributes<T> = Solid.MathMLMsubElementAttributes<T>;
|
|
215
|
+
type MathMLMsubsupElementAttributes<T> = Solid.MathMLMsubsupElementAttributes<T>;
|
|
216
|
+
type MathMLMsupElementAttributes<T> = Solid.MathMLMsupElementAttributes<T>;
|
|
217
|
+
type MathMLMtableElementAttributes<T> = Solid.MathMLMtableElementAttributes<T>;
|
|
218
|
+
type MathMLMtdElementAttributes<T> = Solid.MathMLMtdElementAttributes<T>;
|
|
219
|
+
type MathMLMtextElementAttributes<T> = Solid.MathMLMtextElementAttributes<T>;
|
|
220
|
+
type MathMLMtrElementAttributes<T> = Solid.MathMLMtrElementAttributes<T>;
|
|
221
|
+
type MathMLMunderElementAttributes<T> = Solid.MathMLMunderElementAttributes<T>;
|
|
222
|
+
type MathMLMunderoverElementAttributes<T> = Solid.MathMLMunderoverElementAttributes<T>;
|
|
223
|
+
type MathMLSemanticsElementAttributes<T> = Solid.MathMLSemanticsElementAttributes<T>;
|
|
224
|
+
type MathMLMencloseElementAttributes<T> = Solid.MathMLMencloseElementAttributes<T>;
|
|
225
|
+
type MathMLMfencedElementAttributes<T> = Solid.MathMLMfencedElementAttributes<T>;
|
|
226
|
+
type HTMLElementTags = Solid.HTMLElementTags;
|
|
227
|
+
type HTMLElementDeprecatedTags = Solid.HTMLElementDeprecatedTags;
|
|
228
|
+
type SVGElementTags = Solid.SVGElementTags;
|
|
229
|
+
type MathMLElementTags = Solid.MathMLElementTags;
|
|
230
|
+
type IntrinsicElements = Solid.IntrinsicElements;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* `<>` and `<Fragment>`, as `solid-js/h/jsx-runtime` types it. Always an
|
|
234
|
+
* array, so a single child that is a script stays a child, read where it
|
|
235
|
+
* stands, rather than a script the fragment drew.
|
|
236
|
+
*/
|
|
237
|
+
export declare function Fragment(props: {
|
|
238
|
+
children?: unknown;
|
|
239
|
+
}): Client<Solid.Element>;
|
|
240
|
+
export declare function jsx(type: JSX.ElementType, props: unknown): Client<Solid.Element>;
|
|
241
|
+
export declare const jsxs: typeof jsx;
|
|
242
|
+
export declare const jsxDEV: typeof jsx;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createJsxElement, cs, } from "@backtickjs/core";
|
|
2
|
+
const createComponent = { "@backtickjs": "ClientImport", name: "createComponent", from: "solid-js", version: "1.9.14" };
|
|
3
|
+
const $module0 = {
|
|
4
|
+
id: "25mdzlh7035ld:352:9",
|
|
5
|
+
code: "(module, exports, require) => {\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = (($splice0, $splice1) => $splice0()(() => $splice1(), {}));\n}",
|
|
6
|
+
map: "{\"version\":3,\"file\":\"module.jsx\",\"mappings\":\";;;mBA+VY,kCAAgB,CAAC,GAAG,EAAE,CAAC,UAAQ,EAAE,EAAE,CAAC\",\"names\":[],\"ignoreList\":[],\"sources\":[\"@backtickjs/jsx-solid/src/jsx-runtime.ts\"]}",
|
|
7
|
+
dependencies: [],
|
|
8
|
+
params: [{ kind: "splice", bindings: [] }, { kind: "splice", bindings: [] }],
|
|
9
|
+
kind: "expression"
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* `<>` and `<Fragment>`, as `solid-js/h/jsx-runtime` types it. Always an
|
|
13
|
+
* array, so a single child that is a script stays a child, read where it
|
|
14
|
+
* stands, rather than a script the fragment drew.
|
|
15
|
+
*/
|
|
16
|
+
export function Fragment(props) {
|
|
17
|
+
// The bundler writes the array as it is: a Solid array element.
|
|
18
|
+
return [props.children];
|
|
19
|
+
}
|
|
20
|
+
// A component, run on the client as Solid runs one, through `createComponent`:
|
|
21
|
+
// untracked, so what it reads while it sets up doesn't build it again where it
|
|
22
|
+
// stands.
|
|
23
|
+
export function jsx(type, props) {
|
|
24
|
+
// Core's element, as this package types it: a stand-in for a Solid element.
|
|
25
|
+
const element = createJsxElement(type, props);
|
|
26
|
+
return cs.create($module0, [createComponent, element]);
|
|
27
|
+
}
|
|
28
|
+
export const jsxs = jsx;
|
|
29
|
+
// What a development build of the JSX transform calls, as Bun does.
|
|
30
|
+
export const jsxDEV = jsx;
|
|
31
|
+
//# sourceMappingURL=jsx-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.js","sourceRoot":"","sources":["../src/jsx-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,EAAE,GAIH,MAAM,kBAAkB,CAAC;;;;;;;;;;AAsU1B;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,KAA6B;IACpD,gEAAgE;IAChE,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAqC,CAAC;AAC9D,CAAC;AAED,+EAA+E;AAC/E,+EAA+E;AAC/E,UAAU;AACV,MAAM,UAAU,GAAG,CACjB,IAAqB,EACrB,KAAc;IAEd,4EAA4E;IAC5E,MAAM,OAAO,GAAG,gBAAgB,CAAC,IAAI,EAAE,KAAK,CAA0B,CAAC;IACvE,uDAAgD;AAClD,CAAC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAC;AACxB,oEAAoE;AACpE,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Solid's compiler as a build's compile step: a script's module, its JSX as
|
|
3
|
+
* Solid's template and DOM code, importing from `solid-js/web`. Typed by its
|
|
4
|
+
* shape, which is the compiler's `Plugin`, so this package needn't depend on the
|
|
5
|
+
* compiler.
|
|
6
|
+
*/
|
|
7
|
+
export declare function solid(): (code: string, id: string) => {
|
|
8
|
+
code: string;
|
|
9
|
+
map: string;
|
|
10
|
+
};
|
|
11
|
+
export default solid;
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { transformSync } from "@babel/core";
|
|
2
|
+
import preset from "babel-preset-solid";
|
|
3
|
+
/**
|
|
4
|
+
* Solid's compiler as a build's compile step: a script's module, its JSX as
|
|
5
|
+
* Solid's template and DOM code, importing from `solid-js/web`. Typed by its
|
|
6
|
+
* shape, which is the compiler's `Plugin`, so this package needn't depend on the
|
|
7
|
+
* compiler.
|
|
8
|
+
*/
|
|
9
|
+
export function solid() {
|
|
10
|
+
return (code, id) => {
|
|
11
|
+
const result = transformSync(code, {
|
|
12
|
+
filename: id,
|
|
13
|
+
babelrc: false,
|
|
14
|
+
configFile: false,
|
|
15
|
+
sourceMaps: true,
|
|
16
|
+
presets: [[preset, { moduleName: "solid-js/web", generate: "dom" }]],
|
|
17
|
+
});
|
|
18
|
+
return { code: result.code, map: JSON.stringify(result.map) };
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
// What a project names to compile its scripts for Solid, in its `package.json`:
|
|
22
|
+
// `"backtick": { "plugins": ["@backtickjs/jsx-solid/plugin"] }`.
|
|
23
|
+
export default solid;
|
|
24
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC;;;;;GAKG;AACH,MAAM,UAAU,KAAK;IAInB,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;QAClB,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,EAAE;YACjC,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,KAAK;YACd,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;SACrE,CAAE,CAAC;QACJ,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAK,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACjE,CAAC,CAAC;AACJ,CAAC;AAED,gFAAgF;AAChF,iEAAiE;AACjE,eAAe,KAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,81 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backtickjs/jsx-solid",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Solid's JSX for Backtick: a JSX runtime for server components, and the compile plugin for scripts",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"backtick",
|
|
7
|
+
"react-native",
|
|
8
|
+
"server-driven-ui",
|
|
9
|
+
"server-components",
|
|
10
|
+
"solid",
|
|
11
|
+
"solid-js",
|
|
12
|
+
"jsx-runtime"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://backtickjs.com",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/backtickjs/backtick/issues"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/backtickjs/backtick.git",
|
|
21
|
+
"directory": "packages/jsx-solid"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"author": "Jean-François Bisson <jf@backtickjs.com>",
|
|
25
|
+
"type": "module",
|
|
26
|
+
"exports": {
|
|
27
|
+
"./jsx-runtime": {
|
|
28
|
+
"types": "./dist/jsx-runtime.d.ts",
|
|
29
|
+
"default": "./dist/jsx-runtime.js"
|
|
30
|
+
},
|
|
31
|
+
"./jsx-dev-runtime": {
|
|
32
|
+
"types": "./dist/jsx-runtime.d.ts",
|
|
33
|
+
"default": "./dist/jsx-runtime.js"
|
|
34
|
+
},
|
|
35
|
+
"./plugin": {
|
|
36
|
+
"types": "./dist/plugin.d.ts",
|
|
37
|
+
"default": "./dist/plugin.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"!dist/._cache",
|
|
43
|
+
"src"
|
|
44
|
+
],
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@babel/core": "^7.29.7",
|
|
50
|
+
"@backtickjs/core": "^0.2.0",
|
|
51
|
+
"babel-preset-solid": "1.9.12"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"solid-js": "^1.9.14"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@backtickjs/prettier-plugin": "^0.2.0",
|
|
58
|
+
"@backtickjs/tsc": "^0.2.0",
|
|
59
|
+
"@backtickjs/tspatch-plugin": "^0.2.0",
|
|
60
|
+
"@types/babel__core": "^7.20.5",
|
|
61
|
+
"prettier": "^3.6.2",
|
|
62
|
+
"solid-js": "1.9.14",
|
|
63
|
+
"ts-patch": "^4.0.1",
|
|
64
|
+
"typescript": "^6.0.3"
|
|
65
|
+
},
|
|
66
|
+
"peerDependenciesMeta": {},
|
|
67
|
+
"prettier": {
|
|
68
|
+
"plugins": [
|
|
69
|
+
"@backtickjs/prettier-plugin"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"scripts": {
|
|
73
|
+
"typecheck": "backtick-tsc -p tsconfig.build.json --noEmit",
|
|
74
|
+
"build": "tspc -b --noCheck --force",
|
|
75
|
+
"dev": "tspc -b --noCheck --watch",
|
|
76
|
+
"test": "node --conditions=browser --test \"test/**/*.test.ts\"",
|
|
77
|
+
"format": "prettier --write --ignore-unknown .",
|
|
78
|
+
"format:check": "prettier --check --ignore-unknown .",
|
|
79
|
+
"clean": "rm -rf node_modules dist .turbo"
|
|
80
|
+
}
|
|
6
81
|
}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createJsxElement,
|
|
3
|
+
cs,
|
|
4
|
+
type Client,
|
|
5
|
+
type JsxElementOf,
|
|
6
|
+
type JsxElementTypeOf,
|
|
7
|
+
} from "@backtickjs/core";
|
|
8
|
+
import type { JSX as Solid } from "solid-js";
|
|
9
|
+
import { createComponent } from "solid-js" with { backtick: "client" };
|
|
10
|
+
|
|
11
|
+
export declare namespace JSX {
|
|
12
|
+
export type FunctionMaybe<T = unknown> = Solid.FunctionMaybe<T>;
|
|
13
|
+
export type FunctionElement = Solid.FunctionElement;
|
|
14
|
+
export type Element = JsxElementOf<Solid.Element>;
|
|
15
|
+
export type ElementType = JsxElementTypeOf<Solid.Element>;
|
|
16
|
+
export type ArrayElement = Solid.ArrayElement;
|
|
17
|
+
export type ElementClass = Solid.ElementClass;
|
|
18
|
+
export type ElementAttributesProperty = Solid.ElementAttributesProperty;
|
|
19
|
+
export type ElementChildrenAttribute = Solid.ElementChildrenAttribute;
|
|
20
|
+
export type EventHandler<T, E extends Event> = Solid.EventHandler<T, E>;
|
|
21
|
+
export type BoundEventHandler<
|
|
22
|
+
T,
|
|
23
|
+
E extends Event,
|
|
24
|
+
EHandler extends EventHandler<T, any> = EventHandler<T, E>,
|
|
25
|
+
> = Solid.BoundEventHandler<T, E, EHandler>;
|
|
26
|
+
export type EventHandlerUnion<
|
|
27
|
+
T,
|
|
28
|
+
E extends Event,
|
|
29
|
+
EHandler extends EventHandler<T, any> = EventHandler<T, E>,
|
|
30
|
+
> = Solid.EventHandlerUnion<T, E, EHandler>;
|
|
31
|
+
export type EventHandlerWithOptions<
|
|
32
|
+
T,
|
|
33
|
+
E extends Event,
|
|
34
|
+
EHandler = EventHandler<T, E>,
|
|
35
|
+
> = Solid.EventHandlerWithOptions<T, E, EHandler>;
|
|
36
|
+
export type EventHandlerWithOptionsUnion<
|
|
37
|
+
T,
|
|
38
|
+
E extends Event,
|
|
39
|
+
EHandler extends EventHandler<T, any> = EventHandler<T, E>,
|
|
40
|
+
> = Solid.EventHandlerWithOptionsUnion<T, E, EHandler>;
|
|
41
|
+
export type InputEventHandler<
|
|
42
|
+
T,
|
|
43
|
+
E extends InputEvent,
|
|
44
|
+
> = Solid.InputEventHandler<T, E>;
|
|
45
|
+
export type InputEventHandlerUnion<
|
|
46
|
+
T,
|
|
47
|
+
E extends InputEvent,
|
|
48
|
+
> = Solid.InputEventHandlerUnion<T, E>;
|
|
49
|
+
export type ChangeEventHandler<T, E extends Event> = Solid.ChangeEventHandler<
|
|
50
|
+
T,
|
|
51
|
+
E
|
|
52
|
+
>;
|
|
53
|
+
export type ChangeEventHandlerUnion<
|
|
54
|
+
T,
|
|
55
|
+
E extends Event,
|
|
56
|
+
> = Solid.ChangeEventHandlerUnion<T, E>;
|
|
57
|
+
export type FocusEventHandler<
|
|
58
|
+
T,
|
|
59
|
+
E extends FocusEvent,
|
|
60
|
+
> = Solid.FocusEventHandler<T, E>;
|
|
61
|
+
export type FocusEventHandlerUnion<
|
|
62
|
+
T,
|
|
63
|
+
E extends FocusEvent,
|
|
64
|
+
> = Solid.FocusEventHandlerUnion<T, E>;
|
|
65
|
+
export type SerializableAttributeValue = Solid.SerializableAttributeValue;
|
|
66
|
+
export type IntrinsicAttributes = Solid.IntrinsicAttributes;
|
|
67
|
+
export type ClassList = Solid.ClassList;
|
|
68
|
+
export type CustomAttributes<T> = Solid.CustomAttributes<T>;
|
|
69
|
+
export type Accessor<T> = Solid.Accessor<T>;
|
|
70
|
+
export type Directives = Solid.Directives;
|
|
71
|
+
export type DirectiveFunctions = Solid.DirectiveFunctions;
|
|
72
|
+
export type ExplicitProperties = Solid.ExplicitProperties;
|
|
73
|
+
export type ExplicitAttributes = Solid.ExplicitAttributes;
|
|
74
|
+
export type ExplicitBoolAttributes = Solid.ExplicitBoolAttributes;
|
|
75
|
+
export type CustomEvents = Solid.CustomEvents;
|
|
76
|
+
export type CustomCaptureEvents = Solid.CustomCaptureEvents;
|
|
77
|
+
export type DirectiveAttributes = Solid.DirectiveAttributes;
|
|
78
|
+
export type DirectiveFunctionAttributes<T> =
|
|
79
|
+
Solid.DirectiveFunctionAttributes<T>;
|
|
80
|
+
export type PropAttributes = Solid.PropAttributes;
|
|
81
|
+
export type AttrAttributes = Solid.AttrAttributes;
|
|
82
|
+
export type BoolAttributes = Solid.BoolAttributes;
|
|
83
|
+
export type OnAttributes<T> = Solid.OnAttributes<T>;
|
|
84
|
+
export type OnCaptureAttributes<T> = Solid.OnCaptureAttributes<T>;
|
|
85
|
+
export type WindowEventMap<T> = Solid.WindowEventMap<T>;
|
|
86
|
+
export type CustomEventHandlersCamelCase<T> =
|
|
87
|
+
Solid.CustomEventHandlersCamelCase<T>;
|
|
88
|
+
export type CustomEventHandlersLowerCase<T> =
|
|
89
|
+
Solid.CustomEventHandlersLowerCase<T>;
|
|
90
|
+
export type CustomEventHandlersNamespaced<T> =
|
|
91
|
+
Solid.CustomEventHandlersNamespaced<T>;
|
|
92
|
+
export type DOMAttributes<T> = Solid.DOMAttributes<T>;
|
|
93
|
+
export type CSSProperties = Solid.CSSProperties;
|
|
94
|
+
export type HTMLAutocapitalize = Solid.HTMLAutocapitalize;
|
|
95
|
+
export type HTMLAutocomplete = Solid.HTMLAutocomplete;
|
|
96
|
+
export type HTMLDir = Solid.HTMLDir;
|
|
97
|
+
export type HTMLFormEncType = Solid.HTMLFormEncType;
|
|
98
|
+
export type HTMLFormMethod = Solid.HTMLFormMethod;
|
|
99
|
+
export type HTMLCrossorigin = Solid.HTMLCrossorigin;
|
|
100
|
+
export type HTMLReferrerPolicy = Solid.HTMLReferrerPolicy;
|
|
101
|
+
export type HTMLIframeSandbox = Solid.HTMLIframeSandbox;
|
|
102
|
+
export type HTMLLinkAs = Solid.HTMLLinkAs;
|
|
103
|
+
export type AriaAttributes = Solid.AriaAttributes;
|
|
104
|
+
export type HTMLAttributes<T> = Solid.HTMLAttributes<T>;
|
|
105
|
+
export type AnchorHTMLAttributes<T> = Solid.AnchorHTMLAttributes<T>;
|
|
106
|
+
export type AudioHTMLAttributes<T> = Solid.AudioHTMLAttributes<T>;
|
|
107
|
+
export type AreaHTMLAttributes<T> = Solid.AreaHTMLAttributes<T>;
|
|
108
|
+
export type BaseHTMLAttributes<T> = Solid.BaseHTMLAttributes<T>;
|
|
109
|
+
export type BdoHTMLAttributes<T> = Solid.BdoHTMLAttributes<T>;
|
|
110
|
+
export type BlockquoteHTMLAttributes<T> = Solid.BlockquoteHTMLAttributes<T>;
|
|
111
|
+
export type BodyHTMLAttributes<T> = Solid.BodyHTMLAttributes<T>;
|
|
112
|
+
export type ButtonHTMLAttributes<T> = Solid.ButtonHTMLAttributes<T>;
|
|
113
|
+
export type CanvasHTMLAttributes<T> = Solid.CanvasHTMLAttributes<T>;
|
|
114
|
+
export type CaptionHTMLAttributes<T> = Solid.CaptionHTMLAttributes<T>;
|
|
115
|
+
export type ColHTMLAttributes<T> = Solid.ColHTMLAttributes<T>;
|
|
116
|
+
export type ColgroupHTMLAttributes<T> = Solid.ColgroupHTMLAttributes<T>;
|
|
117
|
+
export type DataHTMLAttributes<T> = Solid.DataHTMLAttributes<T>;
|
|
118
|
+
export type DetailsHtmlAttributes<T> = Solid.DetailsHtmlAttributes<T>;
|
|
119
|
+
export type DialogHtmlAttributes<T> = Solid.DialogHtmlAttributes<T>;
|
|
120
|
+
export type EmbedHTMLAttributes<T> = Solid.EmbedHTMLAttributes<T>;
|
|
121
|
+
export type FieldsetHTMLAttributes<T> = Solid.FieldsetHTMLAttributes<T>;
|
|
122
|
+
export type FormHTMLAttributes<T> = Solid.FormHTMLAttributes<T>;
|
|
123
|
+
export type IframeHTMLAttributes<T> = Solid.IframeHTMLAttributes<T>;
|
|
124
|
+
export type ImgHTMLAttributes<T> = Solid.ImgHTMLAttributes<T>;
|
|
125
|
+
export type InputHTMLAttributes<T> = Solid.InputHTMLAttributes<T>;
|
|
126
|
+
export type ModHTMLAttributes<T> = Solid.ModHTMLAttributes<T>;
|
|
127
|
+
export type KeygenHTMLAttributes<T> = Solid.KeygenHTMLAttributes<T>;
|
|
128
|
+
export type LabelHTMLAttributes<T> = Solid.LabelHTMLAttributes<T>;
|
|
129
|
+
export type LiHTMLAttributes<T> = Solid.LiHTMLAttributes<T>;
|
|
130
|
+
export type LinkHTMLAttributes<T> = Solid.LinkHTMLAttributes<T>;
|
|
131
|
+
export type MapHTMLAttributes<T> = Solid.MapHTMLAttributes<T>;
|
|
132
|
+
export type MediaHTMLAttributes<T> = Solid.MediaHTMLAttributes<T>;
|
|
133
|
+
export type MenuHTMLAttributes<T> = Solid.MenuHTMLAttributes<T>;
|
|
134
|
+
export type MetaHTMLAttributes<T> = Solid.MetaHTMLAttributes<T>;
|
|
135
|
+
export type MeterHTMLAttributes<T> = Solid.MeterHTMLAttributes<T>;
|
|
136
|
+
export type QuoteHTMLAttributes<T> = Solid.QuoteHTMLAttributes<T>;
|
|
137
|
+
export type ObjectHTMLAttributes<T> = Solid.ObjectHTMLAttributes<T>;
|
|
138
|
+
export type OlHTMLAttributes<T> = Solid.OlHTMLAttributes<T>;
|
|
139
|
+
export type OptgroupHTMLAttributes<T> = Solid.OptgroupHTMLAttributes<T>;
|
|
140
|
+
export type OptionHTMLAttributes<T> = Solid.OptionHTMLAttributes<T>;
|
|
141
|
+
export type OutputHTMLAttributes<T> = Solid.OutputHTMLAttributes<T>;
|
|
142
|
+
export type ParamHTMLAttributes<T> = Solid.ParamHTMLAttributes<T>;
|
|
143
|
+
export type ProgressHTMLAttributes<T> = Solid.ProgressHTMLAttributes<T>;
|
|
144
|
+
export type ScriptHTMLAttributes<T> = Solid.ScriptHTMLAttributes<T>;
|
|
145
|
+
export type SelectHTMLAttributes<T> = Solid.SelectHTMLAttributes<T>;
|
|
146
|
+
export type HTMLSlotElementAttributes<T> = Solid.HTMLSlotElementAttributes<T>;
|
|
147
|
+
export type SourceHTMLAttributes<T> = Solid.SourceHTMLAttributes<T>;
|
|
148
|
+
export type StyleHTMLAttributes<T> = Solid.StyleHTMLAttributes<T>;
|
|
149
|
+
export type TdHTMLAttributes<T> = Solid.TdHTMLAttributes<T>;
|
|
150
|
+
export type TemplateHTMLAttributes<T> = Solid.TemplateHTMLAttributes<T>;
|
|
151
|
+
export type TextareaHTMLAttributes<T> = Solid.TextareaHTMLAttributes<T>;
|
|
152
|
+
export type ThHTMLAttributes<T> = Solid.ThHTMLAttributes<T>;
|
|
153
|
+
export type TimeHTMLAttributes<T> = Solid.TimeHTMLAttributes<T>;
|
|
154
|
+
export type TrackHTMLAttributes<T> = Solid.TrackHTMLAttributes<T>;
|
|
155
|
+
export type VideoHTMLAttributes<T> = Solid.VideoHTMLAttributes<T>;
|
|
156
|
+
export type WebViewHTMLAttributes<T> = Solid.WebViewHTMLAttributes<T>;
|
|
157
|
+
export type SVGPreserveAspectRatio = Solid.SVGPreserveAspectRatio;
|
|
158
|
+
export type ImagePreserveAspectRatio = Solid.ImagePreserveAspectRatio;
|
|
159
|
+
export type SVGUnits = Solid.SVGUnits;
|
|
160
|
+
export type CoreSVGAttributes<T> = Solid.CoreSVGAttributes<T>;
|
|
161
|
+
export type StylableSVGAttributes = Solid.StylableSVGAttributes;
|
|
162
|
+
export type TransformableSVGAttributes = Solid.TransformableSVGAttributes;
|
|
163
|
+
export type ConditionalProcessingSVGAttributes =
|
|
164
|
+
Solid.ConditionalProcessingSVGAttributes;
|
|
165
|
+
export type ExternalResourceSVGAttributes =
|
|
166
|
+
Solid.ExternalResourceSVGAttributes;
|
|
167
|
+
export type AnimationTimingSVGAttributes = Solid.AnimationTimingSVGAttributes;
|
|
168
|
+
export type AnimationValueSVGAttributes = Solid.AnimationValueSVGAttributes;
|
|
169
|
+
export type AnimationAdditionSVGAttributes =
|
|
170
|
+
Solid.AnimationAdditionSVGAttributes;
|
|
171
|
+
export type AnimationAttributeTargetSVGAttributes =
|
|
172
|
+
Solid.AnimationAttributeTargetSVGAttributes;
|
|
173
|
+
export type PresentationSVGAttributes = Solid.PresentationSVGAttributes;
|
|
174
|
+
export type AnimationElementSVGAttributes<T> =
|
|
175
|
+
Solid.AnimationElementSVGAttributes<T>;
|
|
176
|
+
export type ContainerElementSVGAttributes<T> =
|
|
177
|
+
Solid.ContainerElementSVGAttributes<T>;
|
|
178
|
+
export type FilterPrimitiveElementSVGAttributes<T> =
|
|
179
|
+
Solid.FilterPrimitiveElementSVGAttributes<T>;
|
|
180
|
+
export type SingleInputFilterSVGAttributes =
|
|
181
|
+
Solid.SingleInputFilterSVGAttributes;
|
|
182
|
+
export type DoubleInputFilterSVGAttributes =
|
|
183
|
+
Solid.DoubleInputFilterSVGAttributes;
|
|
184
|
+
export type FitToViewBoxSVGAttributes = Solid.FitToViewBoxSVGAttributes;
|
|
185
|
+
export type GradientElementSVGAttributes<T> =
|
|
186
|
+
Solid.GradientElementSVGAttributes<T>;
|
|
187
|
+
export type GraphicsElementSVGAttributes<T> =
|
|
188
|
+
Solid.GraphicsElementSVGAttributes<T>;
|
|
189
|
+
export type LightSourceElementSVGAttributes<T> =
|
|
190
|
+
Solid.LightSourceElementSVGAttributes<T>;
|
|
191
|
+
export type NewViewportSVGAttributes<T> = Solid.NewViewportSVGAttributes<T>;
|
|
192
|
+
export type ShapeElementSVGAttributes<T> = Solid.ShapeElementSVGAttributes<T>;
|
|
193
|
+
export type TextContentElementSVGAttributes<T> =
|
|
194
|
+
Solid.TextContentElementSVGAttributes<T>;
|
|
195
|
+
export type ZoomAndPanSVGAttributes = Solid.ZoomAndPanSVGAttributes;
|
|
196
|
+
export type AnimateSVGAttributes<T> = Solid.AnimateSVGAttributes<T>;
|
|
197
|
+
export type AnimateMotionSVGAttributes<T> =
|
|
198
|
+
Solid.AnimateMotionSVGAttributes<T>;
|
|
199
|
+
export type AnimateTransformSVGAttributes<T> =
|
|
200
|
+
Solid.AnimateTransformSVGAttributes<T>;
|
|
201
|
+
export type CircleSVGAttributes<T> = Solid.CircleSVGAttributes<T>;
|
|
202
|
+
export type ClipPathSVGAttributes<T> = Solid.ClipPathSVGAttributes<T>;
|
|
203
|
+
export type DefsSVGAttributes<T> = Solid.DefsSVGAttributes<T>;
|
|
204
|
+
export type DescSVGAttributes<T> = Solid.DescSVGAttributes<T>;
|
|
205
|
+
export type EllipseSVGAttributes<T> = Solid.EllipseSVGAttributes<T>;
|
|
206
|
+
export type FeBlendSVGAttributes<T> = Solid.FeBlendSVGAttributes<T>;
|
|
207
|
+
export type FeColorMatrixSVGAttributes<T> =
|
|
208
|
+
Solid.FeColorMatrixSVGAttributes<T>;
|
|
209
|
+
export type FeComponentTransferSVGAttributes<T> =
|
|
210
|
+
Solid.FeComponentTransferSVGAttributes<T>;
|
|
211
|
+
export type FeCompositeSVGAttributes<T> = Solid.FeCompositeSVGAttributes<T>;
|
|
212
|
+
export type FeConvolveMatrixSVGAttributes<T> =
|
|
213
|
+
Solid.FeConvolveMatrixSVGAttributes<T>;
|
|
214
|
+
export type FeDiffuseLightingSVGAttributes<T> =
|
|
215
|
+
Solid.FeDiffuseLightingSVGAttributes<T>;
|
|
216
|
+
export type FeDisplacementMapSVGAttributes<T> =
|
|
217
|
+
Solid.FeDisplacementMapSVGAttributes<T>;
|
|
218
|
+
export type FeDistantLightSVGAttributes<T> =
|
|
219
|
+
Solid.FeDistantLightSVGAttributes<T>;
|
|
220
|
+
export type FeDropShadowSVGAttributes<T> = Solid.FeDropShadowSVGAttributes<T>;
|
|
221
|
+
export type FeFloodSVGAttributes<T> = Solid.FeFloodSVGAttributes<T>;
|
|
222
|
+
export type FeFuncSVGAttributes<T> = Solid.FeFuncSVGAttributes<T>;
|
|
223
|
+
export type FeGaussianBlurSVGAttributes<T> =
|
|
224
|
+
Solid.FeGaussianBlurSVGAttributes<T>;
|
|
225
|
+
export type FeImageSVGAttributes<T> = Solid.FeImageSVGAttributes<T>;
|
|
226
|
+
export type FeMergeSVGAttributes<T> = Solid.FeMergeSVGAttributes<T>;
|
|
227
|
+
export type FeMergeNodeSVGAttributes<T> = Solid.FeMergeNodeSVGAttributes<T>;
|
|
228
|
+
export type FeMorphologySVGAttributes<T> = Solid.FeMorphologySVGAttributes<T>;
|
|
229
|
+
export type FeOffsetSVGAttributes<T> = Solid.FeOffsetSVGAttributes<T>;
|
|
230
|
+
export type FePointLightSVGAttributes<T> = Solid.FePointLightSVGAttributes<T>;
|
|
231
|
+
export type FeSpecularLightingSVGAttributes<T> =
|
|
232
|
+
Solid.FeSpecularLightingSVGAttributes<T>;
|
|
233
|
+
export type FeSpotLightSVGAttributes<T> = Solid.FeSpotLightSVGAttributes<T>;
|
|
234
|
+
export type FeTileSVGAttributes<T> = Solid.FeTileSVGAttributes<T>;
|
|
235
|
+
export type FeTurbulanceSVGAttributes<T> = Solid.FeTurbulanceSVGAttributes<T>;
|
|
236
|
+
export type FilterSVGAttributes<T> = Solid.FilterSVGAttributes<T>;
|
|
237
|
+
export type ForeignObjectSVGAttributes<T> =
|
|
238
|
+
Solid.ForeignObjectSVGAttributes<T>;
|
|
239
|
+
export type GSVGAttributes<T> = Solid.GSVGAttributes<T>;
|
|
240
|
+
export type ImageSVGAttributes<T> = Solid.ImageSVGAttributes<T>;
|
|
241
|
+
export type LineSVGAttributes<T> = Solid.LineSVGAttributes<T>;
|
|
242
|
+
export type LinearGradientSVGAttributes<T> =
|
|
243
|
+
Solid.LinearGradientSVGAttributes<T>;
|
|
244
|
+
export type MarkerSVGAttributes<T> = Solid.MarkerSVGAttributes<T>;
|
|
245
|
+
export type MaskSVGAttributes<T> = Solid.MaskSVGAttributes<T>;
|
|
246
|
+
export type MetadataSVGAttributes<T> = Solid.MetadataSVGAttributes<T>;
|
|
247
|
+
export type MPathSVGAttributes<T> = Solid.MPathSVGAttributes<T>;
|
|
248
|
+
export type PathSVGAttributes<T> = Solid.PathSVGAttributes<T>;
|
|
249
|
+
export type PatternSVGAttributes<T> = Solid.PatternSVGAttributes<T>;
|
|
250
|
+
export type PolygonSVGAttributes<T> = Solid.PolygonSVGAttributes<T>;
|
|
251
|
+
export type PolylineSVGAttributes<T> = Solid.PolylineSVGAttributes<T>;
|
|
252
|
+
export type RadialGradientSVGAttributes<T> =
|
|
253
|
+
Solid.RadialGradientSVGAttributes<T>;
|
|
254
|
+
export type RectSVGAttributes<T> = Solid.RectSVGAttributes<T>;
|
|
255
|
+
export type SetSVGAttributes<T> = Solid.SetSVGAttributes<T>;
|
|
256
|
+
export type StopSVGAttributes<T> = Solid.StopSVGAttributes<T>;
|
|
257
|
+
export type SvgSVGAttributes<T> = Solid.SvgSVGAttributes<T>;
|
|
258
|
+
export type SwitchSVGAttributes<T> = Solid.SwitchSVGAttributes<T>;
|
|
259
|
+
export type SymbolSVGAttributes<T> = Solid.SymbolSVGAttributes<T>;
|
|
260
|
+
export type TextSVGAttributes<T> = Solid.TextSVGAttributes<T>;
|
|
261
|
+
export type TextPathSVGAttributes<T> = Solid.TextPathSVGAttributes<T>;
|
|
262
|
+
export type TSpanSVGAttributes<T> = Solid.TSpanSVGAttributes<T>;
|
|
263
|
+
export type UseSVGAttributes<T> = Solid.UseSVGAttributes<T>;
|
|
264
|
+
export type ViewSVGAttributes<T> = Solid.ViewSVGAttributes<T>;
|
|
265
|
+
export type MathMLAttributes<T> = Solid.MathMLAttributes<T>;
|
|
266
|
+
export type MathMLAnnotationElementAttributes<T> =
|
|
267
|
+
Solid.MathMLAnnotationElementAttributes<T>;
|
|
268
|
+
export type MathMLAnnotationXmlElementAttributes<T> =
|
|
269
|
+
Solid.MathMLAnnotationXmlElementAttributes<T>;
|
|
270
|
+
export type MathMLMactionElementAttributes<T> =
|
|
271
|
+
Solid.MathMLMactionElementAttributes<T>;
|
|
272
|
+
export type MathMLMathElementAttributes<T> =
|
|
273
|
+
Solid.MathMLMathElementAttributes<T>;
|
|
274
|
+
export type MathMLMerrorElementAttributes<T> =
|
|
275
|
+
Solid.MathMLMerrorElementAttributes<T>;
|
|
276
|
+
export type MathMLMfracElementAttributes<T> =
|
|
277
|
+
Solid.MathMLMfracElementAttributes<T>;
|
|
278
|
+
export type MathMLMiElementAttributes<T> = Solid.MathMLMiElementAttributes<T>;
|
|
279
|
+
export type MathMLMmultiscriptsElementAttributes<T> =
|
|
280
|
+
Solid.MathMLMmultiscriptsElementAttributes<T>;
|
|
281
|
+
export type MathMLMnElementAttributes<T> = Solid.MathMLMnElementAttributes<T>;
|
|
282
|
+
export type MathMLMoElementAttributes<T> = Solid.MathMLMoElementAttributes<T>;
|
|
283
|
+
export type MathMLMoverElementAttributes<T> =
|
|
284
|
+
Solid.MathMLMoverElementAttributes<T>;
|
|
285
|
+
export type MathMLMpaddedElementAttributes<T> =
|
|
286
|
+
Solid.MathMLMpaddedElementAttributes<T>;
|
|
287
|
+
export type MathMLMphantomElementAttributes<T> =
|
|
288
|
+
Solid.MathMLMphantomElementAttributes<T>;
|
|
289
|
+
export type MathMLMprescriptsElementAttributes<T> =
|
|
290
|
+
Solid.MathMLMprescriptsElementAttributes<T>;
|
|
291
|
+
export type MathMLMrootElementAttributes<T> =
|
|
292
|
+
Solid.MathMLMrootElementAttributes<T>;
|
|
293
|
+
export type MathMLMrowElementAttributes<T> =
|
|
294
|
+
Solid.MathMLMrowElementAttributes<T>;
|
|
295
|
+
export type MathMLMsElementAttributes<T> = Solid.MathMLMsElementAttributes<T>;
|
|
296
|
+
export type MathMLMspaceElementAttributes<T> =
|
|
297
|
+
Solid.MathMLMspaceElementAttributes<T>;
|
|
298
|
+
export type MathMLMsqrtElementAttributes<T> =
|
|
299
|
+
Solid.MathMLMsqrtElementAttributes<T>;
|
|
300
|
+
export type MathMLMstyleElementAttributes<T> =
|
|
301
|
+
Solid.MathMLMstyleElementAttributes<T>;
|
|
302
|
+
export type MathMLMsubElementAttributes<T> =
|
|
303
|
+
Solid.MathMLMsubElementAttributes<T>;
|
|
304
|
+
export type MathMLMsubsupElementAttributes<T> =
|
|
305
|
+
Solid.MathMLMsubsupElementAttributes<T>;
|
|
306
|
+
export type MathMLMsupElementAttributes<T> =
|
|
307
|
+
Solid.MathMLMsupElementAttributes<T>;
|
|
308
|
+
export type MathMLMtableElementAttributes<T> =
|
|
309
|
+
Solid.MathMLMtableElementAttributes<T>;
|
|
310
|
+
export type MathMLMtdElementAttributes<T> =
|
|
311
|
+
Solid.MathMLMtdElementAttributes<T>;
|
|
312
|
+
export type MathMLMtextElementAttributes<T> =
|
|
313
|
+
Solid.MathMLMtextElementAttributes<T>;
|
|
314
|
+
export type MathMLMtrElementAttributes<T> =
|
|
315
|
+
Solid.MathMLMtrElementAttributes<T>;
|
|
316
|
+
export type MathMLMunderElementAttributes<T> =
|
|
317
|
+
Solid.MathMLMunderElementAttributes<T>;
|
|
318
|
+
export type MathMLMunderoverElementAttributes<T> =
|
|
319
|
+
Solid.MathMLMunderoverElementAttributes<T>;
|
|
320
|
+
export type MathMLSemanticsElementAttributes<T> =
|
|
321
|
+
Solid.MathMLSemanticsElementAttributes<T>;
|
|
322
|
+
export type MathMLMencloseElementAttributes<T> =
|
|
323
|
+
Solid.MathMLMencloseElementAttributes<T>;
|
|
324
|
+
export type MathMLMfencedElementAttributes<T> =
|
|
325
|
+
Solid.MathMLMfencedElementAttributes<T>;
|
|
326
|
+
export type HTMLElementTags = Solid.HTMLElementTags;
|
|
327
|
+
export type HTMLElementDeprecatedTags = Solid.HTMLElementDeprecatedTags;
|
|
328
|
+
export type SVGElementTags = Solid.SVGElementTags;
|
|
329
|
+
export type MathMLElementTags = Solid.MathMLElementTags;
|
|
330
|
+
export type IntrinsicElements = Solid.IntrinsicElements;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* `<>` and `<Fragment>`, as `solid-js/h/jsx-runtime` types it. Always an
|
|
335
|
+
* array, so a single child that is a script stays a child, read where it
|
|
336
|
+
* stands, rather than a script the fragment drew.
|
|
337
|
+
*/
|
|
338
|
+
export function Fragment(props: { children?: unknown }): Client<Solid.Element> {
|
|
339
|
+
// The bundler writes the array as it is: a Solid array element.
|
|
340
|
+
return [props.children] as unknown as Client<Solid.Element>;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// A component, run on the client as Solid runs one, through `createComponent`:
|
|
344
|
+
// untracked, so what it reads while it sets up doesn't build it again where it
|
|
345
|
+
// stands.
|
|
346
|
+
export function jsx(
|
|
347
|
+
type: JSX.ElementType,
|
|
348
|
+
props: unknown,
|
|
349
|
+
): Client<Solid.Element> {
|
|
350
|
+
// Core's element, as this package types it: a stand-in for a Solid element.
|
|
351
|
+
const element = createJsxElement(type, props) as Client<Solid.Element>;
|
|
352
|
+
return cs`$createComponent(() => $element, {})`;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export const jsxs = jsx;
|
|
356
|
+
// What a development build of the JSX transform calls, as Bun does.
|
|
357
|
+
export const jsxDEV = jsx;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { transformSync } from "@babel/core";
|
|
2
|
+
import preset from "babel-preset-solid";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Solid's compiler as a build's compile step: a script's module, its JSX as
|
|
6
|
+
* Solid's template and DOM code, importing from `solid-js/web`. Typed by its
|
|
7
|
+
* shape, which is the compiler's `Plugin`, so this package needn't depend on the
|
|
8
|
+
* compiler.
|
|
9
|
+
*/
|
|
10
|
+
export function solid(): (
|
|
11
|
+
code: string,
|
|
12
|
+
id: string,
|
|
13
|
+
) => { code: string; map: string } {
|
|
14
|
+
return (code, id) => {
|
|
15
|
+
const result = transformSync(code, {
|
|
16
|
+
filename: id,
|
|
17
|
+
babelrc: false,
|
|
18
|
+
configFile: false,
|
|
19
|
+
sourceMaps: true,
|
|
20
|
+
presets: [[preset, { moduleName: "solid-js/web", generate: "dom" }]],
|
|
21
|
+
})!;
|
|
22
|
+
return { code: result.code!, map: JSON.stringify(result.map) };
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// What a project names to compile its scripts for Solid, in its `package.json`:
|
|
27
|
+
// `"backtick": { "plugins": ["@backtickjs/jsx-solid/plugin"] }`.
|
|
28
|
+
export default solid;
|