@liminis/editor 0.2.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/LICENSE +0 -13
  2. package/README.md +158 -103
  3. package/dist/app/editor/CorrectionPanelPlugin.js +10 -11
  4. package/dist/app/editor/DragHandlePlugin.js +1 -1
  5. package/dist/app/editor/Editor.js +17 -5
  6. package/dist/app/editor/SelectionContextMenuPlugin.js +4 -4
  7. package/dist/app/editor/nodes/C4Component.js +8 -10
  8. package/dist/app/editor/nodes/C4Node.d.ts +1 -1
  9. package/dist/app/editor/nodes/DiagramContextMenu.js +5 -5
  10. package/dist/headless.d.ts +3 -5
  11. package/dist/headless.js +2 -4
  12. package/dist/index.d.ts +1 -1
  13. package/dist/styles.css +428 -325
  14. package/docs/decisions/adr-92-lexical-peer-range-policy.md +152 -0
  15. package/docs/decisions/adr-93-liminis-editor-defined-aliases.md +315 -0
  16. package/docs/decisions/adr-98-invert-token-direction.md +309 -0
  17. package/package.json +28 -27
  18. package/dist/app/editor/c4/C4InteractiveRenderer.d.ts +0 -35
  19. package/dist/app/editor/c4/C4InteractiveRenderer.js +0 -299
  20. package/dist/app/editor/c4/edge-clipping.d.ts +0 -24
  21. package/dist/app/editor/c4/edge-clipping.js +0 -139
  22. package/dist/app/editor/c4/hooks/useC4DiagramDrag.d.ts +0 -38
  23. package/dist/app/editor/c4/hooks/useC4DiagramDrag.js +0 -112
  24. package/dist/app/editor/c4/layout.d.ts +0 -25
  25. package/dist/app/editor/c4/layout.js +0 -839
  26. package/dist/app/editor/c4/parser.d.ts +0 -19
  27. package/dist/app/editor/c4/parser.js +0 -410
  28. package/dist/app/editor/c4/render-to-string.d.ts +0 -24
  29. package/dist/app/editor/c4/render-to-string.js +0 -34
  30. package/dist/app/editor/c4/renderer.d.ts +0 -64
  31. package/dist/app/editor/c4/renderer.js +0 -569
  32. package/dist/app/editor/c4/types.d.ts +0 -203
  33. package/dist/app/editor/c4/types.js +0 -43
package/LICENSE CHANGED
@@ -19,16 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
-
23
- ---
24
-
25
- This package vendors a modified copy of `mdast-util-wiki-link` (MIT,
26
- Copyright (c) 2020 Mark Hudnall). Its license and a description of the
27
- modifications ship alongside it, at
28
- `dist/markdown/vendor/mdast-util-wiki-link/`.
29
-
30
- This package derives from the `webview-ui` package of SlashMD
31
- (https://github.com/wolfdavo/SlashMD) by David Wolfenden, which that project's
32
- README declares to be MIT-licensed. SlashMD carries no LICENSE file and no
33
- copyright notice, so none is reproduced here; this notice records the
34
- derivation and the stated license in their absence.
package/README.md CHANGED
@@ -43,12 +43,20 @@ produce a broken editor context — peering is what prevents both.
43
43
 
44
44
  ```bash
45
45
  pnpm add react@^19 react-dom@^19 \
46
- lexical@^0.44 @lexical/react@^0.44 @lexical/code@^0.44 \
47
- @lexical/code-prism@^0.44 @lexical/link@^0.44 @lexical/list@^0.44 \
48
- @lexical/mark@^0.44 @lexical/markdown@^0.44 @lexical/rich-text@^0.44 \
49
- @lexical/selection@^0.44 @lexical/table@^0.44 @lexical/utils@^0.44
46
+ lexical@^0.49 @lexical/react@^0.49 @lexical/code@^0.49 \
47
+ @lexical/code-prism@^0.49 @lexical/link@^0.49 @lexical/list@^0.49 \
48
+ @lexical/mark@^0.49 @lexical/markdown@^0.49 @lexical/rich-text@^0.49 \
49
+ @lexical/selection@^0.49 @lexical/table@^0.49 @lexical/utils@^0.49
50
50
  ```
51
51
 
52
+ > **The Lexical peer ranges are single-caret, not a wide band.** Lexical is
53
+ > also `0.x`, where every minor is permitted to break — unlike React's range
54
+ > above, which spans an untested-but-stable range, the Lexical range names
55
+ > exactly the one minor this package is built and tested against. Expect it
56
+ > to move forward (e.g. to `^0.50`) only after this package has adopted and
57
+ > tested that release, not automatically at every upstream release. See
58
+ > `docs/decisions/adr-92-lexical-peer-range-policy.md`.
59
+
52
60
  pnpm v8+ and npm v7+ install peers automatically, so in practice the first
53
61
  command is usually enough.
54
62
 
@@ -198,24 +206,47 @@ Neither is a package defect, but only one of them tells you what is wrong.
198
206
 
199
207
  The editor's colors, borders and a few layout metrics are all CSS custom
200
208
  properties under a single package-owned vocabulary, `--liminis-editor-*`.
201
- Every one of them resolves with no host configuration at all the table
209
+ Every one of them resolves with no host configuration at all, and every one
210
+ of them *carries its own real value* declared at `:root`/`.dark` in
211
+ `styles.css` — there is no indirection to look through (ADR-98). The table
202
212
  below exists so you can *override* a palette, and also so you can *consume*
203
213
  one: every property this package declares with a value anywhere in
204
- `styles.css` the pre-`0.2.0` names still carrying the real defaults
205
- (`--vscode-*`, `--slashmd-*`, `--checkbox-*`, and a couple of standalone
206
- legacy names) that the `--liminis-editor-*` names below fall back to — is
207
- part of this package's public API, readable directly by a host, not only
208
- overridable. (The `--liminis-editor-*` names themselves are never declared
209
- with a value directly see "Has a default" below nor are legacy names
210
- like `--color-*` that appear only as an inner link in a fallback chain
211
- rather than a `:root`/`.dark` declaration; neither is part of the defined
212
- set this paragraph describes.) Some hosts do exactly that mapping their
213
- own design tokens onto these definitions with `var(--x)` rather than
214
- overriding them. Renaming or removing a definition is therefore a breaking
215
- change, the same as any other change to a supported API surface described
216
- under "Versioning policy" above, and is distinct from renaming a
217
- *consumption* site (covered separately in "Migrating from the old names"
218
- below) this package's CI guards against a definition disappearing
214
+ `styles.css` is part of this package's public API, readable directly by a
215
+ host, not only overridable.
216
+
217
+ Before `0.4.0`, a small set of pre-`0.2.0` names (`--vscode-*`,
218
+ `--checkbox-border`, `--editor-brand`) carried the real defaults, and every
219
+ `--liminis-editor-*` name was itself only a forward to one of them. That
220
+ direction is now reversed: those legacy names are deprecated shims
221
+ `<legacy-name>: var(--liminis-editor-x);` read by nothing inside this
222
+ package, kept only so that **reading** one of them (e.g. mapping a host's own
223
+ design tokens onto `--vscode-foreground`) still returns a real value, via
224
+ ordinary CSS cascade resolution of the shim's own `var()` reference.
225
+ **Setting** only a legacy name no longer themes the editor: every internal
226
+ consumption site reads `--liminis-editor-foreground` directly, never
227
+ `--vscode-foreground`, so a host's override of the legacy name changes what
228
+ that legacy property itself computes to and nothing else — it never reaches
229
+ the editor. This was verified with `getComputedStyle` in a running Electron
230
+ shell (`examples/electron/e2e/theming-aliases.spec.ts`), not assumed from
231
+ cascade theory alone — see "Migrating from the old names" below for what to
232
+ do about it. The pre-`0.2.0` `--slashmd-*` names have no shim at all — they
233
+ are deleted outright, verified unread by any known consumer (ADR-98).
234
+
235
+ `--liminis-editor-primary`/`-100` and `--liminis-editor-muted-foreground`/`-100`
236
+ back the C4 diagram's layout-toggle buttons. Until `0.4.0`, `C4Component.tsx`
237
+ checked liminis-app's own `--color-primary`/`--color-muted-foreground`
238
+ Tailwind tokens *first*, falling back to this package's own default — a
239
+ deliberate, documented exception (ADR-98) to the rule above. That exception
240
+ has been removed: these six expressions now read `--liminis-editor-*` only, the
241
+ same as every other consumption site in this package, and a host's
242
+ `--color-*` tokens no longer have any effect on them (see ADR-98's
243
+ amendment). A host that wants to override the C4 diagram colors sets
244
+ `--liminis-editor-primary` and its siblings, the same as for any other
245
+ token.
246
+
247
+ Renaming or removing a definition is a breaking change, the same as any
248
+ other change to a supported API surface described under "Versioning policy"
249
+ above — this package's CI guards against a definition disappearing
219
250
  unintentionally (ADR-092).
220
251
 
221
252
  **Previous name** is the pre-`0.2.0` name this property replaced — the exact
@@ -224,87 +255,83 @@ vocabulary (`—` for a property that was never renamed). **Controls** is a
224
255
  short description of what the token actually affects. **Kind** distinguishes
225
256
  tokens that only affect appearance (`Cosmetic`) from the handful that also
226
257
  affect layout (`Structural` — heading indents and the base font). **Has a
227
- default** marks tokens with a `--liminis-editor-*` `:root`/`.dark`
228
- declaration in `styles.css` directly; every row below reads "No (inline
229
- fallback only)" because each token instead resolves through a fallback chain
230
- — `--liminis-editor-x` first, then its previous name (which still carries the
231
- real `:root`/`.dark` default), so a host supplying only the old name keeps
232
- theming unchanged. See "Migrating from the old names" below.
258
+ default** marks tokens declared with a value in `styles.css` directly; every
259
+ row below reads "Yes" for that reason directly, not via an alias.
233
260
 
