@decido/plugin-frubeala-ui 1.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.md +31 -0
- package/package.json +3 -3
- package/dist/assets/__federation_expose_Plugin-WvTCD-o4.js +0 -8665
- package/dist/assets/__federation_fn_import-eohqPj63.js +0 -423
- package/dist/assets/__federation_shared_react-B_Erx0pB.js +0 -4
- package/dist/assets/__federation_shared_react-dom-BYCW6Jpt.js +0 -6672
- package/dist/assets/__federation_shared_zustand-BE2cJPMx.js +0 -194
- package/dist/assets/core-Bo9SoPMG.js +0 -142
- package/dist/assets/event-CGIJhKma.js +0 -63
- package/dist/assets/index-DLaxava2.js +0 -65
- package/dist/assets/index-Daqo0uNT.js +0 -122
- package/dist/assets/index-S0MgceH3.js +0 -272
- package/dist/assets/remoteEntry.js +0 -80
- package/dist/index.html +0 -14
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { importShared } from "./__federation_fn_import-eohqPj63.js";
|
|
2
|
-
import { r as reactExports, g as getDefaultExportFromCjs } from "./index-S0MgceH3.js";
|
|
3
|
-
const __vite_import_meta_env__$1 = {};
|
|
4
|
-
const createStoreImpl = (createState) => {
|
|
5
|
-
let state;
|
|
6
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
7
|
-
const setState = (partial, replace) => {
|
|
8
|
-
const nextState = typeof partial === "function" ? partial(state) : partial;
|
|
9
|
-
if (!Object.is(nextState, state)) {
|
|
10
|
-
const previousState = state;
|
|
11
|
-
state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
|
|
12
|
-
listeners.forEach((listener) => listener(state, previousState));
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
const getState = () => state;
|
|
16
|
-
const getInitialState = () => initialState;
|
|
17
|
-
const subscribe = (listener) => {
|
|
18
|
-
listeners.add(listener);
|
|
19
|
-
return () => listeners.delete(listener);
|
|
20
|
-
};
|
|
21
|
-
const destroy = () => {
|
|
22
|
-
if ((__vite_import_meta_env__$1 ? "production" : void 0) !== "production") {
|
|
23
|
-
console.warn(
|
|
24
|
-
"[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
listeners.clear();
|
|
28
|
-
};
|
|
29
|
-
const api = { setState, getState, getInitialState, subscribe, destroy };
|
|
30
|
-
const initialState = state = createState(setState, getState, api);
|
|
31
|
-
return api;
|
|
32
|
-
};
|
|
33
|
-
const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
|
34
|
-
var withSelector = { exports: {} };
|
|
35
|
-
var withSelector_production_min = {};
|
|
36
|
-
var shim = { exports: {} };
|
|
37
|
-
var useSyncExternalStoreShim_production_min = {};
|
|
38
|
-
/**
|
|
39
|
-
* @license React
|
|
40
|
-
* use-sync-external-store-shim.production.min.js
|
|
41
|
-
*
|
|
42
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the MIT license found in the
|
|
45
|
-
* LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/
|
|
47
|
-
var e = reactExports;
|
|
48
|
-
function h$1(a, b) {
|
|
49
|
-
return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b;
|
|
50
|
-
}
|
|
51
|
-
var k = "function" === typeof Object.is ? Object.is : h$1, l = e.useState, m = e.useEffect, n$1 = e.useLayoutEffect, p$1 = e.useDebugValue;
|
|
52
|
-
function q$1(a, b) {
|
|
53
|
-
var d = b(), f = l({ inst: { value: d, getSnapshot: b } }), c = f[0].inst, g = f[1];
|
|
54
|
-
n$1(function() {
|
|
55
|
-
c.value = d;
|
|
56
|
-
c.getSnapshot = b;
|
|
57
|
-
r$1(c) && g({ inst: c });
|
|
58
|
-
}, [a, d, b]);
|
|
59
|
-
m(function() {
|
|
60
|
-
r$1(c) && g({ inst: c });
|
|
61
|
-
return a(function() {
|
|
62
|
-
r$1(c) && g({ inst: c });
|
|
63
|
-
});
|
|
64
|
-
}, [a]);
|
|
65
|
-
p$1(d);
|
|
66
|
-
return d;
|
|
67
|
-
}
|
|
68
|
-
function r$1(a) {
|
|
69
|
-
var b = a.getSnapshot;
|
|
70
|
-
a = a.value;
|
|
71
|
-
try {
|
|
72
|
-
var d = b();
|
|
73
|
-
return !k(a, d);
|
|
74
|
-
} catch (f) {
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function t$1(a, b) {
|
|
79
|
-
return b();
|
|
80
|
-
}
|
|
81
|
-
var u$1 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? t$1 : q$1;
|
|
82
|
-
useSyncExternalStoreShim_production_min.useSyncExternalStore = void 0 !== e.useSyncExternalStore ? e.useSyncExternalStore : u$1;
|
|
83
|
-
{
|
|
84
|
-
shim.exports = useSyncExternalStoreShim_production_min;
|
|
85
|
-
}
|
|
86
|
-
var shimExports = shim.exports;
|
|
87
|
-
/**
|
|
88
|
-
* @license React
|
|
89
|
-
* use-sync-external-store-shim/with-selector.production.min.js
|
|
90
|
-
*
|
|
91
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the MIT license found in the
|
|
94
|
-
* LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/
|
|
96
|
-
var h = reactExports, n = shimExports;
|
|
97
|
-
function p(a, b) {
|
|
98
|
-
return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b;
|
|
99
|
-
}
|
|
100
|
-
var q = "function" === typeof Object.is ? Object.is : p, r = n.useSyncExternalStore, t = h.useRef, u = h.useEffect, v = h.useMemo, w = h.useDebugValue;
|
|
101
|
-
withSelector_production_min.useSyncExternalStoreWithSelector = function(a, b, e2, l2, g) {
|
|
102
|
-
var c = t(null);
|
|
103
|
-
if (null === c.current) {
|
|
104
|
-
var f = { hasValue: false, value: null };
|
|
105
|
-
c.current = f;
|
|
106
|
-
} else f = c.current;
|
|
107
|
-
c = v(function() {
|
|
108
|
-
function a2(a3) {
|
|
109
|
-
if (!c2) {
|
|
110
|
-
c2 = true;
|
|
111
|
-
d2 = a3;
|
|
112
|
-
a3 = l2(a3);
|
|
113
|
-
if (void 0 !== g && f.hasValue) {
|
|
114
|
-
var b2 = f.value;
|
|
115
|
-
if (g(b2, a3)) return k2 = b2;
|
|
116
|
-
}
|
|
117
|
-
return k2 = a3;
|
|
118
|
-
}
|
|
119
|
-
b2 = k2;
|
|
120
|
-
if (q(d2, a3)) return b2;
|
|
121
|
-
var e3 = l2(a3);
|
|
122
|
-
if (void 0 !== g && g(b2, e3)) return b2;
|
|
123
|
-
d2 = a3;
|
|
124
|
-
return k2 = e3;
|
|
125
|
-
}
|
|
126
|
-
var c2 = false, d2, k2, m2 = void 0 === e2 ? null : e2;
|
|
127
|
-
return [function() {
|
|
128
|
-
return a2(b());
|
|
129
|
-
}, null === m2 ? void 0 : function() {
|
|
130
|
-
return a2(m2());
|
|
131
|
-
}];
|
|
132
|
-
}, [b, e2, l2, g]);
|
|
133
|
-
var d = r(a, c[0], c[1]);
|
|
134
|
-
u(function() {
|
|
135
|
-
f.hasValue = true;
|
|
136
|
-
f.value = d;
|
|
137
|
-
}, [d]);
|
|
138
|
-
w(d);
|
|
139
|
-
return d;
|
|
140
|
-
};
|
|
141
|
-
{
|
|
142
|
-
withSelector.exports = withSelector_production_min;
|
|
143
|
-
}
|
|
144
|
-
var withSelectorExports = withSelector.exports;
|
|
145
|
-
const useSyncExternalStoreExports = /* @__PURE__ */ getDefaultExportFromCjs(withSelectorExports);
|
|
146
|
-
const __vite_import_meta_env__ = {};
|
|
147
|
-
const ReactExports = await importShared("react");
|
|
148
|
-
const { useDebugValue } = ReactExports;
|
|
149
|
-
const { useSyncExternalStoreWithSelector } = useSyncExternalStoreExports;
|
|
150
|
-
let didWarnAboutEqualityFn = false;
|
|
151
|
-
const identity = (arg) => arg;
|
|
152
|
-
function useStore(api, selector = identity, equalityFn) {
|
|
153
|
-
if ((__vite_import_meta_env__ ? "production" : void 0) !== "production" && equalityFn && !didWarnAboutEqualityFn) {
|
|
154
|
-
console.warn(
|
|
155
|
-
"[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"
|
|
156
|
-
);
|
|
157
|
-
didWarnAboutEqualityFn = true;
|
|
158
|
-
}
|
|
159
|
-
const slice = useSyncExternalStoreWithSelector(
|
|
160
|
-
api.subscribe,
|
|
161
|
-
api.getState,
|
|
162
|
-
api.getServerState || api.getInitialState,
|
|
163
|
-
selector,
|
|
164
|
-
equalityFn
|
|
165
|
-
);
|
|
166
|
-
useDebugValue(slice);
|
|
167
|
-
return slice;
|
|
168
|
-
}
|
|
169
|
-
const createImpl = (createState) => {
|
|
170
|
-
if ((__vite_import_meta_env__ ? "production" : void 0) !== "production" && typeof createState !== "function") {
|
|
171
|
-
console.warn(
|
|
172
|
-
"[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`."
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
const api = typeof createState === "function" ? createStore(createState) : createState;
|
|
176
|
-
const useBoundStore = (selector, equalityFn) => useStore(api, selector, equalityFn);
|
|
177
|
-
Object.assign(useBoundStore, api);
|
|
178
|
-
return useBoundStore;
|
|
179
|
-
};
|
|
180
|
-
const create = (createState) => createState ? createImpl(createState) : createImpl;
|
|
181
|
-
var react = (createState) => {
|
|
182
|
-
if ((__vite_import_meta_env__ ? "production" : void 0) !== "production") {
|
|
183
|
-
console.warn(
|
|
184
|
-
"[DEPRECATED] Default export is deprecated. Instead use `import { create } from 'zustand'`."
|
|
185
|
-
);
|
|
186
|
-
}
|
|
187
|
-
return create(createState);
|
|
188
|
-
};
|
|
189
|
-
export {
|
|
190
|
-
create,
|
|
191
|
-
createStore,
|
|
192
|
-
react as default,
|
|
193
|
-
useStore
|
|
194
|
-
};
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
2
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
3
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
4
|
-
}
|
|
5
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
6
|
-
if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
7
|
-
return state.set(receiver, value), value;
|
|
8
|
-
}
|
|
9
|
-
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
10
|
-
var e = new Error(message);
|
|
11
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
12
|
-
};
|
|
13
|
-
var _Channel_onmessage, _Channel_nextMessageIndex, _Channel_pendingMessages, _Channel_messageEndIndex, _Resource_rid;
|
|
14
|
-
const SERIALIZE_TO_IPC_FN = "__TAURI_TO_IPC_KEY__";
|
|
15
|
-
function transformCallback(callback, once = false) {
|
|
16
|
-
return window.__TAURI_INTERNALS__.transformCallback(callback, once);
|
|
17
|
-
}
|
|
18
|
-
class Channel {
|
|
19
|
-
constructor(onmessage) {
|
|
20
|
-
_Channel_onmessage.set(this, void 0);
|
|
21
|
-
_Channel_nextMessageIndex.set(this, 0);
|
|
22
|
-
_Channel_pendingMessages.set(this, []);
|
|
23
|
-
_Channel_messageEndIndex.set(this, void 0);
|
|
24
|
-
__classPrivateFieldSet(this, _Channel_onmessage, onmessage || (() => {
|
|
25
|
-
}));
|
|
26
|
-
this.id = transformCallback((rawMessage) => {
|
|
27
|
-
const index = rawMessage.index;
|
|
28
|
-
if ("end" in rawMessage) {
|
|
29
|
-
if (index == __classPrivateFieldGet(this, _Channel_nextMessageIndex, "f")) {
|
|
30
|
-
this.cleanupCallback();
|
|
31
|
-
} else {
|
|
32
|
-
__classPrivateFieldSet(this, _Channel_messageEndIndex, index);
|
|
33
|
-
}
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const message = rawMessage.message;
|
|
37
|
-
if (index == __classPrivateFieldGet(this, _Channel_nextMessageIndex, "f")) {
|
|
38
|
-
__classPrivateFieldGet(this, _Channel_onmessage, "f").call(this, message);
|
|
39
|
-
__classPrivateFieldSet(this, _Channel_nextMessageIndex, __classPrivateFieldGet(this, _Channel_nextMessageIndex, "f") + 1);
|
|
40
|
-
while (__classPrivateFieldGet(this, _Channel_nextMessageIndex, "f") in __classPrivateFieldGet(this, _Channel_pendingMessages, "f")) {
|
|
41
|
-
const message2 = __classPrivateFieldGet(this, _Channel_pendingMessages, "f")[__classPrivateFieldGet(this, _Channel_nextMessageIndex, "f")];
|
|
42
|
-
__classPrivateFieldGet(this, _Channel_onmessage, "f").call(this, message2);
|
|
43
|
-
delete __classPrivateFieldGet(this, _Channel_pendingMessages, "f")[__classPrivateFieldGet(this, _Channel_nextMessageIndex, "f")];
|
|
44
|
-
__classPrivateFieldSet(this, _Channel_nextMessageIndex, __classPrivateFieldGet(this, _Channel_nextMessageIndex, "f") + 1);
|
|
45
|
-
}
|
|
46
|
-
if (__classPrivateFieldGet(this, _Channel_nextMessageIndex, "f") === __classPrivateFieldGet(this, _Channel_messageEndIndex, "f")) {
|
|
47
|
-
this.cleanupCallback();
|
|
48
|
-
}
|
|
49
|
-
} else {
|
|
50
|
-
__classPrivateFieldGet(this, _Channel_pendingMessages, "f")[index] = message;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
cleanupCallback() {
|
|
55
|
-
window.__TAURI_INTERNALS__.unregisterCallback(this.id);
|
|
56
|
-
}
|
|
57
|
-
set onmessage(handler) {
|
|
58
|
-
__classPrivateFieldSet(this, _Channel_onmessage, handler);
|
|
59
|
-
}
|
|
60
|
-
get onmessage() {
|
|
61
|
-
return __classPrivateFieldGet(this, _Channel_onmessage, "f");
|
|
62
|
-
}
|
|
63
|
-
[(_Channel_onmessage = /* @__PURE__ */ new WeakMap(), _Channel_nextMessageIndex = /* @__PURE__ */ new WeakMap(), _Channel_pendingMessages = /* @__PURE__ */ new WeakMap(), _Channel_messageEndIndex = /* @__PURE__ */ new WeakMap(), SERIALIZE_TO_IPC_FN)]() {
|
|
64
|
-
return `__CHANNEL__:${this.id}`;
|
|
65
|
-
}
|
|
66
|
-
toJSON() {
|
|
67
|
-
return this[SERIALIZE_TO_IPC_FN]();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
class PluginListener {
|
|
71
|
-
constructor(plugin, event, channelId) {
|
|
72
|
-
this.plugin = plugin;
|
|
73
|
-
this.event = event;
|
|
74
|
-
this.channelId = channelId;
|
|
75
|
-
}
|
|
76
|
-
async unregister() {
|
|
77
|
-
return invoke(`plugin:${this.plugin}|remove_listener`, {
|
|
78
|
-
event: this.event,
|
|
79
|
-
channelId: this.channelId
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
async function addPluginListener(plugin, event, cb) {
|
|
84
|
-
const handler = new Channel(cb);
|
|
85
|
-
try {
|
|
86
|
-
await invoke(`plugin:${plugin}|register_listener`, {
|
|
87
|
-
event,
|
|
88
|
-
handler
|
|
89
|
-
});
|
|
90
|
-
return new PluginListener(plugin, event, handler.id);
|
|
91
|
-
} catch {
|
|
92
|
-
await invoke(`plugin:${plugin}|registerListener`, { event, handler });
|
|
93
|
-
return new PluginListener(plugin, event, handler.id);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
async function checkPermissions(plugin) {
|
|
97
|
-
return invoke(`plugin:${plugin}|check_permissions`);
|
|
98
|
-
}
|
|
99
|
-
async function requestPermissions(plugin) {
|
|
100
|
-
return invoke(`plugin:${plugin}|request_permissions`);
|
|
101
|
-
}
|
|
102
|
-
async function invoke(cmd, args = {}, options) {
|
|
103
|
-
return window.__TAURI_INTERNALS__.invoke(cmd, args, options);
|
|
104
|
-
}
|
|
105
|
-
function convertFileSrc(filePath, protocol = "asset") {
|
|
106
|
-
return window.__TAURI_INTERNALS__.convertFileSrc(filePath, protocol);
|
|
107
|
-
}
|
|
108
|
-
class Resource {
|
|
109
|
-
get rid() {
|
|
110
|
-
return __classPrivateFieldGet(this, _Resource_rid, "f");
|
|
111
|
-
}
|
|
112
|
-
constructor(rid) {
|
|
113
|
-
_Resource_rid.set(this, void 0);
|
|
114
|
-
__classPrivateFieldSet(this, _Resource_rid, rid);
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Destroys and cleans up this resource from memory.
|
|
118
|
-
* **You should not call any method on this object anymore and should drop any reference to it.**
|
|
119
|
-
*/
|
|
120
|
-
async close() {
|
|
121
|
-
return invoke("plugin:resources|close", {
|
|
122
|
-
rid: this.rid
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
_Resource_rid = /* @__PURE__ */ new WeakMap();
|
|
127
|
-
function isTauri() {
|
|
128
|
-
return !!(globalThis || window).isTauri;
|
|
129
|
-
}
|
|
130
|
-
export {
|
|
131
|
-
Channel,
|
|
132
|
-
PluginListener,
|
|
133
|
-
Resource,
|
|
134
|
-
SERIALIZE_TO_IPC_FN,
|
|
135
|
-
addPluginListener,
|
|
136
|
-
checkPermissions,
|
|
137
|
-
convertFileSrc,
|
|
138
|
-
invoke,
|
|
139
|
-
isTauri,
|
|
140
|
-
requestPermissions,
|
|
141
|
-
transformCallback
|
|
142
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { invoke, transformCallback } from "./core-Bo9SoPMG.js";
|
|
2
|
-
var TauriEvent;
|
|
3
|
-
(function(TauriEvent2) {
|
|
4
|
-
TauriEvent2["WINDOW_RESIZED"] = "tauri://resize";
|
|
5
|
-
TauriEvent2["WINDOW_MOVED"] = "tauri://move";
|
|
6
|
-
TauriEvent2["WINDOW_CLOSE_REQUESTED"] = "tauri://close-requested";
|
|
7
|
-
TauriEvent2["WINDOW_DESTROYED"] = "tauri://destroyed";
|
|
8
|
-
TauriEvent2["WINDOW_FOCUS"] = "tauri://focus";
|
|
9
|
-
TauriEvent2["WINDOW_BLUR"] = "tauri://blur";
|
|
10
|
-
TauriEvent2["WINDOW_SCALE_FACTOR_CHANGED"] = "tauri://scale-change";
|
|
11
|
-
TauriEvent2["WINDOW_THEME_CHANGED"] = "tauri://theme-changed";
|
|
12
|
-
TauriEvent2["WINDOW_CREATED"] = "tauri://window-created";
|
|
13
|
-
TauriEvent2["WEBVIEW_CREATED"] = "tauri://webview-created";
|
|
14
|
-
TauriEvent2["DRAG_ENTER"] = "tauri://drag-enter";
|
|
15
|
-
TauriEvent2["DRAG_OVER"] = "tauri://drag-over";
|
|
16
|
-
TauriEvent2["DRAG_DROP"] = "tauri://drag-drop";
|
|
17
|
-
TauriEvent2["DRAG_LEAVE"] = "tauri://drag-leave";
|
|
18
|
-
})(TauriEvent || (TauriEvent = {}));
|
|
19
|
-
async function _unlisten(event, eventId) {
|
|
20
|
-
window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(event, eventId);
|
|
21
|
-
await invoke("plugin:event|unlisten", {
|
|
22
|
-
event,
|
|
23
|
-
eventId
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
async function listen(event, handler, options) {
|
|
27
|
-
var _a;
|
|
28
|
-
const target = typeof (options === null || options === void 0 ? void 0 : options.target) === "string" ? { kind: "AnyLabel", label: options.target } : (_a = options === null || options === void 0 ? void 0 : options.target) !== null && _a !== void 0 ? _a : { kind: "Any" };
|
|
29
|
-
return invoke("plugin:event|listen", {
|
|
30
|
-
event,
|
|
31
|
-
target,
|
|
32
|
-
handler: transformCallback(handler)
|
|
33
|
-
}).then((eventId) => {
|
|
34
|
-
return async () => _unlisten(event, eventId);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
async function once(event, handler, options) {
|
|
38
|
-
return listen(event, (eventData) => {
|
|
39
|
-
void _unlisten(event, eventData.id);
|
|
40
|
-
handler(eventData);
|
|
41
|
-
}, options);
|
|
42
|
-
}
|
|
43
|
-
async function emit(event, payload) {
|
|
44
|
-
await invoke("plugin:event|emit", {
|
|
45
|
-
event,
|
|
46
|
-
payload
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
async function emitTo(target, event, payload) {
|
|
50
|
-
const eventTarget = typeof target === "string" ? { kind: "AnyLabel", label: target } : target;
|
|
51
|
-
await invoke("plugin:event|emit_to", {
|
|
52
|
-
target: eventTarget,
|
|
53
|
-
event,
|
|
54
|
-
payload
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
export {
|
|
58
|
-
TauriEvent,
|
|
59
|
-
emit,
|
|
60
|
-
emitTo,
|
|
61
|
-
listen,
|
|
62
|
-
once
|
|
63
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { invoke } from "./core-Bo9SoPMG.js";
|
|
2
|
-
import "./event-CGIJhKma.js";
|
|
3
|
-
const commands = {
|
|
4
|
-
async vibrate(duration) {
|
|
5
|
-
try {
|
|
6
|
-
return {
|
|
7
|
-
status: "ok",
|
|
8
|
-
data: await invoke("plugin:haptics|vibrate", { duration })
|
|
9
|
-
};
|
|
10
|
-
} catch (e) {
|
|
11
|
-
if (e instanceof Error)
|
|
12
|
-
throw e;
|
|
13
|
-
else
|
|
14
|
-
return { status: "error", error: e };
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
async impactFeedback(style) {
|
|
18
|
-
try {
|
|
19
|
-
return {
|
|
20
|
-
status: "ok",
|
|
21
|
-
data: await invoke("plugin:haptics|impact_feedback", { style })
|
|
22
|
-
};
|
|
23
|
-
} catch (e) {
|
|
24
|
-
if (e instanceof Error)
|
|
25
|
-
throw e;
|
|
26
|
-
else
|
|
27
|
-
return { status: "error", error: e };
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
async notificationFeedback(type) {
|
|
31
|
-
try {
|
|
32
|
-
return {
|
|
33
|
-
status: "ok",
|
|
34
|
-
data: await invoke("plugin:haptics|notification_feedback", {
|
|
35
|
-
type
|
|
36
|
-
})
|
|
37
|
-
};
|
|
38
|
-
} catch (e) {
|
|
39
|
-
if (e instanceof Error)
|
|
40
|
-
throw e;
|
|
41
|
-
else
|
|
42
|
-
return { status: "error", error: e };
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
async selectionFeedback() {
|
|
46
|
-
try {
|
|
47
|
-
return {
|
|
48
|
-
status: "ok",
|
|
49
|
-
data: await invoke("plugin:haptics|selection_feedback")
|
|
50
|
-
};
|
|
51
|
-
} catch (e) {
|
|
52
|
-
if (e instanceof Error)
|
|
53
|
-
throw e;
|
|
54
|
-
else
|
|
55
|
-
return { status: "error", error: e };
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
const { vibrate, impactFeedback, notificationFeedback, selectionFeedback } = commands;
|
|
60
|
-
export {
|
|
61
|
-
impactFeedback,
|
|
62
|
-
notificationFeedback,
|
|
63
|
-
selectionFeedback,
|
|
64
|
-
vibrate
|
|
65
|
-
};
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { invoke, addPluginListener } from "./core-Bo9SoPMG.js";
|
|
2
|
-
var ScheduleEvery;
|
|
3
|
-
(function(ScheduleEvery2) {
|
|
4
|
-
ScheduleEvery2["Year"] = "year";
|
|
5
|
-
ScheduleEvery2["Month"] = "month";
|
|
6
|
-
ScheduleEvery2["TwoWeeks"] = "twoWeeks";
|
|
7
|
-
ScheduleEvery2["Week"] = "week";
|
|
8
|
-
ScheduleEvery2["Day"] = "day";
|
|
9
|
-
ScheduleEvery2["Hour"] = "hour";
|
|
10
|
-
ScheduleEvery2["Minute"] = "minute";
|
|
11
|
-
ScheduleEvery2["Second"] = "second";
|
|
12
|
-
})(ScheduleEvery || (ScheduleEvery = {}));
|
|
13
|
-
class Schedule {
|
|
14
|
-
static at(date, repeating = false, allowWhileIdle = false) {
|
|
15
|
-
return {
|
|
16
|
-
at: { date, repeating, allowWhileIdle },
|
|
17
|
-
interval: void 0,
|
|
18
|
-
every: void 0
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
static interval(interval, allowWhileIdle = false) {
|
|
22
|
-
return {
|
|
23
|
-
at: void 0,
|
|
24
|
-
interval: { interval, allowWhileIdle },
|
|
25
|
-
every: void 0
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
static every(kind, count, allowWhileIdle = false) {
|
|
29
|
-
return {
|
|
30
|
-
at: void 0,
|
|
31
|
-
interval: void 0,
|
|
32
|
-
every: { interval: kind, count, allowWhileIdle }
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
var Importance;
|
|
37
|
-
(function(Importance2) {
|
|
38
|
-
Importance2[Importance2["None"] = 0] = "None";
|
|
39
|
-
Importance2[Importance2["Min"] = 1] = "Min";
|
|
40
|
-
Importance2[Importance2["Low"] = 2] = "Low";
|
|
41
|
-
Importance2[Importance2["Default"] = 3] = "Default";
|
|
42
|
-
Importance2[Importance2["High"] = 4] = "High";
|
|
43
|
-
})(Importance || (Importance = {}));
|
|
44
|
-
var Visibility;
|
|
45
|
-
(function(Visibility2) {
|
|
46
|
-
Visibility2[Visibility2["Secret"] = -1] = "Secret";
|
|
47
|
-
Visibility2[Visibility2["Private"] = 0] = "Private";
|
|
48
|
-
Visibility2[Visibility2["Public"] = 1] = "Public";
|
|
49
|
-
})(Visibility || (Visibility = {}));
|
|
50
|
-
async function isPermissionGranted() {
|
|
51
|
-
if (window.Notification.permission !== "default") {
|
|
52
|
-
return await Promise.resolve(window.Notification.permission === "granted");
|
|
53
|
-
}
|
|
54
|
-
return await invoke("plugin:notification|is_permission_granted");
|
|
55
|
-
}
|
|
56
|
-
async function requestPermission() {
|
|
57
|
-
return await window.Notification.requestPermission();
|
|
58
|
-
}
|
|
59
|
-
function sendNotification(options) {
|
|
60
|
-
if (typeof options === "string") {
|
|
61
|
-
new window.Notification(options);
|
|
62
|
-
} else {
|
|
63
|
-
new window.Notification(options.title, options);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
async function registerActionTypes(types) {
|
|
67
|
-
await invoke("plugin:notification|register_action_types", { types });
|
|
68
|
-
}
|
|
69
|
-
async function pending() {
|
|
70
|
-
return await invoke("plugin:notification|get_pending");
|
|
71
|
-
}
|
|
72
|
-
async function cancel(notifications) {
|
|
73
|
-
await invoke("plugin:notification|cancel", { notifications });
|
|
74
|
-
}
|
|
75
|
-
async function cancelAll() {
|
|
76
|
-
await invoke("plugin:notification|cancel");
|
|
77
|
-
}
|
|
78
|
-
async function active() {
|
|
79
|
-
return await invoke("plugin:notification|get_active");
|
|
80
|
-
}
|
|
81
|
-
async function removeActive(notifications) {
|
|
82
|
-
await invoke("plugin:notification|remove_active", { notifications });
|
|
83
|
-
}
|
|
84
|
-
async function removeAllActive() {
|
|
85
|
-
await invoke("plugin:notification|remove_active");
|
|
86
|
-
}
|
|
87
|
-
async function createChannel(channel) {
|
|
88
|
-
await invoke("plugin:notification|create_channel", { ...channel });
|
|
89
|
-
}
|
|
90
|
-
async function removeChannel(id) {
|
|
91
|
-
await invoke("plugin:notification|delete_channel", { id });
|
|
92
|
-
}
|
|
93
|
-
async function channels() {
|
|
94
|
-
return await invoke("plugin:notification|listChannels");
|
|
95
|
-
}
|
|
96
|
-
async function onNotificationReceived(cb) {
|
|
97
|
-
return await addPluginListener("notification", "notification", cb);
|
|
98
|
-
}
|
|
99
|
-
async function onAction(cb) {
|
|
100
|
-
return await addPluginListener("notification", "actionPerformed", cb);
|
|
101
|
-
}
|
|
102
|
-
export {
|
|
103
|
-
Importance,
|
|
104
|
-
Schedule,
|
|
105
|
-
ScheduleEvery,
|
|
106
|
-
Visibility,
|
|
107
|
-
active,
|
|
108
|
-
cancel,
|
|
109
|
-
cancelAll,
|
|
110
|
-
channels,
|
|
111
|
-
createChannel,
|
|
112
|
-
isPermissionGranted,
|
|
113
|
-
onAction,
|
|
114
|
-
onNotificationReceived,
|
|
115
|
-
pending,
|
|
116
|
-
registerActionTypes,
|
|
117
|
-
removeActive,
|
|
118
|
-
removeAllActive,
|
|
119
|
-
removeChannel,
|
|
120
|
-
requestPermission,
|
|
121
|
-
sendNotification
|
|
122
|
-
};
|