@meaningfully/ui 0.0.5 → 0.0.7

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/README.md CHANGED
@@ -1,5 +1,3 @@
1
1
  # meaningfully-ui
2
2
 
3
- This is a library of UI components for [meaningfully](https://www.github.com/jeremybmerrill/meaningfully), which is an app (or collection of apps!) for semantic search over spreadsheets. See the main repo URL for more discussion.
4
-
5
-
3
+ This is a library of UI components for [meaningfully](https://www.github.com/jeremybmerrill/meaningfully), which is an app (or collection of apps!) for semantic search over spreadsheets. See the main repo URL for more discussion.
package/dist/App.svelte CHANGED
@@ -11,11 +11,15 @@
11
11
 
12
12
  interface Props {
13
13
  api: MeaningfullyAPI;
14
- basePath: string;
14
+ basePath_prop: string;
15
15
  }
16
- let { api, basePath }: Props = $props();
17
-
18
- let url = $state(basePath || '');
16
+ let { api, basePath_prop }: Props = $props();
17
+
18
+ // basepath must not be blank;
19
+ // unclear if it needs a trailing slash when using a subpath.
20
+ let basepath = $state(basePath_prop || '/');
21
+ console.log(`basepath App "${basepath}" (prop: "${basePath_prop}")`);
22
+ let url = $state('');
19
23
  // Ensure $state returns Settings | null
20
24
  let settings = $state<Settings | null>(null);
21
25
 
@@ -43,7 +47,7 @@
43
47
 
44
48
  <!-- <img alt="logo" class="logo" src={electronLogo} /> -->
45
49
 
46
- <Router url={url} >
50
+ <Router url={url} basepath={basepath}>
47
51
  <Link to="/">
48
52
  <h1 class="text-2xl font-bold">
49
53
  Meaningfully
@@ -68,7 +72,9 @@
68
72
  <Route path="search/:id" let:params>
69
73
  <SearchPage validApiKeysSet={validApiKeysSet} documentSetId={Number(params.id)} api={api} />
70
74
  </Route>
71
- <Route path="help" component={HelpPage} />
75
+ <Route path="help">
76
+ <HelpPage />
77
+ </Route>
72
78
  <Route path="settings">
73
79
  {#if settings}
74
80
  <ApiKeyPage settings={settings} settingsUpdated={() => getSettings() } api={api} />
@@ -80,6 +86,7 @@
80
86
  <Link to="" class="nav-link underline text-blue-600 hover:text-blue-800 visited:text-purple-600">Home</Link>
81
87
  <Link to="help" class="nav-link underline text-blue-600 hover:text-blue-800 visited:text-purple-600">Help</Link>
82
88
  <Link to="settings" class="nav-link underline text-blue-600 hover:text-blue-800 visited:text-purple-600">Settings / API Keys</Link>
89
+ <a href="https://github.com/jeremybmerrill/meaningfully" target="_blank" class="nav-link underline text-blue-600 hover:text-blue-800 visited:text-purple-600">GitHub</a>
83
90
  <span class="nav-link creator">Built with ✨ by Jeremy</span>
84
91
  <span class="nav-link">© 2025</span>
85
92
  </nav>
@@ -1,7 +1,7 @@
1
1
  import type { MeaningfullyAPI } from './types.js';
2
2
  interface Props {
3
3
  api: MeaningfullyAPI;
4
- basePath: string;
4
+ basePath_prop: string;
5
5
  }
6
6
  declare const App: import("svelte").Component<Props, {}, "">;
7
7
  type App = ReturnType<typeof App>;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { navigate } from 'svelte-routing'
3
- import type { MeaningfullyAPI } from '../types';
3
+ import type { MeaningfullyAPI } from '../types.js';
4
4
 
5
5
  interface Props {
6
6
  settings: Settings;
@@ -1,4 +1,4 @@
1
- import type { MeaningfullyAPI } from '../types';
1
+ import type { MeaningfullyAPI } from '../types.js';
2
2
  interface Props {
3
3
  settings: Settings;
4
4
  settingsUpdated: () => void;
@@ -10,7 +10,7 @@
10
10
 
11
11
  {#if !validApiKeysSet }
12
12
  <div class="alert alert-warning" data-testid="api-key-status">
13
- <p>No OpenAI API key is set. Please <Link to="/settings" class="text-blue text-decoration-line"><span class="text-blue text-decoration-line">add one</span></Link> (or details for another provider) in order to use Meaningfully.</p>
13
+ <p>No OpenAI API key is set. Please <Link to="settings" class="text-blue text-decoration-line"><span class="text-blue text-decoration-line">add one</span></Link> (or details for another provider) in order to use Meaningfully.</p>
14
14
  </div>
15
15
  {/if}
16
16
 
@@ -35,4 +35,4 @@
35
35
  cursor: pointer;
36
36
  font-weight: bold;
37
37
  }
38
- </style>
38
+ </style>
@@ -143,11 +143,12 @@
143
143
  [selectedTextColumn]: result.text
144
144
  }));
145
145
  } else {
146
- error = 'Preview generation failed';
146
+ error = previewResponse.message || 'Preview generation failed'; // fastify responses don't throw
147
+
147
148
  console.error('Preview generation failed:', previewResponse);
148
149
  }
149
150
  } catch (e: any) {
150
- error = e.message;
151
+ error = e.message; // electron errors throw
151
152
  } finally {
152
153
  generatingPreview = false;
153
154
  }