234
261
  This table is generated from `src/` by `node scripts/generate-theming-docs.mjs`
235
262
  and checked for staleness in CI (`tests/theming-contract.test.ts`) — a `var(--x)`
236
263
  added to the source without regenerating this block fails the build. Do not
237
264
  hand-edit the rows between the markers below. See ADR-085 for how the
238
- generation and drift guard work, ADR-087 for the rename and its compatibility
239
- design, and ADR-092 for the separate guard that protects the full *defined*
240
- set — every token declared with a value in `styles.css`, per the checked-in
241
- baseline (`scripts/lib/theming-defined-tokens-baseline.json`), a different
242
- and non-overlapping set of names from this table's rows — against an
243
- unintentional rename or removal run `pnpm docs:theming-baseline` after a
244
- deliberate one.
265
+ generation and drift guard work, ADR-087 for the original rename and its
266
+ compatibility design, ADR-092 for the separate guard that protects the full
267
+ *defined* set — every token declared with a value in `styles.css`, per the
268
+ checked-in baseline (`scripts/lib/theming-defined-tokens-baseline.json`)
269
+ against an unintentional rename or removal (run `pnpm docs:theming-baseline`
270
+ after a deliberate one), and ADR-98 for the direction inversion this section
271
+ describes, superseding ADR-93.
245
272
 
246
273
  <!-- theming-tokens:start -->
247
274
  | Custom property | Previous name | Controls | Kind | Has a default |
248
275
  | --- | --- | --- | --- | --- |
