@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,224 @@
1
+ [data-start-error-viewer] {
2
+ display: flex;
3
+ flex-direction: column;
4
+
5
+ width: 100%;
6
+ }
7
+
8
+ [data-start-error-viewer-navbar] {
9
+ display: flex;
10
+ flex-direction: row;
11
+ align-items: center;
12
+ justify-content: space-between;
13
+ gap: 0.5rem;
14
+ }
15
+
16
+ [data-start-error-viewer-pagination] {
17
+ display: flex;
18
+ flex-direction: row;
19
+ align-items: center;
20
+ justify-content: center;
21
+ gap: 0.5rem;
22
+ border-radius: 9999px;
23
+ color: rgb(249 250 251);
24
+ background-color: rgb(17 24 39);
25
+ padding: 0.25rem;
26
+ }
27
+
28
+ [data-start-error-viewer-button] {
29
+ /* empty */
30
+ }
31
+
32
+ [data-start-error-viewer-button]:hover {
33
+ color: rgb(229 231 235);
34
+ background-color: rgb(55 65 81);
35
+ }
36
+
37
+ [data-start-error-viewer-button]:focus {
38
+ outline: 2px solid transparent;
39
+ outline-offset: 2px;
40
+ outline-color: rgb(229 231 235);
41
+ }
42
+
43
+ [data-start-error-viewer-button]:focus-visible {
44
+ box-shadow: 0 0 0 calc(3px) rgb(17 24 39 / 0.75);
45
+ }
46
+
47
+ [data-start-error-viewer-button]:active {
48
+ color: rgb(243 244 246);
49
+ background-color: rgb(31 41 55);
50
+ }
51
+
52
+ [data-start-error-viewer-button] > svg {
53
+ height: 1.5rem;
54
+ width: 1.5rem;
55
+ }
56
+
57
+ [data-start-error-viewer-page-counter] {
58
+ font-size: 0.875rem;
59
+ line-height: 1.25rem;
60
+ font-weight: 600;
61
+ }
62
+
63
+ [data-start-error-viewer-navbar-left] {
64
+ display: flex;
65
+ flex-direction: row;
66
+ gap: 0.5rem;
67
+ }
68
+
69
+ [data-start-error-viewer-controls] {
70
+ display: flex;
71
+ flex-direction: row;
72
+ align-items: center;
73
+ justify-content: center;
74
+ gap: 0.25rem;
75
+ border-radius: 9999px;
76
+ color: rgb(249 250 251);
77
+ padding: 0.25rem;
78
+ }
79
+
80
+ [data-start-error-viewer-content] {
81
+ display: flex;
82
+ flex-direction: column;
83
+ gap: 0.75rem;
84
+ padding: 1rem;
85
+
86
+ border-top-width: 1px;
87
+ border-top-style: solid;
88
+ border-top-color: oklch(87% 0.065 274.039);
89
+ }
90
+
91
+ [data-start-error-viewer-error-info] {
92
+ display: flex;
93
+ flex-direction: column;
94
+ gap: 0.25rem;
95
+ }
96
+
97
+ [data-start-error-viewer-error-info-name] {
98
+ font-weight: 700;
99
+ color: rgb(249 250 251);
100
+ }
101
+
102
+ [data-start-error-viewer-error-info-message] {
103
+ font-size: 1.5rem;
104
+ line-height: 2rem;
105
+ color: rgb(239 68 68);
106
+ font-weight: 700;
107
+ }
108
+
109
+ [data-start-error-viewer-stack-frames-content] {
110
+ display: flex;
111
+ flex-direction: column;
112
+ gap: 0.75rem;
113
+ }
114
+
115
+ [data-start-error-viewer-stack-frames] {
116
+ flex: 1 1 0%;
117
+ max-height: 16rem;
118
+ overflow-y: auto;
119
+ }
120
+
121
+ [data-start-error-viewer-stack-frame] {
122
+ display: flex;
123
+ flex-direction: row;
124
+ align-items: center;
125
+ justify-content: space-between;
126
+ gap: 1rem;
127
+ color: rgb(249 250 251);
128
+ cursor: default;
129
+ user-select: none;
130
+ padding-top: 0.5rem;
131
+ padding-bottom: 0.5rem;
132
+ padding-left: 1rem;
133
+ padding-right: 1rem;
134
+ font-size: 0.875rem;
135
+ line-height: 1.25rem;
136
+ outline: none;
137
+ }
138
+
139
+ [data-start-error-viewer-stack-frame][tc-active],
140
+ [data-start-error-viewer-stack-frame][tc-selected],
141
+ [data-start-error-viewer-stack-frame]:focus {
142
+ color: rgb(219 234 254);
143
+ background-color: rgb(30 58 138);
144
+ }
145
+
146
+ [data-start-error-viewer-stack-frame-function] {
147
+ font-weight: 700;
148
+ }
149
+
150
+ [data-start-error-viewer-stack-frame-file] {
151
+ white-space: nowrap;
152
+ font-size: 0.75rem;
153
+ /* 12px */
154
+ line-height: 1rem;
155
+ /* 16px */
156
+ }
157
+
158
+ [data-start-error-viewer-stack-frames-code] {
159
+ padding: 0.5rem 1rem;
160
+ gap: 0.25rem;
161
+ flex: 1 1 0%;
162
+ display: flex;
163
+ flex-direction: column;
164
+ align-items: center;
165
+ justify-content: center;
166
+ border-radius: 0.5rem;
167
+ background-color: rgb(17 24 39);
168
+ }
169
+
170
+ [data-start-error-viewer-stack-frames-code-fallback] {
171
+ display: flex;
172
+ align-items: center;
173
+ justify-content: center;
174
+ color: rgb(249 250 251);
175
+ min-height: 16rem;
176
+ font-size: 0.875rem;
177
+ line-height: 1.25rem;
178
+ }
179
+
180
+ [data-start-error-viewer-stack-frames-code-source] {
181
+ font-size: 0.875rem;
182
+ line-height: 1.25rem;
183
+ color: rgb(249 250 251);
184
+ }
185
+
186
+ [data-start-error-viewer-stack-frames-code-container] {
187
+ width: 100%;
188
+ overflow: hidden;
189
+ min-width: 100%;
190
+ max-height: 16rem;
191
+ border-top-width: 1px;
192
+ border-top-style: solid;
193
+ border-top-color: oklch(87% 0.065 274.039);
194
+ }
195
+
196
+ [data-start-error-viewer-code-view] {
197
+ overflow: auto;
198
+ min-width: 100%;
199
+ }
200
+
201
+ [data-start-error-viewer-code-view] > .shiki {
202
+ float: left;
203
+ min-width: 100%;
204
+ overflow-x: auto;
205
+ font-size: 0.75rem;
206
+ line-height: 1rem;
207
+ counter-reset: step;
208
+ counter-increment: step calc(var(--error-viewer-code-view-start, 1) - 1);
209
+ background-color: transparent !important;
210
+ }
211
+
212
+ [data-start-error-viewer-code-view] > .shiki .line::before {
213
+ content: counter(step);
214
+ counter-increment: step;
215
+ width: 1rem;
216
+ margin-right: 1.5rem;
217
+ display: inline-block;
218
+ text-align: right;
219
+ color: rgba(115, 138, 148, 0.4);
220
+ }
221
+
222
+ [data-start-error-viewer-error-line] {
223
+ background-color: rgba(239, 68, 68, 0.4);
224
+ }
@@ -0,0 +1,4 @@
1
+ [data-start-blob-viewer] svg {
2
+ width: 1rem;
3
+ height: 1rem;
4
+ }
@@ -0,0 +1,6 @@
1
+ import { type JSX } from "solid-js";
2
+ import "./BlobViewer.css";
3
+ export interface BlobViewerProps {
4
+ source: Blob | File | Promise<Blob | File>;
5
+ }
6
+ export declare function BlobViewer(props: BlobViewerProps): JSX.Element;
@@ -0,0 +1,37 @@
1
+ import { createMemo, createResource, onCleanup, Show, Suspense } from "solid-js";
2
+ import { Badge } from "../../ui/Badge.jsx";
3
+ import Button from "../../ui/Button.jsx";
4
+ import "./BlobViewer.css";
5
+ function DocumentIcon(props) {
6
+ return (<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" {...props}>
7
+ <title>{props.title}</title>
8
+ <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"/>
9
+ </svg>);
10
+ }
11
+ function BlobViewerInner(props) {
12
+ const fileURL = createMemo(() => URL.createObjectURL(props.source));
13
+ onCleanup(() => {
14
+ URL.revokeObjectURL(fileURL());
15
+ });
16
+ function openFileInNewTab() {
17
+ const link = document.createElement("a");
18
+ link.href = fileURL();
19
+ link.target = "_blank"; // Open in a new tab
20
+ link.style.display = "none"; // Hide the link
21
+ document.body.appendChild(link);
22
+ link.click();
23
+ document.body.removeChild(link);
24
+ }
25
+ return (<Button data-start-blob-viewer onClick={() => openFileInNewTab()}>
26
+ {props.source instanceof File ? (<Badge type="info">
27
+ <DocumentIcon title={props.source.name}/>
28
+ {props.source.name}
29
+ </Badge>) : (<Badge type="info">{props.source.type}</Badge>)}
30
+ </Button>);
31
+ }
32
+ export function BlobViewer(props) {
33
+ const [data] = createResource(() => props.source);
34
+ return (<Suspense>
35
+ <Show when={data()}>{current => <BlobViewerInner source={current()}/>}</Show>
36
+ </Suspense>);
37
+ }
@@ -0,0 +1,5 @@
1
+ import { type JSX } from "solid-js";
2
+ export interface FormDataViewerProps {
3
+ source: FormData | Promise<FormData>;
4
+ }
5
+ export declare function FormDataViewer(props: FormDataViewerProps): JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { createResource, For, Show, Suspense } from "solid-js";
2
+ import { Section } from "../../ui/Section.jsx";
3
+ import { BlobViewer } from "./BlobViewer.jsx";
4
+ import { PropertySeparator, SerovalValue } from "./SerovalValue.jsx";
5
+ function FormDataViewerInner(props) {
6
+ return (<Section title="FormData" options={{ size: "sm" }}>
7
+ <div data-start-form-data-viewer data-start-properties>
8
+ <For each={Array.from(props.source.entries())}>
9
+ {([key, value]) => (<div data-start-property>
10
+ <SerovalValue value={`"${key}"`}/>
11
+ <PropertySeparator />
12
+ {typeof value === "string" ? (<SerovalValue value={`"${JSON.stringify(value)}"`}/>) : (<BlobViewer source={value}/>)}
13
+ </div>)}
14
+ </For>
15
+ </div>
16
+ </Section>);
17
+ }
18
+ export function FormDataViewer(props) {
19
+ const [data] = createResource(() => props.source);
20
+ return (<Suspense>
21
+ <Show when={data()}>{current => <FormDataViewerInner source={current()}/>}</Show>
22
+ </Suspense>);
23
+ }
@@ -0,0 +1,8 @@
1
+ [data-start-headers-viewer] {
2
+ font-size: 0.75rem;
3
+ line-height: 1rem;
4
+ }
5
+
6
+ [data-start-headers-viewer] > [data-start-property] > *:first-child {
7
+ text-transform: capitalize;
8
+ }
@@ -0,0 +1,6 @@
1
+ import "./HeadersViewer.css";
2
+ interface HeadersViewerProps {
3
+ headers: Headers;
4
+ }
5
+ export declare function HeadersViewer(props: HeadersViewerProps): import("solid-js").JSX.Element;
6
+ export {};
@@ -0,0 +1,15 @@
1
+ import { For } from "solid-js";
2
+ import { PropertySeparator, SerovalValue } from "./SerovalValue.jsx";
3
+ import "./HeadersViewer.css";
4
+ import { Text } from "../../ui/Text.jsx";
5
+ export function HeadersViewer(props) {
6
+ return (<div data-start-headers-viewer data-start-properties>
7
+ <For each={Array.from(props.headers.entries())}>
8
+ {([key, value]) => (<div data-start-property>
9
+ <Text options={{ size: "xs", weight: "semibold", wrap: "nowrap" }}>{key}</Text>
10
+ <PropertySeparator />
11
+ <SerovalValue value={value}/>
12
+ </div>)}
13
+ </For>
14
+ </div>);
15
+ }
@@ -0,0 +1,34 @@
1
+ [data-start-hex-viewer] {
2
+ display: flex;
3
+ border: 1px oklch(87% 0.065 274.039) solid;
4
+ overflow: auto;
5
+ }
6
+
7
+ [data-start-hex-viewer-bytes] {
8
+ flex: 1;
9
+ display: flex;
10
+ flex-direction: column;
11
+ gap: 0.5rem;
12
+ padding: 0.5rem;
13
+ }
14
+
15
+ [data-start-hex-viewer-text] {
16
+ flex: 1;
17
+ display: flex;
18
+ flex-direction: column;
19
+ gap: 0.5rem;
20
+ padding: 0.5rem;
21
+ border-left: 1px oklch(87% 0.065 274.039) solid;
22
+ }
23
+
24
+ [data-start-hex-row] {
25
+ display: flex;
26
+ align-items: center;
27
+ gap: 1rem;
28
+ }
29
+
30
+ [data-start-hex-text] {
31
+ display: flex;
32
+ align-items: center;
33
+ justify-content: start;
34
+ }
@@ -0,0 +1,11 @@
1
+ import { type JSX } from "solid-js";
2
+ import "./HexViewer.css";
3
+ interface HexViewerInnerProps {
4
+ bytes: Uint8Array;
5
+ }
6
+ export declare function HexViewerInner(props: HexViewerInnerProps): JSX.Element;
7
+ export interface HexViewerProps {
8
+ bytes: Uint8Array | Promise<Uint8Array>;
9
+ }
10
+ export declare function HexViewer(props: HexViewerProps): JSX.Element;
11
+ export {};
@@ -0,0 +1,70 @@
1
+ import { createMemo, createResource, For, Show, Suspense } from "solid-js";
2
+ import { Text } from "../../ui/Text.jsx";
3
+ import "./HexViewer.css";
4
+ function toHex(num, digits = 2) {
5
+ return num.toString(16).padStart(digits, "0").toUpperCase();
6
+ }
7
+ function HexChunk(props) {
8
+ const content = createMemo(() => {
9
+ const byte1 = props.bytes[0] || 0;
10
+ const byte2 = props.bytes[1] || 0;
11
+ const byte3 = props.bytes[2] || 0;
12
+ const byte4 = props.bytes[3] || 0;
13
+ return `${toHex(byte1)} ${toHex(byte2)} ${toHex(byte3)} ${toHex(byte4)}`;
14
+ });
15
+ return (<Text data-start-hex-chunk options={{ size: "xs", weight: "bold", wrap: "nowrap" }}>
16
+ {content()}
17
+ </Text>);
18
+ }
19
+ function HexRow(props) {
20
+ const chunk1 = createMemo(() => props.bytes.subarray(0, 4));
21
+ const chunk2 = createMemo(() => props.bytes.subarray(4, 8));
22
+ const chunk3 = createMemo(() => props.bytes.subarray(8, 12));
23
+ const chunk4 = createMemo(() => props.bytes.subarray(12, 16));
24
+ return (<div data-start-hex-row>
25
+ <HexChunk bytes={chunk1()}/>
26
+ <HexChunk bytes={chunk2()}/>
27
+ <HexChunk bytes={chunk3()}/>
28
+ <HexChunk bytes={chunk4()}/>
29
+ </div>);
30
+ }
31
+ function replaceString(string) {
32
+ const result = string.codePointAt(0);
33
+ if (result == null) {
34
+ return string;
35
+ }
36
+ return String.fromCodePoint(result + 0x2400);
37
+ }
38
+ function HexText(props) {
39
+ const text = createMemo(() => {
40
+ const decoder = new TextDecoder();
41
+ const result = decoder.decode(props.bytes).replaceAll(/[\x00-\x1F]/g, replaceString);
42
+ return result;
43
+ });
44
+ return (<div data-start-hex-text>
45
+ <Text options={{ size: "xs", weight: "bold", wrap: "nowrap" }}>{text()}</Text>
46
+ </div>);
47
+ }
48
+ export function HexViewerInner(props) {
49
+ const rows = createMemo(() => {
50
+ const arrays = [];
51
+ for (let i = 0, len = props.bytes.length; i < len; i += 16) {
52
+ arrays.push(props.bytes.subarray(i, i + 16));
53
+ }
54
+ return arrays;
55
+ });
56
+ return (<div data-start-hex-viewer>
57
+ <div data-start-hex-viewer-bytes>
58
+ <For each={rows()}>{current => <HexRow bytes={current}/>}</For>
59
+ </div>
60
+ <div data-start-hex-viewer-text>
61
+ <For each={rows()}>{current => <HexText bytes={current}/>}</For>
62
+ </div>
63
+ </div>);
64
+ }
65
+ export function HexViewer(props) {
66
+ const [data] = createResource(() => props.bytes);
67
+ return (<Suspense>
68
+ <Show when={data()}>{current => <HexViewerInner bytes={current()}/>}</Show>
69
+ </Suspense>);
70
+ }
@@ -0,0 +1,5 @@
1
+ [data-start-seroval-value] {
2
+ display: flex;
3
+ gap: 0.25rem;
4
+ align-items: center;
5
+ }
@@ -0,0 +1,7 @@
1
+ import "./SerovalValue.css";
2
+ interface SerovalValueProps {
3
+ value: string | number | boolean | undefined | null;
4
+ }
5
+ export declare function SerovalValue(props: SerovalValueProps): import("solid-js").JSX.Element;
6
+ export declare function PropertySeparator(): import("solid-js").JSX.Element;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Text } from "../../ui/Text.jsx";
2
+ import "./SerovalValue.css";
3
+ export function SerovalValue(props) {
4
+ return (<Text data-start-seroval-value options={{ size: "xs", weight: "semibold", wrap: "nowrap" }}>
5
+ {`${props.value}`}
6
+ </Text>);
7
+ }
8
+ export function PropertySeparator() {
9
+ return <Text options={{ size: "xs", weight: "semibold", wrap: "nowrap" }}>:</Text>;
10
+ }
@@ -0,0 +1,70 @@
1
+ [data-start-seroval-viewer] {
2
+ display: grid;
3
+ grid-template-columns: 1fr 2fr;
4
+ }
5
+
6
+ [data-start-seroval-promise] {
7
+ display: flex;
8
+ gap: 0.5rem;
9
+ align-items: center;
10
+ }
11
+
12
+ [data-start-seroval-renderer] {
13
+ display: flex;
14
+ border-top: 1px oklch(87% 0.065 274.039) solid;
15
+ border-bottom: 1px oklch(87% 0.065 274.039) solid;
16
+ }
17
+
18
+ [data-start-seroval-renderer] > * {
19
+ border-left: 1px oklch(87% 0.065 274.039) solid;
20
+ }
21
+
22
+ [data-start-seroval-renderer]:last-child {
23
+ border-right: 1px oklch(87% 0.065 274.039) solid;
24
+ }
25
+
26
+ [data-start-seroval-node] {
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: 0.25rem;
30
+ padding: 0.25rem;
31
+
32
+ width: 100%;
33
+ max-width: 16rem;
34
+ }
35
+
36
+ [data-start-seroval-node-header] {
37
+ position: sticky;
38
+ top: 0;
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: space-between;
42
+ color: rgb(249 250 251);
43
+ }
44
+
45
+ [data-start-seroval-node-content] {
46
+ display: flex;
47
+ flex-direction: column;
48
+ gap: 0.25rem;
49
+ }
50
+
51
+ [data-start-seroval-value] {
52
+ color: rgb(249 250 251);
53
+ }
54
+
55
+ [data-start-seroval-value-wrapper] {
56
+ display: inline-flex;
57
+ gap: 0.25rem;
58
+ align-items: center;
59
+ }
60
+
61
+ [data-start-seroval-link] {
62
+ display: inline-flex;
63
+ gap: 0.25rem;
64
+ align-items: center;
65
+ }
66
+
67
+ [data-start-seroval-link] > svg {
68
+ width: 1rem;
69
+ height: 1rem;
70
+ }
@@ -0,0 +1,6 @@
1
+ import { type JSX } from "solid-js";
2
+ import "./SerovalViewer.css";
3
+ export interface SerovalViewerProps {
4
+ stream: Request | Response;
5
+ }
6
+ export declare function SerovalViewer(props: SerovalViewerProps): JSX.Element;