@rokkit/actions 1.0.0-next.144 → 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.
@@ -8,7 +8,7 @@ export type RevealOptions = {
8
8
  /**
9
9
  * Slide direction
10
10
  */
11
- direction?: "none" | "left" | "right" | "down" | "up" | undefined;
11
+ direction?: "none" | "up" | "down" | "left" | "right" | undefined;
12
12
  /**
13
13
  * Slide distance (CSS unit)
14
14
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rokkit/actions",
3
- "version": "1.0.0-next.144",
3
+ "version": "1.0.0-next.146",
4
4
  "description": "Contains generic actions that can be used in various components.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "ramda": "^0.32.0",
39
- "@rokkit/core": "workspace:latest"
39
+ "@rokkit/core": "latest"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@rokkit/helpers": "workspace:latest",
@@ -21,7 +21,9 @@ function resolveHoverLiftOpts(options) {
21
21
  }
22
22
 
23
23
  function isReducedMotion() {
24
- return typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches
24
+ return (
25
+ typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches
26
+ )
25
27
  }
26
28
 
27
29
  function applyHoverLift(node, opts) {
@@ -15,7 +15,9 @@ function resolveMagneticOpts(options) {
15
15
  }
16
16
 
17
17
  function isReducedMotion() {
18
- return typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches
18
+ return (
19
+ typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches
20
+ )
19
21
  }
20
22
 
21
23
  function applyMagnetic(node, opts) {
@@ -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) { runTypeahead(config, wrapper, ta, event); return }
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) { clearTimeout(timer); timer = null }
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 () => { ta.reset(); cleanup.forEach((fn) => fn()) }
230
+ return () => {
231
+ ta.reset()
232
+ cleanup.forEach((fn) => fn())
233
+ }
225
234
  })
226
235
  }
@@ -16,7 +16,9 @@ function resolveRippleOpts(options) {
16
16
  }
17
17
 
18
18
  function isReducedMotion() {
19
- return typeof window !== 'undefined' && window.matchMedia('(prefers-reduced-motion: reduce)').matches
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(() => { if (span.parentNode) span.remove() }, opts.duration + 100)
71
+ setTimeout(() => {
72
+ if (span.parentNode) span.remove()
73
+ }, opts.duration + 100)
70
74
  }
71
75
 
72
76
  injectRippleKeyframes()