From 8dcca2c21f65768469514ceaecc058999b64d5ef Mon Sep 17 00:00:00 2001
From: Ramiro Medina <64783088+ramedina86@users.noreply.github.com>
Date: Mon, 11 Mar 2024 11:34:55 +0000
Subject: [PATCH 1/3] chore: Add shadows for consistency
---
ui/src/core_components/input/CoreRatingInput.vue | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ui/src/core_components/input/CoreRatingInput.vue b/ui/src/core_components/input/CoreRatingInput.vue
index 03a98ba60..2dbbf43b8 100644
--- a/ui/src/core_components/input/CoreRatingInput.vue
+++ b/ui/src/core_components/input/CoreRatingInput.vue
@@ -266,6 +266,7 @@ label {
}
.unit.stars {
+ box-shadow: 0 0 8px 4px rgba(0, 0, 0, 0.2) inset;
clip-path: polygon(
50% 0%,
61% 35%,
@@ -281,10 +282,12 @@ label {
}
.unit.faces {
+ box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.2) inset;
clip-path: circle(50%);
}
.unit.hearts {
+ box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.2) inset;
clip-path: path(
"M2.54139 14.2987C0.97724 12.7905 0 10.646 0 8.26667C0 3.70111 3.5983 0 8.03704 0C10.4025 0 12.5293 1.05112 14 2.72404C15.4707 1.05112 17.5975 0 19.963 0C24.4017 0 28 3.70111 28 8.26667C28 10.6181 27.0455 12.7402 25.5133 14.2455L14.0815 28L2.54139 14.2987Z"
);
@@ -297,6 +300,7 @@ label {
width: 28px;
height: 28px;
background: var(--accentColor);
+ box-shadow: none;
}
.unit .filler.light {
From ba2db4075833f427cd2d6c79aa46b51cd1c1e9a4 Mon Sep 17 00:00:00 2001
From: Ramiro Medina <64783088+ramedina86@users.noreply.github.com>
Date: Mon, 11 Mar 2024 11:35:16 +0000
Subject: [PATCH 2/3] feat: Switch Input component
---
src/streamsync/core.py | 4 +
ui/src/core/templateMap.ts | 4 +-
.../core_components/input/CoreSwitchInput.vue | 127 ++++++++++++++++++
3 files changed, 134 insertions(+), 1 deletion(-)
create mode 100644 ui/src/core_components/input/CoreSwitchInput.vue
diff --git a/src/streamsync/core.py b/src/streamsync/core.py
index 85ff703b9..0b27fb8d6 100644
--- a/src/streamsync/core.py
+++ b/src/streamsync/core.py
@@ -632,6 +632,10 @@ def _transform_options_change(self, ev: StreamsyncEvent) -> Optional[List[str]]:
raise ValueError("Unauthorised option")
return payload
+ def _transform_toggle(self, ev: StreamsyncEvent) -> bool:
+ payload = bool(ev.payload)
+ return payload
+
def _transform_keydown(self, ev) -> Dict:
payload = ev.payload
key = str(payload.get("key"))
diff --git a/ui/src/core/templateMap.ts b/ui/src/core/templateMap.ts
index 8c5aa211d..3cdf95845 100644
--- a/ui/src/core/templateMap.ts
+++ b/ui/src/core/templateMap.ts
@@ -25,6 +25,7 @@ import CoreSliderInput from "../core_components/input/CoreSliderInput.vue";
import CoreTextInput from "../core_components/input/CoreTextInput.vue";
import CoreTextareaInput from "../core_components/input/CoreTextareaInput.vue";
import CoreRating from "../core_components/input/CoreRatingInput.vue";
+import CoreSwitchInput from "../core_components/input/CoreSwitchInput.vue";
// layout
import CoreColumn from "../core_components/layout/CoreColumn.vue";
import CoreColumns from "../core_components/layout/CoreColumns.vue";
@@ -104,7 +105,8 @@ const templateMap = {
chat: CoreChat,
step: CoreStep,
steps: CoreSteps,
- ratinginput: CoreRating
+ ratinginput: CoreRating,
+ switchinput: CoreSwitchInput,
};
if (STREAMSYNC_LIVE_CCT === "yes") {
diff --git a/ui/src/core_components/input/CoreSwitchInput.vue b/ui/src/core_components/input/CoreSwitchInput.vue
new file mode 100644
index 000000000..c99265517
--- /dev/null
+++ b/ui/src/core_components/input/CoreSwitchInput.vue
@@ -0,0 +1,127 @@
+
+