swup 4.5.1 → 4.5.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/Swup.cjs +1 -1
- package/dist/Swup.cjs.map +1 -1
- package/dist/Swup.modern.js +1 -1
- package/dist/Swup.modern.js.map +1 -1
- package/dist/Swup.module.js +1 -1
- package/dist/Swup.module.js.map +1 -1
- package/dist/Swup.umd.js +1 -1
- package/dist/Swup.umd.js.map +1 -1
- package/dist/types/utils/index.d.ts +1 -2
- package/dist/types/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/utils/index.ts +2 -3
|
@@ -10,10 +10,9 @@ export declare function isPromise<T>(obj: unknown): obj is PromiseLike<T>;
|
|
|
10
10
|
export declare function runAsPromise(func: Function, args?: unknown[]): Promise<unknown>;
|
|
11
11
|
/**
|
|
12
12
|
* Force a layout reflow, e.g. after adding classnames
|
|
13
|
-
* @returns The offset height, just here so it doesn't get optimized away by the JS engine
|
|
14
13
|
* @see https://stackoverflow.com/a/21665117/3759615
|
|
15
14
|
*/
|
|
16
|
-
export declare function forceReflow(element?: HTMLElement):
|
|
15
|
+
export declare function forceReflow(element?: HTMLElement): void;
|
|
17
16
|
/** Escape a string with special chars to not break CSS selectors. */
|
|
18
17
|
export declare const escapeCssIdentifier: (ident: string) => string;
|
|
19
18
|
/** Fix for Chrome below v61 formatting CSS floats with comma in some locales. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,eAAO,MAAM,KAAK,aAAc,MAAM,YAAW,QAAQ,GAAG,OAAO,uBAElE,CAAC;AAEF,0CAA0C;AAC1C,eAAO,MAAM,QAAQ,aACV,MAAM,YACP,QAAQ,GAAG,OAAO,KACzB,WAAW,EAEb,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,QAAQ,QAAO,QAAQ,IAAI,CAQvC,CAAC;AAEF,oDAAoD;AACpD,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAMhE;AAED,wFAAwF;AAExF,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CASnF;AAED
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,eAAO,MAAM,KAAK,aAAc,MAAM,YAAW,QAAQ,GAAG,OAAO,uBAElE,CAAC;AAEF,0CAA0C;AAC1C,eAAO,MAAM,QAAQ,aACV,MAAM,YACP,QAAQ,GAAG,OAAO,KACzB,WAAW,EAEb,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,QAAQ,QAAO,QAAQ,IAAI,CAQvC,CAAC;AAEF,oDAAoD;AACpD,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAMhE;AAED,wFAAwF;AAExF,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CASnF;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAGvD;AAED,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,UAAW,MAAM,WAMhD,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,IAAI,MAAO,MAAM,WAE7B,CAAC"}
|
package/package.json
CHANGED
package/src/utils/index.ts
CHANGED
|
@@ -46,12 +46,11 @@ export function runAsPromise(func: Function, args: unknown[] = []): Promise<unkn
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Force a layout reflow, e.g. after adding classnames
|
|
49
|
-
* @returns The offset height, just here so it doesn't get optimized away by the JS engine
|
|
50
49
|
* @see https://stackoverflow.com/a/21665117/3759615
|
|
51
50
|
*/
|
|
52
|
-
export function forceReflow(element?: HTMLElement) {
|
|
51
|
+
export function forceReflow(element?: HTMLElement): void {
|
|
53
52
|
element = element || document.body;
|
|
54
|
-
|
|
53
|
+
element?.getBoundingClientRect();
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
/** Escape a string with special chars to not break CSS selectors. */
|