xpine 0.0.39 → 0.0.41

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.
@@ -27,7 +27,8 @@ async function updatePageOnLinkClick(e) {
27
27
  window.history.pushState(
28
28
  {
29
29
  type: "link-click",
30
- targetHref
30
+ href: targetHref,
31
+ url: newURL
31
32
  },
32
33
  "",
33
34
  targetHref
@@ -169,17 +170,20 @@ function replaceAttributesOnDocumentBody(dom) {
169
170
  }
170
171
  }
171
172
  async function handleBackButton() {
173
+ const url = window.history.state?.url?.href || window.location.href;
172
174
  const initEvent = new CustomEvent("spa-popstate-initiated", {
173
175
  detail: {
174
- href: window.history.state?.targetHref || window.location.href
176
+ href: url,
177
+ url: safeParseURL(url)
175
178
  }
176
179
  });
177
180
  window.dispatchEvent(initEvent);
178
181
  if (window.xpineIgnorePopState) return;
179
- await getNewPageContent(window.history.state?.targetHref || window.location.href);
182
+ await getNewPageContent(url);
180
183
  const updatedEvent = new CustomEvent("spa-popstate-updated", {
181
184
  detail: {
182
- href: window.history.state?.targetHref || window.location.href
185
+ href: url,
186
+ url: safeParseURL(url)
183
187
  }
184
188
  });
185
189
  window.dispatchEvent(updatedEvent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xpine",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
4
4
  "main": "dist/index.js",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-secrets-manager": "^3.758.0",