@salla.sa/twilight 2.0.266 → 2.0.267

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.0.266",
3
+ "version": "2.0.267",
4
4
  "description": "Salla Theme Toolkit, Webcomponents, Events, Requests, Utils",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,6 +1,26 @@
1
1
  import {Price} from "../common";
2
2
 
3
3
  export type UrlHelper = (path: string) => string; //add any path to current url, ex: `salla.url('cart?anything=data')` output => `https://store_domain.com/cart?anything=data`
4
+ export type PageName = 'blog.index'
5
+ | 'blog.index.author'
6
+ | 'blog.index.category'
7
+ | 'blog.index.tag'
8
+ | 'brands.index'
9
+ | 'cart'
10
+ | 'customer.orders.index'
11
+ | 'customer.orders.index.pending'
12
+ | 'customer.orders.single'
13
+ | 'customer.profile'
14
+ | 'customer.wishlist'
15
+ | 'index'
16
+ | 'page-single'
17
+ | 'product.index'
18
+ | 'product.index.latest'
19
+ | 'product.index.offers'
20
+ | 'product.index.search'
21
+ | 'product.index.tag'
22
+ | 'product.single'
23
+ | 'thank-you';
4
24
  export default interface SallaHelpers {
5
25
  //Numbers helpers
6
26
  digitsOnly: (num: string | number) => number;
@@ -25,6 +45,7 @@ export default interface SallaHelpers {
25
45
  asset: UrlHelper;
26
46
  get: UrlHelper;
27
47
  cdn: UrlHelper;
48
+ is_page: (pageName: PageName) => boolean;
28
49
  };
29
50
  asset: UrlHelper;
30
51
  cdn: UrlHelper;
package/types/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import SallaActions from "./actions";
4
4
 
5
5
  import SallaConfig from "./lib/salla-config";
6
6
  import {Price} from "./common";
7
- import SallaHelpers, {UrlHelper} from "./helpers/salla-helpers";
7
+ import SallaHelpers, {PageName, UrlHelper} from "./helpers/salla-helpers";
8
8
  import AppHelpers from "./helpers/app-helpers";
9
9
  import SallaNotify, {Logger} from "./lib/salla-notify";
10
10
  import SallaStorage from "./lib/salla-storage";
@@ -34,6 +34,7 @@ export default interface Salla extends SallaActions {
34
34
  asset: UrlHelper;
35
35
  get: UrlHelper;
36
36
  cdn: UrlHelper;
37
+ is_page: (pageName: PageName) => boolean;
37
38
  };
38
39
  isInitiated: boolean; // will be true when firing event `twilight::initiated`
39
40
  onReady: (callback: (event: Event) => unknown) => void; //don't relay on it because Salla may not existed yet