diff --git a/.github/nightly-signing-policy.json b/.github/nightly-signing-policy.json
index 6427f339db..55d2a1983c 100644
--- a/.github/nightly-signing-policy.json
+++ b/.github/nightly-signing-policy.json
@@ -123,7 +123,9 @@
}
},
"max_artifact_bytes": 2147483648,
- "automatic_signer_actors": [],
+ "automatic_signer_actors": [
+ "github-actions[bot]"
+ ],
"platforms": {
"windows-x86_64": {
"unsigned_artifact_name": "nightly-unsigned-windows-x86_64",
diff --git a/.github/scripts/release-rpm-smoke.py b/.github/scripts/release-rpm-smoke.py
new file mode 100644
index 0000000000..3d70cca7c1
--- /dev/null
+++ b/.github/scripts/release-rpm-smoke.py
@@ -0,0 +1,74 @@
+"""Check a real installed release RPM and exercise the GUI control channel."""
+
+import json
+import os
+from pathlib import Path
+import secrets
+import socket
+import subprocess
+import time
+import tempfile
+
+
+def run_smoke(results):
+ requirements = (results / "rpm-requires.txt").read_text()
+ for capability in (
+ "libc.so.6()(64bit)",
+ "libm.so.6(GLIBC_2.35)(64bit)",
+ "libgcc_s.so.1()(64bit)",
+ "libxkbcommon.so.0()(64bit)",
+ "(libvulkan.so.1()(64bit) or libEGL.so.1()(64bit))",
+ ):
+ if capability not in requirements.splitlines():
+ raise RuntimeError(f"Missing RPM requirement: {capability}")
+
+ version = subprocess.check_output(["vectorcraft-cli", "--version"], text=True)
+ (results / "cli-version.txt").write_text(version)
+ # Original fixture authored for this package smoke test; no external artwork.
+ fixture = results / "original-smoke.svg"
+ fixture.write_text('')
+ token = secrets.token_hex(32)
+ with tempfile.TemporaryDirectory(prefix="vectorcraft-runtime-") as runtime, (results / "gui.log").open("w") as log:
+ env = dict(os.environ, VECTORCRAFT_NO_PREFS="1", XDG_RUNTIME_DIR=runtime,
+ VECTORCRAFT_CONTROL_TOKEN=token)
+ app = subprocess.Popen([
+ "vectorcraft", "--control", "32180", "--automation-read-root", str(results),
+ "--automation-write-root", str(results), str(fixture),
+ ], stdout=log, stderr=subprocess.STDOUT, env=env)
+ try:
+ deadline = time.monotonic() + 90
+ while True:
+ if app.poll() is not None:
+ raise RuntimeError(f"GUI exited during startup: {app.returncode}")
+ try:
+ channel = socket.create_connection(("127.0.0.1", 32180), timeout=5)
+ break
+ except OSError:
+ if time.monotonic() >= deadline:
+ raise RuntimeError("GUI control channel did not become ready") from None
+ time.sleep(1)
+ channel.settimeout(30)
+ with channel, channel.makefile("rwb") as stream:
+ for request_id, method, params in (
+ (0, "auth", {"token": token}),
+ (1, "ui.inspect", {}),
+ ):
+ stream.write((json.dumps(dict(id=request_id, method=method, params=params)) + "\n").encode())
+ stream.flush()
+ response = json.loads(stream.readline())
+ (results / f"{method}.json").write_text(json.dumps(response, indent=2))
+ if response.get("id") != request_id or response.get("ok") is not True:
+ raise RuntimeError(f"GUI request failed: {method}")
+ finally:
+ app.terminate()
+ try:
+ app.wait(timeout=10)
+ except subprocess.TimeoutExpired:
+ app.kill()
+ app.wait()
+
+
+if __name__ == "__main__":
+ run_smoke(Path("/results"))
diff --git a/.github/scripts/tests/test_release_rpm_smoke.py b/.github/scripts/tests/test_release_rpm_smoke.py
new file mode 100644
index 0000000000..9d92237534
--- /dev/null
+++ b/.github/scripts/tests/test_release_rpm_smoke.py
@@ -0,0 +1,116 @@
+"""Exercise failures that an installed-package happy-path check cannot reproduce."""
+import importlib.util
+import json
+from pathlib import Path
+import subprocess
+import tempfile
+import unittest
+from unittest.mock import MagicMock, patch
+
+spec = importlib.util.spec_from_file_location("rpm_smoke", Path(__file__).parents[1] / "release-rpm-smoke.py")
+smoke = importlib.util.module_from_spec(spec)
+spec.loader.exec_module(smoke)
+
+
+class SmokeLifecycleTests(unittest.TestCase):
+ def setUp(self):
+ self.folder = tempfile.TemporaryDirectory()
+ self.addCleanup(self.folder.cleanup)
+ self.results = Path(self.folder.name)
+ (self.results / "rpm-requires.txt").write_text("\n".join([
+ "libc.so.6()(64bit)", "libm.so.6(GLIBC_2.35)(64bit)",
+ "libgcc_s.so.1()(64bit)", "libxkbcommon.so.0()(64bit)",
+ "(libvulkan.so.1()(64bit) or libEGL.so.1()(64bit))",
+ ]))
+ self.app = MagicMock()
+ self.app.poll.return_value = None
+ self.channel = MagicMock()
+ self.stream = self.channel.makefile.return_value.__enter__.return_value
+ self.stream.readline.side_effect = [
+ b'{"id":0,"ok":true}\n', b'{"id":1,"ok":true,"result":{"window":"fixture"}}\n',
+ ]
+ self.runtime = None
+
+ def launch(*args, **kwargs):
+ self.runtime = Path(kwargs["env"]["XDG_RUNTIME_DIR"])
+ self.assertTrue(self.runtime.is_dir())
+ return self.app
+
+ self.launch = self.start_patch(smoke.subprocess, "Popen", side_effect=launch)
+ self.start_patch(smoke.subprocess, "check_output", return_value="vectorcraft-cli 0.25.0\n")
+ self.connect = self.start_patch(smoke.socket, "create_connection", return_value=self.channel)
+ self.start_patch(smoke.time, "sleep")
+
+ def start_patch(self, owner, name, **kwargs):
+ patcher = patch.object(owner, name, **kwargs)
+ result = patcher.start()
+ self.addCleanup(patcher.stop)
+ return result
+
+ def assert_cleaned_up(self):
+ self.app.terminate.assert_called_once()
+ self.assertFalse(self.runtime.exists())
+
+ def test_success_records_inspection_and_removes_private_runtime(self):
+ smoke.run_smoke(self.results)
+ report = json.loads((self.results / "ui.inspect.json").read_text())
+ self.assertEqual(report["result"], {"window": "fixture"})
+ requests = [json.loads(call.args[0]) for call in self.stream.write.call_args_list]
+ self.assertEqual(requests[0]["method"], "auth")
+ self.assertEqual(requests[0]["params"]["token"], self.launch.call_args.kwargs["env"]["VECTORCRAFT_CONTROL_TOKEN"])
+ self.assert_cleaned_up()
+
+ def test_missing_runtime_dependency_prevents_launch(self):
+ (self.results / "rpm-requires.txt").write_text("")
+ with self.assertRaisesRegex(RuntimeError, "Missing RPM requirement"):
+ smoke.run_smoke(self.results)
+ self.launch.assert_not_called()
+
+ def test_child_exit_during_startup_is_a_failure(self):
+ self.app.poll.return_value = 1
+ self.app.returncode = 1
+ with self.assertRaisesRegex(RuntimeError, "exited during startup"):
+ smoke.run_smoke(self.results)
+ self.assert_cleaned_up()
+
+ def test_connection_is_retried_until_ready(self):
+ self.connect.side_effect = [OSError("not ready"), self.channel]
+ smoke.run_smoke(self.results)
+ self.assertEqual(self.connect.call_count, 2)
+ self.assert_cleaned_up()
+
+ def test_startup_timeout_stops_child(self):
+ self.connect.side_effect = OSError("not ready")
+ self.start_patch(smoke.time, "monotonic", side_effect=[0, 91])
+ with self.assertRaisesRegex(RuntimeError, "did not become ready"):
+ smoke.run_smoke(self.results)
+ self.assert_cleaned_up()
+
+ def test_auth_refusal_prevents_inspection(self):
+ self.stream.readline.side_effect = [b'{"id":0,"ok":false}\n']
+ with self.assertRaisesRegex(RuntimeError, "request failed: auth"):
+ smoke.run_smoke(self.results)
+ self.assertFalse((self.results / "ui.inspect.json").exists())
+ self.assert_cleaned_up()
+
+ def test_response_for_another_request_is_rejected(self):
+ self.stream.readline.side_effect = [b'{"id":0,"ok":true}\n', b'{"id":99,"ok":true}\n']
+ with self.assertRaisesRegex(RuntimeError, "request failed: ui.inspect"):
+ smoke.run_smoke(self.results)
+ self.assert_cleaned_up()
+
+ def test_malformed_response_still_stops_child(self):
+ self.stream.readline.side_effect = [b'not json\n']
+ with self.assertRaises(json.JSONDecodeError):
+ smoke.run_smoke(self.results)
+ self.assert_cleaned_up()
+
+ def test_unresponsive_child_is_killed_after_termination_timeout(self):
+ self.app.wait.side_effect = [subprocess.TimeoutExpired("vectorcraft", 10), 0]
+ smoke.run_smoke(self.results)
+ self.app.kill.assert_called_once()
+ self.assert_cleaned_up()
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/.github/workflows/nightly-dispatch.yml b/.github/workflows/nightly-dispatch.yml
index dd4a4a02da..4ef372c40b 100644
--- a/.github/workflows/nightly-dispatch.yml
+++ b/.github/workflows/nightly-dispatch.yml
@@ -11,9 +11,9 @@ permissions: {}
jobs:
dispatch:
- # SOURCE PREPARATION: literal off until immutable shared tooling and policy qualification.
+ # Enabled for automated scheduled producer completions on main.
if: >-
- false && github.repository == 'storytold/vectorcraft' &&
+ github.repository == 'storytold/vectorcraft' &&
github.event_name == 'workflow_run'
runs-on: ubuntu-latest
timeout-minutes: 5
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 0e963e43e1..c2224a81ba 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -1,8 +1,9 @@
name: VectorCraft unsigned nightly
-# Enabled for supervised manual runs by the reviewed manual actor only; no schedule yet.
-# A later explicit opt-in may add a cadence (and turn on nightly-dispatch.yml with it).
+# Automated daily nightly builds at 06:30 UTC, plus supervised manual runs by reviewed manual actors.
on:
+ schedule:
+ - cron: '30 6 * * *'
workflow_dispatch:
permissions:
diff --git a/.github/workflows/release-rpm-smoke.yml b/.github/workflows/release-rpm-smoke.yml
new file mode 100644
index 0000000000..61948e0f35
--- /dev/null
+++ b/.github/workflows/release-rpm-smoke.yml
@@ -0,0 +1,114 @@
+name: Release RPM smoke
+
+on:
+ workflow_dispatch:
+ inputs:
+ run-id:
+ description: Release run containing both RPM artifacts (empty selects the latest available pair)
+ type: string
+ default: ""
+ pull_request:
+ paths:
+ - .github/workflows/release-rpm-smoke.yml
+ - .github/scripts/release-rpm-smoke.py
+ - .github/scripts/tests/test_release_rpm_smoke.py
+
+permissions: {}
+
+jobs:
+ source:
+ permissions:
+ actions: read
+ runs-on: ubuntu-24.04
+ timeout-minutes: 5
+ outputs:
+ run-id: ${{ steps.source.outputs.run-id }}
+ steps:
+ - id: source
+ env:
+ GH_TOKEN: ${{ github.token }}
+ RUN_ID: ${{ inputs.run-id }}
+ run: |
+ candidates="$RUN_ID"
+ if [ -z "$candidates" ]; then
+ candidates=$(gh run list --repo "$GITHUB_REPOSITORY" --workflow release.yml --branch release --limit 10 --json databaseId --jq '.[].databaseId')
+ fi
+ for candidate in $candidates; do
+ [[ "$candidate" =~ ^[0-9]+$ ]]
+ names=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$candidate/artifacts?per_page=100" --jq '.artifacts[] | select(.expired == false) | .name')
+ if grep -Fxq release-linux-x86_64 <<< "$names" && grep -Fxq release-linux-aarch64 <<< "$names"; then
+ printf 'run-id=%s\n' "$candidate" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+ done
+ echo '::error::No release run has both Linux package artifacts available'
+ exit 1
+ smoke:
+ permissions:
+ contents: read
+ actions: read
+ needs: source
+ timeout-minutes: 25
+ strategy:
+ fail-fast: false
+ matrix:
+ platform:
+ - {arch: x86_64, runner: ubuntu-24.04}
+ - {arch: aarch64, runner: ubuntu-24.04-arm}
+ distro: [fedora, rocky, opensuse]
+ runs-on: ${{ matrix.platform.runner }}
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
+ with:
+ persist-credentials: false
+ - name: Download the release packages
+ env:
+ GH_TOKEN: ${{ github.token }}
+ RUN_ID: ${{ needs.source.outputs.run-id }}
+ ARCH: ${{ matrix.platform.arch }}
+ run: |
+ [[ "$RUN_ID" =~ ^[0-9]+$ ]]
+ mkdir -p packages results
+ gh run view "$RUN_ID" --json headSha,url > results/source.json
+ gh run download "$RUN_ID" --name "release-linux-$ARCH" --dir packages
+ sha256sum packages/*.rpm > results/rpm-sha256.txt
+ - name: Install and start the RPM on the target distribution
+ env:
+ DISTRO: ${{ matrix.distro }}
+ run: |
+ sudo apt-get update -qq
+ sudo apt-get install -y xvfb
+ Xvfb :99 -screen 0 1440x900x24 -ac -nolisten tcp > results/xvfb.log 2>&1 &
+ for _attempt in {1..20}; do
+ [ -S /tmp/.X11-unix/X99 ] && break
+ sleep 1
+ done
+ [ -S /tmp/.X11-unix/X99 ]
+ case "$DISTRO" in
+ fedora) image=fedora:latest ;;
+ rocky) image=rockylinux:10 ;;
+ opensuse) image=opensuse/tumbleweed:latest ;;
+ esac
+ docker pull "$image"
+ docker image inspect "$image" --format '{{json .RepoDigests}}' > results/container-digest.json
+ docker run --rm --ipc=host --name rpm-smoke -e DISTRO -e DISPLAY=:99 -e LIBGL_ALWAYS_SOFTWARE=1 \
+ -v /tmp/.X11-unix:/tmp/.X11-unix:ro -v "$PWD/packages:/packages:ro" \
+ -v "$PWD/results:/results" -v "$PWD/.github/scripts:/checks:ro" "$image" bash -euc '
+ cat /etc/os-release > /results/os-release.txt
+ if [ "$DISTRO" = opensuse ]; then
+ zypper --non-interactive refresh
+ zypper --non-interactive install python3 Mesa-dri Mesa-libEGL1 libX11-6 libXcursor1 libXi6 libXrandr2 libxkbcommon0 libxkbcommon-x11-0
+ zypper --non-interactive --no-gpg-checks install /packages/*.rpm
+ else
+ dnf -y install python3 mesa-dri-drivers mesa-libEGL libX11 libXcursor libXi libXrandr libxkbcommon libxkbcommon-x11
+ dnf -y --nogpgcheck install /packages/*.rpm
+ fi
+ rpm -qp --requires /packages/*.rpm > /results/rpm-requires.txt
+ python3 /checks/release-rpm-smoke.py
+ '
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9
+ if: always()
+ with:
+ name: rpm-smoke-${{ matrix.distro }}-${{ matrix.platform.arch }}
+ path: results/
+ if-no-files-found: error
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 538d09cc31..ea3bf92583 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -43,6 +43,7 @@ jobs:
app-name: vectorcraft
app-title: VectorCraft
macos-runner: macos-15
+ macos-split-build: true
craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
web-craft-fonts: true
version: ${{ inputs.version }}
diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
index dde1f6f5a8..98e9c1d00a 100644
--- a/.github/workflows/sonarcloud.yml
+++ b/.github/workflows/sonarcloud.yml
@@ -21,4 +21,7 @@ jobs:
# The reusable workflow defaults build-jobs to 2 so a cold instrumented
# archive stays within hosted-runner memory (craft-common-actions#333).
uses: storytold/craft-common-actions/.github/workflows/sonarcloud.yml@main
+ with:
+ python-coverage-source: .github/scripts
+ python-coverage-script: .github/scripts/tests/test_release_rpm_smoke.py
secrets: inherit
diff --git a/Cargo.lock b/Cargo.lock
index 3cb674e4ae..170ad40f3d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -626,12 +626,6 @@ dependencies = [
"cpufeatures 0.3.1",
]
-[[package]]
-name = "block"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
-
[[package]]
name = "block-buffer"
version = "0.10.4"
@@ -725,6 +719,17 @@ dependencies = [
"brotli-decompressor 5.0.3",
]
+[[package]]
+name = "brotli"
+version = "9.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9071f285ed78f04f37d675abaaef5de7689e2f30a216c8dc6795465d81910a13"
+dependencies = [
+ "alloc-no-stdlib 3.0.0",
+ "alloc-stdlib 0.3.0",
+ "brotli-decompressor 6.3.2",
+]
+
[[package]]
name = "brotli-decompressor"
version = "5.0.3"
@@ -1184,19 +1189,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "core-graphics2"
-version = "0.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b65858d95344d2711161cd92196732f67d6c5fea238cf12f994584828731a5c"
-dependencies = [
- "bitflags 2.13.2",
- "block",
- "cfg-if",
- "core-foundation 0.10.1",
- "libc",
-]
-
[[package]]
name = "core_detect"
version = "1.0.0"
@@ -1239,7 +1231,7 @@ dependencies = [
[[package]]
name = "craft"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-automation",
"craft-behavior",
@@ -1280,7 +1272,7 @@ dependencies = [
[[package]]
name = "craft-affinity"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"crc32fast",
"flate2",
@@ -1291,18 +1283,19 @@ dependencies = [
[[package]]
name = "craft-appkit"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"block2 0.6.2",
"objc2 0.6.5",
"objc2-app-kit 0.3.2",
+ "objc2-core-graphics",
"objc2-foundation 0.3.2",
]
[[package]]
name = "craft-atomic"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"rustix 1.1.6",
]
@@ -1310,7 +1303,7 @@ dependencies = [
[[package]]
name = "craft-automation"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"base64 0.23.1",
"craft-behavior",
@@ -1335,7 +1328,7 @@ dependencies = [
[[package]]
name = "craft-behavior"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"accesskit",
"bitflags 2.13.2",
@@ -1353,7 +1346,7 @@ dependencies = [
[[package]]
name = "craft-browse"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-docpath",
@@ -1371,7 +1364,7 @@ dependencies = [
[[package]]
name = "craft-cdr"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"crc32fast",
"flate2",
@@ -1380,7 +1373,7 @@ dependencies = [
[[package]]
name = "craft-cloud-ui"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"egui",
]
@@ -1388,7 +1381,7 @@ dependencies = [
[[package]]
name = "craft-cms"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"md-5",
"rayon",
@@ -1397,12 +1390,12 @@ dependencies = [
[[package]]
name = "craft-codepage"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
[[package]]
name = "craft-color-ui"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-cms",
@@ -1422,7 +1415,7 @@ dependencies = [
[[package]]
name = "craft-control"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-control-protocol",
"craft-platform",
@@ -1433,7 +1426,7 @@ dependencies = [
[[package]]
name = "craft-control-protocol"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"getrandom 0.3.4",
"serde_json",
@@ -1443,7 +1436,7 @@ dependencies = [
[[package]]
name = "craft-dds"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"rayon",
]
@@ -1451,7 +1444,7 @@ dependencies = [
[[package]]
name = "craft-dialogs"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"block2 0.6.2",
"craft-appkit",
@@ -1477,7 +1470,7 @@ dependencies = [
[[package]]
name = "craft-doc"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"blake3",
"craft-ecproj-format",
@@ -1493,7 +1486,7 @@ dependencies = [
[[package]]
name = "craft-docpath"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"serde",
]
@@ -1501,7 +1494,7 @@ dependencies = [
[[package]]
name = "craft-draw"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-color-ui",
@@ -1520,7 +1513,7 @@ dependencies = [
[[package]]
name = "craft-dxf"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-codepage",
"encoding_rs",
@@ -1532,7 +1525,7 @@ dependencies = [
[[package]]
name = "craft-ecproj-format"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"serde",
"serde_json",
@@ -1542,12 +1535,12 @@ dependencies = [
[[package]]
name = "craft-eps"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
[[package]]
name = "craft-font-catalog"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"fontique",
"harfrust 0.13.3",
@@ -1562,7 +1555,7 @@ dependencies = [
[[package]]
name = "craft-font-manager"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-font-catalog",
@@ -1581,7 +1574,7 @@ dependencies = [
[[package]]
name = "craft-font-os-windows"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"windows-registry",
"windows-sys 0.61.2",
@@ -1590,7 +1583,7 @@ dependencies = [
[[package]]
name = "craft-font-store"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"cap-primitives",
"craft-atomic",
@@ -1613,12 +1606,12 @@ dependencies = [
[[package]]
name = "craft-fonts-build"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
[[package]]
name = "craft-gif"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"gif",
]
@@ -1626,7 +1619,7 @@ dependencies = [
[[package]]
name = "craft-gzip"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"flate2",
]
@@ -1634,7 +1627,7 @@ dependencies = [
[[package]]
name = "craft-host"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"bitflags 2.13.2",
"craft-i18n",
@@ -1647,8 +1640,10 @@ dependencies = [
[[package]]
name = "craft-i18n"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
+ "brotli 9.1.3",
+ "brotli-decompressor 6.3.2",
"chrono",
"fixed_decimal",
"icu_calendar",
@@ -1675,7 +1670,7 @@ dependencies = [
[[package]]
name = "craft-image-codecs"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-dds",
"craft-jpeg",
@@ -1702,7 +1697,7 @@ dependencies = [
[[package]]
name = "craft-imaging"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-color-ui",
@@ -1720,7 +1715,7 @@ dependencies = [
[[package]]
name = "craft-jpeg"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"thiserror 2.0.21",
]
@@ -1728,7 +1723,7 @@ dependencies = [
[[package]]
name = "craft-jxl"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"brotli-decompressor 5.0.3",
"jixel",
@@ -1739,7 +1734,7 @@ dependencies = [
[[package]]
name = "craft-keymap"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-host",
"craft-i18n",
@@ -1754,7 +1749,7 @@ dependencies = [
[[package]]
name = "craft-layers"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-i18n",
@@ -1768,7 +1763,7 @@ dependencies = [
[[package]]
name = "craft-menu"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-host",
@@ -1786,7 +1781,7 @@ dependencies = [
[[package]]
name = "craft-metadata"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"brotli-decompressor 6.3.2",
"chrono",
@@ -1798,7 +1793,7 @@ dependencies = [
[[package]]
name = "craft-metafile"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"encoding_rs",
"image",
@@ -1809,17 +1804,26 @@ dependencies = [
[[package]]
name = "craft-mime"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"chrono",
"craft-codepage",
"encoding_rs",
]
+[[package]]
+name = "craft-nightly"
+version = "0.1.0"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
+dependencies = [
+ "uds_windows",
+ "winsafe",
+]
+
[[package]]
name = "craft-pages"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-keymap",
@@ -1835,7 +1839,7 @@ dependencies = [
[[package]]
name = "craft-pcraft-format"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"flate2",
"serde",
@@ -1846,7 +1850,7 @@ dependencies = [
[[package]]
name = "craft-pdf"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"hayro-interpret",
"hayro-syntax",
@@ -1858,12 +1862,12 @@ dependencies = [
[[package]]
name = "craft-platform"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"async-channel",
"async-io",
"async-process",
- "core-graphics2",
+ "craft-appkit",
"craft-atomic",
"craft-docpath",
"craft-host",
@@ -1873,6 +1877,8 @@ dependencies = [
"js-sys",
"log",
"objc2-app-kit 0.3.2",
+ "objc2-core-foundation",
+ "objc2-core-graphics",
"rfd",
"serde",
"serde_json",
@@ -1889,7 +1895,7 @@ dependencies = [
[[package]]
name = "craft-plotter"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"kurbo 0.13.1",
"thiserror 2.0.21",
@@ -1898,7 +1904,7 @@ dependencies = [
[[package]]
name = "craft-print"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-host",
@@ -1922,7 +1928,7 @@ dependencies = [
[[package]]
name = "craft-proof"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"log",
"miniz_oxide 0.9.1",
@@ -1933,7 +1939,7 @@ dependencies = [
[[package]]
name = "craft-ps"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-eps",
"flate2",
@@ -1947,7 +1953,7 @@ dependencies = [
[[package]]
name = "craft-psd"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"encoding_rs",
"flate2",
@@ -1958,7 +1964,7 @@ dependencies = [
[[package]]
name = "craft-quit"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"dispatch2",
"egui",
@@ -1971,7 +1977,7 @@ dependencies = [
[[package]]
name = "craft-review"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"base64 0.23.1",
"craft-behavior",
@@ -1990,7 +1996,7 @@ dependencies = [
[[package]]
name = "craft-settings"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-atomic",
"craft-host",
@@ -2007,7 +2013,7 @@ dependencies = [
[[package]]
name = "craft-stream-codecs"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"fax",
"hayro-ccitt",
@@ -2018,7 +2024,7 @@ dependencies = [
[[package]]
name = "craft-svg"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-image-codecs",
"craft-xml",
@@ -2039,7 +2045,7 @@ dependencies = [
[[package]]
name = "craft-table"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-keymap",
@@ -2051,7 +2057,7 @@ dependencies = [
[[package]]
name = "craft-text"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-font-manager",
@@ -2076,7 +2082,7 @@ dependencies = [
[[package]]
name = "craft-theme"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"bitflags 2.13.2",
"craft-tracked",
@@ -2091,7 +2097,7 @@ dependencies = [
[[package]]
name = "craft-theme-store"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-atomic",
"craft-behavior",
@@ -2106,7 +2112,7 @@ dependencies = [
[[package]]
name = "craft-tiff"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"serde",
"thiserror 2.0.21",
@@ -2116,7 +2122,7 @@ dependencies = [
[[package]]
name = "craft-time"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"serde",
"thiserror 2.0.21",
@@ -2125,7 +2131,7 @@ dependencies = [
[[package]]
name = "craft-timeline"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-keymap",
@@ -2140,12 +2146,12 @@ dependencies = [
[[package]]
name = "craft-tracked"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
[[package]]
name = "craft-ui"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-cloud-ui",
"craft-ui-canvas",
@@ -2159,7 +2165,7 @@ dependencies = [
[[package]]
name = "craft-ui-canvas"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-i18n",
@@ -2175,7 +2181,7 @@ dependencies = [
[[package]]
name = "craft-ui-contract"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"accesskit",
"craft-behavior",
@@ -2213,7 +2219,7 @@ dependencies = [
[[package]]
name = "craft-ui-macros"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@@ -2224,7 +2230,7 @@ dependencies = [
[[package]]
name = "craft-ui-panels"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-host",
@@ -2242,7 +2248,7 @@ dependencies = [
[[package]]
name = "craft-ui-patterns"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-host",
@@ -2263,7 +2269,7 @@ dependencies = [
[[package]]
name = "craft-ui-shell"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-host",
@@ -2284,7 +2290,7 @@ dependencies = [
[[package]]
name = "craft-ui-widgets"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-behavior",
"craft-host",
@@ -2303,7 +2309,7 @@ dependencies = [
[[package]]
name = "craft-update"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"base64 0.22.1",
"chrono",
@@ -2335,7 +2341,7 @@ dependencies = [
[[package]]
name = "craft-vectorcraft-format"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"flate2",
"serde",
@@ -2346,7 +2352,7 @@ dependencies = [
[[package]]
name = "craft-wayland"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"raw-window-handle",
"wayland-backend",
@@ -2356,7 +2362,7 @@ dependencies = [
[[package]]
name = "craft-web-api"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"js-sys",
"serde_json",
@@ -2367,7 +2373,7 @@ dependencies = [
[[package]]
name = "craft-win32"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"winsafe",
]
@@ -2375,7 +2381,7 @@ dependencies = [
[[package]]
name = "craft-window"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"craft-appkit",
"craft-atomic",
@@ -2407,7 +2413,7 @@ dependencies = [
[[package]]
name = "craft-xml"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"quick-xml 0.41.0",
"serde",
@@ -2752,7 +2758,7 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
[[package]]
name = "ecolor"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"bytemuck",
"emath",
@@ -2785,7 +2791,7 @@ dependencies = [
[[package]]
name = "eframe"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"ahash",
"bytemuck",
@@ -2820,7 +2826,7 @@ dependencies = [
[[package]]
name = "egui"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"accesskit",
"ahash",
@@ -2839,7 +2845,7 @@ dependencies = [
[[package]]
name = "egui-wgpu"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"ahash",
"bytemuck",
@@ -2858,7 +2864,7 @@ dependencies = [
[[package]]
name = "egui-winit"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"accesskit_winit",
"arboard",
@@ -2883,7 +2889,7 @@ dependencies = [
[[package]]
name = "egui_extras"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"ahash",
"egui",
@@ -2897,7 +2903,7 @@ dependencies = [
[[package]]
name = "egui_glow"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"bytemuck",
"egui",
@@ -2910,7 +2916,7 @@ dependencies = [
[[package]]
name = "egui_kittest"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"dify",
"eframe",
@@ -2936,7 +2942,7 @@ checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
[[package]]
name = "emath"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"bytemuck",
]
@@ -3017,7 +3023,7 @@ dependencies = [
[[package]]
name = "epaint"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
dependencies = [
"ahash",
"bytemuck",
@@ -3043,7 +3049,11 @@ dependencies = [
[[package]]
name = "epaint_default_fonts"
version = "0.37.0"
-source = "git+https://github.com/storytold/egui.git?rev=14c39fed181756be6f357c284354e0ab55b64443#14c39fed181756be6f357c284354e0ab55b64443"
+source = "git+https://github.com/storytold/egui.git?rev=07c20531f89717e461c0f387dd1f9649553f9321#07c20531f89717e461c0f387dd1f9649553f9321"
+dependencies = [
+ "brotli 9.1.3",
+ "brotli-decompressor 6.3.2",
+]
[[package]]
name = "equivalent"
@@ -3762,16 +3772,16 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a"
[[package]]
name = "hayro-cmap"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
- "brotli",
+ "brotli 8.0.4",
"hayro-postscript",
]
[[package]]
name = "hayro-interpret"
version = "0.7.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"bitflags 2.13.2",
"hayro-cmap",
@@ -3789,7 +3799,7 @@ dependencies = [
[[package]]
name = "hayro-jbig2"
version = "0.3.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"fearless_simd",
"hayro-ccitt",
@@ -3807,12 +3817,12 @@ dependencies = [
[[package]]
name = "hayro-postscript"
version = "0.1.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
[[package]]
name = "hayro-syntax"
version = "0.7.2"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"flate2",
"hayro-ccitt",
@@ -4795,7 +4805,7 @@ dependencies = [
[[package]]
name = "krilla"
version = "0.8.2"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"base64 0.22.1",
"bumpalo",
@@ -4952,7 +4962,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4"
[[package]]
name = "linesweeper"
version = "0.5.0"
-source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735"
+source = "git+https://github.com/storytold/craft-libs?rev=2680a3b3fe464c7afa3d260b33a828fa94e12f6d#2680a3b3fe464c7afa3d260b33a828fa94e12f6d"
dependencies = [
"arrayvec",
"kurbo 0.13.1",
@@ -8515,13 +8525,14 @@ dependencies = [
[[package]]
name = "vectorcraft"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"arboard",
"block2 0.6.2",
"chrono",
"clipboard-win",
"craft",
+ "craft-nightly",
"eframe",
"egui",
"egui_extras",
@@ -8558,7 +8569,7 @@ dependencies = [
[[package]]
name = "vectorcraft-affinity"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft-affinity",
"craft-image-codecs",
@@ -8569,26 +8580,26 @@ dependencies = [
[[package]]
name = "vectorcraft-apischema"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"serde_json",
]
[[package]]
name = "vectorcraft-brush"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"kurbo 0.13.1",
"serde",
"serde_json",
"vectorcraft-color",
"vectorcraft-doc",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
]
[[package]]
name = "vectorcraft-cad"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft-dxf",
"craft-image-codecs",
@@ -8600,14 +8611,14 @@ dependencies = [
"vectorcraft-color",
"vectorcraft-doc",
"vectorcraft-effects",
- "vectorcraft-geom 0.25.0",
- "vectorcraft-pathops 0.25.0",
+ "vectorcraft-geom 0.25.1",
+ "vectorcraft-pathops 0.25.1",
"vectorcraft-text",
]
[[package]]
name = "vectorcraft-cli"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"log",
"objc2-core-foundation",
@@ -8618,7 +8629,7 @@ dependencies = [
"vectorcraft-doc",
"vectorcraft-engine",
"vectorcraft-format",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-mcp",
"vectorcraft-render",
"vectorcraft-svg",
@@ -8630,7 +8641,7 @@ dependencies = [
[[package]]
name = "vectorcraft-color"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft-cms",
"craft-color-ui",
@@ -8646,7 +8657,7 @@ dependencies = [
[[package]]
name = "vectorcraft-doc"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"chrono",
"craft-image-codecs",
@@ -8662,13 +8673,13 @@ dependencies = [
"thiserror 2.0.21",
"tiff",
"vectorcraft-color",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
"zune-jpeg",
]
[[package]]
name = "vectorcraft-effects"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft-image-codecs",
"craft-svg",
@@ -8678,8 +8689,8 @@ dependencies = [
"svgtypes 0.16.1",
"vectorcraft-color",
"vectorcraft-doc",
- "vectorcraft-geom 0.25.0",
- "vectorcraft-pathops 0.25.0",
+ "vectorcraft-geom 0.25.1",
+ "vectorcraft-pathops 0.25.1",
"vectorcraft-plugins",
"vectorcraft-text",
"vectorcraft-three-d",
@@ -8689,7 +8700,7 @@ dependencies = [
[[package]]
name = "vectorcraft-engine"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"apple-native-keyring-store",
"cfb",
@@ -8738,10 +8749,10 @@ dependencies = [
"vectorcraft-doc",
"vectorcraft-eps",
"vectorcraft-format",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-js",
"vectorcraft-metafile",
- "vectorcraft-pathops 0.25.0",
+ "vectorcraft-pathops 0.25.1",
"vectorcraft-pdf",
"vectorcraft-plugins",
"vectorcraft-render",
@@ -8761,7 +8772,7 @@ dependencies = [
[[package]]
name = "vectorcraft-eps"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft-eps",
"craft-image-codecs",
@@ -8782,9 +8793,9 @@ dependencies = [
"vectorcraft-doc",
"vectorcraft-effects",
"vectorcraft-eps",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-metafile",
- "vectorcraft-pathops 0.25.0",
+ "vectorcraft-pathops 0.25.1",
"vectorcraft-pdf",
"vectorcraft-render",
"vectorcraft-testkit",
@@ -8793,7 +8804,7 @@ dependencies = [
[[package]]
name = "vectorcraft-format"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft-gzip",
"craft-vectorcraft-format",
@@ -8805,7 +8816,7 @@ dependencies = [
"thiserror 2.0.21",
"vectorcraft-brush",
"vectorcraft-doc",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-testkit",
]
@@ -8821,7 +8832,7 @@ dependencies = [
[[package]]
name = "vectorcraft-geom"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"kurbo 0.13.1",
"proptest",
@@ -8832,7 +8843,7 @@ dependencies = [
[[package]]
name = "vectorcraft-js"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"chrono",
"craft-xml",
@@ -8843,7 +8854,7 @@ dependencies = [
[[package]]
name = "vectorcraft-mcp"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft",
"craft-image-codecs",
@@ -8855,7 +8866,7 @@ dependencies = [
"vectorcraft-doc",
"vectorcraft-engine",
"vectorcraft-format",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-render",
"vectorcraft-svg",
"vectorcraft-testkit",
@@ -8864,7 +8875,7 @@ dependencies = [
[[package]]
name = "vectorcraft-metafile"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft-image-codecs",
"craft-metafile",
@@ -8874,7 +8885,7 @@ dependencies = [
"vectorcraft-color",
"vectorcraft-doc",
"vectorcraft-effects",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-text",
]
@@ -8891,19 +8902,19 @@ dependencies = [
[[package]]
name = "vectorcraft-pathops"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"kurbo 0.13.1",
"linesweeper",
"proptest",
"thiserror 2.0.21",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-testkit",
]
[[package]]
name = "vectorcraft-pdf"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"aes 0.8.4",
"chrono",
@@ -8932,7 +8943,7 @@ dependencies = [
"vectorcraft-color",
"vectorcraft-doc",
"vectorcraft-effects",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-pdf",
"vectorcraft-testkit",
"vectorcraft-text",
@@ -8940,7 +8951,7 @@ dependencies = [
[[package]]
name = "vectorcraft-plugin-worker"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"js-sys",
"vectorcraft-plugins",
@@ -8950,7 +8961,7 @@ dependencies = [
[[package]]
name = "vectorcraft-plugins"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft-image-codecs",
"craft-vectorcraft-format",
@@ -8962,7 +8973,7 @@ dependencies = [
"thiserror 2.0.21",
"vectorcraft-color",
"vectorcraft-doc",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-js",
"vectorcraft-plugins",
"wasmi",
@@ -8973,7 +8984,7 @@ dependencies = [
[[package]]
name = "vectorcraft-render"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft-gif",
"craft-image-codecs",
@@ -8991,7 +9002,7 @@ dependencies = [
"vectorcraft-color",
"vectorcraft-doc",
"vectorcraft-effects",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-plugins",
"vectorcraft-testkit",
"vectorcraft-text",
@@ -9004,7 +9015,7 @@ dependencies = [
[[package]]
name = "vectorcraft-scriptcheck"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"proptest",
"unicode-properties",
@@ -9012,7 +9023,7 @@ dependencies = [
[[package]]
name = "vectorcraft-svg"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft-docpath",
"craft-image-codecs",
@@ -9036,15 +9047,15 @@ dependencies = [
"vectorcraft-color",
"vectorcraft-doc",
"vectorcraft-effects",
- "vectorcraft-geom 0.25.0",
- "vectorcraft-pathops 0.25.0",
+ "vectorcraft-geom 0.25.1",
+ "vectorcraft-pathops 0.25.1",
"vectorcraft-testkit",
"vectorcraft-text",
]
[[package]]
name = "vectorcraft-testkit"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft-image-codecs",
"fax",
@@ -9055,14 +9066,14 @@ dependencies = [
"vectorcraft-doc",
"vectorcraft-engine",
"vectorcraft-format",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-render",
"vectorcraft-svg",
]
[[package]]
name = "vectorcraft-text"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft",
"craft-fonts-build",
@@ -9080,23 +9091,23 @@ dependencies = [
"unicode-script",
"unicode-segmentation",
"vectorcraft-doc",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
"vello_cpu",
"write-fonts",
]
[[package]]
name = "vectorcraft-three-d"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"proptest",
- "vectorcraft-geom 0.25.0",
- "vectorcraft-pathops 0.25.0",
+ "vectorcraft-geom 0.25.1",
+ "vectorcraft-pathops 0.25.1",
]
[[package]]
name = "vectorcraft-thumbnail-handler"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"png 0.18.1",
"windows",
@@ -9105,7 +9116,7 @@ dependencies = [
[[package]]
name = "vectorcraft-tools"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft-image-codecs",
"kurbo 0.13.1",
@@ -9115,15 +9126,15 @@ dependencies = [
"vectorcraft-color",
"vectorcraft-doc",
"vectorcraft-effects",
- "vectorcraft-geom 0.25.0",
- "vectorcraft-pathops 0.25.0",
+ "vectorcraft-geom 0.25.1",
+ "vectorcraft-pathops 0.25.1",
"vectorcraft-text",
"vectorcraft-tools",
]
[[package]]
name = "vectorcraft-trace"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft-image-codecs",
"image",
@@ -9131,12 +9142,12 @@ dependencies = [
"serde",
"serde_json",
"thiserror 2.0.21",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
]
[[package]]
name = "vectorcraft-ui-egui"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"bytemuck",
"chrono",
@@ -9160,7 +9171,7 @@ dependencies = [
"vectorcraft-engine",
"vectorcraft-eps",
"vectorcraft-format",
- "vectorcraft-geom 0.25.0",
+ "vectorcraft-geom 0.25.1",
"vectorcraft-pdf",
"vectorcraft-plugins",
"vectorcraft-render",
@@ -9175,7 +9186,7 @@ dependencies = [
[[package]]
name = "vectorcraft-web"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"craft",
"craft-web-api",
@@ -10067,7 +10078,7 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winit"
version = "0.30.13"
-source = "git+https://github.com/storytold/winit.git?rev=a517b3846ee8457d84ee4975110bfda6797c44dc#a517b3846ee8457d84ee4975110bfda6797c44dc"
+source = "git+https://github.com/storytold/winit.git?rev=0dfcec0eb62fda5904137a63a6dd0c3d83295f45#0dfcec0eb62fda5904137a63a6dd0c3d83295f45"
dependencies = [
"ahash",
"android-activity",
@@ -10404,7 +10415,7 @@ checksum = "9440ea3e5aeabb0ac63af70daf835274065238cdd0cec83418f417eae38bacee"
[[package]]
name = "xtask"
-version = "0.25.0"
+version = "0.25.1"
dependencies = [
"serde_json",
]
diff --git a/Cargo.toml b/Cargo.toml
index 7ad3e4cfeb..7720ce4b8a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,55 +4,57 @@ members = ["crates/*", "apps/*", "xtask"]
default-members = ["crates/*", "apps/vectorcraft", "apps/vectorcraft-cli", "xtask"]
[workspace.package]
-version = "0.25.0"
+version = "0.25.1"
edition = "2024"
license = "MIT OR Apache-2.0"
rust-version = "1.95"
[workspace.dependencies]
-craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", default-features = false, features = ["interpret", "write"] }
-craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
+craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", default-features = false, features = ["interpret", "write"] }
+craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
# Language packs: the Craft apps' shared font store installs them (#4936).
-craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
+craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
# The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON.
-craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
+craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
# `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile.
-craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", features = ["pcraft-pixels"] }
+craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", features = ["pcraft-pixels"] }
# Native Affinity documents (craft-libs#914).
-craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
+craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
# Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778).
-craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
+craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
# SVG parsing, limits, SVGZ and writer (craft-libs#778).
-craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", features = ["tree"] }
-craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
+craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", features = ["tree"] }
+craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
# EPS container, previews, ASCII85 and DSC comments (craft-libs#778).
-craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
+craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
# DXF tags, reader and writer (craft-libs#778, #926, #927).
-craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
+craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
# WMF, EMF and EMF+ reader (craft-libs#778).
-craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", default-features = false, features = ["read", "write"] }
-craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
+craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", default-features = false, features = ["read", "write"] }
+craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
# The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names
# the members it imports.
-craft = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
+craft = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
# Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui
# without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes.
-craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
+craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+# Nightly profile isolation, launch protocol, and security fence.
+craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
# internal
vectorcraft-geom = { path = "crates/geom" }
vectorcraft-color = { path = "crates/color" }
@@ -192,22 +194,22 @@ lto = "thin"
codegen-units = 1
[patch.crates-io]
-hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-krilla = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" }
-ecolor = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" }
-emath = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" }
-epaint = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" }
-epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" }
-egui = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" }
-egui-winit = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" }
-egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" }
-egui_glow = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" }
-egui_extras = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" }
-egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" }
-eframe = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" }
-winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" }
+hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+krilla = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d" }
+ecolor = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+emath = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+epaint = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+egui = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+egui-winit = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+egui_glow = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+egui_extras = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+eframe = { git = "https://github.com/storytold/egui.git", rev = "07c20531f89717e461c0f387dd1f9649553f9321" }
+winit = { git = "https://github.com/storytold/winit.git", rev = "0dfcec0eb62fda5904137a63a6dd0c3d83295f45" }
diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml
index ce4d1d3d44..2dedefa32f 100644
--- a/apps/vectorcraft-web/Cargo.toml
+++ b/apps/vectorcraft-web/Cargo.toml
@@ -28,7 +28,7 @@ egui_extras = { workspace = true }
# `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback.
eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] }
# The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft.
-craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", version = "0.1.0" }
+craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "2680a3b3fe464c7afa3d260b33a828fa94e12f6d", version = "0.1.0" }
wasm-bindgen = "0.2"
serde_json = { workspace = true }
diff --git a/apps/vectorcraft/Cargo.toml b/apps/vectorcraft/Cargo.toml
index d17c96eaf7..3ec7da1b75 100644
--- a/apps/vectorcraft/Cargo.toml
+++ b/apps/vectorcraft/Cargo.toml
@@ -22,6 +22,7 @@ vectorcraft-text = { workspace = true }
# frame policy and placement store (so VectorCraft matches the rest on Linux, see #217), printing and
# the update client.
craft = { workspace = true, features = ["ui", "ui-app", "settings", "automation", "platform", "window", "dialogs", "print", "update"] }
+craft-nightly = { workspace = true }
eframe = { workspace = true, features = ["clipboard", "default_fonts", "wayland", "x11"] }
egui = { workspace = true }
egui_extras = { workspace = true }
diff --git a/apps/vectorcraft/src/build_flavor.rs b/apps/vectorcraft/src/build_flavor.rs
index 9450a48972..93876b5cce 100644
--- a/apps/vectorcraft/src/build_flavor.rs
+++ b/apps/vectorcraft/src/build_flavor.rs
@@ -1,30 +1,13 @@
//! Build-time channel is distinct from a launch selector. A runtime environment cannot promote a
-//! stable build, and a nightly build refuses to start without its profile.
-use crate::launch_profile::Profile;
-use std::ffi::OsString;
+//! stable build, and a nightly build self-isolates into its canonical nightly profile root (or the
+//! profile root supplied by ArtCraft Launcher).
-#[derive(Clone, Copy, Debug, PartialEq, Eq)]
-pub enum BuildFlavor {
- Stable,
- NightlyV1,
-}
+pub use craft_nightly::BuildFlavor;
pub const COMPILED: BuildFlavor = if cfg!(vectorcraft_nightly_v1) { BuildFlavor::NightlyV1 } else { BuildFlavor::Stable };
-pub fn require_profile(flavor: BuildFlavor, profile: &Profile) -> Result<(), String> {
- match (flavor, profile.is_nightly()) {
- (BuildFlavor::NightlyV1, false) => Err("Open VectorCraft Nightly from ArtCraft Launcher".to_string()),
- (BuildFlavor::Stable, true) => Err("This is a stable VectorCraft build; nightly-v1 requires the nightly build".to_string()),
- _ => Ok(()),
- }
-}
-
-pub fn needs_native_error(flavor: BuildFlavor, desktop_session: bool) -> bool {
- desktop_session && flavor == BuildFlavor::NightlyV1
-}
-
-/// `--version` and `-V` on their own, before any other argument is read.
-pub fn version_query(args: &[OsString]) -> bool {
+/// An exact plain version query, before resolving any profile or environment paths.
+pub fn version_query(args: &[std::ffi::OsString]) -> bool {
matches!(args, [arg] if arg == "--version" || arg == "-V")
}
@@ -37,40 +20,19 @@ pub fn version(flavor: BuildFlavor, stable: &str) -> String {
#[cfg(test)]
mod tests {
- use super::*;
+ use super::{BuildFlavor, version, version_query};
#[test]
- fn only_a_nightly_desktop_refusal_requests_a_native_dialog() {
- assert!(needs_native_error(BuildFlavor::NightlyV1, true));
- assert!(!needs_native_error(BuildFlavor::NightlyV1, false));
- assert!(!needs_native_error(BuildFlavor::Stable, true));
- assert!(!needs_native_error(BuildFlavor::Stable, false));
- }
-
- #[test]
- fn nightly_build_without_a_profile_is_refused_before_startup() {
- let started = std::cell::Cell::new(false);
- let result = require_profile(BuildFlavor::NightlyV1, &Profile::Stable).map(|()| started.set(true));
- assert!(result.unwrap_err().contains("ArtCraft Launcher"));
- assert!(!started.get());
- }
-
- #[test]
- fn stable_and_nightly_flavors_accept_only_their_own_profile() {
- let nightly = Profile::NightlyV1(std::path::PathBuf::from("already validated root"));
- assert!(require_profile(BuildFlavor::Stable, &Profile::Stable).is_ok());
- assert!(require_profile(BuildFlavor::Stable, &nightly).is_err());
- assert!(require_profile(BuildFlavor::NightlyV1, &nightly).is_ok());
- assert!(require_profile(BuildFlavor::NightlyV1, &Profile::Stable).is_err());
- }
-
- #[test]
- fn nightly_version_query_is_unambiguous_and_never_reinterprets_file_arguments() {
- assert_eq!(version(BuildFlavor::Stable, "0.24.1"), "0.24.1");
- assert_eq!(version(BuildFlavor::NightlyV1, "0.24.1"), "0.24.1 (nightly-v1)");
+ fn plain_version_query_is_exact() {
assert!(version_query(&["--version".into()]));
assert!(version_query(&["-V".into()]));
assert!(!version_query(&["--".into(), "--version".into()]));
assert!(!version_query(&[]));
}
+
+ #[test]
+ fn version_labels_nightly_without_changing_stable() {
+ assert_eq!(version(BuildFlavor::Stable, "0.24.1"), "0.24.1");
+ assert_eq!(version(BuildFlavor::NightlyV1, "0.24.1"), "0.24.1 (nightly-v1)");
+ }
}
diff --git a/apps/vectorcraft/src/launch_profile.rs b/apps/vectorcraft/src/launch_profile.rs
index 12615dd81d..d986f28d71 100644
--- a/apps/vectorcraft/src/launch_profile.rs
+++ b/apps/vectorcraft/src/launch_profile.rs
@@ -1,130 +1,28 @@
-//! Launcher-owned nightly-v1 bootstrap. Selected before logging, updates, fonts or saved state.
-//! Stable launches retain their original arguments and directory policy.
-//!
-//! The protocol is `vectorcraft --launch-profile nightly-v1 --profile-root -- [files…]`: the
-//! selector and the root are separate tokens, exactly once each, and everything after `--` is a file
-//! even when it looks like one of them. The Launcher's version check
-//! (`… --version`) is answered before the root is validated or touched.
+//! Nightly-v1 bootstrap backed by [`craft_nightly`]. Selected before logging, updates, fonts or
+//! saved state. Stable launches retain their original arguments and directory policy; direct
+//! nightly launches self-isolate into [`craft_nightly::canonical_profile_root`], while ArtCraft
+//! Launcher can supply `--launch-profile nightly-v1 --profile-root -- [args…]`.
use std::ffi::OsString;
-use std::path::{Component, Path, PathBuf};
-use std::sync::OnceLock;
-pub const VERSION: &str = "nightly-v1";
+pub use craft_nightly::NIGHTLY_V1_CONTRACT as VERSION;
+use craft_nightly::{BuildFlavor, Launch, Profile, ProfileError, StartupOptions};
-#[derive(Clone, Debug, PartialEq, Eq)]
-pub enum Profile {
- Stable,
- NightlyV1(PathBuf),
-}
-
-impl Profile {
- pub fn is_nightly(&self) -> bool {
- matches!(self, Self::NightlyV1(_))
- }
-
- pub fn root(&self) -> Option<&Path> {
- match self {
- Self::Stable => None,
- Self::NightlyV1(root) => Some(root),
- }
- }
-}
-
-#[derive(Debug, PartialEq, Eq)]
-pub struct Launch {
- pub profile: Profile,
- pub args: Vec,
-}
-
-static PROFILE: OnceLock = OnceLock::new();
+static STABLE: Profile = Profile::Stable;
pub fn current() -> &'static Profile {
- PROFILE.get().unwrap_or(&Profile::Stable)
+ craft_nightly::current().unwrap_or(&STABLE)
}
-pub fn install(profile: Profile) -> Result<(), String> {
- PROFILE.set(profile).map_err(|_| "the launch profile was already selected".to_string())
-}
-
-/// Recognize only the agreed literal selector/root pair before `--`. No filesystem or startup hook
-/// runs here.
-pub fn parse(args: Vec) -> Result {
- let mut selector = None;
- let mut root = None;
- let mut other = Vec::new();
- let mut files = Vec::new();
- let mut iter = args.iter();
- let mut delimiter = false;
- while let Some(arg) = iter.next() {
- if arg == "--" {
- delimiter = true;
- files.extend(iter.cloned());
- break;
- }
- if arg == "--launch-profile" || arg == "--profile-root" {
- let slot = if arg == "--launch-profile" { &mut selector } else { &mut root };
- if slot.is_some() {
- return Err("the profile selector and root must each occur exactly once".to_string());
- }
- let value = iter.next().filter(|v| !v.is_empty()).ok_or_else(|| "the profile selector/root needs a value".to_string())?;
- if value.to_string_lossy().starts_with("--") {
- return Err("the profile selector/root needs a value".to_string());
- }
- *slot = Some(value.clone());
- } else if arg.to_string_lossy().starts_with("--launch-profile=") || arg.to_string_lossy().starts_with("--profile-root=") {
- return Err("the nightly protocol requires separate literal selector/root argument tokens".to_string());
- } else {
- other.push(arg.clone());
- }
- }
- match (selector, root) {
- (None, None) => Ok(Launch { profile: Profile::Stable, args }),
- (Some(version), Some(root)) if version == VERSION => {
- if !delimiter || !other.is_empty() {
- return Err("nightly-v1 accepts only its selector/root followed by -- and file names".to_string());
- }
- let root = PathBuf::from(root);
- if !root.is_absolute() || root.components().any(|c| matches!(c, Component::ParentDir)) {
- return Err("the nightly profile root must be absolute and contain no parent traversal".to_string());
- }
- Ok(Launch { profile: Profile::NightlyV1(root), args: std::iter::once(OsString::from("--")).chain(files).collect() })
- }
- (Some(_), Some(_)) => Err("unsupported launch profile (expected nightly-v1)".to_string()),
- _ => Err("--launch-profile and --profile-root must be supplied together".to_string()),
- }
-}
-
-/// The Launcher's version check: the selector/root pair followed by exactly `--version` (or `-V`),
-/// answered like a plain version query. Only [`parse`]'s lexical checks apply; the root is never
-/// validated or touched, and `-- --version` stays a file name.
-pub fn version_query(args: &[OsString]) -> bool {
- let Some((last, pair)) = args.split_last() else { return false };
- if last != "--version" && last != "-V" {
- return false;
- }
- let lexical = pair.iter().cloned().chain(std::iter::once(OsString::from("--"))).collect();
- matches!(parse(lexical), Ok(Launch { profile: Profile::NightlyV1(_), args }) if args.len() == 1)
-}
-
-/// Validation finishes before the caller's first startup effect. Stable never calls the nightly root
-/// validator, so its portable and config resolution stays unchanged.
-pub fn prepare(mut launch: Launch, validate: impl FnOnce(&Path) -> Result) -> Result {
- if let Profile::NightlyV1(root) = &launch.profile {
- launch.profile = Profile::NightlyV1(validate(root)?);
- }
- Ok(launch)
-}
-
-/// Resolve the selected private root before the caller's first startup effect.
-pub fn validate_root(root: &Path, env: impl Fn(&str) -> Option, exe: Option<&Path>) -> Result {
- crate::profile_root::validate(root, env, exe, crate::prefs_dir::profile::ensure_writable)
+pub fn prepare_launch(flavor: BuildFlavor, args: impl IntoIterator- ) -> Result {
+ let spec = crate::profile_root::app_profile_spec();
+ craft_nightly::prepare_launch(flavor, &spec, args, &StartupOptions::default())
}
/// The arguments a child of this process starts with: a nightly launch hands its profile on, so the
-/// child opens the same private profile instead of being refused ("Open VectorCraft Nightly…"), and
-/// `--` keeps a file whose name starts with '-' a file. Stable's child arguments are unchanged.
-/// Only `single_instance` starts a child, and macOS does not build it.
+/// child opens the same private profile, and `--` keeps a file whose name starts with '-' a file.
+/// Stable's child arguments are unchanged. Only `single_instance` starts a child, and macOS does
+/// not build it.
#[cfg(not(target_os = "macos"))]
pub fn child_args(files: &[String]) -> Vec {
child_args_for(current(), files)
@@ -132,21 +30,24 @@ pub fn child_args(files: &[String]) -> Vec {
#[cfg(not(target_os = "macos"))]
fn child_args_for(profile: &Profile, files: &[String]) -> Vec {
- let mut args: Vec = match profile {
- Profile::Stable => Vec::new(),
- Profile::NightlyV1(root) => {
- vec![OsString::from("--launch-profile"), OsString::from(VERSION), OsString::from("--profile-root"), root.clone().into_os_string()]
- }
- };
- args.push(OsString::from("--"));
- args.extend(files.iter().map(OsString::from));
- args
+ let delimited: Vec = std::iter::once(OsString::from("--")).chain(files.iter().map(OsString::from)).collect();
+ match profile {
+ Profile::Stable => delimited,
+ Profile::NightlyV1(root) => craft_nightly::launch_arguments(root, &delimited),
+ }
}
#[cfg(test)]
mod tests {
- use super::*;
- use std::cell::Cell;
+ use std::ffi::OsString;
+ use std::path::PathBuf;
+
+ use craft_nightly::{BuildFlavor, Profile, ProfileError, StartupOptions, canonical_profile_root, parse_startup};
+
+ use super::VERSION;
+ #[cfg(not(target_os = "macos"))]
+ use super::child_args_for;
+ use crate::profile_root::app_profile_spec;
fn args(values: &[&str]) -> Vec {
values.iter().map(OsString::from).collect()
@@ -156,95 +57,72 @@ mod tests {
if cfg!(windows) { r"C:\NightlyData\profiles\vectorcraft" } else { "/nightly-data/profiles/vectorcraft" }
}
- fn nightly() -> Vec {
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--"])
- }
-
#[test]
- fn stable_arguments_and_directory_policy_are_unchanged() {
+ fn stable_arguments_are_unchanged_and_nightly_flags_are_refused() {
+ let spec = app_profile_spec();
for argv in [args(&[]), args(&["--new-instance", "a.svg"]), args(&["--", "--launch-profile", "file.svg"])] {
- let launch = prepare(parse(argv.clone()).unwrap(), |_| panic!("stable must never validate a nightly root")).unwrap();
- assert_eq!(launch, Launch { profile: Profile::Stable, args: argv });
+ let launch = parse_startup(BuildFlavor::Stable, &spec, argv.clone(), &StartupOptions::default()).unwrap();
+ assert_eq!(launch.profile, Profile::Stable);
+ assert_eq!(launch.passthrough_args, argv);
}
+
+ let nightly_flags = args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--"]);
+ let err = parse_startup(BuildFlavor::Stable, &spec, nightly_flags, &StartupOptions::default()).unwrap_err();
+ assert!(matches!(err, ProfileError::NightlyFlagsInStableBuild));
}
#[test]
- fn exact_version_and_root_are_parsed_without_reinterpreting_file_names() {
- let mut argv = nightly();
- argv.extend(args(&["--profile-root", "art with spaces.svg"]));
- let launch = parse(argv).unwrap();
+ fn nightly_direct_launch_self_isolates_into_canonical_profile_root() {
+ let spec = app_profile_spec();
+ let expected_root = canonical_profile_root("vectorcraft").unwrap();
+
+ let empty = parse_startup(BuildFlavor::NightlyV1, &spec, Vec::new(), &StartupOptions::default()).unwrap();
+ assert_eq!(empty.profile, Profile::NightlyV1(expected_root.clone()));
+ assert!(empty.passthrough_args.is_empty());
+
+ let with_args = parse_startup(BuildFlavor::NightlyV1, &spec, args(&["--safe-mode", "art.svg"]), &StartupOptions::default()).unwrap();
+ assert_eq!(with_args.profile, Profile::NightlyV1(expected_root));
+ assert_eq!(with_args.passthrough_args, args(&["--safe-mode", "art.svg"]));
+ }
+
+ #[test]
+ fn explicit_launcher_arguments_preserve_profile_root_and_user_args() {
+ let spec = app_profile_spec();
+ let argv = args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--", "--profile-root", "art with spaces.svg"]);
+ let launch = parse_startup(BuildFlavor::NightlyV1, &spec, argv, &StartupOptions::default()).unwrap();
assert_eq!(launch.profile, Profile::NightlyV1(PathBuf::from(absolute())));
- assert_eq!(launch.args, args(&["--", "--profile-root", "art with spaces.svg"]));
+ assert_eq!(launch.passthrough_args, args(&["--profile-root", "art with spaces.svg"]));
}
#[test]
- fn missing_duplicate_unknown_and_conflicting_profile_arguments_are_refused() {
- for argv in [
- args(&["--launch-profile", VERSION]),
- args(&["--profile-root", absolute()]),
- args(&["--launch-profile", "future-v2", "--profile-root", absolute(), "--"]),
- args(&["--launch-profile", VERSION, "--launch-profile", VERSION, "--profile-root", absolute(), "--"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--profile-root", absolute(), "--"]),
- args(&["--launch-profile", VERSION, "--profile-root", "relative", "--"]),
- args(&["--launch-profile", VERSION, "--profile-root", "../escape", "--"]),
- args(&["--launch-profile", VERSION, "--profile-root", "", "--"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--new-instance", "--"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute()]),
- ] {
- assert!(parse(argv.clone()).is_err(), "{argv:?}");
- }
- }
-
- #[test]
- fn the_launcher_version_check_is_a_version_query_only_in_its_exact_form() {
- let pair = &["--launch-profile", VERSION, "--profile-root", absolute()];
- let reversed = &["--profile-root", absolute(), "--launch-profile", VERSION];
+ fn version_queries_are_recognized_plain_and_via_launcher() {
+ let spec = app_profile_spec();
for flag in ["--version", "-V"] {
- for form in [pair, reversed] {
- let mut argv = args(form);
- argv.push(flag.into());
- assert!(version_query(&argv), "{argv:?}");
+ for argv in [
+ args(&[flag]),
+ args(&["--launch-profile", VERSION, "--profile-root", absolute(), flag]),
+ args(&["--profile-root", absolute(), "--launch-profile", VERSION, flag]),
+ args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--", flag]),
+ ] {
+ let launch = parse_startup(BuildFlavor::NightlyV1, &spec, argv.clone(), &StartupOptions::default()).unwrap();
+ assert!(launch.is_version_query(), "{argv:?}");
}
}
- for argv in [
- args(&["--version"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--", "--version"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--version", "--"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--new-instance", "--version"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--version", "--version"]),
- args(&["--version", "--launch-profile", VERSION, "--profile-root", absolute()]),
- args(&["--launch-profile", "future-v2", "--profile-root", absolute(), "--version"]),
- args(&["--launch-profile", VERSION, "--profile-root", "relative", "--version"]),
- args(&["--launch-profile", VERSION, "--version"]),
- args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--help"]),
- ] {
- assert!(!version_query(&argv), "{argv:?}");
- }
- // Outside the query the strict protocol still refuses the version flag.
- assert!(parse(args(&["--launch-profile", VERSION, "--profile-root", absolute(), "--version"])).is_err());
}
#[test]
- fn failed_root_validation_never_reaches_startup_or_falls_back_to_stable() {
- let reached = Cell::new(false);
- let result = prepare(parse(nightly()).unwrap(), |_| Err("read-only or unsafe profile".to_string())).map(|_| reached.set(true));
- assert!(result.is_err());
- assert!(!reached.get());
- }
-
- #[test]
- fn successful_root_validation_keeps_the_persistent_root_not_the_binary_tag() {
- let checked = PathBuf::from(absolute()).join("checked");
- let launch = prepare(parse(nightly()).unwrap(), |_| Ok(checked.clone())).unwrap();
- assert_eq!(launch.profile.root(), Some(checked.as_path()));
- assert!(launch.profile.is_nightly());
- }
-
- #[test]
- fn a_joined_flag_form_is_refused() {
- for joined in [format!("--launch-profile={VERSION}"), format!("--profile-root={}", absolute())] {
- let argv = vec![OsString::from(joined), OsString::from("--")];
- assert!(parse(argv).is_err());
+ fn version_and_document_arguments_are_not_a_version_only_query() {
+ let spec = app_profile_spec();
+ for flag in ["--version", "-V"] {
+ for argv in [
+ args(&[flag, "art with spaces.svg"]),
+ args(&["--launch-profile", VERSION, "--profile-root", absolute(), flag, "art with spaces.svg"]),
+ args(&["--profile-root", absolute(), "--launch-profile", VERSION, flag, "art with spaces.svg"]),
+ ] {
+ let launch = parse_startup(BuildFlavor::NightlyV1, &spec, argv, &StartupOptions::default()).unwrap();
+ assert!(!launch.is_version_query());
+ assert_eq!(launch.passthrough_args, args(&[flag, "art with spaces.svg"]));
+ }
}
}
@@ -258,6 +136,7 @@ mod tests {
#[cfg(not(target_os = "macos"))]
#[test]
fn a_nightly_child_inherits_the_selected_profile() {
+ let spec = app_profile_spec();
let root = PathBuf::from(absolute());
let child = child_args_for(&Profile::NightlyV1(root.clone()), &["art.svg".to_string()]);
let expected = vec![
@@ -266,12 +145,12 @@ mod tests {
OsString::from("--profile-root"),
root.into_os_string(),
OsString::from("--"),
+ OsString::from("--"),
OsString::from("art.svg"),
];
assert_eq!(child, expected);
- // The child's own parse finds the same profile and the file list.
- let launch = parse(child).unwrap();
+ let launch = parse_startup(BuildFlavor::NightlyV1, &spec, child, &StartupOptions::default()).unwrap();
assert!(launch.profile.is_nightly());
- assert_eq!(launch.args, args(&["--", "art.svg"]));
+ assert_eq!(launch.passthrough_args, args(&["--", "art.svg"]));
}
}
diff --git a/apps/vectorcraft/src/main.rs b/apps/vectorcraft/src/main.rs
index 5a7d3e33ba..6ab6778597 100644
--- a/apps/vectorcraft/src/main.rs
+++ b/apps/vectorcraft/src/main.rs
@@ -112,6 +112,43 @@ use prefs::{load_prefs, log_dir, open_store, prefs_enabled};
const DEFAULT_SIZE: [f32; 2] = [1440.0, 900.0];
const MIN_SIZE: [f32; 2] = [800.0, 500.0];
+/// Apply the saved main-window placement before the first frame. On a first launch the
+/// framework maximizes the window when its default size would not fit the current screen.
+fn restore_main_window(window: &winit::window::Window, store: &Store, legacy: Option, wayland: bool) {
+ use craft::behavior::placement::{Defaults, Placement, place};
+ use craft::behavior::{Monitor, MonitorKey};
+ use winit::dpi::{LogicalSize, PhysicalPosition};
+
+ let handles: Vec<_> = window.available_monitors().collect();
+ let monitors: Vec<_> = handles
+ .iter()
+ .map(|monitor| {
+ let size = monitor.size();
+ let size = [size.width, size.height];
+ let position = monitor.position();
+ Monitor::new(MonitorKey::new(monitor.name().unwrap_or_default(), size), [position.x, position.y], size, monitor.scale_factor() as f32)
+ })
+ .collect();
+ let home = window.current_monitor().or_else(|| window.primary_monitor()).and_then(|monitor| handles.iter().position(|m| *m == monitor));
+ let defaults = Defaults::new(DEFAULT_SIZE, MIN_SIZE).with_no_position(wayland);
+ let saved = store.get(craft::window::restore::MAIN).or_else(|| {
+ let old = legacy?;
+ let mut placement = Placement::new(old.size, window.scale_factor() as f32);
+ placement.position_px = old.pos;
+ placement.maximized = old.maximized;
+ placement.repaired()
+ });
+ let placement = place(saved.as_ref(), &monitors, home, &defaults);
+ if let Some([x, y]) = placement.position_px {
+ window.set_outer_position(PhysicalPosition::new(x, y));
+ }
+ let [width, height] = placement.normal.size;
+ let _ = window.request_inner_size(LogicalSize::new(width, height));
+ if placement.maximized {
+ window.set_maximized(true);
+ }
+}
+
/// The window, Dock, taskbar and app-switcher icon (`assets/app-icon/`, see its README). macOS gets
/// the version with Apple's transparent margin; elsewhere the full-bleed tile. The app ID matches
/// `packaging/linux/ai.storyteller.vectorcraft.desktop` so Wayland docks find the launcher icon.
@@ -384,58 +421,47 @@ fn channel_name() -> &'static str {
/// Says why a nightly launch was refused, then exits 2. A window could not have shown it yet: this
/// app has no message box of its own before eframe starts (its dialogs are egui windows), so the
-/// text goes to standard error, which a Launcher launch records. The desktop-session test still
-/// decides whether a daily user would have seen it, for the message's wording.
+/// text goes to standard error, which a Launcher launch records.
fn report_launch_profile_error(error: &str) {
eprintln!("VectorCraft launch profile: {error}");
- let desktop_session = cfg!(windows)
- || cfg!(target_os = "macos")
- || (cfg!(target_os = "linux") && ["DISPLAY", "WAYLAND_DISPLAY"].into_iter().any(|key| std::env::var_os(key).is_some_and(|v| !v.is_empty())));
- if build_flavor::needs_native_error(build_flavor::COMPILED, desktop_session) {
- eprintln!("VectorCraft Nightly: open it from ArtCraft Launcher, which starts it in its own profile");
- }
+}
+
+fn write_nightly_version() {
+ use std::io::Write as _;
+ let line = format!("VectorCraft {}\n", build_flavor::version(build_flavor::COMPILED, env!("VECTORCRAFT_BUILT_VERSION")));
+ let _ = std::io::stdout().write_all(line.as_bytes());
}
/// Selects the immutable launch profile before any startup service or side effect, and returns the
/// arguments the rest of `main` reads. `None` means the process ends here (`--version` answered).
fn prepare_launch() -> Option> {
- // The trusted Launcher protocol is decided before the logger, updates, fonts or any saved state.
+ // The launch profile is decided before the logger, updates, fonts or any saved state.
let argv: Vec<_> = std::env::args_os().skip(1).collect();
- // A nightly answers its version before root validation, process identity, IPC or any window:
- // plain `--version`/`-V`, or the Launcher's `--launch-profile nightly-v1 --profile-root
- // --version`. A stable build leaves the answer to `read_command_line`, exactly as before.
- if build_flavor::COMPILED == build_flavor::BuildFlavor::NightlyV1 && (build_flavor::version_query(&argv) || launch_profile::version_query(&argv))
- {
- use std::io::Write as _;
- let line = format!("VectorCraft {}\n", build_flavor::version(build_flavor::COMPILED, env!("VECTORCRAFT_BUILT_VERSION")));
- let _ = std::io::stdout().write_all(line.as_bytes());
+ // A plain nightly version query does not even need the OS home/data root to resolve.
+ if build_flavor::COMPILED == build_flavor::BuildFlavor::NightlyV1 && build_flavor::version_query(&argv) {
+ write_nightly_version();
+ return None;
+ }
+ let early = launch_profile::prepare_launch(build_flavor::COMPILED, argv).unwrap_or_else(|error| {
+ report_launch_profile_error(&error.to_string());
+ std::process::exit(2)
+ });
+ // A launcher version query also exits before process identity, IPC or any window.
+ // `craft_nightly::prepare_launch` skips root preparation for version queries.
+ // A stable build leaves the answer to `read_command_line`, exactly as before.
+ if build_flavor::COMPILED == build_flavor::BuildFlavor::NightlyV1 && early.is_version_query() {
+ write_nightly_version();
return None;
}
- let early = launch_profile::parse(argv)
- .and_then(|launch| {
- build_flavor::require_profile(build_flavor::COMPILED, &launch.profile)?;
- Ok(launch)
- })
- .and_then(|launch| {
- launch_profile::prepare(launch, |root| {
- launch_profile::validate_root(root, |key| std::env::var_os(key), std::env::current_exe().ok().as_deref())
- })
- })
- .unwrap_or_else(|error| {
- report_launch_profile_error(&error);
- std::process::exit(2)
- });
let nightly = early.profile.is_nightly();
let identity =
if nightly { vectorcraft_ui_egui::os_window::LaunchIdentity::NightlyV1 } else { vectorcraft_ui_egui::os_window::LaunchIdentity::Stable };
- let install = launch_profile::install(early.profile).and_then(|()| {
- // Every data path follows the selected profile from here on: settings, logs, recovery, the
- // user's libraries, plug-ins, caches and the single-instance record.
- if let Some(root) = launch_profile::current().root() {
- prefs_dir::profile::install_data_root(root.to_path_buf())?;
- }
- vectorcraft_ui_egui::os_window::select_identity(identity)
- });
+ // Every data path follows the selected profile from here on: settings, logs, recovery, the
+ // user's libraries, plug-ins, caches and the single-instance record.
+ let install = launch_profile::current()
+ .root()
+ .map_or(Ok(()), |root| prefs_dir::profile::install_data_root(root.to_path_buf()))
+ .and_then(|()| vectorcraft_ui_egui::os_window::select_identity(identity));
if let Err(error) = install {
report_launch_profile_error(&error);
std::process::exit(2);
@@ -453,11 +479,11 @@ fn prepare_launch() -> Option> {
// The window's identity, not the profile, failed: main's own failure status (1).
std::process::exit(1);
}
- Some(early.args)
+ Some(early.passthrough_args)
}
/// The arguments the rest of `main` reads: a nightly's profile tokens were consumed by
-/// `prepare_launch`, so what is left is `--` and the files to open. A stable launch reads its
+/// `prepare_launch`, leaving any user flags and files to open. A stable launch reads its
/// arguments exactly as it always did.
fn launch_arguments(nightly: bool, arguments: &[std::ffi::OsString]) -> Vec {
if nightly { arguments.iter().map(|a| a.to_string_lossy().into_owned()).collect() } else { std::env::args().skip(1).collect() }
@@ -520,8 +546,9 @@ fn finish_pending_update(nightly: bool) {
}
fn main() -> std::process::ExitCode {
- // The launch profile first: a nightly build without one is refused here, before the update
- // helper, the logger, fonts or any saved state, and `--version` is answered here too.
+ // The launch profile first: a nightly build self-isolates or uses the Launcher's profile here,
+ // before the update helper, the logger, fonts or any saved state, and `--version` is answered
+ // here too.
let Some(arguments) = prepare_launch() else { return std::process::ExitCode::SUCCESS };
let nightly = launch_profile::current().is_nightly();
#[cfg(windows)]
@@ -791,9 +818,13 @@ fn main() -> std::process::ExitCode {
Box::new(move |cc| {
let ctx = &cc.egui_ctx;
let winit_window = cc.winit_window().cloned();
+ let placement = placement_store();
+ if let Some(window) = &winit_window {
+ restore_main_window(window, &placement, settings.lock().get().ui.legacy_window, wayland);
+ }
let spec = InstallSpec::new(shell_info, Arc::new(SystemWindows))
.app_id(vectorcraft_ui_egui::os_window::app_id())
- .placement(Arc::new(Mutex::new(placement_store())))
+ .placement(Arc::new(Mutex::new(placement)))
.frame(decision);
let spec = match start_pen(&winit_window) {
Some(pen) => spec.pen(pen),
@@ -808,7 +839,7 @@ fn main() -> std::process::ExitCode {
};
let (files, file_panels) = file_service(wake, folders);
let files = Arc::new(files);
- craft::host::Host::builder(AppInfo {
+ let host = craft::host::Host::builder(AppInfo {
id: vectorcraft_ui_egui::os_window::SETTINGS_APP_ID,
name: vectorcraft_ui_egui::os_window::name(),
version: vectorcraft_ui_egui::os_window::version(),
@@ -816,7 +847,8 @@ fn main() -> std::process::ExitCode {
.i18n(vectorcraft_ui_egui::i18n::shared())
.settings(Arc::new(settings.clone()))
.files(files.clone())
- .install(ctx);
+ .build();
+ host.clone().install(ctx);
let mut session = Session::new();
// The profiles loaded before come back before the preferences name any of them.
prefs_dir::attach_profile_store(&mut session);
@@ -841,6 +873,7 @@ fn main() -> std::process::ExitCode {
prefs_dir::attach_proof_setups(&mut session);
prefs_dir::attach_script_data(&mut session);
let mut app = VectorcraftApp::new(session, services(winit_window.clone()));
+ app.host = Arc::new(host);
app.adopt_context(&cc.egui_ctx);
// A nightly is updated by the Launcher: it never checks for a stable release, which
// would install this program's own updater over the nightly build.
diff --git a/apps/vectorcraft/src/profile_root.rs b/apps/vectorcraft/src/profile_root.rs
index 7f46e77766..d5ae707a17 100644
--- a/apps/vectorcraft/src/profile_root.rs
+++ b/apps/vectorcraft/src/profile_root.rs
@@ -1,264 +1,17 @@
-//! App-owned nightly profile fences: a profile every one of VectorCraft's data paths is redirected
-//! into ([`crate::prefs_dir::profile::install_data_root`]), and that never overlaps stable's folders, a portable
-//! copy or an installation.
+//! App-owned nightly profile specification for [`craft_nightly`]: describes VectorCraft's stable
+//! directories, forbidden environment variables, portable markers, folder-only profile entries, and
+//! extra installation/package boundaries so a nightly profile never overlaps stable state.
use std::ffi::OsString;
-use std::path::{Component, Path, PathBuf};
+use std::path::{Path, PathBuf};
-use crate::prefs_dir::profile::PORTABLE_DATA_DIR;
+use craft_nightly::AppProfileSpec;
-#[derive(Clone, Copy, Debug, PartialEq, Eq)]
-enum Platform {
- Windows,
- Linux,
- Mac,
-}
+use crate::prefs_dir::profile::{PORTABLE_DATA_DIR, PORTABLE_MARKERS};
-impl Platform {
- fn current() -> Result {
- match std::env::consts::OS {
- "windows" => Ok(Self::Windows),
- "linux" => Ok(Self::Linux),
- "macos" => Ok(Self::Mac),
- other => Err(format!("nightly-v1 is not defined for this operating system ({other})")),
- }
- }
+const STABLE_DIR_NAMES: [&str; 2] = ["VectorCraft", "vectorcraft"];
- fn ignores_case(self) -> bool {
- self != Self::Linux
- }
-}
-
-fn absolute(path: PathBuf, label: &str) -> Result {
- if !path.is_absolute() || path.components().any(|c| matches!(c, Component::ParentDir)) {
- return Err(format!("{label} must be absolute and contain no parent traversal"));
- }
- Ok(path)
-}
-
-fn required_base(env: &impl Fn(&str) -> Option, key: &str) -> Result {
- let value = env(key).filter(|v| !v.is_empty()).ok_or_else(|| format!("cannot establish the stable {key} boundary"))?;
- absolute(PathBuf::from(value), key)
-}
-
-fn xdg_base(env: &impl Fn(&str) -> Option, key: &str, fallback: &str) -> Result {
- match env(key).filter(|v| !v.is_empty()) {
- Some(value) => absolute(PathBuf::from(value), key),
- None => Ok(required_base(env, "HOME")?.join(fallback)),
- }
-}
-
-/// Resolve existing ancestors before creating anything. A dangling link or an inaccessible ancestor
-/// is not a missing directory that may be replaced or followed later.
-fn canonical_future(path: &Path) -> Result {
- let mut parent = path;
- let mut missing = Vec::new();
- loop {
- match std::fs::symlink_metadata(parent) {
- Ok(_) => break,
- Err(error) if error.kind() == std::io::ErrorKind::NotFound => {
- missing.push(parent.file_name().ok_or_else(|| "the profile root has no existing ancestor".to_string())?.to_os_string());
- parent = parent.parent().ok_or_else(|| "the profile root has no existing ancestor".to_string())?;
- }
- Err(error) => return Err(format!("cannot inspect the profile boundary: {error}")),
- }
- }
- let mut resolved = std::fs::canonicalize(parent).map_err(|e| format!("cannot resolve the profile boundary: {e}"))?;
- for part in missing.into_iter().rev() {
- resolved.push(part);
- }
- Ok(resolved)
-}
-
-/// A stable entry point may be a dangling link once its target is uninstalled. Its own name is still
-/// the fence, so only the folder it lives in is resolved: a link that cannot be resolved would refuse
-/// every launch, a valid private profile included.
-fn canonical_future_entry(path: &Path) -> Result {
- let parent = path.parent().ok_or_else(|| "an entry point has no folder".to_string())?;
- let name = path.file_name().ok_or_else(|| "an entry point has no name".to_string())?;
- Ok(canonical_future(parent)?.join(name))
-}
-
-fn overlaps(a: &Path, b: &Path, platform: Platform) -> bool {
- let parts = |p: &Path| {
- p.components()
- .map(|c| {
- let value = c.as_os_str().to_string_lossy().into_owned();
- if platform.ignores_case() { value.to_lowercase() } else { value }
- })
- .collect::>()
- };
- let (a, b) = (parts(a), parts(b));
- a.starts_with(&b) || b.starts_with(&a)
-}
-
-fn installation_boundary(platform: Platform, exe: &Path) -> Result {
- let parent = exe.parent().ok_or_else(|| "cannot establish the installation boundary".to_string())?;
- if platform == Platform::Mac {
- // A profile in Resources is still inside the versioned install, not beside MacOS.
- if let Some(bundle) = exe.ancestors().find(|p| p.extension().is_some_and(|ext| ext.eq_ignore_ascii_case("app"))) {
- return Ok(bundle.to_path_buf());
- }
- }
- Ok(parent.to_path_buf())
-}
-
-/// Every folder a stable VectorCraft keeps user state in, on `platform`: the settings folder each
-/// platform convention and the portable layout use, the eframe window state, the logs, the recovery
-/// copies, the plug-ins, the caches, the install folders and the entry points. A nightly profile that
-/// overlapped any of them would read, rewrite or prune stable's own state.
-fn forbidden_roots(platform: Platform, env: &impl Fn(&str) -> Option, exe: &Path) -> Result, String> {
- let mut roots = match platform {
- Platform::Windows => {
- // The settings folder (`profile.rs`) and the eframe window state, which eframe puts under
- // `%APPDATA%\ai.storyteller.vectorcraft\data` (the window id).
- let mut roots = ["APPDATA", "LOCALAPPDATA"]
- .into_iter()
- .map(|key| required_base(env, key).map(|p| p.join("VectorCraft")))
- .collect::, _>>()?;
- roots.push(required_base(env, "APPDATA")?.join("ai.storyteller.vectorcraft"));
- // The MSI's default per-user and per-machine folders (install-policy.wxi). A custom
- // install folder is not known here; the executable's own folder is fenced below.
- roots.push(required_base(env, "LOCALAPPDATA")?.join("Programs").join("ArtCraft").join("VectorCraft"));
- for key in ["ProgramW6432", "ProgramFiles", "ProgramFiles(x86)"] {
- if let Some(base) = env(key).filter(|v| !v.is_empty()) {
- roots.push(absolute(PathBuf::from(base), key)?.join("ArtCraft").join("VectorCraft"));
- }
- }
- roots
- }
- Platform::Linux => {
- let mut roots =
- [("XDG_CONFIG_HOME", ".config"), ("XDG_DATA_HOME", ".local/share"), ("XDG_CACHE_HOME", ".cache"), ("XDG_STATE_HOME", ".local/state")]
- .into_iter()
- .map(|(key, fallback)| xdg_base(env, key, fallback).map(|p| p.join("vectorcraft")))
- .collect::, _>>()?;
- // The eframe window state, under the lowercased window id.
- roots.push(xdg_base(env, "XDG_DATA_HOME", ".local/share")?.join("ai.storyteller.vectorcraft"));
- roots.push(required_base(env, "HOME")?.join(".config").join("VectorCraft"));
- // The same folders at their HOME defaults: an XDG override moves this launch's own paths,
- // not stable's, which stays where a launch without the override finds it.
- for (directory, app) in
- [(".config", "vectorcraft"), (".local/share", "vectorcraft"), (".cache", "vectorcraft"), (".local/state", "vectorcraft")]
- {
- roots.push(required_base(env, "HOME")?.join(directory).join(app));
- }
- // The stable Flatpak keeps its data in its own per-app folder.
- roots.push(required_base(env, "HOME")?.join(".var/app/ai.storyteller.vectorcraft"));
- roots
- }
- Platform::Mac => {
- let home = required_base(env, "HOME")?;
- let library = home.join("Library");
- vec![
- library.join("Application Support/VectorCraft"),
- library.join("Application Support/ai.storyteller.vectorcraft"),
- library.join("Caches/VectorCraft"),
- library.join("Caches/ai.storyteller.vectorcraft"),
- library.join("Preferences/VectorCraft"),
- library.join("Preferences/ai.storyteller.vectorcraft.plist"),
- library.join("Saved Application State/ai.storyteller.vectorcraft.savedState"),
- home.join("Applications/VectorCraft.app"),
- PathBuf::from("/Applications/VectorCraft.app"),
- ]
- }
- };
- roots.push(installation_boundary(platform, exe)?);
- let mut fences = roots.into_iter().map(|p| canonical_future(&p)).collect::, _>>()?;
- if platform == Platform::Linux {
- for entry in ["/usr/bin/vectorcraft", "/usr/local/bin/vectorcraft", "/opt/vectorcraft"] {
- fences.push(canonical_future_entry(Path::new(entry))?);
- }
- }
- Ok(fences)
-}
-
-fn private_subdirectory(root: &Path, name: impl AsRef, label: &str) -> Result {
- let chosen = canonical_future(&absolute(root.to_path_buf(), "the nightly profile root")?)?;
- let target = chosen.join(name);
- match std::fs::symlink_metadata(&target) {
- Ok(metadata) if !metadata.is_dir() => {
- return Err(format!("the nightly {label} must be a directory inside its selected profile"));
- }
- Ok(_) => {}
- Err(error) if error.kind() == std::io::ErrorKind::NotFound => {}
- Err(error) => return Err(format!("cannot inspect the nightly {label}: {error}")),
- }
- let child = canonical_future(&target)?;
- if child == chosen || !child.starts_with(&chosen) {
- return Err(format!("the nightly {label} must stay inside its selected profile"));
- }
- Ok(child)
-}
-
-/// Every existing entry directly in the profile (settings, logs, the user's libraries and so on) must
-/// resolve inside it, so a link there cannot point Nightly's writes at another app's data.
-fn entries_stay_inside(root: &Path) -> Result<(), String> {
- let entries = match std::fs::read_dir(root) {
- Ok(entries) => entries,
- Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(()),
- Err(error) => return Err(format!("cannot inspect the nightly profile: {error}")),
- };
- for entry in entries {
- let entry = entry.map_err(|e| format!("cannot inspect the nightly profile: {e}"))?;
- let path = entry.path();
- let metadata = std::fs::symlink_metadata(&path).map_err(|e| format!("cannot inspect the nightly profile: {e}"))?;
- // Settings and session state are ordinary files, not directories. Keep the existing
- // directory-boundary check for folders (including the known folder-only entries).
- let folder_only = PROFILE_FOLDERS.iter().any(|name| entry.file_name().eq_ignore_ascii_case(name));
- if metadata.is_file() && !folder_only {
- private_regular_file(&path, &metadata)?;
- } else {
- private_subdirectory(root, entry.file_name(), "profile entry")?;
- }
- }
- Ok(())
-}
-
-/// Persisted files must have their own ordinary file identity, not an alias to other data.
-fn private_regular_file(path: &Path, metadata: &std::fs::Metadata) -> Result<(), String> {
- #[cfg(unix)]
- {
- use std::os::unix::fs::MetadataExt as _;
- if metadata.nlink() != 1 {
- return Err("the nightly profile file must not be shared".into());
- }
- }
- #[cfg(all(windows, feature = "wgpu"))]
- {
- use winsafe::{HFILE, co};
- let (file, _) = HFILE::CreateFile(
- path.to_str().ok_or("the nightly profile file path is not textual")?,
- co::GENERIC::default(),
- Some(co::FILE_SHARE::READ | co::FILE_SHARE::WRITE | co::FILE_SHARE::DELETE),
- None,
- co::DISPOSITION::OPEN_EXISTING,
- co::FILE_ATTRIBUTE::NORMAL,
- Some(co::FILE_FLAG::OPEN_REPARSE_POINT),
- None,
- None,
- )
- .map_err(|e| e.to_string())?;
- let info = file.GetFileInformationByHandle().map_err(|e| e.to_string())?;
- if info.dwFileAttributes.has(co::FILE_ATTRIBUTE::REPARSE_POINT) || info.dwFileAttributes.has(co::FILE_ATTRIBUTE::DIRECTORY) {
- return Err("the nightly profile file must not be an alias or directory".into());
- }
- if info.nNumberOfLinks != 1 {
- return Err("the nightly profile file must not be shared".into());
- }
- }
- #[cfg(all(windows, not(feature = "wgpu")))]
- {
- use std::os::windows::fs::MetadataExt as _;
- const FILE_ATTRIBUTE_DIRECTORY: u32 = 0x10;
- const FILE_ATTRIBUTE_REPARSE_POINT: u32 = 0x400;
- if metadata.file_attributes() & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT) != 0 {
- return Err("the nightly profile file must not be an alias or directory".into());
- }
- }
- let _ = (path, metadata);
- Ok(())
-}
+const FORBIDDEN_ENV_VARS: [&str; 2] = ["VECTORCRAFT_CONFIG_DIR", "VECTORCRAFT_NO_PREFS"];
const PROFILE_FOLDERS: [&str; 18] = [
"Data Recovery",
@@ -281,397 +34,207 @@ const PROFILE_FOLDERS: [&str; 18] = [
"Libraries",
];
-/// Recognise the shared portable data namespace in both the supplied and the resolved path. Up to
-/// the chosen folder itself, a marker only counts beside a VectorCraft executable, so an unrelated
-/// `portable.txt` higher up (in a user folder or at a drive root) does not refuse the profile.
-fn is_portable_layout(path: &Path, platform: Platform) -> bool {
- path.ancestors().enumerate().any(|(depth, ancestor)| {
- crate::prefs_dir::profile::PORTABLE_MARKERS.iter().any(|marker| ancestor.join(marker).is_file())
- && (depth == 0 || ["vectorcraft.exe", "vectorcraft"].iter().any(|exe| ancestor.join(exe).is_file()))
- }) || path.components().any(|component| match component {
- Component::Normal(name) if platform.ignores_case() => name.to_string_lossy().eq_ignore_ascii_case(PORTABLE_DATA_DIR),
- Component::Normal(name) => name == PORTABLE_DATA_DIR,
- _ => false,
- })
+/// Builds VectorCraft's [`AppProfileSpec`] for [`craft_nightly`].
+pub fn app_profile_spec() -> AppProfileSpec {
+ AppProfileSpec {
+ app_id: vectorcraft_ui_egui::os_window::SETTINGS_APP_ID,
+ display_name: vectorcraft_ui_egui::os_window::APP_NAME,
+ stable_dir_names: &STABLE_DIR_NAMES,
+ stable_package_id: vectorcraft_ui_egui::os_window::APP_ID,
+ nightly_package_id: vectorcraft_ui_egui::os_window::NIGHTLY_PACKAGE_ID,
+ profile_root_env: None,
+ forbidden_env_vars: &FORBIDDEN_ENV_VARS,
+ portable_markers: &PORTABLE_MARKERS,
+ folder_only_entries: &PROFILE_FOLDERS,
+ extra_forbidden_roots: extra_forbidden_roots(),
+ }
}
-/// The writable hook is the app's own exclusive probe ([`crate::prefs_dir::profile::ensure_writable`]). Keeping
-/// it injected lets the boundary tests exercise the real policy without starting the app.
-pub fn validate(
- root: &Path,
- env: impl Fn(&str) -> Option,
- exe: Option<&Path>,
- writable: impl FnOnce(&Path) -> std::io::Result<()>,
-) -> Result {
- validate_for(Platform::current()?, root, env, exe, writable)
+fn non_empty_abs(env: &impl Fn(&str) -> Option, key: &str) -> Option {
+ let value = env(key)?;
+ if value.is_empty() {
+ return None;
+ }
+ let path = PathBuf::from(value);
+ path.is_absolute().then_some(path)
}
-fn validate_for(
- platform: Platform,
- root: &Path,
- env: impl Fn(&str) -> Option,
- exe: Option<&Path>,
- writable: impl FnOnce(&Path) -> std::io::Result<()>,
-) -> Result {
- absolute(root.to_path_buf(), "the nightly profile root")?;
- if env("VECTORCRAFT_CONFIG_DIR").is_some_and(|v| !v.is_empty()) {
- return Err("nightly-v1 cannot be combined with VECTORCRAFT_CONFIG_DIR".to_string());
- }
- // The app turns preferences off whenever the variable is present, empty value included.
- if env("VECTORCRAFT_NO_PREFS").is_some() {
- // A run without preferences keeps nothing: its own profile would stay unused and the app
- // would log to standard error only, so it is never a nightly launch.
- return Err("nightly-v1 cannot inherit VECTORCRAFT_NO_PREFS".to_string());
- }
- let nightly_flatpak = vectorcraft_ui_egui::os_window::NIGHTLY_PACKAGE_ID;
- if platform != Platform::Windows
- && let Some(id) = env("FLATPAK_ID").filter(|value| !value.is_empty())
- && id.to_string_lossy().as_ref() != nightly_flatpak
+fn extra_forbidden_roots() -> Vec {
+ extra_forbidden_roots_with(|key| std::env::var_os(key), std::env::current_exe().ok().as_deref())
+}
+
+fn extra_forbidden_roots_with(env: impl Fn(&str) -> Option, exe: Option<&Path>) -> Vec {
+ let mut roots = Vec::new();
+
+ #[cfg(target_os = "windows")]
{
- // `packaging/linux/flatpak-bundle.sh` builds VectorCraft Nightly as its own Flatpak
- // (`ai.storyteller.vectorcraft.nightly`), whose sandbox is already a private home. Any other
- // instance, the stable app's included, would put this profile inside another app's tree.
- return Err(format!("nightly-v1 can only run inside its own Flatpak instance ({nightly_flatpak}), not {}", id.to_string_lossy()));
+ if let Some(local) = non_empty_abs(&env, "LOCALAPPDATA") {
+ roots.push(local.join("Programs").join("ArtCraft").join("VectorCraft"));
+ }
+ for key in ["ProgramW6432", "ProgramFiles", "ProgramFiles(x86)"] {
+ if let Some(base) = non_empty_abs(&env, key) {
+ roots.push(base.join("ArtCraft").join("VectorCraft"));
+ }
+ }
}
- let chosen = canonical_future(root)?;
- if is_portable_layout(root, platform) || is_portable_layout(&chosen, platform) {
- return Err("the nightly root must not use a portable VectorCraft installation or its VectorCraftData settings folder".to_string());
- }
- let exe = absolute(exe.ok_or_else(|| "cannot establish the installation boundary".to_string())?.to_path_buf(), "the executable")?;
- let forbidden = forbidden_roots(platform, &env, &exe)?;
- if forbidden.iter().any(|stable| overlaps(&chosen, stable, platform)) {
- return Err("the nightly root must not overlap stable data or an installation".to_string());
- }
- // Data Recovery can read, adopt, overwrite and sweep entries: never let its alias leave the
- // private profile.
- private_subdirectory(&chosen, "Data Recovery", "recovery folder")?;
- entries_stay_inside(&chosen)?;
- let mut create = std::fs::DirBuilder::new();
- create.recursive(true);
- #[cfg(unix)]
+
+ #[cfg(all(unix, not(target_os = "macos")))]
{
- use std::os::unix::fs::DirBuilderExt as _;
- create.mode(0o700);
+ if let Some(home) = non_empty_abs(&env, "HOME") {
+ roots.push(home.join(".var").join("app").join(vectorcraft_ui_egui::os_window::APP_ID));
+ }
+ for entry in ["/usr/bin/vectorcraft", "/usr/local/bin/vectorcraft", "/opt/vectorcraft"] {
+ roots.push(PathBuf::from(entry));
+ }
}
- create.create(&chosen).map_err(|e| format!("cannot create the nightly profile: {e}"))?;
- let confirmed = std::fs::canonicalize(&chosen).map_err(|e| format!("cannot resolve the created nightly profile: {e}"))?;
- if confirmed != chosen || forbidden.iter().any(|stable| overlaps(&confirmed, stable, platform)) {
- return Err("the nightly profile changed while it was being validated".to_string());
+
+ #[cfg(target_os = "macos")]
+ {
+ if let Some(home) = non_empty_abs(&env, "HOME") {
+ let library = home.join("Library");
+ roots.push(library.join("Preferences").join(format!("{}.plist", vectorcraft_ui_egui::os_window::APP_ID)));
+ roots.push(library.join("Saved Application State").join(format!("{}.savedState", vectorcraft_ui_egui::os_window::APP_ID)));
+ roots.push(home.join("Applications").join("VectorCraft.app"));
+ }
+ roots.push(PathBuf::from("/Applications/VectorCraft.app"));
}
- private_subdirectory(&confirmed, "Data Recovery", "recovery folder")?;
- entries_stay_inside(&confirmed)?;
- writable(&confirmed).map_err(|e| format!("the nightly profile is not writable: {e}"))?;
- Ok(confirmed)
+
+ if let Some(exe) = exe {
+ if let Some(parent) = exe.parent() {
+ roots.push(parent.join(PORTABLE_DATA_DIR));
+ }
+ #[cfg(target_os = "macos")]
+ if let Some(bundle_parent) = exe.ancestors().find(|p| p.extension().is_some_and(|ext| ext.eq_ignore_ascii_case("app"))).and_then(Path::parent)
+ {
+ roots.push(bundle_parent.join(PORTABLE_DATA_DIR));
+ }
+ }
+
+ roots
}
#[cfg(test)]
mod tests {
- use super::*;
- use std::cell::Cell;
- use std::collections::BTreeMap;
- use std::sync::atomic::{AtomicU64, Ordering};
+ use std::ffi::OsString;
+ use std::fs;
+ #[cfg(unix)]
+ use std::path::PathBuf;
- /// An owned fixture tree: a home, a roaming/local app-data pair and an install folder, so the
- /// fence can be checked for every platform on any host.
- struct Fixture {
- root: PathBuf,
- env: BTreeMap,
- exe: PathBuf,
- }
+ use craft_nightly::validate_and_prepare_root;
- impl Fixture {
- fn new() -> Self {
- static NEXT: AtomicU64 = AtomicU64::new(0);
- let root = loop {
- let candidate =
- std::env::temp_dir().join(format!("vectorcraft-profile-policy-{}-{}", std::process::id(), NEXT.fetch_add(1, Ordering::Relaxed)));
- match std::fs::create_dir(&candidate) {
- Ok(()) => break std::fs::canonicalize(candidate).unwrap(),
- Err(error) if error.kind() == std::io::ErrorKind::AlreadyExists => continue,
- Err(error) => panic!("cannot create owned fixture: {error}"),
- }
- };
- let home = root.join("home");
- let exe = root.join("install/vectorcraft");
- std::fs::create_dir_all(&home).unwrap();
- std::fs::create_dir_all(exe.parent().unwrap()).unwrap();
- std::fs::write(&exe, b"fixture executable, never run").unwrap();
- let env = [("HOME", home), ("APPDATA", root.join("roaming")), ("LOCALAPPDATA", root.join("local"))]
- .into_iter()
- .map(|(key, value)| (key.into(), value.into_os_string()))
- .collect();
- Self { root, env, exe }
- }
-
- fn get(&self, key: &str) -> Option {
- self.env.get(key).cloned()
- }
-
- fn home(&self) -> PathBuf {
- PathBuf::from(self.get("HOME").unwrap())
- }
-
- fn check(&self, platform: Platform, root: &Path) -> Result {
- self.check_with(platform, root, |_| Ok(()))
- }
-
- fn check_with(&self, platform: Platform, root: &Path, writable: impl FnOnce(&Path) -> std::io::Result<()>) -> Result {
- validate_for(platform, root, |key| self.get(key), Some(&self.exe), writable)
- }
- }
-
- impl Drop for Fixture {
- fn drop(&mut self) {
- // Only the directory this fixture created is owned for removal.
- std::fs::remove_dir_all(&self.root).unwrap();
- }
- }
-
- const PLATFORMS: [Platform; 3] = [Platform::Windows, Platform::Linux, Platform::Mac];
+ use super::{FORBIDDEN_ENV_VARS, PROFILE_FOLDERS, STABLE_DIR_NAMES, app_profile_spec, extra_forbidden_roots_with};
+ use crate::prefs_dir::profile::{PORTABLE_DATA_DIR, PORTABLE_MARKERS};
#[test]
- fn a_private_profile_is_accepted_on_every_platform() {
- let fixture = Fixture::new();
- for platform in PLATFORMS {
- let root = fixture.root.join(format!("nightly profiles/{platform:?}/vectorcraft"));
- let resolved = fixture.check(platform, &root).unwrap();
- assert!(resolved.is_dir(), "{platform:?}");
- assert_eq!(resolved, std::fs::canonicalize(root).unwrap(), "{platform:?}");
- std::fs::remove_dir_all(fixture.root.join("nightly profiles")).unwrap();
- }
+ fn spec_preserves_vectorcraft_invariants() {
+ let spec = app_profile_spec();
+ assert_eq!(spec.app_id, "vectorcraft");
+ assert_eq!(spec.display_name, "VectorCraft");
+ assert_eq!(spec.stable_dir_names, &STABLE_DIR_NAMES);
+ assert_eq!(spec.stable_package_id, "ai.storyteller.vectorcraft");
+ assert_eq!(spec.nightly_package_id, "ai.storyteller.vectorcraft.nightly");
+ assert_eq!(spec.profile_root_env, None);
+ assert_eq!(spec.forbidden_env_vars, &FORBIDDEN_ENV_VARS);
+ assert_eq!(spec.portable_markers, &PORTABLE_MARKERS);
+ assert_eq!(spec.folder_only_entries, &PROFILE_FOLDERS);
}
#[test]
- fn stable_settings_folders_are_refused_on_every_platform() {
- let fixture = Fixture::new();
- let stable = [
- (Platform::Windows, fixture.get("APPDATA").map(|v| PathBuf::from(v).join("VectorCraft"))),
- (Platform::Windows, fixture.get("APPDATA").map(|v| PathBuf::from(v).join("ai.storyteller.vectorcraft"))),
- (Platform::Windows, fixture.get("LOCALAPPDATA").map(|v| PathBuf::from(v).join("VectorCraft"))),
- (Platform::Windows, fixture.get("LOCALAPPDATA").map(|v| PathBuf::from(v).join("Programs/ArtCraft/VectorCraft"))),
- (Platform::Linux, Some(fixture.home().join(".config/vectorcraft"))),
- (Platform::Linux, Some(fixture.home().join(".local/share/vectorcraft"))),
- (Platform::Linux, Some(fixture.home().join(".local/share/ai.storyteller.vectorcraft"))),
- (Platform::Linux, Some(fixture.home().join(".cache/vectorcraft"))),
- (Platform::Linux, Some(fixture.home().join(".var/app/ai.storyteller.vectorcraft"))),
- (Platform::Mac, Some(fixture.home().join("Library/Application Support/VectorCraft"))),
- (Platform::Mac, Some(fixture.home().join("Library/Application Support/ai.storyteller.vectorcraft"))),
- (Platform::Mac, Some(fixture.home().join("Library/Preferences/ai.storyteller.vectorcraft.plist"))),
- ];
- for (platform, stable) in stable {
- let stable = stable.unwrap();
- for candidate in [stable.clone(), stable.join("nested nightly")] {
- let probed = Cell::new(false);
- let result = fixture.check_with(platform, &candidate, |_| {
- probed.set(true);
- Ok(())
- });
- assert!(result.is_err(), "{platform:?} accepted {candidate:?}");
- assert!(!probed.get(), "a refused root is rejected before the writable probe");
- }
- }
- }
+ fn extra_forbidden_roots_fences_platform_installs_and_portable_data() {
+ let tmp = tempfile::tempdir().unwrap();
+ let home = tmp.path().join("home");
+ let exe = tmp.path().join("install/vectorcraft");
+ let roots = extra_forbidden_roots_with(
+ |key| match key {
+ "HOME" | "LOCALAPPDATA" | "ProgramFiles" => Some(home.clone().into_os_string()),
+ _ => None,
+ },
+ Some(&exe),
+ );
+ assert!(roots.contains(&tmp.path().join("install").join(PORTABLE_DATA_DIR)));
- #[test]
- fn the_install_folder_and_the_entry_points_are_refused() {
- let fixture = Fixture::new();
- for platform in PLATFORMS {
- let install = fixture.exe.parent().unwrap();
- assert!(fixture.check(platform, install).is_err(), "{platform:?}: the install folder");
- assert!(fixture.check(platform, &install.join("NightlyData")).is_err(), "{platform:?}: inside the install");
- }
- }
-
- #[test]
- fn an_inherited_config_or_no_prefs_override_is_refused() {
- let fixture = Fixture::new();
- let root = fixture.root.join("nightly");
- for (key, value) in [
- ("VECTORCRAFT_CONFIG_DIR", "/elsewhere"),
- ("VECTORCRAFT_NO_PREFS", "1"),
- // The app turns preferences off on presence, so an empty value is a run too.
- ("VECTORCRAFT_NO_PREFS", ""),
- ("FLATPAK_ID", "ai.storyteller.vectorcraft"),
- ] {
- for platform in PLATFORMS {
- let result = validate_for(
- platform,
- &root,
- |name| if name == key { Some(value.into()) } else { fixture.get(name) },
- Some(&fixture.exe),
- |_| Ok(()),
- );
- let refused = result.is_err();
- // A Flatpak instance only keeps the stable app's sockets on native Unix packages.
- assert_eq!(refused, !(key == "FLATPAK_ID" && platform == Platform::Windows), "{key} on {platform:?}");
- if refused {
- assert!(!root.exists(), "a refused launch creates nothing ({key} on {platform:?})");
- } else if root.exists() {
- // The accepted case validated the root, which creates it: start the next one clean.
- std::fs::remove_dir_all(&root).expect("remove the accepted launch's root");
- }
- }
- }
- }
-
- #[test]
- fn only_the_nightly_s_own_flatpak_instance_may_carry_a_profile() {
- let fixture = Fixture::new();
- let root = fixture.root.join("flatpak profile");
- for (id, accepted) in
- [(vectorcraft_ui_egui::os_window::NIGHTLY_PACKAGE_ID, true), ("ai.storyteller.vectorcraft", false), ("io.other.App", false)]
+ #[cfg(target_os = "windows")]
{
- let result = validate_for(
- Platform::Linux,
- &root,
- |name| if name == "FLATPAK_ID" { Some(id.into()) } else { fixture.get(name) },
- Some(&fixture.exe),
- |_| Ok(()),
- );
- assert_eq!(result.is_ok(), accepted, "{id}");
- let _ = std::fs::remove_dir_all(&root);
+ assert!(roots.contains(&home.join("Programs").join("ArtCraft").join("VectorCraft")));
+ assert!(roots.contains(&home.join("ArtCraft").join("VectorCraft")));
+ }
+ #[cfg(all(unix, not(target_os = "macos")))]
+ {
+ assert!(roots.contains(&home.join(".var/app/ai.storyteller.vectorcraft")));
+ assert!(roots.contains(&PathBuf::from("/usr/bin/vectorcraft")));
+ assert!(roots.contains(&PathBuf::from("/usr/local/bin/vectorcraft")));
+ assert!(roots.contains(&PathBuf::from("/opt/vectorcraft")));
+ }
+ #[cfg(target_os = "macos")]
+ {
+ assert!(roots.contains(&home.join("Library/Preferences/ai.storyteller.vectorcraft.plist")));
+ assert!(roots.contains(&home.join("Library/Saved Application State/ai.storyteller.vectorcraft.savedState")));
+ assert!(roots.contains(&home.join("Applications/VectorCraft.app")));
+ assert!(roots.contains(&PathBuf::from("/Applications/VectorCraft.app")));
}
}
#[test]
- fn a_portable_copy_and_its_data_folder_are_refused() {
- let fixture = Fixture::new();
- let portable = fixture.root.join("portable copy");
- let data = portable.join(crate::prefs_dir::profile::PORTABLE_DATA_DIR);
- std::fs::create_dir_all(&data).unwrap();
- std::fs::write(portable.join("portable.txt"), b"owned portable fixture").unwrap();
- std::fs::write(data.join("config.toml"), b"stable settings must not change").unwrap();
- for platform in PLATFORMS {
- for candidate in [&data, &data.join("nested nightly")] {
- let probed = Cell::new(false);
- let result = fixture.check_with(platform, candidate, |_| {
- probed.set(true);
- Ok(())
- });
- assert!(result.is_err(), "{platform:?} accepted {candidate:?}");
- assert!(!probed.get());
- assert!(!data.join("nested nightly").exists());
- assert_eq!(std::fs::read(data.join("config.toml")).unwrap(), b"stable settings must not change");
- }
+ fn nightly_profile_reopens_after_saving_settings_and_enforces_folder_only_entries() {
+ let tmp = tempfile::tempdir().unwrap();
+ let private = tmp.path().join("nightly-reopen");
+ let mut spec = app_profile_spec();
+ spec.forbidden_env_vars = &[];
+
+ let canonical = validate_and_prepare_root(&private, &spec).unwrap();
+ assert_eq!(canonical, fs::canonicalize(&private).unwrap());
+
+ for name in ["config.toml", "instance.json", "Color Settings.json", "app.ron"] {
+ fs::write(canonical.join(name), b"saved profile data").unwrap();
+ }
+ for name in PROFILE_FOLDERS {
+ fs::create_dir(canonical.join(name)).unwrap();
+ }
+ assert_eq!(validate_and_prepare_root(&private, &spec).unwrap(), canonical);
+ for name in ["config.toml", "instance.json", "Color Settings.json", "app.ron"] {
+ assert_eq!(fs::read(canonical.join(name)).unwrap(), b"saved profile data", "{name} remains intact after reopen");
+ }
+
+ for name in PROFILE_FOLDERS {
+ let path = canonical.join(name);
+ fs::remove_dir(&path).unwrap();
+ fs::write(&path, b"not a directory").unwrap();
+ assert!(validate_and_prepare_root(&private, &spec).is_err(), "{name} must stay a directory");
+ fs::remove_file(&path).unwrap();
+ fs::create_dir(&path).unwrap();
}
- // A merely similar name is not the portable settings folder.
- let similar = fixture.root.join("VectorCraftData-backup-name/nightly");
- assert!(fixture.check(Platform::Linux, &similar).is_ok());
}
#[cfg(unix)]
#[test]
- fn a_link_inside_the_profile_cannot_redirect_recovery_or_a_library() {
- let fixture = Fixture::new();
- let root = fixture.root.join("nightly");
- std::fs::create_dir_all(&root).unwrap();
- let external = fixture.root.join("stable-document");
- std::fs::write(&external, b"stable bytes").unwrap();
+ fn symlink_inside_profile_is_refused() {
+ let tmp = tempfile::tempdir().unwrap();
+ let private = tmp.path().join("nightly");
+ fs::create_dir_all(&private).unwrap();
+ let external = tmp.path().join("stable-document");
+ fs::write(&external, b"stable bytes").unwrap();
+
+ let mut spec = app_profile_spec();
+ spec.forbidden_env_vars = &[];
+
for name in ["Data Recovery", "Swatches"] {
- let alias = root.join(name);
+ let alias = private.join(name);
std::os::unix::fs::symlink(&external, &alias).unwrap();
- assert!(fixture.check(Platform::Linux, &root).is_err(), "{name} alias");
- std::fs::remove_file(&alias).unwrap();
+ assert!(validate_and_prepare_root(&private, &spec).is_err(), "{name} alias");
+ fs::remove_file(&alias).unwrap();
}
- assert_eq!(std::fs::read(&external).unwrap(), b"stable bytes");
- }
-
- #[cfg(unix)]
- #[test]
- fn a_dangling_link_or_a_linked_ancestor_is_refused() {
- let fixture = Fixture::new();
- let elsewhere = fixture.root.join("elsewhere");
- std::fs::create_dir_all(&elsewhere).unwrap();
- let linked = fixture.root.join("nightly");
- std::os::unix::fs::symlink(&elsewhere, &linked).unwrap();
- // Canonical resolution keeps a link's target: a profile reached through one is fine, but it
- // is judged (and named) as its target, so nothing is written under the link.
- let resolved = fixture.check(Platform::Linux, &linked).unwrap();
- assert_eq!(resolved, std::fs::canonicalize(&elsewhere).unwrap());
- std::fs::remove_file(&linked).unwrap();
- let dangling = fixture.root.join("dangling/nightly");
- std::fs::create_dir_all(dangling.parent().unwrap()).unwrap();
- std::os::unix::fs::symlink(fixture.root.join("missing"), dangling.parent().unwrap().join("nightly")).unwrap();
- assert!(fixture.check(Platform::Linux, &dangling).is_err());
+ assert_eq!(fs::read(&external).unwrap(), b"stable bytes");
}
#[test]
- fn a_home_settings_folder_is_fenced_even_when_the_xdg_override_moves_elsewhere() {
- let fixture = Fixture::new();
- let xdg = fixture.root.join("override");
- std::fs::create_dir_all(&xdg).unwrap();
- let config = fixture.home().join(".config/vectorcraft");
- let data = fixture.home().join(".local/share/vectorcraft");
- for stable in [config.clone(), data.clone()] {
- for candidate in [stable.clone(), stable.join("nested nightly")] {
- let result = validate_for(
- Platform::Linux,
- &candidate,
- |name| match name {
- "XDG_CONFIG_HOME" | "XDG_DATA_HOME" => Some(xdg.clone().into_os_string()),
- _ => fixture.get(name),
- },
- Some(&fixture.exe),
- |_| Ok(()),
- );
- assert!(result.is_err(), "accepted {candidate:?} with the XDG folders moved to {xdg:?}");
- }
- }
- assert!(!config.exists() && !data.exists(), "a refused root creates nothing");
- }
-
- #[cfg(unix)]
- #[test]
- fn a_dangling_entry_point_keeps_its_fence_instead_of_refusing_every_launch() {
- let fixture = Fixture::new();
- let bin = fixture.root.join("entry/bin");
- std::fs::create_dir_all(&bin).unwrap();
- let entry = bin.join("vectorcraft");
- std::os::unix::fs::symlink(fixture.root.join("uninstalled target"), &entry).unwrap();
- // The shared resolver refuses the dangling link, as a profile root must be.
- assert!(canonical_future(&entry).is_err());
- assert_eq!(canonical_future_entry(&entry).unwrap(), std::fs::canonicalize(&bin).unwrap().join("vectorcraft"));
- }
-
- #[test]
- fn an_unwritable_profile_is_refused_after_the_probe_and_never_used() {
- let fixture = Fixture::new();
- let root = fixture.root.join("nightly");
- let result = fixture.check_with(Platform::Linux, &root, |_| Err(std::io::Error::other("read-only")));
- assert!(result.unwrap_err().contains("not writable"));
- }
-
- #[test]
- fn nightly_profile_reopens_after_saving_settings_and_session_state() {
- let fixture = Fixture::new();
- for platform in PLATFORMS {
- let private = fixture.root.join(format!("nightly-reopen-{platform:?}"));
- assert_eq!(fixture.check(platform, &private).unwrap(), private);
- for name in ["config.toml", "instance.json", "Color Settings.json", "app.ron"] {
- std::fs::write(private.join(name), b"saved profile data").unwrap();
- }
- for name in PROFILE_FOLDERS {
- std::fs::create_dir(private.join(name)).unwrap();
- }
- assert_eq!(fixture.check(platform, &private).unwrap(), private);
- assert_eq!(std::fs::read(private.join("config.toml")).unwrap(), b"saved profile data");
- for name in PROFILE_FOLDERS {
- let path = private.join(name);
- std::fs::remove_dir(&path).unwrap();
- std::fs::write(&path, b"not a directory").unwrap();
- assert!(fixture.check(platform, &private).is_err(), "{name} must stay a directory");
- std::fs::remove_file(&path).unwrap();
- std::fs::create_dir(&path).unwrap();
- }
- }
- }
-
- #[test]
- fn the_platform_case_rules_are_the_file_systems_ones() {
- let fixture = Fixture::new();
- let upper = fixture.root.join("NIGHTLY");
- assert!(fixture.check(Platform::Linux, &upper).is_ok());
- let stable_mac = fixture.home().join("library/application support/vectorcraft");
- assert!(fixture.check(Platform::Mac, &stable_mac).is_err(), "macOS compares folders case-insensitively");
+ fn non_empty_abs_ignores_empty_and_relative_values() {
+ let env = |key: &str| match key {
+ "EMPTY" => Some(OsString::new()),
+ "RELATIVE" => Some(OsString::from("relative/path")),
+ _ => None,
+ };
+ assert!(super::non_empty_abs(&env, "EMPTY").is_none());
+ assert!(super::non_empty_abs(&env, "RELATIVE").is_none());
+ assert!(super::non_empty_abs(&env, "MISSING").is_none());
}
}
diff --git a/apps/vectorcraft/src/single_instance.rs b/apps/vectorcraft/src/single_instance.rs
index 249309fa87..4dba61d6b4 100644
--- a/apps/vectorcraft/src/single_instance.rs
+++ b/apps/vectorcraft/src/single_instance.rs
@@ -155,8 +155,8 @@ pub fn launch_with_plug_ins(files: &[String]) -> io::Result<()> {
}
/// The command [`launch_with_plug_ins`] runs: `exe -- files…`, so a file whose name starts with '-'
-/// stays a file. A nightly launch hands its profile on first (`launch_profile::child_args`), or the
-/// child would refuse to start without one.
+/// stays a file. A nightly launch hands its profile on first (`launch_profile::child_args`), so the
+/// child opens the same private profile.
fn app_with_plug_ins(exe: &Path, files: &[String]) -> std::process::Command {
let mut command = std::process::Command::new(exe);
command.args(super::launch_profile::child_args(files));
diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.toml
index 027ae10251..8e06886ba0 100644
--- a/crates/engine/Cargo.toml
+++ b/crates/engine/Cargo.toml
@@ -72,10 +72,11 @@ serde_json = { workspace = true }
thiserror = { workspace = true }
log = { workspace = true }
-# Whether a recovery area folder is this account's own (`FolderStore::own_area`). Already in
-# Cargo.lock (tempfile, ui-egui), so this adds no new crate.
+# Whether a recovery area folder is this account's own (`FolderStore::own_area`), and opening a
+# file without following a link (`store::read_capped_plain`). Already in Cargo.lock (tempfile,
+# ui-egui), so this adds no new crate.
[target.'cfg(unix)'.dependencies]
-rustix = { workspace = true, features = ["std", "process"] }
+rustix = { workspace = true, features = ["std", "process", "fs"] }
# Whether a recovery area's lock file is still the one that was opened (`FolderStore::still_named`),
# and whether two paths a script names are one file (`script::files`). Already in Cargo.lock
diff --git a/crates/engine/src/cmd.rs b/crates/engine/src/cmd.rs
index 43d6e3a7d4..42e3f1d960 100644
--- a/crates/engine/src/cmd.rs
+++ b/crates/engine/src/cmd.rs
@@ -111,6 +111,7 @@ mod textedit;
pub use textedit::effective_kerning;
mod retype;
+mod stepandrepeat;
pub mod textstyles;
pub(crate) mod textwrap;
pub(crate) mod threads;
@@ -327,6 +328,7 @@ pub fn command_specs() -> &'static [CommandSpec] {
v.extend(layerpanel::specs());
v.extend(draw2::specs());
v.extend(xform::specs());
+ v.extend(stepandrepeat::specs());
v.extend(effectcmd::specs());
v.extend(bevels::specs());
v.extend(wireframe::specs());
@@ -874,6 +876,9 @@ pub(crate) use vectorcraft_doc::range::parse_range;
/// What the fill and stroke proxies read from the selected objects, kept with the selection
/// ([`crate::doc_state::SelectionRecord`]).
pub(crate) use paint::SelectionPaints;
+/// The faces and edges of Live Paint groups among objects that count with their group
+/// ([`crate::DocState::live_paint_covered_kept`] keeps an empty answer).
+pub(crate) use paint::live_paint_covered;
#[cfg(test)]
pub(crate) use paint::{PAINTS_READ, WEIGHTS_READ};
diff --git a/crates/engine/src/cmd/brushsym.rs b/crates/engine/src/cmd/brushsym.rs
index bd6cb220e5..ee2b1904f6 100644
--- a/crates/engine/src/cmd/brushsym.rs
+++ b/crates/engine/src/cmd/brushsym.rs
@@ -98,7 +98,7 @@ pub fn specs() -> Vec {
"Apply Brush",
[],
None,
- "{name, ids?|id?} apply a brush to the strokes of the selected paths (adds a stroke if missing) and make it current → {ids}",
+ "{name, ids?|id?} apply a brush to the strokes of the selected paths (adds a stroke if missing) and make it current; the brush settings of each path's top stroke (brush.objectOptions) are cleared, and clearing them is one undo step; when the brush is already current and applying it leaves every path as it was (its top stroke already has the brush, paint, a width above 0 and no settings of its own), nothing changes and no undo step is recorded → {ids}",
has_doc,
brush_apply
),
@@ -170,7 +170,7 @@ pub fn specs() -> Vec {
"Brush Options…",
[],
None,
- "{name, params?: {…fields to change (brush.get shows them; values outside their ranges are clamped). calligraphic: angle −180..180° (counter-clockwise from level), roundness 0..100%, size 0..1296 pt, variation: [angle°, roundness%, size pt], modes: [fixed|random|pressure|tilt|bearing|rotation|stylusWheel for angle, roundness, size] (pressure goes from value − variation at the lightest pen pressure to value + variation at the heaviest; tilt from value − variation with the pen lying flat to value + variation with it upright; bearing and rotation add variation × the pen's bearing (which way it leans, counter-clockwise from leaning right) or its barrel's counter-clockwise rotation over 180°; stylusWheel from value − variation at one end of an airbrush pen's finger wheel to value + variation at the other; the angle turns on past ±180°). scatter: size [a, b] 1..10000%, spacing [a, b] 1..10000%, scatter [a, b] −1000..1000%, rotation [a, b] −180..180° (counter-clockwise), modes: [fixed|random|pressure|tilt|bearing|rotation|stylusWheel for size, spacing, scatter, rotation] (fixed: a; random: between a and b; pressure: a at the lightest pen pressure to b at the heaviest; tilt: a with the pen lying flat to b upright; bearing and rotation: a at −180° to b at 180°; stylusWheel: a at one end of an airbrush pen's finger wheel to b at the other), rotation_relative_to_path, hue_jitter 0..180° (each copy turns the hue of its solid colors, after the colorization, by its own amount up to this far either way, the same on every redraw; colors without a hue stay; 0: off), saturation_jitter 0..100% (each copy moves the saturation of its solid colors, after the colorization and the hue jitter, by its own amount up to this many points either way, keeping their hue and brightness, the same on every redraw; colors without a hue stay; 0: off), brightness_jitter 0..100% (each copy moves the brightness of its solid colors, after the colorization and the hue and saturation jitter, by its own amount up to this many points either way, keeping their hue and saturation, the same on every redraw; white, black and grays move too; 0: off). art: width 1..1000%, width_mode: null (fixed)|pressure|tilt|bearing|rotation|stylusWheel, width_max 1..1000% (pressure: width at the lightest pen pressure to width_max at the heaviest; tilt: width with the pen lying flat to width_max upright; bearing and rotation: width at −180° to width_max at 180°; stylusWheel: width at one end of the finger wheel to width_max at the other; half way on a stroke drawn without that input), scale: {mode: proportional|stretch|betweenGuides, start, end: 0..1 of the art length}, direction: leftToRight|rightToLeft|topToBottom|bottomToTop, flip_along, flip_across, overlap. pattern: scale 1..10000%, scale_mode: null (fixed)|pressure|tilt|bearing|rotation|stylusWheel, scale_max 1..10000% (the tiles go from scale to scale_max over the same pen ranges as an art brush's width; half way on a stroke drawn without that input; each tile's height follows the stroke, its length and the gap after it take the scale at its middle, and a corner tile takes the scale at its corner), spacing 0..10000%, fit: stretch|addSpace|approximate, flip_along, flip_across, outer_corner and inner_corner: corner tile art (drawn as the corner that joins a side tile on its right to one below it) or null, outer_source and inner_source: what that kind of corner draws without its art: none|autoCentered|autoBetween|autoSliced|autoOverlap (a tile made from the side tile), or null (the other kind of corner's art); side_tile, outer_corner_tile, inner_corner_tile, start_tile, end_tile: a document pattern name, original, or none (side refuses none); corner tiles also take autoCentered|autoBetween|autoSliced|autoOverlap. Each tile also accepts {pattern: name} to select a swatch whose name is a reserved choice. scatter, art and pattern: colorization: {method: none|tints|tintsAndShades|hueShift, key: colour (hueShift: the art colour that becomes the stroke colour; without a key: the solid color the art's fills and strokes use most, black when they use none)}; colorization and the art brush's scale change only the fields given}, newName? (trimmed; blank: the name is kept; a new bristle brush name has at most 31 characters, and a longer name the brush has is kept)} edit a brush definition (strokes using it update) → {name}",
+ "{name, params?: {…fields to change (brush.get shows them; values outside their ranges are clamped). calligraphic: angle −180..180° (counter-clockwise from level), roundness 0..100%, size 0..1296 pt, variation: [angle°, roundness%, size pt], modes: [fixed|random|pressure|tilt|bearing|rotation|stylusWheel for angle, roundness, size] (pressure goes from value − variation at the lightest pen pressure to value + variation at the heaviest; tilt from value − variation with the pen lying flat to value + variation with it upright; bearing and rotation add variation × the pen's bearing (which way it leans, counter-clockwise from leaning right) or its barrel's counter-clockwise rotation over 180°; stylusWheel from value − variation at one end of an airbrush pen's finger wheel to value + variation at the other; the angle turns on past ±180°). scatter: size [a, b] 1..10000%, spacing [a, b] 1..10000%, scatter [a, b] −1000..1000%, rotation [a, b] −180..180° (counter-clockwise), modes: [fixed|random|pressure|tilt|bearing|rotation|stylusWheel for size, spacing, scatter, rotation] (fixed: a; random: between a and b; pressure: a at the lightest pen pressure to b at the heaviest; tilt: a with the pen lying flat to b upright; bearing and rotation: a at −180° to b at 180°; stylusWheel: a at one end of an airbrush pen's finger wheel to b at the other), rotation_relative_to_path, hue_jitter 0..180° (each copy turns the hue of its solid colors, after the colorization, by its own amount up to this far either way, the same on every redraw; colors without a hue stay; 0: off), saturation_jitter 0..100% (each copy moves the saturation of its solid colors, after the colorization and the hue jitter, by its own amount up to this many points either way, keeping their hue and brightness, the same on every redraw; colors without a hue stay; 0: off), brightness_jitter 0..100% (each copy moves the brightness of its solid colors, after the colorization and the hue and saturation jitter, by its own amount up to this many points either way, keeping their hue and saturation, the same on every redraw; white, black and grays move too; 0: off). art: width 1..1000%, width_mode: null (fixed)|pressure|tilt|bearing|rotation|stylusWheel, width_max 1..1000% (pressure: width at the lightest pen pressure to width_max at the heaviest; tilt: width with the pen lying flat to width_max upright; bearing and rotation: width at −180° to width_max at 180°; stylusWheel: width at one end of the finger wheel to width_max at the other; half way on a stroke drawn without that input), scale: {mode: proportional|stretch|betweenGuides, start, end: 0..1 of the art length}, direction: leftToRight|rightToLeft|topToBottom|bottomToTop, flip_along, flip_across, overlap. pattern: scale 1..10000%, scale_mode: null (fixed)|pressure|tilt|bearing|rotation|stylusWheel, scale_max 1..10000% (the tiles go from scale to scale_max over the same pen ranges as an art brush's width; half way on a stroke drawn without that input; each tile's height follows the stroke, its length and the gap after it take the scale at its middle, and a corner tile takes the scale at its corner), spacing 0..10000%, fit: stretch|addSpace|approximate, flip_along, flip_across, outer_corner and inner_corner: corner tile art (drawn as the corner that joins a side tile on its right to one below it) or null, outer_source and inner_source: what that kind of corner draws without its art: none|autoCentered|autoBetween|autoSliced|autoOverlap (a tile made from the side tile), or null (the other kind of corner's art); side_tile, outer_corner_tile, inner_corner_tile, start_tile, end_tile: a document pattern name, original, or none (side refuses none); corner tiles also take autoCentered|autoBetween|autoSliced|autoOverlap. Each tile also accepts {pattern: name} to select a swatch whose name is a reserved choice. scatter, art and pattern: colorization: {method: none|tints|tintsAndShades|hueShift, key: colour (hueShift: the art colour that becomes the stroke colour; without a key: the solid color the art's fills and strokes use most, black when they use none)}; colorization and the art brush's scale change only the fields given}, newName? (trimmed; blank: the name is kept; a new bristle brush name has at most 31 characters, and a longer name the brush has is kept)} edit a brush definition (strokes using it update); params and a newName that leave the brush as it is change nothing and record no undo step → {name}",
has_doc,
brush_options
),
diff --git a/crates/engine/src/cmd/brushsym/brushes.rs b/crates/engine/src/cmd/brushsym/brushes.rs
index af71b2dae9..eaebecf11e 100644
--- a/crates/engine/src/cmd/brushsym/brushes.rs
+++ b/crates/engine/src/cmd/brushsym/brushes.rs
@@ -80,10 +80,11 @@ pub(super) fn brush_apply(s: &mut Session, p: &Value) -> Result {
}
let ids = brush_targets(&s.doc()?.doc, &roots(s, p)?);
let stroke = stroke_paint(s);
- s.edit("Apply Brush", |d, _| {
+ crate::cmd::colorcmds::edit_if_changed(s, "Apply Brush", |before, d| {
d.unknown.insert(brush::CURRENT_KEY.into(), json!(name));
apply_brush(d, &ids, &name, &stroke);
- Ok(())
+ let changed = brush::current(before).as_deref() != Some(name.as_str()) || ids.iter().any(|id| before.node(*id) != d.node(*id));
+ Ok(((), changed))
})?;
Ok(json!({ "ids": ids_json(&ids) }))
}
@@ -213,6 +214,7 @@ fn rename_brush_strokes(d: &mut Document, lib: &mut [Brush], from: &str, to: Opt
}
}
+/// Stores `lib` and applies `renames` as one undo step named `label`.
fn save_library(s: &mut Session, label: &str, mut lib: Vec, renames: &[(String, Option)]) -> Result<()> {
s.edit(label, |d, _| {
for (from, to) in renames {
@@ -503,8 +505,13 @@ pub(super) fn brush_options(s: &mut Session, p: &Value) -> Result {
v["name"] = json!(name);
}
v["type"] = json!(lib[i].kind.type_id());
- lib[i] = parse_brush(C, v)?;
- let out = lib[i].name.clone();
+ let edited = parse_brush(C, v)?;
+ let out = edited.name.clone();
+ // Options that leave the brush as it is change nothing and add no undo step.
+ if new_name.is_none() && edited == lib[i] {
+ return Ok(json!({ "name": out }));
+ }
+ lib[i] = edited;
let rename = new_name.map(|nn| (name, Some(nn)));
save_library(s, "Brush Options", lib, rename.as_slice())?;
Ok(json!({ "name": out }))
diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs
index b03ecb2d38..bac821ab90 100644
--- a/crates/engine/src/cmd/edit.rs
+++ b/crates/engine/src/cmd/edit.rs
@@ -171,7 +171,7 @@ pub fn specs() -> Vec {
"Cut",
["Edit"],
Some("Cmd+X"),
- "{selectedArtboards?: [n…], art?: bool, lockedAndHidden?: bool (the Artboard tool chosen, as artboard.cut)} (as edit.copy) removes the objects it copies, in one undo step: a compound-path member selected on its own leaves the compound's other members in the compound (selected ruler guides go too; the Artboard tool chosen, or selectedArtboards given: artboard.cut); refused while an object of a symbol instance's art is selected",
+ "{artboard?: index (the source artboard for copied objects), selectedArtboards?: [n…], art?: bool, lockedAndHidden?: bool (the Artboard tool chosen, as artboard.cut)} (as edit.copy) removes the objects it copies, in one undo step: a compound-path member selected on its own leaves the compound's other members in the compound (selected ruler guides go too; the Artboard tool chosen, or selectedArtboards given: artboard.cut); refused while an object of a symbol instance's art is selected",
has_selection_guides_or_artboard_tool,
cut
),
@@ -180,7 +180,7 @@ pub fn specs() -> Vec {
"Copy",
["Edit"],
Some("Cmd+C"),
- "{selectedArtboards?: [n…] (the artboards the Artboard tool had selected, which the journal records for a replay; it runs artboard.copy with any tool chosen), art?: bool (default: the Artboard tool's moveArt option; the journal records it beside selectedArtboards), lockedAndHidden?: bool (the Artboard tool chosen, as artboard.copy)} the selection with what it uses (a compound-path member selected on its own, whole or in part, with Direct or Group Selection, is copied as an ordinary path with the compound's paint, transparency, opacity mask, fill rule and graphic style link (while it has that style's look), a gradient keeping the compound's fit; the compound is copied when it is selected, or when every member is selected whole outside isolation mode), and the selected ruler guides (pasted on the layer new art goes to, moved as the objects are; alone, where they were); the Artboard tool chosen: artboard.copy; with an object of a symbol instance's art selected, the instance is copied whole → {copied, guides}",
+ "{artboard?: index (the source artboard for copied objects; without it, the artboard containing the selection center), selectedArtboards?: [n…] (the artboards the Artboard tool had selected, which the journal records for a replay; it runs artboard.copy with any tool chosen), art?: bool (default: the Artboard tool's moveArt option; the journal records it beside selectedArtboards), lockedAndHidden?: bool (the Artboard tool chosen, as artboard.copy)} the selection with what it uses (a compound-path member selected on its own, whole or in part, with Direct or Group Selection, is copied as an ordinary path with the compound's paint, transparency, opacity mask, fill rule and graphic style link (while it has that style's look), a gradient keeping the compound's fit; the compound is copied when it is selected, or when every member is selected whole outside isolation mode), and the selected ruler guides (pasted on the layer new art goes to, moved as the objects are; alone, where they were); the Artboard tool chosen: artboard.copy; with an object of a symbol instance's art selected, the instance is copied whole → {copied, guides}",
has_selection_guides_or_artboard_tool,
copy
),
@@ -996,7 +996,8 @@ pub(crate) fn selection_roots(st: &crate::DocState) -> Vec {
}
#[cfg(test)]
ROOTS_FOUND.set(ROOTS_FOUND.get() + 1);
- let roots = roots_of(&st.doc, st.selection.in_paint_order(&st.doc));
+ let (ids, paths) = placed_in_paint_order(&st.doc, &st.selection.objects);
+ let roots = roots_placed(&st.doc, ids, &paths, |_, _| false);
*kept = Some((Arc::downgrade(&st.doc), st.selection.objects.clone(), roots.clone()));
roots
})
@@ -1044,7 +1045,19 @@ pub(crate) fn no_symbol_part(s: &Session) -> std::result::Result<(), String> {
pub(crate) fn selected_roots_to_transform(s: &Session) -> Result> {
refuse_symbol_part(s)?;
let st = s.doc()?;
- Ok(roots_within(&st.doc, st.selection.in_paint_order(&st.doc), |_, _| true))
+ let (ids, paths) = placed_in_paint_order(&st.doc, &st.selection.objects);
+ Ok(roots_placed(&st.doc, ids, &paths, |_, _| true))
+}
+
+/// The objects of `objects` that are in `doc`, in paint order as
+/// [`vectorcraft_doc::Selection::in_paint_order`] gives them, with their places in the tree. One
+/// walk finds the places for both the order and [`roots_placed`] ([`roots_within`] after
+/// `in_paint_order` walks the tree twice).
+fn placed_in_paint_order(doc: &Document, objects: &[NodeId]) -> (Vec, HashMap>) {
+ let paths = doc.index_paths(objects.iter().copied());
+ let mut ids: Vec = objects.iter().copied().filter(|id| paths.contains_key(id)).collect();
+ ids.sort_by(|a, b| paths.get(a).cmp(&paths.get(b)));
+ (ids, paths)
}
/// [`selected_roots`] for the selected objects inside the isolated object `root`
@@ -1056,8 +1069,9 @@ pub(crate) fn selected_roots_to_transform(s: &Session) -> Result> {
pub(crate) fn selected_roots_inside(s: &Session, root: NodeId, members: bool) -> Result> {
refuse_symbol_part(s)?;
let st = s.doc()?;
- let ids = st.selection.in_paint_order(&st.doc).into_iter().filter(|id| super::inside_isolation(&st.doc, root, *id)).collect();
- Ok(roots_within(&st.doc, ids, |compound, _| members || compound == root))
+ let (ids, paths) = placed_in_paint_order(&st.doc, &st.selection.objects);
+ let ids = ids.into_iter().filter(|id| super::inside_isolation(&st.doc, root, *id)).collect();
+ Ok(roots_placed(&st.doc, ids, &paths, |compound, _| members || compound == root))
}
/// The top-level objects among `ids` (in paint order): compound-path members stand for their
@@ -1071,6 +1085,11 @@ pub(crate) fn roots_of(doc: &Document, ids: Vec) -> Vec {
fn roots_within(doc: &Document, ids: Vec, keep_member: impl Fn(NodeId, NodeId) -> bool) -> Vec {
// Every id's place in the tree, found in one walk (a lookup per id is a walk per id).
let paths = doc.index_paths(ids.iter().copied());
+ roots_placed(doc, ids, &paths, keep_member)
+}
+
+/// [`roots_within`] with `paths`, the places of `ids` in `doc`'s tree, found already.
+fn roots_placed(doc: &Document, ids: Vec, paths: &HashMap>, keep_member: impl Fn(NodeId, NodeId) -> bool) -> Vec {
// A compound-path member acts as its compound (compounds are one object).
let mut sel: Vec<(NodeId, Option>)> = ids
.into_iter()
@@ -1134,7 +1153,8 @@ fn copy_cut_targets(s: &Session) -> Result<(bool, Vec)> {
st.doc.node(compound).and_then(|n| n.children()).is_some_and(|members| !members.is_empty() && members.iter().all(|m| whole(m)))
})
};
- let roots = roots_within(&st.doc, st.selection.in_paint_order(&st.doc), |compound, _member| in_isolated_compound || !all_members_whole(compound));
+ let (ids, paths) = placed_in_paint_order(&st.doc, &st.selection.objects);
+ let roots = roots_placed(&st.doc, ids, &paths, |compound, _member| in_isolated_compound || !all_members_whole(compound));
Ok((direct, roots))
}
@@ -1192,6 +1212,13 @@ fn copy(s: &mut Session, p: &Value) -> Result {
});
clip.source_artboard = board.map(|a| a.rect);
}
+ if let Some(value) = p.get("artboard") {
+ let board = value
+ .as_u64()
+ .and_then(|v| st.doc.artboards.get(index(v)))
+ .ok_or_else(|| bad("edit.copy", "`artboard` must be the index of an artboard of the document"))?;
+ clip.source_artboard = Some(board.rect);
+ }
clip.guides = guides;
s.clipboard = clip;
Ok(json!({ "copied": s.clipboard.nodes.len(), "guides": s.clipboard.guides.len() }))
diff --git a/crates/engine/src/cmd/edit/tests.rs b/crates/engine/src/cmd/edit/tests.rs
index 7ac2d9c162..7e0471f0f5 100644
--- a/crates/engine/src/cmd/edit/tests.rs
+++ b/crates/engine/src/cmd/edit/tests.rs
@@ -348,6 +348,36 @@ fn direct_selection_cut_timing() {
}
}
+/// Finding the selected roots (for the menus, for Move and its siblings, for Copy and Cut, and
+/// inside an isolated group) walks the tree once for the paint order and the roots together, in
+/// paint order whatever order the objects were selected in.
+#[test]
+fn finding_the_selected_roots_walks_the_tree_once() {
+ let mut s = session(2_000, square);
+ let all = crate::tests_large_edits::layer(&s, 0);
+ let reversed: Vec = all.iter().rev().map(|id| id.0).collect();
+ s.execute("select.set", &json!({"ids": reversed})).unwrap();
+ type Find = fn(&Session) -> Vec;
+ let finds: [(&str, Find); 3] = [
+ ("the selected roots", |s| selected_roots(s).unwrap()),
+ ("the roots to transform", |s| selected_roots_to_transform(s).unwrap()),
+ ("Copy's targets", |s| copy_cut_targets(s).unwrap().1),
+ ];
+ for (what, find) in finds {
+ let walks = tree_walks();
+ assert!(find(&s) == all, "{what} in paint order");
+ assert_eq!(tree_walks() - walks, 1, "finding {what} walked the tree {} times", tree_walks() - walks);
+ }
+ s.execute("object.group", &json!({})).unwrap();
+ let group = s.doc().unwrap().doc.layers[0].children().unwrap()[0].id;
+ s.execute("select.set", &json!({"ids": reversed})).unwrap();
+ // The first call also builds the lookup cache that the isolation check reads.
+ assert!(selected_roots_inside(&s, group, false).unwrap() == all, "the roots inside the group in paint order");
+ let walks = tree_walks();
+ assert!(selected_roots_inside(&s, group, false).unwrap() == all);
+ assert_eq!(tree_walks() - walks, 1, "finding the roots inside the group walked the tree {} times", tree_walks() - walks);
+}
+
/// The selected roots are found once for a document version and its selected objects, however many enabled checks
/// read them, and found again after the selection changes, after an edit, and for another selection.
#[test]
diff --git a/crates/engine/src/cmd/globaledit.rs b/crates/engine/src/cmd/globaledit.rs
index cecf216b24..b2d6098e56 100644
--- a/crates/engine/src/cmd/globaledit.rs
+++ b/crates/engine/src/cmd/globaledit.rs
@@ -267,6 +267,8 @@ thread_local! {
pub(crate) static FORMS_MADE: std::cell::Cell = const { std::cell::Cell::new(0) };
/// Tests: how many times [`outlines`] made the outline of a highlighted object on this thread.
pub(crate) static OUTLINES_MADE: std::cell::Cell = const { std::cell::Cell::new(0) };
+ /// Tests: how many objects [`matches`] looked at on this thread.
+ pub(crate) static OBJECTS_WALKED: std::cell::Cell = const { std::cell::Cell::new(0) };
}
impl Form {
@@ -527,6 +529,8 @@ fn matches(s: &Session, o: &Options) -> Result> {
let mut cache = st.global_edit_forms.0.borrow_mut();
let mut pass = cache.forms.pass();
super::select::walk_selectable(d, st.isolation, |n| {
+ #[cfg(test)]
+ OBJECTS_WALKED.with(|c| c.set(c.get() + 1));
if n.id == *id || out.len() >= MAX_MEMBERS {
return false;
}
@@ -1075,34 +1079,178 @@ pub fn highlights(s: &Session) -> std::sync::Arc {
out
}
-/// [`similar`]'s outlines as of a document revision and the options they were found with.
-pub type SimilarCache = std::cell::RefCell