Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ab2ac4813a | |||
|
0c0a341f1e |
|||
|
f74ca52f4f |
|||
|
|
94f11f60f6 |
||
|
|
f5461bbd42 |
||
|
7c9d9529b4 |
|||
|
8a04b327fc |
|||
|
0a304e44f2 |
|||
|
094cb910aa |
|||
|
cf17365c8f |
|||
|
aa34bd962b |
|||
|
1d1b304bcf |
|||
|
|
0fbedf6733 | ||
|
96b81d30b1 |
|||
|
edcf0e15dd |
|||
|
5056f084b4 |
|||
|
ede0199858 |
|||
|
88a094c8bf |
|||
|
e43e03ff12 |
|||
|
97270abed8 |
|||
|
2a55c87df1 |
|||
|
|
57c7ceb27a | ||
|
|
d0918ff384 | ||
|
caa7d65b84 |
|||
| 0ac20f09e4 | |||
|
7b36218ffa |
|||
| 73db7e6b2b | |||
|
6e977bca7e |
|||
|
eaf3f61ebd |
|||
|
6f4cc62530 |
|||
|
eaeff1b8d5 |
|||
|
4016181db9 |
|||
| 2299555fe6 | |||
| f50b4eaebe | |||
|
825be4eb33 |
|||
|
1c90a0c859 |
|||
| 6dee7e8dcc | |||
| 41258a8483 | |||
| 746f0cc9a4 | |||
| c1baf3576d | |||
| 7ffbab6b08 | |||
| f1af0f210d | |||
| a40bf3a2c2 | |||
|
dbb407606b |
|||
| f763af13be | |||
|
f83e71be6b |
|||
|
b7c94123fa |
|||
|
32671f32fd |
|||
|
2b4207f8fa |
|||
|
5f44b89043 |
|||
|
31ff5a542f |
|||
|
99c38162a6 |
|||
|
ef24ea4ca0 |
|||
|
45d39cb47c |
|||
|
c182f2e9ac |
|||
|
ec019a4dff |
|||
|
b76143e2e2 |
|||
| 01b68300ab | |||
| 3954d776ce | |||
| 860fd2ec08 | |||
| dfb82373c6 | |||
| 927a719281 | |||
| 7f64659e23 | |||
| 35769b1aae | |||
| a731f8ee42 | |||
|
|
beafb623ba | ||
|
|
ac1bdf5ac2 | ||
|
22a4cd2f0e |
|||
|
3725587232 |
|||
| f0dcfbc63e | |||
| 00ff0b00d4 | |||
| 4d72469806 | |||
|
|
9ae7dbe35e | ||
|
|
2c405af72d | ||
|
652dab0351 |
|||
|
1ea13acc3b |
|||
| 29e80d6d02 | |||
| f3ca5d637c | |||
| 565f39c255 | |||
| 5090b67deb | |||
|
2061c3c393 |
|||
|
83427a344e |
|||
|
6f9ae31f7d |
|||
|
c442803412 |
|||
|
d59f9455bf |
|||
|
6dcec11426 |
|||
|
bda3bdcd0a |
|||
|
8946da05cc |
|||
| 60fbe3c9ec | |||
| 03735f9230 | |||
| 27b60005cc | |||
| 80d74b3ac7 | |||
| 3e80a37566 | |||
| 2f8bf376b7 | |||
| cc8cd9c017 | |||
|
1b17158ad5 |
|||
| bb25ed83ef | |||
| 959f6638ad | |||
| 48f04adfd9 | |||
| 0e2995454e | |||
| acc48c1207 | |||
| d66b404368 | |||
| 5914419aee | |||
| 625314cb5a | |||
| 6c145d293d | |||
| 4e97368f2f | |||
| d07202386f | |||
| a71a9effae | |||
| 7b3367cff0 | |||
| f14bfe6233 | |||
| 2faf100fa2 | |||
| faebd27286 | |||
| 5b2ac5315f | |||
| e61be9e5e0 | |||
| d30f7100b1 | |||
| e35fd3d96d | |||
|
f2343297e0 |
|||
|
5a7d5008a3 |
|||
| 51e83b8d9e | |||
| 9d5517fe30 | |||
| a88bda43eb | |||
| 16a288725d | |||
|
d30de8b404 |
|||
|
be8ea09cd6 |
|||
| 8da83a4900 | |||
|
2dc5be85e3 |
|||
| e11f46bd7c | |||
| 2ead5e17be | |||
|
611a4944b6 |
|||
| cf38260a87 | |||
| a6775b1d14 | |||
|
b5c5dd722b |
|||
| 5fb884edb0 | |||
| 52fcf7ca02 | |||
| 014bb0480a | |||
| 3bc4f49678 | |||
|
089fd152de |
|||
|
5044947525 |
|||
|
4a841de073 |
|||
| 43fd0beb8e | |||
| 07e31d1ad6 | |||
|
|
4c2b0e4c99 | ||
|
|
329a35bcfb | ||
| 70932ca135 | |||
| c1b10ef737 | |||
|
|
cdc8d31505 | ||
| aee2a0963d | |||
|
|
bf17f59a95 | ||
|
f41cf7cfa4 |
|||
|
|
41bea6b107 | ||
| e44863e9cb | |||
|
|
4a23f8455f | ||
| 37a9f97361 | |||
|
|
d545b91844 | ||
| b57bc0683c | |||
| 73ff854f0f | |||
|
|
abc0cceb56 | ||
| 67756255db | |||
| 257ef320d8 | |||
| 4a53d5c6dc | |||
|
|
089e6c5b28 | ||
| 00598348ab | |||
|
|
0c06516984 | ||
| 8f4f356746 |
2
.cargo/config.toml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
[env]
|
||||||
|
MTP_TYPE_MAPS = { value = "mtp-type-maps/type-maps.yaml", relative = true }
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
"entry": [
|
"entry": [
|
||||||
"src/index.{ts,tsx,js,jsx}",
|
"src/index.{ts,tsx,js,jsx}",
|
||||||
"src/main.{ts,tsx,js,jsx}",
|
"src/main.{ts,tsx,js,jsx}",
|
||||||
|
"apps/pwa/src/serviceWorker.ts",
|
||||||
"apps/tauri/render-version.ts",
|
"apps/tauri/render-version.ts",
|
||||||
"packages/**/*.test.ts"
|
"packages/**/*.test.ts"
|
||||||
],
|
],
|
||||||
|
|
|
||||||
60
.forgejo/workflows/dependency-builds.yml
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
name: Dependency builds
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
env:
|
||||||
|
FORGEJO_TOKEN: ""
|
||||||
|
GITHUB_TOKEN: ""
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
web:
|
||||||
|
if: ${{ github.actor == 'rasensprenger' }}
|
||||||
|
name: Build web
|
||||||
|
runs-on: nixos
|
||||||
|
steps:
|
||||||
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- run: git submodule update --init --recursive
|
||||||
|
- run: nix develop .#electron --command pnpm install --frozen-lockfile
|
||||||
|
- run: nix develop .#electron --command pnpm run build:packages
|
||||||
|
- run: nix develop .#electron --command pnpm run build:web
|
||||||
|
|
||||||
|
desktop:
|
||||||
|
if: ${{ github.actor == 'rasensprenger' }}
|
||||||
|
name: Build desktop
|
||||||
|
runs-on: nixos
|
||||||
|
steps:
|
||||||
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- run: git submodule update --init --recursive
|
||||||
|
- run: nix develop .#electron --command pnpm install --frozen-lockfile
|
||||||
|
- run: nix develop .#electron --command pnpm run build:packages
|
||||||
|
- run: nix develop .#electron --command pnpm run build:desktop
|
||||||
|
|
||||||
|
native-mtp:
|
||||||
|
if: ${{ github.actor == 'rasensprenger' }}
|
||||||
|
name: Test native MTP
|
||||||
|
runs-on: nixos
|
||||||
|
steps:
|
||||||
|
- run: nix profile add nixpkgs#nodejs_24
|
||||||
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- run: git submodule update --init --recursive
|
||||||
|
- run: nix develop .#electron --command bash -lc 'cd apps/tauri/src-tauri && cargo test'
|
||||||
|
|
||||||
|
mobile:
|
||||||
|
if: ${{ github.actor == 'rasensprenger' }}
|
||||||
|
name: Build mobile
|
||||||
|
runs-on: nixos
|
||||||
|
steps:
|
||||||
|
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- run: git submodule update --init --recursive
|
||||||
|
- run: nix develop .#tauri --command pnpm install --frozen-lockfile
|
||||||
|
- run: nix develop .#tauri --command pnpm run build:packages
|
||||||
|
- run: nix develop .#tauri --command pnpm --dir apps/tauri run build:mobile:ci
|
||||||
|
|
@ -1,20 +1,15 @@
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- flake.nix
|
- flake.nix
|
||||||
|
|
||||||
env:
|
|
||||||
NIX_CONFIG: experimental-features = nix-command flakes
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-web:
|
build-web:
|
||||||
runs-on: nixos
|
runs-on: nixos
|
||||||
steps:
|
steps:
|
||||||
- name: Install node
|
|
||||||
run: nix profile add nixpkgs#nodejs_24
|
|
||||||
|
|
||||||
- name: Check out repo
|
- name: Check out repo
|
||||||
uses: https://data.forgejo.org/actions/checkout@v4
|
uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
|
|
@ -39,9 +34,6 @@ jobs:
|
||||||
build-mobile:
|
build-mobile:
|
||||||
runs-on: nixos
|
runs-on: nixos
|
||||||
steps:
|
steps:
|
||||||
- name: Install node
|
|
||||||
run: nix profile add nixpkgs#nodejs_24
|
|
||||||
|
|
||||||
- name: Check out repo
|
- name: Check out repo
|
||||||
uses: https://data.forgejo.org/actions/checkout@v4
|
uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
|
|
@ -62,8 +54,6 @@ jobs:
|
||||||
KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
||||||
KEYSTORE_PROPERTIES: ${{ secrets.ANDROID_KEYSTORE_PROPERTIES }}
|
KEYSTORE_PROPERTIES: ${{ secrets.ANDROID_KEYSTORE_PROPERTIES }}
|
||||||
run: |
|
run: |
|
||||||
nix profile add nixpkgs#gnused
|
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
if [ -z "$KEYSTORE_BASE64" ]; then
|
if [ -z "$KEYSTORE_BASE64" ]; then
|
||||||
|
|
@ -128,9 +118,6 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
target: [linux]
|
target: [linux]
|
||||||
steps:
|
steps:
|
||||||
- name: Install node
|
|
||||||
run: nix profile add nixpkgs#nodejs_24
|
|
||||||
|
|
||||||
- name: Check out repo
|
- name: Check out repo
|
||||||
uses: https://data.forgejo.org/actions/checkout@v4
|
uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
|
|
@ -181,9 +168,6 @@ jobs:
|
||||||
runs-on: nixos
|
runs-on: nixos
|
||||||
needs: [build-web, build-mobile, build-desktop]
|
needs: [build-web, build-mobile, build-desktop]
|
||||||
steps:
|
steps:
|
||||||
- name: Install node
|
|
||||||
run: nix profile add nixpkgs#nodejs_24
|
|
||||||
|
|
||||||
- name: Check out repo
|
- name: Check out repo
|
||||||
uses: https://data.forgejo.org/actions/checkout@v4
|
uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -6,16 +6,10 @@ on:
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- flake.nix
|
- flake.nix
|
||||||
|
|
||||||
env:
|
|
||||||
NIX_CONFIG: experimental-features = nix-command flakes
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-web:
|
build-web:
|
||||||
runs-on: nixos
|
runs-on: nixos
|
||||||
steps:
|
steps:
|
||||||
- name: Install node
|
|
||||||
run: nix profile add nixpkgs#nodejs_24
|
|
||||||
|
|
||||||
- name: Check out repo
|
- name: Check out repo
|
||||||
uses: https://data.forgejo.org/actions/checkout@v4
|
uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
|
|
@ -40,9 +34,6 @@ jobs:
|
||||||
build-mobile:
|
build-mobile:
|
||||||
runs-on: nixos
|
runs-on: nixos
|
||||||
steps:
|
steps:
|
||||||
- name: Install node
|
|
||||||
run: nix profile add nixpkgs#nodejs_24
|
|
||||||
|
|
||||||
- name: Check out repo
|
- name: Check out repo
|
||||||
uses: https://data.forgejo.org/actions/checkout@v4
|
uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
|
|
@ -63,8 +54,6 @@ jobs:
|
||||||
KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
||||||
KEYSTORE_PROPERTIES: ${{ secrets.ANDROID_KEYSTORE_PROPERTIES }}
|
KEYSTORE_PROPERTIES: ${{ secrets.ANDROID_KEYSTORE_PROPERTIES }}
|
||||||
run: |
|
run: |
|
||||||
nix profile add nixpkgs#gnused
|
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
if [ -z "$KEYSTORE_BASE64" ]; then
|
if [ -z "$KEYSTORE_BASE64" ]; then
|
||||||
|
|
@ -129,9 +118,6 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
target: [linux]
|
target: [linux]
|
||||||
steps:
|
steps:
|
||||||
- name: Install node
|
|
||||||
run: nix profile add nixpkgs#nodejs_24
|
|
||||||
|
|
||||||
- name: Check out repo
|
- name: Check out repo
|
||||||
uses: https://data.forgejo.org/actions/checkout@v4
|
uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
|
|
@ -180,9 +166,6 @@ jobs:
|
||||||
runs-on: nixos
|
runs-on: nixos
|
||||||
needs: [build-web, build-mobile, build-desktop]
|
needs: [build-web, build-mobile, build-desktop]
|
||||||
steps:
|
steps:
|
||||||
- name: Install node
|
|
||||||
run: nix profile add nixpkgs#nodejs_24
|
|
||||||
|
|
||||||
- name: Check out repo
|
- name: Check out repo
|
||||||
uses: https://data.forgejo.org/actions/checkout@v4
|
uses: https://data.forgejo.org/actions/checkout@v4
|
||||||
|
|
||||||
|
|
@ -328,58 +311,3 @@ jobs:
|
||||||
"$API/repos/$REPO/releases/$release_id"
|
"$API/repos/$REPO/releases/$release_id"
|
||||||
done < "$DELETE_RELEASES"
|
done < "$DELETE_RELEASES"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Update root flake release hash
|
|
||||||
env:
|
|
||||||
TAG: ${{ steps.version.outputs.tag }}
|
|
||||||
run: |
|
|
||||||
nix develop .#electron --command bash <<'EOF'
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
DEB="$(find releases -maxdepth 1 -type f -name 'Tensamin-*-linux-amd64.deb' -print -quit)"
|
|
||||||
test -n "$DEB"
|
|
||||||
|
|
||||||
HASH="$(node -e 'const fs = require("fs"); const crypto = require("crypto"); const file = process.argv[1]; console.log("sha256-" + crypto.createHash("sha256").update(fs.readFileSync(file)).digest("base64"));' "$DEB")"
|
|
||||||
export HASH
|
|
||||||
|
|
||||||
node -e '
|
|
||||||
const fs = require("fs");
|
|
||||||
const version = process.env.TAG;
|
|
||||||
const hash = process.env.HASH;
|
|
||||||
let content = fs.readFileSync("flake.nix", "utf8");
|
|
||||||
content = content.replace(/version = "[^"]+";/, `version = "${version}";`);
|
|
||||||
content = content.replace(/x86_64DebHash = "sha256-[^"]+";/, `x86_64DebHash = "${hash}";`);
|
|
||||||
fs.writeFileSync("flake.nix", content);
|
|
||||||
'
|
|
||||||
|
|
||||||
if git diff --quiet -- flake.nix; then
|
|
||||||
echo "flake.nix already has the current release hash on main."
|
|
||||||
else
|
|
||||||
git add flake.nix
|
|
||||||
git -c user.name="forgejo-actions" -c user.email="forgejo-actions@localhost" commit -m "(qol): update release flake hash"
|
|
||||||
git push
|
|
||||||
fi
|
|
||||||
|
|
||||||
git fetch origin dev
|
|
||||||
git worktree add ../dev-flake-update origin/dev
|
|
||||||
cd ../dev-flake-update
|
|
||||||
|
|
||||||
node -e '
|
|
||||||
const fs = require("fs");
|
|
||||||
const version = process.env.TAG;
|
|
||||||
const hash = process.env.HASH;
|
|
||||||
let content = fs.readFileSync("flake.nix", "utf8");
|
|
||||||
content = content.replace(/version = "[^"]+";/, `version = "${version}";`);
|
|
||||||
content = content.replace(/x86_64DebHash = "sha256-[^"]+";/, `x86_64DebHash = "${hash}";`);
|
|
||||||
fs.writeFileSync("flake.nix", content);
|
|
||||||
'
|
|
||||||
|
|
||||||
if git diff --quiet -- flake.nix; then
|
|
||||||
echo "flake.nix already has the current release hash on dev."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
git add flake.nix
|
|
||||||
git -c user.name="forgejo-actions" -c user.email="forgejo-actions@localhost" commit -m "(qol): update release flake hash"
|
|
||||||
git push origin HEAD:dev
|
|
||||||
EOF
|
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
|
@ -28,12 +28,11 @@
|
||||||
"validate:raw": "pnpm run build && pnpm run package:linux:raw",
|
"validate:raw": "pnpm run build && pnpm run package:linux:raw",
|
||||||
"validate": "if command -v nix >/dev/null 2>&1 && [ -z \"$IN_NIX_SHELL\" ]; then nix develop ../..#electron --command pnpm run validate:raw; else pnpm run validate:raw; fi"
|
"validate": "if command -v nix >/dev/null 2>&1 && [ -z \"$IN_NIX_SHELL\" ]; then nix develop ../..#electron --command pnpm run validate:raw; else pnpm run validate:raw; fi"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^25.9.1",
|
"@types/node": "^26.1.2",
|
||||||
"electron": "^39.2.7",
|
"electron": "^43.3.0",
|
||||||
"electron-builder": "^26.0.12",
|
"electron-builder": "^26.15.3",
|
||||||
"esbuild": "^0.25.11",
|
"esbuild": "^0.28.1",
|
||||||
"typescript": "~6.0.3"
|
"typescript": "~6.0.3"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
|
|
|
||||||
36
apps/pwa/package.json
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
{
|
||||||
|
"name": "@tensamin/pwa",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.0.0",
|
||||||
|
"type": "module",
|
||||||
|
"exports": {
|
||||||
|
"./vite": "./src/vite.ts",
|
||||||
|
"./runtime": "./src/runtime.tsx"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"format": "pnpm exec prettier --write .",
|
||||||
|
"lint": "eslint src",
|
||||||
|
"build": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.worker.json --noEmit"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@methanium/ui": "*",
|
||||||
|
"@tauri-apps/api": "^2.11.1",
|
||||||
|
"@tensamin/crypto": "workspace:*",
|
||||||
|
"@tensamin/shared": "workspace:*",
|
||||||
|
"@tensamin/storage": "workspace:*",
|
||||||
|
"mtp": "*",
|
||||||
|
"react": "^19.2.8",
|
||||||
|
"sonner": "^2.0.7",
|
||||||
|
"vite-plugin-pwa": "^1.1.0",
|
||||||
|
"workbox-core": "^7.3.0",
|
||||||
|
"workbox-precaching": "^7.3.0",
|
||||||
|
"workbox-routing": "^7.3.0",
|
||||||
|
"workbox-strategies": "^7.3.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^26.1.2",
|
||||||
|
"@types/react": "^19.2.18",
|
||||||
|
"typescript": "~6.0.3",
|
||||||
|
"vite": "^8.2.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
189
apps/pwa/src/runtime.tsx
Normal file
|
|
@ -0,0 +1,189 @@
|
||||||
|
import { useEffect } from "react";
|
||||||
|
import { toast } from "sonner";
|
||||||
|
|
||||||
|
import { setDatabaseEntry } from "@tensamin/shared/indexedDb";
|
||||||
|
import { isTauri } from "@tauri-apps/api/core";
|
||||||
|
|
||||||
|
import "./style.css";
|
||||||
|
|
||||||
|
const launchedFiles: File[] = [];
|
||||||
|
const fileListeners = new Set<(file: File) => void>();
|
||||||
|
|
||||||
|
function emitLaunchedFile(file: File) {
|
||||||
|
if (fileListeners.size === 0) launchedFiles.push(file);
|
||||||
|
else for (const listener of fileListeners) listener(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function subscribeTuFileLaunch(listener: (file: File) => void) {
|
||||||
|
fileListeners.add(listener);
|
||||||
|
for (const file of launchedFiles.splice(0)) listener(file);
|
||||||
|
return () => {
|
||||||
|
fileListeners.delete(listener);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function isInstalledPwa() {
|
||||||
|
return (
|
||||||
|
window.matchMedia("(display-mode: standalone)").matches ||
|
||||||
|
window.matchMedia("(display-mode: window-controls-overlay)").matches ||
|
||||||
|
(navigator as Navigator & { standalone?: boolean }).standalone === true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function applicationServerKey(value: string) {
|
||||||
|
const normalized = value.replace(/-/g, "+").replace(/_/g, "/");
|
||||||
|
const padded = normalized.padEnd(Math.ceil(normalized.length / 4) * 4, "=");
|
||||||
|
return Uint8Array.from(atob(padded), (character) => character.charCodeAt(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
async function enablePush() {
|
||||||
|
if (!("Notification" in window))
|
||||||
|
throw new Error("Notifications are not supported by this browser.");
|
||||||
|
const permission = await Notification.requestPermission();
|
||||||
|
if (permission !== "granted")
|
||||||
|
throw new Error("Notification permission was not granted.");
|
||||||
|
|
||||||
|
const publicKey = import.meta.env.VITE_WEB_PUSH_PUBLIC_KEY;
|
||||||
|
if (
|
||||||
|
!publicKey ||
|
||||||
|
!("serviceWorker" in navigator) ||
|
||||||
|
!("PushManager" in window)
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const registration = await navigator.serviceWorker.ready;
|
||||||
|
const subscription =
|
||||||
|
(await registration.pushManager.getSubscription()) ??
|
||||||
|
(await registration.pushManager.subscribe({
|
||||||
|
userVisibleOnly: true,
|
||||||
|
applicationServerKey: applicationServerKey(publicKey),
|
||||||
|
}));
|
||||||
|
await setDatabaseEntry("keys", "push-subscription", subscription.toJSON());
|
||||||
|
}
|
||||||
|
|
||||||
|
function InstalledPwaRuntime() {
|
||||||
|
useEffect(() => {
|
||||||
|
if (
|
||||||
|
!("serviceWorker" in navigator) ||
|
||||||
|
!["http:", "https:"].includes(window.location.protocol)
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let reloading = false;
|
||||||
|
const handleControllerChange = () => {
|
||||||
|
if (reloading) return;
|
||||||
|
reloading = true;
|
||||||
|
// A newly activated service worker must reload the document it controls.
|
||||||
|
// eslint-disable-next-line tensamin/no-window-location-reload
|
||||||
|
window.location.reload();
|
||||||
|
};
|
||||||
|
navigator.serviceWorker.addEventListener(
|
||||||
|
"controllerchange",
|
||||||
|
handleControllerChange,
|
||||||
|
);
|
||||||
|
void navigator.serviceWorker
|
||||||
|
.register(
|
||||||
|
import.meta.env.DEV ? "/dev-sw.js?dev-sw" : "/serviceWorker.js",
|
||||||
|
{
|
||||||
|
type: "module",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.then((registration) => {
|
||||||
|
const watchWorker = (worker: ServiceWorker) => {
|
||||||
|
worker.addEventListener("statechange", () => {
|
||||||
|
if (worker.state !== "installed") return;
|
||||||
|
if (!navigator.serviceWorker.controller) {
|
||||||
|
toast.success("Tensamin is ready for offline startup");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
toast("A Tensamin update is ready", {
|
||||||
|
duration: Infinity,
|
||||||
|
action: {
|
||||||
|
label: "Update",
|
||||||
|
onClick: () => worker.postMessage({ type: "SKIP_WAITING" }),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
if (registration.installing) watchWorker(registration.installing);
|
||||||
|
registration.addEventListener("updatefound", () => {
|
||||||
|
if (registration.installing) watchWorker(registration.installing);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((error: unknown) => {
|
||||||
|
console.error("Failed to register the Tensamin service worker", error);
|
||||||
|
});
|
||||||
|
return () => {
|
||||||
|
navigator.serviceWorker.removeEventListener(
|
||||||
|
"controllerchange",
|
||||||
|
handleControllerChange,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const launchQueue = (
|
||||||
|
window as Window & {
|
||||||
|
launchQueue?: {
|
||||||
|
setConsumer: (
|
||||||
|
consumer: (params: {
|
||||||
|
files?: Array<{ getFile: () => Promise<File> }>;
|
||||||
|
}) => void,
|
||||||
|
) => void;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
).launchQueue;
|
||||||
|
launchQueue?.setConsumer((params) => {
|
||||||
|
for (const handle of params.files ?? []) {
|
||||||
|
void handle.getFile().then(emitLaunchedFile);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (
|
||||||
|
!("Notification" in window) ||
|
||||||
|
Notification.permission !== "default" ||
|
||||||
|
localStorage.getItem("pwa-push-hint")
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
localStorage.setItem("pwa-push-hint", "shown");
|
||||||
|
toast("Enable message notifications", {
|
||||||
|
duration: Infinity,
|
||||||
|
action: {
|
||||||
|
label: "Enable",
|
||||||
|
onClick: () => {
|
||||||
|
void enablePush()
|
||||||
|
.then(() => toast.success("Notifications enabled"))
|
||||||
|
.catch((error: unknown) =>
|
||||||
|
toast.error(
|
||||||
|
error instanceof Error
|
||||||
|
? error.message
|
||||||
|
: "Could not enable notifications",
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (
|
||||||
|
"Notification" in window &&
|
||||||
|
Notification.permission === "granted" &&
|
||||||
|
import.meta.env.VITE_WEB_PUSH_PUBLIC_KEY
|
||||||
|
) {
|
||||||
|
void enablePush().catch((error: unknown) => {
|
||||||
|
console.error("Failed to refresh the Web Push subscription", error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function PwaRuntime() {
|
||||||
|
if (isTauri() || !isInstalledPwa()) return null;
|
||||||
|
return <InstalledPwaRuntime />;
|
||||||
|
}
|
||||||
161
apps/pwa/src/serviceWorker.ts
Normal file
|
|
@ -0,0 +1,161 @@
|
||||||
|
/// <reference lib="webworker" />
|
||||||
|
|
||||||
|
import { base64ToBytes } from "mtp";
|
||||||
|
import { clientsClaim } from "workbox-core";
|
||||||
|
import { cleanupOutdatedCaches, precacheAndRoute } from "workbox-precaching";
|
||||||
|
import { NavigationRoute, registerRoute } from "workbox-routing";
|
||||||
|
import { createHandlerBoundToURL } from "workbox-precaching";
|
||||||
|
import { CacheFirst } from "workbox-strategies";
|
||||||
|
|
||||||
|
import { decryptChatText, unwrapChatSecret } from "@tensamin/crypto/chatSecret";
|
||||||
|
import { loadSecureBrowserValue } from "@tensamin/storage/browserSecure";
|
||||||
|
|
||||||
|
declare let self: ServiceWorkerGlobalScope;
|
||||||
|
|
||||||
|
type PushPayload = {
|
||||||
|
version: 1;
|
||||||
|
senderId: number;
|
||||||
|
sender: string;
|
||||||
|
avatar?: string;
|
||||||
|
message: { content: string };
|
||||||
|
secret: {
|
||||||
|
chatId: string;
|
||||||
|
secretId: string;
|
||||||
|
version: number;
|
||||||
|
encryptedSecret: string;
|
||||||
|
kemCiphertext: string;
|
||||||
|
wrappingScheme: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
function isPushPayload(value: unknown): value is PushPayload {
|
||||||
|
if (!value || typeof value !== "object") return false;
|
||||||
|
const payload = value as Partial<PushPayload>;
|
||||||
|
const message = payload.message as
|
||||||
|
Partial<PushPayload["message"]> | undefined;
|
||||||
|
const secret = payload.secret as Partial<PushPayload["secret"]> | undefined;
|
||||||
|
const stringValues = [
|
||||||
|
payload.sender,
|
||||||
|
message?.content,
|
||||||
|
secret?.chatId,
|
||||||
|
secret?.secretId,
|
||||||
|
secret?.encryptedSecret,
|
||||||
|
secret?.kemCiphertext,
|
||||||
|
secret?.wrappingScheme,
|
||||||
|
];
|
||||||
|
return (
|
||||||
|
payload.version === 1 &&
|
||||||
|
typeof payload.senderId === "number" &&
|
||||||
|
Number.isSafeInteger(payload.senderId) &&
|
||||||
|
payload.senderId > 0 &&
|
||||||
|
typeof secret?.version === "number" &&
|
||||||
|
stringValues.every((item) => typeof item === "string")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function decryptPush(payload: PushPayload) {
|
||||||
|
const keyring = await loadSecureBrowserValue<string>("mtp_keyring");
|
||||||
|
if (!keyring) throw new Error("MTP credentials are unavailable.");
|
||||||
|
const chatSecret = await unwrapChatSecret({
|
||||||
|
encryptedSecret: base64ToBytes(payload.secret.encryptedSecret),
|
||||||
|
kemCiphertext: base64ToBytes(payload.secret.kemCiphertext),
|
||||||
|
keyring,
|
||||||
|
chatId: payload.secret.chatId,
|
||||||
|
secretId: payload.secret.secretId,
|
||||||
|
version: payload.secret.version,
|
||||||
|
wrappingScheme: payload.secret.wrappingScheme,
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
return await decryptChatText(chatSecret, payload.message.content);
|
||||||
|
} finally {
|
||||||
|
chatSecret.fill(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
clientsClaim();
|
||||||
|
cleanupOutdatedCaches();
|
||||||
|
const precacheManifest = self.__WB_MANIFEST;
|
||||||
|
precacheAndRoute(precacheManifest);
|
||||||
|
|
||||||
|
if (
|
||||||
|
precacheManifest.some((entry) =>
|
||||||
|
(typeof entry === "string" ? entry : entry.url).endsWith("index.html"),
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
registerRoute(
|
||||||
|
new NavigationRoute(createHandlerBoundToURL("index.html"), {
|
||||||
|
denylist: [/^\/api\//],
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
registerRoute(
|
||||||
|
({ request, url }) =>
|
||||||
|
url.origin === self.location.origin &&
|
||||||
|
["font", "image", "style"].includes(request.destination),
|
||||||
|
new CacheFirst({ cacheName: "tensamin-static-v1" }),
|
||||||
|
);
|
||||||
|
|
||||||
|
self.addEventListener("push", (event) => {
|
||||||
|
event.waitUntil(
|
||||||
|
(async () => {
|
||||||
|
let payload: PushPayload | undefined;
|
||||||
|
try {
|
||||||
|
const value = event.data?.json() as unknown;
|
||||||
|
if (isPushPayload(value)) payload = value;
|
||||||
|
} catch {
|
||||||
|
// The generic notification below is safe for malformed payloads.
|
||||||
|
}
|
||||||
|
|
||||||
|
let body = "Open Tensamin to view the encrypted message.";
|
||||||
|
if (payload) {
|
||||||
|
try {
|
||||||
|
body = await decryptPush(payload);
|
||||||
|
} catch {
|
||||||
|
// Do not leak credential or decryption failures in the notification.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await self.registration.showNotification(payload?.sender ?? "Tensamin", {
|
||||||
|
body,
|
||||||
|
icon: payload?.avatar || "./icons/icon-192.png",
|
||||||
|
badge: "./icons/notification-badge.png",
|
||||||
|
tag: payload ? `message-${payload.senderId}` : "message",
|
||||||
|
data: { url: payload ? `/chat?id=${payload.senderId}` : "/" },
|
||||||
|
});
|
||||||
|
|
||||||
|
const navigatorWithBadge = self.navigator as WorkerNavigator & {
|
||||||
|
setAppBadge?: (contents?: number) => Promise<void>;
|
||||||
|
};
|
||||||
|
await navigatorWithBadge.setAppBadge?.().catch(() => undefined);
|
||||||
|
})(),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
self.addEventListener("notificationclick", (event) => {
|
||||||
|
event.notification.close();
|
||||||
|
event.waitUntil(
|
||||||
|
(async () => {
|
||||||
|
const target = new URL(
|
||||||
|
String(
|
||||||
|
(event.notification.data as { url?: string } | undefined)?.url ?? "/",
|
||||||
|
),
|
||||||
|
self.location.origin,
|
||||||
|
);
|
||||||
|
const windows = await self.clients.matchAll({
|
||||||
|
type: "window",
|
||||||
|
includeUncontrolled: true,
|
||||||
|
});
|
||||||
|
for (const client of windows) {
|
||||||
|
if ("navigate" in client) await client.navigate(target.href);
|
||||||
|
return client.focus();
|
||||||
|
}
|
||||||
|
return self.clients.openWindow(target.href);
|
||||||
|
})(),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
self.addEventListener("message", (event) => {
|
||||||
|
if ((event.data as { type?: string } | undefined)?.type === "SKIP_WAITING") {
|
||||||
|
void self.skipWaiting();
|
||||||
|
}
|
||||||
|
});
|
||||||
18
apps/pwa/src/style.css
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
@media (display-mode: standalone), (display-mode: fullscreen) {
|
||||||
|
[data-pwa-root] {
|
||||||
|
padding-top: env(safe-area-inset-top, 0px);
|
||||||
|
padding-right: env(safe-area-inset-right, 0px);
|
||||||
|
padding-left: env(safe-area-inset-left, 0px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (display-mode: window-controls-overlay) and (min-width: 768px) {
|
||||||
|
[data-pwa-navbar] {
|
||||||
|
min-height: env(titlebar-area-height, 3.375rem);
|
||||||
|
padding-left: max(1px, env(titlebar-area-x, 0px));
|
||||||
|
padding-right: max(
|
||||||
|
0px,
|
||||||
|
calc(100vw - env(titlebar-area-x, 0px) - env(titlebar-area-width, 100vw))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
218
apps/pwa/src/vite.ts
Normal file
|
|
@ -0,0 +1,218 @@
|
||||||
|
import { readFileSync } from "node:fs";
|
||||||
|
import { dirname, resolve } from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
|
||||||
|
import type { Plugin } from "vite";
|
||||||
|
import { VitePWA } from "vite-plugin-pwa";
|
||||||
|
|
||||||
|
const pwaDirectory = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
|
const tauriIcons = resolve(pwaDirectory, "../tauri/src-tauri/icons");
|
||||||
|
const androidResources = resolve(
|
||||||
|
pwaDirectory,
|
||||||
|
"../tauri/src-tauri/gen/android/app/src/main/res",
|
||||||
|
);
|
||||||
|
|
||||||
|
function emitIcons(): Plugin {
|
||||||
|
const icons = [
|
||||||
|
{
|
||||||
|
fileName: "icons/icon-180.png",
|
||||||
|
source: resolve(tauriIcons, "ios/AppIcon-60x60@3x.png"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fileName: "icons/icon-192.png",
|
||||||
|
source: resolve(androidResources, "mipmap-xxxhdpi/ic_launcher.png"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fileName: "icons/icon-96.png",
|
||||||
|
source: resolve(androidResources, "mipmap-xhdpi/ic_launcher.png"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fileName: "icons/icon-512.png",
|
||||||
|
source: resolve(tauriIcons, "icon.png"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fileName: "icons/icon-maskable-512.png",
|
||||||
|
source: resolve(tauriIcons, "icon.png"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fileName: "icons/icon-monochrome-432.png",
|
||||||
|
source: resolve(
|
||||||
|
androidResources,
|
||||||
|
"mipmap-xxxhdpi/ic_launcher_monochrome.png",
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fileName: "icons/notification-badge.png",
|
||||||
|
source: resolve(androidResources, "drawable/ic_notification_small.png"),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
return {
|
||||||
|
name: "tensamin-pwa-icons",
|
||||||
|
configureServer(server) {
|
||||||
|
server.middlewares.use((request, response, next) => {
|
||||||
|
const pathname = request.url
|
||||||
|
? new URL(request.url, "http://localhost").pathname.slice(1)
|
||||||
|
: "";
|
||||||
|
const icon = icons.find(({ fileName }) => fileName === pathname);
|
||||||
|
if (!icon) {
|
||||||
|
next();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
response.statusCode = 200;
|
||||||
|
response.setHeader("Content-Type", "image/png");
|
||||||
|
response.setHeader("Cache-Control", "no-cache");
|
||||||
|
response.end(readFileSync(icon.source));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
generateBundle() {
|
||||||
|
for (const icon of icons) {
|
||||||
|
this.emitFile({
|
||||||
|
type: "asset",
|
||||||
|
fileName: icon.fileName,
|
||||||
|
source: readFileSync(icon.source),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
transformIndexHtml: {
|
||||||
|
order: "post",
|
||||||
|
handler() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
tag: "link",
|
||||||
|
attrs: {
|
||||||
|
rel: "apple-touch-icon",
|
||||||
|
sizes: "180x180",
|
||||||
|
href: "./icons/icon-180.png",
|
||||||
|
},
|
||||||
|
injectTo: "head",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tag: "meta",
|
||||||
|
attrs: { name: "apple-mobile-web-app-capable", content: "yes" },
|
||||||
|
injectTo: "head",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tag: "meta",
|
||||||
|
attrs: {
|
||||||
|
name: "apple-mobile-web-app-status-bar-style",
|
||||||
|
content: "black-translucent",
|
||||||
|
},
|
||||||
|
injectTo: "head",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tag: "meta",
|
||||||
|
attrs: {
|
||||||
|
name: "apple-mobile-web-app-title",
|
||||||
|
content: "Tensamin",
|
||||||
|
},
|
||||||
|
injectTo: "head",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tag: "meta",
|
||||||
|
attrs: { name: "theme-color", content: "#006a67" },
|
||||||
|
injectTo: "head",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function tensaminPwa(): Plugin[] {
|
||||||
|
return [
|
||||||
|
emitIcons(),
|
||||||
|
...VitePWA({
|
||||||
|
strategies: "injectManifest",
|
||||||
|
srcDir: resolve(pwaDirectory, "src"),
|
||||||
|
filename: "serviceWorker.ts",
|
||||||
|
injectRegister: null,
|
||||||
|
registerType: "prompt",
|
||||||
|
buildBase: "/",
|
||||||
|
manifestFilename: "manifest.json",
|
||||||
|
includeAssets: ["favicon.ico", "icons/*.png"],
|
||||||
|
manifest: {
|
||||||
|
id: "/",
|
||||||
|
name: "Tensamin",
|
||||||
|
short_name: "Tensamin",
|
||||||
|
description: "Private messaging and calls with Tensamin.",
|
||||||
|
start_url: "/",
|
||||||
|
scope: "/",
|
||||||
|
display: "standalone",
|
||||||
|
display_override: ["window-controls-overlay", "standalone"],
|
||||||
|
background_color: "#001f1e",
|
||||||
|
theme_color: "#006a67",
|
||||||
|
categories: ["social", "communication"],
|
||||||
|
orientation: "any",
|
||||||
|
launch_handler: { client_mode: "focus-existing" },
|
||||||
|
icons: [
|
||||||
|
{
|
||||||
|
src: "icons/icon-192.png",
|
||||||
|
sizes: "192x192",
|
||||||
|
type: "image/png",
|
||||||
|
purpose: "any",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: "icons/icon-512.png",
|
||||||
|
sizes: "512x512",
|
||||||
|
type: "image/png",
|
||||||
|
purpose: "any",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: "icons/icon-maskable-512.png",
|
||||||
|
sizes: "512x512",
|
||||||
|
type: "image/png",
|
||||||
|
purpose: "maskable",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
src: "icons/icon-monochrome-432.png",
|
||||||
|
sizes: "432x432",
|
||||||
|
type: "image/png",
|
||||||
|
purpose: "monochrome",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
shortcuts: [
|
||||||
|
{
|
||||||
|
name: "Chats",
|
||||||
|
short_name: "Chats",
|
||||||
|
url: "/",
|
||||||
|
icons: [
|
||||||
|
{
|
||||||
|
src: "icons/icon-96.png",
|
||||||
|
sizes: "96x96",
|
||||||
|
type: "image/png",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Settings",
|
||||||
|
short_name: "Settings",
|
||||||
|
url: "/settings",
|
||||||
|
icons: [
|
||||||
|
{
|
||||||
|
src: "icons/icon-96.png",
|
||||||
|
sizes: "96x96",
|
||||||
|
type: "image/png",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
file_handlers: [
|
||||||
|
{
|
||||||
|
action: "/login",
|
||||||
|
accept: { "application/x-tensamin-user": [".tu"] },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
injectManifest: {
|
||||||
|
globPatterns: ["**/*.{js,css,html,ico,png,svg,woff2,wasm,mp3,wav}"],
|
||||||
|
globIgnores: ["assets/v2/**"],
|
||||||
|
maximumFileSizeToCacheInBytes: 15 * 1024 * 1024,
|
||||||
|
},
|
||||||
|
devOptions: {
|
||||||
|
enabled: true,
|
||||||
|
type: "module",
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
}
|
||||||
33
apps/pwa/todo.md
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
# Web Push Backend TODO
|
||||||
|
|
||||||
|
The client can subscribe and decrypt version 1 push payloads, but reliable delivery requires backend support.
|
||||||
|
|
||||||
|
- Generate and securely store a VAPID key pair. Expose only the public key to the web build as `VITE_WEB_PUSH_PUBLIC_KEY`.
|
||||||
|
- Add authenticated MTP requests for registering, replacing, and deleting a browser `PushSubscription` per user and installation.
|
||||||
|
- Persist the endpoint, `p256dh`, `auth`, expiration time, stable installation ID, and last-seen time.
|
||||||
|
- Remove subscriptions when a push service returns HTTP 404 or 410 and rate-limit registrations per user.
|
||||||
|
- Send pushes when an encrypted live message cannot be delivered to an active browser client. Define duplicate suppression for clients that receive both MTP and Web Push.
|
||||||
|
- Keep the JSON payload within push-provider limits and use this version 1 shape:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"senderId": 123,
|
||||||
|
"sender": "Display name",
|
||||||
|
"avatar": "https://optional.example/avatar",
|
||||||
|
"message": { "content": "base64 encrypted message content" },
|
||||||
|
"secret": {
|
||||||
|
"chatId": "123:456",
|
||||||
|
"secretId": "chat:123:456:main",
|
||||||
|
"version": 1,
|
||||||
|
"encryptedSecret": "base64 wrapped chat secret",
|
||||||
|
"kemCiphertext": "base64 KEM ciphertext",
|
||||||
|
"wrappingScheme": "mtp-chat-secret-kem-chacha20poly1305-hkdf-sha256-v1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- Ensure the wrapped secret is intended for the receiving user's MTP keyring. The server must never receive plaintext message content or plaintext chat secrets.
|
||||||
|
- Decide how edits, deletions, reactions, calls, read states, and per-chat notification cancellation map to push events.
|
||||||
|
- Add subscription rotation handling and unregister subscriptions when a user logs out or clears application data.
|
||||||
|
- Configure production HTTPS, SPA route fallback, `application/manifest+json` for `manifest.json`, and `Cache-Control: no-cache` for the service worker.
|
||||||
23
apps/pwa/tsconfig.json
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2022",
|
||||||
|
"useDefineForClassFields": true,
|
||||||
|
"module": "ESNext",
|
||||||
|
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||||
|
"types": ["vite/client", "vite-plugin-pwa/client", "node"],
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
|
"moduleDetection": "force",
|
||||||
|
"noEmit": true,
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
"strict": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"erasableSyntaxOnly": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noUncheckedSideEffectImports": true
|
||||||
|
},
|
||||||
|
"include": ["src/runtime.tsx", "src/vite.ts"]
|
||||||
|
}
|
||||||
21
apps/pwa/tsconfig.worker.json
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ESNext",
|
||||||
|
"lib": ["ES2022", "WebWorker"],
|
||||||
|
"types": ["vite-plugin-pwa/client"],
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
|
"moduleDetection": "force",
|
||||||
|
"noEmit": true,
|
||||||
|
"strict": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"erasableSyntaxOnly": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noUncheckedSideEffectImports": true
|
||||||
|
},
|
||||||
|
"include": ["src/serviceWorker.ts"]
|
||||||
|
}
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
[env]
|
|
||||||
MTP_TYPE_MAPS = { value = "../../mtp-type-maps/type-maps.yaml", relative = true }
|
|
||||||
BIN
apps/tauri/monochrome_cropped.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
|
|
@ -7,16 +7,13 @@
|
||||||
"./deeplinkHandler": {
|
"./deeplinkHandler": {
|
||||||
"types": "./src/deeplinkHandler.tsx",
|
"types": "./src/deeplinkHandler.tsx",
|
||||||
"default": "./src/deeplinkHandler.tsx"
|
"default": "./src/deeplinkHandler.tsx"
|
||||||
},
|
|
||||||
"./qrCodeScanner": {
|
|
||||||
"types": "./src/qrCodeScanner.tsx",
|
|
||||||
"default": "./src/qrCodeScanner.tsx"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev:mobile:raw": "tauri android dev --host ${TAURI_DEV_HOST:-127.0.0.1}",
|
"dev:mobile:raw": "adb reverse tcp:3000 tcp:3000 && tauri android dev --host ${TAURI_DEV_HOST:-127.0.0.1}",
|
||||||
"start-adb:mobile:raw": "adb devices",
|
"start-adb:mobile:raw": "adb devices",
|
||||||
"build:mobile:raw": "tauri android build",
|
"build:mobile:raw": "tauri android build",
|
||||||
|
"build:mobile:ci": "node render-version.ts && trap 'node render-version.ts --unrender' EXIT && tauri android build --debug",
|
||||||
"dev:mobile": "if command -v nix >/dev/null 2>&1 && [ -z \"$IN_NIX_SHELL\" ]; then nix develop ../..#tauri --command pnpm run dev:mobile:raw; else pnpm run dev:mobile:raw; fi",
|
"dev:mobile": "if command -v nix >/dev/null 2>&1 && [ -z \"$IN_NIX_SHELL\" ]; then nix develop ../..#tauri --command pnpm run dev:mobile:raw; else pnpm run dev:mobile:raw; fi",
|
||||||
"start-adb:mobile": "if command -v nix >/dev/null 2>&1 && [ -z \"$IN_NIX_SHELL\" ]; then nix develop ../..#tauri --command pnpm run start-adb:mobile:raw; else pnpm run start-adb:mobile:raw; fi",
|
"start-adb:mobile": "if command -v nix >/dev/null 2>&1 && [ -z \"$IN_NIX_SHELL\" ]; then nix develop ../..#tauri --command pnpm run start-adb:mobile:raw; else pnpm run start-adb:mobile:raw; fi",
|
||||||
"build:mobile": "node render-version.ts && trap 'node render-version.ts --unrender' EXIT && if command -v nix >/dev/null 2>&1 && [ -z \"$IN_NIX_SHELL\" ]; then nix develop ../..#tauri --command pnpm run build:mobile:raw; else pnpm run build:mobile:raw; fi",
|
"build:mobile": "node render-version.ts && trap 'node render-version.ts --unrender' EXIT && if command -v nix >/dev/null 2>&1 && [ -z \"$IN_NIX_SHELL\" ]; then nix develop ../..#tauri --command pnpm run build:mobile:raw; else pnpm run build:mobile:raw; fi",
|
||||||
|
|
@ -25,18 +22,15 @@
|
||||||
"lint": "eslint src"
|
"lint": "eslint src"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tauri-apps/api": "^2",
|
|
||||||
"@tauri-apps/plugin-barcode-scanner": "~2",
|
|
||||||
"@tauri-apps/plugin-deep-link": "~2",
|
|
||||||
"@tauri-apps/plugin-log": "~2",
|
|
||||||
"@tauri-apps/plugin-notification": "~2",
|
|
||||||
"@tensamin/shared": "workspace:*",
|
|
||||||
"@methanium/ui": "*",
|
"@methanium/ui": "*",
|
||||||
"react": "^19.2.0",
|
"@tauri-apps/api": "^2.11.1",
|
||||||
"react-dom": "^19.2.0"
|
"@tauri-apps/plugin-deep-link": "~2.4.9",
|
||||||
|
"@tensamin/shared": "workspace:*",
|
||||||
|
"react": "^19.2.8",
|
||||||
|
"react-dom": "^19.2.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tauri-apps/cli": "^2",
|
"@tauri-apps/cli": "^2.11.4",
|
||||||
"@types/node": "^25.9.1"
|
"@types/node": "^26.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1278
apps/tauri/src-tauri/Cargo.lock
generated
|
|
@ -15,17 +15,16 @@ name = "mobile_lib"
|
||||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tauri-build = { git = "https://github.com/tauri-apps/tauri", rev = "20f3f2515c65ca1e115991c3ef3625e2c29c1bbb", features = [] }
|
tauri-build = { git = "https://github.com/tauri-apps/tauri", rev = "4af26a3f7f8b692d62cca549bbacd93f5ce90b41", features = [] }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tauri-plugin-opener = "2"
|
tauri-plugin-opener = "2"
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
base64 = "0.22"
|
base64 = "0.22"
|
||||||
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
|
reqwest = { version = "0.13", default-features = false, features = ["json", "rustls"] }
|
||||||
tokio = { version = "1", features = ["rt-multi-thread", "sync", "time"] }
|
tokio = { version = "1", features = ["rt-multi-thread", "sync", "time"] }
|
||||||
mtp = { git = "https://git.methanium.net/methanium/mtp.git", rev = "d10266198d62ca9e14a8b1a55d2ab108b24e756e", features = ["client", "crypto"] }
|
mtp = { git = "https://git.methanium.net/Methanium/mtp.git", rev = "a5c8d4f0c898c78351e9d54124886c86e789a22a", features = ["client", "crypto"] }
|
||||||
mtp-transport = { git = "https://git.methanium.net/methanium/mtp.git", rev = "d10266198d62ca9e14a8b1a55d2ab108b24e756e" }
|
|
||||||
webpki-root-certs = "1"
|
webpki-root-certs = "1"
|
||||||
tauri-plugin-deep-link = "2"
|
tauri-plugin-deep-link = "2"
|
||||||
tauri-plugin-notification = "2"
|
tauri-plugin-notification = "2"
|
||||||
|
|
@ -36,12 +35,14 @@ version = "2"
|
||||||
features = []
|
features = []
|
||||||
default-features = true
|
default-features = true
|
||||||
|
|
||||||
[target.'cfg(target_os = "android")'.dependencies]
|
[target.'cfg(not(target_os = "android"))'.dependencies.tauri]
|
||||||
jni = "0.21"
|
version = "2"
|
||||||
|
features = []
|
||||||
|
default-features = true
|
||||||
|
|
||||||
[target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies]
|
[target.'cfg(target_os = "android")'.dependencies]
|
||||||
tauri-plugin-barcode-scanner = "2"
|
jni = "0.22"
|
||||||
|
|
||||||
[patch.crates-io.tauri]
|
[patch.crates-io.tauri]
|
||||||
git = "https://github.com/tauri-apps/tauri"
|
git = "https://github.com/tauri-apps/tauri"
|
||||||
rev = "20f3f2515c65ca1e115991c3ef3625e2c29c1bbb"
|
rev = "4af26a3f7f8b692d62cca549bbacd93f5ce90b41"
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,7 @@
|
||||||
"main"
|
"main"
|
||||||
],
|
],
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"core:default",
|
|
||||||
"opener:default",
|
"opener:default",
|
||||||
"core:window:default",
|
|
||||||
"core:event:default",
|
|
||||||
"deep-link:default",
|
"deep-link:default",
|
||||||
"notification:default",
|
"notification:default",
|
||||||
"log:default"
|
"log:default"
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,10 @@
|
||||||
{
|
{
|
||||||
"identifier": "mobile-capability",
|
"identifier": "mobile-capability",
|
||||||
"platforms": [
|
"platforms": ["android", "iOS"],
|
||||||
"android",
|
"windows": ["main"],
|
||||||
"iOS"
|
|
||||||
],
|
|
||||||
"windows": [
|
|
||||||
"main"
|
|
||||||
],
|
|
||||||
"permissions": [
|
"permissions": [
|
||||||
|
"core:event:default",
|
||||||
"deep-link:default",
|
"deep-link:default",
|
||||||
"barcode-scanner:default",
|
|
||||||
"barcode-scanner:allow-scan",
|
|
||||||
"barcode-scanner:allow-cancel",
|
|
||||||
"notification:default",
|
"notification:default",
|
||||||
"log:default"
|
"log:default"
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
import java.util.Properties
|
import java.util.Properties
|
||||||
import java.io.FileInputStream
|
import java.io.FileInputStream
|
||||||
|
|
||||||
|
|
@ -61,26 +62,29 @@ android {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = "1.8"
|
|
||||||
}
|
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
buildConfig = true
|
buildConfig = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
compilerOptions {
|
||||||
|
jvmTarget = JvmTarget.JVM_1_8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rust {
|
rust {
|
||||||
rootDirRel = "../../../"
|
rootDirRel = "../../../"
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("androidx.webkit:webkit:1.14.0")
|
implementation("androidx.webkit:webkit:1.16.0")
|
||||||
implementation("androidx.appcompat:appcompat:1.7.1")
|
implementation("androidx.appcompat:appcompat:1.7.1")
|
||||||
implementation("androidx.activity:activity-ktx:1.10.1")
|
implementation("androidx.activity:activity-ktx:1.13.0")
|
||||||
implementation("com.google.android.material:material:1.12.0")
|
implementation("com.google.android.material:material:1.14.0")
|
||||||
testImplementation("junit:junit:4.13.2")
|
testImplementation("junit:junit:4.13.2")
|
||||||
androidTestImplementation("androidx.test.ext:junit:1.1.4")
|
androidTestImplementation("androidx.test.ext:junit:1.3.0")
|
||||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.7.0")
|
||||||
}
|
}
|
||||||
|
|
||||||
apply(from = "tauri.build.gradle.kts")
|
apply(from = "tauri.build.gradle.kts")
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||||
|
|
@ -56,6 +57,7 @@
|
||||||
<service
|
<service
|
||||||
android:name=".MtpForegroundService"
|
android:name=".MtpForegroundService"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
|
android:stopWithTask="false"
|
||||||
android:foregroundServiceType="specialUse">
|
android:foregroundServiceType="specialUse">
|
||||||
<property
|
<property
|
||||||
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
|
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,9 @@ package net.tensamin.client
|
||||||
import android.Manifest
|
import android.Manifest
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.graphics.Rect
|
|
||||||
import android.media.projection.MediaProjectionManager
|
import android.media.projection.MediaProjectionManager
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.ViewGroup
|
import android.view.MotionEvent
|
||||||
import android.view.ViewTreeObserver
|
import android.view.ViewTreeObserver
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import android.webkit.JavascriptInterface
|
import android.webkit.JavascriptInterface
|
||||||
|
|
@ -56,7 +55,33 @@ class MainActivity : TauriActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onWebViewCreate(webView: WebView) {
|
override fun onWebViewCreate(webView: WebView) {
|
||||||
webView.setInitialScale(290)
|
webView.settings.apply {
|
||||||
|
setSupportZoom(false)
|
||||||
|
builtInZoomControls = false
|
||||||
|
displayZoomControls = false
|
||||||
|
}
|
||||||
|
|
||||||
|
var blockingMultiTouch = false
|
||||||
|
webView.setOnTouchListener { _, event ->
|
||||||
|
val shouldBlock = blockingMultiTouch || event.pointerCount > 1
|
||||||
|
|
||||||
|
when (event.actionMasked) {
|
||||||
|
MotionEvent.ACTION_POINTER_DOWN -> {
|
||||||
|
// Cancel the one-finger gesture before consuming the rest of the pinch.
|
||||||
|
MotionEvent.obtain(event).let { cancelEvent ->
|
||||||
|
cancelEvent.action = MotionEvent.ACTION_CANCEL
|
||||||
|
webView.onTouchEvent(cancelEvent)
|
||||||
|
cancelEvent.recycle()
|
||||||
|
}
|
||||||
|
blockingMultiTouch = true
|
||||||
|
}
|
||||||
|
MotionEvent.ACTION_UP, MotionEvent.ACTION_CANCEL -> blockingMultiTouch = false
|
||||||
|
}
|
||||||
|
|
||||||
|
shouldBlock
|
||||||
|
}
|
||||||
|
|
||||||
|
NativeAccessibilityBridge.attach(webView)
|
||||||
mediaWebView = webView
|
mediaWebView = webView
|
||||||
MobileMediaEvents.attach(webView)
|
MobileMediaEvents.attach(webView)
|
||||||
webView.addJavascriptInterface(MobileMediaJavascriptInterface(), "tensaminMobileMedia")
|
webView.addJavascriptInterface(MobileMediaJavascriptInterface(), "tensaminMobileMedia")
|
||||||
|
|
@ -70,6 +95,7 @@ class MainActivity : TauriActivity() {
|
||||||
if (MtpSecureStore.isEnabled(this) && MtpSecureStore.hasConfig(this)) {
|
if (MtpSecureStore.isEnabled(this) && MtpSecureStore.hasConfig(this)) {
|
||||||
NativeMtpBridge.startService(this)
|
NativeMtpBridge.startService(this)
|
||||||
}
|
}
|
||||||
|
NativeAccessibilityBridge.nativeAttach(applicationContext)
|
||||||
installKeyboardResizeWorkaround()
|
installKeyboardResizeWorkaround()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -90,7 +116,10 @@ class MainActivity : TauriActivity() {
|
||||||
attachLayoutListener = null
|
attachLayoutListener = null
|
||||||
contentRoot = null
|
contentRoot = null
|
||||||
contentChild = null
|
contentChild = null
|
||||||
mediaWebView?.removeJavascriptInterface("tensaminMobileMedia")
|
mediaWebView?.let {
|
||||||
|
NativeAccessibilityBridge.detach(it)
|
||||||
|
it.removeJavascriptInterface("tensaminMobileMedia")
|
||||||
|
}
|
||||||
mediaWebView = null
|
mediaWebView = null
|
||||||
MobileMediaEvents.detach()
|
MobileMediaEvents.detach()
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
|
|
@ -203,16 +232,20 @@ class MainActivity : TauriActivity() {
|
||||||
child: android.view.View,
|
child: android.view.View,
|
||||||
insets: WindowInsetsCompat? = ViewCompat.getRootWindowInsets(child),
|
insets: WindowInsetsCompat? = ViewCompat.getRootWindowInsets(child),
|
||||||
) {
|
) {
|
||||||
val visibleFrame = Rect()
|
|
||||||
child.getWindowVisibleDisplayFrame(visibleFrame)
|
|
||||||
|
|
||||||
val rootHeight = child.rootView.height
|
val rootHeight = child.rootView.height
|
||||||
if (rootHeight <= 0) return
|
if (rootHeight <= 0) return
|
||||||
|
|
||||||
val imeHeight = insets?.getInsets(WindowInsetsCompat.Type.ime())?.bottom ?: 0
|
val imeVisible = insets?.isVisible(WindowInsetsCompat.Type.ime()) == true
|
||||||
val keyboardHeight = maxOf(imeHeight, rootHeight - visibleFrame.bottom)
|
val imeHeight = if (imeVisible) {
|
||||||
val keyboardVisible = keyboardHeight > rootHeight * 0.15
|
insets.getInsets(WindowInsetsCompat.Type.ime()).bottom
|
||||||
val usableHeight = if (keyboardVisible) rootHeight - keyboardHeight else ViewGroup.LayoutParams.MATCH_PARENT
|
} else {
|
||||||
|
0
|
||||||
|
}
|
||||||
|
val usableHeight = if (imeHeight in 1 until rootHeight) {
|
||||||
|
rootHeight - imeHeight
|
||||||
|
} else {
|
||||||
|
WindowManager.LayoutParams.MATCH_PARENT
|
||||||
|
}
|
||||||
|
|
||||||
if (previousUsableHeight == usableHeight) return
|
if (previousUsableHeight == usableHeight) return
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import android.os.HandlerThread
|
||||||
import android.os.IBinder
|
import android.os.IBinder
|
||||||
import android.util.Base64
|
import android.util.Base64
|
||||||
import android.util.DisplayMetrics
|
import android.util.DisplayMetrics
|
||||||
|
import androidx.core.app.NotificationCompat
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
import java.util.concurrent.atomic.AtomicBoolean
|
import java.util.concurrent.atomic.AtomicBoolean
|
||||||
|
|
@ -107,16 +108,12 @@ class MediaProjectionService : Service() {
|
||||||
stopIntent,
|
stopIntent,
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,
|
||||||
)
|
)
|
||||||
val notification = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
val notification = NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID)
|
||||||
android.app.Notification.Builder(this, NOTIFICATION_CHANNEL_ID)
|
|
||||||
} else {
|
|
||||||
android.app.Notification.Builder(this)
|
|
||||||
}
|
|
||||||
.setSmallIcon(android.R.drawable.ic_menu_share)
|
.setSmallIcon(android.R.drawable.ic_menu_share)
|
||||||
.setContentTitle("Tensamin is sharing your screen")
|
.setContentTitle("Tensamin is sharing your screen")
|
||||||
.setContentText("Tap Stop to end screen sharing")
|
.setContentText("Tap Stop to end screen sharing")
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
.setCategory(android.app.Notification.CATEGORY_SERVICE)
|
.setCategory(NotificationCompat.CATEGORY_SERVICE)
|
||||||
.addAction(android.R.drawable.ic_media_pause, "Stop", stopPendingIntent)
|
.addAction(android.R.drawable.ic_media_pause, "Stop", stopPendingIntent)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,32 @@ import android.app.Service
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.pm.ServiceInfo
|
import android.content.pm.ServiceInfo
|
||||||
|
import android.net.ConnectivityManager
|
||||||
|
import android.net.Network
|
||||||
|
import android.net.NetworkCapabilities
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.IBinder
|
import android.os.IBinder
|
||||||
|
import android.os.Process
|
||||||
|
import android.os.SystemClock
|
||||||
import androidx.core.app.NotificationCompat
|
import androidx.core.app.NotificationCompat
|
||||||
|
|
||||||
class MtpForegroundService : Service() {
|
class MtpForegroundService : Service() {
|
||||||
|
private var started = false
|
||||||
|
private val networkCallback = object : ConnectivityManager.NetworkCallback() {
|
||||||
|
override fun onAvailable(network: Network) = refreshNotification()
|
||||||
|
override fun onLost(network: Network) = refreshNotification()
|
||||||
|
override fun onCapabilitiesChanged(network: Network, capabilities: NetworkCapabilities) =
|
||||||
|
refreshNotification()
|
||||||
|
}
|
||||||
|
|
||||||
override fun onBind(intent: Intent?): IBinder? = null
|
override fun onBind(intent: Intent?): IBinder? = null
|
||||||
|
|
||||||
|
override fun onCreate() {
|
||||||
|
super.onCreate()
|
||||||
|
getSystemService(ConnectivityManager::class.java)
|
||||||
|
.registerDefaultNetworkCallback(networkCallback)
|
||||||
|
}
|
||||||
|
|
||||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||||
if (intent?.action == ACTION_STOP) {
|
if (intent?.action == ACTION_STOP) {
|
||||||
MtpSecureStore.setEnabled(this, false)
|
MtpSecureStore.setEnabled(this, false)
|
||||||
|
|
@ -23,8 +42,11 @@ class MtpForegroundService : Service() {
|
||||||
return START_NOT_STICKY
|
return START_NOT_STICKY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (started) return START_STICKY
|
||||||
|
|
||||||
createChannel(this)
|
createChannel(this)
|
||||||
val notification = buildNotification(this, "Connecting")
|
connectionStatus = "Connecting"
|
||||||
|
val notification = buildNotification(this, displayedStatus(this))
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||||
startForeground(
|
startForeground(
|
||||||
NOTIFICATION_ID,
|
NOTIFICATION_ID,
|
||||||
|
|
@ -44,6 +66,7 @@ class MtpForegroundService : Service() {
|
||||||
try {
|
try {
|
||||||
NativeMtpBridge.nativeAttach(applicationContext)
|
NativeMtpBridge.nativeAttach(applicationContext)
|
||||||
NativeMtpBridge.nativeStart(config)
|
NativeMtpBridge.nativeStart(config)
|
||||||
|
started = true
|
||||||
NativeMtpBridge.log(2, "Started MTP foreground service")
|
NativeMtpBridge.log(2, "Started MTP foreground service")
|
||||||
} catch (error: Throwable) {
|
} catch (error: Throwable) {
|
||||||
NativeMtpBridge.log(0, "Failed to start MTP foreground service", error)
|
NativeMtpBridge.log(0, "Failed to start MTP foreground service", error)
|
||||||
|
|
@ -52,21 +75,57 @@ class MtpForegroundService : Service() {
|
||||||
return START_STICKY
|
return START_STICKY
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onTaskRemoved(rootIntent: Intent?) {
|
||||||
|
val preferences = getSharedPreferences(SERVICE_PREFERENCES, Context.MODE_PRIVATE)
|
||||||
|
val now = SystemClock.elapsedRealtime()
|
||||||
|
if (now - preferences.getLong(LAST_TASK_RESTART, 0) < TASK_RESTART_COOLDOWN_MS) {
|
||||||
|
super.onTaskRemoved(rootIntent)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
preferences.edit().putLong(LAST_TASK_RESTART, now).commit()
|
||||||
|
if (MtpSecureStore.isEnabled(this) && MtpSecureStore.hasConfig(this)) {
|
||||||
|
startService(Intent(this, MtpForegroundService::class.java))
|
||||||
|
}
|
||||||
|
super.onTaskRemoved(rootIntent)
|
||||||
|
// Tauri cannot recreate its WebView after the UI task is removed while this process survives.
|
||||||
|
Process.killProcess(Process.myPid())
|
||||||
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
|
getSystemService(ConnectivityManager::class.java).unregisterNetworkCallback(networkCallback)
|
||||||
if (!MtpSecureStore.isEnabled(this)) NativeMtpBridge.nativeStop()
|
if (!MtpSecureStore.isEnabled(this)) NativeMtpBridge.nativeStop()
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun refreshNotification() {
|
||||||
|
updateNotification(this, connectionStatus)
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val CHANNEL_ID = "tensamin-connection"
|
private const val CHANNEL_ID = "tensamin-connection"
|
||||||
private const val NOTIFICATION_ID = 2201
|
private const val NOTIFICATION_ID = 2201
|
||||||
private const val ACTION_STOP = "net.tensamin.client.STOP_MTP"
|
private const val ACTION_STOP = "net.tensamin.client.STOP_MTP"
|
||||||
|
private const val SERVICE_PREFERENCES = "tensamin-service"
|
||||||
|
private const val LAST_TASK_RESTART = "last-task-restart"
|
||||||
|
private const val TASK_RESTART_COOLDOWN_MS = 15_000L
|
||||||
|
@Volatile private var connectionStatus = "Connecting"
|
||||||
|
|
||||||
fun updateNotification(context: Context, status: String) {
|
fun updateNotification(context: Context, status: String) {
|
||||||
if (!MtpSecureStore.isEnabled(context)) return
|
if (!MtpSecureStore.isEnabled(context)) return
|
||||||
|
connectionStatus = status
|
||||||
createChannel(context)
|
createChannel(context)
|
||||||
context.getSystemService(NotificationManager::class.java)
|
context.getSystemService(NotificationManager::class.java)
|
||||||
.notify(NOTIFICATION_ID, buildNotification(context, status))
|
.notify(NOTIFICATION_ID, buildNotification(context, displayedStatus(context)))
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun displayedStatus(context: Context): String {
|
||||||
|
val connectivity = context.getSystemService(ConnectivityManager::class.java)
|
||||||
|
val network = connectivity.activeNetwork ?: return "No network"
|
||||||
|
val capabilities = connectivity.getNetworkCapabilities(network) ?: return "No network"
|
||||||
|
return if (
|
||||||
|
capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) &&
|
||||||
|
capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED)
|
||||||
|
) connectionStatus else "No network"
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createChannel(context: Context) {
|
private fun createChannel(context: Context) {
|
||||||
|
|
@ -95,7 +154,7 @@ class MtpForegroundService : Service() {
|
||||||
)
|
)
|
||||||
return NotificationCompat.Builder(context, CHANNEL_ID)
|
return NotificationCompat.Builder(context, CHANNEL_ID)
|
||||||
.setSmallIcon(android.R.drawable.stat_notify_sync)
|
.setSmallIcon(android.R.drawable.stat_notify_sync)
|
||||||
.setContentTitle("Tensamin background connection")
|
.setContentTitle("Tensamin")
|
||||||
.setContentText(status)
|
.setContentText(status)
|
||||||
.setContentIntent(openIntent)
|
.setContentIntent(openIntent)
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package net.tensamin.client
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.webkit.WebView
|
||||||
|
import androidx.annotation.Keep
|
||||||
|
import java.lang.ref.WeakReference
|
||||||
|
|
||||||
|
@Keep
|
||||||
|
object NativeAccessibilityBridge {
|
||||||
|
const val DEFAULT_INITIAL_SCALE = 290
|
||||||
|
private const val MIN_INITIAL_SCALE = 210
|
||||||
|
private const val MAX_INITIAL_SCALE = 500
|
||||||
|
private const val PREFERENCES = "tensamin-accessibility"
|
||||||
|
private const val INITIAL_SCALE = "initial-scale"
|
||||||
|
|
||||||
|
private var webView = WeakReference<WebView>(null)
|
||||||
|
|
||||||
|
init {
|
||||||
|
System.loadLibrary("mobile_lib")
|
||||||
|
}
|
||||||
|
|
||||||
|
@JvmStatic external fun nativeAttach(context: Context)
|
||||||
|
|
||||||
|
fun attach(webView: WebView) {
|
||||||
|
this.webView = WeakReference(webView)
|
||||||
|
webView.setInitialScale(getInitialScale(webView.context))
|
||||||
|
}
|
||||||
|
|
||||||
|
fun detach(webView: WebView) {
|
||||||
|
if (this.webView.get() === webView) this.webView.clear()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getInitialScale(context: Context): Int {
|
||||||
|
val preferences = context.getSharedPreferences(PREFERENCES, Context.MODE_PRIVATE)
|
||||||
|
val storedScale = preferences.getInt(INITIAL_SCALE, DEFAULT_INITIAL_SCALE)
|
||||||
|
val scale = storedScale.coerceIn(MIN_INITIAL_SCALE, MAX_INITIAL_SCALE)
|
||||||
|
if (scale != storedScale) preferences.edit().putInt(INITIAL_SCALE, scale).apply()
|
||||||
|
return scale
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setInitialScale(context: Context, initialScale: Int) {
|
||||||
|
val nextScale = initialScale.coerceIn(MIN_INITIAL_SCALE, MAX_INITIAL_SCALE)
|
||||||
|
context.getSharedPreferences(PREFERENCES, Context.MODE_PRIVATE)
|
||||||
|
.edit()
|
||||||
|
.putInt(INITIAL_SCALE, nextScale)
|
||||||
|
.apply()
|
||||||
|
webView.get()?.let { currentWebView ->
|
||||||
|
currentWebView.post { currentWebView.setInitialScale(nextScale) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -6,6 +6,7 @@ import android.app.NotificationManager
|
||||||
import android.app.PendingIntent
|
import android.app.PendingIntent
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.graphics.BitmapFactory
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.PowerManager
|
import android.os.PowerManager
|
||||||
|
|
@ -13,7 +14,12 @@ import android.provider.Settings
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.annotation.Keep
|
import androidx.annotation.Keep
|
||||||
import androidx.core.app.NotificationCompat
|
import androidx.core.app.NotificationCompat
|
||||||
|
import androidx.core.app.Person
|
||||||
|
import androidx.core.content.LocusIdCompat
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
|
import androidx.core.content.pm.ShortcutInfoCompat
|
||||||
|
import androidx.core.content.pm.ShortcutManagerCompat
|
||||||
|
import androidx.core.graphics.drawable.IconCompat
|
||||||
|
|
||||||
@Keep
|
@Keep
|
||||||
object NativeMtpBridge {
|
object NativeMtpBridge {
|
||||||
|
|
@ -85,6 +91,7 @@ object NativeMtpBridge {
|
||||||
senderId: Long,
|
senderId: Long,
|
||||||
sender: String,
|
sender: String,
|
||||||
body: String,
|
body: String,
|
||||||
|
avatar: ByteArray,
|
||||||
) {
|
) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
context.getSystemService(NotificationManager::class.java).createNotificationChannel(
|
context.getSystemService(NotificationManager::class.java).createNotificationChannel(
|
||||||
|
|
@ -107,11 +114,36 @@ object NativeMtpBridge {
|
||||||
openIntent,
|
openIntent,
|
||||||
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE,
|
||||||
)
|
)
|
||||||
|
val avatarBitmap = avatar.takeIf { it.isNotEmpty() }?.let {
|
||||||
|
BitmapFactory.decodeByteArray(it, 0, it.size)
|
||||||
|
}
|
||||||
|
val avatarIcon = avatarBitmap?.let(IconCompat::createWithAdaptiveBitmap)
|
||||||
|
val person = Person.Builder()
|
||||||
|
.setName(sender)
|
||||||
|
.setKey(senderId.toString())
|
||||||
|
.setIcon(avatarIcon)
|
||||||
|
.build()
|
||||||
|
val shortcutId = "chat-$senderId"
|
||||||
|
val shortcut = ShortcutInfoCompat.Builder(context, shortcutId)
|
||||||
|
.setShortLabel(sender)
|
||||||
|
.setLongLived(true)
|
||||||
|
.setPerson(person)
|
||||||
|
.setIntent(openIntent)
|
||||||
|
.apply { if (avatarIcon != null) setIcon(avatarIcon) }
|
||||||
|
.build()
|
||||||
|
ShortcutManagerCompat.pushDynamicShortcut(context, shortcut)
|
||||||
|
|
||||||
|
val style = NotificationCompat.MessagingStyle(
|
||||||
|
Person.Builder().setName("You").build(),
|
||||||
|
).addMessage(body, System.currentTimeMillis(), person)
|
||||||
val notification = NotificationCompat.Builder(context, MESSAGE_CHANNEL)
|
val notification = NotificationCompat.Builder(context, MESSAGE_CHANNEL)
|
||||||
.setSmallIcon(android.R.drawable.sym_action_chat)
|
.setSmallIcon(R.drawable.ic_notification_small)
|
||||||
.setContentTitle(sender)
|
.setContentTitle(sender)
|
||||||
.setContentText(body)
|
.setContentText(body)
|
||||||
.setStyle(NotificationCompat.BigTextStyle().bigText(body))
|
.setStyle(style)
|
||||||
|
.setShortcutId(shortcutId)
|
||||||
|
.setLocusId(LocusIdCompat(shortcutId))
|
||||||
|
.setLargeIcon(avatarBitmap)
|
||||||
.setCategory(Notification.CATEGORY_MESSAGE)
|
.setCategory(Notification.CATEGORY_MESSAGE)
|
||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
.setContentIntent(pendingIntent)
|
.setContentIntent(pendingIntent)
|
||||||
|
|
@ -121,4 +153,9 @@ object NativeMtpBridge {
|
||||||
.notify(senderId.hashCode(), notification)
|
.notify(senderId.hashCode(), notification)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun cancelMessageNotification(context: Context, senderId: Long) {
|
||||||
|
context.getSystemService(NotificationManager::class.java)
|
||||||
|
.cancel(senderId.hashCode())
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
After Width: | Height: | Size: 8.3 KiB |
|
|
@ -1,4 +1,4 @@
|
||||||
import com.android.build.gradle.LibraryExtension
|
import com.android.build.api.dsl.LibraryExtension
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
|
|
@ -7,7 +7,7 @@ buildscript {
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("com.android.tools.build:gradle:8.11.0")
|
classpath("com.android.tools.build:gradle:8.11.0")
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25")
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.20")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,4 +20,3 @@ dependencies {
|
||||||
compileOnly(gradleApi())
|
compileOnly(gradleApi())
|
||||||
implementation("com.android.tools.build:gradle:8.11.0")
|
implementation("com.android.tools.build:gradle:8.11.0")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,12 @@ import org.gradle.api.GradleException
|
||||||
import org.gradle.api.logging.LogLevel
|
import org.gradle.api.logging.LogLevel
|
||||||
import org.gradle.api.tasks.Input
|
import org.gradle.api.tasks.Input
|
||||||
import org.gradle.api.tasks.TaskAction
|
import org.gradle.api.tasks.TaskAction
|
||||||
|
import org.gradle.process.ExecOperations
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
open class BuildTask : DefaultTask() {
|
open class BuildTask @Inject constructor(
|
||||||
|
private val execOperations: ExecOperations,
|
||||||
|
) : DefaultTask() {
|
||||||
@Input
|
@Input
|
||||||
var rootDirRel: String? = null
|
var rootDirRel: String? = null
|
||||||
@Input
|
@Input
|
||||||
|
|
@ -50,7 +54,7 @@ open class BuildTask : DefaultTask() {
|
||||||
val release = release ?: throw GradleException("release cannot be null")
|
val release = release ?: throw GradleException("release cannot be null")
|
||||||
val args = listOf("tauri", "android", "android-studio-script");
|
val args = listOf("tauri", "android", "android-studio-script");
|
||||||
|
|
||||||
project.exec {
|
execOperations.exec {
|
||||||
workingDir(File(project.projectDir, rootDirRel))
|
workingDir(File(project.projectDir, rootDirRel))
|
||||||
executable(executable)
|
executable(executable)
|
||||||
args(args)
|
args(args)
|
||||||
|
|
@ -65,4 +69,4 @@ open class BuildTask : DefaultTask() {
|
||||||
args(listOf("--target", target))
|
args(listOf("--target", target))
|
||||||
}.assertNormalExitValue()
|
}.assertNormalExitValue()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#Tue May 10 19:22:52 CST 2022
|
#Tue May 10 19:22:52 CST 2022
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|
|
||||||
135
apps/tauri/src-tauri/src/accessibility_backend.rs
Normal file
|
|
@ -0,0 +1,135 @@
|
||||||
|
#[cfg(not(target_os = "android"))]
|
||||||
|
const DEFAULT_INITIAL_SCALE: i32 = 290;
|
||||||
|
const MIN_INITIAL_SCALE: i32 = 210;
|
||||||
|
const MAX_INITIAL_SCALE: i32 = 500;
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub fn accessibility_get_initial_scale() -> Result<i32, String> {
|
||||||
|
android_get_initial_scale()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub fn accessibility_set_initial_scale(initial_scale: i32) -> Result<(), String> {
|
||||||
|
if !(MIN_INITIAL_SCALE..=MAX_INITIAL_SCALE).contains(&initial_scale) {
|
||||||
|
return Err(format!(
|
||||||
|
"Initial scale must be between {MIN_INITIAL_SCALE} and {MAX_INITIAL_SCALE}"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
android_set_initial_scale(initial_scale)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "android"))]
|
||||||
|
fn android_get_initial_scale() -> Result<i32, String> {
|
||||||
|
Ok(DEFAULT_INITIAL_SCALE)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "android"))]
|
||||||
|
fn android_set_initial_scale(_: i32) -> Result<(), String> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "android")]
|
||||||
|
mod android {
|
||||||
|
use std::sync::OnceLock;
|
||||||
|
|
||||||
|
use jni::{
|
||||||
|
jni_sig, jni_str,
|
||||||
|
objects::{Global, JClass, JObject, JValue},
|
||||||
|
Env, EnvUnowned, JavaVM,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Host {
|
||||||
|
vm: JavaVM,
|
||||||
|
context: Global<JObject<'static>>,
|
||||||
|
bridge: Global<JObject<'static>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
static HOST: OnceLock<Host> = OnceLock::new();
|
||||||
|
|
||||||
|
fn attach(env: &mut Env, context: JObject) -> Result<(), String> {
|
||||||
|
if HOST.get().is_some() {
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
let class = env
|
||||||
|
.find_class(jni_str!("net/tensamin/client/NativeAccessibilityBridge"))
|
||||||
|
.map_err(|error| error.to_string())?;
|
||||||
|
let bridge = env
|
||||||
|
.get_static_field(
|
||||||
|
class,
|
||||||
|
jni_str!("INSTANCE"),
|
||||||
|
jni_sig!("Lnet/tensamin/client/NativeAccessibilityBridge;"),
|
||||||
|
)
|
||||||
|
.and_then(|value| value.l())
|
||||||
|
.map_err(|error| error.to_string())?;
|
||||||
|
|
||||||
|
HOST.set(Host {
|
||||||
|
vm: env.get_java_vm().map_err(|error| error.to_string())?,
|
||||||
|
context: env
|
||||||
|
.new_global_ref(context)
|
||||||
|
.map_err(|error| error.to_string())?,
|
||||||
|
bridge: env
|
||||||
|
.new_global_ref(bridge)
|
||||||
|
.map_err(|error| error.to_string())?,
|
||||||
|
})
|
||||||
|
.map_err(|_| "Android accessibility host is already attached".to_string())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn with_env<T>(call: impl FnOnce(&mut Env, &Host) -> Result<T, String>) -> Result<T, String> {
|
||||||
|
let host = HOST
|
||||||
|
.get()
|
||||||
|
.ok_or("Android accessibility host is not attached")?;
|
||||||
|
host.vm
|
||||||
|
.attach_current_thread(|env| Ok::<_, jni::errors::Error>(call(env, host)))
|
||||||
|
.map_err(|error| error.to_string())?
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_initial_scale() -> Result<i32, String> {
|
||||||
|
with_env(|env, host| {
|
||||||
|
env.call_method(
|
||||||
|
host.bridge.as_obj(),
|
||||||
|
jni_str!("getInitialScale"),
|
||||||
|
jni_sig!("(Landroid/content/Context;)I"),
|
||||||
|
&[JValue::Object(host.context.as_obj())],
|
||||||
|
)
|
||||||
|
.and_then(|value| value.i())
|
||||||
|
.map_err(|error| error.to_string())
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn set_initial_scale(initial_scale: i32) -> Result<(), String> {
|
||||||
|
with_env(|env, host| {
|
||||||
|
env.call_method(
|
||||||
|
host.bridge.as_obj(),
|
||||||
|
jni_str!("setInitialScale"),
|
||||||
|
jni_sig!("(Landroid/content/Context;I)V"),
|
||||||
|
&[
|
||||||
|
JValue::Object(host.context.as_obj()),
|
||||||
|
JValue::Int(initial_scale),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
.map_err(|error| error.to_string())?;
|
||||||
|
Ok(())
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "system" fn Java_net_tensamin_client_NativeAccessibilityBridge_nativeAttach<
|
||||||
|
'caller,
|
||||||
|
>(
|
||||||
|
mut env: EnvUnowned<'caller>,
|
||||||
|
_class: JClass,
|
||||||
|
context: JObject<'caller>,
|
||||||
|
) {
|
||||||
|
let _ = env.with_env(|env| {
|
||||||
|
let _ = attach(env, context);
|
||||||
|
Ok::<_, jni::errors::Error>(())
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "android")]
|
||||||
|
use android::{
|
||||||
|
get_initial_scale as android_get_initial_scale, set_initial_scale as android_set_initial_scale,
|
||||||
|
};
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
mod accessibility_backend;
|
||||||
mod mtp_backend;
|
mod mtp_backend;
|
||||||
|
|
||||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||||
|
|
@ -14,11 +15,10 @@ pub fn run() {
|
||||||
.plugin(tauri_plugin_deep_link::init())
|
.plugin(tauri_plugin_deep_link::init())
|
||||||
.plugin(tauri_plugin_opener::init());
|
.plugin(tauri_plugin_opener::init());
|
||||||
|
|
||||||
#[cfg(any(target_os = "ios", target_os = "android"))]
|
let app = builder
|
||||||
let builder = builder.plugin(tauri_plugin_barcode_scanner::init());
|
|
||||||
|
|
||||||
if let Err(error) = builder
|
|
||||||
.invoke_handler(tauri::generate_handler![
|
.invoke_handler(tauri::generate_handler![
|
||||||
|
accessibility_backend::accessibility_get_initial_scale,
|
||||||
|
accessibility_backend::accessibility_set_initial_scale,
|
||||||
mtp_backend::mtp_request,
|
mtp_backend::mtp_request,
|
||||||
mtp_backend::mtp_status,
|
mtp_backend::mtp_status,
|
||||||
mtp_backend::mtp_store_credentials,
|
mtp_backend::mtp_store_credentials,
|
||||||
|
|
@ -26,6 +26,7 @@ pub fn run() {
|
||||||
mtp_backend::mtp_load_keyring,
|
mtp_backend::mtp_load_keyring,
|
||||||
mtp_backend::mtp_set_enabled,
|
mtp_backend::mtp_set_enabled,
|
||||||
mtp_backend::mtp_set_ui_visible,
|
mtp_backend::mtp_set_ui_visible,
|
||||||
|
mtp_backend::mtp_post_message_notification,
|
||||||
mtp_backend::mtp_is_ignoring_battery_optimizations,
|
mtp_backend::mtp_is_ignoring_battery_optimizations,
|
||||||
mtp_backend::mtp_request_battery_exemption,
|
mtp_backend::mtp_request_battery_exemption,
|
||||||
])
|
])
|
||||||
|
|
@ -45,9 +46,18 @@ pub fn run() {
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
})
|
})
|
||||||
.run(tauri::generate_context!())
|
.build(tauri::generate_context!())
|
||||||
{
|
.expect("error while building tauri application");
|
||||||
eprintln!("error while running tauri application: {error}");
|
|
||||||
panic!("error while running tauri application: {error}");
|
app.run(|_app, event| {
|
||||||
}
|
#[cfg(target_os = "android")]
|
||||||
|
if let tauri::RunEvent::ExitRequested {
|
||||||
|
api, code: None, ..
|
||||||
|
} = event
|
||||||
|
{
|
||||||
|
if mtp_backend::manager().is_enabled() {
|
||||||
|
api.prevent_exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
|
||||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||||
|
|
||||||
use lib::log;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
mobile_lib::run();
|
mobile_lib::run();
|
||||||
log("Test test 123")
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,11 @@ import { getCurrent, onOpenUrl } from "@tauri-apps/plugin-deep-link";
|
||||||
import { isTauri } from "@tauri-apps/api/core";
|
import { isTauri } from "@tauri-apps/api/core";
|
||||||
import { useIsMobile } from "@methanium/ui";
|
import { useIsMobile } from "@methanium/ui";
|
||||||
|
|
||||||
type DeeplinkContextValue = {
|
|
||||||
deeplinks: readonly string[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export const deeplinkContext = createContext<DeeplinkContextValue | undefined>(
|
|
||||||
|
export const deeplinkContext = createContext<{
|
||||||
|
deeplinks: readonly string[];
|
||||||
|
} | undefined>(
|
||||||
undefined,
|
undefined,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
import {
|
|
||||||
scan,
|
|
||||||
Format,
|
|
||||||
requestPermissions,
|
|
||||||
} from "@tauri-apps/plugin-barcode-scanner";
|
|
||||||
import { Button } from "@methanium/ui";
|
|
||||||
|
|
||||||
import { toast } from "@tensamin/shared/log";
|
|
||||||
|
|
||||||
export default function QrCodeScanner({
|
|
||||||
onData,
|
|
||||||
}: {
|
|
||||||
onData: (data: string) => void;
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
<Button
|
|
||||||
onClick={() => {
|
|
||||||
requestPermissions()
|
|
||||||
.catch((err) => {
|
|
||||||
toast("error", err.message);
|
|
||||||
})
|
|
||||||
.then(() =>
|
|
||||||
scan({ windowed: false, formats: [Format.QRCode] })
|
|
||||||
.catch((err) => {
|
|
||||||
toast("error", err.message);
|
|
||||||
})
|
|
||||||
.then((data) => {
|
|
||||||
if (data) {
|
|
||||||
onData(data.content);
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Open QR Code Scanner
|
|
||||||
</Button>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -2,8 +2,11 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
|
<link rel="icon" href="./favicon.ico" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta
|
||||||
|
name="viewport"
|
||||||
|
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
|
||||||
|
/>
|
||||||
<title>Tensamin</title>
|
<title>Tensamin</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
|
|
@ -6,141 +6,58 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"format": "pnpm exec prettier --write .",
|
"format": "pnpm exec prettier --write .",
|
||||||
"lint": "eslint src",
|
"lint": "eslint src",
|
||||||
"dev": "vite --port 3000 --host 0.0.0.0",
|
"dev": "vite",
|
||||||
"test": "vitest run --passWithNoTests",
|
"test": "vitest run --passWithNoTests",
|
||||||
"build": "pnpm run test && tsc -b && vite build",
|
"build": "pnpm --filter @tensamin/pwa build && pnpm run test && tsc -b && vite build",
|
||||||
"preview": "cd dist && nix-shell -p python3 --run 'python3 -m http.server 3000' && cd .."
|
"preview": "cd dist && nix-shell -p python3 --run 'python3 -m http.server 3000' && cd .."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@base-ui/react": "^1.0.0",
|
"@fontsource-variable/public-sans": "^5.3.0",
|
||||||
"@base-ui/utils": "0.3.1",
|
"@methanium/ui": "*",
|
||||||
"@babel/runtime": "^7.29.2",
|
"@tailwindcss/vite": "^4.3.3",
|
||||||
"@fontsource-variable/inter": "^5.2.8",
|
"@tanstack/react-router": "^1.170.21",
|
||||||
"@fontsource-variable/public-sans": "^5.2.7",
|
"@tanstack/react-virtual": "^3.14.9",
|
||||||
"@floating-ui/core": "^1.7.0",
|
"@tauri-apps/api": "^2.11.1",
|
||||||
"@floating-ui/dom": "^1.7.0",
|
"@tensamin/pwa": "workspace:*",
|
||||||
"@floating-ui/react-dom": "^2.1.8",
|
|
||||||
"@floating-ui/utils": "^0.2.11",
|
|
||||||
"@radix-ui/primitive": "^1.1.0",
|
|
||||||
"@radix-ui/react-compose-refs": "^1.1.1",
|
|
||||||
"@radix-ui/react-context": "^1.1.4",
|
|
||||||
"@radix-ui/react-dialog": "^1.1.6",
|
|
||||||
"@radix-ui/react-dismissable-layer": "^1.1.11",
|
|
||||||
"@radix-ui/react-focus-guards": "^1.1.4",
|
|
||||||
"@radix-ui/react-focus-scope": "^1.1.11",
|
|
||||||
"@radix-ui/react-id": "^1.1.0",
|
|
||||||
"@radix-ui/react-portal": "^1.1.13",
|
|
||||||
"@radix-ui/react-presence": "^1.1.6",
|
|
||||||
"@radix-ui/react-primitive": "^2.0.2",
|
|
||||||
"@radix-ui/react-slot": "^1.1.2",
|
|
||||||
"@radix-ui/react-use-callback-ref": "^1.1.1",
|
|
||||||
"@radix-ui/react-use-controllable-state": "^1.2.3",
|
|
||||||
"@radix-ui/react-use-effect-event": "^0.0.2",
|
|
||||||
"@radix-ui/react-use-layout-effect": "^1.1.0",
|
|
||||||
"@reduxjs/toolkit": "^2.0.0",
|
|
||||||
"@tailwindcss/vite": "^4.2.4",
|
|
||||||
"@tanstack/devtools-event-client": "^0.3.0",
|
|
||||||
"@tanstack/query-core": "^5.0.0",
|
|
||||||
"@tanstack/react-router": "^1.169.1",
|
|
||||||
"@tanstack/history": "1.162.0",
|
|
||||||
"@tanstack/react-store": "^0.9.3",
|
|
||||||
"@tanstack/router-core": "^1.169.1",
|
|
||||||
"@tanstack/store": "^0.9.3",
|
|
||||||
"@tanstack/virtual-core": "^3.13.24",
|
|
||||||
"@tanstack/react-virtual": "^3.13.24",
|
|
||||||
"@tauri-apps/api": "^2",
|
|
||||||
"@tensamin/call": "workspace:*",
|
|
||||||
"@tensamin/cache": "workspace:*",
|
"@tensamin/cache": "workspace:*",
|
||||||
|
"@tensamin/call": "workspace:*",
|
||||||
"@tensamin/chat": "workspace:*",
|
"@tensamin/chat": "workspace:*",
|
||||||
"@tensamin/crypto": "workspace:*",
|
"@tensamin/crypto": "workspace:*",
|
||||||
"@tensamin/hotkeys": "workspace:*",
|
"@tensamin/hotkeys": "workspace:*",
|
||||||
"@tensamin/shared": "workspace:*",
|
|
||||||
"@tensamin/settings": "workspace:*",
|
|
||||||
"@tensamin/storage": "workspace:*",
|
|
||||||
"@tensamin/tauri": "workspace:*",
|
|
||||||
"@tensamin/mtp": "workspace:*",
|
"@tensamin/mtp": "workspace:*",
|
||||||
"@tensamin/tauth": "workspace:*",
|
|
||||||
"@tensamin/markdown": "workspace:*",
|
|
||||||
"@methanium/ui": "*",
|
|
||||||
"@tensamin/user": "workspace:*",
|
|
||||||
"@tensamin/notifications": "workspace:*",
|
"@tensamin/notifications": "workspace:*",
|
||||||
"@tensamin/onboarding": "workspace:*",
|
"@tensamin/onboarding": "workspace:*",
|
||||||
"aria-hidden": "^1.2.4",
|
"@tensamin/settings": "workspace:*",
|
||||||
"class-variance-authority": "^0.7.1",
|
"@tensamin/shared": "workspace:*",
|
||||||
"clsx": "^2.1.1",
|
"@tensamin/storage": "workspace:*",
|
||||||
"cmdk": "^1.1.1",
|
"@tensamin/tauri": "workspace:*",
|
||||||
"cookie-es": "^3.0.0",
|
"@tensamin/tauth": "workspace:*",
|
||||||
"d3-array": "^3.1.6",
|
"@tensamin/user": "workspace:*",
|
||||||
"d3-color": "^3.1.0",
|
|
||||||
"d3-ease": "^3.0.1",
|
|
||||||
"d3-format": "^3.1.0",
|
|
||||||
"d3-interpolate": "^3.0.1",
|
|
||||||
"d3-path": "^3.0.1",
|
|
||||||
"d3-scale": "^4.0.2",
|
|
||||||
"d3-shape": "^3.1.0",
|
|
||||||
"d3-time": "^3.0.0",
|
|
||||||
"d3-time-format": "^4.1.0",
|
|
||||||
"d3-timer": "^3.0.1",
|
|
||||||
"date-fns": "^4.4.0",
|
|
||||||
"decimal.js-light": "^2.5.1",
|
"decimal.js-light": "^2.5.1",
|
||||||
"detect-node-es": "^1.1.0",
|
"eventemitter3": "^5.0.4",
|
||||||
"dijkstrajs": "^1.0.1",
|
"lucide-react": "^1.29.0",
|
||||||
"embla-carousel": "8.6.0",
|
"react": "^19.2.8",
|
||||||
"embla-carousel-react": "^8.6.0",
|
"react-dom": "^19.2.8",
|
||||||
"embla-carousel-reactive-utils": "8.6.0",
|
"react-is": "^19.2.8",
|
||||||
"es-toolkit": "^1.39.3",
|
"react-redux": "^9.3.0",
|
||||||
"eventemitter3": "^5.0.1",
|
|
||||||
"get-nonce": "^1.0.1",
|
|
||||||
"immer": "^10.1.1",
|
|
||||||
"input-otp": "^1.4.2",
|
|
||||||
"internmap": "^2.0.3",
|
|
||||||
"tw-animate-css": "^1.4.0",
|
|
||||||
"lucide-react": "^1.14.0",
|
|
||||||
"next-themes": "^0.4.6",
|
|
||||||
"pngjs": "^5.0.0",
|
|
||||||
"qrcode": "^1.5.4",
|
|
||||||
"react": "^19.2.0",
|
|
||||||
"react-day-picker": "^10.0.1",
|
|
||||||
"react-dom": "^19.2.0",
|
|
||||||
"react-is": "^19.0.0",
|
|
||||||
"react-redux": "^9.0.0",
|
|
||||||
"react-remove-scroll": "^2.7.2",
|
|
||||||
"react-remove-scroll-bar": "^2.3.7",
|
|
||||||
"react-resizable-panels": "^4.11.2",
|
|
||||||
"react-style-singleton": "^2.2.3",
|
|
||||||
"recharts": "3.8.1",
|
|
||||||
"redux": "^5.0.0",
|
|
||||||
"redux-thunk": "^3.1.0",
|
|
||||||
"reselect": "5.1.1",
|
|
||||||
"scheduler": "^0.27.0",
|
|
||||||
"seroval": "^1.5.4",
|
|
||||||
"seroval-plugins": "^1.5.4",
|
|
||||||
"shadcn": "^4.11.0",
|
|
||||||
"sonner": "^2.0.7",
|
|
||||||
"tailwindcss": "^4.2.4",
|
|
||||||
"tailwind-merge": "^3.6.0",
|
|
||||||
"tailwind-scrollbar-hide": "^4.0.0",
|
"tailwind-scrollbar-hide": "^4.0.0",
|
||||||
"tiny-invariant": "^1.3.3",
|
"tailwindcss": "^4.3.3",
|
||||||
"tslib": "^2.8.1",
|
"tw-animate-css": "^1.4.0",
|
||||||
"use-callback-ref": "^1.3.3",
|
"use-sync-external-store": "^1.6.0",
|
||||||
"use-sidecar": "^1.1.3",
|
"zod": "^4.4.3"
|
||||||
"use-sync-external-store": "^1.2.2",
|
|
||||||
"vaul": "^1.1.2",
|
|
||||||
"victory-vendor": "^37.0.2",
|
|
||||||
"yargs": "^15.3.1",
|
|
||||||
"zod": "^4.3.6"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@types/qrcode": "^1.5.6",
|
"@types/qrcode": "^1.5.6",
|
||||||
"@types/react": "^19.2.2",
|
"@types/react": "^19.2.18",
|
||||||
"@types/react-dom": "^19.2.2",
|
"@types/react-dom": "^19.2.4",
|
||||||
"@vitejs/plugin-react": "^6.0.1",
|
"@vitejs/plugin-react": "^6.0.5",
|
||||||
"esbuild": "^0.25.11",
|
"esbuild": "^0.28.1",
|
||||||
"eslint": "^10.0.3",
|
"eslint": "^10.8.0",
|
||||||
"globals": "^17.4.0",
|
"globals": "^17.9.0",
|
||||||
|
"mtp": "*",
|
||||||
"typescript": "~6.0.3",
|
"typescript": "~6.0.3",
|
||||||
"typescript-eslint": "^8.57.0",
|
"typescript-eslint": "^8.66.0",
|
||||||
"vite": "^8.0.10"
|
"vite": "^8.2.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,10 @@ export function Basic({
|
||||||
user,
|
user,
|
||||||
extra,
|
extra,
|
||||||
}: {
|
}: {
|
||||||
user: User;
|
user: Pick<
|
||||||
|
User,
|
||||||
|
"Display" | "Username" | "Avatar" | "OnlineStatus" | "Status"
|
||||||
|
>;
|
||||||
extra?: React.ReactNode;
|
extra?: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const display = user.Display || user.Username || "Unknown";
|
const display = user.Display || user.Username || "Unknown";
|
||||||
|
|
@ -57,8 +60,9 @@ export function Basic({
|
||||||
</TooltipContent>
|
</TooltipContent>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex w-full flex-col items-start justify-center gap-1 text-[15px]">
|
<div className="flex w-full flex-col items-start justify-center text-[15px]">
|
||||||
<p>{display}</p>
|
<p>{display}</p>
|
||||||
|
<p className="text-xs text-muted-foreground">{user.Status}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="pr-1">{extra}</div>
|
<div className="pr-1">{extra}</div>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,23 @@
|
||||||
import type { User } from "@tensamin/user/context";
|
import type { User } from "@tensamin/user/context";
|
||||||
import { Avatar, AvatarFallback, AvatarImage, Button } from "@methanium/ui";
|
import { Avatar, AvatarFallback, AvatarImage, Button } from "@methanium/ui";
|
||||||
import Text from "@tensamin/markdown/text";
|
import { Text } from "@methanium/ui/markdown";
|
||||||
import { ChevronDown, ChevronUp } from "lucide-react";
|
import { ChevronDown, ChevronUp } from "lucide-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
export default function Profile({ user }: { user: User }) {
|
export default function Profile({
|
||||||
|
user,
|
||||||
|
}: {
|
||||||
|
user: Pick<
|
||||||
|
User,
|
||||||
|
| "UserId"
|
||||||
|
| "Display"
|
||||||
|
| "Username"
|
||||||
|
| "Avatar"
|
||||||
|
| "About"
|
||||||
|
| "IotaId"
|
||||||
|
| "PublicKey"
|
||||||
|
>;
|
||||||
|
}) {
|
||||||
const [showAdvancedInformation, setShowAdvancedInformation] = useState(false);
|
const [showAdvancedInformation, setShowAdvancedInformation] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ export default function Navbar({ forMobile }: { forMobile: boolean }) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
data-tauri-drag-region
|
data-tauri-drag-region
|
||||||
|
data-pwa-navbar
|
||||||
className={`${forMobile && "border-b"} pl-px w-full shrink-0 gap-2 h-13.5 flex items-center justify-between`}
|
className={`${forMobile && "border-b"} pl-px w-full shrink-0 gap-2 h-13.5 flex items-center justify-between`}
|
||||||
>
|
>
|
||||||
<div className="flex items-center justify-center gap-2">
|
<div className="flex items-center justify-center gap-2">
|
||||||
|
|
@ -91,6 +92,15 @@ export default function Navbar({ forMobile }: { forMobile: boolean }) {
|
||||||
{pathname === "/chat" && id && (
|
{pathname === "/chat" && id && (
|
||||||
<Wrapper
|
<Wrapper
|
||||||
userId={id}
|
userId={id}
|
||||||
|
fields={[
|
||||||
|
"UserId",
|
||||||
|
"Display",
|
||||||
|
"Username",
|
||||||
|
"Avatar",
|
||||||
|
"About",
|
||||||
|
"IotaId",
|
||||||
|
"PublicKey",
|
||||||
|
]}
|
||||||
component={(user) =>
|
component={(user) =>
|
||||||
isMobile ? (
|
isMobile ? (
|
||||||
<p className="font-medium text-[1.07rem]">{user?.Display}</p>
|
<p className="font-medium text-[1.07rem]">{user?.Display}</p>
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,11 @@ import {
|
||||||
useState,
|
useState,
|
||||||
} from "react";
|
} from "react";
|
||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { invoke, isTauri } from "@tauri-apps/api/core";
|
import { subscribeTuFileLaunch } from "@tensamin/pwa/runtime";
|
||||||
import QrCodeScanner from "@tensamin/tauri/qrCodeScanner";
|
import {
|
||||||
|
parseTuFileContent,
|
||||||
|
persistMtpCredentials,
|
||||||
|
} from "@tensamin/storage/credentials";
|
||||||
import { useNavigate } from "@tanstack/react-router";
|
import { useNavigate } from "@tanstack/react-router";
|
||||||
|
|
||||||
const fetchedUser = z.object({
|
const fetchedUser = z.object({
|
||||||
|
|
@ -35,55 +38,6 @@ const formSchema = z.object({
|
||||||
mtp_keyring: z.string().min(1).max(92),
|
mtp_keyring: z.string().min(1).max(92),
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* Parses a .tu file payload into credentials.
|
|
||||||
* @param rawFileContent UTF-8 file content from an uploaded .tu file.
|
|
||||||
* @returns Parsed user id and private key credentials.
|
|
||||||
*/
|
|
||||||
function parseTuFileContent(rawFileContent: string): {
|
|
||||||
userId: number;
|
|
||||||
privateKey: string;
|
|
||||||
domain: string | null;
|
|
||||||
} {
|
|
||||||
if (rawFileContent.trim().length === 0) {
|
|
||||||
throw new Error("File is empty");
|
|
||||||
} else if (!rawFileContent.includes("::")) {
|
|
||||||
throw new Error("Invalid file");
|
|
||||||
} else if (rawFileContent.split("::").length !== 2) {
|
|
||||||
throw new Error("Invalid file");
|
|
||||||
}
|
|
||||||
|
|
||||||
const left = rawFileContent.split("::")[0];
|
|
||||||
const right = rawFileContent.split("::")[1];
|
|
||||||
|
|
||||||
if (left.length === 0) {
|
|
||||||
throw new Error("Invalid file");
|
|
||||||
} else if (right.length === 0) {
|
|
||||||
throw new Error("Invalid file");
|
|
||||||
} else if (isNaN(Number(left)) && !left.includes("@")) {
|
|
||||||
throw new Error("Invalid file");
|
|
||||||
}
|
|
||||||
|
|
||||||
const [userIdString, privateKeyValue] = rawFileContent.split("::");
|
|
||||||
const privateKey = privateKeyValue.trim();
|
|
||||||
const userId = isNaN(Number(userIdString))
|
|
||||||
? Number(userIdString.split("@")[0])
|
|
||||||
: Number(userIdString);
|
|
||||||
|
|
||||||
const domain = userIdString.includes("@") ? userIdString.split("@")[1] : null;
|
|
||||||
|
|
||||||
if (!userId || !privateKey) {
|
|
||||||
throw new Error("Invalid file");
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log({
|
|
||||||
domain,
|
|
||||||
userId,
|
|
||||||
});
|
|
||||||
|
|
||||||
return { userId, privateKey, domain };
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Form() {
|
export default function Form() {
|
||||||
const isMobile = useIsMobile();
|
const isMobile = useIsMobile();
|
||||||
const uploadRef = useRef<HTMLInputElement | null>(null);
|
const uploadRef = useRef<HTMLInputElement | null>(null);
|
||||||
|
|
@ -97,27 +51,12 @@ export default function Form() {
|
||||||
if (loginPendingRef.current) return false;
|
if (loginPendingRef.current) return false;
|
||||||
loginPendingRef.current = true;
|
loginPendingRef.current = true;
|
||||||
try {
|
try {
|
||||||
if (domain) await save("omega_url", `https://${domain}/`);
|
await persistMtpCredentials({
|
||||||
if (isTauri()) {
|
storage: { load, save },
|
||||||
const [omegaUrl, forcedOmikronUrl, forcedOmikronPublicKey] =
|
userId,
|
||||||
await Promise.all([
|
keyring: privateKey,
|
||||||
domain ? `https://${domain}/` : load("omega_url"),
|
domain,
|
||||||
load("forced_omikron_url"),
|
});
|
||||||
load("forced_omikron_public_key"),
|
|
||||||
]);
|
|
||||||
await invoke("mtp_store_credentials", {
|
|
||||||
config: {
|
|
||||||
userId,
|
|
||||||
keyring: privateKey,
|
|
||||||
omegaUrl,
|
|
||||||
forcedOmikronUrl,
|
|
||||||
forcedOmikronPublicKey,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
await save("mtp_keyring", privateKey, { secure: true });
|
|
||||||
await save("session_id", Date.now());
|
|
||||||
await save("user_id", userId);
|
|
||||||
await navigate({ to: "/", replace: true });
|
await navigate({ to: "/", replace: true });
|
||||||
return true;
|
return true;
|
||||||
} finally {
|
} finally {
|
||||||
|
|
@ -148,6 +87,11 @@ export default function Form() {
|
||||||
[persistLogin],
|
[persistLogin],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
useEffect(
|
||||||
|
() => subscribeTuFileLaunch(processDroppedFile),
|
||||||
|
[processDroppedFile],
|
||||||
|
);
|
||||||
|
|
||||||
// Handle .tu files
|
// Handle .tu files
|
||||||
const handleFileInputChange = useCallback(
|
const handleFileInputChange = useCallback(
|
||||||
async (event: ChangeEvent<HTMLInputElement>): Promise<void> => {
|
async (event: ChangeEvent<HTMLInputElement>): Promise<void> => {
|
||||||
|
|
@ -286,32 +230,10 @@ export default function Form() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative flex md:flex-row flex-col gap-15">
|
<div className="relative flex md:flex-row flex-col gap-15">
|
||||||
{isTauri() && isMobile ? (
|
{isMobile ? (
|
||||||
<>
|
<Button onClick={() => uploadRef.current?.click()}>
|
||||||
<QrCodeScanner
|
Select .tu file
|
||||||
onData={async (data) => {
|
</Button>
|
||||||
if (!data.startsWith("tensamin://tu::")) {
|
|
||||||
toast("error", "Invalid QR code");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const decoded = data.replace("tensamin://tu::", "");
|
|
||||||
|
|
||||||
try {
|
|
||||||
const { userId, privateKey, domain } =
|
|
||||||
parseTuFileContent(decoded);
|
|
||||||
|
|
||||||
await persistLogin(userId, privateKey, domain);
|
|
||||||
} catch (error) {
|
|
||||||
log(0, "login", "red", error);
|
|
||||||
toast("error", "Failed to parse QR code data");
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Button onClick={() => uploadRef.current?.click()}>
|
|
||||||
Select .tu file
|
|
||||||
</Button>
|
|
||||||
</>
|
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
onClick={() => uploadRef.current?.click()}
|
onClick={() => uploadRef.current?.click()}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ import {
|
||||||
SelectContent,
|
SelectContent,
|
||||||
SelectItem,
|
SelectItem,
|
||||||
} from "@methanium/ui";
|
} from "@methanium/ui";
|
||||||
import { isTauri } from "@tauri-apps/api/core";
|
|
||||||
import { useIsMobile } from "@methanium/ui";
|
import { useIsMobile } from "@methanium/ui";
|
||||||
import { MobileNavbar } from "./navbar";
|
import { MobileNavbar } from "./navbar";
|
||||||
|
|
||||||
|
|
@ -35,24 +34,20 @@ import SidebarBox from "@tensamin/call/sidebarBox";
|
||||||
import { useShowMobileNavbar } from "@/routes/app/useShowMobileNavbar";
|
import { useShowMobileNavbar } from "@/routes/app/useShowMobileNavbar";
|
||||||
import { Ellipsis, Check } from "lucide-react";
|
import { Ellipsis, Check } from "lucide-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import type { User } from "@tensamin/user/context";
|
import { useUser, type User } from "@tensamin/user/context";
|
||||||
import type z from "zod";
|
import { mtp, userPresencePreferenceSchema } from "@tensamin/shared/data";
|
||||||
import { mtp } from "@tensamin/shared/data";
|
|
||||||
import { useMTP } from "@tensamin/mtp";
|
import { useMTP } from "@tensamin/mtp";
|
||||||
|
import {
|
||||||
|
onlineStatusLabels,
|
||||||
|
onlineStatusOptions,
|
||||||
|
type OnlineStatus,
|
||||||
|
} from "./status-options";
|
||||||
|
|
||||||
type OnlineStatus = z.infer<typeof mtp.GetUserData.response.shape.OnlineStatus>;
|
function accountPreference(status: User["OnlineStatus"]): OnlineStatus {
|
||||||
|
return userPresencePreferenceSchema.safeParse(status).success
|
||||||
const onlineStatusLabels: Record<OnlineStatus, string> = {
|
? (status as OnlineStatus)
|
||||||
user_online: "Online",
|
: "user_online";
|
||||||
user_offline: "Offline",
|
}
|
||||||
user_dnd: "Do not disturb",
|
|
||||||
user_idle: "Idle",
|
|
||||||
user_wc: "Away",
|
|
||||||
user_borked: "Borked",
|
|
||||||
iota_offline: "Iota offline",
|
|
||||||
iota_online: "Iota online",
|
|
||||||
iota_borked: "Iota borked",
|
|
||||||
};
|
|
||||||
|
|
||||||
function StatusDialog({
|
function StatusDialog({
|
||||||
user,
|
user,
|
||||||
|
|
@ -68,7 +63,7 @@ function StatusDialog({
|
||||||
saveSucceeded,
|
saveSucceeded,
|
||||||
setSaveSucceeded,
|
setSaveSucceeded,
|
||||||
}: {
|
}: {
|
||||||
user: User;
|
user: Pick<User, "UserId" | "OnlineStatus" | "Status">;
|
||||||
open: boolean;
|
open: boolean;
|
||||||
onOpenChange: (open: boolean) => void;
|
onOpenChange: (open: boolean) => void;
|
||||||
send: ReturnType<typeof useMTP>["send"];
|
send: ReturnType<typeof useMTP>["send"];
|
||||||
|
|
@ -81,13 +76,15 @@ function StatusDialog({
|
||||||
saveSucceeded: boolean;
|
saveSucceeded: boolean;
|
||||||
setSaveSucceeded: (value: boolean) => void;
|
setSaveSucceeded: (value: boolean) => void;
|
||||||
}) {
|
}) {
|
||||||
|
const { updateProfile, updateState } = useUser();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
open={open}
|
open={open}
|
||||||
onOpenChange={(nextOpen) => {
|
onOpenChange={(nextOpen) => {
|
||||||
if (!nextOpen) {
|
if (!nextOpen) {
|
||||||
setDraftStatus(user.Status ?? "");
|
setDraftStatus(user.Status ?? "");
|
||||||
setDraftOnlineStatus(user.OnlineStatus);
|
setDraftOnlineStatus(accountPreference(user.OnlineStatus));
|
||||||
setErrorMessage("");
|
setErrorMessage("");
|
||||||
setSaveSucceeded(false);
|
setSaveSucceeded(false);
|
||||||
}
|
}
|
||||||
|
|
@ -126,10 +123,11 @@ function StatusDialog({
|
||||||
</SelectValue>
|
</SelectValue>
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent className="p-1">
|
<SelectContent className="p-1">
|
||||||
<SelectItem value="user_online">Online</SelectItem>
|
{onlineStatusOptions.map((option) => (
|
||||||
<SelectItem value="user_offline">Offline</SelectItem>
|
<SelectItem key={option.value} value={option.value}>
|
||||||
<SelectItem value="user_idle">Idle</SelectItem>
|
{option.label}
|
||||||
<SelectItem value="user_dnd">Do not disturb</SelectItem>
|
</SelectItem>
|
||||||
|
))}
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -140,12 +138,10 @@ function StatusDialog({
|
||||||
<DialogClose render={<Button variant="destructive">Cancel</Button>} />
|
<DialogClose render={<Button variant="destructive">Cancel</Button>} />
|
||||||
<Button
|
<Button
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
const payload = {
|
const validation = mtp.ChangeUserData.request.safeParse({
|
||||||
...(draftStatus && { status: draftStatus }),
|
|
||||||
OnlineStatus: draftOnlineStatus,
|
OnlineStatus: draftOnlineStatus,
|
||||||
};
|
Status: draftStatus,
|
||||||
|
});
|
||||||
const validation = mtp.ChangeUserData.request.safeParse(payload);
|
|
||||||
|
|
||||||
if (!validation.success) {
|
if (!validation.success) {
|
||||||
setSaveSucceeded(false);
|
setSaveSucceeded(false);
|
||||||
|
|
@ -157,6 +153,8 @@ function StatusDialog({
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await send("ChangeUserData", validation.data);
|
await send("ChangeUserData", validation.data);
|
||||||
|
updateState(user.UserId, draftOnlineStatus);
|
||||||
|
await updateProfile(user.UserId, { Status: draftStatus });
|
||||||
setSaveSucceeded(true);
|
setSaveSucceeded(true);
|
||||||
setErrorMessage("");
|
setErrorMessage("");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
@ -195,16 +193,20 @@ export default function Sidebar() {
|
||||||
|
|
||||||
const content = (
|
const content = (
|
||||||
<>
|
<>
|
||||||
<SidebarContent
|
<SidebarContent className="pt-2">
|
||||||
className={
|
|
||||||
isTauri() && isMobile ? "pt-[env(safe-area-inset-top)]" : "pt-2"
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div className="h-full w-full flex flex-col gap-3 p-2 pt-0!">
|
<div className="h-full w-full flex flex-col gap-3 p-2 pt-0!">
|
||||||
<div>
|
<div>
|
||||||
<Wrapper
|
<Wrapper
|
||||||
loading={<Loading />}
|
loading={<Loading />}
|
||||||
userId={"own"}
|
userId={"own"}
|
||||||
|
fields={[
|
||||||
|
"UserId",
|
||||||
|
"Display",
|
||||||
|
"Username",
|
||||||
|
"Avatar",
|
||||||
|
"OnlineStatus",
|
||||||
|
"Status",
|
||||||
|
]}
|
||||||
component={(user) => (
|
component={(user) => (
|
||||||
<>
|
<>
|
||||||
<Basic
|
<Basic
|
||||||
|
|
@ -227,7 +229,9 @@ export default function Sidebar() {
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setDraftStatus(user.Status ?? "");
|
setDraftStatus(user.Status ?? "");
|
||||||
setDraftOnlineStatus(user.OnlineStatus);
|
setDraftOnlineStatus(
|
||||||
|
accountPreference(user.OnlineStatus),
|
||||||
|
);
|
||||||
setStatusErrorMessage("");
|
setStatusErrorMessage("");
|
||||||
setStatusSaveSucceeded(false);
|
setStatusSaveSucceeded(false);
|
||||||
setDialogOpen(true);
|
setDialogOpen(true);
|
||||||
|
|
@ -246,7 +250,9 @@ export default function Sidebar() {
|
||||||
onOpenChange={(nextOpen) => {
|
onOpenChange={(nextOpen) => {
|
||||||
if (!nextOpen) {
|
if (!nextOpen) {
|
||||||
setDraftStatus(user.Status ?? "");
|
setDraftStatus(user.Status ?? "");
|
||||||
setDraftOnlineStatus(user.OnlineStatus);
|
setDraftOnlineStatus(
|
||||||
|
accountPreference(user.OnlineStatus),
|
||||||
|
);
|
||||||
setStatusErrorMessage("");
|
setStatusErrorMessage("");
|
||||||
setStatusSaveSucceeded(false);
|
setStatusSaveSucceeded(false);
|
||||||
}
|
}
|
||||||
|
|
@ -298,7 +304,7 @@ export default function Sidebar() {
|
||||||
data-sidebar="sidebar"
|
data-sidebar="sidebar"
|
||||||
data-slot="sidebar"
|
data-slot="sidebar"
|
||||||
data-mobile="true"
|
data-mobile="true"
|
||||||
className="fixed inset-y-0 left-0 z-50 w-screen bg-sidebar p-0 text-sidebar-foreground"
|
className="fixed inset-y-0 left-0 z-50 w-screen bg-sidebar pt-[var(--ui-safe-area-top)] pr-[var(--ui-safe-area-right)] pl-[var(--ui-safe-area-left)] text-sidebar-foreground"
|
||||||
style={{
|
style={{
|
||||||
transform: openMobile ? "translateX(0)" : "translateX(-100%)",
|
transform: openMobile ? "translateX(0)" : "translateX(-100%)",
|
||||||
opacity: openMobile ? 1 : 0,
|
opacity: openMobile ? 1 : 0,
|
||||||
|
|
|
||||||
13
apps/web/src/components/status-options.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
export const onlineStatusOptions = [
|
||||||
|
{ label: "Online", value: "user_online" },
|
||||||
|
{ label: "Idle", value: "user_idle" },
|
||||||
|
{ label: "Do not disturb", value: "user_dnd" },
|
||||||
|
{ label: "On the toilet", value: "user_wc" },
|
||||||
|
{ label: "Offline", value: "user_invisible" },
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
export type OnlineStatus = (typeof onlineStatusOptions)[number]["value"];
|
||||||
|
|
||||||
|
export const onlineStatusLabels = Object.fromEntries(
|
||||||
|
onlineStatusOptions.map((option) => [option.value, option.label]),
|
||||||
|
) as Record<OnlineStatus, string>;
|
||||||
|
|
@ -28,6 +28,13 @@ export default function ConversationModal({ userId }: { userId: number }) {
|
||||||
<Wrapper
|
<Wrapper
|
||||||
loading={<Loading />}
|
loading={<Loading />}
|
||||||
userId={userId}
|
userId={userId}
|
||||||
|
fields={[
|
||||||
|
"Display",
|
||||||
|
"Username",
|
||||||
|
"Avatar",
|
||||||
|
"OnlineStatus",
|
||||||
|
"Status",
|
||||||
|
]}
|
||||||
component={(user) => <Basic user={user} />}
|
component={(user) => <Basic user={user} />}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,9 @@ import { useCall, useInitializeCall } from "@tensamin/call/store";
|
||||||
import { useIsSpeaking } from "@tensamin/call/speakingState";
|
import { useIsSpeaking } from "@tensamin/call/speakingState";
|
||||||
import { Provider as MTPProvider } from "@tensamin/mtp";
|
import { Provider as MTPProvider } from "@tensamin/mtp";
|
||||||
import UserProvider from "@tensamin/user/context";
|
import UserProvider from "@tensamin/user/context";
|
||||||
import DeeplinkContext from "@tensamin/tauri/deeplinkHandler";
|
import DeeplinkContext, { useDeeplinks } from "@tensamin/tauri/deeplinkHandler";
|
||||||
import NotificationsProvider from "@tensamin/notifications/context";
|
import NotificationsProvider from "@tensamin/notifications/context";
|
||||||
|
import PwaRuntime from "@tensamin/pwa/runtime";
|
||||||
|
|
||||||
import TAuthWrapper from "@tensamin/tauth/context";
|
import TAuthWrapper from "@tensamin/tauth/context";
|
||||||
|
|
||||||
|
|
@ -48,7 +49,6 @@ import CacheSync from "@tensamin/cache/sync";
|
||||||
import { useStorage } from "@tensamin/storage/context";
|
import { useStorage } from "@tensamin/storage/context";
|
||||||
import { useLocation, useNavigate } from "@tanstack/react-router";
|
import { useLocation, useNavigate } from "@tanstack/react-router";
|
||||||
import { useIsMobile, Toaster, TooltipProvider } from "@methanium/ui";
|
import { useIsMobile, Toaster, TooltipProvider } from "@methanium/ui";
|
||||||
import { isTauri } from "@tauri-apps/api/core";
|
|
||||||
import { HotkeysProvider } from "@tensamin/hotkeys";
|
import { HotkeysProvider } from "@tensamin/hotkeys";
|
||||||
|
|
||||||
const wrapper = document.getElementById("root");
|
const wrapper = document.getElementById("root");
|
||||||
|
|
@ -254,19 +254,14 @@ function RootShell() {
|
||||||
parentThemeStorageKey={null}
|
parentThemeStorageKey={null}
|
||||||
designStorageKey={null}
|
designStorageKey={null}
|
||||||
>
|
>
|
||||||
<div className="w-screen h-dvh overflow-hidden">
|
<div
|
||||||
<Toaster
|
data-pwa-root
|
||||||
position={isMobile ? "top-center" : "bottom-right"}
|
className="box-border w-screen h-dvh overflow-hidden"
|
||||||
{...(isTauri() && isMobile
|
>
|
||||||
? {
|
<Toaster position={isMobile ? "top-center" : "bottom-right"} />
|
||||||
mobileOffset: {
|
|
||||||
top: "env(safe-area-inset-top)",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
: {})}
|
|
||||||
/>
|
|
||||||
<TooltipProvider>
|
<TooltipProvider>
|
||||||
<Storage>
|
<Storage>
|
||||||
|
<PwaRuntime />
|
||||||
<HotkeysProvider>
|
<HotkeysProvider>
|
||||||
<ThemeStorageBridge />
|
<ThemeStorageBridge />
|
||||||
<LoginWrapper>
|
<LoginWrapper>
|
||||||
|
|
@ -288,6 +283,7 @@ function AppShell() {
|
||||||
<DesktopMediaProvider>
|
<DesktopMediaProvider>
|
||||||
<MTPProvider>
|
<MTPProvider>
|
||||||
<CacheSync />
|
<CacheSync />
|
||||||
|
<DeeplinkNavigator />
|
||||||
<Session>
|
<Session>
|
||||||
<UserProvider>
|
<UserProvider>
|
||||||
<CallInit />
|
<CallInit />
|
||||||
|
|
@ -309,6 +305,36 @@ function AppShell() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function DeeplinkNavigator() {
|
||||||
|
const { deeplinks } = useDeeplinks();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const handledCount = useRef(0);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const links = deeplinks.slice(handledCount.current);
|
||||||
|
handledCount.current = deeplinks.length;
|
||||||
|
|
||||||
|
for (const link of links) {
|
||||||
|
try {
|
||||||
|
const url = new URL(link);
|
||||||
|
const id = Number(url.searchParams.get("id"));
|
||||||
|
if (
|
||||||
|
url.protocol === "tensamin:" &&
|
||||||
|
url.hostname === "chat" &&
|
||||||
|
Number.isSafeInteger(id) &&
|
||||||
|
id > 0
|
||||||
|
) {
|
||||||
|
void navigate({ to: "/chat", search: { id } });
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// Ignore malformed URLs delivered by the platform.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [deeplinks, navigate]);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
function createCallTrayIcon(color: string, speaking: boolean) {
|
function createCallTrayIcon(color: string, speaking: boolean) {
|
||||||
const canvas = document.createElement("canvas");
|
const canvas = document.createElement("canvas");
|
||||||
canvas.width = 32;
|
canvas.width = 32;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ export default function Layout({ children }: { children: ReactNode }) {
|
||||||
<Sidebar />
|
<Sidebar />
|
||||||
<CallPopout />
|
<CallPopout />
|
||||||
<div
|
<div
|
||||||
|
data-app-layout
|
||||||
// Background of ui that is overlapping with the system ui
|
// Background of ui that is overlapping with the system ui
|
||||||
className={cn(
|
className={cn(
|
||||||
"w-full h-full min-h-0 flex flex-col overflow-hidden",
|
"w-full h-full min-h-0 flex flex-col overflow-hidden",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { createReadStream, realpathSync, statSync } from "node:fs";
|
import { createReadStream, statSync } from "node:fs";
|
||||||
import type { IncomingMessage, ServerResponse } from "node:http";
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
||||||
import { dirname, resolve } from "node:path";
|
import { dirname, resolve } from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
|
|
@ -8,14 +8,10 @@ import react from "@vitejs/plugin-react";
|
||||||
import tailwindcss from "@tailwindcss/vite";
|
import tailwindcss from "@tailwindcss/vite";
|
||||||
import { mtp } from "mtp/vite";
|
import { mtp } from "mtp/vite";
|
||||||
import { methaniumUi } from "@methanium/ui/vite";
|
import { methaniumUi } from "@methanium/ui/vite";
|
||||||
|
import { tensaminPwa } from "@tensamin/pwa/vite";
|
||||||
|
|
||||||
const host = process.env.TAURI_DEV_HOST;
|
const host = process.env.TAURI_DEV_HOST;
|
||||||
const appDir = dirname(fileURLToPath(import.meta.url));
|
const appDir = dirname(fileURLToPath(import.meta.url));
|
||||||
const markdownPackageDir = resolve(appDir, "../../packages/markdown");
|
|
||||||
|
|
||||||
function resolveMarkdownDependency(packageName: string): string {
|
|
||||||
return realpathSync(resolve(markdownPackageDir, "node_modules", packageName));
|
|
||||||
}
|
|
||||||
|
|
||||||
function deepFilterAssetHeaders(rootDir: string): Plugin {
|
function deepFilterAssetHeaders(rootDir: string): Plugin {
|
||||||
const serveModel = (
|
const serveModel = (
|
||||||
|
|
@ -57,24 +53,6 @@ export default defineConfig({
|
||||||
clearScreen: false,
|
clearScreen: false,
|
||||||
resolve: {
|
resolve: {
|
||||||
tsconfigPaths: true,
|
tsconfigPaths: true,
|
||||||
alias: [
|
|
||||||
{
|
|
||||||
find: "@codemirror/commands",
|
|
||||||
replacement: resolveMarkdownDependency("@codemirror/commands"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
find: "@codemirror/lang-markdown",
|
|
||||||
replacement: resolveMarkdownDependency("@codemirror/lang-markdown"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
find: "@codemirror/state",
|
|
||||||
replacement: resolveMarkdownDependency("@codemirror/state"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
find: "@codemirror/view",
|
|
||||||
replacement: resolveMarkdownDependency("@codemirror/view"),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
dedupe: [
|
dedupe: [
|
||||||
"react",
|
"react",
|
||||||
"react-dom",
|
"react-dom",
|
||||||
|
|
@ -90,16 +68,12 @@ export default defineConfig({
|
||||||
"@tensamin/user",
|
"@tensamin/user",
|
||||||
"@tensamin/tauri",
|
"@tensamin/tauri",
|
||||||
"@tensamin/chat",
|
"@tensamin/chat",
|
||||||
"@codemirror/commands",
|
|
||||||
"@codemirror/lang-markdown",
|
|
||||||
"@codemirror/state",
|
|
||||||
"@codemirror/view",
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
port: 5173,
|
port: 3000,
|
||||||
strictPort: true,
|
strictPort: true,
|
||||||
host: host || "0.0.0.0",
|
host: "0.0.0.0",
|
||||||
hmr: host
|
hmr: host
|
||||||
? {
|
? {
|
||||||
protocol: "ws",
|
protocol: "ws",
|
||||||
|
|
@ -133,7 +107,6 @@ export default defineConfig({
|
||||||
"@tensamin/crypto",
|
"@tensamin/crypto",
|
||||||
"@tensamin/crypto/context",
|
"@tensamin/crypto/context",
|
||||||
"@tensamin/hotkeys",
|
"@tensamin/hotkeys",
|
||||||
"@tensamin/markdown",
|
|
||||||
"@tensamin/mtp",
|
"@tensamin/mtp",
|
||||||
"@tensamin/notifications",
|
"@tensamin/notifications",
|
||||||
"@tensamin/onboarding",
|
"@tensamin/onboarding",
|
||||||
|
|
@ -153,6 +126,7 @@ export default defineConfig({
|
||||||
sourcemap: !!process.env.TAURI_ENV_DEBUG,
|
sourcemap: !!process.env.TAURI_ENV_DEBUG,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
...tensaminPwa(),
|
||||||
methaniumUi({ defaultThemeId: "tensamin" }),
|
methaniumUi({ defaultThemeId: "tensamin" }),
|
||||||
deepFilterAssetHeaders(resolve(appDir, "public")),
|
deepFilterAssetHeaders(resolve(appDir, "public")),
|
||||||
mtp({ typeMaps: resolve(appDir, "../../mtp-type-maps/type-maps.yaml") }),
|
mtp({ typeMaps: resolve(appDir, "../../mtp-type-maps/type-maps.yaml") }),
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import * as tsParser from "@typescript-eslint/parser";
|
||||||
import { dirname } from "node:path";
|
import { dirname } from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import {
|
import {
|
||||||
|
inlineSingleUseDeclarations,
|
||||||
noReactNamespaceImport,
|
noReactNamespaceImport,
|
||||||
noWindowLocationReload,
|
noWindowLocationReload,
|
||||||
} from "./utils/eslint-rules/index.js";
|
} from "./utils/eslint-rules/index.js";
|
||||||
|
|
@ -34,6 +35,7 @@ export default [
|
||||||
"react-hooks": reactHooks,
|
"react-hooks": reactHooks,
|
||||||
tensamin: {
|
tensamin: {
|
||||||
rules: {
|
rules: {
|
||||||
|
"inline-single-use-declarations": inlineSingleUseDeclarations,
|
||||||
"no-react-namespace-import": noReactNamespaceImport,
|
"no-react-namespace-import": noReactNamespaceImport,
|
||||||
"no-window-location-reload": noWindowLocationReload,
|
"no-window-location-reload": noWindowLocationReload,
|
||||||
},
|
},
|
||||||
|
|
@ -42,6 +44,7 @@ export default [
|
||||||
rules: {
|
rules: {
|
||||||
...reactHooks.configs.recommended.rules,
|
...reactHooks.configs.recommended.rules,
|
||||||
"react-hooks/set-state-in-effect": "off",
|
"react-hooks/set-state-in-effect": "off",
|
||||||
|
"tensamin/inline-single-use-declarations": "error",
|
||||||
"tensamin/no-react-namespace-import": "error",
|
"tensamin/no-react-namespace-import": "error",
|
||||||
"tensamin/no-window-location-reload": "error",
|
"tensamin/no-window-location-reload": "error",
|
||||||
},
|
},
|
||||||
|
|
|
||||||
183
flake.nix
|
|
@ -16,9 +16,7 @@
|
||||||
let
|
let
|
||||||
systems = [ "x86_64-linux" ];
|
systems = [ "x86_64-linux" ];
|
||||||
forAllSystems = nixpkgs.lib.genAttrs systems;
|
forAllSystems = nixpkgs.lib.genAttrs systems;
|
||||||
version = "0.0.10";
|
version = "0.0.11";
|
||||||
x86_64DebHash = "sha256-3CbaZnUT+hS6ClG5US6ZS7iy6kA82YlX/sJI3qFA81U=";
|
|
||||||
forgejoBaseUrl = "https://git.methanium.net/tensamin/client/releases/download/${version}";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages = forAllSystems (
|
packages = forAllSystems (
|
||||||
|
|
@ -32,8 +30,6 @@
|
||||||
android_sdk.accept_license = true;
|
android_sdk.accept_license = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
debArtifact = "Tensamin-${version}-linux-amd64.deb";
|
|
||||||
|
|
||||||
electronRuntimeLibs = with pkgs; [
|
electronRuntimeLibs = with pkgs; [
|
||||||
alsa-lib
|
alsa-lib
|
||||||
at-spi2-atk
|
at-spi2-atk
|
||||||
|
|
@ -75,71 +71,130 @@
|
||||||
libXtst
|
libXtst
|
||||||
libxcb
|
libxcb
|
||||||
];
|
];
|
||||||
packageDeb =
|
electron = pkgs.electron;
|
||||||
src:
|
pnpm = pkgs.pnpm;
|
||||||
pkgs.stdenv.mkDerivation {
|
mtpTypeMaps = pkgs.fetchgit {
|
||||||
pname = "tensamin";
|
url = "https://git.methanium.net/tensamin/mtp-type-maps";
|
||||||
inherit version src;
|
rev = "6e5122fe44f793c0e0d3229b3d34145ce17c2d31";
|
||||||
|
hash = "sha256-/4n8F0YLJaLncefKL907P5l+en1CTjpgdFmLBF3gbiQ=";
|
||||||
nativeBuildInputs = with pkgs; [
|
};
|
||||||
autoPatchelfHook
|
mtpSource = pkgs.fetchzip {
|
||||||
dpkg
|
url = "https://git.methanium.net/methanium/mtp/releases/download/0.3.0-dev-c7c7afe/mtp-0.3.0.tgz";
|
||||||
makeWrapper
|
hash = "sha256-XLTa8DxP93Q4hBHRCLUzCPOqkbdb4V3aZxE5Iuq+kW0=";
|
||||||
];
|
};
|
||||||
buildInputs = electronRuntimeLibs;
|
mtpCargoDeps = pkgs.rustPlatform.fetchCargoVendor {
|
||||||
|
src = mtpSource;
|
||||||
dontConfigure = true;
|
hash = "sha256-8MZ65N/EtWPAggal0JkGDx3WSn+LxWQORinkqVbsrys=";
|
||||||
dontBuild = true;
|
};
|
||||||
|
wasmBindgenCliSource = pkgs.fetchCrate {
|
||||||
unpackPhase = ''
|
pname = "wasm-bindgen-cli";
|
||||||
runHook preUnpack
|
version = "0.2.127";
|
||||||
dpkg-deb -x "$src" .
|
hash = "sha256-di+qBAdd7pENLiIB9CoZoab+W5xeDoByMREcCGTSzWo=";
|
||||||
runHook postUnpack
|
};
|
||||||
'';
|
wasmBindgenCli = pkgs.buildWasmBindgenCli {
|
||||||
|
src = wasmBindgenCliSource;
|
||||||
installPhase = ''
|
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
|
||||||
runHook preInstall
|
src = wasmBindgenCliSource;
|
||||||
|
hash = "sha256-FTv2GZIAQs0ePdIZXIXil7JbZ6kIT05VG6vqC1qNFxQ=";
|
||||||
mkdir -p "$out"
|
|
||||||
cp -r opt "$out/"
|
|
||||||
cp -r usr/* "$out/"
|
|
||||||
|
|
||||||
mkdir -p "$out/bin"
|
|
||||||
makeWrapper "$out/opt/Tensamin/tensamin" "$out/bin/tensamin" \
|
|
||||||
--prefix LD_LIBRARY_PATH : "${pkgs.lib.makeLibraryPath electronRuntimeLibs}"
|
|
||||||
|
|
||||||
substituteInPlace "$out/share/applications/Tensamin.desktop" \
|
|
||||||
--replace-fail "Exec=/opt/Tensamin/tensamin" "Exec=tensamin"
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
defaultPackage = packageDeb (
|
};
|
||||||
pkgs.fetchurl {
|
desktopItem = pkgs.makeDesktopItem {
|
||||||
url = "${forgejoBaseUrl}/${debArtifact}";
|
name = "tensamin";
|
||||||
hash = x86_64DebHash;
|
desktopName = "Tensamin";
|
||||||
}
|
exec = "tensamin";
|
||||||
);
|
icon = "tensamin";
|
||||||
localDebPath = builtins.getEnv "TENSAMIN_DEB";
|
startupWMClass = "Tensamin";
|
||||||
localPathPackage =
|
categories = [ "Network" ];
|
||||||
if localDebPath == "" then
|
};
|
||||||
pkgs.writeShellScriptBin "tensamin" ''
|
defaultPackage = pkgs.stdenv.mkDerivation (finalAttrs: {
|
||||||
echo "Set TENSAMIN_DEB to a local .deb path and run with --impure." >&2
|
pname = "tensamin";
|
||||||
exit 1
|
inherit version;
|
||||||
''
|
src = self;
|
||||||
else
|
|
||||||
packageDeb (
|
pnpmDeps = pkgs.fetchPnpmDeps {
|
||||||
builtins.path {
|
inherit (finalAttrs) pname version src;
|
||||||
path = localDebPath;
|
inherit pnpm;
|
||||||
name = debArtifact;
|
fetcherVersion = 4;
|
||||||
}
|
hash = "sha256-imP3MTr1YLc28Z9n617m0Wt/6vPirFznzoriKzojlEg=";
|
||||||
);
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
copyDesktopItems
|
||||||
|
makeWrapper
|
||||||
|
nodejs_22
|
||||||
|
pnpm
|
||||||
|
pnpmConfigHook
|
||||||
|
cargo
|
||||||
|
lld
|
||||||
|
rustc
|
||||||
|
wasm-pack
|
||||||
|
wasmBindgenCli
|
||||||
|
binaryen
|
||||||
|
];
|
||||||
|
|
||||||
|
env.ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
rm -rf mtp-type-maps
|
||||||
|
ln -s ${mtpTypeMaps} mtp-type-maps
|
||||||
|
|
||||||
|
node -e '
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = "apps/electron/package.json";
|
||||||
|
const pkg = JSON.parse(fs.readFileSync(path, "utf8"));
|
||||||
|
pkg.version = "${version}";
|
||||||
|
fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + "\n");
|
||||||
|
'
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
mkdir -p "$HOME/.cargo"
|
||||||
|
substitute ${mtpCargoDeps}/.cargo/config.toml "$HOME/.cargo/config.toml" \
|
||||||
|
--replace-fail @vendor@ ${mtpCargoDeps}
|
||||||
|
|
||||||
|
pnpm run copy-licenses
|
||||||
|
pnpm run build:packages
|
||||||
|
pnpm run build:web
|
||||||
|
pnpm --dir apps/tauri run gen-icons
|
||||||
|
pnpm --dir apps/electron run build
|
||||||
|
pnpm --dir apps/electron exec electron-builder --dir --linux --publish never \
|
||||||
|
--config.electronDist=${electron.dist} \
|
||||||
|
--config.electronVersion=${electron.version}
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p "$out/lib/tensamin" "$out/bin"
|
||||||
|
cp -r apps/electron/release/linux-unpacked/. "$out/lib/tensamin/"
|
||||||
|
|
||||||
|
makeWrapper "$out/lib/tensamin/tensamin" "$out/bin/tensamin" \
|
||||||
|
--prefix LD_LIBRARY_PATH : "${pkgs.lib.makeLibraryPath electronRuntimeLibs}"
|
||||||
|
|
||||||
|
install -Dm644 apps/electron/build/icons/icon.png \
|
||||||
|
"$out/share/icons/hicolor/512x512/apps/tensamin.png"
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
desktopItems = [ desktopItem ];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Tensamin desktop client";
|
||||||
|
homepage = "https://git.methanium.net/tensamin/client";
|
||||||
|
mainProgram = "tensamin";
|
||||||
|
platforms = pkgs.lib.platforms.linux;
|
||||||
|
};
|
||||||
|
});
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
default = defaultPackage;
|
default = defaultPackage;
|
||||||
tensamin = defaultPackage;
|
tensamin = defaultPackage;
|
||||||
electron = defaultPackage;
|
electron = defaultPackage;
|
||||||
localPathForDev = localPathPackage;
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2014-present Sebastian McKenzie and other contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
"Software"), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2019 Material-UI SAS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2019 Material-UI SAS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2021-present Floating UI contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
|
||||||
the Software without restriction, including without limitation the rights to
|
|
||||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2021-present Floating UI contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
|
||||||
the Software without restriction, including without limitation the rights to
|
|
||||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2021-present Floating UI contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
|
||||||
the Software without restriction, including without limitation the rights to
|
|
||||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2021-present Floating UI contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
|
||||||
the Software without restriction, including without limitation the rights to
|
|
||||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
|
|
@ -1,93 +0,0 @@
|
||||||
Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) Inter-Italic[opsz,wght].ttf: Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter)
|
|
||||||
|
|
||||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
||||||
This license is copied below, and is also available with a FAQ at:
|
|
||||||
http://scripts.sil.org/OFL
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------
|
|
||||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
||||||
-----------------------------------------------------------
|
|
||||||
|
|
||||||
PREAMBLE
|
|
||||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
||||||
development of collaborative font projects, to support the font creation
|
|
||||||
efforts of academic and linguistic communities, and to provide a free and
|
|
||||||
open framework in which fonts may be shared and improved in partnership
|
|
||||||
with others.
|
|
||||||
|
|
||||||
The OFL allows the licensed fonts to be used, studied, modified and
|
|
||||||
redistributed freely as long as they are not sold by themselves. The
|
|
||||||
fonts, including any derivative works, can be bundled, embedded,
|
|
||||||
redistributed and/or sold with any software provided that any reserved
|
|
||||||
names are not used by derivative works. The fonts and derivatives,
|
|
||||||
however, cannot be released under any other type of license. The
|
|
||||||
requirement for fonts to remain under this license does not apply
|
|
||||||
to any document created using the fonts or their derivatives.
|
|
||||||
|
|
||||||
DEFINITIONS
|
|
||||||
"Font Software" refers to the set of files released by the Copyright
|
|
||||||
Holder(s) under this license and clearly marked as such. This may
|
|
||||||
include source files, build scripts and documentation.
|
|
||||||
|
|
||||||
"Reserved Font Name" refers to any names specified as such after the
|
|
||||||
copyright statement(s).
|
|
||||||
|
|
||||||
"Original Version" refers to the collection of Font Software components as
|
|
||||||
distributed by the Copyright Holder(s).
|
|
||||||
|
|
||||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
||||||
or substituting -- in part or in whole -- any of the components of the
|
|
||||||
Original Version, by changing formats or by porting the Font Software to a
|
|
||||||
new environment.
|
|
||||||
|
|
||||||
"Author" refers to any designer, engineer, programmer, technical
|
|
||||||
writer or other person who contributed to the Font Software.
|
|
||||||
|
|
||||||
PERMISSION & CONDITIONS
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
||||||
redistribute, and sell modified and unmodified copies of the Font
|
|
||||||
Software, subject to the following conditions:
|
|
||||||
|
|
||||||
1) Neither the Font Software nor any of its individual components,
|
|
||||||
in Original or Modified Versions, may be sold by itself.
|
|
||||||
|
|
||||||
2) Original or Modified Versions of the Font Software may be bundled,
|
|
||||||
redistributed and/or sold with any software, provided that each copy
|
|
||||||
contains the above copyright notice and this license. These can be
|
|
||||||
included either as stand-alone text files, human-readable headers or
|
|
||||||
in the appropriate machine-readable metadata fields within text or
|
|
||||||
binary files as long as those fields can be easily viewed by the user.
|
|
||||||
|
|
||||||
3) No Modified Version of the Font Software may use the Reserved Font
|
|
||||||
Name(s) unless explicit written permission is granted by the corresponding
|
|
||||||
Copyright Holder. This restriction only applies to the primary font name as
|
|
||||||
presented to the users.
|
|
||||||
|
|
||||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
||||||
Software shall not be used to promote, endorse or advertise any
|
|
||||||
Modified Version, except to acknowledge the contribution(s) of the
|
|
||||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
||||||
permission.
|
|
||||||
|
|
||||||
5) The Font Software, modified or unmodified, in part or in whole,
|
|
||||||
must be distributed entirely under this license, and must not be
|
|
||||||
distributed under any other license. The requirement for fonts to
|
|
||||||
remain under this license does not apply to any document created
|
|
||||||
using the Font Software.
|
|
||||||
|
|
||||||
TERMINATION
|
|
||||||
This license becomes null and void if any of the above conditions are
|
|
||||||
not met.
|
|
||||||
|
|
||||||
DISCLAIMER
|
|
||||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
||||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
||||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
||||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
||||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
||||||
15
licenses/@methanium_ui@0.0.28/LICENSE
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
Copyright (c) 2025 Methanium
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
No part of this software, source code, documentation, or
|
||||||
|
associated materials may be copied, reproduced, modified,
|
||||||
|
distributed, published, sublicensed, sold, or used to create
|
||||||
|
derivative works without prior written permission from the
|
||||||
|
copyright holder.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EXPRESS OR IMPLIED. TO THE MAXIMUM
|
||||||
|
EXTENT PERMITTED BY LAW, THE COPYRIGHT HOLDER SHALL
|
||||||
|
NOT BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
|
||||||
|
LIABILITY ARISING FROM THE SOFTWARE OR ITS USE.
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2018 Mark Erikson
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2025 TanStack
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2022 WorkOS
|
Copyright (c) 2026 Tanner Linsley
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2021-present Tanner Linsley
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||