@wix/himalaya-cli 0.2052.0 → 0.2054.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 (483) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/members-v1/src/index.d.ts +31 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-members.mjs +12 -0
  3. package/dist/cli.mjs +8 -3
  4. package/fixtures/wix-canned.json +1 -0
  5. package/guides/sdk-reference.json +35 -1
  6. package/package.json +2 -2
  7. package/templates/bare-fashion/tier5-src/_shared/about-text.ts +8 -0
  8. package/templates/bare-fashion/tier5-src/_shared/detail-presence.ts +51 -0
  9. package/templates/bare-fashion/tier5-src/_shared/owner-editor-value.ts +164 -0
  10. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  11. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  12. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  13. package/templates/bare-fashion/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  14. package/templates/beauty-salon/config.ts +7 -0
  15. package/templates/beauty-salon/dev/index.ts +1568 -171
  16. package/templates/beauty-salon/himalaya.content.json +3 -0
  17. package/templates/beauty-salon/l10n/ar.json +150 -6
  18. package/templates/beauty-salon/l10n/cs.json +150 -6
  19. package/templates/beauty-salon/l10n/da.json +150 -6
  20. package/templates/beauty-salon/l10n/de.json +150 -6
  21. package/templates/beauty-salon/l10n/el.json +150 -6
  22. package/templates/beauty-salon/l10n/en.json +102 -9
  23. package/templates/beauty-salon/l10n/es.json +150 -6
  24. package/templates/beauty-salon/l10n/fi.json +150 -6
  25. package/templates/beauty-salon/l10n/fr.json +150 -6
  26. package/templates/beauty-salon/l10n/he.json +119 -5
  27. package/templates/beauty-salon/l10n/hu.json +150 -6
  28. package/templates/beauty-salon/l10n/id.json +150 -6
  29. package/templates/beauty-salon/l10n/it.json +150 -6
  30. package/templates/beauty-salon/l10n/ja.json +150 -6
  31. package/templates/beauty-salon/l10n/ko.json +150 -6
  32. package/templates/beauty-salon/l10n/lt.json +150 -6
  33. package/templates/beauty-salon/l10n/nl.json +150 -6
  34. package/templates/beauty-salon/l10n/no.json +150 -6
  35. package/templates/beauty-salon/l10n/pl.json +150 -6
  36. package/templates/beauty-salon/l10n/pt.json +150 -6
  37. package/templates/beauty-salon/l10n/ru.json +150 -6
  38. package/templates/beauty-salon/l10n/sv.json +150 -6
  39. package/templates/beauty-salon/l10n/th.json +150 -6
  40. package/templates/beauty-salon/l10n/tr.json +150 -6
  41. package/templates/beauty-salon/l10n/uk.json +150 -6
  42. package/templates/beauty-salon/l10n/vi.json +150 -6
  43. package/templates/beauty-salon/l10n/zh.json +150 -6
  44. package/templates/beauty-salon/tier5-src/_shared/about-text.ts +8 -0
  45. package/templates/beauty-salon/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  46. package/templates/beauty-salon/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  47. package/templates/beauty-salon/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  48. package/templates/beauty-salon/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  49. package/templates/beauty-salon/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  50. package/templates/branded-lite/config.ts +7 -0
  51. package/templates/branded-lite/dev/index.ts +2048 -167
  52. package/templates/branded-lite/himalaya.content.json +3 -0
  53. package/templates/branded-lite/l10n/ar.json +74 -6
  54. package/templates/branded-lite/l10n/cs.json +74 -6
  55. package/templates/branded-lite/l10n/da.json +74 -6
  56. package/templates/branded-lite/l10n/de.json +74 -6
  57. package/templates/branded-lite/l10n/el.json +74 -6
  58. package/templates/branded-lite/l10n/en.json +67 -11
  59. package/templates/branded-lite/l10n/es.json +74 -6
  60. package/templates/branded-lite/l10n/fi.json +74 -6
  61. package/templates/branded-lite/l10n/fr.json +74 -6
  62. package/templates/branded-lite/l10n/he.json +57 -5
  63. package/templates/branded-lite/l10n/hu.json +74 -6
  64. package/templates/branded-lite/l10n/id.json +74 -6
  65. package/templates/branded-lite/l10n/it.json +74 -6
  66. package/templates/branded-lite/l10n/ja.json +74 -6
  67. package/templates/branded-lite/l10n/ko.json +74 -6
  68. package/templates/branded-lite/l10n/lt.json +74 -6
  69. package/templates/branded-lite/l10n/nl.json +74 -6
  70. package/templates/branded-lite/l10n/no.json +74 -6
  71. package/templates/branded-lite/l10n/pl.json +74 -6
  72. package/templates/branded-lite/l10n/pt.json +74 -6
  73. package/templates/branded-lite/l10n/ru.json +74 -6
  74. package/templates/branded-lite/l10n/sv.json +74 -6
  75. package/templates/branded-lite/l10n/th.json +74 -6
  76. package/templates/branded-lite/l10n/tr.json +74 -6
  77. package/templates/branded-lite/l10n/uk.json +74 -6
  78. package/templates/branded-lite/l10n/vi.json +74 -6
  79. package/templates/branded-lite/l10n/zh.json +74 -6
  80. package/templates/branded-lite/tier5-src/_shared/about-text.ts +8 -0
  81. package/templates/branded-lite/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  82. package/templates/branded-lite/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  83. package/templates/branded-lite/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  84. package/templates/branded-lite/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  85. package/templates/branded-lite/tier5-src/wix-spaces-member-detail/index.ts +247 -34
  86. package/templates/brandy/tier5-src/_shared/about-text.ts +8 -0
  87. package/templates/brandy/tier5-src/_shared/owner-editor-value.ts +164 -0
  88. package/templates/brandy/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  89. package/templates/brandy/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  90. package/templates/brandy/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  91. package/templates/brandy/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  92. package/templates/community-club/config.ts +7 -0
  93. package/templates/community-club/dev/index.ts +1813 -171
  94. package/templates/community-club/himalaya.content.json +3 -0
  95. package/templates/community-club/l10n/ar.json +151 -12
  96. package/templates/community-club/l10n/cs.json +151 -12
  97. package/templates/community-club/l10n/da.json +151 -12
  98. package/templates/community-club/l10n/de.json +151 -12
  99. package/templates/community-club/l10n/el.json +151 -12
  100. package/templates/community-club/l10n/en.json +107 -15
  101. package/templates/community-club/l10n/es.json +151 -12
  102. package/templates/community-club/l10n/fi.json +151 -12
  103. package/templates/community-club/l10n/fr.json +151 -12
  104. package/templates/community-club/l10n/he.json +125 -10
  105. package/templates/community-club/l10n/hu.json +151 -12
  106. package/templates/community-club/l10n/id.json +151 -12
  107. package/templates/community-club/l10n/it.json +151 -12
  108. package/templates/community-club/l10n/ja.json +151 -12
  109. package/templates/community-club/l10n/ko.json +151 -12
  110. package/templates/community-club/l10n/lt.json +151 -12
  111. package/templates/community-club/l10n/nl.json +151 -12
  112. package/templates/community-club/l10n/no.json +151 -12
  113. package/templates/community-club/l10n/pl.json +151 -12
  114. package/templates/community-club/l10n/pt.json +151 -12
  115. package/templates/community-club/l10n/ru.json +151 -12
  116. package/templates/community-club/l10n/sv.json +151 -12
  117. package/templates/community-club/l10n/th.json +151 -12
  118. package/templates/community-club/l10n/tr.json +151 -12
  119. package/templates/community-club/l10n/uk.json +151 -12
  120. package/templates/community-club/l10n/vi.json +151 -12
  121. package/templates/community-club/l10n/zh.json +151 -12
  122. package/templates/community-club/tier5-src/_shared/about-text.ts +8 -0
  123. package/templates/community-club/tier5-src/_shared/detail-presence.ts +51 -0
  124. package/templates/community-club/tier5-src/_shared/owner-editor-value.ts +164 -0
  125. package/templates/community-club/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  126. package/templates/community-club/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  127. package/templates/community-club/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  128. package/templates/community-club/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  129. package/templates/community-club/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  130. package/templates/conference/tier5-src/_shared/about-text.ts +8 -0
  131. package/templates/conference/tier5-src/_shared/detail-presence.ts +51 -0
  132. package/templates/conference/tier5-src/_shared/owner-editor-value.ts +164 -0
  133. package/templates/conference/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  134. package/templates/conference/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  135. package/templates/conference/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  136. package/templates/conference/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  137. package/templates/events-meetups/config.ts +7 -0
  138. package/templates/events-meetups/dev/index.ts +1817 -175
  139. package/templates/events-meetups/himalaya.content.json +3 -0
  140. package/templates/events-meetups/l10n/ar.json +151 -12
  141. package/templates/events-meetups/l10n/cs.json +151 -12
  142. package/templates/events-meetups/l10n/da.json +151 -12
  143. package/templates/events-meetups/l10n/de.json +151 -12
  144. package/templates/events-meetups/l10n/el.json +151 -12
  145. package/templates/events-meetups/l10n/en.json +107 -15
  146. package/templates/events-meetups/l10n/es.json +151 -12
  147. package/templates/events-meetups/l10n/fi.json +151 -12
  148. package/templates/events-meetups/l10n/fr.json +151 -12
  149. package/templates/events-meetups/l10n/he.json +125 -10
  150. package/templates/events-meetups/l10n/hu.json +151 -12
  151. package/templates/events-meetups/l10n/id.json +151 -12
  152. package/templates/events-meetups/l10n/it.json +151 -12
  153. package/templates/events-meetups/l10n/ja.json +151 -12
  154. package/templates/events-meetups/l10n/ko.json +151 -12
  155. package/templates/events-meetups/l10n/lt.json +151 -12
  156. package/templates/events-meetups/l10n/nl.json +151 -12
  157. package/templates/events-meetups/l10n/no.json +151 -12
  158. package/templates/events-meetups/l10n/pl.json +151 -12
  159. package/templates/events-meetups/l10n/pt.json +151 -12
  160. package/templates/events-meetups/l10n/ru.json +151 -12
  161. package/templates/events-meetups/l10n/sv.json +151 -12
  162. package/templates/events-meetups/l10n/th.json +151 -12
  163. package/templates/events-meetups/l10n/tr.json +151 -12
  164. package/templates/events-meetups/l10n/uk.json +151 -12
  165. package/templates/events-meetups/l10n/vi.json +151 -12
  166. package/templates/events-meetups/l10n/zh.json +151 -12
  167. package/templates/events-meetups/tier5-src/_shared/about-text.ts +8 -0
  168. package/templates/events-meetups/tier5-src/_shared/detail-presence.ts +51 -0
  169. package/templates/events-meetups/tier5-src/_shared/owner-editor-value.ts +164 -0
  170. package/templates/events-meetups/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  171. package/templates/events-meetups/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  172. package/templates/events-meetups/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  173. package/templates/events-meetups/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  174. package/templates/events-meetups/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  175. package/templates/fitness-gym/tier5-src/_shared/about-text.ts +8 -0
  176. package/templates/fitness-gym/tier5-src/_shared/owner-editor-value.ts +164 -0
  177. package/templates/fitness-gym/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  178. package/templates/fitness-gym/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  179. package/templates/fitness-gym/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  180. package/templates/fitness-gym/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  181. package/templates/gym-fitness/config.ts +7 -0
  182. package/templates/gym-fitness/dev/index.ts +1568 -171
  183. package/templates/gym-fitness/himalaya.content.json +3 -0
  184. package/templates/gym-fitness/l10n/ar.json +150 -6
  185. package/templates/gym-fitness/l10n/cs.json +150 -6
  186. package/templates/gym-fitness/l10n/da.json +150 -6
  187. package/templates/gym-fitness/l10n/de.json +150 -6
  188. package/templates/gym-fitness/l10n/el.json +150 -6
  189. package/templates/gym-fitness/l10n/en.json +102 -9
  190. package/templates/gym-fitness/l10n/es.json +150 -6
  191. package/templates/gym-fitness/l10n/fi.json +150 -6
  192. package/templates/gym-fitness/l10n/fr.json +150 -6
  193. package/templates/gym-fitness/l10n/he.json +119 -5
  194. package/templates/gym-fitness/l10n/hu.json +150 -6
  195. package/templates/gym-fitness/l10n/id.json +150 -6
  196. package/templates/gym-fitness/l10n/it.json +150 -6
  197. package/templates/gym-fitness/l10n/ja.json +150 -6
  198. package/templates/gym-fitness/l10n/ko.json +150 -6
  199. package/templates/gym-fitness/l10n/lt.json +150 -6
  200. package/templates/gym-fitness/l10n/nl.json +150 -6
  201. package/templates/gym-fitness/l10n/no.json +150 -6
  202. package/templates/gym-fitness/l10n/pl.json +150 -6
  203. package/templates/gym-fitness/l10n/pt.json +150 -6
  204. package/templates/gym-fitness/l10n/ru.json +150 -6
  205. package/templates/gym-fitness/l10n/sv.json +150 -6
  206. package/templates/gym-fitness/l10n/th.json +150 -6
  207. package/templates/gym-fitness/l10n/tr.json +150 -6
  208. package/templates/gym-fitness/l10n/uk.json +150 -6
  209. package/templates/gym-fitness/l10n/vi.json +150 -6
  210. package/templates/gym-fitness/l10n/zh.json +150 -6
  211. package/templates/gym-fitness/tier5-src/_shared/about-text.ts +8 -0
  212. package/templates/gym-fitness/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  213. package/templates/gym-fitness/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  214. package/templates/gym-fitness/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  215. package/templates/gym-fitness/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  216. package/templates/gym-fitness/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  217. package/templates/medical-services/tier5-src/_shared/about-text.ts +8 -0
  218. package/templates/medical-services/tier5-src/_shared/detail-presence.ts +51 -0
  219. package/templates/medical-services/tier5-src/_shared/owner-editor-value.ts +164 -0
  220. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  221. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  222. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  223. package/templates/medical-services/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  224. package/templates/nonprofit-cause/config.ts +7 -0
  225. package/templates/nonprofit-cause/dev/index.ts +1816 -174
  226. package/templates/nonprofit-cause/himalaya.content.json +3 -0
  227. package/templates/nonprofit-cause/l10n/ar.json +151 -6
  228. package/templates/nonprofit-cause/l10n/cs.json +151 -6
  229. package/templates/nonprofit-cause/l10n/da.json +151 -6
  230. package/templates/nonprofit-cause/l10n/de.json +151 -6
  231. package/templates/nonprofit-cause/l10n/el.json +151 -6
  232. package/templates/nonprofit-cause/l10n/en.json +107 -9
  233. package/templates/nonprofit-cause/l10n/es.json +151 -6
  234. package/templates/nonprofit-cause/l10n/fi.json +151 -6
  235. package/templates/nonprofit-cause/l10n/fr.json +151 -6
  236. package/templates/nonprofit-cause/l10n/he.json +125 -5
  237. package/templates/nonprofit-cause/l10n/hu.json +151 -6
  238. package/templates/nonprofit-cause/l10n/id.json +151 -6
  239. package/templates/nonprofit-cause/l10n/it.json +151 -6
  240. package/templates/nonprofit-cause/l10n/ja.json +151 -6
  241. package/templates/nonprofit-cause/l10n/ko.json +151 -6
  242. package/templates/nonprofit-cause/l10n/lt.json +151 -6
  243. package/templates/nonprofit-cause/l10n/nl.json +151 -6
  244. package/templates/nonprofit-cause/l10n/no.json +151 -6
  245. package/templates/nonprofit-cause/l10n/pl.json +151 -6
  246. package/templates/nonprofit-cause/l10n/pt.json +151 -6
  247. package/templates/nonprofit-cause/l10n/ru.json +151 -6
  248. package/templates/nonprofit-cause/l10n/sv.json +151 -6
  249. package/templates/nonprofit-cause/l10n/th.json +151 -6
  250. package/templates/nonprofit-cause/l10n/tr.json +151 -6
  251. package/templates/nonprofit-cause/l10n/uk.json +151 -6
  252. package/templates/nonprofit-cause/l10n/vi.json +151 -6
  253. package/templates/nonprofit-cause/l10n/zh.json +151 -6
  254. package/templates/nonprofit-cause/tier5-src/_shared/about-text.ts +8 -0
  255. package/templates/nonprofit-cause/tier5-src/_shared/owner-editor-value.ts +164 -0
  256. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  257. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  258. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  259. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  260. package/templates/nonprofit-cause/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  261. package/templates/personal-fitness-trainer/dev/index.ts +641 -75
  262. package/templates/personal-fitness-trainer/tier5-src/_shared/about-text.ts +8 -0
  263. package/templates/personal-fitness-trainer/tier5-src/_shared/group-member-count.ts +15 -0
  264. package/templates/personal-fitness-trainer/tier5-src/_shared/himi-media.ts +33 -0
  265. package/templates/personal-fitness-trainer/tier5-src/_shared/owner-editor-value.ts +164 -0
  266. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  267. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  268. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  269. package/templates/personal-fitness-trainer/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  270. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  271. package/templates/personal-fitness-trainer/tokens.json +6 -0
  272. package/templates/podcast-creator/config.ts +7 -0
  273. package/templates/podcast-creator/dev/index.ts +1571 -174
  274. package/templates/podcast-creator/himalaya.content.json +3 -0
  275. package/templates/podcast-creator/l10n/ar.json +145 -6
  276. package/templates/podcast-creator/l10n/cs.json +145 -6
  277. package/templates/podcast-creator/l10n/da.json +145 -6
  278. package/templates/podcast-creator/l10n/de.json +145 -6
  279. package/templates/podcast-creator/l10n/el.json +145 -6
  280. package/templates/podcast-creator/l10n/en.json +102 -9
  281. package/templates/podcast-creator/l10n/es.json +145 -6
  282. package/templates/podcast-creator/l10n/fi.json +145 -6
  283. package/templates/podcast-creator/l10n/fr.json +145 -6
  284. package/templates/podcast-creator/l10n/he.json +119 -5
  285. package/templates/podcast-creator/l10n/hu.json +145 -6
  286. package/templates/podcast-creator/l10n/id.json +145 -6
  287. package/templates/podcast-creator/l10n/it.json +145 -6
  288. package/templates/podcast-creator/l10n/ja.json +145 -6
  289. package/templates/podcast-creator/l10n/ko.json +145 -6
  290. package/templates/podcast-creator/l10n/lt.json +145 -6
  291. package/templates/podcast-creator/l10n/nl.json +145 -6
  292. package/templates/podcast-creator/l10n/no.json +145 -6
  293. package/templates/podcast-creator/l10n/pl.json +145 -6
  294. package/templates/podcast-creator/l10n/pt.json +145 -6
  295. package/templates/podcast-creator/l10n/ru.json +145 -6
  296. package/templates/podcast-creator/l10n/sv.json +145 -6
  297. package/templates/podcast-creator/l10n/th.json +145 -6
  298. package/templates/podcast-creator/l10n/tr.json +145 -6
  299. package/templates/podcast-creator/l10n/uk.json +145 -6
  300. package/templates/podcast-creator/l10n/vi.json +145 -6
  301. package/templates/podcast-creator/l10n/zh.json +145 -6
  302. package/templates/podcast-creator/tier5-src/_shared/about-text.ts +8 -0
  303. package/templates/podcast-creator/tier5-src/_shared/owner-editor-value.ts +164 -0
  304. package/templates/podcast-creator/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  305. package/templates/podcast-creator/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  306. package/templates/podcast-creator/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  307. package/templates/podcast-creator/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  308. package/templates/podcast-creator/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  309. package/templates/portfolio-creative/config.ts +7 -0
  310. package/templates/portfolio-creative/dev/index.ts +1571 -174
  311. package/templates/portfolio-creative/himalaya.content.json +3 -0
  312. package/templates/portfolio-creative/l10n/ar.json +150 -12
  313. package/templates/portfolio-creative/l10n/cs.json +150 -12
  314. package/templates/portfolio-creative/l10n/da.json +150 -12
  315. package/templates/portfolio-creative/l10n/de.json +150 -12
  316. package/templates/portfolio-creative/l10n/el.json +150 -12
  317. package/templates/portfolio-creative/l10n/en.json +102 -15
  318. package/templates/portfolio-creative/l10n/es.json +150 -12
  319. package/templates/portfolio-creative/l10n/fi.json +150 -12
  320. package/templates/portfolio-creative/l10n/fr.json +150 -12
  321. package/templates/portfolio-creative/l10n/he.json +119 -10
  322. package/templates/portfolio-creative/l10n/hu.json +150 -12
  323. package/templates/portfolio-creative/l10n/id.json +150 -12
  324. package/templates/portfolio-creative/l10n/it.json +150 -12
  325. package/templates/portfolio-creative/l10n/ja.json +150 -12
  326. package/templates/portfolio-creative/l10n/ko.json +150 -12
  327. package/templates/portfolio-creative/l10n/lt.json +150 -12
  328. package/templates/portfolio-creative/l10n/nl.json +150 -12
  329. package/templates/portfolio-creative/l10n/no.json +150 -12
  330. package/templates/portfolio-creative/l10n/pl.json +150 -12
  331. package/templates/portfolio-creative/l10n/pt.json +150 -12
  332. package/templates/portfolio-creative/l10n/ru.json +150 -12
  333. package/templates/portfolio-creative/l10n/sv.json +150 -12
  334. package/templates/portfolio-creative/l10n/th.json +150 -12
  335. package/templates/portfolio-creative/l10n/tr.json +150 -12
  336. package/templates/portfolio-creative/l10n/uk.json +150 -12
  337. package/templates/portfolio-creative/l10n/vi.json +150 -12
  338. package/templates/portfolio-creative/l10n/zh.json +150 -12
  339. package/templates/portfolio-creative/tier5-src/_shared/about-text.ts +8 -0
  340. package/templates/portfolio-creative/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  341. package/templates/portfolio-creative/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  342. package/templates/portfolio-creative/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  343. package/templates/portfolio-creative/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  344. package/templates/portfolio-creative/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  345. package/templates/professional-services/tier5-src/_shared/about-text.ts +8 -0
  346. package/templates/professional-services/tier5-src/_shared/owner-editor-value.ts +164 -0
  347. package/templates/professional-services/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  348. package/templates/professional-services/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  349. package/templates/professional-services/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  350. package/templates/professional-services/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  351. package/templates/restaurant/config.ts +7 -0
  352. package/templates/restaurant/dev/index.ts +1571 -174
  353. package/templates/restaurant/himalaya.content.json +3 -0
  354. package/templates/restaurant/l10n/ar.json +145 -6
  355. package/templates/restaurant/l10n/cs.json +145 -6
  356. package/templates/restaurant/l10n/da.json +145 -6
  357. package/templates/restaurant/l10n/de.json +145 -6
  358. package/templates/restaurant/l10n/el.json +145 -6
  359. package/templates/restaurant/l10n/en.json +102 -9
  360. package/templates/restaurant/l10n/es.json +145 -6
  361. package/templates/restaurant/l10n/fi.json +145 -6
  362. package/templates/restaurant/l10n/fr.json +145 -6
  363. package/templates/restaurant/l10n/he.json +119 -5
  364. package/templates/restaurant/l10n/hu.json +145 -6
  365. package/templates/restaurant/l10n/id.json +145 -6
  366. package/templates/restaurant/l10n/it.json +145 -6
  367. package/templates/restaurant/l10n/ja.json +145 -6
  368. package/templates/restaurant/l10n/ko.json +145 -6
  369. package/templates/restaurant/l10n/lt.json +145 -6
  370. package/templates/restaurant/l10n/nl.json +145 -6
  371. package/templates/restaurant/l10n/no.json +145 -6
  372. package/templates/restaurant/l10n/pl.json +145 -6
  373. package/templates/restaurant/l10n/pt.json +145 -6
  374. package/templates/restaurant/l10n/ru.json +145 -6
  375. package/templates/restaurant/l10n/sv.json +145 -6
  376. package/templates/restaurant/l10n/th.json +145 -6
  377. package/templates/restaurant/l10n/tr.json +145 -6
  378. package/templates/restaurant/l10n/uk.json +145 -6
  379. package/templates/restaurant/l10n/vi.json +145 -6
  380. package/templates/restaurant/l10n/zh.json +145 -6
  381. package/templates/restaurant/tier5-src/_shared/about-text.ts +8 -0
  382. package/templates/restaurant/tier5-src/_shared/owner-editor-value.ts +164 -0
  383. package/templates/restaurant/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  384. package/templates/restaurant/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  385. package/templates/restaurant/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  386. package/templates/restaurant/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  387. package/templates/restaurant/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  388. package/templates/retail-store/config.ts +7 -0
  389. package/templates/retail-store/dev/index.ts +1572 -175
  390. package/templates/retail-store/himalaya.content.json +3 -0
  391. package/templates/retail-store/l10n/ar.json +150 -12
  392. package/templates/retail-store/l10n/cs.json +150 -12
  393. package/templates/retail-store/l10n/da.json +150 -12
  394. package/templates/retail-store/l10n/de.json +150 -12
  395. package/templates/retail-store/l10n/el.json +150 -12
  396. package/templates/retail-store/l10n/en.json +102 -15
  397. package/templates/retail-store/l10n/es.json +150 -12
  398. package/templates/retail-store/l10n/fi.json +150 -12
  399. package/templates/retail-store/l10n/fr.json +150 -12
  400. package/templates/retail-store/l10n/he.json +119 -10
  401. package/templates/retail-store/l10n/hu.json +150 -12
  402. package/templates/retail-store/l10n/id.json +150 -12
  403. package/templates/retail-store/l10n/it.json +150 -12
  404. package/templates/retail-store/l10n/ja.json +150 -12
  405. package/templates/retail-store/l10n/ko.json +150 -12
  406. package/templates/retail-store/l10n/lt.json +150 -12
  407. package/templates/retail-store/l10n/nl.json +150 -12
  408. package/templates/retail-store/l10n/no.json +150 -12
  409. package/templates/retail-store/l10n/pl.json +150 -12
  410. package/templates/retail-store/l10n/pt.json +150 -12
  411. package/templates/retail-store/l10n/ru.json +150 -12
  412. package/templates/retail-store/l10n/sv.json +150 -12
  413. package/templates/retail-store/l10n/th.json +150 -12
  414. package/templates/retail-store/l10n/tr.json +150 -12
  415. package/templates/retail-store/l10n/uk.json +150 -12
  416. package/templates/retail-store/l10n/vi.json +150 -12
  417. package/templates/retail-store/l10n/zh.json +150 -12
  418. package/templates/retail-store/tier5-src/_shared/about-text.ts +8 -0
  419. package/templates/retail-store/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  420. package/templates/retail-store/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  421. package/templates/retail-store/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  422. package/templates/retail-store/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  423. package/templates/retail-store/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  424. package/templates/salon-spa/tier5-src/_shared/about-text.ts +8 -0
  425. package/templates/salon-spa/tier5-src/_shared/owner-editor-value.ts +164 -0
  426. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  427. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  428. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  429. package/templates/salon-spa/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  430. package/templates/wholesale-store/tier5-src/_shared/about-text.ts +8 -0
  431. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  432. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  433. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  434. package/templates/wholesale-store/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  435. package/templates/yoga-studio/config.ts +7 -0
  436. package/templates/yoga-studio/dev/index.ts +1567 -170
  437. package/templates/yoga-studio/himalaya.content.json +3 -0
  438. package/templates/yoga-studio/l10n/ar.json +145 -6
  439. package/templates/yoga-studio/l10n/cs.json +145 -6
  440. package/templates/yoga-studio/l10n/da.json +145 -6
  441. package/templates/yoga-studio/l10n/de.json +145 -6
  442. package/templates/yoga-studio/l10n/el.json +145 -6
  443. package/templates/yoga-studio/l10n/en.json +102 -9
  444. package/templates/yoga-studio/l10n/es.json +145 -6
  445. package/templates/yoga-studio/l10n/fi.json +145 -6
  446. package/templates/yoga-studio/l10n/fr.json +145 -6
  447. package/templates/yoga-studio/l10n/he.json +119 -5
  448. package/templates/yoga-studio/l10n/hu.json +145 -6
  449. package/templates/yoga-studio/l10n/id.json +145 -6
  450. package/templates/yoga-studio/l10n/it.json +145 -6
  451. package/templates/yoga-studio/l10n/ja.json +145 -6
  452. package/templates/yoga-studio/l10n/ko.json +145 -6
  453. package/templates/yoga-studio/l10n/lt.json +145 -6
  454. package/templates/yoga-studio/l10n/nl.json +145 -6
  455. package/templates/yoga-studio/l10n/no.json +145 -6
  456. package/templates/yoga-studio/l10n/pl.json +145 -6
  457. package/templates/yoga-studio/l10n/pt.json +145 -6
  458. package/templates/yoga-studio/l10n/ru.json +145 -6
  459. package/templates/yoga-studio/l10n/sv.json +145 -6
  460. package/templates/yoga-studio/l10n/th.json +145 -6
  461. package/templates/yoga-studio/l10n/tr.json +145 -6
  462. package/templates/yoga-studio/l10n/uk.json +145 -6
  463. package/templates/yoga-studio/l10n/vi.json +145 -6
  464. package/templates/yoga-studio/l10n/zh.json +145 -6
  465. package/templates/yoga-studio/tier5-src/_shared/about-text.ts +8 -0
  466. package/templates/yoga-studio/tier5-src/_shared/owner-editor-value.ts +164 -0
  467. package/templates/yoga-studio/tier5-src/himi-branded-lite-account-settings/about.ts +134 -0
  468. package/templates/yoga-studio/tier5-src/himi-branded-lite-account-settings/index.ts +3 -1
  469. package/templates/yoga-studio/tier5-src/himi-branded-lite-account-settings/personal-info.ts +44 -5
  470. package/templates/yoga-studio/tier5-src/himi-branded-lite-account-settings/shared.ts +21 -1
  471. package/templates/yoga-studio/tier5-src/wix-spaces-member-detail/index.ts +769 -0
  472. package/templates/beauty-salon/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  473. package/templates/branded-lite/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  474. package/templates/community-club/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  475. package/templates/events-meetups/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  476. package/templates/gym-fitness/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  477. package/templates/nonprofit-cause/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  478. package/templates/personal-fitness-trainer/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  479. package/templates/podcast-creator/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  480. package/templates/portfolio-creative/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  481. package/templates/restaurant/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  482. package/templates/retail-store/tier5-src/wix-spaces-view-profile/index.ts +0 -119
  483. package/templates/yoga-studio/tier5-src/wix-spaces-view-profile/index.ts +0 -119
