@raxonltd/raxon-core 1.1.7 → 1.1.13
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/core/component/general.image.tsx +86 -0
- package/core/context/cart.context.tsx +446 -0
- package/core/context/security.context.tsx +151 -0
- package/core/feature/address/api/places.api.ts +92 -0
- package/core/feature/address/form/address-search-input.tsx +125 -0
- package/core/feature/address/hook/use.addres.tsx +63 -0
- package/core/feature/address/hook/use.address-autocomplete.ts +116 -0
- package/core/feature/address/util/address.types.ts +38 -0
- package/core/feature/address/util/parse-google-place.ts +66 -0
- package/core/feature/analytic-event/analytic.event.api.ts +27 -0
- package/core/feature/analytic-event/analytic.event.context.tsx +180 -0
- package/core/feature/analytic-event/analytic.event.util.ts +42 -0
- package/core/feature/analytic-event/use.analytic.auto.tsx +114 -0
- package/core/feature/article/hook/use.article.tsx +33 -0
- package/core/feature/attribute/hook/use.attribute.tsx +24 -0
- package/core/feature/auth/hook/use.auth.tsx +141 -0
- package/core/feature/auth/modal/modal.auth.tsx +80 -0
- package/core/feature/auth/view/view.login.tsx +199 -0
- package/core/feature/auth/view/view.register.tsx +333 -0
- package/core/feature/bank-account/hook/use.bank.account.tsx +47 -0
- package/core/feature/brand/hook/use.brand.tsx +24 -0
- package/core/feature/cart/component/cart.order.summary.tsx +89 -0
- package/core/feature/cart/component/cart.promo.code.section.tsx +208 -0
- package/core/feature/cart/hook/use.cart.tsx +267 -0
- package/core/feature/cart/util/basket-pay.response.ts +67 -0
- package/core/feature/cart/util/cart-optimistic.ts +425 -0
- package/core/feature/cart/util/garanti-payment.ts +27 -0
- package/core/feature/collection/hook/use.collection.tsx +32 -0
- package/core/feature/delivery-method/hook/use.delivery.method.tsx +40 -0
- package/core/feature/delivery-method/util/checkout.delivery.method.ts +11 -0
- package/core/feature/faq/hook/use.faq.tsx +23 -0
- package/core/feature/favorite/hook/use.favorite.tsx +48 -0
- package/core/feature/form-submit/form/form.contact.tsx +118 -0
- package/core/feature/form-submit/hook/use.form.submit.tsx +16 -0
- package/core/feature/invoice/hook/use.invoice.tsx +51 -0
- package/core/feature/newsletter/hook/use.newsletter.tsx +124 -0
- package/core/feature/newsletter/modal/modal.newsletter.product.tsx +163 -0
- package/core/feature/order/hook/use.order.tsx +31 -0
- package/core/feature/payment-method/checkout.payment.options.ts +117 -0
- package/core/feature/payment-method/hook/use.payment.method.tsx +44 -0
- package/core/feature/product/hook/use.product.tsx +122 -0
- package/core/feature/profile/hook/use.profile.tsx +126 -0
- package/core/feature/promo-code/hook/use.promo.code.tsx +27 -0
- package/core/interface/basket.interface.ts +360 -0
- package/core/interface/bootstrap.interface.ts +39 -0
- package/core/interface/context.interface.ts +9 -0
- package/core/interface/inventory.interface.ts +88 -0
- package/core/interface/nexine.interface.ts +4 -0
- package/core/interface/prisma.interface.ts +8844 -0
- package/core/interface/product.interface.ts +111 -0
- package/core/raxon.context.tsx +256 -0
- package/core/schema/checkout.schema.ts +103 -0
- package/core/server/places.proxy.ts +35 -0
- package/core/server/raxon.bootstrap.route.ts +39 -0
- package/core/server/raxon.server.ts +80 -0
- package/core/util/basket.item.display.ts +19 -0
- package/core/util/category.nav.ts +46 -0
- package/core/util/client-ip.ts +35 -0
- package/core/util/collection.util.ts +433 -0
- package/core/util/fetch.bootstrap.ts +21 -0
- package/core/util/garanti-payment.ts +5 -0
- package/core/util/nexine.axios.tsx +104 -0
- package/core/util/no-cache.ts +6 -0
- package/core/util/util.ts +191 -0
- package/core/view/view.checkout.tsx +1964 -0
- package/dist/core/feature/address/api/places.api.d.ts.map +1 -1
- package/dist/core/feature/address/api/places.api.js +18 -4
- package/dist/core/server/places.proxy.d.ts +10 -0
- package/dist/core/server/places.proxy.d.ts.map +1 -0
- package/dist/core/server/places.proxy.js +24 -0
- package/dist/core/server/raxon.bootstrap.route.d.ts +7 -0
- package/dist/core/server/raxon.bootstrap.route.d.ts.map +1 -0
- package/dist/core/server/raxon.bootstrap.route.js +27 -0
- package/dist/core/server/raxon.server.d.ts +24 -0
- package/dist/core/server/raxon.server.d.ts.map +1 -0
- package/dist/core/server/raxon.server.js +59 -0
- package/dist/core/view/view.checkout.js +2 -2
- package/dist/middleware.d.ts +6 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +5 -0
- package/dist/server-bootstrap.d.ts +2 -0
- package/dist/server-bootstrap.d.ts.map +1 -0
- package/dist/server-bootstrap.js +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +22 -3
- package/tailwind.css +11 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"places.api.d.ts","sourceRoot":"","sources":["../../../../../core/feature/address/api/places.api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAMtG,UAAU,yBAAyB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,MAAM,EACb,EAAE,UAAyB,EAAE,QAAe,EAAE,MAAM,EAAE,GAAE,yBAA8B,GACrF,OAAO,CAAC,qBAAqB,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"places.api.d.ts","sourceRoot":"","sources":["../../../../../core/feature/address/api/places.api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAMtG,UAAU,yBAAyB;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,MAAM,EACb,EAAE,UAAyB,EAAE,QAAe,EAAE,MAAM,EAAE,GAAE,yBAA8B,GACrF,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAiClC;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,EAAE,QAAe,EAAE,MAAM,EAAE,GAAE,oBAAyB,GACrD,OAAO,CAAC,kBAAkB,CAAC,CAiC7B"}
|
|
@@ -6,11 +6,18 @@ export async function fetchPlaceAutocomplete(input, { components = 'country:tr',
|
|
|
6
6
|
if (!apiKey) {
|
|
7
7
|
throw new Error('Google Maps API key not configured');
|
|
8
8
|
}
|
|
9
|
-
const
|
|
9
|
+
const isBrowser = typeof window !== 'undefined';
|
|
10
|
+
let url;
|
|
11
|
+
if (isBrowser) {
|
|
12
|
+
url = new URL('/api/places/autocomplete', window.location.origin);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
url = new URL('https://maps.googleapis.com/maps/api/place/autocomplete/json');
|
|
16
|
+
url.searchParams.set('key', apiKey);
|
|
17
|
+
}
|
|
10
18
|
url.searchParams.set('input', input);
|
|
11
19
|
url.searchParams.set('components', components);
|
|
12
20
|
url.searchParams.set('language', language);
|
|
13
|
-
url.searchParams.set('key', apiKey);
|
|
14
21
|
const response = await fetch(url.toString(), { signal });
|
|
15
22
|
if (!response.ok) {
|
|
16
23
|
throw new Error(`Google Places API error: ${response.status}`);
|
|
@@ -26,11 +33,18 @@ export async function fetchPlaceDetails(placeId, { language = 'tr', signal } = {
|
|
|
26
33
|
if (!apiKey) {
|
|
27
34
|
throw new Error('Google Maps API key not configured');
|
|
28
35
|
}
|
|
29
|
-
const
|
|
36
|
+
const isBrowser = typeof window !== 'undefined';
|
|
37
|
+
let url;
|
|
38
|
+
if (isBrowser) {
|
|
39
|
+
url = new URL('/api/places/details', window.location.origin);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
url = new URL('https://maps.googleapis.com/maps/api/place/details/json');
|
|
43
|
+
url.searchParams.set('key', apiKey);
|
|
44
|
+
}
|
|
30
45
|
url.searchParams.set('place_id', placeId);
|
|
31
46
|
url.searchParams.set('fields', 'geometry,address_components,formatted_address');
|
|
32
47
|
url.searchParams.set('language', language);
|
|
33
|
-
url.searchParams.set('key', apiKey);
|
|
34
48
|
const response = await fetch(url.toString(), { signal });
|
|
35
49
|
if (!response.ok) {
|
|
36
50
|
throw new Error(`Google Places API error: ${response.status}`);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import type { NextRequest } from 'next/server';
|
|
3
|
+
declare const GOOGLE_PLACES_URL: {
|
|
4
|
+
readonly autocomplete: "https://maps.googleapis.com/maps/api/place/autocomplete/json";
|
|
5
|
+
readonly details: "https://maps.googleapis.com/maps/api/place/details/json";
|
|
6
|
+
};
|
|
7
|
+
export type GooglePlacesEndpoint = keyof typeof GOOGLE_PLACES_URL;
|
|
8
|
+
export declare function proxyGooglePlaces(request: NextRequest, endpoint: GooglePlacesEndpoint, googleMapsApiKey?: string): Promise<NextResponse<any>>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=places.proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"places.proxy.d.ts","sourceRoot":"","sources":["../../../core/server/places.proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,QAAA,MAAM,iBAAiB;;;CAGb,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAElE,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,oBAAoB,EAC9B,gBAAgB,CAAC,EAAE,MAAM,8BAqB1B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
const GOOGLE_PLACES_URL = {
|
|
3
|
+
autocomplete: 'https://maps.googleapis.com/maps/api/place/autocomplete/json',
|
|
4
|
+
details: 'https://maps.googleapis.com/maps/api/place/details/json',
|
|
5
|
+
};
|
|
6
|
+
export async function proxyGooglePlaces(request, endpoint, googleMapsApiKey) {
|
|
7
|
+
const googleUrl = new URL(GOOGLE_PLACES_URL[endpoint]);
|
|
8
|
+
request.nextUrl.searchParams.forEach((value, key) => {
|
|
9
|
+
googleUrl.searchParams.set(key, value);
|
|
10
|
+
});
|
|
11
|
+
const apiKey = googleMapsApiKey ?? process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY ?? '';
|
|
12
|
+
if (!googleUrl.searchParams.has('key') && apiKey) {
|
|
13
|
+
googleUrl.searchParams.set('key', apiKey);
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
const response = await fetch(googleUrl.toString());
|
|
17
|
+
const data = await response.json();
|
|
18
|
+
return NextResponse.json(data);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
console.error('[raxonServer/places]', error);
|
|
22
|
+
return NextResponse.json({ error: 'Google Places API isteği başarısız' }, { status: 500 });
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
/** API route kullanmak isteyenler için: export { GET, revalidate } from '@raxonltd/raxon-core/server/bootstrap' */
|
|
3
|
+
export declare const revalidate = 300;
|
|
4
|
+
export declare function GET(): Promise<NextResponse<import("../..").RaxonBootstrapPayload> | NextResponse<{
|
|
5
|
+
error: string;
|
|
6
|
+
}>>;
|
|
7
|
+
//# sourceMappingURL=raxon.bootstrap.route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raxon.bootstrap.route.d.ts","sourceRoot":"","sources":["../../../core/server/raxon.bootstrap.route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAyB3C,mHAAmH;AACnH,eAAO,MAAM,UAAU,MAA+B,CAAC;AAEvD,wBAAsB,GAAG;;IAUxB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import { unstable_cache } from 'next/cache';
|
|
3
|
+
import { fetchRaxonBootstrap } from '../util/fetch.bootstrap';
|
|
4
|
+
import { BOOTSTRAP_REVALIDATE_SECONDS, bootstrapCacheHeaders, } from '../server/raxon.server';
|
|
5
|
+
async function fetchBootstrapData() {
|
|
6
|
+
const apiUrl = process.env.NEXT_PUBLIC_API_URL;
|
|
7
|
+
const apiKey = process.env.NEXT_PUBLIC_API_KEY;
|
|
8
|
+
if (!apiUrl || !apiKey) {
|
|
9
|
+
throw new Error('[raxonServer] NEXT_PUBLIC_API_URL veya NEXT_PUBLIC_API_KEY tanımlı değil');
|
|
10
|
+
}
|
|
11
|
+
return fetchRaxonBootstrap(apiUrl, apiKey);
|
|
12
|
+
}
|
|
13
|
+
const getCachedBootstrap = unstable_cache(fetchBootstrapData, ['raxon-bootstrap'], { revalidate: BOOTSTRAP_REVALIDATE_SECONDS });
|
|
14
|
+
/** API route kullanmak isteyenler için: export { GET, revalidate } from '@raxonltd/raxon-core/server/bootstrap' */
|
|
15
|
+
export const revalidate = BOOTSTRAP_REVALIDATE_SECONDS;
|
|
16
|
+
export async function GET() {
|
|
17
|
+
try {
|
|
18
|
+
const data = await getCachedBootstrap();
|
|
19
|
+
return NextResponse.json(data, {
|
|
20
|
+
headers: bootstrapCacheHeaders(revalidate),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
console.error('[raxonServer]', error);
|
|
25
|
+
return NextResponse.json({ error: 'Bootstrap verisi alınamadı' }, { status: 502 });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import type { NextRequest } from 'next/server';
|
|
3
|
+
declare const DEFAULT_REVALIDATE_SECONDS = 300;
|
|
4
|
+
export interface RaxonServerOptions {
|
|
5
|
+
apiUrl?: string;
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
googleMapsApiKey?: string;
|
|
8
|
+
revalidate?: number;
|
|
9
|
+
}
|
|
10
|
+
declare function bootstrapCacheHeaders(revalidate?: number): {
|
|
11
|
+
'Cache-Control': string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Next.js middleware — bootstrap ve Google Places BFF isteklerini karşılar.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // proxy.ts — config Next.js tarafından statik parse edilmeli, import edilemez
|
|
18
|
+
* import { raxonServer } from '@raxonltd/raxon-core/server';
|
|
19
|
+
* export default raxonServer();
|
|
20
|
+
* export const config = { matcher: ['/api/bootstrap', '/api/places/:path'] };
|
|
21
|
+
*/
|
|
22
|
+
export declare function raxonServer(options?: RaxonServerOptions): (request: NextRequest) => Promise<NextResponse<any>>;
|
|
23
|
+
export { DEFAULT_REVALIDATE_SECONDS as BOOTSTRAP_REVALIDATE_SECONDS, bootstrapCacheHeaders };
|
|
24
|
+
//# sourceMappingURL=raxon.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raxon.server.d.ts","sourceRoot":"","sources":["../../../core/server/raxon.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,QAAA,MAAM,0BAA0B,MAAM,CAAC;AAQvC,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAkBD,iBAAS,qBAAqB,CAAC,UAAU,SAA6B;;EAIrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,IAGpB,SAAS,WAAW,gCAuB3D;AAED,OAAO,EAAE,0BAA0B,IAAI,4BAA4B,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import { fetchRaxonBootstrap } from '../util/fetch.bootstrap';
|
|
3
|
+
import { proxyGooglePlaces } from '../server/places.proxy';
|
|
4
|
+
const DEFAULT_REVALIDATE_SECONDS = 300;
|
|
5
|
+
const RAXON_SERVER_PATHS = {
|
|
6
|
+
bootstrap: '/api/bootstrap',
|
|
7
|
+
placesAutocomplete: '/api/places/autocomplete',
|
|
8
|
+
placesDetails: '/api/places/details',
|
|
9
|
+
};
|
|
10
|
+
function resolveCredentials(options = {}) {
|
|
11
|
+
const apiUrl = options.apiUrl ?? process.env.NEXT_PUBLIC_API_URL;
|
|
12
|
+
const apiKey = options.apiKey ?? process.env.NEXT_PUBLIC_API_KEY;
|
|
13
|
+
return { apiUrl, apiKey };
|
|
14
|
+
}
|
|
15
|
+
async function fetchBootstrapData(options = {}) {
|
|
16
|
+
const { apiUrl, apiKey } = resolveCredentials(options);
|
|
17
|
+
if (!apiUrl || !apiKey) {
|
|
18
|
+
throw new Error('[raxonServer] NEXT_PUBLIC_API_URL veya NEXT_PUBLIC_API_KEY tanımlı değil');
|
|
19
|
+
}
|
|
20
|
+
return fetchRaxonBootstrap(apiUrl, apiKey);
|
|
21
|
+
}
|
|
22
|
+
function bootstrapCacheHeaders(revalidate = DEFAULT_REVALIDATE_SECONDS) {
|
|
23
|
+
return {
|
|
24
|
+
'Cache-Control': `public, s-maxage=${revalidate}, stale-while-revalidate=${revalidate * 2}`,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Next.js middleware — bootstrap ve Google Places BFF isteklerini karşılar.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // proxy.ts — config Next.js tarafından statik parse edilmeli, import edilemez
|
|
32
|
+
* import { raxonServer } from '@raxonltd/raxon-core/server';
|
|
33
|
+
* export default raxonServer();
|
|
34
|
+
* export const config = { matcher: ['/api/bootstrap', '/api/places/:path'] };
|
|
35
|
+
*/
|
|
36
|
+
export function raxonServer(options = {}) {
|
|
37
|
+
const revalidate = options.revalidate ?? DEFAULT_REVALIDATE_SECONDS;
|
|
38
|
+
return async function raxonMiddleware(request) {
|
|
39
|
+
const { pathname } = request.nextUrl;
|
|
40
|
+
if (pathname === RAXON_SERVER_PATHS.bootstrap) {
|
|
41
|
+
try {
|
|
42
|
+
const data = await fetchBootstrapData(options);
|
|
43
|
+
return NextResponse.json(data, { headers: bootstrapCacheHeaders(revalidate) });
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
console.error('[raxonServer/bootstrap]', error);
|
|
47
|
+
return NextResponse.json({ error: 'Bootstrap verisi alınamadı' }, { status: 502 });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (pathname === RAXON_SERVER_PATHS.placesAutocomplete) {
|
|
51
|
+
return proxyGooglePlaces(request, 'autocomplete', options.googleMapsApiKey);
|
|
52
|
+
}
|
|
53
|
+
if (pathname === RAXON_SERVER_PATHS.placesDetails) {
|
|
54
|
+
return proxyGooglePlaces(request, 'details', options.googleMapsApiKey);
|
|
55
|
+
}
|
|
56
|
+
return NextResponse.next();
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export { DEFAULT_REVALIDATE_SECONDS as BOOTSTRAP_REVALIDATE_SECONDS, bootstrapCacheHeaders };
|
|
@@ -910,7 +910,7 @@ function CheckoutMainView() {
|
|
|
910
910
|
window.addEventListener(LOGIN_SUCCESS_EVENT, handleLoginSuccess);
|
|
911
911
|
return () => window.removeEventListener(LOGIN_SUCCESS_EVENT, handleLoginSuccess);
|
|
912
912
|
}, []);
|
|
913
|
-
return (_jsxs("div", { className: "min-h-screen overflow-x-hidden bg-gray-50", children: [_jsx("header", { className: "border-b border-gray-100 bg-white", children: _jsxs("div", { className: "mx-auto flex max-w-7xl items-center justify-between px-4 py-5 sm:px-6 lg:px-8", children: [_jsx(Link, { href: "/", className: "flex flex-col items-start gap-1", children: _jsx(GeneralImage, { quality: 85, src: branch?.logoMedia?.relativePath ? `${process.env.NEXT_PUBLIC_STORAGE_URL}/${branch.logoMedia.relativePath}` : '', alt: branch?.tradingName ?? 'Logo', width: 120, height: 36, className: "h-7 w-auto object-contain" }) }), _jsx(Link, { href: "/sepet", className: "text-xs font-black uppercase tracking-widest text-gray-900 transition-colors hover:text-[#CF0A2C]", children: "Sepete d\u00F6n" })] }) }), _jsx("div", { className: "mx-auto max-w-7xl px-4 py-10 sm:px-6 sm:py-14 lg:px-8", children: _jsxs("div", { className: "
|
|
913
|
+
return (_jsxs("div", { className: "min-h-screen overflow-x-hidden bg-gray-50", children: [_jsx("header", { className: "border-b border-gray-100 bg-white", children: _jsxs("div", { className: "mx-auto flex max-w-7xl items-center justify-between px-4 py-5 sm:px-6 lg:px-8", children: [_jsx(Link, { href: "/", className: "flex flex-col items-start gap-1", children: _jsx(GeneralImage, { quality: 85, src: branch?.logoMedia?.relativePath ? `${process.env.NEXT_PUBLIC_STORAGE_URL}/${branch.logoMedia.relativePath}` : '', alt: branch?.tradingName ?? 'Logo', width: 120, height: 36, className: "h-7 w-auto object-contain" }) }), _jsx(Link, { href: "/sepet", className: "text-xs font-black uppercase tracking-widest text-gray-900 transition-colors hover:text-[#CF0A2C]", children: "Sepete d\u00F6n" })] }) }), _jsx("div", { className: "mx-auto max-w-7xl px-4 py-10 sm:px-6 sm:py-14 lg:px-8", children: _jsxs("div", { className: "flex flex-col gap-10 md:flex-row md:items-start md:gap-10 lg:gap-14", children: [_jsxs("div", { className: "min-w-0 flex-1 rounded-2xl border border-gray-100 bg-white p-6 shadow-sm sm:p-8", children: [_jsx("nav", { className: "mb-8 flex flex-wrap gap-2", "aria-label": "\u00D6deme ad\u0131mlar\u0131", children: ['contact', 'address', 'checkout'].map((step, index) => {
|
|
914
914
|
const stepOrder = ['contact', 'address', 'checkout'].indexOf(checkoutStep);
|
|
915
915
|
const isActive = checkoutStep === step;
|
|
916
916
|
const isDone = index < stepOrder;
|
|
@@ -922,7 +922,7 @@ function CheckoutMainView() {
|
|
|
922
922
|
}) }), checkoutStep === 'contact' && (_jsx(ViewStep1, { onContinue: email => {
|
|
923
923
|
setConfirmedContactEmail(email);
|
|
924
924
|
setCheckoutStep('address');
|
|
925
|
-
} })), checkoutStep === 'address' && (_jsx(ViewStep2, { onComplete: () => setCheckoutStep('checkout'), onBack: () => setCheckoutStep('contact') })), checkoutStep === 'checkout' && _jsx(ViewStepCheckout, { onBack: () => setCheckoutStep('address') })] }), _jsx("
|
|
925
|
+
} })), checkoutStep === 'address' && (_jsx(ViewStep2, { onComplete: () => setCheckoutStep('checkout'), onBack: () => setCheckoutStep('contact') })), checkoutStep === 'checkout' && _jsx(ViewStepCheckout, { onBack: () => setCheckoutStep('address') })] }), _jsx("aside", { className: "w-full shrink-0 md:w-96 md:sticky md:top-24 md:self-start", children: _jsxs("div", { className: "rounded-2xl border border-gray-100 bg-white p-6 shadow-sm lg:p-8", children: [_jsx("span", { className: "text-sm font-black text-[#CF0A2C] uppercase tracking-widest", children: "\u00D6zet" }), _jsx("h2", { className: "mt-2 text-xl font-black text-gray-900 uppercase tracking-tighter", children: "Sipari\u015F \u00F6zeti" }), _jsx("div", { className: "my-6 space-y-5", children: cart?.items?.map(item => {
|
|
926
926
|
const linePay = item.linePay ?? 0;
|
|
927
927
|
const listGross = (item.lineTotal ?? 0) + (item.lineTax ?? 0);
|
|
928
928
|
const showListStrike = listGross - linePay > 0.01;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../middleware.ts"],"names":[],"mappings":";AAEA,wBAA6B;AAE7B,eAAO,MAAM,MAAM;;CAElB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-bootstrap.d.ts","sourceRoot":"","sources":["../server-bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GET, revalidate } from './core/server/raxon.bootstrap.route';
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { raxonServer } from './core/server/raxon.server';
|