diff --git a/index.html b/index.html index a5866fa..f21ad5c 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ rel="stylesheet" href="https://chinese-fonts-cdn.deno.dev/packages/maple-mono-cn/dist/MapleMono-CN-Regular/result.css" /> - Solid App + Protobuf Decoder diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 8d8a551..241b10b 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -1,5 +1,7 @@ import { JSXElement } from "solid-js"; + import { cx } from "@emotion/css"; + import ButtonStyles from "../components.styles/Button.styles"; export default (props: { class?: string; "on:click"?: () => void; children: JSXElement }): JSXElement => { diff --git a/src/components/Input.tsx b/src/components/Input.tsx index 41a1d2b..8ef012b 100644 --- a/src/components/Input.tsx +++ b/src/components/Input.tsx @@ -1,6 +1,9 @@ import { createMemo, For, JSXElement, onCleanup, onMount } from "solid-js"; + import { cx } from "@emotion/css"; + import { editable } from "edix"; + import InputStyles from "../components.styles/Input.styles"; export default (props: { class?: string; value: string; "on:change": (text: string) => void }): JSXElement => { diff --git a/src/components/NodeAsBytes.tsx b/src/components/NodeAsBytes.tsx index e8a4a8e..46bfb32 100644 --- a/src/components/NodeAsBytes.tsx +++ b/src/components/NodeAsBytes.tsx @@ -1,9 +1,11 @@ import { createMemo, createSignal, JSXElement, Show } from "solid-js"; import { ProtoBufNode } from "../utilities/n_protobuf_decode/node"; +import { bytesToHex } from "../utilities/hex_util"; +import { cx } from "@emotion/css"; + import NodeAsXStyles from "../components.styles/NodeAsX.styles"; + import Button from "./Button"; -import { cx } from "@emotion/css"; -import { bytesToHex } from "../utilities/hex_util"; export default (props: { node: ProtoBufNode }): JSXElement => { const result = createMemo(() => props.node.tryAsBytes()); diff --git a/src/components/NodeAsDouble.tsx b/src/components/NodeAsDouble.tsx index 061e1fa..5867b48 100644 --- a/src/components/NodeAsDouble.tsx +++ b/src/components/NodeAsDouble.tsx @@ -1,8 +1,10 @@ import { createMemo, createSignal, JSXElement, Show } from "solid-js"; import { ProtoBufNode } from "../utilities/n_protobuf_decode/node"; +import { cx } from "@emotion/css"; + import NodeAsXStyles from "../components.styles/NodeAsX.styles"; + import Button from "./Button"; -import { cx } from "@emotion/css"; export default (props: { node: ProtoBufNode }): JSXElement => { const result = createMemo(() => props.node.tryAsDouble()); diff --git a/src/components/NodeAsFixed32.tsx b/src/components/NodeAsFixed32.tsx index 4c85806..ad21cd1 100644 --- a/src/components/NodeAsFixed32.tsx +++ b/src/components/NodeAsFixed32.tsx @@ -1,8 +1,10 @@ import { createMemo, createSignal, JSXElement, Show } from "solid-js"; import { ProtoBufNode } from "../utilities/n_protobuf_decode/node"; +import { cx } from "@emotion/css"; + import NodeAsXStyles from "../components.styles/NodeAsX.styles"; + import Button from "./Button"; -import { cx } from "@emotion/css"; export default (props: { node: ProtoBufNode }): JSXElement => { const result = createMemo(() => props.node.tryAsFixed32()); diff --git a/src/components/NodeAsFixed64.tsx b/src/components/NodeAsFixed64.tsx index 4260206..1050a76 100644 --- a/src/components/NodeAsFixed64.tsx +++ b/src/components/NodeAsFixed64.tsx @@ -1,8 +1,10 @@ import { createMemo, createSignal, JSXElement, Show } from "solid-js"; import { ProtoBufNode } from "../utilities/n_protobuf_decode/node"; +import { cx } from "@emotion/css"; + import NodeAsXStyles from "../components.styles/NodeAsX.styles"; + import Button from "./Button"; -import { cx } from "@emotion/css"; export default (props: { node: ProtoBufNode }): JSXElement => { const result = createMemo(() => props.node.tryAsFixed64()); diff --git a/src/components/NodeAsFloat.tsx b/src/components/NodeAsFloat.tsx index 4cf8721..a3f2d52 100644 --- a/src/components/NodeAsFloat.tsx +++ b/src/components/NodeAsFloat.tsx @@ -1,8 +1,10 @@ import { createMemo, createSignal, JSXElement, Show } from "solid-js"; import { ProtoBufNode } from "../utilities/n_protobuf_decode/node"; +import { cx } from "@emotion/css"; + import NodeAsXStyles from "../components.styles/NodeAsX.styles"; + import Button from "./Button"; -import { cx } from "@emotion/css"; export default (props: { node: ProtoBufNode }): JSXElement => { const result = createMemo(() => props.node.tryAsFloat()); diff --git a/src/components/NodeAsInt32.tsx b/src/components/NodeAsInt32.tsx index 514f780..8a28c63 100644 --- a/src/components/NodeAsInt32.tsx +++ b/src/components/NodeAsInt32.tsx @@ -1,8 +1,10 @@ import { createMemo, createSignal, JSXElement, Show } from "solid-js"; import { ProtoBufNode } from "../utilities/n_protobuf_decode/node"; +import { cx } from "@emotion/css"; + import NodeAsXStyles from "../components.styles/NodeAsX.styles"; + import Button from "./Button"; -import { cx } from "@emotion/css"; export default (props: { node: ProtoBufNode }): JSXElement => { const result = createMemo(() => props.node.tryAsInt32()); diff --git a/src/components/NodeAsInt64.tsx b/src/components/NodeAsInt64.tsx index d0de022..32a2fdf 100644 --- a/src/components/NodeAsInt64.tsx +++ b/src/components/NodeAsInt64.tsx @@ -1,8 +1,10 @@ import { createMemo, createSignal, JSXElement, Show } from "solid-js"; import { ProtoBufNode } from "../utilities/n_protobuf_decode/node"; +import { cx } from "@emotion/css"; + import NodeAsXStyles from "../components.styles/NodeAsX.styles"; + import Button from "./Button"; -import { cx } from "@emotion/css"; export default (props: { node: ProtoBufNode }): JSXElement => { const result = createMemo(() => props.node.tryAsInt64()); diff --git a/src/components/NodeAsSfixed32.tsx b/src/components/NodeAsSfixed32.tsx index 15bd0ef..be51d98 100644 --- a/src/components/NodeAsSfixed32.tsx +++ b/src/components/NodeAsSfixed32.tsx @@ -1,8 +1,10 @@ import { createMemo, createSignal, JSXElement, Show } from "solid-js"; import { ProtoBufNode } from "../utilities/n_protobuf_decode/node"; +import { cx } from "@emotion/css"; + import NodeAsXStyles from "../components.styles/NodeAsX.styles"; + import Button from "./Button"; -import { cx } from "@emotion/css"; export default (props: { node: ProtoBufNode }): JSXElement => { const result = createMemo(() => props.node.tryAsSfixed32()); diff --git a/src/components/NodeAsSfixed64.tsx b/src/components/NodeAsSfixed64.tsx index c7d5c2c..cdc88e0 100644 --- a/src/components/NodeAsSfixed64.tsx +++ b/src/components/NodeAsSfixed64.tsx @@ -1,8 +1,10 @@ import { createMemo, createSignal, JSXElement, Show } from "solid-js"; import { ProtoBufNode } from "../utilities/n_protobuf_decode/node"; +import { cx } from "@emotion/css"; + import NodeAsXStyles from "../components.styles/NodeAsX.styles"; + import Button from "./Button"; -import { cx } from "@emotion/css"; export default (props: { node: ProtoBufNode }): JSXElement => { const result = createMemo(() => props.node.tryAsSfixed64()); diff --git a/src/components/NodeAsSint64.tsx b/src/components/NodeAsSint64.tsx index bd0d0e9..b2be492 100644 --- a/src/components/NodeAsSint64.tsx +++ b/src/components/NodeAsSint64.tsx @@ -1,8 +1,10 @@ import { createMemo, createSignal, JSXElement, Show } from "solid-js"; import { ProtoBufNode } from "../utilities/n_protobuf_decode/node"; +import { cx } from "@emotion/css"; + import NodeAsXStyles from "../components.styles/NodeAsX.styles"; + import Button from "./Button"; -import { cx } from "@emotion/css"; export default (props: { node: ProtoBufNode }): JSXElement => { const result = createMemo(() => props.node.tryAsSint64()); diff --git a/src/components/NodeAsString.tsx b/src/components/NodeAsString.tsx index e4de76f..e829027 100644 --- a/src/components/NodeAsString.tsx +++ b/src/components/NodeAsString.tsx @@ -1,8 +1,10 @@ import { createMemo, createSignal, JSXElement, Show } from "solid-js"; import { ProtoBufNode } from "../utilities/n_protobuf_decode/node"; +import { cx } from "@emotion/css"; + import NodeAsXStyles from "../components.styles/NodeAsX.styles"; + import Button from "./Button"; -import { cx } from "@emotion/css"; export default (props: { node: ProtoBufNode }): JSXElement => { const result = createMemo(() => props.node.tryAsString()); diff --git a/src/components/NodeAsUint64.tsx b/src/components/NodeAsUint64.tsx index fc955e8..1fe5e61 100644 --- a/src/components/NodeAsUint64.tsx +++ b/src/components/NodeAsUint64.tsx @@ -1,8 +1,10 @@ import { createMemo, createSignal, JSXElement, Show } from "solid-js"; import { ProtoBufNode } from "../utilities/n_protobuf_decode/node"; +import { cx } from "@emotion/css"; + import NodeAsXStyles from "../components.styles/NodeAsX.styles"; + import Button from "./Button"; -import { cx } from "@emotion/css"; export default (props: { node: ProtoBufNode }): JSXElement => { const result = createMemo(() => props.node.tryAsUint64()); diff --git a/src/index.tsx b/src/index.tsx index ae8868b..e06695a 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,9 +1,9 @@ /* @refresh reload */ import { render } from "solid-js/web"; +import { media } from "./utilities/css_util"; +import { injectGlobal } from "@emotion/css"; import App from "./views/App"; -import { injectGlobal } from "@emotion/css"; -import { media } from "./utilities/css_util"; injectGlobal({ "*": { diff --git a/src/utilities/n_protobuf_decode/index.ts b/src/utilities/n_protobuf_decode/index.ts index 0eeabe8..02982ff 100644 --- a/src/utilities/n_protobuf_decode/index.ts +++ b/src/utilities/n_protobuf_decode/index.ts @@ -1,3 +1 @@ -import { decode } from "./decoder"; - -export default { decode }; +export { decode } from "./decoder"; diff --git a/src/views/App.tsx b/src/views/App.tsx index d50fad8..05fb9a1 100644 --- a/src/views/App.tsx +++ b/src/views/App.tsx @@ -1,7 +1,5 @@ import { JSXElement, Match, Switch } from "solid-js"; - import { hexCheck, hexToBytes } from "../utilities/hex_util"; - import { decode } from "../utilities/n_protobuf_decode/decoder"; import { WireType } from "../utilities/n_protobuf_decode/wire_type";