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
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
ToggleGroupButton,
Text,
Switch,
SmallToggleButton,
} from "@webstudio-is/design-system";
import { useIds } from "~/shared/form-utils";
import type { PropAndMeta } from "../use-props-logic";
Expand All @@ -25,7 +26,7 @@ import {
insetUnitValueSchema,
RANGE_UNITS,
} from "@webstudio-is/sdk";
import { RepeatColumnIcon, RepeatRowIcon } from "@webstudio-is/icons";
import { BugIcon, RepeatColumnIcon, RepeatRowIcon } from "@webstudio-is/icons";
import { AnimationsSelect } from "./animations-select";
import { SubjectSelect } from "./subject-select";
import { toValue, type StyleValue } from "@webstudio-is/css-engine";
Expand Down Expand Up @@ -200,15 +201,48 @@ export const AnimateSection = ({
<Separator />

<Grid
gap={1}
gap={2}
align={"center"}
css={{
gridTemplateColumns: "1fr auto",
gridTemplateColumns: "1fr auto auto",
padding: theme.panel.paddingInline,
}}
>
<Text variant={"titles"}>Animation</Text>

<Tooltip
content={
value.debug ? (
"Stop Debugging"
) : (
<Text>
Debug <small>(experimental)</small>
</Text>
)
}
>
<SmallToggleButton
css={
value.debug
? {
color: theme.colors.foregroundDestructive,
"&:hover": {
color: theme.colors.foregroundDestructive,
opacity: 0.8,
},
}
: undefined
}
pressed={value.debug ?? false}
onPressedChange={() => {
handleChange({ ...value, debug: !value.debug });
}}
variant="normal"
tabIndex={-1}
icon={<BugIcon />}
/>
</Tooltip>

<Tooltip content={value.isPinned ? "Unpin Animation" : "Pin Animation"}>
<Switch
checked={value.isPinned ?? false}
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-components-animation/private-src
2 changes: 2 additions & 0 deletions packages/sdk/src/schema/animation-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export const scrollActionSchema = z.object({
axis: animationAxisSchema.optional(),
animations: z.array(scrollAnimationSchema),
isPinned: z.boolean().optional(),
debug: z.boolean().optional(),
});

export const viewAnimationSchema = baseAnimation.merge(
Expand All @@ -191,6 +192,7 @@ export const viewActionSchema = z.object({
insetEnd: insetUnitValueSchema.optional(),

isPinned: z.boolean().optional(),
debug: z.boolean().optional(),
});

// Animation Action
Expand Down
Loading