Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Andrey Antukh 2026-11-20 09:54:54 +01:00
commit 15a099f118
68 changed files with 6437 additions and 4155 deletions

View File

@ -29,3 +29,8 @@ right flow.
Everything else (title derivation, metadata policy, body templates, Issue
Type IDs, create/verify/cleanup commands) lives in the memory — go to the
matching section there.
For the creation step, `python3 scripts/gh.py create-issue --type <type>
--title "..." --body-file <file>` creates the issue and sets its Issue Type in
one command (see `mem:scripts/gh`). Title derivation, body templates and
verification still follow `mem:workflow/creating-issues`.

View File

@ -59,7 +59,7 @@ The memory is structured in a way that you can get the critical information abou
- `scripts/paren-repair` — Fix mismatched delimiters in Clojure/CLJS files and reformat with cljfmt. Run before lint checks when LLM edits break parens. See `mem:scripts/paren-repair`.
- `scripts/psql` — PostgreSQL client wrapper with devenv defaults. Companion: `scripts/db-schema` for DDL dumps. See `mem:scripts/psql`.
- `scripts/taiga.py` — Fetch public issues, user stories, and tasks from the Penpot Taiga project without authentication. See `mem:scripts/taiga`.
- `scripts/gh.py` — GitHub operations helper: list milestone issues, fetch PR details, compare against CHANGES.md. Requires `gh` CLI. See `mem:scripts/gh`.
- `scripts/gh.py` — GitHub operations helper: list milestone issues, fetch PR details, compare against CHANGES.md, create issues with their Issue Type in one command. Requires `gh` CLI. See `mem:scripts/gh`.
- `scripts/coverage-summary.mjs` — Renders an lcov file as a markdown table grouped by source area, for `$GITHUB_STEP_SUMMARY` (`--title`, `--lcov`, optional `--note`, `--unloaded`). Used by the backend, common and frontend test workflows; module coverage commands are in `mem:backend/testing`, `mem:common/testing`, `mem:frontend/testing`.
- `scripts/coverage-comment.mjs` — Keeps one PR comment (`<!-- coverage-report -->`) with the coverage table of Backend, Common, Frontend and Render WASM, in the format of the Vitest Coverage Report Action (status, metric, %, covered/total, changed-file coverage, run/commit footer). Each test job updates its own project: the data of all three lives base64-encoded in a hidden `coverage-data` block, and the job re-reads after `SETTLE_MS` and rewrites if a concurrent job dropped its data; extra report comments from simultaneous creates are merged and deleted. Targets (`THRESHOLDS`, per project and metric, status colour only, never fail CI) are on lines only: 70 Backend, 70 Common, 50 Frontend, 40 Render WASM; other metrics get the blue dot. Statements are Clojure forms for Backend/Common (`--emma-xml`) and llvm regions for Render WASM (`--llvm-json`). Shared lcov parsing: `scripts/coverage-lcov.mjs`. The test workflows run it only for PRs from branches of this repo (job-level `pull-requests: write`, `continue-on-error`): fork PRs get a read-only token, so they only get the run-page summary. A fork-safe `workflow_run` commenter would run only from the default branch's copy of the workflow.
- `scripts/project-anomalies.py` — Main-board anomaly check for a milestone (`check` writes `tmp/<MILESTONE>-ANOMALIES.md`). Bulk resolution via `scripts/gh.py`. See `mem:scripts/project-anomalies`.

View File

@ -13,7 +13,7 @@ Frontend: CLJS SPA; React/Rumext; Potok; RxJS; okulary refs; SCSS modules; share
- `app.util.*`: DOM, HTTP, i18n, keyboard, codegen, and general frontend utilities.
- `frontend/packages/*` and `frontend/text-editor`: JS/TS workspace packages consumed by the app.
- Nitrate subscription/organization UI and flows live under `app.main.data.nitrate` and `app.main.ui.nitrate*`; backend/API behavior is covered by backend memories, and shared organization permission rules (`allowed?`, `can-send-invitations?`) are in `common/src/app/common/types/organization.cljc`.
- `app.config` external bridges (`external-feature-flag`, `external-session-id`, `external-context-info`, `external-notify-register-success`, `initialize-external-context-info`) delegate to `globalThis` hooks injected by the SaaS host. Never delete `external-feature-flag`, even with zero call sites: it is the seam for future A/B tests.
- `app.config` external bridges (`external-feature-flag`, `external-session-id`, `external-context-info`, `external-notify-register-success`, `initialize-external-context-info`, `add-event-callback` / `get-event-callbacks` via `penpotEventCallbacks` + `penpotAddEventCallback`) delegate to `globalThis` hooks injected by the SaaS host. Never delete `external-feature-flag`, even with zero call sites: it is the seam for future A/B tests. Frontend audit events are forwarded to named host callbacks from `app.main.data.event` after `make-event` (vendor-agnostic; no analytics SDK in Penpot). `resources/js/event-callbacks.js` is copied to `public/js/` and loaded in `index.mustache` **before** `config.js` so hosts can call `penpotAddEventCallback` at config parse time.
## Lint and Format

View File

@ -43,7 +43,7 @@
- Exports (exporter and client/WASM PDF/SVG/PNG alike), the dashboard `dd/duplicate-files` and the `.penpot` download call `force-persist-files-and-wait file-ids timeout` first. A client export draws local data, so its warning says the export includes unsaved changes (`workspace.export.unsaved-changes-included`); exporter exports and the duplicate copy server data and warn they miss them. `duplicate-files` owns its one toast, shown once every copy exists: the plural `dashboard.duplicate-unsaved-changes` warning when the files had unsaved changes before the copy request, else the success toast; a failed copy errors the stream, so neither shows (the file menu must not emit its own success toast, the single-toast store would let it replace the warning).
- Exports and the `.penpot` download call `force-persist-files-and-wait file-ids timeout` (waits only for those files, ends on `:error` or timeout, never raises) and then `unsaved-changes? state file-ids` to warn; it reads `refs/persistence`, so tests mock it with `(l/derived :persistence store)`.
- `persistence-failed` emits a `save-failed` audit event (`:cause-type :code :retrying :queued-commits`) whenever the user is notified (`notify-failure?`, same rule as the toast), including delegated auth failures.
- `start-undo-transaction` stamps the transaction with a fresh `:commit-group` (dropped from the history entry); `commit-changes` uses `(or undo-group (:undo-group tx) (:commit-group tx) (uuid/next))`, so all commits of one transaction are one rollback unit. Pre-setting `:undo-group` instead breaks entries whose group is set later (sync transactions).
- `start-undo-transaction` stamps the transaction with a fresh `:commit-group` (dropped from the history entry); `commit-changes` uses `(or undo-group <stacked-entry-group> (:undo-group tx) (:commit-group tx) (uuid/next))`, so all commits of one transaction are one rollback unit. `<stacked-entry-group>` (`get-stacked-undo-group`) is the `:undo-group` of the entry at the current undo index, taken only by a `:stack-undo? true` commit that records undo (`save-undo?` and non-empty undo changes, the history watcher's test) and only when the open transaction holds no changes (else `append-undo` accumulates it into the transaction): the commits it starts (component sync after a main text resizes) inherit it, so one Ctrl+Z reverts the whole action. Heals (`:stack-undo? true :save-undo? false`) never take it, or a rejected heal would roll back the user's last action. Known limit: a late stacked commit (font-load resize) that lands while an unrelated user transaction is open but still empty (colorpicker mousedown) takes the previous entry's group; its sync reuses that transaction (`start-undo-transaction` keeps an open one) and sets the transaction's `:undo-group`, so the user's next action undoes together with the previous one. Rare and loses no data; left as is. Pre-setting `:undo-group` instead breaks entries whose group is set later (sync transactions).
- Undo transactions can stay open only temporarily; timed-out pending transactions are force-committed after about 20s. Undo entries are capped at 50.
- Undo/redo are ignored while a normal editor/drawing interaction is active, except grid-layout edition handles undo through this path. `undo`, `redo` and `undo-to-index` also do nothing while the save lock holds: `materialize-undo` would move the index while the commit is refused.
- Undo entries carry a required boolean `:translation` (`schema:undo-entry` rejects an entry without it; `initialize-workspace` sets it when it records a local commit) and `undo`, `redo` and `undo-to-index` pass it back to `commit-changes`, so replaying a pure move skips component sync and thumbnails like the original commit did. Merging ANDs the flags: `stack-undo-entry`, `accumulate-undo-entry` (`empty-tx` starts at true) and undo groups in `undo-to-index` (`every?`). Test harnesses that mirror the recorder (`tokens/helpers/state.cljs`, `composable_tests/interpreter.cljs`) must pass it too.

View File

@ -6,7 +6,12 @@
- `libs/plugin-types`: TypeScript declarations for the public Penpot Plugin API. Type-only package; runtime behavior is implemented elsewhere.
- `libs/plugins-runtime`: runtime that loads plugins and exposes/generated API behavior to plugin code.
- `libs/plugins-styles`: reusable styling package for plugins.
- `libs/plugins-styles`: reusable styling package for plugins. Keep its root
`styles.css`: it imports `src/lib/styles.css` and mirrors the bundled file
`tools/scripts/build-css.mjs` publishes. When a consumer depends on the same
version as this package, pnpm links the source tree instead of the published
package, and the documented `@penpot/plugin-styles/styles.css` import must
still resolve.
- `apps/*-plugin`: sample/development plugins. `apps/e2e`: plugin e2e tests.
## Dev Workflow

View File

@ -10,6 +10,7 @@ repository via GraphQL and REST APIs through the authenticated `gh` CLI.
- Fetching PR details by number or by milestone.
- Comparing milestone issues against CHANGES.md to find missing entries.
- Explicitly linking a GitHub issue to a pull request.
- Creating an issue with its Issue Type set in a single command.
- Listing or inspecting GitHub Security Advisories (GHSA).
- Fetching issue comments (the `## Breaking change note` markdown for the changelog).
@ -104,6 +105,25 @@ python3 scripts/gh.py link-issue <ISSUE_NUMBER> <PR_NUMBER>
The command resolves both node IDs and calls `addCloseIssueReferences`. It trusts the successful mutation instead of re-querying, because GitHub does not reliably report mutation-created links through `closedByPullRequestsReferences(userLinkedOnly: true)`. It is safe to rerun and works for merged PRs. It does not guarantee the issue stays open: adding `Closes #N` to the body of an already-merged PR closed the issue immediately when tried (#12896 / PR #12067, 2026-11-09). JSON goes to stdout; progress and errors go to stderr; a missing issue/PR or a failed mutation exits non-zero.
### `create-issue`
Create an issue and set its Issue Type in one command. `gh issue create` cannot set the type, so the script runs `gh issue create` (always with `--project Main` by default) and then two GraphQL calls: one to get the issue's node ID and one `updateIssue` mutation to set the type. The issue number is parsed from the URL returned by `gh issue create`.
```bash
python3 scripts/gh.py create-issue \
--type task \
--title "Expand backend email tests" \
--body-file /tmp/issue-body.md
# Optional label (comma-separated); no --milestone (set it later if needed)
python3 scripts/gh.py create-issue --type bug --title "..." \
--body-file /tmp/issue-body.md --label "breaking change"
```
`--type` is a name from the Issue Type table in `mem:workflow/creating-issues` (`bug`, `enhancement`, `feature`, `task`, `question`, `docs`, `epic`); it is case-insensitive and the ID mapping lives in `ISSUE_TYPE_IDS` in `scripts/gh.py`. The command prints JSON with `number`, `url`, `title` and `issue_type` to stdout, and progress to stderr. If the type assignment fails after creation, the issue is left in place and the error reports its number and URL so it can be fixed by hand. This shortcut does not replace the workflow in `mem:workflow/creating-issues`: title derivation, body templates and verification still follow that memory.
**Output**: JSON object on stdout; progress and errors on stderr. A bad type, a `gh` failure, or a type that was not applied exits non-zero.
### `advisories`
List or inspect GitHub Security Advisories for the repository.

View File

@ -123,6 +123,8 @@ gh issue create \
Output: `https://github.com/penpot/penpot/issues/<NUMBER>`
**Shortcut:** `python3 scripts/gh.py create-issue --type <type> --title "..." --body-file /tmp/issue-body.md` does the creation and the Issue Type assignment in one command (see `mem:scripts/gh`). Title derivation, body templates and verification in this memory still apply.
## Setting the Issue Type
`gh issue create` can't set Issue Type directly. Use GraphQL after creation.

View File

@ -3,10 +3,10 @@
:deps
{penpot/common {:local/root "../common"}
org.clojure/clojure {:mvn/version "1.12.6"}
org.clojure/clojure {:mvn/version "1.12.7"}
org.clojure/tools.namespace {:mvn/version "1.5.1"}
com.github.luben/zstd-jni {:mvn/version "1.5.7-21"}
com.github.luben/zstd-jni {:mvn/version "1.5.7-28"}
io.prometheus/simpleclient {:mvn/version "0.16.0"}
io.prometheus/simpleclient_hotspot {:mvn/version "0.16.0"}
@ -17,7 +17,7 @@
io.prometheus/simpleclient_httpserver {:mvn/version "0.16.0"}
io.lettuce/lettuce-core {:mvn/version "7.8.0.RELEASE"}
io.lettuce/lettuce-core {:mvn/version "7.9.0.RELEASE"}
;; Minimal dependencies required by lettuce, we need to include them
;; explicitly because clojure dependency management does not support
;; yet the BOM format.
@ -25,7 +25,7 @@
io.micrometer/micrometer-observation {:mvn/version "1.14.2"}
java-http-clj/java-http-clj {:mvn/version "0.4.3"}
com.google.guava/guava {:mvn/version "33.7.1-jre"}
com.google.guava/guava {:mvn/version "33.8.0-jre"}
funcool/yetti
{:git/tag "v11.11"
@ -34,12 +34,12 @@
:exclusions [org.slf4j/slf4j-api]}
com.github.seancorfield/next.jdbc
{:mvn/version "1.3.1118"}
{:mvn/version "1.4.72"}
metosin/reitit-core {:mvn/version "0.11.0"}
nrepl/nrepl {:mvn/version "1.8.0"}
org.postgresql/postgresql {:mvn/version "42.7.13"}
org.postgresql/postgresql {:mvn/version "42.7.14"}
com.zaxxer/HikariCP {:mvn/version "7.1.0"}
@ -49,26 +49,26 @@
buddy/buddy-sign {:mvn/version "3.6.1-359"}
org.passay/passay {:mvn/version "2.0.0"}
com.github.ben-manes.caffeine/caffeine {:mvn/version "3.3.0"}
com.github.ben-manes.caffeine/caffeine {:mvn/version "3.3.1"}
org.jsoup/jsoup {:mvn/version "1.23.2"}
org.jsoup/jsoup {:mvn/version "1.24.1"}
com.j256.simplemagic/simplemagic {:mvn/version "1.17"}
at.yawk.lz4/lz4-java
{:mvn/version "1.12.0"}
{:mvn/version "1.14.1"}
org.clojars.pntblnk/clj-ldap {:mvn/version "0.0.17"}
dawran6/emoji {:mvn/version "0.2.0"}
markdown-clj/markdown-clj {:mvn/version "1.12.10"}
markdown-clj/markdown-clj {:mvn/version "1.12.14"}
;; Pretty Print specs
pretty-spec/pretty-spec {:mvn/version "0.1.4"}
software.amazon.awssdk/s3 {:mvn/version "2.55.11"}
software.amazon.awssdk/sts {:mvn/version "2.55.11"}
software.amazon.awssdk/s3 {:mvn/version "2.59.4"}
software.amazon.awssdk/sts {:mvn/version "2.59.4"}
com.ladybugdb/lbug {:mvn/version "0.21.2"}
com.ladybugdb/lbug {:mvn/version "0.22.3"}
;; Required by Arrow RootAllocator (lbug only pulls arrow-memory-core).
org.apache.arrow/arrow-memory-netty {:mvn/version "19.0.0"}}

View File

@ -30,6 +30,7 @@ export PENPOT_MEDIA_PROCESSING_SERVICE_URI=http://localhost:6065
export PENPOT_FLAGS="\
$PENPOT_FLAGS \
disable-admin-console \
enable-login-with-password \
enable-login-with-ldap \
disable-login-with-oidc \

View File

@ -1,5 +1,5 @@
{:deps
{org.clojure/clojure {:mvn/version "1.12.6"}
{org.clojure/clojure {:mvn/version "1.12.7"}
org.clojure/data.json {:mvn/version "2.5.2"}
org.clojure/tools.cli {:mvn/version "1.4.256"}
org.clojure/test.check {:mvn/version "1.1.3"}
@ -20,17 +20,17 @@
selmer/selmer {:mvn/version "1.13.5"}
criterium/criterium {:mvn/version "0.4.6"}
metosin/jsonista {:mvn/version "1.0.1"
metosin/jsonista {:mvn/version "1.0.2"
:exclusions [com.fasterxml.jackson.core/jackson-core
com.fasterxml.jackson.core/jackson-databind]}
com.fasterxml.jackson.core/jackson-core {:mvn/version "2.22.3"}
com.fasterxml.jackson.core/jackson-databind {:mvn/version "2.22.3"}
com.fasterxml.jackson.core/jackson-core {:mvn/version "2.23.0"}
com.fasterxml.jackson.core/jackson-databind {:mvn/version "2.23.0"}
metosin/malli {:mvn/version "0.20.2"}
metosin/malli {:mvn/version "0.20.3"}
expound/expound {:mvn/version "0.9.0"}
com.cognitect/transit-clj {:mvn/version "1.1.363"}
com.cognitect/transit-clj {:mvn/version "1.2.372"}
com.cognitect/transit-cljs {:mvn/version "0.8.280"}
java-http-clj/java-http-clj {:mvn/version "0.4.3"}
integrant/integrant {:mvn/version "1.0.1"}

View File

@ -11,11 +11,11 @@
"url": "https://github.com/penpot/penpot"
},
"devDependencies": {
"concurrently": "^10.0.5",
"concurrently": "^10.0.7",
"nodemon": "^3.1.14",
"prettier": "3.9.9",
"prettier": "3.10.1",
"source-map-support": "^0.5.21",
"ws": "^8.22.0"
"ws": "^8.23.0"
},
"dependencies": {
"date-fns": "^4.4.0"

90
common/pnpm-lock.yaml generated
View File

@ -171,6 +171,10 @@ settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
overrides:
brace-expansion@>=4.0.0 <5.0.12: ^5.0.12
minimatch@>=7.0.0 <11.0.1: ^11.0.1
importers:
.:
@ -180,25 +184,28 @@ importers:
version: 4.4.0
devDependencies:
concurrently:
specifier: ^10.0.5
version: 10.0.5
specifier: ^10.0.7
version: 10.0.7
nodemon:
specifier: ^3.1.14
version: 3.1.14
prettier:
specifier: 3.9.9
version: 3.9.9
specifier: 3.10.1
version: 3.10.1
source-map-support:
specifier: ^0.5.21
version: 0.5.21
ws:
specifier: ^8.22.0
version: 8.22.0
specifier: ^8.23.0
version: 8.23.0
packages:
ansi-regex@6.2.2:
resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==}
'@isaacs/nonrecursive-glob-match@1.1.0':
resolution: {integrity: sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==}
ansi-regex@6.6.0:
resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==}
engines: {node: '>=12'}
ansi-styles@6.2.3:
@ -217,8 +224,8 @@ packages:
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
engines: {node: '>=8'}
brace-expansion@5.0.9:
resolution: {integrity: sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==}
brace-expansion@5.0.13:
resolution: {integrity: sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==}
engines: {node: 20 || >=22}
braces@3.0.3:
@ -240,8 +247,8 @@ packages:
resolution: {integrity: sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==}
engines: {node: '>=20'}
concurrently@10.0.5:
resolution: {integrity: sha512-JaP/CoftUrCcAFW/g//RbgEGwlelnEae6cfBLgH6ZdO6s8jPkn6p9SB9u6pdVxYXoiSnFqseOlHfrEfF82TVOg==}
concurrently@10.0.7:
resolution: {integrity: sha512-zMCeLhawVIj3SLbpg0/BWCdJl1wcBSpcHKbNrhaM01P3xAlEWcH30Lea2q+F4uGZ7YM0scDK0dgpWyn1uCJj6w==}
engines: {node: '>=22'}
hasBin: true
@ -277,8 +284,8 @@ packages:
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
engines: {node: 6.* || 8.* || >= 10.*}
get-east-asian-width@1.6.0:
resolution: {integrity: sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==}
get-east-asian-width@1.7.0:
resolution: {integrity: sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==}
engines: {node: '>=18'}
glob-parent@5.1.2:
@ -308,9 +315,9 @@ packages:
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
engines: {node: '>=0.12.0'}
minimatch@10.2.5:
resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==}
engines: {node: 18 || 20 || >=22}
minimatch@11.0.9:
resolution: {integrity: sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q==}
engines: {node: 20 || >=22}
ms@2.1.3:
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
@ -328,8 +335,8 @@ packages:
resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==}
engines: {node: '>=8.6'}
prettier@3.9.9:
resolution: {integrity: sha512-Z/CJHIkdujO/OtN7nXUii0Rf3VT5SRuhjBA82Xvu2XhBUgX3nhP67T0LHceBdQLex7OOFGTox+Q5Yg8Jk2Qivg==}
prettier@3.10.1:
resolution: {integrity: sha512-70vp3ZUYoPlFbF9uiTdXHUUCGEIp7d4+6p+8DYbkm2jP7x/3i/paXVF6dopSI3zd/CEitrZN1rc4i85xWmmXlg==}
engines: {node: '>=14'}
hasBin: true
@ -348,8 +355,8 @@ packages:
engines: {node: '>=10'}
hasBin: true
shell-quote@1.9.0:
resolution: {integrity: sha512-Iov+JwFv/2HcTpcwNMKd8+IWNb8tboQJNQTkAY/LLVK7gGH9jy+LGkVqPxfekHl+yMmiqXszdGWXgkfml7hjqA==}
shell-quote@1.12.0:
resolution: {integrity: sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q==}
engines: {node: '>= 0.4'}
simple-update-notifier@2.0.0:
@ -391,8 +398,8 @@ packages:
resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==}
hasBin: true
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
tslib@2.9.1:
resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==}
undefsafe@2.0.5:
resolution: {integrity: sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==}
@ -401,8 +408,8 @@ packages:
resolution: {integrity: sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==}
engines: {node: '>=18'}
ws@8.22.0:
resolution: {integrity: sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==}
ws@8.23.0:
resolution: {integrity: sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
@ -427,7 +434,9 @@ packages:
snapshots:
ansi-regex@6.2.2: {}
'@isaacs/nonrecursive-glob-match@1.1.0': {}
ansi-regex@6.6.0: {}
ansi-styles@6.2.3: {}
@ -440,7 +449,7 @@ snapshots:
binary-extensions@2.3.0: {}
brace-expansion@5.0.9:
brace-expansion@5.0.13:
dependencies:
balanced-match: 4.0.4
@ -470,11 +479,11 @@ snapshots:
strip-ansi: 7.2.0
wrap-ansi: 9.0.2
concurrently@10.0.5:
concurrently@10.0.7:
dependencies:
chalk: 5.6.2
rxjs: 7.8.2
shell-quote: 1.9.0
shell-quote: 1.12.0
supports-color: 10.2.2
tree-kill: 1.2.2
yargs: 18.0.0
@ -500,7 +509,7 @@ snapshots:
get-caller-file@2.0.5: {}
get-east-asian-width@1.6.0: {}
get-east-asian-width@1.7.0: {}
glob-parent@5.1.2:
dependencies:
@ -522,9 +531,10 @@ snapshots:
is-number@7.0.0: {}
minimatch@10.2.5:
minimatch@11.0.9:
dependencies:
brace-expansion: 5.0.9
'@isaacs/nonrecursive-glob-match': 1.1.0
brace-expansion: 5.0.13
ms@2.1.3: {}
@ -533,7 +543,7 @@ snapshots:
chokidar: 3.6.0
debug: 4.4.3(supports-color@5.5.0)
ignore-by-default: 1.0.1
minimatch: 10.2.5
minimatch: 11.0.9
pstree.remy: 1.1.8
semver: 7.8.4
simple-update-notifier: 2.0.0
@ -545,7 +555,7 @@ snapshots:
picomatch@2.3.2: {}
prettier@3.9.9: {}
prettier@3.10.1: {}
pstree.remy@1.1.8: {}
@ -555,11 +565,11 @@ snapshots:
rxjs@7.8.2:
dependencies:
tslib: 2.8.1
tslib: 2.9.1
semver@7.8.4: {}
shell-quote@1.9.0: {}
shell-quote@1.12.0: {}
simple-update-notifier@2.0.0:
dependencies:
@ -575,12 +585,12 @@ snapshots:
string-width@7.2.0:
dependencies:
emoji-regex: 10.6.0
get-east-asian-width: 1.6.0
get-east-asian-width: 1.7.0
strip-ansi: 7.2.0
strip-ansi@7.2.0:
dependencies:
ansi-regex: 6.2.2
ansi-regex: 6.6.0
supports-color@10.2.2: {}
@ -596,7 +606,7 @@ snapshots:
tree-kill@1.2.2: {}
tslib@2.8.1: {}
tslib@2.9.1: {}
undefsafe@2.0.5: {}
@ -606,7 +616,7 @@ snapshots:
string-width: 7.2.0
strip-ansi: 7.2.0
ws@8.22.0: {}
ws@8.23.0: {}
y18n@5.0.8: {}

View File

@ -1,3 +1,7 @@
storeDir: ../.pnpm-store
minimumReleaseAge: 0
overrides:
brace-expansion@>=4.0.0 <5.0.12: ^5.0.12
minimatch@>=7.0.0 <11.0.1: ^11.0.1

View File

@ -9,7 +9,23 @@
[app.common.data.macros :as dm]
[app.common.geom.rect :as grc]
[app.common.geom.shapes.common :as gco]
[app.common.geom.shapes.transforms :as gtr]))
[app.common.geom.shapes.transforms :as gtr]
[app.common.math :as mth]
[app.common.types.shape.layout :as ctl]))
(defn text-size-drifted?
"True when a measured auto-grow size is off the stored one by more than
`tolerance` on an axis that grows (width for :auto-width, height for both
auto-grow types). An axis that fills its layout parent takes its size
from the layout, so it never drifts. Other grow types never drift."
[{:keys [grow-type width height] :as shape} new-width new-height tolerance]
(boolean
(or (and (= :auto-width grow-type)
(not (ctl/fill-width? shape))
(not (mth/close? width new-width tolerance)))
(and (contains? #{:auto-width :auto-height} grow-type)
(not (ctl/fill-height? shape))
(not (mth/close? height new-height tolerance))))))
(defn position-data->rect
[{:keys [x y width height]}]

View File

@ -74,3 +74,41 @@
shape {:points shape-points}
pd [{:x 200 :y 200 :width 20 :height 10}]]
(t/is (false? (gte/overlaps-position-data? shape pd))))))
(t/deftest text-size-drifted-ignores-sub-pixel-gaps
(t/is (not (gte/text-size-drifted? {:grow-type :auto-width :width 100 :height 17} 100.5 17.5 1)))
(t/is (not (gte/text-size-drifted? {:grow-type :auto-height :width 100 :height 17} 100 17.5 1))))
(t/deftest text-size-drifted-checks-only-the-growing-axis
(t/is (not (gte/text-size-drifted? {:grow-type :auto-height :width 100 :height 17} 140 17 1))
"auto-height width comes from the box, not the text")
(t/is (gte/text-size-drifted? {:grow-type :auto-height :width 100 :height 17} 100 34 1))
(t/is (gte/text-size-drifted? {:grow-type :auto-width :width 44 :height 17} 67 17 1))
(t/is (gte/text-size-drifted? {:grow-type :auto-width :width 44 :height 17} 44 34 1)
"auto-width grows in height too"))
(t/deftest text-size-drifted-treats-exactly-the-tolerance-as-rounding
(t/is (not (gte/text-size-drifted? {:grow-type :auto-height :width 100 :height 17} 100 18 1))
"a 1px height gap is rounding at a 1px tolerance")
(t/is (not (gte/text-size-drifted? {:grow-type :auto-width :width 44 :height 17} 45 17 1))
"a 1px width gap is rounding at a 1px tolerance")
(t/is (gte/text-size-drifted? {:grow-type :auto-height :width 100 :height 17} 100 17.5 0.1)
"a finer tolerance catches a sub-pixel gap"))
(t/deftest text-size-drifted-ignores-an-axis-that-fills-its-parent
(t/is (not (gte/text-size-drifted? {:grow-type :auto-height :width 100 :height 40
:layout-item-v-sizing :fill}
100 17 1))
"a height set by the layout is not drift")
(t/is (not (gte/text-size-drifted? {:grow-type :auto-width :width 200 :height 17
:layout-item-h-sizing :fill}
44 17 1))
"a width set by the layout is not drift")
(t/is (gte/text-size-drifted? {:grow-type :auto-width :width 200 :height 17
:layout-item-h-sizing :fill}
44 34 1)
"the axis that does not fill is still checked"))
(t/deftest text-size-drifted-ignores-other-grow-types
(t/is (not (gte/text-size-drifted? {:grow-type :fixed :width 100 :height 17} 300 90 1)))
(t/is (not (gte/text-size-drifted? {:width 100 :height 17} 300 90 1))))

View File