249
- | `--liminis-editor-background` | `--vscode-background` | Base background color of the editor surface and its popovers/menus. | Cosmetic | No (inline fallback only) |
250
- | `--liminis-editor-bold-color` | `--slashmd-bold-color` | Text color of bold (`**text**`) markdown spans. | Cosmetic | No (inline fallback only) |
251
- | `--liminis-editor-border` | `--vscode-border` | Default border color used throughout the editor chrome. | Cosmetic | No (inline fallback only) |
252
- | `--liminis-editor-button-background` | `--vscode-button-background` | Background of primary action buttons (e.g. the correction panel's "Apply" button). | Cosmetic | No (inline fallback only) |
253
- | `--liminis-editor-button-foreground` | `--vscode-button-foreground` | Text color of primary action buttons. | Cosmetic | No (inline fallback only) |
254
- | `--liminis-editor-callout-caution-bg` | `--slashmd-callout-caution-bg` | Background of "caution" callout blocks. | Cosmetic | No (inline fallback only) |
255
- | `--liminis-editor-callout-caution-border` | `--slashmd-callout-caution-border` | Left border accent of "caution" callout blocks. | Cosmetic | No (inline fallback only) |
256
- | `--liminis-editor-callout-important-bg` | `--slashmd-callout-important-bg` | Background of "important" callout blocks. | Cosmetic | No (inline fallback only) |
257
- | `--liminis-editor-callout-important-border` | `--slashmd-callout-important-border` | Left border accent of "important" callout blocks. | Cosmetic | No (inline fallback only) |
258
- | `--liminis-editor-callout-note-bg` | `--slashmd-callout-note-bg` | Background of "note" callout blocks. | Cosmetic | No (inline fallback only) |
259
- | `--liminis-editor-callout-note-border` | `--slashmd-callout-note-border` | Left border accent of "note" callout blocks. | Cosmetic | No (inline fallback only) |
260
- | `--liminis-editor-callout-tip-bg` | `--slashmd-callout-tip-bg` | Background of "tip" callout blocks. | Cosmetic | No (inline fallback only) |
261
- | `--liminis-editor-callout-tip-border` | `--slashmd-callout-tip-border` | Left border accent of "tip" callout blocks. | Cosmetic | No (inline fallback only) |
262
- | `--liminis-editor-callout-warning-bg` | `--slashmd-callout-warning-bg` | Background of "warning" callout blocks. | Cosmetic | No (inline fallback only) |
263
- | `--liminis-editor-callout-warning-border` | `--slashmd-callout-warning-border` | Left border accent of "warning" callout blocks. | Cosmetic | No (inline fallback only) |
264
- | `--liminis-editor-checkbox-border` | `--checkbox-border` | Border color of unchecked task-list checkboxes. | Cosmetic | No (inline fallback only) |
265
- | `--liminis-editor-code-bg` | `--vscode-code-bg` | Background of inline code spans and fenced code blocks. | Cosmetic | No (inline fallback only) |
266
- | `--liminis-editor-errorForeground` | `--vscode-errorForeground` | Text color for error and validation messages. | Cosmetic | No (inline fallback only) |
267
- | `--liminis-editor-external-link` | `--vscode-external-link` | Text color of links that point outside the document. | Cosmetic | No (inline fallback only) |
268
- | `--liminis-editor-focus-border` | `--vscode-focus-border` | Border color of the toolbar link-input field when focused. | Cosmetic | No (inline fallback only) |
269
- | `--liminis-editor-focusBorder` | `--vscode-focusBorder` | Color of the drag-and-drop position indicator while reordering blocks. | Cosmetic | No (inline fallback only) |
270
- | `--liminis-editor-font-family` | `--vscode-font-family` | Base font family for the editor content. | Structural | No (inline fallback only) |
271
- | `--liminis-editor-font-size` | `--vscode-font-size` | Base font size for the editor content. | Structural | No (inline fallback only) |
272
- | `--liminis-editor-foreground` | `--vscode-foreground` | Default text color throughout the editor. | Cosmetic | No (inline fallback only) |
273
- | `--liminis-editor-foreground-muted` | `--vscode-foreground-muted` | Hover border color for the frontmatter tray's raw-view toggle. | Cosmetic | No (inline fallback only) |
274
- | `--liminis-editor-h1-color` | `--slashmd-h1-color` | Text color of level-1 (`#`) headings. | Cosmetic | No (inline fallback only) |
275
- | `--liminis-editor-h1-indent` | `--slashmd-h1-indent` | Left margin of level-1 (`#`) headings. | Structural | No (inline fallback only) |
276
- | `--liminis-editor-h2-color` | `--slashmd-h2-color` | Text color of level-2 (`##`) headings. | Cosmetic | No (inline fallback only) |
277
- | `--liminis-editor-h2-indent` | `--slashmd-h2-indent` | Left margin of level-2 (`##`) headings. | Structural | No (inline fallback only) |
278
- | `--liminis-editor-h3-color` | `--slashmd-h3-color` | Text color of level-3 (`###`) headings. | Cosmetic | No (inline fallback only) |
279
- | `--liminis-editor-h3-indent` | `--slashmd-h3-indent` | Left margin of level-3 (`###`) headings. | Structural | No (inline fallback only) |
280
- | `--liminis-editor-h4-color` | `--slashmd-h4-color` | Text color of level-4 (`####`) headings. | Cosmetic | No (inline fallback only) |
281
- | `--liminis-editor-h4-indent` | `--slashmd-h4-indent` | Left margin of level-4 (`####`) headings. | Structural | No (inline fallback only) |
282
- | `--liminis-editor-h5-color` | `--slashmd-h5-color` | Text color of level-5 (`#####`) headings. | Cosmetic | No (inline fallback only) |
283
- | `--liminis-editor-h5-indent` | `--slashmd-h5-indent` | Left margin of level-5 (`#####`) headings. | Structural | No (inline fallback only) |
284
- | `--liminis-editor-input-bg` | `--vscode-input-bg` | Background of the toolbar link-input field. | Cosmetic | No (inline fallback only) |
285
- | `--liminis-editor-inputValidation-errorBackground` | `--vscode-inputValidation-errorBackground` | Background of inline validation-error messages. | Cosmetic | No (inline fallback only) |
286
- | `--liminis-editor-italic-color` | `--slashmd-italic-color` | Text color of italic (`*text*`) markdown spans. | Cosmetic | No (inline fallback only) |
287
- | `--liminis-editor-link` | `--vscode-link` | Text color of in-document links. | Cosmetic | No (inline fallback only) |
288
- | `--liminis-editor-menu-background` | `--vscode-menu-background` | Background of context menus (block, selection and correction menus). | Cosmetic | No (inline fallback only) |
289
- | `--liminis-editor-menu-border` | `--vscode-menu-border` | Border color of context menus. | Cosmetic | No (inline fallback only) |
290
- | `--liminis-editor-menu-foreground` | `--vscode-menu-foreground` | Text color of context menu items. | Cosmetic | No (inline fallback only) |
291
- | `--liminis-editor-menu-selectionBackground` | `--vscode-menu-selectionBackground` | Background of a hovered/selected context menu item. | Cosmetic | No (inline fallback only) |
292
- | `--liminis-editor-menu-separatorBackground` | `--vscode-menu-separatorBackground` | Color of separator lines inside context menus. | Cosmetic | No (inline fallback only) |
293
- | `--liminis-editor-muted-100` | `--color-muted-100` | Background of the C4 diagram layout-toggle buttons when inactive. | Cosmetic | No (inline fallback only) |
294
- | `--liminis-editor-muted-foreground` | `--color-muted-foreground` | Icon/text color of the C4 diagram layout-toggle buttons when inactive. | Cosmetic | No (inline fallback only) |
295
- | `--liminis-editor-notificationsInfoIcon-foreground` | `--vscode-notificationsInfoIcon-foreground` | Color of informational icons in inline notifications. | Cosmetic | No (inline fallback only) |
296
- | `--liminis-editor-primary` | `--color-primary` | Icon/text color of the C4 diagram layout-toggle buttons when active. | Cosmetic | No (inline fallback only) |
297
- | `--liminis-editor-primary-100` | `--color-primary-100` | Background of the C4 diagram layout-toggle buttons when active. | Cosmetic | No (inline fallback only) |
298
- | `--liminis-editor-selection` | `--vscode-selection` | Background color of selected/highlighted text. | Cosmetic | No (inline fallback only) |
299
- | `--liminis-editor-token-comment` | `--slashmd-token-comment` | Syntax-highlight color for comments in fenced code blocks. | Cosmetic | No (inline fallback only) |
300
- | `--liminis-editor-token-function` | `--slashmd-token-function` | Syntax-highlight color for function names in fenced code blocks. | Cosmetic | No (inline fallback only) |
301
- | `--liminis-editor-token-keyword` | `--slashmd-token-keyword` | Syntax-highlight color for keywords in fenced code blocks. | Cosmetic | No (inline fallback only) |
302
- | `--liminis-editor-token-operator` | `--slashmd-token-operator` | Syntax-highlight color for operators in fenced code blocks. | Cosmetic | No (inline fallback only) |
303
- | `--liminis-editor-token-property` | `--slashmd-token-property` | Syntax-highlight color for object properties in fenced code blocks. | Cosmetic | No (inline fallback only) |
304
- | `--liminis-editor-token-punctuation` | `--slashmd-token-punctuation` | Syntax-highlight color for punctuation in fenced code blocks. | Cosmetic | No (inline fallback only) |
305
- | `--liminis-editor-token-selector` | `--slashmd-token-selector` | Syntax-highlight color for CSS selectors in fenced code blocks. | Cosmetic | No (inline fallback only) |
306
- | `--liminis-editor-token-variable` | `--slashmd-token-variable` | Syntax-highlight color for variables in fenced code blocks. | Cosmetic | No (inline fallback only) |
307
- | `--liminis-editor-toolbar-hoverBackground` | `--vscode-toolbar-hoverBackground` | Background of a toolbar button on hover. | Cosmetic | No (inline fallback only) |
276
+ | `--liminis-editor-background` | `--vscode-background` | Base background color of the editor surface and its popovers/menus. | Cosmetic | Yes |
277
+ | `--liminis-editor-bold-color` | `--slashmd-bold-color` | Text color of bold (`**text**`) markdown spans. | Cosmetic | Yes |
278
+ | `--liminis-editor-border` | `--vscode-border` | Default border color used throughout the editor chrome. | Cosmetic | Yes |
279
+ | `--liminis-editor-button-background` | `--vscode-button-background` | Background of primary action buttons (e.g. the correction panel's "Apply" button). | Cosmetic | Yes |
280
+ | `--liminis-editor-button-foreground` | `--vscode-button-foreground` | Text color of primary action buttons. | Cosmetic | Yes |
281
+ | `--liminis-editor-callout-caution-bg` | `--slashmd-callout-caution-bg` | Background of "caution" callout blocks. | Cosmetic | Yes |
282
+ | `--liminis-editor-callout-caution-border` | `--slashmd-callout-caution-border` | Left border accent of "caution" callout blocks. | Cosmetic | Yes |
283
+ | `--liminis-editor-callout-important-bg` | `--slashmd-callout-important-bg` | Background of "important" callout blocks. | Cosmetic | Yes |
284
+ | `--liminis-editor-callout-important-border` | `--slashmd-callout-important-border` | Left border accent of "important" callout blocks. | Cosmetic | Yes |
285
+ | `--liminis-editor-callout-note-bg` | `--slashmd-callout-note-bg` | Background of "note" callout blocks. | Cosmetic | Yes |
286
+ | `--liminis-editor-callout-note-border` | `--slashmd-callout-note-border` | Left border accent of "note" callout blocks. | Cosmetic | Yes |
287
+ | `--liminis-editor-callout-tip-bg` | `--slashmd-callout-tip-bg` | Background of "tip" callout blocks. | Cosmetic | Yes |
288
+ | `--liminis-editor-callout-tip-border` | `--slashmd-callout-tip-border` | Left border accent of "tip" callout blocks. | Cosmetic | Yes |
289
+ | `--liminis-editor-callout-warning-bg` | `--slashmd-callout-warning-bg` | Background of "warning" callout blocks. | Cosmetic | Yes |
290
+ | `--liminis-editor-callout-warning-border` | `--slashmd-callout-warning-border` | Left border accent of "warning" callout blocks. | Cosmetic | Yes |
291
+ | `--liminis-editor-checkbox-border` | `--checkbox-border` | Border color of unchecked task-list checkboxes. | Cosmetic | Yes |
292
+ | `--liminis-editor-code-bg` | `--vscode-code-bg` | Background of inline code spans and fenced code blocks. | Cosmetic | Yes |
293
+ | `--liminis-editor-errorForeground` | `--vscode-errorForeground` | Text color for error and validation messages. | Cosmetic | Yes |
294
+ | `--liminis-editor-external-link` | `--vscode-external-link` | Text color of links that point outside the document. | Cosmetic | Yes |
295
+ | `--liminis-editor-focus-border` | `--vscode-focus-border` | Border color of the toolbar link-input field when focused. | Cosmetic | Yes |
296
+ | `--liminis-editor-focusBorder` | `--vscode-focusBorder` | Color of the drag-and-drop position indicator while reordering blocks. | Cosmetic | Yes |
297
+ | `--liminis-editor-font-family` | `--vscode-font-family` | Base font family for the editor content. | Structural | Yes |
298
+ | `--liminis-editor-font-size` | `--vscode-font-size` | Base font size for the editor content. | Structural | Yes |
299
+ | `--liminis-editor-foreground` | `--vscode-foreground` | Default text color throughout the editor. | Cosmetic | Yes |
300
+ | `--liminis-editor-foreground-muted` | `--vscode-foreground-muted` | Hover border color for the frontmatter tray's raw-view toggle. | Cosmetic | Yes |
301
+ | `--liminis-editor-h1-color` | `--slashmd-h1-color` | Text color of level-1 (`#`) headings. | Cosmetic | Yes |
302
+ | `--liminis-editor-h1-indent` | `--slashmd-h1-indent` | Left margin of level-1 (`#`) headings. | Structural | Yes |
303
+ | `--liminis-editor-h2-color` | `--slashmd-h2-color` | Text color of level-2 (`##`) headings. | Cosmetic | Yes |
304
+ | `--liminis-editor-h2-indent` | `--slashmd-h2-indent` | Left margin of level-2 (`##`) headings. | Structural | Yes |
305
+ | `--liminis-editor-h3-color` | `--slashmd-h3-color` | Text color of level-3 (`###`) headings. | Cosmetic | Yes |
306
+ | `--liminis-editor-h3-indent` | `--slashmd-h3-indent` | Left margin of level-3 (`###`) headings. | Structural | Yes |
307
+ | `--liminis-editor-h4-color` | `--slashmd-h4-color` | Text color of level-4 (`####`) headings. | Cosmetic | Yes |
308
+ | `--liminis-editor-h4-indent` | `--slashmd-h4-indent` | Left margin of level-4 (`####`) headings. | Structural | Yes |
309
+ | `--liminis-editor-h5-color` | `--slashmd-h5-color` | Text color of level-5 (`#####`) headings. | Cosmetic | Yes |
310
+ | `--liminis-editor-h5-indent` | `--slashmd-h5-indent` | Left margin of level-5 (`#####`) headings. | Structural | Yes |
311
+ | `--liminis-editor-input-bg` | `--vscode-input-bg` | Background of the toolbar link-input field. | Cosmetic | Yes |
312
+ | `--liminis-editor-inputValidation-errorBackground` | `--vscode-inputValidation-errorBackground` | Background of inline validation-error messages. | Cosmetic | Yes |
313
+ | `--liminis-editor-italic-color` | `--slashmd-italic-color` | Text color of italic (`*text*`) markdown spans. | Cosmetic | Yes |
314
+ | `--liminis-editor-link` | `--vscode-link` | Text color of in-document links. | Cosmetic | Yes |
315
+ | `--liminis-editor-menu-background` | `--vscode-menu-background` | Background of context menus (block, selection and correction menus). | Cosmetic | Yes |
316
+ | `--liminis-editor-menu-border` | `--vscode-menu-border` | Border color of context menus. | Cosmetic | Yes |
317
+ | `--liminis-editor-menu-foreground` | `--vscode-menu-foreground` | Text color of context menu items. | Cosmetic | Yes |
318
+ | `--liminis-editor-menu-selectionBackground` | `--vscode-menu-selectionBackground` | Background of a hovered/selected context menu item. | Cosmetic | Yes |
319
+ | `--liminis-editor-menu-separatorBackground` | `--vscode-menu-separatorBackground` | Color of separator lines inside context menus. | Cosmetic | Yes |
320
+ | `--liminis-editor-muted-100` | | Background of the C4 diagram layout-toggle buttons when inactive. | Cosmetic | Yes |
321
+ | `--liminis-editor-muted-foreground` | | Icon/text color of the C4 diagram layout-toggle buttons when inactive. | Cosmetic | Yes |
322
+ | `--liminis-editor-notificationsInfoIcon-foreground` | `--vscode-notificationsInfoIcon-foreground` | Color of informational icons in inline notifications. | Cosmetic | Yes |
323
+ | `--liminis-editor-primary` | `--editor-brand` | Icon/text color of the C4 diagram layout-toggle buttons when active. | Cosmetic | Yes |
324
+ | `--liminis-editor-primary-100` | | Background of the C4 diagram layout-toggle buttons when active. | Cosmetic | Yes |
325
+ | `--liminis-editor-selection` | `--vscode-selection` | Background color of selected/highlighted text. | Cosmetic | Yes |
326
+ | `--liminis-editor-token-comment` | `--slashmd-token-comment` | Syntax-highlight color for comments in fenced code blocks. | Cosmetic | Yes |
327
+ | `--liminis-editor-token-function` | `--slashmd-token-function` | Syntax-highlight color for function names in fenced code blocks. | Cosmetic | Yes |
328
+ | `--liminis-editor-token-keyword` | `--slashmd-token-keyword` | Syntax-highlight color for keywords in fenced code blocks. | Cosmetic | Yes |
329
+ | `--liminis-editor-token-operator` | `--slashmd-token-operator` | Syntax-highlight color for operators in fenced code blocks. | Cosmetic | Yes |
330
+ | `--liminis-editor-token-property` | `--slashmd-token-property` | Syntax-highlight color for object properties in fenced code blocks. | Cosmetic | Yes |
331
+ | `--liminis-editor-token-punctuation` | `--slashmd-token-punctuation` | Syntax-highlight color for punctuation in fenced code blocks. | Cosmetic | Yes |
332
+ | `--liminis-editor-token-selector` | `--slashmd-token-selector` | Syntax-highlight color for CSS selectors in fenced code blocks. | Cosmetic | Yes |
333
+ | `--liminis-editor-token-variable` | `--slashmd-token-variable` | Syntax-highlight color for variables in fenced code blocks. | Cosmetic | Yes |
334
+ | `--liminis-editor-toolbar-hoverBackground` | `--vscode-toolbar-hoverBackground` | Background of a toolbar button on hover. | Cosmetic | Yes |
308
335
  <!-- theming-tokens:end -->
309
336
 
310
337
  **A worked example.** To match a host's own palette, override a subset of
@@ -336,17 +363,45 @@ highest-value place to start.
336
363
  #### Migrating from the old names
337
364
 
338
365
  Before `0.2.0`, these tokens were split across four inconsistent prefixes:
339
- `--vscode-*`, `--slashmd-*`, `--color-*` and `--checkbox-*`. `0.2.0` renames
340
- all 59 of them to `--liminis-editor-*`, but **a host that still only supplies
341
- the old names keeps working unchanged** — every renamed token resolves
342
- `--liminis-editor-x` first, then falls back to its specific previous name,
343
- so nothing breaks silently on upgrade. The old prefixes are deprecated as of
344
- `0.2.0` and will be removed in a future major release; migrate at your own
345
- pace using the table above's **Previous name** column, which lists each
346
- renamed property's exact old name the mapping isn't always a mechanical
347
- prefix swap (`--checkbox-border` became `--liminis-editor-checkbox-border`,
348
- not `--liminis-editor-border`, to avoid colliding with `--vscode-border`'s
349
- new name), so look it up rather than deriving it.
366
+ `--vscode-*`, `--slashmd-*`, `--color-*` and `--checkbox-*`. `0.2.0` renamed
367
+ all of them to `--liminis-editor-*`. **As of `0.4.0` (ADR-98), a host that
368
+ still only *sets* an old name to theme the editor no longer works** — this is
369
+ a breaking change from `0.2.0`'s original guarantee, corrected here rather
370
+ than left silently wrong. `--old-name-x: var(--liminis-editor-x);` is a
371
+ one-line `:root`-scoped shim that this package never itself reads; a host's
372
+ own override of the old name still changes what the old name computes to,
373
+ but since every internal consumption site reads `--liminis-editor-x`
374
+ directly, that override never reaches the editor. Set the corresponding
375
+ `--liminis-editor-*` name instead see the table above's **Previous name**
376
+ column to find it. This was verified with `getComputedStyle` in a running
377
+ Electron shell, not assumed (`examples/electron/e2e/theming-aliases.spec.ts`),
378
+ and neither known consumer of this package (`liminis-app`, Zusammen) sets a
379
+ legacy name today. `--slashmd-*` is the one prefix with no shim at all: it is
380
+ deleted outright in `0.4.0`, verified unread by any known consumer (ADR-98).
381
+
382
+ The old prefixes are deprecated and will be removed in a future major
383
+ release; migrate at your own pace using the table above's **Previous name**
384
+ column, which lists each renamed property's exact old name — the mapping
385
+ isn't always a mechanical prefix swap (`--checkbox-border` became
386
+ `--liminis-editor-checkbox-border`, not `--liminis-editor-border`, to avoid
387
+ colliding with `--vscode-border`'s new name), so look it up rather than
388
+ deriving it.
389
+
390
+ Reading, not just overriding, is also migratable, and is the direction
391
+ `0.4.0` actually improves: before ADR-98, a host reading a legacy name
392
+ directly (e.g. mapping its own design tokens onto `--vscode-foreground`)
393
+ could switch that read to `--liminis-editor-foreground` only as long as
394
+ nothing (host or package) set the new name — some `--liminis-editor-*`
395
+ aliases forwarded to a token this package never defined at all
396
+ (`--liminis-editor-primary`, notably, forwarded to liminis-app's
397
+ `--color-primary` and baked a literal, `#3b82f6`, whenever liminis-app
398
+ hadn't set it), so switching a read to those names would return a value
399
+ this package didn't actually own. As of `0.4.0`, every `--liminis-editor-*`
400
+ name carries its own real, package-owned default — read migration is now a
401
+ like-for-like swap with no caveat, for every name except
402
+ `--liminis-editor-primary`/`-100`, whose default value deliberately changed
403
+ (see verveguy/zusammen#134, the migration this addresses, and ADR-98 for why
404
+ the old value was a defect, not a default worth preserving).
350
405
 
351
406
  ## Annotations
352
407
 
@@ -29,10 +29,10 @@ const panelStyle = () => {
29
29
  padding: '12px',
30
30
  minWidth: '280px',
31
31
  maxWidth: '360px',
32
- background: `var(--liminis-editor-menu-background, var(--vscode-menu-background, ${dark ? '#252526' : '#ffffff'}))`,
33
- border: `1px solid var(--liminis-editor-menu-border, var(--vscode-menu-border, ${dark ? '#454545' : '#d4d4d4'}))`,
32
+ background: `var(--liminis-editor-menu-background)`,
33
+ border: `1px solid var(--liminis-editor-menu-border)`,
34
34
  boxShadow: dark ? '0 4px 16px rgba(0,0,0,0.4)' : '0 4px 16px rgba(0,0,0,0.15)',
35
- color: `var(--liminis-editor-menu-foreground, var(--vscode-menu-foreground, ${dark ? '#cccccc' : '#333333'}))`,
35
+ color: `var(--liminis-editor-menu-foreground)`,
36
36
  fontFamily: 'system-ui, -apple-system, sans-serif',
37
37
  fontSize: '13px',
38
38
  };
@@ -260,8 +260,8 @@ export function CorrectionPanelPlugin() {
260
260
  if (!isOpen)
261
261
  return null;
262
262
  const dark = isDark();
263
- const borderColor = `var(--liminis-editor-menu-border, var(--vscode-menu-border, ${dark ? '#454545' : '#d4d4d4'}))`;
264
- const hoverBg = `var(--liminis-editor-menu-selectionBackground, var(--vscode-menu-selectionBackground, ${dark ? '#094771' : '#e8e8e8'}))`;
263
+ const borderColor = `var(--liminis-editor-menu-border)`;
264
+ const hoverBg = `var(--liminis-editor-menu-selectionBackground)`;
265
265
  const mutedColor = dark ? '#888888' : '#999999';
266
266
  const inputBg = dark ? '#1e1e1e' : '#f5f5f5';
267
267
  const warningBg = dark ? '#4a3500' : '#fff8e1';
@@ -273,12 +273,12 @@ export function CorrectionPanelPlugin() {
273
273
  cursor: 'pointer',
274
274
  border: `1px solid ${borderColor}`,
275
275
  background: 'transparent',
276
- color: `var(--liminis-editor-menu-foreground, var(--vscode-menu-foreground, ${dark ? '#cccccc' : '#333333'}))`,
276
+ color: `var(--liminis-editor-menu-foreground)`,
277
277
  };
278
278
  const btnPrimary = {
279
279
  ...btnBase,
280
- background: `var(--liminis-editor-button-background, var(--vscode-button-background, ${dark ? '#0e639c' : '#007acc'}))`,
281
- color: `var(--liminis-editor-button-foreground, var(--vscode-button-foreground, #ffffff))`,
280
+ background: `var(--liminis-editor-button-background)`,
281
+ color: `var(--liminis-editor-button-foreground)`,
282
282
  border: 'none',
283
283
  opacity: isSubmitting ? 0.6 : 1,
284
284
  };
@@ -297,7 +297,7 @@ export function CorrectionPanelPlugin() {
297
297
  borderRadius: '4px',
298
298
  border: `1px solid ${borderColor}`,
299
299
  background: inputBg,
300
- color: `var(--liminis-editor-menu-foreground, var(--vscode-menu-foreground, ${dark ? '#cccccc' : '#333333'}))`,
300
+ color: `var(--liminis-editor-menu-foreground)`,
301
301
  fontSize: '13px',
302
302
  boxSizing: 'border-box',
303
303
  }, onKeyDown: (e) => {
@@ -313,7 +313,6 @@ export function CorrectionPanelPlugin() {
313
313
  }, children: "This term is already a canonical name for other aliases. Proceeding will re-canonicalize it." })), _jsxs("div", { style: { display: 'flex', gap: '8px', justifyContent: 'flex-end' }, children: [_jsx("button", { style: btnBase, onClick: close, children: "Cancel" }), confirmPhase === 'needs-canonical-warning' ? (_jsx("button", { style: btnPrimary, onClick: handleConfirm, disabled: isSubmitting || !canonicalInput.trim(), children: "Proceed anyway" })) : (_jsx("button", { style: btnPrimary, onClick: handleConfirm, disabled: isSubmitting || !canonicalInput.trim(), children: isSubmitting ? 'Saving…' : 'Confirm' }))] })] }));
