@miadi/stateloom-canvas 0.1.6 → 0.1.8

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.
@@ -4,15 +4,19 @@
4
4
  * - `<MarkComposer>`: what was pointed at, and a box to say something about
5
5
  * it — typed, or spoken when the host hands it something that listens.
6
6
  * - `<MarkThread>`: one mark and its replies; reply, resolve, reopen, remove.
7
- * - `<MarksPanel>`: every mark on the drawing, waiting ones first, and the
8
- * button that copies them as a review for an agent.
7
+ * - `<MarksPanel>`: every mark on the drawing, the ones with an agent's word
8
+ * not yet read first (marked "new"), and the button that copies them as a
9
+ * review for an agent.
10
+ * - `<MarkNotice>`: one line near the board's controls when an agent answers
11
+ * ("Mia answered mark 3"); a tap opens that thread. It takes no focus.
9
12
  *
10
13
  * Props in, callbacks out, as the canvases: the host writes the sidecar and
11
- * tells the hub. The listener is any object shaped like
14
+ * tells the hub. A host that knows who will answer says so in `note`: one quiet
15
+ * line under the card ("Mia is listening in episode 412: she answers here"). The listener is any object shaped like
12
16
  * `@miadi/stateloom-react`'s `browserDictation()`, so this package needs no
13
17
  * socket and no speech code of its own.
14
18
  */
15
- import { type CSSProperties } from "react";
19
+ import { type CSSProperties, type ReactNode } from "react";
16
20
  import { type Box, type Mark, type MarkKind } from "@miadi/stateloom-protocol";
17
21
  import { type CanvasTheme } from "./theme.js";
18
22
  /** Something that turns speech into words (`browserDictation()`). */
@@ -39,11 +43,13 @@ export interface MarkComposerProps {
39
43
  busy?: boolean;
40
44
  error?: string | null;
41
45
  placeholder?: string;
46
+ /** Who will answer the mark, from the host: one quiet line under the card. */
47
+ note?: ReactNode;
42
48
  theme?: Partial<CanvasTheme>;
43
49
  className?: string;
44
50
  style?: CSSProperties;
45
51
  }
