@immediately-run/sdk 0.64.1 → 0.65.0
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/dist/boot.cjs +6 -1
- package/dist/boot.cjs.map +1 -1
- package/dist/boot.js +6 -1
- package/dist/boot.js.map +1 -1
- package/dist/components/ScrollRestoration.cjs +117 -0
- package/dist/components/ScrollRestoration.cjs.map +1 -0
- package/dist/components/ScrollRestoration.d.cts +13 -0
- package/dist/components/ScrollRestoration.d.ts +13 -0
- package/dist/components/ScrollRestoration.js +94 -0
- package/dist/components/ScrollRestoration.js.map +1 -0
- package/dist/entryState.cjs +99 -0
- package/dist/entryState.cjs.map +1 -0
- package/dist/entryState.d.cts +42 -0
- package/dist/entryState.d.ts +42 -0
- package/dist/entryState.js +69 -0
- package/dist/entryState.js.map +1 -0
- package/dist/index.cjs +10 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/routing.cjs +3 -0
- package/dist/routing.cjs.map +1 -1
- package/dist/routing.js +3 -0
- package/dist/routing.js.map +1 -1
- package/dist/scrollRestore.cjs +43 -0
- package/dist/scrollRestore.cjs.map +1 -0
- package/dist/scrollRestore.d.cts +39 -0
- package/dist/scrollRestore.d.ts +39 -0
- package/dist/scrollRestore.js +18 -0
- package/dist/scrollRestore.js.map +1 -0
- package/dist/useEntryState.cjs +41 -0
- package/dist/useEntryState.cjs.map +1 -0
- package/dist/useEntryState.d.cts +28 -0
- package/dist/useEntryState.d.ts +28 -0
- package/dist/useEntryState.js +17 -0
- package/dist/useEntryState.js.map +1 -0
- package/dist/version.cjs +1 -1
- package/dist/version.cjs.map +1 -1
- package/dist/version.d.cts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NavigationDirection } from './entryState.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Read the value this app left on the current history entry, and queue the value to
|
|
5
|
+
* leave on the entry the next navigation departs from.
|
|
6
|
+
*
|
|
7
|
+
* `value` is `undefined` on an ordinary forward navigation — there is no bookmark for
|
|
8
|
+
* a page being visited for the first time — and on a traversal to an entry that was
|
|
9
|
+
* stamped by nothing (a navigation the app did not initiate).
|
|
10
|
+
*
|
|
11
|
+
* `save` queues; it does not send. The queued value travels with the next
|
|
12
|
+
* `navigate()`, which is the only moment the app knows an entry is being left.
|
|
13
|
+
*/
|
|
14
|
+
declare const useEntryState: <T>(key: string) => {
|
|
15
|
+
value: T | undefined;
|
|
16
|
+
save: (value: T) => void;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* How the browser reached the page being rendered: `push` for an ordinary
|
|
20
|
+
* navigation, `back`/`forward` for a history traversal.
|
|
21
|
+
*
|
|
22
|
+
* An app that resets its own view on arrival — scrolling a container to the top is
|
|
23
|
+
* the usual one — should stand down on a traversal, so a restored position is not
|
|
24
|
+
* immediately thrown away.
|
|
25
|
+
*/
|
|
26
|
+
declare const useNavigationDirection: () => NavigationDirection;
|
|
27
|
+
|
|
28
|
+
export { useEntryState, useNavigationDirection };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NavigationDirection } from './entryState.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Read the value this app left on the current history entry, and queue the value to
|
|
5
|
+
* leave on the entry the next navigation departs from.
|
|
6
|
+
*
|
|
7
|
+
* `value` is `undefined` on an ordinary forward navigation — there is no bookmark for
|
|
8
|
+
* a page being visited for the first time — and on a traversal to an entry that was
|
|
9
|
+
* stamped by nothing (a navigation the app did not initiate).
|
|
10
|
+
*
|
|
11
|
+
* `save` queues; it does not send. The queued value travels with the next
|
|
12
|
+
* `navigate()`, which is the only moment the app knows an entry is being left.
|
|
13
|
+
*/
|
|
14
|
+
declare const useEntryState: <T>(key: string) => {
|
|
15
|
+
value: T | undefined;
|
|
16
|
+
save: (value: T) => void;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* How the browser reached the page being rendered: `push` for an ordinary
|
|
20
|
+
* navigation, `back`/`forward` for a history traversal.
|
|
21
|
+
*
|
|
22
|
+
* An app that resets its own view on arrival — scrolling a container to the top is
|
|
23
|
+
* the usual one — should stand down on a traversal, so a restored position is not
|
|
24
|
+
* immediately thrown away.
|
|
25
|
+
*/
|
|
26
|
+
declare const useNavigationDirection: () => NavigationDirection;
|
|
27
|
+
|
|
28
|
+
export { useEntryState, useNavigationDirection };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./chunk-VHAA22YE.js";
|
|
2
|
+
import { useCallback, useSyncExternalStore } from "react";
|
|
3
|
+
import { getArrivedNavigation, saveEntryState, subscribeNavigation } from "./entryState";
|
|
4
|
+
const useEntryState = (key) => {
|
|
5
|
+
const arrived = useSyncExternalStore(subscribeNavigation, getArrivedNavigation, getArrivedNavigation);
|
|
6
|
+
const save = useCallback((value) => saveEntryState(key, value), [key]);
|
|
7
|
+
return { value: arrived.state?.[key], save };
|
|
8
|
+
};
|
|
9
|
+
const useNavigationDirection = () => {
|
|
10
|
+
const arrived = useSyncExternalStore(subscribeNavigation, getArrivedNavigation, getArrivedNavigation);
|
|
11
|
+
return arrived.direction;
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
useEntryState,
|
|
15
|
+
useNavigationDirection
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=useEntryState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/useEntryState.ts"],"sourcesContent":["// React surface over the per-history-entry scratch (R3-627). The store itself is in\n// `entryState.ts` and is framework-free; this file is the thin binding so a component\n// re-renders when the host tells the frame which entry it just arrived at.\n\nimport { useCallback, useSyncExternalStore } from 'react';\n\nimport { getArrivedNavigation, saveEntryState, subscribeNavigation, type NavigationDirection } from './entryState';\n\n/**\n * Read the value this app left on the current history entry, and queue the value to\n * leave on the entry the next navigation departs from.\n *\n * `value` is `undefined` on an ordinary forward navigation — there is no bookmark for\n * a page being visited for the first time — and on a traversal to an entry that was\n * stamped by nothing (a navigation the app did not initiate).\n *\n * `save` queues; it does not send. The queued value travels with the next\n * `navigate()`, which is the only moment the app knows an entry is being left.\n */\nexport const useEntryState = <T>(key: string): { value: T | undefined; save: (value: T) => void } => {\n const arrived = useSyncExternalStore(subscribeNavigation, getArrivedNavigation, getArrivedNavigation);\n const save = useCallback((value: T) => saveEntryState(key, value), [key]);\n return { value: arrived.state?.[key] as T | undefined, save };\n};\n\n/**\n * How the browser reached the page being rendered: `push` for an ordinary\n * navigation, `back`/`forward` for a history traversal.\n *\n * An app that resets its own view on arrival — scrolling a container to the top is\n * the usual one — should stand down on a traversal, so a restored position is not\n * immediately thrown away.\n */\nexport const useNavigationDirection = (): NavigationDirection => {\n const arrived = useSyncExternalStore(subscribeNavigation, getArrivedNavigation, getArrivedNavigation);\n return arrived.direction;\n};\n"],"mappings":";AAIA,SAAS,aAAa,4BAA4B;AAElD,SAAS,sBAAsB,gBAAgB,2BAAqD;AAa7F,MAAM,gBAAgB,CAAI,QAAoE;AACnG,QAAM,UAAU,qBAAqB,qBAAqB,sBAAsB,oBAAoB;AACpG,QAAM,OAAO,YAAY,CAAC,UAAa,eAAe,KAAK,KAAK,GAAG,CAAC,GAAG,CAAC;AACxE,SAAO,EAAE,OAAO,QAAQ,QAAQ,GAAG,GAAoB,KAAK;AAC9D;AAUO,MAAM,yBAAyB,MAA2B;AAC/D,QAAM,UAAU,qBAAqB,qBAAqB,sBAAsB,oBAAoB;AACpG,SAAO,QAAQ;AACjB;","names":[]}
|
package/dist/version.cjs
CHANGED
|
@@ -21,7 +21,7 @@ __export(version_exports, {
|
|
|
21
21
|
SDK_VERSION: () => SDK_VERSION
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const SDK_VERSION = "0.
|
|
24
|
+
const SDK_VERSION = "0.65.0";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
SDK_VERSION
|
package/dist/version.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.
|
|
1
|
+
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.65.0';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,cAAc;","names":[]}
|
package/dist/version.d.cts
CHANGED
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.
|
|
1
|
+
{"version":3,"sources":["../src/version.ts"],"sourcesContent":["// GENERATED by scripts/gen-version.mjs from package.json — do not edit by hand.\n// Regenerated on every build (prebuild); kept honest by version.test.ts.\n\n/** This SDK's package version, baked from package.json at build (SP2-6). */\nexport const SDK_VERSION = '0.65.0';\n"],"mappings":";AAIO,MAAM,cAAc;","names":[]}
|
package/package.json
CHANGED