Skip to content

Commit

Permalink
Merge pull request #683 from intechstudio/bug/MinorFixes
Browse files Browse the repository at this point in the history
🚩PR: Various bugfixes and minor feature updates
  • Loading branch information
SukuWc authored Apr 23, 2024
2 parents 63ae58c + b26106e commit 6cc842e
Show file tree
Hide file tree
Showing 35 changed files with 234 additions and 440 deletions.
10 changes: 5 additions & 5 deletions src/renderer/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,11 @@
</Pane>
<Pane class="overflow-clip w-full h-full">
<MiddlePanelContainer>
{#if $modal?.options.snap === "middle"}
<svelte:component this={$modal?.component} reference={3} />
{/if}
</MiddlePanelContainer>
{#if $modal?.options.snap === "middle"}
<svelte:component this={$modal?.component} reference={3} />
{:else}
<MiddlePanelContainer />
{/if}
</Pane>
<Pane
Expand Down
1 change: 1 addition & 0 deletions src/renderer/config-blocks/ActionBlockInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class SyntaxPreprocessor {
interface Information {
short: string;
name: string;
menuName?: string;
rendering: "modifier" | "standard";
category:
| "variables"
Expand Down
7 changes: 1 addition & 6 deletions src/renderer/config-blocks/ButtonPressRelease_End.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@
</script>

<else-block
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 {information.rounding ==
'top'
? 'rounded-tr-xl '
: ''} {information.rounding == 'bottom'
? 'rounded-br-xl '
: ''} pointer-events-auto"
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 pointer-events-auto"
style="min-height: 2.5rem; background: {information.color};"
/>
10 changes: 3 additions & 7 deletions src/renderer/config-blocks/ButtonPressRelease_If.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
export const information: ActionBlockInformation = {
short: "bpr",
name: "ButtonPressRelease_If",
menuName: "Press/Release",
rendering: "modifier",
rounding: "top",
category: "special",
Expand Down Expand Up @@ -106,7 +107,7 @@

<script>
import { createEventDispatcher, onDestroy } from "svelte";
import stringManipulation from "../main/user-interface/_string-operations";
import { stringManipulation } from "../main/user-interface/_string-operations";
import { parenthesis } from "./_validators";
export let config;
Expand Down Expand Up @@ -147,12 +148,7 @@
<svelte:window bind:innerWidth={sidebarWidth} />

<if-block
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 {information.rounding ==
'top'
? 'rounded-tr-xl '
: ''} {information.rounding == 'bottom'
? 'rounded-br-xl '
: ''} pointer-events-auto"
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 pointer-events-auto"
style="min-height: 2.5rem; background: {information.color};"
>
<div class="bg-secondary p-1 my-auto mr-1 rounded hidden">
Expand Down
40 changes: 8 additions & 32 deletions src/renderer/config-blocks/CodeBlock.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<script>
import * as luamin from "lua-format";
import stringManipulation from "../main/user-interface/_string-operations";
import { stringManipulation } from "../main/user-interface/_string-operations";
import { createEventDispatcher, onMount, onDestroy } from "svelte";
Expand Down Expand Up @@ -102,35 +102,7 @@
});
function displayConfigScript(script) {
if (typeof codePreview === "undefined") return;
let code = "";
try {
//Step 1
let human = stringManipulation.humanize(String(script));
if (human.trim() !== "") {
code = human;
}
//Step2
let beautified = luamin.Beautify(human, {
RenameVariables: false,
RenameGlobals: false,
SolveMath: false,
});
if (beautified.charAt(0) === "\n") {
beautified = beautified.slice(1);
}
if (beautified.trim() !== "") {
code = beautified;
}
} catch (e) {
//Fallback
code = script;
}
codePreview.innerHTML = stringManipulation.noCommentToLineComment(code);
codePreview.innerHTML = stringManipulation.expandScript(script);
monaco_editor.colorizeElement(codePreview, {
theme: "my-theme",
tabSize: 2,
Expand All @@ -142,16 +114,20 @@
//evt.preventDefault();
//codePreview.scrollLeft += evt.deltaY;
});
displayConfigScript(config.script);
});
$: {
if (codePreview) {
displayConfigScript(config.script);
}
}
$: if (typeof $committed_code_store !== "undefined") {
if ($committed_code_store.index == index) {
dispatch("output", {
short: "cb",
script: $committed_code_store.script,
});
displayConfigScript($committed_code_store.script);
}
}
Expand Down
7 changes: 1 addition & 6 deletions src/renderer/config-blocks/EncoderLeftRight_End.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@
</script>

<else-block
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 {information.rounding ==
'top'
? 'rounded-tr-xl '
: ''} {information.rounding == 'bottom'
? 'rounded-br-xl '
: ''} pointer-events-auto"
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 pointer-events-auto"
style="min-height: 2.5rem; background: {information.color};"
/>
10 changes: 3 additions & 7 deletions src/renderer/config-blocks/EncoderLeftRight_If.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
rounding: "top",
category: "special",
displayName: "Rotate Left",
menuName: "Left/Right Rotate",
defaultLua: "if self:est()<64 then",
compositeLua: [
{ short: "elrel", script: "else" },
Expand Down Expand Up @@ -62,7 +63,7 @@

<script>
import { createEventDispatcher, onDestroy } from "svelte";
import stringManipulation from "../main/user-interface/_string-operations";
import { stringManipulation } from "../main/user-interface/_string-operations";
import { parenthesis } from "./_validators";
export let config;
Expand Down Expand Up @@ -103,12 +104,7 @@
<svelte:window bind:innerWidth={sidebarWidth} />

<if-block
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 {information.rounding ==
'top'
? 'rounded-tr-xl '
: ''} {information.rounding == 'bottom'
? 'rounded-br-xl '
: ''} pointer-events-auto"
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 pointer-events-auto"
style="min-height: 2.5rem; background: {information.color};"
>
<div class="bg-secondary p-1 my-auto mr-1 rounded hidden">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
</script>

<else-block
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 {information.rounding ==
'top'
? 'rounded-tr-xl '
: ''} {information.rounding == 'bottom'
? 'rounded-br-xl '
: ''} pointer-events-auto"
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 pointer-events-auto"
style="min-height: 2.5rem; background: {information.color};"
/>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
rounding: "top",
category: "special",
displayName: "Push & Rotate Left",
menuName: "Push & Rotate L R",
defaultLua: "if (self:bst()>0 and self:est()<64) then",
compositeLua: [
{
Expand Down
7 changes: 1 addition & 6 deletions src/renderer/config-blocks/EncoderPushRot_End.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@
</script>

<else-block
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 {information.rounding ==
'top'
? 'rounded-tr-xl '
: ''} {information.rounding == 'bottom'
? 'rounded-br-xl '
: ''} pointer-events-auto"
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 pointer-events-auto"
style="min-height: 2.5rem; background: {information.color};"
/>
10 changes: 3 additions & 7 deletions src/renderer/config-blocks/EncoderPushRot_If.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
rounding: "top",
category: "special",
displayName: "Push & Rotate",
menuName: "Push & Rotate",
defaultLua: "if self:bst()>0 then",
compositeLua: [
{ short: "eprel", script: "else" },
Expand Down Expand Up @@ -44,7 +45,7 @@

<script>
import { createEventDispatcher, onDestroy } from "svelte";
import stringManipulation from "../main/user-interface/_string-operations";
import { stringManipulation } from "../main/user-interface/_string-operations";
import { parenthesis } from "./_validators";
export let config;
Expand Down Expand Up @@ -85,12 +86,7 @@
<svelte:window bind:innerWidth={sidebarWidth} />

<if-block
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 {information.rounding ==
'top'
? 'rounded-tr-xl '
: ''} {information.rounding == 'bottom'
? 'rounded-br-xl '
: ''} pointer-events-auto"
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 pointer-events-auto"
style="min-height: 2.5rem; background: {information.color};"
>
<div class="bg-secondary p-1 my-auto mr-1 rounded hidden">
Expand Down
7 changes: 1 addition & 6 deletions src/renderer/config-blocks/Loop_End.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
</script>

<endif-block
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 {information.rounding ==
'top'
? 'rounded-tr-xl '
: ''} {information.rounding == 'bottom'
? 'rounded-br-xl '
: ''} pointer-events-auto"
class="{$$props.class} w-full h-fit flex flex-col text-white py-1 pointer-events-auto"
style="min-height: 2.5rem; background: {information.color};"
/>
2 changes: 1 addition & 1 deletion src/renderer/config-blocks/VarGlobal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<script>
import { createEventDispatcher, onDestroy, onMount } from "svelte";
import { fly } from "svelte/transition";
import stringManipulation from "../main/user-interface/_string-operations";
import { stringManipulation } from "../main/user-interface/_string-operations";
import { parenthesis } from "./_validators.js";
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/config-blocks/VarLocals.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<script>
import { createEventDispatcher, onDestroy, onMount } from "svelte";
import { fly } from "svelte/transition";
import stringManipulation from "../main/user-interface/_string-operations";
import { stringManipulation } from "../main/user-interface/_string-operations";
import { parenthesis } from "./_validators.js";
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/config-blocks/VarSelf.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<script>
import { createEventDispatcher, onDestroy, onMount } from "svelte";
import { fly } from "svelte/transition";
import stringManipulation from "../main/user-interface/_string-operations";
import { stringManipulation } from "../main/user-interface/_string-operations";
import { parenthesis } from "./_validators.js";
Expand Down
2 changes: 0 additions & 2 deletions src/renderer/config-blocks/headers/CompositeFace.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
<div
class="{$$props.class} text-white flex items-center"
style="background-color:{config.information.color}"
class:rounded-tr-xl={config.information.rounding == "top"}
class:rounded-br-xl={config.information.rounding == "bottom"}
on:click={handleClick}
>
<span>{config.information.displayName}</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import { createEventDispatcher, onDestroy } from "svelte";
import stringManipulation from "../../main/user-interface/_string-operations";
import { stringManipulation } from "../../main/user-interface/_string-operations";
import { parenthesis } from "../_validators";
const dispatch = createEventDispatcher();
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/config-blocks/headers/ConditionIfFace.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import { createEventDispatcher, onDestroy } from "svelte";
import stringManipulation from "../../main/user-interface/_string-operations";
import { stringManipulation } from "../../main/user-interface/_string-operations";
import { parenthesis } from "../_validators";
export let config;
Expand Down Expand Up @@ -38,7 +38,7 @@
</script>

<if-block
class="{$$props.class} h-fit flex text-white py-1 pointer-events-none rounded-tr-xl"
class="{$$props.class} h-fit flex text-white py-1 pointer-events-none"
style="background-color:{config.information.color}"
>
<div class="flex flex-row items-center w-full">
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/config-blocks/headers/ForLoopHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { createEventDispatcher } from "svelte";
import { Script } from "../_script_parsers.js";
import Toggle from "../../main/user-interface/Toggle.svelte";
import stringManipulation from "../../main/user-interface/_string-operations";
import { stringManipulation } from "../../main/user-interface/_string-operations";
import { Validator } from "../_validators";
import AtomicInput from "../../main/user-interface/AtomicInput.svelte";
import SendFeedback from "../../main/user-interface/SendFeedback.svelte";
Expand Down Expand Up @@ -97,7 +97,7 @@
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<container
class="{$$props.class} h-full justify-center flex flex-col rounded-tr-xl"
class="{$$props.class} h-full justify-center flex flex-col"
class:p-2={toggleValue}
style="background-color:{config.information.color}"
>
Expand Down
2 changes: 0 additions & 2 deletions src/renderer/main/MiddlePanelContainer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,4 @@
on:content-change={handleContentChange}
/>
</div>

<slot />
</div>
Loading

0 comments on commit 6cc842e

Please sign in to comment.