Skip to content

Commit

Permalink
Fixed PR issues
Browse files Browse the repository at this point in the history
  • Loading branch information
elsoazemelet committed Oct 26, 2023
1 parent 2849371 commit 3fa0a79
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 320 deletions.
20 changes: 0 additions & 20 deletions src/renderer/config-blocks/LedAnimationStart.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -157,26 +157,6 @@
suggestions = _suggestions;
});
let showSuggestions = false;
let focusedInput = undefined;
let focusGroup = [];
function onActiveFocus(event, index) {
if (index < 2) {
suggestionPlaceMove = true;
} else {
suggestionPlaceMove = false;
}
focusGroup[index] = event.detail.focus;
focusedInput = index;
}
function onLooseFocus(event, index) {
focusGroup[index] = event.detail.focus;
showSuggestions = focusGroup.includes(true);
}
let suggestionElement1 = undefined;
let suggestionElement2 = undefined;
Expand Down
20 changes: 0 additions & 20 deletions src/renderer/config-blocks/LedAnimationStop.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -157,26 +157,6 @@
suggestions = _suggestions;
});
let showSuggestions = false;
let focusedInput = undefined;
let focusGroup = [];
function onActiveFocus(event, index) {
if (index < 2) {
suggestionPlaceMove = true;
} else {
suggestionPlaceMove = false;
}
focusGroup[index] = event.detail.focus;
focusedInput = index;
}
function onLooseFocus(event, index) {
focusGroup[index] = event.detail.focus;
showSuggestions = focusGroup.includes(true);
}
let suggestionElement = undefined;
let focusedInputIndex = null;
Expand Down
22 changes: 0 additions & 22 deletions src/renderer/config-blocks/LedColor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -180,28 +180,6 @@ A -> B : AB-First step
updatePicker();
});
let suggestionPlaceMove = false;
let showSuggestions = false;
let focusedInput = undefined;
let focusGroup = [];
function onActiveFocus(event, index) {
if (index < 2) {
suggestionPlaceMove = true;
} else {
suggestionPlaceMove = false;
}
focusGroup[index] = event.detail.focus;
focusedInput = index;
}
function onLooseFocus(event, index) {
focusGroup[index] = event.detail.focus;
showSuggestions = focusGroup.includes(true);
}
/* accepts parameters
* h Object = {h:x, s:y, v:z}
* OR
Expand Down
14 changes: 0 additions & 14 deletions src/renderer/config-blocks/LedPhase.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,6 @@
suggestions = _suggestions;
});
let showSuggestions = false;
let focusedInput = undefined;
let focusGroup = [];
function onActiveFocus(event, index) {
focusGroup[index] = event.detail.focus;
focusedInput = index;
}
function onLooseFocus(event, index) {
focusGroup[index] = event.detail.focus;
showSuggestions = focusGroup.includes(true);
}
let suggestionElement = undefined;
let focusedInputIndex = null;
Expand Down
22 changes: 1 addition & 21 deletions src/renderer/config-blocks/MidiFourteenBit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -681,26 +681,10 @@
renderSuggestions();
}
let ready = false;
onMount(() => {
renderSuggestions();
ready = true;
});
let showSuggestions = false;
let focusedInput = undefined;
let focusGroup = [];
function onActiveFocus(event, index) {
focusGroup[index] = event.detail.focus;
focusedInput = index;
}
function onLooseFocus(event, index) {
focusGroup[index] = event.detail.focus;
showSuggestions = focusGroup.includes(true);
}
const tabs = [
{ name: "MIDI", component: "Midi" },
{ name: "14 bit MIDI", component: "MidiFourteenBit" },
Expand Down Expand Up @@ -751,6 +735,7 @@
inputValue={script}
suggestions={suggestions[i]}
validator={validators[i]}
suggestionTarget={suggestionElement}
on:focus={() => handleInputFocus(i)}
on:validator={(e) => {
const data = e.detail;
Expand All @@ -766,12 +751,7 @@

<AtomicSuggestions
bind:component={suggestionElement}
suggestionTarget={suggestionElement}
on:select={handleSuggestionSelected}
on:select={(e) => {
scriptSegments[e.detail.index] = e.detail.value;
sendData(e.detail.value, e.detail.index);
}}
/>

<SendFeedback
Expand Down
21 changes: 2 additions & 19 deletions src/renderer/config-blocks/MouseButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
loaded = false;
});
function sendData(e) {
scriptSegments[e.detail.index] = e.detail.value;
function sendData(value, index) {
scriptSegments[index] = value;
const script = Script.toScript({
human: config.human,
Expand All @@ -81,20 +81,6 @@
dispatch("output", { short: config.short, script: script });
}
let showSuggestions = false;
let focusedInput = undefined;
let focusGroup = [];
function onActiveFocus(event, index) {
focusGroup[index] = event.detail.focus;
focusedInput = index;
}
function onLooseFocus(event, index) {
focusGroup[index] = event.detail.focus;
showSuggestions = focusGroup.includes(true);
}
let suggestions = [];
const _suggestions = [
Expand Down Expand Up @@ -155,9 +141,6 @@
<AtomicSuggestions
bind:component={suggestionElement}
on:select={handleSuggestionSelected}
on:select={(e) => {
sendData(e);
}}
/>
</mouse-button>

Expand Down
14 changes: 0 additions & 14 deletions src/renderer/config-blocks/MouseMove.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,6 @@
suggestions = _suggestions;
});
let showSuggestions = false;
let focusedInput = undefined;
let focusGroup = [];
function onActiveFocus(event, index) {
focusGroup[index] = event.detail.focus;
focusedInput = index;
}
function onLooseFocus(event, index) {
focusGroup[index] = event.detail.focus;
showSuggestions = focusGroup.includes(true);
}
let suggestionElement = undefined;
let focusedInputIndex = null;
Expand Down
30 changes: 3 additions & 27 deletions src/renderer/config-blocks/SettingsButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,8 @@
sendData(scriptValue);
}
function sendData(e) {
dispatch("output", { short: `sbc`, script: `self:bmo(${e})` });
}
let showSuggestions = false;
let focusedInput = undefined;
let focusGroup = [];
function onActiveFocus(event, index) {
focusGroup[index] = event.detail.focus;
focusedInput = index;
}
function onLooseFocus(event, index) {
focusGroup[index] = event.detail.focus;
showSuggestions = focusGroup.includes(true);
function sendData(value) {
dispatch("output", { short: `sbc`, script: `self:bmo(${value})` });
}
const suggestions = [
Expand All @@ -89,15 +75,9 @@
let suggestionElement = undefined;
let focusedInputIndex = null;
function handleInputFocus(index) {
focusedInputIndex = index;
}
function handleSuggestionSelected(e) {
const { value } = e.detail;
scriptSegments[focusedInputIndex] = value;
sendData(value, focusedInputIndex);
scriptValue = value;
}
</script>

Expand All @@ -110,7 +90,6 @@
inputValue={scriptValue}
suggestions={suggestions[0]}
suggestionTarget={suggestionElement}
on:focus={() => handleInputFocus()}
on:change={(e) => {
scriptValue = e.detail;
}}
Expand All @@ -127,8 +106,5 @@
<AtomicSuggestions
bind:component={suggestionElement}
on:select={handleSuggestionSelected}
on:select={(e) => {
scriptValue = e.detail.value;
}}
/>
</encoder-settings>
35 changes: 9 additions & 26 deletions src/renderer/config-blocks/SettingsEncoder.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,6 @@
});
}
let showSuggestions = false;
let focusedInput = undefined;
let focusGroup = [];
function onActiveFocus(event, index) {
focusGroup[index] = event.detail.focus;
focusedInput = index;
}
function onLooseFocus(event, index) {
focusGroup[index] = event.detail.focus;
showSuggestions = focusGroup.includes(true);
}
const suggestions = [
[
{ value: "0", info: "Absolute" },
Expand All @@ -115,8 +101,12 @@
function handleSuggestionSelected(e) {
const { value } = e.detail;
scriptSegments[focusedInputIndex] = value;
sendData(value, focusedInputIndex);
if (focusedInputIndex == 1) {
ev0 = value;
}
if (focusedInputIndex == 0) {
emo = value;
}
}
</script>

Expand All @@ -133,7 +123,8 @@
validator={(e) => {
return new Validator(e).NotEmpty().Result();
}}
on:focus={() => handleInputFocus()}
suggestionTarget={suggestionElement}
on:focus={() => handleInputFocus(0)}
on:change={(e) => {
emo = e.detail;
}}
Expand All @@ -155,7 +146,7 @@
return new Validator(e).NotEmpty().Result();
}}
suggestionTarget={suggestionElement}
on:focus={() => handleInputFocus()}
on:focus={() => handleInputFocus(1)}
on:change={(e) => {
ev0 = e.detail;
}}
Expand All @@ -171,13 +162,5 @@
<AtomicSuggestions
bind:component={suggestionElement}
on:select={handleSuggestionSelected}
on:select={(e) => {
if (focusedInput == 1) {
ev0 = e.detail.value;
}
if (focusedInput == 0) {
emo = e.detail.value;
}
}}
/>
</encoder-settings>
Loading

0 comments on commit 3fa0a79

Please sign in to comment.