@vue/devtools-kit 7.7.6 → 7.7.7

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 CHANGED
@@ -4552,18 +4552,21 @@ function getAppRecordId(app, defaultId) {
4552
4552
  return id;
4553
4553
  }
4554
4554
  function createAppRecord(app, types) {
4555
+ var _a25, _b25;
4555
4556
  const rootInstance = getAppRootInstance(app);
4556
4557
  if (rootInstance) {
4557
4558
  appRecordInfo.id++;
4558
4559
  const name = getAppRecordName(app, appRecordInfo.id.toString());
4559
4560
  const id = getAppRecordId(app, (0, import_speakingurl.default)(name));
4561
+ const [el] = getRootElementsFromComponentInstance(rootInstance);
4560
4562
  const record = {
4561
4563
  id,
4562
4564
  name,
4563
4565
  types,
4564
4566
  instanceMap: /* @__PURE__ */ new Map(),
4565
4567
  perfGroupIds: /* @__PURE__ */ new Map(),
4566
- rootInstance
4568
+ rootInstance,
4569
+ iframe: import_devtools_shared20.isBrowser && document !== (el == null ? void 0 : el.ownerDocument) ? (_b25 = (_a25 = el == null ? void 0 : el.ownerDocument) == null ? void 0 : _a25.location) == null ? void 0 : _b25.pathname : void 0
4567
4570
  };
4568
4571
  app.__VUE_DEVTOOLS_NEXT_APP_RECORD__ = record;
4569
4572
  const rootId = `${record.id}:root`;
@@ -4575,9 +4578,96 @@ function createAppRecord(app, types) {
4575
4578
  }
4576
4579
  }
4577
4580
 
4581
+ // src/core/iframe/index.ts
4582
+ init_cjs_shims();
4583
+ function detectIframeApp(target22, inIframe = false) {
4584
+ if (inIframe) {
4585
+ let sendEventToParent2 = function(cb) {
4586
+ try {
4587
+ const hook3 = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
4588
+ if (hook3) {
4589
+ cb(hook3);
4590
+ }
4591
+ } catch (e) {
4592
+ }
4593
+ };
4594
+ var sendEventToParent = sendEventToParent2;
4595
+ const hook2 = {
4596
+ id: "vue-devtools-next",
4597
+ devtoolsVersion: "7.0",
4598
+ on: (event, cb) => {
4599
+ sendEventToParent2((hook3) => {
4600
+ hook3.on(event, cb);
4601
+ });
4602
+ },
4603
+ once: (event, cb) => {
4604
+ sendEventToParent2((hook3) => {
4605
+ hook3.once(event, cb);
4606
+ });
4607
+ },
4608
+ off: (event, cb) => {
4609
+ sendEventToParent2((hook3) => {
4610
+ hook3.off(event, cb);
4611
+ });
4612
+ },
4613
+ emit: (event, ...payload) => {
4614
+ sendEventToParent2((hook3) => {
4615
+ hook3.emit(event, ...payload);
4616
+ });
4617
+ }
4618
+ };
4619
+ Object.defineProperty(target22, "__VUE_DEVTOOLS_GLOBAL_HOOK__", {
4620
+ get() {
4621
+ return hook2;
4622
+ },
4623
+ configurable: true
4624
+ });
4625
+ }
4626
+ function injectVueHookToIframe(iframe) {
4627
+ if (iframe.__vdevtools__injected) {
4628
+ return;
4629
+ }
4630
+ try {
4631
+ iframe.__vdevtools__injected = true;
4632
+ const inject = () => {
4633
+ try {
4634
+ iframe.contentWindow.__VUE_DEVTOOLS_IFRAME__ = iframe;
4635
+ const script = iframe.contentDocument.createElement("script");
4636
+ script.textContent = `;(${detectIframeApp.toString()})(window, true)`;
4637
+ iframe.contentDocument.documentElement.appendChild(script);
4638
+ script.parentNode.removeChild(script);
4639
+ } catch (e) {
4640
+ }
4641
+ };
4642
+ inject();
4643
+ iframe.addEventListener("load", () => inject());
4644
+ } catch (e) {
4645
+ }
4646
+ }
4647
+ function injectVueHookToIframes() {
4648
+ if (typeof window === "undefined") {
4649
+ return;
4650
+ }
4651
+ const iframes = Array.from(document.querySelectorAll("iframe:not([data-vue-devtools-ignore])"));
4652
+ for (const iframe of iframes) {
4653
+ injectVueHookToIframe(iframe);
4654
+ }
4655
+ }
4656
+ injectVueHookToIframes();
4657
+ let iframeAppChecks = 0;
4658
+ const iframeAppCheckTimer = setInterval(() => {
4659
+ injectVueHookToIframes();
4660
+ iframeAppChecks++;
4661
+ if (iframeAppChecks >= 5) {
4662
+ clearInterval(iframeAppCheckTimer);
4663
+ }
4664
+ }, 1e3);
4665
+ }
4666
+
4578
4667
  // src/core/index.ts
4579
4668
  function initDevTools() {
4580
4669
  var _a25;
4670
+ detectIframeApp(import_devtools_shared21.target);
4581
4671
  updateDevToolsState({
4582
4672
  vitePluginDetected: getDevToolsEnv().vitePluginDetected
4583
4673
  });
@@ -4597,8 +4687,10 @@ function initDevTools() {
4597
4687
  import_devtools_shared21.target.__VUE_DEVTOOLS_VUE2_APP_DETECTED__ = true;
4598
4688
  console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 600; font-size: 16px;");
4599
4689
  console.log("%cVue DevTools v7 detected in your Vue2 project. v7 only supports Vue3 and will not work.", "font-bold: 500; font-size: 14px;");
4600
- const url = "https://chromewebstore.google.com/detail/vuejs-devtools/iaajmlceplecbljialhhkmedjlpdblhp";
4601
- console.log(`%cThe legacy version that supports both Vue 2 and Vue 3 has been moved to %c ${url}`, "font-size: 14px;", "text-decoration: underline; cursor: pointer;font-size: 14px;");
4690
+ const legacyChromeUrl = "https://chromewebstore.google.com/detail/vuejs-devtools/iaajmlceplecbljialhhkmedjlpdblhp";
4691
+ const legacyFirefoxUrl = "https://addons.mozilla.org/firefox/addon/vue-js-devtools-v6-legacy";
4692
+ console.log(`%cThe legacy version of chrome extension that supports both Vue 2 and Vue 3 has been moved to %c ${legacyChromeUrl}`, "font-size: 14px;", "text-decoration: underline; cursor: pointer;font-size: 14px;");
4693
+ console.log(`%cThe legacy version of firefox extension that supports both Vue 2 and Vue 3 has been moved to %c ${legacyFirefoxUrl}`, "font-size: 14px;", "text-decoration: underline; cursor: pointer;font-size: 14px;");
4602
4694
  console.log("%cPlease install and enable only the legacy version for your Vue2 app.", "font-bold: 500; font-size: 14px;");
4603
4695
  console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 600; font-size: 16px;");
4604
4696
  });
@@ -4660,7 +4752,8 @@ function initDevTools() {
4660
4752
  Object.defineProperty(import_devtools_shared21.target, "__VUE_DEVTOOLS_GLOBAL_HOOK__", {
4661
4753
  get() {
4662
4754
  return _devtoolsHook;
4663
- }
4755
+ },
4756
+ configurable: true
4664
4757
  });
4665
4758
  } else {
4666
4759
  if (!import_devtools_shared21.isNuxtApp) {
package/dist/index.d.cts CHANGED
@@ -62,6 +62,7 @@ interface AppRecord {
62
62
  }>;
63
63
  rootInstance: VueAppInstance;
64
64
  routerId?: string;
65
+ iframe?: string;
65
66
  }
66
67
 
67
68
  interface CustomCommandAction {
package/dist/index.d.ts CHANGED
@@ -62,6 +62,7 @@ interface AppRecord {
62
62
  }>;
63
63
  rootInstance: VueAppInstance;
64
64
  routerId?: string;
65
+ iframe?: string;
65
66
  }
66
67
 
67
68
  interface CustomCommandAction {
package/dist/index.js CHANGED
@@ -4421,7 +4421,7 @@ var devtoolsContext = target11.__VUE_DEVTOOLS_KIT_CONTEXT__;
4421
4421
  // src/core/app/index.ts
4422
4422
  init_esm_shims();
4423
4423
  var import_speakingurl = __toESM(require_speakingurl2(), 1);
4424
- import { target as target12 } from "@vue/devtools-shared";
4424
+ import { isBrowser as isBrowser3, target as target12 } from "@vue/devtools-shared";
4425
4425
  var _a17, _b17;
4426
4426
  var appRecordInfo = (_b17 = (_a17 = target12).__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__) != null ? _b17 : _a17.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__ = {
4427
4427
  id: 0,
@@ -4460,18 +4460,21 @@ function getAppRecordId(app, defaultId) {
4460
4460
  return id;
4461
4461
  }
4462
4462
  function createAppRecord(app, types) {
4463
+ var _a25, _b25;
4463
4464
  const rootInstance = getAppRootInstance(app);
4464
4465
  if (rootInstance) {
4465
4466
  appRecordInfo.id++;
4466
4467
  const name = getAppRecordName(app, appRecordInfo.id.toString());
4467
4468
  const id = getAppRecordId(app, (0, import_speakingurl.default)(name));
4469
+ const [el] = getRootElementsFromComponentInstance(rootInstance);
4468
4470
  const record = {
4469
4471
  id,
4470
4472
  name,
4471
4473
  types,
4472
4474
  instanceMap: /* @__PURE__ */ new Map(),
4473
4475
  perfGroupIds: /* @__PURE__ */ new Map(),
4474
- rootInstance
4476
+ rootInstance,
4477
+ iframe: isBrowser3 && document !== (el == null ? void 0 : el.ownerDocument) ? (_b25 = (_a25 = el == null ? void 0 : el.ownerDocument) == null ? void 0 : _a25.location) == null ? void 0 : _b25.pathname : void 0
4475
4478
  };
4476
4479
  app.__VUE_DEVTOOLS_NEXT_APP_RECORD__ = record;
4477
4480
  const rootId = `${record.id}:root`;
@@ -4483,9 +4486,96 @@ function createAppRecord(app, types) {
4483
4486
  }
4484
4487
  }
4485
4488
 
4489
+ // src/core/iframe/index.ts
4490
+ init_esm_shims();
4491
+ function detectIframeApp(target22, inIframe = false) {
4492
+ if (inIframe) {
4493
+ let sendEventToParent2 = function(cb) {
4494
+ try {
4495
+ const hook3 = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
4496
+ if (hook3) {
4497
+ cb(hook3);
4498
+ }
4499
+ } catch (e) {
4500
+ }
4501
+ };
4502
+ var sendEventToParent = sendEventToParent2;
4503
+ const hook2 = {
4504
+ id: "vue-devtools-next",
4505
+ devtoolsVersion: "7.0",
4506
+ on: (event, cb) => {
4507
+ sendEventToParent2((hook3) => {
4508
+ hook3.on(event, cb);
4509
+ });
4510
+ },
4511
+ once: (event, cb) => {
4512
+ sendEventToParent2((hook3) => {
4513
+ hook3.once(event, cb);
4514
+ });
4515
+ },
4516
+ off: (event, cb) => {
4517
+ sendEventToParent2((hook3) => {
4518
+ hook3.off(event, cb);
4519
+ });
4520
+ },
4521
+ emit: (event, ...payload) => {
4522
+ sendEventToParent2((hook3) => {
4523
+ hook3.emit(event, ...payload);
4524
+ });
4525
+ }
4526
+ };
4527
+ Object.defineProperty(target22, "__VUE_DEVTOOLS_GLOBAL_HOOK__", {
4528
+ get() {
4529
+ return hook2;
4530
+ },
4531
+ configurable: true
4532
+ });
4533
+ }
4534
+ function injectVueHookToIframe(iframe) {
4535
+ if (iframe.__vdevtools__injected) {
4536
+ return;
4537
+ }
4538
+ try {
4539
+ iframe.__vdevtools__injected = true;
4540
+ const inject = () => {
4541
+ try {
4542
+ iframe.contentWindow.__VUE_DEVTOOLS_IFRAME__ = iframe;
4543
+ const script = iframe.contentDocument.createElement("script");
4544
+ script.textContent = `;(${detectIframeApp.toString()})(window, true)`;
4545
+ iframe.contentDocument.documentElement.appendChild(script);
4546
+ script.parentNode.removeChild(script);
4547
+ } catch (e) {
4548
+ }
4549
+ };
4550
+ inject();
4551
+ iframe.addEventListener("load", () => inject());
4552
+ } catch (e) {
4553
+ }
4554
+ }
4555
+ function injectVueHookToIframes() {
4556
+ if (typeof window === "undefined") {
4557
+ return;
4558
+ }
4559
+ const iframes = Array.from(document.querySelectorAll("iframe:not([data-vue-devtools-ignore])"));
4560
+ for (const iframe of iframes) {
4561
+ injectVueHookToIframe(iframe);
4562
+ }
4563
+ }
4564
+ injectVueHookToIframes();
4565
+ let iframeAppChecks = 0;
4566
+ const iframeAppCheckTimer = setInterval(() => {
4567
+ injectVueHookToIframes();
4568
+ iframeAppChecks++;
4569
+ if (iframeAppChecks >= 5) {
4570
+ clearInterval(iframeAppCheckTimer);
4571
+ }
4572
+ }, 1e3);
4573
+ }
4574
+
4486
4575
  // src/core/index.ts
4487
4576
  function initDevTools() {
4488
4577
  var _a25;
4578
+ detectIframeApp(target13);
4489
4579
  updateDevToolsState({
4490
4580
  vitePluginDetected: getDevToolsEnv().vitePluginDetected
4491
4581
  });
@@ -4505,8 +4595,10 @@ function initDevTools() {
4505
4595
  target13.__VUE_DEVTOOLS_VUE2_APP_DETECTED__ = true;
4506
4596
  console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 600; font-size: 16px;");
4507
4597
  console.log("%cVue DevTools v7 detected in your Vue2 project. v7 only supports Vue3 and will not work.", "font-bold: 500; font-size: 14px;");
4508
- const url = "https://chromewebstore.google.com/detail/vuejs-devtools/iaajmlceplecbljialhhkmedjlpdblhp";
4509
- console.log(`%cThe legacy version that supports both Vue 2 and Vue 3 has been moved to %c ${url}`, "font-size: 14px;", "text-decoration: underline; cursor: pointer;font-size: 14px;");
4598
+ const legacyChromeUrl = "https://chromewebstore.google.com/detail/vuejs-devtools/iaajmlceplecbljialhhkmedjlpdblhp";
4599
+ const legacyFirefoxUrl = "https://addons.mozilla.org/firefox/addon/vue-js-devtools-v6-legacy";
4600
+ console.log(`%cThe legacy version of chrome extension that supports both Vue 2 and Vue 3 has been moved to %c ${legacyChromeUrl}`, "font-size: 14px;", "text-decoration: underline; cursor: pointer;font-size: 14px;");
4601
+ console.log(`%cThe legacy version of firefox extension that supports both Vue 2 and Vue 3 has been moved to %c ${legacyFirefoxUrl}`, "font-size: 14px;", "text-decoration: underline; cursor: pointer;font-size: 14px;");
4510
4602
  console.log("%cPlease install and enable only the legacy version for your Vue2 app.", "font-bold: 500; font-size: 14px;");
4511
4603
  console.log("%c[_____Vue DevTools v7 log_____]", "color: red; font-bold: 600; font-size: 16px;");
4512
4604
  });
@@ -4568,7 +4660,8 @@ function initDevTools() {
4568
4660
  Object.defineProperty(target13, "__VUE_DEVTOOLS_GLOBAL_HOOK__", {
4569
4661
  get() {
4570
4662
  return _devtoolsHook;
4571
- }
4663
+ },
4664
+ configurable: true
4572
4665
  });
4573
4666
  } else {
4574
4667
  if (!isNuxtApp) {
@@ -5853,7 +5946,7 @@ init_esm_shims();
5853
5946
 
5854
5947
  // src/messaging/presets/iframe/client.ts
5855
5948
  init_esm_shims();
5856
- import { isBrowser as isBrowser3 } from "@vue/devtools-shared";
5949
+ import { isBrowser as isBrowser4 } from "@vue/devtools-shared";
5857
5950
 
5858
5951
  // src/messaging/presets/iframe/context.ts
5859
5952
  init_esm_shims();
@@ -5869,7 +5962,7 @@ function setIframeServerContext(context) {
5869
5962
 
5870
5963
  // src/messaging/presets/iframe/client.ts
5871
5964
  function createIframeClientChannel() {
5872
- if (!isBrowser3) {
5965
+ if (!isBrowser4) {
5873
5966
  return {
5874
5967
  post: (data) => {
5875
5968
  },
@@ -5896,9 +5989,9 @@ function createIframeClientChannel() {
5896
5989
 
5897
5990
  // src/messaging/presets/iframe/server.ts
5898
5991
  init_esm_shims();
5899
- import { isBrowser as isBrowser4 } from "@vue/devtools-shared";
5992
+ import { isBrowser as isBrowser5 } from "@vue/devtools-shared";
5900
5993
  function createIframeServerChannel() {
5901
- if (!isBrowser4) {
5994
+ if (!isBrowser5) {
5902
5995
  return {
5903
5996
  post: (data) => {
5904
5997
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue/devtools-kit",
3
3
  "type": "module",
4
- "version": "7.7.6",
4
+ "version": "7.7.7",
5
5
  "author": "webfansplz",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "perfect-debounce": "^1.0.0",
30
30
  "speakingurl": "^14.0.1",
31
31
  "superjson": "^2.2.2",
32
- "@vue/devtools-shared": "^7.7.6"
32
+ "@vue/devtools-shared": "^7.7.7"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/speakingurl": "^13.0.6",