@solidjs/start 2.0.0-rc.1 → 2.0.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/dist/config/app-root-alias.d.ts +7 -0
  3. package/dist/config/app-root-alias.js +58 -0
  4. package/dist/config/constants.d.ts +2 -0
  5. package/dist/config/constants.js +2 -0
  6. package/dist/config/env.js +2 -2
  7. package/dist/config/fs-routes/index.js +3 -3
  8. package/dist/config/fs-routes/tree-shake.d.ts +27 -0
  9. package/dist/config/fs-routes/tree-shake.js +51 -1
  10. package/dist/config/index.d.ts +154 -5
  11. package/dist/config/index.js +16 -8
  12. package/dist/config/lazy.js +7 -2
  13. package/dist/config/manifest.d.ts +3 -0
  14. package/dist/config/manifest.js +26 -4
  15. package/dist/directives/remove-unused-variables.js +15 -3
  16. package/dist/directives/xxhash32.js +5 -13
  17. package/dist/fns/client.js +14 -5
  18. package/dist/fns/error-handler.d.ts +34 -0
  19. package/dist/fns/error-handler.js +10 -0
  20. package/dist/fns/handler.d.ts +1 -1
  21. package/dist/fns/handler.js +45 -10
  22. package/dist/fns/plugins.d.ts +34 -0
  23. package/dist/fns/plugins.js +33 -0
  24. package/dist/fns/serialization.d.ts +15 -0
  25. package/dist/fns/serialization.js +36 -6
  26. package/dist/server/assets/render.jsx +1 -1
  27. package/dist/server/collect-styles.d.ts +3 -1
  28. package/dist/server/collect-styles.js +8 -5
  29. package/dist/server/handler.d.ts +3 -4
  30. package/dist/server/handler.js +16 -46
  31. package/dist/server/index.d.ts +2 -1
  32. package/dist/server/manifest/dev-client-manifest.js +1 -1
  33. package/dist/server/manifest/dev-ssr-manifest.js +1 -1
  34. package/dist/server/spa/StartServer.jsx +1 -1
  35. package/dist/server/spa/handler.d.ts +2 -3
  36. package/dist/server/spa/handler.js +2 -2
  37. package/dist/server/types.d.ts +12 -1
  38. package/dist/server/web-stream.d.ts +1 -1
  39. package/dist/server/web-stream.js +5 -2
  40. package/dist/shared/ErrorBoundary.jsx +3 -3
  41. package/dist/shared/clientOnly.js +3 -1
  42. package/dist/shared/{dev-overlay → dev-toolbar/error-viewer}/CodeView.jsx +3 -3
  43. package/dist/shared/{dev-overlay/DevOverlayDialog.d.ts → dev-toolbar/error-viewer/index.d.ts} +3 -2
  44. package/dist/shared/{dev-overlay/DevOverlayDialog.jsx → dev-toolbar/error-viewer/index.jsx} +66 -77
  45. package/dist/shared/dev-toolbar/error-viewer/styles.css +224 -0
  46. package/dist/shared/dev-toolbar/functions/BlobViewer.css +4 -0
  47. package/dist/shared/dev-toolbar/functions/BlobViewer.d.ts +6 -0
  48. package/dist/shared/dev-toolbar/functions/BlobViewer.jsx +37 -0
  49. package/dist/shared/dev-toolbar/functions/FormDataViewer.d.ts +5 -0
  50. package/dist/shared/dev-toolbar/functions/FormDataViewer.jsx +23 -0
  51. package/dist/shared/dev-toolbar/functions/HeadersViewer.css +8 -0
  52. package/dist/shared/dev-toolbar/functions/HeadersViewer.d.ts +6 -0
  53. package/dist/shared/dev-toolbar/functions/HeadersViewer.jsx +15 -0
  54. package/dist/shared/dev-toolbar/functions/HexViewer.css +34 -0
  55. package/dist/shared/dev-toolbar/functions/HexViewer.d.ts +11 -0
  56. package/dist/shared/dev-toolbar/functions/HexViewer.jsx +70 -0
  57. package/dist/shared/dev-toolbar/functions/SerovalValue.css +5 -0
  58. package/dist/shared/dev-toolbar/functions/SerovalValue.d.ts +7 -0
  59. package/dist/shared/dev-toolbar/functions/SerovalValue.jsx +10 -0
  60. package/dist/shared/dev-toolbar/functions/SerovalViewer.css +70 -0
  61. package/dist/shared/dev-toolbar/functions/SerovalViewer.d.ts +6 -0
  62. package/dist/shared/dev-toolbar/functions/SerovalViewer.jsx +796 -0
  63. package/dist/shared/dev-toolbar/functions/URLSearchParamsViewer.d.ts +5 -0
  64. package/dist/shared/dev-toolbar/functions/URLSearchParamsViewer.jsx +22 -0
  65. package/dist/shared/dev-toolbar/functions/index.d.ts +13 -0
  66. package/dist/shared/dev-toolbar/functions/index.jsx +216 -0
  67. package/dist/shared/dev-toolbar/functions/styles.css +109 -0
  68. package/dist/shared/dev-toolbar/functions/tracker.d.ts +19 -0
  69. package/dist/shared/dev-toolbar/functions/tracker.js +29 -0
  70. package/dist/shared/{dev-overlay → dev-toolbar}/icons.d.ts +9 -0
  71. package/dist/shared/{dev-overlay → dev-toolbar}/icons.jsx +19 -1
  72. package/dist/shared/dev-toolbar/index.css +88 -0
  73. package/dist/shared/dev-toolbar/index.d.ts +6 -0
  74. package/dist/shared/dev-toolbar/index.jsx +179 -0
  75. package/dist/shared/ui/Badge.css +33 -0
  76. package/dist/shared/ui/Badge.d.ts +7 -0
  77. package/dist/shared/ui/Badge.jsx +7 -0
  78. package/dist/shared/ui/Button.css +32 -0
  79. package/dist/shared/ui/Button.d.ts +4 -0
  80. package/dist/shared/ui/Button.jsx +4 -0
  81. package/dist/shared/ui/Cascade.css +29 -0
  82. package/dist/shared/ui/Cascade.d.ts +4 -0
  83. package/dist/shared/ui/Cascade.jsx +4 -0
  84. package/dist/shared/ui/Dialog.css +25 -0
  85. package/dist/shared/ui/Dialog.d.ts +5 -0
  86. package/dist/shared/ui/Dialog.jsx +5 -0
  87. package/dist/shared/ui/IconButton.css +39 -0
  88. package/dist/shared/ui/IconButton.d.ts +4 -0
  89. package/dist/shared/ui/IconButton.jsx +4 -0
  90. package/dist/shared/ui/Placeholder.css +12 -0
  91. package/dist/shared/ui/Placeholder.d.ts +6 -0
  92. package/dist/shared/ui/Placeholder.jsx +4 -0
  93. package/dist/shared/ui/Section.css +18 -0
  94. package/dist/shared/ui/Section.d.ts +9 -0
  95. package/dist/shared/ui/Section.jsx +10 -0
  96. package/dist/shared/ui/Select.css +37 -0
  97. package/dist/shared/ui/Select.d.ts +4 -0
  98. package/dist/shared/ui/Select.jsx +4 -0
  99. package/dist/shared/ui/Table.css +22 -0
  100. package/dist/shared/ui/Table.d.ts +11 -0
  101. package/dist/shared/ui/Table.jsx +13 -0
  102. package/dist/shared/ui/Tabs.css +51 -0
  103. package/dist/shared/ui/Tabs.d.ts +6 -0
  104. package/dist/shared/ui/Tabs.jsx +6 -0
  105. package/dist/shared/ui/Text.css +73 -0
  106. package/dist/shared/ui/Text.d.ts +12 -0
  107. package/dist/shared/ui/Text.jsx +17 -0
  108. package/package.json +36 -29
  109. package/dist/shared/dev-overlay/index.d.ts +0 -5
  110. package/dist/shared/dev-overlay/index.jsx +0 -39
  111. package/dist/shared/dev-overlay/styles.css +0 -292
  112. /package/dist/shared/{dev-overlay → dev-toolbar/error-viewer}/CodeView.d.ts +0 -0
  113. /package/dist/shared/{dev-overlay/createStackFrame.d.ts → dev-toolbar/error-viewer/create-stack-frame.d.ts} +0 -0
  114. /package/dist/shared/{dev-overlay/createStackFrame.js → dev-toolbar/error-viewer/create-stack-frame.js} +0 -0
  115. /package/dist/shared/{dev-overlay → dev-toolbar/error-viewer}/download.d.ts +0 -0
  116. /package/dist/shared/{dev-overlay → dev-toolbar/error-viewer}/download.js +0 -0
  117. /package/dist/shared/{dev-overlay → dev-toolbar/error-viewer}/get-source-map.d.ts +0 -0
  118. /package/dist/shared/{dev-overlay → dev-toolbar/error-viewer}/get-source-map.js +0 -0
