@gospore/theme 1.0.92 → 1.0.93
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/theme.es.js +263 -381
- package/dist/theme.umd.js +2 -2
- package/package.json +6 -5
package/dist/theme.es.js
CHANGED
|
@@ -1,401 +1,283 @@
|
|
|
1
|
-
import { openBlock, createElementBlock, renderSlot } from "vue";
|
|
2
|
-
var
|
|
3
|
-
|
|
1
|
+
import { defineComponent as V, ref as $, provide as z, watch as H, onBeforeUnmount as J, openBlock as Q, createElementBlock as Z, renderSlot as ee } from "vue";
|
|
2
|
+
var te = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, C = {}, ne = {
|
|
3
|
+
get exports() {
|
|
4
|
+
return C;
|
|
5
|
+
},
|
|
6
|
+
set exports(w) {
|
|
7
|
+
C = w;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
4
10
|
/**
|
|
5
11
|
* what-input - A global utility for tracking the current input method (mouse, keyboard or touch).
|
|
6
12
|
* @version v5.2.12
|
|
7
13
|
* @link https://github.com/ten1seven/what-input
|
|
8
14
|
* @license MIT
|
|
9
15
|
*/
|
|
10
|
-
(function(
|
|
11
|
-
(function
|
|
12
|
-
|
|
13
|
-
})(
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
__webpack_require__.c = installedModules;
|
|
30
|
-
__webpack_require__.p = "";
|
|
31
|
-
return __webpack_require__(0);
|
|
32
|
-
}([
|
|
33
|
-
function(module2, exports2) {
|
|
34
|
-
module2.exports = function() {
|
|
35
|
-
if (typeof document === "undefined" || typeof window === "undefined") {
|
|
36
|
-
return {
|
|
37
|
-
ask: function ask() {
|
|
38
|
-
return "initial";
|
|
39
|
-
},
|
|
40
|
-
element: function element() {
|
|
41
|
-
return null;
|
|
42
|
-
},
|
|
43
|
-
ignoreKeys: function ignoreKeys() {
|
|
44
|
-
},
|
|
45
|
-
specificKeys: function specificKeys() {
|
|
46
|
-
},
|
|
47
|
-
registerOnChange: function registerOnChange() {
|
|
48
|
-
},
|
|
49
|
-
unRegisterOnChange: function unRegisterOnChange() {
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
var docElem = document.documentElement;
|
|
54
|
-
var currentElement = null;
|
|
55
|
-
var currentInput = "initial";
|
|
56
|
-
var currentIntent = currentInput;
|
|
57
|
-
var currentTimestamp = Date.now();
|
|
58
|
-
var shouldPersist = false;
|
|
59
|
-
var formInputs = ["button", "input", "select", "textarea"];
|
|
60
|
-
var functionList = [];
|
|
61
|
-
var ignoreMap = [
|
|
62
|
-
16,
|
|
63
|
-
17,
|
|
64
|
-
18,
|
|
65
|
-
91,
|
|
66
|
-
93
|
|
67
|
-
];
|
|
68
|
-
var specificMap = [];
|
|
69
|
-
var inputMap = {
|
|
70
|
-
keydown: "keyboard",
|
|
71
|
-
keyup: "keyboard",
|
|
72
|
-
mousedown: "mouse",
|
|
73
|
-
mousemove: "mouse",
|
|
74
|
-
MSPointerDown: "pointer",
|
|
75
|
-
MSPointerMove: "pointer",
|
|
76
|
-
pointerdown: "pointer",
|
|
77
|
-
pointermove: "pointer",
|
|
78
|
-
touchstart: "touch",
|
|
79
|
-
touchend: "touch"
|
|
16
|
+
(function(w, p) {
|
|
17
|
+
(function(u, r) {
|
|
18
|
+
w.exports = r();
|
|
19
|
+
})(te, function() {
|
|
20
|
+
return (
|
|
21
|
+
/******/
|
|
22
|
+
function(c) {
|
|
23
|
+
var u = {};
|
|
24
|
+
function r(i) {
|
|
25
|
+
if (u[i])
|
|
26
|
+
return u[i].exports;
|
|
27
|
+
var s = u[i] = {
|
|
28
|
+
/******/
|
|
29
|
+
exports: {},
|
|
30
|
+
/******/
|
|
31
|
+
id: i,
|
|
32
|
+
/******/
|
|
33
|
+
loaded: !1
|
|
34
|
+
/******/
|
|
80
35
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
window.addEventListener("pointermove", setIntent, true);
|
|
111
|
-
} else if (window.MSPointerEvent) {
|
|
112
|
-
window.addEventListener("MSPointerDown", setInput, true);
|
|
113
|
-
window.addEventListener("MSPointerMove", setIntent, true);
|
|
114
|
-
} else {
|
|
115
|
-
window.addEventListener("mousedown", setInput, true);
|
|
116
|
-
window.addEventListener("mousemove", setIntent, true);
|
|
117
|
-
if ("ontouchstart" in window) {
|
|
118
|
-
window.addEventListener("touchstart", setInput, options);
|
|
119
|
-
window.addEventListener("touchend", setInput, true);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
window.addEventListener(detectWheel(), setIntent, options);
|
|
123
|
-
window.addEventListener("keydown", setInput, true);
|
|
124
|
-
window.addEventListener("keyup", setInput, true);
|
|
125
|
-
window.addEventListener("focusin", setElement, true);
|
|
126
|
-
window.addEventListener("focusout", clearElement, true);
|
|
127
|
-
};
|
|
128
|
-
var setPersist = function setPersist2() {
|
|
129
|
-
shouldPersist = !(docElem.getAttribute("data-whatpersist") === "false" || document.body.getAttribute("data-whatpersist") === "false");
|
|
130
|
-
if (shouldPersist) {
|
|
131
|
-
try {
|
|
132
|
-
if (window.sessionStorage.getItem("what-input")) {
|
|
133
|
-
currentInput = window.sessionStorage.getItem("what-input");
|
|
36
|
+
return c[i].call(s.exports, s, s.exports, r), s.loaded = !0, s.exports;
|
|
37
|
+
}
|
|
38
|
+
return r.m = c, r.c = u, r.p = "", r(0);
|
|
39
|
+
}([
|
|
40
|
+
/* 0 */
|
|
41
|
+
/***/
|
|
42
|
+
function(c, u) {
|
|
43
|
+
c.exports = function() {
|
|
44
|
+
if (typeof document > "u" || typeof window > "u")
|
|
45
|
+
return {
|
|
46
|
+
// always return "initial" because no interaction will ever be detected
|
|
47
|
+
ask: function() {
|
|
48
|
+
return "initial";
|
|
49
|
+
},
|
|
50
|
+
// always return null
|
|
51
|
+
element: function() {
|
|
52
|
+
return null;
|
|
53
|
+
},
|
|
54
|
+
// no-op
|
|
55
|
+
ignoreKeys: function() {
|
|
56
|
+
},
|
|
57
|
+
// no-op
|
|
58
|
+
specificKeys: function() {
|
|
59
|
+
},
|
|
60
|
+
// no-op
|
|
61
|
+
registerOnChange: function() {
|
|
62
|
+
},
|
|
63
|
+
// no-op
|
|
64
|
+
unRegisterOnChange: function() {
|
|
134
65
|
}
|
|
135
|
-
|
|
136
|
-
|
|
66
|
+
};
|
|
67
|
+
var r = document.documentElement, i = null, s = "initial", a = s, k = Date.now(), E = !1, I = ["button", "input", "select", "textarea"], d = [], N = [
|
|
68
|
+
16,
|
|
69
|
+
// shift
|
|
70
|
+
17,
|
|
71
|
+
// control
|
|
72
|
+
18,
|
|
73
|
+
// alt
|
|
74
|
+
91,
|
|
75
|
+
// Windows key / left Apple cmd
|
|
76
|
+
93
|
|
77
|
+
// Windows menu / right Apple cmd
|
|
78
|
+
], m = [], M = {
|
|
79
|
+
keydown: "keyboard",
|
|
80
|
+
keyup: "keyboard",
|
|
81
|
+
mousedown: "mouse",
|
|
82
|
+
mousemove: "mouse",
|
|
83
|
+
MSPointerDown: "pointer",
|
|
84
|
+
MSPointerMove: "pointer",
|
|
85
|
+
pointerdown: "pointer",
|
|
86
|
+
pointermove: "pointer",
|
|
87
|
+
touchstart: "touch",
|
|
88
|
+
touchend: "touch"
|
|
89
|
+
// boolean: true if the page is being scrolled
|
|
90
|
+
}, v = !1, g = {
|
|
91
|
+
x: null,
|
|
92
|
+
y: null
|
|
93
|
+
// map of IE 10 pointer events
|
|
94
|
+
}, B = {
|
|
95
|
+
2: "touch",
|
|
96
|
+
3: "touch",
|
|
97
|
+
// treat pen like touch
|
|
98
|
+
4: "mouse"
|
|
99
|
+
// check support for passive event listeners
|
|
100
|
+
}, S = !1;
|
|
101
|
+
try {
|
|
102
|
+
var A = Object.defineProperty({}, "passive", {
|
|
103
|
+
get: function() {
|
|
104
|
+
S = !0;
|
|
137
105
|
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
doUpdate("input");
|
|
142
|
-
doUpdate("intent");
|
|
143
|
-
};
|
|
144
|
-
var setInput = function setInput2(event) {
|
|
145
|
-
var eventKey = event.which;
|
|
146
|
-
var value = inputMap[event.type];
|
|
147
|
-
if (value === "pointer") {
|
|
148
|
-
value = pointerType(event);
|
|
149
|
-
}
|
|
150
|
-
var ignoreMatch = !specificMap.length && ignoreMap.indexOf(eventKey) === -1;
|
|
151
|
-
var specificMatch = specificMap.length && specificMap.indexOf(eventKey) !== -1;
|
|
152
|
-
var shouldUpdate = value === "keyboard" && eventKey && (ignoreMatch || specificMatch) || value === "mouse" || value === "touch";
|
|
153
|
-
if (validateTouch(value)) {
|
|
154
|
-
shouldUpdate = false;
|
|
155
|
-
}
|
|
156
|
-
if (shouldUpdate && currentInput !== value) {
|
|
157
|
-
currentInput = value;
|
|
158
|
-
persistInput("input", currentInput);
|
|
159
|
-
doUpdate("input");
|
|
160
|
-
}
|
|
161
|
-
if (shouldUpdate && currentIntent !== value) {
|
|
162
|
-
var activeElem = document.activeElement;
|
|
163
|
-
var notFormInput = activeElem && activeElem.nodeName && (formInputs.indexOf(activeElem.nodeName.toLowerCase()) === -1 || activeElem.nodeName.toLowerCase() === "button" && !checkClosest(activeElem, "form"));
|
|
164
|
-
if (notFormInput) {
|
|
165
|
-
currentIntent = value;
|
|
166
|
-
persistInput("intent", currentIntent);
|
|
167
|
-
doUpdate("intent");
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
var doUpdate = function doUpdate2(which) {
|
|
172
|
-
docElem.setAttribute("data-what" + which, which === "input" ? currentInput : currentIntent);
|
|
173
|
-
fireFunctions(which);
|
|
174
|
-
};
|
|
175
|
-
var setIntent = function setIntent2(event) {
|
|
176
|
-
var value = inputMap[event.type];
|
|
177
|
-
if (value === "pointer") {
|
|
178
|
-
value = pointerType(event);
|
|
179
|
-
}
|
|
180
|
-
detectScrolling(event);
|
|
181
|
-
if ((!isScrolling && !validateTouch(value) || isScrolling && event.type === "wheel" || event.type === "mousewheel" || event.type === "DOMMouseScroll") && currentIntent !== value) {
|
|
182
|
-
currentIntent = value;
|
|
183
|
-
persistInput("intent", currentIntent);
|
|
184
|
-
doUpdate("intent");
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
var setElement = function setElement2(event) {
|
|
188
|
-
if (!event.target.nodeName) {
|
|
189
|
-
clearElement();
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
currentElement = event.target.nodeName.toLowerCase();
|
|
193
|
-
docElem.setAttribute("data-whatelement", currentElement);
|
|
194
|
-
if (event.target.classList && event.target.classList.length) {
|
|
195
|
-
docElem.setAttribute("data-whatclasses", event.target.classList.toString().replace(" ", ","));
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
var clearElement = function clearElement2() {
|
|
199
|
-
currentElement = null;
|
|
200
|
-
docElem.removeAttribute("data-whatelement");
|
|
201
|
-
docElem.removeAttribute("data-whatclasses");
|
|
202
|
-
};
|
|
203
|
-
var persistInput = function persistInput2(which, value) {
|
|
204
|
-
if (shouldPersist) {
|
|
205
|
-
try {
|
|
206
|
-
window.sessionStorage.setItem("what-" + which, value);
|
|
207
|
-
} catch (e) {
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
var pointerType = function pointerType2(event) {
|
|
212
|
-
if (typeof event.pointerType === "number") {
|
|
213
|
-
return pointerMap[event.pointerType];
|
|
214
|
-
} else {
|
|
215
|
-
return event.pointerType === "pen" ? "touch" : event.pointerType;
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
var validateTouch = function validateTouch2(value) {
|
|
219
|
-
var timestamp = Date.now();
|
|
220
|
-
var touchIsValid = value === "mouse" && currentInput === "touch" && timestamp - currentTimestamp < 200;
|
|
221
|
-
currentTimestamp = timestamp;
|
|
222
|
-
return touchIsValid;
|
|
223
|
-
};
|
|
224
|
-
var detectWheel = function detectWheel2() {
|
|
225
|
-
var wheelType = null;
|
|
226
|
-
if ("onwheel" in document.createElement("div")) {
|
|
227
|
-
wheelType = "wheel";
|
|
228
|
-
} else {
|
|
229
|
-
wheelType = document.onmousewheel !== void 0 ? "mousewheel" : "DOMMouseScroll";
|
|
106
|
+
});
|
|
107
|
+
window.addEventListener("test", null, A);
|
|
108
|
+
} catch {
|
|
230
109
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
110
|
+
var D = function() {
|
|
111
|
+
M[T()] = "mouse", K();
|
|
112
|
+
}, K = function() {
|
|
113
|
+
var e = S ? { passive: !0, capture: !0 } : !0;
|
|
114
|
+
document.addEventListener("DOMContentLoaded", U, !0), window.PointerEvent ? (window.addEventListener("pointerdown", l, !0), window.addEventListener("pointermove", y, !0)) : window.MSPointerEvent ? (window.addEventListener("MSPointerDown", l, !0), window.addEventListener("MSPointerMove", y, !0)) : (window.addEventListener("mousedown", l, !0), window.addEventListener("mousemove", y, !0), "ontouchstart" in window && (window.addEventListener("touchstart", l, e), window.addEventListener("touchend", l, !0))), window.addEventListener(T(), y, e), window.addEventListener("keydown", l, !0), window.addEventListener("keyup", l, !0), window.addEventListener("focusin", R, !0), window.addEventListener("focusout", _, !0);
|
|
115
|
+
}, U = function() {
|
|
116
|
+
if (E = !(r.getAttribute("data-whatpersist") === "false" || document.body.getAttribute("data-whatpersist") === "false"), E)
|
|
117
|
+
try {
|
|
118
|
+
window.sessionStorage.getItem("what-input") && (s = window.sessionStorage.getItem("what-input")), window.sessionStorage.getItem("what-intent") && (a = window.sessionStorage.getItem("what-intent"));
|
|
119
|
+
} catch {
|
|
120
|
+
}
|
|
121
|
+
f("input"), f("intent");
|
|
122
|
+
}, l = function(e) {
|
|
123
|
+
var t = e.which, o = M[e.type];
|
|
124
|
+
o === "pointer" && (o = x(e));
|
|
125
|
+
var W = !m.length && N.indexOf(t) === -1, X = m.length && m.indexOf(t) !== -1, L = o === "keyboard" && t && (W || X) || o === "mouse" || o === "touch";
|
|
126
|
+
if (O(o) && (L = !1), L && s !== o && (s = o, b("input", s), f("input")), L && a !== o) {
|
|
127
|
+
var h = document.activeElement, q = h && h.nodeName && (I.indexOf(h.nodeName.toLowerCase()) === -1 || h.nodeName.toLowerCase() === "button" && !F(h, "form"));
|
|
128
|
+
q && (a = o, b("intent", a), f("intent"));
|
|
237
129
|
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
130
|
+
}, f = function(e) {
|
|
131
|
+
r.setAttribute("data-what" + e, e === "input" ? s : a), j(e);
|
|
132
|
+
}, y = function(e) {
|
|
133
|
+
var t = M[e.type];
|
|
134
|
+
t === "pointer" && (t = x(e)), G(e), (!v && !O(t) || v && e.type === "wheel" || e.type === "mousewheel" || e.type === "DOMMouseScroll") && a !== t && (a = t, b("intent", a), f("intent"));
|
|
135
|
+
}, R = function(e) {
|
|
136
|
+
if (!e.target.nodeName) {
|
|
137
|
+
_();
|
|
138
|
+
return;
|
|
244
139
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
isScrolling = true;
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
var checkClosest = function checkClosest2(elem, tag) {
|
|
257
|
-
var ElementPrototype = window.Element.prototype;
|
|
258
|
-
if (!ElementPrototype.matches) {
|
|
259
|
-
ElementPrototype.matches = ElementPrototype.msMatchesSelector || ElementPrototype.webkitMatchesSelector;
|
|
260
|
-
}
|
|
261
|
-
if (!ElementPrototype.closest) {
|
|
262
|
-
do {
|
|
263
|
-
if (elem.matches(tag)) {
|
|
264
|
-
return elem;
|
|
140
|
+
i = e.target.nodeName.toLowerCase(), r.setAttribute("data-whatelement", i), e.target.classList && e.target.classList.length && r.setAttribute("data-whatclasses", e.target.classList.toString().replace(" ", ","));
|
|
141
|
+
}, _ = function() {
|
|
142
|
+
i = null, r.removeAttribute("data-whatelement"), r.removeAttribute("data-whatclasses");
|
|
143
|
+
}, b = function(e, t) {
|
|
144
|
+
if (E)
|
|
145
|
+
try {
|
|
146
|
+
window.sessionStorage.setItem("what-" + e, t);
|
|
147
|
+
} catch {
|
|
265
148
|
}
|
|
266
|
-
|
|
267
|
-
|
|
149
|
+
}, x = function(e) {
|
|
150
|
+
return typeof e.pointerType == "number" ? B[e.pointerType] : e.pointerType === "pen" ? "touch" : e.pointerType;
|
|
151
|
+
}, O = function(e) {
|
|
152
|
+
var t = Date.now(), o = e === "mouse" && s === "touch" && t - k < 200;
|
|
153
|
+
return k = t, o;
|
|
154
|
+
}, T = function() {
|
|
155
|
+
var e = null;
|
|
156
|
+
return "onwheel" in document.createElement("div") ? e = "wheel" : e = document.onmousewheel !== void 0 ? "mousewheel" : "DOMMouseScroll", e;
|
|
157
|
+
}, j = function(e) {
|
|
158
|
+
for (var t = 0, o = d.length; t < o; t++)
|
|
159
|
+
d[t].type === e && d[t].fn.call(void 0, e === "input" ? s : a);
|
|
160
|
+
}, Y = function(e) {
|
|
161
|
+
for (var t = 0, o = d.length; t < o; t++)
|
|
162
|
+
if (d[t].fn === e)
|
|
163
|
+
return t;
|
|
164
|
+
}, G = function(e) {
|
|
165
|
+
g.x !== e.screenX || g.y !== e.screenY ? (v = !1, g.x = e.screenX, g.y = e.screenY) : v = !0;
|
|
166
|
+
}, F = function(e, t) {
|
|
167
|
+
var o = window.Element.prototype;
|
|
168
|
+
if (o.matches || (o.matches = o.msMatchesSelector || o.webkitMatchesSelector), o.closest)
|
|
169
|
+
return e.closest(t);
|
|
170
|
+
do {
|
|
171
|
+
if (e.matches(t))
|
|
172
|
+
return e;
|
|
173
|
+
e = e.parentElement || e.parentNode;
|
|
174
|
+
} while (e !== null && e.nodeType === 1);
|
|
268
175
|
return null;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
176
|
+
};
|
|
177
|
+
return "addEventListener" in window && Array.prototype.indexOf && D(), {
|
|
178
|
+
// returns string: the current input type
|
|
179
|
+
// opt: 'intent'|'input'
|
|
180
|
+
// 'input' (default): returns the same value as the `data-whatinput` attribute
|
|
181
|
+
// 'intent': includes `data-whatintent` value if it's different than `data-whatinput`
|
|
182
|
+
ask: function(e) {
|
|
183
|
+
return e === "intent" ? a : s;
|
|
184
|
+
},
|
|
185
|
+
// returns string: the currently focused element or null
|
|
186
|
+
element: function() {
|
|
187
|
+
return i;
|
|
188
|
+
},
|
|
189
|
+
// overwrites ignored keys with provided array
|
|
190
|
+
ignoreKeys: function(e) {
|
|
191
|
+
N = e;
|
|
192
|
+
},
|
|
193
|
+
// overwrites specific char keys to update on
|
|
194
|
+
specificKeys: function(e) {
|
|
195
|
+
m = e;
|
|
196
|
+
},
|
|
197
|
+
// attach functions to input and intent "events"
|
|
198
|
+
// funct: function to fire on change
|
|
199
|
+
// eventType: 'input'|'intent'
|
|
200
|
+
registerOnChange: function(e, t) {
|
|
201
|
+
d.push({
|
|
202
|
+
fn: e,
|
|
203
|
+
type: t || "input"
|
|
204
|
+
});
|
|
205
|
+
},
|
|
206
|
+
unRegisterOnChange: function(e) {
|
|
207
|
+
var t = Y(e);
|
|
208
|
+
(t || t === 0) && d.splice(t, 1);
|
|
209
|
+
},
|
|
210
|
+
clearStorage: function() {
|
|
211
|
+
window.sessionStorage.clear();
|
|
299
212
|
}
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
]);
|
|
213
|
+
};
|
|
214
|
+
}();
|
|
215
|
+
}
|
|
216
|
+
/******/
|
|
217
|
+
])
|
|
218
|
+
);
|
|
308
219
|
});
|
|
309
|
-
})(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
};
|
|
324
|
-
},
|
|
325
|
-
data() {
|
|
326
|
-
return {
|
|
327
|
-
theme: {
|
|
328
|
-
darkMode: window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
},
|
|
332
|
-
watch: {
|
|
333
|
-
theme: {
|
|
334
|
-
handler() {
|
|
335
|
-
document.documentElement.setAttribute("dark-mode", this.theme.darkMode);
|
|
220
|
+
})(ne);
|
|
221
|
+
const oe = { class: "theme" }, re = V({
|
|
222
|
+
name: "Theme"
|
|
223
|
+
}), ae = /* @__PURE__ */ Object.assign(re, {
|
|
224
|
+
setup(w) {
|
|
225
|
+
const p = $({
|
|
226
|
+
darkMode: window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
227
|
+
});
|
|
228
|
+
z("theme", p), window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", u);
|
|
229
|
+
var c = document.createElement("meta");
|
|
230
|
+
c.name = "color-scheme", c.setAttribute("content", "light dark"), document.getElementsByTagName("head")[0].appendChild(c), H(
|
|
231
|
+
p.value,
|
|
232
|
+
() => {
|
|
233
|
+
document.documentElement.setAttribute("dark-mode", p.value.darkMode);
|
|
336
234
|
},
|
|
337
|
-
deep:
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
var colorSchemeMeta = document.createElement("meta");
|
|
344
|
-
colorSchemeMeta.name = "color-scheme";
|
|
345
|
-
colorSchemeMeta.setAttribute("content", "light dark");
|
|
346
|
-
document.getElementsByTagName("head")[0].appendChild(colorSchemeMeta);
|
|
347
|
-
},
|
|
348
|
-
beforeUnmount() {
|
|
349
|
-
window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change", this.updateDarkMode);
|
|
350
|
-
},
|
|
351
|
-
methods: {
|
|
352
|
-
updateDarkMode(event) {
|
|
353
|
-
if (!event) {
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
this.theme.darkMode = event.matches;
|
|
235
|
+
{ deep: !0, immediate: !0 }
|
|
236
|
+
), J(() => {
|
|
237
|
+
window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change", u);
|
|
238
|
+
});
|
|
239
|
+
function u(r) {
|
|
240
|
+
r && (p.value.darkMode = r.matches);
|
|
357
241
|
}
|
|
242
|
+
return (r, i) => (Q(), Z("div", oe, [
|
|
243
|
+
ee(r.$slots, "default")
|
|
244
|
+
]));
|
|
358
245
|
}
|
|
246
|
+
}), ce = "hsl(225, 90%, 16%)", ue = "#061f80", P = "hsl(225, 94%, 35%)", de = "#06c", le = "hsl(210, 100%, 50%)", pe = "hsl(210, 100%, 93%)", fe = "hsl(225, 100%, 96%)", he = "hsl(12, 91%, 46%)", we = "hsl(11, 100%, 59%)", me = "hsl(40, 100%, 50%)", ve = "hsl(46, 100%, 50%)", ge = "hsl(120, 100%, 25%)", ye = "#36b37e", Ee = "hsl(0, 0%, 0%)", Me = "hsl(218, 76%, 15%)", be = "hsla(0,0%,10%,.9)", Le = "hsla(0,0%,10%,.6)", ke = "hsl(218, 20%, 39%)", Ne = "hsl(218, 17%, 44%)", Se = "hsl(218, 14%, 49%)", _e = "hsl(218, 14%, 54%)", xe = "hsl(218, 13%, 59%)", Oe = "hsl(218, 13%, 64%)", Te = "hsl(217, 13%, 69%)", Ce = "hsl(223, 12%, 89%)", Pe = "hsl(228, 14%, 93%)", Ie = "hsl(210, 7%, 95%)", Be = "hsl(220, 16%, 96%)", Ae = "hsl(210, 25%, 98%)", De = "hsl(0, 0%, 98%)", se = "hsl(0, 0%, 100%)", Ke = P, Ue = P, Re = se;
|
|
247
|
+
export {
|
|
248
|
+
fe as B100,
|
|
249
|
+
pe as B200,
|
|
250
|
+
le as B300,
|
|
251
|
+
de as B400,
|
|
252
|
+
P as B500,
|
|
253
|
+
ue as B600,
|
|
254
|
+
ce as B900,
|
|
255
|
+
ye as G300,
|
|
256
|
+
ge as G500,
|
|
257
|
+
se as N0,
|
|
258
|
+
Ae as N10,
|
|
259
|
+
_e as N100,
|
|
260
|
+
Ee as N1000,
|
|
261
|
+
Be as N20,
|
|
262
|
+
Se as N200,
|
|
263
|
+
Ie as N25,
|
|
264
|
+
Pe as N30,
|
|
265
|
+
Ne as N300,
|
|
266
|
+
Ce as N40,
|
|
267
|
+
ke as N400,
|
|
268
|
+
De as N5,
|
|
269
|
+
Le as N500,
|
|
270
|
+
Te as N70,
|
|
271
|
+
Oe as N80,
|
|
272
|
+
be as N800,
|
|
273
|
+
xe as N90,
|
|
274
|
+
Me as N900,
|
|
275
|
+
we as R300,
|
|
276
|
+
he as R400,
|
|
277
|
+
ae as Theme,
|
|
278
|
+
ve as Y200,
|
|
279
|
+
me as Y300,
|
|
280
|
+
Ke as primary1,
|
|
281
|
+
Ue as primary2,
|
|
282
|
+
Re as primary3
|
|
359
283
|
};
|
|
360
|
-
const _hoisted_1 = { class: "theme" };
|
|
361
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
362
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
363
|
-
renderSlot(_ctx.$slots, "default")
|
|
364
|
-
]);
|
|
365
|
-
}
|
|
366
|
-
var Theme = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
367
|
-
const B900 = "hsl(225, 90%, 16%)";
|
|
368
|
-
const B600 = "#061f80";
|
|
369
|
-
const B500 = "hsl(225, 94%, 35%)";
|
|
370
|
-
const B400 = "#06c";
|
|
371
|
-
const B300 = "hsl(210, 100%, 50%)";
|
|
372
|
-
const B200 = "hsl(210, 100%, 93%)";
|
|
373
|
-
const B100 = "hsl(225, 100%, 96%)";
|
|
374
|
-
const R400 = "hsl(12, 91%, 46%)";
|
|
375
|
-
const R300 = "hsl(11, 100%, 59%)";
|
|
376
|
-
const Y300 = "hsl(40, 100%, 50%)";
|
|
377
|
-
const Y200 = "hsl(46, 100%, 50%)";
|
|
378
|
-
const G500 = "hsl(120, 100%, 25%)";
|
|
379
|
-
const G300 = "#36b37e";
|
|
380
|
-
const N1000 = "hsl(0, 0%, 0%)";
|
|
381
|
-
const N900 = "hsl(218, 76%, 15%)";
|
|
382
|
-
const N800 = "hsla(0,0%,10%,.9)";
|
|
383
|
-
const N500 = "hsla(0,0%,10%,.6)";
|
|
384
|
-
const N400 = "hsl(218, 20%, 39%)";
|
|
385
|
-
const N300 = "hsl(218, 17%, 44%)";
|
|
386
|
-
const N200 = "hsl(218, 14%, 49%)";
|
|
387
|
-
const N100 = "hsl(218, 14%, 54%)";
|
|
388
|
-
const N90 = "hsl(218, 13%, 59%)";
|
|
389
|
-
const N80 = "hsl(218, 13%, 64%)";
|
|
390
|
-
const N70 = "hsl(217, 13%, 69%)";
|
|
391
|
-
const N40 = "hsl(223, 12%, 89%)";
|
|
392
|
-
const N30 = "hsl(228, 14%, 93%)";
|
|
393
|
-
const N25 = "hsl(210, 7%, 95%)";
|
|
394
|
-
const N20 = "hsl(220, 16%, 96%)";
|
|
395
|
-
const N10 = "hsl(210, 25%, 98%)";
|
|
396
|
-
const N5 = "hsl(0, 0%, 98%)";
|
|
397
|
-
const N0 = "hsl(0, 0%, 100%)";
|
|
398
|
-
const primary1 = B500;
|
|
399
|
-
const primary2 = B500;
|
|
400
|
-
const primary3 = N0;
|
|
401
|
-
export { B100, B200, B300, B400, B500, B600, B900, G300, G500, N0, N10, N100, N1000, N20, N200, N25, N30, N300, N40, N400, N5, N500, N70, N80, N800, N90, N900, R300, R400, Y200, Y300, Theme as default, primary1, primary2, primary3 };
|
package/dist/theme.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(t,
|
|
1
|
+
(function(t,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(t=typeof globalThis<"u"?globalThis:t||self,a(t.theme={},t.Vue))})(this,function(t,a){"use strict";var K=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},_={},R={get exports(){return _},set exports(v){_=v}};/**
|
|
2
2
|
* what-input - A global utility for tracking the current input method (mouse, keyboard or touch).
|
|
3
3
|
* @version v5.2.12
|
|
4
4
|
* @link https://github.com/ten1seven/what-input
|
|
5
5
|
* @license MIT
|
|
6
|
-
*/(function(
|
|
6
|
+
*/(function(v,p){(function(l,i){v.exports=i()})(K,function(){return function(d){var l={};function i(c){if(l[c])return l[c].exports;var s=l[c]={exports:{},id:c,loaded:!1};return d[c].call(s.exports,s,s.exports,i),s.loaded=!0,s.exports}return i.m=d,i.c=l,i.p="",i(0)}([function(d,l){d.exports=function(){if(typeof document>"u"||typeof window>"u")return{ask:function(){return"initial"},element:function(){return null},ignoreKeys:function(){},specificKeys:function(){},registerOnChange:function(){},unRegisterOnChange:function(){}};var i=document.documentElement,c=null,s="initial",u=s,B=Date.now(),M=!1,ye=["button","input","select","textarea"],f=[],O=[16,17,18,91,93],g=[],L={keydown:"keyboard",keyup:"keyboard",mousedown:"mouse",mousemove:"mouse",MSPointerDown:"pointer",MSPointerMove:"pointer",pointerdown:"pointer",pointermove:"pointer",touchstart:"touch",touchend:"touch"},y=!1,N={x:null,y:null},Ne={2:"touch",3:"touch",4:"mouse"},C=!1;try{var Ee=Object.defineProperty({},"passive",{get:function(){C=!0}});window.addEventListener("test",null,Ee)}catch{}var be=function(){L[D()]="mouse",Me()},Me=function(){var e=C?{passive:!0,capture:!0}:!0;document.addEventListener("DOMContentLoaded",Le,!0),window.PointerEvent?(window.addEventListener("pointerdown",h,!0),window.addEventListener("pointermove",E,!0)):window.MSPointerEvent?(window.addEventListener("MSPointerDown",h,!0),window.addEventListener("MSPointerMove",E,!0)):(window.addEventListener("mousedown",h,!0),window.addEventListener("mousemove",E,!0),"ontouchstart"in window&&(window.addEventListener("touchstart",h,e),window.addEventListener("touchend",h,!0))),window.addEventListener(D(),E,e),window.addEventListener("keydown",h,!0),window.addEventListener("keyup",h,!0),window.addEventListener("focusin",ke,!0),window.addEventListener("focusout",P,!0)},Le=function(){if(M=!(i.getAttribute("data-whatpersist")==="false"||document.body.getAttribute("data-whatpersist")==="false"),M)try{window.sessionStorage.getItem("what-input")&&(s=window.sessionStorage.getItem("what-input")),window.sessionStorage.getItem("what-intent")&&(u=window.sessionStorage.getItem("what-intent"))}catch{}m("input"),m("intent")},h=function(e){var n=e.which,r=L[e.type];r==="pointer"&&(r=I(e));var Oe=!g.length&&O.indexOf(n)===-1,Ce=g.length&&g.indexOf(n)!==-1,S=r==="keyboard"&&n&&(Oe||Ce)||r==="mouse"||r==="touch";if(A(r)&&(S=!1),S&&s!==r&&(s=r,k("input",s),m("input")),S&&u!==r){var w=document.activeElement,Pe=w&&w.nodeName&&(ye.indexOf(w.nodeName.toLowerCase())===-1||w.nodeName.toLowerCase()==="button"&&!Be(w,"form"));Pe&&(u=r,k("intent",u),m("intent"))}},m=function(e){i.setAttribute("data-what"+e,e==="input"?s:u),Se(e)},E=function(e){var n=L[e.type];n==="pointer"&&(n=I(e)),Te(e),(!y&&!A(n)||y&&e.type==="wheel"||e.type==="mousewheel"||e.type==="DOMMouseScroll")&&u!==n&&(u=n,k("intent",u),m("intent"))},ke=function(e){if(!e.target.nodeName){P();return}c=e.target.nodeName.toLowerCase(),i.setAttribute("data-whatelement",c),e.target.classList&&e.target.classList.length&&i.setAttribute("data-whatclasses",e.target.classList.toString().replace(" ",","))},P=function(){c=null,i.removeAttribute("data-whatelement"),i.removeAttribute("data-whatclasses")},k=function(e,n){if(M)try{window.sessionStorage.setItem("what-"+e,n)}catch{}},I=function(e){return typeof e.pointerType=="number"?Ne[e.pointerType]:e.pointerType==="pen"?"touch":e.pointerType},A=function(e){var n=Date.now(),r=e==="mouse"&&s==="touch"&&n-B<200;return B=n,r},D=function(){var e=null;return"onwheel"in document.createElement("div")?e="wheel":e=document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",e},Se=function(e){for(var n=0,r=f.length;n<r;n++)f[n].type===e&&f[n].fn.call(void 0,e==="input"?s:u)},_e=function(e){for(var n=0,r=f.length;n<r;n++)if(f[n].fn===e)return n},Te=function(e){N.x!==e.screenX||N.y!==e.screenY?(y=!1,N.x=e.screenX,N.y=e.screenY):y=!0},Be=function(e,n){var r=window.Element.prototype;if(r.matches||(r.matches=r.msMatchesSelector||r.webkitMatchesSelector),r.closest)return e.closest(n);do{if(e.matches(n))return e;e=e.parentElement||e.parentNode}while(e!==null&&e.nodeType===1);return null};return"addEventListener"in window&&Array.prototype.indexOf&&be(),{ask:function(e){return e==="intent"?u:s},element:function(){return c},ignoreKeys:function(e){O=e},specificKeys:function(e){g=e},registerOnChange:function(e,n){f.push({fn:e,type:n||"input"})},unRegisterOnChange:function(e){var n=_e(e);(n||n===0)&&f.splice(n,1)},clearStorage:function(){window.sessionStorage.clear()}}}()}])})})(R);const Ie="",j={class:"theme"},U=a.defineComponent({name:"Theme"}),Y=Object.assign(U,{setup(v){const p=a.ref({darkMode:window.matchMedia("(prefers-color-scheme: dark)").matches});a.provide("theme",p),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",l);var d=document.createElement("meta");d.name="color-scheme",d.setAttribute("content","light dark"),document.getElementsByTagName("head")[0].appendChild(d),a.watch(p.value,()=>{document.documentElement.setAttribute("dark-mode",p.value.darkMode)},{deep:!0,immediate:!0}),a.onBeforeUnmount(()=>{window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",l)});function l(i){i&&(p.value.darkMode=i.matches)}return(i,c)=>(a.openBlock(),a.createElementBlock("div",j,[a.renderSlot(i.$slots,"default")]))}}),G="hsl(225, 90%, 16%)",q="#061f80",b="hsl(225, 94%, 35%)",F="#06c",V="hsl(210, 100%, 50%)",W="hsl(210, 100%, 93%)",X="hsl(225, 100%, 96%)",$="hsl(12, 91%, 46%)",z="hsl(11, 100%, 59%)",H="hsl(40, 100%, 50%)",J="hsl(46, 100%, 50%)",Q="hsl(120, 100%, 25%)",Z="#36b37e",x="hsl(0, 0%, 0%)",ee="hsl(218, 76%, 15%)",te="hsla(0,0%,10%,.9)",ne="hsla(0,0%,10%,.6)",oe="hsl(218, 20%, 39%)",re="hsl(218, 17%, 44%)",ie="hsl(218, 14%, 49%)",se="hsl(218, 14%, 54%)",ae="hsl(218, 13%, 59%)",ce="hsl(218, 13%, 64%)",ue="hsl(217, 13%, 69%)",de="hsl(223, 12%, 89%)",le="hsl(228, 14%, 93%)",fe="hsl(210, 7%, 95%)",he="hsl(220, 16%, 96%)",pe="hsl(210, 25%, 98%)",me="hsl(0, 0%, 98%)",T="hsl(0, 0%, 100%)",we=b,ve=b,ge=T;t.B100=X,t.B200=W,t.B300=V,t.B400=F,t.B500=b,t.B600=q,t.B900=G,t.G300=Z,t.G500=Q,t.N0=T,t.N10=pe,t.N100=se,t.N1000=x,t.N20=he,t.N200=ie,t.N25=fe,t.N30=le,t.N300=re,t.N40=de,t.N400=oe,t.N5=me,t.N500=ne,t.N70=ue,t.N80=ce,t.N800=te,t.N90=ae,t.N900=ee,t.R300=z,t.R400=$,t.Theme=Y,t.Y200=J,t.Y300=H,t.primary1=we,t.primary2=ve,t.primary3=ge,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gospore/theme",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.93",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Gospore",
|
|
6
6
|
"files": [
|
|
@@ -18,11 +18,12 @@
|
|
|
18
18
|
"build": "vite build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"what-input": "^5.2.
|
|
21
|
+
"what-input": "^5.2.12"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@vitejs/plugin-vue": "^
|
|
25
|
-
"
|
|
24
|
+
"@vitejs/plugin-vue": "^4.0.0",
|
|
25
|
+
"unplugin-vue-macros": "^1.9.1",
|
|
26
|
+
"vite": "^4.1.4"
|
|
26
27
|
},
|
|
27
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "f323d4fdab270d9ff4ef9e50a224992c0866fd4e"
|
|
28
29
|
}
|