File tree Expand file tree Collapse file tree 3 files changed +9
-27
lines changed
Expand file tree Collapse file tree 3 files changed +9
-27
lines changed Original file line number Diff line number Diff line change 100100 "svelte-morphing-modal" : " ^2.2.0" ,
101101 "svelte-pathfinder" : " ^3.3.0" ,
102102 "svelte-preprocess" : " ^4.10.6" ,
103- "svelte-spectre" : " ^0.3.4 " ,
103+ "svelte-spectre" : " ^0.3.5 " ,
104104 "tslib" : " ^2.4.0" ,
105- "typescript" : " ^4.6.4 "
105+ "typescript" : " ^4.7.2 "
106106 },
107107 "dependencies" : {
108108 "debounce-promise" : " ^3.1.2" ,
109- "optimade" : " ^2.0.4 " ,
109+ "optimade" : " ^2.0.5 " ,
110110 "optimade-mpds-nlp" : " ^0.1.3"
111111 }
112112}
Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ import { asyncable, syncable } from 'svelte-asyncable';
33import type { Readable } from 'svelte/store' ;
44import type { Asyncable } from 'svelte-asyncable' ;
55
6- import { getJSON } from '@/services/optimade' ;
6+ import { getJSON } from '@/services/optimade' ; // now replaced by simple fetch() for ignore CORS issue
77import { supportedModulesUrl , lsModulesKey } from '@/config' ;
88
9- export const builtinModules : Asyncable < string [ ] > = asyncable ( ( ) => getJSON ( supportedModulesUrl ) , null ) ;
9+ export const builtinModules : Asyncable < string [ ] > = asyncable ( ( ) => fetch ( supportedModulesUrl ) . then ( async ( res ) => await res . json ( ) ) , null ) ;
1010
1111export const builtinModulesSync : Readable < string [ ] > = syncable ( builtinModules , [ ] ) ;
1212
Original file line number Diff line number Diff line change 1- {#await $modules then predefined }
2- <Autocomplete { groupBy } { predefined } bind:selected creatable placeholder =" Select app or enter app URL" empty = " No apps added " />
1+ {#await $modules then options }
2+ <Select { options } bind:value ={ selectedValue } placeholder =" Select app or enter app URL" style = " margin: 0 0 1em " />
33{/await }
44
55<script lang =" ts" context =" module" >
6- import { Autocomplete } from ' svelte-spectre' ;
7-
8- import modules , { builtinModulesSync } from ' @/stores/modules' ;
9-
10- import { moduleGroups } from ' @/config' ;
6+ import { Select } from ' svelte-spectre' ;
7+ import modules from ' @/stores/modules' ;
118 </script >
129
1310<script lang =" ts" >
14- let selected: any [] = [];
15-
1611 export let selectedValue: string ;
17-
18- $ : selectedValue = selected [0 ]?.value ;
19-
20- $ : if (selectedValue ) {
21- modules .update (async ($modules ) => {
22- if (! (await $modules ).includes (selectedValue )) {
23- (await $modules ).unshift (selectedValue );
24- }
25- return $modules ;
26- });
27- }
28-
29- const groupBy = (item : { value: string }): string => ($builtinModulesSync .includes (item .value ) ? moduleGroups .builtin : moduleGroups .local );
3012 </script >
You can’t perform that action at this time.
0 commit comments