@vue/devtools-api 6.0.0-beta.20.1 → 6.0.0-beta.21

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.
@@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
7
7
  o[k2] = m[k];
8
8
  }));
9
9
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  __exportStar(require("./api"), exports);
package/lib/cjs/index.js CHANGED
@@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
7
7
  o[k2] = m[k];
8
8
  }));
9
9
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.setupDevtoolsPlugin = void 0;
@@ -17,8 +17,8 @@ const proxy_1 = require("./proxy");
17
17
  __exportStar(require("./api"), exports);
18
18
  __exportStar(require("./plugin"), exports);
19
19
  function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
20
- const target = env_1.getTarget();
21
- const hook = env_1.getDevtoolsGlobalHook();
20
+ const target = (0, env_1.getTarget)();
21
+ const hook = (0, env_1.getDevtoolsGlobalHook)();
22
22
  const enableProxy = env_1.isProxyAvailable && pluginDescriptor.enableEarlyProxy;
23
23
  if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
24
24
  hook.emit(const_1.HOOK_SETUP, pluginDescriptor, setupFn);
package/lib/cjs/proxy.js CHANGED
@@ -3,6 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ApiProxy = void 0;
4
4
  const const_1 = require("./const");
5
5
  class ApiProxy {
6
+ target;
7
+ targetQueue;
8
+ proxiedTarget;
9
+ onQueue;
10
+ proxiedOn;
11
+ plugin;
12
+ hook;
13
+ fallbacks;
6
14
  constructor(plugin, hook) {
7
15
  this.target = null;
8
16
  this.targetQueue = [];
@@ -17,7 +25,7 @@ class ApiProxy {
17
25
  }
18
26
  }
19
27
  const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
20
- let currentSettings = { ...defaultSettings };
28
+ let currentSettings = Object.assign({}, defaultSettings);
21
29
  try {
22
30
  const raw = localStorage.getItem(localSettingsSaveId);
23
31
  const data = JSON.parse(raw);
@@ -40,11 +48,13 @@ class ApiProxy {
40
48
  currentSettings = value;
41
49
  },
42
50
  };
43
- hook.on(const_1.HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
44
- if (pluginId === this.plugin.id) {
45
- this.fallbacks.setSettings(value);
46
- }
47
- });
51
+ if (hook) {
52
+ hook.on(const_1.HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
53
+ if (pluginId === this.plugin.id) {
54
+ this.fallbacks.setSettings(value);
55
+ }
56
+ });
57
+ }
48
58
  this.proxiedOn = new Proxy({}, {
49
59
  get: (_target, prop) => {
50
60
  if (this.target) {
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1 @@
1
- export declare type App = Record<string, any> & {
2
- __app: true;
3
- };
1
+ export declare type App = any;
@@ -0,0 +1 @@
1
+ export {};
@@ -1,8 +1,6 @@
1
1
  import { InspectorNodeTag } from './api';
2
2
  import { ID } from './util';
3
- export declare type ComponentInstance = Record<string, any> & {
4
- __component: true;
5
- };
3
+ export declare type ComponentInstance = any;
6
4
  export interface ComponentTreeNode {
7
5
  uid: ID;
8
6
  id: string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/lib/esm/plugin.js CHANGED
@@ -0,0 +1 @@
1
+ export {};
package/lib/esm/proxy.js CHANGED
@@ -1,5 +1,13 @@
1
1
  import { HOOK_PLUGIN_SETTINGS_SET } from './const';
2
2
  export class ApiProxy {
3
+ target;
4
+ targetQueue;
5
+ proxiedTarget;
6
+ onQueue;
7
+ proxiedOn;
8
+ plugin;
9
+ hook;
10
+ fallbacks;
3
11
  constructor(plugin, hook) {
4
12
  this.target = null;
5
13
  this.targetQueue = [];
@@ -14,7 +22,7 @@ export class ApiProxy {
14
22
  }
15
23
  }
16
24
  const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
17
- let currentSettings = { ...defaultSettings };
25
+ let currentSettings = Object.assign({}, defaultSettings);
18
26
  try {
19
27
  const raw = localStorage.getItem(localSettingsSaveId);
20
28
  const data = JSON.parse(raw);
@@ -37,11 +45,13 @@ export class ApiProxy {
37
45
  currentSettings = value;
38
46
  },
39
47
  };
40
- hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
41
- if (pluginId === this.plugin.id) {
42
- this.fallbacks.setSettings(value);
43
- }
44
- });
48
+ if (hook) {
49
+ hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
50
+ if (pluginId === this.plugin.id) {
51
+ this.fallbacks.setSettings(value);
52
+ }
53
+ });
54
+ }
45
55
  this.proxiedOn = new Proxy({}, {
46
56
  get: (_target, prop) => {
47
57
  if (this.target) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/devtools-api",
3
- "version": "6.0.0-beta.20.1",
3
+ "version": "6.0.0-beta.21",
4
4
  "description": "Interact with the Vue devtools from the page",
5
5
  "main": "lib/cjs/index.js",
6
6
  "browser": "lib/esm/index.js",
@@ -32,6 +32,6 @@
32
32
  "devDependencies": {
33
33
  "@types/node": "^13.9.1",
34
34
  "@types/webpack-env": "^1.15.1",
35
- "typescript": "^3.8.3"
35
+ "typescript": "^4.5.2"
36
36
  }
37
37
  }