lecodes-sdk 2.0.1 → 2.0.3
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/types/ui/UIScreen.d.ts +17 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types.json +1 -1
- package/package.json +2 -1
- package/src/bridges/tree.d.ts +4 -0
- package/src/chisel.ts +1 -1
- package/src/ui/UIScreen.ts +23 -0
- package/src/ui/transitions.ts +1 -1
- package/src/version.ts +1 -1
- package/tests/helpers/fakeTree.ts +2 -0
|
@@ -28,6 +28,22 @@ export interface UIScreen extends UIContainerBase<UIScreenStyle, DrawableStyle &
|
|
|
28
28
|
* in place. `onClose`/`onOpen` still fire on detach/re-attach. Free it with `destroy()`.
|
|
29
29
|
*/
|
|
30
30
|
keepAlive(enabled?: boolean): this;
|
|
31
|
+
/**
|
|
32
|
+
* The screen's ADDRESS on the web: while the screen is the one shown, the browser's address
|
|
33
|
+
* bar shows it, and a link copied from there opens the app with it (`app.launchUrl`). A route,
|
|
34
|
+
* not a page's address: `"/product/42"`, `"/search?q=shoes"` — the app never sees where the
|
|
35
|
+
* page is served from. Call it again to change the address of a screen that is shown (a
|
|
36
|
+
* filter, a search): the entry of the browser's history is replaced, not added to. `null`
|
|
37
|
+
* takes the address away; a screen with none keeps the address of the one under it.
|
|
38
|
+
*
|
|
39
|
+
* The way in is the app's: read `app.launchUrl` at start and listen to the `"url"` event, as
|
|
40
|
+
* for a deep link on a phone. No-op on hosts without an address bar.
|
|
41
|
+
*
|
|
42
|
+
* ```ts
|
|
43
|
+
* const ProductScreen = (id: string) => UIScreen(...).url(`/product/${id}`)
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
url(route: string | null): this;
|
|
31
47
|
/** Touch began on the screen; `ev.track(...)` takes over the rest of the gesture. */
|
|
32
48
|
onTouchStart(callback: (ev: TouchStartEvent<UIScreen>) => void): this;
|
|
33
49
|
}
|
|
@@ -39,6 +55,7 @@ export declare class ScreenElement extends ContainerElement<"screen"> {
|
|
|
39
55
|
protected cl: (() => void)[];
|
|
40
56
|
onClose(callback: () => void): this;
|
|
41
57
|
keepAlive(enabled?: boolean): this;
|
|
58
|
+
url(route: string | null): this;
|
|
42
59
|
readonly touchStartListeners: any[];
|
|
43
60
|
onTouchStart(callback: any): this;
|
|
44
61
|
private _backButtonCallback?;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.0.
|
|
1
|
+
export declare const SDK_VERSION = "2.0.3";
|
|
2
2
|
/** The major of a semver string, or null when it is not one. */
|
|
3
3
|
export declare const sdkMajor: (version: string | null | undefined) => number | null;
|
|
4
4
|
/** The `// sdk: <version>` line of a compiled bundle's header (sdk/src/compile/header.ts), read from
|