vinojs 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.mjs +1 -1
- package/dist/{compile-Lxl_tdxL.mjs → compile-glNMkyyx.mjs} +3 -47
- package/dist/compile-glNMkyyx.mjs.map +1 -0
- package/dist/{definePage-Ba4r-TFh.mjs → definePage--9Pz7rHs.mjs} +29 -7
- package/dist/definePage--9Pz7rHs.mjs.map +1 -0
- package/dist/defineServerFn-H-bz7xBX.mjs +47 -0
- package/dist/defineServerFn-H-bz7xBX.mjs.map +1 -0
- package/dist/factory-CVT0-OZw.d.mts +187 -0
- package/dist/factory-CVT0-OZw.d.mts.map +1 -0
- package/dist/factory.d.mts +2 -0
- package/dist/factory.mjs +153 -0
- package/dist/factory.mjs.map +1 -0
- package/dist/vino.d.mts +4 -103
- package/dist/vino.d.mts.map +1 -1
- package/dist/vino.mjs +8 -3
- package/dist/vino.mjs.map +1 -1
- package/dist/vite.mjs +3 -2
- package/dist/vite.mjs.map +1 -1
- package/package.json +5 -1
- package/dist/compile-Lxl_tdxL.mjs.map +0 -1
- package/dist/definePage-Ba4r-TFh.mjs.map +0 -1
- package/examples/basic/dist/client/.assetsignore +0 -2
- package/examples/basic/dist/client/about.html +0 -1
- package/examples/basic/dist/client/admin.html +0 -1
- package/examples/basic/dist/client/assets/Counter-BvqMZKON.js +0 -1
- package/examples/basic/dist/client/assets/_slug_-CYpOSbrn.js +0 -1
- package/examples/basic/dist/client/assets/about-BZXRzUyv.js +0 -1
- package/examples/basic/dist/client/assets/admin-DRE7uh2s.js +0 -1
- package/examples/basic/dist/client/assets/client-B6nFkut5.js +0 -1
- package/examples/basic/dist/client/assets/client-pages-Bc6cNZAm.js +0 -2
- package/examples/basic/dist/client/assets/components-DX9r6vHn.js +0 -1
- package/examples/basic/dist/client/assets/components-DsWJ6F73.js +0 -2
- package/examples/basic/dist/client/assets/counter-DBpvln_F.js +0 -1
- package/examples/basic/dist/client/assets/dom-B5sHIJ1E.js +0 -1
- package/examples/basic/dist/client/assets/honoto-9UtdLp4J.js +0 -33
- package/examples/basic/dist/client/assets/honoto-client-DEh86_WZ.css +0 -1
- package/examples/basic/dist/client/assets/honoto-client.js +0 -2
- package/examples/basic/dist/client/assets/hooks-Cz6AT21d.js +0 -1
- package/examples/basic/dist/client/assets/jsx-dev-runtime-92VDsVyo.js +0 -1
- package/examples/basic/dist/client/counter.html +0 -1
- package/examples/basic/dist/client/index.html +0 -1
- package/examples/basic/dist/client/jobs.html +0 -1
- package/examples/basic/dist/ssr/.vite/manifest.json +0 -140
- package/examples/basic/dist/ssr/assets/_slug_-CY3-kffX.js +0 -46
- package/examples/basic/dist/ssr/assets/about-CTDjNhkO.js +0 -15
- package/examples/basic/dist/ssr/assets/admin-DvS-UGJx.js +0 -26
- package/examples/basic/dist/ssr/assets/constants-UoriGYcX-CUecBFMT.js +0 -6
- package/examples/basic/dist/ssr/assets/counter-DfIbc9Sp.js +0 -30
- package/examples/basic/dist/ssr/assets/honoto-CA313cVy.js +0 -2129
- package/examples/basic/dist/ssr/assets/jobs-D9hh-UO9.js +0 -42
- package/examples/basic/dist/ssr/assets/jsx-CgYLQazd.js +0 -1080
- package/examples/basic/dist/ssr/assets/jsx-dev-runtime-BlUda7H8.js +0 -742
- package/examples/basic/dist/ssr/assets/jsx-renderer-CzZcZPnS.js +0 -65
- package/examples/basic/dist/ssr/assets/layout-DYvLwr2u.js +0 -53
- package/examples/basic/dist/ssr/assets/pages-DB6jeyrt.js +0 -53
- package/examples/basic/dist/ssr/assets/rolldown-runtime-D7D4PA-g.js +0 -13
- package/examples/basic/dist/ssr/assets/ssr-hooks-CBQr0cdH.js +0 -7
- package/examples/basic/dist/ssr/index.js +0 -22
- package/examples/basic/dist/ssr/wrangler.json +0 -1
- package/examples/full/dist/client/.assetsignore +0 -2
- package/examples/full/dist/client/assets/BookmarkButton-py0xGxgl.js +0 -1
- package/examples/full/dist/client/assets/_slug_-DZUFsE9O.js +0 -1
- package/examples/full/dist/client/assets/auth-client-D2Wtuobe.js +0 -1
- package/examples/full/dist/client/assets/bun-sqlite-dialect-C7ftEUSI-CsHdUKBY.js +0 -1
- package/examples/full/dist/client/assets/client-B6nFkut5.js +0 -1
- package/examples/full/dist/client/assets/client-pages-fshKs747.js +0 -2
- package/examples/full/dist/client/assets/components-DX9r6vHn.js +0 -1
- package/examples/full/dist/client/assets/components-S_-rWrKi.js +0 -2
- package/examples/full/dist/client/assets/d1-sqlite-dialect-BZmaVTp8-FPCaMZqX.js +0 -1
- package/examples/full/dist/client/assets/default-query-compiler-CUdqIu1h.js +0 -1
- package/examples/full/dist/client/assets/dist-BoGTNvkC.js +0 -1
- package/examples/full/dist/client/assets/dom-DCd3wYW7.js +0 -1
- package/examples/full/dist/client/assets/factory-Bgf4EtLx.js +0 -8
- package/examples/full/dist/client/assets/honoto-client-BSvNAnxN.css +0 -1
- package/examples/full/dist/client/assets/honoto-client.js +0 -2
- package/examples/full/dist/client/assets/hooks-Cz6AT21d.js +0 -1
- package/examples/full/dist/client/assets/jsx-dev-runtime-92VDsVyo.js +0 -1
- package/examples/full/dist/client/assets/kysely-adapter-BHhasAnc.js +0 -1
- package/examples/full/dist/client/assets/kysely-migration-tables-DFfmKhq--U5ujlMwE.js +0 -1
- package/examples/full/dist/client/assets/node-sqlite-dialect-DJDXH5Ot.js +0 -1
- package/examples/full/dist/client/assets/pages-CUQx6Eus.js +0 -1
- package/examples/full/dist/client/assets/saved-jIi74ncJ.js +0 -1
- package/examples/full/dist/client/assets/session-B-accyM3.js +0 -611
- package/examples/full/dist/client/assets/sign-in-BelI3gSs.js +0 -1
- package/examples/full/dist/client/assets/sign-up-pR94lfdu.js +0 -1
- package/examples/full/dist/client/index.html +0 -1
- package/examples/full/dist/client/saved.html +0 -1
- package/examples/full/dist/client/sign-in.html +0 -1
- package/examples/full/dist/client/sign-up.html +0 -1
- package/examples/full/dist/ssr/.dev.vars +0 -1
- package/examples/full/dist/ssr/.vite/manifest.json +0 -219
- package/examples/full/dist/ssr/assets/BookmarkButton-KS7z5_vi.js +0 -298
- package/examples/full/dist/ssr/assets/_slug_-rRStRaAN.js +0 -89
- package/examples/full/dist/ssr/assets/auth-DSFZ4iak.js +0 -31434
- package/examples/full/dist/ssr/assets/auth-client-BFSBVoML.js +0 -894
- package/examples/full/dist/ssr/assets/bun-sqlite-dialect-C7ftEUSI-BeXpIqKl.js +0 -162
- package/examples/full/dist/ssr/assets/compiled-query-DmoyCh28.js +0 -8410
- package/examples/full/dist/ssr/assets/d1-sqlite-dialect-BZmaVTp8-CjJdvL94.js +0 -114
- package/examples/full/dist/ssr/assets/default-query-compiler-D7xOzCCJ.js +0 -1727
- package/examples/full/dist/ssr/assets/dist-LmmDoNdk.js +0 -6832
- package/examples/full/dist/ssr/assets/dist-kFDN1l4Z.js +0 -342
- package/examples/full/dist/ssr/assets/factory-AD6s9SIW.js +0 -2079
- package/examples/full/dist/ssr/assets/jsx-renderer-mMLf5XLN.js +0 -1926
- package/examples/full/dist/ssr/assets/kysely-adapter-BCLenpM8.js +0 -2
- package/examples/full/dist/ssr/assets/kysely-migration-tables-DFfmKhq--BtVr6hRe.js +0 -17
- package/examples/full/dist/ssr/assets/layout-mVA7qP4j.js +0 -44
- package/examples/full/dist/ssr/assets/node-sqlite-dialect-D-wtYAD7.js +0 -162
- package/examples/full/dist/ssr/assets/pages-Do5kR_Ia.js +0 -147
- package/examples/full/dist/ssr/assets/saved-Dr4pP6B5.js +0 -111
- package/examples/full/dist/ssr/assets/session-BvIpX7tr.js +0 -13
- package/examples/full/dist/ssr/assets/sign-in-22pzTnJE.js +0 -115
- package/examples/full/dist/ssr/assets/sign-up-CN4j8Qg1.js +0 -117
- package/examples/full/dist/ssr/assets/sqlite-adapter-DVlms5wO.js +0 -79
- package/examples/full/dist/ssr/index.js +0 -97
- package/examples/full/dist/ssr/wrangler.json +0 -1
|
@@ -1,742 +0,0 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
//#region ../../node_modules/.pnpm/hono@4.13.3/node_modules/hono/dist/utils/html.js
|
|
3
|
-
var HtmlEscapedCallbackPhase = {
|
|
4
|
-
Stringify: 1,
|
|
5
|
-
BeforeStream: 2,
|
|
6
|
-
Stream: 3
|
|
7
|
-
};
|
|
8
|
-
var raw = (value, callbacks) => {
|
|
9
|
-
const escapedString = new String(value);
|
|
10
|
-
escapedString.isEscaped = true;
|
|
11
|
-
escapedString.callbacks = callbacks;
|
|
12
|
-
return escapedString;
|
|
13
|
-
};
|
|
14
|
-
var escapeRe = /[&<>'"]/;
|
|
15
|
-
var stringBufferToString = async (buffer, callbacks) => {
|
|
16
|
-
let str = "";
|
|
17
|
-
callbacks ||= [];
|
|
18
|
-
const resolvedBuffer = await Promise.all(buffer);
|
|
19
|
-
for (let i = resolvedBuffer.length - 1;; i--) {
|
|
20
|
-
str += resolvedBuffer[i];
|
|
21
|
-
i--;
|
|
22
|
-
if (i < 0) break;
|
|
23
|
-
let r = resolvedBuffer[i];
|
|
24
|
-
if (typeof r === "object") callbacks.push(...r.callbacks || []);
|
|
25
|
-
const isEscaped = r.isEscaped;
|
|
26
|
-
r = await (typeof r === "object" ? r.toString() : r);
|
|
27
|
-
if (typeof r === "object") callbacks.push(...r.callbacks || []);
|
|
28
|
-
if (r.isEscaped ?? isEscaped) str += r;
|
|
29
|
-
else {
|
|
30
|
-
const buf = [str];
|
|
31
|
-
escapeToBuffer(r, buf);
|
|
32
|
-
str = buf[0];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return raw(str, callbacks);
|
|
36
|
-
};
|
|
37
|
-
var escapeToBuffer = (str, buffer) => {
|
|
38
|
-
const match = str.search(escapeRe);
|
|
39
|
-
if (match === -1) {
|
|
40
|
-
buffer[0] += str;
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
let escape;
|
|
44
|
-
let index;
|
|
45
|
-
let lastIndex = 0;
|
|
46
|
-
for (index = match; index < str.length; index++) {
|
|
47
|
-
switch (str.charCodeAt(index)) {
|
|
48
|
-
case 34:
|
|
49
|
-
escape = """;
|
|
50
|
-
break;
|
|
51
|
-
case 39:
|
|
52
|
-
escape = "'";
|
|
53
|
-
break;
|
|
54
|
-
case 38:
|
|
55
|
-
escape = "&";
|
|
56
|
-
break;
|
|
57
|
-
case 60:
|
|
58
|
-
escape = "<";
|
|
59
|
-
break;
|
|
60
|
-
case 62:
|
|
61
|
-
escape = ">";
|
|
62
|
-
break;
|
|
63
|
-
default: continue;
|
|
64
|
-
}
|
|
65
|
-
buffer[0] += str.substring(lastIndex, index) + escape;
|
|
66
|
-
lastIndex = index + 1;
|
|
67
|
-
}
|
|
68
|
-
buffer[0] += str.substring(lastIndex, index);
|
|
69
|
-
};
|
|
70
|
-
var resolveCallbackSync = (str) => {
|
|
71
|
-
const callbacks = str.callbacks;
|
|
72
|
-
if (!callbacks?.length) return str;
|
|
73
|
-
const buffer = [str];
|
|
74
|
-
const context = {};
|
|
75
|
-
callbacks.forEach((c) => c({
|
|
76
|
-
phase: HtmlEscapedCallbackPhase.Stringify,
|
|
77
|
-
buffer,
|
|
78
|
-
context
|
|
79
|
-
}));
|
|
80
|
-
return buffer[0];
|
|
81
|
-
};
|
|
82
|
-
var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {
|
|
83
|
-
if (typeof str === "object" && !(str instanceof String)) {
|
|
84
|
-
if (!(str instanceof Promise)) str = str.toString();
|
|
85
|
-
if (str instanceof Promise) str = await str;
|
|
86
|
-
}
|
|
87
|
-
const callbacks = str.callbacks;
|
|
88
|
-
if (!callbacks?.length) return Promise.resolve(str);
|
|
89
|
-
if (buffer) buffer[0] += str;
|
|
90
|
-
else buffer = [str];
|
|
91
|
-
const resStr = Promise.all(callbacks.map((c) => c({
|
|
92
|
-
phase,
|
|
93
|
-
buffer,
|
|
94
|
-
context
|
|
95
|
-
}))).then((res) => Promise.all(res.filter(Boolean).map((str2) => resolveCallback(str2, phase, false, context, buffer))).then(() => buffer[0]));
|
|
96
|
-
if (preserveCallbacks) return raw(await resStr, callbacks);
|
|
97
|
-
else return resStr;
|
|
98
|
-
};
|
|
99
|
-
//#endregion
|
|
100
|
-
//#region ../../node_modules/.pnpm/hono@4.13.3/node_modules/hono/dist/jsx/constants.js
|
|
101
|
-
var DOM_RENDERER = /* @__PURE__ */ Symbol("RENDERER");
|
|
102
|
-
var DOM_ERROR_HANDLER = /* @__PURE__ */ Symbol("ERROR_HANDLER");
|
|
103
|
-
var DOM_STASH = /* @__PURE__ */ Symbol("STASH");
|
|
104
|
-
var DOM_INTERNAL_TAG = /* @__PURE__ */ Symbol("INTERNAL");
|
|
105
|
-
var DOM_MEMO = /* @__PURE__ */ Symbol("MEMO");
|
|
106
|
-
var PERMALINK = /* @__PURE__ */ Symbol("PERMALINK");
|
|
107
|
-
//#endregion
|
|
108
|
-
//#region ../../node_modules/.pnpm/hono@4.13.3/node_modules/hono/dist/jsx/dom/utils.js
|
|
109
|
-
var setInternalTagFlag = (fn) => {
|
|
110
|
-
fn[DOM_INTERNAL_TAG] = true;
|
|
111
|
-
return fn;
|
|
112
|
-
};
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region ../../node_modules/.pnpm/hono@4.13.3/node_modules/hono/dist/jsx/dom/context.js
|
|
115
|
-
var createContextProviderFunction = (values) => ({ value, children }) => {
|
|
116
|
-
if (!children) return;
|
|
117
|
-
const props = { children: [{
|
|
118
|
-
tag: setInternalTagFlag(() => {
|
|
119
|
-
values.push(value);
|
|
120
|
-
}),
|
|
121
|
-
props: {}
|
|
122
|
-
}] };
|
|
123
|
-
if (Array.isArray(children)) props.children.push(...children.flat());
|
|
124
|
-
else props.children.push(children);
|
|
125
|
-
props.children.push({
|
|
126
|
-
tag: setInternalTagFlag(() => {
|
|
127
|
-
values.pop();
|
|
128
|
-
}),
|
|
129
|
-
props: {}
|
|
130
|
-
});
|
|
131
|
-
const res = {
|
|
132
|
-
tag: "",
|
|
133
|
-
props,
|
|
134
|
-
type: ""
|
|
135
|
-
};
|
|
136
|
-
res[DOM_ERROR_HANDLER] = (err) => {
|
|
137
|
-
values.pop();
|
|
138
|
-
throw err;
|
|
139
|
-
};
|
|
140
|
-
return res;
|
|
141
|
-
};
|
|
142
|
-
var createContext$1 = (defaultValue) => {
|
|
143
|
-
const values = [defaultValue];
|
|
144
|
-
const context = createContextProviderFunction(values);
|
|
145
|
-
context.values = values;
|
|
146
|
-
context.Provider = context;
|
|
147
|
-
globalContexts.push(context);
|
|
148
|
-
return context;
|
|
149
|
-
};
|
|
150
|
-
//#endregion
|
|
151
|
-
//#region ../../node_modules/.pnpm/hono@4.13.3/node_modules/hono/dist/jsx/context.js
|
|
152
|
-
var globalContexts = [];
|
|
153
|
-
var alsProbed = false;
|
|
154
|
-
var asyncLocalStorage;
|
|
155
|
-
var fallbackStore;
|
|
156
|
-
var fallbackRendersInFlight = 0;
|
|
157
|
-
var warnedFallbackDefault = false;
|
|
158
|
-
var loadAsyncLocalStorage = () => {
|
|
159
|
-
if (alsProbed) return asyncLocalStorage;
|
|
160
|
-
alsProbed = true;
|
|
161
|
-
const global = globalThis;
|
|
162
|
-
let AsyncLocalStorage;
|
|
163
|
-
for (const probe of [() => global.process?.getBuiltinModule?.("node:async_hooks")?.AsyncLocalStorage, () => global.process?.mainModule?.require?.("node:async_hooks")?.AsyncLocalStorage]) {
|
|
164
|
-
try {
|
|
165
|
-
AsyncLocalStorage = probe();
|
|
166
|
-
} catch {}
|
|
167
|
-
if (AsyncLocalStorage) break;
|
|
168
|
-
}
|
|
169
|
-
if (AsyncLocalStorage) asyncLocalStorage = new AsyncLocalStorage();
|
|
170
|
-
return asyncLocalStorage;
|
|
171
|
-
};
|
|
172
|
-
var getCurrentStore = () => {
|
|
173
|
-
return loadAsyncLocalStorage()?.getStore() || fallbackStore;
|
|
174
|
-
};
|
|
175
|
-
var warnIfStorelessAccess = () => {
|
|
176
|
-
if (fallbackRendersInFlight > 0 && !warnedFallbackDefault) {
|
|
177
|
-
warnedFallbackDefault = true;
|
|
178
|
-
console.warn("hono/jsx: AsyncLocalStorage is unavailable in this runtime, so useContext() after an await in an async component falls back to the context default value during server-side rendering. To get provided values across await boundaries, use a runtime with AsyncLocalStorage (Node.js >= 20.16, Deno, Bun, or Cloudflare Workers with the nodejs_compat flag).");
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
var getContextValuesIn = (store, context) => {
|
|
182
|
-
if (!store) {
|
|
183
|
-
warnIfStorelessAccess();
|
|
184
|
-
return context.values;
|
|
185
|
-
}
|
|
186
|
-
let values = store.get(context);
|
|
187
|
-
if (!values) {
|
|
188
|
-
values = [context.values[0]];
|
|
189
|
-
store.set(context, values);
|
|
190
|
-
}
|
|
191
|
-
return values;
|
|
192
|
-
};
|
|
193
|
-
var readContextValueIn = (store, context) => {
|
|
194
|
-
if (!store) {
|
|
195
|
-
warnIfStorelessAccess();
|
|
196
|
-
return context.values.at(-1);
|
|
197
|
-
}
|
|
198
|
-
const values = store.get(context);
|
|
199
|
-
return values?.length ? values.at(-1) : context.values[0];
|
|
200
|
-
};
|
|
201
|
-
var captureContextValues = (store) => (store ? globalContexts.filter((c) => store.has(c)) : globalContexts).map((c) => [c, readContextValueIn(store, c)]);
|
|
202
|
-
var resumeWithContextValues = (callback, store, contexts) => runWithRenderContext(() => {
|
|
203
|
-
const currentStore = getCurrentStore();
|
|
204
|
-
const valuesPerContext = contexts.map(([context, value]) => {
|
|
205
|
-
const values = getContextValuesIn(currentStore, context);
|
|
206
|
-
values.push(value);
|
|
207
|
-
return values;
|
|
208
|
-
});
|
|
209
|
-
const popContextValues = () => {
|
|
210
|
-
valuesPerContext.forEach((values) => {
|
|
211
|
-
values.pop();
|
|
212
|
-
});
|
|
213
|
-
};
|
|
214
|
-
try {
|
|
215
|
-
const result = callback();
|
|
216
|
-
if (result instanceof Promise) return result.finally(popContextValues);
|
|
217
|
-
popContextValues();
|
|
218
|
-
return result;
|
|
219
|
-
} catch (e) {
|
|
220
|
-
popContextValues();
|
|
221
|
-
throw e;
|
|
222
|
-
}
|
|
223
|
-
}, store);
|
|
224
|
-
var runWithRenderContext = (callback, resumeStore) => {
|
|
225
|
-
if (getCurrentStore()) return callback();
|
|
226
|
-
const store = resumeStore ?? /* @__PURE__ */ new WeakMap();
|
|
227
|
-
const storage = loadAsyncLocalStorage();
|
|
228
|
-
if (storage) return storage.run(store, callback);
|
|
229
|
-
fallbackStore = store;
|
|
230
|
-
let result;
|
|
231
|
-
try {
|
|
232
|
-
result = callback();
|
|
233
|
-
} finally {
|
|
234
|
-
fallbackStore = void 0;
|
|
235
|
-
}
|
|
236
|
-
if (!warnedFallbackDefault && result instanceof Promise) {
|
|
237
|
-
fallbackRendersInFlight++;
|
|
238
|
-
result = result.finally(() => {
|
|
239
|
-
fallbackRendersInFlight--;
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
return result;
|
|
243
|
-
};
|
|
244
|
-
var captureRenderContext = () => {
|
|
245
|
-
const store = getCurrentStore();
|
|
246
|
-
const contexts = captureContextValues(store);
|
|
247
|
-
return (callback) => resumeWithContextValues(callback, store, contexts);
|
|
248
|
-
};
|
|
249
|
-
var createContext = (defaultValue) => {
|
|
250
|
-
const values = [defaultValue];
|
|
251
|
-
const context = ((props) => {
|
|
252
|
-
const contextValues = getContextValuesIn(getCurrentStore(), context);
|
|
253
|
-
contextValues.push(props.value);
|
|
254
|
-
let string;
|
|
255
|
-
try {
|
|
256
|
-
string = props.children ? (Array.isArray(props.children) ? new JSXFragmentNode("", {}, props.children) : props.children).toString() : "";
|
|
257
|
-
} catch (e) {
|
|
258
|
-
contextValues.pop();
|
|
259
|
-
throw e;
|
|
260
|
-
}
|
|
261
|
-
if (string instanceof Promise) return string.finally(() => contextValues.pop()).then((resString) => raw(resString, resString.callbacks));
|
|
262
|
-
else {
|
|
263
|
-
contextValues.pop();
|
|
264
|
-
return raw(string);
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
context.values = values;
|
|
268
|
-
context.Provider = context;
|
|
269
|
-
context[DOM_RENDERER] = createContextProviderFunction(values);
|
|
270
|
-
globalContexts.push(context);
|
|
271
|
-
return context;
|
|
272
|
-
};
|
|
273
|
-
var useContext = (context) => {
|
|
274
|
-
return readContextValueIn(getCurrentStore(), context);
|
|
275
|
-
};
|
|
276
|
-
//#endregion
|
|
277
|
-
//#region ../../node_modules/.pnpm/hono@4.13.3/node_modules/hono/dist/jsx/intrinsic-element/common.js
|
|
278
|
-
var deDupeKeyMap = {
|
|
279
|
-
title: [],
|
|
280
|
-
script: ["src"],
|
|
281
|
-
style: ["data-href"],
|
|
282
|
-
link: ["href"],
|
|
283
|
-
meta: [
|
|
284
|
-
"name",
|
|
285
|
-
"httpEquiv",
|
|
286
|
-
"charset",
|
|
287
|
-
"itemProp"
|
|
288
|
-
]
|
|
289
|
-
};
|
|
290
|
-
var domRenderers = {};
|
|
291
|
-
var dataPrecedenceAttr = "data-precedence";
|
|
292
|
-
var isStylesheetLinkWithPrecedence = (props) => props.rel === "stylesheet" && "precedence" in props;
|
|
293
|
-
var shouldDeDupeByKey = (tagName, supportSort) => {
|
|
294
|
-
if (tagName === "link") return supportSort;
|
|
295
|
-
return deDupeKeyMap[tagName].length > 0;
|
|
296
|
-
};
|
|
297
|
-
//#endregion
|
|
298
|
-
//#region ../../node_modules/.pnpm/hono@4.13.3/node_modules/hono/dist/jsx/children.js
|
|
299
|
-
var toArray = (children) => Array.isArray(children) ? children : [children];
|
|
300
|
-
//#endregion
|
|
301
|
-
//#region ../../node_modules/.pnpm/hono@4.13.3/node_modules/hono/dist/jsx/intrinsic-element/components.js
|
|
302
|
-
var components_exports = /* @__PURE__ */ __exportAll({
|
|
303
|
-
button: () => button,
|
|
304
|
-
form: () => form,
|
|
305
|
-
input: () => input,
|
|
306
|
-
link: () => link,
|
|
307
|
-
meta: () => meta,
|
|
308
|
-
script: () => script,
|
|
309
|
-
style: () => style,
|
|
310
|
-
title: () => title
|
|
311
|
-
});
|
|
312
|
-
var metaTagMap = /* @__PURE__ */ new WeakMap();
|
|
313
|
-
var insertIntoHead = (tagName, tag, props, precedence) => ({ buffer, context }) => {
|
|
314
|
-
if (!buffer) return;
|
|
315
|
-
const map = metaTagMap.get(context) || {};
|
|
316
|
-
metaTagMap.set(context, map);
|
|
317
|
-
const tags = map[tagName] ||= [];
|
|
318
|
-
let duped = false;
|
|
319
|
-
const deDupeKeys = deDupeKeyMap[tagName];
|
|
320
|
-
const deDupeByKey = shouldDeDupeByKey(tagName, precedence !== void 0);
|
|
321
|
-
if (deDupeByKey) LOOP: for (const [, tagProps] of tags) {
|
|
322
|
-
if (tagName === "link" && !(tagProps.rel === "stylesheet" && tagProps["data-precedence"] !== void 0)) continue;
|
|
323
|
-
for (const key of deDupeKeys) if ((tagProps?.[key] ?? null) === props?.[key]) {
|
|
324
|
-
duped = true;
|
|
325
|
-
break LOOP;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
if (duped) buffer[0] = buffer[0].replaceAll(tag, "");
|
|
329
|
-
else if (deDupeByKey || tagName === "link") tags.push([
|
|
330
|
-
tag,
|
|
331
|
-
props,
|
|
332
|
-
precedence
|
|
333
|
-
]);
|
|
334
|
-
else tags.unshift([
|
|
335
|
-
tag,
|
|
336
|
-
props,
|
|
337
|
-
precedence
|
|
338
|
-
]);
|
|
339
|
-
if (buffer[0].indexOf("</head>") !== -1) {
|
|
340
|
-
let insertTags;
|
|
341
|
-
if (tagName === "link" || precedence !== void 0) {
|
|
342
|
-
const precedences = [];
|
|
343
|
-
insertTags = tags.map(([tag2, , tagPrecedence], index) => {
|
|
344
|
-
if (tagPrecedence === void 0) return [
|
|
345
|
-
tag2,
|
|
346
|
-
Number.MAX_SAFE_INTEGER,
|
|
347
|
-
index
|
|
348
|
-
];
|
|
349
|
-
let order = precedences.indexOf(tagPrecedence);
|
|
350
|
-
if (order === -1) {
|
|
351
|
-
precedences.push(tagPrecedence);
|
|
352
|
-
order = precedences.length - 1;
|
|
353
|
-
}
|
|
354
|
-
return [
|
|
355
|
-
tag2,
|
|
356
|
-
order,
|
|
357
|
-
index
|
|
358
|
-
];
|
|
359
|
-
}).sort((a, b) => a[1] - b[1] || a[2] - b[2]).map(([tag2]) => tag2);
|
|
360
|
-
} else insertTags = tags.map(([tag2]) => tag2);
|
|
361
|
-
insertTags.forEach((tag2) => {
|
|
362
|
-
buffer[0] = buffer[0].replaceAll(tag2, "");
|
|
363
|
-
});
|
|
364
|
-
buffer[0] = buffer[0].replace(/(?=<\/head>)/, insertTags.join(""));
|
|
365
|
-
}
|
|
366
|
-
};
|
|
367
|
-
var returnWithoutSpecialBehavior = (tag, children, props) => raw(new JSXNode(tag, props, toArray(children ?? [])).toString());
|
|
368
|
-
var documentMetadataTag = (tag, children, props, sort) => {
|
|
369
|
-
if ("itemProp" in props) return returnWithoutSpecialBehavior(tag, children, props);
|
|
370
|
-
let { precedence, blocking, ...restProps } = props;
|
|
371
|
-
precedence = sort ? precedence ?? "" : void 0;
|
|
372
|
-
if (sort) restProps[dataPrecedenceAttr] = precedence;
|
|
373
|
-
const string = new JSXNode(tag, restProps, toArray(children || [])).toString();
|
|
374
|
-
if (string instanceof Promise) return string.then((resString) => raw(resString, [...resString.callbacks || [], insertIntoHead(tag, resString, restProps, precedence)]));
|
|
375
|
-
else return raw(string, [insertIntoHead(tag, string, restProps, precedence)]);
|
|
376
|
-
};
|
|
377
|
-
var title = ({ children, ...props }) => {
|
|
378
|
-
const nameSpaceContext = getNameSpaceContext();
|
|
379
|
-
if (nameSpaceContext) {
|
|
380
|
-
const context = useContext(nameSpaceContext);
|
|
381
|
-
if (context === "svg" || context === "head") return new JSXNode("title", props, toArray(children ?? []));
|
|
382
|
-
}
|
|
383
|
-
return documentMetadataTag("title", children, props, false);
|
|
384
|
-
};
|
|
385
|
-
var script = ({ children, ...props }) => {
|
|
386
|
-
const nameSpaceContext = getNameSpaceContext();
|
|
387
|
-
if (["src", "async"].some((k) => !props[k]) || nameSpaceContext && useContext(nameSpaceContext) === "head") return returnWithoutSpecialBehavior("script", children, props);
|
|
388
|
-
return documentMetadataTag("script", children, props, false);
|
|
389
|
-
};
|
|
390
|
-
var style = ({ children, ...props }) => {
|
|
391
|
-
if (!["href", "precedence"].every((k) => k in props)) return returnWithoutSpecialBehavior("style", children, props);
|
|
392
|
-
props["data-href"] = props.href;
|
|
393
|
-
delete props.href;
|
|
394
|
-
return documentMetadataTag("style", children, props, true);
|
|
395
|
-
};
|
|
396
|
-
var link = ({ children, ...props }) => {
|
|
397
|
-
if (["onLoad", "onError"].some((k) => k in props) || props.rel === "stylesheet" && (!("precedence" in props) || "disabled" in props)) return returnWithoutSpecialBehavior("link", children, props);
|
|
398
|
-
return documentMetadataTag("link", children, props, isStylesheetLinkWithPrecedence(props));
|
|
399
|
-
};
|
|
400
|
-
var meta = ({ children, ...props }) => {
|
|
401
|
-
const nameSpaceContext = getNameSpaceContext();
|
|
402
|
-
if (nameSpaceContext && useContext(nameSpaceContext) === "head") return returnWithoutSpecialBehavior("meta", children, props);
|
|
403
|
-
return documentMetadataTag("meta", children, props, false);
|
|
404
|
-
};
|
|
405
|
-
var newJSXNode = (tag, { children, ...props }) => new JSXNode(tag, props, toArray(children ?? []));
|
|
406
|
-
var form = (props) => {
|
|
407
|
-
if (typeof props.action === "function") props.action = PERMALINK in props.action ? props.action[PERMALINK] : void 0;
|
|
408
|
-
return newJSXNode("form", props);
|
|
409
|
-
};
|
|
410
|
-
var formActionableElement = (tag, props) => {
|
|
411
|
-
if (typeof props.formAction === "function") props.formAction = PERMALINK in props.formAction ? props.formAction[PERMALINK] : void 0;
|
|
412
|
-
return newJSXNode(tag, props);
|
|
413
|
-
};
|
|
414
|
-
var input = (props) => formActionableElement("input", props);
|
|
415
|
-
var button = (props) => formActionableElement("button", props);
|
|
416
|
-
//#endregion
|
|
417
|
-
//#region ../../node_modules/.pnpm/hono@4.13.3/node_modules/hono/dist/jsx/utils.js
|
|
418
|
-
var normalizeElementKeyMap = /* @__PURE__ */ new Map([
|
|
419
|
-
["className", "class"],
|
|
420
|
-
["htmlFor", "for"],
|
|
421
|
-
["crossOrigin", "crossorigin"],
|
|
422
|
-
["httpEquiv", "http-equiv"],
|
|
423
|
-
["itemProp", "itemprop"],
|
|
424
|
-
["fetchPriority", "fetchpriority"],
|
|
425
|
-
["noModule", "nomodule"],
|
|
426
|
-
["formAction", "formaction"]
|
|
427
|
-
]);
|
|
428
|
-
var normalizeIntrinsicElementKey = (key) => normalizeElementKeyMap.get(key) || key;
|
|
429
|
-
var invalidAttributeNameCharRe = /[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/;
|
|
430
|
-
var validAttributeNameCache = /* @__PURE__ */ new Set();
|
|
431
|
-
var validAttributeNameCacheMax = 1024;
|
|
432
|
-
var invalidTagNameCharRe = /^[!?]|[\s"'<>/=`\\\x00-\x1f\x7f-\x9f]/;
|
|
433
|
-
var validTagNameCache = /* @__PURE__ */ new Set();
|
|
434
|
-
var validTagNameCacheMax = 256;
|
|
435
|
-
var cacheValidName = (cache, max, name) => {
|
|
436
|
-
if (cache.size >= max) cache.clear();
|
|
437
|
-
cache.add(name);
|
|
438
|
-
};
|
|
439
|
-
var isValidTagName = (name) => {
|
|
440
|
-
if (validTagNameCache.has(name)) return true;
|
|
441
|
-
if (typeof name !== "string") return false;
|
|
442
|
-
if (name.length === 0) return true;
|
|
443
|
-
if (invalidTagNameCharRe.test(name)) return false;
|
|
444
|
-
cacheValidName(validTagNameCache, validTagNameCacheMax, name);
|
|
445
|
-
return true;
|
|
446
|
-
};
|
|
447
|
-
var isValidAttributeName = (name) => {
|
|
448
|
-
if (validAttributeNameCache.has(name)) return true;
|
|
449
|
-
const len = name.length;
|
|
450
|
-
if (len === 0) return false;
|
|
451
|
-
for (let i = 0; i < len; i++) {
|
|
452
|
-
const c = name.charCodeAt(i);
|
|
453
|
-
if (!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c === 45 || c === 95 || c === 46 || c === 58)) {
|
|
454
|
-
if (!invalidAttributeNameCharRe.test(name)) {
|
|
455
|
-
cacheValidName(validAttributeNameCache, validAttributeNameCacheMax, name);
|
|
456
|
-
return true;
|
|
457
|
-
} else return false;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
cacheValidName(validAttributeNameCache, validAttributeNameCacheMax, name);
|
|
461
|
-
return true;
|
|
462
|
-
};
|
|
463
|
-
var invalidStylePropertyNameCharRe = /[\s"'():;\\/\[\]{}\x00-\x1f\x7f-\x9f]/;
|
|
464
|
-
var validStylePropertyNameCache = /* @__PURE__ */ new Set();
|
|
465
|
-
var validStylePropertyNameCacheMax = 1024;
|
|
466
|
-
var isValidStylePropertyName = (name) => {
|
|
467
|
-
if (validStylePropertyNameCache.has(name)) return true;
|
|
468
|
-
const len = name.length;
|
|
469
|
-
if (len === 0) return false;
|
|
470
|
-
for (let i = 0; i < len; i++) {
|
|
471
|
-
const c = name.charCodeAt(i);
|
|
472
|
-
if (!(c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c === 45 || c === 95)) {
|
|
473
|
-
if (!invalidStylePropertyNameCharRe.test(name)) {
|
|
474
|
-
cacheValidName(validStylePropertyNameCache, validStylePropertyNameCacheMax, name);
|
|
475
|
-
return true;
|
|
476
|
-
} else return false;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
cacheValidName(validStylePropertyNameCache, validStylePropertyNameCacheMax, name);
|
|
480
|
-
return true;
|
|
481
|
-
};
|
|
482
|
-
var unsafeStyleValueCharRe = /[;"'\\/\[\](){}]/;
|
|
483
|
-
var hasUnsafeStyleValue = (value) => {
|
|
484
|
-
if (!unsafeStyleValueCharRe.test(value)) return false;
|
|
485
|
-
let quote = 0;
|
|
486
|
-
const blockStack = [];
|
|
487
|
-
for (let i = 0, len = value.length; i < len; i++) {
|
|
488
|
-
const c = value.charCodeAt(i);
|
|
489
|
-
if (c === 92) {
|
|
490
|
-
if (i === len - 1) return true;
|
|
491
|
-
i++;
|
|
492
|
-
} else if (quote !== 0) {
|
|
493
|
-
if (c === 10 || c === 12 || c === 13) return true;
|
|
494
|
-
if (c === quote) quote = 0;
|
|
495
|
-
} else if (c === 47 && value.charCodeAt(i + 1) === 42) {
|
|
496
|
-
const end = value.indexOf("*/", i + 2);
|
|
497
|
-
if (end === -1) return true;
|
|
498
|
-
i = end + 1;
|
|
499
|
-
} else if (c === 34 || c === 39) quote = c;
|
|
500
|
-
else if (c === 40) blockStack.push(41);
|
|
501
|
-
else if (c === 91) blockStack.push(93);
|
|
502
|
-
else if (c === 123 || c === 125) return true;
|
|
503
|
-
else if (c === 41 || c === 93) {
|
|
504
|
-
if (blockStack[blockStack.length - 1] !== c) return true;
|
|
505
|
-
blockStack.pop();
|
|
506
|
-
} else if (c === 59 && blockStack.length === 0) return true;
|
|
507
|
-
}
|
|
508
|
-
return quote !== 0 || blockStack.length !== 0;
|
|
509
|
-
};
|
|
510
|
-
var styleObjectForEach = (style, fn) => {
|
|
511
|
-
for (const [k, v] of Object.entries(style)) {
|
|
512
|
-
const key = k[0] === "-" || !/[A-Z]/.test(k) ? k : k.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`);
|
|
513
|
-
if (!isValidStylePropertyName(key)) continue;
|
|
514
|
-
if (v == null) {
|
|
515
|
-
fn(key, null);
|
|
516
|
-
continue;
|
|
517
|
-
}
|
|
518
|
-
let value;
|
|
519
|
-
if (typeof v === "number") value = !key.match(/^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/) ? `${v}px` : `${v}`;
|
|
520
|
-
else if (typeof v === "string") {
|
|
521
|
-
if (hasUnsafeStyleValue(v)) continue;
|
|
522
|
-
value = v;
|
|
523
|
-
} else continue;
|
|
524
|
-
fn(key, value);
|
|
525
|
-
}
|
|
526
|
-
};
|
|
527
|
-
//#endregion
|
|
528
|
-
//#region ../../node_modules/.pnpm/hono@4.13.3/node_modules/hono/dist/jsx/base.js
|
|
529
|
-
var nameSpaceContext = void 0;
|
|
530
|
-
var getNameSpaceContext = () => nameSpaceContext;
|
|
531
|
-
var toSVGAttributeName = (key) => /[A-Z]/.test(key) && key.match(/^(?:al|basel|clip(?:Path|Rule)$|co|do|fill|fl|fo|gl|let|lig|i|marker[EMS]|o|pai|pointe|sh|st[or]|text[^L]|tr|u|ve|w)/) ? key.replace(/([A-Z])/g, "-$1").toLowerCase() : key;
|
|
532
|
-
var emptyTags = [
|
|
533
|
-
"area",
|
|
534
|
-
"base",
|
|
535
|
-
"br",
|
|
536
|
-
"col",
|
|
537
|
-
"embed",
|
|
538
|
-
"hr",
|
|
539
|
-
"img",
|
|
540
|
-
"input",
|
|
541
|
-
"keygen",
|
|
542
|
-
"link",
|
|
543
|
-
"meta",
|
|
544
|
-
"param",
|
|
545
|
-
"source",
|
|
546
|
-
"track",
|
|
547
|
-
"wbr"
|
|
548
|
-
];
|
|
549
|
-
var booleanAttributes = [
|
|
550
|
-
"allowfullscreen",
|
|
551
|
-
"async",
|
|
552
|
-
"autofocus",
|
|
553
|
-
"autoplay",
|
|
554
|
-
"checked",
|
|
555
|
-
"controls",
|
|
556
|
-
"default",
|
|
557
|
-
"defer",
|
|
558
|
-
"disabled",
|
|
559
|
-
"download",
|
|
560
|
-
"formnovalidate",
|
|
561
|
-
"hidden",
|
|
562
|
-
"inert",
|
|
563
|
-
"ismap",
|
|
564
|
-
"itemscope",
|
|
565
|
-
"loop",
|
|
566
|
-
"multiple",
|
|
567
|
-
"muted",
|
|
568
|
-
"nomodule",
|
|
569
|
-
"novalidate",
|
|
570
|
-
"open",
|
|
571
|
-
"playsinline",
|
|
572
|
-
"readonly",
|
|
573
|
-
"required",
|
|
574
|
-
"reversed",
|
|
575
|
-
"selected"
|
|
576
|
-
];
|
|
577
|
-
var resolveFunctionComponentResult = (result, suspendedContext) => result.then((resolved) => {
|
|
578
|
-
if (!Array.isArray(resolved) && !(resolved instanceof JSXNode)) return resolved;
|
|
579
|
-
const children = Array.isArray(resolved) ? resolved : [resolved];
|
|
580
|
-
const render = () => {
|
|
581
|
-
const buffer = [""];
|
|
582
|
-
childrenToStringToBuffer(children, buffer);
|
|
583
|
-
return buffer.length === 1 ? raw(buffer[0], buffer.callbacks) : stringBufferToString(buffer, buffer.callbacks);
|
|
584
|
-
};
|
|
585
|
-
return suspendedContext ? suspendedContext(render) : runWithRenderContext(render);
|
|
586
|
-
});
|
|
587
|
-
var childrenToStringToBuffer = (children, buffer) => {
|
|
588
|
-
for (let i = 0, len = children.length; i < len; i++) {
|
|
589
|
-
const child = children[i];
|
|
590
|
-
if (typeof child === "string") escapeToBuffer(child, buffer);
|
|
591
|
-
else if (typeof child === "boolean" || child === null || child === void 0) continue;
|
|
592
|
-
else if (child instanceof JSXNode) child.toStringToBuffer(buffer);
|
|
593
|
-
else if (typeof child === "number") buffer[0] += child;
|
|
594
|
-
else if (child.isEscaped) {
|
|
595
|
-
buffer[0] += child;
|
|
596
|
-
const callbacks = child.callbacks;
|
|
597
|
-
if (callbacks) {
|
|
598
|
-
buffer.callbacks ||= [];
|
|
599
|
-
buffer.callbacks.push(...callbacks);
|
|
600
|
-
}
|
|
601
|
-
} else if (child instanceof Promise) buffer.unshift("", child);
|
|
602
|
-
else childrenToStringToBuffer(child, buffer);
|
|
603
|
-
}
|
|
604
|
-
};
|
|
605
|
-
var JSXNode = class {
|
|
606
|
-
tag;
|
|
607
|
-
props;
|
|
608
|
-
key;
|
|
609
|
-
children;
|
|
610
|
-
isEscaped = true;
|
|
611
|
-
constructor(tag, props, children) {
|
|
612
|
-
if (typeof tag !== "function" && !isValidTagName(tag)) throw new Error(`Invalid JSX tag name: ${tag}`);
|
|
613
|
-
this.tag = tag;
|
|
614
|
-
this.props = props;
|
|
615
|
-
this.children = children;
|
|
616
|
-
}
|
|
617
|
-
get type() {
|
|
618
|
-
return this.tag;
|
|
619
|
-
}
|
|
620
|
-
get ref() {
|
|
621
|
-
return this.props.ref || null;
|
|
622
|
-
}
|
|
623
|
-
toString() {
|
|
624
|
-
const render = () => {
|
|
625
|
-
const buffer = [""];
|
|
626
|
-
this.toStringToBuffer(buffer);
|
|
627
|
-
return buffer.length === 1 ? "callbacks" in buffer ? resolveCallbackSync(raw(buffer[0], buffer.callbacks)).toString() : buffer[0] : stringBufferToString(buffer, buffer.callbacks);
|
|
628
|
-
};
|
|
629
|
-
return runWithRenderContext(render);
|
|
630
|
-
}
|
|
631
|
-
toStringToBuffer(buffer) {
|
|
632
|
-
const tag = this.tag;
|
|
633
|
-
const props = this.props;
|
|
634
|
-
let { children } = this;
|
|
635
|
-
buffer[0] += `<${tag}`;
|
|
636
|
-
const normalizeKey = tag === "svg" || nameSpaceContext && useContext(nameSpaceContext) === "svg" ? (key) => toSVGAttributeName(normalizeIntrinsicElementKey(key)) : (key) => normalizeIntrinsicElementKey(key);
|
|
637
|
-
for (let [key, v] of Object.entries(props)) {
|
|
638
|
-
key = normalizeKey(key);
|
|
639
|
-
if (!isValidAttributeName(key)) continue;
|
|
640
|
-
if (key === "children") {} else if (key === "style" && typeof v === "object") {
|
|
641
|
-
let styleStr = "";
|
|
642
|
-
styleObjectForEach(v, (property, value) => {
|
|
643
|
-
if (value != null) styleStr += `${styleStr ? ";" : ""}${property}:${value}`;
|
|
644
|
-
});
|
|
645
|
-
buffer[0] += " style=\"";
|
|
646
|
-
escapeToBuffer(styleStr, buffer);
|
|
647
|
-
buffer[0] += "\"";
|
|
648
|
-
} else if (typeof v === "string") {
|
|
649
|
-
buffer[0] += ` ${key}="`;
|
|
650
|
-
escapeToBuffer(v, buffer);
|
|
651
|
-
buffer[0] += "\"";
|
|
652
|
-
} else if (v === null || v === void 0) {} else if (typeof v === "number" || v.isEscaped) buffer[0] += ` ${key}="${v}"`;
|
|
653
|
-
else if (typeof v === "boolean" && booleanAttributes.includes(key)) {
|
|
654
|
-
if (v) buffer[0] += ` ${key}=""`;
|
|
655
|
-
} else if (key === "dangerouslySetInnerHTML") {
|
|
656
|
-
if (children.length > 0) throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
|
|
657
|
-
children = [raw(v.__html)];
|
|
658
|
-
} else if (v instanceof Promise) {
|
|
659
|
-
buffer[0] += ` ${key}="`;
|
|
660
|
-
buffer.unshift("\"", v);
|
|
661
|
-
} else if (typeof v === "function") {
|
|
662
|
-
if (!key.startsWith("on") && key !== "ref") throw new Error(`Invalid prop '${key}' of type 'function' supplied to '${tag}'.`);
|
|
663
|
-
} else {
|
|
664
|
-
buffer[0] += ` ${key}="`;
|
|
665
|
-
escapeToBuffer(v.toString(), buffer);
|
|
666
|
-
buffer[0] += "\"";
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
if (emptyTags.includes(tag) && children.length === 0) {
|
|
670
|
-
buffer[0] += "/>";
|
|
671
|
-
return;
|
|
672
|
-
}
|
|
673
|
-
buffer[0] += ">";
|
|
674
|
-
childrenToStringToBuffer(children, buffer);
|
|
675
|
-
buffer[0] += `</${tag}>`;
|
|
676
|
-
}
|
|
677
|
-
};
|
|
678
|
-
var JSXFunctionNode = class extends JSXNode {
|
|
679
|
-
toStringToBuffer(buffer) {
|
|
680
|
-
const { children } = this;
|
|
681
|
-
const props = { ...this.props };
|
|
682
|
-
if (children.length) props.children = children.length === 1 ? children[0] : children;
|
|
683
|
-
const res = this.tag.call(null, props);
|
|
684
|
-
if (typeof res === "boolean" || res == null) return;
|
|
685
|
-
else if (res instanceof Promise) {
|
|
686
|
-
if (globalContexts.length === 0) buffer.unshift("", resolveFunctionComponentResult(res));
|
|
687
|
-
else buffer.unshift("", resolveFunctionComponentResult(res, captureRenderContext()));
|
|
688
|
-
} else if (res instanceof JSXNode) res.toStringToBuffer(buffer);
|
|
689
|
-
else if (Array.isArray(res)) childrenToStringToBuffer(res, buffer);
|
|
690
|
-
else if (typeof res === "number" || res.isEscaped) {
|
|
691
|
-
buffer[0] += res;
|
|
692
|
-
if (res.callbacks) {
|
|
693
|
-
buffer.callbacks ||= [];
|
|
694
|
-
buffer.callbacks.push(...res.callbacks);
|
|
695
|
-
}
|
|
696
|
-
} else escapeToBuffer(res, buffer);
|
|
697
|
-
}
|
|
698
|
-
};
|
|
699
|
-
var JSXFragmentNode = class extends JSXNode {
|
|
700
|
-
toStringToBuffer(buffer) {
|
|
701
|
-
childrenToStringToBuffer(this.children, buffer);
|
|
702
|
-
}
|
|
703
|
-
};
|
|
704
|
-
var jsx = (tag, props, ...children) => {
|
|
705
|
-
props ??= {};
|
|
706
|
-
if (children.length) props.children = children.length === 1 ? children[0] : children;
|
|
707
|
-
const key = props.key;
|
|
708
|
-
delete props["key"];
|
|
709
|
-
const node = jsxFn(tag, props, children);
|
|
710
|
-
node.key = key;
|
|
711
|
-
return node;
|
|
712
|
-
};
|
|
713
|
-
var initDomRenderer = false;
|
|
714
|
-
var jsxFn = (tag, props, children) => {
|
|
715
|
-
if (!initDomRenderer) {
|
|
716
|
-
for (const k in domRenderers) components_exports[k][DOM_RENDERER] = domRenderers[k];
|
|
717
|
-
initDomRenderer = true;
|
|
718
|
-
}
|
|
719
|
-
if (typeof tag === "function") return new JSXFunctionNode(tag, props, children);
|
|
720
|
-
else if (components_exports[tag]) return new JSXFunctionNode(components_exports[tag], props, children);
|
|
721
|
-
else if (tag === "svg" || tag === "head") {
|
|
722
|
-
nameSpaceContext ||= createContext("");
|
|
723
|
-
return new JSXNode(tag, props, [new JSXFunctionNode(nameSpaceContext, { value: tag }, children)]);
|
|
724
|
-
} else return new JSXNode(tag, props, children);
|
|
725
|
-
};
|
|
726
|
-
var Fragment = ({ children }) => {
|
|
727
|
-
return new JSXFragmentNode("", { children }, Array.isArray(children) ? children : children ? [children] : []);
|
|
728
|
-
};
|
|
729
|
-
//#endregion
|
|
730
|
-
//#region ../../node_modules/.pnpm/hono@4.13.3/node_modules/hono/dist/jsx/jsx-dev-runtime.js
|
|
731
|
-
function jsxDEV(tag, props, key) {
|
|
732
|
-
let node;
|
|
733
|
-
if (!props || !("children" in props)) node = jsxFn(tag, props, []);
|
|
734
|
-
else {
|
|
735
|
-
const children = props.children;
|
|
736
|
-
node = Array.isArray(children) ? jsxFn(tag, props, children) : jsxFn(tag, props, [children]);
|
|
737
|
-
}
|
|
738
|
-
node.key = key;
|
|
739
|
-
return node;
|
|
740
|
-
}
|
|
741
|
-
//#endregion
|
|
742
|
-
export { HtmlEscapedCallbackPhase as C, resolveCallbackSync as D, resolveCallback as E, stringBufferToString as O, DOM_STASH as S, raw as T, createContext$1 as _, normalizeIntrinsicElementKey as a, DOM_MEMO as b, dataPrecedenceAttr as c, isStylesheetLinkWithPrecedence as d, shouldDeDupeByKey as f, useContext as g, globalContexts as h, jsx as i, deDupeKeyMap as l, createContext as m, Fragment as n, styleObjectForEach as o, captureRenderContext as p, JSXNode as r, toArray as s, jsxDEV as t, domRenderers as u, DOM_ERROR_HANDLER as v, escapeToBuffer as w, DOM_RENDERER as x, DOM_INTERNAL_TAG as y };
|