Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions fix_sandbox.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sudo chown root ./node_modules/electron/dist/chrome-sandbox
sudo chmod 4755 ./node_modules/electron/dist/chrome-sandbox
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"dependencies": {
"@intechstudio/grid-protocol": "1.20251126.1325",
"@intechstudio/grid-uikit": "1.20251104.1750",
"@intechstudio/grid-uikit": "1.20260116.1329",
"@intechstudio/profile-cloud-webcomponent": "1.20251107.1414",
"adm-zip": "^0.5.10",
"axios": "^1.9.0",
Expand Down
8 changes: 5 additions & 3 deletions playwright-tests/data/actionBlockLocators.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const blocks = (page) => ({
block: page.locator("#action-menu").getByText("Function").nth(1),
elements: {
Function: page.locator("#cfg-0"),
input: page.locator(".view-line"),
input: page.locator("#cfg-0 input"),
End: page.locator("#cfg-1"),
},
},
Expand Down Expand Up @@ -237,8 +237,10 @@ export const blocks = (page) => ({
"Repeater Loop": {
block: page.getByText("Repeater Loop"),
elements: {
variable: page.locator("#cfg-0").getByRole("button"),
times: page.locator("#cfg-0").getByRole("textbox"),
variable: page
.locator("#cfg-0")
.getByRole("button", { name: "Repeat" }),
times: page.locator("#cfg-0").getByRole("button", { name: "Times" }),
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/config-blocks/For_Loop.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
defaultLua: "for i=1,5 do",
compositeLua: [{ short: "enl", script: "end" }],
icon: `<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="3.32 5.32 17.37 16.37"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M8 18H7C5.34315 18 4 16.6569 4 15V9C4 7.34315 5.34315 6 7 6H17C18.6569 6 20 7.34315 20 9V15C20 16.6569 18.6569 18 17 18H12M12 18L15 15M12 18L15 21" stroke="#000000" stroke-width="1.3679999999999999" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>`,
blockIcon: `<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="3.32 5.32 17.37 16.37"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M8 18H7C5.34315 18 4 16.6569 4 15V9C4 7.34315 5.34315 6 7 6H17C18.6569 6 20 7.34315 20 9V15C20 16.6569 18.6569 18 17 18H12M12 18L15 15M12 18L15 21" stroke="#000000" stroke-width="1.3679999999999999" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>`,
blockIcon: `<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="3.32 5.32 17.37 16.37"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M8 18H7C5.34315 18 4 16.6569 4 15V9C4 7.34315 5.34315 6 7 6H17C18.6569 6 20 7.34315 20 9V15C20 16.6569 18.6569 18 17 18H12M12 18L15 15M12 18L15 21" stroke="#ffffff" stroke-width="1.3679999999999999" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>`,
color: "#F4511E",
selectable: true,
movable: true,
hideIcon: true,
hideIcon: false,
type: "composite_open",
toggleable: false,
syntaxPreprocessor: new SyntaxPreprocessor("$SCRIPT$ end"),
Expand Down
19 changes: 15 additions & 4 deletions src/renderer/config-blocks/For_Loop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export namespace ForLoop {

export type ViewModelData = {
variable: MeltComboData;
increment: string;
increment: MeltComboData;
};

export class ViewModel implements Readable<ViewModelData> {
Expand Down Expand Up @@ -73,17 +73,28 @@ export namespace ForLoop {
{ value: "k", info: "k" },
],
},
increment: parsed.increment,
increment: {
value: parsed.increment,
validator: {
value: true,
func: (e) => new Validator(e).NotEmpty().Result(),
},
suggestions: [],
},
});
}

public buildScript() {
const data = get(this._internal);
return `for ${data.variable.value}=1,${data.increment} do`;
return `for ${data.variable.value}=1,${data.increment.value} do`;
}

public isValidationError() {
return get(this._internal).variable.validator.value === false;
const data = get(this._internal);
return (
data.variable.validator.value === false ||
data.increment.validator.value === false
);
}
}
}
8 changes: 4 additions & 4 deletions src/renderer/config-blocks/Function_Start.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
rounding: "top",
category: "function",
displayName: "Function",
defaultLua: "function YourFunction()",
defaultLua: "YourFunction = function()",
compositeLua: [{ short: "fen", script: "end" }],
icon: `
<svg class="svg-icon" style="width: 1em; height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg">
<path d="M768 921.6H275.2c-83.2 0-147.2-64-147.2-147.2V275.2C128 192 192 128 275.2 128H768c83.2 0 147.2 64 147.2 147.2 0 25.6-12.8 32-38.4 32s-38.4-12.8-38.4-32c0-38.4-32-70.4-70.4-70.4H275.2c-38.4 0-70.4 32-70.4 70.4v499.2c0 38.4 32 70.4 70.4 70.4H768c38.4 0 70.4-32 70.4-70.4 0-19.2 19.2-38.4 38.4-38.4s38.4 19.2 38.4 38.4c0 76.8-64 147.2-147.2 147.2z m-38.4-281.6c-6.4 0-19.2 0-25.6-6.4L582.4 499.2c-12.8-12.8-12.8-32 0-44.8 12.8-12.8 32-12.8 44.8 0l121.6 134.4c12.8 12.8 12.8 32 0 44.8 0 6.4-6.4 6.4-19.2 6.4z m-140.8 12.8c-6.4 0-12.8 0-19.2-6.4-12.8-12.8-12.8-25.6 0-38.4l166.4-172.8c12.8-12.8 25.6-12.8 38.4 0s12.8 25.6 0 38.4l-166.4 172.8c-6.4 6.4-12.8 6.4-19.2 6.4z m-44.8-377.6c12.8 0 44.8 6.4 44.8 38.4 0 25.6-38.4 19.2-51.2 19.2-57.6 0-76.8 32-83.2 57.6l-12.8 76.8h64c12.8 0 25.6 12.8 25.6 25.6s-12.8 25.6-25.6 25.6H435.2l-44.8 198.4s-6.4 57.6-44.8 57.6-19.2-57.6-19.2-57.6l44.8-192h-57.6c-12.8 0-25.6-12.8-25.6-25.6 0-25.6 12.8-32 25.6-32H384L403.2 384C416 275.2 512 268.8 544 275.2z m326.4 115.2c6.4-19.2 19.2-25.6 38.4-25.6 19.2 6.4 25.6 19.2 25.6 38.4l-64 256c-6.4 19.2-19.2 25.6-38.4 25.6-19.2-6.4-25.6-19.2-25.6-38.4l64-256z" fill="#333333" />
</svg>
`,
blockIcon: `<span class="text-white">If</span>`,
color: "#4474c2 ",
blockIcon: `<span class="text-white font-medium">fn</span>`,
color: "#4474c2",
selectable: true,
movable: true,
hideIcon: true,
hideIcon: false,
type: "composite_open",
toggleable: false,
syntaxPreprocessor: new SyntaxPreprocessor("$SCRIPT$ end"),
Expand Down
20 changes: 10 additions & 10 deletions src/renderer/config-blocks/RawCode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import SendFeedback from "../main/user-interface/SendFeedback.svelte";

import TooltipQuestion from "../../renderer/main/user-interface/tooltip/TooltipQuestion.svelte";
import { MoltenButton } from "@intechstudio/grid-uikit";
import { MoltenPushButton } from "@intechstudio/grid-uikit";
import { mergeActionsToCode } from "../runtime/operations";
import { GridAction, GridEvent } from "../runtime/runtime";
import { Analytics } from "../runtime/analytics.js";
Expand Down Expand Up @@ -128,23 +128,23 @@

<div class="text-white">
{#if availablePackage?.isDownloaded === true}
<MoltenButton
title={"Enable Package"}
border={"yellow-500"}
<MoltenPushButton
text="Enable Package"
style="outlined"
click={handleEnablePackage}
/>
{:else if availablePackage?.installProgress !== undefined}
<p class="text-white">Installing package...</p>
{:else if availablePackage?.isDownloaded === false}
<MoltenButton
title={"Install Package"}
border={"yellow-500"}
<MoltenPushButton
text="Install Package"
style="outlined"
click={handleInstallPackage}
/>
{:else}
<MoltenButton
title={"To Code"}
border={"yellow-500"}
<MoltenPushButton
text="To Code"
style="outlined"
click={handleReplace}
/>
{/if}
Expand Down
186 changes: 83 additions & 103 deletions src/renderer/config-blocks/SimpleColor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
<script lang="ts">
import { createEventDispatcher, onDestroy } from "svelte";
import {
Block,
BlockRow,
BlockColumn,
MeltCombo,
MeltSelect,
MeltCheckbox,
Expand All @@ -42,7 +45,6 @@
CircleColorPicker,
ColorLayerSelector,
type LayerClickDetail,
ControlGroup,
} from "@intechstudio/grid-uikit";

import { GridScript } from "@intechstudio/grid-protocol";
Expand Down Expand Up @@ -170,8 +172,14 @@
</script>

<config-led-color class="flex flex-col gap-4 w-full p-2 pointer-events-auto">
<MeltSelect
bind:target={$appSettings.persistent.colorPicker}
{options}
disabled={false}
size={"full"}
/>
{#if $appSettings.persistent.userLevelMinimalist == false}
<div class="flex flex-row w-full gap-2">
<BlockRow>
<MeltCombo
title={"Element"}
value={$data.element.value}
Expand Down Expand Up @@ -203,7 +211,7 @@
postProcessor={GridScript.shortify}
preProcessor={GridScript.humanize}
/>
</div>
</BlockRow>
{/if}
<ColorLayerSelector
colors={$data.previewColors}
Expand All @@ -212,108 +220,80 @@
on:remove-layer={handleRemoveLayer}
on:layer-click={handleLayerClicked}
/>

<div class="flex w-full">
<MeltSelect
bind:target={$appSettings.persistent.colorPicker}
{options}
disabled={false}
size={"full"}
/>
</div>

<ControlGroup>
<div slot="header" class="flex flex-row justify-between">
<span class="text-lg">Mixer</span>
<div
class="flex rounded-full w-1/3 h-6"
style="background-color: {getMixerPreviewColor($data)};"
<BlockRow>
<div class="flex flex-grow min-w-28 h-28 items-center justify-center">
<svelte:component
this={colorPickerComponent.get($appSettings.persistent.colorPicker)}
color={$data.pickerColor}
on:input={(e) => {
const { color } = e.detail;
data.updatePickerColor(color);
sendData($data);
}}
on:change={(e) => {
dispatch("sync");
}}
/>
</div>
<div
slot="content"
class="grid grid-cols-[1fr_max-content] w-full gap-2 items-center justify-center bg-background p-2 rounded-xl"
>
<div class="flex flex-col">
{#each [SimpleColor.Channel.RED, SimpleColor.Channel.GREEN, SimpleColor.Channel.BLUE] as channel}
<div class="flex flex-row flex-grow items-center gap-2">
<span>{channel[0].toLocaleUpperCase()}</span>
<MeltCombo
title={" "}
value={$data[channel].value}
validator={$data[channel].validator.func}
suggestions={$data[channel].suggestions}
on:input={(e) => {
const { value, validationError } = e.detail;
data.updateRGBAChannelValue(
action,
value,
validationError,
channel,
);
sendData($data);
}}
on:change={() => dispatch("sync")}
postProcessor={GridScript.shortify}
preProcessor={GridScript.humanize}
/>
</div>
{/each}
</div>
<div class="flex w-32 h-32 items-center justify-center">
<svelte:component
this={colorPickerComponent.get($appSettings.persistent.colorPicker)}
color={$data.pickerColor}
on:input={(e) => {
const { color } = e.detail;
data.updatePickerColor(color);
sendData($data);
}}
on:change={(e) => {
dispatch("sync");
}}
/>
</div>
<div class="flex flex-row items-center gap-2 flex-grow">
<span>{SimpleColor.Channel.ALPHA[0].toLocaleUpperCase()}</span>
<MeltCombo
title={" "}
value={$data[SimpleColor.Channel.ALPHA].value}
validator={$data[SimpleColor.Channel.ALPHA].validator.func}
suggestions={$data[SimpleColor.Channel.ALPHA].suggestions}
on:input={(e) => {
const { value, validationError } = e.detail;
data.updateRGBAChannelValue(
action,
value,
validationError,
SimpleColor.Channel.ALPHA,
);
sendData($data);
}}
on:change={() => dispatch("sync")}
postProcessor={GridScript.shortify}
preProcessor={GridScript.humanize}
/>
</div>
<div class="flex flex-grow">
<MeltSlider
target={$data.alphaSliderValue}
min={0}
max={1}
step={0.01}
on:change={(e) => {
const { value } = e.detail;
data.updateAlphaSliderValue(value);
sendData($data);
}}
on:commit={() => {
dispatch("sync");
}}
/>
</div>
</div>
</ControlGroup>

<BlockColumn>
<MeltCombo
title="Alpha"
value={$data[SimpleColor.Channel.ALPHA].value}
validator={$data[SimpleColor.Channel.ALPHA].validator.func}
suggestions={[
...$data[SimpleColor.Channel.ALPHA].suggestions,
{ value: "1", info: "Default" },
{ value: "0", info: "Transparent" },
]}
on:input={(e) => {
const { value, validationError } = e.detail;
data.updateRGBAChannelValue(
action,
value,
validationError,
SimpleColor.Channel.ALPHA,
);
sendData($data);
}}
on:change={() => dispatch("sync")}
postProcessor={GridScript.shortify}
preProcessor={GridScript.humanize}
/>
<MeltSlider
target={$data.alphaSliderValue}
min={0}
max={1}
step={0.01}
on:change={(e) => {
const { value } = e.detail;
data.updateAlphaSliderValue(value);
sendData($data);
}}
on:commit={() => {
dispatch("sync");
}}
/>
</BlockColumn>
</BlockRow>
<BlockRow>
{#each [SimpleColor.Channel.RED, SimpleColor.Channel.GREEN, SimpleColor.Channel.BLUE] as channel}
<MeltCombo
title={channel.charAt(0).toUpperCase() + channel.slice(1)}
value={$data[channel].value}
validator={$data[channel].validator.func}
suggestions={$data[channel].suggestions}
on:input={(e) => {
const { value, validationError } = e.detail;
data.updateRGBAChannelValue(action, value, validationError, channel);
sendData($data);
}}
on:change={() => dispatch("sync")}
postProcessor={GridScript.shortify}
preProcessor={GridScript.humanize}
/>
{/each}
</BlockRow>

{#if $appSettings.persistent.userLevelMinimalist == false}
<MeltCheckbox
Expand Down
Loading
Loading