@@ -8,7 +8,7 @@ import { VsRunAll } from 'solid-icons/vs'
88import { createMemo , createSignal , onMount , Show } from 'solid-js'
99import { A } from '@solidjs/router'
1010import toast , { Toaster } from 'solid-toast'
11- import { BACKEND_URL , TOKEN } from './urls '
11+ import { API_URL } from './lib/api '
1212import hljs from 'highlight.js/lib/core'
1313import 'highlight.js/styles/panda-syntax-dark.css'
1414import {
@@ -41,21 +41,12 @@ import {
4141 completionKeymap ,
4242} from '@codemirror/autocomplete'
4343import {
44- EditorMode ,
45- ImportCSVDirection ,
46- ImportFormat ,
47- ParserParameters ,
44+ // EditorMode,
45+ // ImportCSVDirection,
46+ // ImportFormat,
47+ // ParserParameters,
4848 Token ,
49- } from './types'
50- import {
51- editorTheme ,
52- highlightStyle ,
53- languageSupport ,
54- mettaLinter ,
55- toJSON ,
56- } from './mettaLanguageSupport'
57- import { parser } from './parser/parser'
58- import { Expression , Symbol , Variable } from './parser/parser.terms'
49+ } from './lib/types'
5950
6051const extensionToImportFormat = ( file : File ) : ImportFormat | undefined => {
6152 const extension = file . name . split ( '.' ) [ 1 ]
@@ -100,7 +91,7 @@ const App: Component = () => {
10091 const [ editorOutput , setEditorOutput ] = createSignal ( '' )
10192 const [ editorView , setEditorView ] = createSignal < EditorView > ( )
10293 const [ editorMode , setEditorMode ] = createSignal < EditorMode > (
103- EditorMode . DEFAULT
94+ " EditorMode.DEFAULT"
10495 )
10596
10697 const [ activeImportFile , setActiveImportFile ] = createSignal < File > ( )
@@ -122,7 +113,7 @@ const App: Component = () => {
122113
123114 // CSV-specific import parameters
124115 const [ importCSVDirection , setImportCSVDirection ] =
125- createSignal < ImportCSVDirection > ( ImportCSVDirection . CELL_LABELED )
116+ createSignal < ImportCSVDirection > ( " ImportCSVDirection.CELL_LABELED" )
126117 const [ importCSVDelimiter , setImportCSVDelimiter ] =
127118 createSignal < string > ( '\u002C' )
128119
@@ -136,8 +127,8 @@ const App: Component = () => {
136127 const editorState = EditorState . create ( {
137128 doc : editorContent ( ) ,
138129 extensions : [
139- editorTheme ,
140- languageSupport ,
130+ // editorTheme,
131+ // languageSupport,
141132 highlightActiveLineGutter ( ) ,
142133 history ( ) ,
143134 foldGutter ( ) ,
@@ -147,10 +138,10 @@ const App: Component = () => {
147138 bracketMatching ( ) ,
148139 closeBrackets ( ) ,
149140 highlightActiveLine ( ) ,
150- syntaxHighlighting ( highlightStyle ) ,
141+ syntaxHighlighting ( " highlightStyle" ) ,
151142 EditorView . lineWrapping ,
152143 autocompletion ( ) ,
153- mettaLinter ,
144+ // mettaLinter,
154145 keymap . of ( [
155146 ...closeBracketsKeymap ,
156147 ...defaultKeymap ,
@@ -236,7 +227,7 @@ const App: Component = () => {
236227
237228 importFileModal . close ( )
238229 }
239-
230+ let TOKEN = false ;
240231 if ( TOKEN ) {
241232 loadSpace ( TOKEN )
242233 setEditorMode ( EditorMode . EDIT )
@@ -351,7 +342,7 @@ const App: Component = () => {
351342
352343 try {
353344 const resp = await fetch (
354- `${ BACKEND_URL } /translations/${ fileFormat } ?${ parameters . toString ( ) } ` ,
345+ `${ API_URL } /translations/${ fileFormat } ?${ parameters . toString ( ) } ` ,
355346 {
356347 method : 'POST' ,
357348 headers : { } ,
@@ -368,7 +359,7 @@ const App: Component = () => {
368359 }
369360
370361 // switch to import mode to allow modification of import parameters
371- setEditorMode ( EditorMode . IMPORT )
362+ setEditorMode ( " EditorMode.IMPORT" )
372363
373364 // insert translated MeTTa code at cursor location
374365 view . dispatch (
@@ -462,7 +453,7 @@ const App: Component = () => {
462453 */
463454 const loadSpace = async ( token : string ) : Promise < void > => {
464455 try {
465- const resp = await fetch ( `${ BACKEND_URL } /token` , {
456+ const resp = await fetch ( `${ API_URL } /token` , {
466457 method : 'GET' ,
467458 headers : {
468459 'Content-Type' : 'application/json' ,
@@ -523,7 +514,7 @@ const App: Component = () => {
523514 const content = editorContent ( )
524515
525516 await fetch (
526- `${ BACKEND_URL } /spaces${ token ( ) ?. namespace } ${ selectedNamespace ( ) } ` ,
517+ `${ API_URL } /spaces${ token ( ) ?. namespace } ${ selectedNamespace ( ) } ` ,
527518 {
528519 method : 'PUT' ,
529520 headers : {
@@ -539,7 +530,7 @@ const App: Component = () => {
539530
540531 const read = async ( token ?: Token ) => {
541532 const resp = await fetch (
542- `${ BACKEND_URL } /spaces${ token ?. namespace } ${ selectedNamespace ( ) } ` ,
533+ `${ API_URL } /spaces${ token ?. namespace } ${ selectedNamespace ( ) } ` ,
543534 {
544535 method : 'GET' ,
545536 headers : {
@@ -572,7 +563,7 @@ const App: Component = () => {
572563 }
573564
574565 const transform = async ( ) => {
575- const resp = await fetch ( `${ BACKEND_URL } /spaces` , {
566+ const resp = await fetch ( `${ API_URL } /spaces` , {
576567 method : 'POST' ,
577568 headers : {
578569 'Content-Type' : 'application/json' ,
@@ -714,7 +705,7 @@ const App: Component = () => {
714705 </ Show >
715706 </ div >
716707 < Show
717- when = { editorMode ( ) === EditorMode . IMPORT }
708+ when = { editorMode ( ) === " EditorMode.IMPORT" }
718709 fallback = { < div > </ div > }
719710 >
720711 < div >
0 commit comments