bitsnap-react 1.7.0 → 1.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/dist/CartProvider-5KAG5QGA.mjs +2 -0
- package/dist/CartProvider-7GJXW2IP.js +2 -0
- package/dist/CartProvider-7GJXW2IP.js.map +1 -0
- package/dist/catalog.js +1 -1
- package/dist/catalog.js.map +1 -1
- package/dist/catalog.mjs +1 -1
- package/dist/chunk-45AP7UZE.mjs +2 -0
- package/dist/chunk-45AP7UZE.mjs.map +1 -0
- package/dist/chunk-7XTDFTQU.js +4 -0
- package/dist/chunk-7XTDFTQU.js.map +1 -0
- package/dist/chunk-C6Z7LOHB.mjs +2 -0
- package/dist/chunk-C6Z7LOHB.mjs.map +1 -0
- package/dist/chunk-HB6KQT26.mjs +4 -0
- package/dist/chunk-HB6KQT26.mjs.map +1 -0
- package/dist/chunk-JSDGZ4NY.js +2 -0
- package/dist/chunk-JSDGZ4NY.js.map +1 -0
- package/dist/chunk-KOVKUJAW.mjs +2 -0
- package/dist/chunk-KOVKUJAW.mjs.map +1 -0
- package/dist/chunk-KOYBZORL.js +2 -0
- package/dist/chunk-KOYBZORL.js.map +1 -0
- package/dist/chunk-LWK4E5G5.js +2 -0
- package/dist/chunk-LWK4E5G5.js.map +1 -0
- package/dist/chunk-OJT3YO2R.mjs +2 -0
- package/dist/{chunk-6KQBDN7M.mjs.map → chunk-OJT3YO2R.mjs.map} +1 -1
- package/dist/chunk-OUYRKNZJ.mjs +2 -0
- package/dist/chunk-OUYRKNZJ.mjs.map +1 -0
- package/dist/chunk-P2YB25KZ.js +2 -0
- package/dist/chunk-P2YB25KZ.js.map +1 -0
- package/dist/chunk-T2POA6RW.js +2 -0
- package/dist/chunk-T2POA6RW.js.map +1 -0
- package/dist/chunk-VPKE2ZOR.mjs +2 -0
- package/dist/{chunk-6W4FCL22.mjs.map → chunk-VPKE2ZOR.mjs.map} +1 -1
- package/dist/chunk-WRCXZMKK.js +2 -0
- package/dist/chunk-WRCXZMKK.js.map +1 -0
- package/dist/chunk-WSM4OM72.mjs +2 -0
- package/dist/chunk-WSM4OM72.mjs.map +1 -0
- package/dist/chunk-XRNTUSBH.js +2 -0
- package/dist/chunk-XRNTUSBH.js.map +1 -0
- package/dist/chunk-Z2BKIX6F.js +2 -0
- package/dist/chunk-Z2BKIX6F.js.map +1 -0
- package/dist/course.d.mts +1872 -0
- package/dist/course.d.ts +1872 -0
- package/dist/course.js +2 -0
- package/dist/course.js.map +1 -0
- package/dist/course.mjs +2 -0
- package/dist/course.mjs.map +1 -0
- package/dist/errors.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +10 -36
- package/dist/index.d.ts +10 -36
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal.js +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/methods-ITD6WFIY.mjs +2 -0
- package/dist/methods-JENIGNF7.js +2 -0
- package/dist/methods-JENIGNF7.js.map +1 -0
- package/dist/models.js +1 -1
- package/dist/models.js.map +1 -1
- package/dist/returns.d.mts +5 -195
- package/dist/returns.d.ts +5 -195
- package/dist/returns.js +1 -1
- package/dist/returns.js.map +1 -1
- package/dist/returns.mjs +1 -1
- package/dist/texts-CIEFbJTN.d.ts +196 -0
- package/dist/texts-tQtAGJCT.d.mts +196 -0
- package/dist/types-BTm_ZolC.d.ts +40 -0
- package/dist/types-PSBBDdQm.d.mts +40 -0
- package/package.json +57 -22
- package/dist/CartProvider-FQCDE3HZ.mjs +0 -2
- package/dist/chunk-3TENJTY4.mjs +0 -2
- package/dist/chunk-3TENJTY4.mjs.map +0 -1
- package/dist/chunk-4HOZFM6V.mjs +0 -2
- package/dist/chunk-4HOZFM6V.mjs.map +0 -1
- package/dist/chunk-6KQBDN7M.mjs +0 -2
- package/dist/chunk-6N24OFUB.mjs +0 -4
- package/dist/chunk-6N24OFUB.mjs.map +0 -1
- package/dist/chunk-6W4FCL22.mjs +0 -2
- package/dist/methods-J7S63RTQ.mjs +0 -2
- /package/dist/{CartProvider-FQCDE3HZ.mjs.map → CartProvider-5KAG5QGA.mjs.map} +0 -0
- /package/dist/{methods-J7S63RTQ.mjs.map → methods-ITD6WFIY.mjs.map} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { S as SlotAppearance, A as AppearanceElements } from './appearance-core-Dt2grZdl.mjs';
|
|
3
3
|
export { PRODUCT_LIST_SLOT_NAMES, ProductList, ProductListAppearance, ProductListAppearanceElements, ProductListAppearanceTokens, ProductListData, ProductListItemContext, ProductListProps, ProductListSlotAppearance, ProductListSlotName, ProductListTextKey, ProductListTexts, ProductListTheme, PublicListProduct, UseProductsOptions, UseProductsResult, formatProductPrice, useProducts } from './catalog.mjs';
|
|
4
|
-
|
|
5
|
-
export {
|
|
4
|
+
export { BitsnapReturns, BitsnapReturnsProps, BitsnapReturnsProvider, BitsnapReturnsProviderProps, CreateReturnInput, Environment, LegacyCreateReturnInput, LegacyReturnsTexts, LegacyReturnsTheme, ReturnsAppearanceProvider, ReturnsChallenge, ReturnsCodeStep, ReturnsCodeStepProps, ReturnsConfirmation, ReturnsConfirmationProps, ReturnsEmailStep, ReturnsEmailStepProps, ReturnsEnvironment, ReturnsEnvironmentInput, ReturnsMyReturnDetail, ReturnsMyReturnDetailProps, ReturnsMyReturnsList, ReturnsMyReturnsListProps, ReturnsOrderDetail, ReturnsOrderDetailProps, ReturnsOrderList, ReturnsOrderListProps, ReturnsProvider, ReturnsProviderProps, ReturnsResult, ReturnsResultProps, ReturnsSessionStatus, ReturnsTextsInput, SelectedReturnLine, UseCreateReturnResult, UseMyReturnResult, UseMyReturnsResult, UseReturnOrdersResult, UseReturnSessionResult, UseReturnableOrderResult, useCreateReturn, useMyReturn, useMyReturns, useReturnOrders, useReturnSession, useReturnableOrder, useReturnsAppearance, useReturnsSlot, useReturnsText } from './returns.mjs';
|
|
5
|
+
export { b as RETURNS_SLOT_NAMES, R as ReturnsAppearance, c as ReturnsAppearanceElements, d as ReturnsAppearanceTokens, e as ReturnsSlotAppearance, f as ReturnsSlotName, h as ReturnsTextKey, a as ReturnsTexts, g as ReturnsTheme } from './texts-tQtAGJCT.mjs';
|
|
6
6
|
import { ReactNode } from 'react';
|
|
7
7
|
import z__default from 'zod';
|
|
8
|
+
import { P as PanelProps, G as GetThemeOutput } from './types-PSBBDdQm.mjs';
|
|
9
|
+
export { a as PanelLoginProps, b as PanelScreen, c as PanelSearchParamsType } from './types-PSBBDdQm.mjs';
|
|
8
10
|
import './models.mjs';
|
|
9
11
|
import '@bufbuild/protobuf/wkt';
|
|
10
12
|
import '@bufbuild/protobuf';
|
|
@@ -403,6 +405,11 @@ declare const linkRequestSchema: z__default.ZodObject<{
|
|
|
403
405
|
}, z__default.core.$strip>;
|
|
404
406
|
|
|
405
407
|
declare namespace Bitsnap {
|
|
408
|
+
/**
|
|
409
|
+
* Adds a product or variant to the cart. Returns an `Err` instead of adding
|
|
410
|
+
* anything when the backend does not know the id
|
|
411
|
+
* (`item-ids-not-found`, with the unknown ids in `data`).
|
|
412
|
+
*/
|
|
406
413
|
function addProductToCart(id: string, quantity?: number, metadata?: Record<string, string | undefined>, args?: {
|
|
407
414
|
name?: string;
|
|
408
415
|
price?: number;
|
|
@@ -426,39 +433,6 @@ declare function injectReferenceToRequestIfNeeded(request: LinkRequest): LinkReq
|
|
|
426
433
|
|
|
427
434
|
declare const PanelLogin: () => react_jsx_runtime.JSX.Element;
|
|
428
435
|
|
|
429
|
-
interface GetThemeOutput {
|
|
430
|
-
logoURL?: string;
|
|
431
|
-
logoDarkURL?: string;
|
|
432
|
-
colors?: {
|
|
433
|
-
brand?: string;
|
|
434
|
-
brandDark?: string;
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
type PanelScreen = "products" | "notifications" | "profile" | "plans" | "orders" | "order-details" | "returns" | "return-details";
|
|
438
|
-
type PanelSearchParamsType = {
|
|
439
|
-
product?: string;
|
|
440
|
-
state: PanelScreen;
|
|
441
|
-
orderId?: string;
|
|
442
|
-
returnId?: string;
|
|
443
|
-
};
|
|
444
|
-
interface PanelProps {
|
|
445
|
-
projectID: string;
|
|
446
|
-
theme?: GetThemeOutput;
|
|
447
|
-
loginURL: string;
|
|
448
|
-
/**
|
|
449
|
-
* Appearance of the Returns screen. When omitted, `buttonBackground`,
|
|
450
|
-
* `focusRing` and a readable `buttonForeground` are derived from
|
|
451
|
-
* `theme.colors.brand`.
|
|
452
|
-
*/
|
|
453
|
-
returnsAppearance?: ReturnsAppearance;
|
|
454
|
-
/** Text overrides of the Returns screen. */
|
|
455
|
-
returnsTexts?: Partial<ReturnsTexts>;
|
|
456
|
-
}
|
|
457
|
-
interface PanelLoginProps {
|
|
458
|
-
projectID: string;
|
|
459
|
-
theme?: GetThemeOutput;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
436
|
declare const PanelPage: ({ returnsAppearance, returnsTexts, }?: Pick<PanelProps, "returnsAppearance" | "returnsTexts">) => react_jsx_runtime.JSX.Element;
|
|
463
437
|
|
|
464
438
|
interface Props {
|
|
@@ -495,4 +469,4 @@ declare function persistReturnURL(returnURL: string | null): void;
|
|
|
495
469
|
declare function readPersistedReturnURL(): string | null;
|
|
496
470
|
declare function buildAccessTokenRedirect(returnURL: string, accessToken: string): string;
|
|
497
471
|
|
|
498
|
-
export { Wrapper$2 as ApplePayButton, type Props$3 as ApplePayButtonProps, Bitsnap, type BitsnapCartProps, BitsnapCart as BitsnapCheckout, CHECKOUT_SLOT_NAMES, type CheckoutAppearance, type CheckoutAppearanceElements, type CheckoutAppearanceTokens, type CheckoutSlotAppearance, type CheckoutSlotName, type CheckoutTexts, type CheckoutTheme, type ComponentClassNames, type CustomizationTexts,
|
|
472
|
+
export { Wrapper$2 as ApplePayButton, type Props$3 as ApplePayButtonProps, Bitsnap, type BitsnapCartProps, BitsnapCart as BitsnapCheckout, CHECKOUT_SLOT_NAMES, type CheckoutAppearance, type CheckoutAppearanceElements, type CheckoutAppearanceTokens, type CheckoutSlotAppearance, type CheckoutSlotName, type CheckoutTexts, type CheckoutTheme, type ComponentClassNames, type CustomizationTexts, GetThemeOutput, Wrapper$1 as GooglePayButton, type Props$2 as GooglePayButtonProps, type LinkRequest, type NotificationGroup, Wrapper as NotificationsComponent, type Props$1 as NotificationsComponentProps, type NotificationsComponentPublicProps, PanelPage as Panel, type PanelConfig, PanelLogin, PanelProps, PanelProvider, type PublicNotificationGroup, PublicOrderPage, buildAccessTokenRedirect, createCheckout, createPaymentURL, getAllowedReturnOrigins, getLocale, getPanelConfig, getReferenceIfPossible, getReturnURLFromSearch, injectReferenceToRequestIfNeeded, persistReturnURL, readPersistedReturnURL, setAllowedReturnOrigins, setCustomHost, setHost, setLocale, setLoginURL, setPanelConfig, setProjectID as setPanelProjectID, setProjectID$1 as setProjectID, setTheme, usePanelConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { S as SlotAppearance, A as AppearanceElements } from './appearance-core-Dt2grZdl.js';
|
|
3
3
|
export { PRODUCT_LIST_SLOT_NAMES, ProductList, ProductListAppearance, ProductListAppearanceElements, ProductListAppearanceTokens, ProductListData, ProductListItemContext, ProductListProps, ProductListSlotAppearance, ProductListSlotName, ProductListTextKey, ProductListTexts, ProductListTheme, PublicListProduct, UseProductsOptions, UseProductsResult, formatProductPrice, useProducts } from './catalog.js';
|
|
4
|
-
|
|
5
|
-
export {
|
|
4
|
+
export { BitsnapReturns, BitsnapReturnsProps, BitsnapReturnsProvider, BitsnapReturnsProviderProps, CreateReturnInput, Environment, LegacyCreateReturnInput, LegacyReturnsTexts, LegacyReturnsTheme, ReturnsAppearanceProvider, ReturnsChallenge, ReturnsCodeStep, ReturnsCodeStepProps, ReturnsConfirmation, ReturnsConfirmationProps, ReturnsEmailStep, ReturnsEmailStepProps, ReturnsEnvironment, ReturnsEnvironmentInput, ReturnsMyReturnDetail, ReturnsMyReturnDetailProps, ReturnsMyReturnsList, ReturnsMyReturnsListProps, ReturnsOrderDetail, ReturnsOrderDetailProps, ReturnsOrderList, ReturnsOrderListProps, ReturnsProvider, ReturnsProviderProps, ReturnsResult, ReturnsResultProps, ReturnsSessionStatus, ReturnsTextsInput, SelectedReturnLine, UseCreateReturnResult, UseMyReturnResult, UseMyReturnsResult, UseReturnOrdersResult, UseReturnSessionResult, UseReturnableOrderResult, useCreateReturn, useMyReturn, useMyReturns, useReturnOrders, useReturnSession, useReturnableOrder, useReturnsAppearance, useReturnsSlot, useReturnsText } from './returns.js';
|
|
5
|
+
export { b as RETURNS_SLOT_NAMES, R as ReturnsAppearance, c as ReturnsAppearanceElements, d as ReturnsAppearanceTokens, e as ReturnsSlotAppearance, f as ReturnsSlotName, h as ReturnsTextKey, a as ReturnsTexts, g as ReturnsTheme } from './texts-CIEFbJTN.js';
|
|
6
6
|
import { ReactNode } from 'react';
|
|
7
7
|
import z__default from 'zod';
|
|
8
|
+
import { P as PanelProps, G as GetThemeOutput } from './types-BTm_ZolC.js';
|
|
9
|
+
export { a as PanelLoginProps, b as PanelScreen, c as PanelSearchParamsType } from './types-BTm_ZolC.js';
|
|
8
10
|
import './models.js';
|
|
9
11
|
import '@bufbuild/protobuf/wkt';
|
|
10
12
|
import '@bufbuild/protobuf';
|
|
@@ -403,6 +405,11 @@ declare const linkRequestSchema: z__default.ZodObject<{
|
|
|
403
405
|
}, z__default.core.$strip>;
|
|
404
406
|
|
|
405
407
|
declare namespace Bitsnap {
|
|
408
|
+
/**
|
|
409
|
+
* Adds a product or variant to the cart. Returns an `Err` instead of adding
|
|
410
|
+
* anything when the backend does not know the id
|
|
411
|
+
* (`item-ids-not-found`, with the unknown ids in `data`).
|
|
412
|
+
*/
|
|
406
413
|
function addProductToCart(id: string, quantity?: number, metadata?: Record<string, string | undefined>, args?: {
|
|
407
414
|
name?: string;
|
|
408
415
|
price?: number;
|
|
@@ -426,39 +433,6 @@ declare function injectReferenceToRequestIfNeeded(request: LinkRequest): LinkReq
|
|
|
426
433
|
|
|
427
434
|
declare const PanelLogin: () => react_jsx_runtime.JSX.Element;
|
|
428
435
|
|
|
429
|
-
interface GetThemeOutput {
|
|
430
|
-
logoURL?: string;
|
|
431
|
-
logoDarkURL?: string;
|
|
432
|
-
colors?: {
|
|
433
|
-
brand?: string;
|
|
434
|
-
brandDark?: string;
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
type PanelScreen = "products" | "notifications" | "profile" | "plans" | "orders" | "order-details" | "returns" | "return-details";
|
|
438
|
-
type PanelSearchParamsType = {
|
|
439
|
-
product?: string;
|
|
440
|
-
state: PanelScreen;
|
|
441
|
-
orderId?: string;
|
|
442
|
-
returnId?: string;
|
|
443
|
-
};
|
|
444
|
-
interface PanelProps {
|
|
445
|
-
projectID: string;
|
|
446
|
-
theme?: GetThemeOutput;
|
|
447
|
-
loginURL: string;
|
|
448
|
-
/**
|
|
449
|
-
* Appearance of the Returns screen. When omitted, `buttonBackground`,
|
|
450
|
-
* `focusRing` and a readable `buttonForeground` are derived from
|
|
451
|
-
* `theme.colors.brand`.
|
|
452
|
-
*/
|
|
453
|
-
returnsAppearance?: ReturnsAppearance;
|
|
454
|
-
/** Text overrides of the Returns screen. */
|
|
455
|
-
returnsTexts?: Partial<ReturnsTexts>;
|
|
456
|
-
}
|
|
457
|
-
interface PanelLoginProps {
|
|
458
|
-
projectID: string;
|
|
459
|
-
theme?: GetThemeOutput;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
436
|
declare const PanelPage: ({ returnsAppearance, returnsTexts, }?: Pick<PanelProps, "returnsAppearance" | "returnsTexts">) => react_jsx_runtime.JSX.Element;
|
|
463
437
|
|
|
464
438
|
interface Props {
|
|
@@ -495,4 +469,4 @@ declare function persistReturnURL(returnURL: string | null): void;
|
|
|
495
469
|
declare function readPersistedReturnURL(): string | null;
|
|
496
470
|
declare function buildAccessTokenRedirect(returnURL: string, accessToken: string): string;
|
|
497
471
|
|
|
498
|
-
export { Wrapper$2 as ApplePayButton, type Props$3 as ApplePayButtonProps, Bitsnap, type BitsnapCartProps, BitsnapCart as BitsnapCheckout, CHECKOUT_SLOT_NAMES, type CheckoutAppearance, type CheckoutAppearanceElements, type CheckoutAppearanceTokens, type CheckoutSlotAppearance, type CheckoutSlotName, type CheckoutTexts, type CheckoutTheme, type ComponentClassNames, type CustomizationTexts,
|
|
472
|
+
export { Wrapper$2 as ApplePayButton, type Props$3 as ApplePayButtonProps, Bitsnap, type BitsnapCartProps, BitsnapCart as BitsnapCheckout, CHECKOUT_SLOT_NAMES, type CheckoutAppearance, type CheckoutAppearanceElements, type CheckoutAppearanceTokens, type CheckoutSlotAppearance, type CheckoutSlotName, type CheckoutTexts, type CheckoutTheme, type ComponentClassNames, type CustomizationTexts, GetThemeOutput, Wrapper$1 as GooglePayButton, type Props$2 as GooglePayButtonProps, type LinkRequest, type NotificationGroup, Wrapper as NotificationsComponent, type Props$1 as NotificationsComponentProps, type NotificationsComponentPublicProps, PanelPage as Panel, type PanelConfig, PanelLogin, PanelProps, PanelProvider, type PublicNotificationGroup, PublicOrderPage, buildAccessTokenRedirect, createCheckout, createPaymentURL, getAllowedReturnOrigins, getLocale, getPanelConfig, getReferenceIfPossible, getReturnURLFromSearch, injectReferenceToRequestIfNeeded, persistReturnURL, readPersistedReturnURL, setAllowedReturnOrigins, setCustomHost, setHost, setLocale, setLoginURL, setPanelConfig, setProjectID as setPanelProjectID, setProjectID$1 as setProjectID, setTheme, usePanelConfig };
|