@wix/himalaya-cli 0.1569.0 → 0.1571.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 (159) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/l10n-strings.d.ts +3 -2
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +8 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/index.d.ts +7 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/business-contact-service.d.ts +17 -0
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/business-contact.d.ts +73 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/index.d.ts +3 -0
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/invite-target.d.ts +1 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/flows/screens/src/invite.d.ts +148 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/blog-v3/src/extensions.d.ts +6 -3
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/auth.mjs +17 -7
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core/validation.mjs +17 -7
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +17 -7
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/screens.mjs +575 -91
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/state.mjs +17 -7
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-auth.mjs +7 -1
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-blog.mjs +1 -0
  17. package/dist/cli.mjs +1897 -1226
  18. package/dist/preview-assets.generated.bin +0 -0
  19. package/guides/base44-app-to-himi-app.md +1 -1
  20. package/guides/capabilities.md +7 -0
  21. package/guides/getting-started.md +5 -0
  22. package/guides/himi-json-output.md +11 -0
  23. package/guides/himi-skill.md +5 -0
  24. package/guides/one-app-to-himi-app.md +267 -8
  25. package/guides/sdk-reference.json +2 -2
  26. package/guides/skill.md +5 -0
  27. package/guides/splash-screens.md +10 -1
  28. package/guides/tier-5-add-a-screen.md +20 -0
  29. package/guides/trim-a-template.md +5 -0
  30. package/guides/wix-business-context.md +11 -2
  31. package/package.json +2 -2
  32. package/templates/beauty-salon/config.ts +8 -1
  33. package/templates/beauty-salon/dev/index.ts +244 -1
  34. package/templates/beauty-salon/himalaya.content.json +3 -0
  35. package/templates/beauty-salon/tier5-src/_shared/member-read.ts +52 -0
  36. package/templates/beauty-salon/tier5-src/_shared/program-description.ts +11 -0
  37. package/templates/beauty-salon/tier5-src/business-contact/index.ts +6 -0
  38. package/templates/beauty-salon/tier5-src/himi-blog-post/index.ts +35 -12
  39. package/templates/beauty-salon/tier5-src/himi-branded-lite-home/index.ts +3 -3
  40. package/templates/beauty-salon/tier5-src/himi-store-product/index.ts +6 -9
  41. package/templates/beauty-salon-owner/config.ts +1 -1
  42. package/templates/branded-lite/config.ts +8 -1
  43. package/templates/branded-lite/dev/index.ts +409 -2
  44. package/templates/branded-lite/himalaya.content.json +3 -0
  45. package/templates/branded-lite/tier5-src/_shared/member-read.ts +52 -0
  46. package/templates/branded-lite/tier5-src/_shared/program-description.ts +11 -0
  47. package/templates/branded-lite/tier5-src/business-contact/index.ts +6 -0
  48. package/templates/branded-lite/tier5-src/himi-blog-post/index.ts +35 -12
  49. package/templates/branded-lite/tier5-src/himi-branded-lite-home/index.ts +3 -3
  50. package/templates/branded-lite/tier5-src/himi-branded-lite-notifsettings/index.ts +39 -11
  51. package/templates/branded-lite/tier5-src/himi-branded-lite-program/index.ts +16 -14
  52. package/templates/branded-lite/tier5-src/himi-branded-lite-programs/index.ts +3 -7
  53. package/templates/branded-lite/tier5-src/himi-events-my-events/index.ts +76 -42
  54. package/templates/branded-lite/tier5-src/himi-store-product/index.ts +6 -9
  55. package/templates/branded-lite/tier5-src/wix-spaces-chat-thread/index.ts +101 -34
  56. package/templates/branded-lite/tier5-src/wix-spaces-forum-post/index.ts +23 -6
  57. package/templates/branded-lite/tier5-src/wix-spaces-member-detail/index.ts +26 -11
  58. package/templates/community-club/config.ts +8 -1
  59. package/templates/community-club/dev/index.ts +278 -2
  60. package/templates/community-club/himalaya.content.json +3 -0
  61. package/templates/community-club/tier5-src/_shared/branded-load-state.ts +106 -0
  62. package/templates/community-club/tier5-src/_shared/member-read.ts +52 -0
  63. package/templates/community-club/tier5-src/_shared/program-description.ts +11 -0
  64. package/templates/community-club/tier5-src/business-contact/index.ts +6 -0
  65. package/templates/community-club/tier5-src/himi-blog-post/index.ts +35 -12
  66. package/templates/community-club/tier5-src/himi-branded-lite-home/index.ts +3 -3
  67. package/templates/community-club/tier5-src/himi-events-my-events/index.ts +76 -42
  68. package/templates/community-club-owner/config.ts +1 -1
  69. package/templates/events-meetups/config.ts +8 -1
  70. package/templates/events-meetups/dev/index.ts +278 -2
  71. package/templates/events-meetups/himalaya.content.json +3 -0
  72. package/templates/events-meetups/tier5-src/_shared/branded-load-state.ts +106 -0
  73. package/templates/events-meetups/tier5-src/_shared/member-read.ts +52 -0
  74. package/templates/events-meetups/tier5-src/_shared/program-description.ts +11 -0
  75. package/templates/events-meetups/tier5-src/business-contact/index.ts +6 -0
  76. package/templates/events-meetups/tier5-src/himi-blog-post/index.ts +35 -12
  77. package/templates/events-meetups/tier5-src/himi-branded-lite-home/index.ts +3 -3
  78. package/templates/events-meetups/tier5-src/himi-events-my-events/index.ts +76 -42
  79. package/templates/events-meetups-owner/config.ts +1 -1
  80. package/templates/gym-fitness/config.ts +8 -1
  81. package/templates/gym-fitness/dev/index.ts +278 -2
  82. package/templates/gym-fitness/himalaya.content.json +3 -0
  83. package/templates/gym-fitness/tier5-src/_shared/member-read.ts +52 -0
  84. package/templates/gym-fitness/tier5-src/_shared/program-description.ts +11 -0
  85. package/templates/gym-fitness/tier5-src/business-contact/index.ts +6 -0
  86. package/templates/gym-fitness/tier5-src/himi-blog-post/index.ts +35 -12
  87. package/templates/gym-fitness/tier5-src/himi-branded-lite-home/index.ts +3 -3
  88. package/templates/gym-fitness/tier5-src/himi-events-my-events/index.ts +76 -42
  89. package/templates/gym-fitness/tier5-src/himi-store-product/index.ts +6 -9
  90. package/templates/gym-fitness-owner/config.ts +1 -1
  91. package/templates/nonprofit-cause/config.ts +8 -1
  92. package/templates/nonprofit-cause/dev/index.ts +278 -2
  93. package/templates/nonprofit-cause/himalaya.content.json +3 -0
  94. package/templates/nonprofit-cause/tier5-src/_shared/branded-load-state.ts +106 -0
  95. package/templates/nonprofit-cause/tier5-src/_shared/member-read.ts +52 -0
  96. package/templates/nonprofit-cause/tier5-src/_shared/program-description.ts +11 -0
  97. package/templates/nonprofit-cause/tier5-src/business-contact/index.ts +6 -0
  98. package/templates/nonprofit-cause/tier5-src/himi-blog-post/index.ts +35 -12
  99. package/templates/nonprofit-cause/tier5-src/himi-branded-lite-home/index.ts +3 -3
  100. package/templates/nonprofit-cause/tier5-src/himi-events-my-events/index.ts +76 -42
  101. package/templates/nonprofit-cause-owner/config.ts +1 -1
  102. package/templates/owner-lite/config.ts +1 -1
  103. package/templates/podcast-creator/config.ts +8 -1
  104. package/templates/podcast-creator/dev/index.ts +278 -2
  105. package/templates/podcast-creator/himalaya.content.json +3 -0
  106. package/templates/podcast-creator/tier5-src/_shared/branded-load-state.ts +106 -0
  107. package/templates/podcast-creator/tier5-src/_shared/member-read.ts +52 -0
  108. package/templates/podcast-creator/tier5-src/_shared/program-description.ts +11 -0
  109. package/templates/podcast-creator/tier5-src/business-contact/index.ts +6 -0
  110. package/templates/podcast-creator/tier5-src/himi-blog-post/index.ts +35 -12
  111. package/templates/podcast-creator/tier5-src/himi-branded-lite-home/index.ts +3 -3
  112. package/templates/podcast-creator/tier5-src/himi-events-my-events/index.ts +76 -42
  113. package/templates/podcast-creator-owner/config.ts +1 -1
  114. package/templates/portfolio-creative/config.ts +8 -1
  115. package/templates/portfolio-creative/dev/index.ts +278 -2
  116. package/templates/portfolio-creative/himalaya.content.json +3 -0
  117. package/templates/portfolio-creative/tier5-src/_shared/branded-load-state.ts +106 -0
  118. package/templates/portfolio-creative/tier5-src/_shared/member-read.ts +52 -0
  119. package/templates/portfolio-creative/tier5-src/_shared/program-description.ts +11 -0
  120. package/templates/portfolio-creative/tier5-src/business-contact/index.ts +6 -0
  121. package/templates/portfolio-creative/tier5-src/himi-blog-post/index.ts +35 -12
  122. package/templates/portfolio-creative/tier5-src/himi-branded-lite-home/index.ts +3 -3
  123. package/templates/portfolio-creative/tier5-src/himi-events-my-events/index.ts +76 -42
  124. package/templates/portfolio-creative/tier5-src/himi-store-product/index.ts +6 -9
  125. package/templates/portfolio-creative-owner/config.ts +1 -1
  126. package/templates/restaurant/config.ts +8 -1
  127. package/templates/restaurant/dev/index.ts +278 -2
  128. package/templates/restaurant/himalaya.content.json +3 -0
  129. package/templates/restaurant/tier5-src/_shared/branded-load-state.ts +106 -0
  130. package/templates/restaurant/tier5-src/_shared/member-read.ts +52 -0
  131. package/templates/restaurant/tier5-src/_shared/program-description.ts +11 -0
  132. package/templates/restaurant/tier5-src/business-contact/index.ts +6 -0
  133. package/templates/restaurant/tier5-src/himi-blog-post/index.ts +35 -12
  134. package/templates/restaurant/tier5-src/himi-branded-lite-home/index.ts +3 -3
  135. package/templates/restaurant/tier5-src/himi-events-my-events/index.ts +76 -42
  136. package/templates/restaurant-owner/config.ts +1 -1
  137. package/templates/retail-store/config.ts +8 -1
  138. package/templates/retail-store/dev/index.ts +244 -1
  139. package/templates/retail-store/himalaya.content.json +3 -0
  140. package/templates/retail-store/tier5-src/_shared/branded-load-state.ts +106 -0
  141. package/templates/retail-store/tier5-src/_shared/member-read.ts +52 -0
  142. package/templates/retail-store/tier5-src/_shared/program-description.ts +11 -0
  143. package/templates/retail-store/tier5-src/business-contact/index.ts +6 -0
  144. package/templates/retail-store/tier5-src/himi-blog-post/index.ts +35 -12
  145. package/templates/retail-store/tier5-src/himi-branded-lite-home/index.ts +3 -3
  146. package/templates/retail-store/tier5-src/himi-store-product/index.ts +6 -9
  147. package/templates/retail-store-owner/config.ts +1 -1
  148. package/templates/yoga-studio/config.ts +8 -1
  149. package/templates/yoga-studio/dev/index.ts +306 -2
  150. package/templates/yoga-studio/himalaya.content.json +3 -0
  151. package/templates/yoga-studio/tier5-src/_shared/member-read.ts +52 -0
  152. package/templates/yoga-studio/tier5-src/_shared/program-description.ts +11 -0
  153. package/templates/yoga-studio/tier5-src/business-contact/index.ts +6 -0
  154. package/templates/yoga-studio/tier5-src/himi-blog-post/index.ts +35 -12
  155. package/templates/yoga-studio/tier5-src/himi-branded-lite-home/index.ts +3 -3
  156. package/templates/yoga-studio/tier5-src/himi-branded-lite-program/index.ts +16 -14
  157. package/templates/yoga-studio/tier5-src/himi-branded-lite-programs/index.ts +3 -7
  158. package/templates/yoga-studio/tier5-src/himi-events-my-events/index.ts +76 -42
  159. package/templates/yoga-studio-owner/config.ts +1 -1
