bitsnap-react 1.7.1 → 1.9.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/README.md +130 -0
- package/dist/CartProvider-XWTLBIZ5.js +2 -0
- package/dist/CartProvider-XWTLBIZ5.js.map +1 -0
- package/dist/CartProvider-ZURLJNBW.mjs +2 -0
- package/dist/analytics.d.mts +28 -0
- package/dist/analytics.d.ts +28 -0
- package/dist/analytics.js +2 -0
- package/dist/analytics.js.map +1 -0
- package/dist/analytics.mjs +2 -0
- package/dist/catalog.d.mts +14 -1
- package/dist/catalog.d.ts +14 -1
- package/dist/catalog.js +1 -1
- package/dist/catalog.js.map +1 -1
- package/dist/catalog.mjs +1 -1
- package/dist/chunk-3IMJALBX.js +2 -0
- package/dist/chunk-3IMJALBX.js.map +1 -0
- package/dist/chunk-3UHPJ6NK.js +2 -0
- package/dist/chunk-3UHPJ6NK.js.map +1 -0
- package/dist/chunk-CO2P4FR5.js +2 -0
- package/dist/chunk-CO2P4FR5.js.map +1 -0
- package/dist/chunk-E6QVQEGZ.mjs +2 -0
- package/dist/chunk-E6QVQEGZ.mjs.map +1 -0
- package/dist/chunk-FHDFLSPW.js +2 -0
- package/dist/chunk-FHDFLSPW.js.map +1 -0
- package/dist/{chunk-6KQBDN7M.mjs → chunk-GN63ITLA.mjs} +2 -2
- package/dist/chunk-HKVMSMDF.mjs +2 -0
- package/dist/chunk-HKVMSMDF.mjs.map +1 -0
- package/dist/chunk-JSDGZ4NY.js +2 -0
- package/dist/chunk-JSDGZ4NY.js.map +1 -0
- package/dist/chunk-KG6RU37U.js +4 -0
- package/dist/chunk-KG6RU37U.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-LJWS6ZRJ.mjs +2 -0
- package/dist/chunk-LJWS6ZRJ.mjs.map +1 -0
- package/dist/chunk-LZE2E4TE.mjs +4 -0
- package/dist/chunk-LZE2E4TE.mjs.map +1 -0
- package/dist/chunk-QZJGNLCZ.js +2 -0
- package/dist/chunk-QZJGNLCZ.js.map +1 -0
- package/dist/chunk-RA452LXZ.mjs +2 -0
- package/dist/chunk-RA452LXZ.mjs.map +1 -0
- package/dist/chunk-SLLBTQTW.mjs +2 -0
- package/dist/chunk-SLLBTQTW.mjs.map +1 -0
- package/dist/chunk-SZ256RCC.mjs +2 -0
- package/dist/chunk-SZ256RCC.mjs.map +1 -0
- package/dist/chunk-V4U2PTKN.js +2 -0
- package/dist/chunk-V4U2PTKN.js.map +1 -0
- package/dist/chunk-VM6JEJFZ.js +2 -0
- package/dist/chunk-VM6JEJFZ.js.map +1 -0
- package/dist/chunk-VXB7LA4E.js +2 -0
- package/dist/chunk-VXB7LA4E.js.map +1 -0
- package/dist/chunk-XVQKEGPO.mjs +2 -0
- package/dist/chunk-XVQKEGPO.mjs.map +1 -0
- package/dist/consent.d.mts +158 -0
- package/dist/consent.d.ts +158 -0
- package/dist/consent.js +75 -0
- package/dist/consent.js.map +1 -0
- package/dist/consent.mjs +75 -0
- package/dist/consent.mjs.map +1 -0
- package/dist/course.d.mts +1882 -0
- package/dist/course.d.ts +1882 -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/embed/analytics.js +1 -0
- package/dist/embed/consent.js +74 -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 +56 -40
- package/dist/index.d.ts +56 -40
- 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/instrument-C_abZLHk.d.mts +912 -0
- package/dist/instrument-C_abZLHk.d.ts +912 -0
- package/dist/internal.js +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/methods-CYARZTYL.mjs +2 -0
- package/dist/methods-CYARZTYL.mjs.map +1 -0
- package/dist/methods-DAPEWVI6.js +2 -0
- package/dist/methods-DAPEWVI6.js.map +1 -0
- package/dist/models.js +1 -1
- package/dist/models.js.map +1 -1
- package/dist/returns.d.mts +14 -196
- package/dist/returns.d.ts +14 -196
- 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-BaqLJYuq.d.ts +53 -0
- package/dist/types-D_WnqwR_.d.mts +53 -0
- package/package.json +41 -5
- package/dist/CartProvider-F2VH7WFO.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-FTYJTO6O.mjs +0 -2
- package/dist/chunk-FTYJTO6O.mjs.map +0 -1
- package/dist/chunk-RATFYRKZ.mjs +0 -4
- package/dist/chunk-RATFYRKZ.mjs.map +0 -1
- package/dist/methods-PFZSMZFU.mjs +0 -2
- /package/dist/{CartProvider-F2VH7WFO.mjs.map → CartProvider-ZURLJNBW.mjs.map} +0 -0
- /package/dist/{methods-PFZSMZFU.mjs.map → analytics.mjs.map} +0 -0
- /package/dist/{chunk-6KQBDN7M.mjs.map → chunk-GN63ITLA.mjs.map} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { A as AnalyticsOption, l as Instrument } from './instrument-C_abZLHk.mjs';
|
|
2
3
|
import { S as SlotAppearance, A as AppearanceElements } from './appearance-core-Dt2grZdl.mjs';
|
|
3
4
|
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 {
|
|
5
|
+
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';
|
|
6
|
+
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
7
|
import { ReactNode } from 'react';
|
|
7
8
|
import z__default from 'zod';
|
|
9
|
+
import { P as PanelProps, G as GetThemeOutput } from './types-D_WnqwR_.mjs';
|
|
10
|
+
export { a as PanelLoginProps, b as PanelScreen, c as PanelSearchParamsType } from './types-D_WnqwR_.mjs';
|
|
8
11
|
import './models.mjs';
|
|
9
12
|
import '@bufbuild/protobuf/wkt';
|
|
10
13
|
import '@bufbuild/protobuf';
|
|
@@ -32,6 +35,12 @@ type Props$3 = {
|
|
|
32
35
|
};
|
|
33
36
|
}[];
|
|
34
37
|
onClick?: () => Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Usage statistics for your Bitsnap dashboard (Apple Pay clicks and
|
|
40
|
+
* results). On by default; `false` turns it off. Inside `<BitsnapCheckout>`
|
|
41
|
+
* the checkout's setting applies unless this is given.
|
|
42
|
+
*/
|
|
43
|
+
analytics?: AnalyticsOption;
|
|
35
44
|
};
|
|
36
45
|
declare function Wrapper$2(props: Props$3): react_jsx_runtime.JSX.Element;
|
|
37
46
|
|
|
@@ -144,8 +153,15 @@ type BitsnapCartProps = {
|
|
|
144
153
|
* whatever the locale; omitted keys keep the `pl`/`en` defaults.
|
|
145
154
|
*/
|
|
146
155
|
texts?: Partial<CheckoutTexts>;
|
|
156
|
+
/**
|
|
157
|
+
* Usage statistics for your Bitsnap dashboard (cart opened, checkout
|
|
158
|
+
* started, add to cart). On by default; `false` turns it off. An object
|
|
159
|
+
* lets you forward every event: `{ onEvent }`. Nothing is stored on the
|
|
160
|
+
* visitor's device.
|
|
161
|
+
*/
|
|
162
|
+
analytics?: AnalyticsOption;
|
|
147
163
|
};
|
|
148
|
-
declare function BitsnapCart({ projectID, locale, children, onVisibleChange, className, numberOfProductsInCartOptions, appearance, texts, }: BitsnapCartProps): react_jsx_runtime.JSX.Element;
|
|
164
|
+
declare function BitsnapCart({ projectID, locale, children, onVisibleChange, className, numberOfProductsInCartOptions, appearance, texts, analytics, }: BitsnapCartProps): react_jsx_runtime.JSX.Element;
|
|
149
165
|
|
|
150
166
|
type Props$2 = {
|
|
151
167
|
test?: boolean;
|
|
@@ -164,6 +180,12 @@ type Props$2 = {
|
|
|
164
180
|
[key: string]: string | undefined;
|
|
165
181
|
};
|
|
166
182
|
}[];
|
|
183
|
+
/**
|
|
184
|
+
* Usage statistics for your Bitsnap dashboard. On by default; `false` turns
|
|
185
|
+
* it off. Inside `<BitsnapCheckout>` the checkout's setting applies unless
|
|
186
|
+
* this is given.
|
|
187
|
+
*/
|
|
188
|
+
analytics?: AnalyticsOption;
|
|
167
189
|
};
|
|
168
190
|
declare function Wrapper$1(props: Props$2): react_jsx_runtime.JSX.Element;
|
|
169
191
|
|
|
@@ -297,10 +319,21 @@ interface NotificationsComponentPublicProps {
|
|
|
297
319
|
* Custom CSS class names for various component sections (for easier styling).
|
|
298
320
|
*/
|
|
299
321
|
className?: ComponentClassNames;
|
|
322
|
+
/**
|
|
323
|
+
* Public project ID used for usage statistics. Defaults to the one set by
|
|
324
|
+
* `<BitsnapCheckout projectID>`.
|
|
325
|
+
*/
|
|
326
|
+
projectID?: string;
|
|
327
|
+
/**
|
|
328
|
+
* Usage statistics for your Bitsnap dashboard (sign-ups). On by default;
|
|
329
|
+
* `false` turns it off. An object lets you forward every event:
|
|
330
|
+
* `{ onEvent }`. Nothing is stored on the visitor's device.
|
|
331
|
+
*/
|
|
332
|
+
analytics?: AnalyticsOption;
|
|
300
333
|
}
|
|
301
334
|
|
|
302
335
|
type Props$1 = NotificationsComponentPublicProps;
|
|
303
|
-
declare function Wrapper({ slug, userID, productID, projectName, projectLogo, projectLogoDark, groups, isManaging, texts, showQRCode, showPhoneInput, hiddenGroupIds, className, }: Props$1): react_jsx_runtime.JSX.Element;
|
|
336
|
+
declare function Wrapper({ slug, userID, productID, projectID, analytics, projectName, projectLogo, projectLogoDark, groups, isManaging, texts, showQRCode, showPhoneInput, hiddenGroupIds, className, }: Props$1): react_jsx_runtime.JSX.Element;
|
|
304
337
|
|
|
305
338
|
type ErrTypes = "internal" | "badInput" | "notFound";
|
|
306
339
|
type Err = {
|
|
@@ -412,6 +445,8 @@ declare namespace Bitsnap {
|
|
|
412
445
|
name?: string;
|
|
413
446
|
price?: number;
|
|
414
447
|
currency?: string;
|
|
448
|
+
/** Where `add_to_cart` is reported. Defaults to the mounted `<BitsnapCheckout>`. */
|
|
449
|
+
analytics?: Instrument;
|
|
415
450
|
}): Promise<Err | undefined>;
|
|
416
451
|
function showCart(): void;
|
|
417
452
|
function hideCart(): void;
|
|
@@ -429,48 +464,22 @@ declare function createCheckout(request: LinkRequest & {
|
|
|
429
464
|
declare function getReferenceIfPossible(): string | undefined;
|
|
430
465
|
declare function injectReferenceToRequestIfNeeded(request: LinkRequest): LinkRequest;
|
|
431
466
|
|
|
432
|
-
declare const PanelLogin: (
|
|
467
|
+
declare const PanelLogin: ({ analytics, }?: {
|
|
468
|
+
analytics?: AnalyticsOption;
|
|
469
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
433
470
|
|
|
434
|
-
|
|
435
|
-
logoURL?: string;
|
|
436
|
-
logoDarkURL?: string;
|
|
437
|
-
colors?: {
|
|
438
|
-
brand?: string;
|
|
439
|
-
brandDark?: string;
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
type PanelScreen = "products" | "notifications" | "profile" | "plans" | "orders" | "order-details" | "returns" | "return-details";
|
|
443
|
-
type PanelSearchParamsType = {
|
|
444
|
-
product?: string;
|
|
445
|
-
state: PanelScreen;
|
|
446
|
-
orderId?: string;
|
|
447
|
-
returnId?: string;
|
|
448
|
-
};
|
|
449
|
-
interface PanelProps {
|
|
450
|
-
projectID: string;
|
|
451
|
-
theme?: GetThemeOutput;
|
|
452
|
-
loginURL: string;
|
|
453
|
-
/**
|
|
454
|
-
* Appearance of the Returns screen. When omitted, `buttonBackground`,
|
|
455
|
-
* `focusRing` and a readable `buttonForeground` are derived from
|
|
456
|
-
* `theme.colors.brand`.
|
|
457
|
-
*/
|
|
458
|
-
returnsAppearance?: ReturnsAppearance;
|
|
459
|
-
/** Text overrides of the Returns screen. */
|
|
460
|
-
returnsTexts?: Partial<ReturnsTexts>;
|
|
461
|
-
}
|
|
462
|
-
interface PanelLoginProps {
|
|
463
|
-
projectID: string;
|
|
464
|
-
theme?: GetThemeOutput;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
declare const PanelPage: ({ returnsAppearance, returnsTexts, }?: Pick<PanelProps, "returnsAppearance" | "returnsTexts">) => react_jsx_runtime.JSX.Element;
|
|
471
|
+
declare const PanelPage: ({ returnsAppearance, returnsTexts, analytics, }?: Pick<PanelProps, "returnsAppearance" | "returnsTexts" | "analytics">) => react_jsx_runtime.JSX.Element;
|
|
468
472
|
|
|
469
473
|
interface Props {
|
|
470
474
|
orderID: string;
|
|
471
475
|
initialEmail?: string;
|
|
472
476
|
accessToken?: string;
|
|
473
477
|
onBack?: () => void;
|
|
478
|
+
/**
|
|
479
|
+
* Usage statistics for your Bitsnap dashboard (order viewed). Inside
|
|
480
|
+
* `<Panel>` or `<PanelProvider>` their setting applies unless this is given.
|
|
481
|
+
*/
|
|
482
|
+
analytics?: AnalyticsOption;
|
|
474
483
|
}
|
|
475
484
|
declare function PublicOrderPage(props: Props): react_jsx_runtime.JSX.Element;
|
|
476
485
|
|
|
@@ -492,6 +501,13 @@ declare function getAllowedReturnOrigins(): string[];
|
|
|
492
501
|
|
|
493
502
|
declare const PanelProvider: React.FC<{
|
|
494
503
|
children: React.ReactNode;
|
|
504
|
+
/**
|
|
505
|
+
* Usage statistics for your Bitsnap dashboard (panel logins, orders viewed,
|
|
506
|
+
* downloads, course progress). On by default; `false` turns it off. An
|
|
507
|
+
* object lets you forward every event: `{ onEvent }`. Nothing is stored on
|
|
508
|
+
* the visitor's device.
|
|
509
|
+
*/
|
|
510
|
+
analytics?: AnalyticsOption;
|
|
495
511
|
}>;
|
|
496
512
|
declare const usePanelConfig: () => PanelConfig;
|
|
497
513
|
|
|
@@ -500,4 +516,4 @@ declare function persistReturnURL(returnURL: string | null): void;
|
|
|
500
516
|
declare function readPersistedReturnURL(): string | null;
|
|
501
517
|
declare function buildAccessTokenRedirect(returnURL: string, accessToken: string): string;
|
|
502
518
|
|
|
503
|
-
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,
|
|
519
|
+
export { AnalyticsOption, 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,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { A as AnalyticsOption, l as Instrument } from './instrument-C_abZLHk.js';
|
|
2
3
|
import { S as SlotAppearance, A as AppearanceElements } from './appearance-core-Dt2grZdl.js';
|
|
3
4
|
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 {
|
|
5
|
+
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';
|
|
6
|
+
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
7
|
import { ReactNode } from 'react';
|
|
7
8
|
import z__default from 'zod';
|
|
9
|
+
import { P as PanelProps, G as GetThemeOutput } from './types-BaqLJYuq.js';
|
|
10
|
+
export { a as PanelLoginProps, b as PanelScreen, c as PanelSearchParamsType } from './types-BaqLJYuq.js';
|
|
8
11
|
import './models.js';
|
|
9
12
|
import '@bufbuild/protobuf/wkt';
|
|
10
13
|
import '@bufbuild/protobuf';
|
|
@@ -32,6 +35,12 @@ type Props$3 = {
|
|
|
32
35
|
};
|
|
33
36
|
}[];
|
|
34
37
|
onClick?: () => Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Usage statistics for your Bitsnap dashboard (Apple Pay clicks and
|
|
40
|
+
* results). On by default; `false` turns it off. Inside `<BitsnapCheckout>`
|
|
41
|
+
* the checkout's setting applies unless this is given.
|
|
42
|
+
*/
|
|
43
|
+
analytics?: AnalyticsOption;
|
|
35
44
|
};
|
|
36
45
|
declare function Wrapper$2(props: Props$3): react_jsx_runtime.JSX.Element;
|
|
37
46
|
|
|
@@ -144,8 +153,15 @@ type BitsnapCartProps = {
|
|
|
144
153
|
* whatever the locale; omitted keys keep the `pl`/`en` defaults.
|
|
145
154
|
*/
|
|
146
155
|
texts?: Partial<CheckoutTexts>;
|
|
156
|
+
/**
|
|
157
|
+
* Usage statistics for your Bitsnap dashboard (cart opened, checkout
|
|
158
|
+
* started, add to cart). On by default; `false` turns it off. An object
|
|
159
|
+
* lets you forward every event: `{ onEvent }`. Nothing is stored on the
|
|
160
|
+
* visitor's device.
|
|
161
|
+
*/
|
|
162
|
+
analytics?: AnalyticsOption;
|
|
147
163
|
};
|
|
148
|
-
declare function BitsnapCart({ projectID, locale, children, onVisibleChange, className, numberOfProductsInCartOptions, appearance, texts, }: BitsnapCartProps): react_jsx_runtime.JSX.Element;
|
|
164
|
+
declare function BitsnapCart({ projectID, locale, children, onVisibleChange, className, numberOfProductsInCartOptions, appearance, texts, analytics, }: BitsnapCartProps): react_jsx_runtime.JSX.Element;
|
|
149
165
|
|
|
150
166
|
type Props$2 = {
|
|
151
167
|
test?: boolean;
|
|
@@ -164,6 +180,12 @@ type Props$2 = {
|
|
|
164
180
|
[key: string]: string | undefined;
|
|
165
181
|
};
|
|
166
182
|
}[];
|
|
183
|
+
/**
|
|
184
|
+
* Usage statistics for your Bitsnap dashboard. On by default; `false` turns
|
|
185
|
+
* it off. Inside `<BitsnapCheckout>` the checkout's setting applies unless
|
|
186
|
+
* this is given.
|
|
187
|
+
*/
|
|
188
|
+
analytics?: AnalyticsOption;
|
|
167
189
|
};
|
|
168
190
|
declare function Wrapper$1(props: Props$2): react_jsx_runtime.JSX.Element;
|
|
169
191
|
|
|
@@ -297,10 +319,21 @@ interface NotificationsComponentPublicProps {
|
|
|
297
319
|
* Custom CSS class names for various component sections (for easier styling).
|
|
298
320
|
*/
|
|
299
321
|
className?: ComponentClassNames;
|
|
322
|
+
/**
|
|
323
|
+
* Public project ID used for usage statistics. Defaults to the one set by
|
|
324
|
+
* `<BitsnapCheckout projectID>`.
|
|
325
|
+
*/
|
|
326
|
+
projectID?: string;
|
|
327
|
+
/**
|
|
328
|
+
* Usage statistics for your Bitsnap dashboard (sign-ups). On by default;
|
|
329
|
+
* `false` turns it off. An object lets you forward every event:
|
|
330
|
+
* `{ onEvent }`. Nothing is stored on the visitor's device.
|
|
331
|
+
*/
|
|
332
|
+
analytics?: AnalyticsOption;
|
|
300
333
|
}
|
|
301
334
|
|
|
302
335
|
type Props$1 = NotificationsComponentPublicProps;
|
|
303
|
-
declare function Wrapper({ slug, userID, productID, projectName, projectLogo, projectLogoDark, groups, isManaging, texts, showQRCode, showPhoneInput, hiddenGroupIds, className, }: Props$1): react_jsx_runtime.JSX.Element;
|
|
336
|
+
declare function Wrapper({ slug, userID, productID, projectID, analytics, projectName, projectLogo, projectLogoDark, groups, isManaging, texts, showQRCode, showPhoneInput, hiddenGroupIds, className, }: Props$1): react_jsx_runtime.JSX.Element;
|
|
304
337
|
|
|
305
338
|
type ErrTypes = "internal" | "badInput" | "notFound";
|
|
306
339
|
type Err = {
|
|
@@ -412,6 +445,8 @@ declare namespace Bitsnap {
|
|
|
412
445
|
name?: string;
|
|
413
446
|
price?: number;
|
|
414
447
|
currency?: string;
|
|
448
|
+
/** Where `add_to_cart` is reported. Defaults to the mounted `<BitsnapCheckout>`. */
|
|
449
|
+
analytics?: Instrument;
|
|
415
450
|
}): Promise<Err | undefined>;
|
|
416
451
|
function showCart(): void;
|
|
417
452
|
function hideCart(): void;
|
|
@@ -429,48 +464,22 @@ declare function createCheckout(request: LinkRequest & {
|
|
|
429
464
|
declare function getReferenceIfPossible(): string | undefined;
|
|
430
465
|
declare function injectReferenceToRequestIfNeeded(request: LinkRequest): LinkRequest;
|
|
431
466
|
|
|
432
|
-
declare const PanelLogin: (
|
|
467
|
+
declare const PanelLogin: ({ analytics, }?: {
|
|
468
|
+
analytics?: AnalyticsOption;
|
|
469
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
433
470
|
|
|
434
|
-
|
|
435
|
-
logoURL?: string;
|
|
436
|
-
logoDarkURL?: string;
|
|
437
|
-
colors?: {
|
|
438
|
-
brand?: string;
|
|
439
|
-
brandDark?: string;
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
type PanelScreen = "products" | "notifications" | "profile" | "plans" | "orders" | "order-details" | "returns" | "return-details";
|
|
443
|
-
type PanelSearchParamsType = {
|
|
444
|
-
product?: string;
|
|
445
|
-
state: PanelScreen;
|
|
446
|
-
orderId?: string;
|
|
447
|
-
returnId?: string;
|
|
448
|
-
};
|
|
449
|
-
interface PanelProps {
|
|
450
|
-
projectID: string;
|
|
451
|
-
theme?: GetThemeOutput;
|
|
452
|
-
loginURL: string;
|
|
453
|
-
/**
|
|
454
|
-
* Appearance of the Returns screen. When omitted, `buttonBackground`,
|
|
455
|
-
* `focusRing` and a readable `buttonForeground` are derived from
|
|
456
|
-
* `theme.colors.brand`.
|
|
457
|
-
*/
|
|
458
|
-
returnsAppearance?: ReturnsAppearance;
|
|
459
|
-
/** Text overrides of the Returns screen. */
|
|
460
|
-
returnsTexts?: Partial<ReturnsTexts>;
|
|
461
|
-
}
|
|
462
|
-
interface PanelLoginProps {
|
|
463
|
-
projectID: string;
|
|
464
|
-
theme?: GetThemeOutput;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
declare const PanelPage: ({ returnsAppearance, returnsTexts, }?: Pick<PanelProps, "returnsAppearance" | "returnsTexts">) => react_jsx_runtime.JSX.Element;
|
|
471
|
+
declare const PanelPage: ({ returnsAppearance, returnsTexts, analytics, }?: Pick<PanelProps, "returnsAppearance" | "returnsTexts" | "analytics">) => react_jsx_runtime.JSX.Element;
|
|
468
472
|
|
|
469
473
|
interface Props {
|
|
470
474
|
orderID: string;
|
|
471
475
|
initialEmail?: string;
|
|
472
476
|
accessToken?: string;
|
|
473
477
|
onBack?: () => void;
|
|
478
|
+
/**
|
|
479
|
+
* Usage statistics for your Bitsnap dashboard (order viewed). Inside
|
|
480
|
+
* `<Panel>` or `<PanelProvider>` their setting applies unless this is given.
|
|
481
|
+
*/
|
|
482
|
+
analytics?: AnalyticsOption;
|
|
474
483
|
}
|
|
475
484
|
declare function PublicOrderPage(props: Props): react_jsx_runtime.JSX.Element;
|
|
476
485
|
|
|
@@ -492,6 +501,13 @@ declare function getAllowedReturnOrigins(): string[];
|
|
|
492
501
|
|
|
493
502
|
declare const PanelProvider: React.FC<{
|
|
494
503
|
children: React.ReactNode;
|
|
504
|
+
/**
|
|
505
|
+
* Usage statistics for your Bitsnap dashboard (panel logins, orders viewed,
|
|
506
|
+
* downloads, course progress). On by default; `false` turns it off. An
|
|
507
|
+
* object lets you forward every event: `{ onEvent }`. Nothing is stored on
|
|
508
|
+
* the visitor's device.
|
|
509
|
+
*/
|
|
510
|
+
analytics?: AnalyticsOption;
|
|
495
511
|
}>;
|
|
496
512
|
declare const usePanelConfig: () => PanelConfig;
|
|
497
513
|
|
|
@@ -500,4 +516,4 @@ declare function persistReturnURL(returnURL: string | null): void;
|
|
|
500
516
|
declare function readPersistedReturnURL(): string | null;
|
|
501
517
|
declare function buildAccessTokenRedirect(returnURL: string, accessToken: string): string;
|
|
502
518
|
|
|
503
|
-
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,
|
|
519
|
+
export { AnalyticsOption, 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 };
|