diff --git a/kalk_web/package.json b/kalk_web/package.json index ddf84f9..6161fcf 100644 --- a/kalk_web/package.json +++ b/kalk_web/package.json @@ -1,6 +1,6 @@ { "name": "@paddim8/kalk-component", - "version": "1.0.1", + "version": "1.0.2", "description": "A Svelte component for kalk, a calculator that supports user-defined functions and variables.", "svelte": "src/main.ts", "main": "public/build/bundle.js", diff --git a/kalk_web/public/index.html b/kalk_web/public/index.html index c1505b1..bc82e33 100644 --- a/kalk_web/public/index.html +++ b/kalk_web/public/index.html @@ -37,7 +37,7 @@
- + kalk Type 'help' for instructions. diff --git a/kalk_web/src/KalkCalculator.svelte b/kalk_web/src/KalkCalculator.svelte index 95d76e9..a329fb1 100644 --- a/kalk_web/src/KalkCalculator.svelte +++ b/kalk_web/src/KalkCalculator.svelte @@ -3,12 +3,13 @@ import ConsoleLine from "./ConsoleLine.svelte"; import type { Context } from "@paddim8/kalk"; - export let identifierColor = "cornflowerblue"; - export let operatorColor = "darkorange"; - export let promptColor = "mediumseagreen"; - export let errorColor = "tomato"; - export let linkColor = "cornflowerblue"; - export let hintText = ""; + // Props, HTML doesn't recognise them if they're not like this + export let identifiercolor = "cornflowerblue"; + export let operatorcolor = "darkorange"; + export let promptcolor = "mediumseagreen"; + export let errorcolor = "tomato"; + export let linkcolor = "cornflowerblue"; + export let hinttext = ""; type Kalk = typeof import("@paddim8/kalk"); @@ -52,14 +53,14 @@ let output: string; if (input.trim() == "help") { - output = `Link to usage guide`; } else { const [result, success] = calculate(kalk, input); output = success ? highlight(result)[0] - : `${result}`; + : `${result}`; } outputLines = output @@ -216,11 +217,11 @@ offset += substring.length - newSubstring.length; - return `${newSubstring}`; + return `${newSubstring}`; } if (op) { - return `${substring}`; + return `${substring}`; } return substring; @@ -299,27 +300,27 @@ {#each outputLines as line} {#if line[1]} - >> + >> {/if} {@html line[0]} {/each}
- >>  + >>  {#await import('@paddim8/kalk')} Loading... {:then kalk}
handleKeyDown(event, kalk)} on:keyup={handleKeyUp} on:input={handleInput} role="textbox" /> {:catch error} - {error} + {error} {/await}