@@ -6982,6 +6982,219 @@ const SCREENS = runtimeSetting({
6982
6982
  "bundleVersion": "0.0.1"
6983
6983
  }
6984
6984
  },
6985
+ "himi_business_contact": {
6986
+ "screenId": "himi_business_contact",
6987
+ "title": "Business contact",
6988
+ "renderer": "sdui_intent",
6989
+ "schemaVersion": 1,
6990
+ "cacheControl": {
6991
+ "maxAge": 0,
6992
+ "staleWhileRevalidate": 0
6993
+ },
6994
+ "payload": {
6995
+ "id": "himi_business_contact.root",
6996
+ "body": {
6997
+ "package": "himalaya",
6998
+ "type": "VStack",
6999
+ "props": {
7000
+ "spacing": 16,
7001
+ "alignment": "leading",
7002
+ "children": [
7003
+ {
7004
+ "id": "himi_business_contact.section",
7005
+ "body": {
7006
+ "package": "himalaya",
7007
+ "type": "VStack",
7008
+ "props": {
7009
+ "spacing": 12,
7010
+ "alignment": "leading",
7011
+ "children": [
7012
+ {
7013
+ "id": "himi_business_contact.section.directions_copy",
7014
+ "body": {
7015
+ "package": "himalaya",
7016
+ "type": "Text",
7017
+ "props": {
7018
+ "text": "Directions",
7019
+ "style": "body",
7020
+ "collapseWhenEmpty": true
7021
+ }
7022
+ },
7023
+ "modifiers": {
7024
+ "hidden": true
7025
+ }
7026
+ },
7027
+ {
7028
+ "id": "himi_business_contact.section.unavailable",
7029
+ "body": {
7030
+ "package": "himalaya",
7031
+ "type": "Text",
7032
+ "props": {
7033
+ "text": "Contact details unavailable",
7034
+ "style": "body",
7035
+ "collapseWhenEmpty": true
7036
+ }
7037
+ }
7038
+ },
7039
+ {
7040
+ "id": "himi_business_contact.section.member_count",
7041
+ "body": {
7042
+ "package": "himalaya",
7043
+ "type": "FragmentSlot",
7044
+ "props": {
7045
+ "casePath": "$service:businessContact.memberCountCase",
7046
+ "defaultCase": "unavailable",
7047
+ "cases": [
7048
+ {
7049
+ "id": "one",
7050
+ "content": {
7051
+ "id": "himi_business_contact.section.members_one",
7052
+ "body": {
7053
+ "package": "himalaya",
7054
+ "type": "HStack",
7055
+ "props": {
7056
+ "spacing": 4,
7057
+ "alignment": "center",
7058
+ "children": [
7059
+ {
7060
+ "id": "himi_business_contact.section.count_one",
7061
+ "body": {
7062
+ "package": "himalaya",
7063
+ "type": "Text",
7064
+ "props": {
7065
+ "text": "$service:businessContact.memberCount",
7066
+ "style": "footnote",
7067
+ "collapseWhenEmpty": true
7068
+ }
7069
+ }
7070
+ },
7071
+ {
7072
+ "id": "himi_business_contact.section.unit_one",
7073
+ "body": {
7074
+ "package": "himalaya",
7075
+ "type": "Text",
7076
+ "props": {
7077
+ "text": "member",
7078
+ "style": "footnote",
7079
+ "collapseWhenEmpty": true
7080
+ }
7081
+ }
7082
+ }
7083
+ ]
7084
+ }
7085
+ }
7086
+ }
7087
+ },
7088
+ {
7089
+ "id": "other",
7090
+ "content": {
7091
+ "id": "himi_business_contact.section.members_other",
7092
+ "body": {
7093
+ "package": "himalaya",
7094
+ "type": "HStack",
7095
+ "props": {
7096
+ "spacing": 4,
7097
+ "alignment": "center",
7098
+ "children": [
7099
+ {
7100
+ "id": "himi_business_contact.section.count_other",
7101
+ "body": {
7102
+ "package": "himalaya",
7103
+ "type": "Text",
7104
+ "props": {
7105
+ "text": "$service:businessContact.memberCount",
7106
+ "style": "footnote",
7107
+ "collapseWhenEmpty": true
7108
+ }
7109
+ }
7110
+ },
7111
+ {
7112
+ "id": "himi_business_contact.section.unit_other",
7113
+ "body": {
7114
+ "package": "himalaya",
7115
+ "type": "Text",
7116
+ "props": {
7117
+ "text": "members",
7118
+ "style": "footnote",
7119
+ "collapseWhenEmpty": true
7120
+ }
7121
+ }
7122
+ }
7123
+ ]
7124
+ }
7125
+ }
7126
+ }
7127
+ },
7128
+ {
7129
+ "id": "unavailable",
7130
+ "content": {
7131
+ "id": "himi_business_contact.section.members_unavailable",
7132
+ "body": {
7133
+ "package": "himalaya",
7134
+ "type": "Text",
7135
+ "props": {
7136
+ "text": "Member count unavailable",
7137
+ "style": "footnote",
7138
+ "collapseWhenEmpty": true
7139
+ }
7140
+ }
7141
+ }
7142
+ }
7143
+ ]
7144
+ }
7145
+ },
7146
+ "modifiers": {
7147
+ "hidden": true
7148
+ }
7149
+ },
7150
+ {
7151
+ "id": "himi_business_contact.section.feedback",
7152
+ "body": {
7153
+ "package": "himalaya",
7154
+ "type": "Text",
7155
+ "props": {
7156
+ "text": "$service:businessContact.message",
7157
+ "style": "footnote",
7158
+ "collapseWhenEmpty": true
7159
+ }
7160
+ }
7161
+ }
7162
+ ]
7163
+ }
7164
+ }
7165
+ }
7166
+ ]
7167
+ }
7168
+ },
7169
+ "modifiers": {
7170
+ "background": {
7171
+ "token": "surfacePrimary"
7172
+ },
7173
+ "padding": {
7174
+ "leading": 20,
7175
+ "trailing": 20,
7176
+ "top": 18,
7177
+ "bottom": 28
7178
+ },
7179
+ "onAppear": {
7180
+ "actionId": "tier5.businessContact.load",
7181
+ "args": {
7182
+ "showMemberCount": false
7183
+ }
7184
+ }
7185
+ }
7186
+ },
7187
+ "logicBundle": {
7188
+ "url": "http://localhost:8190/v1/bundles/business-contact?integrity=",
7189
+ "integrity": "",
7190
+ "contentType": "application/javascript+ts-bundle",
7191
+ "declaredCapabilities": [
7192
+ "open_url"
7193
+ ],
7194
+ "minBinaryVersion": "0.1.0",
7195
+ "bundleVersion": "0.0.1"
7196
+ }
7197
+ },
6985
7198
  "himi_appearance": {
6986
7199
  "screenId": "himi_appearance",
6987
7200
  "renderer": "sdui_intent",
@@ -31984,6 +32197,9 @@ const SCREENS = runtimeSetting({
31984
32197
  "style": "body",
31985
32198
  "color": "textSecondary"
31986
32199
  }
32200
+ },
32201
+ "modifiers": {
32202
+ "hiddenPath": "$service:himiMyEvents.signInRequired"
31987
32203
  }
31988
32204
  },
