mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-30 17:48:50 +02:00
rebuild dist, fix example
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
import Clipboard from "./views/Clipboard.svelte";
|
import Clipboard from "./views/Clipboard.svelte";
|
||||||
import WebRTC from "./views/WebRTC.svelte";
|
import WebRTC from "./views/WebRTC.svelte";
|
||||||
import Scanner from "./views/Scanner.svelte";
|
import Scanner from "./views/Scanner.svelte";
|
||||||
import { Camera } from "./views/Camera.svelte";
|
import Camera from "./views/Camera.svelte";
|
||||||
import App from "./views/App.svelte";
|
import App from "./views/App.svelte";
|
||||||
|
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
label: "Camera",
|
label: "Camera",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: Source.Photo,
|
value: Source.Photos,
|
||||||
label: "Photo",
|
label: "Photo",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Vendored
+4
-106
@@ -1,101 +1,6 @@
|
|||||||
var f$1 = Object.defineProperty;
|
var f$1=Object.defineProperty;var g=(a,b)=>{for(var c in b)f$1(a,c,{get:b[c],enumerable:!0});};var e=(a,b,c)=>{if(!b.has(a))throw TypeError("Cannot "+c)};var h$1=(a,b,c)=>(e(a,b,"read from private field"),c?c.call(a):b.get(a)),i$1=(a,b,c)=>{if(b.has(a))throw TypeError("Cannot add the same private member more than once");b instanceof WeakSet?b.add(a):b.set(a,c);},j=(a,b,c,d)=>(e(a,b,"write to private field"),d?d.call(a,c):b.set(a,c),c);
|
||||||
var g = (a, b) => {
|
|
||||||
for (var c in b) f$1(a, c, {
|
|
||||||
get: b[c],
|
|
||||||
enumerable: !0
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var e = (a, b, c) => {
|
|
||||||
if (!b.has(a)) throw TypeError("Cannot " + c)
|
|
||||||
};
|
|
||||||
var h$1 = (a, b, c) => (e(a, b, "read from private field"), c ? c.call(a) : b.get(a)),
|
|
||||||
i$1 = (a, b, c) => {
|
|
||||||
if (b.has(a)) throw TypeError("Cannot add the same private member more than once");
|
|
||||||
b instanceof WeakSet ? b.add(a) : b.set(a, c);
|
|
||||||
},
|
|
||||||
j = (a, b, c, d) => (e(a, b, "write to private field"), d ? d.call(a, c) : b.set(a, c), c);
|
|
||||||
|
|
||||||
var h = {};
|
var h={};g(h,{Channel:()=>o,PluginListener:()=>a,addPluginListener:()=>m,convertFileSrc:()=>y,invoke:()=>u,transformCallback:()=>s});function f(){return window.crypto.getRandomValues(new Uint32Array(1))[0]}function s(n,e=!1){let t=f(),r=`_${t}`;return Object.defineProperty(window,r,{value:c=>(e&&Reflect.deleteProperty(window,r),n?.(c)),writable:!1,configurable:!0}),t}var i,o=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0;i$1(this,i,()=>{});this.id=s(e=>{h$1(this,i).call(this,e);});}set onmessage(e){j(this,i,e);}get onmessage(){return h$1(this,i)}toJSON(){return `__CHANNEL__:${this.id}`}};i=new WeakMap;var a=class{constructor(e,t,r){this.plugin=e,this.event=t,this.channelId=r;}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function m(n,e,t){let r=new o;return r.onmessage=t,u(`plugin:${n}|register_listener`,{event:e,handler:r}).then(()=>new a(n,e,r.id))}async function u(n,e={},t){return new Promise((r,c)=>{let g=s(d=>{r(d),Reflect.deleteProperty(window,`_${_}`);},!0),_=s(d=>{c(d),Reflect.deleteProperty(window,`_${g}`);},!0);window.__TAURI_IPC__({cmd:n,callback:g,error:_,payload:e,options:t});})}function y(n,e="asset"){return window.__TAURI__.convertFileSrc(n,e)}
|
||||||
g(h, {
|
|
||||||
Channel: () => o,
|
|
||||||
PluginListener: () => a,
|
|
||||||
addPluginListener: () => m,
|
|
||||||
convertFileSrc: () => y,
|
|
||||||
invoke: () => u,
|
|
||||||
transformCallback: () => s
|
|
||||||
});
|
|
||||||
|
|
||||||
function f() {
|
|
||||||
return window.crypto.getRandomValues(new Uint32Array(1))[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
function s(n, e = !1) {
|
|
||||||
let t = f(),
|
|
||||||
r = `_${t}`;
|
|
||||||
return Object.defineProperty(window, r, {
|
|
||||||
value: c => (e && Reflect.deleteProperty(window, r), n ? .(c)),
|
|
||||||
writable: !1,
|
|
||||||
configurable: !0
|
|
||||||
}), t
|
|
||||||
}
|
|
||||||
var i, o = class {
|
|
||||||
constructor() {
|
|
||||||
this.__TAURI_CHANNEL_MARKER__ = !0;
|
|
||||||
i$1(this, i, () => {});
|
|
||||||
this.id = s(e => {
|
|
||||||
h$1(this, i).call(this, e);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
set onmessage(e) {
|
|
||||||
j(this, i, e);
|
|
||||||
}
|
|
||||||
get onmessage() {
|
|
||||||
return h$1(this, i)
|
|
||||||
}
|
|
||||||
toJSON() {
|
|
||||||
return `__CHANNEL__:${this.id}`
|
|
||||||
}
|
|
||||||
};
|
|
||||||
i = new WeakMap;
|
|
||||||
var a = class {
|
|
||||||
constructor(e, t, r) {
|
|
||||||
this.plugin = e, this.event = t, this.channelId = r;
|
|
||||||
}
|
|
||||||
async unregister() {
|
|
||||||
return u(`plugin:${this.plugin}|remove_listener`, {
|
|
||||||
event: this.event,
|
|
||||||
channelId: this.channelId
|
|
||||||
})
|
|
||||||
}
|
|
||||||
};
|
|
||||||
async function m(n, e, t) {
|
|
||||||
let r = new o;
|
|
||||||
return r.onmessage = t, u(`plugin:${n}|register_listener`, {
|
|
||||||
event: e,
|
|
||||||
handler: r
|
|
||||||
}).then(() => new a(n, e, r.id))
|
|
||||||
}
|
|
||||||
async function u(n, e = {}, t) {
|
|
||||||
return new Promise((r, c) => {
|
|
||||||
let g = s(d => {
|
|
||||||
r(d), Reflect.deleteProperty(window, `_${_}`);
|
|
||||||
}, !0),
|
|
||||||
_ = s(d => {
|
|
||||||
c(d), Reflect.deleteProperty(window, `_${g}`);
|
|
||||||
}, !0);
|
|
||||||
window.__TAURI_IPC__({
|
|
||||||
cmd: n,
|
|
||||||
callback: g,
|
|
||||||
error: _,
|
|
||||||
payload: e,
|
|
||||||
options: t
|
|
||||||
});
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function y(n, e = "asset") {
|
|
||||||
return window.__TAURI__.convertFileSrc(n, e)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
@@ -118,15 +23,8 @@ var CameraDirection;
|
|||||||
CameraDirection["Front"] = "FRONT";
|
CameraDirection["Front"] = "FRONT";
|
||||||
})(CameraDirection || (CameraDirection = {}));
|
})(CameraDirection || (CameraDirection = {}));
|
||||||
async function getPhoto(options) {
|
async function getPhoto(options) {
|
||||||
return await u("plugin:camera|getPhoto", {
|
return await u("plugin:camera|getPhoto", { ...options });
|
||||||
...options
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export { CameraDirection, ResultType, Source, getPhoto };
|
||||||
CameraDirection,
|
|
||||||
ResultType,
|
|
||||||
Source,
|
|
||||||
getPhoto
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=index.min.js.map
|
//# sourceMappingURL=index.min.js.map
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
import {
|
import { invoke } from '@tauri-apps/api/tauri';
|
||||||
invoke
|
|
||||||
} from '@tauri-apps/api/tauri';
|
|
||||||
|
|
||||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
@@ -23,15 +21,8 @@ var CameraDirection;
|
|||||||
CameraDirection["Front"] = "FRONT";
|
CameraDirection["Front"] = "FRONT";
|
||||||
})(CameraDirection || (CameraDirection = {}));
|
})(CameraDirection || (CameraDirection = {}));
|
||||||
async function getPhoto(options) {
|
async function getPhoto(options) {
|
||||||
return await invoke("plugin:camera|getPhoto", {
|
return await invoke("plugin:camera|getPhoto", { ...options });
|
||||||
...options
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export { CameraDirection, ResultType, Source, getPhoto };
|
||||||
CameraDirection,
|
|
||||||
ResultType,
|
|
||||||
Source,
|
|
||||||
getPhoto
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=index.mjs.map
|
//# sourceMappingURL=index.mjs.map
|
||||||
Reference in New Issue
Block a user