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,8 +1,8 @@
|
|
|
1
1
|
/* The memories tab. */
|
|
2
2
|
|
|
3
|
-
/* ── the top:
|
|
4
|
-
.mem-top{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px}
|
|
5
|
-
.mem-
|
|
3
|
+
/* ── the top: a short count + the page's buttons ── */
|
|
4
|
+
.mem-top{display:flex;align-items:center;justify-content:space-between;gap:10px 12px;flex-wrap:wrap;margin-bottom:14px}
|
|
5
|
+
.mem-count{color:var(--dim);font-size:13.5px;line-height:1.5;margin:0;flex:1 1 14rem;min-width:0}
|
|
6
6
|
.tools{display:flex;gap:8px;flex-wrap:wrap}
|
|
7
7
|
.mbtn{background:none;border:1px solid var(--border);border-radius:6px;color:var(--ink);font:inherit;font-size:13px;
|
|
8
8
|
padding:8px 14px;cursor:pointer;white-space:nowrap;transition:border-color .2s,color .2s,box-shadow .2s}
|
|
@@ -23,105 +23,131 @@
|
|
|
23
23
|
.np-hint code{font-family:var(--mono)}
|
|
24
24
|
|
|
25
25
|
/* ── find: search + ask ── */
|
|
26
|
-
.find{display:grid;grid-template-columns:1fr
|
|
26
|
+
.find{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,22rem),1fr));gap:12px 20px;margin-bottom:8px;align-items:start}
|
|
27
27
|
.find>*{min-width:0}
|
|
28
28
|
.find-lab{display:block;font-size:13px;font-weight:600;color:var(--ink);margin-bottom:6px}
|
|
29
29
|
.find-row{display:flex;align-items:center;gap:10px;margin-bottom:8px}
|
|
30
|
-
#q,#ask-q{flex:1;min-width:0;background:var(--card);border:1px solid
|
|
30
|
+
#q,#ask-q{flex:1;min-width:0;background:var(--card);border:1px solid rgba(0,229,255,.34);border-radius:6px;
|
|
31
31
|
color:inherit;font:inherit;font-size:14px;padding:11px 14px;outline:none}
|
|
32
32
|
#q:focus,#ask-q:focus{border-color:var(--cyan);box-shadow:0 0 12px rgba(0,229,255,.12)}
|
|
33
|
-
#ask-q{border-color:rgba(179,136,255,.
|
|
33
|
+
#ask-q{border-color:rgba(179,136,255,.55)}
|
|
34
34
|
#ask-q:focus{border-color:var(--purple);box-shadow:0 0 12px rgba(179,136,255,.15)}
|
|
35
35
|
#qn{color:var(--dim);font-size:12px;white-space:nowrap}
|
|
36
|
-
#qout,#ask-out .
|
|
36
|
+
#qout,#ask-out .mlist{max-height:440px;overflow-y:auto}
|
|
37
37
|
.ask-head{color:var(--dim);font-size:12px;margin:2px 0 6px}
|
|
38
|
-
.rows .r b{color:var(--ink);font-weight:600}
|
|
39
|
-
.bdot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px;vertical-align:0}
|
|
40
|
-
.bdot.hollow{background:none;border:1.5px solid}
|
|
41
|
-
.tier{color:var(--dim)}
|
|
42
|
-
.tier-vivid{color:var(--cyan)}
|
|
43
38
|
|
|
44
|
-
|
|
45
|
-
.glance{padding:0}
|
|
46
|
-
.bandkey{display:flex;gap:8px;flex-wrap:wrap;align-items:center;padding:12px 14px 0}
|
|
47
|
-
.bchip{display:inline-flex;align-items:center;gap:7px;background:var(--deep);border:1px solid var(--border);border-radius:20px;
|
|
48
|
-
color:var(--ink);font:inherit;font-size:12.5px;padding:6px 12px;cursor:pointer}
|
|
49
|
-
.bchip:hover:not(:disabled){border-color:var(--glow)}
|
|
50
|
-
.bchip.on{border-color:var(--cyan);box-shadow:0 0 10px rgba(0,229,255,.18)}
|
|
51
|
-
.bchip.none{cursor:default;color:var(--dim)}
|
|
52
|
-
.bchip .bn{font-family:var(--mono);font-weight:700}
|
|
53
|
-
.bchip .bw{color:var(--dim);font-size:12px}
|
|
54
|
-
.bchip .bdot{margin-right:0}
|
|
55
|
-
.bhint{color:var(--dim);font-size:12px}
|
|
56
|
-
.glance .chart{padding:8px 12px 2px}
|
|
57
|
-
.glance-foot{display:flex;gap:18px;flex-wrap:wrap;color:var(--faint);font-size:11.5px;padding:0 16px 12px}
|
|
39
|
+
.mfilters .q-wrap.open{display:block;flex-basis:100%}
|
|
58
40
|
|
|
59
|
-
/* ──
|
|
60
|
-
.
|
|
61
|
-
.
|
|
62
|
-
|
|
63
|
-
.
|
|
64
|
-
.
|
|
65
|
-
.
|
|
66
|
-
.
|
|
67
|
-
.
|
|
68
|
-
|
|
69
|
-
.
|
|
70
|
-
.
|
|
71
|
-
.
|
|
72
|
-
.
|
|
73
|
-
.
|
|
74
|
-
.
|
|
75
|
-
.
|
|
76
|
-
.
|
|
77
|
-
|
|
41
|
+
/* ── the two small pictures: how firmly it's held, how it feels ── */
|
|
42
|
+
.glance2{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,24rem),1fr));gap:0 20px;align-items:start}
|
|
43
|
+
.glance-card{display:flex;flex-direction:column;min-width:0}
|
|
44
|
+
.glance-card .card{flex:1;margin-bottom:8px}
|
|
45
|
+
.glance-empty{color:var(--dim);font-size:13px;line-height:1.55;margin:4px 0}
|
|
46
|
+
.glance-note{color:var(--dim);font-size:12.5px;line-height:1.5;margin:10px 0 0}
|
|
47
|
+
.hold{display:flex;flex-direction:column;justify-content:center}
|
|
48
|
+
.hbar{display:flex;gap:3px;height:40px;border-radius:6px;overflow:hidden}
|
|
49
|
+
.hseg{min-width:10px;border:none;padding:0 8px;cursor:pointer;display:flex;align-items:center;justify-content:center;
|
|
50
|
+
font:inherit;font-family:var(--mono);font-size:13px;font-weight:700;transition:opacity .15s,box-shadow .15s}
|
|
51
|
+
.hseg.firm{background:#00e5ff;color:#03252b}
|
|
52
|
+
.hseg.settling{background:rgba(0,229,255,.38);color:#e8fbff}
|
|
53
|
+
.hseg.fading{background:#ffb74d;color:#2b1a00}
|
|
54
|
+
.hseg:hover{box-shadow:inset 0 0 0 2px rgba(255,255,255,.55)}
|
|
55
|
+
.hseg.on{box-shadow:inset 0 0 0 2px #fff}
|
|
56
|
+
.hseg.off{opacity:.35}
|
|
57
|
+
.hkeys{display:flex;flex-wrap:wrap;gap:6px 8px;margin-top:10px}
|
|
58
|
+
.hkey{display:inline-flex;align-items:center;gap:6px;background:none;border:1px solid var(--border);border-radius:20px;
|
|
59
|
+
color:var(--ink);font:inherit;font-size:12.5px;padding:5px 11px;cursor:pointer}
|
|
60
|
+
.hkey:hover:not(:disabled){border-color:var(--glow)}
|
|
61
|
+
.hkey.on{border-color:var(--cyan);color:var(--cyan)}
|
|
62
|
+
.hkey:disabled{color:var(--dim);cursor:default}
|
|
63
|
+
.hkey i,.hdot{display:inline-block;width:10px;height:10px;border-radius:3px}
|
|
64
|
+
.hkey .fn{font-family:var(--mono);color:var(--dim)}
|
|
65
|
+
.hkey.firm i,.hdot.firm{background:#00e5ff}
|
|
66
|
+
.hkey.settling i,.hdot.settling{background:rgba(0,229,255,.38)}
|
|
67
|
+
.hkey.fading i,.hdot.fading{background:#ffb74d}
|
|
68
|
+
.feel-row{display:flex;flex-wrap:wrap;gap:6px 18px;align-items:center}
|
|
69
|
+
.feel-svg{flex:1 1 15rem;max-width:22rem;min-width:0;height:auto;overflow:visible}
|
|
70
|
+
.feel-ring{fill:none;stroke:rgba(0,229,255,.1);stroke-width:1}
|
|
71
|
+
.feel-spoke{stroke:rgba(0,229,255,.1);stroke-width:1}
|
|
72
|
+
.feel-shape{fill-opacity:.2;stroke-width:1.8;stroke-linejoin:round}
|
|
73
|
+
.feel-hit{fill:transparent;cursor:pointer}
|
|
74
|
+
.feel-axis:focus{outline:none}
|
|
75
|
+
.feel-axis:focus-visible .feel-label,.feel-axis.on .feel-label{fill:var(--ink);font-weight:600}
|
|
76
|
+
.feel-label{fill:var(--dim);font-family:var(--sans);font-size:12px}
|
|
77
|
+
.feel-axis:hover .feel-label{fill:var(--ink)}
|
|
78
|
+
.feel-side{flex:1 1 9rem;min-width:0;display:flex;flex-direction:column;gap:10px}
|
|
79
|
+
.feel-legend{display:flex;gap:14px;font-size:12.5px;color:var(--ink)}
|
|
80
|
+
.feel-legend span{display:inline-flex;align-items:center;gap:6px}
|
|
81
|
+
.feel-legend i{display:inline-block;width:10px;height:10px;border-radius:50%}
|
|
82
|
+
.feel-detail{font-size:13px;line-height:1.6;color:var(--ink);min-height:4.8em;overflow-wrap:anywhere}
|
|
83
|
+
.feel-who{display:inline-block;min-width:3.2em;font-size:12px}
|
|
84
|
+
.feel-hint{color:var(--dim)}
|
|
85
|
+
.feel-line{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin-top:5px}
|
|
86
|
+
.fword{display:inline-flex;align-items:center;gap:4px;background:none;border:1px solid var(--border);border-radius:14px;
|
|
87
|
+
color:var(--ink);font:inherit;font-size:12.5px;line-height:1.3;padding:3px 9px;cursor:pointer}
|
|
88
|
+
.fword:hover{border-color:var(--glow)}
|
|
89
|
+
.fword.on{border-color:var(--cyan);color:var(--cyan);background:rgba(0,229,255,.06)}
|
|
90
|
+
.fword .fn{font-family:var(--mono);color:var(--dim)}
|
|
91
|
+
.feel-axis.filtering .feel-label{fill:var(--cyan);font-weight:600}
|
|
92
|
+
.fchip .fx{color:var(--dim);font-size:11px}
|
|
78
93
|
|
|
79
94
|
/* ── the list ── */
|
|
95
|
+
.mlist-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px 16px;flex-wrap:wrap}
|
|
96
|
+
.mlist-head h2{margin-bottom:8px}
|
|
97
|
+
.msort{margin-bottom:8px}
|
|
80
98
|
.mfilters{display:flex;flex-wrap:wrap;gap:8px 16px;margin-bottom:10px;align-items:center}
|
|
81
|
-
.fgroup{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
|
|
82
|
-
.fchip{background:none;border:1px solid var(--border);border-radius:20px;
|
|
83
|
-
padding:5px 11px;cursor:pointer}
|
|
99
|
+
.fgroup{display:flex;flex-wrap:wrap;gap:6px;align-items:center;min-width:0}
|
|
100
|
+
.fchip{display:inline-flex;align-items:center;gap:5px;background:none;border:1px solid var(--border);border-radius:20px;
|
|
101
|
+
color:var(--ink);font:inherit;font-size:12.5px;padding:5px 11px;cursor:pointer;white-space:nowrap}
|
|
84
102
|
.fchip:hover{border-color:var(--glow)}
|
|
85
103
|
.fchip.on{border-color:var(--cyan);color:var(--cyan);background:rgba(0,229,255,.06)}
|
|
86
104
|
.fchip.zero{color:var(--dim)}
|
|
87
|
-
.fchip .fn{font-family:var(--mono);color:var(--dim)
|
|
105
|
+
.fchip .fn{font-family:var(--mono);color:var(--dim)}
|
|
88
106
|
.fchip.on .fn{color:var(--cyan)}
|
|
107
|
+
.fchip .star{color:#d9c8ff}
|
|
89
108
|
.fchip.clear{color:var(--dim);border-style:dashed}
|
|
90
|
-
.seggroup{gap:0}
|
|
109
|
+
.seggroup{display:flex;gap:0}
|
|
91
110
|
.seggroup .fchip{border-radius:0;margin-left:-1px}
|
|
92
111
|
.seggroup .fchip:first-child{border-radius:20px 0 0 20px;margin-left:0}
|
|
93
112
|
.seggroup .fchip:last-child{border-radius:0 20px 20px 0}
|
|
94
113
|
.mlist{margin-bottom:10px}
|
|
95
114
|
.mlist .empty{margin:10px}
|
|
96
|
-
|
|
97
|
-
|
|
115
|
+
|
|
116
|
+
/* A row: words on the left, date · kind · marks on the right. How firmly it is
|
|
117
|
+
held is its brightness — five real colours, the dimmest still ≥ --faint. */
|
|
118
|
+
.mrow{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 18px;align-items:start;padding:10px 15px;
|
|
119
|
+
border-bottom:1px solid var(--border);cursor:pointer;--t:#b8c1cc;--x:#96a0ab}
|
|
98
120
|
.mrow:last-child{border-bottom:none}
|
|
99
121
|
.mrow:hover,.mrow:focus{background:var(--hover);outline:none}
|
|
100
|
-
.
|
|
101
|
-
.
|
|
102
|
-
.mrow.
|
|
122
|
+
.mrow:focus-visible{box-shadow:inset 0 0 0 1px var(--cyan)}
|
|
123
|
+
.mrow.lit-1{--t:#8f9aa8;--x:#7c8793}
|
|
124
|
+
.mrow.lit-2{--t:#a3adb9;--x:#88939e}
|
|
125
|
+
.mrow.lit-3{--t:#b8c1cc;--x:#96a0ab}
|
|
126
|
+
.mrow.lit-4{--t:#d3dae2;--x:#a9b2bc}
|
|
127
|
+
.mrow.lit-5{--t:#f1f5f9;--x:#bdc5ce}
|
|
128
|
+
.mmain{min-width:0}
|
|
129
|
+
.mtitle{color:var(--t);font-size:14px;font-weight:600;line-height:1.45;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
130
|
+
.mtext{color:var(--x);font-size:13px;line-height:1.5;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;
|
|
131
|
+
-webkit-box-orient:vertical;overflow-wrap:anywhere;margin-top:1px}
|
|
132
|
+
.mtext.solo{color:var(--t);font-size:13.5px;margin-top:0}
|
|
103
133
|
.mwhy{color:var(--amber);font-size:12px;margin-top:3px}
|
|
104
|
-
.
|
|
105
|
-
.
|
|
106
|
-
.
|
|
107
|
-
.
|
|
108
|
-
.
|
|
109
|
-
.
|
|
110
|
-
.
|
|
111
|
-
.mpager{display:flex;align-items:center;justify-content:center;gap:14px;margin:6px 0 20px}
|
|
134
|
+
.mside{display:flex;flex-direction:column;align-items:flex-end;gap:4px;min-width:0;padding-top:2px}
|
|
135
|
+
.mline{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end;min-height:18px}
|
|
136
|
+
.mdate{color:var(--faint);font-size:12px;white-space:nowrap}
|
|
137
|
+
.mkind{display:inline-flex;align-items:center;gap:5px;color:var(--faint);font-size:12px;white-space:nowrap}
|
|
138
|
+
.mtier{color:var(--faint);font-size:11.5px;white-space:nowrap}
|
|
139
|
+
.mrow.lit-5 .mtier{color:var(--cyan)}
|
|
140
|
+
.mpager{display:flex;align-items:center;justify-content:center;gap:14px;margin:6px 0 20px;flex-wrap:wrap}
|
|
112
141
|
.mpage{color:var(--dim);font-size:12.5px}
|
|
113
142
|
|
|
114
|
-
@media(max-width:
|
|
115
|
-
|
|
116
|
-
.
|
|
117
|
-
.
|
|
118
|
-
.mrow{grid-template-columns:1fr;gap:6px}
|
|
119
|
-
.mmeta{grid-template-columns:auto 1fr auto auto;gap:10px}
|
|
143
|
+
@media(max-width:640px){
|
|
144
|
+
.mrow{grid-template-columns:minmax(0,1fr);padding:10px 12px}
|
|
145
|
+
.mside{flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:4px 12px;padding-top:4px}
|
|
146
|
+
.mline{justify-content:flex-start}
|
|
120
147
|
}
|
|
121
148
|
/* A thumb needs 44px on everything it presses. */
|
|
122
149
|
@media(max-width:720px){
|
|
123
|
-
.mbtn,.fchip,.
|
|
124
|
-
.kcard{min-height:44px}
|
|
150
|
+
.mbtn,.fchip,.hkey,.fword,#q,#ask-q{min-height:44px}
|
|
125
151
|
.np-row{flex-wrap:wrap}
|
|
126
152
|
}
|
|
127
153
|
|
|
@@ -140,4 +166,3 @@
|
|
|
140
166
|
.mdialog .confirm-buttons button{font-size:13px;padding:8px 14px}
|
|
141
167
|
.fd-go{color:var(--cyan)!important;border-color:rgba(0,229,255,.45)!important}
|
|
142
168
|
@media(max-width:720px){.mdialog .confirm-buttons button,.fd-set label{min-height:44px}}
|
|
143
|
-
.bchip.none .bn{font-family:var(--sans);font-weight:400}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* One memory as a row — the shape the list, the search hits and Ask's answers
|
|
2
|
+
all share. Title on its own line with the words dimmer beneath (two lines,
|
|
3
|
+
clipped); the date, the kind and the marks on the right. How firmly it is
|
|
4
|
+
held is the row's BRIGHTNESS (`lit-1` … `lit-5`, real colours that stay
|
|
5
|
+
readable at the dimmest), with one quiet meter beside it. */
|
|
6
|
+
import { esc } from "../../shared/dom.js";
|
|
7
|
+
import { badges, feelingDots, kindMark, kindOf, litLevel, shortDate, strengthMeter } from "../../shared/memory-marks.js";
|
|
8
|
+
import { openMemory } from "../../shared/memory-modal.js";
|
|
9
|
+
|
|
10
|
+
/** Rows under `container` open their memory on a click or Enter (one listener
|
|
11
|
+
* for every row it will ever hold, so a repaint needs no rewiring). */
|
|
12
|
+
export function wireRows(container) {
|
|
13
|
+
const open = (e) => {
|
|
14
|
+
const row = e.target.closest(".mrow[data-id]");
|
|
15
|
+
if (row && container.contains(row)) openMemory(row.dataset.id);
|
|
16
|
+
};
|
|
17
|
+
container.addEventListener("click", open);
|
|
18
|
+
container.addEventListener("keydown", (e) => { if (e.key === "Enter") open(e); });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const DATE_WORDS = { text: "the date written in the memory", chapter: "the day its journal chapter names", recorded: "the day it was recorded" };
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* `r`: { id, title, text, confidential, kind, strength, date, dateFrom, core,
|
|
25
|
+
* protected, journal, feelings, archived, schemaRole }. `opts.lit` overrides the
|
|
26
|
+
* brightness (Ask's tiers); `opts.tier` adds a small tier word in place of the
|
|
27
|
+
* meter.
|
|
28
|
+
*/
|
|
29
|
+
export function memRow(r, opts = {}) {
|
|
30
|
+
const lit = r.archived ? 1 : opts.lit ?? (r.journal ? 3 : litLevel(r.strength));
|
|
31
|
+
const words = r.confidential ? '<span class="withheld">' + esc(r.text) + "</span>" : esc(r.text || "");
|
|
32
|
+
const main = r.title
|
|
33
|
+
? '<div class="mtitle">' + esc(r.title) + "</div>" + (r.text ? '<div class="mtext">' + words + "</div>" : "")
|
|
34
|
+
: '<div class="mtext solo">' + words + "</div>";
|
|
35
|
+
const k = kindOf(r.kind);
|
|
36
|
+
const kindWords = k.label + (r.schemaRole ? " · " + r.schemaRole : "");
|
|
37
|
+
const held = opts.tier ? '<span class="mtier">' + esc(opts.tier) + "</span>"
|
|
38
|
+
: r.journal || r.archived ? "" : strengthMeter(r.strength);
|
|
39
|
+
const id = esc(r.id);
|
|
40
|
+
return '<div class="mrow click lit-' + lit + (r.archived ? " arch" : "") + '" role="button" tabindex="0" data-id="' + id + '">' +
|
|
41
|
+
'<div class="mmain">' + main +
|
|
42
|
+
(r.archived ? '<div class="mwhy">archived: ' + esc(r.archived) + "</div>" : "") + "</div>" +
|
|
43
|
+
'<div class="mside">' +
|
|
44
|
+
'<span class="mline">' + held +
|
|
45
|
+
(r.date ? '<span class="mdate" title="' + esc(DATE_WORDS[r.dateFrom] || "") + '">' + esc(shortDate(r.date)) + "</span>" : "") +
|
|
46
|
+
"</span>" +
|
|
47
|
+
'<span class="mline">' + badges(r) + feelingDots(r.feelings) +
|
|
48
|
+
'<span class="mkind" title="' + esc(kindWords) + '">' + kindMark(r.kind, false) + '<span class="klabel">' + esc(kindWords) + "</span></span>" +
|
|
49
|
+
"</span>" +
|
|
50
|
+
"</div></div>";
|
|
51
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/* "How it feels": a radar of the feelings wheel's six cores, in wheel order,
|
|
2
|
+
with two shapes laid over each other — yours (the feelings recorded as the
|
|
3
|
+
owner's) and mine (this counterpart's own). Each axis is how much of that
|
|
4
|
+
feeling runs through the live memories: the recorded strengths summed, both
|
|
5
|
+
shapes scaled by the one largest axis so they compare, on a square-root
|
|
6
|
+
scale so a little of a feeling still shows beside a lot. Hover an axis for the
|
|
7
|
+
feelings under it; click or tap one to pin them and filter the list to that
|
|
8
|
+
core; click a word to filter to that feeling, from that side. Plain SVG. */
|
|
9
|
+
import { $, esc } from "../../../shared/dom.js";
|
|
10
|
+
import { FEELING_COLOURS } from "../../../shared/memory-marks.js";
|
|
11
|
+
import { hideTip, showTip } from "../../../shared/tip.js";
|
|
12
|
+
import { q, wireTips } from "../../../shared/widgets/tips.js";
|
|
13
|
+
import { filters, onFilter, setFilter } from "../state.js";
|
|
14
|
+
|
|
15
|
+
const YOURS = "#ffb74d";
|
|
16
|
+
const MINE = "#b388ff";
|
|
17
|
+
/** Under this many memories with feelings, say how few there are. */
|
|
18
|
+
const FEW = 20;
|
|
19
|
+
|
|
20
|
+
export const markup = `
|
|
21
|
+
<div class="glance-card">
|
|
22
|
+
<h2 id="feel-h">How it feels<span id="feel-q"></span></h2>
|
|
23
|
+
<div class="card pad feel" id="feel"></div>
|
|
24
|
+
</div>`;
|
|
25
|
+
|
|
26
|
+
let data = null;
|
|
27
|
+
/** The axis whose feelings are showing (kept across a live refresh). */
|
|
28
|
+
let picked = null;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Hover floats an axis's words by the pointer and changes nothing. A click or a
|
|
32
|
+
* tap on an axis pins its words beside the chart AND filters the list to every
|
|
33
|
+
* memory with a feeling under that core (again: clears it). A click on a word
|
|
34
|
+
* in the pinned readout filters to that feeling, from that side. The readout
|
|
35
|
+
* changes only on a click, so a pointer crossing other axes on its way to a
|
|
36
|
+
* word leaves it alone.
|
|
37
|
+
*/
|
|
38
|
+
export function mount() {
|
|
39
|
+
const el = $("feel");
|
|
40
|
+
el.addEventListener("click", (e) => {
|
|
41
|
+
const w = e.target.closest("button[data-word]");
|
|
42
|
+
if (w) {
|
|
43
|
+
const cur = filters.feeling;
|
|
44
|
+
const same = cur && cur.word === w.dataset.word && cur.whose === w.dataset.whose;
|
|
45
|
+
filterBy({ feeling: same ? null : { word: w.dataset.word, whose: w.dataset.whose }, feelingCore: null }, !same);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const a = e.target.closest("[data-core]");
|
|
49
|
+
if (!a) return;
|
|
50
|
+
picked = a.dataset.core;
|
|
51
|
+
hideTip();
|
|
52
|
+
// No scroll here: the words just pinned are what a phone taps next.
|
|
53
|
+
filterBy({ feeling: null, feelingCore: filters.feelingCore === picked ? null : picked }, false);
|
|
54
|
+
});
|
|
55
|
+
el.addEventListener("keydown", (e) => {
|
|
56
|
+
const a = e.target.closest("g[data-core]");
|
|
57
|
+
if (a && (e.key === "Enter" || e.key === " ")) { e.preventDefault(); a.dispatchEvent(new MouseEvent("click", { bubbles: true })); }
|
|
58
|
+
});
|
|
59
|
+
// With a pointer, the words also float by it (the shell's hover tip).
|
|
60
|
+
el.addEventListener("mousemove", (e) => {
|
|
61
|
+
const a = e.target.closest("g[data-core]");
|
|
62
|
+
const c = a && data ? data.cores.find((x) => x.core === a.dataset.core) : null;
|
|
63
|
+
if (!c) return hideTip();
|
|
64
|
+
showTip(e.clientX, e.clientY, detailHtml(c, false));
|
|
65
|
+
});
|
|
66
|
+
el.addEventListener("mouseleave", hideTip);
|
|
67
|
+
onFilter(showDetail);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Set the feeling filter; for a word, bring the list up if its rows would be off screen. */
|
|
71
|
+
function filterBy(patch, scroll) {
|
|
72
|
+
setFilter(patch);
|
|
73
|
+
const h = document.getElementById("mlist-h");
|
|
74
|
+
if (scroll && h && h.getBoundingClientRect().top > innerHeight * 0.5) h.scrollIntoView({ block: "start", behavior: "smooth" });
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function paint(d) {
|
|
78
|
+
data = d.feelings;
|
|
79
|
+
$("feel-q").innerHTML = q("feel",
|
|
80
|
+
"The six core feelings of the feelings wheel. The amber shape is yours — how you felt about the moments I kept; the purple one is mine. " +
|
|
81
|
+
"Each axis sums the strength of every feeling recorded under it, across the memories I hold now; both shapes share one scale, " +
|
|
82
|
+
"so a bigger shape means more of it was recorded (the scale is a square root, so small amounts still show). Hover a feeling for the words under it; click or tap one to show those memories below, and click a word for just that feeling.");
|
|
83
|
+
wireTips($("feel-q"));
|
|
84
|
+
draw();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function draw() {
|
|
88
|
+
const f = data;
|
|
89
|
+
if (!f) return;
|
|
90
|
+
const cores = f.cores;
|
|
91
|
+
const max = Math.max(0, ...cores.map((c) => Math.max(c.yours.sum, c.mine.sum)));
|
|
92
|
+
const W = 300, H = 250, cx = W / 2, cy = H / 2 + 2, R = 86;
|
|
93
|
+
const ang = (i) => -Math.PI / 2 + (i * 2 * Math.PI) / cores.length;
|
|
94
|
+
const pt = (i, r) => [cx + r * Math.cos(ang(i)), cy + r * Math.sin(ang(i))];
|
|
95
|
+
const fmt = (p) => p[0].toFixed(1) + "," + p[1].toFixed(1);
|
|
96
|
+
let svg = '<svg class="feel-svg" viewBox="0 0 ' + W + " " + H + '" role="img" aria-label="' +
|
|
97
|
+
esc("how it feels: " + cores.map((c) => c.core + " yours " + c.yours.count + ", mine " + c.mine.count).join("; ")) + '">';
|
|
98
|
+
for (const k of [1 / 3, 2 / 3, 1]) {
|
|
99
|
+
svg += '<polygon class="feel-ring" points="' + cores.map((_, i) => fmt(pt(i, R * k))).join(" ") + '"/>';
|
|
100
|
+
}
|
|
101
|
+
cores.forEach((c, i) => {
|
|
102
|
+
const [x, y] = pt(i, R);
|
|
103
|
+
svg += '<line class="feel-spoke" x1="' + cx + '" y1="' + cy + '" x2="' + x.toFixed(1) + '" y2="' + y.toFixed(1) + '"/>';
|
|
104
|
+
});
|
|
105
|
+
if (max > 0) {
|
|
106
|
+
for (const [who, col] of [["yours", YOURS], ["mine", MINE]]) {
|
|
107
|
+
if (cores.every((c) => c[who].sum === 0)) continue;
|
|
108
|
+
const pts = cores.map((c, i) => fmt(pt(i, R * Math.sqrt(c[who].sum / max)))).join(" ");
|
|
109
|
+
svg += '<polygon class="feel-shape" points="' + pts + '" style="fill:' + col + ";stroke:" + col + '"/>';
|
|
110
|
+
cores.forEach((c, i) => {
|
|
111
|
+
if (c[who].sum === 0) return;
|
|
112
|
+
const [x, y] = pt(i, R * Math.sqrt(c[who].sum / max));
|
|
113
|
+
svg += '<circle cx="' + x.toFixed(1) + '" cy="' + y.toFixed(1) + '" r="2.6" fill="' + col + '"/>';
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// Each axis: a wedge to hover or tap, and its word at the rim.
|
|
118
|
+
cores.forEach((c, i) => {
|
|
119
|
+
const a0 = ang(i) - Math.PI / cores.length, a1 = ang(i) + Math.PI / cores.length;
|
|
120
|
+
const w = [[cx, cy], [cx + (R + 34) * Math.cos(a0), cy + (R + 34) * Math.sin(a0)], [cx + (R + 34) * Math.cos(a1), cy + (R + 34) * Math.sin(a1)]];
|
|
121
|
+
const [lx, ly] = pt(i, R + 16);
|
|
122
|
+
const anchor = Math.abs(lx - cx) < 4 ? "middle" : lx > cx ? "start" : "end";
|
|
123
|
+
svg += '<g class="feel-axis' + (picked === c.core ? " on" : "") + '" data-core="' + esc(c.core) + '" tabindex="0" role="button" aria-label="' + esc(c.core) + '">' +
|
|
124
|
+
'<polygon class="feel-hit" points="' + w.map(fmt).join(" ") + '"/>' +
|
|
125
|
+
'<circle cx="' + (lx + (anchor === "start" ? -8 : anchor === "end" ? 8 : 0)).toFixed(1) + '" cy="' + (ly - (anchor === "middle" ? 12 : 4)).toFixed(1) +
|
|
126
|
+
'" r="3" fill="' + (FEELING_COLOURS[c.core] || "#8a95a3") + '"/>' +
|
|
127
|
+
'<text class="feel-label" x="' + lx.toFixed(1) + '" y="' + (ly + (anchor === "middle" && ly > cy ? 8 : 0)).toFixed(1) + '" text-anchor="' + anchor + '">' + esc(c.core) + "</text></g>";
|
|
128
|
+
});
|
|
129
|
+
svg += "</svg>";
|
|
130
|
+
const legend = '<div class="feel-legend"><span><i style="background:' + YOURS + '"></i>yours</span><span><i style="background:' + MINE + '"></i>mine</span></div>';
|
|
131
|
+
const line = f.carrying === 0
|
|
132
|
+
? '<p class="glance-empty">No feelings recorded yet. When a memory is kept with how it felt — yours or mine — it shows here.</p>'
|
|
133
|
+
: f.carrying < FEW
|
|
134
|
+
? '<p class="glance-note">' + f.carrying + (f.carrying === 1 ? " memory carries" : " memories carry") + " feelings so far.</p>"
|
|
135
|
+
: "";
|
|
136
|
+
$("feel").innerHTML = '<div class="feel-row">' + svg + '<div class="feel-side">' + (f.carrying ? legend : "") +
|
|
137
|
+
'<div class="feel-detail" id="feel-detail" aria-live="polite"></div></div></div>' + line;
|
|
138
|
+
showDetail();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function showDetail() {
|
|
142
|
+
const box = document.getElementById("feel-detail");
|
|
143
|
+
if (!box || !data) return;
|
|
144
|
+
// A core the list is filtered to is the one shown, after a refresh too.
|
|
145
|
+
if (filters.feelingCore) picked = filters.feelingCore;
|
|
146
|
+
document.querySelectorAll("#feel .feel-axis").forEach((g) => {
|
|
147
|
+
g.classList.toggle("on", g.dataset.core === picked);
|
|
148
|
+
g.classList.toggle("filtering", g.dataset.core === filters.feelingCore);
|
|
149
|
+
g.setAttribute("aria-pressed", String(g.dataset.core === filters.feelingCore));
|
|
150
|
+
});
|
|
151
|
+
const c = data.cores.find((x) => x.core === picked);
|
|
152
|
+
if (!c) {
|
|
153
|
+
box.innerHTML = data.carrying ? '<span class="feel-hint">Click or tap a feeling to see what’s under it, and to show those memories below.</span>' : "";
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
box.innerHTML = detailHtml(c, true);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** One core's feelings in words: `proud 3, joyful 1`, yours and mine. In the
|
|
160
|
+
* pinned readout each word is a chip that filters the list. */
|
|
161
|
+
function detailHtml(c, chips) {
|
|
162
|
+
const words = (s, whose) => {
|
|
163
|
+
if (!s.words.length) return '<span class="feel-hint">none</span>';
|
|
164
|
+
if (!chips) return s.words.map((w) => esc(w.word) + " " + w.count).join(", ");
|
|
165
|
+
const f = filters.feeling;
|
|
166
|
+
return s.words.map((w) => {
|
|
167
|
+
const on = !!f && f.word === w.word.toLowerCase() && f.whose === whose;
|
|
168
|
+
return '<button type="button" class="fword' + (on ? " on" : "") + '" data-word="' + esc(w.word.toLowerCase()) + '" data-whose="' + whose +
|
|
169
|
+
'" aria-pressed="' + on + '" title="show the memories carrying ' + esc(w.word) + " (" + (whose === "owner" ? "yours" : "mine") + ')">' +
|
|
170
|
+
esc(w.word) + ' <span class="fn">' + w.count + "</span></button>";
|
|
171
|
+
}).join("");
|
|
172
|
+
};
|
|
173
|
+
return '<b style="color:' + (FEELING_COLOURS[c.core] || "inherit") + '">' + esc(c.core) + "</b>" +
|
|
174
|
+
'<div class="feel-line"><span class="feel-who" style="color:' + YOURS + '">yours</span> ' + words(c.yours, "owner") + "</div>" +
|
|
175
|
+
'<div class="feel-line"><span class="feel-who" style="color:' + MINE + '">mine</span> ' + words(c.mine, "self") + "</div>";
|
|
176
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* "How firmly it's held": one bar in three parts — firm, settling, fading —
|
|
2
|
+
with their counts. Brighter is firmer (the tab's one visual language), and
|
|
3
|
+
fading is amber. Click a part to filter the list to it; click it again for
|
|
4
|
+
everything. Journal chapters aren't scored, so they are a note, not a part. */
|
|
5
|
+
import { $, esc } from "../../../shared/dom.js";
|
|
6
|
+
import { q, wireTips } from "../../../shared/widgets/tips.js";
|
|
7
|
+
import { filters, onFilter, toggle } from "../state.js";
|
|
8
|
+
|
|
9
|
+
const PARTS = [
|
|
10
|
+
["firm", "firm"],
|
|
11
|
+
["settling", "settling"],
|
|
12
|
+
["fading", "fading"],
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
export const markup = `
|
|
16
|
+
<div class="glance-card">
|
|
17
|
+
<h2 id="hold-h">How firmly it's held<span id="hold-q"></span></h2>
|
|
18
|
+
<div class="card pad hold" id="hold"></div>
|
|
19
|
+
</div>`;
|
|
20
|
+
|
|
21
|
+
let data = null;
|
|
22
|
+
|
|
23
|
+
export function mount() {
|
|
24
|
+
$("hold").addEventListener("click", (e) => {
|
|
25
|
+
const b = e.target.closest("[data-hold]");
|
|
26
|
+
if (b && !b.disabled) toggle("hold", b.dataset.hold);
|
|
27
|
+
});
|
|
28
|
+
onFilter(paintParts);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function paint(d) {
|
|
32
|
+
data = d;
|
|
33
|
+
$("hold-q").innerHTML = q("hold",
|
|
34
|
+
"Firm: in the core, protected, or strong enough that — even unused — it is still settled knowledge " + d.firmAheadDays +
|
|
35
|
+
" lived days from now. Fading: if nobody uses it, it will be let go (archived — kept, not deleted) within " + d.nearLetGoDays +
|
|
36
|
+
" lived days. Settling: everything between. Using a memory makes it firmer. Click a part to see those memories below.");
|
|
37
|
+
wireTips($("hold-q"));
|
|
38
|
+
paintParts();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function paintParts() {
|
|
42
|
+
if (!data) return;
|
|
43
|
+
const h = data.hold;
|
|
44
|
+
const scored = h.firm + h.settling + h.fading;
|
|
45
|
+
if (scored === 0) {
|
|
46
|
+
$("hold").innerHTML = '<p class="glance-empty">Nothing held yet. It fills in as we talk.</p>' + journalNote(h);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const seg = PARTS.filter(([k]) => h[k] > 0).map(([k, label]) => {
|
|
50
|
+
const on = filters.hold === k;
|
|
51
|
+
return '<button type="button" class="hseg ' + k + (on ? " on" : "") + (filters.hold && !on ? " off" : "") +
|
|
52
|
+
'" style="flex:' + h[k] + '" data-hold="' + k + '" aria-pressed="' + on + '" title="' + esc(label + ": " + h[k]) + '">' +
|
|
53
|
+
'<span class="hn">' + (h[k] / scored >= 0.08 ? h[k] : "") + "</span></button>";
|
|
54
|
+
}).join("");
|
|
55
|
+
const keys = PARTS.map(([k, label]) => {
|
|
56
|
+
const on = filters.hold === k;
|
|
57
|
+
return '<button type="button" class="hkey ' + k + (on ? " on" : "") + '" data-hold="' + k + '" aria-pressed="' + on + '"' +
|
|
58
|
+
(h[k] === 0 ? " disabled" : "") + '><i></i>' + esc(label) + ' <span class="fn">' + h[k] + "</span></button>";
|
|
59
|
+
}).join("");
|
|
60
|
+
$("hold").innerHTML = '<div class="hbar" role="group" aria-label="how firmly it is held — click a part to filter the list">' + seg + "</div>" +
|
|
61
|
+
'<div class="hkeys">' + keys + "</div>" + journalNote(h);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function journalNote(h) {
|
|
65
|
+
return h.journal ? '<p class="glance-note">' + h.journal + (h.journal === 1 ? " journal chapter isn't" : " journal chapters aren't") +
|
|
66
|
+
" scored, so " + (h.journal === 1 ? "it's" : "they're") + " left out.</p>" : "";
|
|
67
|
+
}
|