vite-plugin-vue-devtools 0.1.7 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/client/assets/{IframeView.vue_vue_type_script_setup_true_lang-b97575a4.js → IframeView.vue_vue_type_script_setup_true_lang-3a43e6ae.js} +1 -1
  2. package/dist/client/assets/{StateFields.vue_vue_type_script_setup_true_lang-6afd54d1.js → StateFields.vue_vue_type_script_setup_true_lang-f9c67da8.js} +4 -4
  3. package/dist/client/assets/{VCard-50fbc1c6.js → VCard-8f584a44.js} +1 -1
  4. package/dist/client/assets/{VIcon.vue_vue_type_script_setup_true_lang-fa37679c.js → VIcon.vue_vue_type_script_setup_true_lang-b5034521.js} +1 -1
  5. package/dist/client/assets/{VIconButton.vue_vue_type_script_setup_true_lang-bb9d2409.js → VIconButton.vue_vue_type_script_setup_true_lang-66a83f1a.js} +2 -2
  6. package/dist/client/assets/{VIconTitle.vue_vue_type_script_setup_true_lang-4c3fb496.js → VIconTitle.vue_vue_type_script_setup_true_lang-276880a3.js} +1 -1
  7. package/dist/client/assets/{VPanelGrids-06a48044.js → VPanelGrids-08531872.js} +1 -1
  8. package/dist/client/assets/{VSectionBlock-c2aabf14.js → VSectionBlock-c9cecc8a.js} +3 -3
  9. package/dist/client/assets/{VTextInput.vue_vue_type_script_setup_true_lang-00787f29.js → VTextInput.vue_vue_type_script_setup_true_lang-96ef132c.js} +2 -2
  10. package/dist/client/assets/__eyedropper-dbdd9188.js +112 -0
  11. package/dist/client/assets/{__inspecting-110158f6.js → __inspecting-c3942849.js} +2 -2
  12. package/dist/client/assets/{assets-81886869.js → assets-dc890f94.js} +9 -9
  13. package/dist/client/assets/{component-docs-8efb505d.js → component-docs-0d4eec65.js} +6 -6
  14. package/dist/client/assets/{components-34ee71ab.js → components-4bbb4d42.js} +8 -8
  15. package/dist/client/assets/{documentations-980e4452.js → documentations-0772e28d.js} +4 -4
  16. package/dist/client/assets/{graph-82f7576a.js → graph-f04f0659.js} +2 -2
  17. package/dist/client/assets/{index-896fa224.js → index-4ea8507d.js} +1 -1
  18. package/dist/client/assets/index-76a3c684.css +466 -0
  19. package/dist/client/assets/{index-4557c2db.js → index-f743edb2.js} +28 -18
  20. package/dist/client/assets/{inspect-70b2e8de.js → inspect-ef16c665.js} +3 -3
  21. package/dist/client/assets/{npm-812fea30.js → npm-8aa51398.js} +175 -31
  22. package/dist/client/assets/{overview-b7346332.js → overview-d04e0943.js} +5 -5
  23. package/dist/client/assets/{pages-fec4d4eb.js → pages-c8759169.js} +5 -5
  24. package/dist/client/assets/{pinia-056be81a.js → pinia-a1d3abba.js} +6 -6
  25. package/dist/client/assets/{routes-f230a5cb.js → routes-b6e1361f.js} +8 -8
  26. package/dist/client/assets/{rpc-54e81694.js → rpc-901b9577.js} +1 -1
  27. package/dist/client/assets/{settings-82fab955.js → settings-7dc3a0fa.js} +3 -3
  28. package/dist/client/assets/{splitpanes.es-331a3b1f.js → splitpanes.es-cb929c19.js} +1 -1
  29. package/dist/client/assets/{timeline-fa753dd6.js → timeline-01c3c8d8.js} +8 -8
  30. package/dist/client/index.html +2 -2
  31. package/dist/index.cjs +34 -8
  32. package/dist/index.mjs +34 -8
  33. package/package.json +2 -2
  34. package/src/node/Container.vue +18 -5
  35. package/dist/client/assets/index-4825b66d.css +0 -466
