eleva 1.1.0 → 1.1.1

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.
Files changed (56) hide show
  1. package/README.md +2 -2
  2. package/dist/eleva-plugins.cjs +25 -21
  3. package/dist/eleva-plugins.cjs.map +1 -1
  4. package/dist/eleva-plugins.js +25 -21
  5. package/dist/eleva-plugins.js.map +1 -1
  6. package/dist/eleva-plugins.umd.js +25 -21
  7. package/dist/eleva-plugins.umd.js.map +1 -1
  8. package/dist/eleva-plugins.umd.min.js +1 -1
  9. package/dist/eleva-plugins.umd.min.js.map +1 -1
  10. package/dist/eleva.cjs +9 -13
  11. package/dist/eleva.cjs.map +1 -1
  12. package/dist/eleva.d.cts +4 -15
  13. package/dist/eleva.d.cts.map +1 -1
  14. package/dist/eleva.d.ts +4 -15
  15. package/dist/eleva.d.ts.map +1 -1
  16. package/dist/eleva.js +9 -13
  17. package/dist/eleva.js.map +1 -1
  18. package/dist/eleva.umd.js +9 -13
  19. package/dist/eleva.umd.js.map +1 -1
  20. package/dist/eleva.umd.min.js +1 -1
  21. package/dist/eleva.umd.min.js.map +1 -1
  22. package/dist/plugins/attr.cjs +2 -2
  23. package/dist/plugins/attr.cjs.map +1 -1
  24. package/dist/plugins/attr.js +2 -2
  25. package/dist/plugins/attr.js.map +1 -1
  26. package/dist/plugins/attr.umd.js +2 -2
  27. package/dist/plugins/attr.umd.js.map +1 -1
  28. package/dist/plugins/attr.umd.min.js +1 -1
  29. package/dist/plugins/attr.umd.min.js.map +1 -1
  30. package/dist/plugins/router.cjs +23 -19
  31. package/dist/plugins/router.cjs.map +1 -1
  32. package/dist/plugins/router.js +23 -19
  33. package/dist/plugins/router.js.map +1 -1
  34. package/dist/plugins/router.umd.js +23 -19
  35. package/dist/plugins/router.umd.js.map +1 -1
  36. package/dist/plugins/router.umd.min.js +1 -1
  37. package/dist/plugins/router.umd.min.js.map +1 -1
  38. package/dist/plugins/store.cjs +2 -2
  39. package/dist/plugins/store.cjs.map +1 -1
  40. package/dist/plugins/store.js +2 -2
  41. package/dist/plugins/store.js.map +1 -1
  42. package/dist/plugins/store.umd.js +2 -2
  43. package/dist/plugins/store.umd.js.map +1 -1
  44. package/dist/plugins/store.umd.min.js +1 -1
  45. package/dist/plugins/store.umd.min.js.map +1 -1
  46. package/package.json +5 -5
  47. package/src/core/Eleva.js +4 -11
  48. package/src/modules/TemplateEngine.js +3 -3
  49. package/src/plugins/Attr.js +1 -1
  50. package/src/plugins/Router.js +24 -21
  51. package/src/plugins/Store.js +1 -1
  52. package/types/core/Eleva.d.ts +2 -13
  53. package/types/core/Eleva.d.ts.map +1 -1
  54. package/types/modules/TemplateEngine.d.ts +1 -1
  55. package/types/modules/TemplateEngine.d.ts.map +1 -1
  56. package/types/plugins/Router.d.ts.map +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Eleva.js 🚀
2
2
 
3
- > **Version:** `1.1.0` | **Size:** ~6KB min (~2.5KB gzip) | **Dependencies:** Zero | **TypeScript:** Yes
3
+ > **Version:** `1.1.1` | **Size:** ~6KB min (~2.5KB gzip) | **Dependencies:** Zero | **TypeScript:** Yes
4
4
  >
5
5
  > *Also known as: elevajs, eleva*
6
6
 
