@axium/calendar 0.3.3 → 0.3.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/calendar",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "description": "Calendar for Axium",
6
6
  "funding": {
@@ -43,6 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "rrule": "^2.8.1",
46
+ "svelte-gestures": "^5.2.2",
46
47
  "zod": "^4.0.5"
47
48
  },
48
49
  "axium": {
@@ -18,6 +18,7 @@
18
18
  import { fetchAPI } from '@axium/client/requests';
19
19
  import { colorHashHex, encodeColor } from '@axium/core/color';
20
20
  import { rrulestr } from 'rrule';
21
+ import { useSwipe } from 'svelte-gestures';
21
22
  import { SvelteDate } from 'svelte/reactivity';
22
23
  import { _throw } from 'utilium';
23
24
  import * as z from 'zod';
@@ -188,7 +189,27 @@
188
189
  {/each}
189
190
  {/if}
190
191
  </div>
191
- <div id="cal">
192
+ <div
193
+ id="cal"
194
+ {...useSwipe(
195
+ e => {
196
+ if (e.detail.pointerType != 'touch') return;
197
+ switch (e.detail.direction) {
198
+ case 'left':
199
+ start.setDate(start.getDate() + spanDays);
200
+ end.setDate(end.getDate() + spanDays);
201
+ break;
202
+ case 'right':
203
+ start.setDate(start.getDate() - spanDays);
204
+ end.setDate(end.getDate() - spanDays);
205
+ break;
206
+ case 'top':
207
+ case 'bottom':
208
+ }
209
+ },
210
+ () => ({ touchAction: 'pan-y' })
211
+ )}
212
+ >
192
213
  <div id="hours" class="subtle">
193
214
  {#each { length: 24 }, i}
194
215
  {#if !i}