@vitejs/devtools 0.0.0-alpha.9 → 0.1.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/dist/DockIcon-BtMEW4VE.js +97 -0
- package/dist/DockStandalone-CZAqITKs.js +81 -0
- package/dist/LogItem-BTrEubKY.js +205 -0
- package/dist/ToastOverlay-DO3Kl_rY.js +1055 -0
- package/dist/ViewBuiltinLogs-BL373XPJ.js +428 -0
- package/dist/ViewBuiltinTerminals-DdpE1Ftb.js +10409 -0
- package/dist/ViewJsonRender-coidkW9b.js +6835 -0
- package/dist/cli-commands-BRswBnHn.js +180 -0
- package/dist/cli-commands.js +3 -5
- package/dist/cli.js +3 -6
- package/dist/client/inject.js +171 -18
- package/dist/client/standalone/assets/DockStandalone-DDaYjGO1.js +1 -0
- package/dist/client/standalone/assets/LogItem-CKbVrExA.js +1 -0
- package/dist/client/standalone/assets/ViewBuiltinLogs-9oWDdl1G.js +1 -0
- package/dist/client/standalone/assets/ViewBuiltinTerminals-CpexS-ib.js +36 -0
- package/dist/client/standalone/assets/ViewJsonRender-CKPzRgqQ.js +43 -0
- package/dist/client/standalone/assets/dist-JpCJ4ieR.js +1 -0
- package/dist/client/standalone/assets/iconify-C-CPDXMf.js +2 -0
- package/dist/client/standalone/assets/index-3wlMt-60.js +3 -0
- package/dist/client/standalone/assets/index-6F2y1lxr.css +1 -0
- package/dist/client/standalone/assets/runtime-core.esm-bundler-oO31W4LZ.js +1 -0
- package/dist/client/standalone/index.html +7 -3
- package/dist/client/webcomponents.d.ts +21657 -31
- package/dist/client/webcomponents.js +307 -455
- package/dist/config.d.ts +25 -0
- package/dist/config.js +14 -0
- package/dist/dirs.js +7 -3
- package/dist/dist-Cgqg5_oP.js +1113 -0
- package/dist/iconify-YyqAMHKf.js +1625 -0
- package/dist/index.d.ts +256 -13
- package/dist/index.js +2 -4
- package/dist/plugins-Cvy_lJ0L.js +2135 -0
- package/dist/popup-ffZHGm5D.js +358 -0
- package/dist/utils-Csuu5uNf.js +10 -0
- package/dist/{dist-2aLfy0Lc.js → vue.runtime.esm-bundler-D2MZbyFr.js} +1948 -1734
- package/package.json +53 -21
- package/dist/cli-commands-CWESTkWI.js +0 -97
- package/dist/client/standalone/assets/index-CXKamp9k.js +0 -7
- package/dist/client/standalone/assets/index-DULlvzQC.css +0 -1
- package/dist/dirs-DcSK9l9L.js +0 -9
- package/dist/index-C-9eMTqf.d.ts +0 -142
- package/dist/plugins-5VE4Mfdt.js +0 -1365
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { G as shallowRef, M as watch, V as reactive, z as markRaw } from "./vue.runtime.esm-bundler-D2MZbyFr.js";
|
|
2
|
+
import { createEventEmitter } from "@vitejs/devtools-kit/utils/events";
|
|
3
|
+
//#region src/client/webcomponents/constants.ts
|
|
4
|
+
const BUILTIN_ENTRY_CLIENT_AUTH_NOTICE = Object.freeze({
|
|
5
|
+
type: "~builtin",
|
|
6
|
+
id: "~client-auth-notice",
|
|
7
|
+
title: "Unauthorized",
|
|
8
|
+
icon: "i-fluent-emoji-flat-warning"
|
|
9
|
+
});
|
|
10
|
+
const BUILTIN_ENTRIES = Object.freeze([BUILTIN_ENTRY_CLIENT_AUTH_NOTICE]);
|
|
11
|
+
const DEFAULT_CATEGORIES_ORDER = {
|
|
12
|
+
"~viteplus": -1e3,
|
|
13
|
+
"default": 0,
|
|
14
|
+
"app": 100,
|
|
15
|
+
"framework": 200,
|
|
16
|
+
"web": 300,
|
|
17
|
+
"advanced": 400,
|
|
18
|
+
"~builtin": 1e3
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/client/webcomponents/state/dock-settings.ts
|
|
22
|
+
/**
|
|
23
|
+
* Group and sort dock entries based on user settings.
|
|
24
|
+
* Filters out hidden entries and categories, sorts by pinned status, custom order, and default order.
|
|
25
|
+
*/
|
|
26
|
+
function docksGroupByCategories(entries, settings, options) {
|
|
27
|
+
const { docksHidden, docksCategoriesHidden, docksCustomOrder, docksPinned } = settings;
|
|
28
|
+
const { includeHidden = false } = options ?? {};
|
|
29
|
+
const map = /* @__PURE__ */ new Map();
|
|
30
|
+
for (const entry of entries) {
|
|
31
|
+
if (entry.isHidden && !includeHidden) continue;
|
|
32
|
+
if (!includeHidden && docksHidden.includes(entry.id)) continue;
|
|
33
|
+
const category = entry.category ?? "default";
|
|
34
|
+
if (!includeHidden && docksCategoriesHidden.includes(category)) continue;
|
|
35
|
+
if (!map.has(category)) map.set(category, []);
|
|
36
|
+
map.get(category).push(entry);
|
|
37
|
+
}
|
|
38
|
+
const grouped = Array.from(map.entries()).sort(([a], [b]) => {
|
|
39
|
+
const ia = DEFAULT_CATEGORIES_ORDER[a] || 0;
|
|
40
|
+
const ib = DEFAULT_CATEGORIES_ORDER[b] || 0;
|
|
41
|
+
return ib === ia ? b.localeCompare(a) : ia - ib;
|
|
42
|
+
});
|
|
43
|
+
grouped.forEach(([_, items]) => {
|
|
44
|
+
items.sort((a, b) => {
|
|
45
|
+
const aPinned = docksPinned.includes(a.id);
|
|
46
|
+
if (aPinned !== docksPinned.includes(b.id)) return aPinned ? -1 : 1;
|
|
47
|
+
const customOrderA = docksCustomOrder[a.id] ?? 0;
|
|
48
|
+
const customOrderB = docksCustomOrder[b.id] ?? 0;
|
|
49
|
+
if (customOrderA !== customOrderB) return customOrderA - customOrderB;
|
|
50
|
+
const ia = a.defaultOrder ?? 0;
|
|
51
|
+
const ib = b.defaultOrder ?? 0;
|
|
52
|
+
return ib === ia ? b.title.localeCompare(a.title) : ia - ib;
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
return grouped;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Split grouped entries into visible and overflow based on capacity.
|
|
59
|
+
*/
|
|
60
|
+
function docksSplitGroupsWithCapacity(groups, capacity) {
|
|
61
|
+
const visible = [];
|
|
62
|
+
const overflow = [];
|
|
63
|
+
let left = capacity;
|
|
64
|
+
for (const [category, items] of groups) if (left <= 0) overflow.push([category, items]);
|
|
65
|
+
else if (items.length > left) {
|
|
66
|
+
visible.push([category, items.slice(0, left)]);
|
|
67
|
+
overflow.push([category, items.slice(left)]);
|
|
68
|
+
left = 0;
|
|
69
|
+
} else {
|
|
70
|
+
left -= items.length;
|
|
71
|
+
visible.push([category, items]);
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
visible,
|
|
75
|
+
overflow
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/client/webcomponents/state/docks.ts
|
|
80
|
+
function DEFAULT_DOCK_PANEL_STORE() {
|
|
81
|
+
return {
|
|
82
|
+
width: 80,
|
|
83
|
+
height: 80,
|
|
84
|
+
top: 0,
|
|
85
|
+
left: 10,
|
|
86
|
+
position: "bottom",
|
|
87
|
+
open: false,
|
|
88
|
+
inactiveTimeout: 3e3
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function createDockEntryState(entry, selected) {
|
|
92
|
+
const events = createEventEmitter();
|
|
93
|
+
const state = reactive({
|
|
94
|
+
entryMeta: entry,
|
|
95
|
+
get isActive() {
|
|
96
|
+
return selected.value?.id === entry.id;
|
|
97
|
+
},
|
|
98
|
+
domElements: {},
|
|
99
|
+
events: markRaw(events)
|
|
100
|
+
});
|
|
101
|
+
watch(() => selected.value?.id, (newSelectedId) => {
|
|
102
|
+
if (newSelectedId === entry.id) events.emit("entry:activated");
|
|
103
|
+
else events.emit("entry:deactivated");
|
|
104
|
+
}, { immediate: true });
|
|
105
|
+
watch(() => state.domElements.iframe, (newIframe) => {
|
|
106
|
+
if (newIframe) events.emit("dom:iframe:mounted", newIframe);
|
|
107
|
+
}, { immediate: true });
|
|
108
|
+
watch(() => state.domElements.panel, (newPanel) => {
|
|
109
|
+
if (newPanel) events.emit("dom:panel:mounted", newPanel);
|
|
110
|
+
}, { immediate: true });
|
|
111
|
+
return state;
|
|
112
|
+
}
|
|
113
|
+
function sharedStateToRef(sharedState) {
|
|
114
|
+
const ref = shallowRef(sharedState.value());
|
|
115
|
+
sharedState.on("updated", (newState) => {
|
|
116
|
+
ref.value = newState;
|
|
117
|
+
});
|
|
118
|
+
return ref;
|
|
119
|
+
}
|
|
120
|
+
const docksEntriesRefByRpc = /* @__PURE__ */ new WeakMap();
|
|
121
|
+
async function useDocksEntries(rpc) {
|
|
122
|
+
if (docksEntriesRefByRpc.has(rpc)) return docksEntriesRefByRpc.get(rpc);
|
|
123
|
+
const docksEntriesRef = sharedStateToRef(await rpc.sharedState.get("devtoolskit:internal:docks", { initialValue: [] }));
|
|
124
|
+
docksEntriesRefByRpc.set(rpc, docksEntriesRef);
|
|
125
|
+
return docksEntriesRef;
|
|
126
|
+
}
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/client/webcomponents/state/floating-tooltip.ts
|
|
129
|
+
const tooltip = shallowRef(null);
|
|
130
|
+
const docksOverflowPanel = shallowRef(null);
|
|
131
|
+
const dockContextMenu = shallowRef(null);
|
|
132
|
+
function setFloatingTooltip(info) {
|
|
133
|
+
tooltip.value = info;
|
|
134
|
+
}
|
|
135
|
+
function useFloatingTooltip() {
|
|
136
|
+
return tooltip;
|
|
137
|
+
}
|
|
138
|
+
function setDocksOverflowPanel(info) {
|
|
139
|
+
docksOverflowPanel.value = info;
|
|
140
|
+
}
|
|
141
|
+
function useDocksOverflowPanel() {
|
|
142
|
+
return docksOverflowPanel;
|
|
143
|
+
}
|
|
144
|
+
function setDockContextMenu(info) {
|
|
145
|
+
dockContextMenu.value = info;
|
|
146
|
+
}
|
|
147
|
+
function useDockContextMenu() {
|
|
148
|
+
return dockContextMenu;
|
|
149
|
+
}
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/client/webcomponents/state/popup.ts
|
|
152
|
+
const PANEL_MIN_SIZE = 20;
|
|
153
|
+
const PANEL_MAX_SIZE = 100;
|
|
154
|
+
const POPUP_MIN_WIDTH = 320;
|
|
155
|
+
const POPUP_MIN_HEIGHT = 240;
|
|
156
|
+
const POPUP_DOCK_ID = "~popup";
|
|
157
|
+
const MAIN_FRAME_ACTION_HANDLER_KEY = "__VITE_DEVTOOLS_TRIGGER_DOCK_ACTION__";
|
|
158
|
+
const popupWindow = shallowRef(null);
|
|
159
|
+
const isPopupOpen = shallowRef(false);
|
|
160
|
+
const popupEvents = createEventEmitter();
|
|
161
|
+
let detachPopupListeners;
|
|
162
|
+
let detachColorModeSync;
|
|
163
|
+
let popupDockElement;
|
|
164
|
+
let loadDockStandalone = async () => {
|
|
165
|
+
return await import("./DockStandalone-CZAqITKs.js").then((m) => m.DockStandalone);
|
|
166
|
+
};
|
|
167
|
+
popupEvents.on("popup:open-requested", (context) => {
|
|
168
|
+
openDockPopup(context);
|
|
169
|
+
});
|
|
170
|
+
function getDocumentPictureInPicture() {
|
|
171
|
+
if (typeof window === "undefined") return;
|
|
172
|
+
return window.documentPictureInPicture;
|
|
173
|
+
}
|
|
174
|
+
function clearListeners() {
|
|
175
|
+
detachPopupListeners?.();
|
|
176
|
+
detachPopupListeners = void 0;
|
|
177
|
+
detachColorModeSync?.();
|
|
178
|
+
detachColorModeSync = void 0;
|
|
179
|
+
}
|
|
180
|
+
function resolveColorMode() {
|
|
181
|
+
const sourceWindow = window;
|
|
182
|
+
const elements = [sourceWindow.document?.documentElement, sourceWindow.document?.body].filter(Boolean);
|
|
183
|
+
for (const element of elements) {
|
|
184
|
+
if (element?.classList?.contains("dark")) return "dark";
|
|
185
|
+
if (element?.classList?.contains("light")) return "light";
|
|
186
|
+
const dataTheme = element?.getAttribute?.("data-theme");
|
|
187
|
+
if (dataTheme === "dark" || dataTheme === "light") return dataTheme;
|
|
188
|
+
}
|
|
189
|
+
if (sourceWindow.matchMedia?.("(prefers-color-scheme: dark)").matches) return "dark";
|
|
190
|
+
return "light";
|
|
191
|
+
}
|
|
192
|
+
function applyPopupColorMode(popup, mode) {
|
|
193
|
+
popup.document.documentElement?.style.setProperty("color-scheme", mode);
|
|
194
|
+
}
|
|
195
|
+
function setupPopupColorModeSync(popup) {
|
|
196
|
+
const cleanups = [];
|
|
197
|
+
const update = () => applyPopupColorMode(popup, resolveColorMode());
|
|
198
|
+
update();
|
|
199
|
+
const sourceWindow = window;
|
|
200
|
+
const sourceDocument = sourceWindow.document;
|
|
201
|
+
if (typeof MutationObserver !== "undefined" && sourceDocument) {
|
|
202
|
+
const observer = new MutationObserver(update);
|
|
203
|
+
for (const element of [sourceDocument.documentElement, sourceDocument.body]) {
|
|
204
|
+
if (!element) continue;
|
|
205
|
+
observer.observe(element, {
|
|
206
|
+
attributes: true,
|
|
207
|
+
attributeFilter: [
|
|
208
|
+
"class",
|
|
209
|
+
"data-theme",
|
|
210
|
+
"style"
|
|
211
|
+
]
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
cleanups.push(() => observer.disconnect());
|
|
215
|
+
}
|
|
216
|
+
if (sourceWindow.matchMedia) {
|
|
217
|
+
const darkQuery = sourceWindow.matchMedia("(prefers-color-scheme: dark)");
|
|
218
|
+
const lightQuery = sourceWindow.matchMedia("(prefers-color-scheme: light)");
|
|
219
|
+
darkQuery.addEventListener("change", update);
|
|
220
|
+
lightQuery.addEventListener("change", update);
|
|
221
|
+
cleanups.push(() => {
|
|
222
|
+
darkQuery.removeEventListener("change", update);
|
|
223
|
+
lightQuery.removeEventListener("change", update);
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
return () => {
|
|
227
|
+
cleanups.forEach((fn) => fn());
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
function unmountPopupElement() {
|
|
231
|
+
popupDockElement?.remove();
|
|
232
|
+
popupDockElement = void 0;
|
|
233
|
+
}
|
|
234
|
+
function clearPopupState() {
|
|
235
|
+
clearListeners();
|
|
236
|
+
unmountPopupElement();
|
|
237
|
+
popupWindow.value = null;
|
|
238
|
+
isPopupOpen.value = false;
|
|
239
|
+
}
|
|
240
|
+
function clamp(value, min, max) {
|
|
241
|
+
return Math.min(Math.max(value, min), max);
|
|
242
|
+
}
|
|
243
|
+
function syncPanelSizeFromPopup(context, popup) {
|
|
244
|
+
if (window.innerWidth <= 0 || window.innerHeight <= 0) return;
|
|
245
|
+
context.panel.store.width = clamp(Math.round(popup.innerWidth / window.innerWidth * 100), PANEL_MIN_SIZE, PANEL_MAX_SIZE);
|
|
246
|
+
context.panel.store.height = clamp(Math.round(popup.innerHeight / window.innerHeight * 100), PANEL_MIN_SIZE, PANEL_MAX_SIZE);
|
|
247
|
+
}
|
|
248
|
+
async function mountStandaloneApp(context, popup) {
|
|
249
|
+
const DockStandaloneElement = await loadDockStandalone();
|
|
250
|
+
const baseStyle = popup.document.createElement("style");
|
|
251
|
+
baseStyle.textContent = [
|
|
252
|
+
"html, body {",
|
|
253
|
+
" margin: 0;",
|
|
254
|
+
" padding: 0;",
|
|
255
|
+
" width: 100%;",
|
|
256
|
+
" height: 100%;",
|
|
257
|
+
" overflow: hidden;",
|
|
258
|
+
" background: transparent;",
|
|
259
|
+
"}",
|
|
260
|
+
"#vite-devtools-popup-root {",
|
|
261
|
+
" width: 100vw;",
|
|
262
|
+
" height: 100vh;",
|
|
263
|
+
"}",
|
|
264
|
+
"#vite-devtools-popup-root > vite-devtools-dock-standalone {",
|
|
265
|
+
" display: block;",
|
|
266
|
+
" width: 100%;",
|
|
267
|
+
" height: 100%;",
|
|
268
|
+
"}"
|
|
269
|
+
].join("\n");
|
|
270
|
+
popup.document.title = "Vite DevTools";
|
|
271
|
+
popup.document.head?.appendChild(baseStyle);
|
|
272
|
+
popup.document.body.textContent = "";
|
|
273
|
+
const appRoot = popup.document.createElement("div");
|
|
274
|
+
appRoot.id = "vite-devtools-popup-root";
|
|
275
|
+
popup.document.body.appendChild(appRoot);
|
|
276
|
+
const dockElement = new DockStandaloneElement({ context });
|
|
277
|
+
popupDockElement = dockElement;
|
|
278
|
+
appRoot.appendChild(dockElement);
|
|
279
|
+
}
|
|
280
|
+
function isDockPopupSupported() {
|
|
281
|
+
return !!getDocumentPictureInPicture()?.requestWindow;
|
|
282
|
+
}
|
|
283
|
+
function registerMainFrameDockActionHandler(clientType, handler) {
|
|
284
|
+
if (typeof window === "undefined") return;
|
|
285
|
+
if (clientType === "standalone") return;
|
|
286
|
+
window[MAIN_FRAME_ACTION_HANDLER_KEY] = handler;
|
|
287
|
+
}
|
|
288
|
+
async function triggerMainFrameDockAction(clientType, entryId) {
|
|
289
|
+
if (typeof window === "undefined") return void 0;
|
|
290
|
+
if (clientType !== "standalone") return void 0;
|
|
291
|
+
try {
|
|
292
|
+
const opener = window.opener;
|
|
293
|
+
if (!opener || opener.closed) return void 0;
|
|
294
|
+
const handler = opener[MAIN_FRAME_ACTION_HANDLER_KEY];
|
|
295
|
+
if (typeof handler !== "function") return void 0;
|
|
296
|
+
return await handler(entryId);
|
|
297
|
+
} catch {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
function isDockPopupEntryVisible(clientType) {
|
|
302
|
+
return isDockPopupSupported() && !isPopupOpen.value && clientType !== "standalone";
|
|
303
|
+
}
|
|
304
|
+
function filterPopupDockEntry(groups) {
|
|
305
|
+
return groups.map(([category, entries]) => [category, entries.filter((entry) => entry.id !== POPUP_DOCK_ID)]).filter(([, entries]) => entries.length > 0);
|
|
306
|
+
}
|
|
307
|
+
function useIsDockPopupOpen() {
|
|
308
|
+
return isPopupOpen;
|
|
309
|
+
}
|
|
310
|
+
function requestDockPopupOpen(context) {
|
|
311
|
+
popupEvents.emit("popup:open-requested", context);
|
|
312
|
+
}
|
|
313
|
+
function closeDockPopup() {
|
|
314
|
+
const popup = popupWindow.value;
|
|
315
|
+
clearPopupState();
|
|
316
|
+
if (!popup || popup.closed) return;
|
|
317
|
+
popup.close();
|
|
318
|
+
}
|
|
319
|
+
async function openDockPopup(context) {
|
|
320
|
+
setDocksOverflowPanel(null);
|
|
321
|
+
const currentPopup = popupWindow.value;
|
|
322
|
+
if (currentPopup?.closed) clearPopupState();
|
|
323
|
+
else if (currentPopup) {
|
|
324
|
+
currentPopup.focus();
|
|
325
|
+
return currentPopup;
|
|
326
|
+
}
|
|
327
|
+
const documentPictureInPicture = getDocumentPictureInPicture();
|
|
328
|
+
if (!documentPictureInPicture?.requestWindow) return null;
|
|
329
|
+
let openedPopup;
|
|
330
|
+
try {
|
|
331
|
+
const popup = openedPopup = await documentPictureInPicture.requestWindow({
|
|
332
|
+
width: Math.max(POPUP_MIN_WIDTH, Math.round(window.innerWidth * context.panel.store.width / 100)),
|
|
333
|
+
height: Math.max(POPUP_MIN_HEIGHT, Math.round(window.innerHeight * context.panel.store.height / 100))
|
|
334
|
+
});
|
|
335
|
+
await mountStandaloneApp(context, popup);
|
|
336
|
+
detachColorModeSync = setupPopupColorModeSync(popup);
|
|
337
|
+
const onResize = () => syncPanelSizeFromPopup(context, popup);
|
|
338
|
+
const onPageHide = () => {
|
|
339
|
+
if (popupWindow.value !== popup) return;
|
|
340
|
+
clearPopupState();
|
|
341
|
+
};
|
|
342
|
+
popup.addEventListener("resize", onResize);
|
|
343
|
+
popup.addEventListener("pagehide", onPageHide);
|
|
344
|
+
detachPopupListeners = () => {
|
|
345
|
+
popup.removeEventListener("resize", onResize);
|
|
346
|
+
popup.removeEventListener("pagehide", onPageHide);
|
|
347
|
+
};
|
|
348
|
+
popupWindow.value = popup;
|
|
349
|
+
isPopupOpen.value = true;
|
|
350
|
+
return popup;
|
|
351
|
+
} catch {
|
|
352
|
+
if (openedPopup && !openedPopup.closed) openedPopup.close();
|
|
353
|
+
clearPopupState();
|
|
354
|
+
return null;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
//#endregion
|
|
358
|
+
export { useDocksEntries as _, requestDockPopupOpen as a, BUILTIN_ENTRIES as b, setDockContextMenu as c, useDockContextMenu as d, useDocksOverflowPanel as f, sharedStateToRef as g, createDockEntryState as h, registerMainFrameDockActionHandler as i, setDocksOverflowPanel as l, DEFAULT_DOCK_PANEL_STORE as m, filterPopupDockEntry as n, triggerMainFrameDockAction as o, useFloatingTooltip as p, isDockPopupEntryVisible as r, useIsDockPopupOpen as s, closeDockPopup as t, setFloatingTooltip as u, docksGroupByCategories as v, BUILTIN_ENTRY_CLIENT_AUTH_NOTICE as x, docksSplitGroupsWithCapacity as y };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isIP } from "node:net";
|
|
2
|
+
//#region src/node/utils.ts
|
|
3
|
+
function isObject(value) {
|
|
4
|
+
return Object.prototype.toString.call(value) === "[object Object]";
|
|
5
|
+
}
|
|
6
|
+
function normalizeHttpServerUrl(host, port) {
|
|
7
|
+
return `http://${host === "127.0.0.1" ? "localhost" : isIP(host) === 6 ? `[${host}]` : host}:${port}`;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { normalizeHttpServerUrl as n, isObject as t };
|