diff --git a/src/assets/defaults.ts b/src/assets/defaults.ts index af46b6ed8..332273542 100644 --- a/src/assets/defaults.ts +++ b/src/assets/defaults.ts @@ -37,6 +37,89 @@ export const defaultMiniWidgetManagerVars: MiniWidgetManagerVars = { highlighted: false, } +export const defaultCustomWidgetContainers = [ + { + name: '0-left', + elements: [], + }, + { + name: '1-left', + elements: [], + }, + { + name: '2-left', + elements: [], + }, + { + name: '3-left', + elements: [], + }, + { + name: '4-left', + elements: [], + }, + { + name: '5-left', + elements: [], + }, + { + name: '6-left', + elements: [], + }, + { + name: '7-left', + elements: [], + }, + { + name: '8-left', + elements: [], + }, + { + name: '9-left', + elements: [], + }, + { + name: '0-right', + elements: [], + }, + { + name: '1-right', + elements: [], + }, + { + name: '2-right', + elements: [], + }, + { + name: '3-right', + elements: [], + }, + { + name: '4-right', + elements: [], + }, + { + name: '5-right', + elements: [], + }, + { + name: '6-right', + elements: [], + }, + { + name: '7-right', + elements: [], + }, + { + name: '8-right', + elements: [], + }, + { + name: '9-right', + elements: [], + }, +] + const hostname = window.location.hostname export const defaultBlueOsAddress = 'http://blueos-avahi.local' export const defaultGlobalAddress = !hostname || hostname == 'localhost' ? defaultBlueOsAddress : hostname diff --git a/src/assets/widgets/CustomWidgetBase.png b/src/assets/widgets/CustomWidgetBase.png new file mode 100644 index 000000000..032ac7f12 Binary files /dev/null and b/src/assets/widgets/CustomWidgetBase.png differ diff --git a/src/components/EditMenu.vue b/src/components/EditMenu.vue index 63aef0f46..d3c4d48eb 100644 --- a/src/components/EditMenu.vue +++ b/src/components/EditMenu.vue @@ -152,7 +152,7 @@

Widget type:

