@creator-notes/cnotes 0.140.0 → 0.141.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.
package/dist/commands/canvas.js
CHANGED
|
@@ -1437,7 +1437,7 @@ and only warns.
|
|
|
1437
1437
|
defineAddTextCommand("add-richtext", "[DEPRECATED — use `add-text`] Alias of `add-text`: adds the same Text element (richtext) with the same flags. Kept for existing scripts; prefer `add-text`.");
|
|
1438
1438
|
canvas
|
|
1439
1439
|
.command("add-section")
|
|
1440
|
-
.description("Add a section frame — a named background region (Miro-style). Whatever sits inside moves with the frame when dragged; notes inside stay individually draggable. Mints a SECTION-<n> id: mention it from notes as [[SECTION-<n>]] to deep-link readers to that region, so name frames like places (\"Shaping\", \"Open Questions\"), not sentences. With --notes the frame is created WITH those notes laid out inside it (collision-aware, no coordinate math — the preferred way to build a populated section), and it stays ARRANGED: adding, editing
|
|
1440
|
+
.description("Add a section frame — a named background region (Miro-style). Whatever sits inside moves with the frame when dragged; notes inside stay individually draggable. Mints a SECTION-<n> id: mention it from notes as [[SECTION-<n>]] to deep-link readers to that region, so name frames like places (\"Shaping\", \"Open Questions\"), not sentences. With --notes the frame is created WITH those notes laid out inside it (collision-aware, no coordinate math — the preferred way to build a populated section), and it stays ARRANGED: adding, editing or removing its cards re-lays it out, until someone moves a card by hand.")
|
|
1441
1441
|
.argument("<canvasId>", "Canvas ID")
|
|
1442
1442
|
.requiredOption("--name <name>", "Frame title (shown on the floating chip; title case)")
|
|
1443
1443
|
.option("--notes <ids>", "Note IDs (comma-separated, display IDs like TASK-6 or Convex IDs) to lay out INSIDE the frame; the frame sizes itself around them")
|
|
@@ -1921,8 +1921,8 @@ nothing.
|
|
|
1921
1921
|
|
|
1922
1922
|
Sections: a section container in the spec ({"kind":"section","name":…,"child":…})
|
|
1923
1923
|
creates an ARRANGED section (every new section is). It keeps its cards laid out
|
|
1924
|
-
as they are added, edited
|
|
1925
|
-
|
|
1924
|
+
as they are added, edited or removed, until someone moves a card by hand. Put
|
|
1925
|
+
more cards in it later with
|
|
1926
1926
|
--into SECTION-<n>; never by picking coordinates inside the frame.
|
|
1927
1927
|
|
|
1928
1928
|
Placement (relative to nodes already on the canvas):
|
|
@@ -1987,8 +1987,8 @@ Placement (relative to nodes already on the canvas):
|
|
|
1987
1987
|
.description("Reflow EXISTING canvas nodes with the layout solver (no coordinate math). " +
|
|
1988
1988
|
"`arrange --section SECTION-<n>` on its own tidies everything already inside that frame " +
|
|
1989
1989
|
"(keeping the columns and rows it is roughly in), sizes the frame to fit, and leaves the " +
|
|
1990
|
-
"section ARRANGED: it re-lays itself out as cards are added, edited
|
|
1991
|
-
"
|
|
1990
|
+
"section ARRANGED: it re-lays itself out as cards are added, edited or removed, until someone " +
|
|
1991
|
+
"moves a card by hand. With --nodes or --spec, packs exactly those nodes (mixed kinds welcome) " +
|
|
1992
1992
|
"into the frame, which then stays arranged the same way.")
|
|
1993
1993
|
.argument("<canvasId>", "Canvas ID")
|
|
1994
1994
|
.option("--section <id>", "Target SECTION-<n> (or raw id) to pack into; auto-resizes the frame around the new layout")
|
|
@@ -2055,7 +2055,7 @@ Examples:
|
|
|
2055
2055
|
console.log(`Arranged ${data.cardCount} card${data.cardCount === 1 ? "" : "s"} in ${data.displayId ?? opts.section}: ` +
|
|
2056
2056
|
`${data.movedCount} moved, frame ${data.width} × ${data.height}px` +
|
|
2057
2057
|
(data.rippledCount ? `, ${data.rippledCount} item${data.rippledCount === 1 ? "" : "s"} below pushed down` : "") +
|
|
2058
|
-
". It keeps itself laid out until
|
|
2058
|
+
". It keeps itself laid out until a card is moved by hand.");
|
|
2059
2059
|
}
|
|
2060
2060
|
return;
|
|
2061
2061
|
}
|
package/dist/lib/mcp-spec.js
CHANGED
|
@@ -256,7 +256,7 @@ export function buildMcpSpec(z, opts) {
|
|
|
256
256
|
"Edges resolve endpoints in priority order: '@<key>' of an item placed in this call, the noteId of a note placed in this call, or the displayId / id of a node already on the canvas.\n\n" +
|
|
257
257
|
"NEW NOTES IN THE SAME CALL: pass `notes` (the cnotes_notes_create item shape, rubric rules included) and place each with a note leaf whose noteId is '@<key>'. Bodies cross-link with [@<key>: Title](relationship:<verb>); edges and anchors say '@<key>'. One call replaces notes_create then place. The notes are created only if the layout solves, and come back under `notes`.\n\n" +
|
|
258
258
|
"placement: 'auto' (default, drops into a clear band below existing nodes and slides down to de-collide), 'append' (always below everything), 'exact' (honor origin verbatim).\n\n" +
|
|
259
|
-
"SECTIONS ARRANGE THEMSELVES. Every new section is ARRANGED: it keeps its cards laid out as cards are added, edited
|
|
259
|
+
"SECTIONS ARRANGE THEMSELVES. Every new section is ARRANGED: it keeps its cards laid out as cards are added, edited or removed, until someone moves a card by hand. To add cards to an existing section, pass `intoSection: 'SECTION-<n>'` with a doc of just those items: they are appended to its layout and the frame resizes to fit. Never aim `origin` inside a frame.\n\n" +
|
|
260
260
|
"The schema is strict server-side: a typo'd key anywhere in the doc is rejected with the offending path named. If a large layout is refused as a whole, place it in two or three smaller calls — each is independent.",
|
|
261
261
|
shape: {
|
|
262
262
|
intent,
|
|
@@ -308,7 +308,7 @@ export function buildMcpSpec(z, opts) {
|
|
|
308
308
|
"MOVING CARRIES THE CONTENTS. Pass BOTH x and y and the frame travels with everything sitting inside it, exactly as dragging it in the app does — so 'put this section where that one is' is one call. Frame membership is geometric (a card belongs to whichever frame its centre is in), and the response's `movedNodeCount` tells you how many travelled.\n\n" +
|
|
309
309
|
"A MOVE IS ITS OWN CALL: send x/y alone, never alongside name, width/height or colorHex, and never one axis without the other. To shift a frame along one axis, read the other axis off cnotes_canvas_get and pass it unchanged. Resizing and renaming keep the frame's contents where they are; only a move takes them along. GROWING TALLER RIPPLES: the band below the frame's old bottom edge shifts down by the growth delta so the layout beneath survives (see `ripple` to opt out).\n\n" +
|
|
310
310
|
`To reorder a canvas — 'the last section should replace section 7' — move the new frame onto the old one's position (read it off cnotes_canvas_get) and then remove the old frame with ${names.removeNodes}.\n\n` +
|
|
311
|
-
"ARRANGE: `arrange: true` (on its own) tidies everything inside the frame, keeping the rows and columns the cards are roughly in, sizes the frame to fit, and leaves the section ARRANGED: it re-lays itself out as its cards are added, edited
|
|
311
|
+
"ARRANGE: `arrange: true` (on its own) tidies everything inside the frame, keeping the rows and columns the cards are roughly in, sizes the frame to fit, and leaves the section ARRANGED: it re-lays itself out as its cards are added, edited or removed, until someone moves a card by hand. Use it whenever a section's contents overlap or spill out of the frame. `arrange: false` stops arranging; nothing moves.",
|
|
312
312
|
shape: {
|
|
313
313
|
intent,
|
|
314
314
|
canvasId: canvasRef,
|
package/package.json
CHANGED
|
@@ -136,11 +136,8 @@ frame drawn around another frame starts freeform. An arranged section:
|
|
|
136
136
|
in, and sizes the frame to fit (what sits below is pushed down if it grows);
|
|
137
137
|
- re-lays itself out when one of its cards is added, edited or removed: a text
|
|
138
138
|
card that grows pushes the cards under it down, a deleted card's gap closes;
|
|
139
|
-
- stays arranged
|
|
140
|
-
|
|
141
|
-
it leaves the section and its gap closes, a card moved in joins it there, and
|
|
142
|
-
moving every card at once re-reads the layout from where they landed;
|
|
143
|
-
- becomes freeform only when someone RESIZES THE FRAME by hand. Nothing moves.
|
|
139
|
+
- stays arranged until someone MOVES A CARD BY HAND (drag, `move-node`,
|
|
140
|
+
`bulk-move`) or resizes the frame. Then it is freeform again and nothing moves.
|
|
144
141
|
`arrange --section SECTION-<n> --stop` does the same on purpose.
|
|
145
142
|
|
|
146
143
|
Put new cards into a section with the section, never with coordinates inside
|