@40rty/ams-ui 0.3.0 → 0.3.2
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/dist/agent.js +8 -6
- package/dist/chunk-BFZ3YCUY.js +163 -0
- package/dist/{chunk-54QPRWEG.js → chunk-OKP7MC72.js} +89 -281
- package/dist/chunk-QXCHHCPU.js +58 -0
- package/dist/chunk-TEPH476O.js +218 -0
- package/dist/css/shell/spacefront-island.css +30 -13
- package/dist/css/shell/spacefront-presence.css +222 -0
- package/dist/css/shell/spacefront-thread-panel.css +255 -0
- package/dist/index.js +6 -4
- package/dist/island.js +13 -3
- package/dist/presence.js +134 -0
- package/dist/shell.js +305 -451
- package/dist/thread-panel.js +238 -0
- package/dist/types/presence/index.d.ts +1 -0
- package/dist/types/shell/PresenceActivity.d.ts +22 -0
- package/dist/types/shell/SideDock.d.ts +3 -2
- package/dist/types/shell/SpacefrontIsland.d.ts +5 -1
- package/dist/types/shell/SpacefrontPresence.d.ts +25 -0
- package/dist/types/shell/SpacefrontThreadPanel.d.ts +45 -0
- package/dist/types/shell/ThreadPanelConversation.d.ts +14 -0
- package/dist/types/shell/host-shell-store.d.ts +35 -0
- package/dist/types/thread-panel/index.d.ts +1 -0
- package/package.json +12 -2
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
// src/shell/host-shell-store.ts
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
var state = { islands: 0, islandSlot: null, panelSlot: null };
|
|
6
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
7
|
+
var SERVER_STATE = { islands: 0, islandSlot: null, panelSlot: null };
|
|
8
|
+
function update(next) {
|
|
9
|
+
state = {
|
|
10
|
+
islands: next.islands === void 0 ? state.islands : next.islands,
|
|
11
|
+
islandSlot: next.islandSlot === void 0 ? state.islandSlot : next.islandSlot,
|
|
12
|
+
panelSlot: next.panelSlot === void 0 ? state.panelSlot : next.panelSlot
|
|
13
|
+
};
|
|
14
|
+
listeners.forEach((listener) => listener());
|
|
15
|
+
}
|
|
16
|
+
function subscribe(listener) {
|
|
17
|
+
listeners.add(listener);
|
|
18
|
+
return () => listeners.delete(listener);
|
|
19
|
+
}
|
|
20
|
+
function useHostShell() {
|
|
21
|
+
return React.useSyncExternalStore(subscribe, () => state, () => SERVER_STATE);
|
|
22
|
+
}
|
|
23
|
+
function useRegisterIsland() {
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
update({ islands: state.islands + 1 });
|
|
26
|
+
return () => update({ islands: state.islands - 1 });
|
|
27
|
+
}, []);
|
|
28
|
+
}
|
|
29
|
+
function useIslandSlot(el) {
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
if (el === null) return;
|
|
32
|
+
update({ islandSlot: el });
|
|
33
|
+
return () => {
|
|
34
|
+
if (state.islandSlot === el) update({ islandSlot: null });
|
|
35
|
+
};
|
|
36
|
+
}, [el]);
|
|
37
|
+
}
|
|
38
|
+
function usePanelSlot(el, active) {
|
|
39
|
+
React.useEffect(() => {
|
|
40
|
+
if (el === null || !active) return;
|
|
41
|
+
update({ panelSlot: el });
|
|
42
|
+
return () => {
|
|
43
|
+
if (state.panelSlot === el) update({ panelSlot: null });
|
|
44
|
+
};
|
|
45
|
+
}, [el, active]);
|
|
46
|
+
}
|
|
47
|
+
function stopHostKeys(event) {
|
|
48
|
+
event.stopPropagation();
|
|
49
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
useHostShell,
|
|
54
|
+
useRegisterIsland,
|
|
55
|
+
useIslandSlot,
|
|
56
|
+
usePanelSlot,
|
|
57
|
+
stopHostKeys
|
|
58
|
+
};
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
// src/agent/presence/read-data.ts
|
|
4
|
+
function factRegister(fact) {
|
|
5
|
+
if (fact.provenance === "recalled") return "recalled";
|
|
6
|
+
if (fact.provenance !== void 0) return "inferred";
|
|
7
|
+
return fact.tier === "profile" ? "recalled" : "inferred";
|
|
8
|
+
}
|
|
9
|
+
function readFacts(frame) {
|
|
10
|
+
const raw = frame.data === void 0 ? void 0 : Reflect.get(frame.data, "facts");
|
|
11
|
+
if (!Array.isArray(raw)) return [];
|
|
12
|
+
const out = [];
|
|
13
|
+
for (const f of raw) {
|
|
14
|
+
if (typeof f !== "object" || f === null) continue;
|
|
15
|
+
const label = Reflect.get(f, "label");
|
|
16
|
+
const value = Reflect.get(f, "value");
|
|
17
|
+
if (typeof label !== "string" || typeof value !== "string") continue;
|
|
18
|
+
const tier = Reflect.get(f, "tier");
|
|
19
|
+
const scope = Reflect.get(f, "scope");
|
|
20
|
+
out.push({
|
|
21
|
+
label,
|
|
22
|
+
value,
|
|
23
|
+
...tier === "session" || tier === "profile" ? { tier } : {},
|
|
24
|
+
...typeof scope === "string" && scope.length > 0 ? { scope } : {}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return out;
|
|
28
|
+
}
|
|
29
|
+
function factIdentity(fact) {
|
|
30
|
+
return `${fact.label}=${fact.value}`;
|
|
31
|
+
}
|
|
32
|
+
function readLabel(frame) {
|
|
33
|
+
if (frame.data === void 0) return "";
|
|
34
|
+
const l = Reflect.get(frame.data, "label");
|
|
35
|
+
return typeof l === "string" ? l : "";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// src/agent/presence/use-forget-fact.ts
|
|
39
|
+
import * as React from "react";
|
|
40
|
+
import { useFourtySession, useOptimisticFlowSet, useReconcileFlowSet, PRESENCE_FACT_DISMISS_SIGNAL } from "@40rty/ams-sdk";
|
|
41
|
+
var DISMISSED_FLOW = "presence.dismissed";
|
|
42
|
+
function useVisibleFacts(frame) {
|
|
43
|
+
return useVisibleFactList(frame !== null ? readFacts(frame) : []);
|
|
44
|
+
}
|
|
45
|
+
function useVisibleFactList(facts) {
|
|
46
|
+
const dismissed = useOptimisticFlowSet(DISMISSED_FLOW);
|
|
47
|
+
return facts.filter((f) => !dismissed.has(f.label));
|
|
48
|
+
}
|
|
49
|
+
var useUndismissedFacts = useVisibleFactList;
|
|
50
|
+
function useForgetFact() {
|
|
51
|
+
const { sendImmediateSignal } = useFourtySession();
|
|
52
|
+
const dismissed = useOptimisticFlowSet(DISMISSED_FLOW);
|
|
53
|
+
const forget = React.useCallback(
|
|
54
|
+
(f) => {
|
|
55
|
+
dismissed.add(f.label);
|
|
56
|
+
sendImmediateSignal({ type: PRESENCE_FACT_DISMISS_SIGNAL, payload: { label: f.label, value: f.value } });
|
|
57
|
+
},
|
|
58
|
+
[dismissed, sendImmediateSignal]
|
|
59
|
+
);
|
|
60
|
+
return { forget };
|
|
61
|
+
}
|
|
62
|
+
function useReconcileDismissed(presentLabels) {
|
|
63
|
+
useReconcileFlowSet(DISMISSED_FLOW, presentLabels);
|
|
64
|
+
}
|
|
65
|
+
function useDismissedLabels() {
|
|
66
|
+
return useOptimisticFlowSet(DISMISSED_FLOW);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/agent/presence/fact-rail.ts
|
|
70
|
+
var PRESENCE_FACT_LIMIT = 3;
|
|
71
|
+
var PRESENCE_DURABLE_SLOTS = 1;
|
|
72
|
+
function rankFactElements(facts, liveTurnId) {
|
|
73
|
+
const thisTurn = [];
|
|
74
|
+
const profile = [];
|
|
75
|
+
const older = [];
|
|
76
|
+
for (const el of facts) {
|
|
77
|
+
if (liveTurnId !== void 0 && el.turnId === liveTurnId) thisTurn.push(el);
|
|
78
|
+
else if (el.tier === "profile") profile.push(el);
|
|
79
|
+
else older.push(el);
|
|
80
|
+
}
|
|
81
|
+
return [...thisTurn, ...profile, ...newestReadFirst(older)];
|
|
82
|
+
}
|
|
83
|
+
function newestReadFirst(facts) {
|
|
84
|
+
const reads = /* @__PURE__ */ new Map();
|
|
85
|
+
for (const el of facts) {
|
|
86
|
+
const held = reads.get(el.turnId);
|
|
87
|
+
if (held === void 0) reads.set(el.turnId, [el]);
|
|
88
|
+
else held.push(el);
|
|
89
|
+
}
|
|
90
|
+
const out = [];
|
|
91
|
+
for (const read of [...reads.values()].reverse()) out.push(...read);
|
|
92
|
+
return out;
|
|
93
|
+
}
|
|
94
|
+
function selectPresenceFacts(facts, liveTurnId) {
|
|
95
|
+
return rankFactElements(facts, liveTurnId);
|
|
96
|
+
}
|
|
97
|
+
function isDurable(fact) {
|
|
98
|
+
return fact.tier === "profile";
|
|
99
|
+
}
|
|
100
|
+
function capWithDurableFloor(facts, limit) {
|
|
101
|
+
const head = facts.slice(0, limit);
|
|
102
|
+
if (limit < PRESENCE_DURABLE_SLOTS) return head;
|
|
103
|
+
if (head.some(isDurable)) return head;
|
|
104
|
+
const durable = facts.slice(limit).find(isDurable);
|
|
105
|
+
if (durable === void 0) return head;
|
|
106
|
+
return [...head.slice(0, limit - PRESENCE_DURABLE_SLOTS), durable];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// src/agent/presence/element-view.ts
|
|
110
|
+
function toFact(el) {
|
|
111
|
+
if (el.scope === void 0) {
|
|
112
|
+
return { label: el.label, value: el.value, tier: el.tier, provenance: el.provenance };
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
label: el.label,
|
|
116
|
+
value: el.value,
|
|
117
|
+
tier: el.tier,
|
|
118
|
+
provenance: el.provenance,
|
|
119
|
+
scope: el.scope
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function isWorthShowing(el) {
|
|
123
|
+
return el.provenance !== "stated";
|
|
124
|
+
}
|
|
125
|
+
function derivePresenceView(elements, liveTurnId) {
|
|
126
|
+
const sources = [];
|
|
127
|
+
const showable = [];
|
|
128
|
+
const heldLabels = [];
|
|
129
|
+
let voice = "";
|
|
130
|
+
let ask;
|
|
131
|
+
let concession;
|
|
132
|
+
for (const el of elements) {
|
|
133
|
+
switch (el.kind) {
|
|
134
|
+
case "source":
|
|
135
|
+
sources.push(el);
|
|
136
|
+
break;
|
|
137
|
+
case "fact":
|
|
138
|
+
heldLabels.push(el.label);
|
|
139
|
+
if (isWorthShowing(el)) showable.push(el);
|
|
140
|
+
break;
|
|
141
|
+
case "voice":
|
|
142
|
+
if (el.register === "lead") voice = el.text;
|
|
143
|
+
break;
|
|
144
|
+
case "ask":
|
|
145
|
+
ask = el;
|
|
146
|
+
break;
|
|
147
|
+
case "concession":
|
|
148
|
+
concession = el;
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
const facts = selectPresenceFacts(showable, liveTurnId).map(toFact);
|
|
153
|
+
return { sources, facts, hiddenFacts: 0, heldLabels, voice, ask, concession };
|
|
154
|
+
}
|
|
155
|
+
function withCappedFacts(view, facts, reachable, limit) {
|
|
156
|
+
const drawn = capWithDurableFloor(facts, limit);
|
|
157
|
+
const shown = new Set(drawn.map(factIdentity));
|
|
158
|
+
return {
|
|
159
|
+
sources: view.sources,
|
|
160
|
+
facts: drawn,
|
|
161
|
+
// `+N` COUNTS WHAT THE BRIEF HOLDS AND THE BAND IS NOT SHOWING — the two are
|
|
162
|
+
// different lists, and counting the wrong one is a door onto an empty room.
|
|
163
|
+
// It was `facts.length - limit`: `facts` is the BAND's set, which includes
|
|
164
|
+
// the optimistic bridge (a pick shown before the agent's read lands), while
|
|
165
|
+
// the brief shows only what the agent knows. A visitor who picked a size got
|
|
166
|
+
// a "+4" whose destination held two entries. Counting the REACHABLE set that
|
|
167
|
+
// the band did not draw is exact by construction, whatever fills the slots.
|
|
168
|
+
hiddenFacts: reachable.filter((f) => !shown.has(factIdentity(f))).length,
|
|
169
|
+
heldLabels: view.heldLabels,
|
|
170
|
+
voice: view.voice,
|
|
171
|
+
ask: view.ask,
|
|
172
|
+
concession: view.concession
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function viewIsEmpty(view) {
|
|
176
|
+
return view.sources.length === 0 && view.facts.length === 0 && view.voice.length === 0 && view.ask === void 0 && view.concession === void 0;
|
|
177
|
+
}
|
|
178
|
+
function viewHasHeld(view) {
|
|
179
|
+
return view.facts.length > 0 || view.voice.length > 0 || view.ask !== void 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// src/agent/presence/use-band-facts.ts
|
|
183
|
+
import * as React2 from "react";
|
|
184
|
+
import { usePresenceElements, usePresenceLiveTurn } from "@40rty/ams-sdk";
|
|
185
|
+
function useBandFacts() {
|
|
186
|
+
const elements = usePresenceElements();
|
|
187
|
+
const liveTurnId = usePresenceLiveTurn();
|
|
188
|
+
const rawView = React2.useMemo(
|
|
189
|
+
() => derivePresenceView(elements, liveTurnId),
|
|
190
|
+
[elements, liveTurnId]
|
|
191
|
+
);
|
|
192
|
+
useReconcileDismissed(rawView.heldLabels.length > 0 ? rawView.heldLabels : null);
|
|
193
|
+
const all = useVisibleFactList(rawView.facts);
|
|
194
|
+
const reachable = all;
|
|
195
|
+
const view = React2.useMemo(
|
|
196
|
+
() => withCappedFacts(rawView, all, reachable, PRESENCE_FACT_LIMIT),
|
|
197
|
+
[rawView, all]
|
|
198
|
+
);
|
|
199
|
+
return { view, all: reachable };
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export {
|
|
203
|
+
factRegister,
|
|
204
|
+
readFacts,
|
|
205
|
+
factIdentity,
|
|
206
|
+
readLabel,
|
|
207
|
+
useVisibleFacts,
|
|
208
|
+
useVisibleFactList,
|
|
209
|
+
useUndismissedFacts,
|
|
210
|
+
useForgetFact,
|
|
211
|
+
useDismissedLabels,
|
|
212
|
+
PRESENCE_FACT_LIMIT,
|
|
213
|
+
PRESENCE_DURABLE_SLOTS,
|
|
214
|
+
derivePresenceView,
|
|
215
|
+
viewIsEmpty,
|
|
216
|
+
viewHasHeld,
|
|
217
|
+
useBandFacts
|
|
218
|
+
};
|
|
@@ -9,18 +9,27 @@
|
|
|
9
9
|
below is `.fourty-si .fourty-si__x` (0,2,0), which beats the reset and any
|
|
10
10
|
host rule short of two classes. The tests pin both numbers.
|
|
11
11
|
|
|
12
|
-
Themed ONLY through
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
--fourty-
|
|
12
|
+
Themed ONLY through custom properties. The SHARED shell tokens come first —
|
|
13
|
+
the island, `thread-panel.css` and `presence.css` all read them, so a store
|
|
14
|
+
maps its design once:
|
|
15
|
+
--fourty-surface (#fff) fill
|
|
16
|
+
--fourty-fg (#111) text, hairlines, the send stamp
|
|
17
|
+
--fourty-accent (fg) hover / selected fill
|
|
18
|
+
--fourty-accent-fg (surface) text on the accent
|
|
19
|
+
--fourty-radius (16px) corner
|
|
20
|
+
--fourty-font-family (inherit)
|
|
21
|
+
Each island property below falls back to its shared token:
|
|
22
|
+
--fourty-island-surface (--fourty-surface)
|
|
23
|
+
--fourty-island-fg (--fourty-fg)
|
|
24
|
+
--fourty-island-radius (--fourty-radius)
|
|
16
25
|
--fourty-island-edge (1px hairline of fg)
|
|
17
26
|
--fourty-island-shadow (three-step lift)
|
|
18
27
|
--fourty-island-collapsed-surface (fg) pill fill
|
|
19
28
|
--fourty-island-collapsed-fg (surface) pill text
|
|
20
|
-
--fourty-island-accent (
|
|
21
|
-
--fourty-island-accent-fg (
|
|
29
|
+
--fourty-island-accent (--fourty-accent)
|
|
30
|
+
--fourty-island-accent-fg (--fourty-accent-fg)
|
|
22
31
|
--fourty-island-error (#b42318)
|
|
23
|
-
--fourty-island-font-family (
|
|
32
|
+
--fourty-island-font-family (--fourty-font-family)
|
|
24
33
|
--fourty-island-offset-bottom (16px) clears a host bottom bar
|
|
25
34
|
--fourty-island-inset-left / -right (0) the column, container="viewport"
|
|
26
35
|
--fourty-island-max-width (640px)
|
|
@@ -28,10 +37,10 @@
|
|
|
28
37
|
============================================================================ */
|
|
29
38
|
|
|
30
39
|
.fourty-si {
|
|
31
|
-
--_surface: var(--fourty-island-surface, #fff);
|
|
32
|
-
--_fg: var(--fourty-island-fg, #111);
|
|
33
|
-
--_accent: var(--fourty-island-accent, var(--_fg));
|
|
34
|
-
--_accent-fg: var(--fourty-island-accent-fg, var(--_surface));
|
|
40
|
+
--_surface: var(--fourty-island-surface, var(--fourty-surface, #fff));
|
|
41
|
+
--_fg: var(--fourty-island-fg, var(--fourty-fg, #111));
|
|
42
|
+
--_accent: var(--fourty-island-accent, var(--fourty-accent, var(--_fg)));
|
|
43
|
+
--_accent-fg: var(--fourty-island-accent-fg, var(--fourty-accent-fg, var(--_surface)));
|
|
35
44
|
--_ease: cubic-bezier(0.22, 1, 0.36, 1);
|
|
36
45
|
position: fixed;
|
|
37
46
|
left: var(--fourty-island-inset-left, 0);
|
|
@@ -43,7 +52,7 @@
|
|
|
43
52
|
box-sizing: border-box;
|
|
44
53
|
padding: 0 16px;
|
|
45
54
|
pointer-events: none;
|
|
46
|
-
font-family: var(--fourty-island-font-family, inherit);
|
|
55
|
+
font-family: var(--fourty-island-font-family, var(--fourty-font-family, inherit));
|
|
47
56
|
font-size: 14px;
|
|
48
57
|
line-height: 1.4;
|
|
49
58
|
color: var(--_fg);
|
|
@@ -75,6 +84,14 @@
|
|
|
75
84
|
animation: fourty-si-in 220ms var(--_ease);
|
|
76
85
|
}
|
|
77
86
|
|
|
87
|
+
/* Where <SpacefrontPresence /> attaches — above the chips and slab. */
|
|
88
|
+
.fourty-si .fourty-si__presence {
|
|
89
|
+
display: block;
|
|
90
|
+
}
|
|
91
|
+
.fourty-si .fourty-si__presence:empty {
|
|
92
|
+
display: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
78
95
|
.fourty-si .fourty-si__chips {
|
|
79
96
|
display: flex;
|
|
80
97
|
flex-wrap: wrap;
|
|
@@ -94,7 +111,7 @@
|
|
|
94
111
|
display: flex;
|
|
95
112
|
flex-direction: column;
|
|
96
113
|
overflow: hidden;
|
|
97
|
-
border-radius: var(--fourty-island-radius, 16px);
|
|
114
|
+
border-radius: var(--fourty-island-radius, var(--fourty-radius, 16px));
|
|
98
115
|
background: var(--_surface);
|
|
99
116
|
box-shadow:
|
|
100
117
|
var(--fourty-island-edge, 0 0 0 1px color-mix(in srgb, var(--_fg) 14%, transparent)),
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
<SpacefrontPresence /> — the agent presence band for a host-owned page.
|
|
3
|
+
Published as `@40rty/ams-ui/presence.css`. Same contract as `island.css`:
|
|
4
|
+
plain CSS, UNLAYERED, every element reset by `.fourty-sp :is(…)` (0,1,1)
|
|
5
|
+
and every rule `.fourty-sp .fourty-sp__x` (0,2,0).
|
|
6
|
+
|
|
7
|
+
Themed through the SHARED shell tokens (see `island.css`), so it matches
|
|
8
|
+
the island it sits on and the panel it tops:
|
|
9
|
+
--fourty-surface (#fff) --fourty-fg (#111) --fourty-accent (fg)
|
|
10
|
+
--fourty-accent-fg (surface) --fourty-radius (16px)
|
|
11
|
+
--fourty-font-family (inherit)
|
|
12
|
+
…and its own:
|
|
13
|
+
--fourty-presence-shadow (the island's lift, lighter)
|
|
14
|
+
--fourty-presence-thumb (28px) scanned-record thumbnail size
|
|
15
|
+
============================================================================ */
|
|
16
|
+
|
|
17
|
+
/* The root doubles its class (0,2,0): it is portalled INTO the island and the
|
|
18
|
+
panel, whose own resets (`.fourty-si :is(div, …)`, 0,1,1) would otherwise
|
|
19
|
+
unset the band's box. */
|
|
20
|
+
.fourty-sp.fourty-sp {
|
|
21
|
+
--_surface: var(--fourty-surface, #fff);
|
|
22
|
+
--_fg: var(--fourty-fg, #111);
|
|
23
|
+
--_accent: var(--fourty-accent, var(--_fg));
|
|
24
|
+
--_accent-fg: var(--fourty-accent-fg, var(--_surface));
|
|
25
|
+
--_radius: var(--fourty-radius, 16px);
|
|
26
|
+
--_thumb: var(--fourty-presence-thumb, 28px);
|
|
27
|
+
display: grid;
|
|
28
|
+
gap: 10px;
|
|
29
|
+
box-sizing: border-box;
|
|
30
|
+
width: 100%;
|
|
31
|
+
padding: 10px 12px;
|
|
32
|
+
border-radius: var(--_radius);
|
|
33
|
+
background: var(--_surface);
|
|
34
|
+
box-shadow: var(--fourty-presence-shadow,
|
|
35
|
+
0 0 0 1px color-mix(in srgb, var(--_fg) 12%, transparent),
|
|
36
|
+
0 6px 16px -6px color-mix(in srgb, var(--_fg) 24%, transparent));
|
|
37
|
+
font-family: var(--fourty-font-family, inherit);
|
|
38
|
+
font-size: 13px;
|
|
39
|
+
line-height: 1.4;
|
|
40
|
+
color: var(--_fg);
|
|
41
|
+
text-align: left;
|
|
42
|
+
pointer-events: auto;
|
|
43
|
+
animation: fourty-sp-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* The reset — the host's element globals stop here. */
|
|
47
|
+
.fourty-sp :is(div, p, span, ul, li, button, img, svg) {
|
|
48
|
+
all: unset;
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
}
|
|
51
|
+
.fourty-sp :focus-visible {
|
|
52
|
+
outline: 2px solid var(--_accent);
|
|
53
|
+
outline-offset: 2px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Activity — thumbs of what is being read, and the line. */
|
|
57
|
+
.fourty-sp .fourty-sp__activity {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: 10px;
|
|
61
|
+
min-width: 0;
|
|
62
|
+
}
|
|
63
|
+
.fourty-sp .fourty-sp__thumbs {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex: 0 0 auto;
|
|
66
|
+
}
|
|
67
|
+
.fourty-sp .fourty-sp__thumb {
|
|
68
|
+
display: block;
|
|
69
|
+
width: var(--_thumb);
|
|
70
|
+
height: var(--_thumb);
|
|
71
|
+
margin-left: calc(var(--_thumb) * -0.3);
|
|
72
|
+
border-radius: 6px;
|
|
73
|
+
object-fit: cover;
|
|
74
|
+
background: color-mix(in srgb, var(--_fg) 8%, var(--_surface));
|
|
75
|
+
box-shadow: 0 0 0 2px var(--_surface);
|
|
76
|
+
animation: fourty-sp-thumb 260ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
|
|
77
|
+
}
|
|
78
|
+
.fourty-sp .fourty-sp__thumb:first-child {
|
|
79
|
+
margin-left: 0;
|
|
80
|
+
}
|
|
81
|
+
.fourty-sp .fourty-sp__line {
|
|
82
|
+
display: block;
|
|
83
|
+
min-width: 0;
|
|
84
|
+
overflow: hidden;
|
|
85
|
+
white-space: nowrap;
|
|
86
|
+
text-overflow: ellipsis;
|
|
87
|
+
color: color-mix(in srgb, var(--_fg) 78%, transparent);
|
|
88
|
+
}
|
|
89
|
+
.fourty-sp .fourty-sp__line--thinking {
|
|
90
|
+
color: transparent;
|
|
91
|
+
background: linear-gradient(100deg,
|
|
92
|
+
color-mix(in srgb, var(--_fg) 45%, transparent) 40%,
|
|
93
|
+
var(--_fg) 50%,
|
|
94
|
+
color-mix(in srgb, var(--_fg) 45%, transparent) 60%) 0 0 / 250% 100%;
|
|
95
|
+
-webkit-background-clip: text;
|
|
96
|
+
background-clip: text;
|
|
97
|
+
animation: fourty-sp-shimmer 1.6s linear infinite;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Facts — what the agent understood, each forgettable. */
|
|
101
|
+
.fourty-sp .fourty-sp__facts {
|
|
102
|
+
display: grid;
|
|
103
|
+
gap: 6px;
|
|
104
|
+
}
|
|
105
|
+
.fourty-sp .fourty-sp__eyebrow {
|
|
106
|
+
display: block;
|
|
107
|
+
font-size: 11px;
|
|
108
|
+
font-weight: 600;
|
|
109
|
+
letter-spacing: 0.06em;
|
|
110
|
+
text-transform: uppercase;
|
|
111
|
+
color: color-mix(in srgb, var(--_fg) 55%, transparent);
|
|
112
|
+
}
|
|
113
|
+
.fourty-sp .fourty-sp__fact-list {
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-wrap: wrap;
|
|
116
|
+
gap: 6px;
|
|
117
|
+
}
|
|
118
|
+
.fourty-sp .fourty-sp__fact {
|
|
119
|
+
display: inline-flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
gap: 6px;
|
|
122
|
+
padding: 3px 4px 3px 10px;
|
|
123
|
+
border-radius: 999px;
|
|
124
|
+
background: color-mix(in srgb, var(--_fg) 7%, var(--_surface));
|
|
125
|
+
}
|
|
126
|
+
.fourty-sp .fourty-sp__fact-label {
|
|
127
|
+
display: inline;
|
|
128
|
+
color: color-mix(in srgb, var(--_fg) 60%, transparent);
|
|
129
|
+
}
|
|
130
|
+
.fourty-sp .fourty-sp__fact-value {
|
|
131
|
+
display: inline;
|
|
132
|
+
font-weight: 600;
|
|
133
|
+
}
|
|
134
|
+
.fourty-sp .fourty-sp__more {
|
|
135
|
+
display: inline-flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
padding: 3px 8px;
|
|
138
|
+
color: color-mix(in srgb, var(--_fg) 60%, transparent);
|
|
139
|
+
}
|
|
140
|
+
.fourty-sp .fourty-sp__forget,
|
|
141
|
+
.fourty-sp .fourty-sp__dismiss {
|
|
142
|
+
display: grid;
|
|
143
|
+
place-items: center;
|
|
144
|
+
width: 20px;
|
|
145
|
+
height: 20px;
|
|
146
|
+
border-radius: 999px;
|
|
147
|
+
color: color-mix(in srgb, var(--_fg) 60%, transparent);
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
transition: background-color 150ms ease, color 150ms ease;
|
|
150
|
+
}
|
|
151
|
+
.fourty-sp .fourty-sp__dismiss {
|
|
152
|
+
width: 28px;
|
|
153
|
+
height: 28px;
|
|
154
|
+
}
|
|
155
|
+
.fourty-sp .fourty-sp__forget svg,
|
|
156
|
+
.fourty-sp .fourty-sp__dismiss svg {
|
|
157
|
+
display: block;
|
|
158
|
+
width: 12px;
|
|
159
|
+
height: 12px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* A standing question — answer it, or dismiss it. */
|
|
163
|
+
.fourty-sp .fourty-sp__ask {
|
|
164
|
+
display: grid;
|
|
165
|
+
gap: 8px;
|
|
166
|
+
}
|
|
167
|
+
.fourty-sp .fourty-sp__question {
|
|
168
|
+
display: block;
|
|
169
|
+
font-weight: 600;
|
|
170
|
+
}
|
|
171
|
+
.fourty-sp .fourty-sp__replies {
|
|
172
|
+
display: flex;
|
|
173
|
+
flex-wrap: wrap;
|
|
174
|
+
align-items: center;
|
|
175
|
+
gap: 6px;
|
|
176
|
+
}
|
|
177
|
+
.fourty-sp .fourty-sp__reply {
|
|
178
|
+
padding: 4px 14px;
|
|
179
|
+
border-radius: 999px;
|
|
180
|
+
background: var(--_fg);
|
|
181
|
+
color: var(--_surface);
|
|
182
|
+
cursor: pointer;
|
|
183
|
+
transition: background-color 150ms ease, color 150ms ease;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
@media (hover: hover) {
|
|
187
|
+
.fourty-sp .fourty-sp__reply:hover {
|
|
188
|
+
background: var(--_accent);
|
|
189
|
+
color: var(--_accent-fg);
|
|
190
|
+
}
|
|
191
|
+
.fourty-sp .fourty-sp__forget:hover,
|
|
192
|
+
.fourty-sp .fourty-sp__dismiss:hover {
|
|
193
|
+
background: color-mix(in srgb, var(--_fg) 10%, transparent);
|
|
194
|
+
color: var(--_fg);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
@keyframes fourty-sp-in {
|
|
199
|
+
from { opacity: 0; transform: translateY(6px); }
|
|
200
|
+
}
|
|
201
|
+
@keyframes fourty-sp-thumb {
|
|
202
|
+
from { opacity: 0; transform: scale(0.8); }
|
|
203
|
+
}
|
|
204
|
+
@keyframes fourty-sp-shimmer {
|
|
205
|
+
to { background-position: -150% 0; }
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@media (prefers-reduced-motion: reduce) {
|
|
209
|
+
.fourty-sp,
|
|
210
|
+
.fourty-sp .fourty-sp__thumb,
|
|
211
|
+
.fourty-sp .fourty-sp__line--thinking {
|
|
212
|
+
animation: none;
|
|
213
|
+
}
|
|
214
|
+
.fourty-sp .fourty-sp__line--thinking {
|
|
215
|
+
color: color-mix(in srgb, var(--_fg) 55%, transparent);
|
|
216
|
+
}
|
|
217
|
+
.fourty-sp .fourty-sp__reply,
|
|
218
|
+
.fourty-sp .fourty-sp__forget,
|
|
219
|
+
.fourty-sp .fourty-sp__dismiss {
|
|
220
|
+
transition: none;
|
|
221
|
+
}
|
|
222
|
+
}
|