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 @@ -20,10 +20,7 @@ import {
TreeSortableItem,
type TreeDropTarget,
} from "@webstudio-is/design-system";
import {
animationCanPlayOnCanvasAttribute,
showAttribute,
} from "@webstudio-is/react-sdk";
import { showAttribute } from "@webstudio-is/react-sdk";
import {
ROOT_INSTANCE_ID,
collectionComponent,
Expand All @@ -34,6 +31,7 @@ import {
type Instance,
type WsComponentMeta,
} from "@webstudio-is/sdk";
import { animationCanPlayOnCanvasProperty } from "@webstudio-is/sdk/runtime";
import {
EyeClosedIcon,
EyeOpenIcon,
Expand Down Expand Up @@ -675,7 +673,7 @@ export const NavigatorTree = () => {

// Hook memory prop
const isAnimationSelected =
propValues?.get(animationCanPlayOnCanvasAttribute) === true;
propValues?.get(animationCanPlayOnCanvasProperty) === true;

const props = propsByInstanceId.get(item.instance.id);
const actionProp = props?.find(
Expand Down
2 changes: 0 additions & 2 deletions packages/react-sdk/src/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ export const componentAttribute = "data-ws-component" as const;
export const showAttribute = "data-ws-show" as const;
export const collapsedAttribute = "data-ws-collapsed" as const;
export const textContentAttribute = "data-ws-text-content" as const;
export const animationCanPlayOnCanvasAttribute =
"data-ws-animation-can-play-on-canvas";

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-components-animation/private-src
12 changes: 5 additions & 7 deletions packages/sdk-components-animation/src/animate-children.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import {
animationCanPlayOnCanvasAttribute,
type Hook,
} from "@webstudio-is/react-sdk";
import type { AnimationAction } from "@webstudio-is/sdk";
import { forwardRef, type ElementRef } from "react";
import type { Hook } from "@webstudio-is/react-sdk";
import type { AnimationAction } from "@webstudio-is/sdk";
import { animationCanPlayOnCanvasProperty } from "@webstudio-is/sdk/runtime";

type ScrollProps = {
debug?: boolean;
Expand All @@ -30,7 +28,7 @@ export const hooksAnimateChildren: Hook = {
) {
context.setMemoryProp(
event.instancePath[0],
animationCanPlayOnCanvasAttribute,
animationCanPlayOnCanvasProperty,
undefined
);
}
Expand All @@ -42,7 +40,7 @@ export const hooksAnimateChildren: Hook = {
) {
context.setMemoryProp(
event.instancePath[0],
animationCanPlayOnCanvasAttribute,
animationCanPlayOnCanvasProperty,
true
);
}
Expand Down
5 changes: 4 additions & 1 deletion packages/sdk/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ export const getTagFromProps = (
return props[tagProperty] as string | undefined;
};

export const indexProperty = "data-ws-index" as const;
export const indexProperty = "data-ws-index";

export const getIndexWithinAncestorFromProps = (
props: Record<string, unknown>
) => {
return props[indexProperty] as string | undefined;
};

export const animationCanPlayOnCanvasProperty =
"data-ws-animation-can-play-on-canvas";