@@ -188,9 +189,9 @@
188
189
  if (uploadResponse.success) {
189
190
  navigate("/search/" + uploadResponse.documentSetId);
190
191
  } else {
191
- error = 'Upload failed';
192
+ error = uploadResponse.message || 'Upload failed'; // fastify responses don't throw
192
193
  }
193
- } catch (e: any) {
194
+ } catch (e: any) { // in Electron, errors throw
194
195
  error = e.message;
195
196
  } finally {
196
197
  uploading = false;
@@ -108,7 +108,7 @@
108
108
  >
109
109
  <td class="px-4 py-2 font-medium">
110
110
  <Link
111
- to={`/search/${set.documentSetId}`}
111
+ to={`search/${set.documentSetId}`}
112
112
  class="underline text-blue-600 hover:text-blue-800 visited:text-purple-600"
113
113
  >
114
114
  {set.name}
@@ -24,14 +24,14 @@
24
24
  </p>
25
25
  </section>
26
26
  <section>
27
- <h2> a CSV</h2>
27
+ <h2>Upload a CSV</h2>
28
28
  <p>
29
29
  You can select a CSV from your computer to "upload" it to Meaningfully. Then, select one column
30
30
  from the CSV to search semantically, and any number of other columns to be shown alongside it in results.
31
31
  </p>
32
32
  <p>
33
33
  Once you upload the CSV, each entry in the chosen column will be embedded, with the results stored on your
34
- computer. If you choose a remote embedding API -- like OpenAI's text-embedding-small or text-embedding-large --
34
+ computer. If you choose a remote embedding API (like OpenAI's text-embedding-small or text-embedding-large)
35
35
  then the entries in your column will be sent
36
36
  to that service; if you choose a local one, then the data will not leave your computer.
37
37
  </p>
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { navigate } from 'svelte-routing';
3
- import type { DocumentSet, MeaningfullyAPI } from '../types';
3
+ import type { DocumentSet, MeaningfullyAPI } from '../types.js';
4
4
  import Results from './Results.svelte';
5
5
 
6
6
  interface Props {
@@ -1,4 +1,4 @@
1
- import type { MeaningfullyAPI } from '../types';
1
+ import type { MeaningfullyAPI } from '../types.js';
2
2
  interface Props {
3
3
  validApiKeysSet: boolean;
4
4
  documentSetId: number;
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@meaningfully/ui",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "license": "MIT",
5
5
  "description": "Svelte components for meaningfully semantic search",
6
6
  "repo": "https://github.com/jeremybmerrill/meaningfully-ui",
7
7
  "scripts": {
8
8
  "dev": "vite dev",
9
9
  "build": "vite build && npm run prepack",
10
+ "watch": "vite build --watch",
10
11
  "preview": "vite preview",
11
12
  "prepare": "svelte-kit sync && npm run build",
12
13
  "prepack": "svelte-kit sync && svelte-package && publint",