🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@solid-primitives/resize-observer

Package Overview
Dependencies
Maintainers
3
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid-primitives/resize-observer - npm Package Compare versions

Comparing version
2.1.6
to
2.2.0
+8
-5
dist/index.d.ts

@@ -12,8 +12,11 @@ import { type Many, type MaybeAccessor } from "@solid-primitives/utils";

};
export type NullableSize = {
width: number;
height: number;
} | {
type SizeWithClient = Size & {
clientWidth: number;
clientHeight: number;
};
export type NullableSize = SizeWithClient | {
width: null;
height: null;
clientWidth: null;
clientHeight: null;
};

@@ -87,4 +90,4 @@ /**

*/
export declare function createElementSize(target: Element): Readonly<Size>;
export declare function createElementSize(target: Element): SizeWithClient;
export declare function createElementSize(target: Accessor<Element | false | undefined | null>): Readonly<NullableSize>;
export {};

@@ -99,3 +99,8 @@ import { makeEventListener } from "@solid-primitives/event-listener";

/*#__PURE__*/ createHydratableSingletonRoot(createWindowSize);
const ELEMENT_SIZE_FALLBACK = { width: null, height: null };
const ELEMENT_SIZE_FALLBACK = {
width: null,
height: null,
clientWidth: null,
clientHeight: null,
};
/**

@@ -110,3 +115,4 @@ * @param target html element

const { width, height } = target.getBoundingClientRect();
return { width, height };
const { clientWidth, clientHeight } = target;
return { width, height, clientWidth, clientHeight };
}

@@ -113,0 +119,0 @@ export function createElementSize(target) {

{
"name": "@solid-primitives/resize-observer",
"version": "2.1.6",
"version": "2.2.0",
"description": "Reactive primitives for observing resizing of HTML elements.",

@@ -48,4 +48,4 @@ "author": "Moshe Udimar",

"dependencies": {
"@solid-primitives/rootless": "^1.5.4",
"@solid-primitives/event-listener": "^2.4.6",
"@solid-primitives/rootless": "^1.5.4",
"@solid-primitives/static-store": "^0.1.4",

@@ -52,0 +52,0 @@ "@solid-primitives/utils": "^6.4.1"