+
+ {
+ const hexColor = `#${color}`;
+ if (color !== "transparent") {
+ lastSelectedColor.current = hexColor;
+ }
+ editor.timeline.previewElements({
+ updates: [
+ {
+ trackId,
+ elementId: element.id,
+ updates: {
+ background: { ...element.background, color: hexColor },
+ },
+ },
+ ],
+ });
+ }}
+ onChangeEnd={() => editor.timeline.commitPreview()}
+ className={
+ element.background.color === "transparent"
+ ? "pointer-events-none opacity-50"
+ : ""
+ }
+ />
+
+
+
+
+ editor.timeline.updateElements({
+ updates: [
+ {
+ trackId,
+ elementId: element.id,
+ updates: {
+ background: {
+ ...element.background,
+ paddingX: DEFAULT_TEXT_BACKGROUND.paddingX,
+ },
+ },
+ },
+ ],
+ })
+ }
+ isDefault={
+ (element.background.paddingX ?? DEFAULT_TEXT_BACKGROUND.paddingX) ===
+ DEFAULT_TEXT_BACKGROUND.paddingX
+ }
+ />
+
+
+
+ editor.timeline.updateElements({
+ updates: [
+ {
+ trackId,
+ elementId: element.id,
+ updates: {
+ background: {
+ ...element.background,
+ paddingY: DEFAULT_TEXT_BACKGROUND.paddingY,
+ },
+ },
+ },
+ ],
+ })
+ }
+ isDefault={
+ (element.background.paddingY ?? DEFAULT_TEXT_BACKGROUND.paddingY) ===
+ DEFAULT_TEXT_BACKGROUND.paddingY
+ }
+ />
+
+
+
+
+
+ editor.timeline.updateElements({
+ updates: [
+ {
+ trackId,
+ elementId: element.id,
+ updates: {
+ background: { ...element.background, offsetX: 0 },
+ },
+ },
+ ],
+ })
+ }
+ isDefault={(element.background.offsetX ?? 0) === 0}
+ />
+
+
+
+ editor.timeline.updateElements({
+ updates: [
+ {
+ trackId,
+ elementId: element.id,
+ updates: {
+ background: { ...element.background, offsetY: 0 },
+ },
+ },
+ ],
+ })
+ }
+ isDefault={(element.background.offsetY ?? 0) === 0}
+ />
+
+
+
+
+ editor.timeline.updateElements({
+ updates: [
+ {
+ trackId,
+ elementId: element.id,
+ updates: {
+ background: {
+ ...element.background,
+ cornerRadius: 0,
+ },
+ },
+ },
+ ],
+ })
+ }
+ isDefault={(element.background.cornerRadius ?? 0) === 0}
+ />
+
+