@wix/himalaya-cli 0.1835.0 → 0.1837.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.
Files changed (367) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/local-db/src/index.d.ts +15 -1
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +4 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +1 -0
  4. package/dist/browser-plane/assets.json +5 -5
  5. package/dist/browser-plane/preview-deferred/{9258d331cc401dff7b183ce732d49df2e480ea113b52198a4a10790167519c09.bin → 12b7dd1ca5ed350a30ed6a0085a4c31f30b46688e3795c425f145dfdd3830b31.bin} +1 -1
  6. package/dist/browser-plane/sw.js +8 -8
  7. package/dist/cli.mjs +1010 -705
  8. package/dist/preview-assets.generated.bin +0 -0
  9. package/guides/app-config.md +42 -0
  10. package/guides/component-index.md +198 -0
  11. package/guides/designing-himi-screens.md +6 -5
  12. package/guides/getting-started.md +5 -1
  13. package/guides/himi-json-output.md +14 -1
  14. package/guides/himi-skill.md +5 -1
  15. package/guides/himi-test.md +6 -1
  16. package/guides/index.json +6 -0
  17. package/guides/release-notes.md +8 -0
  18. package/guides/sdk-reference.json +1 -1
  19. package/guides/skill.md +4 -0
  20. package/guides/tier-5-add-a-screen.md +10 -5
  21. package/guides/web-ux.md +2 -1
  22. package/package.json +2 -2
  23. package/templates/beauty-salon/dev/index.ts +305 -2
  24. package/templates/beauty-salon/l10n/ar.json +77 -0
  25. package/templates/beauty-salon/l10n/cs.json +77 -0
  26. package/templates/beauty-salon/l10n/da.json +77 -0
  27. package/templates/beauty-salon/l10n/de.json +77 -0
  28. package/templates/beauty-salon/l10n/el.json +77 -0
  29. package/templates/beauty-salon/l10n/en.json +85 -1
  30. package/templates/beauty-salon/l10n/es.json +77 -0
  31. package/templates/beauty-salon/l10n/fi.json +77 -0
  32. package/templates/beauty-salon/l10n/fr.json +77 -0
  33. package/templates/beauty-salon/l10n/he.json +64 -0
  34. package/templates/beauty-salon/l10n/hu.json +77 -0
  35. package/templates/beauty-salon/l10n/id.json +77 -0
  36. package/templates/beauty-salon/l10n/it.json +77 -0
  37. package/templates/beauty-salon/l10n/ja.json +77 -0
  38. package/templates/beauty-salon/l10n/ko.json +77 -0
  39. package/templates/beauty-salon/l10n/lt.json +77 -0
  40. package/templates/beauty-salon/l10n/nl.json +77 -0
  41. package/templates/beauty-salon/l10n/no.json +77 -0
  42. package/templates/beauty-salon/l10n/pl.json +77 -0
  43. package/templates/beauty-salon/l10n/pt.json +77 -0
  44. package/templates/beauty-salon/l10n/ru.json +77 -0
  45. package/templates/beauty-salon/l10n/sv.json +77 -0
  46. package/templates/beauty-salon/l10n/th.json +77 -0
  47. package/templates/beauty-salon/l10n/tr.json +77 -0
  48. package/templates/beauty-salon/l10n/uk.json +77 -0
  49. package/templates/beauty-salon/l10n/vi.json +77 -0
  50. package/templates/beauty-salon/l10n/zh.json +77 -0
  51. package/templates/beauty-salon/tier5-src/_shared/push-permission.ts +75 -0
  52. package/templates/beauty-salon/tier5-src/himi-branded-lite-home/index.ts +103 -4
  53. package/templates/beauty-salon/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  54. package/templates/branded-lite/dev/index.ts +305 -2
  55. package/templates/branded-lite/l10n/ar.json +77 -0
  56. package/templates/branded-lite/l10n/cs.json +77 -0
  57. package/templates/branded-lite/l10n/da.json +77 -0
  58. package/templates/branded-lite/l10n/de.json +77 -0
  59. package/templates/branded-lite/l10n/el.json +77 -0
  60. package/templates/branded-lite/l10n/en.json +85 -1
  61. package/templates/branded-lite/l10n/es.json +77 -0
  62. package/templates/branded-lite/l10n/fi.json +77 -0
  63. package/templates/branded-lite/l10n/fr.json +77 -0
  64. package/templates/branded-lite/l10n/he.json +64 -0
  65. package/templates/branded-lite/l10n/hu.json +77 -0
  66. package/templates/branded-lite/l10n/id.json +77 -0
  67. package/templates/branded-lite/l10n/it.json +77 -0
  68. package/templates/branded-lite/l10n/ja.json +77 -0
  69. package/templates/branded-lite/l10n/ko.json +77 -0
  70. package/templates/branded-lite/l10n/lt.json +77 -0
  71. package/templates/branded-lite/l10n/nl.json +77 -0
  72. package/templates/branded-lite/l10n/no.json +77 -0
  73. package/templates/branded-lite/l10n/pl.json +77 -0
  74. package/templates/branded-lite/l10n/pt.json +77 -0
  75. package/templates/branded-lite/l10n/ru.json +77 -0
  76. package/templates/branded-lite/l10n/sv.json +77 -0
  77. package/templates/branded-lite/l10n/th.json +77 -0
  78. package/templates/branded-lite/l10n/tr.json +77 -0
  79. package/templates/branded-lite/l10n/uk.json +77 -0
  80. package/templates/branded-lite/l10n/vi.json +77 -0
  81. package/templates/branded-lite/l10n/zh.json +77 -0
  82. package/templates/branded-lite/tier5-src/_shared/push-permission.ts +75 -0
  83. package/templates/branded-lite/tier5-src/himi-branded-lite-home/index.ts +103 -4
  84. package/templates/branded-lite/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  85. package/templates/community-club/dev/index.ts +305 -2
  86. package/templates/community-club/l10n/ar.json +77 -0
  87. package/templates/community-club/l10n/cs.json +77 -0
  88. package/templates/community-club/l10n/da.json +77 -0
  89. package/templates/community-club/l10n/de.json +77 -0
  90. package/templates/community-club/l10n/el.json +77 -0
  91. package/templates/community-club/l10n/en.json +85 -1
  92. package/templates/community-club/l10n/es.json +77 -0
  93. package/templates/community-club/l10n/fi.json +77 -0
  94. package/templates/community-club/l10n/fr.json +77 -0
  95. package/templates/community-club/l10n/he.json +64 -0
  96. package/templates/community-club/l10n/hu.json +77 -0
  97. package/templates/community-club/l10n/id.json +77 -0
  98. package/templates/community-club/l10n/it.json +77 -0
  99. package/templates/community-club/l10n/ja.json +77 -0
  100. package/templates/community-club/l10n/ko.json +77 -0
  101. package/templates/community-club/l10n/lt.json +77 -0
  102. package/templates/community-club/l10n/nl.json +77 -0
  103. package/templates/community-club/l10n/no.json +77 -0
  104. package/templates/community-club/l10n/pl.json +77 -0
  105. package/templates/community-club/l10n/pt.json +77 -0
  106. package/templates/community-club/l10n/ru.json +77 -0
  107. package/templates/community-club/l10n/sv.json +77 -0
  108. package/templates/community-club/l10n/th.json +77 -0
  109. package/templates/community-club/l10n/tr.json +77 -0
  110. package/templates/community-club/l10n/uk.json +77 -0
  111. package/templates/community-club/l10n/vi.json +77 -0
  112. package/templates/community-club/l10n/zh.json +77 -0
  113. package/templates/community-club/tier5-src/_shared/push-permission.ts +75 -0
  114. package/templates/community-club/tier5-src/himi-branded-lite-home/index.ts +103 -4
  115. package/templates/community-club/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  116. package/templates/events-meetups/dev/index.ts +305 -2
  117. package/templates/events-meetups/l10n/ar.json +77 -0
  118. package/templates/events-meetups/l10n/cs.json +77 -0
  119. package/templates/events-meetups/l10n/da.json +77 -0
  120. package/templates/events-meetups/l10n/de.json +77 -0
  121. package/templates/events-meetups/l10n/el.json +77 -0
  122. package/templates/events-meetups/l10n/en.json +85 -1
  123. package/templates/events-meetups/l10n/es.json +77 -0
  124. package/templates/events-meetups/l10n/fi.json +77 -0
  125. package/templates/events-meetups/l10n/fr.json +77 -0
  126. package/templates/events-meetups/l10n/he.json +64 -0
  127. package/templates/events-meetups/l10n/hu.json +77 -0
  128. package/templates/events-meetups/l10n/id.json +77 -0
  129. package/templates/events-meetups/l10n/it.json +77 -0
  130. package/templates/events-meetups/l10n/ja.json +77 -0
  131. package/templates/events-meetups/l10n/ko.json +77 -0
  132. package/templates/events-meetups/l10n/lt.json +77 -0
  133. package/templates/events-meetups/l10n/nl.json +77 -0
  134. package/templates/events-meetups/l10n/no.json +77 -0
  135. package/templates/events-meetups/l10n/pl.json +77 -0
  136. package/templates/events-meetups/l10n/pt.json +77 -0
  137. package/templates/events-meetups/l10n/ru.json +77 -0
  138. package/templates/events-meetups/l10n/sv.json +77 -0
  139. package/templates/events-meetups/l10n/th.json +77 -0
  140. package/templates/events-meetups/l10n/tr.json +77 -0
  141. package/templates/events-meetups/l10n/uk.json +77 -0
  142. package/templates/events-meetups/l10n/vi.json +77 -0
  143. package/templates/events-meetups/l10n/zh.json +77 -0
  144. package/templates/events-meetups/tier5-src/_shared/push-permission.ts +75 -0
  145. package/templates/events-meetups/tier5-src/himi-branded-lite-home/index.ts +103 -4
  146. package/templates/events-meetups/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  147. package/templates/gym-fitness/dev/index.ts +305 -2
  148. package/templates/gym-fitness/l10n/ar.json +77 -0
  149. package/templates/gym-fitness/l10n/cs.json +77 -0
  150. package/templates/gym-fitness/l10n/da.json +77 -0
  151. package/templates/gym-fitness/l10n/de.json +77 -0
  152. package/templates/gym-fitness/l10n/el.json +77 -0
  153. package/templates/gym-fitness/l10n/en.json +85 -1
  154. package/templates/gym-fitness/l10n/es.json +77 -0
  155. package/templates/gym-fitness/l10n/fi.json +77 -0
  156. package/templates/gym-fitness/l10n/fr.json +77 -0
  157. package/templates/gym-fitness/l10n/he.json +64 -0
  158. package/templates/gym-fitness/l10n/hu.json +77 -0
  159. package/templates/gym-fitness/l10n/id.json +77 -0
  160. package/templates/gym-fitness/l10n/it.json +77 -0
  161. package/templates/gym-fitness/l10n/ja.json +77 -0
  162. package/templates/gym-fitness/l10n/ko.json +77 -0
  163. package/templates/gym-fitness/l10n/lt.json +77 -0
  164. package/templates/gym-fitness/l10n/nl.json +77 -0
  165. package/templates/gym-fitness/l10n/no.json +77 -0
  166. package/templates/gym-fitness/l10n/pl.json +77 -0
  167. package/templates/gym-fitness/l10n/pt.json +77 -0
  168. package/templates/gym-fitness/l10n/ru.json +77 -0
  169. package/templates/gym-fitness/l10n/sv.json +77 -0
  170. package/templates/gym-fitness/l10n/th.json +77 -0
  171. package/templates/gym-fitness/l10n/tr.json +77 -0
  172. package/templates/gym-fitness/l10n/uk.json +77 -0
  173. package/templates/gym-fitness/l10n/vi.json +77 -0
  174. package/templates/gym-fitness/l10n/zh.json +77 -0
  175. package/templates/gym-fitness/tier5-src/_shared/push-permission.ts +75 -0
  176. package/templates/gym-fitness/tier5-src/himi-branded-lite-home/index.ts +103 -4
  177. package/templates/gym-fitness/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  178. package/templates/nonprofit-cause/dev/index.ts +305 -2
  179. package/templates/nonprofit-cause/l10n/ar.json +77 -0
  180. package/templates/nonprofit-cause/l10n/cs.json +77 -0
  181. package/templates/nonprofit-cause/l10n/da.json +77 -0
  182. package/templates/nonprofit-cause/l10n/de.json +77 -0
  183. package/templates/nonprofit-cause/l10n/el.json +77 -0
  184. package/templates/nonprofit-cause/l10n/en.json +85 -1
  185. package/templates/nonprofit-cause/l10n/es.json +77 -0
  186. package/templates/nonprofit-cause/l10n/fi.json +77 -0
  187. package/templates/nonprofit-cause/l10n/fr.json +77 -0
  188. package/templates/nonprofit-cause/l10n/he.json +64 -0
  189. package/templates/nonprofit-cause/l10n/hu.json +77 -0
  190. package/templates/nonprofit-cause/l10n/id.json +77 -0
  191. package/templates/nonprofit-cause/l10n/it.json +77 -0
  192. package/templates/nonprofit-cause/l10n/ja.json +77 -0
  193. package/templates/nonprofit-cause/l10n/ko.json +77 -0
  194. package/templates/nonprofit-cause/l10n/lt.json +77 -0
  195. package/templates/nonprofit-cause/l10n/nl.json +77 -0
  196. package/templates/nonprofit-cause/l10n/no.json +77 -0
  197. package/templates/nonprofit-cause/l10n/pl.json +77 -0
  198. package/templates/nonprofit-cause/l10n/pt.json +77 -0
  199. package/templates/nonprofit-cause/l10n/ru.json +77 -0
  200. package/templates/nonprofit-cause/l10n/sv.json +77 -0
  201. package/templates/nonprofit-cause/l10n/th.json +77 -0
  202. package/templates/nonprofit-cause/l10n/tr.json +77 -0
  203. package/templates/nonprofit-cause/l10n/uk.json +77 -0
  204. package/templates/nonprofit-cause/l10n/vi.json +77 -0
  205. package/templates/nonprofit-cause/l10n/zh.json +77 -0
  206. package/templates/nonprofit-cause/tier5-src/_shared/push-permission.ts +75 -0
  207. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-home/index.ts +103 -4
  208. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  209. package/templates/personal-fitness-trainer/config.ts +1 -1
  210. package/templates/personal-fitness-trainer/dev/index.ts +129 -1
  211. package/templates/personal-fitness-trainer/tier5-src/_shared/push-permission.ts +75 -0
  212. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  213. package/templates/podcast-creator/dev/index.ts +305 -2
  214. package/templates/podcast-creator/l10n/ar.json +77 -0
  215. package/templates/podcast-creator/l10n/cs.json +77 -0
  216. package/templates/podcast-creator/l10n/da.json +77 -0
  217. package/templates/podcast-creator/l10n/de.json +77 -0
  218. package/templates/podcast-creator/l10n/el.json +77 -0
  219. package/templates/podcast-creator/l10n/en.json +85 -1
  220. package/templates/podcast-creator/l10n/es.json +77 -0
  221. package/templates/podcast-creator/l10n/fi.json +77 -0
  222. package/templates/podcast-creator/l10n/fr.json +77 -0
  223. package/templates/podcast-creator/l10n/he.json +64 -0
  224. package/templates/podcast-creator/l10n/hu.json +77 -0
  225. package/templates/podcast-creator/l10n/id.json +77 -0
  226. package/templates/podcast-creator/l10n/it.json +77 -0
  227. package/templates/podcast-creator/l10n/ja.json +77 -0
  228. package/templates/podcast-creator/l10n/ko.json +77 -0
  229. package/templates/podcast-creator/l10n/lt.json +77 -0
  230. package/templates/podcast-creator/l10n/nl.json +77 -0
  231. package/templates/podcast-creator/l10n/no.json +77 -0
  232. package/templates/podcast-creator/l10n/pl.json +77 -0
  233. package/templates/podcast-creator/l10n/pt.json +77 -0
  234. package/templates/podcast-creator/l10n/ru.json +77 -0
  235. package/templates/podcast-creator/l10n/sv.json +77 -0
  236. package/templates/podcast-creator/l10n/th.json +77 -0
  237. package/templates/podcast-creator/l10n/tr.json +77 -0
  238. package/templates/podcast-creator/l10n/uk.json +77 -0
  239. package/templates/podcast-creator/l10n/vi.json +77 -0
  240. package/templates/podcast-creator/l10n/zh.json +77 -0
  241. package/templates/podcast-creator/tier5-src/_shared/push-permission.ts +75 -0
  242. package/templates/podcast-creator/tier5-src/himi-branded-lite-home/index.ts +103 -4
  243. package/templates/podcast-creator/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  244. package/templates/portfolio-creative/dev/index.ts +305 -2
  245. package/templates/portfolio-creative/l10n/ar.json +77 -0
  246. package/templates/portfolio-creative/l10n/cs.json +77 -0
  247. package/templates/portfolio-creative/l10n/da.json +77 -0
  248. package/templates/portfolio-creative/l10n/de.json +77 -0
  249. package/templates/portfolio-creative/l10n/el.json +77 -0
  250. package/templates/portfolio-creative/l10n/en.json +85 -1
  251. package/templates/portfolio-creative/l10n/es.json +77 -0
  252. package/templates/portfolio-creative/l10n/fi.json +77 -0
  253. package/templates/portfolio-creative/l10n/fr.json +77 -0
  254. package/templates/portfolio-creative/l10n/he.json +64 -0
  255. package/templates/portfolio-creative/l10n/hu.json +77 -0
  256. package/templates/portfolio-creative/l10n/id.json +77 -0
  257. package/templates/portfolio-creative/l10n/it.json +77 -0
  258. package/templates/portfolio-creative/l10n/ja.json +77 -0
  259. package/templates/portfolio-creative/l10n/ko.json +77 -0
  260. package/templates/portfolio-creative/l10n/lt.json +77 -0
  261. package/templates/portfolio-creative/l10n/nl.json +77 -0
  262. package/templates/portfolio-creative/l10n/no.json +77 -0
  263. package/templates/portfolio-creative/l10n/pl.json +77 -0
  264. package/templates/portfolio-creative/l10n/pt.json +77 -0
  265. package/templates/portfolio-creative/l10n/ru.json +77 -0
  266. package/templates/portfolio-creative/l10n/sv.json +77 -0
  267. package/templates/portfolio-creative/l10n/th.json +77 -0
  268. package/templates/portfolio-creative/l10n/tr.json +77 -0
  269. package/templates/portfolio-creative/l10n/uk.json +77 -0
  270. package/templates/portfolio-creative/l10n/vi.json +77 -0
  271. package/templates/portfolio-creative/l10n/zh.json +77 -0
  272. package/templates/portfolio-creative/tier5-src/_shared/push-permission.ts +75 -0
  273. package/templates/portfolio-creative/tier5-src/himi-branded-lite-home/index.ts +103 -4
  274. package/templates/portfolio-creative/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  275. package/templates/restaurant/dev/index.ts +305 -2
  276. package/templates/restaurant/l10n/ar.json +77 -0
  277. package/templates/restaurant/l10n/cs.json +77 -0
  278. package/templates/restaurant/l10n/da.json +77 -0
  279. package/templates/restaurant/l10n/de.json +77 -0
  280. package/templates/restaurant/l10n/el.json +77 -0
  281. package/templates/restaurant/l10n/en.json +85 -1
  282. package/templates/restaurant/l10n/es.json +77 -0
  283. package/templates/restaurant/l10n/fi.json +77 -0
  284. package/templates/restaurant/l10n/fr.json +77 -0
  285. package/templates/restaurant/l10n/he.json +64 -0
  286. package/templates/restaurant/l10n/hu.json +77 -0
  287. package/templates/restaurant/l10n/id.json +77 -0
  288. package/templates/restaurant/l10n/it.json +77 -0
  289. package/templates/restaurant/l10n/ja.json +77 -0
  290. package/templates/restaurant/l10n/ko.json +77 -0
  291. package/templates/restaurant/l10n/lt.json +77 -0
  292. package/templates/restaurant/l10n/nl.json +77 -0
  293. package/templates/restaurant/l10n/no.json +77 -0
  294. package/templates/restaurant/l10n/pl.json +77 -0
  295. package/templates/restaurant/l10n/pt.json +77 -0
  296. package/templates/restaurant/l10n/ru.json +77 -0
  297. package/templates/restaurant/l10n/sv.json +77 -0
  298. package/templates/restaurant/l10n/th.json +77 -0
  299. package/templates/restaurant/l10n/tr.json +77 -0
  300. package/templates/restaurant/l10n/uk.json +77 -0
  301. package/templates/restaurant/l10n/vi.json +77 -0
  302. package/templates/restaurant/l10n/zh.json +77 -0
  303. package/templates/restaurant/tier5-src/_shared/push-permission.ts +75 -0
  304. package/templates/restaurant/tier5-src/himi-branded-lite-home/index.ts +103 -4
  305. package/templates/restaurant/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  306. package/templates/retail-store/dev/index.ts +305 -2
  307. package/templates/retail-store/l10n/ar.json +77 -0
  308. package/templates/retail-store/l10n/cs.json +77 -0
  309. package/templates/retail-store/l10n/da.json +77 -0
  310. package/templates/retail-store/l10n/de.json +77 -0
  311. package/templates/retail-store/l10n/el.json +77 -0
  312. package/templates/retail-store/l10n/en.json +85 -1
  313. package/templates/retail-store/l10n/es.json +77 -0
  314. package/templates/retail-store/l10n/fi.json +77 -0
  315. package/templates/retail-store/l10n/fr.json +77 -0
  316. package/templates/retail-store/l10n/he.json +64 -0
  317. package/templates/retail-store/l10n/hu.json +77 -0
  318. package/templates/retail-store/l10n/id.json +77 -0
  319. package/templates/retail-store/l10n/it.json +77 -0
  320. package/templates/retail-store/l10n/ja.json +77 -0
  321. package/templates/retail-store/l10n/ko.json +77 -0
  322. package/templates/retail-store/l10n/lt.json +77 -0
  323. package/templates/retail-store/l10n/nl.json +77 -0
  324. package/templates/retail-store/l10n/no.json +77 -0
  325. package/templates/retail-store/l10n/pl.json +77 -0
  326. package/templates/retail-store/l10n/pt.json +77 -0
  327. package/templates/retail-store/l10n/ru.json +77 -0
  328. package/templates/retail-store/l10n/sv.json +77 -0
  329. package/templates/retail-store/l10n/th.json +77 -0
  330. package/templates/retail-store/l10n/tr.json +77 -0
  331. package/templates/retail-store/l10n/uk.json +77 -0
  332. package/templates/retail-store/l10n/vi.json +77 -0
  333. package/templates/retail-store/l10n/zh.json +77 -0
  334. package/templates/retail-store/tier5-src/_shared/push-permission.ts +75 -0
  335. package/templates/retail-store/tier5-src/himi-branded-lite-home/index.ts +103 -4
  336. package/templates/retail-store/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
  337. package/templates/yoga-studio/dev/index.ts +305 -2
  338. package/templates/yoga-studio/l10n/ar.json +77 -0
  339. package/templates/yoga-studio/l10n/cs.json +77 -0
  340. package/templates/yoga-studio/l10n/da.json +77 -0
  341. package/templates/yoga-studio/l10n/de.json +77 -0
  342. package/templates/yoga-studio/l10n/el.json +77 -0
  343. package/templates/yoga-studio/l10n/en.json +85 -1
  344. package/templates/yoga-studio/l10n/es.json +77 -0
  345. package/templates/yoga-studio/l10n/fi.json +77 -0
  346. package/templates/yoga-studio/l10n/fr.json +77 -0
  347. package/templates/yoga-studio/l10n/he.json +64 -0
  348. package/templates/yoga-studio/l10n/hu.json +77 -0
  349. package/templates/yoga-studio/l10n/id.json +77 -0
  350. package/templates/yoga-studio/l10n/it.json +77 -0
  351. package/templates/yoga-studio/l10n/ja.json +77 -0
  352. package/templates/yoga-studio/l10n/ko.json +77 -0
  353. package/templates/yoga-studio/l10n/lt.json +77 -0
  354. package/templates/yoga-studio/l10n/nl.json +77 -0
  355. package/templates/yoga-studio/l10n/no.json +77 -0
  356. package/templates/yoga-studio/l10n/pl.json +77 -0
  357. package/templates/yoga-studio/l10n/pt.json +77 -0
  358. package/templates/yoga-studio/l10n/ru.json +77 -0
  359. package/templates/yoga-studio/l10n/sv.json +77 -0
  360. package/templates/yoga-studio/l10n/th.json +77 -0
  361. package/templates/yoga-studio/l10n/tr.json +77 -0
  362. package/templates/yoga-studio/l10n/uk.json +77 -0
  363. package/templates/yoga-studio/l10n/vi.json +77 -0
  364. package/templates/yoga-studio/l10n/zh.json +77 -0
  365. package/templates/yoga-studio/tier5-src/_shared/push-permission.ts +75 -0
  366. package/templates/yoga-studio/tier5-src/himi-branded-lite-home/index.ts +103 -4
  367. package/templates/yoga-studio/tier5-src/himi-branded-lite-notifsettings/index.ts +108 -6