314
314
  }
315
315
  function SuggestionItem({ name, hoverBg, onClick, }) {
316
- const dark = isDark();
317
316
  return (_jsx("button", { onClick: onClick, style: {
318
317
  display: 'block',
319
318
  width: '100%',
@@ -324,7 +323,7 @@ function SuggestionItem({ name, hoverBg, onClick, }) {
324
323
  cursor: 'pointer',
325
324
  fontSize: '13px',
326
325
  borderRadius: '3px',
327
- color: `var(--liminis-editor-menu-foreground, var(--vscode-menu-foreground, ${dark ? '#cccccc' : '#333333'}))`,
326
+ color: `var(--liminis-editor-menu-foreground)`,
328
327
  }, onMouseEnter: (e) => {
329
328
  e.currentTarget.style.background = hoverBg;
330
329
  }, onMouseLeave: (e) => {
@@ -293,7 +293,7 @@ export function DragHandlePlugin() {
293
293
  left: 0,
294
294
  right: 0,
295
295
  height: 2,
296
- background: 'var(--liminis-editor-focusBorder, var(--vscode-focusBorder, #007acc))',
296
+ background: 'var(--liminis-editor-focusBorder)',
297
297
  pointerEvents: 'none',
298
298
  zIndex: 100,
299
299
  } }))] }));