31989
32205
  {
@@ -31998,6 +32214,32 @@ const SCREENS = runtimeSetting({
31998
32214
  "actionId": "tier5.himiMyEvents.load"
31999
32215
  }
32000
32216
  }
32217
+ },
32218
+ "modifiers": {
32219
+ "hiddenPath": "$service:himiMyEvents.signInRequired"
32220
+ }
32221
+ },
32222
+ {
32223
+ "id": "himi_my_events.retry.sign_in",
32224
+ "body": {
32225
+ "package": "himalaya",
32226
+ "type": "Button",
32227
+ "props": {
32228
+ "title": "Sign in",
32229
+ "style": "primary",
32230
+ "action": {
32231
+ "actionId": "himi.open",
32232
+ "params": {
32233
+ "screenId": "himi_sign_in",
32234
+ "mode": "signin",
32235
+ "modal": "1"
32236
+ },
32237
+ "presentation": "sheet"
32238
+ }
32239
+ }
32240
+ },
32241
+ "modifiers": {
32242
+ "hiddenPath": "$service:himiMyEvents.noSignIn"
32001
32243
  }
32002
32244
  }
32003
32245
  ]
@@ -32428,7 +32670,11 @@ const SCREENS = runtimeSetting({
32428
32670
  "bottom": 24
32429
32671
  },
32430
32672
  "onAppear": {
32431
- "actionId": "tier5.himiMyEvents.load"
32673
+ "actionId": "tier5.himiMyEvents.load",
32674
+ "params": {
32675
+ "signInScreenId": "himi_sign_in",
32676
+ "memberOnly": "1"
32677
+ }
32432
32678
  }
32433
32679
  }
