@sellhapi/studio-runtime 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AppointmentBooker.d.ts +7 -0
- package/dist/components/AppointmentBooker.d.ts.map +1 -0
- package/dist/components/ArticleCard.d.ts +6 -0
- package/dist/components/ArticleCard.d.ts.map +1 -0
- package/dist/components/ArticleGrid.d.ts +8 -0
- package/dist/components/ArticleGrid.d.ts.map +1 -0
- package/dist/components/DonationCampaignGrid.d.ts +7 -0
- package/dist/components/DonationCampaignGrid.d.ts.map +1 -0
- package/dist/components/DonationForm.d.ts +9 -0
- package/dist/components/DonationForm.d.ts.map +1 -0
- package/dist/components/EventCard.d.ts +6 -0
- package/dist/components/EventCard.d.ts.map +1 -0
- package/dist/components/EventGrid.d.ts +8 -0
- package/dist/components/EventGrid.d.ts.map +1 -0
- package/dist/components/MembershipTiers.d.ts +6 -0
- package/dist/components/MembershipTiers.d.ts.map +1 -0
- package/dist/components/ProductCard.d.ts +6 -0
- package/dist/components/ProductCard.d.ts.map +1 -0
- package/dist/components/ProductGrid.d.ts +9 -0
- package/dist/components/ProductGrid.d.ts.map +1 -0
- package/dist/components/RSVPForm.d.ts +7 -0
- package/dist/components/RSVPForm.d.ts.map +1 -0
- package/dist/context.d.ts +26 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/hooks/useArticles.d.ts +12 -0
- package/dist/hooks/useArticles.d.ts.map +1 -0
- package/dist/hooks/useBookAppointment.d.ts +26 -0
- package/dist/hooks/useBookAppointment.d.ts.map +1 -0
- package/dist/hooks/useCart.d.ts +63 -0
- package/dist/hooks/useCart.d.ts.map +1 -0
- package/dist/hooks/useCheckoutConfig.d.ts +21 -0
- package/dist/hooks/useCheckoutConfig.d.ts.map +1 -0
- package/dist/hooks/useCollection.d.ts +12 -0
- package/dist/hooks/useCollection.d.ts.map +1 -0
- package/dist/hooks/useContentForm.d.ts +31 -0
- package/dist/hooks/useContentForm.d.ts.map +1 -0
- package/dist/hooks/useContentItems.d.ts +122 -0
- package/dist/hooks/useContentItems.d.ts.map +1 -0
- package/dist/hooks/useCreateRSVP.d.ts +10 -0
- package/dist/hooks/useCreateRSVP.d.ts.map +1 -0
- package/dist/hooks/useDigitalProducts.d.ts +8 -0
- package/dist/hooks/useDigitalProducts.d.ts.map +1 -0
- package/dist/hooks/useDonate.d.ts +8 -0
- package/dist/hooks/useDonate.d.ts.map +1 -0
- package/dist/hooks/useDonationCampaigns.d.ts +10 -0
- package/dist/hooks/useDonationCampaigns.d.ts.map +1 -0
- package/dist/hooks/useEvents.d.ts +10 -0
- package/dist/hooks/useEvents.d.ts.map +1 -0
- package/dist/hooks/useFetch.d.ts +14 -0
- package/dist/hooks/useFetch.d.ts.map +1 -0
- package/dist/hooks/useMemberships.d.ts +5 -0
- package/dist/hooks/useMemberships.d.ts.map +1 -0
- package/dist/hooks/useProductCheckout.d.ts +15 -0
- package/dist/hooks/useProductCheckout.d.ts.map +1 -0
- package/dist/hooks/useProducts.d.ts +19 -0
- package/dist/hooks/useProducts.d.ts.map +1 -0
- package/dist/hooks/usePurchaseTickets.d.ts +8 -0
- package/dist/hooks/usePurchaseTickets.d.ts.map +1 -0
- package/dist/hooks/useServices.d.ts +8 -0
- package/dist/hooks/useServices.d.ts.map +1 -0
- package/dist/hooks/useShippingRates.d.ts +12 -0
- package/dist/hooks/useShippingRates.d.ts.map +1 -0
- package/dist/hooks/useStudioEditMode.d.ts +19 -0
- package/dist/hooks/useStudioEditMode.d.ts.map +1 -0
- package/dist/hooks/useSubscribeMembership.d.ts +8 -0
- package/dist/hooks/useSubscribeMembership.d.ts.map +1 -0
- package/dist/hooks/useValidateDiscount.d.ts +21 -0
- package/dist/hooks/useValidateDiscount.d.ts.map +1 -0
- package/dist/index.cjs +1594 -0
- package/dist/index.d.ts +104 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1571 -0
- package/dist/types/index.d.ts +162 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ProductCheckoutInput, CommerceActionResult } from "../types/index.js";
|
|
2
|
+
export interface UseProductCheckoutResult {
|
|
3
|
+
initiate: (input: ProductCheckoutInput) => Promise<CommerceActionResult>;
|
|
4
|
+
/** Alias for initiate — AI-generated code commonly uses this name. */
|
|
5
|
+
initiateCheckout: (input: ProductCheckoutInput) => Promise<CommerceActionResult>;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
error: string | null;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Single-product "Buy Now" checkout for physical and digital products.
|
|
11
|
+
* Calls POST /api/storefront/:vendorId/products/checkout
|
|
12
|
+
* Returns a Paystack paymentLink — redirect to it to complete payment.
|
|
13
|
+
*/
|
|
14
|
+
export declare function useProductCheckout(): UseProductCheckoutResult;
|
|
15
|
+
//# sourceMappingURL=useProductCheckout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProductCheckout.d.ts","sourceRoot":"","sources":["../../src/hooks/useProductCheckout.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEpF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAW,CAAC,KAAK,EAAE,oBAAoB,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAClF,sEAAsE;IACtE,gBAAgB,EAAG,CAAC,KAAK,EAAE,oBAAoB,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAClF,OAAO,EAAY,OAAO,CAAC;IAC3B,KAAK,EAAc,MAAM,GAAG,IAAI,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,wBAAwB,CA2B7D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { StoreProduct, StoreProductDetail } from "../types/index.js";
|
|
2
|
+
import type { FetchState } from "./useFetch.js";
|
|
3
|
+
export interface UseProductsOptions {
|
|
4
|
+
limit?: number;
|
|
5
|
+
categoryId?: string;
|
|
6
|
+
/** Fetch only these specific product IDs (pinned selection). Overrides limit behaviour. */
|
|
7
|
+
ids?: string[];
|
|
8
|
+
}
|
|
9
|
+
/** Fetches active physical products for the linked vendor */
|
|
10
|
+
export declare function useProducts(options?: UseProductsOptions): FetchState<StoreProduct[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Fetches a single physical product by ID.
|
|
13
|
+
*
|
|
14
|
+
* NOT YET IMPLEMENTED — no public single-product storefront endpoint exists.
|
|
15
|
+
* Use useProducts() (the list hook) instead. This stub will be wired up
|
|
16
|
+
* in Phase 7 when the dedicated endpoint is added to sell_api.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useProduct(_productId: string): FetchState<StoreProductDetail | null>;
|
|
19
|
+
//# sourceMappingURL=useProducts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProducts.d.ts","sourceRoot":"","sources":["../../src/hooks/useProducts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAO,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2FAA2F;IAC3F,GAAG,CAAC,EAAS,MAAM,EAAE,CAAC;CACvB;AAED,6DAA6D;AAC7D,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,UAAU,CAAC,YAAY,EAAE,CAAC,CAaxF;AAED;;;;;;GAMG;AAEH,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAEpF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PurchaseTicketsInput, CommerceActionResult } from "../types/index.js";
|
|
2
|
+
export interface UsePurchaseTicketsResult {
|
|
3
|
+
initiate: (input: PurchaseTicketsInput) => Promise<CommerceActionResult>;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
error: string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function usePurchaseTickets(): UsePurchaseTicketsResult;
|
|
8
|
+
//# sourceMappingURL=usePurchaseTickets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePurchaseTickets.d.ts","sourceRoot":"","sources":["../../src/hooks/usePurchaseTickets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEpF,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACzE,OAAO,EAAG,OAAO,CAAC;IAClB,KAAK,EAAK,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,wBAAgB,kBAAkB,IAAI,wBAAwB,CA2B7D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StorefrontService } from "../types/index.js";
|
|
2
|
+
import type { FetchState } from "./useFetch.js";
|
|
3
|
+
export interface UseServicesOptions {
|
|
4
|
+
limit?: number;
|
|
5
|
+
}
|
|
6
|
+
/** Fetches active bookable services for the linked vendor */
|
|
7
|
+
export declare function useServices(options?: UseServicesOptions): FetchState<StorefrontService[]>;
|
|
8
|
+
//# sourceMappingURL=useServices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useServices.d.ts","sourceRoot":"","sources":["../../src/hooks/useServices.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,6DAA6D;AAC7D,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAS7F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ShippingRate {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
locations: string;
|
|
5
|
+
price: string;
|
|
6
|
+
priceKobo: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function useShippingRates(destinationState: string | null): {
|
|
9
|
+
rates: ShippingRate[];
|
|
10
|
+
loading: boolean;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useShippingRates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useShippingRates.d.ts","sourceRoot":"","sources":["../../src/hooks/useShippingRates.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAS,MAAM,CAAC;IAClB,IAAI,EAAO,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAM,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG;IACjE,KAAK,EAAI,YAAY,EAAE,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;CAClB,CAsBA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useStudioEditMode
|
|
3
|
+
*
|
|
4
|
+
* Injected into AI-generated sites via App.tsx. Enables the Studio editor's
|
|
5
|
+
* visual region/component selection tools via a postMessage protocol.
|
|
6
|
+
*
|
|
7
|
+
* Inbound messages (from studio parent):
|
|
8
|
+
* { type: "studio:set-mode", mode: "none" | "region" | "component" }
|
|
9
|
+
* { type: "studio:navigate", page: string }
|
|
10
|
+
* { type: "studio:highlight", selector: string }
|
|
11
|
+
*
|
|
12
|
+
* Outbound messages (to studio parent):
|
|
13
|
+
* { type: "region:selected", slug: string, label: string, scope: string }
|
|
14
|
+
* { type: "component:selected", name: string, label: string, scope: string }
|
|
15
|
+
*
|
|
16
|
+
* This hook is a no-op in production (no message is ever sent to the iframe).
|
|
17
|
+
*/
|
|
18
|
+
export declare function useStudioEditMode(): void;
|
|
19
|
+
//# sourceMappingURL=useStudioEditMode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStudioEditMode.d.ts","sourceRoot":"","sources":["../../src/hooks/useStudioEditMode.ts"],"names":[],"mappings":"AAiKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CA+HxC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SubscribeMembershipInput, CommerceActionResult } from "../types/index.js";
|
|
2
|
+
export interface UseSubscribeMembershipResult {
|
|
3
|
+
initiate: (input: SubscribeMembershipInput) => Promise<CommerceActionResult>;
|
|
4
|
+
loading: boolean;
|
|
5
|
+
error: string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function useSubscribeMembership(): UseSubscribeMembershipResult;
|
|
8
|
+
//# sourceMappingURL=useSubscribeMembership.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSubscribeMembership.d.ts","sourceRoot":"","sources":["../../src/hooks/useSubscribeMembership.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAExF,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC7E,OAAO,EAAG,OAAO,CAAC;IAClB,KAAK,EAAK,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,wBAAgB,sBAAsB,IAAI,4BAA4B,CA2BrE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface DiscountValidationResult {
|
|
2
|
+
valid: boolean;
|
|
3
|
+
discountId?: string;
|
|
4
|
+
discountAmountKobo?: number;
|
|
5
|
+
cartTotalKobo?: number;
|
|
6
|
+
finalTotalKobo?: number;
|
|
7
|
+
description?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
code?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface UseValidateDiscountResult {
|
|
12
|
+
validate: (code: string, cartItems: Array<{
|
|
13
|
+
productId: string;
|
|
14
|
+
quantity: number;
|
|
15
|
+
}>) => Promise<DiscountValidationResult>;
|
|
16
|
+
loading: boolean;
|
|
17
|
+
result: DiscountValidationResult | null;
|
|
18
|
+
reset: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function useValidateDiscount(): UseValidateDiscountResult;
|
|
21
|
+
//# sourceMappingURL=useValidateDiscount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useValidateDiscount.d.ts","sourceRoot":"","sources":["../../src/hooks/useValidateDiscount.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAe,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAS,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAM,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAK,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAQ,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAc,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAe,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACzH,OAAO,EAAG,OAAO,CAAC;IAClB,MAAM,EAAI,wBAAwB,GAAG,IAAI,CAAC;IAC1C,KAAK,EAAK,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,mBAAmB,IAAI,yBAAyB,CAkC/D"}
|