ziex 0.1.0-dev.805 → 0.1.0-dev.864

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/README.md CHANGED
@@ -184,7 +184,7 @@ You can view our current progress and planned features here:
184
184
 
185
185
  ## Links
186
186
 
187
- * [Codeberg Mirror](https://codeberg.org/ziex-dev/ziex) - ZX repository mirror on Codeberg
187
+ * [Codeberg Mirror](https://codeberg.org/ziex/ziex) - ZX repository mirror on Codeberg
188
188
  * [ziex.dev](https://github.com/ziex-dev/ziex/tree/main/site) - Official documentation site of ZX made using ZX.
189
189
  * [example-blog](https://github.com/ziex-dev/example-blog) - Demo blog web application built with ZX
190
190
  * [zx-numbers-game](https://github.com/Andrew-Velox/zx-numbers-game) - ZX numbers game
@@ -377,7 +377,7 @@ class ZxBridge extends ZxBridgeCore {
377
377
  }
378
378
  submitFormActionAsync(form, statesJson, fetchId) {
379
379
  const formData = new FormData(form);
380
- formData.append("__zx_states", statesJson);
380
+ formData.append("__$states", statesJson);
381
381
  fetch(window.location.href, {
382
382
  method: "POST",
383
383
  headers: { "X-ZX-Action": "1" },
@@ -863,9 +863,9 @@ function initEventDelegation(bridge, rootSelector = "body") {
863
863
  }, { passive: eventType.startsWith("touch") || eventType === "scroll" });
864
864
  }
865
865
  }
866
- var DEFAULT_URL = "/assets/main.wasm";
866
+ var DEFAULT_URL = "/assets/_/main.wasm";
867
867
  async function init(options = {}) {
868
- const url = options.url ?? DEFAULT_URL;
868
+ const url = options.url ?? document.getElementById("__$wasmlink")?.href ?? DEFAULT_URL;
869
869
  const bridgeRef = { current: null };
870
870
  const importObject = Object.assign({}, ZxBridge.createImportObject(bridgeRef), options.importObject);
871
871
  const source = await WebAssembly.instantiateStreaming(fetch(url), importObject);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziex",
3
- "version": "0.1.0-dev.805",
3
+ "version": "0.1.0-dev.864",
4
4
  "description": "ZX is a framework for building web applications with Zig.",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/wasm/index.js CHANGED
@@ -377,7 +377,7 @@ class ZxBridge extends ZxBridgeCore {
377
377
  }
378
378
  submitFormActionAsync(form, statesJson, fetchId) {
379
379
  const formData = new FormData(form);
380
- formData.append("__zx_states", statesJson);
380
+ formData.append("__$states", statesJson);
381
381
  fetch(window.location.href, {
382
382
  method: "POST",
383
383
  headers: { "X-ZX-Action": "1" },
@@ -863,9 +863,9 @@ function initEventDelegation(bridge, rootSelector = "body") {
863
863
  }, { passive: eventType.startsWith("touch") || eventType === "scroll" });
864
864
  }
865
865
  }
866
- var DEFAULT_URL = "/assets/main.wasm";
866
+ var DEFAULT_URL = "/assets/_/main.wasm";
867
867
  async function init(options = {}) {
868
- const url = options.url ?? DEFAULT_URL;
868
+ const url = options.url ?? document.getElementById("__$wasmlink")?.href ?? DEFAULT_URL;
869
869
  const bridgeRef = { current: null };
870
870
  const importObject = Object.assign({}, ZxBridge.createImportObject(bridgeRef), options.importObject);
871
871
  const source = await WebAssembly.instantiateStreaming(fetch(url), importObject);
package/wasm/init.js CHANGED
@@ -366,7 +366,7 @@ class ZxBridge extends ZxBridgeCore {
366
366
  }
367
367
  submitFormActionAsync(form, statesJson, fetchId) {
368
368
  const formData = new FormData(form);
369
- formData.append("__zx_states", statesJson);
369
+ formData.append("__$states", statesJson);
370
370
  fetch(window.location.href, {
371
371
  method: "POST",
372
372
  headers: { "X-ZX-Action": "1" },
@@ -852,9 +852,9 @@ function initEventDelegation(bridge, rootSelector = "body") {
852
852
  }, { passive: eventType.startsWith("touch") || eventType === "scroll" });
853
853
  }
854
854
  }
855
- var DEFAULT_URL = "/assets/main.wasm";
855
+ var DEFAULT_URL = "/assets/_/main.wasm";
856
856
  async function init(options = {}) {
857
- const url = options.url ?? DEFAULT_URL;
857
+ const url = options.url ?? document.getElementById("__$wasmlink")?.href ?? DEFAULT_URL;
858
858
  const bridgeRef = { current: null };
859
859
  const importObject = Object.assign({}, ZxBridge.createImportObject(bridgeRef), options.importObject);
860
860
  const source = await WebAssembly.instantiateStreaming(fetch(url), importObject);