Updated deps.

Fixed type errors.
This commit is contained in:
Martin Berg Alstad 2024-07-18 16:30:03 +02:00
parent 2376eadea9
commit d64e2497a8
5 changed files with 327 additions and 320 deletions

View File

@ -11,22 +11,22 @@
},
"license": "MIT",
"devDependencies": {
"autoprefixer": "^10.4.17",
"postcss": "^8.4.35",
"prettier": "3.2.5",
"prettier-plugin-tailwindcss": "^0.5.11",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3",
"vite": "^5.1.4",
"vite-plugin-solid": "^2.10.1"
"autoprefixer": "^10.4.19",
"postcss": "^8.4.39",
"prettier": "3.3.3",
"prettier-plugin-tailwindcss": "^0.6.5",
"tailwindcss": "^3.4.6",
"typescript": "^5.5.3",
"vite": "^5.3.4",
"vite-plugin-solid": "^2.10.2"
},
"dependencies": {
"@solidjs/router": "^0.12.4",
"@types/diff": "^5.0.9",
"@solidjs/router": "^0.14.1",
"@types/diff": "^5.2.1",
"diff": "^5.2.0",
"solid-headless": "^0.13.1",
"solid-heroicons": "^3.2.4",
"solid-js": "^1.8.15",
"solid-js": "^1.8.18",
"xlsx": "^0.18.5"
}
}

602
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@ import { For } from "solid-js/web"
import { type Component } from "solid-js"
interface TruthTableProps extends SimpleProps {
table?: Table
table?: TruthMatrix
header?: string[]
}
@ -20,8 +20,7 @@ const TruthTable: Component<TruthTableProps> = ({ table, header, className, styl
<th
scope={"col"}
class={
`sticky top-0 bg-default-bg text-center outline
outline-2 outline-offset-[-1px] outline-gray-500 [position:-webkit-sticky;]` /*TODO sticky header at the top of the screen */
`sticky top-0 bg-default-bg text-center outline outline-2 outline-offset-[-1px] outline-gray-500 [position:-webkit-sticky;]` /*TODO sticky header at the top of the screen */
}
>
<p class={"w-max px-2"}>{exp}</p>
@ -37,8 +36,7 @@ const TruthTable: Component<TruthTableProps> = ({ table, header, className, styl
<For each={row}>
{(value) => (
<td
class={`border border-gray-500 text-center last:underline
${value ? "bg-green-700" : "bg-red-700"}`}
class={`border border-gray-500 text-center last:underline ${value ? "bg-green-700" : "bg-red-700"}`}
>
<p>{value ? "T" : "F"}</p>
</td>

View File

@ -34,7 +34,7 @@ const fetchUrls = [
// TODO more user friendly options
const TruthTablePage: Component = () => {
const [searchParams, setSearchParams] = useSearchParams()
let inputElement: HTMLInputElement | undefined = undefined
let inputElement!: HTMLInputElement
let simplifyDefault = searchParams.simplify === undefined || searchParams.simplify === "true",
inputContent = !!searchParams.exp,
@ -386,7 +386,8 @@ const HowTo: Component = () => (
Parentheses is also allowed.
</p>
<p>
API docs can be found <Link to={"https://api.martials.no/simplify-truths"}>here</Link>.
API docs can be found{" "}
<Link to={"https://api.martials.no/simplify-truths/v2/openapi"}>here</Link>.
</p>
</MyDisclosure>

10
src/types/types.d.ts vendored
View File

@ -72,14 +72,16 @@ type Operation = {
law: Law
}
type Table = {
header: string[]
truthMatrix: TruthMatrix
}
type FetchResult = {
version: string
before: string
after: string
operations: Operation[]
expression: Expression | null
truthTable?: {
header: string[]
truthMatrix: TruthMatrix
} | null
truthTable?: Table | null
}