32434
32680
  },
@@ -48055,6 +48301,9 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
48055
48301
  "style": "body",
48056
48302
  "color": "textSecondary"
48057
48303
  }
48304
+ },
48305
+ "modifiers": {
48306
+ "hiddenPath": "$service:himiBlogPost.signInRequired"
48058
48307
  }
48059
48308
  },
48060
48309
  {
@@ -48069,6 +48318,32 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
48069
48318
  "actionId": "tier5.himiBlogPost.retry"
48070
48319
  }
48071
48320
  }
48321
+ },
48322
+ "modifiers": {
48323
+ "hiddenPath": "$service:himiBlogPost.signInRequired"
48324
+ }
48325
+ },
48326
+ {
48327
+ "id": "himi_blog_post.retry.sign_in",
48328
+ "body": {
48329
+ "package": "himalaya",
48330
+ "type": "Button",
48331
+ "props": {
48332
+ "title": "Sign in",
48333
+ "style": "primary",
48334
+ "action": {
48335
+ "actionId": "himi.open",
48336
+ "params": {
48337
+ "screenId": "himi_sign_in",
48338
+ "mode": "signin",
48339
+ "modal": "1"
48340
+ },
48341
+ "presentation": "sheet"
48342
+ }
48343
+ }
48344
+ },
48345
+ "modifiers": {
48346
+ "hiddenPath": "$service:himiBlogPost.noSignIn"
48072
48347
  }
48073
48348
  }
