@oxy.so/services 12.6.0 → 12.8.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/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/client.js +20 -0
- package/lib/commonjs/ui/client.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +8 -12
- package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
- package/lib/commonjs/ui/components/FollowTargetButton.js +1 -2
- package/lib/commonjs/ui/components/FollowTargetButton.js.map +1 -1
- package/lib/commonjs/ui/components/followLabels.js +34 -0
- package/lib/commonjs/ui/components/followLabels.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAccountColor.js +56 -0
- package/lib/commonjs/ui/hooks/useAccountColor.js.map +1 -0
- package/lib/commonjs/ui/hooks/useFollow.js +5 -4
- package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
- package/lib/commonjs/ui/hooks/useFollowTarget.js +8 -8
- package/lib/commonjs/ui/hooks/useFollowTarget.js.map +1 -1
- package/lib/commonjs/ui/stores/followStore.js +10 -9
- package/lib/commonjs/ui/stores/followStore.js.map +1 -1
- package/lib/commonjs/ui/stores/followTargetStore.js.map +1 -1
- package/lib/commonjs/ui/utils/followErrors.js +45 -0
- package/lib/commonjs/ui/utils/followErrors.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/client.js +2 -0
- package/lib/module/ui/client.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +9 -13
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/FollowTargetButton.js +2 -3
- package/lib/module/ui/components/FollowTargetButton.js.map +1 -1
- package/lib/module/ui/components/followLabels.js +33 -1
- package/lib/module/ui/components/followLabels.js.map +1 -1
- package/lib/module/ui/hooks/useAccountColor.js +51 -0
- package/lib/module/ui/hooks/useAccountColor.js.map +1 -0
- package/lib/module/ui/hooks/useFollow.js +5 -4
- package/lib/module/ui/hooks/useFollow.js.map +1 -1
- package/lib/module/ui/hooks/useFollowTarget.js +8 -8
- package/lib/module/ui/hooks/useFollowTarget.js.map +1 -1
- package/lib/module/ui/stores/followStore.js +10 -9
- package/lib/module/ui/stores/followStore.js.map +1 -1
- package/lib/module/ui/stores/followTargetStore.js.map +1 -1
- package/lib/module/ui/utils/followErrors.js +41 -0
- package/lib/module/ui/utils/followErrors.js.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +2 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/client.d.ts +3 -0
- package/lib/typescript/commonjs/ui/client.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.map +1 -1
- package/lib/typescript/commonjs/ui/components/followLabels.d.ts +13 -0
- package/lib/typescript/commonjs/ui/components/followLabels.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useAccountColor.d.ts +25 -0
- package/lib/typescript/commonjs/ui/hooks/useAccountColor.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/useFollow.d.ts +5 -4
- package/lib/typescript/commonjs/ui/hooks/useFollow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useFollow.types.d.ts +3 -2
- package/lib/typescript/commonjs/ui/hooks/useFollow.types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/hooks/useFollowTarget.d.ts +4 -2
- package/lib/typescript/commonjs/ui/hooks/useFollowTarget.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/stores/followStore.d.ts +3 -1
- package/lib/typescript/commonjs/ui/stores/followStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/stores/followTargetStore.d.ts +4 -2
- package/lib/typescript/commonjs/ui/stores/followTargetStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/followErrors.d.ts +42 -0
- package/lib/typescript/commonjs/ui/utils/followErrors.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +2 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/client.d.ts +3 -0
- package/lib/typescript/module/ui/client.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.map +1 -1
- package/lib/typescript/module/ui/components/followLabels.d.ts +13 -0
- package/lib/typescript/module/ui/components/followLabels.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useAccountColor.d.ts +25 -0
- package/lib/typescript/module/ui/hooks/useAccountColor.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/useFollow.d.ts +5 -4
- package/lib/typescript/module/ui/hooks/useFollow.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useFollow.types.d.ts +3 -2
- package/lib/typescript/module/ui/hooks/useFollow.types.d.ts.map +1 -1
- package/lib/typescript/module/ui/hooks/useFollowTarget.d.ts +4 -2
- package/lib/typescript/module/ui/hooks/useFollowTarget.d.ts.map +1 -1
- package/lib/typescript/module/ui/stores/followStore.d.ts +3 -1
- package/lib/typescript/module/ui/stores/followStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/stores/followTargetStore.d.ts +4 -2
- package/lib/typescript/module/ui/stores/followTargetStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/followErrors.d.ts +42 -0
- package/lib/typescript/module/ui/utils/followErrors.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/index.ts +2 -0
- package/src/ui/client.ts +3 -0
- package/src/ui/components/FollowButton.tsx +14 -12
- package/src/ui/components/FollowTargetButton.tsx +7 -3
- package/src/ui/components/followLabels.ts +36 -2
- package/src/ui/hooks/useAccountColor.ts +52 -0
- package/src/ui/hooks/useFollow.ts +22 -10
- package/src/ui/hooks/useFollow.types.ts +6 -2
- package/src/ui/hooks/useFollowTarget.ts +15 -10
- package/src/ui/stores/__tests__/followStore.test.ts +1 -1
- package/src/ui/stores/followStore.ts +12 -14
- package/src/ui/stores/followTargetStore.ts +4 -2
- package/src/ui/utils/followErrors.ts +56 -0
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* strings, so a verb reads the same — and in the same language — wherever it is
|
|
8
8
|
* drawn.
|
|
9
9
|
*/
|
|
10
|
+
import { type Translate } from '../hooks/useI18n';
|
|
11
|
+
import type { FollowErrorCode } from '../utils/followErrors';
|
|
10
12
|
/**
|
|
11
13
|
* The small vocabulary of verbs the ecosystem actually uses. An application
|
|
12
14
|
* whose verb is not here passes `labels` instead — the escape hatch exists so
|
|
@@ -25,4 +27,15 @@ export interface FollowLabels {
|
|
|
25
27
|
}
|
|
26
28
|
/** The labels for `verb` in the current language, with the caller's `overrides` on top. */
|
|
27
29
|
export declare function useFollowLabels(verb?: FollowVerb, overrides?: Partial<FollowLabels>): FollowLabels;
|
|
30
|
+
/**
|
|
31
|
+
* What a follow error says, in the current language. Every component that
|
|
32
|
+
* shows a follow failure reads it here; a missing code (a failure the store
|
|
33
|
+
* did not record) reads as the generic "could not update".
|
|
34
|
+
*/
|
|
35
|
+
export declare function describeFollowError(code: FollowErrorCode | null | undefined, t: Translate): string;
|
|
36
|
+
/**
|
|
37
|
+
* `describeFollowError` bound to the current language, for an application that
|
|
38
|
+
* renders `useFollowTarget().error` (or `useFollow().error`) itself.
|
|
39
|
+
*/
|
|
40
|
+
export declare function useFollowErrorMessage(): (code: FollowErrorCode | null | undefined) => string;
|
|
28
41
|
//# sourceMappingURL=followLabels.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"followLabels.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/followLabels.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"followLabels.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/followLabels.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,2FAA2F;AAC3F,wBAAgB,eAAe,CAC7B,IAAI,GAAE,UAAqB,EAC3B,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAChC,YAAY,CAYd;AAcD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,EACxC,CAAC,EAAE,SAAS,GACX,MAAM,CAER;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,KAAK,MAAM,CAG5F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAccountColor
|
|
3
|
+
*
|
|
4
|
+
* The account's colour is one value that every Oxy app wears: `users.color`, a
|
|
5
|
+
* Bloom preset NAME the API only stores after its entitlement check (`oxy` and
|
|
6
|
+
* `faircoin` belong to the account with that handle, `mono` to an active
|
|
7
|
+
* benefit). This hook is the single place an app turns that stored name into its
|
|
8
|
+
* Bloom theme, so two apps cannot disagree about which field wins.
|
|
9
|
+
*
|
|
10
|
+
* The portable `themePreference.colorPreset` is the fallback for an account that
|
|
11
|
+
* has no `color` yet. Mode (light/dark) is deliberately out of scope: whether to
|
|
12
|
+
* follow the account's mode is each app's own choice, the colour is not.
|
|
13
|
+
*
|
|
14
|
+
* An app with a stricter rule of its own (a plan the SDK cannot see) passes
|
|
15
|
+
* `canUse`; a name it refuses is simply not applied, so the app keeps its own
|
|
16
|
+
* default instead of a colour the viewer is not entitled to.
|
|
17
|
+
*/
|
|
18
|
+
import type { User } from '@oxy.so/core';
|
|
19
|
+
import { type AppColorName } from '@oxy.so/bloom/theme';
|
|
20
|
+
/** The preset an account wears, or `null` when it has none Bloom knows. */
|
|
21
|
+
export declare function resolveAccountColor(user: Pick<User, 'color' | 'themePreference'> | null | undefined): AppColorName | null;
|
|
22
|
+
export declare function useAccountColor({ canUse, }?: {
|
|
23
|
+
canUse?: (name: AppColorName) => boolean;
|
|
24
|
+
}): void;
|
|
25
|
+
//# sourceMappingURL=useAccountColor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccountColor.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useAccountColor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAS1F,2EAA2E;AAC3E,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,iBAAiB,CAAC,GAAG,IAAI,GAAG,SAAS,GAC/D,YAAY,GAAG,IAAI,CAGrB;AAED,wBAAgB,eAAe,CAAC,EAC9B,MAAM,GACP,GAAE;IACD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC;CACrC,GAAG,IAAI,CAUZ"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type OxyServices, type BulkFollowResult, type BulkUnfollowResult } from '@oxy.so/core';
|
|
2
|
+
import type { FollowErrorCode } from '../utils/followErrors';
|
|
2
3
|
/**
|
|
3
4
|
* useFollow — Hook for follow state management.
|
|
4
5
|
*
|
|
@@ -15,7 +16,7 @@ import type { OxyServices, BulkFollowResult, BulkUnfollowResult } from '@oxy.so/
|
|
|
15
16
|
export declare const useFollow: (userId?: string | string[]) => {
|
|
16
17
|
isFollowing: boolean;
|
|
17
18
|
isLoading: boolean;
|
|
18
|
-
error:
|
|
19
|
+
error: FollowErrorCode | null;
|
|
19
20
|
toggleFollow: () => Promise<void>;
|
|
20
21
|
setFollowStatus: (following: boolean) => void;
|
|
21
22
|
fetchStatus: () => Promise<void>;
|
|
@@ -42,7 +43,7 @@ export declare const useFollow: (userId?: string | string[]) => {
|
|
|
42
43
|
followData: Record<string, {
|
|
43
44
|
isFollowing: boolean;
|
|
44
45
|
isLoading: boolean;
|
|
45
|
-
error:
|
|
46
|
+
error: FollowErrorCode | null;
|
|
46
47
|
}>;
|
|
47
48
|
toggleFollowForUser: (targetUserId: string) => Promise<void>;
|
|
48
49
|
setFollowStatusForUser: (targetUserId: string, following: boolean) => void;
|
|
@@ -81,7 +82,7 @@ export declare const useFollowForButton: (userId: string, oxyServices: OxyServic
|
|
|
81
82
|
isFollowing: boolean;
|
|
82
83
|
isKnown: boolean;
|
|
83
84
|
isLoading: boolean;
|
|
84
|
-
error:
|
|
85
|
+
error: FollowErrorCode | null;
|
|
85
86
|
toggleFollow: () => Promise<boolean>;
|
|
86
87
|
resolveStatus: () => void;
|
|
87
88
|
setFollowStatus: (following: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFollow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollow.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"useFollow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollow.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAK7D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,GAAI,SAAS,MAAM,GAAG,MAAM,EAAE;;;;;iCAwHpC,OAAO;;;;;;;8BA4BX,MAAM;+BASN,MAAM;;;;;;;;;;;;;;;qBApFG,OAAO;mBAAa,OAAO;eAAS,eAAe,GAAG,IAAI;;wCAsHtD,MAAM;2CAY6B,MAAM,aAAa,OAAO;uCAK7D,MAAM;;0BAegB,OAAO,CAAC,gBAAgB,CAAC;4BAOvB,OAAO,CAAC,kBAAkB,CAAC;sCAMrB,MAAM;;;;;;;;;;;;;;;;;;CAkD5D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,MAAM,EACd,aAAa,WAAW,EACxB,qBAAqB,OAAO;;;;;wBA8Be,OAAO,CAAC,OAAO,CAAC;;iCAc7C,OAAO;;CAoBtB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,mBACT,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,SAExC,CAAC;AAGT,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM;;;;;8BAkBpC,MAAM;+BAON,MAAM;CAcjB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { BulkFollowResult } from '@oxy.so/core';
|
|
2
|
+
import type { FollowErrorCode } from '../utils/followErrors';
|
|
2
3
|
export type SingleFollowResult = {
|
|
3
4
|
isFollowing: boolean;
|
|
4
5
|
isLoading: boolean;
|
|
5
|
-
error:
|
|
6
|
+
error: FollowErrorCode | null;
|
|
6
7
|
toggleFollow: () => Promise<void>;
|
|
7
8
|
setFollowStatus: (following: boolean) => void;
|
|
8
9
|
fetchStatus: () => Promise<void>;
|
|
@@ -18,7 +19,7 @@ export type MultiFollowResult = {
|
|
|
18
19
|
followData: Record<string, {
|
|
19
20
|
isFollowing: boolean;
|
|
20
21
|
isLoading: boolean;
|
|
21
|
-
error:
|
|
22
|
+
error: FollowErrorCode | null;
|
|
22
23
|
}>;
|
|
23
24
|
toggleFollowForUser: (userId: string) => Promise<void>;
|
|
24
25
|
setFollowStatusForUser: (userId: string, following: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFollow.types.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollow.types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"useFollow.types.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollow.types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,eAAe,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAChB,MAAM,EACN;QAAE,WAAW,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAA;KAAE,CAC5E,CAAC;IACF,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,sBAAsB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACrE,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,cAAc,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAChD,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,kBAAkB,GAAG,iBAAiB,CAAC"}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* width of one request rather than being sent with a guessed id.
|
|
16
16
|
*/
|
|
17
17
|
import type { FollowStatus } from '@oxy.so/contracts';
|
|
18
|
+
import { type FollowErrorCode } from '../utils/followErrors';
|
|
18
19
|
export interface UseFollowTargetResult {
|
|
19
20
|
status: FollowStatus;
|
|
20
21
|
/**
|
|
@@ -25,11 +26,12 @@ export interface UseFollowTargetResult {
|
|
|
25
26
|
/** True until the first read settles. Distinct from "not following". */
|
|
26
27
|
isUnknown: boolean;
|
|
27
28
|
isPending: boolean;
|
|
28
|
-
|
|
29
|
+
/** Why the last read or write failed — a code; `useFollowErrorMessage()` words it. */
|
|
30
|
+
error: FollowErrorCode | undefined;
|
|
29
31
|
/**
|
|
30
32
|
* Every mutation resolves to whether the server ACCEPTED it.
|
|
31
33
|
*
|
|
32
|
-
* They never reject — a refusal becomes `error` in the store, so the button
|
|
34
|
+
* They never reject — a refusal becomes an `error` code in the store, so the button
|
|
33
35
|
* can render it — which means a caller that only awaits them cannot tell a
|
|
34
36
|
* write that happened from one that did not. Returning the outcome is what
|
|
35
37
|
* lets a caller mirror the change somewhere else without mirroring failures
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFollowTarget.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollowTarget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"useFollowTarget.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollowTarget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAStD,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,YAAY,CAAC;IACrB;;;OAGG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,wEAAwE;IACxE,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,sFAAsF;IACtF,KAAK,EAAE,eAAe,GAAG,SAAS,CAAC;IACnC;;;;;;;;OAQG;IACH,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/D,QAAQ,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACjC,wEAAwE;IACxE,WAAW,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,YAAY,CAAA;CAAE,GACzC,qBAAqB,CAkKvB"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { OxyServices, BulkFollowResult, BulkUnfollowResult } from '@oxy.so/core';
|
|
2
|
+
import { type FollowErrorCode } from '../utils/followErrors';
|
|
2
3
|
interface FollowState {
|
|
3
4
|
followingUsers: Record<string, boolean>;
|
|
4
5
|
loadingUsers: Record<string, boolean>;
|
|
5
6
|
fetchingUsers: Record<string, boolean>;
|
|
6
|
-
|
|
7
|
+
/** Why the last read or write of a user failed, as a code — never text. */
|
|
8
|
+
errors: Record<string, FollowErrorCode | null>;
|
|
7
9
|
followerCounts: Record<string, number>;
|
|
8
10
|
followingCounts: Record<string, number>;
|
|
9
11
|
loadingCounts: Record<string, boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"followStore.d.ts","sourceRoot":"","sources":["../../../../../src/ui/stores/followStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"followStore.d.ts","sourceRoot":"","sources":["../../../../../src/ui/stores/followStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,KAAK,eAAe,EAAqB,MAAM,uBAAuB,CAAC;AAEhF,UAAU,WAAW;IAKnB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,YAAY,EAA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EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,4BAA4B,EAAE,CAC5B,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,QAAQ,GAAG,UAAU,EAC7B,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAChD,aAAa,CAAC,EAAE,MAAM,KACnB,IAAI,CAAC;IACV,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9E;AA8BD,kFAAkF;AAClF,eAAO,MAAM,qBAAqB,QAAO,IAMxC,CAAC;AAEF,eAAO,MAAM,cAAc,0EAsYxB,CAAC"}
|
|
@@ -22,13 +22,15 @@
|
|
|
22
22
|
* why a follow the user can see in their list does nothing in this app.
|
|
23
23
|
*/
|
|
24
24
|
import type { FollowApplicationMode, FollowRecord, FollowStatus } from '@oxy.so/contracts';
|
|
25
|
+
import type { FollowErrorCode } from '../utils/followErrors';
|
|
25
26
|
/** The status of one target, or `undefined` when it has never been read. */
|
|
26
27
|
type StatusMap = Record<string, FollowStatus | undefined>;
|
|
27
28
|
interface FollowTargetState {
|
|
28
29
|
statuses: StatusMap;
|
|
29
30
|
/** In-flight writes, per target. Reads do not set this — only mutations do. */
|
|
30
31
|
pending: Record<string, boolean>;
|
|
31
|
-
|
|
32
|
+
/** Why the last read or write of a target failed, as a code — never text. */
|
|
33
|
+
errors: Record<string, FollowErrorCode | undefined>;
|
|
32
34
|
setStatus: (targetId: string, status: FollowStatus) => void;
|
|
33
35
|
/**
|
|
34
36
|
* Seed many statuses at once — from a follow list, a feed payload, anything
|
|
@@ -37,7 +39,7 @@ interface FollowTargetState {
|
|
|
37
39
|
*/
|
|
38
40
|
seed: (entries: Record<string, FollowStatus>) => void;
|
|
39
41
|
setPending: (targetId: string, pending: boolean) => void;
|
|
40
|
-
setError: (targetId: string, error:
|
|
42
|
+
setError: (targetId: string, error: FollowErrorCode | undefined) => void;
|
|
41
43
|
/** Drop everything. Called on identity change — see the note below. */
|
|
42
44
|
reset: () => void;
|
|
43
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"followTargetStore.d.ts","sourceRoot":"","sources":["../../../../../src/ui/stores/followTargetStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"followTargetStore.d.ts","sourceRoot":"","sources":["../../../../../src/ui/stores/followTargetStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,4EAA4E;AAC5E,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,SAAS,CAAC,CAAC;AAE1D,UAAU,iBAAiB;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,+EAA+E;IAC/E,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,CAAC,CAAC;IAEpD,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAC5D;;;;OAIG;IACH,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,KAAK,IAAI,CAAC;IACtD,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,SAAS,KAAK,IAAI,CAAC;IACzE,uEAAuE;IACvE,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAInC,CAAC;AAEF,eAAO,MAAM,oBAAoB,gFAoB9B,CAAC;AAEJ;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAEhE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAGpE;AAED,kFAAkF;AAClF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CAQvE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAM9F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,qBAAqB,GAC1B,YAAY,CAad"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a failed follow read or write leaves behind: a stable CODE, never text.
|
|
3
|
+
*
|
|
4
|
+
* The follow stores and hooks have no translator and must not pretend to — an
|
|
5
|
+
* English sentence written into a store reaches every locale's toast verbatim,
|
|
6
|
+
* and so does a server's `message`. They keep one of these codes instead, and
|
|
7
|
+
* the UI turns it into words in the user's language (`describeFollowError` in
|
|
8
|
+
* `components/followLabels.ts`).
|
|
9
|
+
*
|
|
10
|
+
* A code says either what the caller was doing (`read_failed`, `update_failed`,
|
|
11
|
+
* `mode_failed`) or — when the failure says more than that — why it failed,
|
|
12
|
+
* taken from the API's machine code and HTTP status rather than its message.
|
|
13
|
+
*/
|
|
14
|
+
export type FollowErrorCode =
|
|
15
|
+
/** The status could not be read. */
|
|
16
|
+
'read_failed'
|
|
17
|
+
/** A follow or unfollow was refused. */
|
|
18
|
+
| 'update_failed'
|
|
19
|
+
/** Switching a follow off or back on in this application was refused. */
|
|
20
|
+
| 'mode_failed'
|
|
21
|
+
/** No response arrived: the device is offline, or the request timed out. */
|
|
22
|
+
| 'offline'
|
|
23
|
+
/** The session is gone; signing in again is the only fix. */
|
|
24
|
+
| 'signed_out'
|
|
25
|
+
/** This application lacks the permission the write needs. */
|
|
26
|
+
| 'forbidden'
|
|
27
|
+
/** The target or the relationship no longer exists. */
|
|
28
|
+
| 'not_found'
|
|
29
|
+
/** Too many writes in a short window. */
|
|
30
|
+
| 'rate_limited';
|
|
31
|
+
/** The codes that name the caller's action rather than a cause. */
|
|
32
|
+
export type FollowActionErrorCode = 'read_failed' | 'update_failed' | 'mode_failed';
|
|
33
|
+
/**
|
|
34
|
+
* The code for whatever a follow request rejected with.
|
|
35
|
+
*
|
|
36
|
+
* Read structurally — every `OxyServices` call rejects with an `OxyApiError`
|
|
37
|
+
* (or an `OxyAuthenticationError`), and both carry `status` and `code` — so a
|
|
38
|
+
* second copy of `@oxy.so/core` in an app cannot defeat an `instanceof`.
|
|
39
|
+
* Anything the cause does not explain falls back to the caller's `action`.
|
|
40
|
+
*/
|
|
41
|
+
export declare function toFollowErrorCode(error: unknown, action: FollowActionErrorCode): FollowErrorCode;
|
|
42
|
+
//# sourceMappingURL=followErrors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"followErrors.d.ts","sourceRoot":"","sources":["../../../../../src/ui/utils/followErrors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,eAAe;AACzB,oCAAoC;AAClC,aAAa;AACf,wCAAwC;GACtC,eAAe;AACjB,yEAAyE;GACvE,aAAa;AACf,4EAA4E;GAC1E,SAAS;AACX,6DAA6D;GAC3D,YAAY;AACd,6DAA6D;GAC3D,WAAW;AACb,uDAAuD;GACrD,WAAW;AACb,yCAAyC;GACvC,cAAc,CAAC;AAEnB,mEAAmE;AACnE,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG,eAAe,GAAG,aAAa,CAAC;AAIpF;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,qBAAqB,GAAG,eAAe,CAWhG"}
|
|
@@ -87,6 +87,8 @@ export { buildFollowMenuItems, resolveFollowPrimaryAction, FOLLOW_ACTION_LEAVES_
|
|
|
87
87
|
export type { FollowDuration, FollowMenuItem } from './ui/components/followRules.js';
|
|
88
88
|
export type { FollowTargetButtonProps } from './ui/components/FollowTargetButton.js';
|
|
89
89
|
export type { FollowVerb, FollowLabels } from './ui/components/followLabels.js';
|
|
90
|
+
export { useFollowErrorMessage } from './ui/components/followLabels.js';
|
|
91
|
+
export type { FollowErrorCode } from './ui/utils/followErrors.js';
|
|
90
92
|
export { useFollowTarget } from './ui/hooks/useFollowTarget.js';
|
|
91
93
|
export type { UseFollowTargetResult } from './ui/hooks/useFollowTarget.js';
|
|
92
94
|
export { useFollowTargetStore, UNKNOWN_FOLLOW_STATUS, isFollowedGlobally, withApplicationMode, isCompleteFollowStatus, followRecordToStatus, followRecordsToStatusMap, } from './ui/stores/followTargetStore.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH,OAAO,uBAAoB,CAAC;AAU5B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gCAA6B,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAAyB,CAAC;AAIjD,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,4BAAyB,CAAC;AAKlF,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,uBAAc,CAAC;AACtB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,YAAY,EAAE,sBAAsB,EAAE,MAAM,sCAAmC,CAAC;AAQhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAA8B,CAAC;AACjE,YAAY,EAAE,uBAAuB,EAAE,MAAM,iCAA8B,CAAC;AAU5E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uCAAoC,CAAC;AACvF,YAAY,EAAE,SAAS,EAAE,MAAM,2BAAwB,CAAC;AAKxD,OAAO,EAAE,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,MAAM,gCAA6B,CAAC;AAC1F,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,GAC9B,MAAM,wCAAqC,CAAC;AAM7C,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,yCAAsC,CAAC;AAE9C,YAAY,EACV,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,mCAAgC,CAAC;AAExC,OAAO,EACL,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,wCAAqC,CAAC;AAC7C,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAA6C,CAAC;AAE1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAAyC,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAA+B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA4B,CAAC"}
|
|
@@ -23,6 +23,8 @@ export type { FollowButtonProps, SingleFollowButtonProps, MultiFollowButtonProps
|
|
|
23
23
|
export { FollowTargetButton } from './components/FollowTargetButton.js';
|
|
24
24
|
export type { FollowTargetButtonProps } from './components/FollowTargetButton.js';
|
|
25
25
|
export type { FollowVerb, FollowLabels } from './components/followLabels.js';
|
|
26
|
+
export { useFollowErrorMessage } from './components/followLabels.js';
|
|
27
|
+
export type { FollowErrorCode } from './utils/followErrors.js';
|
|
26
28
|
export { default as ProfileButton } from './components/ProfileButton.js';
|
|
27
29
|
export type { ProfileButtonProps } from './components/ProfileButton.js';
|
|
28
30
|
export { default as PeableButton } from './components/PeableButton.js';
|
|
@@ -33,6 +35,7 @@ export { default as OxyPayButton } from './components/OxyPayButton.js';
|
|
|
33
35
|
export type { OxyPayButtonProps } from './components/OxyPayButton.js';
|
|
34
36
|
export { useOxy, useOptionalOxy, OxyProviderMissingError } from './context/OxyContext.js';
|
|
35
37
|
export { useAuth } from './hooks/useAuth.js';
|
|
38
|
+
export { useAccountColor, resolveAccountColor } from './hooks/useAccountColor.js';
|
|
36
39
|
export { useAppAssertion, AppAssertionProviderMissingError, } from './appAssertion/AppAssertionContext.js';
|
|
37
40
|
export type { UseAppAssertionResult } from './appAssertion/AppAssertionContext.js';
|
|
38
41
|
export type { AppAssertionSnapshot, AppAssertionStatus } from './appAssertion/appAssertionManager.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/ui/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,wBAAqB,CAAC;AAG7B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,6BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,iCAA8B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,+BAA4B,CAAC;AACtE,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA4B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA4B,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,8BAA2B,CAAC;AACpE,YAAY,EACV,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,8BAA2B,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAiC,CAAC;AACrE,YAAY,EAAE,uBAAuB,EAAE,MAAM,oCAAiC,CAAC;A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B,4BAA4B,GAC7B,MAAM,8BAA2B,CAAC;AACnC,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,8BAA2B,CAAC;AACnC,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,8BAA2B,CAAC;AAGnC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAoB,CAAC;AAGlD,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,0BAAuB,CAAC;AAC/B,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FollowButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/FollowButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpE,OAAO,KAAK,EAAe,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"FollowButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/FollowButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpE,OAAO,KAAK,EAAe,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAKtF,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,UAAU,EAEhB,MAAM,mBAAgB,CAAC;AAExB,gEAAgE;AAChE,UAAU,qBAAqB;IAC7B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,C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AE,YAAY,EAAE,CAAC;AACxB,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FollowTargetButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/FollowTargetButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAkBzD,OAAO,EAIL,KAAK,cAAc,EAEpB,MAAM,kBAAe,CAAC;AACvB,OAAO,
|
|
1
|
+
{"version":3,"file":"FollowTargetButton.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/FollowTargetButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAkBzD,OAAO,EAIL,KAAK,cAAc,EAEpB,MAAM,kBAAe,CAAC;AACvB,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,UAAU,EAEhB,MAAM,mBAAgB,CAAC;AAiBxB,MAAM,WAAW,uBAAuB;IACtC,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;IACrC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED,eAAO,MAAM,kBAAkB,+DAqM7B,CAAC"}
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* strings, so a verb reads the same — and in the same language — wherever it is
|
|
8
8
|
* drawn.
|
|
9
9
|
*/
|
|
10
|
+
import { type Translate } from '../hooks/useI18n.js';
|
|
11
|
+
import type { FollowErrorCode } from '../utils/followErrors.js';
|
|
10
12
|
/**
|
|
11
13
|
* The small vocabulary of verbs the ecosystem actually uses. An application
|
|
12
14
|
* whose verb is not here passes `labels` instead — the escape hatch exists so
|
|
@@ -25,4 +27,15 @@ export interface FollowLabels {
|
|
|
25
27
|
}
|
|
26
28
|
/** The labels for `verb` in the current language, with the caller's `overrides` on top. */
|
|
27
29
|
export declare function useFollowLabels(verb?: FollowVerb, overrides?: Partial<FollowLabels>): FollowLabels;
|
|
30
|
+
/**
|
|
31
|
+
* What a follow error says, in the current language. Every component that
|
|
32
|
+
* shows a follow failure reads it here; a missing code (a failure the store
|
|
33
|
+
* did not record) reads as the generic "could not update".
|
|
34
|
+
*/
|
|
35
|
+
export declare function describeFollowError(code: FollowErrorCode | null | undefined, t: Translate): string;
|
|
36
|
+
/**
|
|
37
|
+
* `describeFollowError` bound to the current language, for an application that
|
|
38
|
+
* renders `useFollowTarget().error` (or `useFollow().error`) itself.
|
|
39
|
+
*/
|
|
40
|
+
export declare function useFollowErrorMessage(): (code: FollowErrorCode | null | undefined) => string;
|
|
28
41
|
//# sourceMappingURL=followLabels.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"followLabels.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/followLabels.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"followLabels.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/followLabels.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,qBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAAuB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,2FAA2F;AAC3F,wBAAgB,eAAe,CAC7B,IAAI,GAAE,UAAqB,EAC3B,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GAChC,YAAY,CAYd;AAcD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,EACxC,CAAC,EAAE,SAAS,GACX,MAAM,CAER;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,CAAC,IAAI,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,KAAK,MAAM,CAG5F"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useAccountColor
|
|
3
|
+
*
|
|
4
|
+
* The account's colour is one value that every Oxy app wears: `users.color`, a
|
|
5
|
+
* Bloom preset NAME the API only stores after its entitlement check (`oxy` and
|
|
6
|
+
* `faircoin` belong to the account with that handle, `mono` to an active
|
|
7
|
+
* benefit). This hook is the single place an app turns that stored name into its
|
|
8
|
+
* Bloom theme, so two apps cannot disagree about which field wins.
|
|
9
|
+
*
|
|
10
|
+
* The portable `themePreference.colorPreset` is the fallback for an account that
|
|
11
|
+
* has no `color` yet. Mode (light/dark) is deliberately out of scope: whether to
|
|
12
|
+
* follow the account's mode is each app's own choice, the colour is not.
|
|
13
|
+
*
|
|
14
|
+
* An app with a stricter rule of its own (a plan the SDK cannot see) passes
|
|
15
|
+
* `canUse`; a name it refuses is simply not applied, so the app keeps its own
|
|
16
|
+
* default instead of a colour the viewer is not entitled to.
|
|
17
|
+
*/
|
|
18
|
+
import type { User } from '@oxy.so/core';
|
|
19
|
+
import { type AppColorName } from '@oxy.so/bloom/theme';
|
|
20
|
+
/** The preset an account wears, or `null` when it has none Bloom knows. */
|
|
21
|
+
export declare function resolveAccountColor(user: Pick<User, 'color' | 'themePreference'> | null | undefined): AppColorName | null;
|
|
22
|
+
export declare function useAccountColor({ canUse, }?: {
|
|
23
|
+
canUse?: (name: AppColorName) => boolean;
|
|
24
|
+
}): void;
|
|
25
|
+
//# sourceMappingURL=useAccountColor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAccountColor.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useAccountColor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAS1F,2EAA2E;AAC3E,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,iBAAiB,CAAC,GAAG,IAAI,GAAG,SAAS,GAC/D,YAAY,GAAG,IAAI,CAGrB;AAED,wBAAgB,eAAe,CAAC,EAC9B,MAAM,GACP,GAAE;IACD,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC;CACrC,GAAG,IAAI,CAUZ"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type OxyServices, type BulkFollowResult, type BulkUnfollowResult } from '@oxy.so/core';
|
|
2
|
+
import type { FollowErrorCode } from '../utils/followErrors.js';
|
|
2
3
|
/**
|
|
3
4
|
* useFollow — Hook for follow state management.
|
|
4
5
|
*
|
|
@@ -15,7 +16,7 @@ import type { OxyServices, BulkFollowResult, BulkUnfollowResult } from '@oxy.so/
|
|
|
15
16
|
export declare const useFollow: (userId?: string | string[]) => {
|
|
16
17
|
isFollowing: boolean;
|
|
17
18
|
isLoading: boolean;
|
|
18
|
-
error:
|
|
19
|
+
error: FollowErrorCode | null;
|
|
19
20
|
toggleFollow: () => Promise<void>;
|
|
20
21
|
setFollowStatus: (following: boolean) => void;
|
|
21
22
|
fetchStatus: () => Promise<void>;
|
|
@@ -42,7 +43,7 @@ export declare const useFollow: (userId?: string | string[]) => {
|
|
|
42
43
|
followData: Record<string, {
|
|
43
44
|
isFollowing: boolean;
|
|
44
45
|
isLoading: boolean;
|
|
45
|
-
error:
|
|
46
|
+
error: FollowErrorCode | null;
|
|
46
47
|
}>;
|
|
47
48
|
toggleFollowForUser: (targetUserId: string) => Promise<void>;
|
|
48
49
|
setFollowStatusForUser: (targetUserId: string, following: boolean) => void;
|
|
@@ -81,7 +82,7 @@ export declare const useFollowForButton: (userId: string, oxyServices: OxyServic
|
|
|
81
82
|
isFollowing: boolean;
|
|
82
83
|
isKnown: boolean;
|
|
83
84
|
isLoading: boolean;
|
|
84
|
-
error:
|
|
85
|
+
error: FollowErrorCode | null;
|
|
85
86
|
toggleFollow: () => Promise<boolean>;
|
|
86
87
|
resolveStatus: () => void;
|
|
87
88
|
setFollowStatus: (following: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFollow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollow.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"useFollow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollow.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAAuB,CAAC;AAK7D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,GAAI,SAAS,MAAM,GAAG,MAAM,EAAE;;;;;iCAwHpC,OAAO;;;;;;;8BA4BX,MAAM;+BASN,MAAM;;;;;;;;;;;;;;;qBApFG,OAAO;mBAAa,OAAO;eAAS,eAAe,GAAG,IAAI;;wCAsHtD,MAAM;2CAY6B,MAAM,aAAa,OAAO;uCAK7D,MAAM;;0BAegB,OAAO,CAAC,gBAAgB,CAAC;4BAOvB,OAAO,CAAC,kBAAkB,CAAC;sCAMrB,MAAM;;;;;;;;;;;;;;;;;;CAkD5D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,MAAM,EACd,aAAa,WAAW,EACxB,qBAAqB,OAAO;;;;;wBA8Be,OAAO,CAAC,OAAO,CAAC;;iCAc7C,OAAO;;CAoBtB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,mBACT,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,SAExC,CAAC;AAGT,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM;;;;;8BAkBpC,MAAM;+BAON,MAAM;CAcjB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { BulkFollowResult } from '@oxy.so/core';
|
|
2
|
+
import type { FollowErrorCode } from '../utils/followErrors.js';
|
|
2
3
|
export type SingleFollowResult = {
|
|
3
4
|
isFollowing: boolean;
|
|
4
5
|
isLoading: boolean;
|
|
5
|
-
error:
|
|
6
|
+
error: FollowErrorCode | null;
|
|
6
7
|
toggleFollow: () => Promise<void>;
|
|
7
8
|
setFollowStatus: (following: boolean) => void;
|
|
8
9
|
fetchStatus: () => Promise<void>;
|
|
@@ -18,7 +19,7 @@ export type MultiFollowResult = {
|
|
|
18
19
|
followData: Record<string, {
|
|
19
20
|
isFollowing: boolean;
|
|
20
21
|
isLoading: boolean;
|
|
21
|
-
error:
|
|
22
|
+
error: FollowErrorCode | null;
|
|
22
23
|
}>;
|
|
23
24
|
toggleFollowForUser: (userId: string) => Promise<void>;
|
|
24
25
|
setFollowStatusForUser: (userId: string, following: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFollow.types.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollow.types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"useFollow.types.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollow.types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAAuB,CAAC;AAE7D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,eAAe,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAChB,MAAM,EACN;QAAE,WAAW,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAA;KAAE,CAC5E,CAAC;IACF,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,sBAAsB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACrE,kBAAkB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,gBAAgB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,cAAc,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAChD,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,kBAAkB,GAAG,iBAAiB,CAAC"}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* width of one request rather than being sent with a guessed id.
|
|
16
16
|
*/
|
|
17
17
|
import type { FollowStatus } from '@oxy.so/contracts';
|
|
18
|
+
import { type FollowErrorCode } from '../utils/followErrors.js';
|
|
18
19
|
export interface UseFollowTargetResult {
|
|
19
20
|
status: FollowStatus;
|
|
20
21
|
/**
|
|
@@ -25,11 +26,12 @@ export interface UseFollowTargetResult {
|
|
|
25
26
|
/** True until the first read settles. Distinct from "not following". */
|
|
26
27
|
isUnknown: boolean;
|
|
27
28
|
isPending: boolean;
|
|
28
|
-
|
|
29
|
+
/** Why the last read or write failed — a code; `useFollowErrorMessage()` words it. */
|
|
30
|
+
error: FollowErrorCode | undefined;
|
|
29
31
|
/**
|
|
30
32
|
* Every mutation resolves to whether the server ACCEPTED it.
|
|
31
33
|
*
|
|
32
|
-
* They never reject — a refusal becomes `error` in the store, so the button
|
|
34
|
+
* They never reject — a refusal becomes an `error` code in the store, so the button
|
|
33
35
|
* can render it — which means a caller that only awaits them cannot tell a
|
|
34
36
|
* write that happened from one that did not. Returning the outcome is what
|
|
35
37
|
* lets a caller mirror the change somewhere else without mirroring failures
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFollowTarget.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollowTarget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"useFollowTarget.d.ts","sourceRoot":"","sources":["../../../../../src/ui/hooks/useFollowTarget.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAStD,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,0BAAuB,CAAC;AAE/B,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,YAAY,CAAC;IACrB;;;OAGG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,wEAAwE;IACxE,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,sFAAsF;IACtF,KAAK,EAAE,eAAe,GAAG,SAAS,CAAC;IACnC;;;;;;;;OAQG;IACH,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/D,QAAQ,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACjC,wEAAwE;IACxE,WAAW,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACpC,UAAU,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,OAAO,CAAC,EAAE;IAAE,aAAa,CAAC,EAAE,YAAY,CAAA;CAAE,GACzC,qBAAqB,CAkKvB"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { OxyServices, BulkFollowResult, BulkUnfollowResult } from '@oxy.so/core';
|
|
2
|
+
import { type FollowErrorCode } from '../utils/followErrors.js';
|
|
2
3
|
interface FollowState {
|
|
3
4
|
followingUsers: Record<string, boolean>;
|
|
4
5
|
loadingUsers: Record<string, boolean>;
|
|
5
6
|
fetchingUsers: Record<string, boolean>;
|
|
6
|
-
|
|
7
|
+
/** Why the last read or write of a user failed, as a code — never text. */
|
|
8
|
+
errors: Record<string, FollowErrorCode | null>;
|
|
7
9
|
followerCounts: Record<string, number>;
|
|
8
10
|
followingCounts: Record<string, number>;
|
|
9
11
|
loadingCounts: Record<string, boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"followStore.d.ts","sourceRoot":"","sources":["../../../../../src/ui/stores/followStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAEnB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"followStore.d.ts","sourceRoot":"","sources":["../../../../../src/ui/stores/followStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,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AAO,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEhG,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1D,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,4BAA4B,EAAE,CAC5B,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,QAAQ,GAAG,UAAU,EAC7B,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAChD,aAAa,CAAC,EAAE,MAAM,KACnB,IAAI,CAAC;IACV,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9E;AA8BD,kFAAkF;AAClF,eAAO,MAAM,qBAAqB,QAAO,IAMxC,CAAC;AAEF,eAAO,MAAM,cAAc,0EAsYxB,CAAC"}
|
|
@@ -22,13 +22,15 @@
|
|
|
22
22
|
* why a follow the user can see in their list does nothing in this app.
|
|
23
23
|
*/
|
|
24
24
|
import type { FollowApplicationMode, FollowRecord, FollowStatus } from '@oxy.so/contracts';
|
|
25
|
+
import type { FollowErrorCode } from '../utils/followErrors.js';
|
|
25
26
|
/** The status of one target, or `undefined` when it has never been read. */
|
|
26
27
|
type StatusMap = Record<string, FollowStatus | undefined>;
|
|
27
28
|
interface FollowTargetState {
|
|
28
29
|
statuses: StatusMap;
|
|
29
30
|
/** In-flight writes, per target. Reads do not set this — only mutations do. */
|
|
30
31
|
pending: Record<string, boolean>;
|
|
31
|
-
|
|
32
|
+
/** Why the last read or write of a target failed, as a code — never text. */
|
|
33
|
+
errors: Record<string, FollowErrorCode | undefined>;
|
|
32
34
|
setStatus: (targetId: string, status: FollowStatus) => void;
|
|
33
35
|
/**
|
|
34
36
|
* Seed many statuses at once — from a follow list, a feed payload, anything
|
|
@@ -37,7 +39,7 @@ interface FollowTargetState {
|
|
|
37
39
|
*/
|
|
38
40
|
seed: (entries: Record<string, FollowStatus>) => void;
|
|
39
41
|
setPending: (targetId: string, pending: boolean) => void;
|
|
40
|
-
setError: (targetId: string, error:
|
|
42
|
+
setError: (targetId: string, error: FollowErrorCode | undefined) => void;
|
|
41
43
|
/** Drop everything. Called on identity change — see the note below. */
|
|
42
44
|
reset: () => void;
|
|
43
45
|
}
|