@lynx-js/luna-stage 0.0.0-oidc-bootstrap.0 → 0.1.0

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.
Files changed (140) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +415 -5
  3. package/dist/components/context/create-context.d.ts +55 -0
  4. package/dist/components/context/create-context.d.ts.map +1 -0
  5. package/dist/components/context/create-context.js +32 -0
  6. package/dist/components/context/create-context.js.map +1 -0
  7. package/dist/components/context/index.d.ts +2 -0
  8. package/dist/components/context/index.d.ts.map +1 -0
  9. package/dist/components/context/index.js +1 -0
  10. package/dist/components/stage/index.d.ts +2 -0
  11. package/dist/components/stage/index.d.ts.map +1 -0
  12. package/dist/components/stage/index.js +1 -0
  13. package/dist/components/stage/stage.d.ts +10 -0
  14. package/dist/components/stage/stage.d.ts.map +1 -0
  15. package/dist/components/stage/stage.js +185 -0
  16. package/dist/components/stage/stage.js.map +1 -0
  17. package/dist/constants/stage.d.ts +4 -0
  18. package/dist/constants/stage.d.ts.map +1 -0
  19. package/dist/constants/stage.js +6 -0
  20. package/dist/constants/stage.js.map +1 -0
  21. package/dist/hooks/index.d.ts +6 -0
  22. package/dist/hooks/index.d.ts.map +1 -0
  23. package/dist/hooks/index.js +5 -0
  24. package/dist/hooks/use-container-resize.d.ts +30 -0
  25. package/dist/hooks/use-container-resize.d.ts.map +1 -0
  26. package/dist/hooks/use-container-resize.js +63 -0
  27. package/dist/hooks/use-container-resize.js.map +1 -0
  28. package/dist/hooks/use-event-callback.d.ts +36 -0
  29. package/dist/hooks/use-event-callback.d.ts.map +1 -0
  30. package/dist/hooks/use-event-callback.js +18 -0
  31. package/dist/hooks/use-event-callback.js.map +1 -0
  32. package/dist/hooks/use-is-client.d.ts +2 -0
  33. package/dist/hooks/use-is-client.d.ts.map +1 -0
  34. package/dist/hooks/use-is-client.js +16 -0
  35. package/dist/hooks/use-is-client.js.map +1 -0
  36. package/dist/hooks/use-isomorphic-layout-effect.d.ts +4 -0
  37. package/dist/hooks/use-isomorphic-layout-effect.d.ts.map +1 -0
  38. package/dist/hooks/use-isomorphic-layout-effect.js +6 -0
  39. package/dist/hooks/use-isomorphic-layout-effect.js.map +1 -0
  40. package/dist/hooks/use-merged-refs.d.ts +5 -0
  41. package/dist/hooks/use-merged-refs.d.ts.map +1 -0
  42. package/dist/hooks/use-merged-refs.js +18 -0
  43. package/dist/hooks/use-merged-refs.js.map +1 -0
  44. package/dist/hooks/use-raf-clock.d.ts +17 -0
  45. package/dist/hooks/use-raf-clock.d.ts.map +1 -0
  46. package/dist/hooks/use-raf-clock.js +22 -0
  47. package/dist/hooks/use-raf-clock.js.map +1 -0
  48. package/dist/index.d.ts +4 -0
  49. package/dist/index.d.ts.map +1 -0
  50. package/dist/index.js +2 -0
  51. package/dist/lynx/index.d.ts +7 -0
  52. package/dist/lynx/index.d.ts.map +1 -0
  53. package/dist/lynx/index.js +3 -0
  54. package/dist/lynx/luna-lynx-stage.d.ts +32 -0
  55. package/dist/lynx/luna-lynx-stage.d.ts.map +1 -0
  56. package/dist/lynx/luna-lynx-stage.js +45 -0
  57. package/dist/lynx/luna-lynx-stage.js.map +1 -0
  58. package/dist/lynx/lynx-stage-constants.d.ts +8 -0
  59. package/dist/lynx/lynx-stage-constants.d.ts.map +1 -0
  60. package/dist/lynx/lynx-stage-constants.js +26 -0
  61. package/dist/lynx/lynx-stage-constants.js.map +1 -0
  62. package/dist/lynx/lynx-stage.d.ts +25 -0
  63. package/dist/lynx/lynx-stage.d.ts.map +1 -0
  64. package/dist/lynx/lynx-stage.js +33 -0
  65. package/dist/lynx/lynx-stage.js.map +1 -0
  66. package/dist/lynx/types.d.ts +77 -0
  67. package/dist/lynx/types.d.ts.map +1 -0
  68. package/dist/lynx/types.js +0 -0
  69. package/dist/lynx/use-lynx-stage.d.ts +5 -0
  70. package/dist/lynx/use-lynx-stage.d.ts.map +1 -0
  71. package/dist/lynx/use-lynx-stage.js +130 -0
  72. package/dist/lynx/use-lynx-stage.js.map +1 -0
  73. package/dist/motion/context/index.d.ts +6 -0
  74. package/dist/motion/context/index.d.ts.map +1 -0
  75. package/dist/motion/context/index.js +3 -0
  76. package/dist/motion/context/use-visual-size.d.ts +8 -0
  77. package/dist/motion/context/use-visual-size.d.ts.map +1 -0
  78. package/dist/motion/context/use-visual-size.js +8 -0
  79. package/dist/motion/context/use-visual-size.js.map +1 -0
  80. package/dist/motion/context/visual-size-context.d.ts +10 -0
  81. package/dist/motion/context/visual-size-context.d.ts.map +1 -0
  82. package/dist/motion/context/visual-size-context.js +5 -0
  83. package/dist/motion/context/visual-size-context.js.map +1 -0
  84. package/dist/motion/context/visual-size-provider.d.ts +9 -0
  85. package/dist/motion/context/visual-size-provider.d.ts.map +1 -0
  86. package/dist/motion/context/visual-size-provider.js +19 -0
  87. package/dist/motion/context/visual-size-provider.js.map +1 -0
  88. package/dist/motion/index.d.ts +5 -0
  89. package/dist/motion/index.d.ts.map +1 -0
  90. package/dist/motion/index.js +2 -0
  91. package/dist/motion/stage/container-motion.d.ts +25 -0
  92. package/dist/motion/stage/container-motion.d.ts.map +1 -0
  93. package/dist/motion/stage/container-motion.js +111 -0
  94. package/dist/motion/stage/container-motion.js.map +1 -0
  95. package/dist/motion/stage/index.d.ts +5 -0
  96. package/dist/motion/stage/index.d.ts.map +1 -0
  97. package/dist/motion/stage/index.js +3 -0
  98. package/dist/motion/stage/presentation-motion.d.ts +17 -0
  99. package/dist/motion/stage/presentation-motion.d.ts.map +1 -0
  100. package/dist/motion/stage/presentation-motion.js +33 -0
  101. package/dist/motion/stage/presentation-motion.js.map +1 -0
  102. package/dist/motion/stage/stage-motion.d.ts +5 -0
  103. package/dist/motion/stage/stage-motion.d.ts.map +1 -0
  104. package/dist/motion/stage/stage-motion.js +184 -0
  105. package/dist/motion/stage/stage-motion.js.map +1 -0
  106. package/dist/motion/stage/transform-utils.d.ts +9 -0
  107. package/dist/motion/stage/transform-utils.d.ts.map +1 -0
  108. package/dist/motion/stage/transform-utils.js +20 -0
  109. package/dist/motion/stage/transform-utils.js.map +1 -0
  110. package/dist/motion/stage/types.d.ts +85 -0
  111. package/dist/motion/stage/types.d.ts.map +1 -0
  112. package/dist/motion/stage/types.js +0 -0
  113. package/dist/motion/stage/use-container-resize-mv.d.ts +13 -0
  114. package/dist/motion/stage/use-container-resize-mv.d.ts.map +1 -0
  115. package/dist/motion/stage/use-container-resize-mv.js +64 -0
  116. package/dist/motion/stage/use-container-resize-mv.js.map +1 -0
  117. package/dist/types/align.d.ts +3 -0
  118. package/dist/types/align.d.ts.map +1 -0
  119. package/dist/types/align.js +0 -0
  120. package/dist/types/index.d.ts +3 -0
  121. package/dist/types/index.d.ts.map +1 -0
  122. package/dist/types/index.js +0 -0
  123. package/dist/types/lynx-view.d.ts +18 -0
  124. package/dist/types/lynx-view.d.ts.map +1 -0
  125. package/dist/types/lynx-view.js +0 -0
  126. package/dist/types/stage-props.d.ts +94 -0
  127. package/dist/types/stage-props.d.ts.map +1 -0
  128. package/dist/types/stage-props.js +0 -0
  129. package/dist/utils/align.d.ts +3 -0
  130. package/dist/utils/align.d.ts.map +1 -0
  131. package/dist/utils/align.js +15 -0
  132. package/dist/utils/align.js.map +1 -0
  133. package/dist/utils/index.d.ts +3 -0
  134. package/dist/utils/index.d.ts.map +1 -0
  135. package/dist/utils/index.js +2 -0
  136. package/dist/utils/transform.d.ts +121 -0
  137. package/dist/utils/transform.d.ts.map +1 -0
  138. package/dist/utils/transform.js +37 -0
  139. package/dist/utils/transform.js.map +1 -0
  140. package/package.json +73 -5
