diff --git a/plugins/ztools-shukuaikuai/.gitignore b/plugins/ztools-shukuaikuai/.gitignore new file mode 100644 index 000000000..9f0234628 --- /dev/null +++ b/plugins/ztools-shukuaikuai/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +dist/ +artifacts/ +*.user diff --git a/plugins/ztools-shukuaikuai/CHANGELOG.md b/plugins/ztools-shukuaikuai/CHANGELOG.md new file mode 100644 index 000000000..0f4812b5d --- /dev/null +++ b/plugins/ztools-shukuaikuai/CHANGELOG.md @@ -0,0 +1,13 @@ +# 更新日志 + +## 0.5.9 - 2026-11-16 + +首次准备公开发布 Windows x64 版本。 + +- 支持双可见轮盘、无边界外圈、扇区直接绑定动作与可调大小。 +- 支持统一自由轨迹录制、多笔手势、匹配反馈和规则管理。 +- 提供五种动作类型、快捷键录入、应用排除与配置导入导出。 +- 重排轮盘、手势和动作库为同屏编辑布局;左下角控制监听。 +- 编辑草稿与运行配置隔离,二次确认在页内显示。 +- 修复外圈选中时异常焦点边线,补齐删除手势的确认,精简页面说明。 +- 使用指定蓝色鼠标图标,并更新宿主入口图标地址以避免旧缓存。 diff --git a/plugins/ztools-shukuaikuai/LICENSE b/plugins/ztools-shukuaikuai/LICENSE new file mode 100644 index 000000000..81f80c538 --- /dev/null +++ b/plugins/ztools-shukuaikuai/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 jiang66-so + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/plugins/ztools-shukuaikuai/MARKET.md b/plugins/ztools-shukuaikuai/MARKET.md new file mode 100644 index 000000000..023bc35cc --- /dev/null +++ b/plugins/ztools-shukuaikuai/MARKET.md @@ -0,0 +1,17 @@ +# 鼠快快 · 商店说明 + +一划一点,快捷随手。 + +将常用操作放到鼠标旁:按住唤起轮盘,移动选择、松开执行;或画下自己习惯的轨迹,直接调用绑定动作。 + +支持两圈可见扇区与轮盘之外的外圈动作,触发鼠标按键与修饰键可自行录入。自由手势支持分笔与试画反馈。动作库覆盖快捷键、应用、文件、网址和文本,配有配置备份、应用排除和暂停开关。 + +平台:Windows x64。请先在常用应用中确认效果;高权限窗口、游戏和受保护桌面存在系统输入限制。 + +源码与问题反馈:https://github.com/jiang66-so/ztools-shukuaikuai + +![轮盘](screenshots/wheel.png) + +![手势](screenshots/gestures.png) + +![动作库](screenshots/actions.png) diff --git a/plugins/ztools-shukuaikuai/README.md b/plugins/ztools-shukuaikuai/README.md new file mode 100644 index 000000000..5de6ebfd9 --- /dev/null +++ b/plugins/ztools-shukuaikuai/README.md @@ -0,0 +1,43 @@ +# 鼠快快 + +**一划一点,快捷随手。** + +Windows x64 的 ZTools 鼠标轮盘与自由手势插件。把快捷键、应用、文件、网址和固定文本绑定到轮盘扇区或自己绘制的轨迹。 + +## 安装与使用 + +从 [GitHub Releases](https://github.com/jiang66-so/ztools-shukuaikuai/releases) 下载 ZIP,在 ZTools 中导入插件包。商店提交审核通过后,也可从插件中心搜索“鼠快快”。当前版本:0.5.9。 + +在 ZTools 搜索“鼠快快”打开设置。轮盘默认使用鼠标中键,手势默认使用右键;两者的触发按键、Ctrl / Alt / Shift 组合均可修改或直接录入。左下角开关暂停或恢复监听。 + +- **轮盘**:点击预览扇区选择动作。支持两个可见圈层;外圈指可见轮盘之外的无限区域,可统一执行一个动作或按方向绑定。选择方案后保存即可启用该方案。实际轮盘大小可设置为 200—600 px,并随 Windows 显示缩放。 +- **手势**:自由绘制轨迹,填写名称、绑定动作并添加。支持最多 8 笔;试画显示与已保存手势的匹配结果。已有手势列表可修改、替换轨迹、启停或删除。 +- **动作库**:支持键盘快捷键、打开应用、文件或目录、HTTP/HTTPS 网址及输入固定文本。快捷键支持录入;共用动作修改会同步影响引用它的轮盘和手势。 +- **设置**:排除特定应用、导入导出配置。编辑只修改草稿,原配置继续运行;点击底部“保存设置”后生效。Esc 可取消当前轮盘或手势。 + +![轮盘与动作](screenshots/wheel.png) + +![手势设置](screenshots/gestures.png) + +## 数据与兼容性 + +配置保存在 ZTools userData 下的 `shukuaikuai/config.json`,原配置有 `.bak` 备份;暂停状态单独存入 `runtime.json`。插件不需要账号,不主动联网;打开网址动作交给系统浏览器。导出配置会包含你填写的文本、网址和路径,请按需要保管。 + +仅支持 Windows x64。原生服务使用 Win32 鼠标钩子、透明绘制窗口和系统模拟输入;运行包不需要安装 Node.js 或 .NET SDK。高权限应用、受保护桌面以及部分游戏可能拒绝模拟输入,复杂轨迹和多屏缩放效果仍取决于实际环境。可通过应用排除避免接管特定程序的鼠标操作。 + +## 从源码构建 + +需要 Windows x64、Node.js 20 或以上,以及系统 .NET Framework 4.x 的 C# 编译器(Windows 常见环境已提供)。 + +```powershell +npm ci +npm run package +``` + +运行目录为 `dist/plugin`,安装包输出到 `artifacts/鼠快快-0.5.9.zip`。`npm test` 提供纯逻辑检查。日常修改默认只验证直接相关内容,完整回归按需执行。 + +源码包含可读的 preload 与 C# 服务实现;构建时生成原生服务,无需从外部下载可执行文件。项目发布快照不包含个人配置、日常宿主数据库、临时安装工具或本机测试 profile。 + +## 许可 + +[MIT](LICENSE)。Vue 的许可保留在 `public/THIRD_PARTY_NOTICES.txt` 中。 diff --git a/plugins/ztools-shukuaikuai/index.html b/plugins/ztools-shukuaikuai/index.html new file mode 100644 index 000000000..25008fd69 --- /dev/null +++ b/plugins/ztools-shukuaikuai/index.html @@ -0,0 +1 @@ +鼠快快
diff --git a/plugins/ztools-shukuaikuai/native/MouseService.cs b/plugins/ztools-shukuaikuai/native/MouseService.cs new file mode 100644 index 000000000..289f1e712 --- /dev/null +++ b/plugins/ztools-shukuaikuai/native/MouseService.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; +using System.Web.Script.Serialization; +using System.Windows.Forms; + +static class Native { + public static bool Integration=false; public static UIntPtr Marker=new UIntPtr(0x534B4B); + public delegate IntPtr Hook(int code,IntPtr wp,IntPtr lp); + [StructLayout(LayoutKind.Sequential)] public struct Pt {public int x,y; public Pt(int a,int b){x=a;y=b;}} + [StructLayout(LayoutKind.Sequential)] public struct Mouse {public Pt pt;public uint data,flags,time;public UIntPtr extra;} + [StructLayout(LayoutKind.Sequential)] public struct Input {public uint type;public Union u;} + [StructLayout(LayoutKind.Explicit)] public struct Union {[FieldOffset(0)]public MI mi;[FieldOffset(0)]public KI ki;} + [StructLayout(LayoutKind.Sequential)] public struct MI {public int dx,dy;public uint data,flags,time;public UIntPtr extra;} + [StructLayout(LayoutKind.Sequential)] public struct KI {public ushort vk,scan;public uint flags,time;public UIntPtr extra;} + [DllImport("user32.dll")]public static extern IntPtr SetWindowsHookEx(int id,Hook cb,IntPtr mod,uint thread); + [DllImport("user32.dll")]public static extern bool UnhookWindowsHookEx(IntPtr h); + [DllImport("user32.dll")]public static extern IntPtr CallNextHookEx(IntPtr h,int n,IntPtr w,IntPtr l); + [DllImport("kernel32.dll",CharSet=CharSet.Auto)]public static extern IntPtr GetModuleHandle(string name); + [DllImport("user32.dll")]public static extern short GetAsyncKeyState(int key); + [DllImport("user32.dll")]public static extern IntPtr GetForegroundWindow(); + [DllImport("user32.dll")]public static extern bool SetForegroundWindow(IntPtr h); + [DllImport("user32.dll")]public static extern bool IsWindow(IntPtr h); + [DllImport("user32.dll")]public static extern uint GetWindowThreadProcessId(IntPtr h,out uint pid); + [DllImport("user32.dll")]public static extern uint SendInput(uint n,Input[] inputs,int size); + [DllImport("user32.dll")]public static extern bool GetCursorPos(out Pt p); + [DllImport("user32.dll")]public static extern bool SetProcessDPIAware(); + public static bool Down(int key){return (GetAsyncKeyState(key)&0x8000)!=0;} + public static void Key(ushort key,bool up){var i=new Input();i.type=1;i.u.ki=new KI{vk=key,flags=(uint)(up?2:0),extra=Marker};if(key>=33&&key<=46)i.u.ki.flags|=1;Send(new Input[]{i});} + public static void Send(Input[] inputs){if(SendInput((uint)inputs.Length,inputs,Marshal.SizeOf(typeof(Input)))!=inputs.Length)throw new Exception("系统拒绝输入,请检查目标权限");} + public static void Click(string button){uint dn=0x20,up=0x40,data=0;if(button=="right"){dn=8;up=16;}if(button=="x1"||button=="x2"){dn=0x80;up=0x100;data=(uint)(button=="x1"?1:2);}var a=new Input();a.u.mi=new MI{flags=dn,data=data,extra=Marker};var b=new Input();b.u.mi=new MI{flags=up,data=data,extra=Marker};Send(new Input[]{a,b});} +} + +static class Data { + public static JavaScriptSerializer Json=new JavaScriptSerializer(); + public static Dictionary Obj(object x){return (Dictionary)x;} + public static object[] Arr(object x){return x is object[]?(object[])x:((ArrayList)x).ToArray();} + public static string S(Dictionary x,string k,string fallback=""){return x.ContainsKey(k)?Convert.ToString(x[k]):fallback;} + public static bool B(Dictionary x,string k){return x.ContainsKey(k)&&Convert.ToBoolean(x[k]);} + public static int N(Dictionary x,string k){return Convert.ToInt32(x[k]);} + public static string Recognize(List pts,int min,int tolerance){if(pts.Count<2)return "";Point anchor=pts[0];string s="";bool uncertain=false;foreach(var p in pts.GetRange(1,pts.Count-1)){double x=p.X-anchor.X,y=p.Y-anchor.Y;if(Math.Sqrt((double)x*x+(double)y*y)4)return "";anchor=p;}return uncertain?"":s;} + public static int WheelHit(int x,int y,int radius,int center,int innerCount,bool second,int secondCount,bool bounded,bool outside=false,int outsideCount=1,bool singleOutside=true){double distance=Math.Sqrt((double)x*x+(double)y*y);if(distance<=center)return -1;if(distance>radius)return outside?innerCount+(second?secondCount:0)+(singleOutside?0:Hit(x,y,outsideCount,center)):-1;bool ring2=second&&distance>=center+(radius-center)*.5;int index=Hit(x,y,ring2?secondCount:innerCount,center);return ring2?innerCount+index:index;} + public static int Hit(int x,int y,int count,int center,int outer=int.MaxValue){if(Math.Sqrt((double)x*x+(double)y*y)<=center||Math.Sqrt((double)x*x+(double)y*y)>outer)return -1;double tau=Math.PI*2;return (int)Math.Floor(((Math.Atan2(y,x)+Math.PI/2+Math.PI/count+tau)%tau)/(tau/count))%count;} +} + +class Service:ApplicationContext { + public Dictionary config,gesture,wheel; + public string state="idle",button="",cancelButtonUp="";public List points=new List();public Point center,current,start;public int selected=-1;public float dpi=1; + bool settingsVisible;uint settingsHostPid;bool dryRun=false;bool paused=true,suppressLeftUp=false,suppressTriggerUp=false;IntPtr target;uint targetPid;DateTime began;IntPtr hook;Native.Hook callback;OverlayPump overlay;WheelVisual visual;bool renderDirty;double strokeTravel;bool waitForRelease=true,actionFromGesture;int recognitionToken;DateTime strokeDeadline;List> strokes=new List>();List templates=new List();long hookCalls;double maxHookMs;System.Windows.Forms.Timer timer;Form dispatcher;string pendingAction="";DateTime executeAt; + public Service(){dispatcher=new Form();var handle=dispatcher.Handle;overlay=new OverlayPump();callback=MouseHook;hook=Native.SetWindowsHookEx(14,callback,Native.GetModuleHandle(null),0);if(hook==IntPtr.Zero)throw new Exception("无法注册鼠标监听");timer=new System.Windows.Forms.Timer();timer.Interval=16;timer.Tick+=(a,b)=>Tick();timer.Start();var reader=new Thread(Read);reader.IsBackground=true;reader.Start();Emit("ready","监听器已就绪,当前暂停");} + public int Scale(int n){return (int)Math.Round(n*dpi);} + void Read(){try{string line;while((line=Console.ReadLine())!=null){string message=line;dispatcher.BeginInvoke((Action)(()=>Command(message)));}}catch{}try{dispatcher.BeginInvoke((Action)(()=>ExitThread()));}catch{}} + void Command(string line){try{var msg=Data.Obj(Data.Json.DeserializeObject(line));string op=Data.S(msg,"op");if(op=="configure"){Cancel();config=Data.Obj(msg["config"]);settingsVisible=Data.B(msg,"settingsVisible");settingsHostPid=msg.ContainsKey("hostPid")?Convert.ToUInt32(msg["hostPid"]):0;dryRun=Native.Integration&&Data.B(msg,"dryRun");gesture=Data.Obj(config["gesture"]);templates=ShapeRecognizer.Compile(config);paused=Data.B(msg,"paused");Emit("status",paused?"已暂停":"运行中");}else if(op=="settings-visible"){settingsVisible=Data.B(msg,"value");settingsHostPid=msg.ContainsKey("hostPid")?Convert.ToUInt32(msg["hostPid"]):0;}else if(op=="pause"){Cancel();paused=Data.B(msg,"value");Emit("status",paused?"已暂停":"运行中");}else if(op=="stop")ExitThread();else if(op=="test"){Cancel();target=Native.GetForegroundWindow();Native.GetWindowThreadProcessId(target,out targetPid);Queue(Data.S(msg,"id"));}else if(op=="probe")Emit("probe",Data.Json.Serialize(new {state=state,selected=selected,paused=paused,settingsVisible=settingsVisible,wheelSize=wheel==null?0:Data.N(wheel,"size"),visualRadius=visual==null?0:visual.Radius,dpi=dpi,centerX=center.X,centerY=center.Y,hookCalls=hookCalls,maxHookMs=maxHookMs,paints=overlay.Paints,maxPaintMs=overlay.MaxPaintMs}));else if(op=="event"&&Native.Integration){var m=new Native.Mouse{pt=new Native.Pt(Data.N(msg,"x"),Data.N(msg,"y")),flags=0x80000000};var ptr=Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Native.Mouse)));try{Marshal.StructureToPtr(m,ptr,false);var handled=MouseHook(0,new IntPtr(Data.N(msg,"event")),ptr);Emit("event",handled==IntPtr.Zero?"pass":"handled");}finally{Marshal.FreeHGlobal(ptr);}}}catch(Exception ex){paused=true;Cancel();Emit("error",ex.Message);}} + void Publish(){renderDirty=false;if(state=="wheel"){if(visual==null){visual=new WheelVisual{Radius=Scale(Data.N(wheel,"size"))/2,Center=Scale(Data.N(wheel,"center")),InnerCount=Data.N(wheel,"count"),Second=Data.B(wheel,"secondEnabled"),Outside=Data.B(wheel,"outsideEnabled"),Color=ColorTranslator.FromHtml(Data.S(wheel,"color")),Opacity=Data.N(wheel,"opacity")/100.0};visual.SecondCount=visual.Second?Data.N(wheel,"secondCount"):0;visual.OutsideCount=visual.Outside?(Data.S(wheel,"outsideMode")=="single"?1:Data.N(wheel,"outsideCount")):0;var names=new List();foreach(string ring in visual.Second?new string[]{"slots","secondSlots"}:new string[]{"slots"})foreach(var x in Data.Arr(wheel[ring])){var a=Action(Convert.ToString(x));names.Add(a==null?"+":Data.B(wheel,"labels")?(Data.S(a,"icon")+" "+Data.S(a,"name")).Trim():(names.Count+1).ToString());}if(visual.Outside){var values=Data.S(wheel,"outsideMode")=="single"?new object[]{Data.S(wheel,"outsideActionId")}:Data.Arr(wheel["outsideSlots"]);foreach(var x in values){var a=Action(Convert.ToString(x));names.Add(a==null?"未配置":Data.S(a,"name"));}}visual.Labels=names.ToArray();}overlay.Submit(new RenderFrame{Kind="wheel",Center=center,Cursor=current,Dpi=dpi,Selected=selected,Wheel=visual});}else if(state=="gesture"){string p=Pattern();var rule=Rule(p);overlay.Submit(new RenderFrame{Kind="gesture",Points=AllPoints(),Strokes=SnapshotStrokes(),Cursor=current,Dpi=dpi,Trail=Data.B(gesture,"trail"),Color=ColorTranslator.FromHtml(Data.S(gesture,"color")),Width=Scale(Data.N(gesture,"width")),Hint=templates.Count>0?"绘制中 · 松开完成":p+" "+(rule==null?"未匹配":Data.S(rule,"name"))});}else overlay.Clear();} + Point[][] SnapshotStrokes(){var result=new Point[strokes.Count][];for(int i=0;i();foreach(var stroke in strokes)all.AddRange(stroke);return all.ToArray();} + void Recognize(bool final){var snapshot=SnapshotStrokes();var library=templates;int token=++recognitionToken;state="recognizing";double threshold=gesture.ContainsKey("shapeThreshold")?Convert.ToDouble(gesture["shapeThreshold"]):.75;ThreadPool.QueueUserWorkItem(_=>{var ranking=ShapeRecognizer.Rank(snapshot,library);var best=ranking.Count>0?ranking[0]:null;var match=best!=null&&best.Score>=threshold?best.Template:null;try{dispatcher.BeginInvoke((Action)(()=>{if(token!=recognitionToken||state!="recognizing")return;if(match!=null){Emit("recognized",match.Id);Queue(match.ActionId,true,true);return;}if(snapshot.Length==1){var rule=Rule(Pattern());if(rule!=null){Queue(Data.S(rule,"actionId"),true,true);return;}}string hint=best==null?"没有已保存的手势,请先录制并保存":"未匹配 · 最接近 "+best.Template.Name+" "+Math.Round(best.Score*100)+"%";Cancel();overlay.Submit(new RenderFrame{Kind="feedback",Cursor=current,Dpi=dpi,Hint=hint});Emit("unmatched",hint);}));}catch{}});} + public void Emit(string kind,string message){Console.WriteLine(Data.Json.Serialize(new {kind=kind,message=message,state=state,paused=paused}));Console.Out.Flush();} + public Dictionary Action(string id){if(config==null)return null;foreach(var x in Data.Arr(config["actions"])){var a=Data.Obj(x);if(Data.S(a,"id")==id)return a;}return null;} + public Dictionary Rule(string pattern){if(config==null||pattern=="")return null;foreach(var x in Data.Arr(config["gestures"])){var r=Data.Obj(x);if(Data.B(r,"enabled")&&Data.S(r,"kind")!="shape"&&Data.S(r,"pattern")==pattern)return r;}return null;} + public string Pattern(){return Data.Recognize(points,Scale(Data.N(gesture,"min")),Data.N(gesture,"tolerance"));} + bool Match(Dictionary t,string b){if(Data.S(t,"button")!=b)return false;var mods=Data.Arr(t["modifiers"]);return Native.Down(17)==Array.Exists(mods,x=>Convert.ToString(x)=="Ctrl")&&Native.Down(18)==Array.Exists(mods,x=>Convert.ToString(x)=="Alt")&&Native.Down(16)==Array.Exists(mods,x=>Convert.ToString(x)=="Shift")&&!Native.Down(91)&&!Native.Down(92);} + bool Excluded(){try{uint pid;Native.GetWindowThreadProcessId(Native.GetForegroundWindow(),out pid);if(settingsVisible&&settingsHostPid!=0&&pid==settingsHostPid)return true;string name=Process.GetProcessById((int)pid).ProcessName;if(settingsVisible&&settingsHostPid==0&&name.Equals("ZTools",StringComparison.OrdinalIgnoreCase))return true;foreach(var x in Data.Arr(config["excluded"]))if(string.Equals(System.IO.Path.GetFileNameWithoutExtension(Convert.ToString(x)),name,StringComparison.OrdinalIgnoreCase))return true;return pid==Process.GetCurrentProcess().Id;}catch{return true;}} + IntPtr MouseHook(int code,IntPtr wp,IntPtr lp){long began=Stopwatch.GetTimestamp();try{return ProcessMouse(code,wp,lp);}finally{hookCalls++;maxHookMs=Math.Max(maxHookMs,(Stopwatch.GetTimestamp()-began)*1000.0/Stopwatch.Frequency);}} + IntPtr ProcessMouse(int code,IntPtr wp,IntPtr lp){if(code<0)return Native.CallNextHookEx(hook,code,wp,lp);try{var m=(Native.Mouse)Marshal.PtrToStructure(lp,typeof(Native.Mouse));if(m.extra==Native.Marker||(Native.Integration?m.flags!=0x80000000:(m.flags&1)!=0))return Native.CallNextHookEx(hook,code,wp,lp);int ev=wp.ToInt32();bool down=ev==0x204||ev==0x207||ev==0x20B,up=ev==0x205||ev==0x208||ev==0x20C;string b=ev==0x204||ev==0x205?"right":ev==0x207||ev==0x208?"middle":((m.data>>16)==1?"x1":"x2");current=new Point(m.pt.x,m.pt.y); + if(up&&b==cancelButtonUp){cancelButtonUp="";return (IntPtr)1;}if(suppressLeftUp&&ev==0x202){suppressLeftUp=false;return (IntPtr)1;}if(suppressTriggerUp&&up&&b==button){suppressTriggerUp=false;return (IntPtr)1;} + if(paused||config==null)return Native.CallNextHookEx(hook,code,wp,lp); + if(state=="recognizing"){if(down&&b==button&&Match(gesture,b)&&strokes.Count<8){recognitionToken++;points=new List{current};strokes.Add(points);began=DateTime.UtcNow;state="gesture";renderDirty=true;return (IntPtr)1;}if(down||ev==0x201)Cancel();return Native.CallNextHookEx(hook,code,wp,lp);}if(state=="awaiting-stroke"){if(down&&b==button&&Match(gesture,b)&&strokes.Count<8){points=new List{current};strokes.Add(points);began=DateTime.UtcNow;state="gesture";renderDirty=true;return (IntPtr)1;}if(down||ev==0x201)Cancel();return Native.CallNextHookEx(hook,code,wp,lp);} + if(state=="executing")return Native.CallNextHookEx(hook,code,wp,lp); + if(state=="wheel"&&Data.S(wheel,"mode")=="click"){if(ev==0x201){suppressLeftUp=true;FinishWheel();return (IntPtr)1;}if(down){cancelButtonUp=b;Cancel();return (IntPtr)1;}if(up&&b==button)return (IntPtr)1;} + if(state!="idle"){ + if(ev==0x200){if(wheel==null&&(points.Count==0||Distance(points[points.Count-1],current)>=2)){if(points.Count>=2048){var reduced=new List();for(int i=0;i0)strokeTravel+=Distance(points[points.Count-1],current);points.Add(current);renderDirty=true;}if(state=="pending"&&wheel==null&&(Distance(start,current)>=Scale(Data.N(gesture,"min"))||strokeTravel>=Scale(Data.N(gesture,"min"))&&PointSpan()>=Scale(8))){state="gesture";renderDirty=true;}if(state=="wheel"){int previous=selected;Select();if(selected!=previous){renderDirty=true;int outsideBase=Data.N(wheel,"count")+(Data.B(wheel,"secondEnabled")?Data.N(wheel,"secondCount"):0);if(Data.B(wheel,"outsideEnabled")&&selected>=outsideBase&&Data.S(wheel,"outsideTrigger")=="enter"){suppressTriggerUp=Native.Down(ButtonVk());Queue(SelectedAction(),false);}}}} + if(up&&b==button){if(state=="pending"){string original=button;Cancel();Native.Click(original);}else if(state=="gesture"){if(points.Count<2)points.Add(current);if(strokes.Count>=8)Recognize(true);else{state="awaiting-stroke";strokeDeadline=DateTime.UtcNow.AddMilliseconds(gesture.ContainsKey("strokeWindow")?Data.N(gesture,"strokeWindow"):350);}}else if(state=="wheel"&&Data.S(wheel,"mode")=="hold")FinishWheel();return (IntPtr)1;} + if(down&&b==button)return (IntPtr)1;return Native.CallNextHookEx(hook,code,wp,lp); + } + if(down){ + wheel=null;if(Data.B(config,"wheelEnabled"))foreach(var x in Data.Arr(config["wheels"])){var w=Data.Obj(x);if(Data.B(w,"enabled")&&Match(w,b)){wheel=w;break;}} + bool g=Data.B(config,"gestureEnabled")&&Match(gesture,b);if((wheel!=null||g)&&(Native.Integration||!Excluded())){target=Native.GetForegroundWindow();Native.GetWindowThreadProcessId(target,out targetPid);button=b;start=current;center=current;strokeTravel=0;points=new List{start};strokes=new List>{points};began=DateTime.UtcNow;state="pending";selected=-1;visual=null;dpi=ScreenDpi(current);return (IntPtr)1;} + } + }catch(Exception ex){Cancel();Emit("error",ex.Message);}return Native.CallNextHookEx(hook,code,wp,lp);} + double PointSpan(){int left=start.X,right=start.X,top=start.Y,bottom=start.Y;foreach(var p in points){left=Math.Min(left,p.X);right=Math.Max(right,p.X);top=Math.Min(top,p.Y);bottom=Math.Max(bottom,p.Y);}return Math.Max(right-left,bottom-top);} + double Distance(Point a,Point b){double x=a.X-b.X,y=a.Y-b.Y;return Math.Sqrt((double)x*x+(double)y*y);} + [DllImport("shcore.dll")]static extern int GetDpiForMonitor(IntPtr monitor,int type,out uint x,out uint y); + [DllImport("user32.dll")]static extern IntPtr MonitorFromPoint(Native.Pt p,uint flags); + float ScreenDpi(Point p){try{uint x,y;GetDpiForMonitor(MonitorFromPoint(new Native.Pt(p.X,p.Y),2),0,out x,out y);return x/96f;}catch{return 1;}} + void Tick(){try{if(renderDirty)Publish();if(state=="idle")return;if(Native.Down(27)){suppressTriggerUp=state!="executing"&&Native.Down(ButtonVk());Cancel();return;}if(state=="awaiting-stroke"){if(Native.Down(27)){Cancel();return;}if(DateTime.UtcNow>=strokeDeadline)Recognize(true);return;}if(state=="recognizing")return;if(Native.Down(27)){suppressTriggerUp=state!="executing"&&(Native.Down(ButtonVk()));Cancel();return;}if(state=="executing"){if(DateTime.UtcNow>executeAt.AddSeconds(10)){Cancel();Emit("error","触发键尚未释放,动作已取消");return;}if(DateTime.UtcNow>=executeAt&&CanExecutePending())Execute();return;} + if(wheel!=null&&state=="pending"&&(DateTime.UtcNow-began).TotalMilliseconds>=Data.N(wheel,"delay")){var area=Screen.FromPoint(start).WorkingArea;int r=Scale(Data.N(wheel,"size"))/2;center=new Point(Math.Max(area.Left+r,Math.Min(area.Right-r,start.X)),Math.Max(area.Top+r,Math.Min(area.Bottom-r,start.Y)));state="wheel";selected=-1;Publish();} + if(wheel==null&&(DateTime.UtcNow-began).TotalMilliseconds>Data.N(gesture,"timeout")){suppressTriggerUp=Native.Down(ButtonVk());Cancel();overlay.Submit(new RenderFrame{Kind="feedback",Cursor=current,Dpi=dpi,Hint="绘制超时,可在设置中延长绘制时间"});} + }catch(Exception ex){Cancel();Emit("error",ex.Message);}} + bool CanExecutePending(){if(dryRun)return true;if(waitForRelease&&Native.Down(ButtonVk()))return false;var action=Action(pendingAction);string type=action==null?"":Data.S(action,"type");return type!="key"&&type!="text"||!AnyModifier();} + int ButtonVk(){return button=="right"?2:button=="middle"?4:button=="x1"?5:6;} + bool AnyModifier(){return Native.Down(16)||Native.Down(17)||Native.Down(18)||Native.Down(91)||Native.Down(92);} + void Select(){if(Distance(start,current)Scale(Data.N(wheel,"center"))){selected=-1;return;}selected=Data.WheelHit(current.X-center.X,current.Y-center.Y,Scale(Data.N(wheel,"size"))/2,Scale(Data.N(wheel,"center")),Data.N(wheel,"count"),Data.B(wheel,"secondEnabled"),Data.B(wheel,"secondEnabled")?Data.N(wheel,"secondCount"):0,Data.S(wheel,"mode")=="click",Data.B(wheel,"outsideEnabled"),Data.B(wheel,"outsideEnabled")?Data.N(wheel,"outsideCount"):1,Data.S(wheel,"outsideMode")=="single");} + string SelectedAction(){if(selected<0)return "";int count=Data.N(wheel,"count");if(selected=1&&n<=24)return (ushort)(111+n);var map=new Dictionary{{"LEFT",37},{"RIGHT",39},{"UP",38},{"DOWN",40},{"ENTER",13},{"TAB",9},{"SPACE",32},{"BACKSPACE",8},{"DELETE",46},{"HOME",36},{"END",35},{"PAGEUP",33},{"PAGEDOWN",34},{"ESCAPE",27}};return map[s];} + static void Hotkey(string value){var pressed=new List();try{foreach(string key in value.Split('+')){ushort vk=Vk(key);Native.Key(vk,false);pressed.Add(vk);}}finally{pressed.Reverse();foreach(var vk in pressed)Native.Key(vk,true);}} + static void UnicodeText(string value){foreach(char c in value){if(c=='\r')continue;if(c=='\n'){Native.Key(13,false);Native.Key(13,true);continue;}var a=new Native.Input();a.type=1;a.u.ki=new Native.KI{scan=c,flags=4,extra=Native.Marker};var b=a;b.u.ki.flags=6;Native.Send(new Native.Input[]{a,b});}} + protected override void ExitThreadCore(){timer.Stop();Native.UnhookWindowsHookEx(hook);overlay.Dispose();dispatcher.Dispose();base.ExitThreadCore();} +} + +static class Program { + [DllImport("user32.dll")]static extern bool SetProcessDpiAwarenessContext(IntPtr context); + [STAThread]static void Main(string[] args){Console.InputEncoding=Encoding.UTF8;Console.OutputEncoding=new UTF8Encoding(false);if(args.Length>0&&args[0]=="--self-test"){if(Data.Recognize(new List{new Point(0,0),new Point(50,0),new Point(90,0),new Point(90,60)},24,30)!="RD")Environment.Exit(1);if(Data.Hit(0,-80,8,36)!=0||Data.Hit(80,0,8,36)!=2||Data.Hit(0,0,8,36)!=-1)Environment.Exit(2);if(Data.Hit(500,0,8,36,140)!=-1)Environment.Exit(3);if(Data.WheelHit(0,-65,180,36,8,true,12,false)!=0||Data.WheelHit(0,-150,180,36,8,true,12,false)!=8||Data.WheelHit(0,-300,180,36,8,true,12,true)!=-1)Environment.Exit(4);if(Data.Recognize(new List{new Point(0,0),new Point(50,0),new Point(60,10),new Point(70,30),new Point(70,70)},24,30)!="RD")Environment.Exit(5);Console.WriteLine("native geometry, rounded gestures and dual rings OK");return;}if(args.Length>1&&args[0]=="--render-preview"){var visual=new WheelVisual{Radius=180,Center=42,InnerCount=8,Second=true,SecondCount=8,Outside=true,OutsideCount=1,Color=ColorTranslator.FromHtml("#208b91"),Opacity=1,Labels=new string[]{"复制","粘贴","剪切","全选","撤销","保存","查找","关闭","浏览器","文件夹","搜索","截图","设置","笔记","终端","刷新","外圈动作"}};var frame=new RenderFrame{Kind="wheel",Center=new Point(200,200),Dpi=1,Selected=2,Wheel=visual};using(var bitmap=new Bitmap(400,400,System.Drawing.Imaging.PixelFormat.Format32bppPArgb))using(var g=Graphics.FromImage(bitmap))using(var font=new Font("Microsoft YaHei UI",11,FontStyle.Regular,GraphicsUnit.Pixel))using(var small=new Font("Microsoft YaHei UI",10,FontStyle.Regular,GraphicsUnit.Pixel)){g.Clear(Color.Transparent);g.SmoothingMode=SmoothingMode.AntiAlias;g.TextRenderingHint=System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;WheelPainter.Draw(g,frame,font,small);bitmap.Save(args[1],System.Drawing.Imaging.ImageFormat.Png);}return;}Native.Integration=Array.IndexOf(args,"--integration")>=0;try{SetProcessDpiAwarenessContext(new IntPtr(-4));}catch{Native.SetProcessDPIAware();}Application.EnableVisualStyles();try{Application.Run(new Service());}catch(Exception ex){Console.WriteLine(Data.Json.Serialize(new {kind="error",message=ex.Message}));Environment.ExitCode=1;}} +} diff --git a/plugins/ztools-shukuaikuai/native/Overlay.cs b/plugins/ztools-shukuaikuai/native/Overlay.cs new file mode 100644 index 000000000..3dab93dbd --- /dev/null +++ b/plugins/ztools-shukuaikuai/native/Overlay.cs @@ -0,0 +1,68 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Threading; +using System.Runtime.InteropServices; +using System.Drawing.Imaging; +using System.Windows.Forms; + +// Frames never reference the mutable input session. Only this STA thread draws windows. +sealed class WheelVisual { + public int Radius,Center,InnerCount,SecondCount,OutsideCount;public bool Second,Outside;public string[] Labels; + public Color Color;public double Opacity; +} +sealed class RenderFrame { + public string Kind="idle",Hint="";public Point Center,Cursor;public Point[] Points; + public Point[][] Strokes;public float Dpi=1;public int Selected=-1,Width;public bool Trail;public Color Color;public WheelVisual Wheel; +} +sealed class OverlayPump:IDisposable { + RenderFrame latest;Thread worker;Form dispatch;ManualResetEvent ready=new ManualResetEvent(false);volatile bool stopped; + public long Paints;public double MaxPaintMs; + public OverlayPump(){worker=new Thread(Run);worker.IsBackground=true;worker.SetApartmentState(ApartmentState.STA);worker.Start();if(!ready.WaitOne(4000))throw new Exception("绘制线程启动超时");} + void Run(){using(var view=new OverlayView(this)){dispatch=view;var handle=view.Handle;using(var timer=new System.Windows.Forms.Timer()){timer.Interval=16;timer.Tick+=(s,e)=>{var frame=Interlocked.Exchange(ref latest,null);if(frame!=null)view.Apply(frame);view.ExpireFeedback();};timer.Start();ready.Set();Application.Run();}}} + public void Submit(RenderFrame frame){if(!stopped)Interlocked.Exchange(ref latest,frame);} + public void Clear(){Submit(new RenderFrame());} + public void Dispose(){if(stopped)return;stopped=true;try{dispatch.BeginInvoke((Action)(()=>{dispatch.Close();Application.ExitThread();}));}catch{}worker.Join(1500);ready.Dispose();} +} +sealed class OverlayView:Form { + readonly OverlayPump stats;RenderFrame frame=new RenderFrame();Font font,small;float fontDpi;Rectangle gestureBounds;DateTime feedbackUntil; + public OverlayView(OverlayPump owner){stats=owner;FormBorderStyle=FormBorderStyle.None;ShowInTaskbar=false;TopMost=true;} + protected override bool ShowWithoutActivation{get{return true;}} + protected override CreateParams CreateParams{get{var p=base.CreateParams;p.ExStyle|=0x08000000|0x20|0x80|0x80000;return p;}} + protected override void OnPaint(PaintEventArgs e){} + protected override void OnPaintBackground(PaintEventArgs e){} + public void ExpireFeedback(){if(frame.Kind=="feedback"&&DateTime.UtcNow>=feedbackUntil){Hide();frame=new RenderFrame();}} + public void Apply(RenderFrame next){var previous=frame.Kind;frame=next;if(next.Kind!="wheel"&&next.Kind!="gesture"&&next.Kind!="feedback"){Hide();gestureBounds=Rectangle.Empty;return;} + if(font==null||fontDpi!=next.Dpi){if(font!=null){font.Dispose();small.Dispose();}fontDpi=next.Dpi;font=new Font("Microsoft YaHei UI",11*fontDpi,FontStyle.Regular,GraphicsUnit.Pixel);small=new Font("Microsoft YaHei UI",10*fontDpi,FontStyle.Regular,GraphicsUnit.Pixel);} + Rectangle bounds;if(next.Kind=="feedback"){var area=Screen.FromPoint(next.Cursor).WorkingArea;int width=(int)(320*next.Dpi),height=(int)(54*next.Dpi);bounds=new Rectangle(Math.Max(area.Left,Math.Min(area.Right-width,next.Cursor.X+16)),Math.Max(area.Top,Math.Min(area.Bottom-height,next.Cursor.Y+20)),width,height);feedbackUntil=DateTime.UtcNow.AddMilliseconds(1400);} + else if(next.Kind=="wheel"){int r=next.Wheel.Radius+(int)(14*next.Dpi);bounds=new Rectangle(next.Center.X-r,next.Center.Y-r,r*2,r*2);gestureBounds=Rectangle.Empty;} + else{if(!next.Trail||next.Points==null||next.Points.Length<2){Hide();return;}int left=next.Points[0].X,top=next.Points[0].Y,right=left,bottom=top;foreach(var p in next.Points){left=Math.Min(left,p.X);top=Math.Min(top,p.Y);right=Math.Max(right,p.X);bottom=Math.Max(bottom,p.Y);}right=Math.Max(right,next.Cursor.X+240);bottom=Math.Max(bottom,next.Cursor.Y+60);var region=Rectangle.FromLTRB((int)Math.Floor((left-12)/128.0)*128,(int)Math.Floor((top-12)/128.0)*128,(int)Math.Ceiling((right+12)/128.0)*128,(int)Math.Ceiling((bottom+12)/128.0)*128);gestureBounds=previous!="gesture"?region:Rectangle.Union(gestureBounds,region);bounds=gestureBounds;} + var watch=System.Diagnostics.Stopwatch.StartNew();try{using(var bitmap=new Bitmap(bounds.Width,bounds.Height,PixelFormat.Format32bppPArgb))using(var g=Graphics.FromImage(bitmap)){g.Clear(Color.Transparent);g.SmoothingMode=SmoothingMode.AntiAlias;g.TextRenderingHint=System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;g.TranslateTransform(-bounds.Left,-bounds.Top);if(frame.Kind=="wheel")WheelPainter.Draw(g,frame,font,small);else if(frame.Kind=="feedback"){using(var b=new SolidBrush(Color.FromArgb(244,248,249)))g.FillRectangle(b,bounds);using(var b=new SolidBrush(Color.FromArgb(47,68,74)))using(var format=new StringFormat{Alignment=StringAlignment.Center,LineAlignment=StringAlignment.Center,Trimming=StringTrimming.EllipsisCharacter})g.DrawString(frame.Hint,font,b,bounds,format);}else{using(var pen=new Pen(frame.Color,frame.Width)){pen.StartCap=LineCap.Round;pen.EndCap=LineCap.Round;if(frame.Strokes!=null){foreach(var stroke in frame.Strokes)if(stroke.Length>1)g.DrawLines(pen,stroke);}else g.DrawLines(pen,frame.Points);}using(var b=new SolidBrush(Color.FromArgb(40,53,65)))g.DrawString(frame.Hint,font,b,frame.Cursor.X+18,frame.Cursor.Y+18);}Bounds=bounds;AlphaSurface.Upload(Handle,bitmap,bounds,frame.Kind=="wheel"?frame.Wheel.Opacity:1);if(!Visible)Show();}}finally{watch.Stop();stats.Paints++;stats.MaxPaintMs=Math.Max(stats.MaxPaintMs,watch.Elapsed.TotalMilliseconds);} + } + protected override void Dispose(bool disposing){if(disposing){if(font!=null)font.Dispose();if(small!=null)small.Dispose();}base.Dispose(disposing);} +} +static class WheelPainter { + static Color Ink=Color.FromArgb(45,57,69); + public static void Draw(Graphics g,RenderFrame f,Font font,Font small){var w=f.Wheel;float boundary=w.Center+(w.Radius-w.Center)*.5f;var disk=new RectangleF(f.Center.X-w.Radius,f.Center.Y-w.Radius,w.Radius*2,w.Radius*2); + for(int i=10;i>=1;i--){float inset=i*f.Dpi;using(var b=new SolidBrush(Color.FromArgb(2,27,46,57)))g.FillEllipse(b,disk.X-inset,disk.Y-inset,disk.Width+inset*2,disk.Height+inset*2);} + using(var b=new SolidBrush(Color.FromArgb(249,251,252)))g.FillEllipse(b,disk); + int offset=0;for(int ring=0;ring<(w.Second?2:1);ring++){int count=ring==0?w.InnerCount:w.SecondCount;float inner=ring==0?w.Center+3*f.Dpi:boundary+2*f.Dpi,outer=ring==0&&w.Second?boundary-2*f.Dpi:w.Radius-3*f.Dpi;float step=360f/count; + for(int i=0;i=offset;if(outside)using(var pen=new Pen(Color.FromArgb(180,w.Color),2*f.Dpi))g.DrawEllipse(pen,disk); + using(var fill=new SolidBrush(Color.White))g.FillEllipse(fill,f.Center.X-w.Center+3*f.Dpi,f.Center.Y-w.Center+3*f.Dpi,(w.Center-3*f.Dpi)*2,(w.Center-3*f.Dpi)*2); + string title=outside?"外圈":"鼠快快",subtitle=outside&&f.Selected8)return null;double left=double.MaxValue,top=left,right=double.MinValue,bottom=right,total=0;var lengths=new double[strokes.Length]; + for(int k=0;k0)lengths[k]+=Distance(p,strokes[k][i-1]);}total+=lengths[k];} + double scale=Math.Max(right-left,bottom-top);if(scale<12||total<24)return null;var counts=new int[strokes.Length];int sum=0,longest=0;for(int k=0;klengths[longest])longest=k;}while(sum<64){counts[longest]++;sum++;}while(sum>64){int index=0;for(int k=1;kcounts[index])index=k;counts[index]--;sum--;} + var cloud=new List();for(int k=0;k0?Math.Max(0,Math.Min(1,(target-distance)/segment)):0;cloud.Add(new PointF((float)((a.X+(b.X-a.X)*t)/scale),(float)((a.Y+(b.Y-a.Y)*t)/scale)));}} + double cx=0,cy=0;foreach(var p in cloud){cx+=p.X/64.0;cy+=p.Y/64.0;}for(int i=0;i.98;return new ShapeTemplate{Cloud=cloud.ToArray(),Heading=new PointF((float)hx,(float)hy),Linear=linear,StrokeCount=strokes.Length,Closed=strokes.Length==1&&Distance(strokes[0][0],strokes[0][strokes[0].Length-1])/scale<.22}; + } + public static List Compile(Dictionary config){var list=new List();foreach(var item in Data.Arr(config["gestures"])){var rule=Data.Obj(item);if(!Data.B(rule,"enabled")||Data.S(rule,"kind")!="shape")continue;var strokes=new List();foreach(var rawStroke in Data.Arr(rule["strokes"])){var points=new List();foreach(var point in Data.Arr(rawStroke)){var p=Data.Obj(point);points.Add(new PointF(Convert.ToSingle(p["x"]),Convert.ToSingle(p["y"])));}strokes.Add(points.ToArray());}var shape=Normalize(strokes.ToArray());if(shape!=null){shape.Id=Data.S(rule,"id");shape.ActionId=Data.S(rule,"actionId");shape.Name=Data.S(rule,"name");list.Add(shape);}}return list;} + static double CloudDistance(PointF[] a,PointF[] b,int start){var used=new bool[64];double sum=0;for(int n=0;n<64;n++){var p=a[(start+n)%64];int best=-1;double distance=double.MaxValue;for(int j=0;j<64;j++){if(used[j])continue;double d=Distance(p,b[j]);if(d Rank(Point[][] strokes,List templates){var floats=new PointF[strokes.Length][];for(int k=0;k();var input=Normalize(floats);if(input==null)return result;foreach(var t in templates){double distance=double.MaxValue;for(int start=0;start<64;start+=8)distance=Math.Min(distance,Math.Min(CloudDistance(input.Cloud,t.Cloud,start),CloudDistance(t.Cloud,input.Cloud,start)));double score=Math.Max(0,1-distance/.5-(input.Closed!=t.Closed?.06:0));if((input.StrokeCount==1&&t.StrokeCount==1&&!input.Closed&&!t.Closed)||(input.Linear&&t.Linear)){double an=Distance(input.Heading,new PointF()),bn=Distance(t.Heading,new PointF());if(an>.25&&bn>.25){double cosine=(input.Heading.X*t.Heading.X+input.Heading.Y*t.Heading.Y)/(an*bn);score=cosine<.2?0:Math.Max(0,score-(1-cosine)*.12);}}result.Add(new ShapeCandidate{Template=t,Score=score});}result.Sort((a,b)=>b.Score.CompareTo(a.Score));return result;} + public static ShapeTemplate Match(Point[][] strokes,List templates,double threshold){var ranking=Rank(strokes,templates);return ranking.Count>0&&ranking[0].Score>=threshold?ranking[0].Template:null;} +} diff --git a/plugins/ztools-shukuaikuai/package-lock.json b/plugins/ztools-shukuaikuai/package-lock.json new file mode 100644 index 000000000..f6108126c --- /dev/null +++ b/plugins/ztools-shukuaikuai/package-lock.json @@ -0,0 +1,1409 @@ +{ + "name": "ztools-shukuaikuai", + "version": "0.5.9", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "ztools-shukuaikuai", + "version": "0.5.9", + "license": "MIT", + "dependencies": { + "vue": "3.5.13" + }, + "devDependencies": { + "@playwright/test": "1.58.2", + "@vitejs/plugin-vue": "5.2.1", + "@ztools-center/plugin-cli": "1.3.2", + "fflate": "0.8.2", + "vite": "6.0.11" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.14", + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.29.14.tgz", + "integrity": "sha512-CXvKMFvM80ihI7Vox9jb+kQjnyjESQNPM+vB7U0Zz6TWuZA+Z/FL0QPMH300h33qJtIx+REeBhXqWOPW48TcAQ==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.14", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.29.14.tgz", + "integrity": "sha512-VL220vXuyO2z3rNIQwY7ftj9UwpqOt+33sH+sBWkOekbsSR2g7EEMnOx24ZlCH0xOA3DM/33SifVFGbnJD8r/w==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.14" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.14", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.29.14.tgz", + "integrity": "sha512-UjI/dKmwJwT9pOszJitq2G6EObZPnsZUfdCr92z2TlF3EZK9J3EdfOKUrCzHl6wFthbzwhzl1Soc/UIwxRiq6w==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.14", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.24.2.tgz", + "integrity": "sha512-thpVCb/rhxE/BnMLQ7GReQLLN8q9qbHmI55F4489/ByVg2aQaQ6kbcLb6FHkocZzQhxc4gx0sCk0tJkKBFzDhA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.24.2.tgz", + "integrity": "sha512-tmwl4hJkCfNHwFB3nBa8z1Uy3ypZpxqxfTQOcHX+xRByyYgunVbZ9MzUUfb0RxaHIMnbHagwAxuTL+tnNM+1/Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.24.2.tgz", + "integrity": "sha512-cNLgeqCqV8WxfcTIOeL4OAtSmL8JjcN6m09XIgro1Wi7cF4t/THaWEa7eL5CMoMBdjoHOTh/vwTO/o2TRXIyzg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.24.2.tgz", + "integrity": "sha512-B6Q0YQDqMx9D7rvIcsXfmJfvUYLoP722bgfBlO5cGvNVb5V/+Y7nhBE3mHV9OpxBf4eAS2S68KZztiPaWq4XYw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.24.2.tgz", + "integrity": "sha512-kj3AnYWc+CekmZnS5IPu9D+HWtUI49hbnyqk0FLEJDbzCIQt7hg7ucF1SQAilhtYpIujfaHr6O0UHlzzSPdOeA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.24.2.tgz", + "integrity": "sha512-WeSrmwwHaPkNR5H3yYfowhZcbriGqooyu3zI/3GGpF8AyUdsrrP0X6KumITGA9WOyiJavnGZUwPGvxvwfWPHIA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.2.tgz", + "integrity": "sha512-UN8HXjtJ0k/Mj6a9+5u6+2eZ2ERD7Edt1Q9IZiB5UZAIdPnVKDoG7mdTVGhHJIeEml60JteamR3qhsr1r8gXvg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.24.2.tgz", + "integrity": "sha512-TvW7wE/89PYW+IevEJXZ5sF6gJRDY/14hyIGFXdIucxCsbRmLUcjseQu1SyTko+2idmCw94TgyaEZi9HUSOe3Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.24.2.tgz", + "integrity": "sha512-n0WRM/gWIdU29J57hJyUdIsk0WarGd6To0s+Y+LwvlC55wt+GT/OgkwoXCXvIue1i1sSNWblHEig00GBWiJgfA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.24.2.tgz", + "integrity": "sha512-7HnAD6074BW43YvvUmE/35Id9/NB7BeX5EoNkK9obndmZBUk8xmJJeU7DwmUeN7tkysslb2eSl6CTrYz6oEMQg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.24.2.tgz", + "integrity": "sha512-sfv0tGPQhcZOgTKO3oBE9xpHuUqguHvSo4jl+wjnKwFpapx+vUDcawbwPNuBIAYdRAvIDBfZVvXprIj3HA+Ugw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.24.2.tgz", + "integrity": "sha512-CN9AZr8kEndGooS35ntToZLTQLHEjtVB5n7dl8ZcTZMonJ7CCfStrYhrzF97eAecqVbVJ7APOEe18RPI4KLhwQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.24.2.tgz", + "integrity": "sha512-iMkk7qr/wl3exJATwkISxI7kTcmHKE+BlymIAbHO8xanq/TjHaaVThFF6ipWzPHryoFsesNQJPE/3wFJw4+huw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.24.2.tgz", + "integrity": "sha512-shsVrgCZ57Vr2L8mm39kO5PPIb+843FStGt7sGGoqiiWYconSxwTiuswC1VJZLCjNiMLAMh34jg4VSEQb+iEbw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.24.2.tgz", + "integrity": "sha512-4eSFWnU9Hhd68fW16GD0TINewo1L6dRrB+oLNNbYyMUAeOD2yCK5KXGK1GH4qD/kT+bTEXjsyTCiJGHPZ3eM9Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.24.2.tgz", + "integrity": "sha512-S0Bh0A53b0YHL2XEXC20bHLuGMOhFDO6GN4b3YjRLK//Ep3ql3erpNcPlEFed93hsQAjAQDNsvcK+hV90FubSw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.24.2.tgz", + "integrity": "sha512-8Qi4nQcCTbLnK9WoMjdC9NiTG6/E38RNICU6sUNqK0QFxCYgoARqVqxdFmWkdonVsvGqWhmm7MO0jyTqLqwj0Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-arm64/-/netbsd-arm64-0.24.2.tgz", + "integrity": "sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.24.2.tgz", + "integrity": "sha512-VefFaQUc4FMmJuAxmIHgUmfNiLXY438XrL4GDNV1Y1H/RW3qow68xTwjZKfj/+Plp9NANmzbH5R40Meudu8mmw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.2.tgz", + "integrity": "sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.24.2.tgz", + "integrity": "sha512-+iDS6zpNM6EnJyWv0bMGLWSWeXGN/HTaF/LXHXHwejGsVi+ooqDfMCCTerNFxEkM3wYVcExkeGXNqshc9iMaOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.24.2.tgz", + "integrity": "sha512-hTdsW27jcktEvpwNHJU4ZwWFGkz2zRJUz8pvddmXPtXDzVKTTINmlmga3ZzwcuMpUvLw7JkLy9QLKyGpD2Yxig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.24.2.tgz", + "integrity": "sha512-LihEQ2BBKVFLOC9ZItT9iFprsE9tqjDjnbulhHoFxYQtQfai7qfluVODIYxt1PgdoyQkz23+01rzwNwYfutxUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.24.2.tgz", + "integrity": "sha512-q+iGUwfs8tncmFC9pcnD5IvRHAzmbwQ3GPS5/ceCyHdjXubwQWI12MKWSNSMYLJMq23/IUCvJMS76PDqXe1fxA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.24.2.tgz", + "integrity": "sha512-7VTgWzgMGvup6aSqDPLiW5zHaxYJGTO4OokMjIlrCtf+VpEL+cXKtCvg723iguPYI5oaUNdS+/V7OU2gvXVWEg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT" + }, + "node_modules/@playwright/test": { + "version": "1.58.2", + "resolved": "https://registry.npmmirror.com/@playwright/test/-/test-1.58.2.tgz", + "integrity": "sha512-akea+6bHYBBfA9uQqSYmlJXn61cTa+jbO87xVLCWbTqbWadRVmhxlXATaOjOgcBaWU4ePo0wB41KMFv3o35IXA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.58.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.68.3.tgz", + "integrity": "sha512-mqfypgH/liYjaSCoPI4erckUcROgZtmFUUmyOJ05oyayi/tVqOEYAzWP7ufqCoCT3xB31Fw4XIVO/jX42hYvKA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.68.3.tgz", + "integrity": "sha512-5tY+GC/1gpt79cKS2DQzu6iD824j6BmI4q5Zb6qftZ4kWqIQmvR3DD4eJ2Gclu6/nVMYDk2IVpqxypWOiAuWJg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-x64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-x64/-/rollup-android-x64-4.68.3.tgz", + "integrity": "sha512-nDBcQ/o3PMmGxmAzGBJFn+n1rb83Va9WSdFIq1AHmlEF3tuibVsyJ3kG5x13r7VIy6WI8SvzCdHVNSlSDIdj8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.68.3.tgz", + "integrity": "sha512-dra5zl0QWKkIkaMgNDNPC19gkMlPAfAf41yWlkGztXMIvUQrX9XWZFQRw7abhH3nks+XZGQpybINAxT2pKdFew==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.68.3.tgz", + "integrity": "sha512-xo5xeo/AjEB/ArzQjGn0JRDZuybZicQ5O3VPfko6ocH1li/qNrN4p5+R/WgjavzRz6UwAOaqsau7VvRQA6i6AA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.68.3.tgz", + "integrity": "sha512-zdckkcxHDEEKyDbC1t21DeaaiKGymxbkBU9c3zyfaaz+8N96ItJw4nmzHhZF+Mukgt906fnf2tsc90pVyStuHA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.68.3.tgz", + "integrity": "sha512-9oXqI7g/ycEz7TyicdGBC4sL6PfWMXAx8u15f/nd7lYkCLJd8U8VdBfbpc4SSnRBU/e7aPALve3mhzasGDeCYg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.68.3.tgz", + "integrity": "sha512-hbgT4NlaOELE3D5UUzSqF+OFgwz4Scvo2SQD9nZJUFjdIsg9Kg3FabQauUxkHKY9N5yjNXfXRRmiKNN4JpLmFA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.68.3.tgz", + "integrity": "sha512-yECcXZ/Bl+JVRhLFgld42rYrXgPdE0LtySGAmmmH6OtkaJM17A4cWG/eCzDymMVb52/jZjW0R54YrTHj4xXlSA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.68.3.tgz", + "integrity": "sha512-q4Q4/B7wyqM+TFqY5tJYQlaz5+ksGopcRmMeMdu4q6eaPK7N1PymTjIaH5LL32mMJBqIzpRof7BhlYLim5JgNQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.68.3.tgz", + "integrity": "sha512-Ich3TGl/7GqhQ6G6jVPzgGQGJjd3E5hECxSVanPYchy6Vwcq+WI8wG/gmEMilHNy+ZYCR6U8EN50EejG3TaIgw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.68.3.tgz", + "integrity": "sha512-URBmOhwv4Y0Hi5Hhxc3cmqZLtQlx55DOs5PUhhITDC3zu0qwAfhcNAFAIwAhOUdA6NFVEck07CNZX6cBEs1vTg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.68.3.tgz", + "integrity": "sha512-PTdJXuZplRyaE3ECArlbZubI2LlUHWm0oCipCexnE/8LM+L7qIqUiNbU0piBxt46EB5zxXX+cpmDvHX4Z3WwcQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.68.3.tgz", + "integrity": "sha512-IlSQPDExSm9YdtrWeZIHj87GPXI9lYygRvHVwQ1o9t91JHIiB2CihrvNIASpc/zI28atqm04jS3proaQuaJMww==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.68.3.tgz", + "integrity": "sha512-O2ssyDcBTZkH5v2P/9ZaXJreL0hCKvUA5UwuHn0jCKeMLKi4GhspZJ1I5FT5QsHtJ/dPx4pup7pg/Lw0emeY0Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.68.3.tgz", + "integrity": "sha512-fesqagxcnc87lH2+aBWne/tFCmQVIGH+YezjY1wQwbUODuTBBlhHoyxju6umwn8LnjHVanjpoeaQdLsXP8JQSQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.68.3.tgz", + "integrity": "sha512-WAjFDtLW3HjJ2RAytKoWdFwlK/hW8rJHrjhRZFw14nR+c9JN//WIlSBkyXUjEYCNOFs2sGLNutOEPQG4iVYHgA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.68.3.tgz", + "integrity": "sha512-+fZiTeHV/1fy/14dRqE4thjYwUOABL6qQjxElOEQg2oHLkCamO8dxhHphVgD4+pFxtVEUIWxsGVduPtwnAlvbg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.68.3.tgz", + "integrity": "sha512-pfn4Zd9Ic3lEaSwW3GsQhTIDd7929C+eiEkOutsSCT2IHD6rDLblwmMQkgeGOso0oDo9Jk/ERtFdtFr9ElLs+g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.68.3.tgz", + "integrity": "sha512-eUXzaeNQbKXKNqseL3g/usUqOPmRu+DbQsvwr9MXMdV+VQFUNb9bcWSNAAs/TRV95PCbFK46kLzHEOhFSzujsg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.68.3.tgz", + "integrity": "sha512-OiUclE7QDU4H/hr3ACRHhVGKWl+gNx+6Emignfq0hmNmzzTkZnT79wzB9NXKd0QH16S4t/wVqlAFBfC17nkZ5A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.68.3.tgz", + "integrity": "sha512-s6EclDWmk6zvIfk1yixgYthk7xHNx0xu5cEF5RDpS4IHNTpfswRX6xOXVG5cHF5xWn0B6EpDGARhPQ520KTlsA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.68.3.tgz", + "integrity": "sha512-G2xnmxGnU8XHLwtjnnXNRcLrub+Af3nm9VQ1QzL2aEiAL7woBdRgTCZBslJl8umA+YMqdEFpUh9kJB/Vyzk2wQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.68.3.tgz", + "integrity": "sha512-Y/4tApNVrMUYWbAHsyRWJgwuuJOfhTNhA2B04Xpa6+G9btkPZ9kU3XagUKzPTwF3hg36NpQk748JsnoTVho67Q==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.68.3.tgz", + "integrity": "sha512-i2vH/OA5BcW+TdNg12ZTRC4rn+vILaPMP9CvHqnv+QEpMjBHGGNLo4k4EnEqzjYvTD6x1Xark9WhsQbH4bTzUQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.68.3.tgz", + "integrity": "sha512-ADb1Uz2MNM0sxVpAlMNdQG16Hw4sgW1aqVL7NeqBMpcZeiHb192d7W6shZdMQs33D+w9ihDYBBPsYqqc4MlD8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/estree": { + "version": "1.0.10", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.10.tgz", + "integrity": "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitejs/plugin-vue": { + "version": "5.2.1", + "resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-5.2.1.tgz", + "integrity": "sha512-cxh314tzaWwOLqVes2gnnCtvBDcM1UMdn+iFR+UjAn411dPT3tOmqrJjbMd7koZpMAmBM/GqeV4n9ge7JSiJJQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.13.tgz", + "integrity": "sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/shared": "3.5.13", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.13.tgz", + "integrity": "sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.13.tgz", + "integrity": "sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/compiler-core": "3.5.13", + "@vue/compiler-dom": "3.5.13", + "@vue/compiler-ssr": "3.5.13", + "@vue/shared": "3.5.13", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.11", + "postcss": "^8.4.48", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.13.tgz", + "integrity": "sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.13.tgz", + "integrity": "sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.5.13.tgz", + "integrity": "sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.5.13.tgz", + "integrity": "sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.13", + "@vue/runtime-core": "3.5.13", + "@vue/shared": "3.5.13", + "csstype": "^3.1.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.5.13.tgz", + "integrity": "sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-ssr": "3.5.13", + "@vue/shared": "3.5.13" + }, + "peerDependencies": { + "vue": "3.5.13" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.13.tgz", + "integrity": "sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==", + "license": "MIT" + }, + "node_modules/@ztools-center/plugin-cli": { + "version": "1.3.2", + "resolved": "https://registry.npmmirror.com/@ztools-center/plugin-cli/-/plugin-cli-1.3.2.tgz", + "integrity": "sha512-ZQdFxHpo1al068Lw6k3t5uhrsLN0Ete/3DflqGo+lWxjDEU5JI497Cs0EVP3cF7vyC8kBIAPHebcvVrLaVpm3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "kolorist": "^1.8.0", + "minimist": "^1.2.8", + "prompts": "^2.4.2" + }, + "bin": { + "ztools": "dist/index.js" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/esbuild": { + "version": "0.24.2", + "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.24.2.tgz", + "integrity": "sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.24.2", + "@esbuild/android-arm": "0.24.2", + "@esbuild/android-arm64": "0.24.2", + "@esbuild/android-x64": "0.24.2", + "@esbuild/darwin-arm64": "0.24.2", + "@esbuild/darwin-x64": "0.24.2", + "@esbuild/freebsd-arm64": "0.24.2", + "@esbuild/freebsd-x64": "0.24.2", + "@esbuild/linux-arm": "0.24.2", + "@esbuild/linux-arm64": "0.24.2", + "@esbuild/linux-ia32": "0.24.2", + "@esbuild/linux-loong64": "0.24.2", + "@esbuild/linux-mips64el": "0.24.2", + "@esbuild/linux-ppc64": "0.24.2", + "@esbuild/linux-riscv64": "0.24.2", + "@esbuild/linux-s390x": "0.24.2", + "@esbuild/linux-x64": "0.24.2", + "@esbuild/netbsd-arm64": "0.24.2", + "@esbuild/netbsd-x64": "0.24.2", + "@esbuild/openbsd-arm64": "0.24.2", + "@esbuild/openbsd-x64": "0.24.2", + "@esbuild/sunos-x64": "0.24.2", + "@esbuild/win32-arm64": "0.24.2", + "@esbuild/win32-ia32": "0.24.2", + "@esbuild/win32-x64": "0.24.2" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmmirror.com/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "dev": true, + "license": "MIT" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmmirror.com/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/kolorist": { + "version": "1.8.0", + "resolved": "https://registry.npmmirror.com/kolorist/-/kolorist-1.8.0.tgz", + "integrity": "sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/playwright": { + "version": "1.58.2", + "resolved": "https://registry.npmmirror.com/playwright/-/playwright-1.58.2.tgz", + "integrity": "sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.58.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.58.2", + "resolved": "https://registry.npmmirror.com/playwright-core/-/playwright-core-1.58.2.tgz", + "integrity": "sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/playwright/node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/postcss": { + "version": "8.5.33", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.33.tgz", + "integrity": "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmmirror.com/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/rollup": { + "version": "4.68.3", + "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.68.3.tgz", + "integrity": "sha512-wd2gavj7CEQv52rdcVqfUupO/KPIKcoJKxyFWl4cOqYZGMQEOSijJRkliz0dRa7gpkj/h4TRqyWa+dJJi6T0OA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.10" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.68.3", + "@rollup/rollup-android-arm64": "4.68.3", + "@rollup/rollup-android-x64": "4.68.3", + "@rollup/rollup-darwin-arm64": "4.68.3", + "@rollup/rollup-darwin-x64": "4.68.3", + "@rollup/rollup-freebsd-arm64": "4.68.3", + "@rollup/rollup-freebsd-x64": "4.68.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.68.3", + "@rollup/rollup-linux-arm-musleabihf": "4.68.3", + "@rollup/rollup-linux-arm64-gnu": "4.68.3", + "@rollup/rollup-linux-arm64-musl": "4.68.3", + "@rollup/rollup-linux-loong64-gnu": "4.68.3", + "@rollup/rollup-linux-loong64-musl": "4.68.3", + "@rollup/rollup-linux-ppc64-gnu": "4.68.3", + "@rollup/rollup-linux-ppc64-musl": "4.68.3", + "@rollup/rollup-linux-riscv64-gnu": "4.68.3", + "@rollup/rollup-linux-riscv64-musl": "4.68.3", + "@rollup/rollup-linux-s390x-gnu": "4.68.3", + "@rollup/rollup-linux-x64-gnu": "4.68.3", + "@rollup/rollup-linux-x64-musl": "4.68.3", + "@rollup/rollup-openbsd-x64": "4.68.3", + "@rollup/rollup-openharmony-arm64": "4.68.3", + "@rollup/rollup-win32-arm64-msvc": "4.68.3", + "@rollup/rollup-win32-ia32-msvc": "4.68.3", + "@rollup/rollup-win32-x64-gnu": "4.68.3", + "@rollup/rollup-win32-x64-msvc": "4.68.3", + "fsevents": "~2.3.2" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/vite": { + "version": "6.0.11", + "resolved": "https://registry.npmmirror.com/vite/-/vite-6.0.11.tgz", + "integrity": "sha512-4VL9mQPKoHy4+FE0NnRE/kbY51TOfaknxAjt3fJbGJxhIpBZiqVzlZDEesWWsuREXHwNdAoOFZ9MkPEVXczHwg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "esbuild": "^0.24.2", + "postcss": "^8.4.49", + "rollup": "^4.23.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vue": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.13.tgz", + "integrity": "sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@vue/compiler-dom": "3.5.13", + "@vue/compiler-sfc": "3.5.13", + "@vue/runtime-dom": "3.5.13", + "@vue/server-renderer": "3.5.13", + "@vue/shared": "3.5.13" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + } + } +} diff --git a/plugins/ztools-shukuaikuai/package.json b/plugins/ztools-shukuaikuai/package.json new file mode 100644 index 000000000..fea72eddf --- /dev/null +++ b/plugins/ztools-shukuaikuai/package.json @@ -0,0 +1,32 @@ +{ + "name": "ztools-shukuaikuai", + "version": "0.5.9", + "private": true, + "type": "module", + "scripts": { + "dev": "vite --host 127.0.0.1", + "predev": "node scripts/prepare.mjs", + "prebuild": "node scripts/prepare.mjs && node scripts/clean.mjs", + "build": "vite build && node scripts/build-native.mjs", + "package": "npm run build && node scripts/package.mjs", + "test": "node --test tests/*.test.cjs", + "publish:market": "node scripts/publish.mjs" + }, + "dependencies": { + "vue": "3.5.13" + }, + "devDependencies": { + "@playwright/test": "1.58.2", + "@vitejs/plugin-vue": "5.2.1", + "@ztools-center/plugin-cli": "1.3.2", + "fflate": "0.8.2", + "vite": "6.0.11" + }, + "author": "jiang66-so", + "homepage": "https://github.com/jiang66-so/ztools-shukuaikuai", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/jiang66-so/ztools-shukuaikuai.git" + } +} diff --git a/plugins/ztools-shukuaikuai/public/THIRD_PARTY_NOTICES.txt b/plugins/ztools-shukuaikuai/public/THIRD_PARTY_NOTICES.txt new file mode 100644 index 000000000..15f1f7e7a --- /dev/null +++ b/plugins/ztools-shukuaikuai/public/THIRD_PARTY_NOTICES.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018-present, Yuxi (Evan) You + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/ztools-shukuaikuai/public/core.cjs b/plugins/ztools-shukuaikuai/public/core.cjs new file mode 100644 index 000000000..5c2b33479 --- /dev/null +++ b/plugins/ztools-shukuaikuai/public/core.cjs @@ -0,0 +1,60 @@ +'use strict'; +function defaults(){return upgrade({schemaVersion:1,wheelEnabled:true,gestureEnabled:true,wheels:[{id:'main',name:'常用轮盘',enabled:true,button:'middle',modifiers:[],mode:'hold',count:8,size:280,center:36,delay:0,opacity:95,color:'#208b91',labels:true,slots:['copy','paste','cut','all','undo','save','','']}],gesture:{button:'right',modifiers:[],min:24,tolerance:30,timeout:3000,color:'#208b91',width:4,trail:true},gestures:[{id:'back',name:'后退',enabled:true,pattern:'L',actionId:'back'},{id:'forward',name:'前进',enabled:true,pattern:'R',actionId:'forward'}],actions:[['copy','复制','Ctrl+C'],['paste','粘贴','Ctrl+V'],['cut','剪切','Ctrl+X'],['all','全选','Ctrl+A'],['undo','撤销','Ctrl+Z'],['save','保存','Ctrl+S'],['back','后退','Alt+Left'],['forward','前进','Alt+Right']].map(([id,name,value])=>({id,name,type:'key',value})),excluded:[]})} +function validate(c){const errors=[];if(!c||c.schemaVersion!==1)return ['不支持的配置版本'];if(!Array.isArray(c.wheels)||!Array.isArray(c.gestures)||!Array.isArray(c.actions)||!c.gesture||!Array.isArray(c.excluded))return ['配置结构不完整'];if([c.actions,c.wheels,c.gestures].some(g=>g.some(x=>!x||typeof x!=='object'||Array.isArray(x))))return ['配置条目无效'];if(c.wheels.length>30||c.actions.length>300||c.gestures.length>200)return ['配置数量过多'];const ids=new Set(),acts=new Set();for(const group of [c.actions,c.wheels,c.gestures]){ids.clear();for(const x of group){if(!x||typeof x.id!=='string'||!x.id||ids.has(x.id))errors.push('ID 重复或无效');ids.add(x?.id);if(typeof x?.name!=='string'||!x.name.trim())errors.push('名称不能为空')}}for(const a of c.actions){acts.add(a.id);if(!['key','app','path','url','text'].includes(a.type)||typeof a.value!=='string'||!a.value.trim())errors.push('动作内容无效');if(a.type==='url'&&!/^https?:\/\/[^\s]+$/i.test(a.value))errors.push('网址仅支持 HTTP/HTTPS');if(a.type==='key'&&!/^(?:(?:Ctrl|Alt|Shift|Win)\+)*(?:[A-Z0-9]|F(?:[1-9]|1[0-9]|2[0-4])|Left|Right|Up|Down|Enter|Tab|Space|Backspace|Delete|Home|End|PageUp|PageDown|Escape)$/i.test(a.value))errors.push('快捷键格式不支持');if(a.args!==undefined&&(!Array.isArray(a.args)||a.args.some(x=>typeof x!=='string')))errors.push('应用参数必须是字符串数组')} +const triggers=new Set();function trigger(x,on){if(!['middle','right','x1','x2'].includes(x.button)||!Array.isArray(x.modifiers)||x.modifiers.some(m=>!['Ctrl','Alt','Shift'].includes(m))||new Set(x.modifiers).size!==x.modifiers.length){errors.push('触发按键无效');return}const key=x.button+'+'+[...x.modifiers].sort().join('+');if(on&&triggers.has(key))errors.push('触发组合冲突');if(on)triggers.add(key)} +for(const raw of c.wheels){ + if(raw.layoutVersion!==3){if(raw.outerEnabled!==undefined&&typeof raw.outerEnabled!=='boolean')errors.push('第二圈开关无效');if(raw.outerSlots!==undefined&&(!Array.isArray(raw.outerSlots)||raw.outerSlots.length!==(raw.outerCount??8)))errors.push('外圈旧配置无效');} + const w=upgrade({wheels:[raw]}).wheels[0];trigger(w,c.wheelEnabled&&w.enabled); + function slots(label,values,count){if(![4,6,8,12].includes(count)||!Array.isArray(values)||values.length!==count||values.some(x=>typeof x!=='string'||x&&!acts.has(x)))errors.push(label+'数量或引用动作无效');} + slots('轮盘',w.slots,w.count);slots('第二圈',w.secondSlots,w.secondCount);slots('外圈',w.outsideSlots,w.outsideCount); + if(typeof w.secondEnabled!=='boolean'||typeof w.outsideEnabled!=='boolean')errors.push('圈层开关无效'); + if(!['single','direction'].includes(w.outsideMode)||!['release','enter'].includes(w.outsideTrigger)||typeof w.outsideActionId!=='string'||w.outsideActionId&&!acts.has(w.outsideActionId))errors.push('外圈动作配置无效'); + if(!['hold','click'].includes(w.mode)||!(w.size>=200&&w.size<=600)||!(w.center>=20&&w.center=0&&w.delay<=1000)||!(w.opacity>=30&&w.opacity<=100)||!/^#[0-9a-f]{6}$/i.test(w.color))errors.push('轮盘参数超出范围'); +} +trigger(c.gesture,c.gestureEnabled);const patterns=new Set(),shapeSignatures=new Set();for(const g of c.gestures){ + if(g.kind==='shape'){if(!validShape(g.strokes))errors.push('图形手势需包含 1—8 笔有效轨迹,每笔至少两个点');else{const signature=JSON.stringify(g.strokes);if(g.enabled&&shapeSignatures.has(signature))errors.push('手势重复');if(g.enabled)shapeSignatures.add(signature);}} + else {if(!/^[UDLR]{1,4}$/.test(g.pattern)||/(.)\1/.test(g.pattern))errors.push('手势必须为 1—4 段不同的相邻方向');if(g.enabled&&patterns.has(g.pattern))errors.push('手势重复');if(g.enabled)patterns.add(g.pattern);} + if(!acts.has(g.actionId))errors.push('手势引用不存在的动作'); +} +const g=c.gesture;if(!(g.min>=12&&g.min<=100)||!(g.timeout>=500&&g.timeout<=10000)||!(g.tolerance>=10&&g.tolerance<=40)||!(g.width>=1&&g.width<=12)||!/^#[0-9a-f]{6}$/i.test(g.color))errors.push('手势参数超出范围');if(g.shapeThreshold!==undefined&&!(g.shapeThreshold>=.65&&g.shapeThreshold<=.95))errors.push('图形识别精度无效');if(g.strokeWindow!==undefined&&!(g.strokeWindow>=200&&g.strokeWindow<=1500))errors.push('分笔等待时间无效');if(c.excluded.some(x=>typeof x!=='string'||!x.trim()))errors.push('排除应用无效');return [...new Set(errors)]} +function recognize(points,min=24,tolerance=30){if(points.length<2)return '';let anchor=points[0],out='',uncertain=false;for(const p of points.slice(1)){const x=p.x-anchor.x,y=p.y-anchor.y;if(Math.hypot(x,y)Math.abs(angle-a)<=tolerance);if(!d){uncertain=true;continue}uncertain=false;if(out.at(-1)!==d[1])out+=d[1];if(out.length>4)return '';anchor=p}return uncertain?'':out} +function hit(x,y,count,center,outer=Infinity){if(Math.hypot(x,y)<=center||Math.hypot(x,y)>outer)return -1;return Math.floor(((Math.atan2(y,x)+Math.PI/2+Math.PI/count+Math.PI*2)%(Math.PI*2))/(Math.PI*2/count))%count} + +function upgrade(input){ + const c=JSON.parse(JSON.stringify(input));if(!c||!Array.isArray(c.wheels))return c; + for(const w of c.wheels){if(!w||typeof w!=='object')continue; + if(w.triggerDelayVersion===undefined){if(w.delay===120)w.delay=0;w.triggerDelayVersion=2;} + if(w.layoutVersion!==3){ + w.secondEnabled=w.secondEnabled??w.outerEnabled??false;w.secondCount=w.secondCount??w.outerCount??8;w.secondSlots=w.secondSlots??w.outerSlots??Array([4,6,8,12].includes(w.secondCount)?w.secondCount:8).fill(''); + delete w.outerEnabled;delete w.outerCount;delete w.outerSlots;w.layoutVersion=3; + } + if(w.secondEnabled===undefined)w.secondEnabled=false;if(w.secondCount===undefined)w.secondCount=8;if(w.secondSlots===undefined)w.secondSlots=Array([4,6,8,12].includes(w.secondCount)?w.secondCount:8).fill(''); + if(w.outsideEnabled===undefined)w.outsideEnabled=false;if(w.outsideMode===undefined)w.outsideMode='single';if(w.outsideActionId===undefined)w.outsideActionId=''; + if(w.outsideCount===undefined)w.outsideCount=8;if(w.outsideSlots===undefined)w.outsideSlots=Array([4,6,8,12].includes(w.outsideCount)?w.outsideCount:8).fill('');if(w.outsideTrigger===undefined)w.outsideTrigger='release'; + if(w.styleVersion!==3){if(w.color==='#4f66e8')w.color='#208b91';w.styleVersion=3;} + }if(Array.isArray(c.gestures)){for(const rule of c.gestures){if(rule&&rule.kind!=='shape'&&/^[UDLR]{1,4}$/.test(rule.pattern)){rule.kind='shape';rule.strokes=patternStrokes(rule.pattern);}}}if(c.gesture){if(c.gesture.shapeThreshold===undefined)c.gesture.shapeThreshold=.75;if(c.gesture.recognitionVersion!==4){if(c.gesture.shapeThreshold===.82)c.gesture.shapeThreshold=.75;if(c.gesture.timeout===3000)c.gesture.timeout=8000;if(c.gesture.strokeWindow===600)c.gesture.strokeWindow=350;c.gesture.recognitionVersion=4;}if(c.gesture.strokeWindow===undefined)c.gesture.strokeWindow=600;}return c; +} +function wheelHit(x,y,w){ + const radius=w.size/2,d=Math.hypot(x,y);if(d<=w.center)return null; + if(d>radius)return w.outsideEnabled?{ring:'outside',index:w.outsideMode==='single'?0:hit(x,y,w.outsideCount,w.center)}:null; + const second=w.secondEnabled&&d>=w.center+(radius-w.center)*.5; + return {ring:second?'second':'inner',index:hit(x,y,second?w.secondCount:w.count,w.center)}; +} +function captureTrigger(e){const button=({1:'middle',2:'right',3:'x1',4:'x2'})[e.button];if(!button)return null;return {button,modifiers:[e.ctrlKey?'Ctrl':'',e.altKey?'Alt':'',e.shiftKey?'Shift':''].filter(Boolean)}} +function gestureIssue(pattern,actionId,rules,ignoreId){if(!/^[UDLR]{1,4}$/.test(pattern))return '请绘制轨迹或使用方向按钮录入手势';if(/(.)\1/.test(pattern))return '相邻方向不能重复';if(!actionId)return '请选择一个执行动作';const existing=rules.find(g=>g.id!==ignoreId&&g.pattern===pattern);return existing?'这个手势已存在:'+existing.name+',请修改原规则或选择不同轨迹':''} + +function validShape(strokes){return Array.isArray(strokes)&&strokes.length>=1&&strokes.length<=8&&strokes.every(s=>Array.isArray(s)&&s.length>=2&&s.length<=2048&&s.every(p=>p&&Number.isFinite(p.x)&&Number.isFinite(p.y)))&&strokes.flat().some(p=>Math.hypot(p.x-strokes[0][0].x,p.y-strokes[0][0].y)>12)} +function normalizeShape(strokes){ + if(!validShape(strokes))return null;const all=strokes.flat(),xs=all.map(p=>p.x),ys=all.map(p=>p.y),width=Math.max(...xs)-Math.min(...xs),height=Math.max(...ys)-Math.min(...ys),scale=Math.max(width,height);if(scale<12)return null; + const lengths=strokes.map(s=>s.slice(1).reduce((n,p,i)=>n+Math.hypot(p.x-s[i].x,p.y-s[i].y),0)),total=lengths.reduce((a,b)=>a+b,0);if(total<24)return null; + const count=strokes.map((s,i)=>Math.max(4,Math.floor(lengths[i]/total*64)));while(count.reduce((a,b)=>a+b,0)<64)count[lengths.indexOf(Math.max(...lengths))]++;while(count.reduce((a,b)=>a+b,0)>64){const i=count.indexOf(Math.max(...count));count[i]--;} + const points=[];strokes.forEach((s,k)=>{let cursor=1,distance=0;const step=lengths[k]/(count[k]-1);for(let i=0;in+p.x,0)/64,cy=points.reduce((n,p)=>n+p.y,0)/64;for(const p of points){p.x-=cx;p.y-=cy;}const first=strokes[0][0],last=strokes.at(-1).at(-1);let hx=0,hy=0;for(const stroke of strokes){hx+=(stroke.at(-1).x-stroke[0].x)/scale;hy+=(stroke.at(-1).y-stroke[0].y)/scale;}const xx=points.reduce((n,p)=>n+p.x*p.x,0),yy=points.reduce((n,p)=>n+p.y*p.y,0),xy=points.reduce((n,p)=>n+p.x*p.y,0),linear=(xx+yy+Math.hypot(xx-yy,2*xy))/(2*(xx+yy||1))>.98;return {points,heading:{x:hx,y:hy},linear,strokeCount:strokes.length,closed:strokes.length===1&&Math.hypot(first.x-last.x,first.y-last.y)/scale<.22}; +} +function cloudDistance(a,b,start){const used=Array(64).fill(false);let sum=0;for(let n=0;n<64;n++){const p=a[(start+n)%64];let best=-1,distance=Infinity;for(let j=0;j<64;j++){if(used[j])continue;const d=Math.hypot(p.x-b[j].x,p.y-b[j].y);if(d.25&&bn>.25){const cosine=(a.x*b.x+a.y*b.y)/(an*bn);score=cosine<.2?0:Math.max(0,score-(1-cosine)*.12);}}ranking.push({...rule,score});}return ranking.sort((a,b)=>b.score-a.score)} +function matchShape(strokes,rules,threshold=.75){const best=rankShapes(strokes,rules)[0];return best&&best.score>=threshold?best:null} +function saveAtomic(file,c){const fs=require('node:fs'),path=require('node:path');const e=validate(c);if(e.length)throw Error(e.join(';'));fs.mkdirSync(path.dirname(file),{recursive:true});fs.writeFileSync(file+'.tmp',JSON.stringify(c,null,2));if(fs.existsSync(file)){try{const old=JSON.parse(fs.readFileSync(file,'utf8'));if(!validate(old).length)fs.copyFileSync(file,file+'.bak')}catch{}}fs.renameSync(file+'.tmp',file)} +function loadSafe(file){const fs=require('node:fs');for(const name of [file,file+'.bak']){try{const c=JSON.parse(fs.readFileSync(name,'utf8'));if(!validate(c).length)return upgrade(c)}catch{}}return defaults()} +module.exports={defaults,validate,recognize,hit,upgrade,wheelHit,captureTrigger,gestureIssue,validShape,normalizeShape,patternStrokes,rankShapes,matchShape,saveAtomic,loadSafe}; diff --git a/plugins/ztools-shukuaikuai/public/defaults.json b/plugins/ztools-shukuaikuai/public/defaults.json new file mode 100644 index 000000000..e1b316c97 --- /dev/null +++ b/plugins/ztools-shukuaikuai/public/defaults.json @@ -0,0 +1 @@ +{"schemaVersion":1,"wheelEnabled":true,"gestureEnabled":true,"wheels":[{"id":"main","name":"常用轮盘","enabled":true,"button":"middle","modifiers":[],"mode":"hold","count":8,"size":280,"center":36,"delay":0,"opacity":95,"color":"#208b91","labels":true,"slots":["copy","paste","cut","all","undo","save","",""],"triggerDelayVersion":2,"secondEnabled":false,"secondCount":8,"secondSlots":["","","","","","","",""],"layoutVersion":3,"outsideEnabled":false,"outsideMode":"single","outsideActionId":"","outsideCount":8,"outsideSlots":["","","","","","","",""],"outsideTrigger":"release","styleVersion":3}],"gesture":{"button":"right","modifiers":[],"min":24,"tolerance":30,"timeout":8000,"color":"#208b91","width":4,"trail":true,"shapeThreshold":0.75,"recognitionVersion":4,"strokeWindow":600},"gestures":[{"id":"back","name":"后退","enabled":true,"pattern":"L","actionId":"back","kind":"shape","strokes":[[{"x":0,"y":0},{"x":-100,"y":0}]]},{"id":"forward","name":"前进","enabled":true,"pattern":"R","actionId":"forward","kind":"shape","strokes":[[{"x":0,"y":0},{"x":100,"y":0}]]}],"actions":[{"id":"copy","name":"复制","type":"key","value":"Ctrl+C"},{"id":"paste","name":"粘贴","type":"key","value":"Ctrl+V"},{"id":"cut","name":"剪切","type":"key","value":"Ctrl+X"},{"id":"all","name":"全选","type":"key","value":"Ctrl+A"},{"id":"undo","name":"撤销","type":"key","value":"Ctrl+Z"},{"id":"save","name":"保存","type":"key","value":"Ctrl+S"},{"id":"back","name":"后退","type":"key","value":"Alt+Left"},{"id":"forward","name":"前进","type":"key","value":"Alt+Right"}],"excluded":[]} \ No newline at end of file diff --git a/plugins/ztools-shukuaikuai/public/logo-mouse.png b/plugins/ztools-shukuaikuai/public/logo-mouse.png new file mode 100644 index 000000000..682ba1ef6 Binary files /dev/null and b/plugins/ztools-shukuaikuai/public/logo-mouse.png differ diff --git a/plugins/ztools-shukuaikuai/public/logo.png b/plugins/ztools-shukuaikuai/public/logo.png new file mode 100644 index 000000000..682ba1ef6 Binary files /dev/null and b/plugins/ztools-shukuaikuai/public/logo.png differ diff --git a/plugins/ztools-shukuaikuai/public/model.js b/plugins/ztools-shukuaikuai/public/model.js new file mode 100644 index 000000000..f199b6f31 --- /dev/null +++ b/plugins/ztools-shukuaikuai/public/model.js @@ -0,0 +1,61 @@ +(()=>{ +'use strict'; +function defaults(){return upgrade({schemaVersion:1,wheelEnabled:true,gestureEnabled:true,wheels:[{id:'main',name:'常用轮盘',enabled:true,button:'middle',modifiers:[],mode:'hold',count:8,size:280,center:36,delay:0,opacity:95,color:'#208b91',labels:true,slots:['copy','paste','cut','all','undo','save','','']}],gesture:{button:'right',modifiers:[],min:24,tolerance:30,timeout:3000,color:'#208b91',width:4,trail:true},gestures:[{id:'back',name:'后退',enabled:true,pattern:'L',actionId:'back'},{id:'forward',name:'前进',enabled:true,pattern:'R',actionId:'forward'}],actions:[['copy','复制','Ctrl+C'],['paste','粘贴','Ctrl+V'],['cut','剪切','Ctrl+X'],['all','全选','Ctrl+A'],['undo','撤销','Ctrl+Z'],['save','保存','Ctrl+S'],['back','后退','Alt+Left'],['forward','前进','Alt+Right']].map(([id,name,value])=>({id,name,type:'key',value})),excluded:[]})} +function validate(c){const errors=[];if(!c||c.schemaVersion!==1)return ['不支持的配置版本'];if(!Array.isArray(c.wheels)||!Array.isArray(c.gestures)||!Array.isArray(c.actions)||!c.gesture||!Array.isArray(c.excluded))return ['配置结构不完整'];if([c.actions,c.wheels,c.gestures].some(g=>g.some(x=>!x||typeof x!=='object'||Array.isArray(x))))return ['配置条目无效'];if(c.wheels.length>30||c.actions.length>300||c.gestures.length>200)return ['配置数量过多'];const ids=new Set(),acts=new Set();for(const group of [c.actions,c.wheels,c.gestures]){ids.clear();for(const x of group){if(!x||typeof x.id!=='string'||!x.id||ids.has(x.id))errors.push('ID 重复或无效');ids.add(x?.id);if(typeof x?.name!=='string'||!x.name.trim())errors.push('名称不能为空')}}for(const a of c.actions){acts.add(a.id);if(!['key','app','path','url','text'].includes(a.type)||typeof a.value!=='string'||!a.value.trim())errors.push('动作内容无效');if(a.type==='url'&&!/^https?:\/\/[^\s]+$/i.test(a.value))errors.push('网址仅支持 HTTP/HTTPS');if(a.type==='key'&&!/^(?:(?:Ctrl|Alt|Shift|Win)\+)*(?:[A-Z0-9]|F(?:[1-9]|1[0-9]|2[0-4])|Left|Right|Up|Down|Enter|Tab|Space|Backspace|Delete|Home|End|PageUp|PageDown|Escape)$/i.test(a.value))errors.push('快捷键格式不支持');if(a.args!==undefined&&(!Array.isArray(a.args)||a.args.some(x=>typeof x!=='string')))errors.push('应用参数必须是字符串数组')} +const triggers=new Set();function trigger(x,on){if(!['middle','right','x1','x2'].includes(x.button)||!Array.isArray(x.modifiers)||x.modifiers.some(m=>!['Ctrl','Alt','Shift'].includes(m))||new Set(x.modifiers).size!==x.modifiers.length){errors.push('触发按键无效');return}const key=x.button+'+'+[...x.modifiers].sort().join('+');if(on&&triggers.has(key))errors.push('触发组合冲突');if(on)triggers.add(key)} +for(const raw of c.wheels){ + if(raw.layoutVersion!==3){if(raw.outerEnabled!==undefined&&typeof raw.outerEnabled!=='boolean')errors.push('第二圈开关无效');if(raw.outerSlots!==undefined&&(!Array.isArray(raw.outerSlots)||raw.outerSlots.length!==(raw.outerCount??8)))errors.push('外圈旧配置无效');} + const w=upgrade({wheels:[raw]}).wheels[0];trigger(w,c.wheelEnabled&&w.enabled); + function slots(label,values,count){if(![4,6,8,12].includes(count)||!Array.isArray(values)||values.length!==count||values.some(x=>typeof x!=='string'||x&&!acts.has(x)))errors.push(label+'数量或引用动作无效');} + slots('轮盘',w.slots,w.count);slots('第二圈',w.secondSlots,w.secondCount);slots('外圈',w.outsideSlots,w.outsideCount); + if(typeof w.secondEnabled!=='boolean'||typeof w.outsideEnabled!=='boolean')errors.push('圈层开关无效'); + if(!['single','direction'].includes(w.outsideMode)||!['release','enter'].includes(w.outsideTrigger)||typeof w.outsideActionId!=='string'||w.outsideActionId&&!acts.has(w.outsideActionId))errors.push('外圈动作配置无效'); + if(!['hold','click'].includes(w.mode)||!(w.size>=200&&w.size<=600)||!(w.center>=20&&w.center=0&&w.delay<=1000)||!(w.opacity>=30&&w.opacity<=100)||!/^#[0-9a-f]{6}$/i.test(w.color))errors.push('轮盘参数超出范围'); +} +trigger(c.gesture,c.gestureEnabled);const patterns=new Set(),shapeSignatures=new Set();for(const g of c.gestures){ + if(g.kind==='shape'){if(!validShape(g.strokes))errors.push('图形手势需包含 1—8 笔有效轨迹,每笔至少两个点');else{const signature=JSON.stringify(g.strokes);if(g.enabled&&shapeSignatures.has(signature))errors.push('手势重复');if(g.enabled)shapeSignatures.add(signature);}} + else {if(!/^[UDLR]{1,4}$/.test(g.pattern)||/(.)\1/.test(g.pattern))errors.push('手势必须为 1—4 段不同的相邻方向');if(g.enabled&&patterns.has(g.pattern))errors.push('手势重复');if(g.enabled)patterns.add(g.pattern);} + if(!acts.has(g.actionId))errors.push('手势引用不存在的动作'); +} +const g=c.gesture;if(!(g.min>=12&&g.min<=100)||!(g.timeout>=500&&g.timeout<=10000)||!(g.tolerance>=10&&g.tolerance<=40)||!(g.width>=1&&g.width<=12)||!/^#[0-9a-f]{6}$/i.test(g.color))errors.push('手势参数超出范围');if(g.shapeThreshold!==undefined&&!(g.shapeThreshold>=.65&&g.shapeThreshold<=.95))errors.push('图形识别精度无效');if(g.strokeWindow!==undefined&&!(g.strokeWindow>=200&&g.strokeWindow<=1500))errors.push('分笔等待时间无效');if(c.excluded.some(x=>typeof x!=='string'||!x.trim()))errors.push('排除应用无效');return [...new Set(errors)]} +function recognize(points,min=24,tolerance=30){if(points.length<2)return '';let anchor=points[0],out='',uncertain=false;for(const p of points.slice(1)){const x=p.x-anchor.x,y=p.y-anchor.y;if(Math.hypot(x,y)Math.abs(angle-a)<=tolerance);if(!d){uncertain=true;continue}uncertain=false;if(out.at(-1)!==d[1])out+=d[1];if(out.length>4)return '';anchor=p}return uncertain?'':out} +function hit(x,y,count,center,outer=Infinity){if(Math.hypot(x,y)<=center||Math.hypot(x,y)>outer)return -1;return Math.floor(((Math.atan2(y,x)+Math.PI/2+Math.PI/count+Math.PI*2)%(Math.PI*2))/(Math.PI*2/count))%count} + +function upgrade(input){ + const c=JSON.parse(JSON.stringify(input));if(!c||!Array.isArray(c.wheels))return c; + for(const w of c.wheels){if(!w||typeof w!=='object')continue; + if(w.triggerDelayVersion===undefined){if(w.delay===120)w.delay=0;w.triggerDelayVersion=2;} + if(w.layoutVersion!==3){ + w.secondEnabled=w.secondEnabled??w.outerEnabled??false;w.secondCount=w.secondCount??w.outerCount??8;w.secondSlots=w.secondSlots??w.outerSlots??Array([4,6,8,12].includes(w.secondCount)?w.secondCount:8).fill(''); + delete w.outerEnabled;delete w.outerCount;delete w.outerSlots;w.layoutVersion=3; + } + if(w.secondEnabled===undefined)w.secondEnabled=false;if(w.secondCount===undefined)w.secondCount=8;if(w.secondSlots===undefined)w.secondSlots=Array([4,6,8,12].includes(w.secondCount)?w.secondCount:8).fill(''); + if(w.outsideEnabled===undefined)w.outsideEnabled=false;if(w.outsideMode===undefined)w.outsideMode='single';if(w.outsideActionId===undefined)w.outsideActionId=''; + if(w.outsideCount===undefined)w.outsideCount=8;if(w.outsideSlots===undefined)w.outsideSlots=Array([4,6,8,12].includes(w.outsideCount)?w.outsideCount:8).fill('');if(w.outsideTrigger===undefined)w.outsideTrigger='release'; + if(w.styleVersion!==3){if(w.color==='#4f66e8')w.color='#208b91';w.styleVersion=3;} + }if(Array.isArray(c.gestures)){for(const rule of c.gestures){if(rule&&rule.kind!=='shape'&&/^[UDLR]{1,4}$/.test(rule.pattern)){rule.kind='shape';rule.strokes=patternStrokes(rule.pattern);}}}if(c.gesture){if(c.gesture.shapeThreshold===undefined)c.gesture.shapeThreshold=.75;if(c.gesture.recognitionVersion!==4){if(c.gesture.shapeThreshold===.82)c.gesture.shapeThreshold=.75;if(c.gesture.timeout===3000)c.gesture.timeout=8000;if(c.gesture.strokeWindow===600)c.gesture.strokeWindow=350;c.gesture.recognitionVersion=4;}if(c.gesture.strokeWindow===undefined)c.gesture.strokeWindow=600;}return c; +} +function wheelHit(x,y,w){ + const radius=w.size/2,d=Math.hypot(x,y);if(d<=w.center)return null; + if(d>radius)return w.outsideEnabled?{ring:'outside',index:w.outsideMode==='single'?0:hit(x,y,w.outsideCount,w.center)}:null; + const second=w.secondEnabled&&d>=w.center+(radius-w.center)*.5; + return {ring:second?'second':'inner',index:hit(x,y,second?w.secondCount:w.count,w.center)}; +} +function captureTrigger(e){const button=({1:'middle',2:'right',3:'x1',4:'x2'})[e.button];if(!button)return null;return {button,modifiers:[e.ctrlKey?'Ctrl':'',e.altKey?'Alt':'',e.shiftKey?'Shift':''].filter(Boolean)}} +function gestureIssue(pattern,actionId,rules,ignoreId){if(!/^[UDLR]{1,4}$/.test(pattern))return '请绘制轨迹或使用方向按钮录入手势';if(/(.)\1/.test(pattern))return '相邻方向不能重复';if(!actionId)return '请选择一个执行动作';const existing=rules.find(g=>g.id!==ignoreId&&g.pattern===pattern);return existing?'这个手势已存在:'+existing.name+',请修改原规则或选择不同轨迹':''} + +function validShape(strokes){return Array.isArray(strokes)&&strokes.length>=1&&strokes.length<=8&&strokes.every(s=>Array.isArray(s)&&s.length>=2&&s.length<=2048&&s.every(p=>p&&Number.isFinite(p.x)&&Number.isFinite(p.y)))&&strokes.flat().some(p=>Math.hypot(p.x-strokes[0][0].x,p.y-strokes[0][0].y)>12)} +function normalizeShape(strokes){ + if(!validShape(strokes))return null;const all=strokes.flat(),xs=all.map(p=>p.x),ys=all.map(p=>p.y),width=Math.max(...xs)-Math.min(...xs),height=Math.max(...ys)-Math.min(...ys),scale=Math.max(width,height);if(scale<12)return null; + const lengths=strokes.map(s=>s.slice(1).reduce((n,p,i)=>n+Math.hypot(p.x-s[i].x,p.y-s[i].y),0)),total=lengths.reduce((a,b)=>a+b,0);if(total<24)return null; + const count=strokes.map((s,i)=>Math.max(4,Math.floor(lengths[i]/total*64)));while(count.reduce((a,b)=>a+b,0)<64)count[lengths.indexOf(Math.max(...lengths))]++;while(count.reduce((a,b)=>a+b,0)>64){const i=count.indexOf(Math.max(...count));count[i]--;} + const points=[];strokes.forEach((s,k)=>{let cursor=1,distance=0;const step=lengths[k]/(count[k]-1);for(let i=0;in+p.x,0)/64,cy=points.reduce((n,p)=>n+p.y,0)/64;for(const p of points){p.x-=cx;p.y-=cy;}const first=strokes[0][0],last=strokes.at(-1).at(-1);let hx=0,hy=0;for(const stroke of strokes){hx+=(stroke.at(-1).x-stroke[0].x)/scale;hy+=(stroke.at(-1).y-stroke[0].y)/scale;}const xx=points.reduce((n,p)=>n+p.x*p.x,0),yy=points.reduce((n,p)=>n+p.y*p.y,0),xy=points.reduce((n,p)=>n+p.x*p.y,0),linear=(xx+yy+Math.hypot(xx-yy,2*xy))/(2*(xx+yy||1))>.98;return {points,heading:{x:hx,y:hy},linear,strokeCount:strokes.length,closed:strokes.length===1&&Math.hypot(first.x-last.x,first.y-last.y)/scale<.22}; +} +function cloudDistance(a,b,start){const used=Array(64).fill(false);let sum=0;for(let n=0;n<64;n++){const p=a[(start+n)%64];let best=-1,distance=Infinity;for(let j=0;j<64;j++){if(used[j])continue;const d=Math.hypot(p.x-b[j].x,p.y-b[j].y);if(d.25&&bn>.25){const cosine=(a.x*b.x+a.y*b.y)/(an*bn);score=cosine<.2?0:Math.max(0,score-(1-cosine)*.12);}}ranking.push({...rule,score});}return ranking.sort((a,b)=>b.score-a.score)} +function matchShape(strokes,rules,threshold=.75){const best=rankShapes(strokes,rules)[0];return best&&best.score>=threshold?best:null} + +globalThis.skkModel={defaults,validate,recognize,hit,upgrade,wheelHit,captureTrigger,gestureIssue,validShape,normalizeShape,patternStrokes,rankShapes,matchShape}; +})(); \ No newline at end of file diff --git a/plugins/ztools-shukuaikuai/public/pipe.cjs b/plugins/ztools-shukuaikuai/public/pipe.cjs new file mode 100644 index 000000000..5807a58dc --- /dev/null +++ b/plugins/ztools-shukuaikuai/public/pipe.cjs @@ -0,0 +1,3 @@ +'use strict'; +function createPipe(input,onError){let failed=false;function fail(error){if(!failed){failed=true;onError(error)}}input.on('error',fail);return {send(message){if(failed||!input.writable)return false;try{input.write(JSON.stringify(message)+'\n',error=>{if(error)fail(error)});return true}catch(error){fail(error);return false}}}} +module.exports={createPipe}; diff --git a/plugins/ztools-shukuaikuai/public/plugin.json b/plugins/ztools-shukuaikuai/public/plugin.json new file mode 100644 index 000000000..ed59fd137 --- /dev/null +++ b/plugins/ztools-shukuaikuai/public/plugin.json @@ -0,0 +1,43 @@ +{ + "name": "ztools-shukuaikuai", + "title": "鼠快快", + "version": "0.5.9", + "description": "一划一点,快捷随手。自定义鼠标轮盘与手势工具。", + "main": "index.html", + "preload": "preload.cjs", + "logo": "logo-mouse.png", + "platform": [ + "win32" + ], + "pluginSetting": { + "backgroundRunning": true + }, + "features": [ + { + "code": "settings", + "explain": "设置轮盘、鼠标手势与快捷动作", + "cmds": [ + "鼠快快", + "鼠标轮盘", + "鼠标手势", + "鼠快快设置" + ] + }, + { + "code": "pause", + "explain": "暂停鼠快快", + "cmds": [ + "暂停鼠快快" + ] + }, + { + "code": "start", + "explain": "启用鼠快快", + "cmds": [ + "启用鼠快快" + ] + } + ], + "author": "jiang66-so", + "homepage": "https://github.com/jiang66-so/ztools-shukuaikuai" +} diff --git a/plugins/ztools-shukuaikuai/public/preload.cjs b/plugins/ztools-shukuaikuai/public/preload.cjs new file mode 100644 index 000000000..10aad20ba --- /dev/null +++ b/plugins/ztools-shukuaikuai/public/preload.cjs @@ -0,0 +1,48 @@ +'use strict'; +const {spawn}=require('node:child_process'); +const {join}=require('node:path'); +const fs=require('node:fs'); +const {createInterface}=require('node:readline'); +const core=require('./core.cjs'); +const {createPipe}=require('./pipe.cjs'); +let child=null,pipe=null,nativeReady=false,config=null,file=null,prefsFile=null; +let paused=false,settingsVisible=true,status='正在初始化',lastError=''; +const listeners=new Set();let resolveReady;const ready=new Promise(resolve=>resolveReady=resolve); +function emit(){for(const fn of listeners)try{fn({paused,status,lastError,running:!!child})}catch{}} +function send(message){return pipe?.send(message)||false} +function persistPause(){fs.mkdirSync(require('node:path').dirname(prefsFile),{recursive:true});fs.writeFileSync(prefsFile+'.tmp',JSON.stringify({paused}));fs.renameSync(prefsFile+'.tmp',prefsFile)} +function applySaved(){send({op:'configure',config,paused,settingsVisible,hostPid:process.ppid})} +function start(){ + if(child)return;const proc=spawn(join(__dirname,'native','MouseService.exe'),process.env?.SK_MOUSE_TEST==='1'?['--integration']:[],{stdio:['pipe','pipe','pipe'],windowsHide:true});child=proc;nativeReady=false; + pipe=createPipe(proc.stdin,error=>{if(child===proc){lastError=error.message;status='不可用';paused=true;emit()}});status='正在启动';emit(); + createInterface({input:proc.stdout}).on('line',line=>{try{const message=JSON.parse(line);status=message.message;if(message.kind==='error')lastError=message.message;else if(message.kind==='status'){lastError='';nativeReady=true;}if(message.kind==='ready')applySaved();emit()}catch{}}); + proc.stderr.on('data',()=>{});proc.on('error',error=>{lastError=error.message;status='不可用';emit()}); + proc.on('exit',()=>{if(child===proc){child=null;pipe=null;nativeReady=false;status='已停止';emit()}}); +} +function stopChild(){const proc=child;if(!proc)return;send({op:'stop'});setTimeout(()=>{if(child===proc)proc.kill()},1500)} +window.skk={ + subscribe(fn){listeners.add(fn);emit();return()=>listeners.delete(fn)}, + async snapshot(){await ready;return {config:structuredClone(config),paused,status,lastError,running:!!child}}, + async save(draft){await ready;const errors=core.validate(draft);if(errors.length)throw Error(errors.join(';'));const next=core.upgrade(draft);core.saveAtomic(file,next);config=next;applySaved();return true}, + async pause(value){await ready;paused=!!value;persistPause();if(!child)start();send({op:'pause',value:paused});status=paused?'已暂停':'运行中';emit()}, + async activate(){await ready;paused=false;persistPause();if(!child)start();applySaved();await window.ztools.hideMainWindow(true);emit()}, + async stop(){await ready;paused=true;persistPause();stopChild();emit()}, + async testGesture(strokes){await ready;const ranking=core.rankShapes(strokes,config.gestures),threshold=config.gesture.shapeThreshold;return {matched:!!ranking[0]&&ranking[0].score>=threshold,closest:ranking[0]?{name:ranking[0].name,score:ranking[0].score}:null,threshold}}, + async test(id){await ready;if(!config.actions.some(a=>a.id===id))throw Error('动作不存在');if(!child)start();for(let i=0;!nativeReady&&i<100;i++)await new Promise(r=>setTimeout(r,50));if(!nativeReady)throw Error('后台服务未就绪');const hidden=await window.ztools.hideMainWindow(true);if(hidden===false)throw Error('无法切换到原窗口');await new Promise(r=>setTimeout(r,180));if(!send({op:'test',id}))throw Error('后台服务不可用')}, + validate:core.validate,recognize:core.recognize,defaults:core.defaults, + async choose(kind){await ready;const properties=kind==='folder'?['openDirectory']:['openFile'];const result=await window.ztools.showOpenDialog({properties});return Array.isArray(result)?result[0]:result?.filePaths?.[0]}, + async export(){await ready;const result=await window.ztools.showSaveDialog({defaultPath:'鼠快快配置.json',filters:[{name:'JSON',extensions:['json']}]});const target=typeof result==='string'?result:result?.filePath;if(target)fs.writeFileSync(target,JSON.stringify(config,null,2));return !!target}, + async import(){await ready;const result=await window.ztools.showOpenDialog({properties:['openFile'],filters:[{name:'JSON',extensions:['json']}]});const path=Array.isArray(result)?result[0]:result?.filePaths?.[0];if(!path)return null;if(fs.statSync(path).size>2e6)throw Error('配置文件过大');const draft=JSON.parse(fs.readFileSync(path,'utf8')),errors=core.validate(draft);if(errors.length)throw Error(errors.join(';'));return core.upgrade(draft)} +}; +function init(){ + if(!window.ztools){setTimeout(init,40);return}const api=window.ztools; + try{ + const root=join(api.getPath('userData'),'shukuaikuai');file=join(root,'config.json');prefsFile=join(root,'runtime.json');config=core.loadSafe(file); + try{paused=JSON.parse(fs.readFileSync(prefsFile,'utf8')).paused===true}catch{paused=false} + start(); + api.onPluginEnter(async param=>{settingsVisible=true;send({op:'settings-visible',value:true,hostPid:process.ppid});if(param.code==='start')await window.skk.activate();else if(param.code==='pause')await window.skk.pause(true);else{status=paused?'已暂停':'运行中(使用已保存配置)';emit()}}); + api.onPluginOut(killed=>{settingsVisible=false;send({op:'settings-visible',value:false,hostPid:process.ppid});if(killed)stopChild()}); + api.onThemeChange?.(theme=>{document.documentElement.dataset.theme=theme.isDark?'dark':'light'});resolveReady();emit(); + }catch(error){lastError=error.message;status='初始化失败';emit();resolveReady()} +} +window.addEventListener('beforeunload',stopChild);init(); diff --git a/plugins/ztools-shukuaikuai/screenshots/actions.png b/plugins/ztools-shukuaikuai/screenshots/actions.png new file mode 100644 index 000000000..d68f90f05 Binary files /dev/null and b/plugins/ztools-shukuaikuai/screenshots/actions.png differ diff --git a/plugins/ztools-shukuaikuai/screenshots/gestures.png b/plugins/ztools-shukuaikuai/screenshots/gestures.png new file mode 100644 index 000000000..1638561c0 Binary files /dev/null and b/plugins/ztools-shukuaikuai/screenshots/gestures.png differ diff --git a/plugins/ztools-shukuaikuai/screenshots/wheel.png b/plugins/ztools-shukuaikuai/screenshots/wheel.png new file mode 100644 index 000000000..6cee1237d Binary files /dev/null and b/plugins/ztools-shukuaikuai/screenshots/wheel.png differ diff --git a/plugins/ztools-shukuaikuai/scripts/build-native.mjs b/plugins/ztools-shukuaikuai/scripts/build-native.mjs new file mode 100644 index 000000000..e7e12b9e5 --- /dev/null +++ b/plugins/ztools-shukuaikuai/scripts/build-native.mjs @@ -0,0 +1,2 @@ +import {execFileSync} from 'node:child_process';import {mkdirSync} from 'node:fs';import {resolve} from 'node:path'; +mkdirSync('dist/plugin/native',{recursive:true});const csc=process.env.WINDIR+'\\Microsoft.NET\\Framework64\\v4.0.30319\\csc.exe';execFileSync(csc,['/nologo','/target:exe','/platform:x64','/optimize+','/reference:System.Windows.Forms.dll','/reference:System.Drawing.dll','/reference:System.Web.Extensions.dll','/out:'+resolve('dist/plugin/native/MouseService.exe'),resolve('native/MouseService.cs'),resolve('native/Overlay.cs'),resolve('native/ShapeRecognizer.cs')],{stdio:'inherit',windowsHide:true});execFileSync(resolve('dist/plugin/native/MouseService.exe'),['--self-test'],{stdio:'inherit',windowsHide:true}); diff --git a/plugins/ztools-shukuaikuai/scripts/clean.mjs b/plugins/ztools-shukuaikuai/scripts/clean.mjs new file mode 100644 index 000000000..8d2c9ae01 --- /dev/null +++ b/plugins/ztools-shukuaikuai/scripts/clean.mjs @@ -0,0 +1,3 @@ +// Kept as a non-destructive build-path check. Packaging selects current files explicitly. +import {existsSync,lstatSync} from 'node:fs';import {resolve,sep} from 'node:path'; +const root=resolve('.'),target=resolve('dist/plugin');if(!target.startsWith(root+sep)||target===root)throw Error('Unsafe build directory');if(existsSync(target)&&lstatSync(target).isSymbolicLink())throw Error('Build directory is a link'); diff --git a/plugins/ztools-shukuaikuai/scripts/package.mjs b/plugins/ztools-shukuaikuai/scripts/package.mjs new file mode 100644 index 000000000..825bb3555 --- /dev/null +++ b/plugins/ztools-shukuaikuai/scripts/package.mjs @@ -0,0 +1,3 @@ +import{zipSync}from'fflate';import{readFileSync,mkdirSync,writeFileSync}from'node:fs';import{join}from'node:path'; +// Only package declared runtime files and assets referenced by the current HTML. +const html=readFileSync('dist/plugin/index.html','utf8');const names=['index.html','plugin.json','preload.cjs','core.cjs','model.js','pipe.cjs','defaults.json','logo.png','logo-mouse.png','THIRD_PARTY_NOTICES.txt','native/MouseService.exe',...Array.from(html.matchAll(/(?:src|href)="\.\/(assets\/[^"?]+)"/g),m=>m[1])];const entries={};for(const name of names){if(name.includes('..')||name.startsWith('/'))throw Error('Unsafe package path');entries[name]=readFileSync(join('dist/plugin',name))}mkdirSync('artifacts',{recursive:true});const version=JSON.parse(readFileSync('package.json','utf8')).version;const file='artifacts/鼠快快-'+version+'.zip';writeFileSync(file,zipSync(entries));console.log(file,Object.keys(entries).length+' files'); diff --git a/plugins/ztools-shukuaikuai/scripts/prepare.mjs b/plugins/ztools-shukuaikuai/scripts/prepare.mjs new file mode 100644 index 000000000..ee525b44a --- /dev/null +++ b/plugins/ztools-shukuaikuai/scripts/prepare.mjs @@ -0,0 +1 @@ +import{readFileSync,writeFileSync}from'node:fs';import{createRequire}from'node:module';const require=createRequire(import.meta.url);const source=readFileSync('public/core.cjs','utf8');writeFileSync('public/model.js','(()=>{\n'+source.slice(0,source.indexOf('function saveAtomic'))+'\nglobalThis.skkModel={defaults,validate,recognize,hit,upgrade,wheelHit,captureTrigger,gestureIssue,validShape,normalizeShape,patternStrokes,rankShapes,matchShape};\n})();');const core=require('../public/core.cjs');writeFileSync('public/defaults.json',JSON.stringify(core.upgrade(core.defaults()))); diff --git a/plugins/ztools-shukuaikuai/scripts/publish-platform.mjs b/plugins/ztools-shukuaikuai/scripts/publish-platform.mjs new file mode 100644 index 000000000..4e1e26405 --- /dev/null +++ b/plugins/ztools-shukuaikuai/scripts/publish-platform.mjs @@ -0,0 +1,14 @@ +/** Quote the CLI's generated Git refs/paths for cmd.exe, rejecting shell expansion. */ +function quoteWindowsGitArgument(value) { + if (typeof value !== 'string' || /["%!\r\n\0]/.test(value)) throw new Error('Unsupported character in Windows Git argument') + // Windows argv parsing requires doubling backslashes immediately before the closing quote. + return '"' + value.replace(/\\+$/, tail => tail + tail) + '"' +} + +/** Fix CLI 1.3.2's POSIX-only shell quoting without changing its sync/protection logic. */ +export function adaptCliUpstream(source, platform = process.platform) { + if (platform !== 'win32') return source + const marker = 'function shellQuote(value) {' + if (!source.includes(marker)) throw new Error('CLI upstream quoting changed; inspect before publishing') + return source.replace(marker, `${marker}\n return (${quoteWindowsGitArgument.toString()})(value);`) +} diff --git a/plugins/ztools-shukuaikuai/scripts/publish.mjs b/plugins/ztools-shukuaikuai/scripts/publish.mjs new file mode 100644 index 000000000..a7692058c --- /dev/null +++ b/plugins/ztools-shukuaikuai/scripts/publish.mjs @@ -0,0 +1,58 @@ +import { execFileSync } from 'node:child_process' +import { registerHooks } from 'node:module' +import { homedir } from 'node:os' +import { join } from 'node:path' +import { existsSync, readFileSync } from 'node:fs' +import { adaptCliUpstream } from './publish-platform.mjs' + +// 复用用户已经登录的 GitHub CLI,不把凭据写入项目或 CLI 配置。 +const token = execFileSync('gh', ['auth', 'token'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] }).trim() +process.env.ZTOOLS_CONFIG_DIR ||= join(homedir(), '.config', 'ztools', 'shukuaikuai-market') +const cache = join(process.env.ZTOOLS_CONFIG_DIR, 'ZTools-plugins') +const write = process.stdout.write.bind(process.stdout) +const errorWrite = process.stderr.write.bind(process.stderr) +process.stdout.write = (chunk, ...args) => write(String(chunk).replaceAll(token, '[REDACTED]'), ...args) +process.stderr.write = (chunk, ...args) => errorWrite(String(chunk).replaceAll(token, '[REDACTED]'), ...args) +globalThis[Symbol.for('shukuaikuai-publish-token')] = token +registerHooks({ + resolve(specifier, context, next) { + if (specifier === './auth.js' && context.parentURL?.includes('/@ztools-center/plugin-cli/dist/')) return { url: 'shukuaikuai-auth:gh', shortCircuit: true } + return next(specifier, context) + }, + load(url, context, next) { + if (url.endsWith('/@ztools-center/plugin-cli/dist/upstream.js')) return { format: 'module', shortCircuit: true, source: adaptCliUpstream(readFileSync(new URL(url), 'utf8')) } + if (url === 'shukuaikuai-auth:gh') return { format: 'module', shortCircuit: true, source: 'export async function ensureAuth(){ return globalThis[Symbol.for("shukuaikuai-publish-token")] }' } + if (url.endsWith('/@ztools-center/plugin-cli/dist/github.js')) { + // Windows 当前网络下 Node HTTPS 直连失败;保留官方 API 业务逻辑,使用 gh 发送真实请求。 + let source = readFileSync(new URL(url), 'utf8') + const start = source.indexOf('function githubRequest(') + const end = source.indexOf('export async function getCurrentUser', start) + if (start < 0 || end < 0) throw new Error('CLI GitHub transport changed; inspect before publishing') + source = source.slice(0, start) + `async function githubRequest(path, accessToken, method = 'GET', body) { + const args = ['api', path, '--method', method]; + if (body !== undefined) args.push('--input', '-'); + const result = await import('node:child_process').then(({execFileSync}) => execFileSync('gh', args, { encoding: 'utf8', input: body === undefined ? undefined : JSON.stringify(body), stdio: ['pipe','pipe','pipe'] })); + return result.trim() ? JSON.parse(result) : null; + }\n` + source.slice(end) + return { format: 'module', shortCircuit: true, source } + } + return next(url, context) + } +}) +/** 移除发布缓存 remote URL 中的认证信息。 */ +function cleanCredentialURL() { + if (!existsSync(join(cache, '.git'))) return + try { + const url = execFileSync('git', ['remote', 'get-url', 'origin'], { cwd: cache, encoding: 'utf8' }).trim() + execFileSync('git', ['remote', 'set-url', 'origin', url.replace(/https:\/\/[^/]*@github\.com\//, 'https://github.com/')], { cwd: cache, stdio: 'ignore' }) + } catch { /* 不让清理错误遮蔽发布失败原因。 */ } +} +process.once('exit', cleanCredentialURL) +try { + const { publish } = await import('@ztools-center/plugin-cli/dist/publish.js') + await publish() +} finally { + // 官方 CLI 会将认证 URL 写入缓存 remote;完成后移除其中的凭据。 + cleanCredentialURL() + delete globalThis[Symbol.for('shukuaikuai-publish-token')] +} diff --git a/plugins/ztools-shukuaikuai/src/App.vue b/plugins/ztools-shukuaikuai/src/App.vue new file mode 100644 index 000000000..ef13f3b0e --- /dev/null +++ b/plugins/ztools-shukuaikuai/src/App.vue @@ -0,0 +1,77 @@ + +