vite-plugin-vue-devtools 7.3.5 → 7.3.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/vite.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { fileURLToPath } from 'node:url';
2
2
  import path$a, { dirname, resolve as resolve$1 } from 'node:path';
3
+ import fs$8 from 'node:fs';
3
4
  import { normalizePath } from 'vite';
4
5
  import sirv from 'sirv';
5
6
  import Inspect from 'vite-plugin-inspect';
@@ -6879,6 +6880,7 @@ function normalizeWindowsPath(input = "") {
6879
6880
  const _UNC_REGEX = /^[/\\]{2}/;
6880
6881
  const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
6881
6882
  const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
6883
+ const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
6882
6884
  const normalize = function(path) {
6883
6885
  if (path.length === 0) {
6884
6886
  return ".";
@@ -7013,6 +7015,22 @@ function normalizeString(path, allowAboveRoot) {
7013
7015
  const isAbsolute = function(p) {
7014
7016
  return _IS_ABSOLUTE_RE.test(p);
7015
7017
  };
7018
+ const relative = function(from, to) {
7019
+ const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
7020
+ const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
7021
+ if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
7022
+ return _to.join("/");
7023
+ }
7024
+ const _fromCopy = [..._from];
7025
+ for (const segment of _fromCopy) {
7026
+ if (_to[0] !== segment) {
7027
+ break;
7028
+ }
7029
+ _from.shift();
7030
+ _to.shift();
7031
+ }
7032
+ return [..._from.map(() => ".."), ..._to].join("/");
7033
+ };
7016
7034
 
7017
7035
  const decoder = new TextDecoder();
7018
7036
  const toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
@@ -7579,19 +7597,72 @@ const TGA = {
7579
7597
  }
7580
7598
  };
7581
7599
 
7600
+ function readIFD(buffer, isBigEndian) {
7601
+ const ifdOffset = readUInt(buffer, 32, 4, isBigEndian);
7602
+ let bufferSize = 1024;
7603
+ const fileSize = buffer.length;
7604
+ if (ifdOffset + bufferSize > fileSize) {
7605
+ bufferSize = fileSize - ifdOffset - 10;
7606
+ }
7607
+ return buffer.slice(ifdOffset + 2, ifdOffset + 2 + bufferSize);
7608
+ }
7609
+ function readValue(buffer, isBigEndian) {
7610
+ const low = readUInt(buffer, 16, 8, isBigEndian);
7611
+ const high = readUInt(buffer, 16, 10, isBigEndian);
7612
+ return (high << 16) + low;
7613
+ }
7614
+ function nextTag(buffer) {
7615
+ if (buffer.length > 24) {
7616
+ return buffer.slice(12);
7617
+ }
7618
+ }
7619
+ function extractTags(buffer, isBigEndian) {
7620
+ const tags = {};
7621
+ let temp = buffer;
7622
+ while (temp && temp.length > 0) {
7623
+ const code = readUInt(temp, 16, 0, isBigEndian);
7624
+ const type = readUInt(temp, 16, 2, isBigEndian);
7625
+ const length = readUInt(temp, 32, 4, isBigEndian);
7626
+ if (code === 0) {
7627
+ break;
7628
+ } else {
7629
+ if (length === 1 && (type === 3 || type === 4)) {
7630
+ tags[code] = readValue(temp, isBigEndian);
7631
+ }
7632
+ temp = nextTag(temp);
7633
+ }
7634
+ }
7635
+ return tags;
7636
+ }
7637
+ function determineEndianness(input) {
7638
+ const signature = toUTF8String(input, 0, 2);
7639
+ if (signature === "II") {
7640
+ return "LE";
7641
+ } else if (signature === "MM") {
7642
+ return "BE";
7643
+ }
7644
+ }
7582
7645
  const signatures = /* @__PURE__ */ new Set([
7583
- "492049",
7584
- // ?
7646
+ // '492049', // currently not supported
7585
7647
  "49492a00",
7586
7648
  // Little endian
7587
- "4d4d002a",
7588
- // Big Endian
7589
7649
  "4d4d002a"
7590
- // BigTIFF > 4GB. currently not supported
7650
+ // Big Endian
7651
+ // '4d4d002a', // BigTIFF > 4GB. currently not supported
7591
7652
  ]);
7592
7653
  const TIFF = {
7593
7654
  validate: (input) => signatures.has(toHexString(input, 0, 4)),
7594
- calculate: () => ({ width: void 0, height: void 0 })
7655
+ calculate(input) {
7656
+ const isBigEndian = determineEndianness(input) === "BE";
7657
+ const ifdBuffer = readIFD(input, isBigEndian);
7658
+ const tags = extractTags(ifdBuffer, isBigEndian);
7659
+ const width = tags[256];
7660
+ const height = tags[257];
7661
+ if (!width || !height) {
7662
+ throw new TypeError("Invalid Tiff. Missing tags");
7663
+ }
7664
+ return { height, width };
7665
+ }
7595
7666
  };
7596
7667
 
7597
7668
  function calculateExtended(input) {
@@ -7643,6 +7714,48 @@ const WEBP = {
7643
7714
  }
7644
7715
  };
7645
7716
 
7717
+ const AVIF = {
7718
+ validate: (input) => toUTF8String(input, 8, 12) === "avif",
7719
+ calculate: (input) => {
7720
+ const metaBox = findBox(input, "meta");
7721
+ const iprpBox = findBox(
7722
+ input,
7723
+ "iprp",
7724
+ metaBox.offset + 12,
7725
+ metaBox.offset + metaBox.size
7726
+ );
7727
+ const ipcoBox = findBox(
7728
+ input,
7729
+ "ipco",
7730
+ iprpBox.offset + 8,
7731
+ iprpBox.offset + iprpBox.size
7732
+ );
7733
+ const ispeBox = findBox(
7734
+ input,
7735
+ "ispe",
7736
+ ipcoBox.offset + 8,
7737
+ ipcoBox.offset + ipcoBox.size
7738
+ );
7739
+ const width = readUInt32BE(input, ispeBox.offset + 12);
7740
+ const height = readUInt32BE(input, ispeBox.offset + 16);
7741
+ return { width, height };
7742
+ }
7743
+ };
7744
+ function findBox(input, type, startOffset = 0, endOffset = input.length) {
7745
+ for (let offset = startOffset; offset < endOffset; ) {
7746
+ const size = readUInt32BE(input, offset);
7747
+ const boxType = toUTF8String(input, offset + 4, offset + 8);
7748
+ if (boxType === type) {
7749
+ return { offset, size };
7750
+ }
7751
+ if (size <= 0 || offset + size > endOffset) {
7752
+ break;
7753
+ }
7754
+ offset += size;
7755
+ }
7756
+ throw new Error(`${type} box not found`);
7757
+ }
7758
+
7646
7759
  const typeHandlers = {
7647
7760
  bmp: BMP,
7648
7761
  cur: CUR,
@@ -7660,7 +7773,8 @@ const typeHandlers = {
7660
7773
  svg: SVG,
7661
7774
  tga: TGA,
7662
7775
  tiff: TIFF,
7663
- webp: WEBP
7776
+ webp: WEBP,
7777
+ avif: AVIF
7664
7778
  };
7665
7779
 
7666
7780
  const keys = Object.keys(typeHandlers);
@@ -7724,6 +7838,8 @@ function getAssetsFunctions(ctx) {
7724
7838
  async function scan() {
7725
7839
  const dir = resolve(config.root);
7726
7840
  const baseURL = config.base;
7841
+ const publicDir = config.publicDir;
7842
+ const relativePublicDir = publicDir === "" ? "" : `${relative(dir, publicDir)}/`;
7727
7843
  const files = await fg([
7728
7844
  // image
7729
7845
  "**/*.(png|jpg|jpeg|gif|svg|webp|avif|ico|bmp|tiff)",
@@ -7749,15 +7865,16 @@ function getAssetsFunctions(ctx) {
7749
7865
  "**/pnpm-workspace.*"
7750
7866
  ]
7751
7867
  });
7752
- cache = await Promise.all(files.map(async (path) => {
7753
- const filePath = resolve(dir, path);
7868
+ cache = await Promise.all(files.map(async (relativePath) => {
7869
+ const filePath = resolve(dir, relativePath);
7754
7870
  const stat = await fsp.lstat(filePath);
7755
- path = path.startsWith("public/") ? path.slice(7) : path;
7871
+ const path = relativePath.replace(relativePublicDir, "");
7756
7872
  return {
7757
7873
  path,
7874
+ relativePath,
7758
7875
  publicPath: join(baseURL, path),
7759
7876
  filePath,
7760
- type: guessType(path),
7877
+ type: guessType(relativePath),
7761
7878
  size: stat.size,
7762
7879
  mtime: stat.mtimeMs
7763
7880
  };
@@ -7854,6 +7971,10 @@ function getRpcFunctions(ctx) {
7854
7971
  };
7855
7972
  }
7856
7973
 
7974
+ function removeUrlQuery(url) {
7975
+ return url.replace(/\?.*$/, "");
7976
+ }
7977
+
7857
7978
  function getVueDevtoolsPath() {
7858
7979
  const pluginPath = normalizePath(path$a.dirname(fileURLToPath(import.meta.url)));
7859
7980
  return pluginPath.replace(/\/dist$/, "//src");
@@ -7866,6 +7987,7 @@ const toggleComboKeysMap = {
7866
7987
  function normalizeComboKeyPrint(toggleComboKey) {
7867
7988
  return toggleComboKey.split("-").map((key) => toggleComboKeysMap[key] || key[0].toUpperCase() + key.slice(1)).join(dim("+"));
7868
7989
  }
7990
+ const devtoolsNextResourceSymbol = "?__vue-devtools-next-resource";
7869
7991
  const defaultOptions = {
7870
7992
  appendTo: "",
7871
7993
  componentInspector: true,
@@ -7908,6 +8030,8 @@ function VitePluginVueDevTools(options) {
7908
8030
  `);
7909
8031
  };
7910
8032
  }
8033
+ const devtoolsOptionsImportee = "virtual:vue-devtools-options";
8034
+ const resolvedDevtoolsOptions = `\0${devtoolsOptionsImportee}`;
7911
8035
  const plugin = {
7912
8036
  name: "vite-plugin-vue-devtools",
7913
8037
  enforce: "pre",
@@ -7919,16 +8043,20 @@ function VitePluginVueDevTools(options) {
7919
8043
  configureServer(server);
7920
8044
  },
7921
8045
  async resolveId(importee) {
7922
- if (importee.startsWith("virtual:vue-devtools-options")) {
7923
- return importee;
8046
+ if (importee === devtoolsOptionsImportee) {
8047
+ return resolvedDevtoolsOptions;
7924
8048
  } else if (importee.startsWith("virtual:vue-devtools-path:")) {
7925
8049
  const resolved = importee.replace("virtual:vue-devtools-path:", `${vueDevtoolsPath}/`);
7926
- return resolved;
8050
+ return `${resolved}${devtoolsNextResourceSymbol}`;
7927
8051
  }
7928
8052
  },
7929
8053
  async load(id) {
7930
- if (id === "virtual:vue-devtools-options")
8054
+ if (id === resolvedDevtoolsOptions) {
7931
8055
  return `export default ${JSON.stringify({ base: config.base, componentInspector: pluginOptions.componentInspector })}`;
8056
+ } else if (id.endsWith(devtoolsNextResourceSymbol)) {
8057
+ const filename = removeUrlQuery(id);
8058
+ return await fs$8.promises.readFile(filename, "utf-8");
8059
+ }
7932
8060
  },
7933
8061
  transform(code, id, options2) {
7934
8062
  if (options2?.ssr)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vite-plugin-vue-devtools",
3
3
  "type": "module",
4
- "version": "7.3.5",
4
+ "version": "7.3.7",
5
5
  "description": "A vite plugin for Vue DevTools",
6
6
  "author": "webfansplz",
7
7
  "license": "MIT",
@@ -49,15 +49,15 @@
49
49
  "execa": "^8.0.1",
50
50
  "sirv": "^2.0.4",
51
51
  "vite-plugin-inspect": "^0.8.4",
52
- "vite-plugin-vue-inspector": "^5.1.2",
53
- "@vue/devtools-core": "^7.3.5",
54
- "@vue/devtools-kit": "^7.3.5",
55
- "@vue/devtools-shared": "^7.3.5"
52
+ "vite-plugin-vue-inspector": "^5.1.3",
53
+ "@vue/devtools-shared": "^7.3.7",
54
+ "@vue/devtools-core": "^7.3.7",
55
+ "@vue/devtools-kit": "^7.3.7"
56
56
  },
57
57
  "devDependencies": {
58
- "@types/node": "^20.14.9",
58
+ "@types/node": "^20.14.10",
59
59
  "fast-glob": "^3.3.2",
60
- "image-meta": "^0.2.0",
60
+ "image-meta": "^0.2.1",
61
61
  "pathe": "^1.1.2"
62
62
  },
63
63
  "scripts": {
@@ -1 +1 @@
1
- .vue-devtools-frame[data-v-df0df9e8]{position:fixed;z-index:2147483645}.vue-devtools-frame[data-v-df0df9e8] iframe{width:100%;height:100%;outline:none;background:var(--vue-devtools-widget-bg);border:1px solid rgba(125,125,125,.2);border-radius:10px}.vue-devtools-frame.view-mode-xs[data-v-df0df9e8]{width:400px!important;height:80px!important}.vue-devtools-frame.view-mode-fullscreen[data-v-df0df9e8]{width:100vw!important;height:100vh!important;z-index:1!important;bottom:0!important;transform:none!important}.vue-devtools-frame.view-mode-fullscreen[data-v-df0df9e8] iframe{border-radius:0!important}.vue-devtools-resize--horizontal[data-v-df0df9e8]{position:absolute;left:6px;right:6px;height:10px;margin:-5px 0;cursor:ns-resize;border-radius:5px}.vue-devtools-resize--vertical[data-v-df0df9e8]{position:absolute;top:6px;bottom:0;width:10px;margin:0 -5px;cursor:ew-resize;border-radius:5px}.vue-devtools-resize-corner[data-v-df0df9e8]{position:absolute;width:14px;height:14px;margin:-6px;border-radius:6px}.vue-devtools-resize[data-v-df0df9e8]:hover{background:#7d7d7d1a}.vue-devtools__anchor[data-v-19b8fd4e]{position:fixed;z-index:2147483645;transform-origin:center center;transform:translate(-50%,-50%) rotate(0)}.vue-devtools__anchor.fullscreen[data-v-19b8fd4e]{transform:none!important;left:0!important}.vue-devtools__anchor-btn[data-v-19b8fd4e]{border-radius:100%;border-width:0;width:30px;height:30px;display:flex;justify-content:center;align-items:center;opacity:.8;transition:opacity .2s ease-in-out}.vue-devtools__anchor-btn[data-v-19b8fd4e]:hover{opacity:1}.vue-devtools__anchor-btn svg[data-v-19b8fd4e]{width:14px;height:14px}.vue-devtools__anchor-btn.active[data-v-19b8fd4e]{cursor:pointer}.vue-devtools__anchor .panel-entry-btn[data-v-19b8fd4e]{cursor:pointer;flex:none}.vue-devtools__anchor--vertical .panel-entry-btn[data-v-19b8fd4e]{transform:rotate(-90deg)}.vue-devtools__anchor--vertical .vue-devtools__panel[data-v-19b8fd4e]{transform:translate(-50%,-50%) rotate(90deg);box-shadow:2px -2px 8px var(--vue-devtools-widget-shadow)}.vue-devtools__anchor--hide .vue-devtools__panel[data-v-19b8fd4e]{max-width:32px;padding:2px 0}.vue-devtools__anchor--hide .vue-devtools__panel-content[data-v-19b8fd4e]{opacity:0}.vue-devtools__anchor--glowing[data-v-19b8fd4e]{position:absolute;left:0;top:0;transform:translate(-50%,-50%);width:160px;height:160px;opacity:0;transition:all 1s ease;pointer-events:none;z-index:-1;border-radius:9999px;background-image:linear-gradient(45deg,#00dc82,#36e4da,#0047e1);filter:blur(60px)}.vue-devtools__anchor:hover .vue-devtools__anchor--glowing[data-v-19b8fd4e]{opacity:.6}.vue-devtools__panel[data-v-19b8fd4e]{position:absolute;left:0;top:0;transform:translate(-50%,-50%);display:flex;justify-content:flex-start;overflow:hidden;align-items:center;gap:2px;height:30px;padding:4px 4px 4px 5px;box-sizing:border-box;border:1px solid var(--vue-devtools-widget-border);border-radius:20px;background-color:var(--vue-devtools-widget-bg);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);color:var(--vue-devtools-widget-fg);box-shadow:2px 2px 8px var(--vue-devtools-widget-shadow);-webkit-user-select:none;user-select:none;max-width:150px;transition:max-width .4s ease,padding .5s ease,transform .3s ease,all .4s ease}.vue-devtools__panel-content[data-v-19b8fd4e]{transition:opacity .4s ease}.vue-devtools__panel-divider[data-v-19b8fd4e]{border-left:1px solid rgba(136,136,136,.2);width:1px;height:10px}@keyframes blink-19b8fd4e{0%{opacity:.2}50%{opacity:.6}to{opacity:.2}}@media print{#vue-devtools-anchor[data-v-19b8fd4e]{display:none}}
1
+ .vue-devtools-frame[data-v-df0df9e8]{position:fixed;z-index:2147483645}.vue-devtools-frame[data-v-df0df9e8] iframe{width:100%;height:100%;outline:none;background:var(--vue-devtools-widget-bg);border:1px solid rgba(125,125,125,.2);border-radius:10px}.vue-devtools-frame.view-mode-xs[data-v-df0df9e8]{width:400px!important;height:80px!important}.vue-devtools-frame.view-mode-fullscreen[data-v-df0df9e8]{width:100vw!important;height:100vh!important;z-index:1!important;bottom:0!important;transform:none!important}.vue-devtools-frame.view-mode-fullscreen[data-v-df0df9e8] iframe{border-radius:0!important}.vue-devtools-resize--horizontal[data-v-df0df9e8]{position:absolute;left:6px;right:6px;height:10px;margin:-5px 0;cursor:ns-resize;border-radius:5px}.vue-devtools-resize--vertical[data-v-df0df9e8]{position:absolute;top:6px;bottom:0;width:10px;margin:0 -5px;cursor:ew-resize;border-radius:5px}.vue-devtools-resize-corner[data-v-df0df9e8]{position:absolute;width:14px;height:14px;margin:-6px;border-radius:6px}.vue-devtools-resize[data-v-df0df9e8]:hover{background:#7d7d7d1a}.vue-devtools__anchor[data-v-a5b0a558]{position:fixed;z-index:2147483645;transform-origin:center center;transform:translate(-50%,-50%) rotate(0)}.vue-devtools__anchor.fullscreen[data-v-a5b0a558]{transform:none!important;left:0!important}.vue-devtools__anchor-btn[data-v-a5b0a558]{border-radius:100%;border-width:0;width:30px;height:30px;display:flex;justify-content:center;align-items:center;opacity:.8;transition:opacity .2s ease-in-out}.vue-devtools__anchor-btn[data-v-a5b0a558]:hover{opacity:1}.vue-devtools__anchor-btn svg[data-v-a5b0a558]{width:14px;height:14px}.vue-devtools__anchor-btn.active[data-v-a5b0a558]{cursor:pointer}.vue-devtools__anchor .panel-entry-btn[data-v-a5b0a558]{cursor:pointer;flex:none}.vue-devtools__anchor--vertical .panel-entry-btn[data-v-a5b0a558]{transform:rotate(-90deg)}.vue-devtools__anchor--vertical .vue-devtools__panel[data-v-a5b0a558]{transform:translate(-50%,-50%) rotate(90deg);box-shadow:2px -2px 8px var(--vue-devtools-widget-shadow)}.vue-devtools__anchor--hide .vue-devtools__panel[data-v-a5b0a558]{max-width:32px;padding:2px 0}.vue-devtools__anchor--hide .vue-devtools__panel-content[data-v-a5b0a558]{opacity:0}.vue-devtools__anchor--glowing[data-v-a5b0a558]{position:absolute;left:0;top:0;transform:translate(-50%,-50%);width:160px;height:160px;opacity:0;transition:all 1s ease;pointer-events:none;z-index:-1;border-radius:9999px;background-image:linear-gradient(45deg,#00dc82,#36e4da,#0047e1);filter:blur(60px)}.vue-devtools__anchor:hover .vue-devtools__anchor--glowing[data-v-a5b0a558]{opacity:.6}.vue-devtools__panel[data-v-a5b0a558]{position:absolute;left:0;top:0;transform:translate(-50%,-50%);display:flex;justify-content:flex-start;overflow:hidden;align-items:center;gap:2px;height:30px;padding:4px 4px 4px 5px;box-sizing:border-box;border:1px solid var(--vue-devtools-widget-border);border-radius:20px;background-color:var(--vue-devtools-widget-bg);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);color:var(--vue-devtools-widget-fg);box-shadow:2px 2px 8px var(--vue-devtools-widget-shadow);-webkit-user-select:none;user-select:none;max-width:150px;transition:max-width .4s ease,padding .5s ease,transform .3s ease,all .4s ease}.vue-devtools__panel-content[data-v-a5b0a558]{transition:opacity .4s ease}.vue-devtools__panel-divider[data-v-a5b0a558]{border-left:1px solid rgba(136,136,136,.2);width:1px;height:10px}@keyframes blink-a5b0a558{0%{opacity:.2}50%{opacity:.6}to{opacity:.2}}@media print{#vue-devtools-anchor[data-v-a5b0a558]{display:none}}