@copilotz/work 0.0.0-stage → 1.0.0-rc.35
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/LICENSE +21 -0
- package/README.md +56 -2
- package/boards/actions/create-board.d.ts +1 -0
- package/boards/actions/create-board.js +47 -0
- package/boards/actions/create-card.d.ts +1 -0
- package/boards/actions/create-card.js +83 -0
- package/boards/actions/delete-board.d.ts +1 -0
- package/boards/actions/delete-board.js +30 -0
- package/boards/actions/delete-card.d.ts +1 -0
- package/boards/actions/delete-card.js +24 -0
- package/boards/actions/move-card.d.ts +1 -0
- package/boards/actions/move-card.js +85 -0
- package/boards/actions/update-board.d.ts +1 -0
- package/boards/actions/update-board.js +110 -0
- package/boards/actions/update-card.d.ts +1 -0
- package/boards/actions/update-card.js +67 -0
- package/boards/collections/board.d.ts +71 -0
- package/boards/collections/board.js +32 -0
- package/boards/collections/card.d.ts +74 -0
- package/boards/collections/card.js +29 -0
- package/boards/contract.d.ts +67 -0
- package/boards/contract.js +20 -0
- package/boards/mod.d.ts +34 -0
- package/boards/mod.js +72 -0
- package/boards/resources/tools.d.ts +2 -0
- package/boards/resources/tools.js +414 -0
- package/boards/shared/columns.d.ts +39 -0
- package/boards/shared/columns.js +88 -0
- package/boards/shared/dates.d.ts +11 -0
- package/boards/shared/dates.js +22 -0
- package/boards/shared/errors.d.ts +24 -0
- package/boards/shared/errors.js +20 -0
- package/boards/shared/fields.d.ts +65 -0
- package/boards/shared/fields.js +44 -0
- package/boards/shared/load.d.ts +22 -0
- package/boards/shared/load.js +32 -0
- package/boards/shared/order.d.ts +30 -0
- package/boards/shared/order.js +47 -0
- package/boards/shared/people.d.ts +30 -0
- package/boards/shared/people.js +87 -0
- package/boards/shared/said.d.ts +28 -0
- package/boards/shared/said.js +30 -0
- package/boards/views/web/board-head.d.ts +62 -0
- package/boards/views/web/board-head.js +170 -0
- package/boards/views/web/board-page.d.ts +17 -0
- package/boards/views/web/board-page.js +97 -0
- package/boards/views/web/board-view.d.ts +40 -0
- package/boards/views/web/board-view.js +341 -0
- package/boards/views/web/boards-tab.d.ts +13 -0
- package/boards/views/web/boards-tab.js +109 -0
- package/boards/views/web/card-sheet.d.ts +47 -0
- package/boards/views/web/card-sheet.js +314 -0
- package/boards/views/web/card-tile.d.ts +29 -0
- package/boards/views/web/card-tile.js +20 -0
- package/boards/views/web/column.d.ts +38 -0
- package/boards/views/web/column.js +171 -0
- package/boards/views/web/drag.d.ts +36 -0
- package/boards/views/web/drag.js +276 -0
- package/boards/views/web/glyphs.d.ts +29 -0
- package/boards/views/web/glyphs.js +25 -0
- package/boards/views/web/load.d.ts +32 -0
- package/boards/views/web/load.js +33 -0
- package/boards/views/web/palette.d.ts +15 -0
- package/boards/views/web/palette.js +180 -0
- package/boards/views/web/pickers.d.ts +45 -0
- package/boards/views/web/pickers.js +83 -0
- package/boards/views/web/shown.d.ts +77 -0
- package/boards/views/web/shown.js +136 -0
- package/boards/views/web/step.d.ts +13 -0
- package/boards/views/web/step.js +41 -0
- package/boards/views/web/style.d.ts +10 -0
- package/boards/views/web/style.js +380 -0
- package/boards/views/web/toolbar.d.ts +21 -0
- package/boards/views/web/toolbar.js +39 -0
- package/boards/web.d.ts +26 -0
- package/boards/web.js +52 -0
- package/contract.d.ts +7 -0
- package/contract.js +7 -0
- package/documents/actions/create.d.ts +1 -0
- package/documents/actions/create.js +28 -0
- package/documents/actions/delete.d.ts +1 -0
- package/documents/actions/delete.js +32 -0
- package/documents/actions/presence.d.ts +1 -0
- package/documents/actions/presence.js +45 -0
- package/documents/actions/rename.d.ts +1 -0
- package/documents/actions/rename.js +33 -0
- package/documents/actions/restore.d.ts +1 -0
- package/documents/actions/restore.js +39 -0
- package/documents/actions/save.d.ts +1 -0
- package/documents/actions/save.js +78 -0
- package/documents/collections/document-presence.d.ts +79 -0
- package/documents/collections/document-presence.js +25 -0
- package/documents/collections/document-version.d.ts +166 -0
- package/documents/collections/document-version.js +60 -0
- package/documents/collections/document.d.ts +131 -0
- package/documents/collections/document.js +72 -0
- package/documents/contract.d.ts +17 -0
- package/documents/contract.js +1 -0
- package/documents/mod.d.ts +38 -0
- package/documents/mod.js +75 -0
- package/documents/resources/tools.d.ts +2 -0
- package/documents/resources/tools.js +253 -0
- package/documents/shared/diff.d.ts +37 -0
- package/documents/shared/diff.js +148 -0
- package/documents/shared/merge.d.ts +29 -0
- package/documents/shared/merge.js +120 -0
- package/documents/shared/presence.d.ts +7 -0
- package/documents/shared/presence.js +7 -0
- package/documents/shared/text.d.ts +36 -0
- package/documents/shared/text.js +67 -0
- package/documents/shared/who.d.ts +23 -0
- package/documents/shared/who.js +39 -0
- package/documents/shared/write.d.ts +54 -0
- package/documents/shared/write.js +123 -0
- package/documents/views/web/changes.d.ts +22 -0
- package/documents/views/web/changes.js +57 -0
- package/documents/views/web/conflict.d.ts +38 -0
- package/documents/views/web/conflict.js +96 -0
- package/documents/views/web/draft.d.ts +18 -0
- package/documents/views/web/draft.js +32 -0
- package/documents/views/web/editor.d.ts +57 -0
- package/documents/views/web/editor.js +268 -0
- package/documents/views/web/format.d.ts +56 -0
- package/documents/views/web/format.js +245 -0
- package/documents/views/web/history.d.ts +23 -0
- package/documents/views/web/history.js +118 -0
- package/documents/views/web/list.d.ts +37 -0
- package/documents/views/web/list.js +211 -0
- package/documents/views/web/page.d.ts +35 -0
- package/documents/views/web/page.js +416 -0
- package/documents/views/web/palette.d.ts +16 -0
- package/documents/views/web/palette.js +168 -0
- package/documents/views/web/people.d.ts +60 -0
- package/documents/views/web/people.js +63 -0
- package/documents/views/web/presence.d.ts +30 -0
- package/documents/views/web/presence.js +75 -0
- package/documents/views/web/step.d.ts +25 -0
- package/documents/views/web/step.js +81 -0
- package/documents/views/web/style.d.ts +7 -0
- package/documents/views/web/style.js +266 -0
- package/documents/web.d.ts +18 -0
- package/documents/web.js +46 -0
- package/mod.d.ts +18 -0
- package/mod.js +18 -0
- package/package.json +61 -4
- package/web.d.ts +13 -0
- package/web.js +13 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Choosing on a board, in popovers: whom a card goes to (the space's people
|
|
4
|
+
* and agents, found as you type), its labels (the board's, or a new one),
|
|
5
|
+
* and what the board is filtered by (owners, labels: several at once). Each
|
|
6
|
+
* list is a popover's items: arrows move, Enter chooses, Escape closes.
|
|
7
|
+
*/
|
|
8
|
+
import { useState } from "react";
|
|
9
|
+
import { Avatar, Icon, Input, Popover } from "copilotz/web";
|
|
10
|
+
import { fold } from "../../shared/columns.js";
|
|
11
|
+
import { hueOf } from "./shown.js";
|
|
12
|
+
/** An option's face: a person's initial, an agent's emoji, or nobody's dashed ring. */
|
|
13
|
+
export function Face({ someone, size = 24 }) {
|
|
14
|
+
if (!someone) {
|
|
15
|
+
return (_jsx("span", { className: "board-unassigned", style: { width: size, height: size }, "aria-hidden": "true", children: _jsx(Icon, { name: "person", size: Math.round(size * 0.55) }) }));
|
|
16
|
+
}
|
|
17
|
+
return _jsx(Avatar, { name: someone.name, kind: someone.kind, icon: someone.icon, size: size });
|
|
18
|
+
}
|
|
19
|
+
/** Arrow keys from a popover's search field to its first item. */
|
|
20
|
+
const down = (event) => {
|
|
21
|
+
if (event.key !== "ArrowDown")
|
|
22
|
+
return;
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
event.currentTarget.closest("[popover]")?.querySelector("[data-popover-item]:not(input)")?.focus();
|
|
25
|
+
};
|
|
26
|
+
/** Whether someone fits what's typed: their name, their note (an email), their key. */
|
|
27
|
+
const fits = (someone, typed) => fold(`${someone.name} ${someone.note ?? ""} ${someone.key}`).includes(fold(typed));
|
|
28
|
+
/** Whom a card goes to: one of the space's people or agents, or nobody. */
|
|
29
|
+
export function AssigneePicker({ people, value, onChange, trigger, label = "Owner" }) {
|
|
30
|
+
const [typed, setTyped] = useState("");
|
|
31
|
+
const shown = people.filter((p) => fits(p, typed));
|
|
32
|
+
const humans = shown.filter((p) => p.kind === "person");
|
|
33
|
+
const agents = shown.filter((p) => p.kind === "agent");
|
|
34
|
+
const option = (someone, close) => (_jsxs("button", { type: "button", role: "menuitemradio", "aria-checked": (someone?.key ?? undefined) === value, className: "board-option", "data-popover-item": true, onClick: () => {
|
|
35
|
+
onChange(someone?.key ?? null);
|
|
36
|
+
close();
|
|
37
|
+
}, children: [_jsx(Face, { someone: someone }), _jsxs("span", { className: "board-option-text", children: [_jsx("span", { children: someone?.name ?? "Nobody yet" }), someone?.note && someone.note !== someone.name
|
|
38
|
+
? _jsx("span", { className: "board-option-note", children: someone.note })
|
|
39
|
+
: null] }), _jsx(Icon, { name: "check", size: 16, className: "board-option-check" })] }, someone?.key ?? "nobody"));
|
|
40
|
+
return (_jsx(Popover, { label: label, trigger: trigger, width: 300, children: (close) => (_jsxs("div", { role: "menu", "aria-label": label, children: [_jsx("div", { className: "board-options-search", children: _jsx(Input, { size: "sm", icon: "search", placeholder: "Find someone here", "aria-label": "Find someone here", value: typed, "data-popover-item": true, autoComplete: "off", onChange: (event) => setTyped(event.target.value), onKeyDown: down }) }), _jsxs("div", { className: "board-options", children: [typed ? null : option(undefined, close), humans.length ? _jsx("p", { className: "board-options-head", children: "People" }) : null, humans.map((p) => option(p, close)), agents.length ? _jsx("p", { className: "board-options-head", children: "Agents" }) : null, agents.map((p) => option(p, close)), !shown.length
|
|
41
|
+
? _jsxs("p", { className: "board-option-none", children: ["Nobody here called \u201C", typed, "\u201D."] })
|
|
42
|
+
: null] })] })) }));
|
|
43
|
+
}
|
|
44
|
+
/** A card's labels: the board's to choose from, or a new one typed. */
|
|
45
|
+
export function LabelPicker({ known, value, onChange, trigger }) {
|
|
46
|
+
const [typed, setTyped] = useState("");
|
|
47
|
+
const has = (label) => value.some((v) => fold(v) === fold(label));
|
|
48
|
+
const toggle = (label) => onChange(has(label) ? value.filter((v) => fold(v) !== fold(label)) : [...value, label]);
|
|
49
|
+
const all = [...value, ...known.filter((k) => !value.some((v) => fold(v) === fold(k)))];
|
|
50
|
+
const shown = all.filter((l) => fold(l).includes(fold(typed)));
|
|
51
|
+
const fresh = typed.trim() && !all.some((l) => fold(l) === fold(typed.trim()))
|
|
52
|
+
? typed.trim().slice(0, 32)
|
|
53
|
+
: undefined;
|
|
54
|
+
return (_jsx(Popover, { label: "Labels", trigger: trigger, width: 280, children: _jsxs("div", { role: "menu", "aria-label": "Labels", children: [_jsx("div", { className: "board-options-search", children: _jsx(Input, { size: "sm", icon: "search", placeholder: "Find or make a label", "aria-label": "Find or make a label", value: typed, maxLength: 32, "data-popover-item": true, autoComplete: "off", onChange: (event) => setTyped(event.target.value), onKeyDown: (event) => {
|
|
55
|
+
if (event.key === "Enter" && (fresh || shown[0])) {
|
|
56
|
+
event.preventDefault();
|
|
57
|
+
toggle(fresh ?? shown[0]);
|
|
58
|
+
setTyped("");
|
|
59
|
+
}
|
|
60
|
+
else
|
|
61
|
+
down(event);
|
|
62
|
+
} }) }), _jsxs("div", { className: "board-options", children: [shown.map((label) => (_jsxs("button", { type: "button", role: "menuitemcheckbox", "aria-checked": has(label), className: "board-option", "data-popover-item": true, onClick: () => toggle(label), children: [_jsx("span", { className: "board-label", "data-hue": hueOf(label), children: _jsx("span", { children: label }) }), _jsx("span", { className: "board-option-text" }), _jsx(Icon, { name: "check", size: 16, className: "board-option-check" })] }, label))), fresh
|
|
63
|
+
? (_jsxs("button", { type: "button", role: "menuitem", className: "board-option", "data-popover-item": true, onClick: () => {
|
|
64
|
+
toggle(fresh);
|
|
65
|
+
setTyped("");
|
|
66
|
+
}, children: [_jsx(Icon, { name: "plus", size: 16 }), _jsx("span", { className: "board-option-text", children: _jsxs("span", { children: ["Make \u201C", fresh, "\u201D"] }) })] }))
|
|
67
|
+
: null, !shown.length && !fresh
|
|
68
|
+
? _jsx("p", { className: "board-option-none", children: "Type a label to make one." })
|
|
69
|
+
: null] })] }) }));
|
|
70
|
+
}
|
|
71
|
+
/** Several of a list at once (a filter's owners or labels), each with how many cards have it. */
|
|
72
|
+
export function ManyPicker({ label, options, value, onChange, trigger, search }) {
|
|
73
|
+
const [typed, setTyped] = useState("");
|
|
74
|
+
const shown = options.filter((o) => fold(o.label).includes(fold(typed)));
|
|
75
|
+
return (_jsx(Popover, { label: label, trigger: trigger, width: 280, children: _jsxs("div", { role: "menu", "aria-label": label, children: [search
|
|
76
|
+
? (_jsx("div", { className: "board-options-search", children: _jsx(Input, { size: "sm", icon: "search", placeholder: search, "aria-label": search, value: typed, "data-popover-item": true, autoComplete: "off", onChange: (event) => setTyped(event.target.value), onKeyDown: down }) }))
|
|
77
|
+
: null, _jsxs("div", { className: "board-options", children: [shown.map((o) => {
|
|
78
|
+
const on = value.includes(o.value);
|
|
79
|
+
return (_jsxs("button", { type: "button", role: "menuitemcheckbox", "aria-checked": on, className: "board-option", "data-popover-item": true, onClick: () => onChange(on ? value.filter((v) => v !== o.value) : [...value, o.value]), children: [o.leading, _jsx("span", { className: "board-option-text", children: _jsx("span", { children: o.label }) }), o.count !== undefined
|
|
80
|
+
? _jsx("span", { className: "board-option-count", children: o.count })
|
|
81
|
+
: null, _jsx(Icon, { name: "check", size: 16, className: "board-option-check" })] }, o.value));
|
|
82
|
+
}), !shown.length ? _jsx("p", { className: "board-option-none", children: "Nothing matches." }) : null] })] }) }));
|
|
83
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Board, Card, Column } from "../../contract.js";
|
|
2
|
+
/** How many hues labels take (see style.ts: `--board-hue-0` … `-7`). */
|
|
3
|
+
export declare const HUES = 8;
|
|
4
|
+
/** A label's hue: from its letters, so it's the same wherever it shows. */
|
|
5
|
+
export declare function hueOf(label: string): number;
|
|
6
|
+
/** A due date as a card shows it: its words, how pressing it is, and the date in full. */
|
|
7
|
+
export type DueShown = {
|
|
8
|
+
text: string;
|
|
9
|
+
tone: "overdue" | "today" | "soon" | "later" | "done";
|
|
10
|
+
title: string;
|
|
11
|
+
};
|
|
12
|
+
/** "Nov 2", or "Nov 2, 2027" in another year than `today`'s. */
|
|
13
|
+
export declare function dayOf(due: string, today: string): string;
|
|
14
|
+
export declare function dueShown(due: string, today: string, done?: boolean): DueShown;
|
|
15
|
+
/** Someone a card can go to: their key, name, and an agent's emoji. */
|
|
16
|
+
export type Someone = {
|
|
17
|
+
key: string;
|
|
18
|
+
kind: "person" | "agent";
|
|
19
|
+
name: string;
|
|
20
|
+
icon?: string;
|
|
21
|
+
/** A quieter line: a person's email, an agent's role. */
|
|
22
|
+
note?: string;
|
|
23
|
+
};
|
|
24
|
+
/** What chat's `thread.agents` says of agents: how each shows. */
|
|
25
|
+
export type Team = {
|
|
26
|
+
here: string[];
|
|
27
|
+
default: string[];
|
|
28
|
+
agents: Record<string, {
|
|
29
|
+
name?: string;
|
|
30
|
+
icon?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
}>;
|
|
33
|
+
};
|
|
34
|
+
/** Names by person id, as their profiles say them (Copilotz's `namesIn`). */
|
|
35
|
+
export type Names = Record<string, string>;
|
|
36
|
+
/**
|
|
37
|
+
* A person's id as a name: their profile's; else an email's first part, or
|
|
38
|
+
* the id itself when it reads as a name (a sign-in's id never does).
|
|
39
|
+
*/
|
|
40
|
+
export declare const personName: (id: string, names?: Names) => string;
|
|
41
|
+
/** Who `key` (`person:ana`, `agent:north`) is, as shown. */
|
|
42
|
+
export declare function someoneOf(key: string, team?: Team, me?: string, names?: Names): Someone;
|
|
43
|
+
/**
|
|
44
|
+
* Who cards here can go to: the space's people (you first) then its agents,
|
|
45
|
+
* by name; and anyone a card already has who's no longer there, kept.
|
|
46
|
+
*/
|
|
47
|
+
export declare function peopleOf(members: {
|
|
48
|
+
member: string;
|
|
49
|
+
}[], team: Team | undefined, me?: string, also?: string[], names?: Names): Someone[];
|
|
50
|
+
/** What the board is filtered by: words, owners (`none` for nobody), labels. */
|
|
51
|
+
export type Filters = {
|
|
52
|
+
search: string;
|
|
53
|
+
assignees: string[];
|
|
54
|
+
labels: string[];
|
|
55
|
+
};
|
|
56
|
+
export declare const NO_FILTERS: Filters;
|
|
57
|
+
export declare const filtering: (f: Filters) => boolean;
|
|
58
|
+
/** Whether a card shows under the filters: every word in it, one of the owners, one of the labels. */
|
|
59
|
+
export declare function kept(card: Card, f: Filters, names?: (key: string) => string): boolean;
|
|
60
|
+
/** Every label on a board's cards, once each (as first written), most used first. */
|
|
61
|
+
export declare function labelsOn(cards: Card[]): {
|
|
62
|
+
label: string;
|
|
63
|
+
count: number;
|
|
64
|
+
}[];
|
|
65
|
+
/** A move on its way: where a card is going, until the board says it's there. */
|
|
66
|
+
export type Pending = Record<string, {
|
|
67
|
+
column: string;
|
|
68
|
+
order: number;
|
|
69
|
+
}>;
|
|
70
|
+
/** A board's cards by column, in order, with pending moves applied (cards of no column, last). */
|
|
71
|
+
export declare function byColumn(board: Board, cards: Card[], pending?: Pending): Map<string, Card[]>;
|
|
72
|
+
/** Whether a column's cards are done: there, a past due date isn't overdue. */
|
|
73
|
+
export declare const isDone: (column: Column) => boolean;
|
|
74
|
+
/** A Markdown description, as a card's mark says it: whether it says anything. */
|
|
75
|
+
export declare const says: (card: Pick<Card, "description">) => boolean;
|
|
76
|
+
/** A board's card count, as words: "1 card", "12 cards". */
|
|
77
|
+
export declare const counted: (n: number, one?: string, many?: string) => string;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boards as their web front end says them, pure (so tested): a label's hue
|
|
3
|
+
* (the same label is the same colour everywhere), a due date against today
|
|
4
|
+
* (overdue, today, soon), who someone is (people by their profiles' names,
|
|
5
|
+
* agents by the name they're shown as, with their emoji), what a filter keeps, and
|
|
6
|
+
* a board's cards by column, with moves still on their way shown where
|
|
7
|
+
* they're going.
|
|
8
|
+
*/
|
|
9
|
+
import { nameOf } from "copilotz/plugins/access/contract";
|
|
10
|
+
import { fold, stageOf } from "../../shared/columns.js";
|
|
11
|
+
import { daysUntil } from "../../shared/dates.js";
|
|
12
|
+
import { byOrder } from "../../shared/order.js";
|
|
13
|
+
/** How many hues labels take (see style.ts: `--board-hue-0` … `-7`). */
|
|
14
|
+
export const HUES = 8;
|
|
15
|
+
/** A label's hue: from its letters, so it's the same wherever it shows. */
|
|
16
|
+
export function hueOf(label) {
|
|
17
|
+
let h = 0;
|
|
18
|
+
for (const c of label.trim().toLowerCase())
|
|
19
|
+
h = (h * 31 + c.codePointAt(0)) >>> 0;
|
|
20
|
+
return h % HUES;
|
|
21
|
+
}
|
|
22
|
+
const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
23
|
+
/** "Nov 2", or "Nov 2, 2027" in another year than `today`'s. */
|
|
24
|
+
export function dayOf(due, today) {
|
|
25
|
+
const [y, m, d] = due.split("-").map(Number);
|
|
26
|
+
const year = Number(today.slice(0, 4));
|
|
27
|
+
return `${MONTHS[m - 1]} ${d}${y !== year ? `, ${y}` : ""}`;
|
|
28
|
+
}
|
|
29
|
+
export function dueShown(due, today, done = false) {
|
|
30
|
+
const days = daysUntil(due, today);
|
|
31
|
+
const day = dayOf(due, today);
|
|
32
|
+
const title = days === 0
|
|
33
|
+
? "Due today"
|
|
34
|
+
: days > 0
|
|
35
|
+
? `Due in ${days} day${days === 1 ? "" : "s"}`
|
|
36
|
+
: `${-days} day${days === -1 ? "" : "s"} overdue`;
|
|
37
|
+
if (done)
|
|
38
|
+
return { text: day, tone: "done", title: `Was due ${day}` };
|
|
39
|
+
if (days < 0) {
|
|
40
|
+
return { text: `Overdue · ${days === -1 ? "yesterday" : day}`, tone: "overdue", title };
|
|
41
|
+
}
|
|
42
|
+
if (days === 0)
|
|
43
|
+
return { text: "Today", tone: "today", title };
|
|
44
|
+
if (days === 1)
|
|
45
|
+
return { text: "Tomorrow", tone: "soon", title };
|
|
46
|
+
return { text: day, tone: days <= 3 ? "soon" : "later", title };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A person's id as a name: their profile's; else an email's first part, or
|
|
50
|
+
* the id itself when it reads as a name (a sign-in's id never does).
|
|
51
|
+
*/
|
|
52
|
+
export const personName = (id, names = {}) => names[id] ?? (/^[^:@\s]+@/.test(id) ? id.split("@")[0] : nameOf(id, names));
|
|
53
|
+
/** Who `key` (`person:ana`, `agent:north`) is, as shown. */
|
|
54
|
+
export function someoneOf(key, team, me, names) {
|
|
55
|
+
const at = key.indexOf(":");
|
|
56
|
+
const kind = key.slice(0, at) === "agent" ? "agent" : "person";
|
|
57
|
+
const id = key.slice(at + 1);
|
|
58
|
+
if (kind === "agent") {
|
|
59
|
+
const agent = team?.agents[id];
|
|
60
|
+
return {
|
|
61
|
+
key,
|
|
62
|
+
kind,
|
|
63
|
+
name: agent?.name || id,
|
|
64
|
+
...(agent?.icon ? { icon: agent.icon } : {}),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const name = personName(id, names);
|
|
68
|
+
return {
|
|
69
|
+
key,
|
|
70
|
+
kind,
|
|
71
|
+
name: id === me ? `${name} (you)` : name,
|
|
72
|
+
...(/^[^:@\s]+@/.test(id) ? { note: id } : {}),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Who cards here can go to: the space's people (you first) then its agents,
|
|
77
|
+
* by name; and anyone a card already has who's no longer there, kept.
|
|
78
|
+
*/
|
|
79
|
+
export function peopleOf(members, team, me, also = [], names) {
|
|
80
|
+
const keys = [...new Set([...members.map((m) => m.member), ...also])]
|
|
81
|
+
.filter((k) => k.startsWith("person:") || k.startsWith("agent:"));
|
|
82
|
+
const all = keys.map((k) => someoneOf(k, team, me, names));
|
|
83
|
+
const rank = (s) => s.kind === "person" ? (s.key === `person:${me}` ? 0 : 1) : 2;
|
|
84
|
+
return all.sort((a, b) => rank(a) - rank(b) || a.name.localeCompare(b.name, undefined, { sensitivity: "base" }));
|
|
85
|
+
}
|
|
86
|
+
export const NO_FILTERS = { search: "", assignees: [], labels: [] };
|
|
87
|
+
export const filtering = (f) => !!f.search.trim() || f.assignees.length > 0 || f.labels.length > 0;
|
|
88
|
+
/** Whether a card shows under the filters: every word in it, one of the owners, one of the labels. */
|
|
89
|
+
export function kept(card, f, names = (k) => k) {
|
|
90
|
+
if (f.assignees.length && !f.assignees.includes(card.assignee ?? "none"))
|
|
91
|
+
return false;
|
|
92
|
+
if (f.labels.length &&
|
|
93
|
+
!card.labels?.some((l) => f.labels.some((wanted) => fold(wanted) === fold(l))))
|
|
94
|
+
return false;
|
|
95
|
+
const words = fold(f.search).split(" ").filter(Boolean);
|
|
96
|
+
if (!words.length)
|
|
97
|
+
return true;
|
|
98
|
+
const text = fold([
|
|
99
|
+
card.title,
|
|
100
|
+
card.description ?? "",
|
|
101
|
+
...(card.labels ?? []),
|
|
102
|
+
card.assignee ? names(card.assignee) : "",
|
|
103
|
+
]
|
|
104
|
+
.join(" "));
|
|
105
|
+
return words.every((w) => text.includes(w));
|
|
106
|
+
}
|
|
107
|
+
/** Every label on a board's cards, once each (as first written), most used first. */
|
|
108
|
+
export function labelsOn(cards) {
|
|
109
|
+
const counts = new Map();
|
|
110
|
+
for (const card of cards) {
|
|
111
|
+
for (const label of card.labels ?? []) {
|
|
112
|
+
const key = fold(label);
|
|
113
|
+
const seen = counts.get(key);
|
|
114
|
+
if (seen)
|
|
115
|
+
seen.count++;
|
|
116
|
+
else
|
|
117
|
+
counts.set(key, { label, count: 1 });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return [...counts.values()].sort((a, b) => b.count - a.count || a.label.localeCompare(b.label));
|
|
121
|
+
}
|
|
122
|
+
/** A board's cards by column, in order, with pending moves applied (cards of no column, last). */
|
|
123
|
+
export function byColumn(board, cards, pending = {}) {
|
|
124
|
+
const placed = cards.map((c) => pending[c._id] ? { ...c, ...pending[c._id] } : c);
|
|
125
|
+
const columns = new Map(board.columns.map((c) => [c.id, []]));
|
|
126
|
+
for (const card of byOrder(placed)) {
|
|
127
|
+
(columns.get(card.column) ?? columns.get(board.columns[0]?.id ?? "") ?? []).push(card);
|
|
128
|
+
}
|
|
129
|
+
return columns;
|
|
130
|
+
}
|
|
131
|
+
/** Whether a column's cards are done: there, a past due date isn't overdue. */
|
|
132
|
+
export const isDone = (column) => stageOf(column) === "done";
|
|
133
|
+
/** A Markdown description, as a card's mark says it: whether it says anything. */
|
|
134
|
+
export const says = (card) => !!card.description?.trim();
|
|
135
|
+
/** A board's card count, as words: "1 card", "12 cards". */
|
|
136
|
+
export const counted = (n, one = "card", many = `${one}s`) => `${n} ${n === 1 ? one : many}`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An agent's call to a board's tool, in a conversation (kind `board.step`,
|
|
3
|
+
* chat's `toolViews` for the six tools): one compact line, what happened
|
|
4
|
+
* ("Created “Ship pricing page” in To do", "Moved “Ship pricing page” from
|
|
5
|
+
* To do to Doing"), and the board as a link (to the card, when there's
|
|
6
|
+
* one); "Moving a card…" while it runs; what went wrong, plainly, when it
|
|
7
|
+
* did. It reads the tool's answer back (shared/said.ts), so it says what
|
|
8
|
+
* changed then, whatever the board says now.
|
|
9
|
+
*/
|
|
10
|
+
import type { ReactNode } from "react";
|
|
11
|
+
import type { ViewContext } from "copilotz";
|
|
12
|
+
import type { ShownCall } from "copilotz/plugins/agents/contract";
|
|
13
|
+
export declare const boardStepView: (call: ShownCall, ctx: ViewContext<ReactNode>) => ReactNode;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Icon, Spinner } from "copilotz/web";
|
|
3
|
+
import { boardPath } from "../../contract.js";
|
|
4
|
+
import { heard } from "../../shared/said.js";
|
|
5
|
+
import { Glyph } from "./glyphs.js";
|
|
6
|
+
import { STYLE } from "./style.js";
|
|
7
|
+
/** What each tool says while it runs. */
|
|
8
|
+
const RUNNING = {
|
|
9
|
+
list_boards: "Looking at the boards…",
|
|
10
|
+
read_board: "Reading the board…",
|
|
11
|
+
create_board: "Making a board…",
|
|
12
|
+
create_card: "Adding a card…",
|
|
13
|
+
update_card: "Changing a card…",
|
|
14
|
+
move_card: "Moving a card…",
|
|
15
|
+
};
|
|
16
|
+
/** A line with what's in quotes in bold: the titles and names it mentions. */
|
|
17
|
+
function said(text) {
|
|
18
|
+
return text.split(/(“[^”]*”)/).map((part, i) => part.startsWith("“") ? _jsx("b", { children: part }, i) : part);
|
|
19
|
+
}
|
|
20
|
+
export const boardStepView = (call, ctx) => {
|
|
21
|
+
const style = _jsx("style", { href: "boards-web", precedence: "copilotz", children: STYLE });
|
|
22
|
+
const space = typeof ctx.hints.in === "string" ? ctx.hints.in : undefined;
|
|
23
|
+
if (ctx.hints.running === true) {
|
|
24
|
+
return (_jsxs("span", { className: "board-step", children: [style, _jsx(Spinner, { size: 14 }), _jsx("span", { children: RUNNING[call.name] ?? "Working on a board…" })] }));
|
|
25
|
+
}
|
|
26
|
+
const answer = heard(call.output);
|
|
27
|
+
const link = (board, card) => (_jsxs("a", { className: "board-step-link", href: boardPath(board.id, space, card), children: [_jsx(Glyph, { name: "board", size: 13 }), _jsx("span", { children: board.name })] }, board.id));
|
|
28
|
+
if (!answer.ok) {
|
|
29
|
+
const quiet = call.name === "list_boards" && /^No boards/.test(answer.head);
|
|
30
|
+
return (_jsxs("span", { className: "board-step", children: [style, _jsx("span", { className: "board-step-mark", "data-failed": quiet ? undefined : "", children: quiet ? _jsx(Glyph, { name: "board", size: 13 }) : _jsx(Icon, { name: "alert", size: 13 }) }), _jsx("span", { className: "board-step-head", "data-failed": true, children: answer.head || "The board didn't answer." })] }));
|
|
31
|
+
}
|
|
32
|
+
const cards = /: \d+ columns, (\d+) cards?/.exec(call.output ?? "")?.[1];
|
|
33
|
+
const head = call.name === "read_board"
|
|
34
|
+
? _jsx(_Fragment, { children: "Read the board" })
|
|
35
|
+
: call.name === "list_boards"
|
|
36
|
+
? _jsxs(_Fragment, { children: ["Looked at ", answer.boards.length === 1 ? "the board" : `${answer.boards.length} boards`] })
|
|
37
|
+
: _jsx(_Fragment, { children: said(call.name === "create_board" ? "Made a board" : answer.head) });
|
|
38
|
+
return (_jsxs("span", { className: "board-step", children: [style, _jsx("span", { className: "board-step-mark", children: _jsx(Glyph, { name: "board", size: 13 }) }), _jsxs("span", { className: "board-step-head", children: [head, " ", answer.boards.slice(0, 3).map((b) => link(b, answer.card)), cards && call.name === "read_board"
|
|
39
|
+
? _jsxs("span", { className: "board-step-note", children: ["\u00B7 ", cards, " card", cards === "1" ? "" : "s"] })
|
|
40
|
+
: null] })] }));
|
|
41
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boards' layout on the web, on the theme's variables: a board (its header,
|
|
3
|
+
* filters, and columns side by side, scrolling sideways; stacked in a side
|
|
4
|
+
* panel), its cards (labels, title, due date, a mark for a description, who
|
|
5
|
+
* owns it), the slot a dragged card would land in and the copy that follows
|
|
6
|
+
* the pointer, a card's details (a dialog; a sheet on a phone), a space's
|
|
7
|
+
* boards (none yet, one, several), and an agent's call to a board's tool in
|
|
8
|
+
* a conversation. Only layout: the pieces are the toolkit's.
|
|
9
|
+
*/
|
|
10
|
+
export declare const STYLE = "\n.board, .board-ghost, .card-sheet, .boards, .board-step {\n --board-lane: color-mix(in oklab, var(--muted) 72%, var(--background));\n --board-hue-0: var(--chart-1);\n --board-hue-1: var(--chart-2);\n --board-hue-2: var(--chart-3);\n --board-hue-3: var(--chart-4);\n --board-hue-4: var(--chart-5);\n --board-hue-5: color-mix(in oklab, var(--chart-1) 55%, var(--chart-5));\n --board-hue-6: color-mix(in oklab, var(--chart-3) 50%, var(--chart-1));\n --board-hue-7: color-mix(in oklab, var(--chart-2) 50%, var(--chart-5));\n}\n@media (prefers-color-scheme: dark) {\n .board, .board-ghost, .card-sheet, .boards, .board-step {\n --board-lane: color-mix(in oklab, var(--muted) 55%, var(--background));\n }\n}\n.board-glyph { flex: none; display: inline-block; vertical-align: middle; }\n.board-stage { flex: none; color: var(--muted-foreground); }\n.board-stage[data-stage=todo] { color: color-mix(in oklab, var(--foreground) 50%, var(--background)); }\n.board-stage[data-stage=doing] { color: var(--warning); }\n.board-stage[data-stage=review] { color: var(--info); }\n.board-stage[data-stage=blocked] { color: var(--destructive); }\n.board-stage[data-stage=done] { color: var(--success); }\n.board-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;\n clip-path: inset(50%); white-space: nowrap; border: 0; }\n\n/* A board: its head, its filters, then its columns */\n.board { --board-col: 284px; container: board / inline-size; display: flex; flex-direction: column; gap: 14px;\n min-width: 0; min-height: 0; }\n.board[data-mode=page] { flex: 1; }\n.board-head { display: grid; gap: 4px; min-width: 0; }\n.board-head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }\n.board-head-title { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0;\n font-family: var(--font-display); font-size: 19px; font-weight: 660; letter-spacing: -.015em; }\n.board-head-title > a { min-width: 0; overflow: hidden; color: inherit; text-decoration: none; text-overflow: ellipsis;\n white-space: nowrap; }\n.board-head-title > a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }\n.board-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }\n.board-name { position: relative; display: inline; isolation: isolate; max-width: 100%; margin: 0; padding: 0; border: 0;\n background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: text; }\n.board-name::before { content: \"\"; position: absolute; inset: -2px -7px; z-index: -1; border-radius: var(--radius-md);\n transition: background-color .12s; }\n.board-name:hover::before { background: var(--accent); }\n.board-name:focus-visible { outline: none; }\n.board-name:focus-visible::before { outline: 2px solid var(--ring); }\n.board-about { display: block; max-width: 72ch; margin: 2px -8px 0; padding: 4px 8px; border: 0; border-radius: var(--radius-md);\n background: transparent; color: var(--muted-foreground); font: inherit; font-size: 14px; line-height: 1.5;\n text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; transition: background-color .12s; }\nbutton.board-about:hover { background: var(--accent); color: var(--foreground); }\n.board-about[data-empty] { color: color-mix(in oklab, var(--muted-foreground) 80%, transparent); font-style: normal; }\n.board-about-edit { display: grid; gap: 8px; max-width: 72ch; }\n.board-about-edit-end { display: flex; justify-content: flex-end; gap: 6px; }\n.board-error { margin: 0; color: var(--destructive-text); font-size: 13px; }\n\n.board-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }\n.board-search { width: 230px; }\n.board-filter[data-on] { border-color: var(--primary-border); background: var(--primary-soft); color: var(--primary-text); }\n.board-filter-faces { display: inline-flex; margin-left: 2px; }\n.board-filter-faces > * + * { margin-left: -6px; }\n.board-filter-faces .copilotz-avatar { outline: 2px solid var(--card); }\n.board-toolbar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted-foreground);\n font-size: 12.5px; font-variant-numeric: tabular-nums; }\n\n/* The columns, side by side */\n.board-scroller { display: flex; align-items: flex-start; gap: 12px; min-height: 0; margin: 0 -4px; padding: 2px 4px 14px;\n overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-padding-inline: 4px;\n scrollbar-width: thin; }\n.board[data-mode=page] .board-scroller { flex: 1; align-items: stretch; min-height: 300px; }\n.board-column { flex: 0 0 var(--board-col); display: flex; flex-direction: column; width: var(--board-col); min-height: 0;\n max-height: 100%; border-radius: var(--radius-xl); background: var(--board-lane); scroll-snap-align: start;\n transition: background-color .15s, outline-color .15s; }\n.board-column[data-over] { background: color-mix(in oklab, var(--ring) 7%, var(--board-lane));\n outline: 1px solid color-mix(in oklab, var(--ring) 30%, transparent); outline-offset: -1px; }\n.board-column-head { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 6px 6px 12px; }\n.board-column-name { flex: 0 1 auto; min-width: 0; margin: 0; padding: 2px 4px; margin-left: -4px; overflow: hidden;\n border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--foreground); font: inherit;\n font-size: 13.5px; font-weight: 650; text-align: left; text-overflow: ellipsis; white-space: nowrap; }\nbutton.board-column-name { cursor: text; }\nbutton.board-column-name:hover { background: color-mix(in oklab, var(--foreground) 6%, transparent); }\n.board-column-name:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }\n.board-column-rename { flex: 1; min-width: 0; }\n.board-column-rename .copilotz-input { height: 30px; }\n.board-column-count { color: var(--muted-foreground); font-size: 12.5px; font-weight: 550; font-variant-numeric: tabular-nums; }\n.board-column-tools { display: flex; align-items: center; gap: 0; margin-left: auto; opacity: 0; transition: opacity .12s; }\n.board-column:is(:hover, :focus-within) .board-column-tools, .board-column-tools:has([aria-expanded=true]) { opacity: 1; }\n.board-list { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 8px; margin: 0;\n padding: 2px 8px 4px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; list-style: none;\n scrollbar-width: thin; }\n.board-list:empty::after { content: \"\"; display: block; min-height: 40px; }\n.board-column-foot { padding: 2px 8px 8px; }\n.board-add { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 34px; padding: 0 8px; border: 0;\n border-radius: var(--radius-md); background: transparent; color: var(--muted-foreground); font: inherit; font-size: 13px;\n font-weight: 560; text-align: left; cursor: pointer; transition: background-color .12s, color .12s; }\n.board-add:hover { background: color-mix(in oklab, var(--foreground) 6%, transparent); color: var(--foreground); }\n.board-add:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }\n.board-quick { display: grid; gap: 8px; padding: 8px; border: 1px solid var(--ring); border-radius: var(--radius-lg);\n background: var(--card); box-shadow: var(--shadow-sm); }\n.board-quick .copilotz-textarea { font-size: 14px; font-weight: 520; }\n.board-quick-end { display: flex; align-items: center; justify-content: space-between; gap: 6px; }\n.board-quick-hint { color: var(--muted-foreground); font-size: 12px; }\n.board-quick-hint .copilotz-kbd { margin: 0 1px; }\n.board-quick-buttons { display: flex; gap: 4px; }\n.board-grow { margin-right: auto; }\n.board-column-error { padding: 0 12px 6px; }\n.card-sheet-say { margin: 0; }\n.board-new-column { flex: 0 0 var(--board-col); display: grid; align-content: start; gap: 8px; width: var(--board-col); }\n.board-new-column > button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;\n border: 1.5px dashed var(--input); border-radius: var(--radius-xl); background: transparent; color: var(--muted-foreground);\n font: inherit; font-size: 13.5px; font-weight: 560; cursor: pointer; transition: border-color .15s, color .15s, background-color .15s; }\n.board-new-column > button:hover { border-color: var(--ring); background: var(--board-lane); color: var(--foreground); }\n.board-new-column > button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }\n.board-new-column form { display: grid; gap: 8px; padding: 10px; border-radius: var(--radius-xl); background: var(--board-lane); }\n.board-new-column-end { display: flex; justify-content: flex-end; gap: 6px; }\n\n/* A card */\n.board-card { position: relative; flex: none; border: 1px solid var(--border); border-radius: var(--radius-lg);\n background: var(--card); color: var(--card-foreground); box-shadow: var(--shadow-sm); cursor: grab;\n touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;\n transition: border-color .15s, box-shadow .15s, opacity .15s; }\n.board-card:hover { border-color: var(--input); box-shadow: var(--shadow-md); }\n.board-card[data-lifted] { display: none; }\n.board-card[data-held] { z-index: 1; border-color: var(--ring); box-shadow: var(--shadow-lg);\n outline: 2px solid color-mix(in oklab, var(--ring) 40%, transparent); outline-offset: 2px; rotate: .8deg; }\n.board-card[data-busy] { opacity: .7; }\n.board-card-open { display: grid; gap: 7px; width: 100%; padding: 10px 12px; border: 0; border-radius: inherit;\n background: transparent; color: inherit; font: inherit; text-align: left; cursor: inherit; }\n.board-card-open:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }\n.board-card-open > :first-child { padding-right: 22px; }\n.board-card-labels { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }\n.board-label { --hue: var(--board-hue-0); display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 20px;\n padding: 0 8px 0 7px; border-radius: var(--radius-full); background: color-mix(in oklab, var(--hue) 13%, var(--card));\n color: color-mix(in oklab, var(--hue) 70%, var(--foreground)); font-size: 11.5px; font-weight: 620; line-height: 1;\n white-space: nowrap; }\n.board-label::before { content: \"\"; flex: none; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--hue); }\n.board-label > span { min-width: 0; overflow: hidden; line-height: 1.4; text-overflow: ellipsis; }\n.board-label[data-hue=\"1\"] { --hue: var(--board-hue-1); }\n.board-label[data-hue=\"2\"] { --hue: var(--board-hue-2); }\n.board-label[data-hue=\"3\"] { --hue: var(--board-hue-3); }\n.board-label[data-hue=\"4\"] { --hue: var(--board-hue-4); }\n.board-label[data-hue=\"5\"] { --hue: var(--board-hue-5); }\n.board-label[data-hue=\"6\"] { --hue: var(--board-hue-6); }\n.board-label[data-hue=\"7\"] { --hue: var(--board-hue-7); }\n.board-card-title { display: -webkit-box; overflow: hidden; font-size: 14px; font-weight: 560; line-height: 1.42;\n overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }\n.board-card-meta { display: flex; align-items: center; gap: 8px; min-height: 22px; color: var(--muted-foreground);\n font-size: 12px; }\n.board-card-mark { display: inline-flex; align-items: center; color: var(--muted-foreground); }\n.board-card-who { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; min-width: 0; }\n.board-due { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px 0 6px;\n border-radius: var(--radius-sm); background: var(--muted); color: var(--muted-foreground); font-size: 11.5px;\n font-weight: 620; white-space: nowrap; font-variant-numeric: tabular-nums; }\n.board-due[data-tone=overdue] { background: var(--destructive-soft); color: var(--destructive-text); }\n.board-due[data-tone=today] { background: var(--warning-soft); color: var(--warning-text); }\n.board-due[data-tone=soon] { color: var(--foreground); }\n.board-due[data-tone=done] { background: transparent; padding-left: 0; text-decoration: line-through;\n text-decoration-color: color-mix(in oklab, var(--muted-foreground) 60%, transparent); }\n.board-card-menu { position: absolute; top: 5px; right: 5px; opacity: 0; transition: opacity .12s; }\n.board-card:is(:hover, :focus-within) .board-card-menu, .board-card-menu:has([aria-expanded=true]) { opacity: 1; }\n@media (pointer: coarse) {\n .board-card-menu { opacity: .75; }\n .board-column-tools { opacity: 1; }\n}\n\n/* Where a dragged card would land, and the copy that follows the pointer */\n.board-slot { flex: none; border: 1.5px dashed color-mix(in oklab, var(--ring) 60%, transparent); border-radius: var(--radius-lg);\n background: color-mix(in oklab, var(--ring) 9%, transparent); animation: board-slot .16s cubic-bezier(.2, .8, .2, 1); }\n@keyframes board-slot { from { height: 0; opacity: 0; } }\n.board-ghost { position: fixed; top: 0; left: 0; z-index: 2147483000; margin: 0; list-style: none; pointer-events: none;\n cursor: grabbing; border-color: var(--input); box-shadow: var(--shadow-lg); rotate: 2.2deg; scale: 1.035;\n animation: board-lift .16s cubic-bezier(.2, .8, .2, 1); will-change: translate; }\n@keyframes board-lift { from { rotate: 0deg; scale: 1; box-shadow: var(--shadow-sm); } }\n.board-ghost .board-card-menu { display: none; }\n.board-ghost-settling { rotate: 0deg; scale: 1; box-shadow: var(--shadow-md);\n transition: translate .17s cubic-bezier(.2, .8, .2, 1), rotate .17s, scale .17s, width .17s, box-shadow .17s; }\n:root[data-board-dragging], :root[data-board-dragging] * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }\n@media (prefers-reduced-motion: reduce) {\n .board-slot, .board-ghost { animation: none; }\n .board-ghost { rotate: 0deg; scale: 1; }\n}\n\n/* In a side panel: the columns stacked, each folding */\n.board[data-mode=panel] { --board-col: auto; gap: 10px; }\n.board[data-mode=panel] .board-scroller { flex-direction: column; align-items: stretch; gap: 8px; margin: 0; padding: 0;\n overflow: visible; scroll-snap-type: none; }\n.board[data-mode=panel] .board-column { flex: none; width: auto; max-height: none; }\n.board[data-mode=panel] .board-list { overflow: visible; }\n.board[data-mode=panel] .board-list[data-folded] { display: none; }\n.board[data-mode=panel] .board-column-head { min-height: 38px; padding: 4px 4px 4px 6px; }\n.board[data-mode=panel] .board-search { flex: 1 1 140px; width: auto; }\n.board[data-mode=panel] .board-new-column { width: auto; flex: none; }\n.board-fold { display: grid; place-items: center; width: 24px; height: 24px; margin-right: -2px; padding: 0; border: 0;\n border-radius: var(--radius-sm); background: transparent; color: var(--muted-foreground); cursor: pointer;\n transition: rotate .15s, background-color .12s; }\n.board-fold:hover { background: color-mix(in oklab, var(--foreground) 6%, transparent); color: var(--foreground); }\n.board-fold[aria-expanded=false] { rotate: -90deg; }\n.board-fold:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }\n\n@container board (max-width: 640px) {\n .board { --board-col: min(82cqi, 310px); }\n .board:not([data-mode=panel]) .board-scroller { scroll-snap-type: x proximity; }\n .board-search { flex: 1 1 100%; width: auto; }\n .board-count { display: none; }\n}\n\n/* Choosing among people, labels, columns: a popover's list */\n.board-options { display: grid; gap: 1px; max-height: 320px; overflow: auto; }\n.board-options-head { margin: 6px 8px 2px; color: var(--muted-foreground); font-size: 11px; font-weight: 680;\n letter-spacing: .05em; text-transform: uppercase; }\n.board-options-search { padding: 2px 2px 6px; }\n.board-option { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 4px 8px; border: 0;\n border-radius: var(--radius-md); background: transparent; color: inherit; font: inherit; font-size: 13.5px;\n text-align: left; cursor: pointer; }\n.board-option:is(:hover, :focus-visible) { background: var(--accent); outline: none; }\n.board-option-text { flex: 1; display: grid; min-width: 0; }\n.board-option-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.board-option-note { color: var(--muted-foreground); font-size: 12px; }\n.board-option-count { color: var(--muted-foreground); font-size: 12px; font-variant-numeric: tabular-nums; }\n.board-option-check { flex: none; color: var(--primary-text); visibility: hidden; }\n.board-option[aria-checked=true] .board-option-check, .board-option[aria-selected=true] .board-option-check { visibility: visible; }\n.board-option-none { margin: 10px 8px; color: var(--muted-foreground); font-size: 13px; }\n.board-unassigned { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border: 1.5px dashed var(--input);\n border-radius: var(--radius-full); color: var(--muted-foreground); }\n\n/* A card's details: a dialog, a sheet on a phone */\n.card-sheet { display: flex; flex-direction: column; flex: 1; min-height: 0; max-height: min(88dvh, 880px); }\n.copilotz-drawer .card-sheet { max-height: 88dvh; }\n.card-sheet-head { display: flex; align-items: center; gap: 6px; padding: 14px 12px 2px 18px; }\n.card-sheet-where { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted-foreground);\n font-size: 13px; }\n.card-sheet-where a { overflow: hidden; color: inherit; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }\n.card-sheet-where a:hover { color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; }\n.card-sheet-head-end { display: flex; align-items: center; gap: 2px; margin-left: auto; }\n.card-sheet-body { display: grid; align-content: start; gap: 18px; flex: 1; min-height: 0; padding: 6px 22px 20px;\n overflow: auto; overscroll-behavior: contain; }\n.card-sheet-title.copilotz-textarea { font-family: var(--font-display); font-size: 22px; font-weight: 650; line-height: 1.3;\n letter-spacing: -.015em; }\n.card-props { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: center; gap: 4px 12px; margin: 0; }\n.card-props dt { display: flex; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: 13px; font-weight: 560; }\n.card-props dt .board-glyph, .card-props dt .copilotz-icon { opacity: .85; }\n.card-props dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; min-height: 36px;\n margin: 0 0 0 -8px; }\n.card-prop { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 32px;\n padding: 0 10px 0 8px; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit; font: inherit;\n font-size: 13.5px; font-weight: 540; text-align: left; cursor: pointer; transition: background-color .12s; }\n.card-prop:hover { background: var(--accent); }\n.card-prop:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }\n.card-prop[data-empty] { color: var(--muted-foreground); font-weight: 500; }\n.card-prop > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.card-prop-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }\n.card-prop-labels .board-label { height: 24px; padding-right: 3px; }\n.card-label-x { display: grid; place-items: center; width: 18px; height: 18px; margin-left: 2px; padding: 0; border: 0;\n border-radius: var(--radius-full); background: transparent; color: inherit; cursor: pointer; opacity: .7; }\n.card-label-x:hover { background: color-mix(in oklab, var(--hue) 22%, transparent); opacity: 1; }\n.card-label-x:focus-visible { outline: 2px solid var(--ring); }\n.card-due { display: flex; align-items: center; gap: 6px; padding-left: 8px; }\n.card-due .copilotz-input { height: 34px; width: 170px; }\n.card-due-said { color: var(--muted-foreground); font-size: 12.5px; }\n.card-due-said[data-tone=overdue] { color: var(--destructive-text); font-weight: 600; }\n.card-due-said[data-tone=today] { color: var(--warning-text); font-weight: 600; }\n.card-desc { display: grid; gap: 8px; }\n.card-desc-head { display: flex; align-items: center; gap: 10px; min-height: 30px; }\n.card-desc-head h3 { flex: 1; margin: 0; font-size: 13px; font-weight: 650; color: var(--muted-foreground);\n letter-spacing: .02em; }\n.card-desc-view { display: block; width: calc(100% + 24px); min-height: 64px; margin: 0 -12px; padding: 10px 12px; border: 0;\n border-radius: var(--radius-lg); background: transparent; color: inherit; font: inherit; text-align: left; cursor: text;\n transition: background-color .12s; }\n.card-desc-view:hover { background: color-mix(in oklab, var(--muted) 70%, transparent); }\n.card-desc-view:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }\n.card-desc-view[data-empty] { color: var(--muted-foreground); font-size: 14px; }\n.card-desc-view .copilotz-md { font-size: 14.5px; }\n.card-desc .copilotz-textarea { min-height: 160px; font-size: 14.5px; line-height: 1.6; }\n.card-desc-preview { min-height: 160px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg);\n background: var(--card); }\n.card-desc-end { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }\n.card-desc-end .board-quick-hint { flex: 1; }\n.card-sheet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 16px 12px 22px;\n border-top: 1px solid var(--border); background: color-mix(in oklab, var(--muted) 45%, var(--popover));\n color: var(--muted-foreground); font-size: 12.5px; }\n.card-sheet-foot .copilotz-time { font-size: 12.5px; }\n.card-sheet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; flex: 1; min-width: 0; }\n.card-sheet-meta > span + span::before { content: \"\u00B7\"; margin-right: 8px; }\n.card-sheet-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }\n.card-sheet-error { margin: 0; color: var(--destructive-text); font-size: 13px; }\n@media (max-width: 640px) {\n .card-sheet-body { padding: 4px 16px 18px; }\n .card-props { grid-template-columns: 92px minmax(0, 1fr); }\n .card-sheet-title.copilotz-textarea { font-size: 20px; }\n .card-sheet-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }\n}\n\n/* A board's page */\n.board-page.copilotz-page-full > .copilotz-page-inner { display: flex; flex-direction: column; height: 100%; padding-bottom: 8px; }\n.board-page .copilotz-page-body { display: flex; flex: 1; flex-direction: column; min-height: 0; margin-top: 14px; }\n.board-page .copilotz-page-description { max-width: none; margin-top: 2px; }\n.board-missing, .board-loading { display: grid; gap: 14px; }\n.board-missing { min-height: 60vh; place-items: center; padding: 24px; }\n.board-loading-columns { display: flex; gap: 12px; overflow: hidden; }\n.board-loading-columns > * { flex: 0 0 284px; }\n\n/* A space's boards */\n.boards { container: boards / inline-size; display: grid; gap: 18px; }\n.boards-empty { display: grid; justify-items: center; gap: 20px; padding: 28px 0 8px; }\n.boards-empty .copilotz-empty-text { max-width: 50ch; }\n.boards-preview { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; width: min(100%, 720px);\n padding: 12px; border-radius: var(--radius-2xl); background: var(--board-lane); }\n.boards-preview-column { display: grid; align-content: start; gap: 6px; min-width: 0; }\n.boards-preview-column b { display: flex; align-items: center; gap: 6px; min-width: 0; margin: 2px 2px 4px; overflow: hidden;\n font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }\n.boards-preview-card { height: 30px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card);\n box-shadow: var(--shadow-sm); }\n.boards-preview-card:nth-child(3) { height: 22px; opacity: .7; }\n.boards-teach { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(100%, 720px); margin: 0;\n padding: 0; list-style: none; }\n.boards-teach li { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg);\n background: var(--card); font-size: 13px; line-height: 1.45; }\n.boards-teach b { font-size: 13px; }\n.boards-teach span { color: var(--muted-foreground); }\n.boards-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }\n.boards-head > .copilotz-select { flex: 1; }\n.boards-intro { flex: 1 1 320px; margin: 0; color: var(--muted-foreground); font-size: 14px; line-height: 1.5; }\n.boards-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 0; padding: 0;\n list-style: none; }\n.boards-item { display: grid; gap: 10px; height: 100%; padding: 14px 16px; border: 1px solid var(--border);\n border-radius: var(--radius-xl); background: var(--card); box-shadow: var(--shadow-sm); color: inherit; text-decoration: none;\n transition: border-color .15s, box-shadow .15s; }\n.boards-item:hover { border-color: var(--input); box-shadow: var(--shadow-md); }\n.boards-item:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }\n.boards-item-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; font-weight: 650; }\n.boards-item-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.boards-item-about { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted-foreground); font-size: 13px;\n line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }\n.boards-bar { display: flex; height: 6px; overflow: hidden; border-radius: var(--radius-full); background: var(--muted); gap: 2px; }\n.boards-bar > span { min-width: 4px; background: currentColor; }\n.boards-bar > [data-stage=backlog] { color: color-mix(in oklab, var(--muted-foreground) 45%, var(--muted)); }\n.boards-bar > [data-stage=todo] { color: color-mix(in oklab, var(--foreground) 35%, var(--muted)); }\n.boards-bar > [data-stage=doing] { color: var(--warning); }\n.boards-bar > [data-stage=review] { color: var(--info); }\n.boards-bar > [data-stage=blocked] { color: var(--destructive); }\n.boards-bar > [data-stage=done] { color: var(--success); }\n.boards-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted-foreground);\n font-size: 12.5px; }\n.boards-item-meta .copilotz-time { font-size: 12.5px; }\n.boards-archived summary { cursor: pointer; color: var(--muted-foreground); font-size: 13px; font-weight: 600; }\n.boards-archived[open] summary { margin-bottom: 10px; }\n.boards-new { display: grid; gap: 14px; }\n.boards-new-end { display: flex; justify-content: flex-end; gap: 8px; }\n@container boards (max-width: 560px) {\n .boards-preview { grid-template-columns: repeat(3, minmax(0, 1fr)); }\n .boards-preview-column:nth-child(n + 4) { display: none; }\n .boards-teach { grid-template-columns: 1fr; }\n}\n\n/* A call to a board's tool, in a conversation */\n.board-step { display: inline-flex; align-items: flex-start; gap: 8px; max-width: 100%; color: var(--muted-foreground);\n font-size: 13px; line-height: 24px; }\n.board-step-mark { display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin-top: 1px;\n border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-text); }\n.board-step-mark[data-failed] { background: var(--warning-soft); color: var(--warning-text); }\n.board-step-head { min-width: 0; color: var(--foreground); overflow-wrap: anywhere; }\n.board-step-head b { font-weight: 640; }\n.board-step-head[data-failed] { color: var(--muted-foreground); }\n.board-step-link { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-height: 22px; margin-left: 2px;\n padding: 0 9px 0 7px; border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--card);\n color: var(--foreground); font-size: 12.5px; font-weight: 600; line-height: 1.2; text-decoration: none;\n vertical-align: middle; box-shadow: var(--shadow-sm); transition: border-color .12s, background-color .12s; }\n.board-step-link + .board-step-link { margin-left: 4px; }\n.board-step-note { margin-left: 6px; color: var(--muted-foreground); }\n.board-step-link:hover { border-color: var(--input); background: var(--muted); }\n.board-step-link > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n";
|