@player-ui/auto-scroll-manager-plugin-react 0.3.1-next.1 → 0.4.0--canary.85.4368
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/index.cjs.js +10 -6
- package/dist/index.esm.js +10 -6
- package/package.json +2 -2
- package/src/hooks.tsx +2 -2
- package/src/plugin.tsx +8 -7
package/dist/index.cjs.js
CHANGED
|
@@ -39,8 +39,8 @@ const AutoScrollProvider = ({
|
|
|
39
39
|
const node = document.getElementById(getElementToScrollTo(scrollableMap));
|
|
40
40
|
if (node) {
|
|
41
41
|
scrollIntoView__default["default"](node, {
|
|
42
|
-
block: "
|
|
43
|
-
inline: "
|
|
42
|
+
block: "center",
|
|
43
|
+
inline: "center"
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
});
|
|
@@ -67,7 +67,10 @@ class AutoScrollManagerPlugin {
|
|
|
67
67
|
this.scrollFn = this.calculateScroll.bind(this);
|
|
68
68
|
}
|
|
69
69
|
getFirstScrollableElement(idList, type) {
|
|
70
|
-
const highestElement = {
|
|
70
|
+
const highestElement = {
|
|
71
|
+
id: "",
|
|
72
|
+
ypos: 0
|
|
73
|
+
};
|
|
71
74
|
const ypos = window.scrollY;
|
|
72
75
|
idList.forEach((id) => {
|
|
73
76
|
const element = document.getElementById(id);
|
|
@@ -116,9 +119,10 @@ class AutoScrollManagerPlugin {
|
|
|
116
119
|
this.failedNavigation = false;
|
|
117
120
|
this.alreadyScrolledTo = [];
|
|
118
121
|
});
|
|
119
|
-
flow.hooks.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
+
flow.hooks.skipTransition.intercept({
|
|
123
|
+
call: () => {
|
|
124
|
+
this.failedNavigation = true;
|
|
125
|
+
}
|
|
122
126
|
});
|
|
123
127
|
});
|
|
124
128
|
});
|
package/dist/index.esm.js
CHANGED
|
@@ -30,8 +30,8 @@ const AutoScrollProvider = ({
|
|
|
30
30
|
const node = document.getElementById(getElementToScrollTo(scrollableMap));
|
|
31
31
|
if (node) {
|
|
32
32
|
scrollIntoView(node, {
|
|
33
|
-
block: "
|
|
34
|
-
inline: "
|
|
33
|
+
block: "center",
|
|
34
|
+
inline: "center"
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
});
|
|
@@ -58,7 +58,10 @@ class AutoScrollManagerPlugin {
|
|
|
58
58
|
this.scrollFn = this.calculateScroll.bind(this);
|
|
59
59
|
}
|
|
60
60
|
getFirstScrollableElement(idList, type) {
|
|
61
|
-
const highestElement = {
|
|
61
|
+
const highestElement = {
|
|
62
|
+
id: "",
|
|
63
|
+
ypos: 0
|
|
64
|
+
};
|
|
62
65
|
const ypos = window.scrollY;
|
|
63
66
|
idList.forEach((id) => {
|
|
64
67
|
const element = document.getElementById(id);
|
|
@@ -107,9 +110,10 @@ class AutoScrollManagerPlugin {
|
|
|
107
110
|
this.failedNavigation = false;
|
|
108
111
|
this.alreadyScrolledTo = [];
|
|
109
112
|
});
|
|
110
|
-
flow.hooks.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
flow.hooks.skipTransition.intercept({
|
|
114
|
+
call: () => {
|
|
115
|
+
this.failedNavigation = true;
|
|
116
|
+
}
|
|
113
117
|
});
|
|
114
118
|
});
|
|
115
119
|
});
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@player-ui/auto-scroll-manager-plugin-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0--canary.85.4368",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
7
7
|
},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@player-ui/react": "0.
|
|
9
|
+
"@player-ui/react": "0.4.0--canary.85.4368"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"smooth-scroll-into-view-if-needed": "1.1.32",
|
package/src/hooks.tsx
CHANGED
package/src/plugin.tsx
CHANGED
|
@@ -48,7 +48,10 @@ export class AutoScrollManagerPlugin implements ReactPlayerPlugin {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
getFirstScrollableElement(idList: Set<string>, type: ScrollType) {
|
|
51
|
-
const highestElement = {
|
|
51
|
+
const highestElement = {
|
|
52
|
+
id: '',
|
|
53
|
+
ypos: 0,
|
|
54
|
+
};
|
|
52
55
|
const ypos = window.scrollY;
|
|
53
56
|
idList.forEach((id) => {
|
|
54
57
|
const element = document.getElementById(id);
|
|
@@ -126,12 +129,10 @@ export class AutoScrollManagerPlugin implements ReactPlayerPlugin {
|
|
|
126
129
|
this.failedNavigation = false;
|
|
127
130
|
this.alreadyScrolledTo = [];
|
|
128
131
|
});
|
|
129
|
-
flow.hooks.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return state;
|
|
132
|
+
flow.hooks.skipTransition.intercept({
|
|
133
|
+
call: () => {
|
|
134
|
+
this.failedNavigation = true;
|
|
135
|
+
},
|
|
135
136
|
});
|
|
136
137
|
});
|
|
137
138
|
});
|