@@ -240,6 +240,20 @@ function CursorRestorePlugin({ contentVersion, cursorToRestoreRef, }) {
240
240
  const cursorToRestore = cursorToRestoreRef.current;
241
241
  if (!cursorToRestore)
242
242
  return;
243
+ // Only restore the caret if the user was actually in the editor when the
244
+ // reload arrived. A content reload is not always the user's doing: an
245
+ // agent writing the open file reaches here too, and re-focusing then pulls
246
+ // the caret out of whatever the user is typing in — a chat prompt beside
247
+ // the editor, say — mid-sentence. Restoring a caret nobody is looking at
248
+ // buys nothing, so an unfocused editor is left entirely alone (no
249
+ // selection write either, so reconciliation cannot move focus as a side
250
+ // effect). Same rule as `AutoFocusPlugin`: never take focus unasked.
251
+ // Read synchronously, before the update below can perturb focus.
252
+ const rootElement = editor.getRootElement();
253
+ const hadFocus = rootElement !== null &&
254
+ (rootElement === document.activeElement || rootElement.contains(document.activeElement));
255
+ if (!hadFocus)
256
+ return;
243
257
  console.log('[CursorRestorePlugin] Restoring cursor', {
244
258
  contentVersion,
245
259
  offset: cursorToRestore.offset,
@@ -262,11 +276,9 @@ function CursorRestorePlugin({ contentVersion, cursorToRestoreRef, }) {
262
276
  console.log('[CursorRestorePlugin] Selection restored at offset', newOffset);
263
277
  }
264
278
  });
265
- // Re-focus the editor
266
- const rootElement = editor.getRootElement();
267
- if (rootElement) {
268
- rootElement.focus({ preventScroll: true });
269
- }
279
+ // Re-focus the editor. Reached only when it already had focus above, so
280
+ // this restores focus the reload disturbed rather than taking it.
281
+ rootElement.focus({ preventScroll: true });
270
282
  });
