shelving 1.322.0 → 1.322.1

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.
@@ -447,7 +447,7 @@ Use `<SidebarLayout sidebar>`. On a narrow screen the sidebar becomes a drawer w
447
447
 
448
448
  #### A tab bar
449
449
 
450
- Use `<AppLayout nav>`. It puts the content slot above a bar, at every screen size. The bar has its own view-transition group, so it stays still while pages slide. Set `nav={false}` to hide the bar.
450
+ Use `<AppLayout nav>`. It puts the content slot above a bar, at every screen size. Pages slide in the content slot above the bar, so the bar stays still. Set `nav={false}` to hide the bar.
451
451
 
452
452
  ```tsx
453
453
  <AppLayout nav={<StackBar />}>
@@ -608,7 +608,7 @@ Use `<SidebarLayout sidebar>`. On a narrow screen the sidebar becomes a drawer w
608
608
 
609
609
  #### A tab bar
610
610
 
611
- Use `<AppLayout nav>`. It puts the content slot above a bar, at every screen size. The bar has its own view-transition group, so it stays still while pages slide. Set `nav={false}` to hide the bar.
611
+ Use `<AppLayout nav>`. It puts the content slot above a bar, at every screen size. Pages slide in the content slot above the bar, so the bar stays still. Set `nav={false}` to hide the bar.
612
612
 
613
613
  ```tsx
614
614
  <AppLayout nav={<StackBar />}>
@@ -23863,7 +23863,9 @@ A native `<dialog>` element opened in modal mode. It opens via `showModal()` whe
23863
23863
  - 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.
23864
23864
  - `Dialog` knows nothing about transitions. React runs a view transition only for an update made inside `startTransition()`, so the code that mounts and unmounts the dialog decides if it animates:
23865
23865
  - `<Dialogs>` renders a `DialogsStore` inside transitions, so a dialog opened with `DialogsStore.show()` animates in and out for you.
23866
- - A `Dialog` you mount yourself appears and goes at once, unless you set the state that mounts and unmounts it inside `startTransition()`. See the declarative example below.
23866
+ - A `Dialog` you mount yourself appears and goes at once, unless you set the React state that mounts and unmounts it inside `startTransition()`. See the declarative example below.
23867
+ - A `Dialog` you mount from a store read with `useStore()` never animates. `useStore()` applies each change at once, so `startTransition()` around the store write does not help.
23868
+ - To open a dialog from app code, use `requireDialogs()` and `DialogsStore.show()`. Pass the `DialogsStore` into any function that opens one.
23867
23869
  - A browser without view transitions shows and hides the dialog at once.
23868
23870
  - Pair with `DialogsStore`, `<DialogsContext>`, and `<Dialogs>` to open dialogs imperatively from anywhere in the app.
23869
23871
 
@@ -24157,6 +24159,10 @@ DialogsContext({ children }: DialogsContextProps): ReactElement
24157
24159
 
24158
24160
  Render the open dialogs from the current `DialogsContext`.
24159
24161
 
24162
+ - It renders the list inside a transition, so each dialog animates in and out.
24163
+ - To open a dialog, use `requireDialogs()` and `DialogsStore.show()`. Pass the `DialogsStore` into any function that opens one.
24164
+ - A `<Dialog>` you render from `useStore()` never animates, even if you write the store inside `startTransition()`.
24165
+
24160
24166
  ## Signatures
24161
24167
 
