mirror of
https://github.com/penpot/penpot.git
synced 2026-11-26 21:00:32 +00:00
📚 Clarify shared text guidance
Give shared text rules a direct name and distinguish derived position data from whether it can be persisted on a shape. AI-assisted-by: gpt-6.1-terra
This commit is contained in:
parent
2e736233e7
commit
09969d622e
@ -37,6 +37,6 @@ Components, variants, and debugging:
|
||||
- Components, variants, referential integrity, repair and diagnosis: `mem:common/components`.
|
||||
|
||||
Text and tests:
|
||||
- Shared text data conversion, DraftJS compatibility, modern text content, and derived position data: `mem:common/text-subtleties`.
|
||||
- Shared text data conversion, DraftJS compatibility, modern text content, and derived position data: `mem:common/text`.
|
||||
- Common test commands, helper conventions, production-path test mutations, and runtime coverage choices: `mem:common/testing`.
|
||||
- Cross-cutting testing principles, anti-patterns, and verification checklist: `mem:testing`.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# Common Text Subtleties
|
||||
# Common text
|
||||
|
||||
## DraftJS compatibility
|
||||
|
||||
@ -10,5 +10,5 @@
|
||||
## Modern text content
|
||||
|
||||
- Modern text content schema is narrow: root -> paragraph-set -> paragraph -> text nodes.
|
||||
- `position-data` is derived layout/geometry/font fragment data and should be treated as generated state, not source-of-truth file data.
|
||||
- Token propagation and some non-current-page text updates drop `:position-data` so it can be regenerated in the right runtime context.
|
||||
- `position-data` is derived layout/geometry/font fragment data. It can be committed to the shape, but is generated state rather than the source of truth and must be regenerable from the content and runtime context.
|
||||
- Token propagation and some non-current-page text updates drop `:position-data` so it can be regenerated in the right runtime context.
|
||||
@ -10,4 +10,4 @@
|
||||
- Applying a token is blocked while a text shape is being edited. Otherwise the workspace records its name, resolves active tokens through Style Dictionary or tokenscript according to feature flags, updates concrete attrs and groups the operation in an undo transaction.
|
||||
- Composite and atomic typography token attrs replace one another. Spacing application targets gap/padding on layout containers and margins on immediate layout children.
|
||||
- Propagation resolves active tokens and buffers `update-shapes` commits, processing the current page before other pages. It clears affected frame/component thumbnails and drops text `:position-data` on non-current pages so it can be regenerated.
|
||||
- For workspace state and undo see `mem:frontend/workspace-store` and `mem:frontend/workspace-commits`; for geometry and text data see `mem:common/geometry` and `mem:common/text-subtleties`.
|
||||
- For workspace state and undo see `mem:frontend/workspace-store` and `mem:frontend/workspace-commits`; for geometry and text data see `mem:common/geometry` and `mem:common/text`.
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# Frontend text editor
|
||||
|
||||
- `frontend/text-editor` is the JS/Vite `@penpot/text-editor` package, with its own Vitest and browser-test setup. Its entry point is `src/editor/TextEditor.js`; shared text data rules are in `mem:common/text-subtleties`.
|
||||
- `frontend/text-editor` is the JS/Vite `@penpot/text-editor` package, with its own Vitest and browser-test setup. Its entry point is `src/editor/TextEditor.js`; shared text data rules are in `mem:common/text`.
|
||||
- It copies render-wasm artifacts from `frontend/resources/public/js` to `src/wasm`. After rebuilding render-wasm, run `pnpm run wasm:update` from `frontend/text-editor` when local development or tests need updated artifacts.
|
||||
- From `frontend/text-editor`, `pnpm run dev` starts Vite, `pnpm run test` runs tests, `pnpm run coverage` collects coverage, and `pnpm run test:watch:e2e` starts browser tests. `pnpm run fmt:js` checks formatting. Frontend root JS formatting also covers text-editor sources, but does not replace package tests.
|
||||
- Text behavior can cross this package, render-wasm and CLJS integration; verify the runtime that owns the changed behavior. For the separate shared UI package see `mem:frontend/ui-package`.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user