xpine 0.0.37 → 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,7 +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);
178
+ if (window.xpineIgnorePopState) return;
172
179
  await getNewPageContent(window.history.state?.targetHref || window.location.href);
180
+ const updatedEvent = new CustomEvent("spa-popstate-updated", {
181
+ detail: {
182
+ href: window.history.state?.targetHref || window.location.href
183
+ }
184
+ });
185
+ window.dispatchEvent(updatedEvent);
173
186
  }
174
187
  function isRelativeURL(url) {
175
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.37",
3
+ "version": "0.0.39",
4
4
  "main": "dist/index.js",
5
5
  "dependencies": {
6
6
  "@aws-sdk/client-secrets-manager": "^3.758.0",