@utopia-utils/dom
Advanced tools
Comparing version 0.3.12 to 0.3.13
@@ -19,2 +19,5 @@ interface PanZoomOptions { | ||
/** | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/panzoom/index.ts | ||
*/ | ||
declare function panzoom(target: HTMLElement, { zoomFactor, maxZoom, minZoom, onTransform, }?: PanZoomOptions): void; | ||
@@ -25,2 +28,3 @@ | ||
* @returns A boolean value. | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/isAndroid.ts | ||
*/ | ||
@@ -32,2 +36,3 @@ declare function isAndroid(): boolean; | ||
* @returns A boolean value. | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/isIOS.ts | ||
*/ | ||
@@ -39,2 +44,3 @@ declare function isIOS(): boolean; | ||
* @returns A boolean value. | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/isMobile.ts | ||
*/ | ||
@@ -46,2 +52,3 @@ declare function isMobile(): boolean; | ||
* @returns A boolean value. | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/isWeixin.ts | ||
*/ | ||
@@ -69,2 +76,3 @@ declare function isWeixin(): boolean; | ||
* - linkTag: the link tag that was created | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/loadCSS.ts | ||
*/ | ||
@@ -119,2 +127,3 @@ declare function loadCSS(path: string, options?: LoadCSSOptions): { | ||
* - scriptTag: the script tag that was created | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/loadScript.ts | ||
*/ | ||
@@ -140,2 +149,3 @@ declare function loadScript(src: string, options?: LoadScriptOptions): { | ||
* @returns A promise that resolves to an element that matches the selector. | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/waitForSelector.ts | ||
*/ | ||
@@ -142,0 +152,0 @@ declare function waitForSelector<T extends Element>(selector: string, options?: WaitForOptions): Promise<T | null>; |
{ | ||
"name": "@utopia-utils/dom", | ||
"type": "module", | ||
"version": "0.3.12", | ||
"version": "0.3.13", | ||
"description": "Collection of common dom utils", | ||
@@ -6,0 +6,0 @@ "author": "Utopia <https://github.com/GreatAuk>", |
/** | ||
* Returns a boolean value indicating whether the current platform is Android. | ||
* @returns A boolean value. | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/isAndroid.ts | ||
*/ | ||
@@ -5,0 +6,0 @@ export function isAndroid() { |
/** | ||
* If the user agent string contains the word 'iPad', 'iPhone', or 'iPod', then we're on iOS. | ||
* @returns A boolean value. | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/isIOS.ts | ||
*/ | ||
@@ -5,0 +6,0 @@ export function isIOS() { |
/** | ||
* detect current environment is a mobile device | ||
* @returns A boolean value. | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/isMobile.ts | ||
*/ | ||
@@ -5,0 +6,0 @@ export function isMobile() { |
/** | ||
* Check if the current environment is Weixin. (微信) | ||
* @returns A boolean value. | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/isWeixin.ts | ||
*/ | ||
@@ -5,0 +6,0 @@ export function isWeixin() { |
@@ -21,2 +21,3 @@ interface LoadCSSOptions { | ||
* - linkTag: the link tag that was created | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/loadCSS.ts | ||
*/ | ||
@@ -23,0 +24,0 @@ export function loadCSS(path: string, options?: LoadCSSOptions) { |
@@ -44,2 +44,3 @@ interface LoadScriptOptions { | ||
* - scriptTag: the script tag that was created | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/loadScript.ts | ||
*/ | ||
@@ -46,0 +47,0 @@ export function loadScript(src: string, options?: LoadScriptOptions) { |
import type { PanZoomOptions, Transform } from './type' | ||
import { applyTransform, getScaleMultiplier } from './utils' | ||
/** | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/panzoom/index.ts | ||
*/ | ||
export function panzoom(target: HTMLElement, { | ||
@@ -5,0 +8,0 @@ zoomFactor = 1, |
@@ -15,2 +15,3 @@ interface WaitForOptions { | ||
* @returns A promise that resolves to an element that matches the selector. | ||
* @linkcode https://github.com/GreatAuk/utopia-utils/blob/main/packages/dom/src/waitForSelector.ts | ||
*/ | ||
@@ -17,0 +18,0 @@ export function waitForSelector<T extends Element>(selector: string, options?: WaitForOptions): Promise<T | null> { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79232
766