app-studio 0.7.0 → 0.7.2
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/dist/app-studio.cjs.development.js +20 -4
- package/dist/app-studio.cjs.development.js.map +1 -1
- package/dist/app-studio.cjs.production.min.js +1 -1
- package/dist/app-studio.esm.js +20 -4
- package/dist/app-studio.esm.js.map +1 -1
- package/dist/app-studio.umd.development.js +20 -4
- package/dist/app-studio.umd.development.js.map +1 -1
- package/dist/app-studio.umd.production.min.js +1 -1
- package/dist/hooks/useScroll.d.ts +2 -0
- package/dist/stories/IframeSupport.stories.d.ts +1 -0
- package/dist/stories/ScrollAnimation.stories.d.ts +40 -8
- package/dist/stories/ScrollTimeline.stories.d.ts +0 -1
- package/docs/Animation.md +288 -0
- package/docs/Hooks.md +205 -10
- package/docs/IframeSupport.md +743 -0
- package/docs/Theming.md +90 -0
- package/package.json +1 -1
|
@@ -5544,7 +5544,7 @@ const useScroll = function (_temp) {
|
|
|
5544
5544
|
}, [handleScroll, disabled, getContext]);
|
|
5545
5545
|
return scrollPosition;
|
|
5546
5546
|
};
|
|
5547
|
-
// Enhanced useScrollAnimation with callback support
|
|
5547
|
+
// Enhanced useScrollAnimation with callback support and iframe support
|
|
5548
5548
|
const useScrollAnimation = function (ref, options) {
|
|
5549
5549
|
if (options === void 0) {
|
|
5550
5550
|
options = {};
|
|
@@ -5554,7 +5554,23 @@ const useScrollAnimation = function (ref, options) {
|
|
|
5554
5554
|
React.useEffect(() => {
|
|
5555
5555
|
const element = ref.current;
|
|
5556
5556
|
if (!element) return;
|
|
5557
|
-
|
|
5557
|
+
// Auto-detect iframe context from element's ownerDocument
|
|
5558
|
+
const elementWindow = element.ownerDocument?.defaultView;
|
|
5559
|
+
const targetWindow = options.targetWindow ?? elementWindow;
|
|
5560
|
+
// If no valid window context, bail out
|
|
5561
|
+
if (!targetWindow) return;
|
|
5562
|
+
// Use the IntersectionObserver from the target window context
|
|
5563
|
+
// This is crucial for iframe support - we need to use the iframe's
|
|
5564
|
+
// IntersectionObserver, not the parent window's
|
|
5565
|
+
const ObserverClass = targetWindow.IntersectionObserver;
|
|
5566
|
+
if (!ObserverClass) return;
|
|
5567
|
+
// Determine effective root:
|
|
5568
|
+
// 1. If explicit root provided, use it
|
|
5569
|
+
// 2. Otherwise use null (default viewport of the target window)
|
|
5570
|
+
// Note: When using the iframe's IntersectionObserver with null root,
|
|
5571
|
+
// it correctly observes relative to the iframe's viewport
|
|
5572
|
+
const effectiveRoot = options.root !== undefined ? options.root : null;
|
|
5573
|
+
const observer = new ObserverClass(entries => {
|
|
5558
5574
|
const entry = entries[0];
|
|
5559
5575
|
setIsInView(entry.isIntersecting);
|
|
5560
5576
|
setProgress(entry.intersectionRatio);
|
|
@@ -5562,11 +5578,11 @@ const useScrollAnimation = function (ref, options) {
|
|
|
5562
5578
|
}, {
|
|
5563
5579
|
threshold: options.threshold ?? 0,
|
|
5564
5580
|
rootMargin: options.rootMargin ?? '0px',
|
|
5565
|
-
root:
|
|
5581
|
+
root: effectiveRoot
|
|
5566
5582
|
});
|
|
5567
5583
|
observer.observe(element);
|
|
5568
5584
|
return () => observer.disconnect();
|
|
5569
|
-
}, [ref, options.threshold, options.rootMargin, options.root, options.onIntersectionChange]);
|
|
5585
|
+
}, [ref, options.threshold, options.rootMargin, options.root, options.targetWindow, options.onIntersectionChange]);
|
|
5570
5586
|
return {
|
|
5571
5587
|
isInView,
|
|
5572
5588
|
progress
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-studio.cjs.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-studio.cjs.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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