46
- export declare function MarkComposer({ elements, region, author, onAuthorChange, onSubmit, onCancel, listener, listenAtOnce, busy, error, placeholder, theme, className, style, }: MarkComposerProps): import("react").JSX.Element;
52
+ export declare function MarkComposer({ elements, region, author, onAuthorChange, onSubmit, onCancel, listener, listenAtOnce, busy, error, placeholder, note, theme, className, style, }: MarkComposerProps): import("react").JSX.Element;
47
53
  export interface MarkThreadProps {
48
54
  mark: Mark;
49
55
  /** Its number on the board. */
@@ -56,11 +62,16 @@ export interface MarkThreadProps {
56
62
  listener?: ListenerLike | null;
57
63
  busy?: boolean;
58
64
  error?: string | null;
65
+ /**
66
+ * Who will answer, from the host. Shown under the thread only while it waits on an
67
+ * agent: the last word is a person's and the mark is not resolved.
68
+ */
69
+ note?: ReactNode;
59
70
  theme?: Partial<CanvasTheme>;
60
71
  className?: string;
61
72
  style?: CSSProperties;
62
73
  }
63
- export declare function MarkThread({ mark, number, onReply, onResolve, onReopen, onRemove, onClose, listener, busy, error, theme, className, style, }: MarkThreadProps): import("react").JSX.Element;
74
+ export declare function MarkThread({ mark, number, onReply, onResolve, onReopen, onRemove, onClose, listener, busy, error, note, theme, className, style, }: MarkThreadProps): import("react").JSX.Element;
64
75
  export interface MarksPanelProps {
65
76
  marks: readonly Mark[];
66
77
  selected?: string | null;
@@ -69,8 +80,31 @@ export interface MarksPanelProps {
69
80
  onCopy?: () => void;
70
81
  copied?: boolean;
71
82
  onClose?: () => void;
83
+ /** Who will answer the marks, from the host: one quiet line under the list. */
84
+ note?: ReactNode;
85
+ /**
86
+ * Marks with an agent's word not yet opened (their ids): listed first and
87
+ * marked "new". `unreadMarks(marks, read)` from the protocol.
88
+ */
89
+ unread?: readonly string[];
72
90
  theme?: Partial<CanvasTheme>;
73
91
  className?: string;
74
92
  style?: CSSProperties;
75
93
  }
76
- export declare function MarksPanel({ marks, selected, onSelect, onCopy, copied, onClose, theme, className, style }: MarksPanelProps): import("react").JSX.Element;
94
+ export declare function MarksPanel({ marks, selected, onSelect, onCopy, copied, onClose, note, unread, theme, className, style }: MarksPanelProps): import("react").JSX.Element;
95
+ export interface MarkNoticeProps {
96
+ /** The line: `agentWordText(agentWordIn(envelope))`, e.g. "Mia answered mark 3". */
97
+ children: ReactNode;
98
+ /** Open the thread it speaks of. */
99
+ onOpen: () => void;
100
+ onDismiss?: () => void;
101
+ theme?: Partial<CanvasTheme>;
102
+ className?: string;
103
+ style?: CSSProperties;
104
+ }
105
+ /**
106
+ * One line that says an agent answered, near the board's controls. A polite
107
+ * live region: read out, never focused, never a card over the board. The host
108
+ * decides how long it stays (a few seconds) and what a tap opens.
109
+ */
110
+ export declare function MarkNotice({ children, onOpen, onDismiss, theme, className, style }: MarkNoticeProps): import("react").JSX.Element;
package/dist/MarkCards.js CHANGED
@@ -5,16 +5,20 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
5
5
  * - `<MarkComposer>`: what was pointed at, and a box to say something about
6
6
  * it — typed, or spoken when the host hands it something that listens.
7
7
  * - `<MarkThread>`: one mark and its replies; reply, resolve, reopen, remove.
8
- * - `<MarksPanel>`: every mark on the drawing, waiting ones first, and the
9
- * button that copies them as a review for an agent.
8
+ * - `<MarksPanel>`: every mark on the drawing, the ones with an agent's word
9
+ * not yet read first (marked "new"), and the button that copies them as a
10
+ * review for an agent.
11
+ * - `<MarkNotice>`: one line near the board's controls when an agent answers
12
+ * ("Mia answered mark 3"); a tap opens that thread. It takes no focus.
10
13
  *
11
14
  * Props in, callbacks out, as the canvases: the host writes the sidecar and
12
- * tells the hub. The listener is any object shaped like
15
+ * tells the hub. A host that knows who will answer says so in `note`: one quiet
16
+ * line under the card ("Mia is listening in episode 412: she answers here"). The listener is any object shaped like
13
17
  * `@miadi/stateloom-react`'s `browserDictation()`, so this package needs no
14
18
  * socket and no speech code of its own.
15
19
  */
16
20
  import { useEffect, useRef, useState } from "react";
17
- import { MARK_KINDS, markAnchorText } from "@miadi/stateloom-protocol";
21
+ import { MARK_KINDS, lastWordOf, markAnchorText } from "@miadi/stateloom-protocol";
18
22
  import { themeStyle } from "./theme.js";
19
23
  import { CloseIcon, MicIcon } from "./icons.js";
20
24
  const KIND_LABEL = {
@@ -46,7 +50,22 @@ function Anchor({ elements, region }) {
46
50
  return _jsx("span", { className: "slc-stage-chip slc-stage-chip--quiet", children: "the drawing" });
47
51
  return (_jsxs(_Fragment, { children: [elements?.map((e) => (_jsx("span", { className: "slc-stage-chip", children: e }, e))), region && !elements?.length && _jsx("span", { className: "slc-stage-chip slc-stage-chip--quiet", children: "an area" })] }));
48
52
  }
49
- export function MarkComposer({ elements, region, author, onAuthorChange, onSubmit, onCancel, listener, listenAtOnce = false, busy = false, error, placeholder = "What should the agent know about this?", theme, className, style, }) {
53
+ /** Who will answer, as the host knows it: one muted line, nothing when the host has nothing to say. */
54
+ function Note({ children }) {
55
+ if (children === undefined || children === null || children === false || children === "")
56
+ return null;
57
+ return (_jsx("div", { className: "slc-stage-card-note", role: "status", children: children }));
58
+ }
59
+ /** A mouse or trackpad: the composer may take focus without raising a keyboard. */
60
+ function finePointer() {
61
+ try {
62
+ return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia("(pointer: fine)").matches;
63
+ }
64
+ catch {
65
+ return false;
66
+ }
67
+ }
68
+ export function MarkComposer({ elements, region, author, onAuthorChange, onSubmit, onCancel, listener, listenAtOnce = false, busy = false, error, placeholder = "What should the agent know about this?", note, theme, className, style, }) {
50
69
  const [text, setText] = useState("");
51
70
  const [kind, setKind] = useState("comment");
52
71
  const [name, setName] = useState(author);
@@ -55,7 +74,10 @@ export function MarkComposer({ elements, region, author, onAuthorChange, onSubmi
55
74
  useEffect(() => {
56
75
  if (listenAtOnce && listener)
57
76
  toggle("");
58
- else
77
+ // On a phone, focusing raises the keyboard over the board before the person
78
+ // asked to type: the box takes focus by itself only under a fine pointer,
79
+ // or when they pressed Answer (by voice, where nothing listens).
80
+ else if (listenAtOnce || finePointer())
59
81
  area.current?.focus();
60
82
  // Once, when the composer opens.
61
83
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -76,9 +98,9 @@ export function MarkComposer({ elements, region, author, onAuthorChange, onSubmi
76
98
  submit();
77
99
  if (e.key === "Escape")
78
100
  onCancel();
79
- }, rows: 3 }), !author && (_jsx("input", { className: "slc-stage-input", value: name, placeholder: "Your name (signs your marks)", onChange: (e) => setName(e.target.value) })), _jsxs("div", { className: "slc-stage-card-row", children: [_jsx("select", { className: "slc-stage-input slc-stage-select", value: kind, onChange: (e) => setKind(e.target.value), "aria-label": "Kind of mark", children: MARK_KINDS.map((k) => (_jsx("option", { value: k, children: KIND_LABEL[k] }, k))) }), listener && (_jsx("button", { type: "button", className: `slc-stage-btn${listening ? " slc-stage-btn--live" : ""}`, onClick: () => toggle(text), "aria-pressed": listening, title: listening ? "Stop listening" : "Speak instead of typing", children: _jsx(MicIcon, {}) })), _jsx("span", { className: "slc-stage-spacer" }), _jsx("button", { type: "button", className: "slc-stage-btn slc-stage-btn--quiet", onClick: onCancel, children: "Cancel" }), _jsx("button", { type: "submit", className: "slc-stage-btn slc-stage-btn--main", disabled: !text.trim() || busy || (!author && !name.trim()), children: busy ? "Saving…" : "Mark" })] }), error && _jsx("div", { className: "slc-stage-card-error", children: error })] }));
101
+ }, rows: 3 }), !author && (_jsx("input", { className: "slc-stage-input", value: name, placeholder: "Your name (signs your marks)", onChange: (e) => setName(e.target.value) })), _jsxs("div", { className: "slc-stage-card-row", children: [_jsx("select", { className: "slc-stage-input slc-stage-select", value: kind, onChange: (e) => setKind(e.target.value), "aria-label": "Kind of mark", children: MARK_KINDS.map((k) => (_jsx("option", { value: k, children: KIND_LABEL[k] }, k))) }), listener && (_jsx("button", { type: "button", className: `slc-stage-btn${listening ? " slc-stage-btn--live" : ""}`, onClick: () => toggle(text), "aria-pressed": listening, title: listening ? "Stop listening" : "Speak instead of typing", children: _jsx(MicIcon, {}) })), _jsx("span", { className: "slc-stage-spacer" }), _jsx("button", { type: "button", className: "slc-stage-btn slc-stage-btn--quiet", onClick: onCancel, children: "Cancel" }), _jsx("button", { type: "submit", className: "slc-stage-btn slc-stage-btn--main", disabled: !text.trim() || busy || (!author && !name.trim()), children: busy ? "Saving…" : "Mark" })] }), _jsx(Note, { children: note }), error && _jsx("div", { className: "slc-stage-card-error", children: error })] }));
80
102
  }
