@creator-notes/cnotes 0.107.1 → 0.107.3
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
|
@@ -117,6 +117,27 @@ function warnLayoutListMisuse(node) {
|
|
|
117
117
|
* below a growing frame that shifted down with it (or didn't, and why).
|
|
118
118
|
* Straddlers the grown frame ran over go to stderr like every layout warning.
|
|
119
119
|
*/
|
|
120
|
+
/** Canvas role tints a quote card takes by meaning (components/canvas/constants/preset-colors.ts). */
|
|
121
|
+
const QUOTE_ROLE_HEX = {
|
|
122
|
+
evidence: "#3B82F6",
|
|
123
|
+
commitment: "#22C55E",
|
|
124
|
+
insight: "#EC4899",
|
|
125
|
+
warning: "#F59E0B",
|
|
126
|
+
danger: "#EF4444",
|
|
127
|
+
people: "#8B5CF6",
|
|
128
|
+
};
|
|
129
|
+
const QUOTE_ROLE_NAMES = Object.keys(QUOTE_ROLE_HEX);
|
|
130
|
+
/** A role name, "none", or a hex, as the colorHex the API takes ("" clears the tint). */
|
|
131
|
+
function quoteColorHex(value) {
|
|
132
|
+
const v = value.trim().toLowerCase();
|
|
133
|
+
if (v === "none" || v === "")
|
|
134
|
+
return "";
|
|
135
|
+
if (QUOTE_ROLE_HEX[v])
|
|
136
|
+
return QUOTE_ROLE_HEX[v];
|
|
137
|
+
if (/^#([0-9a-f]{3}|[0-9a-f]{6})$/.test(v))
|
|
138
|
+
return v;
|
|
139
|
+
throw new ValidationError(`--color takes ${QUOTE_ROLE_NAMES.join(", ")}, none, or a hex like #3B82F6.`);
|
|
140
|
+
}
|
|
120
141
|
/**
|
|
121
142
|
* add-node / move-node take raw x/y with no packing. Say so on every use, and
|
|
122
143
|
* pass on the server's overlap lint when the box lands on something (a card
|
|
@@ -1481,6 +1502,8 @@ Examples:
|
|
|
1481
1502
|
.requiredOption("--note <ref>", "The note to quote (display id like TRANSCRIPT-4, or id)")
|
|
1482
1503
|
.requiredOption("--text <words>", "The exact words to quote; they must appear in the note's saved version")
|
|
1483
1504
|
.addOption(new Option("--style <style>", "How the card shows the words").choices(["pull", "highlight", "evidence"]))
|
|
1505
|
+
.addOption(new Option("--size <size>", "Card size: one large hero line per board, medium for support, small beside its source").choices(["small", "medium", "large"]))
|
|
1506
|
+
.option("--color <role>", `Tint by meaning: ${QUOTE_ROLE_NAMES.join(", ")}, or a hex (default: none)`)
|
|
1484
1507
|
.option("--title <words>", "Your own words for the Quote note's title: why the line matters (default: the quoted words)")
|
|
1485
1508
|
.option("--x <n>", "Raw X position (default: beside the note's card, clear of other cards, else below everything)")
|
|
1486
1509
|
.option("--y <n>", "Raw Y position")
|
|
@@ -1494,6 +1517,7 @@ Insight that cites the Quote note.
|
|
|
1494
1517
|
Examples:
|
|
1495
1518
|
$ cnotes canvas add-quote CANVAS-12 --note TRANSCRIPT-4 --text "We lose them at the invite step"
|
|
1496
1519
|
$ cnotes canvas add-quote CANVAS-12 --note TRANSCRIPT-4 --text "every time" --style highlight --title "Invites stall every time"
|
|
1520
|
+
$ cnotes canvas add-quote CANVAS-12 --note DECISION-3 --text "We bet on the loop" --size large --color insight
|
|
1497
1521
|
`)
|
|
1498
1522
|
.action(async (canvasId, opts) => {
|
|
1499
1523
|
const cfg = resolveConfig(program.opts());
|
|
@@ -1505,6 +1529,8 @@ Examples:
|
|
|
1505
1529
|
note: opts.note,
|
|
1506
1530
|
text: opts.text,
|
|
1507
1531
|
...(opts.style ? { style: opts.style } : {}),
|
|
1532
|
+
...(opts.size ? { size: opts.size } : {}),
|
|
1533
|
+
...(opts.color !== undefined ? { colorHex: quoteColorHex(opts.color) } : {}),
|
|
1508
1534
|
...(opts.title ? { title: opts.title } : {}),
|
|
1509
1535
|
...(position ? { positionX: position.x, positionY: position.y } : {}),
|
|
1510
1536
|
});
|
|
@@ -1522,6 +1548,44 @@ Examples:
|
|
|
1522
1548
|
handleError(error, cfg.json);
|
|
1523
1549
|
}
|
|
1524
1550
|
});
|
|
1551
|
+
canvas
|
|
1552
|
+
.command("style-quote")
|
|
1553
|
+
.description("Restyle a Quote note's card on a canvas: style, size and tint by meaning")
|
|
1554
|
+
.argument("<canvasId>", "Canvas ID (CANVAS-<n> or id)")
|
|
1555
|
+
.requiredOption("--quote <ref>", "The Quote note on this canvas (QUOTE-<n>)")
|
|
1556
|
+
.addOption(new Option("--style <style>", "pull (a display line), highlight (the words in their sentence), evidence (an excerpt under its source)").choices(["pull", "highlight", "evidence"]))
|
|
1557
|
+
.addOption(new Option("--size <size>", "small, medium or large: the same card scaled").choices(["small", "medium", "large"]))
|
|
1558
|
+
.option("--color <role>", `Tint by meaning: ${QUOTE_ROLE_NAMES.join(", ")}, none, or a hex`)
|
|
1559
|
+
.addHelpText("after", `
|
|
1560
|
+
Examples:
|
|
1561
|
+
$ cnotes canvas style-quote CANVAS-12 --quote QUOTE-7 --size large --color insight
|
|
1562
|
+
$ cnotes canvas style-quote CANVAS-12 --quote QUOTE-8 --style evidence --color none
|
|
1563
|
+
`)
|
|
1564
|
+
.action(async (canvasId, opts) => {
|
|
1565
|
+
const cfg = resolveConfig(program.opts());
|
|
1566
|
+
const api = new ApiClient(cfg.serverUrl, cfg.token, cfg.workspaceId);
|
|
1567
|
+
try {
|
|
1568
|
+
if (!opts.style && !opts.size && opts.color === undefined) {
|
|
1569
|
+
throw new ValidationError("Pass --style, --size or --color.");
|
|
1570
|
+
}
|
|
1571
|
+
const data = await api.post(canvasActionPath(canvasId, cfg.workspaceId), {
|
|
1572
|
+
action: "styleQuote",
|
|
1573
|
+
quote: opts.quote,
|
|
1574
|
+
...(opts.style ? { style: opts.style } : {}),
|
|
1575
|
+
...(opts.size ? { size: opts.size } : {}),
|
|
1576
|
+
...(opts.color !== undefined ? { colorHex: quoteColorHex(opts.color) } : {}),
|
|
1577
|
+
});
|
|
1578
|
+
if (cfg.quiet)
|
|
1579
|
+
outputQuiet(String(opts.quote));
|
|
1580
|
+
else if (cfg.json)
|
|
1581
|
+
outputJson(data);
|
|
1582
|
+
else
|
|
1583
|
+
console.log(data.changed ? `Restyled ${opts.quote} on ${canvasId}` : `${opts.quote} already looks like that`);
|
|
1584
|
+
}
|
|
1585
|
+
catch (error) {
|
|
1586
|
+
handleError(error, cfg.json);
|
|
1587
|
+
}
|
|
1588
|
+
});
|
|
1525
1589
|
canvas
|
|
1526
1590
|
.command("bulk-add")
|
|
1527
1591
|
.description("Add multiple notes to a canvas in one operation with positions")
|
|
@@ -2398,8 +2462,7 @@ Examples:
|
|
|
2398
2462
|
.requiredOption("--x <n>", "X position")
|
|
2399
2463
|
.requiredOption("--y <n>", "Y position")
|
|
2400
2464
|
// `text` is a LEGACY kind (the old "Heading" node) — movable/deletable, not creatable.
|
|
2401
|
-
|
|
2402
|
-
.addOption(new Option("--type <type>", "Node type (defaults to note; `text` is legacy — old heading nodes, no longer creatable; `quote` is a quote card)").choices(["note", "text", "list", "canvas", "richtext", "section", "quote"]))
|
|
2465
|
+
.addOption(new Option("--type <type>", "Node type (defaults to note; `text` is legacy — old heading nodes, no longer creatable)").choices(["note", "text", "list", "canvas", "richtext", "section"]))
|
|
2403
2466
|
.action(async (canvasId, opts) => {
|
|
2404
2467
|
const cfg = resolveConfig(program.opts());
|
|
2405
2468
|
const api = new ApiClient(cfg.serverUrl, cfg.token, cfg.workspaceId);
|
package/package.json
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Read this before building or changing a canvas. It decides which element holds what, the hard rules, the orientation banner and the three completion tests.
|
|
4
4
|
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- [Decision table](#decision-table)
|
|
8
|
+
- [Hard rules (each one has burned a real canvas)](#hard-rules-each-one-has-burned-a-real-canvas), including colour roles (rule 6), the banner (rule 7) and quotes (rule 8)
|
|
9
|
+
- [Three completion tests](#three-completion-tests)
|
|
10
|
+
- [Worked example](#worked-example)
|
|
11
|
+
- [Current platform limitations](#current-platform-limitations-re-check-before-relying-on-these)
|
|
12
|
+
|
|
5
13
|
The vocabulary is five elements:
|
|
6
14
|
|
|
7
15
|
| Element | What it is | CLI |
|
|
@@ -71,6 +79,13 @@ A canvas holds two tiers of content, and the difference is load-bearing:
|
|
|
71
79
|
Cut: frame counts ("in five moments"), method notes ("fat-marker sketches", "coral marks…"), and recaps of what the strip below says.
|
|
72
80
|
Wayfind and Attention canvases add their own lines after these four, never instead.
|
|
73
81
|
|
|
82
|
+
8. **Quotes carry a board's best lines.** A board of same-shaped cards hides its point. After the notes are placed, find the 2–4 sentences the board rests on (a customer's own words, the reason inside a Decision, the number that changes the story) and `add-quote` each from its source note. Each lands beside its source as a Quote note (QUOTE-<n>) that other boards can reuse.
|
|
83
|
+
- **Size is hierarchy.** One `large` quote per board: the line everything rests on. `medium` for one to three supporting lines. `small` for evidence beside the card it backs. Never two larges.
|
|
84
|
+
- **Style follows the job.** `pull` for a line that stands alone. `highlight` when the words need their sentence around them. `evidence` for data or an excerpt backing a claim next to it.
|
|
85
|
+
- **Colour follows rule 6, by meaning.** `insight` for the hero line, `evidence` for customer words and data, `warning` for the caveat that could sink the plan, `people` for a stakeholder speaking. Most quotes stay untinted; tint two at most.
|
|
86
|
+
- **Every quote is cited by a claim on the board.** A wall of lines nobody interpreted is a pile, not an argument. About one quote per five notes is plenty.
|
|
87
|
+
- **Words from outside the workspace** (a call, a Slack thread, an AI reply) become a Quote note directly: `notes create` with type `Quote`, the words in a blockquote, then a `from <who>, <where>, <date>` line. Place it like any note and style it with `style-quote`.
|
|
88
|
+
|
|
74
89
|
## Three completion tests
|
|
75
90
|
|
|
76
91
|
Run all three before ending your operation:
|
|
@@ -135,7 +135,11 @@ cnotes canvas add-link <canvasId> --target <otherCanvasId> [--section SECTION-<n
|
|
|
135
135
|
# below everything; --x/--y override. --title is your own words for why the line
|
|
136
136
|
# matters (default: the quoted words). The words must appear in the saved version
|
|
137
137
|
# (exit 3 otherwise). Say what a quote means in an Insight that cites QUOTE-<n>.
|
|
138
|
-
|
|
138
|
+
# --size small|medium|large and --color <role> (evidence, commitment, insight, warning,
|
|
139
|
+
# danger, people) set hierarchy and meaning; canvas-elements.md rule 8 says when.
|
|
140
|
+
cnotes canvas add-quote <canvasId> --note <TRANSCRIPT-4> --text "<exact words>" [--style pull|highlight|evidence] [--size small|medium|large] [--color <role>] [--title "<why it matters>"]
|
|
141
|
+
# Restyle a Quote note's card already on the board (its box resizes with it).
|
|
142
|
+
cnotes canvas style-quote <canvasId> --quote QUOTE-<n> [--style ...] [--size ...] [--color <role>|none]
|
|
139
143
|
# section = a NAMED REGION frame (Miro-style). Renders behind content; dragging the frame
|
|
140
144
|
# carries whatever sits inside it. Mints SECTION-<n>: mention [[SECTION-<n>]] from a note
|
|
141
145
|
# body to deep-link readers to that region. Name like a place ("Shaping", "Open Questions").
|