271
283
  }, [editor, contentVersion, cursorToRestoreRef]);
272
284
  return null;
@@ -36,10 +36,10 @@ const itemStyle = {
36
36
  function SelectionContextMenu({ visible, x, y, selectedText, onChatAboutThis, annotationAffordances, onCreateAnnotation, onClose, }) {
37
37
  const menuRef = useRef(null);
38
38
  const isDark = typeof document !== 'undefined' && document.documentElement.classList.contains('dark');
39
- const bgColor = `var(--liminis-editor-menu-background, var(--vscode-menu-background, ${isDark ? '#252526' : '#ffffff'}))`;
40
- const borderColor = `var(--liminis-editor-menu-border, var(--vscode-menu-border, ${isDark ? '#454545' : '#d4d4d4'}))`;
41
- const textColor = `var(--liminis-editor-menu-foreground, var(--vscode-menu-foreground, ${isDark ? '#cccccc' : '#333333'}))`;
42
- const hoverBg = `var(--liminis-editor-menu-selectionBackground, var(--vscode-menu-selectionBackground, ${isDark ? '#094771' : '#e8e8e8'}))`;
39
+ const bgColor = `var(--liminis-editor-menu-background)`;
40
+ const borderColor = `var(--liminis-editor-menu-border)`;
41
+ const textColor = `var(--liminis-editor-menu-foreground)`;
42
+ const hoverBg = `var(--liminis-editor-menu-selectionBackground)`;
43
43
  useEffect(() => {
44
44
  if (!visible)
45
45
  return;
@@ -11,10 +11,8 @@ import { mergeRegister } from '@lexical/utils';
11
11
  import { $getNodeByKey, $getSelection, $isNodeSelection, COMMAND_PRIORITY_HIGH, KEY_ESCAPE_COMMAND, SELECTION_CHANGE_COMMAND, } from 'lexical';
12
12
  import { Move, RotateCcw } from 'lucide-react';
13
13
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
14
- import { parseC4, validateC4 } from '../c4/parser.js';
15
- import { layoutC4Diagram } from '../c4/layout.js';
16
- import { C4Renderer, C4ErrorDisplay } from '../c4/renderer.js';
17
- import { C4InteractiveRenderer } from '../c4/C4InteractiveRenderer.js';
14
+ import { parseC4, validateC4, layoutC4Diagram } from '@liminis/diagrams/core';
15
+ import { C4Renderer, C4ErrorDisplay, C4InteractiveRenderer } from '@liminis/diagrams/react';
18
16
  import { $isC4Node } from './C4Node.js';
19
17
  import { DiagramContextMenu, useDiagramContextMenu } from './DiagramContextMenu.js';
20
18
  function C4DiagramDisplay({ code, nodeKey, onDoubleClick, isEditable, }) {
@@ -181,11 +179,11 @@ function C4DiagramDisplay({ code, nodeKey, onDoubleClick, isEditable, }) {
181
179
  border: 'none',
182
180
  cursor: 'pointer',
183
181
  backgroundColor: isEditingLayout
184
- ? 'var(--liminis-editor-primary-100, var(--color-primary-100, rgba(59, 130, 246, 0.1)))'
185
- : 'var(--liminis-editor-muted-100, var(--color-muted-100, rgba(128, 128, 128, 0.1)))',
182
+ ? 'var(--liminis-editor-primary-100)'
183
+ : 'var(--liminis-editor-muted-100)',
186
184
  color: isEditingLayout
187
- ? 'var(--liminis-editor-primary, var(--color-primary, #3b82f6))'
188
- : 'var(--liminis-editor-muted-foreground, var(--color-muted-foreground, #6b7280))',
185
+ ? 'var(--liminis-editor-primary)'
186
+ : 'var(--liminis-editor-muted-foreground)',
189
187
  }, children: _jsx(Move, { size: 16 }) }), manualLayout && (_jsx("button", { type: "button", onClick: (e) => {
190
188
  e.stopPropagation();
191
189
  handleResetLayout();
@@ -198,8 +196,8 @@ function C4DiagramDisplay({ code, nodeKey, onDoubleClick, isEditable, }) {
198
196
  borderRadius: '4px',
199
197
  border: 'none',
200
198
  cursor: 'pointer',
201
- backgroundColor: 'var(--liminis-editor-muted-100, var(--color-muted-100, rgba(128, 128, 128, 0.1)))',
202
- color: 'var(--liminis-editor-muted-foreground, var(--color-muted-foreground, #6b7280))',
199
+ backgroundColor: 'var(--liminis-editor-muted-100)',
200
+ color: 'var(--liminis-editor-muted-foreground)',
203
201
  }, children: _jsx(RotateCcw, { size: 16 }) }))] })), isEditingLayout && parseResult.diagram ? (_jsx(C4InteractiveRenderer, { diagram: parseResult.diagram, isDarkMode: isDarkMode, isEditMode: isEditingLayout, manualPositions: manualPositions, onPositionChange: handlePositionChange })) : (_jsx(C4Renderer, { layout: layout, isDarkMode: isDarkMode })), _jsx(DiagramContextMenu, { ...contextMenu.props, onEditText: isEditable ? onDoubleClick : undefined, onEditLayout: isEditable ? () => setIsEditingLayout(prev => !prev) : undefined, onResetLayout: isEditable ? handleResetLayout : undefined, isEditingLayout: isEditingLayout, hasManualLayout: !!manualLayout })] }));
