feat: F4.8a the documentation items in model and file, measured against Java's

New oracle DocuRun on Java's JDocuElement. Italic is kept (the model knew
only bold), an item keeps its file's size and font size (Swift's 32 x 24
and 8-72 changed Java's files), an item without a colour is Java's light
grey. Java's new items, colour lists, font sizes and styles, the drag's
smallest sizes and Java's stacking; document commands for the editor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-04 10:42:21 +00:00
co-authored by Claude Opus 5.5
parent 9252b942c4
commit 56cdb4926e
18 changed files with 1889 additions and 57 deletions
+5 -5
View File
@@ -4,7 +4,7 @@
// so that it can run on every change while someone drags a device.
import * as Y from 'yjs';
import { compareIds, stableGeneratedMacAddress, type DocumentationItemKind, type HostLabelPolicy, type InstallableProgram, type NodeKind } from '@mdg-filius/core';
import { inJavaDrawingOrder, stableGeneratedMacAddress, type DocumentationItemKind, type HostLabelPolicy, type InstallableProgram, type NodeKind } from '@mdg-filius/core';
import { inOrder, ROOTS } from './projectDoc.js';
export interface NodeView {
@@ -44,6 +44,7 @@ export interface DocumentationView {
readonly font: string;
readonly size: number;
readonly bold: boolean;
readonly italic: boolean;
readonly order: number;
}
@@ -153,12 +154,11 @@ export function topologyView(doc: Y.Doc): TopologyView {
font: item.get('font') as string,
size: item.get('size') as number,
bold: item.get('bold') as boolean,
italic: item.get('italic') === true,
order: item.get('order') as number,
}));
// The model's render order (inDeterministicRenderOrder): rectangles below texts, then by order, then by id.
const layer = (item: DocumentationView) => (item.kind === 'rectangle' ? 0 : 1);
docs.sort((left, right) => layer(left) - layer(right) || left.order - right.order || compareIds(left.id, right.id));
return { nodes, links, docs };
// In Java's drawing order, the last on top: texts over rectangles, of one kind the earlier over the later.
return { nodes, links, docs: inJavaDrawingOrder(docs) };
}
/** What a computer's desktop needs of the document (Java's GUIDesktopWindow, GUIDesktopPanel). */