@graview/primitives 0.1.64 → 0.1.66
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/README.md +1 -1
- package/dist/app-bar.d.ts +88 -15
- package/dist/app-bar.d.ts.map +1 -1
- package/dist/app-bar.js +177 -131
- package/dist/app-bar.js.map +1 -1
- package/dist/app-menu.d.ts +9 -0
- package/dist/app-menu.d.ts.map +1 -0
- package/dist/app-menu.js +60 -0
- package/dist/app-menu.js.map +1 -0
- package/dist/bar-activity.d.ts +5 -9
- package/dist/bar-activity.d.ts.map +1 -1
- package/dist/bar-activity.js +24 -7
- package/dist/bar-activity.js.map +1 -1
- package/dist/bar-panes.d.ts +5 -5
- package/dist/bar-panes.d.ts.map +1 -1
- package/dist/bar-panes.js +9 -5
- package/dist/bar-panes.js.map +1 -1
- package/dist/bar-suggested.d.ts +9 -1
- package/dist/bar-suggested.d.ts.map +1 -1
- package/dist/bar-suggested.js +11 -17
- package/dist/bar-suggested.js.map +1 -1
- package/dist/better-bar.d.ts +65 -0
- package/dist/better-bar.d.ts.map +1 -0
- package/dist/better-bar.js +252 -0
- package/dist/better-bar.js.map +1 -0
- package/dist/better-panel.d.ts +50 -0
- package/dist/better-panel.d.ts.map +1 -0
- package/dist/better-panel.js +151 -0
- package/dist/better-panel.js.map +1 -0
- package/dist/chat.js +1 -1
- package/dist/chat.js.map +1 -1
- package/dist/editable.d.ts +8 -1
- package/dist/editable.d.ts.map +1 -1
- package/dist/editable.js +140 -16
- package/dist/editable.js.map +1 -1
- package/dist/find.js +3 -3
- package/dist/find.js.map +1 -1
- package/dist/first-look-door.d.ts +2 -2
- package/dist/first-look-door.js +2 -2
- package/dist/first-look.d.ts.map +1 -1
- package/dist/first-look.js +10 -8
- package/dist/first-look.js.map +1 -1
- package/dist/frame.d.ts +2 -2
- package/dist/frame.d.ts.map +1 -1
- package/dist/frame.js +1 -1
- package/dist/frame.js.map +1 -1
- package/dist/here.d.ts +1 -1
- package/dist/here.js +2 -2
- package/dist/here.js.map +1 -1
- package/dist/inbox-pane.d.ts +31 -0
- package/dist/inbox-pane.d.ts.map +1 -0
- package/dist/inbox-pane.js +89 -0
- package/dist/inbox-pane.js.map +1 -0
- package/dist/inbox.d.ts +17 -0
- package/dist/inbox.d.ts.map +1 -0
- package/dist/inbox.js +84 -0
- package/dist/inbox.js.map +1 -0
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/inline-ai-menu.d.ts +4 -2
- package/dist/inline-ai-menu.d.ts.map +1 -1
- package/dist/inline-ai-menu.js +34 -8
- package/dist/inline-ai-menu.js.map +1 -1
- package/dist/kind-stop.d.ts.map +1 -1
- package/dist/kind-stop.js +204 -21
- package/dist/kind-stop.js.map +1 -1
- package/dist/lines-key.d.ts.map +1 -1
- package/dist/lines-key.js +22 -2
- package/dist/lines-key.js.map +1 -1
- package/dist/map-panel.js +98 -6
- package/dist/map-panel.js.map +1 -1
- package/dist/menu-rank.d.ts +25 -0
- package/dist/menu-rank.d.ts.map +1 -0
- package/dist/menu-rank.js +56 -0
- package/dist/menu-rank.js.map +1 -0
- package/dist/menu-suggested.d.ts +54 -0
- package/dist/menu-suggested.d.ts.map +1 -0
- package/dist/menu-suggested.js +140 -0
- package/dist/menu-suggested.js.map +1 -0
- package/dist/menu-told-door.d.ts +17 -0
- package/dist/menu-told-door.d.ts.map +1 -0
- package/dist/menu-told-door.js +49 -0
- package/dist/menu-told-door.js.map +1 -0
- package/dist/menu-told.d.ts +44 -0
- package/dist/menu-told.d.ts.map +1 -0
- package/dist/menu-told.js +90 -0
- package/dist/menu-told.js.map +1 -0
- package/dist/menu-words.d.ts +15 -0
- package/dist/menu-words.d.ts.map +1 -0
- package/dist/menu-words.js +28 -0
- package/dist/menu-words.js.map +1 -0
- package/dist/notify-sheet.js +2 -2
- package/dist/notify-sheet.js.map +1 -1
- package/dist/page-better.d.ts +13 -0
- package/dist/page-better.d.ts.map +1 -0
- package/dist/page-better.js +714 -0
- package/dist/page-better.js.map +1 -0
- package/dist/page-parts.d.ts +41 -0
- package/dist/page-parts.d.ts.map +1 -0
- package/dist/page-parts.js +100 -0
- package/dist/page-parts.js.map +1 -0
- package/dist/pages.d.ts +4 -3
- package/dist/pages.d.ts.map +1 -1
- package/dist/pages.js +4 -3
- package/dist/pages.js.map +1 -1
- package/dist/profile.d.ts +1 -10
- package/dist/profile.d.ts.map +1 -1
- package/dist/profile.js +2 -3
- package/dist/profile.js.map +1 -1
- package/dist/quick-ask-desk.d.ts +16 -0
- package/dist/quick-ask-desk.d.ts.map +1 -1
- package/dist/quick-ask-desk.js +20 -0
- package/dist/quick-ask-desk.js.map +1 -1
- package/dist/quick-ask-door.d.ts.map +1 -1
- package/dist/quick-ask-door.js +5 -0
- package/dist/quick-ask-door.js.map +1 -1
- package/dist/quick-ask-plan.d.ts +52 -0
- package/dist/quick-ask-plan.d.ts.map +1 -0
- package/dist/quick-ask-plan.js +112 -0
- package/dist/quick-ask-plan.js.map +1 -0
- package/dist/quick-ask.d.ts.map +1 -1
- package/dist/quick-ask.js +341 -19
- package/dist/quick-ask.js.map +1 -1
- package/dist/scene-bar.d.ts +1 -1
- package/dist/scene-bar.d.ts.map +1 -1
- package/dist/scene-bar.js +4 -7
- package/dist/scene-bar.js.map +1 -1
- package/dist/scene-css.d.ts.map +1 -1
- package/dist/scene-css.js +16 -6
- package/dist/scene-css.js.map +1 -1
- package/dist/scene-places.d.ts +3 -2
- package/dist/scene-places.d.ts.map +1 -1
- package/dist/scene-places.js +47 -8
- package/dist/scene-places.js.map +1 -1
- package/dist/scene.d.ts +2 -0
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +2 -0
- package/dist/scene.js.map +1 -1
- package/dist/section-better.d.ts +76 -0
- package/dist/section-better.d.ts.map +1 -0
- package/dist/section-better.js +529 -0
- package/dist/section-better.js.map +1 -0
- package/dist/section-door.d.ts +39 -0
- package/dist/section-door.d.ts.map +1 -0
- package/dist/section-door.js +66 -0
- package/dist/section-door.js.map +1 -0
- package/dist/section-menu.d.ts +32 -0
- package/dist/section-menu.d.ts.map +1 -0
- package/dist/section-menu.js +229 -0
- package/dist/section-menu.js.map +1 -0
- package/dist/section-outline.d.ts +8 -0
- package/dist/section-outline.d.ts.map +1 -0
- package/dist/section-outline.js +48 -0
- package/dist/section-outline.js.map +1 -0
- package/dist/section-words.d.ts +32 -0
- package/dist/section-words.d.ts.map +1 -0
- package/dist/section-words.js +116 -0
- package/dist/section-words.js.map +1 -0
- package/dist/shell.d.ts +5 -1
- package/dist/shell.d.ts.map +1 -1
- package/dist/shell.js +5 -2
- package/dist/shell.js.map +1 -1
- package/dist/subject.js +2 -2
- package/dist/subject.js.map +1 -1
- package/dist/suggested.d.ts +21 -10
- package/dist/suggested.d.ts.map +1 -1
- package/dist/suggested.js +43 -64
- package/dist/suggested.js.map +1 -1
- package/dist/told-card.d.ts +66 -0
- package/dist/told-card.d.ts.map +1 -0
- package/dist/told-card.js +197 -0
- package/dist/told-card.js.map +1 -0
- package/dist/told-listed.d.ts +14 -0
- package/dist/told-listed.d.ts.map +1 -0
- package/dist/told-listed.js +46 -0
- package/dist/told-listed.js.map +1 -0
- package/dist/told-panel-door.d.ts +17 -0
- package/dist/told-panel-door.d.ts.map +1 -0
- package/dist/told-panel-door.js +6 -0
- package/dist/told-panel-door.js.map +1 -0
- package/dist/told-panel.d.ts +19 -0
- package/dist/told-panel.d.ts.map +1 -0
- package/dist/told-panel.js +83 -0
- package/dist/told-panel.js.map +1 -0
- package/dist/told-ui.d.ts +5 -0
- package/dist/told-ui.d.ts.map +1 -0
- package/dist/told-ui.js +12 -0
- package/dist/told-ui.js.map +1 -0
- package/dist/when-words.d.ts +21 -0
- package/dist/when-words.d.ts.map +1 -0
- package/dist/when-words.js +43 -0
- package/dist/when-words.js.map +1 -0
- package/dist/workbench/activity.d.ts +44 -0
- package/dist/workbench/activity.d.ts.map +1 -1
- package/dist/workbench/activity.js +74 -59
- package/dist/workbench/activity.js.map +1 -1
- package/dist/workbench/ai-entries.d.ts.map +1 -1
- package/dist/workbench/ai-entries.js +23 -2
- package/dist/workbench/ai-entries.js.map +1 -1
- package/dist/workbench/back-out.js +1 -1
- package/dist/workbench/back-out.js.map +1 -1
- package/dist/workbench/inspector.d.ts.map +1 -1
- package/dist/workbench/inspector.js +366 -27
- package/dist/workbench/inspector.js.map +1 -1
- package/dist/workbench/standing.d.ts.map +1 -1
- package/dist/workbench/standing.js +1 -1
- package/dist/workbench/standing.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { heldAlso, seenOnThisPage, toldHeld } from "./told-listed.js";
|
|
3
|
+
export { seenOnThisPage, toldListed } from "./told-listed.js";
|
|
4
|
+
import { recordsOfTarget } from "@graview/core/catalog";
|
|
5
|
+
import { similarTellings, tellingExamples, tellingOf, toldSeenBy } from "@graview/core/told";
|
|
6
|
+
import { useEffect, useId, useState } from "react";
|
|
7
|
+
/**
|
|
8
|
+
* WHAT A PERSON TELLS GRAVIEW, KEPT FROM THE ANSWER CARD (Roadmap
|
|
9
|
+
* f-menu-learns), fetched with the card.
|
|
10
|
+
*
|
|
11
|
+
* Each Enter or reply on the card is one telling (`@graview/core/told`):
|
|
12
|
+
* the words, what they were on (a kind and ids), the records they were read
|
|
13
|
+
* as, the people they named, what was decided and by which slot, the time
|
|
14
|
+
* it took, and — as the person goes on — how it ended and what they thought
|
|
15
|
+
* of it. It goes to the host's door (`HostAi.told`); with none, nothing is
|
|
16
|
+
* kept and the card draws no rating, because a press that keeps nothing
|
|
17
|
+
* would say something untrue.
|
|
18
|
+
*/
|
|
19
|
+
/** The kind the words are on: the record's, the list's, the selection's first. */
|
|
20
|
+
export function kindOfTarget(store, target) {
|
|
21
|
+
if (target.on === "list")
|
|
22
|
+
return target.kind;
|
|
23
|
+
if (target.on === "lens")
|
|
24
|
+
return target.kind;
|
|
25
|
+
const first = recordsOfTarget(target)[0];
|
|
26
|
+
return first ? store.graph.getNode(first)?.kind : undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* THE LIKE 👍 TELLINGS, AS EXAMPLES FOR THE SLOTS: the top three like the
|
|
30
|
+
* words on this kind that were rated 👍 and are not excluded — given to Jev
|
|
31
|
+
* and the light model by name, and their ids kept on the telling they
|
|
32
|
+
* informed.
|
|
33
|
+
*/
|
|
34
|
+
export function examplesHere(told, store, principal, words, target) {
|
|
35
|
+
// Never in the way of an answer: only what is already at hand, read when the card opened.
|
|
36
|
+
const held = told ? toldHeld(told) : undefined;
|
|
37
|
+
if (!held)
|
|
38
|
+
return { examples: [], ids: [] };
|
|
39
|
+
const kind = kindOfTarget(store, target);
|
|
40
|
+
const like = similarTellings(toldSeenBy(held, seenOnThisPage(store, principal)), { words, ...(kind ? { kind } : {}) }, { reader: principal, rated: true, most: 3 });
|
|
41
|
+
return { examples: tellingExamples(like), ids: like.map((one) => one.telling.id) };
|
|
42
|
+
}
|
|
43
|
+
/** Which slot decided it, from the stages the entry timed. */
|
|
44
|
+
function slotOf(entry) {
|
|
45
|
+
const stages = new Set((entry.stages ?? []).map((one) => one.stage));
|
|
46
|
+
if (stages.has("thinking"))
|
|
47
|
+
return "full";
|
|
48
|
+
if (stages.has("light"))
|
|
49
|
+
return "light";
|
|
50
|
+
if (stages.has("fast"))
|
|
51
|
+
return "graph";
|
|
52
|
+
return (entry.usage ?? []).some((usage) => usage.tier === "thinking") ? "full" : undefined;
|
|
53
|
+
}
|
|
54
|
+
/** What was decided: an act over N records, a plan, an open answer, or nothing it could do. */
|
|
55
|
+
function decidedOf(result, plan) {
|
|
56
|
+
if (result.interaction.outcome === "failed" || (plan && "refused" in plan))
|
|
57
|
+
return { type: "refusal" };
|
|
58
|
+
if (plan && "question" in plan)
|
|
59
|
+
return plan.proposal ? { type: "plan", edits: plan.parts.length } : { type: "refusal" };
|
|
60
|
+
const proposals = result.ghost?.proposals ?? [];
|
|
61
|
+
if (proposals.length > 0) {
|
|
62
|
+
const act = proposals[0].call.name;
|
|
63
|
+
return { type: "act", act, records: new Set(proposals.map((one) => one.record ?? one.id)).size };
|
|
64
|
+
}
|
|
65
|
+
return { type: "answer" };
|
|
66
|
+
}
|
|
67
|
+
/** The records the words named as people: a proposal's values that are records, other than what it acts on. */
|
|
68
|
+
function peopleOf(store, result) {
|
|
69
|
+
const people = new Set();
|
|
70
|
+
for (const proposal of result.ghost?.proposals ?? []) {
|
|
71
|
+
for (const value of Object.values(proposal.call.args)) {
|
|
72
|
+
if (typeof value === "string" && value !== proposal.record && store.graph.getNode(value))
|
|
73
|
+
people.add(value);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return [...people];
|
|
77
|
+
}
|
|
78
|
+
/** The draft of one telling: the words, what they were on, what was decided and how long it took. */
|
|
79
|
+
export function tellingDraftOf(store, asked) {
|
|
80
|
+
const { target, result } = asked;
|
|
81
|
+
const kind = kindOfTarget(store, target);
|
|
82
|
+
const id = target.on === "record" || target.on === "field" ? target.id : undefined;
|
|
83
|
+
const place = target.on === "lens" || target.on === "place" ? target.place : undefined;
|
|
84
|
+
const reading = result.reading ? { which: result.reading.which, kind: result.reading.kind, records: result.reading.records } : undefined;
|
|
85
|
+
const people = peopleOf(store, result);
|
|
86
|
+
const slot = slotOf(result.interaction);
|
|
87
|
+
const decided = decidedOf(result, asked.plan);
|
|
88
|
+
return {
|
|
89
|
+
words: asked.words,
|
|
90
|
+
target: { on: target.on, ...(kind ? { kind } : {}), ...(id ? { id } : {}), ...(place ? { place } : {}) },
|
|
91
|
+
...(reading ? { reading } : {}),
|
|
92
|
+
...(people.length > 0 ? { people } : {}),
|
|
93
|
+
decided,
|
|
94
|
+
...(slot ? { slot } : {}),
|
|
95
|
+
...(result.interaction.stages ? { stages: result.interaction.stages } : {}),
|
|
96
|
+
ms: asked.ms,
|
|
97
|
+
outcome: "previewed",
|
|
98
|
+
...(asked.conversation ? { conversation: asked.conversation } : {}),
|
|
99
|
+
...(asked.follows ? { follows: asked.follows } : {}),
|
|
100
|
+
interaction: result.interaction.id,
|
|
101
|
+
...(asked.examples && asked.examples.length > 0 ? { examples: asked.examples } : {}),
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/** Kept with the host, as the person: the telling, or nothing for a visitor or a door that is not there. */
|
|
105
|
+
export function keepTelling(told, draft, by) {
|
|
106
|
+
if (!told)
|
|
107
|
+
return undefined;
|
|
108
|
+
const telling = tellingOf(draft, by);
|
|
109
|
+
if (!telling)
|
|
110
|
+
return undefined;
|
|
111
|
+
heldAlso(told, telling);
|
|
112
|
+
void Promise.resolve()
|
|
113
|
+
.then(() => told.add(telling))
|
|
114
|
+
.catch(() => undefined);
|
|
115
|
+
return telling;
|
|
116
|
+
}
|
|
117
|
+
/** A change to a kept telling, handed to the host and never awaited. */
|
|
118
|
+
export function changeTelling(told, id, change) {
|
|
119
|
+
if (!told)
|
|
120
|
+
return;
|
|
121
|
+
void Promise.resolve()
|
|
122
|
+
.then(() => told.change(id, change))
|
|
123
|
+
.catch(() => undefined);
|
|
124
|
+
}
|
|
125
|
+
/** How an interaction's entry ended, as a telling says it. */
|
|
126
|
+
const OUTCOME_OF = { accepted: "accepted", partly: "accepted", drawn: "accepted", dismissed: "declined" };
|
|
127
|
+
/**
|
|
128
|
+
* HOW IT ENDED, HEARD FROM THE DESK: the change it proposed accepted (on the
|
|
129
|
+
* card or on the tray once the card is put away), dismissed, or undone — an
|
|
130
|
+
* undo a quiet sign, never a 👎. Heard until it is undone, or for half an
|
|
131
|
+
* hour.
|
|
132
|
+
*/
|
|
133
|
+
export function watchTelling(desk, told, telling) {
|
|
134
|
+
let said;
|
|
135
|
+
const hear = () => {
|
|
136
|
+
const entry = desk.get().entries.find((one) => one.id === telling.interaction);
|
|
137
|
+
if (!entry)
|
|
138
|
+
return;
|
|
139
|
+
const outcome = entry.undone ? "undone" : OUTCOME_OF[entry.outcome];
|
|
140
|
+
if (!outcome || outcome === said)
|
|
141
|
+
return;
|
|
142
|
+
said = outcome;
|
|
143
|
+
changeTelling(told, telling.id, { outcome });
|
|
144
|
+
if (outcome === "undone")
|
|
145
|
+
stop();
|
|
146
|
+
};
|
|
147
|
+
const unsubscribe = desk.subscribe(hear);
|
|
148
|
+
const timer = setTimeout(() => stop(), 30 * 60_000);
|
|
149
|
+
const stop = () => {
|
|
150
|
+
unsubscribe();
|
|
151
|
+
clearTimeout(timer);
|
|
152
|
+
};
|
|
153
|
+
return stop;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* 👍 AND 👎 AT THE FOOT OF AN ANSWERED CARD: quiet, reachable from the
|
|
157
|
+
* keyboard, named "This was right" and "This was wrong"; a rating changed
|
|
158
|
+
* while the card is open; a 👎 offers one optional line, "What should it
|
|
159
|
+
* have done?", kept with the telling.
|
|
160
|
+
*/
|
|
161
|
+
export function RateTelling({ told, telling }) {
|
|
162
|
+
const [rating, setRating] = useState(telling.rating);
|
|
163
|
+
const [should, setShould] = useState("");
|
|
164
|
+
const [kept, setKept] = useState(false);
|
|
165
|
+
const field = useId();
|
|
166
|
+
useEffect(() => {
|
|
167
|
+
setRating(telling.rating);
|
|
168
|
+
setShould("");
|
|
169
|
+
setKept(false);
|
|
170
|
+
}, [telling.id, telling.rating]);
|
|
171
|
+
const rate = (next) => {
|
|
172
|
+
const now = rating === next ? undefined : next;
|
|
173
|
+
setRating(now);
|
|
174
|
+
setKept(false);
|
|
175
|
+
changeTelling(told, telling.id, { rating: now ?? null });
|
|
176
|
+
};
|
|
177
|
+
const keepShould = () => {
|
|
178
|
+
const words = should.trim();
|
|
179
|
+
if (!words || rating !== "down")
|
|
180
|
+
return;
|
|
181
|
+
changeTelling(told, telling.id, { should: words });
|
|
182
|
+
setKept(true);
|
|
183
|
+
};
|
|
184
|
+
return (_jsxs("div", { "data-testid": "quick-ask-rating", "data-rating": rating ?? "", style: { display: "grid", gap: 6 }, children: [_jsxs("div", { role: "group", "aria-label": "Was this right?", style: { display: "flex", gap: 4, justifyContent: "flex-end" }, children: [_jsx("button", { type: "button", "data-testid": "quick-ask-right", "aria-label": "This was right", title: "This was right", "aria-pressed": rating === "up", onClick: () => rate("up"), style: rating === "up" ? THUMB_ON : THUMB, children: _jsx("span", { "aria-hidden": "true", children: "\uD83D\uDC4D" }) }), _jsx("button", { type: "button", "data-testid": "quick-ask-wrong", "aria-label": "This was wrong", title: "This was wrong", "aria-pressed": rating === "down", onClick: () => rate("down"), style: rating === "down" ? THUMB_ON : THUMB, children: _jsx("span", { "aria-hidden": "true", children: "\uD83D\uDC4E" }) })] }), rating === "down" ? (_jsxs("div", { style: { display: "grid", gap: 2 }, children: [_jsxs("label", { htmlFor: field, style: { fontSize: "0.75rem", color: "var(--graview-ink-muted)" }, children: ["What should it have done? ", _jsx("span", { style: { color: "var(--graview-ink-faint)" }, children: "(optional)" })] }), _jsx("input", { id: field, type: "text", "data-testid": "quick-ask-should", value: should, maxLength: 300, autoComplete: "off", enterKeyHint: "done", onChange: (event) => {
|
|
185
|
+
setShould(event.target.value);
|
|
186
|
+
setKept(false);
|
|
187
|
+
}, onKeyDown: (event) => {
|
|
188
|
+
if (event.key !== "Enter")
|
|
189
|
+
return;
|
|
190
|
+
event.preventDefault();
|
|
191
|
+
keepShould();
|
|
192
|
+
}, onBlur: keepShould, style: SHOULD }), kept ? (_jsx("span", { role: "status", "data-testid": "quick-ask-should-kept", style: { fontSize: "0.75rem", color: "var(--graview-ink-muted)" }, children: "Kept, to learn from." })) : null] })) : null] }));
|
|
193
|
+
}
|
|
194
|
+
const THUMB = { display: "inline-grid", placeItems: "center", width: 30, height: 28, padding: 0, font: "inherit", fontSize: "0.875rem", lineHeight: 1, background: "transparent", border: "1px solid transparent", borderRadius: 6, boxShadow: "none", cursor: "pointer", opacity: 0.7 };
|
|
195
|
+
const THUMB_ON = { ...THUMB, opacity: 1, borderColor: "var(--graview-accent)", background: "var(--graview-panel)" };
|
|
196
|
+
const SHOULD = { boxSizing: "border-box", width: "100%", height: 32, padding: "0 8px", font: "inherit", fontSize: "max(1rem,16px)", color: "var(--graview-ink)", background: "var(--graview-panel)", border: "1px solid var(--graview-edge)", borderRadius: 8 };
|
|
197
|
+
//# sourceMappingURL=told-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"told-card.js","sourceRoot":"","sources":["../src/told-card.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAqC,MAAM,uBAAuB,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAwJ,MAAM,oBAAoB,CAAC;AAGnP,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AAGvE;;;;;;;;;;;GAWG;AAEH,kFAAkF;AAClF,MAAM,UAAU,YAAY,CAAC,KAAuB,EAAE,MAAgB;IACpE,IAAI,MAAM,CAAC,EAAE,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC;IAC7C,IAAI,MAAM,CAAC,EAAE,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC;IAC7C,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAA2B,EAAE,KAAuB,EAAE,SAAoB,EAAE,KAAa,EAAE,MAAgB;IACtI,0FAA0F;IAC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E,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,EAAE,+BAA+B,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type AnySchema, type Principal, type Store } from "@graview/core";
|
|
2
|
+
import type { Telling, ToldStore } from "@graview/core/told";
|
|
3
|
+
/** The host's tellings, as this page last read them; a telling this page kept is in it at once. */
|
|
4
|
+
export declare function toldListed(told: ToldStore): Promise<readonly Telling[]>;
|
|
5
|
+
/** What is already at hand, without waiting: the last list read, or nothing yet. */
|
|
6
|
+
export declare const toldHeld: (told: ToldStore) => readonly Telling[] | undefined;
|
|
7
|
+
export declare function heldAlso(told: ToldStore, telling: Telling): void;
|
|
8
|
+
/**
|
|
9
|
+
* WHAT A READER SEES ON THIS PAGE: a record the page holds and the sight
|
|
10
|
+
* lets them see. A page's store is the seat's view, so a record kept from
|
|
11
|
+
* them is not in it at all — and one that is not there is not seen.
|
|
12
|
+
*/
|
|
13
|
+
export declare function seenOnThisPage(store: Store<AnySchema>, principal: Principal): (id: string) => boolean;
|
|
14
|
+
//# sourceMappingURL=told-listed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"told-listed.d.ts","sourceRoot":"","sources":["../src/told-listed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAW7D,mGAAmG;AACnG,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAYvE;AAED,oFAAoF;AACpF,eAAO,MAAM,QAAQ,GAAI,MAAM,SAAS,KAAG,SAAS,OAAO,EAAE,GAAG,SAAoC,CAAC;AAErG,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAMhE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,SAAS,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAGrG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { seesId } from "@graview/core";
|
|
2
|
+
/*
|
|
3
|
+
* WHAT A PAGE HAS READ OF ITS HOST'S TELLINGS (Roadmap f-menu-learns), one
|
|
4
|
+
* copy for the menu's suggestions and the answer card's examples alike, and
|
|
5
|
+
* what a reader sees on this page. No React, no part of what a page draws.
|
|
6
|
+
*/
|
|
7
|
+
/** What a page has read of its host's tellings, for a few seconds, so typing does not ask again on every key. */
|
|
8
|
+
const LISTED = new WeakMap();
|
|
9
|
+
const FRESH_MS = 5000;
|
|
10
|
+
/** The host's tellings, as this page last read them; a telling this page kept is in it at once. */
|
|
11
|
+
export function toldListed(told) {
|
|
12
|
+
const held = LISTED.get(told);
|
|
13
|
+
if (held && Date.now() - held.at < FRESH_MS)
|
|
14
|
+
return held.list;
|
|
15
|
+
const entry = { at: Date.now(), list: Promise.resolve([]) };
|
|
16
|
+
entry.list = Promise.resolve()
|
|
17
|
+
.then(() => told.list())
|
|
18
|
+
.catch(() => [])
|
|
19
|
+
.then((list) => (entry.value = [...list, ...(entry.value ?? []).filter((one) => !list.some((had) => had.id === one.id))]));
|
|
20
|
+
// What was read last stays at hand while it is read again.
|
|
21
|
+
if (held?.value)
|
|
22
|
+
entry.value = held.value;
|
|
23
|
+
LISTED.set(told, entry);
|
|
24
|
+
return entry.list;
|
|
25
|
+
}
|
|
26
|
+
/** What is already at hand, without waiting: the last list read, or nothing yet. */
|
|
27
|
+
export const toldHeld = (told) => LISTED.get(told)?.value;
|
|
28
|
+
export function heldAlso(told, telling) {
|
|
29
|
+
const held = LISTED.get(told);
|
|
30
|
+
if (!held)
|
|
31
|
+
return;
|
|
32
|
+
const add = (list) => [...list.filter((one) => one.id !== telling.id), telling];
|
|
33
|
+
if (held.value)
|
|
34
|
+
held.value = add(held.value);
|
|
35
|
+
LISTED.set(told, { at: held.at, list: held.list.then(add), ...(held.value ? { value: held.value } : {}) });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* WHAT A READER SEES ON THIS PAGE: a record the page holds and the sight
|
|
39
|
+
* lets them see. A page's store is the seat's view, so a record kept from
|
|
40
|
+
* them is not in it at all — and one that is not there is not seen.
|
|
41
|
+
*/
|
|
42
|
+
export function seenOnThisPage(store, principal) {
|
|
43
|
+
const sees = seesId(store, principal);
|
|
44
|
+
return (id) => store.graph.getNode(id) !== undefined && sees(id);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=told-listed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"told-listed.js","sourceRoot":"","sources":["../src/told-listed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA8C,MAAM,eAAe,CAAC;AAGnF;;;;GAIG;AACH,iHAAiH;AACjH,MAAM,MAAM,GAAG,IAAI,OAAO,EAA8G,CAAC;AACzI,MAAM,QAAQ,GAAG,IAAI,CAAC;AAEtB,mGAAmG;AACnG,MAAM,UAAU,UAAU,CAAC,IAAe;IACxC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,QAAQ;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IAC9D,MAAM,KAAK,GAAkF,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC;IAC3I,KAAK,CAAC,IAAI,GAAG,OAAO,CA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AC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7C,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7G,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAuB,EAAE,SAAoB;IAC1E,MAAM,IAAI,GAAG,MAAM,CAAC,KAAc,EAAE,SAAS,CAAC,CAAC;IAC/C,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AnySchema, Principal, Store } from "@graview/core";
|
|
2
|
+
import type { ToldStore } from "@graview/core/told";
|
|
3
|
+
import type { ComponentType } from "react";
|
|
4
|
+
/**
|
|
5
|
+
* "WHAT GRAVIEW HAS BEEN TOLD" (Roadmap f-menu-learns), the door: the
|
|
6
|
+
* Studio's panel of what people told this app (`told-panel.tsx`) is fetched
|
|
7
|
+
* when it is opened, never with the Studio — a host that hands the Studio
|
|
8
|
+
* in carries only this.
|
|
9
|
+
*/
|
|
10
|
+
export interface ToldPanelProps {
|
|
11
|
+
readonly told: ToldStore;
|
|
12
|
+
readonly store: Store<AnySchema>;
|
|
13
|
+
readonly principal: Principal;
|
|
14
|
+
readonly onClose: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const ToldPanelDoor: ComponentType<ToldPanelProps>;
|
|
17
|
+
//# sourceMappingURL=told-panel-door.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"told-panel-door.d.ts","sourceRoot":"","sources":["../src/told-panel-door.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAID,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,cAAc,CAGvD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { retryingImport } from "@graview/core/retry";
|
|
3
|
+
import { lazyModule } from "@graview/react/provider";
|
|
4
|
+
const panel = /* @__PURE__ */ lazyModule(retryingImport(() => import("./told-ui.js")));
|
|
5
|
+
export const ToldPanelDoor = /* @__PURE__ */ panel.part((module, props) => _jsx(module.ToldPanel, { ...props }), { what: "What Graview has been told" });
|
|
6
|
+
//# sourceMappingURL=told-panel-door.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"told-panel-door.js","sourceRoot":"","sources":["../src/told-panel-door.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAgBrD,MAAM,KAAK,GAAG,eAAe,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;AAEvF,MAAM,CAAC,MAAM,aAAa,GAAkC,eAAe,CAAC,KAAK,CAAC,IAAI,CACpF,CAAC,MAAM,EAAE,KAAqB,EAAE,EAAE,CAAC,KAAC,MAAM,CAAC,SAAS,OAAK,KAAK,GAAI,EAClE,EAAE,IAAI,EAAE,4BAA4B,EAAE,CACvC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type AnySchema, type Principal, type Store } from "@graview/core";
|
|
2
|
+
import { type ToldStore } from "@graview/core/told";
|
|
3
|
+
/**
|
|
4
|
+
* WHAT GRAVIEW HAS BEEN TOLD, IN THE STUDIO (Roadmap f-menu-learns): every
|
|
5
|
+
* telling this app's host keeps (`HostAi.told`, `@graview/core/told`) that
|
|
6
|
+
* the owner may see — a telling about a record hidden from them is not
|
|
7
|
+
* listed — with its words, what it did, how it ended, its rating, who told
|
|
8
|
+
* it, when, and how long it took; filtered by rating, outcome and kind.
|
|
9
|
+
* From one an owner marks a good example, excludes it from suggestions, or
|
|
10
|
+
* deletes it; the line at the top says what is teaching the system. Only
|
|
11
|
+
* in the Studio, which only the app's owners and editors are offered.
|
|
12
|
+
*/
|
|
13
|
+
export declare function ToldPanel({ told, store, principal, onClose }: {
|
|
14
|
+
readonly told: ToldStore;
|
|
15
|
+
readonly store: Store<AnySchema>;
|
|
16
|
+
readonly principal: Principal;
|
|
17
|
+
readonly onClose: () => void;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=told-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"told-panel.d.ts","sourceRoot":"","sources":["../src/told-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,KAAK,EAAE,MAAM,eAAe,CAAC;AACxG,OAAO,EAYL,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,+BAkIzL"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { layer, nameOfAuthor, seesId } from "@graview/core";
|
|
3
|
+
import { TELLING_OUTCOMES, TELLING_OUTCOME_WORDS, tellingDidWords, toldAfter, toldMatching, toldSeenBy, toldTeachingWords, } from "@graview/core/told";
|
|
4
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
/**
|
|
6
|
+
* WHAT GRAVIEW HAS BEEN TOLD, IN THE STUDIO (Roadmap f-menu-learns): every
|
|
7
|
+
* telling this app's host keeps (`HostAi.told`, `@graview/core/told`) that
|
|
8
|
+
* the owner may see — a telling about a record hidden from them is not
|
|
9
|
+
* listed — with its words, what it did, how it ended, its rating, who told
|
|
10
|
+
* it, when, and how long it took; filtered by rating, outcome and kind.
|
|
11
|
+
* From one an owner marks a good example, excludes it from suggestions, or
|
|
12
|
+
* deletes it; the line at the top says what is teaching the system. Only
|
|
13
|
+
* in the Studio, which only the app's owners and editors are offered.
|
|
14
|
+
*/
|
|
15
|
+
export function ToldPanel({ told, store, principal, onClose }) {
|
|
16
|
+
const [tellings, setTellings] = useState(null);
|
|
17
|
+
const [filter, setFilter] = useState({});
|
|
18
|
+
const panel = useRef(null);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
let live = true;
|
|
21
|
+
void Promise.resolve()
|
|
22
|
+
.then(() => told.list())
|
|
23
|
+
.then((list) => live && setTellings(list), () => live && setTellings([]));
|
|
24
|
+
panel.current?.focus({ preventScroll: true });
|
|
25
|
+
return () => {
|
|
26
|
+
live = false;
|
|
27
|
+
};
|
|
28
|
+
}, [told]);
|
|
29
|
+
const seen = useMemo(() => (tellings ? toldSeenBy(tellings, seesId(store, principal)) : []), [tellings, store, principal]);
|
|
30
|
+
const shown = useMemo(() => [...toldMatching(seen, filter)].sort((a, b) => (a.at < b.at ? 1 : -1)), [seen, filter]);
|
|
31
|
+
const kinds = useMemo(() => [...new Set(seen.flatMap((one) => one.reading?.kind ?? one.target.kind ?? []))].sort(), [seen]);
|
|
32
|
+
const titleOf = (act) => store.allMutations().find((one) => one.name === act)?.title ?? act;
|
|
33
|
+
const plural = (kind) => store.schema.tryDefinition(kind)?.plural ?? kind;
|
|
34
|
+
const who = (telling) => {
|
|
35
|
+
try {
|
|
36
|
+
return nameOfAuthor(telling.by, { graph: store.graph, schema: store.schema });
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return telling.by.id ?? telling.by.kind;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const change = (id, with_) => {
|
|
43
|
+
setTellings((list) => (list ? toldAfter(list, { change: id, with: with_ }) : list));
|
|
44
|
+
void Promise.resolve()
|
|
45
|
+
.then(() => told.change(id, with_))
|
|
46
|
+
.catch(() => undefined);
|
|
47
|
+
};
|
|
48
|
+
const remove = (id) => {
|
|
49
|
+
setTellings((list) => (list ? toldAfter(list, { remove: id }) : list));
|
|
50
|
+
void Promise.resolve()
|
|
51
|
+
.then(() => told.remove(id))
|
|
52
|
+
.catch(() => undefined);
|
|
53
|
+
};
|
|
54
|
+
return (_jsxs("section", { ref: panel, tabIndex: -1, "data-testid": "told-panel", "data-graview-overlay": "", "aria-label": "What Graview has been told", onKeyDown: (event) => {
|
|
55
|
+
if (event.key !== "Escape")
|
|
56
|
+
return;
|
|
57
|
+
event.stopPropagation();
|
|
58
|
+
onClose();
|
|
59
|
+
}, style: PANEL, children: [_jsxs("div", { style: { display: "flex", alignItems: "baseline", gap: 8 }, children: [_jsx("h2", { style: { margin: 0, fontSize: "1rem", fontWeight: 600, flex: "1 1 auto" }, children: "What Graview has been told" }), _jsx("button", { type: "button", "data-testid": "told-close", onClick: onClose, style: BUTTON, children: "Close" })] }), _jsx("p", { "data-testid": "told-teaching", style: { margin: 0, fontSize: "0.875rem", color: "var(--graview-ink-muted)" }, children: tellings === null ? "Reading what was told…" : toldTeachingWords(seen) }), _jsxs("div", { role: "group", "aria-label": "Show only", style: { display: "flex", flexWrap: "wrap", gap: 8, fontSize: "0.8125rem" }, children: [_jsxs("label", { style: FILTER, children: ["Rating", _jsxs("select", { "data-testid": "told-filter-rating", value: filter.rating ?? "", onChange: (event) => setFilter(({ rating: _drop, ...rest }) => (event.target.value ? { ...rest, rating: event.target.value } : rest)), children: [_jsx("option", { value: "", children: "Any" }), _jsx("option", { value: "up", children: "\uD83D\uDC4D Right" }), _jsx("option", { value: "down", children: "\uD83D\uDC4E Wrong" }), _jsx("option", { value: "none", children: "Not rated" })] })] }), _jsxs("label", { style: FILTER, children: ["Outcome", _jsxs("select", { "data-testid": "told-filter-outcome", value: filter.outcome ?? "", onChange: (event) => setFilter(({ outcome: _drop, ...rest }) => (event.target.value ? { ...rest, outcome: event.target.value } : rest)), children: [_jsx("option", { value: "", children: "Any" }), TELLING_OUTCOMES.map((outcome) => (_jsx("option", { value: outcome, children: TELLING_OUTCOME_WORDS[outcome] }, outcome)))] })] }), _jsxs("label", { style: FILTER, children: ["Kind", _jsxs("select", { "data-testid": "told-filter-kind", value: filter.kind ?? "", onChange: (event) => setFilter(({ kind: _drop, ...rest }) => (event.target.value ? { ...rest, kind: event.target.value } : rest)), children: [_jsx("option", { value: "", children: "Any" }), kinds.map((kind) => (_jsx("option", { value: kind, children: plural(kind) }, kind)))] })] })] }), tellings !== null && shown.length === 0 ? (_jsx("p", { "data-testid": "told-none", style: { margin: 0, fontSize: "0.875rem", color: "var(--graview-ink-muted)" }, children: seen.length === 0 ? "Nothing has been told here yet." : "Nothing told here fits these." })) : null, _jsx("ol", { style: { margin: 0, padding: 0, listStyle: "none", display: "grid", gap: 8, overflowY: "auto" }, children: shown.map((telling) => (_jsxs("li", { "data-testid": "told-entry", "data-telling": telling.id, "data-outcome": telling.outcome, "data-rating": telling.rating ?? "", "data-excluded": telling.excluded ? "" : undefined, "data-pinned": telling.pinned ? "" : undefined, style: ENTRY, children: [_jsxs("p", { style: { margin: 0, fontWeight: 550, overflowWrap: "anywhere" }, children: ["\u201C", telling.words, "\u201D"] }), _jsxs("p", { style: { margin: 0, fontSize: "0.8125rem" }, children: [tellingDidWords(telling, titleOf), " \u00B7 ", TELLING_OUTCOME_WORDS[telling.outcome], telling.rating ? ` · ${telling.rating === "up" ? "👍 right" : "👎 wrong"}` : "", telling.pinned ? " · a good example" : "", telling.excluded ? " · excluded from suggestions" : ""] }), telling.should ? _jsxs("p", { style: { margin: 0, fontSize: "0.8125rem", fontStyle: "italic" }, children: ["Should have: ", telling.should] }) : null, _jsxs("p", { style: { margin: 0, fontSize: "0.75rem", color: "var(--graview-ink-muted)" }, children: [who(telling), " \u00B7 ", _jsx("time", { dateTime: telling.at, children: new Date(telling.at).toLocaleString() }), telling.ms !== undefined ? ` · ${telling.ms < 1000 ? `${telling.ms} ms` : `${(telling.ms / 1000).toFixed(1)} s`}` : ""] }), _jsxs("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: [_jsx("button", { type: "button", "data-testid": "told-pin", "aria-pressed": telling.pinned === true, onClick: () => change(telling.id, { pinned: !telling.pinned }), style: BUTTON, children: telling.pinned ? "Not a good example" : "A good example" }), _jsx("button", { type: "button", "data-testid": "told-exclude", "aria-pressed": telling.excluded === true, onClick: () => change(telling.id, { excluded: !telling.excluded }), style: BUTTON, children: telling.excluded ? "Suggest it again" : "Exclude from suggestions" }), _jsx("button", { type: "button", "data-testid": "told-delete", onClick: () => remove(telling.id), style: BUTTON, children: "Delete" })] })] }, telling.id))) })] }));
|
|
60
|
+
}
|
|
61
|
+
const PANEL = {
|
|
62
|
+
position: "absolute",
|
|
63
|
+
insetBlock: "60px 12px",
|
|
64
|
+
insetInlineEnd: 12,
|
|
65
|
+
width: "min(440px, calc(100% - 24px))",
|
|
66
|
+
boxSizing: "border-box",
|
|
67
|
+
display: "flex",
|
|
68
|
+
flexDirection: "column",
|
|
69
|
+
gap: 10,
|
|
70
|
+
padding: 14,
|
|
71
|
+
borderRadius: 12,
|
|
72
|
+
border: "1px solid var(--graview-edge)",
|
|
73
|
+
background: "var(--graview-float)",
|
|
74
|
+
color: "var(--graview-ink)",
|
|
75
|
+
boxShadow: "var(--graview-lift-high)",
|
|
76
|
+
// Over the studio's own picture, under nothing else the dialog holds.
|
|
77
|
+
zIndex: layer("popover"),
|
|
78
|
+
overflow: "hidden",
|
|
79
|
+
};
|
|
80
|
+
const ENTRY = { display: "grid", gap: 4, padding: 10, borderRadius: 10, border: "1px solid var(--graview-edge)", background: "var(--graview-panel)" };
|
|
81
|
+
const BUTTON = { padding: "2px 10px", minHeight: 28, font: "inherit", fontSize: "0.8125rem", borderRadius: 8 };
|
|
82
|
+
const FILTER = { display: "inline-flex", alignItems: "center", gap: 4 };
|
|
83
|
+
//# sourceMappingURL=told-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"told-panel.js","sourceRoot":"","sources":["../src/told-panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAA8C,MAAM,eAAe,CAAC;AACxG,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,SAAS,EACT,YAAY,EACZ,UAAU,EACV,iBAAiB,GAMlB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AAEjF;;;;;;;;;GASG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAA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AO,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;AAC9H,MAAM,MAAM,GAAkB,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "./frame.js";
|
|
2
|
+
export { changeTelling, examplesHere, keepTelling, RateTelling, seenOnThisPage, tellingDraftOf, toldListed, watchTelling } from "./told-card.js";
|
|
3
|
+
export { readToldHere, toldForHere, toldSuggestionsFrom } from "./menu-told.js";
|
|
4
|
+
export { ToldPanel } from "./told-panel.js";
|
|
5
|
+
//# sourceMappingURL=told-ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"told-ui.d.ts","sourceRoot":"","sources":["../src/told-ui.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AAQpB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACjJ,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/told-ui.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./frame.js"; // A door: tied to what the page drew first (TIED DOORS, packages/primitives/src/frame.ts).
|
|
2
|
+
/*
|
|
3
|
+
* WHAT PEOPLE TELL GRAVIEW, ONE CHUNK (Roadmap f-menu-learns): the card's
|
|
4
|
+
* telling and its thumbs, the menu's suggestions and the Studio's panel,
|
|
5
|
+
* with `@graview/core/told`, fetched together by whichever door asks first
|
|
6
|
+
* (`quick-ask.tsx`, `menu-told-door.ts`, `told-panel-door.tsx`) — one
|
|
7
|
+
* request, and no piece of it on a page that never tells Graview anything.
|
|
8
|
+
*/
|
|
9
|
+
export { changeTelling, examplesHere, keepTelling, RateTelling, seenOnThisPage, tellingDraftOf, toldListed, watchTelling } from "./told-card.js";
|
|
10
|
+
export { readToldHere, toldForHere, toldSuggestionsFrom } from "./menu-told.js";
|
|
11
|
+
export { ToldPanel } from "./told-panel.js";
|
|
12
|
+
//# sourceMappingURL=told-ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"told-ui.js","sourceRoot":"","sources":["../src/told-ui.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC,CAAC,2FAA2F;AAChH;;;;;;GAMG;AACH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACjJ,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** How far a day is from today, as a person says it: "today", "tomorrow", "in 3 days", "2 weeks ago", "9 years ago". */
|
|
2
|
+
export declare function fromToday(day: string, today: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* A stored day or moment said with its weekday and how far it is from
|
|
5
|
+
* today: "Fri, Sep 4 · in 3 days", "Mon, Sep 25, 2017, 11:30 AM · 9 years
|
|
6
|
+
* ago" — its year only when it is not this one. Undefined for anything that
|
|
7
|
+
* names no whole day (a month alone, a year alone, words).
|
|
8
|
+
*/
|
|
9
|
+
export declare function whenSaid(stored: string, today: string, options?: {
|
|
10
|
+
readonly locale?: string;
|
|
11
|
+
readonly timeZone?: string;
|
|
12
|
+
}): {
|
|
13
|
+
readonly words: string;
|
|
14
|
+
readonly day: string;
|
|
15
|
+
readonly past: boolean;
|
|
16
|
+
} | undefined;
|
|
17
|
+
/** The day a store judges "late" against: its own (`?today=`, a pinned demo), else today on the app's clock. */
|
|
18
|
+
export declare function todayOf(store: {
|
|
19
|
+
today?(): string | undefined;
|
|
20
|
+
}): string;
|
|
21
|
+
//# sourceMappingURL=when-words.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"when-words.d.ts","sourceRoot":"","sources":["../src/when-words.ts"],"names":[],"mappings":"AAWA,wHAAwH;AACxH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAU5D;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAMpN;AAED,gHAAgH;AAChH,wBAAgB,OAAO,CAAC,KAAK,EAAE;IAAE,KAAK,CAAC,IAAI,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,MAAM,CAEvE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { dayOfMoment, isoToday, timeAsRead, weekdayAsRead, zoneFor } from "@graview/core";
|
|
2
|
+
/*
|
|
3
|
+
* A DAY SAID BOTH WAYS (Roadmap f-facts-by-type): what it is and how far it
|
|
4
|
+
* is — "Fri, Sep 4 · in 3 days". A record's page said a due date as "Sep 4,
|
|
5
|
+
* 2026" and left the reader to work out that it was Friday and three days
|
|
6
|
+
* off; a person deciding what to do next asks the second question first.
|
|
7
|
+
*/
|
|
8
|
+
const DAY_MS = 86_400_000;
|
|
9
|
+
/** How far a day is from today, as a person says it: "today", "tomorrow", "in 3 days", "2 weeks ago", "9 years ago". */
|
|
10
|
+
export function fromToday(day, today) {
|
|
11
|
+
const days = Math.round((Date.parse(`${day}T00:00:00Z`) - Date.parse(`${today}T00:00:00Z`)) / DAY_MS);
|
|
12
|
+
if (!Number.isFinite(days))
|
|
13
|
+
return "";
|
|
14
|
+
if (days === 0)
|
|
15
|
+
return "today";
|
|
16
|
+
if (days === 1)
|
|
17
|
+
return "tomorrow";
|
|
18
|
+
if (days === -1)
|
|
19
|
+
return "yesterday";
|
|
20
|
+
const far = Math.abs(days);
|
|
21
|
+
const [count, unit] = far < 14 ? [far, "day"] : far < 60 ? [Math.round(far / 7), "week"] : far < 730 ? [Math.round(far / 30.44), "month"] : [Math.round(far / 365.25), "year"];
|
|
22
|
+
const said = `${count} ${unit}${count === 1 ? "" : "s"}`;
|
|
23
|
+
return days > 0 ? `in ${said}` : `${said} ago`;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A stored day or moment said with its weekday and how far it is from
|
|
27
|
+
* today: "Fri, Sep 4 · in 3 days", "Mon, Sep 25, 2017, 11:30 AM · 9 years
|
|
28
|
+
* ago" — its year only when it is not this one. Undefined for anything that
|
|
29
|
+
* names no whole day (a month alone, a year alone, words).
|
|
30
|
+
*/
|
|
31
|
+
export function whenSaid(stored, today, options = {}) {
|
|
32
|
+
const day = dayOfMoment(stored, options.timeZone);
|
|
33
|
+
if (day === undefined)
|
|
34
|
+
return undefined;
|
|
35
|
+
const date = weekdayAsRead(day, { weekday: "short", year: day.slice(0, 4) !== today.slice(0, 4) }, options.locale);
|
|
36
|
+
const time = stored.length > 10 ? `, ${timeAsRead(stored, options.locale, options.timeZone)}` : "";
|
|
37
|
+
return { words: `${date}${time} · ${fromToday(day, today)}`, day, past: day < today };
|
|
38
|
+
}
|
|
39
|
+
/** The day a store judges "late" against: its own (`?today=`, a pinned demo), else today on the app's clock. */
|
|
40
|
+
export function todayOf(store) {
|
|
41
|
+
return store.today?.() ?? isoToday(zoneFor());
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=when-words.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"when-words.js","sourceRoot":"","sources":["../src/when-words.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE1F;;;;;GAKG;AAEH,MAAM,MAAM,GAAG,UAAU,CAAC;AAE1B,wHAAwH;AACxH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,KAAa;IAClD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,YAAY,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,YAAY,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;IACtG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IACtC,IAAI,IAAI,KAAK,CAAC;QAAE,OAAO,OAAO,CAAC;IAC/B,IAAI,IAAI,KAAK,CAAC;QAAE,OAAO,UAAU,CAAC;IAClC,IAAI,IAAI,KAAK,CAAC,CAAC;QAAE,OAAO,WAAW,CAAC;IACpC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC3B,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAA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