chemicaljs 3.0.0 → 3.0.1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chemicaljs",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Easily create your own web proxy with no experience required.",
5
5
  "author": "Nebelung",
6
6
  "license": "AGPL-3.0-only",
@@ -1,16 +0,0 @@
1
- <script>
2
- import Chemical from "../../../chemical/Chemical.svelte";
3
- import { setContext } from "svelte";
4
-
5
- let { children } = $props();
6
-
7
- let chemState = $state({
8
- ready: false,
9
- instance: null,
10
- });
11
-
12
- setContext("chemState", chemState);
13
- </script>
14
-
15
- <Chemical bind:this={chemState.instance} bind:ready={chemState.ready} />
16
- {@render children()}
@@ -1,12 +0,0 @@
1
- <script>
2
- import Frame from "../../../chemical/Frame.svelte";
3
- import { getContext } from "svelte";
4
-
5
- let chemState = getContext("chemState");
6
- </script>
7
-
8
- <Frame
9
- src="https://www.example.com"
10
- bind:ready={chemState.ready}
11
- bind:chemical={chemState.instance}
12
- ></Frame>
@@ -1,68 +0,0 @@
1
- <script>
2
- import Chemical from "$lib/chemicaljs/Chemical.svelte";
3
- import Frame from "$lib/chemicaljs/Frame.svelte";
4
-
5
- let ready = $state(false);
6
- let chemical = $state();
7
- let transport = $state("epoxy");
8
- let wisp = $state("wss://wisp.freewisp.org/");
9
-
10
- let frame1 = $state();
11
- </script>
12
-
13
- <button onclick={() => console.log(chemical.fetch("https://example.com"))}
14
- >fetch test</button
15
- >
16
- <button
17
- onclick={async () =>
18
- console.log(await chemical.autocomplete("math", "brave"))}
19
- >autocomplete test</button
20
- >
21
- <button
22
- onclick={async () =>
23
- console.log(
24
- await chemical.createDataURL("https://www.google.com/favicon.ico"),
25
- )}>createDataURL test</button
26
- >
27
-
28
- <button onclick={() => (transport = "epoxy")}>epoxy</button>
29
- <button onclick={() => (transport = "libcurl")}>libcurl</button>
30
- <button onclick={() => (wisp = "wss://fake.freewisp.org/")}>change wisp</button>
31
- <Chemical
32
- bind:this={chemical}
33
- bind:ready
34
- bind:transport
35
- bind:wisp
36
- onready={() => console.log(chemical.url("https://playobsidian.com"))}
37
- />
38
-
39
- <input
40
- onkeydown={(e) => e.key === "Enter" && frame1.go(e.target.value)}
41
- placeholder="Enter URL"
42
- />
43
- <button onclick={() => frame1.go("example.com", { autoHttps: true })}
44
- >autohttps</button
45
- >
46
- <button
47
- onclick={() =>
48
- frame1.go("kittens", {
49
- searchEngine: chemical.searchEngines.google,
50
- })}>search engine test</button
51
- >
52
- <button onclick={() => frame1.reload()}>reload</button>
53
- <button onclick={() => frame1.forward()}>forward</button>
54
- <button onclick={() => frame1.back()}>back</button>
55
-
56
- <Frame
57
- bind:this={frame1}
58
- class="w-full h-screen"
59
- adblock={true}
60
- catchlinks={(url) =>
61
- new URL(`/?goto=${encodeURIComponent(url.href)}`, location.origin)}
62
- linkhandler={(url) => window.open("?url=" + encodeURIComponent(url))}
63
- cache={false}
64
- onchange={(url) => console.log("Frame URL changed to: " + url)}
65
- src="https://www.example.com"
66
- bind:ready
67
- bind:chemical
68
- ></Frame>