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
@@ -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
  /**
3
3
  * @module eleva/plugins/attr
4
4
  * @fileoverview Attribute plugin providing ARIA, data, boolean, and dynamic attribute handling.
@@ -71,7 +71,7 @@
71
71
  /**
72
72
  * Plugin version
73
73
  * @type {string}
74
- */ version: "1.1.0",
74
+ */ version: "1.1.1",
75
75
  /**
76
76
  * Plugin description
77
77
  * @type {string}
@@ -1071,26 +1071,30 @@
1071
1071
  // Increment navigation ID and capture it for this navigation
1072
1072
  const currentNavId = ++this._navigationId;
1073
1073
  this._isNavigating = true;
1074
- const state = target.state || {};
1075
- const replace = target.replace || false;
1076
- const historyMethod = replace ? "replaceState" : "pushState";
1077
- if (this.options.mode === "hash") {
1078
- if (replace) {
1079
- const newUrl = `${window.location.pathname}${window.location.search}#${path}`;
1080
- window.history.replaceState(state, "", newUrl);
1074
+ try {
1075
+ const state = target.state || {};
1076
+ const replace = target.replace || false;
1077
+ const historyMethod = replace ? "replaceState" : "pushState";
1078
+ if (this.options.mode === "hash") {
1079
+ if (replace) {
1080
+ const newUrl = `${window.location.pathname}${window.location.search}#${path}`;
1081
+ window.history.replaceState(state, "", newUrl);
1082
+ } else {
1083
+ window.location.hash = path;
1084
+ }
1081
1085
  } else {
1082
- window.location.hash = path;
1086
+ const url = this.options.mode === "query" ? this._buildQueryUrl(path) : path;
1087
+ history[historyMethod](state, "", url);
1083
1088
  }
1084
- } else {
1085
- const url = this.options.mode === "query" ? this._buildQueryUrl(path) : path;
1086
- history[historyMethod](state, "", url);
1089
+ } finally{
1090
+ // Always reset the flag via microtask, even if history manipulation throws
1091
+ // Only reset if no newer navigation has started
1092
+ queueMicrotask(()=>{
1093
+ if (this._navigationId === currentNavId) {
1094
+ this._isNavigating = false;
1095
+ }
1096
+ });
1087
1097
  }
1088
- // Only reset the flag if no newer navigation has started
1089
- queueMicrotask(()=>{
1090
- if (this._navigationId === currentNavId) {
1091
- this._isNavigating = false;
1092
- }
1093
- });
1094
1098
  }
1095
1099
  return navigationSuccessful;
1096
1100
  } catch (error) {
@@ -2008,7 +2012,7 @@
2008
2012
  /**
2009
2013
  * Plugin version
2010
2014
  * @type {string}
2011
- */ version: "1.1.0",
2015
+ */ version: "1.1.1",
2012
2016
  /**
2013
2017
  * Plugin description
2014
2018
  * @type {string}
@@ -2389,7 +2393,7 @@
2389
2393
  /**
2390
2394
  * Plugin version
2391
2395
  * @type {string}
2392
- */ version: "1.1.0",
2396
+ */ version: "1.1.1",
2393
2397
  /**
2394
2398
  * Plugin description
2395
2399
  * @type {string}