@usableapp/cardds 0.7.20 → 0.7.21
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
> For: a project that consumes `@usableapp/cardds` and its AI — what changed between versions, written as before → after, so a screen can be brought up to date without reading the source. Newest first. A consumer never edits cardds; if something here leaves you without a way to do what you did before, report the gap.
|
|
4
4
|
|
|
5
|
+
## 0.7.21 — 2026-09-29
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
- `installScreenSlide()`: the phone's back slid the WHOLE screen on every history step, also on an entry of the same screen (an open `Home`/`SheetStack` sheet kept in `history.state` so back closes it) — the page slid while the stack closed. Now an entry with the same path + query goes back without a slide; the component moves itself. Nothing to change in an app (Lh 2026-09-29, timebank home).
|
|
9
|
+
|
|
5
10
|
## 0.7.20 — 2026-09-28
|
|
6
11
|
|
|
7
12
|
Lh, from timebank on a real Android phone (card #153). Nothing to change in a screen.
|
|
@@ -10,6 +10,7 @@ export declare function slideScreen(update: () => unknown, direction?: SlideDire
|
|
|
10
10
|
/**
|
|
11
11
|
* installScreenSlide — call ONCE when the app starts: the phone's / browser's BACK (and forward) buttons slide the screen too,
|
|
12
12
|
* the way `back` (and `next`) does. It listens to `popstate` before the router renders; the direction is read from the history
|
|
13
|
-
* entry's index (`history.state.idx`, which React Router keeps; without it: back).
|
|
13
|
+
* entry's index (`history.state.idx`, which React Router keeps; without it: back). An entry of the SAME screen (same path and
|
|
14
|
+
* query, only its state differs — an open sheet pushed so the phone's back closes it) does not slide. Returns the uninstall.
|
|
14
15
|
*/
|
|
15
16
|
export declare function installScreenSlide(): () => void;
|
|
@@ -47,17 +47,25 @@ export function slideScreen(update, direction = 'next', scope = document) {
|
|
|
47
47
|
/**
|
|
48
48
|
* installScreenSlide — call ONCE when the app starts: the phone's / browser's BACK (and forward) buttons slide the screen too,
|
|
49
49
|
* the way `back` (and `next`) does. It listens to `popstate` before the router renders; the direction is read from the history
|
|
50
|
-
* entry's index (`history.state.idx`, which React Router keeps; without it: back).
|
|
50
|
+
* entry's index (`history.state.idx`, which React Router keeps; without it: back). An entry of the SAME screen (same path and
|
|
51
|
+
* query, only its state differs — an open sheet pushed so the phone's back closes it) does not slide. Returns the uninstall.
|
|
51
52
|
*/
|
|
52
53
|
export function installScreenSlide() {
|
|
53
|
-
|
|
54
|
+
const where = () => location.pathname + location.search;
|
|
55
|
+
let idx = history.state?.idx, at = where();
|
|
54
56
|
const push = history.pushState.bind(history), replace = history.replaceState.bind(history);
|
|
55
|
-
|
|
56
|
-
history.
|
|
57
|
+
const seen = () => { idx = history.state?.idx; at = where(); };
|
|
58
|
+
history.pushState = (...a) => { push(...a); seen(); };
|
|
59
|
+
history.replaceState = (...a) => { replace(...a); seen(); };
|
|
57
60
|
const pop = () => {
|
|
58
|
-
const to = history.state?.idx;
|
|
61
|
+
const to = history.state?.idx, same = where() === at;
|
|
59
62
|
const dir = to != null && idx != null && to > idx ? 'next' : 'back';
|
|
60
63
|
idx = to;
|
|
64
|
+
at = where();
|
|
65
|
+
/* the SAME screen (path + query unchanged, only the entry's state — an open sheet, a tab): the screen stays, the
|
|
66
|
+
component moves itself (a SheetStack closes as a stack does). Lh 2026-09-29, timebank home. */
|
|
67
|
+
if (same)
|
|
68
|
+
return;
|
|
61
69
|
slideScreen(() => undefined, dir); // the router renders on its own, right after this: the slide waits for its new Screen
|
|
62
70
|
};
|
|
63
71
|
addEventListener('popstate', pop, { capture: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usableapp/cardds",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.21",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "card-first mobile design system, React-first: the components in src/ are thin wrappers over the CSS contract (css/*.css stays the only truth); gallery/ shows every story live (npm run dev), tests/ measures the geometry.",
|