@tauri-controls-v2/vue 0.4.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 eatham532
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ <picture>
2
+ <source media="(prefers-color-scheme: dark)" srcset="https://github.com/eatham532/tauri-controls-v2/assets/16024979/8ac8cae0-9cde-4b27-af8b-02d949ede7a2">
3
+ <img alt="Tauri Controls" src="https://github.com/eatham532/tauri-controls-v2/assets/16024979/12f46aa7-72de-4c44-aa4a-0580c73fc73a">
4
+ </picture>
5
+
6
+ ![](https://img.shields.io/bundlephobia/min/%40tauri-controls%2Fvue)
7
+ ![](https://img.shields.io/bundlephobia/minzip/%40tauri-controls%2Fvue)
8
+ [![](https://img.shields.io/npm/dt/%40tauri-controls%2Fvue)](https://npmjs.com/package/tauri-controls) [![Vue.js](https://img.shields.io/badge/Vue.js-%2335495e.svg?logo=vuedotjs&logoColor=%234FC08D)](https://www.npmjs.com/package/@tauri-controls-v2/vue)
9
+
10
+ ## @tauri-controls-v2/vue
11
+
12
+ ```bash
13
+ pnpm add @tauri-controls-v2/vue
14
+ ```
15
+
16
+ https://github.com/eatham532/tauri-controls-v2
@@ -0,0 +1 @@
1
+ import"./tauri-controls.css";var e;const t="__TAURI_TO_IPC_KEY__";function i(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}async function n(e,t={},i){return window.__TAURI_INTERNALS__.invoke(e,t,i)}class a{get rid(){return function(e,t){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}(this,e)}constructor(t){e.set(this,void 0),function(e,t,i){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");t.set(e,i)}(this,e,t)}async close(){return n("plugin:resources|close",{rid:this.rid})}}e=new WeakMap;class l extends a{constructor(e){super(e)}static async new(e,t,i){return n("plugin:image|new",{rgba:s(e),width:t,height:i}).then((e=>new l(e)))}static async fromBytes(e){return n("plugin:image|from_bytes",{bytes:s(e)}).then((e=>new l(e)))}static async fromPath(e){return n("plugin:image|from_path",{path:e}).then((e=>new l(e)))}async rgba(){return n("plugin:image|rgba",{rid:this.rid}).then((e=>new Uint8Array(e)))}async size(){return n("plugin:image|size",{rid:this.rid})}}function s(e){return null==e?null:"string"==typeof e?e:e instanceof l?e.rid:e}var r,o,u,c,h,w,d;(d=r||(r={})).Nsis="nsis",d.Msi="msi",d.Deb="deb",d.Rpm="rpm",d.AppImage="appimage",d.App="app";class p{constructor(...e){this.type="Logical",1===e.length?"Logical"in e[0]?(this.width=e[0].Logical.width,this.height=e[0].Logical.height):(this.width=e[0].width,this.height=e[0].height):(this.width=e[0],this.height=e[1])}toPhysical(e){return new b(this.width*e,this.height*e)}[t](){return{width:this.width,height:this.height}}toJSON(){return this[t]()}}class b{constructor(...e){this.type="Physical",1===e.length?"Physical"in e[0]?(this.width=e[0].Physical.width,this.height=e[0].Physical.height):(this.width=e[0].width,this.height=e[0].height):(this.width=e[0],this.height=e[1])}toLogical(e){return new p(this.width/e,this.height/e)}[t](){return{width:this.width,height:this.height}}toJSON(){return this[t]()}}class g{constructor(e){this.size=e}toLogical(e){return this.size instanceof p?this.size:this.size.toLogical(e)}toPhysical(e){return this.size instanceof b?this.size:this.size.toPhysical(e)}[t](){return{[`${this.size.type}`]:{width:this.size.width,height:this.size.height}}}toJSON(){return this[t]()}}class y{constructor(...e){this.type="Logical",1===e.length?"Logical"in e[0]?(this.x=e[0].Logical.x,this.y=e[0].Logical.y):(this.x=e[0].x,this.y=e[0].y):(this.x=e[0],this.y=e[1])}toPhysical(e){return new _(this.x*e,this.y*e)}[t](){return{x:this.x,y:this.y}}toJSON(){return this[t]()}}class _{constructor(...e){this.type="Physical",1===e.length?"Physical"in e[0]?(this.x=e[0].Physical.x,this.y=e[0].Physical.y):(this.x=e[0].x,this.y=e[0].y):(this.x=e[0],this.y=e[1])}toLogical(e){return new y(this.x/e,this.y/e)}[t](){return{x:this.x,y:this.y}}toJSON(){return this[t]()}}class v{constructor(e){this.position=e}toLogical(e){return this.position instanceof y?this.position:this.position.toLogical(e)}toPhysical(e){return this.position instanceof _?this.position:this.position.toPhysical(e)}[t](){return{[`${this.position.type}`]:{x:this.position.x,y:this.position.y}}}toJSON(){return this[t]()}}async function m(e,t){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(e,t),await n("plugin:event|unlisten",{event:e,eventId:t})}async function f(e,t,a){var l;const s="string"==typeof a?.target?{kind:"AnyLabel",label:a.target}:null!==(l=a?.target)&&void 0!==l?l:{kind:"Any"};return n("plugin:event|listen",{event:e,target:s,handler:i(t)}).then((t=>async()=>m(e,t)))}async function E(e,t,i){return f(e,(i=>{m(e,i.id),t(i)}),i)}async function D(e,t){await n("plugin:event|emit",{event:e,payload:t})}async function A(e,t,i){await n("plugin:event|emit_to",{target:"string"==typeof e?{kind:"AnyLabel",label:e}:e,event:t,payload:i})}(function(e){e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_CREATED="tauri://window-created",e.WEBVIEW_CREATED="tauri://webview-created",e.DRAG_ENTER="tauri://drag-enter",e.DRAG_OVER="tauri://drag-over",e.DRAG_DROP="tauri://drag-drop",e.DRAG_LEAVE="tauri://drag-leave"})(o||(o={})),function(e){e.Add="Add",e.Advanced="Advanced",e.Bluetooth="Bluetooth",e.Bookmarks="Bookmarks",e.Caution="Caution",e.ColorPanel="ColorPanel",e.ColumnView="ColumnView",e.Computer="Computer",e.EnterFullScreen="EnterFullScreen",e.Everyone="Everyone",e.ExitFullScreen="ExitFullScreen",e.FlowView="FlowView",e.Folder="Folder",e.FolderBurnable="FolderBurnable",e.FolderSmart="FolderSmart",e.FollowLinkFreestanding="FollowLinkFreestanding",e.FontPanel="FontPanel",e.GoLeft="GoLeft",e.GoRight="GoRight",e.Home="Home",e.IChatTheater="IChatTheater",e.IconView="IconView",e.Info="Info",e.InvalidDataFreestanding="InvalidDataFreestanding",e.LeftFacingTriangle="LeftFacingTriangle",e.ListView="ListView",e.LockLocked="LockLocked",e.LockUnlocked="LockUnlocked",e.MenuMixedState="MenuMixedState",e.MenuOnState="MenuOnState",e.MobileMe="MobileMe",e.MultipleDocuments="MultipleDocuments",e.Network="Network",e.Path="Path",e.PreferencesGeneral="PreferencesGeneral",e.QuickLook="QuickLook",e.RefreshFreestanding="RefreshFreestanding",e.Refresh="Refresh",e.Remove="Remove",e.RevealFreestanding="RevealFreestanding",e.RightFacingTriangle="RightFacingTriangle",e.Share="Share",e.Slideshow="Slideshow",e.SmartBadge="SmartBadge",e.StatusAvailable="StatusAvailable",e.StatusNone="StatusNone",e.StatusPartiallyAvailable="StatusPartiallyAvailable",e.StatusUnavailable="StatusUnavailable",e.StopProgressFreestanding="StopProgressFreestanding",e.StopProgress="StopProgress",e.TrashEmpty="TrashEmpty",e.TrashFull="TrashFull",e.User="User",e.UserAccounts="UserAccounts",e.UserGroup="UserGroup",e.UserGuest="UserGuest"}(u||(u={})),function(e){e[e.Audio=1]="Audio",e[e.Cache=2]="Cache",e[e.Config=3]="Config",e[e.Data=4]="Data",e[e.LocalData=5]="LocalData",e[e.Document=6]="Document",e[e.Download=7]="Download",e[e.Picture=8]="Picture",e[e.Public=9]="Public",e[e.Video=10]="Video",e[e.Resource=11]="Resource",e[e.Temp=12]="Temp",e[e.AppConfig=13]="AppConfig",e[e.AppData=14]="AppData",e[e.AppLocalData=15]="AppLocalData",e[e.AppCache=16]="AppCache",e[e.AppLog=17]="AppLog",e[e.Desktop=18]="Desktop",e[e.Executable=19]="Executable",e[e.Font=20]="Font",e[e.Home=21]="Home",e[e.Runtime=22]="Runtime",e[e.Template=23]="Template"}(c||(c={})),function(e){e[e.Critical=1]="Critical",e[e.Informational=2]="Informational"}(h||(h={}));class S{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}function k(){return new R(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}async function z(){return n("plugin:window|get_all_windows").then((e=>e.map((e=>new R(e,{skip:!0})))))}!function(e){e.None="none",e.Normal="normal",e.Indeterminate="indeterminate",e.Paused="paused",e.Error="error"}(w||(w={}));const L=["tauri://created","tauri://error"];class R{constructor(e,t={}){var i;this.label=e,this.listeners=Object.create(null),t?.skip||n("plugin:window|create",{options:{...t,parent:"string"==typeof t.parent?t.parent:null===(i=t.parent)||void 0===i?void 0:i.label,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static async getByLabel(e){var t;return null!==(t=(await z()).find((t=>t.label===e)))&&void 0!==t?t:null}static getCurrent(){return k()}static async getAll(){return z()}static async getFocusedWindow(){for(const e of await z())if(await e.isFocused())return e;return null}async listen(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:f(e,t,{target:{kind:"Window",label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:E(e,t,{target:{kind:"Window",label:this.label}})}async emit(e,t){if(!L.includes(e))return D(e,t);for(const i of this.listeners[e]||[])i({event:e,id:-1,payload:t})}async emitTo(e,t,i){if(!L.includes(t))return A(e,t,i);for(const e of this.listeners[t]||[])e({event:t,id:-1,payload:i})}_handleTauriEvent(e,t){return!!L.includes(e)&&(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0)}async scaleFactor(){return n("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return n("plugin:window|inner_position",{label:this.label}).then((e=>new _(e)))}async outerPosition(){return n("plugin:window|outer_position",{label:this.label}).then((e=>new _(e)))}async innerSize(){return n("plugin:window|inner_size",{label:this.label}).then((e=>new b(e)))}async outerSize(){return n("plugin:window|outer_size",{label:this.label}).then((e=>new b(e)))}async isFullscreen(){return n("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return n("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return n("plugin:window|is_maximized",{label:this.label})}async isFocused(){return n("plugin:window|is_focused",{label:this.label})}async isDecorated(){return n("plugin:window|is_decorated",{label:this.label})}async isResizable(){return n("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return n("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return n("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return n("plugin:window|is_closable",{label:this.label})}async isVisible(){return n("plugin:window|is_visible",{label:this.label})}async title(){return n("plugin:window|title",{label:this.label})}async theme(){return n("plugin:window|theme",{label:this.label})}async isAlwaysOnTop(){return n("plugin:window|is_always_on_top",{label:this.label})}async center(){return n("plugin:window|center",{label:this.label})}async requestUserAttention(e){let t=null;return e&&(t=e===h.Critical?{type:"Critical"}:{type:"Informational"}),n("plugin:window|request_user_attention",{label:this.label,value:t})}async setResizable(e){return n("plugin:window|set_resizable",{label:this.label,value:e})}async setEnabled(e){return n("plugin:window|set_enabled",{label:this.label,value:e})}async isEnabled(){return n("plugin:window|is_enabled",{label:this.label})}async setMaximizable(e){return n("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return n("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return n("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return n("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return n("plugin:window|maximize",{label:this.label})}async unmaximize(){return n("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return n("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return n("plugin:window|minimize",{label:this.label})}async unminimize(){return n("plugin:window|unminimize",{label:this.label})}async show(){return n("plugin:window|show",{label:this.label})}async hide(){return n("plugin:window|hide",{label:this.label})}async close(){return n("plugin:window|close",{label:this.label})}async destroy(){return n("plugin:window|destroy",{label:this.label})}async setDecorations(e){return n("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return n("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return n("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return n("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return n("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return n("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return n("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){return n("plugin:window|set_size",{label:this.label,value:e instanceof g?e:new g(e)})}async setMinSize(e){return n("plugin:window|set_min_size",{label:this.label,value:e instanceof g?e:e?new g(e):null})}async setMaxSize(e){return n("plugin:window|set_max_size",{label:this.label,value:e instanceof g?e:e?new g(e):null})}async setSizeConstraints(e){function t(e){return e?{Logical:e}:null}return n("plugin:window|set_size_constraints",{label:this.label,value:{minWidth:t(e?.minWidth),minHeight:t(e?.minHeight),maxWidth:t(e?.maxWidth),maxHeight:t(e?.maxHeight)}})}async setPosition(e){return n("plugin:window|set_position",{label:this.label,value:e instanceof v?e:new v(e)})}async setFullscreen(e){return n("plugin:window|set_fullscreen",{label:this.label,value:e})}async setSimpleFullscreen(e){return n("plugin:window|set_simple_fullscreen",{label:this.label,value:e})}async setFocus(){return n("plugin:window|set_focus",{label:this.label})}async setFocusable(e){return n("plugin:window|set_focusable",{label:this.label,value:e})}async setIcon(e){return n("plugin:window|set_icon",{label:this.label,value:s(e)})}async setSkipTaskbar(e){return n("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return n("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return n("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return n("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setBackgroundColor(e){return n("plugin:window|set_background_color",{color:e})}async setCursorPosition(e){return n("plugin:window|set_cursor_position",{label:this.label,value:e instanceof v?e:new v(e)})}async setIgnoreCursorEvents(e){return n("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return n("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(e){return n("plugin:window|start_resize_dragging",{label:this.label,value:e})}async setBadgeCount(e){return n("plugin:window|set_badge_count",{label:this.label,value:e})}async setBadgeLabel(e){return n("plugin:window|set_badge_label",{label:this.label,value:e})}async setOverlayIcon(e){return n("plugin:window|set_overlay_icon",{label:this.label,value:e?s(e):void 0})}async setProgressBar(e){return n("plugin:window|set_progress_bar",{label:this.label,value:e})}async setVisibleOnAllWorkspaces(e){return n("plugin:window|set_visible_on_all_workspaces",{label:this.label,value:e})}async setTitleBarStyle(e){return n("plugin:window|set_title_bar_style",{label:this.label,value:e})}async setTheme(e){return n("plugin:window|set_theme",{label:this.label,value:e})}async onResized(e){return this.listen(o.WINDOW_RESIZED,(t=>{t.payload=new b(t.payload),e(t)}))}async onMoved(e){return this.listen(o.WINDOW_MOVED,(t=>{t.payload=new _(t.payload),e(t)}))}async onCloseRequested(e){return this.listen(o.WINDOW_CLOSE_REQUESTED,(async t=>{const i=new S(t);await e(i),i.isPreventDefault()||await this.destroy()}))}async onDragDropEvent(e){const t=await this.listen(o.DRAG_ENTER,(t=>{e({...t,payload:{type:"enter",paths:t.payload.paths,position:new _(t.payload.position)}})})),i=await this.listen(o.DRAG_OVER,(t=>{e({...t,payload:{type:"over",position:new _(t.payload.position)}})})),n=await this.listen(o.DRAG_DROP,(t=>{e({...t,payload:{type:"drop",paths:t.payload.paths,position:new _(t.payload.position)}})})),a=await this.listen(o.DRAG_LEAVE,(t=>{e({...t,payload:{type:"leave"}})}));return()=>{t(),n(),i(),a()}}async onFocusChanged(e){const t=await this.listen(o.WINDOW_FOCUS,(t=>{e({...t,payload:!0})})),i=await this.listen(o.WINDOW_BLUR,(t=>{e({...t,payload:!1})}));return()=>{t(),i()}}async onScaleChanged(e){return this.listen(o.WINDOW_SCALE_FACTOR_CHANGED,e)}async onThemeChanged(e){return this.listen(o.WINDOW_THEME_CHANGED,e)}}var T,O,C,P;function W(e){return null===e?null:{name:e.name,scaleFactor:e.scaleFactor,position:new _(e.position),size:new b(e.size),workArea:{position:new _(e.workArea.position),size:new b(e.workArea.size)}}}(function(e){e.Disabled="disabled",e.Throttle="throttle",e.Suspend="suspend"})(T||(T={})),function(e){e.Default="default",e.FluentOverlay="fluentOverlay"}(O||(O={})),function(e){e.AppearanceBased="appearanceBased",e.Light="light",e.Dark="dark",e.MediumLight="mediumLight",e.UltraDark="ultraDark",e.Titlebar="titlebar",e.Selection="selection",e.Menu="menu",e.Popover="popover",e.Sidebar="sidebar",e.HeaderView="headerView",e.Sheet="sheet",e.WindowBackground="windowBackground",e.HudWindow="hudWindow",e.FullScreenUI="fullScreenUI",e.Tooltip="tooltip",e.ContentBackground="contentBackground",e.UnderWindowBackground="underWindowBackground",e.UnderPageBackground="underPageBackground",e.Mica="mica",e.Blur="blur",e.Acrylic="acrylic",e.Tabbed="tabbed",e.TabbedDark="tabbedDark",e.TabbedLight="tabbedLight"}(C||(C={})),function(e){e.FollowsWindowActiveState="followsWindowActiveState",e.Active="active",e.Inactive="inactive"}(P||(P={}));const F=Object.freeze(Object.defineProperty({__proto__:null,CloseRequestedEvent:S,get Effect(){return C},get EffectState(){return P},LogicalPosition:y,LogicalSize:p,PhysicalPosition:_,PhysicalSize:b,get ProgressBarStatus(){return w},get UserAttentionType(){return h},Window:R,availableMonitors:async function(){return n("plugin:window|available_monitors").then((e=>e.map(W)))},currentMonitor:async function(){return n("plugin:window|current_monitor").then(W)},cursorPosition:async function(){return n("plugin:window|cursor_position").then((e=>new _(e)))},getAllWindows:z,getCurrentWindow:k,monitorFromPoint:async function(e,t){return n("plugin:window|monitor_from_point",{x:e,y:t}).then(W)},primaryMonitor:async function(){return n("plugin:window|primary_monitor").then(W)}},Symbol.toStringTag,{value:"Module"}));function I(){return new B(k(),window.__TAURI_INTERNALS__.metadata.currentWebview.label,{skip:!0})}async function x(){return n("plugin:webview|get_all_webviews").then((e=>e.map((e=>new B(new R(e.windowLabel,{skip:!0}),e.label,{skip:!0})))))}const N=["tauri://created","tauri://error"];class B{constructor(e,t,i){this.window=e,this.label=t,this.listeners=Object.create(null),i?.skip||n("plugin:webview|create_webview",{windowLabel:e.label,options:{...i,label:t}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static async getByLabel(e){var t;return null!==(t=(await x()).find((t=>t.label===e)))&&void 0!==t?t:null}static getCurrent(){return I()}static async getAll(){return x()}async listen(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:f(e,t,{target:{kind:"Webview",label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:E(e,t,{target:{kind:"Webview",label:this.label}})}async emit(e,t){if(!N.includes(e))return D(e,t);for(const i of this.listeners[e]||[])i({event:e,id:-1,payload:t})}async emitTo(e,t,i){if(!N.includes(t))return A(e,t,i);for(const e of this.listeners[t]||[])e({event:t,id:-1,payload:i})}_handleTauriEvent(e,t){return!!N.includes(e)&&(e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t],!0)}async position(){return n("plugin:webview|webview_position",{label:this.label}).then((e=>new _(e)))}async size(){return n("plugin:webview|webview_size",{label:this.label}).then((e=>new b(e)))}async close(){return n("plugin:webview|webview_close",{label:this.label})}async setSize(e){return n("plugin:webview|set_webview_size",{label:this.label,value:e instanceof g?e:new g(e)})}async setPosition(e){return n("plugin:webview|set_webview_position",{label:this.label,value:e instanceof v?e:new v(e)})}async setFocus(){return n("plugin:webview|set_webview_focus",{label:this.label})}async setAutoResize(e){return n("plugin:webview|set_webview_auto_resize",{label:this.label,value:e})}async hide(){return n("plugin:webview|webview_hide",{label:this.label})}async show(){return n("plugin:webview|webview_show",{label:this.label})}async setZoom(e){return n("plugin:webview|set_webview_zoom",{label:this.label,value:e})}async reparent(e){return n("plugin:webview|reparent",{label:this.label,window:"string"==typeof e?e:e.label})}async clearAllBrowsingData(){return n("plugin:webview|clear_all_browsing_data")}async setBackgroundColor(e){return n("plugin:webview|set_webview_background_color",{color:e})}async onDragDropEvent(e){const t=await this.listen(o.DRAG_ENTER,(t=>{e({...t,payload:{type:"enter",paths:t.payload.paths,position:new _(t.payload.position)}})})),i=await this.listen(o.DRAG_OVER,(t=>{e({...t,payload:{type:"over",position:new _(t.payload.position)}})})),n=await this.listen(o.DRAG_DROP,(t=>{e({...t,payload:{type:"drop",paths:t.payload.paths,position:new _(t.payload.position)}})})),a=await this.listen(o.DRAG_LEAVE,(t=>{e({...t,payload:{type:"leave"}})}));return()=>{t(),n(),i(),a()}}}async function M(){return n("plugin:window|get_all_windows").then((e=>e.map((e=>new U(e,{skip:!0})))))}class U{constructor(e,t={}){var i;this.label=e,this.listeners=Object.create(null),t?.skip||n("plugin:webview|create_webview_window",{options:{...t,parent:"string"==typeof t.parent?t.parent:null===(i=t.parent)||void 0===i?void 0:i.label,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static async getByLabel(e){var t;const i=null!==(t=(await M()).find((t=>t.label===e)))&&void 0!==t?t:null;return i?new U(i.label,{skip:!0}):null}static getCurrent(){return function(){const e=I();return new U(e.label,{skip:!0})}()}static async getAll(){return M()}async listen(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:f(e,t,{target:{kind:"WebviewWindow",label:this.label}})}async once(e,t){return this._handleTauriEvent(e,t)?()=>{const i=this.listeners[e];i.splice(i.indexOf(t),1)}:E(e,t,{target:{kind:"WebviewWindow",label:this.label}})}async setBackgroundColor(e){return n("plugin:window|set_background_color",{color:e}).then((()=>n("plugin:webview|set_webview_background_color",{color:e})))}}var G,V;G=U,V=[R,B],(Array.isArray(V)?V:[V]).forEach((e=>{Object.getOwnPropertyNames(e.prototype).forEach((t=>{var i;"object"==typeof G.prototype&&G.prototype&&t in G.prototype||Object.defineProperty(G.prototype,t,null!==(i=Object.getOwnPropertyDescriptor(e.prototype,t))&&void 0!==i?i:Object.create(null))}))}));export{F as window};
@@ -0,0 +1,110 @@
1
+ import { ComponentOptionsMixin } from 'vue';
2
+ import { ComponentProvideOptions } from 'vue';
3
+ import { DefineComponent } from 'vue';
4
+ import { PublicProps } from 'vue';
5
+
6
+ declare const __VLS_component: DefineComponent<WindowTitlebarProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<WindowTitlebarProps> & Readonly<{}>, {
7
+ controlsOrder: "right" | "left" | "platform" | "system";
8
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
9
+
10
+ declare function __VLS_template(): {
11
+ attrs: Partial<{}>;
12
+ slots: {
13
+ default?(_: {}): any;
14
+ default?(_: {}): any;
15
+ };
16
+ refs: {};
17
+ rootEl: HTMLDivElement;
18
+ };
19
+
20
+ declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
21
+
22
+ declare type __VLS_WithTemplateSlots<T, S> = T & {
23
+ new (): {
24
+ $slots: S;
25
+ };
26
+ };
27
+
28
+ export declare const WindowControls: DefineComponent<WindowControlsProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<WindowControlsProps> & Readonly<{}>, {
29
+ hide: boolean;
30
+ hideMethod: "display" | "visibility";
31
+ justify: boolean;
32
+ className: string;
33
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
34
+
35
+ /**
36
+ * Interface for window controls.
37
+ * If the `platform` property is not specified, the library will automatically detect
38
+ * the operating system the app is running on and display the appropriate elements.
39
+ */
40
+ export declare interface WindowControlsProps {
41
+ /**
42
+ * Specifies which platform's window controls to display.
43
+ * It can be one of "windows", "macos", or "gnome".
44
+ * If the `platform` property is not specified, the library will automatically detect
45
+ * the operating system the app is running on and display the appropriate elements.
46
+ */
47
+ platform?: "windows" | "macos" | "gnome";
48
+ /**
49
+ * Indicates whether the window controls should be shown or hidden.
50
+ * @default false
51
+ */
52
+ hide?: boolean;
53
+ /**
54
+ * - "display": "display: none;" making them completely invisible and not taking up any space.
55
+ * - "visibility": "visibility: hidden;" making them invisible but still occupying the same space.
56
+ * @default "display"
57
+ */
58
+ hideMethod?: "display" | "visibility";
59
+ /**
60
+ * Justify/Snap WindowControls
61
+ *
62
+ * @default false, (if not defined in WindowTitlebar automatically assigned)
63
+ */
64
+ justify?: boolean;
65
+ /**
66
+ * Specifies the Linux desktop environment for which the window controls are intended.
67
+ * This property is applicable only when the platform is set to "linux".
68
+ * @default "gnome"
69
+ */
70
+ /**
71
+ * Indicates whether to prevent the right-click context menu.
72
+ * When set to true, it will prevent the default right-click behavior.
73
+ * (only in production, default false)
74
+ */
75
+ /** `data-tauri-drag-region` */
76
+ /**
77
+ * to add custom class to window controls
78
+ */
79
+ className?: string;
80
+ }
81
+
82
+ export declare const WindowTitlebar: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
83
+
84
+ /**
85
+ * Interface for titlebar
86
+ */
87
+ export declare interface WindowTitlebarProps {
88
+ /**
89
+ * The `controlsOrder` property is an optional property used in the `WindowControls` interface.
90
+ * It allows you to specify the order in which the window controls should be rendered relative to the children.
91
+ * (default: system)
92
+ *
93
+ * When `controlsOrder` is not specified or set to `system`, the default behavior will be as follows:
94
+ * - For platforms other than macOS, the controls will be on the right side of the children.
95
+ * - For macOS, the controls will be on the left side of the children (similar to "left" option).
96
+ *
97
+ * Possible values for `controlsOrder`:
98
+ * - "right": The window controls will be rendered to the right of the children.
99
+ * - "left": The window controls will be rendered to the left of the children. This order applies only when the platform is macOS (macOS window controls are usually located on the left side of the title bar).
100
+ * - "platform": for OS-based positioning specified in `windowControlsProps`
101
+ * @default "system"
102
+ */
103
+ controlsOrder?: "right" | "left" | "platform" | "system";
104
+ /**
105
+ * `WindowControls` props
106
+ */
107
+ windowControlsProps?: WindowControlsProps;
108
+ }
109
+
110
+ export { }
@@ -0,0 +1 @@
1
+ import"./tauri-controls.css";import{defineComponent as e,openBlock as t,createElementBlock as n,normalizeClass as o,unref as l,renderSlot as a,mergeProps as s,createElementVNode as r,createCommentVNode as i,ref as c,createVNode as u,withCtx as d,createBlock as C,onMounted as f,nextTick as v,getCurrentInstance as p,getCurrentScope as w,onScopeDispose as h,watch as m,shallowRef as g,computed as b,toValue as k,Fragment as y,normalizeProps as x,guardReactiveProps as _}from"vue";import{twMerge as M}from"tailwind-merge";const L=e({__name:"Button",setup:e=>(e,s)=>(t(),n("button",{class:o(l(M)("inline-flex cursor-default items-center justify-center",e.$attrs.class))},[a(e.$slots,"default")],2))}),V=e({__name:"Icons",props:{icon:{type:String,required:!0}},setup:e=>(o,l)=>(t(),n("div",null,["minimizeWin"===e.icon?(t(),n("svg",s({key:0},o.$attrs,{width:"10",height:"1",viewBox:"0 0 10 1",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),[...l[0]||(l[0]=[r("path",{d:"M0.498047 1.00098C0.429688 1.00098 0.364583 0.987956 0.302734 0.961914C0.244141 0.935872 0.192057 0.900065 0.146484 0.854492C0.100911 0.808919 0.0651042 0.756836 0.0390625 0.698242C0.0130208 0.636393 0 0.571289 0 0.50293C0 0.43457 0.0130208 0.371094 0.0390625 0.3125C0.0651042 0.250651 0.100911 0.19694 0.146484 0.151367C0.192057 0.102539 0.244141 0.0651042 0.302734 0.0390625C0.364583 0.0130208 0.429688 0 0.498047 0H9.50195C9.57031 0 9.63379 0.0130208 9.69238 0.0390625C9.75423 0.0651042 9.80794 0.102539 9.85352 0.151367C9.89909 0.19694 9.9349 0.250651 9.96094 0.3125C9.98698 0.371094 10 0.43457 10 0.50293C10 0.571289 9.98698 0.636393 9.96094 0.698242C9.9349 0.756836 9.89909 0.808919 9.85352 0.854492C9.80794 0.900065 9.75423 0.935872 9.69238 0.961914C9.63379 0.987956 9.57031 1.00098 9.50195 1.00098H0.498047Z",fill:"currentColor","fill-opacity":"0.8956"},null,-1)])],16)):"maximizeWin"===e.icon?(t(),n("svg",s({key:1},o.$attrs,{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),[...l[1]||(l[1]=[r("path",{d:"M1.47461 10.001C1.2793 10.001 1.09212 9.96191 0.913086 9.88379C0.734049 9.80241 0.576172 9.69499 0.439453 9.56152C0.30599 9.4248 0.198568 9.26693 0.117188 9.08789C0.0390625 8.90885 0 8.72168 0 8.52637V1.47559C0 1.28027 0.0390625 1.0931 0.117188 0.914062C0.198568 0.735026 0.30599 0.578776 0.439453 0.445312C0.576172 0.308594 0.734049 0.201172 0.913086 0.123047C1.09212 0.0416667 1.2793 0.000976562 1.47461 0.000976562H8.52539C8.7207 0.000976562 8.90788 0.0416667 9.08691 0.123047C9.26595 0.201172 9.4222 0.308594 9.55566 0.445312C9.69238 0.578776 9.7998 0.735026 9.87793 0.914062C9.95931 1.0931 10 1.28027 10 1.47559V8.52637C10 8.72168 9.95931 8.90885 9.87793 9.08789C9.7998 9.26693 9.69238 9.4248 9.55566 9.56152C9.4222 9.69499 9.26595 9.80241 9.08691 9.88379C8.90788 9.96191 8.7207 10.001 8.52539 10.001H1.47461ZM8.50098 9C8.56934 9 8.63281 8.98698 8.69141 8.96094C8.75326 8.9349 8.80697 8.89909 8.85254 8.85352C8.89811 8.80794 8.93392 8.75586 8.95996 8.69727C8.986 8.63542 8.99902 8.57031 8.99902 8.50195V1.5C8.99902 1.43164 8.986 1.36816 8.95996 1.30957C8.93392 1.24772 8.89811 1.19401 8.85254 1.14844C8.80697 1.10286 8.75326 1.06706 8.69141 1.04102C8.63281 1.01497 8.56934 1.00195 8.50098 1.00195H1.49902C1.43066 1.00195 1.36556 1.01497 1.30371 1.04102C1.24512 1.06706 1.19303 1.10286 1.14746 1.14844C1.10189 1.19401 1.06608 1.24772 1.04004 1.30957C1.014 1.36816 1.00098 1.43164 1.00098 1.5V8.50195C1.00098 8.57031 1.014 8.63542 1.04004 8.69727C1.06608 8.75586 1.10189 8.80794 1.14746 8.85352C1.19303 8.89909 1.24512 8.9349 1.30371 8.96094C1.36556 8.98698 1.43066 9 1.49902 9H8.50098Z",fill:"currentColor","fill-opacity":"0.8956"},null,-1)])],16)):"maximizeRestoreWin"===e.icon?(t(),n("svg",s({key:2},o.$attrs,{width:"10",height:"11",viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),[...l[2]||(l[2]=[r("path",{d:"M8.99902 2.98096C8.99902 2.71077 8.94531 2.45687 8.83789 2.21924C8.73047 1.97835 8.58398 1.77002 8.39844 1.59424C8.21615 1.4152 8.00293 1.27523 7.75879 1.17432C7.5179 1.07015 7.264 1.01807 6.99707 1.01807H2.08496C2.13704 0.868327 2.21029 0.731608 2.30469 0.60791C2.39909 0.484212 2.50814 0.378418 2.63184 0.290527C2.75553 0.202637 2.89062 0.135905 3.03711 0.090332C3.18685 0.0415039 3.34147 0.0170898 3.50098 0.0170898H6.99707C7.41048 0.0170898 7.79948 0.0968424 8.16406 0.256348C8.52865 0.412598 8.84603 0.625814 9.11621 0.895996C9.38965 1.16618 9.60449 1.48356 9.76074 1.84814C9.92025 2.21273 10 2.60173 10 3.01514V6.51611C10 6.67562 9.97559 6.83024 9.92676 6.97998C9.88118 7.12646 9.81445 7.26156 9.72656 7.38525C9.63867 7.50895 9.53288 7.618 9.40918 7.7124C9.28548 7.8068 9.14876 7.88005 8.99902 7.93213V2.98096ZM1.47461 10.0171C1.2793 10.0171 1.09212 9.97803 0.913086 9.8999C0.734049 9.81852 0.576172 9.7111 0.439453 9.57764C0.30599 9.44092 0.198568 9.28304 0.117188 9.104C0.0390625 8.92497 0 8.73779 0 8.54248V3.49365C0 3.29508 0.0390625 3.10791 0.117188 2.93213C0.198568 2.75309 0.30599 2.59684 0.439453 2.46338C0.576172 2.32666 0.732422 2.21924 0.908203 2.14111C1.08724 2.05973 1.27604 2.01904 1.47461 2.01904H6.52344C6.72201 2.01904 6.91081 2.05973 7.08984 2.14111C7.26888 2.21924 7.42513 2.32503 7.55859 2.4585C7.69206 2.59196 7.79785 2.74821 7.87598 2.92725C7.95736 3.10628 7.99805 3.29508 7.99805 3.49365V8.54248C7.99805 8.74105 7.95736 8.92985 7.87598 9.10889C7.79785 9.28467 7.69043 9.44092 7.55371 9.57764C7.42025 9.7111 7.264 9.81852 7.08496 9.8999C6.90918 9.97803 6.72201 10.0171 6.52344 10.0171H1.47461ZM6.49902 9.01611C6.56738 9.01611 6.63086 9.00309 6.68945 8.97705C6.7513 8.95101 6.80501 8.9152 6.85059 8.86963C6.89941 8.82406 6.93685 8.77197 6.96289 8.71338C6.98893 8.65153 7.00195 8.58643 7.00195 8.51807V3.51807C7.00195 3.44971 6.98893 3.3846 6.96289 3.32275C6.93685 3.2609 6.90104 3.20719 6.85547 3.16162C6.8099 3.11605 6.75618 3.08024 6.69434 3.0542C6.63249 3.02816 6.56738 3.01514 6.49902 3.01514H1.49902C1.43066 3.01514 1.36556 3.02816 1.30371 3.0542C1.24512 3.08024 1.19303 3.11768 1.14746 3.1665C1.10189 3.21208 1.06608 3.26579 1.04004 3.32764C1.014 3.38623 1.00098 3.44971 1.00098 3.51807V8.51807C1.00098 8.58643 1.014 8.65153 1.04004 8.71338C1.06608 8.77197 1.10189 8.82406 1.14746 8.86963C1.19303 8.9152 1.24512 8.95101 1.30371 8.97705C1.36556 9.00309 1.43066 9.01611 1.49902 9.01611H6.49902Z",fill:"currentColor","fill-opacity":"0.8956"},null,-1)])],16)):"closeWin"===e.icon?(t(),n("svg",s({key:3},o.$attrs,{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),[...l[3]||(l[3]=[r("path",{d:"M5 5.70898L0.854492 9.85449C0.756836 9.95215 0.639648 10.001 0.50293 10.001C0.359701 10.001 0.239258 9.95378 0.141602 9.85938C0.0472005 9.76172 0 9.64128 0 9.49805C0 9.36133 0.0488281 9.24414 0.146484 9.14648L4.29199 5.00098L0.146484 0.855469C0.0488281 0.757812 0 0.638997 0 0.499023C0 0.430664 0.0130208 0.36556 0.0390625 0.303711C0.0651042 0.241862 0.100911 0.189779 0.146484 0.147461C0.192057 0.101888 0.245768 0.0660807 0.307617 0.0400391C0.369466 0.0139974 0.43457 0.000976562 0.50293 0.000976562C0.639648 0.000976562 0.756836 0.0498047 0.854492 0.147461L5 4.29297L9.14551 0.147461C9.24316 0.0498047 9.36198 0.000976562 9.50195 0.000976562C9.57031 0.000976562 9.63379 0.0139974 9.69238 0.0400391C9.75423 0.0660807 9.80794 0.101888 9.85352 0.147461C9.89909 0.193034 9.9349 0.246745 9.96094 0.308594C9.98698 0.367188 10 0.430664 10 0.499023C10 0.638997 9.95117 0.757812 9.85352 0.855469L5.70801 5.00098L9.85352 9.14648C9.95117 9.24414 10 9.36133 10 9.49805C10 9.56641 9.98698 9.63151 9.96094 9.69336C9.9349 9.75521 9.89909 9.80892 9.85352 9.85449C9.8112 9.90007 9.75911 9.93587 9.69727 9.96191C9.63542 9.98796 9.57031 10.001 9.50195 10.001C9.36198 10.001 9.24316 9.95215 9.14551 9.85449L5 5.70898Z",fill:"currentColor","fill-opacity":"0.8956"},null,-1)])],16)):"closeMac"===e.icon?(t(),n("svg",s({key:4},o.$attrs,{width:"6",height:"6",viewBox:"0 0 16 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),[...l[4]||(l[4]=[r("path",{d:"M15.7522 4.44381L11.1543 9.04165L15.7494 13.6368C16.0898 13.9771 16.078 14.5407 15.724 14.8947L13.8907 16.728C13.5358 17.0829 12.9731 17.0938 12.6328 16.7534L8.03766 12.1583L3.44437 16.7507C3.10402 17.091 2.54132 17.0801 2.18645 16.7253L0.273257 14.8121C-0.0807018 14.4572 -0.0925004 13.8945 0.247845 13.5542L4.84024 8.96087L0.32499 4.44653C-0.0153555 4.10619 -0.00355681 3.54258 0.350402 3.18862L2.18373 1.35529C2.53859 1.00042 3.1013 0.989533 3.44164 1.32988L7.95689 5.84422L12.5556 1.24638C12.8951 0.906035 13.4587 0.917833 13.8126 1.27179L15.7267 3.18589C16.0807 3.53985 16.0925 4.10346 15.7522 4.44381Z",fill:"currentColor"},null,-1)])],16)):"minMac"===e.icon?(t(),n("svg",s({key:5},o.$attrs,{width:"8",height:"8",viewBox:"0 0 17 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),[...l[5]||(l[5]=[r("g",{"clip-path":"url(#clip0_20_2051)"},[r("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1.47211 1.18042H15.4197C15.8052 1.18042 16.1179 1.50551 16.1179 1.90769V3.73242C16.1179 4.13387 15.8052 4.80006 15.4197 4.80006H1.47211C1.08665 4.80006 0.773926 4.47497 0.773926 4.07278V1.90769C0.773926 1.50551 1.08665 1.18042 1.47211 1.18042Z",fill:"currentColor"})],-1)])],16)):"fullMac"===e.icon?(t(),n("svg",s({key:6},o.$attrs,{width:"6",height:"6",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),[...l[6]||(l[6]=[r("g",{"clip-path":"url(#clip0_20_2057)"},[r("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.53068 0.433838L15.0933 12.0409C15.0933 12.0409 15.0658 5.35028 15.0658 4.01784C15.0658 1.32095 14.1813 0.433838 11.5378 0.433838C10.6462 0.433838 3.53068 0.433838 3.53068 0.433838ZM12.4409 15.5378L0.87735 3.93073C0.87735 3.93073 0.905794 10.6214 0.905794 11.9538C0.905794 14.6507 1.79024 15.5378 4.43291 15.5378C5.32535 15.5378 12.4409 15.5378 12.4409 15.5378Z",fill:"currentColor"})],-1)])],16)):"plusMac"===e.icon?(t(),n("svg",s({key:7},o.$attrs,{width:"8",height:"8",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),[...l[7]||(l[7]=[r("g",{"clip-path":"url(#clip0_20_2053)"},[r("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.5308 9.80147H10.3199V15.0095C10.3199 15.3949 9.9941 15.7076 9.59265 15.7076H7.51555C7.11337 15.7076 6.78828 15.3949 6.78828 15.0095V9.80147H1.58319C1.19774 9.80147 0.88501 9.47638 0.88501 9.07419V6.90619C0.88501 6.50401 1.19774 6.17892 1.58319 6.17892H6.78828V1.06183C6.78828 0.676375 7.11337 0.363647 7.51555 0.363647H9.59265C9.9941 0.363647 10.3199 0.676375 10.3199 1.06183V6.17892H15.5308C15.9163 6.17892 16.229 6.50401 16.229 6.90619V9.07419C16.229 9.47638 15.9163 9.80147 15.5308 9.80147Z",fill:"currentColor"})],-1)])],16)):i("",!0)]))}),z=c(null),H=c(!1);typeof window<"u"&&(async()=>{const e=(await import("./index-CRQ_vzBK.js")).window.getCurrentWindow();z.value=e;const t=await e.isMaximized();H.value=t,await e.onResized((async()=>{const t=await e.isMaximized();H.value=t}))})();const W=async()=>{await(z.value?.minimize())},j=async()=>{await(z.value?.toggleMaximize())},O=async()=>{if(z.value){const e=await(z.value?.isFullscreen());await(z.value?.setFullscreen(!e))}},$=async()=>{await(z.value?.close())},B=e({__name:"Gnome",setup:e=>(e,a)=>(t(),n("div",{class:o(l(M)("mr-[10px] h-auto items-center space-x-[13px]",e.$attrs.class))},[u(L,{onClick:l(W),class:"m-0 aspect-square h-6 w-6 cursor-default rounded-full bg-[#dadada] p-0 text-[#3d3d3d] hover:bg-[#d1d1d1] active:bg-[#bfbfbf] dark:bg-[#373737] dark:text-white dark:hover:bg-[#424242] dark:active:bg-[#565656]"},{default:d((()=>[u(V,{icon:"minimizeWin",class:"h-[9px] w-[9px]"})])),_:1},8,["onClick"]),u(L,{onClick:l(j),class:"m-0 aspect-square h-6 w-6 cursor-default rounded-full bg-[#dadada] p-0 text-[#3d3d3d] hover:bg-[#d1d1d1] active:bg-[#bfbfbf] dark:bg-[#373737] dark:text-white dark:hover:bg-[#424242] dark:active:bg-[#565656]"},{default:d((()=>[l(H)?(t(),C(V,{key:0,icon:"maximizeRestoreWin",class:"h-[9px] w-[9px]"})):(t(),C(V,{key:1,icon:"maximizeWin",class:"h-2 w-2"}))])),_:1},8,["onClick"]),u(L,{onClick:l($),class:"m-0 aspect-square h-6 w-6 cursor-default rounded-full bg-[#dadada] p-0 text-[#3d3d3d] hover:bg-[#d1d1d1] active:bg-[#bfbfbf] dark:bg-[#373737] dark:text-white dark:hover:bg-[#424242] dark:active:bg-[#565656]"},{default:d((()=>[u(V,{icon:"closeWin",class:"h-2 w-2"})])),_:1},8,["onClick"])],2))});function R(e){return!!w()&&(h(e),!0)}const E=typeof window<"u"&&typeof document<"u",N=e=>null!=e,P=Object.prototype.toString,Z=e=>"[object Object]"===P.call(e);function A(e){return Array.isArray(e)?e:[e]}const S=E?window:void 0;function T(e){var t;const n=k(e);return null!=(t=n?.$el)?t:n}function X(...e){const t=[],n=()=>{t.forEach((e=>e())),t.length=0},o=b((()=>{const t=A(k(e[0])).filter((e=>null!=e));return t.every((e=>"string"!=typeof e))?t:void 0})),a=(s={flush:"post"},m((()=>{var t,n;return[null!=(n=null==(t=o.value)?void 0:t.map((e=>T(e))))?n:[S].filter((e=>null!=e)),A(k(o.value?e[1]:e[0])),A(l(o.value?e[2]:e[1])),k(o.value?e[3]:e[2])]}),(([e,o,l,a])=>{if(n(),!e?.length||!o?.length||!l?.length)return;const s=Z(a)?{...a}:a;t.push(...e.flatMap((e=>o.flatMap((t=>l.map((n=>{return l=t,a=n,r=s,(o=e).addEventListener(l,a,r),()=>o.removeEventListener(l,a,r);var o,l,a,r})))))))}),{...s,immediate:!0}));var s;return R(n),()=>{a(),n()}}function Y(e){const t=function(){const e=g(!1),t=p();return t&&f((()=>{e.value=!0}),t),e}();return b((()=>(t.value,!!e())))}function q(...e){let t,n,o={};3===e.length?(t=e[0],n=e[1],o=e[2]):2===e.length?"object"==typeof e[1]?(t=!0,n=e[0],o=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:l=S,eventName:a="keydown",passive:s=!1,dedupe:r=!1}=o,i="function"==typeof(c=t)?c:"string"==typeof c?e=>e.key===c:Array.isArray(c)?e=>c.includes(e.key):()=>!0;var c;return X(l,a,(e=>{e.repeat&&k(r)||i(e)&&n(e)}),s)}const F={page:e=>[e.pageX,e.pageY],client:e=>[e.clientX,e.clientY],screen:e=>[e.screenX,e.screenY],movement:e=>e instanceof MouseEvent?[e.movementX,e.movementY]:null};function I(e,t={}){const{windowResize:n=!0,windowScroll:o=!0,handleOutside:l=!0,window:a=S}=t,s=t.type||"page",{x:r,y:i,sourceType:c}=function(e={}){const{type:t="page",touch:n=!0,resetOnTouchEnds:o=!1,initialValue:l={x:0,y:0},window:a=S,target:s=a,scroll:r=!0,eventFilter:i}=e;let c=null,u=0,d=0;const C=g(l.x),f=g(l.y),v=g(null),p="function"==typeof t?t:F[t],w=e=>{const t=p(e);c=e,t&&([C.value,f.value]=t,v.value="mouse"),a&&(u=a.scrollX,d=a.scrollY)},h=e=>{if(e.touches.length>0){const t=p(e.touches[0]);t&&([C.value,f.value]=t,v.value="touch")}},m=()=>{if(!c||!a)return;const e=p(c);c instanceof MouseEvent&&e&&(C.value=e[0]+a.scrollX-u,f.value=e[1]+a.scrollY-d)},b=()=>{C.value=l.x,f.value=l.y},k=i?e=>i((()=>w(e)),{}):e=>w(e),y=i?e=>i((()=>h(e)),{}):e=>h(e),x=i?()=>i((()=>m()),{}):()=>m();if(s){const e={passive:!0};X(s,["mousemove","dragover"],k,e),n&&"movement"!==t&&(X(s,["touchstart","touchmove"],y,e),o&&X(s,"touchend",b,e)),r&&"page"===t&&X(a,"scroll",x,e)}return{x:C,y:f,sourceType:v}}(t),u=g(e??a?.document.body),d=g(0),C=g(0),w=g(0),h=g(0),y=g(0),x=g(0),_=g(!0);function M(){if(!a)return;const e=T(u);if(!(e&&e instanceof Element))return;const{left:t,top:n,width:o,height:c}=e.getBoundingClientRect();w.value=t+("page"===s?a.pageXOffset:0),h.value=n+("page"===s?a.pageYOffset:0),y.value=c,x.value=o;const f=r.value-w.value,v=i.value-h.value;_.value=0===o||0===c||f<0||v<0||f>o||v>c,!l&&_.value||(d.value=f,C.value=v)}const L=[];if(function(e,t=!0,n){p()?f(e,n):t?e():v(e)}((()=>{M()})),a){const{stop:e}=function(e,t,n={}){const{window:o=S,...l}=n;let a;const s=Y((()=>o&&"ResizeObserver"in o)),r=()=>{a&&(a.disconnect(),a=void 0)},i=b((()=>{const t=k(e);return Array.isArray(t)?t.map((e=>T(e))):[T(t)]})),c=m(i,(e=>{if(r(),s.value&&o){a=new ResizeObserver(t);for(const t of e)t&&a.observe(t,l)}}),{immediate:!0,flush:"post"}),u=()=>{r(),c()};return R(u),{isSupported:s,stop:u}}(u,M),{stop:t}=function(e,t,n={}){const{window:o=S,...l}=n;let a;const s=Y((()=>o&&"MutationObserver"in o)),r=()=>{a&&(a.disconnect(),a=void 0)},i=b((()=>{const t=A(k(e)).map(T).filter(N);return new Set(t)})),c=m(i,(e=>{r(),s.value&&e.size&&(a=new MutationObserver(t),e.forEach((e=>a.observe(e,l))))}),{immediate:!0,flush:"post"}),u=()=>{c(),r()};return R(u),{isSupported:s,stop:u,takeRecords:()=>a?.takeRecords()}}(u,M,{attributeFilter:["style","class"]}),l=m([u,r,i],M);L.push(e,t,l),X(document,"mouseleave",(()=>_.value=!0),{passive:!0}),o&&L.push(X("scroll",M,{capture:!0,passive:!0})),n&&L.push(X("resize",M,{passive:!0}))}return{x:r,y:i,sourceType:c,elementX:d,elementY:C,elementPositionX:w,elementPositionY:h,elementHeight:y,elementWidth:x,isOutside:_,stop:function(){L.forEach((e=>e())),L.length=0}}}const D=e({__name:"MacOs",setup(e){const a=c(null),{isOutside:s}=I(a),r=c(!1);return q("Alt",(()=>{r.value=!0}),{eventName:"keydown"}),q("Alt",(()=>{r.value=!1}),{eventName:"keyup"}),(e,c)=>(t(),n("div",{ref_key:"winBtns",ref:a,class:o(l(M)("space-x-2 px-3 text-black active:text-black dark:text-black",e.$attrs.class))},[u(L,{onClick:l($),class:"aspect-square h-3 w-3 content-center items-center justify-center self-center rounded-full border border-black/12 bg-[#ff544d] text-center text-black/60 hover:bg-[#ff544d] active:bg-[#bf403a] active:text-black/60 dark:border-none"},{default:d((()=>[l(s)?i("",!0):(t(),C(V,{key:0,icon:"closeMac"}))])),_:1},8,["onClick"]),u(L,{onClick:l(W),class:"aspect-square h-3 w-3 content-center items-center justify-center self-center rounded-full border border-black/12 bg-[#ffbd2e] text-center text-black/60 hover:bg-[#ffbd2e] active:bg-[#bf9122] active:text-black/60 dark:border-none"},{default:d((()=>[l(s)?i("",!0):(t(),C(V,{key:0,icon:"minMac"}))])),_:1},8,["onClick"]),u(L,{onClick:c[0]||(c[0]=e=>r.value?l(j)():l(O)()),class:"aspect-square h-3 w-3 content-center items-center justify-center self-center rounded-full border border-black/12 bg-[#28c93f] text-center text-black/60 hover:bg-[#28c93f] active:bg-[#1e9930] active:text-black/60 dark:border-none"},{default:d((()=>[l(s)?i("",!0):(t(),n(y,{key:0},[r.value?(t(),C(V,{key:0,icon:"plusMac"})):(t(),C(V,{key:1,icon:"fullMac"}))],64))])),_:1})],2))}}),G=e({__name:"Windows",setup:e=>(e,a)=>(t(),n("div",{class:o(l(M)("h-8",e.$attrs.class))},[u(L,{onClick:l(W),class:"max-h-8 w-[46px] cursor-default rounded-none bg-transparent text-black/90 hover:bg-black/5 active:bg-black/3 dark:text-white dark:hover:bg-white/6 dark:active:bg-white/4"},{default:d((()=>[u(V,{icon:"minimizeWin"})])),_:1},8,["onClick"]),u(L,{onClick:l(j),class:o(l(M)("max-h-8 w-[46px] cursor-default rounded-none bg-transparent","text-black/90 hover:bg-black/5 active:bg-black/3 dark:text-white dark:hover:bg-white/6 dark:active:bg-white/4"))},{default:d((()=>[l(H)?(t(),C(V,{key:0,icon:"maximizeRestoreWin"})):(t(),C(V,{key:1,icon:"maximizeWin"}))])),_:1},8,["onClick","class"]),u(L,{onClick:l($),class:"max-h-8 w-[46px] cursor-default rounded-none bg-transparent text-black/90 hover:bg-[#c42b1c] hover:text-white active:bg-[#c42b1c]/90 dark:text-white"},{default:d((()=>[u(V,{icon:"closeWin"})])),_:1},8,["onClick"])],2))});let U,J=null;function K(){return J||(U?Promise.resolve(U):Promise.resolve("windows"))}typeof window<"u"&&(J=async function(){return async function(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}("plugin:os|os_type")}().then((e=>(U=e,e))));const Q=e({inheritAttrs:!1,__name:"WindowControls",props:{platform:{},hide:{type:Boolean,default:!1},hideMethod:{default:"display"},justify:{type:Boolean,default:!1},className:{default:""}},setup(e){const n=e,a=c(n.platform);f((()=>{K().then((e=>{if(!a.value)switch(e){case"macos":a.value="macos";break;case"linux":a.value="gnome";break;default:a.value="windows"}}))}));const s=M("tauri-controls flex",n.className,n.hide&&("display"===n.hideMethod?"hidden":"invisible"));return(e,r)=>"windows"===a.value?(t(),C(G,{key:0,class:o(l(M)(l(s),n.justify&&"ml-auto"))},null,8,["class"])):"macos"===a.value?(t(),C(D,{key:1,class:o(l(M)(l(s),n.justify&&"ml-0"))},null,8,["class"])):"gnome"===a.value?(t(),C(B,{key:2,class:o(l(M)(l(s),n.justify&&"ml-auto"))},null,8,["class"])):(t(),C(G,{key:3,class:o(l(M)(l(s),n.justify&&"ml-auto"))},null,8,["class"]))}}),ee=e({__name:"WindowTitlebar",props:{controlsOrder:{default:"system"},windowControlsProps:{}},setup(e){const s=e,r=c(void 0);f((()=>{K().then((e=>{r.value=e}))}));const i="left"===s.controlsOrder||"platform"===s.controlsOrder&&"macos"===s.windowControlsProps?.platform||"system"===s.controlsOrder&&"macos"===r.value,d=e=>{if(void 0!==s.windowControlsProps?.justify)return s.windowControlsProps;const{justify:t,className:n,...o}=s.windowControlsProps||{};return{justify:!1,className:M(n,e),...o}};return(e,s)=>(t(),n("div",{class:o(l(M)("tauri-controls bg-background flex flex-row overflow-hidden select-none",e.$attrs.class)),"data-tauri-drag-region":""},[l(i)?(t(),n(y,{key:0},[u(Q,x(_(d("ml-0"))),null,16),a(e.$slots,"default")],64)):(t(),n(y,{key:1},[a(e.$slots,"default"),u(Q,x(_(d("ml-auto"))),null,16)],64))],2))}});export{Q as WindowControls,ee as WindowTitlebar};
package/dist/vue.css ADDED
@@ -0,0 +1 @@
1
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000}}}:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-sky-300:oklch(82.8% .111 230.318);--color-sky-500:oklch(68.5% .169 237.323);--color-sky-600:oklch(58.8% .158 241.966);--color-violet-200:oklch(89.4% .057 293.283);--color-rose-700:oklch(51.4% .222 16.935);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-slate-950:oklch(12.9% .042 264.695);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-semibold:600;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}@layer base{.tauri-controls *,.tauri-controls :after,.tauri-controls :before,.tauri-controls ::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}.tauri-controls ::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}.tauri-controls html,.tauri-controls :host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}.tauri-controls hr{height:0;color:inherit;border-top-width:1px}.tauri-controls abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.tauri-controls h1,.tauri-controls h2,.tauri-controls h3,.tauri-controls h4,.tauri-controls h5,.tauri-controls h6{font-size:inherit;font-weight:inherit}.tauri-controls a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}.tauri-controls b,.tauri-controls strong{font-weight:bolder}.tauri-controls code,.tauri-controls kbd,.tauri-controls samp,.tauri-controls pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}.tauri-controls small{font-size:80%}.tauri-controls sub,.tauri-controls sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}.tauri-controls sub{bottom:-.25em}.tauri-controls sup{top:-.5em}.tauri-controls table{text-indent:0;border-color:inherit;border-collapse:collapse}.tauri-controls :-moz-focusring{outline:auto}.tauri-controls progress{vertical-align:baseline}.tauri-controls summary{display:list-item}.tauri-controls ol,.tauri-controls ul,.tauri-controls menu{list-style:none}.tauri-controls img,.tauri-controls svg,.tauri-controls video,.tauri-controls canvas,.tauri-controls audio,.tauri-controls iframe,.tauri-controls embed,.tauri-controls object{vertical-align:middle;display:block}.tauri-controls img,.tauri-controls video{max-width:100%;height:auto}.tauri-controls button,.tauri-controls input,.tauri-controls select,.tauri-controls optgroup,.tauri-controls textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}.tauri-controls ::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}.tauri-controls :where(select:is([multiple],[size])) optgroup{font-weight:bolder}.tauri-controls :where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}.tauri-controls ::file-selector-button{margin-inline-end:4px}.tauri-controls ::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){.tauri-controls ::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){.tauri-controls ::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}.tauri-controls textarea{resize:vertical}.tauri-controls ::-webkit-search-decoration{-webkit-appearance:none}.tauri-controls ::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}.tauri-controls ::-webkit-datetime-edit{display:inline-flex}.tauri-controls ::-webkit-datetime-edit-fields-wrapper{padding:0}.tauri-controls ::-webkit-datetime-edit{padding-block:0}.tauri-controls ::-webkit-datetime-edit-year-field{padding-block:0}.tauri-controls ::-webkit-datetime-edit-month-field{padding-block:0}.tauri-controls ::-webkit-datetime-edit-day-field{padding-block:0}.tauri-controls ::-webkit-datetime-edit-hour-field{padding-block:0}.tauri-controls ::-webkit-datetime-edit-minute-field{padding-block:0}.tauri-controls ::-webkit-datetime-edit-second-field{padding-block:0}.tauri-controls ::-webkit-datetime-edit-millisecond-field{padding-block:0}.tauri-controls ::-webkit-datetime-edit-meridiem-field{padding-block:0}.tauri-controls ::-webkit-calendar-picker-indicator{line-height:1}.tauri-controls :-moz-ui-invalid{box-shadow:none}.tauri-controls button,.tauri-controls input:where([type=button],[type=reset],[type=submit]){appearance:button}.tauri-controls ::file-selector-button{appearance:button}.tauri-controls ::-webkit-inner-spin-button{height:auto}.tauri-controls ::-webkit-outer-spin-button{height:auto}.tauri-controls [hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.tauri-controls .invisible{visibility:hidden}.tauri-controls .fixed{position:fixed}.tauri-controls .relative{position:relative}.tauri-controls .start{inset-inline-start:var(--spacing)}.tauri-controls .top-1{top:calc(var(--spacing) * 1)}.tauri-controls .right-1{right:calc(var(--spacing) * 1)}.tauri-controls .m-0{margin:calc(var(--spacing) * 0)}.tauri-controls .mr-2{margin-right:calc(var(--spacing) * 2)}.tauri-controls .mr-\[10px\]{margin-right:10px}.tauri-controls .ml-0{margin-left:calc(var(--spacing) * 0)}.tauri-controls .ml-3{margin-left:calc(var(--spacing) * 3)}.tauri-controls .ml-auto{margin-left:auto}.tauri-controls .flex{display:flex}.tauri-controls .hidden{display:none}.tauri-controls .inline-flex{display:inline-flex}.tauri-controls .aspect-square{aspect-ratio:1}.tauri-controls .h-2{height:calc(var(--spacing) * 2)}.tauri-controls .h-3{height:calc(var(--spacing) * 3)}.tauri-controls .h-6{height:calc(var(--spacing) * 6)}.tauri-controls .h-8{height:calc(var(--spacing) * 8)}.tauri-controls .h-10{height:calc(var(--spacing) * 10)}.tauri-controls .h-\[9px\]{height:9px}.tauri-controls .h-auto{height:auto}.tauri-controls .h-full{height:100%}.tauri-controls .h-screen{height:100vh}.tauri-controls .max-h-8{max-height:calc(var(--spacing) * 8)}.tauri-controls .w-2{width:calc(var(--spacing) * 2)}.tauri-controls .w-3{width:calc(var(--spacing) * 3)}.tauri-controls .w-6{width:calc(var(--spacing) * 6)}.tauri-controls .w-\[9px\]{width:9px}.tauri-controls .w-\[46px\]{width:46px}.tauri-controls .w-\[960px\]{width:960px}.tauri-controls .w-fit{width:fit-content}.tauri-controls .w-full{width:100%}.tauri-controls .cursor-default{cursor:default}.tauri-controls .flex-col{flex-direction:column}.tauri-controls .flex-row{flex-direction:row}.tauri-controls .content-center{align-content:center}.tauri-controls .items-center{align-items:center}.tauri-controls .justify-center{justify-content:center}:where(.tauri-controls .space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.tauri-controls .space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}:where(.tauri-controls .space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-x-reverse)))}:where(.tauri-controls .space-x-\[13px\]>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(13px * var(--tw-space-x-reverse));margin-inline-end:calc(13px * calc(1 - var(--tw-space-x-reverse)))}.tauri-controls .self-center{align-self:center}.tauri-controls .overflow-auto{overflow:auto}.tauri-controls .overflow-hidden{overflow:hidden}.tauri-controls .rounded-full{border-radius:3.40282e38px}.tauri-controls .rounded-md{border-radius:var(--radius-md)}.tauri-controls .rounded-none{border-radius:0}.tauri-controls .rounded-sm{border-radius:var(--radius-sm)}.tauri-controls .rounded-xl{border-radius:var(--radius-xl)}.tauri-controls .rounded-t-lg{border-top-left-radius:var(--radius-lg);border-top-right-radius:var(--radius-lg)}.tauri-controls .border{border-style:var(--tw-border-style);border-width:1px}.tauri-controls .border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.tauri-controls .border-dashed{--tw-border-style:dashed;border-style:dashed}.tauri-controls .border-none{--tw-border-style:none;border-style:none}.tauri-controls .border-black\/12{border-color:#0000001f}@supports (color:color-mix(in lab,red,red)){.tauri-controls .border-black\/12{border-color:color-mix(in oklab,var(--color-black) 12%,transparent)}}.tauri-controls .border-slate-400{border-color:var(--color-slate-400)}.tauri-controls .bg-\[\#28c93f\]{background-color:#28c93f}.tauri-controls .bg-\[\#dadada\]{background-color:#dadada}.tauri-controls .bg-\[\#ff544d\]{background-color:#ff544d}.tauri-controls .bg-\[\#ffbd2e\]{background-color:#ffbd2e}.tauri-controls .bg-rose-700{background-color:var(--color-rose-700)}.tauri-controls .bg-sky-500{background-color:var(--color-sky-500)}.tauri-controls .bg-slate-200{background-color:var(--color-slate-200)}.tauri-controls .bg-slate-300{background-color:var(--color-slate-300)}.tauri-controls .bg-transparent{background-color:#0000}.tauri-controls .bg-violet-200\/20{background-color:#ddd6ff33}@supports (color:color-mix(in lab,red,red)){.tauri-controls .bg-violet-200\/20{background-color:color-mix(in oklab,var(--color-violet-200) 20%,transparent)}}.tauri-controls .bg-white{background-color:var(--color-white)}.tauri-controls .p-0{padding:calc(var(--spacing) * 0)}.tauri-controls .p-2{padding:calc(var(--spacing) * 2)}.tauri-controls .p-3{padding:calc(var(--spacing) * 3)}.tauri-controls .px-2{padding-inline:calc(var(--spacing) * 2)}.tauri-controls .px-3{padding-inline:calc(var(--spacing) * 3)}.tauri-controls .px-14{padding-inline:calc(var(--spacing) * 14)}.tauri-controls .py-1{padding-block:calc(var(--spacing) * 1)}.tauri-controls .py-6{padding-block:calc(var(--spacing) * 6)}.tauri-controls .pr-10{padding-right:calc(var(--spacing) * 10)}.tauri-controls .pb-1{padding-bottom:calc(var(--spacing) * 1)}.tauri-controls .text-center{text-align:center}.tauri-controls .font-mono{font-family:var(--font-mono)}.tauri-controls .text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.tauri-controls .font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tauri-controls .whitespace-nowrap{white-space:nowrap}.tauri-controls .text-\[\#3d3d3d\]{color:#3d3d3d}.tauri-controls .text-black{color:var(--color-black)}.tauri-controls .text-black\/60{color:#0009}@supports (color:color-mix(in lab,red,red)){.tauri-controls .text-black\/60{color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.tauri-controls .text-black\/90{color:#000000e6}@supports (color:color-mix(in lab,red,red)){.tauri-controls .text-black\/90{color:color-mix(in oklab,var(--color-black) 90%,transparent)}}.tauri-controls .text-sky-600\/70{color:#0084ccb3}@supports (color:color-mix(in lab,red,red)){.tauri-controls .text-sky-600\/70{color:color-mix(in oklab,var(--color-sky-600) 70%,transparent)}}.tauri-controls .shadow,.tauri-controls .shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.tauri-controls .select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.tauri-controls .hover\:bg-\[\#28c93f\]:hover{background-color:#28c93f}.tauri-controls .hover\:bg-\[\#c42b1c\]:hover{background-color:#c42b1c}.tauri-controls .hover\:bg-\[\#d1d1d1\]:hover{background-color:#d1d1d1}.tauri-controls .hover\:bg-\[\#ff544d\]:hover{background-color:#ff544d}.tauri-controls .hover\:bg-\[\#ffbd2e\]:hover{background-color:#ffbd2e}.tauri-controls .hover\:bg-black\/5:hover{background-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.tauri-controls .hover\:bg-black\/5:hover{background-color:color-mix(in oklab,var(--color-black) 5%,transparent)}}.tauri-controls .hover\:text-white:hover{color:var(--color-white)}}.tauri-controls .active\:bg-\[\#1e9930\]:active{background-color:#1e9930}.tauri-controls .active\:bg-\[\#bf403a\]:active{background-color:#bf403a}.tauri-controls .active\:bg-\[\#bf9122\]:active{background-color:#bf9122}.tauri-controls .active\:bg-\[\#bfbfbf\]:active{background-color:#bfbfbf}.tauri-controls .active\:bg-\[\#c42b1c\]\/90:active{background-color:#c42b1ce6}.tauri-controls .active\:bg-black\/3:active{background-color:#00000008}@supports (color:color-mix(in lab,red,red)){.tauri-controls .active\:bg-black\/3:active{background-color:color-mix(in oklab,var(--color-black) 3%,transparent)}}.tauri-controls .active\:text-black:active{color:var(--color-black)}.tauri-controls .active\:text-black\/60:active{color:#0009}@supports (color:color-mix(in lab,red,red)){.tauri-controls .active\:text-black\/60:active{color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.tauri-controls .dark\:border-none:where(.dark,.dark *){--tw-border-style:none;border-style:none}.tauri-controls .dark\:border-slate-600:where(.dark,.dark *){border-color:var(--color-slate-600)}.tauri-controls .dark\:bg-\[\#373737\]:where(.dark,.dark *){background-color:#373737}.tauri-controls .dark\:bg-slate-800:where(.dark,.dark *){background-color:var(--color-slate-800)}.tauri-controls .dark\:bg-slate-900:where(.dark,.dark *){background-color:var(--color-slate-900)}.tauri-controls .dark\:bg-slate-950\/50:where(.dark,.dark *){background-color:#02061880}@supports (color:color-mix(in lab,red,red)){.tauri-controls .dark\:bg-slate-950\/50:where(.dark,.dark *){background-color:color-mix(in oklab,var(--color-slate-950) 50%,transparent)}}.tauri-controls .dark\:text-black:where(.dark,.dark *){color:var(--color-black)}.tauri-controls .dark\:text-sky-300\/70:where(.dark,.dark *){color:#77d4ffb3}@supports (color:color-mix(in lab,red,red)){.tauri-controls .dark\:text-sky-300\/70:where(.dark,.dark *){color:color-mix(in oklab,var(--color-sky-300) 70%,transparent)}}.tauri-controls .dark\:text-white:where(.dark,.dark *){color:var(--color-white)}@media(hover:hover){.tauri-controls .dark\:hover\:bg-\[\#424242\]:where(.dark,.dark *):hover{background-color:#424242}.tauri-controls .dark\:hover\:bg-white\/6:where(.dark,.dark *):hover{background-color:#ffffff0f}@supports (color:color-mix(in lab,red,red)){.tauri-controls .dark\:hover\:bg-white\/6:where(.dark,.dark *):hover{background-color:color-mix(in oklab,var(--color-white) 6%,transparent)}}}.tauri-controls .dark\:active\:bg-\[\#565656\]:where(.dark,.dark *):active{background-color:#565656}.tauri-controls .dark\:active\:bg-white\/4:where(.dark,.dark *):active{background-color:#ffffff0a}@supports (color:color-mix(in lab,red,red)){.tauri-controls .dark\:active\:bg-white\/4:where(.dark,.dark *):active{background-color:color-mix(in oklab,var(--color-white) 4%,transparent)}}}.tauri-controls button,.tauri-controls input,.tauri-controls optgroup,.tauri-controls select,.tauri-controls textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;appearance:none;cursor:default;background-color:#0000;border:none;border-radius:0;outline:none;margin:0;padding:0}.tauri-controls *{box-sizing:border-box}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@tauri-controls-v2/vue",
3
+ "description": "🚥 Native-looking window controls for Tauri 2.",
4
+ "private": false,
5
+ "version": "0.4.1",
6
+ "type": "module",
7
+ "license": "MIT",
8
+ "scripts": {
9
+ "dev": "vite",
10
+ "build": "vue-tsc --noEmit && vite build",
11
+ "preview": "vite preview",
12
+ "tauri": "tauri",
13
+ "tauri:dev": "tauri dev",
14
+ "lint": "eslint src",
15
+ "format": "prettier --write . --config ./prettier.config.cjs"
16
+ },
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/eatham532/tauri-controls-v2.git"
23
+ },
24
+ "author": "eatham532",
25
+ "bugs": {
26
+ "url": "https://github.com/eatham532/tauri-controls-v2/issues"
27
+ },
28
+ "homepage": "https://github.com/eatham532/tauri-controls-v2#readme",
29
+ "files": [
30
+ "dist"
31
+ ],
32
+ "exports": {
33
+ ".": {
34
+ "import": "./dist/tauri-controls.js",
35
+ "types": "./dist/index.d.ts"
36
+ }
37
+ },
38
+ "module": "./dist/tauri-controls.js",
39
+ "types": "./dist/index.d.ts",
40
+ "dependencies": {
41
+ "@vueuse/core": "^13.0.0"
42
+ },
43
+ "devDependencies": {
44
+ "@eslint/js": "^10.0.1",
45
+ "@rollup/plugin-terser": "^0.4.4",
46
+ "@tailwindcss/vite": "^4.2.0",
47
+ "@tauri-apps/api": "^2.1.0",
48
+ "@tauri-apps/cli": "^2.1.0",
49
+ "@tauri-apps/plugin-os": "^2.1.0",
50
+ "@types/node": "^25.3.0",
51
+ "@vitejs/plugin-vue": "^6.0.4",
52
+ "eslint-config-prettier": "^10.1.8",
53
+ "eslint-plugin-import": "^2.32.0",
54
+ "eslint-plugin-vue": "^10.8.0",
55
+ "postcss": "^8.5.6",
56
+ "prettier-plugin-tailwindcss": "^0.7.2",
57
+ "tailwind-merge": "^3.0.1",
58
+ "tailwindcss": "^4.2.0",
59
+ "typescript": "^5.7.3",
60
+ "typescript-eslint": "^8.56.0",
61
+ "vite": "^7.3.1",
62
+ "vite-plugin-dts": "^4.5.4",
63
+ "vue": "^3.5.13",
64
+ "vue-tsc": "^2.2.0"
65
+ },
66
+ "peerDependencies": {
67
+ "tailwind-merge": "^3.0.1",
68
+ "vue": "^3.5.13"
69
+ }
70
+ }