@salesforcedevs/dx-components 1.37.0 → 1.37.1-new-content-type-alpha
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/package.json
CHANGED
|
@@ -1,48 +1,47 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
2
|
+
"name": "@salesforcedevs/dx-components",
|
|
3
|
+
"version": "1.37.1-new-content-type-alpha",
|
|
4
|
+
"description": "DX Lightning web components",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": "22.x"
|
|
8
|
+
},
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@coveo/headless": "3.22.2",
|
|
14
|
+
"@floating-ui/dom": "1.5.1",
|
|
15
|
+
"@optimizely/optimizely-sdk": "5.3.0",
|
|
16
|
+
"@shikijs/colorized-brackets": "^3.12.2",
|
|
17
|
+
"@types/throttle-debounce": "5.0.2",
|
|
18
|
+
"@vimeo/player": "2.22.0",
|
|
19
|
+
"classnames": "2.5.1",
|
|
20
|
+
"composed-offset-position": "0.0.4",
|
|
21
|
+
"coveo-search-ui": "2.10113.0",
|
|
22
|
+
"debounce": "1.2.1",
|
|
23
|
+
"js-cookie": "3.0.5",
|
|
24
|
+
"lodash.defaults": "4.2.0",
|
|
25
|
+
"lodash.get": "4.4.2",
|
|
26
|
+
"lodash.kebabcase": "4.1.1",
|
|
27
|
+
"memoize-one": "6.0.0",
|
|
28
|
+
"microtip": "0.2.2",
|
|
29
|
+
"shiki": "^3.12.2",
|
|
30
|
+
"throttle-debounce": "5.0.0",
|
|
31
|
+
"uuid": "9.0.1"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/classnames": "2.3.1",
|
|
35
|
+
"@types/debounce": "1.2.4",
|
|
36
|
+
"@types/js-cookie": "3.0.6",
|
|
37
|
+
"@types/lodash.defaults": "4.2.9",
|
|
38
|
+
"@types/lodash.get": "4.4.9",
|
|
39
|
+
"@types/lodash.kebabcase": "4.1.9",
|
|
40
|
+
"@types/luxon": "3.4.2",
|
|
41
|
+
"@types/uuid": "8.3.4",
|
|
42
|
+
"@types/vimeo__player": "2.18.3",
|
|
43
|
+
"eventsourcemock": "2.0.0",
|
|
44
|
+
"luxon": "3.4.4",
|
|
45
|
+
"msw": "^2.12.4"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -5,6 +5,7 @@ import { track } from "dxUtils/analytics";
|
|
|
5
5
|
const RESTORE_SCROLL_EVENT_NAME = "restore-scroll";
|
|
6
6
|
const SCROLL_EVENT_NAME = "scroll";
|
|
7
7
|
const GLOBAL_NAV_TOGGLE_EVENT_NAME = "toggle_global_nav";
|
|
8
|
+
const FULLSCREEN_CHANGE_EVENT_NAME = "fullscreenchange";
|
|
8
9
|
|
|
9
10
|
const LOAD_TIME_SCROLL_RESTORE_DELAY = 750;
|
|
10
11
|
const REDUNDANT_INSTANCE_ERROR_MESSAGE =
|
|
@@ -55,6 +56,7 @@ export default class ScrollManager extends LightningElement {
|
|
|
55
56
|
private scrolledSevenFivePercent = false;
|
|
56
57
|
private scrolledOneHundredPercent = false;
|
|
57
58
|
private scrollUnlocked = false;
|
|
59
|
+
private lastKnownScrollTop = 0;
|
|
58
60
|
|
|
59
61
|
renderedCallback() {
|
|
60
62
|
scrollUnlocked = window.location.hash !== ""; // if we have anchor links, skip the entire scroll restore
|
|
@@ -105,15 +107,39 @@ export default class ScrollManager extends LightningElement {
|
|
|
105
107
|
GLOBAL_NAV_TOGGLE_EVENT_NAME,
|
|
106
108
|
this.onGlobalNavToggle
|
|
107
109
|
);
|
|
110
|
+
document.addEventListener(
|
|
111
|
+
FULLSCREEN_CHANGE_EVENT_NAME,
|
|
112
|
+
this.onFullscreenChange
|
|
113
|
+
);
|
|
108
114
|
} else {
|
|
109
115
|
console.error(REDUNDANT_INSTANCE_ERROR_MESSAGE);
|
|
110
116
|
}
|
|
111
117
|
}
|
|
112
118
|
|
|
113
119
|
onWindowScroll = () => {
|
|
120
|
+
if (!document.fullscreenElement) {
|
|
121
|
+
this.lastKnownScrollTop = (
|
|
122
|
+
document.scrollingElement || document.body
|
|
123
|
+
).scrollTop;
|
|
124
|
+
}
|
|
114
125
|
this.updateScrollState();
|
|
115
126
|
};
|
|
116
127
|
|
|
128
|
+
/*
|
|
129
|
+
Preserve the last valid scroll position, as fullscreen temporarily resets it to 0.
|
|
130
|
+
Used to restore the original position on exit.
|
|
131
|
+
*/
|
|
132
|
+
onFullscreenChange = () => {
|
|
133
|
+
const isExitingFullscreen = !document.fullscreenElement;
|
|
134
|
+
if (isExitingFullscreen && this.lastKnownScrollTop > 0) {
|
|
135
|
+
const target = this.lastKnownScrollTop;
|
|
136
|
+
requestAnimationFrame(() => {
|
|
137
|
+
document.body.scrollTop = document.documentElement.scrollTop =
|
|
138
|
+
target;
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
117
143
|
onGlobalNavToggle = (event: Event) => {
|
|
118
144
|
const isGlobalNavShowing: boolean = (event as CustomEvent).detail;
|
|
119
145
|
HTML_ELEMENT?.setAttribute(
|
|
@@ -208,5 +234,9 @@ export default class ScrollManager extends LightningElement {
|
|
|
208
234
|
GLOBAL_NAV_TOGGLE_EVENT_NAME,
|
|
209
235
|
this.onGlobalNavToggle
|
|
210
236
|
);
|
|
237
|
+
document.removeEventListener(
|
|
238
|
+
FULLSCREEN_CHANGE_EVENT_NAME,
|
|
239
|
+
this.onFullscreenChange
|
|
240
|
+
);
|
|
211
241
|
}
|
|
212
242
|
}
|
package/LICENSE
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2020, Salesforce.com, Inc.
|
|
2
|
-
All rights reserved.
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
-
|
|
6
|
-
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
-
|
|
8
|
-
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
-
|
|
10
|
-
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
-
|
|
12
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|