shelving 1.307.3 → 1.307.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shelving",
3
- "version": "1.307.3",
3
+ "version": "1.307.4",
4
4
  "author": "Dave Houlbrooke <dave@shax.com>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,6 +18,7 @@ export interface DialogProps extends OptionalChildProps {
18
18
  * - Opens via `showModal()` when mounted, and closes on a tap anywhere on it, the close button, or the Escape key.
19
19
  * - A tap on a control (button, input, select, textarea, label) or inside a `<Modal>` panel does not close it. A tap on a link or a `<nav>` button always closes it.
20
20
  * - The whole dialog fades in and out in one view transition. A `<Modal>` pinned to an edge leaves that layer and slides in its own.
21
+ * - A change inside an open dialog (new content, a Suspense reveal) runs no view transition. The page ignores taps while one runs.
21
22
  * - With `onClose`, a close request calls `onClose()` and the dialog stays open until it unmounts, so the view transition can capture it as it leaves.
22
23
  * - Children sit in one wrapper in normal block layout, `--dialog-width` wide and centred on the screen. Content taller than the screen scrolls from its top.
23
24
  * - Wraps content in `<Suspense>` so lazy children can stream in.
@@ -12,6 +12,7 @@ import modalStyles from "./Modal.module.css";
12
12
  * - Opens via `showModal()` when mounted, and closes on a tap anywhere on it, the close button, or the Escape key.
13
13
  * - A tap on a control (button, input, select, textarea, label) or inside a `<Modal>` panel does not close it. A tap on a link or a `<nav>` button always closes it.
14
14
  * - The whole dialog fades in and out in one view transition. A `<Modal>` pinned to an edge leaves that layer and slides in its own.
15
+ * - A change inside an open dialog (new content, a Suspense reveal) runs no view transition. The page ignores taps while one runs.
15
16
  * - With `onClose`, a close request calls `onClose()` and the dialog stays open until it unmounts, so the view transition can capture it as it leaves.
16
17
  * - Children sit in one wrapper in normal block layout, `--dialog-width` wide and centred on the screen. Content taller than the screen scrolls from its top.
17
18
  * - Wraps content in `<Suspense>` so lazy children can stream in.
@@ -20,7 +21,7 @@ import modalStyles from "./Modal.module.css";
20
21
  * @see https://shelving.cc/ui/Dialog
21
22
  */
22
23
  export const Dialog = memo(({ children, onClose, ...props }) => {
23
- return (_jsx(Suspense, { fallback: null, children: _jsx(ViewTransition, { enter: "fade", exit: "fade", children: _jsxs("dialog", { ref: _showModal, className: getModuleClass(styles, "dialog"), onClick: _closeOnClick, onCancel: e => {
24
+ return (_jsx(Suspense, { fallback: null, children: _jsx(ViewTransition, { default: "none", enter: "fade", exit: "fade", children: _jsxs("dialog", { ref: _showModal, className: getModuleClass(styles, "dialog"), onClick: _closeOnClick, onCancel: e => {
24
25
  // Keep the dialog open and let the parent unmount it in a transition. An uncancelable request closes natively and fires `onClose` from the `close` event.
25
26
  if (!onClose || !e.cancelable)
26
27
  return;
@@ -12,6 +12,7 @@ A native `<dialog>` element opened in modal mode. It opens via `showModal()` whe
12
12
  - `Dialog` only dims the page. Its text is white (`--tint-100`) so it reads on the dark overlay. Wrap the content in `<Modal>` to give it a panel with dark text on a light surface.
13
13
  - `onClose` fires when the user closes the dialog. It must unmount the `Dialog`: clear the React state that mounts it, or (when pushed via a store) remove it from the list. `Dialog` calls `onClose` inside `startTransition()`, and the dialog stays open until it unmounts.
14
14
  - The dialog animates with [view transitions](https://developer.mozilla.org/en-US/docs/Web/API/View_Transition_API). The whole dialog fades in and out as one layer. A `<Modal>` pinned to an edge takes its own layer and slides.
15
+ - A change inside an open dialog (new content, a Suspense reveal) runs no view transition, so the dialog never ignores a tap while its content changes. The page ignores taps while a view transition runs.
15
16
  - A view transition only runs for a React transition update. `DialogsStore` and `onClose` do this for you. To animate a declarative `Dialog` as it opens, set the state that mounts it inside `startTransition()`.
16
17
  - A browser without view transitions shows and hides the dialog at once.
17
18
  - Pair with `DialogsStore`, `<DialogsContext>`, and `<Dialogs>` to open dialogs imperatively from anywhere in the app.
@@ -24,6 +24,7 @@ export interface DialogProps extends OptionalChildProps {
24
24
  * - Opens via `showModal()` when mounted, and closes on a tap anywhere on it, the close button, or the Escape key.
25
25
  * - A tap on a control (button, input, select, textarea, label) or inside a `<Modal>` panel does not close it. A tap on a link or a `<nav>` button always closes it.
26
26
  * - The whole dialog fades in and out in one view transition. A `<Modal>` pinned to an edge leaves that layer and slides in its own.
27
+ * - A change inside an open dialog (new content, a Suspense reveal) runs no view transition. The page ignores taps while one runs.
27
28
  * - With `onClose`, a close request calls `onClose()` and the dialog stays open until it unmounts, so the view transition can capture it as it leaves.
28
29
  * - Children sit in one wrapper in normal block layout, `--dialog-width` wide and centred on the screen. Content taller than the screen scrolls from its top.
29
30
  * - Wraps content in `<Suspense>` so lazy children can stream in.
@@ -34,8 +35,8 @@ export interface DialogProps extends OptionalChildProps {
34
35
  export const Dialog = memo(({ children, onClose, ...props }: DialogProps) => {
35
36
  return (
36
37
  <Suspense fallback={null}>
37
- {/* The transition must wrap the `<dialog>`: React only animates a `<ViewTransition>` that comes before any DOM element in the inserted or deleted tree. Fade only on enter and exit, so an open dialog stays still while another dialog opens or closes. */}
38
- <ViewTransition enter="fade" exit="fade">
38
+ {/* The transition must wrap the `<dialog>`: React only animates a `<ViewTransition>` that comes before any DOM element in the inserted or deleted tree. Fade only on enter and exit, so an open dialog stays still while another dialog opens or closes. No update transition: the page ignores taps while a view transition runs, so a change inside an open dialog must not start one. */}
39
+ <ViewTransition default="none" enter="fade" exit="fade">
39
40
  {/** biome-ignore lint/a11y/useKeyWithClickEvents: Dialogs also show a close button. */}
40
41
  <dialog
41
42
  ref={_showModal}