@webqit/webflo 1.0.5 → 1.0.7

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/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "vanila-javascript"
13
13
  ],
14
14
  "homepage": "https://webqit.io/tooling/webflo",
15
- "version": "1.0.5",
15
+ "version": "1.0.7",
16
16
  "license": "MIT",
17
17
  "repository": {
18
18
  "type": "git",
@@ -47,6 +47,10 @@ export class WebfloClient extends WebfloRuntime {
47
47
  #backgroundMessaging;
48
48
  get backgroundMessaging() { return this.#backgroundMessaging; }
49
49
 
50
+ get withViewTransitions() {
51
+ return document.querySelector('meta[name="webflo-viewtransitions"]')?.value;
52
+ }
53
+
50
54
  constructor(host) {
51
55
  super();
52
56
  this.#host = host;
@@ -486,7 +490,7 @@ export class WebfloClient extends WebfloRuntime {
486
490
  }
487
491
 
488
492
  async transitionUI(updateCallback) {
489
- if (document.startViewTransition) {
493
+ if (document.startViewTransition && this.withViewTransitions) {
490
494
  const synthesizeWhile = window.webqit?.realdom?.synthesizeWhile || ((callback) => callback());
491
495
  await synthesizeWhile(async () => {
492
496
  Observer.set(this.transition, 'phase', 1);
@@ -72,6 +72,8 @@ export class WebfloSubClient extends WebfloClient {
72
72
 
73
73
  get workport() { return this.#superRuntime.workport; }
74
74
 
75
+ get withViewTransitions() { return this.host.has('viewtransitions'); }
76
+
75
77
  constructor(host, superRuntime) {
76
78
  if (!(host instanceof HTMLElement)) {
77
79
  throw new Error('Argument #1 must be a HTMLElement instance');
@@ -119,6 +119,9 @@ export class WebfloWorker extends WebfloRuntime {
119
119
  }
120
120
 
121
121
  createRequest(href, init = {}) {
122
+ if (init instanceof Request && init.url === (href.href || href)) {
123
+ return init;
124
+ }
122
125
  return new Request(href, init);
123
126
  }
124
127
 
@@ -8,6 +8,7 @@ import { renderHttpMessageInit } from './util-http.js';
8
8
  * The xfetch Mixin
9
9
  */
10
10
  const xfetch = async (url, init = {}) => {
11
+ return await fetch(url);
11
12
  if (init.body) {
12
13
  const { body, headers } = renderHttpMessageInit(init);
13
14
  init = { ...init, body, headers, };