@@ -8,7 +8,7 @@
8
8
  // failure is split by field so the error lands under the field Wix rejected. A full success closes
9
9
  // the modal with a snackbar; a field error keeps it open; a server error shows a banner and keeps
10
10
  // every change.
11
- import { defineService } from "@himalaya/state";
11
+ import { defineService, navigate } from "@himalaya/state";
12
12
  import { snackbar } from "@himalaya/ui";
13
13
  import { deleteMemberPhones, getMyMember, listCustomFields, updateMember } from "@himalaya/wix-members";
14
14
  import { generateMemberPhotoUploadUrl } from "@himalaya/wix-site-media";
@@ -16,8 +16,8 @@ import { memberAccess } from "../_shared/member-access.js";
16
16
  import { MEMBER_PHOTO_UPLOAD_TARGET, isMemberPhotoUploadTarget, memberAccountRoutes } from "../_shared/member-account-routes.js";
17
17
  import { copyParam, stashCopy } from "../_shared/himi-copy.js";
18
18
  import {
19
- clean, currentMemberRecordMatches, fetchMember, isSignedOut, loadErrorVariant, memberInitials, rawText,
20
- signedOutError, type WixMemberRecord, type WixMemberResponse,
19
+ aboutPreviewText, clean, currentMemberRecordMatches, fetchMember, isSignedOut, loadErrorVariant, memberInitials, rawText,
20
+ readMyAbout, sameAccess, signedOutError, type WixMemberRecord, type WixMemberResponse,
21
21
  } from "./shared.js";
