cineview 1.0.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.
- package/LICENSE +21 -0
- package/README.md +284 -0
- package/README.zh-CN.md +284 -0
- package/dist/animations/animationParser.d.ts +24 -0
- package/dist/animations/composer.d.ts +13 -0
- package/dist/animations/presets/blink.d.ts +18 -0
- package/dist/animations/presets/blur.d.ts +18 -0
- package/dist/animations/presets/bounce.d.ts +18 -0
- package/dist/animations/presets/elastic.d.ts +23 -0
- package/dist/animations/presets/fade.d.ts +18 -0
- package/dist/animations/presets/flip.d.ts +18 -0
- package/dist/animations/presets/index.d.ts +38 -0
- package/dist/animations/presets/rotate.d.ts +23 -0
- package/dist/animations/presets/shake.d.ts +28 -0
- package/dist/animations/presets/slide.d.ts +23 -0
- package/dist/animations/presets/special.d.ts +38 -0
- package/dist/animations/presets/zoom.d.ts +23 -0
- package/dist/animations/registry.d.ts +51 -0
- package/dist/artifacts.json +40 -0
- package/dist/blink-BGmsrTwW.mjs +81 -0
- package/dist/blur-CQoB_VWp.mjs +52 -0
- package/dist/bounce-B_QJxgOq.mjs +64 -0
- package/dist/cineview-dev.css +2 -0
- package/dist/cineview-dev.es.mjs +2 -0
- package/dist/cineview-drag.umd.js +2 -0
- package/dist/cineview-scroll.umd.js +2 -0
- package/dist/cineview.es.mjs +2 -0
- package/dist/cineview.umd.js +2 -0
- package/dist/components/Animate/Animate.d.ts +67 -0
- package/dist/components/Animate/AnimateRenderBridge.d.ts +16 -0
- package/dist/components/Animate/AnimateVideo.d.ts +59 -0
- package/dist/components/Animate/StaggerContainer.d.ts +35 -0
- package/dist/components/Animate/__fixtures__/animate-media-public-path.fixture.d.ts +1 -0
- package/dist/components/Animate/animateInterpolation.d.ts +41 -0
- package/dist/components/Animate/animateRenderState.d.ts +23 -0
- package/dist/components/Animate/animateSemantics.d.ts +39 -0
- package/dist/components/Animate/animateTimeline.d.ts +14 -0
- package/dist/components/Animate/dragVisualState.d.ts +26 -0
- package/dist/components/Animate/index.d.ts +6 -0
- package/dist/components/Animate/useAnimateArrival.d.ts +35 -0
- package/dist/components/Animate/useAnimateDrag.d.ts +34 -0
- package/dist/components/Animate/useAnimatePublicTimeline.d.ts +16 -0
- package/dist/components/Animate/useAnimateScroll.d.ts +83 -0
- package/dist/components/Animate/useAnimatedPropertyLanes.d.ts +30 -0
- package/dist/components/Animate/visibilityScheduler.d.ts +12 -0
- package/dist/components/CineView/CineView.d.ts +48 -0
- package/dist/components/CineView/CineViewDispatch.d.ts +2 -0
- package/dist/components/CineView/DirectScrollCineView.d.ts +5 -0
- package/dist/components/CineView/DragSceneStack.d.ts +55 -0
- package/dist/components/CineView/ScrollSceneSlot.d.ts +42 -0
- package/dist/components/CineView/ScrollSceneStack.d.ts +13 -0
- package/dist/components/CineView/ScrollbarOverlay.d.ts +24 -0
- package/dist/components/CineView/directScrollHelpers.d.ts +75 -0
- package/dist/components/CineView/index.d.ts +5 -0
- package/dist/components/CineView/preloadTargets.d.ts +18 -0
- package/dist/components/CineView/regroupCallbacks.d.ts +10 -0
- package/dist/components/CineView/useCineViewImperativeApi.d.ts +21 -0
- package/dist/components/CineView/useNativeScrollController.d.ts +38 -0
- package/dist/components/CineView/useScrollInputBindings.d.ts +9 -0
- package/dist/components/CineView/useScrollSceneLayout.d.ts +24 -0
- package/dist/components/CineView/useScrollSceneSnapshots.d.ts +32 -0
- package/dist/components/CineView/useScrollViewport.d.ts +20 -0
- package/dist/components/CineView/useScrollZoneRegistry.d.ts +34 -0
- package/dist/components/Container/Container.d.ts +2 -0
- package/dist/components/Container/index.d.ts +1 -0
- package/dist/components/Image/Image.d.ts +12 -0
- package/dist/components/Image/index.d.ts +2 -0
- package/dist/components/Position/Position.d.ts +13 -0
- package/dist/components/Position/index.d.ts +1 -0
- package/dist/components/Scene/Scene.d.ts +10 -0
- package/dist/components/Scene/SceneFixedLayer.d.ts +14 -0
- package/dist/components/Scene/__fixtures__/scene-grouped-public-path.fixture.d.ts +1 -0
- package/dist/components/Scene/dragPreparedState.d.ts +49 -0
- package/dist/components/Scene/helpers.d.ts +101 -0
- package/dist/components/Scene/index.d.ts +1 -0
- package/dist/components/Scene/sceneScrollBudget.d.ts +36 -0
- package/dist/components/Scene/sceneScrollRuntime.d.ts +66 -0
- package/dist/components/Scene/types.d.ts +189 -0
- package/dist/components/Scene/useDragSceneEngine.d.ts +67 -0
- package/dist/components/Scene/useElementTrack.d.ts +82 -0
- package/dist/components/Scene/useNativePointerDrag.d.ts +25 -0
- package/dist/components/Scene/useSceneAnimationRegistry.d.ts +56 -0
- package/dist/components/Scene/useScenePointerInput.d.ts +28 -0
- package/dist/components/Scene/useSceneRuntimeState.d.ts +17 -0
- package/dist/components/Scene/useSceneScrollTakeover.d.ts +14 -0
- package/dist/components/Scene/useScrollSceneEngine.d.ts +28 -0
- package/dist/components/runtime/runtimeContext.d.ts +14 -0
- package/dist/components/runtime/scrollExternalStore.d.ts +13 -0
- package/dist/components/runtime/scrollSceneFrameStore.d.ts +29 -0
- package/dist/context/CineViewContext.d.ts +25 -0
- package/dist/dev/PerfPanel.d.ts +16 -0
- package/dist/dev/index.d.ts +14 -0
- package/dist/dev/usePerfMonitor.d.ts +9 -0
- package/dist/drag-scene-engine-y8Wj9ivV.mjs +270 -0
- package/dist/elastic-CBP_FdRv.mjs +129 -0
- package/dist/element-track-Du10P12_.mjs +316 -0
- package/dist/entry-drag.d.ts +14 -0
- package/dist/entry-scroll.d.ts +14 -0
- package/dist/fade-DXxFsgxR.mjs +22 -0
- package/dist/flip-CrCoNIws.mjs +49 -0
- package/dist/hooks/imagePreloadCache.d.ts +4 -0
- package/dist/hooks/mediaPreloadCache.d.ts +31 -0
- package/dist/hooks/useFirstSceneEnter.d.ts +65 -0
- package/dist/hooks/useImagePreloader.d.ts +31 -0
- package/dist/hooks/usePrefersReducedMotion.d.ts +12 -0
- package/dist/hooks/useSceneManager.d.ts +78 -0
- package/dist/index.d.ts +17 -0
- package/dist/media/VideoFrameRenderer.d.ts +48 -0
- package/dist/media/videoPlaybackOwnership.d.ts +63 -0
- package/dist/performance-monitor-AlOOwzY_.mjs +73 -0
- package/dist/public-api.d.ts +12 -0
- package/dist/rotate-BMEBKDk5.mjs +69 -0
- package/dist/scene-animation-registry-8b0m_IaZ.mjs +422 -0
- package/dist/shake-BV6SdR9O.mjs +171 -0
- package/dist/slide-DWmVtj0L.mjs +63 -0
- package/dist/special-DDz8BopB.mjs +224 -0
- package/dist/types/index.d.ts +555 -0
- package/dist/utils/animationHelpers.d.ts +15 -0
- package/dist/utils/debounce.d.ts +18 -0
- package/dist/utils/devLog.d.ts +16 -0
- package/dist/utils/dragTimelineMapping.d.ts +30 -0
- package/dist/utils/gestureDetector.d.ts +67 -0
- package/dist/utils/performanceMonitor.d.ts +66 -0
- package/dist/utils/styleConvert.d.ts +7 -0
- package/dist/utils/useIsomorphicLayoutEffect.d.ts +22 -0
- package/dist/utils/useStructurallyStableValue.d.ts +5 -0
- package/dist/zoom-CuAthpqd.mjs +63 -0
- package/package.json +167 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Variant } from 'framer-motion';
|
|
2
|
+
export declare const bounceAnimations: {
|
|
3
|
+
bounce: {
|
|
4
|
+
initial: Variant;
|
|
5
|
+
animate: Variant;
|
|
6
|
+
exit: Variant;
|
|
7
|
+
};
|
|
8
|
+
'bounce-in': {
|
|
9
|
+
initial: Variant;
|
|
10
|
+
animate: Variant;
|
|
11
|
+
exit: Variant;
|
|
12
|
+
};
|
|
13
|
+
'bounce-out': {
|
|
14
|
+
initial: Variant;
|
|
15
|
+
animate: Variant;
|
|
16
|
+
exit: Variant;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Variant } from 'framer-motion';
|
|
2
|
+
export declare const elasticAnimations: {
|
|
3
|
+
elastic: {
|
|
4
|
+
initial: Variant;
|
|
5
|
+
animate: Variant;
|
|
6
|
+
exit: Variant;
|
|
7
|
+
};
|
|
8
|
+
'rubber-band': {
|
|
9
|
+
initial: Variant;
|
|
10
|
+
animate: Variant;
|
|
11
|
+
exit: Variant;
|
|
12
|
+
};
|
|
13
|
+
wobble: {
|
|
14
|
+
initial: Variant;
|
|
15
|
+
animate: Variant;
|
|
16
|
+
exit: Variant;
|
|
17
|
+
};
|
|
18
|
+
swing: {
|
|
19
|
+
initial: Variant;
|
|
20
|
+
animate: Variant;
|
|
21
|
+
exit: Variant;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Variant } from 'framer-motion';
|
|
2
|
+
export declare const fadeAnimations: {
|
|
3
|
+
fade: {
|
|
4
|
+
initial: Variant;
|
|
5
|
+
animate: Variant;
|
|
6
|
+
exit: Variant;
|
|
7
|
+
};
|
|
8
|
+
'fade-in': {
|
|
9
|
+
initial: Variant;
|
|
10
|
+
animate: Variant;
|
|
11
|
+
exit: Variant;
|
|
12
|
+
};
|
|
13
|
+
'fade-out': {
|
|
14
|
+
initial: Variant;
|
|
15
|
+
animate: Variant;
|
|
16
|
+
exit: Variant;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Variant } from 'framer-motion';
|
|
2
|
+
export declare const flipAnimations: {
|
|
3
|
+
flip: {
|
|
4
|
+
initial: Variant;
|
|
5
|
+
animate: Variant;
|
|
6
|
+
exit: Variant;
|
|
7
|
+
};
|
|
8
|
+
'flip-x': {
|
|
9
|
+
initial: Variant;
|
|
10
|
+
animate: Variant;
|
|
11
|
+
exit: Variant;
|
|
12
|
+
};
|
|
13
|
+
'flip-y': {
|
|
14
|
+
initial: Variant;
|
|
15
|
+
animate: Variant;
|
|
16
|
+
exit: Variant;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Variant } from 'framer-motion';
|
|
2
|
+
export interface PresetAnimation {
|
|
3
|
+
initial: Variant;
|
|
4
|
+
animate: Variant;
|
|
5
|
+
exit: Variant;
|
|
6
|
+
}
|
|
7
|
+
export type PresetLoadErrorCode = 'INVALID_ANIMATION' | 'ANIMATION_ASSET_LOAD_FAILED';
|
|
8
|
+
export type PresetLoadState = 'idle' | 'pending' | 'success' | 'failed-permanent' | 'failed-transient';
|
|
9
|
+
export declare const PRESET_LOAD_TIMEOUT_MS = 3000;
|
|
10
|
+
export declare class PresetLoadError extends Error {
|
|
11
|
+
readonly code: PresetLoadErrorCode;
|
|
12
|
+
readonly permanent: boolean;
|
|
13
|
+
readonly category?: string;
|
|
14
|
+
readonly presetName?: string;
|
|
15
|
+
readonly cause?: unknown;
|
|
16
|
+
constructor(code: PresetLoadErrorCode, message: string, options: {
|
|
17
|
+
permanent: boolean;
|
|
18
|
+
category?: string;
|
|
19
|
+
presetName?: string;
|
|
20
|
+
cause?: unknown;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export declare function isPresetLoadError(error: unknown): error is PresetLoadError;
|
|
24
|
+
type AnimationModule = Record<string, PresetAnimation>;
|
|
25
|
+
type CategoryLoader = (category: string) => Promise<AnimationModule>;
|
|
26
|
+
/** Load one category, coalescing concurrent requests across all CineView roots. */
|
|
27
|
+
export declare function loadAnimationModule(category: string): Promise<AnimationModule>;
|
|
28
|
+
/** Resolve one preset. Unknown names/missing exports are permanent failures. */
|
|
29
|
+
export declare function getPresetAnimation(name: string): Promise<PresetAnimation>;
|
|
30
|
+
export declare function preloadAnimationCategory(category: string): Promise<void>;
|
|
31
|
+
export declare function preloadAllAnimations(): Promise<void>;
|
|
32
|
+
/** Clears success/permanent caches. Pending imports may finish but cannot repopulate a cleared epoch. */
|
|
33
|
+
export declare function clearAnimationCache(): void;
|
|
34
|
+
/** Read-only diagnostic state used by tests and development tooling. */
|
|
35
|
+
export declare function getPresetCategoryState(category: string): PresetLoadState;
|
|
36
|
+
/** Test seam; intentionally not re-exported from the package barrel. */
|
|
37
|
+
export declare function setPresetCategoryLoaderForTests(loader: CategoryLoader | null): void;
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Variant } from 'framer-motion';
|
|
2
|
+
export declare const rotateAnimations: {
|
|
3
|
+
rotate: {
|
|
4
|
+
initial: Variant;
|
|
5
|
+
animate: Variant;
|
|
6
|
+
exit: Variant;
|
|
7
|
+
};
|
|
8
|
+
'rotate-in': {
|
|
9
|
+
initial: Variant;
|
|
10
|
+
animate: Variant;
|
|
11
|
+
exit: Variant;
|
|
12
|
+
};
|
|
13
|
+
'rotate-out': {
|
|
14
|
+
initial: Variant;
|
|
15
|
+
animate: Variant;
|
|
16
|
+
exit: Variant;
|
|
17
|
+
};
|
|
18
|
+
spin: {
|
|
19
|
+
initial: Variant;
|
|
20
|
+
animate: Variant;
|
|
21
|
+
exit: Variant;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Variant } from 'framer-motion';
|
|
2
|
+
export declare const shakeAnimations: {
|
|
3
|
+
shake: {
|
|
4
|
+
initial: Variant;
|
|
5
|
+
animate: Variant;
|
|
6
|
+
exit: Variant;
|
|
7
|
+
};
|
|
8
|
+
'shake-x': {
|
|
9
|
+
initial: Variant;
|
|
10
|
+
animate: Variant;
|
|
11
|
+
exit: Variant;
|
|
12
|
+
};
|
|
13
|
+
'shake-y': {
|
|
14
|
+
initial: Variant;
|
|
15
|
+
animate: Variant;
|
|
16
|
+
exit: Variant;
|
|
17
|
+
};
|
|
18
|
+
vibrate: {
|
|
19
|
+
initial: Variant;
|
|
20
|
+
animate: Variant;
|
|
21
|
+
exit: Variant;
|
|
22
|
+
};
|
|
23
|
+
jello: {
|
|
24
|
+
initial: Variant;
|
|
25
|
+
animate: Variant;
|
|
26
|
+
exit: Variant;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Variant } from 'framer-motion';
|
|
2
|
+
export declare const slideAnimations: {
|
|
3
|
+
'slide-up': {
|
|
4
|
+
initial: Variant;
|
|
5
|
+
animate: Variant;
|
|
6
|
+
exit: Variant;
|
|
7
|
+
};
|
|
8
|
+
'slide-down': {
|
|
9
|
+
initial: Variant;
|
|
10
|
+
animate: Variant;
|
|
11
|
+
exit: Variant;
|
|
12
|
+
};
|
|
13
|
+
'slide-left': {
|
|
14
|
+
initial: Variant;
|
|
15
|
+
animate: Variant;
|
|
16
|
+
exit: Variant;
|
|
17
|
+
};
|
|
18
|
+
'slide-right': {
|
|
19
|
+
initial: Variant;
|
|
20
|
+
animate: Variant;
|
|
21
|
+
exit: Variant;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Variant } from 'framer-motion';
|
|
2
|
+
export declare const specialAnimations: {
|
|
3
|
+
heartbeat: {
|
|
4
|
+
initial: Variant;
|
|
5
|
+
animate: Variant;
|
|
6
|
+
exit: Variant;
|
|
7
|
+
};
|
|
8
|
+
tada: {
|
|
9
|
+
initial: Variant;
|
|
10
|
+
animate: Variant;
|
|
11
|
+
exit: Variant;
|
|
12
|
+
};
|
|
13
|
+
wave: {
|
|
14
|
+
initial: Variant;
|
|
15
|
+
animate: Variant;
|
|
16
|
+
exit: Variant;
|
|
17
|
+
};
|
|
18
|
+
'roll-in': {
|
|
19
|
+
initial: Variant;
|
|
20
|
+
animate: Variant;
|
|
21
|
+
exit: Variant;
|
|
22
|
+
};
|
|
23
|
+
'roll-out': {
|
|
24
|
+
initial: Variant;
|
|
25
|
+
animate: Variant;
|
|
26
|
+
exit: Variant;
|
|
27
|
+
};
|
|
28
|
+
hinge: {
|
|
29
|
+
initial: Variant;
|
|
30
|
+
animate: Variant;
|
|
31
|
+
exit: Variant;
|
|
32
|
+
};
|
|
33
|
+
'jack-in-the-box': {
|
|
34
|
+
initial: Variant;
|
|
35
|
+
animate: Variant;
|
|
36
|
+
exit: Variant;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Variant } from 'framer-motion';
|
|
2
|
+
export declare const zoomAnimations: {
|
|
3
|
+
'zoom-in': {
|
|
4
|
+
initial: Variant;
|
|
5
|
+
animate: Variant;
|
|
6
|
+
exit: Variant;
|
|
7
|
+
};
|
|
8
|
+
'zoom-out': {
|
|
9
|
+
initial: Variant;
|
|
10
|
+
animate: Variant;
|
|
11
|
+
exit: Variant;
|
|
12
|
+
};
|
|
13
|
+
'scale-up': {
|
|
14
|
+
initial: Variant;
|
|
15
|
+
animate: Variant;
|
|
16
|
+
exit: Variant;
|
|
17
|
+
};
|
|
18
|
+
'scale-down': {
|
|
19
|
+
initial: Variant;
|
|
20
|
+
animate: Variant;
|
|
21
|
+
exit: Variant;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type AnimateTimelineLane = 'drag' | 'scroll' | 'visibility';
|
|
2
|
+
export declare function isLaneCompatible(followerLane: AnimateTimelineLane, leaderLane: AnimateTimelineLane): boolean;
|
|
3
|
+
export interface AnimateRegistrationInfo {
|
|
4
|
+
delay: number;
|
|
5
|
+
duration: number;
|
|
6
|
+
after?: string;
|
|
7
|
+
/** Concrete runtime driver. Optional only for legacy/internal callers while the
|
|
8
|
+
* registration API migrates to owner-safe leases. */
|
|
9
|
+
lane?: AnimateTimelineLane;
|
|
10
|
+
}
|
|
11
|
+
export type AnimationRegistryIssue = {
|
|
12
|
+
type: 'missing-dependency';
|
|
13
|
+
animateId: string;
|
|
14
|
+
after: string;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'circular-dependency';
|
|
17
|
+
animateId: string;
|
|
18
|
+
cycle: string[];
|
|
19
|
+
} | {
|
|
20
|
+
type: 'duplicate-id';
|
|
21
|
+
animateId: string;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'incompatible-lane';
|
|
24
|
+
animateId: string;
|
|
25
|
+
after: string;
|
|
26
|
+
followerLane: AnimateTimelineLane;
|
|
27
|
+
leaderLane: AnimateTimelineLane;
|
|
28
|
+
};
|
|
29
|
+
export interface AnimationRegistrySnapshot {
|
|
30
|
+
registrations: Map<string, AnimateRegistrationInfo>;
|
|
31
|
+
calculatedDelays: Map<string, number>;
|
|
32
|
+
issues: AnimationRegistryIssue[];
|
|
33
|
+
timelineDuration: number;
|
|
34
|
+
}
|
|
35
|
+
/** Immutable registry compilation captured by prepared scenes and transactions. */
|
|
36
|
+
export interface FrozenAnimationRegistrySnapshot {
|
|
37
|
+
readonly registrations: ReadonlyMap<string, Readonly<AnimateRegistrationInfo>>;
|
|
38
|
+
readonly calculatedDelays: ReadonlyMap<string, number>;
|
|
39
|
+
readonly issues: readonly AnimationRegistryIssue[];
|
|
40
|
+
readonly timelineDuration: number;
|
|
41
|
+
}
|
|
42
|
+
export declare function createImmutableMap<K, V>(entries: Iterable<readonly [K, V]>): ReadonlyMap<K, V>;
|
|
43
|
+
export declare function freezeAnimationRegistrySnapshot(snapshot: AnimationRegistrySnapshot): FrozenAnimationRegistrySnapshot;
|
|
44
|
+
export interface BuildAnimationRegistrySnapshotOptions {
|
|
45
|
+
baseDuration: number;
|
|
46
|
+
registrations: Map<string, AnimateRegistrationInfo>;
|
|
47
|
+
/** Driver-only declarations never enter registrations or extend timelineDuration. */
|
|
48
|
+
declaredLanes?: ReadonlyMap<string, AnimateTimelineLane>;
|
|
49
|
+
duplicateIds?: Iterable<string>;
|
|
50
|
+
}
|
|
51
|
+
export declare function buildAnimationRegistrySnapshot({ baseDuration, registrations, declaredLanes, duplicateIds, }: BuildAnimationRegistrySnapshotOptions): AnimationRegistrySnapshot;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generatedBy": "scripts/build-all.mjs",
|
|
3
|
+
"artifacts": [
|
|
4
|
+
{
|
|
5
|
+
"file": "cineview.es.mjs",
|
|
6
|
+
"module": true,
|
|
7
|
+
"budgetKB": 50,
|
|
8
|
+
"label": "全量 ESM(运行时按 mode 派发)",
|
|
9
|
+
"entry": "src/index.ts"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"file": "cineview.umd.js",
|
|
13
|
+
"module": false,
|
|
14
|
+
"budgetKB": 56,
|
|
15
|
+
"label": "全量 UMD(运行时按 mode 派发)",
|
|
16
|
+
"entry": "src/index.ts"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"file": "cineview-drag.umd.js",
|
|
20
|
+
"module": false,
|
|
21
|
+
"budgetKB": 50,
|
|
22
|
+
"label": "UMD(仅拖拽引擎)",
|
|
23
|
+
"entry": "src/entry-drag.ts"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"file": "cineview-scroll.umd.js",
|
|
27
|
+
"module": false,
|
|
28
|
+
"budgetKB": 50,
|
|
29
|
+
"label": "UMD(仅滚动引擎)",
|
|
30
|
+
"entry": "src/entry-scroll.ts"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"file": "cineview-dev.es.mjs",
|
|
34
|
+
"module": true,
|
|
35
|
+
"budgetKB": 10,
|
|
36
|
+
"label": "开发工具 ESM",
|
|
37
|
+
"entry": "src/dev/index.ts"
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
var i = {
|
|
2
|
+
blink: {
|
|
3
|
+
initial: { opacity: 1 },
|
|
4
|
+
animate: {
|
|
5
|
+
opacity: [
|
|
6
|
+
1,
|
|
7
|
+
0,
|
|
8
|
+
1,
|
|
9
|
+
0,
|
|
10
|
+
1
|
|
11
|
+
],
|
|
12
|
+
transition: {
|
|
13
|
+
duration: 1,
|
|
14
|
+
times: [
|
|
15
|
+
0,
|
|
16
|
+
0.25,
|
|
17
|
+
0.5,
|
|
18
|
+
0.75,
|
|
19
|
+
1
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
exit: { opacity: 0 }
|
|
24
|
+
},
|
|
25
|
+
flash: {
|
|
26
|
+
initial: { opacity: 0 },
|
|
27
|
+
animate: {
|
|
28
|
+
opacity: [
|
|
29
|
+
0,
|
|
30
|
+
1,
|
|
31
|
+
0,
|
|
32
|
+
1
|
|
33
|
+
],
|
|
34
|
+
transition: {
|
|
35
|
+
duration: 0.8,
|
|
36
|
+
times: [
|
|
37
|
+
0,
|
|
38
|
+
0.25,
|
|
39
|
+
0.5,
|
|
40
|
+
1
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
exit: { opacity: 0 }
|
|
45
|
+
},
|
|
46
|
+
pulse: {
|
|
47
|
+
initial: {
|
|
48
|
+
scale: 1,
|
|
49
|
+
opacity: 1
|
|
50
|
+
},
|
|
51
|
+
animate: {
|
|
52
|
+
scale: [
|
|
53
|
+
1,
|
|
54
|
+
1.05,
|
|
55
|
+
1
|
|
56
|
+
],
|
|
57
|
+
opacity: [
|
|
58
|
+
1,
|
|
59
|
+
0.8,
|
|
60
|
+
1
|
|
61
|
+
],
|
|
62
|
+
transition: {
|
|
63
|
+
duration: 1,
|
|
64
|
+
times: [
|
|
65
|
+
0,
|
|
66
|
+
0.5,
|
|
67
|
+
1
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
exit: {
|
|
72
|
+
scale: 1,
|
|
73
|
+
opacity: 0
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
export {
|
|
78
|
+
i as blinkAnimations
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=blink-BGmsrTwW.mjs.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var i = {
|
|
2
|
+
"blur-in": {
|
|
3
|
+
initial: {
|
|
4
|
+
filter: "blur(10px)",
|
|
5
|
+
opacity: 0
|
|
6
|
+
},
|
|
7
|
+
animate: {
|
|
8
|
+
filter: "blur(0px)",
|
|
9
|
+
opacity: 1
|
|
10
|
+
},
|
|
11
|
+
exit: {
|
|
12
|
+
filter: "blur(0px)",
|
|
13
|
+
opacity: 1
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"blur-out": {
|
|
17
|
+
initial: {
|
|
18
|
+
filter: "blur(0px)",
|
|
19
|
+
opacity: 1
|
|
20
|
+
},
|
|
21
|
+
animate: {
|
|
22
|
+
filter: "blur(0px)",
|
|
23
|
+
opacity: 1
|
|
24
|
+
},
|
|
25
|
+
exit: {
|
|
26
|
+
filter: "blur(10px)",
|
|
27
|
+
opacity: 0
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"focus-in": {
|
|
31
|
+
initial: {
|
|
32
|
+
filter: "blur(20px)",
|
|
33
|
+
scale: 0.8,
|
|
34
|
+
opacity: 0
|
|
35
|
+
},
|
|
36
|
+
animate: {
|
|
37
|
+
filter: "blur(0px)",
|
|
38
|
+
scale: 1,
|
|
39
|
+
opacity: 1
|
|
40
|
+
},
|
|
41
|
+
exit: {
|
|
42
|
+
filter: "blur(0px)",
|
|
43
|
+
scale: 1,
|
|
44
|
+
opacity: 1
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
export {
|
|
49
|
+
i as blurAnimations
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=blur-CQoB_VWp.mjs.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var i = {
|
|
2
|
+
bounce: {
|
|
3
|
+
initial: {
|
|
4
|
+
y: -100,
|
|
5
|
+
opacity: 0
|
|
6
|
+
},
|
|
7
|
+
animate: {
|
|
8
|
+
y: 0,
|
|
9
|
+
opacity: 1,
|
|
10
|
+
transition: {
|
|
11
|
+
type: "spring",
|
|
12
|
+
bounce: 0.5,
|
|
13
|
+
duration: 0.8
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
exit: {
|
|
17
|
+
y: 100,
|
|
18
|
+
opacity: 0
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"bounce-in": {
|
|
22
|
+
initial: {
|
|
23
|
+
scale: 0,
|
|
24
|
+
opacity: 0
|
|
25
|
+
},
|
|
26
|
+
animate: {
|
|
27
|
+
scale: 1,
|
|
28
|
+
opacity: 1,
|
|
29
|
+
transition: {
|
|
30
|
+
type: "spring",
|
|
31
|
+
bounce: 0.6,
|
|
32
|
+
duration: 0.8
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
exit: {
|
|
36
|
+
scale: 1,
|
|
37
|
+
opacity: 1
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"bounce-out": {
|
|
41
|
+
initial: {
|
|
42
|
+
scale: 1,
|
|
43
|
+
opacity: 1
|
|
44
|
+
},
|
|
45
|
+
animate: {
|
|
46
|
+
scale: 1,
|
|
47
|
+
opacity: 1
|
|
48
|
+
},
|
|
49
|
+
exit: {
|
|
50
|
+
scale: 0,
|
|
51
|
+
opacity: 0,
|
|
52
|
+
transition: {
|
|
53
|
+
type: "spring",
|
|
54
|
+
bounce: 0.6,
|
|
55
|
+
duration: 0.6
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
i as bounceAnimations
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=bounce-B_QJxgOq.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.cineview-perf-panel{z-index:999999;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);color:#e5e7eb;-webkit-user-select:none;user-select:none;background:#0a0d12f2;border:1px solid #ffffff1a;border-radius:8px;max-width:320px;font-family:SF Mono,Monaco,Cascadia Code,Consolas,monospace;font-size:11px;transition:background-color .2s,border-color .2s;position:fixed;box-shadow:0 8px 32px #0009}.cineview-perf-panel--top-left{top:16px;left:16px}.cineview-perf-panel--top-right{top:16px;right:16px}.cineview-perf-panel--bottom-left{bottom:16px;left:16px}.cineview-perf-panel--bottom-right{bottom:16px;right:16px}.cineview-perf-panel--collapsed{cursor:pointer;background:#0a0d12e6;padding:8px 12px}.cineview-perf-panel--collapsed:hover{background:#0f131cf2;border-color:#fff3}.cineview-perf-collapsed-label{letter-spacing:.02em;font-size:12px;font-weight:600}.cineview-perf-header{border-bottom:1px solid #ffffff14;justify-content:space-between;align-items:center;padding:10px 12px;display:flex}.cineview-perf-header[data-draggable=true]{cursor:grab;touch-action:none}.cineview-perf-panel[data-dragging=true] .cineview-perf-header{cursor:grabbing}.cineview-perf-title{color:#f9fafb;letter-spacing:.02em;margin:0;font-size:12px;font-weight:600}.cineview-perf-toggle{color:#9ca3af;cursor:pointer;background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;width:20px;height:20px;padding:0;font-size:16px;transition:all .15s;display:flex}.cineview-perf-toggle:hover{color:#f9fafb;background:#ffffff1a}.cineview-perf-body{flex-direction:column;gap:12px;padding:12px;display:flex}.cineview-perf-metrics{grid-template-columns:repeat(3,1fr);gap:8px;display:grid}.cineview-perf-metric{background:#ffffff08;border:1px solid #ffffff0f;border-radius:6px;flex-direction:column;align-items:center;gap:4px;padding:8px;display:flex}.cineview-perf-metric-label{color:#9ca3af;text-transform:uppercase;letter-spacing:.05em;font-size:9px;font-weight:500}.cineview-perf-metric-value{font-variant-numeric:tabular-nums;font-size:16px;font-weight:700;line-height:1}.cineview-perf-chart{background:#ffffff05;border:1px solid #ffffff0f;border-radius:6px;padding:8px 8px 24px;position:relative}.cineview-perf-chart-title{color:#9ca3af;text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px;font-size:9px;font-weight:500}.cineview-perf-chart-svg{width:100%;height:60px;display:block}.cineview-perf-chart-labels{color:#6b7280;font-variant-numeric:tabular-nums;flex-direction:column;gap:16px;font-size:8px;display:flex;position:absolute;top:32px;right:8px}.cineview-perf-stats{flex-direction:column;gap:6px;display:flex}.cineview-perf-stat{background:#ffffff05;border-radius:4px;justify-content:space-between;align-items:center;padding:6px 8px;display:flex}.cineview-perf-stat-label{color:#9ca3af;font-size:10px}.cineview-perf-stat-value{color:#e5e7eb;font-variant-numeric:tabular-nums;font-size:11px;font-weight:600}.cineview-perf-warning{color:#fbbf24;background:#fbbf241a;border:1px solid #fbbf244d;border-radius:6px;padding:8px 10px;font-size:10px;line-height:1.4}.cineview-perf-warning--critical{color:#ef4444;background:#ef44441a;border-color:#ef44444d}.cineview-perf-warning-details{opacity:.9;flex-direction:column;gap:4px;margin-top:6px;font-size:9px;display:flex}.cineview-perf-tips{color:#6ee7b7;background:#6ee7b71a;border:1px solid #6ee7b74d;border-radius:6px;padding:8px 10px;font-size:10px;line-height:1.4}@media (max-width:768px){.cineview-perf-panel{max-width:280px;font-size:10px}.cineview-perf-panel--top-left,.cineview-perf-panel--top-right{top:8px}.cineview-perf-panel--top-right,.cineview-perf-panel--bottom-right{right:8px}.cineview-perf-metrics{grid-template-columns:repeat(3,1fr);gap:6px}.cineview-perf-metric{padding:6px}.cineview-perf-metric-value{font-size:14px}}@media (prefers-color-scheme:dark){.cineview-perf-panel{background:#0a0d12fa}}@media print{.cineview-perf-panel{display:none!important}}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useRef as e,useState as i,useSyncExternalStore as r}from"react";import{jsx as a,jsxs as t}from"react/jsx-runtime";var n=new WeakMap,l=()=>null,s=()=>()=>{};function c(e,i=!0){const a=e&&i?function(e){const i=n.get(e.getPerformanceMetrics);if(i)return i;const r=function(e){let i,r=null;const a=new Set,t=()=>{const i=e.getPerformanceMetrics();r={current:i,history:[...(r?.history??[]).slice(-59),i]},a.forEach(e=>e())};return{getSnapshot:()=>r,subscribe:e=>(a.add(e),1===a.size&&(t(),i=setInterval(t,500)),()=>{a.delete(e),0===a.size&&void 0!==i&&(clearInterval(i),i=void 0)})}}(e);return n.set(e.getPerformanceMetrics,r),r}(e):null;return r(a?.subscribe??s,a?.getSnapshot??l,l)}function o({position:r="top-right",defaultExpanded:n=!0,source:l=null,enabled:s=!0,draggable:o=!0,lang:d="en"}){const[p,m]=i(n),f=e(null),v=e(null),u=c(l,s),h=u?.current??null,w=h?.fps??0,g=h?.avgFrameTime??0,b=u?.history.filter(e=>e.avgFrameTime>0).map(e=>e.fps)??[],y=null!==h&&g>32,N=null!==h&&g>50,x=w>=55?"#6ee7b7":w>=45?"#fbbf24":"#ef4444",C=g<=20?"#6ee7b7":g<=32?"#fbbf24":"#ef4444",P="zh"===d?{expand:"展开 CineView 性能面板",collapse:"收起 CineView 性能面板",title:"CineView 性能",fps:"帧率",frame:"平均帧时",loaded:"已加载代码",history:"帧率历史",memory:"内存",samples:"采样数",monitor:"监视器",waiting:"等待 CineView 引用",warning:"性能警告",issue:"性能问题",details:e=>`平均帧时:${e}(目标 <16.67ms)`,loadedTitle:"根据 Resource Timing 估算的页面 JavaScript 和 CSS,不是包 gzip 大小。"}:{expand:"Expand CineView performance panel",collapse:"Collapse CineView performance panel",title:"CineView Performance",fps:"FPS",frame:"Avg Frame",loaded:"Loaded code",history:"FPS History",memory:"Memory",samples:"Samples",monitor:"Monitor",waiting:"Waiting for CineView ref",warning:"Performance warning",issue:"Performance issue",details:e=>`Average frame time: ${e} (target <16.67ms)`,loadedTitle:"Estimated loaded page JavaScript and CSS from Resource Timing; not package gzip size."},S=e=>{v.current?.pointerId===e.pointerId&&(v.current=null,f.current?.removeAttribute("data-dragging"),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))};return p?t("section",{ref:f,className:`cineview-perf-panel cineview-perf-panel--${r}`,"aria-label":P.title,children:[t("div",{className:"cineview-perf-header",onPointerDown:e=>{if(!o||0!==e.button||e.target.closest("button"))return;const i=f.current;if(!i)return;const r=i.getBoundingClientRect();i.style.left=`${r.left}px`,i.style.top=`${r.top}px`,i.style.right="auto",i.style.bottom="auto",i.dataset.dragging="true",v.current={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,left:r.left,top:r.top},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:e=>{const i=v.current,r=f.current;!i||!r||i.pointerId!==e.pointerId||(r.style.left=`${Math.max(8,i.left+e.clientX-i.startX)}px`,r.style.top=`${Math.max(8,i.top+e.clientY-i.startY)}px`)},onPointerUp:S,onPointerCancel:S,"data-draggable":o?"true":"false",children:[a("h3",{className:"cineview-perf-title",children:P.title}),a("button",{type:"button",className:"cineview-perf-toggle",onClick:()=>m(!1),"aria-label":P.collapse,children:"−"})]}),t("div",{className:"cineview-perf-body",children:[t("div",{className:"cineview-perf-metrics",children:[t("div",{className:"cineview-perf-metric",children:[a("div",{className:"cineview-perf-metric-label",children:P.fps}),a("div",{className:"cineview-perf-metric-value",style:{color:x},children:h?w:"--"})]}),t("div",{className:"cineview-perf-metric",children:[a("div",{className:"cineview-perf-metric-label",children:P.frame}),a("div",{className:"cineview-perf-metric-value",style:{color:C},children:h?`${g.toFixed(1)}ms`:"--"})]}),t("div",{className:"cineview-perf-metric",children:[a("div",{className:"cineview-perf-metric-label",title:P.loadedTitle,children:P.loaded}),a("div",{className:"cineview-perf-metric-value",children:h?`~${h.bundleSize.toFixed(1)} KB`:"--"})]})]}),t("div",{className:"cineview-perf-chart",children:[a("div",{className:"cineview-perf-chart-title",children:P.history}),t("svg",{className:"cineview-perf-chart-svg",viewBox:"0 0 300 60",preserveAspectRatio:"none","aria-hidden":"true",children:[a("line",{x1:"0",y1:"30",x2:"300",y2:"30",stroke:"#374151",strokeWidth:"0.5",strokeDasharray:"2,2"}),a("line",{x1:"0",y1:"50",x2:"300",y2:"50",stroke:"#374151",strokeWidth:"0.5",strokeDasharray:"2,2"}),a("polyline",{points:b.map((e,i)=>`${i/Math.max(59,1)*300},${60-e/60*60}`).join(" "),fill:"none",stroke:x,strokeWidth:"2"})]}),t("div",{className:"cineview-perf-chart-labels",children:[a("span",{children:"60"}),a("span",{children:"30"}),a("span",{children:"0"})]})]}),t("div",h?{className:"cineview-perf-stats",children:[t("div",{className:"cineview-perf-stat",children:[a("span",{className:"cineview-perf-stat-label",children:P.memory}),a("span",{className:"cineview-perf-stat-value",children:void 0===h.memoryUsage?"n/a":`${h.memoryUsage.toFixed(1)} MB`})]}),t("div",{className:"cineview-perf-stat",children:[a("span",{className:"cineview-perf-stat-label",children:P.samples}),a("span",{className:"cineview-perf-stat-value",children:u?.history.length??0})]})]}:{className:"cineview-perf-stat",children:[a("span",{className:"cineview-perf-stat-label",children:P.monitor}),a("span",{className:"cineview-perf-stat-value",children:P.waiting})]}),y&&t("div",{className:"cineview-perf-warning "+(N?"cineview-perf-warning--critical":""),children:[N?P.issue:P.warning,a("div",{className:"cineview-perf-warning-details",children:P.details(`${g.toFixed(1)}ms`)})]})]})]}):a("button",{type:"button",className:`cineview-perf-panel cineview-perf-panel--collapsed cineview-perf-panel--${r}`,onClick:()=>m(!0),"aria-label":P.expand,children:t("span",{className:"cineview-perf-collapsed-label",children:[a("span",{style:{color:x},children:h?w:"--"})," fps"]})})}export{o as PerfPanel,c as usePerfMonitor};
|
|
2
|
+
//# sourceMappingURL=cineview-dev.es.mjs.map
|