@ -879,3 +879,200 @@
(t/is (= "14" (:font-size line)))
;; The text doesn't change, because the structure was touched
(t/is (= "hello world" (:text line)))))
(t/deftest sync-text-override-with-geometry-touched-keeps-width
;; Documents the #12721 gap: text+geometry touched receives font-size from
;; main but keeps local width until frontend re-measure.
(let [;; ==== Setup
file0 (-> (thf/sample-file :file1)
(tho/add-frame-with-text :main-root :main-child "hello world")
(thc/make-component :component1 :main-root)
(thc/instantiate-component :component1 :copy-root {:children-labels [:copy-child]}))
page0 (thf/current-page file0)
copy-child (ths/get-shape file0 :copy-child)
copy-width (:width copy-child)
changes (cls/generate-update-shapes (pcb/empty-changes nil (:id page0))
#{(:id copy-child)}
(fn [shape]
(-> shape
(assoc-in [:content :children 0 :children 0 :children 0 :text] "Hi")
(assoc :width (+ copy-width 25)
:touched #{:content-group
:text-content-text
:geometry-group})))
(:objects page0)
{:ignore-touched true})
file (thf/apply-changes file0 changes)
main-child (ths/get-shape file :main-child)
page (thf/current-page file)
copy-before (ths/get-shape file :copy-child)
;; ==== Action — main font-size change + sync
changes1 (cls/generate-update-shapes (pcb/empty-changes nil (:id page))
#{(:id main-child)}
(fn [shape]
(-> shape
(assoc-in [:content :children 0 :children 0 :children 0 :font-size] "32")
(assoc :width (+ (:width shape) 50))))
(:objects page)
{})
updated-file (thf/apply-changes file changes1)
changes2 (cll/generate-sync-file-changes (pcb/empty-changes)
nil
:components
(:id updated-file)
(thi/id :component1)
(:id updated-file)
{(:id updated-file) updated-file}
(:id updated-file))
file' (thf/apply-changes updated-file changes2)
;; ==== Get
copy-child' (ths/get-shape file' :copy-child)
line (get-in copy-child' [:content :children 0 :children 0 :children 0])]
(t/is (= "32" (:font-size line)))
(t/is (= "Hi" (:text line)))
(t/is (= (:width copy-before) (:width copy-child')))
(t/is (contains? (:touched copy-child') :geometry-group))))
(t/deftest sync-text-only-override-without-geometry-receives-font-size
(let [;; ==== Setup
file0 (-> (thf/sample-file :file1)
(tho/add-frame-with-text :main-root :main-child "hello world")
(thc/make-component :component1 :main-root)
(thc/instantiate-component :component1 :copy-root {:children-labels [:copy-child]}))
page0 (thf/current-page file0)
copy-child (ths/get-shape file0 :copy-child)
changes (cls/generate-update-shapes (pcb/empty-changes nil (:id page0))
#{(:id copy-child)}
(fn [shape]
(assoc-in shape [:content :children 0 :children 0 :children 0 :text] "Hi"))
(:objects page0)
{})
file (thf/apply-changes file0 changes)
main-child (ths/get-shape file :main-child)
page (thf/current-page file)
copy-mid (ths/get-shape file :copy-child)
;; ==== Action
changes1 (cls/generate-update-shapes (pcb/empty-changes nil (:id page))
#{(:id main-child)}
(fn [shape]
(assoc-in shape [:content :children 0 :children 0 :children 0 :font-size] "32"))
(:objects page)
{})
updated-file (thf/apply-changes file changes1)
changes2 (cll/generate-sync-file-changes (pcb/empty-changes)
nil
:components
(:id updated-file)
(thi/id :component1)
(:id updated-file)
{(:id updated-file) updated-file}
(:id updated-file))
file' (thf/apply-changes updated-file changes2)
copy-child' (ths/get-shape file' :copy-child)
line (get-in copy-child' [:content :children 0 :children 0 :children 0])]
(t/is (= #{:content-group :text-content-text} (:touched copy-mid)))
(t/is (not (contains? (:touched copy-mid) :geometry-group)))
(t/is (= "32" (:font-size line)))
(t/is (= "Hi" (:text line)))))
(t/deftest sync-fixed-copy-keeps-grow-type-and-local-width-when-geometry-touched
(let [;; ==== Setup
file0 (-> (thf/sample-file :file1)
(tho/add-frame-with-text :main-root :main-child "hello world"
:child-params {:grow-type :fixed :width 120 :height 40})
(thc/make-component :component1 :main-root)
(thc/instantiate-component :component1 :copy-root {:children-labels [:copy-child]}))
page0 (thf/current-page file0)
copy-child (ths/get-shape file0 :copy-child)
changes (cls/generate-update-shapes (pcb/empty-changes nil (:id page0))
#{(:id copy-child)}
(fn [shape]
(-> shape
(assoc :width 200
:touched #{:geometry-group})))
(:objects page0)
{:ignore-touched true})
file (thf/apply-changes file0 changes)
main-child (ths/get-shape file :main-child)
page (thf/current-page file)
changes1 (cls/generate-update-shapes (pcb/empty-changes nil (:id page))
#{(:id main-child)}
(fn [shape]
(assoc shape :width 300))
(:objects page)
{})
updated-file (thf/apply-changes file changes1)
changes2 (cll/generate-sync-file-changes (pcb/empty-changes)
nil
:components
(:id updated-file)
(thi/id :component1)
(:id updated-file)
{(:id updated-file) updated-file}
(:id updated-file))
file' (thf/apply-changes updated-file changes2)
copy-child' (ths/get-shape file' :copy-child)]
(t/is (= :fixed (:grow-type copy-child')))
(t/is (= 200 (:width copy-child')))
(t/is (contains? (:touched copy-child') :geometry-group))))
(t/deftest sync-grow-type-override-kept-on-copy
(let [;; ==== Setup
file0 (-> (thf/sample-file :file1)
(tho/add-frame-with-text :main-root :main-child "hello world")
(thc/make-component :component1 :main-root)
(thc/instantiate-component :component1 :copy-root {:children-labels [:copy-child]}))
page0 (thf/current-page file0)
copy-child (ths/get-shape file0 :copy-child)
changes (cls/generate-update-shapes (pcb/empty-changes nil (:id page0))
#{(:id copy-child)}
(fn [shape]
(assoc shape :grow-type :fixed))
(:objects page0)
{})
file (thf/apply-changes file0 changes)
main-child (ths/get-shape file :main-child)
page (thf/current-page file)
copy-mid (ths/get-shape file :copy-child)
changes1 (cls/generate-update-shapes (pcb/empty-changes nil (:id page))
#{(:id main-child)}
(fn [shape]
(assoc-in shape [:content :children 0 :children 0 :children 0 :font-size] "32"))
(:objects page)
{})
updated-file (thf/apply-changes file changes1)
changes2 (cll/generate-sync-file-changes (pcb/empty-changes)
nil
:components
(:id updated-file)
(thi/id :component1)
(:id updated-file)
{(:id updated-file) updated-file}
(:id updated-file))
file' (thf/apply-changes updated-file changes2)
copy-child' (ths/get-shape file' :copy-child)
line (get-in copy-child' [:content :children 0 :children 0 :children 0])]
(t/is (contains? (:touched copy-mid) :text-font-group))
(t/is (= :fixed (:grow-type copy-child')))
(t/is (= "32" (:font-size line)))))

View File

@ -130,3 +130,67 @@
copy-child' (ths/get-shape file' :copy-child)]
(t/is (= #{:content-group :text-content-structure} (:touched copy-child')))))
(t/deftest test-text-copy-width-marks-geometry-without-ignore-touched
(let [;; ==== Setup
file (-> (thf/sample-file :file1)
(tho/add-frame-with-text :main-root :main-child "hello world")
(thc/make-component :component1 :main-root)
(thc/instantiate-component :component1 :copy-root {:children-labels [:copy-child]}))
page (thf/current-page file)
copy-child (ths/get-shape file :copy-child)
;; ==== Action — documents set-shape-attr: :width marks :geometry-group
changes (cls/generate-update-shapes (pcb/empty-changes nil (:id page))
#{(:id copy-child)}
(fn [shape]
(assoc shape :width (+ (:width shape) 40)))
(:objects page)
{})
file' (thf/apply-changes file changes)
copy-child' (ths/get-shape file' :copy-child)]
(t/is (contains? (:touched copy-child') :geometry-group))))
(t/deftest test-text-copy-width-with-ignore-touched-skips-geometry
(let [;; ==== Setup
file (-> (thf/sample-file :file1)
(tho/add-frame-with-text :main-root :main-child "hello world")
(thc/make-component :component1 :main-root)
(thc/instantiate-component :component1 :copy-root {:children-labels [:copy-child]}))
page (thf/current-page file)
copy-child (ths/get-shape file :copy-child)
;; ==== Action — contract for content-driven auto-resize commits
changes (cls/generate-update-shapes (pcb/empty-changes nil (:id page))
#{(:id copy-child)}
(fn [shape]
(assoc shape :width (+ (:width shape) 40)))
(:objects page)
{:ignore-touched true})
file' (thf/apply-changes file changes)
copy-child' (ths/get-shape file' :copy-child)]
(t/is (not (contains? (:touched copy-child') :geometry-group)))))
(t/deftest test-text-copy-auto-height-height-with-ignore-touched-skips-geometry
(let [;; ==== Setup
file (-> (thf/sample-file :file1)
(tho/add-frame-with-text :main-root :main-child "hello world"
:child-params {:grow-type :auto-height})
(thc/make-component :component1 :main-root)
(thc/instantiate-component :component1 :copy-root {:children-labels [:copy-child]}))
page (thf/current-page file)
copy-child (ths/get-shape file :copy-child)
changes (cls/generate-update-shapes (pcb/empty-changes nil (:id page))
#{(:id copy-child)}
(fn [shape]
(assoc shape :height (+ (:height shape) 20)))
(:objects page)
{:ignore-touched true})
file' (thf/apply-changes file changes)
copy-child' (ths/get-shape file' :copy-child)]
(t/is (= :auto-height (:grow-type copy-child')))
(t/is (not (contains? (:touched copy-child') :geometry-group)))))

View File

@ -24,7 +24,7 @@
},
"homepage": "https://docs.penpot.app",
"dependencies": {
"@11ty/eleventy": "^3.1.6",
"@11ty/eleventy": "^3.1.8",
"@11ty/eleventy-navigation": "^1.0.5",
"@11ty/eleventy-plugin-rss": "^3.1.0",
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.2",
@ -35,8 +35,8 @@
"eleventy-plugin-nesting-toc": "^1.3.0",
"eleventy-plugin-youtube-embed": "^1.13.2",
"luxon": "^3.7.2",
"markdown-it": "^15.0.2",
"markdown-it-anchor": "^10.0.0",
"markdown-it": "^15.0.3",
"markdown-it-anchor": "^10.1.0",
"markdown-it-plantuml": "^1.4.1"
},
"packageManager": "pnpm@12.21.0+sha512.66fd8278ee28935ce951792d34367ff3af5c432a2756445823029533835b8da529bbe0be5130afd56ed0713fb8789e47bad82d93bd5ae2fe54b15562d6276ef0"

333
docs/pnpm-lock.yaml generated
View File

@ -176,8 +176,8 @@ importers:
.:
dependencies:
'@11ty/eleventy':
specifier: ^3.1.6
version: 3.1.6
specifier: ^3.1.8
version: 3.1.8
'@11ty/eleventy-navigation':
specifier: ^1.0.5
version: 1.0.5
@ -189,7 +189,7 @@ importers:
version: 5.0.2
'@tigersway/eleventy-plugin-ancestry':
specifier: ^1.0.3
version: 1.0.3(@11ty/eleventy@3.1.6)
version: 1.0.3(@11ty/eleventy@3.1.8)
'@types/markdown-it':
specifier: 14.2.0
version: 14.2.0
@ -209,25 +209,29 @@ importers:
specifier: ^3.7.2
version: 3.7.2
markdown-it:
specifier: ^15.0.2
version: 15.0.2
specifier: ^15.0.3
version: 15.0.3
markdown-it-anchor:
specifier: ^10.0.0
version: 10.0.0(@types/markdown-it@14.2.0)(markdown-it@15.0.2)
specifier: ^10.1.0
version: 10.1.0(@types/markdown-it@14.2.0)(markdown-it@15.0.3)
markdown-it-plantuml:
specifier: ^1.4.1
version: 1.4.1
packages:
'@11ty/chokidar-with-glob-support@1.1.1':
resolution: {integrity: sha512-wyugY5VKwQ9OabCBNwa3BLwei54aV36jy8K3O762m/ZVKiczLvnKJN+JYGFL5Ct2faDoBr3Bp0AjNbZpz0xo3A==}
engines: {node: '>=18'}
'@11ty/dependency-tree-esm@2.0.4':
resolution: {integrity: sha512-MYKC0Ac77ILr1HnRJalzKDlb9Z8To3kXQCltx299pUXXUFtJ1RIONtULlknknqW8cLe19DLVgmxVCtjEFm7h0A==}
'@11ty/dependency-tree@4.0.2':
resolution: {integrity: sha512-RTF6VTZHatYf7fSZBUN3RKwiUeJh5dhWV61gDPrHhQF2/gzruAkYz8yXuvGLx3w3ZBKreGrR+MfYpSVkdbdbLA==}
'@11ty/eleventy-dev-server@2.0.8':
resolution: {integrity: sha512-15oC5M1DQlCaOMUq4limKRYmWiGecDaGwryr7fTE/oM9Ix8siqMvWi+I8VjsfrGr+iViDvWcH/TVI6D12d93mA==}
'@11ty/eleventy-dev-server@2.1.2':
resolution: {integrity: sha512-cwReJlQtIZsFuwMhm2fXwwjj+uUVvRkuoESgDtR5Mg9tY2qRj8UbNC8xhYRBuYVpACd3E09CxGPkk/Qj15Zo+A==}
engines: {node: '>=18'}
hasBin: true
@ -252,11 +256,15 @@ packages:
resolution: {integrity: sha512-6QE+duqSQ0GY9rENXYb4iPR4AYGdrFpqnmi59tFp9VrleOl0QSh8VlBr2yd6dlhkdtj7904poZW5PvGr9cMiJQ==}
engines: {node: '>=18'}
'@11ty/eleventy@3.1.6':
resolution: {integrity: sha512-ZlSiR1PLdS2lv7TelBgWAhcvMiLNZkPBlLEb+lh7kGYZ+Mk0bo9qcYgVsewvw9W7Em0RH3wd01h5fAstNDh0zA==}
'@11ty/eleventy@3.1.8':
resolution: {integrity: sha512-nzwVWco4TBETroX7yARBtHlX8P1TWfqHZtQKc5LQ4vyBSbE8dw8lA5gsMWs9VpWqWoLdfnHCLl/r8hT8qOFvwg==}
engines: {node: '>=18'}
hasBin: true
'@11ty/gray-matter@1.0.0':
resolution: {integrity: sha512-7mJJl+wf1AByoT0PknQiQfOPnVNT4fevGrUBVWO4HXsnYn1aQPyRyrELYrNUFleUBM++KzMKN6QaxHPk0t/6/g==}
engines: {node: '>=11'}
'@11ty/lodash-custom@4.17.21':
resolution: {integrity: sha512-Mqt6im1xpb1Ykn3nbcCovWXK3ggywRJa+IXIdoz4wIIK+cvozADH63lexcuPpGS/gJ6/m2JxyyXDyupkMr5DHw==}
engines: {node: '>=14'}
@ -265,8 +273,8 @@ packages:
resolution: {integrity: sha512-1YvhnkaNlFnnJic1rBMWmTC2adbuy+JQiBfl1Hecr1Wjjik1pQZmGyk/eC9zKX/FQv52s2Nht1Gi/UwhYqrBeg==}
engines: {node: '>= 6'}
'@11ty/recursive-copy@4.0.4':
resolution: {integrity: sha512-oI7m8pa7/IAU/3lqRU9vjBbs20iKFo7x+1K9kT3aVira6scc1X9MjBdgLCHzLJeJ7iB6wydioA+kr9/qPnvmlQ==}
'@11ty/recursive-copy@4.0.6':
resolution: {integrity: sha512-+mdqG79jXufZnY0nD/ZWOsT7i8lxqXRtaO0TotpV4fD3qrHlPonEz2izTsbENAlzpsq5+QpwuHnH4RZoalx44g==}
engines: {node: '>=18'}
'@rgrove/parse-xml@4.2.3':
@ -307,18 +315,11 @@ packages:
engines: {node: '>=0.4.0'}
hasBin: true
anymatch@3.1.3:
resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}
engines: {node: '>= 8'}
argparse@1.0.10:
resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
argparse@2.0.1:
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
argparse@3.0.2:
resolution: {integrity: sha512-mFdDM6WqWKraGLsVb+C9CahPnzTXOefAOLq3jYcca2YZ8bEWpr++Tzj+zSaKW9+X9L5uSxcm1AZ3Y6aZJ09OhQ==}
argparse@3.0.4:
resolution: {integrity: sha512-fwWK3Zq22l4XJJjx5mcBHGikIk+hJqO+32dPm0Jur7+rtG5x1scOjSfdT9ZKeWHPpsya/l0HHK4tDImBkTrtvA==}
asap@2.0.6:
resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==}
@ -332,22 +333,14 @@ packages:
bcp-47-normalize@2.3.0:
resolution: {integrity: sha512-8I/wfzqQvttUFz7HVJgIZ7+dj3vUaIyIxYXaTRP1YWoSDfzt6TUmxaKZeuXR62qBmYr+nvuWINFRl6pZ5DlN4Q==}
bcp-47@2.1.1:
resolution: {integrity: sha512-KLw+H/gd2p4zly1X7Yh/qziuyae5/w/QFnvTng9eZL5fvszL7Whl3MBoWF8yxL7ksUjBfOD+OxkytiqbBpG+Fw==}
binary-extensions@2.3.0:
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
engines: {node: '>=8'}
bcp-47@2.1.2:
resolution: {integrity: sha512-wsv86UuNFuPnVieKLyECTT+CP1WSAHeoIg5P3xu2kA9Z+7fVPoKt7dxzSeEhtJel0AI+NW3fIW3KtTKQKUCngg==}
boolbase@1.0.0:
resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==}
brace-expansion@1.1.21:
resolution: {integrity: sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==}
braces@3.0.3:
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
engines: {node: '>=8'}
brace-expansion@1.1.22:
resolution: {integrity: sha512-CKLDTuSsN0+r1ThM0WkzzBI7dnPI6xEGfa/JnVYIK9JNBA1N1NyPwXVHor//NKD/y3sDxp764sZdLhFK7pH8XQ==}
cheerio-select@2.1.0:
resolution: {integrity: sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==}
@ -356,9 +349,9 @@ packages:
resolution: {integrity: sha512-WDrybc/gKFpTYQutKIK6UvfcuxijIZfMfXaYm8NMsPQxSYvf+13fXUJ4rztGGbJcBQ/GF55gvrZ0Bc0bj/mqvg==}
engines: {node: '>=20.18.1'}
chokidar@3.6.0:
resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}
engines: {node: '>= 8.10.0'}
chokidar@4.0.3:
resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==}
engines: {node: '>= 14.16.0'}
commander@10.0.1:
resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==}
@ -445,8 +438,8 @@ packages:
eleventy-plugin-youtube-embed@1.13.2:
resolution: {integrity: sha512-dd5VnphtAvF4lWbZ/Z5kXnkcGLVYTUIYtBsbOTNQ5PfU+dZ/qRgsXvtzaH4+/txBbcsSm9AtRi5mtYHgD2WNPA==}
encodeurl@2.0.0:
resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==}
encodeurl@2.0.3:
resolution: {integrity: sha512-mIteYONiEfc4xWf2F1WXovh1c8npzS00vNeiUPdwFF+QlVJni+gNvpQltLMQhob8rew/bWWc/bGTuUr0EUGt0w==}
engines: {node: '>= 0.8'}
encoding-sniffer@0.2.1:
@ -489,11 +482,6 @@ packages:
esm-import-transformer@3.0.5:
resolution: {integrity: sha512-1GKLvfuMnnpI75l8c6sHoz0L3Z872xL5akGuBudgqTDPv4Vy6f2Ec7jEMKTxlqWl/3kSvNbHELeimJtnqgYniw==}
esprima@4.0.1:
resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==}
engines: {node: '>=4'}
hasBin: true
etag@1.8.1:
resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==}
engines: {node: '>= 0.6'}
@ -522,10 +510,6 @@ packages:
resolution: {integrity: sha512-sJslQKU2uM33qH5nqewAwVB2QgR6w1aMNsYUp3aN5rMRyXEwJGmZvaWzeJFNTOXWlHQyBFCWrdj3fV/fsTOX8w==}
engines: {node: '>= 10.4.0'}
fill-range@7.1.1:
resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
engines: {node: '>=8'}
finalhandler@1.3.2:
resolution: {integrity: sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==}
engines: {node: '>= 0.8'}
@ -537,22 +521,9 @@ packages:
resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==}
engines: {node: '>= 0.8'}
fsevents@2.3.3:
resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin]
get-tag@0.1.10:
resolution: {integrity: sha512-WizKzwUyC0hopc1JcXj6oP/Iq402XWbxaDJdz2ON/uW4ae66XTIAAULryeCLnozRXGsqc7/EQJKnhHcs26S/aw==}
glob-parent@5.1.2:
resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
engines: {node: '>= 6'}
gray-matter@4.0.3:
resolution: {integrity: sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==}
engines: {node: '>=6.0'}
htmlparser2@10.1.0:
resolution: {integrity: sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==}
@ -580,10 +551,6 @@ packages:
is-alphanumerical@2.0.1:
resolution: {integrity: sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==}
is-binary-path@2.1.0:
resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
engines: {node: '>=8'}
is-decimal@2.0.1:
resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==}
@ -591,29 +558,13 @@ packages:
resolution: {integrity: sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==}
engines: {node: '>=0.10.0'}
is-extglob@2.1.1:
resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
engines: {node: '>=0.10.0'}
is-glob@4.0.3:
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
engines: {node: '>=0.10.0'}
is-json@2.0.1:
resolution: {integrity: sha512-6BEnpVn1rcf3ngfmViLM6vjUjGErbdrL4rwlv+u1NO1XO8kqT4YGL8+19Q+Z/bas8tY90BTWMk2+fW1g6hQjbA==}
is-number@7.0.0:
resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}
engines: {node: '>=0.12.0'}
iso-639-1@3.1.6:
resolution: {integrity: sha512-ZFar/L4ngX7wZh2QX+Fiftmuf0igWJsrJtfizrovWifF1gAWkfmRa5Z1m0LQZbm0hKCHRDYhLRSLFrSqNe4EJA==}
engines: {node: '>=6.0'}
js-yaml@3.15.2:
resolution: {integrity: sha512-6EuL879VkRA+1Cz578mKMiKvjPNEuk6+r1JaFzoSWejZmtf7xWbIyw1e3KkxlkzTIt9Taw6JBhEppG7utc1P+w==}
hasBin: true
js-yaml@4.3.2:
resolution: {integrity: sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==}
hasBin: true
@ -636,8 +587,8 @@ packages:
linkify-it@6.1.0:
resolution: {integrity: sha512-wJ/TwpSDTLepCrQoYWYIExIKg5Zchex2Nn5yk2mFnB+6PtdkHtyLx742md9csRjjOnGkKIS/RrbY7l8D6gT9Vw==}
liquidjs@10.30.0:
resolution: {integrity: sha512-Fw4wA+8CZsJkaeLEIlPE3AoponfjEZhj7FQvYNcAEcg7jNRik7mEMoaco382FBdrYlykVf6w4vClPNctz2OYjg==}
liquidjs@10.30.1:
resolution: {integrity: sha512-P1Iz14WUHZdfbOYwHOIhtl/iAWIOYk1ks5l9rPZlDM6vZo+6BLeYIuWHAPkIz+U8Mm8HKZKITIrjX7DQJO2fqA==}
engines: {node: '>=16'}
hasBin: true
@ -651,21 +602,24 @@ packages:
resolution: {integrity: sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==}
engines: {node: '>=12'}
markdown-it-anchor@10.0.0:
resolution: {integrity: sha512-Q8g7Z6OBdH3eXF0lujFqukIxUvgCDZcjzCrJxmD6QiEzU1HWR9fVN+Bf6gxmM+0yrPFs+jUw8gNjLmUQqt6Eew==}
markdown-it-anchor@10.1.0:
resolution: {integrity: sha512-htMTOUnoGqoWguddWO+NBrOEdh3dt9k1RIhTlr2CQTJOPiLZglDDGADu+Ch+47roTO6nxl2aJfSYykmOhdJCew==}
peerDependencies:
'@types/markdown-it': '*'
markdown-it: '*'
peerDependenciesMeta:
'@types/markdown-it':
optional: true
markdown-it-plantuml@1.4.1:
resolution: {integrity: sha512-13KgnZaGYTHBp4iUmGofzZSBz+Zj6cyqfR0SXUIc9wgWTto5Xhn7NjaXYxY0z7uBeTUMlc9LMQq5uP4OM5xCHg==}
markdown-it@14.3.2:
resolution: {integrity: sha512-sHHjZ5fJKlgrG4qns2YwVcdNep35h5fERrfkD2YNsb9UFk0UIHarbiTaHKVMlPuWAoiilyK8Fv/jAm11slsY7Q==}
markdown-it@14.3.3:
resolution: {integrity: sha512-L//tDAkjTjJCU6pBUSBTgs3Kg4InVaZuUZog/b6V12UKhcDQ7S78877ibbCanRExwPuYP1CZD7Gd2dxSy1GXRg==}
hasBin: true
markdown-it@15.0.2:
resolution: {integrity: sha512-q4IGxMv56jCqT4OCRCADBoDP3LO4MhmTXjFbphHPXs4g3j9Xg5RDnxqN8IF/3vIWEU+VCnUq+7JUg/cfy2E6Qw==}
markdown-it@15.0.3:
resolution: {integrity: sha512-+Az7Ojz3iRGu8KYMvJ6xVhvrxP3eE+vEtJX75Ow88XBpcQNV/0lGX5ZynIIBftREo4DC2jsveAMDaeltmm8QvQ==}
hasBin: true
mdurl@2.1.0:
@ -687,9 +641,6 @@ packages:
engines: {node: '>=10.0.0'}
hasBin: true
minimatch@3.1.5:
resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==}
minimist@1.2.8:
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
@ -733,8 +684,8 @@ packages:
resolution: {integrity: sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==}
engines: {node: '>=12.20.0'}
on-finished@2.4.1:
resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==}
on-finished@2.4.2:
resolution: {integrity: sha512-ATWUv387i+nLD49EiDoOft5scf32Vsdz3ktrQJG9bi7jRFmaXTssvyvj1EmeKVVgvesbqUtvQQvaS2TpTukAZQ==}
engines: {node: '>= 0.8'}
p-finally@1.0.0:
@ -765,10 +716,6 @@ packages:
resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==}
engines: {node: '>= 0.8'}
picomatch@2.3.2:
resolution: {integrity: sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==}
engines: {node: '>=8.6'}
picomatch@4.0.7:
resolution: {integrity: sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==}
engines: {node: '>=12'}
@ -809,9 +756,9 @@ packages:
resolution: {integrity: sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==}
engines: {node: '>= 0.6'}
readdirp@3.6.0:
resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
engines: {node: '>=8.10.0'}
readdirp@4.1.2:
resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==}
engines: {node: '>= 14.18.0'}
safer-buffer@2.1.2:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
@ -823,8 +770,8 @@ packages:
semver-compare@1.0.0:
resolution: {integrity: sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==}
semver@7.8.5:
resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==}
semver@7.8.6:
resolution: {integrity: sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==}
engines: {node: '>=10'}
hasBin: true
@ -843,9 +790,6 @@ packages:
resolution: {integrity: sha512-vZ7rfeehZui7wQs438JXBckYLkIIdfHOXsaVEUMyS5fHo1483l1bMdo0EDSWYclY0yZKFOipDy4KHuKs6ssvdg==}
engines: {node: '>=8.0.0'}
sprintf-js@1.0.3:
resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==}
ssri@11.0.0:
resolution: {integrity: sha512-aZpUoMN/Jj2MqA4vMCeiKGnc/8SuSyHbGSBdgFbZxP8OJGF/lFkIuElzPxsN0q8TQQ+prw3P4EDfB3TBHHgfXw==}
engines: {node: ^16.14.0 || >=18.0.0}
@ -866,10 +810,6 @@ packages:
resolution: {integrity: sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==}
engines: {node: '>=12.0.0'}
to-regex-range@5.0.1:
resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}
engines: {node: '>=8.0'}
toidentifier@1.0.1:
resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==}
engines: {node: '>=0.6'}
@ -900,8 +840,8 @@ packages:
resolution: {integrity: sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==}
engines: {node: '>=18'}
ws@8.22.0:
resolution: {integrity: sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==}
ws@8.23.0:
resolution: {integrity: sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
@ -914,6 +854,11 @@ packages:
snapshots:
'@11ty/chokidar-with-glob-support@1.1.1':
dependencies:
chokidar: 4.0.3
picomatch: 4.0.7
'@11ty/dependency-tree-esm@2.0.4':
dependencies:
'@11ty/eleventy-utils': 2.0.7
@ -925,10 +870,10 @@ snapshots:
dependencies:
'@11ty/eleventy-utils': 2.0.7
'@11ty/eleventy-dev-server@2.0.8':
'@11ty/eleventy-dev-server@2.1.2':
dependencies:
'@11ty/chokidar-with-glob-support': 1.1.1
'@11ty/eleventy-utils': 2.0.7
chokidar: 3.6.0
debug: 4.4.3
finalhandler: 1.3.2
mime: 3.0.0
@ -938,7 +883,7 @@ snapshots:
send: 1.2.1
ssri: 11.0.0
urlpattern-polyfill: 10.1.0
ws: 8.22.0
ws: 8.23.0
transitivePeerDependencies:
- bufferutil
- supports-color
@ -980,46 +925,54 @@ snapshots:
'@11ty/eleventy-utils@2.0.7': {}
'@11ty/eleventy@3.1.6':
'@11ty/eleventy@3.1.8':
dependencies:
'@11ty/chokidar-with-glob-support': 1.1.1
'@11ty/dependency-tree': 4.0.2
'@11ty/dependency-tree-esm': 2.0.4
'@11ty/eleventy-dev-server': 2.0.8
'@11ty/eleventy-dev-server': 2.1.2
'@11ty/eleventy-plugin-bundle': 3.0.7(posthtml@0.16.7)
'@11ty/eleventy-utils': 2.0.7
'@11ty/lodash-custom': 4.17.21
'@11ty/posthtml-urls': 1.0.3
'@11ty/recursive-copy': 4.0.4
'@11ty/recursive-copy': 4.0.6
'@sindresorhus/slugify': 2.2.1
bcp-47-normalize: 2.3.0
chokidar: 3.6.0
debug: 4.4.3
dependency-graph: 1.0.0
entities: 6.0.1
filesize: 10.1.6
gray-matter: 4.0.3
gray-matter: '@11ty/gray-matter@1.0.0'
iso-639-1: 3.1.6
js-yaml: 4.3.2
kleur: 4.1.5
liquidjs: 10.30.0
liquidjs: 10.30.1
luxon: 3.7.2
markdown-it: 14.3.2
markdown-it: 14.3.3
minimist: 1.2.8
moo: 0.5.2
node-retrieve-globals: 6.0.1
nunjucks: 3.2.4(chokidar@3.6.0)
nunjucks: 3.2.4
picomatch: 4.0.7
please-upgrade-node: 3.2.0
posthtml: 0.16.7
posthtml-match-helper: 2.0.3(posthtml@0.16.7)
semver: 7.8.5
semver: 7.8.6
slugify: 1.6.9
tinyglobby: 0.2.17
transitivePeerDependencies:
- bufferutil
- chokidar
- supports-color
- utf-8-validate
'@11ty/gray-matter@1.0.0':
dependencies:
js-yaml: 4.3.2
kind-of: 6.0.3
section-matter: 1.0.0
strip-bom-string: 1.0.0
'@11ty/lodash-custom@4.17.21': {}
'@11ty/posthtml-urls@1.0.3':
@ -1029,11 +982,11 @@ snapshots:
list-to-array: 1.1.0
parse-srcset: 1.0.2
'@11ty/recursive-copy@4.0.4':
'@11ty/recursive-copy@4.0.6':
dependencies:
brace-expansion: 1.1.22
errno: 1.0.0
junk: 3.1.0
minimatch: 3.1.5
slash: 3.0.0
'@rgrove/parse-xml@4.2.3': {}
@ -1047,9 +1000,9 @@ snapshots:
dependencies:
escape-string-regexp: 5.0.0
'@tigersway/eleventy-plugin-ancestry@1.0.3(@11ty/eleventy@3.1.6)':
'@tigersway/eleventy-plugin-ancestry@1.0.3(@11ty/eleventy@3.1.8)':
dependencies:
'@11ty/eleventy': 3.1.6
'@11ty/eleventy': 3.1.8
'@types/linkify-it@5.0.0': {}
@ -1068,18 +1021,9 @@ snapshots:
acorn@8.19.0: {}
anymatch@3.1.3:
dependencies:
normalize-path: 3.0.0
picomatch: 2.3.2
argparse@1.0.10:
dependencies:
sprintf-js: 1.0.3
argparse@2.0.1: {}
argparse@3.0.2: {}
argparse@3.0.4: {}
asap@2.0.6: {}
@ -1089,28 +1033,22 @@ snapshots:
bcp-47-normalize@2.3.0:
dependencies:
bcp-47: 2.1.1
bcp-47: 2.1.2
bcp-47-match: 2.0.3
bcp-47@2.1.1:
bcp-47@2.1.2:
dependencies:
is-alphabetical: 2.0.1
is-alphanumerical: 2.0.1
is-decimal: 2.0.1
binary-extensions@2.3.0: {}
boolbase@1.0.0: {}
brace-expansion@1.1.21:
brace-expansion@1.1.22:
dependencies:
balanced-match: 1.0.2
concat-map: 0.0.1
braces@3.0.3:
dependencies:
fill-range: 7.1.1
cheerio-select@2.1.0:
dependencies:
boolbase: 1.0.0
@ -1134,17 +1072,9 @@ snapshots:
undici: 7.30.0
whatwg-mimetype: 4.0.0
chokidar@3.6.0:
chokidar@4.0.3:
dependencies:
anymatch: 3.1.3
braces: 3.0.3
glob-parent: 5.1.2
is-binary-path: 2.1.0
is-glob: 4.0.3
normalize-path: 3.0.0
readdirp: 3.6.0
optionalDependencies:
fsevents: 2.3.3
readdirp: 4.1.2
commander@10.0.1: {}
@ -1216,10 +1146,11 @@ snapshots:
eleventy-plugin-metagen@1.8.5:
dependencies:
'@11ty/eleventy': 3.1.6
'@11ty/eleventy': 3.1.8
meta-generator: 0.1.6
transitivePeerDependencies:
- bufferutil
- chokidar
- supports-color
- utf-8-validate
@ -1236,7 +1167,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
encodeurl@2.0.0: {}
encodeurl@2.0.3: {}
encoding-sniffer@0.2.1:
dependencies:
@ -1267,8 +1198,6 @@ snapshots:
dependencies:
acorn: 8.19.0
esprima@4.0.1: {}
etag@1.8.1: {}
evaluate-value@2.0.0: {}
@ -1285,16 +1214,12 @@ snapshots:
filesize@10.1.6: {}
fill-range@7.1.1:
dependencies:
to-regex-range: 5.0.1
finalhandler@1.3.2:
dependencies:
debug: 2.6.9
encodeurl: 2.0.0
encodeurl: 2.0.3
escape-html: 1.0.3
on-finished: 2.4.1
on-finished: 2.4.2
parseurl: 1.3.3
statuses: 2.0.2
unpipe: 1.0.0
@ -1305,22 +1230,8 @@ snapshots:
fresh@2.0.0: {}
fsevents@2.3.3:
optional: true
get-tag@0.1.10: {}
glob-parent@5.1.2:
dependencies:
is-glob: 4.0.3
gray-matter@4.0.3:
dependencies:
js-yaml: 3.15.2
kind-of: 6.0.3
section-matter: 1.0.0
strip-bom-string: 1.0.0
htmlparser2@10.1.0:
dependencies:
domelementtype: 2.3.0
@ -1358,31 +1269,14 @@ snapshots:
is-alphabetical: 2.0.1
is-decimal: 2.0.1
is-binary-path@2.1.0:
dependencies:
binary-extensions: 2.3.0
is-decimal@2.0.1: {}
is-extendable@0.1.1: {}
is-extglob@2.1.1: {}
is-glob@4.0.3:
dependencies:
is-extglob: 2.1.1
is-json@2.0.1: {}
is-number@7.0.0: {}
iso-639-1@3.1.6: {}
js-yaml@3.15.2:
dependencies:
argparse: 1.0.10
esprima: 4.0.1
js-yaml@4.3.2:
dependencies:
argparse: 2.0.1
@ -1401,7 +1295,7 @@ snapshots:
dependencies:
uc.micro: 3.0.0
liquidjs@10.30.0:
liquidjs@10.30.1:
dependencies:
commander: 10.0.1
@ -1411,14 +1305,15 @@ snapshots:
luxon@3.7.2: {}
markdown-it-anchor@10.0.0(@types/markdown-it@14.2.0)(markdown-it@15.0.2):
markdown-it-anchor@10.1.0(@types/markdown-it@14.2.0)(markdown-it@15.0.3):
dependencies:
markdown-it: 15.0.3
optionalDependencies:
'@types/markdown-it': 14.2.0
markdown-it: 15.0.2
markdown-it-plantuml@1.4.1: {}
markdown-it@14.3.2:
markdown-it@14.3.3:
dependencies:
argparse: 2.0.1
entities: 4.5.0
@ -1427,9 +1322,9 @@ snapshots:
punycode.js: 2.3.1
uc.micro: 2.1.0
markdown-it@15.0.2:
markdown-it@15.0.3:
dependencies:
argparse: 3.0.2
argparse: 3.0.4
entities: 8.1.0
linkify-it: 6.1.0
mdurl: 2.1.0
@ -1450,10 +1345,6 @@ snapshots:
mime@3.0.0: {}
minimatch@3.1.5:
dependencies:
brace-expansion: 1.1.21
minimist@1.2.8: {}
minipass@7.1.3: {}
@ -1478,17 +1369,15 @@ snapshots:
dependencies:
boolbase: 1.0.0
nunjucks@3.2.4(chokidar@3.6.0):
nunjucks@3.2.4:
dependencies:
a-sync-waterfall: 1.0.1
asap: 2.0.6
commander: 5.1.0
optionalDependencies:
chokidar: 3.6.0
obug@3.0.0: {}
on-finished@2.4.1:
on-finished@2.4.2:
dependencies:
ee-first: 1.1.1
@ -1520,8 +1409,6 @@ snapshots:
parseurl@1.3.3: {}
picomatch@2.3.2: {}
picomatch@4.0.7: {}
please-upgrade-node@3.2.0:
@ -1553,9 +1440,7 @@ snapshots:
range-parser@1.3.0: {}
readdirp@3.6.0:
dependencies:
picomatch: 2.3.2
readdirp@4.1.2: {}
safer-buffer@2.1.2: {}
@ -1566,19 +1451,19 @@ snapshots:
semver-compare@1.0.0: {}
semver@7.8.5: {}
semver@7.8.6: {}
send@1.2.1:
dependencies:
debug: 4.4.3
encodeurl: 2.0.0
encodeurl: 2.0.3
escape-html: 1.0.3
etag: 1.8.1
fresh: 2.0.0
http-errors: 2.0.1
mime-types: 3.0.2
ms: 2.1.3
on-finished: 2.4.1
on-finished: 2.4.2
range-parser: 1.3.0
statuses: 2.0.2
transitivePeerDependencies:
@ -1590,8 +1475,6 @@ snapshots:
slugify@1.6.9: {}
sprintf-js@1.0.3: {}
ssri@11.0.0:
dependencies:
minipass: 7.1.3
@ -1607,10 +1490,6 @@ snapshots:
fdir: 6.5.0(picomatch@4.0.7)
picomatch: 4.0.7
to-regex-range@5.0.1:
dependencies:
is-number: 7.0.0
toidentifier@1.0.1: {}
uc.micro@2.1.0: {}
@ -1629,4 +1508,4 @@ snapshots:
whatwg-mimetype@4.0.0: {}
ws@8.22.0: {}
ws@8.23.0: {}

View File

@ -18,15 +18,15 @@
"generic-pool": "^3.9.0",
"inflation": "^2.1.0",
"ioredis": "^6.0.0",
"playwright": "1.63.0",
"playwright": "1.65.1",
"raw-body": "^4.0.0",
"source-map-support": "^0.5.21",
"undici": "^8.12.3",
"undici": "^8.12.4",
"xml-js": "^1.6.11",
"xregexp": "^5.1.3"
},
"devDependencies": {
"ws": "^8.22.0"
"ws": "^8.23.0"
},
"scripts": {
"clear:shadow-cache": "rm -rf .shadow-cljs && rm -rf target",

View File

@ -175,6 +175,7 @@ overrides:
lodash@<=4.17.23: ^4.17.24
lodash@>=4.0.0 <=4.17.22: ^4.17.23
lodash@>=4.0.0 <=4.17.23: ^4.17.24
minimatch@>=7.0.0 <11.0.1: ^11.0.1
playwright@>=1.61.1 <2.0.0-0: 1.62.1
importers:
@ -212,8 +213,8 @@ importers:
specifier: ^0.5.21
version: 0.5.21
undici:
specifier: ^8.12.3
version: 8.12.3
specifier: ^8.12.4
version: 8.12.4
xml-js:
specifier: ^1.6.11
version: 1.6.11
@ -222,8 +223,8 @@ importers:
version: 5.1.3
devDependencies:
ws:
specifier: ^8.22.0
version: 8.22.0
specifier: ^8.23.0
version: 8.23.0
packages:
@ -234,6 +235,9 @@ packages:
'@ioredis/commands@2.0.0':
resolution: {integrity: sha512-vrx0AE/T0h7cRZwfo1M39Cr+ZhZrkf0V8mQN75wucKCxCLD9l/VX6no3gFvrLqD1IlG/1LtzWovqEw3t0Vr9zg==}
'@isaacs/nonrecursive-glob-match@1.1.0':
resolution: {integrity: sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==}
'@penpot/svgo@https://codeload.github.com/penpot/svgo/tar.gz/65b3a645df9edbe3c00acf4267dd06c2ca736021':
resolution: {gitHosted: true, integrity: sha512-hG/pgVEWhmHEFMU+evGZkB5kHauff5Zo6ZO+Ro7HY0efsQTJft6svM4isH5jDISeSVrZ1CDGnhWBXuqkztsTWw==, tarball: https://codeload.github.com/penpot/svgo/tar.gz/65b3a645df9edbe3c00acf4267dd06c2ca736021}
version: 3.3.0
@ -475,9 +479,9 @@ packages:
mdn-data@2.27.1:
resolution: {integrity: sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==}
minimatch@10.2.6:
resolution: {integrity: sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==}
engines: {node: 18 || 20 || >=22}
minimatch@11.0.9:
resolution: {integrity: sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q==}
engines: {node: 20 || >=22}
ms@2.1.3:
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
@ -583,15 +587,15 @@ packages:
resolution: {integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==}
engines: {node: '>=0.6.x'}
undici@8.12.3:
resolution: {integrity: sha512-+fdndUTwBP86cVjihTp21hZHo7d6oj1c/47XPA3lL8mM0XHs+C4EkcjmgRsFnFk2f/UONGDy9ItBItmXsLOQHw==}
undici@8.12.4:
resolution: {integrity: sha512-8Mx+uNKKER2bA4AdtedkqRbwUCIJFr2nJckXRe5yrDqzePqwLP7VNcctN8/XdmDSbF7mS+jJKIszlL+vbam1VA==}
engines: {node: '>=22.19.0'}
util-deprecate@1.0.2:
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
ws@8.22.0:
resolution: {integrity: sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==}
ws@8.23.0:
resolution: {integrity: sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
@ -621,6 +625,8 @@ snapshots:
'@ioredis/commands@2.0.0': {}
'@isaacs/nonrecursive-glob-match@1.1.0': {}
'@penpot/svgo@https://codeload.github.com/penpot/svgo/tar.gz/65b3a645df9edbe3c00acf4267dd06c2ca736021':
dependencies:
css-select: 7.0.0
@ -843,8 +849,9 @@ snapshots:
mdn-data@2.27.1: {}
minimatch@10.2.6:
minimatch@11.0.9:
dependencies:
'@isaacs/nonrecursive-glob-match': 1.1.0
brace-expansion: 5.0.12
ms@2.1.3: {}
@ -892,7 +899,7 @@ snapshots:
readdir-glob@3.0.0:
dependencies:
minimatch: 10.2.6
minimatch: 11.0.9
redis-errors@1.2.0: {}
@ -962,11 +969,11 @@ snapshots:
tsscmp@1.0.6: {}
undici@8.12.3: {}
undici@8.12.4: {}
util-deprecate@1.0.2: {}
ws@8.22.0: {}
ws@8.23.0: {}
xml-js@1.6.11:
dependencies:

View File

@ -11,4 +11,5 @@ overrides:
lodash@<=4.17.23: ^4.17.24
lodash@>=4.0.0 <=4.17.22: ^4.17.23
lodash@>=4.0.0 <=4.17.23: ^4.17.24
minimatch@>=7.0.0 <11.0.1: ^11.0.1
playwright@>=1.61.1 <2.0.0-0: "1.62.1"

View File

@ -4,7 +4,7 @@
penpot/common
{:local/root "../common"}
org.clojure/clojure {:mvn/version "1.12.6"}
org.clojure/clojure {:mvn/version "1.12.7"}
binaryage/devtools {:mvn/version "RELEASE"}
metosin/reitit-core {:mvn/version "0.11.0"}
funcool/okulary {:mvn/version "2022.04.11-16"}

View File

@ -63,76 +63,76 @@
"@penpot/svgo": "penpot/svgo#3.3.0",
"@penpot/text-editor": "link:text-editor",
"@penpot/ua-parser": "penpot/ua-parser#1.0.0",
"@playwright/test": "1.63.0",
"@storybook/addon-docs": "10.6.1",
"@storybook/addon-themes": "10.6.1",
"@storybook/addon-vitest": "10.6.1",
"@storybook/react-vite": "10.6.1",
"@playwright/test": "1.65.1",
"@storybook/addon-docs": "10.6.7",
"@storybook/addon-themes": "10.6.7",
"@storybook/addon-vitest": "10.6.7",
"@storybook/react-vite": "10.6.7",
"@tokens-studio/sd-transforms": "2.0.3",
"@types/node": "^26.6.4",
"@vitest/browser": "5.0.3",
"@vitest/browser-playwright": "5.0.3",
"@vitest/coverage-v8": "5.0.3",
"@vitest/istanbul-lib-coverage": "1.0.2",
"@vitest/istanbul-lib-report": "1.0.2",
"@types/node": "^26.6.6",
"@vitest/browser": "5.1.1",
"@vitest/browser-playwright": "5.1.1",
"@vitest/coverage-v8": "5.1.1",
"@vitest/istanbul-lib-coverage": "2.1.1",
"@vitest/istanbul-lib-report": "2.1.1",
"@zip.js/zip.js": "2.8.34",
"acorn": "8.19.0",
"ast-v8-to-istanbul": "1.0.7",
"autoprefixer": "^10.6.1",
"ast-v8-to-istanbul": "1.0.8",
"autoprefixer": "^10.6.2",
"compression": "^1.8.2",
"concurrently": "^10.0.5",
"concurrently": "^10.0.7",
"date-fns": "^4.4.0",
"esbuild": "^0.28.2",
"eventsource-parser": "^4.1.1",
"express": "^5.2.1",
"eventsource-parser": "^4.1.3",
"express": "^5.3.0",
"fancy-log": "^2.0.0",
"getopts": "^2.3.0",
"gettext-parser": "^9.1.1",
"gettext-parser": "^10.0.0",
"highlight.js": "^11.12.0",
"js-beautify": "^2.0.3",
"jsdom": "^30.1.2",
"jsdom": "^31.0.1",
"lodash": "^4.18.1",
"lodash.debounce": "^4.0.8",
"map-stream": "0.0.7",
"marked": "^18.1.0",
"marked": "^18.2.1",
"mkdirp": "^3.0.1",
"mustache": "^4.2.0",
"nodemon": "^3.1.14",
"npm-run-all": "^4.1.5",
"opentype.js": "^2.0.0",
"p-limit": "^7.3.3",
"playwright": "1.63.0",
"postcss": "^8.5.29",
"playwright": "1.65.1",
"postcss": "^8.5.33",
"postcss-clean": "^1.2.2",
"postcss-modules": "^9.0.1",
"postcss-modules": "^9.1.2",
"postcss-scss": "^4.0.9",
"prettier": "3.9.9",
"prettier": "3.10.1",
"pretty-time": "^1.1.0",
"prop-types": "^15.8.1",
"randomcolor": "^0.6.2",
"react": "19.3.0",
"react-dom": "19.3.0",
"react": "19.3.1",
"react-dom": "19.3.1",
"react-error-boundary": "^6.1.6",
"react-virtualized": "^9.22.6",
"rimraf": "^6.1.3",
"rimraf": "^6.1.4",
"rxjs": "8.0.0-alpha.14",
"sass": "^1.105.1",
"sass-embedded": "^1.105.1",
"sass": "^1.108.2",
"sass-embedded": "^1.108.2",
"sax": "^1.6.1",
"scheduler": "^0.28.0",
"source-map-support": "^0.5.21",
"storybook": "10.6.1",
"style-dictionary": "5.5.5",
"stylelint": "^17.16.0",
"stylelint-config-standard-scss": "^17.0.0",
"stylelint-plugin-logical-css": "^2.1.0",
"stylelint-scss": "^7.3.0",
"storybook": "10.6.7",
"style-dictionary": "5.8.0",
"stylelint": "^18.0.0",
"stylelint-config-standard-scss": "^18.0.0",
"stylelint-plugin-logical-css": "^2.1.1",
"stylelint-scss": "^7.5.0",
"svg-sprite": "^2.0.4",
"tdigest": "^0.1.3",
"tinycolor2": "^1.6.0",
"typescript": "^6.0.3",
"vite": "^8.3.3",
"vitest": "^5.0.3",
"vite": "^8.3.8",
"vitest": "^5.1.1",
"wait-on": "^9.5.1",
"watcher": "^2.3.1",
"workerpool": "^10.0.3",
@ -140,6 +140,6 @@
},
"dependencies": {
"@penpot/ui": "link:packages/ui",
"react-aria-components": "^1.21.1"
"react-aria-components": "^1.22.1"
}
}

View File

@ -24,22 +24,22 @@
"test": "vitest run --config vite.config.mts"
},
"devDependencies": {
"@babel/core": "^8.0.6",
"@babel/core": "^8.1.2",
"@babel/preset-react": "^8.0.1",
"@storybook/react": "10.6.1",
"@storybook/react-vite": "10.6.1",
"@storybook/react": "10.6.7",
"@storybook/react-vite": "10.6.7",
"@testing-library/dom": "10.4.2",
"@testing-library/react": "16.3.3",
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.1.2",
"@vitejs/plugin-react": "^6.3.0",
"babel-plugin-react-compiler": "^1.0.0",
"react-compiler-runtime": "^1.0.0",
"storybook": "10.6.1",
"storybook": "10.6.7",
"vite-plugin-dts": "^5.1.2"
},
"dependencies": {
"react-aria-components": "^1.20.0"
"react-aria-components": "^1.22.1"
},
"peerDependencies": {
"react": ">=19.2",

3198
frontend/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -38,3 +38,5 @@ overrides:
postcss@<=8.5.17: ^8.5.18
postcss@<=8.5.22: ^8.5.23
shell-quote@>=1.8.4 <1.11.0: ^1.11.0
glob@>=9.0.0 <=14.0.1: ^14.0.2
minimatch@>=7.0.0 <11.0.1: ^11.0.1

View File

@ -0,0 +1,32 @@
/**
* Early registry for host-facing frontend audit event callbacks.
*
* Loaded before config.js so SaaS / local config can call
* `penpotAddEventCallback(name, fn)` at parse time. The ClojureScript
* app reads `penpotEventCallbacks` when prepared audit events fire and
* leaves a host-provided `penpotAddEventCallback` alone when present.
*/
(function (g) {
"use strict";
if (!(g.penpotEventCallbacks instanceof Map)) {
g.penpotEventCallbacks = new Map();
}
if (typeof g.penpotAddEventCallback !== "function") {
g.penpotAddEventCallback = function (name, callback) {
var m = g.penpotEventCallbacks;
var entry = m.get(name);
if (entry == null) {
m.set(name, [callback]);
} else if (Array.isArray(entry)) {
entry.push(callback);
} else if (typeof entry === "function") {
m.set(name, [entry, callback]);
} else {
m.set(name, [callback]);
}
};
}
})(globalThis);

View File

@ -41,6 +41,7 @@
</script>
{{# manifest}}
<script src="{{& event_callbacks}}"></script>
<script src="{{& config}}"></script>
<script src="{{& polyfills}}"></script>
{{/manifest}}

View File

@ -223,6 +223,7 @@ async function generateManifest() {
render_main: "./js/render.js",
rasterizer_main: "./js/rasterizer.js",
event_callbacks: "./js/event-callbacks.js?version=" + VERSION_TAG,
config: "./js/config.js?version=" + VERSION_TAG,
config_render: "./js/config-render.js?version=" + VERSION_TAG,
polyfills: "./js/polyfills.js?version=" + VERSION_TAG,
@ -658,6 +659,13 @@ export async function compilePolyfills() {
await fs.mkdir("./resources/public/js", { recursive: true });
fs.writeFile("resources/public/js/polyfills.js", result.join("\n"));
// Host event-callback registry must load before config.js (see
// index.mustache). Keep the public copy in sync with the source file.
await fs.copyFile(
"resources/js/event-callbacks.js",
"resources/public/js/event-callbacks.js",
);
const end = process.hrtime(start);
log.info("done: compile polyfills", `(${ppt(end)})`);
}

View File

@ -243,6 +243,65 @@
(let [f (obj/get global "initializeExternalConfigInfo")]
(when (fn? f) (f))))
(defn- get-or-create-event-callbacks-map
"Return the host-facing Map of event-name → callback(s), creating it
on globalThis when absent."
[]
(let [existing (obj/get global "penpotEventCallbacks")]
(if (instance? js/Map existing)
existing
(let [m (js/Map.)]
(obj/set! global "penpotEventCallbacks" m)
m))))
(defn add-event-callback
"Register a callback for a named frontend audit event.
Hosts (config.js / SaaS shell) call this as
`globalThis.penpotAddEventCallback(name, fn)`. Multiple callbacks per
name are kept in registration order."
[event-name callback]
(let [m (get-or-create-event-callbacks-map)
entry (.get m event-name)]
(cond
(nil? entry)
(.set m event-name #js [callback])
(array? entry)
(.push entry callback)
(fn? entry)
(.set m event-name #js [entry callback])
:else
(.set m event-name #js [callback]))
nil))
(defn get-event-callbacks
"Return the callbacks registered for `event-name`, or nil.
Accepts a single function or a JS array of functions under that name
on `globalThis.penpotEventCallbacks`."
[event-name]
(let [m (obj/get global "penpotEventCallbacks")]
(when (instance? js/Map m)
(let [entry (.get m event-name)]
(cond
(fn? entry)
[entry]
(array? entry)
(array-seq entry)
:else
nil)))))
;; Fallback install when the early `js/event-callbacks.js` stub (loaded
;; before config.js) is missing. Leave a host- or stub-provided function
;; alone so registrations from config.js stay on the same Map.
(when-not (fn? (obj/get global "penpotAddEventCallback"))
(obj/set! global "penpotAddEventCallback" add-event-callback))
(def mcp-server-url (-> public-uri u/ensure-path-slash (u/join "mcp/stream") str))
(def mcp-help-center-uri "https://help.penpot.app/mcp/")

View File

@ -267,6 +267,19 @@
[state file-id]
(:vern (dsh/lookup-file state file-id)))
(defn- get-stacked-undo-group
"The undo group of the history entry that a `stack-undo?` commit is
added to: the entry at the current undo index, unless an open undo
transaction already holds changes (then the commit joins the
transaction instead). Mirrors `app.main.data.workspace.undo/append-undo`."
[state]
(let [{:keys [items index transaction]} (:workspace-undo state)]
(when (and (empty? (:undo-changes transaction))
(empty? (:redo-changes transaction))
(some? index)
(>= index 0))
(dm/get-in items [index :undo-group]))))
(defn commit-changes
"Schedules a list of changes to execute now, and add the corresponding undo changes to
the undo stack.
@ -275,8 +288,10 @@
- save-undo?: if set to false, do not add undo changes.
- undo-group: if some consecutive changes (or even transactions) share the same
undo-group, they will be undone or redone in a single step. Without
it, a commit made while an undo transaction is open joins the
transaction's group, and any other gets a new one.
it, a `stack-undo?` commit that records undo takes the group of
the history entry it is added to, a commit made while an undo
transaction is open joins the transaction's group, and any
other gets a new one.
- ignore-save-lock: commit even while the save-failure lock holds. Only for
commits that are not user edits: the undo of rolled-back
commits and data derived from commits already made.
@ -310,9 +325,19 @@
(log/trace :hint "commit-changes" :redo-changes redo-changes)
(let [selected (dm/get-in state [:workspace-local :selected])
tx (dm/get-in state [:workspace-undo :transaction])
;; Inside an undo transaction, the group of its history entry
;; (taken from its first commit), or the one it was opened with
undo-group (or undo-group (:undo-group tx) (:commit-group tx) (uuid/next))]
;; A stacked commit that records undo belongs to the action
;; of the entry it is added to, and so do the commits it
;; starts, so one undo reverts them all. A commit that
;; records no undo joins no entry, so it keeps a group of
;; its own. Inside an undo transaction, the group of its
;; history entry (taken from its first commit), or the one
;; it was opened with
undo-group (or undo-group
(when (and stack-undo? save-undo? (seq undo-changes))
(get-stacked-undo-group state))
(:undo-group tx)
(:commit-group tx)
(uuid/next))]
(rx/of (-> params
(assoc :undo-group undo-group)
(assoc :features features)

View File

@ -8,6 +8,7 @@
(:require
["@penpot/ua-parser" :as ua]
[app.common.data :as d]
[app.common.exceptions :as ex]
[app.common.json :as json]
[app.common.logging :as l]
[app.common.math :as math]
@ -375,6 +376,18 @@
(or (contains? flags :audit-log)
(contains? flags :telemetry)))
(defn- run-event-callbacks
"Invoke host callbacks registered for this prepared audit event's
`:name`. Errors in a callback are swallowed so the audit pipeline
keeps running."
[event]
(let [name (:name event)
cbs (some-> name cf/get-event-callbacks)
js-event (when (seq cbs) (json/->js event))]
(when js-event
(doseq [f cbs]
(ex/ignoring (f js-event))))))
(defn initialize
[]
(ptk/reify ::initialize
@ -478,6 +491,8 @@
(assoc :timestamp (ct/now))
(assoc :context context)))))
(rx/tap run-event-callbacks)
(rx/tap (fn [event]
(l/debug :hint "event enqueued")
(swap! buffer append-to-buffer event)))

View File

@ -529,12 +529,15 @@
(rx/of (dwcm/watch-comment-thread-position-changes stoper-s))
;; Resize auto-grow text shapes whose selrect does not match
;; the WASM text layout once their fonts finish loading.
;; the WASM text layout (on page load or once their fonts
;; finish loading). These automatic heals record no undo
;; step, so Ctrl+Z reverts the user's own last edit.
(->> stream
(rx/filter (ptk/type? :app.render-wasm.api/stale-text-selrects))
(rx/map deref)
(rx/map (fn [{:keys [ids]}]
(dwwt/resize-wasm-text-all ids {:skip-component-sync? true}))))
(dwwt/resize-wasm-text-all ids {:skip-component-sync? true
:save-undo? false}))))
(let [local-commits-s
(->> stream

View File

@ -27,6 +27,7 @@
[app.common.types.file :as ctf]
[app.common.types.library :as ctl]
[app.common.types.shape.layout :as ctsl]
[app.common.types.text :as txt]
[app.common.types.typography :as ctt]
[app.common.uuid :as uuid]
[app.config :as cf]
@ -1229,6 +1230,56 @@
(remove uuid/zero?))
(:redo-changes changes)))
(def ^:private text-size-attrs
"Shape attributes whose change can change the size of an auto-grow text."
#{:grow-type :width :height :layout-item-h-sizing :layout-item-v-sizing})
(defn- without-fills
"Text `content` without its fills, which do not change its layout."
[content]
(txt/transform-nodes #(apply dissoc % :fills txt/text-fill-attrs) content))
(defn- text-size-change?
"True when `change` can change the size of the text `shape`: it sets a
size attribute, or content that differs in more than its fills. Sync only
emits operations for attributes that changed."
[shape {:keys [type operations]}]
(and (= :mod-obj type)
(some (fn [{:keys [attr val] :as op}]
(and (= :set (:type op))
(or (contains? text-size-attrs attr)
(and (= :content attr)
(not= (without-fills (:content shape))
(without-fills val))))))
operations)))
(defn- grow-type-after
"Grow type of text `shape` once `change` is applied."
[shape {:keys [operations]}]
(or (->> operations
(filter #(and (= :set (:type %)) (= :grow-type (:attr %))))
(last)
:val)
(:grow-type shape)))
(defn- sync-auto-grow-text-ids-on-page
"Text ids from sync redo-changes on `page-id` that are auto-grow once the
change is applied and whose size the change can alter. Shapes come from
pre-commit `objects`; the grow type comes from the change when it sets
one. Off-page, non-text and ids :fixed after the change are excluded."
[changes page-id objects]
(into []
(comp
(filter #(= page-id (:page-id %)))
(filter (fn [{:keys [id] :as change}]
(when-let [shape (get objects id)]
(and (cfh/text-shape? shape)
(not= :fixed (grow-type-after shape change))
(text-size-change? shape change)))))
(map :id)
(distinct))
(:redo-changes changes)))
(defn set-updating-library
[updating?]
(ptk/reify ::set-updating-library
@ -1239,30 +1290,62 @@
(dissoc state :updating-library)))))
(defn- sync-file-frontend-events
[file-id changes updated-frames undo-group]
(rx/concat
(rx/of (set-updating-library false)
(ntf/hide {:tag :sync-dialog}))
(when (seq (:redo-changes changes))
(rx/of (dch/commit-changes changes)))
(when-not (empty? updated-frames)
(let [frames-by-page (group-by :page-id updated-frames)]
(rx/merge
;; Emit one layout/update event for each page.
(->> frames-by-page
(map (fn [[page-id frames]]
"Commit sync changes, schedule current-page auto-grow text re-measure, then
layout. Re-measure heals box size only; it does not clear a stale
:geometry-group flag. The re-measure commit carries
:skip-component-sync? so it does not start another sync; the resize
itself never marks :geometry-group (it uses :ignore-touched). Keep
per-page updated-frames layout and thumbnail clears.
An auto-grow text copy takes the main's width and height on each
geometry sync, also when its content is overridden: its size is derived,
not an override. The re-measure corrects it on the current page, and the
page-open check on other pages. Until then the viewer, exports and
thumbnails show the main's box."
[file-id changes updated-frames undo-group current-page-id objects wasm?]
(let [remeasure-ids (when (and wasm? (some? current-page-id))
(sync-auto-grow-text-ids-on-page changes current-page-id objects))
frames-by-page (group-by :page-id updated-frames)
;; Re-measure-only layout when the current page has texts to heal but
;; no synced frames entry (covers empty updated-frames too).
remeasure-only-layout? (and (seq remeasure-ids)
(nil? (get frames-by-page current-page-id)))]
(rx/concat
(rx/of (set-updating-library false)
(ntf/hide {:tag :sync-dialog}))
(when (seq (:redo-changes changes))
(rx/of (dch/commit-changes changes)))
;; Schedule re-measure before layout (swap pattern: debounce ~40ms vs
;; layout buffer ~100ms).
(when (seq remeasure-ids)
(rx/of (dwwt/resize-wasm-text-all remeasure-ids
{:skip-component-sync? true
:undo-group undo-group})))
(rx/merge
;; Per-page layout for synced frames; merge re-measure ids into the
;; current page so hug sees the post-re-measure box.
(->> frames-by-page
(map (fn [[page-id frames]]
(let [ids (cond-> (mapv :id frames)
(and (= page-id current-page-id)
(seq remeasure-ids))
(into remeasure-ids))]
(ptk/data-event :layout/update
{:page-id page-id
:ids (map :id frames)
:undo-group undo-group})))
(rx/from))
(->> (rx/from updated-frames)
(rx/mapcat
(fn [shape]
(rx/of
(dwt/clear-thumbnail file-id (:page-id shape) (:id shape) "frame")
(when-not (= (:frame-id shape) uuid/zero)
(dwt/clear-thumbnail file-id (:page-id shape) (:frame-id shape) "frame")))))))))))
:ids ids
:undo-group undo-group}))))
(rx/from))
(when remeasure-only-layout?
(rx/of (ptk/data-event :layout/update
{:page-id current-page-id
:ids remeasure-ids
:undo-group undo-group})))
(->> (rx/from updated-frames)
(rx/mapcat
(fn [shape]
(rx/of
(dwt/clear-thumbnail file-id (:page-id shape) (:id shape) "frame")
(when-not (= (:frame-id shape) uuid/zero)
(dwt/clear-thumbnail file-id (:page-id shape) (:frame-id shape) "frame"))))))))))
(defn- mark-library-synced
"Tells the backend that `file-id` is synced with `library-id`. Only the
@ -1322,13 +1405,24 @@
ptk/WatchEvent
(watch [it state stream]
(when (and (some? file-id) (some? library-id)) ; Prevent race conditions while navigating out of the file
(log/info :msg "SYNC-FILE"
:file (debug-pretty-file file-id state)
:library (debug-pretty-file library-id state)
:asset-type asset-type
:asset-id asset-id
:undo-group undo-group)
(let [ldata (dsh/lookup-file-data state file-id)
(let [tx (dm/get-in state [:workspace-undo :transaction])
;; The sync commit and its text re-measure share one undo
;; group. The layout pass does not get it (the layout
;; buffer drops `:undo-group`); it joins the same undo
;; entry because it commits with `:stack-undo? true`.
;; Inside an undo transaction (color and typography edits)
;; the group is the transaction's, so the edit and its sync
;; undo and roll back together
undo-group (or undo-group (:undo-group tx) (:commit-group tx) (uuid/next))
_ (log/info :msg "SYNC-FILE"
:file (debug-pretty-file file-id state)
:library (debug-pretty-file library-id state)
:asset-type asset-type
:asset-id asset-id
:undo-group undo-group)
ldata (dsh/lookup-file-data state file-id)
libraries (dsh/lookup-libraries state)
current-file-id (:current-file-id state)
@ -1353,9 +1447,17 @@
pending-ids (sync-file-pending-ids file-id changes)
current-page-id (:current-page-id state)
frontend-sync
(sync-file-frontend-events
file-id changes updated-frames undo-group)]
file-id
changes
updated-frames
undo-group
current-page-id
(dsh/lookup-page-objects state file-id current-page-id)
(features/active-feature? state "render-wasm/v1"))]
(log/debug :msg "SYNC-FILE finished" :js/rchanges (log-changes
(:redo-changes changes)

View File

@ -101,13 +101,14 @@
;; Never call this directly but through the data-event `:layout/update`
;; Otherwise a lot of cycle dependencies could be generated
(defn- update-layout-positions
[{:keys [page-id ids undo-group reflow-tasks]}]
[{:keys [page-id ids undo-group reflow-tasks save-undo? skip-component-sync?]}]
(ptk/reify ::update-layout-positions
ptk/WatchEvent
(watch [_ state stream]
(let [page-id (or page-id (:current-page-id state))
objects (dsh/lookup-page-objects state page-id)
ids (->> ids (remove uuid/zero?) (filter #(contains? objects %)))
(let [page-id (or page-id (:current-page-id state))
objects (dsh/lookup-page-objects state page-id)
ids (->> ids (remove uuid/zero?) (filter #(contains? objects %)))
save-undo? (not (false? save-undo?))
update-positions-stream
(if (d/not-empty? ids)
@ -116,11 +117,15 @@
(= page-id (:current-page-id state)))
(rx/of (dwm/apply-wasm-modifiers modif-tree
:stack-undo? true
:save-undo? save-undo?
:skip-component-sync? skip-component-sync?
:undo-group undo-group
:ignore-touched true))
(rx/of (dwm/apply-modifiers {:page-id page-id
:modifiers modif-tree
:stack-undo? true
:save-undo? save-undo?
:skip-component-sync? skip-component-sync?
:ignore-touched true
:undo-group undo-group}))))
(rx/empty))
@ -169,11 +174,20 @@
(rx/filter #(d/not-empty? %))
(rx/mapcat
(fn [updates]
(->> (group-by :page-id updates)
(map (fn [[page-id updates]]
;; Updates flagged `:save-undo? false` and
;; `:skip-component-sync?` (automatic text size heals) are
;; laid out apart, so their reflow records no undo and does
;; not change components.
(->> (group-by (juxt :page-id
#(not (false? (:save-undo? %)))
#(boolean (:skip-component-sync? %)))
updates)
(map (fn [[[page-id save-undo? skip-component-sync?] updates]]
(let [ids (into #{} (mapcat :ids) updates)]
(update-layout-positions {:page-id page-id
:ids ids
:save-undo? save-undo?
:skip-component-sync? skip-component-sync?
:reflow-tasks (mapv ::reflow-task updates)})))))))
(rx/take-until stopper)
;; On workspace teardown clear everything still pending.

View File

@ -853,50 +853,83 @@
shape))]
(let [ids (into #{} (filter changed-text?) (keys props))]
(rx/of (dwu/start-undo-transaction undo-id)
(dwsh/update-shapes ids update-fn {:with-objects? true
:reg-objects? true
:stack-undo? true
:ignore-touched true})
(ptk/data-event :layout/update {:ids ids})
(dwu/commit-undo-transaction undo-id))))))))
(let [changed-ids (into #{} (filter changed-text?) (keys props))
;; Automatic size heals record no undo step, their parents'
;; reflow included, and do not sync to component copies.
heal-ids (into #{}
(filter (or (::resize-text-no-undo-ids state) #{}))
changed-ids)
ids (into #{} (remove heal-ids) changed-ids)
opts {:with-objects? true
:reg-objects? true
:stack-undo? true
:ignore-touched true}]
(rx/concat
(rx/of (dwu/start-undo-transaction undo-id)
(dwsh/update-shapes ids update-fn opts))
(if (seq heal-ids)
(rx/of (dwsh/update-shapes heal-ids update-fn
(assoc opts
:save-undo? false
:skip-component-sync? true)))
(rx/empty))
(rx/of (ptk/data-event :layout/update {:ids ids}))
(if (seq heal-ids)
(rx/of (ptk/data-event :layout/update {:ids heal-ids
:save-undo? false
:skip-component-sync? true}))
(rx/empty))
(rx/of (dwu/commit-undo-transaction undo-id)))))))))
(defn- track-no-undo-id
"Keep `id` in the no-undo set at `key` when `opts` ask for no undo step,
drop it otherwise (the latest request for a shape wins)."
[state key id opts]
(if (false? (:save-undo? opts))
(update state key (fnil conj #{}) id)
(update state key disj id)))
(defn resize-text
[id new-width new-height]
"Resize an auto-grow text to its measured size. The requests are batched
and committed together; `opts` with `:save-undo? false` commit this one
without an undo step."
([id new-width new-height]
(resize-text id new-width new-height nil))
([id new-width new-height opts]
(let [cur-event (js/Symbol)
reflow-task (wrf/task :text-resize [id])]
(ptk/reify ::resize-text
ptk/UpdateEvent
(update [_ state]
(-> state
(update ::resize-text-debounce-props (fnil assoc {}) id [new-width new-height])
(update ::resize-text-reflow-tasks (fnil conj []) reflow-task)
(track-no-undo-id ::resize-text-no-undo-ids id opts)
(cond-> (nil? (::resize-text-debounce-event state))
(assoc ::resize-text-debounce-event cur-event))))
(let [cur-event (js/Symbol)
reflow-task (wrf/task :text-resize [id])]
(ptk/reify ::resize-text
ptk/UpdateEvent
(update [_ state]
(-> state
(update ::resize-text-debounce-props (fnil assoc {}) id [new-width new-height])
(update ::resize-text-reflow-tasks (fnil conj []) reflow-task)
(cond-> (nil? (::resize-text-debounce-event state))
(assoc ::resize-text-debounce-event cur-event))))
ptk/WatchEvent
(watch [_ state stream]
(wrf/start! reflow-task)
(if (= (::resize-text-debounce-event state) cur-event)
(let [stopper (->> stream (rx/filter (ptk/type? ::dw/finalize-workspace)))]
(rx/concat
(rx/merge
(->> stream
(rx/filter (ptk/type? ::resize-text))
(rx/debounce 50)
(rx/take 1)
(rx/map #(commit-resize-text))
(rx/take-until stopper))
(rx/of (resize-text id new-width new-height)))
(rx/of (fn [state]
(wrf/finish-tasks! (::resize-text-reflow-tasks state))
(dissoc state
::resize-text-debounce-props
::resize-text-reflow-tasks
::resize-text-debounce-event)))))
(rx/empty))))))
ptk/WatchEvent
(watch [_ state stream]
(wrf/start! reflow-task)
(if (= (::resize-text-debounce-event state) cur-event)
(let [stopper (->> stream (rx/filter (ptk/type? ::dw/finalize-workspace)))]
(rx/concat
(rx/merge
(->> stream
(rx/filter (ptk/type? ::resize-text))
(rx/debounce 50)
(rx/take 1)
(rx/map #(commit-resize-text))
(rx/take-until stopper))
(rx/of (resize-text id new-width new-height opts)))
(rx/of (fn [state]
(wrf/finish-tasks! (::resize-text-reflow-tasks state))
(dissoc state
::resize-text-debounce-props
::resize-text-reflow-tasks
::resize-text-no-undo-ids
::resize-text-debounce-event)))))
(rx/empty)))))))
(defn save-default-font
[data]
@ -1041,51 +1074,68 @@
ptk/WatchEvent
(watch [_ state _]
(let [position-data (::update-position-data state)]
(rx/of (dwsh/update-shapes
(keys position-data)
(fn [shape]
(-> shape
(assoc :position-data (get position-data (:id shape)))))
{:stack-undo? true :reg-objects? false}))))))
(let [position-data (::update-position-data state)
;; Automatic size heals record no undo step and do not sync to
;; component copies.
no-undo-ids (or (::update-position-data-no-undo-ids state) #{})
update-fn (fn [shape]
(-> shape
(assoc :position-data (get position-data (:id shape)))))
opts {:stack-undo? true :reg-objects? false}
ids (into [] (remove no-undo-ids) (keys position-data))
heal-ids (into [] (filter no-undo-ids) (keys position-data))]
(rx/concat
(rx/of (dwsh/update-shapes ids update-fn opts))
(if (seq heal-ids)
(rx/of (dwsh/update-shapes heal-ids update-fn
(assoc opts
:save-undo? false
:skip-component-sync? true)))
(rx/empty)))))))
(defn update-position-data
[id position-data]
"Store the measured position-data of a text. The requests are batched and
committed together; `opts` with `:save-undo? false` commit this one
without an undo step."
([id position-data]
(update-position-data id position-data nil))
([id position-data opts]
(let [cur-event (js/Symbol)
reflow-task (wrf/task :text-position [id])]
(ptk/reify ::update-position-data
ptk/UpdateEvent
(update [_ state]
(let [state (assoc-in state [:workspace-text-modifier id :position-data] position-data)]
(-> state
(update ::update-position-data-reflow-tasks (fnil conj []) reflow-task)
(track-no-undo-id ::update-position-data-no-undo-ids id opts)
(cond-> (nil? (::update-position-data-debounce state))
(assoc ::update-position-data-debounce cur-event))
(cond-> (some? (::update-position-data-debounce state))
(assoc-in [::update-position-data id] position-data)))))
(let [cur-event (js/Symbol)
reflow-task (wrf/task :text-position [id])]
(ptk/reify ::update-position-data
ptk/UpdateEvent
(update [_ state]
(let [state (assoc-in state [:workspace-text-modifier id :position-data] position-data)]
(-> state
(update ::update-position-data-reflow-tasks (fnil conj []) reflow-task)
(cond-> (nil? (::update-position-data-debounce state))
(assoc ::update-position-data-debounce cur-event))
(cond-> (some? (::update-position-data-debounce state))
(assoc-in [::update-position-data id] position-data)))))
ptk/WatchEvent
(watch [_ state stream]
(wrf/start! reflow-task)
(if (= (::update-position-data-debounce state) cur-event)
(let [stopper (text-work-stopper stream)]
(rx/concat
(rx/merge
(->> stream
(rx/filter (ptk/type? ::update-position-data))
(rx/debounce 50)
(rx/take 1)
(rx/map #(commit-position-data))
(rx/take-until stopper))
(rx/of (update-position-data id position-data)))
(rx/of (fn [state]
(wrf/finish-tasks! (::update-position-data-reflow-tasks state))
(dissoc state
::update-position-data-debounce
::update-position-data
::update-position-data-reflow-tasks)))))
(rx/empty))))))
ptk/WatchEvent
(watch [_ state stream]
(wrf/start! reflow-task)
(if (= (::update-position-data-debounce state) cur-event)
(let [stopper (text-work-stopper stream)]
(rx/concat
(rx/merge
(->> stream
(rx/filter (ptk/type? ::update-position-data))
(rx/debounce 50)
(rx/take 1)
(rx/map #(commit-position-data))
(rx/take-until stopper))
(rx/of (update-position-data id position-data opts)))
(rx/of (fn [state]
(wrf/finish-tasks! (::update-position-data-reflow-tasks state))
(dissoc state
::update-position-data-debounce
::update-position-data
::update-position-data-no-undo-ids
::update-position-data-reflow-tasks)))))
(rx/empty)))))))
(defn update-attrs
[id attrs]
@ -1293,13 +1343,16 @@
(defn- add-geometry-undo-to-commit
"Adds geometry undo/redo to a commit so undo restores both content and geometry.
old-geom and final-geom are maps with :selrect :points and optionally :width :height."
old-geom and final-geom are maps with :selrect :points and optionally :width :height.
Uses :ignore-touched so auto-grow size from content edit is not a geometry override
on component copies (mirrors commit-resize-text)."
[base objects id old-geom final-geom attrs]
(let [objects-with-old (update objects id #(merge % old-geom))
final-shape-fn (fn [shape] (merge shape final-geom))]
(-> base
(pcb/with-objects objects-with-old)
(pcb/update-shapes [id] final-shape-fn {:attrs attrs}))))
(pcb/update-shapes [id] final-shape-fn {:attrs attrs
:ignore-touched true}))))
(defn- build-finalize-commit-changes
"Builds the commit changes for text finalization (content + geometry undo).
@ -1438,7 +1491,9 @@
;; Push the auto-grow geometry to WASM/app state; the commit persists it via `resize-geom`.
;; Skipped for a no-op finalize: applying it would record an undo transaction.
(when (and (some? resize-modifiers) (not finalize-no-op?))
(dwm/apply-wasm-modifiers resize-modifiers {:undo-group (when new-shape? id)})))
(dwm/apply-wasm-modifiers resize-modifiers
{:undo-group (when new-shape? id)
:ignore-touched true})))
(when finalize?
(rx/concat

View File

@ -92,7 +92,8 @@
(watch [_ state _]
(let [objects (dsh/lookup-page-objects state)
shape (get objects id)
apply-opts (or opts {})
;; Auto-grow size is derived from content; never mark geometry overrides.
apply-opts (assoc (or opts {}) :ignore-touched true)
resize-stream
(if (and (some? shape)
(cfh/text-shape? shape)
@ -102,11 +103,17 @@
(wrf/with-pending :text-resize [id] resize-stream))))))
(defn- merge-resize-debounce-opts
[prev {:keys [undo-group undo-id skip-component-sync?]}]
(cond-> (or prev {})
(some? undo-group) (assoc :undo-group undo-group)
(some? undo-id) (assoc :undo-id undo-id)
skip-component-sync? (assoc :skip-component-sync? true)))
"Merge the options of a request into its batch. The batch records no undo
step, or skips the component sync, only when every request in it asked
for that, so a user resize that lands in the same window keeps its undo
entry and still reaches the copies."
[prev {:keys [undo-group undo-id skip-component-sync? save-undo?]}]
(let [prev (or prev {:skip-component-sync? true :save-undo? false})]
(cond-> (assoc prev
:skip-component-sync? (and (:skip-component-sync? prev) (boolean skip-component-sync?))
:save-undo? (or (:save-undo? prev) (not (false? save-undo?))))
(some? undo-group) (assoc :undo-group undo-group)
(some? undo-id) (assoc :undo-id undo-id))))
(defn resize-wasm-text-debounce-commit
[]
@ -114,7 +121,7 @@
ptk/WatchEvent
(watch [_ state _]
(let [ids (get state ::resize-wasm-text-debounce-ids)
{:keys [undo-group undo-id skip-component-sync?]} (get state ::resize-wasm-text-debounce-opts)
{:keys [undo-group undo-id skip-component-sync? save-undo?]} (get state ::resize-wasm-text-debounce-opts)
objects (dsh/lookup-page-objects state)
modifiers
@ -132,10 +139,13 @@
;; When undo-id is present, extend the current undo transaction instead of
;; creating a new one, and commit it after the resize (single undo action).
extend-tx? (some? undo-id)
apply-opts (cond-> {}
;; Auto-grow size is derived; hardcode here (debounce caller opts
;; whitelist does not forward :ignore-touched).
apply-opts (cond-> {:ignore-touched true}
(some? undo-group) (assoc :undo-group undo-group)
extend-tx? (assoc :undo-transation? false)
skip-component-sync? (assoc :skip-component-sync? true))]
skip-component-sync? (assoc :skip-component-sync? true)
(false? save-undo?) (assoc :save-undo? false))]
(cond
(not (empty? modifiers))
(if extend-tx?
@ -167,8 +177,7 @@
(-> state
(update ::resize-wasm-text-debounce-ids (fnil conj []) id)
(update ::resize-wasm-text-reflow-tasks (fnil conj []) reflow-task)
(cond-> (seq opts)
(update ::resize-wasm-text-debounce-opts merge-resize-debounce-opts opts))
(update ::resize-wasm-text-debounce-opts merge-resize-debounce-opts opts)
(cond-> (nil? (::resize-wasm-text-debounce-event state))
(assoc ::resize-wasm-text-debounce-event cur-event))))
@ -202,7 +211,7 @@
(defn resize-wasm-text-debounce
([id]
(resize-wasm-text-debounce id nil))
([id {:keys [undo-group undo-id skip-component-sync?] :as opts}]
([id opts]
(ptk/reify ::resize-wasm-text-debounce
ptk/WatchEvent
(watch [_ state _]
@ -220,12 +229,8 @@
resize-wasm-stream
(if fonts-ready?
(let [pass-opts (when (or (some? undo-group) (some? undo-id) skip-component-sync?)
(cond-> {}
(some? undo-group) (assoc :undo-group undo-group)
(some? undo-id) (assoc :undo-id undo-id)
skip-component-sync? (assoc :skip-component-sync? true)))]
(rx/of (resize-wasm-text-debounce-inner id pass-opts)))
;; `merge-resize-debounce-opts` reads only the keys it knows.
(rx/of (resize-wasm-text-debounce-inner id opts))
;; Fonts not loaded; retry after 20 msecs
(->> (rx/of (resize-wasm-text-debounce id opts))

View File

@ -671,7 +671,7 @@
(mf/use-fn
(mf/deps frames)
(fn [_]
(st/emit! (de/show-workspace-export-frames-dialog frames))))
(st/emit! (de/show-workspace-export-frames-dialog (reverse frames)))))
on-export-frames-key-down
(mf/use-fn

View File

@ -14,6 +14,7 @@
[app.common.geom.shapes.text :as gsht]
[app.common.logging :as log]
[app.common.math :as mth]
[app.common.types.component :as ctk]
[app.common.types.modifiers :as ctm]
[app.common.types.text :as txt]
[app.common.uuid :as uuid]
@ -74,29 +75,71 @@
(update-shape-with-content shape content editor-content)))
(defn- measured-auto-size
"Measured [width height] of an auto-grow text, or nil when there is nothing
to resize."
[{:keys [grow-type migrate]} node]
(when (contains? #{:auto-height :auto-width} grow-type)
(let [{:keys [width height]}
(-> (dom/query node ".paragraph-set")
(dom/get-bounding-rect))
width (mth/ceil width)
height (mth/ceil height)]
(when (and (not (mth/almost-zero? width))
(not (mth/almost-zero? height))
(not migrate))
[width height]))))
(defn- text-heal
"How to commit a measured auto-grow text in heal `phase`: nil commits
nothing, otherwise a map with the commit `:opts`, whether to `:resize?`
the text and the `:next` heal phase, if any.
The `:check` phase runs when the page opens. It resizes the text when the
size drifted, so rounding differences between renderers or browsers are
not written back on every open. A text with no position-data that did not
drift gets its position-data only. A heal records no undo step. A resize
makes the text be measured again at its new box, in the `:settle` phase,
which is part of the heal too. Without a phase the text is committed as
usual.
Known limit: the WebGL and SVG renderers can measure the same text
differently. When they differ by more than 1px, each page open by a user
of the other renderer writes the size back. Two browsers on the SVG
renderer can do the same: a long auto-width line can differ by more than
1px, and an auto-height text can wrap a line differently."
[phase shape size]
(case phase
:check (let [drifted? (when-let [[width height] size]
(gsht/text-size-drifted? shape width height 1))]
(when (or drifted? (nil? (:position-data shape)))
(cond-> {:opts {:save-undo? false}}
drifted? (assoc :resize? true :next :settle))))
:settle {:opts {:save-undo? false} :resize? true}
{:resize? true}))
(defn- update-text-shape
[{:keys [grow-type id migrate] :as shape} node]
;; Check if we need to update the size because it's auto-width or auto-height
;; Update the position-data of every text fragment
"Measure the text and commit its position-data and auto-grow size as
`text-heal` decides for `phase`. Resolves to the next heal phase, if any."
[{:keys [id] :as shape} node phase]
(->> (tsp/calc-position-data id)
(p/fmap (fn [position-data]
;; At least one paragraph needs to be inside the bounding box
(when (gsht/overlaps-position-data? shape position-data)
(st/emit! (dwt/update-position-data id position-data)))
(let [;; A page-open check never writes a size laid out
;; with a fallback font
size (when-not (and (= :check phase)
(tsp/font-failed? position-data))
(measured-auto-size shape node))
heal (text-heal phase shape size)
opts (:opts heal)]
(when (some? heal)
;; At least one paragraph needs to be inside the bounding box
(when (gsht/overlaps-position-data? shape position-data)
(st/emit! (dwt/update-position-data id position-data opts)))
(when (contains? #{:auto-height :auto-width} grow-type)
(let [{:keys [width height]}
(-> (dom/query node ".paragraph-set")
(dom/get-bounding-rect))
(when-let [[width height] (and (:resize? heal) size)]
(st/emit! (dwt/resize-text id width height opts))))
width (mth/ceil width)
height (mth/ceil height)]
(when (and (not (mth/almost-zero? width))
(not (mth/almost-zero? height))
(not migrate))
(st/emit! (dwt/resize-text id width height)))))
(st/emit! (dwt/clean-text-modifier id))))
(st/emit! (dwt/clean-text-modifier id))
(:next heal))))
;; Log measurement errors and resolve to nil. The returned promise
;; stays pending until the measurement settles, so callers keep the
;; text mounted while it is measured.
@ -132,13 +175,19 @@
[props]
(let [shape (obj/get props "shape")
on-update (obj/get props "on-update")
phase (obj/get props "phase")
;; `phase` is left out of the deps on purpose: a shape change already
;; rebuilds the callback with the current value, and a phase change
;; after a measurement must not measure the text again.
handle-update
(mf/use-callback
(mf/deps shape on-update)
(fn [node]
(when (some? node)
(on-update shape node))))]
(if (some? phase)
(on-update shape node phase)
(on-update shape node)))))]
[:> html/text-shape* {:key (str "shape-" (:id shape))
:ref handle-update
@ -157,6 +206,32 @@
(mth/close? (dm/get-prop shape :width) (dm/get-prop other :width))
(mth/close? (dm/get-prop shape :height) (dm/get-prop other :height)))))
(defn text-changed?
"True when `new-shape` must be measured, given its previous version and its
heal `phase`."
[old-shape new-shape phase]
(let [remote? (some? (-> new-shape meta :session-id))]
(or (and (not remote?) ;; changes caused by a remote peer are not re-calculated
(not (text-properties-equal? old-shape new-shape)))
;; When the position data is nil we force to recalculate
(nil? (:position-data new-shape))
(= :check phase))))
(defn copy-heal-phases
"Auto-grow texts inside a component copy, each in the `:check` heal phase:
a component sync, also one through a nested main, can give them a stale
size, so they are measured again when the page opens. Texts of a main are
never synced. The check runs on every mount of `viewport-texts`: a page
open, a version change, and the end of read-only mode (Inspect, save-lock
release), which unmounts it."
[text-shapes]
(into {}
(comp (map val)
(filter (comp #{:auto-width :auto-height} :grow-type))
(filter ctk/in-component-copy?)
(map (fn [{:keys [id]}] [id :check])))
text-shapes))
(mf/defc text-changes-renderer
{::mf/wrap-props false}
[props]
@ -169,19 +244,21 @@
pending-update* (mf/use-state {})
pending-update (deref pending-update*)
;; Heal phase per text id. Auto-grow texts in copies start in
;; `:check` and are measured on page open: a sync while their page was
;; closed can give them a stale size. A text in `:settle` waits for
;; its heal resize to change the shape, which measures it again.
phases* (mf/use-state #(copy-heal-phases text-shapes))
phases (deref phases*)
text-change?
(fn [id]
(let [new-shape (get text-shapes id)
old-shape (get prev-text-shapes id)
remote? (some? (-> new-shape meta :session-id))]
(or (and (not remote?) ;; changes caused by a remote peer are not re-calculated
(not (text-properties-equal? old-shape new-shape)))
;; When the position data is nil we force to recalculate
(nil? (:position-data new-shape)))))
(text-changed? (get prev-text-shapes id)
(get text-shapes id)
(get phases id)))
changed-texts
(mf/with-memo [text-shapes pending-update]
(mf/with-memo [text-shapes pending-update phases]
(let [pending-shapes (into #{} (vals pending-update))]
(->> (keys text-shapes)
(filter (fn [id]
@ -191,7 +268,7 @@
handle-update-shape
(mf/use-fn
(fn [shape node]
(fn [shape node phase]
;; Unique to indentify the pending state
(let [uid (uuid/next)
id (:id shape)]
@ -202,13 +279,20 @@
(wrf/run-pending!
:text-measure
[id]
#(-> (update-text-shape shape node)
(p/finally (fn [] (swap! pending-update* dissoc uid))))))))]
#(-> (update-text-shape shape node phase)
(p/then (fn [next-phase]
(swap! phases* (fn [phases]
(if next-phase
(assoc phases id next-phase)
(dissoc phases id))))))
(p/finally (fn []
(swap! pending-update* dissoc uid))))))))]
[:.text-changes-renderer
(for [{:keys [id] :as shape} changed-texts]
[:& text-container {:key (dm/str "text-container-" id)
:shape shape
:phase (get phases id)
:on-update handle-update-shape}])]))
(mf/defc text-modifiers-renderer

View File

@ -14,6 +14,7 @@
[app.common.files.focus :as cpf]
[app.common.files.helpers :as cfh]
[app.common.fonts :as cfnt]
[app.common.geom.shapes.text :as gsht]
[app.common.logging :as log]
[app.common.math :as mth]
[app.common.render-wasm.api.modifiers :as modifiers]
@ -1655,16 +1656,13 @@
[text-ids]
(run! f/force-update-text-layout text-ids))
(defn- text-selrect-stale?
(defn- text-size-stale?
"Check if the WASM-measured dimensions of an auto-grow text shape differ
from its stored selrect (same 0.1px tolerance as the classic renderer)."
[{:keys [id selrect grow-type]}]
from its stored size by more than `tolerance` on an axis that grows and
does not fill its layout parent."
[{:keys [id] :as shape} tolerance]
(when-let [{:keys [width height]} (get-text-dimensions id)]
(case grow-type
:auto-width (or (not (mth/close? width (:width selrect) 0.1))
(not (mth/close? height (:height selrect) 0.1)))
:auto-height (not (mth/close? height (:height selrect) 0.1))
false)))
(gsht/text-size-drifted? shape width height tolerance)))
(defonce ^:private pending-stale-selrect-ids (atom #{}))
(defonce ^:private stale-selrect-sync-token (atom 0))
@ -1690,32 +1688,64 @@
(listen-tiles-render-complete-once! flush-on-idle!)))
(defn- sync-stale-text-selrects!
"Emit the ids of auto-grow text shapes whose selrect no longer matches the
measured layout, so the workspace resizes them (data-event instead of a
"Emit the ids of auto-grow text shapes whose stored size drifted from the
measured layout on an axis that grows and does not fill its layout
parent, so the workspace resizes them (data-event instead of a
direct call to avoid a circular dependency; see the watcher in
`app.main.data.workspace/initialize-workspace`)."
[shapes]
(let [stale-ids (into []
(comp (filter cfh/text-shape?)
(filter (comp #{:auto-width :auto-height} :grow-type))
(filter text-selrect-stale?)
(map :id))
shapes)]
(when (seq stale-ids)
(schedule-stale-selrect-sync! stale-ids))))
`app.main.data.workspace/initialize-workspace`). The default tolerance is
0.1px, as in the classic renderer."
([shapes]
(sync-stale-text-selrects! shapes 0.1))
([shapes tolerance]
(let [stale-ids (into []
(comp (filter cfh/text-shape?)
(filter (comp #{:auto-width :auto-height} :grow-type))
(filter #(text-size-stale? % tolerance))
(map :id))
shapes)]
(when (seq stale-ids)
(schedule-stale-selrect-sync! stale-ids)))))
(defn- shape-ids-for-failed-fonts
"Ids of the texts that use a face that failed to load. WASM lays them out
with a fallback font, so their measured size must not be saved: it would
be wrong and the heal records no undo step."
[{:keys [font-index]}]
(into #{}
(comp (filter f/font-failed?) (mapcat font-index))
(keys font-index)))
(defn- sync-loaded-text-selrects
"Check the auto-grow texts just loaded into WASM, so a text whose stored
size came from elsewhere (e.g. a component sync while its page was closed)
is resized to its layout. Texts still waiting for a font are left to
`relayout-after-fonts!`, which checks them once the font arrives, with
its own 0.1px tolerance. Texts using a face that failed to load are
skipped: their layout comes from a fallback font and would save a wrong
size with no undo step. This check runs on every page load, so it uses
1px: the classic renderer stores whole-pixel sizes and WASM fractional
ones, and a finer tolerance would rewrite the same texts each time a page
opens."
[shapes text-font-state]
(let [skip-ids (into (or (shape-ids-for-pending-fonts text-font-state) #{})
(shape-ids-for-failed-fonts text-font-state))]
(sync-stale-text-selrects! (into [] (remove (comp skip-ids :id)) shapes) 1)))
(defn- relayout-after-fonts!
"Relayout text shapes once their pending fonts have resolved. Font fetches
are deduped per URL, so only shapes that use a not-yet-ready face at upload
time need a forced relayout; then re-sync selrects that drifted for those
shapes only."
shapes only, leaving out the texts whose face failed to load."
[shapes text-font-state]
(let [text-ids (into [] (comp (filter cfh/text-shape?) (map :id)) shapes)
affected-ids (or (shape-ids-for-pending-fonts text-font-state) #{})
shapes-by-id (d/index-by :id shapes)]
(when (seq text-ids)
(if (seq affected-ids)
(let [affected-shapes (into [] (keep shapes-by-id) affected-ids)]
(let [failed-ids (shape-ids-for-failed-fonts text-font-state)
affected-shapes (into []
(comp (remove failed-ids) (keep shapes-by-id))
affected-ids)]
(force-update-text-layouts affected-ids)
(sync-stale-text-selrects! affected-shapes))
(update-text-layouts text-ids)))))
@ -1862,7 +1892,8 @@
;; is false). Each call touch_shape → touched_ids.
(let [text-ids (into [] (comp (filter cfh/text-shape?) (map :id)) shapes)]
(when (seq text-ids)
(update-text-layouts text-ids)))
(update-text-layouts text-ids)
(sync-loaded-text-selrects shapes text-font-state-acc)))
(if render-callback
(render-callback)
(request-render "set-objects-complete"))
@ -1980,7 +2011,8 @@
(if render-callback
(render-callback)
(request-render "set-objects-sync-complete"))
(ug/dispatch! (ug/event "penpot:wasm:set-objects")))))))
(ug/dispatch! (ug/event "penpot:wasm:set-objects"))))
(sync-loaded-text-selrects shapes text-font-state))))
(defn- shapes-in-tree-order
"Returns shapes sorted in tree order (parents before children).

View File

@ -276,6 +276,12 @@
(:style font-data)
emoji?))))
(defn font-failed?
"Returns true when the face behind `font-key` failed to load, so WASM lays
it out with a fallback."
[font-key]
(contains? @failed-font-data-keys font-key))
(defn font-ready?
"Returns true when WASM can lay out with the requested face or its fallback."
[font-data]

View File

@ -40,6 +40,8 @@
load-promise)))
(defn resolve-font
"Ensure the font of `node` is loaded. Resolves to `::font-failed` when it
cannot be loaded: the text is then laid out with a fallback font."
[node]
(let [styles (dom/get-computed-styles node)
font (dom/get-property-value styles "font")
@ -59,7 +61,7 @@
(load-font font))))
(p/merr (fn [_cause]
(js/console.error (str/ffmt "Cannot load font %" font-id))
(p/resolved nil))))))
(p/resolved ::font-failed))))))
(defn- process-text-node
@ -84,7 +86,15 @@
(let [text-nodes (-> (dom/query (dm/fmt "#html-text-node-%" shape-id))
(dom/query-all ".text-node"))]
(->> (p/all (map resolve-font text-nodes))
(p/fmap #(mapcat process-text-node text-nodes)))))
(p/fmap (fn [fonts]
(cond-> (into [] (mapcat process-text-node) text-nodes)
(some #{::font-failed} fonts)
(with-meta {::font-failed true})))))))
(defn font-failed?
"True when `position-data` was measured with a font that failed to load."
[position-data]
(true? (::font-failed (meta position-data))))
(defn calc-position-data
[shape-id]
@ -113,4 +123,5 @@
(when (some? shape-id)
(->> (calc-text-node-positions shape-id)
(p/fmap (fn [text-data]
(mapv transform-data text-data)))))))
(with-meta (mapv transform-data text-data)
(meta text-data))))))))

View File

@ -13,6 +13,11 @@ export default {
rules: {
"at-rule-no-unknown": null,
"declaration-property-value-no-unknown": null,
// TODO: stylelint-config-standard-scss@18 enables these rules; clean up the
// flagged legacy styles before turning them on.
"selector-no-deprecated": null,
"declaration-block-no-shorthand-property-overrides": null,
"scss/dollar-variable-no-missing-interpolation": null,
"property-no-unknown": [true, { ignoreProperties: ["text-box"] }],
"declaration-block-no-redundant-longhand-properties": [
true,

View File

@ -7,14 +7,84 @@
(ns frontend-tests.data.event-test
(:require
[app.common.uuid :as uuid]
[app.config :as cf]
[app.main.data.event :as ev]
[app.main.repo :as rp]
[app.util.globals :refer [global]]
[app.util.object :as obj]
[beicon.v2.core :as rx]
[cljs.test :as t :include-macros true]
[frontend-tests.helpers.async :as async]
[frontend-tests.helpers.mock :as mock]
[potok.v2.core :as ptk]))
(defn- with-event-callbacks
"Install a fresh penpotEventCallbacks Map for the body, then restore."
[setup-fn body-fn]
(let [prev-map (obj/get global "penpotEventCallbacks")
m (js/Map.)]
(setup-fn m)
(obj/set! global "penpotEventCallbacks" m)
(try
(body-fn)
(finally
(if (some? prev-map)
(obj/set! global "penpotEventCallbacks" prev-map)
(obj/unset! global "penpotEventCallbacks"))))))
(t/deftest run-event-callbacks-invokes-matching-name
(let [calls (atom [])]
(with-event-callbacks
(fn [m]
(.set m "disable-webgl-rendering"
#js [(fn [e] (swap! calls conj e))]))
(fn []
(#'ev/run-event-callbacks {:name "disable-webgl-rendering"
:type "action"
:props {:origin "settings"}})
(t/is (= 1 (count @calls)))
(let [payload (first @calls)]
(t/is (= "disable-webgl-rendering" (unchecked-get payload "name")))
(t/is (= "action" (unchecked-get payload "type")))
(t/is (= "settings" (unchecked-get (unchecked-get payload "props") "origin"))))))))
(t/deftest run-event-callbacks-ignores-unknown-name
(let [calls (atom [])]
(with-event-callbacks
(fn [m]
(.set m "disable-webgl-rendering"
#js [(fn [e] (swap! calls conj e))]))
(fn []
(#'ev/run-event-callbacks {:name "enable-webgl-rendering"
:type "action"
:props {}})
(t/is (empty? @calls))))))
(t/deftest run-event-callbacks-swallows-callback-errors
(let [calls (atom [])]
(with-event-callbacks
(fn [m]
(.set m "disable-webgl-rendering"
#js [(fn [_] (throw (js/Error. "host boom")))
(fn [e] (swap! calls conj e))]))
(fn []
(#'ev/run-event-callbacks {:name "disable-webgl-rendering"
:type "action"
:props {}})
(t/is (= 1 (count @calls)))
(t/is (= "disable-webgl-rendering"
(unchecked-get (first @calls) "name")))))))
(t/deftest add-event-callback-registers-on-global-map
(with-event-callbacks
(fn [_m])
(fn []
(let [calls (atom [])]
(cf/add-event-callback "navigate" (fn [e] (swap! calls conj e)))
(#'ev/run-event-callbacks {:name "navigate" :type "action" :props {}})
(t/is (= 1 (count @calls)))
(t/is (= "navigate" (unchecked-get (first @calls) "name")))))))
(t/deftest events-enabled?-truth-table
(t/testing "enabled when audit-log is present"
(t/is (true? (ev/events-enabled? #{:audit-log}))))

View File

@ -0,0 +1,444 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS SUBSIDIARY SL
(ns frontend-tests.data.workspace-heal-undo-test
"Automatic text size heals (a text resized to its WASM layout without a
user action) must not record an undo step, so Ctrl+Z reverts the user's
own last edit."
(:require
[app.common.math :as mth]
[app.common.test-helpers.components :as cthc]
[app.common.test-helpers.compositions :as ctho]
[app.common.test-helpers.files :as cthf]
[app.common.test-helpers.ids-map :as cthi]
[app.common.test-helpers.shapes :as cths]
[app.main.data.changes :as dch]
[app.main.data.helpers :as dsh]
[app.main.data.workspace.libraries :as dwl]
[app.main.data.workspace.pages :as dwpg]
[app.main.data.workspace.shape-layout :as dwsl]
[app.main.data.workspace.shapes :as dwsh]
[app.main.data.workspace.texts :as dwt]
[app.main.data.workspace.thumbnails :as dwth]
[app.main.data.workspace.thumbnails-wasm :as dwth.wasm]
[app.main.data.workspace.undo :as dwu]
[app.main.data.workspace.wasm-text :as dwwt]
[app.main.refs :as refs]
[app.main.store :as st]
[beicon.v2.core :as rx]
[cljs.test :as t :include-macros true]
[frontend-tests.helpers.async :as async]
[frontend-tests.helpers.mock :as mock]
[frontend-tests.helpers.state :as ths]
[frontend-tests.helpers.wasm :as thw]
[frontend-tests.tokens.helpers.state :as tohs]
[okulary.core :as l]
[potok.v2.core :as ptk]))
(t/use-fixtures :each
{:before (fn []
(cthi/reset-idmap!)
(thw/setup-wasm-mocks!))
:after thw/teardown-wasm-mocks!})
(defn- collect-commits
"Subscribe before emitting; accumulates the commits that touch `id`."
[store id]
(let [acc (atom [])]
(->> (ptk/input-stream store)
(rx/filter dch/commit?)
(rx/map deref)
(rx/filter #(some (comp #{id} :id) (:redo-changes %)))
(rx/subs! #(swap! acc conj %)))
acc))
(defn- touches?
[commit id]
(some (comp #{id} :id) (:redo-changes commit)))
(defn- ^:async batch-commit
"Emit one WASM text resize per entry of `opts-list`, each for its own text,
in the same debounce window. Resolves to the first commit that touches
the first text, with the ids of all the texts."
[& opts-list]
(let [labels (map-indexed (fn [i _] [(keyword (str "frame-" i)) (keyword (str "text-" i))])
opts-list)
file (reduce (fn [file [frame text]]
(ctho/add-frame-with-text file frame text "hello"))
(cthf/sample-file :file1)
labels)
store (ths/setup-store file)
ids (mapv (fn [[_ text]] (:id (cths/get-shape file text))) labels)
commits (collect-commits store (first ids))]
(doseq [[id opts] (map vector ids opts-list)]
(ptk/emit! store (dwwt/resize-wasm-text-all [id] opts)))
(await (async/wait-for #(seq @commits) "a resize commit for the text" {:max-ticks 200}))
{:commit (first @commits) :ids ids}))
(def ^:private heal {:skip-component-sync? true :save-undo? false})
;; What the component sync sends when it re-measures the synced copies.
(def ^:private sync-remeasure {:skip-component-sync? true})
;; A user resize carries no options.
(def ^:private user nil)
(t/deftest ^:async heal-resize-records-no-undo-step
(let [{:keys [commit]} (await (batch-commit heal))]
(t/is (false? (:save-undo? commit))
"the heal commit is not added to the undo history")))
(t/deftest ^:async user-resize-keeps-its-undo-step
(let [{:keys [commit]} (await (batch-commit user))]
(t/is (true? (:save-undo? commit))
"a user resize records undo")
(t/is (not (:skip-component-sync? commit))
"a user resize syncs to component copies")))
(t/deftest ^:async sync-remeasure-keeps-its-undo-step
(let [{:keys [commit]} (await (batch-commit sync-remeasure))]
(t/is (true? (:save-undo? commit))
"a sync re-measure records undo")
(t/is (true? (:skip-component-sync? commit))
"a sync re-measure does not start another sync")))
(t/deftest ^:async user-resize-batched-after-a-heal-keeps-its-undo-step
(let [{:keys [commit ids]} (await (batch-commit heal user))]
(t/is (every? #(touches? commit %) ids)
"both resizes land in one commit")
(t/is (true? (:save-undo? commit))
"a user resize without options keeps its undo step")
(t/is (not (:skip-component-sync? commit))
"a user resize without options still syncs to component copies")))
(t/deftest ^:async heal-batched-after-a-user-resize-keeps-the-undo-step
(let [{:keys [commit ids]} (await (batch-commit user heal))]
(t/is (every? #(touches? commit %) ids)
"both resizes land in one commit")
(t/is (true? (:save-undo? commit))
"the user's resize keeps its undo step")
(t/is (not (:skip-component-sync? commit))
"the user's resize still syncs to component copies")))
(t/deftest ^:async user-resize-batched-after-a-sync-remeasure-still-syncs
(let [{:keys [commit ids]} (await (batch-commit sync-remeasure user))]
(t/is (every? #(touches? commit %) ids)
"both resizes land in one commit")
(t/is (true? (:save-undo? commit)))
(t/is (not (:skip-component-sync? commit))
"the main's new size reaches its copies")))
(t/deftest ^:async sync-remeasure-batched-after-a-user-resize-still-syncs
(let [{:keys [commit ids]} (await (batch-commit user sync-remeasure))]
(t/is (every? #(touches? commit %) ids)
"both resizes land in one commit")
(t/is (true? (:save-undo? commit)))
(t/is (not (:skip-component-sync? commit))
"the main's new size reaches its copies")))
(t/deftest ^:async batch-of-sync-remeasures-skips-the-sync
(let [{:keys [commit ids]} (await (batch-commit sync-remeasure sync-remeasure))]
(t/is (every? #(touches? commit %) ids)
"both re-measures land in one commit")
(t/is (true? (:save-undo? commit)))
(t/is (true? (:skip-component-sync? commit))
"a batch of re-measures does not start another sync")))
(t/deftest ^:async batch-of-heals-records-no-undo-step
(let [{:keys [commit ids]} (await (batch-commit heal heal))]
(t/is (every? #(touches? commit %) ids)
"both heals land in one commit")
(t/is (false? (:save-undo? commit))
"a batch of heals is not added to the undo history")
(t/is (true? (:skip-component-sync? commit))
"a batch of heals does not sync to component copies")))
;; SVG renderer
(defn- collect-layout-updates
"Subscribe before emitting; accumulates `:layout/update` payloads."
[store]
(let [acc (atom [])]
(->> (ptk/input-stream store)
(rx/filter (ptk/type? :layout/update))
(rx/map deref)
(rx/subs! #(swap! acc conj %)))
acc))
(t/deftest ^:async svg-heal-resize-records-no-undo-step
(let [file (-> (cthf/sample-file :file1)
(ctho/add-frame-with-text :frame :text "hello"))
store (ths/setup-store file {:renderer :svg})
id (:id (cths/get-shape file :text))
commits (collect-commits store id)
layouts (collect-layout-updates store)]
(ptk/emit! store (dwt/resize-text id 50 30 {:save-undo? false}))
(await (async/wait-for #(seq @commits) "a resize commit for the text" {:max-ticks 200}))
(t/is (false? (:save-undo? (first @commits)))
"the heal commit is not added to the undo history")
(t/is (true? (:skip-component-sync? (first @commits)))
"the heal does not sync to component copies")
(t/is (some #(and (false? (:save-undo? %))
(true? (:skip-component-sync? %))
(contains? (set (:ids %)) id))
@layouts)
"the parents' reflow is asked for without undo and without sync too")))
(defn- ^:async svg-mixed-commits
"Emit `heal-event` for one text and `user-event` for another in the same
debounce window; resolve to the first commit that touches each, as
`[heal-commit user-commit]`."
[heal-event user-event]
(let [file (-> (cthf/sample-file :file1)
(ctho/add-frame-with-text :frame-a :text-a "hello")
(ctho/add-frame-with-text :frame-b :text-b "world"))
store (ths/setup-store file {:renderer :svg})
heal-id (:id (cths/get-shape file :text-a))
user-id (:id (cths/get-shape file :text-b))
heal (collect-commits store heal-id)
user (collect-commits store user-id)]
(ptk/emit! store (heal-event heal-id))
(ptk/emit! store (user-event user-id))
(await (async/wait-for #(and (seq @heal) (seq @user)) "a commit for each text"
{:max-ticks 400}))
[(first @heal) (first @user)]))
(t/deftest ^:async svg-resize-batch-keeps-the-undo-step-of-a-user-resize
(let [[heal user] (await (svg-mixed-commits #(dwt/resize-text % 50 30 {:save-undo? false})
#(dwt/resize-text % 60 40)))]
(t/is (false? (:save-undo? heal))
"the heal in the batch records no undo step")
(t/is (true? (:save-undo? user))
"the user resize in the same batch keeps its undo step")
(t/is (not (:skip-component-sync? user))
"the user resize still syncs to component copies")))
(def ^:private position-data
[{:x 0 :y 0 :width 10 :height 10 :text "x" :font-size "14" :font-family "sourcesanspro"
:font-weight "400" :font-style "normal" :text-decoration "none"
:text-transform "none" :letter-spacing "normal" :direction "ltr"
:fills [{:fill-color "#000000" :fill-opacity 1}]}])
(t/deftest ^:async svg-position-data-batch-keeps-the-undo-step-of-a-user-change
(let [[heal user] (await (svg-mixed-commits #(dwt/update-position-data % position-data {:save-undo? false})
#(dwt/update-position-data % position-data)))]
(t/is (false? (:save-undo? heal))
"the heal in the batch records no undo step")
(t/is (true? (:skip-component-sync? heal))
"the heal does not sync to component copies")
(t/is (true? (:save-undo? user))
"the user change in the same batch keeps its undo step")
(t/is (not (:skip-component-sync? user))
"the user change still syncs to component copies")))
(defn- ^:async svg-same-text-commit
"Emit `heal-event` and then `user-event` for the same text in one debounce
window; resolve to the first commit that touches it."
[heal-event user-event]
(let [file (-> (cthf/sample-file :file1)
(ctho/add-frame-with-text :frame :text "hello"))
store (ths/setup-store file {:renderer :svg})
id (:id (cths/get-shape file :text))
commits (collect-commits store id)]
(ptk/emit! store (heal-event id))
(ptk/emit! store (user-event id))
(await (async/wait-for #(seq @commits) "a commit for the text" {:max-ticks 200}))
(first @commits)))
(t/deftest ^:async svg-user-resize-after-a-heal-of-the-same-text-keeps-undo
(let [commit (await (svg-same-text-commit #(dwt/resize-text % 50 30 {:save-undo? false})
#(dwt/resize-text % 60 40)))]
(t/is (true? (:save-undo? commit))
"the later user resize decides: it keeps its undo step")
(t/is (not (:skip-component-sync? commit))
"and syncs to component copies")))
(t/deftest ^:async svg-user-change-after-a-heal-of-the-same-text-keeps-undo
(let [commit (await (svg-same-text-commit #(dwt/update-position-data % position-data {:save-undo? false})
#(dwt/update-position-data % position-data)))]
(t/is (true? (:save-undo? commit))
"the later user change decides: it keeps its undo step")
(t/is (not (:skip-component-sync? commit))
"and syncs to component copies")))
(defn- flex-board-with-rect
"A flex column board with a rect placed off its layout position, so a
reflow of the board always moves the rect."
[file board-label rect-label x]
(-> file
(ctho/add-frame board-label {:x x :y 0 :width 200 :height 200
:layout :flex :layout-flex-dir :column})
(ctho/add-rect rect-label {:parent-label board-label
:x (+ x 50) :y 50 :width 20 :height 20})))
(t/deftest ^:async reflow-of-a-heal-records-no-undo-step
(let [file (-> (cthf/sample-file :file1)
(flex-board-with-rect :board-a :rect-a 0)
(flex-board-with-rect :board-b :rect-b 300))
store (ths/setup-store file {:renderer :svg})
rect-a (:id (cths/get-shape file :rect-a))
rect-b (:id (cths/get-shape file :rect-b))
heal (collect-commits store rect-a)
user (collect-commits store rect-b)]
(ptk/emit! store (dwsl/initialize-shape-layout))
;; Both updates land in the same 100 ms layout buffer.
(ptk/emit! store (ptk/data-event :layout/update {:ids [rect-a]
:save-undo? false
:skip-component-sync? true}))
(ptk/emit! store (ptk/data-event :layout/update {:ids [rect-b]}))
(await (async/wait-for #(and (seq @heal) (seq @user)) "a reflow commit for each board"
{:max-ticks 400}))
(ptk/emit! store (dwsl/finalize-shape-layout))
(t/is (false? (:save-undo? (first @heal)))
"the reflow of a heal is not added to the undo history")
;; A commit without undo and without this flag would make the component
;; watcher touch the component, so a page open would change it
(t/is (true? (:skip-component-sync? (first @heal)))
"the reflow of a heal does not change components")
(t/is (true? (:save-undo? (first @user)))
"a user reflow in the same buffer keeps its undo step")
(t/is (not (:skip-component-sync? (first @user)))
"and still syncs to component copies")))
;; Undo history
(defn- undo-stack
[store]
(select-keys (:workspace-undo @store) [:items :index]))
(defn- text-size
[store id]
(-> (dsh/lookup-page-objects @store)
(get id)
(select-keys [:width :height])))
(defn- ^:async heal-keeps-the-undo-history
"Make a user edit on one text with `user-event`, then heal another with
`heal-event`, each in its own commit. The heal must leave the undo stack
as the user edit left it, and undo must revert the user edit."
[renderer user-event heal-event]
(let [file (-> (cthf/sample-file :file1)
(ctho/add-frame-with-text :frame-a :text-a "hello")
(ctho/add-frame-with-text :frame-b :text-b "world"))
store (ths/setup-store file (when renderer {:renderer renderer}))
user-id (:id (cths/get-shape file :text-a))
heal-id (:id (cths/get-shape file :text-b))
user-commits (collect-commits store user-id)
heal-commits (collect-commits store heal-id)
original (text-size store user-id)]
(ptk/emit! store (tohs/watch-undo-stack))
(ptk/emit! store (user-event user-id))
(await (async/wait-for #(and (seq @user-commits) (seq (:items (undo-stack store))))
"an undo entry for the user edit" {:max-ticks 200}))
(let [after-user (undo-stack store)
edited (text-size store user-id)]
(t/is (not= original edited)
"the user edit changes the text size")
(ptk/emit! store (heal-event heal-id))
(await (async/wait-for #(seq @heal-commits) "a heal commit" {:max-ticks 200}))
(await (async/settle))
(let [healed (text-size store heal-id)]
(t/is (= after-user (undo-stack store))
"the heal adds no undo entry and does not move the index")
(ptk/emit! store dwu/undo)
(await (async/wait-for #(not= edited (text-size store user-id))
"the undo of the user edit" {:max-ticks 200}))
(t/is (and (mth/close? (:width original) (:width (text-size store user-id)))
(mth/close? (:height original) (:height (text-size store user-id))))
"undo reverts the user edit")
(t/is (= healed (text-size store heal-id))
"undo leaves the heal in place")))))
(t/deftest ^:async heal-keeps-the-undo-history-on-wasm
(await (heal-keeps-the-undo-history
nil
#(dwwt/resize-wasm-text-all [%] nil)
#(dwwt/resize-wasm-text-all [%] heal))))
(t/deftest ^:async heal-keeps-the-undo-history-on-svg
(await (heal-keeps-the-undo-history
:svg
#(dwt/resize-text % 60 40)
#(dwt/resize-text % 50 30 {:save-undo? false}))))
;; Main text edit, its own resize and the component sync
(defn- get-shape-in-store
[store id]
(get (dsh/lookup-page-objects @store) id))
(defn- noop-render-thumbnail
[& _]
(ptk/reify ::noop-render-thumbnail
ptk/WatchEvent
(watch [_ _ _] (rx/empty))))
;; Scenario: the user edits a main text, the main text then resizes itself
;; (`resize-text`, a stacked commit in its own undo transaction), and the
;; real component watcher syncs both changes to the copy. Proves: one Ctrl+Z
;; reverts the edit, the resize and the syncs, on the main and on the copy.
;; Before, the resize kept the group of its transaction, the sync it started
;; inherited it and became an undo entry of its own, so the first Ctrl+Z
;; undid only that sync.
(t/deftest ^:async one-undo-reverts-a-main-text-edit-its-resize-and-their-sync
(let [file (-> (cthf/sample-file :file1)
(ctho/add-frame-with-text :main-root :main-child "hello world"
:child-params {:grow-type :auto-height})
(cthc/make-component :component1 :main-root)
(cthc/instantiate-component :component1 :copy-root
{:children-labels [:copy-child]}))
store (ths/setup-store file {:renderer :svg})
page-id (cthf/current-page-id file)
main-id (cthi/id :main-child)
copy-id (cthi/id :copy-child)
before (fn [id] (select-keys (get-shape-in-store store id) [:opacity :width :height]))
main-0 (before main-id)
copy-0 (before copy-id)]
(await
(mock/with-mocks*
{;; The component watcher reads the file data through this lens
refs/workspace-data (l/derived dsh/lookup-file-data store)
;; Thumbnail renders read the global store
st/state store
dwth.wasm/render-thumbnail noop-render-thumbnail
;; The SVG renderer updates the main's thumbnail after the sync; its
;; render needs a DOM and finishes after the test
dwth/update-thumbnail noop-render-thumbnail
;; sync-file clears frame thumbnails on a timer that outlives the test
dwth/clear-thumbnail (mock/stub (constantly nil))}
(ptk/emit! store (tohs/watch-undo-stack))
(ptk/emit! store (dwl/watch-component-changes))
;; The user edit, synced to the copy
(ptk/emit! store (dwsh/update-shapes [main-id] #(assoc % :opacity 0.5)))
(await (async/wait-for #(= 0.5 (:opacity (get-shape-in-store store copy-id)))
"the edit to reach the copy" {:max-ticks 400}))
;; The main text resizes itself, synced to the copy
(ptk/emit! store (dwt/resize-text main-id 60 40))
(await (async/wait-for #(mth/close? 40 (:height (get-shape-in-store store copy-id)))
"the resize to reach the copy" {:max-ticks 400}))
(await (async/settle))
(let [index (get-in @store [:workspace-undo :index])]
(ptk/emit! store dwu/undo)
(await (async/wait-for #(not= index (get-in @store [:workspace-undo :index]))
"the undo" {:max-ticks 400})))
(await (async/settle))
(t/is (= -1 (get-in @store [:workspace-undo :index]))
"one undo reverts the whole action")
(t/is (= main-0 (before main-id))
"the main is back to its size and opacity")
(t/is (= copy-0 (before copy-id))
"the copy is back to its size and opacity")
(ptk/emit! store (dwpg/finalize-page (:id file) page-id))
(await (async/settle))))))

View File

@ -0,0 +1,341 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS SUBSIDIARY SL
(ns frontend-tests.data.workspace-sync-text-wasm-test
"Regression test for #12721: after component sync with render-wasm/v1,
auto-grow text copies must be scheduled for a WASM re-measure with
:skip-component-sync?, so the re-measure commit does not start another
sync."
(:require
[app.common.files.changes-builder :as pcb]
[app.common.geom.shapes :as gsh]
[app.common.logic.shapes :as cls]
[app.common.test-helpers.components :as cthc]
[app.common.test-helpers.compositions :as ctho]
[app.common.test-helpers.files :as cthf]
[app.common.test-helpers.ids-map :as cthi]
[app.common.test-helpers.shapes :as cths]
[app.common.types.modifiers :as ctm]
[app.common.uuid :as uuid]
[app.main.data.changes :as dch]
[app.main.data.workspace.libraries :as dwl]
[app.main.data.workspace.thumbnails :as dwt]
[app.main.data.workspace.undo :as dwu]
[app.main.data.workspace.wasm-text :as dwwt]
[beicon.v2.core :as rx]
[cljs.test :as t :include-macros true]
[frontend-tests.helpers.state :as ths]
[potok.v2.core :as ptk]))
(def ^:private orig-resize-wasm-text-all dwwt/resize-wasm-text-all)
(def ^:private orig-clear-thumbnail dwt/clear-thumbnail)
(def ^:private resize-calls (atom []))
(defn- mock-clear-thumbnail
([_ _] nil)
([_ _ _ _] nil))
(defn- mock-resize-wasm-text-all
([ids] (mock-resize-wasm-text-all ids nil))
([ids opts]
(swap! resize-calls conj {:ids ids :opts opts})
nil))
(t/use-fixtures :each
{:before (fn []
(cthi/reset-idmap!)
(reset! resize-calls [])
(set! dwwt/resize-wasm-text-all mock-resize-wasm-text-all)
;; sync-file clears frame thumbnails on a 200ms timer that
;; outlives the test and calls rp/cmd! inside later tests.
(set! dwt/clear-thumbnail mock-clear-thumbnail))
:after (fn []
(set! dwwt/resize-wasm-text-all orig-resize-wasm-text-all)
(set! dwt/clear-thumbnail orig-clear-thumbnail))})
(defn- setup-file
[& {:keys [grow-type] :or {grow-type :auto-width}}]
(-> (cthf/sample-file :file1)
(ctho/add-frame-with-text :main-root :main-child "hello world"
:child-params {:grow-type grow-type})
(cthc/make-component :component1 :main-root)
(cthc/instantiate-component :component1 :copy-root
{:children-labels [:copy-child]})))
(defn- update-main-text
[file update-fn]
(let [page (cthf/current-page file)
main-child (cths/get-shape file :main-child)
changes (cls/generate-update-shapes
(pcb/empty-changes nil (:id page))
#{(:id main-child)}
update-fn
(:objects page)
{})]
(cthf/apply-changes file changes)))
(defn- bump-main-font-size
[file]
(update-main-text file #(assoc-in % [:content :children 0 :children 0 :children 0 :font-size] "32")))
(defn- recolor-main-text
[file]
(update-main-text file #(assoc-in % [:content :children 0 :children 0 :children 0 :fills]
[{:fill-color "#ff0000" :fill-opacity 1}])))
(defn- fade-main-text
[file]
(update-main-text file #(assoc % :opacity 0.5)))
(defn- widen-main-text
[file]
(update-main-text file #(gsh/transform-shape % (ctm/change-dimensions-modifiers % :width 300))))
(defn- collect-layout-updates
"Subscribe before emit; accumulates deref'd `:layout/update` payloads."
[store]
(let [acc (atom [])]
(->> (ptk/input-stream store)
(rx/filter (ptk/type? :layout/update))
(rx/tap #(swap! acc conj (deref %)))
(rx/subs! (fn [_] nil)))
acc))
(t/deftest test-sync-file-schedules-wasm-text-remeasure
(t/async
done
(let [file (-> (setup-file) bump-main-font-size)
store (ths/setup-store file)
page-id (cthf/current-page-id file)
copy-id (:id (cths/get-shape file :copy-child))
undo-group (uuid/next)
layout-updates (collect-layout-updates store)
events
[(dwl/sync-file (:id file) (:id file)
:components (cthi/id :component1)
undo-group)]]
(ths/run-store
store done events
(fn [_new-state]
(t/is (= 1 (count @resize-calls))
"resize-wasm-text-all should run once after sync")
(let [{:keys [ids opts]} (first @resize-calls)
layout-ids (->> @layout-updates
(filter #(= page-id (:page-id %)))
(mapcat :ids)
set)]
(t/is (some #{copy-id} ids)
"re-measure ids should include the copy text")
(t/is (:skip-component-sync? opts)
"re-measure must use :skip-component-sync? so its commit does not start another sync")
(t/is (= undo-group (:undo-group opts)))
(t/is (every? layout-ids ids)
(str "current-page :layout/update ids must include re-measure ids; "
"layout=" layout-ids " re-measure=" ids))))))))
(defn- collect-commits
"Subscribe before emit; accumulates the commits that touch `id`."
[store id]
(let [acc (atom [])]
(->> (ptk/input-stream store)
(rx/filter dch/commit?)
(rx/map deref)
(rx/filter #(some (comp #{id} :id) (:redo-changes %)))
(rx/subs! #(swap! acc conj %)))
acc))
(t/deftest test-sync-file-without-undo-group-shares-one-with-its-remeasure
(t/async
done
(let [file (-> (setup-file) bump-main-font-size)
store (ths/setup-store file)
copy-id (:id (cths/get-shape file :copy-child))
commits (collect-commits store copy-id)
;; The library update dialog and the color and typography syncs
;; pass no undo group
events [(dwl/sync-file (:id file) (:id file)
:components (cthi/id :component1))]]
(ths/run-store
store done events
(fn [_]
(let [sync-group (:undo-group (first @commits))
remeasure-opts (:opts (first @resize-calls))]
(t/is (some? sync-group)
"the sync commit gets an undo group")
(t/is (= sync-group (:undo-group remeasure-opts))
"the re-measure shares it, so one undo reverts both")))))))
(defn- run-sync-in-undo-transaction
"Runs, inside one undo transaction, an edit commit with `edit-group` (nil
for none) and then `sync-file` with no undo group, and checks that the
sync commit and its re-measure take the edit's group. With `edit-group`
the edit's history entry is appended by hand, as the workspace undo
watcher does, so the transaction gets that group as its `:undo-group`."
[done edit-group]
(let [file (-> (setup-file) bump-main-font-size)
store (ths/setup-store file)
page-id (cthf/current-page-id file)
tx (js/Symbol)
redo [{:type :mod-page :id page-id :name "Edited"}]
undo [{:type :mod-page :id page-id :name "Page 1"}]
groups (atom [])
sub (->> (ptk/input-stream store)
(rx/filter dch/commit?)
(rx/subs! #(swap! groups conj (:undo-group (deref %)))))
events (cond-> [(dwu/start-undo-transaction tx :timeout 0)
;; Stands for the color, typography or delete commit
(dch/commit-changes {:redo-changes redo
:undo-changes undo
:undo-group edit-group})]
(some? edit-group)
(conj (dwu/append-undo {:undo-changes undo
:redo-changes redo
:undo-group edit-group
:tags #{}}
false))
:always
(conj (dwl/sync-file (:id file) (:id file)
:components (cthi/id :component1))
(dwu/commit-undo-transaction tx)))]
(ths/run-store
store done events
(fn [_]
(rx/dispose! sub)
(let [first-group (first @groups)
remeasure-opts (:opts (first @resize-calls))]
(t/is (some? first-group))
(when (some? edit-group)
(t/is (= edit-group first-group)))
(t/is (< 1 (count @groups))
"the sync commits after the edit")
(t/is (every? #{first-group} @groups)
"the sync commit takes the transaction's group")
(t/is (= first-group (:undo-group remeasure-opts))
"the re-measure takes the transaction's group"))))))
;; Scenario: the color and typography edits commit and call `sync-file`
;; with no undo group inside their own undo transaction. Proves: the sync
;; commit and its re-measure take the transaction's group, so one undo
;; reverts the edit and its sync, and a rejected sync rolls back both.
(t/deftest test-sync-file-in-undo-transaction-shares-its-group
(t/async
done
(run-sync-in-undo-transaction done nil)))
;; Scenario: `delete-component` commits with its own undo group inside the
;; sidebar's undo transaction, then syncs with no group. Proves: the sync
;; takes the transaction's `:undo-group` (the delete's), not the group the
;; transaction was opened with.
(t/deftest test-sync-file-in-undo-transaction-takes-the-entry-group
(t/async
done
(run-sync-in-undo-transaction done (uuid/next))))
(t/deftest test-sync-file-skips-remeasure-for-fixed-text
(t/async
done
(let [file (-> (setup-file :grow-type :fixed) bump-main-font-size)
store (ths/setup-store file)
events
[(dwl/sync-file (:id file) (:id file)
:components (cthi/id :component1))]]
(ths/run-store
store done events
(fn [_new-state]
(t/is (empty? @resize-calls)
"fixed-grow texts must not be scheduled for a WASM re-measure"))))))
(defn- set-main-grow-type
[grow-type]
(fn [file]
(update-main-text file #(assoc % :grow-type grow-type))))
(t/deftest test-sync-file-remeasures-text-that-becomes-auto-grow
(t/async
done
(let [file (-> (setup-file :grow-type :fixed)
((set-main-grow-type :auto-height)))
store (ths/setup-store file)
copy-id (:id (cths/get-shape file :copy-child))
events [(dwl/sync-file (:id file) (:id file)
:components (cthi/id :component1))]]
(ths/run-store
store done events
(fn [_]
(t/is (= 1 (count @resize-calls))
"a copy turned auto-grow by the sync is re-measured")
(t/is (some #{copy-id} (:ids (first @resize-calls)))
"the re-measure includes the copy"))))))
(t/deftest test-sync-file-skips-text-that-becomes-fixed
(t/async
done
(let [file (-> (setup-file :grow-type :auto-height)
((set-main-grow-type :fixed)))
store (ths/setup-store file)
page-id (cthf/current-page-id file)
copy-id (:id (cths/get-shape file :copy-child))
layout-updates (collect-layout-updates store)
events [(dwl/sync-file (:id file) (:id file)
:components (cthi/id :component1))]]
(ths/run-store
store done events
(fn [_]
(t/is (empty? @resize-calls)
"a copy turned fixed by the sync is not re-measured")
(t/is (not-any? #(and (= page-id (:page-id %))
(some #{copy-id} (:ids %)))
@layout-updates)
"and gets no layout update for a re-measure"))))))
(defn- sync-remeasures
"Sync the copy after `change-main` and call `check` with the re-measure
requests."
[done change-main check]
(let [file (change-main (setup-file :grow-type :auto-height))
store (ths/setup-store file)
events [(dwl/sync-file (:id file) (:id file)
:components (cthi/id :component1))]]
(ths/run-store store done events (fn [_] (check @resize-calls)))))
(t/deftest test-sync-file-skips-remeasure-for-fill-change
(t/async
done
(sync-remeasures done recolor-main-text
(fn [calls]
(t/is (empty? calls)
"a text color change does not change its size")))))
(t/deftest test-sync-file-skips-remeasure-for-opacity-change
(t/async
done
(sync-remeasures done fade-main-text
(fn [calls]
(t/is (empty? calls)
"an opacity change does not change the text size")))))
(t/deftest test-sync-file-remeasures-auto-height-text-on-font-change
(t/async
done
(sync-remeasures done bump-main-font-size
(fn [calls]
(t/is (= 1 (count calls))
"a font change can change the text size")))))
(t/deftest test-sync-file-remeasures-auto-height-text-on-width-change
(t/async
done
(sync-remeasures done widen-main-text
(fn [calls]
(t/is (= 1 (count calls))
"a wider auto-height text can wrap into fewer lines")))))

View File

@ -7,7 +7,10 @@
(ns frontend-tests.data.workspace-texts-test
(:require
[app.common.geom.rect :as grc]
[app.common.test-helpers.components :as cthc]
[app.common.test-helpers.compositions :as ctho]
[app.common.test-helpers.files :as cthf]
[app.common.test-helpers.ids-map :as cthi]
[app.common.test-helpers.shapes :as cths]
[app.common.types.modifiers :as ctm]
[app.common.types.shape :as cts]
@ -19,8 +22,16 @@
[beicon.v2.core :as rx]
[cljs.test :as t :include-macros true]
[frontend-tests.helpers.state :as ths]
[frontend-tests.helpers.wasm :as thw]
[potok.v2.core :as ptk]))
(t/use-fixtures :each
{:before (fn []
(cthi/reset-idmap!)
(thw/setup-wasm-mocks!))
:after (fn []
(thw/teardown-wasm-mocks!))})
;; ---------------------------------------------------------------------------
;; Helpers
;; ---------------------------------------------------------------------------
@ -313,6 +324,39 @@
(= :app.main.data.workspace.shapes/update-shapes (ptk/type %)))
@events))))
;; Scenario: finalize an auto-grow text edit on a component copy under
;; render-wasm/v1. Proves: content is committed and the auto-resize does
;; not mark :geometry-group (so later main font-size sync can still size
;; the box). See #12721.
(t/deftest finalize-auto-grow-copy-skips-geometry-touched
(t/async
done
(let [file (-> (cthf/sample-file :file1)
(ctho/add-frame-with-text :main-root :main-child "hello world")
(cthc/make-component :component1 :main-root)
(cthc/instantiate-component :component1 :copy-root
{:children-labels [:copy-child]}))
copy (cths/get-shape file :copy-child)
copy-id (:id copy)
store (ths/setup-store file)
mid (txt/change-text (:content copy) "typing")
final (txt/change-text (:content copy) "changed")
;; Non-finalize first so session geom is stored; otherwise finalize
;; is treated as a no-op and skips the geometry commit path.
events [(dwt/v2-update-text-shape-content copy-id mid :finalize? false)
(dwt/v2-update-text-shape-content copy-id final :finalize? true)]]
(ths/run-store
store done events
(fn [new-state]
(let [file' (ths/get-file-from-state new-state)
copy' (cths/get-shape file' :copy-child)
text' (get-in copy' [:content :children 0 :children 0 :children 0 :text])]
(t/is (= "changed" text')
"finalize must commit the edited content")
(t/is (not (contains? (:touched copy') :geometry-group))
"auto-grow finalize must not mark :geometry-group on a component copy")))))))
(t/deftest add-typography-normalises-float-line-height
(t/async
done

View File

@ -14,6 +14,7 @@
[app.main.data.changes :as dch]
[app.main.data.comments :as dcmt]
[app.main.data.fonts :as df]
[app.main.data.helpers :as dsh]
[app.main.data.workspace :as dw]
[app.main.data.workspace.undo :as dwu]
[beicon.v2.core :as rx]
@ -21,6 +22,7 @@
[frontend-tests.helpers.async :as async]
[frontend-tests.helpers.mock :as mock]
[frontend-tests.helpers.state :as ths]
[frontend-tests.tokens.helpers.state :as tohs]
[potok.v2.core :as ptk]))
(t/use-fixtures :each {:before cthi/reset-idmap!})
@ -159,6 +161,177 @@
(t/is (= 1 (count (get-in state [:workspace-undo :items]))))
(t/is (= #{g1 g2} (get-in state [:workspace-undo :items 0 :undo-groups])))))
;; Scenario: a commit stacks onto the last history entry. Proves: it takes
;; that entry's undo group, so the commits it starts (e.g. a component sync)
;; inherit it, and one undo reverts the whole action.
(t/deftest a-stacked-commit-takes-the-undo-group-of-its-entry
(t/async
done
(let [group (uuid/next)]
(run-commits done
(fn [page-id]
[#(assoc % :workspace-undo {:items [(entry page-id "A" group)] :index 0})
(rename-page page-id "B" :stack-undo? true)])
(fn [groups _]
(t/is (= [group] groups)))))))
;; Scenario: after an undo, the undo index sits below the end of the history
;; when a commit stacks onto it. Proves: the commit takes the group of the
;; entry at the index, where `append-undo` stacks it, not the group of the
;; undone entry at the end.
(t/deftest a-stacked-commit-after-an-undo-takes-the-group-of-the-entry-at-the-index
(t/async
done
(let [[group-a group-b] (repeatedly 2 uuid/next)]
(run-commits done
(fn [page-id]
[#(assoc % :workspace-undo {:items [(entry page-id "A" group-a)
(entry page-id "B" group-b)]
:index 0})
(rename-page page-id "C" :stack-undo? true)])
(fn [groups _]
(t/is (= [group-a] groups)))))))
;; Scenario: a commit stacks onto an empty undo history. Proves: with no
;; entry to join, it gets a group of its own.
(t/deftest a-stacked-commit-on-an-empty-history-gets-its-own-undo-group
(t/async
done
(run-commits done
(fn [page-id]
[#(assoc % :workspace-undo {})
(rename-page page-id "A" :stack-undo? true)])
(fn [[group :as groups] _]
(t/is (= 1 (count groups)))
(t/is (some? group))))))
;; Scenario: the user edits the font size of a main text, which then resizes
;; itself in its own undo transaction with a stacked commit (`resize-text`).
;; Proves: the resize takes the group of the user's edit, not the one the
;; transaction was opened with. Before, the component sync that the resize
;; starts got a group of its own, and the first Ctrl+Z undid only that sync.
(t/deftest a-stacked-commit-in-an-empty-transaction-takes-the-group-of-its-entry
(t/async
done
(let [group (uuid/next)
tx (js/Symbol)]
(run-commits done
(fn [page-id]
[#(assoc % :workspace-undo {:items [(entry page-id "A" group)] :index 0})
(dwu/start-undo-transaction tx)
(rename-page page-id "B" :stack-undo? true)
(dwu/commit-undo-transaction tx)])
(fn [groups _]
(t/is (= [group] groups)))))))
;; Scenario: an open transaction already holds changes when a stacked commit
;; arrives. Proves: the stacked commit joins the transaction and its group,
;; not the group of the last history entry.
(t/deftest a-stacked-commit-in-a-transaction-with-changes-takes-its-group
(t/async
done
(let [[entry-group tx-group] (repeatedly 2 uuid/next)]
(run-commits done
(fn [page-id]
(let [held (entry page-id "B" tx-group)]
[#(assoc % :workspace-undo
{:items [(entry page-id "A" entry-group)]
:index 0
:transaction (select-keys held [:undo-changes :redo-changes :undo-group])})
(rename-page page-id "C" :stack-undo? true)]))
(fn [groups _]
(t/is (= [tx-group] groups)))))))
;; Scenario: an automatic heal commits with `:stack-undo? true` and
;; `:save-undo? false` (the auto-grow text heals). Proves: it does not take
;; the group of the user's last action, the rollback unit, since it never
;; joins that history entry. Inside an empty transaction it takes the
;; transaction's group.
(t/deftest a-stacked-commit-without-undo-keeps-its-own-undo-group
(t/async
done
(let [group (uuid/next)
tx (js/Symbol)
tx-group (atom nil)
spy (ptk/reify ::spy-heal-transaction
ptk/EffectEvent
(effect [_ state _]
(reset! tx-group (get-in state [:workspace-undo :transaction :commit-group]))))]
(run-commits done
(fn [page-id]
[#(assoc % :workspace-undo {:items [(entry page-id "A" group)] :index 0})
(rename-page page-id "B" :stack-undo? true :save-undo? false)
(dwu/start-undo-transaction tx)
spy
(rename-page page-id "C" :stack-undo? true :save-undo? false)
(dwu/commit-undo-transaction tx)])
(fn [[heal-group tx-heal-group] _]
(t/is (some? heal-group))
(t/is (not= group heal-group))
(t/is (= @tx-group tx-heal-group)))))))
(defn- run-edit-resize-and-sync
"Runs the user's edit of a main text (rename to A), its resize in its own
undo transaction with a stacked commit (B) and the component sync the
resize starts (C), which inherits the resize's group. Then runs
`then-events` and calls `check` with the page id and the final state."
[done then-events check]
(let [file (cthf/sample-file :file1 :page-label :page1)
page-id (cthf/current-page-id file)
store (ths/setup-store file)
last-group (atom nil)
sub (->> (ptk/input-stream store)
(rx/filter dch/commit?)
(rx/subs! #(reset! last-group (:undo-group (deref %)))))
tx (js/Symbol)
;; The component sync: commits with the group of the commit it
;; follows, as `component-changed` does
sync (ptk/reify ::sync
ptk/WatchEvent
(watch [_ _ _]
(rx/of (rename-page page-id "C"
:undo-changes [{:type :mod-page :id page-id :name "B"}]
:undo-group @last-group))))]
(ths/run-store store done
(concat [(tohs/watch-undo-stack)
(rename-page page-id "A")
(dwu/start-undo-transaction tx)
(rename-page page-id "B"
:undo-changes [{:type :mod-page :id page-id :name "A"}]
:stack-undo? true)
(dwu/commit-undo-transaction tx)
sync]
then-events)
(fn [state]
(rx/dispose! sub)
(check page-id state)))))
;; Scenario: the user edits a main text; the text resizes itself in its own
;; undo transaction with a stacked commit, and that resize starts a component
;; sync that inherits the resize's group. Proves: one Ctrl+Z reverts the
;; edit, the resize and the sync. Before, the sync was an undo entry of its
;; own and the first Ctrl+Z undid only the sync.
(t/deftest one-undo-reverts-an-edit-its-stacked-resize-and-their-sync
(t/async
done
(run-edit-resize-and-sync done
[dwu/undo]
(fn [page-id state]
(t/is (= 2 (count (get-in state [:workspace-undo :items]))))
(t/is (= -1 (get-in state [:workspace-undo :index])))
(t/is (= "Page 1" (:name (dsh/lookup-page state page-id))))))))
;; Scenario: the same action as above is undone and then redone. Proves: one
;; redo restores the edit, the resize and the sync together.
(t/deftest one-redo-restores-an-edit-its-stacked-resize-and-their-sync
(t/async
done
(run-edit-resize-and-sync done
[dwu/undo dwu/redo]
(fn [page-id state]
(t/is (= 1 (get-in state [:workspace-undo :index])))
(t/is (= "C" (:name (dsh/lookup-page state page-id))))))))
;; Scenario: the user presses Ctrl+Z on a page rename. Proves: the commit it
;; makes can be undone (its undo changes redo the rename) and names the index
;; the history moved from, so a rollback can put both back.

View File

@ -0,0 +1,224 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS SUBSIDIARY SL
(ns frontend-tests.render-wasm.stale-text-selrects-test
"A page load must check every auto-grow text whose stored size no longer
matches its WASM layout, not only the texts that waited for a font. A copy
synced while its page was closed keeps the main's size otherwise."
(:require
[app.common.render-wasm.serialize-shape :as serialize-shape]
[app.common.render-wasm.wasm :as wasm]
[app.common.uuid :as uuid]
[app.main.store :as st]
[app.render-wasm.api :as wasm.api]
[app.render-wasm.api.fonts :as wasm.fonts]
[app.util.timers :as timers]
[beicon.v2.core :as rx]
[cljs.test :as t :include-macros true]
[frontend-tests.helpers.async :as async]
[frontend-tests.helpers.mock :as mock]
[potok.v2.core :as ptk]
[promesa.core :as p]))
(defn- text-shape
([grow-type width height]
(text-shape grow-type width height nil))
([grow-type width height attrs]
(merge {:id (uuid/next)
:type :text
:parent-id uuid/zero
:grow-type grow-type
:width width
:height height
:selrect {:x 0 :y 0 :width width :height height}}
attrs)))
(defn- rect-shape
[]
{:id (uuid/next) :type :rect :parent-id uuid/zero})
(defn- page-objects
[& shapes]
(into {uuid/zero {:id uuid/zero
:type :frame
:parent-id uuid/zero
:shapes (mapv :id shapes)}}
(map (juxt :id identity))
shapes))
(defn- stale-selrect-ids
"Ids carried by the stale-selrect events among `events`."
[events]
(into #{}
(comp (filter #(= :app.render-wasm.api/stale-text-selrects (ptk/type %)))
(mapcat (comp :ids deref)))
events))
(defn- no-pending-fonts
"Host attrs of a shape whose fonts are all loaded."
[& _]
{:thumbnails [] :full [] :font-face-keys #{} :pending-font-face-keys #{}})
(defn- run-with-wasm
"Run `f` with the WASM boundaries mocked and resolve to the events emitted
to the store. `dims` maps shape id to its measured layout size,
`host-attrs` stands in for the per-shape upload, `failed-faces` holds the
font faces that failed to load and `process-pending` replaces the pending
fetches (a no-op unless given). `f` may return a promise, which is
awaited."
[{:keys [dims host-attrs failed-faces process-pending]} f]
(let [emitted (atom [])
host-attrs (or host-attrs no-pending-fonts)
process-pending (or process-pending (mock/stub (constantly nil)))]
(->> (mock/with-mocks*
{wasm/live? (mock/stub (constantly true))
wasm/internal-module #js {"_set_view_end" (fn [& _] nil)
"_begin_loading" (fn [& _] nil)
"_end_loading" (fn [& _] nil)
"_update_shape_text_layout_for" (fn [& _] nil)
"_force_update_shape_text_layout_for" (fn [& _] nil)}
serialize-shape/serialize-shapes-batch (mock/stub (fn [shapes _] shapes))
;; Private: the only seam that feeds the font state of the load.
#_{:clj-kondo/ignore [:private-call]}
wasm.api/set-object-host-attrs host-attrs
wasm.api/process-pending process-pending
wasm.api/request-render (mock/stub (constantly nil))
wasm.api/get-text-dimensions (mock/stub (fn [id] (get dims id)))
wasm.fonts/font-failed? (mock/stub #(contains? (or failed-faces #{}) %))
wasm.api/listen-tiles-render-complete-once! (mock/stub (fn [f] (f)))
timers/schedule-on-idle mock/schedule-on-idle-mock
st/emit! (mock/stub (fn [& events] (swap! emitted into events) nil))}
(await (f))
(await (async/settle)))
(p/fmap (fn [_] @emitted)))))
(defn- load-page
"Load `objects` through `wasm.api/set-objects`, forcing the sync path used
by small pages."
([objects dims]
(load-page objects dims nil))
([objects dims host-attrs]
(load-page objects dims host-attrs #{}))
([objects dims host-attrs failed-faces]
(run-with-wasm {:dims dims :host-attrs host-attrs :failed-faces failed-faces}
#(wasm.api/set-objects objects nil nil true))))
(defn- load-large-page
"Load `objects` through `wasm.api/set-objects` without forcing, so a page
with enough shapes takes the chunked async path. Resolves once the load
has rendered."
[objects dims]
(run-with-wasm {:dims dims}
#(let [rendered (p/deferred)]
(wasm.api/set-objects objects (fn [] (p/resolve rendered nil)) nil false)
rendered)))
(t/deftest ^:async page-load-requests-resize-for-stale-auto-height-text
(let [text (text-shape :auto-height 100 17)
events (await (load-page (page-objects text)
{(:id text) {:width 100 :height 34}}))]
(t/is (= #{(:id text)} (stale-selrect-ids events))
"the text stored at the main's height is resized on page load")))
(t/deftest ^:async large-page-load-requests-resize-for-stale-text
(let [text (text-shape :auto-height 100 17)
shapes (conj (vec (repeatedly (dec wasm.api/ASYNC_THRESHOLD) rect-shape)) text)
events (await (load-large-page (apply page-objects shapes)
{(:id text) {:width 100 :height 34}}))]
(t/is (= #{(:id text)} (stale-selrect-ids events))
"a page loaded in chunks checks its texts too")))
(t/deftest ^:async page-load-ignores-sub-pixel-gaps
(let [text (text-shape :auto-width 100 17)
events (await (load-page (page-objects text)
{(:id text) {:width 100.5 :height 17.5}}))]
(t/is (empty? (stale-selrect-ids events))
"rounding differences between renderers do not trigger a resize")))
(t/deftest ^:async page-load-skips-fixed-text
(let [text (text-shape :fixed 100 17)
events (await (load-page (page-objects text)
{(:id text) {:width 100 :height 34}}))]
(t/is (empty? (stale-selrect-ids events))
"fixed text boxes are never resized to their layout")))
(t/deftest ^:async page-load-skips-axes-that-fill-their-layout-parent
(let [fill-width (text-shape :auto-width 200 17 {:layout-item-h-sizing :fill})
fill-height (text-shape :auto-height 100 40 {:layout-item-v-sizing :fill})
events (await (load-page (page-objects fill-width fill-height)
{(:id fill-width) {:width 44 :height 17}
(:id fill-height) {:width 100 :height 17}}))]
(t/is (empty? (stale-selrect-ids events))
"a size set by the layout is not stale")))
(t/deftest ^:async page-load-checks-the-axis-that-does-not-fill
(let [text (text-shape :auto-width 200 17 {:layout-item-h-sizing :fill})
events (await (load-page (page-objects text)
{(:id text) {:width 44 :height 34}}))]
(t/is (= #{(:id text)} (stale-selrect-ids events))
"the height of a fill-width auto-width text still grows with its content")))
(t/deftest ^:async page-load-skips-texts-waiting-for-a-font
(let [waiting (text-shape :auto-height 100 17)
ready (text-shape :auto-height 100 17)
events (await (load-page
(page-objects waiting ready)
{(:id waiting) {:width 100 :height 34}
(:id ready) {:width 100 :height 34}}
;; One of the two stale texts uses a face still loading.
(fn [shape & _]
(if (= (:id shape) (:id waiting))
{:thumbnails [] :full []
:font-face-keys #{"font-key"}
:pending-font-face-keys #{"font-key"}}
(no-pending-fonts)))))]
(t/is (= #{(:id ready)} (stale-selrect-ids events))
"a text waiting for a font is not checked when the page loads")))
(t/deftest ^:async page-load-skips-texts-using-a-failed-font
(let [failed (text-shape :auto-height 100 17)
ready (text-shape :auto-height 100 17)
events (await (load-page
(page-objects failed ready)
{(:id failed) {:width 100 :height 34}
(:id ready) {:width 100 :height 34}}
;; WASM counts the failed face as ready and lays the
;; text out with a fallback font.
(fn [shape & _]
(if (= (:id shape) (:id failed))
{:thumbnails [] :full []
:font-face-keys #{"failed-key"}
:pending-font-face-keys #{}}
(no-pending-fonts)))
#{"failed-key"}))]
(t/is (= #{(:id ready)} (stale-selrect-ids events))
"a text measured with a fallback font keeps its stored size")))
(t/deftest ^:async pending-shape-updates-do-not-check-text-sizes
(let [text (text-shape :auto-height 100 17)
events (await (run-with-wasm
{:dims {(:id text) {:width 100 :height 34}}
:process-pending wasm.api/process-pending}
#(wasm.api/process-pending [text] [] [] {} nil)))]
(t/is (empty? (stale-selrect-ids events))
"shape updates while editing do not resize texts to their layout")))
(t/deftest ^:async font-load-skips-texts-whose-font-failed
(let [failed (text-shape :auto-height 100 17)
loaded (text-shape :auto-height 100 17)
font-state {:font-index {"failed-key" #{(:id failed)}
"loaded-key" #{(:id loaded)}}
:pending-faces #{"failed-key" "loaded-key"}}
;; A pending fetch, so the font relayout runs once it completes.
full [{:key "font" :callback #(rx/of nil)}]
events (await (run-with-wasm
{:dims {(:id failed) {:width 100 :height 34}
(:id loaded) {:width 100 :height 34}}
:failed-faces #{"failed-key"}
:process-pending wasm.api/process-pending}
#(wasm.api/process-pending [failed loaded] [] full font-state nil)))]
(t/is (= #{(:id loaded)} (stale-selrect-ids events))
"a text laid out with a fallback font after its face failed keeps its stored size")))

View File

@ -42,6 +42,7 @@
[frontend-tests.data.workspace-comments-test]
[frontend-tests.data.workspace-context-menu-test]
[frontend-tests.data.workspace-focus-test]
[frontend-tests.data.workspace-heal-undo-test]
[frontend-tests.data.workspace-interactions-test]
[frontend-tests.data.workspace-layout-other-page-test]
[frontend-tests.data.workspace-libraries-link-test]
@ -54,6 +55,7 @@
[frontend-tests.data.workspace-path-edition-test]
[frontend-tests.data.workspace-reflow-test]
[frontend-tests.data.workspace-shortcuts-test]
[frontend-tests.data.workspace-sync-text-wasm-test]
[frontend-tests.data.workspace-texts-test]
[frontend-tests.data.workspace-thumbnails-test]
[frontend-tests.data.workspace-thumbnails-wasm-test]
@ -127,6 +129,7 @@
[frontend-tests.render-wasm.process-objects-test]
[frontend-tests.render-wasm.serialization-test]
[frontend-tests.render-wasm.shape-proxy-test]
[frontend-tests.render-wasm.stale-text-selrects-test]
[frontend-tests.render-wasm.text-editor-apply-styles-test]
[frontend-tests.render-wasm.text-editor-caret-color-test]
[frontend-tests.render-wasm.text-editor-content-range-test]
@ -275,6 +278,7 @@
'frontend-tests.data.workspace-comments-test
'frontend-tests.data.workspace-context-menu-test
'frontend-tests.data.workspace-focus-test
'frontend-tests.data.workspace-heal-undo-test
'frontend-tests.data.workspace-interactions-test
'frontend-tests.data.workspace-layout-other-page-test
'frontend-tests.data.workspace-libraries-link-test
@ -287,6 +291,7 @@
'frontend-tests.data.workspace-path-edition-test
'frontend-tests.data.workspace-reflow-test
'frontend-tests.data.workspace-shortcuts-test
'frontend-tests.data.workspace-sync-text-wasm-test
'frontend-tests.data.workspace-texts-test
'frontend-tests.data.workspace-thumbnails-test
'frontend-tests.data.workspace-thumbnails-wasm-test
@ -359,6 +364,7 @@
'frontend-tests.render-wasm.process-objects-test
'frontend-tests.render-wasm.serialization-test
'frontend-tests.render-wasm.shape-proxy-test
'frontend-tests.render-wasm.stale-text-selrects-test
'frontend-tests.render-wasm.text-editor-apply-styles-test
'frontend-tests.render-wasm.text-editor-caret-color-test
'frontend-tests.render-wasm.text-editor-content-range-test

View File

@ -7,16 +7,25 @@
(ns frontend-tests.ui.viewport-texts-html-test
"How the SVG renderer measures text shapes and commits the result."
(:require
["jsdom" :refer [JSDOM]]
["react" :as react]
["react-dom" :as rd]
["react-dom/client" :as rdc]
[app.common.geom.point :as gpt]
[app.common.uuid :as uuid]
[app.main.data.workspace.reflow :as wrf]
[app.main.data.workspace.texts :as dwt]
[app.main.store :as st]
[app.main.ui.shapes.text.html-text :as html]
[app.main.ui.workspace.shapes.text.viewport-texts-html :as vth]
[app.util.dom :as dom]
[app.util.text-svg-position :as tsp]
[cljs.test :as t :include-macros true]
[frontend-tests.helpers.async :as async]
[frontend-tests.helpers.mock :as mock]
[potok.v2.core :as ptk]
[promesa.core :as p]))
[promesa.core :as p]
[rumext.v2 :as mf]))
(def ^:private fixed-text
{:id (uuid/next) :type :text :grow-type :fixed})
@ -25,8 +34,10 @@
"Measure `shape` as the SVG renderer does and return the measurement
promise. Kept out of the `^:async` test bodies: there, a call through the
var compiles to an awaited wrapper that would wait for the measurement."
[shape]
(#'vth/update-text-shape shape nil))
([shape]
(measure-text shape nil nil))
([shape node phase]
(#'vth/update-text-shape shape node phase)))
(defn- with-measurement
"Run `f` with the text measurement mocked to `measurement`, a promise the
@ -69,3 +80,286 @@
(p/reject measurement (ex-info "measure failed" {}))
(t/is (nil? (await result))
"a failed measurement resolves to nil")))))))
(def ^:private fragment
"A position-data fragment inside the box of `text`."
{:x 0 :y 17 :width 100 :height 17 :text "label"})
(defn- text
[grow-type touched]
{:id (uuid/next) :type :text :grow-type grow-type :touched touched
:x 0 :y 0 :width 200 :height 17
:points [(gpt/point 0 0) (gpt/point 200 0) (gpt/point 200 17) (gpt/point 0 17)]
:position-data [fragment]})
(defn- by-id
[& shapes]
(into {} (map (juxt :id identity)) shapes))
(defn- in-copy
[shape]
(assoc shape :shape-ref (uuid/next)))
(t/deftest copy-heal-phases-checks-auto-grow-texts-in-copies
(let [fixed (in-copy (text :fixed #{:content-group}))
unknown (in-copy (text nil #{:content-group}))
main (text :auto-height #{:content-group})
untouched (in-copy (text :auto-height nil))
geometry (in-copy (text :auto-height #{:geometry-group}))
override (in-copy (text :auto-width #{:content-group}))]
(t/is (= {(:id untouched) :check
(:id geometry) :check
(:id override) :check}
(vth/copy-heal-phases (by-id fixed unknown main untouched geometry override)))
(str "every auto-grow text in a copy is checked, also one nested in a "
"main that overrides it, which has no touched flag of its own; "
"texts of a main and fixed texts are not"))))
(t/deftest unchanged-copy-is-measured-in-the-check-phase
(let [copy (text :auto-height #{:content-group})]
(t/is (vth/text-changed? copy copy :check)
"an unchanged copy waiting for its check is measured")
(t/is (not (vth/text-changed? copy copy nil))
"once checked, an unchanged copy is left alone")
(t/is (not (vth/text-changed? copy copy :settle))
"a copy waiting to settle is measured only once its heal resize changes it")))
(defn- measure-with-box
"Measure `shape` in heal `phase` with its layout box measured at `width` x
`height`. Resolves to the events emitted to the store and the next heal
phase. The resize and position-data requests are recorded as `::resize`
and `::position-data` events carrying their options."
([shape phase width height]
(measure-with-box shape phase width height [fragment]))
([shape phase width height position-data]
(let [emitted (atom [])
record (fn [type] (fn [& args] (ptk/data-event type {:opts (last args)})))]
(->> (mock/with-mocks*
{tsp/calc-position-data (mock/stub (constantly (p/resolved position-data)))
dom/query (mock/stub (constantly #js {}))
dom/get-bounding-rect (mock/stub (constantly {:width width :height height}))
dwt/resize-text (mock/stub (record ::resize))
dwt/update-position-data (mock/stub (record ::position-data))
st/emit! (mock/stub (fn [& events] (swap! emitted into events) nil))}
(await (measure-text shape #js {} phase)))
(p/fmap (fn [next-phase] {:events @emitted :next next-phase}))))))
(defn- committed
"Options of the `type` request among `events`, `::none` if there is none."
[type events]
(or (some #(when (= type (ptk/type %)) (or (:opts (deref %)) {})) events)
::none))
(def ^:private no-undo {:save-undo? false})
(t/deftest ^:async check-phase-heals-a-drifted-copy-without-undo
(let [{:keys [events next]}
(await (measure-with-box (text :auto-height #{:content-group}) :check 200 34))]
(t/is (= no-undo (committed ::resize events))
"a copy measured taller than its stored box is resized, with no undo step")
(t/is (= no-undo (committed ::position-data events))
"its position-data is written with the new layout, with no undo step")
(t/is (= :settle next)
"the measurement caused by the resize belongs to the heal")))
(t/deftest ^:async check-phase-leaves-a-matching-copy-alone
(let [{:keys [events next]}
(await (measure-with-box (text :auto-height #{:content-group}) :check 200 17.4))]
(t/is (= ::none (committed ::resize events))
"a copy that matches its stored box is not resized")
(t/is (= ::none (committed ::position-data events))
"nor is its position-data written back")
(t/is (some #(= ::dwt/clean-text-modifier (ptk/type %)) events)
"the measurement still completes")
(t/is (nil? next)
"the heal ends")))
(t/deftest ^:async check-phase-heals-a-copy-without-position-data
(let [copy (assoc (text :auto-height #{:content-group}) :position-data nil)
{:keys [events next]} (await (measure-with-box copy :check 200 17.4))]
(t/is (= no-undo (committed ::position-data events))
"a copy that lost its position-data in a sync gets it back, with no undo step")
(t/is (= ::none (committed ::resize events))
"a copy whose size did not drift is not resized")
(t/is (nil? next)
"nothing resizes it, so the heal ends")))
(t/deftest ^:async check-phase-heals-a-drifted-copy-without-position-data
(let [copy (assoc (text :auto-height #{:content-group}) :position-data nil)
{:keys [events next]} (await (measure-with-box copy :check 200 34))]
(t/is (= no-undo (committed ::resize events))
"a drifted copy without position-data is resized, with no undo step")
(t/is (= no-undo (committed ::position-data events))
"and gets its position-data back, with no undo step")
(t/is (= :settle next)
"the measurement caused by the resize belongs to the heal")))
(t/deftest ^:async check-phase-commits-nothing-when-it-cannot-measure
(let [{:keys [events]}
(await (measure-with-box (text :auto-height #{:content-group}) :check 0 0))]
(t/is (= ::none (committed ::resize events))
"an empty layout box is not a size")
(t/is (= ::none (committed ::position-data events))
"nothing is written for a text that could not be measured")))
(t/deftest ^:async settle-phase-commits-without-undo
(let [{:keys [events next]}
(await (measure-with-box (text :auto-height #{:content-group}) :settle 200 34))]
(t/is (= no-undo (committed ::resize events))
"the measurement after a heal resize records no undo step")
(t/is (= no-undo (committed ::position-data events))
"nor does its position-data")
(t/is (nil? next)
"the heal ends")))
(t/deftest ^:async no-phase-commits-as-usual
(let [{:keys [events next]}
(await (measure-with-box (text :auto-height nil) nil 200 17.4))]
(t/is (= {} (committed ::resize events))
"outside a heal, a size within 1px is still committed, with undo")
(t/is (= {} (committed ::position-data events))
"and so is the position-data")
(t/is (nil? next))))
(def ^:private fallback-font-position-data
"Position-data measured with a font that failed to load."
(with-meta [fragment] {::tsp/font-failed true}))
(t/deftest font-failed-reads-the-measurement-mark
(t/is (tsp/font-failed? fallback-font-position-data))
(t/is (not (tsp/font-failed? [fragment]))))
(t/deftest ^:async check-phase-writes-no-size-from-a-fallback-font
(let [{:keys [events next]}
(await (measure-with-box (text :auto-height #{:content-group}) :check 200 34
fallback-font-position-data))]
(t/is (= ::none (committed ::resize events))
"a size laid out with a fallback font is not written on page open")
(t/is (= ::none (committed ::position-data events))
"nor its position-data")
(t/is (nil? next)
"the heal ends")))
(t/deftest ^:async check-phase-restores-position-data-with-a-fallback-font
(let [copy (assoc (text :auto-height #{:content-group}) :position-data nil)
{:keys [events]}
(await (measure-with-box copy :check 200 34 fallback-font-position-data))]
(t/is (= no-undo (committed ::position-data events))
"a copy without position-data still gets it, with no undo step")
(t/is (= ::none (committed ::resize events))
"but its size is not written")))
(t/deftest ^:async no-phase-commits-a-fallback-font-size-as-usual
(let [{:keys [events]}
(await (measure-with-box (text :auto-height nil) nil 200 34
fallback-font-position-data))]
(t/is (= {} (committed ::resize events))
"outside a heal, the measured size is committed as before")))
;; The heal phases through the mounted renderer: a text is measured when it
;; mounts, and how often it mounts depends on its phase.
(def ^:private measured-text
"Stands in for `html/text-shape*`: a node to measure, with no content."
(react/forwardRef
(fn [_props ref]
(react/createElement "div" #js {:ref ref :className "measured-text"}))))
(defn- next-immediate
"Resolves after the tasks React's scheduler queued with `setImmediate`
so far have run."
[]
(js/Promise. (fn [resolve] (js/setImmediate resolve))))
(defn- mount-text-changes
"Mount `text-changes-renderer` in a jsdom document. Returns `:render`,
which renders it with a map of text shapes, `:measuring`, the number of
texts mounted to be measured, `:errors`, what React reported, and
`:unmount`, which resolves once React's scheduler has run. react-dom
reads the global `window`, so the jsdom one stays installed until then."
[]
(let [errors (atom [])
on-error (fn [error _info] (swap! errors conj error))
window (.-window (JSDOM. "<!doctype html><div id=\"root\"></div>"))
container (.getElementById (.-document window) "root")
root (rdc/createRoot container #js {:onUncaughtError on-error
:onCaughtError on-error
:onRecoverableError on-error})
previous (.-window js/globalThis)]
(set! (.-window js/globalThis) window)
{:render (fn [shapes]
(rd/flushSync
#(.render root (mf/element vth/text-changes-renderer
#js {"text-shapes" shapes}))))
:measuring #(.-length (.querySelectorAll container ".measured-text"))
:errors #(deref errors)
:unmount (fn []
(rd/flushSync #(.unmount root))
(p/finally (next-immediate)
#(set! (.-window js/globalThis) previous)))}))
(defn- with-text-changes
"Run `(f mount counts)` with `text-changes-renderer` mounted and every
text measured `height` px tall. `counts` returns the number of
measurements so far and the options of each resize request. Resolves
once `f` settles and the renderer is unmounted."
[height f]
(let [measures (atom 0)
resizes (atom [])]
(mock/with-mocks*
{tsp/calc-position-data (mock/stub (fn [_id]
(swap! measures inc)
(p/resolved [fragment])))
dom/query (mock/stub (constantly #js {}))
dom/get-bounding-rect (mock/stub (constantly {:width 200 :height height}))
dwt/resize-text (mock/stub (fn [& args]
(swap! resizes conj (last args))
(ptk/data-event ::resize {})))
dwt/update-position-data (mock/stub (fn [& _] (ptk/data-event ::position-data {})))
wrf/run-pending! (mock/stub (fn [_kind _ids f] (f)))
html/text-shape* measured-text
st/emit! (mock/stub (constantly nil))}
(let [mount (mount-text-changes)
counts (fn [] {:measures @measures :resizes @resizes})]
(await (f mount counts))
(await ((:unmount mount)))))))
(t/deftest ^:async drifted-copy-is-measured-once-to-check-and-once-to-settle
(let [copy (in-copy (text :auto-height nil))
resized (assoc copy :height 34)]
(await
(with-text-changes
34
(^:async fn [{:keys [render measuring errors]} counts]
(render (by-id copy))
(await (async/wait-for #(zero? (measuring)) "the check measurement ends"))
(t/is (= {:measures 1 :resizes [no-undo]} (counts))
"the check measures the copy once and resizes it, with no undo step")
(render (by-id resized))
(await (async/wait-for #(zero? (measuring)) "the settle measurement ends"))
(t/is (= {:measures 2 :resizes [no-undo no-undo]} (counts))
"the heal resize measures it once more, with no undo step")
(render (by-id resized))
(await (async/settle))
(t/is (= 2 (:measures (counts)))
"once settled, the copy is not measured again")
(t/is (empty? (errors))))))))
(t/deftest ^:async matching-copy-is-measured-once
(let [copy (in-copy (text :auto-height nil))]
(await
(with-text-changes
17.4
(^:async fn [{:keys [render measuring errors]} counts]
(render (by-id copy))
(await (async/wait-for #(zero? (measuring)) "the check measurement ends"))
(t/is (= {:measures 1 :resizes []} (counts))
"the check measures the copy once and leaves its size alone")
(render (by-id copy))
(await (async/settle))
(t/is (= 1 (:measures (counts)))
"once checked, the copy is not measured again")
(t/is (empty? (errors))))))))

View File

@ -15,18 +15,18 @@
"test:watch:e2e": "vitest --browser"
},
"devDependencies": {
"@playwright/test": "1.63.0",
"@types/node": "^26.6.3",
"@vitest/browser": "^5.0.2",
"@vitest/coverage-v8": "^5.0.2",
"@vitest/ui": "^5.0.2",
"@playwright/test": "1.65.1",
"@types/node": "^26.6.6",
"@vitest/browser": "^5.1.1",
"@vitest/coverage-v8": "^5.1.1",
"@vitest/ui": "^5.1.1",
"canvas": "^3.2.3",
"esbuild": "^0.28.0",
"jsdom": "^30.0.1",
"playwright": "1.63.0",
"prettier": "^3.9.6",
"vite": "^8.2.0",
"vitest": "^5.0.2"
"jsdom": "^31.0.1",
"playwright": "1.65.1",
"prettier": "^3.10.1",
"vite": "^8.3.8",
"vitest": "^5.1.1"
},
"packageManager": "pnpm@12.21.0+sha512.66fd8278ee28935ce951792d34367ff3af5c432a2756445823029533835b8da529bbe0be5130afd56ed0713fb8789e47bad82d93bd5ae2fe54b15562d6276ef0"
}

View File

@ -34,9 +34,9 @@
"watch": "pnpm run clear:shadow-cache && clojure -M:dev:shadow-cljs watch library"
},
"devDependencies": {
"@types/node": "^26.6.4",
"@types/node": "^26.6.6",
"@zip.js/zip.js": "2.8.34",
"concurrently": "^10.0.5",
"concurrently": "^10.0.7",
"date-fns": "^4.4.0",
"nodemon": "^3.1.14",
"source-map-support": "^0.5.21"

36
library/pnpm-lock.yaml generated
View File

@ -182,14 +182,14 @@ importers:
.:
devDependencies:
'@types/node':
specifier: ^26.6.4
version: 26.6.4
specifier: ^26.6.6
version: 26.6.6
'@zip.js/zip.js':
specifier: 2.8.34
version: 2.8.34(patch_hash=7b556bbd426f152eb086f0126a53900e369a95cf64357c380b7c8d8e940c3d95)
concurrently:
specifier: ^10.0.5
version: 10.0.5
specifier: ^10.0.7
version: 10.0.7
date-fns:
specifier: ^4.4.0
version: 4.4.0
@ -202,15 +202,15 @@ importers:
packages:
'@types/node@26.6.4':
resolution: {integrity: sha512-ldVPDCzj7fsaGZrLB0NuHuTvJcsNasysBAqMolr/cgxrLd1xbqxIr3XJiPnHHJUCxj5sNF1vnRj9aWnrVh5Jcg==}
'@types/node@26.6.6':
resolution: {integrity: sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==}
'@zip.js/zip.js@2.8.34':
resolution: {integrity: sha512-+6a3lyqq69rpseLbvDPiVIWsZ/HdTGAAD6afFtug6ECPDGttb2dHnPC6cJgdPofYkzL9OvXizegq+DQVfL2rnA==}
engines: {bun: '>=0.7.0', deno: '>=1.0.0', node: '>=18.0.0'}
ansi-regex@6.4.0:
resolution: {integrity: sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw==}
ansi-regex@6.6.0:
resolution: {integrity: sha512-XZ5apbzreCbXSKwPjJstu8R0zOi247w3XYwWxtwBXgpZrCyc1Ka7p9/xY0A9/diMewmHbEKz+FIraWaEWjlN5g==}
engines: {node: '>=12'}
ansi-styles@6.2.3:
@ -252,8 +252,8 @@ packages:
resolution: {integrity: sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==}
engines: {node: '>=20'}
concurrently@10.0.5:
resolution: {integrity: sha512-JaP/CoftUrCcAFW/g//RbgEGwlelnEae6cfBLgH6ZdO6s8jPkn6p9SB9u6pdVxYXoiSnFqseOlHfrEfF82TVOg==}
concurrently@10.0.7:
resolution: {integrity: sha512-zMCeLhawVIj3SLbpg0/BWCdJl1wcBSpcHKbNrhaM01P3xAlEWcH30Lea2q+F4uGZ7YM0scDK0dgpWyn1uCJj6w==}
engines: {node: '>=22'}
hasBin: true
@ -398,8 +398,8 @@ packages:
resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==}
hasBin: true
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
tslib@2.9.1:
resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==}
undefsafe@2.0.5:
resolution: {integrity: sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==}
@ -425,13 +425,13 @@ packages:
snapshots:
'@types/node@26.6.4':
'@types/node@26.6.6':
dependencies:
undici-types: 8.9.0
'@zip.js/zip.js@2.8.34(patch_hash=7b556bbd426f152eb086f0126a53900e369a95cf64357c380b7c8d8e940c3d95)': {}
ansi-regex@6.4.0: {}
ansi-regex@6.6.0: {}
ansi-styles@6.2.3: {}
@ -474,7 +474,7 @@ snapshots:
strip-ansi: 7.2.0
wrap-ansi: 9.0.2
concurrently@10.0.5:
concurrently@10.0.7:
dependencies:
chalk: 5.6.2
rxjs: 7.8.2
@ -557,7 +557,7 @@ snapshots:
rxjs@7.8.2:
dependencies:
tslib: 2.8.1
tslib: 2.9.1
semver@7.8.5: {}
@ -582,7 +582,7 @@ snapshots:
strip-ansi@7.2.0:
dependencies:
ansi-regex: 6.4.0
ansi-regex: 6.6.0
supports-color@10.2.2: {}
@ -598,7 +598,7 @@ snapshots:
tree-kill@1.2.2: {}
tslib@2.8.1: {}
tslib@2.9.1: {}
undefsafe@2.0.5: {}

View File

@ -25,7 +25,7 @@
},
"packageManager": "pnpm@12.21.0+sha512.66fd8278ee28935ce951792d34367ff3af5c432a2756445823029533835b8da529bbe0be5130afd56ed0713fb8789e47bad82d93bd5ae2fe54b15562d6276ef0",
"devDependencies": {
"concurrently": "^10.0.6",
"prettier": "^3.9.10"
"concurrently": "^10.0.7",
"prettier": "^3.10.1"
}
}

View File

@ -13,7 +13,7 @@
},
"devDependencies": {
"@penpot/mcp-common": "workspace:../common",
"@types/chrome": "^0.3.6",
"@types/chrome": "^0.3.7",
"esbuild": "^0.28.2",
"tsx": "^4.23.15",
"typescript": "^6.0.3"

View File

@ -19,7 +19,7 @@
"devDependencies": {
"cross-env": "^10.1.0",
"typescript": "^6.0.3",
"vite": "^8.3.5",
"vite": "^8.3.8",
"vite-live-preview": "^0.4.0"
}
}

View File

@ -29,8 +29,8 @@
},
"packageManager": "pnpm@12.21.0+sha512.66fd8278ee28935ce951792d34367ff3af5c432a2756445823029533835b8da529bbe0be5130afd56ed0713fb8789e47bad82d93bd5ae2fe54b15562d6276ef0",
"dependencies": {
"@modelcontextprotocol/node": "^2.1.1",
"@modelcontextprotocol/server": "^2.3.1",
"@modelcontextprotocol/node": "^2.1.2",
"@modelcontextprotocol/server": "^2.4.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.15.1",
"express": "^5.3.0",
@ -42,15 +42,15 @@
"pino-pretty": "^13.2.0",
"reflect-metadata": "^0.2.2",
"sharp": "^0.35.5",
"ws": "^8.22.0",
"ws": "^8.23.0",
"zod": "^4.6.7"
},
"devDependencies": {
"@modelcontextprotocol/client": "^2.3.1",
"@modelcontextprotocol/client": "^2.4.0",
"@penpot/mcp-common": "workspace:../common",
"@types/express": "^5.0.6",
"@types/js-yaml": "^4.0.9",
"@types/node": "^26.6.5",
"@types/node": "^26.6.6",
"@types/ws": "^8.18.2",
"cross-env": "^10.1.0",
"esbuild": "^0.28.1",

395
mcp/pnpm-lock.yaml generated
View File

@ -180,11 +180,11 @@ importers:
.:
devDependencies:
concurrently:
specifier: ^10.0.6
version: 10.0.6
specifier: ^10.0.7
version: 10.0.7
prettier:
specifier: ^3.9.10
version: 3.9.10
specifier: ^3.10.1
version: 3.10.1
packages/browser-extension:
devDependencies:
@ -192,8 +192,8 @@ importers:
specifier: workspace:../common
version: link:../common
'@types/chrome':
specifier: ^0.3.6
version: 0.3.6
specifier: ^0.3.7
version: 0.3.7
esbuild:
specifier: ^0.28.2
version: 0.28.2
@ -226,20 +226,20 @@ importers:
specifier: ^6.0.3
version: 6.0.3
vite:
specifier: ^8.3.5
version: 8.3.5(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15)
specifier: ^8.3.8
version: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(tsx@4.23.15)
vite-live-preview:
specifier: ^0.4.0
version: 0.4.0(vite@8.3.5(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15))
version: 0.4.0(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(tsx@4.23.15))
packages/server:
dependencies:
'@modelcontextprotocol/node':
specifier: ^2.1.1
version: 2.1.1(@modelcontextprotocol/server@2.3.1)
specifier: ^2.1.2
version: 2.1.2(@modelcontextprotocol/server@2.4.0)
'@modelcontextprotocol/server':
specifier: ^2.3.1
version: 2.3.1
specifier: ^2.4.0
version: 2.4.0
class-transformer:
specifier: ^0.5.1
version: 0.5.1
@ -272,17 +272,17 @@ importers:
version: 0.2.2
sharp:
specifier: ^0.35.5
version: 0.35.5(@types/node@26.6.5)
version: 0.35.5(@types/node@26.6.6)
ws:
specifier: ^8.22.0
version: 8.22.0
specifier: ^8.23.0
version: 8.23.0
zod:
specifier: ^4.6.7
version: 4.6.7
devDependencies:
'@modelcontextprotocol/client':
specifier: ^2.3.1
version: 2.3.1
specifier: ^2.4.0
version: 2.4.0
'@penpot/mcp-common':
specifier: workspace:../common
version: link:../common
@ -293,8 +293,8 @@ importers:
specifier: ^4.0.9
version: 4.0.9
'@types/node':
specifier: ^26.6.5
version: 26.6.5
specifier: ^26.6.6
version: 26.6.6
'@types/ws':
specifier: ^8.18.2
version: 8.18.2
@ -306,7 +306,7 @@ importers:
version: 0.28.2
ts-node:
specifier: ^10.9.2
version: 10.9.2(@types/node@26.6.5)(typescript@6.0.3)
version: 10.9.2(@types/node@26.6.6)(typescript@6.0.3)
tsx:
specifier: ^4.23.15
version: 4.23.15
@ -320,9 +320,18 @@ packages:
resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
engines: {node: '>=12'}
'@emnapi/core@2.0.0-beta.2':
resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==}
'@emnapi/runtime@1.11.3':
resolution: {integrity: sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==}
'@emnapi/runtime@2.0.0-beta.2':
resolution: {integrity: sha512-JcrSPzPvZuNZvJqPTF9Fw25LbOJ8avzFVlaf2grmH4Cku0oGP47tRgqPZadcfj3YoZMHkFVnCYFbQM8I+i5QEw==}
'@emnapi/wasi-threads@2.2.0':
resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==}
'@epic-web/invariant@1.0.0':
resolution: {integrity: sha512-lrTPqgvfFQtR/eY/qkIzp98OGdNJu0m5ji3q/nJI8v3SXkRKEnWiOxMmbvcSoAIzv/cGiuvRy57k4suKQSAdwA==}
@ -482,11 +491,11 @@ packages:
cpu: [x64]
os: [win32]
'@hono/node-server@2.1.3':
resolution: {integrity: sha512-TA//nWMqPhbfdfneACk6t5a9eqbS9lABEPyKn0/xZTah3H3U2XaVg85rJFl0/Fyit0I552YDHgXGVSf3GwqbUw==}
'@hono/node-server@2.1.9':
resolution: {integrity: sha512-Sk4NQd3GFY0WZWCzndwFMPwJhtD0y9qjsQ+pjID0/03nK9pxyBCUoUHCho8QYBLBVhi0ssL8UkNPHqbgSOFPIQ==}
engines: {node: '>=20'}
peerDependencies:
hono: ^4
hono: ^4 || ^5.0.0-0
'@img/colour@1.1.0':
resolution: {integrity: sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==}
@ -663,26 +672,33 @@ packages:
'@jridgewell/trace-mapping@0.3.9':
resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
'@modelcontextprotocol/client@2.3.1':
resolution: {integrity: sha512-mIGZXpHsjnZ6lD+gD/WCMpR5k8yVQQ8nNFH1N0Srf7AvnwTUMYD6pvTY8ng2+He5FfV7YMZLmrjL7cLa/cc3dQ==}
'@modelcontextprotocol/client@2.4.0':
resolution: {integrity: sha512-LgrD2OphHuG12vfKFKz6SOnq7bKHQmhGJIAYdD+MZBn2npHEyry6uD8zvktodtl5CQM85MO0anUyD9JwmUmxww==}
engines: {node: '>=20'}
'@modelcontextprotocol/core@2.3.1':
resolution: {integrity: sha512-laVmIhPGpWi7rG9q+0UigblRN0Hws/Yjlb6qLFtVqryXVLkc4h+yN8z731POD2LnAGQlFe7/tXhUm7Bi0YB91g==}
'@modelcontextprotocol/core@2.4.0':
resolution: {integrity: sha512-z8QBKqdfXLPzkLQuG4xp8hrVEMm1PZ1IgxMN2sMbJiFiAKOWXnAzogXn2W4aqIBlP1ea6U5yiqVquvUNM1Cj6Q==}
engines: {node: '>=20'}
'@modelcontextprotocol/node@2.1.1':
resolution: {integrity: sha512-EY92OAXN2xYL7tNS/MVsWJW1v8VHAPwl9B4Ca3pCrjmvqyC+S1C/6UHsMxF2GoFPraS5Yyg56vFz9brVpFojMA==}
'@modelcontextprotocol/node@2.1.2':
resolution: {integrity: sha512-IIcIqBpr6NCQQs5DgJTgvbSOAw+3iaR/uquqg+e0nXCdudfjPg/80x0TseUnQx14AUAtE4fsJCEpJKPyb6WPVA==}
engines: {node: '>=20'}
peerDependencies:
'@modelcontextprotocol/server': ^2.3.0
'@modelcontextprotocol/server': ^2.4.0
'@modelcontextprotocol/server@2.3.1':
resolution: {integrity: sha512-e59MfWuSssj6DoQ96JCTqdW1AXT5/XtnTl0WWd6MU1Ka434fFUGGosCLJbGNySDhHGvxQWoRWK137FXYFkYNWw==}
'@modelcontextprotocol/server@2.4.0':
resolution: {integrity: sha512-rgR9yxSaAJ+bcsi/XroT/S2AfPiIWloXAnrdfYSCms9ivVju0ishu/wW0J21Ho6+ZOR1r7RyeRbjiRuF87ix5Q==}
engines: {node: '>=20'}
'@oxc-project/types@0.155.0':
resolution: {integrity: sha512-SeE8JPwW1xs1tHeNycjUtUBdhorRa8o4jlvjwk49R7/Z291i+4DQa7JJIgOm/TaYQZx+QrPQbVJ/9c8dMIZN8Q==}
'@napi-rs/wasm-runtime@1.2.6':
resolution: {integrity: sha512-mRyDmEw9/fCDXCGfL1sbgIw/GUK0PVxRW4YwgPN61F3LQ+fSyoBFarJVzgGyhF6kRzEQZ0FejDqm4WLXSeqQmw==}
engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0}
peerDependencies:
'@emnapi/core': ^1.7.1 || 2.0.0-beta.2
'@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2
'@oxc-project/types@0.156.0':
resolution: {integrity: sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==}
'@penpot/plugin-styles@1.6.0':
resolution: {integrity: sha512-vmIDYbQqIcTPxYer7/C1nmo5QJyErTI4ZcFNELuENMnLcs+UeAFWtqsMENGoY6jfldEujbUwoglS9hBKI11x5Q==}
@ -690,104 +706,109 @@ packages:
'@pinojs/redact@0.4.0':
resolution: {integrity: sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==}
'@rolldown/binding-android-arm-eabi@1.2.15':
resolution: {integrity: sha512-aLcgK9gIJ3YRvrrtfSBbRa27F5WrpiTaPulnFpsHPxpUHgFlSgnU4854MHwoRGEBhfRJDWCS2WQ7lIjskE9Olw==}
'@rolldown/binding-android-arm-eabi@1.2.19':
resolution: {integrity: sha512-e+Ebe0WT+9tbXmNKPIiC8YrWAHYwug3m6i4p3rZGGulfZri1jtI4HslT+OZnFf/OIHowWF71DTlHwXBP2SiA7A==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [android]
'@rolldown/binding-android-arm64@1.2.15':
resolution: {integrity: sha512-xD7DdZCrbThKuxNg7ooQmvp07ys4J/pnSEMTG3/OdOWl6daC67m/Q4fL78sRHMxTH/N4fGUbYhcPM0MF5WFHkg==}
'@rolldown/binding-android-arm64@1.2.19':
resolution: {integrity: sha512-hOombrTJ+szt2ciEzS7oCA78lMPBgF5UMQWCJIyNfnrI7GLl8HYoFqCnpL2gcPOaXMqryGCU5ExdQKyDDcC+yA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [android]
'@rolldown/binding-darwin-arm64@1.2.15':
resolution: {integrity: sha512-m2WuQ6r0B4OTYxyPpNLtXaMRbRDUbG8YQV2Q3KTdSSK8Th6KHCnC8jVCJt8bvYeSB5WivkkNbc85mKadaSdOxA==}
'@rolldown/binding-darwin-arm64@1.2.19':
resolution: {integrity: sha512-XoMA2pwCKGTQzUjPgtRwkedH4WmXhdIPKT6l6oOxd1PUbNodGI6DcBekgN7EC//+x3pfBYX/qL1gNmZAqivw5g==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [darwin]
'@rolldown/binding-darwin-x64@1.2.15':
resolution: {integrity: sha512-5RtnsHM36nodM9WbMy+zip0LGS/G+y5wro5RHrpOlr4ac24+1zSi9kiV2MP1myZeZ/ifEHfulQcWjnAXzc2C2A==}
'@rolldown/binding-darwin-x64@1.2.19':
resolution: {integrity: sha512-zo8EsSSwMZCY/e+fRnGaX02YGgvJD0yvhNi/9hpGPA2MJ9ZF8dPCw75UGfpI6OpQ/myR/dIYmogRvqiZD0TrXg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [darwin]
'@rolldown/binding-freebsd-x64@1.2.15':
resolution: {integrity: sha512-g3l09pyFqhu+135JKkbkwiKGQmwU5hUMUPJ4VdBADvuqR8d33L6H578rh8m7rtxbdp+VmX/+nzI7nvhSZlzpUQ==}
'@rolldown/binding-freebsd-x64@1.2.19':
resolution: {integrity: sha512-O8ISAOfI1nj7AuBPd30FSF47z7f7lzlk5poQVGgiikvQuGEBFYvW8ki+UEnT+YJPnNGjQzn304klt4O9FUE7mA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [freebsd]
'@rolldown/binding-linux-arm-gnueabihf@1.2.15':
resolution: {integrity: sha512-nIe3VugI97nGQtspPxDqA4sXMUpeiocKIP/CqpY/u/vgbT+alX+cVxu1C/oVBPKg4feNTmYovE91v4DgXvXNwQ==}
'@rolldown/binding-linux-arm-gnueabihf@1.2.19':
resolution: {integrity: sha512-/lYCba5NO0yq4S0jGMH8QTBtkvQxoXjoQWzF5BcWp9MjB9jxVRD1GQDNofkVjcOj30DWyhLIN/4Oe60JKzaONw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [linux]
'@rolldown/binding-linux-arm64-gnu@1.2.15':
resolution: {integrity: sha512-iTBjXx+B5QSvgI89lJfmqh4wTh8NabR1YZIIN3hNx4zSG0EVfVqkOvLulNpG4251pbd6/IAmZ/LefVk1Y4rPhw==}
'@rolldown/binding-linux-arm64-gnu@1.2.19':
resolution: {integrity: sha512-pm/apFMBnSbFb3O6nG5pHO1iqHhZrjGDFEjSm+ot9J17XXPvH9L90y5h+jgfHCE+Qdlsvy8qKEcU4VKxgjD+vA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@rolldown/binding-linux-arm64-musl@1.2.15':
resolution: {integrity: sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ==}
'@rolldown/binding-linux-arm64-musl@1.2.19':
resolution: {integrity: sha512-K1SmQp3FFichn8oqrNIwvFoZ5wcvjC7goBzpaMNvLf9FZc+QB/QvLmnpJZgAAGHiD980tP8FZZnXk2K94rvlxg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
libc: [musl]
'@rolldown/binding-linux-ppc64-gnu@1.2.15':
resolution: {integrity: sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw==}
'@rolldown/binding-linux-ppc64-gnu@1.2.19':
resolution: {integrity: sha512-I0xwD57jP/3A7+5UPZin2w8Y7XHEmEM5zqpYZOcQ45MlNW6tUJUziymV3yRr7rL4vwyfEcRsRksC4a7Kc08p5Q==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@rolldown/binding-linux-s390x-gnu@1.2.15':
resolution: {integrity: sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA==}
'@rolldown/binding-linux-s390x-gnu@1.2.19':
resolution: {integrity: sha512-BrtEHT24SNXj9HiXqy+s/kXiSiQGt6EKCPUlRirAoIioVxKGnbXBUEkbZASAei7iZJB0/Ynm+0JP00Ipx7AnSw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@rolldown/binding-linux-x64-gnu@1.2.15':
resolution: {integrity: sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw==}
'@rolldown/binding-linux-x64-gnu@1.2.19':
resolution: {integrity: sha512-rm75/9DkHKeU2WnA8w4X94WGYgLlDCFCfkQC+4bguVJmC/jvDRv2B+2wLOYhyE0fVuv7//Ckk39OoOufyCu76Q==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
libc: [glibc]
'@rolldown/binding-linux-x64-musl@1.2.15':
resolution: {integrity: sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ==}
'@rolldown/binding-linux-x64-musl@1.2.19':
resolution: {integrity: sha512-irh/4+iYFM4GAzpluDErgjz89bj6NDtqqMAG/6O1LG38Ed3NpyebzCpcVNkFW8uhy+/3/BocUvnXDR33CXWe9A==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
libc: [musl]
'@rolldown/binding-openharmony-arm64@1.2.15':
resolution: {integrity: sha512-MyzC5Hrv/sm+Z7TSGKP/j8001RO2xQm1zOpCNVL4j0cY/VhBZviludA2YFQ7i4lH6ZAXxQm0lcMdBzM+99mE7w==}
'@rolldown/binding-openharmony-arm64@1.2.19':
resolution: {integrity: sha512-+KWTWNoPt+CfSq94CiceWu3yPE+QzkaG+phPyz9G60tmZLwfQkcA4AeksafzvJAw4pvg1mcd5a1TkUqVv0s4JA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [openharmony]
'@rolldown/binding-win32-arm64-msvc@1.2.15':
resolution: {integrity: sha512-+PgYiS+AH5omy6L45ZLxybasauJaj3M8buoT83D+nzPmCayXlxUV9hydhciCKVyIg0B/v0BtXPDE1uGqNwCPpg==}
'@rolldown/binding-wasm32-wasi@1.2.19':
resolution: {integrity: sha512-7EH+skOsl5qpWnK0vzamgJFhOv1cwxQpsxm8tI883K9fur5c27p8q87fzEO6BbBPabA2/+s/zR63/pLc137iOg==}
engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0}
cpu: [wasm32]
'@rolldown/binding-win32-arm64-msvc@1.2.19':
resolution: {integrity: sha512-3Q1Yg1Q7tEvBWoZf5rFvG/GKZQPgwfru+p4wBajDfJFBs0SHCpL++dfTjW9gyAKd1T7ZpIYvdaUax7Pa/IhFVQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [win32]
'@rolldown/binding-win32-x64-msvc@1.2.15':
resolution: {integrity: sha512-HFZd2QNQYn1JbIi+Hpd7H+r/lkWxcfIu28nirZ6eCn2LafuvmExMlb/P96Sfx5tf7pPArw39IdhmCF8vmV+NhQ==}
'@rolldown/binding-win32-x64-msvc@1.2.19':
resolution: {integrity: sha512-y/sqRRc6d7hECzOFc5n3LSeqctmIp9mMjY1Kq4s14uLPd/LZ4z7i1zrW6fMtp2mPeuQIC4e6ULMcwQzMomqQag==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [win32]
'@rolldown/pluginutils@1.0.1':
resolution: {integrity: sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==}
'@rolldown/pluginutils@1.1.1':
resolution: {integrity: sha512-glFIJDvLNDtJhT9qrMFWLPbvS+skxgt4L0K8Ei2YtnhPysAJnsI7nyxSJxKj4ADeKX0OLjC4ntRkwpLOoS3rwA==}
'@seahax/deep-copy@0.1.0':
resolution: {integrity: sha512-Ux88qw9ypPbqszDGwj0JvP8FP017MV3ck7jnkit+0i3mecTkqhYiCUqy3exbxhGFBu07zrUS6yPRUWVct1eSMQ==}
@ -807,11 +828,14 @@ packages:
'@tsconfig/node16@1.0.4':
resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==}
'@tybys/wasm-util@0.10.5':
resolution: {integrity: sha512-dOGOPxlaNV+G046mZzN+9C0dAcQZeSKcXiVaM0TYy/LM4ttTmgSBDxYfovcYI8Em3+eAbiAYpvWLOv8+ZVRJKA==}
'@types/body-parser@1.19.6':
resolution: {integrity: sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==}
'@types/chrome@0.3.6':
resolution: {integrity: sha512-NXCrCBefCHCKMVbkaxfBQqyP766Wg85S2FQhixCCxq7AtjJwoEaja2y5NSqCzpihIi9mPqhaF5RuybTnrdYD2Q==}
'@types/chrome@0.3.7':
resolution: {integrity: sha512-jWZgbHqWbTL1a5+PoyN0OJutNyejWgyZ5MdcvKo6iJE1TNRtXR3FxsC4WzNl52yZWPidfWC8NV/VUNZf+OFKcA==}
'@types/connect@3.4.38':
resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==}
@ -831,11 +855,8 @@ packages:
'@types/js-yaml@4.0.9':
resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==}
'@types/node@26.6.4':
resolution: {integrity: sha512-ldVPDCzj7fsaGZrLB0NuHuTvJcsNasysBAqMolr/cgxrLd1xbqxIr3XJiPnHHJUCxj5sNF1vnRj9aWnrVh5Jcg==}
'@types/node@26.6.5':
resolution: {integrity: sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==}
'@types/node@26.6.6':
resolution: {integrity: sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==}
'@types/qs@6.15.1':
resolution: {integrity: sha512-GZHUBZR9hckSUhrxmp1nG6NwdpM9fCunJwyThLW1X3AyHgd9IlHb6VANpQQqDr2o/qQp6McZ3y/IA2rVzKzSbw==}
@ -926,8 +947,8 @@ packages:
colorette@2.0.20:
resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
concurrently@10.0.6:
resolution: {integrity: sha512-qgICXXFp2/3nAebRLmxcINKEXM1mLK3ij/y31P02VTs/KIkddIeC05n73DxOXsXMB9LFSqNU1/na3lDlOhcbIw==}
concurrently@10.0.7:
resolution: {integrity: sha512-zMCeLhawVIj3SLbpg0/BWCdJl1wcBSpcHKbNrhaM01P3xAlEWcH30Lea2q+F4uGZ7YM0scDK0dgpWyn1uCJj6w==}
engines: {node: '>=22'}
hasBin: true
@ -1114,8 +1135,8 @@ packages:
help-me@5.0.0:
resolution: {integrity: sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==}
hono@4.13.13:
resolution: {integrity: sha512-CQ46U0ZkAGmbT/4UxdzzGJpacP2IeKgY4a5/tOI9AABbpOMfK739wfDXmv1usCk+3RkKj1hQy4/fjhiwa2xlrA==}
hono@4.13.19:
resolution: {integrity: sha512-KmXvQAXwcAHV+muzbIwoJ23niEB5nMoDVr9WcRkU8mvjUECm/1+7v4Jgp7P7a+H6MLFrh+vXrGonGrGS+RQfkA==}
engines: {node: '>=16.9.0'}
http-errors@2.0.1:
@ -1143,8 +1164,8 @@ packages:
isexe@2.0.0:
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
jose@6.2.12:
resolution: {integrity: sha512-9NiFmJEex0sy2Dk58j2UGBSHgUs2ypF9eZSu4L6vjOX3Dp96Sw1F3uL+H+D1sx02jZZdzUT0HgvCy59CuvXcWw==}
jose@6.2.17:
resolution: {integrity: sha512-wOuK9V1yujQFH5S0ZWmLcDZN7+IKh9bUCC2ZPCf2HDlol3WWHy+PPyNjEI75FXRLMp3vDKQcupP59xhVU95hcg==}
joycon@3.1.1:
resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==}
@ -1328,12 +1349,12 @@ packages:
resolution: {integrity: sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==}
engines: {node: '>=16.20.0'}
postcss@8.5.32:
resolution: {integrity: sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==}
postcss@8.5.33:
resolution: {integrity: sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==}
engines: {node: ^10 || ^12 || >=14}
prettier@3.9.10:
resolution: {integrity: sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==}
prettier@3.10.1:
resolution: {integrity: sha512-70vp3ZUYoPlFbF9uiTdXHUUCGEIp7d4+6p+8DYbkm2jP7x/3i/paXVF6dopSI3zd/CEitrZN1rc4i85xWmmXlg==}
engines: {node: '>=14'}
hasBin: true
@ -1376,8 +1397,8 @@ packages:
reflect-metadata@0.2.2:
resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==}
rolldown@1.2.15:
resolution: {integrity: sha512-6odND+fel5zVw3I4Yc2e69gvguDnX0CAAGiNDZSq4ik5WUcaLrkD2GLuog0XcODbor31hZ5ayEMgVDno+KPV5g==}
rolldown@1.2.19:
resolution: {integrity: sha512-QIiV1J9d0pzN4jeeTH4sjPy0AZ6cAy2cG0ExeoE1+U8Rvj+hR3gYkokx0YbeUNGlZqiQJJ2utcETe0oKXwzsuA==}
engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true
@ -1521,6 +1542,9 @@ packages:
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
tslib@2.9.1:
resolution: {integrity: sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==}
tsx@4.23.15:
resolution: {integrity: sha512-Yiex1Ovn8z2xPpOWckIiysV1SSyRMY9BkLF++q0yKiDxCqRhosKfMg3janKkiLBwZ5c/YryloKwGZcrEmtwxKw==}
engines: {node: '>=18.0.0'}
@ -1558,8 +1582,8 @@ packages:
peerDependencies:
vite: '>=5.4.0'
vite@8.3.5:
resolution: {integrity: sha512-z1YpjieJ9g0ebTmQpLBv/oq9E3F9EIlOe+7LahW8SrE3LTiG3udBRUXQOlYXP9b+IC2q2phHeVxj9xGlw34OEQ==}
vite@8.3.8:
resolution: {integrity: sha512-LzOn3h9rG/0vhLdXrV4yJ4QFA9eEoqCl+Yx+kGJd7aB9w6nfNgVHKSYwLPZUHrz4ZGa+t+kXjV9itvcHDLQouA==}
engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true
peerDependencies:
@ -1613,8 +1637,8 @@ packages:
wrappy@1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
ws@8.22.0:
resolution: {integrity: sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==}
ws@8.23.0:
resolution: {integrity: sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ==}
engines: {node: '>=10.0.0'}
peerDependencies:
bufferutil: ^4.0.1
@ -1650,11 +1674,27 @@ snapshots:
dependencies:
'@jridgewell/trace-mapping': 0.3.9
'@emnapi/core@2.0.0-beta.2':
dependencies:
'@emnapi/wasi-threads': 2.2.0
tslib: 2.8.1
optional: true
'@emnapi/runtime@1.11.3':
dependencies:
tslib: 2.8.1
optional: true
'@emnapi/runtime@2.0.0-beta.2':
dependencies:
tslib: 2.8.1
optional: true
'@emnapi/wasi-threads@2.2.0':
dependencies:
tslib: 2.8.1
optional: true
'@epic-web/invariant@1.0.0': {}
'@esbuild/aix-ppc64@0.28.2':
@ -1735,9 +1775,9 @@ snapshots:
'@esbuild/win32-x64@0.28.2':
optional: true
'@hono/node-server@2.1.3(hono@4.13.13)':
'@hono/node-server@2.1.9(hono@4.13.19)':
dependencies:
hono: 4.13.13
hono: 4.13.19
'@img/colour@1.1.0': {}
@ -1856,83 +1896,97 @@ snapshots:
'@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.6.0
'@modelcontextprotocol/client@2.3.1':
'@modelcontextprotocol/client@2.4.0':
dependencies:
'@modelcontextprotocol/core': 2.3.1
'@modelcontextprotocol/core': 2.4.0
cross-spawn: 7.0.6
eventsource: 3.0.7
eventsource-parser: 3.1.1
jose: 6.2.12
jose: 6.2.17
pkce-challenge: 5.0.1
zod: 4.6.7
'@modelcontextprotocol/core@2.3.1':
'@modelcontextprotocol/core@2.4.0':
dependencies:
zod: 4.6.7
'@modelcontextprotocol/node@2.1.1(@modelcontextprotocol/server@2.3.1)':
'@modelcontextprotocol/node@2.1.2(@modelcontextprotocol/server@2.4.0)':
dependencies:
'@hono/node-server': 2.1.3(hono@4.13.13)
'@modelcontextprotocol/server': 2.3.1
hono: 4.13.13
'@hono/node-server': 2.1.9(hono@4.13.19)
'@modelcontextprotocol/server': 2.4.0
hono: 4.13.19
'@modelcontextprotocol/server@2.3.1':
'@modelcontextprotocol/server@2.4.0':
dependencies:
'@modelcontextprotocol/core': 2.3.1
'@modelcontextprotocol/core': 2.4.0
zod: 4.6.7
'@oxc-project/types@0.155.0': {}
'@napi-rs/wasm-runtime@1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)':
dependencies:
'@emnapi/core': 2.0.0-beta.2
'@emnapi/runtime': 2.0.0-beta.2
'@tybys/wasm-util': 0.10.5
optional: true
'@oxc-project/types@0.156.0': {}
'@penpot/plugin-styles@1.6.0': {}
'@pinojs/redact@0.4.0': {}
'@rolldown/binding-android-arm-eabi@1.2.15':
'@rolldown/binding-android-arm-eabi@1.2.19':
optional: true
'@rolldown/binding-android-arm64@1.2.15':
'@rolldown/binding-android-arm64@1.2.19':
optional: true
'@rolldown/binding-darwin-arm64@1.2.15':
'@rolldown/binding-darwin-arm64@1.2.19':
optional: true
'@rolldown/binding-darwin-x64@1.2.15':
'@rolldown/binding-darwin-x64@1.2.19':
optional: true
'@rolldown/binding-freebsd-x64@1.2.15':
'@rolldown/binding-freebsd-x64@1.2.19':
optional: true
'@rolldown/binding-linux-arm-gnueabihf@1.2.15':
'@rolldown/binding-linux-arm-gnueabihf@1.2.19':
optional: true
'@rolldown/binding-linux-arm64-gnu@1.2.15':
'@rolldown/binding-linux-arm64-gnu@1.2.19':
optional: true
'@rolldown/binding-linux-arm64-musl@1.2.15':
'@rolldown/binding-linux-arm64-musl@1.2.19':
optional: true
'@rolldown/binding-linux-ppc64-gnu@1.2.15':
'@rolldown/binding-linux-ppc64-gnu@1.2.19':
optional: true
'@rolldown/binding-linux-s390x-gnu@1.2.15':
'@rolldown/binding-linux-s390x-gnu@1.2.19':
optional: true
'@rolldown/binding-linux-x64-gnu@1.2.15':
'@rolldown/binding-linux-x64-gnu@1.2.19':
optional: true
'@rolldown/binding-linux-x64-musl@1.2.15':
'@rolldown/binding-linux-x64-musl@1.2.19':
optional: true
'@rolldown/binding-openharmony-arm64@1.2.15':
'@rolldown/binding-openharmony-arm64@1.2.19':
optional: true
'@rolldown/binding-win32-arm64-msvc@1.2.15':
'@rolldown/binding-wasm32-wasi@1.2.19':
dependencies:
'@emnapi/core': 2.0.0-beta.2
'@emnapi/runtime': 2.0.0-beta.2
'@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2)
optional: true
'@rolldown/binding-win32-x64-msvc@1.2.15':
'@rolldown/binding-win32-arm64-msvc@1.2.19':
optional: true
'@rolldown/pluginutils@1.0.1': {}
'@rolldown/binding-win32-x64-msvc@1.2.19':
optional: true
'@rolldown/pluginutils@1.1.1': {}
'@seahax/deep-copy@0.1.0': {}
@ -1946,22 +2000,27 @@ snapshots:
'@tsconfig/node16@1.0.4': {}
'@tybys/wasm-util@0.10.5':
dependencies:
tslib: 2.8.1
optional: true
'@types/body-parser@1.19.6':
dependencies:
'@types/connect': 3.4.38
'@types/node': 26.6.5
'@types/node': 26.6.6
'@types/chrome@0.3.6':
'@types/chrome@0.3.7':
dependencies:
'@types/har-format': 1.2.16
'@types/connect@3.4.38':
dependencies:
'@types/node': 26.6.5
'@types/node': 26.6.6
'@types/express-serve-static-core@5.1.3':
dependencies:
'@types/node': 26.6.5
'@types/node': 26.6.6
'@types/qs': 6.15.1
'@types/range-parser': 1.2.7
'@types/send': 1.2.1
@ -1978,11 +2037,7 @@ snapshots:
'@types/js-yaml@4.0.9': {}
'@types/node@26.6.4':
dependencies:
undici-types: 8.9.0
'@types/node@26.6.5':
'@types/node@26.6.6':
dependencies:
undici-types: 8.9.0
@ -1992,18 +2047,18 @@ snapshots:
'@types/send@1.2.1':
dependencies:
'@types/node': 26.6.5
'@types/node': 26.6.6
'@types/serve-static@2.2.0':
dependencies:
'@types/http-errors': 2.0.5
'@types/node': 26.6.5
'@types/node': 26.6.6
'@types/validator@13.15.10': {}
'@types/ws@8.18.2':
dependencies:
'@types/node': 26.6.4
'@types/node': 26.6.6
accepts@2.0.0:
dependencies:
@ -2074,7 +2129,7 @@ snapshots:
colorette@2.0.20: {}
concurrently@10.0.6:
concurrently@10.0.7:
dependencies:
chalk: 5.6.2
rxjs: 7.8.2
@ -2280,7 +2335,7 @@ snapshots:
help-me@5.0.0: {}
hono@4.13.13: {}
hono@4.13.19: {}
http-errors@2.0.1:
dependencies:
@ -2313,7 +2368,7 @@ snapshots:
isexe@2.0.0: {}
jose@6.2.12: {}
jose@6.2.17: {}
joycon@3.1.1: {}
@ -2466,13 +2521,13 @@ snapshots:
pkce-challenge@5.0.1: {}
postcss@8.5.32:
postcss@8.5.33:
dependencies:
nanoid: 3.3.20
picocolors: 1.1.1
source-map-js: 1.2.2
prettier@3.9.10: {}
prettier@3.10.1: {}
process-warning@5.1.1: {}
@ -2513,26 +2568,27 @@ snapshots:
reflect-metadata@0.2.2: {}
rolldown@1.2.15:
rolldown@1.2.19:
dependencies:
'@oxc-project/types': 0.155.0
'@rolldown/pluginutils': 1.0.1
'@oxc-project/types': 0.156.0
'@rolldown/pluginutils': 1.1.1
optionalDependencies:
'@rolldown/binding-android-arm-eabi': 1.2.15
'@rolldown/binding-android-arm64': 1.2.15
'@rolldown/binding-darwin-arm64': 1.2.15
'@rolldown/binding-darwin-x64': 1.2.15
'@rolldown/binding-freebsd-x64': 1.2.15
'@rolldown/binding-linux-arm-gnueabihf': 1.2.15
'@rolldown/binding-linux-arm64-gnu': 1.2.15
'@rolldown/binding-linux-arm64-musl': 1.2.15
'@rolldown/binding-linux-ppc64-gnu': 1.2.15
'@rolldown/binding-linux-s390x-gnu': 1.2.15
'@rolldown/binding-linux-x64-gnu': 1.2.15
'@rolldown/binding-linux-x64-musl': 1.2.15
'@rolldown/binding-openharmony-arm64': 1.2.15
'@rolldown/binding-win32-arm64-msvc': 1.2.15
'@rolldown/binding-win32-x64-msvc': 1.2.15
'@rolldown/binding-android-arm-eabi': 1.2.19
'@rolldown/binding-android-arm64': 1.2.19
'@rolldown/binding-darwin-arm64': 1.2.19
'@rolldown/binding-darwin-x64': 1.2.19
'@rolldown/binding-freebsd-x64': 1.2.19
'@rolldown/binding-linux-arm-gnueabihf': 1.2.19
'@rolldown/binding-linux-arm64-gnu': 1.2.19
'@rolldown/binding-linux-arm64-musl': 1.2.19
'@rolldown/binding-linux-ppc64-gnu': 1.2.19
'@rolldown/binding-linux-s390x-gnu': 1.2.19
'@rolldown/binding-linux-x64-gnu': 1.2.19
'@rolldown/binding-linux-x64-musl': 1.2.19
'@rolldown/binding-openharmony-arm64': 1.2.19
'@rolldown/binding-wasm32-wasi': 1.2.19
'@rolldown/binding-win32-arm64-msvc': 1.2.19
'@rolldown/binding-win32-x64-msvc': 1.2.19
router@2.2.0(supports-color@10.2.2):
dependencies:
@ -2546,7 +2602,7 @@ snapshots:
rxjs@7.8.2:
dependencies:
tslib: 2.8.1
tslib: 2.9.1
safe-stable-stringify@2.5.0: {}
@ -2583,7 +2639,7 @@ snapshots:
setprototypeof@1.2.0: {}
sharp@0.35.5(@types/node@26.6.5):
sharp@0.35.5(@types/node@26.6.6):
dependencies:
'@img/colour': 1.1.0
detect-libc: 2.1.2
@ -2614,7 +2670,7 @@ snapshots:
'@img/sharp-win32-arm64': 0.35.5
'@img/sharp-win32-ia32': 0.35.5
'@img/sharp-win32-x64': 0.35.5
'@types/node': 26.6.5
'@types/node': 26.6.6
shebang-command@2.0.0:
dependencies:
@ -2695,14 +2751,14 @@ snapshots:
tree-kill@1.2.2: {}
ts-node@10.9.2(@types/node@26.6.5)(typescript@6.0.3):
ts-node@10.9.2(@types/node@26.6.6)(typescript@6.0.3):
dependencies:
'@cspotcode/source-map-support': 0.8.1
'@tsconfig/node10': 1.0.13
'@tsconfig/node12': 1.0.11
'@tsconfig/node14': 1.0.3
'@tsconfig/node16': 1.0.4
'@types/node': 26.6.5
'@types/node': 26.6.6
acorn: 8.19.0
acorn-walk: 8.3.5
arg: 4.1.3
@ -2713,7 +2769,10 @@ snapshots:
v8-compile-cache-lib: 3.0.1
yn: 3.1.1
tslib@2.8.1: {}
tslib@2.8.1:
optional: true
tslib@2.9.1: {}
tsx@4.23.15:
dependencies:
@ -2739,28 +2798,28 @@ snapshots:
vary@1.1.2: {}
vite-live-preview@0.4.0(vite@8.3.5(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15)):
vite-live-preview@0.4.0(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(tsx@4.23.15)):
dependencies:
'@seahax/deep-copy': 0.1.0
'@seahax/semaphore': 0.5.1
'@types/ws': 8.18.2
escape-goat: 4.0.0
strip-ansi: 7.2.0
vite: 8.3.5(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15)
ws: 8.22.0
vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(tsx@4.23.15)
ws: 8.23.0
transitivePeerDependencies:
- bufferutil
- utf-8-validate
vite@8.3.5(@types/node@26.6.4)(esbuild@0.28.2)(tsx@4.23.15):
vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(tsx@4.23.15):
dependencies:
lightningcss: 1.33.0
picomatch: 4.0.7
postcss: 8.5.32
rolldown: 1.2.15
postcss: 8.5.33
rolldown: 1.2.19
tinyglobby: 0.2.17
optionalDependencies:
'@types/node': 26.6.4
'@types/node': 26.6.6
esbuild: 0.28.2
fsevents: 2.3.3
tsx: 4.23.15
@ -2777,7 +2836,7 @@ snapshots:
wrappy@1.0.2: {}
ws@8.22.0: {}
ws@8.23.0: {}
y18n@5.0.8: {}

View File

@ -17,14 +17,14 @@
"clean": "rm -rf dist/"
},
"dependencies": {
"@penpot/plugin-styles": "1.4.2",
"@penpot/plugin-types": "1.4.2"
"@penpot/plugin-styles": "1.6.0",
"@penpot/plugin-types": "1.6.0"
},
"devDependencies": {
"playwright": "^1.63.0",
"prettier": "^3.9.9",
"playwright": "^1.65.1",
"prettier": "^3.10.1",
"typescript": "^7.0.2",
"vite": "^8.3.2",
"vite": "^8.3.8",
"vite-live-preview": "^0.4.0"
},
"packageManager": "pnpm@12.21.0+sha512.66fd8278ee28935ce951792d34367ff3af5c432a2756445823029533835b8da529bbe0be5130afd56ed0713fb8789e47bad82d93bd5ae2fe54b15562d6276ef0"

View File

@ -18,7 +18,7 @@
"test:unit": "tsx --test ci/static-server.test.ts"
},
"devDependencies": {
"playwright": "^1.63.0"
"playwright": "^1.65.1"
},
"packageManager": "pnpm@12.21.0+sha512.66fd8278ee28935ce951792d34367ff3af5c432a2756445823029533835b8da529bbe0be5130afd56ed0713fb8789e47bad82d93bd5ae2fe54b15562d6276ef0"
}

View File

@ -4,7 +4,7 @@
"dependencies": {
"@penpot/plugin-types": "^1.6.0",
"ses": "^2.3.0",
"zod": "^4.6.5"
"zod": "^4.6.7"
},
"module": "./dist/index.js",
"typings": "./dist/index.d.ts",

View File

@ -0,0 +1,5 @@
/* Workspace entry point for the public `@penpot/plugin-styles/styles.css` import.
The published package ships a bundled file at this path; when the workspace
package is linked, its source lives under src/lib instead. Keep both layouts
exposing the same path so consumers resolve it identically. */
@import './src/lib/styles.css';

View File

@ -32,29 +32,29 @@
},
"private": true,
"devDependencies": {
"@angular-devkit/core": "22.2.1",
"@angular-devkit/schematics": "22.2.1",
"@angular-eslint/eslint-plugin": "22.5.0",
"@angular-eslint/eslint-plugin-template": "22.5.0",
"@angular-eslint/template-parser": "22.5.0",
"@angular/build": "22.2.1",
"@angular/cli": "22.2.1",
"@angular/compiler-cli": "22.2.1",
"@angular/language-service": "22.2.1",
"@angular-devkit/core": "22.2.7",
"@angular-devkit/schematics": "22.2.7",
"@angular-eslint/eslint-plugin": "22.8.0",
"@angular-eslint/eslint-plugin-template": "22.8.0",
"@angular-eslint/template-parser": "22.8.0",
"@angular/build": "22.2.7",
"@angular/cli": "22.2.7",
"@angular/compiler-cli": "22.2.6",
"@angular/language-service": "22.2.6",
"@eslint/js": "10.0.1",
"@schematics/angular": "22.2.1",
"@schematics/angular": "22.2.7",
"@types/feather-icons": "^4.29.4",
"@types/node": "26.6.4",
"@types/node": "26.6.6",
"@types/yargs": "^17.0.35",
"@typescript-eslint/eslint-plugin": "8.71.1",
"@typescript-eslint/parser": "8.71.1",
"@typescript-eslint/utils": "^8.71.1",
"@vitest/coverage-v8": "5.0.3",
"@vitest/ui": "5.0.3",
"concurrently": "^10.0.5",
"dotenv": "^18.0.5",
"@typescript-eslint/eslint-plugin": "8.73.0",
"@typescript-eslint/parser": "8.73.0",
"@typescript-eslint/utils": "^8.73.0",
"@vitest/coverage-v8": "5.1.1",
"@vitest/ui": "5.1.1",
"concurrently": "^10.0.7",
"dotenv": "^18.0.10",
"esbuild": "^0.28.2",
"eslint": "10.12.0",
"eslint": "10.15.0",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-import": "2.32.0",
"eslint-plugin-jsx-a11y": "6.10.2",
@ -62,37 +62,37 @@
"eslint-plugin-react-hooks": "7.1.1",
"eslint-plugin-unused-imports": "^4.4.1",
"fs-extra": "^11.4.1",
"globals": "^17.13.0",
"happy-dom": "^20.14.5",
"globals": "^17.14.0",
"happy-dom": "^21.0.4",
"jiti": "2.7.0",
"jsdom": "~30.1.2",
"jsdom": "~31.0.1",
"jsonc-eslint-parser": "^3.3.0",
"prettier": "^3.9.9",
"prettier": "^3.10.1",
"tsx": "^4.23.15",
"typedoc": "^0.28.20",
"typescript": "6.0.2",
"typescript-eslint": "^8.71.1",
"vite": "8.3.2",
"vite-plugin-checker": "^0.14.5",
"typescript-eslint": "^8.73.0",
"vite": "8.3.8",
"vite-plugin-checker": "^1.0.0",
"vite-plugin-dts": "5.1.2",
"vite-plugin-static-copy": "^4.1.1",
"vitest": "5.0.3",
"vitest": "5.1.1",
"yargs": "^18.2.0"
},
"dependencies": {
"@angular/common": "22.2.1",
"@angular/compiler": "22.2.1",
"@angular/core": "22.2.1",
"@angular/forms": "22.2.1",
"@angular/platform-browser": "22.2.1",
"@angular/router": "22.2.1",
"axios": "^1.20.0",
"@angular/common": "22.2.6",
"@angular/compiler": "22.2.6",
"@angular/core": "22.2.6",
"@angular/forms": "22.2.6",
"@angular/platform-browser": "22.2.6",
"@angular/router": "22.2.6",
"axios": "^1.21.1",
"feather-icons": "^4.29.2",
"puppeteer": "^25.12.0",
"puppeteer": "^25.18.1",
"rxjs": "~7.8.2",
"ses": "^2.3.0",
"tslib": "^2.8.1",
"zod": "^4.6.5",
"tslib": "^2.9.1",
"zod": "^4.6.7",
"zone.js": "0.16.3"
}
}

3102
plugins/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,7 @@ Subcommands:
prs Fetch details for one or more PRs (by number or milestone)
advisories List or inspect GitHub security advisories
link-issue Explicitly link a GitHub issue to a pull request
create-issue Create an issue and set its Issue Type in one command
Usage:
python3 scripts/gh.py issues <milestone-title> (default: state=closed)
@ -34,6 +35,8 @@ Usage:
python3 scripts/gh.py advisories --patched-version 2.19.1 (filter by patched version)
python3 scripts/gh.py advisories GHSA-xvj6-fh9w-gjw7 (single advisory detail)
python3 scripts/gh.py link-issue 11235 11243
python3 scripts/gh.py create-issue --type task \
--title "Expand backend email tests" --body-file /tmp/issue-body.md
Prerequisites:
- gh CLI authenticated (gh auth status)
@ -132,6 +135,126 @@ def run_gh_rest(path: str) -> Any:
fail_gh(err.stderr)
# ─────────────────────────────────────────────
# Subcommand: create-issue
# ─────────────────────────────────────────────
# Issue Type node IDs in penpot/penpot. ``gh issue create`` cannot set the
# Issue Type, so it is assigned with a follow-up GraphQL mutation.
ISSUE_TYPE_IDS = {
"bug": "IT_kwDOAcyBPM4AX5Nb",
"enhancement": "IT_kwDOAcyBPM4B_IQN",
"feature": "IT_kwDOAcyBPM4AX5Nf",
"task": "IT_kwDOAcyBPM4AX5NY",
"question": "IT_kwDOAcyBPM4B_IQj",
"docs": "IT_kwDOAcyBPM4B_IQz",
"epic": "IT_kwDOAcyBPM4CEMzF",
}
ISSUE_URL_RE = re.compile(r"/issues/(\d+)")
GQL_ISSUE_NODE_ID_QUERY = """\
query($owner: String!, $repo: String!, $issueNumber: Int!) {
repository(owner: $owner, name: $repo) {
issue(number: $issueNumber) { id }
}
}
"""
GQL_UPDATE_ISSUE_TYPE = """\
mutation($issueId: ID!, $issueTypeId: ID!) {
updateIssue(input: {id: $issueId, issueTypeId: $issueTypeId}) {
issue { number issueType { name } }
}
}
"""
def create_issue(
title: str,
body_file: str,
issue_type: str,
labels: str | None = None,
project: str = "Main",
) -> dict:
"""Create an issue and assign its Issue Type in one sequence of calls.
``gh issue create`` returns the issue URL, so the number is parsed from
it. The Issue Type is then set through GraphQL: a failure at that point
leaves the issue in place and reports its number and URL for a manual fix.
"""
issue_type = issue_type.lower()
type_id = ISSUE_TYPE_IDS.get(issue_type)
if not type_id:
raise ValueError(f"unknown issue type: {issue_type}")
if not title.strip():
raise ValueError("issue title must not be empty")
cmd = [
"gh", "issue", "create",
"--repo", REPO,
"--title", title,
"--project", project,
"--body-file", body_file,
]
if labels:
cmd += ["--label", labels]
stdout = run_gh_command(cmd)
url = stdout.strip().splitlines()[-1].strip()
match = ISSUE_URL_RE.search(url)
if not match:
raise RuntimeError(
f"could not read issue number from gh output: {url!r};"
" check whether the issue was created"
)
number = int(match.group(1))
node_data = run_gh_graphql(
GQL_ISSUE_NODE_ID_QUERY,
{"owner": OWNER, "repo": REPO_NAME, "issueNumber": number},
)
issue = (node_data.get("repository") or {}).get("issue") or {}
if not issue.get("id"):
raise RuntimeError(
f"issue #{number} was created ({url}) but was not found in {REPO};"
f" set the {issue_type} type manually"
)
mutation_data = run_gh_graphql(
GQL_UPDATE_ISSUE_TYPE,
{"issueId": issue["id"], "issueTypeId": type_id},
)
updated = (mutation_data.get("updateIssue") or {}).get("issue") or {}
type_name = (updated.get("issueType") or {}).get("name")
if str(type_name).lower() != issue_type.lower():
raise RuntimeError(
f"issue #{number} was created ({url}) but its type is"
f" {type_name!r} instead of {issue_type!r}; set it manually"
)
return {
"number": number,
"url": url,
"title": title,
"issue_type": issue_type,
}
def cmd_create_issue(args: argparse.Namespace) -> None:
"""Handle the ``create-issue`` subcommand."""
print(f"Creating issue of type {args.type}...", file=sys.stderr)
try:
result = create_issue(
args.title, args.body_file, args.type, labels=args.label
)
except (ValueError, RuntimeError, GhCommandFailed) as error:
print(f"ERROR: {error}", file=sys.stderr)
sys.exit(1)
print(f"Created issue #{result['number']}: {result['url']}", file=sys.stderr)
print(json.dumps(result, indent=2))
# ─────────────────────────────────────────────
# Subcommand: link-issue
# ─────────────────────────────────────────────
@ -1146,6 +1269,26 @@ def main() -> None:
p_link.add_argument("pr_number", type=int, help="Pull request number")
p_link.set_defaults(func=cmd_link_issue)
# --- create-issue ---
p_create = sub.add_parser(
"create-issue",
help="Create an issue and set its Issue Type in one command",
)
p_create.add_argument(
"--type", required=True, type=str.lower,
choices=sorted(ISSUE_TYPE_IDS),
help="Issue Type, e.g. 'task' or 'bug' (case-insensitive)",
)
p_create.add_argument("--title", required=True, help="Issue title")
p_create.add_argument(
"--body-file", required=True,
help="Path to the file holding the Markdown body",
)
p_create.add_argument(
"--label", help="Comma-separated labels to add, e.g. 'breaking change'"
)
p_create.set_defaults(func=cmd_create_issue)
# --- issue (by-number lookup) ---
p_issue = sub.add_parser(
"issue", help="Fetch details for one or more issues by number (batched)"

View File

@ -36,6 +36,149 @@ def load_gh():
gh = load_gh()
class CreateIssueTests(unittest.TestCase):
def setUp(self):
self.url = "https://github.com/penpot/penpot/issues/13202"
self.create_response = self.url + "\n"
self.node_response = {"repository": {"issue": {"id": "issue-node-id"}}}
self.mutation_response = {
"updateIssue": {
"issue": {"number": 13202, "issueType": {"name": "Task"}}
}
}
@patch.object(gh, "run_gh_graphql")
@patch.object(gh, "run_gh_command")
def test_create_issue_sets_type_and_returns_result(self, run_command, run_graphql):
run_command.return_value = self.create_response
run_graphql.side_effect = [self.node_response, self.mutation_response]
result = gh.create_issue("A title", "/tmp/body.md", "task")
self.assertEqual(
result,
{
"number": 13202,
"url": self.url,
"title": "A title",
"issue_type": "task",
},
)
self.assertEqual(
run_command.call_args.args[0],
[
"gh", "issue", "create",
"--repo", "penpot/penpot",
"--title", "A title",
"--project", "Main",
"--body-file", "/tmp/body.md",
],
)
self.assertEqual(run_graphql.call_count, 2)
self.assertEqual(
run_graphql.call_args_list[1].args[1],
{
"issueId": "issue-node-id",
"issueTypeId": "IT_kwDOAcyBPM4AX5NY",
},
)
@patch.object(gh, "run_gh_graphql")
@patch.object(gh, "run_gh_command")
def test_create_issue_passes_labels(self, run_command, run_graphql):
run_command.return_value = self.create_response
run_graphql.side_effect = [
self.node_response,
{"updateIssue": {"issue": {"number": 13202, "issueType": {"name": "Bug"}}}},
]
gh.create_issue("T", "/tmp/body.md", "bug", labels="breaking change")
self.assertIn("breaking change", run_command.call_args.args[0])
self.assertIn(
"IT_kwDOAcyBPM4AX5Nb",
run_graphql.call_args_list[1].args[1].values(),
)
@patch.object(gh, "run_gh_graphql")
@patch.object(gh, "run_gh_command")
def test_create_issue_accepts_mixed_case_type(self, run_command, run_graphql):
run_command.return_value = self.create_response
run_graphql.side_effect = [self.node_response, self.mutation_response]
result = gh.create_issue("T", "/tmp/body.md", "Task")
self.assertEqual(result["issue_type"], "task")
self.assertEqual(
run_graphql.call_args_list[1].args[1]["issueTypeId"],
"IT_kwDOAcyBPM4AX5NY",
)
@patch.object(gh, "run_gh_command")
def test_create_issue_rejects_unknown_type(self, run_command):
with self.assertRaisesRegex(ValueError, "unknown issue type"):
gh.create_issue("T", "/tmp/body.md", "nope")
run_command.assert_not_called()
@patch.object(gh, "run_gh_command", return_value="created")
def test_create_issue_fails_when_url_has_no_number(self, _run_command):
with self.assertRaisesRegex(RuntimeError, "could not read issue number"):
gh.create_issue("T", "/tmp/body.md", "task")
@patch.object(gh, "run_gh_graphql")
@patch.object(gh, "run_gh_command")
def test_create_issue_reports_when_type_was_not_set(self, run_command, run_graphql):
run_command.return_value = self.create_response
run_graphql.side_effect = [
self.node_response,
{"updateIssue": {"issue": {"number": 13202, "issueType": None}}},
]
with self.assertRaisesRegex(RuntimeError, "set it manually"):
gh.create_issue("T", "/tmp/body.md", "task")
@patch.object(gh, "run_gh_command", side_effect=gh.GhCommandFailed("boom"))
def test_create_issue_propagates_gh_failure(self, _run_command):
with self.assertRaises(gh.GhCommandFailed):
gh.create_issue("T", "/tmp/body.md", "task")
@patch.object(gh, "create_issue")
def test_cmd_create_issue_outputs_result(self, create_issue):
expected = {
"number": 13202,
"url": self.url,
"title": "T",
"issue_type": "task",
}
create_issue.return_value = expected
args = types.SimpleNamespace(
type="task", title="T", body_file="/tmp/body.md", label=None
)
stdout = io.StringIO()
stderr = io.StringIO()
with contextlib.redirect_stdout(stdout), contextlib.redirect_stderr(stderr):
gh.cmd_create_issue(args)
self.assertEqual(json.loads(stdout.getvalue()), expected)
self.assertIn("Created issue #13202", stderr.getvalue())
create_issue.assert_called_once_with("T", "/tmp/body.md", "task", labels=None)
@patch.object(gh, "create_issue", side_effect=gh.GhCommandFailed("boom"))
def test_cmd_create_issue_exits_on_error(self, _create_issue):
args = types.SimpleNamespace(
type="task", title="T", body_file="/tmp/body.md", label=None
)
stderr = io.StringIO()
with contextlib.redirect_stderr(stderr):
with self.assertRaises(SystemExit) as error:
gh.cmd_create_issue(args)
self.assertEqual(error.exception.code, 1)
self.assertIn("boom", stderr.getvalue())
class LinkIssueTests(unittest.TestCase):
def setUp(self):
self.target_response = {