@wix/himalaya-cli 0.1863.0 → 0.1864.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/cli.mjs +18 -10
- package/package.json +2 -2
- package/templates/beauty-salon/dev/index.ts +29 -4
- package/templates/beauty-salon/l10n/ar.json +6 -0
- package/templates/beauty-salon/l10n/cs.json +6 -0
- package/templates/beauty-salon/l10n/da.json +6 -0
- package/templates/beauty-salon/l10n/de.json +6 -0
- package/templates/beauty-salon/l10n/el.json +6 -0
- package/templates/beauty-salon/l10n/en.json +8 -1
- package/templates/beauty-salon/l10n/es.json +6 -0
- package/templates/beauty-salon/l10n/fi.json +6 -0
- package/templates/beauty-salon/l10n/fr.json +6 -0
- package/templates/beauty-salon/l10n/he.json +5 -0
- package/templates/beauty-salon/l10n/hu.json +6 -0
- package/templates/beauty-salon/l10n/id.json +6 -0
- package/templates/beauty-salon/l10n/it.json +6 -0
- package/templates/beauty-salon/l10n/ja.json +6 -0
- package/templates/beauty-salon/l10n/ko.json +6 -0
- package/templates/beauty-salon/l10n/lt.json +6 -0
- package/templates/beauty-salon/l10n/nl.json +6 -0
- package/templates/beauty-salon/l10n/no.json +6 -0
- package/templates/beauty-salon/l10n/pl.json +6 -0
- package/templates/beauty-salon/l10n/pt.json +6 -0
- package/templates/beauty-salon/l10n/ru.json +6 -0
- package/templates/beauty-salon/l10n/sv.json +6 -0
- package/templates/beauty-salon/l10n/th.json +6 -0
- package/templates/beauty-salon/l10n/tr.json +6 -0
- package/templates/beauty-salon/l10n/uk.json +6 -0
- package/templates/beauty-salon/l10n/vi.json +6 -0
- package/templates/beauty-salon/l10n/zh.json +6 -0
- package/templates/beauty-salon/site-functions/README.md +19 -6
- package/templates/beauty-salon/tier5-src/himi-branded-lite-account-settings/personal-info.ts +66 -9
- package/templates/branded-lite/dev/index.ts +29 -4
- package/templates/branded-lite/l10n/ar.json +6 -0
- package/templates/branded-lite/l10n/cs.json +6 -0
- package/templates/branded-lite/l10n/da.json +6 -0
- package/templates/branded-lite/l10n/de.json +6 -0
- package/templates/branded-lite/l10n/el.json +6 -0
- package/templates/branded-lite/l10n/en.json +8 -1
- package/templates/branded-lite/l10n/es.json +6 -0
- package/templates/branded-lite/l10n/fi.json +6 -0
- package/templates/branded-lite/l10n/fr.json +6 -0
- package/templates/branded-lite/l10n/he.json +5 -0
- package/templates/branded-lite/l10n/hu.json +6 -0
- package/templates/branded-lite/l10n/id.json +6 -0
- package/templates/branded-lite/l10n/it.json +6 -0
- package/templates/branded-lite/l10n/ja.json +6 -0
- package/templates/branded-lite/l10n/ko.json +6 -0
- package/templates/branded-lite/l10n/lt.json +6 -0
- package/templates/branded-lite/l10n/nl.json +6 -0
- package/templates/branded-lite/l10n/no.json +6 -0
- package/templates/branded-lite/l10n/pl.json +6 -0
- package/templates/branded-lite/l10n/pt.json +6 -0
- package/templates/branded-lite/l10n/ru.json +6 -0
- package/templates/branded-lite/l10n/sv.json +6 -0
- package/templates/branded-lite/l10n/th.json +6 -0
- package/templates/branded-lite/l10n/tr.json +6 -0
- package/templates/branded-lite/l10n/uk.json +6 -0
- package/templates/branded-lite/l10n/vi.json +6 -0
- package/templates/branded-lite/l10n/zh.json +6 -0
- package/templates/branded-lite/site-functions/README.md +19 -6
- package/templates/branded-lite/tier5-src/himi-branded-lite-account-settings/personal-info.ts +66 -9
- package/templates/community-club/dev/index.ts +29 -4
- package/templates/community-club/l10n/ar.json +6 -0
- package/templates/community-club/l10n/cs.json +6 -0
- package/templates/community-club/l10n/da.json +6 -0
- package/templates/community-club/l10n/de.json +6 -0
- package/templates/community-club/l10n/el.json +6 -0
- package/templates/community-club/l10n/en.json +8 -1
- package/templates/community-club/l10n/es.json +6 -0
- package/templates/community-club/l10n/fi.json +6 -0
- package/templates/community-club/l10n/fr.json +6 -0
- package/templates/community-club/l10n/he.json +5 -0
- package/templates/community-club/l10n/hu.json +6 -0
- package/templates/community-club/l10n/id.json +6 -0
- package/templates/community-club/l10n/it.json +6 -0
- package/templates/community-club/l10n/ja.json +6 -0
- package/templates/community-club/l10n/ko.json +6 -0
- package/templates/community-club/l10n/lt.json +6 -0
- package/templates/community-club/l10n/nl.json +6 -0
- package/templates/community-club/l10n/no.json +6 -0
- package/templates/community-club/l10n/pl.json +6 -0
- package/templates/community-club/l10n/pt.json +6 -0
- package/templates/community-club/l10n/ru.json +6 -0
- package/templates/community-club/l10n/sv.json +6 -0
- package/templates/community-club/l10n/th.json +6 -0
- package/templates/community-club/l10n/tr.json +6 -0
- package/templates/community-club/l10n/uk.json +6 -0
- package/templates/community-club/l10n/vi.json +6 -0
- package/templates/community-club/l10n/zh.json +6 -0
- package/templates/community-club/site-functions/README.md +19 -6
- package/templates/community-club/tier5-src/himi-branded-lite-account-settings/personal-info.ts +66 -9
- package/templates/events-meetups/dev/index.ts +29 -4
- package/templates/events-meetups/l10n/ar.json +6 -0
- package/templates/events-meetups/l10n/cs.json +6 -0
- package/templates/events-meetups/l10n/da.json +6 -0
- package/templates/events-meetups/l10n/de.json +6 -0
- package/templates/events-meetups/l10n/el.json +6 -0
- package/templates/events-meetups/l10n/en.json +8 -1
- package/templates/events-meetups/l10n/es.json +6 -0
- package/templates/events-meetups/l10n/fi.json +6 -0
- package/templates/events-meetups/l10n/fr.json +6 -0
- package/templates/events-meetups/l10n/he.json +5 -0
- package/templates/events-meetups/l10n/hu.json +6 -0
- package/templates/events-meetups/l10n/id.json +6 -0
- package/templates/events-meetups/l10n/it.json +6 -0
- package/templates/events-meetups/l10n/ja.json +6 -0
- package/templates/events-meetups/l10n/ko.json +6 -0
- package/templates/events-meetups/l10n/lt.json +6 -0
- package/templates/events-meetups/l10n/nl.json +6 -0
- package/templates/events-meetups/l10n/no.json +6 -0
- package/templates/events-meetups/l10n/pl.json +6 -0
- package/templates/events-meetups/l10n/pt.json +6 -0
- package/templates/events-meetups/l10n/ru.json +6 -0
- package/templates/events-meetups/l10n/sv.json +6 -0
- package/templates/events-meetups/l10n/th.json +6 -0
- package/templates/events-meetups/l10n/tr.json +6 -0
- package/templates/events-meetups/l10n/uk.json +6 -0
- package/templates/events-meetups/l10n/vi.json +6 -0
- package/templates/events-meetups/l10n/zh.json +6 -0
- package/templates/events-meetups/site-functions/README.md +19 -6
- package/templates/events-meetups/tier5-src/himi-branded-lite-account-settings/personal-info.ts +66 -9
- package/templates/fitness-gym/dev/index.ts +29 -4
- package/templates/fitness-gym/tier5-src/himi-branded-lite-account-settings/personal-info.ts +66 -9
- package/templates/gym-fitness/dev/index.ts +29 -4
- package/templates/gym-fitness/l10n/ar.json +6 -0
- package/templates/gym-fitness/l10n/cs.json +6 -0
- package/templates/gym-fitness/l10n/da.json +6 -0
- package/templates/gym-fitness/l10n/de.json +6 -0
- package/templates/gym-fitness/l10n/el.json +6 -0
- package/templates/gym-fitness/l10n/en.json +8 -1
- package/templates/gym-fitness/l10n/es.json +6 -0
- package/templates/gym-fitness/l10n/fi.json +6 -0
- package/templates/gym-fitness/l10n/fr.json +6 -0
- package/templates/gym-fitness/l10n/he.json +5 -0
- package/templates/gym-fitness/l10n/hu.json +6 -0
- package/templates/gym-fitness/l10n/id.json +6 -0
- package/templates/gym-fitness/l10n/it.json +6 -0
- package/templates/gym-fitness/l10n/ja.json +6 -0
- package/templates/gym-fitness/l10n/ko.json +6 -0
- package/templates/gym-fitness/l10n/lt.json +6 -0
- package/templates/gym-fitness/l10n/nl.json +6 -0
- package/templates/gym-fitness/l10n/no.json +6 -0
- package/templates/gym-fitness/l10n/pl.json +6 -0
- package/templates/gym-fitness/l10n/pt.json +6 -0
- package/templates/gym-fitness/l10n/ru.json +6 -0
- package/templates/gym-fitness/l10n/sv.json +6 -0
- package/templates/gym-fitness/l10n/th.json +6 -0
- package/templates/gym-fitness/l10n/tr.json +6 -0
- package/templates/gym-fitness/l10n/uk.json +6 -0
- package/templates/gym-fitness/l10n/vi.json +6 -0
- package/templates/gym-fitness/l10n/zh.json +6 -0
- package/templates/gym-fitness/site-functions/README.md +19 -6
- package/templates/gym-fitness/tier5-src/himi-branded-lite-account-settings/personal-info.ts +66 -9
- package/templates/nonprofit-cause/dev/index.ts +29 -4
- package/templates/nonprofit-cause/l10n/ar.json +6 -0
- package/templates/nonprofit-cause/l10n/cs.json +6 -0
- package/templates/nonprofit-cause/l10n/da.json +6 -0
- package/templates/nonprofit-cause/l10n/de.json +6 -0
- package/templates/nonprofit-cause/l10n/el.json +6 -0
- package/templates/nonprofit-cause/l10n/en.json +8 -1
- package/templates/nonprofit-cause/l10n/es.json +6 -0
- package/templates/nonprofit-cause/l10n/fi.json +6 -0
- package/templates/nonprofit-cause/l10n/fr.json +6 -0
- package/templates/nonprofit-cause/l10n/he.json +5 -0
- package/templates/nonprofit-cause/l10n/hu.json +6 -0
- package/templates/nonprofit-cause/l10n/id.json +6 -0
- package/templates/nonprofit-cause/l10n/it.json +6 -0
- package/templates/nonprofit-cause/l10n/ja.json +6 -0
- package/templates/nonprofit-cause/l10n/ko.json +6 -0
- package/templates/nonprofit-cause/l10n/lt.json +6 -0
- package/templates/nonprofit-cause/l10n/nl.json +6 -0
- package/templates/nonprofit-cause/l10n/no.json +6 -0
- package/templates/nonprofit-cause/l10n/pl.json +6 -0
- package/templates/nonprofit-cause/l10n/pt.json +6 -0
- package/templates/nonprofit-cause/l10n/ru.json +6 -0
- package/templates/nonprofit-cause/l10n/sv.json +6 -0
- package/templates/nonprofit-cause/l10n/th.json +6 -0
- package/templates/nonprofit-cause/l10n/tr.json +6 -0
- package/templates/nonprofit-cause/l10n/uk.json +6 -0
- package/templates/nonprofit-cause/l10n/vi.json +6 -0
- package/templates/nonprofit-cause/l10n/zh.json +6 -0
- package/templates/nonprofit-cause/site-functions/README.md +19 -6
- package/templates/nonprofit-cause/tier5-src/himi-branded-lite-account-settings/personal-info.ts +66 -9
- package/templates/personal-fitness-trainer/dev/index.ts +29 -4
- package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/personal-info.ts +66 -9
- package/templates/podcast-creator/dev/index.ts +29 -4
- package/templates/podcast-creator/l10n/ar.json +6 -0
- package/templates/podcast-creator/l10n/cs.json +6 -0
- package/templates/podcast-creator/l10n/da.json +6 -0
- package/templates/podcast-creator/l10n/de.json +6 -0
- package/templates/podcast-creator/l10n/el.json +6 -0
- package/templates/podcast-creator/l10n/en.json +8 -1
- package/templates/podcast-creator/l10n/es.json +6 -0
- package/templates/podcast-creator/l10n/fi.json +6 -0
- package/templates/podcast-creator/l10n/fr.json +6 -0
- package/templates/podcast-creator/l10n/he.json +5 -0
- package/templates/podcast-creator/l10n/hu.json +6 -0
- package/templates/podcast-creator/l10n/id.json +6 -0
- package/templates/podcast-creator/l10n/it.json +6 -0
- package/templates/podcast-creator/l10n/ja.json +6 -0
- package/templates/podcast-creator/l10n/ko.json +6 -0
- package/templates/podcast-creator/l10n/lt.json +6 -0
- package/templates/podcast-creator/l10n/nl.json +6 -0
- package/templates/podcast-creator/l10n/no.json +6 -0
- package/templates/podcast-creator/l10n/pl.json +6 -0
- package/templates/podcast-creator/l10n/pt.json +6 -0
- package/templates/podcast-creator/l10n/ru.json +6 -0
- package/templates/podcast-creator/l10n/sv.json +6 -0
- package/templates/podcast-creator/l10n/th.json +6 -0
- package/templates/podcast-creator/l10n/tr.json +6 -0
- package/templates/podcast-creator/l10n/uk.json +6 -0
- package/templates/podcast-creator/l10n/vi.json +6 -0
- package/templates/podcast-creator/l10n/zh.json +6 -0
- package/templates/podcast-creator/site-functions/README.md +19 -6
- package/templates/podcast-creator/tier5-src/himi-branded-lite-account-settings/personal-info.ts +66 -9
- package/templates/portfolio-creative/dev/index.ts +29 -4
- package/templates/portfolio-creative/l10n/ar.json +6 -0
- package/templates/portfolio-creative/l10n/cs.json +6 -0
- package/templates/portfolio-creative/l10n/da.json +6 -0
- package/templates/portfolio-creative/l10n/de.json +6 -0
- package/templates/portfolio-creative/l10n/el.json +6 -0
- package/templates/portfolio-creative/l10n/en.json +8 -1
- package/templates/portfolio-creative/l10n/es.json +6 -0
- package/templates/portfolio-creative/l10n/fi.json +6 -0
- package/templates/portfolio-creative/l10n/fr.json +6 -0
- package/templates/portfolio-creative/l10n/he.json +5 -0
- package/templates/portfolio-creative/l10n/hu.json +6 -0
- package/templates/portfolio-creative/l10n/id.json +6 -0
- package/templates/portfolio-creative/l10n/it.json +6 -0
- package/templates/portfolio-creative/l10n/ja.json +6 -0
- package/templates/portfolio-creative/l10n/ko.json +6 -0
- package/templates/portfolio-creative/l10n/lt.json +6 -0
- package/templates/portfolio-creative/l10n/nl.json +6 -0
- package/templates/portfolio-creative/l10n/no.json +6 -0
- package/templates/portfolio-creative/l10n/pl.json +6 -0
- package/templates/portfolio-creative/l10n/pt.json +6 -0
- package/templates/portfolio-creative/l10n/ru.json +6 -0
- package/templates/portfolio-creative/l10n/sv.json +6 -0
- package/templates/portfolio-creative/l10n/th.json +6 -0
- package/templates/portfolio-creative/l10n/tr.json +6 -0
- package/templates/portfolio-creative/l10n/uk.json +6 -0
- package/templates/portfolio-creative/l10n/vi.json +6 -0
- package/templates/portfolio-creative/l10n/zh.json +6 -0
- package/templates/portfolio-creative/site-functions/README.md +19 -6
- package/templates/portfolio-creative/tier5-src/himi-branded-lite-account-settings/personal-info.ts +66 -9
- package/templates/restaurant/dev/index.ts +29 -4
- package/templates/restaurant/l10n/ar.json +6 -0
- package/templates/restaurant/l10n/cs.json +6 -0
- package/templates/restaurant/l10n/da.json +6 -0
- package/templates/restaurant/l10n/de.json +6 -0
- package/templates/restaurant/l10n/el.json +6 -0
- package/templates/restaurant/l10n/en.json +8 -1
- package/templates/restaurant/l10n/es.json +6 -0
- package/templates/restaurant/l10n/fi.json +6 -0
- package/templates/restaurant/l10n/fr.json +6 -0
- package/templates/restaurant/l10n/he.json +5 -0
- package/templates/restaurant/l10n/hu.json +6 -0
- package/templates/restaurant/l10n/id.json +6 -0
- package/templates/restaurant/l10n/it.json +6 -0
- package/templates/restaurant/l10n/ja.json +6 -0
- package/templates/restaurant/l10n/ko.json +6 -0
- package/templates/restaurant/l10n/lt.json +6 -0
- package/templates/restaurant/l10n/nl.json +6 -0
- package/templates/restaurant/l10n/no.json +6 -0
- package/templates/restaurant/l10n/pl.json +6 -0
- package/templates/restaurant/l10n/pt.json +6 -0
- package/templates/restaurant/l10n/ru.json +6 -0
- package/templates/restaurant/l10n/sv.json +6 -0
- package/templates/restaurant/l10n/th.json +6 -0
- package/templates/restaurant/l10n/tr.json +6 -0
- package/templates/restaurant/l10n/uk.json +6 -0
- package/templates/restaurant/l10n/vi.json +6 -0
- package/templates/restaurant/l10n/zh.json +6 -0
- package/templates/restaurant/site-functions/README.md +19 -6
- package/templates/restaurant/tier5-src/himi-branded-lite-account-settings/personal-info.ts +66 -9
- package/templates/retail-store/dev/index.ts +29 -4
- package/templates/retail-store/l10n/ar.json +6 -0
- package/templates/retail-store/l10n/cs.json +6 -0
- package/templates/retail-store/l10n/da.json +6 -0
- package/templates/retail-store/l10n/de.json +6 -0
- package/templates/retail-store/l10n/el.json +6 -0
- package/templates/retail-store/l10n/en.json +8 -1
- package/templates/retail-store/l10n/es.json +6 -0
- package/templates/retail-store/l10n/fi.json +6 -0
- package/templates/retail-store/l10n/fr.json +6 -0
- package/templates/retail-store/l10n/he.json +5 -0
- package/templates/retail-store/l10n/hu.json +6 -0
- package/templates/retail-store/l10n/id.json +6 -0
- package/templates/retail-store/l10n/it.json +6 -0
- package/templates/retail-store/l10n/ja.json +6 -0
- package/templates/retail-store/l10n/ko.json +6 -0
- package/templates/retail-store/l10n/lt.json +6 -0
- package/templates/retail-store/l10n/nl.json +6 -0
- package/templates/retail-store/l10n/no.json +6 -0
- package/templates/retail-store/l10n/pl.json +6 -0
- package/templates/retail-store/l10n/pt.json +6 -0
- package/templates/retail-store/l10n/ru.json +6 -0
- package/templates/retail-store/l10n/sv.json +6 -0
- package/templates/retail-store/l10n/th.json +6 -0
- package/templates/retail-store/l10n/tr.json +6 -0
- package/templates/retail-store/l10n/uk.json +6 -0
- package/templates/retail-store/l10n/vi.json +6 -0
- package/templates/retail-store/l10n/zh.json +6 -0
- package/templates/retail-store/site-functions/README.md +19 -6
- package/templates/retail-store/tier5-src/himi-branded-lite-account-settings/personal-info.ts +66 -9
- package/templates/yoga-studio/dev/index.ts +29 -4
- package/templates/yoga-studio/l10n/ar.json +6 -0
- package/templates/yoga-studio/l10n/cs.json +6 -0
- package/templates/yoga-studio/l10n/da.json +6 -0
- package/templates/yoga-studio/l10n/de.json +6 -0
- package/templates/yoga-studio/l10n/el.json +6 -0
- package/templates/yoga-studio/l10n/en.json +8 -1
- package/templates/yoga-studio/l10n/es.json +6 -0
- package/templates/yoga-studio/l10n/fi.json +6 -0
- package/templates/yoga-studio/l10n/fr.json +6 -0
- package/templates/yoga-studio/l10n/he.json +5 -0
- package/templates/yoga-studio/l10n/hu.json +6 -0
- package/templates/yoga-studio/l10n/id.json +6 -0
- package/templates/yoga-studio/l10n/it.json +6 -0
- package/templates/yoga-studio/l10n/ja.json +6 -0
- package/templates/yoga-studio/l10n/ko.json +6 -0
- package/templates/yoga-studio/l10n/lt.json +6 -0
- package/templates/yoga-studio/l10n/nl.json +6 -0
- package/templates/yoga-studio/l10n/no.json +6 -0
- package/templates/yoga-studio/l10n/pl.json +6 -0
- package/templates/yoga-studio/l10n/pt.json +6 -0
- package/templates/yoga-studio/l10n/ru.json +6 -0
- package/templates/yoga-studio/l10n/sv.json +6 -0
- package/templates/yoga-studio/l10n/th.json +6 -0
- package/templates/yoga-studio/l10n/tr.json +6 -0
- package/templates/yoga-studio/l10n/uk.json +6 -0
- package/templates/yoga-studio/l10n/vi.json +6 -0
- package/templates/yoga-studio/l10n/zh.json +6 -0
- package/templates/yoga-studio/site-functions/README.md +19 -6
- package/templates/yoga-studio/tier5-src/himi-branded-lite-account-settings/personal-info.ts +66 -9
|
@@ -1634,6 +1634,12 @@
|
|
|
1634
1634
|
"translation": "页面",
|
|
1635
1635
|
"origin": "machine"
|
|
1636
1636
|
},
|
|
1637
|
+
"h_c8f5eda8ace9": {
|
|
1638
|
+
"key": "accountSettings.profilePhotoRemove",
|
|
1639
|
+
"source": "Remove photo",
|
|
1640
|
+
"translation": "移除照片",
|
|
1641
|
+
"origin": "machine"
|
|
1642
|
+
},
|
|
1637
1643
|
"h_1e9b74b4dda5": {
|
|
1638
1644
|
"source": "Show all ({count})",
|
|
1639
1645
|
"translation": "查看全部({count})",
|
|
@@ -29,9 +29,22 @@ Publishing makes the latest saved site revision live, which can include other
|
|
|
29
29
|
unpublished site changes. Review that revision before publishing. This source
|
|
30
30
|
change does not publish or invoke a live site.
|
|
31
31
|
|
|
32
|
-
After
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
After publishing, turn the picker on for that site. The setting belongs to the site, because only a
|
|
33
|
+
site that published the function can serve the upload; an app bound to another site keeps showing
|
|
34
|
+
"Change your photo on the website."
|
|
35
|
+
|
|
36
|
+
- **A generated template** (a `himi init` scaffold, one app for one site): set
|
|
37
|
+
`HIMI_BRANDED_LITE_MEMBER_PHOTO_UPLOAD_FUNCTION=himiMemberPhotoUploadUrl` in the app's runtime
|
|
38
|
+
environment, next to `WIX_SITE_URL`. The template reads it at runtime; template generation replaces
|
|
39
|
+
the generator machine's value with a placeholder, so it is never baked into customer templates.
|
|
40
|
+
- **An app bound to its site by its provisioning** (the Branded Lite app itself): set the field there.
|
|
41
|
+
It wins over the environment variable.
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{ "wix": { "clientId": "…", "memberPhotoUploadFunction": "himiMemberPhotoUploadUrl" } }
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Template adoption (`/adopt-himalaya-template`) does this step with the owner's approval. Without the
|
|
48
|
+
setting, the profile photo picker stays hidden.
|
|
49
|
+
|
|
50
|
+
"Remove photo" needs no function: it clears the photo through the member's own profile update.
|
package/templates/nonprofit-cause/tier5-src/himi-branded-lite-account-settings/personal-info.ts
CHANGED
|
@@ -94,6 +94,11 @@ interface S extends ProfileValues {
|
|
|
94
94
|
photoUploadError: string;
|
|
95
95
|
photoUploading: boolean;
|
|
96
96
|
notPhotoUploading: boolean;
|
|
97
|
+
/** Remove photo was tapped: Save clears the profile photo. A new pick replaces it. */
|
|
98
|
+
photoRemoved: boolean;
|
|
99
|
+
/** There is a photo (saved or just picked) that Remove photo would clear. */
|
|
100
|
+
canRemovePhoto: boolean;
|
|
101
|
+
noRemovePhoto: boolean;
|
|
97
102
|
}
|
|
98
103
|
|
|
99
104
|
const BLANK: ProfileValues = { displayName: "", title: "", firstName: "", lastName: "", phone: "", memberImage: "", memberImageId: "", memberInitials: "M", custom: {} };
|
|
@@ -137,6 +142,9 @@ const EMPTY: S = {
|
|
|
137
142
|
photoUploadError: "",
|
|
138
143
|
photoUploading: false,
|
|
139
144
|
notPhotoUploading: true,
|
|
145
|
+
photoRemoved: false,
|
|
146
|
+
canRemovePhoto: false,
|
|
147
|
+
noRemovePhoto: true,
|
|
140
148
|
};
|
|
141
149
|
|
|
142
150
|
// ---- The site's field list ----
|
|
@@ -242,13 +250,18 @@ function changedFields(s: S): Set<SaveField> {
|
|
|
242
250
|
if (s.firstName.trim() !== s.original.firstName.trim()) fields.add("firstName");
|
|
243
251
|
if (s.lastName.trim() !== s.original.lastName.trim()) fields.add("lastName");
|
|
244
252
|
if (s.showPhone && s.phone.trim() !== (s.originalPhones[0] ?? "").trim()) fields.add("phone");
|
|
245
|
-
if (s.photoMediaId && s.photoDraftUrl) fields.add("photo");
|
|
253
|
+
if ((s.photoMediaId && s.photoDraftUrl) || (s.photoRemoved && hadSavedPhoto(s))) fields.add("photo");
|
|
246
254
|
for (const field of s.siteFields) {
|
|
247
255
|
if ((s.custom[field.id] ?? "").trim() !== (s.original.custom[field.id] ?? "").trim()) fields.add(`cf:${field.id}`);
|
|
248
256
|
}
|
|
249
257
|
return fields;
|
|
250
258
|
}
|
|
251
259
|
|
|
260
|
+
/** The member had a saved profile photo when this modal loaded. */
|
|
261
|
+
function hadSavedPhoto(s: S): boolean {
|
|
262
|
+
return !!(s.original.memberImage || s.original.memberImageId);
|
|
263
|
+
}
|
|
264
|
+
|
|
252
265
|
function nextPhones(s: S): string[] {
|
|
253
266
|
return s.phone.trim() ? [s.phone.trim(), ...s.originalPhones.slice(1)] : s.originalPhones.slice(1);
|
|
254
267
|
}
|
|
@@ -265,6 +278,8 @@ function memberPatch(s: S, fields: Set<SaveField>): { profile?: Record<string, u
|
|
|
265
278
|
if (fields.has("displayName")) profile.nickname = s.displayName.trim();
|
|
266
279
|
if (fields.has("title")) profile.title = s.title.trim();
|
|
267
280
|
if (fields.has("photo") && s.photoMediaId && s.photoDraftUrl) profile.photo = { id: s.photoMediaId, url: s.photoDraftUrl };
|
|
281
|
+
// An empty photo clears it (checked against Members v1: the readback has no photo).
|
|
282
|
+
else if (fields.has("photo") && s.photoRemoved) profile.photo = {};
|
|
268
283
|
if (fields.has("firstName")) contact.firstName = s.firstName.trim();
|
|
269
284
|
if (fields.has("lastName")) contact.lastName = s.lastName.trim();
|
|
270
285
|
if (fields.has("phone")) {
|
|
@@ -447,9 +462,29 @@ function derive(s: S): S {
|
|
|
447
462
|
noSaveError: !s.saveError,
|
|
448
463
|
noPhotoUploadAvailable: !s.photoUploadAvailable,
|
|
449
464
|
notPhotoUploading: !s.photoUploading,
|
|
465
|
+
...removePhotoFlags(s),
|
|
450
466
|
};
|
|
451
467
|
}
|
|
452
468
|
|
|
469
|
+
/** Remove photo is offered exactly when the tap would act: not while a Save or an upload is under
|
|
470
|
+
* way (the Save's read-back, or a late upload, would put the photo back), and not with nothing to
|
|
471
|
+
* remove. The button and the action read this one rule, so a visible button never does nothing. */
|
|
472
|
+
function canRemovePhoto(s: S): boolean {
|
|
473
|
+
return s.phase === "ready" && !s.saving && !profileMutationInFlight && !photoUploadMintInFlight
|
|
474
|
+
&& !s.photoUploading && !photoUploadPending(s) && !s.photoRemoved && !!s.photoDisplayUrl;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function removePhotoFlags(s: S): Pick<S, "canRemovePhoto" | "noRemovePhoto"> {
|
|
478
|
+
const can = canRemovePhoto(s);
|
|
479
|
+
return { canRemovePhoto: can, noRemovePhoto: !can };
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/** An action's result, with Remove photo read again once its in-flight flag is cleared. A result
|
|
483
|
+
* derived while the flag was still set would keep the button hidden after the action ended. */
|
|
484
|
+
function settled<T extends S | undefined>(next: T): T {
|
|
485
|
+
return next && next.phase ? { ...next, ...removePhotoFlags(next) } : next;
|
|
486
|
+
}
|
|
487
|
+
|
|
453
488
|
function clearFieldErrors(): Pick<S, "displayNameError" | "titleError" | "firstNameError" | "lastNameError" | "phoneError" | "customErrors"> {
|
|
454
489
|
return { displayNameError: "", titleError: "", firstNameError: "", lastNameError: "", phoneError: "", customErrors: {} };
|
|
455
490
|
}
|
|
@@ -472,6 +507,7 @@ function loaded(member: WixMemberRecord, email: string, scope: string, siteField
|
|
|
472
507
|
...clearFieldErrors(),
|
|
473
508
|
saveError: "",
|
|
474
509
|
photoDisplayUrl: values.memberImage,
|
|
510
|
+
photoRemoved: false,
|
|
475
511
|
uploadUrl: "",
|
|
476
512
|
photoDraftUrl: "",
|
|
477
513
|
photoMediaId: "",
|
|
@@ -507,6 +543,7 @@ const svc = defineService<S, {
|
|
|
507
543
|
genUpload: (s: S, arg?: { fileName?: unknown; mimeType?: unknown }) => Promise<Polled>;
|
|
508
544
|
setMedia: (s: S, arg?: { mediaId?: unknown; imageUrl?: unknown }) => Promise<Polled>;
|
|
509
545
|
photoUploadTimeout: (s: S) => Polled;
|
|
546
|
+
removePhoto: (s: S) => S;
|
|
510
547
|
save: (s: S) => Promise<Result | undefined>;
|
|
511
548
|
showLoading: (s: S) => S;
|
|
512
549
|
begin: (s: S, patch: Partial<S>) => S;
|
|
@@ -540,6 +577,14 @@ const svc = defineService<S, {
|
|
|
540
577
|
return loadFailed(error);
|
|
541
578
|
}
|
|
542
579
|
},
|
|
580
|
+
// Remove photo: stage the removal (initials show, Save is on); Save clears the photo. A photo
|
|
581
|
+
// that was only picked, never saved, is dropped, so Save then has nothing to send for it.
|
|
582
|
+
// Refused while a Save or an upload is under way (canRemovePhoto). Any earlier upload attempt
|
|
583
|
+
// is dropped, so it cannot land afterwards.
|
|
584
|
+
removePhoto: (s) => {
|
|
585
|
+
if (!canRemovePhoto(s)) return s;
|
|
586
|
+
return derive({ ...clearPhotoUploadAttempt(s), photoRemoved: hadSavedPhoto(s), photoDraftUrl: "", photoMediaId: "", photoDisplayUrl: "", memberImage: "", saveError: "" });
|
|
587
|
+
},
|
|
543
588
|
setDisplayName: setText("displayName"),
|
|
544
589
|
setTitle: setText("title"),
|
|
545
590
|
setFirstName: setText("firstName"),
|
|
@@ -569,7 +614,8 @@ const svc = defineService<S, {
|
|
|
569
614
|
const version = ++photoUploadVersion;
|
|
570
615
|
const accountChanged = () => copyParam("accountSettings.profilePhotoAccountChanged", "Your account changed. Reload before choosing a profile photo.");
|
|
571
616
|
const sameMember = (latest: S) => latest.memberId === s.memberId && latest.memberEmail === s.memberEmail && latest.memberScope === s.memberScope;
|
|
572
|
-
|
|
617
|
+
let next: Polled;
|
|
618
|
+
try { next = await (async (): Promise<Polled> => { try {
|
|
573
619
|
if (!(await currentMemberRecordMatches(s.memberEmail, s.memberScope, s.memberId))) {
|
|
574
620
|
const latest = svc.getState() as S;
|
|
575
621
|
if (version !== photoUploadVersion || !sameMember(latest)) return latest;
|
|
@@ -608,7 +654,8 @@ const svc = defineService<S, {
|
|
|
608
654
|
const latest = svc.getState() as S;
|
|
609
655
|
if (version !== photoUploadVersion || !sameMember(latest)) return latest;
|
|
610
656
|
return derive(clearPhotoUploadAttempt(latest, copyParam("accountSettings.profilePhotoUploadError", "The photo could not be uploaded. Try again.")));
|
|
611
|
-
} finally { photoUploadMintInFlight = false; }
|
|
657
|
+
} })(); } finally { photoUploadMintInFlight = false; }
|
|
658
|
+
return settled(next);
|
|
612
659
|
},
|
|
613
660
|
setMedia: async (s, arg): Promise<Polled> => {
|
|
614
661
|
const mediaId = clean(arg?.mediaId);
|
|
@@ -634,6 +681,7 @@ const svc = defineService<S, {
|
|
|
634
681
|
photoDraftUrl: imageUrl,
|
|
635
682
|
photoDisplayUrl: imageUrl,
|
|
636
683
|
photoMediaId: mediaId,
|
|
684
|
+
photoRemoved: false,
|
|
637
685
|
photoPendingMemberId: "",
|
|
638
686
|
photoPendingMemberEmail: "",
|
|
639
687
|
photoPendingMemberScope: "",
|
|
@@ -660,7 +708,8 @@ const svc = defineService<S, {
|
|
|
660
708
|
profileMutationInFlight = true;
|
|
661
709
|
await svc.begin({ saving: true });
|
|
662
710
|
const accepted = new Set<SaveField>();
|
|
663
|
-
|
|
711
|
+
let next: Result;
|
|
712
|
+
try { next = await (async (): Promise<Result> => { try {
|
|
664
713
|
if (!(await currentMemberRecordMatches(s.memberEmail, s.memberScope, s.memberId))) throw signedOutError();
|
|
665
714
|
const rejected = new Map<SaveField, string>();
|
|
666
715
|
const fields = new Set<SaveField>();
|
|
@@ -750,10 +799,12 @@ const svc = defineService<S, {
|
|
|
750
799
|
if (rejected.has(field) || editedSince(field)) continue;
|
|
751
800
|
if (!readbackMatches(field)) rejected.set(field, rejectedFieldError(field));
|
|
752
801
|
}
|
|
753
|
-
const photoChanged = latest.photoMediaId !== s.photoMediaId || latest.photoDraftUrl !== s.photoDraftUrl;
|
|
802
|
+
const photoChanged = latest.photoMediaId !== s.photoMediaId || latest.photoDraftUrl !== s.photoDraftUrl || latest.photoRemoved !== s.photoRemoved;
|
|
754
803
|
const refreshedPhotoId = clean(refreshed.member.profile?.photo?.id);
|
|
755
804
|
const refreshedPhotoUrl = memberPhotoDisplayUrl(refreshed.member.profile?.photo?.url);
|
|
756
|
-
const
|
|
805
|
+
const removing = attempted.has("photo") && s.photoRemoved && !savingPhotoId;
|
|
806
|
+
const removalUnconfirmed = removing && !photoChanged && (rejected.has("photo") || !!refreshedPhotoId || !!refreshedPhotoUrl);
|
|
807
|
+
const photoUnconfirmed = removalUnconfirmed || (!!savingPhotoId && !photoChanged && (rejected.has("photo") || canonicalPhotoMediaId(refreshedPhotoId) !== canonicalPhotoMediaId(savingPhotoId) || !validPhotoUrl(refreshedPhotoUrl)));
|
|
757
808
|
// Full success, and nothing typed while it saved: the modal closes on the menu's snackbar.
|
|
758
809
|
const typedSince = [...attempted].some(editedSince) || photoChanged;
|
|
759
810
|
if (!rejected.size && !photoUnconfirmed && !typedSince) {
|
|
@@ -787,7 +838,10 @@ const svc = defineService<S, {
|
|
|
787
838
|
...(photoChanged || photoUnconfirmed ? {
|
|
788
839
|
photoDraftUrl: photoChanged ? latest.photoDraftUrl : s.photoDraftUrl,
|
|
789
840
|
photoMediaId: photoChanged ? latest.photoMediaId : s.photoMediaId,
|
|
790
|
-
|
|
841
|
+
// A removal still waiting for Save keeps the initials, not the photo Wix still has.
|
|
842
|
+
photoRemoved: photoChanged ? latest.photoRemoved : s.photoRemoved,
|
|
843
|
+
...((photoChanged ? latest.photoRemoved : s.photoRemoved) ? { memberImage: "" } : {}),
|
|
844
|
+
photoDisplayUrl: (photoChanged ? latest.photoRemoved : s.photoRemoved) ? "" : (photoChanged ? latest.photoDraftUrl : s.photoDraftUrl) || refreshedPhotoUrl,
|
|
791
845
|
uploadUrl: latest.uploadUrl,
|
|
792
846
|
photoPendingMemberId: latest.photoPendingMemberId,
|
|
793
847
|
photoPendingMemberEmail: latest.photoPendingMemberEmail,
|
|
@@ -796,7 +850,9 @@ const svc = defineService<S, {
|
|
|
796
850
|
photoUploadError: photoUnconfirmed
|
|
797
851
|
? rejected.has("photo")
|
|
798
852
|
? rejectedFieldError("photo")
|
|
799
|
-
:
|
|
853
|
+
: removalUnconfirmed
|
|
854
|
+
? copyParam("accountSettings.saveError", "Your changes weren't saved. Try again.")
|
|
855
|
+
: copyParam("accountSettings.profilePhotoSaveError", "Your new profile photo was not confirmed as saved. Try saving it again.")
|
|
800
856
|
: latest.photoUploadError,
|
|
801
857
|
});
|
|
802
858
|
} catch (error) {
|
|
@@ -814,9 +870,10 @@ const svc = defineService<S, {
|
|
|
814
870
|
? copyParam("accountSettings.savePartialError", "Some changes were saved, but we couldn't confirm the rest. Try again.")
|
|
815
871
|
: copyParam("accountSettings.saveError", "Your changes weren't saved. Try again."),
|
|
816
872
|
});
|
|
817
|
-
} finally {
|
|
873
|
+
} })(); } finally {
|
|
818
874
|
profileMutationInFlight = false;
|
|
819
875
|
}
|
|
876
|
+
return settled(next);
|
|
820
877
|
},
|
|
821
878
|
},
|
|
822
879
|
});
|
|
@@ -11983,7 +11983,10 @@ const SCREENS = runtimeSetting({
|
|
|
11983
11983
|
"integrity": "",
|
|
11984
11984
|
"contentType": "application/javascript+ts-bundle",
|
|
11985
11985
|
"declaredCapabilities": [
|
|
11986
|
-
"wix_api"
|
|
11986
|
+
"wix_api",
|
|
11987
|
+
"app_info",
|
|
11988
|
+
"ui",
|
|
11989
|
+
"open_url"
|
|
11987
11990
|
],
|
|
11988
11991
|
"minBinaryVersion": "0.1.0",
|
|
11989
11992
|
"bundleVersion": "0.0.1"
|
|
@@ -12498,6 +12501,23 @@ const SCREENS = runtimeSetting({
|
|
|
12498
12501
|
"hiddenPath": "$service:himiBrandedAccountPersonal.photoUploadAvailable"
|
|
12499
12502
|
}
|
|
12500
12503
|
},
|
|
12504
|
+
{
|
|
12505
|
+
"id": "himi_account_personal_info.photo_remove",
|
|
12506
|
+
"body": {
|
|
12507
|
+
"package": "himalaya",
|
|
12508
|
+
"type": "Button",
|
|
12509
|
+
"props": {
|
|
12510
|
+
"title": "Remove photo",
|
|
12511
|
+
"style": "plain",
|
|
12512
|
+
"action": {
|
|
12513
|
+
"actionId": "tier5.himiBrandedAccountPersonal.removePhoto"
|
|
12514
|
+
}
|
|
12515
|
+
}
|
|
12516
|
+
},
|
|
12517
|
+
"modifiers": {
|
|
12518
|
+
"hiddenPath": "$service:himiBrandedAccountPersonal.noRemovePhoto"
|
|
12519
|
+
}
|
|
12520
|
+
},
|
|
12501
12521
|
{
|
|
12502
12522
|
"id": "himi_account_personal_info.photo_upload_error",
|
|
12503
12523
|
"body": {
|
|
@@ -13182,7 +13202,8 @@ const SCREENS = runtimeSetting({
|
|
|
13182
13202
|
"declaredCapabilities": [
|
|
13183
13203
|
"wix_api",
|
|
13184
13204
|
"app_info",
|
|
13185
|
-
"ui"
|
|
13205
|
+
"ui",
|
|
13206
|
+
"open_url"
|
|
13186
13207
|
],
|
|
13187
13208
|
"minBinaryVersion": "0.1.0",
|
|
13188
13209
|
"bundleVersion": "0.0.1"
|
|
@@ -13905,6 +13926,7 @@ const SCREENS = runtimeSetting({
|
|
|
13905
13926
|
"declaredCapabilities": [
|
|
13906
13927
|
"wix_api",
|
|
13907
13928
|
"app_info",
|
|
13929
|
+
"ui",
|
|
13908
13930
|
"open_url"
|
|
13909
13931
|
],
|
|
13910
13932
|
"minBinaryVersion": "0.1.0",
|
|
@@ -14461,7 +14483,8 @@ const SCREENS = runtimeSetting({
|
|
|
14461
14483
|
"declaredCapabilities": [
|
|
14462
14484
|
"wix_api",
|
|
14463
14485
|
"app_info",
|
|
14464
|
-
"ui"
|
|
14486
|
+
"ui",
|
|
14487
|
+
"open_url"
|
|
14465
14488
|
],
|
|
14466
14489
|
"minBinaryVersion": "0.1.0",
|
|
14467
14490
|
"bundleVersion": "0.0.1"
|
|
@@ -15175,7 +15198,9 @@ const SCREENS = runtimeSetting({
|
|
|
15175
15198
|
"contentType": "application/javascript+ts-bundle",
|
|
15176
15199
|
"declaredCapabilities": [
|
|
15177
15200
|
"wix_api",
|
|
15178
|
-
"
|
|
15201
|
+
"app_info",
|
|
15202
|
+
"ui",
|
|
15203
|
+
"open_url"
|
|
15179
15204
|
],
|
|
15180
15205
|
"minBinaryVersion": "0.1.0",
|
|
15181
15206
|
"bundleVersion": "0.0.1"
|
|
@@ -94,6 +94,11 @@ interface S extends ProfileValues {
|
|
|
94
94
|
photoUploadError: string;
|
|
95
95
|
photoUploading: boolean;
|
|
96
96
|
notPhotoUploading: boolean;
|
|
97
|
+
/** Remove photo was tapped: Save clears the profile photo. A new pick replaces it. */
|
|
98
|
+
photoRemoved: boolean;
|
|
99
|
+
/** There is a photo (saved or just picked) that Remove photo would clear. */
|
|
100
|
+
canRemovePhoto: boolean;
|
|
101
|
+
noRemovePhoto: boolean;
|
|
97
102
|
}
|
|
98
103
|
|
|
99
104
|
const BLANK: ProfileValues = { displayName: "", title: "", firstName: "", lastName: "", phone: "", memberImage: "", memberImageId: "", memberInitials: "M", custom: {} };
|
|
@@ -137,6 +142,9 @@ const EMPTY: S = {
|
|
|
137
142
|
photoUploadError: "",
|
|
138
143
|
photoUploading: false,
|
|
139
144
|
notPhotoUploading: true,
|
|
145
|
+
photoRemoved: false,
|
|
146
|
+
canRemovePhoto: false,
|
|
147
|
+
noRemovePhoto: true,
|
|
140
148
|
};
|
|
141
149
|
|
|
142
150
|
// ---- The site's field list ----
|
|
@@ -242,13 +250,18 @@ function changedFields(s: S): Set<SaveField> {
|
|
|
242
250
|
if (s.firstName.trim() !== s.original.firstName.trim()) fields.add("firstName");
|
|
243
251
|
if (s.lastName.trim() !== s.original.lastName.trim()) fields.add("lastName");
|
|
244
252
|
if (s.showPhone && s.phone.trim() !== (s.originalPhones[0] ?? "").trim()) fields.add("phone");
|
|
245
|
-
if (s.photoMediaId && s.photoDraftUrl) fields.add("photo");
|
|
253
|
+
if ((s.photoMediaId && s.photoDraftUrl) || (s.photoRemoved && hadSavedPhoto(s))) fields.add("photo");
|
|
246
254
|
for (const field of s.siteFields) {
|
|
247
255
|
if ((s.custom[field.id] ?? "").trim() !== (s.original.custom[field.id] ?? "").trim()) fields.add(`cf:${field.id}`);
|
|
248
256
|
}
|
|
249
257
|
return fields;
|
|
250
258
|
}
|
|
251
259
|
|
|
260
|
+
/** The member had a saved profile photo when this modal loaded. */
|
|
261
|
+
function hadSavedPhoto(s: S): boolean {
|
|
262
|
+
return !!(s.original.memberImage || s.original.memberImageId);
|
|
263
|
+
}
|
|
264
|
+
|
|
252
265
|
function nextPhones(s: S): string[] {
|
|
253
266
|
return s.phone.trim() ? [s.phone.trim(), ...s.originalPhones.slice(1)] : s.originalPhones.slice(1);
|
|
254
267
|
}
|
|
@@ -265,6 +278,8 @@ function memberPatch(s: S, fields: Set<SaveField>): { profile?: Record<string, u
|
|
|
265
278
|
if (fields.has("displayName")) profile.nickname = s.displayName.trim();
|
|
266
279
|
if (fields.has("title")) profile.title = s.title.trim();
|
|
267
280
|
if (fields.has("photo") && s.photoMediaId && s.photoDraftUrl) profile.photo = { id: s.photoMediaId, url: s.photoDraftUrl };
|
|
281
|
+
// An empty photo clears it (checked against Members v1: the readback has no photo).
|
|
282
|
+
else if (fields.has("photo") && s.photoRemoved) profile.photo = {};
|
|
268
283
|
if (fields.has("firstName")) contact.firstName = s.firstName.trim();
|
|
269
284
|
if (fields.has("lastName")) contact.lastName = s.lastName.trim();
|
|
270
285
|
if (fields.has("phone")) {
|
|
@@ -447,9 +462,29 @@ function derive(s: S): S {
|
|
|
447
462
|
noSaveError: !s.saveError,
|
|
448
463
|
noPhotoUploadAvailable: !s.photoUploadAvailable,
|
|
449
464
|
notPhotoUploading: !s.photoUploading,
|
|
465
|
+
...removePhotoFlags(s),
|
|
450
466
|
};
|
|
451
467
|
}
|
|
452
468
|
|
|
469
|
+
/** Remove photo is offered exactly when the tap would act: not while a Save or an upload is under
|
|
470
|
+
* way (the Save's read-back, or a late upload, would put the photo back), and not with nothing to
|
|
471
|
+
* remove. The button and the action read this one rule, so a visible button never does nothing. */
|
|
472
|
+
function canRemovePhoto(s: S): boolean {
|
|
473
|
+
return s.phase === "ready" && !s.saving && !profileMutationInFlight && !photoUploadMintInFlight
|
|
474
|
+
&& !s.photoUploading && !photoUploadPending(s) && !s.photoRemoved && !!s.photoDisplayUrl;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function removePhotoFlags(s: S): Pick<S, "canRemovePhoto" | "noRemovePhoto"> {
|
|
478
|
+
const can = canRemovePhoto(s);
|
|
479
|
+
return { canRemovePhoto: can, noRemovePhoto: !can };
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/** An action's result, with Remove photo read again once its in-flight flag is cleared. A result
|
|
483
|
+
* derived while the flag was still set would keep the button hidden after the action ended. */
|
|
484
|
+
function settled<T extends S | undefined>(next: T): T {
|
|
485
|
+
return next && next.phase ? { ...next, ...removePhotoFlags(next) } : next;
|
|
486
|
+
}
|
|
487
|
+
|
|
453
488
|
function clearFieldErrors(): Pick<S, "displayNameError" | "titleError" | "firstNameError" | "lastNameError" | "phoneError" | "customErrors"> {
|
|
454
489
|
return { displayNameError: "", titleError: "", firstNameError: "", lastNameError: "", phoneError: "", customErrors: {} };
|
|
455
490
|
}
|
|
@@ -472,6 +507,7 @@ function loaded(member: WixMemberRecord, email: string, scope: string, siteField
|
|
|
472
507
|
...clearFieldErrors(),
|
|
473
508
|
saveError: "",
|
|
474
509
|
photoDisplayUrl: values.memberImage,
|
|
510
|
+
photoRemoved: false,
|
|
475
511
|
uploadUrl: "",
|
|
476
512
|
photoDraftUrl: "",
|
|
477
513
|
photoMediaId: "",
|
|
@@ -507,6 +543,7 @@ const svc = defineService<S, {
|
|
|
507
543
|
genUpload: (s: S, arg?: { fileName?: unknown; mimeType?: unknown }) => Promise<Polled>;
|
|
508
544
|
setMedia: (s: S, arg?: { mediaId?: unknown; imageUrl?: unknown }) => Promise<Polled>;
|
|
509
545
|
photoUploadTimeout: (s: S) => Polled;
|
|
546
|
+
removePhoto: (s: S) => S;
|
|
510
547
|
save: (s: S) => Promise<Result | undefined>;
|
|
511
548
|
showLoading: (s: S) => S;
|
|
512
549
|
begin: (s: S, patch: Partial<S>) => S;
|
|
@@ -540,6 +577,14 @@ const svc = defineService<S, {
|
|
|
540
577
|
return loadFailed(error);
|
|
541
578
|
}
|
|
542
579
|
},
|
|
580
|
+
// Remove photo: stage the removal (initials show, Save is on); Save clears the photo. A photo
|
|
581
|
+
// that was only picked, never saved, is dropped, so Save then has nothing to send for it.
|
|
582
|
+
// Refused while a Save or an upload is under way (canRemovePhoto). Any earlier upload attempt
|
|
583
|
+
// is dropped, so it cannot land afterwards.
|
|
584
|
+
removePhoto: (s) => {
|
|
585
|
+
if (!canRemovePhoto(s)) return s;
|
|
586
|
+
return derive({ ...clearPhotoUploadAttempt(s), photoRemoved: hadSavedPhoto(s), photoDraftUrl: "", photoMediaId: "", photoDisplayUrl: "", memberImage: "", saveError: "" });
|
|
587
|
+
},
|
|
543
588
|
setDisplayName: setText("displayName"),
|
|
544
589
|
setTitle: setText("title"),
|
|
545
590
|
setFirstName: setText("firstName"),
|
|
@@ -569,7 +614,8 @@ const svc = defineService<S, {
|
|
|
569
614
|
const version = ++photoUploadVersion;
|
|
570
615
|
const accountChanged = () => copyParam("accountSettings.profilePhotoAccountChanged", "Your account changed. Reload before choosing a profile photo.");
|
|
571
616
|
const sameMember = (latest: S) => latest.memberId === s.memberId && latest.memberEmail === s.memberEmail && latest.memberScope === s.memberScope;
|
|
572
|
-
|
|
617
|
+
let next: Polled;
|
|
618
|
+
try { next = await (async (): Promise<Polled> => { try {
|
|
573
619
|
if (!(await currentMemberRecordMatches(s.memberEmail, s.memberScope, s.memberId))) {
|
|
574
620
|
const latest = svc.getState() as S;
|
|
575
621
|
if (version !== photoUploadVersion || !sameMember(latest)) return latest;
|
|
@@ -608,7 +654,8 @@ const svc = defineService<S, {
|
|
|
608
654
|
const latest = svc.getState() as S;
|
|
609
655
|
if (version !== photoUploadVersion || !sameMember(latest)) return latest;
|
|
610
656
|
return derive(clearPhotoUploadAttempt(latest, copyParam("accountSettings.profilePhotoUploadError", "The photo could not be uploaded. Try again.")));
|
|
611
|
-
} finally { photoUploadMintInFlight = false; }
|
|
657
|
+
} })(); } finally { photoUploadMintInFlight = false; }
|
|
658
|
+
return settled(next);
|
|
612
659
|
},
|
|
613
660
|
setMedia: async (s, arg): Promise<Polled> => {
|
|
614
661
|
const mediaId = clean(arg?.mediaId);
|
|
@@ -634,6 +681,7 @@ const svc = defineService<S, {
|
|
|
634
681
|
photoDraftUrl: imageUrl,
|
|
635
682
|
photoDisplayUrl: imageUrl,
|
|
636
683
|
photoMediaId: mediaId,
|
|
684
|
+
photoRemoved: false,
|
|
637
685
|
photoPendingMemberId: "",
|
|
638
686
|
photoPendingMemberEmail: "",
|
|
639
687
|
photoPendingMemberScope: "",
|
|
@@ -660,7 +708,8 @@ const svc = defineService<S, {
|
|
|
660
708
|
profileMutationInFlight = true;
|
|
661
709
|
await svc.begin({ saving: true });
|
|
662
710
|
const accepted = new Set<SaveField>();
|
|
663
|
-
|
|
711
|
+
let next: Result;
|
|
712
|
+
try { next = await (async (): Promise<Result> => { try {
|
|
664
713
|
if (!(await currentMemberRecordMatches(s.memberEmail, s.memberScope, s.memberId))) throw signedOutError();
|
|
665
714
|
const rejected = new Map<SaveField, string>();
|
|
666
715
|
const fields = new Set<SaveField>();
|
|
@@ -750,10 +799,12 @@ const svc = defineService<S, {
|
|
|
750
799
|
if (rejected.has(field) || editedSince(field)) continue;
|
|
751
800
|
if (!readbackMatches(field)) rejected.set(field, rejectedFieldError(field));
|
|
752
801
|
}
|
|
753
|
-
const photoChanged = latest.photoMediaId !== s.photoMediaId || latest.photoDraftUrl !== s.photoDraftUrl;
|
|
802
|
+
const photoChanged = latest.photoMediaId !== s.photoMediaId || latest.photoDraftUrl !== s.photoDraftUrl || latest.photoRemoved !== s.photoRemoved;
|
|
754
803
|
const refreshedPhotoId = clean(refreshed.member.profile?.photo?.id);
|
|
755
804
|
const refreshedPhotoUrl = memberPhotoDisplayUrl(refreshed.member.profile?.photo?.url);
|
|
756
|
-
const
|
|
805
|
+
const removing = attempted.has("photo") && s.photoRemoved && !savingPhotoId;
|
|
806
|
+
const removalUnconfirmed = removing && !photoChanged && (rejected.has("photo") || !!refreshedPhotoId || !!refreshedPhotoUrl);
|
|
807
|
+
const photoUnconfirmed = removalUnconfirmed || (!!savingPhotoId && !photoChanged && (rejected.has("photo") || canonicalPhotoMediaId(refreshedPhotoId) !== canonicalPhotoMediaId(savingPhotoId) || !validPhotoUrl(refreshedPhotoUrl)));
|
|
757
808
|
// Full success, and nothing typed while it saved: the modal closes on the menu's snackbar.
|
|
758
809
|
const typedSince = [...attempted].some(editedSince) || photoChanged;
|
|
759
810
|
if (!rejected.size && !photoUnconfirmed && !typedSince) {
|
|
@@ -787,7 +838,10 @@ const svc = defineService<S, {
|
|
|
787
838
|
...(photoChanged || photoUnconfirmed ? {
|
|
788
839
|
photoDraftUrl: photoChanged ? latest.photoDraftUrl : s.photoDraftUrl,
|
|
789
840
|
photoMediaId: photoChanged ? latest.photoMediaId : s.photoMediaId,
|
|
790
|
-
|
|
841
|
+
// A removal still waiting for Save keeps the initials, not the photo Wix still has.
|
|
842
|
+
photoRemoved: photoChanged ? latest.photoRemoved : s.photoRemoved,
|
|
843
|
+
...((photoChanged ? latest.photoRemoved : s.photoRemoved) ? { memberImage: "" } : {}),
|
|
844
|
+
photoDisplayUrl: (photoChanged ? latest.photoRemoved : s.photoRemoved) ? "" : (photoChanged ? latest.photoDraftUrl : s.photoDraftUrl) || refreshedPhotoUrl,
|
|
791
845
|
uploadUrl: latest.uploadUrl,
|
|
792
846
|
photoPendingMemberId: latest.photoPendingMemberId,
|
|
793
847
|
photoPendingMemberEmail: latest.photoPendingMemberEmail,
|
|
@@ -796,7 +850,9 @@ const svc = defineService<S, {
|
|
|
796
850
|
photoUploadError: photoUnconfirmed
|
|
797
851
|
? rejected.has("photo")
|
|
798
852
|
? rejectedFieldError("photo")
|
|
799
|
-
:
|
|
853
|
+
: removalUnconfirmed
|
|
854
|
+
? copyParam("accountSettings.saveError", "Your changes weren't saved. Try again.")
|
|
855
|
+
: copyParam("accountSettings.profilePhotoSaveError", "Your new profile photo was not confirmed as saved. Try saving it again.")
|
|
800
856
|
: latest.photoUploadError,
|
|
801
857
|
});
|
|
802
858
|
} catch (error) {
|
|
@@ -814,9 +870,10 @@ const svc = defineService<S, {
|
|
|
814
870
|
? copyParam("accountSettings.savePartialError", "Some changes were saved, but we couldn't confirm the rest. Try again.")
|
|
815
871
|
: copyParam("accountSettings.saveError", "Your changes weren't saved. Try again."),
|
|
816
872
|
});
|
|
817
|
-
} finally {
|
|
873
|
+
} })(); } finally {
|
|
818
874
|
profileMutationInFlight = false;
|
|
819
875
|
}
|
|
876
|
+
return settled(next);
|
|
820
877
|
},
|
|
821
878
|
},
|
|
822
879
|
});
|
|
@@ -4894,7 +4894,10 @@ const SCREENS = runtimeSetting({
|
|
|
4894
4894
|
"integrity": "",
|
|
4895
4895
|
"contentType": "application/javascript+ts-bundle",
|
|
4896
4896
|
"declaredCapabilities": [
|
|
4897
|
-
"wix_api"
|
|
4897
|
+
"wix_api",
|
|
4898
|
+
"app_info",
|
|
4899
|
+
"ui",
|
|
4900
|
+
"open_url"
|
|
4898
4901
|
],
|
|
4899
4902
|
"minBinaryVersion": "0.1.0",
|
|
4900
4903
|
"bundleVersion": "0.0.1"
|
|
@@ -5409,6 +5412,23 @@ const SCREENS = runtimeSetting({
|
|
|
5409
5412
|
"hiddenPath": "$service:himiBrandedAccountPersonal.photoUploadAvailable"
|
|
5410
5413
|
}
|
|
5411
5414
|
},
|
|
5415
|
+
{
|
|
5416
|
+
"id": "himi_account_personal_info.photo_remove",
|
|
5417
|
+
"body": {
|
|
5418
|
+
"package": "himalaya",
|
|
5419
|
+
"type": "Button",
|
|
5420
|
+
"props": {
|
|
5421
|
+
"title": "Remove photo",
|
|
5422
|
+
"style": "plain",
|
|
5423
|
+
"action": {
|
|
5424
|
+
"actionId": "tier5.himiBrandedAccountPersonal.removePhoto"
|
|
5425
|
+
}
|
|
5426
|
+
}
|
|
5427
|
+
},
|
|
5428
|
+
"modifiers": {
|
|
5429
|
+
"hiddenPath": "$service:himiBrandedAccountPersonal.noRemovePhoto"
|
|
5430
|
+
}
|
|
5431
|
+
},
|
|
5412
5432
|
{
|
|
5413
5433
|
"id": "himi_account_personal_info.photo_upload_error",
|
|
5414
5434
|
"body": {
|
|
@@ -6094,7 +6114,8 @@ const SCREENS = runtimeSetting({
|
|
|
6094
6114
|
"declaredCapabilities": [
|
|
6095
6115
|
"wix_api",
|
|
6096
6116
|
"app_info",
|
|
6097
|
-
"ui"
|
|
6117
|
+
"ui",
|
|
6118
|
+
"open_url"
|
|
6098
6119
|
],
|
|
6099
6120
|
"minBinaryVersion": "0.1.0",
|
|
6100
6121
|
"bundleVersion": "0.0.1"
|
|
@@ -6817,6 +6838,7 @@ const SCREENS = runtimeSetting({
|
|
|
6817
6838
|
"declaredCapabilities": [
|
|
6818
6839
|
"wix_api",
|
|
6819
6840
|
"app_info",
|
|
6841
|
+
"ui",
|
|
6820
6842
|
"open_url"
|
|
6821
6843
|
],
|
|
6822
6844
|
"minBinaryVersion": "0.1.0",
|
|
@@ -7373,7 +7395,8 @@ const SCREENS = runtimeSetting({
|
|
|
7373
7395
|
"declaredCapabilities": [
|
|
7374
7396
|
"wix_api",
|
|
7375
7397
|
"app_info",
|
|
7376
|
-
"ui"
|
|
7398
|
+
"ui",
|
|
7399
|
+
"open_url"
|
|
7377
7400
|
],
|
|
7378
7401
|
"minBinaryVersion": "0.1.0",
|
|
7379
7402
|
"bundleVersion": "0.0.1"
|
|
@@ -8087,7 +8110,9 @@ const SCREENS = runtimeSetting({
|
|
|
8087
8110
|
"contentType": "application/javascript+ts-bundle",
|
|
8088
8111
|
"declaredCapabilities": [
|
|
8089
8112
|
"wix_api",
|
|
8090
|
-
"
|
|
8113
|
+
"app_info",
|
|
8114
|
+
"ui",
|
|
8115
|
+
"open_url"
|
|
8091
8116
|
],
|
|
8092
8117
|
"minBinaryVersion": "0.1.0",
|
|
8093
8118
|
"bundleVersion": "0.0.1"
|
|
@@ -1580,6 +1580,12 @@
|
|
|
1580
1580
|
"translation": "الصفحات",
|
|
1581
1581
|
"origin": "machine"
|
|
1582
1582
|
},
|
|
1583
|
+
"h_c8f5eda8ace9": {
|
|
1584
|
+
"key": "accountSettings.profilePhotoRemove",
|
|
1585
|
+
"source": "Remove photo",
|
|
1586
|
+
"translation": "إزالة الصورة",
|
|
1587
|
+
"origin": "machine"
|
|
1588
|
+
},
|
|
1583
1589
|
"h_1e9b74b4dda5": {
|
|
1584
1590
|
"source": "Show all ({count})",
|
|
1585
1591
|
"translation": "عرض الكل ({count})",
|
|
@@ -1580,6 +1580,12 @@
|
|
|
1580
1580
|
"translation": "Stránky",
|
|
1581
1581
|
"origin": "machine"
|
|
1582
1582
|
},
|
|
1583
|
+
"h_c8f5eda8ace9": {
|
|
1584
|
+
"key": "accountSettings.profilePhotoRemove",
|
|
1585
|
+
"source": "Remove photo",
|
|
1586
|
+
"translation": "Odstranit fotku",
|
|
1587
|
+
"origin": "machine"
|
|
1588
|
+
},
|
|
1583
1589
|
"h_1e9b74b4dda5": {
|
|
1584
1590
|
"source": "Show all ({count})",
|
|
1585
1591
|
"translation": "Zobrazit vše ({count})",
|
|
@@ -1580,6 +1580,12 @@
|
|
|
1580
1580
|
"translation": "Sider",
|
|
1581
1581
|
"origin": "machine"
|
|
1582
1582
|
},
|
|
1583
|
+
"h_c8f5eda8ace9": {
|
|
1584
|
+
"key": "accountSettings.profilePhotoRemove",
|
|
1585
|
+
"source": "Remove photo",
|
|
1586
|
+
"translation": "Fjern foto",
|
|
1587
|
+
"origin": "machine"
|
|
1588
|
+
},
|
|
1583
1589
|
"h_1e9b74b4dda5": {
|
|
1584
1590
|
"source": "Show all ({count})",
|
|
1585
1591
|
"translation": "Vis alle ({count})",
|
|
@@ -1580,6 +1580,12 @@
|
|
|
1580
1580
|
"translation": "Seiten",
|
|
1581
1581
|
"origin": "machine"
|
|
1582
1582
|
},
|
|
1583
|
+
"h_c8f5eda8ace9": {
|
|
1584
|
+
"key": "accountSettings.profilePhotoRemove",
|
|
1585
|
+
"source": "Remove photo",
|
|
1586
|
+
"translation": "Foto entfernen",
|
|
1587
|
+
"origin": "machine"
|
|
1588
|
+
},
|
|
1583
1589
|
"h_1e9b74b4dda5": {
|
|
1584
1590
|
"source": "Show all ({count})",
|
|
1585
1591
|
"translation": "Alle anzeigen ({count})",
|
|
@@ -1580,6 +1580,12 @@
|
|
|
1580
1580
|
"translation": "Σελίδες",
|
|
1581
1581
|
"origin": "machine"
|
|
1582
1582
|
},
|
|
1583
|
+
"h_c8f5eda8ace9": {
|
|
1584
|
+
"key": "accountSettings.profilePhotoRemove",
|
|
1585
|
+
"source": "Remove photo",
|
|
1586
|
+
"translation": "Αφαίρεση φωτογραφίας",
|
|
1587
|
+
"origin": "machine"
|
|
1588
|
+
},
|
|
1583
1589
|
"h_1e9b74b4dda5": {
|
|
1584
1590
|
"source": "Show all ({count})",
|
|
1585
1591
|
"translation": "Εμφάνιση όλων ({count})",
|