81
- export function MarkThread({ mark, number, onReply, onResolve, onReopen, onRemove, onClose, listener, busy = false, error, theme, className, style, }) {
103
+ export function MarkThread({ mark, number, onReply, onResolve, onReopen, onRemove, onClose, listener, busy = false, error, note, theme, className, style, }) {
82
104
  const [reply, setReply] = useState("");
83
105
  const { listening, toggle } = useListening(listener, setReply);
84
106
  const send = (e) => {
@@ -90,15 +112,26 @@ export function MarkThread({ mark, number, onReply, onResolve, onReopen, onRemov
90
112
  onReply?.(reply.trim());
91
113
  setReply("");
92
114
  };
93
- return (_jsxs("div", { className: `slc-stage-card slc-stage-thread${className ? ` ${className}` : ""}`, style: { ...themeStyle(theme), ...style }, onPointerDown: (e) => e.stopPropagation(), children: [_jsxs("div", { className: "slc-stage-card-row", children: [number !== undefined && _jsx("span", { className: `slc-stage-pin slc-stage-pin--inline slc-stage-pin--${mark.status === "resolved" ? "resolved" : mark.status}`, children: number }), _jsxs("span", { className: "slc-stage-card-label", children: [KIND_LABEL[mark.kind], " \u00B7 ", mark.status] }), _jsx("span", { className: "slc-stage-spacer" }), _jsx("button", { type: "button", className: "slc-stage-btn slc-stage-btn--quiet", onClick: onClose, "aria-label": "Close", children: _jsx(CloseIcon, {}) })] }), _jsx("div", { className: "slc-stage-card-anchor", children: _jsx(Anchor, { elements: mark.elements, region: mark.region }) }), _jsxs("ol", { className: "slc-stage-thread-list", children: [_jsxs("li", { className: `slc-stage-said slc-stage-said--${mark.author.role}`, children: [_jsx("span", { className: "slc-stage-said-who", children: mark.author.name }), _jsx("span", { className: "slc-stage-said-text", children: mark.text })] }), (mark.replies ?? []).map((r, i) => (_jsxs("li", { className: `slc-stage-said slc-stage-said--${r.author.role}`, children: [_jsx("span", { className: "slc-stage-said-who", children: r.author.name }), _jsx("span", { className: "slc-stage-said-text", children: r.text })] }, i)))] }), onReply && (_jsxs("form", { className: "slc-stage-card-row", onSubmit: send, children: [_jsx("input", { className: "slc-stage-input slc-stage-grow", value: reply, placeholder: listening ? "Listening…" : "Reply…", onChange: (e) => setReply(e.target.value) }), listener && (_jsx("button", { type: "button", className: `slc-stage-btn${listening ? " slc-stage-btn--live" : ""}`, onClick: () => toggle(reply), "aria-pressed": listening, title: "Speak the reply", children: _jsx(MicIcon, {}) })), _jsx("button", { type: "submit", className: "slc-stage-btn slc-stage-btn--main", disabled: !reply.trim() || busy, children: "Reply" })] })), _jsxs("div", { className: "slc-stage-card-row", children: [mark.status === "resolved"
115
+ return (_jsxs("div", { className: `slc-stage-card slc-stage-thread${className ? ` ${className}` : ""}`, style: { ...themeStyle(theme), ...style }, onPointerDown: (e) => e.stopPropagation(), children: [_jsxs("div", { className: "slc-stage-card-row", children: [number !== undefined && _jsx("span", { className: `slc-stage-pin slc-stage-pin--inline slc-stage-pin--${mark.status === "resolved" ? "resolved" : mark.status}`, children: number }), _jsxs("span", { className: "slc-stage-card-label", children: [KIND_LABEL[mark.kind], " \u00B7 ", mark.status] }), _jsx("span", { className: "slc-stage-spacer" }), _jsx("button", { type: "button", className: "slc-stage-btn slc-stage-btn--quiet", onClick: onClose, "aria-label": "Close", children: _jsx(CloseIcon, {}) })] }), _jsx("div", { className: "slc-stage-card-anchor", children: _jsx(Anchor, { elements: mark.elements, region: mark.region }) }), _jsxs("ol", { className: "slc-stage-thread-list", children: [_jsxs("li", { className: `slc-stage-said slc-stage-said--${mark.author.role}`, children: [_jsx("span", { className: "slc-stage-said-who", children: mark.author.name }), _jsx("span", { className: "slc-stage-said-text", children: mark.text })] }), (mark.replies ?? []).map((r, i) => (_jsxs("li", { className: `slc-stage-said slc-stage-said--${r.author.role}`, children: [_jsx("span", { className: "slc-stage-said-who", children: r.author.name }), _jsx("span", { className: "slc-stage-said-text", children: r.text })] }, i)))] }), mark.status !== "resolved" && lastWordOf(mark) === "person" && _jsx(Note, { children: note }), onReply && (_jsxs("form", { className: "slc-stage-card-row", onSubmit: send, children: [_jsx("input", { className: "slc-stage-input slc-stage-grow", value: reply, placeholder: listening ? "Listening…" : "Reply…", onChange: (e) => setReply(e.target.value) }), listener && (_jsx("button", { type: "button", className: `slc-stage-btn${listening ? " slc-stage-btn--live" : ""}`, onClick: () => toggle(reply), "aria-pressed": listening, title: "Speak the reply", children: _jsx(MicIcon, {}) })), _jsx("button", { type: "submit", className: "slc-stage-btn slc-stage-btn--main", disabled: !reply.trim() || busy, children: "Reply" })] })), _jsxs("div", { className: "slc-stage-card-row", children: [mark.status === "resolved"
94
116
  ? onReopen && (_jsx("button", { type: "button", className: "slc-stage-btn", onClick: onReopen, children: "Reopen" }))
95
117
  : onResolve && (_jsx("button", { type: "button", className: "slc-stage-btn", onClick: onResolve, children: "Resolve" })), _jsx("span", { className: "slc-stage-spacer" }), onRemove && (_jsx("button", { type: "button", className: "slc-stage-btn slc-stage-btn--danger", onClick: onRemove, children: "Remove" }))] }), error && _jsx("div", { className: "slc-stage-card-error", children: error })] }));
96
118
  }
97
- export function MarksPanel({ marks, selected, onSelect, onCopy, copied, onClose, theme, className, style }) {
119
+ export function MarksPanel({ marks, selected, onSelect, onCopy, copied, onClose, note, unread, theme, className, style }) {
98
120
  const [all, setAll] = useState(false);
121
+ const unreadIds = new Set(unread ?? []);
122
+ // Numbered as on the board; the ones with an agent's word not yet read first.
99
123
  const numbered = marks.map((m, i) => ({ m, n: i + 1 }));
100
- const shown = all ? numbered : numbered.filter(({ m }) => m.status !== "resolved");
124
+ const ordered = [...numbered.filter(({ m }) => unreadIds.has(m.id)), ...numbered.filter(({ m }) => !unreadIds.has(m.id))];
125
+ const shown = all ? ordered : ordered.filter(({ m }) => m.status !== "resolved");
101
126
  const open = marks.filter((m) => m.status !== "resolved").length;
102
- return (_jsxs("div", { className: `slc-stage-card slc-stage-panel${className ? ` ${className}` : ""}`, style: { ...themeStyle(theme), ...style }, onPointerDown: (e) => e.stopPropagation(), children: [_jsxs("div", { className: "slc-stage-card-row", children: [_jsx("span", { className: "slc-stage-card-label", children: "Marks on this drawing" }), _jsx("span", { className: "slc-stage-spacer" }), _jsxs("span", { className: "slc-stage-segment", role: "group", "aria-label": "Which marks to list", children: [_jsxs("button", { type: "button", className: `slc-stage-segment-btn${all ? "" : " slc-stage-segment-btn--on"}`, "aria-pressed": !all, onClick: () => setAll(false), children: ["Open ", open] }), _jsxs("button", { type: "button", className: `slc-stage-segment-btn${all ? " slc-stage-segment-btn--on" : ""}`, "aria-pressed": all, onClick: () => setAll(true), children: ["All ", marks.length] })] }), onClose && (_jsx("button", { type: "button", className: "slc-stage-btn slc-stage-btn--quiet", onClick: onClose, "aria-label": "Close", children: _jsx(CloseIcon, {}) }))] }), shown.length === 0 && _jsx("div", { className: "slc-stage-empty", children: marks.length ? "Every mark is resolved." : "No marks yet. Turn on marking (✎) and tap or draw around what you mean." }), _jsx("ul", { className: "slc-stage-panel-list", children: shown.map(({ m, n }) => (_jsx("li", { children: _jsxs("button", { type: "button", className: `slc-stage-panel-item${m.id === selected ? " slc-stage-panel-item--selected" : ""}`, onClick: () => onSelect(m.id), children: [_jsx("span", { className: `slc-stage-pin slc-stage-pin--inline slc-stage-pin--${m.status === "resolved" ? "resolved" : m.author.role === "agent" && m.status === "open" ? "question" : m.status}`, children: n }), _jsxs("span", { className: "slc-stage-panel-text", children: [_jsx("span", { className: "slc-stage-panel-said", children: m.text }), _jsxs("span", { className: "slc-stage-panel-meta", children: [m.author.name, " \u00B7 ", markAnchorText(m), m.replies?.length ? ` · ${m.replies.length} repl${m.replies.length === 1 ? "y" : "ies"}` : ""] })] })] }) }, m.id))) }), onCopy && (_jsxs("div", { className: "slc-stage-card-row", children: [_jsx("span", { className: "slc-stage-spacer" }), _jsx("button", { type: "button", className: "slc-stage-btn", onClick: onCopy, title: "Copy what is on screen and the waiting marks, to paste into any agent", children: copied ? "Copied" : "Copy for the agent" })] }))] }));
127
+ return (_jsxs("div", { className: `slc-stage-card slc-stage-panel${className ? ` ${className}` : ""}`, style: { ...themeStyle(theme), ...style }, onPointerDown: (e) => e.stopPropagation(), children: [_jsxs("div", { className: "slc-stage-card-row", children: [_jsx("span", { className: "slc-stage-card-label", children: "Marks on this drawing" }), _jsx("span", { className: "slc-stage-spacer" }), _jsxs("span", { className: "slc-stage-segment", role: "group", "aria-label": "Which marks to list", children: [_jsxs("button", { type: "button", className: `slc-stage-segment-btn${all ? "" : " slc-stage-segment-btn--on"}`, "aria-pressed": !all, onClick: () => setAll(false), children: ["Open ", open] }), _jsxs("button", { type: "button", className: `slc-stage-segment-btn${all ? " slc-stage-segment-btn--on" : ""}`, "aria-pressed": all, onClick: () => setAll(true), children: ["All ", marks.length] })] }), onClose && (_jsx("button", { type: "button", className: "slc-stage-btn slc-stage-btn--quiet", onClick: onClose, "aria-label": "Close", children: _jsx(CloseIcon, {}) }))] }), shown.length === 0 && _jsx("div", { className: "slc-stage-empty", children: marks.length ? "Every mark is resolved." : "No marks yet. Turn on marking (✎) and tap or draw around what you mean." }), _jsx("ul", { className: "slc-stage-panel-list", children: shown.map(({ m, n }) => (_jsx("li", { children: _jsxs("button", { type: "button", className: `slc-stage-panel-item${m.id === selected ? " slc-stage-panel-item--selected" : ""}`, onClick: () => onSelect(m.id), children: [_jsx("span", { className: `slc-stage-pin slc-stage-pin--inline slc-stage-pin--${m.status === "resolved" ? "resolved" : m.author.role === "agent" && m.status === "open" ? "question" : m.status}${unreadIds.has(m.id) ? " slc-stage-pin--new" : ""}`, children: n }), _jsxs("span", { className: "slc-stage-panel-text", children: [_jsx("span", { className: "slc-stage-panel-said", children: m.text }), _jsxs("span", { className: "slc-stage-panel-meta", children: [unreadIds.has(m.id) && _jsx("span", { className: "slc-stage-new", children: "new" }), m.author.name, " \u00B7 ", markAnchorText(m), m.replies?.length ? ` · ${m.replies.length} repl${m.replies.length === 1 ? "y" : "ies"}` : ""] })] })] }) }, m.id))) }), _jsx(Note, { children: note }), onCopy && (_jsxs("div", { className: "slc-stage-card-row", children: [_jsx("span", { className: "slc-stage-spacer" }), _jsx("button", { type: "button", className: "slc-stage-btn", onClick: onCopy, title: "Copy what is on screen and the waiting marks, to paste into any agent", children: copied ? "Copied" : "Copy for the agent" })] }))] }));
128
+ }
129
+ /**
130
+ * One line that says an agent answered, near the board's controls. A polite
131
+ * live region: read out, never focused, never a card over the board. The host
132
+ * decides how long it stays (a few seconds) and what a tap opens.
133
+ */
134
+ export function MarkNotice({ children, onOpen, onDismiss, theme, className, style }) {
135
+ return (_jsxs("div", { className: `slc-stage-notice${className ? ` ${className}` : ""}`, style: { ...themeStyle(theme), ...style }, role: "status", "aria-live": "polite", onPointerDown: (e) => e.stopPropagation(), children: [_jsxs("button", { type: "button", className: "slc-stage-notice-open", onClick: onOpen, title: "Open the thread", children: [_jsx("span", { className: "slc-stage-notice-dot", "aria-hidden": "true" }), _jsx("span", { className: "slc-stage-notice-text", children: children })] }), onDismiss && (_jsx("button", { type: "button", className: "slc-stage-notice-close", onClick: onDismiss, "aria-label": "Dismiss", children: _jsx(CloseIcon, {}) }))] }));
103
136
  }
104
137
  //# sourceMappingURL=MarkCards.js.map
@@ -10,9 +10,14 @@
10
10
  * scrim with a hole around each spotlighted element, and each hole is ringed;
11
11
  * - **frames** an area the agent names;
12
12
  * - **pins** each mark at what it points at, numbered, coloured by whether it
13
- * waits (open), was answered, or is done — a tap opens its thread;
13
+ * waits (open), was answered, or is done — a tap opens its thread; a mark
14
+ * the host lists in `unread` (an agent's word not yet opened) wears a quiet
15
+ * "new" ring and dot;
14
16
  * - **takes a mark** when the host turns marking on: a tap names the element
15
17
  * under it, a drag names the elements inside the area drawn (and the area).
18
+ * A mouse or pen tap on empty board marks a small area there; a finger's tap
19
+ * on empty board does nothing, so a phone's stray touch never makes a mark
20
+ * (a finger's drag still frames an area).
16
21
  *
17
22
  * Positioned over the canvas by the host (both in one `position: relative`
18
23
  * box); it lets every pointer through to the canvas except on its pins and
@@ -37,6 +42,12 @@ export interface StageOverlayProps {
37
42
  marks?: readonly Mark[];
38
43
  selectedMark?: string | null;
39
44
  onSelectMark?: (id: string) => void;
45
+ /**
46
+ * Marks with an agent's word the person has not opened yet (their ids): the
47
+ * pin wears a quiet "new" ring. `unreadMarks(marks, read)` from the protocol,
48
+ * with `read` from `useMarksRead`.
49
+ */
50
+ unread?: readonly string[];
40
51
  /** Resolved marks keep no pin. Default true. */
41
52
  hideResolved?: boolean;
42
53
  /** Take the next tap or drag as a mark. */
@@ -50,5 +61,5 @@ export interface StageOverlayProps {
50
61
  }
51
62
  /** Where a mark sits: its elements that are drawn here, else its area. */
52
63
  export declare function markAnchor(mark: Pick<Mark, "elements" | "region">, boxes: readonly ElementBox[]): Box | null;
53
- export declare function StageOverlay({ viewport, boxes, spotlight, region, marks, selectedMark, onSelectMark, hideResolved, marking, onDraft, draft, theme, className, style, }: StageOverlayProps): import("react").JSX.Element;
64
+ export declare function StageOverlay({ viewport, boxes, spotlight, region, marks, selectedMark, onSelectMark, unread, hideResolved, marking, onDraft, draft, theme, className, style, }: StageOverlayProps): import("react").JSX.Element;
54
65
  export default StageOverlay;
@@ -11,9 +11,14 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
11
11
  * scrim with a hole around each spotlighted element, and each hole is ringed;
12
12
  * - **frames** an area the agent names;
13
13
  * - **pins** each mark at what it points at, numbered, coloured by whether it
14
- * waits (open), was answered, or is done — a tap opens its thread;
14
+ * waits (open), was answered, or is done — a tap opens its thread; a mark
15
+ * the host lists in `unread` (an agent's word not yet opened) wears a quiet
16
+ * "new" ring and dot;
15
17
  * - **takes a mark** when the host turns marking on: a tap names the element
16
18
  * under it, a drag names the elements inside the area drawn (and the area).
19
+ * A mouse or pen tap on empty board marks a small area there; a finger's tap
20
+ * on empty board does nothing, so a phone's stray touch never makes a mark
21
+ * (a finger's drag still frames an area).
17
22
  *
18
23
  * Positioned over the canvas by the host (both in one `position: relative`
19
24
  * box); it lets every pointer through to the canvas except on its pins and
@@ -39,7 +44,7 @@ function pinTone(mark) {
39
44
  return mark.status === "answered" ? "answered" : "question";
40
45
  return mark.status === "answered" ? "answered" : "open";
41
46
  }
42
- export function StageOverlay({ viewport, boxes, spotlight, region, marks, selectedMark = null, onSelectMark, hideResolved = true, marking = false, onDraft, draft = null, theme, className, style, }) {
47
+ export function StageOverlay({ viewport, boxes, spotlight, region, marks, selectedMark = null, onSelectMark, unread, hideResolved = true, marking = false, onDraft, draft = null, theme, className, style, }) {
43
48
  const maskId = `slc-stage-mask-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;
44
49
  const rootRef = useRef(null);
45
50
  const press = useRef(null);
@@ -47,6 +52,7 @@ export function StageOverlay({ viewport, boxes, spotlight, region, marks, select
47
52
  const holes = useMemo(() => (spotlight?.length ? boxesOf(boxes, spotlight).map((b) => padBox(b, HOLE_PAD)) : []), [boxes, spotlight]);
48
53
  const vt = viewportTransform(viewport);
49
54
  const selected = marks?.find((m) => m.id === selectedMark) ?? null;
55
+ const unreadIds = useMemo(() => new Set(unread ?? []), [unread]);
50
56
  const ringed = useMemo(() => {
51
57
  const out = [];
52
58
  if (selected?.elements?.length)
@@ -106,10 +112,13 @@ export function StageOverlay({ viewport, boxes, spotlight, region, marks, select
106
112
  const hit = elementAt(boxes, w.x, w.y);
107
113
  if (hit)
108
114
  return onDraft?.({ elements: [hit] });
115
+ // A finger's tap on empty board is a pan or a dismiss gone astray, not a mark.
116
+ if (e.pointerType === "touch")
117
+ return;
109
118
  const half = TAP_AREA / 2 / (viewport.scale || 1);
110
119
  onDraft?.({ elements: [], region: { x: w.x - half, y: w.y - half, width: half * 2, height: half * 2 } });
111
120
  };
112
- return (_jsxs("div", { ref: rootRef, className: `slc-stage${marking ? " slc-stage--marking" : ""}${className ? ` ${className}` : ""}`, style: { ...themeStyle(theme), ...style }, children: [_jsxs("svg", { className: "slc-stage-svg", "aria-hidden": "true", children: [holes.length > 0 && (_jsxs(_Fragment, { children: [_jsx("defs", { children: _jsxs("mask", { id: maskId, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "100%", height: "100%", children: [_jsx("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: "white" }), _jsx("g", { transform: vt, children: holes.map((b, i) => (_jsx("rect", { x: b.x, y: b.y, width: b.width, height: b.height, rx: 10, fill: "black" }, i))) })] }) }), _jsx("rect", { x: "0", y: "0", width: "100%", height: "100%", className: "slc-stage-scrim", mask: `url(#${maskId})` }), _jsx("g", { transform: vt, children: holes.map((b, i) => (_jsx("rect", { x: b.x, y: b.y, width: b.width, height: b.height, rx: 10, className: "slc-stage-ring", vectorEffect: "non-scaling-stroke" }, i))) })] })), _jsxs("g", { transform: vt, children: [region && (_jsx("rect", { x: region.x, y: region.y, width: region.width, height: region.height, rx: 6, className: "slc-stage-region", vectorEffect: "non-scaling-stroke" })), ringed.map((b, i) => (_jsx("rect", { x: b.x, y: b.y, width: b.width, height: b.height, rx: 8, className: "slc-stage-mark-ring", vectorEffect: "non-scaling-stroke" }, `r${i}`))), framed.map((b, i) => (_jsx("rect", { x: b.x, y: b.y, width: b.width, height: b.height, rx: 4, className: "slc-stage-mark-area", vectorEffect: "non-scaling-stroke" }, `f${i}`)))] }), drag && _jsx("rect", { x: drag.x, y: drag.y, width: drag.w, height: drag.h, rx: 4, className: "slc-stage-drag" })] }), pins.map(({ mark, n, x, y }) => (_jsxs("button", { type: "button", className: `slc-stage-pin slc-stage-pin--${pinTone(mark)}${mark.id === selectedMark ? " slc-stage-pin--selected" : ""}`, style: { left: x, top: y }, title: `${mark.author.name}: ${mark.text}${mark.replies?.length ? ` (${mark.replies.length} repl${mark.replies.length === 1 ? "y" : "ies"})` : ""}`, "aria-label": `Mark ${n}, ${mark.status}: ${mark.text}`, onPointerDown: (e) => e.stopPropagation(), onClick: (e) => {
121
+ return (_jsxs("div", { ref: rootRef, className: `slc-stage${marking ? " slc-stage--marking" : ""}${className ? ` ${className}` : ""}`, style: { ...themeStyle(theme), ...style }, children: [_jsxs("svg", { className: "slc-stage-svg", "aria-hidden": "true", children: [holes.length > 0 && (_jsxs(_Fragment, { children: [_jsx("defs", { children: _jsxs("mask", { id: maskId, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "100%", height: "100%", children: [_jsx("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: "white" }), _jsx("g", { transform: vt, children: holes.map((b, i) => (_jsx("rect", { x: b.x, y: b.y, width: b.width, height: b.height, rx: 10, fill: "black" }, i))) })] }) }), _jsx("rect", { x: "0", y: "0", width: "100%", height: "100%", className: "slc-stage-scrim", mask: `url(#${maskId})` }), _jsx("g", { transform: vt, children: holes.map((b, i) => (_jsx("rect", { x: b.x, y: b.y, width: b.width, height: b.height, rx: 10, className: "slc-stage-ring", vectorEffect: "non-scaling-stroke" }, i))) })] })), _jsxs("g", { transform: vt, children: [region && (_jsx("rect", { x: region.x, y: region.y, width: region.width, height: region.height, rx: 6, className: "slc-stage-region", vectorEffect: "non-scaling-stroke" })), ringed.map((b, i) => (_jsx("rect", { x: b.x, y: b.y, width: b.width, height: b.height, rx: 8, className: "slc-stage-mark-ring", vectorEffect: "non-scaling-stroke" }, `r${i}`))), framed.map((b, i) => (_jsx("rect", { x: b.x, y: b.y, width: b.width, height: b.height, rx: 4, className: "slc-stage-mark-area", vectorEffect: "non-scaling-stroke" }, `f${i}`)))] }), drag && _jsx("rect", { x: drag.x, y: drag.y, width: drag.w, height: drag.h, rx: 4, className: "slc-stage-drag" })] }), pins.map(({ mark, n, x, y }) => (_jsxs("button", { type: "button", className: `slc-stage-pin slc-stage-pin--${pinTone(mark)}${unreadIds.has(mark.id) ? " slc-stage-pin--new" : ""}${mark.id === selectedMark ? " slc-stage-pin--selected" : ""}`, style: { left: x, top: y }, title: `${mark.author.name}: ${mark.text}${mark.replies?.length ? ` (${mark.replies.length} repl${mark.replies.length === 1 ? "y" : "ies"})` : ""}${unreadIds.has(mark.id) ? " · new" : ""}`, "aria-label": `Mark ${n}, ${mark.status}${unreadIds.has(mark.id) ? ", new" : ""}: ${mark.text}`, onPointerDown: (e) => e.stopPropagation(), onClick: (e) => {
113
122
  e.stopPropagation();
114
123
  onSelectMark?.(mark.id);
115
124
  }, children: [n, (mark.replies?.length ?? 0) > 0 && _jsx("span", { className: "slc-stage-pin-count", children: mark.replies.length })] }, mark.id))), marking && (_jsx("div", { className: "slc-stage-catch", onPointerDown: onDown, onPointerMove: onMove, onPointerUp: onUp, onPointerCancel: () => {
package/dist/index.d.ts CHANGED
@@ -22,13 +22,14 @@ export { StageOverlay, markAnchor } from "./StageOverlay.js";
22
22
  export type { StageOverlayProps, MarkDraft } from "./StageOverlay.js";
23
23
  export { StageCaption } from "./StageCaption.js";
24
24
  export type { StageCaptionProps } from "./StageCaption.js";
25
- export { MarkComposer, MarkThread, MarksPanel } from "./MarkCards.js";
25
+ export { MarkComposer, MarkThread, MarksPanel, MarkNotice } from "./MarkCards.js";
26
+ export { useMarksRead, loadMarksRead, saveMarksRead, marksReadKey } from "./marksRead.js";
26
27
  export { CompanionDock } from "./CompanionDock.js";
27
28
  export type { CompanionDockProps, DockItem, DockReply, DockStep, DockTake } from "./CompanionDock.js";
28
29
  export { MicIcon, SpeakerIcon, SpeakerOffIcon, MarksIcon, MarkIcon, PlayIcon, PauseIcon, StopIcon, PrevIcon, NextIcon, ThumbUpIcon, ThumbDownIcon, CloseIcon, } from "./icons.js";
29
- export type { MarkComposerProps, MarkThreadProps, MarksPanelProps, ListenerLike } from "./MarkCards.js";
30
+ export type { MarkComposerProps, MarkThreadProps, MarksPanelProps, MarkNoticeProps, ListenerLike } from "./MarkCards.js";
30
31
  export { themeStyle, CANVAS_THEME_VARS } from "./theme.js";
31
32
  export type { CanvasTheme } from "./theme.js";
32
33
  export { childByName, childStatesAt, childrenOf, definedEvents, findState, livePath, parentAt, } from "./drill.js";
33
- export { autoLayout, AUTO_LAYOUT_DEFAULTS, IDENTITY_VIEWPORT, VIEWPORT_LIMITS, clampScale, fitToBoxes, normalizeViewport, panBy, sameViewport, screenDeltaToWorld, screenToWorld, viewportTransform, worldToScreen, zoomAt, zoomTo, routeEdges, erdAutoLayout, erdEntitySize, sequenceLayout, placeLabels, eventGlyph, guardText, machineElementBoxes, erdElementBoxes, sequenceElementBoxes, elementsInRegion, elementAt, boxesOf, unionBox, } from "@miadi/stateloom-protocol";
34
- export type { AutoLayoutOptions, Box, EntityRelationshipDefinition, FitOptions, LayoutBox, Point, ScaleLimits, SequenceDefinition, SequenceLayout, StateDef, StateMachineDefinition, TransitionDef, Viewport, ElementBox, Mark, MarkKind, TourStep, TourDefinition, } from "@miadi/stateloom-protocol";
34
+ export { autoLayout, AUTO_LAYOUT_DEFAULTS, IDENTITY_VIEWPORT, VIEWPORT_LIMITS, clampScale, fitToBoxes, normalizeViewport, panBy, sameViewport, screenDeltaToWorld, screenToWorld, viewportTransform, worldToScreen, zoomAt, zoomTo, routeEdges, erdAutoLayout, erdEntitySize, sequenceLayout, placeLabels, eventGlyph, guardText, machineElementBoxes, erdElementBoxes, sequenceElementBoxes, elementsInRegion, elementAt, boxesOf, unionBox, marksWaitingOn, markCounts, unreadMarks, isMarkUnread, withMarkRead, lastWordOf, agentWordIn, agentWordText, } from "@miadi/stateloom-protocol";
35
+ export type { AutoLayoutOptions, Box, EntityRelationshipDefinition, FitOptions, LayoutBox, Point, ScaleLimits, SequenceDefinition, SequenceLayout, StateDef, StateMachineDefinition, TransitionDef, Viewport, ElementBox, Mark, MarkKind, MarksRead, MarksEnvelope, AgentWord, TourStep, TourDefinition, } from "@miadi/stateloom-protocol";
package/dist/index.js CHANGED
@@ -20,7 +20,15 @@ export { SequenceCanvas, drawableSequence } from "./SequenceCanvas.js";
20
20
  // and the cards marks are written and read in.
21
21
  export { StageOverlay, markAnchor } from "./StageOverlay.js";
22
22
  export { StageCaption } from "./StageCaption.js";
23
- export { MarkComposer, MarkThread, MarksPanel } from "./MarkCards.js";
23
+ export { MarkComposer, MarkThread, MarksPanel, MarkNotice } from "./MarkCards.js";
24
+ // Whether an agent's word has been read, per drawing in this browser, and
25
+ // what a marks button counts — for any host that shows marks (Miadi's room
26
+ // as the loom): `useMarksRead(doc)` + `unreadMarks(marks, read)` give the
27
+ // pins' and the list's `unread`; `markCounts(marks, read)` gives `forYou`
28
+ // (what waits on the person: the main number) and `forAgent` (the quiet one);
29
+ // `agentWordIn(envelope)` + `agentWordText(word)` turn a `marks:changed` that
30
+ // carries an agent's answer into the line for `<MarkNotice>`.
31
+ export { useMarksRead, loadMarksRead, saveMarksRead, marksReadKey } from "./marksRead.js";
24
32
  // Talking with a companion from the canvas (Spec 84).
25
33
  export { CompanionDock } from "./CompanionDock.js";
26
34
  export { MicIcon, SpeakerIcon, SpeakerOffIcon, MarksIcon, MarkIcon, PlayIcon, PauseIcon, StopIcon, PrevIcon, NextIcon, ThumbUpIcon, ThumbDownIcon, CloseIcon, } from "./icons.js";
@@ -28,5 +36,5 @@ export { themeStyle, CANVAS_THEME_VARS } from "./theme.js";
28
36
  export { childByName, childStatesAt, childrenOf, definedEvents, findState, livePath, parentAt, } from "./drill.js";
29
37
  // The geometry and the model, re-exported at the address a host reaching for a
30
38
  // canvas is already looking at.
31
- export { autoLayout, AUTO_LAYOUT_DEFAULTS, IDENTITY_VIEWPORT, VIEWPORT_LIMITS, clampScale, fitToBoxes, normalizeViewport, panBy, sameViewport, screenDeltaToWorld, screenToWorld, viewportTransform, worldToScreen, zoomAt, zoomTo, routeEdges, erdAutoLayout, erdEntitySize, sequenceLayout, placeLabels, eventGlyph, guardText, machineElementBoxes, erdElementBoxes, sequenceElementBoxes, elementsInRegion, elementAt, boxesOf, unionBox, } from "@miadi/stateloom-protocol";
39
+ export { autoLayout, AUTO_LAYOUT_DEFAULTS, IDENTITY_VIEWPORT, VIEWPORT_LIMITS, clampScale, fitToBoxes, normalizeViewport, panBy, sameViewport, screenDeltaToWorld, screenToWorld, viewportTransform, worldToScreen, zoomAt, zoomTo, routeEdges, erdAutoLayout, erdEntitySize, sequenceLayout, placeLabels, eventGlyph, guardText, machineElementBoxes, erdElementBoxes, sequenceElementBoxes, elementsInRegion, elementAt, boxesOf, unionBox, marksWaitingOn, markCounts, unreadMarks, isMarkUnread, withMarkRead, lastWordOf, agentWordIn, agentWordText, } from "@miadi/stateloom-protocol";
32
40
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,12 @@
1
+ import { type Mark, type MarksRead } from "@miadi/stateloom-protocol";
2
+ export declare function marksReadKey(doc: string): string;
3
+ export declare function loadMarksRead(doc: string): MarksRead;
4
+ export declare function saveMarksRead(doc: string, read: MarksRead): void;
5
+ /**
6
+ * The read record of one drawing, and `markRead(mark)` to call when the person
7
+ * opens a thread (and again while it stays open as replies arrive).
8
+ */
9
+ export declare function useMarksRead(doc: string | null): {
10
+ read: MarksRead;
11
+ markRead: (mark: Pick<Mark, "id" | "replies">) => void;
12
+ };
@@ -0,0 +1,64 @@
1
+ /**
2
+ * What a person has read of a drawing's marks, kept in this browser (Spec 83).
3
+ *
4
+ * Per drawing, `stateloom.marks.read.v1:<doc>` holds mark id → the number of
5
+ * replies the thread had when the person last opened it. With the protocol's
6
+ * `unreadMarks(marks, read)` it says which threads carry an agent's word they
7
+ * have not seen. Every access is guarded: a private window, blocked storage or
8
+ * a server render reads as nothing read, and a write that fails is dropped.
9
+ */
10
+ import { useCallback, useEffect, useState } from "react";
11
+ import { withMarkRead } from "@miadi/stateloom-protocol";
12
+ const PREFIX = "stateloom.marks.read.v1:";
13
+ export function marksReadKey(doc) {
14
+ return `${PREFIX}${doc}`;
15
+ }
16
+ export function loadMarksRead(doc) {
17
+ try {
18
+ const raw = window.localStorage.getItem(marksReadKey(doc));
19
+ const parsed = raw ? JSON.parse(raw) : null;
20
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
21
+ return {};
22
+ const out = {};
23
+ for (const [id, n] of Object.entries(parsed)) {
24
+ if (typeof n === "number" && Number.isFinite(n) && n >= 0)
25
+ out[id] = n;
26
+ }
27
+ return out;
28
+ }
29
+ catch {
30
+ return {};
31
+ }
32
+ }
33
+ export function saveMarksRead(doc, read) {
34
+ try {
35
+ window.localStorage.setItem(marksReadKey(doc), JSON.stringify(read));
36
+ }
37
+ catch {
38
+ // Storage refused (private mode, quota): the marks read again as new next time.
39
+ }
40
+ }
41
+ /**
42
+ * The read record of one drawing, and `markRead(mark)` to call when the person
43
+ * opens a thread (and again while it stays open as replies arrive).
44
+ */
45
+ export function useMarksRead(doc) {
46
+ const [state, setState] = useState(() => ({ doc, read: doc ? loadMarksRead(doc) : {} }));
47
+ useEffect(() => {
48
+ setState((s) => (s.doc === doc ? s : { doc, read: doc ? loadMarksRead(doc) : {} }));
49
+ }, [doc]);
50
+ const markRead = useCallback((mark) => {
51
+ if (!doc)
52
+ return;
53
+ setState((s) => {
54
+ const base = s.doc === doc ? s.read : loadMarksRead(doc);
55
+ if (base[mark.id] === (mark.replies?.length ?? 0) && s.doc === doc)
56
+ return s;
57
+ const read = withMarkRead(base, mark);
58
+ saveMarksRead(doc, read);
59
+ return { doc, read };
60
+ });
61
+ }, [doc]);
62
+ return { read: state.doc === doc ? state.read : {}, markRead };
63
+ }
64
+ //# sourceMappingURL=marksRead.js.map
package/dist/styles.css CHANGED
@@ -633,7 +633,8 @@
633
633
 
634
634
  .slc-stage,
635
635
  .slc-stage-caption,
636
- .slc-stage-card {
636
+ .slc-stage-card,
637
+ .slc-stage-notice {
637
638
  --slc-accent: #3b82f6;
638
639
  --slc-accent-fill: #1e3a5f;
639
640
  --slc-accent-ink: #93c5fd;
@@ -738,6 +739,21 @@
738
739
  .slc-stage-pin--open { background: var(--slc-mark-open); }
739
740
  .slc-stage-pin--selected { outline: 3px solid var(--slc-label); outline-offset: 1px; z-index: 2; }
740
741
 
742
+ /* An agent's word not yet opened: a quiet ring and a dot, over whichever colour the pin has. */
743
+ .slc-stage-pin--new { box-shadow: 0 0 0 3px rgb(255 255 255 / 0.22), 0 2px 6px rgb(0 0 0 / 0.45); }
744
+ .slc-stage-pin--new::after {
745
+ content: "";
746
+ position: absolute;
747
+ left: -4px;
748
+ top: -4px;
749
+ width: 9px;
750
+ height: 9px;
751
+ border-radius: 50%;
752
+ background: var(--slc-label);
753
+ border: 1.5px solid var(--slc-panel-bg, #111827);
754
+ }
755
+ .slc-stage-pin--inline.slc-stage-pin--new { position: relative; }
756
+
741
757
  .slc-stage-pin--inline {
742
758
  position: static;
743
759
  transform: none;
@@ -916,6 +932,72 @@
916
932
  .slc-stage-card-label { color: var(--slc-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
917
933
  .slc-stage-card-anchor { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
918
934
  .slc-stage-card-error { color: var(--slc-danger); font-size: 12px; }
935
+ /* Who will answer the marks: the host's one line, quiet. */
936
+ .slc-stage-card-note { color: var(--slc-muted); font-size: 12px; line-height: 1.35; }
937
+
938
+ /* "new" beside a listed mark whose agent's word is not yet read. */
939
+ .slc-stage-new {
940
+ display: inline-block;
941
+ margin-right: 6px;
942
+ padding: 0 6px;
943
+ border-radius: 999px;
944
+ border: 1px solid var(--slc-mark-answered);
945
+ color: var(--slc-label);
946
+ font-size: 10px;
947
+ line-height: 15px;
948
+ text-transform: lowercase;
949
+ }
950
+
951
+ /* One line when an agent answers: near the board's controls, never over the board. */
952
+ .slc-stage-notice {
953
+ display: inline-flex;
954
+ align-items: center;
955
+ max-width: 100%;
956
+ min-width: 0;
957
+ border-radius: 999px;
958
+ border: 1px solid var(--slc-mark-answered);
959
+ background: var(--slc-panel-bg);
960
+ color: var(--slc-label);
961
+ box-shadow: 0 6px 18px rgb(0 0 0 / 0.45);
962
+ backdrop-filter: blur(6px);
963
+ pointer-events: auto;
964
+ }
965
+ .slc-stage-notice-open {
966
+ display: inline-flex;
967
+ align-items: center;
968
+ gap: 7px;
969
+ min-width: 0;
970
+ min-height: 34px;
971
+ padding: 0 4px 0 12px;
972
+ border: 0;
973
+ background: transparent;
974
+ color: inherit;
975
+ font: 500 13px/1.2 ui-sans-serif, system-ui, sans-serif;
976
+ cursor: pointer;
977
+ }
978
+ .slc-stage-notice-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
979
+ .slc-stage-notice-dot {
980
+ flex: none;
981
+ width: 8px;
982
+ height: 8px;
983
+ border-radius: 50%;
984
+ background: var(--slc-mark-answered);
985
+ }
986
+ .slc-stage-notice-close {
987
+ flex: none;
988
+ display: inline-flex;
989
+ align-items: center;
990
+ justify-content: center;
991
+ width: 30px;
992
+ height: 30px;
993
+ margin-right: 2px;
994
+ border: 0;
995
+ border-radius: 999px;
996
+ background: transparent;
997
+ color: var(--slc-muted);
998
+ cursor: pointer;
999
+ }
1000
+ .slc-stage-notice-close:hover { color: var(--slc-label); }
919
1001
 
920
1002
  .slc-stage-chip {
921
1003
  padding: 1px 7px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miadi/stateloom-canvas",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "The reusable SMDF design surface: a pannable, zoomable, drillable React SVG canvas with routed edges, settled labels and a navigation HUD",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,7 +43,7 @@
43
43
  "node": ">=20"
44
44
  },
45
45
  "dependencies": {
46
- "@miadi/stateloom-protocol": "^0.1.15"
46
+ "@miadi/stateloom-protocol": "^0.1.16"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "react": "^19"