motion-dom 12.27.3-alpha.2 → 12.27.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,202 @@
1
+ import { HTMLProjectionNode } from '../projection/node/HTMLProjectionNode.mjs';
2
+ import { HTMLVisualElement } from '../render/html/HTMLVisualElement.mjs';
3
+ import { nodeGroup } from '../projection/node/group.mjs';
4
+ import { getLayoutId } from './get-layout-elements.mjs';
5
+ import { addScaleCorrector } from '../projection/styles/scale-correction.mjs';
6
+ import { correctBorderRadius } from '../projection/styles/scale-border-radius.mjs';
7
+ import { correctBoxShadow } from '../projection/styles/scale-box-shadow.mjs';
8
+
9
+ let scaleCorrectorAdded = false;
10
+ /**
11
+ * Track active projection nodes per element to handle animation interruption.
12
+ * When a new animation starts on an element that already has an active animation,
13
+ * we need to stop the old animation so the new one can start from the current
14
+ * visual position.
15
+ */
16
+ const activeProjectionNodes = new WeakMap();
17
+ function ensureScaleCorrectors() {
18
+ if (scaleCorrectorAdded)
19
+ return;
20
+ scaleCorrectorAdded = true;
21
+ addScaleCorrector({
22
+ borderRadius: {
23
+ ...correctBorderRadius,
24
+ applyTo: [
25
+ "borderTopLeftRadius",
26
+ "borderTopRightRadius",
27
+ "borderBottomLeftRadius",
28
+ "borderBottomRightRadius",
29
+ ],
30
+ },
31
+ borderTopLeftRadius: correctBorderRadius,
32
+ borderTopRightRadius: correctBorderRadius,
33
+ borderBottomLeftRadius: correctBorderRadius,
34
+ borderBottomRightRadius: correctBorderRadius,
35
+ boxShadow: correctBoxShadow,
36
+ });
37
+ }
38
+ /**
39
+ * Get DOM depth of an element
40
+ */
41
+ function getDepth(element) {
42
+ let depth = 0;
43
+ let current = element.parentElement;
44
+ while (current) {
45
+ depth++;
46
+ current = current.parentElement;
47
+ }
48
+ return depth;
49
+ }
50
+ /**
51
+ * Find the closest projection parent for an element
52
+ */
53
+ function findProjectionParent(element, nodeCache) {
54
+ let parent = element.parentElement;
55
+ while (parent) {
56
+ const node = nodeCache.get(parent);
57
+ if (node)
58
+ return node;
59
+ parent = parent.parentElement;
60
+ }
61
+ return undefined;
62
+ }
63
+ /**
64
+ * Create or reuse a projection node for an element
65
+ */
66
+ function createProjectionNode(element, parent, options, transition) {
67
+ // Check for existing active node - reuse it to preserve animation state
68
+ const existingNode = activeProjectionNodes.get(element);
69
+ if (existingNode) {
70
+ const visualElement = existingNode.options.visualElement;
71
+ // Update transition options for the new animation
72
+ const nodeTransition = transition
73
+ ? { duration: transition.duration, ease: transition.ease }
74
+ : { duration: 0.3, ease: "easeOut" };
75
+ existingNode.setOptions({
76
+ ...existingNode.options,
77
+ animate: true,
78
+ transition: nodeTransition,
79
+ ...options,
80
+ });
81
+ // Re-mount the node if it was previously unmounted
82
+ // This re-adds it to root.nodes so didUpdate() will process it
83
+ if (!existingNode.instance) {
84
+ existingNode.mount(element);
85
+ }
86
+ return { node: existingNode, visualElement };
87
+ }
88
+ // No existing node - create a new one
89
+ const latestValues = {};
90
+ const visualElement = new HTMLVisualElement({
91
+ visualState: {
92
+ latestValues,
93
+ renderState: {
94
+ transformOrigin: {},
95
+ transform: {},
96
+ style: {},
97
+ vars: {},
98
+ },
99
+ },
100
+ presenceContext: null,
101
+ props: {},
102
+ });
103
+ const node = new HTMLProjectionNode(latestValues, parent);
104
+ // Convert AnimationOptions to transition format for the projection system
105
+ const nodeTransition = transition
106
+ ? { duration: transition.duration, ease: transition.ease }
107
+ : { duration: 0.3, ease: "easeOut" };
108
+ node.setOptions({
109
+ visualElement,
110
+ layout: true,
111
+ animate: true,
112
+ transition: nodeTransition,
113
+ ...options,
114
+ });
115
+ node.mount(element);
116
+ visualElement.projection = node;
117
+ // Track this node as the active one for this element
118
+ activeProjectionNodes.set(element, node);
119
+ return { node, visualElement };
120
+ }
121
+ /**
122
+ * Build a projection tree from a list of elements
123
+ */
124
+ function buildProjectionTree(elements, existingContext, options) {
125
+ ensureScaleCorrectors();
126
+ const nodes = existingContext?.nodes ?? new Map();
127
+ const visualElements = existingContext?.visualElements ?? new Map();
128
+ const group = existingContext?.group ?? nodeGroup();
129
+ const defaultTransition = options?.defaultTransition;
130
+ const sharedTransitions = options?.sharedTransitions;
131
+ // Sort elements by DOM depth (parents before children)
132
+ const sorted = [...elements].sort((a, b) => getDepth(a) - getDepth(b));
133
+ let root = existingContext?.root;
134
+ for (const element of sorted) {
135
+ // Skip if already has a node
136
+ if (nodes.has(element))
137
+ continue;
138
+ const parent = findProjectionParent(element, nodes);
139
+ const layoutId = getLayoutId(element);
140
+ const layoutMode = element.getAttribute("data-layout");
141
+ const nodeOptions = {
142
+ layoutId: layoutId ?? undefined,
143
+ animationType: parseLayoutMode(layoutMode),
144
+ };
145
+ // Use layoutId-specific transition if available, otherwise use default
146
+ const transition = layoutId && sharedTransitions?.get(layoutId)
147
+ ? sharedTransitions.get(layoutId)
148
+ : defaultTransition;
149
+ const { node, visualElement } = createProjectionNode(element, parent, nodeOptions, transition);
150
+ nodes.set(element, node);
151
+ visualElements.set(element, visualElement);
152
+ group.add(node);
153
+ if (!root) {
154
+ root = node.root;
155
+ }
156
+ }
157
+ return {
158
+ nodes,
159
+ visualElements,
160
+ group,
161
+ root: root,
162
+ };
163
+ }
164
+ /**
165
+ * Parse the data-layout attribute value
166
+ */
167
+ function parseLayoutMode(value) {
168
+ if (value === "position")
169
+ return "position";
170
+ if (value === "size")
171
+ return "size";
172
+ if (value === "preserve-aspect")
173
+ return "preserve-aspect";
174
+ return "both";
175
+ }
176
+ /**
177
+ * Clean up projection nodes for specific elements.
178
+ * If elementsToCleanup is provided, only those elements are cleaned up.
179
+ * If not provided, all nodes are cleaned up.
180
+ *
181
+ * This allows persisting elements to keep their nodes between animations,
182
+ * matching React's behavior where nodes persist for elements that remain in the DOM.
183
+ */
184
+ function cleanupProjectionTree(context, elementsToCleanup) {
185
+ const elementsToProcess = elementsToCleanup
186
+ ? [...context.nodes.entries()].filter(([el]) => elementsToCleanup.has(el))
187
+ : [...context.nodes.entries()];
188
+ for (const [element, node] of elementsToProcess) {
189
+ context.group.remove(node);
190
+ node.unmount();
191
+ // Only clear from activeProjectionNodes if this is still the active node.
192
+ // A newer animation might have already taken over.
193
+ if (activeProjectionNodes.get(element) === node) {
194
+ activeProjectionNodes.delete(element);
195
+ }
196
+ context.nodes.delete(element);
197
+ context.visualElements.delete(element);
198
+ }
199
+ }
200
+
201
+ export { buildProjectionTree, cleanupProjectionTree };
202
+ //# sourceMappingURL=projection-tree.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projection-tree.mjs","sources":["../../../src/layout/projection-tree.ts"],"sourcesContent":["import type { AnimationOptions } from \"../animation/types\"\nimport type {\n IProjectionNode,\n ProjectionNodeOptions,\n} from \"../projection/node/types\"\nimport { HTMLProjectionNode } from \"../projection/node/HTMLProjectionNode\"\nimport { HTMLVisualElement } from \"../render/html/HTMLVisualElement\"\nimport { nodeGroup, type NodeGroup } from \"../projection/node/group\"\nimport { getLayoutId } from \"./get-layout-elements\"\nimport { addScaleCorrector } from \"../render/utils/is-forced-motion-value\"\nimport { correctBorderRadius } from \"../projection/styles/scale-border-radius\"\nimport { correctBoxShadow } from \"../projection/styles/scale-box-shadow\"\n\nlet scaleCorrectorAdded = false\n\n/**\n * Track active projection nodes per element to handle animation interruption.\n * When a new animation starts on an element that already has an active animation,\n * we need to stop the old animation so the new one can start from the current\n * visual position.\n */\nconst activeProjectionNodes = new WeakMap<HTMLElement, IProjectionNode>()\n\nfunction ensureScaleCorrectors() {\n if (scaleCorrectorAdded) return\n scaleCorrectorAdded = true\n\n addScaleCorrector({\n borderRadius: {\n ...correctBorderRadius,\n applyTo: [\n \"borderTopLeftRadius\",\n \"borderTopRightRadius\",\n \"borderBottomLeftRadius\",\n \"borderBottomRightRadius\",\n ],\n },\n borderTopLeftRadius: correctBorderRadius,\n borderTopRightRadius: correctBorderRadius,\n borderBottomLeftRadius: correctBorderRadius,\n borderBottomRightRadius: correctBorderRadius,\n boxShadow: correctBoxShadow,\n })\n}\n\nexport interface ProjectionContext {\n nodes: Map<HTMLElement, IProjectionNode>\n visualElements: Map<HTMLElement, HTMLVisualElement>\n group: NodeGroup\n root: IProjectionNode\n}\n\n/**\n * Get DOM depth of an element\n */\nfunction getDepth(element: Element): number {\n let depth = 0\n let current = element.parentElement\n while (current) {\n depth++\n current = current.parentElement\n }\n return depth\n}\n\n/**\n * Find the closest projection parent for an element\n */\nfunction findProjectionParent(\n element: HTMLElement,\n nodeCache: Map<HTMLElement, IProjectionNode>\n): IProjectionNode | undefined {\n let parent = element.parentElement as HTMLElement | null\n while (parent) {\n const node = nodeCache.get(parent)\n if (node) return node\n parent = parent.parentElement as HTMLElement | null\n }\n return undefined\n}\n\n/**\n * Create or reuse a projection node for an element\n */\nfunction createProjectionNode(\n element: HTMLElement,\n parent: IProjectionNode | undefined,\n options: ProjectionNodeOptions,\n transition?: AnimationOptions\n): { node: IProjectionNode; visualElement: HTMLVisualElement } {\n // Check for existing active node - reuse it to preserve animation state\n const existingNode = activeProjectionNodes.get(element)\n if (existingNode) {\n const visualElement = existingNode.options.visualElement as HTMLVisualElement\n\n // Update transition options for the new animation\n const nodeTransition = transition\n ? { duration: transition.duration, ease: transition.ease as any }\n : { duration: 0.3, ease: \"easeOut\" }\n\n existingNode.setOptions({\n ...existingNode.options,\n animate: true,\n transition: nodeTransition,\n ...options,\n })\n\n // Re-mount the node if it was previously unmounted\n // This re-adds it to root.nodes so didUpdate() will process it\n if (!existingNode.instance) {\n existingNode.mount(element)\n }\n\n return { node: existingNode, visualElement }\n }\n\n // No existing node - create a new one\n const latestValues: Record<string, any> = {}\n\n const visualElement = new HTMLVisualElement({\n visualState: {\n latestValues,\n renderState: {\n transformOrigin: {},\n transform: {},\n style: {},\n vars: {},\n },\n },\n presenceContext: null,\n props: {},\n })\n\n const node = new HTMLProjectionNode(latestValues, parent)\n\n // Convert AnimationOptions to transition format for the projection system\n const nodeTransition = transition\n ? { duration: transition.duration, ease: transition.ease as any }\n : { duration: 0.3, ease: \"easeOut\" }\n\n node.setOptions({\n visualElement,\n layout: true,\n animate: true,\n transition: nodeTransition,\n ...options,\n })\n\n node.mount(element)\n visualElement.projection = node\n\n // Track this node as the active one for this element\n activeProjectionNodes.set(element, node)\n\n return { node, visualElement }\n}\n\nexport interface BuildProjectionTreeOptions {\n defaultTransition?: AnimationOptions\n sharedTransitions?: Map<string, AnimationOptions>\n}\n\n/**\n * Build a projection tree from a list of elements\n */\nexport function buildProjectionTree(\n elements: HTMLElement[],\n existingContext?: ProjectionContext,\n options?: BuildProjectionTreeOptions\n): ProjectionContext {\n ensureScaleCorrectors()\n\n const nodes = existingContext?.nodes ?? new Map<HTMLElement, IProjectionNode>()\n const visualElements =\n existingContext?.visualElements ?? new Map<HTMLElement, HTMLVisualElement>()\n const group = existingContext?.group ?? nodeGroup()\n\n const defaultTransition = options?.defaultTransition\n const sharedTransitions = options?.sharedTransitions\n\n // Sort elements by DOM depth (parents before children)\n const sorted = [...elements].sort((a, b) => getDepth(a) - getDepth(b))\n\n let root: IProjectionNode | undefined = existingContext?.root\n\n for (const element of sorted) {\n // Skip if already has a node\n if (nodes.has(element)) continue\n\n const parent = findProjectionParent(element, nodes)\n const layoutId = getLayoutId(element)\n const layoutMode = element.getAttribute(\"data-layout\")\n\n const nodeOptions: ProjectionNodeOptions = {\n layoutId: layoutId ?? undefined,\n animationType: parseLayoutMode(layoutMode),\n }\n\n // Use layoutId-specific transition if available, otherwise use default\n const transition = layoutId && sharedTransitions?.get(layoutId)\n ? sharedTransitions.get(layoutId)\n : defaultTransition\n\n const { node, visualElement } = createProjectionNode(\n element,\n parent,\n nodeOptions,\n transition\n )\n\n nodes.set(element, node)\n visualElements.set(element, visualElement)\n group.add(node)\n\n if (!root) {\n root = node.root\n }\n }\n\n return {\n nodes,\n visualElements,\n group,\n root: root!,\n }\n}\n\n/**\n * Parse the data-layout attribute value\n */\nfunction parseLayoutMode(\n value: string | null\n): \"size\" | \"position\" | \"both\" | \"preserve-aspect\" {\n if (value === \"position\") return \"position\"\n if (value === \"size\") return \"size\"\n if (value === \"preserve-aspect\") return \"preserve-aspect\"\n return \"both\"\n}\n\n/**\n * Clean up projection nodes for specific elements.\n * If elementsToCleanup is provided, only those elements are cleaned up.\n * If not provided, all nodes are cleaned up.\n *\n * This allows persisting elements to keep their nodes between animations,\n * matching React's behavior where nodes persist for elements that remain in the DOM.\n */\nexport function cleanupProjectionTree(\n context: ProjectionContext,\n elementsToCleanup?: Set<HTMLElement>\n) {\n const elementsToProcess = elementsToCleanup\n ? [...context.nodes.entries()].filter(([el]) => elementsToCleanup.has(el))\n : [...context.nodes.entries()]\n\n for (const [element, node] of elementsToProcess) {\n context.group.remove(node)\n node.unmount()\n\n // Only clear from activeProjectionNodes if this is still the active node.\n // A newer animation might have already taken over.\n if (activeProjectionNodes.get(element) === node) {\n activeProjectionNodes.delete(element)\n }\n\n context.nodes.delete(element)\n context.visualElements.delete(element)\n }\n}\n\n/**\n * Set a value on a projection node's visual element\n */\nexport function setNodeValue(\n context: ProjectionContext,\n element: HTMLElement,\n key: string,\n value: any\n) {\n const visualElement = context.visualElements.get(element)\n if (visualElement) {\n visualElement.latestValues[key] = value\n visualElement.scheduleRender()\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAaA,IAAI,mBAAmB,GAAG,KAAK,CAAA;AAE/B;;;;;AAKG;AACH,MAAM,qBAAqB,GAAG,IAAI,OAAO,EAAgC,CAAA;AAEzE,SAAS,qBAAqB,GAAA;AAC1B,IAAA,IAAI,mBAAmB;QAAE,OAAM;IAC/B,mBAAmB,GAAG,IAAI,CAAA;AAE1B,IAAA,iBAAiB,CAAC;AACd,QAAA,YAAY,EAAE;AACV,YAAA,GAAG,mBAAmB;AACtB,YAAA,OAAO,EAAE;gBACL,qBAAqB;gBACrB,sBAAsB;gBACtB,wBAAwB;gBACxB,yBAAyB;AAC5B,aAAA;AACJ,SAAA;AACD,QAAA,mBAAmB,EAAE,mBAAmB;AACxC,QAAA,oBAAoB,EAAE,mB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G,CAAC,EAAE,CAAC,CAAC;UACxE,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;IAElC,KAAK,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,iBAAiB,EAAE;AAC7C,QAAA,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAC1B,IAAI,CAAC,OAAO,EAAE,CAAA;;;QAId,IAAI,qBAAqB,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE;AAC7C,YAAA,qBAAqB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;SACxC;AAED,QAAA,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AAC7B,QAAA,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;KACzC;AACL;;;;"}
@@ -1,30 +1,30 @@
1
- import { SubscriptionManager, clamp, noop } from 'motion-utils';
2
- import { animateSingleValue } from '../../animation/animate/single-value.mjs';
3
- import { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs';
1
+ import { activeAnimations } from '../../stats/animation-count.mjs';
4
2
  import { getValueTransition } from '../../animation/utils/get-value-transition.mjs';
5
3
  import { microtask } from '../../frameloop/microtask.mjs';
6
4
  import { time } from '../../frameloop/sync-time.mjs';
7
- import { scaleCorrectors } from '../styles/scale-correction.mjs';
8
- import { activeAnimations } from '../../stats/animation-count.mjs';
9
- import { statsBuffer } from '../../stats/buffer.mjs';
10
- import { delay } from '../../utils/delay.mjs';
11
- import { isSVGElement } from '../../utils/is-svg-element.mjs';
12
- import { isSVGSVGElement } from '../../utils/is-svg-svg-element.mjs';
13
- import { mixNumber } from '../../utils/mix/number.mjs';
14
- import { motionValue } from '../../value/index.mjs';
15
- import { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';
16
- import { mixValues } from '../animation/mix-values.mjs';
17
- import { copyBoxInto, copyAxisDeltaInto } from '../geometry/copy.mjs';
18
5
  import { translateAxis, transformBox, applyBoxDelta, applyTreeDeltas } from '../geometry/delta-apply.mjs';
19
6
  import { calcLength, calcRelativeBox, calcRelativePosition, calcBoxDelta, isNear } from '../geometry/delta-calc.mjs';
20
7
  import { removeBoxTransforms } from '../geometry/delta-remove.mjs';
8
+ import { copyBoxInto, copyAxisDeltaInto } from '../geometry/copy.mjs';
21
9
  import { createBox, createDelta } from '../geometry/models.mjs';
22
10
  import { boxEqualsRounded, isDeltaZero, axisDeltaEquals, aspectRatio, boxEquals } from '../geometry/utils.mjs';
23
- import { NodeStack } from '../shared/stack.mjs';
24
11
  import { buildProjectionTransform } from '../styles/transform.mjs';
25
12
  import { eachAxis } from '../utils/each-axis.mjs';
26
- import { FlatTree } from '../utils/flat-tree.mjs';
27
13
  import { hasTransform, hasScale, has2DTranslate } from '../utils/has-transform.mjs';
14
+ import { mixValues } from '../animation/mix-values.mjs';
15
+ import { isSVGElement } from '../../utils/is-svg-element.mjs';
16
+ import { isSVGSVGElement } from '../../utils/is-svg-svg-element.mjs';
17
+ import { mixNumber } from '../../utils/mix/number.mjs';
18
+ import { motionValue } from '../../value/index.mjs';
19
+ import { scaleCorrectors } from '../styles/scale-correction.mjs';
20
+ import { statsBuffer } from '../../stats/buffer.mjs';
21
+ import { SubscriptionManager, clamp, noop } from 'motion-utils';
22
+ import { animateSingleValue } from '../../animation/animate/single-value.mjs';
23
+ import { getOptimisedAppearId } from '../../animation/optimized-appear/get-appear-id.mjs';
24
+ import { FlatTree } from '../utils/flat-tree.mjs';
25
+ import { delay } from '../../utils/delay.mjs';
26
+ import { resolveMotionValue } from '../../value/utils/resolve-motion-value.mjs';
27
+ import { NodeStack } from '../shared/stack.mjs';
28
28
  import { globalProjectionState } from './state.mjs';
29
29
  import { frame, cancelFrame, frameData, frameSteps } from '../../frameloop/frame.mjs';
30
30