xpine 0.0.38 → 0.0.39

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.
@@ -169,14 +169,20 @@ function replaceAttributesOnDocumentBody(dom) {
169
169
  }
170
170
  }
171
171
  async function handleBackButton() {
172
+ const initEvent = new CustomEvent("spa-popstate-initiated", {
173
+ detail: {
174
+ href: window.history.state?.targetHref || window.location.href
175
+ }
176
+ });
177
+ window.dispatchEvent(initEvent);
172
178
  if (window.xpineIgnorePopState) return;
173
179
  await getNewPageContent(window.history.state?.targetHref || window.location.href);
174
- const event = new CustomEvent("spa-popstate", {
180
+ const updatedEvent = new CustomEvent("spa-popstate-updated", {
175
181
  detail: {
176
182
  href: window.history.state?.targetHref || window.location.href
177
183
  }
178
184
  });
179
- window.dispatchEvent(event);
185
+ window.dispatchEvent(updatedEvent);
180
186
  }
181
187
  function isRelativeURL(url) {
182
188
  if (typeof url !== "string") return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xpine",
3
- "version": "0.0.38",
3
+ "version": "0.0.39",
4
4
  "main": "dist/index.js",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-secrets-manager": "^3.758.0",