package/dist/index.cjs CHANGED
@@ -7591,7 +7591,10 @@ async function getPackages(root) {
7591
7591
  for (const type in categorizedPackages) {
7592
7592
  for (const name in categorizedPackages[type]) {
7593
7593
  const version = categorizedPackages[type][name];
7594
- packages[name] = version;
7594
+ packages[name] = {
7595
+ version,
7596
+ type
7597
+ };
7595
7598
  }
7596
7599
  }
7597
7600
  return {
@@ -13631,22 +13634,29 @@ const parseNi = (agent, args, ctx) => {
13631
13634
  return getCommand(agent, "install", args);
13632
13635
  return getCommand(agent, "add", args);
13633
13636
  };
13637
+ const parseNun = (agent, args) => {
13638
+ if (args.includes("-g"))
13639
+ return getCommand(agent, "global_uninstall", exclude(args, "-g"));
13640
+ return getCommand(agent, "uninstall", args);
13641
+ };
13634
13642
  if (typeof process !== 'undefined') {
13635
13643
  (process.env || {});
13636
13644
  process.stdout && process.stdout.isTTY;
13637
13645
  }
13638
13646
 
13639
- async function installPackage(packages, options = {}) {
13647
+ async function execNpmScript(packages, options = {}) {
13640
13648
  const {
13641
13649
  isDev = false,
13642
13650
  cwd = process.cwd(),
13643
13651
  callback = () => {
13644
- }
13652
+ },
13653
+ type = "install"
13645
13654
  } = options;
13646
13655
  const agent = await detect({});
13647
- const command = await parseNi(agent, [...packages, ...isDev ? ["-D"] : [], "--ignore-scripts"]);
13648
- const { execaCommand: execaCommand2 } = await import('execa');
13649
- const _process = execaCommand2(command, {
13656
+ const fn = type === "install" ? parseNi : parseNun;
13657
+ const command = await fn(agent, [...packages, ...isDev ? ["-D"] : [], type === "install" ? "--ignore-scripts" : ""]);
13658
+ const { execaCommand } = await import('execa');
13659
+ const _process = execaCommand(command, {
13650
13660
  encoding: "utf-8",
13651
13661
  cwd,
13652
13662
  env: {
@@ -13666,7 +13676,11 @@ async function installPackage(packages, options = {}) {
13666
13676
  callback("data", data.toString());
13667
13677
  });
13668
13678
  _process.on("exit", (code) => {
13669
- callback("data", "\n\n> Successfully installed. \n\n");
13679
+ callback("data", `
13680
+
13681
+ > Successfully ${type === "install" ? "installed" : "removed"}.
13682
+
13683
+ `);
13670
13684
  callback("exit", `${code}`);
13671
13685
  });
13672
13686
  }
@@ -13714,8 +13728,20 @@ function VitePluginVueDevTools(options = { appendTo: "" }) {
13714
13728
  getPackages: () => getPackages(config.root),
13715
13729
  getVueSFCList: () => getVueSFCList(config.root),
13716
13730
  getComponentInfo: (filename) => getComponentInfo(config.root, filename),
13717
- installPackage: (packages, options2 = {}) => installPackage(packages, {
13731
+ installPackage: (packages, options2 = {}) => execNpmScript(packages, {
13732
+ ...options2,
13733
+ type: "install",
13734
+ cwd: config.root,
13735
+ callback: (type, data) => {
13736
+ if (type === "data")
13737
+ rpc.onTerminalData({ data });
13738
+ else if (type === "exit")
13739
+ rpc.onTerminalExit({ data });
13740
+ }
13741
+ }),
13742
+ uninstallPackage: (packages, options2 = {}) => execNpmScript(packages, {
13718
13743
  ...options2,
13744
+ type: "uninstall",
13719
13745
  cwd: config.root,
13720
13746
  callback: (type, data) => {
13721
13747
  if (type === "data")
package/dist/index.mjs CHANGED
@@ -7565,7 +7565,10 @@ async function getPackages(root) {
7565
7565
  for (const type in categorizedPackages) {
7566
7566
  for (const name in categorizedPackages[type]) {
7567
7567
  const version = categorizedPackages[type][name];
7568
- packages[name] = version;
7568
+ packages[name] = {
7569
+ version,
7570
+ type
7571
+ };
7569
7572
  }
7570
7573
  }
7571
7574
  return {
@@ -13605,22 +13608,29 @@ const parseNi = (agent, args, ctx) => {
13605
13608
  return getCommand(agent, "install", args);
13606
13609
  return getCommand(agent, "add", args);
13607
13610
  };
13611
+ const parseNun = (agent, args) => {
13612
+ if (args.includes("-g"))
13613
+ return getCommand(agent, "global_uninstall", exclude(args, "-g"));
13614
+ return getCommand(agent, "uninstall", args);
13615
+ };
13608
13616
  if (typeof process !== 'undefined') {
13609
13617
  (process.env || {});
13610
13618
  process.stdout && process.stdout.isTTY;
13611
13619
  }
13612
13620
 
13613
- async function installPackage(packages, options = {}) {
13621
+ async function execNpmScript(packages, options = {}) {
13614
13622
  const {
13615
13623
  isDev = false,
13616
13624
  cwd = process.cwd(),
13617
13625
  callback = () => {
13618
- }
13626
+ },
13627
+ type = "install"
13619
13628
  } = options;
13620
13629
  const agent = await detect({});
13621
- const command = await parseNi(agent, [...packages, ...isDev ? ["-D"] : [], "--ignore-scripts"]);
13622
- const { execaCommand: execaCommand2 } = await import('execa');
13623
- const _process = execaCommand2(command, {
13630
+ const fn = type === "install" ? parseNi : parseNun;
13631
+ const command = await fn(agent, [...packages, ...isDev ? ["-D"] : [], type === "install" ? "--ignore-scripts" : ""]);
13632
+ const { execaCommand } = await import('execa');
13633
+ const _process = execaCommand(command, {
13624
13634
  encoding: "utf-8",
13625
13635
  cwd,
13626
13636
  env: {
@@ -13640,7 +13650,11 @@ async function installPackage(packages, options = {}) {
13640
13650
  callback("data", data.toString());
13641
13651
  });
13642
13652
  _process.on("exit", (code) => {
13643
- callback("data", "\n\n> Successfully installed. \n\n");
13653
+ callback("data", `
13654
+
13655
+ > Successfully ${type === "install" ? "installed" : "removed"}.
13656
+
13657
+ `);
13644
13658
  callback("exit", `${code}`);
13645
13659
  });
13646
13660
  }
@@ -13688,8 +13702,20 @@ function VitePluginVueDevTools(options = { appendTo: "" }) {
13688
13702
  getPackages: () => getPackages(config.root),
13689
13703
  getVueSFCList: () => getVueSFCList(config.root),
13690
13704
  getComponentInfo: (filename) => getComponentInfo(config.root, filename),
13691
- installPackage: (packages, options2 = {}) => installPackage(packages, {
13705
+ installPackage: (packages, options2 = {}) => execNpmScript(packages, {
13706
+ ...options2,
13707
+ type: "install",
13708
+ cwd: config.root,
13709
+ callback: (type, data) => {
13710
+ if (type === "data")
13711
+ rpc.onTerminalData({ data });
13712
+ else if (type === "exit")
13713
+ rpc.onTerminalExit({ data });
13714
+ }
13715
+ }),
13716
+ uninstallPackage: (packages, options2 = {}) => execNpmScript(packages, {
13692
13717
  ...options2,
13718
+ type: "uninstall",
13693
13719
  cwd: config.root,
13694
13720
  callback: (type, data) => {
13695
13721
  if (type === "data")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-vue-devtools",
3
- "version": "0.1.7",
3
+ "version": "0.2.1",
4
4
  "packageManager": "pnpm@8.4.0",
5
5
  "description": "A vite plugin for Vue Devtools",
6
6
  "author": "webfansplz",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@vueuse/core": "^10.1.2",
59
- "@webfansplz/vuedoc-parser": "^0.0.2",
59
+ "@webfansplz/vuedoc-parser": "^0.0.3",
60
60
  "algoliasearch": "^4.17.1",
61
61
  "birpc": "^0.2.12",
62
62
  "execa": "^7.1.1",
@@ -45,7 +45,7 @@ const panelState = ref({
45
45
  const panelStyle = computed(() => {
46
46
  const height = `calc(${panelState.value.height}vh - ${PANEL_PADDING}px)`
47
47
  const width = `calc(${panelState.value.width}vw - ${PANEL_PADDING}px)`
48
- if (panelState.value.viewMode === 'component-inspector') {
48
+ if (panelState.value.viewMode === 'xs') {
49
49
  return {
50
50
  bottom: `${PANEL_PADDING}px`,
51
51
  left: '50%',
@@ -199,15 +199,27 @@ document.addEventListener('mousemove', (e) => {
199
199
 
200
200
  /** -----inspector end-----**/
201
201
 
202
+ function toggleViewMode(state) {
203
+ if (state) {
204
+ panelState.value.viewMode = state
205
+ return
206
+ }
207
+ if (panelState.value.viewMode === 'xs')
208
+ panelState.value.viewMode = 'default'
209
+
210
+ else
211
+ panelState.value.viewMode = 'xs'
212
+ }
213
+
202
214
  function enableComponentInspector() {
203
215
  window.__VUE_INSPECTOR__?.enable()
204
- panelState.value.viewMode = 'component-inspector'
216
+ panelState.value.viewMode = 'xs'
205
217
  }
206
218
 
207
219
  function disableComponentInspector() {
208
220
  window.__VUE_INSPECTOR__?.disable()
209
221
  hook.emit('host:inspector:close')
210
- if (panelState.value.viewMode === 'component-inspector')
222
+ if (panelState.value.viewMode === 'xs')
211
223
  panelState.value.viewMode = 'default'
212
224
  }
213
225
  /** -----inspector end-----**/
@@ -251,6 +263,7 @@ function setupClient() {
251
263
  disable: disableComponentInspector,
252
264
  },
253
265
  panel: {
266
+ toggleViewMode,
254
267
  toggle: togglePanel,
255
268
  togglePosition(position) {
256
269
  panelState.value.position = position
@@ -445,8 +458,8 @@ window.addEventListener('click', (event) => {
445
458
  </div>
446
459
  <!-- toggle button -->
447
460
  <button
448
- ref="toggleButtonRef" class="vue-devtools-toggle" aria-label="Toggle devtools panel" :style="toggleButtonPosition"
449
- @click.prevent="togglePanel"
461
+ ref="toggleButtonRef" class="vue-devtools-toggle" aria-label="Toggle devtools panel"
462
+ :style="toggleButtonPosition" @click.prevent="togglePanel"
450
463
  >
451
464
  <svg viewBox="0 0 256 198" fill="none" xmlns="http://www.w3.org/2000/svg">
452
465
  <path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z" />