@thepassle/app-tools 0.8.6 → 0.8.8

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.
package/dialog/events.js CHANGED
@@ -1,14 +1,10 @@
1
1
  export class DialogStateEvent extends Event {
2
2
  /**
3
3
  * @param {'opening' | 'opened' | 'closing' | 'closed'} kind
4
- * @param {{
5
- * id: string,
6
- * dialog: import('./index.js').DialogNode,
7
- * }} opts
4
+ * @param {import('./types.js').Context} context
8
5
  */
9
- constructor(kind, {id, dialog}) {
6
+ constructor(kind, context) {
10
7
  super(kind);
11
- this.dialog = dialog;
12
- this.id = id;
8
+ this.context = context;
13
9
  }
14
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thepassle/app-tools",
3
- "version": "0.8.6",
3
+ "version": "0.8.8",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "scripts": {
package/router/index.js CHANGED
@@ -126,6 +126,7 @@ export class Router extends EventTarget {
126
126
  const url = new URL(a.href);
127
127
 
128
128
  if (this.url.href === url.href) return;
129
+ if (url.host !== window.location.host) return;
129
130
  if (a.hasAttribute('download') || a.href.includes('mailto:')) return;
130
131
 
131
132
  const target = a.getAttribute('target');
@@ -141,7 +142,8 @@ export class Router extends EventTarget {
141
142
  async navigate(url) {
142
143
  if (typeof url === 'string') {
143
144
  url = new URL(url, this.baseUrl);
144
- }
145
+ }
146
+
145
147
  this.route = this._matchRoute(url) || this._matchRoute(this.fallback);
146
148
  log(`Navigating to ${url.pathname}${url.search}`, { context: this.context, route: this.route });
147
149
 
@@ -194,4 +196,4 @@ export class Router extends EventTarget {
194
196
  }
195
197
  }
196
198
  }
197
- }
199
+ }