48074
48349
  ]
@@ -48773,7 +49048,8 @@ const TEMPLATED: { pattern: string; display: string; liveSeed?: LiveSeed; static
48773
49048
  "onAppear": {
48774
49049
  "actionId": "tier5.himiBlogPost.load",
48775
49050
  "params": {
48776
- "id": "__HIMI_ID__"
49051
+ "id": "__HIMI_ID__",
49052
+ "signInScreenId": "himi_sign_in"
48777
49053
  }
48778
49054
  }
48779
49055
  }
@@ -40,6 +40,9 @@
40
40
  "himi_branded_splash": {
41
41
  "displayName": "Splash"
42
42
  },
43
+ "himi_business_contact": {
44
+ "displayName": "Business contact"
45
+ },
43
46
  "himi_cart": {
44
47
  "displayName": "Cart"
45
48
  },
@@ -0,0 +1,52 @@
1
+ import { memberAccess, memberAccessChanged, memberAccessDenied, type MemberAccess } from "./member-access.js";
2
+ import { needsSignIn } from "./branded-load-state.js";
3
+
4
+ /** Public reads stay public. Capture their reader only to reject a result that
5
+ * belongs to the identity/site which was active before the request. */
6
+ export interface ReadAccess { member: MemberAccess; tenant: string; }
7
+ export async function readAccess(): Promise<ReadAccess> {
8
+ const member = await memberAccess();
9
+ const input = (globalThis as { himalaya?: { input?: Record<string, unknown> } }).himalaya?.input;
10
+ return { member, tenant: JSON.stringify([input?.__himiPreferenceAccount ?? "", input?.__himiPreferenceBusiness ?? ""]) };
11
+ }
12
+
13
+ export async function assertReadAccess(access: ReadAccess): Promise<void> {
14
+ const current = await readAccess();
15
+ if (current.member.email !== access.member.email || current.member.scope !== access.member.scope || current.tenant !== access.tenant) throw memberAccessChanged();
16
+ }
17
+
18
+ /** Bridge errors put the actual status first; codes quoted inside the body are data. */
19
+ function httpStatus(error: unknown): string | undefined {
20
+ return /^HTTP\s*(\d{3})\b/i.exec(String((error as { message?: unknown })?.message ?? error))?.[1];
21
+ }
22
+
23
+ export const NO_READ_SIGN_IN = { signInRequired: false, noSignIn: true };
24
+
25
+ /** An authorization refusal must not fall back to a previously cached article. */
26
+ export function readAccessDenied(error: unknown): boolean {
27
+ let cause = error;
28
+ for (let depth = 0; cause && depth < 4; depth++) {
29
+ const status = httpStatus(cause);
30
+ if (status ? status === "401" || status === "403" : memberAccessDenied(cause) || needsSignIn(cause)) return true;
31
+ cause = (cause as { cause?: unknown }).cause;
32
+ }
33
+ return false;
34
+ }
35
+
36
+ /** A permission failure alone says nothing about whether signing in can help.
37
+ * In particular, a private member profile can be unavailable to members too.
38
+ * Only an authentication refusal for a current visitor offers Sign in. Follow
39
+ * SDK wrapper causes (blog getPost preserves its original read error there). */
40
+ export async function readSignInFlags(error: unknown): Promise<typeof NO_READ_SIGN_IN> {
41
+ let authenticationRequired = false;
42
+ let permissionRefused = false;
43
+ let cause = error;
44
+ for (let depth = 0; cause && depth < 4; depth++) {
45
+ const status = httpStatus(cause);
46
+ permissionRefused ||= status === "403";
47
+ authenticationRequired ||= status ? status === "401" : needsSignIn(cause);
48
+ cause = (cause as { cause?: unknown }).cause;
49
+ }
50
+ const signInRequired = !permissionRefused && authenticationRequired && !(await memberAccess()).email;
51
+ return { signInRequired, noSignIn: !signInRequired };
52
+ }
@@ -0,0 +1,11 @@
1
+ import type { WixProgram } from "@himalaya/wix-online-programs";
2
+
3
+ /** v3 nests the body in description.details; older responses use settings or a
4
+ * flat description. The body itself may be a Ricos document or serialized text. */
5
+ export function programDescription(program: WixProgram): unknown {
6
+ const raw = (program as { description?: unknown }).description;
7
+ const nested = raw && typeof raw === "object" ? raw as { details?: unknown; nodes?: unknown } : undefined;
8
+ return program.settings?.description ?? nested?.details
9
+ ?? (typeof raw === "string" || Array.isArray(nested?.nodes) ? raw : undefined)
10
+ ?? program.details?.description;
11
+ }
@@ -0,0 +1,6 @@
1
+ import { createBusinessContactService } from "@himalaya/screens";
2
+
3
+ // Contact values and the optional public total are build-time source evidence.
4
+ // No owner API, device location, or cross-site source URL is read by this worker.
5
+ const svc = createBusinessContactService();
6
+ export { svc };
@@ -9,6 +9,7 @@ import { stashCopy, copyParam, copyTemplate } from "../_shared/himi-copy.js";
9
9
  import { formatDateMedium, formatMonthDay } from "../_shared/engine-intl.js";
