@neurodyn/react-ai-try-on 0.1.1 → 0.1.3
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/index.js +28 -30
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9819,28 +9819,28 @@ function createApiClientRuntime({ clientName, configureFunctionName, defaultBase
|
|
|
9819
9819
|
};
|
|
9820
9820
|
}
|
|
9821
9821
|
const runtime = createApiClientRuntime({
|
|
9822
|
-
clientName: 'API
|
|
9823
|
-
configureFunctionName: '
|
|
9822
|
+
clientName: 'API client',
|
|
9823
|
+
configureFunctionName: 'configureApiClient',
|
|
9824
9824
|
defaultBaseURL: "https://api.vizbl.com"
|
|
9825
9825
|
});
|
|
9826
|
-
const
|
|
9826
|
+
const configureApiClientRuntime = runtime.configureClientRuntime;
|
|
9827
9827
|
runtime.configureAccessTokenResolverRuntime;
|
|
9828
9828
|
runtime.configureHeadersResolverRuntime;
|
|
9829
9829
|
runtime.configureUnauthorizedHandlerRuntime;
|
|
9830
9830
|
runtime.isClientConfiguredRuntime;
|
|
9831
9831
|
runtime.assertClientConfiguredRuntime;
|
|
9832
9832
|
runtime.resetClientForTestsRuntime;
|
|
9833
|
-
const
|
|
9833
|
+
const client_runtime_requestRuntime = runtime.requestRuntime;
|
|
9834
9834
|
runtime.requestWithoutUnauthorizedRecovery;
|
|
9835
9835
|
runtime.addResponseInterceptorRuntime;
|
|
9836
|
-
function
|
|
9837
|
-
|
|
9836
|
+
function configureApiClient(config) {
|
|
9837
|
+
configureApiClientRuntime(config);
|
|
9838
9838
|
}
|
|
9839
|
-
async function
|
|
9840
|
-
return
|
|
9839
|
+
async function client_client(config) {
|
|
9840
|
+
return client_runtime_requestRuntime(config);
|
|
9841
9841
|
}
|
|
9842
9842
|
async function nanoBananaControllerGenerateTryOnSync(data, config = {}) {
|
|
9843
|
-
const { client: request =
|
|
9843
|
+
const { client: request = client_client, ...requestConfig } = config;
|
|
9844
9844
|
const requestData = data;
|
|
9845
9845
|
const res = await request({
|
|
9846
9846
|
method: "POST",
|
|
@@ -9851,7 +9851,7 @@ async function nanoBananaControllerGenerateTryOnSync(data, config = {}) {
|
|
|
9851
9851
|
return res.data;
|
|
9852
9852
|
}
|
|
9853
9853
|
async function nanoBananaControllerRequestUploadUrls(params, config = {}) {
|
|
9854
|
-
const { client: request =
|
|
9854
|
+
const { client: request = client_client, ...requestConfig } = config;
|
|
9855
9855
|
const res = await request({
|
|
9856
9856
|
method: "POST",
|
|
9857
9857
|
url: "/nano-banana/guest/upload/request",
|
|
@@ -9861,7 +9861,7 @@ async function nanoBananaControllerRequestUploadUrls(params, config = {}) {
|
|
|
9861
9861
|
return res.data;
|
|
9862
9862
|
}
|
|
9863
9863
|
async function tryOnControllerActivateTryOn(params, config = {}) {
|
|
9864
|
-
const { client: request =
|
|
9864
|
+
const { client: request = client_client, ...requestConfig } = config;
|
|
9865
9865
|
const res = await request({
|
|
9866
9866
|
method: "POST",
|
|
9867
9867
|
url: "/public/widget/activate-try-on",
|
|
@@ -9871,7 +9871,7 @@ async function tryOnControllerActivateTryOn(params, config = {}) {
|
|
|
9871
9871
|
return res.data;
|
|
9872
9872
|
}
|
|
9873
9873
|
async function tryOnControllerCreateUploadUrls(params, config = {}) {
|
|
9874
|
-
const { client: request =
|
|
9874
|
+
const { client: request = client_client, ...requestConfig } = config;
|
|
9875
9875
|
const res = await request({
|
|
9876
9876
|
method: "POST",
|
|
9877
9877
|
url: "/public/try-on/upload/request",
|
|
@@ -9881,7 +9881,7 @@ async function tryOnControllerCreateUploadUrls(params, config = {}) {
|
|
|
9881
9881
|
return res.data;
|
|
9882
9882
|
}
|
|
9883
9883
|
async function tryOnControllerGenerateShopifyTryOn(data, config = {}) {
|
|
9884
|
-
const { client: request =
|
|
9884
|
+
const { client: request = client_client, ...requestConfig } = config;
|
|
9885
9885
|
const requestData = data;
|
|
9886
9886
|
const res = await request({
|
|
9887
9887
|
method: "POST",
|
|
@@ -9892,7 +9892,7 @@ async function tryOnControllerGenerateShopifyTryOn(data, config = {}) {
|
|
|
9892
9892
|
return res.data;
|
|
9893
9893
|
}
|
|
9894
9894
|
async function tryOnControllerGenerateTryOn(data, config = {}) {
|
|
9895
|
-
const { client: request =
|
|
9895
|
+
const { client: request = client_client, ...requestConfig } = config;
|
|
9896
9896
|
const requestData = data;
|
|
9897
9897
|
const res = await request({
|
|
9898
9898
|
method: "POST",
|
|
@@ -9903,7 +9903,7 @@ async function tryOnControllerGenerateTryOn(data, config = {}) {
|
|
|
9903
9903
|
return res.data;
|
|
9904
9904
|
}
|
|
9905
9905
|
async function publicApiControllerIssueWidgetToken(data, config = {}) {
|
|
9906
|
-
const { client: request =
|
|
9906
|
+
const { client: request = client_client, ...requestConfig } = config;
|
|
9907
9907
|
const requestData = data;
|
|
9908
9908
|
const res = await request({
|
|
9909
9909
|
method: "POST",
|
|
@@ -9914,7 +9914,7 @@ async function publicApiControllerIssueWidgetToken(data, config = {}) {
|
|
|
9914
9914
|
return res.data;
|
|
9915
9915
|
}
|
|
9916
9916
|
async function widgetEventsControllerCreateWidgetEvent(data, config = {}) {
|
|
9917
|
-
const { client: request =
|
|
9917
|
+
const { client: request = client_client, ...requestConfig } = config;
|
|
9918
9918
|
const requestData = data;
|
|
9919
9919
|
const res = await request({
|
|
9920
9920
|
method: "POST",
|
|
@@ -9925,7 +9925,7 @@ async function widgetEventsControllerCreateWidgetEvent(data, config = {}) {
|
|
|
9925
9925
|
return res.data;
|
|
9926
9926
|
}
|
|
9927
9927
|
async function sessionControllerCreateGuestSession(config = {}) {
|
|
9928
|
-
const { client: request =
|
|
9928
|
+
const { client: request = client_client, ...requestConfig } = config;
|
|
9929
9929
|
const res = await request({
|
|
9930
9930
|
method: "POST",
|
|
9931
9931
|
url: "/session/guest",
|
|
@@ -17924,6 +17924,12 @@ function ZoomIn(props) {
|
|
|
17924
17924
|
]
|
|
17925
17925
|
});
|
|
17926
17926
|
}
|
|
17927
|
+
function fallBackOnce(fallbackSrc) {
|
|
17928
|
+
return (event)=>{
|
|
17929
|
+
const image = event.currentTarget;
|
|
17930
|
+
if (fallbackSrc && image.getAttribute('src') !== fallbackSrc) image.src = fallbackSrc;
|
|
17931
|
+
};
|
|
17932
|
+
}
|
|
17927
17933
|
function TryOnImagePanel({ children, className, ...props }) {
|
|
17928
17934
|
return /*#__PURE__*/ jsx_runtime_jsx("div", {
|
|
17929
17935
|
className: utils_cn('relative h-82 w-full overflow-hidden rounded-xl bg-background-base sm:h-100', className),
|
|
@@ -17948,9 +17954,7 @@ function PhotoBackdrop({ className, src }) {
|
|
|
17948
17954
|
}
|
|
17949
17955
|
function SmartPhotoLayer({ backdropClassName, className, fallbackSrc, imageClassName, photo }) {
|
|
17950
17956
|
const src = photo?.src ?? fallbackSrc;
|
|
17951
|
-
|
|
17952
|
-
if (fallbackSrc) event.currentTarget.src = fallbackSrc;
|
|
17953
|
-
}
|
|
17957
|
+
const handleError = fallBackOnce(fallbackSrc);
|
|
17954
17958
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
17955
17959
|
children: [
|
|
17956
17960
|
src && /*#__PURE__*/ jsx_runtime_jsx("img", {
|
|
@@ -17980,9 +17984,7 @@ function BlurredPhotoBackdrop({ className, fallbackSrc, photo }) {
|
|
|
17980
17984
|
"aria-hidden": "true",
|
|
17981
17985
|
className: utils_cn('absolute inset-0 size-full scale-125 object-cover blur-3xl', className),
|
|
17982
17986
|
src: src,
|
|
17983
|
-
onError: (
|
|
17984
|
-
if (fallbackSrc) event.currentTarget.src = fallbackSrc;
|
|
17985
|
-
}
|
|
17987
|
+
onError: fallBackOnce(fallbackSrc)
|
|
17986
17988
|
}),
|
|
17987
17989
|
/*#__PURE__*/ jsx_runtime_jsx("div", {
|
|
17988
17990
|
"aria-hidden": "true",
|
|
@@ -18136,9 +18138,7 @@ function TryOnPerson({ className, fallbackSrc, photo }) {
|
|
|
18136
18138
|
alt: photo?.name ?? '',
|
|
18137
18139
|
className: utils_cn('absolute left-1/2 top-0 h-full w-69 -translate-x-1/2 object-cover', className),
|
|
18138
18140
|
src: src,
|
|
18139
|
-
onError: (
|
|
18140
|
-
if (fallbackSrc) event.currentTarget.src = fallbackSrc;
|
|
18141
|
-
}
|
|
18141
|
+
onError: fallBackOnce(fallbackSrc)
|
|
18142
18142
|
});
|
|
18143
18143
|
}
|
|
18144
18144
|
function ProductThumbnail({ className, imageSrc, name }) {
|
|
@@ -19284,9 +19284,7 @@ function ErrorScreen({ view, onClose }) {
|
|
|
19284
19284
|
alt: view.photo.name ?? '',
|
|
19285
19285
|
className: "size-full object-cover",
|
|
19286
19286
|
src: view.photo.src,
|
|
19287
|
-
onError: (
|
|
19288
|
-
event.currentTarget.src = view.productImageSrc;
|
|
19289
|
-
}
|
|
19287
|
+
onError: fallBackOnce(view.productImageSrc)
|
|
19290
19288
|
}) : null
|
|
19291
19289
|
})
|
|
19292
19290
|
]
|
|
@@ -21074,7 +21072,7 @@ function getBadgeTone(stage) {
|
|
|
21074
21072
|
return 'gray';
|
|
21075
21073
|
}
|
|
21076
21074
|
}
|
|
21077
|
-
|
|
21075
|
+
configureApiClient({
|
|
21078
21076
|
baseURL: "https://api.neurodyn.ai/"
|
|
21079
21077
|
});
|
|
21080
21078
|
const SHOPIFY_REQUEST_TIMEOUT_MS = 30000;
|