diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 9dd8e8ea5..bc15cca0a 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -46,7 +46,7 @@ Hi! We, the maintainers, are really excited that you are interested in contribut First, [join our Discord server](https://discord.gg/SpmNs4S) and let us know that you want to contribute. This way we can point you in the right direction and help ensure your contribution will be as helpful as possible. -To set up your machine for development, follow the [Tauri setup guide](https://tauri.studio/en/docs/getting-started/intro#setting-up-your-environment) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [Yarn](https://yarnpkg.com/), it is only required if you are developing the Node CLI/API (`tooling/cli.js` and `api`). Next, fork and clone this repo. It is structured as a monorepo, which means that all the various Tauri packages are under the same repository. The development process varies depending on what part of Tauri you are contributing to, see the guides below for per-package instructions. +To set up your machine for development, follow the [Tauri setup guide](https://tauri.studio/en/docs/get-started/intro#setting-up-your-environment) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [Yarn](https://yarnpkg.com/), it is only required if you are developing the Node CLI/API (`tooling/cli.js` and `api`). Next, fork and clone this repo. It is structured as a monorepo, which means that all the various Tauri packages are under the same repository. The development process varies depending on what part of Tauri you are contributing to, see the guides below for per-package instructions. Some Tauri packages will be automatically built when running one of the examples. Others, however, will need to be built beforehand. To build these automatically, run the `.scripts/setup.sh` (Linux and macOS) or `.scripts/setup.ps1` (Windows) script. This will install the Rust and Node.js CLI and build the JS API. After that, you should be able to run all the examples. Note that the setup script should be executed from the root folder of the respository in order to run correctly. diff --git a/README.md b/README.md index a7cef0dd3..06b2835f1 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Chat Server](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/SpmNs4S) [![devto](https://img.shields.io/badge/blog-dev.to-black.svg)](https://dev.to/tauri) -[![devto](https://img.shields.io/badge/documentation-tauri.studio-purple.svg)](https://tauri.studio/docs/getting-started/intro) +[![devto](https://img.shields.io/badge/documentation-tauri.studio-purple.svg)](https://tauri.studio/docs/get-started/intro) [![https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg](https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg)](https://good-labs.github.io/greater-good-affirmation) [![support](https://img.shields.io/badge/sponsor-open%20collective-blue.svg)](https://opencollective.com/tauri) diff --git a/examples/api/dist/assets/index.ab727ab4.js b/examples/api/dist/assets/index.cbdca1f1.js similarity index 99% rename from examples/api/dist/assets/index.ab727ab4.js rename to examples/api/dist/assets/index.cbdca1f1.js index b56112855..3c2e92f02 100644 --- a/examples/api/dist/assets/index.ab727ab4.js +++ b/examples/api/dist/assets/index.cbdca1f1.js @@ -19,7 +19,7 @@ var Yl=Object.defineProperty,Ql=Object.defineProperties;var Zl=Object.getOwnProp `),de=a("input"),yn=g(),Ae=a("div"),vt=a("div"),Cn=M(`Max width `),se=a("input"),Mn=g(),_t=a("div"),Tn=M(`Max height `),oe=a("input"),Ht=g(),le=a("div"),Ue=a("div"),fe=a("div"),Rt=a("div"),Rt.textContent="Inner Size",Sn=g(),De=a("span"),Ln=M("Width: "),Dt=M(bt),En=g(),je=a("span"),zn=M("Height: "),jt=M(wt),On=g(),he=a("div"),Bt=a("div"),Bt.textContent="Outer Size",Pn=g(),Be=a("span"),An=M("Width: "),Ft=M(kt),Un=g(),Fe=a("span"),Wn=M("Height: "),Gt=M(yt),Nn=g(),We=a("div"),ge=a("div"),Vt=a("div"),Vt.textContent="Inner Logical Size",In=g(),Ge=a("span"),qn=M("Width: "),Jt=M(Ct),Hn=g(),Ve=a("span"),Rn=M("Height: "),Kt=M(Mt),Dn=g(),me=a("div"),Xt=a("div"),Xt.textContent="Outer Logical Size",jn=g(),Je=a("span"),Bn=M("Width: "),Yt=M(Tt),Fn=g(),Ke=a("span"),Gn=M("Height: "),Qt=M(St),Vn=g(),Ne=a("div"),ve=a("div"),Zt=a("div"),Zt.textContent="Inner Position",Jn=g(),Xe=a("span"),Kn=M("x: "),$t=M(Lt),Xn=g(),Ye=a("span"),Yn=M("y: "),xt=M(Et),Qn=g(),_e=a("div"),en=a("div"),en.textContent="Outer Position",Zn=g(),Qe=a("span"),$n=M("x: "),tn=M(zt),xn=g(),Ze=a("span"),el=M("y: "),nn=M(Ot),tl=g(),Ie=a("div"),be=a("div"),ln=a("div"),ln.textContent="Inner Logical Position",nl=g(),$e=a("span"),ll=M("x: "),sn=M(Pt),il=g(),xe=a("span"),sl=M("y: "),on=M(At),ol=g(),we=a("div"),an=a("div"),an.textContent="Outer Logical Position",al=g(),et=a("span"),ul=M("x: "),un=M(Ut),rl=g(),tt=a("span"),cl=M("y: "),rn=M(Wt),cn=g(),ke=a("form"),Me=a("input"),pl=g(),nt=a("button"),nt.textContent="Set title",pn=g(),ye=a("form"),Te=a("input"),dl=g(),lt=a("button"),lt.textContent="Open URL",dn=g(),Se=a("button"),Se.textContent="Request attention",fn=g(),qe=a("button"),qe.textContent="New window",u(i,"class","button"),n[0]===void 0&&Ml(()=>n[31].call(i)),u(c,"type","checkbox"),u(w,"type","checkbox"),u(p,"title","Unminimizes after 2 seconds"),u(k,"title","Unminimizes after 2 seconds"),u(T,"title","Visible again after 2 seconds"),u(W,"type","checkbox"),u(j,"type","checkbox"),u(U,"type","checkbox"),u(ue,"type","checkbox"),u($,"type","number"),u($,"min","0"),u($,"class","svelte-12ggtr4"),u(x,"type","number"),u(x,"min","0"),u(x,"class","svelte-12ggtr4"),u(re,"class","flex col grow svelte-12ggtr4"),u(ee,"type","number"),u(ee,"min","400"),u(ee,"class","svelte-12ggtr4"),u(te,"type","number"),u(te,"min","400"),u(te,"class","svelte-12ggtr4"),u(ce,"class","flex col grow svelte-12ggtr4"),u(pe,"type","number"),u(pe,"class","svelte-12ggtr4"),u(de,"type","number"),u(de,"class","svelte-12ggtr4"),u(q,"class","flex col grow svelte-12ggtr4"),u(se,"type","number"),u(se,"min","400"),u(se,"class","svelte-12ggtr4"),u(oe,"type","number"),u(oe,"min","400"),u(oe,"class","svelte-12ggtr4"),u(Ae,"class","flex col grow svelte-12ggtr4"),u(Q,"class","window-controls flex flex-row svelte-12ggtr4"),u(t,"class","flex col"),u(De,"class","svelte-12ggtr4"),u(je,"class","svelte-12ggtr4"),u(fe,"class","grow window-property svelte-12ggtr4"),u(Be,"class","svelte-12ggtr4"),u(Fe,"class","svelte-12ggtr4"),u(he,"class","grow window-property svelte-12ggtr4"),u(Ue,"class","flex"),u(Ge,"class","svelte-12ggtr4"),u(Ve,"class","svelte-12ggtr4"),u(ge,"class","grow window-property svelte-12ggtr4"),u(Je,"class","svelte-12ggtr4"),u(Ke,"class","svelte-12ggtr4"),u(me,"class","grow window-property svelte-12ggtr4"),u(We,"class","flex"),u(Xe,"class","svelte-12ggtr4"),u(Ye,"class","svelte-12ggtr4"),u(ve,"class","grow window-property svelte-12ggtr4"),u(Qe,"class","svelte-12ggtr4"),u(Ze,"class","svelte-12ggtr4"),u(_e,"class","grow window-property svelte-12ggtr4"),u(Ne,"class","flex"),u($e,"class","svelte-12ggtr4"),u(xe,"class","svelte-12ggtr4"),u(be,"class","grow window-property svelte-12ggtr4"),u(et,"class","svelte-12ggtr4"),u(tt,"class","svelte-12ggtr4"),u(we,"class","grow window-property svelte-12ggtr4"),u(Ie,"class","flex"),u(Me,"id","title"),u(nt,"class","button"),u(nt,"type","submit"),ae(ke,"margin-top","24px"),u(Te,"id","url"),u(lt,"class","button"),u(lt,"id","open-url"),ae(ye,"margin-top","24px"),u(Se,"class","button"),u(Se,"title","Minimizes the window, requests attention for 3s and then resets it"),u(qe,"class","button")},m(b,z){S(b,t,z),e(t,i);for(let B=0;B{i(20,j=q),i(7,p=j.width),i(8,f=j.height)}),s[l].outerSize().then(q=>{i(21,D=q)})}function at(){s[l].innerPosition().then(q=>{i(18,E=q)}),s[l].outerPosition().then(q=>{i(19,I=q),i(13,P=I.x),i(14,W=I.y)})}async function Re(q){X&&X(),Z&&Z(),Z=await q.listen("tauri://move",at),X=await q.listen("tauri://resize",Le)}async function Q(){await s[l].minimize(),await s[l].requestUserAttention(Ll.Critical),await new Promise(q=>setTimeout(q,3e3)),await s[l].requestUserAttention(null)}function re(){l=Sl(this),i(0,l),i(1,s)}function Ee(){r=this.checked,i(2,r)}function ut(){m=this.checked,i(3,m)}const $=()=>s[l].center();function rt(){h=this.checked,i(16,h)}function ze(){w=this.checked,i(4,w)}function ct(){v=this.checked,i(5,v)}function x(){d=this.checked,i(6,d)}function pt(){P=F(this.value),i(13,P)}function ce(){W=F(this.value),i(14,W)}function Oe(){p=F(this.value),i(7,p)}function dt(){f=F(this.value),i(8,f)}function ee(){k=F(this.value),i(9,k)}function ft(){_=F(this.value),i(10,_)}function Pe(){T=F(this.value),i(11,T)}function ht(){C=F(this.value),i(12,C)}function te(){U=this.value,i(22,U)}function gt(){c=this.value,i(15,c)}return n.$$set=q=>{"onMessage"in q&&i(30,o=q.onMessage)},n.$$.update=()=>{n.$$.dirty[0]&7&&s[l].setResizable(r),n.$$.dirty[0]&11&&(m?s[l].maximize():s[l].unmaximize()),n.$$.dirty[0]&19&&s[l].setDecorations(w),n.$$.dirty[0]&35&&s[l].setAlwaysOnTop(v),n.$$.dirty[0]&67&&s[l].setFullscreen(d),n.$$.dirty[0]&387&&s[l].setSize(new _n(p,f)),n.$$.dirty[0]&1539&&(k&&_?s[l].setMinSize(new zl(k,_)):s[l].setMinSize(null)),n.$$.dirty[0]&6147&&(T&&C?s[l].setMaxSize(new zl(T,C)):s[l].setMaxSize(null)),n.$$.dirty[0]&24579&&s[l].setPosition(new vn(P,W)),n.$$.dirty[0]&3&&s[l].scaleFactor().then(q=>i(17,A=q)),n.$$.dirty[0]&3&&Re(s[l])},[l,s,r,m,w,v,d,p,f,k,_,T,C,P,W,c,h,A,E,I,j,D,U,ne,H,ie,ue,st,ot,Q,o,re,Ee,ut,$,rt,ze,ct,x,pt,ce,Oe,dt,ee,ft,Pe,ht,te,gt]}class Zi extends G{constructor(t){super();V(this,t,Qi,Yi,J,{onMessage:30},[-1,-1])}}function Fl(n,t,i){const l=n.slice();return l[9]=t[i],l}function Gl(n){let t,i=n[9]+"",l,s,o,c,r;function m(){return n[8](n[9])}return{c(){t=a("div"),l=M(i),s=g(),o=a("button"),o.textContent="Unregister",u(o,"type","button")},m(h,w){S(h,t,w),e(t,l),e(t,s),e(t,o),c||(r=y(o,"click",m),c=!0)},p(h,w){n=h,w&2&&i!==(i=n[9]+"")&&R(l,i)},d(h){h&&L(t),c=!1,r()}}}function Vl(n){let t,i,l;return{c(){t=a("button"),t.textContent="Unregister all",u(t,"type","button")},m(s,o){S(s,t,o),i||(l=y(t,"click",n[5]),i=!0)},p:N,d(s){s&&L(t),i=!1,l()}}}function $i(n){let t,i,l,s,o,c,r,m,h,w,v=n[1],d=[];for(let f=0;fi(1,l=d));let c="CmdOrControl+X";function r(){const d=c;fi(d,()=>{s(`Shortcut ${d} triggered`)}).then(()=>{o.update(p=>[...p,d]),s(`Shortcut ${d} registered successfully`)}).catch(s)}function m(d){const p=d;hi(p).then(()=>{o.update(f=>f.filter(k=>k!==p)),s(`Shortcut ${p} unregistered`)}).catch(s)}function h(){gi().then(()=>{o.update(()=>[]),s("Unregistered all shortcuts")}).catch(s)}function w(){c=this.value,i(0,c)}const v=d=>m(d);return n.$$set=d=>{"onMessage"in d&&i(6,s=d.onMessage)},[c,l,o,r,m,h,s,w,v]}class es extends G{constructor(t){super();V(this,t,xi,$i,J,{onMessage:6})}}function Jl(n){let t,i,l,s,o;return{c(){t=a("input"),i=g(),l=a("button"),l.textContent="Write",u(t,"placeholder","write to stdin"),u(l,"class","button")},m(c,r){S(c,t,r),O(t,n[3]),S(c,i,r),S(c,l,r),s||(o=[y(t,"input",n[10]),y(l,"click",n[7])],s=!0)},p(c,r){r&8&&t.value!==c[3]&&O(t,c[3])},d(c){c&&L(t),c&&L(i),c&&L(l),s=!1,Y(o)}}}function ts(n){let t,i,l,s,o,c,r,m,h,w,v,d,p,f,k,_=n[4]&&Jl(n);return{c(){t=a("div"),i=a("div"),l=a("input"),s=g(),o=a("button"),o.textContent="Run",c=g(),r=a("button"),r.textContent="Kill",m=g(),_&&_.c(),h=g(),w=a("div"),v=a("input"),d=g(),p=a("input"),u(o,"class","button"),u(r,"class","button"),u(v,"placeholder","Working directory"),u(p,"placeholder","Environment variables"),ae(p,"width","300px")},m(T,C){S(T,t,C),e(t,i),e(i,l),O(l,n[0]),e(i,s),e(i,o),e(i,c),e(i,r),e(i,m),_&&_.m(i,null),e(t,h),e(t,w),e(w,v),O(v,n[1]),e(w,d),e(w,p),O(p,n[2]),f||(k=[y(l,"input",n[9]),y(o,"click",n[5]),y(r,"click",n[6]),y(v,"input",n[11]),y(p,"input",n[12])],f=!0)},p(T,[C]){C&1&&l.value!==T[0]&&O(l,T[0]),T[4]?_?_.p(T,C):(_=Jl(T),_.c(),_.m(i,null)):_&&(_.d(1),_=null),C&2&&v.value!==T[1]&&O(v,T[1]),C&4&&p.value!==T[2]&&O(p,T[2])},i:N,o:N,d(T){T&&L(t),_&&_.d(),f=!1,Y(k)}}}function ns(n,t,i){const l=navigator.userAgent.includes("Windows");let s=l?"cmd":"sh",o=l?["/C"]:["-c"],{onMessage:c}=t,r='echo "hello world"',m=null,h="SOMETHING=value ANOTHER=2",w="",v;function d(){return h.split(" ").reduce((W,A)=>{let[E,I]=A.split("=");return _l(vl({},W),{[E]:I})},{})}function p(){i(4,v=null);const W=new mi(s,[...o,r],{cwd:m||null,env:d()});W.on("close",A=>{c(`command finished with code ${A.code} and signal ${A.signal}`),i(4,v=null)}),W.on("error",A=>c(`command error: "${A}"`)),W.stdout.on("data",A=>c(`command stdout: "${A}"`)),W.stderr.on("data",A=>c(`command stderr: "${A}"`)),W.spawn().then(A=>{i(4,v=A)}).catch(c)}function f(){v.kill().then(()=>c("killed child process")).catch(c)}function k(){v.write(w).catch(c)}function _(){r=this.value,i(0,r)}function T(){w=this.value,i(3,w)}function C(){m=this.value,i(1,m)}function P(){h=this.value,i(2,h)}return n.$$set=W=>{"onMessage"in W&&i(8,c=W.onMessage)},[r,m,h,w,v,p,f,k,c,_,T,C,P]}class ls extends G{constructor(t){super();V(this,t,ns,ts,J,{onMessage:8})}}function is(n){let t,i,l,s,o,c;return{c(){t=a("div"),i=a("button"),i.textContent="Check update",l=g(),s=a("button"),s.textContent="Install update",u(i,"class","button"),u(i,"id","check_update"),u(s,"class","button hidden"),u(s,"id","start_update")},m(r,m){S(r,t,m),e(t,i),e(t,l),e(t,s),o||(c=[y(i,"click",n[0]),y(s,"click",n[1])],o=!0)},p:N,i:N,o:N,d(r){r&&L(t),o=!1,Y(c)}}}function ss(n,t,i){let{onMessage:l}=t,s;it(async()=>{s=await wl("tauri://update-status",l)}),gn(()=>{s&&s()});async function o(){try{document.getElementById("check_update").classList.add("hidden");const{shouldUpdate:r,manifest:m}=await vi();l(`Should update: ${r}`),l(m),r&&document.getElementById("start_update").classList.remove("hidden")}catch(r){l(r)}}async function c(){try{document.getElementById("start_update").classList.add("hidden"),await _i(),l("Installation complete, restart required."),await bl()}catch(r){l(r)}}return n.$$set=r=>{"onMessage"in r&&i(2,l=r.onMessage)},[o,c,l]}class os extends G{constructor(t){super();V(this,t,ss,is,J,{onMessage:2})}}function as(n){let t,i,l,s,o,c,r,m,h;return{c(){t=a("div"),i=a("div"),l=a("input"),s=g(),o=a("button"),o.textContent="Write",c=g(),r=a("button"),r.textContent="Read",u(l,"placeholder","Text to write to the clipboard"),u(o,"type","button"),u(r,"type","button")},m(w,v){S(w,t,v),e(t,i),e(i,l),O(l,n[0]),e(i,s),e(i,o),e(t,c),e(t,r),m||(h=[y(l,"input",n[4]),y(o,"click",n[1]),y(r,"click",n[2])],m=!0)},p(w,[v]){v&1&&l.value!==w[0]&&O(l,w[0])},i:N,o:N,d(w){w&&L(t),m=!1,Y(h)}}}function us(n,t,i){let{onMessage:l}=t,s="clipboard message";function o(){bi(s).then(()=>{l("Wrote to the clipboard")}).catch(l)}function c(){wi().then(m=>{l(`Clipboard contents: ${m}`)}).catch(l)}function r(){s=this.value,i(0,s)}return n.$$set=m=>{"onMessage"in m&&i(3,l=m.onMessage)},[s,o,c,l,r]}class rs extends G{constructor(t){super();V(this,t,us,as,J,{onMessage:3})}}function cs(n){let t;return{c(){t=a("div"),t.innerHTML=`

Not available for Linux

- `},m(i,l){S(i,t,l)},p:N,i:N,o:N,d(i){i&&L(t)}}}function ps(n,t,i){let{onMessage:l}=t;const s=window.constraints={audio:!0,video:!0};function o(r){const m=document.querySelector("video"),h=r.getVideoTracks();l("Got stream with constraints:",s),l(`Using video device: ${h[0].label}`),window.stream=r,m.srcObject=r}function c(r){if(r.name==="ConstraintNotSatisfiedError"){const m=s.video;l(`The resolution ${m.width.exact}x${m.height.exact} px is not supported by your device.`)}else r.name==="PermissionDeniedError"&&l("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");l(`getUserMedia error: ${r.name}`,r)}return it(async()=>{try{const r=await navigator.mediaDevices.getUserMedia(s);o(r)}catch(r){c(r)}}),gn(()=>{window.stream.getTracks().forEach(function(r){r.stop()})}),n.$$set=r=>{"onMessage"in r&&i(0,l=r.onMessage)},[l]}class ds extends G{constructor(t){super();V(this,t,ps,cs,J,{onMessage:0})}}function fs(n){let t,i,l,s,o,c,r,m,h,w,v,d;return{c(){t=a("input"),i=g(),l=a("input"),s=g(),o=a("button"),o.textContent="Post it.",c=g(),r=a("p"),r.textContent="Result:",m=g(),h=a("pre"),w=M(n[2]),u(o,"type","button")},m(p,f){S(p,t,f),O(t,n[0]),S(p,i,f),S(p,l,f),O(l,n[1]),S(p,s,f),S(p,o,f),S(p,c,f),S(p,r,f),S(p,m,f),S(p,h,f),e(h,w),v||(d=[y(t,"input",n[4]),y(l,"input",n[5]),y(o,"click",n[3])],v=!0)},p(p,[f]){f&1&&t.value!==p[0]&&O(t,p[0]),f&2&&l.value!==p[1]&&O(l,p[1]),f&4&&R(w,p[2])},i:N,o:N,d(p){p&&L(t),p&&L(i),p&&L(l),p&&L(s),p&&L(o),p&&L(c),p&&L(r),p&&L(m),p&&L(h),v=!1,Y(d)}}}function hs(n,t,i){let l="baz",s="qux",o=null;async function c(){let h=navigator.userAgent.includes("Windows")?"https://customprotocol.test/example.html":"customprotocol://test/example.html";const v=await(await fetch(h,{method:"POST",body:JSON.stringify({foo:l,bar:s})})).json();i(2,o=JSON.stringify(v))}function r(){l=this.value,i(0,l)}function m(){s=this.value,i(1,s)}return[l,s,o,c,r,m]}class gs extends G{constructor(t){super();V(this,t,hs,fs,J,{})}}function Kl(n,t,i){const l=n.slice();return l[9]=t[i],l}function Xl(n){let t,i=n[9].label+"",l,s,o,c,r;function m(){return n[7](n[9])}return{c(){t=a("p"),l=M(i),s=g(),u(t,"class",o="nv noselect "+(n[0]===n[9]?"nv_selected":""))},m(h,w){S(h,t,w),e(t,l),e(t,s),c||(r=y(t,"click",m),c=!0)},p(h,w){n=h,w&1&&o!==(o="nv noselect "+(n[0]===n[9]?"nv_selected":""))&&u(t,"class",o)},d(h){h&&L(t),c=!1,r()}}}function ms(n){let t,i,l,s,o,c,r,m,h,w,v,d,p,f,k,_,T,C,P,W,A,E,I,j=n[2],D=[];for(let U=0;UDocumentation + `},m(i,l){S(i,t,l)},p:N,i:N,o:N,d(i){i&&L(t)}}}function ps(n,t,i){let{onMessage:l}=t;const s=window.constraints={audio:!0,video:!0};function o(r){const m=document.querySelector("video"),h=r.getVideoTracks();l("Got stream with constraints:",s),l(`Using video device: ${h[0].label}`),window.stream=r,m.srcObject=r}function c(r){if(r.name==="ConstraintNotSatisfiedError"){const m=s.video;l(`The resolution ${m.width.exact}x${m.height.exact} px is not supported by your device.`)}else r.name==="PermissionDeniedError"&&l("Permissions have not been granted to use your camera and microphone, you need to allow the page access to your devices in order for the demo to work.");l(`getUserMedia error: ${r.name}`,r)}return it(async()=>{try{const r=await navigator.mediaDevices.getUserMedia(s);o(r)}catch(r){c(r)}}),gn(()=>{window.stream.getTracks().forEach(function(r){r.stop()})}),n.$$set=r=>{"onMessage"in r&&i(0,l=r.onMessage)},[l]}class ds extends G{constructor(t){super();V(this,t,ps,cs,J,{onMessage:0})}}function fs(n){let t,i,l,s,o,c,r,m,h,w,v,d;return{c(){t=a("input"),i=g(),l=a("input"),s=g(),o=a("button"),o.textContent="Post it.",c=g(),r=a("p"),r.textContent="Result:",m=g(),h=a("pre"),w=M(n[2]),u(o,"type","button")},m(p,f){S(p,t,f),O(t,n[0]),S(p,i,f),S(p,l,f),O(l,n[1]),S(p,s,f),S(p,o,f),S(p,c,f),S(p,r,f),S(p,m,f),S(p,h,f),e(h,w),v||(d=[y(t,"input",n[4]),y(l,"input",n[5]),y(o,"click",n[3])],v=!0)},p(p,[f]){f&1&&t.value!==p[0]&&O(t,p[0]),f&2&&l.value!==p[1]&&O(l,p[1]),f&4&&R(w,p[2])},i:N,o:N,d(p){p&&L(t),p&&L(i),p&&L(l),p&&L(s),p&&L(o),p&&L(c),p&&L(r),p&&L(m),p&&L(h),v=!1,Y(d)}}}function hs(n,t,i){let l="baz",s="qux",o=null;async function c(){let h=navigator.userAgent.includes("Windows")?"https://customprotocol.test/example.html":"customprotocol://test/example.html";const v=await(await fetch(h,{method:"POST",body:JSON.stringify({foo:l,bar:s})})).json();i(2,o=JSON.stringify(v))}function r(){l=this.value,i(0,l)}function m(){s=this.value,i(1,s)}return[l,s,o,c,r,m]}class gs extends G{constructor(t){super();V(this,t,hs,fs,J,{})}}function Kl(n,t,i){const l=n.slice();return l[9]=t[i],l}function Xl(n){let t,i=n[9].label+"",l,s,o,c,r;function m(){return n[7](n[9])}return{c(){t=a("p"),l=M(i),s=g(),u(t,"class",o="nv noselect "+(n[0]===n[9]?"nv_selected":""))},m(h,w){S(h,t,w),e(t,l),e(t,s),c||(r=y(t,"click",m),c=!0)},p(h,w){n=h,w&1&&o!==(o="nv noselect "+(n[0]===n[9]?"nv_selected":""))&&u(t,"class",o)},d(h){h&&L(t),c=!1,r()}}}function ms(n){let t,i,l,s,o,c,r,m,h,w,v,d,p,f,k,_,T,C,P,W,A,E,I,j=n[2],D=[];for(let U=0;UDocumentation Github Source`,r=g(),m=a("div"),h=a("div");for(let U=0;U{Il(H,1)}),ki()}X?(d=new X(Z(U)),Al(d.$$.fragment),Nl(d.$$.fragment,1),Ul(d,v,null)):d=null}(!A||ne&2)&&W.p(U[1])},i(U){A||(d&&Nl(d.$$.fragment,U),A=!0)},o(U){d&&Wl(d.$$.fragment,U),A=!1},d(U){U&&L(t),It(D,U),d&&Il(d),E=!1,Y(I)}}}const vs="ctrl+b";function _s(n,t,i){it(()=>{Mi(vs,()=>{mn("menu_toggle")})});const l=[{label:"Welcome",component:Ei},{label:"Messages",component:Wi},{label:"CLI",component:Pi},{label:"Dialog",component:Hi},{label:"File system",component:Bi},{label:"HTTP",component:Vi},{label:"HTTP Form",component:gs},{label:"Notifications",component:Xi},{label:"Window",component:Zi},{label:"Shortcuts",component:es},{label:"Shell",component:ls},{label:"Updater",component:os},{label:"Clipboard",component:rs},{label:"WebRTC",component:ds}];let s=l[0],o=Pl([]),c="";function r(d){i(0,s=d)}function m(d){o.update(p=>[`[${new Date().toLocaleTimeString()}]: `+(typeof d=="string"?d:JSON.stringify(d)),...p])}function h(){Ol("https://tauri.studio/")}return it(()=>{o.subscribe(d=>{i(1,c=d.join(` `))})}),[s,c,l,o,r,m,h,d=>r(d),()=>{o.update(()=>[])}]}class bs extends G{constructor(t){super();V(this,t,_s,ms,J,{})}}new bs({target:document.body}); diff --git a/examples/api/dist/index.html b/examples/api/dist/index.html index 111fd73dc..aa03b6eb4 100644 --- a/examples/api/dist/index.html +++ b/examples/api/dist/index.html @@ -5,7 +5,7 @@ Svelte + Vite App - + diff --git a/examples/api/src/App.svelte b/examples/api/src/App.svelte index 8d5f77f06..ae1438322 100644 --- a/examples/api/src/App.svelte +++ b/examples/api/src/App.svelte @@ -115,7 +115,7 @@