@@ -0,0 +1,111 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useMotionValue, useTransform } from "motion/react";
3
+ import { forwardRef, useRef } from "react";
4
+ import { getLastScaleFromTransform } from "./transform-utils.js";
5
+ import { useContainerResizeMV } from "./use-container-resize-mv.js";
6
+ import { useMergedRefs } from "../../hooks/use-merged-refs.js";
7
+ import { VisualSizeProvider } from "../context/visual-size-provider.js";
8
+ import * as __rspack_external_motion_react_client_3c058d48 from "motion/react-client";
9
+ const CONTAINER_LOCKED_STYLE = {
10
+ display: 'flex',
11
+ justifyContent: 'center',
12
+ alignItems: 'center',
13
+ overflow: 'hidden'
14
+ };
15
+ const ANCHOR_LOCKED_STYLE = {
16
+ position: 'relative',
17
+ width: 4,
18
+ height: 4,
19
+ display: 'flex',
20
+ justifyContent: 'center',
21
+ alignItems: 'center',
22
+ overflow: 'visible'
23
+ };
24
+ const MotionStageContainer = /*#__PURE__*/ forwardRef(MotionStageContainerImpl);
25
+ function MotionStageContainerImpl(props, ref) {
26
+ const { children, className, layoutId, style, onLayoutMeasure, onLayoutAnimationStart, onLayoutAnimationComplete, ...restProps } = props;
27
+ const containerRef = useRef(null);
28
+ const { width: layoutW, height: layoutH } = useContainerResizeMV(containerRef);
29
+ const mergedRef = useMergedRefs(containerRef, ref);
30
+ const animLayoutW = useMotionValue(layoutW.get());
31
+ const animLayoutH = useMotionValue(layoutH.get());
32
+ const isAnimating = useMotionValue(0);
33
+ const scaleX = useMotionValue(1);
34
+ const scaleY = useMotionValue(1);
35
+ const visualW = useTransform(()=>(isAnimating.get() ? animLayoutW.get() : layoutW.get()) * scaleX.get());
36
+ const visualH = useTransform(()=>(isAnimating.get() ? animLayoutH.get() : layoutH.get()) * scaleY.get());
37
+ const handleParentTransform = (_latest, generated)=>{
38
+ if (generated && 'none' !== generated) {
39
+ const s = getLastScaleFromTransform(generated);
40
+ if (s) {
41
+ scaleX.set(s.x);
42
+ scaleY.set(s.y);
43
+ } else {
44
+ scaleX.set(1);
45
+ scaleY.set(1);
46
+ }
47
+ } else {
48
+ scaleX.set(1);
49
+ scaleY.set(1);
50
+ }
51
+ return generated;
52
+ };
53
+ const handleLayoutMeasure = (...args)=>{
54
+ const [box] = args;
55
+ try {
56
+ onLayoutMeasure?.(...args);
57
+ } finally{
58
+ animLayoutW.set(box.x.max - box.x.min);
59
+ animLayoutH.set(box.y.max - box.y.min);
60
+ }
61
+ };
62
+ const handleLayoutAnimationStart = (...args)=>{
63
+ try {
64
+ onLayoutAnimationStart?.(...args);
65
+ } finally{
66
+ isAnimating.set(1);
67
+ }
68
+ };
69
+ const handleLayoutAnimationComplete = (...args)=>{
70
+ try {
71
+ onLayoutAnimationComplete?.(...args);
72
+ } finally{
73
+ isAnimating.set(0);
74
+ animLayoutW.set(layoutW.get());
75
+ animLayoutH.set(layoutH.get());
76
+ scaleX.set(1);
77
+ scaleY.set(1);
78
+ }
79
+ };
80
+ const mergedContainerStyle = void 0 === style ? CONTAINER_LOCKED_STYLE : {
81
+ ...style,
82
+ ...CONTAINER_LOCKED_STYLE
83
+ };
84
+ return /*#__PURE__*/ jsx(__rspack_external_motion_react_client_3c058d48.div, {
85
+ ...restProps,
86
+ layout: true,
87
+ layoutId: `_${layoutId}_parent`,
88
+ layoutCrossfade: false,
89
+ ref: mergedRef,
90
+ onLayoutMeasure: handleLayoutMeasure,
91
+ onLayoutAnimationStart: handleLayoutAnimationStart,
92
+ onLayoutAnimationComplete: handleLayoutAnimationComplete,
93
+ transformTemplate: handleParentTransform,
94
+ className: className,
95
+ style: mergedContainerStyle,
96
+ children: /*#__PURE__*/ jsx(__rspack_external_motion_react_client_3c058d48.div, {
97
+ layout: true,
98
+ layoutId: `_${layoutId}_child`,
99
+ layoutCrossfade: false,
100
+ style: ANCHOR_LOCKED_STYLE,
101
+ children: /*#__PURE__*/ jsx(VisualSizeProvider, {
102
+ visualH: visualH,
103
+ visualW: visualW,
104
+ children: children
105
+ })
106
+ })
107
+ });
108
+ }
109
+ export { MotionStageContainer };
110
+
111
+ //# sourceMappingURL=container-motion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion/stage/container-motion.js","sources":["../../../src/motion/stage/container-motion.tsx"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nimport { useMotionValue, useTransform } from 'motion/react'\nimport type { MotionStyle, TransformTemplate } from 'motion/react'\nimport * as motion from 'motion/react-client'\nimport { forwardRef, useRef } from 'react'\nimport type {\n ForwardRefExoticComponent,\n ForwardedRef,\n RefAttributes,\n} from 'react'\n\nimport { getLastScaleFromTransform } from './transform-utils'\nimport type { MotionStageContainerProps } from './types'\nimport { useContainerResizeMV } from './use-container-resize-mv'\nimport { useMergedRefs } from '../../hooks/use-merged-refs'\nimport { VisualSizeProvider } from '../context/visual-size-provider'\n\nconst CONTAINER_LOCKED_STYLE: MotionStyle = {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n overflow: 'hidden',\n}\n\nconst ANCHOR_LOCKED_STYLE: MotionStyle = {\n position: 'relative',\n width: 4,\n height: 4,\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n overflow: 'visible',\n}\n\n/**\n * Layout-animation container that neutralizes Motion's scale side effects.\n *\n * Framer Motion uses `transform: scale(...)` for layout animations to avoid\n * reflow. This scales descendants as well, distorting their coordinate space.\n *\n * We use a two-layer structure:\n * - outer: participates in layout animation (may be scaled)\n * - inner: stable anchor for children\n *\n * Instead of applying inverse transforms, we extract the scale and reconstruct\n * the \"visual size\" (layout × scale), exposing it via context so children render\n * against stable dimensions.\n *\n * Note:\n * This component is typically used inside `AnimatePresence mode=\"popLayout\"`,\n * so it must forward its ref to the underlying DOM node, as `popLayout` needs\n * that DOM node to measure the element's position and then temporarily take\n * the exiting node out of normal layout flow while siblings reflow.\n */\nconst MotionStageContainer: ForwardRefExoticComponent<\n MotionStageContainerProps & RefAttributes<HTMLDivElement>\n> = forwardRef<HTMLDivElement, MotionStageContainerProps>(\n MotionStageContainerImpl,\n)\n\nfunction MotionStageContainerImpl(\n props: MotionStageContainerProps,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const {\n children,\n className,\n layoutId,\n style,\n onLayoutMeasure,\n onLayoutAnimationStart,\n onLayoutAnimationComplete,\n ...restProps\n } = props\n\n const containerRef = useRef<HTMLDivElement | null>(null)\n\n // Layout size from ResizeObserver (untransformed border-box)\n const { width: layoutW, height: layoutH } = useContainerResizeMV(\n containerRef,\n )\n\n const mergedRef = useMergedRefs(containerRef, ref)\n\n // Frozen base size during layout animation (snapshot at measure/start)\n const animLayoutW = useMotionValue(layoutW.get())\n const animLayoutH = useMotionValue(layoutH.get())\n\n // Animation phase flag: 0 (idle) / 1 (animating)\n const isAnimating = useMotionValue(0)\n\n // Parent scale extracted from transformTemplate\n const scaleX = useMotionValue(1)\n const scaleY = useMotionValue(1)\n\n // Visual size in the local transform coord system: base × scale\n const visualW = useTransform(() =>\n (isAnimating.get() ? animLayoutW.get() : layoutW.get()) * scaleX.get()\n )\n const visualH = useTransform(() =>\n (isAnimating.get() ? animLayoutH.get() : layoutH.get()) * scaleY.get()\n )\n\n const handleParentTransform: TransformTemplate = (\n _latest,\n generated,\n ) => {\n if (generated && generated !== 'none') {\n const s = getLastScaleFromTransform(generated)\n if (s) {\n scaleX.set(s.x)\n scaleY.set(s.y)\n } else {\n scaleX.set(1)\n scaleY.set(1)\n }\n } else {\n scaleX.set(1)\n scaleY.set(1)\n }\n return generated\n }\n\n const handleLayoutMeasure = (\n ...args: Parameters<\n NonNullable<MotionStageContainerProps['onLayoutMeasure']>\n >\n ) => {\n const [box] = args\n // Forward consumer callbacks while guaranteeing internal MotionValue updates\n // always run even if the consumer callback throws.\n try {\n onLayoutMeasure?.(...args)\n } finally {\n animLayoutW.set(box.x.max - box.x.min)\n animLayoutH.set(box.y.max - box.y.min)\n }\n }\n\n const handleLayoutAnimationStart = (\n ...args: Parameters<\n NonNullable<MotionStageContainerProps['onLayoutAnimationStart']>\n >\n ) => {\n // Forward consumer callbacks while guaranteeing internal MotionValue updates\n // always run even if the consumer callback throws.\n try {\n onLayoutAnimationStart?.(...args)\n } finally {\n isAnimating.set(1)\n }\n }\n\n const handleLayoutAnimationComplete = (\n ...args: Parameters<\n NonNullable<MotionStageContainerProps['onLayoutAnimationComplete']>\n >\n ) => {\n // Forward consumer callbacks while guaranteeing internal MotionValue updates\n // always run even if the consumer callback throws.\n try {\n onLayoutAnimationComplete?.(...args)\n } finally {\n isAnimating.set(0)\n animLayoutW.set(layoutW.get())\n animLayoutH.set(layoutH.get())\n scaleX.set(1)\n scaleY.set(1)\n }\n }\n\n const mergedContainerStyle: MotionStyle = style === undefined\n ? CONTAINER_LOCKED_STYLE\n : { ...(style as MotionStyle), ...CONTAINER_LOCKED_STYLE }\n\n return (\n // Two-layer layout shell:\n // outer applies scale S; inner defines stable coords.\n // We effectively apply an inverse transform (S⁻¹), but instead of\n // nesting transforms, we reconstruct visual size: V = L × S,\n // so children render in a scale-invariant space.\n <motion.div\n {...restProps}\n layout\n layoutId={`_${layoutId}_parent`}\n layoutCrossfade={false}\n ref={mergedRef}\n onLayoutMeasure={handleLayoutMeasure}\n onLayoutAnimationStart={handleLayoutAnimationStart}\n onLayoutAnimationComplete={handleLayoutAnimationComplete}\n transformTemplate={handleParentTransform}\n className={className}\n style={mergedContainerStyle}\n >\n <motion.div\n layout\n layoutId={`_${layoutId}_child`}\n layoutCrossfade={false}\n style={ANCHOR_LOCKED_STYLE}\n >\n {/* Descendants consume the post-compensation visual size, not the raw outer transform. */}\n <VisualSizeProvider visualH={visualH} visualW={visualW}>\n {children}\n </VisualSizeProvider>\n </motion.div>\n </motion.div>\n )\n}\n\nexport { MotionStageContainer }\n"],"names":["CONTAINER_LOCKED_STYLE","ANCHOR_LOCKED_STYLE","MotionStageContainer","forwardRef","MotionStageContainerImpl","props","ref","children","className","layoutId","style","onLayoutMeasure","onLayoutAnimationStart","onLayoutAnimationComplete","restProps","containerRef","useRef","layoutW","layoutH","useContainerResizeMV","mergedRef","useMergedRefs","animLayoutW","useMotionValue","animLayoutH","isAnimating","scaleX","scaleY","visualW","useTransform","visualH","handleParentTransform","_latest","generated","s","getLastScaleFromTransform","handleLayoutMeasure","args","box","handleLayoutAnimationStart","handleLayoutAnimationComplete","mergedContainerStyle","undefined","motion","VisualSizeProvider"],"mappings":";;;;;;;;AAoBA,MAA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5CrB;;;;AAKX"}
@@ -0,0 +1,5 @@
1
+ export { MotionStage } from './stage-motion';
2
+ export { MotionStageContainer } from './container-motion';
3
+ export { MotionPresentation } from './presentation-motion';
4
+ export type { MotionPresentationProps, MotionStageContainerProps, MotionStageProps, } from './types';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/motion/stage/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,YAAY,EACV,uBAAuB,EACvB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,SAAS,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { MotionStage } from "./stage-motion.js";
2
+ export { MotionStageContainer } from "./container-motion.js";
3
+ export { MotionPresentation } from "./presentation-motion.js";
@@ -0,0 +1,17 @@
1
+ import type { JSX } from 'react';
2
+ import type { MotionPresentationProps } from './types';
3
+ /**
4
+ * Presentation-only motion wrapper.
5
+ *
6
+ * `AnimatePresence` with `propagate` ensures descendant `exit` animations still
7
+ * run when this subtree is removed by an outer presence boundary.
8
+ *
9
+ * This layer intentionally sets `layout={false}` because layout measurement and
10
+ * layout transitions are owned by `MotionStageContainer`. In other words,
11
+ * `MotionStageContainer` moves/resizes the stage in layout space, while
12
+ * `MotionPresentation` only handles presence-style visual animation for the
13
+ * content inside that stage.
14
+ */
15
+ declare function MotionPresentation(props: MotionPresentationProps): JSX.Element;
16
+ export { MotionPresentation };
17
+ //# sourceMappingURL=presentation-motion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation-motion.d.ts","sourceRoot":"","sources":["../../../src/motion/stage/presentation-motion.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAatD;;;;;;;;;;;GAWG;AACH,iBAAS,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAmBvE;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAA"}
@@ -0,0 +1,33 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { AnimatePresence } from "motion/react";
3
+ import * as __rspack_external_motion_react_client_3c058d48 from "motion/react-client";
4
+ const PRESENTATION_LOCKED_STYLE = {
5
+ position: 'relative',
6
+ width: 4,
7
+ height: 4,
8
+ display: 'flex',
9
+ justifyContent: 'center',
10
+ alignItems: 'center',
11
+ overflow: 'visible',
12
+ transformOrigin: 'center'
13
+ };
14
+ function MotionPresentation(props) {
15
+ const { children, className, style, ...restProps } = props;
16
+ const mergedStyle = void 0 === style ? PRESENTATION_LOCKED_STYLE : {
17
+ ...style,
18
+ ...PRESENTATION_LOCKED_STYLE
19
+ };
20
+ return /*#__PURE__*/ jsx(AnimatePresence, {
21
+ propagate: true,
22
+ children: /*#__PURE__*/ jsx(__rspack_external_motion_react_client_3c058d48.div, {
23
+ layout: false,
24
+ className: className,
25
+ style: mergedStyle,
26
+ ...restProps,
27
+ children: children
28
+ })
29
+ });
30
+ }
31
+ export { MotionPresentation };
32
+
33
+ //# sourceMappingURL=presentation-motion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion/stage/presentation-motion.js","sources":["../../../src/motion/stage/presentation-motion.tsx"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nimport { AnimatePresence } from 'motion/react'\nimport type { MotionStyle } from 'motion/react'\nimport * as motion from 'motion/react-client'\nimport type { JSX } from 'react'\n\nimport type { MotionPresentationProps } from './types'\n\nconst PRESENTATION_LOCKED_STYLE: MotionStyle = {\n position: 'relative',\n width: 4,\n height: 4,\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n overflow: 'visible',\n transformOrigin: 'center',\n}\n\n/**\n * Presentation-only motion wrapper.\n *\n * `AnimatePresence` with `propagate` ensures descendant `exit` animations still\n * run when this subtree is removed by an outer presence boundary.\n *\n * This layer intentionally sets `layout={false}` because layout measurement and\n * layout transitions are owned by `MotionStageContainer`. In other words,\n * `MotionStageContainer` moves/resizes the stage in layout space, while\n * `MotionPresentation` only handles presence-style visual animation for the\n * content inside that stage.\n */\nfunction MotionPresentation(props: MotionPresentationProps): JSX.Element {\n const { children, className, style, ...restProps } = props\n\n const mergedStyle: MotionStyle = style === undefined\n ? PRESENTATION_LOCKED_STYLE\n : { ...(style as MotionStyle), ...PRESENTATION_LOCKED_STYLE }\n\n return (\n <AnimatePresence propagate>\n <motion.div\n layout={false}\n className={className}\n style={mergedStyle}\n {...restProps}\n >\n {children}\n </motion.div>\n </AnimatePresence>\n )\n}\n\nexport { MotionPresentation }\n"],"names":["PRESENTATION_LOCKED_STYLE","MotionPresentation","props","children","className","style","restProps","mergedStyle","undefined","AnimatePresence","motion"],"mappings":";;;AAWA,MAAMA,4BAAyC;IAC7C,UAAU;IACV,OAAO;IACP,QAAQ;IACR,SAAS;IACT,gBAAgB;IAChB,YAAY;IACZ,UAAU;IACV,iBAAiB;AACnB;AAcA,SAASC,mBAAmBC,KAA8B;IACxD,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGC,WAAW,GAAGJ;IAErD,MAAMK,cAA2BF,AAAUG,WAAVH,QAC7BL,4BACA;QAAE,GAAIK,KAAK;QAAkB,GAAGL,yBAAyB;IAAC;IAE9D,OAAO,WAAP,GACE,IAACS,iBAAeA;QAAC,WAAS;kBACxB,kBAACC,+CAAAA,GAAU;YACT,QAAQ;YACR,WAAWN;YACX,OAAOG;YACN,GAAGD,SAAS;sBAEZH;;;AAIT"}
@@ -0,0 +1,5 @@
1
+ import type { JSX } from 'react';
2
+ import type { MotionStageProps } from './types';
3
+ declare function MotionStage({ width: widthProp, height: heightProp, baseWidth, baseHeight, fit, fitProgress, zoom, panX: screenPanX, panY: screenPanY, world, fitTransition, zoomTransition, panTransition, alignX, alignY, className, style, children, focalLength, maskColor, maskOpacity, contentInteractive, }: MotionStageProps): JSX.Element;
4
+ export { MotionStage };
5
+ //# sourceMappingURL=stage-motion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stage-motion.d.ts","sourceRoot":"","sources":["../../../src/motion/stage/stage-motion.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AA2C/C,iBAAS,WAAW,CAAC,EACnB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,UAAU,EAClB,SAAe,EACf,UAAgB,EAChB,GAAe,EACf,WAAW,EACX,IAAQ,EACR,IAAI,EAAE,UAAc,EACpB,IAAI,EAAE,UAAc,EACpB,KAAqB,EACrB,aAAkC,EAClC,cAAmC,EACnC,aAAkC,EAClC,MAAiB,EACjB,MAAiB,EACjB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,WAAW,EACX,SAAyB,EACzB,WAAe,EACf,kBAA0B,GAC3B,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CA6JhC;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -0,0 +1,184 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useMotionTemplate, useMotionValue, useSpring, useTransform } from "motion/react";
3
+ import { useLayoutEffect, useMemo } from "react";
4
+ import { OUTLINE_WEIGHT, SMOOTHING_OUTLINE_PATH, SMOOTHING_PATH } from "../../constants/stage.js";
5
+ import { computeDepthScale, computeScreenTranslation, toAlignFactor } from "../../utils/index.js";
6
+ import { useVisualSize } from "../context/use-visual-size.js";
7
+ import * as __rspack_external_motion_react_client_3c058d48 from "motion/react-client";
8
+ const DEVICE_CLIP_PATH = `path("${SMOOTHING_PATH}")`;
9
+ const DEVICE_OUTLINE_CLIP_PATH = `path("${SMOOTHING_OUTLINE_PATH}")`;
10
+ const STAGE_ANCHOR_LOCKED_STYLE = {
11
+ position: 'relative',
12
+ width: 0,
13
+ height: 0,
14
+ overflow: 'visible',
15
+ pointerEvents: 'none'
16
+ };
17
+ const LAYER_BASE_LOCKED_STYLE = {
18
+ position: 'absolute',
19
+ top: 0,
20
+ left: 0,
21
+ transformOrigin: 'top left',
22
+ pointerEvents: 'none',
23
+ willChange: 'transform'
24
+ };
25
+ const LAYER_CLIPPED_LOCKED_STYLE = {
26
+ ...LAYER_BASE_LOCKED_STYLE,
27
+ overflow: 'hidden'
28
+ };
29
+ const clamp01 = (v)=>Math.max(0, Math.min(1, v));
30
+ const DEFAULT_TRANSITION = {
31
+ stiffness: 170,
32
+ damping: 26
33
+ };
34
+ const DEFAULT_WORLD = {
35
+ x: 0,
36
+ y: 0,
37
+ z: 0
38
+ };
39
+ function MotionStage({ width: widthProp, height: heightProp, baseWidth = 375, baseHeight = 812, fit = 'contain', fitProgress, zoom = 1, panX: screenPanX = 0, panY: screenPanY = 0, world = DEFAULT_WORLD, fitTransition = DEFAULT_TRANSITION, zoomTransition = DEFAULT_TRANSITION, panTransition = DEFAULT_TRANSITION, alignX = 'center', alignY = 'center', className, style, children, focalLength, maskColor = 'transparent', maskOpacity = 0, contentInteractive = false }) {
40
+ const visualSizeCtx = useVisualSize();
41
+ const outlineW = baseWidth + 2 * OUTLINE_WEIGHT;
42
+ const outlineH = baseHeight + 2 * OUTLINE_WEIGHT;
43
+ const deltaX = OUTLINE_WEIGHT;
44
+ const deltaY = OUTLINE_WEIGHT;
45
+ const baseW = useMotionValue(outlineW);
46
+ const baseH = useMotionValue(outlineH);
47
+ useLayoutEffect(()=>{
48
+ baseW.set(outlineW);
49
+ baseH.set(outlineH);
50
+ }, [
51
+ outlineW,
52
+ outlineH,
53
+ baseW,
54
+ baseH
55
+ ]);
56
+ const width = widthProp ?? visualSizeCtx?.visualW ?? baseW;
57
+ const height = heightProp ?? visualSizeCtx?.visualH ?? baseH;
58
+ const ax = toAlignFactor(alignX);
59
+ const ay = toAlignFactor(alignY);
60
+ const ratioW = useTransform(()=>width.get() / baseW.get());
61
+ const ratioH = useTransform(()=>height.get() / baseH.get());
62
+ const tMv = useMotionValue(0);
63
+ const zMv = useMotionValue(1);
64
+ useLayoutEffect(()=>{
65
+ if ('number' == typeof fitProgress) tMv.set(clamp01(fitProgress));
66
+ else tMv.set('cover' === fit ? 1 : 0);
67
+ }, [
68
+ fit,
69
+ fitProgress,
70
+ tMv
71
+ ]);
72
+ useLayoutEffect(()=>{
73
+ zMv.set(zoom ?? 1);
74
+ }, [
75
+ zoom,
76
+ zMv
77
+ ]);
78
+ const minScale = useTransform(()=>Math.min(ratioW.get(), ratioH.get()));
79
+ const maxScale = useTransform(()=>Math.max(ratioW.get(), ratioH.get()));
80
+ const fitSpring = useSpring(tMv, fitTransition);
81
+ const zoomSpring = useSpring(zMv, zoomTransition);
82
+ const { x: worldX = 0, y: worldY = 0, z: worldZ = 0 } = world;
83
+ const k = computeDepthScale(focalLength, worldZ);
84
+ const { x: panX, y: panY } = computeScreenTranslation({
85
+ worldX,
86
+ worldY,
87
+ depthScale: k,
88
+ screenPanX,
89
+ screenPanY
90
+ });
91
+ const zoomCamMv = useMotionValue(k);
92
+ const panXMv = useMotionValue(panX);
93
+ const panYMv = useMotionValue(panY);
94
+ useLayoutEffect(()=>{
95
+ zoomCamMv.set(k);
96
+ }, [
97
+ k,
98
+ zoomCamMv
99
+ ]);
100
+ useLayoutEffect(()=>{
101
+ panXMv.set(panX);
102
+ }, [
103
+ panX,
104
+ panXMv
105
+ ]);
106
+ useLayoutEffect(()=>{
107
+ panYMv.set(panY);
108
+ }, [
109
+ panY,
110
+ panYMv
111
+ ]);
112
+ const zoomCamSpring = useSpring(zoomCamMv, zoomTransition);
113
+ const panXSpring = useSpring(panXMv, panTransition);
114
+ const panYSpring = useSpring(panYMv, panTransition);
115
+ const scale = useTransform(()=>(minScale.get() + (maxScale.get() - minScale.get()) * fitSpring.get()) * zoomSpring.get() * zoomCamSpring.get());
116
+ const outlineX = useTransform(()=>-(outlineW * scale.get()) * ax);
117
+ const outlineY = useTransform(()=>-(outlineH * scale.get()) * ay);
118
+ const frameX = useTransform(()=>outlineX.get() + deltaX * scale.get());
119
+ const frameY = useTransform(()=>outlineY.get() + deltaY * scale.get());
120
+ const frameTransform = useMotionTemplate`translate(${panXSpring}px, ${panYSpring}px) translate(${frameX}px, ${frameY}px) scale(${scale})`;
121
+ const outlineTransform = useMotionTemplate`translate(${panXSpring}px, ${panYSpring}px) translate(${outlineX}px, ${outlineY}px) scale(${scale})`;
122
+ const outlineLayerStyle = useMemo(()=>({
123
+ ...LAYER_BASE_LOCKED_STYLE,
124
+ width: outlineW,
125
+ height: outlineH,
126
+ clipPath: DEVICE_OUTLINE_CLIP_PATH
127
+ }), [
128
+ outlineW,
129
+ outlineH
130
+ ]);
131
+ const frameLayerStyle = useMemo(()=>({
132
+ ...LAYER_CLIPPED_LOCKED_STYLE,
133
+ width: baseWidth,
134
+ height: baseHeight,
135
+ clipPath: DEVICE_CLIP_PATH
136
+ }), [
137
+ baseWidth,
138
+ baseHeight
139
+ ]);
140
+ const maskLayerStyle = useMemo(()=>({
141
+ ...LAYER_BASE_LOCKED_STYLE,
142
+ width: baseWidth,
143
+ height: baseHeight,
144
+ clipPath: DEVICE_CLIP_PATH
145
+ }), [
146
+ baseWidth,
147
+ baseHeight
148
+ ]);
149
+ return /*#__PURE__*/ jsxs(__rspack_external_motion_react_client_3c058d48.div, {
150
+ style: STAGE_ANCHOR_LOCKED_STYLE,
151
+ children: [
152
+ /*#__PURE__*/ jsx(__rspack_external_motion_react_client_3c058d48.div, {
153
+ className: className,
154
+ style: {
155
+ ...style,
156
+ ...outlineLayerStyle,
157
+ transform: outlineTransform
158
+ }
159
+ }),
160
+ /*#__PURE__*/ jsx(__rspack_external_motion_react_client_3c058d48.div, {
161
+ style: {
162
+ ...frameLayerStyle,
163
+ pointerEvents: contentInteractive ? 'auto' : 'none',
164
+ transform: frameTransform
165
+ },
166
+ children: children
167
+ }),
168
+ /*#__PURE__*/ jsx(__rspack_external_motion_react_client_3c058d48.div, {
169
+ style: {
170
+ ...maskLayerStyle,
171
+ transform: frameTransform,
172
+ backgroundColor: maskColor
173
+ },
174
+ animate: {
175
+ opacity: maskOpacity
176
+ },
177
+ transition: DEFAULT_TRANSITION
178
+ })
179
+ ]
180
+ });
181
+ }
182
+ export { MotionStage };
183
+
184
+ //# sourceMappingURL=stage-motion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion/stage/stage-motion.js","sources":["../../../src/motion/stage/stage-motion.tsx"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nimport {\n useMotionTemplate,\n useMotionValue,\n useSpring,\n useTransform,\n} from 'motion/react'\nimport type { MotionStyle, SpringOptions } from 'motion/react'\nimport * as motion from 'motion/react-client'\nimport { useLayoutEffect, useMemo } from 'react'\nimport type { JSX } from 'react'\n\nimport type { MotionStageProps } from './types'\nimport {\n OUTLINE_WEIGHT,\n SMOOTHING_OUTLINE_PATH,\n SMOOTHING_PATH,\n} from '../../constants/stage'\nimport {\n computeDepthScale,\n computeScreenTranslation,\n toAlignFactor,\n} from '../../utils'\nimport { useVisualSize } from '../context/use-visual-size'\n\nconst DEVICE_CLIP_PATH = `path(\"${SMOOTHING_PATH}\")`\nconst DEVICE_OUTLINE_CLIP_PATH = `path(\"${SMOOTHING_OUTLINE_PATH}\")`\n\nconst STAGE_ANCHOR_LOCKED_STYLE: MotionStyle = {\n position: 'relative',\n width: 0,\n height: 0,\n overflow: 'visible',\n pointerEvents: 'none',\n}\n\nconst LAYER_BASE_LOCKED_STYLE: MotionStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n transformOrigin: 'top left',\n pointerEvents: 'none',\n willChange: 'transform',\n}\n\nconst LAYER_CLIPPED_LOCKED_STYLE: MotionStyle = {\n ...LAYER_BASE_LOCKED_STYLE,\n overflow: 'hidden',\n}\n\nconst clamp01 = (v: number) => Math.max(0, Math.min(1, v))\n\nconst DEFAULT_TRANSITION: SpringOptions = { stiffness: 170, damping: 26 }\nconst DEFAULT_WORLD: { x: number, y: number, z: number } = { x: 0, y: 0, z: 0 }\n\nfunction MotionStage({\n width: widthProp,\n height: heightProp,\n baseWidth = 375,\n baseHeight = 812,\n fit = 'contain',\n fitProgress,\n zoom = 1,\n panX: screenPanX = 0,\n panY: screenPanY = 0,\n world = DEFAULT_WORLD,\n fitTransition = DEFAULT_TRANSITION,\n zoomTransition = DEFAULT_TRANSITION,\n panTransition = DEFAULT_TRANSITION,\n alignX = 'center',\n alignY = 'center',\n className,\n style,\n children,\n focalLength,\n maskColor = 'transparent',\n maskOpacity = 0,\n contentInteractive = false,\n}: MotionStageProps): JSX.Element {\n // Graceful fallback: null when no VisualSizeProvider wraps this component\n const visualSizeCtx = useVisualSize()\n\n const outlineW = baseWidth + 2 * OUTLINE_WEIGHT\n const outlineH = baseHeight + 2 * OUTLINE_WEIGHT\n\n const deltaX = OUTLINE_WEIGHT\n const deltaY = OUTLINE_WEIGHT\n\n const baseW = useMotionValue(outlineW)\n const baseH = useMotionValue(outlineH)\n\n useLayoutEffect(() => {\n baseW.set(outlineW)\n baseH.set(outlineH)\n }, [outlineW, outlineH, baseW, baseH])\n\n const width = widthProp\n ?? visualSizeCtx?.visualW ?? baseW\n\n const height = heightProp\n ?? visualSizeCtx?.visualH ?? baseH\n\n const ax = toAlignFactor(alignX)\n const ay = toAlignFactor(alignY)\n\n const ratioW = useTransform(() => width.get() / baseW.get())\n const ratioH = useTransform(() => height.get() / baseH.get())\n\n const tMv = useMotionValue(0)\n const zMv = useMotionValue(1)\n\n useLayoutEffect(() => {\n if (typeof fitProgress === 'number') {\n tMv.set(clamp01(fitProgress))\n } else {\n tMv.set(fit === 'cover' ? 1 : 0)\n }\n }, [fit, fitProgress, tMv])\n\n useLayoutEffect(() => {\n zMv.set(zoom ?? 1)\n }, [zoom, zMv])\n\n const minScale = useTransform(() => Math.min(ratioW.get(), ratioH.get()))\n const maxScale = useTransform(() => Math.max(ratioW.get(), ratioH.get()))\n\n const fitSpring = useSpring(tMv, fitTransition)\n const zoomSpring = useSpring(zMv, zoomTransition)\n\n // ===== Camera (perspective) layer =====\n const { x: worldX = 0, y: worldY = 0, z: worldZ = 0 } = world\n\n // k = f/(f-z), or 1 when no perspective\n const k = computeDepthScale(focalLength, worldZ)\n\n // principal-point compensation so the center stays visually fixed\n const { x: panX, y: panY } = computeScreenTranslation({\n worldX,\n worldY,\n depthScale: k,\n screenPanX,\n screenPanY,\n })\n\n const zoomCamMv = useMotionValue(k)\n const panXMv = useMotionValue(panX)\n const panYMv = useMotionValue(panY)\n\n useLayoutEffect(() => {\n zoomCamMv.set(k)\n }, [k, zoomCamMv])\n\n useLayoutEffect(() => {\n panXMv.set(panX)\n }, [panX, panXMv])\n\n useLayoutEffect(() => {\n panYMv.set(panY)\n }, [panY, panYMv])\n\n const zoomCamSpring = useSpring(zoomCamMv, zoomTransition)\n const panXSpring = useSpring(panXMv, panTransition)\n const panYSpring = useSpring(panYMv, panTransition)\n\n const scale = useTransform(() =>\n (minScale.get() + (maxScale.get() - minScale.get()) * fitSpring.get())\n * zoomSpring.get() * zoomCamSpring.get()\n )\n\n const outlineX = useTransform(() => -(outlineW * scale.get()) * ax)\n const outlineY = useTransform(() => -(outlineH * scale.get()) * ay)\n const frameX = useTransform(() => outlineX.get() + deltaX * scale.get())\n const frameY = useTransform(() => outlineY.get() + deltaY * scale.get())\n\n const frameTransform =\n useMotionTemplate`translate(${panXSpring}px, ${panYSpring}px) translate(${frameX}px, ${frameY}px) scale(${scale})`\n const outlineTransform =\n useMotionTemplate`translate(${panXSpring}px, ${panYSpring}px) translate(${outlineX}px, ${outlineY}px) scale(${scale})`\n\n const outlineLayerStyle = useMemo<MotionStyle>(() => ({\n ...LAYER_BASE_LOCKED_STYLE,\n width: outlineW,\n height: outlineH,\n clipPath: DEVICE_OUTLINE_CLIP_PATH,\n }), [outlineW, outlineH])\n\n const frameLayerStyle = useMemo<MotionStyle>(() => ({\n ...LAYER_CLIPPED_LOCKED_STYLE,\n width: baseWidth,\n height: baseHeight,\n clipPath: DEVICE_CLIP_PATH,\n }), [baseWidth, baseHeight])\n\n const maskLayerStyle = useMemo<MotionStyle>(() => ({\n ...LAYER_BASE_LOCKED_STYLE,\n width: baseWidth,\n height: baseHeight,\n clipPath: DEVICE_CLIP_PATH,\n }), [baseWidth, baseHeight])\n\n return (\n <motion.div style={STAGE_ANCHOR_LOCKED_STYLE}>\n {/* Device outline */}\n <motion.div\n className={className}\n style={{\n ...(style as MotionStyle | undefined),\n ...outlineLayerStyle,\n transform: outlineTransform,\n }}\n />\n\n {/* Device frame */}\n <motion.div\n style={{\n ...frameLayerStyle,\n pointerEvents: contentInteractive ? 'auto' : 'none',\n transform: frameTransform,\n }}\n >\n {children}\n </motion.div>\n\n {/* Mask layer */}\n <motion.div\n style={{\n ...maskLayerStyle,\n transform: frameTransform,\n backgroundColor: maskColor,\n }}\n animate={{ opacity: maskOpacity }}\n transition={DEFAULT_TRANSITION}\n />\n </motion.div>\n )\n}\n\nexport { MotionStage }\n"],"names":["DEVICE_CLIP_PATH","SMOOTHING_PATH","DEVICE_OUTLINE_CLIP_PATH","SMOOTHING_OUTLINE_PATH","STAGE_ANCHOR_LOCKED_STYLE","LAYER_BASE_LOCKED_STYLE","LAYER_CLIPPED_LOCKED_STYLE","clamp01","v","Math","DEFAULT_TRANSITION","DEFAULT_WORLD","MotionStage","widthProp","heightProp","baseWidth","baseHeight","fit","fitProgress","zoom","screenPanX","screenPanY","world","fitTransition","zoomTransition","panTransition","alignX","alignY","className","style","children","focalLength","maskColor","maskOpacity","contentInteractive","visualSizeCtx","useVisualSize","outlineW","OUTLINE_WEIGHT","outlineH","deltaX","deltaY","baseW","useMotionValue","baseH","useLayoutEffect","width","height","ax","toAlignFactor","ay","ratioW","useTransform","ratioH","tMv","zMv","minScale","maxScale","fitSpring","useSpring","zoomSpring","worldX","worldY","worldZ","k","computeDepthScale","panX","panY","computeScreenTranslation","zoomCamMv","panXMv","panYMv","zoomCamSpring","panXSpring","panYSpring","scale","outlineX","outlineY","frameX","frameY","frameTransform","useMotionTemplate","outlineTransform","outlineLayerStyle","useMemo","frameLayerStyle","maskLayerStyle","motion"],"mappings":";;;;;;;AA4BA,MAAMA,mBAAmB,CAAC,MAAM,EAAEC,eAAe,EAAE,CAAC;AACpD,MAAMC,2BAA2B,CAAC,MAAM,EAAEC,uBAAuB,EAAE,CAAC;AAEpE,MAAMC,4BAAyC;IAC7C,UAAU;IACV,OAAO;IACP,QAAQ;IACR,UAAU;IACV,eAAe;AACjB;AAEA,MAAMC,0BAAuC;IAC3C,UAAU;IACV,KAAK;IACL,MAAM;IACN,iBAAiB;IACjB,eAAe;IACf,YAAY;AACd;AAEA,MAAMC,6BAA0C;IAC9C,GAAGD,uBAAuB;IAC1B,UAAU;AACZ;AAEA,MAAME,UAAU,CAACC,IAAcC,KAAK,GAAG,CAAC,GAAGA,KAAK,GAAG,CAAC,GAAGD;AAEvD,MAAME,qBAAoC;IAAE,WAAW;IAAK,SAAS;AAAG;AACxE,MAAMC,gBAAqD;IAAE,GAAG;IAAG,GAAG;IAAG,GAAG;AAAE;AAE9E,SAASC,YAAY,EACnB,OAAOC,SAAS,EAChB,QAAQC,UAAU,EAClBC,YAAY,GAAG,EACfC,aAAa,GAAG,EAChBC,MAAM,SAAS,EACfC,WAAW,EACXC,OAAO,CAAC,EACR,MAAMC,aAAa,CAAC,EACpB,MAAMC,aAAa,CAAC,EACpBC,QAAQX,aAAa,EACrBY,gBAAgBb,kBAAkB,EAClCc,iBAAiBd,kBAAkB,EACnCe,gBAAgBf,kBAAkB,EAClCgB,SAAS,QAAQ,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x: ScaleX, y: ScaleY }; if not found, returns null.
4
+ */
5
+ export declare function getLastScaleFromTransform(transform: string): {
6
+ x: number;
7
+ y: number;
8
+ } | null;
9
+ //# sourceMappingURL=transform-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform-utils.d.ts","sourceRoot":"","sources":["../../../src/motion/stage/transform-utils.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,GAChB;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAiBjC"}
@@ -0,0 +1,20 @@
1
+ const NUM_SRC = String.raw`[+-]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?`;
2
+ const SCALE_SINGLE_RE = new RegExp(String.raw`^scale\(\s*(${NUM_SRC})(?:\s*,\s*(${NUM_SRC}))?\s*\)`, 'i');
3
+ function getLastScaleFromTransform(transform) {
4
+ if (!transform) return null;
5
+ const lower = transform.toLowerCase();
6
+ const idx = lower.lastIndexOf('scale(');
7
+ if (-1 === idx) return null;
8
+ const suffix = transform.slice(idx);
9
+ const m = SCALE_SINGLE_RE.exec(suffix);
10
+ if (!m) return null;
11
+ const sx = Number.parseFloat(m[1]);
12
+ const sy = void 0 === m[2] ? sx : Number.parseFloat(m[2]);
13
+ return {
14
+ x: sx,
15
+ y: sy
16
+ };
17
+ }
18
+ export { getLastScaleFromTransform };
19
+
20
+ //# sourceMappingURL=transform-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion/stage/transform-utils.js","sources":["../../../src/motion/stage/transform-utils.ts"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nconst NUM_SRC = String.raw`[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:e[+-]?\\d+)?`\nconst SCALE_SINGLE_RE = new RegExp(\n String.raw`^scale\\(\\s*(${NUM_SRC})(?:\\s*,\\s*(${NUM_SRC}))?\\s*\\)`,\n 'i', // case-insensitive so \"e\" and \"E\" both work, avoids duplicate character class issues\n)\n\n/**\n * Parse the last occurrence of `scale(...)` from a CSS transform string.\n * Returns { x: ScaleX, y: ScaleY }; if not found, returns null.\n */\nexport function getLastScaleFromTransform(\n transform: string,\n): { x: number, y: number } | null {\n if (!transform) return null\n\n // Find the last index of \"scale(\" (case-insensitive)\n const lower = transform.toLowerCase()\n const idx = lower.lastIndexOf('scale(')\n if (idx === -1) return null\n\n // Slice from the last \"scale(\" and extract numbers with a small regex\n const suffix = transform.slice(idx)\n const m = SCALE_SINGLE_RE.exec(suffix)\n if (!m) return null\n\n // m[1] is guaranteed by the regex pattern (required capture group)\n const sx = Number.parseFloat(m[1]!)\n const sy = m[2] === undefined ? sx : Number.parseFloat(m[2]) // if only one argument, sy = sx\n return { x: sx, y: sy }\n}\n"],"names":["NUM_SRC","String","SCALE_SINGLE_RE","RegExp","getLastScaleFromTransform","transform","lower","idx","suffix","m","sx","Number","sy","undefined"],"mappings":"AAIA,MAAMA,UAAUC,OAAO,GAAG,CAAC,0CAA0C,CAAC;AACtE,MAAMC,kBAAkB,IAAIC,OAC1BF,OAAO,GAAG,CAAC,YAAY,EAAED,QAAQ,YAAY,EAAEA,QAAQ,QAAQ,CAAC,EAChE;AAOK,SAASI,0BACdC,SAAiB;IAEjB,IAAI,CAACA,WAAW,OAAO;IAGvB,MAAMC,QAAQD,UAAU,WAAW;IACnC,MAAME,MAAMD,MAAM,WAAW,CAAC;IAC9B,IAAIC,AAAQ,OAARA,KAAY,OAAO;IAGvB,MAAMC,SAASH,UAAU,KAAK,CAACE;IAC/B,MAAME,IAAIP,gBAAgB,IAAI,CAACM;IAC/B,IAAI,CAACC,GAAG,OAAO;IAGf,MAAMC,KAAKC,OAAO,UAAU,CAACF,CAAC,CAAC,EAAE;IACjC,MAAMG,KAAKH,AAASI,WAATJ,CAAC,CAAC,EAAE,GAAiBC,KAAKC,OAAO,UAAU,CAACF,CAAC,CAAC,EAAE;IAC3D,OAAO;QAAE,GAAGC;QAAI,GAAGE;IAAG;AACxB"}
@@ -0,0 +1,85 @@
1
+ import type { MotionNodeLayoutOptions, MotionNodeOptions, MotionValue, SpringOptions } from 'motion/react';
2
+ import type { ComponentPropsWithoutRef } from 'react';
3
+ import type { StageBaseProps } from '../../types/stage-props';
4
+ export type MotionStageContainerProps = Omit<MotionNodeOptions, 'transformTemplate'> & ComponentPropsWithoutRef<'div'> & {
5
+ layoutId: string;
6
+ };
7
+ export type MotionPresentationProps = Omit<MotionNodeOptions, keyof MotionNodeLayoutOptions> & ComponentPropsWithoutRef<'div'>;
8
+ export type MotionStageProps = StageBaseProps & {
9
+ /**
10
+ * Motion value for the target viewport width in pixels.
11
+ *
12
+ * When omitted, it uses the visual size from `VisualSizeProvider` if present,
13
+ * otherwise falls back to the base outline width.
14
+ */
15
+ width?: MotionValue<number>;
16
+ /**
17
+ * Motion value for the target viewport height in pixels.
18
+ *
19
+ * When omitted, it uses the visual size from `VisualSizeProvider` if present,
20
+ * otherwise falls back to the base outline height.
21
+ */
22
+ height?: MotionValue<number>;
23
+ /**
24
+ * Continuous interpolation between `contain` and `cover`.
25
+ *
26
+ * - `0`: behave like `contain`
27
+ * - `1`: behave like `cover`
28
+ */
29
+ fitProgress?: number;
30
+ /**
31
+ * 3D translation applied in world space.
32
+ *
33
+ * When `focalLength` is provided, `z` affects perspective scaling.
34
+ */
35
+ world?: {
36
+ x?: number;
37
+ y?: number;
38
+ z?: number;
39
+ };
40
+ /**
41
+ * Spring settings for the fit interpolation (`fit` / `fitProgress`).
42
+ * Controls how the scale transitions between contain and cover.
43
+ */
44
+ fitTransition?: SpringOptions;
45
+ /**
46
+ * Spring settings for the zoom factor.
47
+ * Applied on top of the fit scale - independent of fit interpolation.
48
+ */
49
+ zoomTransition?: SpringOptions;
50
+ /**
51
+ * Spring settings for the final screen-space translation.
52
+ *
53
+ * Both `panX`/`panY` and `world.x`/`world.y` contribute to screen-space
54
+ * displacement - `world` is perspective-projected before being composited.
55
+ * The spring animates the combined screen-space value.
56
+ */
57
+ panTransition?: SpringOptions;
58
+ /**
59
+ * Camera focal length in pixels.
60
+ *
61
+ * When provided and greater than 0, enables perspective.
62
+ */
63
+ focalLength?: number;
64
+ /**
65
+ * Color of the overlay mask above the frame.
66
+ */
67
+ maskColor?: string;
68
+ /**
69
+ * Opacity of the overlay mask above the frame.
70
+ */
71
+ maskOpacity?: number;
72
+ /**
73
+ * Enables pointer interactions for the content rendered inside the device frame.
74
+ *
75
+ * @defaultValue false
76
+ *
77
+ * When `false`, the content host element uses `pointer-events: none` so pointer events can
78
+ * "pass through" to outer Web layout containers (useful for orchestration UIs).
79
+ *
80
+ * When `true`, the content host element uses `pointer-events: auto` so embedded runtimes
81
+ * (e.g. Lynx content) can receive pointer events.
82
+ */
83
+ contentInteractive?: boolean;
84
+ };
85
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/motion/stage/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EACjB,WAAW,EACX,aAAa,EACd,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAA;AAErD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE7D,MAAM,MAAM,yBAAyB,GACjC,IAAI,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,GAC5C,wBAAwB,CAAC,KAAK,CAAC,GAC/B;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAA;AAExB,MAAM,MAAM,uBAAuB,GAC/B,IAAI,CAAC,iBAAiB,EAAE,MAAM,uBAAuB,CAAC,GACtD,wBAAwB,CAAC,KAAK,CAAC,CAAA;AAEnC,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd;IACA;;;;;OAKG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC3B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC5B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9C;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B;;;OAGG;IACH,cAAc,CAAC,EAAE,aAAa,CAAA;IAC9B;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B,CAAA"}
File without changes
@@ -0,0 +1,13 @@
1
+ import type { MotionValue } from 'motion/react';
2
+ import type { RefObject } from 'react';
3
+ interface SizeMV {
4
+ width: MotionValue<number>;
5
+ height: MotionValue<number>;
6
+ }
7
+ type ResizeObserverCtor = new (cb: ResizeObserverCallback) => ResizeObserver;
8
+ export declare function useContainerResizeMV<T extends HTMLElement = HTMLElement>(ref: RefObject<T | null>, opts?: {
9
+ ResizeObserverImpl?: ResizeObserverCtor;
10
+ onResize?: (w: number, h: number) => void;
11
+ }): SizeMV;
12
+ export {};
13
+ //# sourceMappingURL=use-container-resize-mv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-container-resize-mv.d.ts","sourceRoot":"","sources":["../../../src/motion/stage/use-container-resize-mv.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,UAAU,MAAM;IACd,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAC1B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAC5B;AAED,KAAK,kBAAkB,GAAG,KAAI,EAAE,EAAE,sBAAsB,KAAK,cAAc,CAAA;AAE3E,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,EACtE,GAAG,EAAE,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,EACxB,IAAI,CAAC,EAAE;IACL,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;IACvC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAC1C,GACA,MAAM,CA+DR"}