@sierra-95/svelte-scaffold 1.0.44 → 1.0.46

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.
@@ -82,6 +82,19 @@
82
82
 
83
83
  localStorage.setItem(RECENT_SEARCH_KEY, JSON.stringify(recent));
84
84
  }
85
+
86
+
87
+ function navigate(result: SearchResult) {
88
+ const url = result.path + (result.sectionId ? `#${result.sectionId}` : '');
89
+
90
+ const isExternal = /^(https?:)?\/\//.test(result.path) || result.path.startsWith('mailto:');
91
+
92
+ if (isExternal) {
93
+ window.open(url, '_blank');
94
+ } else {
95
+ goto(url);
96
+ }
97
+ }
85
98
  </script>
86
99
 
87
100
  <style>
@@ -116,7 +129,7 @@
116
129
  {#each results as result}
117
130
  <MenuItem icon={result.icon} iconSize="15px" onclick={() => {
118
131
  saveRecentSearch(result);
119
- goto(result.path + (result.sectionId ? `#${result.sectionId}` : ''));
132
+ navigate(result);
120
133
  toggle();
121
134
  }}>{result.label}</MenuItem>
122
135
  {/each}
@@ -128,7 +141,7 @@
128
141
  {#each initialResults as result}
129
142
  <MenuItem icon={result.icon} iconSize="15px" onclick={() => {
130
143
  saveRecentSearch(result);
131
- goto(result.path + (result.sectionId ? `#${result.sectionId}` : ''));
144
+ navigate(result);
132
145
  toggle();
133
146
  }}>{result.label}</MenuItem>
134
147
  {/each}
@@ -11,7 +11,7 @@
11
11
  isLoading.set(true);
12
12
  const content = await exractContent(editor);
13
13
  editorStore.update((state) => ({ ...state, content }));
14
- $editorStore.onExport();
14
+ if($editorStore.content) $editorStore.onExport();
15
15
  }catch (error) {
16
16
  setToastMessage('error', 'An error occurred while processing content.');
17
17
  } finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sierra-95/svelte-scaffold",
3
- "version": "1.0.44",
3
+ "version": "1.0.46",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",