@oxyhq/services 27.0.0 → 27.1.1
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/lib/commonjs/index.js +41 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +3 -5
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/FollowTargetButton.js +323 -0
- package/lib/commonjs/ui/components/FollowTargetButton.js.map +1 -0
- package/lib/commonjs/ui/hooks/useFollowTarget.js +147 -0
- package/lib/commonjs/ui/hooks/useFollowTarget.js.map +1 -0
- package/lib/commonjs/ui/screens/AccountMembersScreen.js +49 -6
- package/lib/commonjs/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/commonjs/ui/stores/followTargetStore.js +113 -0
- package/lib/commonjs/ui/stores/followTargetStore.js.map +1 -0
- package/lib/commonjs/ui/stores/resetSessionScopedStores.js +2 -0
- package/lib/commonjs/ui/stores/resetSessionScopedStores.js.map +1 -1
- package/lib/module/index.js +8 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +3 -5
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/FollowTargetButton.js +317 -0
- package/lib/module/ui/components/FollowTargetButton.js.map +1 -0
- package/lib/module/ui/hooks/useFollowTarget.js +143 -0
- package/lib/module/ui/hooks/useFollowTarget.js.map +1 -0
- package/lib/module/ui/screens/AccountMembersScreen.js +49 -6
- package/lib/module/ui/screens/AccountMembersScreen.js.map +1 -1
- package/lib/module/ui/stores/followTargetStore.js +107 -0
- package/lib/module/ui/stores/followTargetStore.js.map +1 -0
- package/lib/module/ui/stores/resetSessionScopedStores.js +2 -0
- package/lib/module/ui/stores/resetSessionScopedStores.js.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +5 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/FollowTargetButton.d.ts +130 -0
- package/lib/typescript/commonjs/ui/components/FollowTargetButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useFollowTarget.d.ts +50 -0
- package/lib/typescript/commonjs/ui/hooks/useFollowTarget.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/AccountMembersScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/stores/followTargetStore.d.ts +70 -0
- package/lib/typescript/commonjs/ui/stores/followTargetStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/stores/resetSessionScopedStores.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +5 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FollowButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/FollowTargetButton.d.ts +130 -0
- package/lib/typescript/module/ui/components/FollowTargetButton.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useFollowTarget.d.ts +50 -0
- package/lib/typescript/module/ui/hooks/useFollowTarget.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/AccountMembersScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/stores/followTargetStore.d.ts +70 -0
- package/lib/typescript/module/ui/stores/followTargetStore.d.ts.map +1 -0
- package/lib/typescript/module/ui/stores/resetSessionScopedStores.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +19 -0
- package/src/ui/components/FollowButton.tsx +3 -5
- package/src/ui/components/FollowTargetButton.tsx +356 -0
- package/src/ui/components/__tests__/followTargetButton.test.ts +152 -0
- package/src/ui/hooks/useFollowTarget.ts +211 -0
- package/src/ui/screens/AccountMembersScreen.tsx +62 -6
- package/src/ui/stores/__tests__/resetSessionScopedStores.test.ts +23 -0
- package/src/ui/stores/followTargetStore.ts +119 -0
- package/src/ui/stores/resetSessionScopedStores.ts +2 -0
package/lib/commonjs/index.js
CHANGED
|
@@ -39,6 +39,12 @@ Object.defineProperty(exports, "FollowButton", {
|
|
|
39
39
|
return _FollowButton.default;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
+
Object.defineProperty(exports, "FollowTargetButton", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _FollowTargetButton.FollowTargetButton;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
42
48
|
Object.defineProperty(exports, "IdentityBoundSessionError", {
|
|
43
49
|
enumerable: true,
|
|
44
50
|
get: function () {
|
|
@@ -159,6 +165,12 @@ Object.defineProperty(exports, "SurfaceHeaderAction", {
|
|
|
159
165
|
return _SurfaceHeaderAction.SurfaceHeaderAction;
|
|
160
166
|
}
|
|
161
167
|
});
|
|
168
|
+
Object.defineProperty(exports, "UNKNOWN_FOLLOW_STATUS", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return _followTargetStore.UNKNOWN_FOLLOW_STATUS;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
162
174
|
Object.defineProperty(exports, "clearedFieldsFromAccountUpdate", {
|
|
163
175
|
enumerable: true,
|
|
164
176
|
get: function () {
|
|
@@ -267,6 +279,12 @@ Object.defineProperty(exports, "invalidateUserQueries", {
|
|
|
267
279
|
return _queryKeys.invalidateUserQueries;
|
|
268
280
|
}
|
|
269
281
|
});
|
|
282
|
+
Object.defineProperty(exports, "isFollowedGlobally", {
|
|
283
|
+
enumerable: true,
|
|
284
|
+
get: function () {
|
|
285
|
+
return _followTargetStore.isFollowedGlobally;
|
|
286
|
+
}
|
|
287
|
+
});
|
|
270
288
|
Object.defineProperty(exports, "isInvalidSessionError", {
|
|
271
289
|
enumerable: true,
|
|
272
290
|
get: function () {
|
|
@@ -453,6 +471,18 @@ Object.defineProperty(exports, "useFollow", {
|
|
|
453
471
|
return _useFollow.useFollow;
|
|
454
472
|
}
|
|
455
473
|
});
|
|
474
|
+
Object.defineProperty(exports, "useFollowTarget", {
|
|
475
|
+
enumerable: true,
|
|
476
|
+
get: function () {
|
|
477
|
+
return _useFollowTarget.useFollowTarget;
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
Object.defineProperty(exports, "useFollowTargetStore", {
|
|
481
|
+
enumerable: true,
|
|
482
|
+
get: function () {
|
|
483
|
+
return _followTargetStore.useFollowTargetStore;
|
|
484
|
+
}
|
|
485
|
+
});
|
|
456
486
|
Object.defineProperty(exports, "useFollowerCounts", {
|
|
457
487
|
enumerable: true,
|
|
458
488
|
get: function () {
|
|
@@ -699,6 +729,12 @@ Object.defineProperty(exports, "useUsersBySessions", {
|
|
|
699
729
|
return _useAccountQueries.useUsersBySessions;
|
|
700
730
|
}
|
|
701
731
|
});
|
|
732
|
+
Object.defineProperty(exports, "withApplicationMode", {
|
|
733
|
+
enumerable: true,
|
|
734
|
+
get: function () {
|
|
735
|
+
return _followTargetStore.withApplicationMode;
|
|
736
|
+
}
|
|
737
|
+
});
|
|
702
738
|
var _core = require("@oxyhq/core");
|
|
703
739
|
var _reactNative = require("react-native");
|
|
704
740
|
var _OxyProvider = _interopRequireDefault(require("./ui/components/OxyProvider.js"));
|
|
@@ -735,6 +771,9 @@ var _OxyOAuthCallback = require("./ui/components/OxyOAuthCallback.js");
|
|
|
735
771
|
var _OxyConsentScreen = require("./ui/components/OxyConsentScreen.js");
|
|
736
772
|
var _RequireOxyAuth = require("./ui/components/RequireOxyAuth.js");
|
|
737
773
|
var _FollowButton = _interopRequireDefault(require("./ui/components/FollowButton.js"));
|
|
774
|
+
var _FollowTargetButton = require("./ui/components/FollowTargetButton.js");
|
|
775
|
+
var _useFollowTarget = require("./ui/hooks/useFollowTarget.js");
|
|
776
|
+
var _followTargetStore = require("./ui/stores/followTargetStore.js");
|
|
738
777
|
var _OxyPayButton = _interopRequireDefault(require("./ui/components/OxyPayButton.js"));
|
|
739
778
|
var _LogoIcon = require("./ui/components/logo/LogoIcon.js");
|
|
740
779
|
var _LogoText = require("./ui/components/logo/LogoText.js");
|
|
@@ -872,6 +911,8 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
872
911
|
// Gates on `useOxy().canUsePrivateApi` / `isPrivateApiPending` — never flashes the
|
|
873
912
|
// wall before the device-first cold boot resolves. Opens the ONE account dialog.
|
|
874
913
|
|
|
914
|
+
// The follow graph (#809): follows anything registered, not just users.
|
|
915
|
+
|
|
875
916
|
// Sidebar account trigger. Pressing `ProfileButton` opens the unified
|
|
876
917
|
// `OxyAccountDialogScreen` (the single account switcher + sign-in surface) via
|
|
877
918
|
// `useOxy().openAccountDialog`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","_reactNative","_OxyProvider","_interopRequireDefault","_OxyContext","_useAuth","_identityBinding","_authStore","_accountStore","_assetStore","_useAssets","_useFileDownloadUrl","_useFollow","_useStorage","_useAccountQueries","_useServicesQueries","_useSecurityQueries","_useAuthMethods","_usePaymentQueries","_useAccountMutations","_useServicesMutations","_mutationFactory","_mutationKeys","_queryKeys","_userCache","_useMutationStatus","_useOnlineStatus","_useOxyEvent","_errorHandlers","_useFileFiltering","_OxySignInButton","_oauthPopup","_OxyAuthPrompt","_OxyOAuthCallback","_OxyConsentScreen","_RequireOxyAuth","_FollowButton","_OxyPayButton","_LogoIcon","_LogoText","_ProfileButton","_OxyAuthChooser","_OxySignInRequestSurface","_useSwitchableAccounts","_ProfileScreen","_ManageAccountScreen","_NotificationsScreen","_PreferencesScreen","_ConnectedAppsScreen","_CreateAccountScreen","_AccountMembersScreen","_AccountSettingsScreen","_bottomSheetManager","_useSurfaceHeader","_SurfaceHeaderAction","_accountDialogManager","e","__esModule","default","setPlatformOS","Platform","OS"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_core","require","_reactNative","_OxyProvider","_interopRequireDefault","_OxyContext","_useAuth","_identityBinding","_authStore","_accountStore","_assetStore","_useAssets","_useFileDownloadUrl","_useFollow","_useStorage","_useAccountQueries","_useServicesQueries","_useSecurityQueries","_useAuthMethods","_usePaymentQueries","_useAccountMutations","_useServicesMutations","_mutationFactory","_mutationKeys","_queryKeys","_userCache","_useMutationStatus","_useOnlineStatus","_useOxyEvent","_errorHandlers","_useFileFiltering","_OxySignInButton","_oauthPopup","_OxyAuthPrompt","_OxyOAuthCallback","_OxyConsentScreen","_RequireOxyAuth","_FollowButton","_FollowTargetButton","_useFollowTarget","_followTargetStore","_OxyPayButton","_LogoIcon","_LogoText","_ProfileButton","_OxyAuthChooser","_OxySignInRequestSurface","_useSwitchableAccounts","_ProfileScreen","_ManageAccountScreen","_NotificationsScreen","_PreferencesScreen","_ConnectedAppsScreen","_CreateAccountScreen","_AccountMembersScreen","_AccountSettingsScreen","_bottomSheetManager","_useSurfaceHeader","_SurfaceHeaderAction","_accountDialogManager","e","__esModule","default","setPlatformOS","Platform","OS"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAnX9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAIA,IAAAG,mBAAa,EAACC,qBAAQ,CAACC,EAAgB,CAAC;;AAExC;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;;AAgBA;AACA;AACA;;AAOA;AACA;AACA;;AAgCA;;AAeA;AACA;AACA;;AA2BA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;;AAcA;;AAMA;AACA;AACA;;AASA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAQA;AACA;AACA;AACA;;AAsBA;AACA;AACA;AACA;AACA;;AAMA;;AAuBA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;;AAIA;;AAOA;;AAKA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.FollowButton = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
8
9
|
var _OxyContext = require("../context/OxyContext.js");
|
|
9
10
|
var _toast = require("@oxyhq/bloom/toast");
|
|
10
11
|
var _button = require("@oxyhq/bloom/button");
|
|
11
|
-
var _loading = require("@oxyhq/bloom/loading");
|
|
12
12
|
var _useFollow = require("../hooks/useFollow.js");
|
|
13
13
|
var _followStore = require("../stores/followStore.js");
|
|
14
14
|
var _theme = require("@oxyhq/bloom/theme");
|
|
@@ -89,8 +89,7 @@ const FollowButtonInner = /*#__PURE__*/(0, _react.memo)(function FollowButtonInn
|
|
|
89
89
|
disabled: disabled || isBusy,
|
|
90
90
|
style: style,
|
|
91
91
|
textStyle: textStyle,
|
|
92
|
-
icon: showSpinner ? /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
93
|
-
variant: "inline",
|
|
92
|
+
icon: showSpinner ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
94
93
|
size: "small",
|
|
95
94
|
color: showFollowing ? colors.text : colors.primaryForeground
|
|
96
95
|
}) : undefined,
|
|
@@ -200,8 +199,7 @@ const FollowButtonMultiInner = /*#__PURE__*/(0, _react.memo)(function FollowButt
|
|
|
200
199
|
disabled: disabled || isLoading,
|
|
201
200
|
style: style,
|
|
202
201
|
textStyle: textStyle,
|
|
203
|
-
icon: showSpinner ? /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
204
|
-
variant: "inline",
|
|
202
|
+
icon: showSpinner ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
205
203
|
size: "small",
|
|
206
204
|
color: allFollowing ? colors.text : colors.primaryForeground
|
|
207
205
|
}) : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_OxyContext","_toast","_button","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_OxyContext","_toast","_button","_useFollow","_followStore","_theme","_shallow","_jsxRuntime","DEFAULT_FOLLOW_ALL_LABEL","DEFAULT_FOLLOWED_ALL_LABEL","isMultiMode","props","Array","isArray","userIds","FollowButtonInner","memo","userId","oxyServices","initiallyFollowing","size","onFollowChange","style","textStyle","disabled","showLoadingState","preventParentActions","colors","useTheme","isFollowing","isKnown","isLoading","toggleFollow","resolveStatus","useFollowForButton","handlePress","useCallback","event","preventDefault","stopPropagation","err","error","Error","String","toast","message","useEffect","isBusy","showFollowing","showSpinner","jsx","Button","variant","onPress","icon","ActivityIndicator","color","text","primaryForeground","undefined","children","FollowButtonMultiInner","initiallyAllFollowing","followAllLabel","followedAllLabel","onBulkFollow","onBulkUnfollow","follow","useFollow","followAllUsers","unfollowAllUsers","isAnyLoading","initialFollowStatuses","useFollowStore","useShallow","state","statuses","uid","Object","prototype","hasOwnProperty","call","followingUsers","hasKnownNotFollowing","some","storeAllFollowing","allFollowing","fetchAllStatuses","isSubmitting","setIsSubmitting","useState","result","allAlreadyFollowing","followedCount","results","length","every","entry","alreadyFollowing","anyFollowed","success","FollowButton","canUsePrivateApi","user","currentUser","useOxy","currentUserId","id","trim","rawUserIds","multiUserIds","useMemo","seen","Set","cleaned","raw","has","add","push","targetUserId","exports","_default","default"],"sourceRoot":"../../../../src","sources":["ui/components/FollowButton.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAEA,IAAAQ,QAAA,GAAAR,OAAA;AAAmD,IAAAS,WAAA,GAAAT,OAAA;AAEnD,MAAMU,wBAAwB,GAAG,YAAY;AAC7C,MAAMC,0BAA0B,GAAG,WAAW;;AAE9C;;AAYA;;AAOA;;AAWA;AACA;AACA;AACA;;AAGA,MAAMC,WAAW,GAAIC,KAAwB,IAC3C,SAAS,IAAIA,KAAK,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAACG,OAAO,CAAC;AAEpD,MAAMC,iBAAiB,gBAAG,IAAAC,WAAI,EAAC,SAASD,iBAAiBA,CAAC;EACxDE,MAAM;EACNC,WAAW;EACXC,kBAAkB;EAClBC,IAAI,GAAG,QAAQ;EACfC,cAAc;EACdC,KAAK;EACLC,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ACb;EAEA,IAAI5F,WAAW,CAACC,KAAK,CAAC,EAAE;IACtB,IAAImG,YAAY,CAACf,MAAM,KAAK,CAAC,EAAE;MAC7B,OAAO,IAAI;IACb;IACA,oBACE,IAAAxF,WAAA,CAAA2C,GAAA,EAACW,sBAAsB;MAAA,GACjBlD,KAAK;MACTG,OAAO,EAAEgG;IAAa,CACvB,CAAC;EAEN;EAEA,MAAMS,YAAY,GAAG5G,KAAK,CAACM,MAAM,GAAG0B,MAAM,CAAChC,KAAK,CAACM,MAAM,CAAC,CAAC2F,IAAI,CAAC,CAAC,GAAG,EAAE;EACpE,IAAI,CAACW,YAAY,IAAKb,aAAa,IAAIA,aAAa,KAAKa,YAAa,EAAE;IACtE,OAAO,IAAI;EACb;EAEA,oBACE,IAAAhH,WAAA,CAAA2C,GAAA,EAACnC,iBAAiB;IAAA,GACZJ,KAAK;IACTM,MAAM,EAAEsG,YAAa;IACrBrG,WAAW,EAAEA;EAAY,CAC1B,CAAC;AAEN,CAAC;AAACsG,OAAA,CAAAnB,YAAA,GAAAA,YAAA;AAAA,IAAAoB,QAAA,GAAAD,OAAA,CAAAE,OAAA,GAGarB,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FollowTargetButton = void 0;
|
|
7
|
+
exports.buildFollowMenuItems = buildFollowMenuItems;
|
|
8
|
+
exports.resolveFollowPrimaryAction = resolveFollowPrimaryAction;
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
var _button = require("@oxyhq/bloom/button");
|
|
12
|
+
var _icons = require("@oxyhq/bloom/icons");
|
|
13
|
+
var _menu = require("@oxyhq/bloom/menu");
|
|
14
|
+
var _toast = require("@oxyhq/bloom/toast");
|
|
15
|
+
var _useFollowTarget = require("../hooks/useFollowTarget.js");
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
/**
|
|
18
|
+
* `FollowTargetButton` — one button for everything an Oxy user can follow.
|
|
19
|
+
*
|
|
20
|
+
* Follows a TARGET of any registered kind: a person, a topic, a channel, a
|
|
21
|
+
* store, an artist. Nothing in this file branches on what the target is, which
|
|
22
|
+
* is the property that lets an application this package has never heard of use
|
|
23
|
+
* it without a release.
|
|
24
|
+
*
|
|
25
|
+
* ## Two controls, not one
|
|
26
|
+
*
|
|
27
|
+
* The main press does the obvious thing. The chevron beside it opens the
|
|
28
|
+
* choices that a single press cannot express — follow for a while, stop showing
|
|
29
|
+
* this here without giving it up everywhere — and those belong behind a
|
|
30
|
+
* disclosure precisely because they are not what most people want most of the
|
|
31
|
+
* time. Bloom's `Menu` renders as a bottom sheet on native and a dropdown on
|
|
32
|
+
* web, so this is one component and not a platform fork.
|
|
33
|
+
*
|
|
34
|
+
* ## Verbs
|
|
35
|
+
*
|
|
36
|
+
* "Follow" is wrong for half the things in the ecosystem: you subscribe to a
|
|
37
|
+
* channel, you join a community, you watch a listing. The verb is a prop with a
|
|
38
|
+
* small vocabulary of defaults and a full override, rather than a lookup keyed
|
|
39
|
+
* on kind — a kind→verb table in this package would need a release every time
|
|
40
|
+
* an application invents a kind, which is exactly the coupling #809 removes.
|
|
41
|
+
*
|
|
42
|
+
* ## Relationship to the legacy `FollowButton`
|
|
43
|
+
*
|
|
44
|
+
* `FollowButton` follows a USER through the Mongo-backed social graph and
|
|
45
|
+
* remains the correct component for that until the user graph is migrated onto
|
|
46
|
+
* `/v2/follows`. When it is, that component is deleted and this one takes the
|
|
47
|
+
* name — not aliased, not deprecated in place.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The small vocabulary of verbs the ecosystem actually uses. An application
|
|
52
|
+
* whose verb is not here passes `labels` instead — the escape hatch exists so
|
|
53
|
+
* this union never has to grow to accommodate one product's wording.
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
const VERB_LABELS = {
|
|
57
|
+
follow: {
|
|
58
|
+
idle: 'Follow',
|
|
59
|
+
active: 'Following',
|
|
60
|
+
pending: 'Requested',
|
|
61
|
+
disabled: 'Off here'
|
|
62
|
+
},
|
|
63
|
+
subscribe: {
|
|
64
|
+
idle: 'Subscribe',
|
|
65
|
+
active: 'Subscribed',
|
|
66
|
+
pending: 'Requested',
|
|
67
|
+
disabled: 'Off here'
|
|
68
|
+
},
|
|
69
|
+
join: {
|
|
70
|
+
idle: 'Join',
|
|
71
|
+
active: 'Joined',
|
|
72
|
+
pending: 'Requested',
|
|
73
|
+
disabled: 'Off here'
|
|
74
|
+
},
|
|
75
|
+
watch: {
|
|
76
|
+
idle: 'Watch',
|
|
77
|
+
active: 'Watching',
|
|
78
|
+
pending: 'Requested',
|
|
79
|
+
disabled: 'Off here'
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/** A timed-follow choice offered in the menu. */
|
|
84
|
+
|
|
85
|
+
const HOUR = 60 * 60;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Defaults chosen for the cases a timed follow is actually for: a live event
|
|
89
|
+
* tonight, a story running this week. Not a general-purpose duration picker —
|
|
90
|
+
* an application that needs one passes its own.
|
|
91
|
+
*/
|
|
92
|
+
const DEFAULT_DURATIONS = [{
|
|
93
|
+
label: '24 hours',
|
|
94
|
+
seconds: 24 * HOUR
|
|
95
|
+
}, {
|
|
96
|
+
label: '72 hours',
|
|
97
|
+
seconds: 72 * HOUR
|
|
98
|
+
}, {
|
|
99
|
+
label: 'A week',
|
|
100
|
+
seconds: 7 * 24 * HOUR
|
|
101
|
+
}];
|
|
102
|
+
|
|
103
|
+
/** One line in the disclosure menu. */
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Which choices exist, given the state.
|
|
107
|
+
*
|
|
108
|
+
* Pure and exported because this is the product decision, not a rendering
|
|
109
|
+
* detail: a timed follow is only offered before following, turning it off here
|
|
110
|
+
* is only offered while following, and NEITHER is offered before the server has
|
|
111
|
+
* answered — every one of them addresses a relationship that does not exist
|
|
112
|
+
* yet, so offering them mid-write would mean sending a guessed id.
|
|
113
|
+
*/
|
|
114
|
+
/**
|
|
115
|
+
* What the main button should do for the current state.
|
|
116
|
+
*
|
|
117
|
+
* Exported because the product rule is not obvious from the label alone: a
|
|
118
|
+
* follow switched off here still reads as "following" globally, so the primary
|
|
119
|
+
* press must re-enable here — not unfollow everywhere.
|
|
120
|
+
*/
|
|
121
|
+
function resolveFollowPrimaryAction(input) {
|
|
122
|
+
if (!input.isFollowing) return 'follow';
|
|
123
|
+
if (input.applicationMode === 'disabled') return 'enable-here';
|
|
124
|
+
return 'unfollow';
|
|
125
|
+
}
|
|
126
|
+
function buildFollowMenuItems(input) {
|
|
127
|
+
const items = [];
|
|
128
|
+
if (!input.following) {
|
|
129
|
+
if (input.durations === false) return items;
|
|
130
|
+
for (const d of input.durations) {
|
|
131
|
+
items.push({
|
|
132
|
+
key: `for-${d.seconds}`,
|
|
133
|
+
label: `${input.idleVerb} for ${d.label.toLowerCase()}`,
|
|
134
|
+
action: {
|
|
135
|
+
type: 'follow-timed',
|
|
136
|
+
seconds: d.seconds,
|
|
137
|
+
durationLabel: d.label
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
return items;
|
|
142
|
+
}
|
|
143
|
+
if (!input.hasRelationship || input.isPending) return items;
|
|
144
|
+
items.push(input.applicationMode === 'disabled' ? {
|
|
145
|
+
key: 'enable-here',
|
|
146
|
+
label: `Show in ${input.applicationName}`,
|
|
147
|
+
action: {
|
|
148
|
+
type: 'enable-here'
|
|
149
|
+
}
|
|
150
|
+
} : {
|
|
151
|
+
key: 'disable-here',
|
|
152
|
+
label: `Don’t show in ${input.applicationName}`,
|
|
153
|
+
action: {
|
|
154
|
+
type: 'disable-here'
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
items.push({
|
|
158
|
+
// Named for what it does. "Unfollow" beside "don't show here" would read as
|
|
159
|
+
// the same action twice, and the user would pick the wrong one.
|
|
160
|
+
key: 'unfollow-everywhere',
|
|
161
|
+
label: 'Unfollow everywhere',
|
|
162
|
+
action: {
|
|
163
|
+
type: 'unfollow'
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
return items;
|
|
167
|
+
}
|
|
168
|
+
const FollowTargetButton = exports.FollowTargetButton = /*#__PURE__*/(0, _react.memo)(function FollowTargetButton({
|
|
169
|
+
targetId,
|
|
170
|
+
verb = 'follow',
|
|
171
|
+
labels,
|
|
172
|
+
size = 'medium',
|
|
173
|
+
style,
|
|
174
|
+
disabled = false,
|
|
175
|
+
showOptions = true,
|
|
176
|
+
durations = DEFAULT_DURATIONS,
|
|
177
|
+
applicationName,
|
|
178
|
+
onChange
|
|
179
|
+
}) {
|
|
180
|
+
const {
|
|
181
|
+
status,
|
|
182
|
+
isFollowing,
|
|
183
|
+
isUnknown,
|
|
184
|
+
isPending,
|
|
185
|
+
follow,
|
|
186
|
+
unfollow,
|
|
187
|
+
disableHere,
|
|
188
|
+
enableHere
|
|
189
|
+
} = (0, _useFollowTarget.useFollowTarget)(targetId);
|
|
190
|
+
const text = (0, _react.useMemo)(() => ({
|
|
191
|
+
...VERB_LABELS[verb],
|
|
192
|
+
...labels
|
|
193
|
+
}), [verb, labels]);
|
|
194
|
+
const label = (0, _react.useMemo)(() => {
|
|
195
|
+
if (status.globalState === 'requested') return text.pending;
|
|
196
|
+
if (!isFollowing) return text.idle;
|
|
197
|
+
// Followed globally but switched off here. `effectiveState` reports
|
|
198
|
+
// `not_following` for this, correctly — the question it answers is "does
|
|
199
|
+
// this act here" — so the label has to be derived from the other two.
|
|
200
|
+
return status.applicationMode === 'disabled' ? text.disabled : text.active;
|
|
201
|
+
}, [isFollowing, status.globalState, status.applicationMode, text]);
|
|
202
|
+
|
|
203
|
+
// `onChange` fires ONLY when the server accepted the write.
|
|
204
|
+
//
|
|
205
|
+
// The mutations never reject — a refusal becomes error state so the button
|
|
206
|
+
// can render it — so an unconditional `onChange` after `await` reports
|
|
207
|
+
// INTENT rather than outcome. A caller mirroring the follow somewhere else
|
|
208
|
+
// (a local shelf, a ranking signal) would then mirror failures too, and the
|
|
209
|
+
// button beside it would show the server's truth while the mirror showed a
|
|
210
|
+
// press that did not happen. Same shape of trap as reading `effectiveState`
|
|
211
|
+
// as "does the user follow this".
|
|
212
|
+
const handlePrimary = (0, _react.useCallback)(async () => {
|
|
213
|
+
switch (resolveFollowPrimaryAction({
|
|
214
|
+
isFollowing,
|
|
215
|
+
applicationMode: status.applicationMode
|
|
216
|
+
})) {
|
|
217
|
+
case 'enable-here':
|
|
218
|
+
if (await enableHere()) onChange?.(true);
|
|
219
|
+
return;
|
|
220
|
+
case 'unfollow':
|
|
221
|
+
if (await unfollow()) onChange?.(false);
|
|
222
|
+
return;
|
|
223
|
+
case 'follow':
|
|
224
|
+
if (await follow()) onChange?.(true);
|
|
225
|
+
}
|
|
226
|
+
}, [isFollowing, status.applicationMode, follow, unfollow, enableHere, onChange]);
|
|
227
|
+
const handleTimed = (0, _react.useCallback)(async (seconds, durationLabel) => {
|
|
228
|
+
if (!(await follow({
|
|
229
|
+
expiresIn: seconds
|
|
230
|
+
}))) return;
|
|
231
|
+
onChange?.(true);
|
|
232
|
+
// The confirmation is the point: a follow that ends on its own is a
|
|
233
|
+
// promise, and a user who does not see it made will not believe it.
|
|
234
|
+
// Which is also why it must not appear when the promise was not made.
|
|
235
|
+
_toast.toast.success(`Following for ${durationLabel.toLowerCase()}`);
|
|
236
|
+
}, [follow, onChange]);
|
|
237
|
+
const menuItems = (0, _react.useMemo)(() => buildFollowMenuItems({
|
|
238
|
+
following: isFollowing,
|
|
239
|
+
applicationMode: status.applicationMode,
|
|
240
|
+
hasRelationship: Boolean(status.relationshipId),
|
|
241
|
+
isPending,
|
|
242
|
+
durations,
|
|
243
|
+
idleVerb: text.idle,
|
|
244
|
+
applicationName: applicationName ?? 'this app'
|
|
245
|
+
}), [isFollowing, status.applicationMode, status.relationshipId, isPending, durations, text.idle, applicationName]);
|
|
246
|
+
const runItem = (0, _react.useCallback)(item => {
|
|
247
|
+
switch (item.action.type) {
|
|
248
|
+
case 'follow-timed':
|
|
249
|
+
void handleTimed(item.action.seconds, item.action.durationLabel);
|
|
250
|
+
return;
|
|
251
|
+
case 'enable-here':
|
|
252
|
+
void enableHere();
|
|
253
|
+
return;
|
|
254
|
+
case 'disable-here':
|
|
255
|
+
void disableHere();
|
|
256
|
+
return;
|
|
257
|
+
case 'unfollow':
|
|
258
|
+
void unfollow().then(ok => {
|
|
259
|
+
if (ok) onChange?.(false);
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}, [handleTimed, enableHere, disableHere, unfollow, onChange]);
|
|
263
|
+
const primary = /*#__PURE__*/(0, _jsxRuntime.jsx)(_button.Button, {
|
|
264
|
+
variant: isFollowing ? 'secondary' : 'primary',
|
|
265
|
+
size: size
|
|
266
|
+
// Unknown is not "not following": the button stays inert until the first
|
|
267
|
+
// read settles rather than inviting a follow that may already exist.
|
|
268
|
+
,
|
|
269
|
+
disabled: disabled || isUnknown,
|
|
270
|
+
loading: isPending,
|
|
271
|
+
onPress: () => void handlePrimary(),
|
|
272
|
+
accessibilityLabel: label,
|
|
273
|
+
children: label
|
|
274
|
+
});
|
|
275
|
+
if (!showOptions || menuItems.length === 0) {
|
|
276
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
277
|
+
style: style,
|
|
278
|
+
children: primary
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
282
|
+
style: [{
|
|
283
|
+
flexDirection: 'row',
|
|
284
|
+
alignItems: 'center',
|
|
285
|
+
gap: 4
|
|
286
|
+
}, style],
|
|
287
|
+
children: [primary, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_menu.Menu, {
|
|
288
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_menu.MenuTrigger, {
|
|
289
|
+
label: `${label} options`,
|
|
290
|
+
hint: "Opens follow options",
|
|
291
|
+
children: ({
|
|
292
|
+
props
|
|
293
|
+
}) =>
|
|
294
|
+
/*#__PURE__*/
|
|
295
|
+
// The trigger's props are mapped rather than spread: `MenuTrigger`
|
|
296
|
+
// hands back a DOM-ish bag (focus handlers, an accessibility role)
|
|
297
|
+
// and `Button` accepts a different set, so a spread would pass
|
|
298
|
+
// props it silently drops.
|
|
299
|
+
(0, _jsxRuntime.jsx)(_button.Button, {
|
|
300
|
+
variant: "secondary",
|
|
301
|
+
size: size === 'large' ? 'large' : 'small',
|
|
302
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ChevronBottom_Stroke2_Corner0_Rounded, {
|
|
303
|
+
width: 16
|
|
304
|
+
}),
|
|
305
|
+
disabled: disabled || isUnknown,
|
|
306
|
+
onPress: props.onPress,
|
|
307
|
+
accessibilityLabel: props.accessibilityLabel,
|
|
308
|
+
accessibilityHint: props.accessibilityHint
|
|
309
|
+
})
|
|
310
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_menu.MenuContent, {
|
|
311
|
+
showCancel: true,
|
|
312
|
+
children: menuItems.map(item => /*#__PURE__*/(0, _jsxRuntime.jsx)(_menu.MenuItem, {
|
|
313
|
+
label: item.label,
|
|
314
|
+
onPress: () => runItem(item),
|
|
315
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_menu.MenuItemText, {
|
|
316
|
+
children: item.label
|
|
317
|
+
})
|
|
318
|
+
}, item.key))
|
|
319
|
+
})]
|
|
320
|
+
})]
|
|
321
|
+
});
|
|
322
|
+
});
|
|
323
|
+
//# sourceMappingURL=FollowTargetButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_button","_icons","_menu","_toast","_useFollowTarget","_jsxRuntime","VERB_LABELS","follow","idle","active","pending","disabled","subscribe","join","watch","HOUR","DEFAULT_DURATIONS","label","seconds","resolveFollowPrimaryAction","input","isFollowing","applicationMode","buildFollowMenuItems","items","following","durations","d","push","key","idleVerb","toLowerCase","action","type","durationLabel","hasRelationship","isPending","applicationName","FollowTargetButton","exports","memo","targetId","verb","labels","size","style","showOptions","onChange","status","isUnknown","unfollow","disableHere","enableHere","useFollowTarget","text","useMemo","globalState","handlePrimary","useCallback","handleTimed","expiresIn","toast","success","menuItems","Boolean","relationshipId","runItem","item","then","ok","primary","jsx","Button","variant","loading","onPress","accessibilityLabel","children","length","View","jsxs","flexDirection","alignItems","gap","Menu","MenuTrigger","hint","props","icon","ChevronBottom_Stroke2_Corner0_Rounded","width","accessibilityHint","MenuContent","showCancel","map","MenuItem","MenuItemText"],"sourceRoot":"../../../../src","sources":["ui/components/FollowTargetButton.tsx"],"mappings":";;;;;;;;AAiCA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AAA2D,IAAAO,WAAA,GAAAP,OAAA;AAzC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;;AAcA,MAAMQ,WAA6C,GAAG;EACpDC,MAAM,EAAE;IAAEC,IAAI,EAAE,QAAQ;IAAEC,MAAM,EAAE,WAAW;IAAEC,OAAO,EAAE,WAAW;IAAEC,QAAQ,EAAE;EAAW,CAAC;EAC3FC,SAAS,EAAE;IACTJ,IAAI,EAAE,WAAW;IACjBC,MAAM,EAAE,YAAY;IACpBC,OAAO,EAAE,WAAW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