Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Normalize line endings so generated reports and sources stay byte-identical
# across platforms.
* text=auto eol=lf

# Generated snapshots: keep diffs readable but do not treat them as authored.
etc/*.api.md linguist-generated=true
package-lock.json linguist-generated=true
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 0.6.0

- Fixed focus trapping skipping over targets that cannot receive focus: hidden inputs and anything
inside a `[hidden]`, `[inert]`, or `aria-hidden="true"` subtree. A dialog whose form started with a
hidden field, such as a CSRF token, previously left focus on `<body>` so the trap never engaged.
- Added `summary`, `iframe`, `audio[controls]`, `video[controls]`, and `contenteditable` elements to
focus detection.
- Fixed `update({ className })` throwing `SyntaxError` when the class string was padded, empty, or
contained repeated whitespace.
- Fixed `toast()` dismissing immediately for a duration of `0` or `Infinity`; both now keep the toast
until it is dismissed explicitly.
- Fixed the toast auto-dismiss timer leaking when a toast was dismissed through its action button.
- Added a `notifications` label so the toast region name can be localized with `setLabels()`.
- Fixed `resetForTests()` on the dialog stack leaving the body scroll locked.
- Pinned generated API reports to LF endings and normalized line endings repository-wide so the
checked-in snapshots stop churning on Windows checkouts.
- Updated development dependencies to clear all reported advisories.

## 0.5.0

- Added scoped surface/backdrop opacity, backdrop blur, border, and shadow appearance controls.
Expand Down
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ForgeDialog 0.5
# ForgeDialog 0.6

_A modern, lightweight, and highly customizable JavaScript dialog library for alerts, confirmations, modals, drawers, and interactive workflows._

Expand Down Expand Up @@ -72,17 +72,17 @@ const result = await instance.whenClosed();

## API

| Function | Returns | Description |
| -------------------------------------- | ----------------------- | ------------------------------------------------------------ |
| `alert(message, options?)` | `Promise<void>` | Single-button informational dialog. |
| `confirm(message, options?)` | `Promise<boolean>` | OK/Cancel dialog; resolves `false` on Escape/overlay close. |
| `prompt(message, options?)` | `Promise<string\|null>` | Text-input dialog with optional `validate()`. |
| `open(options)` | `DialogInstance` | Low-level API for fully custom dialogs. |
| `setTheme('light'\|'dark'\|'system')` | `void` | Overrides the OS color-scheme preference. |
| `getTheme()` | `ThemeMode` | Reads the current theme override. |
| `setLabels(overrides)` / `getLabels()` | `void` / `DialogLabels` | Overrides default button labels (`ok`, `cancel`, `close`). |
| `registerPlugin(plugin)` | `void` | Registers a plugin (`{ name, install?, hooks? }`). |
| `on(hookName, fn)` / `off(...)` | `void` | Shorthand for a single lifecycle hook without a full plugin. |
| Function | Returns | Description |
| -------------------------------------- | ----------------------- | -------------------------------------------------------------------- |
| `alert(message, options?)` | `Promise<void>` | Single-button informational dialog. |
| `confirm(message, options?)` | `Promise<boolean>` | OK/Cancel dialog; resolves `false` on Escape/overlay close. |
| `prompt(message, options?)` | `Promise<string\|null>` | Text-input dialog with optional `validate()`. |
| `open(options)` | `DialogInstance` | Low-level API for fully custom dialogs. |
| `setTheme('light'\|'dark'\|'system')` | `void` | Overrides the OS color-scheme preference. |
| `getTheme()` | `ThemeMode` | Reads the current theme override. |
| `setLabels(overrides)` / `getLabels()` | `void` / `DialogLabels` | Overrides default labels (`ok`, `cancel`, `close`, `notifications`). |
| `registerPlugin(plugin)` | `void` | Registers a plugin (`{ name, install?, hooks? }`). |
| `on(hookName, fn)` / `off(...)` | `void` | Shorthand for a single lifecycle hook without a full plugin. |

`DialogInstance` exposes `open()`, `close(result?)`, `whenClosed()`, `update(partialOptions)`,
`isOpen()`, and the position methods `getPosition()`, `setPosition()`, and `resetPosition()`.
Expand Down Expand Up @@ -142,6 +142,10 @@ palettes, and persisted branching wizards.
import { drawer, toast, wizard } from 'forgedialog';

toast('Saved', { tone: 'success' });
// A duration of 0 or Infinity keeps the toast until dismiss() is called.
const upload = toast('Uploading…', { duration: 0 });
upload.dismiss();

drawer({ title: 'Settings', side: 'right', content: renderSettings });

const flow = wizard({
Expand Down
1 change: 1 addition & 0 deletions api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"reportFolder": "<projectFolder>/etc",
"reportTempFolder": "<projectFolder>/temp"
},
"newlineKind": "lf",
"docModel": { "enabled": false },
"dtsRollup": { "enabled": false },
"tsdocMetadata": { "enabled": false },
Expand Down
1 change: 1 addition & 0 deletions etc/core.api.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion etc/forgedialog.api.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion etc/presentation.api.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

106 changes: 38 additions & 68 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "forgedialog",
"version": "0.5.0",
"version": "0.6.0",
"description": "A modern, lightweight, and highly customizable JavaScript dialog library for alerts, confirmations, modals, drawers, and interactive workflows.",
"type": "module",
"license": "MIT",
Expand Down
Loading
Loading