204
202
  }
205
203
  // =============================================================================
@@ -3,7 +3,7 @@
3
3
  * Uses DecoratorNode pattern similar to MermaidNode
4
4
  */
5
5
  import { DecoratorNode, DOMConversionMap, DOMExportOutput, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from 'lexical';
6
- import type { ManualLayout } from '../c4/types.js';
6
+ import type { ManualLayout } from '@liminis/diagrams/core';
7
7
  export type SerializedC4Node = Spread<{
8
8
  code: string;
9
9
  manualLayout?: ManualLayout;
@@ -75,11 +75,11 @@ const separatorStyle = {
75
75
  export function DiagramContextMenu({ visible, x, y, onCopyImage, onClose, onEditText, onEditLayout, onResetLayout, isEditingLayout, hasManualLayout, }) {
76
76
  const menuRef = useRef(null);
77
77
  const isDark = typeof document !== 'undefined' && document.documentElement.classList.contains('dark');
78
- const bgColor = `var(--liminis-editor-menu-background, var(--vscode-menu-background, ${isDark ? '#252526' : '#ffffff'}))`;
79
- const borderColor = `var(--liminis-editor-menu-border, var(--vscode-menu-border, ${isDark ? '#454545' : '#d4d4d4'}))`;
80
- const textColor = `var(--liminis-editor-menu-foreground, var(--vscode-menu-foreground, ${isDark ? '#cccccc' : '#333333'}))`;
81
- const hoverBg = `var(--liminis-editor-menu-selectionBackground, var(--vscode-menu-selectionBackground, ${isDark ? '#094771' : '#e8e8e8'}))`;
82
- const separatorColor = `var(--liminis-editor-menu-separatorBackground, var(--vscode-menu-separatorBackground, ${isDark ? '#454545' : '#d4d4d4'}))`;
78
+ const bgColor = `var(--liminis-editor-menu-background)`;
79
+ const borderColor = `var(--liminis-editor-menu-border)`;
80
+ const textColor = `var(--liminis-editor-menu-foreground)`;
81
+ const hoverBg = `var(--liminis-editor-menu-selectionBackground)`;
82
+ const separatorColor = `var(--liminis-editor-menu-separatorBackground)`;
83
83
  // Close on click outside or Escape
84
84
  useEffect(() => {
85
85
  if (!visible)
@@ -29,11 +29,9 @@
29
29
  * graph yourself. The fix for a violation is always to prune that graph, never to
30
30
  * widen main's `lib`.
31
31
  */
32
- export { renderC4DiagramToSVG } from './app/editor/c4/render-to-string.js';
33
- export { parseC4, validateC4 } from './app/editor/c4/parser.js';
34
- export { layoutC4Diagram } from './app/editor/c4/layout.js';
35
- export { isSystem, isContainer, isComponent, isPerson, isExternal, isBoundary, } from './app/editor/c4/types.js';
36
- export type { C4ElementType, C4Shape, C4Direction, C4Style, C4Properties, C4Element, C4Relationship, C4Diagram, Point, LayoutNode, LayoutEdge, LayoutResult, LayoutOptions, ParseError, ParseResult, ManualLayout, } from './app/editor/c4/types.js';
32
+ export { renderC4DiagramToSVG } from '@liminis/diagrams/server';
33
+ export { parseC4, validateC4, layoutC4Diagram, isSystem, isContainer, isComponent, isPerson, isExternal, isBoundary, } from '@liminis/diagrams/core';
34
+ export type { C4ElementType, C4Shape, C4Direction, C4Style, C4Properties, C4Element, C4Relationship, C4Diagram, Point, LayoutNode, LayoutEdge, LayoutResult, LayoutOptions, ParseError, ParseResult, ManualLayout, } from '@liminis/diagrams/core';
37
35
  export { createLiteAdaptorDocument, TEX_PACKAGES } from './mathjax-config.js';
38
36
  export type { TeXPackage, MathDocument, LiteMathJaxInstance } from './mathjax-config.js';
39
37
  export { getFileType } from './utils/file-types.js';
package/dist/headless.js CHANGED
@@ -30,10 +30,8 @@
30
30
  * widen main's `lib`.
31
31
  */
32
32
  // C4 diagram subsystem — parse, layout, and server-side SVG rendering
33
- export { renderC4DiagramToSVG } from './app/editor/c4/render-to-string.js';
34
- export { parseC4, validateC4 } from './app/editor/c4/parser.js';
35
- export { layoutC4Diagram } from './app/editor/c4/layout.js';
36
- export { isSystem, isContainer, isComponent, isPerson, isExternal, isBoundary, } from './app/editor/c4/types.js';
33
+ export { renderC4DiagramToSVG } from '@liminis/diagrams/server';
34
+ export { parseC4, validateC4, layoutC4Diagram, isSystem, isContainer, isComponent, isPerson, isExternal, isBoundary, } from '@liminis/diagrams/core';
37
35
  // MathJax lite-adaptor factory (equation rendering, server-side export).
38
36
  //
39
37
  // `createBrowserAdaptorDocument` / `BrowserMathJaxInstance` are deliberately NOT
package/dist/index.d.ts CHANGED
@@ -37,4 +37,4 @@ export * from './types.js';
37
37
  export { useEditorStore } from './stores/editorStore.js';
38
38
  export { findSvgElement } from './app/editor/nodes/diagram-utils.js';
39
39
  export * from './headless.js';
40
- export type { ParseResult as C4ParseResult, ParseError as C4ParseError, } from './app/editor/c4/types.js';
40
+ export type { ParseResult as C4ParseResult, ParseError as C4ParseError, } from '@liminis/diagrams/core';