jsmind 0.9.1 → 2.0.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 (40) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +78 -67
  3. package/README.zh.md +81 -0
  4. package/dist/cli.js +4482 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/jsmind.cjs +4101 -0
  7. package/dist/jsmind.cjs.map +1 -0
  8. package/dist/jsmind.d.ts +1269 -0
  9. package/dist/jsmind.js +4099 -0
  10. package/dist/jsmind.js.map +1 -0
  11. package/dist/jsmind.umd.js +4107 -0
  12. package/dist/jsmind.umd.js.map +1 -0
  13. package/package.json +65 -51
  14. package/es6/README-en.md +0 -37
  15. package/es6/README.md +0 -34
  16. package/es6/jsmind.draggable-node.js +0 -9
  17. package/es6/jsmind.draggable-node.js.map +0 -1
  18. package/es6/jsmind.js +0 -9
  19. package/es6/jsmind.js.map +0 -1
  20. package/es6/jsmind.screenshot.js +0 -9
  21. package/es6/jsmind.screenshot.js.map +0 -1
  22. package/style/jsmind.css +0 -408
  23. package/types/generated/index.d.ts +0 -8
  24. package/types/generated/jsmind.common.d.ts +0 -66
  25. package/types/generated/jsmind.d.ts +0 -366
  26. package/types/generated/jsmind.data_provider.d.ts +0 -56
  27. package/types/generated/jsmind.dom.d.ts +0 -59
  28. package/types/generated/jsmind.format.d.ts +0 -100
  29. package/types/generated/jsmind.graph.d.ts +0 -180
  30. package/types/generated/jsmind.layout_provider.d.ts +0 -182
  31. package/types/generated/jsmind.mind.d.ts +0 -121
  32. package/types/generated/jsmind.node.d.ts +0 -62
  33. package/types/generated/jsmind.option.d.ts +0 -64
  34. package/types/generated/jsmind.plugin.d.ts +0 -21
  35. package/types/generated/jsmind.shortcut_provider.d.ts +0 -52
  36. package/types/generated/jsmind.util.d.ts +0 -26
  37. package/types/generated/jsmind.view_provider.d.ts +0 -347
  38. package/types/generated/plugins/jsmind.draggable-node.d.ts +0 -229
  39. package/types/generated/plugins/jsmind.screenshot.d.ts +0 -83
  40. package/types/tsconfig.declaration.json +0 -19
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsmind.umd.js","sources":["../src/common/error.ts","../src/observer/manager.ts","../src/model/data/edge.ts","../src/common/index.ts","../src/model/data/node.ts","../src/model/data/node-content.ts","../src/common/object.ts","../src/common/option.ts","../src/generation/index.ts","../src/model/event/index.ts","../src/model/event/data.ts","../src/model/mind.ts","../src/common/dom.ts","../src/model/data/style.ts","../src/view/shadow.ts","../src/view/node.ts","../src/view/edge.ts","../src/view/export-svg.ts","../src/view/export.ts","../src/view/index.ts","../src/common/cache.ts","../src/arranger/mindmap.ts","../src/model/mind-observer.ts","../src/common/debug.ts","../src/application/mind-change-coordinator.ts","../src/application/commander.ts","../src/serialization/freemind.ts","../src/serialization/validation.ts","../src/serialization/json.ts","../src/serialization/serializer-factory.ts","../src/application/jsmind.ts"],"sourcesContent":["/**\n * Custom error class for jsMind operations.\n *\n * @public\n */\nexport class JsMindError extends Error {\n /** The data associated with the error. */\n data: Record<string, unknown>;\n\n /**\n * Stable machine-readable code, when the failure has one.\n *\n * @remarks\n * Callers branch on this rather than on `message`, which is written for\n * humans and may be reworded at any time.\n */\n code?: string;\n\n /**\n * Creates a new JsMindError instance.\n *\n * @param message - The error message.\n * @param data - Extra data carried with the error.\n * @param code - Stable machine-readable code, if any.\n */\n constructor(message: string, data: Record<string, unknown> = {}, code?: string) {\n super(message);\n this.data = data;\n if (code !== undefined) {\n this.code = code;\n }\n }\n}\n\n","import { JsMindError } from '../common/error.ts';\nimport type { JmObserver } from './index.ts';\n\n/**\n * Manager for observers of an observed object.\n *\n * @public\n */\nexport class JmObserverManager<T> {\n /** The object being observed. */\n observedObject: T;\n\n /** @internal */\n _observers: JmObserver<T>[];\n\n /**\n * Creates an observer manager for an observed object.\n *\n * @param observedObject - The object to observe.\n */\n constructor(observedObject: T) {\n this.observedObject = observedObject;\n this._observers = [];\n }\n\n /**\n * Adds an observer to the observed object.\n *\n * @param observer - An object that contains an `update(observedObject, event)` method.\n * @throws {@link JsMindError} If the observer is not a valid JmObserver instance.\n */\n addObserver(observer: JmObserver<T>): void {\n if(!observer || !('update' in observer) || typeof observer.update !== 'function') {\n throw new JsMindError('observer is not a valid JmObserver instance');\n }\n this._observers.push(observer);\n }\n\n /**\n * Removes an observer that was previously added by the `addObserver` method.\n *\n * @param observer - The observer to remove.\n */\n removeObserver(observer: JmObserver<T>): void {\n this._observers = this._observers.filter(o => o !== observer);\n }\n\n /**\n * Removes all observers from the object.\n */\n clearObservers(): void {\n this._observers = [];\n }\n\n /**\n * Notifies the event to all observers.\n *\n * @remarks\n * This is an asynchronous method. Each observer is notified in a separate\n * asynchronous operation.\n *\n * @param event - Events are defined by different observed objects, which\n * represent specific information about the changes.\n */\n async notifyObservers(event: unknown): Promise<void> {\n this._observers.forEach(async (observer: JmObserver<T>) => {\n await new Promise<void>((resolve) => {\n setTimeout(() => {\n observer.update(this.observedObject, event);\n resolve();\n });\n });\n }\n );\n }\n}\n\n","import { JsMindError } from '../../common/error.ts';\nimport type { JmLineStyle } from './style.ts';\n\n/**\n * Options for creating a new edge.\n *\n * @public\n */\nexport interface EdgeCreationOptions {\n /** Optional edge ID, will be generated if not provided. */\n edgeId?: string;\n /** Optional label for the edge. */\n label?: string;\n /** Optional visual style for the edge line. */\n style?: JmLineStyle;\n}\n\n/**\n * Edge of mind map.\n *\n * @remarks\n * Edges represent additional relationships between nodes (not parent-child relationships).\n *\n * @public\n */\nexport class JmEdge {\n /** The unique identifier of the edge. */\n id: string;\n\n /** The ID of the source node. */\n sourceNodeId: string;\n\n /** The ID of the target node. */\n targetNodeId: string;\n\n /** The type of the edge. */\n type: JmEdgeType;\n\n /** The optional label of the edge. */\n label: string | null;\n\n /**\n * Visual style of the edge line.\n *\n * @remarks\n * Uses the same `JmLineStyle` as `JmNodeStyle.incoming` so that\n * hierarchical and additional relationships share one vocabulary.\n */\n style?: JmLineStyle;\n\n /**\n * Creates a new edge.\n *\n * @param id - The unique identifier of the edge.\n * @param sourceNodeId - The ID of the source node.\n * @param targetNodeId - The ID of the target node.\n * @param type - The type of the edge.\n * @param label - Optional label for the edge.\n * @throws {@link JsMindError} If any of the required parameters are invalid.\n */\n constructor(id: string, sourceNodeId: string, targetNodeId: string, type: JmEdgeType, label: string | null = null) {\n if (!id) {\n throw new JsMindError('invalid edge id');\n }\n if (!sourceNodeId) {\n throw new JsMindError('invalid source node id');\n }\n if (!targetNodeId) {\n throw new JsMindError('invalid target node');\n }\n if (!type) {\n throw new JsMindError('invalid edge type');\n }\n this.id = id;\n this.sourceNodeId = sourceNodeId;\n this.targetNodeId = targetNodeId;\n this.type = type;\n this.label = label;\n }\n}\n\n/**\n * Type of edge - only for additional relationships (not parent-child).\n *\n * @public\n */\nexport const JmEdgeType = {\n /** Link edge type. */\n Link: 'link',\n} as const;\n\nexport type JmEdgeType = typeof JmEdgeType[keyof typeof JmEdgeType];\n\n","/**\n * Represents a size with width and height.\n *\n * @public\n */\nexport class JmSize {\n /** The width value. */\n width: number;\n\n /** The height value. */\n height: number;\n\n /**\n * Creates a new size instance.\n *\n * @param width - The width value.\n * @param height - The height value.\n */\n constructor(width: number, height: number) {\n this.width = width;\n this.height = height;\n }\n}\n\nexport class JmPoint {\n x: number;\n\n y: number;\n\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n\n offset(offset: JmPoint): JmPoint {\n return new JmPoint(this.x + offset.x, this.y + offset.y);\n }\n\n static readonly Zero: JmPoint = new JmPoint(0, 0);\n}\n\nexport class JmBounds {\n center: JmPoint;\n\n size: JmSize;\n\n constructor(center: JmPoint, size: JmSize) {\n this.center = center;\n this.size = size;\n }\n}\n","import type { JmElement } from '../../common/dom.ts';\nimport { JsMindError } from '../../common/error.ts';\nimport { JmPoint } from '../../common/index.ts';\nimport { JmSize } from '../../common/index.ts';\nimport type { JmNodeContent } from './node-content.ts';\nimport type { JmNodeStyle } from './style.ts';\n\n/**\n * Options for creating a new node.\n *\n * @public\n */\nexport interface NodeCreationOptions {\n /** Optional custom node ID. */\n nodeId?: string;\n /** Whether the node is folded (default: false). */\n folded?: boolean;\n /** Direction of the node (default: null). */\n side?: JmNodeSide;\n /** Additional data for the node (default: {}). */\n data?: Record<string, unknown>;\n /** Visual overrides for the node (default: none). */\n style?: JmNodeStyle;\n}\n\n/**\n * Options for specifying node destination.\n *\n * @public\n */\nexport interface NodeDestinationOptions {\n /** The ID of the target parent node (required). */\n parentId: string;\n /** The position index among siblings (if not provided, adds to end). */\n position?: number\n /** The direction of the node (if not provided, keeps current direction). */\n side?: JmNodeSide;\n}\n\n\nexport class JmNodeViewData {\n element: JmElement | null = null;\n\n expander: JmElement | null = null;\n\n leadingLine: SVGPathElement | null = null;\n}\n\nexport class JmNodeLayoutData {\n side: JmNodeSide = JmNodeSide.Center;\n\n visible: boolean = true;\n\n size: JmSize = new JmSize(0, 0);\n\n withDescendantsSize: JmSize = new JmSize(0, 0);\n\n offsetToParent: JmPoint = new JmPoint(0, 0);\n}\n\nclass NodeInternalData {\n view: JmNodeViewData = new JmNodeViewData();\n\n layout: JmNodeLayoutData = new JmNodeLayoutData();\n}\n/**\n * Node of mind map.\n *\n * @public\n */\nexport class JmNode {\n /** The unique identifier of the node. */\n id: string;\n\n /** The content of the node. */\n content: JmNodeContent;\n\n /** The parent node, or null if this is the root node. */\n parent: JmNode | null;\n\n /** Array of child nodes. */\n children: JmNode[];\n\n /** Whether the node is folded (collapsed). */\n folded: boolean;\n\n /** The direction of the node. */\n side: JmNodeSide;\n\n /** Additional data associated with the node. */\n data: Record<string, unknown>;\n\n /**\n * Visual overrides for this node.\n *\n * @remarks\n * Unset fields fall back to the theme. Storing only the difference keeps\n * theme changes propagating to every node that did not override anything.\n */\n style?: JmNodeStyle;\n\n /** View data associated with the node. */\n _data: NodeInternalData;\n\n /**\n * Creates a new node.\n *\n * @param id - The unique identifier of the node.\n * @param content - The content of the node.\n * @throws {@link JsMindError} If the node ID or content is invalid.\n */\n constructor(id: string, content: JmNodeContent) {\n if (!id) {\n throw new JsMindError('Invalid node id');\n }\n if (!content) {\n throw new JsMindError('Content is required');\n }\n\n this.id = id;\n this.content = content;\n this.parent = null;\n this.children = [];\n this.folded = false;\n this.side = JmNodeSide.SideA;\n this.data = {};\n this._data = new NodeInternalData();\n }\n\n /**\n * Lists all subnode IDs recursively.\n *\n * @returns Array of all subnode IDs including this node's children and their descendants.\n */\n getAllSubnodeIds(): string[] {\n const nodeIds: string[] = [];\n if(this.children.length > 0) {\n this.children.forEach((node)=>{\n nodeIds.push(node.id);\n nodeIds.push(...node.getAllSubnodeIds());\n });\n }\n return nodeIds;\n }\n\n /**\n * Compares this node with another node.\n *\n * @param other - The other node to compare with.\n * @returns True if they are equal, false otherwise.\n */\n equals(other: JmNode): boolean {\n return this.id === other.id\n && this.content.type === other.content.type\n && this.content.value === other.content.value\n && this.folded === other.folded\n && this.side === other.side\n && ((this.parent === null && other.parent === null) || (this.parent!.id === other.parent!.id))\n && this.children.length === other.children.length\n && this.children.every((child, idx, _)=>{ return child.id === other.children[idx].id; });\n }\n\n /**\n * Checks if this node is a descendant of another node.\n *\n * @param potentialAncestor - The potential ancestor node.\n * @returns True if this node is a descendant of potentialAncestor.\n */\n isDescendant(potentialAncestor: JmNode): boolean {\n if (!potentialAncestor || !potentialAncestor.children) {\n return false;\n }\n\n for (const child of potentialAncestor.children) {\n if (child.id === this.id) {\n return true;\n }\n if (this.isDescendant(child)) {\n return true;\n }\n }\n return false;\n }\n\n isRoot(): boolean {\n return this.parent === null;\n }\n}\n\n/**\n * Enumeration for directions of node.\n *\n * @public\n */\nexport const JmNodeSide = {\n /** Left direction. */\n SideB: -1,\n /** Center direction. */\n Center: 0,\n /** Right direction. */\n SideA: 1,\n} as const;\n\nexport type JmNodeSide = typeof JmNodeSide[keyof typeof JmNodeSide];\n","/**\n * Content types and utilities for JsMind nodes.\n *\n * @packageDocumentation\n */\n\n/**\n * Enumeration for content types of node.\n *\n * @public\n */\nexport const JmNodeContentType = {\n /** Text content type. */\n Text: 'text',\n} as const;\n\nexport type JmNodeContentType = typeof JmNodeContentType[keyof typeof JmNodeContentType];\n\n/**\n * Content of mind map node.\n *\n * @public\n */\nexport class JmNodeContent {\n /** The type of the content. */\n type: JmNodeContentType;\n\n /** The actual content value. */\n value: unknown;\n\n /**\n * Creates a content object.\n *\n * @param type - The type of content.\n * @param value - The actual content value.\n * @throws {@link Error} If the content type is invalid.\n */\n constructor(type: JmNodeContentType, value: unknown) {\n if (!type || !Object.values(JmNodeContentType).includes(type)) {\n throw new Error(`Invalid content type: ${type}`);\n }\n this.type = type;\n this.value = value;\n }\n\n /**\n * Checks if content is of specific type.\n *\n * @param type - The type to check.\n * @returns True if content is of the specified type.\n */\n hasType(type: JmNodeContentType): boolean {\n return this.type === type;\n }\n\n /**\n * Checks if content is text type.\n *\n * @returns True if content is text type.\n */\n isText(): boolean {\n return this.hasType(JmNodeContentType.Text);\n }\n\n getText(): string {\n if (!this.isText()) {\n throw new Error('Content is not text type');\n }\n return this.value as string;\n }\n\n /**\n * Creates a text content object.\n *\n * @param text - The text content.\n * @returns The content object.\n */\n static createText(text: string): JmNodeContent {\n return new JmNodeContent(JmNodeContentType.Text, text);\n }\n\n /**\n * Creates a content object from an object with type and value.\n *\n * @param obj - The object to create content from.\n * @returns The content object.\n */\n static fromObject(obj: { type: JmNodeContentType, value: unknown }): JmNodeContent {\n return new JmNodeContent(obj.type, obj.value);\n }\n}\n\n","/**\n * Plain-object helpers.\n *\n * @packageDocumentation\n */\n\n/**\n * Merges user values over default values, returning a new object.\n *\n * @remarks\n * A one-level merge: nested objects are replaced, not merged field by field.\n * Callers that need a deeper merge must merge each nested section themselves.\n *\n * The user values being absent returns a copy of the defaults rather than the\n * defaults themselves, so the result can be mutated without reaching back into\n * whatever constant was passed in.\n *\n * @param defaultValues - The base values.\n * @param userValues - Values to apply on top, if any.\n * @returns A new object; neither input is mutated.\n *\n * @public\n */\nexport function mergeObjects<T>(defaultValues: T, userValues?: Partial<T>): T {\n if (!userValues) {\n return { ...defaultValues };\n }\n\n return {\n ...defaultValues,\n ...userValues\n } as T;\n}\n","/**\n * Metadata for the mind map.\n *\n * @public\n */\n\nimport { mergeObjects } from './object.ts';\nexport interface MindMetadata {\n /** The author of the mind map. */\n author: string;\n /** The name of the mind map. */\n name: string;\n /** The version of the mind map. */\n version: string;\n}\n\n/**\n * Configuration options for the mind map.\n *\n * @public\n */\nexport interface MindOptions {\n rootNodeId: string;\n}\n\nexport interface ViewPadding {\n left: number;\n right: number;\n top: number;\n bottom: number;\n}\n\nexport const ViewExpanderStyle = {\n Char: 'char',\n Number: 'number'\n} as const;\n\ntype ViewExpanderStyle = typeof ViewExpanderStyle[keyof typeof ViewExpanderStyle];\n\nexport interface ViewExpanderOptions {\n style: ViewExpanderStyle;\n // expanded: string;\n // collapsed: string;\n}\nexport interface ViewOptions {\n padding: ViewPadding;\n expander: ViewExpanderOptions;\n}\n\nexport interface LayoutOptions {\n parentChildSpace: number;\n siblingSpace: number;\n cousinSpace: number;\n expanderSize: number;\n}\n\n/**\n * Options for JsMind.\n *\n * @public\n */\nexport interface JsMindOptions {\n mind: MindOptions;\n view: ViewOptions;\n layout: LayoutOptions;\n}\n\nexport const DEFAULT_METADATA: MindMetadata = {\n author: 'hizzgdev@163.com',\n name: 'jsMind Mindmap',\n version: '1.0'\n};\n\nexport const DEFAULT_OPTIONS: JsMindOptions = {\n mind: {\n rootNodeId: 'root'\n },\n view: {\n padding: {\n left: 100,\n right: 100,\n top: 50,\n bottom: 50\n },\n expander: {\n style: ViewExpanderStyle.Char\n // expanded: '\\u229D', // ⊝\n // collapsed: '\\u2295' // ⊕\n }\n },\n layout: {\n parentChildSpace: 30,\n siblingSpace: 20,\n cousinSpace: 15,\n expanderSize: 13\n }\n};\n\n/**\n * Merges the provided options with the default options and returns a new options object.\n *\n * @param options - Partial options to merge with default options\n * @returns A new merged options object\n *\n * @public\n */\nexport function mergeJsMindOptions(options?: Partial<JsMindOptions>): JsMindOptions {\n if (!options) {\n return { ...DEFAULT_OPTIONS };\n }\n\n return {\n mind: {\n ...mergeObjects(DEFAULT_OPTIONS.mind, options.mind)\n },\n view: {\n ...mergeObjects(DEFAULT_OPTIONS.view, options.view)\n },\n layout: {\n ...mergeObjects(DEFAULT_OPTIONS.layout, options.layout)\n }\n };\n}\n","/**\n * Interface for generating unique IDs.\n *\n * @remarks\n * IdGenerator is an interface for generating unique IDs.\n *\n * @example\n * ```typescript\n * class MyIdGenerator extends IdGenerator {\n * constructor() {\n * super();\n * this._seq = 0;\n * }\n * newId() {\n * return 'my' + (this._seq++);\n * }\n * }\n * ```\n *\n * @public\n */\nexport class IdGenerator {\n /**\n * Generates a new unique ID.\n *\n * @returns A new unique ID.\n * @throws {@link Error} If not implemented.\n */\n newId(): string {\n throw new Error('not implemented');\n }\n}\n\n/**\n * Simple implementation of IdGenerator.\n *\n * @public\n */\nexport class SimpleIdGenerator extends IdGenerator {\n /** The seed value for ID generation. */\n seed: number;\n\n /** The sequence counter. */\n seq: number;\n\n /** The prefix for generated IDs. */\n prefix: string;\n\n /**\n * Creates a new SimpleIdGenerator instance.\n *\n * @param prefix - Optional prefix for generated IDs. Defaults to empty string.\n */\n constructor(prefix?: string) {\n super();\n this.seed = new Date().getTime();\n this.seq = 0;\n this.prefix = prefix || '';\n }\n\n /**\n * Generates a new unique ID.\n *\n * @returns A new unique ID with the format: prefix + (seed + seq).toString(36)\n */\n newId(): string {\n this.seq++;\n return this.prefix + (this.seed + this.seq).toString(36);\n }\n}\n\n/**\n * Global ID generator instance.\n *\n * @public\n */\nexport const GLOBAL_ID_GENERATOR = new SimpleIdGenerator('jm-');\n\n","\n\n/**\n * Enumeration of mind map event types.\n *\n * @public\n */\nexport const JmMindEventType = {\n /** Event fired when a node is added. */\n NodeAdded: 1,\n /** Event fired when a node is removed. */\n NodeRemoved: 2,\n /** Event fired when a node is updated. */\n NodeUpdated: 3,\n /** Event fired when a node is moved. */\n NodeMoved: 4,\n /** Event fired when an edge is added. */\n EdgeAdded: 5,\n /** Event fired when an edge is removed. */\n EdgeRemoved: 6,\n} as const;\n\nexport type JmMindEventType = typeof JmMindEventType[keyof typeof JmMindEventType];\n","import { JmMindEventType } from './index.ts';\nimport type { JmNode, JmNodeSide} from '../data/node.ts';\nimport type { JmEdge } from '../data/edge.ts';\n\n/**\n * Event data containing the state change in JmMind.\n *\n * @public\n */\nexport class JmMindEvent {\n /** The type of the event. */\n readonly type: JmMindEventType;\n\n /** The event data. */\n readonly data: JmMindEventData;\n\n /**\n * Creates a new JmMindEvent instance.\n *\n * @param type - The type of the event.\n * @param data - The event data.\n */\n constructor(type: JmMindEventType, data: JmMindEventData) {\n this.type = type;\n this.data = data;\n }\n\n static onNodeAdded(node: JmNode) {\n return new JmMindEvent(JmMindEventType.NodeAdded, new JmMindEventDataOnNodeAdded(node));\n }\n\n static onNodeRemoved(node: JmNode, removedNodeIds: string[], removedEdgeIds: string[]) {\n return new JmMindEvent(JmMindEventType.NodeRemoved, new JmMindEventDataOnNodeRemoved(node, removedNodeIds, removedEdgeIds));\n }\n\n static onNodeUpdated(node: JmNode, property: string, originValue: unknown, newValue: unknown) {\n return new JmMindEvent(JmMindEventType.NodeUpdated, new JmMindEventDataOnNodeUpdated(node, property, originValue, newValue));\n }\n\n static onNodeMoved(node: JmNode, oldParentId: string | null, oldPosition: number | null, oldSide: JmNodeSide | null) {\n return new JmMindEvent(JmMindEventType.NodeMoved, new JmMindEventDataOnNodeMoved(node, oldParentId, oldPosition, oldSide));\n }\n\n static onEdgeAdded(edge: JmEdge) {\n return new JmMindEvent(JmMindEventType.EdgeAdded, new JmMindEventDataOnEdgeAdded(edge));\n }\n\n static onEdgeRemoved(edge: JmEdge) {\n return new JmMindEvent(JmMindEventType.EdgeRemoved, new JmMindEventDataOnEdgeRemoved(edge));\n }\n\n}\n\n\nexport class JmMindEventDataOnNodeAdded {\n readonly node: JmNode;\n\n constructor(node: JmNode) {\n this.node = node;\n }\n}\n\nexport class JmMindEventDataOnNodeRemoved {\n readonly node: JmNode;\n\n readonly removedNodeIds: string[];\n\n readonly removedEdgeIds: string[];\n\n constructor(node: JmNode, removedNodeIds: string[], removedEdgeIds: string[]) {\n this.node = node;\n this.removedNodeIds = removedNodeIds.slice();\n this.removedEdgeIds = removedEdgeIds.slice();\n }\n}\n\nexport class JmMindEventDataOnNodeUpdated {\n readonly node: JmNode;\n\n readonly property: string;\n\n readonly originValue: unknown;\n\n readonly newValue: unknown;\n\n constructor(node: JmNode, property: string, originValue: unknown, newValue: unknown) {\n this.node = node;\n this.property = property;\n this.originValue = originValue;\n this.newValue = newValue;\n }\n}\n\nexport class JmMindEventDataOnNodeMoved {\n readonly node: JmNode;\n\n readonly oldParentId: string | null;\n\n readonly oldPosition: number | null;\n\n readonly oldSide: JmNodeSide | null;\n\n constructor(node: JmNode, oldParentId: string | null, oldPosition: number | null, oldSide: JmNodeSide | null) {\n this.node = node;\n this.oldParentId = oldParentId;\n this.oldPosition = oldPosition;\n this.oldSide = oldSide;\n }\n}\n\nexport class JmMindEventDataOnEdgeAdded {\n readonly edge: JmEdge;\n\n constructor(edge: JmEdge) {\n this.edge = edge;\n }\n}\n\nexport class JmMindEventDataOnEdgeRemoved {\n readonly edge: JmEdge;\n\n constructor(edge: JmEdge) {\n this.edge = edge;\n }\n}\n\nexport type JmMindEventData = JmMindEventDataOnNodeRemoved | JmMindEventDataOnNodeAdded | JmMindEventDataOnNodeUpdated | JmMindEventDataOnNodeMoved | JmMindEventDataOnEdgeAdded | JmMindEventDataOnEdgeRemoved;\n","import { JmObserverManager } from '../observer/manager.ts';\nimport { JmEdge, type EdgeCreationOptions, type JmEdgeType } from './data/edge.ts';\nimport { JmNode, type NodeCreationOptions, type NodeDestinationOptions, JmNodeSide } from './data/node.ts';\nimport { JmNodeContent } from './data/node-content.ts';\nimport { type MindMetadata, type MindOptions, DEFAULT_METADATA, DEFAULT_OPTIONS } from '../common/option.ts';\nimport { mergeObjects } from '../common/object.ts';\nimport { SimpleIdGenerator } from '../generation/index.ts';\nimport type { JmStyle } from './data/style.ts';\n\nimport { JmMindEvent } from './event/data.ts';\nimport { JsMindError } from '../common/error.ts';\n\n/**\n * Represents a mind map with nodes and edges.\n *\n * @public\n */\nexport class JmMind {\n /** Metadata for the mind map. */\n meta: MindMetadata;\n\n /** Configuration options for the mind map. */\n options: MindOptions;\n\n /**\n * Style declaration for the mind map.\n *\n * @remarks\n * This mind map inherits from `style.theme` (default `\"default\"`) and\n * overrides whatever else the declaration lists. Resolution and deep\n * merging happen at render time via `resolveJmStyle`, not here — this\n * field only stores what the file said.\n */\n style?: JmStyle;\n\n /** Manager for observers of this mind map. */\n observerManager: JmObserverManager<JmMind>;\n\n /** Manager for node operations. */\n nodeManager: JmNodeManager;\n\n /** @internal Internal ID generator for nodes and edges. */\n _idGenerator: SimpleIdGenerator;\n\n /** @internal Dictionary of all nodes by ID. */\n _nodes: Record<string, JmNode>;\n\n /** @internal Dictionary of all edges by ID. */\n _edges: Record<string, JmEdge>;\n\n /** @internal The root node of the mind map. */\n _root: JmNode;\n\n /**\n * Creates a new mind map.\n *\n * @param metadata - Metadata for the mind map.\n * @param options - Configuration options for the mind map.\n */\n constructor(metadata: Partial<MindMetadata> = {}, options: Partial<MindOptions> = {}) {\n this.meta = mergeObjects(DEFAULT_METADATA, metadata) as MindMetadata;\n this.options = mergeObjects(DEFAULT_OPTIONS.mind, options) as MindOptions;\n this.observerManager = new JmObserverManager<JmMind>(this);\n this.nodeManager = new JmNodeManager(this);\n this._idGenerator = new SimpleIdGenerator('jm-');\n this._nodes = {};\n this._edges = {};\n this._root = this._createRootNode();\n }\n\n /**\n * Gets the root node.\n *\n * @returns The root node.\n */\n get root(): JmNode {\n return this.lite(this._root);\n }\n\n /**\n * Adds an edge between two nodes.\n *\n * @param sourceNodeId - The source node ID.\n * @param targetNodeId - The target node ID.\n * @param type - The edge type.\n * @param options - Optional edge creation options.\n * @returns The created edge.\n * @throws {@link JsMindError} If the source or target node does not exist.\n */\n addEdge(sourceNodeId: string, targetNodeId: string, type: JmEdgeType, options?: EdgeCreationOptions): JmEdge {\n // Validate nodes exist\n this._getNodeById(sourceNodeId);\n this._getNodeById(targetNodeId);\n\n const edgeId = (options && options.edgeId) || this._idGenerator.newId();\n const label = (options && options.label) || null;\n const edge = new JmEdge(edgeId, sourceNodeId, targetNodeId, type, label);\n if (options && options.style !== undefined) {\n edge.style = options.style;\n }\n this._edges[edgeId] = edge;\n\n // Emit event\n this.observerManager.notifyObservers(JmMindEvent.onEdgeAdded(edge));\n\n return edge;\n }\n\n\n addChildNode(content: unknown, parentId: string): JmNode {\n if(!parentId) {\n throw new JsMindError('parentId is required for addChildNode');\n }\n if(!content) {\n throw new JsMindError('content is required for addChildNode');\n }\n\n let nodeContent: JmNodeContent;\n if(content instanceof JmNodeContent) {\n nodeContent = content;\n } else if(typeof content === 'string') {\n nodeContent = JmNodeContent.createText(content);\n } else {\n throw new JsMindError('content must be a string or a JmNodeContent object');\n }\n return this.addNode(nodeContent, { parentId: parentId });\n }\n\n /**\n * Adds a new node to the mind map at a specific destination.\n *\n * @param content - Content for the new node.\n * @param destOptions - Destination options (required).\n * @param nodeOptions - Optional node creation options.\n * @returns The created node.\n * @throws {@link JsMindError} If destOptions.parentId is missing.\n */\n addNode(content: JmNodeContent, destOptions: NodeDestinationOptions, nodeOptions?: NodeCreationOptions): JmNode {\n // Validate destination options\n if (!destOptions || !destOptions.parentId) {\n throw new JsMindError('destOptions.parentId is required for addNode');\n }\n\n // Get target parent\n const targetParent = this._getNodeById(destOptions.parentId);\n\n // Create node content\n const nodeContent = content instanceof JmNodeContent ? content : JmNodeContent.fromObject(content);\n\n // Create and initialize the node\n const node = this._newNode(nodeContent, nodeOptions);\n\n // Use existing helper method for placement\n this._addNodeToParent(node, targetParent, destOptions.position);\n\n // Apply destination side if specified\n if (destOptions.side !== undefined && destOptions.side !== null) {\n node.side = destOptions.side;\n }\n\n // Emit event\n this.observerManager.notifyObservers(JmMindEvent.onNodeAdded(node));\n\n return this.lite(node);\n }\n\n /**\n * Finds a node from the mind map by the given ID.\n *\n * @param nodeId - The given node ID.\n * @returns The corresponding node in this mind map if it exists, otherwise null.\n */\n findNodeById(nodeId: string): JmNode | null {\n const node = this._nodes[nodeId];\n return !!node ? this.lite(node) : null;\n }\n\n /**\n * Gets all edges for a specific node.\n *\n * @param nodeId - The node ID.\n * @param type - Optional edge type filter.\n * @returns Array of edges involving the node.\n */\n getEdges(nodeId: string, type: JmEdgeType | null = null): JmEdge[] {\n return Object.values(this._edges).filter(edge => {\n return (edge.sourceNodeId === nodeId || edge.targetNodeId === nodeId) &&\n (!type || edge.type === type);\n });\n }\n\n /**\n * Moves a node to a new parent and position.\n *\n * @param nodeId - The ID of the node to move.\n * @param destOptions - Destination options.\n * @returns The moved node.\n * @throws {@link JsMindError} If destOptions are missing, node not found, or invalid move operation.\n */\n moveNode(nodeId: string, destOptions: NodeDestinationOptions): JmNode {\n if (!destOptions || Object.keys(destOptions).length === 0) {\n throw new JsMindError('destOptions are required for moveNode operation');\n }\n\n const node = this._getNodeById(nodeId);\n if (!node) {\n throw new JsMindError(`Node with ID '${nodeId}' not found`);\n }\n\n // Skip all logic for root node - it cannot be moved\n if (node === this.root) {\n return this.lite(node);\n }\n\n // Extract options\n const targetParentId = destOptions.parentId;\n const targetPosition = destOptions.position;\n const targetSide = destOptions.side;\n\n // Capture original values before any changes\n const oldParent = node.parent;\n const oldPosition = node.parent ? node.parent.children.indexOf(node) : -1;\n const oldSide = node.side;\n\n // 1. Update parent and position if the node parent is provided and changed\n if (targetParentId && (!node.parent || node.parent.id !== targetParentId)) {\n const targetParent = this._getNodeById(targetParentId);\n if (!targetParent) {\n throw new JsMindError(`Target parent with ID '${targetParentId}' not found`);\n }\n\n // Validate that we're not moving a node to be its own descendant\n if (targetParent.isDescendant(node)) {\n throw new JsMindError('Cannot move a node to be its own descendant');\n }\n\n // Remove from current parent\n this._removeNodeFromParent(node);\n\n // Add to new parent at specified position and create edge\n this._addNodeToParent(node, targetParent, targetPosition);\n }\n\n // 2. Reposition if the node parent is not provided or is not changed, and the targetPosition is provided and changed\n if ((!targetParentId || (node.parent && node.parent.id === targetParentId)) &&\n targetPosition !== undefined && targetPosition !== null) {\n this._repositionNode(node, targetPosition);\n }\n\n // 3. Update side if the target side is provided and changed\n if (targetSide !== undefined && targetSide !== null) {\n node.side = targetSide;\n }\n\n // 4. Emit event only if something actually changed\n this._emitNodeMovedEventIfChanged(node, oldParent, oldPosition, oldSide);\n\n return this.lite(node);\n }\n\n /**\n * Removes an edge by ID.\n *\n * @param edgeId - The edge ID to remove.\n * @returns True if the edge was removed, false if not found.\n */\n removeEdge(edgeId: string): boolean {\n const edge = this._edges[edgeId];\n if (edge) {\n delete this._edges[edgeId];\n\n // Emit event\n this.observerManager.notifyObservers(JmMindEvent.onEdgeRemoved(edge));\n return true;\n }\n return false;\n }\n\n /**\n * Removes a node and all its descendants.\n *\n * @param nodeId - The ID of the node to remove.\n * @throws {@link JsMindError} If trying to remove the root node.\n */\n removeNode(nodeId: string): void {\n const node = this._getNodeById(nodeId);\n if(nodeId == this._root.id) {\n throw new JsMindError('root node can not be removed');\n }\n\n // remove node from parent's children\n const nodeIndex = node.parent!.children.indexOf(node);\n node.parent!.children.splice(nodeIndex, 1);\n\n // identify all nodes that need to be cleared\n const nodeIds = node.getAllSubnodeIds();\n nodeIds.push(node.id);\n\n // remove those nodes\n nodeIds.forEach((id)=> delete this._nodes[id]);\n\n // remove all relevant edges\n const edgeIds = Object.values(this._edges)\n .filter((e)=>nodeIds.includes(e.sourceNodeId) || nodeIds.includes(e.targetNodeId))\n .map((e) => e.id);\n edgeIds.forEach((id) => delete this._edges[id]);\n\n // emit event\n this.observerManager.notifyObservers(JmMindEvent.onNodeRemoved(node, nodeIds, edgeIds));\n }\n\n /**\n * Adds a node to a new parent at a specific position.\n *\n * @private\n * @param node - The node to add.\n * @param targetParent - The new parent node.\n * @param targetPosition - The position index among siblings.\n */\n _addNodeToParent(node: JmNode, targetParent: JmNode, targetPosition?: number | null): void {\n node.parent = targetParent;\n\n if (targetPosition === undefined || targetPosition === null) {\n // Add to the end if no position specified\n targetParent.children.push(node);\n } else {\n // Insert at specific position\n const position = Math.max(0, Math.min(targetPosition, targetParent.children.length));\n targetParent.children.splice(position, 0, node);\n }\n }\n\n /**\n * Creates the root node.\n *\n * @private\n * @returns The created root node.\n */\n _createRootNode(): JmNode {\n const nodeOptions = {\n nodeId: this.options.rootNodeId,\n side: JmNodeSide.Center\n };\n return this._newNode(JmNodeContent.createText(this.meta.name), nodeOptions);\n }\n\n /**\n * Emits NodeMoved event only if something actually changed.\n *\n * @private\n * @param node - The node that was moved.\n * @param oldParent - The old parent node.\n * @param oldPosition - The old position index.\n * @param oldSide - The old side.\n */\n _emitNodeMovedEventIfChanged(node: JmNode, oldParent: JmNode | null, oldPosition: number, oldSide: JmNodeSide | null): void {\n // Compare actual updated node properties with old values\n const parentChanged = oldParent!.id !== node.parent!.id;\n const positionChanged = oldPosition !== node.parent!.children.indexOf(node);\n const sideChanged = oldSide !== node.side;\n\n if (parentChanged || positionChanged || sideChanged) {\n const oldParentId = parentChanged ? oldParent!.id : null;\n const oldPositionData = positionChanged ? oldPosition : null;\n const oldSideData = sideChanged ? oldSide : null;\n this.observerManager.notifyObservers(JmMindEvent.onNodeMoved(node, oldParentId, oldPositionData, oldSideData));\n }\n }\n\n /**\n * Creates a new node and adds it to the mind map.\n *\n * @private\n * @param content - Content for the node.\n * @param nodeOptions - Optional node creation options.\n * @returns The created node.\n */\n _newNode(content: JmNodeContent, nodeOptions?: NodeCreationOptions): JmNode {\n const nodeId = (nodeOptions && nodeOptions.nodeId) || this._idGenerator.newId();\n const node = new JmNode(nodeId, content);\n if (nodeOptions) {\n if (nodeOptions.folded !== undefined) {\n node.folded = nodeOptions.folded;\n }\n if (nodeOptions.side !== undefined) {\n node.side = nodeOptions.side;\n }\n if (nodeOptions.data !== undefined) {\n node.data = nodeOptions.data;\n }\n if (nodeOptions.style !== undefined) {\n node.style = nodeOptions.style;\n }\n }\n this._nodes[nodeId] = node;\n return node;\n }\n\n /**\n * Handles node update events.\n *\n * @private\n * @param node - The node that was updated.\n * @param prop - The property that was updated.\n * @param originValue - The original value.\n * @param newValue - The new value.\n */\n _onNodeUpdated(node: JmNode, prop: string, originValue: unknown, newValue: unknown): void {\n this.observerManager.notifyObservers(JmMindEvent.onNodeUpdated(node, prop, originValue, newValue));\n }\n\n /**\n * Removes a node from its current parent.\n *\n * @private\n * @param node - The node to remove from parent.\n */\n _removeNodeFromParent(node: JmNode): void {\n if (!node.parent) {\n return;\n }\n\n const parent = node.parent;\n const index = parent.children.indexOf(node);\n if (index > -1) {\n parent.children.splice(index, 1);\n }\n node.parent = null;\n }\n\n /**\n * Repositions a node within the same parent (optimized operation).\n *\n * @private\n * @param node - The node to reposition.\n * @param targetPosition - The new position index among siblings.\n */\n _repositionNode(node: JmNode, targetPosition: number): void {\n if (targetPosition === undefined || targetPosition === null) {\n return;\n }\n\n const parent = node.parent!;\n const currentIndex = parent.children.indexOf(node);\n const newPosition = Math.max(0, Math.min(targetPosition, parent.children.length));\n\n if (currentIndex !== newPosition) {\n parent.children.splice(currentIndex, 1);\n parent.children.splice(newPosition, 0, node);\n }\n }\n\n /**\n * Retrieves a node by node ID.\n *\n * @private\n * @param nodeId - The node ID.\n * @returns The corresponding node.\n * @throws {@link JsMindError} If the node doesn't exist.\n */\n _getNodeById(nodeId: string): JmNode {\n const node = this._nodes[nodeId];\n if(!!node) {\n return node;\n }\n throw new JsMindError(`node[id=${nodeId}] does not exist`);\n }\n\n private lite(node: JmNode): JmNode {\n return this.nodeManager.manage(node);\n }\n}\n\n/**\n * Manager for node operations with proxy-based access control.\n *\n * @internal\n */\nclass JmNodeManager {\n /** The mind map instance. */\n mind: JmMind;\n\n /** Set of readonly field names. */\n readonlyFields: Set<string>;\n\n /** Set of unsafe array method names. */\n unsafeArrayMethods: Set<string>;\n\n /**\n * Creates a new JmNodeManager instance.\n *\n * @param mind - The mind map instance.\n */\n constructor(mind: JmMind) {\n this.mind = mind;\n this.readonlyFields = new Set(['id', 'parent', 'children', 'data']);\n this.unsafeArrayMethods = new Set(['fill', 'pop', 'push', 'shift', 'unshift', 'reverse', 'sort', 'splice']);\n }\n\n /**\n * Manages a node with proxy-based access control.\n *\n * @param node - The node to manage.\n * @returns The managed node with proxy.\n */\n manage(node: JmNode): JmNode {\n return new Proxy(node, {\n get: this.getterTrap.bind(this),\n set: this.setterTrap.bind(this)\n }) as JmNode;\n }\n\n /**\n * Getter trap for the proxy.\n *\n * @param node - The node.\n * @param prop - The property name.\n * @returns The property value.\n */\n getterTrap(node: JmNode, prop: string | symbol): unknown {\n const ori = (node as unknown as Record<string | symbol, unknown>)[prop];\n if(prop === 'children') {\n const itemManagedArray = (ori as JmNode[]).map((n: JmNode)=>this.manage(n));\n return new Proxy(itemManagedArray, {\n get: (arr: JmNode[], prop: string | symbol) =>{\n if(this.unsafeArrayMethods.has(prop as string)) {\n return function() {\n throw new JsMindError(`unsupported method ${String(prop)} on node.children, please follow the document to operate the mindmap.`);\n };\n }\n return arr[prop as keyof typeof arr];\n }\n });\n }\n if(prop === 'parent') {\n return !!ori ? this.manage(ori as JmNode) : null;\n }\n return ori;\n }\n\n /**\n * Setter trap for the proxy.\n *\n * @param node - The node.\n * @param prop - The property name.\n * @param value - The new value.\n * @returns True if the operation succeeded.\n * @throws {@link JsMindError} If trying to set a readonly property.\n */\n setterTrap(node: JmNode, prop: string | symbol, value: unknown): boolean {\n if(this.readonlyFields.has(prop as string)) {\n throw new JsMindError(`the property[${String(prop)}] is readonly`);\n }\n const ori = (node as unknown as Record<string | symbol, unknown>)[prop];\n if(ori !== value) {\n (node as unknown as Record<string | symbol, unknown>)[prop] = value;\n this.mind._onNodeUpdated(node, prop as string, ori, value);\n }\n return true;\n }\n\n}\n\n","import { JsMindError } from './error.ts';\nimport type { JmPoint, JmSize } from './index.ts';\n\nconst untilNextFrame = () => {\n return new Promise(resolve => {\n requestAnimationFrame(resolve);\n });\n};\n\nexport class JmDomUtility {\n static createElement(tagName: string, className: string, jmAttrs: Record<string, string> = {}): JmElement {\n const element = document.createElement(tagName);\n const jmElement = new JmElement(element);\n jmElement.classList.add(className);\n for (const [key, value] of Object.entries(jmAttrs)) {\n jmElement.setAttribute(key, value);\n }\n return jmElement;\n }\n\n static async measureElement(element: JmElement | HTMLElement, container: JmElement | HTMLElement): Promise<DOMRect> {\n const element_ = element instanceof JmElement ? element.element : element;\n const container_ = container instanceof JmElement ? container.element : container;\n return await DomUtility.measureElement(element_, container_);\n }\n}\n\nexport class DomUtility {\n static createElement(tagName: string, className: string): HTMLElement {\n const element = document.createElement(tagName);\n element.classList.add(className);\n return element;\n }\n\n static async measureElement(element: HTMLElement, container: HTMLElement): Promise<DOMRect> {\n const originalDisplay = element.style.display;\n const originalVisibility = element.style.visibility;\n\n element.style.visibility = 'hidden';\n if (originalDisplay === 'none') {\n element.style.display = 'unset';\n }\n container.appendChild(element);\n await untilNextFrame();\n const rect = element.getBoundingClientRect();\n container.removeChild(element);\n element.style.display = originalDisplay;\n element.style.visibility = originalVisibility;\n return rect;\n }\n\n static async ensureElementVisible (element: HTMLElement): Promise<void> {\n return new Promise<void>((resolve) => {\n new IntersectionObserver((entities, observer) => {\n if (entities[0]?.isIntersecting) {\n observer.unobserve(element);\n resolve();\n }\n }).observe(element);\n });\n };\n}\n\nexport class JmElement {\n private readonly ATTR_PREFIX = 'data-jm-';\n\n private readonly _element: HTMLElement;\n\n private _cachedRect: DOMRect | null = null;\n\n constructor(element: HTMLElement) {\n if (!element) {\n throw new Error('Element is required');\n }\n this._element = element;\n }\n\n get element(): HTMLElement {\n return this._element;\n }\n\n get classList(): DOMTokenList {\n return this._element.classList;\n }\n\n get innerHTML(): string {\n return this._element.innerHTML;\n }\n\n set innerHTML(value: string) {\n this._element.innerHTML = value;\n }\n\n get cachedRect(): JmSize {\n if (!this._cachedRect) {\n throw new JsMindError('Rect is not measured yet', { element: this._element });\n }\n return this._cachedRect;\n }\n\n set cachedRect(rect: DOMRect) {\n this._cachedRect = rect;\n }\n\n get style(): CSSStyleDeclaration {\n return this._element.style;\n }\n\n get clientWidth(): number {\n return this._element.clientWidth;\n }\n\n get clientHeight(): number {\n return this._element.clientHeight;\n }\n\n hide(): void {\n this._element.style.visibility = 'hidden';\n this._element.style.top = '0px';\n this._element.style.left = '0px';\n }\n\n show(position: JmPoint): void {\n this._element.style.top = `${position.y}px`;\n this._element.style.left = `${position.x}px`;\n this._element.style.visibility = 'visible';\n }\n\n setAttribute(key: string, value: string): void {\n this._element.setAttribute(this.ATTR_PREFIX + key, value);\n }\n\n getAttribute(key: string): string | null {\n return this._element.getAttribute(this.ATTR_PREFIX + key);\n }\n\n removeAttribute(key: string): void {\n this._element.removeAttribute(this.ATTR_PREFIX + key);\n }\n\n appendChild(child: JmElement | HTMLElement | SVGSVGElement): void {\n if (child instanceof JmElement) {\n this._element.appendChild(child.element);\n } else {\n this._element.appendChild(child);\n }\n }\n}\n","/**\n * Style and theme data structures for JsMind mind maps.\n *\n * @remarks\n * This module only defines data. Nothing here draws anything — the rendering\n * layer consumes these values but never appears in this file.\n *\n * @packageDocumentation\n */\n\nimport { mergeObjects } from '../../common/object.ts';\n\n/**\n * Semantic tone. Expresses color only, never geometry.\n *\n * @remarks\n * Semantic roles are about color; geometry is orthogonal (a node can be\n * warning-colored, thick-bordered and large-font at once). Keeping them apart\n * gives the agent fewer side effects per change, which makes generated output\n * more controllable.\n *\n * @public\n */\nexport const JmTone = {\n /** Default tone, resolved from the theme's neutral palette. */\n Default: 'default',\n /** Primary or emphasis tone. */\n Primary: 'primary',\n /** Success or positive tone. */\n Success: 'success',\n /** Warning or caution tone. */\n Warning: 'warning',\n /** Danger or negative tone. */\n Danger: 'danger',\n /** Informational or neutral-accent tone. */\n Info: 'info',\n /**\n * Accent tone for an element that stands out without carrying a judgement.\n *\n * @remarks\n * `primary` already means \"this is the important one\", which is a claim\n * about the content. `accent` is the option for \"make this one visually\n * distinct\" with no claim attached — the purple that v1 exposed as\n * `theme-wisteria` and that none of the semantic tones could absorb.\n */\n Accent: 'accent',\n} as const;\n\nexport type JmTone = typeof JmTone[keyof typeof JmTone];\n\n/**\n * Font weight.\n *\n * @remarks\n * An enum rather than an inline union so the CLI can enumerate the accepted\n * values instead of repeating them. `JmLinePattern` and `JmLineCurve` had this\n * shape already; `fontWeight` was the odd one out.\n *\n * @public\n */\nexport const JmFontWeight = {\n /** Regular weight. */\n Normal: 'normal',\n /** Emphasised weight. */\n Bold: 'bold',\n} as const;\n\nexport type JmFontWeight = typeof JmFontWeight[keyof typeof JmFontWeight];\n\n/**\n * Line dash style.\n *\n * @public\n */\nexport const JmLinePattern = {\n /** Continuous line. */\n Solid: 'solid',\n /** Dashed line. */\n Dashed: 'dashed',\n /** Dotted line. */\n Dotted: 'dotted',\n} as const;\n\nexport type JmLinePattern = typeof JmLinePattern[keyof typeof JmLinePattern];\n\n/**\n * How a line travels between its two endpoints.\n *\n * @remarks\n * A different axis from {@link JmLinePattern}: `pattern` says whether the\n * stroke is dashed, `curve` says what shape it traces. They are separable on\n * purpose - a straight dashed line and a curved dashed line both need to exist,\n * and a single `style` string (as in v1's `line_style`) could only ever express\n * one of the two.\n *\n * @public\n */\nexport const JmLineCurve = {\n /** Straight segment from one endpoint to the other. */\n Straight: 'straight',\n /**\n * Cubic bezier leaving each endpoint horizontally.\n *\n * @remarks\n * The default, and what v1 drew. Edges leaving a node always read better\n * when they depart along the horizontal axis: siblings sit in a column, so a\n * straight segment between two of them cuts diagonally across the layout.\n */\n Bezier: 'bezier',\n} as const;\n\nexport type JmLineCurve = typeof JmLineCurve[keyof typeof JmLineCurve];\n\n/**\n * Visual style of a single line.\n *\n * @remarks\n * Shared by two places: `JmNodeStyle.incoming` (the line connecting a node to\n * its parent) and `JmEdge.style` (lines for additional, non-hierarchical\n * relationships). One shape avoids two vocabularies for the same thing.\n *\n * @public\n */\nexport interface JmLineStyle {\n /** Line color, e.g. `#4a9eff`. */\n color?: string;\n /** Line width in pixels. */\n width?: number;\n /**\n * Line pattern.\n *\n * @remarks\n * Named `pattern` rather than `style` because this type is itself reached\n * through `node.style.incoming`, and `.style.style` reads badly. `pattern`\n * also covers `solid` honestly — `solid` is not a dash.\n */\n pattern?: JmLinePattern;\n /** How the line travels between its endpoints. Defaults to `bezier`. */\n curve?: JmLineCurve;\n}\n\n/**\n * Visual overrides for a single node.\n *\n * @remarks\n * Every field is optional and unset fields fall back to the theme. The node\n * carries only what differs from the theme, so a theme change still reaches\n * every node that did not explicitly override anything.\n *\n * `incoming` lives on the child node: a line connects exactly one child, which\n * makes the child the natural owner. The name mirrors the layout layer\n * (`calculateNodeIncomingPoint` / `calculateNodeOutgoingPoint`).\n *\n * @public\n */\nexport interface JmNodeStyle {\n /** Semantic tone for this node. Overrides background/border/color from the theme. */\n tone?: JmTone;\n /** Background color, e.g. `#ffffff`. */\n background?: string;\n /** Text color. */\n color?: string;\n /** Border color. */\n borderColor?: string;\n /** Border width in pixels. */\n borderWidth?: number;\n /** Border dash style. */\n borderStyle?: JmLinePattern;\n /** Font size in pixels. */\n fontSize?: number;\n /** Font weight. */\n fontWeight?: JmFontWeight;\n /** Style of the line connecting this node to its parent. */\n incoming?: JmLineStyle;\n}\n\n/**\n * Colors a tone resolves to.\n *\n * @remarks\n * `line` is the color of the connecting line, which usually differs from\n * `border` so that a subtree reads as one visual grouping.\n *\n * @public\n */\nexport interface JmTonePalette {\n /**\n * Node background color.\n *\n * @remarks\n * Every field here carries a `Color` suffix. The palette sits alongside\n * `JmNodeStyle`, which already uses `borderColor`, so `borderColor` means\n * the same thing in both places and an agent reading the JSON never has to\n * guess whether `fill` or `border` is a color or a length.\n */\n fillColor: string;\n /** Node text color. */\n textColor: string;\n /** Node border color. */\n borderColor: string;\n /** Connecting line color. */\n lineColor: string;\n}\n\n/**\n * One drop shadow, in CSS terms.\n *\n * @remarks\n * Spelled out as four numbers and a color rather than kept as a CSS string\n * like `\"1px 1px 1px #666\"` so it can be merged field by field — an override\n * that changes only the blur should not have to restate the offsets — and so\n * an agent writing the JSON never has to get CSS shorthand syntax right.\n *\n * @public\n */\nexport interface JmThemeShadowLayer {\n /** Horizontal offset in pixels. */\n offsetX: number;\n /** Vertical offset in pixels. */\n offsetY: number;\n /** Blur radius in pixels. */\n blur: number;\n /** Shadow color, e.g. `#666666`. */\n color: string;\n}\n\n/**\n * Drop shadows for the three visual states a node can be in.\n *\n * @remarks\n * States live in the theme rather than in CSS because they change the node's\n * appearance, and \"how does this node look\" belongs with the rest of the\n * appearance. `normal` is the resting state; `hover` and `selected` are what\n * the pointer and the selection do to it.\n *\n * @public\n */\nexport interface JmThemeShadow {\n /** Shadow when the node is idle. */\n normal: JmThemeShadowLayer;\n /** Shadow while the pointer is over the node. */\n hover: JmThemeShadowLayer;\n /** Shadow when the node is selected. */\n selected: JmThemeShadowLayer;\n}\n\n/**\n * A partial replacement for {@link JmThemeShadow}.\n *\n * @remarks\n * Every level is optional so a style can restyle one state, or one field of one\n * state (`hover.blur`), without restating the rest. The merged result is always\n * complete.\n *\n * @public\n */\nexport interface JmThemeShadowOverride {\n /** Override for the idle shadow. */\n normal?: Partial<JmThemeShadowLayer>;\n /** Override for the hover shadow. */\n hover?: Partial<JmThemeShadowLayer>;\n /** Override for the selected shadow. */\n selected?: Partial<JmThemeShadowLayer>;\n}\n\n/**\n * Partial overrides for {@link JmThemeNode}.\n *\n * @remarks\n * Identical to `Partial<JmThemeNode>` except for `shadow`, which allows\n * overriding a single state rather than all three.\n *\n * @public\n */\nexport type JmThemeNodeOverride = Omit<Partial<JmThemeNode>, 'shadow'> & {\n /** Override for the node shadows. */\n shadow?: JmThemeShadowOverride;\n};\n\n/**\n * Geometry and typography shared by every node.\n *\n * @public\n */\nexport interface JmThemeNode {\n /** Corner radius in pixels. */\n radius: number;\n /** Inner padding in pixels. */\n padding: number;\n /** Base font size in pixels. */\n fontSize: number;\n /**\n * Root node font size in pixels.\n *\n * @remarks\n * Separate from `fontSize` because the root is the one node that reads as a\n * title: v1 rendered it at 24px against a 16px body. Folding it into\n * `fontSize` would have forced every theme to pick one and lose the\n * hierarchy.\n */\n rootFontSize: number;\n /** Font family. */\n fontFamily: string;\n /**\n * Line height as a multiple of the font size.\n *\n * @remarks\n * Unitless multiplier, matching the CSS `line-height: 1.125` form, so it\n * scales with `fontSize` instead of needing a matching pixel value per size.\n */\n lineHeight: number;\n /** Default border width in pixels. */\n borderWidth: number;\n /**\n * Maximum node width in pixels before text wraps.\n *\n * @remarks\n * Wrapping is a layout input, not a detail: it decides how tall a node is,\n * which decides where its children go.\n */\n maxWidth: number;\n /** Drop shadows for the idle, hover and selected states. */\n shadow: JmThemeShadow;\n}\n\n/**\n * Geometry shared by every line of a mind map.\n *\n * @public\n */\nexport interface JmThemeLine {\n /** Default line width in pixels. */\n width: number;\n /** Default line pattern. Named `pattern` to match `JmLineStyle.pattern`. */\n pattern: JmLinePattern;\n /** Default curve shape. Named `curve` to match `JmLineStyle.curve`. */\n curve: JmLineCurve;\n}\n\n/**\n * Geometry of the collapse/expand control.\n *\n * @public\n */\nexport interface JmThemeExpander {\n /** Expander width and height in pixels. */\n size: number;\n /**\n * Corner radius in pixels.\n *\n * @remarks\n * `size / 2` gives a circle, which is what the stylesheet did with\n * `border-radius: 50%`. A number keeps it in the same units as every other\n * length here; percentage radii only make sense when the box can grow.\n */\n radius: number;\n /** Font size of the character or count drawn inside, in pixels. */\n fontSize: number;\n /** Line height of that content, in pixels. */\n lineHeight: number;\n /** Border width in pixels. */\n borderWidth: number;\n}\n\n/**\n * Complete visual theme.\n *\n * @remarks\n * Every section except `name` is optional and merged deeply over the built-in\n * preset it names, so a theme can override one tone color without restating\n * every other color.\n *\n * @public\n */\nexport interface JmTheme {\n /** Canvas background color. */\n background?: string;\n /** Per-tone color palettes. */\n tones?: Partial<Record<JmTone, Partial<JmTonePalette>>>;\n /** Node geometry. */\n node?: Partial<JmThemeNode>;\n /** Line geometry. */\n line?: Partial<JmThemeLine>;\n /** Expander geometry. */\n expander?: Partial<JmThemeExpander>;\n}\n\n/**\n * Style declaration for a whole mind map, as stored in the data file.\n *\n * @remarks\n * Named in the singular, like the per-node and per-edge style fields: one\n * `style` concept, with the scope decided by where it sits. `mind.style` covers\n * the whole map; `node.style` covers one node; `edge.style` covers one edge.\n * Carrying both `styles` and `style` in one document only differed by an `s`,\n * which is a trap for an agent generating the JSON.\n *\n * Read this as: \"this mind map looks like this — it inherits from `theme`, then\n * overrides the fields listed below.\"\n *\n * Splitting inheritance from overrides into one flat declaration avoids the\n * ambiguity of a nested `{ name, ...overrides }` form, where `name` could be\n * read either as \"what this theme is called\" or as \"which theme to inherit\".\n * Here `theme` can only mean the latter.\n *\n * - `theme` names a built-in preset to inherit from. Omitted means `\"default\"`,\n * so a file that only overrides a few colors does not have to name it.\n * - Every other field is an override applied on top of that preset, merged\n * deeply.\n *\n * @public\n */\nexport interface JmStyle {\n /** Name of the built-in theme to inherit from. Defaults to `\"default\"`. */\n theme?: string;\n /** Canvas background color. */\n background?: string;\n /** Per-tone color overrides. */\n tones?: Partial<Record<JmTone, Partial<JmTonePalette>>>;\n /** Node geometry overrides. */\n node?: JmThemeNodeOverride;\n /** Line geometry overrides. */\n line?: Partial<JmThemeLine>;\n /** Expander geometry overrides. */\n expander?: Partial<JmThemeExpander>;\n}\n\n/**\n * The only theme built into this version.\n *\n * @remarks\n * Dark mode is a separate theme, not a light/dark variant pair of the same\n * theme, because a dark palette is not a mechanical inversion of a light one.\n *\n * @public\n */\nexport const JSMIND_THEME_DEFAULT: JmTheme = {\n background: '#ffffff',\n // Filled solids with white text, taken from v1 — a node carrying a tone\n // that only tints its background barely reads as \"this one is different\"\n // from across the canvas. The v1 palette names that map onto these tones\n // (belizehole, nephrite, pumpkin, pomegranate) are the same hue a few\n // degrees away, so they fold in rather than getting their own entry.\n tones: {\n default: { fillColor: '#ffffff', textColor: '#333333', borderColor: '#cccccc', lineColor: '#b0b0b0' },\n primary: { fillColor: '#428bca', textColor: '#ffffff', borderColor: '#357ebd', lineColor: '#689ece' },\n success: { fillColor: '#5cb85c', textColor: '#ffffff', borderColor: '#4cae4c', lineColor: '#79c279' },\n warning: { fillColor: '#f0ad4e', textColor: '#ffffff', borderColor: '#eea236', lineColor: '#f2b968' },\n danger: { fillColor: '#d9534f', textColor: '#ffffff', borderColor: '#d43f3a', lineColor: '#df6f6b' },\n info: { fillColor: '#5dc0de', textColor: '#ffffff', borderColor: '#46b8da', lineColor: '#74cae3' },\n accent: { fillColor: '#9b59b6', textColor: '#ffffff', borderColor: '#8e44ad', lineColor: '#aa73c2' },\n },\n node: {\n radius: 5,\n padding: 10,\n fontSize: 16,\n rootFontSize: 24,\n fontFamily: 'Verdana, Arial, Helvetica, sans-serif',\n lineHeight: 1.125,\n // Zero, because the stylesheet drew no border: the depth came from the\n // shadow below. Tone palettes still carry a borderColor for themes that\n // do want one.\n borderWidth: 0,\n maxWidth: 400,\n shadow: {\n normal: { offsetX: 1, offsetY: 1, blur: 1, color: '#666666' },\n hover: { offsetX: 2, offsetY: 2, blur: 8, color: '#000000' },\n selected: { offsetX: 2, offsetY: 2, blur: 8, color: '#000000' },\n },\n },\n line: {\n width: 2,\n pattern: JmLinePattern.Solid,\n curve: JmLineCurve.Bezier,\n },\n expander: {\n size: 13,\n radius: 6.5,\n fontSize: 8,\n lineHeight: 11,\n borderWidth: 1,\n },\n};\n\n/**\n * Built-in theme presets, keyed by name.\n *\n * @public\n */\nexport const JSMIND_THEME_PRESETS: Record<string, JmTheme> = {\n default: JSMIND_THEME_DEFAULT,\n};\n\n/**\n * Checks whether a value is a plain object that can be merged.\n *\n * @param value - The value to check.\n * @returns True for plain objects, false for arrays, null and primitives.\n */\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Deeply merges theme overrides onto a base theme.\n *\n * @remarks\n * A shallow merge is not enough. `tones: { primary: { fill: \"#f00\" } }` merged\n * shallowly would replace the whole `primary` entry, dropping `text`, `border`\n * and `line`, and the node would render black-on-black. Deep merge keeps the\n * fields the override did not mention.\n *\n * @param base - The theme to merge onto.\n * @param override - The partial theme to apply.\n * @returns A new merged theme; neither input is mutated.\n *\n * @public\n */\nexport function mergeJmTheme(base: JmTheme, override: JmStyle): JmTheme {\n const result: JmTheme = { ...base };\n\n // `theme` names the preset to inherit from and is consumed by\n // resolveJmStyle before this runs, so there is nothing to carry over here.\n if (override.background !== undefined) {\n result.background = override.background;\n }\n\n // node/line/expander each hold scalars, so they merge one level deep with\n // the same flat merge the options layer uses. Spread the base first:\n // mergeObjects replaces a missing default wholesale, which would drop\n // every field the override did not mention.\n if (override.node) {\n // `shadow` is decomposed first: it nests further than the rest\n // (state -> layer), and `mergeObjects` cannot express that in one call.\n const { shadow: shadowOverride, ...nodeRest } = override.node;\n const merged = mergeObjects(\n { ...base.node } as Partial<JmThemeNode>,\n nodeRest as Partial<JmThemeNode>\n );\n // A shallow merge would let an override that only restyles `hover`\n // replace the whole shadow block, dropping `normal` and `selected` and\n // leaving the node with no resting shadow at all.\n const baseShadow = base.node?.shadow;\n if (baseShadow && shadowOverride) {\n merged.shadow = mergeShadow(baseShadow, shadowOverride);\n }\n result.node = merged;\n }\n if (override.line) {\n result.line = mergeObjects({ ...base.line }, override.line);\n }\n if (override.expander) {\n result.expander = mergeObjects({ ...base.expander }, override.expander);\n }\n\n // `tones` is the one section nested two levels deep: tone -> palette. Each\n // palette must be merged field by field, or an override that names only\n // `fillColor` would drop textColor/borderColor/lineColor and the node\n // would render black on black.\n if (override.tones) {\n result.tones = mergeTonePalettes(base.tones, override.tones);\n }\n\n return result;\n}\n\n/**\n * Merges shadow overrides into a complete shadow.\n *\n * @remarks\n * Two levels deep: state, then layer. Each state the override does not mention\n * is passed through, and each layer is merged field by field so `hover.blur`\n * alone is a legal override.\n *\n * @param base - The complete shadow to merge onto.\n * @param override - The partial shadow to apply.\n * @returns A new complete shadow; neither input is mutated.\n *\n * @private\n */\nfunction mergeShadow(base: JmThemeShadow, override: JmThemeShadowOverride): JmThemeShadow {\n const result: JmThemeShadow = { ...base };\n\n for (const state of ['normal', 'hover', 'selected'] as const) {\n const layer = override[state];\n if (layer) {\n result[state] = mergeObjects({ ...base[state] }, layer);\n }\n }\n\n return result;\n}\n\n/**\n * Merges tone palette overrides into a set of palettes.\n *\n * @remarks\n * Per tone, the palette is merged field by field. Tones the override does not\n * mention are passed through untouched.\n *\n * @param base - The palettes to merge onto, possibly absent.\n * @param override - The per-tone overrides to apply.\n * @returns New palettes; neither input is mutated.\n *\n * @private\n */\nfunction mergeTonePalettes(\n base: Partial<Record<JmTone, Partial<JmTonePalette>>> | undefined,\n override: Partial<Record<JmTone, Partial<JmTonePalette>>>\n): Partial<Record<JmTone, Partial<JmTonePalette>>> {\n const tones: Partial<Record<JmTone, Partial<JmTonePalette>>> = { ...base };\n\n for (const key of Object.keys(override) as JmTone[]) {\n const overridePalette = override[key];\n if (!overridePalette) {\n continue;\n }\n tones[key] = mergeObjects(tones[key], overridePalette);\n }\n\n return tones;\n}\n\n/**\n * Resolves a style declaration into a complete theme.\n *\n * @remarks\n * `style.theme` picks the preset to inherit from (default `\"default\"`), then\n * every other field in `style` is merged on top of it, deeply.\n *\n * @param style - The style declaration, if the data carried one.\n * @returns A fully populated theme; never partial.\n * @throws {@link Error} If the named preset does not exist.\n *\n * @public\n */\nexport function resolveJmStyle(style?: JmStyle): JmTheme {\n if (style === undefined || style === null) {\n return { ...JSMIND_THEME_DEFAULT };\n }\n\n if (!isPlainObject(style)) {\n throw new Error('invalid style declaration');\n }\n\n const themeName = style.theme ?? 'default';\n if (typeof themeName !== 'string') {\n throw new Error('invalid theme name');\n }\n\n const preset = JSMIND_THEME_PRESETS[themeName];\n if (!preset) {\n throw new Error(`unknown theme: ${themeName}`);\n }\n\n return mergeJmTheme(preset, style);\n}\n","/**\n * @license BSD\n * @copyright 2014-2025 hizzgdev@163.com\n *\n * Project Home:\n * https://github.com/hizzgdev/jsmind-v2/\n */\n\nimport type { JmTheme, JmThemeShadowLayer, JmTonePalette } from '../model/data/style.ts';\n\n/**\n * Styles installed into the shadow root.\n *\n * @remarks\n * Two kinds of rule live here.\n *\n * Positioning (`absolute`, `z-index`, `overflow`) is decided here and nowhere\n * else. It is how the renderer finds room for a node at a coordinate it\n * computed, not a matter of taste, so it is not a theme field.\n *\n * Everything that decides how a node *looks* reads a custom property rather\n * than naming a value. Those values come from the theme, written onto the host\n * element by {@link applyThemeToHost}. The indirection is what lets one\n * stylesheet serve every theme while a single node still carries its own tone\n * color: custom properties inherit, so a value set on one node wins for that\n * node alone.\n *\n * These rules used to be an external stylesheet the caller had to remember to\n * load. Forgetting it stacked every node at 0,0 and reported no error.\n *\n * @private\n */\nexport const JSMIND_VIEW_STYLES = `\n :host {\n display: block;\n position: relative;\n width: 100%;\n height: 100%;\n outline: none;\n -webkit-user-select: none;\n user-select: none;\n background-color: var(--jm-background);\n }\n\n .jsmind-inner {\n position: relative;\n overflow: auto;\n width: 100%;\n height: 100%;\n outline: none;\n -webkit-user-select: none;\n user-select: none;\n }\n\n /* Transparent, not omitted: a node is appended here to be measured, and\n the box needs its own background layer or the measured width collapses. */\n .jsmind-nodes {\n position: absolute;\n z-index: 2;\n background-color: rgba(0, 0, 0, 0);\n }\n\n .jsmind-edges {\n position: absolute;\n z-index: 1;\n }\n\n .jsmind-node {\n position: absolute;\n cursor: default;\n\n padding: var(--jm-node-padding);\n border-radius: var(--jm-node-radius);\n border: var(--jm-node-border-width) solid var(--jm-node-border-color);\n max-width: var(--jm-node-max-width);\n font-family: var(--jm-node-font-family);\n font-size: var(--jm-node-font-size);\n line-height: var(--jm-node-line-height);\n background-color: var(--jm-node-fill);\n color: var(--jm-node-text);\n box-shadow: var(--jm-node-shadow-normal);\n }\n\n /* Hover and selection change colour as well as shadow. Those two colours\n are interaction state, not theme: the theme describes what a node looks\n like at rest, and its tones say what a node means. Folding state colours\n into that would make --jm-node-fill mean two things at once. */\n .jsmind-node:hover {\n box-shadow: var(--jm-node-shadow-hover);\n background-color: #ebebeb;\n color: #333333;\n }\n\n .jsmind-node-selected {\n box-shadow: var(--jm-node-shadow-selected);\n background-color: #11f;\n color: #ffffff;\n }\n\n .jsmind-node-root {\n font-size: var(--jm-node-root-font-size);\n }\n\n /* The expander is a control, not content. Size and radius are theme fields\n because they belong to the layout budget; everything else here — the\n transparent fill, the clipping, the 18px glyph below — is how the control\n itself is drawn and is fixed.\n *\n * No border on this variant. A border here would sit inside border-box and\n shrink the content area to 11px, so a 13px-wide glyph would be clipped\n unevenly and read as off-centre. The number variant is the one with a\n border, and it is declared there. */\n .jsmind-node-expander {\n position: absolute;\n overflow: hidden;\n cursor: pointer;\n\n /* Flex centring rather than text-align plus a negative margin-top.\n The glyph is 18px inside a 13px box, so it overflows on both axes and\n the clipping has to be even. text-align centres the line box, but\n where the ink sits inside that line box comes from the font's ascent\n and side bearings — which differ between Arial, DejaVu, Liberation\n and whatever a given machine substitutes. A hand-tuned margin\n compensates for exactly one font and reads as a 1px drift on every\n other. Flex centres the painted glyph itself. */\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: var(--jm-expander-size);\n height: var(--jm-expander-size);\n border-radius: var(--jm-expander-radius);\n box-sizing: border-box;\n }\n\n /* 18px glyph inside a 13px circle: deliberately larger than the box, with\n the overhang clipped on both sides. Sizing it to match node text instead\n would let a theme's font size push the +/- out of the control. */\n .jsmind-node-expander-expanded::after {\n font-family: Arial, sans-serif;\n font-size: 18px;\n line-height: 1;\n content: '\\\\229D';\n }\n\n .jsmind-node-expander-collapsed::after {\n font-family: Arial, sans-serif;\n font-size: 18px;\n line-height: 1;\n content: '\\\\2295';\n }\n\n /* The only variant that draws a border, and it keeps the neutral #666 the\n v1 stylesheet used. Not var(--jm-node-border-color): that would follow the\n node's tone, and the default tone's border is #cccccc — a barely visible\n ring on a white background. The control is an affordance drawn beside the\n node, not part of what the node means. */\n .jsmind-node-expander-number {\n font-size: var(--jm-expander-font-size);\n text-align: center;\n line-height: var(--jm-expander-line-height);\n border: solid var(--jm-expander-border-width) #666666;\n }\n\n /* Lighter than a node's hover shadow on purpose — the expander is small and\n a full-strength shadow would swamp it. */\n .jsmind-node-expander:hover {\n box-shadow: 1px 1px 8px #000000;\n background-color: #ebebeb;\n color: #333333;\n }\n\n\n\n .jmnode-overflow-wrap .jsmind-nodes {\n min-width: 420px;\n }\n\n .jmnode-overflow-hidden .jsmind-node {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n`;\n\n/**\n * Formats a theme shadow layer as a CSS `box-shadow` value.\n *\n * @param layer - The layer to format.\n * @returns A value like `1px 1px 1px #666666`.\n *\n * @private\n */\nfunction formatShadow(layer: JmThemeShadowLayer): string {\n return `${layer.offsetX}px ${layer.offsetY}px ${layer.blur}px ${layer.color}`;\n}\n\n/**\n * Writes a theme's values onto the host element as custom properties.\n *\n * @remarks\n * Done on the host rather than on the shadow root because custom properties\n * inherit: set here, every rule inside sees them, and a value set on a single\n * node overrides it for that node alone. That is what makes per-node tone\n * colors possible without generating a stylesheet per mind map.\n *\n * Values are written complete, with units (`10px`, not `10`), because the\n * stylesheet interpolates them directly into positions where a bare number is\n * not a valid length.\n *\n * The `default` tone is applied here too, as the fallback for nodes that name\n * no tone of their own.\n *\n * @param root - The shadow root whose host should carry the values.\n * @param theme - The fully resolved theme.\n *\n * @private\n */\nexport function applyThemeToHost(root: ShadowRoot, theme: JmTheme): void {\n const host = root.host as HTMLElement;\n\n /** Sets a custom property only when the theme actually carries a value. */\n const set = (name: string, value: string | number | undefined, unit = ''): void => {\n if (value !== undefined) {\n host.style.setProperty(name, `${value}${unit}`);\n }\n };\n\n set('--jm-background', theme.background);\n\n const node = theme.node;\n if (node) {\n set('--jm-node-padding', node.padding, 'px');\n set('--jm-node-radius', node.radius, 'px');\n set('--jm-node-border-width', node.borderWidth, 'px');\n set('--jm-node-max-width', node.maxWidth, 'px');\n set('--jm-node-font-family', node.fontFamily);\n set('--jm-node-font-size', node.fontSize, 'px');\n set('--jm-node-root-font-size', node.rootFontSize, 'px');\n // Unitless on purpose: it is a multiplier of the font size, and CSS\n // would read a pixel value as an absolute line box instead.\n set('--jm-node-line-height', node.lineHeight);\n\n const shadow = node.shadow;\n if (shadow) {\n set('--jm-node-shadow-normal', formatShadow(shadow.normal));\n set('--jm-node-shadow-hover', formatShadow(shadow.hover));\n set('--jm-node-shadow-selected', formatShadow(shadow.selected));\n }\n }\n\n const expander = theme.expander;\n if (expander) {\n set('--jm-expander-size', expander.size, 'px');\n set('--jm-expander-radius', expander.radius, 'px');\n set('--jm-expander-border-width', expander.borderWidth, 'px');\n set('--jm-expander-font-size', expander.fontSize, 'px');\n set('--jm-expander-line-height', expander.lineHeight, 'px');\n }\n\n // The default tone is the fallback for nodes that name no tone of their\n // own; a node with a tone overrides all four on its own element.\n const fallback = theme.tones?.default;\n if (fallback) {\n // ShadowRoot.host is typed as Element; at runtime it is the host element\n // the view was opened on, so style is there.\n applyTonePalette(root.host as HTMLElement, fallback);\n }\n}\n\n/** Anything that can carry a custom property — a node element or the host. */\ninterface CustomPropertyTarget {\n style: { setProperty(name: string, value: string): void };\n}\n\n/**\n * Writes a tone palette's three colours onto an element as custom properties.\n *\n * @remarks\n * One function rather than two copies of the same three lines. `applyThemeToHost`\n * calls it for the default tone, which becomes the fallback for every node that\n * names no tone of its own; `JmNodeView` calls it per node, where the value wins\n * for that node and nothing else. Keeping the mapping here means a tone that\n * gains a field gains it in both places at once.\n *\n * The expander is deliberately not a consumer: it sits outside the node box,\n * and colouring its outline from the node's tone would make a white-toned node\n * grow a white outline. It keeps the neutral #666 its stylesheet specifies.\n *\n * @param target - Anything with a `style` object. Typed structurally because the\n * two callers pass different things — `JmElement` for a node, a plain `Element`\n * for the host — and `style.setProperty` is all this needs from either.\n * @param palette - Tone to apply. Undefined leaves the target untouched.\n * @returns Nothing.\n */\nexport function applyTonePalette(\n target: CustomPropertyTarget,\n palette: Partial<JmTonePalette> | null | undefined\n): void {\n if (!palette) {\n return;\n }\n const set = (name: string, value: string | undefined): void => {\n if (value !== undefined) {\n target.style.setProperty(name, value);\n }\n };\n set('--jm-node-fill', palette.fillColor);\n set('--jm-node-text', palette.textColor);\n set('--jm-node-border-color', palette.borderColor);\n}\n\n/**\n * Attaches a shadow root to the host element and installs the styles in it.\n *\n * @remarks\n * `open` rather than `closed` so the rendered DOM stays inspectable — for\n * debugging, for the tests, and for anyone who needs to reach a node element\n * from outside. The isolation is about styles, not secrecy.\n *\n * A host that already has a shadow root keeps it. Calling `attachShadow` twice\n * throws, and constructing the view again on the same host (which happens when\n * a mind map is reloaded) must not.\n *\n * @param container - The host element supplied by the caller.\n * @returns The shadow root that rendered content belongs in.\n *\n * @private\n */\nexport function attachViewShadowRoot(container: HTMLElement): ShadowRoot {\n const existing = container.shadowRoot;\n const root = existing ?? container.attachShadow({ mode: 'open' });\n\n // Reuse the style element this function created earlier, so repeated view\n // construction on the same host does not stack copies of the rules.\n const marker = 'data-jsmind-view-styles';\n let style = root.querySelector(`style[${marker}]`) as HTMLStyleElement | null;\n if (!style) {\n style = document.createElement('style');\n style.setAttribute(marker, '');\n root.appendChild(style);\n }\n style.textContent = JSMIND_VIEW_STYLES;\n\n return root;\n}\n","import type { JmNode } from '../model/data/node.ts';\nimport { JmDomUtility, type JmElement } from '../common/dom.ts';\nimport { JmSize, type JmPoint } from '../common/index.ts';\nimport { ViewExpanderStyle, type ViewOptions } from '../common/option.ts';\nimport { JmTone, type JmTheme } from '../model/data/style.ts';\nimport { applyTonePalette } from './shadow.ts';\n\n/**\n * View operator for nodes.\n * Handles rendering and manipulation of node elements in the view.\n *\n * @public\n */\nexport class JmNodeView {\n /** The container element for nodes. */\n private readonly container: JmElement;\n\n /** The view options. */\n private readonly options: ViewOptions;\n\n /** The resolved theme, or null until one is applied. */\n private theme: JmTheme | null = null;\n\n /**\n * Creates a new node view operator.\n *\n * @param innerContainer - The inner container element to append the nodes container to.\n */\n constructor(innerContainer: JmElement, viewOptions: ViewOptions) {\n this.container = this._initNodesContainer(innerContainer);\n this.options = viewOptions;\n }\n\n /**\n * Sets the theme whose tone palettes node elements resolve against.\n *\n * @remarks\n * Only the palettes are needed here. Geometry is written onto the host as\n * custom properties once per map, and every node inherits it — repeating a\n * padding value on every element would multiply work by node count for no\n * benefit.\n *\n * @param theme - The resolved theme.\n */\n setTheme(theme: JmTheme): void {\n this.theme = theme;\n }\n\n async createAndMeasure(node: JmNode): Promise<JmSize> {\n const existingElement = node._data.view.element;\n if (existingElement) {\n return new JmSize(existingElement.cachedRect.width, existingElement.cachedRect.height);\n }\n const sizePromise = this._createNodeElement(node)\n .then((element: JmElement) => {\n node._data.view.element = element;\n this.container.appendChild(element.element);\n return new JmSize(element.cachedRect.width, element.cachedRect.height);\n });\n\n if(!node.isRoot()) {\n const expanderElement = this._createNodeExpander(node);\n node._data.view.expander = expanderElement;\n this.container.appendChild(expanderElement.element);\n }\n return sizePromise;\n }\n\n removeNode(node: JmNode): void {\n const element = node._data.view.element;\n if (element) {\n element.element.remove();\n }\n }\n\n updateCanvasSize(viewSize: JmSize) {\n this.container.style.width = `${viewSize.width}px`;\n this.container.style.height = `${viewSize.height}px`;\n }\n\n placeNode(node: JmNode, absolutePoint: JmPoint) {\n const element = node._data.view.element!;\n element.innerHTML = node.content.getText();\n element.show(absolutePoint);\n }\n\n placeNodeExpander(node: JmNode, absolutePoint: JmPoint) {\n if(node.isRoot()) {\n return;\n }\n if(node.children.length === 0) {\n return;\n }\n\n const element = node._data.view.expander!;\n if(this.options.expander.style === ViewExpanderStyle.Char) {\n if(node.folded) {\n element.classList.add('jsmind-node-expander-collapsed');\n } else {\n element.classList.add('jsmind-node-expander-expanded');\n }\n } else if(this.options.expander.style === ViewExpanderStyle.Number) {\n element.classList.add('jsmind-node-expander-number');\n element.innerHTML = `${node.children.length}`;\n }\n element.show(absolutePoint);\n }\n\n hideNode(node: JmNode) {\n const element = node._data.view.element!;\n element.hide();\n }\n\n hideNodeExpander(node: JmNode) {\n const expanderElement = node._data.view.expander!;\n expanderElement.hide();\n }\n\n /**\n * Initializes the nodes container element.\n *\n * @param innerContainer - The inner container element.\n * @returns The created nodes container element.\n */\n private _initNodesContainer(innerContainer: JmElement): JmElement {\n const jmElement = JmDomUtility.createElement('div', 'jsmind-nodes');\n innerContainer.appendChild(jmElement.element);\n jmElement.style.width = `${innerContainer.clientWidth}px`;\n jmElement.style.height = `${innerContainer.clientHeight}px`;\n return jmElement;\n }\n\n private async _createNodeElement(node: JmNode): Promise<JmElement> {\n const element = JmDomUtility.createElement('div', 'jsmind-node', { 'node-id': node.id });\n element.hide();\n if(node.content.isText()) {\n element.innerHTML = node.content.getText();\n } else {\n element.innerHTML = 'unsupported content type';\n }\n if(node.isRoot()) {\n element.classList.add('jsmind-node-root');\n }\n this._applyTone(element, node);\n const rect = await JmDomUtility.measureElement(element, this.container);\n element.cachedRect = rect;\n return element;\n }\n\n private _createNodeExpander(node: JmNode): JmElement {\n const element = JmDomUtility.createElement('div', 'jsmind-node-expander', {'node-id': node.id});\n element.hide();\n // No tone here on purpose. The expander sits outside the node's box and\n // its stylesheet draws a neutral outline; feeding it the node's palette\n // would put a white circle beside every untoned node.\n return element;\n }\n\n /**\n * Resolves a node's tone and its own style overrides into custom properties.\n *\n * @remarks\n * Written on the element, not on the host, because that is the whole point\n * of the tone concept: one node differs while its siblings do not. Custom\n * properties inherit downward, so a value set here wins for this subtree and\n * nothing else.\n *\n * Precedence follows `JmNodeStyle`'s contract — a field the node states\n * beats the tone beats the theme.\n *\n * @param element - The element to paint.\n * @param node - The node it represents.\n *\n * @private\n */\n private _applyTone(element: JmElement, node: JmNode): void {\n const style = node.style;\n const tone = style?.tone ?? JmTone.Default;\n\n applyTonePalette(element, this.theme?.tones?.[tone]);\n\n if (!style) {\n return;\n }\n\n /** Sets a custom property only when the node actually states it. */\n const set = (name: string, value: string | undefined): void => {\n if (value !== undefined) {\n element.style.setProperty(name, value);\n }\n };\n\n // Explicit fields win over the tone they sat alongside.\n set('--jm-node-fill', style.background);\n set('--jm-node-text', style.color);\n set('--jm-node-border-color', style.borderColor);\n if (style.borderWidth !== undefined) {\n element.style.borderWidth = `${style.borderWidth}px`;\n }\n if (style.borderStyle !== undefined) {\n element.style.borderStyle = style.borderStyle;\n }\n // Font size and weight are set inline rather than through a custom\n // property: only the root adjusts size through the stylesheet, so a\n // per-node value has to override a rule rather than a default.\n if (style.fontSize !== undefined) {\n element.style.fontSize = `${style.fontSize}px`;\n }\n if (style.fontWeight !== undefined) {\n element.style.fontWeight = style.fontWeight;\n }\n }\n}\n\n","import type { JmElement } from '../common/dom.ts';\nimport type { JmPoint, JmSize } from '../common/index.ts';\nimport type { JmNode } from '../model/data/node.ts';\nimport { JmLineCurve, JmLinePattern } from '../model/data/style.ts';\n\n/**\n * A line style with every field resolved.\n *\n * @remarks\n * `drawLine` takes a fully determined style rather than a partial one, so the\n * question of where each value comes from — node override, tone, theme — is\n * answered once, by the caller, and not re-derived per line.\n *\n * @public\n */\nexport interface JmResolvedLineStyle {\n /** Stroke color. */\n color: string;\n /** Stroke width in pixels. */\n width: number;\n /** Dash pattern. */\n pattern: JmLinePattern;\n /** Path shape. */\n curve: JmLineCurve;\n}\n\n/**\n * View operator for edges.\n * Handles rendering and manipulation of edge elements in the view.\n *\n * @public\n */\nexport class JmEdgeView {\n /** The container element for edges (SVG). */\n readonly container: SVGSVGElement;\n\n /**\n * Creates a new edge view operator.\n *\n * @param innerContainer - The inner container element to append the edges container to.\n */\n constructor(innerContainer: JmElement) {\n this.container = this._initEdgesContainer(innerContainer);\n }\n\n updateEdgeViewsSize(viewSize: JmSize): void {\n this.container.style.width = `${viewSize.width}px`;\n this.container.style.height = `${viewSize.height}px`;\n }\n\n drawLine(node: JmNode, sourcePoint: JmPoint, targetPoint: JmPoint, style: JmResolvedLineStyle): void {\n let line = node._data.view.leadingLine;\n if(!line) {\n line = this._createLine();\n node._data.view.leadingLine = line;\n }\n line.setAttribute('d', this._buildPath(sourcePoint, targetPoint, style.curve));\n // Written on every draw, not just at creation: the element outlives\n // redraws, and a node can change tone while its line stays the same\n // element.\n line.setAttribute('stroke', style.color);\n line.setAttribute('stroke-width', String(style.width));\n // Round caps, matching what v1 did on canvas (`ctx.lineCap = 'round'`).\n // Required for the dotted pattern to be made of dots at all: with the\n // default `butt` cap a zero-length dash paints nothing.\n line.setAttribute('stroke-linecap', 'round');\n const dash = this._dashPattern(style);\n if(dash) {\n line.setAttribute('stroke-dasharray', dash);\n }else{\n // Removing the attribute is what makes a line solid. Leaving it set\n // would keep an element dashed after its style went back to solid.\n line.removeAttribute('stroke-dasharray');\n }\n line.style.visibility = 'visible';\n }\n\n eraseLine(node: JmNode): void {\n const line = node._data.view.leadingLine;\n if(!!line) {\n line.style.visibility = 'hidden';\n line.setAttribute('d', 'M 0 0 L 0 0');\n }\n }\n\n /**\n * Builds the path data for one line.\n *\n * @remarks\n * The bezier puts both control points on the horizontal midpoint, so the\n * line leaves the source and enters the target along the horizontal axis and\n * the bend stays symmetric. v1 used `x1 + 2*(x2-x1)/3` for the first control\n * point and the untouched `x1` for the second, which drags the bulge towards\n * the source and reads as lopsided once the vertical span is large.\n */\n private _buildPath(source: JmPoint, target: JmPoint, curve: JmLineCurve): string {\n if(curve === JmLineCurve.Straight) {\n return `M ${source.x} ${source.y} L ${target.x} ${target.y}`;\n }\n const midX = (source.x + target.x) / 2;\n return `M ${source.x} ${source.y} C ${midX} ${source.y}, ${midX} ${target.y}, ${target.x} ${target.y}`;\n }\n\n /**\n * Turns a dash pattern into an SVG `stroke-dasharray` value.\n *\n * @returns The dash array, or `null` for a solid line.\n *\n * @remarks\n * Dash lengths scale with the stroke width so a thicker line keeps the same\n * rhythm instead of collapsing into near-solid strokes.\n */\n private _dashPattern(style: JmResolvedLineStyle): string | null {\n switch(style.pattern) {\n case JmLinePattern.Dashed:\n return `${style.width * 4} ${style.width * 3}`;\n case JmLinePattern.Dotted:\n // Zero-length dash plus a round cap is the only way to get a\n // circle: the cap extends half the stroke width past each end of\n // the dash, so `0` renders a dot of diameter `stroke-width`.\n // A non-zero dash would paint a short rectangle instead.\n return `0 ${style.width * 2}`;\n case JmLinePattern.Solid:\n default:\n return null;\n }\n }\n\n private _createLine(): SVGPathElement {\n const line = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n line.setAttribute('fill', 'transparent');\n line.setAttribute('d', 'M 0 0 L 0 0');\n line.style.visibility = 'hidden';\n this.container.appendChild(line);\n return line;\n }\n\n /**\n * Initializes the edges container element (SVG).\n *\n * @param innerContainer - The inner container element.\n * @returns The created edges container element.\n */\n private _initEdgesContainer(innerContainer: JmElement): SVGSVGElement {\n const element = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n element.classList.add('jsmind-edges');\n innerContainer.appendChild(element);\n element.style.width = `${innerContainer.clientWidth}px`;\n element.style.height = `${innerContainer.clientHeight}px`;\n return element;\n }\n\n private _clearEdges(): void {\n }\n}\n","/**\n * Small string helpers the SVG wrapper needs.\n *\n * Pulled out of `export.ts` so they can be tested - hence the name. Everything left in that file\n * talks to the browser - cloning nodes, decoding images, encoding canvases -\n * and none of it runs under the unit suite. These do, and they are the parts\n * that failed silently when they were wrong:\n *\n * - an unescaped quote in an attribute ends it early, and the SVG fails to\n * parse with an error that names no line\n * - reading custom properties by iterating `CSSStyleDeclaration` yields\n * indices rather than property names, so the filter matched nothing and every\n * node lost its fill\n *\n * Both were bugs that produced a plausible-looking but wrong image.\n *\n * @packageDocumentation\n */\n\n/**\n * Escapes a value for use inside a double-quoted XML attribute.\n *\n * Computed values arrive unescaped: `font-family` on a document with a quoted\n * family yields the quotes themselves.\n *\n * @param value - Raw attribute value.\n * @returns The value with `&`, `<`, `>` and `\"` replaced by entities.\n */\nexport function escapeAttribute(value: string): string {\n return value\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;');\n}\n\n/**\n * Escapes text content for XML.\n *\n * Quotes are left alone: they are only special inside an attribute value.\n *\n * @param value - Raw text.\n * @returns The text with `&`, `<` and `>` replaced by entities.\n */\nexport function escapeText(value: string): string {\n return value.replace(/&/g, '&amp;').replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n}\n\n/**\n * Extracts the theme's custom properties from an inline style declaration.\n *\n * The theme reaches the DOM as `--jm-*` properties set inline on the host\n * element. A clone of the inner content keeps the ones set on nodes themselves,\n * but not these, so without copying them every node loses its fill, border,\n * radius and shadow and the export comes out as bare text.\n *\n * Takes the attribute string rather than the element on purpose: parsing it is\n * the part that has been wrong before, and it does not need a DOM to get right.\n *\n * @param styleAttribute - The host's inline `style` attribute, or `null`.\n * @returns The `--jm-*` declarations, joined with semicolons; empty when none.\n */\nexport function collectHostVariables(styleAttribute: string | null): string {\n if (styleAttribute === null) {\n return '';\n }\n return styleAttribute\n .split(';')\n .map(part => part.trim())\n .filter(part => part.startsWith('--jm-'))\n .join(';');\n}\n","/**\n * @fileoverview Turns the rendered content of the view's shadow root into an image.\n *\n * The browser has no API that converts a DOM subtree into pixels. Element\n * Capture and Region Capture come closest, but both sit on top of the Screen\n * Capture API and need the user to grant a capture prompt, which rules them out\n * for an export a script can call.\n *\n * What every DOM-to-image library does instead, and what this does, is hand the\n * markup back to the browser as an SVG `<foreignObject>` and let the rendering\n * engine paint it. Canvas only appears at the very end, to turn those pixels\n * into a file: `drawImage` then `toBlob`. Nothing is redrawn by hand, so the\n * output matches the view exactly, including text wrapping, shadows and the\n * theme.\n *\n * Excluded from the unit coverage figure (see `test:coverage` in package.json).\n * Everything left here talks to the browser - cloneNode, Image, canvas - so the\n * unit suite cannot reach a line of it. The UI suite exercises it for real,\n * against the built bundle, but a bundle carries no source line numbers to\n * report coverage against. The parts worth asserting in isolation live in\n * `export-svg.ts`; what remains is calls into browser APIs with no logic to check.\n */\n\nimport { JsMindError } from '../common/error.ts';\nimport { collectHostVariables, escapeAttribute, escapeText } from './export-svg.ts';\n\n/** Image formats a caller may ask for. */\nexport const JmImageType = {\n Png: 'image/png',\n Jpeg: 'image/jpeg',\n Webp: 'image/webp',\n} as const;\n\nexport type JmImageType = typeof JmImageType[keyof typeof JmImageType];\n\n/** Options for {@link captureShadowContent}. */\nexport interface JmExportImageOptions {\n /**\n * Device pixel ratio to render at. 2 gives a crisp result on high-density\n * screens and stays cheap; 1 mirrors what the user sees.\n */\n scale?: number;\n /** Output format. JPEG and WebP are lossy, PNG is not. */\n type?: JmImageType;\n /**\n * Quality for the lossy formats, 0 to 1. Ignored for PNG, where the browser\n * rejects a quality argument.\n */\n quality?: number;\n}\n\n/** What a capture produced. */\nexport interface JmExportImageResult {\n blob: Blob;\n /** Pixel width of the image, i.e. the content width times `scale`. */\n width: number;\n /** Pixel height of the image. */\n height: number;\n /** Content width in CSS pixels, before scaling. */\n cssWidth: number;\n /** Content height in CSS pixels, before scaling. */\n cssHeight: number;\n}\n\nconst DEFAULT_SCALE = 2;\n\n/**\n * Reads the shadow root's stylesheet back out.\n *\n * External stylesheets cannot reach into a shadow tree, which is why the view\n * carries its CSS as a string in the first place - that same string is what gets\n * inlined here.\n */\nfunction collectStyles(root: ShadowRoot): string {\n const sheets = root.querySelectorAll('style');\n return Array.from(sheets)\n .map(sheet => sheet.textContent ?? '')\n .join('\\n');\n}\n\n/**\n * Renders the shadow root's content to an image blob.\n *\n * The size is the content's own size, as laid out: the view sizes the map to\n * the larger of the container and the content, so whitespace the map does not\n * fill is kept and a map larger than its container is not cropped.\n *\n * @param host - The element the shadow root is attached to.\n * @param root - The view's shadow root.\n * @param size - The content size in CSS pixels, from the view.\n * @param options - Scale, format and quality.\n * @returns The encoded image plus its dimensions.\n * @throws {@link JsMindError} If there is nothing to capture, if the generated\n * SVG does not parse, or if the browser refuses to encode the canvas.\n */\nexport async function captureShadowContent(\n host: HTMLElement,\n root: ShadowRoot,\n size: { width: number; height: number },\n options: JmExportImageOptions = {}\n): Promise<JmExportImageResult> {\n const scale = options.scale ?? DEFAULT_SCALE;\n const type = options.type ?? JmImageType.Png;\n\n const inner = root.querySelector<HTMLElement>('.jsmind-inner');\n if (!inner) {\n throw new JsMindError('Nothing to capture: the view has no rendered content.');\n }\n\n // The size comes from the caller, not from the element. The inner container\n // is sized by its own container through CSS, so `clientWidth` reports the\n // viewport, not the map: a map larger than the box would be captured\n // cropped to the box. The view keeps the real size separately and hands it\n // over here.\n const cssWidth = size.width;\n const cssHeight = size.height;\n if (cssWidth === 0 || cssHeight === 0) {\n throw new JsMindError(\n `Nothing to capture: the rendered content has no size (${cssWidth}x${cssHeight}).`\n );\n }\n\n const clone = inner.cloneNode(true) as HTMLElement;\n clone.style.position = 'absolute';\n clone.style.left = '0';\n clone.style.top = '0';\n clone.style.margin = '0';\n // The container scrolls; inside a picture that would paint scrollbars.\n clone.style.overflow = 'visible';\n // It is already positioned in the export, not offset by a view pan.\n clone.style.transform = 'none';\n\n // `outerHTML` of a live <svg> carries no xmlns: the element is in the SVG\n // namespace already, so the serializer omits it. Reparsed as XHTML it is an\n // unknown element and paints nothing at all - which is how the edge layer\n // silently disappears from the export.\n for (const svg of Array.from(clone.querySelectorAll('svg'))) {\n svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n }\n\n const hostStyle = getComputedStyle(host);\n const wrapperStyle = escapeAttribute(\n [\n `width:${cssWidth}px`,\n `height:${cssHeight}px`,\n 'position:relative',\n 'overflow:hidden',\n `background:${hostStyle.backgroundColor}`,\n `font-family:${hostStyle.fontFamily}`,\n collectHostVariables(host.getAttribute('style')),\n ]\n .filter(Boolean)\n .join(';')\n );\n\n const svg =\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${cssWidth}\" height=\"${cssHeight}\">` +\n '<foreignObject x=\"0\" y=\"0\" width=\"100%\" height=\"100%\">' +\n `<div xmlns=\"http://www.w3.org/1999/xhtml\" style=\"${wrapperStyle}\">` +\n `<style>${escapeText(collectStyles(root))}</style>` +\n clone.outerHTML +\n '</div></foreignObject></svg>';\n\n const parsed = new DOMParser().parseFromString(svg, 'image/svg+xml');\n if (parsed.querySelector('parsererror')) {\n throw new JsMindError('Failed to render the view to an image: the generated SVG is malformed.');\n }\n\n // A blob: URL taints the canvas once the SVG carries a foreignObject, so\n // toBlob throws SecurityError. A data: URL keeps the document same-origin.\n const dataUrl = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;\n const image = await loadImage(dataUrl);\n\n const canvas = document.createElement('canvas');\n canvas.width = Math.round(cssWidth * scale);\n canvas.height = Math.round(cssHeight * scale);\n\n const context = canvas.getContext('2d');\n if (!context) {\n throw new JsMindError('Failed to render the view to an image: 2D canvas is unavailable.');\n }\n context.scale(scale, scale);\n context.drawImage(image, 0, 0);\n\n const blob = await encodeCanvas(canvas, type, options.quality);\n\n return {\n blob,\n width: canvas.width,\n height: canvas.height,\n cssWidth,\n cssHeight,\n };\n}\n\n/** Loads a data URL into a decoded image. */\nfunction loadImage(src: string): Promise<HTMLImageElement> {\n return new Promise((resolve, reject) => {\n const image = new Image();\n image.onload = () => resolve(image);\n // The error event carries no detail beyond \"failed to load\", so the\n // message has to say where to look.\n image.onerror = () =>\n reject(new JsMindError('Failed to render the view to an image: the SVG did not load.'));\n image.src = src;\n });\n}\n\n/** Encodes a canvas, passing a quality only for the lossy formats. */\nfunction encodeCanvas(\n canvas: HTMLCanvasElement,\n type: JmImageType,\n quality: number | undefined\n): Promise<Blob> {\n return new Promise((resolve, reject) => {\n const done = (blob: Blob | null): void => {\n if (blob === null) {\n reject(new JsMindError(`Failed to encode the image as ${type}.`));\n } else {\n resolve(blob);\n }\n };\n // PNG has no quality knob; passing one makes some browsers treat the\n // argument as a format hint and fall back to a different encoder.\n if (type === JmImageType.Png || quality === undefined) {\n canvas.toBlob(done, type);\n } else {\n canvas.toBlob(done, type, quality);\n }\n });\n}\n","import type { JmMind } from '../model/mind.ts';\nimport { JsMindError } from '../common/error.ts';\nimport type { ViewOptions } from '../common/option.ts';\nimport { JmNodeView } from './node.ts';\nimport { JmEdgeView } from './edge.ts';\nimport { attachViewShadowRoot, applyThemeToHost } from './shadow.ts';\nimport { resolveJmStyle, JmTone, JmLinePattern, JmLineCurve, JSMIND_THEME_DEFAULT } from '../model/data/style.ts';\nimport { captureShadowContent, type JmExportImageOptions, type JmExportImageResult } from './export.ts';\nimport type { JmTheme } from '../model/data/style.ts';\nimport type { JmResolvedLineStyle } from './edge.ts';\nimport { DomUtility, JmDomUtility, type JmElement } from '../common/dom.ts';\nimport type { JmNode } from '../model/data/node.ts';\nimport { JmPoint, JmSize } from '../common/index.ts';\nimport type { Arranger } from '../arranger/index.ts';\n\n/**\n * View of mind map.\n * @public\n */\nexport class JmView {\n private readonly container: HTMLElement;\n\n private readonly shadowRoot: ShadowRoot;\n\n private readonly innerContainer: JmElement;\n\n private readonly nodeView: JmNodeView;\n\n private readonly edgeView: JmEdgeView;\n\n private readonly arranger: Arranger;\n\n private readonly options: ViewOptions;\n\n /**\n * The theme resolved from the mind map's style, kept so that per-node\n * decisions at render time (tone lookup, line fallbacks) do not have to\n * re-resolve it for every node.\n *\n * Starts at the built-in default rather than null: a node can be rendered\n * before `applyTheme` runs, and a null theme would force every lookup to\n * carry an optional chain and a hardcoded colour of its own.\n */\n private theme: JmTheme = JSMIND_THEME_DEFAULT;\n\n private readonly viewSize: JmSize = new JmSize(1, 1);\n\n private readonly viewOffset: JmPoint = new JmPoint(0, 0);\n\n private constructor(container: HTMLElement, shadowRoot: ShadowRoot, innerContainer: JmElement, nodeView: JmNodeView, edgeView: JmEdgeView, arranger: Arranger, options: ViewOptions) {\n this.container = container;\n this.shadowRoot = shadowRoot;\n this.innerContainer = innerContainer;\n this.nodeView = nodeView;\n this.edgeView = edgeView;\n this.arranger = arranger;\n this.options = options;\n }\n\n static async create(container: string | HTMLElement, arranger: Arranger, options: ViewOptions): Promise<JmView> {\n const jmContainer = await this._initContainer(container);\n // Rendered content lives in a shadow root: the map's structural rules\n // are installed there, so the host page cannot reach them and they\n // cannot reach the host page.\n const shadowRoot = attachViewShadowRoot(jmContainer);\n const innerContainer = this._initInnerContainer(shadowRoot);\n const nodeView = new JmNodeView(innerContainer, options);\n const edgeView = new JmEdgeView(innerContainer);\n return new JmView(jmContainer, shadowRoot, innerContainer, nodeView, edgeView, arranger, options);\n }\n\n private static async _initContainer(container: string | HTMLElement): Promise<HTMLElement> {\n if (!container) {\n throw new JsMindError('Container is required');\n }\n if (typeof container === 'string') {\n const element = document.getElementById(container);\n if (!element) {\n throw new JsMindError(`Container element with ID '${container}' is not found`);\n }\n await DomUtility.ensureElementVisible(element);\n return element;\n }\n return container;\n }\n\n private static _initInnerContainer(shadowRoot: ShadowRoot): JmElement {\n const jmElement = JmDomUtility.createElement('div', 'jsmind-inner');\n jmElement.classList.add('jsmind-inner');\n // Appended to the shadow root, not to its host: this is what puts the\n // rendered tree inside the style boundary.\n shadowRoot.appendChild(jmElement.element);\n return jmElement;\n }\n\n /**\n * Resolves the mind map's style and pushes it onto the rendered tree.\n *\n * @remarks\n * Must run before measuring: a node's measured size depends on its padding,\n * font size and line height, and those come from the theme. Applying it\n * afterwards would lay the map out to the previous theme's geometry and\n * leave the rendered nodes disagreeing with the coordinates beside them.\n *\n * @param mind - The mind map about to be rendered.\n */\n applyTheme(mind: JmMind): void {\n const theme = resolveJmStyle(mind.style);\n this.theme = theme;\n applyThemeToHost(this.shadowRoot, theme);\n this.nodeView.setTheme(theme);\n }\n\n async measureNodeSizes(mind: JmMind): Promise<void> {\n const promises = Object.values(mind._nodes).map((node: JmNode)=>this.measureNodeSize(node));\n await Promise.all(promises);\n }\n\n async measureNodeSize(node: JmNode): Promise<JmSize> {\n return this.nodeView.createAndMeasure(node)\n .then((size: JmSize)=>{\n this.arranger.recordNodeSize(node, size);\n return size;\n });\n }\n\n async settle(mind: JmMind, _changedNodeIds: string[] = []): Promise<void> {\n this._updateViewSize(mind);\n this.nodeView.updateCanvasSize(this.viewSize);\n this.edgeView.updateEdgeViewsSize(this.viewSize);\n this._settleNode(mind, this.viewOffset);\n this._renderEdges(mind, this.viewOffset);\n }\n\n private _settleNode(mind: JmMind, viewOffset: JmPoint): void {\n Object.values(mind._nodes).forEach((node: JmNode)=>{\n if(this.arranger.isNodeVisible(node)) {\n // reset custom style\n const nodePoint = this.arranger.calculateNodePoint(node);\n const absolutePoint = nodePoint.offset(viewOffset);\n this.nodeView.placeNode(node, absolutePoint);\n\n const nodeExpanderPoint = this.arranger.calculateNodeExpanderPoint(node);\n const absoluteExpanderPoint = nodeExpanderPoint.offset(viewOffset);\n this.nodeView.placeNodeExpander(node, absoluteExpanderPoint);\n }else{\n this.nodeView.hideNode(node);\n this.nodeView.hideNodeExpander(node);\n }\n });\n }\n\n private _renderEdges(mind: JmMind, viewOffset: JmPoint): void {\n Object.values(mind._nodes)\n .filter((node: JmNode)=>!node.isRoot())\n .forEach((node: JmNode)=>{\n if(this.arranger.isNodeVisible(node)) {\n const sourcePoint = this.arranger.calculateNodeOutgoingPoint(node.parent!);\n const targetPoint = this.arranger.calculateNodeIncomingPoint(node);\n const absoluteSourcePoint = sourcePoint.offset(viewOffset);\n const absoluteTargetPoint = targetPoint.offset(viewOffset);\n this.edgeView.drawLine(node, absoluteSourcePoint, absoluteTargetPoint, this._resolveLineStyle(node));\n }else{\n this.edgeView.eraseLine(node);\n }\n });\n }\n\n /**\n * Resolves the style of the line that connects a node to its parent.\n *\n * @remarks\n * Three layers, most specific first:\n *\n * 1. `node.style.incoming` — this one line.\n * 2. The node's tone — a subtree reads as one visual grouping, because the\n * tone's `lineColor` differs from the fill rather than repeating it.\n * 3. The theme's `line` block — width, pattern and curve for the map.\n *\n * The line belongs to the child, not the parent: a line connects exactly one\n * child, so the child is the natural owner and can restyle its own\n * connection without touching its siblings. v1 did the same, reading\n * `leading-line-color` off the child's `data`.\n *\n * `curve` deliberately does not fall back to the tone. A tone is a colour,\n * and letting it carry geometry would make two nodes of the same tone but\n * different shapes impossible to express.\n */\n private _resolveLineStyle(node: JmNode): JmResolvedLineStyle {\n const theme = this.theme;\n const incoming = node.style?.incoming;\n const tone = node.style?.tone ?? JmTone.Default;\n // The default palette is the last resort for an unknown or unstyled\n // tone, and it comes from the same constant the theme was built from, so\n // an untoned node never falls through to a colour of its own.\n const palette = theme.tones?.[tone] ?? JSMIND_THEME_DEFAULT.tones?.[JmTone.Default];\n\n // Every fallback reads the theme. The final literal is unreachable while\n // JSMIND_THEME_DEFAULT defines a default tone - it exists so the type is\n // `string`, not as a second source of truth that could drift.\n return {\n color: incoming?.color ?? palette?.lineColor ?? '#b0b0b0',\n width: incoming?.width ?? theme.line?.width ?? 2,\n pattern: incoming?.pattern ?? theme.line?.pattern ?? JmLinePattern.Solid,\n curve: incoming?.curve ?? theme.line?.curve ?? JmLineCurve.Bezier,\n };\n }\n\n /**\n * Renders the current content to an image.\n *\n * Kept on the view rather than reached into from outside: the host element\n * and the shadow root are both private, and they are exactly what the\n * capture needs.\n *\n * @param options - Scale, format and quality.\n * @returns The encoded image plus its dimensions.\n */\n async capture(options?: JmExportImageOptions): Promise<JmExportImageResult> {\n return await captureShadowContent(this.container, this.shadowRoot, this.viewSize, options);\n }\n\n private _updateViewSize(mind: JmMind): void {\n const mindBounds = this.arranger.calculateMindBounds(mind);\n const mindViewSize = mindBounds.size;\n const minWidth = mindViewSize.width + this.options.padding.left + this.options.padding.right;\n const minHeight = mindViewSize.height + this.options.padding.top + this.options.padding.bottom;\n this.viewSize.width = Math.max(this.innerContainer.clientWidth, minWidth);\n this.viewSize.height = Math.max(this.innerContainer.clientHeight, minHeight);\n\n const centerOffset = mindBounds.center;\n this.viewOffset.x = this.viewSize.width / 2 - centerOffset.x;\n this.viewOffset.y = this.viewSize.height / 2 - centerOffset.y;\n }\n}\n","/**\n * Generic cache for storing function results with any key and value types.\n * @public\n */\nexport class JmCache<K, V> {\n private readonly cache: Map<string, V>;\n\n private readonly name: string;\n\n private readonly keySelector: (key: K) => string;\n\n private hits: number = 0;\n\n private misses: number = 0;\n\n constructor(name: string, keySelector: (key: K) => string) {\n this.name = name;\n this.cache = new Map();\n this.keySelector = keySelector;\n }\n\n /**\n * Gets the cached value for the given key.\n *\n * @param key - The key to get the cached value for\n * @returns The cached value, or undefined if not found\n */\n get(key: K): V | undefined {\n const cacheKey = this.keySelector(key);\n const exists = this.cache.has(cacheKey);\n if (exists) {\n this.hits++;\n } else {\n this.misses++;\n }\n return this.cache.get(cacheKey);\n }\n\n /**\n * Stores a value in the cache for the given key.\n *\n * @param key - The key to cache the value for\n * @param value - The value to cache\n */\n put(key: K, value: V): void {\n this.cache.set(this.keySelector(key), value);\n }\n\n /**\n * Clears all cached values.\n */\n clear(): void {\n this.cache.clear();\n this.hits = 0;\n this.misses = 0;\n }\n\n /**\n * Gets cache statistics including hit rate.\n *\n * @returns An object containing hits, misses, total requests, and hit rate\n */\n stat(): {\n hits: number;\n misses: number;\n total: number;\n hitRate: number;\n } {\n const total = this.hits + this.misses;\n const hitRate = total > 0 ? this.hits / total : 0;\n return {\n hits: this.hits,\n misses: this.misses,\n total,\n hitRate,\n };\n }\n\n wrap(key: K, func: () => V): V {\n const cached = this.get(key);\n if(cached !== undefined) {\n return cached;\n }\n const value = func();\n this.put(key, value);\n return value;\n }\n\n /**\n * Prints cache statistics to the console.\n */\n printStats(): void {\n const stats = this.stat();\n console.log(`${this.name} Statistics:`);\n console.log(` Hits: ${stats.hits}`);\n console.log(` Misses: ${stats.misses}`);\n console.log(` Total: ${stats.total} (${(stats.hitRate * 100).toFixed(2)}%)`);\n }\n}\n","import { JmCache } from '../common/cache.ts';\nimport { JmBounds, JmPoint, JmSize } from '../common/index.ts';\nimport type { LayoutOptions } from '../common/option.ts';\nimport type { JmMind } from '../model/mind.ts';\nimport { JmNodeSide, type JmNode } from '../model/data/node.ts';\nimport type { Arranger } from './index.ts';\n\nexport class MindmapArranger implements Arranger {\n\n private readonly nodeInSidePredicateA = (node: JmNode)=>{return node.side === JmNodeSide.SideA;};\n\n private readonly nodeInSidePredicateB = (node: JmNode)=>{return node.side === JmNodeSide.SideB;};\n\n private readonly nodeHasCousinsPredicate = (node: JmNode)=>{\n return !node.folded && node.children.length > 0 && (node.parent?.children?.length ?? 0) > 1;\n };\n\n private readonly nodeInComingPointCache = new JmCache<JmNode, JmPoint>('nodeInComingPointCache', (node: JmNode)=>node.id);\n\n\n options: LayoutOptions;\n\n expanderSize: JmSize;\n\n constructor(options: LayoutOptions) {\n this.options = options;\n this.expanderSize = new JmSize(options.expanderSize, options.expanderSize);\n }\n\n /**\n * Calculate the layout of the mind map.\n * @param mind - The mind map data model\n */\n calculate(mind: JmMind): void {\n this.nodeInComingPointCache.clear();\n\n const rootNode = mind._root;\n this._arrange(rootNode);\n this._markInvisibleNodes(rootNode);\n this._calculateOffset(rootNode);\n }\n\n calculateMindBounds(mind: JmMind): JmBounds {\n const rootLayoutData = mind._root._data.layout;\n const rootMaxX: number = rootLayoutData.size.width / 2;\n const rootMinX: number = 0 - rootMaxX;\n\n const outcomePointsX: number[] = Object.values(mind._nodes)\n .filter((node: JmNode)=>node._data.layout.visible)\n .map((node: JmNode)=>this.calculateNodeOutgoingPoint(node))\n .map((p: JmPoint)=>p.x);\n\n const minX: number = Math.min(...outcomePointsX, rootMinX);\n const maxX: number = Math.max(...outcomePointsX, rootMaxX);\n\n const width = maxX - minX;\n const height = rootLayoutData.withDescendantsSize.height;\n\n const size = new JmSize(width, height);\n const center = new JmPoint((minX + maxX) / 2, 0);\n\n return new JmBounds(center, size);\n }\n\n calculateNodePoint(node: JmNode): JmPoint {\n const size = node._data.layout.size;\n const incomingPoint = this.calculateNodeIncomingPoint(node);\n const offsetToIncomingPoint = new JmPoint(\n (size.width * (node._data.layout.side - 1)) / 2,\n -size.height / 2\n );\n return incomingPoint.offset(offsetToIncomingPoint);\n }\n\n calculateNodeExpanderPoint(node: JmNode): JmPoint {\n if(node.isRoot()) {\n return JmPoint.Zero;\n }\n const outgoingPoint = this.calculateNodeOutgoingPoint(node);\n const offsetToOutgoingPoint = new JmPoint(\n this.options.expanderSize * (node._data.layout.side + 1) / -2,\n - this.options.expanderSize / 2);\n return outgoingPoint.offset(offsetToOutgoingPoint);\n }\n\n calculateNodeOutgoingPoint(node: JmNode): JmPoint {\n if(node.isRoot()) {\n return JmPoint.Zero;\n }\n const incomingPoint = this.calculateNodeIncomingPoint(node);\n const offsetToIncomingPointX: number = (node._data.layout.size.width + this.options.expanderSize) * node._data.layout.side;\n const offsetToIncomingPoint = new JmPoint(offsetToIncomingPointX, 0);\n return incomingPoint.offset(offsetToIncomingPoint);\n }\n\n calculateNodeIncomingPoint(node: JmNode): JmPoint {\n if(node.isRoot()) {\n return JmPoint.Zero;\n }\n return this.nodeInComingPointCache.wrap(node, ()=>{\n const parentIncomingPoint = this.calculateNodeIncomingPoint(node.parent!);\n return parentIncomingPoint.offset(node._data.layout.offsetToParent);\n });\n }\n\n isNodeVisible(node: JmNode): boolean {\n return node._data.layout.visible;\n }\n\n recordNodeSize(node: JmNode, size: JmSize): void {\n node._data.layout.size = size;\n }\n\n printCacheStats(): void {\n this.nodeInComingPointCache.printStats();\n }\n\n private _arrange(rootNode: JmNode) {\n rootNode._data.layout.side = JmNodeSide.Center;\n rootNode.children\n .filter(this.nodeInSidePredicateA)\n .forEach((node: JmNode)=>this._arrangeSide(node, JmNodeSide.SideA));\n rootNode.children\n .filter(this.nodeInSidePredicateB)\n .forEach((node: JmNode)=>this._arrangeSide(node, JmNodeSide.SideB));\n }\n\n private _arrangeSide(node: JmNode, side: JmNodeSide) {\n node._data.layout.side = side;\n node.children.forEach((n: JmNode)=>this._arrangeSide(n, side));\n }\n\n private _markInvisibleNodes(node: JmNode) {\n if(node.folded) {\n this._applyToDescendants(node, (n: JmNode)=>{n._data.layout.visible = false;});\n }else{\n this._applyToDescendants(node, (n: JmNode)=>{this._markInvisibleNodes(n);});\n }\n }\n\n private _calculateOffset(rootNode: JmNode) {\n const nodesOnSideA = rootNode.children.filter(this.nodeInSidePredicateA);\n const nodesOnSideB = rootNode.children.filter(this.nodeInSidePredicateB);\n const heightRoot = rootNode._data.layout.size.height;\n const heightA = this._calculateNodesOffset(nodesOnSideA, true);\n const heightB = this._calculateNodesOffset(nodesOnSideB, true);\n // debug('calculateOffset', heightRoot, heightA, heightB);\n rootNode._data.layout.withDescendantsSize.height = Math.max(heightRoot, heightA, heightB);\n }\n\n /**\n * Calculate the offset for the nodes, from bottom to top.\n * @param nodes - The nodes to calculate the offset for, the first item should be the bottom node\n * @param isFirstLevelNodes - Whether the nodes are the first level nodes\n * @returns The total height of the nodes\n */\n private _calculateNodesOffset(nodes: JmNode[], isFirstLevelNodes?: boolean): number {\n let offsetY = 0;\n let totalHeight = 0;\n const visibleNodes = nodes.filter((node: JmNode)=>node._data.layout.visible);\n // debug('visibleNodes', visibleNodes.length, isFirstLevelNodes);\n // debug('calculateNodesOffset options', this.options);\n visibleNodes.forEach((node: JmNode)=>{\n const parentLayout = node.parent!._data.layout;\n const layoutData = node._data.layout;\n const expanderSpace = !!isFirstLevelNodes ? 0 : this.options.expanderSize * layoutData.side;\n const cousinSpace = this.nodeHasCousinsPredicate(node) ? this.options.cousinSpace : 0;\n const height = Math.max(\n this._calculateNodesOffset(node.children, false),\n layoutData.size.height\n ) + cousinSpace;\n layoutData.withDescendantsSize.height = height;\n layoutData.offsetToParent.y = offsetY + height / 2;\n // debug(`calculateNodesOffset for node ${node.content.getText()}`, offsetY, height);\n layoutData.offsetToParent.x = this.options.parentChildSpace * layoutData.side + parentLayout.size.width * (parentLayout.side + layoutData.side) / 2 + expanderSpace;\n offsetY = offsetY + height + this.options.siblingSpace;\n totalHeight += height;\n });\n if(visibleNodes.length > 1) {\n totalHeight += this.options.siblingSpace * (visibleNodes.length - 1);\n }\n const halfTotalHeight = totalHeight / 2;\n visibleNodes.forEach((node: JmNode)=>{\n node._data.layout.offsetToParent.y -= halfTotalHeight;\n });\n return totalHeight;\n }\n\n\n /**\n * Traverse the node and its children recursively.\n * @param nodes - The nodes to start traversing from\n * @param func - The function to call for each node\n */\n private _applyToDescendants(node: JmNode, func: (n: JmNode) => void): void {\n node.children.forEach((n: JmNode)=>{\n func(n);\n this._applyToDescendants(n, func);\n });\n }\n}\n","import type { JmMindEvent, JmMindEventDataOnEdgeAdded, JmMindEventDataOnEdgeRemoved, JmMindEventDataOnNodeAdded, JmMindEventDataOnNodeMoved, JmMindEventDataOnNodeRemoved, JmMindEventDataOnNodeUpdated } from './event/data.ts';\nimport { JmMindEventType } from './event/index.ts';\nimport type { JmMind } from './mind.ts';\nimport type { JmObserver } from '../observer/index.ts';\n\nexport abstract class JmMindObserver implements JmObserver<JmMind> {\n update(observedObject: JmMind, event: unknown): void {\n const eventData = event as JmMindEvent;\n switch (eventData.type) {\n case JmMindEventType.NodeAdded:\n this.onNodeAdded(observedObject, eventData.data as JmMindEventDataOnNodeAdded);\n break;\n case JmMindEventType.NodeRemoved:\n this.onNodeRemoved(observedObject, eventData.data as JmMindEventDataOnNodeRemoved);\n break;\n case JmMindEventType.NodeUpdated:\n this.onNodeUpdated(observedObject, eventData.data as JmMindEventDataOnNodeUpdated);\n break;\n case JmMindEventType.NodeMoved:\n this.onNodeMoved(observedObject, eventData.data as JmMindEventDataOnNodeMoved);\n break;\n case JmMindEventType.EdgeAdded:\n this.onEdgeAdded(observedObject, eventData.data as JmMindEventDataOnEdgeAdded);\n break;\n case JmMindEventType.EdgeRemoved:\n this.onEdgeRemoved(observedObject, eventData.data as JmMindEventDataOnEdgeRemoved);\n break;\n }\n }\n\n abstract onNodeAdded(observedObject: JmMind, event: JmMindEventDataOnNodeAdded): void;\n abstract onNodeRemoved(observedObject: JmMind, event: JmMindEventDataOnNodeRemoved): void;\n abstract onNodeUpdated(observedObject: JmMind, event: JmMindEventDataOnNodeUpdated): void;\n abstract onNodeMoved(observedObject: JmMind, event: JmMindEventDataOnNodeMoved): void;\n abstract onEdgeAdded(observedObject: JmMind, event: JmMindEventDataOnEdgeAdded): void;\n abstract onEdgeRemoved(observedObject: JmMind, event: JmMindEventDataOnEdgeRemoved): void;\n}\n","import type { JmNode } from '../model/data/node.ts';\n\nexport const debug = (label: string, ...objArray: unknown[]) => {\n const titleLength = 80;\n const title = `================= [DEBUG] ${label} `.padEnd(titleLength, '=');\n console.log(title);\n objArray.forEach((obj: unknown) => {\n const objString = JSON.stringify(obj, (key: string, value: unknown) => {\n if (key === 'parent') {\n return (value as JmNode | null)?.id ?? null;\n }\n return value;\n }, 2).replace(/\\n/g, '\\n ');\n console.log(` ${typeof obj}:`, objString);\n });\n const separator = '-'.repeat(titleLength);\n console.log(separator);\n console.log('');\n};\n\n","import type { Arranger } from '../arranger/index.ts';\nimport { MindmapArranger } from '../arranger/mindmap.ts';\nimport type { JmMind } from '../model/mind.ts';\nimport type { JmView } from '../view/index.ts';\nimport { JmMindObserver } from '../model/mind-observer.ts';\nimport { debug } from '../common/debug.ts';\nimport type { JmMindEventDataOnNodeRemoved, JmMindEventDataOnNodeUpdated, JmMindEventDataOnNodeMoved, JmMindEventDataOnEdgeAdded, JmMindEventDataOnEdgeRemoved, JmMindEventDataOnNodeAdded } from '../model/event/data.ts';\n\nexport class JmMindChangeCoordinator extends JmMindObserver {\n\n private readonly arranger: Arranger;\n\n private readonly view: JmView;\n\n constructor(arranger: Arranger, view: JmView) {\n super();\n this.arranger = arranger;\n this.view = view;\n }\n\n async onMindMapOpened(mind: JmMind): Promise<void> {\n // Before measuring, not after: a node's measured size depends on the\n // theme's padding, font size and line height. Applying it later would\n // lay the map out to the previous theme's geometry.\n this.view.applyTheme(mind);\n await this.view.measureNodeSizes(mind);\n this.arranger.calculate(mind);\n await this.view.settle(mind);\n if (this.arranger instanceof MindmapArranger) {\n this.arranger.printCacheStats();\n }\n }\n\n onMindMapClosed(_mind: JmMind): void {\n // Empty for now - can be extended in the future\n // for cleanup operations like removing observers, clearing caches, etc.\n }\n\n async onNodeAdded(mind: JmMind, event: JmMindEventDataOnNodeAdded): Promise<void> {\n debug('onNodeAdded', mind.meta.name, event);\n await this.view.measureNodeSize(event.node);\n this.arranger.calculate(mind);\n await this.view.settle(mind);\n if (this.arranger instanceof MindmapArranger) {\n this.arranger.printCacheStats();\n }\n }\n\n onNodeRemoved(mind: JmMind, event: JmMindEventDataOnNodeRemoved): void {\n debug('onNodeRemoved', mind.meta.name, event);\n }\n\n onNodeUpdated(mind: JmMind, event: JmMindEventDataOnNodeUpdated): void {\n debug('onNodeUpdated', mind.meta.name, event);\n }\n\n onNodeMoved(mind: JmMind, event: JmMindEventDataOnNodeMoved): void {\n debug('onNodeMoved', mind.meta.name, event);\n }\n\n onEdgeAdded(mind: JmMind, event: JmMindEventDataOnEdgeAdded): void {\n debug('onEdgeAdded', mind.meta.name, event);\n }\n\n onEdgeRemoved(mind: JmMind, event: JmMindEventDataOnEdgeRemoved): void {\n debug('onEdgeRemoved', mind.meta.name, event);\n }\n}\n","/**\n * Application-level commands.\n *\n * The counterpart to the change coordinator. The coordinator answers \"the mind\n * changed, update the view\"; the commander answers \"the caller asked for\n * something, do it\". Between them they cover both directions of traffic, and\n * both hold the view the same way - as a narrow handle, not as the class.\n *\n * Existing as its own object rather than as methods on `JsMind` is what makes\n * these commands addressable: a menu item, a keyboard shortcut or a future\n * toolbar can hold a reference to one and call it without knowing where the\n * view lives or how it works. Methods buried in the facade are reachable only\n * by whoever holds the facade.\n *\n * @packageDocumentation\n */\n\nimport type { JmExportImageOptions, JmExportImageResult } from '../view/export.ts';\nimport type { JmViewHandle } from '../view/handle.ts';\n\n/**\n * Issues commands that change what is displayed, never what is stored.\n *\n * @public\n */\nexport class JmCommander {\n /** What commands may ask of the view. */\n private readonly view: JmViewHandle;\n\n /**\n * Creates a commander.\n *\n * @param view - The view's capabilities.\n */\n constructor(view: JmViewHandle) {\n this.view = view;\n }\n\n /**\n * Renders the displayed map to an image.\n *\n * @param options - Scale, format and quality.\n * @returns The encoded image plus its dimensions.\n */\n async exportImage(options?: JmExportImageOptions): Promise<JmExportImageResult> {\n return await this.view.capture(options);\n }\n\n // Future viewport commands land here, next to this one:\n //\n // panTo(x: number, y: number): void;\n // zoomTo(scale: number): void;\n // centerOn(nodeId: string): void;\n //\n // Folding and moving do not, for the reason given in the handle: they change\n // the mind, and the mind already notifies the view. A command that reached\n // past the model would be a second way to write the same data.\n}\n","/**\n * FreeMind serializer for JsMind mind maps (placeholder).\n *\n * @packageDocumentation\n */\nimport type { JmMindSerializer } from './serializer.ts';\nimport { JsMindError } from '../common/error.ts';\nimport type { JmMind } from '../model/mind.ts';\n\n/**\n * FreeMind serializer for mind maps (not yet implemented).\n *\n * @public\n */\nexport class JmMindFreeMindSerializer implements JmMindSerializer {\n /**\n * Gets the format name this serializer supports.\n *\n * @returns The format name.\n */\n getFormatName(): string {\n return 'freemind';\n }\n\n /**\n * Serializes a mind map to FreeMind format.\n *\n * @param mind - The mind map to serialize.\n * @returns The serialized data.\n * @throws {@link JsMindError} FreeMind serialization is not yet implemented.\n */\n serialize(mind: JmMind): unknown {\n throw new JsMindError('FreeMind serialization is not yet implemented', { cause: mind });\n }\n\n /**\n * Deserializes FreeMind data to a mind map.\n *\n * @param data - The data to deserialize.\n * @returns The deserialized mind map.\n * @throws {@link JsMindError} FreeMind deserialization is not yet implemented.\n */\n deserialize(data: unknown): JmMind {\n throw new JsMindError('FreeMind deserialization is not yet implemented', { cause: data });\n }\n\n /**\n * Validates if the data can be deserialized by this serializer.\n *\n * @remarks\n * Basic validation - will be implemented later.\n *\n * @param data - The data to validate.\n * @returns True if the data is valid for this format.\n */\n validate(data: unknown): boolean {\n // Basic validation - will be implemented later\n if (data) {\n // This is a placeholder - will be implemented later\n }\n return false;\n }\n}\n\n","/**\n * Validation for v2 mind map data.\n *\n * @remarks\n * Every check returns a coded issue instead of throwing. A caller (the CLI, a\n * host application, an agent) branches on `code`; the `message` is for humans\n * to read and must never be parsed.\n *\n * @packageDocumentation\n */\n\nimport { JmTone } from '../model/data/style.ts';\nimport { JSMIND_THEME_PRESETS } from '../model/data/style.ts';\nimport { JmLinePattern } from '../model/data/style.ts';\nimport { JmNodeSide } from '../model/data/node.ts';\nimport { JmEdgeType } from '../model/data/edge.ts';\nimport { JmNodeContentType } from '../model/data/node-content.ts';\n\n/**\n * Error codes for v2 data validation.\n *\n * @remarks\n * Codes are stable identifiers. Messages may be reworded at any time; these\n * may not.\n *\n * @public\n */\nexport const JmValidationCode = {\n /** Top-level `format` missing or not \"jsmind_v2\". */\n Format: 'E_FORMAT',\n /** `meta` missing or its fields are not strings. */\n Meta: 'E_META',\n /** The top-level `nodes` object is absent or not an object. */\n NodesMissing: 'E_NODES_MISSING',\n /** The top-level `edges` object is absent or not an object. */\n EdgesMissing: 'E_EDGES_MISSING',\n /** `root` does not point at an existing node. */\n RootMissing: 'E_ROOT_MISSING',\n /** A `nodes` key differs from the `id` of its value. */\n NodeKeyMismatch: 'E_NODE_KEY_MISMATCH',\n /** An `edges` key differs from the `id` of its value. */\n EdgeKeyMismatch: 'E_EDGE_KEY_MISMATCH',\n /** A node's `parent` points at a node that is not present. */\n NodeParentMissing: 'E_NODE_PARENT_MISSING',\n /** A node's `children` lists an id that is not present. */\n NodeChildMissing: 'E_NODE_CHILD_MISSING',\n /** An edge endpoint points at a node that is not present. */\n EdgeNodeMissing: 'E_EDGE_NODE_MISSING',\n /** More than one node has `parent === null`. */\n MultipleRoots: 'E_MULTIPLE_ROOTS',\n /** The root node has a non-null `parent`. */\n RootParentSet: 'E_ROOT_PARENT_SET',\n /** A non-root node uses `side: 0`, which belongs to the root alone. */\n NonRootSideCenter: 'E_NON_ROOT_SIDE_CENTER',\n /** `parent.children` and `child.parent` disagree. */\n ParentChildMismatch: 'E_PARENT_CHILD_MISMATCH',\n /** Following `parent` links returns to where it started. */\n Cycle: 'E_CYCLE',\n /** `content.type` is not a known content type. */\n ContentType: 'E_CONTENT_TYPE',\n /** `edge.type` is not a known edge type. */\n EdgeType: 'E_EDGE_TYPE',\n /** `side` is not a known side value. */\n Side: 'E_SIDE',\n /** `style.tone` is not one of the known tones. */\n Tone: 'E_TONE',\n /** A line pattern is not solid/dashed/dotted. */\n LineStyle: 'E_LINE_STYLE',\n /** A numeric style value is out of range. */\n StyleRange: 'E_STYLE_RANGE',\n /** `style.theme` names a preset that does not exist. */\n ThemeUnknown: 'E_THEME_UNKNOWN',\n} as const;\n\nexport type JmValidationCode = typeof JmValidationCode[keyof typeof JmValidationCode];\n\n/**\n * One validation problem.\n *\n * @public\n */\nexport interface JmValidationIssue {\n /** Stable machine-readable code. Branch on this. */\n code: JmValidationCode;\n /** Location within the document, e.g. `nodes/jm-c1/style/tone`. */\n path: string;\n /** Human-readable description. Never parse this. */\n message: string;\n}\n\n/**\n * Outcome of a validation pass.\n *\n * @public\n */\nexport interface JmValidationResult {\n /** True when `errors` is empty. */\n valid: boolean;\n /** Every problem found, in document order. */\n errors: JmValidationIssue[];\n}\n\n/** Edge types accepted for `edge.type`. */\nconst EDGE_TYPES: ReadonlySet<string> = new Set(Object.values(JmEdgeType));\n\n/** Numeric side values accepted for a node. */\nconst SIDE_VALUES: ReadonlySet<number> = new Set(Object.values(JmNodeSide));\n\n/** Line patterns accepted for `borderStyle` and `incoming.pattern`. */\nconst LINE_PATTERNS: ReadonlySet<string> = new Set(Object.values(JmLinePattern));\n\n/** Tones accepted for `style.tone`. */\nconst TONES: ReadonlySet<string> = new Set(Object.values(JmTone));\n\n/** Content types accepted for `content.type`. */\nconst CONTENT_TYPES: ReadonlySet<string> = new Set(Object.values(JmNodeContentType));\n\n/**\n * Narrows to a plain object.\n *\n * @param value - Value to test.\n * @returns True for non-null, non-array objects.\n */\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Reads a string field, or null when absent or not a string.\n *\n * @param holder - Object to read from.\n * @param key - Field name.\n * @returns The string, or null.\n */\nfunction str(holder: Record<string, unknown>, key: string): string | null {\n const value = holder[key];\n return typeof value === 'string' ? value : null;\n}\n\n/**\n * Validates v2 data against every rule in the format specification.\n *\n * @remarks\n * Never throws for malformed input: anything structurally wrong becomes an\n * issue with a code. The one thing it cannot represent is a non-object root,\n * which it reports as `E_FORMAT` since nothing can be read from it.\n *\n * @param data - Candidate data, typically parsed JSON.\n * @returns Every issue found; `valid` is true only when the list is empty.\n *\n * @public\n */\nexport function validateMindData(data: unknown): JmValidationResult {\n const errors: JmValidationIssue[] = [];\n\n if (!isRecord(data)) {\n errors.push({\n code: JmValidationCode.Format,\n path: '',\n message: 'Data is not an object.',\n });\n return { valid: false, errors };\n }\n\n // ---- format ----\n if (data.format !== 'jsmind_v2') {\n errors.push({\n code: JmValidationCode.Format,\n path: 'format',\n message: `Expected format \"jsmind_v2\", got ${JSON.stringify(data.format) ?? 'nothing'}.`,\n });\n }\n\n // ---- meta ----\n const meta = data.meta;\n if (!isRecord(meta)) {\n errors.push({\n code: JmValidationCode.Meta,\n path: 'meta',\n message: 'Missing \"meta\" object.',\n });\n } else {\n for (const key of ['name', 'author', 'version'] as const) {\n if (typeof meta[key] !== 'string') {\n errors.push({\n code: JmValidationCode.Meta,\n path: `meta/${key}`,\n message: `\"meta.${key}\" must be a string.`,\n });\n }\n }\n }\n\n // ---- nodes / edges containers ----\n const nodes = data.nodes;\n const edges = data.edges;\n\n // Both container checks run before the early return: a document missing both\n // should learn about both, not just whichever is checked first.\n if (!isRecord(nodes)) {\n errors.push({\n code: JmValidationCode.NodesMissing,\n path: 'nodes',\n message: 'Missing \"nodes\" object.',\n });\n }\n if (!isRecord(edges)) {\n errors.push({\n code: JmValidationCode.EdgesMissing,\n path: 'edges',\n message: 'Missing \"edges\" object.',\n });\n }\n if (!isRecord(nodes)) {\n // Without nodes there is not a single reference in the document that can\n // be resolved, so every later rule would only repeat itself.\n return { valid: false, errors };\n }\n\n const nodeIds = new Set(Object.keys(nodes));\n\n // ---- root ----\n const rootId = str(data, 'root');\n if (!rootId) {\n errors.push({\n code: JmValidationCode.RootMissing,\n path: 'root',\n message: '\"root\" must be a non-empty string.',\n });\n } else if (!nodeIds.has(rootId)) {\n errors.push({\n code: JmValidationCode.RootMissing,\n path: 'root',\n message: `\"root\" points at \"${rootId}\", which is not in \"nodes\".`,\n });\n }\n\n // ---- node keys ----\n for (const [key, node] of Object.entries(nodes)) {\n if (!isRecord(node)) {\n errors.push({\n code: JmValidationCode.NodeKeyMismatch,\n path: `nodes/${key}`,\n message: `Node under key \"${key}\" is not an object.`,\n });\n continue;\n }\n if (node.id !== key) {\n errors.push({\n code: JmValidationCode.NodeKeyMismatch,\n path: `nodes/${key}`,\n message: `Key \"${key}\" does not match the node's own id ${JSON.stringify(node.id)}.`,\n });\n }\n }\n\n // ---- edge keys ----\n if (isRecord(edges)) {\n for (const [key, edge] of Object.entries(edges)) {\n if (!isRecord(edge)) {\n errors.push({\n code: JmValidationCode.EdgeKeyMismatch,\n path: `edges/${key}`,\n message: `Edge under key \"${key}\" is not an object.`,\n });\n continue;\n }\n if (edge.id !== key) {\n errors.push({\n code: JmValidationCode.EdgeKeyMismatch,\n path: `edges/${key}`,\n message: `Key \"${key}\" does not match the edge's own id ${JSON.stringify(edge.id)}.`,\n });\n }\n }\n }\n\n // ---- per-node checks ----\n const parentOf = new Map<string, string | null>();\n\n for (const [key, node] of Object.entries(nodes)) {\n if (!isRecord(node)) {\n continue;\n }\n const at = `nodes/${key}`;\n\n // content\n const content = node.content;\n if (!isRecord(content)) {\n errors.push({\n code: JmValidationCode.ContentType,\n path: `${at}/content`,\n message: 'Missing \"content\" object.',\n });\n } else {\n const type = content.type;\n if (typeof type !== 'string' || !CONTENT_TYPES.has(type)) {\n errors.push({\n code: JmValidationCode.ContentType,\n path: `${at}/content/type`,\n message: `Unknown content type ${JSON.stringify(type)}. Expected one of ${[...CONTENT_TYPES].join(', ')}.`,\n });\n }\n }\n\n // parent reference\n const parent = node.parent;\n if (parent === null) {\n parentOf.set(key, null);\n } else if (typeof parent === 'string') {\n parentOf.set(key, parent);\n if (!nodeIds.has(parent)) {\n errors.push({\n code: JmValidationCode.NodeParentMissing,\n path: `${at}/parent`,\n message: `Parent \"${parent}\" is not in \"nodes\".`,\n });\n }\n } else {\n errors.push({\n code: JmValidationCode.NodeParentMissing,\n path: `${at}/parent`,\n message: '\"parent\" must be a node id or null.',\n });\n // Deliberately NOT recorded as null. A malformed parent is\n // undetermined, not root-like: recording it as null makes the root\n // count below report an extra E_MULTIPLE_ROOTS for the same broken\n // field, which is a false positive on a different code.\n }\n\n // children references\n const children = node.children;\n if (!Array.isArray(children)) {\n errors.push({\n code: JmValidationCode.NodeChildMissing,\n path: `${at}/children`,\n message: '\"children\" must be an array.',\n });\n } else {\n for (const childId of children) {\n if (typeof childId !== 'string' || !nodeIds.has(childId)) {\n errors.push({\n code: JmValidationCode.NodeChildMissing,\n path: `${at}/children`,\n message: `Child ${JSON.stringify(childId)} is not in \"nodes\".`,\n });\n }\n }\n }\n\n // side is a number in the JSON, per the format spec: -1 left, 0 centre,\n // 1 right. No name conversion happens at this layer.\n const side = node.side;\n if (typeof side !== 'number' || !SIDE_VALUES.has(side)) {\n errors.push({\n code: JmValidationCode.Side,\n path: `${at}/side`,\n message: `\"side\" must be -1, 0 or 1, got ${JSON.stringify(side)}.`,\n });\n } else if (side === JmNodeSide.Center && parent !== null) {\n // Centre is not a position, it is the absence of one: it tells the\n // layout to place the node relative to the root, which only the root\n // itself can do. A child carrying it is laid out nowhere and does\n // not paint at all - the data validates, the node silently vanishes\n // from the picture, and nothing downstream says why.\n errors.push({\n code: JmValidationCode.NonRootSideCenter,\n path: `${at}/side`,\n message: 'Only the root may use side 0 (centre); a child must be -1 (left) or 1 (right).',\n });\n }\n\n // per-node style\n validateNodeStyle(node.style, `${at}/style`, errors);\n }\n\n // ---- parent/children agreement ----\n for (const [key, node] of Object.entries(nodes)) {\n if (!isRecord(node) || !Array.isArray(node.children)) {\n continue;\n }\n for (const childId of node.children) {\n if (typeof childId !== 'string') {\n continue;\n }\n const child = nodes[childId];\n if (!isRecord(child)) {\n continue;\n }\n if (child.parent !== key) {\n errors.push({\n code: JmValidationCode.ParentChildMismatch,\n path: `nodes/${childId}/parent`,\n message: `Listed as a child of \"${key}\", but its parent is ${JSON.stringify(child.parent)}.`,\n });\n }\n }\n }\n\n // ---- exactly one root ----\n // Nodes with a malformed parent are absent from parentOf entirely, so a\n // broken field cannot masquerade as a second root.\n const roots = [...parentOf.entries()].filter(([, parent]) => parent === null).map(([id]) => id);\n if (roots.length > 1) {\n errors.push({\n code: JmValidationCode.MultipleRoots,\n path: 'nodes',\n message: `${roots.length} nodes have a null parent: ${roots.join(', ')}. Exactly one is allowed.`,\n });\n }\n if (rootId && parentOf.has(rootId) && parentOf.get(rootId) !== null) {\n errors.push({\n code: JmValidationCode.RootParentSet,\n path: `nodes/${rootId}/parent`,\n message: 'The root node must have a null parent.',\n });\n }\n\n // ---- cycles ----\n // A node whose parent chain runs INTO a cycle but does not belong to one\n // must not be blamed: walking up from D (D -> A -> B -> C -> A) does revisit\n // a node, but it is A, not D. Report the cycle's own members instead.\n const reportedCycles = new Set<string>();\n\n for (const startId of nodeIds) {\n const cycle = findParentCycle(startId, parentOf);\n if (cycle === null) {\n continue;\n }\n\n // Same cycle reached from different entry points yields the same member\n // set; sort it so one cycle is reported exactly once, and pick a stable\n // node to hang the issue on.\n const members = [...cycle].sort();\n const key = members.join(',');\n if (reportedCycles.has(key)) {\n continue;\n }\n reportedCycles.add(key);\n\n errors.push({\n code: JmValidationCode.Cycle,\n path: `nodes/${members[0]}`,\n message: `Following \"parent\" from this node returns to it (cycle: ${members.join(' -> ')} -> ${members[0]}).`,\n });\n }\n\n // ---- edges ----\n if (isRecord(edges)) {\n for (const [key, edge] of Object.entries(edges)) {\n if (!isRecord(edge)) {\n continue;\n }\n const at = `edges/${key}`;\n const edgeType = edge.type;\n if (typeof edgeType !== 'string' || !EDGE_TYPES.has(edgeType)) {\n errors.push({\n code: JmValidationCode.EdgeType,\n path: `${at}/type`,\n message: `Unknown edge type ${JSON.stringify(edgeType)}. Expected one of ${[...EDGE_TYPES].join(', ')}.`,\n });\n }\n\n for (const field of ['sourceNodeId', 'targetNodeId'] as const) {\n const endpoint = edge[field];\n if (typeof endpoint !== 'string' || !nodeIds.has(endpoint)) {\n errors.push({\n code: JmValidationCode.EdgeNodeMissing,\n path: `${at}/${field}`,\n message: `Edge endpoint ${JSON.stringify(endpoint)} is not in \"nodes\".`,\n });\n }\n }\n validateLineStyle(edge.style, `${at}/style`, errors);\n }\n }\n\n // ---- mind map style ----\n validateMindStyle(data.style, errors);\n\n return { valid: errors.length === 0, errors };\n}\n\n/**\n * Walks parent links from a node and returns the members of the cycle it hits.\n *\n * @remarks\n * Returns the cycle itself, not the starting node. Walking up from a node that\n * merely points *into* a cycle passes through that cycle without belonging to\n * it — the caller needs the members to blame the right nodes and to recognise\n * the same cycle reached from different starting points.\n *\n * @param startId - Node to start from.\n * @param parentOf - Parent map built during the walk.\n * @returns Member ids of the cycle, in traversal order; null when the chain\n * ends without looping.\n */\nfunction findParentCycle(\n startId: string,\n parentOf: Map<string, string | null>\n): string[] | null {\n const path: string[] = [];\n const indexOf = new Map<string, number>();\n let cursor: string | null | undefined = startId;\n\n while (cursor !== null && cursor !== undefined) {\n const seenAt = indexOf.get(cursor);\n if (seenAt !== undefined) {\n // Everything from the first sighting onwards is the cycle; what came\n // before it is the tail that led in and is not part of it.\n return path.slice(seenAt);\n }\n indexOf.set(cursor, path.length);\n path.push(cursor);\n cursor = parentOf.get(cursor);\n }\n\n return null;\n}\n\n/**\n * Validates the per-node style block.\n *\n * @param style - Candidate style value.\n * @param at - Path prefix for messages.\n * @param errors - Collector.\n */\nfunction validateNodeStyle(style: unknown, at: string, errors: JmValidationIssue[]): void {\n if (style === undefined) {\n return;\n }\n if (!isRecord(style)) {\n errors.push({\n code: JmValidationCode.StyleRange,\n path: at,\n message: '\"style\" must be an object.',\n });\n return;\n }\n\n const tone = style.tone;\n if (tone !== undefined && (typeof tone !== 'string' || !TONES.has(tone))) {\n errors.push({\n code: JmValidationCode.Tone,\n path: `${at}/tone`,\n message: `Unknown tone ${JSON.stringify(tone)}. Expected one of ${[...TONES].join(', ')}.`,\n });\n }\n\n const borderPattern = style.borderStyle;\n if (borderPattern !== undefined) {\n if (typeof borderPattern !== 'string' || !LINE_PATTERNS.has(borderPattern)) {\n errors.push({\n code: JmValidationCode.LineStyle,\n path: `${at}/borderStyle`,\n message: `Unknown line pattern ${JSON.stringify(borderPattern)}. Expected one of ${[...LINE_PATTERNS].join(', ')}.`,\n });\n }\n }\n\n for (const field of ['borderWidth', 'fontSize'] as const) {\n const value = style[field];\n if (value !== undefined && (typeof value !== 'number' || !(value > 0))) {\n errors.push({\n code: JmValidationCode.StyleRange,\n path: `${at}/${field}`,\n message: `\"${field}\" must be a positive number, got ${JSON.stringify(value)}.`,\n });\n }\n }\n\n if (style.incoming !== undefined) {\n validateLineStyle(style.incoming, `${at}/incoming`, errors);\n }\n}\n\n/**\n * Validates a line style block, shared by node `incoming` and edge `style`.\n *\n * @param style - Candidate line style.\n * @param at - Path prefix for messages.\n * @param errors - Collector.\n */\nfunction validateLineStyle(style: unknown, at: string, errors: JmValidationIssue[]): void {\n if (style === undefined) {\n return;\n }\n if (!isRecord(style)) {\n errors.push({\n code: JmValidationCode.LineStyle,\n path: at,\n message: 'Line style must be an object.',\n });\n return;\n }\n\n if (style.pattern !== undefined) {\n const pattern = style.pattern;\n if (typeof pattern !== 'string' || !LINE_PATTERNS.has(pattern)) {\n errors.push({\n code: JmValidationCode.LineStyle,\n path: `${at}/pattern`,\n message: `Unknown line pattern ${JSON.stringify(pattern)}. Expected one of ${[...LINE_PATTERNS].join(', ')}.`,\n });\n }\n }\n\n const width = style.width;\n if (width !== undefined && (typeof width !== 'number' || !(width > 0))) {\n errors.push({\n code: JmValidationCode.StyleRange,\n path: `${at}/width`,\n message: `\"width\" must be a positive number, got ${JSON.stringify(width)}.`,\n });\n }\n}\n\n/**\n * Validates the mind map level style declaration.\n *\n * @param style - Candidate style declaration.\n * @param errors - Collector.\n */\nfunction validateMindStyle(style: unknown, errors: JmValidationIssue[]): void {\n if (style === undefined) {\n return;\n }\n if (!isRecord(style)) {\n errors.push({\n code: JmValidationCode.StyleRange,\n path: 'style',\n message: '\"style\" must be an object.',\n });\n return;\n }\n\n const themeName = style.theme;\n if (themeName !== undefined) {\n if (typeof themeName !== 'string') {\n errors.push({\n code: JmValidationCode.ThemeUnknown,\n path: 'style/theme',\n message: '\"style.theme\" must be a string.',\n });\n } else if (!(themeName in JSMIND_THEME_PRESETS)) {\n errors.push({\n code: JmValidationCode.ThemeUnknown,\n path: 'style/theme',\n message: `Unknown theme ${JSON.stringify(themeName)}. Known themes: ${Object.keys(JSMIND_THEME_PRESETS).join(', ')}.`,\n });\n }\n }\n\n if (style.tones !== undefined) {\n if (!isRecord(style.tones)) {\n errors.push({\n code: JmValidationCode.StyleRange,\n path: 'style/tones',\n message: '\"style.tones\" must be an object.',\n });\n } else {\n for (const toneName of Object.keys(style.tones)) {\n if (!TONES.has(toneName)) {\n errors.push({\n code: JmValidationCode.Tone,\n path: `style/tones/${toneName}`,\n message: `Unknown tone ${JSON.stringify(toneName)}.`,\n });\n }\n }\n }\n }\n\n for (const section of ['node', 'line', 'expander'] as const) {\n if (style[section] === undefined) {\n continue;\n }\n if (!isRecord(style[section])) {\n errors.push({\n code: JmValidationCode.StyleRange,\n path: `style/${section}`,\n message: `\"style.${section}\" must be an object.`,\n });\n }\n }\n}\n","/**\n * JSON serializer for JsMind mind maps.\n *\n * @packageDocumentation\n */\nimport type { JmMindSerializer } from './serializer.ts';\nimport { JmMind } from '../model/mind.ts';\nimport { JmNode } from '../model/data/node.ts';\nimport { JmNodeContent } from '../model/data/node-content.ts';\nimport { JmEdge, type JmEdgeType } from '../model/data/edge.ts';\nimport { JsMindError } from '../common/error.ts';\nimport type { MindMetadata } from '../common/option.ts';\nimport type { JmNodeSide } from '../model/data/node.ts';\nimport type { JmNodeContentType } from '../model/data/node-content.ts';\nimport type { JmNodeStyle, JmLineStyle, JmStyle } from '../model/data/style.ts';\nimport { validateMindData, type JmValidationIssue, type JmValidationResult } from './validation.ts';\n\n/**\n * Format identifier written to every v2 data file.\n *\n * @public\n */\nexport const JSMIND_FORMAT_V2 = 'jsmind_v2';\n\n/**\n * Serialized node data structure.\n *\n * @public\n */\nexport interface SerializedNode {\n id: string;\n content: {\n type: JmNodeContentType;\n value: unknown;\n };\n parent: string | null;\n children: string[];\n folded: boolean;\n side: JmNodeSide;\n data: Record<string, unknown>;\n /** Visual overrides for the node. Absent when the node uses the theme as-is. */\n style?: JmNodeStyle;\n}\n\n/**\n * Serialized edge data structure.\n *\n * @public\n */\nexport interface SerializedEdge {\n id: string;\n sourceNodeId: string;\n targetNodeId: string;\n type: JmEdgeType;\n label: string | null;\n /** Visual style of the edge line. */\n style?: JmLineStyle;\n}\n\n/**\n * Serialized mind map data structure.\n *\n * @public\n */\nexport interface SerializedMindMap {\n /** Format identifier. Always `jsmind_v2` for data written by this version. */\n format?: string;\n /** Style declaration: which theme to inherit from, plus overrides. */\n style?: JmStyle;\n meta: MindMetadata;\n root: string;\n nodes: Record<string, SerializedNode>;\n edges: Record<string, SerializedEdge>;\n}\n\n/**\n * JSON serializer for mind maps.\n *\n * @public\n */\nexport class JmMindJsonSerializer implements JmMindSerializer {\n /**\n * Gets the format name this serializer supports.\n *\n * @returns The format name.\n */\n getFormatName(): string {\n return 'json';\n }\n\n /**\n * Serializes a mind map to JSON format.\n *\n * @param mind - The mind map to serialize.\n * @returns The serialized JSON data.\n * @throws {@link JsMindError} If the mind map is not provided.\n */\n serialize(mind: JmMind): SerializedMindMap {\n if (!mind) {\n throw new JsMindError('Mind map is required for serialization');\n }\n\n const serializedData: SerializedMindMap = {\n format: JSMIND_FORMAT_V2,\n meta: mind.meta,\n root: mind._root.id,\n nodes: {},\n edges: {}\n };\n\n if (mind.style !== undefined) {\n serializedData.style = mind.style;\n }\n\n // Serialize all nodes\n Object.values(mind._nodes).forEach(node => {\n serializedData.nodes[node.id] = this._serializeNode(node);\n });\n\n // Serialize all additional edges\n Object.values(mind._edges).forEach(edge => {\n serializedData.edges[edge.id] = this._serializeEdge(edge);\n });\n\n return serializedData;\n }\n\n /**\n * Deserializes JSON data to a mind map.\n *\n * @param data - The JSON data to deserialize.\n * @returns The deserialized mind map.\n * @throws {@link JsMindError} If the JSON data format is invalid.\n */\n deserialize(data: SerializedMindMap): JmMind {\n const result = this.check(data);\n if (!result.valid) {\n throw new JsMindError(\n `Invalid JSON data format: ${summarise(result.errors)}`,\n { errors: result.errors },\n result.errors[0].code\n );\n }\n\n // Create mind map with metadata and options\n const mind = new JmMind(data.meta, { rootNodeId: data.root });\n if (data.style !== undefined) {\n mind.style = data.style;\n }\n\n // Restore nodes\n Object.values(data.nodes).forEach((nodeData: SerializedNode) => {\n const node = this._deserializeNode(nodeData);\n mind._nodes[node.id] = node;\n });\n\n // Restore additional edges\n if (data.edges) {\n Object.values(data.edges).forEach((edgeData: SerializedEdge) => {\n const edge = this._deserializeEdge(edgeData);\n mind._edges[edge.id] = edge;\n });\n }\n\n // Restore root\n mind._root = mind._nodes[data.root];\n\n // Restore parent-child relationships\n this._restoreNodeRelationships(mind, data);\n\n return mind;\n }\n\n /**\n * Validates if the data can be deserialized by this serializer.\n *\n * @param data - The data to validate.\n * @returns True if the data is valid for this format.\n */\n validate(data: unknown): data is SerializedMindMap {\n return this.check(data).valid;\n }\n\n /**\n * Validates data and returns every problem found.\n *\n * @remarks\n * Use this instead of `validate` when the caller needs to know *why* data\n * was rejected. Each issue carries a stable `code`, a `path` into the\n * document, and a message written for humans.\n *\n * @param data - The data to validate.\n * @returns Every issue found; `valid` is true only when there are none.\n */\n check(data: unknown): JmValidationResult {\n return validateMindData(data);\n }\n\n /**\n * Serializes a single node.\n *\n * @private\n * @param node - The node to serialize.\n * @returns The serialized node data.\n */\n _serializeNode(node: JmNode): SerializedNode {\n return {\n id: node.id,\n content: {\n type: node.content.type,\n value: node.content.value\n },\n parent: node.parent ? node.parent.id : null,\n children: node.children.map(child => child.id),\n folded: node.folded,\n side: node.side,\n data: { ...node.data },\n ...(node.style ? { style: copyNodeStyle(node.style) } : {})\n };\n }\n\n /**\n * Deserializes a single node.\n *\n * @private\n * @param nodeData - The node data to deserialize.\n * @returns The deserialized node.\n */\n _deserializeNode(nodeData: SerializedNode): JmNode {\n const content = new JmNodeContent(nodeData.content.type, nodeData.content.value);\n const node = new JmNode(nodeData.id, content);\n\n node.folded = nodeData.folded;\n node.side = nodeData.side;\n node.data = { ...nodeData.data };\n if (nodeData.style) {\n node.style = copyNodeStyle(nodeData.style);\n }\n\n return node;\n }\n\n /**\n * Serializes a single edge.\n *\n * @private\n * @param edge - The edge to serialize.\n * @returns The serialized edge data.\n */\n _serializeEdge(edge: JmEdge): SerializedEdge {\n return {\n id: edge.id,\n sourceNodeId: edge.sourceNodeId,\n targetNodeId: edge.targetNodeId,\n type: edge.type,\n label: edge.label,\n ...(edge.style ? { style: copyLineStyle(edge.style) } : {})\n };\n }\n\n /**\n * Deserializes a single edge.\n *\n * @private\n * @param edgeData - The edge data to deserialize.\n * @returns The deserialized edge.\n */\n _deserializeEdge(edgeData: SerializedEdge): JmEdge {\n const edge = new JmEdge(\n edgeData.id,\n edgeData.sourceNodeId,\n edgeData.targetNodeId,\n edgeData.type,\n edgeData.label\n );\n if (edgeData.style) {\n edge.style = copyLineStyle(edgeData.style);\n }\n return edge;\n }\n\n /**\n * Restores parent-child relationships between nodes.\n *\n * @private\n * @param mind - The mind map to restore relationships for.\n * @param data - The serialized data containing parent and children information.\n */\n _restoreNodeRelationships(mind: JmMind, data: SerializedMindMap): void {\n // Restore parent relationships\n Object.values(data.nodes).forEach((nodeData: SerializedNode) => {\n const node = mind._nodes[nodeData.id];\n if (nodeData.parent !== null) {\n const parentNode = mind._nodes[nodeData.parent];\n if (parentNode) {\n node.parent = parentNode;\n }\n } else {\n node.parent = null;\n }\n });\n\n // Restore children relationships\n Object.values(data.nodes).forEach((nodeData: SerializedNode) => {\n const node = mind._nodes[nodeData.id];\n node.children = nodeData.children\n .map((childId: string) => mind._nodes[childId])\n .filter((child: JmNode | undefined) => child !== undefined) as JmNode[];\n });\n }\n}\n\n/**\n * Summarises validation issues into one readable sentence.\n *\n * @remarks\n * The first issue carries the most useful detail; the remaining count tells\n * the reader whether to expect more. Full detail is in `error.data.errors`.\n *\n * @param errors - Issues to summarise.\n * @returns A single human-readable line.\n */\nfunction summarise(errors: JmValidationIssue[]): string {\n const first = errors[0];\n const rest = errors.length - 1;\n const suffix = rest > 0 ? ` (and ${rest} more)` : '';\n return `${first.code} at ${first.path || '<root>'}: ${first.message}${suffix}`;\n}\n\n/**\n * Copies a node style so the serialized snapshot does not share nested objects\n * with the live model.\n *\n * @remarks\n * `incoming` is the only nested field, so a two-level copy covers the whole\n * structure. Sharing it would let a later edit to `node.style.incoming` reach\n * back into data that was already serialized.\n *\n * @param style - The style to copy.\n * @returns A detached copy.\n */\nfunction copyNodeStyle(style: JmNodeStyle): JmNodeStyle {\n return style.incoming\n ? { ...style, incoming: copyLineStyle(style.incoming) }\n : { ...style };\n}\n\n/**\n * Copies a line style.\n *\n * @remarks\n * `JmLineStyle` holds scalars only, so a spread is a full copy. Kept as a\n * named function so node styles and edge styles go through one path — if the\n * shape ever grows a nested field, only this function needs to change.\n *\n * @param style - The line style to copy.\n * @returns A detached copy.\n */\nfunction copyLineStyle(style: JmLineStyle): JmLineStyle {\n return { ...style };\n}\n","import { JsMindError } from '../common/error.ts';\nimport { JmMindFreeMindSerializer } from './freemind.ts';\nimport type { JmMindSerializer } from './serializer.ts';\nimport { JmMindJsonSerializer } from './json.ts';\n\nexport class JmMindSerializerFactory {\n static create(format: string): JmMindSerializer {\n switch (format) {\n case 'json':\n return new JmMindJsonSerializer();\n case 'freemind':\n return new JmMindFreeMindSerializer();\n default:\n throw new JsMindError(`Invalid serializer format: ${format}`);\n }\n }\n}\n","\nimport { JmMind } from '../model/mind.ts';\nimport { JsMindError } from '../common/error.ts';\nimport { mergeJsMindOptions, type JsMindOptions } from '../common/option.ts';\nimport { JmView } from '../view/index.ts';\nimport { MindmapArranger } from '../arranger/mindmap.ts';\nimport { JmMindChangeCoordinator } from './mind-change-coordinator.ts';\nimport { JmNodeSide } from '../model/data/node.ts';\nimport type { JmExportImageOptions, JmExportImageResult } from '../view/export.ts';\n\nimport { JmCommander } from './commander.ts';\nimport { JmMindSerializerFactory } from '../serialization/serializer-factory.ts';\n\n/**\n * Main class for jsMind mind map operations.\n *\n * @public\n */\nclass JsMind {\n /**\n * Gets the version of jsMind.\n *\n * @returns The version string.\n */\n static get Version(): string { return '2.0'; }\n\n /**\n * Gets the author of jsMind.\n *\n * @returns The author string.\n */\n static get Author(): string { return 'hizzgdev@163.com'; }\n\n /**\n * Exported classes for browser use.\n */\n static Mind = JmMind;\n\n static Serializer = JmMindSerializerFactory;\n\n static NodeSide = JmNodeSide;\n\n /** The options for this jsMind instance. */\n options: JsMindOptions;\n\n /** The currently opened mind map, or null if none is open. */\n mind: JmMind | null = null;\n\n /** The state coordinator instance for managing the state of the mind map. */\n private readonly coordinator: JmMindChangeCoordinator;\n\n /** Issues display-affecting commands. */\n private readonly commander: JmCommander;\n\n /**\n * Creates a new jsMind instance.\n *\n * @param options - Configuration options for the jsMind instance.\n */\n private constructor(\n options: JsMindOptions,\n mindChangeCoordinator: JmMindChangeCoordinator,\n commander: JmCommander\n ) {\n this.options = options;\n this.coordinator = mindChangeCoordinator;\n this.commander = commander;\n }\n\n static async create(container: string | HTMLElement, options?: JsMindOptions): Promise<JsMind> {\n const mergedOptions = mergeJsMindOptions(options);\n const arranger = new MindmapArranger(mergedOptions.layout);\n const view = await JmView.create(container, arranger, mergedOptions.view);\n const mindChangeCoordinator = new JmMindChangeCoordinator(arranger, view);\n const commander = new JmCommander(view);\n return new JsMind(mergedOptions, mindChangeCoordinator, commander);\n }\n\n /**\n * Opens a mind map.\n *\n * @param mind - The mind map instance to open.\n * @returns The opened mind map instance.\n */\n async open(mind: JmMind): Promise<void> {\n this.mind = mind;\n await this.coordinator.onMindMapOpened(mind);\n mind.observerManager.addObserver(this.coordinator);\n }\n\n\n /**\n * Closes the current mind map (cleanup method).\n *\n * @remarks\n * This method can be extended in the future for cleanup operations\n * like removing observers, clearing caches, etc.\n */\n close(): void {\n if(this.mind) {\n this.coordinator.onMindMapClosed(this.mind!);\n this.mind = null;\n }\n }\n\n /**\n * Serializes the current mind map to JSON.\n *\n * @returns JSON string representation of the mind map.\n * @throws {@link Error} If no mind map is open or serialization fails.\n */\n serialize(): string {\n if (!this.mind) {\n throw new Error('No mind map is currently open');\n }\n\n const serializer = JmMindSerializerFactory.create('json');\n const data = serializer.serialize(this.mind);\n return JSON.stringify(data);\n }\n\n /**\n * Renders the open mind map to an image.\n *\n * The size is the rendered content's own size: whitespace inside the\n * container is part of the picture, and a map larger than its container is\n * not cropped.\n *\n * @param options - Scale, format and quality. Defaults to PNG at 2x.\n * @returns The encoded image, as a Blob, plus its pixel dimensions.\n * @throws {@link JsMindError} If no mind map is open, or if the browser\n * cannot encode the result.\n */\n async exportImage(options?: JmExportImageOptions): Promise<JmExportImageResult> {\n if (!this.mind) {\n throw new JsMindError('No mind map is currently open');\n }\n return await this.commander.exportImage(options);\n }\n}\n\nexport default JsMind;\n\n// Example pages and the CLI image export look the library up as a global.\n// Package consumers use the default export from the ESM bundle, or the CJS\n// entry at `dist/jsmind.cjs`. A classic script tag loads `dist/jsmind.umd.js`,\n// which assigns this same global without an `export`.\n(globalThis as { jsMind?: typeof JsMind }).jsMind = JsMind;\n"],"names":[],"mappings":";;;;;;;;;;;;;IAAA;;;;IAIG;IACG,MAAO,WAAY,SAAQ,KAAK,CAAA;;IAElC,IAAA,IAAI;IAEJ;;;;;;IAMG;IACH,IAAA,IAAI;IAEJ;;;;;;IAMG;IACH,IAAA,WAAA,CAAY,OAAe,EAAE,IAAA,GAAgC,EAAE,EAAE,IAAa,EAAA;YAC1E,KAAK,CAAC,OAAO,CAAC;IACd,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;IAChB,QAAA,IAAI,IAAI,KAAK,SAAS,EAAE;IACpB,YAAA,IAAI,CAAC,IAAI,GAAG,IAAI;YACpB;QACJ;IACH;;IC7BD;;;;IAIG;UACU,iBAAiB,CAAA;;IAE1B,IAAA,cAAc;;I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