Skip to content

The VS Code of video editing, built for agents.

TypeScript

Enhance paint type handling in SubItemLayer and FillItem components

konstantin-paulusf24a00719895
diff --git a/apps/web/src/assets/icons/html-small.svg b/apps/web/src/assets/icons/html-small.svg
new file mode 100644
index 00000000..2835b980
--- /dev/null
+++ b/apps/web/src/assets/icons/html-small.svg
@@ -0,0 +1,3 @@
+<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M16.5 6.5C17.0523 6.5 17.5 6.94772 17.5 7.5V16.5C17.5 17.0523 17.0523 17.5 16.5 17.5H7.5C6.94772 17.5 6.5 17.0523 6.5 16.5V7.5C6.5 6.94772 6.94772 6.5 7.5 6.5H16.5ZM7.5 16.5H16.5V7.5H7.5V16.5ZM10.4141 9.87891C10.6093 9.68364 10.9258 9.68364 11.1211 9.87891C11.3163 10.0742 11.3163 10.3907 11.1211 10.5859L9.70703 12L11.1211 13.4141C11.3164 13.6093 11.3164 13.9258 11.1211 14.1211C10.9258 14.3163 10.6093 14.3163 10.4141 14.1211L8.79395 12.501C8.51763 12.2244 8.51763 11.7756 8.79395 11.499L10.4141 9.87891ZM12.874 9.87891C13.0693 9.68366 13.3858 9.68369 13.5811 9.87891L15.2021 11.499C15.4785 11.7756 15.4785 12.2244 15.2021 12.501L13.5811 14.1211C13.3858 14.3164 13.0693 14.3164 12.874 14.1211C12.679 13.9258 12.6788 13.6092 12.874 13.4141L14.2881 12L12.874 10.5859C12.6789 10.3907 12.679 10.0742 12.874 9.87891Z" fill="currentColor" />
+</svg>
diff --git a/apps/web/src/components/timeline/layers/sub-item.tsx b/apps/web/src/components/timeline/layers/sub-item.tsx
index b9143726..2d9f685e 100644
--- a/apps/web/src/components/timeline/layers/sub-item.tsx
+++ b/apps/web/src/components/timeline/layers/sub-item.tsx
@@ -43,6 +43,8 @@ export function SubItemLayer(props: SubItemLayerProps) {
if (c.Paint[eid()] === PaintType.VIDEO) return 'Video';
if (c.Paint[eid()] === PaintType.SEQUENCE) return 'Sequence';
if (c.Paint[eid()] === PaintType.WAVEFORM) return 'Waveform';
+ if (c.Paint[eid()] === PaintType.HTML) return 'HTML';
+ if (c.Paint[eid()] === PaintType.SURFACE) return 'Surface';
return 'Fill';
}
if (hasComponent(world, eid(), c.ColorStop)) return 'Stop';
diff --git a/apps/web/src/components/ui/fill-item.tsx b/apps/web/src/components/ui/fill-item.tsx
index 3731b088..cc5e6168 100644
--- a/apps/web/src/components/ui/fill-item.tsx
+++ b/apps/web/src/components/ui/fill-item.tsx
@@ -4,6 +4,7 @@
import { createEffect, createMemo, createSignal, onCleanup, Show } from "solid-js";
import { AssetThumbnail } from "@/components/ui/asset-thumbnail";
+import { Icon } from "@/components/ui/icon";
import { Keyframe } from "@/components/ui/keyframe";
import { OpacitySwatch } from "@/components/ui/opacity-swatch";
import { useEngine } from "@/context/engine";
@@ -405,6 +406,12 @@ function PaintItemIcon(props: PaintItemIconProps) {
<Show when={color() !== undefined && type() === PaintType.SOLID}>
<OpacitySwatch color={color()!} opacity={opacity()} />
</Show>
+
+ <Show when={type() === PaintType.HTML || type() === PaintType.SURFACE}>
+ <div class="flex size-full items-center justify-center bg-muted text-muted-foreground">
+ <Icon name="html-small" />
+ </div>
+ </Show>
</>
);
}
@@ -428,6 +435,10 @@ function FillLabel(props: FillLabelProps) {
return "Linear";
} else if (type() === PaintType.RADIAL_GRADIENT) {
return "Radial";
+ } else if (type() === PaintType.HTML) {
+ return "HTML";
+ } else if (type() === PaintType.SURFACE) {
+ return "Surface";
} else {
const asset = assets.get(assetId() ?? "");
return asset?.name ?? "Unknown";