@hot-updater/console 0.36.15 → 0.36.17
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/.output/nitro.json +1 -1
- package/.output/public/assets/dist-BI6FSMS0.js +3 -0
- package/.output/public/assets/index-C4PncbHt.js +11 -0
- package/.output/public/assets/routes-6EQXztxs.js +54 -0
- package/.output/server/{__23tanstack-start-server-fn-resolver-CgwgZ0-i.mjs → __23tanstack-start-server-fn-resolver-CNUWOV2f.mjs} +15 -15
- package/.output/server/_libs/@tanstack/react-form+[...].mjs +6 -6
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +3730 -4032
- package/.output/server/_libs/tanstack__history.mjs +68 -41
- package/.output/server/_libs/tanstack__query-core.mjs +1570 -256
- package/.output/server/_libs/tanstack__react-query.mjs +254 -19
- package/.output/server/_ssr/{api-rpc-BIbDUKSz.mjs → api-rpc-irQMOQXO.mjs} +2 -2
- package/.output/server/_ssr/{createServerFn-DzU0k62V.mjs → createServerFn-CwIQ_zCm.mjs} +41 -56
- package/.output/server/_ssr/{empty-plugin-adapters-B4HCzgmM.mjs → empty-plugin-adapters-DvRHA3Ns.mjs} +1 -1
- package/.output/server/_ssr/{router-C3hqEy3k.mjs → router-bOwIHAiQ.mjs} +3 -3
- package/.output/server/_ssr/{routes-B0lQvvlC.mjs → routes-D6eq6WM0.mjs} +3 -3
- package/.output/server/_ssr/ssr.mjs +5103 -4246
- package/.output/server/_ssr/start-CQ99Z6e_.mjs +4 -0
- package/.output/server/{_tanstack-start-manifest_v-Bpx52WOU.mjs → _tanstack-start-manifest_v-D42dM0BV.mjs} +4 -4
- package/.output/server/index.mjs +30 -30
- package/package.json +13 -13
- package/.output/public/assets/dist-DJX53faP.js +0 -3
- package/.output/public/assets/index-Iylis5kY.js +0 -10
- package/.output/public/assets/routes-HT21hs0C.js +0 -54
- package/.output/server/_ssr/start-02sLteYG.mjs +0 -4
|
@@ -1,7 +1,25 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/@tanstack+history@1.162.
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tanstack+history@1.162.4/node_modules/@tanstack/history/dist/esm/index.js
|
|
2
2
|
var stateIndexKey = "__TSR_index";
|
|
3
3
|
var popStateEvent = "popstate";
|
|
4
4
|
var beforeUnloadEvent = "beforeunload";
|
|
5
|
+
/**
|
|
6
|
+
* Turn protocol-relative inputs such as "//evil.example" into paths
|
|
7
|
+
* such as "/evil.example", keeping navigation on the current origin.
|
|
8
|
+
*
|
|
9
|
+
* For HTTP(S) URLs, WHATWG parsing ignores leading C0 controls and spaces,
|
|
10
|
+
* removes tabs/newlines, and treats backslashes as slashes, so inputs like
|
|
11
|
+
* "/\evil.example" also need normalization. This only allocates when those
|
|
12
|
+
* rules would make the input protocol-relative.
|
|
13
|
+
*/
|
|
14
|
+
var protocolRelativePrefix = /^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;
|
|
15
|
+
function normalizeProtocolRelative(url) {
|
|
16
|
+
const match = protocolRelativePrefix.exec(url);
|
|
17
|
+
return match ? "/" + url.slice(match[0].length) : url;
|
|
18
|
+
}
|
|
19
|
+
function normalizeHref(href) {
|
|
20
|
+
if (/[\x00-\x1f\x7f]/.test(href)) href = href.replace(/[\x00-\x1f\x7f]/g, (character) => " \n\r".includes(character) ? "" : encodeURIComponent(character));
|
|
21
|
+
return normalizeProtocolRelative(href);
|
|
22
|
+
}
|
|
5
23
|
function createHistory(opts) {
|
|
6
24
|
let location = opts.getLocation();
|
|
7
25
|
const subscribers = /* @__PURE__ */ new Set();
|
|
@@ -81,7 +99,7 @@ function createHistory(opts) {
|
|
|
81
99
|
go: (index, navigateOpts) => {
|
|
82
100
|
tryNavigation({
|
|
83
101
|
task: () => {
|
|
84
|
-
opts.go(index);
|
|
102
|
+
opts.go(index, navigateOpts?.ignoreBlocker ?? false);
|
|
85
103
|
handleIndexChange({
|
|
86
104
|
type: "GO",
|
|
87
105
|
index
|
|
@@ -124,11 +142,11 @@ function createHistory(opts) {
|
|
|
124
142
|
},
|
|
125
143
|
flush: () => opts.flush?.(),
|
|
126
144
|
destroy: () => opts.destroy?.(),
|
|
127
|
-
notify
|
|
145
|
+
notify,
|
|
146
|
+
_getBlockers: () => opts.getBlockers?.() ?? []
|
|
128
147
|
};
|
|
129
148
|
}
|
|
130
149
|
function assignKeyAndIndex(index, state) {
|
|
131
|
-
if (!state) state = {};
|
|
132
150
|
const key = createRandomKey();
|
|
133
151
|
return {
|
|
134
152
|
...state,
|
|
@@ -160,7 +178,7 @@ function createBrowserHistory(opts) {
|
|
|
160
178
|
let blockers = [];
|
|
161
179
|
const _getBlockers = () => blockers;
|
|
162
180
|
const _setBlockers = (newBlockers) => blockers = newBlockers;
|
|
163
|
-
const createHref = opts?.createHref
|
|
181
|
+
const createHref = (path) => normalizeHref(opts?.createHref ? opts.createHref(path) : path);
|
|
164
182
|
const parseLocation = opts?.parseLocation ?? (() => parseHref(`${win.location.pathname}${win.location.search}${win.location.hash}`, win.history.state));
|
|
165
183
|
if (!win.history.state?.__TSR_key && !win.history.state?.key) {
|
|
166
184
|
const addedKey = createRandomKey();
|
|
@@ -178,32 +196,32 @@ function createBrowserHistory(opts) {
|
|
|
178
196
|
let ignoreNextBeforeUnload = false;
|
|
179
197
|
const getLocation = () => currentLocation;
|
|
180
198
|
let next;
|
|
181
|
-
let scheduled;
|
|
182
199
|
const flush = () => {
|
|
183
200
|
if (!next) return;
|
|
184
201
|
history._ignoreSubscribers = true;
|
|
185
|
-
(next
|
|
202
|
+
(next[2] ? win.history.pushState : win.history.replaceState)(next[1], "", next[0]);
|
|
186
203
|
history._ignoreSubscribers = false;
|
|
187
204
|
next = void 0;
|
|
188
|
-
scheduled = void 0;
|
|
189
205
|
rollbackLocation = void 0;
|
|
190
206
|
};
|
|
191
|
-
const queueHistoryAction = (
|
|
192
|
-
const href = createHref(destHref);
|
|
193
|
-
|
|
207
|
+
const queueHistoryAction = (isPush, destHref, state) => {
|
|
208
|
+
const href = opts?.createHref ? createHref(destHref) : void 0;
|
|
209
|
+
const hasPendingAction = !!next;
|
|
210
|
+
if (!hasPendingAction) rollbackLocation = currentLocation;
|
|
194
211
|
currentLocation = parseHref(destHref, state);
|
|
195
|
-
next =
|
|
196
|
-
href,
|
|
212
|
+
next = [
|
|
213
|
+
href ?? currentLocation.href,
|
|
197
214
|
state,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
if (!
|
|
215
|
+
next?.[2] || isPush
|
|
216
|
+
];
|
|
217
|
+
if (!hasPendingAction) queueMicrotask(() => flush());
|
|
201
218
|
};
|
|
202
219
|
const onPushPop = (type) => {
|
|
203
220
|
currentLocation = parseLocation();
|
|
204
221
|
history.notify({ type });
|
|
205
222
|
};
|
|
206
223
|
const onPushPopEvent = async () => {
|
|
224
|
+
ignoreNextBeforeUnload = false;
|
|
207
225
|
if (ignoreNextPop) {
|
|
208
226
|
ignoreNextPop = false;
|
|
209
227
|
return;
|
|
@@ -229,7 +247,7 @@ function createBrowserHistory(opts) {
|
|
|
229
247
|
action
|
|
230
248
|
})) {
|
|
231
249
|
ignoreNextPop = true;
|
|
232
|
-
win.history.go(
|
|
250
|
+
win.history.go(-delta);
|
|
233
251
|
history.notify(notify);
|
|
234
252
|
return;
|
|
235
253
|
}
|
|
@@ -264,20 +282,28 @@ function createBrowserHistory(opts) {
|
|
|
264
282
|
const history = createHistory({
|
|
265
283
|
getLocation,
|
|
266
284
|
getLength: () => win.history.length,
|
|
267
|
-
pushState: (href, state) => queueHistoryAction(
|
|
268
|
-
replaceState: (href, state) => queueHistoryAction(
|
|
285
|
+
pushState: (href, state) => queueHistoryAction(true, href, state),
|
|
286
|
+
replaceState: (href, state) => queueHistoryAction(false, href, state),
|
|
269
287
|
back: (ignoreBlocker) => {
|
|
270
|
-
if (ignoreBlocker)
|
|
271
|
-
|
|
288
|
+
if (ignoreBlocker) {
|
|
289
|
+
skipBlockerNextPop = true;
|
|
290
|
+
ignoreNextBeforeUnload = true;
|
|
291
|
+
}
|
|
272
292
|
return win.history.back();
|
|
273
293
|
},
|
|
274
294
|
forward: (ignoreBlocker) => {
|
|
275
|
-
if (ignoreBlocker)
|
|
276
|
-
|
|
295
|
+
if (ignoreBlocker) {
|
|
296
|
+
skipBlockerNextPop = true;
|
|
297
|
+
ignoreNextBeforeUnload = true;
|
|
298
|
+
}
|
|
277
299
|
win.history.forward();
|
|
278
300
|
},
|
|
279
|
-
go: (n) => {
|
|
301
|
+
go: (n, ignoreBlocker) => {
|
|
280
302
|
nextPopIsGo = true;
|
|
303
|
+
if (ignoreBlocker) {
|
|
304
|
+
skipBlockerNextPop = true;
|
|
305
|
+
ignoreNextBeforeUnload = true;
|
|
306
|
+
}
|
|
281
307
|
win.history.go(n);
|
|
282
308
|
},
|
|
283
309
|
createHref: (href) => createHref(href),
|
|
@@ -295,6 +321,13 @@ function createBrowserHistory(opts) {
|
|
|
295
321
|
setBlockers: _setBlockers,
|
|
296
322
|
notifyOnIndexChange: false
|
|
297
323
|
});
|
|
324
|
+
history._ignoreNextBeforeUnload = (href) => {
|
|
325
|
+
ignoreNextBeforeUnload = false;
|
|
326
|
+
try {
|
|
327
|
+
href = new URL(href, win.document.baseURI).href;
|
|
328
|
+
ignoreNextBeforeUnload = /^https?:/.test(href) && (!href.includes("#") || href.split("#")[0] !== win.location.href.split("#")[0]);
|
|
329
|
+
} catch {}
|
|
330
|
+
};
|
|
298
331
|
win.addEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });
|
|
299
332
|
win.addEventListener(popStateEvent, onPushPopEvent);
|
|
300
333
|
win.history.pushState = function(...args) {
|
|
@@ -309,34 +342,28 @@ function createBrowserHistory(opts) {
|
|
|
309
342
|
};
|
|
310
343
|
return history;
|
|
311
344
|
}
|
|
312
|
-
/**
|
|
313
|
-
* Sanitize a path to prevent open redirect vulnerabilities.
|
|
314
|
-
* Removes control characters and collapses leading double slashes.
|
|
315
|
-
*/
|
|
316
|
-
function sanitizePath(path) {
|
|
317
|
-
let sanitized = path.replace(/[\x00-\x1f\x7f]/g, "");
|
|
318
|
-
if (sanitized.startsWith("//")) sanitized = "/" + sanitized.replace(/^\/+/, "");
|
|
319
|
-
return sanitized;
|
|
320
|
-
}
|
|
321
345
|
function parseHref(href, state) {
|
|
322
|
-
const sanitizedHref =
|
|
346
|
+
const sanitizedHref = normalizeHref(href);
|
|
323
347
|
const hashIndex = sanitizedHref.indexOf("#");
|
|
324
348
|
const searchIndex = sanitizedHref.indexOf("?");
|
|
325
|
-
|
|
349
|
+
if (!state) {
|
|
350
|
+
const key = createRandomKey();
|
|
351
|
+
state = {
|
|
352
|
+
[stateIndexKey]: 0,
|
|
353
|
+
key,
|
|
354
|
+
__TSR_key: key
|
|
355
|
+
};
|
|
356
|
+
}
|
|
326
357
|
return {
|
|
327
358
|
href: sanitizedHref,
|
|
328
359
|
pathname: sanitizedHref.substring(0, hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : sanitizedHref.length),
|
|
329
360
|
hash: hashIndex > -1 ? sanitizedHref.substring(hashIndex) : "",
|
|
330
361
|
search: searchIndex > -1 ? sanitizedHref.slice(searchIndex, hashIndex === -1 ? void 0 : hashIndex) : "",
|
|
331
|
-
state
|
|
332
|
-
[stateIndexKey]: 0,
|
|
333
|
-
key: addedKey,
|
|
334
|
-
__TSR_key: addedKey
|
|
335
|
-
}
|
|
362
|
+
state
|
|
336
363
|
};
|
|
337
364
|
}
|
|
338
365
|
function createRandomKey() {
|
|
339
366
|
return (Math.random() + 1).toString(36).substring(7);
|
|
340
367
|
}
|
|
341
368
|
//#endregion
|
|
342
|
-
export {
|
|
369
|
+
export { normalizeProtocolRelative as n, parseHref as r, createBrowserHistory as t };
|