@@ -5,6 +5,7 @@ import { isProgramEnded } from "../_shared/program-fields.js";
5
5
  import { fetchMemberBookings, type MemberBookingRow } from "../_shared/member-bookings.js";
6
6
  import { hostSiteFromInput, hostedExploreCards, hostedHiddenFlags, type HostedExploreCard } from "../_shared/branded-lite-hosted.js";
7
7
  import { memberAccess, assertMemberAccess } from "../_shared/member-access.js";
8
+ import { askForPush, readPhonePush, refreshGrantedTokenOnce, type PhonePush } from "../_shared/push-permission.js";
8
9
  import { defineService as registerHome } from "../_shared/home-service.js";
9
10
  import { navigate } from "@himalaya/state";
10
11
  import { withIapPresentation } from "../_shared/iap-presentation.js";
@@ -283,6 +284,12 @@ interface State {
283
284
  /** Inverse of onboardingHidden — hide the post-onboarding primary Shop CTA
284
285
  * while the welcome card is still up (one primary: Got it). */
285
286
  onboardingActive: boolean;
287
+ /** The in-context push ask (Turn on / Not now). Hidden unless a signed-in member's phone can
288
+ * still show the system prompt and this phone has not answered the card. */
289
+ pushAskHidden: boolean;
290
+ /** Which benefit line the ask shows (hiddenWhen flags, so TRUE hides): the one that fits the
291
+ * installed verticals, the general one in hosted mode. */
292
+ hidePushBodyOrders: boolean; hidePushBodyBookings: boolean; hidePushBodyOrdersBookings: boolean; hidePushBodyGeneral: boolean;
286
293
  heroTitle: string;
287
294
  heroSubtitle: string;
288
295
  heroPrice: string;
@@ -378,6 +385,51 @@ function onboardingSeen(): boolean {
378
385
  try { return storage()?.getItem(ONBOARDING_KEY) === "1"; } catch { return false; }
379
386
  }
380
387
 
388
+ // The push ask is answered once per phone, either way: "Not now" must not come back every launch.
389
+ const PUSH_ASKED_KEY = "himi.brandedLite.pushAsked";
390
+ let pushCheckGeneration = 0;
391
+ /** Also held in memory: a host without storage must still keep "Not now" for this run. */
392
+ let pushAskAnsweredThisRun = false;
393
+ function pushAskAnswered(): boolean {
394
+ if (pushAskAnsweredThisRun) return true;
395
+ try { return storage()?.getItem(PUSH_ASKED_KEY) === "1"; } catch { return false; }
396
+ }
397
+ function rememberPushAskAnswered(): void {
398
+ pushAskAnsweredThisRun = true;
399
+ try { storage()?.setItem(PUSH_ASKED_KEY, "1"); } catch { /* best-effort: held in memory for this run */ }
400
+ }
401
+
402
+ /** Whether the system prompt can still be shown. iOS and macOS say so ("undetermined"); Android 13+
403
+ * reports "denied" before its first ask too, so there a refusal cannot be told from never asked.
404
+ * An iOS phone that refused, and Android below 13 (no runtime dialog), have Notification
405
+ * settings' Settings path instead. */
406
+ function promptPossible(phone: PhonePush): boolean {
407
+ return phone.status === "undetermined" || (phone.status === "denied" && phone.deniedMayPrompt);
408
+ }
409
+
410
+ type PushBody = "orders" | "bookings" | "ordersBookings" | "general";
411
+ /** Ping routes member pushes for orders and bookings; anything else is replies and updates. */
412
+ function pushBodyFor(verticals: string[], hosted: boolean): PushBody {
413
+ if (hosted) return "general";
414
+ const orders = verticals.includes("store"), bookings = verticals.includes("bookings");
415
+ return orders && bookings ? "ordersBookings" : orders ? "orders" : bookings ? "bookings" : "general";
416
+ }
417
+ function pushBodyFlags(body: PushBody): Pick<State, "hidePushBodyOrders" | "hidePushBodyBookings" | "hidePushBodyOrdersBookings" | "hidePushBodyGeneral"> {
418
+ return { hidePushBodyOrders: body !== "orders", hidePushBodyBookings: body !== "bookings",
419
+ hidePushBodyOrdersBookings: body !== "ordersBookings", hidePushBodyGeneral: body !== "general" };
420
+ }
421
+
422
+ /** The moment of value is after sign-in: Ping delivers member notifications (orders, bookings,
423
+ * chat) only to a signed-in member, so a visitor has nothing to be notified about yet. */
424
+ async function shouldAskForPush(): Promise<boolean> {
425
+ const phone = await readPhonePush();
426
+ // Every launch, answered or not: a grant still needs this launch's token, and shells older than
427
+ // the native refresh registered it only from the launch prompt this app no longer shows.
428
+ await refreshGrantedTokenOnce(phone.status);
429
+ if (pushAskAnswered() || !promptPossible(phone)) return false;
430
+ return (await memberAccess()).signedIn === true;
431
+ }
432
+
381
433
  // The user's own layout choice, persisted by the appearance worker under the
382
434
  // same shared LAYOUT_KEY. Best-effort — a missing store just means we fall back
383
435
  // to owner-default / content-recommendation.
@@ -1085,6 +1137,8 @@ function baseState(): State {
1085
1137
  refreshedAt: "",
1086
1138
  effectiveLayout: resolveEffectiveLayout(undefined, 0),
1087
1139
  onboardingHidden: onboardingSeen(),
1140
+ pushAskHidden: true,
1141
+ ...pushBodyFlags("general"),
1088
1142
  // derive() recomputes this from onboardingHidden, but State requires it and this
1089
1143
  // literal is a full State by contract — every other derived flag above is passed
1090
1144
  // explicitly for the same reason. Omitting it made baseState() not a State.
@@ -1327,6 +1381,7 @@ async function refresh(state: State, arg?: unknown): Promise<State | undefined>
1327
1381
  const generation = ++personalGeneration;
1328
1382
  // Personalized work must never hold public browsing behind identity/network.
1329
1383
  svc.clearPersonal();
1384
+ void svc.checkPushAsk();
1330
1385
  void refreshPersonal(generation, arg);
1331
1386
  const publicState = await refreshPublic(state, arg);
1332
1387
  if (!publicState || generation !== personalGeneration) return undefined;
@@ -1344,7 +1399,10 @@ async function refresh(state: State, arg?: unknown): Promise<State | undefined>
1344
1399
  memberProgressLabel: current.memberProgressLabel, memberProgressFraction: current.memberProgressFraction,
1345
1400
  hideMemberProgress: current.hideMemberProgress, personalError: current.personalError, hidePersonalError: current.hidePersonalError,
1346
1401
  // The weekly goal is PERSONAL (member bookings); the public refresh resets it, so keep it.
1347
- weeklyClassCount: current.weeklyClassCount, weeklyClassGoalFraction: current.weeklyClassGoalFraction, weeklyGoalLabel: current.weeklyGoalLabel });
1402
+ weeklyClassCount: current.weeklyClassCount, weeklyClassGoalFraction: current.weeklyClassGoalFraction, weeklyGoalLabel: current.weeklyGoalLabel,
1403
+ // Decided by checkPushAsk, which may have landed while the public read was in flight.
1404
+ pushAskHidden: current.pushAskHidden, hidePushBodyOrders: current.hidePushBodyOrders, hidePushBodyBookings: current.hidePushBodyBookings,
1405
+ hidePushBodyOrdersBookings: current.hidePushBodyOrdersBookings, hidePushBodyGeneral: current.hidePushBodyGeneral });
1348
1406
  }