22
22
 
23
23
  type SiteFieldType = "TEXT" | "NUMBER" | "DATE" | "URL";
@@ -101,6 +101,11 @@ interface S extends ProfileValues {
101
101
  /** There is a photo (saved or just picked) that Remove photo would clear. */
102
102
  canRemovePhoto: boolean;
103
103
  noRemovePhoto: boolean;
104
+ /** The About me field: the start of the member's About as plain text ("" for none — the field
105
+ * then shows its placeholder). The text itself is edited in the About me sheet, not here. */
106
+ aboutPreview: string;
107
+ noAboutPreview: boolean;
108
+ hasAboutPreview: boolean;
104
109
  }
105
110
 
106
111
  const BLANK: ProfileValues = { displayName: "", title: "", firstName: "", lastName: "", phone: "", memberImage: "", memberImageId: "", memberInitials: "M", custom: {} };
@@ -148,6 +153,9 @@ const EMPTY: S = {
148
153
  photoRemoved: false,
149
154
  canRemovePhoto: false,
150
155
  noRemovePhoto: true,
156
+ aboutPreview: "",
157
+ noAboutPreview: true,
158
+ hasAboutPreview: false,
151
159
  };
152
160
 
153
161
  // ---- The site's field list ----
@@ -527,6 +535,17 @@ function loaded(member: WixMemberRecord, email: string, scope: string, siteField
527
535
  });
