AI-native design editor. Open-source Figma alternative.
feat(cloud): serve the Cloud portal from the server (#1068)
Danila Poyarkov15d7fd80ce98
diff --git a/.gitignore b/.gitignoreindex 7c8c67204..6a624767f 100644--- a/.gitignore+++ b/.gitignore@@ -100,3 +100,4 @@ packages/feedback/.dev.vars# OpenPencil Cloud local and build outputspackages/cloud/deploy/generated/packages/cloud/dist-standalone/+dist-cloud-portal/diff --git a/bun.lock b/bun.lockindex 8c17ec1aa..6f11bfb9b 100644--- a/bun.lock+++ b/bun.lock@@ -80,6 +80,7 @@"nanostores": "^1.5.4","opentype.js": "^2.0.0","partial-json": "^0.1.7",+ "qrcode": "1.5.4","reka-ui": "^2.10.5","svg2pdf.js": "^2.8.1","tailwind-merge": "^3.7.0",@@ -124,6 +125,7 @@"@types/culori": "^4.0.1","@types/node": "^25.9.9","@types/opentype.js": "^1.3.10",+ "@types/qrcode": "1.5.5","@types/ws": "^8.18.1","@typescript-eslint/utils": "^8.71.0","@typescript/native-preview": "^7.0.0-dev.20260707.2",@@ -2336,6 +2338,8 @@"@types/proper-lockfile": ["@types/[email protected]", "", { "dependencies": { "@types/retry": "*" } }, "sha512-uo2ABllncSqg9F1D4nugVl9v93RmjxF6LJzQLMLDdPaXCUIDPeOJ21Gbqi43xNKzBi/WQ0Q0dICqufzQbMjipQ=="],+ "@types/qrcode": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-CdfBi/e3Qk+3Z/fXYShipBT13OJ2fDO2Q2w5CIP5anLTLIndQG9z6P1cnm+8zCWSpm5dnxMFd/uREtb0EXuQzg=="],+"@types/raf": ["@types/[email protected]", "", {}, "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw=="],"@types/rbush": ["@types/[email protected]", "", {}, "sha512-+N+2H39P8X+Hy1I5mC6awlTX54k3FhiUmvt7HWzGJZvF+syUAAxP/stwppS8JE84YHqFgRMv6fCy31202CMFxQ=="],@@ -3020,6 +3024,8 @@"diff": ["[email protected]", "", {}, "sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw=="],+ "dijkstrajs": ["[email protected]", "", {}, "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA=="],+"doctypes": ["[email protected]", "", {}, "sha512-LLBi6pEqS6Do3EKQ3J0NqHWV5hhb78Pi8vvESYwyOy2c31ZEZVdtitdzsQsKb7878PEERhzUk0ftqGhG6Mz+pQ=="],"dom-accessibility-api": ["[email protected]", "", {}, "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg=="],@@ -3976,6 +3982,8 @@"p-retry": ["[email protected]", "", { "dependencies": { "@types/retry": "0.12.0", "retry": "^0.13.1" } }, "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ=="],+ "p-try": ["[email protected]", "", {}, "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="],+"pac-proxy-agent": ["[email protected]", "", { "dependencies": { "@tootallnate/quickjs-emscripten": "^0.23.0", "agent-base": "^7.1.2", "debug": "^4.3.4", "get-uri": "^6.0.1", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.6", "pac-resolver": "^7.0.1", "socks-proxy-agent": "^8.0.5" } }, "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA=="],"pac-resolver": ["[email protected]", "", { "dependencies": { "degenerator": "^5.0.0", "netmask": "^2.0.2" } }, "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg=="],@@ -4072,7 +4080,7 @@"pluralize": ["[email protected]", "", {}, "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA=="],- "pngjs": ["[email protected]", "", {}, "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow=="],+ "pngjs": ["[email protected]", "", {}, "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw=="],"portless": ["[email protected]", "", { "os": [ "linux", "win32", "darwin", ], "bin": { "portless": "dist/cli.js" } }, "sha512-zmJu4Q8/fY54oVUT/5NnmF4Ih8wTdCvCf6JCN783dRYl9mXkJBzXSckX2lztGCLIbM70varDjCudAbGKT73XPg=="],@@ -4168,6 +4176,8 @@"pvutils": ["[email protected]", "", {}, "sha512-BbubeCEyTuQjVMakvJQ/Sxbc93F2pwmbsxONT/ZRrwU7Ua38d8unYTwXpTVLAKJ4BDuH9IGztCjQcd/N/39Dvg=="],+ "qrcode": ["[email protected]", "", { "dependencies": { "dijkstrajs": "^1.0.1", "pngjs": "^5.0.0", "yargs": "^15.3.1" }, "bin": { "qrcode": "bin/qrcode" } }, "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg=="],+"qs": ["[email protected]", "", { "dependencies": { "es-define-property": "^1.0.1", "side-channel": "^1.1.1" } }, "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA=="],"quansync": ["[email protected]", "", {}, "sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA=="],@@ -4290,6 +4300,8 @@"require-from-string": ["[email protected]", "", {}, "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="],+ "require-main-filename": ["[email protected]", "", {}, "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg=="],+"resolve": ["[email protected]", "", { "dependencies": { "es-errors": "^1.3.0", "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA=="],"resolve-from": ["[email protected]", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="],@@ -4368,6 +4380,8 @@"serve-static": ["[email protected]", "", { "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "parseurl": "^1.3.3", "send": "^1.2.0" } }, "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw=="],+ "set-blocking": ["[email protected]", "", {}, "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="],+"set-cookie-parser": ["[email protected]", "", {}, "sha512-xletSdAI5efyVJjsatBbzDkXl3M/Zmad3xfnQe7ZXuBB0yNwW7C2WFsNGjdRNfZunmNHQuX79xs/ACMTLCdcew=="],"set-function-length": ["[email protected]", "", { "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2" } }, "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg=="],@@ -4846,6 +4860,8 @@"which-collection": ["[email protected]", "", { "dependencies": { "is-map": "^2.0.3", "is-set": "^2.0.3", "is-weakmap": "^2.0.2", "is-weakset": "^2.0.3" } }, "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw=="],+ "which-module": ["[email protected]", "", {}, "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ=="],+"which-typed-array": ["[email protected]", "", { "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.9", "call-bound": "^1.0.4", "for-each": "^0.3.5", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" } }, "sha512-fvO4ExWMFsqyhG3AiPAObMuY1lxaqgYcxbc49CNdWDDECOJNgQyvsOWVwbZc+qf3rzRtxojBK+CMEv0Ld5CYpw=="],"whynot": ["[email protected]", "", {}, "sha512-cGGfDPYYqoHoMWqXVc3G+N74u1FhFhrBa+pOO906b9ktRc/JFUdwroTkfPqjKzyoCLVcKr6yy6bYIcWT7jTg2A=="],@@ -5392,6 +5408,8 @@"pi-mcp-adapter/@modelcontextprotocol/client": ["@modelcontextprotocol/[email protected]", "", { "dependencies": { "@modelcontextprotocol/core": "2.0.0-beta.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "jose": "^6.1.3", "pkce-challenge": "^5.0.0", "zod": "^4.2.0" } }, "sha512-YuuNm5f2TMoFQRje1UqVP8TJRjijCXMz4ckvoVpx1cUXuBEmykWQ2d8R536pek6UKcXT41T5nWc4qR1JFIbEmg=="],+ "pixelmatch/pngjs": ["[email protected]", "", {}, "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow=="],+"pptxgenjs/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-EANqOCF9QFyra+4pfxUcX9STKJpCLjMbObVzljIJomAWSnuSIEAvyzEU53GaajbXJEgdh0iEcPL+DGvpUd4k1Q=="],"prebuild-install/tar-fs": ["[email protected]", "", { "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", "tar-stream": "^2.1.4" } }, "sha512-OboTd8mmMhZDNPV+UjQcK9yKAatXu2aJ+r1w4im1Otd4M4fl2hwvdoXUxIYHFTHWK/3y3FarBP70v3vwmGlOxw=="],@@ -5404,6 +5422,8 @@"proxy-agent/lru-cache": ["[email protected]", "", {}, "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA=="],+ "qrcode/yargs": ["[email protected]", "", { "dependencies": { "cliui": "^6.0.0", "decamelize": "^1.2.0", "find-up": "^4.1.0", "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", "string-width": "^4.2.0", "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^18.1.2" } }, "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A=="],+"raw-body/iconv-lite": ["[email protected]", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ=="],"rc/ini": ["[email protected]", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="],@@ -5950,6 +5970,16 @@"prebuild-install/tar-fs/tar-stream": ["[email protected]", "", { "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.1.1" } }, "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ=="],+ "qrcode/yargs/cliui": ["[email protected]", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" } }, "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ=="],++ "qrcode/yargs/decamelize": ["[email protected]", "", {}, "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA=="],++ "qrcode/yargs/find-up": ["[email protected]", "", { "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" } }, "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw=="],++ "qrcode/yargs/y18n": ["[email protected]", "", {}, "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ=="],++ "qrcode/yargs/yargs-parser": ["[email protected]", "", { "dependencies": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" } }, "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ=="],+"read-pkg-up/find-up/locate-path": ["[email protected]", "", { "dependencies": { "p-locate": "^6.0.0" } }, "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA=="],"read-pkg-up/find-up/path-exists": ["[email protected]", "", {}, "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ=="],@@ -6444,6 +6474,14 @@"prebuild-install/tar-fs/tar-stream/readable-stream": ["[email protected]", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="],+ "qrcode/yargs/cliui/strip-ansi": ["[email protected]", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],++ "qrcode/yargs/cliui/wrap-ansi": ["[email protected]", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA=="],++ "qrcode/yargs/find-up/locate-path": ["[email protected]", "", { "dependencies": { "p-locate": "^4.1.0" } }, "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g=="],++ "qrcode/yargs/yargs-parser/camelcase": ["[email protected]", "", {}, "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="],+"read-pkg-up/find-up/locate-path/p-locate": ["[email protected]", "", { "dependencies": { "p-limit": "^4.0.0" } }, "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw=="],"read-pkg/normalize-package-data/hosted-git-info/lru-cache": ["[email protected]", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="],@@ -6542,6 +6580,10 @@"prebuild-install/tar-fs/tar-stream/bl/buffer": ["[email protected]", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="],+ "qrcode/yargs/cliui/strip-ansi/ansi-regex": ["[email protected]", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],++ "qrcode/yargs/find-up/locate-path/p-locate": ["[email protected]", "", { "dependencies": { "p-limit": "^2.2.0" } }, "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A=="],+"read-pkg-up/find-up/locate-path/p-locate/p-limit": ["[email protected]", "", { "dependencies": { "yocto-queue": "^1.0.0" } }, "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ=="],"steiger/yargs/cliui/strip-ansi/ansi-regex": ["[email protected]", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],@@ -6582,6 +6624,8 @@"@earendil-works/pi-coding-agent/@earendil-works/pi-ai/@aws-sdk/client-bedrock-runtime/@aws-sdk/token-providers/@aws-sdk/nested-clients/@aws-sdk/signature-v4-multi-region": ["@aws-sdk/[email protected]", "", { "dependencies": { "@aws-sdk/types": "^3.974.4", "@smithy/signature-v4": "^5.6.12", "@smithy/types": "^4.16.1", "tslib": "^2.6.2" } }, "sha512-bBuyztukzXq6plzFGHAWiQt0QXo+HL8b8lX5cFTzkez/74PtS1c0qPFCIVuHkyoT+miH2qOjAcm1/yoro2ESPA=="],+ "qrcode/yargs/find-up/locate-path/p-locate/p-limit": ["[email protected]", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="],+"read-pkg-up/find-up/locate-path/p-locate/p-limit/yocto-queue": ["[email protected]", "", {}, "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ=="],"@earendil-works/pi-agent-core/@earendil-works/pi-ai/@aws-sdk/client-bedrock-runtime/@aws-sdk/credential-provider-node/@aws-sdk/credential-provider-ini/@aws-sdk/nested-clients/@aws-sdk/signature-v4-multi-region": ["@aws-sdk/[email protected]", "", { "dependencies": { "@aws-sdk/types": "^3.974.4", "@smithy/signature-v4": "^5.6.12", "@smithy/types": "^4.16.1", "tslib": "^2.6.2" } }, "sha512-bBuyztukzXq6plzFGHAWiQt0QXo+HL8b8lX5cFTzkez/74PtS1c0qPFCIVuHkyoT+miH2qOjAcm1/yoro2ESPA=="],diff --git a/cloud.html b/cloud.htmlnew file mode 100644index 000000000..3b96ff503--- /dev/null+++ b/cloud.html@@ -0,0 +1,23 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <meta name="referrer" content="no-referrer" />+ <title>OpenPencil Cloud</title>+ <link rel="icon" type="image/svg+xml" href="/brand/favicon.svg" />+ <link rel="icon" type="image/png" sizes="96x96" href="/brand/favicon-96x96.png" />+ <style>+ html, body, #app { height: 100%; margin: 0; }+ body { background: #1e1e1e; }+ @media (prefers-color-scheme: light) {+ body { background: #f3f4f6; }+ }+ </style>+ </head>++ <body>+ <div id="app"></div>+ <script type="module" src="/src/cloud/main.ts"></script>+ </body>+</html>diff --git a/package.json b/package.jsonindex a6792375d..e29dc435d 100644--- a/package.json+++ b/package.json@@ -52,6 +52,7 @@"cloud:dev": "bun tools/dev/cloud/src/index.ts up","cloud:dev:down": "bun tools/dev/cloud/src/index.ts down","build": "bun run build:packages && bun run lint && vite build",+ "build:cloud-portal": "vite build --mode cloud-portal","preview": "vite preview","storybook": "storybook dev -p 6006","build-storybook": "storybook build",@@ -188,6 +189,7 @@"nanostores": "^1.5.4","opentype.js": "^2.0.0","partial-json": "^0.1.7",+ "qrcode": "1.5.4","reka-ui": "^2.10.5","svg2pdf.js": "^2.8.1","tailwind-merge": "^3.7.0",@@ -232,6 +234,7 @@"@types/culori": "^4.0.1","@types/node": "^25.9.9","@types/opentype.js": "^1.3.10",+ "@types/qrcode": "1.5.5","@types/ws": "^8.18.1","@typescript-eslint/utils": "^8.71.0","@typescript/native-preview": "^7.0.0-dev.20260707.2",diff --git a/packages/cloud/AGENTS.md b/packages/cloud/AGENTS.mdindex 4a09523f2..afb33994e 100644--- a/packages/cloud/AGENTS.md+++ b/packages/cloud/AGENTS.md@@ -21,6 +21,10 @@ Optional, self-hostable backend; the design is in `packages/docs/development/clo- Viewers may send only the channels in `VIEWER_ACTIONS`; every other channel from them is dropped, and presence is stamped from the ticket by `stampAwareness` (`tests/server/collaboration/relay/hub.test.ts`).- Decoders must consume exactly the frame's bytes and copy payloads out, since socket buffers are pooled (`src/contract/relay.ts`, `tests/contract/relay.test.ts`).+## Portal++- The portal's pages live in the app (`cloud.html`, `src/views/cloud/`, `src/components/cloud-portal/`); this package owns only their paths (`src/contract/portal.ts`) and serving them (`src/runtime/node/portal.ts`). Links the server sends to people point at portal paths on `publicURL`; only the editor itself is on `appURL` (`src/admin/enrollment/email.ts`).+## Configuration- Deployment settings live in the schema-versioned TOML parsed by `src/server/config/deployment.ts`; environment variables only resolve `{ from_env }` secret references and never override the file (`tests/runtime/node/config.test.ts`).diff --git a/packages/cloud/src/admin/api/routes.ts b/packages/cloud/src/admin/api/routes.tsindex 1ecd19b24..45538bc4f 100644--- a/packages/cloud/src/admin/api/routes.ts+++ b/packages/cloud/src/admin/api/routes.ts@@ -15,17 +15,21 @@ import type { CloudAPIEnvironment } from '#cloud/server/api'import type { CloudAuthAdapter } from '#cloud/server/auth'import type { CloudDatabase } from '#cloud/server/db'import { CLOUD_RATE_LIMITS, createActorRateLimiter } from '#cloud/server/rate-limit'-import { validatedJSON } from '#cloud/server/validation'+import { validatedJSON, validatedQuery } from '#cloud/server/validation'import { Hono } from 'hono'import { NoResultError, type Kysely } from 'kysely'import * as v from 'valibot'-const countSchema = v.pipe(v.string(), v.digits(), v.toNumber())-/** A count from the query string; anything but digits is a bad request, not a NaN query. */-function queryCount(value: string | undefined, fallback: number): number {- return value === undefined ? fallback : v.parse(countSchema, value)-}+const countSchema = v.optional(v.pipe(v.string(), v.digits(), v.toNumber()))+const parseEnrollmentQuery = (input: unknown) =>+ v.parse(v.object({ status: v.optional(enrollmentStatusSchema) }), input)+const parseUserQuery = (input: unknown) =>+ v.parse(+ v.object({ search: v.optional(v.string()), limit: countSchema, offset: countSchema }),+ input+ )+const parseLimitQuery = (input: unknown) => v.parse(v.object({ limit: countSchema }), input)export type CloudAdminServices = {email: AdminEmailService@@ -87,11 +91,11 @@ export function createCloudAdminRoutes(}throw error})- .get('/enrollments', async (context) => {- const statusValue = context.req.query('status')- const status = statusValue ? v.parse(enrollmentStatusSchema, statusValue) : undefined- return context.json({ enrollments: await services.enrollment.list(status) })- })+ .get('/enrollments', validatedQuery(parseEnrollmentQuery), async (context) =>+ context.json({+ enrollments: await services.enrollment.list(context.req.valid('query').status)+ })+ ).post('/enrollments/:id/approve', validatedJSON(parseEnrollmentReview), async (context) =>context.json({enrollment: await services.enrollment.review(@@ -122,15 +126,16 @@ export function createCloudAdminRoutes()}))- .get('/users', async (context) =>- context.json(+ .get('/users', validatedQuery(parseUserQuery), async (context) => {+ const query = context.req.valid('query')+ return context.json(await services.users.list(context.req.raw.headers, {- searchValue: context.req.query('search'),- limit: queryCount(context.req.query('limit'), 100),- offset: queryCount(context.req.query('offset'), 0)+ searchValue: query.search,+ limit: query.limit ?? 100,+ offset: query.offset ?? 0}))- )+ }).post('/users/ban', validatedJSON(parseUserMutation), async (context) => {const input = context.req.valid('json')await services.users.ban(@@ -165,19 +170,22 @@ export function createCloudAdminRoutes()return context.json({ ok: true as const })})- .get('/email', async (context) =>+ .get('/email', validatedQuery(parseLimitQuery), async (context) =>context.json({- messages: await services.email.list(queryCount(context.req.query('limit'), 100))+ messages: await services.email.list(context.req.valid('query').limit ?? 100)})).post('/email/:id/regenerate', async (context) => {await services.email.regenerate(context.get('actor').userId, context.req.param('id'))return context.json({ ok: true as const })})- .get('/audit', async (context) =>+ .get('/audit', validatedQuery(parseLimitQuery), async (context) =>context.json({- events: await services.audit.list(queryCount(context.req.query('limit'), 100))+ events: await services.audit.list(context.req.valid('query').limit ?? 100)})).get('/operations', async (context) => context.json(await services.operations.summary()))}++/** The administration routes' types, for the portal's typed client. */+export type CloudAdminRoutes = ReturnType<typeof createCloudAdminRoutes>diff --git a/packages/cloud/src/admin/email/service.ts b/packages/cloud/src/admin/email/service.tsindex 6b268803a..ffb8d0c15 100644--- a/packages/cloud/src/admin/email/service.ts+++ b/packages/cloud/src/admin/email/service.ts@@ -17,7 +17,7 @@ const ENROLLMENT_MESSAGE_STATUS: Partial<Record<string, EnrollmentStatus>> = {export function createAdminEmailService(database: Kysely<CloudDatabase>,email?: TransactionalEmailService,- appURL = ''+ links: { appURL: string; portalURL: string } = { appURL: '', portalURL: '' }) {return {async list(limit = 100) {@@ -80,7 +80,10 @@ export function createAdminEmailService(recipientEmail: enrollment.emailNormalized,payload: {name: enrollment.name ?? 'there',- actionURL: kind === 'enrollment-approved' ? appURL : `${appURL}/auth/sign-in`+ actionURL:+ kind === 'enrollment-approved'+ ? links.appURL+ : new URL('/auth/sign-in', links.portalURL).href}},transactiondiff --git a/packages/cloud/src/admin/enrollment/email.ts b/packages/cloud/src/admin/enrollment/email.tsindex 6be9b2ffc..26ec6c2aa 100644--- a/packages/cloud/src/admin/enrollment/email.ts+++ b/packages/cloud/src/admin/enrollment/email.ts@@ -5,7 +5,10 @@ import type { Transaction } from 'kysely'import type { EnrollmentStatus } from './service'export type EnrollmentEmailOptions = {+ /** The editor, where an approved account goes next. */appURL: string+ /** The server's own pages, where people sign in and administrators review requests. */+ portalURL: stringadminRecipients: string[]email?: TransactionalEmailService}@@ -21,7 +24,7 @@ export async function enqueueEnrollmentRequested(idempotencyKey: `enrollment-requested/${input.enrollmentId}/${input.revision}`,kind: 'enrollment-requested',recipientEmail: input.email,- payload: { name: input.name, actionURL: `${options.appURL}/auth/sign-in` }+ payload: { name: input.name, actionURL: new URL('/auth/sign-in', options.portalURL).href }},transaction)@@ -35,7 +38,7 @@ export async function enqueueEnrollmentRequested(requesterEmail: input.email,requesterName: input.name,reason: input.reason,- actionURL: `${options.appURL}/admin/enrollment`+ actionURL: new URL('/admin/requests', options.portalURL).href}},transaction@@ -62,7 +65,10 @@ export async function enqueueEnrollmentReview(recipientEmail: input.recipientEmail,payload: {name: input.name,- actionURL: input.status === 'approved' ? options.appURL : `${options.appURL}/auth/sign-in`+ actionURL:+ input.status === 'approved'+ ? options.appURL+ : new URL('/auth/sign-in', options.portalURL).href}},transactiondiff --git a/packages/cloud/src/admin/enrollment/service.ts b/packages/cloud/src/admin/enrollment/service.tsindex 74f3e1a60..b3ba09de7 100644--- a/packages/cloud/src/admin/enrollment/service.ts+++ b/packages/cloud/src/admin/enrollment/service.ts@@ -72,7 +72,7 @@ export function normalizeEnrollmentEmail(value: string): string {export function createEnrollmentService(database: Kysely<CloudDatabase>,- emailOptions: EnrollmentEmailOptions = { appURL: '', adminRecipients: [] }+ emailOptions: EnrollmentEmailOptions = { appURL: '', portalURL: '', adminRecipients: [] }) {const statusForEmail = async (email: string): Promise<EnrollmentStatus | null> => {const row = await databasediff --git a/packages/cloud/src/admin/index.ts b/packages/cloud/src/admin/index.tsindex 18b4f695d..22dedf926 100644--- a/packages/cloud/src/admin/index.ts+++ b/packages/cloud/src/admin/index.ts@@ -1,5 +1,9 @@export { adminErrorStatus, AdminDomainError, type AdminErrorCode } from './errors'-export { createCloudAdminRoutes, type CloudAdminServices } from './api/routes'+export {+ createCloudAdminRoutes,+ type CloudAdminRoutes,+ type CloudAdminServices+} from './api/routes'export { createAdminAuditService, type AdminAuditService } from './audit/service'export { createAdminEmailService, type AdminEmailService } from './email/service'export { PostgresRateLimitStore } from '#cloud/server/rate-limit'diff --git a/packages/cloud/src/client/index.ts b/packages/cloud/src/client/index.tsindex c26531643..db6426f2a 100644--- a/packages/cloud/src/client/index.ts+++ b/packages/cloud/src/client/index.ts@@ -36,3 +36,10 @@ export {type CloudFetch,type DiscoverCloudOptions} from './discovery'+export {+ CloudPortalAPIError,+ createCloudPortalClient,+ type CloudPortalAPIErrorKind,+ type CloudPortalClient,+ type CloudPortalClientOptions+} from './portal/client'diff --git a/packages/cloud/src/client/portal/account.ts b/packages/cloud/src/client/portal/account.tsnew file mode 100644index 000000000..5465f3dc9--- /dev/null+++ b/packages/cloud/src/client/portal/account.ts@@ -0,0 +1,114 @@+import {+ cloudAccountMutationResponseSchema,+ cloudAccountStatusResponseSchema,+ cloudAuthenticationMethodsResponseSchema,+ cloudMFAEnableResponseSchema,+ cloudMFARecoveryCodesResponseSchema,+ cloudMFAStatusResponseSchema,+ cloudMFAVerifyResponseSchema,+ cloudPasskeysResponseSchema,+ cloudSocialLinkResponseSchema+} from '#cloud/contract'++import type { CloudCall, PortalRouteClients } from './request'++export function createAccountAPI(call: CloudCall, { account }: PortalRouteClients) {+ return {+ accountStatus(signal?: AbortSignal) {+ return call(+ (options) => account.status.$get(undefined, options),+ cloudAccountStatusResponseSchema,+ signal+ )+ },+ authenticationMethods(signal?: AbortSignal) {+ return call(+ (options) => account.authentication.$get(undefined, options),+ cloudAuthenticationMethodsResponseSchema,+ signal+ )+ },+ mfaStatus(signal?: AbortSignal) {+ return call(+ (options) => account.mfa.$get(undefined, options),+ cloudMFAStatusResponseSchema,+ signal+ )+ },+ enableTOTP(password?: string, signal?: AbortSignal) {+ return call(+ (options) => account.mfa.totp.enable.$post({ json: { password } }, options),+ cloudMFAEnableResponseSchema,+ signal+ )+ },+ verifyTOTP(code: string, signal?: AbortSignal) {+ return call(+ (options) => account.mfa.totp.verify.$post({ json: { code } }, options),+ cloudMFAVerifyResponseSchema,+ signal+ )+ },+ verifyRecoveryCode(code: string, signal?: AbortSignal) {+ return call(+ (options) => account.mfa.recovery.verify.$post({ json: { code } }, options),+ cloudMFAVerifyResponseSchema,+ signal+ )+ },+ regenerateRecoveryCodes(password?: string, signal?: AbortSignal) {+ return call(+ (options) => account.mfa.recovery.regenerate.$post({ json: { password } }, options),+ cloudMFARecoveryCodesResponseSchema,+ signal+ )+ },+ disableTOTP(password?: string, signal?: AbortSignal) {+ return call(+ (options) => account.mfa.totp.disable.$post({ json: { password } }, options),+ cloudAccountMutationResponseSchema,+ signal+ )+ },+ passkeys(signal?: AbortSignal) {+ return call(+ (options) => account.mfa.passkeys.$get(undefined, options),+ cloudPasskeysResponseSchema,+ signal+ )+ },+ deletePasskey(id: string, signal?: AbortSignal) {+ return call(+ (options) => account.mfa.passkeys.delete.$post({ json: { id } }, options),+ cloudAccountMutationResponseSchema,+ signal+ )+ },+ changePassword(currentPassword: string, newPassword: string, signal?: AbortSignal) {+ return call(+ (options) =>+ account.authentication['change-password'].$post(+ { json: { currentPassword, newPassword } },+ options+ ),+ cloudAccountMutationResponseSchema,+ signal+ )+ },+ linkSocial(provider: 'google' | 'apple', callbackURL: string, signal?: AbortSignal) {+ return call(+ (options) =>+ account.authentication['link-social'].$post({ json: { provider, callbackURL } }, options),+ cloudSocialLinkResponseSchema,+ signal+ )+ },+ unlinkAuthenticationMethod(methodId: string, signal?: AbortSignal) {+ return call(+ (options) => account.authentication.unlink.$post({ json: { methodId } }, options),+ cloudAccountMutationResponseSchema,+ signal+ )+ }+ }+}diff --git a/packages/cloud/src/client/portal/administration.ts b/packages/cloud/src/client/portal/administration.tsnew file mode 100644index 000000000..510e7d008--- /dev/null+++ b/packages/cloud/src/client/portal/administration.ts@@ -0,0 +1,102 @@+import {+ adminAuditResponseSchema,+ adminEmailResponseSchema,+ adminMutationResponseSchema,+ adminOperationsResponseSchema,+ cloudAdminSessionResponseSchema,+ cloudAdminUsersResponseSchema,+ enrollmentReviewResponseSchema,+ enrollmentsResponseSchema,+ type enrollmentStatusSchema+} from '#cloud/contract'+import type * as v from 'valibot'++import type { CloudCall, PortalRouteClients } from './request'++type EnrollmentStatus = v.InferOutput<typeof enrollmentStatusSchema>++export function createAdministrationAPI(call: CloudCall, { admin, api }: PortalRouteClients) {+ return {+ session(signal?: AbortSignal) {+ return call(+ (options) => api.session.$get(undefined, options),+ cloudAdminSessionResponseSchema,+ signal+ )+ },+ enrollments(status?: EnrollmentStatus, signal?: AbortSignal) {+ return call(+ (options) => admin.enrollments.$get({ query: { status } }, options),+ enrollmentsResponseSchema,+ signal+ )+ },+ reviewEnrollment(+ id: string,+ action: 'approve' | 'reject' | 'revoke',+ note?: string,+ signal?: AbortSignal+ ) {+ return call(+ (options) =>+ admin.enrollments[':id'][action].$post({ param: { id }, json: { note } }, options),+ enrollmentReviewResponseSchema,+ signal+ )+ },+ users(search?: string, signal?: AbortSignal) {+ return call(+ (options) => admin.users.$get({ query: { search: search || undefined } }, options),+ cloudAdminUsersResponseSchema,+ signal+ )+ },+ userAction(+ action: 'ban' | 'unban' | 'revoke-sessions',+ userId: string,+ reason?: string,+ signal?: AbortSignal+ ) {+ return call(+ (options) => admin.users[action].$post({ json: { userId, reason } }, options),+ adminMutationResponseSchema,+ signal+ )+ },+ setAdmin(userId: string, enabled: boolean, signal?: AbortSignal) {+ return call(+ (options) => admin.users['set-admin'].$post({ json: { userId, enabled } }, options),+ adminMutationResponseSchema,+ signal+ )+ },+ email(signal?: AbortSignal) {+ return call(+ (options) => admin.email.$get({ query: {} }, options),+ adminEmailResponseSchema,+ signal+ )+ },+ regenerateEmail(id: string, signal?: AbortSignal) {+ return call(+ (options) => admin.email[':id'].regenerate.$post({ param: { id } }, options),+ adminMutationResponseSchema,+ signal+ )+ },+ audit(signal?: AbortSignal) {+ return call(+ (options) => admin.audit.$get({ query: {} }, options),+ adminAuditResponseSchema,+ signal+ )+ },+ operations(signal?: AbortSignal) {+ return call(+ (options) => admin.operations.$get(undefined, options),+ adminOperationsResponseSchema,+ signal+ )+ }+ }+}diff --git a/packages/cloud/src/client/portal/client.ts b/packages/cloud/src/client/portal/client.tsnew file mode 100644index 000000000..28871d4b5--- /dev/null+++ b/packages/cloud/src/client/portal/client.ts@@ -0,0 +1,18 @@+import { createAccountAPI } from './account'+import { createAdministrationAPI } from './administration'+import { createCloudCall, createPortalRouteClients, type CloudPortalClientOptions } from './request'++export { CloudPortalAPIError, type CloudPortalAPIErrorKind } from './request'+export type { CloudPortalClientOptions } from './request'++/** The account and administration routes Cloud's own web pages use, validated against the contract. */+export function createCloudPortalClient(options: CloudPortalClientOptions = {}) {+ const call = createCloudCall(options)+ const routes = createPortalRouteClients(options)+ return {+ ...createAccountAPI(call, routes),+ ...createAdministrationAPI(call, routes)+ }+}++export type CloudPortalClient = ReturnType<typeof createCloudPortalClient>diff --git a/packages/cloud/src/client/portal/request.ts b/packages/cloud/src/client/portal/request.tsnew file mode 100644index 000000000..b6101ea52--- /dev/null+++ b/packages/cloud/src/client/portal/request.ts@@ -0,0 +1,110 @@+import type { CloudAdminRoutes } from '#cloud/admin/api/routes'+import type { CloudFetch } from '#cloud/client/discovery'+import {+ accountSecurityErrorResponseSchema,+ adminErrorResponseSchema,+ type AccountSecurityErrorCode,+ type AdminErrorCode+} from '#cloud/contract'+import type { CloudAccountRoutes } from '#cloud/server/account/routes'+import type { CloudAPI } from '#cloud/server/api'+import { hc } from 'hono/client'+import * as v from 'valibot'++export type CloudPortalAPIErrorKind =+ | 'authentication-required'+ | 'authorization-required'+ | 'cancelled'+ | 'domain'+ | 'network'+ | 'protocol'+ | 'timeout'++export class CloudPortalAPIError extends Error {+ override readonly name = 'CloudPortalAPIError'++ constructor(+ readonly kind: CloudPortalAPIErrorKind,+ readonly code?: AdminErrorCode | AccountSecurityErrorCode,+ options?: ErrorOptions+ ) {+ super(kind, options)+ }+}++export type CloudPortalClientOptions = {+ baseURL?: string+ fetch?: CloudFetch+ timeoutMs?: number+}++/** The parts of a response the portal reads; the typed Hono clients' responses have them. */+type PortalResponse = Pick<Response, 'ok' | 'status' | 'json'>++/** Sends one request with the call's `init` (its signal); the typed Hono clients fit this shape. */+export type CloudSend = (options: { init: RequestInit }) => Promise<PortalResponse>++export type CloudCall = <Output>(+ send: CloudSend,+ schema: v.GenericSchema<unknown, Output>,+ signal?: AbortSignal+) => Promise<Output>++/**+ * Sends a request and reads its answer the same way for every portal route: transport failures,+ * missing sessions and permissions, and domain errors become `CloudPortalAPIError`, and a success+ * body is checked against the contract.+ */+export function createCloudCall(options: CloudPortalClientOptions = {}): CloudCall {+ const timeoutMs = options.timeoutMs ?? 10_000+ return async (send, schema, callerSignal) => {+ const timeout = AbortSignal.timeout(timeoutMs)+ const signal = callerSignal ? AbortSignal.any([callerSignal, timeout]) : timeout+ let response: PortalResponse+ try {+ response = await send({ init: { signal } })+ } catch (cause) {+ if (callerSignal?.aborted) throw new CloudPortalAPIError('cancelled', undefined, { cause })+ if (timeout.aborted) throw new CloudPortalAPIError('timeout', undefined, { cause })+ throw new CloudPortalAPIError('network', undefined, { cause })+ }+ if (response.status === 401) throw new CloudPortalAPIError('authentication-required')+ if (response.status === 403) throw new CloudPortalAPIError('authorization-required')+ let body: unknown+ try {+ body = await response.json()+ } catch (cause) {+ throw new CloudPortalAPIError('protocol', undefined, { cause })+ }+ if (!response.ok) {+ const accountError = v.safeParse(accountSecurityErrorResponseSchema, body)+ const adminError = v.safeParse(adminErrorResponseSchema, body)+ let code: AdminErrorCode | AccountSecurityErrorCode | undefined+ if (accountError.success) code = accountError.output.error.code+ else if (adminError.success) code = adminError.output.error.code+ throw new CloudPortalAPIError('domain', code)+ }+ const parsed = v.safeParse(schema, body)+ if (!parsed.success) {+ throw new CloudPortalAPIError('protocol', undefined, { cause: parsed.issues })+ }+ return parsed.output+ }+}++/** Typed clients for the routes the portal calls, all on the server's own address. */+export function createPortalRouteClients(options: CloudPortalClientOptions = {}) {+ const origin = options.baseURL ?? globalThis.location.origin+ const clientOptions = {+ fetch: options.fetch,+ headers: { Accept: 'application/json' },+ init: { credentials: 'include' as const }+ }+ return {+ account: hc<CloudAccountRoutes>(origin, clientOptions).api.account,+ admin: hc<CloudAdminRoutes>(new URL('/api/admin', origin).href, clientOptions),+ api: hc<CloudAPI>(new URL('/api', origin).href, clientOptions)+ }+}++export type PortalRouteClients = ReturnType<typeof createPortalRouteClients>diff --git a/packages/cloud/src/contract/index.ts b/packages/cloud/src/contract/index.tsindex a70037f7c..74f22cc6c 100644--- a/packages/cloud/src/contract/index.ts+++ b/packages/cloud/src/contract/index.ts@@ -124,3 +124,4 @@ export {type WorkspaceRole,type WorkspaceSummary} from './workspaces'+export { CLOUD_PORTAL_PAGE_ROOTS, isCloudPortalPage } from './portal'diff --git a/packages/cloud/src/contract/portal.ts b/packages/cloud/src/contract/portal.tsnew file mode 100644index 000000000..3bac61e09--- /dev/null+++ b/packages/cloud/src/contract/portal.ts@@ -0,0 +1,10 @@+/**+ * The pages a Cloud server shows on its own address: sign-in, desktop sign-in approval, account+ * settings, and the administration console. Every runtime serves the portal's `cloud.html` at+ * and below these paths; everything else reaches the API.+ */+export const CLOUD_PORTAL_PAGE_ROOTS = ['/auth', '/cloud/device', '/account', '/admin'] as const++export function isCloudPortalPage(path: string): boolean {+ return CLOUD_PORTAL_PAGE_ROOTS.some((root) => path === root || path.startsWith(`${root}/`))+}diff --git a/packages/cloud/src/runtime/node/portal.ts b/packages/cloud/src/runtime/node/portal.tsnew file mode 100644index 000000000..98ecf6079--- /dev/null+++ b/packages/cloud/src/runtime/node/portal.ts@@ -0,0 +1,69 @@+import { readFile } from 'node:fs/promises'+import { resolve, sep } from 'node:path'++import { isCloudPortalPage } from '#cloud/contract'+import { getMimeType } from 'hono/utils/mime'++const PAGE_HEADERS = {+ 'Content-Type': 'text/html; charset=utf-8',+ 'Cache-Control': 'no-cache',+ // Desktop sign-in approval must never be framed by another site.+ 'Content-Security-Policy': "frame-ancestors 'none'",+ 'Referrer-Policy': 'no-referrer',+ 'X-Content-Type-Options': 'nosniff'+}++function decodedPath(request: Request): string | null {+ try {+ return decodeURIComponent(new URL(request.url).pathname)+ } catch {+ return null+ }+}++/**+ * Serves a built Cloud portal (`bun run build:cloud-portal`) from `directory`: `cloud.html` for+ * portal pages, and its hashed assets and icons for paths the API does not answer.+ */+export function createNodeCloudPortal(directory: string) {+ const root = resolve(directory)++ async function read(path: string) {+ const file = resolve(root, `.${path}`)+ if (!file.startsWith(`${root}${sep}`)) return null+ try {+ return await readFile(file)+ } catch {+ return null+ }+ }++ return {+ /** The portal page for `request`, or null when it is not one. */+ async page(request: Request): Promise<Response | null> {+ if (request.method !== 'GET' && request.method !== 'HEAD') return null+ if (!isCloudPortalPage(new URL(request.url).pathname)) return null+ const page = await read('/cloud.html')+ return page ? new Response(page, { headers: PAGE_HEADERS }) : null+ },++ /** A portal file for `request`, or null when there is none. */+ async file(request: Request): Promise<Response | null> {+ if (request.method !== 'GET' && request.method !== 'HEAD') return null+ const path = decodedPath(request)+ if (!path || path === '/cloud.html') return null+ const type = getMimeType(path)+ const body = type ? await read(path) : null+ if (!type || !body) return null+ return new Response(body, {+ headers: {+ 'Content-Type': type,+ 'Cache-Control': path.startsWith('/assets/')+ ? 'public, max-age=31536000, immutable'+ : 'public, max-age=3600',+ 'X-Content-Type-Options': 'nosniff'+ }+ })+ }+ }+}diff --git a/packages/cloud/src/runtime/node/server.ts b/packages/cloud/src/runtime/node/server.tsindex af55a0511..8e5212635 100644--- a/packages/cloud/src/runtime/node/server.ts+++ b/packages/cloud/src/runtime/node/server.ts@@ -23,6 +23,7 @@ import { getRequestListener } from '@hono/node-server'import { createMigratedNodeCloudDatabase } from './bootstrap'import { createNodeTransactionalEmailRuntime } from './email/runtime'+import { createNodeCloudPortal } from './portal'import { attachCollaborationRelay, defaultRelayURL } from './relay'export type NodeCloudServerOptions = {@@ -103,10 +104,16 @@ export async function startNodeCloudServer(options: NodeCloudServerOptions = {})onError: (error) => console.error('[Cloud] Email worker failed:', error)}): undefined+ const portalDirectory = environment.OPENPENCIL_CLOUD_PORTAL_DIR+ const portal = portalDirectory ? createNodeCloudPortal(portalDirectory) : undefinedconst server = await listen(async (request) => {const path = new URL(request.url).pathname- return withIndexingPolicy(await app.fetch(request), path, config.indexingPolicy)+ const page = await portal?.page(request)+ if (page) return withIndexingPolicy(page, path, config.indexingPolicy)+ const response = await app.fetch(request)+ const file = response.status === 404 ? await portal?.file(request) : null+ return withIndexingPolicy(file ?? response, path, config.indexingPolicy)},options.port ?? Number(environment.PORT ?? 8787),environment.HOST ?? '0.0.0.0'diff --git a/packages/cloud/src/server/account/routes.ts b/packages/cloud/src/server/account/routes.tsindex 92fb2c310..d730d96b0 100644--- a/packages/cloud/src/server/account/routes.ts+++ b/packages/cloud/src/server/account/routes.ts@@ -196,3 +196,6 @@ export function createAccountRoutes(services: AccountRouteDependencies) {return result instanceof Response ? result : context.json(result)})}++/** The account routes' types, for the portal's typed client. */+export type CloudAccountRoutes = ReturnType<typeof createAccountRoutes>diff --git a/packages/cloud/src/server/app.ts b/packages/cloud/src/server/app.tsindex 6090c3478..a46e7dda7 100644--- a/packages/cloud/src/server/app.ts+++ b/packages/cloud/src/server/app.ts@@ -161,16 +161,16 @@ export function createCloudApp(services: CloudServices) {services.enrollment ??createEnrollmentService(services.database, {appURL: services.config.appURL ?? services.config.publicURL,+ portalURL: services.config.publicURL,adminRecipients: services.config.enrollmentAdminNotificationEmails,email: services.transactionalEmail})const admin = createCloudAdminRoutes({- email: createAdminEmailService(- services.database,- services.transactionalEmail,- services.config.appURL ?? services.config.publicURL- ),+ email: createAdminEmailService(services.database, services.transactionalEmail, {+ appURL: services.config.appURL ?? services.config.publicURL,+ portalURL: services.config.publicURL+ }),enrollment,users: createAdminUserService(services.database, services.auth, {requireMFA: services.config.deploymentAdminMFARequireddiff --git a/packages/cloud/src/server/auth/factory.ts b/packages/cloud/src/server/auth/factory.tsindex be8689bc2..a4e72a408 100644--- a/packages/cloud/src/server/auth/factory.ts+++ b/packages/cloud/src/server/auth/factory.ts@@ -392,14 +392,18 @@ export function createBetterAuthAdapter(await auth.api.unlinkAccount({ headers, body: { accountId: methodId } })},async listUsers(headers, query) {+ // Paging by offset needs a stable order, or people skip or repeat between pages.+ const page = {+ limit: query?.limit,+ offset: query?.offset,+ // Better Auth sorts by one field, so accounts created in the same millisecond, such as a+ // bulk import, can trade places between pages; ordinary sign-ups never collide.+ sortBy: 'createdAt',+ sortDirection: 'asc' as const+ }const listQuery = query?.searchValue- ? {- searchValue: query.searchValue,- searchField: 'email' as const,- limit: query.limit,- offset: query.offset- }- : { limit: query?.limit, offset: query?.offset }+ ? { ...page, searchValue: query.searchValue, searchField: 'email' as const }+ : pageconst response = await auth.api.listUsers({ headers, query: listQuery })return { users: response.users, total: response.total }},diff --git a/packages/cloud/src/server/auth/runtime.ts b/packages/cloud/src/server/auth/runtime.tsindex 4d7d03f9e..a4c608dcd 100644--- a/packages/cloud/src/server/auth/runtime.ts+++ b/packages/cloud/src/server/auth/runtime.ts@@ -15,6 +15,7 @@ export function createCloudAuthenticationRuntime() {const enrollment = createEnrollmentService(database, {appURL: config.appURL ?? config.publicURL,+ portalURL: config.publicURL,adminRecipients: config.enrollmentAdminNotificationEmails,})diff --git a/packages/cloud/src/server/validation.ts b/packages/cloud/src/server/validation.tsindex 8486508d1..3ea319817 100644--- a/packages/cloud/src/server/validation.ts+++ b/packages/cloud/src/server/validation.ts@@ -2,15 +2,23 @@ import type { Context } from 'hono'import { validator } from 'hono/validator'import { ValiError } from 'valibot'-export function validatedJSON<T>(parse: (input: unknown) => T) {- return validator('json', (value, context: Context) => {- try {- return parse(value)- } catch (error) {- if (error instanceof ValiError) {- return context.json({ error: { code: 'invalid_request' as const } }, 400)- }- throw error+/** A request part that fails its schema is a 400, never a server error. */+function parseOrReject<T>(parse: (input: unknown) => T, value: unknown, context: Context) {+ try {+ return parse(value)+ } catch (error) {+ if (error instanceof ValiError) {+ return context.json({ error: { code: 'invalid_request' as const } }, 400)}- })+ throw error+ }+}++export function validatedJSON<T>(parse: (input: unknown) => T) {+ return validator('json', (value, context: Context) => parseOrReject(parse, value, context))+}++/** Query string counterpart of `validatedJSON`. */+export function validatedQuery<T>(parse: (input: unknown) => T) {+ return validator('query', (value, context: Context) => parseOrReject(parse, value, context))}diff --git a/packages/cloud/tests/client/portal/client.test.ts b/packages/cloud/tests/client/portal/client.test.tsnew file mode 100644index 000000000..d0f7f0c29--- /dev/null+++ b/packages/cloud/tests/client/portal/client.test.ts@@ -0,0 +1,148 @@+import { describe, expect, test } from 'bun:test'++import { createCloudPortalClient } from '#cloud/client'++describe('Cloud portal client', () => {+ test('validates successful response bodies', async () => {+ const client = createCloudPortalClient({+ baseURL: 'https://cloud.example.com',+ fetch: async () =>+ Response.json({+ user: {+ userId: 'user-id',+ email: '[email protected]',+ name: 'Person',+ deploymentRole: 'user'+ },+ state: 'pending'+ })+ })+ await expect(client.accountStatus()).resolves.toEqual({+ user: {+ userId: 'user-id',+ email: '[email protected]',+ name: 'Person',+ deploymentRole: 'user'+ },+ state: 'pending'+ })+ })++ test('rejects malformed success bodies as protocol errors', async () => {+ const client = createCloudPortalClient({+ baseURL: 'https://cloud.example.com',+ fetch: async () => Response.json({ state: 'unknown' })+ })+ await expect(client.accountStatus()).rejects.toMatchObject({ kind: 'protocol' })+ })++ test('preserves stable domain and authorization errors', async () => {+ const forbidden = createCloudPortalClient({+ baseURL: 'https://cloud.example.com',+ fetch: async () => Response.json({}, { status: 403 })+ })+ await expect(forbidden.session()).rejects.toEqual(+ expect.objectContaining({ kind: 'authorization-required' })+ )+ const domain = createCloudPortalClient({+ baseURL: 'https://cloud.example.com',+ fetch: async () => Response.json({ error: { code: 'last_admin_required' } }, { status: 400 })+ })+ await expect(domain.setAdmin('user', false)).rejects.toMatchObject({+ kind: 'domain',+ code: 'last_admin_required'+ })+ const account = createCloudPortalClient({+ baseURL: 'https://cloud.example.com',+ fetch: async () =>+ Response.json({ error: { code: 'last_authentication_method' } }, { status: 400 })+ })+ await expect(account.unlinkAuthenticationMethod('method')).rejects.toMatchObject({+ kind: 'domain',+ code: 'last_authentication_method'+ })+ })++ test('sends typed requests to the server routes', async () => {+ const requests: Array<{+ url: string+ method: string+ body: string | null+ credentials?: string+ }> = []+ const client = createCloudPortalClient({+ baseURL: 'https://cloud.example.com',+ async fetch(input, init) {+ requests.push({+ url: String(input),+ method: init?.method ?? 'GET',+ body: typeof init?.body === 'string' ? init.body : null,+ credentials: init?.credentials+ })+ return Response.json({ ok: true })+ }+ })+ await client.setAdmin('user-id', true)+ await client.userAction('revoke-sessions', 'user-id')+ expect(requests).toEqual([+ {+ url: 'https://cloud.example.com/api/admin/users/set-admin',+ method: 'POST',+ body: JSON.stringify({ userId: 'user-id', enabled: true }),+ credentials: 'include'+ },+ {+ url: 'https://cloud.example.com/api/admin/users/revoke-sessions',+ method: 'POST',+ body: JSON.stringify({ userId: 'user-id' }),+ credentials: 'include'+ }+ ])+ requests.length = 0+ await client.enrollments('pending').catch(() => undefined)+ await client.users('ada').catch(() => undefined)+ await client.accountStatus().catch(() => undefined)+ expect(requests.map((request) => request.url)).toEqual([+ 'https://cloud.example.com/api/admin/enrollments?status=pending',+ 'https://cloud.example.com/api/admin/users?search=ada',+ 'https://cloud.example.com/api/account/status'+ ])+ })++ test('reports transport failures by kind', async () => {+ const offline = createCloudPortalClient({+ baseURL: 'https://cloud.example.com',+ fetch: async () => {+ throw new TypeError('Failed to fetch')+ }+ })+ await expect(offline.operations()).rejects.toMatchObject({ kind: 'network' })++ const controller = new AbortController()+ controller.abort()+ const waiting = createCloudPortalClient({+ baseURL: 'https://cloud.example.com',+ fetch: (_input, init) =>+ new Promise((_resolve, reject) => {+ init?.signal?.addEventListener('abort', () => reject(init.signal?.reason), { once: true })+ if (init?.signal?.aborted) reject(init.signal.reason)+ }),+ timeoutMs: 10+ })+ await expect(waiting.operations(controller.signal)).rejects.toMatchObject({ kind: 'cancelled' })+ await expect(waiting.operations()).rejects.toMatchObject({ kind: 'timeout' })++ const html = createCloudPortalClient({+ baseURL: 'https://cloud.example.com',+ fetch: async () => new Response('<html>Bad gateway</html>', { status: 502 })+ })+ await expect(html.operations()).rejects.toMatchObject({ kind: 'protocol' })+ const signedOut = createCloudPortalClient({+ baseURL: 'https://cloud.example.com',+ fetch: async () => Response.json({}, { status: 401 })+ })+ await expect(signedOut.accountStatus()).rejects.toMatchObject({+ kind: 'authentication-required'+ })+ })+})diff --git a/packages/cloud/tests/contract/portal.test.ts b/packages/cloud/tests/contract/portal.test.tsnew file mode 100644index 000000000..27f5ecee0--- /dev/null+++ b/packages/cloud/tests/contract/portal.test.ts@@ -0,0 +1,28 @@+import { describe, expect, test } from 'bun:test'++import { isCloudPortalPage } from '#cloud/contract'++describe('Cloud portal pages', () => {+ test('cover sign-in, desktop approval, account, and console paths', () => {+ for (const path of [+ '/auth/sign-in',+ '/cloud/device',+ '/account',+ '/account/pending',+ '/admin',+ '/admin/people'+ ])+ expect(isCloudPortalPage(path)).toBe(true)+ })++ test('leave the API, discovery, and look-alike paths to the server', () => {+ for (const path of [+ '/api/auth/sign-in/email',+ '/.well-known/openpencil-cloud',+ '/accounts',+ '/administrator',+ '/cloud/devices'+ ])+ expect(isCloudPortalPage(path)).toBe(false)+ })+})diff --git a/packages/cloud/tests/integration/admin/email/service.test.ts b/packages/cloud/tests/integration/admin/email/service.test.tsindex fd6481e03..48f49d9c6 100644--- a/packages/cloud/tests/integration/admin/email/service.test.ts+++ b/packages/cloud/tests/integration/admin/email/service.test.ts@@ -7,6 +7,8 @@ import {AdminDomainError} from '#cloud/server'+const CLOUD_LINKS = { appURL: 'https://cloud.example.com', portalURL: 'https://cloud.example.com' }+describe('admin email regeneration', () => {test('regenerates an enrollment message from authoritative enrollment state', async () => {const runtime = await createCloudTestDatabase()@@ -40,11 +42,10 @@ describe('admin email regeneration', () => {.set({ status: 'failed', payloadEncrypted: null }).where('id', '=', original).execute()- await createAdminEmailService(- runtime.database,- email,- 'https://cloud.example.com'- ).regenerate('admin', original)+ await createAdminEmailService(runtime.database, email, CLOUD_LINKS).regenerate(+ 'admin',+ original+ )const rows = await runtime.database.selectFrom('transactionalEmail').select(['id', 'kind', 'status'])@@ -82,10 +83,7 @@ describe('admin email regeneration', () => {}})await expect(- createAdminEmailService(runtime.database, email, 'https://cloud.example.com').regenerate(- 'admin',- id- )+ createAdminEmailService(runtime.database, email, CLOUD_LINKS).regenerate('admin', id)).rejects.toBeInstanceOf(AdminDomainError)} finally {await runtime.close()@@ -120,10 +118,7 @@ describe('admin email regeneration', () => {payload: { name: 'Revoked', actionURL: 'https://cloud.example.com' }})await expect(- createAdminEmailService(runtime.database, email, 'https://cloud.example.com').regenerate(- 'admin',- approval- )+ createAdminEmailService(runtime.database, email, CLOUD_LINKS).regenerate('admin', approval)).rejects.toBeInstanceOf(AdminDomainError)const queued = await runtime.database.selectFrom('transactionalEmail')diff --git a/packages/cloud/tests/integration/admin/enrollment/service.test.ts b/packages/cloud/tests/integration/admin/enrollment/service.test.tsindex 1740abe8d..350505eb8 100644--- a/packages/cloud/tests/integration/admin/enrollment/service.test.ts+++ b/packages/cloud/tests/integration/admin/enrollment/service.test.ts@@ -63,6 +63,7 @@ describe('Cloud enrollment integration', () => {})const enrollment = createEnrollmentService(runtime.database, {appURL: 'https://cloud.example.com',+ portalURL: 'https://cloud.example.com',adminRecipients: ['[email protected]'],})diff --git a/packages/cloud/tests/integration/server/auth/email-password.test.ts b/packages/cloud/tests/integration/server/auth/email-password.test.tsindex ad06df03c..0308e9198 100644--- a/packages/cloud/tests/integration/server/auth/email-password.test.ts+++ b/packages/cloud/tests/integration/server/auth/email-password.test.ts@@ -39,6 +39,7 @@ async function runtime(authenticationEmail?: AuthenticationEmailService) {})const enrollment = createEnrollmentService(databaseRuntime.database, {appURL: config.publicURL,+ portalURL: config.publicURL,adminRecipients: [],})diff --git a/packages/cloud/tests/integration/server/auth/user-listing.test.ts b/packages/cloud/tests/integration/server/auth/user-listing.test.tsnew file mode 100644index 000000000..aa9c2e905--- /dev/null+++ b/packages/cloud/tests/integration/server/auth/user-listing.test.ts@@ -0,0 +1,62 @@+import { describe, expect, test } from 'bun:test'++import {+ accountAuthenticationRequest,+ createAccountAuthenticationFixture,+ createVerifiedCredentialAccount+} from '#cloud-tests/helpers/account-authentication'+import { responseJSON } from '#cloud-tests/helpers/response'+import * as v from 'valibot'++const PASSWORD = 'a sufficiently long password'+const usersSchema = v.object({ users: v.array(v.object({ email: v.string() })), total: v.number() })++describe('deployment user listing', () => {+ test('pages through people in the order their accounts were created', async () => {+ const fixture = await createAccountAuthenticationFixture()+ try {+ let cookie = ''+ for (const [index, email] of emails.entries()) {+ const account = await createVerifiedCredentialAccount(fixture, {+ email,+ name: email,+ password: PASSWORD,+ approved: true+ })+ await fixture.database+ .updateTable('user')+ .set({+ createdAt: new Date(Date.UTC(2026, 0, index + 1)),+ role: index === 0 ? 'admin' : 'user'+ })+ .where('id', '=', account.userId)+ .execute()+ if (index === 0) cookie = account.sessionCookie+ }+ // Rewriting the oldest row moves it in storage; the listing must not follow storage order.+ await fixture.database+ .updateTable('user')+ .set({ name: 'First, renamed' })+ .where('email', '=', '[email protected]')+ .execute()+ const page = async (offset: number) =>+ (+ await responseJSON(+ await fixture.app.fetch(+ accountAuthenticationRequest(+ `/api/admin/users?limit=2&offset=${offset}`,+ undefined,+ cookie+ )+ ),+ usersSchema+ )+ ).users.map((user) => user.email)++ expect([...(await page(0)), ...(await page(2))]).toEqual(emails)+ } finally {+ await fixture.close()+ }+ })+})diff --git a/packages/cloud/tests/runtime/node/enrollment-email.test.ts b/packages/cloud/tests/runtime/node/enrollment-email.test.tsindex f277365e0..badbd2940 100644--- a/packages/cloud/tests/runtime/node/enrollment-email.test.ts+++ b/packages/cloud/tests/runtime/node/enrollment-email.test.ts@@ -29,11 +29,11 @@ describe('enrollment email rendering', () => {requesterEmail: '[email protected]',requesterName: 'Person',reason: 'Design',- actionURL: 'https://cloud.example.com/admin/enrollment'+ actionURL: 'https://cloud.example.com/admin/requests'}})expect(rendered.html).toContain('[email protected]')- expect(rendered.html).toContain('/admin/enrollment')+ expect(rendered.html).toContain('/admin/requests')expect(rendered.html).not.toContain('token=')})})diff --git a/packages/cloud/tests/runtime/node/portal.test.ts b/packages/cloud/tests/runtime/node/portal.test.tsnew file mode 100644index 000000000..2b20f1dd2--- /dev/null+++ b/packages/cloud/tests/runtime/node/portal.test.ts@@ -0,0 +1,59 @@+import { afterAll, beforeAll, describe, expect, test } from 'bun:test'+import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises'+import { tmpdir } from 'node:os'+import { join } from 'node:path'++import { createNodeCloudPortal } from '#cloud/runtime/node/portal'++let directory = ''++beforeAll(async () => {+ directory = await mkdtemp(join(tmpdir(), 'openpencil-portal-'))+ await mkdir(join(directory, 'assets'))+ await writeFile(join(directory, 'cloud.html'), '<!doctype html><title>Portal</title>')+ await writeFile(join(directory, 'assets', 'cloud-abc.js'), 'export {}')+ await writeFile(join(directory, 'favicon.svg'), '<svg/>')+ await writeFile(join(tmpdir(), 'openpencil-portal-outside.txt'), 'secret')+})++afterAll(async () => {+ await rm(directory, { recursive: true, force: true })+ await rm(join(tmpdir(), 'openpencil-portal-outside.txt'), { force: true })+})++const request = (path: string, method = 'GET') =>+ new Request(`https://cloud.example${path}`, { method })++describe('Node Cloud portal', () => {+ test('serves the page for portal paths, never framed and never cached', async () => {+ const page = await createNodeCloudPortal(directory).page(+ request('/cloud/device?user_code=ABCD')+ )+ expect(await page?.text()).toContain('Portal')+ expect(page?.headers.get('Content-Security-Policy')).toBe("frame-ancestors 'none'")+ expect(page?.headers.get('Cache-Control')).toBe('no-cache')+ })++ test('leaves other paths and methods to the API', async () => {+ const portal = createNodeCloudPortal(directory)+ expect(await portal.page(request('/api/session'))).toBeNull()+ expect(await portal.page(request('/account', 'POST'))).toBeNull()+ })++ test('serves hashed assets as immutable and icons briefly cached', async () => {+ const portal = createNodeCloudPortal(directory)+ const asset = await portal.file(request('/assets/cloud-abc.js'))+ expect(asset?.headers.get('Content-Type')).toContain('javascript')+ expect(asset?.headers.get('Cache-Control')).toContain('immutable')+ const icon = await portal.file(request('/favicon.svg'))+ expect(icon?.headers.get('Content-Type')).toContain('image/svg+xml')+ expect(icon?.headers.get('Cache-Control')).not.toContain('immutable')+ })++ test('never reads outside its directory or answers missing files', async () => {+ const portal = createNodeCloudPortal(directory)+ expect(await portal.file(request('/..%2Fopenpencil-portal-outside.txt'))).toBeNull()+ expect(await portal.file(request('/assets/missing.js'))).toBeNull()+ expect(await portal.file(request('/cloud.html'))).toBeNull()+ })+})diff --git a/packages/docs/development/cloud.md b/packages/docs/development/cloud.mdindex d217b6b75..9a63d43d5 100644--- a/packages/docs/development/cloud.md+++ b/packages/docs/development/cloud.md@@ -108,6 +108,22 @@ pending request that a deployment administrator approves or rejects; approval caDeployment administrators are separate from workspace administrators, and startup never grantseither role: the first operator is approved and promoted through the `admin` command.+## Portal++The server shows its own pages on its public address: sign-in and sign-up, email verification,+password reset, two-step sign-in, desktop sign-in approval, account security, and the+administration console. They are a separate Vite entry, `cloud.html`, in the app project, so they+reuse the editor's components and theme without loading the editor; `bun run build:cloud-portal`+writes them to `dist-cloud-portal/`. The editor, on the web and on the desktop, never embeds these+pages; it opens them in a browser and gets the person back through `/auth/return` or the device+code.++`CLOUD_PORTAL_PAGE_ROOTS` in the contract lists the page paths, and every runtime serves+`cloud.html` at and below them with `frame-ancestors 'none'`, so the approval page cannot be+framed. The Node runtime serves the build named by `OPENPENCIL_CLOUD_PORTAL_DIR`, answering portal+pages before the API and portal assets only where the API returns 404. `bun run cloud:dev` keeps a+watched portal build next to the server.+## ConfigurationOperators author one schema-versioned TOML file. It owns URLs, trusted origins and proxies,diff --git a/packages/vue/src/i18n/index.ts b/packages/vue/src/i18n/index.tsindex b3e603820..bdfcf9af2 100644--- a/packages/vue/src/i18n/index.ts+++ b/packages/vue/src/i18n/index.ts@@ -26,6 +26,7 @@ export {useStorageMessages,useToolMessages,useUpdateMessages,+ useCloudPortalMessages,useVariableMessages,useVariableTypeMessages} from '#vue/i18n/useI18n'diff --git a/packages/vue/src/i18n/locales/de/cloud-portal.json b/packages/vue/src/i18n/locales/de/cloud-portal.jsonnew file mode 100644index 000000000..171f5966b--- /dev/null+++ b/packages/vue/src/i18n/locales/de/cloud-portal.json@@ -0,0 +1,239 @@+{+ "productName": "OpenPencil Cloud",+ "loading": "Wird geladen…",+ "unavailableTitle": "Dieser Server antwortet nicht",+ "unavailableDescription": "Prüfe die Adresse oder versuche es gleich noch einmal.",+ "tryAgain": "Erneut versuchen",+ "signInTitle": "Bei OpenPencil Cloud anmelden",+ "signUpTitle": "Konto erstellen",+ "signInWelcome": "Willkommen zurück.",+ "signUpDescription": "Erstelle ein Konto auf diesem Server.",+ "returnsTo": "Danach geht es zurück zu {destination}.",+ "returnsToDesktop": "der OpenPencil-App",+ "returnsToEditor": "dem Editor",+ "continueWithGoogle": "Weiter mit Google",+ "continueWithApple": "Weiter mit Apple",+ "or": "oder",+ "name": "Name",+ "email": "E-Mail",+ "emailPlaceholder": "[email protected]",+ "password": "Passwort",+ "passwordHint": "Mindestens {count} Zeichen.",+ "forgotPassword": "Passwort vergessen?",+ "signIn": "Anmelden",+ "createAccount": "Konto erstellen",+ "haveAccount": "Du hast schon ein Konto?",+ "newHere": "Neu hier?",+ "createAnAccount": "Konto erstellen",+ "approvalTitle": "Neue Konten werden von einem Administrator geprüft",+ "approvalDescription": "Du kannst dich anmelden, sobald deine Anfrage genehmigt ist. Wir benachrichtigen dich per E-Mail.",+ "signInFailed": "Anmeldung fehlgeschlagen",+ "noSignInMethods": "Dieser Server bietet noch keine Anmeldemöglichkeit. Wende dich an den Administrator.",+ "failureInvalidCredentials": "E-Mail oder Passwort ist falsch.",+ "failureEmailNotVerified": "Bestätige zuerst deine E-Mail-Adresse. Wir können den Link erneut senden.",+ "failurePasswordTooShort": "Das Passwort ist zu kurz.",+ "failurePasswordTooLong": "Das Passwort ist zu lang.",+ "failureInvalidLink": "Dieser Link ist abgelaufen oder wurde bereits verwendet. Fordere einen neuen an.",+ "failureInvalidCode": "Der Code hat nicht funktioniert. Prüfe ihn und versuche es erneut.",+ "failurePasskeyCancelled": "Die Einrichtung des Passkeys wurde abgebrochen.",+ "failurePasskeyExists": "Dieses Gerät hat bereits einen Passkey für dein Konto.",+ "failurePasskeyUnavailable": "Dieser Browser konnte für diese Adresse keinen Passkey erstellen. Versuche einen anderen Browser oder nutze eine Authenticator-App.",+ "failureRateLimited": "Zu viele Versuche. Warte eine Minute und versuche es erneut.",+ "failureUnavailable": "Auf dem Server ist ein Fehler aufgetreten. Versuche es gleich noch einmal.",+ "failureCancelled": "Die Anmeldung wurde abgebrochen.",+ "failureEnrollmentClosed": "Dieser Server nimmt keine neuen Konten an.",+ "checkEmailTitle": "Prüfe deine E-Mails",+ "checkEmailDescription": "Wir haben einen Link an {email} gesendet. Öffne ihn auf diesem Gerät, um die Kontoerstellung abzuschließen.",+ "sendAgain": "Erneut senden",+ "sent": "Gesendet",+ "useAnotherEmail": "Andere E-Mail-Adresse verwenden",+ "pendingTitle": "Deine Anfrage liegt bei einem Administrator",+ "pendingDescription": "Wir schreiben an {email}, sobald du dich anmelden kannst. Bis dahin musst du nichts tun.",+ "closedTitle": "Du kannst diesen Server nicht nutzen",+ "closedDescription": "Ein Administrator hat deinen Zugang abgelehnt oder entzogen. Frag nach, wenn du das für einen Fehler hältst.",+ "signOut": "Abmelden",+ "twoStepTitle": "Bestätige, dass du es bist",+ "twoStepAuthenticator": "Gib den 6-stelligen Code aus deiner Authenticator-App ein.",+ "twoStepRecovery": "Gib einen deiner gespeicherten Wiederherstellungscodes ein. Jeder funktioniert nur einmal.",+ "authenticationCode": "Authentifizierungscode",+ "recoveryCode": "Wiederherstellungscode",+ "continue": "Weiter",+ "useRecoveryCode": "Wiederherstellungscode verwenden",+ "useAuthenticator": "Authenticator-App verwenden",+ "usePasskey": "Passkey verwenden",+ "resetTitle": "Passwort zurücksetzen",+ "resetDescription": "Wir senden dir einen Link, mit dem du ein neues festlegen kannst.",+ "chooseTitle": "Neues Passwort festlegen",+ "chooseDescription": "Beim Speichern wirst du überall sonst abgemeldet.",+ "newPassword": "Neues Passwort",+ "sendLink": "Link senden",+ "savePassword": "Passwort speichern",+ "backToSignIn": "Zurück zur Anmeldung",+ "resetSentTitle": "Prüfe deine E-Mails",+ "resetSentDescription": "Falls {email} hier ein Konto hat, ist ein Link zum Zurücksetzen unterwegs.",+ "deviceTitle": "Bei der OpenPencil-App anmelden?",+ "deviceDescription": "Die OpenPencil-App möchte dein Konto {email} verwenden.",+ "deviceCheckCode": "Prüfe, ob die App diesen Code anzeigt",+ "deviceWarningTitle": "Genehmige nur Anmeldungen, die du selbst gestartet hast",+ "deviceWarningDescription": "Wenn du dich gerade nicht auf einem Computer bei OpenPencil angemeldet hast, lehne diese Anfrage ab.",+ "approve": "Genehmigen",+ "deny": "Ablehnen",+ "deviceApprovedTitle": "Du bist angemeldet",+ "deviceApprovedDescription": "Kehre zur OpenPencil-App zurück; sie hat die Anmeldung bereits übernommen. Du kannst diesen Tab schließen.",+ "deviceDeniedTitle": "Anmeldung abgelehnt",+ "deviceDeniedDescription": "Die App wurde nicht angemeldet. Wenn du das nicht gestartet hast, kennt womöglich jemand dein Passwort; ändere es in deinen Kontoeinstellungen.",+ "deviceExpiredTitle": "Dieser Code ist abgelaufen",+ "deviceExpiredDescription": "Starte die Anmeldung in der OpenPencil-App erneut, um einen neuen Code zu erhalten.",+ "accountSettings": "Kontoeinstellungen",+ "sectionAccount": "Dein Konto",+ "sectionServer": "Server",+ "security": "Anmeldung und Sicherheit",+ "securityDescription": "Wie du dich bei {host} anmeldest.",+ "overview": "Übersicht",+ "accessRequests": "Zugangsanfragen",+ "accessRequestsDescription": "Personen, die beitreten möchten. Nach der Genehmigung können sie sich anmelden; in jedem Fall erhalten sie eine E-Mail.",+ "people": "Personen",+ "peopleDescription": {+ "one": "{count} Konto auf diesem Server.",+ "many": "{count} Konten auf diesem Server."+ },+ "emailDelivery": "E-Mail-Versand",+ "emailDeliveryDescription": "Einladungen, Anmeldelinks und Zugangsentscheidungen, die der Server versendet.",+ "activity": "Aktivität",+ "activityDescription": "Was Administratoren auf diesem Server getan haben.",+ "waysToSignIn": "Anmeldemethoden",+ "waysToSignInDescription": "Behalte mindestens eine, damit du jederzeit wieder hineinkommst.",+ "providerGoogle": "Google",+ "providerApple": "Apple",+ "linkedOn": "Verknüpft am {date}",+ "notLinked": "Nicht verknüpft",+ "link": "Verknüpfen",+ "unlink": "Trennen",+ "passwordSet": "Mit E-Mail-Adresse und Passwort anmelden",+ "passwordNotSet": "Füge ein Passwort hinzu, um dich auch mit deiner E-Mail-Adresse anzumelden",+ "change": "Ändern",+ "setPassword": "Passwort festlegen",+ "twoStepSection": "Zweistufige Anmeldung",+ "twoStepSectionDescription": "Nach dem Passwort oder verknüpften Konto einen zweiten Nachweis verlangen.",+ "authenticatorApp": "Authenticator-App",+ "authenticatorOn": "Aktiv",+ "authenticatorOff": "Codes aus einer App wie 1Password oder Google Authenticator",+ "newRecoveryCodes": "Neue Wiederherstellungscodes",+ "turnOff": "Deaktivieren",+ "setUp": "Einrichten",+ "passkeys": "Passkeys",+ "passkeysDescription": "Melde dich mit der Bildschirmsperre deines Geräts statt mit einem Code an.",+ "addPasskey": "Passkey hinzufügen",+ "passkeyAdded": "Hinzugefügt am {date}",+ "unnamedPasskey": "Passkey",+ "remove": "Entfernen",+ "noPasskeys": "Noch keine Passkeys.",+ "adminTwoStepTitle": "Zweiten Anmeldeschritt aktivieren",+ "adminTwoStepDescription": "Auf diesem Server müssen Administratoren eine Authenticator-App oder einen Passkey verwenden, bevor sie die Konsole öffnen.",+ "authenticatorSetupTitle": "Authenticator-App einrichten",+ "authenticatorSetupScan": "Scanne dies mit deiner Authenticator-App und gib dann den angezeigten Code ein.",+ "authenticatorSetupKey": "Scannen nicht möglich? Gib diesen Schlüssel ein",+ "recoveryCodesTitle": "Wiederherstellungscodes speichern",+ "recoveryCodesDescription": "Mit jedem Code kannst du dich einmal anmelden, falls du deinen Authenticator verlierst. Bewahre sie sicher auf; sie werden nicht noch einmal angezeigt.",+ "copyCodes": "Codes kopieren",+ "copyKey": "Schlüssel kopieren",+ "copied": "Kopiert",+ "done": "Fertig",+ "cancel": "Abbrechen",+ "currentPassword": "Aktuelles Passwort",+ "changePasswordTitle": "Passwort ändern",+ "confirmPasswordTitle": "Mit deinem Passwort bestätigen",+ "filterWaiting": "Wartend",+ "filterApproved": "Genehmigt",+ "filterDeclined": "Abgelehnt",+ "filterRemoved": "Entfernt",+ "statusWaiting": "Wartend",+ "statusApproved": "Genehmigt",+ "statusDeclined": "Abgelehnt",+ "statusRemoved": "Zugang entzogen",+ "asked": "Angefragt am {date}",+ "reviewedBy": "{decision} von {name}",+ "decline": "Ablehnen",+ "removeAccess": "Zugang entziehen",+ "noOneWaiting": "Niemand wartet",+ "nothingHere": "Noch nichts vorhanden",+ "requestsEmptyDescription": "Neue Anfragen erscheinen hier, und Administratoren erhalten für jede eine E-Mail.",+ "searchPeople": "Personen suchen…",+ "you": "(du)",+ "administrator": "Administrator",+ "suspended": "Gesperrt",+ "joined": "Beigetreten am {date}",+ "actionsFor": "Aktionen für {name}",+ "makeAdministrator": "Zum Administrator machen",+ "removeAdministrator": "Administratorrechte entziehen",+ "signOutEverywhere": "Überall abmelden",+ "suspendAccount": "Konto sperren",+ "restoreAccount": "Konto entsperren",+ "emailTo": "An {recipient}",+ "attempts": {+ "one": "{count} Versuch",+ "many": "{count} Versuche"+ },+ "emailSent": "Gesendet",+ "emailWaiting": "Wartend",+ "emailFailed": "Fehlgeschlagen",+ "retry": "Erneut versuchen",+ "needsAttention": "Erfordert Aufmerksamkeit",+ "waitingRequests": {+ "one": "{count} Person wartet auf eine Entscheidung",+ "many": "{count} Personen warten auf eine Entscheidung"+ },+ "noOneIsWaiting": "Niemand wartet",+ "emailStatus": "Fehlgeschlagen: {failed} · Wartend: {waiting}",+ "emailWaitingOnly": {+ "one": "{count} E-Mail wartet auf den Versand",+ "many": "{count} E-Mails warten auf den Versand"+ },+ "emailAllSent": "Alles wurde gesendet",+ "review": "Prüfen",+ "open": "Öffnen",+ "serverSection": "Server",+ "serverSectionDescription": "Festgelegt in der Konfigurationsdatei des Servers.",+ "deployment": "Bereitstellung",+ "deploymentOfficial": "OpenPencil Cloud",+ "deploymentSelfHosted": "Selbst gehostet",+ "newAccounts": "Neue Konten",+ "enrollmentOpen": "Jeder kann beitreten",+ "enrollmentApproval": "Prüfung durch einen Administrator",+ "enrollmentClosed": "Geschlossen",+ "emailTransportNone": "Aus",+ "emailTransportSMTP": "SMTP",+ "emailTransportCloudflare": "Cloudflare Email",+ "someoneElse": "Jemand",+ "emailSuppressed": "Nicht gesendet",+ "emailKindInvitation": "Einladung zu einem Dokument",+ "emailKindEnrollmentRequested": "Zugangsanfrage erhalten",+ "emailKindAdminNotification": "Neue Zugangsanfrage (Administratoren)",+ "emailKindEnrollmentApproved": "Zugang genehmigt",+ "emailKindEnrollmentRejected": "Zugang abgelehnt",+ "emailKindEnrollmentRevoked": "Zugang entzogen",+ "emailKindVerification": "E-Mail-Adresse bestätigen",+ "emailKindPasswordReset": "Passwort zurücksetzen",+ "emailKindPasswordChanged": "Passwort geändert",+ "emailKindOther": "E-Mail",+ "activityApproved": "genehmigte den Zugang für",+ "activityRejected": "lehnte den Zugang ab für",+ "activityRevoked": "entzog den Zugang für",+ "activitySuspended": "sperrte",+ "activityRestored": "entsperrte",+ "activitySignedOut": "meldete überall ab:",+ "activityMadeAdmin": "ernannte zum Administrator:",+ "activityRemovedAdmin": "entzog die Administratorrechte von",+ "activityEmailRetried": "sendete eine E-Mail erneut an",+ "activityChanged": "änderte",+ "errorTitle": "Das hat nicht funktioniert",+ "errorLastMethod": "Behalte mindestens eine Anmeldemethode.",+ "errorSessionNotFresh": "Melde dich zu deiner Sicherheit erneut an, bevor du diese Änderung vornimmst.",+ "errorLastAdmin": "Der Server braucht mindestens einen Administrator.",+ "errorSelfAction": "Das kannst du nicht mit deinem eigenen Konto tun.",+ "errorTwoStepRequired": "Aktiviere zuerst die zweistufige Anmeldung.",+ "errorNotAllowed": "Dazu bist du nicht berechtigt.",+ "errorNetwork": "Der Server ist nicht erreichbar. Prüfe deine Verbindung.",+ "errorAlreadyDecided": "Über diese Anfrage wurde bereits entschieden. Aktualisiere die Seite, um das Ergebnis zu sehen.",+ "passwordResetSent": "Wir haben dir einen Link zum Festlegen eines Passworts gesendet."+}diff --git a/packages/vue/src/i18n/locales/de/index.ts b/packages/vue/src/i18n/locales/de/index.tsindex 44dc76dfb..e6d27db01 100644--- a/packages/vue/src/i18n/locales/de/index.ts+++ b/packages/vue/src/i18n/locales/de/index.ts@@ -2,6 +2,7 @@ import type { ComponentsJSON } from '@nanostores/i18n'import ai from './ai.json'import automation from './automation.json'+import cloudPortal from './cloud-portal.json'import code from './code.json'import collaboration from './collaboration.json'import commands from './commands.json'@@ -31,6 +32,7 @@ import variables from './variables.json'export default {ai,automation,+ cloudPortal,code,collaboration,commands,diff --git a/packages/vue/src/i18n/locales/es/cloud-portal.json b/packages/vue/src/i18n/locales/es/cloud-portal.jsonnew file mode 100644index 000000000..79c078c9c--- /dev/null+++ b/packages/vue/src/i18n/locales/es/cloud-portal.json@@ -0,0 +1,239 @@+{+ "productName": "OpenPencil Cloud",+ "loading": "Cargando…",+ "unavailableTitle": "Este servidor no responde",+ "unavailableDescription": "Comprueba la dirección o inténtalo de nuevo en un momento.",+ "tryAgain": "Reintentar",+ "signInTitle": "Inicia sesión en OpenPencil Cloud",+ "signUpTitle": "Crea tu cuenta",+ "signInWelcome": "Hola de nuevo.",+ "signUpDescription": "Crea una cuenta en este servidor.",+ "returnsTo": "Después volverás a {destination}.",+ "returnsToDesktop": "la app de OpenPencil",+ "returnsToEditor": "el editor",+ "continueWithGoogle": "Continuar con Google",+ "continueWithApple": "Continuar con Apple",+ "or": "o",+ "name": "Nombre",+ "email": "Correo electrónico",+ "emailPlaceholder": "[email protected]",+ "password": "Contraseña",+ "passwordHint": "Al menos {count} caracteres.",+ "forgotPassword": "¿Has olvidado la contraseña?",+ "signIn": "Iniciar sesión",+ "createAccount": "Crear cuenta",+ "haveAccount": "¿Ya tienes una cuenta?",+ "newHere": "¿Eres nuevo?",+ "createAnAccount": "Crea una cuenta",+ "approvalTitle": "Un administrador revisa las cuentas nuevas",+ "approvalDescription": "Podrás iniciar sesión cuando se apruebe tu solicitud. Te avisaremos por correo.",+ "signInFailed": "No se pudo iniciar sesión",+ "noSignInMethods": "Este servidor todavía no ofrece ninguna forma de iniciar sesión. Consulta a su administrador.",+ "failureInvalidCredentials": "El correo o la contraseña no son correctos.",+ "failureEmailNotVerified": "Primero confirma tu correo. Podemos enviarte el enlace de nuevo.",+ "failurePasswordTooShort": "La contraseña es demasiado corta.",+ "failurePasswordTooLong": "La contraseña es demasiado larga.",+ "failureInvalidLink": "Este enlace ha caducado o ya se ha usado. Pide uno nuevo.",+ "failureInvalidCode": "Ese código no ha funcionado. Revísalo e inténtalo de nuevo.",+ "failurePasskeyCancelled": "Se canceló la configuración de la llave de acceso.",+ "failurePasskeyExists": "Este dispositivo ya tiene una llave de acceso para tu cuenta.",+ "failurePasskeyUnavailable": "Este navegador no pudo crear una llave de acceso para esta dirección. Prueba con otro navegador o usa una app de autenticación.",+ "failureRateLimited": "Demasiados intentos. Espera un minuto e inténtalo de nuevo.",+ "failureUnavailable": "Algo ha fallado en el servidor. Inténtalo de nuevo en un momento.",+ "failureCancelled": "Se ha cancelado el inicio de sesión.",+ "failureEnrollmentClosed": "Este servidor no admite cuentas nuevas.",+ "checkEmailTitle": "Revisa tu correo",+ "checkEmailDescription": "Hemos enviado un enlace a {email}. Ábrelo en este dispositivo para terminar de crear tu cuenta.",+ "sendAgain": "Volver a enviar",+ "sent": "Enviado",+ "useAnotherEmail": "Usar otro correo",+ "pendingTitle": "Un administrador está revisando tu solicitud",+ "pendingDescription": "Escribiremos a {email} cuando puedas iniciar sesión. Por ahora no tienes que hacer nada más.",+ "closedTitle": "No puedes usar este servidor",+ "closedDescription": "Un administrador ha rechazado o retirado tu acceso. Pregúntale si crees que es un error.",+ "signOut": "Cerrar sesión",+ "twoStepTitle": "Confirma que eres tú",+ "twoStepAuthenticator": "Introduce el código de 6 dígitos de tu app de autenticación.",+ "twoStepRecovery": "Introduce uno de los códigos de recuperación que guardaste. Cada uno sirve una sola vez.",+ "authenticationCode": "Código de autenticación",+ "recoveryCode": "Código de recuperación",+ "continue": "Continuar",+ "useRecoveryCode": "Usar un código de recuperación",+ "useAuthenticator": "Usar la app de autenticación",+ "usePasskey": "Usar una llave de acceso",+ "resetTitle": "Restablece tu contraseña",+ "resetDescription": "Te enviaremos un enlace para elegir una nueva.",+ "chooseTitle": "Elige una contraseña nueva",+ "chooseDescription": "Al guardarla se cerrará tu sesión en todos los demás sitios.",+ "newPassword": "Contraseña nueva",+ "sendLink": "Enviar enlace",+ "savePassword": "Guardar contraseña",+ "backToSignIn": "Volver a iniciar sesión",+ "resetSentTitle": "Revisa tu correo",+ "resetSentDescription": "Si {email} tiene una cuenta aquí, el enlace para restablecer la contraseña está en camino.",+ "deviceTitle": "¿Iniciar sesión en la app de OpenPencil?",+ "deviceDescription": "La app de OpenPencil quiere usar tu cuenta, {email}.",+ "deviceCheckCode": "Comprueba que la app muestra este código",+ "deviceWarningTitle": "Aprueba solo un inicio de sesión que hayas iniciado tú",+ "deviceWarningDescription": "Si no acabas de iniciar sesión en OpenPencil en un ordenador, deniega esta solicitud.",+ "approve": "Aprobar",+ "deny": "Denegar",+ "deviceApprovedTitle": "Has iniciado sesión",+ "deviceApprovedDescription": "Vuelve a la app de OpenPencil; ya lo ha detectado. Puedes cerrar esta pestaña.",+ "deviceDeniedTitle": "Inicio de sesión denegado",+ "deviceDeniedDescription": "La app no ha iniciado sesión. Si no fuiste tú, puede que alguien conozca tu contraseña; cámbiala en los ajustes de tu cuenta.",+ "deviceExpiredTitle": "Este código ha caducado",+ "deviceExpiredDescription": "Vuelve a iniciar sesión desde la app de OpenPencil para obtener un código nuevo.",+ "accountSettings": "Ajustes de la cuenta",+ "sectionAccount": "Tu cuenta",+ "sectionServer": "Servidor",+ "security": "Inicio de sesión y seguridad",+ "securityDescription": "Cómo inicias sesión en {host}.",+ "overview": "Resumen",+ "accessRequests": "Solicitudes de acceso",+ "accessRequestsDescription": "Personas que piden unirse. Al aprobarlas podrán iniciar sesión; en ambos casos reciben un correo.",+ "people": "Personas",+ "peopleDescription": {+ "one": "{count} cuenta en este servidor.",+ "many": "{count} cuentas en este servidor."+ },+ "emailDelivery": "Envío de correos",+ "emailDeliveryDescription": "Invitaciones, enlaces de inicio de sesión y decisiones de acceso que envía el servidor.",+ "activity": "Actividad",+ "activityDescription": "Lo que han hecho los administradores en este servidor.",+ "waysToSignIn": "Formas de iniciar sesión",+ "waysToSignInDescription": "Conserva al menos una para poder volver a entrar siempre.",+ "providerGoogle": "Google",+ "providerApple": "Apple",+ "linkedOn": "Vinculada el {date}",+ "notLinked": "Sin vincular",+ "link": "Vincular",+ "unlink": "Desvincular",+ "passwordSet": "Inicia sesión con tu correo y contraseña",+ "passwordNotSet": "Añade una contraseña para iniciar sesión también con tu correo",+ "change": "Cambiar",+ "setPassword": "Establecer contraseña",+ "twoStepSection": "Verificación en dos pasos",+ "twoStepSectionDescription": "Pide una segunda prueba después de la contraseña o la cuenta vinculada.",+ "authenticatorApp": "App de autenticación",+ "authenticatorOn": "Activada",+ "authenticatorOff": "Códigos de una app como 1Password o Google Authenticator",+ "newRecoveryCodes": "Nuevos códigos de recuperación",+ "turnOff": "Desactivar",+ "setUp": "Configurar",+ "passkeys": "Llaves de acceso",+ "passkeysDescription": "Inicia sesión con el bloqueo de pantalla de tu dispositivo en lugar de un código.",+ "addPasskey": "Añadir llave de acceso",+ "passkeyAdded": "Añadida el {date}",+ "unnamedPasskey": "Llave de acceso",+ "remove": "Eliminar",+ "noPasskeys": "Aún no hay llaves de acceso.",+ "adminTwoStepTitle": "Activa un segundo paso de inicio de sesión",+ "adminTwoStepDescription": "Este servidor exige que los administradores usen una app de autenticación o una llave de acceso antes de abrir la consola.",+ "authenticatorSetupTitle": "Configura una app de autenticación",+ "authenticatorSetupScan": "Escanéalo con tu app de autenticación e introduce el código que muestre.",+ "authenticatorSetupKey": "¿No puedes escanearlo? Introduce esta clave",+ "recoveryCodesTitle": "Guarda tus códigos de recuperación",+ "recoveryCodesDescription": "Cada código te permite iniciar sesión una vez si pierdes tu app de autenticación. Guárdalos en un lugar seguro; no se volverán a mostrar.",+ "copyCodes": "Copiar códigos",+ "copyKey": "Copiar clave",+ "copied": "Copiado",+ "done": "Hecho",+ "cancel": "Cancelar",+ "currentPassword": "Contraseña actual",+ "changePasswordTitle": "Cambia tu contraseña",+ "confirmPasswordTitle": "Confirma con tu contraseña",+ "filterWaiting": "En espera",+ "filterApproved": "Aprobadas",+ "filterDeclined": "Rechazadas",+ "filterRemoved": "Retiradas",+ "statusWaiting": "En espera",+ "statusApproved": "Aprobado",+ "statusDeclined": "Rechazado",+ "statusRemoved": "Acceso retirado",+ "asked": "Solicitado el {date}",+ "reviewedBy": "{decision} por {name}",+ "decline": "Rechazar",+ "removeAccess": "Retirar acceso",+ "noOneWaiting": "No hay nadie en espera",+ "nothingHere": "Aún no hay nada",+ "requestsEmptyDescription": "Las nuevas solicitudes aparecen aquí y los administradores reciben un correo por cada una.",+ "searchPeople": "Buscar personas…",+ "you": "(tú)",+ "administrator": "Administrador",+ "suspended": "Suspendida",+ "joined": "Se unió el {date}",+ "actionsFor": "Acciones para {name}",+ "makeAdministrator": "Hacer administrador",+ "removeAdministrator": "Quitar como administrador",+ "signOutEverywhere": "Cerrar todas las sesiones",+ "suspendAccount": "Suspender cuenta",+ "restoreAccount": "Restaurar cuenta",+ "emailTo": "Para {recipient}",+ "attempts": {+ "one": "{count} intento",+ "many": "{count} intentos"+ },+ "emailSent": "Enviado",+ "emailWaiting": "En espera",+ "emailFailed": "Error",+ "retry": "Reintentar",+ "needsAttention": "Requiere atención",+ "waitingRequests": {+ "one": "{count} persona espera una decisión",+ "many": "{count} personas esperan una decisión"+ },+ "noOneIsWaiting": "No hay nadie en espera",+ "emailStatus": "Fallidos: {failed} · En espera: {waiting}",+ "emailWaitingOnly": {+ "one": "{count} correo pendiente de envío",+ "many": "{count} correos pendientes de envío"+ },+ "emailAllSent": "Todo se ha enviado",+ "review": "Revisar",+ "open": "Abrir",+ "serverSection": "Servidor",+ "serverSectionDescription": "Se define en el archivo de configuración del servidor.",+ "deployment": "Implementación",+ "deploymentOfficial": "OpenPencil Cloud",+ "deploymentSelfHosted": "Autoalojado",+ "newAccounts": "Cuentas nuevas",+ "enrollmentOpen": "Cualquiera puede unirse",+ "enrollmentApproval": "Las revisa un administrador",+ "enrollmentClosed": "Cerrado",+ "emailTransportNone": "Desactivado",+ "emailTransportSMTP": "SMTP",+ "emailTransportCloudflare": "Cloudflare Email",+ "someoneElse": "Alguien",+ "emailSuppressed": "No enviado",+ "emailKindInvitation": "Invitación a un documento",+ "emailKindEnrollmentRequested": "Solicitud de acceso recibida",+ "emailKindAdminNotification": "Nueva solicitud de acceso (administradores)",+ "emailKindEnrollmentApproved": "Acceso aprobado",+ "emailKindEnrollmentRejected": "Acceso rechazado",+ "emailKindEnrollmentRevoked": "Acceso retirado",+ "emailKindVerification": "Verifica tu correo",+ "emailKindPasswordReset": "Restablece tu contraseña",+ "emailKindPasswordChanged": "Contraseña cambiada",+ "emailKindOther": "Correo",+ "activityApproved": "aprobó el acceso de",+ "activityRejected": "rechazó el acceso de",+ "activityRevoked": "retiró el acceso de",+ "activitySuspended": "suspendió a",+ "activityRestored": "restauró a",+ "activitySignedOut": "cerró todas las sesiones de",+ "activityMadeAdmin": "hizo administrador a",+ "activityRemovedAdmin": "quitó los permisos de administrador a",+ "activityEmailRetried": "reintentó un correo a",+ "activityChanged": "cambió",+ "errorTitle": "No ha funcionado",+ "errorLastMethod": "Conserva al menos una forma de iniciar sesión.",+ "errorSessionNotFresh": "Por seguridad, vuelve a iniciar sesión antes de hacer este cambio.",+ "errorLastAdmin": "El servidor necesita al menos un administrador.",+ "errorSelfAction": "No puedes hacer eso con tu propia cuenta.",+ "errorTwoStepRequired": "Primero activa la verificación en dos pasos.",+ "errorNotAllowed": "No tienes permiso para hacer eso.",+ "errorNetwork": "No se pudo conectar con el servidor. Comprueba tu conexión.",+ "errorAlreadyDecided": "Alguien ya ha resuelto esta solicitud. Actualiza para verla.",+ "passwordResetSent": "Te hemos enviado un enlace para establecer una contraseña."+}diff --git a/packages/vue/src/i18n/locales/es/index.ts b/packages/vue/src/i18n/locales/es/index.tsindex 44dc76dfb..e6d27db01 100644--- a/packages/vue/src/i18n/locales/es/index.ts+++ b/packages/vue/src/i18n/locales/es/index.ts@@ -2,6 +2,7 @@ import type { ComponentsJSON } from '@nanostores/i18n'import ai from './ai.json'import automation from './automation.json'+import cloudPortal from './cloud-portal.json'import code from './code.json'import collaboration from './collaboration.json'import commands from './commands.json'@@ -31,6 +32,7 @@ import variables from './variables.json'export default {ai,automation,+ cloudPortal,code,collaboration,commands,diff --git a/packages/vue/src/i18n/locales/fr/cloud-portal.json b/packages/vue/src/i18n/locales/fr/cloud-portal.jsonnew file mode 100644index 000000000..8267dec20--- /dev/null+++ b/packages/vue/src/i18n/locales/fr/cloud-portal.json@@ -0,0 +1,239 @@+{+ "productName": "OpenPencil Cloud",+ "loading": "Chargement…",+ "unavailableTitle": "Ce serveur ne répond pas",+ "unavailableDescription": "Vérifiez l’adresse ou réessayez dans un instant.",+ "tryAgain": "Réessayer",+ "signInTitle": "Se connecter à OpenPencil Cloud",+ "signUpTitle": "Créer votre compte",+ "signInWelcome": "Bon retour parmi nous.",+ "signUpDescription": "Créez un compte sur ce serveur.",+ "returnsTo": "Vous reviendrez ensuite à {destination}.",+ "returnsToDesktop": "l’app OpenPencil",+ "returnsToEditor": "l’éditeur",+ "continueWithGoogle": "Continuer avec Google",+ "continueWithApple": "Continuer avec Apple",+ "or": "ou",+ "name": "Nom",+ "email": "E-mail",+ "emailPlaceholder": "[email protected]",+ "password": "Mot de passe",+ "passwordHint": "Au moins {count} caractères.",+ "forgotPassword": "Mot de passe oublié ?",+ "signIn": "Se connecter",+ "createAccount": "Créer le compte",+ "haveAccount": "Vous avez déjà un compte ?",+ "newHere": "Nouveau ici ?",+ "createAnAccount": "Créer un compte",+ "approvalTitle": "Un administrateur examine les nouveaux comptes",+ "approvalDescription": "Vous pourrez vous connecter une fois votre demande approuvée. Nous vous préviendrons par e-mail.",+ "signInFailed": "Connexion impossible",+ "noSignInMethods": "Ce serveur ne propose encore aucun moyen de connexion. Contactez son administrateur.",+ "failureInvalidCredentials": "L’e-mail ou le mot de passe est incorrect.",+ "failureEmailNotVerified": "Confirmez d’abord votre adresse e-mail. Nous pouvons renvoyer le lien.",+ "failurePasswordTooShort": "Le mot de passe est trop court.",+ "failurePasswordTooLong": "Le mot de passe est trop long.",+ "failureInvalidLink": "Ce lien a expiré ou a déjà été utilisé. Demandez-en un nouveau.",+ "failureInvalidCode": "Ce code n’a pas fonctionné. Vérifiez-le et réessayez.",+ "failurePasskeyCancelled": "La configuration de la clé d’accès a été annulée.",+ "failurePasskeyExists": "Cet appareil a déjà une clé d’accès pour votre compte.",+ "failurePasskeyUnavailable": "Ce navigateur n’a pas pu créer de clé d’accès pour cette adresse. Essayez un autre navigateur ou utilisez une app d’authentification.",+ "failureRateLimited": "Trop de tentatives. Patientez une minute et réessayez.",+ "failureUnavailable": "Une erreur s’est produite sur le serveur. Réessayez dans un instant.",+ "failureCancelled": "La connexion a été annulée.",+ "failureEnrollmentClosed": "Ce serveur n’accepte pas de nouveaux comptes.",+ "checkEmailTitle": "Consultez vos e-mails",+ "checkEmailDescription": "Nous avons envoyé un lien à {email}. Ouvrez-le sur cet appareil pour terminer la création de votre compte.",+ "sendAgain": "Renvoyer",+ "sent": "Envoyé",+ "useAnotherEmail": "Utiliser une autre adresse e-mail",+ "pendingTitle": "Votre demande est entre les mains d’un administrateur",+ "pendingDescription": "Nous écrirons à {email} dès que vous pourrez vous connecter. Vous n’avez rien d’autre à faire pour l’instant.",+ "closedTitle": "Vous ne pouvez pas utiliser ce serveur",+ "closedDescription": "Un administrateur a refusé ou retiré votre accès. Contactez-le si vous pensez qu’il s’agit d’une erreur.",+ "signOut": "Se déconnecter",+ "twoStepTitle": "Confirmez votre identité",+ "twoStepAuthenticator": "Saisissez le code à 6 chiffres de votre app d’authentification.",+ "twoStepRecovery": "Saisissez l’un des codes de récupération que vous avez enregistrés. Chacun ne fonctionne qu’une fois.",+ "authenticationCode": "Code d’authentification",+ "recoveryCode": "Code de récupération",+ "continue": "Continuer",+ "useRecoveryCode": "Utiliser un code de récupération",+ "useAuthenticator": "Utiliser votre app d’authentification",+ "usePasskey": "Utiliser une clé d’accès",+ "resetTitle": "Réinitialiser votre mot de passe",+ "resetDescription": "Nous vous envoyons un lien pour en choisir un nouveau.",+ "chooseTitle": "Choisir un nouveau mot de passe",+ "chooseDescription": "L’enregistrer vous déconnecte partout ailleurs.",+ "newPassword": "Nouveau mot de passe",+ "sendLink": "Envoyer le lien",+ "savePassword": "Enregistrer le mot de passe",+ "backToSignIn": "Retour à la connexion",+ "resetSentTitle": "Consultez vos e-mails",+ "resetSentDescription": "Si {email} possède un compte ici, un lien de réinitialisation est en route.",+ "deviceTitle": "Se connecter à l’app OpenPencil ?",+ "deviceDescription": "L’app OpenPencil demande à utiliser votre compte {email}.",+ "deviceCheckCode": "Vérifiez que l’app affiche ce code",+ "deviceWarningTitle": "N’approuvez qu’une connexion que vous avez lancée",+ "deviceWarningDescription": "Si vous ne venez pas de vous connecter à OpenPencil sur un ordinateur, refusez cette demande.",+ "approve": "Approuver",+ "deny": "Refuser",+ "deviceApprovedTitle": "Vous êtes connecté",+ "deviceApprovedDescription": "Revenez à l’app OpenPencil ; elle a déjà pris en compte la connexion. Vous pouvez fermer cet onglet.",+ "deviceDeniedTitle": "Connexion refusée",+ "deviceDeniedDescription": "L’app n’a pas été connectée. Si vous n’êtes pas à l’origine de cette demande, quelqu’un connaît peut-être votre mot de passe ; changez-le dans les paramètres de votre compte.",+ "deviceExpiredTitle": "Ce code a expiré",+ "deviceExpiredDescription": "Relancez la connexion depuis l’app OpenPencil pour obtenir un nouveau code.",+ "accountSettings": "Paramètres du compte",+ "sectionAccount": "Votre compte",+ "sectionServer": "Serveur",+ "security": "Connexion et sécurité",+ "securityDescription": "Comment vous vous connectez à {host}.",+ "overview": "Vue d’ensemble",+ "accessRequests": "Demandes d’accès",+ "accessRequestsDescription": "Personnes qui demandent à rejoindre le serveur. Une approbation leur permet de se connecter ; chacune reçoit un e-mail dans tous les cas.",+ "people": "Personnes",+ "peopleDescription": {+ "one": "{count} compte sur ce serveur.",+ "many": "{count} comptes sur ce serveur."+ },+ "emailDelivery": "Envoi des e-mails",+ "emailDeliveryDescription": "Invitations, liens de connexion et décisions d’accès envoyés par le serveur.",+ "activity": "Activité",+ "activityDescription": "Les actions des administrateurs sur ce serveur.",+ "waysToSignIn": "Moyens de connexion",+ "waysToSignInDescription": "Conservez-en au moins un pour toujours pouvoir revenir.",+ "providerGoogle": "Google",+ "providerApple": "Apple",+ "linkedOn": "Associé le {date}",+ "notLinked": "Non associé",+ "link": "Associer",+ "unlink": "Dissocier",+ "passwordSet": "Connectez-vous avec votre e-mail et votre mot de passe",+ "passwordNotSet": "Ajoutez un mot de passe pour pouvoir aussi vous connecter avec votre e-mail",+ "change": "Modifier",+ "setPassword": "Définir un mot de passe",+ "twoStepSection": "Connexion en deux étapes",+ "twoStepSectionDescription": "Demander une seconde preuve après votre mot de passe ou votre compte associé.",+ "authenticatorApp": "App d’authentification",+ "authenticatorOn": "Activée",+ "authenticatorOff": "Codes générés par une app comme 1Password ou Google Authenticator",+ "newRecoveryCodes": "Nouveaux codes de récupération",+ "turnOff": "Désactiver",+ "setUp": "Configurer",+ "passkeys": "Clés d’accès",+ "passkeysDescription": "Connectez-vous avec le verrouillage d’écran de votre appareil au lieu d’un code.",+ "addPasskey": "Ajouter une clé d’accès",+ "passkeyAdded": "Ajoutée le {date}",+ "unnamedPasskey": "Clé d’accès",+ "remove": "Supprimer",+ "noPasskeys": "Aucune clé d’accès pour le moment.",+ "adminTwoStepTitle": "Activez une seconde étape de connexion",+ "adminTwoStepDescription": "Ce serveur exige que les administrateurs utilisent une app d’authentification ou une clé d’accès avant d’ouvrir la console.",+ "authenticatorSetupTitle": "Configurer une app d’authentification",+ "authenticatorSetupScan": "Scannez ce code avec votre app d’authentification, puis saisissez le code affiché.",+ "authenticatorSetupKey": "Impossible de scanner ? Saisissez cette clé",+ "recoveryCodesTitle": "Enregistrez vos codes de récupération",+ "recoveryCodesDescription": "Chaque code vous permet de vous connecter une fois si vous perdez votre app d’authentification. Conservez-les en lieu sûr ; ils ne seront plus affichés.",+ "copyCodes": "Copier les codes",+ "copyKey": "Copier la clé",+ "copied": "Copié",+ "done": "Terminé",+ "cancel": "Annuler",+ "currentPassword": "Mot de passe actuel",+ "changePasswordTitle": "Modifier votre mot de passe",+ "confirmPasswordTitle": "Confirmez avec votre mot de passe",+ "filterWaiting": "En attente",+ "filterApproved": "Approuvées",+ "filterDeclined": "Refusées",+ "filterRemoved": "Retirées",+ "statusWaiting": "En attente",+ "statusApproved": "Approuvé",+ "statusDeclined": "Refusé",+ "statusRemoved": "Accès retiré",+ "asked": "Demandé le {date}",+ "reviewedBy": "{decision} par {name}",+ "decline": "Refuser",+ "removeAccess": "Retirer l’accès",+ "noOneWaiting": "Personne n’attend",+ "nothingHere": "Rien pour le moment",+ "requestsEmptyDescription": "Les nouvelles demandes apparaissent ici, et les administrateurs reçoivent un e-mail pour chacune.",+ "searchPeople": "Rechercher des personnes…",+ "you": "(vous)",+ "administrator": "Administrateur",+ "suspended": "Suspendu",+ "joined": "Inscrit le {date}",+ "actionsFor": "Actions pour {name}",+ "makeAdministrator": "Nommer administrateur",+ "removeAdministrator": "Retirer les droits d’administrateur",+ "signOutEverywhere": "Déconnecter partout",+ "suspendAccount": "Suspendre le compte",+ "restoreAccount": "Rétablir le compte",+ "emailTo": "À {recipient}",+ "attempts": {+ "one": "{count} tentative",+ "many": "{count} tentatives"+ },+ "emailSent": "Envoyé",+ "emailWaiting": "En attente",+ "emailFailed": "Échec",+ "retry": "Réessayer",+ "needsAttention": "Action requise",+ "waitingRequests": {+ "one": "{count} personne attend une décision",+ "many": "{count} personnes attendent une décision"+ },+ "noOneIsWaiting": "Personne n’attend",+ "emailStatus": "Échecs : {failed} · En attente : {waiting}",+ "emailWaitingOnly": {+ "one": "{count} e-mail en attente d’envoi",+ "many": "{count} e-mails en attente d’envoi"+ },+ "emailAllSent": "Tout a été envoyé",+ "review": "Examiner",+ "open": "Ouvrir",+ "serverSection": "Serveur",+ "serverSectionDescription": "Défini dans le fichier de configuration du serveur.",+ "deployment": "Déploiement",+ "deploymentOfficial": "OpenPencil Cloud",+ "deploymentSelfHosted": "Auto-hébergé",+ "newAccounts": "Nouveaux comptes",+ "enrollmentOpen": "Ouvert à tous",+ "enrollmentApproval": "Examinés par un administrateur",+ "enrollmentClosed": "Fermé",+ "emailTransportNone": "Désactivé",+ "emailTransportSMTP": "SMTP",+ "emailTransportCloudflare": "Cloudflare Email",+ "someoneElse": "Quelqu’un",+ "emailSuppressed": "Non envoyé",+ "emailKindInvitation": "Invitation à un document",+ "emailKindEnrollmentRequested": "Demande d’accès reçue",+ "emailKindAdminNotification": "Nouvelle demande d’accès (administrateurs)",+ "emailKindEnrollmentApproved": "Accès approuvé",+ "emailKindEnrollmentRejected": "Accès refusé",+ "emailKindEnrollmentRevoked": "Accès retiré",+ "emailKindVerification": "Vérification de l’adresse e-mail",+ "emailKindPasswordReset": "Réinitialisation du mot de passe",+ "emailKindPasswordChanged": "Mot de passe modifié",+ "emailKindOther": "E-mail",+ "activityApproved": "a approuvé l’accès de",+ "activityRejected": "a refusé l’accès de",+ "activityRevoked": "a retiré l’accès de",+ "activitySuspended": "a suspendu",+ "activityRestored": "a rétabli",+ "activitySignedOut": "a déconnecté partout :",+ "activityMadeAdmin": "a nommé administrateur :",+ "activityRemovedAdmin": "a retiré les droits d’administrateur à",+ "activityEmailRetried": "a renvoyé un e-mail à",+ "activityChanged": "a modifié",+ "errorTitle": "Cela n’a pas fonctionné",+ "errorLastMethod": "Conservez au moins un moyen de connexion.",+ "errorSessionNotFresh": "Pour votre sécurité, reconnectez-vous avant d’effectuer cette modification.",+ "errorLastAdmin": "Le serveur doit avoir au moins un administrateur.",+ "errorSelfAction": "Vous ne pouvez pas faire cela sur votre propre compte.",+ "errorTwoStepRequired": "Activez d’abord la connexion en deux étapes.",+ "errorNotAllowed": "Vous n’avez pas l’autorisation de faire cela.",+ "errorNetwork": "Impossible de joindre le serveur. Vérifiez votre connexion.",+ "errorAlreadyDecided": "Quelqu’un a déjà statué sur cette demande. Actualisez pour voir la décision.",+ "passwordResetSent": "Nous vous avons envoyé par e-mail un lien pour définir un mot de passe."+}diff --git a/packages/vue/src/i18n/locales/fr/index.ts b/packages/vue/src/i18n/locales/fr/index.tsindex 44dc76dfb..e6d27db01 100644--- a/packages/vue/src/i18n/locales/fr/index.ts+++ b/packages/vue/src/i18n/locales/fr/index.ts@@ -2,6 +2,7 @@ import type { ComponentsJSON } from '@nanostores/i18n'import ai from './ai.json'import automation from './automation.json'+import cloudPortal from './cloud-portal.json'import code from './code.json'import collaboration from './collaboration.json'import commands from './commands.json'@@ -31,6 +32,7 @@ import variables from './variables.json'export default {ai,automation,+ cloudPortal,code,collaboration,commands,diff --git a/packages/vue/src/i18n/locales/it/cloud-portal.json b/packages/vue/src/i18n/locales/it/cloud-portal.jsonnew file mode 100644index 000000000..18f078a9a--- /dev/null+++ b/packages/vue/src/i18n/locales/it/cloud-portal.json@@ -0,0 +1,239 @@+{+ "productName": "OpenPencil Cloud",+ "loading": "Caricamento…",+ "unavailableTitle": "Questo server non risponde",+ "unavailableDescription": "Controlla l’indirizzo o riprova tra un momento.",+ "tryAgain": "Riprova",+ "signInTitle": "Accedi a OpenPencil Cloud",+ "signUpTitle": "Crea il tuo account",+ "signInWelcome": "Bentornato.",+ "signUpDescription": "Crea un account su questo server.",+ "returnsTo": "Poi tornerai a {destination}.",+ "returnsToDesktop": "l’app OpenPencil",+ "returnsToEditor": "l’editor",+ "continueWithGoogle": "Continua con Google",+ "continueWithApple": "Continua con Apple",+ "or": "oppure",+ "name": "Nome",+ "email": "Email",+ "emailPlaceholder": "[email protected]",+ "password": "Password",+ "passwordHint": "Almeno {count} caratteri.",+ "forgotPassword": "Password dimenticata?",+ "signIn": "Accedi",+ "createAccount": "Crea account",+ "haveAccount": "Hai già un account?",+ "newHere": "Sei nuovo?",+ "createAnAccount": "Crea un account",+ "approvalTitle": "Un amministratore esamina i nuovi account",+ "approvalDescription": "Potrai accedere quando la tua richiesta sarà approvata. Ti avviseremo via email.",+ "signInFailed": "Accesso non riuscito",+ "noSignInMethods": "Questo server non offre ancora un modo per accedere. Chiedi al suo amministratore.",+ "failureInvalidCredentials": "Email o password errate.",+ "failureEmailNotVerified": "Prima conferma la tua email. Possiamo inviarti di nuovo il link.",+ "failurePasswordTooShort": "La password è troppo corta.",+ "failurePasswordTooLong": "La password è troppo lunga.",+ "failureInvalidLink": "Questo link è scaduto o è già stato usato. Richiedine uno nuovo.",+ "failureInvalidCode": "Il codice non è valido. Controllalo e riprova.",+ "failurePasskeyCancelled": "La configurazione della passkey è stata annullata.",+ "failurePasskeyExists": "Questo dispositivo ha già una passkey per il tuo account.",+ "failurePasskeyUnavailable": "Questo browser non è riuscito a creare una passkey per questo indirizzo. Prova un altro browser o usa un’app di autenticazione.",+ "failureRateLimited": "Troppi tentativi. Attendi un minuto e riprova.",+ "failureUnavailable": "Si è verificato un problema sul server. Riprova tra un momento.",+ "failureCancelled": "Accesso annullato.",+ "failureEnrollmentClosed": "Questo server non accetta nuovi account.",+ "checkEmailTitle": "Controlla la tua email",+ "checkEmailDescription": "Abbiamo inviato un link a {email}. Aprilo su questo dispositivo per completare la creazione dell’account.",+ "sendAgain": "Invia di nuovo",+ "sent": "Inviato",+ "useAnotherEmail": "Usa un’altra email",+ "pendingTitle": "La tua richiesta è in mano a un amministratore",+ "pendingDescription": "Scriveremo a {email} quando potrai accedere. Per ora non devi fare altro.",+ "closedTitle": "Non puoi usare questo server",+ "closedDescription": "Un amministratore ha rifiutato o revocato il tuo accesso. Contattalo se pensi che sia un errore.",+ "signOut": "Esci",+ "twoStepTitle": "Conferma la tua identità",+ "twoStepAuthenticator": "Inserisci il codice a 6 cifre della tua app di autenticazione.",+ "twoStepRecovery": "Inserisci uno dei codici di recupero che hai salvato. Ognuno funziona una sola volta.",+ "authenticationCode": "Codice di autenticazione",+ "recoveryCode": "Codice di recupero",+ "continue": "Continua",+ "useRecoveryCode": "Usa un codice di recupero",+ "useAuthenticator": "Usa l’app di autenticazione",+ "usePasskey": "Usa una passkey",+ "resetTitle": "Reimposta la password",+ "resetDescription": "Ti invieremo via email un link per sceglierne una nuova.",+ "chooseTitle": "Scegli una nuova password",+ "chooseDescription": "Salvandola verrai disconnesso da tutti gli altri dispositivi.",+ "newPassword": "Nuova password",+ "sendLink": "Invia link",+ "savePassword": "Salva password",+ "backToSignIn": "Torna all’accesso",+ "resetSentTitle": "Controlla la tua email",+ "resetSentDescription": "Se {email} ha un account qui, riceverai a breve un link per reimpostare la password.",+ "deviceTitle": "Accedere all’app OpenPencil?",+ "deviceDescription": "L’app OpenPencil chiede di usare il tuo account, {email}.",+ "deviceCheckCode": "Verifica che l’app mostri questo codice",+ "deviceWarningTitle": "Approva solo un accesso avviato da te",+ "deviceWarningDescription": "Se non hai appena effettuato l’accesso a OpenPencil da un computer, nega questa richiesta.",+ "approve": "Approva",+ "deny": "Nega",+ "deviceApprovedTitle": "Accesso effettuato",+ "deviceApprovedDescription": "Torna all’app OpenPencil: ha già ricevuto l’accesso. Puoi chiudere questa scheda.",+ "deviceDeniedTitle": "Accesso negato",+ "deviceDeniedDescription": "L’app non ha effettuato l’accesso. Se non sei stato tu, qualcuno potrebbe conoscere la tua password: cambiala nelle impostazioni dell’account.",+ "deviceExpiredTitle": "Questo codice è scaduto",+ "deviceExpiredDescription": "Avvia di nuovo l’accesso dall’app OpenPencil per ottenere un nuovo codice.",+ "accountSettings": "Impostazioni account",+ "sectionAccount": "Il tuo account",+ "sectionServer": "Server",+ "security": "Accesso e sicurezza",+ "securityDescription": "Come accedi a {host}.",+ "overview": "Panoramica",+ "accessRequests": "Richieste di accesso",+ "accessRequestsDescription": "Persone che chiedono di unirsi. Approvandole potranno accedere; in ogni caso ricevono un’email.",+ "people": "Persone",+ "peopleDescription": {+ "one": "{count} account su questo server.",+ "many": "{count} account su questo server."+ },+ "emailDelivery": "Invio email",+ "emailDeliveryDescription": "Inviti, link di accesso e decisioni sull’accesso inviati dal server.",+ "activity": "Attività",+ "activityDescription": "Le azioni degli amministratori su questo server.",+ "waysToSignIn": "Metodi di accesso",+ "waysToSignInDescription": "Mantienine almeno uno, così potrai sempre rientrare.",+ "providerGoogle": "Google",+ "providerApple": "Apple",+ "linkedOn": "Collegato il {date}",+ "notLinked": "Non collegato",+ "link": "Collega",+ "unlink": "Scollega",+ "passwordSet": "Accedi con email e password",+ "passwordNotSet": "Aggiungi una password per accedere anche con la tua email",+ "change": "Cambia",+ "setPassword": "Imposta password",+ "twoStepSection": "Verifica in due passaggi",+ "twoStepSectionDescription": "Richiedi una seconda prova dopo la password o l’account collegato.",+ "authenticatorApp": "App di autenticazione",+ "authenticatorOn": "Attiva",+ "authenticatorOff": "Codici da un’app come 1Password o Google Authenticator",+ "newRecoveryCodes": "Nuovi codici di recupero",+ "turnOff": "Disattiva",+ "setUp": "Configura",+ "passkeys": "Passkey",+ "passkeysDescription": "Accedi con il blocco schermo del dispositivo invece che con un codice.",+ "addPasskey": "Aggiungi passkey",+ "passkeyAdded": "Aggiunta il {date}",+ "unnamedPasskey": "Passkey",+ "remove": "Rimuovi",+ "noPasskeys": "Ancora nessuna passkey.",+ "adminTwoStepTitle": "Attiva un secondo passaggio di accesso",+ "adminTwoStepDescription": "Questo server richiede agli amministratori di usare un’app di autenticazione o una passkey prima di aprire la console.",+ "authenticatorSetupTitle": "Configura un’app di autenticazione",+ "authenticatorSetupScan": "Scansiona il codice con la tua app di autenticazione, poi inserisci il codice che mostra.",+ "authenticatorSetupKey": "Non riesci a scansionare? Inserisci questa chiave",+ "recoveryCodesTitle": "Salva i codici di recupero",+ "recoveryCodesDescription": "Ogni codice ti permette di accedere una volta se perdi l’app di autenticazione. Conservali in un posto sicuro: non verranno più mostrati.",+ "copyCodes": "Copia codici",+ "copyKey": "Copia chiave",+ "copied": "Copiato",+ "done": "Fatto",+ "cancel": "Annulla",+ "currentPassword": "Password attuale",+ "changePasswordTitle": "Cambia la password",+ "confirmPasswordTitle": "Conferma con la password",+ "filterWaiting": "In attesa",+ "filterApproved": "Approvate",+ "filterDeclined": "Rifiutate",+ "filterRemoved": "Revocate",+ "statusWaiting": "In attesa",+ "statusApproved": "Approvata",+ "statusDeclined": "Rifiutata",+ "statusRemoved": "Accesso revocato",+ "asked": "Richiesta il {date}",+ "reviewedBy": "{decision} da {name}",+ "decline": "Rifiuta",+ "removeAccess": "Revoca accesso",+ "noOneWaiting": "Nessuno in attesa",+ "nothingHere": "Ancora niente qui",+ "requestsEmptyDescription": "Le nuove richieste compaiono qui e gli amministratori ricevono un’email per ciascuna.",+ "searchPeople": "Cerca persone…",+ "you": "(tu)",+ "administrator": "Amministratore",+ "suspended": "Sospeso",+ "joined": "Iscritto il {date}",+ "actionsFor": "Azioni per {name}",+ "makeAdministrator": "Rendi amministratore",+ "removeAdministrator": "Rimuovi da amministratore",+ "signOutEverywhere": "Disconnetti ovunque",+ "suspendAccount": "Sospendi account",+ "restoreAccount": "Ripristina account",+ "emailTo": "A {recipient}",+ "attempts": {+ "one": "{count} tentativo",+ "many": "{count} tentativi"+ },+ "emailSent": "Inviata",+ "emailWaiting": "In attesa",+ "emailFailed": "Non riuscita",+ "retry": "Riprova",+ "needsAttention": "Richiede attenzione",+ "waitingRequests": {+ "one": "{count} persona attende una decisione",+ "many": "{count} persone attendono una decisione"+ },+ "noOneIsWaiting": "Nessuno in attesa",+ "emailStatus": "Non riuscite: {failed} · In attesa: {waiting}",+ "emailWaitingOnly": {+ "one": "{count} email in attesa di invio",+ "many": "{count} email in attesa di invio"+ },+ "emailAllSent": "Tutto è stato inviato",+ "review": "Esamina",+ "open": "Apri",+ "serverSection": "Server",+ "serverSectionDescription": "Impostato nel file di configurazione del server.",+ "deployment": "Distribuzione",+ "deploymentOfficial": "OpenPencil Cloud",+ "deploymentSelfHosted": "Self-hosted",+ "newAccounts": "Nuovi account",+ "enrollmentOpen": "Chiunque può unirsi",+ "enrollmentApproval": "Esaminati da un amministratore",+ "enrollmentClosed": "Chiuso",+ "emailTransportNone": "Disattivato",+ "emailTransportSMTP": "SMTP",+ "emailTransportCloudflare": "Cloudflare Email",+ "someoneElse": "Qualcuno",+ "emailSuppressed": "Non inviata",+ "emailKindInvitation": "Invito a un documento",+ "emailKindEnrollmentRequested": "Richiesta di accesso ricevuta",+ "emailKindAdminNotification": "Nuova richiesta di accesso (amministratori)",+ "emailKindEnrollmentApproved": "Accesso approvato",+ "emailKindEnrollmentRejected": "Accesso rifiutato",+ "emailKindEnrollmentRevoked": "Accesso revocato",+ "emailKindVerification": "Verifica la tua email",+ "emailKindPasswordReset": "Reimposta la password",+ "emailKindPasswordChanged": "Password modificata",+ "emailKindOther": "Email",+ "activityApproved": "ha approvato l’accesso di",+ "activityRejected": "ha rifiutato l’accesso di",+ "activityRevoked": "ha revocato l’accesso di",+ "activitySuspended": "ha sospeso",+ "activityRestored": "ha ripristinato",+ "activitySignedOut": "ha disconnesso ovunque",+ "activityMadeAdmin": "ha reso amministratore",+ "activityRemovedAdmin": "ha rimosso i diritti di amministratore a",+ "activityEmailRetried": "ha ritentato l’invio di un’email a",+ "activityChanged": "ha modificato",+ "errorTitle": "Operazione non riuscita",+ "errorLastMethod": "Mantieni almeno un metodo di accesso.",+ "errorSessionNotFresh": "Per sicurezza, accedi di nuovo prima di apportare questa modifica.",+ "errorLastAdmin": "Il server ha bisogno di almeno un amministratore.",+ "errorSelfAction": "Non puoi farlo sul tuo account.",+ "errorTwoStepRequired": "Prima attiva la verifica in due passaggi.",+ "errorNotAllowed": "Non hai l’autorizzazione per farlo.",+ "errorNetwork": "Impossibile raggiungere il server. Controlla la connessione.",+ "errorAlreadyDecided": "Qualcuno ha già deciso su questa richiesta. Aggiorna per vederla.",+ "passwordResetSent": "Ti abbiamo inviato via email un link per impostare una password."+}diff --git a/packages/vue/src/i18n/locales/it/index.ts b/packages/vue/src/i18n/locales/it/index.tsindex 44dc76dfb..e6d27db01 100644--- a/packages/vue/src/i18n/locales/it/index.ts+++ b/packages/vue/src/i18n/locales/it/index.ts@@ -2,6 +2,7 @@ import type { ComponentsJSON } from '@nanostores/i18n'import ai from './ai.json'import automation from './automation.json'+import cloudPortal from './cloud-portal.json'import code from './code.json'import collaboration from './collaboration.json'import commands from './commands.json'@@ -31,6 +32,7 @@ import variables from './variables.json'export default {ai,automation,+ cloudPortal,code,collaboration,commands,diff --git a/packages/vue/src/i18n/locales/ja/cloud-portal.json b/packages/vue/src/i18n/locales/ja/cloud-portal.jsonnew file mode 100644index 000000000..a2eb0cfb8--- /dev/null+++ b/packages/vue/src/i18n/locales/ja/cloud-portal.json@@ -0,0 +1,235 @@+{+ "productName": "OpenPencil Cloud",+ "loading": "読み込み中…",+ "unavailableTitle": "このサーバーが応答していません",+ "unavailableDescription": "アドレスを確認するか、しばらくしてからもう一度お試しください。",+ "tryAgain": "もう一度試す",+ "signInTitle": "OpenPencil Cloud にサインイン",+ "signUpTitle": "アカウントを作成",+ "signInWelcome": "おかえりなさい。",+ "signUpDescription": "このサーバーにアカウントを作成します。",+ "returnsTo": "完了すると{destination}に戻ります。",+ "returnsToDesktop": "OpenPencil アプリ",+ "returnsToEditor": "エディター",+ "continueWithGoogle": "Google で続行",+ "continueWithApple": "Apple で続行",+ "or": "または",+ "name": "名前",+ "email": "メールアドレス",+ "emailPlaceholder": "[email protected]",+ "password": "パスワード",+ "passwordHint": "{count}文字以上。",+ "forgotPassword": "パスワードをお忘れですか?",+ "signIn": "サインイン",+ "createAccount": "アカウントを作成",+ "haveAccount": "アカウントをお持ちですか?",+ "newHere": "初めてですか?",+ "createAnAccount": "アカウントを作成",+ "approvalTitle": "新しいアカウントは管理者が審査します",+ "approvalDescription": "リクエストが承認されるとサインインできます。承認されたらメールでお知らせします。",+ "signInFailed": "サインインできませんでした",+ "noSignInMethods": "このサーバーにはまだサインイン方法がありません。管理者にお問い合わせください。",+ "failureInvalidCredentials": "メールアドレスまたはパスワードが正しくありません。",+ "failureEmailNotVerified": "先にメールアドレスを確認してください。リンクを再送することもできます。",+ "failurePasswordTooShort": "パスワードが短すぎます。",+ "failurePasswordTooLong": "パスワードが長すぎます。",+ "failureInvalidLink": "このリンクは期限切れか、すでに使用されています。新しいリンクをリクエストしてください。",+ "failureInvalidCode": "コードが正しくありません。確認して、もう一度お試しください。",+ "failurePasskeyCancelled": "パスキーの設定がキャンセルされました。",+ "failurePasskeyExists": "このデバイスには既にアカウントのパスキーがあります。",+ "failurePasskeyUnavailable": "このブラウザーではこのアドレスのパスキーを作成できませんでした。別のブラウザーを試すか、認証アプリを使ってください。",+ "failureRateLimited": "試行回数が多すぎます。1分ほど待ってから、もう一度お試しください。",+ "failureUnavailable": "サーバーで問題が発生しました。しばらくしてからもう一度お試しください。",+ "failureCancelled": "サインインはキャンセルされました。",+ "failureEnrollmentClosed": "このサーバーは新しいアカウントを受け付けていません。",+ "checkEmailTitle": "メールを確認してください",+ "checkEmailDescription": "{email} にリンクを送信しました。このデバイスでリンクを開いて、アカウントの作成を完了してください。",+ "sendAgain": "再送信",+ "sent": "送信しました",+ "useAnotherEmail": "別のメールアドレスを使う",+ "pendingTitle": "リクエストは管理者が確認中です",+ "pendingDescription": "サインインできるようになったら {email} にメールでお知らせします。今は何もする必要はありません。",+ "closedTitle": "このサーバーは利用できません",+ "closedDescription": "管理者がアクセスを却下または削除しました。間違いだと思われる場合は、管理者にお問い合わせください。",+ "signOut": "サインアウト",+ "twoStepTitle": "本人確認",+ "twoStepAuthenticator": "認証アプリに表示される6桁のコードを入力してください。",+ "twoStepRecovery": "保存したリカバリーコードを1つ入力してください。各コードは1回だけ使えます。",+ "authenticationCode": "認証コード",+ "recoveryCode": "リカバリーコード",+ "continue": "続行",+ "useRecoveryCode": "リカバリーコードを使う",+ "useAuthenticator": "認証アプリを使う",+ "usePasskey": "パスキーを使う",+ "resetTitle": "パスワードをリセット",+ "resetDescription": "新しいパスワードを設定するためのリンクをメールでお送りします。",+ "chooseTitle": "新しいパスワードを設定",+ "chooseDescription": "保存すると、他のすべての場所からサインアウトされます。",+ "newPassword": "新しいパスワード",+ "sendLink": "リンクを送信",+ "savePassword": "パスワードを保存",+ "backToSignIn": "サインインに戻る",+ "resetSentTitle": "メールを確認してください",+ "resetSentDescription": "{email} のアカウントがある場合は、リセット用のリンクをお送りしました。",+ "deviceTitle": "OpenPencil アプリにサインインしますか?",+ "deviceDescription": "OpenPencil アプリがあなたのアカウント({email})の使用を求めています。",+ "deviceCheckCode": "アプリにこのコードが表示されていることを確認してください",+ "deviceWarningTitle": "自分で開始したサインインだけを承認してください",+ "deviceWarningDescription": "今パソコンで OpenPencil にサインインしようとしていない場合は、このリクエストを拒否してください。",+ "approve": "承認",+ "deny": "拒否",+ "deviceApprovedTitle": "サインインしました",+ "deviceApprovedDescription": "OpenPencil アプリに戻ってください。サインインはすでに反映されています。このタブは閉じてかまいません。",+ "deviceDeniedTitle": "サインインを拒否しました",+ "deviceDeniedDescription": "アプリはサインインしていません。心当たりがない場合は、パスワードを他人に知られている可能性があります。アカウント設定で変更してください。",+ "deviceExpiredTitle": "このコードは期限切れです",+ "deviceExpiredDescription": "新しいコードを取得するには、OpenPencil アプリからもう一度サインインを始めてください。",+ "accountSettings": "アカウント設定",+ "sectionAccount": "あなたのアカウント",+ "sectionServer": "サーバー",+ "security": "サインインとセキュリティ",+ "securityDescription": "{host} へのサインイン方法です。",+ "overview": "概要",+ "accessRequests": "アクセスリクエスト",+ "accessRequestsDescription": "参加を希望している人です。承認するとサインインできるようになります。どちらの場合も本人にメールが届きます。",+ "people": "ユーザー",+ "peopleDescription": {+ "many": "このサーバーのアカウント数:{count}"+ },+ "emailDelivery": "メール配信",+ "emailDeliveryDescription": "サーバーが送信する招待、サインイン用リンク、アクセスの審査結果です。",+ "activity": "アクティビティ",+ "activityDescription": "このサーバーで管理者が行った操作です。",+ "waysToSignIn": "サインイン方法",+ "waysToSignInDescription": "いつでもサインインできるよう、少なくとも1つは残してください。",+ "providerGoogle": "Google",+ "providerApple": "Apple",+ "linkedOn": "{date}にリンク",+ "notLinked": "未リンク",+ "link": "リンク",+ "unlink": "リンクを解除",+ "passwordSet": "メールアドレスとパスワードでサインイン",+ "passwordNotSet": "パスワードを追加すると、メールアドレスでもサインインできます",+ "change": "変更",+ "setPassword": "パスワードを設定",+ "twoStepSection": "2段階認証",+ "twoStepSectionDescription": "パスワードやリンク済みアカウントに加えて、もう1つの確認を求めます。",+ "authenticatorApp": "認証アプリ",+ "authenticatorOn": "オン",+ "authenticatorOff": "1Password や Google Authenticator などのアプリで生成するコード",+ "newRecoveryCodes": "リカバリーコードを再発行",+ "turnOff": "オフにする",+ "setUp": "設定",+ "passkeys": "パスキー",+ "passkeysDescription": "コードの代わりにデバイスの画面ロックでサインインします。",+ "addPasskey": "パスキーを追加",+ "passkeyAdded": "{date}に追加",+ "unnamedPasskey": "パスキー",+ "remove": "削除",+ "noPasskeys": "パスキーはまだありません。",+ "adminTwoStepTitle": "2段階認証をオンにしてください",+ "adminTwoStepDescription": "このサーバーでは、管理者がコンソールを開く前に認証アプリまたはパスキーを使う必要があります。",+ "authenticatorSetupTitle": "認証アプリを設定",+ "authenticatorSetupScan": "認証アプリでこれをスキャンし、表示されたコードを入力してください。",+ "authenticatorSetupKey": "スキャンできない場合はこのキーを入力",+ "recoveryCodesTitle": "リカバリーコードを保存してください",+ "recoveryCodesDescription": "認証アプリを使えなくなった場合、各コードで1回サインインできます。安全な場所に保管してください。再表示はできません。",+ "copyCodes": "コードをコピー",+ "copyKey": "キーをコピー",+ "copied": "コピーしました",+ "done": "完了",+ "cancel": "キャンセル",+ "currentPassword": "現在のパスワード",+ "changePasswordTitle": "パスワードを変更",+ "confirmPasswordTitle": "パスワードで確認",+ "filterWaiting": "保留中",+ "filterApproved": "承認済み",+ "filterDeclined": "却下済み",+ "filterRemoved": "削除済み",+ "statusWaiting": "保留中",+ "statusApproved": "承認済み",+ "statusDeclined": "却下済み",+ "statusRemoved": "アクセス削除済み",+ "asked": "{date}にリクエスト",+ "reviewedBy": "{decision}({name})",+ "decline": "却下",+ "removeAccess": "アクセスを削除",+ "noOneWaiting": "保留中のリクエストはありません",+ "nothingHere": "まだ何もありません",+ "requestsEmptyDescription": "新しいリクエストはここに表示され、そのたびに管理者にメールが届きます。",+ "searchPeople": "ユーザーを検索…",+ "you": "(あなた)",+ "administrator": "管理者",+ "suspended": "停止中",+ "joined": "{date}に参加",+ "actionsFor": "{name}の操作",+ "makeAdministrator": "管理者にする",+ "removeAdministrator": "管理者から外す",+ "signOutEverywhere": "すべての場所からサインアウト",+ "suspendAccount": "アカウントを停止",+ "restoreAccount": "アカウントを復元",+ "emailTo": "宛先: {recipient}",+ "attempts": {+ "many": "{count} 回試行"+ },+ "emailSent": "送信済み",+ "emailWaiting": "送信待ち",+ "emailFailed": "失敗",+ "retry": "再試行",+ "needsAttention": "要対応",+ "waitingRequests": {+ "many": "{count} 人が判断を待っています"+ },+ "noOneIsWaiting": "待っている人はいません",+ "emailStatus": "失敗:{failed} · 待機中:{waiting}",+ "emailWaitingOnly": {+ "many": "送信待ちのメール:{count} 件"+ },+ "emailAllSent": "すべて送信済みです",+ "review": "確認",+ "open": "開く",+ "serverSection": "サーバー",+ "serverSectionDescription": "サーバーの設定ファイルで指定します。",+ "deployment": "デプロイ",+ "deploymentOfficial": "OpenPencil Cloud",+ "deploymentSelfHosted": "セルフホスト",+ "newAccounts": "新しいアカウント",+ "enrollmentOpen": "誰でも参加可能",+ "enrollmentApproval": "管理者が審査",+ "enrollmentClosed": "受付停止",+ "emailTransportNone": "オフ",+ "emailTransportSMTP": "SMTP",+ "emailTransportCloudflare": "Cloudflare Email",+ "someoneElse": "誰か",+ "emailSuppressed": "未送信",+ "emailKindInvitation": "ドキュメントへの招待",+ "emailKindEnrollmentRequested": "アクセスリクエストの受付",+ "emailKindAdminNotification": "新しいアクセスリクエスト(管理者向け)",+ "emailKindEnrollmentApproved": "アクセスの承認",+ "emailKindEnrollmentRejected": "アクセスの却下",+ "emailKindEnrollmentRevoked": "アクセスの削除",+ "emailKindVerification": "メールアドレスの確認",+ "emailKindPasswordReset": "パスワードのリセット",+ "emailKindPasswordChanged": "パスワードの変更",+ "emailKindOther": "メール",+ "activityApproved": "がアクセスを承認:",+ "activityRejected": "がアクセスを却下:",+ "activityRevoked": "がアクセスを削除:",+ "activitySuspended": "がアカウントを停止:",+ "activityRestored": "がアカウントを復元:",+ "activitySignedOut": "がすべての場所からサインアウト:",+ "activityMadeAdmin": "が管理者に設定:",+ "activityRemovedAdmin": "が管理者権限を削除:",+ "activityEmailRetried": "がメールを再送信:",+ "activityChanged": "が変更:",+ "errorTitle": "操作できませんでした",+ "errorLastMethod": "サインイン方法を少なくとも1つ残してください。",+ "errorSessionNotFresh": "安全のため、この変更を行う前にもう一度サインインしてください。",+ "errorLastAdmin": "サーバーには少なくとも1人の管理者が必要です。",+ "errorSelfAction": "自分のアカウントにはこの操作を行えません。",+ "errorTwoStepRequired": "先に2段階認証をオンにしてください。",+ "errorNotAllowed": "この操作を行う権限がありません。",+ "errorNetwork": "サーバーに接続できませんでした。接続を確認してください。",+ "errorAlreadyDecided": "このリクエストはすでに他の人が対応しました。更新して確認してください。",+ "passwordResetSent": "パスワードを設定するためのリンクをメールでお送りしました。"+}diff --git a/packages/vue/src/i18n/locales/ja/index.ts b/packages/vue/src/i18n/locales/ja/index.tsindex 44dc76dfb..e6d27db01 100644--- a/packages/vue/src/i18n/locales/ja/index.ts+++ b/packages/vue/src/i18n/locales/ja/index.ts@@ -2,6 +2,7 @@ import type { ComponentsJSON } from '@nanostores/i18n'import ai from './ai.json'import automation from './automation.json'+import cloudPortal from './cloud-portal.json'import code from './code.json'import collaboration from './collaboration.json'import commands from './commands.json'@@ -31,6 +32,7 @@ import variables from './variables.json'export default {ai,automation,+ cloudPortal,code,collaboration,commands,diff --git a/packages/vue/src/i18n/locales/pl/cloud-portal.json b/packages/vue/src/i18n/locales/pl/cloud-portal.jsonnew file mode 100644index 000000000..8ff3c865d--- /dev/null+++ b/packages/vue/src/i18n/locales/pl/cloud-portal.json@@ -0,0 +1,243 @@+{+ "productName": "OpenPencil Cloud",+ "loading": "Ładowanie…",+ "unavailableTitle": "Ten serwer nie odpowiada",+ "unavailableDescription": "Sprawdź adres lub spróbuj ponownie za chwilę.",+ "tryAgain": "Spróbuj ponownie",+ "signInTitle": "Zaloguj się do OpenPencil Cloud",+ "signUpTitle": "Utwórz konto",+ "signInWelcome": "Witaj ponownie.",+ "signUpDescription": "Utwórz konto na tym serwerze.",+ "returnsTo": "Następnie wrócisz do {destination}.",+ "returnsToDesktop": "aplikacji OpenPencil",+ "returnsToEditor": "edytora",+ "continueWithGoogle": "Kontynuuj z Google",+ "continueWithApple": "Kontynuuj z Apple",+ "or": "lub",+ "name": "Imię",+ "email": "E-mail",+ "emailPlaceholder": "[email protected]",+ "password": "Hasło",+ "passwordHint": "Minimalna liczba znaków: {count}.",+ "forgotPassword": "Nie pamiętasz hasła?",+ "signIn": "Zaloguj się",+ "createAccount": "Utwórz konto",+ "haveAccount": "Masz już konto?",+ "newHere": "Pierwszy raz tutaj?",+ "createAnAccount": "Utwórz konto",+ "approvalTitle": "Nowe konta sprawdza administrator",+ "approvalDescription": "Zalogujesz się, gdy Twoja prośba zostanie zatwierdzona. Powiadomimy Cię o tym e-mailem.",+ "signInFailed": "Nie udało się zalogować",+ "noSignInMethods": "Ten serwer nie oferuje jeszcze żadnej metody logowania. Zapytaj jego administratora.",+ "failureInvalidCredentials": "Nieprawidłowy e-mail lub hasło.",+ "failureEmailNotVerified": "Najpierw potwierdź adres e-mail. Możemy wysłać link ponownie.",+ "failurePasswordTooShort": "Hasło jest za krótkie.",+ "failurePasswordTooLong": "Hasło jest za długie.",+ "failureInvalidLink": "Ten link wygasł lub został już użyty. Poproś o nowy.",+ "failureInvalidCode": "Ten kod nie zadziałał. Sprawdź go i spróbuj ponownie.",+ "failurePasskeyCancelled": "Konfiguracja klucza dostępu została anulowana.",+ "failurePasskeyExists": "To urządzenie ma już klucz dostępu do Twojego konta.",+ "failurePasskeyUnavailable": "Ta przeglądarka nie mogła utworzyć klucza dostępu dla tego adresu. Spróbuj innej przeglądarki lub użyj aplikacji uwierzytelniającej.",+ "failureRateLimited": "Zbyt wiele prób. Odczekaj minutę i spróbuj ponownie.",+ "failureUnavailable": "Na serwerze coś poszło nie tak. Spróbuj ponownie za chwilę.",+ "failureCancelled": "Logowanie zostało anulowane.",+ "failureEnrollmentClosed": "Ten serwer nie przyjmuje nowych kont.",+ "checkEmailTitle": "Sprawdź skrzynkę",+ "checkEmailDescription": "Wysłaliśmy link na adres {email}. Otwórz go na tym urządzeniu, aby dokończyć tworzenie konta.",+ "sendAgain": "Wyślij ponownie",+ "sent": "Wysłano",+ "useAnotherEmail": "Użyj innego adresu e-mail",+ "pendingTitle": "Twoja prośba czeka na administratora",+ "pendingDescription": "Napiszemy na adres {email}, gdy będzie można się zalogować. Na razie nic więcej nie musisz robić.",+ "closedTitle": "Nie możesz korzystać z tego serwera",+ "closedDescription": "Administrator odrzucił Twoją prośbę lub odebrał Ci dostęp. Jeśli uważasz, że to pomyłka, skontaktuj się z nim.",+ "signOut": "Wyloguj się",+ "twoStepTitle": "Potwierdź, że to Ty",+ "twoStepAuthenticator": "Wpisz 6-cyfrowy kod z aplikacji uwierzytelniającej.",+ "twoStepRecovery": "Wpisz jeden z zapisanych kodów odzyskiwania. Każdy działa tylko raz.",+ "authenticationCode": "Kod uwierzytelniający",+ "recoveryCode": "Kod odzyskiwania",+ "continue": "Dalej",+ "useRecoveryCode": "Użyj kodu odzyskiwania",+ "useAuthenticator": "Użyj aplikacji uwierzytelniającej",+ "usePasskey": "Użyj klucza dostępu",+ "resetTitle": "Zresetuj hasło",+ "resetDescription": "Wyślemy Ci e-mailem link do ustawienia nowego.",+ "chooseTitle": "Ustaw nowe hasło",+ "chooseDescription": "Po zapisaniu wszystkie inne sesje zostaną wylogowane.",+ "newPassword": "Nowe hasło",+ "sendLink": "Wyślij link",+ "savePassword": "Zapisz hasło",+ "backToSignIn": "Wróć do logowania",+ "resetSentTitle": "Sprawdź skrzynkę",+ "resetSentDescription": "Jeśli adres {email} ma tu konto, link do resetu jest już w drodze.",+ "deviceTitle": "Zalogować się w aplikacji OpenPencil?",+ "deviceDescription": "Aplikacja OpenPencil prosi o dostęp do Twojego konta {email}.",+ "deviceCheckCode": "Sprawdź, czy aplikacja wyświetla ten kod",+ "deviceWarningTitle": "Zatwierdzaj tylko logowanie rozpoczęte przez Ciebie",+ "deviceWarningDescription": "Jeśli nie logujesz się właśnie do OpenPencil na komputerze, odrzuć tę prośbę.",+ "approve": "Zatwierdź",+ "deny": "Odrzuć",+ "deviceApprovedTitle": "Zalogowano",+ "deviceApprovedDescription": "Wróć do aplikacji OpenPencil — logowanie zostało już w niej uwzględnione. Możesz zamknąć tę kartę.",+ "deviceDeniedTitle": "Odrzucono logowanie",+ "deviceDeniedDescription": "Aplikacja nie została zalogowana. Jeśli logowanie nie pochodziło od Ciebie, ktoś może znać Twoje hasło — zmień je w ustawieniach konta.",+ "deviceExpiredTitle": "Ten kod wygasł",+ "deviceExpiredDescription": "Rozpocznij logowanie w aplikacji OpenPencil ponownie, aby otrzymać nowy kod.",+ "accountSettings": "Ustawienia konta",+ "sectionAccount": "Twoje konto",+ "sectionServer": "Serwer",+ "security": "Logowanie i bezpieczeństwo",+ "securityDescription": "Jak logujesz się do {host}.",+ "overview": "Przegląd",+ "accessRequests": "Prośby o dostęp",+ "accessRequestsDescription": "Osoby, które chcą dołączyć. Zatwierdzenie pozwala im się zalogować; w obu przypadkach każda z nich dostaje e-mail.",+ "people": "Użytkownicy",+ "peopleDescription": {+ "one": "{count} konto na tym serwerze.",+ "few": "{count} konta na tym serwerze.",+ "many": "{count} kont na tym serwerze."+ },+ "emailDelivery": "Wysyłka e-maili",+ "emailDeliveryDescription": "Zaproszenia, linki do logowania i decyzje o dostępie wysyłane przez serwer.",+ "activity": "Aktywność",+ "activityDescription": "Działania administratorów na tym serwerze.",+ "waysToSignIn": "Metody logowania",+ "waysToSignInDescription": "Zachowaj co najmniej jedną, aby zawsze móc się zalogować.",+ "providerGoogle": "Google",+ "providerApple": "Apple",+ "linkedOn": "Połączono {date}",+ "notLinked": "Niepołączone",+ "link": "Połącz",+ "unlink": "Odłącz",+ "passwordSet": "Logowanie adresem e-mail i hasłem",+ "passwordNotSet": "Dodaj hasło, aby logować się także adresem e-mail",+ "change": "Zmień",+ "setPassword": "Ustaw hasło",+ "twoStepSection": "Logowanie dwuetapowe",+ "twoStepSectionDescription": "Wymagaj drugiego potwierdzenia po haśle lub połączonym koncie.",+ "authenticatorApp": "Aplikacja uwierzytelniająca",+ "authenticatorOn": "Włączona",+ "authenticatorOff": "Kody z aplikacji, takiej jak 1Password lub Google Authenticator",+ "newRecoveryCodes": "Nowe kody odzyskiwania",+ "turnOff": "Wyłącz",+ "setUp": "Skonfiguruj",+ "passkeys": "Klucze dostępu",+ "passkeysDescription": "Loguj się blokadą ekranu urządzenia zamiast kodem.",+ "addPasskey": "Dodaj klucz dostępu",+ "passkeyAdded": "Dodano {date}",+ "unnamedPasskey": "Klucz dostępu",+ "remove": "Usuń",+ "noPasskeys": "Brak kluczy dostępu.",+ "adminTwoStepTitle": "Włącz drugi etap logowania",+ "adminTwoStepDescription": "Ten serwer wymaga, aby administratorzy przed otwarciem konsoli używali aplikacji uwierzytelniającej lub klucza dostępu.",+ "authenticatorSetupTitle": "Skonfiguruj aplikację uwierzytelniającą",+ "authenticatorSetupScan": "Zeskanuj to w aplikacji uwierzytelniającej, a następnie wpisz wyświetlony w niej kod.",+ "authenticatorSetupKey": "Nie możesz zeskanować? Wpisz ten klucz",+ "recoveryCodesTitle": "Zapisz kody odzyskiwania",+ "recoveryCodesDescription": "Każdy kod pozwala zalogować się raz, jeśli stracisz aplikację uwierzytelniającą. Przechowuj je w bezpiecznym miejscu — nie zostaną pokazane ponownie.",+ "copyCodes": "Kopiuj kody",+ "copyKey": "Kopiuj klucz",+ "copied": "Skopiowano",+ "done": "Gotowe",+ "cancel": "Anuluj",+ "currentPassword": "Obecne hasło",+ "changePasswordTitle": "Zmień hasło",+ "confirmPasswordTitle": "Potwierdź hasłem",+ "filterWaiting": "Oczekujące",+ "filterApproved": "Zatwierdzone",+ "filterDeclined": "Odrzucone",+ "filterRemoved": "Odebrany dostęp",+ "statusWaiting": "Oczekuje",+ "statusApproved": "Zatwierdzono",+ "statusDeclined": "Odrzucono",+ "statusRemoved": "Odebrano dostęp",+ "asked": "Zgłoszono {date}",+ "reviewedBy": "{decision} ({name})",+ "decline": "Odrzuć",+ "removeAccess": "Odbierz dostęp",+ "noOneWaiting": "Nikt nie czeka",+ "nothingHere": "Nic tu jeszcze nie ma",+ "requestsEmptyDescription": "Nowe prośby pojawią się tutaj, a administratorzy dostaną e-mail o każdej z nich.",+ "searchPeople": "Szukaj użytkowników…",+ "you": "(ty)",+ "administrator": "Administrator",+ "suspended": "Zawieszono",+ "joined": "Konto od {date}",+ "actionsFor": "Działania: {name}",+ "makeAdministrator": "Nadaj uprawnienia administratora",+ "removeAdministrator": "Odbierz uprawnienia administratora",+ "signOutEverywhere": "Wyloguj ze wszystkich urządzeń",+ "suspendAccount": "Zawieś konto",+ "restoreAccount": "Przywróć konto",+ "emailTo": "Do: {recipient}",+ "attempts": {+ "one": "{count} próba",+ "few": "{count} próby",+ "many": "{count} prób"+ },+ "emailSent": "Wysłano",+ "emailWaiting": "Oczekuje",+ "emailFailed": "Błąd",+ "retry": "Ponów",+ "needsAttention": "Wymaga uwagi",+ "waitingRequests": {+ "one": "{count} osoba czeka na decyzję",+ "few": "{count} osoby czekają na decyzję",+ "many": "{count} osób czeka na decyzję"+ },+ "noOneIsWaiting": "Nikt nie czeka",+ "emailStatus": "Nieudane: {failed} · Oczekujące: {waiting}",+ "emailWaitingOnly": {+ "one": "{count} wiadomość czeka na wysłanie",+ "few": "{count} wiadomości czekają na wysłanie",+ "many": "{count} wiadomości czeka na wysłanie"+ },+ "emailAllSent": "Wszystko zostało wysłane",+ "review": "Przejrzyj",+ "open": "Otwórz",+ "serverSection": "Serwer",+ "serverSectionDescription": "Ustawiane w pliku konfiguracyjnym serwera.",+ "deployment": "Wdrożenie",+ "deploymentOfficial": "OpenPencil Cloud",+ "deploymentSelfHosted": "Własny serwer",+ "newAccounts": "Nowe konta",+ "enrollmentOpen": "Każdy może dołączyć",+ "enrollmentApproval": "Sprawdzane przez administratora",+ "enrollmentClosed": "Zamknięte",+ "emailTransportNone": "Wyłączone",+ "emailTransportSMTP": "SMTP",+ "emailTransportCloudflare": "Cloudflare Email",+ "someoneElse": "Ktoś",+ "emailSuppressed": "Nie wysłano",+ "emailKindInvitation": "Zaproszenie do dokumentu",+ "emailKindEnrollmentRequested": "Otrzymano prośbę o dostęp",+ "emailKindAdminNotification": "Nowa prośba o dostęp (administratorzy)",+ "emailKindEnrollmentApproved": "Dostęp zatwierdzony",+ "emailKindEnrollmentRejected": "Dostęp odrzucony",+ "emailKindEnrollmentRevoked": "Dostęp odebrany",+ "emailKindVerification": "Potwierdź adres e-mail",+ "emailKindPasswordReset": "Zresetuj hasło",+ "emailKindPasswordChanged": "Hasło zmienione",+ "emailKindOther": "E-mail",+ "activityApproved": "— zatwierdzenie dostępu:",+ "activityRejected": "— odrzucenie dostępu:",+ "activityRevoked": "— odebranie dostępu:",+ "activitySuspended": "— zawieszenie konta:",+ "activityRestored": "— przywrócenie konta:",+ "activitySignedOut": "— wylogowanie ze wszystkich urządzeń:",+ "activityMadeAdmin": "— nadanie uprawnień administratora:",+ "activityRemovedAdmin": "— odebranie uprawnień administratora:",+ "activityEmailRetried": "— ponowna wysyłka e-maila do:",+ "activityChanged": "— zmiana:",+ "errorTitle": "Nie udało się",+ "errorLastMethod": "Zachowaj co najmniej jedną metodę logowania.",+ "errorSessionNotFresh": "Ze względów bezpieczeństwa zaloguj się ponownie przed wprowadzeniem tej zmiany.",+ "errorLastAdmin": "Serwer potrzebuje co najmniej jednego administratora.",+ "errorSelfAction": "Nie możesz tego zrobić z własnym kontem.",+ "errorTwoStepRequired": "Najpierw włącz logowanie dwuetapowe.",+ "errorNotAllowed": "Nie masz uprawnień do wykonania tej czynności.",+ "errorNetwork": "Nie udało się połączyć z serwerem. Sprawdź połączenie.",+ "errorAlreadyDecided": "Ktoś już rozpatrzył tę prośbę. Odśwież stronę, aby zobaczyć decyzję.",+ "passwordResetSent": "Wysłaliśmy Ci link do ustawienia hasła."+}diff --git a/packages/vue/src/i18n/locales/pl/index.ts b/packages/vue/src/i18n/locales/pl/index.tsindex 44dc76dfb..e6d27db01 100644--- a/packages/vue/src/i18n/locales/pl/index.ts+++ b/packages/vue/src/i18n/locales/pl/index.ts@@ -2,6 +2,7 @@ import type { ComponentsJSON } from '@nanostores/i18n'import ai from './ai.json'import automation from './automation.json'+import cloudPortal from './cloud-portal.json'import code from './code.json'import collaboration from './collaboration.json'import commands from './commands.json'@@ -31,6 +32,7 @@ import variables from './variables.json'export default {ai,automation,+ cloudPortal,code,collaboration,commands,diff --git a/packages/vue/src/i18n/locales/ru/cloud-portal.json b/packages/vue/src/i18n/locales/ru/cloud-portal.jsonnew file mode 100644index 000000000..7b0585ad2--- /dev/null+++ b/packages/vue/src/i18n/locales/ru/cloud-portal.json@@ -0,0 +1,243 @@+{+ "productName": "OpenPencil Cloud",+ "loading": "Загрузка…",+ "unavailableTitle": "Сервер не отвечает",+ "unavailableDescription": "Проверьте адрес или попробуйте чуть позже.",+ "tryAgain": "Попробовать снова",+ "signInTitle": "Вход в OpenPencil Cloud",+ "signUpTitle": "Создание аккаунта",+ "signInWelcome": "С возвращением.",+ "signUpDescription": "Создайте аккаунт на этом сервере.",+ "returnsTo": "Затем вы вернётесь в {destination}.",+ "returnsToDesktop": "приложение OpenPencil",+ "returnsToEditor": "редактор",+ "continueWithGoogle": "Продолжить с Google",+ "continueWithApple": "Продолжить с Apple",+ "or": "или",+ "name": "Имя",+ "email": "Электронная почта",+ "emailPlaceholder": "[email protected]",+ "password": "Пароль",+ "passwordHint": "Минимум символов: {count}.",+ "forgotPassword": "Забыли пароль?",+ "signIn": "Войти",+ "createAccount": "Создать аккаунт",+ "haveAccount": "Уже есть аккаунт?",+ "newHere": "Впервые здесь?",+ "createAnAccount": "Создать аккаунт",+ "approvalTitle": "Новые аккаунты проверяет администратор",+ "approvalDescription": "Вы сможете войти, когда заявку одобрят. Мы сообщим об этом по почте.",+ "signInFailed": "Не удалось войти",+ "noSignInMethods": "На этом сервере пока нет способов входа. Обратитесь к его администратору.",+ "failureInvalidCredentials": "Неверная почта или пароль.",+ "failureEmailNotVerified": "Сначала подтвердите почту. Мы можем отправить ссылку ещё раз.",+ "failurePasswordTooShort": "Слишком короткий пароль.",+ "failurePasswordTooLong": "Слишком длинный пароль.",+ "failureInvalidLink": "Срок действия ссылки истёк, или она уже использована. Запросите новую.",+ "failureInvalidCode": "Код не подошёл. Проверьте его и попробуйте снова.",+ "failurePasskeyCancelled": "Настройка ключа доступа отменена.",+ "failurePasskeyExists": "На этом устройстве уже есть ключ доступа для вашего аккаунта.",+ "failurePasskeyUnavailable": "Этот браузер не смог создать ключ доступа для этого адреса. Попробуйте другой браузер или приложение-аутентификатор.",+ "failureRateLimited": "Слишком много попыток. Подождите минуту и попробуйте снова.",+ "failureUnavailable": "На сервере что-то пошло не так. Попробуйте чуть позже.",+ "failureCancelled": "Вход отменён.",+ "failureEnrollmentClosed": "Этот сервер не принимает новые аккаунты.",+ "checkEmailTitle": "Проверьте почту",+ "checkEmailDescription": "Мы отправили ссылку на {email}. Откройте её на этом устройстве, чтобы завершить создание аккаунта.",+ "sendAgain": "Отправить снова",+ "sent": "Отправлено",+ "useAnotherEmail": "Указать другую почту",+ "pendingTitle": "Ваша заявка у администратора",+ "pendingDescription": "Мы напишем на {email}, когда вы сможете войти. Пока ничего делать не нужно.",+ "closedTitle": "Этот сервер вам недоступен",+ "closedDescription": "Администратор отклонил заявку или закрыл вам доступ. Если считаете это ошибкой, свяжитесь с ним.",+ "signOut": "Выйти",+ "twoStepTitle": "Подтвердите, что это вы",+ "twoStepAuthenticator": "Введите 6-значный код из приложения-аутентификатора.",+ "twoStepRecovery": "Введите один из сохранённых резервных кодов. Каждый действует только один раз.",+ "authenticationCode": "Код подтверждения",+ "recoveryCode": "Резервный код",+ "continue": "Продолжить",+ "useRecoveryCode": "Использовать резервный код",+ "useAuthenticator": "Использовать приложение-аутентификатор",+ "usePasskey": "Использовать ключ доступа",+ "resetTitle": "Сброс пароля",+ "resetDescription": "Мы отправим вам ссылку, чтобы задать новый.",+ "chooseTitle": "Новый пароль",+ "chooseDescription": "После сохранения вы выйдете на всех остальных устройствах.",+ "newPassword": "Новый пароль",+ "sendLink": "Отправить ссылку",+ "savePassword": "Сохранить пароль",+ "backToSignIn": "Вернуться ко входу",+ "resetSentTitle": "Проверьте почту",+ "resetSentDescription": "Если для {email} здесь есть аккаунт, ссылка для сброса уже в пути.",+ "deviceTitle": "Войти в приложение OpenPencil?",+ "deviceDescription": "Приложение OpenPencil запрашивает доступ к вашему аккаунту {email}.",+ "deviceCheckCode": "Убедитесь, что приложение показывает этот код",+ "deviceWarningTitle": "Одобряйте только вход, который начали сами",+ "deviceWarningDescription": "Если вы только что не входили в OpenPencil на компьютере, отклоните запрос.",+ "approve": "Одобрить",+ "deny": "Отклонить",+ "deviceApprovedTitle": "Вы вошли",+ "deviceApprovedDescription": "Вернитесь в приложение OpenPencil — оно уже получило доступ. Эту вкладку можно закрыть.",+ "deviceDeniedTitle": "Вход отклонён",+ "deviceDeniedDescription": "Приложение не получило доступ. Если вход начинали не вы, кто-то может знать ваш пароль — смените его в настройках аккаунта.",+ "deviceExpiredTitle": "Срок действия кода истёк",+ "deviceExpiredDescription": "Начните вход в приложении OpenPencil заново, чтобы получить новый код.",+ "accountSettings": "Настройки аккаунта",+ "sectionAccount": "Ваш аккаунт",+ "sectionServer": "Сервер",+ "security": "Вход и безопасность",+ "securityDescription": "Как вы входите на {host}.",+ "overview": "Обзор",+ "accessRequests": "Заявки на доступ",+ "accessRequestsDescription": "Люди, которые хотят присоединиться. После одобрения они смогут войти; в любом случае каждый получит письмо.",+ "people": "Пользователи",+ "peopleDescription": {+ "one": "{count} аккаунт на этом сервере.",+ "few": "{count} аккаунта на этом сервере.",+ "many": "{count} аккаунтов на этом сервере."+ },+ "emailDelivery": "Отправка писем",+ "emailDeliveryDescription": "Приглашения, ссылки для входа и решения о доступе, которые отправляет сервер.",+ "activity": "Журнал действий",+ "activityDescription": "Действия администраторов на этом сервере.",+ "waysToSignIn": "Способы входа",+ "waysToSignInDescription": "Оставьте хотя бы один, чтобы всегда можно было войти.",+ "providerGoogle": "Google",+ "providerApple": "Apple",+ "linkedOn": "Привязан {date}",+ "notLinked": "Не привязан",+ "link": "Привязать",+ "unlink": "Отвязать",+ "passwordSet": "Вход по почте и паролю",+ "passwordNotSet": "Добавьте пароль, чтобы входить и по почте",+ "change": "Изменить",+ "setPassword": "Задать пароль",+ "twoStepSection": "Двухэтапный вход",+ "twoStepSectionDescription": "Запрашивать второе подтверждение после пароля или привязанного аккаунта.",+ "authenticatorApp": "Приложение-аутентификатор",+ "authenticatorOn": "Включено",+ "authenticatorOff": "Коды из приложения, например 1Password или Google Authenticator",+ "newRecoveryCodes": "Новые резервные коды",+ "turnOff": "Отключить",+ "setUp": "Настроить",+ "passkeys": "Ключи доступа",+ "passkeysDescription": "Входите с помощью блокировки экрана устройства вместо кода.",+ "addPasskey": "Добавить ключ доступа",+ "passkeyAdded": "Добавлен {date}",+ "unnamedPasskey": "Ключ доступа",+ "remove": "Удалить",+ "noPasskeys": "Ключей доступа пока нет.",+ "adminTwoStepTitle": "Включите второй этап входа",+ "adminTwoStepDescription": "Чтобы открыть консоль, администраторы этого сервера должны использовать приложение-аутентификатор или ключ доступа.",+ "authenticatorSetupTitle": "Настройка приложения-аутентификатора",+ "authenticatorSetupScan": "Отсканируйте это изображение приложением-аутентификатором и введите код, который оно покажет.",+ "authenticatorSetupKey": "Не получается отсканировать? Введите этот ключ",+ "recoveryCodesTitle": "Сохраните резервные коды",+ "recoveryCodesDescription": "Каждый код позволяет войти один раз, если вы потеряете аутентификатор. Храните их в надёжном месте — больше они показаны не будут.",+ "copyCodes": "Скопировать коды",+ "copyKey": "Скопировать ключ",+ "copied": "Скопировано",+ "done": "Готово",+ "cancel": "Отмена",+ "currentPassword": "Текущий пароль",+ "changePasswordTitle": "Смена пароля",+ "confirmPasswordTitle": "Подтвердите паролем",+ "filterWaiting": "Ожидают",+ "filterApproved": "Одобренные",+ "filterDeclined": "Отклонённые",+ "filterRemoved": "Отозванные",+ "statusWaiting": "Ожидает",+ "statusApproved": "Одобрено",+ "statusDeclined": "Отклонено",+ "statusRemoved": "Доступ отозван",+ "asked": "Заявка от {date}",+ "reviewedBy": "{decision} ({name})",+ "decline": "Отклонить",+ "removeAccess": "Отозвать доступ",+ "noOneWaiting": "Никто не ждёт",+ "nothingHere": "Здесь пока пусто",+ "requestsEmptyDescription": "Новые заявки появятся здесь, а администраторы получат письмо о каждой.",+ "searchPeople": "Поиск пользователей…",+ "you": "(вы)",+ "administrator": "Администратор",+ "suspended": "Заблокирован",+ "joined": "Регистрация: {date}",+ "actionsFor": "Действия: {name}",+ "makeAdministrator": "Сделать администратором",+ "removeAdministrator": "Снять права администратора",+ "signOutEverywhere": "Выйти на всех устройствах",+ "suspendAccount": "Заблокировать аккаунт",+ "restoreAccount": "Восстановить аккаунт",+ "emailTo": "Кому: {recipient}",+ "attempts": {+ "one": "{count} попытка",+ "few": "{count} попытки",+ "many": "{count} попыток"+ },+ "emailSent": "Отправлено",+ "emailWaiting": "В очереди",+ "emailFailed": "Ошибка",+ "retry": "Повторить",+ "needsAttention": "Требует внимания",+ "waitingRequests": {+ "one": "{count} человек ждёт решения",+ "few": "{count} человека ждут решения",+ "many": "{count} человек ждут решения"+ },+ "noOneIsWaiting": "Никто не ждёт",+ "emailStatus": "Не отправлено: {failed} · В очереди: {waiting}",+ "emailWaitingOnly": {+ "one": "{count} письмо ждёт отправки",+ "few": "{count} письма ждут отправки",+ "many": "{count} писем ждут отправки"+ },+ "emailAllSent": "Всё отправлено",+ "review": "Рассмотреть",+ "open": "Открыть",+ "serverSection": "Сервер",+ "serverSectionDescription": "Задаётся в файле конфигурации сервера.",+ "deployment": "Развёртывание",+ "deploymentOfficial": "OpenPencil Cloud",+ "deploymentSelfHosted": "Собственный сервер",+ "newAccounts": "Новые аккаунты",+ "enrollmentOpen": "Присоединиться может любой",+ "enrollmentApproval": "С одобрения администратора",+ "enrollmentClosed": "Закрыто",+ "emailTransportNone": "Отключено",+ "emailTransportSMTP": "SMTP",+ "emailTransportCloudflare": "Cloudflare Email",+ "someoneElse": "Кто-то",+ "emailSuppressed": "Не отправлено",+ "emailKindInvitation": "Приглашение в документ",+ "emailKindEnrollmentRequested": "Заявка на доступ получена",+ "emailKindAdminNotification": "Новая заявка на доступ (администраторам)",+ "emailKindEnrollmentApproved": "Доступ одобрен",+ "emailKindEnrollmentRejected": "В доступе отказано",+ "emailKindEnrollmentRevoked": "Доступ отозван",+ "emailKindVerification": "Подтверждение почты",+ "emailKindPasswordReset": "Сброс пароля",+ "emailKindPasswordChanged": "Пароль изменён",+ "emailKindOther": "Письмо",+ "activityApproved": "— одобрение доступа:",+ "activityRejected": "— отказ в доступе:",+ "activityRevoked": "— отзыв доступа:",+ "activitySuspended": "— блокировка аккаунта:",+ "activityRestored": "— восстановление аккаунта:",+ "activitySignedOut": "— выход на всех устройствах:",+ "activityMadeAdmin": "— назначение администратором:",+ "activityRemovedAdmin": "— снятие прав администратора:",+ "activityEmailRetried": "— повторная отправка письма:",+ "activityChanged": "— изменение:",+ "errorTitle": "Не получилось",+ "errorLastMethod": "Оставьте хотя бы один способ входа.",+ "errorSessionNotFresh": "В целях безопасности войдите снова, прежде чем вносить это изменение.",+ "errorLastAdmin": "На сервере должен быть хотя бы один администратор.",+ "errorSelfAction": "Это действие нельзя применить к своему аккаунту.",+ "errorTwoStepRequired": "Сначала включите двухэтапный вход.",+ "errorNotAllowed": "У вас нет прав на это действие.",+ "errorNetwork": "Не удалось связаться с сервером. Проверьте подключение.",+ "errorAlreadyDecided": "По этой заявке уже приняли решение. Обновите страницу, чтобы его увидеть.",+ "passwordResetSent": "Мы отправили вам ссылку для установки пароля."+}diff --git a/packages/vue/src/i18n/locales/ru/index.ts b/packages/vue/src/i18n/locales/ru/index.tsindex 44dc76dfb..e6d27db01 100644--- a/packages/vue/src/i18n/locales/ru/index.ts+++ b/packages/vue/src/i18n/locales/ru/index.ts@@ -2,6 +2,7 @@ import type { ComponentsJSON } from '@nanostores/i18n'import ai from './ai.json'import automation from './automation.json'+import cloudPortal from './cloud-portal.json'import code from './code.json'import collaboration from './collaboration.json'import commands from './commands.json'@@ -31,6 +32,7 @@ import variables from './variables.json'export default {ai,automation,+ cloudPortal,code,collaboration,commands,diff --git a/packages/vue/src/i18n/locales/zh-cn/cloud-portal.json b/packages/vue/src/i18n/locales/zh-cn/cloud-portal.jsonnew file mode 100644index 000000000..2fe8b5c19--- /dev/null+++ b/packages/vue/src/i18n/locales/zh-cn/cloud-portal.json@@ -0,0 +1,235 @@+{+ "productName": "OpenPencil Cloud",+ "loading": "正在加载…",+ "unavailableTitle": "此服务器没有响应",+ "unavailableDescription": "请检查地址,或稍后重试。",+ "tryAgain": "重试",+ "signInTitle": "登录 OpenPencil Cloud",+ "signUpTitle": "创建账号",+ "signInWelcome": "欢迎回来。",+ "signUpDescription": "在此服务器上创建账号。",+ "returnsTo": "完成后将返回{destination}。",+ "returnsToDesktop": "OpenPencil 应用",+ "returnsToEditor": "编辑器",+ "continueWithGoogle": "使用 Google 继续",+ "continueWithApple": "使用 Apple 继续",+ "or": "或",+ "name": "名字",+ "email": "邮箱",+ "emailPlaceholder": "[email protected]",+ "password": "密码",+ "passwordHint": "至少 {count} 个字符。",+ "forgotPassword": "忘记密码?",+ "signIn": "登录",+ "createAccount": "创建账号",+ "haveAccount": "已有账号?",+ "newHere": "第一次来?",+ "createAnAccount": "创建账号",+ "approvalTitle": "新账号需经管理员审核",+ "approvalDescription": "申请获批后即可登录。获批时我们会发邮件通知你。",+ "signInFailed": "无法登录",+ "noSignInMethods": "此服务器尚未提供登录方式。请联系管理员。",+ "failureInvalidCredentials": "邮箱或密码错误。",+ "failureEmailNotVerified": "请先验证邮箱。我们可以重新发送链接。",+ "failurePasswordTooShort": "密码太短。",+ "failurePasswordTooLong": "密码太长。",+ "failureInvalidLink": "此链接已过期或已被使用。请重新获取。",+ "failureInvalidCode": "验证码无效。请检查后重试。",+ "failurePasskeyCancelled": "已取消设置通行密钥。",+ "failurePasskeyExists": "此设备已有你的账号的通行密钥。",+ "failurePasskeyUnavailable": "此浏览器无法为该地址创建通行密钥。请换一个浏览器,或使用身份验证器应用。",+ "failureRateLimited": "尝试次数过多。请等待一分钟后重试。",+ "failureUnavailable": "服务器出现问题。请稍后重试。",+ "failureCancelled": "登录已取消。",+ "failureEnrollmentClosed": "此服务器不接受新账号。",+ "checkEmailTitle": "请查收邮件",+ "checkEmailDescription": "我们已向 {email} 发送链接。请在此设备上打开链接以完成账号创建。",+ "sendAgain": "重新发送",+ "sent": "已发送",+ "useAnotherEmail": "使用其他邮箱",+ "pendingTitle": "你的申请正在等待管理员处理",+ "pendingDescription": "可以登录时,我们会发邮件到 {email}。目前无需其他操作。",+ "closedTitle": "你无法使用此服务器",+ "closedDescription": "管理员拒绝或移除了你的访问权限。如果你认为这是误操作,请联系管理员。",+ "signOut": "退出登录",+ "twoStepTitle": "确认是你本人",+ "twoStepAuthenticator": "请输入身份验证器应用中的 6 位验证码。",+ "twoStepRecovery": "请输入一个你保存的恢复码。每个恢复码只能使用一次。",+ "authenticationCode": "验证码",+ "recoveryCode": "恢复码",+ "continue": "继续",+ "useRecoveryCode": "使用恢复码",+ "useAuthenticator": "使用身份验证器应用",+ "usePasskey": "使用通行密钥",+ "resetTitle": "重置密码",+ "resetDescription": "我们会向你发送一封邮件,其中包含设置新密码的链接。",+ "chooseTitle": "设置新密码",+ "chooseDescription": "保存后,你在其他所有地方的登录都将退出。",+ "newPassword": "新密码",+ "sendLink": "发送链接",+ "savePassword": "保存密码",+ "backToSignIn": "返回登录",+ "resetSentTitle": "请查收邮件",+ "resetSentDescription": "如果 {email} 在此注册过账号,重置链接已发出。",+ "deviceTitle": "登录 OpenPencil 应用?",+ "deviceDescription": "OpenPencil 应用请求使用你的账号 {email}。",+ "deviceCheckCode": "请确认应用中显示的是此代码",+ "deviceWarningTitle": "只批准你自己发起的登录",+ "deviceWarningDescription": "如果你刚才没有在电脑上登录 OpenPencil,请拒绝此请求。",+ "approve": "批准",+ "deny": "拒绝",+ "deviceApprovedTitle": "你已登录",+ "deviceApprovedDescription": "请返回 OpenPencil 应用,它已完成登录。你可以关闭此标签页。",+ "deviceDeniedTitle": "已拒绝登录",+ "deviceDeniedDescription": "应用未登录。如果这不是你发起的,可能有人知道你的密码,请在账号设置中修改密码。",+ "deviceExpiredTitle": "此代码已过期",+ "deviceExpiredDescription": "请在 OpenPencil 应用中重新开始登录,以获取新代码。",+ "accountSettings": "账号设置",+ "sectionAccount": "你的账号",+ "sectionServer": "服务器",+ "security": "登录与安全",+ "securityDescription": "你登录 {host} 的方式。",+ "overview": "概览",+ "accessRequests": "访问申请",+ "accessRequestsDescription": "申请加入的人。批准后即可登录;无论结果如何,对方都会收到邮件。",+ "people": "成员",+ "peopleDescription": {+ "many": "此服务器上有 {count} 个账户。"+ },+ "emailDelivery": "邮件投递",+ "emailDeliveryDescription": "服务器发送的邀请、登录链接和访问审核结果。",+ "activity": "活动",+ "activityDescription": "管理员在此服务器上执行的操作。",+ "waysToSignIn": "登录方式",+ "waysToSignInDescription": "请至少保留一种,以便随时能重新登录。",+ "providerGoogle": "Google",+ "providerApple": "Apple",+ "linkedOn": "关联于 {date}",+ "notLinked": "未关联",+ "link": "关联",+ "unlink": "取消关联",+ "passwordSet": "使用邮箱和密码登录",+ "passwordNotSet": "添加密码后也可以使用邮箱登录",+ "change": "更改",+ "setPassword": "设置密码",+ "twoStepSection": "两步验证",+ "twoStepSectionDescription": "在密码或关联账号之后再要求一次验证。",+ "authenticatorApp": "身份验证器应用",+ "authenticatorOn": "已开启",+ "authenticatorOff": "使用 1Password 或 Google Authenticator 等应用生成的验证码",+ "newRecoveryCodes": "重新生成恢复码",+ "turnOff": "关闭",+ "setUp": "设置",+ "passkeys": "通行密钥",+ "passkeysDescription": "使用设备的屏幕锁登录,无需输入验证码。",+ "addPasskey": "添加通行密钥",+ "passkeyAdded": "添加于 {date}",+ "unnamedPasskey": "通行密钥",+ "remove": "移除",+ "noPasskeys": "暂无通行密钥。",+ "adminTwoStepTitle": "开启两步验证",+ "adminTwoStepDescription": "此服务器要求管理员在打开控制台前使用身份验证器应用或通行密钥。",+ "authenticatorSetupTitle": "设置身份验证器应用",+ "authenticatorSetupScan": "使用身份验证器应用扫描此码,然后输入应用显示的验证码。",+ "authenticatorSetupKey": "无法扫描?请输入此密钥",+ "recoveryCodesTitle": "保存你的恢复码",+ "recoveryCodesDescription": "如果无法使用身份验证器,每个恢复码可登录一次。请妥善保管,它们不会再次显示。",+ "copyCodes": "复制恢复码",+ "copyKey": "复制密钥",+ "copied": "已复制",+ "done": "完成",+ "cancel": "取消",+ "currentPassword": "当前密码",+ "changePasswordTitle": "修改密码",+ "confirmPasswordTitle": "输入密码以确认",+ "filterWaiting": "待处理",+ "filterApproved": "已批准",+ "filterDeclined": "已拒绝",+ "filterRemoved": "已移除",+ "statusWaiting": "待处理",+ "statusApproved": "已批准",+ "statusDeclined": "已拒绝",+ "statusRemoved": "已移除访问权限",+ "asked": "申请于 {date}",+ "reviewedBy": "{decision}({name})",+ "decline": "拒绝",+ "removeAccess": "移除访问权限",+ "noOneWaiting": "没有待处理的申请",+ "nothingHere": "暂无内容",+ "requestsEmptyDescription": "新申请会显示在这里,每条申请都会通过邮件通知管理员。",+ "searchPeople": "搜索成员…",+ "you": "(你)",+ "administrator": "管理员",+ "suspended": "已停用",+ "joined": "加入于 {date}",+ "actionsFor": "{name} 的操作",+ "makeAdministrator": "设为管理员",+ "removeAdministrator": "取消管理员",+ "signOutEverywhere": "退出所有设备",+ "suspendAccount": "停用账号",+ "restoreAccount": "恢复账号",+ "emailTo": "收件人:{recipient}",+ "attempts": {+ "many": "尝试 {count} 次"+ },+ "emailSent": "已发送",+ "emailWaiting": "待发送",+ "emailFailed": "失败",+ "retry": "重试",+ "needsAttention": "需要处理",+ "waitingRequests": {+ "many": "{count} 人正在等待审核"+ },+ "noOneIsWaiting": "没有人在等待",+ "emailStatus": "失败:{failed} · 等待中:{waiting}",+ "emailWaitingOnly": {+ "many": "{count} 封邮件等待发送"+ },+ "emailAllSent": "已全部发送",+ "review": "审核",+ "open": "打开",+ "serverSection": "服务器",+ "serverSectionDescription": "在服务器的配置文件中设置。",+ "deployment": "部署方式",+ "deploymentOfficial": "OpenPencil Cloud",+ "deploymentSelfHosted": "自托管",+ "newAccounts": "新账号",+ "enrollmentOpen": "任何人都可以加入",+ "enrollmentApproval": "需管理员审核",+ "enrollmentClosed": "已关闭",+ "emailTransportNone": "关闭",+ "emailTransportSMTP": "SMTP",+ "emailTransportCloudflare": "Cloudflare Email",+ "someoneElse": "某人",+ "emailSuppressed": "未发送",+ "emailKindInvitation": "文档邀请",+ "emailKindEnrollmentRequested": "已收到访问申请",+ "emailKindAdminNotification": "新的访问申请(管理员)",+ "emailKindEnrollmentApproved": "访问已批准",+ "emailKindEnrollmentRejected": "访问已拒绝",+ "emailKindEnrollmentRevoked": "访问已移除",+ "emailKindVerification": "验证邮箱",+ "emailKindPasswordReset": "重置密码",+ "emailKindPasswordChanged": "密码已更改",+ "emailKindOther": "邮件",+ "activityApproved": "批准了访问申请:",+ "activityRejected": "拒绝了访问申请:",+ "activityRevoked": "移除了访问权限:",+ "activitySuspended": "停用了",+ "activityRestored": "恢复了",+ "activitySignedOut": "让以下用户退出所有设备:",+ "activityMadeAdmin": "将以下用户设为管理员:",+ "activityRemovedAdmin": "取消了管理员权限:",+ "activityEmailRetried": "重新发送了邮件给",+ "activityChanged": "更改了",+ "errorTitle": "操作失败",+ "errorLastMethod": "请至少保留一种登录方式。",+ "errorSessionNotFresh": "为了你的安全,请重新登录后再进行此更改。",+ "errorLastAdmin": "服务器至少需要一名管理员。",+ "errorSelfAction": "你不能对自己的账号执行此操作。",+ "errorTwoStepRequired": "请先开启两步验证。",+ "errorNotAllowed": "你没有执行此操作的权限。",+ "errorNetwork": "无法连接到服务器。请检查网络连接。",+ "errorAlreadyDecided": "已有人处理了此申请。请刷新查看。",+ "passwordResetSent": "我们已向你发送设置密码的链接。"+}diff --git a/packages/vue/src/i18n/locales/zh-cn/index.ts b/packages/vue/src/i18n/locales/zh-cn/index.tsindex 44dc76dfb..e6d27db01 100644--- a/packages/vue/src/i18n/locales/zh-cn/index.ts+++ b/packages/vue/src/i18n/locales/zh-cn/index.ts@@ -2,6 +2,7 @@ import type { ComponentsJSON } from '@nanostores/i18n'import ai from './ai.json'import automation from './automation.json'+import cloudPortal from './cloud-portal.json'import code from './code.json'import collaboration from './collaboration.json'import commands from './commands.json'@@ -31,6 +32,7 @@ import variables from './variables.json'export default {ai,automation,+ cloudPortal,code,collaboration,commands,diff --git a/packages/vue/src/i18n/messages.ts b/packages/vue/src/i18n/messages.tsindex cff30a753..e14f21ffb 100644--- a/packages/vue/src/i18n/messages.ts+++ b/packages/vue/src/i18n/messages.ts@@ -1,5 +1,6 @@import { aiMessageDefaults, aiMessages } from '#vue/i18n/messages/ai'import { automationMessageDefaults, automationMessages } from '#vue/i18n/messages/automation'+import { cloudPortalMessageDefaults, cloudPortalMessages } from '#vue/i18n/messages/cloud-portal'import { codeMessageDefaults, codeMessages } from '#vue/i18n/messages/code'import {collaborationMessageDefaults,@@ -58,6 +59,7 @@ export {storageMessages,toolMessages,updatesMessages,+ cloudPortalMessages,variablesMessages,variableTypeMessages}@@ -88,6 +90,7 @@ export const messageDefaults = {storage: storageMessageDefaults,tools: toolMessageDefaults,updates: updatesMessageDefaults,+ cloudPortal: cloudPortalMessageDefaults,variables: variablesMessageDefaults,variableTypes: variableTypeMessageDefaults} as constdiff --git a/packages/vue/src/i18n/messages/cloud-portal.ts b/packages/vue/src/i18n/messages/cloud-portal.tsnew file mode 100644index 000000000..0f3778961--- /dev/null+++ b/packages/vue/src/i18n/messages/cloud-portal.ts@@ -0,0 +1,264 @@+import { count, params } from '@nanostores/i18n'++import { i18n } from '#vue/i18n/create'++/** Copy for the pages a Cloud server shows on its own address. */+export const cloudPortalMessageDefaults = {+ productName: 'OpenPencil Cloud',+ loading: 'Loading…',+ unavailableTitle: 'This server isn’t answering',+ unavailableDescription: 'Check the address, or try again in a moment.',+ tryAgain: 'Try again',++ signInTitle: 'Sign in to OpenPencil Cloud',+ signUpTitle: 'Create your account',+ signInWelcome: 'Welcome back.',+ signUpDescription: 'Create an account on this server.',+ returnsTo: params('Then you go back to {destination}.'),+ returnsToDesktop: 'the OpenPencil app',+ returnsToEditor: 'the editor',+ continueWithGoogle: 'Continue with Google',+ continueWithApple: 'Continue with Apple',+ or: 'or',+ name: 'Name',+ email: 'Email',+ emailPlaceholder: '[email protected]',+ password: 'Password',+ passwordHint: params('At least {count} characters.'),+ forgotPassword: 'Forgot password?',+ signIn: 'Sign in',+ createAccount: 'Create account',+ haveAccount: 'Already have an account?',+ newHere: 'New here?',+ createAnAccount: 'Create an account',+ approvalTitle: 'An administrator reviews new accounts',+ approvalDescription: 'You can sign in once your request is approved. We email you when it is.',+ signInFailed: 'Couldn’t sign in',+ noSignInMethods: 'This server doesn’t offer a way to sign in yet. Ask its administrator.',++ failureInvalidCredentials: 'The email or password is wrong.',+ failureEmailNotVerified: 'Confirm your email first. We can send the link again.',+ failurePasswordTooShort: 'The password is too short.',+ failurePasswordTooLong: 'The password is too long.',+ failureInvalidLink: 'This link has expired or was already used. Ask for a new one.',+ failureInvalidCode: 'That code didn’t work. Check it and try again.',+ failurePasskeyCancelled: 'Passkey setup was cancelled.',+ failurePasskeyExists: 'This device already has a passkey for your account.',+ failurePasskeyUnavailable:+ 'This browser couldn’t create a passkey for this address. Try another browser, or use an authenticator app.',+ failureRateLimited: 'Too many attempts. Wait a minute and try again.',+ failureUnavailable: 'Something went wrong on the server. Try again in a moment.',+ failureCancelled: 'Sign-in was cancelled.',+ failureEnrollmentClosed: 'This server isn’t taking new accounts.',++ checkEmailTitle: 'Check your email',+ checkEmailDescription: params(+ 'We sent a link to {email}. Open it on this device to finish creating your account.'+ ),+ sendAgain: 'Send again',+ sent: 'Sent',+ useAnotherEmail: 'Use another email',++ pendingTitle: 'Your request is with an administrator',+ pendingDescription: params('We email {email} when you can sign in. Nothing else to do for now.'),+ closedTitle: 'You can’t use this server',+ closedDescription:+ 'An administrator declined or removed your access. Ask them if you think this is a mistake.',+ signOut: 'Sign out',++ twoStepTitle: 'Confirm it’s you',+ twoStepAuthenticator: 'Enter the 6-digit code from your authenticator app.',+ twoStepRecovery: 'Enter one of the recovery codes you saved. Each works once.',+ authenticationCode: 'Authentication code',+ recoveryCode: 'Recovery code',+ continue: 'Continue',+ useRecoveryCode: 'Use a recovery code',+ useAuthenticator: 'Use your authenticator app',+ usePasskey: 'Use a passkey',++ resetTitle: 'Reset your password',+ resetDescription: 'We email you a link to choose a new one.',+ chooseTitle: 'Choose a new password',+ chooseDescription: 'Saving it signs you out everywhere else.',+ newPassword: 'New password',+ sendLink: 'Send link',+ savePassword: 'Save password',+ backToSignIn: 'Back to sign in',+ resetSentTitle: 'Check your email',+ resetSentDescription: params('If {email} has an account here, a reset link is on its way.'),++ deviceTitle: 'Sign in to the OpenPencil app?',+ deviceDescription: params('The OpenPencil app asks to use your account, {email}.'),+ deviceCheckCode: 'Check that the app shows this code',+ deviceWarningTitle: 'Only approve a sign-in you started',+ deviceWarningDescription:+ 'If you didn’t just sign in to OpenPencil on a computer, deny this request.',+ approve: 'Approve',+ deny: 'Deny',+ deviceApprovedTitle: 'You’re signed in',+ deviceApprovedDescription:+ 'Go back to the OpenPencil app; it has already picked this up. You can close this tab.',+ deviceDeniedTitle: 'Sign-in denied',+ deviceDeniedDescription:+ 'The app wasn’t signed in. If you didn’t start this, someone may know your password; change it in your account settings.',+ deviceExpiredTitle: 'This code has expired',+ deviceExpiredDescription: 'Start signing in from the OpenPencil app again to get a new code.',+ accountSettings: 'Account settings',++ sectionAccount: 'Your account',+ sectionServer: 'Server',+ security: 'Sign-in and security',+ securityDescription: params('How you sign in to {host}.'),+ overview: 'Overview',+ accessRequests: 'Access requests',+ accessRequestsDescription:+ 'People asking to join. Approving lets them sign in; each gets an email either way.',+ people: 'People',+ peopleDescription: count({+ one: '{count} account on this server.',+ many: '{count} accounts on this server.'+ }),+ emailDelivery: 'Email delivery',+ emailDeliveryDescription: 'Invitations, sign-in links, and access decisions the server sends.',+ activity: 'Activity',+ activityDescription: 'What administrators did on this server.',++ waysToSignIn: 'Ways to sign in',+ waysToSignInDescription: 'Keep at least one, so you can always get back in.',+ providerGoogle: 'Google',+ providerApple: 'Apple',+ linkedOn: params('Linked {date}'),+ notLinked: 'Not linked',+ link: 'Link',+ unlink: 'Unlink',+ passwordSet: 'Sign in with your email and password',+ passwordNotSet: 'Add a password to sign in with your email too',+ change: 'Change',+ setPassword: 'Set password',+ twoStepSection: 'Two-step sign-in',+ twoStepSectionDescription: 'Ask for a second proof after your password or linked account.',+ authenticatorApp: 'Authenticator app',+ authenticatorOn: 'On',+ authenticatorOff: 'Codes from an app such as 1Password or Google Authenticator',+ newRecoveryCodes: 'New recovery codes',+ turnOff: 'Turn off',+ setUp: 'Set up',+ passkeys: 'Passkeys',+ passkeysDescription: 'Sign in with your device’s screen lock instead of a code.',+ addPasskey: 'Add passkey',+ passkeyAdded: params('Added {date}'),+ unnamedPasskey: 'Passkey',+ remove: 'Remove',+ noPasskeys: 'No passkeys yet.',+ adminTwoStepTitle: 'Turn on a second sign-in step',+ adminTwoStepDescription:+ 'This server requires administrators to use an authenticator app or a passkey before opening the console.',++ authenticatorSetupTitle: 'Set up an authenticator app',+ authenticatorSetupScan: 'Scan this with your authenticator app, then enter the code it shows.',+ authenticatorSetupKey: 'Can’t scan? Enter this key',+ recoveryCodesTitle: 'Save your recovery codes',+ recoveryCodesDescription:+ 'Each code signs you in once if you lose your authenticator. Keep them somewhere safe; they won’t be shown again.',+ copyCodes: 'Copy codes',+ copyKey: 'Copy key',+ copied: 'Copied',+ done: 'Done',+ cancel: 'Cancel',+ currentPassword: 'Current password',+ changePasswordTitle: 'Change your password',+ confirmPasswordTitle: 'Confirm with your password',++ filterWaiting: 'Waiting',+ filterApproved: 'Approved',+ filterDeclined: 'Declined',+ filterRemoved: 'Removed',+ statusWaiting: 'Waiting',+ statusApproved: 'Approved',+ statusDeclined: 'Declined',+ statusRemoved: 'Access removed',+ asked: params('Asked {date}'),+ reviewedBy: params('{decision} by {name}'),+ decline: 'Decline',+ removeAccess: 'Remove access',+ noOneWaiting: 'No one is waiting',+ nothingHere: 'Nothing here yet',+ requestsEmptyDescription: 'New requests appear here, and administrators get an email for each.',+ searchPeople: 'Search people…',+ you: '(you)',+ administrator: 'Administrator',+ suspended: 'Suspended',+ joined: params('Joined {date}'),+ actionsFor: params('Actions for {name}'),+ makeAdministrator: 'Make administrator',+ removeAdministrator: 'Remove administrator',+ signOutEverywhere: 'Sign out everywhere',+ suspendAccount: 'Suspend account',+ restoreAccount: 'Restore account',+ emailTo: params('To {recipient}'),+ attempts: count({ one: '{count} attempt', many: '{count} attempts' }),+ emailSent: 'Sent',+ emailWaiting: 'Waiting',+ emailFailed: 'Failed',+ retry: 'Retry',+ needsAttention: 'Needs attention',+ waitingRequests: count({+ one: '{count} person is waiting for a decision',+ many: '{count} people are waiting for a decision'+ }),+ noOneIsWaiting: 'No one is waiting',+ emailStatus: params('Failed: {failed} · Waiting: {waiting}'),+ emailWaitingOnly: count({+ one: '{count} email waiting to send',+ many: '{count} emails waiting to send'+ }),+ emailAllSent: 'Everything has been sent',+ review: 'Review',+ open: 'Open',+ serverSection: 'Server',+ serverSectionDescription: 'Set in the server’s configuration file.',+ deployment: 'Deployment',+ deploymentOfficial: 'OpenPencil Cloud',+ deploymentSelfHosted: 'Self-hosted',+ newAccounts: 'New accounts',+ enrollmentOpen: 'Anyone can join',+ enrollmentApproval: 'Reviewed by an administrator',+ enrollmentClosed: 'Closed',+ emailTransportNone: 'Off',+ emailTransportSMTP: 'SMTP',+ emailTransportCloudflare: 'Cloudflare Email',+ someoneElse: 'Someone',+ emailSuppressed: 'Not sent',+ emailKindInvitation: 'Invitation to a document',+ emailKindEnrollmentRequested: 'Access request received',+ emailKindAdminNotification: 'New access request (administrators)',+ emailKindEnrollmentApproved: 'Access approved',+ emailKindEnrollmentRejected: 'Access declined',+ emailKindEnrollmentRevoked: 'Access removed',+ emailKindVerification: 'Verify your email',+ emailKindPasswordReset: 'Reset your password',+ emailKindPasswordChanged: 'Password changed',+ emailKindOther: 'Email',+ activityApproved: 'approved access for',+ activityRejected: 'declined access for',+ activityRevoked: 'removed access for',+ activitySuspended: 'suspended',+ activityRestored: 'restored',+ activitySignedOut: 'signed out everywhere:',+ activityMadeAdmin: 'made an administrator:',+ activityRemovedAdmin: 'removed administrator rights from',+ activityEmailRetried: 'retried an email to',+ activityChanged: 'changed',+ errorTitle: 'That didn’t work',+ errorLastMethod: 'Keep at least one way to sign in.',+ errorSessionNotFresh: 'For your security, sign in again before making this change.',+ errorLastAdmin: 'The server needs at least one administrator.',+ errorSelfAction: 'You can’t do that to your own account.',+ errorTwoStepRequired: 'Turn on two-step sign-in first.',+ errorNotAllowed: 'You don’t have permission to do that.',+ errorNetwork: 'Couldn’t reach the server. Check your connection.',+ errorAlreadyDecided: 'Someone already decided this request. Refresh to see it.',+ passwordResetSent: 'We emailed you a link to set a password.'+} as const++export const cloudPortalMessages = i18n('cloudPortal', cloudPortalMessageDefaults)diff --git a/packages/vue/src/i18n/useI18n.ts b/packages/vue/src/i18n/useI18n.tsindex 5f3df1e91..2436dc384 100644--- a/packages/vue/src/i18n/useI18n.ts+++ b/packages/vue/src/i18n/useI18n.ts@@ -30,6 +30,7 @@ import {storageMessages,toolMessages,updatesMessages,+ cloudPortalMessages,variablesMessages,variableTypeMessages} from '#vue/i18n/messages'@@ -63,6 +64,7 @@ export const useStatusMessages = () => useI18nNamespace(statusMessages)export const useStorageMessages = () => useI18nNamespace(storageMessages)export const useToolMessages = () => useI18nNamespace(toolMessages)export const useUpdateMessages = () => useI18nNamespace(updatesMessages)+export const useCloudPortalMessages = () => useI18nNamespace(cloudPortalMessages)export const useVariableMessages = () => useI18nNamespace(variablesMessages)export const useVariableTypeMessages = () => useI18nNamespace(variableTypeMessages)diff --git a/src/AGENTS.md b/src/AGENTS.mdindex 6309d58aa..6f784e562 100644--- a/src/AGENTS.md+++ b/src/AGENTS.md@@ -26,6 +26,8 @@ Root Tauri/Vite app. Services and state live under `src/app/**`, views under `sr- ACP transport lives under `src/app/ai/acp/**`; provider definitions in `packages/core/src/constants.ts`; profiles in `src/app/ai/models/**`. Keep provider connections, reusable profiles, and role assignments separate, and resolve credentials lazily. ACP process changes require checking `desktop/capabilities/**`.- Browser-native WebMCP registration lives under `src/app/automation/webmcp/`, consumes per-tool exposure metadata, and is feature-detected through `document.modelContext`. App completion under `src/app/automation/execution/` loads fonts after commit.- Collaboration lives under `src/app/collab/**` on Yjs and awareness over a `CollabRoomTransport`: Trystero for peer-to-peer rooms, the Cloud relay (`transport/cloud.ts`) for Cloud documents. Preserve crypto-safe room IDs and peer cleanup. Room channels are named in `COLLAB_ACTIONS` from `@open-pencil/cloud/contract`, because the relay reads the document ones to persist rooms and drop viewer writes (`tests/integration/collab/cloud-relay.test.ts`).+- The Cloud portal is its own entry (`cloud.html`, `src/cloud/`, `src/views/cloud/`) served by the Cloud server, not the editor; it must not import editor sessions, CanvasKit, or `src/app/shell/**`, so `bun run build:cloud-portal` stays small (`open-pencil/no-editor-imports-in-cloud-portal`, `check:arch`).+- Which portal pages a visitor may open, by sign-in and account standing, is decided in `portalDestination` alone (`tests/app/cloud-portal/navigation.test.ts`).- A room is a document: every room tab owns its session (`src/app/collab/rooms.ts`, `session.ts`), joining always opens a new tab, and only Share binds an existing document; the collaboration UI reads the active tab's room through `useCollab()` and publishes cursors through the canvas's own tab (`tests/app/collab/session.test.ts`, `tests/e2e/collab/rooms.spec.ts`).- A shared document records each layer's parent history, order key and page, never `parentId` or `childIds`, and only Share or a room's conversion sets its root in `meta`; local edits are written by `writeLocalPlacement` and remote changes applied by `applySharedTree` in `src/app/collab/shared-tree/sync.ts`, which resolve the tree with `LayerTree` from `src/app/collab/tree/` (`tests/app/collab/random-edits.test.ts`).- A room's voice call lives in its session (`src/app/collab/voice/room.ts`): who is in it and muted travels in awareness, the microphone goes only to peers in the call through the transport's `media`, and speaking comes from WebRTC's reported audio levels. One window holds one call, owned by `useVoiceCall()` in `src/app/collab/voice/call.ts`, which opens the microphone with VueUse and ends the call when its room goes (`tests/app/collab/voice/room.test.ts`).diff --git a/src/app/cloud-portal/auth.ts b/src/app/cloud-portal/auth.tsnew file mode 100644index 000000000..8ca14e25f--- /dev/null+++ b/src/app/cloud-portal/auth.ts@@ -0,0 +1,123 @@+import {+ cloudAuthFailure,+ createCloudAuthClient,+ type CloudAuthResult,+ type CloudSocialProvider+} from '@open-pencil/cloud/client'+import type { CloudDiscovery } from '@open-pencil/cloud/contract'++const done = <T>(value: T): CloudAuthResult<T> => ({ ok: true, value })++/** Sign-in steps against the Cloud server the portal is served from. */+export function createPortalAuth(discovery: CloudDiscovery, options: { captcha?: string } = {}) {+ const auth = createCloudAuthClient(discovery, { captchaResponse: options.captcha })++ return {+ /** Leaves for the provider; the browser comes back to `returnURL`. */+ async withProvider(provider: CloudSocialProvider, returnURL: string): Promise<CloudAuthResult> {+ const result = await auth.signIn.social({+ provider,+ callbackURL: returnURL,+ errorCallbackURL: returnURL,+ disableRedirect: true+ })+ if (result.error || typeof result.data.url !== 'string') return cloudAuthFailure(result.error)+ globalThis.location.assign(result.data.url)+ return done(undefined)+ },++ async withEmail(input: {+ email: string+ password: string+ }): Promise<CloudAuthResult<'signed-in' | 'two-step'>> {+ const result = await auth.signIn.email({ ...input, rememberMe: true })+ if (result.error) return cloudAuthFailure(result.error)+ const twoStep = 'twoFactorRedirect' in result.data && result.data.twoFactorRedirect === true+ return done(twoStep ? 'two-step' : 'signed-in')+ },++ async signUp(input: {+ name: string+ email: string+ password: string+ verifiedURL: string+ }): Promise<CloudAuthResult> {+ const result = await auth.signUp.email({+ name: input.name,+ email: input.email,+ password: input.password,+ callbackURL: input.verifiedURL+ })+ return result.error ? cloudAuthFailure(result.error) : done(undefined)+ },++ async resendVerification(email: string, verifiedURL: string): Promise<CloudAuthResult> {+ const result = await auth.sendVerificationEmail({ email, callbackURL: verifiedURL })+ return result.error ? cloudAuthFailure(result.error) : done(undefined)+ },++ async requestPasswordReset(email: string, resetURL: string): Promise<CloudAuthResult> {+ const result = await auth.requestPasswordReset({ email, redirectTo: resetURL })+ return result.error ? cloudAuthFailure(result.error) : done(undefined)+ },++ async resetPassword(token: string, password: string): Promise<CloudAuthResult> {+ const result = await auth.resetPassword({ newPassword: password, token })+ return result.error ? cloudAuthFailure(result.error) : done(undefined)+ },++ async verifyTwoStep(+ method: 'authenticator' | 'recovery',+ code: string+ ): Promise<CloudAuthResult> {+ const result =+ method === 'authenticator'+ ? await auth.twoFactor.verifyTotp({ code, trustDevice: true })+ : await auth.twoFactor.verifyBackupCode({ code, trustDevice: true })+ return result.error ? cloudAuthFailure(result.error) : done(undefined)+ },++ async withPasskey(): Promise<CloudAuthResult> {+ const result = await auth.signIn.passkey()+ return result.error ? cloudAuthFailure(result.error) : done(undefined)+ },++ async addPasskey(): Promise<CloudAuthResult> {+ const result = await auth.passkey.addPasskey()+ return result.error ? cloudAuthFailure(result.error) : done(undefined)+ },++ /** Whether a desktop sign-in code is still waiting, before showing it to approve. */+ async deviceRequest(+ userCode: string+ ): Promise<CloudAuthResult<'pending' | 'approved' | 'denied'>> {+ const result = await auth.device({ query: { user_code: userCode } })+ // An unknown or expired code is the only failure a person can act on: start again.+ if (result.error || !result.data) return { ok: false, failure: 'invalid-code' }+ const status = result.data.status+ return done(status === 'approved' || status === 'denied' ? status : 'pending')+ },++ async decideDevice(userCode: string, decision: 'approve' | 'deny'): Promise<CloudAuthResult> {+ const result = await auth.device[decision]({ userCode }).catch(() => null)+ if (!result) return { ok: false, failure: 'unavailable' }+ const { error } = result+ const status =+ error && 'status' in error && typeof error.status === 'number' ? error.status : undefined+ if (status === 429) return { ok: false, failure: 'rate-limited' }+ // A code that is unknown, used, or expired is refused with a 4xx; anything else can be retried.+ if (status !== undefined && (status < 400 || status >= 500)) {+ return { ok: false, failure: 'unavailable' }+ }+ return error || !result.data?.success+ ? { ok: false, failure: 'invalid-code' }+ : done(undefined)+ },++ async signOut(): Promise<void> {+ await auth.signOut()+ }+ }+}++export type PortalAuth = ReturnType<typeof createPortalAuth>diff --git a/src/app/cloud-portal/context.ts b/src/app/cloud-portal/context.tsnew file mode 100644index 000000000..350d47a4f--- /dev/null+++ b/src/app/cloud-portal/context.ts@@ -0,0 +1,65 @@+import { inject, provide, shallowRef, type InjectionKey, type ShallowRef } from 'vue'++import {+ CloudPortalAPIError,+ createCloudPortalClient,+ discoverCloud,+ type CloudPortalClient+} from '@open-pencil/cloud/client'+import type { CloudAccountStatus, CloudDiscovery } from '@open-pencil/cloud/contract'++import { createPortalAuth, type PortalAuth } from './auth'++/** Everything a portal page needs about the Cloud server it is served from. */+export type PortalContext = {+ host: string+ discovery: CloudDiscovery+ api: CloudPortalClient+ auth: PortalAuth+ /** The signed-in account and its standing, or null when nobody is signed in. */+ account: ShallowRef<CloudAccountStatus | null>+ refreshAccount(): Promise<CloudAccountStatus | null>+}++const PORTAL_CONTEXT: InjectionKey<PortalContext> = Symbol('cloud-portal')++/** Discovers the server at this page's origin and reads who is signed in. */+export async function loadPortalContext(+ origin = globalThis.location.origin+): Promise<PortalContext> {+ const discovery = await discoverCloud(origin)+ const api = createCloudPortalClient({ baseURL: origin })+ const account = shallowRef<CloudAccountStatus | null>(null)+ async function refreshAccount() {+ try {+ account.value = await api.accountStatus()+ } catch (error) {+ if (!(error instanceof CloudPortalAPIError) || error.kind !== 'authentication-required') {+ throw error+ }+ account.value = null+ }+ return account.value+ }+ await refreshAccount()+ return {+ host: new URL(origin).host,+ discovery,+ api,+ auth: createPortalAuth(discovery),+ account,+ refreshAccount+ }+}++export function providePortal(context: PortalContext): void {+ provide(PORTAL_CONTEXT, context)+}++export function usePortal(): PortalContext {+ const context = inject(PORTAL_CONTEXT)+ if (!context) throw new Error('Cloud portal pages need a portal context')+ return context+}++export { PORTAL_CONTEXT }diff --git a/src/app/cloud-portal/failure.ts b/src/app/cloud-portal/failure.tsnew file mode 100644index 000000000..891784659--- /dev/null+++ b/src/app/cloud-portal/failure.ts@@ -0,0 +1,80 @@+import { CloudPortalAPIError, type CloudAuthFailure } from '@open-pencil/cloud/client'+import { useCloudPortalMessages } from '@open-pencil/vue'++/** Words for a failed sign-in step, and for errors the provider sends back in the URL. */+export function usePortalFailureMessages() {+ const messages = useCloudPortalMessages()+ function failure(kind: CloudAuthFailure): string {+ const value = messages.value+ const words: Record<CloudAuthFailure, string> = {+ 'invalid-credentials': value.failureInvalidCredentials,+ 'email-not-verified': value.failureEmailNotVerified,+ 'password-too-short': value.failurePasswordTooShort,+ 'password-too-long': value.failurePasswordTooLong,+ 'invalid-link': value.failureInvalidLink,+ 'invalid-code': value.failureInvalidCode,+ 'passkey-cancelled': value.failurePasskeyCancelled,+ 'passkey-exists': value.failurePasskeyExists,+ 'passkey-unavailable': value.failurePasskeyUnavailable,+ 'session-not-fresh': value.errorSessionNotFresh,+ 'rate-limited': value.failureRateLimited,+ unavailable: value.failureUnavailable+ }+ return words[kind]+ }+ /** The provider's `error` query values after a social sign-in comes back, or null. */+ function callback(query: Record<string, unknown>): string | null {+ const values = ['error', 'error_description', 'error_code']+ .map((key) => query[key])+ .filter((value): value is string => typeof value === 'string' && value.length > 0)+ if (values.length === 0) return null+ if (values.includes('access_denied')) return messages.value.failureCancelled+ if (values.includes('enrollment_closed')) return messages.value.failureEnrollmentClosed+ if (values.includes('enrollment_approval_required')) return null+ return messages.value.failureUnavailable+ }+ /** Words for a failed account or console request. */+ function api(error: unknown): string {+ const value = messages.value+ if (!(error instanceof CloudPortalAPIError)) return value.failureUnavailable+ switch (error.kind) {+ case 'network':+ case 'timeout':+ return value.errorNetwork+ case 'authorization-required':+ return value.errorNotAllowed+ case 'authentication-required':+ return value.errorSessionNotFresh+ case 'cancelled':+ case 'protocol':+ return value.failureUnavailable+ case 'domain':+ break+ }+ switch (error.code) {+ case 'current_password_invalid':+ return value.failureInvalidCredentials+ case 'password_too_short':+ return value.failurePasswordTooShort+ case 'password_too_long':+ return value.failurePasswordTooLong+ case 'last_authentication_method':+ return value.errorLastMethod+ case 'session_not_fresh':+ return value.errorSessionNotFresh+ case 'last_admin_required':+ return value.errorLastAdmin+ case 'self_admin_action_forbidden':+ return value.errorSelfAction+ case 'mfa_required':+ return value.errorTwoStepRequired+ case 'invalid_enrollment_transition':+ return value.errorAlreadyDecided+ case 'rate_limited':+ return value.failureRateLimited+ default:+ return value.failureUnavailable+ }+ }+ return { failure, callback, api }+}diff --git a/src/app/cloud-portal/format.ts b/src/app/cloud-portal/format.tsnew file mode 100644index 000000000..1c421fb8d--- /dev/null+++ b/src/app/cloud-portal/format.ts@@ -0,0 +1,7 @@+/** A date the way portal lists show it, in the person's language; empty for invalid input. */+export function portalDate(value: string | null | undefined, locale: string): string {+ if (!value) return ''+ const date = new Date(value)+ if (Number.isNaN(date.getTime())) return ''+ return new Intl.DateTimeFormat(locale, { dateStyle: 'medium' }).format(date)+}diff --git a/src/app/cloud-portal/navigation.ts b/src/app/cloud-portal/navigation.tsnew file mode 100644index 000000000..f748889e3--- /dev/null+++ b/src/app/cloud-portal/navigation.ts@@ -0,0 +1,67 @@+import type { LocationQuery, RouteLocationRaw, RouteMeta } from 'vue-router'++import { cloudRedirectPath } from '@open-pencil/cloud/client'+import type { CloudAccountStatus } from '@open-pencil/cloud/contract'++/** Where signed-in people land when nothing else asked for them. */+export const PORTAL_HOME = '/account'++/** A same-origin path to continue to after a sign-in step, from a `redirect` query value. */+export function continuationPath(value: unknown): string {+ return cloudRedirectPath(value, PORTAL_HOME)+}++/** An absolute URL for a path on this server. */+export function portalURL(path: string): string {+ return new URL(path, globalThis.location.origin).href+}++/** An absolute URL on this server that keeps the continuation, for links sent by email. */+export function continuationURL(path: string, redirect: string): string {+ const url = new URL(path, globalThis.location.origin)+ if (redirect !== PORTAL_HOME) url.searchParams.set('redirect', redirect)+ return url.href+}++const STANDING_PATHS: Record<CloudAccountStatus['state'], string | null> = {+ active: null,+ pending: '/account/pending',+ rejected: '/account/closed',+ revoked: '/account/closed'+}++const STANDING_PAGES = new Set(Object.values(STANDING_PATHS))++/** The page an account in this standing belongs on, or null when it may go anywhere. */+export function standingPath(account: CloudAccountStatus | null): string | null {+ if (!account) return null+ return STANDING_PATHS[account.state]+}++/** The parts of a route the portal's access rules read. */+export interface PortalRouteTarget {+ meta: RouteMeta+ path: string+ fullPath: string+ query: LocationQuery+}++/**+ * Where a navigation may go. Signed-out pages send signed-in people on; account pages ask for a+ * session; console pages ask for a deployment administrator. An account waiting for review, or+ * whose access was declined, only reaches the page that explains it.+ */+export function portalDestination(+ to: PortalRouteTarget,+ account: CloudAccountStatus | null+): true | RouteLocationRaw {+ if (to.meta.signedOut && account) return continuationPath(to.query.redirect)+ if (!to.meta.account) return true+ if (!account) return { name: 'sign-in', query: { redirect: to.fullPath } }+ const standing = standingPath(account)+ if (standing && to.path !== standing) return standing+ // An active account has nothing waiting or declined to read about.+ if (!standing && STANDING_PAGES.has(to.path)) return PORTAL_HOME+ if (to.meta.admin && account.user.deploymentRole !== 'admin') return PORTAL_HOME+ return true+}diff --git a/src/app/cloud-portal/state.ts b/src/app/cloud-portal/state.tsnew file mode 100644index 000000000..135c33bd4--- /dev/null+++ b/src/app/cloud-portal/state.ts@@ -0,0 +1,63 @@+import { noop, useAsyncState } from '@vueuse/core'+import { computed, shallowRef } from 'vue'++import { usePortalFailureMessages } from './failure'++/**+ * Something the page reads from the server. A newer load replaces an older one still running,+ * a failure is kept in words until the next load starts, and the last good value stays shown.+ */+export function usePortalLoad<T>(load: () => Promise<T>, initial: T) {+ const failures = usePortalFailureMessages()+ const { state, isLoading, error, execute } = useAsyncState(load, initial, {+ resetOnExecute: false,+ onError: noop+ })+ return {+ data: state,+ loading: isLoading,+ error: computed(() => (error.value === undefined ? null : failures.api(error.value))),+ reload: async () => {+ await execute()+ }+ }+}++/**+ * A change the page makes. `busy` is true while it runs and `subject` names what it runs on, its+ * first argument; a thrown failure is put in words, and `fail` reports one the change found itself.+ * Each run clears the previous failure, and so does `clear`.+ */+export function usePortalAction<Args extends unknown[]>(+ action: (...args: Args) => Promise<unknown>+) {+ const failures = usePortalFailureMessages()+ const subject = shallowRef<Args[0] | null>(null)+ const reported = shallowRef<string | null>(null)+ const { isLoading, error, execute } = useAsyncState(+ (...args: Args) => {+ subject.value = args[0] ?? null+ reported.value = null+ return action(...args)+ },+ undefined,+ { immediate: false, onError: noop }+ )+ return {+ busy: isLoading,+ subject: computed(() => (isLoading.value ? subject.value : null)),+ error: computed(+ () => reported.value ?? (error.value === undefined ? null : failures.api(error.value))+ ),+ run: async (...args: Args) => {+ await execute(0, ...args)+ },+ fail(message: string) {+ reported.value = message+ },+ clear() {+ reported.value = null+ error.value = undefined+ }+ }+}diff --git a/src/app/cloud-portal/theme.ts b/src/app/cloud-portal/theme.tsnew file mode 100644index 000000000..ce1fec372--- /dev/null+++ b/src/app/cloud-portal/theme.ts@@ -0,0 +1,15 @@+import { usePreferredDark } from '@vueuse/core'+import { watchEffect } from 'vue'++/**+ * Follows the system color scheme. The portal is served from the Cloud server's origin, so the+ * editor's stored theme and accent are not visible here; the stylesheet's default accent applies.+ */+export function usePortalTheme(): void {+ const prefersDark = usePreferredDark()+ watchEffect(() => {+ const value = prefersDark.value ? 'dark' : 'light'+ document.documentElement.dataset.theme = value+ document.documentElement.style.colorScheme = value+ })+}diff --git a/src/app/presence/initials.ts b/src/app/presence/initials.tsnew file mode 100644index 000000000..9159c6c66--- /dev/null+++ b/src/app/presence/initials.ts@@ -0,0 +1,11 @@+/** Up to two initials for an avatar, or `?` when the name has none. */+export function initials(name: string): string {+ return (+ name+ .split(' ')+ .map((w) => w[0])+ .join('')+ .toUpperCase()+ .slice(0, 2) || '?'+ )+}diff --git a/src/app/shell/ui.ts b/src/app/shell/ui.tsindex d69ea8e0c..b2ecb421b 100644--- a/src/app/shell/ui.ts+++ b/src/app/shell/ui.ts@@ -166,16 +166,6 @@ export async function openExternalLink(url: string) {window.open(url, '_blank')}}-export function initials(name: string): string {- return (- name- .split(' ')- .map((w) => w[0])- .join('')- .toUpperCase()- .slice(0, 2) || '?'- )-}export function decodeTauriStderr(raw: Uint8Array | number[] | string): string {if (typeof raw === 'string') return rawreturn new TextDecoder().decode(raw instanceof Uint8Array ? raw : new Uint8Array(raw))diff --git a/src/cloud/main.ts b/src/cloud/main.tsnew file mode 100644index 000000000..db08634b1--- /dev/null+++ b/src/cloud/main.ts@@ -0,0 +1,32 @@+import { createHead } from '@unhead/vue/client'+import { createApp } from 'vue'++import '@/app.css'+import { loadPortalContext, PORTAL_CONTEXT } from '@/app/cloud-portal/context'+import CloudPortalApp from '@/views/cloud/CloudPortalApp.vue'+import CloudPortalUnavailableView from '@/views/cloud/CloudPortalUnavailableView.vue'++import { createCloudPortalRouter } from './router'++// Entry for the pages a Cloud server shows on its own address (`cloud.html`): signing in,+// approving the desktop app, account security, and the administrator console. The editor+// never loads it; only the Cloud server serves this page.+async function start(): Promise<void> {+ const head = createHead()+ let context: Awaited<ReturnType<typeof loadPortalContext>>+ try {+ context = await loadPortalContext()+ } catch (error) {+ console.error(error)+ createApp(CloudPortalUnavailableView).use(head).mount('#app')+ return+ }+ const app = createApp(CloudPortalApp)+ app.config.errorHandler = (error) => {+ console.error(error)+ }+ app.provide(PORTAL_CONTEXT, context)+ app.use(createCloudPortalRouter(context)).use(head).mount('#app')+}++void start()diff --git a/src/cloud/router.ts b/src/cloud/router.tsnew file mode 100644index 000000000..be28d4f9d--- /dev/null+++ b/src/cloud/router.ts@@ -0,0 +1,87 @@+import { createRouter, createWebHistory } from 'vue-router'++import type { PortalContext } from '@/app/cloud-portal/context'+import { PORTAL_HOME, portalDestination } from '@/app/cloud-portal/navigation'++/** The Cloud portal's pages, guarded by the portal's access rules (`portalDestination`). */+export function createCloudPortalRouter(context: PortalContext) {+ const router = createRouter({+ history: createWebHistory(),+ routes: [+ { path: '/', redirect: PORTAL_HOME },+ {+ path: '/auth/sign-in',+ name: 'sign-in',+ component: () => import('@/views/cloud/SignInView.vue'),+ meta: { signedOut: true }+ },+ {+ path: '/auth/sign-up',+ name: 'sign-up',+ component: () => import('@/views/cloud/SignInView.vue'),+ meta: { signedOut: true }+ },+ {+ path: '/auth/check-email',+ name: 'check-email',+ component: () => import('@/views/cloud/CheckEmailView.vue')+ },+ {+ path: '/auth/two-factor',+ name: 'two-factor',+ component: () => import('@/views/cloud/TwoStepView.vue')+ },+ {+ path: '/auth/forgot-password',+ name: 'forgot-password',+ component: () => import('@/views/cloud/ResetPasswordView.vue')+ },+ {+ path: '/auth/reset-password',+ name: 'reset-password',+ component: () => import('@/views/cloud/ResetPasswordView.vue')+ },+ {+ path: '/auth/return',+ name: 'return',+ component: () => import('@/views/cloud/ReturnView.vue'),+ meta: { account: true }+ },+ {+ path: '/cloud/device',+ name: 'device',+ component: () => import('@/views/cloud/DeviceView.vue'),+ meta: { account: true }+ },+ {+ path: '/account/pending',+ name: 'pending',+ component: () => import('@/views/cloud/StandingView.vue'),+ meta: { account: true }+ },+ {+ path: '/account/closed',+ name: 'closed',+ component: () => import('@/views/cloud/StandingView.vue'),+ meta: { account: true }+ },+ {+ path: '/account',+ name: 'security',+ component: () => import('@/views/cloud/ConsoleView.vue'),+ meta: { account: true }+ },+ {+ path: '/admin/:section(overview|requests|people|email|activity)?',+ name: 'admin',+ component: () => import('@/views/cloud/ConsoleView.vue'),+ meta: { account: true, admin: true }+ },+ { path: '/:pathMatch(.*)*', redirect: PORTAL_HOME }+ ]+ })++ router.beforeEach((to) => portalDestination(to, context.account.value))++ return router+}diff --git a/src/components/cloud-portal/account/PortalAccountSecurity.vue b/src/components/cloud-portal/account/PortalAccountSecurity.vuenew file mode 100644index 000000000..9dec3ccda--- /dev/null+++ b/src/components/cloud-portal/account/PortalAccountSecurity.vue@@ -0,0 +1,177 @@+<script setup lang="ts">+import { computed } from 'vue'++import { useCloudPortalMessages } from '@open-pencil/vue'++import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'+import SettingsRow from '@/components/settings/layout/SettingsRow.vue'+import SettingsSection from '@/components/settings/layout/SettingsSection.vue'+import AppButton from '@/components/ui/button/AppButton.vue'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'+import AppBadge from '@/components/ui/feedback/AppBadge.vue'++import type { PortalLinkedMethod, PortalSignInMethod } from '../types'++/**+ * How a person signs in to this Cloud server and how they prove it’s them: linked accounts,+ * a password, an authenticator app with recovery codes, and passkeys.+ */+const {+ methods,+ linkable,+ authenticator,+ passkeys,+ passkeysAvailable = true,+ twoStepRequired = false,+ busy = false+} = defineProps<{+ methods: PortalLinkedMethod[]+ /** Social providers the server offers that are not linked yet. */+ linkable: PortalSignInMethod[]+ authenticator: { available: boolean; on: boolean }+ passkeys: { id: string; name: string | null; addedOn: string }[]+ passkeysAvailable?: boolean+ /** The server requires a second step for this account, and none is on yet. */+ twoStepRequired?: boolean+ busy?: boolean+}>()+const emit = defineEmits<{+ link: [provider: PortalSignInMethod]+ unlink: [methodId: string]+ changePassword: []+ setUpAuthenticator: []+ turnOffAuthenticator: []+ newRecoveryCodes: []+ addPasskey: []+ removePasskey: [id: string]+}>()++const messages = useCloudPortalMessages()+const providerLabel = (provider: PortalSignInMethod) =>+ provider === 'google' ? messages.value.providerGoogle : messages.value.providerApple+const social = computed(() =>+ methods.flatMap((method) =>+ method.provider === 'credential' ? [] : [{ ...method, provider: method.provider }]+ )+)+const password = computed(() => methods.find((method) => method.provider === 'credential') ?? null)+</script>++<template>+ <div class="flex max-w-2xl flex-col gap-6">+ <AppAlert+ v-if="twoStepRequired"+ tone="warning"+ :heading="messages.adminTwoStepTitle"+ :description="messages.adminTwoStepDescription"+ />++ <SettingsSection>+ <template #title>{{ messages.waysToSignIn }}</template>+ <template #description>{{ messages.waysToSignInDescription }}</template>+ <SettingsGroup>+ <SettingsRow+ v-for="method in social"+ :key="method.id"+ :label="providerLabel(method.provider)"+ :description="messages.linkedOn({ date: method.linkedOn })"+ >+ <AppButton+ size="sm"+ variant="ghost"+ :disabled="busy || !method.canUnlink"+ @click="emit('unlink', method.id)"+ >+ {{ messages.unlink }}+ </AppButton>+ </SettingsRow>+ <SettingsRow+ v-for="provider in linkable"+ :key="provider"+ :label="providerLabel(provider)"+ :description="messages.notLinked"+ >+ <AppButton size="sm" variant="outline" :disabled="busy" @click="emit('link', provider)">+ {{ messages.link }}+ </AppButton>+ </SettingsRow>+ <SettingsRow+ :label="messages.password"+ :description="password ? messages.passwordSet : messages.passwordNotSet"+ >+ <AppButton size="sm" variant="outline" :disabled="busy" @click="emit('changePassword')">+ {{ password ? messages.change : messages.setPassword }}+ </AppButton>+ </SettingsRow>+ </SettingsGroup>+ </SettingsSection>++ <SettingsSection v-if="authenticator.available">+ <template #title>{{ messages.twoStepSection }}</template>+ <template #description>{{ messages.twoStepSectionDescription }}</template>+ <SettingsGroup>+ <SettingsRow :label="messages.authenticatorApp">+ <template #description>+ <p class="mt-1 flex items-center gap-1.5 text-xs text-muted">+ <AppBadge v-if="authenticator.on">{{ messages.authenticatorOn }}</AppBadge>+ <template v-else>{{ messages.authenticatorOff }}</template>+ </p>+ </template>+ <div v-if="authenticator.on" class="flex items-center gap-1">+ <AppButton size="sm" variant="ghost" :disabled="busy" @click="emit('newRecoveryCodes')">+ {{ messages.newRecoveryCodes }}+ </AppButton>+ <AppButton+ size="sm"+ variant="ghost"+ :disabled="busy"+ @click="emit('turnOffAuthenticator')"+ >+ {{ messages.turnOff }}+ </AppButton>+ </div>+ <AppButton+ v-else+ size="sm"+ variant="outline"+ :disabled="busy"+ @click="emit('setUpAuthenticator')"+ >+ {{ messages.setUp }}+ </AppButton>+ </SettingsRow>+ </SettingsGroup>+ </SettingsSection>++ <SettingsSection v-if="passkeysAvailable">+ <template #title>{{ messages.passkeys }}</template>+ <template #description>{{ messages.passkeysDescription }}</template>+ <template #actions>+ <AppButton size="sm" variant="outline" :disabled="busy" @click="emit('addPasskey')">+ <template #leading><icon-lucide-plus class="size-3.5" /></template>+ {{ messages.addPasskey }}+ </AppButton>+ </template>+ <SettingsGroup v-if="passkeys.length">+ <SettingsRow+ v-for="passkey in passkeys"+ :key="passkey.id"+ :label="passkey.name ?? messages.unnamedPasskey"+ :description="messages.passkeyAdded({ date: passkey.addedOn })"+ >+ <AppButton+ size="sm"+ variant="ghost"+ :disabled="busy"+ @click="emit('removePasskey', passkey.id)"+ >+ {{ messages.remove }}+ </AppButton>+ </SettingsRow>+ </SettingsGroup>+ <p v-else class="rounded border border-dashed border-border px-3 py-3 text-xs text-muted">+ {{ messages.noPasskeys }}+ </p>+ </SettingsSection>+ </div>+</template>diff --git a/src/components/cloud-portal/account/PortalAuthenticatorSetup.vue b/src/components/cloud-portal/account/PortalAuthenticatorSetup.vuenew file mode 100644index 000000000..10270d42b--- /dev/null+++ b/src/components/cloud-portal/account/PortalAuthenticatorSetup.vue@@ -0,0 +1,76 @@+<script setup lang="ts">+import { computedAsync } from '@vueuse/core'+import { toDataURL } from 'qrcode'+import { computed, ref } from 'vue'++import { useCloudPortalMessages } from '@open-pencil/vue'++import AppButton from '@/components/ui/button/AppButton.vue'+import AppDialogBody from '@/components/ui/dialog/AppDialogBody.vue'+import AppDialogHeader from '@/components/ui/dialog/AppDialogHeader.vue'+import AppDialogRoot from '@/components/ui/dialog/AppDialogRoot.vue'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'+import AppCopyField from '@/components/ui/input/AppCopyField.vue'+import AppInput from '@/components/ui/input/AppInput.vue'+import { portalForm } from '@/theme/cloud-portal/form'++/** Pairing an authenticator app: scan the code or type the key, then prove it works. */+const {+ uri,+ error = null,+ verifying = false+} = defineProps<{ uri: string; error?: string | null; verifying?: boolean }>()+const open = defineModel<boolean>('open', { default: false })+const emit = defineEmits<{ verify: [code: string] }>()++const ui = portalForm()+const messages = useCloudPortalMessages()+const code = ref('')+const secret = computed(() =>+ URL.canParse(uri) ? (new URL(uri).searchParams.get('secret') ?? '') : ''+)+// A newer key replaces a QR code still rendering for an older one; a failed render leaves the key.+const image = computedAsync(() => toDataURL(uri, { margin: 1, width: 176 }).catch(() => null), null)+</script>++<template>+ <AppDialogRoot v-model:open="open" size="sm">+ <AppDialogHeader+ :heading="messages.authenticatorSetupTitle"+ :description="messages.authenticatorSetupScan"+ :close-label="messages.cancel"+ />+ <AppDialogBody :ui="{ body: 'flex flex-col items-center gap-4' }">+ <img v-if="image" :src="image" alt="" class="size-44 rounded-lg bg-white p-2" />+ <div class="flex w-full flex-col gap-1.5">+ <span :class="ui.label()">{{ messages.authenticatorSetupKey }}</span>+ <AppCopyField+ :value="secret"+ :copy-label="messages.copyKey"+ :copied-label="messages.copied"+ look="command"+ />+ </div>+ <AppAlert v-if="error" tone="error" :heading="error" />+ <form class="flex w-full flex-col gap-3" novalidate @submit.prevent="emit('verify', code)">+ <AppInput+ v-model="code"+ inputmode="numeric"+ autocomplete="one-time-code"+ :aria-label="messages.authenticationCode"+ placeholder="000000"+ :ui="{ input: ui.code() }"+ />+ <AppButton+ type="submit"+ color="primary"+ variant="solid"+ :loading="verifying"+ :ui="{ base: ui.submit() }"+ >+ {{ messages.continue }}+ </AppButton>+ </form>+ </AppDialogBody>+ </AppDialogRoot>+</template>diff --git a/src/components/cloud-portal/account/PortalPasswordDialog.vue b/src/components/cloud-portal/account/PortalPasswordDialog.vuenew file mode 100644index 000000000..b426bd031--- /dev/null+++ b/src/components/cloud-portal/account/PortalPasswordDialog.vue@@ -0,0 +1,86 @@+<script setup lang="ts">+import { ref, watch } from 'vue'++import { useCloudPortalMessages } from '@open-pencil/vue'++import AppButton from '@/components/ui/button/AppButton.vue'+import AppDialogBody from '@/components/ui/dialog/AppDialogBody.vue'+import AppDialogFooter from '@/components/ui/dialog/AppDialogFooter.vue'+import AppDialogHeader from '@/components/ui/dialog/AppDialogHeader.vue'+import AppDialogRoot from '@/components/ui/dialog/AppDialogRoot.vue'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'+import AppInput from '@/components/ui/input/AppInput.vue'+import { portalForm } from '@/theme/cloud-portal/form'++/**+ * Asks for passwords: the current one to confirm a sensitive change, and a new one when the+ * change is the password itself.+ */+const {+ purpose,+ minimumPasswordLength = 15,+ error = null,+ saving = false+} = defineProps<{+ purpose: 'confirm' | 'change'+ minimumPasswordLength?: number+ error?: string | null+ saving?: boolean+}>()+const open = defineModel<boolean>('open', { default: false })+const emit = defineEmits<{ submit: [passwords: { current: string; next: string }] }>()++const ui = portalForm()+const messages = useCloudPortalMessages()+const current = ref('')+const next = ref('')+watch(open, (value) => {+ if (!value) {+ current.value = ''+ next.value = ''+ }+})+</script>++<template>+ <AppDialogRoot v-model:open="open" size="sm">+ <AppDialogHeader+ :heading="purpose === 'change' ? messages.changePasswordTitle : messages.confirmPasswordTitle"+ :close-label="messages.cancel"+ />+ <form novalidate @submit.prevent="emit('submit', { current, next })">+ <AppDialogBody :ui="{ body: 'flex flex-col gap-3' }">+ <AppAlert v-if="error" tone="error" :heading="messages.errorTitle" :description="error" />+ <div :class="ui.field()">+ <label for="portal-current-password" :class="ui.label()">+ {{ messages.currentPassword }}+ </label>+ <AppInput+ id="portal-current-password"+ v-model="current"+ type="password"+ autocomplete="current-password"+ />+ </div>+ <div v-if="purpose === 'change'" :class="ui.field()">+ <label for="portal-next-password" :class="ui.label()">{{ messages.newPassword }}</label>+ <AppInput+ id="portal-next-password"+ v-model="next"+ type="password"+ autocomplete="new-password"+ />+ <p :class="ui.hint()">{{ messages.passwordHint({ count: minimumPasswordLength }) }}</p>+ </div>+ </AppDialogBody>+ <AppDialogFooter>+ <AppButton type="button" variant="ghost" @click="open = false">{{+ messages.cancel+ }}</AppButton>+ <AppButton type="submit" color="primary" variant="solid" :loading="saving">+ {{ purpose === 'change' ? messages.savePassword : messages.continue }}+ </AppButton>+ </AppDialogFooter>+ </form>+ </AppDialogRoot>+</template>diff --git a/src/components/cloud-portal/account/PortalRecoveryCodes.vue b/src/components/cloud-portal/account/PortalRecoveryCodes.vuenew file mode 100644index 000000000..7959e2079--- /dev/null+++ b/src/components/cloud-portal/account/PortalRecoveryCodes.vue@@ -0,0 +1,43 @@+<script setup lang="ts">+import { useClipboard } from '@vueuse/core'++import { useCloudPortalMessages } from '@open-pencil/vue'++import AppButton from '@/components/ui/button/AppButton.vue'+import AppDialogBody from '@/components/ui/dialog/AppDialogBody.vue'+import AppDialogFooter from '@/components/ui/dialog/AppDialogFooter.vue'+import AppDialogHeader from '@/components/ui/dialog/AppDialogHeader.vue'+import AppDialogRoot from '@/components/ui/dialog/AppDialogRoot.vue'++/** Recovery codes, shown once right after they are made. */+const { codes } = defineProps<{ codes: string[] }>()+const open = defineModel<boolean>('open', { default: false })++const messages = useCloudPortalMessages()+const { copy, copied } = useClipboard({ copiedDuring: 1500 })+</script>++<template>+ <AppDialogRoot v-model:open="open" size="sm">+ <AppDialogHeader+ :heading="messages.recoveryCodesTitle"+ :description="messages.recoveryCodesDescription"+ :show-close="false"+ />+ <AppDialogBody>+ <ul+ class="grid grid-cols-2 gap-x-4 gap-y-1.5 rounded-lg bg-input px-4 py-3 font-mono text-xs"+ >+ <li v-for="code in codes" :key="code" class="select-all">{{ code }}</li>+ </ul>+ </AppDialogBody>+ <AppDialogFooter>+ <AppButton variant="outline" @click="copy(codes.join('\n'))">+ {{ copied ? messages.copied : messages.copyCodes }}+ </AppButton>+ <AppButton color="primary" variant="solid" @click="open = false">{{+ messages.done+ }}</AppButton>+ </AppDialogFooter>+ </AppDialogRoot>+</template>diff --git a/src/components/cloud-portal/auth/CloudPortalPublic.stories.ts b/src/components/cloud-portal/auth/CloudPortalPublic.stories.tsnew file mode 100644index 000000000..de7c948c6--- /dev/null+++ b/src/components/cloud-portal/auth/CloudPortalPublic.stories.ts@@ -0,0 +1,85 @@+import type { Meta, StoryObj } from '@storybook/vue3-vite'+import IconCheck from '~icons/lucide/check'+import IconClock from '~icons/lucide/clock'+import IconMailCheck from '~icons/lucide/mail-check'+import IconMonitorX from '~icons/lucide/monitor-x'++import AppButton from '@/components/ui/button/AppButton.vue'++import PortalDeviceApproval from './PortalDeviceApproval.vue'+import PortalNotice from './PortalNotice.vue'+import PortalResetPassword from './PortalResetPassword.vue'+import PortalSignIn from './PortalSignIn.vue'+import PortalTwoFactor from './PortalTwoFactor.vue'++const host = 'cloud.studio.example'+const frame = (inner: string) => `<div class="h-[720px]">${inner}</div>`+const components = {+ PortalDeviceApproval,+ PortalNotice,+ PortalResetPassword,+ PortalSignIn,+ PortalTwoFactor,+ AppButton,+ IconCheck,+ IconClock,+ IconMailCheck,+ IconMonitorX+}++const meta = {+ title: 'App/Cloud Portal/Public Pages',+ tags: ['autodocs'],+ parameters: { layout: 'fullscreen' }+} satisfies Meta++export default meta+type Story = StoryObj<typeof meta>++const story = (template: string): Story => ({+ render: () => ({ components, setup: () => ({ host }), template: frame(template) })+})++export const SignIn = story(+ `<PortalSignIn :host="host" mode="sign-in" :providers="['google', 'apple']" :email-password="{ signUp: true, minimumPasswordLength: 15 }" />`+)+export const SignInForTheDesktopApp = story(+ `<PortalSignIn :host="host" mode="sign-in" :providers="['google']" :email-password="{ signUp: true, minimumPasswordLength: 15 }" returns-to="desktop" />`+)+export const SignInWithAnError = story(+ `<PortalSignIn :host="host" mode="sign-in" :providers="[]" :email-password="{ signUp: false, minimumPasswordLength: 15 }" error="The email or password is wrong." />`+)+export const SignUpWithApproval = story(+ `<PortalSignIn :host="host" mode="sign-up" :providers="['google']" :email-password="{ signUp: true, minimumPasswordLength: 15 }" approval-required />`+)+export const CheckYourEmail = story(`+ <PortalNotice :host="host" heading="Check your email" description="We sent a link to [email protected]. Open it on this device to finish creating your account.">+ <template #icon><IconMailCheck class="size-5" /></template>+ <template #actions>+ <AppButton variant="outline">Send again</AppButton>+ <AppButton variant="ghost">Use another email</AppButton>+ </template>+ </PortalNotice>`)+export const WaitingForApproval = story(`+ <PortalNotice :host="host" tone="waiting" heading="Your request is with an administrator" description="We email [email protected] when you can sign in. Nothing else to do for now.">+ <template #icon><IconClock class="size-5" /></template>+ <template #actions><AppButton variant="ghost">Sign out</AppButton></template>+ </PortalNotice>`)+export const TwoStep = story(`<PortalTwoFactor :host="host" method="authenticator" passkeys />`)+export const TwoStepRecoveryCode = story(+ `<PortalTwoFactor :host="host" method="recovery" error="This code was already used." />`+)+export const ForgotPassword = story(`<PortalResetPassword :host="host" step="request" />`)+export const ChooseNewPassword = story(`<PortalResetPassword :host="host" step="choose" />`)+export const ApproveDesktopSignIn = story(+ `<PortalDeviceApproval :host="host" code="WDJB-MJHT" email="[email protected]" />`+)+export const DesktopSignInApproved = story(`+ <PortalNotice :host="host" tone="success" heading="You’re signed in" description="Go back to the OpenPencil app; it has already picked this up. You can close this tab.">+ <template #icon><IconCheck class="size-5" /></template>+ </PortalNotice>`)+export const DesktopSignInDenied = story(`+ <PortalNotice :host="host" heading="Sign-in denied" description="The app wasn’t signed in. If you didn’t start this, someone may know your password; change it in your account settings.">+ <template #icon><IconMonitorX class="size-5" /></template>+ <template #actions><AppButton variant="outline">Account settings</AppButton></template>+ </PortalNotice>`)diff --git a/src/components/cloud-portal/auth/PortalDeviceApproval.vue b/src/components/cloud-portal/auth/PortalDeviceApproval.vuenew file mode 100644index 000000000..26dd91884--- /dev/null+++ b/src/components/cloud-portal/auth/PortalDeviceApproval.vue@@ -0,0 +1,57 @@+<script setup lang="ts">+import { useCloudPortalMessages } from '@open-pencil/vue'++import AppButton from '@/components/ui/button/AppButton.vue'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'++import PortalPublicLayout from '../layout/PortalPublicLayout.vue'++/**+ * Approving a sign-in started in the desktop app: the person checks that the code matches the+ * one the app shows, then lets the app use their account.+ */+const {+ host,+ code,+ email,+ deciding = false,+ error = null+} = defineProps<{+ host: string+ code: string+ /** The signed-in account the app would use. */+ email: string+ deciding?: boolean+ /** Why the last approval or denial didn't go through; the person can try again. */+ error?: string | null+}>()+const emit = defineEmits<{ approve: []; deny: [] }>()+const messages = useCloudPortalMessages()+</script>++<template>+ <PortalPublicLayout+ :host="host"+ :heading="messages.deviceTitle"+ :description="messages.deviceDescription({ email })"+ >+ <div class="flex flex-col items-center gap-2 rounded-lg bg-input px-4 py-4">+ <span class="text-[11px] text-muted">{{ messages.deviceCheckCode }}</span>+ <span class="font-mono text-xl tracking-[0.3em] text-surface">{{ code }}</span>+ </div>+ <AppAlert v-if="error" tone="error" :heading="messages.errorTitle" :description="error" />+ <AppAlert+ tone="warning"+ :heading="messages.deviceWarningTitle"+ :description="messages.deviceWarningDescription"+ />+ <div class="flex items-center justify-end gap-2">+ <AppButton variant="ghost" :disabled="deciding" @click="emit('deny')">+ {{ messages.deny }}+ </AppButton>+ <AppButton color="primary" variant="solid" :loading="deciding" @click="emit('approve')">+ {{ messages.approve }}+ </AppButton>+ </div>+ </PortalPublicLayout>+</template>diff --git a/src/components/cloud-portal/auth/PortalNotice.vue b/src/components/cloud-portal/auth/PortalNotice.vuenew file mode 100644index 000000000..1eab90b37--- /dev/null+++ b/src/components/cloud-portal/auth/PortalNotice.vue@@ -0,0 +1,33 @@+<script setup lang="ts">+import PortalPublicLayout from '../layout/PortalPublicLayout.vue'++/** A Cloud page that tells the person where they stand and what to do next. */+const {+ host,+ heading,+ description,+ tone = 'neutral'+} = defineProps<{+ host: string+ heading: string+ description: string+ tone?: 'neutral' | 'success' | 'waiting'+}>()+</script>++<template>+ <PortalPublicLayout :host="host" :heading="heading" :description="description">+ <template #icon>+ <span+ class="flex size-10 items-center justify-center rounded-full bg-panel-field text-muted data-[tone=success]:bg-success/10 data-[tone=success]:text-success"+ :data-tone="tone"+ >+ <slot name="icon" />+ </span>+ </template>+ <slot />+ <div v-if="$slots.actions" class="flex flex-wrap items-center gap-2">+ <slot name="actions" />+ </div>+ </PortalPublicLayout>+</template>diff --git a/src/components/cloud-portal/auth/PortalResetPassword.vue b/src/components/cloud-portal/auth/PortalResetPassword.vuenew file mode 100644index 000000000..26fc74cb1--- /dev/null+++ b/src/components/cloud-portal/auth/PortalResetPassword.vue@@ -0,0 +1,78 @@+<script setup lang="ts">+import { ref } from 'vue'++import { useCloudPortalMessages } from '@open-pencil/vue'++import AppButton from '@/components/ui/button/AppButton.vue'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'+import AppInput from '@/components/ui/input/AppInput.vue'+import { portalForm } from '@/theme/cloud-portal/form'++import PortalPublicLayout from '../layout/PortalPublicLayout.vue'++/** Both halves of a password reset: asking for a link, then choosing a new password. */+const {+ host,+ step,+ minimumPasswordLength = 15,+ submitting = false,+ error = null+} = defineProps<{+ host: string+ step: 'request' | 'choose'+ minimumPasswordLength?: number+ submitting?: boolean+ error?: string | null+}>()+const emit = defineEmits<{ request: [email: string]; choose: [password: string]; back: [] }>()++const ui = portalForm()+const messages = useCloudPortalMessages()+const value = ref('')+</script>++<template>+ <PortalPublicLayout+ :host="host"+ :heading="step === 'request' ? messages.resetTitle : messages.chooseTitle"+ :description="step === 'request' ? messages.resetDescription : messages.chooseDescription"+ >+ <AppAlert v-if="error" tone="error" :heading="error" />+ <form+ :class="ui.form()"+ novalidate+ @submit.prevent="step === 'request' ? emit('request', value) : emit('choose', value)"+ >+ <div :class="ui.field()">+ <label for="portal-reset" :class="ui.label()">+ {{ step === 'request' ? messages.email : messages.newPassword }}+ </label>+ <AppInput+ id="portal-reset"+ v-model="value"+ :type="step === 'request' ? 'text' : 'password'"+ :inputmode="step === 'request' ? 'email' : undefined"+ :autocomplete="step === 'request' ? 'email' : 'new-password'"+ />+ <p v-if="step === 'choose'" :class="ui.hint()">+ {{ messages.passwordHint({ count: minimumPasswordLength }) }}+ </p>+ </div>+ <AppButton+ type="submit"+ color="primary"+ variant="solid"+ size="lg"+ :loading="submitting"+ :ui="{ base: ui.submit() }"+ >+ {{ step === 'request' ? messages.sendLink : messages.savePassword }}+ </AppButton>+ </form>+ <template #footer>+ <AppButton size="xs" variant="link" @click="emit('back')">{{+ messages.backToSignIn+ }}</AppButton>+ </template>+ </PortalPublicLayout>+</template>diff --git a/src/components/cloud-portal/auth/PortalSignIn.vue b/src/components/cloud-portal/auth/PortalSignIn.vuenew file mode 100644index 000000000..ac7cb2050--- /dev/null+++ b/src/components/cloud-portal/auth/PortalSignIn.vue@@ -0,0 +1,172 @@+<script setup lang="ts">+import { computed, ref } from 'vue'++import { useCloudPortalMessages } from '@open-pencil/vue'++import AppButton from '@/components/ui/button/AppButton.vue'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'+import AppInput from '@/components/ui/input/AppInput.vue'+import AppActionRow from '@/components/ui/list/AppActionRow.vue'+import { portalForm } from '@/theme/cloud-portal/form'++import PortalPublicLayout from '../layout/PortalPublicLayout.vue'+import type { PortalSignInMethod } from '../types'++/**+ * Signing in to or joining a Cloud server with what it offers: social accounts, email and+ * password, or both. Servers that review new people say so before anyone signs up.+ */+const {+ host,+ mode,+ providers,+ emailPassword,+ approvalRequired = false,+ error = null,+ submitting = false,+ returnsTo = null+} = defineProps<{+ host: string+ mode: 'sign-in' | 'sign-up'+ providers: PortalSignInMethod[]+ emailPassword: { signUp: boolean; minimumPasswordLength: number } | null+ approvalRequired?: boolean+ /** Why the last attempt failed, already worded for people. */+ error?: string | null+ submitting?: boolean+ /** Where the person goes after signing in. */+ returnsTo?: 'desktop' | 'editor' | null+}>()++const emit = defineEmits<{+ provider: [method: PortalSignInMethod]+ submit: [credentials: { name: string; email: string; password: string }]+ forgotPassword: []+ switchMode: []+}>()++const ui = portalForm()+const messages = useCloudPortalMessages()+const name = ref('')+const email = ref('')+const password = ref('')+const signUp = computed(() => mode === 'sign-up')+const labels = computed<Record<PortalSignInMethod, string>>(() => ({+ google: messages.value.continueWithGoogle,+ apple: messages.value.continueWithApple+}))+const description = computed(() => {+ if (returnsTo) {+ return messages.value.returnsTo({+ destination:+ returnsTo === 'desktop' ? messages.value.returnsToDesktop : messages.value.returnsToEditor+ })+ }+ return signUp.value ? messages.value.signUpDescription : messages.value.signInWelcome+})+const showForm = computed(() => !!emailPassword && (!signUp.value || emailPassword.signUp))+</script>++<template>+ <PortalPublicLayout+ :host="host"+ :heading="signUp ? messages.signUpTitle : messages.signInTitle"+ :description="description"+ >+ <AppAlert+ v-if="signUp && approvalRequired"+ tone="info"+ :heading="messages.approvalTitle"+ :description="messages.approvalDescription"+ />+ <AppAlert v-if="error" tone="error" :heading="messages.signInFailed" :description="error" />+ <AppAlert+ v-if="!providers.length && !showForm"+ tone="warning"+ :heading="messages.signInFailed"+ :description="messages.noSignInMethods"+ />++ <div v-if="providers.length" :class="ui.methods()">+ <AppActionRow+ v-for="method in providers"+ :key="method"+ :disabled="submitting"+ @click="emit('provider', method)"+ >+ <template #leading>+ <icon-ai-google v-if="method === 'google'" class="size-4 text-surface" />+ <icon-ai-apple v-else class="size-4 text-surface" />+ </template>+ {{ labels[method] }}+ <template #trailing><icon-lucide-chevron-right class="size-3.5" /></template>+ </AppActionRow>+ </div>++ <div v-if="providers.length && showForm" :class="ui.divider()">+ <span :class="ui.dividerLine()" />{{ messages.or }}<span :class="ui.dividerLine()" />+ </div>++ <form+ v-if="showForm && emailPassword"+ :class="ui.form()"+ novalidate+ @submit.prevent="emit('submit', { name, email, password })"+ >+ <div v-if="signUp" :class="ui.field()">+ <label for="portal-name" :class="ui.label()">{{ messages.name }}</label>+ <AppInput id="portal-name" v-model="name" autocomplete="name" />+ </div>+ <div :class="ui.field()">+ <label for="portal-email" :class="ui.label()">{{ messages.email }}</label>+ <AppInput+ id="portal-email"+ v-model="email"+ inputmode="email"+ autocomplete="email"+ :placeholder="messages.emailPlaceholder"+ />+ </div>+ <div :class="ui.field()">+ <div :class="ui.labelRow()">+ <label for="portal-password" :class="ui.label()">{{ messages.password }}</label>+ <AppButton+ v-if="!signUp"+ size="xs"+ variant="link"+ type="button"+ @click="emit('forgotPassword')"+ >+ {{ messages.forgotPassword }}+ </AppButton>+ </div>+ <AppInput+ id="portal-password"+ v-model="password"+ type="password"+ :autocomplete="signUp ? 'new-password' : 'current-password'"+ />+ <p v-if="signUp" :class="ui.hint()">+ {{ messages.passwordHint({ count: emailPassword.minimumPasswordLength }) }}+ </p>+ </div>+ <AppButton+ type="submit"+ color="primary"+ variant="solid"+ size="lg"+ :loading="submitting"+ :ui="{ base: ui.submit() }"+ >+ {{ signUp ? messages.createAccount : messages.signIn }}+ </AppButton>+ </form>++ <template v-if="emailPassword?.signUp || signUp" #footer>+ {{ signUp ? messages.haveAccount : messages.newHere }}+ <AppButton size="xs" variant="link" @click="emit('switchMode')">+ {{ signUp ? messages.signIn : messages.createAnAccount }}+ </AppButton>+ </template>+ </PortalPublicLayout>+</template>diff --git a/src/components/cloud-portal/auth/PortalTwoFactor.vue b/src/components/cloud-portal/auth/PortalTwoFactor.vuenew file mode 100644index 000000000..5f8425d7d--- /dev/null+++ b/src/components/cloud-portal/auth/PortalTwoFactor.vue@@ -0,0 +1,84 @@+<script setup lang="ts">+import { ref } from 'vue'++import { useCloudPortalMessages } from '@open-pencil/vue'++import AppButton from '@/components/ui/button/AppButton.vue'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'+import AppInput from '@/components/ui/input/AppInput.vue'+import { portalForm } from '@/theme/cloud-portal/form'++import PortalPublicLayout from '../layout/PortalPublicLayout.vue'++/** The second sign-in step: a code from an authenticator app, a recovery code, or a passkey. */+const {+ host,+ method,+ passkeys = false,+ error = null,+ verifying = false+} = defineProps<{+ host: string+ method: 'authenticator' | 'recovery'+ passkeys?: boolean+ error?: string | null+ verifying?: boolean+}>()+const emit = defineEmits<{+ verify: [code: string]+ switchMethod: []+ passkey: []+}>()++const ui = portalForm()+const messages = useCloudPortalMessages()+const code = ref('')+</script>++<template>+ <PortalPublicLayout+ :host="host"+ :heading="messages.twoStepTitle"+ :description="+ method === 'authenticator' ? messages.twoStepAuthenticator : messages.twoStepRecovery+ "+ >+ <AppAlert v-if="error" tone="error" :heading="error" />+ <form :class="ui.form()" novalidate @submit.prevent="emit('verify', code)">+ <AppInput+ v-model="code"+ :inputmode="method === 'authenticator' ? 'numeric' : 'text'"+ autocomplete="one-time-code"+ :aria-label="+ method === 'authenticator' ? messages.authenticationCode : messages.recoveryCode+ "+ :placeholder="method === 'authenticator' ? '000000' : 'xxxx-xxxx'"+ :ui="{ input: ui.code() }"+ />+ <AppButton+ type="submit"+ color="primary"+ variant="solid"+ size="lg"+ :loading="verifying"+ :ui="{ base: ui.submit() }"+ >+ {{ messages.continue }}+ </AppButton>+ </form>+ <div class="flex flex-wrap items-center justify-between gap-2">+ <AppButton size="xs" variant="link" @click="emit('switchMethod')">+ {{ method === 'authenticator' ? messages.useRecoveryCode : messages.useAuthenticator }}+ </AppButton>+ <AppButton+ v-if="passkeys"+ size="xs"+ variant="link"+ :disabled="verifying"+ @click="emit('passkey')"+ >+ {{ messages.usePasskey }}+ </AppButton>+ </div>+ </PortalPublicLayout>+</template>diff --git a/src/components/cloud-portal/console/CloudPortalConsole.stories.ts b/src/components/cloud-portal/console/CloudPortalConsole.stories.tsnew file mode 100644index 000000000..9f7f8d98c--- /dev/null+++ b/src/components/cloud-portal/console/CloudPortalConsole.stories.ts@@ -0,0 +1,157 @@+import type { Meta, StoryObj } from '@storybook/vue3-vite'+import { ref } from 'vue'++import PortalAccountSecurity from '../account/PortalAccountSecurity.vue'+import PortalConsoleLayout from '../layout/PortalConsoleLayout.vue'+import type { AccessRequest, PortalSection } from '../types'+import PortalAccessRequests from './PortalAccessRequests.vue'+import PortalActivity from './PortalActivity.vue'+import PortalEmailDelivery from './PortalEmailDelivery.vue'+import PortalPeople from './PortalPeople.vue'+import PortalStatus from './PortalStatus.vue'++const account = { id: 'user-ana', name: 'Ana Duarte', email: '[email protected]' }+const sections: PortalSection[] = [+ { id: 'security', label: 'Sign-in and security', group: 'Your account' },+ { id: 'status', label: 'Overview', group: 'Server' },+ { id: 'requests', label: 'Access requests', group: 'Server', count: 3 },+ { id: 'people', label: 'People', group: 'Server' },+ { id: 'email', label: 'Email delivery', group: 'Server' },+ { id: 'activity', label: 'Activity', group: 'Server' }+]+const requests: AccessRequest[] = [+ {+ id: '1',+ name: 'Chloe Martin',+ email: '[email protected]',+ reason: 'Freelance illustrator on the spring campaign; Ben asked me to join.',+ requestedOn: '2 hours ago',+ status: 'pending'+ },+ {+ id: '2',+ name: 'Diego Ruiz',+ email: '[email protected]',+ reason: '',+ requestedOn: 'yesterday',+ status: 'pending'+ },+ {+ id: '3',+ name: 'Priya Nair',+ email: '[email protected]',+ reason: 'Reviewing the new brand system with the studio.',+ requestedOn: '3 days ago',+ status: 'pending'+ }+]+const components = {+ PortalConsoleLayout,+ PortalAccountSecurity,+ PortalAccessRequests,+ PortalActivity,+ PortalEmailDelivery,+ PortalPeople,+ PortalStatus+}++const meta = {+ title: 'App/Cloud Portal/Console',+ tags: ['autodocs'],+ parameters: { layout: 'fullscreen' }+} satisfies Meta++export default meta+type Story = StoryObj<typeof meta>++const story = (+ active: string,+ heading: string,+ description: string,+ body: string,+ extra = {}+): Story => ({+ render: () => ({+ components,+ setup: () => ({ account, sections, requests, filter: ref('pending'), ...extra }),+ template: `+ <div class="h-[720px]">+ <PortalConsoleLayout host="cloud.studio.example" :account="account" :sections="sections" active="${active}" heading="${heading}" description="${description}">+ ${body}+ </PortalConsoleLayout>+ </div>`+ })+})++export const SignInAndSecurity = story(+ 'security',+ 'Sign-in and security',+ 'How you sign in to cloud.studio.example.',+ `<PortalAccountSecurity+ :methods="[{ id: 'm1', provider: 'google', linkedOn: 'in March', canUnlink: true }, { id: 'm2', provider: 'credential', linkedOn: 'in March', canUnlink: true }]"+ :linkable="['apple']"+ :authenticator="{ available: true, on: true }"+ :passkeys="[{ id: 'p1', name: 'MacBook Pro', addedOn: 'in July' }]"+ />`+)+export const AdministratorWithoutTwoStep = story(+ 'security',+ 'Sign-in and security',+ 'How you sign in to cloud.studio.example.',+ `<PortalAccountSecurity+ two-step-required+ :methods="[{ id: 'm1', provider: 'google', linkedOn: 'in March', canUnlink: false }]"+ :linkable="[]"+ :authenticator="{ available: true, on: false }"+ :passkeys="[]"+ />`+)+export const Overview = story(+ 'status',+ 'Overview',+ 'cloud.studio.example',+ `<PortalStatus :status="{ deployment: 'self-hosted', enrollmentMode: 'approval', emailTransport: 'smtp', pendingEnrollment: 3, pendingEmail: 0, failedEmail: 1 }" />`+)+export const AccessRequests = story(+ 'requests',+ 'Access requests',+ 'People asking to join. Approving lets them sign in; each gets an email either way.',+ `<PortalAccessRequests v-model:filter="filter" :requests="requests" />`+)+export const NoAccessRequests = story(+ 'requests',+ 'Access requests',+ 'People asking to join. Approving lets them sign in; each gets an email either way.',+ `<PortalAccessRequests v-model:filter="filter" :requests="[]" />`+)+export const People = story(+ 'people',+ 'People',+ '24 accounts on this server.',+ `<PortalPeople :people="[+ { id: 'user-ana', name: 'Ana Duarte', email: '[email protected]', admin: true, suspended: false, joinedOn: 'in March', you: true },+ { id: 'user-ben', name: 'Ben Ortiz', email: '[email protected]', admin: true, suspended: false, joinedOn: 'in March' },+ { id: 'user-mia', name: 'Mia Chen', email: '[email protected]', admin: false, suspended: false, joinedOn: 'in June' },+ { id: 'user-tom', name: 'Tom Weber', email: '[email protected]', admin: false, suspended: true, joinedOn: 'last week' }+ ]" />`+)+export const EmailDelivery = story(+ 'email',+ 'Email delivery',+ 'Invitations, sign-in links, and access decisions the server sends.',+ `<PortalEmailDelivery :emails="[+ { id: 'e1', kind: 'document-invitation', recipient: '[email protected]', status: 'failed', attempts: 5, when: '10:42', error: 'Mailbox unavailable' },+ { id: 'e2', kind: 'email-verification', recipient: '[email protected]', status: 'sent', attempts: 1, when: '09:15' },+ { id: 'e3', kind: 'enrollment-approved', recipient: '[email protected]', status: 'sent', attempts: 1, when: 'Yesterday' }+ ]" />`+)+export const Activity = story(+ 'activity',+ 'Activity',+ 'What administrators did on this server.',+ `<PortalActivity :entries="[+ { id: 'a1', actor: { id: 'user-ana', name: 'Ana Duarte' }, action: 'enrollment.approved', target: '[email protected]', when: 'Yesterday' },+ { id: 'a2', actor: { id: 'user-ben', name: 'Ben Ortiz' }, action: 'user.banned', target: '[email protected]', when: 'Mon' },+ { id: 'a3', actor: { id: 'user-ana', name: 'Ana Duarte' }, action: 'user.admin-granted', target: 'Ben Ortiz', when: 'Sep 28' }+ ]" />`+)diff --git a/src/components/cloud-portal/console/PortalAccessRequests.vue b/src/components/cloud-portal/console/PortalAccessRequests.vuenew file mode 100644index 000000000..1c55785e6--- /dev/null+++ b/src/components/cloud-portal/console/PortalAccessRequests.vue@@ -0,0 +1,120 @@+<script setup lang="ts">+import { computed } from 'vue'++import { useCloudPortalMessages } from '@open-pencil/vue'++import AccountAvatar from '@/components/presence/AccountAvatar.vue'+import AppButton from '@/components/ui/button/AppButton.vue'+import AppPlaceholder from '@/components/ui/feedback/AppPlaceholder.vue'+import SegmentedControl from '@/components/ui/select/SegmentedControl.vue'+import { portalList } from '@/theme/cloud-portal/list'++import type { AccessRequest, AccessRequestStatus } from '../types'++/** People asking to join a server that reviews new accounts, and the decisions made so far. */+const { requests, busy = null } = defineProps<{+ requests: AccessRequest[]+ /** The request a decision is being saved for. */+ busy?: string | null+}>()+const filter = defineModel<AccessRequestStatus>('filter', { default: 'pending' })+const emit = defineEmits<{ approve: [id: string]; reject: [id: string]; revoke: [id: string] }>()++const ui = portalList()+const messages = useCloudPortalMessages()+const tones = {+ pending: 'warning',+ approved: 'success',+ rejected: 'neutral',+ revoked: 'error'+} as const+const labels = computed(() => ({+ pending: messages.value.statusWaiting,+ approved: messages.value.statusApproved,+ rejected: messages.value.statusDeclined,+ revoked: messages.value.statusRemoved+}))+function detail(request: AccessRequest) {+ const asked = messages.value.asked({ date: request.requestedOn })+ if (!request.reviewedBy || request.status === 'pending') return asked+ const decision = labels.value[request.status]+ return `${asked} · ${messages.value.reviewedBy({ decision, name: request.reviewedBy })}`+}+</script>++<template>+ <div class="flex flex-col gap-3">+ <div :class="ui.toolbar()">+ <SegmentedControl+ v-model="filter"+ required+ :label="messages.accessRequests"+ :options="[+ { value: 'pending', label: messages.filterWaiting },+ { value: 'approved', label: messages.filterApproved },+ { value: 'rejected', label: messages.filterDeclined },+ { value: 'revoked', label: messages.filterRemoved }+ ]"+ />+ </div>+ <ul v-if="requests.length" :class="ui.list()">+ <li v-for="request in requests" :key="request.id" :class="ui.row()">+ <AccountAvatar :id="request.email" :name="request.name ?? request.email" size="md" />+ <div :class="ui.body()">+ <p :class="ui.title()">+ {{ request.name ?? request.email }}+ <span v-if="request.name" class="font-normal text-muted">{{ request.email }}</span>+ </p>+ <p v-if="request.reason" :class="ui.quote()">“{{ request.reason }}”</p>+ <p :class="ui.detail()">{{ detail(request) }}</p>+ </div>+ <span+ v-if="request.status !== 'pending'"+ :class="ui.status()"+ :data-tone="tones[request.status]"+ >+ {{ labels[request.status] }}+ </span>+ <div :class="ui.actions()">+ <template v-if="request.status === 'pending'">+ <AppButton+ size="sm"+ variant="ghost"+ :disabled="busy === request.id"+ @click="emit('reject', request.id)"+ >+ {{ messages.decline }}+ </AppButton>+ <AppButton+ size="sm"+ color="primary"+ variant="solid"+ :loading="busy === request.id"+ @click="emit('approve', request.id)"+ >+ {{ messages.approve }}+ </AppButton>+ </template>+ <AppButton+ v-else-if="request.status === 'approved'"+ size="sm"+ variant="ghost"+ :loading="busy === request.id"+ @click="emit('revoke', request.id)"+ >+ {{ messages.removeAccess }}+ </AppButton>+ </div>+ </li>+ </ul>+ <AppPlaceholder+ v-else+ size="page"+ :label="filter === 'pending' ? messages.noOneWaiting : messages.nothingHere"+ :description="messages.requestsEmptyDescription"+ :ui="{ root: 'rounded-lg border border-dashed border-border' }"+ >+ <template #icon><icon-lucide-inbox class="size-5" /></template>+ </AppPlaceholder>+ </div>+</template>diff --git a/src/components/cloud-portal/console/PortalActivity.vue b/src/components/cloud-portal/console/PortalActivity.vuenew file mode 100644index 000000000..a23edf33b--- /dev/null+++ b/src/components/cloud-portal/console/PortalActivity.vue@@ -0,0 +1,40 @@+<script setup lang="ts">+import { computed } from 'vue'++import { useCloudPortalMessages } from '@open-pencil/vue'++import AccountAvatar from '@/components/presence/AccountAvatar.vue'+import { portalList } from '@/theme/cloud-portal/list'++import type { PortalActivityEntry } from '../types'++/** What administrators did on the server, newest first. */+const { entries } = defineProps<{ entries: PortalActivityEntry[] }>()+const ui = portalList()+const messages = useCloudPortalMessages()+const actions = computed<Record<string, string>>(() => ({+ 'enrollment.approved': messages.value.activityApproved,+ 'enrollment.rejected': messages.value.activityRejected,+ 'enrollment.revoked': messages.value.activityRevoked,+ 'user.banned': messages.value.activitySuspended,+ 'user.unbanned': messages.value.activityRestored,+ 'user.sessions-revoked': messages.value.activitySignedOut,+ 'user.admin-granted': messages.value.activityMadeAdmin,+ 'user.admin-revoked': messages.value.activityRemovedAdmin,+ 'email.regenerated': messages.value.activityEmailRetried+}))+</script>++<template>+ <ul :class="ui.list()">+ <li v-for="entry in entries" :key="entry.id" :class="ui.row()">+ <AccountAvatar :id="entry.actor.id" :name="entry.actor.name" />+ <p :class="[ui.body(), 'text-xs text-muted']">+ <span class="font-medium text-surface">{{ entry.actor.name }}</span>+ {{ actions[entry.action] ?? messages.activityChanged }}+ <span class="text-surface">{{ entry.target }}</span>+ </p>+ <span :class="ui.meta()">{{ entry.when }}</span>+ </li>+ </ul>+</template>diff --git a/src/components/cloud-portal/console/PortalEmailDelivery.vue b/src/components/cloud-portal/console/PortalEmailDelivery.vuenew file mode 100644index 000000000..4d73800f3--- /dev/null+++ b/src/components/cloud-portal/console/PortalEmailDelivery.vue@@ -0,0 +1,72 @@+<script setup lang="ts">+import { computed } from 'vue'++import { useCloudPortalMessages } from '@open-pencil/vue'++import AppButton from '@/components/ui/button/AppButton.vue'+import { portalList } from '@/theme/cloud-portal/list'++import type { PortalEmail } from '../types'++/** Email the server sends, such as invitations and sign-in links, and whether it went out. */+const { emails, busy = null } = defineProps<{ emails: PortalEmail[]; busy?: string | null }>()+const emit = defineEmits<{ retry: [id: string] }>()++const ui = portalList()+const messages = useCloudPortalMessages()+const tones = {+ sent: 'success',+ waiting: 'neutral',+ failed: 'error',+ suppressed: 'neutral'+} as const+const statusLabels = computed(() => ({+ sent: messages.value.emailSent,+ waiting: messages.value.emailWaiting,+ failed: messages.value.emailFailed,+ suppressed: messages.value.emailSuppressed+}))+const kindLabels = computed<Record<string, string>>(() => ({+ 'document-invitation': messages.value.emailKindInvitation,+ 'enrollment-requested': messages.value.emailKindEnrollmentRequested,+ 'admin-enrollment-notification': messages.value.emailKindAdminNotification,+ 'enrollment-approved': messages.value.emailKindEnrollmentApproved,+ 'enrollment-rejected': messages.value.emailKindEnrollmentRejected,+ 'enrollment-revoked': messages.value.emailKindEnrollmentRevoked,+ 'email-verification': messages.value.emailKindVerification,+ 'password-reset': messages.value.emailKindPasswordReset,+ 'password-changed': messages.value.emailKindPasswordChanged+}))+function detail(email: PortalEmail) {+ const to = messages.value.emailTo({ recipient: email.recipient })+ if (email.error) return `${to} · ${email.error}`+ return email.attempts > 1 ? `${to} · ${messages.value.attempts(email.attempts)}` : to+}+</script>++<template>+ <ul :class="ui.list()">+ <li v-for="email in emails" :key="email.id" :class="ui.row()">+ <icon-lucide-mail class="size-4 shrink-0 text-muted" />+ <div :class="ui.body()">+ <p :class="ui.title()">{{ kindLabels[email.kind] ?? messages.emailKindOther }}</p>+ <p :class="ui.detail()">{{ detail(email) }}</p>+ </div>+ <span :class="ui.status()" :data-tone="tones[email.status]">+ {{ statusLabels[email.status] }}+ </span>+ <span :class="ui.meta()">{{ email.when }}</span>+ <div :class="[ui.actions(), 'w-16 justify-end']">+ <AppButton+ v-if="email.status === 'failed'"+ size="sm"+ variant="outline"+ :loading="busy === email.id"+ @click="emit('retry', email.id)"+ >+ {{ messages.retry }}+ </AppButton>+ </div>+ </li>+ </ul>+</template>diff --git a/src/components/cloud-portal/console/PortalPeople.vue b/src/components/cloud-portal/console/PortalPeople.vuenew file mode 100644index 000000000..bb193df0c--- /dev/null+++ b/src/components/cloud-portal/console/PortalPeople.vue@@ -0,0 +1,104 @@+<script setup lang="ts">+import {+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuPortal,+ DropdownMenuRoot,+ DropdownMenuSeparator,+ DropdownMenuTrigger+} from 'reka-ui'++import { useCloudPortalMessages } from '@open-pencil/vue'++import AccountAvatar from '@/components/presence/AccountAvatar.vue'+import IconButton from '@/components/ui/button/IconButton.vue'+import AppInput from '@/components/ui/input/AppInput.vue'+import { menu } from '@/components/ui/menu/menu'+import { portalList } from '@/theme/cloud-portal/list'++import type { PortalPerson } from '../types'++/** Everyone with an account on the server, with what an administrator can change about them. */+const { people } = defineProps<{ people: PortalPerson[] }>()+const query = defineModel<string>('query', { default: '' })+const emit = defineEmits<{+ toggleAdmin: [person: PortalPerson]+ signOutEverywhere: [person: PortalPerson]+ toggleSuspended: [person: PortalPerson]+}>()++const ui = portalList()+const menuUI = menu()+const messages = useCloudPortalMessages()+</script>++<template>+ <div class="flex flex-col gap-3">+ <div :class="ui.toolbar()">+ <AppInput+ v-model="query"+ type="search"+ density="compact"+ :placeholder="messages.searchPeople"+ :aria-label="messages.searchPeople"+ class="w-64"+ >+ <template #leading><icon-lucide-search class="size-3.5" /></template>+ </AppInput>+ </div>+ <ul :class="ui.list()">+ <li v-for="person in people" :key="person.id" :class="ui.row()">+ <AccountAvatar :id="person.id" :name="person.name" size="md" />+ <div :class="ui.body()">+ <p :class="ui.title()">+ {{ person.name }}+ <span v-if="person.you" class="font-normal text-muted">{{ messages.you }}</span>+ </p>+ <p :class="ui.detail()">{{ person.email }}</p>+ </div>+ <span v-if="person.admin" :class="ui.status()" data-tone="neutral">+ {{ messages.administrator }}+ </span>+ <span v-if="person.suspended" :class="ui.status()" data-tone="error">+ {{ messages.suspended }}+ </span>+ <span :class="ui.meta()">{{ messages.joined({ date: person.joinedOn }) }}</span>+ <DropdownMenuRoot :modal="false">+ <DropdownMenuTrigger as-child>+ <IconButton :label="messages.actionsFor({ name: person.name })" :disabled="person.you">+ <icon-lucide-ellipsis class="size-3.5" />+ </IconButton>+ </DropdownMenuTrigger>+ <DropdownMenuPortal>+ <DropdownMenuContent+ side="bottom"+ align="end"+ :side-offset="4"+ :class="[menuUI.content(), 'w-52']"+ >+ <DropdownMenuItem+ :class="menuUI.item({ justify: 'start' })"+ @select="emit('toggleAdmin', person)"+ >+ {{ person.admin ? messages.removeAdministrator : messages.makeAdministrator }}+ </DropdownMenuItem>+ <DropdownMenuItem+ :class="menuUI.item({ justify: 'start' })"+ @select="emit('signOutEverywhere', person)"+ >+ {{ messages.signOutEverywhere }}+ </DropdownMenuItem>+ <DropdownMenuSeparator :class="menuUI.separator()" />+ <DropdownMenuItem+ :class="menuUI.item({ justify: 'start' })"+ @select="emit('toggleSuspended', person)"+ >+ {{ person.suspended ? messages.restoreAccount : messages.suspendAccount }}+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenuPortal>+ </DropdownMenuRoot>+ </li>+ </ul>+ </div>+</template>diff --git a/src/components/cloud-portal/console/PortalStatus.vue b/src/components/cloud-portal/console/PortalStatus.vuenew file mode 100644index 000000000..279e9ab61--- /dev/null+++ b/src/components/cloud-portal/console/PortalStatus.vue@@ -0,0 +1,97 @@+<script setup lang="ts">+import { computed } from 'vue'++import { useCloudPortalMessages } from '@open-pencil/vue'++import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'+import SettingsRow from '@/components/settings/layout/SettingsRow.vue'+import SettingsSection from '@/components/settings/layout/SettingsSection.vue'+import AppButton from '@/components/ui/button/AppButton.vue'++import type { PortalServerStatus } from '../types'++/** How the server is set up and what is waiting on an administrator. */+const { status } = defineProps<{ status: PortalServerStatus }>()+const emit = defineEmits<{ open: [section: 'requests' | 'email'] }>()+const messages = useCloudPortalMessages()++const deployment = computed(() =>+ status.deployment === 'official'+ ? messages.value.deploymentOfficial+ : messages.value.deploymentSelfHosted+)+const enrollment = computed(+ () =>+ ({+ open: messages.value.enrollmentOpen,+ approval: messages.value.enrollmentApproval,+ closed: messages.value.enrollmentClosed+ })[status.enrollmentMode]+)+const transport = computed(+ () =>+ ({+ none: messages.value.emailTransportNone,+ smtp: messages.value.emailTransportSMTP,+ cloudflare: messages.value.emailTransportCloudflare+ })[status.emailTransport]+)+const email = computed(() => {+ if (status.failedEmail)+ return messages.value.emailStatus({ failed: status.failedEmail, waiting: status.pendingEmail })+ if (status.pendingEmail) return messages.value.emailWaitingOnly(status.pendingEmail)+ return messages.value.emailAllSent+})+</script>++<template>+ <div class="flex max-w-2xl flex-col gap-6">+ <SettingsSection>+ <template #title>{{ messages.needsAttention }}</template>+ <SettingsGroup>+ <SettingsRow+ :label="messages.accessRequests"+ :description="+ status.pendingEnrollment+ ? messages.waitingRequests(status.pendingEnrollment)+ : messages.noOneIsWaiting+ "+ >+ <AppButton+ v-if="status.pendingEnrollment"+ size="sm"+ variant="outline"+ @click="emit('open', 'requests')"+ >+ {{ messages.review }}+ </AppButton>+ </SettingsRow>+ <SettingsRow :label="messages.emailDelivery" :description="email">+ <AppButton+ v-if="status.failedEmail"+ size="sm"+ variant="outline"+ @click="emit('open', 'email')"+ >+ {{ messages.open }}+ </AppButton>+ </SettingsRow>+ </SettingsGroup>+ </SettingsSection>+ <SettingsSection>+ <template #title>{{ messages.serverSection }}</template>+ <template #description>{{ messages.serverSectionDescription }}</template>+ <SettingsGroup>+ <SettingsRow :label="messages.deployment">+ <span class="text-xs text-muted">{{ deployment }}</span>+ </SettingsRow>+ <SettingsRow :label="messages.newAccounts">+ <span class="text-xs text-muted">{{ enrollment }}</span>+ </SettingsRow>+ <SettingsRow :label="messages.emailDelivery">+ <span class="text-xs text-muted">{{ transport }}</span>+ </SettingsRow>+ </SettingsGroup>+ </SettingsSection>+ </div>+</template>diff --git a/src/components/cloud-portal/layout/PortalConsoleLayout.vue b/src/components/cloud-portal/layout/PortalConsoleLayout.vuenew file mode 100644index 000000000..6e1158361--- /dev/null+++ b/src/components/cloud-portal/layout/PortalConsoleLayout.vue@@ -0,0 +1,81 @@+<script setup lang="ts">+import { uniq } from 'es-toolkit'++import { useCloudPortalMessages } from '@open-pencil/vue'++import BrandMark from '@/components/brand/BrandMark.vue'+import AccountAvatar from '@/components/presence/AccountAvatar.vue'+import IconButton from '@/components/ui/button/IconButton.vue'+import { portalLayout } from '@/theme/cloud-portal/layout'+import { sideList } from '@/theme/list/side-list'++import type { PortalSection } from '../types'++/**+ * Signed-in Cloud pages: account settings and, for operators, the deployment console. The side+ * list is drawn like the editor's Pages panel.+ */+const { host, account, sections, active, heading, description } = defineProps<{+ host: string+ account: { id: string; name: string; email: string }+ sections: PortalSection[]+ active: string+ heading: string+ description?: string+}>()+const emit = defineEmits<{ select: [id: string]; signOut: [] }>()++const ui = portalLayout()+const messages = useCloudPortalMessages()+const side = sideList()+const groups = () => uniq(sections.map((section) => section.group))+</script>++<template>+ <div :class="ui.page()">+ <header :class="ui.bar()">+ <BrandMark variant="micro" decorative />+ <span :class="ui.barTitle()">{{ messages.productName }}</span>+ <span :class="ui.barHost()">{{ host }}</span>+ <div :class="ui.barEnd()">+ <span :class="ui.barHost()">{{ account.email }}</span>+ <AccountAvatar :id="account.id" :name="account.name" />+ <IconButton :label="messages.signOut" @click="emit('signOut')">+ <icon-lucide-log-out class="size-3.5" />+ </IconButton>+ </div>+ </header>+ <div :class="ui.console()">+ <nav :class="side.root({ class: ui.nav() })" :aria-label="messages.productName">+ <div v-for="group in groups()" :key="group" :class="side.group({ class: ui.navGroup() })">+ <div :class="side.header({ class: ui.navHeader() })">+ <span :class="side.title()">{{ group }}</span>+ </div>+ <div :class="side.items({ class: ui.navItems() })">+ <button+ v-for="section in sections.filter((candidate) => candidate.group === group)"+ :key="section.id"+ type="button"+ :class="side.item({ class: ui.navItem() })"+ :data-active="section.id === active"+ :aria-current="section.id === active ? 'page' : undefined"+ @click="emit('select', section.id)"+ >+ <span :class="side.label()">{{ section.label }}</span>+ <span v-if="section.count" :class="side.trailing()">{{ section.count }}</span>+ </button>+ </div>+ </div>+ </nav>+ <main :class="ui.main()">+ <div :class="ui.mainInner()">+ <header>+ <h1 :class="ui.pageTitle()">{{ heading }}</h1>+ <p v-if="description" :class="ui.pageDescription()">{{ description }}</p>+ </header>+ <slot />+ </div>+ </main>+ </div>+ </div>+</template>diff --git a/src/components/cloud-portal/layout/PortalPublicLayout.vue b/src/components/cloud-portal/layout/PortalPublicLayout.vuenew file mode 100644index 000000000..767558e4c--- /dev/null+++ b/src/components/cloud-portal/layout/PortalPublicLayout.vue@@ -0,0 +1,39 @@+<script setup lang="ts">+import { useCloudPortalMessages } from '@open-pencil/vue'++import BrandMark from '@/components/brand/BrandMark.vue'+import { portalLayout } from '@/theme/cloud-portal/layout'++/** A Cloud page for people who are signing in or answering a request, around one card. */+const { host, heading, description } = defineProps<{+ host: string+ heading: string+ description?: string+}>()++const ui = portalLayout()+const messages = useCloudPortalMessages()+</script>++<template>+ <div :class="ui.page()">+ <header :class="ui.bar()">+ <BrandMark variant="micro" decorative />+ <span :class="ui.barTitle()">{{ messages.productName }}</span>+ <span :class="ui.barHost()">{{ host }}</span>+ </header>+ <main :class="ui.center()">+ <section :class="ui.card()" :aria-label="heading">+ <slot name="icon" />+ <div :class="ui.cardHeader()">+ <h1 :class="ui.cardTitle()">{{ heading }}</h1>+ <p v-if="description" :class="ui.cardDescription()">{{ description }}</p>+ </div>+ <slot />+ <footer v-if="$slots.footer" :class="ui.cardFooter()">+ <slot name="footer" />+ </footer>+ </section>+ </main>+ </div>+</template>diff --git a/src/components/cloud-portal/sections/AdminActivitySection.vue b/src/components/cloud-portal/sections/AdminActivitySection.vuenew file mode 100644index 000000000..965688769--- /dev/null+++ b/src/components/cloud-portal/sections/AdminActivitySection.vue@@ -0,0 +1,41 @@+<script setup lang="ts">+import { useCloudPortalMessages, useI18n } from '@open-pencil/vue'++import { usePortal } from '@/app/cloud-portal/context'+import { portalDate } from '@/app/cloud-portal/format'+import { usePortalLoad } from '@/app/cloud-portal/state'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'++import PortalActivity from '../console/PortalActivity.vue'+import type { PortalActivityEntry } from '../types'++const portal = usePortal()+const messages = useCloudPortalMessages()+const { locale } = useI18n()++const { data: entries, error } = usePortalLoad(async (): Promise<PortalActivityEntry[]> => {+ // Events name accounts by ID; the people list gives them names.+ const [{ events }, { users }, { enrollments }] = await Promise.all([+ portal.api.audit(),+ portal.api.users(),+ portal.api.enrollments()+ ])+ const names = new Map(users.map((user) => [user.id, user.name]))+ const requesters = new Map(enrollments.map((enrollment) => [enrollment.id, enrollment.email]))+ return events.map((event) => ({+ id: event.id,+ actor: {+ id: event.actorUserId,+ name: names.get(event.actorUserId) ?? messages.value.someoneElse+ },+ action: event.action,+ target: names.get(event.subjectId) ?? requesters.get(event.subjectId) ?? event.subjectId,+ when: portalDate(event.createdAt, locale.value)+ }))+}, [])+</script>++<template>+ <AppAlert v-if="error" tone="error" :heading="messages.errorTitle" :description="error" />+ <PortalActivity v-else :entries="entries" />+</template>diff --git a/src/components/cloud-portal/sections/AdminEmailSection.vue b/src/components/cloud-portal/sections/AdminEmailSection.vuenew file mode 100644index 000000000..8753bc6c3--- /dev/null+++ b/src/components/cloud-portal/sections/AdminEmailSection.vue@@ -0,0 +1,58 @@+<script setup lang="ts">+import { computed } from 'vue'++import { useCloudPortalMessages, useI18n } from '@open-pencil/vue'++import { usePortal } from '@/app/cloud-portal/context'+import { portalDate } from '@/app/cloud-portal/format'+import { usePortalAction, usePortalLoad } from '@/app/cloud-portal/state'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'++import PortalEmailDelivery from '../console/PortalEmailDelivery.vue'+import type { PortalEmail } from '../types'++const portal = usePortal()+const messages = useCloudPortalMessages()+const { locale } = useI18n()++function deliveryStatus(status: string): PortalEmail['status'] {+ if (status === 'accepted') return 'sent'+ if (status === 'failed') return 'failed'+ if (status === 'suppressed') return 'suppressed'+ return 'waiting'+}++const {+ data: emails,+ error: loadError,+ reload+} = usePortalLoad(async (): Promise<PortalEmail[]> => {+ const { messages: rows } = await portal.api.email()+ return rows.map((row) => ({+ id: row.id,+ kind: row.kind,+ recipient: row.recipientEmailNormalized,+ status: deliveryStatus(row.status),+ attempts: row.attemptCount,+ when: portalDate(row.nextAttemptAt, locale.value),+ error: row.lastErrorCode+ }))+}, [])++const {+ subject: busy,+ error: retryError,+ run: retry+} = usePortalAction(async (id: string) => {+ await portal.api.regenerateEmail(id)+ await reload()+})+const error = computed(() => retryError.value ?? loadError.value)+</script>++<template>+ <div class="flex flex-col gap-3">+ <AppAlert v-if="error" tone="error" :heading="messages.errorTitle" :description="error" />+ <PortalEmailDelivery :emails="emails" :busy="busy" @retry="retry" />+ </div>+</template>diff --git a/src/components/cloud-portal/sections/AdminOverviewSection.vue b/src/components/cloud-portal/sections/AdminOverviewSection.vuenew file mode 100644index 000000000..82765fbf8--- /dev/null+++ b/src/components/cloud-portal/sections/AdminOverviewSection.vue@@ -0,0 +1,23 @@+<script setup lang="ts">+import { useCloudPortalMessages } from '@open-pencil/vue'++import { usePortal } from '@/app/cloud-portal/context'+import { usePortalLoad } from '@/app/cloud-portal/state'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'++import PortalStatus from '../console/PortalStatus.vue'+import type { PortalServerStatus } from '../types'++const emit = defineEmits<{ open: [section: 'requests' | 'email'] }>()+const portal = usePortal()+const messages = useCloudPortalMessages()+const { data: status, error } = usePortalLoad<PortalServerStatus | null>(+ () => portal.api.operations(),+ null+)+</script>++<template>+ <AppAlert v-if="error" tone="error" :heading="messages.errorTitle" :description="error" />+ <PortalStatus v-else-if="status" :status="status" @open="(section) => emit('open', section)" />+</template>diff --git a/src/components/cloud-portal/sections/AdminPeopleSection.vue b/src/components/cloud-portal/sections/AdminPeopleSection.vuenew file mode 100644index 000000000..711ed45e3--- /dev/null+++ b/src/components/cloud-portal/sections/AdminPeopleSection.vue@@ -0,0 +1,67 @@+<script setup lang="ts">+import { refDebounced } from '@vueuse/core'+import { computed, ref, watch } from 'vue'++import { useCloudPortalMessages, useI18n } from '@open-pencil/vue'++import { usePortal } from '@/app/cloud-portal/context'+import { portalDate } from '@/app/cloud-portal/format'+import { usePortalAction, usePortalLoad } from '@/app/cloud-portal/state'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'++import PortalPeople from '../console/PortalPeople.vue'+import type { PortalPerson } from '../types'++const emit = defineEmits<{ total: [count: number] }>()+const portal = usePortal()+const messages = useCloudPortalMessages()+const { locale } = useI18n()+const query = ref('')+const search = refDebounced(query, 250)++const {+ data: listing,+ error: loadError,+ reload+} = usePortalLoad(async (): Promise<{ people: PortalPerson[]; total: number } | null> => {+ const { users, total } = await portal.api.users(search.value.trim() || undefined)+ const you = portal.account.value?.user.userId+ const people = users.map((user) => ({+ id: user.id,+ name: user.name,+ email: user.email,+ admin: user.role === 'admin',+ suspended: user.banned === true,+ joinedOn: portalDate(user.createdAt, locale.value),+ you: user.id === you+ }))+ return { people, total }+}, null)+const people = computed(() => listing.value?.people ?? [])++const { error: actionError, run: act } = usePortalAction(async (change: () => Promise<unknown>) => {+ await change()+ await reload()+})+const error = computed(() => actionError.value ?? loadError.value)++watch(search, () => void reload())+watch(listing, (current) => current && emit('total', current.total))+</script>++<template>+ <div class="flex flex-col gap-3">+ <AppAlert v-if="error" tone="error" :heading="messages.errorTitle" :description="error" />+ <PortalPeople+ v-model:query="query"+ :people="people"+ @toggle-admin="(person) => act(() => portal.api.setAdmin(person.id, !person.admin))"+ @sign-out-everywhere="+ (person) => act(() => portal.api.userAction('revoke-sessions', person.id))+ "+ @toggle-suspended="+ (person) => act(() => portal.api.userAction(person.suspended ? 'unban' : 'ban', person.id))+ "+ />+ </div>+</template>diff --git a/src/components/cloud-portal/sections/AdminRequestsSection.vue b/src/components/cloud-portal/sections/AdminRequestsSection.vuenew file mode 100644index 000000000..c3539bdde--- /dev/null+++ b/src/components/cloud-portal/sections/AdminRequestsSection.vue@@ -0,0 +1,63 @@+<script setup lang="ts">+import { computed, ref, watch } from 'vue'++import { useCloudPortalMessages, useI18n } from '@open-pencil/vue'++import { usePortal } from '@/app/cloud-portal/context'+import { portalDate } from '@/app/cloud-portal/format'+import { usePortalAction, usePortalLoad } from '@/app/cloud-portal/state'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'++import PortalAccessRequests from '../console/PortalAccessRequests.vue'+import type { AccessRequest, AccessRequestStatus } from '../types'++const emit = defineEmits<{ changed: [] }>()+const portal = usePortal()+const messages = useCloudPortalMessages()+const { locale } = useI18n()+const filter = ref<AccessRequestStatus>('pending')++const {+ data: requests,+ error: loadError,+ reload+} = usePortalLoad(async (): Promise<AccessRequest[]> => {+ const { enrollments } = await portal.api.enrollments(filter.value)+ return enrollments.map((enrollment) => ({+ id: enrollment.id,+ name: enrollment.name,+ email: enrollment.email,+ reason: enrollment.reason,+ requestedOn: portalDate(enrollment.requestedAt, locale.value),+ status: enrollment.status,+ reviewedBy: enrollment.reviewedBy+ }))+}, [])++const {+ subject: busy,+ error: reviewError,+ run: review+} = usePortalAction(async (id: string, action: 'approve' | 'reject' | 'revoke') => {+ await portal.api.reviewEnrollment(id, action)+ emit('changed')+ await reload()+})+const error = computed(() => reviewError.value ?? loadError.value)++watch(filter, () => void reload())+</script>++<template>+ <div class="flex flex-col gap-3">+ <AppAlert v-if="error" tone="error" :heading="messages.errorTitle" :description="error" />+ <PortalAccessRequests+ v-model:filter="filter"+ :requests="requests"+ :busy="busy"+ @approve="(id) => review(id, 'approve')"+ @reject="(id) => review(id, 'reject')"+ @revoke="(id) => review(id, 'revoke')"+ />+ </div>+</template>diff --git a/src/components/cloud-portal/sections/SecuritySection.vue b/src/components/cloud-portal/sections/SecuritySection.vuenew file mode 100644index 000000000..df4a2f8cd--- /dev/null+++ b/src/components/cloud-portal/sections/SecuritySection.vue@@ -0,0 +1,225 @@+<script setup lang="ts">+import { computed, ref } from 'vue'++import { useCloudPortalMessages, useI18n } from '@open-pencil/vue'++import { usePortal } from '@/app/cloud-portal/context'+import { usePortalFailureMessages } from '@/app/cloud-portal/failure'+import { portalDate } from '@/app/cloud-portal/format'+import { portalURL } from '@/app/cloud-portal/navigation'+import { usePortalAction, usePortalLoad } from '@/app/cloud-portal/state'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'++import PortalAccountSecurity from '../account/PortalAccountSecurity.vue'+import PortalAuthenticatorSetup from '../account/PortalAuthenticatorSetup.vue'+import PortalPasswordDialog from '../account/PortalPasswordDialog.vue'+import PortalRecoveryCodes from '../account/PortalRecoveryCodes.vue'+import type { PortalSignInMethod } from '../types'++/** The signed-in person's sign-in methods and second steps, with every change they can make. */+const portal = usePortal()+const messages = useCloudPortalMessages()+const { locale } = useI18n()+const failures = usePortalFailureMessages()++const security = usePortalLoad(async () => {+ const [methods, mfa, passkeys] = await Promise.all([+ portal.api.authenticationMethods(),+ portal.api.mfaStatus(),+ portal.api.passkeys()+ ])+ return { methods, mfa: mfa.mfa, passkeys: passkeys.passkeys }+}, null)+const methods = computed(() => security.data.value?.methods ?? null)+const mfa = computed(() => security.data.value?.mfa ?? null)+const passkeys = computed(() => security.data.value?.passkeys ?? [])+const notice = ref<string | null>(null)++type PasswordStep = 'change' | 'enable-authenticator' | 'disable-authenticator' | 'recovery-codes'+const passwordStep = ref<PasswordStep | null>(null)+const setupURI = ref<string | null>(null)+const recoveryCodes = ref<string[] | null>(null)+/** Recovery codes from turning the authenticator on, shown once its first code is verified. */+let pendingCodes: string[] = []++const hasPassword = computed(+ () => methods.value?.methods.some((method) => method.provider === 'credential') ?? false+)+const linkedMethods = computed(() =>+ (methods.value?.methods ?? []).map((method) => ({+ id: method.id,+ provider: method.provider,+ linkedOn: portalDate(method.createdAt, locale.value),+ canUnlink: method.canUnlink+ }))+)+const linkable = computed<PortalSignInMethod[]>(() =>+ (methods.value?.availableSocialProviders ?? []).filter(+ (provider) => !methods.value?.methods.some((method) => method.provider === provider)+ )+)+const minimum = computed(+ () => portal.discovery.authentication.emailPassword?.minimumPasswordLength ?? 15+)++/** One change from the page, then what the page shows read again. */+const change = usePortalAction(async (work: () => Promise<unknown>) => {+ notice.value = null+ await work()+ await security.reload()+})++const verifyAction = usePortalAction(async (code: string) => {+ await portal.api.verifyTOTP(code.trim())+ setupURI.value = null+ recoveryCodes.value = pendingCodes+ pendingCodes = []+ await security.reload()+})++/** A step behind the password dialog; its failure shows in the dialog while it is open. */+const passwordAction = usePortalAction(+ async (step: PasswordStep, password: string | undefined, next: string) => {+ let setup: { totpURI: string; backupCodes: string[] } | null = null+ let codes: string[] | null = null+ if (step === 'change') await portal.api.changePassword(password ?? '', next)+ else if (step === 'enable-authenticator') setup = await portal.api.enableTOTP(password)+ else if (step === 'disable-authenticator') await portal.api.disableTOTP(password)+ else codes = (await portal.api.regenerateRecoveryCodes(password)).backupCodes+ // The step succeeded: close the password dialog before showing what comes next.+ passwordStep.value = null+ if (setup) {+ verifyAction.clear()+ recoveryCodes.value = null+ pendingCodes = setup.backupCodes+ setupURI.value = setup.totpURI+ }+ if (codes) recoveryCodes.value = codes+ await security.reload()+ }+)++const busy = computed(+ () =>+ security.loading.value ||+ change.busy.value ||+ passwordAction.busy.value ||+ verifyAction.busy.value+)+const passwordError = computed(() => (passwordStep.value ? passwordAction.error.value : null))+const error = computed(+ () =>+ change.error.value ??+ (passwordStep.value ? null : passwordAction.error.value) ??+ security.error.value+)++function link(provider: PortalSignInMethod) {+ void change.run(async () => {+ const { url } = await portal.api.linkSocial(provider, portalURL('/account'))+ globalThis.location.assign(url)+ })+}++function openPasswordStep(step: PasswordStep) {+ passwordAction.clear()+ passwordStep.value = step+}++/** A failure inside the dialog stays with it; closing the dialog drops it. */+function closePasswordStep() {+ passwordStep.value = null+ passwordAction.clear()+}++function changePassword() {+ if (hasPassword.value) {+ openPasswordStep('change')+ return+ }+ const email = portal.account.value?.user.email+ if (!email) return+ void change.run(async () => {+ const result = await portal.auth.requestPasswordReset(email, portalURL('/auth/reset-password'))+ if (result.ok) notice.value = messages.value.passwordResetSent+ else change.fail(failures.failure(result.failure))+ })+}++/** Steps that need the current password when the account has one. */+function withPassword(step: Exclude<PasswordStep, 'change'>) {+ if (hasPassword.value) openPasswordStep(step)+ else void passwordAction.run(step, undefined, '')+}++/** Closing setup before the code is verified leaves the authenticator off, so its codes go too. */+function closeAuthenticatorSetup() {+ setupURI.value = null+ pendingCodes = []+}++function addPasskey() {+ void change.run(async () => {+ const result = await portal.auth.addPasskey()+ if (!result.ok) change.fail(failures.failure(result.failure))+ })+}+</script>++<template>+ <div class="flex flex-col gap-4">+ <AppAlert v-if="error" tone="error" :heading="messages.errorTitle" :description="error" />+ <AppAlert v-if="notice" tone="success" :heading="notice" />+ <PortalAccountSecurity+ v-if="methods && mfa"+ :methods="linkedMethods"+ :linkable="linkable"+ :authenticator="{ available: mfa.totpAvailable, on: mfa.enabled }"+ :passkeys="+ passkeys.map((passkey) => ({+ id: passkey.id,+ name: passkey.name ?? null,+ addedOn: portalDate(passkey.createdAt, locale)+ }))+ "+ :passkeys-available="mfa.passkeysAvailable"+ :two-step-required="mfa.required && !mfa.enabled && passkeys.length === 0"+ :busy="busy"+ @link="link"+ @unlink="(id) => change.run(() => portal.api.unlinkAuthenticationMethod(id))"+ @change-password="changePassword"+ @set-up-authenticator="withPassword('enable-authenticator')"+ @turn-off-authenticator="withPassword('disable-authenticator')"+ @new-recovery-codes="withPassword('recovery-codes')"+ @add-passkey="addPasskey"+ @remove-passkey="(id) => change.run(() => portal.api.deletePasskey(id))"+ />++ <PortalPasswordDialog+ :open="passwordStep !== null"+ :purpose="passwordStep === 'change' ? 'change' : 'confirm'"+ :minimum-password-length="minimum"+ :error="passwordError"+ :saving="busy"+ @update:open="(open) => !open && closePasswordStep()"+ @submit="+ ({ current, next }) => passwordStep && passwordAction.run(passwordStep, current, next)+ "+ />+ <PortalAuthenticatorSetup+ v-if="setupURI"+ :open="true"+ :uri="setupURI"+ :error="verifyAction.error.value"+ :verifying="busy"+ @update:open="(open) => !open && closeAuthenticatorSetup()"+ @verify="verifyAction.run"+ />+ <PortalRecoveryCodes+ v-if="recoveryCodes"+ :open="true"+ :codes="recoveryCodes"+ @update:open="(open) => !open && (recoveryCodes = null)"+ />+ </div>+</template>diff --git a/src/components/cloud-portal/types.ts b/src/components/cloud-portal/types.tsnew file mode 100644index 000000000..ea3c172bf--- /dev/null+++ b/src/components/cloud-portal/types.ts@@ -0,0 +1,65 @@+export type PortalSection = {+ id: string+ label: string+ group: string+ count?: number+}++export type PortalSignInMethod = 'google' | 'apple'++export type AccessRequestStatus = 'pending' | 'approved' | 'rejected' | 'revoked'++export type AccessRequest = {+ id: string+ name: string | null+ email: string+ reason: string | null+ requestedOn: string+ status: AccessRequestStatus+ reviewedBy?: string | null+}++export type PortalPerson = {+ id: string+ name: string+ email: string+ admin: boolean+ suspended: boolean+ joinedOn: string+ you?: boolean+}++export type PortalEmail = {+ id: string+ kind: string+ recipient: string+ status: 'sent' | 'waiting' | 'failed' | 'suppressed'+ attempts: number+ when: string+ error?: string | null+}++export type PortalActivityEntry = {+ id: string+ actor: { id: string; name: string }+ /** The server's action code, such as `enrollment.approved`. */+ action: string+ target: string+ when: string+}++export type PortalLinkedMethod = {+ id: string+ provider: 'credential' | PortalSignInMethod+ linkedOn: string+ canUnlink: boolean+}++export type PortalServerStatus = {+ deployment: 'official' | 'self-hosted'+ enrollmentMode: 'open' | 'approval' | 'closed'+ emailTransport: 'none' | 'smtp' | 'cloudflare'+ pendingEnrollment: number+ pendingEmail: number+ failedEmail: number+}diff --git a/src/components/presence/AccountAvatar.vue b/src/components/presence/AccountAvatar.vuenew file mode 100644index 000000000..5d7aac6f6--- /dev/null+++ b/src/components/presence/AccountAvatar.vue@@ -0,0 +1,19 @@+<script setup lang="ts">+import { computed } from 'vue'++import PersonAvatar from '@/components/presence/PersonAvatar.vue'+import { PEER_COLORS } from '@/constants'++/** An account's initials on a color that stays the same for that account. */+const { id, name, size = 'sm' } = defineProps<{ id: string; name: string; size?: 'sm' | 'md' }>()++const color = computed(() => {+ let hash = 0+ for (const character of id) hash = (hash * 31 + (character.codePointAt(0) ?? 0)) >>> 0+ return PEER_COLORS[hash % PEER_COLORS.length] ?? PEER_COLORS[0]+})+</script>++<template>+ <PersonAvatar :name="name" :color="color" :size="size" />+</template>diff --git a/src/components/presence/PersonAvatar.vue b/src/components/presence/PersonAvatar.vueindex 589c7d669..20ec0197e 100644--- a/src/components/presence/PersonAvatar.vue+++ b/src/components/presence/PersonAvatar.vue@@ -5,7 +5,7 @@ import { colorToCSS } from '@open-pencil/scene-graph/color'import type { Color } from '@open-pencil/scene-graph/primitives'import { useCollaborationMessages } from '@open-pencil/vue'-import { initials } from '@/app/shell/ui'+import { initials } from '@/app/presence/initials'import { avatar } from '@/theme/collaboration/avatar'import { avatarStack } from '@/theme/collaboration/avatar-stack'diff --git a/src/components/presence/PresenceList.vue b/src/components/presence/PresenceList.vueindex 0d0ca2349..0b42cc068 100644--- a/src/components/presence/PresenceList.vue+++ b/src/components/presence/PresenceList.vue@@ -2,8 +2,8 @@import { colorToCSS } from '@open-pencil/scene-graph/color'import { useI18n, useInlineRename } from '@open-pencil/vue'+import { initials } from '@/app/presence/initials'import type { FollowTarget } from '@/app/presence/types'-import { initials } from '@/app/shell/ui'import IconButton from '@/components/ui/button/IconButton.vue'import { avatar } from '@/theme/collaboration/avatar'import { presenceList } from '@/theme/collaboration/presence-list'diff --git a/src/router.d.ts b/src/router.d.tsindex 486a602ec..fa1ee58bd 100644--- a/src/router.d.ts+++ b/src/router.d.ts@@ -2,6 +2,12 @@ import 'vue-router'declare module 'vue-router' {interface RouteMeta {+ /** Cloud portal: only for people who are not signed in; signed-in people continue instead. */+ signedOut?: boolean+ /** Cloud portal: needs a signed-in account in good standing. */+ account?: boolean+ /** Cloud portal: needs a deployment administrator. */+ admin?: booleandemo?: boolean}}diff --git a/src/theme/cloud-portal/form.ts b/src/theme/cloud-portal/form.tsnew file mode 100644index 000000000..a84c711ec--- /dev/null+++ b/src/theme/cloud-portal/form.ts@@ -0,0 +1,16 @@+import { tv } from 'tailwind-variants'++export const portalForm = tv({+ slots: {+ form: 'flex flex-col gap-3',+ field: 'flex flex-col gap-1.5',+ labelRow: 'flex items-center justify-between',+ label: 'text-[11px] font-medium text-muted',+ hint: 'text-[11px] text-muted',+ methods: 'flex flex-col gap-1.5',+ divider: 'flex items-center gap-3 text-[11px] text-muted',+ dividerLine: 'h-px flex-1 bg-border',+ submit: 'w-full justify-center',+ code: 'w-full text-center font-mono text-base tracking-[0.4em]'+ }+})diff --git a/src/theme/cloud-portal/layout.ts b/src/theme/cloud-portal/layout.tsnew file mode 100644index 000000000..202296e47--- /dev/null+++ b/src/theme/cloud-portal/layout.ts@@ -0,0 +1,29 @@+import { tv } from 'tailwind-variants'++/** Cloud's own pages outside the editor: a centered card for sign-in, a sidebar for the console. */+export const portalLayout = tv({+ slots: {+ page: 'flex h-full min-h-0 flex-col overflow-hidden bg-canvas text-surface',+ bar: 'flex h-11 shrink-0 items-center gap-2 border-b border-border bg-panel px-4',+ barTitle: 'text-xs font-semibold whitespace-nowrap',+ barHost: 'truncate text-[11px] text-muted max-sm:hidden',+ barEnd: 'ml-auto flex items-center gap-2',+ center: 'flex flex-1 items-start justify-center overflow-y-auto px-4 py-12 sm:items-center',+ card: 'flex w-full max-w-sm flex-col gap-5 rounded-xl border border-border bg-panel p-6 shadow-[0_8px_30px_rgb(0_0_0/0.18)]',+ cardHeader: 'flex flex-col gap-1',+ cardTitle: 'text-sm font-semibold text-surface',+ cardDescription: 'text-xs leading-relaxed text-muted',+ cardFooter: 'border-t border-border pt-4 text-center text-[11px] text-muted',+ console: 'flex min-h-0 flex-1 max-md:flex-col',+ // Narrow screens turn the section list into one scrolling row above the page.+ nav: 'max-md:h-auto max-md:w-full max-md:flex-row max-md:overflow-x-auto max-md:border-r-0 max-md:border-b max-md:pb-0',+ navGroup: 'max-md:flex-row max-md:items-center',+ navHeader: 'max-md:hidden',+ navItems: 'max-md:flex-row max-md:p-1',+ navItem: 'max-md:w-auto max-md:shrink-0',+ main: 'min-w-0 flex-1 overflow-y-auto',+ mainInner: 'mx-auto flex w-full max-w-5xl flex-col gap-5 px-4 py-6 md:px-6',+ pageTitle: 'text-base font-semibold',+ pageDescription: 'mt-0.5 text-xs text-muted'+ }+})diff --git a/src/theme/cloud-portal/list.ts b/src/theme/cloud-portal/list.tsnew file mode 100644index 000000000..c73d87424--- /dev/null+++ b/src/theme/cloud-portal/list.ts@@ -0,0 +1,18 @@+import { tv } from 'tailwind-variants'++/** Console lists, drawn like the home tab's list view. */+export const portalList = tv({+ slots: {+ toolbar: 'flex flex-wrap items-center gap-2',+ list: 'overflow-hidden rounded-lg border border-border bg-panel',+ row: 'flex min-h-14 items-center gap-3 border-b border-border px-4 py-2.5 last:border-b-0',+ body: 'min-w-0 flex-1',+ title: 'flex min-w-0 items-center gap-1.5 truncate text-xs font-medium text-surface',+ detail: 'mt-0.5 truncate text-[11px] text-muted',+ quote: 'mt-1 line-clamp-2 text-[11px] text-surface',+ meta: 'hidden shrink-0 text-[11px] text-muted tabular-nums sm:block',+ actions: 'flex shrink-0 items-center gap-1',+ status:+ 'shrink-0 rounded px-1.5 py-px text-[10px] font-medium data-[tone=neutral]:bg-panel-field data-[tone=neutral]:text-muted data-[tone=success]:bg-success/10 data-[tone=success]:text-success data-[tone=warning]:bg-warning-bg data-[tone=warning]:text-warning data-[tone=error]:bg-error-bg data-[tone=error]:text-error'+ }+})diff --git a/src/theme/list/side-list.ts b/src/theme/list/side-list.tsnew file mode 100644index 000000000..9e6d4638e--- /dev/null+++ b/src/theme/list/side-list.ts@@ -0,0 +1,17 @@+import { tv } from 'tailwind-variants'++/** A side list of places, drawn like the editor's Pages panel: headings, 24px rows, hover selection. */+export const sideList = tv({+ slots: {+ root: 'flex h-full w-60 shrink-0 flex-col overflow-y-auto border-r border-border bg-panel pb-2',+ group: 'flex flex-col',+ header: 'flex h-8 shrink-0 items-center justify-between pr-1.5 pl-3',+ title: 'text-[11px] font-semibold text-surface',+ items: 'flex flex-col px-1 pb-1',+ item: 'group flex h-6 w-full cursor-pointer items-center gap-1.5 rounded border-none bg-transparent px-2 text-left text-[11px] text-muted outline-none hover:bg-hover hover:text-surface focus-visible:ring-1 focus-visible:ring-panel-focus data-[active=true]:bg-hover data-[active=true]:text-surface',+ icon: 'size-3 shrink-0 opacity-70',+ label: 'min-w-0 flex-1 truncate',+ trailing: 'flex shrink-0 items-center gap-1.5 text-[10px] text-muted tabular-nums',+ attention: 'size-3 text-warning'+ }+})diff --git a/src/views/cloud/CheckEmailView.vue b/src/views/cloud/CheckEmailView.vuenew file mode 100644index 000000000..daadcd5c4--- /dev/null+++ b/src/views/cloud/CheckEmailView.vue@@ -0,0 +1,63 @@+<script setup lang="ts">+import { computed, ref } from 'vue'+import { useRoute, useRouter } from 'vue-router'++import { useCloudPortalMessages } from '@open-pencil/vue'++import { usePortal } from '@/app/cloud-portal/context'+import { usePortalFailureMessages } from '@/app/cloud-portal/failure'+import { continuationPath, continuationURL } from '@/app/cloud-portal/navigation'+import PortalNotice from '@/components/cloud-portal/auth/PortalNotice.vue'+import AppButton from '@/components/ui/button/AppButton.vue'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'++const portal = usePortal()+const route = useRoute()+const router = useRouter()+const messages = useCloudPortalMessages()+const { failure } = usePortalFailureMessages()+const email = computed(() => (typeof route.query.email === 'string' ? route.query.email : ''))+const redirect = computed(() => continuationPath(route.query.redirect))+const state = ref<'idle' | 'sending' | 'sent'>('idle')+const error = ref<string | null>(null)++async function sendAgain() {+ state.value = 'sending'+ error.value = null+ const result = await portal.auth.resendVerification(+ email.value,+ continuationURL('/auth/sign-in', redirect.value)+ )+ if (result.ok) {+ state.value = 'sent'+ return+ }+ // Nothing was sent, so the button stays available to try again.+ state.value = 'idle'+ error.value = failure(result.failure)+}+</script>++<template>+ <PortalNotice+ :host="portal.host"+ :heading="messages.checkEmailTitle"+ :description="messages.checkEmailDescription({ email })"+ >+ <template #icon><icon-lucide-mail-check class="size-5" /></template>+ <AppAlert v-if="error" tone="error" :heading="messages.errorTitle" :description="error" />+ <template #actions>+ <AppButton+ variant="outline"+ :loading="state === 'sending'"+ :disabled="state === 'sent' || !email"+ @click="sendAgain"+ >+ {{ state === 'sent' ? messages.sent : messages.sendAgain }}+ </AppButton>+ <AppButton variant="ghost" @click="router.replace({ name: 'sign-up', query: { redirect } })">+ {{ messages.useAnotherEmail }}+ </AppButton>+ </template>+ </PortalNotice>+</template>diff --git a/src/views/cloud/CloudPortalApp.vue b/src/views/cloud/CloudPortalApp.vuenew file mode 100644index 000000000..c8a0a4d61--- /dev/null+++ b/src/views/cloud/CloudPortalApp.vue@@ -0,0 +1,11 @@+<script setup lang="ts">+import { RouterView } from 'vue-router'++import { usePortalTheme } from '@/app/cloud-portal/theme'++usePortalTheme()+</script>++<template>+ <RouterView />+</template>diff --git a/src/views/cloud/CloudPortalUnavailableView.vue b/src/views/cloud/CloudPortalUnavailableView.vuenew file mode 100644index 000000000..b1ea9376b--- /dev/null+++ b/src/views/cloud/CloudPortalUnavailableView.vue@@ -0,0 +1,29 @@+<script setup lang="ts">+import { useCloudPortalMessages } from '@open-pencil/vue'++import { usePortalTheme } from '@/app/cloud-portal/theme'+import AppButton from '@/components/ui/button/AppButton.vue'+import AppPlaceholder from '@/components/ui/feedback/AppPlaceholder.vue'++usePortalTheme()+const messages = useCloudPortalMessages()+const reload = () => globalThis.location.reload()+</script>++<template>+ <main class="flex h-full bg-canvas text-surface">+ <AppPlaceholder+ size="page"+ label-as="h1"+ :label="messages.unavailableTitle"+ :description="messages.unavailableDescription"+ >+ <template #icon><icon-lucide-cloud-off class="size-5" /></template>+ <template #action>+ <AppButton variant="outline" @click="reload">+ {{ messages.tryAgain }}+ </AppButton>+ </template>+ </AppPlaceholder>+ </main>+</template>diff --git a/src/views/cloud/ConsoleView.vue b/src/views/cloud/ConsoleView.vuenew file mode 100644index 000000000..f831c45ef--- /dev/null+++ b/src/views/cloud/ConsoleView.vue@@ -0,0 +1,116 @@+<script setup lang="ts">+import { computed, onMounted, ref } from 'vue'+import { useRoute, useRouter } from 'vue-router'++import { useCloudPortalMessages } from '@open-pencil/vue'++import { usePortal } from '@/app/cloud-portal/context'+import PortalConsoleLayout from '@/components/cloud-portal/layout/PortalConsoleLayout.vue'+import AdminActivitySection from '@/components/cloud-portal/sections/AdminActivitySection.vue'+import AdminEmailSection from '@/components/cloud-portal/sections/AdminEmailSection.vue'+import AdminOverviewSection from '@/components/cloud-portal/sections/AdminOverviewSection.vue'+import AdminPeopleSection from '@/components/cloud-portal/sections/AdminPeopleSection.vue'+import AdminRequestsSection from '@/components/cloud-portal/sections/AdminRequestsSection.vue'+import SecuritySection from '@/components/cloud-portal/sections/SecuritySection.vue'+import type { PortalSection } from '@/components/cloud-portal/types'++const ADMIN_SECTIONS = ['overview', 'requests', 'people', 'email', 'activity'] as const+type AdminSectionId = (typeof ADMIN_SECTIONS)[number]+type SectionId = 'security' | AdminSectionId++function isAdminSection(value: unknown): value is AdminSectionId {+ return ADMIN_SECTIONS.some((section) => section === value)+}++const portal = usePortal()+const route = useRoute()+const router = useRouter()+const messages = useCloudPortalMessages()+const waiting = ref(0)+const peopleTotal = ref<number | null>(null)++const admin = computed(() => portal.account.value?.user.deploymentRole === 'admin')+const active = computed<SectionId>(() => {+ if (route.name !== 'admin') return 'security'+ const section = route.params.section+ return isAdminSection(section) ? section : 'overview'+})+const sections = computed<PortalSection[]>(() => {+ const value = messages.value+ const account = [{ id: 'security', label: value.security, group: value.sectionAccount }]+ if (!admin.value) return account+ return [+ ...account,+ { id: 'overview', label: value.overview, group: value.sectionServer },+ {+ id: 'requests',+ label: value.accessRequests,+ group: value.sectionServer,+ count: waiting.value || undefined+ },+ { id: 'people', label: value.people, group: value.sectionServer },+ { id: 'email', label: value.emailDelivery, group: value.sectionServer },+ { id: 'activity', label: value.activity, group: value.sectionServer }+ ]+})+const heading = computed(+ () => sections.value.find((section) => section.id === active.value)?.label ?? ''+)+const description = computed(() => {+ const value = messages.value+ const descriptions: Record<SectionId, string> = {+ security: value.securityDescription({ host: portal.host }),+ overview: portal.host,+ requests: value.accessRequestsDescription,+ people: peopleTotal.value === null ? '' : value.peopleDescription(peopleTotal.value),+ email: value.emailDeliveryDescription,+ activity: value.activityDescription+ }+ return descriptions[active.value]+})++/** The waiting-requests badge; when it can't be read, it keeps its last count. */+async function refreshWaiting() {+ if (!admin.value) return+ const operations = await portal.api.operations().catch(() => null)+ if (operations) waiting.value = operations.pendingEnrollment+}++function select(id: string) {+ if (id === 'security') void router.push({ name: 'security' })+ else void router.push({ name: 'admin', params: { section: id === 'overview' ? '' : id } })+}++async function signOut() {+ await portal.auth.signOut()+ await portal.refreshAccount()+ await router.replace({ name: 'sign-in' })+}++onMounted(() => void refreshWaiting())+</script>++<template>+ <PortalConsoleLayout+ v-if="portal.account.value"+ :host="portal.host"+ :account="{+ id: portal.account.value.user.userId,+ name: portal.account.value.user.name,+ email: portal.account.value.user.email+ }"+ :sections="sections"+ :active="active"+ :heading="heading"+ :description="description"+ @select="select"+ @sign-out="signOut"+ >+ <SecuritySection v-if="active === 'security'" />+ <AdminOverviewSection v-else-if="active === 'overview'" @open="select" />+ <AdminRequestsSection v-else-if="active === 'requests'" @changed="refreshWaiting" />+ <AdminPeopleSection v-else-if="active === 'people'" @total="(count) => (peopleTotal = count)" />+ <AdminEmailSection v-else-if="active === 'email'" />+ <AdminActivitySection v-else />+ </PortalConsoleLayout>+</template>diff --git a/src/views/cloud/DeviceView.vue b/src/views/cloud/DeviceView.vuenew file mode 100644index 000000000..7b1171537--- /dev/null+++ b/src/views/cloud/DeviceView.vue@@ -0,0 +1,88 @@+<script setup lang="ts">+import { computed, onMounted, ref } from 'vue'+import { useRoute, useRouter } from 'vue-router'++import { useCloudPortalMessages } from '@open-pencil/vue'++import { usePortal } from '@/app/cloud-portal/context'+import { usePortalFailureMessages } from '@/app/cloud-portal/failure'+import { usePortalAction } from '@/app/cloud-portal/state'+import PortalDeviceApproval from '@/components/cloud-portal/auth/PortalDeviceApproval.vue'+import PortalNotice from '@/components/cloud-portal/auth/PortalNotice.vue'+import AppButton from '@/components/ui/button/AppButton.vue'++const portal = usePortal()+const route = useRoute()+const router = useRouter()+const messages = useCloudPortalMessages()+const { failure } = usePortalFailureMessages()+const code = computed(() =>+ typeof route.query.user_code === 'string' ? route.query.user_code.trim().toUpperCase() : ''+)+const state = ref<'checking' | 'pending' | 'approved' | 'denied' | 'expired'>('checking')++onMounted(async () => {+ if (!code.value) {+ state.value = 'expired'+ return+ }+ const result = await portal.auth.deviceRequest(code.value)+ state.value = result.ok ? result.value : 'expired'+})++const {+ busy: deciding,+ error,+ run: decide,+ fail+} = usePortalAction(async (decision: 'approve' | 'deny') => {+ const result = await portal.auth.decideDevice(code.value, decision)+ if (result.ok) state.value = decision === 'approve' ? 'approved' : 'denied'+ // Only a refused code ends the approval; anything else leaves it to try again.+ else if (result.failure === 'invalid-code') state.value = 'expired'+ else fail(failure(result.failure))+})+</script>++<template>+ <PortalDeviceApproval+ v-if="state === 'pending' && portal.account.value"+ :host="portal.host"+ :code="code"+ :email="portal.account.value.user.email"+ :deciding="deciding"+ :error="error"+ @approve="decide('approve')"+ @deny="decide('deny')"+ />+ <PortalNotice+ v-else-if="state === 'approved'"+ :host="portal.host"+ tone="success"+ :heading="messages.deviceApprovedTitle"+ :description="messages.deviceApprovedDescription"+ >+ <template #icon><icon-lucide-check class="size-5" /></template>+ </PortalNotice>+ <PortalNotice+ v-else-if="state === 'denied'"+ :host="portal.host"+ :heading="messages.deviceDeniedTitle"+ :description="messages.deviceDeniedDescription"+ >+ <template #icon><icon-lucide-monitor-x class="size-5" /></template>+ <template #actions>+ <AppButton variant="outline" @click="router.push({ name: 'security' })">+ {{ messages.accountSettings }}+ </AppButton>+ </template>+ </PortalNotice>+ <PortalNotice+ v-else-if="state === 'expired'"+ :host="portal.host"+ :heading="messages.deviceExpiredTitle"+ :description="messages.deviceExpiredDescription"+ >+ <template #icon><icon-lucide-timer-off class="size-5" /></template>+ </PortalNotice>+</template>diff --git a/src/views/cloud/ResetPasswordView.vue b/src/views/cloud/ResetPasswordView.vuenew file mode 100644index 000000000..5fb908b2a--- /dev/null+++ b/src/views/cloud/ResetPasswordView.vue@@ -0,0 +1,81 @@+<script setup lang="ts">+import { computed, ref } from 'vue'+import { useRoute, useRouter } from 'vue-router'++import { useCloudPortalMessages } from '@open-pencil/vue'++import { usePortal } from '@/app/cloud-portal/context'+import { usePortalFailureMessages } from '@/app/cloud-portal/failure'+import { continuationPath, continuationURL } from '@/app/cloud-portal/navigation'+import PortalNotice from '@/components/cloud-portal/auth/PortalNotice.vue'+import PortalResetPassword from '@/components/cloud-portal/auth/PortalResetPassword.vue'+import AppButton from '@/components/ui/button/AppButton.vue'++const portal = usePortal()+const route = useRoute()+const router = useRouter()+const messages = useCloudPortalMessages()+const { failure } = usePortalFailureMessages()+const token = computed(() => (typeof route.query.token === 'string' ? route.query.token : null))+const redirect = computed(() => continuationPath(route.query.redirect))+const minimum = computed(+ () => portal.discovery.authentication.emailPassword?.minimumPasswordLength ?? 15+)+const submitting = ref(false)+const error = ref<string | null>(+ typeof route.query.error === 'string' ? messages.value.failureInvalidLink : null+)+const sentTo = ref<string | null>(null)++async function request(email: string) {+ submitting.value = true+ error.value = null+ const result = await portal.auth.requestPasswordReset(+ email,+ continuationURL('/auth/reset-password', redirect.value)+ )+ submitting.value = false+ if (result.ok) sentTo.value = email+ else error.value = failure(result.failure)+}++async function choose(password: string) {+ if (!token.value) return+ submitting.value = true+ error.value = null+ const result = await portal.auth.resetPassword(token.value, password)+ submitting.value = false+ if (!result.ok) {+ error.value = failure(result.failure)+ return+ }+ await router.replace({ name: 'sign-in', query: { redirect: redirect.value } })+}+</script>++<template>+ <PortalNotice+ v-if="sentTo"+ :host="portal.host"+ :heading="messages.resetSentTitle"+ :description="messages.resetSentDescription({ email: sentTo })"+ >+ <template #icon><icon-lucide-mail-check class="size-5" /></template>+ <template #actions>+ <AppButton variant="ghost" @click="router.replace({ name: 'sign-in', query: { redirect } })">+ {{ messages.backToSignIn }}+ </AppButton>+ </template>+ </PortalNotice>+ <PortalResetPassword+ v-else+ :host="portal.host"+ :step="token ? 'choose' : 'request'"+ :minimum-password-length="minimum"+ :submitting="submitting"+ :error="error"+ @request="request"+ @choose="choose"+ @back="router.replace({ name: 'sign-in', query: { redirect } })"+ />+</template>diff --git a/src/views/cloud/ReturnView.vue b/src/views/cloud/ReturnView.vuenew file mode 100644index 000000000..3b5e7974b--- /dev/null+++ b/src/views/cloud/ReturnView.vue@@ -0,0 +1,43 @@+<script setup lang="ts">+import { onMounted } from 'vue'+import { useRoute, useRouter } from 'vue-router'++import { cloudEditorReturnURL } from '@open-pencil/cloud/client'+import { useCloudPortalMessages } from '@open-pencil/vue'++import { usePortal } from '@/app/cloud-portal/context'+import { PORTAL_HOME } from '@/app/cloud-portal/navigation'+import AppPlaceholder from '@/components/ui/feedback/AppPlaceholder.vue'++const portal = usePortal()+const route = useRoute()+const router = useRouter()+const messages = useCloudPortalMessages()++function editorDestination(editor: string): string | null {+ if (!editor) return null+ try {+ return cloudEditorReturnURL(portal.discovery, editor)+ } catch {+ return null+ }+}++// The editor sent the person here to sign in; only this server's own editor may get them back.+onMounted(() => {+ const editor = typeof route.query.editor === 'string' ? route.query.editor : ''+ const destination = editorDestination(editor)+ if (destination) globalThis.location.replace(destination)+ else void router.replace(PORTAL_HOME)+})+</script>++<template>+ <main class="flex h-full bg-canvas text-surface">+ <AppPlaceholder size="page" :label="messages.loading">+ <template #icon>+ <icon-lucide-loader-circle class="size-5 animate-spin motion-reduce:animate-none" />+ </template>+ </AppPlaceholder>+ </main>+</template>diff --git a/src/views/cloud/SignInView.vue b/src/views/cloud/SignInView.vuenew file mode 100644index 000000000..3da979b9a--- /dev/null+++ b/src/views/cloud/SignInView.vue@@ -0,0 +1,101 @@+<script setup lang="ts">+import { computed, ref } from 'vue'+import { useRoute, useRouter } from 'vue-router'++import type { CloudSocialProvider } from '@open-pencil/cloud/client'++import { usePortal } from '@/app/cloud-portal/context'+import { usePortalFailureMessages } from '@/app/cloud-portal/failure'+import { continuationPath, continuationURL, portalURL } from '@/app/cloud-portal/navigation'+import PortalSignIn from '@/components/cloud-portal/auth/PortalSignIn.vue'++const portal = usePortal()+const route = useRoute()+const router = useRouter()+const { failure, callback } = usePortalFailureMessages()++const mode = computed(() => (route.name === 'sign-up' ? 'sign-up' : 'sign-in'))+const redirect = computed(() => continuationPath(route.query.redirect))+const authentication = computed(() => portal.discovery.authentication)+const emailPassword = computed(() => {+ const credentials = authentication.value.emailPassword+ if (!credentials?.signIn) return null+ return { signUp: credentials.signUp, minimumPasswordLength: credentials.minimumPasswordLength }+})+const returnsTo = computed(() => {+ if (redirect.value.startsWith('/cloud/device')) return 'desktop'+ if (redirect.value.startsWith('/auth/return')) return 'editor'+ return null+})+const error = ref<string | null>(callback(route.query))+const submitting = ref(false)++async function withProvider(provider: CloudSocialProvider) {+ submitting.value = true+ const result = await portal.auth.withProvider(provider, portalURL(redirect.value))+ if (!result.ok) {+ error.value = failure(result.failure)+ submitting.value = false+ }+}++async function submit(input: { name: string; email: string; password: string }) {+ submitting.value = true+ error.value = null+ try {+ if (mode.value === 'sign-up') {+ const result = await portal.auth.signUp({+ ...input,+ verifiedURL: continuationURL('/auth/sign-in', redirect.value)+ })+ if (!result.ok) {+ error.value = failure(result.failure)+ return+ }+ await router.push({+ name: 'check-email',+ query: { email: input.email, redirect: redirect.value }+ })+ return+ }+ const result = await portal.auth.withEmail({ email: input.email, password: input.password })+ if (!result.ok) {+ error.value = failure(result.failure)+ return+ }+ if (result.value === 'two-step') {+ await router.push({ name: 'two-factor', query: { redirect: redirect.value } })+ return+ }+ await portal.refreshAccount()+ await router.replace(redirect.value)+ } finally {+ submitting.value = false+ }+}++function switchMode() {+ error.value = null+ void router.replace({+ name: mode.value === 'sign-up' ? 'sign-in' : 'sign-up',+ query: { redirect: redirect.value }+ })+}+</script>++<template>+ <PortalSignIn+ :host="portal.host"+ :mode="mode"+ :providers="authentication.socialProviders"+ :email-password="emailPassword"+ :approval-required="authentication.enrollmentMode === 'approval'"+ :error="error"+ :submitting="submitting"+ :returns-to="returnsTo"+ @provider="withProvider"+ @submit="submit"+ @forgot-password="router.push({ name: 'forgot-password', query: { redirect } })"+ @switch-mode="switchMode"+ />+</template>diff --git a/src/views/cloud/StandingView.vue b/src/views/cloud/StandingView.vuenew file mode 100644index 000000000..6e734fa12--- /dev/null+++ b/src/views/cloud/StandingView.vue@@ -0,0 +1,40 @@+<script setup lang="ts">+import { computed } from 'vue'+import { useRoute, useRouter } from 'vue-router'++import { useCloudPortalMessages } from '@open-pencil/vue'++import { usePortal } from '@/app/cloud-portal/context'+import PortalNotice from '@/components/cloud-portal/auth/PortalNotice.vue'+import AppButton from '@/components/ui/button/AppButton.vue'++const portal = usePortal()+const route = useRoute()+const router = useRouter()+const messages = useCloudPortalMessages()+const pending = computed(() => route.name === 'pending')+const email = computed(() => portal.account.value?.user.email ?? '')++async function signOut() {+ await portal.auth.signOut()+ await portal.refreshAccount()+ await router.replace({ name: 'sign-in' })+}+</script>++<template>+ <PortalNotice+ :host="portal.host"+ :tone="pending ? 'waiting' : 'neutral'"+ :heading="pending ? messages.pendingTitle : messages.closedTitle"+ :description="pending ? messages.pendingDescription({ email }) : messages.closedDescription"+ >+ <template #icon>+ <icon-lucide-clock v-if="pending" class="size-5" />+ <icon-lucide-ban v-else class="size-5" />+ </template>+ <template v-if="portal.account.value" #actions>+ <AppButton variant="ghost" @click="signOut">{{ messages.signOut }}</AppButton>+ </template>+ </PortalNotice>+</template>diff --git a/src/views/cloud/TwoStepView.vue b/src/views/cloud/TwoStepView.vuenew file mode 100644index 000000000..d048b831f--- /dev/null+++ b/src/views/cloud/TwoStepView.vue@@ -0,0 +1,57 @@+<script setup lang="ts">+import { computed, ref } from 'vue'+import { useRoute, useRouter } from 'vue-router'++import { usePortal } from '@/app/cloud-portal/context'+import { usePortalFailureMessages } from '@/app/cloud-portal/failure'+import { continuationPath } from '@/app/cloud-portal/navigation'+import { usePortalAction } from '@/app/cloud-portal/state'+import PortalTwoFactor from '@/components/cloud-portal/auth/PortalTwoFactor.vue'++const portal = usePortal()+const route = useRoute()+const router = useRouter()+const { failure } = usePortalFailureMessages()+const method = ref<'authenticator' | 'recovery'>('authenticator')+const redirect = computed(() => continuationPath(route.query.redirect))+const passkeys = computed(() => portal.discovery.authentication.mfa?.passkeys ?? false)++type TwoStepResult = Awaited<ReturnType<typeof portal.auth.verifyTwoStep>>++/** One attempt at the second step: a refused code stays on the page, a passed one continues. */+const {+ busy: verifying,+ error,+ run,+ fail+} = usePortalAction(async (attempt: () => Promise<TwoStepResult>) => {+ const result = await attempt()+ if (!result.ok) {+ fail(failure(result.failure))+ return+ }+ await portal.refreshAccount()+ await router.replace(redirect.value)+})++function verify(code: string) {+ void run(() => portal.auth.verifyTwoStep(method.value, code.trim()))+}++function passkey() {+ if (!verifying.value) void run(() => portal.auth.withPasskey())+}+</script>++<template>+ <PortalTwoFactor+ :host="portal.host"+ :method="method"+ :passkeys="passkeys"+ :error="error"+ :verifying="verifying"+ @verify="verify"+ @switch-method="method = method === 'authenticator' ? 'recovery' : 'authenticator'"+ @passkey="passkey"+ />+</template>diff --git a/steiger.config.ts b/steiger.config.tsindex 537c002e5..0185c5e1b 100644--- a/steiger.config.ts+++ b/steiger.config.ts@@ -35,6 +35,7 @@ export default defineConfig(['open-pencil/no-app-imports-components-or-views': 'error','open-pencil/no-components-import-views': 'error','open-pencil/no-views-imported-outside-entry': 'error',+ 'open-pencil/no-editor-imports-in-cloud-portal': 'error','open-pencil/no-non-ui-imports-in-shared-ui': 'error','open-pencil/no-app-imports-in-shared-ui': 'error','open-pencil/no-property-panel-internals-outside-panel': 'error',diff --git a/tests/app/cloud-portal/navigation.test.ts b/tests/app/cloud-portal/navigation.test.tsnew file mode 100644index 000000000..98d34759a--- /dev/null+++ b/tests/app/cloud-portal/navigation.test.ts@@ -0,0 +1,70 @@+import { describe, expect, test } from 'bun:test'++import type { LocationQuery, RouteMeta } from 'vue-router'++import type { CloudAccountStatus } from '@open-pencil/cloud/contract'++import { portalDestination, type PortalRouteTarget } from '@/app/cloud-portal/navigation'++function target(path: string, meta: RouteMeta = {}, redirect?: string): PortalRouteTarget {+ const query: LocationQuery = redirect ? { redirect } : {}+ const fullPath = redirect ? `${path}?redirect=${encodeURIComponent(redirect)}` : path+ return { meta, path, fullPath, query }+}++function account(+ state: CloudAccountStatus['state'],+ deploymentRole: 'user' | 'admin' = 'user'+): CloudAccountStatus {+ return {+ state,+ user: { userId: 'user-1', email: '[email protected]', name: 'Ada', deploymentRole }+ }+}++describe('portal access rules', () => {+ test('signed-out pages send a signed-in person to where they were going', () => {+ const signIn = target('/auth/sign-in', { signedOut: true }, '/admin/people')+ expect(portalDestination(signIn, account('active'))).toBe('/admin/people')+ expect(portalDestination(signIn, null)).toBe(true)+ })++ test('a signed-in person is never sent to another origin', () => {+ const signIn = target('/auth/sign-in', { signedOut: true }, 'https://evil.example/')+ expect(portalDestination(signIn, account('active'))).toBe('/account')+ })++ test('account pages ask for a session and come back after it', () => {+ expect(portalDestination(target('/cloud/device', { account: true }), null)).toEqual({+ name: 'sign-in',+ query: { redirect: '/cloud/device' }+ })+ })++ test('an account waiting for review or declined only reaches its standing page', () => {+ const security = target('/account', { account: true })+ expect(portalDestination(security, account('pending'))).toBe('/account/pending')+ expect(portalDestination(security, account('rejected'))).toBe('/account/closed')+ expect(portalDestination(security, account('revoked'))).toBe('/account/closed')+ })++ test('standing pages belong only to the accounts they describe', () => {+ const pending = target('/account/pending', { account: true })+ const closed = target('/account/closed', { account: true })+ expect(portalDestination(pending, account('pending'))).toBe(true)+ expect(portalDestination(closed, account('revoked'))).toBe(true)+ expect(portalDestination(closed, account('pending'))).toBe('/account/pending')+ expect(portalDestination(closed, account('active'))).toBe('/account')+ expect(portalDestination(pending, account('active'))).toBe('/account')+ expect(portalDestination(closed, null)).toEqual({+ name: 'sign-in',+ query: { redirect: '/account/closed' }+ })+ })++ test('console pages ask for a deployment administrator', () => {+ const adminPage = target('/admin/people', { account: true, admin: true })+ expect(portalDestination(adminPage, account('active'))).toBe('/account')+ expect(portalDestination(adminPage, account('active', 'admin'))).toBe(true)+ })+})diff --git a/tools/checks/architecture/src/steiger-rules/index.ts b/tools/checks/architecture/src/steiger-rules/index.tsindex e2779f230..6ac6c65b3 100644--- a/tools/checks/architecture/src/steiger-rules/index.ts+++ b/tools/checks/architecture/src/steiger-rules/index.ts@@ -353,8 +353,16 @@ const noNonUIImportsInSharedUI = createImportRule(})-// The editor's root and router, plus the desktop Software Update window's page entry.-const VIEW_ENTRYPOINTS = new Set(['src/App.vue', 'src/main.ts', 'src/router.ts', 'src/updater.ts'])+// The editor's root and router, the desktop Software Update window's page entry, and the Cloud+// portal's entry and router.+const VIEW_ENTRYPOINTS = new Set([+ 'src/App.vue',+ 'src/main.ts',+ 'src/router.ts',+ 'src/updater.ts',+ 'src/cloud/main.ts',+ 'src/cloud/router.ts'+])const noViewsImportedOutsideEntry = createImportRule('open-pencil/no-views-imported-outside-entry',@@ -365,6 +373,29 @@ const noViewsImportedOutsideEntry = createImportRule(})+// The Cloud portal is served by the Cloud server on its own; it reuses the app's UI, never the+// editor, so its build stays small.+const CLOUD_PORTAL_SOURCES = [+ 'src/cloud/',+ 'src/views/cloud/',+ 'src/app/cloud-portal/',+ 'src/components/cloud-portal/',+ 'src/theme/cloud-portal/'+]+const EDITOR_ONLY_MODULES = ['src/app/editor/', 'src/app/shell/']++const noEditorImportsInCloudPortal = createImportRule(+ 'open-pencil/no-editor-imports-in-cloud-portal',+ (sourceRel, specifier, resolved) => {+ if (!CLOUD_PORTAL_SOURCES.some((prefix) => sourceRel.startsWith(prefix))) return null+ const editorOnly =+ specifier.startsWith('canvaskit-wasm') ||+ EDITOR_ONLY_MODULES.some((prefix) => resolved?.startsWith(prefix))+ if (!editorOnly) return null+ return 'The Cloud portal must not import editor sessions, CanvasKit, or the app shell, so `bun run build:cloud-portal` stays small.'+ }+)+const noAppImportsInSharedUI = createImportRule('open-pencil/no-app-imports-in-shared-ui',(sourceRel, _specifier, resolved) => {@@ -554,6 +585,7 @@ export const openPencilArchitecturePlugin = {noAppImportsComponentsOrViews,noComponentsImportViews,noViewsImportedOutsideEntry,+ noEditorImportsInCloudPortal,noNonUIImportsInSharedUI,noAppImportsInSharedUI,noPropertyPanelInternalsOutsidePanel,diff --git a/tools/checks/i18n/mixed-script-baseline.txt b/tools/checks/i18n/mixed-script-baseline.txtindex b025f3c61..06414fe0d 100644--- a/tools/checks/i18n/mixed-script-baseline.txt+++ b/tools/checks/i18n/mixed-script-baseline.txt@@ -445,3 +445,23 @@ zh-cn:storage.waitlistOpenWebsitezh-cn:storage.waitlistUnavailablezh-cn:statuses.figmaShowszh-cn:statuses.presetHandoff+ja:cloudPortal.signInTitle+ja:cloudPortal.returnsToDesktop+ja:cloudPortal.continueWithGoogle+ja:cloudPortal.continueWithApple+ja:cloudPortal.deviceTitle+ja:cloudPortal.deviceDescription+ja:cloudPortal.deviceWarningDescription+ja:cloudPortal.deviceApprovedDescription+ja:cloudPortal.deviceExpiredDescription+ja:cloudPortal.authenticatorOff+zh-cn:cloudPortal.signInTitle+zh-cn:cloudPortal.returnsToDesktop+zh-cn:cloudPortal.continueWithGoogle+zh-cn:cloudPortal.continueWithApple+zh-cn:cloudPortal.deviceTitle+zh-cn:cloudPortal.deviceDescription+zh-cn:cloudPortal.deviceWarningDescription+zh-cn:cloudPortal.deviceApprovedDescription+zh-cn:cloudPortal.deviceExpiredDescription+zh-cn:cloudPortal.authenticatorOffdiff --git a/tools/checks/i18n/src/check-locales.ts b/tools/checks/i18n/src/check-locales.tsindex 4c4f5b335..52e176532 100644--- a/tools/checks/i18n/src/check-locales.ts+++ b/tools/checks/i18n/src/check-locales.ts@@ -17,6 +17,7 @@ import { hasMixedLatinAndCjk, placeholders } from './quality'const LOCALES_DIR = 'packages/vue/src/i18n/locales'const LOCALE_FILE_NAMES: Record<string, string> = {+ cloudPortal: 'cloud-portal',designCheck: 'design-check',variableTypes: 'variable-types'}diff --git a/tools/checks/i18n/translation-baseline.txt b/tools/checks/i18n/translation-baseline.txtindex e1b43d526..5ccc44680 100644--- a/tools/checks/i18n/translation-baseline.txt+++ b/tools/checks/i18n/translation-baseline.txt@@ -374,3 +374,69 @@ it:storage.cloudTitlepl:panels.gridAutopl:storage.cloudTitlepl:statuses.status+es:cloudPortal.productName+es:cloudPortal.providerGoogle+es:cloudPortal.providerApple+es:cloudPortal.deploymentOfficial+es:cloudPortal.emailTransportSMTP+es:cloudPortal.emailTransportCloudflare+it:cloudPortal.productName+it:cloudPortal.email+it:cloudPortal.password+it:cloudPortal.sectionServer+it:cloudPortal.providerGoogle+it:cloudPortal.providerApple+it:cloudPortal.unnamedPasskey+it:cloudPortal.serverSection+it:cloudPortal.deploymentOfficial+it:cloudPortal.deploymentSelfHosted+it:cloudPortal.emailTransportSMTP+it:cloudPortal.emailTransportCloudflare+it:cloudPortal.emailKindOther+de:cloudPortal.productName+de:cloudPortal.name+de:cloudPortal.sectionServer+de:cloudPortal.providerGoogle+de:cloudPortal.providerApple+de:cloudPortal.passkeys+de:cloudPortal.unnamedPasskey+de:cloudPortal.administrator+de:cloudPortal.serverSection+de:cloudPortal.deploymentOfficial+de:cloudPortal.emailTransportSMTP+de:cloudPortal.emailTransportCloudflare+fr:cloudPortal.productName+fr:cloudPortal.providerGoogle+fr:cloudPortal.providerApple+fr:cloudPortal.deploymentOfficial+fr:cloudPortal.emailTransportSMTP+fr:cloudPortal.emailTransportCloudflare+ja:cloudPortal.productName+ja:cloudPortal.emailPlaceholder+ja:cloudPortal.providerGoogle+ja:cloudPortal.providerApple+ja:cloudPortal.deploymentOfficial+ja:cloudPortal.emailTransportSMTP+ja:cloudPortal.emailTransportCloudflare+zh-cn:cloudPortal.productName+zh-cn:cloudPortal.emailPlaceholder+zh-cn:cloudPortal.providerGoogle+zh-cn:cloudPortal.providerApple+zh-cn:cloudPortal.deploymentOfficial+zh-cn:cloudPortal.emailTransportSMTP+zh-cn:cloudPortal.emailTransportCloudflare+pl:cloudPortal.productName+pl:cloudPortal.emailPlaceholder+pl:cloudPortal.providerGoogle+pl:cloudPortal.providerApple+pl:cloudPortal.administrator+pl:cloudPortal.deploymentOfficial+pl:cloudPortal.emailTransportSMTP+pl:cloudPortal.emailTransportCloudflare+ru:cloudPortal.productName+ru:cloudPortal.emailPlaceholder+ru:cloudPortal.providerGoogle+ru:cloudPortal.providerApple+ru:cloudPortal.deploymentOfficial+ru:cloudPortal.emailTransportSMTP+ru:cloudPortal.emailTransportCloudflarediff --git a/tools/dev/cloud/src/index.ts b/tools/dev/cloud/src/index.tsindex b8a7f0217..767598d50 100644--- a/tools/dev/cloud/src/index.ts+++ b/tools/dev/cloud/src/index.ts@@ -115,35 +115,48 @@ async function start(project: string): Promise<void> {)await execute(['bunx', 'portless', 'alias', aliasName(mailURL), String(mailpitUIPort), '--force'])+ const betterAuthSecret = await authSecret()+ // The server serves the portal's pages from this build, rebuilt on every change.+ const portal = Bun.spawn(['bun', 'run', 'build:cloud-portal', '--watch'], {+ cwd: root,+ stdout: 'inherit',+ stderr: 'inherit'+ })+console.warn(`OpenPencil Cloud: ${cloudURL}`)console.warn(`Captured email: ${mailURL}`)console.warn('Stop the services with `bun run cloud:dev:down`; their data is kept.')- const exitCode = await execute(- [- 'bunx',- 'portless',- 'run',- '--name',- 'cloud.open-pencil',- 'bun',- '--watch',- 'packages/cloud/src/runtime/node/main.ts'- ],- {- allowFailure: true,- environment: {- ...process.env,- HOST: '127.0.0.1',- OPENPENCIL_CLOUD_CONFIG: generatedConfig,- DATABASE_URL: `postgresql://openpencil:${POSTGRES_PASSWORD}@127.0.0.1:${postgresPort}/openpencil`,- BETTER_AUTH_SECRET: await authSecret(),- S3_ACCESS_KEY_ID,- S3_SECRET_ACCESS_KEY+ try {+ process.exitCode = await execute(+ [+ 'bunx',+ 'portless',+ 'run',+ '--name',+ 'cloud.open-pencil',+ 'bun',+ '--watch',+ 'packages/cloud/src/runtime/node/main.ts'+ ],+ {+ allowFailure: true,+ environment: {+ ...process.env,+ HOST: '127.0.0.1',+ OPENPENCIL_CLOUD_CONFIG: generatedConfig,+ OPENPENCIL_CLOUD_PORTAL_DIR: join(root, 'dist-cloud-portal'),+ DATABASE_URL: `postgresql://openpencil:${POSTGRES_PASSWORD}@127.0.0.1:${postgresPort}/openpencil`,+ BETTER_AUTH_SECRET: betterAuthSecret,+ S3_ACCESS_KEY_ID,+ S3_SECRET_ACCESS_KEY+ }}- }- )- process.exitCode = exitCode+ )+ } finally {+ // The watcher stops with the server however the server ends.+ portal.kill()+ }}async function stop(project: string): Promise<void> {diff --git a/vite.config.ts b/vite.config.tsindex 33cee0d10..b49b53fe3 100644--- a/vite.config.ts+++ b/vite.config.ts@@ -20,6 +20,7 @@ import {openPencilAutomationPlugin} from './vite/automation'import { copyCanvasKitAssetsPlugin } from './vite/canvaskit-assets'+import { cloudPortalBrandPlugin } from './vite/cloud-portal'import { aiIconCollection } from './vite/icons'import { openPencilPwaPlugin } from './vite/pwa'import { rawMarkdownPlugin } from './vite/raw-markdown'@@ -28,8 +29,11 @@ import { createDevServerOptions } from './vite/server'const host = process.env.TAURI_DEV_HOSTconst automationRoute = localAutomationRoute(host)-export default defineConfig(async ({ command }) => {- await Promise.all([ensureBrandAssets(['web']), ensureDemoDocument()])+export default defineConfig(async ({ command, mode }) => {+ // `--mode cloud-portal` builds only the Cloud server's own pages (`cloud.html`), without the+ // editor, its demo document, CanvasKit, or the PWA.+ const cloudPortal = mode === 'cloud-portal'+ await Promise.all([ensureBrandAssets(['web']), cloudPortal ? undefined : ensureDemoDocument()])return {resolve: {alias: createOpenPencilAliases(__dirname)@@ -46,25 +50,29 @@ export default defineConfig(async ({ command }) => {optimizeDeps: { include: ['ai/test'] },plugins: [rawMarkdownPlugin(),- copyCanvasKitAssetsPlugin(),+ cloudPortal ? undefined : copyCanvasKitAssetsPlugin(),tailwindcss(),Icons({ compiler: 'vue3', customCollections: { ai: aiIconCollection() } }),Components({ resolvers: [IconsResolver({ prefix: 'icon', customCollections: ['ai'] })] }),- openPencilAutomationPlugin(command, host),+ cloudPortal ? undefined : openPencilAutomationPlugin(command, host),vue(),- openPencilPwaPlugin()+ cloudPortal ? cloudPortalBrandPlugin() : openPencilPwaPlugin()],clearScreen: false,+ publicDir: cloudPortal ? false : 'public',build: {// Syntax is lowered to the supported browser baseline; APIs are not polyfilled.target: viteBuildTarget(),chunkSizeWarningLimit: 2500,+ outDir: cloudPortal ? 'dist-cloud-portal' : 'dist',rolldownOptions: {- // The desktop Software Update window is its own page.- input: {- main: resolve(__dirname, 'index.html'),- updater: resolve(__dirname, 'updater.html')- }+ // The desktop Software Update window is its own page; the Cloud portal builds alone.+ input: cloudPortal+ ? { cloud: resolve(__dirname, 'cloud.html') }+ : {+ main: resolve(__dirname, 'index.html'),+ updater: resolve(__dirname, 'updater.html')+ }}},server: createDevServerOptions(host, __dirname)diff --git a/vite/cloud-portal.ts b/vite/cloud-portal.tsnew file mode 100644index 000000000..38f0551b8--- /dev/null+++ b/vite/cloud-portal.ts@@ -0,0 +1,25 @@+import { cpSync } from 'node:fs'+import { resolve } from 'node:path'++import type { Plugin, ResolvedConfig } from 'vite'++/**+ * The Cloud portal builds without the editor's public directory (fonts, CanvasKit, demo files)+ * and copies only the brand artwork, which components load from `/brand/`.+ */+export function cloudPortalBrandPlugin(): Plugin {+ let config: ResolvedConfig | undefined+ return {+ name: 'open-pencil-cloud-portal-brand',+ apply: 'build',+ configResolved(resolved) {+ config = resolved+ },+ writeBundle() {+ if (!config) return+ cpSync(resolve(config.root, 'public/brand'), resolve(config.build.outDir, 'brand'), {+ recursive: true+ })+ }+ }+}