@@ -33,7 +33,7 @@
33
33
  **A minimalist, lightweight, pure vanilla JavaScript frontend runtime framework.**
34
34
  _Designed for the best Developer Experience (DX) to help you build exceptional User Experiences (UX). Built with love for native JavaScript and a minimal core that can be extended through a powerful plugin system — because sometimes, less really is more!_ 😊
35
35
 
36
- > **Stable Release**: This is `v1.1.0` - The latest stable release of Eleva.js!
36
+ > **Stable Release**: This is `v1.1.1` - The latest stable release of Eleva.js!
37
37
 
38
38
 
39
39
 
@@ -1,4 +1,4 @@
1
- /*! Eleva Plugins v1.1.0 | MIT License | https://elevajs.com */
1
+ /*! Eleva Plugins v1.1.1 | MIT License | https://elevajs.com */
2
2
  'use strict';
3
3
 
4
4
  /**
@@ -73,7 +73,7 @@
73
73
  /**
74
74
  * Plugin version
75
75
  * @type {string}
76
- */ version: "1.1.0",
76
+ */ version: "1.1.1",
77
77
  /**
78
78
  * Plugin description
79
79
  * @type {string}
@@ -1073,26 +1073,30 @@
1073
1073
  // Increment navigation ID and capture it for this navigation
1074
1074
  const currentNavId = ++this._navigationId;
1075
1075
  this._isNavigating = true;
1076
- const state = target.state || {};
1077
- const replace = target.replace || false;
1078
- const historyMethod = replace ? "replaceState" : "pushState";
1079
- if (this.options.mode === "hash") {
1080
- if (replace) {
1081
- const newUrl = `${window.location.pathname}${window.location.search}#${path}`;
1082
- window.history.replaceState(state, "", newUrl);
1076
+ try {
1077
+ const state = target.state || {};
1078
+ const replace = target.replace || false;
1079
+ const historyMethod = replace ? "replaceState" : "pushState";
1080
+ if (this.options.mode === "hash") {
1081
+ if (replace) {
1082
+ const newUrl = `${window.location.pathname}${window.location.search}#${path}`;
1083
+ window.history.replaceState(state, "", newUrl);
1084
+ } else {
1085
+ window.location.hash = path;
1086
+ }
1083
1087
  } else {
1084
- window.location.hash = path;
1088
+ const url = this.options.mode === "query" ? this._buildQueryUrl(path) : path;
1089
+ history[historyMethod](state, "", url);
1085
1090
  }
1086
- } else {
1087
- const url = this.options.mode === "query" ? this._buildQueryUrl(path) : path;
1088
- history[historyMethod](state, "", url);
1091
+ } finally{
1092
+ // Always reset the flag via microtask, even if history manipulation throws
1093
+ // Only reset if no newer navigation has started
1094
+ queueMicrotask(()=>{
1095
+ if (this._navigationId === currentNavId) {
1096
+ this._isNavigating = false;
1097
+ }
1098
+ });
1089
1099
  }
1090
- // Only reset the flag if no newer navigation has started
1091
- queueMicrotask(()=>{
1092
- if (this._navigationId === currentNavId) {
1093
- this._isNavigating = false;
1094
- }
1095
- });
1096
1100
  }
1097
1101
  return navigationSuccessful;
1098
1102
  } catch (error) {
@@ -2010,7 +2014,7 @@
2010
2014
  /**
2011
2015
  * Plugin version
2012
2016
  * @type {string}
2013
- */ version: "1.1.0",
2017
+ */ version: "1.1.1",
2014
2018
  /**
2015
2019
  * Plugin description
2016
2020
  * @type {string}
@@ -2391,7 +2395,7 @@
2391
2395
  /**
2392
2396
  * Plugin version
2393
2397
  * @type {string}
2394
- */ version: "1.1.0",
2398
+ */ version: "1.1.1",
2395
2399
  /**
2396
2400
  * Plugin description
2397
2401
  * @type {string}