@wix/members 1.0.541 → 1.0.542
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/account-details-context-provider/package.json +3 -0
- package/account-home-context-provider/package.json +3 -0
- package/address-context-provider/package.json +3 -0
- package/addresses-context-provider/package.json +3 -0
- package/build/cjs/context-account-details.d.ts +246 -0
- package/build/cjs/context-account-details.js +9508 -0
- package/build/cjs/context-account-details.js.map +1 -0
- package/build/cjs/context-account-home.d.ts +54 -0
- package/build/cjs/context-account-home.js +719 -0
- package/build/cjs/context-account-home.js.map +1 -0
- package/build/cjs/context-address.d.ts +52 -0
- package/build/cjs/context-address.js +587 -0
- package/build/cjs/context-address.js.map +1 -0
- package/build/cjs/context-addresses.d.ts +104 -0
- package/build/cjs/context-addresses.js +9054 -0
- package/build/cjs/context-addresses.js.map +1 -0
- package/build/cjs/context-authentication.d.ts +633 -0
- package/build/cjs/context-authentication.js +4253 -0
- package/build/cjs/context-authentication.js.map +1 -0
- package/build/es/context-account-details.d.mts +246 -0
- package/build/es/context-account-details.mjs +9462 -0
- package/build/es/context-account-details.mjs.map +1 -0
- package/build/es/context-account-home.d.mts +54 -0
- package/build/es/context-account-home.mjs +690 -0
- package/build/es/context-account-home.mjs.map +1 -0
- package/build/es/context-address.d.mts +52 -0
- package/build/es/context-address.mjs +557 -0
- package/build/es/context-address.mjs.map +1 -0
- package/build/es/context-addresses.d.mts +104 -0
- package/build/es/context-addresses.mjs +9012 -0
- package/build/es/context-addresses.mjs.map +1 -0
- package/build/es/context-authentication.d.mts +633 -0
- package/build/es/context-authentication.mjs +4221 -0
- package/build/es/context-authentication.mjs.map +1 -0
- package/build/internal/cjs/context-account-details.d.ts +246 -0
- package/build/internal/cjs/context-account-home.d.ts +54 -0
- package/build/internal/cjs/context-address.d.ts +52 -0
- package/build/internal/cjs/context-addresses.d.ts +104 -0
- package/build/internal/cjs/context-authentication.d.ts +633 -0
- package/build/internal/es/context-account-details.d.mts +246 -0
- package/build/internal/es/context-account-home.d.mts +54 -0
- package/build/internal/es/context-address.d.mts +52 -0
- package/build/internal/es/context-addresses.d.mts +104 -0
- package/build/internal/es/context-authentication.d.mts +633 -0
- package/context/account-details/package.json +3 -0
- package/context/account-home/package.json +3 -0
- package/context/address/package.json +3 -0
- package/context/addresses/package.json +3 -0
- package/context/authentication/package.json +3 -0
- package/context-runtime/context-account-details/runtime.d.ts +246 -0
- package/context-runtime/context-account-details/runtime.js +14 -0
- package/context-runtime/context-account-home/runtime.d.ts +54 -0
- package/context-runtime/context-account-home/runtime.js +2 -0
- package/context-runtime/context-address/runtime.d.ts +52 -0
- package/context-runtime/context-address/runtime.js +2 -0
- package/context-runtime/context-addresses/runtime.d.ts +104 -0
- package/context-runtime/context-addresses/runtime.js +14 -0
- package/context-runtime/context-authentication/runtime.d.ts +633 -0
- package/context-runtime/context-authentication/runtime.js +6 -0
- package/package.json +86 -13
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
//#region src/extensions/account-home/context-providers/member-details.d.ts
|
|
4
|
+
/** The logged-in member, named after `@wix/members` `Member`; `null` when nobody is logged in. */
|
|
5
|
+
interface AccountHomeMember {
|
|
6
|
+
contact: {
|
|
7
|
+
firstName: string | null;
|
|
8
|
+
};
|
|
9
|
+
profile: {
|
|
10
|
+
nickname: string | null;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/extensions/account-home/context-providers/account-home-context-provider.d.ts
|
|
15
|
+
/** The Account Home page's state, for its greeting and Member Activity. */
|
|
16
|
+
interface AccountHomeContextValue {
|
|
17
|
+
/** @internal */
|
|
18
|
+
member: AccountHomeMember | null;
|
|
19
|
+
/** Whether Member Activity holds any card whose app is installed; `undefined` until known. */
|
|
20
|
+
hasInstalledPromoCards: boolean | undefined;
|
|
21
|
+
/** Whether any card in Member Activity shows something once read; `undefined` until known. */
|
|
22
|
+
hasPromoCardContent: boolean | undefined;
|
|
23
|
+
}
|
|
24
|
+
type PromoScopeProps = PropsWithChildren<{
|
|
25
|
+
onOccupancyChange?: (occupied: boolean) => void; /** Shown while the scope's content suspends; the scope has not reported until it commits. */
|
|
26
|
+
fallback?: ReactNode;
|
|
27
|
+
}>;
|
|
28
|
+
interface PromoCardOptions {
|
|
29
|
+
promoCard: true;
|
|
30
|
+
}
|
|
31
|
+
interface PromoCardRegistration {
|
|
32
|
+
/** False while any card on the page is still loading; a card holds its skeleton until then. */
|
|
33
|
+
revealed: boolean;
|
|
34
|
+
/** Reports the card's read as settled, whatever it resolved to. */
|
|
35
|
+
settle: () => void;
|
|
36
|
+
/** Reports that the card shows something, until the returned callback is called. */
|
|
37
|
+
showContent: () => () => void;
|
|
38
|
+
}
|
|
39
|
+
interface PromoScopeOptions {
|
|
40
|
+
promoScope: true;
|
|
41
|
+
}
|
|
42
|
+
type AccountHomeHookOptions = PromoCardOptions | PromoScopeOptions;
|
|
43
|
+
/**
|
|
44
|
+
* Reads the Account Home context. With no options it returns the context value and suspends until
|
|
45
|
+
* the logged-in member is read; `promoCard` registers the calling card and `promoScope` returns the
|
|
46
|
+
* Member Activity scope, and neither waits on the member read or requires an attached provider.
|
|
47
|
+
*/
|
|
48
|
+
declare function useAccountHome(): AccountHomeContextValue;
|
|
49
|
+
declare function useAccountHome(options: PromoCardOptions): PromoCardRegistration;
|
|
50
|
+
declare function useAccountHome(options: PromoScopeOptions): FC<PromoScopeProps>;
|
|
51
|
+
/** Provides the logged-in member and whether Member Activity holds an installed card to its children. */
|
|
52
|
+
declare const AccountHomeContextProvider: FC<PropsWithChildren>;
|
|
53
|
+
|
|
54
|
+
export { AccountHomeContextProvider, type AccountHomeContextValue, type AccountHomeHookOptions, type AccountHomeMember, type PromoCardOptions, type PromoCardRegistration, type PromoScopeOptions, type PromoScopeProps, AccountHomeContextProvider as default, useAccountHome };
|