@wix/himalaya-cli 0.1323.0 → 0.1324.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/comments-v1/src/extensions.d.ts +79 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/groups/src/extensions.d.ts +221 -14
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/groups/src/index.d.ts +0 -2
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/social-feed/src/index.d.ts +38 -21
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-comments.mjs +80 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-groups.mjs +45 -17
- package/dist/cli.mjs +3 -2
- package/guides/release-notes.md +25 -0
- package/guides/sdk-reference.json +200 -31
- package/guides/wix-api-usage.md +5 -0
- package/package.json +2 -2
- package/templates/branded-lite/config.ts +0 -7
- package/templates/branded-lite/dev/index.ts +0 -116
- package/templates/branded-lite/himalaya.content.json +0 -3
- package/templates/community-club/config.ts +0 -7
- package/templates/community-club/dev/index.ts +0 -116
- package/templates/community-club/himalaya.content.json +0 -3
- package/templates/events-meetups/config.ts +0 -7
- package/templates/events-meetups/dev/index.ts +0 -116
- package/templates/events-meetups/himalaya.content.json +0 -3
- package/templates/nonprofit-cause/config.ts +0 -7
- package/templates/nonprofit-cause/dev/index.ts +0 -116
- package/templates/nonprofit-cause/himalaya.content.json +0 -3
- package/templates/branded-lite/tier5-src/wix-spaces-create-group/index.ts +0 -29
- package/templates/community-club/tier5-src/wix-spaces-create-group/index.ts +0 -29
- package/templates/events-meetups/tier5-src/wix-spaces-create-group/index.ts +0 -29
- package/templates/nonprofit-cause/tier5-src/wix-spaces-create-group/index.ts +0 -29
|
@@ -12328,25 +12328,6 @@ const SCREENS = runtimeSetting({
|
|
|
12328
12328
|
}
|
|
12329
12329
|
}
|
|
12330
12330
|
},
|
|
12331
|
-
{
|
|
12332
|
-
"id": "himi_groups.new_group",
|
|
12333
|
-
"body": {
|
|
12334
|
-
"package": "himalaya",
|
|
12335
|
-
"type": "Button",
|
|
12336
|
-
"props": {
|
|
12337
|
-
"title": "New Group",
|
|
12338
|
-
"style": "secondary",
|
|
12339
|
-
"fullWidth": true,
|
|
12340
|
-
"leadingIcon": "plus",
|
|
12341
|
-
"action": {
|
|
12342
|
-
"actionId": "himi.open",
|
|
12343
|
-
"params": {
|
|
12344
|
-
"screenId": "himi_create_group"
|
|
12345
|
-
}
|
|
12346
|
-
}
|
|
12347
|
-
}
|
|
12348
|
-
}
|
|
12349
|
-
},
|
|
12350
12331
|
{
|
|
12351
12332
|
"id": "himi_groups.search",
|
|
12352
12333
|
"body": {
|
|
@@ -14727,103 +14708,6 @@ const SCREENS = runtimeSetting({
|
|
|
14727
14708
|
"bundleVersion": "0.0.1"
|
|
14728
14709
|
}
|
|
14729
14710
|
},
|
|
14730
|
-
"himi_create_group": {
|
|
14731
|
-
"screenId": "himi_create_group",
|
|
14732
|
-
"renderer": "sdui_intent",
|
|
14733
|
-
"title": "",
|
|
14734
|
-
"schemaVersion": 1,
|
|
14735
|
-
"cacheControl": {
|
|
14736
|
-
"maxAge": 0,
|
|
14737
|
-
"staleWhileRevalidate": 0
|
|
14738
|
-
},
|
|
14739
|
-
"payload": {
|
|
14740
|
-
"id": "himi_create_group.root",
|
|
14741
|
-
"body": {
|
|
14742
|
-
"package": "himalaya",
|
|
14743
|
-
"type": "VStack",
|
|
14744
|
-
"props": {
|
|
14745
|
-
"spacing": 16,
|
|
14746
|
-
"alignment": "leading",
|
|
14747
|
-
"children": [
|
|
14748
|
-
{
|
|
14749
|
-
"id": "himi_create_group.title",
|
|
14750
|
-
"body": {
|
|
14751
|
-
"package": "himalaya",
|
|
14752
|
-
"type": "Text",
|
|
14753
|
-
"props": {
|
|
14754
|
-
"text": "New Group",
|
|
14755
|
-
"style": "title1"
|
|
14756
|
-
}
|
|
14757
|
-
}
|
|
14758
|
-
},
|
|
14759
|
-
{
|
|
14760
|
-
"id": "",
|
|
14761
|
-
"body": {
|
|
14762
|
-
"package": "himalaya",
|
|
14763
|
-
"type": "Text",
|
|
14764
|
-
"props": {
|
|
14765
|
-
"text": "$service:spacesCreateGroup.hint",
|
|
14766
|
-
"style": "footnote",
|
|
14767
|
-
"color": "textSecondary",
|
|
14768
|
-
"collapseWhenEmpty": true
|
|
14769
|
-
}
|
|
14770
|
-
}
|
|
14771
|
-
},
|
|
14772
|
-
{
|
|
14773
|
-
"id": "himi_create_group.name_field",
|
|
14774
|
-
"body": {
|
|
14775
|
-
"package": "himalaya",
|
|
14776
|
-
"type": "TextField",
|
|
14777
|
-
"props": {
|
|
14778
|
-
"placeholder": "Group name",
|
|
14779
|
-
"value": "",
|
|
14780
|
-
"onChange": {
|
|
14781
|
-
"actionId": "tier5.spacesCreateGroup.setName"
|
|
14782
|
-
}
|
|
14783
|
-
}
|
|
14784
|
-
}
|
|
14785
|
-
},
|
|
14786
|
-
{
|
|
14787
|
-
"id": "himi_create_group.submit",
|
|
14788
|
-
"body": {
|
|
14789
|
-
"package": "himalaya",
|
|
14790
|
-
"type": "Button",
|
|
14791
|
-
"props": {
|
|
14792
|
-
"title": "Create",
|
|
14793
|
-
"style": "primary",
|
|
14794
|
-
"fullWidth": true,
|
|
14795
|
-
"action": {
|
|
14796
|
-
"actionId": "tier5.spacesCreateGroup.submit"
|
|
14797
|
-
}
|
|
14798
|
-
}
|
|
14799
|
-
}
|
|
14800
|
-
}
|
|
14801
|
-
]
|
|
14802
|
-
}
|
|
14803
|
-
},
|
|
14804
|
-
"modifiers": {
|
|
14805
|
-
"background": {
|
|
14806
|
-
"token": "surfacePrimary"
|
|
14807
|
-
},
|
|
14808
|
-
"padding": {
|
|
14809
|
-
"leading": 16,
|
|
14810
|
-
"trailing": 16,
|
|
14811
|
-
"top": 18,
|
|
14812
|
-
"bottom": 28
|
|
14813
|
-
}
|
|
14814
|
-
}
|
|
14815
|
-
},
|
|
14816
|
-
"logicBundle": {
|
|
14817
|
-
"url": "http://localhost:8190/v1/bundles/wix-spaces-create-group?integrity=",
|
|
14818
|
-
"integrity": "",
|
|
14819
|
-
"contentType": "application/javascript+ts-bundle",
|
|
14820
|
-
"declaredCapabilities": [
|
|
14821
|
-
"wix_api"
|
|
14822
|
-
],
|
|
14823
|
-
"minBinaryVersion": "0.1.0",
|
|
14824
|
-
"bundleVersion": "0.0.1"
|
|
14825
|
-
}
|
|
14826
|
-
},
|
|
14827
14711
|
"himi_cms": {
|
|
14828
14712
|
"screenId": "himi_cms",
|
|
14829
14713
|
"renderer": "sdui_intent",
|
|
@@ -178,13 +178,6 @@ export default defineApp({
|
|
|
178
178
|
"parentScreenId": "himi_groups",
|
|
179
179
|
"tabId": "groups"
|
|
180
180
|
},
|
|
181
|
-
{
|
|
182
|
-
"screenId": "himi_create_group",
|
|
183
|
-
"isPublic": false,
|
|
184
|
-
"paramKeys": [],
|
|
185
|
-
"parentScreenId": "himi_groups",
|
|
186
|
-
"tabId": "groups"
|
|
187
|
-
},
|
|
188
181
|
{
|
|
189
182
|
"screenId": "himi_account",
|
|
190
183
|
"isPublic": true,
|
|
@@ -12512,25 +12512,6 @@ const SCREENS = runtimeSetting({
|
|
|
12512
12512
|
}
|
|
12513
12513
|
}
|
|
12514
12514
|
},
|
|
12515
|
-
{
|
|
12516
|
-
"id": "himi_groups.new_group",
|
|
12517
|
-
"body": {
|
|
12518
|
-
"package": "himalaya",
|
|
12519
|
-
"type": "Button",
|
|
12520
|
-
"props": {
|
|
12521
|
-
"title": "New Group",
|
|
12522
|
-
"style": "secondary",
|
|
12523
|
-
"fullWidth": true,
|
|
12524
|
-
"leadingIcon": "plus",
|
|
12525
|
-
"action": {
|
|
12526
|
-
"actionId": "himi.open",
|
|
12527
|
-
"params": {
|
|
12528
|
-
"screenId": "himi_create_group"
|
|
12529
|
-
}
|
|
12530
|
-
}
|
|
12531
|
-
}
|
|
12532
|
-
}
|
|
12533
|
-
},
|
|
12534
12515
|
{
|
|
12535
12516
|
"id": "himi_groups.search",
|
|
12536
12517
|
"body": {
|
|
@@ -14911,103 +14892,6 @@ const SCREENS = runtimeSetting({
|
|
|
14911
14892
|
"bundleVersion": "0.0.1"
|
|
14912
14893
|
}
|
|
14913
14894
|
},
|
|
14914
|
-
"himi_create_group": {
|
|
14915
|
-
"screenId": "himi_create_group",
|
|
14916
|
-
"renderer": "sdui_intent",
|
|
14917
|
-
"title": "",
|
|
14918
|
-
"schemaVersion": 1,
|
|
14919
|
-
"cacheControl": {
|
|
14920
|
-
"maxAge": 0,
|
|
14921
|
-
"staleWhileRevalidate": 0
|
|
14922
|
-
},
|
|
14923
|
-
"payload": {
|
|
14924
|
-
"id": "himi_create_group.root",
|
|
14925
|
-
"body": {
|
|
14926
|
-
"package": "himalaya",
|
|
14927
|
-
"type": "VStack",
|
|
14928
|
-
"props": {
|
|
14929
|
-
"spacing": 16,
|
|
14930
|
-
"alignment": "leading",
|
|
14931
|
-
"children": [
|
|
14932
|
-
{
|
|
14933
|
-
"id": "himi_create_group.title",
|
|
14934
|
-
"body": {
|
|
14935
|
-
"package": "himalaya",
|
|
14936
|
-
"type": "Text",
|
|
14937
|
-
"props": {
|
|
14938
|
-
"text": "New Group",
|
|
14939
|
-
"style": "title1"
|
|
14940
|
-
}
|
|
14941
|
-
}
|
|
14942
|
-
},
|
|
14943
|
-
{
|
|
14944
|
-
"id": "",
|
|
14945
|
-
"body": {
|
|
14946
|
-
"package": "himalaya",
|
|
14947
|
-
"type": "Text",
|
|
14948
|
-
"props": {
|
|
14949
|
-
"text": "$service:spacesCreateGroup.hint",
|
|
14950
|
-
"style": "footnote",
|
|
14951
|
-
"color": "textSecondary",
|
|
14952
|
-
"collapseWhenEmpty": true
|
|
14953
|
-
}
|
|
14954
|
-
}
|
|
14955
|
-
},
|
|
14956
|
-
{
|
|
14957
|
-
"id": "himi_create_group.name_field",
|
|
14958
|
-
"body": {
|
|
14959
|
-
"package": "himalaya",
|
|
14960
|
-
"type": "TextField",
|
|
14961
|
-
"props": {
|
|
14962
|
-
"placeholder": "Group name",
|
|
14963
|
-
"value": "",
|
|
14964
|
-
"onChange": {
|
|
14965
|
-
"actionId": "tier5.spacesCreateGroup.setName"
|
|
14966
|
-
}
|
|
14967
|
-
}
|
|
14968
|
-
}
|
|
14969
|
-
},
|
|
14970
|
-
{
|
|
14971
|
-
"id": "himi_create_group.submit",
|
|
14972
|
-
"body": {
|
|
14973
|
-
"package": "himalaya",
|
|
14974
|
-
"type": "Button",
|
|
14975
|
-
"props": {
|
|
14976
|
-
"title": "Create",
|
|
14977
|
-
"style": "primary",
|
|
14978
|
-
"fullWidth": true,
|
|
14979
|
-
"action": {
|
|
14980
|
-
"actionId": "tier5.spacesCreateGroup.submit"
|
|
14981
|
-
}
|
|
14982
|
-
}
|
|
14983
|
-
}
|
|
14984
|
-
}
|
|
14985
|
-
]
|
|
14986
|
-
}
|
|
14987
|
-
},
|
|
14988
|
-
"modifiers": {
|
|
14989
|
-
"background": {
|
|
14990
|
-
"token": "surfacePrimary"
|
|
14991
|
-
},
|
|
14992
|
-
"padding": {
|
|
14993
|
-
"leading": 16,
|
|
14994
|
-
"trailing": 16,
|
|
14995
|
-
"top": 18,
|
|
14996
|
-
"bottom": 28
|
|
14997
|
-
}
|
|
14998
|
-
}
|
|
14999
|
-
},
|
|
15000
|
-
"logicBundle": {
|
|
15001
|
-
"url": "http://localhost:8190/v1/bundles/wix-spaces-create-group?integrity=",
|
|
15002
|
-
"integrity": "",
|
|
15003
|
-
"contentType": "application/javascript+ts-bundle",
|
|
15004
|
-
"declaredCapabilities": [
|
|
15005
|
-
"wix_api"
|
|
15006
|
-
],
|
|
15007
|
-
"minBinaryVersion": "0.1.0",
|
|
15008
|
-
"bundleVersion": "0.0.1"
|
|
15009
|
-
}
|
|
15010
|
-
},
|
|
15011
14895
|
}) as Record<string, unknown>;
|
|
15012
14896
|
|
|
15013
14897
|
// The language destination stays registered for deep links and future translations. Keep its
|
|
@@ -210,13 +210,6 @@ export default defineApp({
|
|
|
210
210
|
"parentScreenId": "himi_groups",
|
|
211
211
|
"tabId": ""
|
|
212
212
|
},
|
|
213
|
-
{
|
|
214
|
-
"screenId": "himi_create_group",
|
|
215
|
-
"isPublic": false,
|
|
216
|
-
"paramKeys": [],
|
|
217
|
-
"parentScreenId": "himi_groups",
|
|
218
|
-
"tabId": ""
|
|
219
|
-
},
|
|
220
213
|
{
|
|
221
214
|
"screenId": "himi_account",
|
|
222
215
|
"isPublic": true,
|
|
@@ -15799,25 +15799,6 @@ const SCREENS = runtimeSetting({
|
|
|
15799
15799
|
}
|
|
15800
15800
|
}
|
|
15801
15801
|
},
|
|
15802
|
-
{
|
|
15803
|
-
"id": "himi_groups.new_group",
|
|
15804
|
-
"body": {
|
|
15805
|
-
"package": "himalaya",
|
|
15806
|
-
"type": "Button",
|
|
15807
|
-
"props": {
|
|
15808
|
-
"title": "New Group",
|
|
15809
|
-
"style": "secondary",
|
|
15810
|
-
"fullWidth": true,
|
|
15811
|
-
"leadingIcon": "plus",
|
|
15812
|
-
"action": {
|
|
15813
|
-
"actionId": "himi.open",
|
|
15814
|
-
"params": {
|
|
15815
|
-
"screenId": "himi_create_group"
|
|
15816
|
-
}
|
|
15817
|
-
}
|
|
15818
|
-
}
|
|
15819
|
-
}
|
|
15820
|
-
},
|
|
15821
15802
|
{
|
|
15822
15803
|
"id": "himi_groups.search",
|
|
15823
15804
|
"body": {
|
|
@@ -18198,103 +18179,6 @@ const SCREENS = runtimeSetting({
|
|
|
18198
18179
|
"bundleVersion": "0.0.1"
|
|
18199
18180
|
}
|
|
18200
18181
|
},
|
|
18201
|
-
"himi_create_group": {
|
|
18202
|
-
"screenId": "himi_create_group",
|
|
18203
|
-
"renderer": "sdui_intent",
|
|
18204
|
-
"title": "",
|
|
18205
|
-
"schemaVersion": 1,
|
|
18206
|
-
"cacheControl": {
|
|
18207
|
-
"maxAge": 0,
|
|
18208
|
-
"staleWhileRevalidate": 0
|
|
18209
|
-
},
|
|
18210
|
-
"payload": {
|
|
18211
|
-
"id": "himi_create_group.root",
|
|
18212
|
-
"body": {
|
|
18213
|
-
"package": "himalaya",
|
|
18214
|
-
"type": "VStack",
|
|
18215
|
-
"props": {
|
|
18216
|
-
"spacing": 16,
|
|
18217
|
-
"alignment": "leading",
|
|
18218
|
-
"children": [
|
|
18219
|
-
{
|
|
18220
|
-
"id": "himi_create_group.title",
|
|
18221
|
-
"body": {
|
|
18222
|
-
"package": "himalaya",
|
|
18223
|
-
"type": "Text",
|
|
18224
|
-
"props": {
|
|
18225
|
-
"text": "New Group",
|
|
18226
|
-
"style": "title1"
|
|
18227
|
-
}
|
|
18228
|
-
}
|
|
18229
|
-
},
|
|
18230
|
-
{
|
|
18231
|
-
"id": "",
|
|
18232
|
-
"body": {
|
|
18233
|
-
"package": "himalaya",
|
|
18234
|
-
"type": "Text",
|
|
18235
|
-
"props": {
|
|
18236
|
-
"text": "$service:spacesCreateGroup.hint",
|
|
18237
|
-
"style": "footnote",
|
|
18238
|
-
"color": "textSecondary",
|
|
18239
|
-
"collapseWhenEmpty": true
|
|
18240
|
-
}
|
|
18241
|
-
}
|
|
18242
|
-
},
|
|
18243
|
-
{
|
|
18244
|
-
"id": "himi_create_group.name_field",
|
|
18245
|
-
"body": {
|
|
18246
|
-
"package": "himalaya",
|
|
18247
|
-
"type": "TextField",
|
|
18248
|
-
"props": {
|
|
18249
|
-
"placeholder": "Group name",
|
|
18250
|
-
"value": "",
|
|
18251
|
-
"onChange": {
|
|
18252
|
-
"actionId": "tier5.spacesCreateGroup.setName"
|
|
18253
|
-
}
|
|
18254
|
-
}
|
|
18255
|
-
}
|
|
18256
|
-
},
|
|
18257
|
-
{
|
|
18258
|
-
"id": "himi_create_group.submit",
|
|
18259
|
-
"body": {
|
|
18260
|
-
"package": "himalaya",
|
|
18261
|
-
"type": "Button",
|
|
18262
|
-
"props": {
|
|
18263
|
-
"title": "Create",
|
|
18264
|
-
"style": "primary",
|
|
18265
|
-
"fullWidth": true,
|
|
18266
|
-
"action": {
|
|
18267
|
-
"actionId": "tier5.spacesCreateGroup.submit"
|
|
18268
|
-
}
|
|
18269
|
-
}
|
|
18270
|
-
}
|
|
18271
|
-
}
|
|
18272
|
-
]
|
|
18273
|
-
}
|
|
18274
|
-
},
|
|
18275
|
-
"modifiers": {
|
|
18276
|
-
"background": {
|
|
18277
|
-
"token": "surfacePrimary"
|
|
18278
|
-
},
|
|
18279
|
-
"padding": {
|
|
18280
|
-
"leading": 16,
|
|
18281
|
-
"trailing": 16,
|
|
18282
|
-
"top": 18,
|
|
18283
|
-
"bottom": 28
|
|
18284
|
-
}
|
|
18285
|
-
}
|
|
18286
|
-
},
|
|
18287
|
-
"logicBundle": {
|
|
18288
|
-
"url": "http://localhost:8190/v1/bundles/wix-spaces-create-group?integrity=",
|
|
18289
|
-
"integrity": "",
|
|
18290
|
-
"contentType": "application/javascript+ts-bundle",
|
|
18291
|
-
"declaredCapabilities": [
|
|
18292
|
-
"wix_api"
|
|
18293
|
-
],
|
|
18294
|
-
"minBinaryVersion": "0.1.0",
|
|
18295
|
-
"bundleVersion": "0.0.1"
|
|
18296
|
-
}
|
|
18297
|
-
},
|
|
18298
18182
|
}) as Record<string, unknown>;
|
|
18299
18183
|
|
|
18300
18184
|
// The language destination stays registered for deep links and future translations. Keep its
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Tier-5 bundle: Wix Spaces clone — Create group (ON-DEVICE form, REAL WRITE).
|
|
2
|
-
// submit creates a real group via the Wix Social Groups API; it then shows up in
|
|
3
|
-
// ws_groups. Creating groups is a genuine member action in Spaces.
|
|
4
|
-
import { defineService } from "@himalaya/state";
|
|
5
|
-
import { createGroup } from "@himalaya/wix-groups";
|
|
6
|
-
|
|
7
|
-
interface S { status: "ready" | "posting"; name: string; hint: string }
|
|
8
|
-
|
|
9
|
-
function val(arg?: unknown): string {
|
|
10
|
-
return typeof arg === "string" ? arg : ((arg as { value?: string; text?: string })?.value ?? (arg as { text?: string })?.text ?? "");
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const svc = defineService<S, { setName: (s: S, a?: unknown) => S; submit: (s: S) => Promise<S> }>("spacesCreateGroup", {
|
|
14
|
-
state: { status: "ready", name: "", hint: "Start a group for your community." },
|
|
15
|
-
actions: {
|
|
16
|
-
setName: (s, a) => ({ ...s, name: val(a) }),
|
|
17
|
-
submit: async (s) => {
|
|
18
|
-
const name = s.name.trim();
|
|
19
|
-
if (!name) return { ...s, hint: "Please enter a group name." };
|
|
20
|
-
try {
|
|
21
|
-
await createGroup({ name, privacyStatus: "PUBLIC" });
|
|
22
|
-
return { status: "ready", name: "", hint: `Created “${name}” ✓ — it now appears in Groups.` };
|
|
23
|
-
} catch {
|
|
24
|
-
return { ...s, status: "ready", hint: "Couldn't create the group — try again." };
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
export { svc };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Tier-5 bundle: Wix Spaces clone — Create group (ON-DEVICE form, REAL WRITE).
|
|
2
|
-
// submit creates a real group via the Wix Social Groups API; it then shows up in
|
|
3
|
-
// ws_groups. Creating groups is a genuine member action in Spaces.
|
|
4
|
-
import { defineService } from "@himalaya/state";
|
|
5
|
-
import { createGroup } from "@himalaya/wix-groups";
|
|
6
|
-
|
|
7
|
-
interface S { status: "ready" | "posting"; name: string; hint: string }
|
|
8
|
-
|
|
9
|
-
function val(arg?: unknown): string {
|
|
10
|
-
return typeof arg === "string" ? arg : ((arg as { value?: string; text?: string })?.value ?? (arg as { text?: string })?.text ?? "");
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const svc = defineService<S, { setName: (s: S, a?: unknown) => S; submit: (s: S) => Promise<S> }>("spacesCreateGroup", {
|
|
14
|
-
state: { status: "ready", name: "", hint: "Start a group for your community." },
|
|
15
|
-
actions: {
|
|
16
|
-
setName: (s, a) => ({ ...s, name: val(a) }),
|
|
17
|
-
submit: async (s) => {
|
|
18
|
-
const name = s.name.trim();
|
|
19
|
-
if (!name) return { ...s, hint: "Please enter a group name." };
|
|
20
|
-
try {
|
|
21
|
-
await createGroup({ name, privacyStatus: "PUBLIC" });
|
|
22
|
-
return { status: "ready", name: "", hint: `Created “${name}” ✓ — it now appears in Groups.` };
|
|
23
|
-
} catch {
|
|
24
|
-
return { ...s, status: "ready", hint: "Couldn't create the group — try again." };
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
export { svc };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Tier-5 bundle: Wix Spaces clone — Create group (ON-DEVICE form, REAL WRITE).
|
|
2
|
-
// submit creates a real group via the Wix Social Groups API; it then shows up in
|
|
3
|
-
// ws_groups. Creating groups is a genuine member action in Spaces.
|
|
4
|
-
import { defineService } from "@himalaya/state";
|
|
5
|
-
import { createGroup } from "@himalaya/wix-groups";
|
|
6
|
-
|
|
7
|
-
interface S { status: "ready" | "posting"; name: string; hint: string }
|
|
8
|
-
|
|
9
|
-
function val(arg?: unknown): string {
|
|
10
|
-
return typeof arg === "string" ? arg : ((arg as { value?: string; text?: string })?.value ?? (arg as { text?: string })?.text ?? "");
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const svc = defineService<S, { setName: (s: S, a?: unknown) => S; submit: (s: S) => Promise<S> }>("spacesCreateGroup", {
|
|
14
|
-
state: { status: "ready", name: "", hint: "Start a group for your community." },
|
|
15
|
-
actions: {
|
|
16
|
-
setName: (s, a) => ({ ...s, name: val(a) }),
|
|
17
|
-
submit: async (s) => {
|
|
18
|
-
const name = s.name.trim();
|
|
19
|
-
if (!name) return { ...s, hint: "Please enter a group name." };
|
|
20
|
-
try {
|
|
21
|
-
await createGroup({ name, privacyStatus: "PUBLIC" });
|
|
22
|
-
return { status: "ready", name: "", hint: `Created “${name}” ✓ — it now appears in Groups.` };
|
|
23
|
-
} catch {
|
|
24
|
-
return { ...s, status: "ready", hint: "Couldn't create the group — try again." };
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
export { svc };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Tier-5 bundle: Wix Spaces clone — Create group (ON-DEVICE form, REAL WRITE).
|
|
2
|
-
// submit creates a real group via the Wix Social Groups API; it then shows up in
|
|
3
|
-
// ws_groups. Creating groups is a genuine member action in Spaces.
|
|
4
|
-
import { defineService } from "@himalaya/state";
|
|
5
|
-
import { createGroup } from "@himalaya/wix-groups";
|
|
6
|
-
|
|
7
|
-
interface S { status: "ready" | "posting"; name: string; hint: string }
|
|
8
|
-
|
|
9
|
-
function val(arg?: unknown): string {
|
|
10
|
-
return typeof arg === "string" ? arg : ((arg as { value?: string; text?: string })?.value ?? (arg as { text?: string })?.text ?? "");
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const svc = defineService<S, { setName: (s: S, a?: unknown) => S; submit: (s: S) => Promise<S> }>("spacesCreateGroup", {
|
|
14
|
-
state: { status: "ready", name: "", hint: "Start a group for your community." },
|
|
15
|
-
actions: {
|
|
16
|
-
setName: (s, a) => ({ ...s, name: val(a) }),
|
|
17
|
-
submit: async (s) => {
|
|
18
|
-
const name = s.name.trim();
|
|
19
|
-
if (!name) return { ...s, hint: "Please enter a group name." };
|
|
20
|
-
try {
|
|
21
|
-
await createGroup({ name, privacyStatus: "PUBLIC" });
|
|
22
|
-
return { status: "ready", name: "", hint: `Created “${name}” ✓ — it now appears in Groups.` };
|
|
23
|
-
} catch {
|
|
24
|
-
return { ...s, status: "ready", hint: "Couldn't create the group — try again." };
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
export { svc };
|