@luna-park/plugin-reactivity 1.0.0 → 1.1.0
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/dist/index.js +521 -431
- package/dist/runtime.js +85 -62
- package/package.json +1 -1
package/dist/runtime.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { breakpointsAntDesign as e, breakpointsBootstrapV5 as t, breakpointsElement as n, breakpointsQuasar as r, breakpointsTailwind as i, breakpointsVuetifyV3 as a, refDebounced as o, refThrottled as s, useBreakpoints as c, useColorMode as l, useCountdown as u,
|
|
2
|
-
import { computed as
|
|
1
|
+
import { breakpointsAntDesign as e, breakpointsBootstrapV5 as t, breakpointsElement as n, breakpointsQuasar as r, breakpointsTailwind as i, breakpointsVuetifyV3 as a, refDebounced as o, refThrottled as s, useBreakpoints as c, useColorMode as l, useCountdown as u, useEventListener as d, useFullscreen as f, useIntervalFn as p, useScrollLock as m, useStorage as h, useWakeLock as g } from "@vueuse/core";
|
|
2
|
+
import { computed as _, effectScope as v, getCurrentScope as y, onScopeDispose as ee, reactive as b, ref as x } from "vue";
|
|
3
3
|
// src/runtime/shared.ts
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
|
|
4
|
+
var S = v(!0), C = !1;
|
|
5
|
+
function te(e) {
|
|
6
|
+
C = e;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return
|
|
8
|
+
function w() {
|
|
9
|
+
return C;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function T(e) {
|
|
12
12
|
let t;
|
|
13
|
-
return () => (t ??=
|
|
13
|
+
return () => (t ??= S.run(e), t);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
15
|
+
function E(e) {
|
|
16
|
+
return S.run(e);
|
|
17
17
|
}
|
|
18
18
|
// src/runtime/actions.ts
|
|
19
|
-
var
|
|
20
|
-
async function k(e) {
|
|
21
|
-
let t = E();
|
|
22
|
-
return await t[e]().catch(() => void 0), t.isFullscreen.value;
|
|
23
|
-
}
|
|
19
|
+
var D = T(() => f()), O = T(() => g()), k = T(() => m(globalThis.document?.body));
|
|
24
20
|
async function A(e) {
|
|
25
21
|
let t = D();
|
|
22
|
+
return await t[e]().catch(() => void 0), t.isFullscreen.value;
|
|
23
|
+
}
|
|
24
|
+
async function j(e) {
|
|
25
|
+
let t = O();
|
|
26
26
|
try {
|
|
27
27
|
e ? await t.request("screen") : await t.release();
|
|
28
28
|
} catch {
|
|
@@ -30,13 +30,13 @@ async function A(e) {
|
|
|
30
30
|
}
|
|
31
31
|
return e;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
33
|
+
function M(e) {
|
|
34
|
+
w() || (k().value = e);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
36
|
+
function N() {
|
|
37
|
+
return k().value;
|
|
38
38
|
}
|
|
39
|
-
async function
|
|
39
|
+
async function P(e) {
|
|
40
40
|
if (!globalThis.navigator?.share) return !1;
|
|
41
41
|
try {
|
|
42
42
|
return await navigator.share(e), !0;
|
|
@@ -44,20 +44,20 @@ async function N(e) {
|
|
|
44
44
|
return !1;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function F(e) {
|
|
48
48
|
return globalThis.navigator?.vibrate?.(e) ?? !1;
|
|
49
49
|
}
|
|
50
|
-
async function
|
|
50
|
+
async function I(e, t = {}) {
|
|
51
51
|
return !("Notification" in globalThis) || (Notification.permission === "default" ? await Notification.requestPermission() : Notification.permission) !== "granted" ? !1 : (new Notification(e, t), !0);
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function L(e, t = {}) {
|
|
54
54
|
if (!("speechSynthesis" in globalThis)) return Promise.resolve(!1);
|
|
55
55
|
let n = new SpeechSynthesisUtterance(e);
|
|
56
56
|
return Object.assign(n, Object.fromEntries(Object.entries(t).filter(([, e]) => e !== void 0))), new Promise((e) => {
|
|
57
57
|
n.onend = () => e(!0), n.onerror = () => e(!1), speechSynthesis.cancel(), speechSynthesis.speak(n);
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
async function
|
|
60
|
+
async function R() {
|
|
61
61
|
let e = globalThis.EyeDropper;
|
|
62
62
|
if (!e) return "";
|
|
63
63
|
try {
|
|
@@ -67,44 +67,67 @@ async function L() {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
// src/runtime/config.ts
|
|
70
|
-
var
|
|
70
|
+
var z = {
|
|
71
71
|
antDesign: e,
|
|
72
72
|
bootstrap: t,
|
|
73
73
|
element: n,
|
|
74
74
|
quasar: r,
|
|
75
75
|
tailwind: i,
|
|
76
76
|
vuetify: a
|
|
77
|
-
},
|
|
78
|
-
function
|
|
79
|
-
Object.assign(
|
|
77
|
+
}, B = b({ breakpoints: "tailwind" });
|
|
78
|
+
function V(e) {
|
|
79
|
+
Object.assign(B, e);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
return
|
|
81
|
+
function H() {
|
|
82
|
+
return B.breakpoints;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
return Object.keys(
|
|
84
|
+
function U(e) {
|
|
85
|
+
return Object.keys(z[e] ?? i);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
return c(
|
|
87
|
+
function W() {
|
|
88
|
+
return c(z[B.breakpoints] ?? i);
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
let t =
|
|
90
|
+
function G(e) {
|
|
91
|
+
let t = W();
|
|
92
92
|
return {
|
|
93
93
|
greaterOrEqual: t.greaterOrEqual(e),
|
|
94
94
|
smaller: t.smaller(e)
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
|
+
// src/runtime/drag.ts
|
|
98
|
+
function K() {
|
|
99
|
+
let e = x(0), t = x(0), n = x(!1), r;
|
|
100
|
+
function i(i) {
|
|
101
|
+
r?.(), i.preventDefault?.();
|
|
102
|
+
let a = i.clientX - e.value, o = i.clientY - t.value;
|
|
103
|
+
n.value = !0;
|
|
104
|
+
let s = [d(window, "pointermove", (n) => {
|
|
105
|
+
e.value = n.clientX - a, t.value = n.clientY - o;
|
|
106
|
+
}), d(window, ["pointerup", "pointercancel"], () => {
|
|
107
|
+
n.value = !1, r?.();
|
|
108
|
+
})];
|
|
109
|
+
r = () => {
|
|
110
|
+
s.forEach((e) => e()), r = void 0;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
return ee(() => r?.()), {
|
|
114
|
+
isDragging: n,
|
|
115
|
+
start: i,
|
|
116
|
+
x: e,
|
|
117
|
+
y: t
|
|
118
|
+
};
|
|
119
|
+
}
|
|
97
120
|
// src/runtime/instances.ts
|
|
98
|
-
function
|
|
99
|
-
let e =
|
|
121
|
+
function q() {
|
|
122
|
+
let e = y() ?? v(!0), t = /* @__PURE__ */ new Map();
|
|
100
123
|
return function(n, r, i) {
|
|
101
124
|
let a = t.get(i);
|
|
102
125
|
if (a && a.deps.length === n.length && a.deps.every((e, t) => Object.is(e, n[t]))) return a.value;
|
|
103
126
|
if (a?.scope.stop(), !e.active) {
|
|
104
|
-
let e =
|
|
127
|
+
let e = v(!0), t = e.run(r);
|
|
105
128
|
return e.stop(), t;
|
|
106
129
|
}
|
|
107
|
-
let o = e.run(() =>
|
|
130
|
+
let o = e.run(() => v()), s = o.run(r);
|
|
108
131
|
return t.set(i, {
|
|
109
132
|
deps: n,
|
|
110
133
|
scope: o,
|
|
@@ -113,7 +136,7 @@ function G() {
|
|
|
113
136
|
};
|
|
114
137
|
}
|
|
115
138
|
// src/runtime/state.ts
|
|
116
|
-
var
|
|
139
|
+
var J = /* @__PURE__ */ new Map(), Y = {
|
|
117
140
|
read: (e) => {
|
|
118
141
|
try {
|
|
119
142
|
return JSON.parse(e);
|
|
@@ -123,38 +146,38 @@ var K = /* @__PURE__ */ new Map(), q = {
|
|
|
123
146
|
},
|
|
124
147
|
write: (e) => JSON.stringify(e)
|
|
125
148
|
};
|
|
126
|
-
function
|
|
127
|
-
let n = `${t}:${e}`, r =
|
|
149
|
+
function X(e, t = "local") {
|
|
150
|
+
let n = `${t}:${e}`, r = J.get(n);
|
|
128
151
|
if (r) return r;
|
|
129
|
-
let i = t === "session" ? globalThis.sessionStorage : globalThis.localStorage, a =
|
|
130
|
-
serializer:
|
|
152
|
+
let i = t === "session" ? globalThis.sessionStorage : globalThis.localStorage, a = E(() => h(e, null, i, {
|
|
153
|
+
serializer: Y,
|
|
131
154
|
writeDefaults: !1
|
|
132
155
|
}));
|
|
133
|
-
return
|
|
156
|
+
return J.set(n, a), a;
|
|
134
157
|
}
|
|
135
|
-
function
|
|
136
|
-
return
|
|
158
|
+
function Z(e, t = "local", n) {
|
|
159
|
+
return X(e, t).value ?? n;
|
|
137
160
|
}
|
|
138
|
-
function
|
|
139
|
-
|
|
161
|
+
function Q(e, t, n = "local") {
|
|
162
|
+
X(e, n).value = t ?? null;
|
|
140
163
|
}
|
|
141
|
-
var
|
|
164
|
+
var $ = T(() => l({
|
|
142
165
|
emitAuto: !0,
|
|
143
166
|
onChanged: (e, t) => {
|
|
144
|
-
|
|
167
|
+
w() || t(e);
|
|
145
168
|
}
|
|
146
169
|
}));
|
|
147
|
-
function
|
|
148
|
-
|
|
170
|
+
function ne(e) {
|
|
171
|
+
$().store.value = e;
|
|
149
172
|
}
|
|
150
|
-
function
|
|
151
|
-
return o(
|
|
173
|
+
function re(e, t) {
|
|
174
|
+
return o(_(e), t);
|
|
152
175
|
}
|
|
153
|
-
function
|
|
154
|
-
return s(
|
|
176
|
+
function ie(e, t) {
|
|
177
|
+
return s(_(e), t);
|
|
155
178
|
}
|
|
156
|
-
function
|
|
157
|
-
let n = u(e, { scheduler: (e) =>
|
|
179
|
+
function ae(e, t) {
|
|
180
|
+
let n = u(e, { scheduler: (e) => p(e, t, { immediate: !1 }) });
|
|
158
181
|
return n.start(), n;
|
|
159
182
|
}
|
|
160
|
-
export {
|
|
183
|
+
export { z as breakpointPresets, V as configureReactivity, U as getBreakpointNames, H as getBreakpointPreset, $ as getColorMode, D as getFullscreen, O as getWakeLock, w as isEditorMode, N as isScrollLocked, I as notify, R as pickColor, Z as readStorage, ne as setColorMode, te as setEditorMode, A as setFullscreen, M as setScrollLock, j as setWakeLock, P as share, L as speak, G as useBreakpoint, W as useBreakpointPreset, re as useDebouncedValue, K as useDrag, q as useInstances, ae as useRunningCountdown, ie as useThrottledValue, F as vibrate, Q as writeStorage };
|