@wix/himalaya-cli 0.1878.0 → 0.1880.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/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/worker-subtree-safe-types.generated.d.ts +20 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/store-invite-message.d.ts +32 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +38 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +19 -12
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdui.mjs +34 -0
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{7ef1986106af7b688111a1b3775f03396def712b12d0e4620cfc758042f8157c.bin → c0c9168ac683637ad53e3365739c050ca372b6fd84b920b90ee3050a0cafca62.bin} +1 -1
- package/dist/browser-plane/sw.js +5 -5
- package/dist/cli.mjs +1409 -1099
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/one-app-to-himi-app.md +59 -9
- package/guides/qa-builds.md +25 -5
- package/package.json +2 -2
- package/templates/beauty-salon/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/branded-lite/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/branded-lite/tier5-src/_shared/one-app-member-action.ts +46 -0
- package/templates/brandy/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/community-club/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/conference/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/events-meetups/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/fitness-gym/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/gym-fitness/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/medical-services/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/nonprofit-cause/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/personal-fitness-trainer/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/podcast-creator/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/portfolio-creative/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/professional-services/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/restaurant/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/retail-store/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/salon-spa/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/wholesale-store/tier5-src/_shared/member-screen.ts +5 -3
- package/templates/yoga-studio/tier5-src/_shared/member-screen.ts +5 -3
|
Binary file
|
|
@@ -701,8 +701,9 @@ Apply these interpretation rules:
|
|
|
701
701
|
other screen, are ineligible. A Detailed Home whose page opens a shared vertical screen is generated as the Home.
|
|
702
702
|
Props are the header's own: title/subtitle (explicit visibility), `showLogo` + `settings.logoImageUrl`, ordered
|
|
703
703
|
`coverImagesUrls` (empty: the global covers), `coverImageTransitionTime` (default 3000). Run `provision` after
|
|
704
|
-
`header-badges` to copy the bar again; `validate-topbar` reports drift.
|
|
705
|
-
|
|
704
|
+
`header-badges` to copy the bar again; `validate-topbar` reports drift. The header's call to action and its Invite
|
|
705
|
+
go in one header actions row right after the header (see "The header's call to action" and "Invite is the Home's
|
|
706
|
+
row" below); never inside it.
|
|
706
707
|
- **Business contact is shared content.** For native contact sections
|
|
707
708
|
`platform_general_contact_section` / `platform_general_contact_section_bp`, use
|
|
708
709
|
`businessContactSection` and `createBusinessContactService` from
|
|
@@ -786,11 +787,14 @@ Apply these interpretation rules:
|
|
|
786
787
|
platform, `verified` with its canonical `url` and `storefront`, or `absent`, `not_found`, `mismatch` or
|
|
787
788
|
`lookup_failed` with a reason. A read that fails never fails the collection.
|
|
788
789
|
|
|
789
|
-
**The
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
`himi_branded_home.invite.button`.
|
|
793
|
-
|
|
790
|
+
**The button.** A tonal `Button` (the line `share` icon, label `Invite`, translated by the app's catalog:
|
|
791
|
+
`provision` adds the `Invite` row for he, it, es, fr, de and pt) in the Home's header actions row (see "The
|
|
792
|
+
header's call to action" below), which it shares with the call to action. Its id is stable:
|
|
793
|
+
`himi_branded_home.invite.button`. It carries the service's `load` as its own `onAppear`, so a row without Invite
|
|
794
|
+
never runs the Invite service. The Home's own content follows in the same order with the same ids. The action is
|
|
795
|
+
`tier5.himiPage_himi_branded_home_invite.invite` (`storeInviteAction` binds it to any tappable control;
|
|
796
|
+
`storeInviteButton` builds the button). An earlier run's Invite-only row (`himi_branded_home.invite`) is still
|
|
797
|
+
read and removed.
|
|
794
798
|
|
|
795
799
|
**The behavior** is `createStoreInviteService` from `@wix/himalaya/screens`, mounted on the Home's worker beside
|
|
796
800
|
its section services (declare `share` and `ui`). A signed-in tap opens the OS share chooser with one plain-text
|
|
@@ -809,7 +813,7 @@ Apply these interpretation rules:
|
|
|
809
813
|
with only the verified stores, in the app's language when the CLI ships it (he, it, es, fr, de, pt; else
|
|
810
814
|
English, which `generate` records as a gap). A guest's tap opens `himi_sign_in` as a modal with the host's
|
|
811
815
|
one-shot `authContinuation`; only that sign-in, confirmed by the host and consumed once by the next `load` (the
|
|
812
|
-
|
|
816
|
+
button's `onAppear`, or the fresh worker after the account change), opens the chooser. The Home asks with the
|
|
813
817
|
host continuation's non-destructive `claim` operation, which spends only the Invite's own confirmed request, so its
|
|
814
818
|
loads never cancel another feature's pending sign-in. **Older binaries** have no `claim`: there a guest's sign-in
|
|
815
819
|
is not resumed (nothing is shared or cleared automatically) and the guest taps Invite again, signed in, which opens
|
|
@@ -825,7 +829,53 @@ Apply these interpretation rules:
|
|
|
825
829
|
An author's own Invite stays. `validate-topbar` takes the Home's row as the source header's Invite button; with
|
|
826
830
|
no row the button is reported under `omitted`, never as a failure, unless the evidence says the Home should
|
|
827
831
|
have the row (a verified listing and a Detailed Home): then it is `missing`. The `interaction` coverage row of
|
|
828
|
-
the Home-owning source screen's `showInviteButton` maps to `himi_branded_home.invite.button`.
|
|
832
|
+
the Home-owning source screen's `showInviteButton` maps to `himi_branded_home.invite.button`. Removing Invite
|
|
833
|
+
(a re-run with no listing, a retired flow) removes only its button: the call to action stays.
|
|
834
|
+
- **The header's call to action, written by `generate`.** The source shows it only when the header has a
|
|
835
|
+
`settings.callToAction` (`{ id, title, payload? }`) **and** `settings.showCallToAction: true`. `himi one-app
|
|
836
|
+
generate` writes it on the Home with a Detailed header, from that same source header (bottom tabs, converted top
|
|
837
|
+
tabs and a shared-vertical Home included): a filled `Button` with the owner's `title`, id
|
|
838
|
+
`himi_branded_home.cta.button`. Its action goes through the shared action table below. `none` is no button. An
|
|
839
|
+
action the app cannot run, a missing destination screen or an empty label is no button and a gap. A Home without
|
|
840
|
+
a Detailed header whose source header shows a call to action is a gap too. `generate` reports `homeCta`:
|
|
841
|
+
`{ applied: true, label, choice, signIn }` or `{ applied: false, reason, detail }`, where `reason` is `cta_off`,
|
|
842
|
+
`no_action`, `no_label`, `unsupported`, `no_sign_in`, `no_route` (a page link to a page with no screen) or
|
|
843
|
+
`no_detailed_header`. The `interaction` coverage row `…/header/settings/callToAction` maps to the button.
|
|
844
|
+
|
|
845
|
+
**The header actions row** (`himi_branded_home.header_actions`) is one `HStack` right after the header with two
|
|
846
|
+
equal-width slots (`weight: 1` each, 12pt apart, 16pt gutters). Both buttons: the call to action first in
|
|
847
|
+
reading order, then Invite. One button: it takes the leading slot (left in LTR, right in RTL) at the same width,
|
|
848
|
+
and the trailing slot is an empty, non-tappable `Spacer` (`himi_branded_home.header_actions.slot`). No button: no
|
|
849
|
+
row and no blank padding. The header keeps its cover and its immersive bar.
|
|
850
|
+
- **One action table for every configurable control.** The header's call to action, both buttons of a Button
|
|
851
|
+
section, a tappable Image, each repeater item and the interactive banner resolve their action through the same
|
|
852
|
+
table (`source-actions.ts`). Each control keeps its own label and action.
|
|
853
|
+
|
|
854
|
+
| Source action | Himi | Visitor |
|
|
855
|
+
| --- | --- | --- |
|
|
856
|
+
| `url` (website) | `capability.open_url.open` (http/https only) | runs |
|
|
857
|
+
| `mailto` (email) | `mailto:` (one mailbox) | runs |
|
|
858
|
+
| `tel` (phone) | `tel:` (one number) | runs |
|
|
859
|
+
| `goToScreen` | the page's screen: `himi.tab` for a tab, else `himi.open` | runs |
|
|
860
|
+
| `form` (`shortFormId`: UUID or numeric short id) | `himi_form` on that `id` | signs in first |
|
|
861
|
+
| `chat.headerCTA.messageUs` | `himi_business_chat` (the business chat, not the member Inbox) | signs in first |
|
|
862
|
+
| `stores.headerCTA.buyProduct` | `himi_shop` | signs in first |
|
|
863
|
+
| `bookings.headerCTA.bookService` | `himi_services` | signs in first |
|
|
864
|
+
| `ordersCta`, `restaurants-online-ordering-header-cta` | `himi_menu` | signs in first |
|
|
865
|
+
| `none` | no action | — |
|
|
866
|
+
|
|
867
|
+
The source's visitor rule: visitors run links, mail, calls and page links; a form and every business action is
|
|
868
|
+
wrapped in the One App's login (no header action definition sets `visitorModeEnabled`). Here a member-only tap is
|
|
869
|
+
`tier5.himiPage_<screen>_memberAction.openMember` (`_shared/one-app-member-action.ts`, one service per page): a
|
|
870
|
+
member opens the destination at once; a visitor gets `himi_sign_in`, and only a confirmed sign-in opens the
|
|
871
|
+
destination (a cancelled one opens nothing). On a page that is a bottom tab the sign-in is a sheet that returns to
|
|
872
|
+
that tab with the host's continuation; elsewhere it is pushed. Without `himi_sign_in` or that module the control
|
|
873
|
+
gets **no** tap and a gap: it never opens a member-only flow to visitors. Any other action (an unknown business
|
|
874
|
+
action, a bad link, a `goToScreen` target containing `|`, an unsafe numeric form id) is no tap and a gap naming
|
|
875
|
+
it. The trim keeps every destination an `openMember` tap names. The destination's own rules still apply. A form
|
|
876
|
+
with a field the app cannot fill (or a conditional rule) shows a notice that opens the site's own page, when the
|
|
877
|
+
app has its site URL (`provision` binds it). A dish with options shows "Order it on the restaurant's website" but
|
|
878
|
+
has no link to it: record that as a parity gap when a restaurant action is migrated.
|
|
829
879
|
- **Preserve source badge behavior.** Collected button definitions retain
|
|
830
880
|
`badgeObserverId`, `badgeListenerId` and `showBadgeOnVisitorMode`. Keep the
|
|
831
881
|
counter's actual site/member/shopper scope and visitor policy; the source's
|
package/guides/qa-builds.md
CHANGED
|
@@ -407,9 +407,16 @@ token, creates the Mac-pool job, and polls it. The compute never moves.
|
|
|
407
407
|
The install link comes back through a **result callback**: the pool POSTs
|
|
408
408
|
`/v1/dist/result` with a per-job token, and `himi dist status` reads the record that
|
|
409
409
|
writes. Two things bound a leaked token: the artifact URL must be HTTPS on an allowed
|
|
410
|
-
host, and the
|
|
411
|
-
|
|
412
|
-
|
|
410
|
+
host, and the token expires 24h after the job was created — on the result **and** on the
|
|
411
|
+
contract, seed, signing and Firebase config routes (the captcha route instead refuses a job
|
|
412
|
+
once it has finished). It is deliberately **not**
|
|
413
|
+
single-use — Job Service retries a failed job with the same env, so the same token
|
|
414
|
+
legitimately reports twice.
|
|
415
|
+
|
|
416
|
+
The token can leak because the pool's runner prints the job's parameters into its Buildkite
|
|
417
|
+
log before it clones the repo. The plain-text `envVars` it prints never carry the token; the
|
|
418
|
+
`--himi-dist` argument does, base64url-encoded, which anyone with the log can decode — so the
|
|
419
|
+
24h expiry is what bounds it.
|
|
413
420
|
|
|
414
421
|
An early return in the build now reports a **FAILURE with the reason** rather than
|
|
415
422
|
exiting 0: a job that produced no artifact must never read `SUCCESS` with no link.
|
|
@@ -1527,7 +1534,19 @@ himi dist --app <app> --platform android --aab --wait --target bo
|
|
|
1527
1534
|
`storeBuild: { metaSiteId, storeId }` and its own `attemptId` (required). The service has already
|
|
1528
1535
|
checked the site's owner, plan, saved store id and its store-app hold, and records the build once
|
|
1529
1536
|
the plane accepts it, so the plane makes no owner or plan check, keeps no hold or record of its
|
|
1530
|
-
own, reports nothing back, and builds under `storeId`.
|
|
1537
|
+
own, reports nothing back, and builds under `storeId`. A Google Play build may also send
|
|
1538
|
+
`storeBuild.googleServicesJson`, the app's google-services.json as a string, for push (MOBPUB-870).
|
|
1539
|
+
The plane checks it as it checks an owner bundle's file: valid JSON of at most 256KB, not the
|
|
1540
|
+
template placeholder, a `project_info.project_id` and `project_info.project_number`, and exactly one
|
|
1541
|
+
Android client for `storeId` with a `mobilesdk_app_id` and an `api_key[].current_key` (the
|
|
1542
|
+
google-services Gradle task fails without any of them). It keeps the file under the job's token for
|
|
1543
|
+
the pool to fetch from `/v1/dist/android-config`, and blanks it when the job ends: on success, on
|
|
1544
|
+
cancel, and on the first job read that sees Job Service end a failed job (Job Service may retry a
|
|
1545
|
+
failure, so the plane keeps the file until then). A file that fails the check is not used and refuses nothing: the build
|
|
1546
|
+
runs without push, as one with no file does. The job shows `storeBuild.firebase`
|
|
1547
|
+
(`{ packageName, firebaseProjectId, configSha256 }`) or `storeBuild.firebaseRefused` (the check's
|
|
1548
|
+
code), and the build log has a `[dist:firebase]` line. Himalaya makes no Branded or Containers call
|
|
1549
|
+
for it. Every check of the plane's own still runs
|
|
1531
1550
|
(shape, release, shell, store marker, icon, kill switch, the per-app cap; for the App Store,
|
|
1532
1551
|
`PrepareAppleCertificates`, whose bundle id must equal `storeId`: `409 store_id_mismatch`). The app
|
|
1533
1552
|
must be bound to `metaSiteId` (`403 store_build_site_mismatch`); only the store-build fields are
|
|
@@ -1608,7 +1627,8 @@ uploads Himi didn't build, add `--min-version-code <the listing's highest + 1>`.
|
|
|
1608
1627
|
- **It runs on Linux.** It's the one brokered job that does: `linux:dist:android` runs
|
|
1609
1628
|
`native-ci/scripts/run-android.mjs`, which sets up the Android SDK and JDK before `run-dist`.
|
|
1610
1629
|
- **The inputs come from the request:** `androidPackageName` and `googleServicesJson`, with nothing read
|
|
1611
|
-
from Branded, the Firebase pool or mobile-apps-containers-builder. The
|
|
1630
|
+
from Branded, the Firebase pool or mobile-apps-containers-builder. The file must pass the check above
|
|
1631
|
+
(`400 owner_bundle_firebase_invalid`, or `owner_bundle_firebase_package_mismatch` for the client). The package name can't be under
|
|
1612
1632
|
Wix's namespaces, but ownership isn't checked: Google Play binds a name at upload. The Firebase file is
|
|
1613
1633
|
stored apart from the job record, served by `GET /v1/dist/android-config` to that job's token, and
|
|
1614
1634
|
blanked when the job succeeds or is canceled, since Job Service may retry a failed one.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1880.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "himi — the Himalaya authoring CLI. Build a Tier-5 content package on your own machine, push it to the production serve as a draft, preview it on web + Himi Player, and read worker logs back — the remote dev loop. Wraps @himalaya/serve-cli for transport.",
|
|
6
6
|
"keywords": [
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"artifactId": "himalaya-cli"
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
"falconPackageHash": "
|
|
85
|
+
"falconPackageHash": "98e2d25162e2488a622c9cc3dc76706365531e4951a333c524672d60"
|
|
86
86
|
}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// A migrated One App page's actions that need a member (himi one-app generate, source-actions.ts): a form, or a business call
|
|
2
|
+
// to action (message us, buy, book, order). The One App runs them through `ensureLoginWrapper`: a visitor signs in first and
|
|
3
|
+
// the action then continues; closing the sign-in runs nothing. A member goes straight on.
|
|
4
|
+
//
|
|
5
|
+
// One service per page, one action: `openMember`, with the tap's params (_shared/member-screen.ts):
|
|
6
|
+
// screenId the destination screen
|
|
7
|
+
// id optional: the entity it opens on (a form id)
|
|
8
|
+
// signInScreenId the app's sign-in screen
|
|
9
|
+
// signInPresentation optional: "sheet" on a page that is a bottom tab; the sign-in then closes and opens the screen on
|
|
10
|
+
// returnTab that tab. Without them the sign-in is pushed and pushes the screen itself (himi-store-account).
|
|
11
|
+
//
|
|
12
|
+
// The session is asked at the tap, never read from a load, and only the newest tap navigates. A modal sign-in also carries the
|
|
13
|
+
// host's continuation, so a sign-in whose account change replaces the form's worker (Android) still resumes, once; a route alone
|
|
14
|
+
// never opens the screen. The action name is the trim planner's (`openMember`): it keeps the literal `screenId` it opens.
|
|
15
|
+
import { defineService, navigate, type ServiceHandle } from "@himalaya/state";
|
|
16
|
+
import { CONTINUATION_BUDGET_MS, memberScreenOpener, within } from "./member-screen.js";
|
|
17
|
+
import { memberIdentity } from "./himi-account.js";
|
|
18
|
+
|
|
19
|
+
/** The session at the tap, as the opener reads it: any non-empty value is a member. A host can answer `signedIn: true` with no
|
|
20
|
+
* email (a member who signed in another way): that is a member too, never a visitor sent to sign in again. */
|
|
21
|
+
const sessionMarker = (): Promise<string> =>
|
|
22
|
+
within(memberIdentity().then((identity) => identity.signedIn ? identity.email || "signed-in" : "", () => ""), CONTINUATION_BUDGET_MS, "");
|
|
23
|
+
|
|
24
|
+
export interface OneAppMemberActionState {
|
|
25
|
+
/** How many taps navigated: a test hook, and a value the page never binds. */
|
|
26
|
+
opened: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type Actions = { openMember: (state: OneAppMemberActionState, arg?: unknown) => Promise<OneAppMemberActionState | undefined> };
|
|
30
|
+
|
|
31
|
+
export function registerOneAppMemberAction(name: string, _options: Record<string, never> = {}): ServiceHandle<OneAppMemberActionState> {
|
|
32
|
+
const open = memberScreenOpener(sessionMarker);
|
|
33
|
+
const svc: ServiceHandle<OneAppMemberActionState> = defineService<OneAppMemberActionState, Actions>(name, {
|
|
34
|
+
state: { opened: 0 } as OneAppMemberActionState,
|
|
35
|
+
notHydrated: ["opened"],
|
|
36
|
+
actions: {
|
|
37
|
+
openMember: async (_s, arg) => {
|
|
38
|
+
const nav = await open(arg);
|
|
39
|
+
if (!nav) return undefined;
|
|
40
|
+
const now: OneAppMemberActionState = svc.getState();
|
|
41
|
+
return navigate({ ...now, opened: now.opened + 1 }, nav);
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
return svc;
|
|
46
|
+
}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
//
|
|
7
7
|
// The tap's params:
|
|
8
8
|
// screenId the member screen
|
|
9
|
+
// id optional: the entity the screen opens on (a form id). The member gets it as the screen's `id`; a
|
|
10
|
+
// guest's sign-in carries it as `returnId`, and himi-store-account opens the screen on it once signed in
|
|
9
11
|
// signInScreenId the app's sign-in screen; without it the tap opens `screenId` as is
|
|
10
12
|
// signInPresentation "sheet" | "full_screen": the sign-in opens as that modal, and once signed
|
|
11
13
|
// in it closes and opens the screen on `returnTab`. Pushed (no presentation),
|
|
@@ -64,10 +66,10 @@ export function within<T>(read: Promise<T>, ms: number, fallback: T): Promise<T>
|
|
|
64
66
|
|
|
65
67
|
/** Where a tap goes, given the session's email ("" for a guest). null: no screen named. */
|
|
66
68
|
export function memberScreenNav(arg: unknown, email: string): NavDirective | null {
|
|
67
|
-
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId");
|
|
69
|
+
const screenId = strField(arg, "screenId"), signInScreenId = strField(arg, "signInScreenId"), id = strField(arg, "id");
|
|
68
70
|
if (!screenId) return null;
|
|
69
|
-
if (!signInScreenId || email) return { screenId };
|
|
70
|
-
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId };
|
|
71
|
+
if (!signInScreenId || email) return id ? { screenId, args: { id } } : { screenId };
|
|
72
|
+
const args: Record<string, string> = { mode: "signin", returnScreenId: screenId, ...(id ? { returnId: id } : {}) };
|
|
71
73
|
const presentation = strField(arg, "signInPresentation");
|
|
72
74
|
if (presentation !== "sheet" && presentation !== "full_screen") return { screenId: signInScreenId, args };
|
|
73
75
|
if (strField(arg, "returnTab")) args.returnTab = strField(arg, "returnTab");
|