@salla.sa/twilight 2.14.144 → 2.14.146

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/README.md CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  <div id="top"></div>
3
2
 
4
3
  <br />
@@ -49,7 +48,29 @@
49
48
 
50
49
  ## Overview
51
50
 
52
- **Twilight** comes with a **JavaScript SDK** for the Salla storefront APIs. This is to provide the developers with helper methods, or REST API endpoints, that allow communication between the frontend and backend. As a result, developers may use these methods to make merchants' stores dynamic after using the API features and data. In this documentation, we will be referring to it as **Twilight JS SDK** for short.
51
+ The Twilight JS SDK (`@salla.sa/twilight`) is the core package of the Twilight Framework, providing a comprehensive JavaScript interface for Salla's storefront APIs. It enables theme developers to easily communicate with Salla's backend services, handle events, manage state, and build interactive e-commerce experiences.
52
+
53
+ ### Architecture
54
+
55
+ The Twilight Framework consists of several packages working together:
56
+
57
+ 1. **@salla.sa/base**: Foundation layer with core utilities and services
58
+ 2. **@salla.sa/twilight** (this package): Main SDK for Salla themes
59
+ 3. **@salla.sa/twilight-components**: Web components for Salla themes
60
+ 4. **@salla.sa/twilight-tailwind-theme**: Tailwind CSS theme for Salla themes
61
+ 5. **@salla.sa/applepay**: Apple Pay integration for Salla
62
+
63
+ This modular architecture allows for better separation of concerns, more maintainable code, and the ability to use only the parts of the framework that are needed for a specific application.
64
+
65
+ ### Key Features
66
+
67
+ - **API Integration**: Pre-built methods for all Salla API endpoints
68
+ - **Event System**: Powerful event handling for real-time updates
69
+ - **Authentication**: Seamless user authentication and session management
70
+ - **Cart Management**: Complete shopping cart functionality
71
+ - **Multilingual Support**: Built-in localization capabilities
72
+ - **Version Management**: Easy access to package versions via `Salla.versions`
73
+ - **Optimized Bundle**: Tree-shakable modules for minimal production builds
53
74
 
54
75
  ## Getting Started
55
76
  **SDK** stands for "software development kit," and it refers to a library for interacting with a specific REST API using JavaScript.
@@ -215,6 +236,20 @@ Furthermore, if the required value is nested inside an inner value, such as a cu
215
236
  salla.config.get('currencies.SAR.code’)
216
237
  ```
217
238
 
239
+ #### Accessing Version Information
240
+
241
+ The Twilight Framework provides easy access to version information for all packages through the `Salla.versions` object:
242
+
243
+ ```js
244
+ // Get the version of the core package
245
+ console.log(Salla.versions.twilight); // e.g., "v2.14.145"
246
+
247
+ // Get the version of the base package
248
+ console.log(Salla.versions.base); // e.g., "v2.14.143"
249
+ ```
250
+
251
+ This is particularly useful for debugging, support, and ensuring compatibility between different parts of the framework.
252
+
218
253
  <p align="right">(<a href="#top">back to top</a>)</p>
219
254
 
220
255
  ## Support
@@ -251,4 +286,3 @@ You can also simply open an issue with the tag "enhancement". Don't forget to gi
251
286
  The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
252
287
 
253
288
  <p align="right">(<a href="#top">back to top</a>)</p>
254
-