@hot-updater/console 0.28.0 → 0.29.1
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,196 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@tanstack+devtools-event-client@0.4.3/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js
|
|
2
|
+
var EventClient = class {
|
|
3
|
+
#enabled = true;
|
|
4
|
+
#pluginId;
|
|
5
|
+
#eventTarget;
|
|
6
|
+
#debug;
|
|
7
|
+
#queuedEvents;
|
|
8
|
+
#connected;
|
|
9
|
+
#connectIntervalId;
|
|
10
|
+
#connectEveryMs;
|
|
11
|
+
#retryCount = 0;
|
|
12
|
+
#maxRetries = 5;
|
|
13
|
+
#connecting = false;
|
|
14
|
+
#failedToConnect = false;
|
|
15
|
+
#internalEventTarget = null;
|
|
16
|
+
#onConnected = () => {
|
|
17
|
+
this.debugLog("Connected to event bus");
|
|
18
|
+
this.#connected = true;
|
|
19
|
+
this.#connecting = false;
|
|
20
|
+
this.debugLog("Emitting queued events", this.#queuedEvents);
|
|
21
|
+
this.#queuedEvents.forEach((event) => this.emitEventToBus(event));
|
|
22
|
+
this.#queuedEvents = [];
|
|
23
|
+
this.stopConnectLoop();
|
|
24
|
+
this.#eventTarget().removeEventListener("tanstack-connect-success", this.#onConnected);
|
|
25
|
+
};
|
|
26
|
+
#retryConnection = () => {
|
|
27
|
+
if (this.#retryCount < this.#maxRetries) {
|
|
28
|
+
this.#retryCount++;
|
|
29
|
+
this.dispatchCustomEvent("tanstack-connect", {});
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.#eventTarget().removeEventListener("tanstack-connect", this.#retryConnection);
|
|
33
|
+
this.#failedToConnect = true;
|
|
34
|
+
this.debugLog("Max retries reached, giving up on connection");
|
|
35
|
+
this.stopConnectLoop();
|
|
36
|
+
};
|
|
37
|
+
#connectFunction = () => {
|
|
38
|
+
if (this.#connecting) return;
|
|
39
|
+
this.#connecting = true;
|
|
40
|
+
this.#eventTarget().addEventListener("tanstack-connect-success", this.#onConnected);
|
|
41
|
+
this.#retryConnection();
|
|
42
|
+
};
|
|
43
|
+
constructor({ pluginId, debug = false, enabled = true, reconnectEveryMs = 300 }) {
|
|
44
|
+
this.#pluginId = pluginId;
|
|
45
|
+
this.#enabled = enabled;
|
|
46
|
+
this.#eventTarget = this.getGlobalTarget;
|
|
47
|
+
this.#debug = debug;
|
|
48
|
+
this.debugLog(" Initializing event subscription for plugin", this.#pluginId);
|
|
49
|
+
this.#queuedEvents = [];
|
|
50
|
+
this.#connected = false;
|
|
51
|
+
this.#failedToConnect = false;
|
|
52
|
+
this.#connectIntervalId = null;
|
|
53
|
+
this.#connectEveryMs = reconnectEveryMs;
|
|
54
|
+
}
|
|
55
|
+
startConnectLoop() {
|
|
56
|
+
if (this.#connectIntervalId !== null || this.#connected) return;
|
|
57
|
+
this.debugLog(`Starting connect loop (every ${this.#connectEveryMs}ms)`);
|
|
58
|
+
this.#connectIntervalId = setInterval(this.#retryConnection, this.#connectEveryMs);
|
|
59
|
+
}
|
|
60
|
+
stopConnectLoop() {
|
|
61
|
+
this.#connecting = false;
|
|
62
|
+
if (this.#connectIntervalId === null) return;
|
|
63
|
+
clearInterval(this.#connectIntervalId);
|
|
64
|
+
this.#connectIntervalId = null;
|
|
65
|
+
this.#queuedEvents = [];
|
|
66
|
+
this.debugLog("Stopped connect loop");
|
|
67
|
+
}
|
|
68
|
+
debugLog(...args) {
|
|
69
|
+
if (this.#debug) console.log(`🌴 [tanstack-devtools:${this.#pluginId}-plugin]`, ...args);
|
|
70
|
+
}
|
|
71
|
+
getGlobalTarget() {
|
|
72
|
+
if (typeof globalThis !== "undefined" && globalThis.__TANSTACK_EVENT_TARGET__) {
|
|
73
|
+
this.debugLog("Using global event target");
|
|
74
|
+
return globalThis.__TANSTACK_EVENT_TARGET__;
|
|
75
|
+
}
|
|
76
|
+
if (typeof window !== "undefined" && typeof window.addEventListener !== "undefined") {
|
|
77
|
+
this.debugLog("Using window as event target");
|
|
78
|
+
return window;
|
|
79
|
+
}
|
|
80
|
+
const eventTarget = typeof EventTarget !== "undefined" ? new EventTarget() : void 0;
|
|
81
|
+
if (typeof eventTarget === "undefined" || typeof eventTarget.addEventListener === "undefined") {
|
|
82
|
+
this.debugLog("No event mechanism available, running in non-web environment");
|
|
83
|
+
return {
|
|
84
|
+
addEventListener: () => {},
|
|
85
|
+
removeEventListener: () => {},
|
|
86
|
+
dispatchEvent: () => false
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
this.debugLog("Using new EventTarget as fallback");
|
|
90
|
+
return eventTarget;
|
|
91
|
+
}
|
|
92
|
+
getPluginId() {
|
|
93
|
+
return this.#pluginId;
|
|
94
|
+
}
|
|
95
|
+
dispatchCustomEventShim(eventName, detail) {
|
|
96
|
+
try {
|
|
97
|
+
const event = new Event(eventName, { detail });
|
|
98
|
+
this.#eventTarget().dispatchEvent(event);
|
|
99
|
+
} catch (e) {
|
|
100
|
+
this.debugLog("Failed to dispatch shim event");
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
dispatchCustomEvent(eventName, detail) {
|
|
104
|
+
try {
|
|
105
|
+
this.#eventTarget().dispatchEvent(new CustomEvent(eventName, { detail }));
|
|
106
|
+
} catch (e) {
|
|
107
|
+
this.dispatchCustomEventShim(eventName, detail);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
emitEventToBus(event) {
|
|
111
|
+
this.debugLog("Emitting event to client bus", event);
|
|
112
|
+
this.dispatchCustomEvent("tanstack-dispatch-event", event);
|
|
113
|
+
}
|
|
114
|
+
createEventPayload(eventSuffix, payload) {
|
|
115
|
+
return {
|
|
116
|
+
type: `${this.#pluginId}:${eventSuffix}`,
|
|
117
|
+
payload,
|
|
118
|
+
pluginId: this.#pluginId
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
emit(eventSuffix, payload) {
|
|
122
|
+
if (!this.#enabled) {
|
|
123
|
+
this.debugLog("Event bus client is disabled, not emitting event", eventSuffix, payload);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (this.#internalEventTarget) {
|
|
127
|
+
this.debugLog("Emitting event to internal event target", eventSuffix, payload);
|
|
128
|
+
this.#internalEventTarget.dispatchEvent(new CustomEvent(`${this.#pluginId}:${eventSuffix}`, { detail: this.createEventPayload(eventSuffix, payload) }));
|
|
129
|
+
}
|
|
130
|
+
if (this.#failedToConnect) {
|
|
131
|
+
this.debugLog("Previously failed to connect, not emitting to bus");
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (!this.#connected) {
|
|
135
|
+
this.debugLog("Bus not available, will be pushed as soon as connected");
|
|
136
|
+
this.#queuedEvents.push(this.createEventPayload(eventSuffix, payload));
|
|
137
|
+
if (typeof CustomEvent !== "undefined" && !this.#connecting) {
|
|
138
|
+
this.#connectFunction();
|
|
139
|
+
this.startConnectLoop();
|
|
140
|
+
}
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
return this.emitEventToBus(this.createEventPayload(eventSuffix, payload));
|
|
144
|
+
}
|
|
145
|
+
on(eventSuffix, cb, options) {
|
|
146
|
+
const withEventTarget = options?.withEventTarget ?? false;
|
|
147
|
+
const eventName = `${this.#pluginId}:${eventSuffix}`;
|
|
148
|
+
if (withEventTarget) {
|
|
149
|
+
if (!this.#internalEventTarget) this.#internalEventTarget = new EventTarget();
|
|
150
|
+
this.#internalEventTarget.addEventListener(eventName, (e) => {
|
|
151
|
+
cb(e.detail);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
if (!this.#enabled) {
|
|
155
|
+
this.debugLog("Event bus client is disabled, not registering event", eventName);
|
|
156
|
+
return () => {};
|
|
157
|
+
}
|
|
158
|
+
const handler = (e) => {
|
|
159
|
+
this.debugLog("Received event from bus", e.detail);
|
|
160
|
+
cb(e.detail);
|
|
161
|
+
};
|
|
162
|
+
this.#eventTarget().addEventListener(eventName, handler);
|
|
163
|
+
this.debugLog("Registered event to bus", eventName);
|
|
164
|
+
return () => {
|
|
165
|
+
if (withEventTarget) this.#internalEventTarget?.removeEventListener(eventName, handler);
|
|
166
|
+
this.#eventTarget().removeEventListener(eventName, handler);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
onAll(cb) {
|
|
170
|
+
if (!this.#enabled) {
|
|
171
|
+
this.debugLog("Event bus client is disabled, not registering event");
|
|
172
|
+
return () => {};
|
|
173
|
+
}
|
|
174
|
+
const handler = (e) => {
|
|
175
|
+
const event = e.detail;
|
|
176
|
+
cb(event);
|
|
177
|
+
};
|
|
178
|
+
this.#eventTarget().addEventListener("tanstack-devtools-global", handler);
|
|
179
|
+
return () => this.#eventTarget().removeEventListener("tanstack-devtools-global", handler);
|
|
180
|
+
}
|
|
181
|
+
onAllPluginEvents(cb) {
|
|
182
|
+
if (!this.#enabled) {
|
|
183
|
+
this.debugLog("Event bus client is disabled, not registering event");
|
|
184
|
+
return () => {};
|
|
185
|
+
}
|
|
186
|
+
const handler = (e) => {
|
|
187
|
+
const event = e.detail;
|
|
188
|
+
if (this.#pluginId && event.pluginId !== this.#pluginId) return;
|
|
189
|
+
cb(event);
|
|
190
|
+
};
|
|
191
|
+
this.#eventTarget().addEventListener("tanstack-devtools-global", handler);
|
|
192
|
+
return () => this.#eventTarget().removeEventListener("tanstack-devtools-global", handler);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
//#endregion
|
|
196
|
+
export { EventClient as t };
|