yummies 3.0.6 → 3.0.8
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/html.d.ts +11 -0
- package/html.d.ts.map +1 -1
- package/html.js +16 -0
- package/package.json +1 -1
package/html.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { SanitizeOptions } from 'insane';
|
|
|
2
2
|
import { Maybe } from './utils/types';
|
|
3
3
|
/**
|
|
4
4
|
* Вытаскивает RGB из любого цвета
|
|
5
|
+
*
|
|
6
|
+
* Не рекомендуется к использованию так как вызывает reflow
|
|
5
7
|
*/
|
|
6
8
|
export declare const getComputedColor: (color?: string) => string | null;
|
|
7
9
|
export declare const downloadUsingAnchor: (urlOrBlob: string | Blob, fileName?: string) => void;
|
|
@@ -14,4 +16,13 @@ export declare const skipEvent: (e: Event) => boolean;
|
|
|
14
16
|
export declare const globalScrollIntoViewForY: (node: HTMLElement) => void;
|
|
15
17
|
export declare const sanitizeHtml: (html: Maybe<string>, config?: Partial<SanitizeOptions>) => string;
|
|
16
18
|
export declare const checkElementHasParent: (element: HTMLElement | null, parent: Maybe<HTMLElement>) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Executes a function within a view transition if supported by the browser.
|
|
21
|
+
*
|
|
22
|
+
* @param {VoidFunction} fn - The function to be executed.
|
|
23
|
+
* @returns {ViewTransition} - The result of the executed function.
|
|
24
|
+
*
|
|
25
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition | MDN: Document.startViewTransition}
|
|
26
|
+
*/
|
|
27
|
+
export declare const startViewTransitionSafety: (fn: VoidFunction) => ViewTransition | undefined;
|
|
17
28
|
//# sourceMappingURL=html.d.ts.map
|
package/html.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../src/html.ts"],"names":[],"mappings":"AAAA,OAAe,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAIjD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../src/html.ts"],"names":[],"mappings":"AAAA,OAAe,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAIjD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,WAAY,MAAM,KAAG,MAAM,GAAG,IAa1D,CAAC;AAEF,eAAO,MAAM,mBAAmB,cACnB,MAAM,GAAG,IAAI,aACb,MAAM,SAgBlB,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,UAI7C;AAED,eAAO,MAAM,gBAAgB,YAAa,WAAW,GAAG,IAAI,WAU3D,CAAC;AAEF,eAAO,MAAM,SAAS,MAAO,KAAK,YAKjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,SAAU,WAAW,SAgBzD,CAAC;AA0DF,eAAO,MAAM,YAAY,SACjB,KAAK,CAAC,MAAM,CAAC,WACV,OAAO,CAAC,eAAe,CAAC,WAMlC,CAAC;AAEF,eAAO,MAAM,qBAAqB,YACvB,WAAW,GAAG,IAAI,UACnB,KAAK,CAAC,WAAW,CAAC,YAe3B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,OAAQ,YAAY,+BAKzD,CAAC"}
|
package/html.js
CHANGED
|
@@ -3,6 +3,8 @@ import { clamp } from 'lodash-es';
|
|
|
3
3
|
import { blobToUrl } from './media';
|
|
4
4
|
/**
|
|
5
5
|
* Вытаскивает RGB из любого цвета
|
|
6
|
+
*
|
|
7
|
+
* Не рекомендуется к использованию так как вызывает reflow
|
|
6
8
|
*/
|
|
7
9
|
export const getComputedColor = (color) => {
|
|
8
10
|
if (!color)
|
|
@@ -135,3 +137,17 @@ export const checkElementHasParent = (element, parent) => {
|
|
|
135
137
|
}
|
|
136
138
|
return false;
|
|
137
139
|
};
|
|
140
|
+
/**
|
|
141
|
+
* Executes a function within a view transition if supported by the browser.
|
|
142
|
+
*
|
|
143
|
+
* @param {VoidFunction} fn - The function to be executed.
|
|
144
|
+
* @returns {ViewTransition} - The result of the executed function.
|
|
145
|
+
*
|
|
146
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Document/startViewTransition | MDN: Document.startViewTransition}
|
|
147
|
+
*/
|
|
148
|
+
export const startViewTransitionSafety = (fn) => {
|
|
149
|
+
if (document.startViewTransition) {
|
|
150
|
+
return document.startViewTransition(fn);
|
|
151
|
+
}
|
|
152
|
+
fn();
|
|
153
|
+
};
|