@stacksjs/desktop 0.2.636 → 0.2.637
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/browser.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{P,c,r,S,k,A,C,I,T,E,M,D,t,p,B,O,R,f,L,_,N,F,W,z,H,U,n,q,V,j,K,G,Y,X,l,J,Q,Z,ee,m,te,re,g,ne,oe,ie,ae,se,ce,le,de,ue,pe,fe,me,ge,he,we,be,xe,ye,ve,Pe,Se,ke,Ae,Ce,h,Ie,$e,Te,Ee,Me,De,Be,Oe,Re,o,w,b,Le,i,_e,Ne,Fe,x,y,a,s,We,d,ze,He,Ue,qe,Ve,je,Ke,Ge,Ye,Xe,Je,Qe,Ze,et,tt,rt,nt,ot,it,at,v,st}from"./chunk-
|
|
2
|
+
import{P,c,r,S,k,A,C,I,T,E,M,D,t,p,B,O,R,f,L,_,N,F,W,z,H,U,n,q,V,j,K,G,Y,X,l,J,Q,Z,ee,m,te,re,g,ne,oe,ie,ae,se,ce,le,de,ue,pe,fe,me,ge,he,we,be,xe,ye,ve,Pe,Se,ke,Ae,Ce,h,Ie,$e,Te,Ee,Me,De,Be,Oe,Re,o,w,b,Le,i,_e,Ne,Fe,x,y,a,s,We,d,ze,He,Ue,qe,Ve,je,Ke,Ge,Ye,Xe,Je,Qe,Ze,et,tt,rt,nt,ot,it,at,v,st}from"./chunk-tyk2bp3f.js";export{a as DEFAULT_WATCH_INTERVAL_MS,y as MAX_WATCH_INTERVAL_MS,x as MIN_WATCH_INTERVAL_MS,z as MODAL_STYLES,D as TOAST_STYLES,_ as alert,Se as app,je as appleScript,Ve as audio,xe as battery,qe as biometric,Oe as bluetooth,Je as bonjour,X as caffeinate,de as clipboard,W as closeAllModals,L as confirm,Ce as contextMenu,nt as continuityCamera,rt as coreml,o as crashReporter,ae as createInterval,ie as createTimer,l as decaffeinate,be as deepLinks,se as delay,T as dismissAlertById,E as dismissAllAlerts,he as dragOut,Ke as fileAssociations,d as focus,He as focusShortcutsReady,le as formatCompact,ee as formatDuration,Z as formatRemainingTime,te as formatShortcut,ce as formatTime,pe as fs,M as getActiveAlertCount,F as getActiveModalCount,Q as getCaffeinateStatus,at as getCapabilities,v as getCapability,Y as getDialogBridgeScript,oe as getRegisteredHotkeys,me as globalShortcuts,i as handoff,ze as hasFocusShortcuts,Le as iap,st as isAvailable,J as isCaffeinated,we as isDragOutAvailable,$e as keychain,_e as liveActivities,Ue as localServer,Ne as location,Xe as log,Ae as menu,tt as midi,Me as nativeAutoLaunch,De as nativeWindow,ye as network,ue as notifications,I as notify,m as parseShortcut,Ye as pdf,Te as permissions,Ee as printing,N as prompt,w as redactPII,re as registerHotkey,P as requestNotificationPermission,Ie as screen,Fe as screenCapture,s as screenSharing,it as serial,ot as serviceMenu,fe as shell,c as showAlert,V as showAlertDialog,q as showColorPicker,j as showConfirmDialog,K as showErrorDialog,O as showErrorModal,C as showErrorToast,p as showInfoModal,S as showInfoToast,n as showMessageBox,t as showModal,H as showOpenDialog,f as showQuestionModal,U as showSaveDialog,R as showSuccessModal,k as showSuccessToast,r as showToast,G as showWarningDialog,B as showWarningModal,A as showWarningToast,h as sidebar,b as signPayload,Re as speech,Ze as speechRecognition,Qe as spotlight,ke as standardMenus,Ge as tags,ge as theme,Be as touchbar,ne as unregisterAllHotkeys,g as unregisterHotkey,ve as updater,et as vision,We as watchScreenSharing,Pe as windowEvents};
|
|
@@ -255,7 +255,7 @@ var u=import.meta.require;function Dr(){if(typeof Notification<"u"&&Notification
|
|
|
255
255
|
}
|
|
256
256
|
`;function sr(ct){let dt=new Set(ct.properties??[]);if(ct.canChooseDirectories)dt.add("openDirectory");if(ct.canChooseFiles)dt.add("openFile");if(ct.multiSelections)dt.add("multiSelections");if(ct.showHiddenFiles)dt.add("showHiddenFiles");if(ct.canCreateDirectories)dt.add("createDirectory");return{...ct,properties:[...dt]}}function Ur(){if(typeof window>"u")return;return window.craft?.dialog}var qr={error:"critical",warning:"warning",question:"info",info:"info",none:"info"};function $r(ct){let dt=[ct.title?ct.message:"",ct.detail??""].filter(Boolean).join(`
|
|
257
257
|
|
|
258
|
-
`);return{title:ct.title||ct.message,message:dt||void 0,style:qr[ct.type??"none"]??"info",buttons:ct.buttons}}function cr(ct,dt){if(typeof ct==="number"&&Number.isFinite(ct))return{response:ct};if(ct&&typeof ct==="object"){let ut=ct;if(typeof ut.response==="number")return{response:ut.response};if(typeof ut.buttonIndex==="number")return{response:ut.buttonIndex}}let lt=dt.buttons??["OK"];return{response:dt.cancelButton??Math.max(0,lt.length-1)}}function Yt(){if(typeof window<"u"&&window.craft?.dialog)return!0;return!1}async function H(ct={}){if(Yt())
|
|
258
|
+
`);return{title:ct.title||ct.message,message:dt||void 0,style:qr[ct.type??"none"]??"info",buttons:ct.buttons}}function cr(ct,dt){if(typeof ct==="number"&&Number.isFinite(ct))return{response:ct};if(ct&&typeof ct==="object"){let ut=ct;if(typeof ut.response==="number")return{response:ut.response};if(typeof ut.buttonIndex==="number")return{response:ut.buttonIndex}}let lt=dt.buttons??["OK"];return{response:dt.cancelButton??Math.max(0,lt.length-1)}}function Yt(){if(typeof window<"u"&&window.craft?.dialog)return!0;return!1}async function H(ct={}){if(Yt())return await window.craft.dialog.showOpenDialog(sr(ct));return new Promise((dt)=>{if(typeof document>"u"){dt({canceled:!0,filePaths:[]});return}let lt=new Set(sr(ct).properties),ut=document.createElement("input");if(ut.type="file",ut.multiple=lt.has("multiSelections"),ct.filters?.length){let ft=ct.filters.flatMap((pt)=>pt.extensions.map((gt)=>`.${gt}`));ut.accept=ft.join(",")}if(lt.has("openDirectory")&&!lt.has("openFile"))ut.webkitdirectory=!0;ut.onchange=()=>{let ft=Array.from(ut.files||[]);if(ft.length===0)dt({canceled:!0,filePaths:[]});else{let pt=ft.map((gt)=>gt.name);dt({canceled:!1,filePaths:pt})}},ut.oncancel=()=>{dt({canceled:!0,filePaths:[]})},ut.click()})}async function U(ct={}){if(Yt()){let lt=window;try{return await lt.craft.dialog.showSaveDialog(ct)}catch(ut){console.warn("[stx-dialog] Failed to show native save dialog:",ut)}}if(typeof window<"u"&&"showSaveFilePicker"in window)try{let lt=ct.filters?.map((ft)=>({description:ft.name,accept:{"*/*":ft.extensions.map((pt)=>`.${pt}`)}}));return{canceled:!1,filePath:(await window.showSaveFilePicker({suggestedName:ct.defaultPath,types:lt})).name}}catch(lt){return{canceled:!0}}console.warn("[stx-dialog] Save dialog not available, using prompt fallback");let dt=prompt("Enter filename:",ct.defaultPath||"file.txt");if(dt)return{canceled:!1,filePath:dt};return{canceled:!0}}async function n(ct){let dt=Ur();if(typeof dt?.showMessageBox==="function")try{return cr(await dt.showMessageBox(ct),ct)}catch(wt){console.warn("[stx-dialog] Failed to show native message box:",wt)}else if(typeof dt?.showAlert==="function")try{return cr(await dt.showAlert($r(ct)),ct)}catch(wt){console.warn("[stx-dialog] Failed to show native alert:",wt)}let lt=ct.buttons||["OK"],ut=ct.detail?`
|
|
259
259
|
|
|
260
260
|
${ct.detail}`:"",ft=`${ct.message}${ut}`;if(lt.length===1)return alert(ft),{response:0};let pt=ct.cancelButton??lt.length-1,gt=ct.defaultButton!==void 0&&ct.defaultButton!==pt?ct.defaultButton:lt.findIndex((wt,ht)=>ht!==pt);if(lt.length>2)console.warn(`[stx-dialog] ${lt.length} buttons requested; a browser confirm offers two. Reachable: "${lt[gt]}" and "${lt[pt]}".`);return{response:confirm(ft)?gt:pt}}async function q(ct={}){if(Yt()){let dt=window;try{return await dt.craft.dialog.showColorPicker(ct)}catch(lt){console.warn("[stx-dialog] Failed to show native color picker:",lt)}}return new Promise((dt)=>{if(typeof document>"u"){dt({canceled:!0});return}let lt=document.createElement("input");lt.type="color",lt.value=ct.color||"#000000",lt.onchange=()=>{dt({canceled:!1,color:lt.value})},lt.oncancel=()=>{dt({canceled:!0})},lt.click()})}async function V(ct,dt){await n({type:"info",title:dt||"Alert",message:ct,buttons:["OK"]})}async function j(ct,dt){return(await n({type:"question",title:dt||"Confirm",message:ct,buttons:["OK","Cancel"],defaultButton:0,cancelButton:1})).response===0}async function K(ct,dt){await n({type:"error",title:dt||"Error",message:ct,buttons:["OK"]})}async function G(ct,dt){await n({type:"warning",title:dt||"Warning",message:ct,buttons:["OK"]})}function Y(){return`
|
|
261
261
|
// STX Desktop Dialog Bridge
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{u,P,c,r,S,k,A,C,I,T,E,M,D,t,p,B,O,R,f,L,_,N,F,W,z,H,U,n,q,V,j,K,G,Y,X,l,J,Q,Z,ee,m,te,re,g,ne,oe,ie,ae,se,ce,le,e,de,ue,pe,fe,me,ge,he,we,be,xe,ye,ve,Pe,Se,ke,Ae,Ce,h,Ie,$e,Te,Ee,Me,De,Be,Oe,Re,o,w,b,Le,i,_e,Ne,Fe,x,y,a,s,We,d,ze,He,Ue,qe,Ve,je,Ke,Ge,Ye,Xe,Je,Qe,Ze,et,tt,rt,nt,ot,it,at,v,st}from"./chunk-
|
|
2
|
+
import{u,P,c,r,S,k,A,C,I,T,E,M,D,t,p,B,O,R,f,L,_,N,F,W,z,H,U,n,q,V,j,K,G,Y,X,l,J,Q,Z,ee,m,te,re,g,ne,oe,ie,ae,se,ce,le,e,de,ue,pe,fe,me,ge,he,we,be,xe,ye,ve,Pe,Se,ke,Ae,Ce,h,Ie,$e,Te,Ee,Me,De,Be,Oe,Re,o,w,b,Le,i,_e,Ne,Fe,x,y,a,s,We,d,ze,He,Ue,qe,Ve,je,Ke,Ge,Ye,Xe,Je,Qe,Ze,et,tt,rt,nt,ot,it,at,v,st}from"./chunk-tyk2bp3f.js";function Tt(lt="stx"){return`${lt}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function vt(lt){return lt.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function St(...lt){return lt.filter(Boolean).join(" ")}function Pt(lt){if(!lt)return"";return Object.entries(lt).map(([dt,ct])=>`${dt.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${ct}`).join("; ")}function Po(lt){let{text:dt,variant:ct="primary",size:pt="medium",disabled:ut=!1,loading:ft=!1,icon:bt,iconPosition:mt="left",id:xt=Tt("btn"),className:yt,style:ht}=lt,wt=St("stx-button",`stx-button--${ct}`,`stx-button--${pt}`,ut&&"stx-button--disabled",ft&&"stx-button--loading",yt),gt=Pt(ht),$t=bt?`<span class="stx-button-icon">${bt}</span>`:"",kt=ft?'<span class="stx-button-spinner"></span>':"",Ct=mt==="left"?`${$t}${kt}<span class="stx-button-text">${vt(dt)}</span>`:`<span class="stx-button-text">${vt(dt)}</span>${$t}${kt}`;return`<button id="${xt}" class="${wt}" ${ut||ft?"disabled":""} ${gt?`style='${gt}'`:""}>${Ct}</button>`}function So(lt){let{value:dt="",placeholder:ct="",type:pt="text",disabled:ut=!1,readonly:ft=!1,maxLength:bt,minLength:mt,pattern:xt,required:yt=!1,autocomplete:ht,label:wt,error:gt,hint:$t,id:kt=Tt("input"),className:Ct,style:At}=lt,It=St("stx-input",gt&&"stx-input--error",ut&&"stx-input--disabled",Ct),Wt=Pt(At),ko=[`type="${pt}"`,`id="${kt}"`,`class="${It}"`,dt&&`value="${vt(dt)}"`,ct&&`placeholder="${vt(ct)}"`,ut&&"disabled",ft&&"readonly",yt&&"required",bt&&`maxlength="${bt}"`,mt&&`minlength="${mt}"`,xt&&`pattern="${vt(xt)}"`,ht&&`autocomplete="${ht}"`,Wt&&`style="${Wt}"`].filter(Boolean).join(" "),_t="";if(wt)_t+=`<label class="stx-input-label" for="${kt}">${vt(wt)}</label>`;if(_t+=`<input ${ko} />`,gt)_t+=`<div class="stx-input-error">${vt(gt)}</div>`;else if($t)_t+=`<div class="stx-input-hint">${vt($t)}</div>`;return`<div class="stx-input-wrapper">${_t}</div>`}function To(lt){let{checked:dt=!1,label:ct,disabled:pt=!1,indeterminate:ut=!1,id:ft=Tt("checkbox"),className:bt,style:mt}=lt,xt=St("stx-checkbox",pt&&"stx-checkbox--disabled",bt),yt=Pt(mt),ht=['type="checkbox"',`id="${ft}"`,dt&&"checked",pt&&"disabled",ut&&'data-indeterminate="true"'].filter(Boolean).join(" ");return`
|
|
3
3
|
<label class="${xt}" ${yt?`style="${yt}"`:""}>
|
|
4
4
|
<input ${ht} />
|
|
5
5
|
<span class="stx-checkbox-box"></span>
|
package/package.json
CHANGED