@luna-park/plugin-reactivity 0.0.0-stage → 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.
@@ -0,0 +1,183 @@
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
+ // src/runtime/shared.ts
4
+ var S = v(!0), C = !1;
5
+ function te(e) {
6
+ C = e;
7
+ }
8
+ function w() {
9
+ return C;
10
+ }
11
+ function T(e) {
12
+ let t;
13
+ return () => (t ??= S.run(e), t);
14
+ }
15
+ function E(e) {
16
+ return S.run(e);
17
+ }
18
+ // src/runtime/actions.ts
19
+ var D = T(() => f()), O = T(() => g()), k = T(() => m(globalThis.document?.body));
20
+ async function A(e) {
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
+ try {
27
+ e ? await t.request("screen") : await t.release();
28
+ } catch {
29
+ return !1;
30
+ }
31
+ return e;
32
+ }
33
+ function M(e) {
34
+ w() || (k().value = e);
35
+ }
36
+ function N() {
37
+ return k().value;
38
+ }
39
+ async function P(e) {
40
+ if (!globalThis.navigator?.share) return !1;
41
+ try {
42
+ return await navigator.share(e), !0;
43
+ } catch {
44
+ return !1;
45
+ }
46
+ }
47
+ function F(e) {
48
+ return globalThis.navigator?.vibrate?.(e) ?? !1;
49
+ }
50
+ async function I(e, t = {}) {
51
+ return !("Notification" in globalThis) || (Notification.permission === "default" ? await Notification.requestPermission() : Notification.permission) !== "granted" ? !1 : (new Notification(e, t), !0);
52
+ }
53
+ function L(e, t = {}) {
54
+ if (!("speechSynthesis" in globalThis)) return Promise.resolve(!1);
55
+ let n = new SpeechSynthesisUtterance(e);
56
+ return Object.assign(n, Object.fromEntries(Object.entries(t).filter(([, e]) => e !== void 0))), new Promise((e) => {
57
+ n.onend = () => e(!0), n.onerror = () => e(!1), speechSynthesis.cancel(), speechSynthesis.speak(n);
58
+ });
59
+ }
60
+ async function R() {
61
+ let e = globalThis.EyeDropper;
62
+ if (!e) return "";
63
+ try {
64
+ return (await new e().open()).sRGBHex;
65
+ } catch {
66
+ return "";
67
+ }
68
+ }
69
+ // src/runtime/config.ts
70
+ var z = {
71
+ antDesign: e,
72
+ bootstrap: t,
73
+ element: n,
74
+ quasar: r,
75
+ tailwind: i,
76
+ vuetify: a
77
+ }, B = b({ breakpoints: "tailwind" });
78
+ function V(e) {
79
+ Object.assign(B, e);
80
+ }
81
+ function H() {
82
+ return B.breakpoints;
83
+ }
84
+ function U(e) {
85
+ return Object.keys(z[e] ?? i);
86
+ }
87
+ function W() {
88
+ return c(z[B.breakpoints] ?? i);
89
+ }
90
+ function G(e) {
91
+ let t = W();
92
+ return {
93
+ greaterOrEqual: t.greaterOrEqual(e),
94
+ smaller: t.smaller(e)
95
+ };
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
+ }
120
+ // src/runtime/instances.ts
121
+ function q() {
122
+ let e = y() ?? v(!0), t = /* @__PURE__ */ new Map();
123
+ return function(n, r, i) {
124
+ let a = t.get(i);
125
+ if (a && a.deps.length === n.length && a.deps.every((e, t) => Object.is(e, n[t]))) return a.value;
126
+ if (a?.scope.stop(), !e.active) {
127
+ let e = v(!0), t = e.run(r);
128
+ return e.stop(), t;
129
+ }
130
+ let o = e.run(() => v()), s = o.run(r);
131
+ return t.set(i, {
132
+ deps: n,
133
+ scope: o,
134
+ value: s
135
+ }), s;
136
+ };
137
+ }
138
+ // src/runtime/state.ts
139
+ var J = /* @__PURE__ */ new Map(), Y = {
140
+ read: (e) => {
141
+ try {
142
+ return JSON.parse(e);
143
+ } catch {
144
+ return e;
145
+ }
146
+ },
147
+ write: (e) => JSON.stringify(e)
148
+ };
149
+ function X(e, t = "local") {
150
+ let n = `${t}:${e}`, r = J.get(n);
151
+ if (r) return r;
152
+ let i = t === "session" ? globalThis.sessionStorage : globalThis.localStorage, a = E(() => h(e, null, i, {
153
+ serializer: Y,
154
+ writeDefaults: !1
155
+ }));
156
+ return J.set(n, a), a;
157
+ }
158
+ function Z(e, t = "local", n) {
159
+ return X(e, t).value ?? n;
160
+ }
161
+ function Q(e, t, n = "local") {
162
+ X(e, n).value = t ?? null;
163
+ }
164
+ var $ = T(() => l({
165
+ emitAuto: !0,
166
+ onChanged: (e, t) => {
167
+ w() || t(e);
168
+ }
169
+ }));
170
+ function ne(e) {
171
+ $().store.value = e;
172
+ }
173
+ function re(e, t) {
174
+ return o(_(e), t);
175
+ }
176
+ function ie(e, t) {
177
+ return s(_(e), t);
178
+ }
179
+ function ae(e, t) {
180
+ let n = u(e, { scheduler: (e) => p(e, t, { immediate: !1 }) });
181
+ return n.start(), n;
182
+ }
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 };
package/package.json CHANGED
@@ -1,6 +1,64 @@
1
1
  {
2
2
  "name": "@luna-park/plugin-reactivity",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.1.0",
4
+ "private": false,
5
+ "description": "Reactivity plugin for Luna Park: browser, sensor, time and state nodes powered by VueUse.",
6
+ "keywords": [
7
+ "luna-park",
8
+ "plugin",
9
+ "reactivity",
10
+ "vueuse"
11
+ ],
12
+ "homepage": "https://luna-park.app",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/lunapark/plugin-reactivity"
16
+ },
17
+ "author": {
18
+ "name": "Luna Park",
19
+ "url": "https://luna-park.app"
20
+ },
21
+ "type": "module",
22
+ "exports": {
23
+ ".": {
24
+ "import": "./dist/index.js"
25
+ },
26
+ "./runtime": {
27
+ "import": "./dist/runtime.js"
28
+ }
29
+ },
30
+ "module": "./dist/index.js",
31
+ "files": [
32
+ "dist/**",
33
+ "src/logo.svg"
34
+ ],
35
+ "dependencies": {
36
+ "@vueuse/core": "^15.0.0",
37
+ "vue": "^3.5.45"
38
+ },
39
+ "devDependencies": {
40
+ "@fortawesome/pro-solid-svg-icons": "link:..\\..\\@fortawesome\\pro-solid-svg-icons",
41
+ "@luna-park/eslint-config": "^1.4.5",
42
+ "@luna-park/plugin": "^2.2.0",
43
+ "@types/node": "^26.6.6",
44
+ "@vue/tsconfig": "^0.9.1",
45
+ "eslint": "^10.14.0",
46
+ "globals": "^17.14.0",
47
+ "typescript": "^6.0.3",
48
+ "typescript-eslint": "^8.72.2",
49
+ "vite": "^8.3.7",
50
+ "vue-tsc": "^3.3.14"
51
+ },
52
+ "peerDependencies": {
53
+ "@vueuse/core": "^15.0.0",
54
+ "vue": "^3.5.43"
55
+ },
56
+ "scripts": {
57
+ "build": "vite build && vite build --mode runtime",
58
+ "dev": "vite build --watch",
59
+ "preview": "luna-preview",
60
+ "typecheck": "vue-tsc -b",
61
+ "lint": "eslint .",
62
+ "lint:fix": "eslint . --fix"
63
+ }
6
64
  }
package/src/logo.svg ADDED
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#42B883" stroke-width="2"
2
+ stroke-linecap="round" stroke-linejoin="round">
3
+ <path d="M13.5 4.5 8 12.5h4l-1.5 7 5.5-8h-4z" fill="#42B883"/>
4
+ <path d="M5.6 5.6a9 9 0 0 0 0 12.8"/>
5
+ <path d="M18.4 5.6a9 9 0 0 1 0 12.8"/>
6
+ </svg>
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.