@axium/contacts 0.2.7 → 0.2.8

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.
Files changed (2) hide show
  1. package/lib/Field.svelte +5 -1
  2. package/package.json +1 -1
package/lib/Field.svelte CHANGED
@@ -1,4 +1,6 @@
1
1
  <script lang="ts">
2
+ import { invalidate } from '$app/navigation';
3
+
2
4
  interface Props {
3
5
  text: string;
4
6
  isDefault?: boolean;
@@ -7,6 +9,8 @@
7
9
  }
8
10
 
9
11
  const { text, isDefault, label, link }: Props = $props();
12
+
13
+ const invalidatePattern = /^\/contacts\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i;
10
14
  </script>
11
15
 
12
16
  {#snippet content()}
@@ -19,7 +23,7 @@
19
23
  <span>
20
24
  {#if link}
21
25
  {#if link[0] == '/' && link[1] != '/'}
22
- <a href={link}>{@render content()}</a>
26
+ <a href={link} onclick={() => invalidate(url => invalidatePattern.test(url.pathname))}>{@render content()}</a>
23
27
  {:else}
24
28
  <a href={link} target="_blank" rel="noopener noreferrer">{@render content()}</a>
25
29
  {/if}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/contacts",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "author": "James Prevett <axium@jamespre.dev>",
5
5
  "description": "Contacts for Axium",
6
6
  "funding": {