@@ -0,0 +1,5 @@
1
+ import { type JSX } from "solid-js";
2
+ export interface URLSearchParamsViewerProps {
3
+ source: URLSearchParams | Promise<URLSearchParams>;
4
+ }
5
+ export declare function URLSearchParamsViewer(props: URLSearchParamsViewerProps): JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { createResource, For, Show, Suspense } from "solid-js";
2
+ import { Section } from "../../ui/Section.jsx";
3
+ import { PropertySeparator, SerovalValue } from "./SerovalValue.jsx";
4
+ function URLSearchParamsViewerInner(props) {
5
+ return (<Section title="URLSearchParams" options={{ size: "sm" }}>
6
+ <div data-start-properties>
7
+ <For each={Array.from(props.source.entries())}>
8
+ {([key, value]) => (<div data-start-property>
9
+ <SerovalValue value={`"${key}"`}/>
10
+ <PropertySeparator />
11
+ <SerovalValue value={`"${JSON.stringify(value)}"`}/>
12
+ </div>)}
13
+ </For>
14
+ </div>
15
+ </Section>);
16
+ }
17
+ export function URLSearchParamsViewer(props) {
18
+ const [data] = createResource(() => props.source);
19
+ return (<Suspense>
20
+ <Show when={data()}>{current => <URLSearchParamsViewerInner source={current()}/>}</Show>
21
+ </Suspense>);
22
+ }
@@ -0,0 +1,13 @@
1
+ import { type JSX } from "solid-js";
2
+ import "./styles.css";
3
+ import { type ServerFunctionRequest, type ServerFunctionResponse } from "./tracker.ts";
4
+ export interface ServerFunctionInstance {
5
+ request: ServerFunctionRequest;
6
+ response?: ServerFunctionResponse;
7
+ }
8
+ export interface ServerFunctionViewerProps {
9
+ instances: Record<string, ServerFunctionInstance | undefined>;
10
+ onDeleteInstance: (value: string) => void;
11
+ show?: boolean;
12
+ }
13
+ export declare function ServerFunctionViewer(props: ServerFunctionViewerProps): JSX.Element;
@@ -0,0 +1,216 @@
1
+ import { createMemo, createSignal, For, Show } from "solid-js";
2
+ import { BODY_FORMAL_FILE, BODY_FORMAT_KEY, BodyFormat } from "../../../fns/shared.js";
3
+ import { Badge } from "../../ui/Badge.jsx";
4
+ import IconButton from "../../ui/IconButton.jsx";
5
+ import Placeholder from "../../ui/Placeholder.jsx";
6
+ import { Section } from "../../ui/Section.jsx";
7
+ import { Select, SelectOption } from "../../ui/Select.jsx";
8
+ import { Tab, TabGroup, TabList, TabPanel } from "../../ui/Tabs.jsx";
9
+ import { Text } from "../../ui/Text.jsx";
10
+ import { ArrowLeftIcon, FunctionIcon, TrashIcon } from "../icons.jsx";
11
+ import { BlobViewer } from "./BlobViewer.jsx";
12
+ import { FormDataViewer } from "./FormDataViewer.jsx";
13
+ import { HeadersViewer } from "./HeadersViewer.jsx";
14
+ import { HexViewer } from "./HexViewer.jsx";
15
+ import { PropertySeparator, SerovalValue } from "./SerovalValue.jsx";
16
+ import { SerovalViewer } from "./SerovalViewer.jsx";
17
+ import "./styles.css";
18
+ import { URLSearchParamsViewer } from "./URLSearchParamsViewer.jsx";
19
+ async function getFile(source) {
20
+ const formData = await source.formData();
21
+ const file = formData.get(BODY_FORMAL_FILE);
22
+ if (!(file && file instanceof File)) {
23
+ throw new Error("invalid file input");
24
+ }
25
+ return file;
26
+ }
27
+ async function getURLSearchParams(source) {
28
+ const text = await source.text();
29
+ return new URLSearchParams(text);
30
+ }
31
+ function ContentViewer(props) {
32
+ return (<>
33
+ <Section title="Headers">
34
+ <HeadersViewer headers={props.source.source.headers}/>
35
+ </Section>
36
+ <Section title="Body">
37
+ {(() => {
38
+ const source = props.source.source.clone();
39
+ const startType = source.headers.get(BODY_FORMAT_KEY);
40
+ const contentType = source.headers.get("Content-Type");
41
+ switch (true) {
42
+ case startType === "true":
43
+ case startType === BodyFormat.Seroval:
44
+ return <SerovalViewer stream={source}/>;
45
+ case startType === BodyFormat.String:
46
+ return <HexViewer bytes={source.bytes()}/>;
47
+ case startType === BodyFormat.File:
48
+ return <BlobViewer source={getFile(source)}/>;
49
+ case startType === BodyFormat.FormData:
50
+ case contentType?.startsWith("multipart/form-data"):
51
+ return <FormDataViewer source={source.formData()}/>;
52
+ case startType === BodyFormat.URLSearchParams:
53
+ case contentType?.startsWith("application/x-www-form-urlencoded"):
54
+ return <URLSearchParamsViewer source={getURLSearchParams(source)}/>;
55
+ case startType === BodyFormat.Blob:
56
+ return <BlobViewer source={source.blob()}/>;
57
+ case startType === BodyFormat.ArrayBuffer:
58
+ case startType === BodyFormat.Uint8Array:
59
+ return <HexViewer bytes={source.bytes()}/>;
60
+ }
61
+ })()}
62
+ </Section>
63
+ </>);
64
+ }
65
+ function convertRequestToEntries(request) {
66
+ return [
67
+ ["Cache", request.cache],
68
+ ["Credentials", request.credentials],
69
+ ["Destination", request.destination],
70
+ ["Integrity", request.integrity],
71
+ ["Keep Alive", request.keepalive],
72
+ ["Mode", request.mode],
73
+ ["Redirect", request.redirect],
74
+ ["Referrer", request.referrer],
75
+ ["Referrer Policy", request.referrerPolicy],
76
+ ["URL", request.url],
77
+ ];
78
+ }
79
+ function RequestViewer(props) {
80
+ return (<TabPanel value="request">
81
+ <Section title="Information">
82
+ <For each={convertRequestToEntries(props.request.source)}>
83
+ {([key, value]) => (<div data-start-property>
84
+ <Text options={{ size: "xs", weight: "semibold", wrap: "nowrap" }}>{key}</Text>
85
+ <PropertySeparator />
86
+ <SerovalValue value={value}/>
87
+ </div>)}
88
+ </For>
89
+ </Section>
90
+ <ContentViewer source={props.request}/>
91
+ </TabPanel>);
92
+ }
93
+ function convertResponseToEntries(response) {
94
+ return [
95
+ ["OK", response.ok],
96
+ ["Redirected", response.redirected],
97
+ ["Status", response.status],
98
+ ["Status Text", response.statusText],
99
+ ["Type", response.type],
100
+ ["URL", response.url],
101
+ ];
102
+ }
103
+ function ResponseViewer(props) {
104
+ return (<TabPanel value="response">
105
+ <Show when={props.response}>
106
+ {instance => (<>
107
+ <Section title="Information">
108
+ <For each={convertResponseToEntries(instance().source)}>
109
+ {([key, value]) => (<div data-start-property>
110
+ <Text options={{ size: "xs", weight: "semibold", wrap: "nowrap" }}>{key}</Text>
111
+ <PropertySeparator />
112
+ <SerovalValue value={value}/>
113
+ </div>)}
114
+ </For>
115
+ <div data-start-property>
116
+ <Text options={{ size: "xs", weight: "semibold", wrap: "nowrap" }}>Timing</Text>
117
+ <PropertySeparator />
118
+ <SerovalValue value={`${((instance().time - props.request.time) / 1000).toFixed(2)}s`}/>
119
+ </div>
120
+ </Section>
121
+ <ContentViewer source={instance()}/>
122
+ </>)}
123
+ </Show>
124
+ </TabPanel>);
125
+ }
126
+ function ServerFunctionInstanceDetail(props) {
127
+ return (<>
128
+ <span data-start-functions-instance-detail>
129
+ <Badge type="info">{props.value.request.source.method}</Badge>
130
+ <Text options={{ size: "xs" }}>{props.id}</Text>
131
+ </span>
132
+ <Show when={props.value.response}>
133
+ {response => {
134
+ if (response().source.ok) {
135
+ return <Badge type="success">{response().source.status}</Badge>;
136
+ }
137
+ return <Badge type="failure">{response().source.status}</Badge>;
138
+ }}
139
+ </Show>
140
+ </>);
141
+ }
142
+ function ServerFunctionInstanceViewer(props) {
143
+ const [tab, setTab] = createSignal("request");
144
+ return (<div data-start-function-instance-viewer>
145
+ <div data-start-function-instance-viewer-nav>
146
+ <div data-start-function-instance-viewer-nav-left>
147
+ <IconButton onClick={props.onReturn}>
148
+ <ArrowLeftIcon title="Go Back"/>
149
+ </IconButton>
150
+ <div>
151
+ <ServerFunctionInstanceDetail id={props.id} value={props.instance}/>
152
+ </div>
153
+ </div>
154
+ <div>
155
+ <IconButton onClick={props.onDelete}>
156
+ <TrashIcon title="Delete instance"/>
157
+ </IconButton>
158
+ </div>
159
+ </div>
160
+ <div data-start-function-instance-viewer-content>
161
+ <TabGroup horizontal value={tab()} onChange={value => setTab(value ?? "request")}>
162
+ <TabList>
163
+ <Tab value="request">Request</Tab>
164
+ <Tab value="response">Response</Tab>
165
+ </TabList>
166
+ <RequestViewer request={props.instance.request}/>
167
+ <ResponseViewer request={props.instance.request} response={props.instance.response}/>
168
+ </TabGroup>
169
+ </div>
170
+ </div>);
171
+ }
172
+ function EmptyServerFunctions() {
173
+ return (<Placeholder>
174
+ <Text options={{ size: "xs" }}>No server function calls detected.</Text>
175
+ </Placeholder>);
176
+ }
177
+ export function ServerFunctionViewer(props) {
178
+ const [currentInstance, setCurrentInstance] = createSignal();
179
+ const keys = createMemo(() => Object.keys(props.instances));
180
+ return (<Show when={props.show}>
181
+ <div data-start-dev-toolbar-panel>
182
+ <div data-start-functions-viewer>
183
+ {/* request/response viewer */}
184
+ <Show when={currentInstance()}>
185
+ {value => (<Show when={props.instances[value()]}>
186
+ {instance => (<ServerFunctionInstanceViewer id={value()} instance={instance()} onReturn={() => {
187
+ setCurrentInstance(undefined);
188
+ }} onDelete={() => {
189
+ props.onDeleteInstance(value());
190
+ }}/>)}
191
+ </Show>)}
192
+ </Show>
193
+ <Show when={!currentInstance()}>
194
+ {/* list of calls */}
195
+ <div data-start-functions-nav>
196
+ <FunctionIcon title="Server functions"/>
197
+ <Text options={{ size: "sm" }}>Server functions</Text>
198
+ </div>
199
+ <div data-start-functions-instances-container>
200
+ <Show when={keys().length} fallback={<EmptyServerFunctions />}>
201
+ <Select data-start-functions-instances horizontal={false} value={currentInstance()} onChange={current => setCurrentInstance(current)}>
202
+ <For each={keys()}>
203
+ {instance => (<SelectOption value={instance}>
204
+ <Show when={props.instances[instance]}>
205
+ {current => (<ServerFunctionInstanceDetail id={instance} value={current()}/>)}
206
+ </Show>
207
+ </SelectOption>)}
208
+ </For>
209
+ </Select>
210
+ </Show>
211
+ </div>
212
+ </Show>
213
+ </div>
214
+ </div>
215
+ </Show>);
216
+ }
@@ -0,0 +1,109 @@
1
+ [data-start-functions-instance-detail] {
2
+ display: flex;
3
+ align-items: center;
4
+ gap: 0.5rem;
5
+ }
6
+
7
+ [data-start-functions-viewer] {
8
+ color: rgb(249 250 251);
9
+
10
+ display: flex;
11
+ flex-direction: column;
12
+
13
+ min-height: 100%;
14
+ }
15
+
16
+ [data-start-functions-instances-container] {
17
+ color: rgb(249 250 251);
18
+ width: 100%;
19
+ min-height: 100%;
20
+ overflow: auto;
21
+ }
22
+
23
+ [data-start-functions-instances] {
24
+ list-style: none;
25
+ display: flex;
26
+ flex-direction: column;
27
+ padding: 0px;
28
+ }
29
+
30
+ [data-start-functions-instances] > [data-start-select-option] {
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: space-between;
34
+ padding: 0.5rem;
35
+ color: rgb(249 250 251);
36
+ }
37
+
38
+ [data-start-headers] {
39
+ display: flex;
40
+ flex-direction: column;
41
+ gap: 0.5rem;
42
+ }
43
+
44
+ [data-start-headers-title] {
45
+ font-weight: 500;
46
+ }
47
+
48
+ [data-start-properties] {
49
+ display: flex;
50
+ flex-direction: column;
51
+ gap: 0.25rem;
52
+ }
53
+
54
+ [data-start-property] {
55
+ display: flex;
56
+ flex-direction: row;
57
+ align-items: center;
58
+ flex-wrap: nowrap;
59
+
60
+ gap: 0.25rem;
61
+ }
62
+
63
+ [data-start-function-instance-viewer] {
64
+ display: flex;
65
+ flex-direction: column;
66
+
67
+ width: 100%;
68
+ }
69
+
70
+ [data-start-function-instance-viewer-nav],
71
+ [data-start-functions-nav] {
72
+ padding: 0.5rem;
73
+ display: flex;
74
+ align-items: center;
75
+ gap: 0.5rem;
76
+
77
+ justify-content: space-between;
78
+
79
+ position: sticky;
80
+ top: 0;
81
+
82
+ border-bottom: oklch(87% 0.065 274.039) 1px solid;
83
+
84
+ background: oklch(25.7% 0.09 281.288);
85
+ }
86
+
87
+ [data-start-functions-nav] svg {
88
+ padding: 0.25rem;
89
+ }
90
+
91
+ [data-start-function-instance-viewer-nav-left] {
92
+ display: flex;
93
+ align-items: center;
94
+ gap: 0.5rem;
95
+ }
96
+
97
+ [data-start-function-instance-viewer-nav-left] > div {
98
+ display: flex;
99
+ align-items: center;
100
+ gap: 0.5rem;
101
+ }
102
+
103
+ [data-start-function-instance-viewer-content] {
104
+ height: 100%;
105
+ }
106
+
107
+ [data-start-function-instance-viewer-content] > [tc-tab-group] {
108
+ height: 100%;
109
+ }
@@ -0,0 +1,19 @@
1
+ export type ServerFunctionRequest = {
2
+ type: "request";
3
+ id: string;
4
+ instance: string;
5
+ source: Request;
6
+ time: number;
7
+ };
8
+ export type ServerFunctionResponse = {
9
+ type: "response";
10
+ id: string;
11
+ instance: string;
12
+ source: Response;
13
+ time: number;
14
+ };
15
+ export type ServerFunctionCall = ServerFunctionRequest | ServerFunctionResponse;
16
+ export type ServerFunctionCallListener = (event: ServerFunctionCall) => void;
17
+ export declare function captureServerFunctionCall(listener: ServerFunctionCallListener): () => void;
18
+ export declare function pushRequest(id: string, instance: string, source: Request): void;
19
+ export declare function pushResponse(id: string, instance: string, source: Response): void;
@@ -0,0 +1,29 @@
1
+ const LISTENERS = new Set();
2
+ export function captureServerFunctionCall(listener) {
3
+ LISTENERS.add(listener);
4
+ return () => LISTENERS.delete(listener);
5
+ }
6
+ export function pushRequest(id, instance, source) {
7
+ const event = {
8
+ type: "request",
9
+ id,
10
+ instance,
11
+ source,
12
+ time: performance.now(),
13
+ };
14
+ for (const listener of new Set(LISTENERS)) {
15
+ listener(event);
16
+ }
17
+ }
18
+ export function pushResponse(id, instance, source) {
19
+ const event = {
20
+ type: "response",
21
+ id,
22
+ instance,
23
+ source,
24
+ time: performance.now(),
25
+ };
26
+ for (const listener of new Set(LISTENERS)) {
27
+ listener(event);
28
+ }
29
+ }
@@ -23,6 +23,15 @@ export declare function DiscordIcon(props: JSX.IntrinsicElements["svg"] & {
23
23
  export declare function GithubIcon(props: JSX.IntrinsicElements["svg"] & {
24
24
  title: string;
25
25
  }): JSX.Element;
26
+ export declare function ErrorIcon(props: JSX.IntrinsicElements["svg"] & {
27
+ title: string;
28
+ }): JSX.Element;
26
29
  export declare function SolidStartIcon(props: JSX.IntrinsicElements["svg"] & {
27
30
  title: string;
28
31
  }): JSX.Element;
32
+ export declare function FunctionIcon(props: JSX.IntrinsicElements["svg"] & {
33
+ title: string;
34
+ }): JSX.Element;
35
+ export declare function TrashIcon(props: JSX.IntrinsicElements["svg"] & {
36
+ title: string;
37
+ }): JSX.Element;
@@ -48,11 +48,17 @@ export function GithubIcon(props) {
48
48
  <path fill-rule="evenodd" clip-rule="evenodd" d="M12.026 2c-5.509 0-9.974 4.465-9.974 9.974 0 4.406 2.857 8.145 6.821 9.465.499.09.679-.217.679-.481 0-.237-.008-.865-.011-1.696-2.775.602-3.361-1.338-3.361-1.338-.452-1.152-1.107-1.459-1.107-1.459-.905-.619.069-.605.069-.605 1.002.07 1.527 1.028 1.527 1.028.89 1.524 2.336 1.084 2.902.829.091-.645.351-1.085.635-1.334-2.214-.251-4.542-1.107-4.542-4.93 0-1.087.389-1.979 1.024-2.675-.101-.253-.446-1.268.099-2.64 0 0 .837-.269 2.742 1.021a9.582 9.582 0 0 1 2.496-.336 9.554 9.554 0 0 1 2.496.336c1.906-1.291 2.742-1.021 2.742-1.021.545 1.372.203 2.387.099 2.64.64.696 1.024 1.587 1.024 2.675 0 3.833-2.33 4.675-4.552 4.922.355.308.675.916.675 1.846 0 1.334-.012 2.41-.012 2.737 0 .267.178.577.687.479C19.146 20.115 22 16.379 22 11.974 22 6.465 17.535 2 12.026 2z"></path>
49
49
  </svg>);
50
50
  }
51
+ export function ErrorIcon(props) {
52
+ return (<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" {...props}>
53
+ <title>{props.title}</title>
54
+ <path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"/>
55
+ </svg>);
56
+ }
51
57
  export function SolidStartIcon(props) {
52
58
  return (<svg viewBox="0 0 701 701" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
53
59
  <title>{props.title}</title>
54
60
  <g filter="url(#filter0_d_1_2)">
55
- <rect width="693" height="693" transform="translate(4)" fill="white"/>
61
+ <rect width="693" height="693" transform="translate(4)" fill="none"/>
56
62
  <mask id="mask0_1_2" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="323" y="556" width="174" height="72">
57
63
  <path d="M323.508 627.978L435.81 619.384C435.81 619.384 474.315 613.168 496.842 576.082L417.413 556.809L323.508 627.978Z" fill="white"/>
58
64
  </mask>
@@ -148,3 +154,15 @@ export function SolidStartIcon(props) {
148
154
  </defs>
149
155
  </svg>);
150
156
  }
157
+ export function FunctionIcon(props) {
158
+ return (<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 24 24" stroke="currentColor" {...props}>
159
+ <title>{props.title}</title>
160
+ <path d="M6.59 19H5v2h1.59c3.02 0 5.58-2.26 5.95-5.26l.47-3.74H17v-2h-3.74l.3-2.37A3.01 3.01 0 0 1 16.54 5h2.47V3h-2.47a5 5 0 0 0-4.96 4.38L11.25 10H7.01v2H11l-.44 3.5c-.25 2-1.96 3.5-3.97 3.5"></path>
161
+ </svg>);
162
+ }
163
+ export function TrashIcon(props) {
164
+ return (<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" {...props}>
165
+ <title>{props.title}</title>
166
+ <path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/>
167
+ </svg>);
168
+ }
@@ -0,0 +1,88 @@
1
+ [data-start-dev-toolbar] {
2
+ position: fixed;
3
+
4
+ bottom: 0px;
5
+ left: 0px;
6
+
7
+ display: flex;
8
+ flex-direction: column-reverse;
9
+ align-items: flex-start;
10
+
11
+ cursor: grab;
12
+ }
13
+
14
+ [data-start-dev-toolbar]:active {
15
+ cursor: grabbing;
16
+ }
17
+
18
+ [data-start-dev-toolbar] > [tc-toolbar] {
19
+ position: relative;
20
+
21
+ background: oklch(25.7% 0.09 281.288);
22
+ margin: 1rem;
23
+ padding: 0.25rem 0.5rem;
24
+
25
+ overflow: hidden;
26
+ border-radius: 9999px;
27
+
28
+ display: flex;
29
+ flex-direction: row;
30
+ align-items: center;
31
+
32
+ gap: 0.5rem;
33
+
34
+ border: oklch(87% 0.065 274.039) 1px solid;
35
+ }
36
+
37
+ [data-start-dev-toolbar] > [tc-toolbar] > div {
38
+ display: flex;
39
+
40
+ flex-direction: row;
41
+ align-items: center;
42
+ justify-content: center;
43
+ }
44
+
45
+ [data-start-dev-toolbar] > [tc-toolbar] > div:last-child {
46
+ border-left: rgb(249 250 251) 1px solid;
47
+ padding-left: 0.5rem;
48
+
49
+ gap: 0.5rem;
50
+ }
51
+
52
+ [data-start-dev-toolbar-version] {
53
+ border-radius: 9999px;
54
+ color: rgb(249 250 251);
55
+ padding: 0.125rem 0.5rem;
56
+
57
+ font-size: 0.875rem;
58
+ line-height: 1.25rem;
59
+ font-weight: 600;
60
+
61
+ border: oklch(87% 0.065 274.039) 1px solid;
62
+ }
63
+
64
+ [data-start-dev-toolbar-version] > div {
65
+ height: 1.5rem;
66
+ width: 1.5rem;
67
+ }
68
+
69
+ [data-start-dev-toolbar] svg {
70
+ height: 1.25rem;
71
+ width: 1.25rem;
72
+ }
73
+
74
+ [data-start-dev-toolbar-panel] {
75
+ border: oklch(87% 0.065 274.039) 1px solid;
76
+ background: oklch(25.7% 0.09 281.288);
77
+ margin: 0rem 1rem;
78
+
79
+ overflow: auto;
80
+
81
+ width: 50rem;
82
+ height: 30rem;
83
+
84
+ max-width: calc(100vw - 10rem);
85
+ max-height: calc(100vh - 2rem);
86
+
87
+ border-radius: 1rem;
88
+ }
@@ -0,0 +1,6 @@
1
+ import { type JSX } from "solid-js";
2
+ import "./index.css";
3
+ export interface DevToolbarProps {
4
+ children?: JSX.Element;
5
+ }
6
+ export declare function DevToolbar(props: DevToolbarProps): JSX.Element;