@stacksjs/desktop 0.70.15 → 0.70.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -5
- package/package.json +14 -12
package/dist/index.js
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
try setting the \`responseType\` option to \`ResponseType.Text\` or \`ResponseType.Binary\` if the API does not return a JSON response.`)}return Z}return Z})}async get(J,K){return this.request({method:"GET",url:J,...K})}async post(J,K,X){return this.request({method:"POST",url:J,body:K,...X})}async put(J,K,X){return this.request({method:"PUT",url:J,body:K,...X})}async patch(J,K){return this.request({method:"PATCH",url:J,...K})}async delete(J,K){return this.request({method:"DELETE",url:J,...K})}}async function Y9(J){return Q({__tauriModule:"Http",message:{cmd:"createClient",options:J}}).then((K)=>new y(K))}var D=null;async function l9(J,K){var X;if(D===null)D=await Y9();return D.request({url:J,method:(X=K===null||K===void 0?void 0:K.method)!==null&&X!==void 0?X:"GET",...K})}var u={};O(u,{mockWindows:()=>s9,mockIPC:()=>p9,mockConvertFileSrc:()=>r9,clearMocks:()=>n9});function p9(J){window.__TAURI_IPC__=async({cmd:K,callback:X,error:V,...Z})=>{try{window[`_${X}`](await J(K,Z))}catch(Y){window[`_${V}`](Y)}}}function s9(J,...K){window.__TAURI_METADATA__={__windows:[J,...K].map((X)=>({label:X})),__currentWindow:{label:J}}}function r9(J,K="https"){var X;window.__TAURI__=(X=window.__TAURI__)!==null&&X!==void 0?X:{},window.__TAURI__.convertFileSrc=function(V,Z="asset"){let Y=encodeURIComponent(V);return J==="windows"?`${K}://${Z}.localhost/${Y}`:`${Z}://localhost/${Y}`}}function n9(){var J;if((J=window.__TAURI__)===null||J===void 0?void 0:J.convertFileSrc)delete window.__TAURI__.convertFileSrc;if(window.__TAURI_IPC__)delete window.__TAURI_IPC__;if(window.__TAURI_METADATA__)delete window.__TAURI_METADATA__}var v={};O(v,{sendNotification:()=>i9,requestPermission:()=>a9,isPermissionGranted:()=>o9});async function o9(){if(window.Notification.permission!=="default")return Promise.resolve(window.Notification.permission==="granted");return Q({__tauriModule:"Notification",message:{cmd:"isNotificationPermissionGranted"}})}async function a9(){return window.Notification.requestPermission()}function i9(J){if(typeof J==="string")new window.Notification(J);else new window.Notification(J.title,J)}var d={};O(d,{version:()=>JJ,type:()=>KJ,tempdir:()=>XJ,platform:()=>e9,locale:()=>ZJ,arch:()=>QJ,EOL:()=>t9});function L(){return navigator.appVersion.includes("Win")}var t9=L()?`\r
|
|
4
|
-
`:`
|
|
5
|
-
`;async function e9(){return Q({__tauriModule:"Os",message:{cmd:"platform"}})}async function JJ(){return Q({__tauriModule:"Os",message:{cmd:"version"}})}async function KJ(){return Q({__tauriModule:"Os",message:{cmd:"osType"}})}async function QJ(){return Q({__tauriModule:"Os",message:{cmd:"arch"}})}async function XJ(){return Q({__tauriModule:"Os",message:{cmd:"tempdir"}})}async function ZJ(){return Q({__tauriModule:"Os",message:{cmd:"locale"}})}var c={};O(c,{videoDir:()=>PJ,templateDir:()=>zJ,sep:()=>fJ,runtimeDir:()=>_J,resourceDir:()=>WJ,resolveResource:()=>RJ,resolve:()=>gJ,publicDir:()=>xJ,pictureDir:()=>NJ,normalize:()=>wJ,logDir:()=>EJ,localDataDir:()=>jJ,join:()=>BJ,isAbsolute:()=>TJ,homeDir:()=>AJ,fontDir:()=>LJ,extname:()=>kJ,executableDir:()=>FJ,downloadDir:()=>UJ,documentDir:()=>SJ,dirname:()=>CJ,desktopDir:()=>MJ,delimiter:()=>bJ,dataDir:()=>qJ,configDir:()=>OJ,cacheDir:()=>IJ,basename:()=>DJ,audioDir:()=>HJ,appLogDir:()=>$9,appLocalDataDir:()=>GJ,appDir:()=>VJ,appDataDir:()=>YJ,appConfigDir:()=>G9,appCacheDir:()=>$J,BaseDirectory:()=>$});async function VJ(){return G9()}async function G9(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.AppConfig}})}async function YJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.AppData}})}async function GJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.AppLocalData}})}async function $J(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.AppCache}})}async function HJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Audio}})}async function IJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Cache}})}async function OJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Config}})}async function qJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Data}})}async function MJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Desktop}})}async function SJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Document}})}async function UJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Download}})}async function FJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Executable}})}async function LJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Font}})}async function AJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Home}})}async function jJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.LocalData}})}async function NJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Picture}})}async function xJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Public}})}async function WJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Resource}})}async function RJ(J){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:J,directory:$.Resource}})}async function _J(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Runtime}})}async function zJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Template}})}async function PJ(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.Video}})}async function EJ(){return $9()}async function $9(){return Q({__tauriModule:"Path",message:{cmd:"resolvePath",path:"",directory:$.AppLog}})}var fJ=L()?"\\":"/",bJ=L()?";":":";async function gJ(...J){return Q({__tauriModule:"Path",message:{cmd:"resolve",paths:J}})}async function wJ(J){return Q({__tauriModule:"Path",message:{cmd:"normalize",path:J}})}async function BJ(...J){return Q({__tauriModule:"Path",message:{cmd:"join",paths:J}})}async function CJ(J){return Q({__tauriModule:"Path",message:{cmd:"dirname",path:J}})}async function kJ(J){return Q({__tauriModule:"Path",message:{cmd:"extname",path:J}})}async function DJ(J,K){return Q({__tauriModule:"Path",message:{cmd:"basename",path:J,ext:K}})}async function TJ(J){return Q({__tauriModule:"Path",message:{cmd:"isAbsolute",path:J}})}var m={};O(m,{relaunch:()=>hJ,exit:()=>yJ});async function yJ(J=0){return Q({__tauriModule:"Process",message:{cmd:"exit",exitCode:J}})}async function hJ(){return Q({__tauriModule:"Process",message:{cmd:"relaunch"}})}var r={};O(r,{open:()=>s,EventEmitter:()=>A,Command:()=>p,Child:()=>l});class A{constructor(){this.eventListeners=Object.create(null)}addListener(J,K){return this.on(J,K)}removeListener(J,K){return this.off(J,K)}on(J,K){if(J in this.eventListeners)this.eventListeners[J].push(K);else this.eventListeners[J]=[K];return this}once(J,K){let X=(...V)=>{this.removeListener(J,X),K(...V)};return this.addListener(J,X)}off(J,K){if(J in this.eventListeners)this.eventListeners[J]=this.eventListeners[J].filter((X)=>X!==K);return this}removeAllListeners(J){if(J)delete this.eventListeners[J];else this.eventListeners=Object.create(null);return this}emit(J,...K){if(J in this.eventListeners){let X=this.eventListeners[J];for(let V of X)V(...K);return!0}return!1}listenerCount(J){if(J in this.eventListeners)return this.eventListeners[J].length;return 0}prependListener(J,K){if(J in this.eventListeners)this.eventListeners[J].unshift(K);else this.eventListeners[J]=[K];return this}prependOnceListener(J,K){let X=(...V)=>{this.removeListener(J,X),K(...V)};return this.prependListener(J,X)}}class l{constructor(J){this.pid=J}async write(J){return Q({__tauriModule:"Shell",message:{cmd:"stdinWrite",pid:this.pid,buffer:typeof J==="string"?J:Array.from(J)}})}async kill(){return Q({__tauriModule:"Shell",message:{cmd:"killChild",pid:this.pid}})}}class p extends A{constructor(J,K=[],X){super();this.stdout=new A,this.stderr=new A,this.program=J,this.args=typeof K==="string"?[K]:K,this.options=X!==null&&X!==void 0?X:{}}static sidecar(J,K=[],X){let V=new p(J,K,X);return V.options.sidecar=!0,V}async spawn(){let J=this.program,K=this.args,X=this.options;if(typeof K==="object")Object.freeze(K);return Q({__tauriModule:"Shell",message:{cmd:"execute",program:J,args:K,options:X,onEventFn:q((Z)=>{switch(Z.event){case"Error":this.emit("error",Z.payload);break;case"Terminated":this.emit("close",Z.payload);break;case"Stdout":this.stdout.emit("data",Z.payload);break;case"Stderr":this.stderr.emit("data",Z.payload);break}})}}).then((Z)=>new l(Z))}async execute(){let J=this.program,K=this.args,X=this.options;if(typeof K==="object")Object.freeze(K);return Q({__tauriModule:"Shell",message:{cmd:"executeAndReturn",program:J,args:K,options:X}})}}async function s(J,K){return Q({__tauriModule:"Shell",message:{cmd:"open",path:J,with:K}})}var o={};O(o,{onUpdaterEvent:()=>n,installUpdate:()=>uJ,checkUpdate:()=>vJ});async function n(J){return g(I.STATUS_UPDATE,(K)=>{J(K===null||K===void 0?void 0:K.payload)})}async function uJ(){let J;function K(){if(J)J();J=void 0}return new Promise((X,V)=>{function Z(Y){if(Y.error){K(),V(Y.error);return}if(Y.status==="DONE")K(),X()}n(Z).then((Y)=>{J=Y}).catch((Y)=>{throw K(),Y}),R(I.INSTALL_UPDATE).catch((Y)=>{throw K(),Y})})}async function vJ(){let J;function K(){if(J)J();J=void 0}return new Promise((X,V)=>{function Z(G){K(),X({manifest:G,shouldUpdate:!0})}function Y(G){if(G.error){K(),V(G.error);return}if(G.status==="UPTODATE")K(),X({shouldUpdate:!1})}w(I.UPDATE_AVAILABLE,(G)=>{Z(G===null||G===void 0?void 0:G.payload)}).catch((G)=>{throw K(),G}),n(Y).then((G)=>{J=G}).catch((G)=>{throw K(),G}),R(I.CHECK_UPDATE).catch((G)=>{throw K(),G})})}var Z9={};O(Z9,{primaryMonitor:()=>mJ,getCurrent:()=>dJ,getAll:()=>a,currentMonitor:()=>cJ,availableMonitors:()=>lJ,appWindow:()=>i,WindowManager:()=>K9,WebviewWindowHandle:()=>J9,WebviewWindow:()=>M,UserAttentionType:()=>_,PhysicalSize:()=>j,PhysicalPosition:()=>N,LogicalSize:()=>t,LogicalPosition:()=>e,CloseRequestedEvent:()=>Q9});class t{constructor(J,K){this.type="Logical",this.width=J,this.height=K}}class j{constructor(J,K){this.type="Physical",this.width=J,this.height=K}toLogical(J){return new t(this.width/J,this.height/J)}}class e{constructor(J,K){this.type="Logical",this.x=J,this.y=K}}class N{constructor(J,K){this.type="Physical",this.x=J,this.y=K}toLogical(J){return new e(this.x/J,this.y/J)}}var _;(function(J){J[J.Critical=1]="Critical",J[J.Informational=2]="Informational"})(_||(_={}));function dJ(){return new M(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})}function a(){return window.__TAURI_METADATA__.__windows.map((J)=>new M(J.label,{skip:!0}))}var H9=["tauri://created","tauri://error"];class J9{constructor(J){this.label=J,this.listeners=Object.create(null)}async listen(J,K){if(this._handleTauriEvent(J,K))return Promise.resolve(()=>{let X=this.listeners[J];X.splice(X.indexOf(K),1)});return U(J,this.label,K)}async once(J,K){if(this._handleTauriEvent(J,K))return Promise.resolve(()=>{let X=this.listeners[J];X.splice(X.indexOf(K),1)});return W(J,this.label,K)}async emit(J,K){if(H9.includes(J)){for(let X of this.listeners[J]||[])X({event:J,id:-1,windowLabel:this.label,payload:K});return Promise.resolve()}return x(J,this.label,K)}_handleTauriEvent(J,K){if(H9.includes(J)){if(!(J in this.listeners))this.listeners[J]=[K];else this.listeners[J].push(K);return!0}return!1}}class K9 extends J9{async scaleFactor(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"scaleFactor"}}}})}async innerPosition(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerPosition"}}}}).then(({x:J,y:K})=>new N(J,K))}async outerPosition(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerPosition"}}}}).then(({x:J,y:K})=>new N(J,K))}async innerSize(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"innerSize"}}}}).then(({width:J,height:K})=>new j(J,K))}async outerSize(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"outerSize"}}}}).then(({width:J,height:K})=>new j(J,K))}async isFullscreen(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFullscreen"}}}})}async isMinimized(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimized"}}}})}async isMaximized(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximized"}}}})}async isFocused(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isFocused"}}}})}async isDecorated(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isDecorated"}}}})}async isResizable(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isResizable"}}}})}async isMaximizable(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMaximizable"}}}})}async isMinimizable(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isMinimizable"}}}})}async isClosable(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isClosable"}}}})}async isVisible(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"isVisible"}}}})}async title(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"title"}}}})}async theme(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"theme"}}}})}async center(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"center"}}}})}async requestUserAttention(J){let K=null;if(J)if(J===_.Critical)K={type:"Critical"};else K={type:"Informational"};return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"requestUserAttention",payload:K}}}})}async setResizable(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setResizable",payload:J}}}})}async setMaximizable(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaximizable",payload:J}}}})}async setMinimizable(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinimizable",payload:J}}}})}async setClosable(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setClosable",payload:J}}}})}async setTitle(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setTitle",payload:J}}}})}async maximize(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"maximize"}}}})}async unmaximize(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unmaximize"}}}})}async toggleMaximize(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"toggleMaximize"}}}})}async minimize(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"minimize"}}}})}async unminimize(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"unminimize"}}}})}async show(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"show"}}}})}async hide(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"hide"}}}})}async close(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"close"}}}})}async setDecorations(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setDecorations",payload:J}}}})}async setAlwaysOnTop(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setAlwaysOnTop",payload:J}}}})}async setContentProtected(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setContentProtected",payload:J}}}})}async setSize(J){if(!J||J.type!=="Logical"&&J.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSize",payload:{type:J.type,data:{width:J.width,height:J.height}}}}}})}async setMinSize(J){if(J&&J.type!=="Logical"&&J.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMinSize",payload:J?{type:J.type,data:{width:J.width,height:J.height}}:null}}}})}async setMaxSize(J){if(J&&J.type!=="Logical"&&J.type!=="Physical")throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setMaxSize",payload:J?{type:J.type,data:{width:J.width,height:J.height}}:null}}}})}async setPosition(J){if(!J||J.type!=="Logical"&&J.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setPosition",payload:{type:J.type,data:{x:J.x,y:J.y}}}}}})}async setFullscreen(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFullscreen",payload:J}}}})}async setFocus(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setFocus"}}}})}async setIcon(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIcon",payload:{icon:typeof J==="string"?J:Array.from(J)}}}}})}async setSkipTaskbar(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setSkipTaskbar",payload:J}}}})}async setCursorGrab(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorGrab",payload:J}}}})}async setCursorVisible(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorVisible",payload:J}}}})}async setCursorIcon(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorIcon",payload:J}}}})}async setCursorPosition(J){if(!J||J.type!=="Logical"&&J.type!=="Physical")throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setCursorPosition",payload:{type:J.type,data:{x:J.x,y:J.y}}}}}})}async setIgnoreCursorEvents(J){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"setIgnoreCursorEvents",payload:J}}}})}async startDragging(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{label:this.label,cmd:{type:"startDragging"}}}})}async onResized(J){return this.listen(I.WINDOW_RESIZED,(K)=>{K.payload=O9(K.payload),J(K)})}async onMoved(J){return this.listen(I.WINDOW_MOVED,(K)=>{K.payload=I9(K.payload),J(K)})}async onCloseRequested(J){return this.listen(I.WINDOW_CLOSE_REQUESTED,(K)=>{let X=new Q9(K);Promise.resolve(J(X)).then(()=>{if(!X.isPreventDefault())return this.close()})})}async onFocusChanged(J){let K=await this.listen(I.WINDOW_FOCUS,(V)=>{J({...V,payload:!0})}),X=await this.listen(I.WINDOW_BLUR,(V)=>{J({...V,payload:!1})});return()=>{K(),X()}}async onScaleChanged(J){return this.listen(I.WINDOW_SCALE_FACTOR_CHANGED,J)}async onMenuClicked(J){return this.listen(I.MENU,J)}async onFileDropEvent(J){let K=await this.listen(I.WINDOW_FILE_DROP,(Z)=>{J({...Z,payload:{type:"drop",paths:Z.payload}})}),X=await this.listen(I.WINDOW_FILE_DROP_HOVER,(Z)=>{J({...Z,payload:{type:"hover",paths:Z.payload}})}),V=await this.listen(I.WINDOW_FILE_DROP_CANCELLED,(Z)=>{J({...Z,payload:{type:"cancel"}})});return()=>{K(),X(),V()}}async onThemeChanged(J){return this.listen(I.WINDOW_THEME_CHANGED,J)}}class Q9{constructor(J){this._preventDefault=!1,this.event=J.event,this.windowLabel=J.windowLabel,this.id=J.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}class M extends K9{constructor(J,K={}){super(J);if(!(K===null||K===void 0?void 0:K.skip))Q({__tauriModule:"Window",message:{cmd:"createWebview",data:{options:{label:J,...K}}}}).then(async()=>this.emit("tauri://created")).catch(async(X)=>this.emit("tauri://error",X))}static getByLabel(J){if(a().some((K)=>K.label===J))return new M(J,{skip:!0});return null}static async getFocusedWindow(){for(let J of a())if(await J.isFocused())return J;return null}}var i;if("__TAURI_METADATA__"in window)i=new M(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0});else console.warn(`Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.
|
|
6
|
-
Note that this is not an issue if running this frontend on a browser instead of a Tauri window.`),i=new M("main",{skip:!0});function X9(J){return J===null?null:{name:J.name,scaleFactor:J.scaleFactor,position:I9(J.position),size:O9(J.size)}}function I9(J){return new N(J.x,J.y)}function O9(J){return new j(J.width,J.height)}async function cJ(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"currentMonitor"}}}}).then(X9)}async function mJ(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"primaryMonitor"}}}}).then(X9)}async function lJ(){return Q({__tauriModule:"Window",message:{cmd:"manage",data:{cmd:{type:"availableMonitors"}}}}).then((J)=>J.map(X9))}var jK="testing this";var WK={app:E,event:B,clipboard:f,dialog:b,fs:C,globalShortcut:k,http:h,mocks:u,notification:v,os:d,path:c,process:m,shell:r,tauri:P,updater:o,window:Z9};async function RK(J){await s(J)}export{jK as testingThis,RK as openShell,WK as desktop};
|
|
2
|
+
async function g(c,f){return!1}export{g as openDevWindow};
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/desktop",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.70.
|
|
4
|
+
"version": "0.70.23",
|
|
5
5
|
"description": "The Stacks Desktop engine.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
|
-
"contributors": [
|
|
7
|
+
"contributors": [
|
|
8
|
+
"Chris Breuer <chris@stacksjs.com>"
|
|
9
|
+
],
|
|
8
10
|
"license": "MIT",
|
|
9
11
|
"funding": "https://github.com/sponsors/chrisbbreuer",
|
|
10
12
|
"homepage": "https://github.com/stacksjs/stacks/tree/main/storage/framework/core/desktop#readme",
|
|
@@ -31,15 +33,21 @@
|
|
|
31
33
|
],
|
|
32
34
|
"exports": {
|
|
33
35
|
".": {
|
|
36
|
+
"bun": "./src/index.ts",
|
|
37
|
+
"types": "./dist/index.d.ts",
|
|
34
38
|
"import": "./dist/index.js"
|
|
35
39
|
},
|
|
36
40
|
"./*": {
|
|
41
|
+
"bun": "./src/*",
|
|
37
42
|
"import": "./dist/*"
|
|
38
43
|
}
|
|
39
44
|
},
|
|
40
45
|
"module": "dist/index.js",
|
|
41
46
|
"types": "dist/index.d.ts",
|
|
42
|
-
"files": [
|
|
47
|
+
"files": [
|
|
48
|
+
"README.md",
|
|
49
|
+
"dist"
|
|
50
|
+
],
|
|
43
51
|
"scripts": {
|
|
44
52
|
"dev": "bunx --bun vite ../../dashboard -c ../vite-config/src/desktop.ts",
|
|
45
53
|
"dev:app": "tauri dev",
|
|
@@ -50,14 +58,8 @@
|
|
|
50
58
|
"prepublishOnly": "bun run build"
|
|
51
59
|
},
|
|
52
60
|
"devDependencies": {
|
|
53
|
-
"@stacksjs/build": "0.70.
|
|
54
|
-
"
|
|
55
|
-
"@stacksjs/server": "0.70.
|
|
56
|
-
"@tauri-apps/api": "^1.6.0",
|
|
57
|
-
"@tauri-apps/cli": "^1.6.3",
|
|
58
|
-
"@types/d3": "^7.4.3",
|
|
59
|
-
"d3": "^7.9.0",
|
|
60
|
-
"unified-network": "^0.6.4",
|
|
61
|
-
"vue": "^3.5.13"
|
|
61
|
+
"@stacksjs/build": "0.70.23",
|
|
62
|
+
"better-dx": "^0.2.12",
|
|
63
|
+
"@stacksjs/server": "0.70.23"
|
|
62
64
|
}
|
|
63
65
|
}
|