bitsnap-react 1.16.0 → 1.17.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/AGENTS.md +5 -0
- package/README.md +56 -0
- package/dist/CartProvider-DGRZDTYC.mjs +2 -0
- package/dist/CartProvider-YVOHSMPE.js +2 -0
- package/dist/{CartProvider-VGZMDVFJ.js.map → CartProvider-YVOHSMPE.js.map} +1 -1
- package/dist/analytics.d.mts +2 -2
- package/dist/analytics.d.ts +2 -2
- package/dist/analytics.js +1 -1
- package/dist/analytics.mjs +1 -1
- package/dist/catalog.d.mts +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +1 -1
- package/dist/catalog.mjs +1 -1
- package/dist/chunk-2NL5FCXC.mjs +4 -0
- package/dist/chunk-2NL5FCXC.mjs.map +1 -0
- package/dist/{chunk-QQQ2JSPQ.mjs → chunk-2UDAB2C5.mjs} +2 -2
- package/dist/{chunk-QQQ2JSPQ.mjs.map → chunk-2UDAB2C5.mjs.map} +1 -1
- package/dist/{chunk-SRQOFCMO.js → chunk-4BL7TLK3.js} +2 -2
- package/dist/{chunk-SRQOFCMO.js.map → chunk-4BL7TLK3.js.map} +1 -1
- package/dist/{chunk-DPKWYLN7.mjs → chunk-4ETIDGYZ.mjs} +2 -2
- package/dist/chunk-555KFWGY.js +4 -0
- package/dist/chunk-555KFWGY.js.map +1 -0
- package/dist/chunk-5FZAROP6.js +2 -0
- package/dist/chunk-5FZAROP6.js.map +1 -0
- package/dist/{chunk-OZHXRKMX.js → chunk-6GCCNBEU.js} +2 -2
- package/dist/{chunk-OZHXRKMX.js.map → chunk-6GCCNBEU.js.map} +1 -1
- package/dist/chunk-A6VCP3A4.mjs +2 -0
- package/dist/{chunk-SULHGFYN.mjs.map → chunk-A6VCP3A4.mjs.map} +1 -1
- package/dist/chunk-BZXV77PT.mjs +2 -0
- package/dist/chunk-BZXV77PT.mjs.map +1 -0
- package/dist/{chunk-GQJDFLSL.js → chunk-C3BBJOVV.js} +2 -2
- package/dist/{chunk-GQJDFLSL.js.map → chunk-C3BBJOVV.js.map} +1 -1
- package/dist/{chunk-GXUNRJ5S.js → chunk-ESF5ZVVF.js} +2 -2
- package/dist/{chunk-GXUNRJ5S.js.map → chunk-ESF5ZVVF.js.map} +1 -1
- package/dist/chunk-HKNWW37T.mjs +2 -0
- package/dist/chunk-HKNWW37T.mjs.map +1 -0
- package/dist/chunk-L7Q7OKM5.mjs +2 -0
- package/dist/chunk-L7Q7OKM5.mjs.map +1 -0
- package/dist/{chunk-WKE6ECID.mjs → chunk-M2G74N43.mjs} +2 -2
- package/dist/chunk-MIMQTH2G.js +2 -0
- package/dist/chunk-MIMQTH2G.js.map +1 -0
- package/dist/chunk-SYN5KU3O.js +2 -0
- package/dist/chunk-SYN5KU3O.js.map +1 -0
- package/dist/{chunk-SXKJ26OA.mjs → chunk-X3LVYIJR.mjs} +2 -2
- package/dist/course.d.mts +3 -3
- package/dist/course.d.ts +3 -3
- package/dist/course.js +1 -1
- package/dist/course.mjs +1 -1
- package/dist/embed/analytics.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +41 -12
- package/dist/index.d.ts +41 -12
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{instrument-BE8ktMUv.d.ts → instrument-eXaC8hc2.d.mts} +1 -1
- package/dist/{instrument-BE8ktMUv.d.mts → instrument-eXaC8hc2.d.ts} +1 -1
- package/dist/methods-3W34GRYL.js +2 -0
- package/dist/{methods-WRONKK3D.js.map → methods-3W34GRYL.js.map} +1 -1
- package/dist/methods-LUJSKSQ4.mjs +2 -0
- package/dist/returns.d.mts +19 -10
- package/dist/returns.d.ts +19 -10
- package/dist/returns.js +1 -1
- package/dist/returns.js.map +1 -1
- package/dist/returns.mjs +1 -1
- package/dist/{texts-tQtAGJCT.d.mts → texts-LGhuQfA9.d.mts} +28 -3
- package/dist/{texts-CIEFbJTN.d.ts → texts-m6XQGZ6w.d.ts} +28 -3
- package/dist/types-ClFCVzk_.d.ts +121 -0
- package/dist/types-D6LsoycW.d.mts +121 -0
- package/dist/viewer3d.mjs +1 -1
- package/package.json +2 -2
- package/dist/CartProvider-VGZMDVFJ.js +0 -2
- package/dist/CartProvider-ZY5OLTAF.mjs +0 -2
- package/dist/chunk-5AYH23UJ.mjs +0 -4
- package/dist/chunk-5AYH23UJ.mjs.map +0 -1
- package/dist/chunk-AGYS7Z6G.mjs +0 -2
- package/dist/chunk-AGYS7Z6G.mjs.map +0 -1
- package/dist/chunk-I3QXJJ7U.mjs +0 -2
- package/dist/chunk-I3QXJJ7U.mjs.map +0 -1
- package/dist/chunk-LL7ASBGY.js +0 -2
- package/dist/chunk-LL7ASBGY.js.map +0 -1
- package/dist/chunk-QERYM7RC.js +0 -2
- package/dist/chunk-QERYM7RC.js.map +0 -1
- package/dist/chunk-QXGK337V.mjs +0 -2
- package/dist/chunk-QXGK337V.mjs.map +0 -1
- package/dist/chunk-SULHGFYN.mjs +0 -2
- package/dist/chunk-WPOXLITY.js +0 -2
- package/dist/chunk-WPOXLITY.js.map +0 -1
- package/dist/chunk-Y5KWVTXT.js +0 -4
- package/dist/chunk-Y5KWVTXT.js.map +0 -1
- package/dist/methods-NJEP64AG.mjs +0 -2
- package/dist/methods-WRONKK3D.js +0 -2
- package/dist/types-DP1vxo5E.d.mts +0 -53
- package/dist/types-u8VwmC3j.d.ts +0 -53
- /package/dist/{CartProvider-ZY5OLTAF.mjs.map → CartProvider-DGRZDTYC.mjs.map} +0 -0
- /package/dist/{chunk-DPKWYLN7.mjs.map → chunk-4ETIDGYZ.mjs.map} +0 -0
- /package/dist/{chunk-WKE6ECID.mjs.map → chunk-M2G74N43.mjs.map} +0 -0
- /package/dist/{chunk-SXKJ26OA.mjs.map → chunk-X3LVYIJR.mjs.map} +0 -0
- /package/dist/{methods-NJEP64AG.mjs.map → methods-LUJSKSQ4.mjs.map} +0 -0
|
@@ -940,4 +940,4 @@ declare function useInstrument(projectKey: string | null | undefined, analytics?
|
|
|
940
940
|
/** Score (0..100) → the contract's bucket. */
|
|
941
941
|
declare function scoreBucket(percent: number): "0-24" | "25-49" | "50-74" | "75-99" | "100";
|
|
942
942
|
|
|
943
|
-
export { type
|
|
943
|
+
export { type AppEventName as A, type BrowserEventName as B, type ClientEvent as C, DEFAULT_ENDPOINT as D, type Env as E, InstrumentProvider as I, type PageType as P, type Source as S, type Tracker as T, type TrackerOptions as a, type TrackExtra as b, createTracker as c, type Channel as d, type EventName as e, type EventProps as f, getTracker as g, type StorefrontEventName as h, initTracker as i, useInstrumentContext as j, type AnalyticsOption as k, type Instrument as l, noopInstrument as n, resetTracker as r, scoreBucket as s, useInstrument as u };
|
|
@@ -940,4 +940,4 @@ declare function useInstrument(projectKey: string | null | undefined, analytics?
|
|
|
940
940
|
/** Score (0..100) → the contract's bucket. */
|
|
941
941
|
declare function scoreBucket(percent: number): "0-24" | "25-49" | "50-74" | "75-99" | "100";
|
|
942
942
|
|
|
943
|
-
export { type
|
|
943
|
+
export { type AppEventName as A, type BrowserEventName as B, type ClientEvent as C, DEFAULT_ENDPOINT as D, type Env as E, InstrumentProvider as I, type PageType as P, type Source as S, type Tracker as T, type TrackerOptions as a, type TrackExtra as b, createTracker as c, type Channel as d, type EventName as e, type EventProps as f, getTracker as g, type StorefrontEventName as h, initTracker as i, useInstrumentContext as j, type AnalyticsOption as k, type Instrument as l, noopInstrument as n, resetTracker as r, scoreBucket as s, useInstrument as u };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk555KFWGYjs = require('./chunk-555KFWGY.js');require('./chunk-5FZAROP6.js');require('./chunk-KOYBZORL.js');require('./chunk-4BL7TLK3.js');require('./chunk-SYN5KU3O.js');require('./chunk-ESF5ZVVF.js');require('./chunk-C3BBJOVV.js');require('./chunk-7RXW6XFY.js');require('./chunk-W3RGQYPD.js');require('./chunk-JSDGZ4NY.js');exports.Bitsnap = _chunk555KFWGYjs.y; exports.createCheckout = _chunk555KFWGYjs.B; exports.createPaymentURL = _chunk555KFWGYjs.A; exports.getPaymentMethodChoice = _chunk555KFWGYjs.z; exports.getReferenceIfPossible = _chunk555KFWGYjs.C; exports.injectReferenceToRequestIfNeeded = _chunk555KFWGYjs.D;
|
|
2
|
+
//# sourceMappingURL=methods-3W34GRYL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/methods-
|
|
1
|
+
{"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/methods-3W34GRYL.js"],"names":[],"mappings":"AAAA,+HAA0E,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,0SAA6J","file":"/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/methods-3W34GRYL.js"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A as c,B as d,C as e,D as f,y as a,z as b}from"./chunk-2NL5FCXC.mjs";import"./chunk-HKNWW37T.mjs";import"./chunk-KOVKUJAW.mjs";import"./chunk-A6VCP3A4.mjs";import"./chunk-CUPG4B5W.mjs";import"./chunk-L7Q7OKM5.mjs";import"./chunk-5R6AGO3Z.mjs";import"./chunk-X3LVYIJR.mjs";import"./chunk-2UDAB2C5.mjs";import"./chunk-VNYHJT6V.mjs";import"./chunk-MDCP5JNP.mjs";import"./chunk-U6FLIRIV.mjs";export{a as Bitsnap,d as createCheckout,c as createPaymentURL,b as getPaymentMethodChoice,e as getReferenceIfPossible,f as injectReferenceToRequestIfNeeded};
|
|
2
|
+
//# sourceMappingURL=methods-LUJSKSQ4.mjs.map
|
package/dist/returns.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { a as ReturnsTexts, R as ReturnsAppearance, L as LoginLogoOptions, h as ReturnsTextKey, i as ResolvedReturnsAppearance, f as ReturnsSlotName, e as ReturnsSlotAppearance } from './texts-LGhuQfA9.mjs';
|
|
3
|
+
export { b as RETURNS_SLOT_NAMES, c as ReturnsAppearanceElements, d as ReturnsAppearanceTokens, g as ReturnsTheme } from './texts-LGhuQfA9.mjs';
|
|
2
4
|
import { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { a as ReturnsTexts, R as ReturnsAppearance, h as ReturnsTextKey, i as ResolvedReturnsAppearance, f as ReturnsSlotName, e as ReturnsSlotAppearance } from './texts-tQtAGJCT.mjs';
|
|
5
|
-
export { b as RETURNS_SLOT_NAMES, c as ReturnsAppearanceElements, d as ReturnsAppearanceTokens, g as ReturnsTheme } from './texts-tQtAGJCT.mjs';
|
|
5
|
+
import { k as AnalyticsOption } from './instrument-eXaC8hc2.mjs';
|
|
6
6
|
import { Timestamp } from '@bufbuild/protobuf/wkt';
|
|
7
7
|
import { Message } from '@bufbuild/protobuf';
|
|
8
8
|
import './appearance-core-Dt2grZdl.mjs';
|
|
@@ -123,7 +123,12 @@ declare function ReturnsProvider({ projectID, host, environment, appearance, tex
|
|
|
123
123
|
declare const BitsnapReturnsProvider: typeof ReturnsProvider;
|
|
124
124
|
type BitsnapReturnsProviderProps = ReturnsProviderProps;
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Props of {@link BitsnapReturns}. `showLogo`, `logoUrl` and `logoDarkUrl` set
|
|
128
|
+
* the shop logo above the e-mail and code steps: by default the logo from the
|
|
129
|
+
* shop settings, or Bitsnap's when the shop has none.
|
|
130
|
+
*/
|
|
131
|
+
type BitsnapReturnsProps = Omit<ReturnsProviderProps, "children"> & LoginLogoOptions;
|
|
127
132
|
/**
|
|
128
133
|
* Customer return flow: email, code, orders, line selection, confirmation and
|
|
129
134
|
* result, plus the list of earlier returns. It is `ReturnsProvider` with the
|
|
@@ -134,24 +139,28 @@ type BitsnapReturnsProps = Omit<ReturnsProviderProps, "children">;
|
|
|
134
139
|
* <BitsnapReturns projectID="…" appearance={brand} texts={{ emailStepTitle: "Return a product" }} />
|
|
135
140
|
* ```
|
|
136
141
|
*/
|
|
137
|
-
declare function BitsnapReturns(props: BitsnapReturnsProps): react_jsx_runtime.JSX.Element;
|
|
142
|
+
declare function BitsnapReturns({ showLogo, logoUrl, logoDarkUrl, ...props }: BitsnapReturnsProps): react_jsx_runtime.JSX.Element;
|
|
138
143
|
|
|
139
|
-
type ReturnsEmailStepProps = {
|
|
144
|
+
type ReturnsEmailStepProps = LoginLogoOptions & {
|
|
140
145
|
/** Called after the verification code was sent, with the trimmed email. */
|
|
141
146
|
onSubmitted?: (email: string) => void;
|
|
142
147
|
className?: string;
|
|
143
148
|
};
|
|
144
149
|
/** First step: asks for the email the order was placed with. */
|
|
145
|
-
declare function ReturnsEmailStep({ onSubmitted, className, }: ReturnsEmailStepProps): react_jsx_runtime.JSX.Element;
|
|
146
|
-
type ReturnsCodeStepProps = {
|
|
150
|
+
declare function ReturnsEmailStep({ onSubmitted, className, ...logo }: ReturnsEmailStepProps): react_jsx_runtime.JSX.Element;
|
|
151
|
+
type ReturnsCodeStepProps = LoginLogoOptions & {
|
|
147
152
|
/** Called once the code was accepted and the session exists. */
|
|
148
153
|
onVerified?: () => void;
|
|
149
154
|
/** Shows a back button, for example to change the email. */
|
|
150
155
|
onBack?: () => void;
|
|
151
156
|
className?: string;
|
|
152
157
|
};
|
|
153
|
-
/**
|
|
154
|
-
|
|
158
|
+
/**
|
|
159
|
+
* Second step: asks for the code that was emailed to the customer. The code
|
|
160
|
+
* is a six digit one-time-code field that submits itself on the last digit;
|
|
161
|
+
* the button stays for those who prefer it.
|
|
162
|
+
*/
|
|
163
|
+
declare function ReturnsCodeStep({ onVerified, onBack, className, ...logo }: ReturnsCodeStepProps): react_jsx_runtime.JSX.Element;
|
|
155
164
|
|
|
156
165
|
/**
|
|
157
166
|
* @generated from message public.v1.StartReturnSessionResponse
|
package/dist/returns.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { a as ReturnsTexts, R as ReturnsAppearance, L as LoginLogoOptions, h as ReturnsTextKey, i as ResolvedReturnsAppearance, f as ReturnsSlotName, e as ReturnsSlotAppearance } from './texts-m6XQGZ6w.js';
|
|
3
|
+
export { b as RETURNS_SLOT_NAMES, c as ReturnsAppearanceElements, d as ReturnsAppearanceTokens, g as ReturnsTheme } from './texts-m6XQGZ6w.js';
|
|
2
4
|
import { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { a as ReturnsTexts, R as ReturnsAppearance, h as ReturnsTextKey, i as ResolvedReturnsAppearance, f as ReturnsSlotName, e as ReturnsSlotAppearance } from './texts-CIEFbJTN.js';
|
|
5
|
-
export { b as RETURNS_SLOT_NAMES, c as ReturnsAppearanceElements, d as ReturnsAppearanceTokens, g as ReturnsTheme } from './texts-CIEFbJTN.js';
|
|
5
|
+
import { k as AnalyticsOption } from './instrument-eXaC8hc2.js';
|
|
6
6
|
import { Timestamp } from '@bufbuild/protobuf/wkt';
|
|
7
7
|
import { Message } from '@bufbuild/protobuf';
|
|
8
8
|
import './appearance-core-Dt2grZdl.js';
|
|
@@ -123,7 +123,12 @@ declare function ReturnsProvider({ projectID, host, environment, appearance, tex
|
|
|
123
123
|
declare const BitsnapReturnsProvider: typeof ReturnsProvider;
|
|
124
124
|
type BitsnapReturnsProviderProps = ReturnsProviderProps;
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Props of {@link BitsnapReturns}. `showLogo`, `logoUrl` and `logoDarkUrl` set
|
|
128
|
+
* the shop logo above the e-mail and code steps: by default the logo from the
|
|
129
|
+
* shop settings, or Bitsnap's when the shop has none.
|
|
130
|
+
*/
|
|
131
|
+
type BitsnapReturnsProps = Omit<ReturnsProviderProps, "children"> & LoginLogoOptions;
|
|
127
132
|
/**
|
|
128
133
|
* Customer return flow: email, code, orders, line selection, confirmation and
|
|
129
134
|
* result, plus the list of earlier returns. It is `ReturnsProvider` with the
|
|
@@ -134,24 +139,28 @@ type BitsnapReturnsProps = Omit<ReturnsProviderProps, "children">;
|
|
|
134
139
|
* <BitsnapReturns projectID="…" appearance={brand} texts={{ emailStepTitle: "Return a product" }} />
|
|
135
140
|
* ```
|
|
136
141
|
*/
|
|
137
|
-
declare function BitsnapReturns(props: BitsnapReturnsProps): react_jsx_runtime.JSX.Element;
|
|
142
|
+
declare function BitsnapReturns({ showLogo, logoUrl, logoDarkUrl, ...props }: BitsnapReturnsProps): react_jsx_runtime.JSX.Element;
|
|
138
143
|
|
|
139
|
-
type ReturnsEmailStepProps = {
|
|
144
|
+
type ReturnsEmailStepProps = LoginLogoOptions & {
|
|
140
145
|
/** Called after the verification code was sent, with the trimmed email. */
|
|
141
146
|
onSubmitted?: (email: string) => void;
|
|
142
147
|
className?: string;
|
|
143
148
|
};
|
|
144
149
|
/** First step: asks for the email the order was placed with. */
|
|
145
|
-
declare function ReturnsEmailStep({ onSubmitted, className, }: ReturnsEmailStepProps): react_jsx_runtime.JSX.Element;
|
|
146
|
-
type ReturnsCodeStepProps = {
|
|
150
|
+
declare function ReturnsEmailStep({ onSubmitted, className, ...logo }: ReturnsEmailStepProps): react_jsx_runtime.JSX.Element;
|
|
151
|
+
type ReturnsCodeStepProps = LoginLogoOptions & {
|
|
147
152
|
/** Called once the code was accepted and the session exists. */
|
|
148
153
|
onVerified?: () => void;
|
|
149
154
|
/** Shows a back button, for example to change the email. */
|
|
150
155
|
onBack?: () => void;
|
|
151
156
|
className?: string;
|
|
152
157
|
};
|
|
153
|
-
/**
|
|
154
|
-
|
|
158
|
+
/**
|
|
159
|
+
* Second step: asks for the code that was emailed to the customer. The code
|
|
160
|
+
* is a six digit one-time-code field that submits itself on the last digit;
|
|
161
|
+
* the button stays for those who prefer it.
|
|
162
|
+
*/
|
|
163
|
+
declare function ReturnsCodeStep({ onVerified, onBack, className, ...logo }: ReturnsCodeStepProps): react_jsx_runtime.JSX.Element;
|
|
155
164
|
|
|
156
165
|
/**
|
|
157
166
|
* @generated from message public.v1.StartReturnSessionResponse
|
package/dist/returns.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkMIMQTH2Gjs = require('./chunk-MIMQTH2G.js');var _chunk5FZAROP6js = require('./chunk-5FZAROP6.js');require('./chunk-KOYBZORL.js');var _chunkSYN5KU3Ojs = require('./chunk-SYN5KU3O.js');require('./chunk-ESF5ZVVF.js');require('./chunk-C3BBJOVV.js');require('./chunk-7RXW6XFY.js');require('./chunk-W3RGQYPD.js');require('./chunk-JSDGZ4NY.js');exports.BitsnapReturns = _chunkMIMQTH2Gjs.a; exports.BitsnapReturnsProvider = _chunk5FZAROP6js.v; exports.Environment = _chunkSYN5KU3Ojs.i; exports.RETURNS_SLOT_NAMES = _chunk5FZAROP6js.l; exports.ReturnsAppearanceProvider = _chunk5FZAROP6js.m; exports.ReturnsCodeStep = _chunk5FZAROP6js.E; exports.ReturnsConfirmation = _chunk5FZAROP6js.H; exports.ReturnsEmailStep = _chunk5FZAROP6js.D; exports.ReturnsMyReturnDetail = _chunk5FZAROP6js.K; exports.ReturnsMyReturnsList = _chunk5FZAROP6js.J; exports.ReturnsOrderDetail = _chunk5FZAROP6js.G; exports.ReturnsOrderList = _chunk5FZAROP6js.F; exports.ReturnsProvider = _chunk5FZAROP6js.u; exports.ReturnsResult = _chunk5FZAROP6js.I; exports.useCreateReturn = _chunk5FZAROP6js.z; exports.useMyReturn = _chunk5FZAROP6js.B; exports.useMyReturns = _chunk5FZAROP6js.A; exports.useReturnOrders = _chunk5FZAROP6js.x; exports.useReturnSession = _chunk5FZAROP6js.w; exports.useReturnableOrder = _chunk5FZAROP6js.y; exports.useReturnsAppearance = _chunk5FZAROP6js.n; exports.useReturnsSlot = _chunk5FZAROP6js.o; exports.useReturnsText = _chunk5FZAROP6js.r;
|
|
2
2
|
//# sourceMappingURL=returns.js.map
|
package/dist/returns.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/returns.js"],"names":[],"mappings":"AAAA,+HAAuC,
|
|
1
|
+
{"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/returns.js"],"names":[],"mappings":"AAAA,+HAAuC,sDAA+K,+BAA4B,sDAAwC,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,kkCAA4gB","file":"/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/returns.js"}
|
package/dist/returns.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as L}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-BZXV77PT.mjs";import{A as m,B as l,D as x,E as d,F as P,G as f,H as S,I as c,J as T,K as C,l as t,m as r,n as s,o as n,r as p,u,v as R,w as o,x as y,y as a,z as i}from"./chunk-HKNWW37T.mjs";import"./chunk-KOVKUJAW.mjs";import{i as e}from"./chunk-L7Q7OKM5.mjs";import"./chunk-5R6AGO3Z.mjs";import"./chunk-X3LVYIJR.mjs";import"./chunk-2UDAB2C5.mjs";import"./chunk-VNYHJT6V.mjs";import"./chunk-MDCP5JNP.mjs";import"./chunk-U6FLIRIV.mjs";export{L as BitsnapReturns,R as BitsnapReturnsProvider,e as Environment,t as RETURNS_SLOT_NAMES,r as ReturnsAppearanceProvider,d as ReturnsCodeStep,S as ReturnsConfirmation,x as ReturnsEmailStep,C as ReturnsMyReturnDetail,T as ReturnsMyReturnsList,f as ReturnsOrderDetail,P as ReturnsOrderList,u as ReturnsProvider,c as ReturnsResult,i as useCreateReturn,l as useMyReturn,m as useMyReturns,y as useReturnOrders,o as useReturnSession,a as useReturnableOrder,s as useReturnsAppearance,n as useReturnsSlot,p as useReturnsText};
|
|
2
2
|
//# sourceMappingURL=returns.mjs.map
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { S as SlotAppearance, A as AppearanceElements } from './appearance-core-Dt2grZdl.mjs';
|
|
3
3
|
|
|
4
|
+
/** Options every login surface passes through to {@link LoginBrandLogo}. */
|
|
5
|
+
type LoginLogoOptions = {
|
|
6
|
+
/** Shows the shop logo above the login. Default `true`; `false` hides it. */
|
|
7
|
+
showLogo?: boolean;
|
|
8
|
+
/** Logo for light backgrounds, instead of the one of the shop settings. */
|
|
9
|
+
logoUrl?: string;
|
|
10
|
+
/** Logo for dark backgrounds, instead of the one of the shop settings. */
|
|
11
|
+
logoDarkUrl?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
4
14
|
/**
|
|
5
15
|
* Returns appearance API.
|
|
6
16
|
*
|
|
@@ -83,7 +93,14 @@ type ResolvedReturnsAppearance = {
|
|
|
83
93
|
* whatever the locale. Strings with `{name}` placeholders keep them in
|
|
84
94
|
* overrides; unknown placeholders are left untouched.
|
|
85
95
|
*/
|
|
86
|
-
type ReturnsTexts =
|
|
96
|
+
type ReturnsTexts = Omit<ResolvedReturnsTexts, OptionalReturnsTextKey> & Partial<Pick<ResolvedReturnsTexts, OptionalReturnsTextKey>>;
|
|
97
|
+
/**
|
|
98
|
+
* Keys added after 1.6: optional in {@link ReturnsTexts} so that code which
|
|
99
|
+
* builds a complete texts object keeps compiling. The defaults fill them in.
|
|
100
|
+
*/
|
|
101
|
+
type OptionalReturnsTextKey = "resendSent" | "codeSpamHint" | "codeValidity" | "codeIncomplete" | "errorNetwork";
|
|
102
|
+
/** The texts after the defaults are applied: every key is present. */
|
|
103
|
+
type ResolvedReturnsTexts = {
|
|
87
104
|
/** Label of the back buttons. */
|
|
88
105
|
back: string;
|
|
89
106
|
/** Step indicator, placeholders `{current}` and `{total}`. */
|
|
@@ -105,6 +122,13 @@ type ReturnsTexts = {
|
|
|
105
122
|
resend: string;
|
|
106
123
|
/** Placeholder `{seconds}`. */
|
|
107
124
|
resendIn: string;
|
|
125
|
+
/** Confirmation after a new code was sent. */
|
|
126
|
+
resendSent: string;
|
|
127
|
+
/** Hint under the code field. */
|
|
128
|
+
codeSpamHint: string;
|
|
129
|
+
codeValidity: string;
|
|
130
|
+
/** Shown when the form is submitted with fewer than 6 digits. */
|
|
131
|
+
codeIncomplete: string;
|
|
108
132
|
logout: string;
|
|
109
133
|
ordersTitle: string;
|
|
110
134
|
ordersDescription: string;
|
|
@@ -178,6 +202,7 @@ type ReturnsTexts = {
|
|
|
178
202
|
refundStatusFailed: string;
|
|
179
203
|
refundStatusFallback: string;
|
|
180
204
|
errorGeneric: string;
|
|
205
|
+
errorNetwork: string;
|
|
181
206
|
errorInvalidEmail: string;
|
|
182
207
|
errorInvalidCode: string;
|
|
183
208
|
errorSessionExpired: string;
|
|
@@ -191,6 +216,6 @@ type ReturnsTexts = {
|
|
|
191
216
|
errorDeliveryFailed: string;
|
|
192
217
|
errorRetry: string;
|
|
193
218
|
};
|
|
194
|
-
type ReturnsTextKey = keyof
|
|
219
|
+
type ReturnsTextKey = keyof ResolvedReturnsTexts;
|
|
195
220
|
|
|
196
|
-
export { type ReturnsAppearance as R, type ReturnsTexts as a, RETURNS_SLOT_NAMES as b, type ReturnsAppearanceElements as c, type ReturnsAppearanceTokens as d, type ReturnsSlotAppearance as e, type ReturnsSlotName as f, type ReturnsTheme as g, type ReturnsTextKey as h, type ResolvedReturnsAppearance as i };
|
|
221
|
+
export { type LoginLogoOptions as L, type ReturnsAppearance as R, type ReturnsTexts as a, RETURNS_SLOT_NAMES as b, type ReturnsAppearanceElements as c, type ReturnsAppearanceTokens as d, type ReturnsSlotAppearance as e, type ReturnsSlotName as f, type ReturnsTheme as g, type ReturnsTextKey as h, type ResolvedReturnsAppearance as i };
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { S as SlotAppearance, A as AppearanceElements } from './appearance-core-Dt2grZdl.js';
|
|
3
3
|
|
|
4
|
+
/** Options every login surface passes through to {@link LoginBrandLogo}. */
|
|
5
|
+
type LoginLogoOptions = {
|
|
6
|
+
/** Shows the shop logo above the login. Default `true`; `false` hides it. */
|
|
7
|
+
showLogo?: boolean;
|
|
8
|
+
/** Logo for light backgrounds, instead of the one of the shop settings. */
|
|
9
|
+
logoUrl?: string;
|
|
10
|
+
/** Logo for dark backgrounds, instead of the one of the shop settings. */
|
|
11
|
+
logoDarkUrl?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
4
14
|
/**
|
|
5
15
|
* Returns appearance API.
|
|
6
16
|
*
|
|
@@ -83,7 +93,14 @@ type ResolvedReturnsAppearance = {
|
|
|
83
93
|
* whatever the locale. Strings with `{name}` placeholders keep them in
|
|
84
94
|
* overrides; unknown placeholders are left untouched.
|
|
85
95
|
*/
|
|
86
|
-
type ReturnsTexts =
|
|
96
|
+
type ReturnsTexts = Omit<ResolvedReturnsTexts, OptionalReturnsTextKey> & Partial<Pick<ResolvedReturnsTexts, OptionalReturnsTextKey>>;
|
|
97
|
+
/**
|
|
98
|
+
* Keys added after 1.6: optional in {@link ReturnsTexts} so that code which
|
|
99
|
+
* builds a complete texts object keeps compiling. The defaults fill them in.
|
|
100
|
+
*/
|
|
101
|
+
type OptionalReturnsTextKey = "resendSent" | "codeSpamHint" | "codeValidity" | "codeIncomplete" | "errorNetwork";
|
|
102
|
+
/** The texts after the defaults are applied: every key is present. */
|
|
103
|
+
type ResolvedReturnsTexts = {
|
|
87
104
|
/** Label of the back buttons. */
|
|
88
105
|
back: string;
|
|
89
106
|
/** Step indicator, placeholders `{current}` and `{total}`. */
|
|
@@ -105,6 +122,13 @@ type ReturnsTexts = {
|
|
|
105
122
|
resend: string;
|
|
106
123
|
/** Placeholder `{seconds}`. */
|
|
107
124
|
resendIn: string;
|
|
125
|
+
/** Confirmation after a new code was sent. */
|
|
126
|
+
resendSent: string;
|
|
127
|
+
/** Hint under the code field. */
|
|
128
|
+
codeSpamHint: string;
|
|
129
|
+
codeValidity: string;
|
|
130
|
+
/** Shown when the form is submitted with fewer than 6 digits. */
|
|
131
|
+
codeIncomplete: string;
|
|
108
132
|
logout: string;
|
|
109
133
|
ordersTitle: string;
|
|
110
134
|
ordersDescription: string;
|
|
@@ -178,6 +202,7 @@ type ReturnsTexts = {
|
|
|
178
202
|
refundStatusFailed: string;
|
|
179
203
|
refundStatusFallback: string;
|
|
180
204
|
errorGeneric: string;
|
|
205
|
+
errorNetwork: string;
|
|
181
206
|
errorInvalidEmail: string;
|
|
182
207
|
errorInvalidCode: string;
|
|
183
208
|
errorSessionExpired: string;
|
|
@@ -191,6 +216,6 @@ type ReturnsTexts = {
|
|
|
191
216
|
errorDeliveryFailed: string;
|
|
192
217
|
errorRetry: string;
|
|
193
218
|
};
|
|
194
|
-
type ReturnsTextKey = keyof
|
|
219
|
+
type ReturnsTextKey = keyof ResolvedReturnsTexts;
|
|
195
220
|
|
|
196
|
-
export { type ReturnsAppearance as R, type ReturnsTexts as a, RETURNS_SLOT_NAMES as b, type ReturnsAppearanceElements as c, type ReturnsAppearanceTokens as d, type ReturnsSlotAppearance as e, type ReturnsSlotName as f, type ReturnsTheme as g, type ReturnsTextKey as h, type ResolvedReturnsAppearance as i };
|
|
221
|
+
export { type LoginLogoOptions as L, type ReturnsAppearance as R, type ReturnsTexts as a, RETURNS_SLOT_NAMES as b, type ReturnsAppearanceElements as c, type ReturnsAppearanceTokens as d, type ReturnsSlotAppearance as e, type ReturnsSlotName as f, type ReturnsTheme as g, type ReturnsTextKey as h, type ResolvedReturnsAppearance as i };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { k as AnalyticsOption } from './instrument-eXaC8hc2.js';
|
|
2
|
+
import { R as ReturnsAppearance, a as ReturnsTexts, L as LoginLogoOptions } from './texts-m6XQGZ6w.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Strings of the shared e-mail + 6-digit-code login (panel, notifications).
|
|
6
|
+
* Strings with `{name}` placeholders keep them in overrides.
|
|
7
|
+
*/
|
|
8
|
+
type EmailCodeTexts = {
|
|
9
|
+
emailLabel: string;
|
|
10
|
+
emailPlaceholder: string;
|
|
11
|
+
/** Submit button of the e-mail step. */
|
|
12
|
+
sendCode: string;
|
|
13
|
+
/** Same button while the code is being sent. */
|
|
14
|
+
sending: string;
|
|
15
|
+
invalidEmail: string;
|
|
16
|
+
/** Placeholder `{email}`. */
|
|
17
|
+
codeSentTo: string;
|
|
18
|
+
/** Link back to the e-mail step ("Zmień"). */
|
|
19
|
+
changeEmail: string;
|
|
20
|
+
codeLabel: string;
|
|
21
|
+
/** Submit button of the code step. */
|
|
22
|
+
verify: string;
|
|
23
|
+
verifying: string;
|
|
24
|
+
codeIncomplete: string;
|
|
25
|
+
spamHint: string;
|
|
26
|
+
validity: string;
|
|
27
|
+
resend: string;
|
|
28
|
+
/** Placeholder `{seconds}`. */
|
|
29
|
+
resendIn: string;
|
|
30
|
+
/** Resend button after the code expired or ran out of attempts. */
|
|
31
|
+
resendNew: string;
|
|
32
|
+
resent: string;
|
|
33
|
+
/** "Masz już kod?" next to the {@link haveCode} link. */
|
|
34
|
+
haveCodePrompt: string;
|
|
35
|
+
haveCode: string;
|
|
36
|
+
/** In the "I already have a code" view: link back to sending one. */
|
|
37
|
+
noCode: string;
|
|
38
|
+
stepEmail: string;
|
|
39
|
+
stepCode: string;
|
|
40
|
+
wrongCode: string;
|
|
41
|
+
expired: string;
|
|
42
|
+
tooManyAttempts: string;
|
|
43
|
+
/** Placeholder `{time}`, for example "45 s" or "2 min". */
|
|
44
|
+
rateLimited: string;
|
|
45
|
+
/** Placeholder `{time}`. */
|
|
46
|
+
alreadySent: string;
|
|
47
|
+
emailNotFound: string;
|
|
48
|
+
deliveryFailed: string;
|
|
49
|
+
deliveryUnavailable: string;
|
|
50
|
+
network: string;
|
|
51
|
+
generic: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** Strings of `PanelLogin`: the shared login texts plus the two titles. */
|
|
55
|
+
type PanelLoginTexts = EmailCodeTexts & {
|
|
56
|
+
title: string;
|
|
57
|
+
description: string;
|
|
58
|
+
codeTitle: string;
|
|
59
|
+
codeDescription: string;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
interface GetThemeOutput {
|
|
63
|
+
logoURL?: string;
|
|
64
|
+
logoDarkURL?: string;
|
|
65
|
+
colors?: {
|
|
66
|
+
brand?: string;
|
|
67
|
+
brandDark?: string;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
type PanelScreen = "products" | "notifications" | "profile" | "plans" | "orders" | "order-details" | "returns" | "return-details" | "course";
|
|
71
|
+
type PanelSearchParamsType = {
|
|
72
|
+
product?: string;
|
|
73
|
+
state: PanelScreen;
|
|
74
|
+
orderId?: string;
|
|
75
|
+
returnId?: string;
|
|
76
|
+
/** `state: "course"`: `UserProduct.accessId` of the open course. */
|
|
77
|
+
course?: string;
|
|
78
|
+
/** `state: "course"`: id of the open lesson or test. */
|
|
79
|
+
item?: string;
|
|
80
|
+
};
|
|
81
|
+
interface PanelProps {
|
|
82
|
+
projectID: string;
|
|
83
|
+
theme?: GetThemeOutput;
|
|
84
|
+
loginURL: string;
|
|
85
|
+
/**
|
|
86
|
+
* Appearance of the Returns screen. When omitted, `buttonBackground`,
|
|
87
|
+
* `focusRing` and a readable `buttonForeground` are derived from
|
|
88
|
+
* `theme.colors.brand`.
|
|
89
|
+
*/
|
|
90
|
+
returnsAppearance?: ReturnsAppearance;
|
|
91
|
+
/** Text overrides of the Returns screen. */
|
|
92
|
+
returnsTexts?: Partial<ReturnsTexts>;
|
|
93
|
+
/**
|
|
94
|
+
* Usage statistics for your Bitsnap dashboard (panel logins, orders viewed, downloads). On by default;
|
|
95
|
+
* `false` turns it off. An object lets you forward every event:
|
|
96
|
+
* `{ onEvent }`. Nothing is stored on the visitor's device.
|
|
97
|
+
*/
|
|
98
|
+
analytics?: AnalyticsOption;
|
|
99
|
+
}
|
|
100
|
+
interface PanelLoginProps extends LoginLogoOptions {
|
|
101
|
+
projectID: string;
|
|
102
|
+
theme?: GetThemeOutput;
|
|
103
|
+
/**
|
|
104
|
+
* Usage statistics for your Bitsnap dashboard (panel logins). On by default;
|
|
105
|
+
* `false` turns it off. An object lets you forward every event:
|
|
106
|
+
* `{ onEvent }`. Nothing is stored on the visitor's device.
|
|
107
|
+
*/
|
|
108
|
+
analytics?: AnalyticsOption;
|
|
109
|
+
/**
|
|
110
|
+
* Text overrides of the login: titles, buttons and every message. Polish
|
|
111
|
+
* and English defaults are chosen by `locale`.
|
|
112
|
+
*/
|
|
113
|
+
texts?: Partial<PanelLoginTexts>;
|
|
114
|
+
/**
|
|
115
|
+
* Language of the default texts: a locale starting with `en` gives English,
|
|
116
|
+
* anything else Polish. Defaults to the library locale (`setLocale`).
|
|
117
|
+
*/
|
|
118
|
+
locale?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export type { GetThemeOutput as G, PanelLoginProps as P, PanelProps as a, PanelScreen as b, PanelSearchParamsType as c };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { k as AnalyticsOption } from './instrument-eXaC8hc2.mjs';
|
|
2
|
+
import { R as ReturnsAppearance, a as ReturnsTexts, L as LoginLogoOptions } from './texts-LGhuQfA9.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Strings of the shared e-mail + 6-digit-code login (panel, notifications).
|
|
6
|
+
* Strings with `{name}` placeholders keep them in overrides.
|
|
7
|
+
*/
|
|
8
|
+
type EmailCodeTexts = {
|
|
9
|
+
emailLabel: string;
|
|
10
|
+
emailPlaceholder: string;
|
|
11
|
+
/** Submit button of the e-mail step. */
|
|
12
|
+
sendCode: string;
|
|
13
|
+
/** Same button while the code is being sent. */
|
|
14
|
+
sending: string;
|
|
15
|
+
invalidEmail: string;
|
|
16
|
+
/** Placeholder `{email}`. */
|
|
17
|
+
codeSentTo: string;
|
|
18
|
+
/** Link back to the e-mail step ("Zmień"). */
|
|
19
|
+
changeEmail: string;
|
|
20
|
+
codeLabel: string;
|
|
21
|
+
/** Submit button of the code step. */
|
|
22
|
+
verify: string;
|
|
23
|
+
verifying: string;
|
|
24
|
+
codeIncomplete: string;
|
|
25
|
+
spamHint: string;
|
|
26
|
+
validity: string;
|
|
27
|
+
resend: string;
|
|
28
|
+
/** Placeholder `{seconds}`. */
|
|
29
|
+
resendIn: string;
|
|
30
|
+
/** Resend button after the code expired or ran out of attempts. */
|
|
31
|
+
resendNew: string;
|
|
32
|
+
resent: string;
|
|
33
|
+
/** "Masz już kod?" next to the {@link haveCode} link. */
|
|
34
|
+
haveCodePrompt: string;
|
|
35
|
+
haveCode: string;
|
|
36
|
+
/** In the "I already have a code" view: link back to sending one. */
|
|
37
|
+
noCode: string;
|
|
38
|
+
stepEmail: string;
|
|
39
|
+
stepCode: string;
|
|
40
|
+
wrongCode: string;
|
|
41
|
+
expired: string;
|
|
42
|
+
tooManyAttempts: string;
|
|
43
|
+
/** Placeholder `{time}`, for example "45 s" or "2 min". */
|
|
44
|
+
rateLimited: string;
|
|
45
|
+
/** Placeholder `{time}`. */
|
|
46
|
+
alreadySent: string;
|
|
47
|
+
emailNotFound: string;
|
|
48
|
+
deliveryFailed: string;
|
|
49
|
+
deliveryUnavailable: string;
|
|
50
|
+
network: string;
|
|
51
|
+
generic: string;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** Strings of `PanelLogin`: the shared login texts plus the two titles. */
|
|
55
|
+
type PanelLoginTexts = EmailCodeTexts & {
|
|
56
|
+
title: string;
|
|
57
|
+
description: string;
|
|
58
|
+
codeTitle: string;
|
|
59
|
+
codeDescription: string;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
interface GetThemeOutput {
|
|
63
|
+
logoURL?: string;
|
|
64
|
+
logoDarkURL?: string;
|
|
65
|
+
colors?: {
|
|
66
|
+
brand?: string;
|
|
67
|
+
brandDark?: string;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
type PanelScreen = "products" | "notifications" | "profile" | "plans" | "orders" | "order-details" | "returns" | "return-details" | "course";
|
|
71
|
+
type PanelSearchParamsType = {
|
|
72
|
+
product?: string;
|
|
73
|
+
state: PanelScreen;
|
|
74
|
+
orderId?: string;
|
|
75
|
+
returnId?: string;
|
|
76
|
+
/** `state: "course"`: `UserProduct.accessId` of the open course. */
|
|
77
|
+
course?: string;
|
|
78
|
+
/** `state: "course"`: id of the open lesson or test. */
|
|
79
|
+
item?: string;
|
|
80
|
+
};
|
|
81
|
+
interface PanelProps {
|
|
82
|
+
projectID: string;
|
|
83
|
+
theme?: GetThemeOutput;
|
|
84
|
+
loginURL: string;
|
|
85
|
+
/**
|
|
86
|
+
* Appearance of the Returns screen. When omitted, `buttonBackground`,
|
|
87
|
+
* `focusRing` and a readable `buttonForeground` are derived from
|
|
88
|
+
* `theme.colors.brand`.
|
|
89
|
+
*/
|
|
90
|
+
returnsAppearance?: ReturnsAppearance;
|
|
91
|
+
/** Text overrides of the Returns screen. */
|
|
92
|
+
returnsTexts?: Partial<ReturnsTexts>;
|
|
93
|
+
/**
|
|
94
|
+
* Usage statistics for your Bitsnap dashboard (panel logins, orders viewed, downloads). On by default;
|
|
95
|
+
* `false` turns it off. An object lets you forward every event:
|
|
96
|
+
* `{ onEvent }`. Nothing is stored on the visitor's device.
|
|
97
|
+
*/
|
|
98
|
+
analytics?: AnalyticsOption;
|
|
99
|
+
}
|
|
100
|
+
interface PanelLoginProps extends LoginLogoOptions {
|
|
101
|
+
projectID: string;
|
|
102
|
+
theme?: GetThemeOutput;
|
|
103
|
+
/**
|
|
104
|
+
* Usage statistics for your Bitsnap dashboard (panel logins). On by default;
|
|
105
|
+
* `false` turns it off. An object lets you forward every event:
|
|
106
|
+
* `{ onEvent }`. Nothing is stored on the visitor's device.
|
|
107
|
+
*/
|
|
108
|
+
analytics?: AnalyticsOption;
|
|
109
|
+
/**
|
|
110
|
+
* Text overrides of the login: titles, buttons and every message. Polish
|
|
111
|
+
* and English defaults are chosen by `locale`.
|
|
112
|
+
*/
|
|
113
|
+
texts?: Partial<PanelLoginTexts>;
|
|
114
|
+
/**
|
|
115
|
+
* Language of the default texts: a locale starting with `en` gives English,
|
|
116
|
+
* anything else Polish. Defaults to the library locale (`setLocale`).
|
|
117
|
+
*/
|
|
118
|
+
locale?: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export type { GetThemeOutput as G, PanelLoginProps as P, PanelProps as a, PanelScreen as b, PanelSearchParamsType as c };
|
package/dist/viewer3d.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as it,b as oe,e as xe,g as st,h as O}from"./chunk-5ED7FWNY.mjs";import{e as De,f as Pe}from"./chunk-
|
|
1
|
+
import{a as it,b as oe,e as xe,g as st,h as O}from"./chunk-5ED7FWNY.mjs";import{e as De,f as Pe}from"./chunk-M2G74N43.mjs";import{b as _}from"./chunk-CUPG4B5W.mjs";import{c as he,e as j}from"./chunk-X3LVYIJR.mjs";import"./chunk-2UDAB2C5.mjs";import{f as we}from"./chunk-VNYHJT6V.mjs";import"./chunk-MDCP5JNP.mjs";import"./chunk-U6FLIRIV.mjs";import{useState as Mt}from"react";var Se={sectionLabel:"Model 3D",show:e=>`Poka\u017C model 3D (${e})`,heroPill:"Zobacz w 3D",heroPillWithSize:e=>`Zobacz w 3D (${e})`,loading:"Wczytywanie modelu 3D\u2026",loadingProgress:e=>`Wczytywanie modelu 3D: ${e}%`,error:"Nie uda\u0142o si\u0119 wczyta\u0107 modelu 3D",retry:"Spr\xF3buj ponownie",unsupported:"Ta przegl\u0105darka nie wy\u015Bwietli modelu 3D.",hintDrag:"Przeci\u0105gnij, aby obr\xF3ci\u0107",hintTap:"Dotknij, aby obraca\u0107",touchDone:"Gotowe",reset:"Reset widoku",fullscreen:"Pe\u0142ny ekran",closeFullscreen:"Zamknij pe\u0142ny ekran",disclaimer:"Model 3D jest pogl\u0105dowy; kolory i detale mog\u0105 si\u0119 r\xF3\u017Cni\u0107 od produktu.",report:"Zg\u0142o\u015B ten model",factsTitle:"Szczeg\xF3\u0142y modelu",factsFormat:"Format",factsFileSize:"Rozmiar pliku",factsTriangles:"Tr\xF3jk\u0105ty",factsDimensions:"Wymiary",triangles:e=>e,licence:"Licencja",licenceShow:"Warunki licencji",licenceOpen:"Otw\xF3rz licencj\u0119",licenceClose:"Zamknij",licenceDefaultName:"Licencja sprzedawcy",units:{meters:"m",centimeters:"cm",millimeters:"mm",inches:"in"},addToCart:"Dodaj do koszyka",addingToCart:"Dodawanie\u2026",addedToCart:"Dodano do koszyka",addToCartError:"Nie uda\u0142o si\u0119 doda\u0107 do koszyka. Spr\xF3buj ponownie."},Ee={sectionLabel:"3D model",show:e=>`Show 3D model (${e})`,heroPill:"View in 3D",heroPillWithSize:e=>`View in 3D (${e})`,loading:"Loading the 3D model\u2026",loadingProgress:e=>`Loading the 3D model: ${e}%`,error:"The 3D model could not be loaded",retry:"Try again",unsupported:"This browser cannot show the 3D model.",hintDrag:"Drag to rotate",hintTap:"Tap to rotate",touchDone:"Done",reset:"Reset view",fullscreen:"Full screen",closeFullscreen:"Close full screen",disclaimer:"The 3D model is illustrative; colours and details may differ from the product.",report:"Report this model",factsTitle:"Model details",factsFormat:"Format",factsFileSize:"File size",factsTriangles:"Triangles",factsDimensions:"Dimensions",triangles:e=>e,licence:"Licence",licenceShow:"Licence terms",licenceOpen:"Open the licence",licenceClose:"Close",licenceDefaultName:"Seller's licence",units:{meters:"m",centimeters:"cm",millimeters:"mm",inches:"in"},addToCart:"Add to cart",addingToCart:"Adding\u2026",addedToCart:"Added to cart",addToCartError:"Could not add to the cart. Try again."};function H(e,t){let r=e?.toLowerCase().startsWith("en")?Ee:Se;return t?{...r,...t}:r}function z(e){return e?.toLowerCase().startsWith("en")?"en-GB":"pl-PL"}import{Box as _e,Hand as Ae,Maximize2 as pt,Rotate3d as mt,RotateCcw as Ue,X as ft}from"lucide-react";import{useCallback as W,useEffect as h,useId as gt,useReducer as bt,useRef as ie,useState as P}from"react";import{createPortal as vt}from"react-dom";var at={meters:1e3,centimeters:10,millimeters:1,inches:25.4};function dt(e,t,r,o){if(e.length!==3)return;let i=new Intl.NumberFormat(z(o),{maximumFractionDigits:t==="millimeters"?0:2}),m=at[t]??1e3;return`${e.map(a=>i.format(a/m)).join(" \xD7 ")} ${r.units[t]}`}function ke(e,t,r){let o=[{label:t.factsFormat,value:"GLB"}];e.fileSize>0&&o.push({label:t.factsFileSize,value:O(e.fileSize,z(r))}),e.triangleCount>0&&o.push({label:t.factsTriangles,value:t.triangles(new Intl.NumberFormat(z(r)).format(e.triangleCount))});let i=dt(e.dimensionsMm,e.unit,t,r);return i&&o.push({label:t.factsDimensions,value:i}),o}import{useCallback as Me,useEffect as B,useRef as lt,useState as ct}from"react";function ut(e){return e!=null&&typeof e.requestFullscreen=="function"&&document.fullscreenEnabled===!0}function Ve(e){let[t,r]=ct(null),o=lt(0),i=Me(()=>{if(document.fullscreenElement!=null){document.exitFullscreen().catch(()=>r(null));return}r(null)},[]),m=Me(()=>{let a=e.current;if(o.current=window.scrollY,ut(a)){a.requestFullscreen({navigationUI:"hide"}).then(()=>r("native")).catch(()=>r("overlay"));return}r("overlay")},[e]);return B(()=>{let a=()=>{document.fullscreenElement==null&&r(d=>d==="native"?null:d)};return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[]),B(()=>{if(t!=="native")return;let a=d=>{d.key==="Escape"&&document.fullscreenElement!=null&&document.exitFullscreen().catch(()=>r(null))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t]),B(()=>{if(t!=="overlay")return;let{body:a,documentElement:d}=document,p={overflow:a.style.overflow,rootOverflow:d.style.overflow};a.style.overflow="hidden",d.style.overflow="hidden";let f=u=>{u.key==="Escape"&&r(null)};return window.addEventListener("keydown",f),()=>{window.removeEventListener("keydown",f),a.style.overflow=p.overflow,d.style.overflow=p.rootOverflow}},[t]),B(()=>{if(t==null&&o.current>0){let a=o.current;o.current=0,requestAnimationFrame(()=>window.scrollTo({top:a,behavior:"instant"}))}},[t]),{mode:t,isFullscreen:t!=null,enter:m,exit:i}}var Ce="bitsnap:viewer3d:gesture-hint-seen";function Te(){try{return typeof window>"u"?void 0:window.localStorage}catch{return}}function Re(e=Te()){try{return e?.getItem(Ce)==="1"}catch{return!1}}function Le(e=Te()){try{e?.setItem(Ce,"1")}catch{}}function Ne(e,t){return oe(e.size)?"awaiting-click":t?"loading":"poster"}function $e(e){return{status:Ne(e,!1),model:e,progress:0,attempt:0}}function ze(e,t){switch(t.type){case"NO_WEBGL":return e.status==="ready"?e:{...e,status:"unsupported"};case"VISIBLE":return e.status==="poster"?{...e,status:"loading",progress:0}:e;case"REQUEST":return e.status==="poster"||e.status==="awaiting-click"?{...e,status:"loading",progress:0}:e.status==="error"?{...e,status:"loading",progress:0,attempt:e.attempt+1}:e;case"RETRY":return e.status==="error"?{...e,status:"loading",progress:0,attempt:e.attempt+1}:e;case"PROGRESS":{if(e.status!=="loading"||t.key!==e.model.key)return e;let r=t.total>0?Math.min(1,Math.max(0,t.loaded/t.total)):0;return r===e.progress?e:{...e,progress:r}}case"LOADED":return e.status!=="loading"||t.key!==e.model.key?e:{...e,status:"ready",progress:1};case"FAILED":return e.status!=="loading"||t.key!==e.model.key?e:{...e,status:"error"};case"MODEL_CHANGED":return t.model.key===e.model.key?t.model.size===e.model.size?e:{...e,model:t.model}:e.status==="unsupported"?{...e,model:t.model}:{status:Ne(t.model,t.visible),model:t.model,progress:0,attempt:0}}}function Fe(e){return e==="loading"||e==="ready"}var Ie="bitsnap-react-viewer3d",T="[data-bitsnap-viewer3d]",k="var(--bitsnap-viewer3d-background,#ffffff)",g="var(--bitsnap-viewer3d-foreground,#171717)",G="var(--bitsnap-viewer3d-border,#e5e5e5)",ne="var(--bitsnap-viewer3d-radius,0.75rem)",Oe=`
|
|
2
2
|
${T}{container-type:inline-size;display:flex;flex-direction:column;gap:.75rem;font-family:inherit;color:${g}}
|
|
3
3
|
${T} *{box-sizing:border-box}
|
|
4
4
|
${T} .bsv3d-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bitsnap-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "This is Bitsnap React library for easy integration with any website which is using React framework",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"clean": "rimraf ./dist",
|
|
15
15
|
"dev": "node scripts/write-version.mjs && tsup --watch",
|
|
16
16
|
"dev:publish": "pnpm dev --env.publish",
|
|
17
|
-
"test": "tsup src/components/checkout/appearance.test.ts src/components/checkout/texts.test.ts src/components/checkout/buy-error.test.ts src/components/checkout/cart-buy-error.test.tsx src/lib/appearance-core.test.ts src/lib/texts.test.ts src/components/returns/appearance.test.ts src/components/returns/texts.test.ts src/components/returns/errors.test.ts src/components/returns/money.test.ts src/components/returns/session-storage.test.ts src/components/returns/state-machine.test.ts src/components/returns/selection.test.ts src/components/returns/legacy.test.ts src/panel/returns-appearance.test.ts src/components/products/appearance.test.ts src/components/products/texts.test.ts src/components/products/format.test.ts src/components/products/fetch.test.ts src/components/products/useProducts.test.ts src/components/products/cart-target.test.ts src/components/checkout/cart-items.test.ts src/components/checkout/pending-order.test.ts src/components/checkout/quantity.test.ts src/components/checkout/cart-a11y.test.tsx src/components/checkout/payment-method.test.ts src/components/checkout/cart-payment-method.test.tsx src/course/logic.test.ts src/course/accent.test.ts src/course/texts.test.ts src/course/datasource.test.ts src/course/sanitize.test.ts src/course/VideoPlayer.test.tsx src/course/PanelCourse.test.tsx src/consent/core/cookie.test.ts src/consent/core/texts.test.ts src/consent/core/activate.test.ts src/consent/core/gcm.test.ts src/consent/core/contrast.test.ts src/consent/core/controller.test.ts src/consent/embed.test.ts src/consent/react.test.tsx src/consent/react-shown.test.tsx src/analytics/core.test.ts src/analytics/embed.test.ts src/analytics/instrument.test.tsx src/analytics/page-views.test.tsx src/analytics/visitor.test.ts src/components/checkout/visitor-header.test.ts src/components/products/impressions.test.ts src/components/products/ProductList.analytics.test.tsx src/components/checkout/cart-analytics.test.tsx src/components/checkout/apple-pay-analytics.test.tsx src/components/notifications/notifications-analytics.test.tsx src/components/returns/returns-analytics.test.tsx src/panel/panel-analytics.test.tsx src/course/course-analytics.test.tsx src/viewer3d/viewer3d.test.ts src/viewer3d/Model3DViewer.test.tsx src/panel/panel-products.test.tsx --format esm --out-dir .test-dist --no-config --external jsdom --silent && node --test --test-force-exit \".test-dist/**/*.test.mjs\"",
|
|
17
|
+
"test": "tsup src/components/checkout/appearance.test.ts src/components/checkout/texts.test.ts src/components/checkout/buy-error.test.ts src/components/checkout/cart-buy-error.test.tsx src/lib/appearance-core.test.ts src/lib/texts.test.ts src/components/returns/appearance.test.ts src/components/returns/texts.test.ts src/components/returns/errors.test.ts src/components/returns/money.test.ts src/components/returns/session-storage.test.ts src/components/returns/state-machine.test.ts src/components/returns/selection.test.ts src/components/returns/legacy.test.ts src/panel/returns-appearance.test.ts src/components/products/appearance.test.ts src/components/products/texts.test.ts src/components/products/format.test.ts src/components/products/fetch.test.ts src/components/products/useProducts.test.ts src/components/products/cart-target.test.ts src/components/checkout/cart-items.test.ts src/components/checkout/pending-order.test.ts src/components/checkout/quantity.test.ts src/components/checkout/cart-a11y.test.tsx src/components/checkout/payment-method.test.ts src/components/checkout/cart-payment-method.test.tsx src/course/logic.test.ts src/course/accent.test.ts src/course/texts.test.ts src/course/datasource.test.ts src/course/sanitize.test.ts src/course/VideoPlayer.test.tsx src/course/PanelCourse.test.tsx src/consent/core/cookie.test.ts src/consent/core/texts.test.ts src/consent/core/activate.test.ts src/consent/core/gcm.test.ts src/consent/core/contrast.test.ts src/consent/core/controller.test.ts src/consent/embed.test.ts src/consent/react.test.tsx src/consent/react-shown.test.tsx src/analytics/core.test.ts src/analytics/embed.test.ts src/analytics/instrument.test.tsx src/analytics/page-views.test.tsx src/analytics/visitor.test.ts src/components/checkout/visitor-header.test.ts src/components/products/impressions.test.ts src/components/products/ProductList.analytics.test.tsx src/components/checkout/cart-analytics.test.tsx src/components/checkout/apple-pay-analytics.test.tsx src/components/notifications/notifications-analytics.test.tsx src/components/returns/returns-analytics.test.tsx src/panel/panel-analytics.test.tsx src/course/course-analytics.test.tsx src/viewer3d/viewer3d.test.ts src/viewer3d/Model3DViewer.test.tsx src/panel/panel-products.test.tsx src/ui/email-code-login/email-code-login.test.tsx src/ui/email-code-login/login-brand-logo.test.tsx src/panel/panel-login.test.tsx src/components/returns/returns-login.test.tsx src/components/notifications/notifications-login.test.tsx --format esm --out-dir .test-dist --no-config --external jsdom --silent && node --test --test-force-exit \".test-dist/**/*.test.mjs\"",
|
|
18
18
|
"test:types": "tsc -p test/consumer/tsconfig.json",
|
|
19
19
|
"test:package": "node test/consumer/verify-package.mjs"
|
|
20
20
|
},
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkY5KWVTXTjs = require('./chunk-Y5KWVTXT.js');require('./chunk-QERYM7RC.js');require('./chunk-KOYBZORL.js');require('./chunk-SRQOFCMO.js');require('./chunk-WPOXLITY.js');require('./chunk-GXUNRJ5S.js');require('./chunk-GQJDFLSL.js');var _chunk7RXW6XFYjs = require('./chunk-7RXW6XFY.js');require('./chunk-W3RGQYPD.js');require('./chunk-JSDGZ4NY.js');exports.MARKETING_AGREEMENT_ID = _chunkY5KWVTXTjs.L; exports.bitsnapProjectID = _chunkY5KWVTXTjs.M; exports.default = _chunkY5KWVTXTjs.T; exports.getCartLines = _chunkY5KWVTXTjs.Q; exports.getCheckoutMethods = _chunkY5KWVTXTjs.U; exports.getCheckoutSelection = _chunkY5KWVTXTjs.P; exports.getLocale = _chunk7RXW6XFYjs.f; exports.getProjectID = _chunkY5KWVTXTjs.O; exports.reconcileOrderOfLastPayment = _chunkY5KWVTXTjs.R; exports.setLocale = _chunk7RXW6XFYjs.e; exports.setProjectID = _chunkY5KWVTXTjs.N; exports.useCartProvider = _chunkY5KWVTXTjs.S;
|
|
2
|
-
//# sourceMappingURL=CartProvider-VGZMDVFJ.js.map
|