@devframes/hub-ui 0.9.9 → 0.9.10
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/client/embedded.js +8 -6
- package/dist/client/standalone/assets/{DockStandalone-Ce0YdEIy.js → DockStandalone-3_CzgPVL.js} +1 -1
- package/dist/client/standalone/assets/{context-DBww7Wy4.js → context-Bt79Y4N5.js} +1 -1
- package/dist/client/standalone/assets/{index-WkX38nos.js → index-BGXSUn0A.js} +4 -4
- package/dist/client/standalone/assets/{popup-e5pfQ1h4.js → popup-B_knQQry.js} +3 -3
- package/dist/client/standalone/index.html +1 -1
- package/package.json +8 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DockStandalone-
|
|
2
|
-
import{Ct as e,M as t,St as n,Tt as r,c as i,f as a,ft as o,i as s,l as c,nt as l,s as u,wt as d}from"./index-
|
|
3
|
-
`:t===`t`?` `:t,a+=2}else o+=e[a],a++;if(a>=e.length)throw Error(`Unterminated string literal at position ${n}`);a++,t.push({type:`string`,value:o}),n=a;continue}if(ae.test(r)){let r=n;for(;r<e.length&&oe.test(e[r]);)r++;let i=e.slice(n,r);i===`true`?t.push({type:`bool`,value:!0}):i===`false`?t.push({type:`bool`,value:!1}):t.push({type:`ident`,value:i}),n=r;continue}throw Error(`Unexpected character "${r}" at position ${n}`)}}return t.push({type:`eof`}),t}function le(e){let t=ce(e),n=0,r=()=>t[n],i=()=>t[n++],a=e=>{let t=r();return t.type===`op`&&t.value===e},o=()=>{let e=i();if(e.type!==`op`)throw Error(`internal: expected operator token, got ${y(e)}`);return e.value};function s(){let e=c();for(;a(`||`);)i(),e={type:`binary`,op:`||`,left:e,right:c()};return e}function c(){let e=l();for(;a(`&&`);)i(),e={type:`binary`,op:`&&`,left:e,right:l()};return e}function l(){let e=u();for(;a(`===`)||a(`!==`)||a(`==`)||a(`!=`);){let t=o(),n=t===`==`||t===`!=`?h():u();e={type:`binary`,op:t,left:e,right:n}}return e}function u(){let e=d();for(;a(`<=`)||a(`>=`)||a(`<`)||a(`>`);)e={type:`binary`,op:o(),left:e,right:d()};return e}function d(){let e=f();for(;a(`+`)||a(`-`);)e={type:`binary`,op:o(),left:e,right:f()};return e}function f(){let e=p();for(;a(`*`)||a(`/`)||a(`%`);)e={type:`binary`,op:o(),left:e,right:p()};return e}function p(){return a(`!`)||a(`-`)||a(`+`)?{type:`unary`,op:o(),operand:p()}:m()}function m(){let e=r();if(e.type===`number`||e.type===`string`||e.type===`bool`)return i(),{type:`literal`,value:e.value};if(e.type===`ident`)return i(),{type:`key`,key:e.value};if(e.type===`lparen`){i();let e=s(),t=r();if(t.type!==`rparen`)throw Error(`Expected ")" but got ${y(t)}`);return i(),e}throw Error(`Unexpected token: ${y(e)}`)}function h(){let e=r();if(e.type===`string`)return i(),{type:`literal`,value:e.value};if(e.type===`number`||e.type===`bool`)return i(),{type:`literal`,value:String(e.value)};if(e.type===`ident`)return i(),{type:`literal`,value:e.value};throw Error(`Expected value literal or identifier on right side of equality, got ${y(e)}`)}let ee=s(),g=r();if(g.type!==`eof`)throw Error(`Unexpected token: ${y(g)}`);return ee}function y(e){switch(e.type){case`eof`:return`end of expression`;case`lparen`:return`"("`;case`rparen`:return`")"`;case`op`:case`ident`:case`string`:return`"${e.value}"`;case`number`:case`bool`:return`"${String(e.value)}"`}}function ue(e,t,n={}){let{strict:r=!1}=n;return!!b(e,t,r)}function b(e,t,n){switch(e.type){case`literal`:return e.value;case`key`:return me(e.key,t,n);case`unary`:return de(e.op,b(e.operand,t,n));case`binary`:return fe(e,t,n)}}function de(e,t){switch(e){case`!`:return!t;case`-`:return-t;case`+`:return+t}}function fe(e,t,n){let{op:r}=e;if(r===`&&`)return b(e.left,t,n)&&b(e.right,t,n);if(r===`||`)return b(e.left,t,n)||b(e.right,t,n);let i=b(e.left,t,n),a=b(e.right,t,n);switch(r){case`==`:return String(i)===String(a);case`!=`:return String(i)!==String(a);case`===`:return i===a;case`!==`:return i!==a;case`<`:return i<a;case`>`:return i>a;case`<=`:return i<=a;case`>=`:return i>=a;case`+`:return i+a;case`-`:return i-a;case`*`:return i*a;case`/`:return i/a;case`%`:return i%a}}function pe(e,t,n){return ue(le(e),t,n)}function me(e,t,n){let{found:r,value:i}=he(e,t);if(!r&&n)throw Error(`Unknown context key: "${e}"`);return i}function he(e,t){if(e in t)return{found:!0,value:t[e]};let n=e.includes(`.`)?`.`:e.includes(`:`)?`:`:null;if(n){let r=e.split(n),i=t;for(let e of r){if(typeof i!=`object`||!i)return{found:!1,value:void 0};let t=i;if(!(e in t))return{found:!1,value:void 0};i=t[e]}return{found:!0,value:i}}return{found:!1,value:void 0}}function x(e,t,n){return pe(e,t,n)}var ge=`devframes:hub-ui:hide`,_e=`devframes_plugin_terminals`,ve=`devframes_plugin_messages`,ye=Object.freeze({type:`~builtin`,category:`~builtin`,id:`~client-auth-notice`,title:`Unauthorized`,icon:`ph:warning-duotone`}),S=Object.freeze({type:`~builtin`,category:`~builtin`,id:`~settings`,title:`Settings`,icon:`ph:gear-duotone`}),be=Object.freeze([ye,S]),C=Object.freeze({showIframeAddressBar:!1,closeOnOutsideClick:!1,autoCollapseEdgeToolbar:!0,showDevframeInspector:!1});function xe(e,t){return e?.[t]??C[t]}var w=new WeakMap;function Se(e){let n=w.get(e);if(!n){let r=s(e.docks.settings);n=t(()=>({...C,...r.value})),w.set(e,n)}return n}var T=`~pinned`,Ce=-1e5;function we(e,t){return e===T?Ce:t?.[e]??r[e]??0}function Te(e){return typeof e==`string`?e:e?.light??e?.dark}var Ee={default:`Default`,app:`App`,framework:`Framework`,web:`Web`,advanced:`Advanced`,"~builtin":`Built-in`,[T]:`Pinned`};function De(e){return e!==`~builtin`&&e!==T}function Oe(e){return Ee[e]??e}function ke(e){let t=new Set;for(let n of e)n.type===`group`&&t.add(n.id);return t}function Ae(e,t){if(!t||t.type===`group`||!t.groupId)return;let n=e.find(e=>e.id===t.groupId);return n?.type===`group`?n:void 0}function je(e,t,n,r){let i=e.filter(e=>e.type!==`group`&&e.groupId===t);if(!n)return i.length?[[`default`,i]]:[];let a=e.find(e=>e.type===`group`&&e.id===t);return O(i,n,{...r,ignoreCategoryHidden:!0,categoryOrderOverride:a?.categoryOrder})}function Me(e,t,n,r){return je(e,t,n,r).flatMap(([,e])=>e)}function E(e,t,n,r){if(!n)return;let i=e.find(e=>e.type!==`group`&&e.groupId===t&&e.id===n);if(i){if(i.when){if(r){if(!x(i.when,r))return}else if(i.when===`false`)return}return i}}function Ne(e,t,n,r){return E(e,t.id,n,r)??E(e,t.id,t.defaultChildId,r)}function D(e,t){return e?t?!x(e,t):e===`false`:!1}function Pe(e,t,n){return D(e.when,n)||D(e.visibility,n)||e.id===`devframes_plugin_inspect`&&!xe(t,`showDevframeInspector`)?!0:t.docksHidden.includes(e.id)}function Fe(e){let t=new Map;for(let n of e)n.type===`group`&&t.set(n.id,n.category??`default`);return t}function Ie(e,t,n){let r=we(e,n),i=we(t,n);return i===r?t.localeCompare(e):r-i}function Le(e,t,n){let r=n[e.id]??0,i=n[t.id]??0;if(r!==i)return r-i;let a=e.defaultOrder??0,o=t.defaultOrder??0;return o===a?t.title.localeCompare(e.title):a-o}function Re(e,t,n){let r=t??e.category??`default`;return n.includes(e.id)&&t===void 0?T:r}function ze(e,t,n,r){let{docksCategoriesHidden:i,docksPinned:a}=n,{includeHidden:o,whenContext:s,collapseGroups:c,ignoreCategoryHidden:l}=r,u=new Map;for(let r of e){let e=r.type!==`group`&&r.groupId?t.get(r.groupId):void 0;if(c&&e!==void 0||!o&&Pe(r,n,s))continue;let d=Re(r,e,a);!o&&!l&&i.includes(d)||(u.has(d)||u.set(d,[]),u.get(d).push(r))}return u}function O(e,t,n){let{docksCustomOrder:r}=t,{includeHidden:i=!1,whenContext:a,collapseGroups:o=!1,ignoreCategoryHidden:s=!1,categoryOrderOverride:c}=n??{},l=ze(e,Fe(e),t,{includeHidden:i,whenContext:a,collapseGroups:o,ignoreCategoryHidden:s}),u=Array.from(l.entries()).sort(([e],[t])=>Ie(e,t,c));for(let[,e]of u)e.sort((e,t)=>Le(e,t,r));return u}function Be(e){let{availableHeight:t,reservedHeight:n,itemHeight:r,dividerHeight:i,moreButtonHeight:a,dividerCount:o,totalItems:s}=e;if(s<=0||r<=0)return 0;let c=t-n-Math.max(0,o)*i;if(Math.floor(c/r)>=s)return s;let l=Math.floor((c-a)/r);return Math.max(0,l)}function k(e,t){let n=[],r=[],i=t;for(let[t,a]of e)i<=0?r.push([t,a]):a.length>i?(n.push([t,a.slice(0,i)]),r.push([t,a.slice(i)]),i=0):(i-=a.length,n.push([t,a]));return{visible:n,overflow:r}}function Ve(e,t){return e.some(([,e])=>e.some(e=>e.id===t))}function He(e,t,n=null){let r=k(e,t);if(r.overflow.reduce((e,[,t])=>e+t.length,0)===1)return{visible:[...r.visible,...r.overflow],overflow:[],recent:null};if(!n||r.overflow.length===0||Ve(r.visible,n.id))return{...r,recent:null};let i=k(e,Math.max(t-1,0)),a=i.overflow.map(([e,t])=>[e,t.filter(e=>e.id!==n.id)]).filter(([,e])=>e.length>0);return{visible:i.visible,overflow:a,recent:n}}var A=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform??``);function Ue(e){return e.split(`+`).map(e=>e===`Mod`?A?`⌘`:`Ctrl`:e===`Shift`?A?`⇧`:`Shift`:e===`Alt`?A?`⌥`:`Alt`:e)}function We(e){let t=[];(A?e.metaKey:e.ctrlKey)&&t.push(`Mod`),(A?e.ctrlKey:e.metaKey)&&t.push(A?`Ctrl`:`Meta`),e.altKey&&t.push(`Alt`),e.shiftKey&&t.push(`Shift`);let n=e.key;return n.length===1&&(n=n.toUpperCase()),[`Control`,`Meta`,`Alt`,`Shift`].includes(n)||t.push(n),t.join(`+`)}function Ge(e,t){let n=e??[],r=t??[];return n.length===r.length&&n.every((e,t)=>e.key===r[t]?.key)}function Ke(e,t){return e!==void 0&&!Ge(e,t)}function j(e,t,n=[]){for(let r of e){let e=t(r,n);if(e===`stop`||!(e===`skip`||!r.children?.length)&&j(r.children,t,[...n,r])===`stop`)return`stop`}}function qe(e,t){let n;return j(e,e=>{if(e.id===t)return n=e,`stop`}),n}function Je(e,t){let n=e=>!e.when||x(e.when,t),r=e=>{let t=[];for(let i of e){if(!n(i))continue;if(!i.children){t.push(i);continue}let e=r(i.children);t.push({...i,children:e})}return t};return r(e)}function Ye(e,t){let n=[];return j(e.value,e=>{for(let r of t(e.id))n.push({id:e.id,keybinding:r})}),n}var Xe={"Mod+T":`Open new tab`,"Mod+W":`Close tab`,"Mod+N":`Open new window`,"Mod+L":`Focus address bar`,"Mod+D":`Bookmark page`,"Mod+Q":`Quit browser`,"Mod+Shift+T":`Reopen closed tab`,"Mod+Shift+N":`Open incognito window`,"Mod+Shift+W":`Close window`,"Mod+Shift+Q":`Quit browser (Chrome)`,"Alt+F4":`Close window (Windows)`,"Mod+R":`Reload page`,"Mod+Shift+R":`Hard reload page`,"Mod+F":`Find in page`},Ze=`devframes:docks`;function M(e){return`${Ze}:${e}`}function Qe(e){return e.at(-1)?.id??null}function N(e,t){return e.source===`client`&&!!e.action&&!!e.children?.length&&t.some(t=>t.type===`group`&&M(t.id)===e.id)}function $e(e,t){return N(e,t)?`execute`:e.children?.length?`drill`:`execute`}function et(e,t,n,r){return N(e,t)&&n&&r===e.id}function tt(e){let t=[];return j(e,(e,n)=>{if(e.showInPalette===!1)return`skip`;let r=n.at(-1)?.title;if(t.push({entry:e,...r?{parentTitle:r}:{},searchTitle:[...n.map(e=>e.title),e.title].join(` > `)}),e.showInPalette===`without-children`)return`skip`}),t}function P(e,t){if(!t)return[];let n=[];return j(e,(e,r)=>{if(e.id===t)return e.children?.length&&(n=[...r,e].filter(e=>e.children?.length).map(e=>({id:e.id,title:e.title,items:e.children}))),`stop`}),n}function nt(e,t,n){let r=n!=null&&t.some(e=>e.id===n),i=[],a=e;for(let e of t){let t=a.find(t=>t.id===e.id);if(!t?.children?.length)break;let n=t.children;i.push({id:t.id,title:t.title,items:n}),a=n}return r&&!i.some(e=>e.id===n)?P(e,n):i}var F=o(null),I=o(null),L=o(null),R=o(null);function rt(e){F.value=e}function it(){return F}function z(e){I.value=e}function at(){return I}function ot(e){L.value=e}function st(){return L}var B=o(null);function ct(e){B.value=e}function lt(){return B}function ut(e){R.value=e}function dt(){return R}var V=o(null);function ft(e){V.value=e}function pt(){return V}var H=20,U=100,mt=320,ht=240,W=`__DEVFRAMES_TRIGGER_DOCK_ACTION__`,G=`__DEVFRAME_CONNECTION_META__`,K=o(null),q=o(!1),J=e(),Y,X,Z,Q,gt=async()=>await n(()=>import(`./DockStandalone-Ce0YdEIy.js`).then(e=>e.DockStandalone),__vite__mapDeps([0,1]),import.meta.url);J.on(`popup:open-requested`,e=>{At(e)});function _t(){if(!(typeof window>`u`))return window.documentPictureInPicture}function vt(){Y?.(),Y=void 0,X?.(),X=void 0}function yt(e){return l(a,t=>{e.document.documentElement?.style.setProperty(`color-scheme`,t?`dark`:`light`)},{immediate:!0})}function bt(){Z?.remove(),Z=void 0}function $(){vt(),bt(),K.value=null,q.value=!1;let e=Q;Q=void 0,e?.docks.switchEntry(null)}function xt(e,t,n){return Math.min(Math.max(e,t),n)}function St(e,t){window.innerWidth<=0||window.innerHeight<=0||(e.panel.store.width=xt(Math.round(t.innerWidth/window.innerWidth*100),H,U),e.panel.store.height=xt(Math.round(t.innerHeight/window.innerHeight*100),H,U))}async function Ct(e,t){let n=await gt(),r=t.document.createElement(`style`);r.textContent=[`html, body {`,` margin: 0;`,` padding: 0;`,` width: 100%;`,` height: 100%;`,` overflow: hidden;`,` background: transparent;`,`}`,`#devframes-popup-root {`,` width: 100vw;`,` height: 100vh;`,`}`,`#devframes-popup-root > devframes-dock-standalone {`,` display: block;`,` width: 100%;`,` height: 100%;`,`}`].join(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DockStandalone-3_CzgPVL.js","./index-BGXSUn0A.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Ct as e,M as t,St as n,Tt as r,c as i,f as a,ft as o,i as s,l as c,nt as l,s as u,wt as d}from"./index-BGXSUn0A.js";var f=`devframe-remote-connection`,p=d.postMessage.remoteAssetsError,m=/^[a-z][a-z\d+.-]*:/i;function h(e){let t=e.trim();return!!t&&!t.startsWith(`/`)&&!t.startsWith(`./`)&&!t.startsWith(`../`)&&!m.test(t)}function ee(e,t={}){if(!h(e))return e;let n=t.resolveClientModule?.(e);if(n)return n;if(!t.template)return e;let r=t.template.includes(`{specifier}`)?t.template.replaceAll(`{specifier}`,e):t.template+e;try{return new URL(r,t.metaBaseUrl).href}catch{return r}}function g(e,t){return h(e)?t===e?". The specifier is a bare npm specifier and this host advertises no client-module resolution (`ConnectionMeta.configs.dock.clientModuleResolution`). Serve the script as a self-contained bundle by URL, pass `resolveClientModule` to this client host, or run under a host that resolves bare specifiers (e.g. Vite: `/@id/{specifier}`).":`. The host resolved the bare specifier "${e}" to this URL but could not serve the module. Check the package is installed and resolvable from the host project's root (and built, if its exports point at build output).`:``}function _(e){let t=e.split(`&`),n=t.filter(e=>e.split(`=`)[0]!==f);return[n.join(`&`),n.length!==t.length]}function te(e){let t=e.indexOf(`?`);if(t===-1)return _(e);let n=e.slice(0,t),[r,i]=_(e.slice(t+1));return i?[r?`${n}?${r}`:n,!0]:[e,!1]}function ne(e){let t=e.indexOf(`?`);if(t===-1)return[e,!1];let n=e.slice(0,t),[r,i]=_(e.slice(t+1));return i?[r?`${n}?${r}`:n,!0]:[e,!1]}function re(e){let t=e.indexOf(`#`),n=t===-1?void 0:e.slice(t+1),r=t===-1?e:e.slice(0,t),[i,a]=n===void 0?[void 0,!1]:te(n),[o,s]=ne(r);return!a&&!s?e:i?`${o}#${i}`:o}var ie=[`===`,`!==`,`==`,`!=`,`<=`,`>=`,`&&`,`||`,`<`,`>`,`+`,`-`,`*`,`/`,`%`,`!`],ae=/[a-z_$]/i,oe=/[\w$.:]/,v=/\d/,se=/\s/;function ce(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(se.test(r)){n++;continue}if(r===`(`){t.push({type:`lparen`}),n++;continue}if(r===`)`){t.push({type:`rparen`}),n++;continue}let i=!1;for(let r of ie)if(e.startsWith(r,n)){t.push({type:`op`,value:r}),n+=r.length,i=!0;break}if(!i){if(v.test(r)){let r=n;for(;r<e.length&&v.test(e[r]);)r++;if(e[r]===`.`&&r+1<e.length&&v.test(e[r+1]))for(r++;r<e.length&&v.test(e[r]);)r++;t.push({type:`number`,value:Number(e.slice(n,r))}),n=r;continue}if(r===`"`||r===`'`){let i=r,a=n+1,o=``;for(;a<e.length&&e[a]!==i;)if(e[a]===`\\`&&a+1<e.length){let t=e[a+1];o+=t===`n`?`
|
|
3
|
+
`:t===`t`?` `:t,a+=2}else o+=e[a],a++;if(a>=e.length)throw Error(`Unterminated string literal at position ${n}`);a++,t.push({type:`string`,value:o}),n=a;continue}if(ae.test(r)){let r=n;for(;r<e.length&&oe.test(e[r]);)r++;let i=e.slice(n,r);i===`true`?t.push({type:`bool`,value:!0}):i===`false`?t.push({type:`bool`,value:!1}):t.push({type:`ident`,value:i}),n=r;continue}throw Error(`Unexpected character "${r}" at position ${n}`)}}return t.push({type:`eof`}),t}function le(e){let t=ce(e),n=0,r=()=>t[n],i=()=>t[n++],a=e=>{let t=r();return t.type===`op`&&t.value===e},o=()=>{let e=i();if(e.type!==`op`)throw Error(`internal: expected operator token, got ${y(e)}`);return e.value};function s(){let e=c();for(;a(`||`);)i(),e={type:`binary`,op:`||`,left:e,right:c()};return e}function c(){let e=l();for(;a(`&&`);)i(),e={type:`binary`,op:`&&`,left:e,right:l()};return e}function l(){let e=u();for(;a(`===`)||a(`!==`)||a(`==`)||a(`!=`);){let t=o(),n=t===`==`||t===`!=`?h():u();e={type:`binary`,op:t,left:e,right:n}}return e}function u(){let e=d();for(;a(`<=`)||a(`>=`)||a(`<`)||a(`>`);)e={type:`binary`,op:o(),left:e,right:d()};return e}function d(){let e=f();for(;a(`+`)||a(`-`);)e={type:`binary`,op:o(),left:e,right:f()};return e}function f(){let e=p();for(;a(`*`)||a(`/`)||a(`%`);)e={type:`binary`,op:o(),left:e,right:p()};return e}function p(){return a(`!`)||a(`-`)||a(`+`)?{type:`unary`,op:o(),operand:p()}:m()}function m(){let e=r();if(e.type===`number`||e.type===`string`||e.type===`bool`)return i(),{type:`literal`,value:e.value};if(e.type===`ident`)return i(),{type:`key`,key:e.value};if(e.type===`lparen`){i();let e=s(),t=r();if(t.type!==`rparen`)throw Error(`Expected ")" but got ${y(t)}`);return i(),e}throw Error(`Unexpected token: ${y(e)}`)}function h(){let e=r();if(e.type===`string`)return i(),{type:`literal`,value:e.value};if(e.type===`number`||e.type===`bool`)return i(),{type:`literal`,value:String(e.value)};if(e.type===`ident`)return i(),{type:`literal`,value:e.value};throw Error(`Expected value literal or identifier on right side of equality, got ${y(e)}`)}let ee=s(),g=r();if(g.type!==`eof`)throw Error(`Unexpected token: ${y(g)}`);return ee}function y(e){switch(e.type){case`eof`:return`end of expression`;case`lparen`:return`"("`;case`rparen`:return`")"`;case`op`:case`ident`:case`string`:return`"${e.value}"`;case`number`:case`bool`:return`"${String(e.value)}"`}}function ue(e,t,n={}){let{strict:r=!1}=n;return!!b(e,t,r)}function b(e,t,n){switch(e.type){case`literal`:return e.value;case`key`:return me(e.key,t,n);case`unary`:return de(e.op,b(e.operand,t,n));case`binary`:return fe(e,t,n)}}function de(e,t){switch(e){case`!`:return!t;case`-`:return-t;case`+`:return+t}}function fe(e,t,n){let{op:r}=e;if(r===`&&`)return b(e.left,t,n)&&b(e.right,t,n);if(r===`||`)return b(e.left,t,n)||b(e.right,t,n);let i=b(e.left,t,n),a=b(e.right,t,n);switch(r){case`==`:return String(i)===String(a);case`!=`:return String(i)!==String(a);case`===`:return i===a;case`!==`:return i!==a;case`<`:return i<a;case`>`:return i>a;case`<=`:return i<=a;case`>=`:return i>=a;case`+`:return i+a;case`-`:return i-a;case`*`:return i*a;case`/`:return i/a;case`%`:return i%a}}function pe(e,t,n){return ue(le(e),t,n)}function me(e,t,n){let{found:r,value:i}=he(e,t);if(!r&&n)throw Error(`Unknown context key: "${e}"`);return i}function he(e,t){if(e in t)return{found:!0,value:t[e]};let n=e.includes(`.`)?`.`:e.includes(`:`)?`:`:null;if(n){let r=e.split(n),i=t;for(let e of r){if(typeof i!=`object`||!i)return{found:!1,value:void 0};let t=i;if(!(e in t))return{found:!1,value:void 0};i=t[e]}return{found:!0,value:i}}return{found:!1,value:void 0}}function x(e,t,n){return pe(e,t,n)}var ge=`devframes:hub-ui:hide`,_e=`devframes_plugin_terminals`,ve=`devframes_plugin_messages`,ye=Object.freeze({type:`~builtin`,category:`~builtin`,id:`~client-auth-notice`,title:`Unauthorized`,icon:`ph:warning-duotone`}),S=Object.freeze({type:`~builtin`,category:`~builtin`,id:`~settings`,title:`Settings`,icon:`ph:gear-duotone`}),be=Object.freeze([ye,S]),C=Object.freeze({showIframeAddressBar:!1,closeOnOutsideClick:!1,autoCollapseEdgeToolbar:!0,showDevframeInspector:!1});function xe(e,t){return e?.[t]??C[t]}var w=new WeakMap;function Se(e){let n=w.get(e);if(!n){let r=s(e.docks.settings);n=t(()=>({...C,...r.value})),w.set(e,n)}return n}var T=`~pinned`,Ce=-1e5;function we(e,t){return e===T?Ce:t?.[e]??r[e]??0}function Te(e){return typeof e==`string`?e:e?.light??e?.dark}var Ee={default:`Default`,app:`App`,framework:`Framework`,web:`Web`,advanced:`Advanced`,"~builtin":`Built-in`,[T]:`Pinned`};function De(e){return e!==`~builtin`&&e!==T}function Oe(e){return Ee[e]??e}function ke(e){let t=new Set;for(let n of e)n.type===`group`&&t.add(n.id);return t}function Ae(e,t){if(!t||t.type===`group`||!t.groupId)return;let n=e.find(e=>e.id===t.groupId);return n?.type===`group`?n:void 0}function je(e,t,n,r){let i=e.filter(e=>e.type!==`group`&&e.groupId===t);if(!n)return i.length?[[`default`,i]]:[];let a=e.find(e=>e.type===`group`&&e.id===t);return O(i,n,{...r,ignoreCategoryHidden:!0,categoryOrderOverride:a?.categoryOrder})}function Me(e,t,n,r){return je(e,t,n,r).flatMap(([,e])=>e)}function E(e,t,n,r){if(!n)return;let i=e.find(e=>e.type!==`group`&&e.groupId===t&&e.id===n);if(i){if(i.when){if(r){if(!x(i.when,r))return}else if(i.when===`false`)return}return i}}function Ne(e,t,n,r){let i=E(e,t.id,n,r);return(i?.type===`action`?void 0:i)??E(e,t.id,t.defaultChildId,r)}function D(e,t){return e?t?!x(e,t):e===`false`:!1}function Pe(e,t,n){return D(e.when,n)||D(e.visibility,n)||e.id===`devframes_plugin_inspect`&&!xe(t,`showDevframeInspector`)?!0:t.docksHidden.includes(e.id)}function Fe(e){let t=new Map;for(let n of e)n.type===`group`&&t.set(n.id,n.category??`default`);return t}function Ie(e,t,n){let r=we(e,n),i=we(t,n);return i===r?t.localeCompare(e):r-i}function Le(e,t,n){let r=n[e.id]??0,i=n[t.id]??0;if(r!==i)return r-i;let a=e.defaultOrder??0,o=t.defaultOrder??0;return o===a?t.title.localeCompare(e.title):a-o}function Re(e,t,n){let r=t??e.category??`default`;return n.includes(e.id)&&t===void 0?T:r}function ze(e,t,n,r){let{docksCategoriesHidden:i,docksPinned:a}=n,{includeHidden:o,whenContext:s,collapseGroups:c,ignoreCategoryHidden:l}=r,u=new Map;for(let r of e){let e=r.type!==`group`&&r.groupId?t.get(r.groupId):void 0;if(c&&e!==void 0||!o&&Pe(r,n,s))continue;let d=Re(r,e,a);!o&&!l&&i.includes(d)||(u.has(d)||u.set(d,[]),u.get(d).push(r))}return u}function O(e,t,n){let{docksCustomOrder:r}=t,{includeHidden:i=!1,whenContext:a,collapseGroups:o=!1,ignoreCategoryHidden:s=!1,categoryOrderOverride:c}=n??{},l=ze(e,Fe(e),t,{includeHidden:i,whenContext:a,collapseGroups:o,ignoreCategoryHidden:s}),u=Array.from(l.entries()).sort(([e],[t])=>Ie(e,t,c));for(let[,e]of u)e.sort((e,t)=>Le(e,t,r));return u}function Be(e){let{availableHeight:t,reservedHeight:n,itemHeight:r,dividerHeight:i,moreButtonHeight:a,dividerCount:o,totalItems:s}=e;if(s<=0||r<=0)return 0;let c=t-n-Math.max(0,o)*i;if(Math.floor(c/r)>=s)return s;let l=Math.floor((c-a)/r);return Math.max(0,l)}function k(e,t){let n=[],r=[],i=t;for(let[t,a]of e)i<=0?r.push([t,a]):a.length>i?(n.push([t,a.slice(0,i)]),r.push([t,a.slice(i)]),i=0):(i-=a.length,n.push([t,a]));return{visible:n,overflow:r}}function Ve(e,t){return e.some(([,e])=>e.some(e=>e.id===t))}function He(e,t,n=null){let r=k(e,t);if(r.overflow.reduce((e,[,t])=>e+t.length,0)===1)return{visible:[...r.visible,...r.overflow],overflow:[],recent:null};if(!n||r.overflow.length===0||Ve(r.visible,n.id))return{...r,recent:null};let i=k(e,Math.max(t-1,0)),a=i.overflow.map(([e,t])=>[e,t.filter(e=>e.id!==n.id)]).filter(([,e])=>e.length>0);return{visible:i.visible,overflow:a,recent:n}}var A=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform??``);function Ue(e){return e.split(`+`).map(e=>e===`Mod`?A?`⌘`:`Ctrl`:e===`Shift`?A?`⇧`:`Shift`:e===`Alt`?A?`⌥`:`Alt`:e)}function We(e){let t=[];(A?e.metaKey:e.ctrlKey)&&t.push(`Mod`),(A?e.ctrlKey:e.metaKey)&&t.push(A?`Ctrl`:`Meta`),e.altKey&&t.push(`Alt`),e.shiftKey&&t.push(`Shift`);let n=e.key;return n.length===1&&(n=n.toUpperCase()),[`Control`,`Meta`,`Alt`,`Shift`].includes(n)||t.push(n),t.join(`+`)}function Ge(e,t){let n=e??[],r=t??[];return n.length===r.length&&n.every((e,t)=>e.key===r[t]?.key)}function Ke(e,t){return e!==void 0&&!Ge(e,t)}function j(e,t,n=[]){for(let r of e){let e=t(r,n);if(e===`stop`||!(e===`skip`||!r.children?.length)&&j(r.children,t,[...n,r])===`stop`)return`stop`}}function qe(e,t){let n;return j(e,e=>{if(e.id===t)return n=e,`stop`}),n}function Je(e,t){let n=e=>!e.when||x(e.when,t),r=e=>{let t=[];for(let i of e){if(!n(i))continue;if(!i.children){t.push(i);continue}let e=r(i.children);t.push({...i,children:e})}return t};return r(e)}function Ye(e,t){let n=[];return j(e.value,e=>{for(let r of t(e.id))n.push({id:e.id,keybinding:r})}),n}var Xe={"Mod+T":`Open new tab`,"Mod+W":`Close tab`,"Mod+N":`Open new window`,"Mod+L":`Focus address bar`,"Mod+D":`Bookmark page`,"Mod+Q":`Quit browser`,"Mod+Shift+T":`Reopen closed tab`,"Mod+Shift+N":`Open incognito window`,"Mod+Shift+W":`Close window`,"Mod+Shift+Q":`Quit browser (Chrome)`,"Alt+F4":`Close window (Windows)`,"Mod+R":`Reload page`,"Mod+Shift+R":`Hard reload page`,"Mod+F":`Find in page`},Ze=`devframes:docks`;function M(e){return`${Ze}:${e}`}function Qe(e){return e.at(-1)?.id??null}function N(e,t){return e.source===`client`&&!!e.action&&!!e.children?.length&&t.some(t=>t.type===`group`&&M(t.id)===e.id)}function $e(e,t){return N(e,t)?`execute`:e.children?.length?`drill`:`execute`}function et(e,t,n,r){return N(e,t)&&n&&r===e.id}function tt(e){let t=[];return j(e,(e,n)=>{if(e.showInPalette===!1)return`skip`;let r=n.at(-1)?.title;if(t.push({entry:e,...r?{parentTitle:r}:{},searchTitle:[...n.map(e=>e.title),e.title].join(` > `)}),e.showInPalette===`without-children`)return`skip`}),t}function P(e,t){if(!t)return[];let n=[];return j(e,(e,r)=>{if(e.id===t)return e.children?.length&&(n=[...r,e].filter(e=>e.children?.length).map(e=>({id:e.id,title:e.title,items:e.children}))),`stop`}),n}function nt(e,t,n){let r=n!=null&&t.some(e=>e.id===n),i=[],a=e;for(let e of t){let t=a.find(t=>t.id===e.id);if(!t?.children?.length)break;let n=t.children;i.push({id:t.id,title:t.title,items:n}),a=n}return r&&!i.some(e=>e.id===n)?P(e,n):i}var F=o(null),I=o(null),L=o(null),R=o(null);function rt(e){F.value=e}function it(){return F}function z(e){I.value=e}function at(){return I}function ot(e){L.value=e}function st(){return L}var B=o(null);function ct(e){B.value=e}function lt(){return B}function ut(e){R.value=e}function dt(){return R}var V=o(null);function ft(e){V.value=e}function pt(){return V}var H=20,U=100,mt=320,ht=240,W=`__DEVFRAMES_TRIGGER_DOCK_ACTION__`,G=`__DEVFRAME_CONNECTION_META__`,K=o(null),q=o(!1),J=e(),Y,X,Z,Q,gt=async()=>await n(()=>import(`./DockStandalone-3_CzgPVL.js`).then(e=>e.DockStandalone),__vite__mapDeps([0,1]),import.meta.url);J.on(`popup:open-requested`,e=>{At(e)});function _t(){if(!(typeof window>`u`))return window.documentPictureInPicture}function vt(){Y?.(),Y=void 0,X?.(),X=void 0}function yt(e){return l(a,t=>{e.document.documentElement?.style.setProperty(`color-scheme`,t?`dark`:`light`)},{immediate:!0})}function bt(){Z?.remove(),Z=void 0}function $(){vt(),bt(),K.value=null,q.value=!1;let e=Q;Q=void 0,e?.docks.switchEntry(null)}function xt(e,t,n){return Math.min(Math.max(e,t),n)}function St(e,t){window.innerWidth<=0||window.innerHeight<=0||(e.panel.store.width=xt(Math.round(t.innerWidth/window.innerWidth*100),H,U),e.panel.store.height=xt(Math.round(t.innerHeight/window.innerHeight*100),H,U))}async function Ct(e,t){let n=await gt(),r=t.document.createElement(`style`);r.textContent=[`html, body {`,` margin: 0;`,` padding: 0;`,` width: 100%;`,` height: 100%;`,` overflow: hidden;`,` background: transparent;`,`}`,`#devframes-popup-root {`,` width: 100vw;`,` height: 100vh;`,`}`,`#devframes-popup-root > devframes-dock-standalone {`,` display: block;`,` width: 100%;`,` height: 100%;`,`}`].join(`
|
|
4
4
|
`),u(t.document,c().value),t.document.head?.appendChild(r),t.document.body.textContent=``,t[G]=globalThis[G]??e.rpc.connectionMeta;let a=t.document.createElement(`div`);a.id=`devframes-popup-root`,t.document.body.appendChild(a);let o=new n({context:e});i(o,c().value.primaryColor),Z=o,a.appendChild(o)}function wt(){return!!_t()?.requestWindow}function Tt(e,t){typeof window>`u`||e!==`standalone`&&(window[W]=t)}async function Et(e,t){if(!(typeof window>`u`)&&e===`standalone`)try{let e=window.opener;if(!e||e.closed)return;let n=e[W];return typeof n==`function`?await n(t):void 0}catch{return}}function Dt(){return K}function Ot(){return q}function kt(e){J.emit(`popup:open-requested`,e)}async function At(e){z(null);let t=K.value;if(t?.closed)$();else if(t)return t.focus(),t;let n=_t();if(!n?.requestWindow)return null;let r;try{let t=r=await n.requestWindow({width:Math.max(mt,Math.round(window.innerWidth*e.panel.store.width/100)),height:Math.max(ht,Math.round(window.innerHeight*e.panel.store.height/100))});await Ct(e,t),X=yt(t);let i=()=>St(e,t),a=()=>{K.value===t&&$()};return t.addEventListener(`resize`,i),t.addEventListener(`pagehide`,a),Y=()=>{t.removeEventListener(`resize`,i),t.removeEventListener(`pagehide`,a)},Q=e,K.value=t,q.value=!0,t}catch{return r&&!r.closed&&r.close(),$(),null}}export{x as $,Ue as A,Me as B,Qe as C,Ye as D,Xe as E,Be as F,E as G,ke as H,O as I,be as J,Ne as K,He as L,A as M,We as N,Je as O,j as P,_e as Q,Oe as R,P as S,$e as T,De as U,je as V,Te as W,ge as X,S as Y,ve as Z,pt as _,Dt as a,tt as b,ct as c,ft as d,g as et,rt as f,st as g,at as h,Et as i,Ke as j,qe as k,z as l,lt as m,Tt as n,re as nt,Ot as o,dt as p,Se as q,kt as r,p as rt,ut as s,wt as t,ee as tt,ot as u,it as v,nt as w,et as x,M as y,Ae as z};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devframes/hub-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.10",
|
|
5
5
|
"description": "Reference UI for the devframe hub, providing the floating dock and standalone viewer.",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@devframes/hub": "0.9.
|
|
33
|
-
"@devframes/json-render": "0.9.
|
|
34
|
-
"devframe": "0.9.
|
|
32
|
+
"@devframes/hub": "0.9.10",
|
|
33
|
+
"@devframes/json-render": "0.9.10",
|
|
34
|
+
"devframe": "0.9.10"
|
|
35
35
|
},
|
|
36
36
|
"peerDependenciesMeta": {
|
|
37
37
|
"@devframes/json-render": {
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@antfu/design": "^0.4.0",
|
|
43
|
-
"@devframes/hub": "0.9.
|
|
44
|
-
"@devframes/json-render": "0.9.
|
|
45
|
-
"@devframes/plugin-git": "0.9.
|
|
43
|
+
"@devframes/hub": "0.9.10",
|
|
44
|
+
"@devframes/json-render": "0.9.10",
|
|
45
|
+
"@devframes/plugin-git": "0.9.10",
|
|
46
46
|
"@iconify-json/ph": "^1.2.2",
|
|
47
47
|
"@storybook/addon-docs": "^10.5.10",
|
|
48
48
|
"@storybook/vue3-vite": "^10.5.10",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@unocss/reset": "^66.8.1",
|
|
51
51
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
52
52
|
"@vueuse/core": "^14.4.0",
|
|
53
|
-
"devframe": "0.9.
|
|
53
|
+
"devframe": "0.9.10",
|
|
54
54
|
"dompurify": "^3.4.14",
|
|
55
55
|
"fuse.js": "^7.5.0",
|
|
56
56
|
"iframe-pane": "^1.1.0",
|