mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-28 14:19:57 -08:00
On the web, a plug-in being installed ran its start function and vc_manifest on the page, and a filter ran on the page for its whole budget, so a slow or looping module froze the tab for up to a minute (five for a heavy filter), and Cancel could not stop it. - A second wasm, apps/vectorcraft-plugin-worker, is built by Trunk as a worker (data-type="worker" with data-loader-shim in index.html). The page starts one worker for each check and each run, and terminates it on Cancel, when the document or the plug-in changes, and 5 s past the run's time budget, also while a dialog is open. Each worker's inbox holds its latest progress report and at most 8 other messages. - crates/plugins/src/worker.rs holds the messages and the worker's side. Runs can pause at each vc_call (Plugin::begin_run and resume_run), which the desktop's synchronous calls now use too. - Install Plug-in... and File > Open check a module in a worker first; the page then loads it with Plugin::load_checked, which runs none of its code. - A filter that calls commands sends each call to the page. The session holds the run's undo step open and refuses other edits with "a plug-in is running: cancel it or wait for it to finish" until the run ends; the progress window shows at once with Cancel only. - On the web every filter and plug-in command started from the menus or their dialogs runs in a worker, and the dialogs have no Preview. A plug-in command applies as itself, one undo step named after it. Commands that automation runs directly still run where they are called and return their result. - packaging/web: the worker files carry no hash, so the sample cache rules make only the hashed app files immutable.
42 lines
2.9 KiB
HTML
42 lines
2.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-title" content="VectorCraft">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<meta name="theme-color" content="#262626">
|
|
<title>VectorCraft</title>
|
|
<!-- Tab and home-screen icons: copied from assets/app-icon (one folder per size, the PNG names are equal). -->
|
|
<link data-trunk rel="copy-file" href="../../assets/app-icon/hicolor/scalable/apps/ai.storyteller.vectorcraft.svg" data-target-path="icons" />
|
|
<link data-trunk rel="copy-file" href="../../assets/app-icon/hicolor/32x32/apps/ai.storyteller.vectorcraft.png" data-target-path="icons/32" />
|
|
<link data-trunk rel="copy-file" href="../../assets/app-icon/hicolor/256x256/apps/ai.storyteller.vectorcraft.png" data-target-path="icons/256" />
|
|
<link rel="icon" type="image/svg+xml" href="icons/ai.storyteller.vectorcraft.svg">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="icons/32/ai.storyteller.vectorcraft.png">
|
|
<link rel="apple-touch-icon" href="icons/256/ai.storyteller.vectorcraft.png">
|
|
<link data-trunk rel="rust" data-bin="vectorcraft-web" data-wasm-opt="z" data-weak-refs />
|
|
<!-- The plug-in worker: checks plug-ins being installed and runs filters off the page (apps/vectorcraft-plugin-worker). -->
|
|
<link data-trunk rel="rust" href="../vectorcraft-plugin-worker/Cargo.toml" data-bin="vectorcraft-plugin-worker" data-type="worker" data-loader-shim data-wasm-opt="z" />
|
|
<style>
|
|
/* iPad: no page scroll, bounce, pinch zoom, text selection or callout; the app takes the gestures. */
|
|
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #262626;
|
|
overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
|
|
-webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
|
|
/* Inside the safe areas (notch, home indicator) of a full-screen app. */
|
|
#vectorcraft_canvas { position: absolute; top: env(safe-area-inset-top, 0); right: env(safe-area-inset-right, 0);
|
|
bottom: env(safe-area-inset-bottom, 0); left: env(safe-area-inset-left, 0);
|
|
width: calc(100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
|
|
height: calc(100% - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
|
|
display: block; touch-action: none; }
|
|
#vectorcraft_loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
|
|
color: #b8b8b8; font: 14px system-ui, sans-serif; pointer-events: none; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<canvas id="vectorcraft_canvas"></canvas>
|
|
<div id="vectorcraft_loading">Loading VectorCraft…</div>
|
|
</body>
|
|
</html>
|