counterparts 0.3.2 → 0.3.4
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/CHANGELOG.md +153 -0
- package/docs/module-map.md +3 -2
- package/package.json +1 -1
- package/src/adapters/claude-code/NOTES.md +28 -0
- package/src/adapters/claude-code/bin/hook.ts +85 -22
- package/src/adapters/claude-code/config.ts +7 -0
- package/src/adapters/claude-code/doctor.ts +166 -4
- package/src/adapters/claude-code/hooks.ts +185 -6
- package/src/adapters/claude-code/index.ts +3 -0
- package/src/adapters/claude-code/transcript.ts +7 -0
- package/src/adapters/cli/CONTRACT.md +11 -0
- package/src/adapters/cli/INTERFACE-GAPS.md +16 -0
- package/src/adapters/cli/NOTES.md +25 -0
- package/src/adapters/cli/commands.ts +184 -4
- package/src/adapters/cli/dream-core.ts +126 -0
- package/src/adapters/cli/help.ts +17 -0
- package/src/adapters/cli/mechanisms.ts +199 -106
- package/src/adapters/dashboard/CONTRACT.md +5 -0
- package/src/adapters/dashboard/INTERFACE-GAPS.md +12 -0
- package/src/adapters/dashboard/NOTES.md +38 -0
- package/src/adapters/dashboard/registries.ts +35 -1
- package/src/adapters/dashboard/web/README.md +63 -26
- package/src/adapters/dashboard/web/app.html +2 -0
- package/src/adapters/dashboard/web/flow.ts +14 -0
- package/src/adapters/dashboard/web/lanes.ts +141 -0
- package/src/adapters/dashboard/web/mechanisms/association/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/consolidation/index.js +8 -5
- package/src/adapters/dashboard/web/mechanisms/consolidation/panel.js +7 -7
- package/src/adapters/dashboard/web/mechanisms/decay/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/dreaming/index.js +19 -0
- package/src/adapters/dashboard/web/mechanisms/emotional/index.js +9 -6
- package/src/adapters/dashboard/web/mechanisms/episodic-semantic/index.js +4 -5
- package/src/adapters/dashboard/web/mechanisms/index.js +5 -3
- package/src/adapters/dashboard/web/mechanisms/interference/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/prospective/index.js +7 -5
- package/src/adapters/dashboard/web/mechanisms/reconsolidation/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/regions.js +1 -1
- package/src/adapters/dashboard/web/mechanisms/retrieval/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/salience/index.js +1 -2
- package/src/adapters/dashboard/web/mechanisms/schema/index.js +1 -2
- package/src/adapters/dashboard/web/narrate.ts +76 -13
- package/src/adapters/dashboard/web/pages/health/sections/checks.js +17 -1
- package/src/adapters/dashboard/web/pages/home/home.css +29 -13
- package/src/adapters/dashboard/web/pages/home/index.js +2 -0
- package/src/adapters/dashboard/web/pages/home/sections/explorer.js +22 -7
- package/src/adapters/dashboard/web/pages/home/sections/hero.js +15 -3
- package/src/adapters/dashboard/web/pages/home/sections/live-activity.js +15 -9
- package/src/adapters/dashboard/web/pages/home/sections/recent-chapters.js +6 -2
- package/src/adapters/dashboard/web/pages/home/sections/tiles.js +35 -18
- package/src/adapters/dashboard/web/pages/memories/index.js +30 -36
- package/src/adapters/dashboard/web/pages/memories/memories.css +97 -72
- package/src/adapters/dashboard/web/pages/memories/row.js +51 -0
- package/src/adapters/dashboard/web/pages/memories/sections/feel.js +176 -0
- package/src/adapters/dashboard/web/pages/memories/sections/hold.js +67 -0
- package/src/adapters/dashboard/web/pages/memories/sections/list.js +65 -43
- package/src/adapters/dashboard/web/pages/memories/sections/search.js +26 -23
- package/src/adapters/dashboard/web/pages/memories/state.js +12 -5
- package/src/adapters/dashboard/web/pages/self/index.js +57 -16
- package/src/adapters/dashboard/web/pages/self/sections/dreams.js +76 -0
- package/src/adapters/dashboard/web/pages/self/sections/journal.js +75 -19
- package/src/adapters/dashboard/web/pages/self/sections/page.js +108 -65
- package/src/adapters/dashboard/web/pages/self/sections/settling.js +129 -104
- package/src/adapters/dashboard/web/pages/self/sections/wake.js +31 -15
- package/src/adapters/dashboard/web/pages/self/self.css +122 -59
- package/src/adapters/dashboard/web/pages/self/state.js +21 -0
- package/src/adapters/dashboard/web/server.ts +9 -0
- package/src/adapters/dashboard/web/shared/memory-marks.css +17 -0
- package/src/adapters/dashboard/web/shared/memory-marks.js +81 -0
- package/src/adapters/dashboard/web/shared/memory-modal.js +240 -53
- package/src/adapters/dashboard/web/shared/modal.css +67 -0
- package/src/adapters/dashboard/web/shared/tip.js +1 -1
- package/src/adapters/dashboard/web/shared/widgets/feed.css +4 -0
- package/src/adapters/dashboard/web/shared/widgets/feed.js +56 -14
- package/src/adapters/dashboard/web/shared/widgets/light.css +1 -0
- package/src/adapters/dashboard/web/shared/widgets/light.js +7 -5
- package/src/adapters/dashboard/web/shared/widgets/tips.css +19 -0
- package/src/adapters/dashboard/web/shared/widgets/tips.js +56 -0
- package/src/adapters/dashboard/web/views/activity.ts +18 -2
- package/src/adapters/dashboard/web/views/archive-words.ts +27 -10
- package/src/adapters/dashboard/web/views/dreams.ts +199 -0
- package/src/adapters/dashboard/web/views/mechanism-panel.ts +116 -35
- package/src/adapters/dashboard/web/views/mechanisms.ts +81 -255
- package/src/adapters/dashboard/web/views/memories.ts +245 -43
- package/src/adapters/dashboard/web/views/memory-words.ts +133 -0
- package/src/adapters/dashboard/web/views/memory.ts +226 -4
- package/src/adapters/dashboard/web/views/mind.ts +261 -61
- package/src/adapters/dashboard/web/views/overview.ts +80 -42
- package/src/adapters/dashboard/web/views/search.ts +35 -1
- package/src/adapters/dashboard/web/views/shared.ts +14 -0
- package/src/adapters/dashboard/web/views.ts +2 -0
- package/src/adapters/feelings-line.ts +74 -0
- package/src/adapters/fired.ts +163 -23
- package/src/adapters/mcp/CONTRACT.md +8 -0
- package/src/adapters/mcp/NOTES.md +56 -0
- package/src/adapters/mcp/server.ts +254 -6
- package/src/adapters/mcp/tools.ts +180 -5
- package/src/adapters/mechanism-evidence.ts +465 -0
- package/src/core/bridge.ts +21 -16
- package/src/core/counterpart.ts +422 -10
- package/src/core/dream/CONTRACT.md +143 -0
- package/src/core/dream/INTERFACE-GAPS.md +24 -0
- package/src/core/dream/NOTES.md +84 -0
- package/src/core/dream/index.ts +1067 -0
- package/src/core/dream/mark.ts +14 -0
- package/src/core/dream/tunables.ts +56 -0
- package/src/core/encode/CONTRACT.md +7 -1
- package/src/core/feelings-wheel.ts +171 -13
- package/src/core/mint.ts +9 -0
- package/src/core/physics/CONTRACT.md +132 -21
- package/src/core/physics/NOTES.md +233 -0
- package/src/core/physics/index.ts +419 -50
- package/src/core/prospective/CONTRACT.md +35 -6
- package/src/core/prospective/INTERFACE-GAPS.md +10 -5
- package/src/core/prospective/NOTES.md +175 -4
- package/src/core/prospective/derive.ts +32 -3
- package/src/core/prospective/index.ts +362 -39
- package/src/core/prospective/tunables.ts +18 -1
- package/src/core/prospective/windows.ts +104 -46
- package/src/core/recall/CONTRACT.md +28 -0
- package/src/core/recall/NOTES.md +55 -0
- package/src/core/recall/activate.ts +32 -5
- package/src/core/recall/gate.ts +7 -1
- package/src/core/recall/index.ts +28 -2
- package/src/core/recall/mood.ts +106 -0
- package/src/core/recall/tunables.ts +26 -0
- package/src/core/remember/CONTRACT.md +5 -0
- package/src/core/remember/index.ts +1 -0
- package/src/core/remember/proposals.ts +86 -3
- package/src/core/remember/spans.ts +11 -1
- package/src/core/self/CONTRACT.md +3 -0
- package/src/core/self/INTERFACE-GAPS.md +7 -0
- package/src/core/self/NOTES.md +30 -0
- package/src/core/self/identity.ts +115 -6
- package/src/core/self/index.ts +17 -0
- package/src/core/self/tunables.ts +17 -0
- package/src/core/sleep/CONTRACT.md +17 -1
- package/src/core/sleep/INTERFACE-GAPS.md +19 -0
- package/src/core/sleep/NOTES.md +36 -0
- package/src/core/sleep/consolidate.ts +149 -96
- package/src/core/sleep/decay.ts +11 -0
- package/src/core/sleep/index.ts +4 -1
- package/src/core/sleep/tunables.ts +9 -0
- package/src/core/sleep/types.ts +17 -0
- package/src/core/sleep/upgrade.ts +168 -0
- package/src/core/store/CONTRACT.md +21 -2
- package/src/core/store/NOTES.md +68 -0
- package/src/core/store/feelings.ts +23 -6
- package/src/core/store/index.ts +716 -17
- package/src/core/store/operational.ts +329 -4
- package/src/core/store/owner-op-seam.ts +79 -1
- package/src/core/types.ts +37 -0
- package/src/adapters/dashboard/web/pages/memories/sections/constellation.js +0 -178
- package/src/adapters/dashboard/web/pages/memories/sections/kinds.js +0 -42
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/* The one picture of everything I hold: every memory a dot — how many lived
|
|
2
|
-
days old across, how strong up, how much it mattered as its size, today's
|
|
3
|
-
band as its colour. The band counts are the legend (click one to filter the
|
|
4
|
-
list below), and the right margin is the strength distribution, split by
|
|
5
|
-
band, on the same strength axis. Hover for the words, click to open. */
|
|
6
|
-
import { fit, hitTest } from "../../../shared/canvas.js";
|
|
7
|
-
import { BANDCOL, COL } from "../../../shared/colors.js";
|
|
8
|
-
import { $, esc } from "../../../shared/dom.js";
|
|
9
|
-
import { openMemory } from "../../../shared/memory-modal.js";
|
|
10
|
-
import { hideTip, showTip } from "../../../shared/tip.js";
|
|
11
|
-
import { filters, onFilter, toggle } from "../state.js";
|
|
12
|
-
|
|
13
|
-
/** Each band in a few plain words. */
|
|
14
|
-
export const BAND_WORDS = {
|
|
15
|
-
episodic: "fresh — still an episode",
|
|
16
|
-
semantic: "settled into what I know",
|
|
17
|
-
identity: "part of who I am",
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const markup = `
|
|
21
|
-
<h2>Everything I hold <small id="con-sub"></small></h2>
|
|
22
|
-
<div class="card glance">
|
|
23
|
-
<div class="bandkey" id="con-legend" role="group" aria-label="bands — click one to filter the list"></div>
|
|
24
|
-
<div class="chart"><canvas id="con" height="340"></canvas></div>
|
|
25
|
-
<div class="glance-foot" id="con-foot"></div>
|
|
26
|
-
</div>`;
|
|
27
|
-
|
|
28
|
-
let data = null;
|
|
29
|
-
let conPoints = [];
|
|
30
|
-
|
|
31
|
-
export function mount() {
|
|
32
|
-
const cv = $("con");
|
|
33
|
-
cv.addEventListener("mousemove", (e) => {
|
|
34
|
-
const hit = hitTest(cv, e, conPoints);
|
|
35
|
-
cv.style.cursor = hit ? "pointer" : "default";
|
|
36
|
-
if (!hit) return hideTip();
|
|
37
|
-
const p = hit.p;
|
|
38
|
-
showTip(e.clientX, e.clientY,
|
|
39
|
-
(p.confidential ? '<span class="withheld">' + esc(p.text) + "</span>" : esc(p.text)) +
|
|
40
|
-
'<div class="dimline">' + esc(p.kind) + " · " + esc(p.band) + " · " + Math.round(p.strength * 100) +
|
|
41
|
-
"% strong · " + p.ageDays + " lived days old · used " + p.uses + "×</div>");
|
|
42
|
-
});
|
|
43
|
-
cv.addEventListener("mouseleave", hideTip);
|
|
44
|
-
cv.addEventListener("click", (e) => {
|
|
45
|
-
const hit = hitTest(cv, e, conPoints);
|
|
46
|
-
if (hit) openMemory(hit.p.id);
|
|
47
|
-
});
|
|
48
|
-
$("con-legend").addEventListener("click", (e) => {
|
|
49
|
-
const chip = e.target.closest("[data-band]");
|
|
50
|
-
if (chip && !chip.disabled) toggle("band", chip.dataset.band);
|
|
51
|
-
});
|
|
52
|
-
onFilter(() => { paintLegend(); draw(); });
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function paint(d) {
|
|
56
|
-
data = d;
|
|
57
|
-
const plotted = d.points.length;
|
|
58
|
-
const held = d.memories + (d.memories === 1 ? " memory" : " memories") +
|
|
59
|
-
(d.schemas ? " and " + d.schemas + (d.schemas === 1 ? " entity or belief" : " entities and beliefs") : "");
|
|
60
|
-
$("con-sub").textContent = "— " + held +
|
|
61
|
-
(plotted < d.total ? " (the " + plotted + " strongest are plotted)" : "");
|
|
62
|
-
$("con-foot").innerHTML =
|
|
63
|
-
"<span>older →</span><span>size: how much it mattered when it arrived</span>" +
|
|
64
|
-
"<span>right edge: how many sit at each strength</span>";
|
|
65
|
-
paintLegend();
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function paintLegend() {
|
|
69
|
-
if (!data) return;
|
|
70
|
-
$("con-legend").innerHTML = data.bands.map((b) => {
|
|
71
|
-
const none = b.count === 0;
|
|
72
|
-
const on = filters.band === b.label;
|
|
73
|
-
return '<button type="button" class="bchip' + (none ? " none" : "") + (on ? " on" : "") + '" data-band="' +
|
|
74
|
-
esc(b.label) + '"' + (none ? " disabled" : "") + ' aria-pressed="' + on + '">' +
|
|
75
|
-
'<span class="bdot' + (none ? " hollow" : "") + '" style="' + (none ? "border-color:" : "background:") +
|
|
76
|
-
BANDCOL[b.label] + '"></span>' +
|
|
77
|
-
'<span class="bname">' + esc(b.label) + "</span>" +
|
|
78
|
-
'<span class="bn">' + (none ? esc(b.absent || "(none yet)") : b.count) + "</span>" +
|
|
79
|
-
'<span class="bw">' + esc(BAND_WORDS[b.label] || b.note) + "</span></button>";
|
|
80
|
-
}).join("") + (filters.band ? '<span class="bhint">showing ' + esc(filters.band) + " only — click again for all</span>" : "");
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export function draw() {
|
|
84
|
-
if (!data) return;
|
|
85
|
-
const MEM = data;
|
|
86
|
-
const cv = $("con");
|
|
87
|
-
const { ctx, w, h } = fit(cv);
|
|
88
|
-
const narrow = w < 520;
|
|
89
|
-
const margin = narrow ? 64 : 120; // the strength-distribution margin
|
|
90
|
-
const padL = 40, padR = margin + 14, padT = 12, padB = 24;
|
|
91
|
-
const plotR = w - padR;
|
|
92
|
-
const maxAge = Math.max(1, ...MEM.points.map((p) => p.ageDays));
|
|
93
|
-
const allNew = MEM.points.length > 0 && MEM.points.every((p) => p.ageDays === 0);
|
|
94
|
-
const X = (a) => padL + (a / maxAge) * (plotR - padL);
|
|
95
|
-
const Y = (s) => h - padB - Math.max(0, Math.min(1, s)) * (h - padT - padB);
|
|
96
|
-
|
|
97
|
-
// grid + strength labels
|
|
98
|
-
ctx.strokeStyle = "rgba(0,229,255,.07)";
|
|
99
|
-
ctx.lineWidth = 1;
|
|
100
|
-
ctx.fillStyle = "#79848f";
|
|
101
|
-
for (let i = 0; i <= 4; i++) {
|
|
102
|
-
const y = Y(i / 4);
|
|
103
|
-
ctx.beginPath(); ctx.moveTo(padL, y); ctx.lineTo(w - 6, y); ctx.stroke();
|
|
104
|
-
ctx.fillText(i * 25 + "%", 4, y + 4);
|
|
105
|
-
}
|
|
106
|
-
ctx.fillText("new", padL, h - 6);
|
|
107
|
-
const label = maxAge + (maxAge === 1 ? " lived day" : " lived days");
|
|
108
|
-
ctx.fillText(label, plotR - ctx.measureText(label).width, h - 6);
|
|
109
|
-
|
|
110
|
-
// the right margin: strength, distributed, split by band
|
|
111
|
-
const steps = MEM.strengthByBand || [];
|
|
112
|
-
const peak = Math.max(1, ...steps.map((s) => Object.values(s.bands).reduce((a, b) => a + b, 0)));
|
|
113
|
-
const mx = plotR + 12, mw = margin - 8;
|
|
114
|
-
ctx.strokeStyle = "rgba(0,229,255,.14)";
|
|
115
|
-
ctx.beginPath(); ctx.moveTo(mx - 0.5, padT); ctx.lineTo(mx - 0.5, h - padB); ctx.stroke();
|
|
116
|
-
for (const s of steps) {
|
|
117
|
-
const y0 = Y(s.to), y1 = Y(s.from);
|
|
118
|
-
const bh = Math.max(1, y1 - y0 - 2);
|
|
119
|
-
let x = mx;
|
|
120
|
-
for (const b of ["episodic", "semantic", "identity"]) {
|
|
121
|
-
const n = s.bands[b] || 0;
|
|
122
|
-
if (n === 0) continue; // nothing drawn for an empty band — no colour without a memory behind it
|
|
123
|
-
const bw = (n / peak) * mw;
|
|
124
|
-
ctx.globalAlpha = filters.band && filters.band !== b ? 0.2 : 0.85;
|
|
125
|
-
ctx.fillStyle = BANDCOL[b];
|
|
126
|
-
ctx.fillRect(x, y0 + 1, bw, bh);
|
|
127
|
-
x += bw;
|
|
128
|
-
}
|
|
129
|
-
ctx.globalAlpha = 1;
|
|
130
|
-
const total = Object.values(s.bands).reduce((a, b) => a + b, 0);
|
|
131
|
-
if (total > 0 && !narrow) {
|
|
132
|
-
ctx.fillStyle = "#79848f";
|
|
133
|
-
ctx.fillText(String(total), Math.min(x + 4, w - 24), y0 + bh / 2 + 5);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (MEM.points.length === 0) {
|
|
138
|
-
ctx.fillStyle = "#8a95a3";
|
|
139
|
-
ctx.fillText(String(MEM.pointsAbsent || "(never run)") + " — no memory to plot yet. Write a note, or just talk.", padL + 8, h / 2);
|
|
140
|
-
conPoints = [];
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (allNew) {
|
|
145
|
-
ctx.fillStyle = "#8a95a3";
|
|
146
|
-
const msg = "All " + MEM.points.length + " were born today. They spread out to the right as days pass, and rise as they settle.";
|
|
147
|
-
ctx.fillText(narrow ? "All born today — they spread out as days pass." : msg, padL + 30, Y(0.62));
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
conPoints = [];
|
|
151
|
-
const few = MEM.points.length < 20;
|
|
152
|
-
// Memories born the same day at the same strength would sit on one pixel —
|
|
153
|
-
// on a young store, all of them. Stack them as a small sunflower instead, so
|
|
154
|
-
// five memories read as five dots.
|
|
155
|
-
const stacked = new Map();
|
|
156
|
-
for (const p of MEM.points) {
|
|
157
|
-
const r = (few ? 4 : 2) + Math.max(0, Math.min(1, p.salience)) * (few ? 6 : 5);
|
|
158
|
-
let x = X(p.ageDays), y = Y(p.strength);
|
|
159
|
-
const key = Math.round(x / 3) + "," + Math.round(y / 3);
|
|
160
|
-
const i = stacked.get(key) || 0;
|
|
161
|
-
stacked.set(key, i + 1);
|
|
162
|
-
if (i > 0 && few) {
|
|
163
|
-
const rad = 12 * Math.sqrt(i), th = i * 2.39996;
|
|
164
|
-
x = Math.max(padL + r, Math.min(plotR - r, x + rad * Math.cos(th)));
|
|
165
|
-
y = Math.max(padT + r, Math.min(h - padB - r, y + rad * Math.sin(th)));
|
|
166
|
-
}
|
|
167
|
-
const col = BANDCOL[p.band] || COL.dim;
|
|
168
|
-
const faded = filters.band && filters.band !== p.band;
|
|
169
|
-
ctx.globalAlpha = faded ? 0.15 : 1;
|
|
170
|
-
ctx.beginPath();
|
|
171
|
-
ctx.arc(x, y, r, 0, Math.PI * 2);
|
|
172
|
-
ctx.fillStyle = col + (p.protected ? "ee" : "aa");
|
|
173
|
-
ctx.fill();
|
|
174
|
-
if (p.protected || p.band === "identity") { ctx.strokeStyle = col; ctx.lineWidth = 1; ctx.stroke(); }
|
|
175
|
-
ctx.globalAlpha = 1;
|
|
176
|
-
if (!faded) conPoints.push({ x, y, r: Math.max(r, 6), p });
|
|
177
|
-
}
|
|
178
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/* The six kinds, in words: what each is, how many I hold, how fast it fades
|
|
2
|
-
and how easily it is corrected. Click one to filter the list. (The physics
|
|
3
|
-
numbers behind the words are still in `/api/memories`; the flow tab is
|
|
4
|
-
where they will be shown.) */
|
|
5
|
-
import { $, esc } from "../../../shared/dom.js";
|
|
6
|
-
import { filters, onFilter, toggle } from "../state.js";
|
|
7
|
-
|
|
8
|
-
export const markup = `
|
|
9
|
-
<h2>Kinds <small>— what sort of thing each memory is</small></h2>
|
|
10
|
-
<div class="kindgrid" id="kinds" role="group" aria-label="kinds — click one to filter the list"></div>`;
|
|
11
|
-
|
|
12
|
-
let data = null;
|
|
13
|
-
|
|
14
|
-
export function mount() {
|
|
15
|
-
$("kinds").addEventListener("click", (e) => {
|
|
16
|
-
const card = e.target.closest("[data-kind]");
|
|
17
|
-
if (card) toggle("kind", card.dataset.kind);
|
|
18
|
-
});
|
|
19
|
-
onFilter(paintCards);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function paint(d) { data = d; paintCards(); }
|
|
23
|
-
|
|
24
|
-
function paintCards() {
|
|
25
|
-
if (!data) return;
|
|
26
|
-
const peak = Math.max(1, ...data.kinds.map((k) => k.count));
|
|
27
|
-
$("kinds").innerHTML = data.kinds.map((k) => {
|
|
28
|
-
const p = k.plain || { label: k.kind, what: k.gloss, fades: "", corrects: "" };
|
|
29
|
-
const on = filters.kind === k.kind;
|
|
30
|
-
return '<button type="button" class="kcard' + (k.absent ? " none" : "") + (on ? " on" : "") +
|
|
31
|
-
'" data-kind="' + esc(k.kind) + '" aria-pressed="' + on + '">' +
|
|
32
|
-
'<span class="kline"><span class="kname">' + esc(p.label) + '</span><span class="kn">' +
|
|
33
|
-
(k.absent ? esc(k.absent) : k.count) + "</span></span>" +
|
|
34
|
-
'<span class="kbar"><span style="width:' + (k.count / peak) * 100 + '%"></span></span>' +
|
|
35
|
-
'<span class="kwhat">' + esc(p.what) + "</span>" +
|
|
36
|
-
'<span class="kfade">' + esc(p.fades) + (p.corrects ? ", " + esc(p.corrects) : "") + "</span>" +
|
|
37
|
-
'<span class="kspeed" title="how fast it fades">' +
|
|
38
|
-
[0, 1, 2, 3, 4].map((i) => '<i class="' + (i < Math.round((k.fadeSpeed || 0) * 5) ? "f" : "") + '"></i>').join("") +
|
|
39
|
-
"<em>fades</em></span>" +
|
|
40
|
-
"</button>";
|
|
41
|
-
}).join("");
|
|
42
|
-
}
|