@40rty/ams-ui 0.5.6 → 0.5.7
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 +3 -2
- package/dist/{chunk-H6MSAD5M.js → chunk-434KIH5P.js} +17 -10
- package/dist/{chunk-2HM6EVDV.js → chunk-4ZX4IRC6.js} +241 -389
- package/dist/chunk-FSY7MEP5.js +843 -0
- package/dist/{chunk-WVD2Y2N2.js → chunk-G3IXNKXL.js} +15 -8
- package/dist/{chunk-CKNELL6G.js → chunk-URUKPL57.js} +109 -79
- package/dist/{chunk-432XYPDT.js → chunk-ZP27BQQE.js} +1 -1
- package/dist/conversation.js +24 -21
- package/dist/css/preset/motion.css +4 -1
- package/dist/css/shell/spacefront-island.css +8 -6
- package/dist/css/shell/spacefront-presence.css +9 -4
- package/dist/css/shell/spacefront-thread-panel.css +12 -5
- package/dist/index.js +473 -403
- package/dist/island.js +18 -11
- package/dist/motion.js +1 -1
- package/dist/presence.js +20 -11
- package/dist/shell.js +6 -5
- package/dist/thread-panel.js +19 -9
- package/dist/types/catalog-data/ecommerce.d.ts +42 -0
- package/dist/types/catalog-data/social.d.ts +14 -0
- package/dist/types/components/content/article/BlogPosts.d.ts +1 -1
- package/dist/types/components/ecommerce/cart/cart-format.d.ts +3 -2
- package/dist/types/components/ecommerce/collection/CollectionList.d.ts +1 -1
- package/dist/types/components/ecommerce/product/AddToRegistry.d.ts +1 -1
- package/dist/types/components/ecommerce/product/ProductPrice.d.ts +1 -0
- package/dist/types/components/feedback/HydrationNotice.d.ts +9 -0
- package/dist/types/components/layout/Drawer.d.ts +2 -0
- package/dist/types/conversation/blocks/schemas.d.ts +40 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/labels/en/agent.d.ts +2 -0
- package/dist/types/labels/en/commerce.d.ts +2 -0
- package/dist/types/labels/en/content.d.ts +2 -0
- package/dist/types/labels/en/notices.d.ts +2 -0
- package/dist/types/labels/en/shell.d.ts +2 -0
- package/dist/types/labels/he/agent.d.ts +2 -0
- package/dist/types/labels/he/commerce.d.ts +2 -0
- package/dist/types/labels/he/content.d.ts +2 -0
- package/dist/types/labels/he/count.d.ts +17 -0
- package/dist/types/labels/he/notices.d.ts +2 -0
- package/dist/types/labels/he/shell.d.ts +2 -0
- package/dist/types/labels/index.d.ts +34 -0
- package/dist/types/{labels.d.ts → labels/types-agent.d.ts} +4 -120
- package/dist/types/labels/types-commerce.d.ts +252 -0
- package/dist/types/labels/types-content.d.ts +28 -0
- package/dist/types/labels/types-notices.d.ts +9 -0
- package/dist/types/labels/types-shell.d.ts +137 -0
- package/dist/types/labels-context.d.ts +19 -5
- package/dist/types/primitives/Money/index.d.ts +1 -1
- package/dist/types/shell/Composer.d.ts +1 -1
- package/dist/types/shell/SideDock.d.ts +1 -1
- package/dist/types/shell/SpacefrontIsland.d.ts +1 -1
- package/dist/types/shell/SpacefrontPresence.d.ts +1 -1
- package/dist/types/shell/VoiceIsland.d.ts +1 -1
- package/dist/types/utils/format-money.d.ts +3 -1
- package/dist/types/utils/mirror-x.d.ts +8 -0
- package/package.json +2 -2
|
@@ -10,176 +10,19 @@ import {
|
|
|
10
10
|
viewHasHeld,
|
|
11
11
|
viewIsEmpty
|
|
12
12
|
} from "./chunk-RMJDSHLA.js";
|
|
13
|
+
import {
|
|
14
|
+
useLabels,
|
|
15
|
+
useTextDirection
|
|
16
|
+
} from "./chunk-FSY7MEP5.js";
|
|
13
17
|
import {
|
|
14
18
|
AnimatePresence,
|
|
15
19
|
motion,
|
|
16
20
|
useAnimationControls,
|
|
17
21
|
useReducedMotion
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
|
|
20
|
-
// src/labels.ts
|
|
21
|
-
var DEFAULT_LABELS = {
|
|
22
|
-
product: {
|
|
23
|
-
addToBag: "add to bag",
|
|
24
|
-
added: "added \xB7 \u2713",
|
|
25
|
-
save: "save",
|
|
26
|
-
saved: "saved",
|
|
27
|
-
inStock: "in stock",
|
|
28
|
-
outOfStock: "out of stock",
|
|
29
|
-
reviewsTitle: "Reviews",
|
|
30
|
-
reviewsEmpty: "No reviews yet for this one.",
|
|
31
|
-
specs: {
|
|
32
|
-
vendor: "vendor",
|
|
33
|
-
type: "type",
|
|
34
|
-
available: "available",
|
|
35
|
-
rating: "rating",
|
|
36
|
-
tags: "tags",
|
|
37
|
-
variant: "variant"
|
|
38
|
-
},
|
|
39
|
-
a11y: {
|
|
40
|
-
ratingLabel: (value, count) => `Rated ${value.toFixed(1)} of 5 from ${count} reviews`
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
rating: {
|
|
44
|
-
reviewsCount: (count) => `${count} reviews`
|
|
45
|
-
},
|
|
46
|
-
variantPicker: {
|
|
47
|
-
title: "choose your options",
|
|
48
|
-
dismiss: "not now"
|
|
49
|
-
},
|
|
50
|
-
canvas: {
|
|
51
|
-
share: "Share",
|
|
52
|
-
shareCopied: "Link copied",
|
|
53
|
-
shareUnavailable: "Can't share yet",
|
|
54
|
-
shareA11y: "Share this page",
|
|
55
|
-
shareTitle: "Send this page",
|
|
56
|
-
shareExplain: "They get this page and the conversation behind it, frozen as it is right now. It becomes their own copy to carry on from \u2014 your page, your cart and anything you do next stay yours.",
|
|
57
|
-
shareCopy: "Copy link",
|
|
58
|
-
shareExpiry: (days) => `Expires in ${days} days`,
|
|
59
|
-
shareClose: "Close",
|
|
60
|
-
shareNative: "Share\u2026",
|
|
61
|
-
shareSubject: "A page made for me"
|
|
62
|
-
},
|
|
63
|
-
chat: {
|
|
64
|
-
placeholder: "Ask the agent",
|
|
65
|
-
placeholderFollowUp: "Follow up"
|
|
66
|
-
},
|
|
67
|
-
voice: {
|
|
68
|
-
speak: "Speak"
|
|
69
|
-
},
|
|
70
|
-
presence: {
|
|
71
|
-
newFacts: (count) => `${count} new ${count === 1 ? "detail" : "details"}`,
|
|
72
|
-
brief: {
|
|
73
|
-
open: "Show what I know about you",
|
|
74
|
-
close: "Hide what I know about you",
|
|
75
|
-
identity: {
|
|
76
|
-
greeting: (name) => `Hey ${name}`,
|
|
77
|
-
invite: "Tell me what to call you",
|
|
78
|
-
placeholder: "Your name",
|
|
79
|
-
change: (name) => `Change the name I call you (${name})`
|
|
80
|
-
},
|
|
81
|
-
more: (count) => `Show ${count} more`,
|
|
82
|
-
forget: (label) => `Forget ${label}`,
|
|
83
|
-
recalled: {
|
|
84
|
-
title: "From before",
|
|
85
|
-
badge: "You told me this on an earlier visit"
|
|
86
|
-
},
|
|
87
|
-
inferred: {
|
|
88
|
-
title: "From this visit"
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
composing: [
|
|
92
|
-
"Putting this together",
|
|
93
|
-
"Lining these up",
|
|
94
|
-
"Laying it all out",
|
|
95
|
-
"Finding the balance",
|
|
96
|
-
"Starting from the top",
|
|
97
|
-
"Making room on the side"
|
|
98
|
-
],
|
|
99
|
-
ask: {
|
|
100
|
-
fallback: "Want me to do that?",
|
|
101
|
-
dismiss: "Dismiss"
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
menu: {
|
|
105
|
-
shopAll: (label) => `Shop all ${label}`
|
|
106
|
-
},
|
|
107
|
-
cart: {
|
|
108
|
-
title: "bag",
|
|
109
|
-
empty: "your bag is empty",
|
|
110
|
-
emptyHint: "add a product to get started",
|
|
111
|
-
removeLine: "Remove from bag",
|
|
112
|
-
viewOnStore: "view bag on official store",
|
|
113
|
-
freeShippingThreshold: null,
|
|
114
|
-
shippingFree: "complimentary",
|
|
115
|
-
shippingDeferred: "shipping & taxes calculated at checkout",
|
|
116
|
-
promoPlaceholder: "promo code",
|
|
117
|
-
promoApply: "apply",
|
|
118
|
-
promoNotApplicable: "doesn't apply",
|
|
119
|
-
promoInvalid: "code not recognized",
|
|
120
|
-
discount: "discount",
|
|
121
|
-
itemSingular: "item",
|
|
122
|
-
itemPlural: "items",
|
|
123
|
-
subtotal: "subtotal",
|
|
124
|
-
shipping: "shipping",
|
|
125
|
-
total: "total",
|
|
126
|
-
linePending: "adding\u2026",
|
|
127
|
-
linePendingPrice: "\u2014",
|
|
128
|
-
totalsPending: "updating totals\u2026"
|
|
129
|
-
},
|
|
130
|
-
conversation: {
|
|
131
|
-
home: "Home",
|
|
132
|
-
thisPage: "This page",
|
|
133
|
-
whatIKnow: "What I know",
|
|
134
|
-
startOver: "Start over",
|
|
135
|
-
clearFacts: "Clear",
|
|
136
|
-
searching: (query) => `Looking through ${query}`,
|
|
137
|
-
working: "Working on it",
|
|
138
|
-
lookedAt: (count) => `${count} looked at`,
|
|
139
|
-
send: "Send",
|
|
140
|
-
verdict: "The verdict",
|
|
141
|
-
ourPick: "Our pick",
|
|
142
|
-
tradeoff: "Trade-off",
|
|
143
|
-
tradeoffCaveat: (caveat) => `Trade-off: ${caveat}`,
|
|
144
|
-
pathsTitle: "Where to next",
|
|
145
|
-
noteEyebrow: "A note",
|
|
146
|
-
explainProducts: "Products like this"
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
// src/labels-context.tsx
|
|
151
|
-
import * as React from "react";
|
|
152
|
-
import { jsx } from "react/jsx-runtime";
|
|
153
|
-
var LabelsContext = React.createContext(DEFAULT_LABELS);
|
|
154
|
-
function mergeLabels(base, override) {
|
|
155
|
-
if (!override) return base;
|
|
156
|
-
return deepMerge(base, override);
|
|
157
|
-
}
|
|
158
|
-
function deepMerge(target, source) {
|
|
159
|
-
if (!isPlainObject(target) || !isPlainObject(source)) return source === void 0 ? target : source;
|
|
160
|
-
const result = { ...target };
|
|
161
|
-
for (const key of Object.keys(source)) {
|
|
162
|
-
const sv = source[key];
|
|
163
|
-
const tv = target[key];
|
|
164
|
-
result[key] = isPlainObject(sv) && isPlainObject(tv) ? deepMerge(tv, sv) : sv;
|
|
165
|
-
}
|
|
166
|
-
return result;
|
|
167
|
-
}
|
|
168
|
-
function isPlainObject(v) {
|
|
169
|
-
if (v === null || typeof v !== "object") return false;
|
|
170
|
-
const proto = Object.getPrototypeOf(v);
|
|
171
|
-
return proto === Object.prototype || proto === null;
|
|
172
|
-
}
|
|
173
|
-
function LabelsProvider({ overrides, children }) {
|
|
174
|
-
const value = React.useMemo(() => mergeLabels(DEFAULT_LABELS, overrides), [overrides]);
|
|
175
|
-
return /* @__PURE__ */ jsx(LabelsContext.Provider, { value, children });
|
|
176
|
-
}
|
|
177
|
-
function useLabels() {
|
|
178
|
-
return React.useContext(LabelsContext);
|
|
179
|
-
}
|
|
22
|
+
} from "./chunk-ZP27BQQE.js";
|
|
180
23
|
|
|
181
24
|
// src/agent/presence/notch/PresenceNotch.tsx
|
|
182
|
-
import * as
|
|
25
|
+
import * as React from "react";
|
|
183
26
|
import {
|
|
184
27
|
usePresenceNotch,
|
|
185
28
|
useFormFactor
|
|
@@ -187,7 +30,7 @@ import {
|
|
|
187
30
|
|
|
188
31
|
// src/agent/presence/AgentAsk.tsx
|
|
189
32
|
import { AGENT_ASK_SIGNAL, useConsumeStandingSignal, useFourtySession } from "@40rty/ams-sdk";
|
|
190
|
-
import { jsx
|
|
33
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
191
34
|
function AgentAsk() {
|
|
192
35
|
const standing = useConsumeStandingSignal(AGENT_ASK_SIGNAL);
|
|
193
36
|
const session = useFourtySession();
|
|
@@ -197,9 +40,9 @@ function AgentAsk() {
|
|
|
197
40
|
const question = typeof p.ask === "string" && p.ask.length > 0 ? p.ask : labels.fallback;
|
|
198
41
|
const suggestions = Array.isArray(p.suggestions) ? p.suggestions.filter((x) => typeof x === "string" && x.length > 0) : [];
|
|
199
42
|
return /* @__PURE__ */ jsxs("div", { className: "fourty-ask", role: "status", "aria-live": "polite", children: [
|
|
200
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ jsx("p", { className: "fourty-ask__question", children: question }),
|
|
201
44
|
/* @__PURE__ */ jsxs("div", { className: "fourty-ask__actions", children: [
|
|
202
|
-
suggestions.map((s) => /* @__PURE__ */
|
|
45
|
+
suggestions.map((s) => /* @__PURE__ */ jsx(
|
|
203
46
|
"button",
|
|
204
47
|
{
|
|
205
48
|
type: "button",
|
|
@@ -212,17 +55,17 @@ function AgentAsk() {
|
|
|
212
55
|
},
|
|
213
56
|
s
|
|
214
57
|
)),
|
|
215
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "fourty-ask__dismiss", onClick: standing.dismiss, "aria-label": labels.dismiss, children: "\xD7" })
|
|
216
59
|
] })
|
|
217
60
|
] });
|
|
218
61
|
}
|
|
219
62
|
|
|
220
63
|
// src/agent/presence/notch/PresenceNotch.tsx
|
|
221
|
-
import { jsx as
|
|
64
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
222
65
|
function PresenceNotch({ widgets }) {
|
|
223
66
|
const { expanded, askStanding, lead, trail, drawerWidgets, openDrawerId, toggleDrawer, rootHandlers, rootRef } = usePresenceNotch(widgets);
|
|
224
67
|
const { isMobile } = useFormFactor();
|
|
225
|
-
const handles =
|
|
68
|
+
const handles = React.useMemo(() => {
|
|
226
69
|
const map = /* @__PURE__ */ new Map();
|
|
227
70
|
for (const w of widgets) {
|
|
228
71
|
if (w.Drawer === void 0) continue;
|
|
@@ -232,9 +75,9 @@ function PresenceNotch({ widgets }) {
|
|
|
232
75
|
}, [widgets, openDrawerId, toggleDrawer]);
|
|
233
76
|
const renderWidget = (w) => {
|
|
234
77
|
const drawer = handles.get(w.id);
|
|
235
|
-
const node = drawer === void 0 ? /* @__PURE__ */
|
|
236
|
-
if (w.Drawer === void 0) return /* @__PURE__ */
|
|
237
|
-
return /* @__PURE__ */
|
|
78
|
+
const node = drawer === void 0 ? /* @__PURE__ */ jsx2(w.Component, { expanded }) : /* @__PURE__ */ jsx2(w.Component, { expanded, drawer });
|
|
79
|
+
if (w.Drawer === void 0) return /* @__PURE__ */ jsx2(React.Fragment, { children: node }, w.id);
|
|
80
|
+
return /* @__PURE__ */ jsx2("div", { className: "fourty-notch__widget", children: node }, w.id);
|
|
238
81
|
};
|
|
239
82
|
return (
|
|
240
83
|
// `rootRef` marks where the notch ENDS: a press outside it closes an open
|
|
@@ -249,17 +92,17 @@ function PresenceNotch({ widgets }) {
|
|
|
249
92
|
role: "region",
|
|
250
93
|
"aria-live": "polite",
|
|
251
94
|
children: [
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ jsx2("div", { className: "fourty-notch__lead", children: askStanding ? /* @__PURE__ */ jsx2(AgentAsk, {}) : lead.map(renderWidget) }),
|
|
96
|
+
/* @__PURE__ */ jsx2("div", { className: "fourty-notch__trail", children: trail.map(renderWidget) })
|
|
254
97
|
]
|
|
255
98
|
}
|
|
256
99
|
),
|
|
257
|
-
!isMobile && drawerWidgets.length > 0 && /* @__PURE__ */
|
|
100
|
+
!isMobile && drawerWidgets.length > 0 && /* @__PURE__ */ jsx2("div", { className: "fourty-notch__drawer-region", children: drawerWidgets.map((w) => {
|
|
258
101
|
const Drawer = w.Drawer;
|
|
259
102
|
if (Drawer === void 0) return null;
|
|
260
103
|
const open = openDrawerId === w.id;
|
|
261
104
|
const drawer = handles.get(w.id);
|
|
262
|
-
return /* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ jsx2("div", { className: "fourty-notch__drawer", "data-open": open ? "true" : "false", "aria-hidden": !open, children: drawer === void 0 ? /* @__PURE__ */ jsx2(Drawer, { expanded: true }) : /* @__PURE__ */ jsx2(Drawer, { expanded: true, drawer }) }, w.id);
|
|
263
106
|
}) })
|
|
264
107
|
] })
|
|
265
108
|
);
|
|
@@ -402,7 +245,7 @@ var presenceClass = {
|
|
|
402
245
|
};
|
|
403
246
|
|
|
404
247
|
// src/agent/presence/parts.tsx
|
|
405
|
-
import { jsx as
|
|
248
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
406
249
|
var FALLBACK = "";
|
|
407
250
|
var SETTLE_EASE = [0.22, 1, 0.36, 1];
|
|
408
251
|
var enter = {
|
|
@@ -412,23 +255,23 @@ var enter = {
|
|
|
412
255
|
transition: { duration: 0.5, ease: SETTLE_EASE }
|
|
413
256
|
};
|
|
414
257
|
function Eyebrow({ children }) {
|
|
415
|
-
return /* @__PURE__ */
|
|
258
|
+
return /* @__PURE__ */ jsx3("span", { className: presenceClass.eyebrow, children });
|
|
416
259
|
}
|
|
417
260
|
function Rule() {
|
|
418
|
-
return /* @__PURE__ */
|
|
261
|
+
return /* @__PURE__ */ jsx3("span", { "aria-hidden": true, className: presenceClass.rule });
|
|
419
262
|
}
|
|
420
263
|
function Fallback() {
|
|
421
264
|
if (FALLBACK.length === 0) return null;
|
|
422
|
-
return /* @__PURE__ */
|
|
265
|
+
return /* @__PURE__ */ jsx3("span", { className: presenceClass.fallback, children: FALLBACK });
|
|
423
266
|
}
|
|
424
267
|
|
|
425
268
|
// src/agent/presence/swatch.tsx
|
|
426
269
|
import { colorHexOf } from "@40rty/ams-sdk";
|
|
427
|
-
import { jsx as
|
|
270
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
428
271
|
function colorSwatch(value) {
|
|
429
272
|
const hex = colorHexOf(value);
|
|
430
273
|
if (hex === null) return null;
|
|
431
|
-
return /* @__PURE__ */
|
|
274
|
+
return /* @__PURE__ */ jsx4("span", { className: presenceClass.swatch, style: { background: hex } });
|
|
432
275
|
}
|
|
433
276
|
|
|
434
277
|
// src/agent/presence/source-cards/card-shell.tsx
|
|
@@ -487,8 +330,18 @@ var CARD_EASE = [0.22, 1, 0.36, 1];
|
|
|
487
330
|
var CARD_SETTLE_MS = 260;
|
|
488
331
|
|
|
489
332
|
// src/agent/presence/source-cards/card-frame.tsx
|
|
490
|
-
import * as
|
|
491
|
-
|
|
333
|
+
import * as React2 from "react";
|
|
334
|
+
|
|
335
|
+
// src/utils/mirror-x.ts
|
|
336
|
+
function mirrorX(dir, x) {
|
|
337
|
+
if (dir === "ltr") return x;
|
|
338
|
+
if (typeof x === "number") return x === 0 ? 0 : -x;
|
|
339
|
+
if (x.startsWith("-")) return x.slice(1);
|
|
340
|
+
return /^0(%|px)?$/.test(x) ? x : `-${x}`;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// src/agent/presence/source-cards/card-frame.tsx
|
|
344
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
492
345
|
var EXIT_TRANSITION = { duration: 0.62, ease: CARD_EASE };
|
|
493
346
|
var CARD_EXIT = {
|
|
494
347
|
chosen: { opacity: 0, scale: 1.1, y: -8, transition: EXIT_TRANSITION },
|
|
@@ -506,9 +359,10 @@ var CARD_POSE = {
|
|
|
506
359
|
// A miss is a statement, so it is not dimmed into near-invisibility.
|
|
507
360
|
missed: { opacity: 0.7, scale: 0.94, y: 0 }
|
|
508
361
|
};
|
|
509
|
-
var SourceCardFrame =
|
|
362
|
+
var SourceCardFrame = React2.forwardRef(function SourceCardFrame2({ kind, state, size, slots, children }, ref) {
|
|
510
363
|
const box = slots === void 0 ? sourceCardBox(size) : sourceCardSpan(size, slots);
|
|
511
364
|
const pose = CARD_POSE[state];
|
|
365
|
+
const dir = useTextDirection();
|
|
512
366
|
return /* @__PURE__ */ jsxs3(
|
|
513
367
|
motion.div,
|
|
514
368
|
{
|
|
@@ -518,7 +372,7 @@ var SourceCardFrame = React3.forwardRef(function SourceCardFrame2({ kind, state,
|
|
|
518
372
|
"data-kind": kind,
|
|
519
373
|
"data-state": state,
|
|
520
374
|
"data-found": state === "missed" || state === "pending" ? "false" : "true",
|
|
521
|
-
initial: { opacity: 0, scale: 0.88, y: 7, x: -7, rotate: -1.6 },
|
|
375
|
+
initial: { opacity: 0, scale: 0.88, y: 7, x: mirrorX(dir, -7), rotate: dir === "rtl" ? 1.6 : -1.6 },
|
|
522
376
|
animate: { ...pose, x: 0, rotate: 0 },
|
|
523
377
|
exit: CARD_EXIT[state],
|
|
524
378
|
transition: { duration: 0.42, ease: CARD_EASE, layout: { duration: 0.34, ease: CARD_EASE } },
|
|
@@ -530,7 +384,7 @@ var SourceCardFrame = React3.forwardRef(function SourceCardFrame2({ kind, state,
|
|
|
530
384
|
},
|
|
531
385
|
children: [
|
|
532
386
|
children,
|
|
533
|
-
state === "chosen" && /* @__PURE__ */
|
|
387
|
+
state === "chosen" && /* @__PURE__ */ jsx5(
|
|
534
388
|
motion.span,
|
|
535
389
|
{
|
|
536
390
|
"aria-hidden": true,
|
|
@@ -544,7 +398,7 @@ var SourceCardFrame = React3.forwardRef(function SourceCardFrame2({ kind, state,
|
|
|
544
398
|
right: 0,
|
|
545
399
|
bottom: -4,
|
|
546
400
|
height: 1,
|
|
547
|
-
transformOrigin: "left center",
|
|
401
|
+
transformOrigin: dir === "rtl" ? "right center" : "left center",
|
|
548
402
|
background: ink(88)
|
|
549
403
|
}
|
|
550
404
|
}
|
|
@@ -555,7 +409,7 @@ var SourceCardFrame = React3.forwardRef(function SourceCardFrame2({ kind, state,
|
|
|
555
409
|
});
|
|
556
410
|
|
|
557
411
|
// src/agent/presence/source-cards/card-plate.tsx
|
|
558
|
-
import { jsx as
|
|
412
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
559
413
|
var PLATE_STYLE = {
|
|
560
414
|
loaded: {
|
|
561
415
|
background: ink(9),
|
|
@@ -616,7 +470,7 @@ function SourcePlate({
|
|
|
616
470
|
...style
|
|
617
471
|
},
|
|
618
472
|
children: [
|
|
619
|
-
state === "missed" && mark ? /* @__PURE__ */
|
|
473
|
+
state === "missed" && mark ? /* @__PURE__ */ jsx6(
|
|
620
474
|
"span",
|
|
621
475
|
{
|
|
622
476
|
"aria-hidden": true,
|
|
@@ -631,7 +485,7 @@ function SourcePlate({
|
|
|
631
485
|
}
|
|
632
486
|
}
|
|
633
487
|
) : null,
|
|
634
|
-
state === "missed" ? null : /* @__PURE__ */
|
|
488
|
+
state === "missed" ? null : /* @__PURE__ */ jsx6(
|
|
635
489
|
"div",
|
|
636
490
|
{
|
|
637
491
|
style: {
|
|
@@ -650,24 +504,24 @@ function SourcePlate({
|
|
|
650
504
|
}
|
|
651
505
|
|
|
652
506
|
// src/agent/presence/source-cards/card-marks.tsx
|
|
653
|
-
import * as
|
|
507
|
+
import * as React3 from "react";
|
|
654
508
|
import { useGenerationStyle } from "@40rty/ams-sdk";
|
|
655
|
-
import { Fragment as Fragment2, jsx as
|
|
509
|
+
import { Fragment as Fragment2, jsx as jsx7 } from "react/jsx-runtime";
|
|
656
510
|
function SourceImage({
|
|
657
511
|
imageUrl,
|
|
658
512
|
caption
|
|
659
513
|
}) {
|
|
660
514
|
const generation = useGenerationStyle();
|
|
661
|
-
const [broken, setBroken] =
|
|
662
|
-
const [loaded, setLoaded] =
|
|
515
|
+
const [broken, setBroken] = React3.useState(false);
|
|
516
|
+
const [loaded, setLoaded] = React3.useState(false);
|
|
663
517
|
const usable = imageUrl !== void 0 && imageUrl.length > 0 && !broken;
|
|
664
|
-
const ref =
|
|
518
|
+
const ref = React3.useCallback((node) => {
|
|
665
519
|
if (node !== null && node.complete && node.naturalWidth > 0) setLoaded(true);
|
|
666
520
|
}, []);
|
|
667
|
-
if (!usable) return /* @__PURE__ */
|
|
521
|
+
if (!usable) return /* @__PURE__ */ jsx7(Fragment2, { children: caption });
|
|
668
522
|
const blurUp = generation.image === "blur-up";
|
|
669
523
|
const seconds = generation.timings.imageResolveS;
|
|
670
|
-
return /* @__PURE__ */
|
|
524
|
+
return /* @__PURE__ */ jsx7(
|
|
671
525
|
"img",
|
|
672
526
|
{
|
|
673
527
|
ref,
|
|
@@ -690,7 +544,7 @@ function SourceImage({
|
|
|
690
544
|
);
|
|
691
545
|
}
|
|
692
546
|
function CaptionRule({ width, height }) {
|
|
693
|
-
return /* @__PURE__ */
|
|
547
|
+
return /* @__PURE__ */ jsx7(
|
|
694
548
|
"span",
|
|
695
549
|
{
|
|
696
550
|
"aria-hidden": true,
|
|
@@ -710,7 +564,7 @@ function RuledLines({
|
|
|
710
564
|
lines,
|
|
711
565
|
headline
|
|
712
566
|
}) {
|
|
713
|
-
return /* @__PURE__ */
|
|
567
|
+
return /* @__PURE__ */ jsx7(
|
|
714
568
|
"div",
|
|
715
569
|
{
|
|
716
570
|
className: sourceCardClass.rules,
|
|
@@ -721,7 +575,7 @@ function RuledLines({
|
|
|
721
575
|
height: "100%",
|
|
722
576
|
width: "100%"
|
|
723
577
|
},
|
|
724
|
-
children: lines.map((line, i) => /* @__PURE__ */
|
|
578
|
+
children: lines.map((line, i) => /* @__PURE__ */ jsx7(
|
|
725
579
|
"span",
|
|
726
580
|
{
|
|
727
581
|
className: sourceCardClass.rule,
|
|
@@ -739,7 +593,7 @@ function RuledLines({
|
|
|
739
593
|
}
|
|
740
594
|
function CornerFold({ width, fold }) {
|
|
741
595
|
const length = Math.round(fold * Math.SQRT2);
|
|
742
|
-
return /* @__PURE__ */
|
|
596
|
+
return /* @__PURE__ */ jsx7(
|
|
743
597
|
"span",
|
|
744
598
|
{
|
|
745
599
|
"aria-hidden": true,
|
|
@@ -765,7 +619,7 @@ function RatingStars({
|
|
|
765
619
|
const gap = Math.max(1, Math.round(width * 0.05));
|
|
766
620
|
const star = Math.max(4, Math.floor((width - gap * (count - 1)) / count));
|
|
767
621
|
const filled = score === void 0 ? 0 : Math.min(count, Math.max(0, Math.round(score)));
|
|
768
|
-
return /* @__PURE__ */
|
|
622
|
+
return /* @__PURE__ */ jsx7("div", { className: sourceCardClass.pips, style: { display: "flex", gap, flexShrink: 0 }, children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx7(
|
|
769
623
|
"svg",
|
|
770
624
|
{
|
|
771
625
|
className: sourceCardClass.pip,
|
|
@@ -775,7 +629,7 @@ function RatingStars({
|
|
|
775
629
|
viewBox: "0 0 24 24",
|
|
776
630
|
"aria-hidden": true,
|
|
777
631
|
style: { display: "block", flexShrink: 0 },
|
|
778
|
-
children: /* @__PURE__ */
|
|
632
|
+
children: /* @__PURE__ */ jsx7(
|
|
779
633
|
"path",
|
|
780
634
|
{
|
|
781
635
|
d: STAR_PATH,
|
|
@@ -791,9 +645,9 @@ function RatingStars({
|
|
|
791
645
|
}
|
|
792
646
|
|
|
793
647
|
// src/agent/presence/source-cards/ProductSourceCard.tsx
|
|
794
|
-
import * as
|
|
795
|
-
import { jsx as
|
|
796
|
-
var ProductSourceCard =
|
|
648
|
+
import * as React4 from "react";
|
|
649
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
650
|
+
var ProductSourceCard = React4.forwardRef(
|
|
797
651
|
function ProductSourceCard2({
|
|
798
652
|
source,
|
|
799
653
|
sourceKind,
|
|
@@ -805,11 +659,11 @@ var ProductSourceCard = React5.forwardRef(
|
|
|
805
659
|
const box = sourceCardBox(size);
|
|
806
660
|
const state = sourceCardState(found, pending, chosen);
|
|
807
661
|
const imageUrl = source === void 0 ? void 0 : source.imageUrl;
|
|
808
|
-
return /* @__PURE__ */
|
|
662
|
+
return /* @__PURE__ */ jsx8(SourceCardFrame, { ref, kind: sourceKind, state, size, children: /* @__PURE__ */ jsx8(SourcePlate, { width: box.width, height: box.height, state, mark: true, children: /* @__PURE__ */ jsx8(
|
|
809
663
|
SourceImage,
|
|
810
664
|
{
|
|
811
665
|
imageUrl,
|
|
812
|
-
caption: /* @__PURE__ */
|
|
666
|
+
caption: /* @__PURE__ */ jsx8(CaptionRule, { width: box.width, height: box.height })
|
|
813
667
|
}
|
|
814
668
|
) }) });
|
|
815
669
|
}
|
|
@@ -819,10 +673,10 @@ var productSourceForm = {
|
|
|
819
673
|
};
|
|
820
674
|
|
|
821
675
|
// src/agent/presence/source-cards/CollectionSourceCard.tsx
|
|
822
|
-
import * as
|
|
823
|
-
import { jsx as
|
|
676
|
+
import * as React5 from "react";
|
|
677
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
824
678
|
var STEP_RATIO = 0.1;
|
|
825
|
-
var CollectionSourceCard =
|
|
679
|
+
var CollectionSourceCard = React5.forwardRef(
|
|
826
680
|
function CollectionSourceCard2({
|
|
827
681
|
source,
|
|
828
682
|
sourceKind,
|
|
@@ -840,7 +694,7 @@ var CollectionSourceCard = React6.forwardRef(
|
|
|
840
694
|
const imageUrl = source === void 0 ? void 0 : source.imageUrl;
|
|
841
695
|
const hairline = ink(30);
|
|
842
696
|
return /* @__PURE__ */ jsxs5(SourceCardFrame, { ref, kind: sourceKind, state, size, children: [
|
|
843
|
-
(missed ? [1] : [2, 1]).map((depth) => /* @__PURE__ */
|
|
697
|
+
(missed ? [1] : [2, 1]).map((depth) => /* @__PURE__ */ jsx9(
|
|
844
698
|
SourcePlate,
|
|
845
699
|
{
|
|
846
700
|
width: face.width,
|
|
@@ -857,15 +711,15 @@ var CollectionSourceCard = React6.forwardRef(
|
|
|
857
711
|
depth
|
|
858
712
|
)),
|
|
859
713
|
/* @__PURE__ */ jsxs5(SourcePlate, { width: face.width, height: face.height, state, mark: true, style: { zIndex: 1 }, children: [
|
|
860
|
-
/* @__PURE__ */
|
|
861
|
-
/* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ jsx9(SourceImage, { imageUrl, caption: null }),
|
|
715
|
+
/* @__PURE__ */ jsx9(
|
|
862
716
|
"span",
|
|
863
717
|
{
|
|
864
718
|
"aria-hidden": true,
|
|
865
719
|
style: { position: "absolute", left: 0, top: "50%", width: "100%", height: 1, background: hairline }
|
|
866
720
|
}
|
|
867
721
|
),
|
|
868
|
-
/* @__PURE__ */
|
|
722
|
+
/* @__PURE__ */ jsx9(
|
|
869
723
|
"span",
|
|
870
724
|
{
|
|
871
725
|
"aria-hidden": true,
|
|
@@ -881,8 +735,8 @@ var collectionSourceForm = {
|
|
|
881
735
|
};
|
|
882
736
|
|
|
883
737
|
// src/agent/presence/source-cards/ArticleSourceCard.tsx
|
|
884
|
-
import * as
|
|
885
|
-
import { jsx as
|
|
738
|
+
import * as React6 from "react";
|
|
739
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
886
740
|
function articleLines(size, weight) {
|
|
887
741
|
const headline = { width: 0.68, weight: weight + 1 };
|
|
888
742
|
const closer = { width: 0.44, weight };
|
|
@@ -898,7 +752,7 @@ function articleLines(size, weight) {
|
|
|
898
752
|
closer
|
|
899
753
|
];
|
|
900
754
|
}
|
|
901
|
-
var ArticleSourceCard =
|
|
755
|
+
var ArticleSourceCard = React6.forwardRef(
|
|
902
756
|
function ArticleSourceCard2({
|
|
903
757
|
sourceKind,
|
|
904
758
|
size,
|
|
@@ -909,7 +763,7 @@ var ArticleSourceCard = React7.forwardRef(
|
|
|
909
763
|
const box = sourceCardBox(size);
|
|
910
764
|
const state = sourceCardState(found, pending, chosen);
|
|
911
765
|
const pad = platePad(box.width);
|
|
912
|
-
return /* @__PURE__ */
|
|
766
|
+
return /* @__PURE__ */ jsx10(SourceCardFrame, { ref, kind: sourceKind, state, size, children: /* @__PURE__ */ jsx10(SourcePlate, { width: box.width, height: box.height, state, mark: true, children: /* @__PURE__ */ jsx10("div", { style: { position: "absolute", inset: pad }, children: /* @__PURE__ */ jsx10(RuledLines, { lines: articleLines(size, ruleWeight(size)), headline: true }) }) }) });
|
|
913
767
|
}
|
|
914
768
|
);
|
|
915
769
|
var articleSourceForm = {
|
|
@@ -917,8 +771,8 @@ var articleSourceForm = {
|
|
|
917
771
|
};
|
|
918
772
|
|
|
919
773
|
// src/agent/presence/source-cards/PolicySourceCard.tsx
|
|
920
|
-
import * as
|
|
921
|
-
import { jsx as
|
|
774
|
+
import * as React7 from "react";
|
|
775
|
+
import { jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
922
776
|
var FOLD_RATIO = 0.32;
|
|
923
777
|
function policyLines(weight) {
|
|
924
778
|
return [
|
|
@@ -927,7 +781,7 @@ function policyLines(weight) {
|
|
|
927
781
|
{ width: 0.5, weight }
|
|
928
782
|
];
|
|
929
783
|
}
|
|
930
|
-
var PolicySourceCard =
|
|
784
|
+
var PolicySourceCard = React7.forwardRef(
|
|
931
785
|
function PolicySourceCard2({
|
|
932
786
|
sourceKind,
|
|
933
787
|
size,
|
|
@@ -940,7 +794,7 @@ var PolicySourceCard = React8.forwardRef(
|
|
|
940
794
|
const pad = platePad(box.width);
|
|
941
795
|
const fold = Math.max(5, Math.round(box.width * FOLD_RATIO));
|
|
942
796
|
return /* @__PURE__ */ jsxs6(SourceCardFrame, { ref, kind: sourceKind, state, size, children: [
|
|
943
|
-
/* @__PURE__ */
|
|
797
|
+
/* @__PURE__ */ jsx11(
|
|
944
798
|
SourcePlate,
|
|
945
799
|
{
|
|
946
800
|
width: box.width,
|
|
@@ -950,10 +804,10 @@ var PolicySourceCard = React8.forwardRef(
|
|
|
950
804
|
style: {
|
|
951
805
|
clipPath: `polygon(0 0, ${box.width - fold}px 0, ${box.width}px ${fold}px, ${box.width}px ${box.height}px, 0 ${box.height}px)`
|
|
952
806
|
},
|
|
953
|
-
children: /* @__PURE__ */
|
|
807
|
+
children: /* @__PURE__ */ jsx11("div", { style: { position: "absolute", left: pad, right: pad, top: fold + pad, bottom: pad }, children: /* @__PURE__ */ jsx11(RuledLines, { lines: policyLines(ruleWeight(size)), headline: false }) })
|
|
954
808
|
}
|
|
955
809
|
),
|
|
956
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ jsx11(CornerFold, { width: box.width, fold })
|
|
957
811
|
] });
|
|
958
812
|
}
|
|
959
813
|
);
|
|
@@ -962,7 +816,7 @@ var policySourceForm = {
|
|
|
962
816
|
};
|
|
963
817
|
|
|
964
818
|
// src/agent/presence/source-cards/ReviewSourceCard.tsx
|
|
965
|
-
import * as
|
|
819
|
+
import * as React8 from "react";
|
|
966
820
|
|
|
967
821
|
// src/agent/presence/source-cards/review-passage.ts
|
|
968
822
|
function str(value) {
|
|
@@ -1014,7 +868,7 @@ function reviewPassages(refs) {
|
|
|
1014
868
|
}
|
|
1015
869
|
|
|
1016
870
|
// src/agent/presence/source-cards/ReviewSourceCard.tsx
|
|
1017
|
-
import { jsx as
|
|
871
|
+
import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1018
872
|
var REVIEW_SLOTS = 5;
|
|
1019
873
|
var COLUMN_MAX = 5;
|
|
1020
874
|
var COLUMN_DWELL_MS = 900;
|
|
@@ -1032,7 +886,7 @@ function reviewLines(weight) {
|
|
|
1032
886
|
];
|
|
1033
887
|
}
|
|
1034
888
|
function Passage({ passage }) {
|
|
1035
|
-
return /* @__PURE__ */
|
|
889
|
+
return /* @__PURE__ */ jsx12(
|
|
1036
890
|
"p",
|
|
1037
891
|
{
|
|
1038
892
|
style: {
|
|
@@ -1044,7 +898,7 @@ function Passage({ passage }) {
|
|
|
1044
898
|
color: ink(76),
|
|
1045
899
|
wordBreak: "break-word"
|
|
1046
900
|
},
|
|
1047
|
-
children: passage.runs.map((run, i) => /* @__PURE__ */
|
|
901
|
+
children: passage.runs.map((run, i) => /* @__PURE__ */ jsx12(
|
|
1048
902
|
"span",
|
|
1049
903
|
{
|
|
1050
904
|
"data-marked": run.marked ? "true" : "false",
|
|
@@ -1062,8 +916,8 @@ function Passage({ passage }) {
|
|
|
1062
916
|
);
|
|
1063
917
|
}
|
|
1064
918
|
function useRead(count, still) {
|
|
1065
|
-
const [at, setAt] =
|
|
1066
|
-
|
|
919
|
+
const [at, setAt] = React8.useState(0);
|
|
920
|
+
React8.useEffect(() => {
|
|
1067
921
|
if (still || count <= 1) return;
|
|
1068
922
|
const last = Math.min(count, COLUMN_MAX) - 1;
|
|
1069
923
|
if (at >= last) return;
|
|
@@ -1072,7 +926,7 @@ function useRead(count, still) {
|
|
|
1072
926
|
}, [count, still, at]);
|
|
1073
927
|
return Math.min(at, Math.max(0, Math.min(count, COLUMN_MAX) - 1));
|
|
1074
928
|
}
|
|
1075
|
-
var ReviewSourceCard =
|
|
929
|
+
var ReviewSourceCard = React8.forwardRef(
|
|
1076
930
|
function ReviewSourceCard2({ source, records, sourceKind, size, found, pending, chosen }, ref) {
|
|
1077
931
|
const box = sourceCardSpan(size, REVIEW_SLOTS);
|
|
1078
932
|
const state = sourceCardState(found, pending, chosen);
|
|
@@ -1086,8 +940,8 @@ var ReviewSourceCard = React9.forwardRef(
|
|
|
1086
940
|
const viewport = LINE_H * COLUMN_LINES;
|
|
1087
941
|
const framed = passages.some((passage) => passage.imageUrl !== void 0);
|
|
1088
942
|
const thumb = current === void 0 ? void 0 : current.imageUrl;
|
|
1089
|
-
return /* @__PURE__ */
|
|
1090
|
-
framed && /* @__PURE__ */
|
|
943
|
+
return /* @__PURE__ */ jsx12(SourceCardFrame, { ref, kind: sourceKind, state, size, slots: REVIEW_SLOTS, children: /* @__PURE__ */ jsx12(SourcePlate, { width: box.width, height: box.height, state, mark: true, children: /* @__PURE__ */ jsxs7("div", { style: { position: "absolute", inset: pad, display: "flex", gap: THUMB_GAP }, children: [
|
|
944
|
+
framed && /* @__PURE__ */ jsx12("div", { style: { width: THUMB_W, height: interior, flexShrink: 0 }, children: thumb !== void 0 && /* @__PURE__ */ jsx12(
|
|
1091
945
|
"img",
|
|
1092
946
|
{
|
|
1093
947
|
src: thumb,
|
|
@@ -1108,7 +962,7 @@ var ReviewSourceCard = React9.forwardRef(
|
|
|
1108
962
|
}
|
|
1109
963
|
) }),
|
|
1110
964
|
/* @__PURE__ */ jsxs7("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column", gap: ROW_GAP }, children: [
|
|
1111
|
-
/* @__PURE__ */
|
|
965
|
+
/* @__PURE__ */ jsx12(
|
|
1112
966
|
RatingStars,
|
|
1113
967
|
{
|
|
1114
968
|
width: STAR_ROW_W,
|
|
@@ -1120,14 +974,14 @@ var ReviewSourceCard = React9.forwardRef(
|
|
|
1120
974
|
// the tool returned without prose. The ruled lines are the same
|
|
1121
975
|
// statement the card has always made — "somebody's few
|
|
1122
976
|
// sentences about a thing" — with nothing invented to fill them.
|
|
1123
|
-
/* @__PURE__ */
|
|
1124
|
-
) : /* @__PURE__ */
|
|
977
|
+
/* @__PURE__ */ jsx12("div", { style: { flex: 1, minHeight: 0 }, children: /* @__PURE__ */ jsx12(RuledLines, { lines: reviewLines(ruleWeight(size)), headline: false }) })
|
|
978
|
+
) : /* @__PURE__ */ jsx12("div", { style: { height: viewport, overflow: "hidden", position: "relative" }, children: /* @__PURE__ */ jsx12(
|
|
1125
979
|
motion.div,
|
|
1126
980
|
{
|
|
1127
981
|
animate: { y: -at * viewport },
|
|
1128
982
|
initial: false,
|
|
1129
983
|
transition: still ? { duration: 0 } : { duration: 0.42, ease: CARD_EASE },
|
|
1130
|
-
children: passages.slice(0, COLUMN_MAX).map((passage) => /* @__PURE__ */
|
|
984
|
+
children: passages.slice(0, COLUMN_MAX).map((passage) => /* @__PURE__ */ jsx12(Passage, { passage }, passage.key))
|
|
1131
985
|
}
|
|
1132
986
|
) })
|
|
1133
987
|
] })
|
|
@@ -1160,14 +1014,14 @@ function registerDefaultPresenceSourceForms() {
|
|
|
1160
1014
|
registerDefaultPresenceSourceForms();
|
|
1161
1015
|
|
|
1162
1016
|
// src/agent/presence/source-cards/SourceCard.tsx
|
|
1163
|
-
import * as
|
|
1017
|
+
import * as React9 from "react";
|
|
1164
1018
|
import { resolvePresenceSourceForm } from "@40rty/ams-sdk";
|
|
1165
|
-
import { jsx as
|
|
1166
|
-
var PresenceSourceCard =
|
|
1019
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1020
|
+
var PresenceSourceCard = React9.forwardRef(function PresenceSourceCard2({ source, records, sourceKind, size, found, pending, chosen }, ref) {
|
|
1167
1021
|
const def = resolvePresenceSourceForm(sourceKind);
|
|
1168
1022
|
if (def === void 0) return null;
|
|
1169
1023
|
const { Component } = def;
|
|
1170
|
-
return /* @__PURE__ */
|
|
1024
|
+
return /* @__PURE__ */ jsx13(
|
|
1171
1025
|
Component,
|
|
1172
1026
|
{
|
|
1173
1027
|
ref,
|
|
@@ -1183,7 +1037,7 @@ var PresenceSourceCard = React10.forwardRef(function PresenceSourceCard2({ sourc
|
|
|
1183
1037
|
});
|
|
1184
1038
|
|
|
1185
1039
|
// src/agent/presence/SourceSift.tsx
|
|
1186
|
-
import * as
|
|
1040
|
+
import * as React10 from "react";
|
|
1187
1041
|
|
|
1188
1042
|
// src/agent/presence/sift-deck.ts
|
|
1189
1043
|
import { resolvePresenceSourceForm as resolvePresenceSourceForm2 } from "@40rty/ams-sdk";
|
|
@@ -1325,7 +1179,7 @@ function siftDeck(sources, materialized, limit, admitted) {
|
|
|
1325
1179
|
}
|
|
1326
1180
|
|
|
1327
1181
|
// src/agent/presence/SourceSift.tsx
|
|
1328
|
-
import { jsx as
|
|
1182
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1329
1183
|
var SIFT_MAX_CARDS = {
|
|
1330
1184
|
band: 8,
|
|
1331
1185
|
compact: 5,
|
|
@@ -1349,7 +1203,7 @@ function siftRegionWidth(size) {
|
|
|
1349
1203
|
}
|
|
1350
1204
|
function CriterionPass({ seq }) {
|
|
1351
1205
|
if (seq === 0) return null;
|
|
1352
|
-
return /* @__PURE__ */
|
|
1206
|
+
return /* @__PURE__ */ jsx14(
|
|
1353
1207
|
motion.span,
|
|
1354
1208
|
{
|
|
1355
1209
|
"aria-hidden": true,
|
|
@@ -1376,34 +1230,34 @@ function SourceSift({
|
|
|
1376
1230
|
size = "band",
|
|
1377
1231
|
reserveTrack = false
|
|
1378
1232
|
}) {
|
|
1379
|
-
const admitted =
|
|
1233
|
+
const admitted = React10.useRef(/* @__PURE__ */ new Map());
|
|
1380
1234
|
const deck = siftDeck(sources, materialized, SIFT_MAX_CARDS[size], admitted.current);
|
|
1381
1235
|
for (const card of deck.cards) admitted.current.set(card.key, card.slots);
|
|
1382
1236
|
const controls = useAnimationControls();
|
|
1383
|
-
const seen =
|
|
1384
|
-
const [pass, setPass] =
|
|
1385
|
-
|
|
1237
|
+
const seen = React10.useRef(criteria);
|
|
1238
|
+
const [pass, setPass] = React10.useState(0);
|
|
1239
|
+
React10.useEffect(() => {
|
|
1386
1240
|
if (criteria > seen.current) setPass((n) => n + 1);
|
|
1387
1241
|
seen.current = criteria;
|
|
1388
1242
|
}, [criteria]);
|
|
1389
|
-
|
|
1243
|
+
React10.useEffect(() => {
|
|
1390
1244
|
if (pass === 0) return;
|
|
1391
1245
|
void controls.start({
|
|
1392
1246
|
opacity: [1, 0.62, 1],
|
|
1393
1247
|
transition: { duration: 0.62, ease: "easeInOut", times: [0, 0.34, 1] }
|
|
1394
1248
|
});
|
|
1395
1249
|
}, [pass, controls]);
|
|
1396
|
-
const lastRest =
|
|
1250
|
+
const lastRest = React10.useRef(0);
|
|
1397
1251
|
const live = deck.cards.length > 0;
|
|
1398
|
-
const [resolving, setResolving] =
|
|
1399
|
-
|
|
1252
|
+
const [resolving, setResolving] = React10.useState(false);
|
|
1253
|
+
React10.useEffect(() => {
|
|
1400
1254
|
if (live) setResolving(true);
|
|
1401
1255
|
}, [live]);
|
|
1402
1256
|
if (!live && !resolving) return null;
|
|
1403
1257
|
const rest = Math.max(0, deck.read - deck.cards.length);
|
|
1404
1258
|
if (rest > 0) lastRest.current = rest;
|
|
1405
1259
|
const shownRest = rest > 0 ? rest : lastRest.current;
|
|
1406
|
-
const tail = /* @__PURE__ */
|
|
1260
|
+
const tail = /* @__PURE__ */ jsx14(
|
|
1407
1261
|
motion.span,
|
|
1408
1262
|
{
|
|
1409
1263
|
className: presenceClass.siftMore,
|
|
@@ -1429,7 +1283,7 @@ function SourceSift({
|
|
|
1429
1283
|
animate: controls,
|
|
1430
1284
|
style: reserveTrack ? { gap: SOURCE_CARD_GAP[size], width: trackWidth(size) } : { gap: SOURCE_CARD_GAP[size] },
|
|
1431
1285
|
children: [
|
|
1432
|
-
/* @__PURE__ */
|
|
1286
|
+
/* @__PURE__ */ jsx14(
|
|
1433
1287
|
AnimatePresence,
|
|
1434
1288
|
{
|
|
1435
1289
|
mode: "popLayout",
|
|
@@ -1438,7 +1292,7 @@ function SourceSift({
|
|
|
1438
1292
|
admitted.current = /* @__PURE__ */ new Map();
|
|
1439
1293
|
setResolving(false);
|
|
1440
1294
|
},
|
|
1441
|
-
children: deck.cards.map((card) => /* @__PURE__ */
|
|
1295
|
+
children: deck.cards.map((card) => /* @__PURE__ */ jsx14(
|
|
1442
1296
|
PresenceSourceCard,
|
|
1443
1297
|
{
|
|
1444
1298
|
source: card.ref,
|
|
@@ -1453,7 +1307,7 @@ function SourceSift({
|
|
|
1453
1307
|
))
|
|
1454
1308
|
}
|
|
1455
1309
|
),
|
|
1456
|
-
/* @__PURE__ */
|
|
1310
|
+
/* @__PURE__ */ jsx14(CriterionPass, { seq: pass })
|
|
1457
1311
|
]
|
|
1458
1312
|
}
|
|
1459
1313
|
),
|
|
@@ -1471,7 +1325,7 @@ import {
|
|
|
1471
1325
|
presenceFactShape,
|
|
1472
1326
|
resolvePresenceFactForm
|
|
1473
1327
|
} from "@40rty/ams-sdk";
|
|
1474
|
-
import { jsx as
|
|
1328
|
+
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1475
1329
|
function resolveValueForm(fact) {
|
|
1476
1330
|
if (fact.scope !== void 0) {
|
|
1477
1331
|
const declared = resolvePresenceFactForm(fact.scope);
|
|
@@ -1495,12 +1349,12 @@ function FactChip({ fact, onForget }) {
|
|
|
1495
1349
|
exit: { opacity: 0, scale: 0.92 },
|
|
1496
1350
|
transition: { duration: 0.3, ease: [0.22, 1, 0.36, 1] },
|
|
1497
1351
|
children: [
|
|
1498
|
-
/* @__PURE__ */
|
|
1352
|
+
/* @__PURE__ */ jsx15("span", { className: presenceClass.factLabel, children: fact.label }),
|
|
1499
1353
|
form === void 0 ? /* @__PURE__ */ jsxs9("span", { className: presenceClass.factValue, children: [
|
|
1500
1354
|
colorSwatch(fact.value),
|
|
1501
|
-
/* @__PURE__ */
|
|
1502
|
-
] }) : /* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
1355
|
+
/* @__PURE__ */ jsx15("span", { className: presenceClass.factValueText, children: fact.value })
|
|
1356
|
+
] }) : /* @__PURE__ */ jsx15("span", { className: presenceClass.factValue, "data-form": "true", children: /* @__PURE__ */ jsx15(form.Component, { fact, kind }) }),
|
|
1357
|
+
/* @__PURE__ */ jsx15(
|
|
1504
1358
|
"button",
|
|
1505
1359
|
{
|
|
1506
1360
|
type: "button",
|
|
@@ -1525,10 +1379,10 @@ function sortFactsByTier(facts) {
|
|
|
1525
1379
|
}
|
|
1526
1380
|
|
|
1527
1381
|
// src/agent/presence/CompactRead.tsx
|
|
1528
|
-
import { jsx as
|
|
1382
|
+
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1529
1383
|
function CompactLead({ text }) {
|
|
1530
1384
|
if (text.trim().length === 0) return null;
|
|
1531
|
-
return /* @__PURE__ */
|
|
1385
|
+
return /* @__PURE__ */ jsx16("div", { className: "fourty-presence-read__compact-lead", children: /* @__PURE__ */ jsx16("span", { className: presenceClass.prose, "data-clamp": "1", children: text }) });
|
|
1532
1386
|
}
|
|
1533
1387
|
function CompactStream({
|
|
1534
1388
|
lead,
|
|
@@ -1539,8 +1393,8 @@ function CompactStream({
|
|
|
1539
1393
|
chipsOnly = false
|
|
1540
1394
|
}) {
|
|
1541
1395
|
return /* @__PURE__ */ jsxs10("div", { className: presenceClass.row, "data-compact": "true", children: [
|
|
1542
|
-
!chipsOnly && /* @__PURE__ */
|
|
1543
|
-
/* @__PURE__ */
|
|
1396
|
+
!chipsOnly && /* @__PURE__ */ jsx16(CompactLead, { text: lead }),
|
|
1397
|
+
/* @__PURE__ */ jsx16(
|
|
1544
1398
|
SourceSift,
|
|
1545
1399
|
{
|
|
1546
1400
|
sources,
|
|
@@ -1549,7 +1403,7 @@ function CompactStream({
|
|
|
1549
1403
|
size: "compact"
|
|
1550
1404
|
}
|
|
1551
1405
|
),
|
|
1552
|
-
/* @__PURE__ */
|
|
1406
|
+
/* @__PURE__ */ jsx16(
|
|
1553
1407
|
FactChips,
|
|
1554
1408
|
{
|
|
1555
1409
|
facts: [...facts].sort((a, b) => a.slot - b.slot).map((f) => f.fact),
|
|
@@ -1565,7 +1419,7 @@ function FactChips({
|
|
|
1565
1419
|
const { forget } = useForgetFact();
|
|
1566
1420
|
if (facts.length === 0) return null;
|
|
1567
1421
|
return /* @__PURE__ */ jsxs10("div", { className: presenceClass.facts, "data-compact": "true", children: [
|
|
1568
|
-
/* @__PURE__ */
|
|
1422
|
+
/* @__PURE__ */ jsx16(AnimatePresence, { initial: false, children: facts.map((fact) => /* @__PURE__ */ jsx16(FactChip, { fact, onForget: forget }, factIdentity(fact))) }),
|
|
1569
1423
|
more > 0 && /* @__PURE__ */ jsxs10("span", { className: presenceClass.factMore, children: [
|
|
1570
1424
|
"+",
|
|
1571
1425
|
more
|
|
@@ -1610,15 +1464,15 @@ function bandRowTemplate(railWidth, deckWidth) {
|
|
|
1610
1464
|
}
|
|
1611
1465
|
|
|
1612
1466
|
// src/agent/presence/folded.tsx
|
|
1613
|
-
import * as
|
|
1614
|
-
import { jsx as
|
|
1467
|
+
import * as React11 from "react";
|
|
1468
|
+
import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1615
1469
|
function Sep() {
|
|
1616
|
-
return /* @__PURE__ */
|
|
1470
|
+
return /* @__PURE__ */ jsx17("span", { "aria-hidden": true, className: presenceClass.factSep, "data-dot": "true", children: "\xB7" });
|
|
1617
1471
|
}
|
|
1618
1472
|
function FactChip2({ fact }) {
|
|
1619
1473
|
const swatch = colorSwatch(fact.value);
|
|
1620
1474
|
return /* @__PURE__ */ jsxs11("span", { className: presenceClass.fact, "data-tier": fact.tier === "profile" ? "profile" : "session", children: [
|
|
1621
|
-
/* @__PURE__ */
|
|
1475
|
+
/* @__PURE__ */ jsx17("span", { className: presenceClass.factLabel, children: fact.label }),
|
|
1622
1476
|
/* @__PURE__ */ jsxs11("span", { className: presenceClass.factValue, children: [
|
|
1623
1477
|
swatch,
|
|
1624
1478
|
fact.value
|
|
@@ -1629,18 +1483,18 @@ function FoldedRead({ label, facts, text }) {
|
|
|
1629
1483
|
const shown = sortFactsByTier(facts).slice(0, 3);
|
|
1630
1484
|
const moreFacts = facts.length - shown.length;
|
|
1631
1485
|
return /* @__PURE__ */ jsxs11("div", { className: presenceClass.row, "data-folded": "true", children: [
|
|
1632
|
-
label.length > 0 && /* @__PURE__ */
|
|
1633
|
-
label.length > 0 && /* @__PURE__ */
|
|
1486
|
+
label.length > 0 && /* @__PURE__ */ jsx17(Eyebrow, { children: label }),
|
|
1487
|
+
label.length > 0 && /* @__PURE__ */ jsx17(Rule, {}),
|
|
1634
1488
|
shown.length > 0 ? /* @__PURE__ */ jsxs11("div", { className: presenceClass.facts, "data-folded": "true", children: [
|
|
1635
|
-
shown.map((f, i) => /* @__PURE__ */ jsxs11(
|
|
1636
|
-
i > 0 && /* @__PURE__ */
|
|
1637
|
-
/* @__PURE__ */
|
|
1489
|
+
shown.map((f, i) => /* @__PURE__ */ jsxs11(React11.Fragment, { children: [
|
|
1490
|
+
i > 0 && /* @__PURE__ */ jsx17(Sep, {}),
|
|
1491
|
+
/* @__PURE__ */ jsx17(FactChip2, { fact: f })
|
|
1638
1492
|
] }, f.label)),
|
|
1639
1493
|
moreFacts > 0 && /* @__PURE__ */ jsxs11("span", { className: presenceClass.factMore, children: [
|
|
1640
1494
|
"+",
|
|
1641
1495
|
moreFacts
|
|
1642
1496
|
] })
|
|
1643
|
-
] }) : /* @__PURE__ */
|
|
1497
|
+
] }) : /* @__PURE__ */ jsx17("span", { className: presenceClass.prose, "data-clamp": "1", children: text })
|
|
1644
1498
|
] });
|
|
1645
1499
|
}
|
|
1646
1500
|
function BriefHandle({
|
|
@@ -1648,7 +1502,7 @@ function BriefHandle({
|
|
|
1648
1502
|
onToggle
|
|
1649
1503
|
}) {
|
|
1650
1504
|
const { brief } = useLabels().presence;
|
|
1651
|
-
return /* @__PURE__ */
|
|
1505
|
+
return /* @__PURE__ */ jsx17(
|
|
1652
1506
|
motion.button,
|
|
1653
1507
|
{
|
|
1654
1508
|
type: "button",
|
|
@@ -1666,13 +1520,13 @@ function BriefHandle({
|
|
|
1666
1520
|
}
|
|
1667
1521
|
|
|
1668
1522
|
// src/agent/presence/PresenceBrief.tsx
|
|
1669
|
-
import * as
|
|
1523
|
+
import * as React13 from "react";
|
|
1670
1524
|
import { usePresenceElements, usePresenceLiveTurn } from "@40rty/ams-sdk";
|
|
1671
1525
|
|
|
1672
1526
|
// src/agent/presence/BriefIdentity.tsx
|
|
1673
|
-
import * as
|
|
1527
|
+
import * as React12 from "react";
|
|
1674
1528
|
import { useVisitorName } from "@40rty/ams-sdk";
|
|
1675
|
-
import { jsx as
|
|
1529
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1676
1530
|
var SETTLE = [0.22, 1, 0.36, 1];
|
|
1677
1531
|
function NameField({
|
|
1678
1532
|
onCommit,
|
|
@@ -1680,9 +1534,9 @@ function NameField({
|
|
|
1680
1534
|
initial
|
|
1681
1535
|
}) {
|
|
1682
1536
|
const { identity } = useLabels().presence.brief;
|
|
1683
|
-
const [draft, setDraft] =
|
|
1684
|
-
const ref =
|
|
1685
|
-
|
|
1537
|
+
const [draft, setDraft] = React12.useState(initial);
|
|
1538
|
+
const ref = React12.useRef(null);
|
|
1539
|
+
React12.useEffect(() => {
|
|
1686
1540
|
ref.current?.focus();
|
|
1687
1541
|
}, []);
|
|
1688
1542
|
const commit = () => {
|
|
@@ -1693,7 +1547,7 @@ function NameField({
|
|
|
1693
1547
|
}
|
|
1694
1548
|
onCommit(next);
|
|
1695
1549
|
};
|
|
1696
|
-
return /* @__PURE__ */
|
|
1550
|
+
return /* @__PURE__ */ jsx18(
|
|
1697
1551
|
"input",
|
|
1698
1552
|
{
|
|
1699
1553
|
ref,
|
|
@@ -1718,9 +1572,9 @@ function NameField({
|
|
|
1718
1572
|
function BriefIdentity() {
|
|
1719
1573
|
const { name, setName } = useVisitorName();
|
|
1720
1574
|
const { identity } = useLabels().presence.brief;
|
|
1721
|
-
const [editing, setEditing] =
|
|
1575
|
+
const [editing, setEditing] = React12.useState(false);
|
|
1722
1576
|
if (editing) {
|
|
1723
|
-
return /* @__PURE__ */
|
|
1577
|
+
return /* @__PURE__ */ jsx18("div", { className: presenceClass.identity, children: /* @__PURE__ */ jsx18(
|
|
1724
1578
|
NameField,
|
|
1725
1579
|
{
|
|
1726
1580
|
initial: name === null ? "" : name,
|
|
@@ -1732,7 +1586,7 @@ function BriefIdentity() {
|
|
|
1732
1586
|
}
|
|
1733
1587
|
) });
|
|
1734
1588
|
}
|
|
1735
|
-
return /* @__PURE__ */
|
|
1589
|
+
return /* @__PURE__ */ jsx18("div", { className: presenceClass.identity, children: name === null ? /* @__PURE__ */ jsx18(
|
|
1736
1590
|
"button",
|
|
1737
1591
|
{
|
|
1738
1592
|
type: "button",
|
|
@@ -1740,7 +1594,7 @@ function BriefIdentity() {
|
|
|
1740
1594
|
onClick: () => setEditing(true),
|
|
1741
1595
|
children: identity.invite
|
|
1742
1596
|
}
|
|
1743
|
-
) : /* @__PURE__ */
|
|
1597
|
+
) : /* @__PURE__ */ jsx18(
|
|
1744
1598
|
motion.button,
|
|
1745
1599
|
{
|
|
1746
1600
|
type: "button",
|
|
@@ -1757,7 +1611,7 @@ function BriefIdentity() {
|
|
|
1757
1611
|
|
|
1758
1612
|
// src/agent/presence/PresenceBrief.tsx
|
|
1759
1613
|
import { useForgetFact as useForgetFact2, useUndismissedFacts } from "@40rty/ams-sdk";
|
|
1760
|
-
import { jsx as
|
|
1614
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1761
1615
|
var SETTLE2 = [0.22, 1, 0.36, 1];
|
|
1762
1616
|
function partition(facts) {
|
|
1763
1617
|
const recalled = [];
|
|
@@ -1775,48 +1629,48 @@ function Group({
|
|
|
1775
1629
|
}) {
|
|
1776
1630
|
if (facts.length === 0) return null;
|
|
1777
1631
|
return /* @__PURE__ */ jsxs12("section", { className: presenceClass.briefGroup, children: [
|
|
1778
|
-
/* @__PURE__ */
|
|
1779
|
-
/* @__PURE__ */
|
|
1632
|
+
/* @__PURE__ */ jsx19("header", { className: presenceClass.briefGroupHead, children: /* @__PURE__ */ jsx19("span", { className: presenceClass.eyebrow, children: title }) }),
|
|
1633
|
+
/* @__PURE__ */ jsx19("div", { className: presenceClass.facts, "data-editable": "true", "data-brief": "true", children: /* @__PURE__ */ jsx19(AnimatePresence, { initial: false, children: facts.map((f) => /* @__PURE__ */ jsx19(FactChip, { fact: f, onForget }, f.label)) }) })
|
|
1780
1634
|
] });
|
|
1781
1635
|
}
|
|
1782
1636
|
function PresenceBriefBody({ facts }) {
|
|
1783
1637
|
const { forget } = useForgetFact2();
|
|
1784
1638
|
const { brief } = useLabels().presence;
|
|
1785
|
-
const { recalled, inferred } =
|
|
1639
|
+
const { recalled, inferred } = React13.useMemo(() => partition(facts), [facts]);
|
|
1786
1640
|
if (facts.length === 0) return null;
|
|
1787
1641
|
return /* @__PURE__ */ jsxs12("div", { className: presenceClass.brief, children: [
|
|
1788
|
-
/* @__PURE__ */
|
|
1789
|
-
/* @__PURE__ */
|
|
1790
|
-
/* @__PURE__ */
|
|
1642
|
+
/* @__PURE__ */ jsx19(BriefIdentity, {}),
|
|
1643
|
+
/* @__PURE__ */ jsx19(Group, { title: brief.recalled.title, facts: recalled, onForget: forget }),
|
|
1644
|
+
/* @__PURE__ */ jsx19(Group, { title: brief.inferred.title, facts: inferred, onForget: forget })
|
|
1791
1645
|
] });
|
|
1792
1646
|
}
|
|
1793
1647
|
function PresenceBriefDrawer() {
|
|
1794
1648
|
const elements = usePresenceElements();
|
|
1795
1649
|
const liveTurnId = usePresenceLiveTurn();
|
|
1796
|
-
const view =
|
|
1650
|
+
const view = React13.useMemo(
|
|
1797
1651
|
() => derivePresenceView(elements, liveTurnId),
|
|
1798
1652
|
[elements, liveTurnId]
|
|
1799
1653
|
);
|
|
1800
1654
|
const visible = useUndismissedFacts(view.facts);
|
|
1801
1655
|
if (visible.length === 0) return null;
|
|
1802
|
-
return /* @__PURE__ */
|
|
1656
|
+
return /* @__PURE__ */ jsx19(
|
|
1803
1657
|
motion.div,
|
|
1804
1658
|
{
|
|
1805
1659
|
className: presenceClass.briefPanel,
|
|
1806
1660
|
initial: { opacity: 0 },
|
|
1807
1661
|
animate: { opacity: 1 },
|
|
1808
1662
|
transition: { duration: 0.24, ease: SETTLE2 },
|
|
1809
|
-
children: /* @__PURE__ */
|
|
1663
|
+
children: /* @__PURE__ */ jsx19(PresenceBriefBody, { facts: visible })
|
|
1810
1664
|
}
|
|
1811
1665
|
);
|
|
1812
1666
|
}
|
|
1813
1667
|
|
|
1814
1668
|
// src/agent/presence/use-measured-height.ts
|
|
1815
|
-
import * as
|
|
1669
|
+
import * as React14 from "react";
|
|
1816
1670
|
function useMeasuredHeight() {
|
|
1817
|
-
const ref =
|
|
1818
|
-
const [height, setHeight] =
|
|
1819
|
-
|
|
1671
|
+
const ref = React14.useRef(null);
|
|
1672
|
+
const [height, setHeight] = React14.useState(0);
|
|
1673
|
+
React14.useLayoutEffect(() => {
|
|
1820
1674
|
const el = ref.current;
|
|
1821
1675
|
if (el === null) return;
|
|
1822
1676
|
if (typeof ResizeObserver === "undefined") {
|
|
@@ -1836,7 +1690,7 @@ function useMeasuredHeight() {
|
|
|
1836
1690
|
|
|
1837
1691
|
// src/agent/presence/reads.tsx
|
|
1838
1692
|
import { useForgetFact as useForgetFact3 } from "@40rty/ams-sdk";
|
|
1839
|
-
import { jsx as
|
|
1693
|
+
import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1840
1694
|
function Thought({
|
|
1841
1695
|
text,
|
|
1842
1696
|
eyebrow,
|
|
@@ -1844,9 +1698,9 @@ function Thought({
|
|
|
1844
1698
|
}) {
|
|
1845
1699
|
const hasEyebrow = eyebrow.length > 0;
|
|
1846
1700
|
return /* @__PURE__ */ jsxs13("div", { className: presenceClass.row, "data-compact": compact ? "true" : void 0, children: [
|
|
1847
|
-
hasEyebrow && /* @__PURE__ */
|
|
1848
|
-
hasEyebrow && !compact && /* @__PURE__ */
|
|
1849
|
-
/* @__PURE__ */
|
|
1701
|
+
hasEyebrow && /* @__PURE__ */ jsx20(Eyebrow, { children: eyebrow }),
|
|
1702
|
+
hasEyebrow && !compact && /* @__PURE__ */ jsx20(Rule, {}),
|
|
1703
|
+
/* @__PURE__ */ jsx20("span", { className: presenceClass.prose, children: text })
|
|
1850
1704
|
] });
|
|
1851
1705
|
}
|
|
1852
1706
|
function Dossier({ text, facts, eyebrow }) {
|
|
@@ -1854,30 +1708,30 @@ function Dossier({ text, facts, eyebrow }) {
|
|
|
1854
1708
|
const { forget } = useForgetFact3();
|
|
1855
1709
|
const shown = facts;
|
|
1856
1710
|
return /* @__PURE__ */ jsxs13("div", { className: presenceClass.dossier, children: [
|
|
1857
|
-
hasEyebrow && /* @__PURE__ */
|
|
1858
|
-
/* @__PURE__ */
|
|
1711
|
+
hasEyebrow && /* @__PURE__ */ jsx20("div", { className: presenceClass.kicker, children: /* @__PURE__ */ jsx20(Eyebrow, { children: eyebrow }) }),
|
|
1712
|
+
/* @__PURE__ */ jsx20("span", { className: presenceClass.prose, children: text }),
|
|
1859
1713
|
shown.length > 0 && // ONE flat list — no group headers, no taxonomy. The long/short-term
|
|
1860
1714
|
// distinction is carried by the entries' MATERIAL (a durable fact's
|
|
1861
1715
|
// value is set: full weight, anchored hairline; a this-visit note is
|
|
1862
1716
|
// provisional: same shape, lighter register) and by ORDER (durable
|
|
1863
1717
|
// first). The surface never explains itself with labels.
|
|
1864
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ jsx20("div", { className: presenceClass.facts, children: /* @__PURE__ */ jsx20(AnimatePresence, { initial: false, children: sortFactsByTier(shown).map((f) => /* @__PURE__ */ jsx20(FactChip, { fact: f, onForget: forget }, f.label)) }) })
|
|
1865
1719
|
] });
|
|
1866
1720
|
}
|
|
1867
1721
|
|
|
1868
1722
|
// src/agent/presence/forms.tsx
|
|
1869
1723
|
import { registerPresenceForm } from "@40rty/ams-sdk";
|
|
1870
|
-
import { jsx as
|
|
1724
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1871
1725
|
function DossierForm({ frame, expanded }) {
|
|
1872
1726
|
const text = typeof frame.text === "string" ? frame.text : "";
|
|
1873
1727
|
const facts = useVisibleFacts(frame);
|
|
1874
1728
|
const label = readLabel(frame);
|
|
1875
|
-
return expanded ? /* @__PURE__ */
|
|
1729
|
+
return expanded ? /* @__PURE__ */ jsx21(Dossier, { text, facts, eyebrow: label }) : /* @__PURE__ */ jsx21(FoldedRead, { label, facts, text });
|
|
1876
1730
|
}
|
|
1877
1731
|
function ThoughtForm({ frame, expanded }) {
|
|
1878
1732
|
const text = typeof frame.text === "string" ? frame.text : "";
|
|
1879
1733
|
const label = readLabel(frame);
|
|
1880
|
-
return expanded ? /* @__PURE__ */
|
|
1734
|
+
return expanded ? /* @__PURE__ */ jsx21(Thought, { text, eyebrow: label }) : /* @__PURE__ */ jsx21(FoldedRead, { label, facts: [], text });
|
|
1881
1735
|
}
|
|
1882
1736
|
var registered2 = false;
|
|
1883
1737
|
function registerDefaultPresenceForms() {
|
|
@@ -1889,7 +1743,7 @@ function registerDefaultPresenceForms() {
|
|
|
1889
1743
|
registerDefaultPresenceForms();
|
|
1890
1744
|
|
|
1891
1745
|
// src/agent/presence/AgentPresenceWidget.tsx
|
|
1892
|
-
import * as
|
|
1746
|
+
import * as React19 from "react";
|
|
1893
1747
|
import {
|
|
1894
1748
|
usePresenceMaterialized,
|
|
1895
1749
|
useFourtySession as useFourtySession2
|
|
@@ -1897,7 +1751,7 @@ import {
|
|
|
1897
1751
|
import { useFormFactor as useFormFactor2 } from "@40rty/ams-sdk";
|
|
1898
1752
|
|
|
1899
1753
|
// src/agent/presence/band-beat.ts
|
|
1900
|
-
import * as
|
|
1754
|
+
import * as React15 from "react";
|
|
1901
1755
|
var BAND_BEAT_MS = 260;
|
|
1902
1756
|
var BAND_REGION_STAGGER_S = 0.06;
|
|
1903
1757
|
var BAND_REGION_ORDER = {
|
|
@@ -1910,11 +1764,11 @@ function bandRegionDelay(region) {
|
|
|
1910
1764
|
}
|
|
1911
1765
|
var BAND_SETTLE = [0.22, 1, 0.36, 1];
|
|
1912
1766
|
function useBandBeat(value, signature) {
|
|
1913
|
-
const [drawn, setDrawn] =
|
|
1914
|
-
const latest =
|
|
1767
|
+
const [drawn, setDrawn] = React15.useState(value);
|
|
1768
|
+
const latest = React15.useRef(value);
|
|
1915
1769
|
latest.current = value;
|
|
1916
|
-
const composedAt =
|
|
1917
|
-
|
|
1770
|
+
const composedAt = React15.useRef(Number.NEGATIVE_INFINITY);
|
|
1771
|
+
React15.useEffect(() => {
|
|
1918
1772
|
const since = performance.now() - composedAt.current;
|
|
1919
1773
|
if (since >= BAND_BEAT_MS) {
|
|
1920
1774
|
composedAt.current = performance.now();
|
|
@@ -1931,7 +1785,7 @@ function useBandBeat(value, signature) {
|
|
|
1931
1785
|
}
|
|
1932
1786
|
|
|
1933
1787
|
// src/agent/presence/fact-slots.ts
|
|
1934
|
-
import * as
|
|
1788
|
+
import * as React16 from "react";
|
|
1935
1789
|
import { useDismissedLabels } from "@40rty/ams-sdk";
|
|
1936
1790
|
function emptySlotRegistry(limit) {
|
|
1937
1791
|
return { slots: new Array(limit).fill(void 0), clock: 0 };
|
|
@@ -2013,8 +1867,8 @@ function assignSlots(registry, facts, dismissed) {
|
|
|
2013
1867
|
}
|
|
2014
1868
|
function useFactSlots(facts) {
|
|
2015
1869
|
const dismissed = useDismissedLabels();
|
|
2016
|
-
const registry =
|
|
2017
|
-
return
|
|
1870
|
+
const registry = React16.useRef(emptySlotRegistry(PRESENCE_FACT_LIMIT));
|
|
1871
|
+
return React16.useMemo(() => {
|
|
2018
1872
|
const next = assignSlots(registry.current, facts, dismissed);
|
|
2019
1873
|
registry.current = next.registry;
|
|
2020
1874
|
return next.slotted;
|
|
@@ -2022,8 +1876,8 @@ function useFactSlots(facts) {
|
|
|
2022
1876
|
}
|
|
2023
1877
|
function useRetainedFacts(facts) {
|
|
2024
1878
|
const dismissed = useDismissedLabels();
|
|
2025
|
-
const held =
|
|
2026
|
-
return
|
|
1879
|
+
const held = React16.useRef([]);
|
|
1880
|
+
return React16.useMemo(() => {
|
|
2027
1881
|
const present = new Map(facts.map((f) => [f.label, f]));
|
|
2028
1882
|
const known = new Set(held.current.map((f) => f.label));
|
|
2029
1883
|
const asserts = facts.some((f) => !known.has(f.label));
|
|
@@ -2043,8 +1897,8 @@ function useRetainedFacts(facts) {
|
|
|
2043
1897
|
}, [facts]);
|
|
2044
1898
|
}
|
|
2045
1899
|
function useHeldSlotCount(slots, holdMs) {
|
|
2046
|
-
const [held, setHeld] =
|
|
2047
|
-
|
|
1900
|
+
const [held, setHeld] = React16.useState(slots);
|
|
1901
|
+
React16.useEffect(() => {
|
|
2048
1902
|
if (slots >= held) {
|
|
2049
1903
|
setHeld(slots);
|
|
2050
1904
|
return;
|
|
@@ -2056,12 +1910,12 @@ function useHeldSlotCount(slots, holdMs) {
|
|
|
2056
1910
|
}
|
|
2057
1911
|
|
|
2058
1912
|
// src/agent/presence/CriteriaRail.tsx
|
|
2059
|
-
import * as
|
|
2060
|
-
import { Fragment as Fragment4, jsx as
|
|
1913
|
+
import * as React17 from "react";
|
|
1914
|
+
import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2061
1915
|
var CRITERION_EXIT_S = 0.16;
|
|
2062
1916
|
var CRITERION_ENTER_DELAY_S = 0.08;
|
|
2063
|
-
var Criterion =
|
|
2064
|
-
const attach =
|
|
1917
|
+
var Criterion = React17.forwardRef(function Criterion2({ fact, slot, onOpenBrief }, ref) {
|
|
1918
|
+
const attach = React17.useCallback((el) => {
|
|
2065
1919
|
if (typeof ref === "function") {
|
|
2066
1920
|
ref(el);
|
|
2067
1921
|
return;
|
|
@@ -2069,12 +1923,12 @@ var Criterion = React18.forwardRef(function Criterion2({ fact, slot, onOpenBrief
|
|
|
2069
1923
|
if (ref !== null) ref.current = el;
|
|
2070
1924
|
}, [ref]);
|
|
2071
1925
|
const content = /* @__PURE__ */ jsxs14(Fragment4, { children: [
|
|
2072
|
-
/* @__PURE__ */
|
|
1926
|
+
/* @__PURE__ */ jsx22("span", { className: presenceClass.factLabel, style: { lineHeight: `${CRITERION_LABEL_LINE}px` }, children: fact.label }),
|
|
2073
1927
|
/* @__PURE__ */ jsxs14("span", { className: presenceClass.factValue, style: { lineHeight: `${CRITERION_VALUE_LINE}px` }, children: [
|
|
2074
1928
|
colorSwatch(fact.value),
|
|
2075
1929
|
fact.value
|
|
2076
1930
|
] }),
|
|
2077
|
-
/* @__PURE__ */
|
|
1931
|
+
/* @__PURE__ */ jsx22(
|
|
2078
1932
|
motion.span,
|
|
2079
1933
|
{
|
|
2080
1934
|
"aria-hidden": true,
|
|
@@ -2125,9 +1979,9 @@ var Criterion = React18.forwardRef(function Criterion2({ fact, slot, onOpenBrief
|
|
|
2125
1979
|
}
|
|
2126
1980
|
};
|
|
2127
1981
|
if (onOpenBrief === void 0) {
|
|
2128
|
-
return /* @__PURE__ */
|
|
1982
|
+
return /* @__PURE__ */ jsx22(motion.span, { ref: attach, ...common, children: content });
|
|
2129
1983
|
}
|
|
2130
|
-
return /* @__PURE__ */
|
|
1984
|
+
return /* @__PURE__ */ jsx22(
|
|
2131
1985
|
motion.button,
|
|
2132
1986
|
{
|
|
2133
1987
|
type: "button",
|
|
@@ -2185,7 +2039,7 @@ function CriteriaRail({
|
|
|
2185
2039
|
columnGap: CRITERION_GAP
|
|
2186
2040
|
},
|
|
2187
2041
|
children: [
|
|
2188
|
-
/* @__PURE__ */
|
|
2042
|
+
/* @__PURE__ */ jsx22(AnimatePresence, { initial: false, children: facts.map(({ fact, slot }) => /* @__PURE__ */ jsx22(
|
|
2189
2043
|
Criterion,
|
|
2190
2044
|
{
|
|
2191
2045
|
fact,
|
|
@@ -2194,13 +2048,13 @@ function CriteriaRail({
|
|
|
2194
2048
|
},
|
|
2195
2049
|
factIdentity(fact)
|
|
2196
2050
|
)) }),
|
|
2197
|
-
lanes.tail && /* @__PURE__ */
|
|
2198
|
-
brief !== void 0 && /* @__PURE__ */
|
|
2051
|
+
lanes.tail && /* @__PURE__ */ jsx22(MoreTail, { count: hidden, onOpenBrief, lane: railTailLane(slots) }),
|
|
2052
|
+
brief !== void 0 && /* @__PURE__ */ jsx22(
|
|
2199
2053
|
"span",
|
|
2200
2054
|
{
|
|
2201
2055
|
className: presenceClass.railHandle,
|
|
2202
2056
|
style: { gridColumn: railHandleLane(slots, lanes), gridRow: 1 },
|
|
2203
|
-
children: /* @__PURE__ */
|
|
2057
|
+
children: /* @__PURE__ */ jsx22(BriefHandle, { open: brief.open, onToggle: brief.toggle })
|
|
2204
2058
|
}
|
|
2205
2059
|
)
|
|
2206
2060
|
]
|
|
@@ -2209,8 +2063,8 @@ function CriteriaRail({
|
|
|
2209
2063
|
}
|
|
2210
2064
|
|
|
2211
2065
|
// src/agent/presence/VoiceLine.tsx
|
|
2212
|
-
import * as
|
|
2213
|
-
import { jsx as
|
|
2066
|
+
import * as React18 from "react";
|
|
2067
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
2214
2068
|
var WORD_FADE_S = 0.14;
|
|
2215
2069
|
var WORD_STAGGER_S = 0.014;
|
|
2216
2070
|
var SWEEP_MAX_S = 0.26;
|
|
@@ -2227,14 +2081,14 @@ function partsWithWordIndex(text) {
|
|
|
2227
2081
|
}
|
|
2228
2082
|
function VoiceLine({ text, className, style, delay = 0 }) {
|
|
2229
2083
|
const reduce = useReducedMotion();
|
|
2230
|
-
const parts =
|
|
2084
|
+
const parts = React18.useMemo(() => partsWithWordIndex(text), [text]);
|
|
2231
2085
|
const words = parts.length === 0 ? 0 : parts[parts.length - 1].word + 1;
|
|
2232
2086
|
const step = words <= 1 ? 0 : Math.min(WORD_STAGGER_S, SWEEP_MAX_S / words);
|
|
2233
|
-
if (reduce === true) return /* @__PURE__ */
|
|
2087
|
+
if (reduce === true) return /* @__PURE__ */ jsx23("span", { className, style, children: text });
|
|
2234
2088
|
return (
|
|
2235
2089
|
// Keyed by the sentence: a NEW read is a new arrival, so the stagger runs
|
|
2236
2090
|
// again from the left rather than the changed words popping in place.
|
|
2237
|
-
/* @__PURE__ */
|
|
2091
|
+
/* @__PURE__ */ jsx23("span", { className, style, children: parts.map(({ part, word }, i) => /* @__PURE__ */ jsx23(
|
|
2238
2092
|
motion.span,
|
|
2239
2093
|
{
|
|
2240
2094
|
initial: { opacity: 0 },
|
|
@@ -2248,7 +2102,7 @@ function VoiceLine({ text, className, style, delay = 0 }) {
|
|
|
2248
2102
|
}
|
|
2249
2103
|
|
|
2250
2104
|
// src/agent/presence/StreamRead.tsx
|
|
2251
|
-
import { jsx as
|
|
2105
|
+
import { jsx as jsx24, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2252
2106
|
var DECK_SIZE = "compact";
|
|
2253
2107
|
function compositionSignature(view) {
|
|
2254
2108
|
const facts = view.facts.map((f) => `${f.label}=${f.value}`).join("|");
|
|
@@ -2286,14 +2140,14 @@ function PresenceStream({
|
|
|
2286
2140
|
tail: more > 0,
|
|
2287
2141
|
handle: brief !== void 0
|
|
2288
2142
|
});
|
|
2289
|
-
return /* @__PURE__ */
|
|
2143
|
+
return /* @__PURE__ */ jsx24("div", { className: presenceClass.stream, children: hasRow && /* @__PURE__ */ jsxs15(
|
|
2290
2144
|
"div",
|
|
2291
2145
|
{
|
|
2292
2146
|
className: presenceClass.row,
|
|
2293
2147
|
"data-tracks": "band",
|
|
2294
2148
|
style: { gridTemplateColumns: bandRowTemplate(railWidth, deckWidth), height: BAND_HEIGHT },
|
|
2295
2149
|
children: [
|
|
2296
|
-
/* @__PURE__ */
|
|
2150
|
+
/* @__PURE__ */ jsx24(
|
|
2297
2151
|
CriteriaRail,
|
|
2298
2152
|
{
|
|
2299
2153
|
facts: rowFacts,
|
|
@@ -2303,7 +2157,7 @@ function PresenceStream({
|
|
|
2303
2157
|
onOpenBrief
|
|
2304
2158
|
}
|
|
2305
2159
|
),
|
|
2306
|
-
/* @__PURE__ */
|
|
2160
|
+
/* @__PURE__ */ jsx24(
|
|
2307
2161
|
VoiceLine,
|
|
2308
2162
|
{
|
|
2309
2163
|
className: presenceClass.voiceLine,
|
|
@@ -2313,8 +2167,8 @@ function PresenceStream({
|
|
|
2313
2167
|
}
|
|
2314
2168
|
),
|
|
2315
2169
|
/* @__PURE__ */ jsxs15("div", { className: presenceClass.deck, style: { width: deckWidth }, children: [
|
|
2316
|
-
rowFacts.length > 0 && hasDeck && /* @__PURE__ */
|
|
2317
|
-
/* @__PURE__ */
|
|
2170
|
+
rowFacts.length > 0 && hasDeck && /* @__PURE__ */ jsx24("span", { "aria-hidden": true, className: presenceClass.gate }),
|
|
2171
|
+
/* @__PURE__ */ jsx24(
|
|
2318
2172
|
SourceSift,
|
|
2319
2173
|
{
|
|
2320
2174
|
sources: composed.sources,
|
|
@@ -2334,13 +2188,13 @@ function streamLeadLine(view) {
|
|
|
2334
2188
|
}
|
|
2335
2189
|
|
|
2336
2190
|
// src/agent/presence/PresenceFiller.tsx
|
|
2337
|
-
import { jsx as
|
|
2191
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2338
2192
|
function PresenceFiller() {
|
|
2339
|
-
return /* @__PURE__ */
|
|
2193
|
+
return /* @__PURE__ */ jsx25("span", { className: presenceClass.filler, "aria-hidden": "true" });
|
|
2340
2194
|
}
|
|
2341
2195
|
|
|
2342
2196
|
// src/agent/presence/AgentPresenceWidget.tsx
|
|
2343
|
-
import { jsx as
|
|
2197
|
+
import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2344
2198
|
var SETTLE3 = [0.22, 1, 0.36, 1];
|
|
2345
2199
|
function AgentPresenceWidget({
|
|
2346
2200
|
expanded,
|
|
@@ -2357,9 +2211,9 @@ function AgentPresenceWidget({
|
|
|
2357
2211
|
const { isMobile } = useFormFactor2();
|
|
2358
2212
|
const [measureRef, height] = useMeasuredHeight();
|
|
2359
2213
|
const measured = !staticBand && height > 0;
|
|
2360
|
-
const firstMeasure =
|
|
2214
|
+
const firstMeasure = React19.useRef(true);
|
|
2361
2215
|
const snap = firstMeasure.current && measured;
|
|
2362
|
-
|
|
2216
|
+
React19.useEffect(() => {
|
|
2363
2217
|
if (measured) firstMeasure.current = false;
|
|
2364
2218
|
}, [measured]);
|
|
2365
2219
|
const { view: liveView, all: facts } = useBandFacts();
|
|
@@ -2372,7 +2226,7 @@ function AgentPresenceWidget({
|
|
|
2372
2226
|
if (isMobile) {
|
|
2373
2227
|
let node2 = null;
|
|
2374
2228
|
if (!viewIsEmpty(view)) {
|
|
2375
|
-
node2 = expanded && hasHeld ? /* @__PURE__ */
|
|
2229
|
+
node2 = expanded && hasHeld ? /* @__PURE__ */ jsx26(PresenceBriefBody, { facts }) : /* @__PURE__ */ jsx26(
|
|
2376
2230
|
CompactStream,
|
|
2377
2231
|
{
|
|
2378
2232
|
lead: hasHeld ? streamLeadLine(view) : "",
|
|
@@ -2385,17 +2239,17 @@ function AgentPresenceWidget({
|
|
|
2385
2239
|
);
|
|
2386
2240
|
} else if (!working) {
|
|
2387
2241
|
if (idleContent !== void 0) node2 = idleContent;
|
|
2388
|
-
else if (!suppressIdleFallback) node2 = /* @__PURE__ */
|
|
2242
|
+
else if (!suppressIdleFallback) node2 = /* @__PURE__ */ jsx26(Fallback, {});
|
|
2389
2243
|
}
|
|
2390
2244
|
return /* @__PURE__ */ jsxs16("div", { className: presenceClass.root, "data-compact": "true", "data-working": working ? "true" : "false", children: [
|
|
2391
|
-
working && /* @__PURE__ */
|
|
2392
|
-
/* @__PURE__ */
|
|
2245
|
+
working && /* @__PURE__ */ jsx26(PresenceFiller, {}),
|
|
2246
|
+
/* @__PURE__ */ jsx26("div", { className: presenceClass.measure, children: /* @__PURE__ */ jsx26(AnimatePresence, { mode: "popLayout", initial: false, children: node2 !== null && /* @__PURE__ */ jsx26(motion.div, { className: presenceClass.frame, ...enter, children: node2 }, viewIsEmpty(view) ? "idle" : "stream") }) })
|
|
2393
2247
|
] });
|
|
2394
2248
|
}
|
|
2395
2249
|
let node = null;
|
|
2396
2250
|
let key = "idle";
|
|
2397
2251
|
if (!viewIsEmpty(view)) {
|
|
2398
|
-
node = /* @__PURE__ */
|
|
2252
|
+
node = /* @__PURE__ */ jsx26(
|
|
2399
2253
|
PresenceStream,
|
|
2400
2254
|
{
|
|
2401
2255
|
view,
|
|
@@ -2413,7 +2267,7 @@ function AgentPresenceWidget({
|
|
|
2413
2267
|
} else if (idleContent !== void 0) {
|
|
2414
2268
|
node = idleContent;
|
|
2415
2269
|
} else if (!suppressIdleFallback) {
|
|
2416
|
-
node = /* @__PURE__ */
|
|
2270
|
+
node = /* @__PURE__ */ jsx26(Fallback, {});
|
|
2417
2271
|
}
|
|
2418
2272
|
const bandHeight = BAND_HEIGHT;
|
|
2419
2273
|
return /* @__PURE__ */ jsxs16(
|
|
@@ -2426,20 +2280,20 @@ function AgentPresenceWidget({
|
|
|
2426
2280
|
animate: staticBand ? void 0 : { height: bandHeight },
|
|
2427
2281
|
transition: snap ? { duration: 0 } : { duration: 0.7, ease: SETTLE3 },
|
|
2428
2282
|
children: [
|
|
2429
|
-
working && /* @__PURE__ */
|
|
2430
|
-
/* @__PURE__ */
|
|
2283
|
+
working && /* @__PURE__ */ jsx26(PresenceFiller, {}),
|
|
2284
|
+
/* @__PURE__ */ jsx26("div", { ref: staticBand ? void 0 : measureRef, className: presenceClass.measure, children: /* @__PURE__ */ jsx26(AnimatePresence, { mode: "popLayout", initial: false, children: node !== null && /* @__PURE__ */ jsx26(motion.div, { className: presenceClass.frame, ...enter, children: node }, key) }) })
|
|
2431
2285
|
]
|
|
2432
2286
|
}
|
|
2433
2287
|
);
|
|
2434
2288
|
}
|
|
2435
2289
|
|
|
2436
2290
|
// src/agent/presence/DefaultNotch.tsx
|
|
2437
|
-
import { jsx as
|
|
2291
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
2438
2292
|
var DEFAULT_NOTCH_WIDGETS = [
|
|
2439
2293
|
{ id: "read", zone: "lead", Component: AgentPresenceWidget }
|
|
2440
2294
|
];
|
|
2441
2295
|
function DefaultNotch() {
|
|
2442
|
-
return /* @__PURE__ */
|
|
2296
|
+
return /* @__PURE__ */ jsx27(PresenceNotch, { widgets: DEFAULT_NOTCH_WIDGETS });
|
|
2443
2297
|
}
|
|
2444
2298
|
|
|
2445
2299
|
// src/agent/presence/fact-forms/class-names.ts
|
|
@@ -2460,21 +2314,21 @@ var factFormClass = {
|
|
|
2460
2314
|
|
|
2461
2315
|
// src/agent/presence/fact-forms/baseline-forms.tsx
|
|
2462
2316
|
import { colorHexOf as colorHexOf2, factFigureParts } from "@40rty/ams-sdk";
|
|
2463
|
-
import { jsx as
|
|
2317
|
+
import { jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2464
2318
|
function BaselineColorFactForm({ fact }) {
|
|
2465
2319
|
const hex = colorHexOf2(fact.value);
|
|
2466
2320
|
return /* @__PURE__ */ jsxs17("span", { className: factFormClass.color, children: [
|
|
2467
|
-
hex !== null && /* @__PURE__ */
|
|
2468
|
-
/* @__PURE__ */
|
|
2321
|
+
hex !== null && /* @__PURE__ */ jsx28("span", { "aria-hidden": true, className: factFormClass.colorChip, style: { background: hex } }),
|
|
2322
|
+
/* @__PURE__ */ jsx28("span", { className: factFormClass.colorName, children: fact.value })
|
|
2469
2323
|
] });
|
|
2470
2324
|
}
|
|
2471
2325
|
function BaselineFigureFactForm({ fact }) {
|
|
2472
2326
|
const parts = factFigureParts(fact);
|
|
2473
|
-
if (parts === null) return /* @__PURE__ */
|
|
2327
|
+
if (parts === null) return /* @__PURE__ */ jsx28("span", { className: factFormClass.figure, children: fact.value.trim() });
|
|
2474
2328
|
return /* @__PURE__ */ jsxs17("span", { className: factFormClass.figure, children: [
|
|
2475
|
-
parts.before.length > 0 && /* @__PURE__ */
|
|
2476
|
-
/* @__PURE__ */
|
|
2477
|
-
parts.after.length > 0 && /* @__PURE__ */
|
|
2329
|
+
parts.before.length > 0 && /* @__PURE__ */ jsx28("span", { className: factFormClass.figureQualifier, children: parts.before }),
|
|
2330
|
+
/* @__PURE__ */ jsx28("span", { className: factFormClass.figureAmount, children: parts.figure }),
|
|
2331
|
+
parts.after.length > 0 && /* @__PURE__ */ jsx28("span", { className: factFormClass.figureQualifier, children: parts.after })
|
|
2478
2332
|
] });
|
|
2479
2333
|
}
|
|
2480
2334
|
|
|
@@ -2487,9 +2341,9 @@ function registerBaselineFactForms() {
|
|
|
2487
2341
|
}
|
|
2488
2342
|
|
|
2489
2343
|
// src/agent/presence/LayoutMorphSkeleton.tsx
|
|
2490
|
-
import * as
|
|
2344
|
+
import * as React20 from "react";
|
|
2491
2345
|
import { useDocumentVisible, useInterval } from "@40rty/ams-sdk";
|
|
2492
|
-
import { jsx as
|
|
2346
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
2493
2347
|
var LAYOUT_ARCHETYPES = [
|
|
2494
2348
|
{ rects: [{ l: 0, t: 0, w: 100, h: 100 }] },
|
|
2495
2349
|
{
|
|
@@ -2537,7 +2391,7 @@ function useLayoutMorph(active) {
|
|
|
2537
2391
|
const reduce = useReducedMotion();
|
|
2538
2392
|
const visible = useDocumentVisible();
|
|
2539
2393
|
const phrases = useLabels().presence.composing;
|
|
2540
|
-
const [index, setIndex] =
|
|
2394
|
+
const [index, setIndex] = React20.useState(0);
|
|
2541
2395
|
const advancing = active && visible && reduce !== true;
|
|
2542
2396
|
useInterval(() => setIndex((x) => (x + 1) % LAYOUT_ARCHETYPES.length), MORPH_MS, advancing);
|
|
2543
2397
|
const archetype = LAYOUT_ARCHETYPES[index];
|
|
@@ -2545,15 +2399,15 @@ function useLayoutMorph(active) {
|
|
|
2545
2399
|
return { index, label, rects: archetype.rects };
|
|
2546
2400
|
}
|
|
2547
2401
|
function LayoutMorphSkeleton({ rects }) {
|
|
2548
|
-
return /* @__PURE__ */
|
|
2402
|
+
return /* @__PURE__ */ jsx29("div", { className: presenceClass.layoutMorph, "aria-hidden": true, children: Array.from({ length: TILE_SLOTS }, (_, i) => {
|
|
2549
2403
|
const on = i < rects.length;
|
|
2550
2404
|
const rect = on ? rects[i] : COLLAPSED;
|
|
2551
|
-
return /* @__PURE__ */
|
|
2405
|
+
return /* @__PURE__ */ jsx29(
|
|
2552
2406
|
"div",
|
|
2553
2407
|
{
|
|
2554
2408
|
className: presenceClass.layoutMorphTile,
|
|
2555
2409
|
style: {
|
|
2556
|
-
|
|
2410
|
+
insetInlineStart: `${rect.l}%`,
|
|
2557
2411
|
top: `${rect.t}%`,
|
|
2558
2412
|
width: `${rect.w}%`,
|
|
2559
2413
|
height: `${rect.h}%`,
|
|
@@ -2567,7 +2421,7 @@ function LayoutMorphSkeleton({ rects }) {
|
|
|
2567
2421
|
|
|
2568
2422
|
// src/agent/presence/InlinePresenceRead.tsx
|
|
2569
2423
|
import { useAgentPresence, useAgentPresenceFresh } from "@40rty/ams-sdk";
|
|
2570
|
-
import { jsx as
|
|
2424
|
+
import { jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2571
2425
|
function InlinePresenceRead({
|
|
2572
2426
|
flowId,
|
|
2573
2427
|
compact = false
|
|
@@ -2579,8 +2433,8 @@ function InlinePresenceRead({
|
|
|
2579
2433
|
const morph = useLayoutMorph(true);
|
|
2580
2434
|
const statusText = readText.length > 0 ? readText : morph.label;
|
|
2581
2435
|
return /* @__PURE__ */ jsxs18("div", { className: presenceClass.loaderColumn, children: [
|
|
2582
|
-
/* @__PURE__ */
|
|
2583
|
-
/* @__PURE__ */
|
|
2436
|
+
/* @__PURE__ */ jsx30(LayoutMorphSkeleton, { rects: morph.rects }),
|
|
2437
|
+
/* @__PURE__ */ jsx30("div", { className: presenceClass.status, "aria-live": "polite", children: /* @__PURE__ */ jsx30(AnimatePresence, { mode: "wait", initial: false, children: /* @__PURE__ */ jsx30(motion.span, { className: presenceClass.prose, ...enter, children: statusText }, statusText) }) })
|
|
2584
2438
|
] });
|
|
2585
2439
|
}
|
|
2586
2440
|
|
|
@@ -2588,26 +2442,23 @@ function InlinePresenceRead({
|
|
|
2588
2442
|
import { useForgetFact as useForgetFact4, useVisibleFactList } from "@40rty/ams-sdk";
|
|
2589
2443
|
|
|
2590
2444
|
// src/agent/presence/KnowledgePeek.tsx
|
|
2591
|
-
import * as
|
|
2445
|
+
import * as React21 from "react";
|
|
2592
2446
|
import { usePresenceElements as usePresenceElements2, usePresenceLiveTurn as usePresenceLiveTurn2 } from "@40rty/ams-sdk";
|
|
2593
2447
|
import { useUndismissedFacts as useUndismissedFacts2 } from "@40rty/ams-sdk";
|
|
2594
|
-
import { jsx as
|
|
2448
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
2595
2449
|
function PresenceBriefRail() {
|
|
2596
2450
|
const elements = usePresenceElements2();
|
|
2597
2451
|
const liveTurnId = usePresenceLiveTurn2();
|
|
2598
|
-
const view =
|
|
2452
|
+
const view = React21.useMemo(
|
|
2599
2453
|
() => derivePresenceView(elements, liveTurnId),
|
|
2600
2454
|
[elements, liveTurnId]
|
|
2601
2455
|
);
|
|
2602
2456
|
const facts = useRetainedFacts(useUndismissedFacts2(view.facts));
|
|
2603
2457
|
if (facts.length === 0) return null;
|
|
2604
|
-
return /* @__PURE__ */
|
|
2458
|
+
return /* @__PURE__ */ jsx31(FactChips, { facts });
|
|
2605
2459
|
}
|
|
2606
2460
|
|
|
2607
2461
|
export {
|
|
2608
|
-
DEFAULT_LABELS,
|
|
2609
|
-
LabelsProvider,
|
|
2610
|
-
useLabels,
|
|
2611
2462
|
PresenceNotch,
|
|
2612
2463
|
presenceClass,
|
|
2613
2464
|
Eyebrow,
|
|
@@ -2621,6 +2472,7 @@ export {
|
|
|
2621
2472
|
sourceCardBox,
|
|
2622
2473
|
platePad,
|
|
2623
2474
|
ruleWeight,
|
|
2475
|
+
mirrorX,
|
|
2624
2476
|
SourceCardFrame,
|
|
2625
2477
|
SourcePlate,
|
|
2626
2478
|
SourceImage,
|