Skip to content

Commit 580bf12

Browse files
Build
1 parent 245f3cb commit 580bf12

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

dist/vue-easter-egg-trigger.cjs.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/vue-easter-egg-trigger.es.js

+19-16
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,37 @@ import { defineComponent as D, inject as O, reactive as l, watchEffect as R, onM
22
import { includes as m, isEqual as U, uniq as E } from "lodash";
33
/**
44
* @name @wdns/vue-easter-egg-trigger
5-
* @version 3.0.1
5+
* @version 3.0.2
66
* @description Presenting the Vue Easter Egg Trigger, a tool that discreetly injects a touch of unexpectedness into Vue.js projects. This unassuming plugin, which operates on both keystrokes (with click events also available), brings hidden surprises to your applications.
77
* @author WebDevNerdStuff & Bunnies... lots and lots of bunnies! <[email protected]> (https://webdevnerdstuff.com)
88
* @copyright Copyright 2024, WebDevNerdStuff
99
* @homepage https://github.com/webdevnerdstuff/vue-easter-egg-trigger
1010
* @repository https://github.com/webdevnerdstuff/vue-easter-egg-trigger
1111
* @license MIT License
1212
*/
13-
const v = D({ __name: "VEasterEggTrigger", props: { callback: {}, destroy: { type: Boolean }, delay: { default: 500 }, pattern: { default: () => ["ArrowUp", "ArrowUp", "ArrowDown", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowLeft", "ArrowRight", "b", "a"] }, persist: { type: Boolean, default: !1 }, target: { default: "body" }, type: { default: "keydown" } }, emits: ["triggered"], setup(c, { emit: a }) {
14-
const N = a, g = c, y = O(L, {}), e = l({ ...g, ...y });
13+
const y = D({ __name: "VEasterEggTrigger", props: { callback: {}, destroy: { type: Boolean }, delay: { default: 500 }, pattern: { default: () => ["ArrowUp", "ArrowUp", "ArrowDown", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowLeft", "ArrowRight", "b", "a"] }, persist: { type: Boolean, default: !1 }, target: { default: "body" }, type: { default: "keydown" } }, emits: ["triggered"], setup(c, { emit: o }) {
14+
const N = o, g = c, v = O(L, {}), e = l({ ...g, ...v });
1515
R(() => {
16-
Object.assign(e, { ...g, ...y });
16+
Object.assign(e, { ...g, ...v });
1717
});
1818
let d = l([]), r = null, s = setTimeout(() => {
1919
});
20-
const w = l(["click", "dblclick", "mouseup", "mousedown"]), o = l({ classNames: [], ids: [], nodes: [] });
20+
const w = l(["click", "dblclick", "mouseup", "mousedown"]), a = l({ classNames: [], ids: [], nodes: [] });
2121
function p(t) {
2222
const i = u("");
2323
if (s !== null && clearTimeout(s), t.key !== void 0 && (i.value = t.key), m(w, t.type)) {
2424
const n = t.currentTarget;
25-
i.value = t.type, o.nodes.push(n.nodeName.toLowerCase()), o.ids.push(n.id), o.classNames.push(n.classList.value);
25+
i.value = t.type, a.nodes.push(n.nodeName.toLowerCase()), a.ids.push(n.id), a.classNames.push(n.classList.value);
2626
}
2727
d.push(i.value), function(n) {
28-
if (U(e.pattern, d))
29-
return m(w, n.type) ? void function() {
30-
const f = e.target, V = f.replace("#", ""), q = f.replace(".", ""), T = E(o.nodes), k = E(o.ids), A = E(o.classNames), j = u(T.length === 1 && T[0] === f), B = u(k.length === 1 && k[0] === V), C = u(A.length === 1 && m(A[0], q));
31-
(j.value || B.value || C.value) && h(), b();
32-
}() : void h();
28+
if (U(e.pattern, d)) {
29+
if (m(w, n.type))
30+
return void function() {
31+
const f = e.target, V = f.replace("#", ""), q = f.replace(".", ""), T = E(a.nodes), k = E(a.ids), A = E(a.classNames), j = u(T.length === 1 && T[0] === f), B = u(k.length === 1 && k[0] === V), C = u(A.length === 1 && m(A[0], q));
32+
(j.value || B.value || C.value) && h(), b();
33+
}();
34+
h();
35+
}
3336
b();
3437
}(t);
3538
}
@@ -54,15 +57,15 @@ const v = D({ __name: "VEasterEggTrigger", props: { callback: {}, destroy: { typ
5457
}), (t, i) => null;
5558
} }), L = Symbol();
5659
function M(c = {}) {
57-
return (a) => {
58-
a.provide(L, c), a.component("EasterEggTrigger", v), a.component("VEasterEggTrigger", v);
60+
return (o) => {
61+
o.provide(L, c), o.component("EasterEggTrigger", y), o.component("VEasterEggTrigger", y);
5962
};
6063
}
61-
const $ = v;
64+
const $ = y;
6265
export {
6366
$ as EasterEggTrigger,
64-
v as VEasterEggTrigger,
67+
y as VEasterEggTrigger,
6568
M as createVEasterEggTrigger,
66-
v as default,
69+
y as default,
6770
L as globalOptions
6871
};

0 commit comments

Comments
 (0)