@wix/himalaya-cli 0.1829.0 → 0.1831.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/iap-checkout.mjs +6 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +6 -2
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{4342c013d2d1938e1fd0eb5ad8808d0a7425d67ea080f4ce615db01a7671e842.bin → 70836790496f742deee3b0e0c83394af3b9fc275d091c6497786d90201392cf4.bin} +1 -1
- package/dist/browser-plane/sw.js +9 -9
- package/dist/cli.mjs +1247 -1083
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/designing-himi-screens.md +46 -18
- package/guides/getting-started.md +1 -1
- package/guides/himi-skill.md +1 -1
- package/guides/index.json +6 -0
- package/guides/push-cli-onboarding.md +5 -0
- package/guides/skill.md +1 -0
- package/guides/web-ux.md +134 -0
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +29 -2
- package/templates/beauty-salon/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +1 -1
- package/templates/beauty-salon/tier5-src/himi-branded-lite-plans/index.ts +4 -1
- package/templates/beauty-salon/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +5 -2
- package/templates/branded-lite/dev/index.ts +32 -2
- package/templates/branded-lite/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +1 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-plans/index.ts +4 -1
- package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +5 -2
- package/templates/branded-lite/tier5-src/himi-branded-lite-video/index.ts +4 -4
- package/templates/branded-lite/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/branded-lite/tier5-src/himi-store-product/index.ts +5 -2
- package/templates/brandy/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/community-club/dev/index.ts +26 -2
- package/templates/community-club/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/community-club/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/conference/dev/index.ts +2 -0
- package/templates/conference/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/conference/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/events-meetups/dev/index.ts +26 -2
- package/templates/events-meetups/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/events-meetups/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/fitness-gym/dev/index.ts +2 -0
- package/templates/fitness-gym/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/fitness-gym/tier5-src/himi-booking-time/index.ts +1 -1
- package/templates/fitness-gym/tier5-src/himi-branded-lite-plans/index.ts +4 -1
- package/templates/fitness-gym/tier5-src/himi-branded-lite-program/index.ts +5 -2
- package/templates/fitness-gym/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/gym-fitness/dev/index.ts +30 -2
- package/templates/gym-fitness/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +1 -1
- package/templates/gym-fitness/tier5-src/himi-branded-lite-plans/index.ts +4 -1
- package/templates/gym-fitness/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +5 -2
- package/templates/medical-services/dev/index.ts +2 -0
- package/templates/medical-services/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/medical-services/tier5-src/himi-booking-time/index.ts +1 -1
- package/templates/medical-services/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/nonprofit-cause/dev/index.ts +27 -2
- package/templates/nonprofit-cause/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-plans/index.ts +4 -1
- package/templates/nonprofit-cause/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/personal-fitness-trainer/dev/index.ts +27 -1
- package/templates/personal-fitness-trainer/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/personal-fitness-trainer/tier5-src/himi-booking-time/index.ts +1 -1
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-plans/index.ts +4 -1
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-video/index.ts +4 -4
- package/templates/personal-fitness-trainer/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/podcast-creator/dev/index.ts +27 -2
- package/templates/podcast-creator/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/podcast-creator/tier5-src/himi-branded-lite-plans/index.ts +4 -1
- package/templates/podcast-creator/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/portfolio-creative/dev/index.ts +27 -2
- package/templates/portfolio-creative/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/portfolio-creative/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +5 -2
- package/templates/restaurant/dev/index.ts +26 -2
- package/templates/restaurant/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/restaurant/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/retail-store/dev/index.ts +26 -2
- package/templates/retail-store/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/retail-store/tier5-src/himi-store-product/index.ts +5 -2
- package/templates/salon-spa/dev/index.ts +2 -0
- package/templates/salon-spa/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/salon-spa/tier5-src/himi-booking-time/index.ts +1 -1
- package/templates/salon-spa/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/wholesale-store/dev/index.ts +1 -0
- package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +49 -10
- package/templates/wholesale-store/tier5-src/himi-store-product/index.ts +5 -2
- package/templates/yoga-studio/dev/index.ts +30 -2
- package/templates/yoga-studio/tier5-src/_shared/iap-attendance-purchase.ts +21 -2
- package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +1 -1
- package/templates/yoga-studio/tier5-src/himi-branded-lite-plans/index.ts +4 -1
- package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +5 -2
- package/templates/yoga-studio/tier5-src/himi-store-account/index.ts +49 -10
|
Binary file
|
|
@@ -99,6 +99,8 @@ they decide what a phone screen looks like, and this guide decides how to compos
|
|
|
99
99
|
Render `--device tablet` (834 points) and `--device desktop` and look for a half of the screen
|
|
100
100
|
with nothing in it, or a row whose price sits a screen's width from its name. Space below
|
|
101
101
|
a short list is fine.
|
|
102
|
+
A screen that also runs in a browser has its own rules for the desktop and the phone web
|
|
103
|
+
(pointer, keyboard, links, line length, public pages): read `himi docs web-ux`.
|
|
102
104
|
|
|
103
105
|
---
|
|
104
106
|
|
|
@@ -837,23 +839,49 @@ air and render on every current binary.
|
|
|
837
839
|
|
|
838
840
|
## 6. Motion & delight — deliberate, never decorative
|
|
839
841
|
|
|
840
|
-
Motion earns its place by clarifying, not by moving:
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
and
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
842
|
+
Motion earns its place by clarifying, not by moving. The renderers already time the common cases:
|
|
843
|
+
a press scales to 0.96 over about 160ms, a `transition` enters from a slight scale and fade over
|
|
844
|
+
about 240ms and exits faster than it entered, and a `StatefulSection` cross-fades its skeleton
|
|
845
|
+
into the content. The author's job is to choose where motion happens, almost never how long it
|
|
846
|
+
takes, and how often.
|
|
847
|
+
|
|
848
|
+
- **One entrance per screen.** At most one node carries `appear` or `transition`: the section that
|
|
849
|
+
is the point of the screen. A list that cascades in uses one `staggerMs` on the list with the
|
|
850
|
+
`transition` on its row template, which is the same one entrance. Never `appear` on every
|
|
851
|
+
section, and nothing animates on what people do many times a minute: a tab switch, a toggle, a
|
|
852
|
+
filter chip, typing.
|
|
853
|
+
- **`pressFeedback` only where a tap is.** The renderer applies it only to an interactive node, so
|
|
854
|
+
set it beside `modifiers.onTap` or on a `Button`, or leave the default; on a plain `Card` it does
|
|
855
|
+
nothing and reads as a promise the screen does not keep. `haptic` rides the same tap.
|
|
856
|
+
- **Celebration only at a completion moment.** `confetti`, `meshGradient`, `animatedGradient` and
|
|
857
|
+
`vectorAnim: "success"` belong to the one screen that ends a purchase, a booking or a goal. A
|
|
858
|
+
home, a list, a detail or a form carries none.
|
|
859
|
+
- **Motion names a token, never a number.** `appear`, `pressMotion` and a transition's `motion`
|
|
860
|
+
take a `{ token: "smooth" }` naming an entry of the app's `motions` registry in `tokens.json`
|
|
861
|
+
(add the entry there if it is missing). A bare string or a number is not the schema's shape: the
|
|
862
|
+
web renderer tolerates it and the native decoders are not required to.
|
|
863
|
+
- **Crisp for data, smooth for content, bouncy for play.** `modifiers.motion` picks the personality
|
|
864
|
+
of a subtree: `"crisp"` for a dashboard, a cart, a form or a working screen, `"smooth"` (the
|
|
865
|
+
default) for content, `"bouncy"` only for something people drag or play with.
|
|
866
|
+
- **Leave `respectReducedMotion` at its default, true.** With reduce motion on, `transition`,
|
|
867
|
+
`appear`, `parallax`, `revealOnScroll`, `confetti`, `animatedGradient` and `staggerMs` stop by
|
|
868
|
+
themselves and the content is shown in place; set it `false` only on motion that is the
|
|
869
|
+
information itself, such as a progress indicator someone is waiting on, never on decoration.
|
|
870
|
+
Haptics follow their own setting and stay on.
|
|
871
|
+
- **A shared element has one `transitionId`, on both ends.** The same id on the list tile's `Image`
|
|
872
|
+
and the detail's hero morphs frame and corner radius between them across the navigation; keep
|
|
873
|
+
the hero at the tile's `aspectRatio` so only its size changes. A row template carries a templated
|
|
874
|
+
id (`transitionId: "card-$item.id"`); a literal id used once matches nothing, and one used on
|
|
875
|
+
more than two nodes matches nothing either. The same id also morphs **within one screen**: when
|
|
876
|
+
one update removes a node carrying `transitionId: X` and inserts another carrying `X` (a card
|
|
877
|
+
finishing in a "creating" strip and appearing in the grid), the inserted node animates from the
|
|
878
|
+
removed one's frame on its own `motion`; under reduce motion it swaps instantly. Renderers: iOS
|
|
879
|
+
`matchedGeometryEffect` in a per-screen namespace; Android a bounds-handoff `graphicsLayer`
|
|
880
|
+
animation; web FLIP. Demo: demo-app Motion → In-screen match.
|
|
881
|
+
|
|
882
|
+
Use `animateContentSize` on a container that grows (a disclosure, "read more"), not a
|
|
883
|
+
`transition`, which would replay an entrance on content that was already there. If every element
|
|
884
|
+
moves, nothing reads as important.
|
|
857
885
|
|
|
858
886
|
---
|
|
859
887
|
|
|
@@ -972,7 +1000,7 @@ Run this punch list on the screen (it's also a good reviewer checklist):
|
|
|
972
1000
|
- [ ] When a business book exists, do those fallbacks use the site's OWN words (`book.copy`) rather than stock phrases — and in `book.copy.language`?
|
|
973
1001
|
- [ ] Spacing on the `xs…xl` scale, consistent rhythm within vs. between groups?
|
|
974
1002
|
- [ ] `accessibility_label` on every icon / image / non-text control (separate from `id`)?
|
|
975
|
-
- [ ] `
|
|
1003
|
+
- [ ] Motion (§6) — at most one entrance, `pressFeedback` only on taps, no celebration outside a completion screen, motion named by token, `respectReducedMotion` left at its default?
|
|
976
1004
|
- [ ] Verified in **both** light and dark (and highContrast for load-bearing color)?
|
|
977
1005
|
- [ ] RTL-safe — leading/trailing alignment + logical insets throughout?
|
|
978
1006
|
- [ ] Kit-clean — no hardcoded look a kit would override; `material`/gradient/background precedence respected?
|
|
@@ -377,7 +377,7 @@ and the loading/empty/error/ready idiom they all share
|
|
|
377
377
|
(the `recipe-four-state` guide (its installed skill, or `himi docs recipe-four-state`) — every recipe that loads or writes data shows a loading state,
|
|
378
378
|
a classified error state and a recovery action where the user can fix the failure). Then — **before you
|
|
379
379
|
design** — read the `designing-himi-screens` guide (its installed skill, or `himi docs designing-himi-screens`) for its phone rules and product
|
|
380
|
-
screen shapes, the `ios-ux` guide (its installed skill, or `himi docs ios-ux`) and the `android-ux` guide (its installed skill, or `himi docs android-ux`) for each platform, and, for a
|
|
380
|
+
screen shapes, the `ios-ux` guide (its installed skill, or `himi docs ios-ux`) and the `android-ux` guide (its installed skill, or `himi docs android-ux`) for each platform, the `web-ux` guide (its installed skill, or `himi docs web-ux`) when it runs in a browser, and, for a
|
|
381
381
|
multi-screen app, the mobile contract in the `mobile-ux` guide (its installed skill, or `himi docs mobile-ux`); then follow
|
|
382
382
|
*Author a Tier-5 screen*. Judge each screen with
|
|
383
383
|
`himi render <screenId> --platform ios --device iphone` and `--platform android --device pixel`,
|
package/guides/himi-skill.md
CHANGED
|
@@ -400,7 +400,7 @@ and the loading/empty/error/ready idiom they all share
|
|
|
400
400
|
(the `recipe-four-state` guide (its installed skill, or `himi docs recipe-four-state`) — every recipe that loads or writes data shows a loading state,
|
|
401
401
|
a classified error state and a recovery action where the user can fix the failure). Then — **before you
|
|
402
402
|
design** — read the `designing-himi-screens` guide (its installed skill, or `himi docs designing-himi-screens`) for its phone rules and product
|
|
403
|
-
screen shapes, the `ios-ux` guide (its installed skill, or `himi docs ios-ux`) and the `android-ux` guide (its installed skill, or `himi docs android-ux`) for each platform, and, for a
|
|
403
|
+
screen shapes, the `ios-ux` guide (its installed skill, or `himi docs ios-ux`) and the `android-ux` guide (its installed skill, or `himi docs android-ux`) for each platform, the `web-ux` guide (its installed skill, or `himi docs web-ux`) when it runs in a browser, and, for a
|
|
404
404
|
multi-screen app, the mobile contract in the `mobile-ux` guide (its installed skill, or `himi docs mobile-ux`); then follow
|
|
405
405
|
*Author a Tier-5 screen*. Judge each screen with
|
|
406
406
|
`himi render <screenId> --platform ios --device iphone` and `--platform android --device pixel`,
|
package/guides/index.json
CHANGED
|
@@ -221,6 +221,12 @@
|
|
|
221
221
|
"category": "Design & UX",
|
|
222
222
|
"file": "android-ux.md"
|
|
223
223
|
},
|
|
224
|
+
{
|
|
225
|
+
"id": "web-ux",
|
|
226
|
+
"title": "Design for the web",
|
|
227
|
+
"category": "Design & UX",
|
|
228
|
+
"file": "web-ux.md"
|
|
229
|
+
},
|
|
224
230
|
{
|
|
225
231
|
"id": "tokens",
|
|
226
232
|
"title": "Design tokens reference",
|
|
@@ -117,6 +117,11 @@ App Store profile stored on the site grants Sign in with Apple. It is `false` wh
|
|
|
117
117
|
is missing or on another bundle. Otherwise it is `null` when there is no stored profile for the
|
|
118
118
|
bundle (`apple_capability_unreadable`), or when that profile lacks Sign in with Apple
|
|
119
119
|
(`stored_profile_lacks_apple_sign_in`), because the binary may be signed with another profile.
|
|
120
|
+
`signIn.iosGoogleHidden` is `true` when Google is set up for iOS but the Apple connection is missing: the iOS
|
|
121
|
+
app shows Google only beside Sign in with Apple, because the App Store requires it (guideline 4.8),
|
|
122
|
+
so Google is hidden on iOS while that connection is missing, and `signIn.hints` says so first. It is
|
|
123
|
+
`null` otherwise, never `false`: the site's record says nothing about the app binary, and a binary
|
|
124
|
+
built without Sign in with Apple hides Google on iOS too.
|
|
120
125
|
`signIn.hints` says who can fix what the owner cannot: for `ios_client_missing`, the Branded team
|
|
121
126
|
(or a person in the Firebase console) must add an iOS app to the app's Firebase project and sync
|
|
122
127
|
social login.
|
package/guides/skill.md
CHANGED
|
@@ -30,6 +30,7 @@ guides in full: its installed skill, or else its own URL (or `himi docs <id>` fr
|
|
|
30
30
|
- https://apps.wix.com/_api/himi-serve/docs/ios-ux.md — Apple's patterns mapped to the Himi field that builds each one.
|
|
31
31
|
- https://apps.wix.com/_api/himi-serve/docs/android-ux.md — Material's patterns mapped the same way.
|
|
32
32
|
- https://apps.wix.com/_api/himi-serve/docs/designing-himi-screens.md — composing one screen from components and tokens.
|
|
33
|
+
- https://apps.wix.com/_api/himi-serve/docs/web-ux.md — also this one when the app runs in a browser (desktop or phone web).
|
|
33
34
|
|
|
34
35
|
A grep or summarized excerpt does not satisfy this. The iOS and Android guides are what make the
|
|
35
36
|
app native: the shell already draws the tab bar, title and Back on each platform, a shared `Fab`
|
package/guides/web-ux.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Designing a Himi App for the Web
|
|
2
|
+
|
|
3
|
+
Read this before you compose a screen that will also run in a browser, on a desktop or on a
|
|
4
|
+
phone, and again before you render it at `--device desktop`. Each rule is a decision and the Himi
|
|
5
|
+
field that builds it. Read it with `himi docs designing-himi-screens` (its phone rules and its
|
|
6
|
+
wide-surface rules still apply) and with `himi docs ios-ux` and `himi docs android-ux`: the
|
|
7
|
+
browser renders the **same** descriptor as the iPhone and Android apps, so a decision made here is
|
|
8
|
+
made for every platform.
|
|
9
|
+
|
|
10
|
+
**On the web a Himi app is a web app.** The web host draws the app's navigation and one content
|
|
11
|
+
column around each screen. Two kinds of screen carry most of the web's weight, and both are built
|
|
12
|
+
from the same components as a phone screen:
|
|
13
|
+
|
|
14
|
+
- **A working screen** — orders, bookings, an inbox, a dashboard: a list beside the selected item,
|
|
15
|
+
filters, and actions that act on what is selected.
|
|
16
|
+
- **A public page** — the first screen someone sees before signing in: what the business is, why
|
|
17
|
+
it matters, and one way to start. It is a screen of the app, not a separate site. A page of the
|
|
18
|
+
customer's existing Wix site belongs in a `WebView` (`sitePage(site, { path })`, see
|
|
19
|
+
`designing-himi-screens` §4), not rebuilt by hand.
|
|
20
|
+
|
|
21
|
+
## What the web host does for you
|
|
22
|
+
|
|
23
|
+
- **The shell draws the navigation, and its chrome depends on the width.** With
|
|
24
|
+
`navigation.navKind: "responsive"` in `config.ts` the host draws a sidebar rail from an 840px
|
|
25
|
+
container and bottom tabs below it; `"sidebar"` draws the rail, `"bottomTabs"` (the default)
|
|
26
|
+
draws tabs and `"single"` draws neither. A screen never draws a tab row or a sidebar of its own.
|
|
27
|
+
- **The host centres every screen in a column, and the column's width is the app's choice.**
|
|
28
|
+
Beside a sidebar rail the screen sits in a column capped at the `contentMaxWidth` token's
|
|
29
|
+
`expanded` value (920px by default). With tabs, a stack or `single`, the whole app is one centred
|
|
30
|
+
column `contentMaxWidth.base` wide at every desktop width: 480px by default, a phone column in
|
|
31
|
+
the middle of the window. `himi render --device desktop` draws exactly what the host will, so the
|
|
32
|
+
PNG is the check.
|
|
33
|
+
- **Every tappable node already has hover, a focus ring and the keyboard.** A node with
|
|
34
|
+
`modifiers.onTap` dims slightly under a pointer, gets a tab stop, a 2px accent focus ring and
|
|
35
|
+
Enter / Space; a `pressFeedback` previews on hover. None of it is authored: the design decision is
|
|
36
|
+
which node carries `onTap`.
|
|
37
|
+
- **There is no status bar and no home indicator.** At phone width the browser's own address bar
|
|
38
|
+
takes the top, and the app's bar sits right under it.
|
|
39
|
+
|
|
40
|
+
## Open up the desktop width
|
|
41
|
+
|
|
42
|
+
- **Choose the width the app needs before you compose a screen.** A phone-sized task (sign-in, one
|
|
43
|
+
form, a settings list) reads well in the default 480px column, and needs nothing. A working app
|
|
44
|
+
with destinations sets `navigation.navKind: "responsive"` in `config.ts`: from 840px the rail
|
|
45
|
+
appears and every screen gets the `expanded` column beside it. An app or page with no
|
|
46
|
+
destinations to list (a public page, a single-screen tool) widens the column itself in
|
|
47
|
+
`tokens.json`: `"contentMaxWidth": { "base": 1120, "medium": 720, "expanded": 1120 }`. `base` is
|
|
48
|
+
the website's desktop column; a phone is narrower than it, and tablets and the Mac window use
|
|
49
|
+
`medium` and `expanded`. Without one of these, every `columnsMedium`, `columnsExpanded` and
|
|
50
|
+
`SplitView` below stays in its phone shape on the desktop, because the column never reaches 600.
|
|
51
|
+
|
|
52
|
+
## A working screen at desktop width
|
|
53
|
+
|
|
54
|
+
- **The list sits beside the selected item.** In the wide column, a working screen is a `SplitView` with the list as
|
|
55
|
+
its `primary` (`primaryMaxWidth: 360` to 420) and the selected item as its `detail`: side by
|
|
56
|
+
side from 840px, stacked below. When the detail is short, a `grid({ columns: 1, columnsMedium:
|
|
57
|
+
2 })` splits from 600 instead.
|
|
58
|
+
- **Rows or a table, never a card per item.** A row is a `ListItem` (or the inbox `hstack` row in
|
|
59
|
+
`designing-himi-screens`) with its status as a `Badge` and its time or amount in `trailing`; a
|
|
60
|
+
record with four or more columns that people compare is a `DataTable`.
|
|
61
|
+
- **Filters are on the screen, above the list.** A `SegmentedControl` for two to four states, a
|
|
62
|
+
`FilterChips` row for more, a `SearchField` when there are dozens of items. Filtering is never
|
|
63
|
+
hidden behind a menu on desktop.
|
|
64
|
+
- **An action on the selection sits in the bar or beside the selection, never a footer across the
|
|
65
|
+
window.** A bulk action ("Mark shipped") is a `topBar.items` entry or a `tonal` button at the
|
|
66
|
+
top of the list; the detail pane's own action ends the detail. No `stickyFooter`.
|
|
67
|
+
|
|
68
|
+
## A public page
|
|
69
|
+
|
|
70
|
+
- **A photo first.** The page opens with one strong photo (an `Image` with `contentMode: "fill"`
|
|
71
|
+
and a fixed height, edge to edge), and the name and a one-sentence promise over or under it.
|
|
72
|
+
- **The benefits side by side from 600.** Three short blocks, each a title and two lines, in
|
|
73
|
+
`grid({ columns: 1, columnsMedium: 3 })`: stacked on a phone, one row in a widened desktop column.
|
|
74
|
+
- **Prose in a measured column.** Body text reads at 60 to 90 characters a line, 560 to 720px:
|
|
75
|
+
put the copy in a `vstack` with `maxWidth: 720` inside a `center`-aligned parent. The photo and
|
|
76
|
+
the benefit grid may run wider; a paragraph never runs the window.
|
|
77
|
+
- **One call to action, in the page.** One filled `Button` ("Book a class", "Reserve a table")
|
|
78
|
+
after the promise; a reminder at the end of the page is `tonal`, never a second filled one (`himi
|
|
79
|
+
validate` warns: `multiple_prominent_actions`); no `stickyFooter`, which on a desktop is a
|
|
80
|
+
bar across the whole column, far from the promise it acts on. Every other action is `tonal`, `secondary` or a link.
|
|
81
|
+
|
|
82
|
+
## Every screen at 390, 840 and 1280
|
|
83
|
+
|
|
84
|
+
- **Photo tiles change shape with the width.** `grid({ columns: 2, columnsMedium: 3,
|
|
85
|
+
columnsExpanded: 4 })`; a shelf stays a horizontal rail with more covers than fit. Two columns in
|
|
86
|
+
a 920px column are two 450px tiles: a phone stretched.
|
|
87
|
+
- **A row keeps its time, price or count beside its title.** Short, bounded rows (a day's classes,
|
|
88
|
+
a menu) go in `grid({ columns: 1, columnsMedium: 2 })` so each cell is 400 to 600px and its
|
|
89
|
+
`trailing` meta stays beside the name. Only a long or paged list at the scroll root (a chat list,
|
|
90
|
+
a feed) runs the full width with its meta at the far edge.
|
|
91
|
+
- **A form is a column, not the window.** From 600, put the fields beside their explanation with
|
|
92
|
+
`grid({ columns: 1, columnsMedium: 2 })` and the submit `Button` as the last child of the fields
|
|
93
|
+
column; or keep one column and cap it with `maxWidth: 480` in a `center` parent (sign-in). A
|
|
94
|
+
`TextField` with no column around it is as wide as the app's whole column.
|
|
95
|
+
- **Enter submits the last field.** Give the form's last single-line field `submitLabel: "go"`
|
|
96
|
+
(or `"send"`, `"search"`) and an `onSubmit` with the same action as the button, so the keyboard
|
|
97
|
+
path ends where the pointer path does.
|
|
98
|
+
|
|
99
|
+
## Pointer and keyboard
|
|
100
|
+
|
|
101
|
+
- **One tap target per tile or row.** Put `modifiers.onTap` on the tile's `vstack` or the row, and
|
|
102
|
+
nothing inside it: an `Image` with its own `onTap` inside a tile that taps gives the pointer two
|
|
103
|
+
targets and the keyboard two stops. An image on its own, outside any tap, opens full screen by
|
|
104
|
+
itself (`himi docs image-preview`).
|
|
105
|
+
- **A link navigates; a button acts.** Text that opens a URL is a `style: "link"` button whose
|
|
106
|
+
action is `capability.open_url.open` with `params: { url }`, given the link role as a modifier:
|
|
107
|
+
`withModifiers(button({ title: "Instagram", style: "link", action }), { accessibilityRole:
|
|
108
|
+
"link" })`. It keeps the width of its words and a screen reader says "link". A row that opens a URL
|
|
109
|
+
(directions, a phone number, a profile) is a link too: give the row `accessibilityRole: "link"`
|
|
110
|
+
in its modifiers beside its `onTap`. A filled button never opens a URL; a button changes state or submits. Inside
|
|
111
|
+
prose, a `RichText` span with `marks: ["link"]`.
|
|
112
|
+
- **At most one `initialFocus` per screen.** Keyboard focus lands there on arrival: the search field
|
|
113
|
+
of a search screen, the first field of a form. Without one the host focuses the content column so
|
|
114
|
+
a screen reader reads the title, which is right for most screens.
|
|
115
|
+
|
|
116
|
+
## Dark and right-to-left
|
|
117
|
+
|
|
118
|
+
- **The scheme follows the OS, live.** Every colour comes from a scheme-aware token, never a hex
|
|
119
|
+
literal on a node; check with `himi render <screen> --device desktop --scheme dark`.
|
|
120
|
+
- **Right-to-left mirrors the whole page.** The rail moves to the right, a split's primary pane
|
|
121
|
+
moves to the right, `leading` and `trailing` flip. Check with `--device desktop --rtl`.
|
|
122
|
+
|
|
123
|
+
## Check it
|
|
124
|
+
|
|
125
|
+
Render `himi render <screen> --device iphone`, `--device tablet` and `--device desktop`, then
|
|
126
|
+
`--device desktop --scheme dark` and `--device desktop --rtl`.
|
|
127
|
+
|
|
128
|
+
- The desktop render is a phone column only when the task is phone-sized; otherwise it has no
|
|
129
|
+
empty half, no phone bar across the column, no paragraph wider than about 720px, and more in view
|
|
130
|
+
than the phone shows (more columns or a split).
|
|
131
|
+
- No short row has its meta a screen's width from its title.
|
|
132
|
+
- Each tile or row is one tap target; a URL opens from a link; there is one filled `Button`.
|
|
133
|
+
- The dark render has no light panel left behind; the RTL render has the rail and the list pane on
|
|
134
|
+
the right.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/himalaya-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1831.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": "3a999aa656f046af9927c9e90fad9ea641f5776f956c7d818a7d6834"
|
|
86
86
|
}
|
|
@@ -8337,6 +8337,28 @@ const SCREENS = runtimeSetting({
|
|
|
8337
8337
|
"children": [
|
|
8338
8338
|
{
|
|
8339
8339
|
"id": "himi_sign_in.social_apple",
|
|
8340
|
+
"body": {
|
|
8341
|
+
"package": "himalaya",
|
|
8342
|
+
"type": "Button",
|
|
8343
|
+
"props": {
|
|
8344
|
+
"title": "Continue with Apple",
|
|
8345
|
+
"style": "appleSignIn",
|
|
8346
|
+
"fullWidth": true,
|
|
8347
|
+
"disabledPath": "$service:himiStoreAccount.authBusy",
|
|
8348
|
+
"action": {
|
|
8349
|
+
"actionId": "tier5.himiStoreAccount.signInWithSocial",
|
|
8350
|
+
"params": {
|
|
8351
|
+
"provider": "apple"
|
|
8352
|
+
}
|
|
8353
|
+
}
|
|
8354
|
+
}
|
|
8355
|
+
},
|
|
8356
|
+
"modifiers": {
|
|
8357
|
+
"hiddenPath": "$service:himiStoreAccount.hideAppleSystemButton"
|
|
8358
|
+
}
|
|
8359
|
+
},
|
|
8360
|
+
{
|
|
8361
|
+
"id": "himi_sign_in.social_apple_legacy",
|
|
8340
8362
|
"body": {
|
|
8341
8363
|
"package": "himalaya",
|
|
8342
8364
|
"type": "Button",
|
|
@@ -8354,7 +8376,7 @@ const SCREENS = runtimeSetting({
|
|
|
8354
8376
|
}
|
|
8355
8377
|
},
|
|
8356
8378
|
"modifiers": {
|
|
8357
|
-
"hiddenPath": "$service:himiStoreAccount.
|
|
8379
|
+
"hiddenPath": "$service:himiStoreAccount.hideAppleLegacyButton"
|
|
8358
8380
|
}
|
|
8359
8381
|
},
|
|
8360
8382
|
{
|
|
@@ -8797,7 +8819,8 @@ const SCREENS = runtimeSetting({
|
|
|
8797
8819
|
"integrity": "",
|
|
8798
8820
|
"contentType": "application/javascript+ts-bundle",
|
|
8799
8821
|
"declaredCapabilities": [
|
|
8800
|
-
"wix_api"
|
|
8822
|
+
"wix_api",
|
|
8823
|
+
"app_info"
|
|
8801
8824
|
],
|
|
8802
8825
|
"minBinaryVersion": "1.7.0",
|
|
8803
8826
|
"bundleVersion": "0.0.1"
|
|
@@ -30088,6 +30111,7 @@ const SCREENS = runtimeSetting({
|
|
|
30088
30111
|
"title": "$service:himiBrandedPlans.detail.joinLabel",
|
|
30089
30112
|
"style": "primary",
|
|
30090
30113
|
"disabledPath": "$service:himiBrandedPlans.detail.joinDisabled",
|
|
30114
|
+
"loadingPath": "$service:himiBrandedPlans.detail.joinBusy",
|
|
30091
30115
|
"action": {
|
|
30092
30116
|
"actionId": "tier5.himiBrandedPlans.join"
|
|
30093
30117
|
}
|
|
@@ -36381,6 +36405,7 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
36381
36405
|
"style": "primary",
|
|
36382
36406
|
"fullWidth": true,
|
|
36383
36407
|
"disabledPath": "$service:himiStoreProduct.buyDisabled",
|
|
36408
|
+
"loadingPath": "$service:himiStoreProduct.buyBusy",
|
|
36384
36409
|
"action": {
|
|
36385
36410
|
"actionId": "tier5.himiStoreProduct.buy"
|
|
36386
36411
|
}
|
|
@@ -40920,6 +40945,7 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
40920
40945
|
"props": {
|
|
40921
40946
|
"title": "$service:himiBookingTime.iapBuyLabel",
|
|
40922
40947
|
"disabledPath": "$service:himiBookingTime.iapBuyDisabled",
|
|
40948
|
+
"loadingPath": "$service:himiBookingTime.iapBusy",
|
|
40923
40949
|
"style": "primary",
|
|
40924
40950
|
"fullWidth": true,
|
|
40925
40951
|
"action": {
|
|
@@ -41951,6 +41977,7 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
|
|
|
41951
41977
|
"props": {
|
|
41952
41978
|
"title": "$service:himiBookingTime.iapBuyLabel",
|
|
41953
41979
|
"disabledPath": "$service:himiBookingTime.iapBuyDisabled",
|
|
41980
|
+
"loadingPath": "$service:himiBookingTime.iapBusy",
|
|
41954
41981
|
"style": "primary",
|
|
41955
41982
|
"fullWidth": true,
|
|
41956
41983
|
"action": {
|
|
@@ -40,6 +40,8 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
|
|
|
40
40
|
let platform = "unknown";
|
|
41
41
|
let started = false;
|
|
42
42
|
let inFlight = false;
|
|
43
|
+
/** The ticket or time `buy` is selling, so a different selection never shows its spinner. */
|
|
44
|
+
let inFlightTarget = "";
|
|
43
45
|
let formError = "";
|
|
44
46
|
let sequence = 0;
|
|
45
47
|
let formRevision = 0;
|
|
@@ -106,7 +108,23 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
|
|
|
106
108
|
if (!retained) initialize(form);
|
|
107
109
|
}
|
|
108
110
|
|
|
109
|
-
|
|
111
|
+
/** Whether the Buy for `target` (the selected ticket or time) shows the spinner: while this worker's
|
|
112
|
+
* `buy` runs, only for its target; otherwise whenever the shared checkout is busy, unless the sale is
|
|
113
|
+
* known to be another target's. A restarted worker knows none, so it follows the checkout. */
|
|
114
|
+
function busyFor(target: string | undefined, purchaseBusy: boolean, state: ReturnType<typeof commerce.state>): boolean {
|
|
115
|
+
if (target === undefined) return purchaseBusy || inFlight;
|
|
116
|
+
if (inFlight) return inFlightTarget === target;
|
|
117
|
+
if (!purchaseBusy || !reference) return purchaseBusy;
|
|
118
|
+
const anotherTarget = (item: string) => [...attempts].some(([known, attempt]) => known !== target && item.endsWith(`#${encodeURIComponent(attempt)}`));
|
|
119
|
+
const prefix = `${reference.kind}:${reference.id}#`;
|
|
120
|
+
const processing = state.payments.filter((p) => p.access === "processing");
|
|
121
|
+
if (processing.some((p) => p.item.startsWith(prefix) && !anotherTarget(p.item))) return true;
|
|
122
|
+
if (state.item !== null) return !anotherTarget(state.item);
|
|
123
|
+
// No item: a recovered sale. It may be this one unless its payments all name other tickets or times.
|
|
124
|
+
return processing.length === 0 || processing.some((p) => p.item === "payment");
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function fields(selected = true, publishPoll = true, selectionKey?: string): AttendancePurchaseFields {
|
|
110
128
|
syncSession();
|
|
111
129
|
if (!reference || !metadata) return ATTENDANCE_INITIAL;
|
|
112
130
|
const currency = metadata.currency ?? "";
|
|
@@ -137,7 +155,7 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
|
|
|
137
155
|
else if (apple && own && state.phase === "cancelled") note = copyParam(`${prefix}.purchaseCancelledText`, "Purchase cancelled. Your place is not confirmed.");
|
|
138
156
|
return {
|
|
139
157
|
iapBuyHidden: !apple, iapBuyDisabled: !enabled || !selected || !member || !form.supported() || purchase.buyDisabled || inFlight,
|
|
140
|
-
iapBuyLabel: purchase.buyLabel || copy.buy, iapBusy: purchase.buyBusy
|
|
158
|
+
iapBuyLabel: purchase.buyLabel || copy.buy, iapBusy: busyFor(selectionKey !== undefined ? `${reference.kind}:${reference.id}:${selectionKey}` : options.kind === "eventsTicket" ? `${reference.kind}:${reference.id}:${reference.id}` : undefined, purchase.buyBusy, state),
|
|
141
159
|
iapPrice: apple ? price.priceText : "", iapRetryHidden: !apple || (price.hidePriceRetry && commerce.scopeComplete()),
|
|
142
160
|
iapNote: note,
|
|
143
161
|
iapFormHidden: !apple || !selected || !form.supported(), iapFormError: formError,
|
|
@@ -173,6 +191,7 @@ export function createAttendancePurchase(options: { kind: "bookingsService" | "e
|
|
|
173
191
|
...(options.kind === "bookingsService" ? { booking: { slot: selection.slot ?? {}, contactDetails: form.buyer() } } : { ticket: { eventId: selection.eventId ?? "", ...form.ticket(ref.id) } }),
|
|
174
192
|
} };
|
|
175
193
|
inFlight = true;
|
|
194
|
+
inFlightTarget = target;
|
|
176
195
|
formError = "";
|
|
177
196
|
options.onChange();
|
|
178
197
|
try {
|
|
@@ -733,7 +733,7 @@ function derive(input: S): S {
|
|
|
733
733
|
message: regular && !regularCheckoutAllowed && s.message === copyParam("time.purchaseUnavailable", "Purchasing is temporarily unavailable.") ? "" : s.message,
|
|
734
734
|
hasSlots,
|
|
735
735
|
// A waitlist pick or a course is not an in-app purchase: neither enables the Apple button.
|
|
736
|
-
...applePurchase.fields(hasSelected && !selectedWaitlist && !s.isCourse),
|
|
736
|
+
...applePurchase.fields(hasSelected && !selectedWaitlist && !s.isCourse, true, s.selectedSlotId),
|
|
737
737
|
hasSelected,
|
|
738
738
|
noSelected: !hasSelected,
|
|
739
739
|
// The shared sign-in card: no sign-in for a course this screen cannot sell (as below).
|
|
@@ -71,6 +71,8 @@ interface PlanRow {
|
|
|
71
71
|
applePeriod: string;
|
|
72
72
|
joinLabel: string;
|
|
73
73
|
joinDisabled: boolean;
|
|
74
|
+
/** An App Store sale of this plan is under way: Join shows its spinner. */
|
|
75
|
+
joinBusy: boolean;
|
|
74
76
|
joinNote: string;
|
|
75
77
|
}
|
|
76
78
|
|
|
@@ -183,7 +185,7 @@ function planRow(plan: WixPlan): PlanRow {
|
|
|
183
185
|
free: isFreePlan(plan),
|
|
184
186
|
appleSupported: isAppleSellablePlan(plan.pricing),
|
|
185
187
|
applePeriod: applePlanPeriod(plan.pricing),
|
|
186
|
-
joined: false, joinLabel: copyParam("plans.joinCta", "Continue"), joinDisabled: true, joinNote: "",
|
|
188
|
+
joined: false, joinLabel: copyParam("plans.joinCta", "Continue"), joinDisabled: true, joinBusy: false, joinNote: "",
|
|
187
189
|
};
|
|
188
190
|
}
|
|
189
191
|
|
|
@@ -258,6 +260,7 @@ function pricedState(state: State): State {
|
|
|
258
260
|
joined,
|
|
259
261
|
joinLabel: joined ? copyParam("plans.joinedLabel", "Current plan") : apple ? purchase.buyLabel : row.joinLabel,
|
|
260
262
|
joinDisabled: joined || (apple ? purchase.buyDisabled || !appleOffered(row, view) : price.actionDisabled || !regularReady) || joining.has(row.id),
|
|
263
|
+
joinBusy: apple && purchase.buyBusy,
|
|
261
264
|
joinNote: apple ? appleOffered(row, view) ? purchase.buyNote : iapPriceCopy("plans").purchaseUnavailable : price.actionNote };
|
|
262
265
|
});
|
|
263
266
|
const detail = priced.find(row => row.id === detailInputId()) ?? null;
|
|
@@ -11,11 +11,12 @@ import { authFailure, authMessage, identityErrors, type AuthOperation } from "@h
|
|
|
11
11
|
// real Sites List, and per-call site scope via `site.forSite`).
|
|
12
12
|
import { defineService, navigate } from "@himalaya/state";
|
|
13
13
|
import { dispatch } from "@himalaya/dispatch";
|
|
14
|
+
import { get as getAppInfo } from "@himalaya/app-info";
|
|
14
15
|
import { getCurrentCart, searchOrders, type WixOrder } from "@himalaya/wix-ecom";
|
|
15
16
|
import { guestProfile, loadMemberProfile, signedInEmail, strOf, fmtDate, titleCase, type AccountActivityRow } from "../_shared/himi-account";
|
|
16
17
|
import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
|
|
17
18
|
import { signInPageStyle, signInSheetStyle } from "../_shared/sign-in-sheet.js";
|
|
18
|
-
import { memberAccountRoutes } from "../_shared/member-account-routes.js";
|
|
19
|
+
import { atLeast, memberAccountRoutes } from "../_shared/member-account-routes.js";
|
|
19
20
|
import { CONTINUATION_BUDGET_MS, memberScreenTarget, within } from "../_shared/member-screen.js";
|
|
20
21
|
import { createIapCommerce, onlineProgramOrders, pricingPlanOrders, storesProductOrders } from "@himalaya/iap-checkout";
|
|
21
22
|
import { IAP_RESTORE_KEYS, NO_IAP_RESTORE, createIapRestore, resetUnhydratedKeysOnOlderRuntime, type IapRestoreFields } from "../_shared/iap-worker.js";
|
|
@@ -413,15 +414,44 @@ const translated = (key: string) => copyParam(key, authMessage(key));
|
|
|
413
414
|
const SOCIAL_PROVIDERS = ["apple", "google"] as const;
|
|
414
415
|
type SocialProvider = typeof SOCIAL_PROVIDERS[number];
|
|
415
416
|
let socialProviders: SocialProvider[] = [];
|
|
417
|
+
/** The first runtime that draws the Button style `appleSignIn`. Below it an Apple-platform host draws an
|
|
418
|
+
* unknown style as bare text, so the screen shows its older outlined Apple button there. */
|
|
419
|
+
export const APPLE_SIGN_IN_STYLE_MIN_BINARY = "1.10.0";
|
|
420
|
+
let appleButtonLegacy = false;
|
|
421
|
+
let hostInfo: Awaited<ReturnType<typeof getAppInfo>> | undefined;
|
|
416
422
|
|
|
417
|
-
|
|
423
|
+
/** `answered`: the host listed a provider, even one this screen then hides; only a host that listed
|
|
424
|
+
* none may still be booting its auth, so only that one is polled again. */
|
|
425
|
+
type SocialProvidersRead = { ok: true; providers: SocialProvider[]; appleButtonLegacy: boolean; answered: boolean } | { ok: false };
|
|
418
426
|
|
|
419
427
|
/** The providers the host offers: site enables it, binary configured, platform supports it. */
|
|
420
428
|
async function readSocialProviders(): Promise<SocialProvidersRead> {
|
|
421
429
|
try {
|
|
422
|
-
const raw = await dispatch("himi.wix.socialProviders") as { payload?: { providers?: unknown }; providers?: unknown } | null;
|
|
430
|
+
const raw = await dispatch("himi.wix.socialProviders") as { payload?: { providers?: unknown; answered?: unknown }; providers?: unknown; answered?: unknown } | null;
|
|
423
431
|
const listed = raw?.payload?.providers ?? raw?.providers;
|
|
424
|
-
|
|
432
|
+
// iOS says the site answered even when its App Review rule left nothing to show; such a [] is final.
|
|
433
|
+
const hostAnswered = (raw?.payload?.answered ?? raw?.answered) === true;
|
|
434
|
+
const providers = Array.isArray(listed) ? SOCIAL_PROVIDERS.filter((p) => listed.includes(p)) : [];
|
|
435
|
+
const read = providers.length ? await getAppInfo().catch(() => undefined) : undefined;
|
|
436
|
+
// A host's platform and runtime do not change: once named, a later failed lookup keeps them.
|
|
437
|
+
if (read && read.platform !== "unknown") hostInfo = read;
|
|
438
|
+
const info = read && read.platform !== "unknown" ? read : hostInfo ?? read;
|
|
439
|
+
const platform = info?.platform;
|
|
440
|
+
// App Review 4.8: on iOS, Google only beside Apple. A current iOS host already answers so; an installed
|
|
441
|
+
// older one still gets this screen over the air and can answer Google alone. Fails closed: only a
|
|
442
|
+
// host that says it is Android or web (neither reviewed by Apple) keeps Google alone, since one that
|
|
443
|
+
// refuses app_info could be iOS. macOS stays covered: App Review applies to Mac apps too.
|
|
444
|
+
if (providers.includes("google") && !providers.includes("apple") && platform !== "android" && platform !== "web") {
|
|
445
|
+
// A lookup that failed outright may be transient: hide Google now, and ask again on the poll.
|
|
446
|
+
return { ok: true, providers: [], appleButtonLegacy: false, answered: info !== undefined };
|
|
447
|
+
}
|
|
448
|
+
// Apple's button only where the host is known to draw it: Android and web always do, an Apple
|
|
449
|
+
// platform from APPLE_SIGN_IN_STYLE_MIN_BINARY; a host that does not say gets the older button.
|
|
450
|
+
const drawsAppleStyle = platform === "android" || platform === "web"
|
|
451
|
+
|| ((platform === "ios" || platform === "macos") && atLeast(info?.binaryVersion ?? "", APPLE_SIGN_IN_STYLE_MIN_BINARY));
|
|
452
|
+
const legacy = !drawsAppleStyle;
|
|
453
|
+
// Listed providers whose platform lookup failed are polled again, so a current host is not left on the older button.
|
|
454
|
+
return { ok: true, providers, appleButtonLegacy: legacy, answered: providers.length > 0 ? info !== undefined : hostAnswered };
|
|
425
455
|
} catch {
|
|
426
456
|
return { ok: false };
|
|
427
457
|
}
|
|
@@ -430,7 +460,7 @@ async function readSocialProviders(): Promise<SocialProvidersRead> {
|
|
|
430
460
|
/** A failed read keeps what the last read showed: a blip must not take the buttons away. A host
|
|
431
461
|
* without the action (web, an older binary) never answers, so it never shows any. */
|
|
432
462
|
function applySocialProviders(read: SocialProvidersRead): void {
|
|
433
|
-
if (read.ok) socialProviders = read.providers;
|
|
463
|
+
if (read.ok) { socialProviders = read.providers; appleButtonLegacy = read.appleButtonLegacy; }
|
|
434
464
|
}
|
|
435
465
|
|
|
436
466
|
// Which member flows this binding can run (the host's `himi.wix.memberFlows`). A One App binding with no Headless OAuth client
|
|
@@ -475,14 +505,15 @@ function armFlowsRetry(read: MemberFlowsRead): void {
|
|
|
475
505
|
}
|
|
476
506
|
|
|
477
507
|
function armSocialRetry(read: SocialProvidersRead): void {
|
|
478
|
-
if (read.ok) socialRetriesLeft = read.
|
|
508
|
+
if (read.ok) socialRetriesLeft = read.answered ? 0 : SOCIAL_RETRIES;
|
|
479
509
|
}
|
|
480
510
|
|
|
481
511
|
async function refreshSocial(): Promise<S> {
|
|
482
512
|
if (socialRetriesLeft > 0) {
|
|
483
513
|
socialRetriesLeft -= 1;
|
|
484
|
-
|
|
485
|
-
|
|
514
|
+
const read = await readSocialProviders();
|
|
515
|
+
applySocialProviders(read);
|
|
516
|
+
if (read.ok && read.answered) socialRetriesLeft = 0;
|
|
486
517
|
}
|
|
487
518
|
if (flowsRetriesLeft > 0) {
|
|
488
519
|
flowsRetriesLeft -= 1;
|
|
@@ -709,6 +740,10 @@ interface S extends IapRestoreFields {
|
|
|
709
740
|
hideShowRegister: boolean;
|
|
710
741
|
hideShowRecovery: boolean;
|
|
711
742
|
hideAppleSignIn: boolean;
|
|
743
|
+
/** Apple's appleSignIn button: hidden without Apple, or on a runtime that cannot draw it. */
|
|
744
|
+
hideAppleSystemButton: boolean;
|
|
745
|
+
/** The older outlined Apple button, shown only on such a runtime. */
|
|
746
|
+
hideAppleLegacyButton: boolean;
|
|
712
747
|
hideGoogleSignIn: boolean;
|
|
713
748
|
/** The social block and its "or" divider: no provider to show, or resetting a password. */
|
|
714
749
|
hideSocialSignIn: boolean;
|
|
@@ -802,6 +837,8 @@ function derive(s: S): S {
|
|
|
802
837
|
hideShowRegister: isRegistering || isRecovering || !signUpAvailable,
|
|
803
838
|
hideShowRecovery: isRegistering || isRecovering || !passwordResetAvailable,
|
|
804
839
|
hideAppleSignIn: !socialProviders.includes("apple"),
|
|
840
|
+
hideAppleSystemButton: !socialProviders.includes("apple") || appleButtonLegacy,
|
|
841
|
+
hideAppleLegacyButton: !socialProviders.includes("apple") || !appleButtonLegacy,
|
|
805
842
|
hideGoogleSignIn: !socialProviders.includes("google"),
|
|
806
843
|
hideSocialSignIn: isRecovering || socialProviders.length === 0,
|
|
807
844
|
hasActivity,
|
|
@@ -973,7 +1010,7 @@ const svc = defineService<S, {
|
|
|
973
1010
|
restorePublish: (s: S) => S;
|
|
974
1011
|
iapRestore: (s: S) => Promise<undefined>;
|
|
975
1012
|
}>("himiStoreAccount", {
|
|
976
|
-
notHydrated: ["message", "hideMessage", "messageKind", "resetSent", "password", "authBusy", "hideAppleSignIn", "hideGoogleSignIn", "hideSocialSignIn", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
|
|
1013
|
+
notHydrated: ["message", "hideMessage", "messageKind", "resetSent", "password", "authBusy", "hideAppleSignIn", "hideAppleSystemButton", "hideAppleLegacyButton", "hideGoogleSignIn", "hideSocialSignIn", "emailError", "passwordError", "passwordFocus", "lastNameFocus", "emailFocus", ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, ...IAP_RESTORE_KEYS],
|
|
977
1014
|
state: derive({
|
|
978
1015
|
status: "loading",
|
|
979
1016
|
isMember: false,
|
|
@@ -1018,6 +1055,8 @@ const svc = defineService<S, {
|
|
|
1018
1055
|
hideShowRegister: false,
|
|
1019
1056
|
hideShowRecovery: false,
|
|
1020
1057
|
hideAppleSignIn: true,
|
|
1058
|
+
hideAppleSystemButton: true,
|
|
1059
|
+
hideAppleLegacyButton: true,
|
|
1021
1060
|
hideGoogleSignIn: true,
|
|
1022
1061
|
hideSocialSignIn: true,
|
|
1023
1062
|
activityTitle: "Previous orders",
|
|
@@ -1159,7 +1198,7 @@ const svc = defineService<S, {
|
|
|
1159
1198
|
},
|
|
1160
1199
|
});
|
|
1161
1200
|
|
|
1162
|
-
resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, message: "", resetSent: false, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), ["message", "hideMessage", "messageKind", "resetSent", "hideAppleSignIn", "hideGoogleSignIn", "hideSocialSignIn", ...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
|
|
1201
|
+
resetUnhydratedKeysOnOlderRuntime(svc, derive({ ...svc.getState(), ...NO_IAP_RESTORE, ...NO_VISIT, ...NO_FOCUS_ALL, message: "", resetSent: false, passwordFocus: "", isRegistering: ROUTE_ASKS_REGISTER }), ["message", "hideMessage", "messageKind", "resetSent", "hideAppleSignIn", "hideAppleSystemButton", "hideAppleLegacyButton", "hideGoogleSignIn", "hideSocialSignIn", ...IAP_RESTORE_KEYS, ...VISIT_KEYS, ...VISIT_DERIVED_KEYS, "lastNameFocus", "emailFocus", "passwordFocus"]);
|
|
1163
1202
|
// `boot` tells settle this is not a visit: the host drops this call's navigation, and the
|
|
1164
1203
|
// appear refresh does the visit's moves.
|
|
1165
1204
|
svc.load({ boot: "1" });
|