24162
24168
  ```ts
@@ -30840,8 +30846,8 @@ A full-viewport layout with a content slot above a bar of the app's main section
30840
30846
  - The bar shows at every screen size.
30841
30847
  - The content slot stays clear of the notch and the rounded screen corners, and the bar stays clear of the home bar (safe-area insets).
30842
30848
  - Each item in the bar takes an equal share of its width, up to `--app-layout-nav-item-width` each.
30843
- - The bar is outside the page cache, so it has one copy. It keeps its state, and the CSS transitions of its items (an active tab) still play while a page slides.
30844
- - The bar has its own view-transition group, so it stays still while the page slides under it.
30849
+ - The bar is outside the page cache, so it has one copy and keeps its state.
30850
+ - The bar has no view-transition name of its own. Pages slide sideways in the content slot above it, so the bar stays still. A named bar would draw above a dialog or notice that covers it during every view transition.
30845
30851
  - Leave out `nav`, or set it to `false`, to show no bar. The content slot then fills the screen. To hide the bar for some pages, change the prop from the URL, so the layout and its page cache stay mounted: `nav={path.startsWith("/squad/") ? false : <StackBar />}`.
30846
30852
  - Pages, error pages and loading states never render it themselves. Pick it above the router. See "Composing an app" on `<App>`.
30847
30853
 
@@ -17,8 +17,8 @@ A full-viewport layout with a content slot above a bar of the app's main section
17
17
  - The bar shows at every screen size.
18
18
  - The content slot stays clear of the notch and the rounded screen corners, and the bar stays clear of the home bar (safe-area insets).
19
19
  - Each item in the bar takes an equal share of its width, up to `--app-layout-nav-item-width` each.
20
- - The bar is outside the page cache, so it has one copy. It keeps its state, and the CSS transitions of its items (an active tab) still play while a page slides.
21
- - The bar has its own view-transition group, so it stays still while the page slides under it.
20
+ - The bar is outside the page cache, so it has one copy and keeps its state.
21
+ - The bar has no view-transition name of its own. Pages slide sideways in the content slot above it, so the bar stays still. A named bar would draw above a dialog or notice that covers it during every view transition.
22
22
  - Leave out `nav`, or set it to `false`, to show no bar. The content slot then fills the screen. To hide the bar for some pages, change the prop from the URL, so the layout and its page cache stay mounted: `nav={path.startsWith("/squad/") ? false : <StackBar />}`.
23
23
  - Pages, error pages and loading states never render it themselves. Pick it above the router. See "Composing an app" on `<App>`.
24
24
 
package/docs/ui/Dialog.md CHANGED
@@ -29,7 +29,9 @@ A native `<dialog>` element opened in modal mode. It opens via `showModal()` whe
29
29
  - 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.
30
30
  - `Dialog` knows nothing about transitions. React runs a view transition only for an update made inside `startTransition()`, so the code that mounts and unmounts the dialog decides if it animates:
31
31
  - `<Dialogs>` renders a `DialogsStore` inside transitions, so a dialog opened with `DialogsStore.show()` animates in and out for you.
32
- - A `Dialog` you mount yourself appears and goes at once, unless you set the state that mounts and unmounts it inside `startTransition()`. See the declarative example below.
32
+ - A `Dialog` you mount yourself appears and goes at once, unless you set the React state that mounts and unmounts it inside `startTransition()`. See the declarative example below.
33
+ - A `Dialog` you mount from a store read with `useStore()` never animates. `useStore()` applies each change at once, so `startTransition()` around the store write does not help.
34
+ - To open a dialog from app code, use `requireDialogs()` and `DialogsStore.show()`. Pass the `DialogsStore` into any function that opens one.
33
35
  - A browser without view transitions shows and hides the dialog at once.
34
36
  - Pair with `DialogsStore`, `<DialogsContext>`, and `<Dialogs>` to open dialogs imperatively from anywhere in the app.
35
37
 
@@ -5,6 +5,10 @@
5
5
 
6
6
  Render the open dialogs from the current `DialogsContext`.
7
7
 
8
+ - It renders the list inside a transition, so each dialog animates in and out.
9
+ - To open a dialog, use `requireDialogs()` and `DialogsStore.show()`. Pass the `DialogsStore` into any function that opens one.
10
+ - A `<Dialog>` you render from `useStore()` never animates, even if you write the store inside `startTransition()`.
11
+
8
12
  ## Signatures
9
13
 
10
14
  ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shelving",
3
- "version": "1.322.0",
3
+ "version": "1.322.1",
4
4
  "author": "Dave Houlbrooke <dave@shax.com>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,9 @@ A native `<dialog>` element opened in modal mode. It opens via `showModal()` whe
16
16
  - 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.
17
17
  - `Dialog` knows nothing about transitions. React runs a view transition only for an update made inside `startTransition()`, so the code that mounts and unmounts the dialog decides if it animates:
18
18
  - `<Dialogs>` renders a `DialogsStore` inside transitions, so a dialog opened with `DialogsStore.show()` animates in and out for you.
19
- - A `Dialog` you mount yourself appears and goes at once, unless you set the state that mounts and unmounts it inside `startTransition()`. See the declarative example below.
19
+ - A `Dialog` you mount yourself appears and goes at once, unless you set the React state that mounts and unmounts it inside `startTransition()`. See the declarative example below.
20
+ - A `Dialog` you mount from a store read with `useStore()` never animates. `useStore()` applies each change at once, so `startTransition()` around the store write does not help.
21
+ - To open a dialog from app code, use `requireDialogs()` and `DialogsStore.show()`. Pass the `DialogsStore` into any function that opens one.
20
22
  - A browser without view transitions shows and hides the dialog at once.
21
23
  - Pair with `DialogsStore`, `<DialogsContext>`, and `<Dialogs>` to open dialogs imperatively from anywhere in the app.
22
24
 
@@ -57,6 +57,10 @@ export declare function DialogsContext({ children }: DialogsContextProps): React
57
57
  /**
58
58
  * Render the open dialogs from the current `DialogsContext`.
59
59
  *
60
+ * - It renders the list inside a transition, so each dialog animates in and out.
61
+ * - To open a dialog, use `requireDialogs()` and `DialogsStore.show()`. Pass the `DialogsStore` into any function that opens one.
62
+ * - A `<Dialog>` you render from `useStore()` never animates, even if you write the store inside `startTransition()`.
63
+ *
60
64
  * @kind component
61
65
  * @see https://shelving.cc/ui/Dialogs
62
66
  */
@@ -61,6 +61,10 @@ export function DialogsContext({ children }) {
61
61
  /**
62
62
  * Render the open dialogs from the current `DialogsContext`.
63
63
  *
64
+ * - It renders the list inside a transition, so each dialog animates in and out.
65
+ * - To open a dialog, use `requireDialogs()` and `DialogsStore.show()`. Pass the `DialogsStore` into any function that opens one.
66
+ * - A `<Dialog>` you render from `useStore()` never animates, even if you write the store inside `startTransition()`.
67
+ *
64
68
  * @kind component
65
69
  * @see https://shelving.cc/ui/Dialogs
66
70
  */
@@ -90,6 +90,10 @@ export function DialogsContext({ children }: DialogsContextProps): ReactElement
90
90
  /**
91
91
  * Render the open dialogs from the current `DialogsContext`.
92
92
  *
93
+ * - It renders the list inside a transition, so each dialog animates in and out.
94
+ * - To open a dialog, use `requireDialogs()` and `DialogsStore.show()`. Pass the `DialogsStore` into any function that opens one.
95
+ * - A `<Dialog>` you render from `useStore()` never animates, even if you write the store inside `startTransition()`.
96
+ *
93
97
  * @kind component
94
98
  * @see https://shelving.cc/ui/Dialogs
95
99
  */
@@ -9,8 +9,8 @@ A full-viewport layout with a content slot above a bar of the app's main section
9
9
  - The bar shows at every screen size.
10
10
  - The content slot stays clear of the notch and the rounded screen corners, and the bar stays clear of the home bar (safe-area insets).
11
11
  - Each item in the bar takes an equal share of its width, up to `--app-layout-nav-item-width` each.
12
- - The bar is outside the page cache, so it has one copy. It keeps its state, and the CSS transitions of its items (an active tab) still play while a page slides.
13
- - The bar has its own view-transition group, so it stays still while the page slides under it.
12
+ - The bar is outside the page cache, so it has one copy and keeps its state.
13
+ - The bar has no view-transition name of its own. Pages slide sideways in the content slot above it, so the bar stays still. A named bar would draw above a dialog or notice that covers it during every view transition.
14
14
  - Leave out `nav`, or set it to `false`, to show no bar. The content slot then fills the screen. To hide the bar for some pages, change the prop from the URL, so the layout and its page cache stay mounted: `nav={path.startsWith("/squad/") ? false : <StackBar />}`.
15
15
  - Pages, error pages and loading states never render it themselves. Pick it above the router. See "Composing an app" on `<App>`.
16
16
 
@@ -80,8 +80,8 @@
80
80
  color: var(--app-layout-nav-color, var(--tint-00));
81
81
  box-shadow: var(--app-layout-nav-shadow, none);
82
82
 
83
- /* Its own view-transition group, so a page slide passes under it and the bar stays still. */
84
- view-transition-name: app-layout-nav;
83
+ /* No view-transition name of its own. Pages slide sideways in the content slot above it, so they never pass over it.
84
+ * A named bar would draw above everything else during any view transition, and jump over a dialog or notice that covers it. */
85
85
 
86
86
  /* Each item takes an equal share of the bar. */
87
87
  > * {
@@ -90,17 +90,3 @@
90
90
  }
91
91
  }
92
92
  }
93
-
94
- /* The bar stays still, so it never makes a view transition last longer. */
95
- ::view-transition-group(app-layout-nav) {
96
- animation-duration: 0s;
97
- }
98
-
99
- /* Show only the live bar during a view transition, so the CSS transitions of its items (an active tab) play with no cross-fade. */
100
- ::view-transition-old(app-layout-nav) {
101
- display: none;
102
- }
103
-
104
- ::view-transition-new(app-layout-nav) {
105
- animation: none;
106
- }