@selvajs/ui 6.0.0-beta.3 → 6.0.0-beta.5

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.
@@ -34,7 +34,7 @@
34
34
  panelActions?: ActionButton[];
35
35
  showSaveButton?: boolean;
36
36
  showLoadButton?: boolean;
37
- /** When set, persist saved states via this callback instead of downloading a .sps file. */
37
+ /** When set, persist saved states via this callback instead of downloading a .slvp file. */
38
38
  onSaveState?: (state: ParameterPreset) => void | Promise<void>;
39
39
  /** When set, the Load dialog lists these states instead of showing a file input. */
40
40
  onListStates?: () => ParameterPreset[] | Promise<ParameterPreset[]>;
@@ -19,7 +19,7 @@ interface Props {
19
19
  panelActions?: ActionButton[];
20
20
  showSaveButton?: boolean;
21
21
  showLoadButton?: boolean;
22
- /** When set, persist saved states via this callback instead of downloading a .sps file. */
22
+ /** When set, persist saved states via this callback instead of downloading a .slvp file. */
23
23
  onSaveState?: (state: ParameterPreset) => void | Promise<void>;
24
24
  /** When set, the Load dialog lists these states instead of showing a file input. */
25
25
  onListStates?: () => ParameterPreset[] | Promise<ParameterPreset[]>;
@@ -20,7 +20,7 @@
20
20
  showSaveButton?: boolean;
21
21
  showLoadButton?: boolean;
22
22
  actions?: ActionButton[];
23
- /** When set, persist saved states via this callback instead of downloading a .sps file. */
23
+ /** When set, persist saved states via this callback instead of downloading a .slvp file. */
24
24
  onSaveState?: (state: ParameterPreset) => void | Promise<void>;
25
25
  /** When set, the Load dialog lists these states instead of showing a file input. */
26
26
  onListStates?: () => ParameterPreset[] | Promise<ParameterPreset[]>;
@@ -182,7 +182,14 @@
182
182
  </Button>
183
183
  {/each}
184
184
 
185
- <input bind:this={fileInputRef} type="file" accept=".sps" onchange={handleImport} class="hidden" />
185
+ <!-- .sps is the pre-rename extension; files with it exist on users' drives, so keep accepting it. -->
186
+ <input
187
+ bind:this={fileInputRef}
188
+ type="file"
189
+ accept=".slvp,.sps"
190
+ onchange={handleImport}
191
+ class="hidden"
192
+ />
186
193
 
187
194
  <!-- Save Dialog -->
188
195
  <Dialog.Root bind:open={showExportDialog}>
@@ -8,7 +8,7 @@ interface Props {
8
8
  showSaveButton?: boolean;
9
9
  showLoadButton?: boolean;
10
10
  actions?: ActionButton[];
11
- /** When set, persist saved states via this callback instead of downloading a .sps file. */
11
+ /** When set, persist saved states via this callback instead of downloading a .slvp file. */
12
12
  onSaveState?: (state: ParameterPreset) => void | Promise<void>;
13
13
  /** When set, the Load dialog lists these states instead of showing a file input. */
14
14
  onListStates?: () => ParameterPreset[] | Promise<ParameterPreset[]>;
@@ -111,7 +111,9 @@ export function exportStateAsJson(savedState) {
111
111
  const date = savedState.timestamp.split('T')[0].replace(/-/g, '_');
112
112
  const link = document.createElement('a');
113
113
  link.href = URL.createObjectURL(blob);
114
- link.download = `${safeName}_${date}.sps`;
114
+ // .slvp = Selva parameter preset. Import accepts legacy .sps files too — the content is
115
+ // identical JSON, only the writer's extension changed.
116
+ link.download = `${safeName}_${date}.slvp`;
115
117
  link.click();
116
118
  URL.revokeObjectURL(link.href);
117
119
  }
@@ -2,7 +2,7 @@ export const DEFAULT_PRESET_LABELS = {
2
2
  saveButton: 'Save State',
3
3
  loadButton: 'Load State',
4
4
  saveDialogTitle: 'Save Parameter State',
5
- saveDialogDescription: 'Save the current parameter values as a .sps file',
5
+ saveDialogDescription: 'Save the current parameter values as a .slvp file',
6
6
  saveNameLabel: 'State Name *',
7
7
  saveNamePlaceholder: 'e.g., Design Option A',
8
8
  saveDescriptionLabel: 'Description',
@@ -13,8 +13,8 @@ export const DEFAULT_PRESET_LABELS = {
13
13
  saveTagsPlaceholder: 'facade, option-a, client-approved (comma-separated)',
14
14
  saveNameRequired: 'Please enter a name for this state',
15
15
  loadDialogTitle: 'Load Parameter State',
16
- loadDialogDescription: 'Select a .sps state file from your drive to load',
17
- loadFromFileButton: 'Select .sps File',
16
+ loadDialogDescription: 'Select a .slvp state file from your drive to load',
17
+ loadFromFileButton: 'Select .slvp File',
18
18
  loadEmptyList: 'No saved states found',
19
19
  loadImportError: 'Failed to import state: ',
20
20
  validationTitle: 'State Validation Report',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selvajs/ui",
3
- "version": "6.0.0-beta.3",
3
+ "version": "6.0.0-beta.5",
4
4
  "description": "Shared UI components and utilities for Selva applications",
5
5
  "license": "MIT",
6
6
  "author": "VektorNode",
@@ -29,7 +29,7 @@
29
29
  "types": "./dist/public.d.ts",
30
30
  "exports": {
31
31
  ".": {
32
- "source": {
32
+ "selva-source": {
33
33
  "types": "./dist/index.d.ts",
34
34
  "svelte": "./dist/index.js"
35
35
  },
@@ -46,10 +46,9 @@
46
46
  "files": [
47
47
  "dist",
48
48
  "src/lib",
49
- "!dist/**/*.test.*",
50
- "!dist/**/*.spec.*",
51
- "!src/lib/**/*.test.*",
52
- "!src/lib/**/*.spec.*"
49
+ "!**/__tests__/**",
50
+ "!**/*.test.*",
51
+ "!**/*.spec.*"
53
52
  ],
54
53
  "sideEffects": [
55
54
  "**/*.css"
@@ -60,10 +59,10 @@
60
59
  "svelte": "^5",
61
60
  "tailwind-variants": "^3.3.0",
62
61
  "three": "^0.185.1",
63
- "@selvajs/compute": "^4.0.0-beta.3",
64
- "@selvajs/visualization": "^1.0.0-beta.1",
65
- "@selvajs/solve": "^1.0.0-beta.7",
66
- "@selvajs/schemas": "^5.0.0-beta.0"
62
+ "@selvajs/compute": "^4.0.0-beta.5",
63
+ "@selvajs/schemas": "^5.0.0-beta.2",
64
+ "@selvajs/solve": "^1.0.0-beta.9",
65
+ "@selvajs/visualization": "^1.0.0-beta.2"
67
66
  },
68
67
  "peerDependenciesMeta": {
69
68
  "three": {
@@ -91,11 +90,11 @@
91
90
  "svelte": "5.56.8",
92
91
  "tailwind-variants": "^3.3.0",
93
92
  "vitest": "^4.1.10",
94
- "@selvajs/compute": "4.0.0-beta.3",
93
+ "@selvajs/compute": "4.0.0-beta.5",
95
94
  "@selvajs/config": "0.0.3",
96
- "@selvajs/schemas": "5.0.0-beta.0",
97
- "@selvajs/visualization": "1.0.0-beta.1",
98
- "@selvajs/solve": "1.0.0-beta.7"
95
+ "@selvajs/schemas": "5.0.0-beta.2",
96
+ "@selvajs/visualization": "1.0.0-beta.2",
97
+ "@selvajs/solve": "1.0.0-beta.9"
99
98
  },
100
99
  "scripts": {
101
100
  "predev": "node ../../scripts/sync-shared-assets.js",
@@ -34,7 +34,7 @@
34
34
  panelActions?: ActionButton[];
35
35
  showSaveButton?: boolean;
36
36
  showLoadButton?: boolean;
37
- /** When set, persist saved states via this callback instead of downloading a .sps file. */
37
+ /** When set, persist saved states via this callback instead of downloading a .slvp file. */
38
38
  onSaveState?: (state: ParameterPreset) => void | Promise<void>;
39
39
  /** When set, the Load dialog lists these states instead of showing a file input. */
40
40
  onListStates?: () => ParameterPreset[] | Promise<ParameterPreset[]>;
@@ -20,7 +20,7 @@
20
20
  showSaveButton?: boolean;
21
21
  showLoadButton?: boolean;
22
22
  actions?: ActionButton[];
23
- /** When set, persist saved states via this callback instead of downloading a .sps file. */
23
+ /** When set, persist saved states via this callback instead of downloading a .slvp file. */
24
24
  onSaveState?: (state: ParameterPreset) => void | Promise<void>;
25
25
  /** When set, the Load dialog lists these states instead of showing a file input. */
26
26
  onListStates?: () => ParameterPreset[] | Promise<ParameterPreset[]>;
@@ -182,7 +182,14 @@
182
182
  </Button>
183
183
  {/each}
184
184
 
185
- <input bind:this={fileInputRef} type="file" accept=".sps" onchange={handleImport} class="hidden" />
185
+ <!-- .sps is the pre-rename extension; files with it exist on users' drives, so keep accepting it. -->
186
+ <input
187
+ bind:this={fileInputRef}
188
+ type="file"
189
+ accept=".slvp,.sps"
190
+ onchange={handleImport}
191
+ class="hidden"
192
+ />
186
193
 
187
194
  <!-- Save Dialog -->
188
195
  <Dialog.Root bind:open={showExportDialog}>
@@ -161,7 +161,9 @@ export function exportStateAsJson(savedState: ParameterPreset): void {
161
161
 
162
162
  const link = document.createElement('a');
163
163
  link.href = URL.createObjectURL(blob);
164
- link.download = `${safeName}_${date}.sps`;
164
+ // .slvp = Selva parameter preset. Import accepts legacy .sps files too — the content is
165
+ // identical JSON, only the writer's extension changed.
166
+ link.download = `${safeName}_${date}.slvp`;
165
167
  link.click();
166
168
  URL.revokeObjectURL(link.href);
167
169
  }
@@ -52,7 +52,7 @@ export const DEFAULT_PRESET_LABELS: PresetLabels = {
52
52
  loadButton: 'Load State',
53
53
 
54
54
  saveDialogTitle: 'Save Parameter State',
55
- saveDialogDescription: 'Save the current parameter values as a .sps file',
55
+ saveDialogDescription: 'Save the current parameter values as a .slvp file',
56
56
  saveNameLabel: 'State Name *',
57
57
  saveNamePlaceholder: 'e.g., Design Option A',
58
58
  saveDescriptionLabel: 'Description',
@@ -64,8 +64,8 @@ export const DEFAULT_PRESET_LABELS: PresetLabels = {
64
64
  saveNameRequired: 'Please enter a name for this state',
65
65
 
66
66
  loadDialogTitle: 'Load Parameter State',
67
- loadDialogDescription: 'Select a .sps state file from your drive to load',
68
- loadFromFileButton: 'Select .sps File',
67
+ loadDialogDescription: 'Select a .slvp state file from your drive to load',
68
+ loadFromFileButton: 'Select .slvp File',
69
69
  loadEmptyList: 'No saved states found',
70
70
  loadImportError: 'Failed to import state: ',
71
71