@react-motion-router/core 2.0.0-beta.sha-1c021e3 → 2.0.0-beta.sha-c601afb
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/build/MetaData.d.ts +2 -2
- package/build/NavigationBase.d.ts +2 -2
- package/build/RouterBase.d.ts +2 -2
- package/build/RouterContext.d.ts +1 -1
- package/build/ScreenBase.d.ts +14 -12
- package/build/ScreenTransitionLayer.d.ts +2 -0
- package/build/SharedElementTransitionLayer.d.ts +2 -1
- package/build/common/events.d.ts +4 -6
- package/build/common/types.d.ts +15 -0
- package/build/common/utils.d.ts +2 -1
- package/build/common/utils.js +7 -2
- package/build/common/utils.js.map +1 -1
- package/build/index.js +142 -147
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -46,6 +46,7 @@ if (true) {
|
|
|
46
46
|
/* harmony export */ "gy": () => (/* binding */ polyfillURLPattern),
|
|
47
47
|
/* harmony export */ "n4": () => (/* binding */ resolveBaseURLFromPattern),
|
|
48
48
|
/* harmony export */ "vi": () => (/* binding */ isNavigationSupported),
|
|
49
|
+
/* harmony export */ "yb": () => (/* binding */ cloneAndInject),
|
|
49
50
|
/* harmony export */ "zW": () => (/* binding */ toCamelCase)
|
|
50
51
|
/* harmony export */ });
|
|
51
52
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(810);
|
|
@@ -126,6 +127,9 @@ async function PromiseAllDynamic(values) {
|
|
|
126
127
|
function toCamelCase(value) {
|
|
127
128
|
return value.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
|
|
128
129
|
}
|
|
130
|
+
function cloneAndInject(element, injectProps) {
|
|
131
|
+
return (0,react__WEBPACK_IMPORTED_MODULE_0__.cloneElement)(element, injectProps);
|
|
132
|
+
}
|
|
129
133
|
|
|
130
134
|
|
|
131
135
|
/***/ }),
|
|
@@ -210,6 +214,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
210
214
|
"XP": () => (/* reexport */ TransitionCancelEvent),
|
|
211
215
|
"d7": () => (/* reexport */ TransitionEndEvent),
|
|
212
216
|
"sy": () => (/* reexport */ TransitionStartEvent),
|
|
217
|
+
"yb": () => (/* reexport */ utils/* cloneAndInject */.yb),
|
|
213
218
|
"Nu": () => (/* reexport */ utils/* dispatchEvent */.Nu),
|
|
214
219
|
"e1": () => (/* reexport */ utils/* includesRoute */.e1),
|
|
215
220
|
"Qv": () => (/* reexport */ isLazyExoticComponent),
|
|
@@ -349,6 +354,7 @@ class LoadEvent extends Event {
|
|
|
349
354
|
#intercepted = false;
|
|
350
355
|
#thenables = [];
|
|
351
356
|
#transition = null;
|
|
357
|
+
hasUAVisualTransition = false;
|
|
352
358
|
constructor() {
|
|
353
359
|
super('navigate', { cancelable: false, bubbles: false, composed: false });
|
|
354
360
|
const currentEntry = window.navigation.currentEntry;
|
|
@@ -379,16 +385,18 @@ class LoadEvent extends Event {
|
|
|
379
385
|
if (this.#intercepted)
|
|
380
386
|
throw new DOMException("Failed to execute 'intercept' on 'NavigateEvent': intercept() may only be called while the navigate event is being dispatched.");
|
|
381
387
|
let finish = null;
|
|
382
|
-
this.#transition
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
388
|
+
if (!this.#transition) {
|
|
389
|
+
this.#transition = {
|
|
390
|
+
finished: new Promise((resolve) => finish = resolve),
|
|
391
|
+
from: window.navigation.currentEntry,
|
|
392
|
+
navigationType: "load"
|
|
393
|
+
};
|
|
394
|
+
}
|
|
387
395
|
const thenable = options?.handler?.();
|
|
388
396
|
if (thenable)
|
|
389
397
|
this.#thenables.push(thenable);
|
|
390
398
|
if (this.#thenables.length === 1) {
|
|
391
|
-
|
|
399
|
+
(0,utils/* PromiseAllDynamic */.DM)(this.#thenables).then(() => {
|
|
392
400
|
this.#intercepted = true;
|
|
393
401
|
window.removeEventListener('navigate', this.#onNavigate);
|
|
394
402
|
finish?.();
|
|
@@ -467,7 +475,7 @@ class ScreenTransitionProvider extends external_react_.Component {
|
|
|
467
475
|
}
|
|
468
476
|
get animationEffect() {
|
|
469
477
|
const animationEffectFactory = this.props.animation;
|
|
470
|
-
const { animation, direction } = this.context;
|
|
478
|
+
const { animation, direction, hasUAVisualTransition } = this.context;
|
|
471
479
|
const { timeline, playbackRate } = animation;
|
|
472
480
|
const { index, exiting, ref } = this;
|
|
473
481
|
return animationEffectFactory?.({
|
|
@@ -476,7 +484,8 @@ class ScreenTransitionProvider extends external_react_.Component {
|
|
|
476
484
|
exiting,
|
|
477
485
|
timeline,
|
|
478
486
|
direction,
|
|
479
|
-
playbackRate
|
|
487
|
+
playbackRate,
|
|
488
|
+
hasUAVisualTransition
|
|
480
489
|
}) ?? null;
|
|
481
490
|
}
|
|
482
491
|
setZIndex(zIndex) {
|
|
@@ -562,44 +571,36 @@ class ScreenBase extends external_react_.Component {
|
|
|
562
571
|
static contextType = RouterContext;
|
|
563
572
|
state = {
|
|
564
573
|
focused: false,
|
|
574
|
+
config: {},
|
|
575
|
+
params: {},
|
|
565
576
|
elementType: 'div'
|
|
566
577
|
};
|
|
567
578
|
constructor(props, context) {
|
|
568
579
|
super(props);
|
|
569
|
-
this.sharedElementScene = new SharedElementScene(`${this.
|
|
580
|
+
this.sharedElementScene = new SharedElementScene(`${this.name}-shared-element-scene`);
|
|
570
581
|
this.sharedElementScene.getScreenRect = () => this.ref.current?.getBoundingClientRect() || new DOMRect();
|
|
571
582
|
this.nestedRouterData = { parentScreen: this, parentRouter: context };
|
|
572
583
|
}
|
|
573
|
-
setParams(
|
|
574
|
-
params
|
|
575
|
-
...this.routeProp.params,
|
|
576
|
-
...params
|
|
577
|
-
};
|
|
578
|
-
const config = this.routeProp.config;
|
|
579
|
-
this.context.screenState.set(this.props.path, { config, params });
|
|
580
|
-
this.forceUpdate();
|
|
581
|
-
}
|
|
582
|
-
setConfig(config) {
|
|
583
|
-
config = {
|
|
584
|
-
...this.routeProp.config,
|
|
585
|
-
...config
|
|
586
|
-
};
|
|
587
|
-
const params = this.routeProp.params;
|
|
588
|
-
this.context.screenState.set(this.props.path, { config, params });
|
|
589
|
-
this.forceUpdate();
|
|
584
|
+
setParams(newParams) {
|
|
585
|
+
this.setState(({ params }) => ({ params: { ...params, ...newParams } }));
|
|
590
586
|
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
return this.props.id;
|
|
594
|
-
return this.props.path
|
|
595
|
-
.toLowerCase()
|
|
596
|
-
.replace(/[^\w-]/g, '-') // Remove non-alphanumeric chars
|
|
597
|
-
.replace(/-+/g, '-') // Replace multiple hyphens with a single one
|
|
598
|
-
.replace(/^-|-$/g, ''); // Remove leading and trailing hyphens;
|
|
587
|
+
setConfig(newConfig) {
|
|
588
|
+
this.setState(({ config }) => ({ config: { ...config, ...newConfig } }));
|
|
599
589
|
}
|
|
600
590
|
get focused() {
|
|
601
591
|
return this.state.focused;
|
|
602
592
|
}
|
|
593
|
+
get name() {
|
|
594
|
+
if (this.props.name)
|
|
595
|
+
return this.props.name
|
|
596
|
+
.toLowerCase()
|
|
597
|
+
.replace(/[^\w-]/g, '-') // Remove non-alphanumeric chars
|
|
598
|
+
.replace(/-+/g, '-') // Replace multiple hyphens with a single one
|
|
599
|
+
.replace(/^-|-$/g, ''); // Remove leading and trailing hyphens;
|
|
600
|
+
else if (isLazyExoticComponent(this.props.component))
|
|
601
|
+
return this.props.component.module?.default.name.toLowerCase();
|
|
602
|
+
return this.props.component.name.toLowerCase();
|
|
603
|
+
}
|
|
603
604
|
blur() {
|
|
604
605
|
return new Promise(resolve => this.setState({ focused: false }, resolve));
|
|
605
606
|
}
|
|
@@ -648,9 +649,6 @@ class ScreenBase extends external_react_.Component {
|
|
|
648
649
|
signal
|
|
649
650
|
});
|
|
650
651
|
}
|
|
651
|
-
get resolvedPathname() {
|
|
652
|
-
return this.props.resolvedPathname;
|
|
653
|
-
}
|
|
654
652
|
get path() {
|
|
655
653
|
return this.props.path;
|
|
656
654
|
}
|
|
@@ -663,7 +661,7 @@ class ScreenBase extends external_react_.Component {
|
|
|
663
661
|
const Component = this.props.component;
|
|
664
662
|
const HeaderComponent = routeProp.config.header?.component;
|
|
665
663
|
const FooterComponent = routeProp.config.footer?.component;
|
|
666
|
-
return ((0,jsx_runtime.jsx)(ScreenTransitionProvider, { ref: this.#transitionProvider, renderAs: this.state.elementType, id: `${this.id}-transition-provider`, animation: routeProp.config.animation, navigation: navigation, focused: this.state.focused, children: (0,jsx_runtime.jsx)("div", { id: this.id
|
|
664
|
+
return ((0,jsx_runtime.jsx)(ScreenTransitionProvider, { ref: this.#transitionProvider, renderAs: this.state.elementType, id: `${this.context.id}-${this.name}-transition-provider`, animation: routeProp.config.animation, navigation: navigation, focused: this.state.focused, children: (0,jsx_runtime.jsx)("div", { id: `${this.context.id}-${this.id}`, ref: this.ref, className: "screen", style: {
|
|
667
665
|
height: '100%',
|
|
668
666
|
width: '100%',
|
|
669
667
|
display: 'flex',
|
|
@@ -677,15 +675,15 @@ function ComponentWithRouteProps({ component, route, navigation }) {
|
|
|
677
675
|
component = component.module.default;
|
|
678
676
|
}
|
|
679
677
|
const Component = component ?? null;
|
|
680
|
-
if ((
|
|
678
|
+
if (typeof Component === "function" || isNativeLazyExoticComponent(Component)) {
|
|
679
|
+
return ((0,jsx_runtime.jsx)(Component, { navigation: navigation, route: route }));
|
|
680
|
+
}
|
|
681
|
+
else if ((0,external_react_.isValidElement)(Component)) {
|
|
681
682
|
return (0,external_react_.cloneElement)(Component, {
|
|
682
683
|
navigation,
|
|
683
684
|
route
|
|
684
685
|
});
|
|
685
686
|
}
|
|
686
|
-
else if (typeof Component === "function" || isNativeLazyExoticComponent(Component)) {
|
|
687
|
-
return ((0,jsx_runtime.jsx)(Component, { navigation: navigation, route: route }));
|
|
688
|
-
}
|
|
689
687
|
return (0,jsx_runtime.jsx)(jsx_runtime.Fragment, { children: Component });
|
|
690
688
|
}
|
|
691
689
|
|
|
@@ -761,6 +759,8 @@ class SharedElementTransitionLayer extends external_react_.Component {
|
|
|
761
759
|
return computedStyles;
|
|
762
760
|
}
|
|
763
761
|
copyStyles(srcElement, cloneElement, styleList) {
|
|
762
|
+
if (!isStylableElement(srcElement))
|
|
763
|
+
return;
|
|
764
764
|
const computedStyles = window.getComputedStyle(srcElement);
|
|
765
765
|
for (const key of styleList) {
|
|
766
766
|
const value = computedStyles.getPropertyValue(key);
|
|
@@ -773,65 +773,66 @@ class SharedElementTransitionLayer extends external_react_.Component {
|
|
|
773
773
|
const startRect = start.instance.getBoundingClientRect();
|
|
774
774
|
const endRect = end.instance.getBoundingClientRect();
|
|
775
775
|
const config = {
|
|
776
|
-
fill: "
|
|
776
|
+
fill: "both",
|
|
777
777
|
duration: "auto",
|
|
778
778
|
easing: "ease",
|
|
779
|
-
...start.instance.props.config,
|
|
780
|
-
...end.instance.props.config
|
|
781
779
|
};
|
|
782
|
-
const transitionType = end.instance.transitionType
|
|
780
|
+
const transitionType = end.instance.transitionType;
|
|
783
781
|
const startTransform = `translate(${startRect.x}px, ${startRect.y}px)`;
|
|
784
782
|
const endTransform = `translate(${endRect.x}px, ${endRect.y}px)`;
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
783
|
+
switch (transitionType) {
|
|
784
|
+
case "fade":
|
|
785
|
+
keyframeEffects.push(new KeyframeEffect(start.clone, [
|
|
786
|
+
{ transform: startTransform, opacity: 1 },
|
|
787
|
+
{ transform: endTransform, opacity: 0 }
|
|
788
|
+
], config));
|
|
789
|
+
keyframeEffects.push(new KeyframeEffect(end.clone, [
|
|
790
|
+
{ transform: startTransform },
|
|
791
|
+
{ transform: endTransform }
|
|
792
|
+
], config));
|
|
793
|
+
break;
|
|
794
|
+
case "fade-through":
|
|
795
|
+
keyframeEffects.push(new KeyframeEffect(start.clone, [
|
|
796
|
+
{ transform: startTransform, opacity: 1 },
|
|
797
|
+
{ opacity: 0, offset: 0.5 },
|
|
798
|
+
{ transform: endTransform, opacity: 0 }
|
|
799
|
+
], config));
|
|
800
|
+
keyframeEffects.push(new KeyframeEffect(end.clone, [
|
|
801
|
+
{ transform: startTransform, opacity: 0 },
|
|
802
|
+
{ opacity: 0, offset: 0.5 },
|
|
803
|
+
{ transform: endTransform, opacity: 1 }
|
|
804
|
+
], config));
|
|
805
|
+
break;
|
|
806
|
+
case "cross-fade":
|
|
807
|
+
end.clone.style.mixBlendMode = "plus-lighter";
|
|
808
|
+
keyframeEffects.push(new KeyframeEffect(start.clone, [
|
|
809
|
+
{ transform: startTransform, opacity: 1 },
|
|
810
|
+
{ transform: endTransform, opacity: 0 }
|
|
811
|
+
], config));
|
|
812
|
+
keyframeEffects.push(new KeyframeEffect(end.clone, [
|
|
813
|
+
{ transform: startTransform },
|
|
814
|
+
{ transform: endTransform }
|
|
815
|
+
], config));
|
|
816
|
+
break;
|
|
817
|
+
case "morph": {
|
|
818
|
+
const styleList = Array.from(new Set([...start.instance.styles, ...end.instance.styles]));
|
|
819
|
+
keyframeEffects.push(new KeyframeEffect(end.clone, [
|
|
820
|
+
{
|
|
821
|
+
...Object.fromEntries((start.instance.ref.current?.firstElementChild).attributeStyleMap),
|
|
822
|
+
transform: startTransform,
|
|
823
|
+
width: `${startRect.width}px`,
|
|
824
|
+
height: `${startRect.height}px`,
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
...Object.fromEntries((end.instance.ref.current?.firstElementChild).attributeStyleMap),
|
|
828
|
+
...this.getKeyframeProperties(end.instance.ref.current?.firstElementChild, styleList),
|
|
829
|
+
transform: endTransform,
|
|
830
|
+
width: `${endRect.width}px`,
|
|
831
|
+
height: `${endRect.height}px`,
|
|
832
|
+
}
|
|
833
|
+
], config));
|
|
834
|
+
break;
|
|
835
|
+
}
|
|
835
836
|
}
|
|
836
837
|
return new external_web_animations_extension_namespaceObject.ParallelEffect(keyframeEffects);
|
|
837
838
|
}
|
|
@@ -847,40 +848,39 @@ class SharedElementTransitionLayer extends external_react_.Component {
|
|
|
847
848
|
const parallelEffects = new Array();
|
|
848
849
|
for (const [id, end] of Array.from(nextScene.nodes.entries())) {
|
|
849
850
|
const start = currentScene.nodes.get(id);
|
|
850
|
-
if (start?.canTransition
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
}
|
|
867
|
-
else if (isStylableElement(start.ref.current?.firstElementChild)) {
|
|
868
|
-
this.copyStyles(start.ref.current.firstElementChild, endClone, styleList);
|
|
869
|
-
}
|
|
870
|
-
endClone.id = `${id}${end.transitionType === "morph" ? '' : '-end'}`;
|
|
871
|
-
endClone.style.position = "absolute";
|
|
872
|
-
this.ref.current?.prepend(endClone);
|
|
873
|
-
start.hide();
|
|
874
|
-
end.hide();
|
|
875
|
-
const onFinish = () => {
|
|
876
|
-
end.unhide();
|
|
877
|
-
endClone.remove();
|
|
878
|
-
startClone.remove();
|
|
879
|
-
};
|
|
880
|
-
this.props.navigation.addEventListener('transition-end', onFinish, { once: true });
|
|
881
|
-
this.props.navigation.addEventListener('transition-cancel', onFinish, { once: true });
|
|
882
|
-
parallelEffects.push(this.getAnimationEffect({ instance: start, clone: startClone }, { instance: end, clone: endClone }));
|
|
851
|
+
if (!start?.canTransition || !end.canTransition)
|
|
852
|
+
continue;
|
|
853
|
+
const endClone = end.clone();
|
|
854
|
+
const startClone = start.clone();
|
|
855
|
+
if (!startClone || !endClone)
|
|
856
|
+
continue;
|
|
857
|
+
const styleList = Array.from(new Set([...start.styles, ...end.styles, 'width', 'height']));
|
|
858
|
+
if (end.transitionType !== "morph") {
|
|
859
|
+
startClone.id = `${id}-start`;
|
|
860
|
+
startClone.style.position = "absolute";
|
|
861
|
+
this.copyStyles(start.ref.current?.firstElementChild, startClone, styleList);
|
|
862
|
+
this.copyStyles(end.ref.current?.firstElementChild, endClone, styleList);
|
|
863
|
+
this.ref.current?.prepend(startClone);
|
|
864
|
+
}
|
|
865
|
+
else if (isStylableElement(start.ref.current?.firstElementChild)) {
|
|
866
|
+
this.copyStyles(start.ref.current.firstElementChild, endClone, styleList);
|
|
883
867
|
}
|
|
868
|
+
endClone.id = `${id}${end.transitionType === "morph" ? '' : '-end'}`;
|
|
869
|
+
endClone.style.position = "absolute";
|
|
870
|
+
this.ref.current?.prepend(endClone);
|
|
871
|
+
start.hide();
|
|
872
|
+
end.hide();
|
|
873
|
+
const onFinish = async () => {
|
|
874
|
+
if (this.props.direction === "forwards")
|
|
875
|
+
end.unhide();
|
|
876
|
+
else
|
|
877
|
+
start.unhide();
|
|
878
|
+
endClone.remove();
|
|
879
|
+
startClone.remove();
|
|
880
|
+
};
|
|
881
|
+
this.props.navigation.addEventListener('transition-end', onFinish, { once: true });
|
|
882
|
+
this.props.navigation.addEventListener('transition-cancel', onFinish, { once: true });
|
|
883
|
+
parallelEffects.push(this.getAnimationEffect({ instance: start, clone: startClone }, { instance: end, clone: endClone }));
|
|
884
884
|
}
|
|
885
885
|
return new external_web_animations_extension_namespaceObject.ParallelEffect(parallelEffects);
|
|
886
886
|
}
|
|
@@ -955,6 +955,9 @@ class ScreenTransitionLayer extends external_react_.Component {
|
|
|
955
955
|
get direction() {
|
|
956
956
|
return this.#direction;
|
|
957
957
|
}
|
|
958
|
+
get hasUAVisualTransition() {
|
|
959
|
+
return this.props.hasUAVisualTransition;
|
|
960
|
+
}
|
|
958
961
|
transition() {
|
|
959
962
|
const effect = new external_web_animations_extension_namespaceObject.ParallelEffect(this.screens.map(screen => {
|
|
960
963
|
return screen.current?.transitionProvider?.current?.animationEffect ?? null;
|
|
@@ -985,10 +988,12 @@ class ScreenTransitionLayer extends external_react_.Component {
|
|
|
985
988
|
return this.animation;
|
|
986
989
|
}
|
|
987
990
|
render() {
|
|
988
|
-
return ((0,jsx_runtime.jsxs)(ScreenTransitionLayerContext.Provider, { value: this, children: [(0,jsx_runtime.jsx)(SharedElementTransitionLayer, { ref: this.sharedElementTransitionLayer, navigation: this.props.navigation }), (0,jsx_runtime.jsx)("div", { className: "screen-transition-layer", style: {
|
|
991
|
+
return ((0,jsx_runtime.jsxs)(ScreenTransitionLayerContext.Provider, { value: this, children: [(0,jsx_runtime.jsx)(SharedElementTransitionLayer, { ref: this.sharedElementTransitionLayer, navigation: this.props.navigation, direction: this.animation.playbackRate > 0 ? "forwards" : "backwards" }), (0,jsx_runtime.jsx)("div", { className: "screen-transition-layer", style: {
|
|
989
992
|
width: '100%',
|
|
990
993
|
height: '100%',
|
|
991
994
|
display: 'grid',
|
|
995
|
+
contain: 'layout',
|
|
996
|
+
isolation: 'isolate',
|
|
992
997
|
'--motion-progress': this.state.progress
|
|
993
998
|
}, children: (0,jsx_runtime.jsx)(MotionContext.Provider, { value: this.state.progress, children: this.props.children }) })] }));
|
|
994
999
|
}
|
|
@@ -1004,10 +1009,10 @@ class ScreenTransitionLayer extends external_react_.Component {
|
|
|
1004
1009
|
class RouterBase extends external_react_.Component {
|
|
1005
1010
|
ref = (0,external_react_.createRef)();
|
|
1006
1011
|
screenTransitionLayer = (0,external_react_.createRef)();
|
|
1007
|
-
screenState = new Map();
|
|
1008
1012
|
parent = null;
|
|
1009
1013
|
#child = null;
|
|
1010
1014
|
loadDispatched = false;
|
|
1015
|
+
hasUAVisualTransition = false;
|
|
1011
1016
|
parentScreen = null;
|
|
1012
1017
|
static rootRouterRef = null;
|
|
1013
1018
|
static contextType = NestedRouterContext;
|
|
@@ -1045,6 +1050,7 @@ class RouterBase extends external_react_.Component {
|
|
|
1045
1050
|
router = router.child;
|
|
1046
1051
|
}
|
|
1047
1052
|
router.intercept(e);
|
|
1053
|
+
this.hasUAVisualTransition = e.hasUAVisualTransition;
|
|
1048
1054
|
};
|
|
1049
1055
|
getRouterById(routerId, target) {
|
|
1050
1056
|
const router = target ?? RouterBase.rootRouterRef?.deref();
|
|
@@ -1083,10 +1089,7 @@ class RouterBase extends external_react_.Component {
|
|
|
1083
1089
|
if (!matchInfo)
|
|
1084
1090
|
return;
|
|
1085
1091
|
found = true;
|
|
1086
|
-
const config =
|
|
1087
|
-
...this.screenState.get(path)?.config,
|
|
1088
|
-
...route.props.config
|
|
1089
|
-
};
|
|
1092
|
+
const config = route.props.config;
|
|
1090
1093
|
queueMicrotask(async () => {
|
|
1091
1094
|
const preloadTasks = [];
|
|
1092
1095
|
if ('load' in route.props.component) {
|
|
@@ -1168,7 +1171,7 @@ class RouterBase extends external_react_.Component {
|
|
|
1168
1171
|
render() {
|
|
1169
1172
|
if (!this.navigation)
|
|
1170
1173
|
return;
|
|
1171
|
-
return ((0,jsx_runtime.jsx)("div", { id: this.id, className: "react-motion-router", style: { width: '100%', height: '100%' }, ref: this.ref, children: (0,jsx_runtime.jsx)(RouterContext.Provider, { value: this, children: (0,jsx_runtime.jsx)(ScreenTransitionLayer, { ref: this.screenTransitionLayer, navigation: this.navigation, children: this.screens }) }) }));
|
|
1174
|
+
return ((0,jsx_runtime.jsx)("div", { id: this.id, className: "react-motion-router", style: { width: '100%', height: '100%' }, ref: this.ref, children: (0,jsx_runtime.jsx)(RouterContext.Provider, { value: this, children: (0,jsx_runtime.jsx)(ScreenTransitionLayer, { ref: this.screenTransitionLayer, navigation: this.navigation, hasUAVisualTransition: this.hasUAVisualTransition, children: this.screens }) }) }));
|
|
1172
1175
|
}
|
|
1173
1176
|
}
|
|
1174
1177
|
|
|
@@ -1301,11 +1304,9 @@ class MetaData {
|
|
|
1301
1304
|
;// CONCATENATED MODULE: ./src/NavigationBase.ts
|
|
1302
1305
|
|
|
1303
1306
|
class NavigationBase {
|
|
1304
|
-
router;
|
|
1305
1307
|
static rootNavigatorRef = null;
|
|
1306
1308
|
metaData = new MetaData();
|
|
1307
|
-
constructor(
|
|
1308
|
-
this.router = router;
|
|
1309
|
+
constructor() {
|
|
1309
1310
|
const rootNavigator = NavigationBase.rootNavigatorRef?.deref();
|
|
1310
1311
|
if (!rootNavigator || !rootNavigator.isInDocument)
|
|
1311
1312
|
NavigationBase.rootNavigatorRef = new WeakRef(this);
|
|
@@ -1384,13 +1385,6 @@ const MAX_NORM_PROGRESS = 1;
|
|
|
1384
1385
|
|
|
1385
1386
|
;// CONCATENATED MODULE: ./src/index.ts
|
|
1386
1387
|
/// <reference types="urlpattern-polyfill" />
|
|
1387
|
-
document.body.style.position = 'fixed';
|
|
1388
|
-
document.body.style.inset = '0';
|
|
1389
|
-
let root = document.getElementById('root');
|
|
1390
|
-
if (root) {
|
|
1391
|
-
root.style.width = '100%';
|
|
1392
|
-
root.style.height = '100%';
|
|
1393
|
-
}
|
|
1394
1388
|
|
|
1395
1389
|
|
|
1396
1390
|
|
|
@@ -1425,6 +1419,7 @@ var __webpack_exports__SharedElement = __webpack_exports__.rJ;
|
|
|
1425
1419
|
var __webpack_exports__TransitionCancelEvent = __webpack_exports__.XP;
|
|
1426
1420
|
var __webpack_exports__TransitionEndEvent = __webpack_exports__.d7;
|
|
1427
1421
|
var __webpack_exports__TransitionStartEvent = __webpack_exports__.sy;
|
|
1422
|
+
var __webpack_exports__cloneAndInject = __webpack_exports__.yb;
|
|
1428
1423
|
var __webpack_exports__dispatchEvent = __webpack_exports__.Nu;
|
|
1429
1424
|
var __webpack_exports__includesRoute = __webpack_exports__.e1;
|
|
1430
1425
|
var __webpack_exports__isLazyExoticComponent = __webpack_exports__.Qv;
|
|
@@ -1443,6 +1438,6 @@ var __webpack_exports__useMotion = __webpack_exports__.nc;
|
|
|
1443
1438
|
var __webpack_exports__useNavigationBase = __webpack_exports__.ev;
|
|
1444
1439
|
var __webpack_exports__useRouteBase = __webpack_exports__.qr;
|
|
1445
1440
|
var __webpack_exports__useRouterBase = __webpack_exports__.yL;
|
|
1446
|
-
export { __webpack_exports__LoadEvent as LoadEvent, __webpack_exports__MAX_NORM_PROGRESS as MAX_NORM_PROGRESS, __webpack_exports__MAX_PROGRESS as MAX_PROGRESS, __webpack_exports__MAX_Z_INDEX as MAX_Z_INDEX, __webpack_exports__MIN_NORM_PROGRESS as MIN_NORM_PROGRESS, __webpack_exports__MIN_PROGRESS as MIN_PROGRESS, __webpack_exports__MotionContext as MotionContext, __webpack_exports__MotionProgressEndEvent as MotionProgressEndEvent, __webpack_exports__MotionProgressEvent as MotionProgressEvent, __webpack_exports__MotionProgressStartEvent as MotionProgressStartEvent, __webpack_exports__NavigationBase as NavigationBase, __webpack_exports__NestedRouterContext as NestedRouterContext, __webpack_exports__PromiseAllDynamic as PromiseAllDynamic, __webpack_exports__RouterBase as RouterBase, __webpack_exports__RouterContext as RouterContext, __webpack_exports__ScreenBase as ScreenBase, __webpack_exports__SharedElement as SharedElement, __webpack_exports__TransitionCancelEvent as TransitionCancelEvent, __webpack_exports__TransitionEndEvent as TransitionEndEvent, __webpack_exports__TransitionStartEvent as TransitionStartEvent, __webpack_exports__dispatchEvent as dispatchEvent, __webpack_exports__includesRoute as includesRoute, __webpack_exports__isLazyExoticComponent as isLazyExoticComponent, __webpack_exports__isNativeLazyExoticComponent as isNativeLazyExoticComponent, __webpack_exports__isNavigationSupported as isNavigationSupported, __webpack_exports__isStylableElement as isStylableElement, __webpack_exports__isURLPatternSupported as isURLPatternSupported, __webpack_exports__isValidScreenChild as isValidScreenChild, __webpack_exports__lazy as lazy, __webpack_exports__matchRoute as matchRoute, __webpack_exports__polyfillNavigation as polyfillNavigation, __webpack_exports__polyfillURLPattern as polyfillURLPattern, __webpack_exports__resolveBaseURLFromPattern as resolveBaseURLFromPattern, __webpack_exports__toCamelCase as toCamelCase, __webpack_exports__useMotion as useMotion, __webpack_exports__useNavigationBase as useNavigationBase, __webpack_exports__useRouteBase as useRouteBase, __webpack_exports__useRouterBase as useRouterBase };
|
|
1441
|
+
export { __webpack_exports__LoadEvent as LoadEvent, __webpack_exports__MAX_NORM_PROGRESS as MAX_NORM_PROGRESS, __webpack_exports__MAX_PROGRESS as MAX_PROGRESS, __webpack_exports__MAX_Z_INDEX as MAX_Z_INDEX, __webpack_exports__MIN_NORM_PROGRESS as MIN_NORM_PROGRESS, __webpack_exports__MIN_PROGRESS as MIN_PROGRESS, __webpack_exports__MotionContext as MotionContext, __webpack_exports__MotionProgressEndEvent as MotionProgressEndEvent, __webpack_exports__MotionProgressEvent as MotionProgressEvent, __webpack_exports__MotionProgressStartEvent as MotionProgressStartEvent, __webpack_exports__NavigationBase as NavigationBase, __webpack_exports__NestedRouterContext as NestedRouterContext, __webpack_exports__PromiseAllDynamic as PromiseAllDynamic, __webpack_exports__RouterBase as RouterBase, __webpack_exports__RouterContext as RouterContext, __webpack_exports__ScreenBase as ScreenBase, __webpack_exports__SharedElement as SharedElement, __webpack_exports__TransitionCancelEvent as TransitionCancelEvent, __webpack_exports__TransitionEndEvent as TransitionEndEvent, __webpack_exports__TransitionStartEvent as TransitionStartEvent, __webpack_exports__cloneAndInject as cloneAndInject, __webpack_exports__dispatchEvent as dispatchEvent, __webpack_exports__includesRoute as includesRoute, __webpack_exports__isLazyExoticComponent as isLazyExoticComponent, __webpack_exports__isNativeLazyExoticComponent as isNativeLazyExoticComponent, __webpack_exports__isNavigationSupported as isNavigationSupported, __webpack_exports__isStylableElement as isStylableElement, __webpack_exports__isURLPatternSupported as isURLPatternSupported, __webpack_exports__isValidScreenChild as isValidScreenChild, __webpack_exports__lazy as lazy, __webpack_exports__matchRoute as matchRoute, __webpack_exports__polyfillNavigation as polyfillNavigation, __webpack_exports__polyfillURLPattern as polyfillURLPattern, __webpack_exports__resolveBaseURLFromPattern as resolveBaseURLFromPattern, __webpack_exports__toCamelCase as toCamelCase, __webpack_exports__useMotion as useMotion, __webpack_exports__useNavigationBase as useNavigationBase, __webpack_exports__useRouteBase as useRouteBase, __webpack_exports__useRouterBase as useRouterBase };
|
|
1447
1442
|
|
|
1448
1443
|
//# sourceMappingURL=index.js.map
|