From 18680f63735fb1e9ac65502e0cac342b989b23d4 Mon Sep 17 00:00:00 2001 From: rameel Date: Fri, 9 Jan 2026 01:31:05 +0500 Subject: [PATCH 1/3] Update pagelock usage version in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3acaed5..a725d9f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ npm install --save @ramstack/pagelock ### Via CDN ```html - + ``` ## Usage examples From 1533f63b9ac4b3dc84dbb5af3bdf803f89d73f9b Mon Sep 17 00:00:00 2001 From: rameel Date: Fri, 9 Jan 2026 01:46:06 +0500 Subject: [PATCH 2/3] Refine text, improve clarity and grammar --- README.md | 28 +++++++++++++++------------- src/pagelock.ts | 14 +++++++------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index a725d9f..644a9a2 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,18 @@ -# Pagelock +# @ramstack/pagelock +[![NPM](https://img.shields.io/npm/v/@ramstack/pagelock)](https://www.npmjs.com/package/@ramstack/pagelock) +[![MIT](https://img.shields.io/github/license/rameel/pagelock)](https://github.com/rameel/pagelock/blob/main/LICENSE) -The `@ramstack/pagelock` represents a simple utility for managing page scroll locking. -The library weighs around 750 bytes, and has no external dependencies. +`@ramstack/pagelock` is a simple utility for managing page scroll locking. +The library is around 750 bytes in size and has no external dependencies. ## Installation -### Via NPM +### Using NPM ```sh npm install --save @ramstack/pagelock ``` -### Via CDN +### Using CDN ```html ``` @@ -26,7 +28,7 @@ npm install --save @ramstack/pagelock let release; async function show() { - // Lock the page scroll before show modal dialog + // Lock the page scroll before showing the modal dialog release = pagelock(); await showModal(); @@ -76,23 +78,23 @@ watch(show, value => { ```js /** * Locks the page scroll. Subsequent calls to the function add to the queue of lock holders. - * Page scroll remains locked until the queue is empty. To forcibly release the page scroll, + * The page scroll remains locked until the queue is empty. To forcibly release the page scroll, * bypassing the queue, call the {@link pageunlock} function with `force = true`. * * @returns {() => void} - A function to unlock the page scroll. - * Subsequent calls to the release function are safe and only release its own captured lock, - * without affecting the other locks in the queue. + * Subsequent calls to this release function are safe: it only releases its own lock + * without affecting the others in the queue. */ function pagelock(): () => void; ``` ```js /** - * Unlocks the page scroll. In contrast to the release function returned by {@link pagelock}, - * the {@link pageunlock} function sequentially clears the queue of lock holders. + * Unlocks the page scroll. Unlike the release function returned by {@link pagelock}, + * this function removes locks from the end of the queue (one by one). * - * @param {boolean} [force] - If `true`, forcibly unlocks the page scroll, bypassing the queue; - * otherwise, only the last lock in the queue will be released. The default is `false`. + * @param {boolean} [force] - If `true`, forcibly unlocks the page scroll, clearing the entire queue. + * Otherwise, only the most recent lock is released. Defaults to `false`. */ function pageunlock(force?: boolean): void; ``` diff --git a/src/pagelock.ts b/src/pagelock.ts index 4f44a34..e3cdbe1 100644 --- a/src/pagelock.ts +++ b/src/pagelock.ts @@ -10,12 +10,12 @@ let props: { /** * Locks the page scroll. Subsequent calls to the function add to the queue of lock holders. - * Page scroll remains locked until the queue is empty. To forcibly release the page scroll, + * The page scroll remains locked until the queue is empty. To forcibly release the page scroll, * bypassing the queue, call the {@link pageunlock} function with `force = true`. * * @returns {() => void} - A function to unlock the page scroll. - * Subsequent calls to the release function are safe and only release its own captured lock, - * without affecting the other locks in the queue. + * Subsequent calls to this release function are safe: it only releases its own lock + * without affecting the others in the queue. */ export function pagelock(): () => void { if (!props) { @@ -47,11 +47,11 @@ export function pagelock(): () => void { } /** - * Unlocks the page scroll. In contrast to the release function returned by {@link pagelock}, - * the {@link pageunlock} function sequentially clears the queue of lock holders. + * Unlocks the page scroll. Unlike the release function returned by {@link pagelock}, + * this function removes locks from the end of the queue (one by one). * - * @param {boolean} [force] - If `true`, forcibly unlocks the page scroll, bypassing the queue; - * otherwise, only the last lock in the queue will be released. The default is `false`. + * @param {boolean} [force] - If `true`, forcibly unlocks the page scroll, clearing the entire queue. + * Otherwise, only the most recent lock is released. Defaults to `false`. */ export function pageunlock(force?: boolean): void { force ? locks = [] : locks.pop(); From 35764d944a4188791de256c7b059a16bcbccf42a Mon Sep 17 00:00:00 2001 From: rameel Date: Fri, 9 Jan 2026 01:48:22 +0500 Subject: [PATCH 3/3] Update Node.js to v24 in github actions --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index da3d263..36a68c2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: "20" + node-version: "24" registry-url: "https://registry.npmjs.org" - name: Checkout