= null;
-
-const fullfilledPromise = Promise.resolve();
-
-export const isPolyfillRequired = typeof ViewTimeline === "undefined";
-
-const polyfill = () => {
- if (!isPolyfillRequired) {
- return fullfilledPromise;
- }
-
- if (clientPolyfillCache === null) {
- clientPolyfillCache = import(
- // @ts-expect-error no types exists
- // "scroll-timeline-polyfill/dist/scroll-timeline.js"
- "scroll-timeline-polyfill/src/index.js"
- );
- }
- return clientPolyfillCache;
-};
-
-export const PolyfillLoader = () => {
- use(polyfill());
- return undefined;
-};
diff --git a/packages/sdk-components-animation/src/shared/scroll.ts b/packages/sdk-components-animation/src/shared/scroll.ts
deleted file mode 100644
index b76ccd6fb3aa..000000000000
--- a/packages/sdk-components-animation/src/shared/scroll.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import {
- findClosestAncestor,
- getAnonymousSourceElement as originalGetAnonymousSourceElement,
-} from "./scroll-from-scroll-timeline";
-
-/**
- * Unlike CSS, this removes 'self' (since a component with a `` child can't use it).
- * We also add 'closest,' which CSS can handle with `scroll-timeline-name: --closest`.
- * Note: 'nearest' and 'closest' differ - 'nearest' finds the nearest containing block.
- * (See: https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block)
- */
-
-export const getSourceElement = (
- sourceType: "root" | "nearest" | "closest",
- node: Element
-) => {
- if (sourceType === "closest") {
- const closestAncestor = findClosestAncestor(node, (element) => {
- const style = getComputedStyle(element);
-
- const scrollStyles = ["auto", "scroll", "hidden"];
-
- return (
- scrollStyles.includes(style.overflowX) ||
- scrollStyles.includes(style.overflowY)
- );
- });
-
- if (
- closestAncestor === document.body &&
- document.scrollingElement !== null &&
- getComputedStyle(document.scrollingElement).overflow === "visible"
- ) {
- return document.scrollingElement;
- }
-
- return closestAncestor;
- }
-
- return originalGetAnonymousSourceElement(sourceType, node) ?? undefined;
-};
diff --git a/packages/sdk-components-animation/tsconfig.json b/packages/sdk-components-animation/tsconfig.json
index 183e232c490b..a7f8652f07c9 100644
--- a/packages/sdk-components-animation/tsconfig.json
+++ b/packages/sdk-components-animation/tsconfig.json
@@ -1,6 +1,11 @@
{
"extends": "@webstudio-is/tsconfig/base.json",
- "include": ["src", "../../@types/**/scroll-timeline.d.ts"],
+ "include": [
+ "src",
+ "../../@types/**/scroll-timeline.d.ts",
+ "private-src/scroll.stories.tsx",
+ "private-src/scroll.tsx"
+ ],
"compilerOptions": {
"types": ["react/experimental", "react-dom/experimental", "@types/node"]
}