1349
1407
 
1350
1408
  const defineService = withIapPresentation<State>({
@@ -1366,6 +1424,9 @@ const svc = defineService<State, {
1366
1424
  // constraint allows an undefined return for exactly this; the declaration did not.
1367
1425
  refresh: (state: State, arg?: unknown) => Promise<State | undefined>;
1368
1426
  dismissOnboarding: (state: State) => State;
1427
+ checkPushAsk: (state: State, arg?: unknown) => Promise<State | undefined>;
1428
+ turnOnPush: (state: State) => Promise<State | undefined>;
1429
+ dismissPushAsk: (state: State) => State;
1369
1430
  clearPersonal: (state: State) => State;
1370
1431
  memberProgramsLoaded: (state: State, arg: { generation: number; rows: MemberProgramCard[]; attempt?: number }) => State | undefined;
1371
1432
  openShopCategory: (state: State, arg?: unknown) => State;
@@ -1375,9 +1436,10 @@ const svc = defineService<State, {
1375
1436
  state: baseState(),
1376
1437
  // The host's site is read fresh at every boot: a snapshot of the last session's site must not
1377
1438
  // decide this one's verticals or name (an owner installs or removes one; another site opens).
1378
- notHydrated: ["hosted", "hostedName", "hostedCards", "homeCategories", "noHomeCategories", "memberPrograms", "noMemberPrograms"],
1439
+ notHydrated: ["hosted", "hostedName", "hostedCards", "homeCategories", "noHomeCategories", "memberPrograms", "noMemberPrograms", "pushAskHidden"],
1379
1440
  // A member's standing never reaches the on-device snapshot either: the next boot may be another member's.
1380
- notPersisted: ["memberPrograms", "noMemberPrograms"],
1441
+ // Nor does the push ask: an early paint from the snapshot would show last run's card.
1442
+ notPersisted: ["memberPrograms", "noMemberPrograms", "pushAskHidden"],
1381
1443
  actions: {
1382
1444
  clearPersonal: state => derive({ ...state, nextBooking: [], hideNextBooking: true, memberProgressLabel: "", memberProgressFraction: 0, hideMemberProgress: true, memberPrograms: [], noMemberPrograms: true, personalError: false, hidePersonalError: true,
1383
1445
  weeklyClassCount: 0, weeklyClassGoalFraction: 0, weeklyGoalLabel: "" }),
@@ -1419,6 +1481,42 @@ const svc = defineService<State, {
1419
1481
  try { storage()?.setItem(ONBOARDING_KEY, "1"); } catch { /* best-effort */ }
1420
1482
  return derive({ ...state, onboardingHidden: true });
1421
1483
  },
1484
+ checkPushAsk: async (_state: State, arg?: unknown): Promise<State | undefined> => {
1485
+ stashCopy(arg);
1486
+ // Only the newest check publishes: an older one (e.g. a visitor's) must not undo a later
1487
+ // revisit's answer for the member who has signed in since.
1488
+ const generation = ++pushCheckGeneration;
1489
+ // Re-read the answer after the awaits: "Not now" tapped meanwhile must win.
1490
+ const hidden = !(await shouldAskForPush()) || pushAskAnswered();
1491
+ if (generation !== pushCheckGeneration) return undefined;
1492
+ const live: State = svc.getState();
1493
+ const body = pushBodyFlags(pushBodyFor(parseVerticals(undefined), !!hostedSite));
1494
+ const same = live.pushAskHidden === hidden && (Object.keys(body) as (keyof typeof body)[]).every((k) => live[k] === body[k]);
1495
+ return same ? undefined : derive({ ...live, ...body, pushAskHidden: hidden });
1496
+ },
1497
+ // The ONLY path to the system prompt. Never a Settings trip: whatever the answer, the card is done.
1498
+ turnOnPush: async (): Promise<State | undefined> => {
1499
+ // Re-check before prompting: a card restored from an older session may outlive the member.
1500
+ // The tap decides on its own fresh check and then outranks every check started before it
1501
+ // (a Home refresh must not cancel it). The permission is the phone's, not the member's, so a
1502
+ // sign-out racing the tap costs nothing but timing.
1503
+ const stillEligible = await shouldAskForPush();
1504
+ ++pushCheckGeneration;
1505
+ // A failed check hides the card for now but does not use up the offer; "Not now" tapped
1506
+ // while the check ran wins.
1507
+ if (stillEligible && !pushAskAnswered()) {
1508
+ const status = await askForPush();
1509
+ // Remembered only once the OS has an answer: a request that failed before any dialog
1510
+ // ("undetermined" or unreadable) leaves the offer for the next visit.
1511
+ if (status === "granted" || status === "denied") rememberPushAskAnswered();
1512
+ }
1513
+ const live: State = svc.getState();
1514
+ return derive({ ...live, pushAskHidden: true });
1515
+ },
1516
+ dismissPushAsk: (state) => {
1517
+ rememberPushAskAnswered();
1518
+ return derive({ ...state, pushAskHidden: true });
1519
+ },
1422
1520
  },
1423
1521
  });
1424
1522
 
@@ -1427,7 +1525,8 @@ const svc = defineService<State, {
1427
1525
  // name. In place, because on those runtimes getState() IS the stored state (as himi-player-home does).
1428
1526
  if ((globalThis as { himalaya?: { hydrationOptOut?: unknown } }).himalaya?.hydrationOptOut !== true) {
1429
1527
  const live = (svc as { getState?: () => State | undefined }).getState?.();
1430
- if (live && typeof live === "object") Object.assign(live, hostedBoot, { homeCategories: [], noHomeCategories: true });
1528
+ // pushAskHidden too: a card restored from the last session may not be this member's.
1529
+ if (live && typeof live === "object") Object.assign(live, hostedBoot, { homeCategories: [], noHomeCategories: true, pushAskHidden: true });
1431
1530
  }
1432
1531
 
1433
1532
  svc.refresh();
@@ -6,9 +6,16 @@ import { withOnlineWrites } from "../_shared/online-actions.js";
6
6
  // (_shared/branded-load-state.ts).
7
7
  // any exist. INTERACTIVE: tapping a row toggles that topic On/Off — optimistic +
8
8
  // best-effort upsertMyNotificationPreferences (a no-op on sample rows).
9
- import { defineService as registerService } from "@himalaya/state";
9
+ //
10
+ // A saved preference is only half the truth: the PHONE's permission decides whether anything
11
+ // arrives. So the screen also reads it (declares "push"): denied ⇒ "off on this phone" + Open
12
+ // Settings, never asked ⇒ an offer to turn on, and either way the switches are dimmed. `load`
13
+ // arms a poll the host fires the moment the app returns to the foreground, which is the return
14
+ // from the OS settings.
15
+ import { defineService as registerService, type PollDirective } from "@himalaya/state";
16
+ import { askForPush, openPushSettings, readPhonePush, refreshGrantedToken, refreshGrantedTokenOnce, type PushStatus } from "../_shared/push-permission.js";
10
17
  import { withEmptyFlags } from "../_shared/empty-flags.js";
11
- import { stashCopy } from "../_shared/himi-copy.js";
18
+ import { copyParam, stashCopy } from "../_shared/himi-copy.js";
12
19
  import { memberAccess, assertMemberAccess, type MemberAccess } from "../_shared/member-access.js";
13
20
  import { LOADING, loaded, loadFailed, type LoadCopy, type LoadFlags } from "../_shared/branded-load-state.js";
14
21
  import {
@@ -41,8 +48,42 @@ interface S extends LoadFlags {
41
48
  * query failed. A failed query must never render the sentence that claims the
42
49
  * customer has no content. */
43
50
  notMockEmpty: boolean; notMockUnavailable: boolean;
51
+ /** The phone's notification permission; "loading" until read, "error" without push. */
52
+ pushStatus: PushStatus | "loading";
53
+ /** hiddenWhen flags: the "off on this phone" card shows only when denied, the turn-on offer
54
+ * only when never asked. Both hidden while loading or without push. */
55
+ hidePushOff: boolean; hidePushAsk: boolean;
56
+ /** The off card's one button: "Open Settings" where only Settings can change it, "Turn on" on
57
+ * Android 13+, whose "denied" also means never asked (the action prompts, then falls to Settings). */
58
+ hideOffSettingsCta: boolean; hideOffTurnOnCta: boolean;
59
+ /** The topic switches' opacity: dimmed while the phone blocks notifications. */
60
+ topicsOpacity: number;
61
+ pushMessage: string;
62
+ /** Transient: the runtime strips it and arms the foreground-refresh poll. */
63
+ _poll?: PollDirective;
44
64
  }
45
65
 
66
+ const DIMMED = 0.45;
67
+
68
+ /** The push half of the view for a status. Pure, so every branch is pinned by the tests. */
69
+ type PushView = Pick<S, "pushStatus" | "hidePushOff" | "hidePushAsk" | "hideOffSettingsCta" | "hideOffTurnOnCta" | "topicsOpacity">;
70
+ export function pushView(pushStatus: S["pushStatus"], deniedMayPrompt = false): PushView {
71
+ const blocked = pushStatus === "denied" || pushStatus === "undetermined";
72
+ const off = pushStatus === "denied";
73
+ return {
74
+ pushStatus, hidePushOff: !off, hidePushAsk: pushStatus !== "undetermined",
75
+ hideOffSettingsCta: !off || deniedMayPrompt, hideOffTurnOnCta: !off || !deniedMayPrompt,
76
+ topicsOpacity: blocked ? DIMMED : 1,
77
+ };
78
+ }
79
+
80
+ /** Whether this phone's "denied" may still hide a first ask (last read; see readPhonePush). */
81
+ let deniedMayPrompt = false;
82
+ const viewOf = (status: S["pushStatus"]): PushView => pushView(status, deniedMayPrompt);
83
+
84
+ const POLL: PollDirective = { id: "himi-branded-notifsettings-push", intervalMs: 60_000, action: "himiBrandedNotifSettings.checkPush", immediate: false };
85
+ const OPEN_FAILED = () => copyParam("notifsettings.openSettingsFailed", "Change notifications for this app in your phone's settings.");
86
+
46
87
  /** Whether this topic is actually being DELIVERED — not merely what the recipient
47
88
  * asked for. `isDeliveredNow` prefers the server's `granted` verdict, so a topic the
48
89
  * member unmuted under a channel-wide mute renders OFF instead of promising a
@@ -97,20 +138,50 @@ const COPY: LoadCopy<Row> = {
97
138
 
98
139
  const defineService = withOnlineWrites(registerService, ["toggle"], { messageFields: ["actionMessage"] });
99
140
  const INITIAL = { ...LOADING, topics: [] as Row[], emptyText: "", actionMessage: "", preferencesMember: null };
141
+ const PUSH_INITIAL = { ...pushView("loading"), pushMessage: "" };
142
+ const PUSH_FIELDS = ["pushStatus", "hidePushOff", "hidePushAsk", "hideOffSettingsCta", "hideOffTurnOnCta", "topicsOpacity", "pushMessage"] as const;
143
+ /** Bumped by every action that writes the permission: a load started earlier must not overwrite it. */
144
+ let pushWrites = 0;
145
+ function pushFieldsOf(state: S): Pick<S, (typeof PUSH_FIELDS)[number]> {
146
+ return Object.fromEntries(PUSH_FIELDS.map((k) => [k, state[k]])) as Pick<S, (typeof PUSH_FIELDS)[number]>;
147
+ }
100
148
  const signInRequired = () => new Error("Unauthenticated: sign in to manage notifications");
101
149
  let loadVersion = 0;
102
150
  const svc = defineService<S, {
103
151
  prepare: (s: S) => S;
104
152
  load: (s: S, arg?: unknown) => Promise<S | undefined>;
105
153
  toggle: (s: S, p?: { id?: string; value?: unknown }) => Promise<S | undefined>;
154
+ checkPush: (s: S) => Promise<S | undefined>;
155
+ enablePush: (s: S) => Promise<S>;
156
+ openPushSettings: (s: S) => Promise<S>;
106
157
  }>("himiBrandedNotifSettings", withEmptyFlags({
107
- state: INITIAL,
158
+ state: { ...INITIAL, ...PUSH_INITIAL },
159
+ // The phone's permission is read fresh each run: last run's answer may have changed in Settings.
160
+ notHydrated: [...PUSH_FIELDS],
161
+ // Nor persisted: an early paint from the snapshot would show last run's card before the worker reads the OS.
162
+ notPersisted: [...PUSH_FIELDS],
108
163
  actions: {
109
- prepare: (s) => ({ ...s, ...INITIAL }),
164
+ // The push view too: a warm worker must not show last visit's card while this load reads the OS.
165
+ // `pushStatus` is kept: a poll comparing against it must not mistake a reload for a change.
166
+ prepare: (s) => ({ ...s, ...INITIAL, ...PUSH_INITIAL, pushStatus: s.pushStatus }),
110
167
  load: async (s, arg): Promise<S | undefined> => {
111
168
  stashCopy(arg);
112
169
  const version = ++loadVersion;
113
170
  await svc.prepare();
171
+ // Independent of the member (a visitor's phone permission is just as real), and read HERE rather
172
+ // than by a second action, which could commit after this one with no topics.
173
+ const phoneRead = readPhonePush();
174
+ const writesAtStart = pushWrites;
175
+ const pushOf = async () => {
176
+ const phone = await phoneRead;
177
+ // A grant made (or seen) while this load waited on the topics wins over its older read.
178
+ if (pushWrites !== writesAtStart) return pushFieldsOf(current());
179
+ deniedMayPrompt = phone.deniedMayPrompt;
180
+ // A grant first seen here (e.g. turned on in Settings before this screen opened) still needs
181
+ // this session's token.
182
+ await refreshGrantedTokenOnce(phone.status);
183
+ return { ...viewOf(phone.status), pushMessage: "" };
184
+ };
114
185
  try {
115
186
  const member = await memberAccess();
116
187
  if (!member.email) throw signInRequired();
@@ -121,12 +192,14 @@ const svc = defineService<S, {
121
192
  await assertMemberAccess(member);
122
193
  const prefs = readPreferences(prefsRes);
123
194
  const topics = readTopics(topicsRes).map((t) => norm(t, prefs));
124
- return version === loadVersion ? { ...s, ...loaded("topics", topics, COPY), preferencesMember: member, actionMessage: "" } : undefined;
195
+ const push = await pushOf();
196
+ return version === loadVersion ? { ...current(), ...loaded("topics", topics, COPY), ...push, preferencesMember: member, actionMessage: "", _poll: POLL } : undefined;
125
197
  } catch {
126
198
  const member = await memberAccess();
127
199
  // An authenticated denial is not repaired by an endless sign-in loop.
128
200
  const failure = member.email ? new Error(COPY.error) : signInRequired();
129
- return version === loadVersion ? { ...s, ...loadFailed("topics", failure, COPY), preferencesMember: null, actionMessage: "" } : undefined;
201
+ const push = await pushOf();
202
+ return version === loadVersion ? { ...current(), ...loadFailed("topics", failure, COPY), ...push, preferencesMember: null, actionMessage: "", _poll: POLL } : undefined;
130
203
  }
131
204
  },
132
205
  // Flip one topic's On/Off. Optimistic (updates the row immediately); the real
@@ -166,8 +239,37 @@ const svc = defineService<S, {
166
239
  }
167
240
  return svc.getState().preferencesMember === s.preferencesMember ? { ...svc.getState(), topics } : undefined;
168
241
  },
242
+ // onAppear's kick and every poll tick (the host fires it on return from the OS settings).
243
+ checkPush: async (s): Promise<S | undefined> => {
244
+ const phone = await readPhonePush();
245
+ deniedMayPrompt = phone.deniedMayPrompt;
246
+ const status = phone.status;
247
+ if (status === s.pushStatus) return undefined;
248
+ pushWrites++;
249
+ // Turned on in the OS settings while away: register this session's token.
250
+ await refreshGrantedToken(status);
251
+ return { ...current(), ...viewOf(status), pushMessage: "" };
252
+ },
253
+ // "Turn on notifications" (never asked): the system prompt, and nothing else. The answer is
254
+ // awaited BEFORE the state is read: topics may have loaded while the prompt was up.
255
+ enablePush: async (): Promise<S> => {
256
+ const status = await askForPush();
257
+ pushWrites++;
258
+ return { ...current(), ...viewOf(status), pushMessage: "" };
259
+ },
260
+ // "Open Settings" (denied). A request first: on Android "denied" also means never asked, and
261
+ // a request is the only way to find out. Anything but a grant goes to the OS settings.
262
+ openPushSettings: async (): Promise<S> => {
263
+ const status = await askForPush();
264
+ pushWrites++;
265
+ if (status === "granted") return { ...current(), ...viewOf(status), pushMessage: "" };
266
+ const opened = await openPushSettings();
267
+ return { ...current(), ...viewOf(status), pushMessage: opened ? "" : OPEN_FAILED() };
268
+ },
169
269
  },
170
270
  }, { topics: "noTopics" }));
271
+ /** The live state, typed: the actions above read it after an await (TS7022 without the annotation). */
272
+ function current(): S { return svc.getState() as S; }
171
273
  svc.prepare();
172
274
  svc.load();
173
275
  export { svc };