openpencil/tests/helpers
Danila Poyarkov e532f616ba
refactor!: move shared primitives below dom-css and core (#771)
* refactor!: move shared primitives below dom-css and core

dom-css depended on core for color conversion, base64 helpers, text
direction, and web-font assets, so core could not use dom-css and every
caller special-cased HTML and Tailwind output.

Color conversion and management, base64 helpers, and text/layout
direction now live in scene-graph under `color`, `bytes`, and
`text-direction`. dom-css takes web-font resolution as an injected
`fonts` option and owns the font face types, so it depends only on
scene-graph and core can depend on it.

BREAKING CHANGE: `@open-pencil/core/color` and `@open-pencil/core/bytes`
are removed, and the direction helpers are no longer exported from
`@open-pencil/core/text`; import them from `@open-pencil/scene-graph`
subpaths. `exportHTMLBundle` takes a font resolver in `fonts` instead of
`'assets'`.

* fix(tools): import color parsing from scene-graph in visual bisect

* fix(mcp): declare the scene-graph dependency

MCP imports `@open-pencil/scene-graph/bytes` since base64 helpers moved
there, but only reached scene-graph through core, so isolated installs
and package checks depended on transitive resolution.

* refactor!: use js-base64 directly instead of a base64 wrapper

Base64 helpers had moved into scene-graph only to sit below dom-css,
but they are a thin wrapper over js-base64 and unrelated to the graph;
fig already called js-base64 directly.

Callers use js-base64 and check `isValid` where input comes from outside
(clipboard, imported HTML, tool arguments, the plugin API). A new
`open-pencil/no-hand-rolled-base64` lint rule rejects atob, btoa, and
Buffer Base64 conversions, and AGENTS.md records the convention.

BREAKING CHANGE: `@open-pencil/core/bytes` is removed; use `js-base64`.

* fix(dom-css): keep images with invalid Base64 inline in HTML export

`exportHTMLBundle` accepts documents parsed from outside HTML, and
js-base64 drops characters it cannot decode, so extracting an invalid
image data URL wrote different bytes. Such images now stay inline.
2026-09-26 11:39:11 +04:00
..
canvas feat(updater): show download progress while installing an update 2026-09-25 23:15:14 +04:00
chat feat: persist AI conversations and add chat history (#661) 2026-09-08 11:19:07 +03:00
fonts perf(canvas): reuse labels with shared font fallback 2026-09-15 23:08:53 +03:00
mcp fix(MCP): add read-only file lifecycle tools (#722) 2026-09-18 11:55:06 +03:00
performance refactor: scope browser test instrumentation and global types (#667) 2026-09-10 14:26:36 +03:00
tauri refactor!: move shared primitives below dom-css and core (#771) 2026-09-26 11:39:11 +04:00
vue fix(editor): close preview and history lifecycle gaps 2026-09-16 03:36:44 +03:00
assert.ts chore(tests): remove targeted non-null assertions 2026-05-06 01:14:50 +03:00
canvas.ts fix(text): finalize font readiness and label shaping (#593) 2026-08-30 14:33:32 +03:00
cli.ts ci: shard unit tests by owner and cut the quick suite from 100 s to 13 s (#715) 2026-09-17 10:18:16 +03:00
clipboard.ts test(clipboard): split editor clipboard coverage 2026-05-06 01:53:10 +03:00
code-panel.ts feat(code): add live JSX and HTML/CSS editing (#525) 2026-08-15 09:48:42 +03:00
demo.ts fix: convert document colour profiles, keep text edits live, and fix .fig exports (#716) 2026-09-18 00:43:10 +03:00
dom-css-browser.ts test: honor the configured browser test origin 2026-09-16 12:46:13 +03:00
dom-css.ts refactor!: move shared primitives below dom-css and core (#771) 2026-09-26 11:39:11 +04:00
editor-history.ts style: tighten import grouping 2026-05-06 02:22:08 +03:00
fig-fixtures.ts ci: shard unit tests by owner and cut the quick suite from 100 s to 13 s (#715) 2026-09-17 10:18:16 +03:00
fig-traversal.ts Refactor architecture boundaries across core, app, and packages (#234) 2026-04-30 15:14:19 +03:00
figma.ts chore(tests): remove easy non-null assertions 2026-05-06 02:59:56 +03:00
geometry.ts feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
large-document.ts perf(scene-graph): accelerate axis-aligned hit tests (#534) 2026-08-16 15:43:25 +03:00
layout.ts chore(lint): enforce type imports in tests 2026-05-06 02:35:57 +03:00
paths.ts Add heuristic overlap detection tool and CLI 2026-06-19 09:54:27 +10:00
properties.ts feat(app): migrate paint effect and export panels 2026-07-14 17:06:28 +03:00
scene.ts test: share scene variable helper 2026-06-30 10:55:05 +03:00
store.ts feat(text): create text boxes by dragging 2026-07-20 21:22:30 +03:00
test-ids.ts refactor(toolbar): reuse test id helpers 2026-05-15 13:13:24 +03:00
test-utils.ts test: extend timeout for slow gold-preview fixture tests 2026-06-19 11:05:25 +10:00
tools.ts chore(tests): remove easy non-null assertions 2026-05-06 02:59:56 +03:00
undo.ts chore(tests): narrow no-empty-function exceptions 2026-05-06 12:32:54 +03:00
vector-network.ts Refactor architecture boundaries across core, app, and packages (#234) 2026-04-30 15:14:19 +03:00
yjs-test-helper.d.ts perf(collab): skip unchanged Yjs node fields (#529) 2026-08-15 11:40:27 +03:00
yjs.ts fix(collab): replicate document content to joiners 2026-06-30 11:56:58 +03:00