@synnaxlabs/drift 0.40.1 → 0.42.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/electron.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var R=Object.defineProperty;var B=(t,e,o)=>e in t?R(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var _=(t,e,o)=>B(t,typeof e!="symbol"?e+"":e,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./state-u8UjvjPJ.cjs"),H=require("./debounce-BUAIXXZt.cjs"),E="drift://action",p="drift://create",w="drift://focus",b="drift://close",I="drift://set-minimized",N="drift://set-maximized",z="drift://set-visible",y="drift://set-fullscreen",M="drift://center",O="drift://set-position",A="drift://set-size",g="drift://set-min-size",V="drift://set-max-size",x="drift://set-resizable",W="drift://set-skip-taskbar",P="drift://set-always-on-top",k="drift://set-title",L="drift://set-decorations",S="drift://get-props",D="drift://get-label",Z=[E,p,w,b,I,N,z,y,M,O,A,g,V,x,W,P,k,L,S],q=t=>{if(!Z.includes(t))throw new Error(`Event ${t} is not on the list of allowed events`)},F=[E],U=t=>{if(!F.includes(t))throw new Error(`Event ${t} is not on the list of allowed events`)},$=[S,D],G=t=>{if(!$.includes(t))throw new Error(`Command ${t} is not on the list of allowed commands`)},J=t=>{var e,o,r,l,u,d,m,f;return{x:(e=t.position)==null?void 0:e.x,y:(o=t.position)==null?void 0:o.y,width:(r=t.size)==null?void 0:r.width,height:(l=t.size)==null?void 0:l.height,center:t.center,minHeight:(u=t.minSize)==null?void 0:u.height,minWidth:(d=t.minSize)==null?void 0:d.width,maxHeight:(m=t.maxSize)==null?void 0:m.height,maxWidth:(f=t.maxSize)==null?void 0:f.width,resizable:t.resizable,fullscreen:t.fullscreen,skipTaskbar:t.skipTaskbar,title:t.title,show:t.visible,transparent:t.transparent,alwaysOnTop:t.alwaysOnTop}},K=t=>{const[e,o]=t.getSize(),[r,l]=t.getPosition();return{size:{width:e,height:o},position:{x:r,y:l},minimized:t.isMinimized(),maximized:t.isMaximized(),fullscreen:t.isFullScreen(),visible:t.isVisible(),resizable:t.isResizable(),skipTaskbar:!1,title:t.getTitle(),alwaysOnTop:t.isAlwaysOnTop(),decorations:!1}},X=({mainWindow:t,createWindow:e})=>{const o=new Map,r=new Map;o.set(h.MAIN_WINDOW,t.id),r.set(t.id,h.MAIN_WINDOW);const{ipcMain:l,BrowserWindow:u}=require("electron"),d=(s,i)=>l.on(s,(n,a)=>{const c=u.fromWebContents(n.sender);c!=null&&i(c,a)});l.on(b,(s,i)=>{const n=o.get(i);if(n==null)return;const a=u.fromId(n);a!=null&&(a.close(),o.delete(i),r.delete(n))}),l.handle(S,s=>{const i=u.fromWebContents(s.sender);return i==null?void 0:{...K(i),label:r.get(i.id)}}),l.handle(D,s=>{const i=u.fromWebContents(s.sender);if(i!=null)return r.get(i.id)});const m=(s,i,n)=>{s.on(i,H.o(n,500))},f=s=>{var i;for(const n of r.keys())(i=u.fromId(n))==null||i.webContents.send(E,s)},C=(s,i)=>{const n=(a,c)=>{m(i,a,()=>{f({action:h.runtimeSetWindowProps({label:s,...c(i)}),emitter:"WHITELIST"})})};n("resize",a=>{const[c,v]=a.getSize();return{size:{width:c,height:v}}}),n("move",()=>{const[a,c]=i.getPosition();return{position:{x:a,y:c}}}),n("minimize",()=>({minimized:!0})),n("restore",()=>({minimized:!1})),n("maximize",()=>({maximized:!0})),n("unmaximize",()=>({maximized:!1})),n("enter-full-screen",a=>(a.setWindowButtonVisibility(!0),{fullscreen:!0})),n("leave-full-screen",()=>(i.setWindowButtonVisibility(!1),{fullscreen:!1}))};C(h.MAIN_WINDOW,t),d(w,s=>s.focus()),d(I,s=>s.minimize()),d(N,s=>s.maximize()),d(z,(s,i)=>i?s.show():s.hide()),d(y,s=>s.setFullScreen(!0)),d(M,s=>s.center()),d(O,(s,{x:i,y:n})=>{s.setPosition(Math.round(i),Math.round(n))}),d(A,(s,{width:i,height:n})=>{s.setSize(Math.round(i),Math.round(n))}),d(g,(s,{width:i,height:n})=>s.setMinimumSize(Math.round(i),Math.round(n))),d(V,(s,{width:i,height:n})=>s.setMaximumSize(Math.round(i),Math.round(n))),d(x,(s,i)=>s.setResizable(i)),d(W,(s,i)=>s.setSkipTaskbar(i)),d(P,(s,i)=>s.setAlwaysOnTop(i)),d(k,(s,i)=>s.setTitle(i)),l.on(p,(s,i,n)=>{const a=e(J(n));o.set(i,a.id),r.set(a.id,i),C(i,a)}),l.on(E,(s,i,n)=>{if(i==null)return;if(n==null)return f(i);const a=o.get(n);if(a==null)return;const c=u.fromId(a);c!=null&&c.webContents.send(E,i)})},T="driftAPI",j=()=>{const{ipcRenderer:t,contextBridge:e}=require("electron"),o={send:(r,...l)=>{q(r),t.send(r,...l)},invoke:async(r,...l)=>(G(r),await t.invoke(r,...l)),on:(r,l)=>{U(r),t.on(r,l)}};e.exposeInMainWorld(T,o)},Y=async()=>{if(!(T in window))throw new Error("Drift API not found. Make sure to call configurePreload in your preload script.");return await window[T].invoke(D)};class Q{constructor(){_(this,"_label","");_(this,"props",null);_(this,"api");if(!(T in window))throw new Error("Drift API not found. Make sure to call configurePreload in your preload script.");this.api=window[T]}async configure(){const{label:e,...o}=await this.api.invoke(S);this._label=e,this.props=o}label(){return this._label}isMain(){return this._label===h.MAIN_WINDOW}release(){}async emit(e,o){this.api.send(E,{...e,emitter:this.label()},o)}async subscribe(e){this.api.on(E,(o,r)=>e(r))}onCloseRequested(){}async create(e,o){this.api.send(p,e,JSON.parse(JSON.stringify(o)))}async close(e){this.api.send(b,e)}async listLabels(){return[]}async focus(){this.api.send(w)}async setMinimized(e){this.api.send(I,e)}async setMaximized(e){this.api.send(N,e)}async setVisible(e){this.api.send(z,e)}async setFullscreen(e){this.api.send(y,e)}async center(){this.api.send(M)}async setPosition(e){this.api.send(O,e)}async setSize(e){this.api.send(A,e)}async setMinSize(e){this.api.send(g,e)}async setMaxSize(e){this.api.send(V,e)}async setResizable(e){this.api.send(x,e)}async setSkipTaskbar(e){this.api.send(W,e)}async setAlwaysOnTop(e){this.api.send(P,e)}async setTitle(e){this.api.send(k,e)}async setDecorations(e){this.api.send(L,e)}async getProps(){if(this.props!=null)return this.props;throw new Error("Window not found")}}exports.ElectronRuntime=Q;exports.exposeAPI=j;exports.getWindowLabel=Y;exports.listenOnMain=X;
1
+ "use strict";var R=Object.defineProperty;var B=(t,e,o)=>e in t?R(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var m=(t,e,o)=>B(t,typeof e!="symbol"?e+"":e,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./window-DLsE0-fP.cjs"),q=require("./state-Ckw4CzST.cjs"),H=require("./debounce-BUAIXXZt.cjs"),E="drift://action",p="drift://create",w="drift://focus",b="drift://close",I="drift://set-minimized",N="drift://set-maximized",z="drift://set-visible",y="drift://set-fullscreen",M="drift://center",O="drift://set-position",A="drift://set-size",g="drift://set-min-size",V="drift://set-max-size",x="drift://set-resizable",W="drift://set-skip-taskbar",P="drift://set-always-on-top",k="drift://set-title",L="drift://set-decorations",S="drift://get-props",D="drift://get-label",Z=[E,p,w,b,I,N,z,y,M,O,A,g,V,x,W,P,k,L,S],F=t=>{if(!Z.includes(t))throw new Error(`Event ${t} is not on the list of allowed events`)},U=[E],$=t=>{if(!U.includes(t))throw new Error(`Event ${t} is not on the list of allowed events`)},G=[S,D],J=t=>{if(!G.includes(t))throw new Error(`Command ${t} is not on the list of allowed commands`)},K=t=>{var e,o,r,l,u,d,T,f;return{x:(e=t.position)==null?void 0:e.x,y:(o=t.position)==null?void 0:o.y,width:(r=t.size)==null?void 0:r.width,height:(l=t.size)==null?void 0:l.height,center:t.center,minHeight:(u=t.minSize)==null?void 0:u.height,minWidth:(d=t.minSize)==null?void 0:d.width,maxHeight:(T=t.maxSize)==null?void 0:T.height,maxWidth:(f=t.maxSize)==null?void 0:f.width,resizable:t.resizable,fullscreen:t.fullscreen,skipTaskbar:t.skipTaskbar,title:t.title,show:t.visible,transparent:t.transparent,alwaysOnTop:t.alwaysOnTop}},X=t=>{const[e,o]=t.getSize(),[r,l]=t.getPosition();return{size:{width:e,height:o},position:{x:r,y:l},minimized:t.isMinimized(),maximized:t.isMaximized(),fullscreen:t.isFullScreen(),visible:t.isVisible(),resizable:t.isResizable(),skipTaskbar:!1,title:t.getTitle(),alwaysOnTop:t.isAlwaysOnTop(),decorations:!1}},j=({mainWindow:t,createWindow:e})=>{const o=new Map,r=new Map;o.set(_.MAIN_WINDOW,t.id),r.set(t.id,_.MAIN_WINDOW);const{ipcMain:l,BrowserWindow:u}=require("electron"),d=(s,i)=>l.on(s,(n,a)=>{const c=u.fromWebContents(n.sender);c!=null&&i(c,a)});l.on(b,(s,i)=>{const n=o.get(i);if(n==null)return;const a=u.fromId(n);a!=null&&(a.close(),o.delete(i),r.delete(n))}),l.handle(S,s=>{const i=u.fromWebContents(s.sender);return i==null?void 0:{...X(i),label:r.get(i.id)}}),l.handle(D,s=>{const i=u.fromWebContents(s.sender);if(i!=null)return r.get(i.id)});const T=(s,i,n)=>{s.on(i,H.o(n,500))},f=s=>{var i;for(const n of r.keys())(i=u.fromId(n))==null||i.webContents.send(E,s)},C=(s,i)=>{const n=(a,c)=>{T(i,a,()=>{f({action:q.runtimeSetWindowProps({label:s,...c(i)}),emitter:"WHITELIST"})})};n("resize",a=>{const[c,v]=a.getSize();return{size:{width:c,height:v}}}),n("move",()=>{const[a,c]=i.getPosition();return{position:{x:a,y:c}}}),n("minimize",()=>({minimized:!0})),n("restore",()=>({minimized:!1})),n("maximize",()=>({maximized:!0})),n("unmaximize",()=>({maximized:!1})),n("enter-full-screen",a=>(a.setWindowButtonVisibility(!0),{fullscreen:!0})),n("leave-full-screen",()=>(i.setWindowButtonVisibility(!1),{fullscreen:!1}))};C(_.MAIN_WINDOW,t),d(w,s=>s.focus()),d(I,s=>s.minimize()),d(N,s=>s.maximize()),d(z,(s,i)=>i?s.show():s.hide()),d(y,s=>s.setFullScreen(!0)),d(M,s=>s.center()),d(O,(s,{x:i,y:n})=>{s.setPosition(Math.round(i),Math.round(n))}),d(A,(s,{width:i,height:n})=>{s.setSize(Math.round(i),Math.round(n))}),d(g,(s,{width:i,height:n})=>s.setMinimumSize(Math.round(i),Math.round(n))),d(V,(s,{width:i,height:n})=>s.setMaximumSize(Math.round(i),Math.round(n))),d(x,(s,i)=>s.setResizable(i)),d(W,(s,i)=>s.setSkipTaskbar(i)),d(P,(s,i)=>s.setAlwaysOnTop(i)),d(k,(s,i)=>s.setTitle(i)),l.on(p,(s,i,n)=>{const a=e(K(n));o.set(i,a.id),r.set(a.id,i),C(i,a)}),l.on(E,(s,i,n)=>{if(i==null)return;if(n==null)return f(i);const a=o.get(n);if(a==null)return;const c=u.fromId(a);c!=null&&c.webContents.send(E,i)})},h="driftAPI",Y=()=>{const{ipcRenderer:t,contextBridge:e}=require("electron"),o={send:(r,...l)=>{F(r),t.send(r,...l)},invoke:async(r,...l)=>(J(r),await t.invoke(r,...l)),on:(r,l)=>{$(r),t.on(r,l)}};e.exposeInMainWorld(h,o)},Q=async()=>{if(!(h in window))throw new Error("Drift API not found. Make sure to call configurePreload in your preload script.");return await window[h].invoke(D)};class ee{constructor(){m(this,"_label","");m(this,"props",null);m(this,"api");if(!(h in window))throw new Error("Drift API not found. Make sure to call configurePreload in your preload script.");this.api=window[h]}async configure(){const{label:e,...o}=await this.api.invoke(S);this._label=e,this.props=o}label(){return this._label}isMain(){return this._label===_.MAIN_WINDOW}release(){}async emit(e,o){this.api.send(E,{...e,emitter:this.label()},o)}async subscribe(e){this.api.on(E,(o,r)=>e(r))}onCloseRequested(){}async create(e,o){this.api.send(p,e,JSON.parse(JSON.stringify(o)))}async close(e){this.api.send(b,e)}async listLabels(){return[]}async focus(){this.api.send(w)}async setMinimized(e){this.api.send(I,e)}async setMaximized(e){this.api.send(N,e)}async setVisible(e){this.api.send(z,e)}async setFullscreen(e){this.api.send(y,e)}async center(){this.api.send(M)}async setPosition(e){this.api.send(O,e)}async setSize(e){this.api.send(A,e)}async setMinSize(e){this.api.send(g,e)}async setMaxSize(e){this.api.send(V,e)}async setResizable(e){this.api.send(x,e)}async setSkipTaskbar(e){this.api.send(W,e)}async setAlwaysOnTop(e){this.api.send(P,e)}async setTitle(e){this.api.send(k,e)}async setDecorations(e){this.api.send(L,e)}async getProps(){if(this.props!=null)return this.props;throw new Error("Window not found")}}exports.ElectronRuntime=ee;exports.exposeAPI=Y;exports.getWindowLabel=Q;exports.listenOnMain=j;
package/dist/electron.js CHANGED
@@ -1,7 +1,8 @@
1
1
  var R = Object.defineProperty;
2
2
  var B = (t, e, o) => e in t ? R(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
3
  var m = (t, e, o) => B(t, typeof e != "symbol" ? e + "" : e, o);
4
- import { M as _, r as H } from "./state-B_nrpWi0.js";
4
+ import { M as _ } from "./window-BIbHrbtA.js";
5
+ import { r as H } from "./state-D8a0PvFs.js";
5
6
  import { o as Z } from "./debounce-DOZKRZa9.js";
6
7
  const E = "drift://action", S = "drift://create", w = "drift://focus", z = "drift://close", b = "drift://set-minimized", y = "drift://set-maximized", I = "drift://set-visible", N = "drift://set-fullscreen", M = "drift://center", O = "drift://set-position", g = "drift://set-size", A = "drift://set-min-size", V = "drift://set-max-size", x = "drift://set-resizable", k = "drift://set-skip-taskbar", C = "drift://set-always-on-top", P = "drift://set-title", L = "drift://set-decorations", p = "drift://get-props", W = "drift://get-label", F = [
7
8
  E,
@@ -67,7 +68,7 @@ const E = "drift://action", S = "drift://create", w = "drift://focus", z = "drif
67
68
  alwaysOnTop: t.isAlwaysOnTop(),
68
69
  decorations: !1
69
70
  };
70
- }, ee = ({ mainWindow: t, createWindow: e }) => {
71
+ }, te = ({ mainWindow: t, createWindow: e }) => {
71
72
  const o = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
72
73
  o.set(_, t.id), r.set(t.id, _);
73
74
  const { ipcMain: l, BrowserWindow: u } = require("electron"), d = (s, i) => l.on(s, (n, a) => {
@@ -140,7 +141,7 @@ const E = "drift://action", S = "drift://create", w = "drift://focus", z = "drif
140
141
  const c = u.fromId(a);
141
142
  c != null && c.webContents.send(E, i);
142
143
  });
143
- }, h = "driftAPI", te = () => {
144
+ }, h = "driftAPI", ie = () => {
144
145
  const { ipcRenderer: t, contextBridge: e } = require("electron"), o = {
145
146
  send: (r, ...l) => {
146
147
  U(r), t.send(r, ...l);
@@ -151,14 +152,14 @@ const E = "drift://action", S = "drift://create", w = "drift://focus", z = "drif
151
152
  }
152
153
  };
153
154
  e.exposeInMainWorld(h, o);
154
- }, ie = async () => {
155
+ }, se = async () => {
155
156
  if (!(h in window))
156
157
  throw new Error(
157
158
  "Drift API not found. Make sure to call configurePreload in your preload script."
158
159
  );
159
160
  return await window[h].invoke(W);
160
161
  };
161
- class se {
162
+ class ne {
162
163
  constructor() {
163
164
  m(this, "_label", "");
164
165
  m(this, "props", null);
@@ -249,8 +250,8 @@ class se {
249
250
  }
250
251
  }
251
252
  export {
252
- se as ElectronRuntime,
253
- te as exposeAPI,
254
- ie as getWindowLabel,
255
- ee as listenOnMain
253
+ ne as ElectronRuntime,
254
+ ie as exposeAPI,
255
+ se as getWindowLabel,
256
+ te as listenOnMain
256
257
  };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("@reduxjs/toolkit"),t=require("./state-u8UjvjPJ.cjs"),f=require("./selectors-DsoUWQIE.cjs"),A=new Error("request for lock canceled");var C=function(i,e,s,o){function n(a){return a instanceof s?a:new s(function(r){r(a)})}return new(s||(s=Promise))(function(a,r){function l(c){try{u(o.next(c))}catch(w){r(w)}}function d(c){try{u(o.throw(c))}catch(w){r(w)}}function u(c){c.done?a(c.value):n(c.value).then(l,d)}u((o=o.apply(i,e||[])).next())})};class L{constructor(e,s=A){this._value=e,this._cancelError=s,this._queue=[],this._weightedWaiters=[]}acquire(e=1,s=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((o,n)=>{const a={resolve:o,reject:n,weight:e,priority:s},r=E(this._queue,l=>s<=l.priority);r===-1&&e<=this._value?this._dispatchItem(a):this._queue.splice(r+1,0,a)})}runExclusive(e){return C(this,arguments,void 0,function*(s,o=1,n=0){const[a,r]=yield this.acquire(o,n);try{return yield s(a)}finally{r()}})}waitForUnlock(e=1,s=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,s)?Promise.resolve():new Promise(o=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),N(this._weightedWaiters[e-1],{resolve:o,priority:s})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const s=this._value;this._value-=e.weight,e.resolve([s,this._newReleaser(e.weight)])}_newReleaser(e){let s=!1;return()=>{s||(s=!0,this.release(e))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let e=this._value;e>0;e--){const s=this._weightedWaiters[e-1];s&&(s.forEach(o=>o.resolve()),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let s=this._value;s>0;s--){const o=this._weightedWaiters[s-1];if(!o)continue;const n=o.findIndex(a=>a.priority<=e);(n===-1?o:o.splice(0,n)).forEach(a=>a.resolve())}}}_couldLockImmediately(e,s){return(this._queue.length===0||this._queue[0].priority<s)&&e<=this._value}}function N(i,e){const s=E(i,o=>e.priority<=o.priority);i.splice(s+1,0,e)}function E(i,e){for(let s=i.length-1;s>=0;s--)if(e(i[s]))return s;return-1}var P=function(i,e,s,o){function n(a){return a instanceof s?a:new s(function(r){r(a)})}return new(s||(s=Promise))(function(a,r){function l(c){try{u(o.next(c))}catch(w){r(w)}}function d(c){try{u(o.throw(c))}catch(w){r(w)}}function u(c){c.done?a(c.value):n(c.value).then(l,d)}u((o=o.apply(i,e||[])).next())})};class q{constructor(e){this._semaphore=new L(1,e)}acquire(){return P(this,arguments,void 0,function*(e=0){const[,s]=yield this._semaphore.acquire(1,e);return s})}runExclusive(e,s=0){return this._semaphore.runExclusive(()=>e(),1,s)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}const D=i=>[...new Set(i)],R=(i,e,s=!0)=>{const o=new Map;return i.forEach(n=>{const a=e(n);if(o.has(a)){if(s)return;o.delete(a)}o.set(a,n)}),Array.from(o.values())},F=Object.freeze(Object.defineProperty({__proto__:null,by:R,unique:D},Symbol.toStringTag,{value:"Module"})),T="DA@",I="://",V=(i,e)=>T.concat(e,I,i),j=i=>{const[e,s]=i.split(I);if(s==null)return[i,""];const[,o]=e.split(T);return[s,o]},b=(i,e)=>({...i,type:V(i.type,e)}),Z=i=>{const[e,s]=j(i.type);return{emitted:s!=null&&s.length>0,emitter:s,action:{...i,type:e}}},U=i=>{const{centerCount:e,processCount:s,focusCount:o,stage:n,key:a,prerenderLabel:r,reserved:l,minimized:d,...u}=i;return u},K=async(i,e,s,o)=>{const n=(await s.listLabels()).filter(c=>c!==t.MAIN_WINDOW),a=Object.keys(i.windows).filter(c=>c!==t.MAIN_WINDOW);t.group(o,"syncInitial"),t.log(o,"existing windows in runtime",n.sort()),t.log(o,"non-main windows in state",a.sort()),t.groupEnd(o);const r=F.unique([...n,...a]);for(const c of r)!n.includes(c)&&s.isMain()?(t.log(o,"state window not in runtime, creating",c),await k(s,c,i.windows[c],o)):a.includes(c)||(t.log(o,"runtime window not in state, closing",c),await p(s,c,o));const l=s.label(),d=i.windows[l];if(d==null)return;const u={...t.INITIAL_WINDOW_STATE};await M(u,d,s,o),e(t.runtimeSetWindowProps({label:s.label(),...await s.getProps()}))},Q=async(i,e,s,o)=>{t.log(o,"sync",i,e),s.isMain()&&await X(i,e,s,o);const n=i.windows[s.label()],a=e.windows[s.label()];n==null||a==null||await M(n,a,s,o)},M=async(i,e,s,o)=>{const n=[];e.title!=null&&e.title!==i.title&&n.push(["title",{prev:i.title,next:e.title},async()=>s.setTitle(e.title)]);const a=e.visible!=null&&e.visible!==i.visible,r=e.visible===!1,l=()=>n.push(["visible",{prev:i.visible,next:e.visible},async()=>{if(await s.setVisible(e.visible),e.visible===!1)return;let d=e.position;d??(d=(await s.getProps()).position),await s.setPosition(t.G.translate(d,{x:1,y:1})),await s.setPosition(d)}]);if(a&&r&&l(),e.skipTaskbar!=null&&e.skipTaskbar!==i.skipTaskbar&&n.push(["skipTaskbar",{prev:i.skipTaskbar,next:e.skipTaskbar},async()=>await s.setSkipTaskbar(e.skipTaskbar)]),e.maximized!=null&&e.maximized!==i.maximized&&n.push(["maximized",{prev:i.maximized,next:e.maximized},async()=>await s.setMaximized(e.maximized)]),e.fullscreen!=null&&e.fullscreen!==i.fullscreen&&n.push(["fullscreen",{prev:i.fullscreen,next:e.fullscreen},async()=>await s.setFullscreen(e.fullscreen)]),e.centerCount!==i.centerCount&&n.push(["center",{prev:i.centerCount,next:e.centerCount},async()=>s.center()]),e.minimized!=null&&e.minimized!==i.minimized&&n.push(["minimized",{prev:i.minimized,next:e.minimized},async()=>await s.setMinimized(e.minimized)]),e.resizable!=null&&e.resizable!==i.resizable&&n.push(["resizable",{prev:i.resizable,next:e.resizable},async()=>await s.setResizable(e.resizable)]),e.minSize!=null&&!t._.equals(e.minSize,i.minSize)&&n.push(["minSize",{prev:i.minSize,next:e.minSize},async()=>await s.setMinSize(e.minSize)]),e.maxSize!=null&&!t._.equals(e.maxSize,i.maxSize)&&n.push(["maxSize",{prev:i.maxSize,next:e.maxSize},async()=>await s.setMaxSize(e.maxSize)]),e.size!=null&&!t._.equals(e.size,i.size)&&n.push(["size",{prev:i.size,next:e.size},async()=>await s.setSize(e.size)]),e.position!=null&&!t._.equals(e.position,i.position)&&n.push(["position",{prev:i.position,next:e.position},async()=>await s.setPosition(e.position)]),e.focusCount!==i.focusCount&&n.push(["setVisible",{prev:i.visible,next:e.visible},async()=>await s.setVisible(!0)],["focus",{prev:i.focusCount,next:e.focusCount},async()=>await s.focus()]),e.decorations!=null&&e.decorations!==i.decorations&&n.push(["decorations",{prev:i.decorations,next:e.decorations},async()=>await s.setDecorations(e.decorations)]),e.alwaysOnTop!=null&&e.alwaysOnTop!==i.alwaysOnTop&&n.push(["alwaysOnTop",{prev:i.alwaysOnTop,next:e.alwaysOnTop},async()=>await s.setAlwaysOnTop(e.alwaysOnTop)]),a&&!r&&l(),n.length!==0){t.group(o,`syncCurrent, label: ${s.label()}, key: ${e.key}`);for(const[d,{prev:u,next:c}]of n)t.log(o,d,u,"->",c);t.groupEnd(o);for(const[,,d]of n)await d()}},X=async(i,e,s,o)=>{const n=Object.keys(i.windows).filter(l=>!(l in e.windows)),a=Object.keys(e.windows).filter(l=>!(l in i.windows)),r=s.isMain();if(r&&n.length>0)for(const l of n)t.log(o,"syncMain","closing",l),l===t.MAIN_WINDOW&&await Promise.all(Object.keys(e.windows).filter(d=>d!==t.MAIN_WINDOW).map(async d=>await p(s,d,o))),await p(s,l,o);if(r&&a.length>0)for(const l of a)await k(s,l,e.windows[l],o)},k=async(i,e,s,o)=>(t.log(o,"createWindow",s),await i.create(e,U(s))),p=async(i,e,s)=>(t.log(s,"closeWindow",e),await i.close(e)),z="[drift] - unexpected undefined action",m="[drift] - unexpected undefined action type",y=i=>{if(i.emitted??(i.emitted=!1),i.action==null)throw console.warn(z,i),new Error(z);if(i.action.type==null||i.action.type.length===0)throw console.warn(m,i),new Error(m)},$=new q,G=[t.runtimeSetWindowProps.type,t.reloadWindow.type],Y=(i,e=!1)=>s=>o=>n=>{let{action:a,emitted:r,emitter:l}=Z(n);const d=i.label();y({action:n,emitted:r,emitter:l});const u=t.isDriftAction(a.type);if(u&&t.log(e,"[drift] - middleware",{action:a,emitted:r,emitter:l,host:d}),l===i.label())return;const c=u&&!G.includes(a.type);let w=null;u&&(w=s.getState().drift,a=t.assignLabel(a,w));const h=o(a),_=c?s.getState().drift:null,W=t.shouldEmit(r,a.type);return $.runExclusive(async()=>{try{w!==null&&_!==null&&await Q(w,_,i,e),W&&await i.emit({action:a})}catch(S){t.log(e,"[drift] - ERROR",{error:S.message,action:a,emitted:r,emitter:l,host:d}),s.dispatch(t.setWindowError({key:d,message:S.message}))}}),h},B=(i,e,s=!1)=>o=>{const n=i!=null?typeof i=="function"?i(o):i:o();return[Y(e,s),...n]},H=async({runtime:i,preloadedState:e,middleware:s,debug:o=!1,enablePrerender:n=!0,defaultWindowProps:a,...r})=>{await i.configure();let l;l=O.configureStore({...r,preloadedState:await J(o,i,()=>l,a,e),middleware:B(s,i,o)}),await K(l.getState().drift,l.dispatch,i,o);const d=i.label();return l.dispatch(t.internalSetInitial({enablePrerender:n,defaultWindowProps:a,debug:o,label:d})),l.dispatch(t.setWindowStage({stage:"created"})),i.onCloseRequested(()=>l==null?void 0:l.dispatch(t.closeWindow({}))),l},J=async(i,e,s,o,n)=>e.isMain()?(await e.subscribe(({action:r,emitter:l,sendState:d})=>{const u=s();if(u==null)return;if(r!=null){y({action:r,emitter:l}),u.dispatch(b(r,l));return}const c=u.getState();d===!0&&e.emit({state:c},l)}),typeof n=="function"?g(o,i,await n()):g(o,i,n)):await new Promise((r,l)=>{(async()=>{try{await e.subscribe(({action:u,emitter:c,state:w})=>{const h=s();if(h==null)return w!=null?r(w):void 0;u!=null&&(y({action:u,emitter:c}),h.dispatch(b(u,c)))}),await e.emit({sendState:!0},t.MAIN_WINDOW)}catch(u){l(u)}})()}),v=H,g=(i,e,s)=>{if(s==null)return s;const o=s[t.SLICE_NAME];return o.config.debug=e??o.config.debug,o.windows=Object.fromEntries(Object.entries(o.windows).filter(([,n])=>n.reserved).map(([n,a])=>((i==null?void 0:i.visible)!=null&&(a.visible=i.visible),a.focusCount=0,a.centerCount=0,a.processCount=0,[n,a]))),s},x=Object.freeze(Object.defineProperty({__proto__:null,MAIN_WINDOW:t.MAIN_WINDOW,SLICE_NAME:t.SLICE_NAME,ZERO_SLICE_STATE:t.ZERO_SLICE_STATE,closeWindow:t.closeWindow,completeProcess:t.completeProcess,configureStore:v,createWindow:t.createWindow,focusWindow:t.focusWindow,reducer:t.reducer,registerProcess:t.registerProcess,reloadWindow:t.reloadWindow,selectSliceState:f.selectSliceState,selectWindow:f.selectWindow,selectWindowAttribute:f.selectWindowAttribute,selectWindowKey:f.selectWindowKey,selectWindowLabel:f.selectWindowLabel,selectWindows:f.selectWindows,setWindowAlwaysOnTop:t.setWindowAlwaysOnTop,setWindowDecorations:t.setWindowDecorations,setWindowFullscreen:t.setWindowFullscreen,setWindowMaxSize:t.setWindowMaxSize,setWindowMaximized:t.setWindowMaximized,setWindowMinSize:t.setWindowMinSize,setWindowMinimized:t.setWindowMinimized,setWindowPosition:t.setWindowPosition,setWindowProps:t.setWindowProps,setWindowResizable:t.setWindowResizable,setWindowSize:t.setWindowSize,setWindowSkipTaskbar:t.setWindowSkipTaskbar,setWindowStage:t.setWindowStage,setWindowTitle:t.setWindowTitle,setWindowVisible:t.setWindowVisible,windowPropsZ:t.windowPropsZ},Symbol.toStringTag,{value:"Module"}));exports.MAIN_WINDOW=t.MAIN_WINDOW;exports.SLICE_NAME=t.SLICE_NAME;exports.ZERO_SLICE_STATE=t.ZERO_SLICE_STATE;exports.closeWindow=t.closeWindow;exports.completeProcess=t.completeProcess;exports.createWindow=t.createWindow;exports.focusWindow=t.focusWindow;exports.reducer=t.reducer;exports.registerProcess=t.registerProcess;exports.reloadWindow=t.reloadWindow;exports.setWindowAlwaysOnTop=t.setWindowAlwaysOnTop;exports.setWindowDecorations=t.setWindowDecorations;exports.setWindowFullscreen=t.setWindowFullscreen;exports.setWindowMaxSize=t.setWindowMaxSize;exports.setWindowMaximized=t.setWindowMaximized;exports.setWindowMinSize=t.setWindowMinSize;exports.setWindowMinimized=t.setWindowMinimized;exports.setWindowPosition=t.setWindowPosition;exports.setWindowProps=t.setWindowProps;exports.setWindowResizable=t.setWindowResizable;exports.setWindowSize=t.setWindowSize;exports.setWindowSkipTaskbar=t.setWindowSkipTaskbar;exports.setWindowStage=t.setWindowStage;exports.setWindowTitle=t.setWindowTitle;exports.setWindowVisible=t.setWindowVisible;exports.windowPropsZ=t.windowPropsZ;exports.selectSliceState=f.selectSliceState;exports.selectWindow=f.selectWindow;exports.selectWindowAttribute=f.selectWindowAttribute;exports.selectWindowKey=f.selectWindowKey;exports.selectWindowLabel=f.selectWindowLabel;exports.selectWindows=f.selectWindows;exports.Drift=x;exports.configureStore=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("@reduxjs/toolkit"),o=require("./state-Ckw4CzST.cjs"),f=require("./window-DLsE0-fP.cjs"),h=require("./selectors-jksTA_U1.cjs"),C=new Error("request for lock canceled");var L=function(i,e,s,t){function n(a){return a instanceof s?a:new s(function(r){r(a)})}return new(s||(s=Promise))(function(a,r){function l(c){try{u(t.next(c))}catch(w){r(w)}}function d(c){try{u(t.throw(c))}catch(w){r(w)}}function u(c){c.done?a(c.value):n(c.value).then(l,d)}u((t=t.apply(i,e||[])).next())})};class N{constructor(e,s=C){this._value=e,this._cancelError=s,this._queue=[],this._weightedWaiters=[]}acquire(e=1,s=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((t,n)=>{const a={resolve:t,reject:n,weight:e,priority:s},r=T(this._queue,l=>s<=l.priority);r===-1&&e<=this._value?this._dispatchItem(a):this._queue.splice(r+1,0,a)})}runExclusive(e){return L(this,arguments,void 0,function*(s,t=1,n=0){const[a,r]=yield this.acquire(t,n);try{return yield s(a)}finally{r()}})}waitForUnlock(e=1,s=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,s)?Promise.resolve():new Promise(t=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),P(this._weightedWaiters[e-1],{resolve:t,priority:s})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const s=this._value;this._value-=e.weight,e.resolve([s,this._newReleaser(e.weight)])}_newReleaser(e){let s=!1;return()=>{s||(s=!0,this.release(e))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let e=this._value;e>0;e--){const s=this._weightedWaiters[e-1];s&&(s.forEach(t=>t.resolve()),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let s=this._value;s>0;s--){const t=this._weightedWaiters[s-1];if(!t)continue;const n=t.findIndex(a=>a.priority<=e);(n===-1?t:t.splice(0,n)).forEach(a=>a.resolve())}}}_couldLockImmediately(e,s){return(this._queue.length===0||this._queue[0].priority<s)&&e<=this._value}}function P(i,e){const s=T(i,t=>e.priority<=t.priority);i.splice(s+1,0,e)}function T(i,e){for(let s=i.length-1;s>=0;s--)if(e(i[s]))return s;return-1}var q=function(i,e,s,t){function n(a){return a instanceof s?a:new s(function(r){r(a)})}return new(s||(s=Promise))(function(a,r){function l(c){try{u(t.next(c))}catch(w){r(w)}}function d(c){try{u(t.throw(c))}catch(w){r(w)}}function u(c){c.done?a(c.value):n(c.value).then(l,d)}u((t=t.apply(i,e||[])).next())})};class D{constructor(e){this._semaphore=new N(1,e)}acquire(){return q(this,arguments,void 0,function*(e=0){const[,s]=yield this._semaphore.acquire(1,e);return s})}runExclusive(e,s=0){return this._semaphore.runExclusive(()=>e(),1,s)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}const R=i=>[...new Set(i)],F=(i,e,s=!0)=>{const t=new Map;return i.forEach(n=>{const a=e(n);if(t.has(a)){if(s)return;t.delete(a)}t.set(a,n)}),Array.from(t.values())},V=Object.freeze(Object.defineProperty({__proto__:null,by:F,unique:R},Symbol.toStringTag,{value:"Module"})),I="DA@",M="://",j=(i,e)=>I.concat(e,M,i),Z=i=>{const[e,s]=i.split(M);if(s==null)return[i,""];const[,t]=e.split(I);return[s,t]},z=(i,e)=>({...i,type:j(i.type,e)}),U=i=>{const[e,s]=Z(i.type);return{emitted:s!=null&&s.length>0,emitter:s,action:{...i,type:e}}},K=i=>{const{centerCount:e,processCount:s,focusCount:t,stage:n,key:a,prerenderLabel:r,reserved:l,minimized:d,...u}=i;return u},Q=async(i,e,s,t)=>{const n=(await s.listLabels()).filter(c=>c!==f.MAIN_WINDOW),a=Object.keys(i.windows).filter(c=>c!==f.MAIN_WINDOW);o.group(t,"syncInitial"),o.log(t,"existing windows in runtime",n.sort()),o.log(t,"non-main windows in state",a.sort()),o.groupEnd(t);const r=V.unique([...n,...a]);for(const c of r)!n.includes(c)&&s.isMain()?(o.log(t,"state window not in runtime, creating",c),await v(s,c,i.windows[c],t)):a.includes(c)||(o.log(t,"runtime window not in state, closing",c),await y(s,c,t));const l=s.label(),d=i.windows[l];if(d==null)return;const u={...f.INITIAL_WINDOW_STATE};await k(u,d,s,t),e(o.runtimeSetWindowProps({label:s.label(),...await s.getProps()}))},X=async(i,e,s,t)=>{o.log(t,"sync",i,e),s.isMain()&&await $(i,e,s,t);const n=i.windows[s.label()],a=e.windows[s.label()];n==null||a==null||await k(n,a,s,t)},k=async(i,e,s,t)=>{const n=[];e.title!=null&&e.title!==i.title&&n.push(["title",{prev:i.title,next:e.title},async()=>s.setTitle(e.title)]);const a=e.visible!=null&&e.visible!==i.visible,r=e.visible===!1,l=()=>n.push(["visible",{prev:i.visible,next:e.visible},async()=>{if(await s.setVisible(e.visible),e.visible===!1)return;let d=e.position;d??(d=(await s.getProps()).position),await s.setPosition(f.J.translate(d,{x:1,y:1})),await s.setPosition(d)}]);if(a&&r&&l(),e.skipTaskbar!=null&&e.skipTaskbar!==i.skipTaskbar&&n.push(["skipTaskbar",{prev:i.skipTaskbar,next:e.skipTaskbar},async()=>await s.setSkipTaskbar(e.skipTaskbar)]),e.maximized!=null&&e.maximized!==i.maximized&&n.push(["maximized",{prev:i.maximized,next:e.maximized},async()=>await s.setMaximized(e.maximized)]),e.fullscreen!=null&&e.fullscreen!==i.fullscreen&&n.push(["fullscreen",{prev:i.fullscreen,next:e.fullscreen},async()=>await s.setFullscreen(e.fullscreen)]),e.centerCount!==i.centerCount&&n.push(["center",{prev:i.centerCount,next:e.centerCount},async()=>s.center()]),e.minimized!=null&&e.minimized!==i.minimized&&n.push(["minimized",{prev:i.minimized,next:e.minimized},async()=>await s.setMinimized(e.minimized)]),e.resizable!=null&&e.resizable!==i.resizable&&n.push(["resizable",{prev:i.resizable,next:e.resizable},async()=>await s.setResizable(e.resizable)]),e.minSize!=null&&!f._.equals(e.minSize,i.minSize)&&n.push(["minSize",{prev:i.minSize,next:e.minSize},async()=>await s.setMinSize(e.minSize)]),e.maxSize!=null&&!f._.equals(e.maxSize,i.maxSize)&&n.push(["maxSize",{prev:i.maxSize,next:e.maxSize},async()=>await s.setMaxSize(e.maxSize)]),e.size!=null&&!f._.equals(e.size,i.size)&&n.push(["size",{prev:i.size,next:e.size},async()=>await s.setSize(e.size)]),e.position!=null&&!f._.equals(e.position,i.position)&&n.push(["position",{prev:i.position,next:e.position},async()=>await s.setPosition(e.position)]),e.focusCount!==i.focusCount&&n.push(["setVisible",{prev:i.visible,next:e.visible},async()=>await s.setVisible(!0)],["focus",{prev:i.focusCount,next:e.focusCount},async()=>await s.focus()]),e.decorations!=null&&e.decorations!==i.decorations&&n.push(["decorations",{prev:i.decorations,next:e.decorations},async()=>await s.setDecorations(e.decorations)]),e.alwaysOnTop!=null&&e.alwaysOnTop!==i.alwaysOnTop&&n.push(["alwaysOnTop",{prev:i.alwaysOnTop,next:e.alwaysOnTop},async()=>await s.setAlwaysOnTop(e.alwaysOnTop)]),a&&!r&&l(),n.length!==0){o.group(t,`syncCurrent, label: ${s.label()}, key: ${e.key}`);for(const[d,{prev:u,next:c}]of n)o.log(t,d,u,"->",c);o.groupEnd(t);for(const[,,d]of n)await d()}},$=async(i,e,s,t)=>{const n=Object.keys(i.windows).filter(l=>!(l in e.windows)),a=Object.keys(e.windows).filter(l=>!(l in i.windows)),r=s.isMain();if(r&&n.length>0)for(const l of n)o.log(t,"syncMain","closing",l),l===f.MAIN_WINDOW&&await Promise.all(Object.keys(e.windows).filter(d=>d!==f.MAIN_WINDOW).map(async d=>await y(s,d,t))),await y(s,l,t);if(r&&a.length>0)for(const l of a)await v(s,l,e.windows[l],t)},v=async(i,e,s,t)=>(o.log(t,"createWindow",s),await i.create(e,K(s))),y=async(i,e,s)=>(o.log(s,"closeWindow",e),await i.close(e)),m="[drift] - unexpected undefined action",g="[drift] - unexpected undefined action type",_=i=>{if(i.emitted??(i.emitted=!1),i.action==null)throw console.warn(m,i),new Error(m);if(i.action.type==null||i.action.type.length===0)throw console.warn(g,i),new Error(g)},J=new D,Y=[o.runtimeSetWindowProps.type,o.reloadWindow.type],B=(i,e=!1)=>s=>t=>n=>{let{action:a,emitted:r,emitter:l}=U(n);const d=i.label();_({action:n,emitted:r,emitter:l});const u=o.isDriftAction(a.type);if(u&&o.log(e,"[drift] - middleware",{action:a,emitted:r,emitter:l,host:d}),l===i.label())return;const c=u&&!Y.includes(a.type);let w=null;u&&(w=s.getState().drift,a=o.assignLabel(a,w));const p=t(a),S=c?s.getState().drift:null,O=o.shouldEmit(r,a.type);return J.runExclusive(async()=>{try{w!==null&&S!==null&&await X(w,S,i,e),O&&await i.emit({action:a})}catch(b){o.log(e,"[drift] - ERROR",{error:b.message,action:a,emitted:r,emitter:l,host:d}),s.dispatch(o.setWindowError({key:d,message:b.message}))}}),p},G=(i,e,s=!1)=>t=>{const n=i!=null?typeof i=="function"?i(t):i:t();return[B(e,s),...n]},H=async({runtime:i,preloadedState:e,middleware:s,debug:t=!1,enablePrerender:n=!0,defaultWindowProps:a,...r})=>{await i.configure();let l;l=A.configureStore({...r,preloadedState:await x(t,i,()=>l,a,e),middleware:G(s,i,t)}),await Q(l.getState().drift,l.dispatch,i,t);const d=i.label();return l.dispatch(o.internalSetInitial({enablePrerender:n,defaultWindowProps:a,debug:t,label:d})),l.dispatch(o.setWindowStage({stage:"created"})),i.onCloseRequested(()=>l==null?void 0:l.dispatch(o.closeWindow({}))),l},x=async(i,e,s,t,n)=>e.isMain()?(await e.subscribe(({action:r,emitter:l,sendState:d})=>{const u=s();if(u==null)return;if(r!=null){_({action:r,emitter:l}),u.dispatch(z(r,l));return}const c=u.getState();d===!0&&e.emit({state:c},l)}),typeof n=="function"?E(t,i,await n()):E(t,i,n)):await new Promise((r,l)=>{(async()=>{try{await e.subscribe(({action:u,emitter:c,state:w})=>{const p=s();if(p==null)return w!=null?r(w):void 0;u!=null&&(_({action:u,emitter:c}),p.dispatch(z(u,c)))}),await e.emit({sendState:!0},f.MAIN_WINDOW)}catch(u){l(u)}})()}),W=H,E=(i,e,s)=>{if(s==null)return s;const t=s[o.SLICE_NAME];return t.config.debug=e??t.config.debug,t.windows=Object.fromEntries(Object.entries(t.windows).filter(([,n])=>n.reserved).map(([n,a])=>((i==null?void 0:i.visible)!=null&&(a.visible=i.visible),a.focusCount=0,a.centerCount=0,a.processCount=0,[n,a]))),s},ee=Object.freeze(Object.defineProperty({__proto__:null,MAIN_WINDOW:f.MAIN_WINDOW,SLICE_NAME:o.SLICE_NAME,ZERO_SLICE_STATE:o.ZERO_SLICE_STATE,closeWindow:o.closeWindow,completeProcess:o.completeProcess,configureStore:W,createWindow:o.createWindow,focusWindow:o.focusWindow,reducer:o.reducer,registerProcess:o.registerProcess,reloadWindow:o.reloadWindow,selectSliceState:h.selectSliceState,selectWindow:h.selectWindow,selectWindowAttribute:h.selectWindowAttribute,selectWindowKey:h.selectWindowKey,selectWindowLabel:h.selectWindowLabel,selectWindows:h.selectWindows,setWindowAlwaysOnTop:o.setWindowAlwaysOnTop,setWindowDecorations:o.setWindowDecorations,setWindowFullscreen:o.setWindowFullscreen,setWindowMaxSize:o.setWindowMaxSize,setWindowMaximized:o.setWindowMaximized,setWindowMinSize:o.setWindowMinSize,setWindowMinimized:o.setWindowMinimized,setWindowPosition:o.setWindowPosition,setWindowProps:o.setWindowProps,setWindowResizable:o.setWindowResizable,setWindowSize:o.setWindowSize,setWindowSkipTaskbar:o.setWindowSkipTaskbar,setWindowStage:o.setWindowStage,setWindowTitle:o.setWindowTitle,setWindowVisible:o.setWindowVisible,windowPropsZ:f.windowPropsZ},Symbol.toStringTag,{value:"Module"}));exports.SLICE_NAME=o.SLICE_NAME;exports.ZERO_SLICE_STATE=o.ZERO_SLICE_STATE;exports.closeWindow=o.closeWindow;exports.completeProcess=o.completeProcess;exports.createWindow=o.createWindow;exports.focusWindow=o.focusWindow;exports.reducer=o.reducer;exports.registerProcess=o.registerProcess;exports.reloadWindow=o.reloadWindow;exports.setWindowAlwaysOnTop=o.setWindowAlwaysOnTop;exports.setWindowDecorations=o.setWindowDecorations;exports.setWindowFullscreen=o.setWindowFullscreen;exports.setWindowMaxSize=o.setWindowMaxSize;exports.setWindowMaximized=o.setWindowMaximized;exports.setWindowMinSize=o.setWindowMinSize;exports.setWindowMinimized=o.setWindowMinimized;exports.setWindowPosition=o.setWindowPosition;exports.setWindowProps=o.setWindowProps;exports.setWindowResizable=o.setWindowResizable;exports.setWindowSize=o.setWindowSize;exports.setWindowSkipTaskbar=o.setWindowSkipTaskbar;exports.setWindowStage=o.setWindowStage;exports.setWindowTitle=o.setWindowTitle;exports.setWindowVisible=o.setWindowVisible;exports.MAIN_WINDOW=f.MAIN_WINDOW;exports.windowPropsZ=f.windowPropsZ;exports.selectSliceState=h.selectSliceState;exports.selectWindow=h.selectWindow;exports.selectWindowAttribute=h.selectWindowAttribute;exports.selectWindowKey=h.selectWindowKey;exports.selectWindowLabel=h.selectWindowLabel;exports.selectWindows=h.selectWindows;exports.Drift=ee;exports.configureStore=W;
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { configureStore as j } from "@reduxjs/toolkit";
2
- import { M as w, g, l as d, a as T, r as E, _ as p, G as F, I as N, b as I, i as V, c as $, s as U, d as Q, e as Z, f as C, h as q, S as M, Z as K, j as X, k as B, m as G, n as Y, o as H, p as J, q as x, t as W, u as ee, v as se, w as ie, x as te, y as ae, z as oe, A as ne, B as le, C as re, D as ce, E as ue, F as fe } from "./state-B_nrpWi0.js";
3
- import { s as de, a as we, b as he, c as pe, d as ye, e as _e } from "./selectors-CVXi0LBk.js";
2
+ import { g, l as d, a as T, r as E, b as I, i as N, c as F, s as V, d as $, e as U, f as C, h as q, S as M, Z as Q, j as Z, k as K, m as X, n as B, o as J, p as Y, q as G, t as H, u as x, v as W, w as ee, x as se, y as ie, z as te, A as ae, B as oe, C as ne, D as le, E as re } from "./state-D8a0PvFs.js";
3
+ import { M as w, _ as p, J as ce, I as ue, w as fe } from "./window-BIbHrbtA.js";
4
+ import { s as de, a as we, b as he, c as pe, d as ye, e as _e } from "./selectors--wDYbFAe.js";
4
5
  const be = new Error("request for lock canceled");
5
6
  var me = function(i, e, s, t) {
6
7
  function a(o) {
@@ -225,7 +226,7 @@ const ge = (i) => [...new Set(i)], Te = (i, e, s = !0) => {
225
226
  !a.includes(r) && s.isMain() ? (d(t, "state window not in runtime, creating", r), await D(s, r, i.windows[r], t)) : o.includes(r) || (d(t, "runtime window not in state, closing", r), await y(s, r, t));
226
227
  const n = s.label(), c = i.windows[n];
227
228
  if (c == null) return;
228
- const u = { ...N };
229
+ const u = { ...ue };
229
230
  await R(u, c, s, t), e(
230
231
  E({ label: s.label(), ...await s.getProps() })
231
232
  );
@@ -246,7 +247,7 @@ const ge = (i) => [...new Set(i)], Te = (i, e, s = !0) => {
246
247
  async () => {
247
248
  if (await s.setVisible(e.visible), e.visible === !1) return;
248
249
  let c = e.position;
249
- c ?? (c = (await s.getProps()).position), await s.setPosition(F.translate(c, { x: 1, y: 1 })), await s.setPosition(c);
250
+ c ?? (c = (await s.getProps()).position), await s.setPosition(ce.translate(c, { x: 1, y: 1 })), await s.setPosition(c);
250
251
  }
251
252
  ]);
252
253
  if (o && l && n(), e.skipTaskbar != null && e.skipTaskbar !== i.skipTaskbar && a.push([
@@ -333,7 +334,7 @@ const ge = (i) => [...new Set(i)], Te = (i, e, s = !0) => {
333
334
  let { action: o, emitted: l, emitter: n } = qe(a);
334
335
  const c = i.label();
335
336
  _({ action: a, emitted: l, emitter: n });
336
- const u = V(o.type);
337
+ const u = N(o.type);
337
338
  if (u && d(e, "[drift] - middleware", {
338
339
  action: o,
339
340
  emitted: l,
@@ -342,11 +343,11 @@ const ge = (i) => [...new Set(i)], Te = (i, e, s = !0) => {
342
343
  }), n === i.label()) return;
343
344
  const r = u && !De.includes(o.type);
344
345
  let f = null;
345
- u && (f = s.getState().drift, o = $(
346
+ u && (f = s.getState().drift, o = F(
346
347
  o,
347
348
  f
348
349
  ));
349
- const h = t(o), b = r ? s.getState().drift : null, P = U(l, o.type);
350
+ const h = t(o), b = r ? s.getState().drift : null, P = V(l, o.type);
350
351
  return Re.runExclusive(async () => {
351
352
  try {
352
353
  f !== null && b !== null && await Le(f, b, i, e), P && await i.emit({ action: o });
@@ -357,13 +358,13 @@ const ge = (i) => [...new Set(i)], Te = (i, e, s = !0) => {
357
358
  emitted: l,
358
359
  emitter: n,
359
360
  host: c
360
- }), s.dispatch(Q({ key: c, message: m.message }));
361
+ }), s.dispatch($({ key: c, message: m.message }));
361
362
  }
362
363
  }), h;
363
364
  }, je = (i, e, s = !1) => (t) => {
364
365
  const a = i != null ? typeof i == "function" ? i(t) : i : t();
365
366
  return [Pe(e, s), ...a];
366
- }, Fe = async ({
367
+ }, Ne = async ({
367
368
  runtime: i,
368
369
  preloadedState: e,
369
370
  middleware: s,
@@ -376,7 +377,7 @@ const ge = (i) => [...new Set(i)], Te = (i, e, s = !0) => {
376
377
  let n;
377
378
  n = j({
378
379
  ...l,
379
- preloadedState: await Ne(
380
+ preloadedState: await Fe(
380
381
  t,
381
382
  i,
382
383
  () => n,
@@ -387,9 +388,9 @@ const ge = (i) => [...new Set(i)], Te = (i, e, s = !0) => {
387
388
  }), await Oe(n.getState().drift, n.dispatch, i, t);
388
389
  const c = i.label();
389
390
  return n.dispatch(
390
- Z({ enablePrerender: a, defaultWindowProps: o, debug: t, label: c })
391
+ U({ enablePrerender: a, defaultWindowProps: o, debug: t, label: c })
391
392
  ), n.dispatch(C({ stage: "created" })), i.onCloseRequested(() => n == null ? void 0 : n.dispatch(q({}))), n;
392
- }, Ne = async (i, e, s, t, a) => e.isMain() ? (await e.subscribe(({ action: l, emitter: n, sendState: c }) => {
393
+ }, Fe = async (i, e, s, t, a) => e.isMain() ? (await e.subscribe(({ action: l, emitter: n, sendState: c }) => {
393
394
  const u = s();
394
395
  if (u == null) return;
395
396
  if (l != null) {
@@ -411,24 +412,24 @@ const ge = (i) => [...new Set(i)], Te = (i, e, s = !0) => {
411
412
  n(u);
412
413
  }
413
414
  })();
414
- }), Ve = Fe, k = (i, e, s) => {
415
+ }), Ve = Ne, k = (i, e, s) => {
415
416
  if (s == null) return s;
416
417
  const t = s[M];
417
418
  return t.config.debug = e ?? t.config.debug, t.windows = Object.fromEntries(
418
419
  Object.entries(t.windows).filter(([, a]) => a.reserved).map(([a, o]) => ((i == null ? void 0 : i.visible) != null && (o.visible = i.visible), o.focusCount = 0, o.centerCount = 0, o.processCount = 0, [a, o]))
419
420
  ), s;
420
- }, Ze = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
421
+ }, Ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
421
422
  __proto__: null,
422
423
  MAIN_WINDOW: w,
423
424
  SLICE_NAME: M,
424
- ZERO_SLICE_STATE: K,
425
+ ZERO_SLICE_STATE: Q,
425
426
  closeWindow: q,
426
- completeProcess: X,
427
+ completeProcess: Z,
427
428
  configureStore: Ve,
428
- createWindow: B,
429
- focusWindow: G,
430
- reducer: Y,
431
- registerProcess: H,
429
+ createWindow: K,
430
+ focusWindow: X,
431
+ reducer: B,
432
+ registerProcess: J,
432
433
  reloadWindow: I,
433
434
  selectSliceState: de,
434
435
  selectWindow: we,
@@ -436,35 +437,35 @@ const ge = (i) => [...new Set(i)], Te = (i, e, s = !0) => {
436
437
  selectWindowKey: pe,
437
438
  selectWindowLabel: ye,
438
439
  selectWindows: _e,
439
- setWindowAlwaysOnTop: J,
440
- setWindowDecorations: x,
441
- setWindowFullscreen: W,
442
- setWindowMaxSize: ee,
443
- setWindowMaximized: se,
444
- setWindowMinSize: ie,
445
- setWindowMinimized: te,
446
- setWindowPosition: ae,
447
- setWindowProps: oe,
448
- setWindowResizable: ne,
449
- setWindowSize: le,
450
- setWindowSkipTaskbar: re,
440
+ setWindowAlwaysOnTop: Y,
441
+ setWindowDecorations: G,
442
+ setWindowFullscreen: H,
443
+ setWindowMaxSize: x,
444
+ setWindowMaximized: W,
445
+ setWindowMinSize: ee,
446
+ setWindowMinimized: se,
447
+ setWindowPosition: ie,
448
+ setWindowProps: te,
449
+ setWindowResizable: ae,
450
+ setWindowSize: oe,
451
+ setWindowSkipTaskbar: ne,
451
452
  setWindowStage: C,
452
- setWindowTitle: ce,
453
- setWindowVisible: ue,
453
+ setWindowTitle: le,
454
+ setWindowVisible: re,
454
455
  windowPropsZ: fe
455
456
  }, Symbol.toStringTag, { value: "Module" }));
456
457
  export {
457
- Ze as Drift,
458
+ Ke as Drift,
458
459
  w as MAIN_WINDOW,
459
460
  M as SLICE_NAME,
460
- K as ZERO_SLICE_STATE,
461
+ Q as ZERO_SLICE_STATE,
461
462
  q as closeWindow,
462
- X as completeProcess,
463
+ Z as completeProcess,
463
464
  Ve as configureStore,
464
- B as createWindow,
465
- G as focusWindow,
466
- Y as reducer,
467
- H as registerProcess,
465
+ K as createWindow,
466
+ X as focusWindow,
467
+ B as reducer,
468
+ J as registerProcess,
468
469
  I as reloadWindow,
469
470
  de as selectSliceState,
470
471
  we as selectWindow,
@@ -472,20 +473,20 @@ export {
472
473
  pe as selectWindowKey,
473
474
  ye as selectWindowLabel,
474
475
  _e as selectWindows,
475
- J as setWindowAlwaysOnTop,
476
- x as setWindowDecorations,
477
- W as setWindowFullscreen,
478
- ee as setWindowMaxSize,
479
- se as setWindowMaximized,
480
- ie as setWindowMinSize,
481
- te as setWindowMinimized,
482
- ae as setWindowPosition,
483
- oe as setWindowProps,
484
- ne as setWindowResizable,
485
- le as setWindowSize,
486
- re as setWindowSkipTaskbar,
476
+ Y as setWindowAlwaysOnTop,
477
+ G as setWindowDecorations,
478
+ H as setWindowFullscreen,
479
+ x as setWindowMaxSize,
480
+ W as setWindowMaximized,
481
+ ee as setWindowMinSize,
482
+ se as setWindowMinimized,
483
+ ie as setWindowPosition,
484
+ te as setWindowProps,
485
+ ae as setWindowResizable,
486
+ oe as setWindowSize,
487
+ ne as setWindowSkipTaskbar,
487
488
  C as setWindowStage,
488
- ce as setWindowTitle,
489
- ue as setWindowVisible,
489
+ le as setWindowTitle,
490
+ re as setWindowVisible,
490
491
  fe as windowPropsZ
491
492
  };
package/dist/noop.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./window-DLsE0-fP.cjs");class s{async configure(){}isMain(){return!0}label(){return e.MAIN_WINDOW}async emit(){}async subscribe(){}onCloseRequested(){}async listLabels(){return[e.MAIN_WINDOW]}async create(){}async close(){}async focus(){}async setMinimized(){}async setMaximized(){}async setVisible(){}async setFullscreen(){}async center(){}async setPosition(){}async setSize(){}async setMinSize(){}async setMaxSize(){}async setResizable(){}async setSkipTaskbar(){}async setAlwaysOnTop(){}async setTitle(){}async setDecorations(){}async getProps(){return{visible:!0,focus:!0,maximized:!1,minimized:!1,fullscreen:!1,position:{x:0,y:0},size:{width:800,height:600}}}}exports.NoopRuntime=s;
package/dist/noop.js ADDED
@@ -0,0 +1,68 @@
1
+ import { M as s } from "./window-BIbHrbtA.js";
2
+ class a {
3
+ async configure() {
4
+ }
5
+ isMain() {
6
+ return !0;
7
+ }
8
+ label() {
9
+ return s;
10
+ }
11
+ async emit() {
12
+ }
13
+ async subscribe() {
14
+ }
15
+ onCloseRequested() {
16
+ }
17
+ async listLabels() {
18
+ return [s];
19
+ }
20
+ async create() {
21
+ }
22
+ async close() {
23
+ }
24
+ async focus() {
25
+ }
26
+ async setMinimized() {
27
+ }
28
+ async setMaximized() {
29
+ }
30
+ async setVisible() {
31
+ }
32
+ async setFullscreen() {
33
+ }
34
+ async center() {
35
+ }
36
+ async setPosition() {
37
+ }
38
+ async setSize() {
39
+ }
40
+ async setMinSize() {
41
+ }
42
+ async setMaxSize() {
43
+ }
44
+ async setResizable() {
45
+ }
46
+ async setSkipTaskbar() {
47
+ }
48
+ async setAlwaysOnTop() {
49
+ }
50
+ async setTitle() {
51
+ }
52
+ async setDecorations() {
53
+ }
54
+ async getProps() {
55
+ return {
56
+ visible: !0,
57
+ focus: !0,
58
+ maximized: !1,
59
+ minimized: !1,
60
+ fullscreen: !1,
61
+ position: { x: 0, y: 0 },
62
+ size: { width: 800, height: 600 }
63
+ };
64
+ }
65
+ }
66
+ export {
67
+ a as NoopRuntime
68
+ };
package/dist/react.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),u=require("react-redux"),a=require("proxy-memoize"),d=require("./selectors-DsoUWQIE.cjs"),i=require("./state-u8UjvjPJ.cjs"),y=e=>u.useSelector(n.useCallback(a.memoize(s=>d.selectWindow(s,e)),[e])),w=()=>u.useSelector(n.useCallback(a.memoize(d.selectWindows),[])),S=e=>u.useSelector(n.useCallback(a.memoize(s=>d.selectWindowKey(s,e)),[e])),W=(e,s)=>u.useSelector(n.useCallback(a.memoize(t=>d.selectWindowAttribute(t,e,s)),[e,s])),m=(e,s)=>{const t=y(s),o=u.useDispatch(),c=n.useRef(null);n.useEffect(()=>{if(t==null)return;const{stage:r}=t;if(r==="created"&&c.current==null){const l=e();l!=null&&(c.current=l),o(i.registerProcess({key:t.key}))}else(r==="closing"||r==="reloading")&&c.current!=null&&(c.current(),c.current=null,o(i.completeProcess({key:t.key})))},[t])},h=(e,s)=>{const t=y(s),o=u.useDispatch(),c=n.useRef(null),r=n.useRef(!1);n.useEffect(()=>{if(t==null)return;const{stage:l}=t;if(l==="created"&&c.current==null)r.current=!0,e().then(f=>{c.current=f??(async()=>{}),o(i.registerProcess({key:t.key}))}).catch(console.error).finally(()=>{r.current=!1});else if((l==="closing"||l==="reloading")&&c.current!=null){const f=c.current;c.current=null,f().then(()=>{c.current=null}).catch(console.error).finally(()=>{o(i.completeProcess({key:t.key}))})}},[t])},g=({store:e,emptyContent:s=null,children:t})=>{const[o,c]=n.useState(null),[r,l]=n.useState(null);if(r!=null)throw l(null),r;return o==null?(e instanceof Promise?e.then(c).catch(l):c(e),s):n.createElement(u.Provider,{store:o},t)};exports.Provider=g;exports.useAsyncWindowLifecycle=h;exports.useSelectWindow=y;exports.useSelectWindowAttribute=W;exports.useSelectWindowKey=S;exports.useSelectWindows=w;exports.useWindowLifecycle=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),u=require("react-redux"),a=require("proxy-memoize"),d=require("./selectors-jksTA_U1.cjs"),i=require("./state-Ckw4CzST.cjs"),y=e=>u.useSelector(n.useCallback(a.memoize(s=>d.selectWindow(s,e)),[e])),w=()=>u.useSelector(n.useCallback(a.memoize(d.selectWindows),[])),S=e=>u.useSelector(n.useCallback(a.memoize(s=>d.selectWindowKey(s,e)),[e])),W=(e,s)=>u.useSelector(n.useCallback(a.memoize(t=>d.selectWindowAttribute(t,e,s)),[e,s])),m=(e,s)=>{const t=y(s),o=u.useDispatch(),c=n.useRef(null);n.useEffect(()=>{if(t==null)return;const{stage:r}=t;if(r==="created"&&c.current==null){const l=e();l!=null&&(c.current=l),o(i.registerProcess({key:t.key}))}else(r==="closing"||r==="reloading")&&c.current!=null&&(c.current(),c.current=null,o(i.completeProcess({key:t.key})))},[t])},h=(e,s)=>{const t=y(s),o=u.useDispatch(),c=n.useRef(null),r=n.useRef(!1);n.useEffect(()=>{if(t==null)return;const{stage:l}=t;if(l==="created"&&c.current==null)r.current=!0,e().then(f=>{c.current=f??(async()=>{}),o(i.registerProcess({key:t.key}))}).catch(console.error).finally(()=>{r.current=!1});else if((l==="closing"||l==="reloading")&&c.current!=null){const f=c.current;c.current=null,f().then(()=>{c.current=null}).catch(console.error).finally(()=>{o(i.completeProcess({key:t.key}))})}},[t])},g=({store:e,emptyContent:s=null,children:t})=>{const[o,c]=n.useState(null),[r,l]=n.useState(null);if(r!=null)throw l(null),r;return o==null?(e instanceof Promise?e.then(c).catch(l):c(e),s):n.createElement(u.Provider,{store:o},t)};exports.Provider=g;exports.useAsyncWindowLifecycle=h;exports.useSelectWindow=y;exports.useSelectWindowAttribute=W;exports.useSelectWindowKey=S;exports.useSelectWindows=w;exports.useWindowLifecycle=m;
package/dist/react.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { useCallback as l, useRef as f, useEffect as m, useState as d, createElement as W } from "react";
2
2
  import { useSelector as u, useDispatch as y, Provider as g } from "react-redux";
3
3
  import { memoize as i } from "proxy-memoize";
4
- import { a as k, e as S, c as P, b as v } from "./selectors-CVXi0LBk.js";
5
- import { o as w, j as p } from "./state-B_nrpWi0.js";
4
+ import { a as k, e as S, c as P, b as v } from "./selectors--wDYbFAe.js";
5
+ import { o as w, j as p } from "./state-D8a0PvFs.js";
6
6
  const h = (e) => u(
7
7
  l(
8
8
  i((r) => k(r, e)),
@@ -1,4 +1,4 @@
1
- import { M as i } from "./state-B_nrpWi0.js";
1
+ import { M as i } from "./window-BIbHrbtA.js";
2
2
  const l = (n) => n.drift, a = (n) => Object.values(l(n).windows), r = (n, e) => {
3
3
  const t = l(n);
4
4
  if (e == null) return t.windows[t.label];
@@ -0,0 +1 @@
1
+ "use strict";const i=require("./window-DLsE0-fP.cjs"),s=n=>n.drift,r=n=>Object.values(s(n).windows),c=(n,e)=>{const t=s(n);if(e==null)return t.windows[t.label];let l=t.windows[e];if(l!=null)return l;const o=t.keyLabels[e];return l=t.windows[o],l==null&&e!=null?null:l??t.windows[t.label]},w=(n,e)=>{const t=s(n);if(e==null)return t.labelKeys[t.label];const l=t.labelKeys[e];return l==null&&e==i.MAIN_WINDOW?i.MAIN_WINDOW:l},d=(n,e,t)=>{var l;return((l=c(n,e))==null?void 0:l[t])??null},u=(n,e)=>s(n).keyLabels[e];exports.selectSliceState=s;exports.selectWindow=c;exports.selectWindowAttribute=d;exports.selectWindowKey=w;exports.selectWindowLabel=u;exports.selectWindows=r;
@@ -0,0 +1,32 @@
1
+ import { Action, UnknownAction } from '@reduxjs/toolkit';
2
+ import { Runtime } from '../runtime';
3
+ import { StoreState } from '../state';
4
+ import { WindowProps } from '../window';
5
+ export declare class NoopRuntime<S extends StoreState, A extends Action = UnknownAction> implements Runtime<S, A> {
6
+ configure(): Promise<void>;
7
+ isMain(): boolean;
8
+ label(): string;
9
+ emit(): Promise<void>;
10
+ subscribe(): Promise<void>;
11
+ onCloseRequested(): void;
12
+ listLabels(): Promise<string[]>;
13
+ create(): Promise<void>;
14
+ close(): Promise<void>;
15
+ focus(): Promise<void>;
16
+ setMinimized(): Promise<void>;
17
+ setMaximized(): Promise<void>;
18
+ setVisible(): Promise<void>;
19
+ setFullscreen(): Promise<void>;
20
+ center(): Promise<void>;
21
+ setPosition(): Promise<void>;
22
+ setSize(): Promise<void>;
23
+ setMinSize(): Promise<void>;
24
+ setMaxSize(): Promise<void>;
25
+ setResizable(): Promise<void>;
26
+ setSkipTaskbar(): Promise<void>;
27
+ setAlwaysOnTop(): Promise<void>;
28
+ setTitle(): Promise<void>;
29
+ setDecorations(): Promise<void>;
30
+ getProps(): Promise<Omit<WindowProps, "key">>;
31
+ }
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/noop/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAEzD,qBAAa,WAAW,CAAC,CAAC,SAAS,UAAU,EAAE,CAAC,SAAS,MAAM,GAAG,aAAa,CAC7E,YAAW,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IAElB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAEhC,MAAM,IAAI,OAAO;IAIjB,KAAK,IAAI,MAAM;IAIT,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAErB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAEhC,gBAAgB,IAAI,IAAI;IAElB,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAI/B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAEvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAEtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAEtB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAE7B,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAE7B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAE3B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAE9B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAEvB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAE5B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAExB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAE3B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAE3B,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAE7B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAE/B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAE/B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAEzB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAE/B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;CAWpD"}
@@ -61,43 +61,19 @@ export declare const windowPropsZ: z.ZodObject<{
61
61
  position: z.ZodOptional<z.ZodObject<{
62
62
  x: z.ZodNumber;
63
63
  y: z.ZodNumber;
64
- }, "strip", z.ZodTypeAny, {
65
- x: number;
66
- y: number;
67
- }, {
68
- x: number;
69
- y: number;
70
- }>>;
64
+ }, {}>>;
71
65
  size: z.ZodOptional<z.ZodObject<{
72
66
  width: z.ZodNumber;
73
67
  height: z.ZodNumber;
74
- }, "strip", z.ZodTypeAny, {
75
- width: number;
76
- height: number;
77
- }, {
78
- width: number;
79
- height: number;
80
- }>>;
68
+ }, {}>>;
81
69
  minSize: z.ZodOptional<z.ZodObject<{
82
70
  width: z.ZodNumber;
83
71
  height: z.ZodNumber;
84
- }, "strip", z.ZodTypeAny, {
85
- width: number;
86
- height: number;
87
- }, {
88
- width: number;
89
- height: number;
90
- }>>;
72
+ }, {}>>;
91
73
  maxSize: z.ZodOptional<z.ZodObject<{
92
74
  width: z.ZodNumber;
93
75
  height: z.ZodNumber;
94
- }, "strip", z.ZodTypeAny, {
95
- width: number;
96
- height: number;
97
- }, {
98
- width: number;
99
- height: number;
100
- }>>;
76
+ }, {}>>;
101
77
  resizable: z.ZodOptional<z.ZodBoolean>;
102
78
  fullscreen: z.ZodOptional<z.ZodBoolean>;
103
79
  focus: z.ZodOptional<z.ZodBoolean>;
@@ -109,69 +85,5 @@ export declare const windowPropsZ: z.ZodObject<{
109
85
  fileDropEnabled: z.ZodOptional<z.ZodBoolean>;
110
86
  transparent: z.ZodOptional<z.ZodBoolean>;
111
87
  alwaysOnTop: z.ZodOptional<z.ZodBoolean>;
112
- }, "strip", z.ZodTypeAny, {
113
- key: string;
114
- url?: string | undefined;
115
- title?: string | undefined;
116
- center?: boolean | undefined;
117
- position?: {
118
- x: number;
119
- y: number;
120
- } | undefined;
121
- size?: {
122
- width: number;
123
- height: number;
124
- } | undefined;
125
- minSize?: {
126
- width: number;
127
- height: number;
128
- } | undefined;
129
- maxSize?: {
130
- width: number;
131
- height: number;
132
- } | undefined;
133
- resizable?: boolean | undefined;
134
- fullscreen?: boolean | undefined;
135
- focus?: boolean | undefined;
136
- maximized?: boolean | undefined;
137
- visible?: boolean | undefined;
138
- minimized?: boolean | undefined;
139
- decorations?: boolean | undefined;
140
- skipTaskbar?: boolean | undefined;
141
- fileDropEnabled?: boolean | undefined;
142
- transparent?: boolean | undefined;
143
- alwaysOnTop?: boolean | undefined;
144
- }, {
145
- key: string;
146
- url?: string | undefined;
147
- title?: string | undefined;
148
- center?: boolean | undefined;
149
- position?: {
150
- x: number;
151
- y: number;
152
- } | undefined;
153
- size?: {
154
- width: number;
155
- height: number;
156
- } | undefined;
157
- minSize?: {
158
- width: number;
159
- height: number;
160
- } | undefined;
161
- maxSize?: {
162
- width: number;
163
- height: number;
164
- } | undefined;
165
- resizable?: boolean | undefined;
166
- fullscreen?: boolean | undefined;
167
- focus?: boolean | undefined;
168
- maximized?: boolean | undefined;
169
- visible?: boolean | undefined;
170
- minimized?: boolean | undefined;
171
- decorations?: boolean | undefined;
172
- skipTaskbar?: boolean | undefined;
173
- fileDropEnabled?: boolean | undefined;
174
- transparent?: boolean | undefined;
175
- alwaysOnTop?: boolean | undefined;
176
- }>;
88
+ }, {}>;
177
89
  //# sourceMappingURL=window.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../src/window.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,0DAA0D;AAC1D,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEtF,eAAO,MAAM,WAAW,SAAS,CAAC;AAClC,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAE5C,MAAM,WAAW,yBAAyB;IACxC,sBAAsB;IACtB,KAAK,EAAE,WAAW,CAAC;IACnB,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,oBAAoB,EAAE,yBAMlC,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,WAI5C,CAAC;AAEF,0CAA0C;AAC1C,MAAM,WAAW,WAAY,SAAQ,WAAW,EAAE,yBAAyB;CAAG;AAE9E;;GAEG;AACH,MAAM,WAAW,WAAW;IAE1B,GAAG,EAAE,MAAM,CAAC;IAEZ,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;IAEjB,IAAI,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC;IAE7B,OAAO,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC;IAEhC,OAAO,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC;IAEhC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBvB,CAAC"}
1
+ {"version":3,"file":"window.d.ts","sourceRoot":"","sources":["../../src/window.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,0DAA0D;AAC1D,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEtF,eAAO,MAAM,WAAW,SAAS,CAAC;AAClC,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAE5C,MAAM,WAAW,yBAAyB;IACxC,sBAAsB;IACtB,KAAK,EAAE,WAAW,CAAC;IACnB,iCAAiC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,oBAAoB,EAAE,yBAMlC,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,WAI5C,CAAC;AAEF,0CAA0C;AAC1C,MAAM,WAAW,WAAY,SAAQ,WAAW,EAAE,yBAAyB;CAAG;AAE9E;;GAEG;AACH,MAAM,WAAW,WAAW;IAE1B,GAAG,EAAE,MAAM,CAAC;IAEZ,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,QAAQ,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;IAEjB,IAAI,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC;IAE7B,OAAO,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC;IAEhC,OAAO,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC;IAEhC,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAoBvB,CAAC"}