528
536
  }
529
537
 
538
+ /** The About me field's preview fields. A failed About read shows the placeholder: the sheet itself says
539
+ * why it cannot load, and this field is only a door to it. */
540
+ async function aboutPreviewFields(): Promise<Pick<S, "aboutPreview" | "noAboutPreview" | "hasAboutPreview">> {
541
+ const aboutPreview = aboutPreviewText(await readMyAbout().catch(() => null));
542
+ return { aboutPreview, noAboutPreview: !aboutPreview, hasAboutPreview: !!aboutPreview };
543
+ }
544
+
545
+ /** Set when the About me field opens its sheet over this modal. The next appear is the way back from
546
+ * that sheet, so it keeps the member's unsaved draft and refreshes only the About preview. */
547
+ let openingAbout = false;
548
+
530
549
  function loadFailed(error: unknown): S {
531
550
  return derive({ ...EMPTY, phase: isSignedOut(error) ? "signedOut" : "error", errorVariant: loadErrorVariant(error) });
532
551
  }
@@ -555,6 +574,7 @@ const svc = defineService<S, {
555
574
  save: (s: S) => Promise<Result | undefined>;
556
575
  showLoading: (s: S) => S;
557
576
  begin: (s: S, patch: Partial<S>) => S;
577
+ openAbout: (s: S) => S;
558
578
  }>("himiBrandedAccountPersonal", {
559
579
  state: { ...EMPTY },
560
580
  // Every value is per visit: a reopened modal starts from the member's record, never a draft.
@@ -564,16 +584,35 @@ const svc = defineService<S, {
564
584
  // Internal: publish a state while an action awaits (the skeleton on reload, the Save spinner).
565
585
  showLoading: () => derive({ ...EMPTY }),
566
586
  begin: (s, patch) => derive({ ...s, ...patch }),
587
+ // The About me field: the About text has its own sheet (the REC editor saves only through its own Form).
588
+ openAbout: (s) => {
589
+ openingAbout = s.phase === "ready";
590
+ return navigate(s, { screenId: "himi_account_about", presentation: "sheet", args: { sheetStyle: "page" } });
591
+ },
567
592
  // Every appear starts over: the shell's Discard closes the modal without telling the worker,
568
593
  // and a pooled worker comes back with the draft it had.
569
594
  load: async (_s, arg): Promise<S> => {
570
595
  const version = ++loadVersion;
596
+ const returningFromAbout = openingAbout;
597
+ openingAbout = false;
598
+ // Back from the About me sheet with unsaved edits here: keep them; only the About preview is new.
599
+ // (Without edits a full reload loses nothing, and also picks up a change made elsewhere.)
600
+ // Only for the same member: one who changed while the sheet was open gets the full load, not the old draft.
601
+ // A record check that cannot run (offline) falls back to the session's email and scope: only a confirmed
602
+ // change drops the draft.
603
+ const current = svc.getState();
604
+ const sameMember = () => currentMemberRecordMatches(current.memberEmail, current.memberScope, current.memberId)
605
+ .catch(() => sameAccess(current.memberEmail, current.memberScope).catch(() => false));
606
+ if (returningFromAbout && current.phase === "ready" && current.dirty && await sameMember()) {
607
+ const preview = await aboutPreviewFields();
608
+ return version === loadVersion ? derive({ ...svc.getState(), ...preview }) : svc.getState() as S;
609
+ }
571
610
  photoUploadVersion += 1;
572
611
  stashCopy(arg);
573
612
  if (svc.getState().phase !== "loading") await svc.showLoading();
574
613
  try {
575
614
  const { email, scope, member } = await fetchMember();
576
- const [routes, site] = await Promise.all([memberAccountRoutes(), readSiteFields()]);
615
+ const [routes, site, preview] = await Promise.all([memberAccountRoutes(), readSiteFields(), aboutPreviewFields()]);
577
616
  if (version !== loadVersion) return svc.getState() as S;
578
617
  if (!(await currentMemberRecordMatches(email, scope, clean(member.id)))) throw signedOutError();
579
618
  if (version !== loadVersion) return svc.getState() as S;
@@ -582,7 +621,7 @@ const svc = defineService<S, {
582
621
  // to the app's member-photo route as the member does the upload, with no site code: migrated apps have none.
583
622
  const viaRoute = !functionName && routes.memberPhotoRoute;
584
623
  const available = (!!functionName && routes.mediaField) || viaRoute;
585
- return derive({ ...loaded(member, email, scope, site.fields, site.hasPhone), photoUploadFunctionName: functionName, photoUploadViaRoute: viaRoute, photoUploadAvailable: available });
624
+ return derive({ ...loaded(member, email, scope, site.fields, site.hasPhone), ...preview, photoUploadFunctionName: functionName, photoUploadViaRoute: viaRoute, photoUploadAvailable: available });
586
625
  } catch (error) {
587
626
  if (version !== loadVersion) return svc.getState() as S;
588
627
  return loadFailed(error);
@@ -3,9 +3,11 @@
3
3
  // own worker and loads the member itself: nothing here is shared state, only the checks.
4
4
  import { dispatch } from "@himalaya/dispatch";
5
5
  import { classifyLoadError } from "@himalaya/state";
6
- import { getMyMember } from "@himalaya/wix-members";
6
+ import { getMyMember, getMyMemberAbout } from "@himalaya/wix-members";
7
7
  import { getMyData } from "@himalaya/wix-users";
8
+ import { aboutPlainText } from "../_shared/about-text.js";
8
9
  import { hostSiteFromInput } from "../_shared/branded-lite-hosted.js";
10
+ import { isNotFoundError } from "../_shared/detail-presence.js";
9
11
  import { memberAccess } from "../_shared/member-access.js";
10
12
  import type { MemberAccountRoutes } from "../_shared/member-account-routes.js";
11
13
 
@@ -93,6 +95,24 @@ export async function memberIdentityState(): Promise<"member" | "guest" | "unava
93
95
  }
94
96
  }
95
97
 
98
+ export interface MyAbout { id: string; revision: string; memberId: string; content: Record<string, unknown> }
99
+
100
+ /** The signed-in member's own "About", or null when they never wrote one (Wix answers NOT_FOUND). */
101
+ export async function readMyAbout(): Promise<MyAbout | null> {
102
+ try {
103
+ const about = (await getMyMemberAbout()).memberAbout;
104
+ return about?.id ? { id: about.id, revision: clean(about.revision), memberId: clean(about.memberId), content: about.content ?? {} } : null;
105
+ } catch (error) {
106
+ if (isNotFoundError(error)) return null;
107
+ throw error;
108
+ }
109
+ }
110
+
111
+ /** The About as plain text, one line per non-empty block, for a short preview. "" for no text. */
112
+ export function aboutPreviewText(about: MyAbout | null): string {
113
+ return about ? aboutPlainText(about.content) : "";
114
+ }
115
+
96
116
  /** Same identity by email and scope alone (no network). */
97
117
  export async function sameAccess(email: string, scope: string): Promise<boolean> {
98
118
  const current = await memberAccess();
@@ -5,11 +5,17 @@
5
5
  // The Follow control reflects the live relationship (getFollowCounts + isFollowingMember, each read
6
6
  // defensively, so a 403 never blanks the screen); toggleFollow writes through the real Members v3
7
7
  // MemberFollowers API. A visitor never writes: Follow opens sign-in (the descriptor routes it).
8
+ //
9
+ // `self: "1"` (himi_view_profile) shows the SIGNED-IN member's own profile instead: the id comes from
10
+ // getMyMember, never from input; a private profile is still shown (it is the reader's own); a visitor
11
+ // gets the Sign in state and makes no member read. Self mode also reads the member's groups and gives
12
+ // the About section its own states (content / empty / failed) and a 5-line collapsed form.
8
13
  import { classifyLoadError, defineService } from "@himalaya/state";
9
14
  import { share as shareSheet } from "@himalaya/share";
10
15
  import { snackbar as showSnackbar } from "@himalaya/ui";
11
16
  import {
12
17
  getMember,
18
+ getMyMember,
13
19
  followMember,
14
20
  unfollowMember,
15
21
  getFollowCounts,
@@ -20,26 +26,41 @@ import {
20
26
  import { query as queryBadges, queryBadgeAssignments } from "@himalaya/wix-badges";
21
27
  import { queryPosts as queryBlogPosts, type WixPost as WixBlogPost } from "@himalaya/wix-blog";
22
28
  import { queryPosts as queryForumPosts, type WixPost as WixForumPost } from "@himalaya/wix-forum";
29
+ import { getGroup, listMemberships, type WixGroup, type WixGroupMembership } from "@himalaya/wix-groups";
30
+ import { aboutPlainText } from "../_shared/about-text.js";
23
31
  import { wixMediaUrl } from "@himalaya/wix-media";
24
32
  import { formatDateMedium, formatMonthYear } from "../_shared/engine-intl.js";
25
33
  import { appLocale } from "../_shared/app-locale.js";
26
34
  import { copyParam, copyTemplate, stashCopy } from "../_shared/himi-copy.js";
27
35
  import { presence, presenceAfterError, detailInputId, isNotFoundError, type PresenceFlags } from "../_shared/detail-presence.js";
36
+ import { groupMemberCount } from "../_shared/group-member-count.js";
37
+ import { groupImage } from "../_shared/himi-media.js";
28
38
 
29
- import { readAccess, assertReadAccess, readAccessDenied, readSignInFlags, NO_READ_SIGN_IN, type ReadAccess } from "../_shared/member-read.js";
30
- import { memberAccess } from "../_shared/member-access.js";
39
+ import { readAccess, readAccessDenied, readSignInFlags, signInError, NO_READ_SIGN_IN, type ReadAccess } from "../_shared/member-read.js";
40
+ import { memberAccess, memberAccessChanged } from "../_shared/member-access.js";
31
41
 
32
42
  const POST_LIMIT = 3;
43
+ const GROUP_LIMIT = 10;
44
+ const MEMBERSHIP_PAGE_LIMIT = 50;
33
45
  // The descriptor's 64pt square preview at up to 3x density.
34
46
  const POST_THUMB_IMAGE = { width: 192, height: 192 };
47
+ /** The collapsed About holds 5 lines; a longer text gets Show more. Approximated from the text, because a
48
+ * worker cannot measure: about 45 characters per line at the phone's footnote size. */
49
+ const ABOUT_LINES = 5;
50
+ const ABOUT_CHARS_PER_LINE = 45;
35
51
 
36
52
  interface PostRow {
37
53
  id: string;
38
54
  title: string;
39
55
  meta: string;
40
56
  thumb: string;
57
+ /** No preview image: the row hides its thumbnail slot instead of an empty box. */
58
+ noThumb: boolean;
41
59
  }
42
60
  interface BadgeRow { id: string; title: string }
61
+ interface GroupRow { id: string; title: string; meta: string; image: string; initial: string; noImage: boolean; hasImage: boolean }
62
+ /** The self-mode About section: not read yet, read with text, read with no text, or the read failed. */
63
+ type AboutPhase = "pending" | "content" | "empty" | "failed";
43
64
 
44
65
  interface S extends PresenceFlags {
45
66
  signInRequired: boolean; noSignIn: boolean;
@@ -92,6 +113,34 @@ interface S extends PresenceFlags {
92
113
  /** The retryable ErrorState: hidden unless the load failed for a reason other than sign-in. */
93
114
  hideError: boolean;
94
115
  unfollowTitle: string;
116
+ // ── Self mode (himi_view_profile) ──
117
+ /** The member's profile title ("Yoga teacher"); hidden when empty. */
118
+ title: string;
119
+ hideTitle: boolean;
120
+ /** The two counts as separate numbers for the hero's Following | Followers row; the row hides when both are unknown. */
121
+ followersNumber: string;
122
+ followingNumber: string;
123
+ hideCountRow: boolean;
124
+ hideFollowersNumber: boolean;
125
+ hideFollowingNumber: boolean;
126
+ /** The rule between the two counts: only when both are known (Wix can answer one direction only). */
127
+ hideCountDivider: boolean;
128
+ aboutPhase: AboutPhase;
129
+ /** The About as plain text, for the collapsed 5-line form. */
130
+ aboutPlain: string;
131
+ aboutLong: boolean;
132
+ aboutExpanded: boolean;
133
+ /** About section gates: the whole section, the full rich text, the collapsed text, Show more / Show less, empty, failed. */
134
+ hideAboutSection: boolean;
135
+ hideAboutRich: boolean;
136
+ hideAboutCollapsed: boolean;
137
+ hideAboutMore: boolean;
138
+ hideAboutLess: boolean;
139
+ hideAboutEmpty: boolean;
140
+ hideAboutFailed: boolean;
141
+ hasGroups: boolean;
142
+ groups: GroupRow[];
143
+ hideGroups: boolean;
95
144
  }
96
145
 
97
146
  function name(m: WixMember): string {
@@ -117,6 +166,11 @@ function hasAboutContent(nodes: unknown[]): boolean {
117
166
  return Array.isArray(node.nodes) && hasAboutContent(node.nodes);
118
167
  });
119
168
  }
169
+ /** More than ABOUT_LINES lines at the phone's width: each paragraph takes at least one line. */
170
+ function aboutIsLong(plain: string): boolean {
171
+ const lines = plain.split("\n").reduce((sum, p) => sum + Math.max(1, Math.ceil(p.length / ABOUT_CHARS_PER_LINE)), 0);
172
+ return lines > ABOUT_LINES;
173
+ }
120
174
  /** "Jul 2026" from the member's createdDate; "" when the date is missing or unreadable. */
121
175
  function joinedFor(createdDate: string | undefined): string {
122
176
  if (!createdDate) return "";
@@ -145,6 +199,30 @@ function derive(s: S): S {
145
199
  noSnackbar: !s.snackbarMessage,
146
200
  followCount,
147
201
  followLabel: s.isFollowing ? "Following ✓" : "Follow",
202
+ ...selfFlags(s),
203
+ };
204
+ }
205
+ /** The self-mode flags. Each About form is shown by exactly one phase, so loading, content, empty and
206
+ * failed never paint together; Show more / Show less follow the collapsed / expanded form. */
207
+ function selfFlags(s: S): Partial<S> {
208
+ const content = s.aboutPhase === "content";
209
+ const collapsed = content && s.aboutLong && !s.aboutExpanded;
210
+ return {
211
+ hideTitle: !s.title,
212
+ followersNumber: s.followers === null ? "" : String(s.followers),
213
+ followingNumber: s.following === null ? "" : String(s.following),
214
+ hideCountRow: s.followers === null && s.following === null,
215
+ hideFollowersNumber: s.followers === null,
216
+ hideFollowingNumber: s.following === null,
217
+ hideCountDivider: s.followers === null || s.following === null,
218
+ hideAboutSection: s.aboutPhase === "pending",
219
+ hideAboutRich: !content || collapsed,
220
+ hideAboutCollapsed: !collapsed,
221
+ hideAboutMore: !collapsed,
222
+ hideAboutLess: !(content && s.aboutLong && s.aboutExpanded),
223
+ hideAboutEmpty: s.aboutPhase !== "empty",
224
+ hideAboutFailed: s.aboutPhase !== "failed",
225
+ hideGroups: !s.hasGroups,
148
226
  };
149
227
  }
150
228
  function postMeta(date: string | undefined, minutes: number | undefined): string {
@@ -153,13 +231,16 @@ function postMeta(date: string | undefined, minutes: number | undefined): string
153
231
  if (minutes) bits.push(copyTemplate("member.readTime", "{minutes} min read", { minutes }));
154
232
  return bits.join(" · ");
155
233
  }
234
+ function postRow(id: string, title: string | undefined, meta: string, thumb: string): PostRow {
235
+ return { id, title: title || "", meta, thumb, noThumb: !thumb };
236
+ }
156
237
  function blogRow(p: WixBlogPost): PostRow {
157
238
  const m = p.media;
158
- return { id: p.id, title: p.title || "", meta: postMeta(p.firstPublishedDate, p.minutesToRead), thumb: wixMediaUrl(m?.wixMedia?.image?.url, POST_THUMB_IMAGE) || wixMediaUrl(m?.embedMedia?.thumbnail?.url, POST_THUMB_IMAGE) };
239
+ return postRow(p.id, p.title, postMeta(p.firstPublishedDate, p.minutesToRead), wixMediaUrl(m?.wixMedia?.image?.url, POST_THUMB_IMAGE) || wixMediaUrl(m?.embedMedia?.thumbnail?.url, POST_THUMB_IMAGE));
159
240
  }
160
241
  function forumRow(p: WixForumPost): PostRow {
161
242
  const first = (p.images ?? [])[0] as { url?: string } | string | undefined;
162
- return { id: p.id, title: p.title || "", meta: postMeta(p.createdDate, undefined), thumb: wixMediaUrl(typeof first === "string" ? first : first?.url, POST_THUMB_IMAGE) };
243
+ return postRow(p.id, p.title, postMeta(p.createdDate, undefined), wixMediaUrl(typeof first === "string" ? first : first?.url, POST_THUMB_IMAGE));
163
244
  }
164
245
 
165
246
  const INITIAL: S = derive({
@@ -203,21 +284,67 @@ const INITIAL: S = derive({
203
284
  hideMemberActions: true,
204
285
  hideError: true,
205
286
  unfollowTitle: "",
287
+ title: "",
288
+ hideTitle: true,
289
+ followersNumber: "",
290
+ followingNumber: "",
291
+ hideCountRow: true,
292
+ hideFollowersNumber: true,
293
+ hideFollowingNumber: true,
294
+ hideCountDivider: true,
295
+ aboutPhase: "pending",
296
+ aboutPlain: "",
297
+ aboutLong: false,
298
+ aboutExpanded: false,
299
+ hideAboutSection: true,
300
+ hideAboutRich: true,
301
+ hideAboutCollapsed: true,
302
+ hideAboutMore: true,
303
+ hideAboutLess: true,
304
+ hideAboutEmpty: true,
305
+ hideAboutFailed: true,
306
+ hasGroups: false,
307
+ groups: [],
308
+ hideGroups: true,
206
309
  ...presence("loading"), ...NO_READ_SIGN_IN,
207
310
  });
208
311
  let loadVersion = 0;
209
312
  let followRevision = 0;
210
313
  let loadedAccess: ReadAccess | undefined;
211
314
  let cachedAccess: ReadAccess | undefined;
315
+ // The session bit counts too: self mode accepts a signed-in session whose email has not arrived, so email and
316
+ // scope alone ("" before and after) cannot tell that session from a sign-out.
212
317
  function sameAccess(a: ReadAccess | undefined, b: ReadAccess | undefined): boolean {
213
- return !!a && !!b && a.tenant === b.tenant && a.member.scope === b.member.scope && a.member.email === b.member.email;
318
+ return !!a && !!b && a.tenant === b.tenant && a.member.scope === b.member.scope && a.member.email === b.member.email
319
+ && a.member.signedIn === b.member.signedIn;
320
+ }
321
+ /** The shared read check with the session bit: one identity read, compared field by field by sameAccess. */
322
+ async function assertReadAccess(access: ReadAccess): Promise<void> {
323
+ if (!sameAccess(await readAccess(), access)) throw memberAccessChanged();
214
324
  }
215
325
  let siteUrlParam = "";
216
326
  let sectionsEnabled = false;
217
327
  let blogEnabled = false;
218
328
  let forumEnabled = false;
329
+ let groupsEnabled = false;
330
+ /** Badges show by default (a site's badges need no Badges screen); an app that drops the section turns the read off. */
331
+ let badgesEnabled = true;
332
+ /** Self mode: the signed-in member's own profile. `selfId` is that member's id, learned from getMyMember. */
333
+ let selfMode = false;
334
+ let selfId = "";
219
335
  const pendingFollows = new Set<string>();
220
336
 
337
+ /** The member this screen shows: the reader in self mode, else the id the host baked into the screen. */
338
+ function targetId(): string {
339
+ return selfMode ? selfId : detailInputId();
340
+ }
341
+ function groupRow(group: WixGroup, membership: WixGroupMembership): GroupRow {
342
+ const title = (group.name || copyParam("groups.groupFallbackName", "Group")).trim();
343
+ const count = group.membersCount ?? group.memberCount;
344
+ const image = groupImage(group);
345
+ return { id: String(membership.groupId), title, meta: typeof count === "number" ? groupMemberCount(count) : "", image, initial: (title[0] || "G").toUpperCase(), noImage: !image, hasImage: !!image };
346
+ }
347
+
221
348
  /** Use the shared classifier so programming errors are never called connectivity failures. */
222
349
  function errorVariantOf(e: unknown): string {
223
350
  return classifyLoadError(e) === "offline" ? "offline" : "server";
@@ -236,13 +363,19 @@ const svc = defineService<S, {
236
363
  applySections: (s: S) => S | undefined;
237
364
  setBusy: (s: S, busy: boolean) => S;
238
365
  syncBusy: (s: S) => S;
366
+ toggleAbout: (s: S) => S;
367
+ retryAbout: (s: S) => Promise<S | undefined>;
239
368
  }>("spacesMemberDetail", {
240
369
  state: INITIAL,
370
+ // Member data stays off the disk snapshot: self mode holds the signed-in member's own profile, private or not.
371
+ // Nothing is lost: `prepare` keeps a cached profile only for an access verified in this run (cachedAccess).
372
+ notPersisted: Object.keys(INITIAL) as (keyof S)[],
373
+ notHydrated: Object.keys(INITIAL) as (keyof S)[],
241
374
  actions: {
242
375
  // A revisit keeps the cached profile on screen: only the first load starts from the skeleton.
243
376
  prepare: (_s, context) => {
244
377
  const { access, cached } = context ?? {};
245
- const keep = cached?.found && cached.id === detailInputId() && sameAccess(cachedAccess, access);
378
+ const keep = cached?.found && cached.id === targetId() && sameAccess(cachedAccess, access);
246
379
  // Cached content becomes actionable again only after the same reader/site has been verified.
247
380
  loadedAccess = keep ? access : undefined;
248
381
  if (!keep) cachedAccess = undefined;
@@ -257,16 +390,20 @@ const svc = defineService<S, {
257
390
  sectionsEnabled = a.sections === "1" || a.sections === true;
258
391
  if (a.blog !== undefined) blogEnabled = a.blog === "1" || a.blog === true;
259
392
  if (a.forum !== undefined) forumEnabled = a.forum === "1" || a.forum === true;
393
+ if (a.groups !== undefined) groupsEnabled = a.groups === "1" || a.groups === true;
394
+ if (a.badges !== undefined) badgesEnabled = a.badges === "1" || a.badges === true;
395
+ selfMode = a.self === "1" || a.self === true;
260
396
  }
261
397
  const version = ++loadVersion;
262
- const id = detailInputId();
398
+ // Self mode learns the id from getMyMember below; until then it is the last reader's id (or "").
399
+ let id = targetId();
263
400
  // The bridge may be resolving a different reader even for the same profile ID.
264
401
  // Keep the cache private until identity is known; restore it before the network re-read
265
402
  // for the same reader, so pending member/relationship reads still allow cached actions.
266
403
  loadedAccess = undefined;
267
404
  await svc.resetToSkeleton();
268
405
  if (version !== loadVersion) return undefined;
269
- if (!id) return { ...INITIAL, status: "ready", noShare: true, ...presence("missing") };
406
+ if (!id && !selfMode) return { ...INITIAL, status: "ready", noShare: true, ...presence("missing") };
270
407
  let access: ReadAccess | undefined;
271
408
  let prior: S | undefined;
272
409
  try {
@@ -276,12 +413,27 @@ const svc = defineService<S, {
276
413
  const prepared = svc.getState();
277
414
  prior = prepared.found && prepared.id === id ? prepared : undefined;
278
415
  const followAtStart = followRevision;
279
- const res = await getMember(id);
280
- const m = ((res as unknown as { member?: WixMember }).member) ?? (res as unknown as WixMember);
416
+ let m: WixMember;
417
+ if (selfMode) {
418
+ // A visitor owns no profile: the Sign in state, and no member read at all. A session whose email has
419
+ // not arrived yet is still a member (as the Profile tab's session check counts it).
420
+ if (!access.member.signedIn) throw signInError();
421
+ const mine = await getMyMember({ fieldsets: ["FULL"] });
422
+ // A newer load (another member) may have started: this answer must not become the profile's id.
423
+ if (version !== loadVersion) return undefined;
424
+ m = ((mine as unknown as { member?: WixMember }).member) ?? (mine as unknown as WixMember);
425
+ if (!m?.id) throw new Error("The signed-in member could not be read.");
426
+ id = selfId = String(m.id);
427
+ if (prior && prior.id !== id) prior = undefined;
428
+ } else {
429
+ const res = await getMember(id);
430
+ m = ((res as unknown as { member?: WixMember }).member) ?? (res as unknown as WixMember);
431
+ }
281
432
  const n = name(m);
282
433
  // Anonymous public reads may omit status fields (UNKNOWN). Explicit refusals hide the profile.
434
+ // The reader's own profile is shown whatever its privacy: only its owner sees this screen.
283
435
  const known = (v: string | undefined): v is string => !!v && v !== "UNKNOWN";
284
- if ((known(m.privacyStatus) && m.privacyStatus !== "PUBLIC") || (known(m.status) && m.status !== "APPROVED")) {
436
+ if (!selfMode && ((known(m.privacyStatus) && m.privacyStatus !== "PUBLIC") || (known(m.status) && m.status !== "APPROVED"))) {
285
437
  await assertReadAccess(access);
286
438
  if (version !== loadVersion) return undefined;
287
439
  loadedAccess = undefined;
@@ -302,9 +454,11 @@ const svc = defineService<S, {
302
454
  } catch { /* unavailable counts stay hidden */ }
303
455
 
304
456
  let isFollowing = false;
305
- try {
306
- isFollowing = await isFollowingMember(id);
307
- } catch { /* default false */ }
457
+ if (!selfMode) {
458
+ try {
459
+ isFollowing = await isFollowingMember(id);
460
+ } catch { /* default false */ }
461
+ }
308
462
 
309
463
  await assertReadAccess(access);
310
464
  if (version !== loadVersion) return undefined;
@@ -323,6 +477,7 @@ const svc = defineService<S, {
323
477
  name: n,
324
478
  initial: (n[0] || "#").toUpperCase(),
325
479
  photo: m.profile?.photo?.url || "",
480
+ title: m.profile?.title?.trim() || "",
326
481
  joined, hasJoined: !!joined,
327
482
  slug, shareUrl, noShare: !shareUrl,
328
483
  isFollowing,
@@ -365,12 +520,12 @@ const svc = defineService<S, {
365
520
  toggleFollow: async (s): Promise<S | undefined> => {
366
521
  if (!s.found || !s.id) return undefined;
367
522
  const access = loadedAccess;
368
- if (!access || detailInputId() !== s.id) return undefined;
523
+ if (!access || targetId() !== s.id) return undefined;
369
524
  if (!access.member.email) return undefined;
370
525
  const pendingKey = JSON.stringify([access.tenant, access.member.scope, access.member.email, s.id]);
371
526
  if (pendingFollows.has(pendingKey)) return undefined;
372
527
  const version = loadVersion;
373
- const current = () => version === loadVersion && access === loadedAccess && detailInputId() === s.id;
528
+ const current = () => version === loadVersion && access === loadedAccess && targetId() === s.id;
374
529
  // Serialize this reader's writes to one member within this worker, including after
375
530
  // navigation back to it. Another member or reader/site can act while this request is
376
531
  // pending. Separate worker instances are isolated contexts and cannot share this guard.
@@ -386,7 +541,7 @@ const svc = defineService<S, {
386
541
  if (!current()) {
387
542
  // The write is confirmed, but a reload overlapped it and may have read the old
388
543
  // relationship. Same reader and member: re-read instead of leaving a stale label.
389
- if (detailInputId() === s.id) await svc.load();
544
+ if (targetId() === s.id) await svc.load();
390
545
  return undefined;
391
546
  }
392
547
  followRevision++;
@@ -419,20 +574,29 @@ const svc = defineService<S, {
419
574
  // toggleFollow revalidates the captured reader/site again before issuing the write.
420
575
  return svc.toggleFollow();
421
576
  },
422
- applySections: (s) => (s.found && s.id === detailInputId() ? derive({ ...s, ...sections }) : undefined),
577
+ applySections: (s) => (s.found && s.id === targetId() ? derive({ ...s, ...sections }) : undefined),
578
+ // Show more / Show less: in place, one tap. Not cached, so the screen opens collapsed again.
579
+ toggleAbout: (s) => derive({ ...s, aboutExpanded: !s.aboutExpanded }),
580
+ // Try again on the About section alone: the section keeps its failed state until the read lands.
581
+ retryAbout: async (s): Promise<S | undefined> => {
582
+ const access = loadedAccess;
583
+ if (!s.found || !access || s.id !== targetId()) return undefined;
584
+ await readAbout(s.id, sectionLander(s.id, loadVersion, access).land);
585
+ return undefined;
586
+ },
423
587
  setBusy: (s, busy) => derive({ ...s, followBusy: busy, snackbarMessage: busy ? "" : s.snackbarMessage }),
424
588
  syncBusy: (s): S => {
425
589
  const access = loadedAccess;
426
- if (!access || !s.found || s.id !== detailInputId()) return s;
590
+ if (!access || !s.found || s.id !== targetId()) return s;
427
591
  return derive({ ...s, followBusy: pendingFollows.has(JSON.stringify([access.tenant, access.member.scope, access.member.email, s.id])) });
428
592
  },
429
593
  share: async (s): Promise<S | undefined> => {
430
594
  const access = loadedAccess;
431
595
  const version = loadVersion;
432
- if (!s.found || !s.shareUrl || !access || detailInputId() !== s.id) return undefined;
596
+ if (!s.found || !s.shareUrl || !access || targetId() !== s.id) return undefined;
433
597
  try {
434
598
  await assertReadAccess(access);
435
- if (version !== loadVersion || loadedAccess !== access || detailInputId() !== s.id) return undefined;
599
+ if (version !== loadVersion || loadedAccess !== access || targetId() !== s.id) return undefined;
436
600
  await shareSheet({ subject: s.name, url: s.shareUrl });
437
601
  } catch { /* changed identity, unavailable presenter or cancellation makes no share */ }
438
602
  // A one-shot presentation never writes a captured screen snapshot back after an await.
@@ -446,6 +610,8 @@ let sections: Partial<S> = {};
446
610
  function sectionsOf(s: S): Partial<S> {
447
611
  return {
448
612
  hasAbout: s.hasAbout, aboutJson: s.aboutJson, hasBadges: s.hasBadges, badges: s.badges,
613
+ aboutPhase: s.aboutPhase, aboutPlain: s.aboutPlain, aboutLong: s.aboutLong,
614
+ hasGroups: groupsEnabled && s.hasGroups, groups: groupsEnabled ? s.groups : [],
449
615
  // A disabled vertical cannot keep contributing cached content, even on an offline revisit.
450
616
  hasBlogPosts: blogEnabled && s.hasBlogPosts, blogPosts: blogEnabled ? s.blogPosts : [],
451
617
  hasForumPosts: forumEnabled && s.hasForumPosts, forumPosts: forumEnabled ? s.forumPosts : [],
@@ -455,8 +621,8 @@ function sectionsOf(s: S): Partial<S> {
455
621
  /** Each secondary read lands in its own state write, so a slow read never delays another section and a
456
622
  * failed one only hides its own. They never change the header or the action row. An availability failure
457
623
  * keeps cached content; an authoritative refusal or missing result clears only that section. */
458
- async function publishSections(id: string, version: number, access: ReadAccess): Promise<void> {
459
- const still = () => version === loadVersion && detailInputId() === id && sameAccess(loadedAccess, access);
624
+ function sectionLander(id: string, version: number, access: ReadAccess) {
625
+ const still = () => version === loadVersion && targetId() === id && sameAccess(loadedAccess, access);
460
626
  const land = async (patch: Partial<S>) => {
461
627
  if (!still()) return;
462
628
  try { await assertReadAccess(access); }
@@ -473,18 +639,14 @@ async function publishSections(id: string, version: number, access: ReadAccess):
473
639
  sections = { ...sections, ...patch };
474
640
  await svc.applySections();
475
641
  };
642
+ return { still, land };
643
+ }
644
+
645
+ async function publishSections(id: string, version: number, access: ReadAccess): Promise<void> {
646
+ const { still, land } = sectionLander(id, version, access);
476
647
  const reads: Array<Promise<void>> = [];
477
- reads.push((async () => {
478
- try {
479
- const res = await queryMemberAbouts({ query: { filter: { memberId: id } } });
480
- const content = res.memberAbouts?.find((a) => a.memberId === id || !a.memberId)?.content;
481
- const nodes = (content as { nodes?: unknown[] } | undefined)?.nodes;
482
- await land(content && Array.isArray(nodes) && hasAboutContent(nodes) ? { hasAbout: true, aboutJson: JSON.stringify(content) } : { hasAbout: false, aboutJson: "" });
483
- } catch (e) {
484
- if (readAccessDenied(e) || isNotFoundError(e)) await land({ hasAbout: false, aboutJson: "" });
485
- }
486
- })());
487
- reads.push((async () => {
648
+ reads.push(readAbout(id, land));
649
+ if (badgesEnabled) reads.push((async () => {
488
650
  try {
489
651
  // Badges v4 (a Visitor can read both): the badges this member holds, then the site's badges that match them.
490
652
  // The site's badge list is paged until every held badge is found, so a held badge is never lost past page one.
@@ -530,6 +692,33 @@ async function publishSections(id: string, version: number, access: ReadAccess):
530
692
  if (readAccessDenied(e) || isNotFoundError(e)) await land({ hasBadges: false, badges: [] });
531
693
  }
532
694
  })());
695
+ // Self mode only: the groups the reader belongs to. Wix answers memberships for the caller's own id only.
696
+ if (selfMode && groupsEnabled) reads.push((async () => {
697
+ try {
698
+ // A full page (as My Groups reads it): pending requests must not crowd out the joined groups shown, and a
699
+ // group listed twice is shown once (its id keys the carousel card).
700
+ const res = await listMemberships(id, { limit: MEMBERSHIP_PAGE_LIMIT });
701
+ const seen = new Set<string>();
702
+ const memberships = ((res as { memberships?: WixGroupMembership[] }).memberships ?? [])
703
+ .filter((m) => {
704
+ if (typeof m?.groupId !== "string" || !m.groupId || (m.status ?? "").toUpperCase() !== "JOINED" || seen.has(m.groupId)) return false;
705
+ seen.add(m.groupId);
706
+ return true;
707
+ })
708
+ .slice(0, GROUP_LIMIT);
709
+ const reads = await Promise.allSettled(memberships.map((m) => getGroup(String(m.groupId))));
710
+ const rows: GroupRow[] = [];
711
+ reads.forEach((read, i) => {
712
+ if (read.status !== "fulfilled") return;
713
+ // Social Groups wraps the entity as `{ group }`; the typed signature claims a bare group.
714
+ const group = ((read.value as unknown as { group?: WixGroup }).group ?? read.value) as WixGroup;
715
+ if (group && typeof group === "object") rows.push(groupRow(group, memberships[i]));
716
+ });
717
+ await land({ hasGroups: rows.length > 0, groups: rows });
718
+ } catch (e) {
719
+ if (readAccessDenied(e) || isNotFoundError(e)) await land({ hasGroups: false, groups: [] });
720
+ }
721
+ })());
533
722
  if (blogEnabled) reads.push((async () => {
534
723
  try {
535
724
  const res = await queryBlogPosts({ query: { filter: { memberId: id }, paging: { limit: POST_LIMIT } } });
@@ -551,6 +740,30 @@ async function publishSections(id: string, version: number, access: ReadAccess):
551
740
  await Promise.all(reads);
552
741
  }
553
742
 
743
+ /** The About read, also run alone by `retryAbout`. On the member profile a failure that is not a refusal
744
+ * keeps what the section showed. Self mode gives the section its own verdict instead: text, no text
745
+ * (the empty state invites the member to add one), or failed (Try again — never the empty state, so a
746
+ * member is not invited to write over a text that merely failed to load). */
747
+ async function readAbout(id: string, land: (patch: Partial<S>) => Promise<void>): Promise<void> {
748
+ try {
749
+ const res = await queryMemberAbouts({ query: { filter: { memberId: id } } });
750
+ const content = res.memberAbouts?.find((a) => a.memberId === id || !a.memberId)?.content;
751
+ const nodes = (content as { nodes?: unknown[] } | undefined)?.nodes;
752
+ if (content && Array.isArray(nodes) && hasAboutContent(nodes)) {
753
+ const aboutPlain = aboutPlainText(content);
754
+ await land({ hasAbout: true, aboutJson: JSON.stringify(content), aboutPhase: "content", aboutPlain, aboutLong: aboutIsLong(aboutPlain) });
755
+ } else {
756
+ await land({ hasAbout: false, aboutJson: "", aboutPhase: "empty", aboutPlain: "", aboutLong: false });
757
+ }
758
+ } catch (e) {
759
+ if (readAccessDenied(e) || isNotFoundError(e)) await land({ hasAbout: false, aboutJson: "", aboutPhase: selfMode ? "failed" : "empty", aboutPlain: "", aboutLong: false });
760
+ else if (selfMode) await land({ aboutPhase: "failed" });
761
+ }
762
+ }
763
+
764
+ // A host older than `hydrationOptOut` ignores notPersisted/notHydrated and restores the whole snapshot: reset it
765
+ // before anything paints, so a previous member's profile never shows (as wix-spaces-view-profile does).
766
+ if (!(globalThis as { himalaya?: { hydrationOptOut?: boolean } }).himalaya?.hydrationOptOut) Object.assign(svc.getState(), INITIAL);
554
767
  svc.prepare();
555
768
  svc.load();
556
769
  export { svc };
@@ -0,0 +1,8 @@
1
+ // A member's About (a Ricos document) as plain text: one line per non-empty block. The SDK joins blocks with a
2
+ // blank line, which would spend a line of a short preview on nothing. Shared by the profile's collapsed About
3
+ // (wix-spaces-member-detail) and Personal info's About me preview (himi-branded-lite-account-settings).
4
+ import { ricosToPlainText } from "@himalaya/wix-rich-content";
5
+
6
+ export function aboutPlainText(content: unknown): string {
7
+ return ricosToPlainText(content as Parameters<typeof ricosToPlainText>[0]).split("\n\n").map((b) => b.trim()).filter(Boolean).join("\n");
8
+ }