@salla.sa/twilight 2.13.44 → 2.13.46

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight",
3
- "version": "2.13.44",
3
+ "version": "2.13.46",
4
4
  "description": "Salla Theme Toolkit, Webcomponents, Events, Requests, Utils",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -8,7 +8,7 @@
8
8
  "scripts": {
9
9
  "build": "npx rollup --config --preserveSymlinks=true",
10
10
  "watch": "npx rollup --watch --config --preserveSymlinks=true",
11
- "test": "jest --detectOpenHandles -- order.test",
11
+ "test": "jest --detectOpenHandles",
12
12
  "express": "node tests/server/index.js"
13
13
  },
14
14
  "keywords": [
@@ -33,7 +33,7 @@
33
33
  ],
34
34
  "homepage": "https://salla.dev",
35
35
  "dependencies": {
36
- "@salla.sa/base": "^2.13.44",
36
+ "@salla.sa/base": "^2.13.46",
37
37
  "axios": "^0.27.2",
38
38
  "infinite-scroll": "^4.0.1",
39
39
  "jwt-decode": "^3.1.2",
@@ -67,5 +67,5 @@
67
67
  "peerDependencies": {
68
68
  "webpack": "^4 || ^5"
69
69
  },
70
- "gitHead": "7179c5214c9f56f1702a0959bdb55451772ddb24"
70
+ "gitHead": "e239f030e5681836769e57cdd75d48a4e3819bf2"
71
71
  }
@@ -12,6 +12,7 @@ import WishlistApi from "./wishlist";
12
12
  import ScopeApi from "./scope";
13
13
  import LandingApi from "./landing";
14
14
  import BookingApi from "./booking";
15
+ import NavigationApi from "./navigation"
15
16
  import {AxiosInstance} from "axios";
16
17
  import {ErrorResponse, SuccessResponse} from "@salla.sa/base/types/common";
17
18
 
@@ -30,6 +31,7 @@ export {
30
31
  ScopeApi,
31
32
  BookingApi,
32
33
  LandingApi,
34
+ NavigationApi,
33
35
  };
34
36
  export type ApiActionName =
35
37
  'auth.login'
@@ -88,7 +90,8 @@ export type ApiActionName =
88
90
  | 'scope.change'
89
91
  | 'scope.getProductAvailability'
90
92
  | 'withoutNotifier'
91
- | 'booking.add';
93
+ | 'booking.add'
94
+ | 'navigation.fetchBreadcrumbs';
92
95
 
93
96
  export default interface Api {
94
97
  cart: CartApi;
@@ -105,6 +108,8 @@ export default interface Api {
105
108
  scope: ScopeApi;
106
109
  booking: BookingApi;
107
110
  landing: LandingApi;
111
+ navigation: NavigationApi;
112
+
108
113
  axios: AxiosInstance;
109
114
  withoutNotifier: (callback: Function) => Promise<void>;
110
115
  getHeaders: () => {
@@ -1,22 +1,6 @@
1
1
  import {SuccessResponse} from "../common";
2
2
 
3
- export interface BreadcrumbItem {
4
- title: string;
5
- url?: string;
6
- }
7
-
8
- export interface BreadCrumbApiQueryParameters {
9
- id?: number;
10
- parent_id?: number;
11
- page: string;
12
- }
13
-
14
- export interface FetchBreadcrumbResponse extends SuccessResponse {
15
- data: Array<BreadcrumbItem>
16
- }
17
-
18
3
  export default interface LandingApi {
19
4
  getDetails: (page_id?: number) => Promise<SuccessResponse>;
20
5
  createCartFromPage: (page_id?: number) => Promise<SuccessResponse>;
21
- fetchBreadcrumbs: (queryParams: BreadCrumbApiQueryParameters) => Promise<FetchBreadcrumbResponse>;
22
6
  }
@@ -0,0 +1,20 @@
1
+ import {SuccessResponse} from "../common";
2
+
3
+ export interface BreadcrumbItem {
4
+ title: string;
5
+ url?: string;
6
+ }
7
+
8
+ export interface BreadCrumbApiQueryParameters {
9
+ id?: number;
10
+ parent_id?: number;
11
+ page: string;
12
+ }
13
+
14
+ export interface FetchBreadcrumbResponse extends SuccessResponse {
15
+ data: Array<BreadcrumbItem>
16
+ }
17
+
18
+ export default interface NavigationApi {
19
+ fetchBreadcrumbs: (queryParams: BreadCrumbApiQueryParameters) => Promise<FetchBreadcrumbResponse>;
20
+ }
@@ -13,6 +13,8 @@ import InfiniteScrollEvent from "./infiniteScroll";
13
13
  import ScopeEvents from "./scope";
14
14
  import BookingEvent from "./booking";
15
15
  import LandingEvent from "./landing";
16
+ import NavigationEvent from "./navigation";
17
+
16
18
  import Emitter from "@salla.sa/base/types/event";
17
19
 
18
20
  export type event = (symbol | string);
@@ -33,6 +35,7 @@ export {
33
35
  ScopeEvents,
34
36
  BookingEvent,
35
37
  LandingEvent,
38
+ NavigationEvent,
36
39
  }
37
40
 
38
41
  export default interface TwilightEmitter extends Emitter {
@@ -51,4 +54,5 @@ export default interface TwilightEmitter extends Emitter {
51
54
  landing: LandingEvent;
52
55
  booking: BookingEvent;
53
56
  infiniteScroll: InfiniteScrollEvent;
57
+ navigation: NavigationEvent;
54
58
  }
@@ -1,11 +1,8 @@
1
- import {RequestError, RequestErrorEvent, SuccessResponse} from "../common";
2
- import { FetchBreadcrumbResponse } from '../api/landing';
1
+ import {RequestError, SuccessResponse} from "../common";
3
2
 
4
3
  export default interface LandingEvent {
5
4
  orderCreationFailed: (error: RequestError, page_id?: number) => void;
6
5
  orderCreated: (response: SuccessResponse, page_id?: number) => Promise<void>;
7
6
  onOrderCreated: (callback: (response: SuccessResponse, page_id?: number) => void) => void;
8
7
  onOrderCreationFailed: (callback: (error: RequestError, page_id?: number) => void) => void;
9
- onBreadcrumbFetched: (callback: (response: FetchBreadcrumbResponse) => void) => void;
10
- onBreadcrumbFetchFailed: RequestErrorEvent
11
8
  }
@@ -0,0 +1,7 @@
1
+ import {RequestErrorEvent} from "../common";
2
+ import { FetchBreadcrumbResponse } from '../api/navigation';
3
+
4
+ export default interface NavigationEvent {
5
+ onBreadcrumbFetched: (callback: (response: FetchBreadcrumbResponse) => void) => void;
6
+ onBreadcrumbFetchFailed: RequestErrorEvent
7
+ }