@rpg-engine/long-bow 0.8.170 → 0.8.172
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/components/Store/CartView.d.ts +21 -1
- package/dist/components/Store/CountdownTimer.d.ts +7 -0
- package/dist/components/Store/FeaturedBanner.d.ts +23 -0
- package/dist/components/Store/PurchaseSuccess.d.ts +18 -0
- package/dist/components/Store/Store.d.ts +50 -2
- package/dist/components/Store/StoreBadges.d.ts +13 -0
- package/dist/components/Store/StoreCharacterSkinRow.d.ts +1 -0
- package/dist/components/Store/StoreItemRow.d.ts +10 -0
- package/dist/components/Store/TrustBar.d.ts +9 -0
- package/dist/components/Store/sections/StoreItemsSection.d.ts +13 -0
- package/dist/components/Store/sections/StorePacksSection.d.ts +11 -0
- package/dist/components/shared/CTAButton/CTAButton.d.ts +1 -0
- package/dist/components/shared/CustomScrollbar.d.ts +9 -0
- package/dist/index.d.ts +6 -1
- package/dist/long-bow.cjs.development.js +1284 -302
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +1281 -304
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/Features/store/FeaturedBanner.stories.d.ts +1 -0
- package/dist/stories/Features/store/PurchaseSuccess.stories.d.ts +1 -0
- package/dist/stories/Features/store/StoreBadges.stories.d.ts +1 -0
- package/dist/stories/Features/store/TrustBar.stories.d.ts +1 -0
- package/package.json +2 -2
- package/src/components/Marketplace/BuyPanel.tsx +1 -1
- package/src/components/Store/CartView.tsx +143 -13
- package/src/components/Store/CountdownTimer.tsx +86 -0
- package/src/components/Store/FeaturedBanner.tsx +273 -0
- package/src/components/Store/PurchaseSuccess.tsx +258 -0
- package/src/components/Store/Store.tsx +236 -50
- package/src/components/Store/StoreBadges.tsx +94 -0
- package/src/components/Store/StoreCharacterSkinRow.tsx +113 -22
- package/src/components/Store/StoreItemRow.tsx +135 -17
- package/src/components/Store/TrustBar.tsx +69 -0
- package/src/components/Store/__test__/CountdownTimer.spec.tsx +100 -0
- package/src/components/Store/__test__/FeaturedBanner.spec.tsx +207 -0
- package/src/components/Store/__test__/PurchaseSuccess.spec.tsx +174 -0
- package/src/components/Store/__test__/StoreBadges.spec.tsx +133 -0
- package/src/components/Store/__test__/TrustBar.spec.tsx +85 -0
- package/src/components/Store/sections/StoreItemsSection.tsx +27 -1
- package/src/components/Store/sections/StorePacksSection.tsx +92 -28
- package/src/components/shared/CTAButton/CTAButton.tsx +25 -1
- package/src/components/shared/CustomScrollbar.ts +41 -0
- package/src/components/shared/ItemRowWrapper.tsx +26 -12
- package/src/components/shared/ScrollableContent/ScrollableContent.tsx +3 -0
- package/src/components/shared/SpriteFromAtlas.tsx +4 -1
- package/src/index.tsx +6 -1
- package/src/stories/Features/store/FeaturedBanner.stories.tsx +121 -0
- package/src/stories/Features/store/PurchaseSuccess.stories.tsx +74 -0
- package/src/stories/Features/store/Store.stories.tsx +39 -3
- package/src/stories/Features/store/StoreBadges.stories.tsx +83 -0
- package/src/stories/Features/store/TrustBar.stories.tsx +51 -0
|
@@ -1,17 +1,37 @@
|
|
|
1
1
|
import { IProductBlueprint } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { ITrustSignal } from './TrustBar';
|
|
3
4
|
interface ICartItem {
|
|
4
5
|
item: IProductBlueprint;
|
|
5
6
|
quantity: number;
|
|
6
7
|
metadata?: Record<string, any>;
|
|
7
8
|
}
|
|
8
|
-
interface ICartViewProps {
|
|
9
|
+
export interface ICartViewProps {
|
|
9
10
|
cartItems: ICartItem[];
|
|
10
11
|
onRemoveFromCart: (itemKey: string) => void;
|
|
11
12
|
onClose: () => void;
|
|
12
13
|
onPurchase: () => Promise<boolean>;
|
|
13
14
|
atlasJSON: Record<string, any>;
|
|
14
15
|
atlasIMG: string;
|
|
16
|
+
paymentMethodLabel?: string;
|
|
17
|
+
trustSignals?: ITrustSignal[];
|
|
18
|
+
onCloseStore?: () => void;
|
|
19
|
+
/** Called when user taps the "Buy DC" nudge — open wallet/DC purchase flow */
|
|
20
|
+
onBuyDC?: () => void;
|
|
21
|
+
/** Fires when user taps the pay button — before the purchase resolves */
|
|
22
|
+
onCheckoutStart?: (items: Array<{
|
|
23
|
+
key: string;
|
|
24
|
+
name: string;
|
|
25
|
+
quantity: number;
|
|
26
|
+
}>, total: number) => void;
|
|
27
|
+
/** Fires after a successful purchase */
|
|
28
|
+
onPurchaseSuccess?: (items: Array<{
|
|
29
|
+
key: string;
|
|
30
|
+
name: string;
|
|
31
|
+
quantity: number;
|
|
32
|
+
}>, total: number) => void;
|
|
33
|
+
/** Fires when a purchase fails */
|
|
34
|
+
onPurchaseError?: (error: string) => void;
|
|
15
35
|
}
|
|
16
36
|
export declare const CartView: React.FC<ICartViewProps>;
|
|
17
37
|
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IFeaturedItem {
|
|
3
|
+
key: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
imageUrl?: string | {
|
|
7
|
+
src: string;
|
|
8
|
+
default?: string;
|
|
9
|
+
};
|
|
10
|
+
texturePath?: string;
|
|
11
|
+
price: number;
|
|
12
|
+
originalPrice?: number;
|
|
13
|
+
endsAt?: string;
|
|
14
|
+
badge?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IFeaturedBannerProps {
|
|
17
|
+
items: IFeaturedItem[];
|
|
18
|
+
atlasJSON?: any;
|
|
19
|
+
atlasIMG?: string;
|
|
20
|
+
onSelectItem: (item: IFeaturedItem) => void;
|
|
21
|
+
onQuickBuy?: (item: IFeaturedItem) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare const FeaturedBanner: React.FC<IFeaturedBannerProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MetadataType } from '@rpg-engine/shared';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface IPurchaseSuccessItem {
|
|
4
|
+
name: string;
|
|
5
|
+
texturePath: string;
|
|
6
|
+
quantity: number;
|
|
7
|
+
metadataType?: MetadataType;
|
|
8
|
+
metadata?: Record<string, any>;
|
|
9
|
+
}
|
|
10
|
+
export interface IPurchaseSuccessProps {
|
|
11
|
+
items: IPurchaseSuccessItem[];
|
|
12
|
+
totalPrice: number;
|
|
13
|
+
atlasJSON: Record<string, any>;
|
|
14
|
+
atlasIMG: string;
|
|
15
|
+
onContinueShopping: () => void;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const PurchaseSuccess: React.FC<IPurchaseSuccessProps>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IItemPack, IPurchase, IProductBlueprint, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
3
|
+
import { IFeaturedItem } from './FeaturedBanner';
|
|
4
|
+
declare type TabId = 'premium' | 'packs' | 'items' | 'wallet' | 'history';
|
|
4
5
|
export interface IStoreProps {
|
|
5
6
|
items: IProductBlueprint[];
|
|
6
7
|
packs?: IItemPack[];
|
|
@@ -21,7 +22,54 @@ export interface IStoreProps {
|
|
|
21
22
|
textInputItemKeys?: string[];
|
|
22
23
|
customPacksContent?: React.ReactNode;
|
|
23
24
|
customWalletContent?: React.ReactNode;
|
|
25
|
+
customHistoryContent?: React.ReactNode;
|
|
24
26
|
packsBadge?: string;
|
|
27
|
+
featuredItems?: IFeaturedItem[];
|
|
28
|
+
onQuickBuy?: (item: IProductBlueprint, quantity?: number) => void;
|
|
29
|
+
itemBadges?: Record<string, {
|
|
30
|
+
badges?: import('./StoreBadges').IStoreBadge[];
|
|
31
|
+
buyCount?: number;
|
|
32
|
+
viewersCount?: number;
|
|
33
|
+
saleEndsAt?: string;
|
|
34
|
+
originalPrice?: number;
|
|
35
|
+
}>;
|
|
36
|
+
packBadges?: Record<string, {
|
|
37
|
+
badges?: import('./StoreBadges').IStoreBadge[];
|
|
38
|
+
buyCount?: number;
|
|
39
|
+
viewersCount?: number;
|
|
40
|
+
saleEndsAt?: string;
|
|
41
|
+
originalPrice?: number;
|
|
42
|
+
}>;
|
|
43
|
+
/** Fires when an item row becomes visible (on mount). Useful for store_item_viewed analytics. */
|
|
44
|
+
onItemView?: (item: IProductBlueprint, position: number) => void;
|
|
45
|
+
/** Fires when a pack row becomes visible (on mount). Useful for pack_viewed analytics. */
|
|
46
|
+
onPackView?: (pack: IItemPack, position: number) => void;
|
|
47
|
+
/** Fires when the active store tab changes (e.g. 'items', 'packs', 'premium'). */
|
|
48
|
+
onTabChange?: (tab: string, itemsShown: number) => void;
|
|
49
|
+
/** Fires when the category filter changes in the items tab. */
|
|
50
|
+
onCategoryChange?: (category: string, itemsShown: number) => void;
|
|
51
|
+
/** Fires when the cart is opened. */
|
|
52
|
+
onCartOpen?: () => void;
|
|
53
|
+
/** Fires when any item or pack is added to the cart. */
|
|
54
|
+
onAddToCart?: (item: IProductBlueprint, quantity: number) => void;
|
|
55
|
+
/** Fires when an item is removed from the cart. */
|
|
56
|
+
onRemoveFromCart?: (itemKey: string) => void;
|
|
57
|
+
/** Fires when the user taps "Pay" — before the purchase resolves. */
|
|
58
|
+
onCheckoutStart?: (items: Array<{
|
|
59
|
+
key: string;
|
|
60
|
+
name: string;
|
|
61
|
+
quantity: number;
|
|
62
|
+
}>, total: number) => void;
|
|
63
|
+
/** Fires after a successful purchase. */
|
|
64
|
+
onPurchaseSuccess?: (items: Array<{
|
|
65
|
+
key: string;
|
|
66
|
+
name: string;
|
|
67
|
+
quantity: number;
|
|
68
|
+
}>, total: number) => void;
|
|
69
|
+
/** Fires when a purchase fails. */
|
|
70
|
+
onPurchaseError?: (error: string) => void;
|
|
71
|
+
/** Called when the DC nudge in CartView is tapped — open the DC purchase flow. */
|
|
72
|
+
onBuyDC?: () => void;
|
|
25
73
|
}
|
|
74
|
+
export type { IFeaturedItem };
|
|
26
75
|
export declare const Store: React.FC<IStoreProps>;
|
|
27
|
-
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type StoreBadgeType = 'popular' | 'bestSeller' | 'limited' | 'new' | 'sale' | 'event';
|
|
3
|
+
export interface IStoreBadge {
|
|
4
|
+
type: StoreBadgeType;
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IStoreBadgesProps {
|
|
8
|
+
badges?: IStoreBadge[];
|
|
9
|
+
buyCount?: number;
|
|
10
|
+
viewersCount?: number;
|
|
11
|
+
saleEndsAt?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const StoreBadges: React.FC<IStoreBadgesProps>;
|
|
@@ -6,6 +6,7 @@ interface IStoreCharacterSkinRowProps {
|
|
|
6
6
|
atlasIMG: string;
|
|
7
7
|
onAddToCart: (item: IProductBlueprint, quantity: number, metadata?: Record<string, any>) => void;
|
|
8
8
|
userAccountType: UserAccountTypes;
|
|
9
|
+
originalPrice?: number;
|
|
9
10
|
}
|
|
10
11
|
export declare const StoreCharacterSkinRow: React.FC<IStoreCharacterSkinRowProps>;
|
|
11
12
|
export {};
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { IProductBlueprint, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { IStoreBadge } from './StoreBadges';
|
|
3
4
|
interface IStoreItemRowProps {
|
|
4
5
|
item: IProductBlueprint;
|
|
5
6
|
atlasJSON: Record<string, any>;
|
|
6
7
|
atlasIMG: string;
|
|
7
8
|
onAddToCart: (item: IProductBlueprint, quantity: number, metadata?: Record<string, any>) => void;
|
|
9
|
+
onQuickBuy?: (item: IProductBlueprint, quantity: number, metadata?: Record<string, any>) => void;
|
|
8
10
|
userAccountType: UserAccountTypes;
|
|
9
11
|
showTextInput?: boolean;
|
|
10
12
|
textInputPlaceholder?: string;
|
|
13
|
+
badges?: IStoreBadge[];
|
|
14
|
+
buyCount?: number;
|
|
15
|
+
viewersCount?: number;
|
|
16
|
+
saleEndsAt?: string;
|
|
17
|
+
originalPrice?: number;
|
|
18
|
+
/** Fires once on mount — use for store_item_viewed analytics. */
|
|
19
|
+
onView?: (item: IProductBlueprint, position: number) => void;
|
|
20
|
+
positionInList?: number;
|
|
11
21
|
}
|
|
12
22
|
export declare const StoreItemRow: React.FC<IStoreItemRowProps>;
|
|
13
23
|
export {};
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
import { IProductBlueprint, UserAccountTypes } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { IStoreBadge } from '../StoreBadges';
|
|
3
4
|
interface IStoreItemsSectionProps {
|
|
4
5
|
items: IProductBlueprint[];
|
|
5
6
|
onAddToCart: (item: IProductBlueprint, quantity: number, metadata?: Record<string, any>) => void;
|
|
7
|
+
onQuickBuy?: (item: IProductBlueprint, quantity: number, metadata?: Record<string, any>) => void;
|
|
6
8
|
atlasJSON: Record<string, any>;
|
|
7
9
|
atlasIMG: string;
|
|
8
10
|
userAccountType?: UserAccountTypes;
|
|
9
11
|
textInputItemKeys?: string[];
|
|
12
|
+
itemBadges?: Record<string, {
|
|
13
|
+
badges?: IStoreBadge[];
|
|
14
|
+
buyCount?: number;
|
|
15
|
+
viewersCount?: number;
|
|
16
|
+
saleEndsAt?: string;
|
|
17
|
+
originalPrice?: number;
|
|
18
|
+
}>;
|
|
19
|
+
/** Fires when an item row becomes visible. Passes item and its 0-based position. */
|
|
20
|
+
onItemView?: (item: IProductBlueprint, position: number) => void;
|
|
21
|
+
/** Fires when the category filter changes. Passes new category and item count. */
|
|
22
|
+
onCategoryChange?: (category: string, itemsShown: number) => void;
|
|
10
23
|
}
|
|
11
24
|
export declare const StoreItemsSection: React.FC<IStoreItemsSectionProps>;
|
|
12
25
|
export {};
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import { IItemPack } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { IStoreBadge } from '../StoreBadges';
|
|
3
4
|
interface IStorePacksSectionProps {
|
|
4
5
|
packs: IItemPack[];
|
|
5
6
|
onAddToCart: (pack: IItemPack, quantity: number) => void;
|
|
7
|
+
onQuickBuy?: (pack: IItemPack, quantity: number) => void;
|
|
6
8
|
onSelectPack?: (pack: IItemPack) => void;
|
|
7
9
|
atlasJSON?: any;
|
|
8
10
|
atlasIMG?: string;
|
|
11
|
+
packBadges?: Record<string, {
|
|
12
|
+
badges?: IStoreBadge[];
|
|
13
|
+
buyCount?: number;
|
|
14
|
+
viewersCount?: number;
|
|
15
|
+
saleEndsAt?: string;
|
|
16
|
+
originalPrice?: number;
|
|
17
|
+
}>;
|
|
18
|
+
/** Fires once on mount per pack row — use for pack_viewed analytics. */
|
|
19
|
+
onPackView?: (pack: IItemPack, position: number) => void;
|
|
9
20
|
}
|
|
10
21
|
export declare const StorePacksSection: React.FC<IStorePacksSectionProps>;
|
|
11
22
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A reusable CSS mixin for a sleek, thin, 4px webkit scrollbar.
|
|
3
|
+
* Drops the thick native OS scrollbar arrows and housing.
|
|
4
|
+
*/
|
|
5
|
+
export declare const customScrollbarCSS: import("styled-components").FlattenSimpleInterpolation;
|
|
6
|
+
/**
|
|
7
|
+
* A basic div wrapper that applies the custom scrollbar style and guarantees overflow-y.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CustomScrollbarContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
package/dist/index.d.ts
CHANGED
|
@@ -67,10 +67,15 @@ export * from './components/SocialModal/SocialModal';
|
|
|
67
67
|
export * from './components/Spellbook/Spellbook';
|
|
68
68
|
export * from './components/Stepper';
|
|
69
69
|
export * from './components/Store/CartView';
|
|
70
|
+
export * from './components/Store/CountdownTimer';
|
|
71
|
+
export * from './components/Store/FeaturedBanner';
|
|
70
72
|
export * from './components/Store/hooks/useStoreCart';
|
|
71
73
|
export * from './components/Store/MetadataCollector';
|
|
72
|
-
export * from './components/Store/Store';
|
|
73
74
|
export * from './components/Store/PaymentMethodModal';
|
|
75
|
+
export * from './components/Store/PurchaseSuccess';
|
|
76
|
+
export * from './components/Store/Store';
|
|
77
|
+
export * from './components/Store/StoreBadges';
|
|
78
|
+
export * from './components/Store/TrustBar';
|
|
74
79
|
export * from './components/Table/Table';
|
|
75
80
|
export * from './components/TextArea';
|
|
76
81
|
export * from './components/TimeWidget/TimeWidget';
|