@vue/devtools-kit 7.0.13 → 7.0.14
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/index.cjs +90 -81
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/{index.mjs → index.js} +89 -81
- package/package.json +5 -6
package/dist/index.cjs
CHANGED
|
@@ -1607,6 +1607,7 @@ __export(src_exports, {
|
|
|
1607
1607
|
symbolRE: () => symbolRE,
|
|
1608
1608
|
toEdit: () => toEdit,
|
|
1609
1609
|
toSubmit: () => toSubmit,
|
|
1610
|
+
toggleComponentInspectorEnabled: () => toggleComponentInspectorEnabled,
|
|
1610
1611
|
vueBuiltins: () => vueBuiltins
|
|
1611
1612
|
});
|
|
1612
1613
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -1665,10 +1666,10 @@ function createDevToolsHook() {
|
|
|
1665
1666
|
apps: {},
|
|
1666
1667
|
events: /* @__PURE__ */ new Map(),
|
|
1667
1668
|
on(event, fn) {
|
|
1668
|
-
var
|
|
1669
|
+
var _a9;
|
|
1669
1670
|
if (!this.events.has(event))
|
|
1670
1671
|
this.events.set(event, []);
|
|
1671
|
-
(
|
|
1672
|
+
(_a9 = this.events.get(event)) == null ? void 0 : _a9.push(fn);
|
|
1672
1673
|
return () => this.off(event, fn);
|
|
1673
1674
|
},
|
|
1674
1675
|
once(event, fn) {
|
|
@@ -1696,14 +1697,14 @@ function createDevToolsHook() {
|
|
|
1696
1697
|
function subscribeDevToolsHook() {
|
|
1697
1698
|
const hook2 = import_devtools_shared.target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
1698
1699
|
hook2.on(import_devtools_schema.DevToolsHooks.APP_INIT, (app, version) => {
|
|
1699
|
-
var
|
|
1700
|
-
if ((_c = (
|
|
1700
|
+
var _a9, _b9, _c;
|
|
1701
|
+
if ((_c = (_b9 = (_a9 = app == null ? void 0 : app._instance) == null ? void 0 : _a9.type) == null ? void 0 : _b9.devtools) == null ? void 0 : _c.hide)
|
|
1701
1702
|
return;
|
|
1702
1703
|
devtoolsHooks.callHook(import_devtools_schema.DevToolsHooks.APP_INIT, app, version);
|
|
1703
1704
|
});
|
|
1704
1705
|
hook2.on(import_devtools_schema.DevToolsHooks.COMPONENT_ADDED, async (app, uid, parentUid, component) => {
|
|
1705
|
-
var
|
|
1706
|
-
if ((_c = (
|
|
1706
|
+
var _a9, _b9, _c;
|
|
1707
|
+
if ((_c = (_b9 = (_a9 = app == null ? void 0 : app._instance) == null ? void 0 : _a9.type) == null ? void 0 : _b9.devtools) == null ? void 0 : _c.hide)
|
|
1707
1708
|
return;
|
|
1708
1709
|
if (!app || typeof uid !== "number" && !uid || !component)
|
|
1709
1710
|
return;
|
|
@@ -1777,8 +1778,8 @@ function normalizeRouterInfo(appRecord) {
|
|
|
1777
1778
|
return route;
|
|
1778
1779
|
}
|
|
1779
1780
|
function init() {
|
|
1780
|
-
var
|
|
1781
|
-
const router = (
|
|
1781
|
+
var _a9;
|
|
1782
|
+
const router = (_a9 = appRecord.app) == null ? void 0 : _a9.config.globalProperties.$router;
|
|
1782
1783
|
const currentRoute = filterCurrentRoute(router == null ? void 0 : router.currentRoute.value);
|
|
1783
1784
|
const routes = filterRoutes(getRoutes(router));
|
|
1784
1785
|
const c = console.warn;
|
|
@@ -1840,14 +1841,14 @@ var devtoolsState = new Proxy(import_devtools_shared3.target[StateKey], {
|
|
|
1840
1841
|
return import_devtools_shared3.target[StateKey][property];
|
|
1841
1842
|
},
|
|
1842
1843
|
set(target8, property, value) {
|
|
1843
|
-
var
|
|
1844
|
+
var _a9;
|
|
1844
1845
|
const oldState = { ...import_devtools_shared3.target[StateKey] };
|
|
1845
1846
|
target8[property] = value;
|
|
1846
1847
|
import_devtools_shared3.target[StateKey][property] = value;
|
|
1847
1848
|
if (property === "activeAppRecord") {
|
|
1848
1849
|
import_devtools_shared3.target[ContextKey].appRecord = value;
|
|
1849
1850
|
import_devtools_shared3.target[ContextKey].api = value.api;
|
|
1850
|
-
import_devtools_shared3.target[ContextKey].inspector = (
|
|
1851
|
+
import_devtools_shared3.target[ContextKey].inspector = (_a9 = value.inspector) != null ? _a9 : [];
|
|
1851
1852
|
normalizeRouterInfo(value);
|
|
1852
1853
|
import_devtools_shared3.target[ContextKey].routerInfo = devtoolsRouterInfo;
|
|
1853
1854
|
}
|
|
@@ -2025,21 +2026,21 @@ async function getComponentId(options) {
|
|
|
2025
2026
|
}
|
|
2026
2027
|
}
|
|
2027
2028
|
function isFragment(instance) {
|
|
2028
|
-
var
|
|
2029
|
-
const subTreeType = (
|
|
2029
|
+
var _a9;
|
|
2030
|
+
const subTreeType = (_a9 = instance.subTree) == null ? void 0 : _a9.type;
|
|
2030
2031
|
return subTreeType === import_vue.Fragment;
|
|
2031
2032
|
}
|
|
2032
2033
|
function isBeingDestroyed(instance) {
|
|
2033
2034
|
return instance._isBeingDestroyed || instance.isUnmounted;
|
|
2034
2035
|
}
|
|
2035
2036
|
function getInstanceName(instance) {
|
|
2036
|
-
var
|
|
2037
|
+
var _a9, _b9, _c;
|
|
2037
2038
|
const name = getComponentTypeName(instance.type || {});
|
|
2038
2039
|
if (name)
|
|
2039
2040
|
return name;
|
|
2040
2041
|
if (instance.root === instance)
|
|
2041
2042
|
return "Root";
|
|
2042
|
-
for (const key in (
|
|
2043
|
+
for (const key in (_b9 = (_a9 = instance.parent) == null ? void 0 : _a9.type) == null ? void 0 : _b9.components) {
|
|
2043
2044
|
if (instance.parent.type.components[key] === instance.type)
|
|
2044
2045
|
return saveComponentGussedName(instance, key);
|
|
2045
2046
|
}
|
|
@@ -2053,8 +2054,8 @@ function getInstanceName(instance) {
|
|
|
2053
2054
|
return "Anonymous Component";
|
|
2054
2055
|
}
|
|
2055
2056
|
function getUniqueComponentId(instance) {
|
|
2056
|
-
var
|
|
2057
|
-
const appId = (_c = (
|
|
2057
|
+
var _a9, _b9, _c;
|
|
2058
|
+
const appId = (_c = (_b9 = (_a9 = instance == null ? void 0 : instance.appContext) == null ? void 0 : _a9.app) == null ? void 0 : _b9.__VUE_DEVTOOLS_APP_RECORD_ID__) != null ? _c : 0;
|
|
2058
2059
|
const instanceId = instance === instance.root ? "root" : instance.uid;
|
|
2059
2060
|
return `${appId}:${instanceId}`;
|
|
2060
2061
|
}
|
|
@@ -2258,7 +2259,7 @@ function getStateTypeAndName(info) {
|
|
|
2258
2259
|
function processSetupState(instance) {
|
|
2259
2260
|
const raw = instance.devtoolsRawSetupState || {};
|
|
2260
2261
|
return Object.keys(instance.setupState).filter((key) => !vueBuiltins.has(key) && key.split(/(?=[A-Z])/)[0] !== "use").map((key) => {
|
|
2261
|
-
var
|
|
2262
|
+
var _a9, _b9, _c, _d;
|
|
2262
2263
|
const value = returnError(() => toRaw(instance.setupState[key]));
|
|
2263
2264
|
const rawData = raw[key];
|
|
2264
2265
|
let result;
|
|
@@ -2267,7 +2268,7 @@ function processSetupState(instance) {
|
|
|
2267
2268
|
const info = getSetupStateType(rawData);
|
|
2268
2269
|
const { stateType, stateTypeName } = getStateTypeAndName(info);
|
|
2269
2270
|
const isState = info.ref || info.computed || info.reactive;
|
|
2270
|
-
const raw2 = ((
|
|
2271
|
+
const raw2 = ((_b9 = (_a9 = rawData.effect) == null ? void 0 : _a9.raw) == null ? void 0 : _b9.toString()) || ((_d = (_c = rawData.effect) == null ? void 0 : _c.fn) == null ? void 0 : _d.toString());
|
|
2271
2272
|
if (stateType)
|
|
2272
2273
|
isOtherType = false;
|
|
2273
2274
|
result = {
|
|
@@ -2297,8 +2298,8 @@ function processComputed(instance, mergedType) {
|
|
|
2297
2298
|
type: type2,
|
|
2298
2299
|
key,
|
|
2299
2300
|
value: returnError(() => {
|
|
2300
|
-
var
|
|
2301
|
-
return (
|
|
2301
|
+
var _a9;
|
|
2302
|
+
return (_a9 = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a9[key];
|
|
2302
2303
|
}),
|
|
2303
2304
|
editable: typeof def.set === "function"
|
|
2304
2305
|
});
|
|
@@ -2360,10 +2361,10 @@ function processRefs(instance) {
|
|
|
2360
2361
|
}));
|
|
2361
2362
|
}
|
|
2362
2363
|
function processEventListeners(instance) {
|
|
2363
|
-
var
|
|
2364
|
+
var _a9;
|
|
2364
2365
|
const emitsDefinition = instance.type.emits;
|
|
2365
2366
|
const declaredEmits = Array.isArray(emitsDefinition) ? emitsDefinition : Object.keys(emitsDefinition != null ? emitsDefinition : {});
|
|
2366
|
-
const keys = Object.keys((
|
|
2367
|
+
const keys = Object.keys((_a9 = instance.vnode.props) != null ? _a9 : {});
|
|
2367
2368
|
const result = [];
|
|
2368
2369
|
for (const key of keys) {
|
|
2369
2370
|
const [prefix, ...eventNameParts] = key.split(/(?=[A-Z])/);
|
|
@@ -2584,13 +2585,13 @@ function getHTMLElementDetails(value) {
|
|
|
2584
2585
|
}
|
|
2585
2586
|
}
|
|
2586
2587
|
function getObjectDetails(object) {
|
|
2587
|
-
var
|
|
2588
|
+
var _a9, _b9, _c, _d;
|
|
2588
2589
|
const info = getSetupStateType(object);
|
|
2589
2590
|
const isState = info.ref || info.computed || info.reactive;
|
|
2590
2591
|
if (isState) {
|
|
2591
2592
|
const stateTypeName = info.computed ? "Computed" : info.ref ? "Ref" : info.reactive ? "Reactive" : null;
|
|
2592
2593
|
const value = toRaw(info.reactive ? object : object._value);
|
|
2593
|
-
const raw = ((
|
|
2594
|
+
const raw = ((_b9 = (_a9 = object.effect) == null ? void 0 : _a9.raw) == null ? void 0 : _b9.toString()) || ((_d = (_c = object.effect) == null ? void 0 : _c.fn) == null ? void 0 : _d.toString());
|
|
2594
2595
|
return {
|
|
2595
2596
|
_custom: {
|
|
2596
2597
|
type: stateTypeName == null ? void 0 : stateTypeName.toLowerCase(),
|
|
@@ -2612,7 +2613,7 @@ function getObjectDetails(object) {
|
|
|
2612
2613
|
|
|
2613
2614
|
// src/core/component/state/replacer.ts
|
|
2614
2615
|
function stringifyReplacer(key) {
|
|
2615
|
-
var
|
|
2616
|
+
var _a9;
|
|
2616
2617
|
if (key === "compilerOptions")
|
|
2617
2618
|
return;
|
|
2618
2619
|
const val = this[key];
|
|
@@ -2668,7 +2669,7 @@ function stringifyReplacer(key) {
|
|
|
2668
2669
|
return `[native VNode <${val.tag}>]`;
|
|
2669
2670
|
} else if (typeof HTMLElement !== "undefined" && val instanceof HTMLElement) {
|
|
2670
2671
|
return getHTMLElementDetails(val);
|
|
2671
|
-
} else if (((
|
|
2672
|
+
} else if (((_a9 = val.constructor) == null ? void 0 : _a9.name) === "Store" && val._wrappedGetters) {
|
|
2672
2673
|
return "[object Store]";
|
|
2673
2674
|
} else if (val.currentRoute) {
|
|
2674
2675
|
return "[object Router]";
|
|
@@ -2704,7 +2705,7 @@ function reviveMap(val) {
|
|
|
2704
2705
|
return result;
|
|
2705
2706
|
}
|
|
2706
2707
|
function revive(val) {
|
|
2707
|
-
var
|
|
2708
|
+
var _a9;
|
|
2708
2709
|
if (val === UNDEFINED) {
|
|
2709
2710
|
return void 0;
|
|
2710
2711
|
} else if (val === INFINITY) {
|
|
@@ -2716,7 +2717,7 @@ function revive(val) {
|
|
|
2716
2717
|
} else if (val && val._custom) {
|
|
2717
2718
|
const { _custom: custom } = val;
|
|
2718
2719
|
if (custom.type === "component")
|
|
2719
|
-
return (
|
|
2720
|
+
return (_a9 = devtoolsContext.appRecord) == null ? void 0 : _a9.instanceMap.get(custom.id);
|
|
2720
2721
|
else if (custom.type === "map")
|
|
2721
2722
|
return reviveMap(val);
|
|
2722
2723
|
else if (custom.type === "set")
|
|
@@ -2878,7 +2879,7 @@ function getInspectorStateValueType(value, raw = true) {
|
|
|
2878
2879
|
}
|
|
2879
2880
|
}
|
|
2880
2881
|
function formatInspectorStateValue(value, quotes = false) {
|
|
2881
|
-
var
|
|
2882
|
+
var _a9, _b9;
|
|
2882
2883
|
let result;
|
|
2883
2884
|
const type = getInspectorStateValueType(value, false);
|
|
2884
2885
|
if (type !== "custom" && (value == null ? void 0 : value._custom))
|
|
@@ -2886,14 +2887,14 @@ function formatInspectorStateValue(value, quotes = false) {
|
|
|
2886
2887
|
if (result = internalStateTokenToString(value)) {
|
|
2887
2888
|
return result;
|
|
2888
2889
|
} else if (type === "custom") {
|
|
2889
|
-
const nestedName = ((
|
|
2890
|
+
const nestedName = ((_a9 = value._custom.value) == null ? void 0 : _a9._custom) && formatInspectorStateValue(value._custom.value);
|
|
2890
2891
|
return nestedName || value._custom.displayText || value._custom.display;
|
|
2891
2892
|
} else if (type === "array") {
|
|
2892
2893
|
return `Array[${value.length}]`;
|
|
2893
2894
|
} else if (type === "plain-object") {
|
|
2894
2895
|
return `Object${Object.keys(value).length ? "" : " (empty)"}`;
|
|
2895
2896
|
} else if (type == null ? void 0 : type.includes("native")) {
|
|
2896
|
-
return escape((
|
|
2897
|
+
return escape((_b9 = specialTypeRE.exec(value)) == null ? void 0 : _b9[2]);
|
|
2897
2898
|
} else if (typeof value === "string") {
|
|
2898
2899
|
const typeMatch = value.match(rawTypeRE);
|
|
2899
2900
|
if (typeMatch)
|
|
@@ -2907,14 +2908,14 @@ function formatInspectorStateValue(value, quotes = false) {
|
|
|
2907
2908
|
return value;
|
|
2908
2909
|
}
|
|
2909
2910
|
function getRawValue(value) {
|
|
2910
|
-
var
|
|
2911
|
+
var _a9, _b9;
|
|
2911
2912
|
const isCustom = getInspectorStateValueType(value) === "custom";
|
|
2912
2913
|
let inherit = {};
|
|
2913
2914
|
if (isCustom) {
|
|
2914
2915
|
const data = value;
|
|
2915
|
-
const customValue = (
|
|
2916
|
+
const customValue = (_a9 = data._custom) == null ? void 0 : _a9.value;
|
|
2916
2917
|
const nestedCustom = typeof customValue === "object" && customValue !== null && "_custom" in customValue ? getRawValue(customValue) : { inherit: void 0, value: void 0 };
|
|
2917
|
-
inherit = nestedCustom.inherit || ((
|
|
2918
|
+
inherit = nestedCustom.inherit || ((_b9 = data._custom) == null ? void 0 : _b9.fields) || {};
|
|
2918
2919
|
value = nestedCustom.value || customValue;
|
|
2919
2920
|
}
|
|
2920
2921
|
if (value && value._isArray)
|
|
@@ -2933,7 +2934,7 @@ function stringify(data) {
|
|
|
2933
2934
|
return stringifyCircularAutoChunks(data, stringifyReplacer);
|
|
2934
2935
|
}
|
|
2935
2936
|
function parse(data, revive2 = false) {
|
|
2936
|
-
if (
|
|
2937
|
+
if (data == void 0)
|
|
2937
2938
|
return {};
|
|
2938
2939
|
return revive2 ? parseCircularAutoChunks(data, reviver) : parseCircularAutoChunks(data);
|
|
2939
2940
|
}
|
|
@@ -3140,8 +3141,8 @@ async function registerPlugin(options) {
|
|
|
3140
3141
|
setupFn(api);
|
|
3141
3142
|
});
|
|
3142
3143
|
devtoolsState.appRecords = devtoolsState.appRecords.map((record) => {
|
|
3143
|
-
var
|
|
3144
|
-
const globalProperties = (
|
|
3144
|
+
var _a9, _b9;
|
|
3145
|
+
const globalProperties = (_b9 = (_a9 = record.app) == null ? void 0 : _a9.config) == null ? void 0 : _b9.globalProperties;
|
|
3145
3146
|
if (!globalProperties)
|
|
3146
3147
|
return record;
|
|
3147
3148
|
return {
|
|
@@ -3249,7 +3250,7 @@ var ComponentWalker = class {
|
|
|
3249
3250
|
* @return {object}
|
|
3250
3251
|
*/
|
|
3251
3252
|
async capture(instance, depth) {
|
|
3252
|
-
var
|
|
3253
|
+
var _a9;
|
|
3253
3254
|
if (!instance)
|
|
3254
3255
|
return null;
|
|
3255
3256
|
const id = this.captureId(instance);
|
|
@@ -3304,7 +3305,7 @@ var ComponentWalker = class {
|
|
|
3304
3305
|
} else {
|
|
3305
3306
|
treeNode.domOrder = [-1];
|
|
3306
3307
|
}
|
|
3307
|
-
if ((
|
|
3308
|
+
if ((_a9 = instance.suspense) == null ? void 0 : _a9.suspenseKey) {
|
|
3308
3309
|
treeNode.tags.push({
|
|
3309
3310
|
label: instance.suspense.suspenseKey,
|
|
3310
3311
|
backgroundColor: 14979812,
|
|
@@ -3329,8 +3330,8 @@ var ComponentWalker = class {
|
|
|
3329
3330
|
* @return {Vue|Array}
|
|
3330
3331
|
*/
|
|
3331
3332
|
async findQualifiedChildren(instance, depth) {
|
|
3332
|
-
var
|
|
3333
|
-
if (this.componentFilter.isQualified(instance) && !((
|
|
3333
|
+
var _a9;
|
|
3334
|
+
if (this.componentFilter.isQualified(instance) && !((_a9 = instance.type.devtools) == null ? void 0 : _a9.hide)) {
|
|
3334
3335
|
return [await this.capture(instance, depth)];
|
|
3335
3336
|
} else if (instance.subTree) {
|
|
3336
3337
|
const list = this.isKeepAlive(instance) ? this.getKeepAliveCachedInstances(instance) : this.getInternalInstanceChildren(instance.subTree);
|
|
@@ -3350,8 +3351,8 @@ var ComponentWalker = class {
|
|
|
3350
3351
|
*/
|
|
3351
3352
|
async findQualifiedChildrenFromList(instances, depth) {
|
|
3352
3353
|
instances = instances.filter((child) => {
|
|
3353
|
-
var
|
|
3354
|
-
return !isBeingDestroyed(child) && !((
|
|
3354
|
+
var _a9;
|
|
3355
|
+
return !isBeingDestroyed(child) && !((_a9 = child.type.devtools) == null ? void 0 : _a9.hide);
|
|
3355
3356
|
});
|
|
3356
3357
|
if (!this.componentFilter.filter)
|
|
3357
3358
|
return Promise.all(instances.map((child) => this.capture(child, depth)));
|
|
@@ -3379,8 +3380,8 @@ var ComponentWalker = class {
|
|
|
3379
3380
|
}
|
|
3380
3381
|
}
|
|
3381
3382
|
return list.filter((child) => {
|
|
3382
|
-
var
|
|
3383
|
-
return !isBeingDestroyed(child) && !((
|
|
3383
|
+
var _a9;
|
|
3384
|
+
return !isBeingDestroyed(child) && !((_a9 = child.type.devtools) == null ? void 0 : _a9.hide);
|
|
3384
3385
|
});
|
|
3385
3386
|
}
|
|
3386
3387
|
/**
|
|
@@ -3404,11 +3405,11 @@ var ComponentWalker = class {
|
|
|
3404
3405
|
// src/core/component/state/index.ts
|
|
3405
3406
|
init_cjs_shims();
|
|
3406
3407
|
function getInstanceState(params) {
|
|
3407
|
-
var
|
|
3408
|
+
var _a9;
|
|
3408
3409
|
const instance = getComponentInstance(devtoolsContext.appRecord, params.instanceId);
|
|
3409
3410
|
const id = getUniqueComponentId(instance);
|
|
3410
3411
|
const name = getInstanceName(instance);
|
|
3411
|
-
const file = (
|
|
3412
|
+
const file = (_a9 = instance == null ? void 0 : instance.type) == null ? void 0 : _a9.__file;
|
|
3412
3413
|
const state = processInstanceState(instance);
|
|
3413
3414
|
return {
|
|
3414
3415
|
id,
|
|
@@ -3598,13 +3599,13 @@ function registerComponentsDevTools(app) {
|
|
|
3598
3599
|
}
|
|
3599
3600
|
});
|
|
3600
3601
|
api.on.getInspectorState(async (payload) => {
|
|
3601
|
-
var
|
|
3602
|
+
var _a9;
|
|
3602
3603
|
if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
|
|
3603
3604
|
const result = getInstanceState({
|
|
3604
3605
|
instanceId: payload.nodeId
|
|
3605
3606
|
});
|
|
3606
3607
|
const componentInstance = result.instance;
|
|
3607
|
-
const app2 = (
|
|
3608
|
+
const app2 = (_a9 = result.instance) == null ? void 0 : _a9.appContext.app;
|
|
3608
3609
|
const _payload = {
|
|
3609
3610
|
componentInstance,
|
|
3610
3611
|
app: app2,
|
|
@@ -3629,8 +3630,8 @@ function registerComponentsDevTools(app) {
|
|
|
3629
3630
|
api.sendInspectorState(INSPECTOR_ID);
|
|
3630
3631
|
}, 120);
|
|
3631
3632
|
const componentAddedCleanup = hook.on.componentAdded(async (app2, uid, parentUid, component) => {
|
|
3632
|
-
var
|
|
3633
|
-
if ((_c = (
|
|
3633
|
+
var _a9, _b9, _c;
|
|
3634
|
+
if ((_c = (_b9 = (_a9 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a9.type) == null ? void 0 : _b9.devtools) == null ? void 0 : _c.hide)
|
|
3634
3635
|
return;
|
|
3635
3636
|
if (!app2 || typeof uid !== "number" && !uid || !component)
|
|
3636
3637
|
return;
|
|
@@ -3651,8 +3652,8 @@ function registerComponentsDevTools(app) {
|
|
|
3651
3652
|
debounceSendInspectorTree();
|
|
3652
3653
|
});
|
|
3653
3654
|
const componentUpdatedCleanup = hook.on.componentUpdated(async (app2, uid, parentUid, component) => {
|
|
3654
|
-
var
|
|
3655
|
-
if ((_c = (
|
|
3655
|
+
var _a9, _b9, _c;
|
|
3656
|
+
if ((_c = (_b9 = (_a9 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a9.type) == null ? void 0 : _b9.devtools) == null ? void 0 : _c.hide)
|
|
3656
3657
|
return;
|
|
3657
3658
|
if (!app2 || typeof uid !== "number" && !uid || !component)
|
|
3658
3659
|
return;
|
|
@@ -3674,8 +3675,8 @@ function registerComponentsDevTools(app) {
|
|
|
3674
3675
|
debounceSendInspectorState();
|
|
3675
3676
|
});
|
|
3676
3677
|
const componentRemovedCleanup = hook.on.componentRemoved(async (app2, uid, parentUid, component) => {
|
|
3677
|
-
var
|
|
3678
|
-
if ((_c = (
|
|
3678
|
+
var _a9, _b9, _c;
|
|
3679
|
+
if ((_c = (_b9 = (_a9 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a9.type) == null ? void 0 : _b9.devtools) == null ? void 0 : _c.hide)
|
|
3679
3680
|
return;
|
|
3680
3681
|
if (!app2 || typeof uid !== "number" && !uid || !component)
|
|
3681
3682
|
return;
|
|
@@ -3750,6 +3751,11 @@ function removeCustomCommand(actionId) {
|
|
|
3750
3751
|
// src/core/vue-inspector/index.ts
|
|
3751
3752
|
init_cjs_shims();
|
|
3752
3753
|
var import_devtools_shared10 = require("@vue/devtools-shared");
|
|
3754
|
+
var _a7, _b7;
|
|
3755
|
+
(_b7 = (_a7 = import_devtools_shared10.target).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__) != null ? _b7 : _a7.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = true;
|
|
3756
|
+
function toggleComponentInspectorEnabled(enabled) {
|
|
3757
|
+
import_devtools_shared10.target.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = enabled;
|
|
3758
|
+
}
|
|
3753
3759
|
function waitForInspectorInit(cb) {
|
|
3754
3760
|
let total = 0;
|
|
3755
3761
|
const timer = setInterval(() => {
|
|
@@ -3773,6 +3779,8 @@ function setupInspector() {
|
|
|
3773
3779
|
}
|
|
3774
3780
|
function getVueInspector() {
|
|
3775
3781
|
return new Promise((resolve) => {
|
|
3782
|
+
if (!import_devtools_shared10.target.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__)
|
|
3783
|
+
resolve(null);
|
|
3776
3784
|
function setup() {
|
|
3777
3785
|
setupInspector();
|
|
3778
3786
|
resolve(import_devtools_shared10.target.__VUE_INSPECTOR__);
|
|
@@ -3824,7 +3832,7 @@ var indicatorStyles = {
|
|
|
3824
3832
|
fontSize: "12px",
|
|
3825
3833
|
opacity: 0.7
|
|
3826
3834
|
};
|
|
3827
|
-
function
|
|
3835
|
+
function getContainerElement() {
|
|
3828
3836
|
return document.getElementById(CONTAINER_ELEMENT_ID);
|
|
3829
3837
|
}
|
|
3830
3838
|
function getCardElement() {
|
|
@@ -3845,9 +3853,9 @@ function getStyles(bounds) {
|
|
|
3845
3853
|
};
|
|
3846
3854
|
}
|
|
3847
3855
|
function create(options) {
|
|
3848
|
-
var
|
|
3856
|
+
var _a9;
|
|
3849
3857
|
const containerEl = document.createElement("div");
|
|
3850
|
-
containerEl.id = (
|
|
3858
|
+
containerEl.id = (_a9 = options.elementId) != null ? _a9 : CONTAINER_ELEMENT_ID;
|
|
3851
3859
|
Object.assign(containerEl.style, {
|
|
3852
3860
|
...containerStyles,
|
|
3853
3861
|
...getStyles(options.bounds),
|
|
@@ -3873,7 +3881,7 @@ function create(options) {
|
|
|
3873
3881
|
return containerEl;
|
|
3874
3882
|
}
|
|
3875
3883
|
function update(options) {
|
|
3876
|
-
const containerEl =
|
|
3884
|
+
const containerEl = getContainerElement();
|
|
3877
3885
|
const cardEl = getCardElement();
|
|
3878
3886
|
const nameEl = getNameElement();
|
|
3879
3887
|
const indicatorEl = getIndicatorElement();
|
|
@@ -3894,11 +3902,11 @@ function toggleComponentInspector(options) {
|
|
|
3894
3902
|
const instance = getComponentInstance(devtoolsContext.appRecord, options.id);
|
|
3895
3903
|
if (instance && (options.bounds.width || options.bounds.height)) {
|
|
3896
3904
|
const name = getInstanceName(instance);
|
|
3897
|
-
const el =
|
|
3905
|
+
const el = getContainerElement();
|
|
3898
3906
|
el ? update({ ...options, name }) : create({ ...options, name });
|
|
3899
3907
|
}
|
|
3900
3908
|
} else {
|
|
3901
|
-
const el =
|
|
3909
|
+
const el = getContainerElement();
|
|
3902
3910
|
if (el)
|
|
3903
3911
|
el.style.display = "none";
|
|
3904
3912
|
}
|
|
@@ -3906,11 +3914,11 @@ function toggleComponentInspector(options) {
|
|
|
3906
3914
|
function highlight(instance) {
|
|
3907
3915
|
const bounds = getComponentBoundingRect(instance);
|
|
3908
3916
|
const name = getInstanceName(instance);
|
|
3909
|
-
const container =
|
|
3917
|
+
const container = getContainerElement();
|
|
3910
3918
|
container ? update({ bounds, name }) : create({ bounds, name });
|
|
3911
3919
|
}
|
|
3912
3920
|
function unhighlight() {
|
|
3913
|
-
const el =
|
|
3921
|
+
const el = getContainerElement();
|
|
3914
3922
|
if (el)
|
|
3915
3923
|
el.style.display = "none";
|
|
3916
3924
|
}
|
|
@@ -3925,18 +3933,18 @@ function inspectFn(e) {
|
|
|
3925
3933
|
if (el) {
|
|
3926
3934
|
const bounds = getComponentBoundingRect(instance);
|
|
3927
3935
|
const name = getInstanceName(instance);
|
|
3928
|
-
const container =
|
|
3936
|
+
const container = getContainerElement();
|
|
3929
3937
|
container ? update({ bounds, name }) : create({ bounds, name });
|
|
3930
3938
|
}
|
|
3931
3939
|
}
|
|
3932
3940
|
}
|
|
3933
3941
|
}
|
|
3934
3942
|
function selectComponentFn(e, cb) {
|
|
3935
|
-
var
|
|
3943
|
+
var _a9;
|
|
3936
3944
|
e.preventDefault();
|
|
3937
3945
|
e.stopPropagation();
|
|
3938
3946
|
if (inspectInstance) {
|
|
3939
|
-
const app = (
|
|
3947
|
+
const app = (_a9 = devtoolsContext.appRecord) == null ? void 0 : _a9.app;
|
|
3940
3948
|
getComponentId({
|
|
3941
3949
|
app,
|
|
3942
3950
|
uid: app.uid,
|
|
@@ -3955,7 +3963,7 @@ function inspectComponentInspector() {
|
|
|
3955
3963
|
selectComponentFn(e, (id) => {
|
|
3956
3964
|
window.removeEventListener("click", onSelect);
|
|
3957
3965
|
window.removeEventListener("mouseover", inspectFn);
|
|
3958
|
-
const el =
|
|
3966
|
+
const el = getContainerElement();
|
|
3959
3967
|
if (el)
|
|
3960
3968
|
el.style.display = "none";
|
|
3961
3969
|
resolve(JSON.stringify({ id }));
|
|
@@ -3992,7 +4000,7 @@ function scrollToComponent(options) {
|
|
|
3992
4000
|
const bounds = getComponentBoundingRect(instance);
|
|
3993
4001
|
if (bounds.width || bounds.height) {
|
|
3994
4002
|
const name = getInstanceName(instance);
|
|
3995
|
-
const el2 =
|
|
4003
|
+
const el2 = getContainerElement();
|
|
3996
4004
|
el2 ? update({ ...options, name, bounds }) : create({ ...options, name, bounds });
|
|
3997
4005
|
setTimeout(() => {
|
|
3998
4006
|
if (el2)
|
|
@@ -4127,12 +4135,12 @@ var DevToolsPluginApi = class {
|
|
|
4127
4135
|
removeCustomCommand(actionId);
|
|
4128
4136
|
}
|
|
4129
4137
|
addInspector(payload) {
|
|
4130
|
-
var
|
|
4138
|
+
var _a9;
|
|
4131
4139
|
addInspector({
|
|
4132
4140
|
id: payload.id,
|
|
4133
4141
|
nodeId: "",
|
|
4134
4142
|
filter: "",
|
|
4135
|
-
treeFilterPlaceholder: (
|
|
4143
|
+
treeFilterPlaceholder: (_a9 = payload.treeFilterPlaceholder) != null ? _a9 : ""
|
|
4136
4144
|
});
|
|
4137
4145
|
}
|
|
4138
4146
|
openInEditor(payload) {
|
|
@@ -4176,20 +4184,20 @@ var DevToolsPluginApi = class {
|
|
|
4176
4184
|
init_cjs_shims();
|
|
4177
4185
|
var import_devtools_shared11 = require("@vue/devtools-shared");
|
|
4178
4186
|
var import_speakingurl = __toESM(require_speakingurl2(), 1);
|
|
4179
|
-
var
|
|
4180
|
-
var appRecordInfo = (
|
|
4187
|
+
var _a8, _b8;
|
|
4188
|
+
var appRecordInfo = (_b8 = (_a8 = import_devtools_shared11.target).__VUE_DEVTOOLS_APP_RECROD_INFO__) != null ? _b8 : _a8.__VUE_DEVTOOLS_APP_RECROD_INFO__ = {
|
|
4181
4189
|
id: 0,
|
|
4182
4190
|
appIds: /* @__PURE__ */ new Set()
|
|
4183
4191
|
};
|
|
4184
4192
|
function getAppRecordName(app, fallbackName) {
|
|
4185
|
-
var
|
|
4186
|
-
return ((
|
|
4193
|
+
var _a9;
|
|
4194
|
+
return ((_a9 = app == null ? void 0 : app._component) == null ? void 0 : _a9.name) || `App ${fallbackName}`;
|
|
4187
4195
|
}
|
|
4188
4196
|
function getAppRootInstance(app) {
|
|
4189
|
-
var
|
|
4197
|
+
var _a9, _b9, _c, _d;
|
|
4190
4198
|
if (app._instance)
|
|
4191
4199
|
return app._instance;
|
|
4192
|
-
else if ((
|
|
4200
|
+
else if ((_b9 = (_a9 = app._container) == null ? void 0 : _a9._vnode) == null ? void 0 : _b9.component)
|
|
4193
4201
|
return (_d = (_c = app._container) == null ? void 0 : _c._vnode) == null ? void 0 : _d.component;
|
|
4194
4202
|
}
|
|
4195
4203
|
function getAppRecordId(app, defaultId) {
|
|
@@ -4230,23 +4238,23 @@ function createAppRecord(app) {
|
|
|
4230
4238
|
|
|
4231
4239
|
// src/core/general/index.ts
|
|
4232
4240
|
function initDevTools() {
|
|
4233
|
-
var
|
|
4241
|
+
var _a9, _b9, _c;
|
|
4234
4242
|
devtoolsState.vitePluginDetected = !!import_devtools_shared12.target.__VUE_DEVTOOLS_VITE_PLUGIN_DETECTED__;
|
|
4235
|
-
const isNewDevTools = ((
|
|
4243
|
+
const isNewDevTools = ((_a9 = import_devtools_shared12.target.__VUE_DEVTOOLS_GLOBAL_HOOK__) == null ? void 0 : _a9.id) === "vue-devtools-next";
|
|
4236
4244
|
if (import_devtools_shared12.target.__VUE_DEVTOOLS_GLOBAL_HOOK__ && isNewDevTools)
|
|
4237
4245
|
return;
|
|
4238
4246
|
if (import_devtools_shared12.target.__VUE_DEVTOOLS_GLOBAL_HOOK__)
|
|
4239
4247
|
Object.assign(__VUE_DEVTOOLS_GLOBAL_HOOK__, createDevToolsHook());
|
|
4240
4248
|
else
|
|
4241
4249
|
import_devtools_shared12.target.__VUE_DEVTOOLS_GLOBAL_HOOK__ = createDevToolsHook();
|
|
4242
|
-
(_c = (
|
|
4250
|
+
(_c = (_b9 = import_devtools_shared12.target).__VUE_DEVTOOLS_APP_RECORDS__) != null ? _c : _b9.__VUE_DEVTOOLS_APP_RECORDS__ = [];
|
|
4243
4251
|
hook.on.setupDevtoolsPlugin(collectRegisteredPlugin);
|
|
4244
4252
|
hook.on.vueAppInit(async (app, version) => {
|
|
4245
|
-
var
|
|
4253
|
+
var _a10;
|
|
4246
4254
|
const record = createAppRecord(app);
|
|
4247
4255
|
const api = new DevToolsPluginApi();
|
|
4248
4256
|
devtoolsState.appRecords = [
|
|
4249
|
-
...(
|
|
4257
|
+
...(_a10 = devtoolsState.appRecords) != null ? _a10 : [],
|
|
4250
4258
|
{
|
|
4251
4259
|
...record,
|
|
4252
4260
|
app,
|
|
@@ -4331,5 +4339,6 @@ var devtools = {
|
|
|
4331
4339
|
symbolRE,
|
|
4332
4340
|
toEdit,
|
|
4333
4341
|
toSubmit,
|
|
4342
|
+
toggleComponentInspectorEnabled,
|
|
4334
4343
|
vueBuiltins
|
|
4335
4344
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -35,7 +35,8 @@ interface VueInspector {
|
|
|
35
35
|
openInEditor: (baseUrl: string, file: string, line: number, column: number) => void;
|
|
36
36
|
onUpdated: () => void;
|
|
37
37
|
}
|
|
38
|
-
declare function
|
|
38
|
+
declare function toggleComponentInspectorEnabled(enabled: boolean): void;
|
|
39
|
+
declare function getVueInspector(): Promise<VueInspector | null>;
|
|
39
40
|
|
|
40
41
|
interface InspectorCustomState {
|
|
41
42
|
_custom?: {
|
|
@@ -358,7 +359,7 @@ declare class DevToolsPluginApi {
|
|
|
358
359
|
highlightElement(instance: any): void;
|
|
359
360
|
unhighlightElement(): void;
|
|
360
361
|
getComponentInstances(app: any): Promise<any[]>;
|
|
361
|
-
getVueInspector(): Promise<VueInspector>;
|
|
362
|
+
getVueInspector(): Promise<VueInspector | null>;
|
|
362
363
|
visitComponentTree(payload: Parameters<DevToolsEvent[DevToolsEvents.VISIT_COMPONENT_TREE]>[0]): void;
|
|
363
364
|
addTimelineLayer(payload: {
|
|
364
365
|
id: string;
|
|
@@ -622,4 +623,4 @@ declare const devtools: {
|
|
|
622
623
|
readonly api: DevToolsPluginApi;
|
|
623
624
|
};
|
|
624
625
|
|
|
625
|
-
export { type AddInspectorApiPayload, type ComponentBoundingRect, type ComponentBoundingRectApiPayload, type ComponentTreeNode, type CustomCommand, type CustomCommandAction, type CustomTab, ESC, INFINITY, type InspectorCustomState, type InspectorNodeTag, type InspectorState, type InspectorStateApiPayload, type InspectorStateEditorPayload, type InspectorTreeApiPayload, MAX_ARRAY_SIZE, MAX_STRING_SIZE, type ModuleIframeView, type ModuleVNodeView, type ModuleView, NAN, NEGATIVE_INFINITY, type OpenInEditorOptions, type PropPath, type RouterInfo, RouterKey, type ScrollToComponentOptions, type TimelineEvent, type TimelineEventData, type ToggleComponentInspectorOptions, UNDEFINED, type VueInspector, addCustomCommand, addCustomTab, devtools, devtoolsRouterInfo, fnTypeRE, formatInspectorStateValue, getInspectorStateValueType, getRawValue, getRouterDevToolsId, getVueInspector, normalizeRouterInfo, now, onDevToolsClientConnected, onDevToolsConnected, openInEditor, parse, rawTypeRE, removeCustomCommand, setupDevToolsPlugin, specialTypeRE, stringify, symbolRE, toEdit, toSubmit, vueBuiltins };
|
|
626
|
+
export { type AddInspectorApiPayload, type ComponentBoundingRect, type ComponentBoundingRectApiPayload, type ComponentTreeNode, type CustomCommand, type CustomCommandAction, type CustomTab, ESC, INFINITY, type InspectorCustomState, type InspectorNodeTag, type InspectorState, type InspectorStateApiPayload, type InspectorStateEditorPayload, type InspectorTreeApiPayload, MAX_ARRAY_SIZE, MAX_STRING_SIZE, type ModuleIframeView, type ModuleVNodeView, type ModuleView, NAN, NEGATIVE_INFINITY, type OpenInEditorOptions, type PropPath, type RouterInfo, RouterKey, type ScrollToComponentOptions, type TimelineEvent, type TimelineEventData, type ToggleComponentInspectorOptions, UNDEFINED, type VueInspector, addCustomCommand, addCustomTab, devtools, devtoolsRouterInfo, fnTypeRE, formatInspectorStateValue, getInspectorStateValueType, getRawValue, getRouterDevToolsId, getVueInspector, normalizeRouterInfo, now, onDevToolsClientConnected, onDevToolsConnected, openInEditor, parse, rawTypeRE, removeCustomCommand, setupDevToolsPlugin, specialTypeRE, stringify, symbolRE, toEdit, toSubmit, toggleComponentInspectorEnabled, vueBuiltins };
|
package/dist/index.d.ts
CHANGED
|
@@ -35,7 +35,8 @@ interface VueInspector {
|
|
|
35
35
|
openInEditor: (baseUrl: string, file: string, line: number, column: number) => void;
|
|
36
36
|
onUpdated: () => void;
|
|
37
37
|
}
|
|
38
|
-
declare function
|
|
38
|
+
declare function toggleComponentInspectorEnabled(enabled: boolean): void;
|
|
39
|
+
declare function getVueInspector(): Promise<VueInspector | null>;
|
|
39
40
|
|
|
40
41
|
interface InspectorCustomState {
|
|
41
42
|
_custom?: {
|
|
@@ -358,7 +359,7 @@ declare class DevToolsPluginApi {
|
|
|
358
359
|
highlightElement(instance: any): void;
|
|
359
360
|
unhighlightElement(): void;
|
|
360
361
|
getComponentInstances(app: any): Promise<any[]>;
|
|
361
|
-
getVueInspector(): Promise<VueInspector>;
|
|
362
|
+
getVueInspector(): Promise<VueInspector | null>;
|
|
362
363
|
visitComponentTree(payload: Parameters<DevToolsEvent[DevToolsEvents.VISIT_COMPONENT_TREE]>[0]): void;
|
|
363
364
|
addTimelineLayer(payload: {
|
|
364
365
|
id: string;
|
|
@@ -622,4 +623,4 @@ declare const devtools: {
|
|
|
622
623
|
readonly api: DevToolsPluginApi;
|
|
623
624
|
};
|
|
624
625
|
|
|
625
|
-
export { type AddInspectorApiPayload, type ComponentBoundingRect, type ComponentBoundingRectApiPayload, type ComponentTreeNode, type CustomCommand, type CustomCommandAction, type CustomTab, ESC, INFINITY, type InspectorCustomState, type InspectorNodeTag, type InspectorState, type InspectorStateApiPayload, type InspectorStateEditorPayload, type InspectorTreeApiPayload, MAX_ARRAY_SIZE, MAX_STRING_SIZE, type ModuleIframeView, type ModuleVNodeView, type ModuleView, NAN, NEGATIVE_INFINITY, type OpenInEditorOptions, type PropPath, type RouterInfo, RouterKey, type ScrollToComponentOptions, type TimelineEvent, type TimelineEventData, type ToggleComponentInspectorOptions, UNDEFINED, type VueInspector, addCustomCommand, addCustomTab, devtools, devtoolsRouterInfo, fnTypeRE, formatInspectorStateValue, getInspectorStateValueType, getRawValue, getRouterDevToolsId, getVueInspector, normalizeRouterInfo, now, onDevToolsClientConnected, onDevToolsConnected, openInEditor, parse, rawTypeRE, removeCustomCommand, setupDevToolsPlugin, specialTypeRE, stringify, symbolRE, toEdit, toSubmit, vueBuiltins };
|
|
626
|
+
export { type AddInspectorApiPayload, type ComponentBoundingRect, type ComponentBoundingRectApiPayload, type ComponentTreeNode, type CustomCommand, type CustomCommandAction, type CustomTab, ESC, INFINITY, type InspectorCustomState, type InspectorNodeTag, type InspectorState, type InspectorStateApiPayload, type InspectorStateEditorPayload, type InspectorTreeApiPayload, MAX_ARRAY_SIZE, MAX_STRING_SIZE, type ModuleIframeView, type ModuleVNodeView, type ModuleView, NAN, NEGATIVE_INFINITY, type OpenInEditorOptions, type PropPath, type RouterInfo, RouterKey, type ScrollToComponentOptions, type TimelineEvent, type TimelineEventData, type ToggleComponentInspectorOptions, UNDEFINED, type VueInspector, addCustomCommand, addCustomTab, devtools, devtoolsRouterInfo, fnTypeRE, formatInspectorStateValue, getInspectorStateValueType, getRawValue, getRouterDevToolsId, getVueInspector, normalizeRouterInfo, now, onDevToolsClientConnected, onDevToolsConnected, openInEditor, parse, rawTypeRE, removeCustomCommand, setupDevToolsPlugin, specialTypeRE, stringify, symbolRE, toEdit, toSubmit, toggleComponentInspectorEnabled, vueBuiltins };
|
|
@@ -1628,10 +1628,10 @@ function createDevToolsHook() {
|
|
|
1628
1628
|
apps: {},
|
|
1629
1629
|
events: /* @__PURE__ */ new Map(),
|
|
1630
1630
|
on(event, fn) {
|
|
1631
|
-
var
|
|
1631
|
+
var _a9;
|
|
1632
1632
|
if (!this.events.has(event))
|
|
1633
1633
|
this.events.set(event, []);
|
|
1634
|
-
(
|
|
1634
|
+
(_a9 = this.events.get(event)) == null ? void 0 : _a9.push(fn);
|
|
1635
1635
|
return () => this.off(event, fn);
|
|
1636
1636
|
},
|
|
1637
1637
|
once(event, fn) {
|
|
@@ -1659,14 +1659,14 @@ function createDevToolsHook() {
|
|
|
1659
1659
|
function subscribeDevToolsHook() {
|
|
1660
1660
|
const hook2 = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
|
|
1661
1661
|
hook2.on(DevToolsHooks.APP_INIT, (app, version) => {
|
|
1662
|
-
var
|
|
1663
|
-
if ((_c = (
|
|
1662
|
+
var _a9, _b9, _c;
|
|
1663
|
+
if ((_c = (_b9 = (_a9 = app == null ? void 0 : app._instance) == null ? void 0 : _a9.type) == null ? void 0 : _b9.devtools) == null ? void 0 : _c.hide)
|
|
1664
1664
|
return;
|
|
1665
1665
|
devtoolsHooks.callHook(DevToolsHooks.APP_INIT, app, version);
|
|
1666
1666
|
});
|
|
1667
1667
|
hook2.on(DevToolsHooks.COMPONENT_ADDED, async (app, uid, parentUid, component) => {
|
|
1668
|
-
var
|
|
1669
|
-
if ((_c = (
|
|
1668
|
+
var _a9, _b9, _c;
|
|
1669
|
+
if ((_c = (_b9 = (_a9 = app == null ? void 0 : app._instance) == null ? void 0 : _a9.type) == null ? void 0 : _b9.devtools) == null ? void 0 : _c.hide)
|
|
1670
1670
|
return;
|
|
1671
1671
|
if (!app || typeof uid !== "number" && !uid || !component)
|
|
1672
1672
|
return;
|
|
@@ -1740,8 +1740,8 @@ function normalizeRouterInfo(appRecord) {
|
|
|
1740
1740
|
return route;
|
|
1741
1741
|
}
|
|
1742
1742
|
function init() {
|
|
1743
|
-
var
|
|
1744
|
-
const router = (
|
|
1743
|
+
var _a9;
|
|
1744
|
+
const router = (_a9 = appRecord.app) == null ? void 0 : _a9.config.globalProperties.$router;
|
|
1745
1745
|
const currentRoute = filterCurrentRoute(router == null ? void 0 : router.currentRoute.value);
|
|
1746
1746
|
const routes = filterRoutes(getRoutes(router));
|
|
1747
1747
|
const c = console.warn;
|
|
@@ -1803,14 +1803,14 @@ var devtoolsState = new Proxy(global2[StateKey], {
|
|
|
1803
1803
|
return global2[StateKey][property];
|
|
1804
1804
|
},
|
|
1805
1805
|
set(target8, property, value) {
|
|
1806
|
-
var
|
|
1806
|
+
var _a9;
|
|
1807
1807
|
const oldState = { ...global2[StateKey] };
|
|
1808
1808
|
target8[property] = value;
|
|
1809
1809
|
global2[StateKey][property] = value;
|
|
1810
1810
|
if (property === "activeAppRecord") {
|
|
1811
1811
|
global2[ContextKey].appRecord = value;
|
|
1812
1812
|
global2[ContextKey].api = value.api;
|
|
1813
|
-
global2[ContextKey].inspector = (
|
|
1813
|
+
global2[ContextKey].inspector = (_a9 = value.inspector) != null ? _a9 : [];
|
|
1814
1814
|
normalizeRouterInfo(value);
|
|
1815
1815
|
global2[ContextKey].routerInfo = devtoolsRouterInfo;
|
|
1816
1816
|
}
|
|
@@ -1988,21 +1988,21 @@ async function getComponentId(options) {
|
|
|
1988
1988
|
}
|
|
1989
1989
|
}
|
|
1990
1990
|
function isFragment(instance) {
|
|
1991
|
-
var
|
|
1992
|
-
const subTreeType = (
|
|
1991
|
+
var _a9;
|
|
1992
|
+
const subTreeType = (_a9 = instance.subTree) == null ? void 0 : _a9.type;
|
|
1993
1993
|
return subTreeType === Fragment;
|
|
1994
1994
|
}
|
|
1995
1995
|
function isBeingDestroyed(instance) {
|
|
1996
1996
|
return instance._isBeingDestroyed || instance.isUnmounted;
|
|
1997
1997
|
}
|
|
1998
1998
|
function getInstanceName(instance) {
|
|
1999
|
-
var
|
|
1999
|
+
var _a9, _b9, _c;
|
|
2000
2000
|
const name = getComponentTypeName(instance.type || {});
|
|
2001
2001
|
if (name)
|
|
2002
2002
|
return name;
|
|
2003
2003
|
if (instance.root === instance)
|
|
2004
2004
|
return "Root";
|
|
2005
|
-
for (const key in (
|
|
2005
|
+
for (const key in (_b9 = (_a9 = instance.parent) == null ? void 0 : _a9.type) == null ? void 0 : _b9.components) {
|
|
2006
2006
|
if (instance.parent.type.components[key] === instance.type)
|
|
2007
2007
|
return saveComponentGussedName(instance, key);
|
|
2008
2008
|
}
|
|
@@ -2016,8 +2016,8 @@ function getInstanceName(instance) {
|
|
|
2016
2016
|
return "Anonymous Component";
|
|
2017
2017
|
}
|
|
2018
2018
|
function getUniqueComponentId(instance) {
|
|
2019
|
-
var
|
|
2020
|
-
const appId = (_c = (
|
|
2019
|
+
var _a9, _b9, _c;
|
|
2020
|
+
const appId = (_c = (_b9 = (_a9 = instance == null ? void 0 : instance.appContext) == null ? void 0 : _a9.app) == null ? void 0 : _b9.__VUE_DEVTOOLS_APP_RECORD_ID__) != null ? _c : 0;
|
|
2021
2021
|
const instanceId = instance === instance.root ? "root" : instance.uid;
|
|
2022
2022
|
return `${appId}:${instanceId}`;
|
|
2023
2023
|
}
|
|
@@ -2221,7 +2221,7 @@ function getStateTypeAndName(info) {
|
|
|
2221
2221
|
function processSetupState(instance) {
|
|
2222
2222
|
const raw = instance.devtoolsRawSetupState || {};
|
|
2223
2223
|
return Object.keys(instance.setupState).filter((key) => !vueBuiltins.has(key) && key.split(/(?=[A-Z])/)[0] !== "use").map((key) => {
|
|
2224
|
-
var
|
|
2224
|
+
var _a9, _b9, _c, _d;
|
|
2225
2225
|
const value = returnError(() => toRaw(instance.setupState[key]));
|
|
2226
2226
|
const rawData = raw[key];
|
|
2227
2227
|
let result;
|
|
@@ -2230,7 +2230,7 @@ function processSetupState(instance) {
|
|
|
2230
2230
|
const info = getSetupStateType(rawData);
|
|
2231
2231
|
const { stateType, stateTypeName } = getStateTypeAndName(info);
|
|
2232
2232
|
const isState = info.ref || info.computed || info.reactive;
|
|
2233
|
-
const raw2 = ((
|
|
2233
|
+
const raw2 = ((_b9 = (_a9 = rawData.effect) == null ? void 0 : _a9.raw) == null ? void 0 : _b9.toString()) || ((_d = (_c = rawData.effect) == null ? void 0 : _c.fn) == null ? void 0 : _d.toString());
|
|
2234
2234
|
if (stateType)
|
|
2235
2235
|
isOtherType = false;
|
|
2236
2236
|
result = {
|
|
@@ -2260,8 +2260,8 @@ function processComputed(instance, mergedType) {
|
|
|
2260
2260
|
type: type2,
|
|
2261
2261
|
key,
|
|
2262
2262
|
value: returnError(() => {
|
|
2263
|
-
var
|
|
2264
|
-
return (
|
|
2263
|
+
var _a9;
|
|
2264
|
+
return (_a9 = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a9[key];
|
|
2265
2265
|
}),
|
|
2266
2266
|
editable: typeof def.set === "function"
|
|
2267
2267
|
});
|
|
@@ -2323,10 +2323,10 @@ function processRefs(instance) {
|
|
|
2323
2323
|
}));
|
|
2324
2324
|
}
|
|
2325
2325
|
function processEventListeners(instance) {
|
|
2326
|
-
var
|
|
2326
|
+
var _a9;
|
|
2327
2327
|
const emitsDefinition = instance.type.emits;
|
|
2328
2328
|
const declaredEmits = Array.isArray(emitsDefinition) ? emitsDefinition : Object.keys(emitsDefinition != null ? emitsDefinition : {});
|
|
2329
|
-
const keys = Object.keys((
|
|
2329
|
+
const keys = Object.keys((_a9 = instance.vnode.props) != null ? _a9 : {});
|
|
2330
2330
|
const result = [];
|
|
2331
2331
|
for (const key of keys) {
|
|
2332
2332
|
const [prefix, ...eventNameParts] = key.split(/(?=[A-Z])/);
|
|
@@ -2547,13 +2547,13 @@ function getHTMLElementDetails(value) {
|
|
|
2547
2547
|
}
|
|
2548
2548
|
}
|
|
2549
2549
|
function getObjectDetails(object) {
|
|
2550
|
-
var
|
|
2550
|
+
var _a9, _b9, _c, _d;
|
|
2551
2551
|
const info = getSetupStateType(object);
|
|
2552
2552
|
const isState = info.ref || info.computed || info.reactive;
|
|
2553
2553
|
if (isState) {
|
|
2554
2554
|
const stateTypeName = info.computed ? "Computed" : info.ref ? "Ref" : info.reactive ? "Reactive" : null;
|
|
2555
2555
|
const value = toRaw(info.reactive ? object : object._value);
|
|
2556
|
-
const raw = ((
|
|
2556
|
+
const raw = ((_b9 = (_a9 = object.effect) == null ? void 0 : _a9.raw) == null ? void 0 : _b9.toString()) || ((_d = (_c = object.effect) == null ? void 0 : _c.fn) == null ? void 0 : _d.toString());
|
|
2557
2557
|
return {
|
|
2558
2558
|
_custom: {
|
|
2559
2559
|
type: stateTypeName == null ? void 0 : stateTypeName.toLowerCase(),
|
|
@@ -2575,7 +2575,7 @@ function getObjectDetails(object) {
|
|
|
2575
2575
|
|
|
2576
2576
|
// src/core/component/state/replacer.ts
|
|
2577
2577
|
function stringifyReplacer(key) {
|
|
2578
|
-
var
|
|
2578
|
+
var _a9;
|
|
2579
2579
|
if (key === "compilerOptions")
|
|
2580
2580
|
return;
|
|
2581
2581
|
const val = this[key];
|
|
@@ -2631,7 +2631,7 @@ function stringifyReplacer(key) {
|
|
|
2631
2631
|
return `[native VNode <${val.tag}>]`;
|
|
2632
2632
|
} else if (typeof HTMLElement !== "undefined" && val instanceof HTMLElement) {
|
|
2633
2633
|
return getHTMLElementDetails(val);
|
|
2634
|
-
} else if (((
|
|
2634
|
+
} else if (((_a9 = val.constructor) == null ? void 0 : _a9.name) === "Store" && val._wrappedGetters) {
|
|
2635
2635
|
return "[object Store]";
|
|
2636
2636
|
} else if (val.currentRoute) {
|
|
2637
2637
|
return "[object Router]";
|
|
@@ -2667,7 +2667,7 @@ function reviveMap(val) {
|
|
|
2667
2667
|
return result;
|
|
2668
2668
|
}
|
|
2669
2669
|
function revive(val) {
|
|
2670
|
-
var
|
|
2670
|
+
var _a9;
|
|
2671
2671
|
if (val === UNDEFINED) {
|
|
2672
2672
|
return void 0;
|
|
2673
2673
|
} else if (val === INFINITY) {
|
|
@@ -2679,7 +2679,7 @@ function revive(val) {
|
|
|
2679
2679
|
} else if (val && val._custom) {
|
|
2680
2680
|
const { _custom: custom } = val;
|
|
2681
2681
|
if (custom.type === "component")
|
|
2682
|
-
return (
|
|
2682
|
+
return (_a9 = devtoolsContext.appRecord) == null ? void 0 : _a9.instanceMap.get(custom.id);
|
|
2683
2683
|
else if (custom.type === "map")
|
|
2684
2684
|
return reviveMap(val);
|
|
2685
2685
|
else if (custom.type === "set")
|
|
@@ -2841,7 +2841,7 @@ function getInspectorStateValueType(value, raw = true) {
|
|
|
2841
2841
|
}
|
|
2842
2842
|
}
|
|
2843
2843
|
function formatInspectorStateValue(value, quotes = false) {
|
|
2844
|
-
var
|
|
2844
|
+
var _a9, _b9;
|
|
2845
2845
|
let result;
|
|
2846
2846
|
const type = getInspectorStateValueType(value, false);
|
|
2847
2847
|
if (type !== "custom" && (value == null ? void 0 : value._custom))
|
|
@@ -2849,14 +2849,14 @@ function formatInspectorStateValue(value, quotes = false) {
|
|
|
2849
2849
|
if (result = internalStateTokenToString(value)) {
|
|
2850
2850
|
return result;
|
|
2851
2851
|
} else if (type === "custom") {
|
|
2852
|
-
const nestedName = ((
|
|
2852
|
+
const nestedName = ((_a9 = value._custom.value) == null ? void 0 : _a9._custom) && formatInspectorStateValue(value._custom.value);
|
|
2853
2853
|
return nestedName || value._custom.displayText || value._custom.display;
|
|
2854
2854
|
} else if (type === "array") {
|
|
2855
2855
|
return `Array[${value.length}]`;
|
|
2856
2856
|
} else if (type === "plain-object") {
|
|
2857
2857
|
return `Object${Object.keys(value).length ? "" : " (empty)"}`;
|
|
2858
2858
|
} else if (type == null ? void 0 : type.includes("native")) {
|
|
2859
|
-
return escape((
|
|
2859
|
+
return escape((_b9 = specialTypeRE.exec(value)) == null ? void 0 : _b9[2]);
|
|
2860
2860
|
} else if (typeof value === "string") {
|
|
2861
2861
|
const typeMatch = value.match(rawTypeRE);
|
|
2862
2862
|
if (typeMatch)
|
|
@@ -2870,14 +2870,14 @@ function formatInspectorStateValue(value, quotes = false) {
|
|
|
2870
2870
|
return value;
|
|
2871
2871
|
}
|
|
2872
2872
|
function getRawValue(value) {
|
|
2873
|
-
var
|
|
2873
|
+
var _a9, _b9;
|
|
2874
2874
|
const isCustom = getInspectorStateValueType(value) === "custom";
|
|
2875
2875
|
let inherit = {};
|
|
2876
2876
|
if (isCustom) {
|
|
2877
2877
|
const data = value;
|
|
2878
|
-
const customValue = (
|
|
2878
|
+
const customValue = (_a9 = data._custom) == null ? void 0 : _a9.value;
|
|
2879
2879
|
const nestedCustom = typeof customValue === "object" && customValue !== null && "_custom" in customValue ? getRawValue(customValue) : { inherit: void 0, value: void 0 };
|
|
2880
|
-
inherit = nestedCustom.inherit || ((
|
|
2880
|
+
inherit = nestedCustom.inherit || ((_b9 = data._custom) == null ? void 0 : _b9.fields) || {};
|
|
2881
2881
|
value = nestedCustom.value || customValue;
|
|
2882
2882
|
}
|
|
2883
2883
|
if (value && value._isArray)
|
|
@@ -2896,7 +2896,7 @@ function stringify(data) {
|
|
|
2896
2896
|
return stringifyCircularAutoChunks(data, stringifyReplacer);
|
|
2897
2897
|
}
|
|
2898
2898
|
function parse(data, revive2 = false) {
|
|
2899
|
-
if (
|
|
2899
|
+
if (data == void 0)
|
|
2900
2900
|
return {};
|
|
2901
2901
|
return revive2 ? parseCircularAutoChunks(data, reviver) : parseCircularAutoChunks(data);
|
|
2902
2902
|
}
|
|
@@ -3103,8 +3103,8 @@ async function registerPlugin(options) {
|
|
|
3103
3103
|
setupFn(api);
|
|
3104
3104
|
});
|
|
3105
3105
|
devtoolsState.appRecords = devtoolsState.appRecords.map((record) => {
|
|
3106
|
-
var
|
|
3107
|
-
const globalProperties = (
|
|
3106
|
+
var _a9, _b9;
|
|
3107
|
+
const globalProperties = (_b9 = (_a9 = record.app) == null ? void 0 : _a9.config) == null ? void 0 : _b9.globalProperties;
|
|
3108
3108
|
if (!globalProperties)
|
|
3109
3109
|
return record;
|
|
3110
3110
|
return {
|
|
@@ -3212,7 +3212,7 @@ var ComponentWalker = class {
|
|
|
3212
3212
|
* @return {object}
|
|
3213
3213
|
*/
|
|
3214
3214
|
async capture(instance, depth) {
|
|
3215
|
-
var
|
|
3215
|
+
var _a9;
|
|
3216
3216
|
if (!instance)
|
|
3217
3217
|
return null;
|
|
3218
3218
|
const id = this.captureId(instance);
|
|
@@ -3267,7 +3267,7 @@ var ComponentWalker = class {
|
|
|
3267
3267
|
} else {
|
|
3268
3268
|
treeNode.domOrder = [-1];
|
|
3269
3269
|
}
|
|
3270
|
-
if ((
|
|
3270
|
+
if ((_a9 = instance.suspense) == null ? void 0 : _a9.suspenseKey) {
|
|
3271
3271
|
treeNode.tags.push({
|
|
3272
3272
|
label: instance.suspense.suspenseKey,
|
|
3273
3273
|
backgroundColor: 14979812,
|
|
@@ -3292,8 +3292,8 @@ var ComponentWalker = class {
|
|
|
3292
3292
|
* @return {Vue|Array}
|
|
3293
3293
|
*/
|
|
3294
3294
|
async findQualifiedChildren(instance, depth) {
|
|
3295
|
-
var
|
|
3296
|
-
if (this.componentFilter.isQualified(instance) && !((
|
|
3295
|
+
var _a9;
|
|
3296
|
+
if (this.componentFilter.isQualified(instance) && !((_a9 = instance.type.devtools) == null ? void 0 : _a9.hide)) {
|
|
3297
3297
|
return [await this.capture(instance, depth)];
|
|
3298
3298
|
} else if (instance.subTree) {
|
|
3299
3299
|
const list = this.isKeepAlive(instance) ? this.getKeepAliveCachedInstances(instance) : this.getInternalInstanceChildren(instance.subTree);
|
|
@@ -3313,8 +3313,8 @@ var ComponentWalker = class {
|
|
|
3313
3313
|
*/
|
|
3314
3314
|
async findQualifiedChildrenFromList(instances, depth) {
|
|
3315
3315
|
instances = instances.filter((child) => {
|
|
3316
|
-
var
|
|
3317
|
-
return !isBeingDestroyed(child) && !((
|
|
3316
|
+
var _a9;
|
|
3317
|
+
return !isBeingDestroyed(child) && !((_a9 = child.type.devtools) == null ? void 0 : _a9.hide);
|
|
3318
3318
|
});
|
|
3319
3319
|
if (!this.componentFilter.filter)
|
|
3320
3320
|
return Promise.all(instances.map((child) => this.capture(child, depth)));
|
|
@@ -3342,8 +3342,8 @@ var ComponentWalker = class {
|
|
|
3342
3342
|
}
|
|
3343
3343
|
}
|
|
3344
3344
|
return list.filter((child) => {
|
|
3345
|
-
var
|
|
3346
|
-
return !isBeingDestroyed(child) && !((
|
|
3345
|
+
var _a9;
|
|
3346
|
+
return !isBeingDestroyed(child) && !((_a9 = child.type.devtools) == null ? void 0 : _a9.hide);
|
|
3347
3347
|
});
|
|
3348
3348
|
}
|
|
3349
3349
|
/**
|
|
@@ -3367,11 +3367,11 @@ var ComponentWalker = class {
|
|
|
3367
3367
|
// src/core/component/state/index.ts
|
|
3368
3368
|
init_esm_shims();
|
|
3369
3369
|
function getInstanceState(params) {
|
|
3370
|
-
var
|
|
3370
|
+
var _a9;
|
|
3371
3371
|
const instance = getComponentInstance(devtoolsContext.appRecord, params.instanceId);
|
|
3372
3372
|
const id = getUniqueComponentId(instance);
|
|
3373
3373
|
const name = getInstanceName(instance);
|
|
3374
|
-
const file = (
|
|
3374
|
+
const file = (_a9 = instance == null ? void 0 : instance.type) == null ? void 0 : _a9.__file;
|
|
3375
3375
|
const state = processInstanceState(instance);
|
|
3376
3376
|
return {
|
|
3377
3377
|
id,
|
|
@@ -3561,13 +3561,13 @@ function registerComponentsDevTools(app) {
|
|
|
3561
3561
|
}
|
|
3562
3562
|
});
|
|
3563
3563
|
api.on.getInspectorState(async (payload) => {
|
|
3564
|
-
var
|
|
3564
|
+
var _a9;
|
|
3565
3565
|
if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {
|
|
3566
3566
|
const result = getInstanceState({
|
|
3567
3567
|
instanceId: payload.nodeId
|
|
3568
3568
|
});
|
|
3569
3569
|
const componentInstance = result.instance;
|
|
3570
|
-
const app2 = (
|
|
3570
|
+
const app2 = (_a9 = result.instance) == null ? void 0 : _a9.appContext.app;
|
|
3571
3571
|
const _payload = {
|
|
3572
3572
|
componentInstance,
|
|
3573
3573
|
app: app2,
|
|
@@ -3592,8 +3592,8 @@ function registerComponentsDevTools(app) {
|
|
|
3592
3592
|
api.sendInspectorState(INSPECTOR_ID);
|
|
3593
3593
|
}, 120);
|
|
3594
3594
|
const componentAddedCleanup = hook.on.componentAdded(async (app2, uid, parentUid, component) => {
|
|
3595
|
-
var
|
|
3596
|
-
if ((_c = (
|
|
3595
|
+
var _a9, _b9, _c;
|
|
3596
|
+
if ((_c = (_b9 = (_a9 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a9.type) == null ? void 0 : _b9.devtools) == null ? void 0 : _c.hide)
|
|
3597
3597
|
return;
|
|
3598
3598
|
if (!app2 || typeof uid !== "number" && !uid || !component)
|
|
3599
3599
|
return;
|
|
@@ -3614,8 +3614,8 @@ function registerComponentsDevTools(app) {
|
|
|
3614
3614
|
debounceSendInspectorTree();
|
|
3615
3615
|
});
|
|
3616
3616
|
const componentUpdatedCleanup = hook.on.componentUpdated(async (app2, uid, parentUid, component) => {
|
|
3617
|
-
var
|
|
3618
|
-
if ((_c = (
|
|
3617
|
+
var _a9, _b9, _c;
|
|
3618
|
+
if ((_c = (_b9 = (_a9 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a9.type) == null ? void 0 : _b9.devtools) == null ? void 0 : _c.hide)
|
|
3619
3619
|
return;
|
|
3620
3620
|
if (!app2 || typeof uid !== "number" && !uid || !component)
|
|
3621
3621
|
return;
|
|
@@ -3637,8 +3637,8 @@ function registerComponentsDevTools(app) {
|
|
|
3637
3637
|
debounceSendInspectorState();
|
|
3638
3638
|
});
|
|
3639
3639
|
const componentRemovedCleanup = hook.on.componentRemoved(async (app2, uid, parentUid, component) => {
|
|
3640
|
-
var
|
|
3641
|
-
if ((_c = (
|
|
3640
|
+
var _a9, _b9, _c;
|
|
3641
|
+
if ((_c = (_b9 = (_a9 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a9.type) == null ? void 0 : _b9.devtools) == null ? void 0 : _c.hide)
|
|
3642
3642
|
return;
|
|
3643
3643
|
if (!app2 || typeof uid !== "number" && !uid || !component)
|
|
3644
3644
|
return;
|
|
@@ -3713,6 +3713,11 @@ function removeCustomCommand(actionId) {
|
|
|
3713
3713
|
// src/core/vue-inspector/index.ts
|
|
3714
3714
|
init_esm_shims();
|
|
3715
3715
|
import { target as target5 } from "@vue/devtools-shared";
|
|
3716
|
+
var _a7, _b7;
|
|
3717
|
+
(_b7 = (_a7 = target5).__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__) != null ? _b7 : _a7.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = true;
|
|
3718
|
+
function toggleComponentInspectorEnabled(enabled) {
|
|
3719
|
+
target5.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__ = enabled;
|
|
3720
|
+
}
|
|
3716
3721
|
function waitForInspectorInit(cb) {
|
|
3717
3722
|
let total = 0;
|
|
3718
3723
|
const timer = setInterval(() => {
|
|
@@ -3736,6 +3741,8 @@ function setupInspector() {
|
|
|
3736
3741
|
}
|
|
3737
3742
|
function getVueInspector() {
|
|
3738
3743
|
return new Promise((resolve) => {
|
|
3744
|
+
if (!target5.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__)
|
|
3745
|
+
resolve(null);
|
|
3739
3746
|
function setup() {
|
|
3740
3747
|
setupInspector();
|
|
3741
3748
|
resolve(target5.__VUE_INSPECTOR__);
|
|
@@ -3787,7 +3794,7 @@ var indicatorStyles = {
|
|
|
3787
3794
|
fontSize: "12px",
|
|
3788
3795
|
opacity: 0.7
|
|
3789
3796
|
};
|
|
3790
|
-
function
|
|
3797
|
+
function getContainerElement() {
|
|
3791
3798
|
return document.getElementById(CONTAINER_ELEMENT_ID);
|
|
3792
3799
|
}
|
|
3793
3800
|
function getCardElement() {
|
|
@@ -3808,9 +3815,9 @@ function getStyles(bounds) {
|
|
|
3808
3815
|
};
|
|
3809
3816
|
}
|
|
3810
3817
|
function create(options) {
|
|
3811
|
-
var
|
|
3818
|
+
var _a9;
|
|
3812
3819
|
const containerEl = document.createElement("div");
|
|
3813
|
-
containerEl.id = (
|
|
3820
|
+
containerEl.id = (_a9 = options.elementId) != null ? _a9 : CONTAINER_ELEMENT_ID;
|
|
3814
3821
|
Object.assign(containerEl.style, {
|
|
3815
3822
|
...containerStyles,
|
|
3816
3823
|
...getStyles(options.bounds),
|
|
@@ -3836,7 +3843,7 @@ function create(options) {
|
|
|
3836
3843
|
return containerEl;
|
|
3837
3844
|
}
|
|
3838
3845
|
function update(options) {
|
|
3839
|
-
const containerEl =
|
|
3846
|
+
const containerEl = getContainerElement();
|
|
3840
3847
|
const cardEl = getCardElement();
|
|
3841
3848
|
const nameEl = getNameElement();
|
|
3842
3849
|
const indicatorEl = getIndicatorElement();
|
|
@@ -3857,11 +3864,11 @@ function toggleComponentInspector(options) {
|
|
|
3857
3864
|
const instance = getComponentInstance(devtoolsContext.appRecord, options.id);
|
|
3858
3865
|
if (instance && (options.bounds.width || options.bounds.height)) {
|
|
3859
3866
|
const name = getInstanceName(instance);
|
|
3860
|
-
const el =
|
|
3867
|
+
const el = getContainerElement();
|
|
3861
3868
|
el ? update({ ...options, name }) : create({ ...options, name });
|
|
3862
3869
|
}
|
|
3863
3870
|
} else {
|
|
3864
|
-
const el =
|
|
3871
|
+
const el = getContainerElement();
|
|
3865
3872
|
if (el)
|
|
3866
3873
|
el.style.display = "none";
|
|
3867
3874
|
}
|
|
@@ -3869,11 +3876,11 @@ function toggleComponentInspector(options) {
|
|
|
3869
3876
|
function highlight(instance) {
|
|
3870
3877
|
const bounds = getComponentBoundingRect(instance);
|
|
3871
3878
|
const name = getInstanceName(instance);
|
|
3872
|
-
const container =
|
|
3879
|
+
const container = getContainerElement();
|
|
3873
3880
|
container ? update({ bounds, name }) : create({ bounds, name });
|
|
3874
3881
|
}
|
|
3875
3882
|
function unhighlight() {
|
|
3876
|
-
const el =
|
|
3883
|
+
const el = getContainerElement();
|
|
3877
3884
|
if (el)
|
|
3878
3885
|
el.style.display = "none";
|
|
3879
3886
|
}
|
|
@@ -3888,18 +3895,18 @@ function inspectFn(e) {
|
|
|
3888
3895
|
if (el) {
|
|
3889
3896
|
const bounds = getComponentBoundingRect(instance);
|
|
3890
3897
|
const name = getInstanceName(instance);
|
|
3891
|
-
const container =
|
|
3898
|
+
const container = getContainerElement();
|
|
3892
3899
|
container ? update({ bounds, name }) : create({ bounds, name });
|
|
3893
3900
|
}
|
|
3894
3901
|
}
|
|
3895
3902
|
}
|
|
3896
3903
|
}
|
|
3897
3904
|
function selectComponentFn(e, cb) {
|
|
3898
|
-
var
|
|
3905
|
+
var _a9;
|
|
3899
3906
|
e.preventDefault();
|
|
3900
3907
|
e.stopPropagation();
|
|
3901
3908
|
if (inspectInstance) {
|
|
3902
|
-
const app = (
|
|
3909
|
+
const app = (_a9 = devtoolsContext.appRecord) == null ? void 0 : _a9.app;
|
|
3903
3910
|
getComponentId({
|
|
3904
3911
|
app,
|
|
3905
3912
|
uid: app.uid,
|
|
@@ -3918,7 +3925,7 @@ function inspectComponentInspector() {
|
|
|
3918
3925
|
selectComponentFn(e, (id) => {
|
|
3919
3926
|
window.removeEventListener("click", onSelect);
|
|
3920
3927
|
window.removeEventListener("mouseover", inspectFn);
|
|
3921
|
-
const el =
|
|
3928
|
+
const el = getContainerElement();
|
|
3922
3929
|
if (el)
|
|
3923
3930
|
el.style.display = "none";
|
|
3924
3931
|
resolve(JSON.stringify({ id }));
|
|
@@ -3955,7 +3962,7 @@ function scrollToComponent(options) {
|
|
|
3955
3962
|
const bounds = getComponentBoundingRect(instance);
|
|
3956
3963
|
if (bounds.width || bounds.height) {
|
|
3957
3964
|
const name = getInstanceName(instance);
|
|
3958
|
-
const el2 =
|
|
3965
|
+
const el2 = getContainerElement();
|
|
3959
3966
|
el2 ? update({ ...options, name, bounds }) : create({ ...options, name, bounds });
|
|
3960
3967
|
setTimeout(() => {
|
|
3961
3968
|
if (el2)
|
|
@@ -4090,12 +4097,12 @@ var DevToolsPluginApi = class {
|
|
|
4090
4097
|
removeCustomCommand(actionId);
|
|
4091
4098
|
}
|
|
4092
4099
|
addInspector(payload) {
|
|
4093
|
-
var
|
|
4100
|
+
var _a9;
|
|
4094
4101
|
addInspector({
|
|
4095
4102
|
id: payload.id,
|
|
4096
4103
|
nodeId: "",
|
|
4097
4104
|
filter: "",
|
|
4098
|
-
treeFilterPlaceholder: (
|
|
4105
|
+
treeFilterPlaceholder: (_a9 = payload.treeFilterPlaceholder) != null ? _a9 : ""
|
|
4099
4106
|
});
|
|
4100
4107
|
}
|
|
4101
4108
|
openInEditor(payload) {
|
|
@@ -4139,20 +4146,20 @@ var DevToolsPluginApi = class {
|
|
|
4139
4146
|
init_esm_shims();
|
|
4140
4147
|
var import_speakingurl = __toESM(require_speakingurl2(), 1);
|
|
4141
4148
|
import { target as target6 } from "@vue/devtools-shared";
|
|
4142
|
-
var
|
|
4143
|
-
var appRecordInfo = (
|
|
4149
|
+
var _a8, _b8;
|
|
4150
|
+
var appRecordInfo = (_b8 = (_a8 = target6).__VUE_DEVTOOLS_APP_RECROD_INFO__) != null ? _b8 : _a8.__VUE_DEVTOOLS_APP_RECROD_INFO__ = {
|
|
4144
4151
|
id: 0,
|
|
4145
4152
|
appIds: /* @__PURE__ */ new Set()
|
|
4146
4153
|
};
|
|
4147
4154
|
function getAppRecordName(app, fallbackName) {
|
|
4148
|
-
var
|
|
4149
|
-
return ((
|
|
4155
|
+
var _a9;
|
|
4156
|
+
return ((_a9 = app == null ? void 0 : app._component) == null ? void 0 : _a9.name) || `App ${fallbackName}`;
|
|
4150
4157
|
}
|
|
4151
4158
|
function getAppRootInstance(app) {
|
|
4152
|
-
var
|
|
4159
|
+
var _a9, _b9, _c, _d;
|
|
4153
4160
|
if (app._instance)
|
|
4154
4161
|
return app._instance;
|
|
4155
|
-
else if ((
|
|
4162
|
+
else if ((_b9 = (_a9 = app._container) == null ? void 0 : _a9._vnode) == null ? void 0 : _b9.component)
|
|
4156
4163
|
return (_d = (_c = app._container) == null ? void 0 : _c._vnode) == null ? void 0 : _d.component;
|
|
4157
4164
|
}
|
|
4158
4165
|
function getAppRecordId(app, defaultId) {
|
|
@@ -4193,23 +4200,23 @@ function createAppRecord(app) {
|
|
|
4193
4200
|
|
|
4194
4201
|
// src/core/general/index.ts
|
|
4195
4202
|
function initDevTools() {
|
|
4196
|
-
var
|
|
4203
|
+
var _a9, _b9, _c;
|
|
4197
4204
|
devtoolsState.vitePluginDetected = !!target7.__VUE_DEVTOOLS_VITE_PLUGIN_DETECTED__;
|
|
4198
|
-
const isNewDevTools = ((
|
|
4205
|
+
const isNewDevTools = ((_a9 = target7.__VUE_DEVTOOLS_GLOBAL_HOOK__) == null ? void 0 : _a9.id) === "vue-devtools-next";
|
|
4199
4206
|
if (target7.__VUE_DEVTOOLS_GLOBAL_HOOK__ && isNewDevTools)
|
|
4200
4207
|
return;
|
|
4201
4208
|
if (target7.__VUE_DEVTOOLS_GLOBAL_HOOK__)
|
|
4202
4209
|
Object.assign(__VUE_DEVTOOLS_GLOBAL_HOOK__, createDevToolsHook());
|
|
4203
4210
|
else
|
|
4204
4211
|
target7.__VUE_DEVTOOLS_GLOBAL_HOOK__ = createDevToolsHook();
|
|
4205
|
-
(_c = (
|
|
4212
|
+
(_c = (_b9 = target7).__VUE_DEVTOOLS_APP_RECORDS__) != null ? _c : _b9.__VUE_DEVTOOLS_APP_RECORDS__ = [];
|
|
4206
4213
|
hook.on.setupDevtoolsPlugin(collectRegisteredPlugin);
|
|
4207
4214
|
hook.on.vueAppInit(async (app, version) => {
|
|
4208
|
-
var
|
|
4215
|
+
var _a10;
|
|
4209
4216
|
const record = createAppRecord(app);
|
|
4210
4217
|
const api = new DevToolsPluginApi();
|
|
4211
4218
|
devtoolsState.appRecords = [
|
|
4212
|
-
...(
|
|
4219
|
+
...(_a10 = devtoolsState.appRecords) != null ? _a10 : [],
|
|
4213
4220
|
{
|
|
4214
4221
|
...record,
|
|
4215
4222
|
app,
|
|
@@ -4293,5 +4300,6 @@ export {
|
|
|
4293
4300
|
symbolRE,
|
|
4294
4301
|
toEdit,
|
|
4295
4302
|
toSubmit,
|
|
4303
|
+
toggleComponentInspectorEnabled,
|
|
4296
4304
|
vueBuiltins
|
|
4297
4305
|
};
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/devtools-kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.
|
|
4
|
+
"version": "7.0.14",
|
|
5
5
|
"author": "webfansplz",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
-
"import": "./dist/index.
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
10
|
"require": "./dist/index.cjs"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"main": "./dist/index.cjs",
|
|
14
|
-
"module": "./dist/index.
|
|
15
|
-
"types": "./dist/index.d.ts",
|
|
14
|
+
"module": "./dist/index.js",
|
|
16
15
|
"files": [
|
|
17
16
|
"dist"
|
|
18
17
|
],
|
|
@@ -21,8 +20,8 @@
|
|
|
21
20
|
"mitt": "^3.0.1",
|
|
22
21
|
"perfect-debounce": "^1.0.0",
|
|
23
22
|
"speakingurl": "^14.0.1",
|
|
24
|
-
"@vue/devtools-schema": "^7.0.
|
|
25
|
-
"@vue/devtools-shared": "^7.0.
|
|
23
|
+
"@vue/devtools-schema": "^7.0.14",
|
|
24
|
+
"@vue/devtools-shared": "^7.0.14"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
27
|
"vue": "^3.4.15",
|