@vue/devtools-kit 7.0.16 → 7.0.18
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 +48 -15
- package/dist/index.d.cts +323 -316
- package/dist/index.d.ts +323 -316
- package/dist/index.js +46 -14
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -27,9 +27,9 @@ var __toESM = (mod, isNodeMode, target9) => (target9 = mod != null ? __create(__
|
|
|
27
27
|
mod
|
|
28
28
|
));
|
|
29
29
|
|
|
30
|
-
// ../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.35_typescript@5.
|
|
30
|
+
// ../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.35_typescript@5.4.2/node_modules/tsup/assets/esm_shims.js
|
|
31
31
|
var init_esm_shims = __esm({
|
|
32
|
-
"../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.35_typescript@5.
|
|
32
|
+
"../../node_modules/.pnpm/tsup@8.0.2_postcss@8.4.35_typescript@5.4.2/node_modules/tsup/assets/esm_shims.js"() {
|
|
33
33
|
"use strict";
|
|
34
34
|
}
|
|
35
35
|
});
|
|
@@ -2298,6 +2298,8 @@ var StateEditor = class {
|
|
|
2298
2298
|
const section = sections.shift();
|
|
2299
2299
|
if (object instanceof Map)
|
|
2300
2300
|
object = object.get(section);
|
|
2301
|
+
if (object instanceof Set)
|
|
2302
|
+
object = Array.from(object.values())[section];
|
|
2301
2303
|
else
|
|
2302
2304
|
object = object[section];
|
|
2303
2305
|
if (this.refEditor.isRef(object))
|
|
@@ -2351,7 +2353,7 @@ var StateEditor = class {
|
|
|
2351
2353
|
else if (toRaw(object) instanceof Map)
|
|
2352
2354
|
object.delete(field);
|
|
2353
2355
|
else if (toRaw(object) instanceof Set)
|
|
2354
|
-
object.delete(
|
|
2356
|
+
object.delete(Array.from(object.values())[field]);
|
|
2355
2357
|
else
|
|
2356
2358
|
Reflect.deleteProperty(object, field);
|
|
2357
2359
|
}
|
|
@@ -2361,6 +2363,8 @@ var StateEditor = class {
|
|
|
2361
2363
|
this.refEditor.set(target9, value);
|
|
2362
2364
|
else if (toRaw(object) instanceof Map)
|
|
2363
2365
|
object.set(state.newKey || field, value);
|
|
2366
|
+
else if (toRaw(object) instanceof Set)
|
|
2367
|
+
object.add(value);
|
|
2364
2368
|
else
|
|
2365
2369
|
object[state.newKey || field] = value;
|
|
2366
2370
|
}
|
|
@@ -2912,6 +2916,8 @@ function registerComponentDevToolsPlugin(app) {
|
|
|
2912
2916
|
}, 120);
|
|
2913
2917
|
const componentAddedCleanup = hook.on.componentAdded(async (app2, uid, parentUid, component) => {
|
|
2914
2918
|
var _a10, _b10, _c;
|
|
2919
|
+
if (devtoolsState.highPerfModeEnabled)
|
|
2920
|
+
return;
|
|
2915
2921
|
if ((_c = (_b10 = (_a10 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a10.type) == null ? void 0 : _b10.devtools) == null ? void 0 : _c.hide)
|
|
2916
2922
|
return;
|
|
2917
2923
|
if (!app2 || typeof uid !== "number" && !uid || !component)
|
|
@@ -2934,6 +2940,8 @@ function registerComponentDevToolsPlugin(app) {
|
|
|
2934
2940
|
});
|
|
2935
2941
|
const componentUpdatedCleanup = hook.on.componentUpdated(async (app2, uid, parentUid, component) => {
|
|
2936
2942
|
var _a10, _b10, _c;
|
|
2943
|
+
if (devtoolsState.highPerfModeEnabled)
|
|
2944
|
+
return;
|
|
2937
2945
|
if ((_c = (_b10 = (_a10 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a10.type) == null ? void 0 : _b10.devtools) == null ? void 0 : _c.hide)
|
|
2938
2946
|
return;
|
|
2939
2947
|
if (!app2 || typeof uid !== "number" && !uid || !component)
|
|
@@ -2957,6 +2965,8 @@ function registerComponentDevToolsPlugin(app) {
|
|
|
2957
2965
|
});
|
|
2958
2966
|
const componentRemovedCleanup = hook.on.componentRemoved(async (app2, uid, parentUid, component) => {
|
|
2959
2967
|
var _a10, _b10, _c;
|
|
2968
|
+
if (devtoolsState.highPerfModeEnabled)
|
|
2969
|
+
return;
|
|
2960
2970
|
if ((_c = (_b10 = (_a10 = app2 == null ? void 0 : app2._instance) == null ? void 0 : _a10.type) == null ? void 0 : _b10.devtools) == null ? void 0 : _c.hide)
|
|
2961
2971
|
return;
|
|
2962
2972
|
if (!app2 || typeof uid !== "number" && !uid || !component)
|
|
@@ -3302,6 +3312,17 @@ function getBigIntDetails(val) {
|
|
|
3302
3312
|
}
|
|
3303
3313
|
};
|
|
3304
3314
|
}
|
|
3315
|
+
function getDateDetails(val) {
|
|
3316
|
+
const date = new Date(val.getTime());
|
|
3317
|
+
date.setMinutes(date.getMinutes() - date.getTimezoneOffset());
|
|
3318
|
+
return {
|
|
3319
|
+
_custom: {
|
|
3320
|
+
type: "date",
|
|
3321
|
+
displayText: Date.prototype.toString.call(val),
|
|
3322
|
+
value: date.toISOString().slice(0, -1)
|
|
3323
|
+
}
|
|
3324
|
+
};
|
|
3325
|
+
}
|
|
3305
3326
|
function getMapDetails(val) {
|
|
3306
3327
|
const list = Object.fromEntries(val);
|
|
3307
3328
|
return {
|
|
@@ -3519,7 +3540,7 @@ function stringifyReplacer(key) {
|
|
|
3519
3540
|
} else if (proto === "[object RegExp]") {
|
|
3520
3541
|
return `[native RegExp ${RegExp.prototype.toString.call(val)}]`;
|
|
3521
3542
|
} else if (proto === "[object Date]") {
|
|
3522
|
-
return
|
|
3543
|
+
return getDateDetails(val);
|
|
3523
3544
|
} else if (proto === "[object Error]") {
|
|
3524
3545
|
return `[native Error ${val.message}<>${val.stack}]`;
|
|
3525
3546
|
} else if (val.state && val._vm) {
|
|
@@ -3793,11 +3814,15 @@ function getRaw(value) {
|
|
|
3793
3814
|
function toEdit(value, customType) {
|
|
3794
3815
|
if (customType === "bigint")
|
|
3795
3816
|
return value;
|
|
3817
|
+
if (customType === "date")
|
|
3818
|
+
return value;
|
|
3796
3819
|
return replaceTokenToString(JSON.stringify(value));
|
|
3797
3820
|
}
|
|
3798
3821
|
function toSubmit(value, customType) {
|
|
3799
3822
|
if (customType === "bigint")
|
|
3800
3823
|
return BigInt(value);
|
|
3824
|
+
if (customType === "date")
|
|
3825
|
+
return new Date(value);
|
|
3801
3826
|
return JSON.parse(replaceStringToToken(value), reviver);
|
|
3802
3827
|
}
|
|
3803
3828
|
|
|
@@ -3891,9 +3916,8 @@ function getComponentInspector() {
|
|
|
3891
3916
|
init_esm_shims();
|
|
3892
3917
|
import { target as target5 } from "@vue/devtools-shared";
|
|
3893
3918
|
function openInEditor(options = {}) {
|
|
3894
|
-
const { file, line = 0, column = 0 } = options;
|
|
3919
|
+
const { file, baseUrl = window.location.origin, line = 0, column = 0 } = options;
|
|
3895
3920
|
if (file) {
|
|
3896
|
-
const baseUrl = window.location.origin;
|
|
3897
3921
|
if (devtoolsState.vitePluginDetected) {
|
|
3898
3922
|
target5.__VUE_INSPECTOR__.openInEditor(baseUrl, file, line, column);
|
|
3899
3923
|
} else {
|
|
@@ -4012,7 +4036,7 @@ var DevToolsPluginApi = class {
|
|
|
4012
4036
|
resolve();
|
|
4013
4037
|
}, "inspector-tree:get" /* GET_INSPECTOR_TREE */);
|
|
4014
4038
|
});
|
|
4015
|
-
return
|
|
4039
|
+
return _payload.rootNodes;
|
|
4016
4040
|
}
|
|
4017
4041
|
getInspectorState(payload = {}) {
|
|
4018
4042
|
var _a10;
|
|
@@ -4030,7 +4054,7 @@ var DevToolsPluginApi = class {
|
|
|
4030
4054
|
}, "inspector-state:get" /* GET_INSPECTOR_STATE */);
|
|
4031
4055
|
const state = _payload.state;
|
|
4032
4056
|
delete state.instance;
|
|
4033
|
-
return
|
|
4057
|
+
return state;
|
|
4034
4058
|
}
|
|
4035
4059
|
async editInspectorState(payload) {
|
|
4036
4060
|
var _a10;
|
|
@@ -4049,10 +4073,10 @@ var DevToolsPluginApi = class {
|
|
|
4049
4073
|
const res = await this.getInspectorTree({
|
|
4050
4074
|
inspectorId
|
|
4051
4075
|
});
|
|
4052
|
-
apiHooks.callHook("inspector-tree:send" /* SEND_INSPECTOR_TREE */,
|
|
4076
|
+
apiHooks.callHook("inspector-tree:send" /* SEND_INSPECTOR_TREE */, {
|
|
4053
4077
|
inspectorId,
|
|
4054
|
-
data:
|
|
4055
|
-
})
|
|
4078
|
+
data: res
|
|
4079
|
+
});
|
|
4056
4080
|
}
|
|
4057
4081
|
}
|
|
4058
4082
|
async sendInspectorState(inspectorId) {
|
|
@@ -4062,7 +4086,7 @@ var DevToolsPluginApi = class {
|
|
|
4062
4086
|
inspectorId,
|
|
4063
4087
|
nodeId: inspector.nodeId
|
|
4064
4088
|
});
|
|
4065
|
-
apiHooks.callHook("inspector-state:send" /* SEND_INSPECTOR_STATE */,
|
|
4089
|
+
apiHooks.callHook("inspector-state:send" /* SEND_INSPECTOR_STATE */, { ...res, inspectorId });
|
|
4066
4090
|
}
|
|
4067
4091
|
}
|
|
4068
4092
|
async getComponentInstances(app) {
|
|
@@ -4149,7 +4173,8 @@ function initStateFactory() {
|
|
|
4149
4173
|
tabs: [],
|
|
4150
4174
|
commands: [],
|
|
4151
4175
|
vitePluginDetected: false,
|
|
4152
|
-
activeAppRecordId: null
|
|
4176
|
+
activeAppRecordId: null,
|
|
4177
|
+
highPerfModeEnabled: false
|
|
4153
4178
|
};
|
|
4154
4179
|
}
|
|
4155
4180
|
var _a4, _b4;
|
|
@@ -4380,6 +4405,12 @@ function onDevToolsClientConnected(fn) {
|
|
|
4380
4405
|
});
|
|
4381
4406
|
}
|
|
4382
4407
|
|
|
4408
|
+
// src/core/high-perf-mode/index.ts
|
|
4409
|
+
init_esm_shims();
|
|
4410
|
+
function toggleHighPerfMode(state) {
|
|
4411
|
+
devtoolsState.highPerfModeEnabled = state != null ? state : !devtoolsState.highPerfModeEnabled;
|
|
4412
|
+
}
|
|
4413
|
+
|
|
4383
4414
|
// src/index.ts
|
|
4384
4415
|
var devtools = {
|
|
4385
4416
|
state: devtoolsState,
|
|
@@ -4407,5 +4438,6 @@ export {
|
|
|
4407
4438
|
stringify,
|
|
4408
4439
|
toEdit,
|
|
4409
4440
|
toSubmit,
|
|
4410
|
-
toggleComponentInspectorEnabled
|
|
4441
|
+
toggleComponentInspectorEnabled,
|
|
4442
|
+
toggleHighPerfMode
|
|
4411
4443
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/devtools-kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.
|
|
4
|
+
"version": "7.0.18",
|
|
5
5
|
"author": "webfansplz",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"exports": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"mitt": "^3.0.1",
|
|
26
26
|
"perfect-debounce": "^1.0.0",
|
|
27
27
|
"speakingurl": "^14.0.1",
|
|
28
|
-
"@vue/devtools-shared": "^7.0.
|
|
28
|
+
"@vue/devtools-shared": "^7.0.18"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/speakingurl": "^13.0.6",
|