@@ -453,7 +453,7 @@ theme="dark" variant="filled" density="compact" - :items="['Regular', 'Mini']" + :items="['Regular', 'Mini', 'Input']" class="bg-[#27384255] 2xl:scale-100 scale-[80%]" hide-details @change="widgetMode = $event" @@ -463,17 +463,18 @@
To be placed on the main view area
-
- Click or drag to add -
+
(Drag card to add)
To be placed on the top and bottom bars
-
- (Drag card in place to add) +
(Drag card to add)
+
+ Add widget base +
@@ -491,7 +492,7 @@ @dragstart="onRegularWidgetDragStart" @dragend="onRegularWidgetDragEnd(widgetType)" > - + @@ -522,19 +522,49 @@ id="mini-widget-card" :ref="(el) => (miniWidgetContainers[miniWidget.component] = el as HTMLElement)" :key="miniWidget.hash" - class="flex flex-col items-center justify-between w-full rounded-md bg-[#273842] hover:brightness-125 h-[90%] aspect-square cursor-pointer elevation-4 overflow-clip pointer-events-none" + class="flex flex-col items-center w-full justify-between rounded-md bg-[#273842] hover:brightness-125 h-[90%] aspect-square cursor-pointer elevation-4 overflow-clip" :draggable="false" >
-
+
+ +
+
+
+ {{ + miniWidget.name.replace(/([a-z])([A-Z])/g, '$1 $2').replace(/^./, (str) => str.toUpperCase()) || + 'Very generic indicator' + }} +
+
+
+
+
+
+
+
-
+
{{ miniWidget.name.replace(/([a-z])([A-Z])/g, '$1 $2').replace(/^./, (str) => str.toUpperCase()) || - 'Very Generic Indicator' + 'Very generic indicator' }}
@@ -587,6 +617,21 @@ + +
+ +
+
+ + diff --git a/src/components/MiniWidgetContainer.vue b/src/components/MiniWidgetContainer.vue index ff481712c..0477b3412 100644 --- a/src/components/MiniWidgetContainer.vue +++ b/src/components/MiniWidgetContainer.vue @@ -25,7 +25,7 @@ @mouseover="widgetStore.miniWidgetManagerVars(miniWidget.hash).highlighted = allowEditing" @mouseleave="widgetStore.miniWidgetManagerVars(miniWidget.hash).highlighted = false" > -
+
@@ -36,12 +36,12 @@
-
+
-
+
@@ -146,6 +146,7 @@ const handleDeleteWidget = (event: DraggableEvent): void => { // Remove miniWidget variableName from Logged variables list CurrentlyLoggedVariables.removeVariable(widgetData.options.displayName) } + widgetStore.elementToShowOnDrawer = undefined trashList.value = [] } diff --git a/src/components/MiniWidgetInstantiator.vue b/src/components/MiniWidgetInstantiator.vue index be0f0c2b7..6acc253e8 100644 --- a/src/components/MiniWidgetInstantiator.vue +++ b/src/components/MiniWidgetInstantiator.vue @@ -3,37 +3,51 @@ diff --git a/src/components/WidgetHugger.vue b/src/components/WidgetHugger.vue index a45a7246f..d99488ac2 100644 --- a/src/components/WidgetHugger.vue +++ b/src/components/WidgetHugger.vue @@ -87,7 +87,7 @@ const hoveringWidgetOrOverlay = computed(() => hoveringOverlay.value || hovering // Put the widget into highlighted state when in edit-mode and hovering over it watch([hoveringWidgetOrOverlay, allowMoving], () => { - widgetStore.widgetManagerVars(widget.value.hash).highlighted = hoveringWidgetOrOverlay.value && allowMoving.value + widgetStore.widgetManagerVars(widget.value.hash).highlighted = hoveringWidgetOrOverlay.value }) const draggingWidget = ref(false) diff --git a/src/components/custom-widget-elements/Button.vue b/src/components/custom-widget-elements/Button.vue new file mode 100644 index 000000000..837f9990d --- /dev/null +++ b/src/components/custom-widget-elements/Button.vue @@ -0,0 +1,85 @@ + + + + + diff --git a/src/components/custom-widget-elements/Checkbox.vue b/src/components/custom-widget-elements/Checkbox.vue new file mode 100644 index 000000000..91e9a2f7e --- /dev/null +++ b/src/components/custom-widget-elements/Checkbox.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/src/components/custom-widget-elements/Dial.vue b/src/components/custom-widget-elements/Dial.vue new file mode 100644 index 000000000..3fa8e19ff --- /dev/null +++ b/src/components/custom-widget-elements/Dial.vue @@ -0,0 +1,251 @@ + + + + + diff --git a/src/components/custom-widget-elements/Dropdown.vue b/src/components/custom-widget-elements/Dropdown.vue new file mode 100644 index 000000000..7b0f49bc8 --- /dev/null +++ b/src/components/custom-widget-elements/Dropdown.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/src/components/custom-widget-elements/Label.vue b/src/components/custom-widget-elements/Label.vue new file mode 100644 index 000000000..25ffdb2d6 --- /dev/null +++ b/src/components/custom-widget-elements/Label.vue @@ -0,0 +1,100 @@ + + + + + diff --git a/src/components/custom-widget-elements/Slider.vue b/src/components/custom-widget-elements/Slider.vue new file mode 100644 index 000000000..0bd14395f --- /dev/null +++ b/src/components/custom-widget-elements/Slider.vue @@ -0,0 +1,142 @@ + + + + + diff --git a/src/components/custom-widget-elements/Switch.vue b/src/components/custom-widget-elements/Switch.vue new file mode 100644 index 000000000..ff1173731 --- /dev/null +++ b/src/components/custom-widget-elements/Switch.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/src/components/mini-widgets/ArmerButton.vue b/src/components/mini-widgets/ArmerButton.vue index 7e85420e1..10c5a6da3 100644 --- a/src/components/mini-widgets/ArmerButton.vue +++ b/src/components/mini-widgets/ArmerButton.vue @@ -1,7 +1,7 @@