openpencil/tools
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
..
architecture fix: explain unsupported browsers instead of a blank window (#745) 2026-09-22 14:40:59 +04:00
authoring-reference style: sort authoring reference dependencies 2026-09-13 21:06:47 +03:00
brand feat: refresh branding with generated platform icons (#707) 2026-09-16 11:54:07 +03:00
ci chore: merge master into ci/ai-attribution-policy 2026-09-15 23:23:26 +03:00
ci-images ci: parallelize quality and trim shard builds (#558) 2026-08-18 22:52:18 +03:00
dev-server feat(editor): checkpoint live interaction improvements 2026-09-15 11:36:17 +03:00
docs docs: remove untranslated localized placeholders 2026-08-13 20:40:41 +03:00
i18n fix(fonts): explain PingFang substitution and draw its CJK text (#781) 2026-09-26 11:14:30 +04:00
lint refactor!: move shared primitives below dom-css and core (#771) 2026-09-26 11:39:11 +04:00
navigation-benchmark perf(canvas): rebuild navigation rendering (#591) 2026-08-31 13:39:40 +03:00
package-artifacts fix(tools): run npm packaging guards in package verification 2026-09-26 01:40:24 +04:00
package-quality fix(tools): run npm packaging guards in package verification 2026-09-26 01:40:24 +04:00
pr-review-guidance ci: move workflow helpers into tools 2026-06-07 09:15:15 +03:00
release-packages refactor!: move shared primitives below dom-css and core (#771) 2026-09-26 11:39:11 +04:00
secret-scan chore(tools): add secret scanning gate 2026-07-01 15:24:06 +03:00
tauri-menu fix: protect unsaved documents and defer credential access (#713) 2026-09-17 15:25:15 +03:00
type-shapes fix(tools): exclude dependencies from type shape scans 2026-08-20 15:55:48 +03:00
unit-tests refactor!: move shared primitives below dom-css and core (#771) 2026-09-26 11:39:11 +04:00
visual-oracles refactor!: move shared primitives below dom-css and core (#771) 2026-09-26 11:39:11 +04:00
test.ts ci: move workflow helpers into tools 2026-06-07 09:15:15 +03:00