@salla.sa/twilight 2.9.36 → 2.9.37

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.9.36",
3
+ "version": "2.9.37",
4
4
  "description": "Salla Theme Toolkit, Webcomponents, Events, Requests, Utils",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -31,7 +31,7 @@
31
31
  ],
32
32
  "homepage": "https://salla.dev",
33
33
  "dependencies": {
34
- "@salla.sa/base": "^2.9.36",
34
+ "@salla.sa/base": "^2.9.37",
35
35
  "@salla.sa/twilight-tailwind-theme": "^2.9.33",
36
36
  "axios": "^0.27.2",
37
37
  "infinite-scroll": "^4.0.1",
@@ -61,5 +61,5 @@
61
61
  "peerDependencies": {
62
62
  "webpack": "^4 || ^5"
63
63
  },
64
- "gitHead": "2b69383ab34339f625576929e5de94a083b0b61e"
64
+ "gitHead": "d403b0292d708f720ec585112a0dae908bf4877f"
65
65
  }
package/types/index.d.ts CHANGED
@@ -2,12 +2,12 @@ import TwilightEmitter from './event';
2
2
  import Api, {ApiActionName} from "./api";
3
3
  import SallaActions from "./actions";
4
4
 
5
- import Config from "./lib/config";
6
5
  import AppHelpers from "./helpers/app-helpers";
7
6
  import SallaNotify from "./lib/notify";
8
7
  import SallaLang from "./lib/lang";
9
8
  import SallaForm from "./lib/form";
10
9
  import {TwilightConfig} from "./tiwlight-config";
10
+ import Config from "../../base/types/config";
11
11
 
12
12
  export default interface Salla extends SallaActions {
13
13
  onReady: (callback: (event: Event) => unknown) => void; //relay on it, it will be available even salla object is not loaded yet
@@ -15,7 +15,7 @@ export default interface Salla extends SallaActions {
15
15
  api: Api;
16
16
  event: TwilightEmitter;
17
17
 
18
- config: TwilightConfig;
18
+ config: Config;
19
19
  lang: SallaLang;
20
20
 
21
21
  notify: SallaNotify;
@@ -1,6 +1,6 @@
1
- import { Language, TwilightConfig } from "../tiwlight-config";
2
- import { Currency, Price } from "../common";
3
- import { default as SallaConfig } from "@salla.sa/base/types/config";
1
+ import {Language, TwilightConfig} from "../tiwlight-config";
2
+ import {Currency, Price} from "../common";
3
+ import {default as SallaConfig} from "@salla.sa/base/types/config";
4
4
 
5
5
  export default interface Config extends SallaConfig {
6
6
  merge: (config: TwilightConfig) => Config;
@@ -10,6 +10,57 @@ export interface Language {
10
10
 
11
11
  type Installment = 'tabby_installment' | 'tamara_installment' | 'spotii_pay';
12
12
  type PaymentName = Installment | 'mada' | 'credit_card' | 'paypal' | 'bank' | 'stc_pay' | 'apple_pay' | 'knet';
13
+ export type TwilightConfigName = 'maintenance'
14
+ | 'debug'
15
+ | 'events'
16
+ | 'sdk'
17
+ | 'sdk.notifier_handler_disabled'
18
+ | 'store'
19
+ | 'store.url'
20
+ | 'store.id'
21
+ | 'store.logo'
22
+ | 'store.name'
23
+ | 'store.api'
24
+ | 'store.settings'
25
+ | 'store.settings.auth'
26
+ | 'store.settings.auth.email_allowed'
27
+ | 'store.settings.auth.mobile_allowed'
28
+ | 'store.settings.auth.is_email_required'
29
+ | 'store.arabic_numbers_enabled'
30
+ | 'store.payments'
31
+ | 'store.installments'
32
+ | 'user.type'
33
+ | 'user.id'
34
+ | 'user.email'
35
+ | 'user.mobile'
36
+ | 'user.language_code'
37
+ | 'user.currency_code'
38
+ | 'user.country_code'
39
+ | 'theme.name'
40
+ | 'theme.mode'
41
+ | 'theme.translations_hash'
42
+ | 'theme.color'
43
+ | 'theme.color.primary'
44
+ | 'theme.color.text'
45
+ | 'theme.color.is_dark'
46
+ | 'theme.color.reverse_primary'
47
+ | 'theme.color.reverse_text'
48
+ | 'languages'
49
+ | 'currencies'
50
+ | '`currencies.${string}`'
51
+ | 'page.title'
52
+ | 'page.slug'
53
+ | 'page.id';
54
+
55
+ export interface TwilightConfigClass {
56
+ merge(config: TwilightConfig): TwilightConfigClass;
57
+
58
+ set(key: TwilightConfigName, value: any): TwilightConfigClass;
59
+
60
+ get(key: TwilightConfigName, default_?: any): any;
61
+
62
+ all(): TwilightConfig;
63
+ }
13
64
 
14
65
  export interface TwilightConfig {
15
66
  /**