@hot-updater/console 0.28.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +17 -0
- package/.output/public/apple-touch-icon.png +0 -0
- package/.output/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/.output/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/.output/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/.output/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/.output/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/.output/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/.output/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/.output/public/assets/main-Dlx8-qN-.js +61 -0
- package/.output/public/assets/routes-DB0tWmiJ.js +10 -0
- package/.output/public/assets/styles-Bfxg4M1x.css +2 -0
- package/.output/public/favicon-16x16.png +0 -0
- package/.output/public/favicon-32x32.png +0 -0
- package/.output/public/favicon.ico +0 -0
- package/.output/public/logo.svg +1 -0
- package/.output/public/manifest.json +30 -0
- package/.output/public/robots.txt +3 -0
- package/.output/server/_chunks/ssr-renderer.mjs +15 -0
- package/.output/server/_libs/@floating-ui/core+[...].mjs +698 -0
- package/.output/server/_libs/@floating-ui/dom+[...].mjs +644 -0
- package/.output/server/_libs/@floating-ui/react-dom+[...].mjs +839 -0
- package/.output/server/_libs/@radix-ui/react-alert-dialog+[...].mjs +2093 -0
- package/.output/server/_libs/@radix-ui/react-popper+[...].mjs +287 -0
- package/.output/server/_libs/@radix-ui/react-select+[...].mjs +1003 -0
- package/.output/server/_libs/@tanstack/devtools-event-client+[...].mjs +196 -0
- package/.output/server/_libs/@tanstack/form-core+[...].mjs +2396 -0
- package/.output/server/_libs/@tanstack/react-form+[...].mjs +298 -0
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +13068 -0
- package/.output/server/_libs/@tanstack/react-table+[...].mjs +2372 -0
- package/.output/server/_libs/chownr.mjs +60 -0
- package/.output/server/_libs/class-variance-authority+clsx.mjs +69 -0
- package/.output/server/_libs/core-util-is.mjs +67 -0
- package/.output/server/_libs/dayjs.mjs +408 -0
- package/.output/server/_libs/h3+rou3+srvx.mjs +1158 -0
- package/.output/server/_libs/hookable.mjs +41 -0
- package/.output/server/_libs/immediate.mjs +57 -0
- package/.output/server/_libs/inherits.mjs +39 -0
- package/.output/server/_libs/isaacs__fs-minipass+minipass.mjs +1120 -0
- package/.output/server/_libs/isarray.mjs +10 -0
- package/.output/server/_libs/jszip+[...].mjs +8311 -0
- package/.output/server/_libs/lucide-react.mjs +371 -0
- package/.output/server/_libs/minizlib.mjs +345 -0
- package/.output/server/_libs/next-themes.mjs +49 -0
- package/.output/server/_libs/radix-ui__number.mjs +6 -0
- package/.output/server/_libs/radix-ui__primitive.mjs +9 -0
- package/.output/server/_libs/radix-ui__react-arrow.mjs +23 -0
- package/.output/server/_libs/radix-ui__react-collection.mjs +78 -0
- package/.output/server/_libs/radix-ui__react-direction.mjs +11 -0
- package/.output/server/_libs/radix-ui__react-label.mjs +22 -0
- package/.output/server/_libs/radix-ui__react-separator.mjs +31 -0
- package/.output/server/_libs/radix-ui__react-slider.mjs +451 -0
- package/.output/server/_libs/radix-ui__react-switch.mjs +118 -0
- package/.output/server/_libs/radix-ui__react-tooltip.mjs +491 -0
- package/.output/server/_libs/semver.mjs +1339 -0
- package/.output/server/_libs/sonner.mjs +908 -0
- package/.output/server/_libs/tailwind-merge.mjs +1962 -0
- package/.output/server/_libs/tanstack__history.mjs +322 -0
- package/.output/server/_libs/tanstack__query-core.mjs +2073 -0
- package/.output/server/_libs/tanstack__react-query.mjs +146 -0
- package/.output/server/_libs/tanstack__router-core.mjs +6 -0
- package/.output/server/_libs/tar.mjs +1996 -0
- package/.output/server/_libs/ufo.mjs +64 -0
- package/.output/server/_runtime.mjs +26 -0
- package/.output/server/_ssr/api-rpc-D3ZehMIN.mjs +217 -0
- package/.output/server/_ssr/config.server-JUYQ7UbI.mjs +26 -0
- package/.output/server/_ssr/deleteBundle-DWUxu9-K.mjs +22 -0
- package/.output/server/_ssr/extract-timestamp-from-uuidv7-B90UBADU.mjs +24 -0
- package/.output/server/_ssr/promoteBundle-DtMHuubR.mjs +1571 -0
- package/.output/server/_ssr/router-pgc7NX76.mjs +250 -0
- package/.output/server/_ssr/routes-PqTTQSoI.mjs +1833 -0
- package/.output/server/_ssr/sidebar-DXng0IOP.mjs +439 -0
- package/.output/server/_ssr/ssr.mjs +5050 -0
- package/.output/server/_ssr/start-DQK0r85G.mjs +4 -0
- package/.output/server/_tanstack-start-manifest_v-DTbQVOpU.mjs +17 -0
- package/.output/server/index.mjs +417 -0
- package/.output/server/node_modules/tslib/modules/index.js +70 -0
- package/.output/server/node_modules/tslib/modules/package.json +3 -0
- package/.output/server/node_modules/tslib/package.json +47 -0
- package/.output/server/node_modules/tslib/tslib.js +484 -0
- package/.output/server/package.json +9 -0
- package/README.md +191 -2
- package/package.json +77 -50
- package/dist/.gitkeep +0 -0
- package/dist/assets/favicon-BkwcEHsj.ico +0 -0
- package/dist/assets/index-DUlKsori.css +0 -1
- package/dist/assets/index-ijmIcyn1.js +0 -27
- package/dist/assets/logo-BYNFyja1.png +0 -0
- package/dist/index.cjs +0 -2129
- package/dist/index.d.cts +0 -218
- package/dist/index.d.ts +0 -218
- package/dist/index.html +0 -14
- package/dist/index.js +0 -2125
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tanstack+history@1.161.4/node_modules/@tanstack/history/dist/esm/index.js
|
|
2
|
+
var stateIndexKey = "__TSR_index";
|
|
3
|
+
var popStateEvent = "popstate";
|
|
4
|
+
var beforeUnloadEvent = "beforeunload";
|
|
5
|
+
function createHistory(opts) {
|
|
6
|
+
let location = opts.getLocation();
|
|
7
|
+
const subscribers = /* @__PURE__ */ new Set();
|
|
8
|
+
const notify = (action) => {
|
|
9
|
+
location = opts.getLocation();
|
|
10
|
+
subscribers.forEach((subscriber) => subscriber({
|
|
11
|
+
location,
|
|
12
|
+
action
|
|
13
|
+
}));
|
|
14
|
+
};
|
|
15
|
+
const handleIndexChange = (action) => {
|
|
16
|
+
if (opts.notifyOnIndexChange ?? true) notify(action);
|
|
17
|
+
else location = opts.getLocation();
|
|
18
|
+
};
|
|
19
|
+
const tryNavigation = async ({ task, navigateOpts, ...actionInfo }) => {
|
|
20
|
+
if (navigateOpts?.ignoreBlocker ?? false) {
|
|
21
|
+
task();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const blockers = opts.getBlockers?.() ?? [];
|
|
25
|
+
const isPushOrReplace = actionInfo.type === "PUSH" || actionInfo.type === "REPLACE";
|
|
26
|
+
if (typeof document !== "undefined" && blockers.length && isPushOrReplace) for (const blocker of blockers) {
|
|
27
|
+
const nextLocation = parseHref(actionInfo.path, actionInfo.state);
|
|
28
|
+
if (await blocker.blockerFn({
|
|
29
|
+
currentLocation: location,
|
|
30
|
+
nextLocation,
|
|
31
|
+
action: actionInfo.type
|
|
32
|
+
})) {
|
|
33
|
+
opts.onBlocked?.();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
task();
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
get location() {
|
|
41
|
+
return location;
|
|
42
|
+
},
|
|
43
|
+
get length() {
|
|
44
|
+
return opts.getLength();
|
|
45
|
+
},
|
|
46
|
+
subscribers,
|
|
47
|
+
subscribe: (cb) => {
|
|
48
|
+
subscribers.add(cb);
|
|
49
|
+
return () => {
|
|
50
|
+
subscribers.delete(cb);
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
push: (path, state, navigateOpts) => {
|
|
54
|
+
const currentIndex = location.state[stateIndexKey];
|
|
55
|
+
state = assignKeyAndIndex(currentIndex + 1, state);
|
|
56
|
+
tryNavigation({
|
|
57
|
+
task: () => {
|
|
58
|
+
opts.pushState(path, state);
|
|
59
|
+
notify({ type: "PUSH" });
|
|
60
|
+
},
|
|
61
|
+
navigateOpts,
|
|
62
|
+
type: "PUSH",
|
|
63
|
+
path,
|
|
64
|
+
state
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
replace: (path, state, navigateOpts) => {
|
|
68
|
+
const currentIndex = location.state[stateIndexKey];
|
|
69
|
+
state = assignKeyAndIndex(currentIndex, state);
|
|
70
|
+
tryNavigation({
|
|
71
|
+
task: () => {
|
|
72
|
+
opts.replaceState(path, state);
|
|
73
|
+
notify({ type: "REPLACE" });
|
|
74
|
+
},
|
|
75
|
+
navigateOpts,
|
|
76
|
+
type: "REPLACE",
|
|
77
|
+
path,
|
|
78
|
+
state
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
go: (index, navigateOpts) => {
|
|
82
|
+
tryNavigation({
|
|
83
|
+
task: () => {
|
|
84
|
+
opts.go(index);
|
|
85
|
+
handleIndexChange({
|
|
86
|
+
type: "GO",
|
|
87
|
+
index
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
navigateOpts,
|
|
91
|
+
type: "GO"
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
back: (navigateOpts) => {
|
|
95
|
+
tryNavigation({
|
|
96
|
+
task: () => {
|
|
97
|
+
opts.back(navigateOpts?.ignoreBlocker ?? false);
|
|
98
|
+
handleIndexChange({ type: "BACK" });
|
|
99
|
+
},
|
|
100
|
+
navigateOpts,
|
|
101
|
+
type: "BACK"
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
forward: (navigateOpts) => {
|
|
105
|
+
tryNavigation({
|
|
106
|
+
task: () => {
|
|
107
|
+
opts.forward(navigateOpts?.ignoreBlocker ?? false);
|
|
108
|
+
handleIndexChange({ type: "FORWARD" });
|
|
109
|
+
},
|
|
110
|
+
navigateOpts,
|
|
111
|
+
type: "FORWARD"
|
|
112
|
+
});
|
|
113
|
+
},
|
|
114
|
+
canGoBack: () => location.state[stateIndexKey] !== 0,
|
|
115
|
+
createHref: (str) => opts.createHref(str),
|
|
116
|
+
block: (blocker) => {
|
|
117
|
+
if (!opts.setBlockers) return () => {};
|
|
118
|
+
const blockers = opts.getBlockers?.() ?? [];
|
|
119
|
+
opts.setBlockers([...blockers, blocker]);
|
|
120
|
+
return () => {
|
|
121
|
+
const blockers2 = opts.getBlockers?.() ?? [];
|
|
122
|
+
opts.setBlockers?.(blockers2.filter((b) => b !== blocker));
|
|
123
|
+
};
|
|
124
|
+
},
|
|
125
|
+
flush: () => opts.flush?.(),
|
|
126
|
+
destroy: () => opts.destroy?.(),
|
|
127
|
+
notify
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
function assignKeyAndIndex(index, state) {
|
|
131
|
+
if (!state) state = {};
|
|
132
|
+
const key = createRandomKey();
|
|
133
|
+
return {
|
|
134
|
+
...state,
|
|
135
|
+
key,
|
|
136
|
+
__TSR_key: key,
|
|
137
|
+
[stateIndexKey]: index
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function createBrowserHistory(opts) {
|
|
141
|
+
const win = opts?.window ?? (typeof document !== "undefined" ? window : void 0);
|
|
142
|
+
const originalPushState = win.history.pushState;
|
|
143
|
+
const originalReplaceState = win.history.replaceState;
|
|
144
|
+
let blockers = [];
|
|
145
|
+
const _getBlockers = () => blockers;
|
|
146
|
+
const _setBlockers = (newBlockers) => blockers = newBlockers;
|
|
147
|
+
const createHref = opts?.createHref ?? ((path) => path);
|
|
148
|
+
const parseLocation = opts?.parseLocation ?? (() => parseHref(`${win.location.pathname}${win.location.search}${win.location.hash}`, win.history.state));
|
|
149
|
+
if (!win.history.state?.__TSR_key && !win.history.state?.key) {
|
|
150
|
+
const addedKey = createRandomKey();
|
|
151
|
+
win.history.replaceState({
|
|
152
|
+
[stateIndexKey]: 0,
|
|
153
|
+
key: addedKey,
|
|
154
|
+
__TSR_key: addedKey
|
|
155
|
+
}, "");
|
|
156
|
+
}
|
|
157
|
+
let currentLocation = parseLocation();
|
|
158
|
+
let rollbackLocation;
|
|
159
|
+
let nextPopIsGo = false;
|
|
160
|
+
let ignoreNextPop = false;
|
|
161
|
+
let skipBlockerNextPop = false;
|
|
162
|
+
let ignoreNextBeforeUnload = false;
|
|
163
|
+
const getLocation = () => currentLocation;
|
|
164
|
+
let next;
|
|
165
|
+
let scheduled;
|
|
166
|
+
const flush = () => {
|
|
167
|
+
if (!next) return;
|
|
168
|
+
history._ignoreSubscribers = true;
|
|
169
|
+
(next.isPush ? win.history.pushState : win.history.replaceState)(next.state, "", next.href);
|
|
170
|
+
history._ignoreSubscribers = false;
|
|
171
|
+
next = void 0;
|
|
172
|
+
scheduled = void 0;
|
|
173
|
+
rollbackLocation = void 0;
|
|
174
|
+
};
|
|
175
|
+
const queueHistoryAction = (type, destHref, state) => {
|
|
176
|
+
const href = createHref(destHref);
|
|
177
|
+
if (!scheduled) rollbackLocation = currentLocation;
|
|
178
|
+
currentLocation = parseHref(destHref, state);
|
|
179
|
+
next = {
|
|
180
|
+
href,
|
|
181
|
+
state,
|
|
182
|
+
isPush: next?.isPush || type === "push"
|
|
183
|
+
};
|
|
184
|
+
if (!scheduled) scheduled = Promise.resolve().then(() => flush());
|
|
185
|
+
};
|
|
186
|
+
const onPushPop = (type) => {
|
|
187
|
+
currentLocation = parseLocation();
|
|
188
|
+
history.notify({ type });
|
|
189
|
+
};
|
|
190
|
+
const onPushPopEvent = async () => {
|
|
191
|
+
if (ignoreNextPop) {
|
|
192
|
+
ignoreNextPop = false;
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const nextLocation = parseLocation();
|
|
196
|
+
const delta = nextLocation.state[stateIndexKey] - currentLocation.state[stateIndexKey];
|
|
197
|
+
const isForward = delta === 1;
|
|
198
|
+
const isBack = delta === -1;
|
|
199
|
+
const isGo = !isForward && !isBack || nextPopIsGo;
|
|
200
|
+
nextPopIsGo = false;
|
|
201
|
+
const action = isGo ? "GO" : isBack ? "BACK" : "FORWARD";
|
|
202
|
+
const notify = isGo ? {
|
|
203
|
+
type: "GO",
|
|
204
|
+
index: delta
|
|
205
|
+
} : { type: isBack ? "BACK" : "FORWARD" };
|
|
206
|
+
if (skipBlockerNextPop) skipBlockerNextPop = false;
|
|
207
|
+
else {
|
|
208
|
+
const blockers2 = _getBlockers();
|
|
209
|
+
if (typeof document !== "undefined" && blockers2.length) {
|
|
210
|
+
for (const blocker of blockers2) if (await blocker.blockerFn({
|
|
211
|
+
currentLocation,
|
|
212
|
+
nextLocation,
|
|
213
|
+
action
|
|
214
|
+
})) {
|
|
215
|
+
ignoreNextPop = true;
|
|
216
|
+
win.history.go(1);
|
|
217
|
+
history.notify(notify);
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
currentLocation = parseLocation();
|
|
223
|
+
history.notify(notify);
|
|
224
|
+
};
|
|
225
|
+
const onBeforeUnload = (e) => {
|
|
226
|
+
if (ignoreNextBeforeUnload) {
|
|
227
|
+
ignoreNextBeforeUnload = false;
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
let shouldBlock = false;
|
|
231
|
+
const blockers2 = _getBlockers();
|
|
232
|
+
if (typeof document !== "undefined" && blockers2.length) for (const blocker of blockers2) {
|
|
233
|
+
const shouldHaveBeforeUnload = blocker.enableBeforeUnload ?? true;
|
|
234
|
+
if (shouldHaveBeforeUnload === true) {
|
|
235
|
+
shouldBlock = true;
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
if (typeof shouldHaveBeforeUnload === "function" && shouldHaveBeforeUnload() === true) {
|
|
239
|
+
shouldBlock = true;
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (shouldBlock) {
|
|
244
|
+
e.preventDefault();
|
|
245
|
+
return e.returnValue = "";
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
const history = createHistory({
|
|
249
|
+
getLocation,
|
|
250
|
+
getLength: () => win.history.length,
|
|
251
|
+
pushState: (href, state) => queueHistoryAction("push", href, state),
|
|
252
|
+
replaceState: (href, state) => queueHistoryAction("replace", href, state),
|
|
253
|
+
back: (ignoreBlocker) => {
|
|
254
|
+
if (ignoreBlocker) skipBlockerNextPop = true;
|
|
255
|
+
ignoreNextBeforeUnload = true;
|
|
256
|
+
return win.history.back();
|
|
257
|
+
},
|
|
258
|
+
forward: (ignoreBlocker) => {
|
|
259
|
+
if (ignoreBlocker) skipBlockerNextPop = true;
|
|
260
|
+
ignoreNextBeforeUnload = true;
|
|
261
|
+
win.history.forward();
|
|
262
|
+
},
|
|
263
|
+
go: (n) => {
|
|
264
|
+
nextPopIsGo = true;
|
|
265
|
+
win.history.go(n);
|
|
266
|
+
},
|
|
267
|
+
createHref: (href) => createHref(href),
|
|
268
|
+
flush,
|
|
269
|
+
destroy: () => {
|
|
270
|
+
win.history.pushState = originalPushState;
|
|
271
|
+
win.history.replaceState = originalReplaceState;
|
|
272
|
+
win.removeEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });
|
|
273
|
+
win.removeEventListener(popStateEvent, onPushPopEvent);
|
|
274
|
+
},
|
|
275
|
+
onBlocked: () => {
|
|
276
|
+
if (rollbackLocation && currentLocation !== rollbackLocation) currentLocation = rollbackLocation;
|
|
277
|
+
},
|
|
278
|
+
getBlockers: _getBlockers,
|
|
279
|
+
setBlockers: _setBlockers,
|
|
280
|
+
notifyOnIndexChange: false
|
|
281
|
+
});
|
|
282
|
+
win.addEventListener(beforeUnloadEvent, onBeforeUnload, { capture: true });
|
|
283
|
+
win.addEventListener(popStateEvent, onPushPopEvent);
|
|
284
|
+
win.history.pushState = function(...args) {
|
|
285
|
+
const res = originalPushState.apply(win.history, args);
|
|
286
|
+
if (!history._ignoreSubscribers) onPushPop("PUSH");
|
|
287
|
+
return res;
|
|
288
|
+
};
|
|
289
|
+
win.history.replaceState = function(...args) {
|
|
290
|
+
const res = originalReplaceState.apply(win.history, args);
|
|
291
|
+
if (!history._ignoreSubscribers) onPushPop("REPLACE");
|
|
292
|
+
return res;
|
|
293
|
+
};
|
|
294
|
+
return history;
|
|
295
|
+
}
|
|
296
|
+
function sanitizePath(path) {
|
|
297
|
+
let sanitized = path.replace(/[\x00-\x1f\x7f]/g, "");
|
|
298
|
+
if (sanitized.startsWith("//")) sanitized = "/" + sanitized.replace(/^\/+/, "");
|
|
299
|
+
return sanitized;
|
|
300
|
+
}
|
|
301
|
+
function parseHref(href, state) {
|
|
302
|
+
const sanitizedHref = sanitizePath(href);
|
|
303
|
+
const hashIndex = sanitizedHref.indexOf("#");
|
|
304
|
+
const searchIndex = sanitizedHref.indexOf("?");
|
|
305
|
+
const addedKey = createRandomKey();
|
|
306
|
+
return {
|
|
307
|
+
href: sanitizedHref,
|
|
308
|
+
pathname: sanitizedHref.substring(0, hashIndex > 0 ? searchIndex > 0 ? Math.min(hashIndex, searchIndex) : hashIndex : searchIndex > 0 ? searchIndex : sanitizedHref.length),
|
|
309
|
+
hash: hashIndex > -1 ? sanitizedHref.substring(hashIndex) : "",
|
|
310
|
+
search: searchIndex > -1 ? sanitizedHref.slice(searchIndex, hashIndex === -1 ? void 0 : hashIndex) : "",
|
|
311
|
+
state: state || {
|
|
312
|
+
[stateIndexKey]: 0,
|
|
313
|
+
key: addedKey,
|
|
314
|
+
__TSR_key: addedKey
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
function createRandomKey() {
|
|
319
|
+
return (Math.random() + 1).toString(36).substring(7);
|
|
320
|
+
}
|
|
321
|
+
//#endregion
|
|
322
|
+
export { parseHref as n, createBrowserHistory as t };
|