diff --git a/editor-solidjs/src/RightPane.module.css b/editor-solidjs/src/RightPane.module.css
index 4ffddb1..c8ed5fa 100644
--- a/editor-solidjs/src/RightPane.module.css
+++ b/editor-solidjs/src/RightPane.module.css
@@ -64,3 +64,7 @@
margin-top: 0.25em;
margin-bottom: 0.25em;
}
+
+.prop_name {
+ user-select: none;
+}
diff --git a/editor-solidjs/src/Tile.jsx b/editor-solidjs/src/Tile.jsx
index 58e5f44..f2d257c 100644
--- a/editor-solidjs/src/Tile.jsx
+++ b/editor-solidjs/src/Tile.jsx
@@ -7,6 +7,8 @@ import Direction from "./input/Direction.jsx";
import Orientation from "./input/Orientation.jsx";
import Number from "./input/Number.jsx";
import Value from "./input/Value.jsx";
+import Bool from "./input/Bool.jsx";
+import CmpOp from "./input/CmpOp.jsx";
export const COMPONENTS = new Map();
@@ -16,6 +18,7 @@ COMPONENTS.set("Orientation", Orientation);
COMPONENTS.set("Uint", (props) => );
COMPONENTS.set("Int", Number);
COMPONENTS.set("Value", Value);
+COMPONENTS.set("CmpOp", CmpOp);
export default function Tile(props) {
let {full_tile, set_full_tile} = props;
@@ -63,9 +66,15 @@ export default function Tile(props) {
{([label, type, value]) => {
if (COMPONENTS.has(type)) {
let setValue = bindSetValue(label, value);
- return
{label}: {COMPONENTS.get(type)({value: () => value, setValue})}
+ return ();
} else {
- return {label}: {value?.toString()}
+ return (
+ {label}:
+ {value?.toString()}
+ );
}
}}
diff --git a/editor-solidjs/src/input/Bool.jsx b/editor-solidjs/src/input/Bool.jsx
new file mode 100644
index 0000000..b5be4e8
--- /dev/null
+++ b/editor-solidjs/src/input/Bool.jsx
@@ -0,0 +1,14 @@
+import {createEffect} from "solid-js";
+
+import styles from "./input.module.css";
+
+export default function Bool(props) {
+ let {value, setValue} = props;
+
+ return ( setValue(!!evt.currentTarget.checked)}
+ />);
+}
diff --git a/editor-solidjs/src/input/CmpOp.jsx b/editor-solidjs/src/input/CmpOp.jsx
new file mode 100644
index 0000000..257d85d
--- /dev/null
+++ b/editor-solidjs/src/input/CmpOp.jsx
@@ -0,0 +1,21 @@
+import {createEffect} from "solid-js";
+
+import styles from "./input.module.css";
+
+export default function CmpOp(props) {
+ let {value, setValue} = props;
+ let select;
+
+ createEffect(() => {
+ select.value = value();
+ });
+
+ return ();
+}
diff --git a/editor-solidjs/src/input/input.module.css b/editor-solidjs/src/input/input.module.css
index 6de3646..c113f8c 100644
--- a/editor-solidjs/src/input/input.module.css
+++ b/editor-solidjs/src/input/input.module.css
@@ -26,6 +26,37 @@
max-width: 12em;
}
+.input[type="checkbox"] {
+ appearance: none;
+ display: inline-flex;
+ height: 1em;
+ width: 1em;
+ vertical-align: middle;
+ justify-content: center;
+ align-items: center;
+ overflow: hidden;
+}
+
+.input[type="checkbox"]::before {
+ content: " ";
+ display: inline-block;
+ font-size: 0.9em;
+ text-align: center;
+ transform: translateY(-0.1em);
+}
+
+.input[type="checkbox"]:checked {
+ background-color: #2d3e6d;
+}
+
+.input[type="checkbox"]:checked:hover {
+ background-color: #364a81;
+}
+
+.input[type="checkbox"]:checked::before {
+ content: "\2714";
+}
+
.select:hover, .input:hover, .select_type:hover {
color: white;
background: rgba(0, 0, 0, 0.4);
diff --git a/stackline/tiles/arithmetic.rs b/stackline/tiles/arithmetic.rs
index a2b0b79..83ffe93 100644
--- a/stackline/tiles/arithmetic.rs
+++ b/stackline/tiles/arithmetic.rs
@@ -206,6 +206,10 @@ impl Tile for Cmp {
Gte => TextChar::from_state('\u{2265}', ctx.state), // GREATER-THAN OR EQUAL TO (no circled version)
}
}
+
+ fn schema(&self) -> TileSchema {
+ TileSchema::value("Operation", "CmpOp")
+ }
}
impl Default for Operation {
diff --git a/stackline/tiles/logic.rs b/stackline/tiles/logic.rs
index 2b58322..7834087 100644
--- a/stackline/tiles/logic.rs
+++ b/stackline/tiles/logic.rs
@@ -66,4 +66,13 @@ impl Tile for If {
TextChar::from_state('?', ctx.state)
}
}
+
+ fn schema(&self) -> TileSchema {
+ // TODO: add Vec?
+ TileSchema::map()
+ .add(
+ "invert",
+ TileSchema::value("Invert", "Bool")
+ )
+ }
}
diff --git a/stackline/tiles/storage.rs b/stackline/tiles/storage.rs
index cd7891a..8dea7fb 100644
--- a/stackline/tiles/storage.rs
+++ b/stackline/tiles/storage.rs
@@ -45,7 +45,7 @@ impl Tile for Store {
fn schema(&self) -> TileSchema {
TileSchema::map()
- .add("signal", TileSchema::value("Stored signal", "Signal|null"))
+ .add("signal", TileSchema::value("Stored signal", "Signal"))
}
}
@@ -205,7 +205,7 @@ impl Tile for Stacker {
fn schema(&self) -> TileSchema {
TileSchema::map()
- .add("signal", TileSchema::value("Signal to stack", "Signal|null"))
+ .add("signal", TileSchema::value("Signal to stack", "Signal"))
.add("orientation", TileSchema::value("Orientation", "Orientation"))
}
}
diff --git a/stackline/tiles/transmit.rs b/stackline/tiles/transmit.rs
index 8e90e25..e49af79 100644
--- a/stackline/tiles/transmit.rs
+++ b/stackline/tiles/transmit.rs
@@ -283,6 +283,18 @@ impl Tile for Sender {
}
}
}
+
+ fn schema(&self) -> TileSchema {
+ // TODO: add Vec?
+ TileSchema::map()
+ .add(
+ "coordinates",
+ TileSchema::tuple()
+ .push(TileSchema::value("Pane", "String"))
+ .push(TileSchema::value("X", "Uint"))
+ .push(TileSchema::value("Y", "Uint"))
+ )
+ }
}
#[cfg(test)]
diff --git a/stackline/tiles/wire.rs b/stackline/tiles/wire.rs
index d2e4bc5..50d643b 100644
--- a/stackline/tiles/wire.rs
+++ b/stackline/tiles/wire.rs
@@ -147,7 +147,7 @@ impl Tile for Resistor {
fn schema(&self) -> TileSchema {
TileSchema::map()
.add("direction", TileSchema::value("Direction", "Direction"))
- .add("signal", TileSchema::value("Signal", "Signal|null"))
+ .add("signal", TileSchema::value("Signal", "Signal"))
}
}