@rokkit/actions 1.0.0-next.145 → 1.0.0-next.146
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/package.json
CHANGED
package/src/hover-lift.svelte.js
CHANGED
|
@@ -21,7 +21,9 @@ function resolveHoverLiftOpts(options) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function isReducedMotion() {
|
|
24
|
-
return
|
|
24
|
+
return (
|
|
25
|
+
typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
26
|
+
)
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
function applyHoverLift(node, opts) {
|
package/src/magnetic.svelte.js
CHANGED
|
@@ -15,7 +15,9 @@ function resolveMagneticOpts(options) {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
function isReducedMotion() {
|
|
18
|
-
return
|
|
18
|
+
return (
|
|
19
|
+
typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
20
|
+
)
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
function applyMagnetic(node, opts) {
|
package/src/navigator.svelte.js
CHANGED
|
@@ -146,7 +146,10 @@ function makeKeydownHandler(ctx, config, handlers, ta) {
|
|
|
146
146
|
|
|
147
147
|
const prevKey = wrapper.focusedKey
|
|
148
148
|
const handled = handleAction(event, handlers[action])
|
|
149
|
-
if (!handled) {
|
|
149
|
+
if (!handled) {
|
|
150
|
+
runTypeahead(config, wrapper, ta, event)
|
|
151
|
+
return
|
|
152
|
+
}
|
|
150
153
|
|
|
151
154
|
ta.reset()
|
|
152
155
|
emitAction(node, wrapper, action, true)
|
|
@@ -166,7 +169,10 @@ function makeTypeahead(node, wrapper) {
|
|
|
166
169
|
|
|
167
170
|
function reset() {
|
|
168
171
|
buffer = ''
|
|
169
|
-
if (timer) {
|
|
172
|
+
if (timer) {
|
|
173
|
+
clearTimeout(timer)
|
|
174
|
+
timer = null
|
|
175
|
+
}
|
|
170
176
|
}
|
|
171
177
|
|
|
172
178
|
function handle(event) {
|
|
@@ -221,6 +227,9 @@ export function navigator(node, options) {
|
|
|
221
227
|
|
|
222
228
|
$effect(() => {
|
|
223
229
|
const cleanup = [on(node, 'keydown', handleKeydown), on(node, 'click', handleClick)]
|
|
224
|
-
return () => {
|
|
230
|
+
return () => {
|
|
231
|
+
ta.reset()
|
|
232
|
+
cleanup.forEach((fn) => fn())
|
|
233
|
+
}
|
|
225
234
|
})
|
|
226
235
|
}
|
package/src/ripple.svelte.js
CHANGED
|
@@ -16,7 +16,9 @@ function resolveRippleOpts(options) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function isReducedMotion() {
|
|
19
|
-
return
|
|
19
|
+
return (
|
|
20
|
+
typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
21
|
+
)
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
function injectRippleKeyframes() {
|
|
@@ -66,7 +68,9 @@ function applyRipple(node, opts) {
|
|
|
66
68
|
const span = createRippleSpan(e, node, opts)
|
|
67
69
|
node.appendChild(span)
|
|
68
70
|
span.addEventListener('animationend', () => span.remove(), { once: true })
|
|
69
|
-
setTimeout(() => {
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
if (span.parentNode) span.remove()
|
|
73
|
+
}, opts.duration + 100)
|
|
70
74
|
}
|
|
71
75
|
|
|
72
76
|
injectRippleKeyframes()
|