@graph-knowledge/api 0.1.3 → 0.1.4

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 (2) hide show
  1. package/README.md +12 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -194,6 +194,17 @@ await api.elements.create(documentId, nodeId, {
194
194
  textAlign: "center"
195
195
  });
196
196
 
197
+ // Create multi-line text (use \n for line breaks)
198
+ await api.elements.create(documentId, nodeId, {
199
+ type: "text",
200
+ x: 100,
201
+ y: 200,
202
+ text: "Line 1\nLine 2\nLine 3",
203
+ fontSize: 18,
204
+ lineHeight: 1.4 // Optional: adjust line spacing (default: 1.2)
205
+ });
206
+ // Note: height is auto-calculated based on the number of lines and lineHeight
207
+
197
208
  // Create a connector
198
209
  await api.elements.create(documentId, nodeId, {
199
210
  type: "connector",
@@ -263,7 +274,7 @@ await api.batch.deleteElements(documentId, nodeId, [
263
274
  | Type | Description |
264
275
  |------|-------------|
265
276
  | `rectangle` | Rectangle shape with fill, stroke, corner radius |
266
- | `text` | Text element with font customization |
277
+ | `text` | Text element with font customization (supports multi-line with `\n`) |
267
278
  | `connector` | Line connecting two elements |
268
279
  | `uml-class` | UML class diagram element |
269
280
  | `uml-interface` | UML interface element |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graph-knowledge/api",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Headless Document API for Graph Knowledge - programmatic access to documents, nodes, and elements",
5
5
  "license": "MIT",
6
6
  "author": "Graph Knowledge Team",