@vitejs/devtools 0.0.0-alpha.8 → 0.1.0
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/DockIcon-Jbdv1CYn.js +1720 -0
- package/dist/DockStandalone-Dd6Dcd5B.js +81 -0
- package/dist/LogItem-CfTxUV6A.js +204 -0
- package/dist/ToastOverlay-BVErqkif.js +1048 -0
- package/dist/ViewBuiltinLogs-DQLxnQ1c.js +427 -0
- package/dist/ViewBuiltinTerminals-B83FB-cT.js +10407 -0
- package/dist/cli-commands-DRp01A04.js +178 -0
- package/dist/cli-commands.d.ts +18 -0
- package/dist/cli-commands.js +3 -0
- package/dist/cli.js +5 -94
- package/dist/client/inject.js +170 -18
- package/dist/client/standalone/assets/DockStandalone-B8W-HO8N.js +1 -0
- package/dist/client/standalone/assets/LogItem-B-ayIBi6.js +1 -0
- package/dist/client/standalone/assets/ViewBuiltinLogs-B8M7lPbt.js +1 -0
- package/dist/client/standalone/assets/ViewBuiltinTerminals-Dkd5qdlN.js +36 -0
- package/dist/client/standalone/assets/dist-ZC9UAo6H.js +1 -0
- package/dist/client/standalone/assets/index-6F2y1lxr.css +1 -0
- package/dist/client/standalone/assets/index-odNIfapG.js +4 -0
- package/dist/client/standalone/index.html +5 -3
- package/dist/client/webcomponents.d.ts +21656 -30
- package/dist/client/webcomponents.js +305 -423
- package/dist/config.d.ts +25 -0
- package/dist/config.js +14 -0
- package/dist/dirs.js +7 -3
- package/dist/{dist-BuuUhVT5.js → dist-3NIYLDlS.js} +2261 -936
- package/dist/index.d.ts +256 -14
- package/dist/index.js +2 -4
- package/dist/plugins-6tW2SoNv.js +2115 -0
- package/dist/popup-EDv_a9nQ.js +358 -0
- package/dist/utils--qjmgani.js +6 -0
- package/package.json +51 -21
- package/dist/client/standalone/assets/index-DULlvzQC.css +0 -1
- package/dist/client/standalone/assets/index-Dpd5aqgb.js +0 -7
- package/dist/dirs-DcSK9l9L.js +0 -9
- package/dist/plugins-Cj9DSRH1.js +0 -1348
|
@@ -1,99 +1,123 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var css_default = "*{box-sizing:border-box;border-style:solid;border-width:0;border-color:var(--un-default-border-color,#e5e7eb)}:before{box-sizing:border-box;border-style:solid;border-width:0;border-color:var(--un-default-border-color,#e5e7eb)}:after{box-sizing:border-box;border-style:solid;border-width:0;border-color:var(--un-default-border-color,#e5e7eb)}:before{--un-content:\"\"}:after{--un-content:\"\"}html{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button{-webkit-appearance:button;background-color:transparent;background-image:none}[type=button]{-webkit-appearance:button;background-color:transparent;background-image:none}[type=reset]{-webkit-appearance:button;background-color:transparent;background-image:none}[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::placeholder{opacity:1;color:#9ca3af}textarea::placeholder{opacity:1;color:#9ca3af}button{cursor:pointer}[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--un-text-opacity:100%}.vite-devtools-resize-handle-horizontal{cursor:ns-resize;-webkit-border-radius:.375rem;border-radius:.375rem;height:10px;margin-top:-5px;margin-bottom:-5px;position:absolute;left:6px;right:6px}.vite-devtools-resize-handle-vertical{cursor:ew-resize;-webkit-border-radius:.375rem;border-radius:.375rem;width:10px;margin-left:-5px;margin-right:-5px;position:absolute;top:6px;bottom:0}.vite-devtools-resize-handle-corner{-webkit-border-radius:.375rem;border-radius:.375rem;width:14px;height:14px;margin:-6px;position:absolute}.vite-devtools-resize-handle{z-index:2147483645}.vite-devtools-resize-handle:hover{background-color:rgba(156,163,175,.1)}#vite-devtools-anchor{z-index:2147483645;box-sizing:border-box;transform-origin:50%;width:0;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-size:15px;position:fixed;transform:translate(-50%,-50%)rotate(0)}#vite-devtools-anchor #vite-devtools-dock-container{width:max-content;min-width:100px;height:44px;position:absolute;top:0;left:0;transform:translate(-50%,-50%)}#vite-devtools-anchor.vite-devtools-vertical #vite-devtools-dock-container{transition:all .6s,max-width .6s,padding .5s,transform .4s,opacity .2s;transform:translate(-50%,-50%)rotate(90deg)}#vite-devtools-anchor #vite-devtools-dock{touch-action:none;user-select:none;--vdt-border-opacity:.13;border-width:1px;border-color:rgba(136,136,136,var(--vdt-border-opacity));--vdt-backdrop-blur:blur(5px);min-width:100%;height:100%;backdrop-filter:var(--vdt-backdrop-blur)var(--vdt-backdrop-brightness)var(--vdt-backdrop-contrast)var(--vdt-backdrop-grayscale)var(--vdt-backdrop-hue-rotate)var(--vdt-backdrop-invert)var(--vdt-backdrop-opacity)var(--vdt-backdrop-saturate)var(--vdt-backdrop-sepia);--vdt-text-opacity:1;color:rgba(255,255,255,var(--vdt-text-opacity));--vdt-shadow:var(--vdt-shadow-inset)0 1px 3px 0 var(--vdt-shadow-color,rgba(0,0,0,.1)),var(--vdt-shadow-inset)0 1px 2px -1px var(--vdt-shadow-color,rgba(0,0,0,.1));box-shadow:var(--vdt-ring-offset-shadow),var(--vdt-ring-shadow),var(--vdt-shadow);background-color:rgba(255,255,255,.75);-webkit-border-radius:9999px;border-radius:9999px;padding-left:1rem;padding-right:1rem;transition:all .6s,max-width .6s,padding .5s,transform .4s,opacity .2s}@media (prefers-color-scheme:dark){#vite-devtools-anchor #vite-devtools-dock{background-color:rgba(17,17,17,.75)}}#vite-devtools-anchor.vite-devtools-minimized #vite-devtools-dock{width:52px;height:8px;padding:2px 0}#vite-devtools-anchor:hover #vite-devtools-glowing{opacity:.6}#vite-devtools-anchor #vite-devtools-glowing{pointer-events:none;z-index:-1;opacity:0;--vdt-blur:blur(60px);width:160px;height:160px;filter:var(--vdt-blur)var(--vdt-brightness)var(--vdt-contrast)var(--vdt-drop-shadow)var(--vdt-grayscale)var(--vdt-hue-rotate)var(--vdt-invert)var(--vdt-saturate)var(--vdt-sepia);background-image:linear-gradient(45deg,#61d9ff,#7a23a1,#715ebd);-webkit-border-radius:9999px;border-radius:9999px;transition-property:all;transition-duration:1s;transition-timing-function:cubic-bezier(0,0,.2,1);position:absolute;top:0;left:0;transform:translate(-50%,-50%)}@media print{#vite-devtools-anchor{display:none}}.vite-devtools-dock-label{--vdt-translate-x:-50%;transform:translateX(var(--vdt-translate-x))translateY(var(--vdt-translate-y))translateZ(var(--vdt-translate-z))rotate(var(--vdt-rotate))rotateX(var(--vdt-rotate-x))rotateY(var(--vdt-rotate-y))rotateZ(var(--vdt-rotate-z))skewX(var(--vdt-skew-x))skewY(var(--vdt-skew-y))scaleX(var(--vdt-scale-x))scaleY(var(--vdt-scale-y))scaleZ(var(--vdt-scale-z));bottom:-1.75rem;left:50%}.vite-devtools-vertical .vite-devtools-dock-label{--vdt-rotate-x:0;--vdt-rotate-y:0;--vdt-rotate-z:0;--vdt-rotate:270deg;transform:translateX(var(--vdt-translate-x))translateY(var(--vdt-translate-y))translateZ(var(--vdt-translate-z))rotate(var(--vdt-rotate))rotateX(var(--vdt-rotate-x))rotateY(var(--vdt-rotate-y))rotateZ(var(--vdt-rotate-z))skewX(var(--vdt-skew-x))skewY(var(--vdt-skew-y))scaleX(var(--vdt-scale-x))scaleY(var(--vdt-scale-y))scaleZ(var(--vdt-scale-z));bottom:-2.5rem}*{--vdt-rotate:0;--vdt-rotate-x:0;--vdt-rotate-y:0;--vdt-rotate-z:0;--vdt-scale-x:1;--vdt-scale-y:1;--vdt-scale-z:1;--vdt-skew-x:0;--vdt-skew-y:0;--vdt-translate-x:0;--vdt-translate-y:0;--vdt-translate-z:0;--vdt-pan-x: ;--vdt-pan-y: ;--vdt-pinch-zoom: ;--vdt-scroll-snap-strictness:proximity;--vdt-ordinal: ;--vdt-slashed-zero: ;--vdt-numeric-figure: ;--vdt-numeric-spacing: ;--vdt-numeric-fraction: ;--vdt-border-spacing-x:0;--vdt-border-spacing-y:0;--vdt-ring-offset-shadow:0 0 transparent;--vdt-ring-shadow:0 0 transparent;--vdt-shadow-inset: ;--vdt-shadow:0 0 transparent;--vdt-ring-inset: ;--vdt-ring-offset-width:0px;--vdt-ring-offset-color:#fff;--vdt-ring-width:0px;--vdt-ring-color:rgba(147,197,253,.5);--vdt-blur: ;--vdt-brightness: ;--vdt-contrast: ;--vdt-drop-shadow: ;--vdt-grayscale: ;--vdt-hue-rotate: ;--vdt-invert: ;--vdt-saturate: ;--vdt-sepia: ;--vdt-backdrop-blur: ;--vdt-backdrop-brightness: ;--vdt-backdrop-contrast: ;--vdt-backdrop-grayscale: ;--vdt-backdrop-hue-rotate: ;--vdt-backdrop-invert: ;--vdt-backdrop-opacity: ;--vdt-backdrop-saturate: ;--vdt-backdrop-sepia: }:before{--vdt-rotate:0;--vdt-rotate-x:0;--vdt-rotate-y:0;--vdt-rotate-z:0;--vdt-scale-x:1;--vdt-scale-y:1;--vdt-scale-z:1;--vdt-skew-x:0;--vdt-skew-y:0;--vdt-translate-x:0;--vdt-translate-y:0;--vdt-translate-z:0;--vdt-pan-x: ;--vdt-pan-y: ;--vdt-pinch-zoom: ;--vdt-scroll-snap-strictness:proximity;--vdt-ordinal: ;--vdt-slashed-zero: ;--vdt-numeric-figure: ;--vdt-numeric-spacing: ;--vdt-numeric-fraction: ;--vdt-border-spacing-x:0;--vdt-border-spacing-y:0;--vdt-ring-offset-shadow:0 0 transparent;--vdt-ring-shadow:0 0 transparent;--vdt-shadow-inset: ;--vdt-shadow:0 0 transparent;--vdt-ring-inset: ;--vdt-ring-offset-width:0px;--vdt-ring-offset-color:#fff;--vdt-ring-width:0px;--vdt-ring-color:rgba(147,197,253,.5);--vdt-blur: ;--vdt-brightness: ;--vdt-contrast: ;--vdt-drop-shadow: ;--vdt-grayscale: ;--vdt-hue-rotate: ;--vdt-invert: ;--vdt-saturate: ;--vdt-sepia: ;--vdt-backdrop-blur: ;--vdt-backdrop-brightness: ;--vdt-backdrop-contrast: ;--vdt-backdrop-grayscale: ;--vdt-backdrop-hue-rotate: ;--vdt-backdrop-invert: ;--vdt-backdrop-opacity: ;--vdt-backdrop-saturate: ;--vdt-backdrop-sepia: }:after{--vdt-rotate:0;--vdt-rotate-x:0;--vdt-rotate-y:0;--vdt-rotate-z:0;--vdt-scale-x:1;--vdt-scale-y:1;--vdt-scale-z:1;--vdt-skew-x:0;--vdt-skew-y:0;--vdt-translate-x:0;--vdt-translate-y:0;--vdt-translate-z:0;--vdt-pan-x: ;--vdt-pan-y: ;--vdt-pinch-zoom: ;--vdt-scroll-snap-strictness:proximity;--vdt-ordinal: ;--vdt-slashed-zero: ;--vdt-numeric-figure: ;--vdt-numeric-spacing: ;--vdt-numeric-fraction: ;--vdt-border-spacing-x:0;--vdt-border-spacing-y:0;--vdt-ring-offset-shadow:0 0 transparent;--vdt-ring-shadow:0 0 transparent;--vdt-shadow-inset: ;--vdt-shadow:0 0 transparent;--vdt-ring-inset: ;--vdt-ring-offset-width:0px;--vdt-ring-offset-color:#fff;--vdt-ring-width:0px;--vdt-ring-color:rgba(147,197,253,.5);--vdt-blur: ;--vdt-brightness: ;--vdt-contrast: ;--vdt-drop-shadow: ;--vdt-grayscale: ;--vdt-hue-rotate: ;--vdt-invert: ;--vdt-saturate: ;--vdt-sepia: ;--vdt-backdrop-blur: ;--vdt-backdrop-brightness: ;--vdt-backdrop-contrast: ;--vdt-backdrop-grayscale: ;--vdt-backdrop-hue-rotate: ;--vdt-backdrop-invert: ;--vdt-backdrop-opacity: ;--vdt-backdrop-saturate: ;--vdt-backdrop-sepia: }::backdrop{--vdt-rotate:0;--vdt-rotate-x:0;--vdt-rotate-y:0;--vdt-rotate-z:0;--vdt-scale-x:1;--vdt-scale-y:1;--vdt-scale-z:1;--vdt-skew-x:0;--vdt-skew-y:0;--vdt-translate-x:0;--vdt-translate-y:0;--vdt-translate-z:0;--vdt-pan-x: ;--vdt-pan-y: ;--vdt-pinch-zoom: ;--vdt-scroll-snap-strictness:proximity;--vdt-ordinal: ;--vdt-slashed-zero: ;--vdt-numeric-figure: ;--vdt-numeric-spacing: ;--vdt-numeric-fraction: ;--vdt-border-spacing-x:0;--vdt-border-spacing-y:0;--vdt-ring-offset-shadow:0 0 transparent;--vdt-ring-shadow:0 0 transparent;--vdt-shadow-inset: ;--vdt-shadow:0 0 transparent;--vdt-ring-inset: ;--vdt-ring-offset-width:0px;--vdt-ring-offset-color:#fff;--vdt-ring-width:0px;--vdt-ring-color:rgba(147,197,253,.5);--vdt-blur: ;--vdt-brightness: ;--vdt-contrast: ;--vdt-drop-shadow: ;--vdt-grayscale: ;--vdt-hue-rotate: ;--vdt-invert: ;--vdt-saturate: ;--vdt-sepia: ;--vdt-backdrop-blur: ;--vdt-backdrop-brightness: ;--vdt-backdrop-contrast: ;--vdt-backdrop-grayscale: ;--vdt-backdrop-hue-rotate: ;--vdt-backdrop-invert: ;--vdt-backdrop-opacity: ;--vdt-backdrop-saturate: ;--vdt-backdrop-sepia: }.container{width:100%}.border-base{--vdt-border-opacity:.13;border-color:rgba(136,136,136,var(--vdt-border-opacity))}.bg-glass{--vdt-backdrop-blur:blur(5px);backdrop-filter:var(--vdt-backdrop-blur)var(--vdt-backdrop-brightness)var(--vdt-backdrop-contrast)var(--vdt-backdrop-grayscale)var(--vdt-backdrop-hue-rotate)var(--vdt-backdrop-invert)var(--vdt-backdrop-opacity)var(--vdt-backdrop-saturate)var(--vdt-backdrop-sepia);background-color:rgba(255,255,255,.75)}@media (prefers-color-scheme:dark){.bg-glass{background-color:rgba(17,17,17,.75)}}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{top:0;bottom:0;left:0;right:0}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z--1{z-index:-1}.z-10{z-index:10}.h-5{height:1.25rem}.h-full{height:100%}.w-5{width:1.25rem}.w-full{width:100%}.w-max{width:max-content}.flex{display:flex}.rotate-270{--vdt-rotate-x:0;--vdt-rotate-y:0;--vdt-rotate-z:0;--vdt-rotate:270deg;transform:translateX(var(--vdt-translate-x))translateY(var(--vdt-translate-y))translateZ(var(--vdt-translate-z))rotate(var(--vdt-rotate))rotateX(var(--vdt-rotate-x))rotateY(var(--vdt-rotate-y))rotateZ(var(--vdt-rotate-z))skewX(var(--vdt-skew-x))skewY(var(--vdt-skew-y))scaleX(var(--vdt-scale-x))scaleY(var(--vdt-scale-y))scaleZ(var(--vdt-scale-z))}.scale-120{--vdt-scale-x:1.2;--vdt-scale-y:1.2;transform:translateX(var(--vdt-translate-x))translateY(var(--vdt-translate-y))translateZ(var(--vdt-translate-z))rotate(var(--vdt-rotate))rotateX(var(--vdt-rotate-x))rotateY(var(--vdt-rotate-y))rotateZ(var(--vdt-rotate-z))skewX(var(--vdt-skew-x))skewY(var(--vdt-skew-y))scaleX(var(--vdt-scale-x))scaleY(var(--vdt-scale-y))scaleZ(var(--vdt-scale-z))}.hover\\:scale-120:hover{--vdt-scale-x:1.2;--vdt-scale-y:1.2;transform:translateX(var(--vdt-translate-x))translateY(var(--vdt-translate-y))translateZ(var(--vdt-translate-z))rotate(var(--vdt-rotate))rotateX(var(--vdt-rotate-x))rotateY(var(--vdt-rotate-y))rotateZ(var(--vdt-rotate-z))skewX(var(--vdt-skew-x))skewY(var(--vdt-skew-y))scaleX(var(--vdt-scale-x))scaleY(var(--vdt-scale-y))scaleZ(var(--vdt-scale-z))}.transform{transform:translateX(var(--vdt-translate-x))translateY(var(--vdt-translate-y))translateZ(var(--vdt-translate-z))rotate(var(--vdt-rotate))rotateX(var(--vdt-rotate-x))rotateY(var(--vdt-rotate-y))rotateZ(var(--vdt-rotate-z))skewX(var(--vdt-skew-x))skewY(var(--vdt-skew-y))scaleX(var(--vdt-scale-x))scaleY(var(--vdt-scale-y))scaleZ(var(--vdt-scale-z))}.select-none{user-select:none}.resize{resize:both}.items-center{align-items:center}.justify-center{justify-content:center}.border{border-width:1px}.rounded{-webkit-border-radius:.25rem;border-radius:.25rem}.rounded-lg{-webkit-border-radius:.5rem;border-radius:.5rem}.rounded-xl{-webkit-border-radius:.75rem;border-radius:.75rem}.hover\\:bg-\\[\\#8881\\]:hover{--vdt-bg-opacity:.07;background-color:rgba(136,136,136,var(--vdt-bg-opacity))}.p1{padding:.25rem}.p1\\.5{padding:.375rem}.px{padding-left:1rem;padding-right:1rem}.px2{padding-left:.5rem;padding-right:.5rem}.text-xs{font-size:.75rem;line-height:1rem}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.op50{opacity:.5}.opacity-0{opacity:0}.opacity-100{opacity:1}.group:hover .group-hover\\:opacity-100{opacity:1}.shadow{--vdt-shadow:var(--vdt-shadow-inset)0 1px 3px 0 var(--vdt-shadow-color,rgba(0,0,0,.1)),var(--vdt-shadow-inset)0 1px 2px -1px var(--vdt-shadow-color,rgba(0,0,0,.1));box-shadow:var(--vdt-ring-offset-shadow),var(--vdt-ring-shadow),var(--vdt-shadow)}.saturate-0{--vdt-saturate:saturate(0);filter:var(--vdt-blur)var(--vdt-brightness)var(--vdt-contrast)var(--vdt-drop-shadow)var(--vdt-grayscale)var(--vdt-hue-rotate)var(--vdt-invert)var(--vdt-saturate)var(--vdt-sepia)}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}";
|
|
5
|
-
|
|
6
|
-
//#endregion
|
|
7
|
-
//#region src/client/webcomponents/components/DockIcon.vue
|
|
8
|
-
const _hoisted_1$2 = ["src", "alt"];
|
|
9
|
-
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
10
|
-
__name: "DockIcon",
|
|
11
|
-
props: {
|
|
12
|
-
icon: {},
|
|
13
|
-
title: {}
|
|
14
|
-
},
|
|
15
|
-
setup(__props) {
|
|
16
|
-
function getIconUrl(str, color) {
|
|
17
|
-
if (str.includes("/")) return str;
|
|
18
|
-
const match = str.match(/^([\w-]+):([\w-]+)$/);
|
|
19
|
-
if (match) {
|
|
20
|
-
const [, collection, icon] = match;
|
|
21
|
-
return `https://api.iconify.design/${collection}/${icon}.svg${color === "dark" ? "?color=%23eee" : "?color=%23111"}`;
|
|
22
|
-
}
|
|
23
|
-
return str;
|
|
24
|
-
}
|
|
25
|
-
return (_ctx, _cache) => {
|
|
26
|
-
return openBlock(), createElementBlock("img", {
|
|
27
|
-
src: getIconUrl(__props.icon, "dark"),
|
|
28
|
-
alt: __props.title,
|
|
29
|
-
draggable: "false"
|
|
30
|
-
}, null, 8, _hoisted_1$2);
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
var DockIcon_default = _sfc_main$7;
|
|
35
|
-
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region src/client/webcomponents/components/DockEntries.vue
|
|
38
|
-
const _hoisted_1$1 = { class: "vite-devtools-dock-entries flex items-center w-full h-full justify-center transition-opacity duration-300" };
|
|
39
|
-
const _hoisted_2 = ["title", "onClick"];
|
|
40
|
-
const _hoisted_3 = { class: "vite-devtools-dock-label text-xs group-hover:opacity-100 opacity-0 transition-opacity duration-300 w-max bg-glass border border-base z-10 rounded px2 absolute p1" };
|
|
1
|
+
import { B as withDirectives, C as createElementBlock, E as createVNode, F as renderSlot, G as toRefs, H as reactive, I as useTemplateRef, J as normalizeStyle, K as unref, L as watch, M as onUnmounted, N as openBlock, O as defineComponent, R as watchEffect, S as createCommentVNode, U as ref, V as markRaw, _ as Fragment, a as useScreenSafeArea, b as createBaseVNode, f as defineCustomElement, g as withModifiers, j as onMounted, k as h, l as watchDebounced, m as vShow, n as useElementBounding, q as normalizeClass, r as useEventListener, s as useWindowSize, x as createBlock, y as computed, z as withCtx } from "../dist-3NIYLDlS.js";
|
|
2
|
+
import { _ as useDocksEntries, f as useDocksOverflowPanel, g as sharedStateToRef, h as createDockEntryState, l as setDocksOverflowPanel, m as DEFAULT_DOCK_PANEL_STORE, n as filterPopupDockEntry, r as isDockPopupEntryVisible, s as useIsDockPopupOpen, t as closeDockPopup, x as BUILTIN_ENTRY_CLIENT_AUTH_NOTICE, y as docksSplitGroupsWithCapacity } from "../popup-EDv_a9nQ.js";
|
|
3
|
+
import { c as _sfc_main$7, d as css_default, l as _sfc_main$8, n as _sfc_main$10, o as PersistedDomHolder, r as _sfc_main$9, s as PersistedDomViewsManager, t as _sfc_main$11, u as openDockContextMenu } from "../ToastOverlay-BVErqkif.js";
|
|
4
|
+
import { n as VitePlusCore_default, r as export_helper_default } from "../DockIcon-Jbdv1CYn.js";
|
|
5
|
+
//#region src/client/webcomponents/components/DockOverflowButton.vue
|
|
41
6
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
42
|
-
__name: "
|
|
7
|
+
__name: "DockOverflowButton",
|
|
43
8
|
props: {
|
|
44
|
-
|
|
9
|
+
context: {},
|
|
45
10
|
isVertical: { type: Boolean },
|
|
46
|
-
|
|
11
|
+
groups: {},
|
|
12
|
+
selected: {}
|
|
47
13
|
},
|
|
48
14
|
emits: ["select"],
|
|
49
15
|
setup(__props, { emit: __emit }) {
|
|
50
16
|
const props = __props;
|
|
51
17
|
const emit = __emit;
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
18
|
+
const overflowButton = useTemplateRef("overflowButton");
|
|
19
|
+
const overflowBadge = computed(() => {
|
|
20
|
+
const count = props.groups.reduce((acc, [_, items]) => acc + items.length, 0);
|
|
21
|
+
if (count > 9) return "9+";
|
|
22
|
+
return count.toString();
|
|
23
|
+
});
|
|
24
|
+
const isOverflowPanelVisible = ref(false);
|
|
25
|
+
const docksOverflowPanel = useDocksOverflowPanel();
|
|
26
|
+
function showOverflowPanel() {
|
|
27
|
+
if (!overflowButton.value) return;
|
|
28
|
+
isOverflowPanelVisible.value = true;
|
|
29
|
+
setDocksOverflowPanel({
|
|
30
|
+
content: () => h("div", { class: "flex gap-0 flex-wrap max-w-220px" }, [h(_sfc_main$7, {
|
|
31
|
+
context: props.context,
|
|
32
|
+
groups: props.groups,
|
|
33
|
+
isVertical: false,
|
|
34
|
+
selected: props.selected,
|
|
35
|
+
onSelect: (e) => emit("select", e)
|
|
36
|
+
})]),
|
|
37
|
+
el: overflowButton.value
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
watchDebounced(() => docksOverflowPanel.value, (value) => {
|
|
41
|
+
isOverflowPanelVisible.value = !!value;
|
|
42
|
+
}, { debounce: 1e3 });
|
|
43
|
+
function toggleOverflowPanel() {
|
|
44
|
+
if (isOverflowPanelVisible.value) hideOverflowPanel();
|
|
45
|
+
else showOverflowPanel();
|
|
46
|
+
}
|
|
47
|
+
function hideOverflowPanel() {
|
|
48
|
+
isOverflowPanelVisible.value = false;
|
|
49
|
+
setDocksOverflowPanel(null);
|
|
56
50
|
}
|
|
57
51
|
return (_ctx, _cache) => {
|
|
58
|
-
return openBlock(), createElementBlock("div",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
52
|
+
return openBlock(), createElementBlock("div", {
|
|
53
|
+
ref_key: "overflowButton",
|
|
54
|
+
ref: overflowButton
|
|
55
|
+
}, [createVNode(_sfc_main$8, {
|
|
56
|
+
context: __props.context,
|
|
57
|
+
dock: {
|
|
58
|
+
id: "overflow",
|
|
59
|
+
title: "Overflow",
|
|
60
|
+
icon: "ph:dots-three-circle-duotone"
|
|
61
|
+
},
|
|
62
|
+
class: "overflow-button",
|
|
63
|
+
tooltip: false,
|
|
64
|
+
badge: overflowBadge.value,
|
|
65
|
+
"is-vertical": __props.isVertical,
|
|
66
|
+
"is-selected": false,
|
|
67
|
+
"is-dimmed": false,
|
|
68
|
+
onClick: toggleOverflowPanel
|
|
69
|
+
}, null, 8, [
|
|
70
|
+
"context",
|
|
71
|
+
"badge",
|
|
72
|
+
"is-vertical"
|
|
73
|
+
])], 512);
|
|
72
74
|
};
|
|
73
75
|
}
|
|
74
76
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/client/webcomponents/components/icons/BracketLeft.vue
|
|
79
|
+
const _sfc_main$5 = {};
|
|
80
|
+
const _hoisted_1$2 = {
|
|
81
|
+
viewBox: "0 0 9 20",
|
|
82
|
+
fill: "none",
|
|
83
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
84
|
+
};
|
|
85
|
+
function _sfc_render$1(_ctx, _cache) {
|
|
86
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$2, [..._cache[0] || (_cache[0] = [createBaseVNode("path", {
|
|
87
|
+
d: "M4.95763 0C1.02563 5.628 1.00263 14.351 4.95763 20H7.61363C3.65963 14.35 3.68363 5.627 7.61363 0H4.95763Z",
|
|
88
|
+
class: "fill-black dark:fill-white"
|
|
89
|
+
}, null, -1)])]);
|
|
90
|
+
}
|
|
91
|
+
var BracketLeft_default = /* @__PURE__ */ export_helper_default(_sfc_main$5, [["render", _sfc_render$1]]);
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/client/webcomponents/components/icons/BracketRight.vue
|
|
94
|
+
const _sfc_main$4 = {};
|
|
95
|
+
const _hoisted_1$1 = {
|
|
96
|
+
viewBox: "0 0 9 20",
|
|
97
|
+
fill: "none",
|
|
98
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
99
|
+
};
|
|
100
|
+
function _sfc_render(_ctx, _cache) {
|
|
101
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$1, [..._cache[0] || (_cache[0] = [createBaseVNode("path", {
|
|
102
|
+
d: "M4.246 10H6.903C6.902 6.407 5.913 2.816 3.946 0H1.29C3.256 2.816 4.244 6.407 4.246 10ZM8.935 14.907H6.27C6.46624 14.1665 6.61752 13.4148 6.723 12.656H4.066C3.96052 13.4148 3.80924 14.1665 3.613 14.907H0.944C0.703507 15.8176 0.387753 16.7067 0 17.565H2.669C2.2859 18.4179 1.82388 19.2331 1.289 20H3.945C4.47988 19.2331 4.9419 18.4179 5.325 17.565H7.99C8.376 16.714 8.691 15.823 8.935 14.907Z",
|
|
103
|
+
class: "fill-black dark:fill-white"
|
|
104
|
+
}, null, -1)])]);
|
|
105
|
+
}
|
|
106
|
+
var BracketRight_default = /* @__PURE__ */ export_helper_default(_sfc_main$4, [["render", _sfc_render]]);
|
|
77
107
|
//#endregion
|
|
78
108
|
//#region src/client/webcomponents/components/Dock.vue
|
|
79
|
-
const
|
|
109
|
+
const _hoisted_1 = {
|
|
110
|
+
key: 0,
|
|
111
|
+
class: "i-fluent-emoji-flat-warning absolute bottom-0 right--1px w-1.5 h-1.5"
|
|
112
|
+
};
|
|
113
|
+
const _hoisted_2 = { class: "flex items-center gap-1" };
|
|
114
|
+
const PANEL_MARGIN = 2;
|
|
80
115
|
const SNAP_THRESHOLD = 2;
|
|
81
|
-
const _sfc_main$
|
|
116
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
82
117
|
__name: "Dock",
|
|
83
|
-
props:
|
|
84
|
-
state: {},
|
|
85
|
-
docks: {}
|
|
86
|
-
}, {
|
|
87
|
-
"isDragging": {
|
|
88
|
-
type: Boolean,
|
|
89
|
-
default: false
|
|
90
|
-
},
|
|
91
|
-
"isDraggingModifiers": {}
|
|
92
|
-
}),
|
|
93
|
-
emits: ["update:isDragging"],
|
|
118
|
+
props: { context: {} },
|
|
94
119
|
setup(__props) {
|
|
95
|
-
const
|
|
96
|
-
const isDragging = useModel(__props, "isDragging");
|
|
120
|
+
const context = __props.context;
|
|
97
121
|
const isSafari = navigator.userAgent.includes("Safari") && !navigator.userAgent.includes("Chrome");
|
|
98
122
|
const panelMargins = reactive({
|
|
99
123
|
left: PANEL_MARGIN,
|
|
@@ -115,6 +139,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
115
139
|
});
|
|
116
140
|
const dockEl = useTemplateRef("dockEl");
|
|
117
141
|
const anchorEl = useTemplateRef("anchorEl");
|
|
142
|
+
const recalculateCounter = ref(0);
|
|
143
|
+
const isHovering = ref(false);
|
|
118
144
|
const windowSize = reactive({
|
|
119
145
|
width: window.innerWidth,
|
|
120
146
|
height: window.innerHeight
|
|
@@ -129,12 +155,28 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
129
155
|
});
|
|
130
156
|
function onPointerDown(e) {
|
|
131
157
|
if (!dockEl.value) return;
|
|
132
|
-
isDragging
|
|
158
|
+
context.panel.isDragging = true;
|
|
133
159
|
const { left, top, width, height } = dockEl.value.getBoundingClientRect();
|
|
134
160
|
draggingOffset.x = e.clientX - left - width / 2;
|
|
135
161
|
draggingOffset.y = e.clientY - top - height / 2;
|
|
136
162
|
}
|
|
137
|
-
|
|
163
|
+
const isRpcTrusted = ref(context.rpc.isTrusted);
|
|
164
|
+
context.rpc.events.on("rpc:is-trusted:updated", (isTrusted) => {
|
|
165
|
+
isRpcTrusted.value = isTrusted;
|
|
166
|
+
if (isTrusted && context.docks.selected?.id === BUILTIN_ENTRY_CLIENT_AUTH_NOTICE.id) context.docks.switchEntry(null);
|
|
167
|
+
});
|
|
168
|
+
const isPopupEntryVisible = computed(() => isDockPopupEntryVisible(context.clientType));
|
|
169
|
+
const groupedEntries = computed(() => {
|
|
170
|
+
if (isPopupEntryVisible.value) return context.docks.groupedEntries;
|
|
171
|
+
return filterPopupDockEntry(context.docks.groupedEntries);
|
|
172
|
+
});
|
|
173
|
+
const splitEntries = computed(() => {
|
|
174
|
+
return docksSplitGroupsWithCapacity(groupedEntries.value, 5);
|
|
175
|
+
});
|
|
176
|
+
const selectedEntry = computed(() => {
|
|
177
|
+
return context.docks.selected;
|
|
178
|
+
});
|
|
179
|
+
onMounted(async () => {
|
|
138
180
|
windowSize.width = window.innerWidth;
|
|
139
181
|
windowSize.height = window.innerHeight;
|
|
140
182
|
useEventListener(window, "resize", () => {
|
|
@@ -142,7 +184,8 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
142
184
|
windowSize.height = window.innerHeight;
|
|
143
185
|
});
|
|
144
186
|
useEventListener(window, "pointermove", (e) => {
|
|
145
|
-
if (!isDragging
|
|
187
|
+
if (!context.panel.isDragging) return;
|
|
188
|
+
const store = context.panel.store;
|
|
146
189
|
const centerX = window.innerWidth / 2;
|
|
147
190
|
const centerY = window.innerHeight / 2;
|
|
148
191
|
const x = e.clientX - draggingOffset.x;
|
|
@@ -156,15 +199,15 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
156
199
|
const TR = Math.atan2(0 - centerY + HORIZONTAL_MARGIN, window.innerWidth - centerX);
|
|
157
200
|
const BL = Math.atan2(window.innerHeight - HORIZONTAL_MARGIN - centerY, 0 - centerX);
|
|
158
201
|
const BR = Math.atan2(window.innerHeight - HORIZONTAL_MARGIN - centerY, window.innerWidth - centerX);
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
202
|
+
store.position = deg >= TL && deg <= TR ? "top" : deg >= TR && deg <= BR ? "right" : deg >= BR && deg <= BL ? "bottom" : "left";
|
|
203
|
+
store.left = snapToPoints(x / window.innerWidth * 100);
|
|
204
|
+
store.top = snapToPoints(y / window.innerHeight * 100);
|
|
162
205
|
});
|
|
163
206
|
useEventListener(window, "pointerup", () => {
|
|
164
|
-
isDragging
|
|
207
|
+
context.panel.isDragging = false;
|
|
165
208
|
});
|
|
166
209
|
useEventListener(window, "pointerleave", () => {
|
|
167
|
-
isDragging
|
|
210
|
+
context.panel.isDragging = false;
|
|
168
211
|
});
|
|
169
212
|
});
|
|
170
213
|
function snapToPoints(value) {
|
|
@@ -176,16 +219,14 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
176
219
|
function clamp(value, min, max) {
|
|
177
220
|
return Math.min(Math.max(value, min), max);
|
|
178
221
|
}
|
|
179
|
-
const recalculateCounter = ref(0);
|
|
180
|
-
const isHovering = ref(false);
|
|
181
|
-
const isVertical = computed(() => state.value.position === "left" || state.value.position === "right");
|
|
182
222
|
const anchorPos = computed(() => {
|
|
183
223
|
recalculateCounter.value;
|
|
224
|
+
const store = context.panel.store;
|
|
184
225
|
const halfWidth = (dockEl.value?.clientWidth || 0) / 2;
|
|
185
226
|
const halfHeight = (dockEl.value?.clientHeight || 0) / 2;
|
|
186
|
-
const left =
|
|
187
|
-
const top =
|
|
188
|
-
switch (
|
|
227
|
+
const left = store.left * windowSize.width / 100;
|
|
228
|
+
const top = store.top * windowSize.height / 100;
|
|
229
|
+
switch (store.position) {
|
|
189
230
|
case "top": return {
|
|
190
231
|
left: clamp(left, halfWidth + panelMargins.left, windowSize.width - halfWidth - panelMargins.right),
|
|
191
232
|
top: panelMargins.top + halfHeight
|
|
@@ -198,7 +239,6 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
198
239
|
left: panelMargins.left + halfHeight,
|
|
199
240
|
top: clamp(top, halfWidth + panelMargins.top, windowSize.height - halfWidth - panelMargins.bottom)
|
|
200
241
|
};
|
|
201
|
-
case "bottom":
|
|
202
242
|
default: return {
|
|
203
243
|
left: clamp(left, halfWidth + panelMargins.left, windowSize.width - halfWidth - panelMargins.right),
|
|
204
244
|
top: windowSize.height - panelMargins.bottom - halfHeight
|
|
@@ -208,18 +248,18 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
208
248
|
let _timer = null;
|
|
209
249
|
function bringUp() {
|
|
210
250
|
isHovering.value = true;
|
|
211
|
-
if (
|
|
251
|
+
if (context.panel.store.inactiveTimeout < 0) return;
|
|
212
252
|
if (_timer) clearTimeout(_timer);
|
|
213
253
|
_timer = setTimeout(() => {
|
|
214
254
|
isHovering.value = false;
|
|
215
|
-
}, +
|
|
255
|
+
}, +context.panel.store.inactiveTimeout || 0);
|
|
216
256
|
}
|
|
217
257
|
const isHidden = computed(() => false);
|
|
218
258
|
const isMinimized = computed(() => {
|
|
219
|
-
if (
|
|
220
|
-
if (
|
|
259
|
+
if (context.panel.store.inactiveTimeout < 0) return false;
|
|
260
|
+
if (context.panel.store.inactiveTimeout === 0) return true;
|
|
221
261
|
const isTouchDevice = "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
|
|
222
|
-
return !isDragging
|
|
262
|
+
return !context.panel.isDragging && !context.panel.store.open && !isHovering.value && !isTouchDevice && context.panel.store.inactiveTimeout;
|
|
223
263
|
});
|
|
224
264
|
const anchorStyle = computed(() => {
|
|
225
265
|
return {
|
|
@@ -229,32 +269,17 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
229
269
|
};
|
|
230
270
|
});
|
|
231
271
|
const panelStyle = computed(() => {
|
|
232
|
-
const style = { transform: isVertical
|
|
272
|
+
const style = { transform: context.panel.isVertical ? `translate(-50%, -50%) rotate(90deg)` : `translate(-50%, -50%)` };
|
|
233
273
|
if (isHidden.value) {
|
|
234
274
|
style.opacity = 0;
|
|
235
275
|
style.pointerEvents = "none";
|
|
236
276
|
}
|
|
237
|
-
if (isDragging
|
|
277
|
+
if (context.panel.isDragging) style.transition = "none !important";
|
|
238
278
|
return style;
|
|
239
279
|
});
|
|
240
|
-
function importScript(entry) {
|
|
241
|
-
return import(
|
|
242
|
-
/* @vite-ignore */
|
|
243
|
-
entry.importFrom
|
|
244
|
-
).then((module) => {
|
|
245
|
-
return module[entry.importName || "default"];
|
|
246
|
-
}).catch((error) => {
|
|
247
|
-
console.error("[VITE DEVTOOLS] Error importing action", error);
|
|
248
|
-
return Promise.reject(error);
|
|
249
|
-
});
|
|
250
|
-
}
|
|
251
|
-
function onSelected(entry) {
|
|
252
|
-
if (entry?.type === "action") return importScript(entry.import).then((fn) => fn());
|
|
253
|
-
state.value.dockEntry = entry;
|
|
254
|
-
if ("import" in entry && entry.import) importScript(entry.import);
|
|
255
|
-
}
|
|
256
280
|
onMounted(() => {
|
|
257
|
-
|
|
281
|
+
if (context.panel.store.open && !isRpcTrusted.value) context.panel.store.open = false;
|
|
282
|
+
if (isRpcTrusted.value) bringUp();
|
|
258
283
|
recalculateCounter.value++;
|
|
259
284
|
});
|
|
260
285
|
return (_ctx, _cache) => {
|
|
@@ -263,18 +288,24 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
263
288
|
ref_key: "anchorEl",
|
|
264
289
|
ref: anchorEl,
|
|
265
290
|
style: normalizeStyle([anchorStyle.value]),
|
|
266
|
-
class: normalizeClass({
|
|
267
|
-
"vite-devtools-horizontal": !isVertical
|
|
268
|
-
"vite-devtools-vertical": isVertical
|
|
291
|
+
class: normalizeClass([{
|
|
292
|
+
"vite-devtools-horizontal": !unref(context).panel.isVertical,
|
|
293
|
+
"vite-devtools-vertical": unref(context).panel.isVertical,
|
|
269
294
|
"vite-devtools-minimized": isMinimized.value
|
|
270
|
-
}),
|
|
295
|
+
}, "color-base"]),
|
|
271
296
|
onMousemove: bringUp
|
|
272
297
|
}, [
|
|
273
298
|
!unref(isSafari) ? (openBlock(), createElementBlock("div", {
|
|
274
299
|
key: 0,
|
|
275
300
|
id: "vite-devtools-glowing",
|
|
276
|
-
|
|
277
|
-
}, null,
|
|
301
|
+
class: normalizeClass(unref(context).panel.isDragging ? "op60!" : "")
|
|
302
|
+
}, null, 2)) : createCommentVNode("v-if", true),
|
|
303
|
+
renderSlot(_ctx.$slots, "default", {
|
|
304
|
+
context: unref(context),
|
|
305
|
+
dockEl: dockEl.value,
|
|
306
|
+
selected: unref(context).docks.selected,
|
|
307
|
+
panelMargins
|
|
308
|
+
}),
|
|
278
309
|
createBaseVNode("div", {
|
|
279
310
|
id: "vite-devtools-dock-container",
|
|
280
311
|
ref_key: "dockEl",
|
|
@@ -283,71 +314,76 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
283
314
|
}, [createBaseVNode("div", {
|
|
284
315
|
id: "vite-devtools-dock",
|
|
285
316
|
onPointerdown: onPointerDown
|
|
286
|
-
}, [
|
|
287
|
-
|
|
288
|
-
class: normalizeClass(
|
|
289
|
-
"
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
"
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
"
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
317
|
+
}, [
|
|
318
|
+
createVNode(BracketLeft_default, { class: "vite-devtools-dock-bracket absolute left--1 top-1/2 translate-y--1/2 bottom-0 w-2.5 op75 transition-opacity duration-300" }),
|
|
319
|
+
createVNode(BracketRight_default, { class: normalizeClass(["vite-devtools-dock-bracket absolute right--1 top-1/2 translate-y--1/2 bottom-0 w-2.5 op75 transition-opacity duration-300", unref(context).panel.isVertical ? "scale-y--100" : ""]) }, null, 8, ["class"]),
|
|
320
|
+
createBaseVNode("div", { class: normalizeClass(["w-3 h-3 absolute left-1/2 top-1/2 translate-x--1/2 translate-y--1/2 transition-opacity duration-300", [isMinimized.value ? "op100" : "op0", unref(context).panel.isVertical ? "rotate-270" : "rotate-0"]]) }, [createVNode(VitePlusCore_default), !isRpcTrusted.value ? (openBlock(), createElementBlock("div", _hoisted_1)) : createCommentVNode("v-if", true)], 2),
|
|
321
|
+
!isRpcTrusted.value ? (openBlock(), createElementBlock("div", {
|
|
322
|
+
key: 0,
|
|
323
|
+
class: normalizeClass(["transition duration-300 delay-200", isMinimized.value ? "opacity-0 pointer-events-none ws-nowrap text-sm text-orange of-hidden" : "opacity-100"])
|
|
324
|
+
}, [createBaseVNode("button", {
|
|
325
|
+
class: "p2 transition hover:bg-active rounded-full px4",
|
|
326
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(context).docks.toggleEntry(unref(BUILTIN_ENTRY_CLIENT_AUTH_NOTICE).id))
|
|
327
|
+
}, [createBaseVNode("div", _hoisted_2, [createBaseVNode("div", { class: normalizeClass(["i-fluent-emoji-flat-warning flex-none", unref(context).panel.isVertical ? "rotate-270" : "rotate-0"]) }, null, 2), _cache[3] || (_cache[3] = createBaseVNode("div", { class: "ws-nowrap text-amber" }, " Unauthorized ", -1))])])], 2)) : createCommentVNode("v-if", true),
|
|
328
|
+
createBaseVNode("div", { class: normalizeClass([isMinimized.value ? "opacity-0 pointer-events-none" : "opacity-100", "transition duration-200 flex items-center w-full h-full justify-center px3"]) }, [createVNode(_sfc_main$7, {
|
|
329
|
+
context: unref(context),
|
|
330
|
+
groups: splitEntries.value.visible,
|
|
331
|
+
"is-vertical": unref(context).panel.isVertical,
|
|
332
|
+
selected: selectedEntry.value,
|
|
333
|
+
onSelect: _cache[1] || (_cache[1] = (e) => unref(context).docks.switchEntry(e?.id))
|
|
334
|
+
}, null, 8, [
|
|
335
|
+
"context",
|
|
336
|
+
"groups",
|
|
337
|
+
"is-vertical",
|
|
338
|
+
"selected"
|
|
339
|
+
]), splitEntries.value.overflow.length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[4] || (_cache[4] = createBaseVNode("div", { class: "border-base m1 h-20px w-px border-r-1.5" }, null, -1)), createVNode(_sfc_main$6, {
|
|
340
|
+
context: unref(context),
|
|
341
|
+
"is-vertical": unref(context).panel.isVertical,
|
|
342
|
+
groups: splitEntries.value.overflow,
|
|
343
|
+
selected: selectedEntry.value,
|
|
344
|
+
onSelect: _cache[2] || (_cache[2] = (e) => unref(context).docks.switchEntry(e?.id))
|
|
345
|
+
}, null, 8, [
|
|
346
|
+
"context",
|
|
347
|
+
"is-vertical",
|
|
348
|
+
"groups",
|
|
349
|
+
"selected"
|
|
350
|
+
])], 64)) : createCommentVNode("v-if", true)], 2)
|
|
351
|
+
], 32)], 4)
|
|
304
352
|
], 38);
|
|
305
353
|
};
|
|
306
354
|
}
|
|
307
355
|
});
|
|
308
|
-
var Dock_default = _sfc_main$5;
|
|
309
|
-
|
|
310
356
|
//#endregion
|
|
311
357
|
//#region src/client/webcomponents/components/DockPanelResizer.vue
|
|
312
358
|
const PANEL_MIN = 20;
|
|
313
359
|
const PANEL_MAX = 100;
|
|
314
|
-
const _sfc_main$
|
|
360
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
315
361
|
__name: "DockPanelResizer",
|
|
316
|
-
props:
|
|
317
|
-
state: {},
|
|
318
|
-
isDragging: { type: Boolean }
|
|
319
|
-
}, {
|
|
320
|
-
"isResizing": {
|
|
321
|
-
type: Boolean,
|
|
322
|
-
default: false
|
|
323
|
-
},
|
|
324
|
-
"isResizingModifiers": {}
|
|
325
|
-
}),
|
|
326
|
-
emits: ["update:isResizing"],
|
|
362
|
+
props: { panel: {} },
|
|
327
363
|
setup(__props) {
|
|
328
364
|
const props = __props;
|
|
329
|
-
const
|
|
330
|
-
const
|
|
331
|
-
const container = ref();
|
|
365
|
+
const topHandle = useTemplateRef("topHandle");
|
|
366
|
+
const container = computed(() => topHandle.value?.parentElement);
|
|
332
367
|
const resizingState = ref(false);
|
|
333
368
|
function handleResize(e) {
|
|
334
369
|
if (!resizingState.value) return;
|
|
335
370
|
const box = container.value?.getBoundingClientRect();
|
|
336
371
|
if (!box) return;
|
|
372
|
+
const store = props.panel.store;
|
|
337
373
|
let widthPx, heightPx;
|
|
338
374
|
if (resizingState.value.right) {
|
|
339
375
|
widthPx = Math.abs(e instanceof MouseEvent ? e.clientX : (e.touches[0]?.clientX || 0) - (box?.left || 0));
|
|
340
|
-
|
|
376
|
+
store.width = Math.min(PANEL_MAX, Math.max(PANEL_MIN, widthPx / window.innerWidth * 100));
|
|
341
377
|
} else if (resizingState.value.left) {
|
|
342
378
|
widthPx = Math.abs((box?.right || 0) - (e instanceof MouseEvent ? e.clientX : e.touches[0]?.clientX || 0));
|
|
343
|
-
|
|
379
|
+
store.width = Math.min(PANEL_MAX, Math.max(PANEL_MIN, widthPx / window.innerWidth * 100));
|
|
344
380
|
}
|
|
345
381
|
if (resizingState.value.top) {
|
|
346
382
|
heightPx = Math.abs((box?.bottom || 0) - (e instanceof MouseEvent ? e.clientY : e.touches[0]?.clientY || 0));
|
|
347
|
-
|
|
383
|
+
store.height = Math.min(PANEL_MAX, Math.max(PANEL_MIN, heightPx / window.innerHeight * 100));
|
|
348
384
|
} else if (resizingState.value.bottom) {
|
|
349
385
|
heightPx = Math.abs(e instanceof MouseEvent ? e.clientY : (e.touches[0]?.clientY || 0) - (box?.top || 0));
|
|
350
|
-
|
|
386
|
+
store.height = Math.min(PANEL_MAX, Math.max(PANEL_MIN, heightPx / window.innerHeight * 100));
|
|
351
387
|
}
|
|
352
388
|
}
|
|
353
389
|
useEventListener(window, "mousemove", handleResize);
|
|
@@ -356,40 +392,37 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
356
392
|
useEventListener(window, "touchend", () => resizingState.value = false);
|
|
357
393
|
useEventListener(window, "mouseleave", () => resizingState.value = false);
|
|
358
394
|
watch(resizingState, (value) => {
|
|
359
|
-
isResizing
|
|
395
|
+
props.panel.isResizing = !!value;
|
|
360
396
|
}, { flush: "sync" });
|
|
361
397
|
return (_ctx, _cache) => {
|
|
362
|
-
return openBlock(), createElementBlock(
|
|
363
|
-
id: "vite-devtools-resize-container",
|
|
364
|
-
ref_key: "container",
|
|
365
|
-
ref: container,
|
|
366
|
-
class: "w-full h-full absolute left-0 right-0 bottom-0 top-0 antialiased"
|
|
367
|
-
}, [
|
|
398
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
368
399
|
createCommentVNode(" Handlers "),
|
|
369
400
|
withDirectives(createBaseVNode("div", {
|
|
401
|
+
ref_key: "topHandle",
|
|
402
|
+
ref: topHandle,
|
|
370
403
|
class: "vite-devtools-resize-handle vite-devtools-resize-handle-horizontal",
|
|
371
404
|
style: { top: 0 },
|
|
372
405
|
onMousedown: _cache[0] || (_cache[0] = withModifiers(($event) => resizingState.value = { top: true }, ["prevent"])),
|
|
373
406
|
onTouchstartPassive: _cache[1] || (_cache[1] = () => resizingState.value = { top: true })
|
|
374
|
-
}, null, 544), [[vShow,
|
|
407
|
+
}, null, 544), [[vShow, __props.panel.store.position !== "top"]]),
|
|
375
408
|
withDirectives(createBaseVNode("div", {
|
|
376
409
|
class: "vite-devtools-resize-handle vite-devtools-resize-handle-horizontal",
|
|
377
410
|
style: { bottom: 0 },
|
|
378
411
|
onMousedown: _cache[2] || (_cache[2] = withModifiers(() => resizingState.value = { bottom: true }, ["prevent"])),
|
|
379
412
|
onTouchstartPassive: _cache[3] || (_cache[3] = () => resizingState.value = { bottom: true })
|
|
380
|
-
}, null, 544), [[vShow,
|
|
413
|
+
}, null, 544), [[vShow, __props.panel.store.position !== "bottom"]]),
|
|
381
414
|
withDirectives(createBaseVNode("div", {
|
|
382
415
|
class: "vite-devtools-resize-handle vite-devtools-resize-handle-vertical",
|
|
383
416
|
style: { left: 0 },
|
|
384
417
|
onMousedown: _cache[4] || (_cache[4] = withModifiers(() => resizingState.value = { left: true }, ["prevent"])),
|
|
385
418
|
onTouchstartPassive: _cache[5] || (_cache[5] = () => resizingState.value = { left: true })
|
|
386
|
-
}, null, 544), [[vShow,
|
|
419
|
+
}, null, 544), [[vShow, __props.panel.store.position !== "left"]]),
|
|
387
420
|
withDirectives(createBaseVNode("div", {
|
|
388
421
|
class: "vite-devtools-resize-handle vite-devtools-resize-handle-vertical",
|
|
389
422
|
style: { right: 0 },
|
|
390
423
|
onMousedown: _cache[6] || (_cache[6] = withModifiers(() => resizingState.value = { right: true }, ["prevent"])),
|
|
391
424
|
onTouchstartPassive: _cache[7] || (_cache[7] = () => resizingState.value = { right: true })
|
|
392
|
-
}, null, 544), [[vShow,
|
|
425
|
+
}, null, 544), [[vShow, __props.panel.store.position !== "right"]]),
|
|
393
426
|
withDirectives(createBaseVNode("div", {
|
|
394
427
|
class: "vite-devtools-resize-handle vite-devtools-resize-handle-corner",
|
|
395
428
|
style: {
|
|
@@ -405,7 +438,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
405
438
|
top: true,
|
|
406
439
|
left: true
|
|
407
440
|
})
|
|
408
|
-
}, null, 544), [[vShow,
|
|
441
|
+
}, null, 544), [[vShow, __props.panel.store.position !== "top" && __props.panel.store.position !== "left"]]),
|
|
409
442
|
withDirectives(createBaseVNode("div", {
|
|
410
443
|
class: "vite-devtools-resize-handle vite-devtools-resize-handle-corner",
|
|
411
444
|
style: {
|
|
@@ -421,7 +454,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
421
454
|
top: true,
|
|
422
455
|
right: true
|
|
423
456
|
})
|
|
424
|
-
}, null, 544), [[vShow,
|
|
457
|
+
}, null, 544), [[vShow, __props.panel.store.position !== "top" && __props.panel.store.position !== "right"]]),
|
|
425
458
|
withDirectives(createBaseVNode("div", {
|
|
426
459
|
class: "vite-devtools-resize-handle vite-devtools-resize-handle-corner",
|
|
427
460
|
style: {
|
|
@@ -437,7 +470,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
437
470
|
bottom: true,
|
|
438
471
|
left: true
|
|
439
472
|
})
|
|
440
|
-
}, null, 544), [[vShow,
|
|
473
|
+
}, null, 544), [[vShow, __props.panel.store.position !== "bottom" && __props.panel.store.position !== "left"]]),
|
|
441
474
|
withDirectives(createBaseVNode("div", {
|
|
442
475
|
class: "vite-devtools-resize-handle vite-devtools-resize-handle-corner",
|
|
443
476
|
style: {
|
|
@@ -453,197 +486,56 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
453
486
|
bottom: true,
|
|
454
487
|
right: true
|
|
455
488
|
})
|
|
456
|
-
}, null, 544), [[vShow,
|
|
457
|
-
],
|
|
489
|
+
}, null, 544), [[vShow, __props.panel.store.position !== "bottom" && __props.panel.store.position !== "right"]])
|
|
490
|
+
], 64);
|
|
458
491
|
};
|
|
459
492
|
}
|
|
460
493
|
});
|
|
461
|
-
var DockPanelResizer_default = _sfc_main$4;
|
|
462
|
-
|
|
463
|
-
//#endregion
|
|
464
|
-
//#region src/client/webcomponents/components/IframeManager.ts
|
|
465
|
-
var IframeManager = class {
|
|
466
|
-
iframes = {};
|
|
467
|
-
container = void 0;
|
|
468
|
-
constructor() {}
|
|
469
|
-
setContainer(container) {
|
|
470
|
-
this.container = container;
|
|
471
|
-
}
|
|
472
|
-
getIframeHolder(id) {
|
|
473
|
-
let iframe;
|
|
474
|
-
if (!this.iframes[id]) {
|
|
475
|
-
const el = document.createElement("iframe");
|
|
476
|
-
this.iframes[id] = new IframeHolder(id, el);
|
|
477
|
-
this.container.appendChild(el);
|
|
478
|
-
iframe = this.iframes[id];
|
|
479
|
-
} else iframe = this.iframes[id];
|
|
480
|
-
return iframe;
|
|
481
|
-
}
|
|
482
|
-
};
|
|
483
|
-
var IframeHolder = class {
|
|
484
|
-
iframe;
|
|
485
|
-
id;
|
|
486
|
-
parent;
|
|
487
|
-
_cleanups = [];
|
|
488
|
-
constructor(id, iframe) {
|
|
489
|
-
this.id = id;
|
|
490
|
-
this.iframe = iframe;
|
|
491
|
-
}
|
|
492
|
-
cleanup() {
|
|
493
|
-
this._cleanups.forEach((cleanup) => cleanup());
|
|
494
|
-
this._cleanups = [];
|
|
495
|
-
}
|
|
496
|
-
mount(parent) {
|
|
497
|
-
if (this.parent === parent) {
|
|
498
|
-
this.show();
|
|
499
|
-
return;
|
|
500
|
-
}
|
|
501
|
-
this.cleanup();
|
|
502
|
-
this.parent = parent;
|
|
503
|
-
const func = () => this.update();
|
|
504
|
-
window.addEventListener("resize", func);
|
|
505
|
-
this._cleanups.push(() => window.removeEventListener("resize", func));
|
|
506
|
-
this.show();
|
|
507
|
-
}
|
|
508
|
-
hide() {
|
|
509
|
-
this.iframe.style.display = "none";
|
|
510
|
-
}
|
|
511
|
-
show() {
|
|
512
|
-
this.iframe.style.display = "block";
|
|
513
|
-
this.update();
|
|
514
|
-
}
|
|
515
|
-
update() {
|
|
516
|
-
if (!this.parent) return;
|
|
517
|
-
const rect = this.parent.getBoundingClientRect();
|
|
518
|
-
this.iframe.style.position = "absolute";
|
|
519
|
-
this.iframe.style.width = `${rect.width}px`;
|
|
520
|
-
this.iframe.style.height = `${rect.height}px`;
|
|
521
|
-
}
|
|
522
|
-
unmount() {
|
|
523
|
-
this.cleanup();
|
|
524
|
-
this.hide();
|
|
525
|
-
this.parent = void 0;
|
|
526
|
-
}
|
|
527
|
-
};
|
|
528
|
-
|
|
529
|
-
//#endregion
|
|
530
|
-
//#region src/client/webcomponents/components/ViewIframe.vue
|
|
531
|
-
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
532
|
-
__name: "ViewIframe",
|
|
533
|
-
props: {
|
|
534
|
-
state: {},
|
|
535
|
-
isDragging: { type: Boolean },
|
|
536
|
-
isResizing: { type: Boolean },
|
|
537
|
-
entry: {},
|
|
538
|
-
iframes: {},
|
|
539
|
-
iframeStyle: {}
|
|
540
|
-
},
|
|
541
|
-
setup(__props) {
|
|
542
|
-
const props = __props;
|
|
543
|
-
const viewFrame = useTemplateRef("viewFrame");
|
|
544
|
-
onMounted(() => {
|
|
545
|
-
const holder = props.iframes.getIframeHolder(props.entry.id);
|
|
546
|
-
holder.iframe.style.boxShadow = "none";
|
|
547
|
-
holder.iframe.style.outline = "none";
|
|
548
|
-
Object.assign(holder.iframe.style, props.iframeStyle);
|
|
549
|
-
if (!holder.iframe.src) holder.iframe.src = props.entry.url;
|
|
550
|
-
holder.mount(viewFrame.value);
|
|
551
|
-
nextTick(() => {
|
|
552
|
-
holder.update();
|
|
553
|
-
});
|
|
554
|
-
watch(() => props.state, () => {
|
|
555
|
-
holder.update();
|
|
556
|
-
}, { deep: true });
|
|
557
|
-
watchEffect(() => {
|
|
558
|
-
holder.iframe.style.pointerEvents = props.isDragging || props.isResizing ? "none" : "auto";
|
|
559
|
-
}, { flush: "sync" });
|
|
560
|
-
});
|
|
561
|
-
onUnmounted(() => {
|
|
562
|
-
props.iframes.getIframeHolder(props.entry.id).unmount();
|
|
563
|
-
});
|
|
564
|
-
return (_ctx, _cache) => {
|
|
565
|
-
return openBlock(), createElementBlock("div", {
|
|
566
|
-
ref_key: "viewFrame",
|
|
567
|
-
ref: viewFrame,
|
|
568
|
-
class: "vite-devtools-view-iframe w-full h-full flex items-center justify-center"
|
|
569
|
-
}, [..._cache[0] || (_cache[0] = [createBaseVNode("div", { class: "op50 z--1" }, " Loading iframe... ", -1)])], 512);
|
|
570
|
-
};
|
|
571
|
-
}
|
|
572
|
-
});
|
|
573
|
-
var ViewIframe_default = _sfc_main$3;
|
|
574
|
-
|
|
575
|
-
//#endregion
|
|
576
|
-
//#region src/client/webcomponents/components/ViewEntry.vue
|
|
577
|
-
const _hoisted_1 = { key: 1 };
|
|
578
|
-
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
579
|
-
__name: "ViewEntry",
|
|
580
|
-
props: {
|
|
581
|
-
state: {},
|
|
582
|
-
isDragging: { type: Boolean },
|
|
583
|
-
isResizing: { type: Boolean },
|
|
584
|
-
entry: {},
|
|
585
|
-
iframes: {},
|
|
586
|
-
iframeStyle: {}
|
|
587
|
-
},
|
|
588
|
-
setup(__props) {
|
|
589
|
-
return (_ctx, _cache) => {
|
|
590
|
-
return __props.entry.type === "iframe" ? (openBlock(), createBlock(ViewIframe_default, {
|
|
591
|
-
key: 0,
|
|
592
|
-
state: __props.state,
|
|
593
|
-
"is-dragging": __props.isDragging,
|
|
594
|
-
"is-resizing": __props.isResizing,
|
|
595
|
-
entry: __props.entry,
|
|
596
|
-
iframes: __props.iframes,
|
|
597
|
-
"iframe-style": __props.iframeStyle
|
|
598
|
-
}, null, 8, [
|
|
599
|
-
"state",
|
|
600
|
-
"is-dragging",
|
|
601
|
-
"is-resizing",
|
|
602
|
-
"entry",
|
|
603
|
-
"iframes",
|
|
604
|
-
"iframe-style"
|
|
605
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_1, " Unknown entry: " + toDisplayString(__props.entry), 1));
|
|
606
|
-
};
|
|
607
|
-
}
|
|
608
|
-
});
|
|
609
|
-
var ViewEntry_default = _sfc_main$2;
|
|
610
|
-
|
|
611
494
|
//#endregion
|
|
612
495
|
//#region src/client/webcomponents/components/DockPanel.vue
|
|
613
496
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
614
497
|
__name: "DockPanel",
|
|
615
498
|
props: {
|
|
616
|
-
|
|
617
|
-
|
|
499
|
+
context: {},
|
|
500
|
+
selected: {},
|
|
618
501
|
dockEl: {},
|
|
619
502
|
panelMargins: {}
|
|
620
503
|
},
|
|
621
504
|
setup(__props) {
|
|
622
505
|
const props = __props;
|
|
623
|
-
const
|
|
624
|
-
const
|
|
625
|
-
const iframesContainer = useTemplateRef("iframesContainer");
|
|
626
|
-
const iframes = markRaw(new IframeManager());
|
|
627
|
-
watchEffect(() => {
|
|
628
|
-
iframes.setContainer(iframesContainer.value);
|
|
629
|
-
}, { flush: "sync" });
|
|
506
|
+
const context = props.context;
|
|
507
|
+
const { selected, panelMargins } = toRefs(props);
|
|
630
508
|
const windowSize = reactive(useWindowSize());
|
|
631
|
-
const isDragging = ref(false);
|
|
632
|
-
const isResizing = ref(false);
|
|
633
509
|
const isHovering = ref(false);
|
|
634
510
|
const mousePosition = reactive({
|
|
635
511
|
x: 0,
|
|
636
512
|
y: 0
|
|
637
513
|
});
|
|
514
|
+
const dockPanel = useTemplateRef("dockPanel");
|
|
515
|
+
const viewsContainer = useTemplateRef("viewsContainer");
|
|
516
|
+
const persistedDoms = markRaw(new PersistedDomViewsManager(viewsContainer));
|
|
638
517
|
function clamp(value, min, max) {
|
|
639
518
|
return Math.min(Math.max(value, min), max);
|
|
640
519
|
}
|
|
520
|
+
function openContextMenu(e) {
|
|
521
|
+
if (!dockPanel.value) return;
|
|
522
|
+
const entry = selected.value;
|
|
523
|
+
if (!entry) return;
|
|
524
|
+
e.preventDefault();
|
|
525
|
+
openDockContextMenu({
|
|
526
|
+
context,
|
|
527
|
+
entry,
|
|
528
|
+
el: dockPanel.value,
|
|
529
|
+
gap: 6
|
|
530
|
+
});
|
|
531
|
+
}
|
|
641
532
|
const anchorPos = computed(() => {
|
|
642
533
|
const halfWidth = (props.dockEl?.clientWidth || 0) / 2;
|
|
643
534
|
const halfHeight = (props.dockEl?.clientHeight || 0) / 2;
|
|
644
|
-
const
|
|
645
|
-
const
|
|
646
|
-
|
|
535
|
+
const store = context.panel.store;
|
|
536
|
+
const left = store.left * windowSize.width / 100;
|
|
537
|
+
const top = store.top * windowSize.height / 100;
|
|
538
|
+
switch (store.position) {
|
|
647
539
|
case "top": return {
|
|
648
540
|
left: clamp(left, halfWidth + panelMargins.value.left, windowSize.width - halfWidth - panelMargins.value.right),
|
|
649
541
|
top: panelMargins.value.top + halfHeight
|
|
@@ -656,7 +548,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
656
548
|
left: panelMargins.value.left + halfHeight,
|
|
657
549
|
top: clamp(top, halfWidth + panelMargins.value.top, windowSize.height - halfWidth - panelMargins.value.bottom)
|
|
658
550
|
};
|
|
659
|
-
case "bottom":
|
|
660
551
|
default: return {
|
|
661
552
|
left: clamp(left, halfWidth + panelMargins.value.left, windowSize.width - halfWidth - panelMargins.value.right),
|
|
662
553
|
top: windowSize.height - panelMargins.value.bottom - halfHeight
|
|
@@ -666,14 +557,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
666
557
|
let _timer = null;
|
|
667
558
|
function bringUp() {
|
|
668
559
|
isHovering.value = true;
|
|
669
|
-
if (
|
|
560
|
+
if (context.panel.store.inactiveTimeout < 0) return;
|
|
670
561
|
if (_timer) clearTimeout(_timer);
|
|
671
562
|
_timer = setTimeout(() => {
|
|
672
563
|
isHovering.value = false;
|
|
673
|
-
}, +
|
|
564
|
+
}, +context.panel.store.inactiveTimeout || 0);
|
|
674
565
|
}
|
|
675
566
|
const { width: frameWidth, height: frameHeight } = useElementBounding(dockPanel);
|
|
676
|
-
const
|
|
567
|
+
const panelStyle = computed(() => {
|
|
677
568
|
mousePosition.x, mousePosition.y;
|
|
678
569
|
const halfHeight = (props.dockEl?.clientHeight || 0) / 2;
|
|
679
570
|
const frameMargin = {
|
|
@@ -686,19 +577,20 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
686
577
|
const marginVertical = frameMargin.top + frameMargin.bottom;
|
|
687
578
|
const maxWidth = windowSize.width - marginHorizontal;
|
|
688
579
|
const maxHeight = windowSize.height - marginVertical;
|
|
580
|
+
const panel = context.panel;
|
|
581
|
+
const store = panel.store;
|
|
689
582
|
const style = {
|
|
690
583
|
position: "fixed",
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
height: `min(${state.value.height}vh, calc(100vh - ${marginVertical}px))`
|
|
584
|
+
pointerEvents: panel.isDragging || panel.isResizing ? "none" : "auto",
|
|
585
|
+
width: `min(${store.width}vw, calc(100vw - ${marginHorizontal}px))`,
|
|
586
|
+
height: `min(${store.height}vh, calc(100vh - ${marginVertical}px))`
|
|
695
587
|
};
|
|
696
588
|
const anchor = anchorPos.value;
|
|
697
|
-
const width = Math.min(maxWidth,
|
|
698
|
-
const height = Math.min(maxHeight,
|
|
589
|
+
const width = Math.min(maxWidth, store.width * windowSize.width / 100);
|
|
590
|
+
const height = Math.min(maxHeight, store.height * windowSize.height / 100);
|
|
699
591
|
const anchorX = anchor?.left || 0;
|
|
700
592
|
const anchorY = anchor?.top || 0;
|
|
701
|
-
switch (
|
|
593
|
+
switch (store.position) {
|
|
702
594
|
case "top":
|
|
703
595
|
case "bottom":
|
|
704
596
|
style.left = `${-frameWidth.value / 2}px`;
|
|
@@ -714,7 +606,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
714
606
|
else if (windowSize.height - anchorY - frameMargin.bottom < height / 2) style.top = `${windowSize.height - anchorY - height / 2 - frameMargin.bottom - frameHeight.value / 2}px`;
|
|
715
607
|
break;
|
|
716
608
|
}
|
|
717
|
-
switch (
|
|
609
|
+
switch (store.position) {
|
|
718
610
|
case "top":
|
|
719
611
|
style.top = 0;
|
|
720
612
|
break;
|
|
@@ -724,7 +616,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
724
616
|
case "left":
|
|
725
617
|
style.left = 0;
|
|
726
618
|
break;
|
|
727
|
-
case "bottom":
|
|
728
619
|
default:
|
|
729
620
|
style.bottom = 0;
|
|
730
621
|
break;
|
|
@@ -736,95 +627,86 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
736
627
|
});
|
|
737
628
|
return (_ctx, _cache) => {
|
|
738
629
|
return withDirectives((openBlock(), createElementBlock("div", {
|
|
739
|
-
id: "vite-devtools-dock-panel",
|
|
740
630
|
ref_key: "dockPanel",
|
|
741
631
|
ref: dockPanel,
|
|
742
|
-
class: "bg-glass rounded-lg border border-base shadow",
|
|
743
|
-
style: normalizeStyle(
|
|
632
|
+
class: "bg-glass:75 rounded-lg border border-base color-base shadow overflow-hidden",
|
|
633
|
+
style: normalizeStyle(panelStyle.value),
|
|
634
|
+
onContextmenu: openContextMenu
|
|
744
635
|
}, [
|
|
745
|
-
createVNode(
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
}, null, 8, [
|
|
752
|
-
"is-resizing",
|
|
753
|
-
"is-dragging",
|
|
754
|
-
"state",
|
|
755
|
-
"entry"
|
|
756
|
-
]),
|
|
757
|
-
unref(entry) && iframesContainer.value ? (openBlock(), createBlock(ViewEntry_default, {
|
|
758
|
-
key: unref(entry).id,
|
|
759
|
-
state: unref(state),
|
|
760
|
-
"is-dragging": isDragging.value,
|
|
761
|
-
"is-resizing": isResizing.value,
|
|
762
|
-
entry: unref(entry),
|
|
763
|
-
iframes: unref(iframes),
|
|
636
|
+
createVNode(_sfc_main$2, { panel: unref(context).panel }, null, 8, ["panel"]),
|
|
637
|
+
unref(selected) && viewsContainer.value ? (openBlock(), createBlock(_sfc_main$9, {
|
|
638
|
+
key: unref(selected).id,
|
|
639
|
+
context: unref(context),
|
|
640
|
+
entry: unref(selected),
|
|
641
|
+
"persisted-doms": unref(persistedDoms),
|
|
764
642
|
"iframe-style": {
|
|
765
643
|
border: "1px solid #8883",
|
|
766
|
-
borderRadius: "0.5rem"
|
|
767
|
-
|
|
768
|
-
},
|
|
769
|
-
rounded: ""
|
|
644
|
+
borderRadius: "0.5rem"
|
|
645
|
+
}
|
|
770
646
|
}, null, 8, [
|
|
771
|
-
"
|
|
772
|
-
"is-dragging",
|
|
773
|
-
"is-resizing",
|
|
647
|
+
"context",
|
|
774
648
|
"entry",
|
|
775
|
-
"
|
|
649
|
+
"persisted-doms"
|
|
776
650
|
])) : createCommentVNode("v-if", true),
|
|
777
651
|
createBaseVNode("div", {
|
|
778
|
-
id: "vite-devtools-
|
|
779
|
-
ref_key: "
|
|
780
|
-
ref:
|
|
781
|
-
class: "absolute inset-0"
|
|
652
|
+
id: "vite-devtools-views-container",
|
|
653
|
+
ref_key: "viewsContainer",
|
|
654
|
+
ref: viewsContainer,
|
|
655
|
+
class: "absolute inset-0 pointer-events-none"
|
|
782
656
|
}, null, 512)
|
|
783
|
-
],
|
|
657
|
+
], 36)), [[vShow, unref(context).docks.selected && unref(context).docks.selected.type !== "action"]]);
|
|
784
658
|
};
|
|
785
659
|
}
|
|
786
660
|
});
|
|
787
|
-
var DockPanel_default = _sfc_main$1;
|
|
788
|
-
|
|
789
661
|
//#endregion
|
|
790
|
-
//#region src/client/webcomponents/components/DockEmbedded.
|
|
791
|
-
const
|
|
662
|
+
//#region src/client/webcomponents/components/DockEmbedded.ts
|
|
663
|
+
const DockEmbedded = defineCustomElement(/* @__PURE__ */ defineComponent({
|
|
792
664
|
__name: "DockEmbedded",
|
|
793
|
-
props: {
|
|
794
|
-
state: {},
|
|
795
|
-
docks: {}
|
|
796
|
-
},
|
|
665
|
+
props: { context: {} },
|
|
797
666
|
setup(__props) {
|
|
667
|
+
const props = __props;
|
|
668
|
+
const isDockPopupOpen = useIsDockPopupOpen();
|
|
669
|
+
const settings = sharedStateToRef(props.context.docks.settings);
|
|
670
|
+
useEventListener(window, "mousedown", (e) => {
|
|
671
|
+
if (!settings.value.closeOnOutsideClick) return;
|
|
672
|
+
if (isDockPopupOpen.value) return;
|
|
673
|
+
if (!props.context.panel.store.open || props.context.panel.isDragging || props.context.panel.isResizing) return;
|
|
674
|
+
if (!e.composedPath().find((_el) => {
|
|
675
|
+
const el = _el;
|
|
676
|
+
return [...el.classList || []].some((c) => c.startsWith("vite-devtools-")) || el.id?.startsWith("vite-devtools-") || el.tagName?.toLowerCase() === "iframe";
|
|
677
|
+
})) props.context.docks.switchEntry(null);
|
|
678
|
+
});
|
|
679
|
+
onUnmounted(() => {
|
|
680
|
+
closeDockPopup();
|
|
681
|
+
});
|
|
798
682
|
return (_ctx, _cache) => {
|
|
799
|
-
return openBlock(),
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
683
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
684
|
+
!unref(isDockPopupOpen) ? (openBlock(), createBlock(_sfc_main$3, {
|
|
685
|
+
key: 0,
|
|
686
|
+
context: __props.context
|
|
687
|
+
}, {
|
|
688
|
+
default: withCtx(({ dockEl, panelMargins, selected }) => [createVNode(_sfc_main$1, {
|
|
689
|
+
context: __props.context,
|
|
690
|
+
selected,
|
|
691
|
+
"dock-el": dockEl,
|
|
692
|
+
"panel-margins": panelMargins
|
|
693
|
+
}, null, 8, [
|
|
694
|
+
"context",
|
|
695
|
+
"selected",
|
|
696
|
+
"dock-el",
|
|
697
|
+
"panel-margins"
|
|
698
|
+
])]),
|
|
699
|
+
_: 1
|
|
700
|
+
}, 8, ["context"])) : createCommentVNode("v-if", true),
|
|
701
|
+
!unref(isDockPopupOpen) ? (openBlock(), createBlock(_sfc_main$10, { key: 1 })) : createCommentVNode("v-if", true),
|
|
702
|
+
createVNode(_sfc_main$11, { context: __props.context }, null, 8, ["context"])
|
|
703
|
+
], 64);
|
|
816
704
|
};
|
|
817
705
|
}
|
|
818
|
-
})
|
|
819
|
-
var DockEmbedded_default = _sfc_main;
|
|
820
|
-
|
|
821
|
-
//#endregion
|
|
822
|
-
//#region src/client/webcomponents/components/DockEmbedded.ts
|
|
823
|
-
const DockEmbedded = defineCustomElement(DockEmbedded_default, {
|
|
706
|
+
}), {
|
|
824
707
|
shadowRoot: true,
|
|
825
708
|
styles: [css_default]
|
|
826
709
|
});
|
|
827
710
|
customElements.define("vite-devtools-dock-embedded", DockEmbedded);
|
|
828
|
-
|
|
829
711
|
//#endregion
|
|
830
|
-
export { DockEmbedded,
|
|
712
|
+
export { DEFAULT_DOCK_PANEL_STORE, DockEmbedded, PersistedDomHolder, PersistedDomViewsManager, createDockEntryState, sharedStateToRef, useDocksEntries };
|