10
10
  import { openRichLink } from "../_shared/rich-content-link.js";
11
11
  import { richBody, ROW_IMAGE_WIDTH } from "../_shared/rich-body.js";
12
+ import { readAccess, assertReadAccess, readAccessDenied, readSignInFlags, NO_READ_SIGN_IN } from "../_shared/member-read.js";
12
13
 
13
14
  // Offline-first (data-offline): the post body is a public read-through — when the
14
15
  // live fetch fails (offline) fall back to the last-synced row the feed cached under
@@ -34,6 +35,7 @@ interface CommentRow {
34
35
  }
35
36
 
36
37
  interface S {
38
+ signInRequired: boolean; noSignIn: boolean; signInScreenId: string;
37
39
  status: "loading" | "ready" | "error";
38
40
  id: string;
39
41
  title: string;
@@ -214,6 +216,7 @@ function derive(s: S): S {
214
216
  }
215
217
 
216
218
  const baseState: S = derive({
219
+ ...NO_READ_SIGN_IN, signInScreenId: "himi_account",
217
220
  status: "loading",
218
221
  id: "",
219
222
  title: "",
@@ -280,23 +283,28 @@ async function cachedPostState(s: S, id: string): Promise<S> {
280
283
  });
281
284
  }
282
285
 
283
- async function loadPostState(s: S): Promise<S> {
286
+ let loadVersion = 0;
287
+ async function loadPostState(s: S): Promise<S | undefined> {
288
+ const version = ++loadVersion;
289
+ await svc.prepare();
290
+ const clean = { ...baseState, signInScreenId: s.signInScreenId };
284
291
  const id = inputId();
285
292
  if (!id) {
286
- return derive({ ...s, status: "ready", emptyText: copyParam("blogPost.notFoundText", "Post not found.") });
293
+ return derive({ ...clean, status: "ready", emptyText: copyParam("blogPost.notFoundText", "Post not found.") });
287
294
  }
288
295
  try {
289
- const [postResult, commentsResult] = await Promise.allSettled([getPost(id), listBlogComments(id)]);
290
- if (postResult.status === "rejected") {
291
- return cachedPostState(s, id);
292
- }
296
+ const access = await readAccess();
297
+ const [postResult, commentsResult] = await Promise.allSettled([getPost(id, {}, { preserveAccessErrors: true }), listBlogComments(id)]);
298
+ if (postResult.status === "rejected") throw postResult.reason;
299
+ await assertReadAccess(access);
300
+ if (version !== loadVersion) return undefined;
293
301
  const post = (((postResult.value as unknown as { post?: WixPost }).post) ?? postResult.value) as PostWithExtras;
294
302
  const commentsUnavailable = commentsResult.status === "rejected";
295
303
  const comments = commentsResult.status === "fulfilled" ? commentsResult.value.map(toCommentRow) : [];
296
304
  const cover = imageUrl(post);
297
305
  const title = post.title || "Untitled post";
298
306
  return derive({
299
- ...s,
307
+ ...clean,
300
308
  status: "ready",
301
309
  id,
302
310
  title,
@@ -319,14 +327,23 @@ async function loadPostState(s: S): Promise<S> {
319
327
  errorText: "",
320
328
  emptyText: "",
321
329
  });
322
- } catch {
323
- return cachedPostState(s, id);
330
+ } catch (error) {
331
+ const flags = await readSignInFlags(error);
332
+ const failed = derive({ ...clean, ...flags, status: "error", id, errorText: copyParam("blogPost.errorText", "This post could not load.") });
333
+ if (version !== loadVersion) return undefined;
334
+ if (readAccessDenied(error)) return failed;
335
+ const access = await readAccess();
336
+ const cached = await cachedPostState(clean, id);
337
+ try { await assertReadAccess(access); }
338
+ catch { return version === loadVersion ? failed : undefined; }
339
+ return version === loadVersion ? cached : undefined;
324
340
  }
325
341
  }
326
342
 
327
343
  const svc = defineService<S, {
328
- load: (s: S, arg?: unknown) => Promise<S>;
329
- retry: (s: S) => Promise<S>;
344
+ prepare: (s: S) => S;
345
+ load: (s: S, arg?: unknown) => Promise<S | undefined>;
346
+ retry: (s: S) => Promise<S | undefined>;
330
347
  like: (s: S) => Promise<S>;
331
348
  unlike: (s: S) => Promise<S>;
332
349
  toggleSave: (s: S) => S;
@@ -338,7 +355,12 @@ const svc = defineService<S, {
338
355
  }>("himiBlogPost", {
339
356
  state: baseState,
340
357
  actions: {
341
- load: (s, arg) => { stashCopy(arg); return loadPostState(s); },
358
+ prepare: (s) => ({ ...s, ...baseState }),
359
+ load: (s, arg) => {
360
+ stashCopy(arg);
361
+ const target = (arg as { signInScreenId?: unknown })?.signInScreenId;
362
+ return loadPostState({ ...s, signInScreenId: target === "himi_sign_in" ? target : s.signInScreenId });
363
+ },
342
364
  retry: (s) => loadPostState({ ...s, status: "loading", errorText: "" }),
343
365
  like: async (s) => {
344
366
  if (!s.id) return derive({ ...s, actionMessage: copyParam("blogPost.noPostMessage", "No post selected.") });
@@ -409,5 +431,6 @@ const svc = defineService<S, {
409
431
  },
410
432
  });
411
433
 
434
+ svc.prepare();
412
435
  svc.load();
413
436
  export { svc };
@@ -1,3 +1,5 @@
1
+ import { descriptionBody } from "../_shared/rich-body.js";
2
+ import { programDescription } from "../_shared/program-description.js";
1
3
  import { fetchMemberBookings, type MemberBookingRow } from "../_shared/member-bookings.js";
2
4
  import { hostSiteFromInput, hostedExploreCards, hostedHiddenFlags, type HostedExploreCard } from "../_shared/branded-lite-hosted.js";
3
5
  import { memberAccess, assertMemberAccess } from "../_shared/member-access.js";
@@ -675,11 +677,9 @@ async function fetchHomePrograms(): Promise<ProgramCard[]> {
675
677
  .map((p: WixProgram) => {
676
678
  const desc = (p as { description?: unknown }).description;
677
679
  const nestedTitle = desc && typeof desc === "object" ? (desc as { title?: string }).title : undefined;
678
- const nestedDetails = desc && typeof desc === "object" ? (desc as { details?: string }).details : undefined;
679
680
  const name = cleanTitle(p.settings?.title ?? nestedTitle ?? p.title) || copyParam("home.programFallbackName", "Program");
680
681
  const image = programImage(p);
681
- const details = (p.settings?.description ?? nestedDetails ?? (typeof desc === "string" ? desc : "") ?? "")
682
- .replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
682
+ const details = descriptionBody(programDescription(p)).bodyText.replace(/\s+/g, " ").trim();
683
683
  return {
684
684
  id: p.id || name,
685
685
  name,