@40rty/ams-ui 0.5.11 → 0.5.13

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.
@@ -1295,7 +1295,7 @@ function Composer({
1295
1295
  onPaste,
1296
1296
  canSend,
1297
1297
  submit
1298
- } = usePromptComposer({ attachments: attachmentsController });
1298
+ } = usePromptComposer({ attachments: attachmentsController, origin: taRef });
1299
1299
  const [ghostPx, setGhostPx] = React9.useState(0);
1300
1300
  const fieldPx = useFieldAutosize(taRef, value, ghostPx);
1301
1301
  const expanded = isFieldExpanded(fieldPx);
@@ -2581,9 +2581,9 @@ function IslandInputBar({
2581
2581
  notchExpanded
2582
2582
  }) {
2583
2583
  const labels = useLabels();
2584
- const { value, setValue, canSend, submit, onPaste } = usePromptComposer2({ attachments });
2585
- const showStop = isStreaming && !canSend;
2586
2584
  const taRef = React17.useRef(null);
2585
+ const { value, setValue, canSend, submit, onPaste } = usePromptComposer2({ attachments, origin: taRef });
2586
+ const showStop = isStreaming && !canSend;
2587
2587
  const send = React17.useCallback(() => {
2588
2588
  submit();
2589
2589
  taRef.current?.blur();
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ComposerChipStrip,
4
4
  usePromptComposer
5
- } from "./chunk-ODII3M4H.js";
5
+ } from "./chunk-BILXJCTS.js";
6
6
  import "./chunk-IFVVYH4T.js";
7
7
  import "./chunk-I5QE47QY.js";
8
8
  import "./chunk-PYH6XCHQ.js";
@@ -46,7 +46,12 @@ function ResultSheet({ children }) {
46
46
  el.addEventListener("error", onError, true);
47
47
  return () => el.removeEventListener("error", onError, true);
48
48
  }, []);
49
- return /* @__PURE__ */ jsx("div", { ref, className: answering ? "fourty-convo-sheet min-h-[calc(100svh_-_16px)] overflow-hidden rounded-[var(--fourty-convo-sheet-radius)] bg-[var(--fourty-convo-sheet)] text-[var(--fourty-convo-ink)]" : "", children });
49
+ return (
50
+ // `overflow-clip`, not `hidden`: it rounds the sheet's corners without
51
+ // making it a scroll container, so a shell's sticky column inside it
52
+ // still holds against the page's scroller.
53
+ /* @__PURE__ */ jsx("div", { ref, className: answering ? "fourty-convo-sheet min-h-[calc(100svh_-_16px)] overflow-clip rounded-[var(--fourty-convo-sheet-radius)] bg-[var(--fourty-convo-sheet)] text-[var(--fourty-convo-ink)]" : "", children })
54
+ );
50
55
  }
51
56
 
52
57
  // src/conversation/TurnHeader.tsx
@@ -107,9 +112,9 @@ function ThinkingBand({ facts: facts2, status }) {
107
112
  animate: { opacity: 1, y: 0 },
108
113
  exit: { opacity: 0 },
109
114
  transition: { duration: 0.3, ease: EASE },
110
- className: "grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-6 py-2",
115
+ className: `grid ${facts2.length > 0 ? "grid-cols-[auto_minmax(0,1fr)_auto]" : "grid-cols-[minmax(0,1fr)_auto]"} items-center gap-6 py-2`,
111
116
  children: [
112
- facts2.length > 0 ? /* @__PURE__ */ jsx2(Facts, { facts: facts2 }) : /* @__PURE__ */ jsx2("span", {}),
117
+ facts2.length > 0 && /* @__PURE__ */ jsx2(Facts, { facts: facts2 }),
113
118
  /* @__PURE__ */ jsx2("span", { className: "relative min-w-0 text-2xl font-bold leading-7 text-[var(--fourty-convo-ink)]", "aria-live": "polite", children: /* @__PURE__ */ jsx2(AnimatePresence, { mode: "popLayout", initial: false, children: /* @__PURE__ */ jsxs(
114
119
  motion.span,
115
120
  {
@@ -236,8 +241,24 @@ function Rich({ text, products }) {
236
241
  }
237
242
  var WORD_EASE = [0.2, 0.75, 0.2, 1];
238
243
  var WORD_STAGGER_S = 0.05;
244
+ var MAX_BACKLOG_S = 1.2;
245
+ var cascadeEndS = 0;
246
+ var WORD_RISE_S = 0.54;
247
+ function wordsSettleInMs() {
248
+ return Math.max(0, (cascadeEndS + WORD_RISE_S) * 1e3 - performance.now());
249
+ }
250
+ function planCascade(count) {
251
+ const atS = performance.now() / 1e3;
252
+ const offsetS = Math.max(cascadeEndS - atS, 0);
253
+ const room = Math.max(MAX_BACKLOG_S - offsetS, 0);
254
+ const staggerS = count > 0 ? Math.min(WORD_STAGGER_S, room / count) : WORD_STAGGER_S;
255
+ return { offsetS, staggerS, atS };
256
+ }
257
+ function commitCascade(plan, count) {
258
+ cascadeEndS = Math.max(cascadeEndS, plan.atS + plan.offsetS + Math.max(count - 1, 0) * plan.staggerS);
259
+ }
239
260
  function RisingWords({ text, products, delayS = 0 }) {
240
- const shownRef = React3.useRef(0);
261
+ const shownRef = React3.useRef(/* @__PURE__ */ new Set());
241
262
  const reduce = useReducedMotion();
242
263
  const words = [];
243
264
  let gap = false;
@@ -250,23 +271,34 @@ function RisingWords({ text, products, delayS = 0 }) {
250
271
  }
251
272
  if (/\s$/.test(part)) gap = true;
252
273
  });
253
- const firstNew = shownRef.current;
254
- React3.useEffect(() => {
255
- shownRef.current = words.length;
274
+ const keyOf = (i) => `${String(i)}:${words[i].w}`;
275
+ const keys = words.map((_, i) => keyOf(i));
276
+ const animated = reduce !== true;
277
+ const rank = /* @__PURE__ */ new Map();
278
+ if (animated) {
279
+ for (const key of keys) if (!shownRef.current.has(key)) rank.set(key, rank.size);
280
+ }
281
+ const freshSig = [...rank.keys()].join("|");
282
+ const plan = React3.useMemo(() => planCascade(freshSig === "" ? 0 : freshSig.split("|").length), [freshSig]);
283
+ React3.useLayoutEffect(() => {
284
+ if (rank.size > 0) commitCascade(plan, rank.size);
285
+ shownRef.current = new Set(keys);
256
286
  });
257
287
  const word = (i) => {
258
288
  const { w, bold, product } = words[i];
259
- const fresh = i >= firstNew && reduce !== true;
289
+ const key = keyOf(i);
290
+ const order = rank.get(key);
291
+ const fresh = order !== void 0;
260
292
  return /* @__PURE__ */ jsx4(
261
293
  motion.span,
262
294
  {
263
295
  className: `inline-block ${bold ? "font-[var(--font-weight-strong,_700)] text-[var(--fourty-convo-ink)]" : ""} ${product !== void 0 ? "underline underline-offset-[0.12em] [color:inherit]" : ""}`,
264
296
  initial: fresh ? { opacity: 0, y: "0.5em", filter: "blur(8px)" } : false,
265
297
  animate: { opacity: 1, y: 0, filter: "blur(0px)" },
266
- transition: { duration: 0.54, ease: WORD_EASE, delay: delayS + (fresh ? (i - firstNew) * WORD_STAGGER_S : 0) },
298
+ transition: { duration: WORD_RISE_S, ease: WORD_EASE, delay: delayS + (order !== void 0 ? plan.offsetS + order * plan.staggerS : 0) },
267
299
  children: w
268
300
  },
269
- i
301
+ key
270
302
  );
271
303
  };
272
304
  const out = [];
@@ -417,20 +449,18 @@ function TurnHeader() {
417
449
  children: [
418
450
  /* @__PURE__ */ jsxs3("div", { className: "flex flex-wrap items-end justify-between gap-5", children: [
419
451
  /* @__PURE__ */ jsx5(Breadcrumbs, { crumbs: wordCrumbs(page.crumbs, labels.home, labels.thisPage) }),
420
- /* @__PURE__ */ jsxs3("div", { className: "flex items-end gap-6", children: [
421
- !thinking && facts2.length > 0 && /* @__PURE__ */ jsxs3("div", { className: "flex items-end gap-4", children: [
422
- /* @__PURE__ */ jsx5("span", { className: "pb-1.5 text-sm font-medium leading-5 text-[var(--fourty-convo-muted)]", children: labels.whatIKnow }),
423
- /* @__PURE__ */ jsx5(Facts, { facts: facts2, onForget: presence.forgetFact })
424
- ] }),
425
- startOver
426
- ] })
452
+ /* @__PURE__ */ jsx5("div", { className: "ms-auto", children: startOver })
453
+ ] }),
454
+ facts2.length > 0 && /* @__PURE__ */ jsxs3("div", { className: "flex flex-wrap items-end gap-4", children: [
455
+ /* @__PURE__ */ jsx5("span", { className: "pb-1.5 text-sm font-medium leading-5 text-[var(--fourty-convo-muted)]", children: labels.whatIKnow }),
456
+ /* @__PURE__ */ jsx5(Facts, { facts: facts2, onForget: presence.forgetFact })
427
457
  ] }),
428
458
  /* @__PURE__ */ jsx5("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ jsxs3("span", { className: "text-xl font-medium leading-[1.625rem] text-[var(--fourty-convo-muted)]", children: [
429
459
  "\u201C",
430
460
  turn.question,
431
461
  "\u201D"
432
462
  ] }) }),
433
- /* @__PURE__ */ jsx5("div", { children: /* @__PURE__ */ jsx5(AnimatePresence, { mode: "popLayout", initial: false, children: thinking ? /* @__PURE__ */ jsx5(ThinkingBand, { facts: facts2, status }, "thinking") : (
463
+ /* @__PURE__ */ jsx5("div", { children: /* @__PURE__ */ jsx5(AnimatePresence, { mode: "popLayout", initial: false, children: thinking ? /* @__PURE__ */ jsx5(ThinkingBand, { facts: [], status }, "thinking") : (
434
464
  // The answer reads top to bottom: the headline, then its supporting
435
465
  // text, then the closing question. The body streams after the layout,
436
466
  // so the page below glides down as it arrives (TurnCanvas).
@@ -506,14 +536,49 @@ function ConversationCanvas({ motion: motion2 = CONVERSATION_MOTION }) {
506
536
  }
507
537
 
508
538
  // src/conversation/PageComposer.tsx
509
- import { useComposerChipSelect, useConversationPage as useConversationPage4 } from "@40rty/ams-sdk";
510
- import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
539
+ import * as React6 from "react";
540
+ import { turnAskAnswers, useComposerChipSelect, useConversationPage as useConversationPage4 } from "@40rty/ams-sdk";
541
+
542
+ // src/conversation/sent-words.tsx
543
+ import { createPortal } from "react-dom";
544
+ import { useWaitingSubmitOrigin } from "@40rty/ams-sdk";
545
+ import { jsx as jsx8 } from "react/jsx-runtime";
546
+ function SentWords() {
547
+ const origin = useWaitingSubmitOrigin();
548
+ if (origin === null) return null;
549
+ return createPortal(
550
+ /* @__PURE__ */ jsx8(
551
+ "span",
552
+ {
553
+ "aria-hidden": true,
554
+ className: "pointer-events-none fixed z-[2147482999] block overflow-hidden whitespace-pre-wrap",
555
+ style: {
556
+ left: origin.rect.left,
557
+ top: origin.rect.top,
558
+ width: origin.rect.width,
559
+ fontSize: origin.fontSizePx,
560
+ lineHeight: `${origin.lineHeightPx}px`,
561
+ fontFamily: origin.fontFamily,
562
+ color: origin.color
563
+ },
564
+ children: origin.text
565
+ }
566
+ ),
567
+ document.body
568
+ );
569
+ }
570
+
571
+ // src/conversation/PageComposer.tsx
572
+ import { Fragment as Fragment5, jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
511
573
  var PAGE_COMPOSER_INPUT_ID = "fourty-page-composer";
512
- function PageComposer({ placeholder, starters }) {
513
- const { value, setValue, attachments, dictation, onPaste, canSend, submit } = usePromptComposer();
574
+ function PageComposer({ placeholder, starters, followUpsInPage = false }) {
575
+ const originRef = React6.useRef(null);
576
+ const { value, setValue, attachments, dictation, onPaste, canSend, submit } = usePromptComposer({ origin: originRef });
514
577
  const onChipSelect = useComposerChipSelect();
515
- const { presence } = useConversationPage4();
578
+ const { presence, turn, place } = useConversationPage4();
516
579
  const isRunning = presence.running;
580
+ const pageAsksForReply = turn !== null && turn.ask !== void 0 && turnAskAnswers(turn.ask).length > 0;
581
+ const showFollowUps = followUpsInPage ? place === "welcome" : !isRunning && !pageAsksForReply;
517
582
  const status = useActivityLine(presence.activity);
518
583
  const labels = useLabels().conversation;
519
584
  const onKeyDown = (e) => {
@@ -523,25 +588,26 @@ function PageComposer({ placeholder, starters }) {
523
588
  }
524
589
  };
525
590
  return (
526
- // It floats over the page: no band behind it, only a soft blur that fades
527
- // in toward the bottom edge so the page reads under it, and a frosted bar.
528
- /* @__PURE__ */ jsxs5("div", { className: "relative px-[var(--fourty-canvas-gutter)] pb-5 pt-10", children: [
529
- /* @__PURE__ */ jsx8("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-0 bg-[linear-gradient(to_bottom,transparent,rgb(255_255_255/0.12))] backdrop-blur-[6px] [mask-image:linear-gradient(to_bottom,transparent,black_75%)]" }),
591
+ // It floats over the page: no band, wash or blur behind it — the page stays
592
+ // sharp under it, and only the chips and the frosted bar sit on top.
593
+ /* @__PURE__ */ jsxs5("div", { className: "relative px-[var(--fourty-canvas-gutter)] pb-5 pt-3", children: [
594
+ /* @__PURE__ */ jsx9(SentWords, {}),
530
595
  /* @__PURE__ */ jsxs5("div", { className: "fourty-convo-composer relative mx-auto flex max-w-[920px] flex-col gap-2.5", children: [
531
- /* @__PURE__ */ jsx8(ComposerChipStrip, { value, starterSuggestions: starters, onStarterClick: setValue, onChipSelect, orientation: "row" }),
532
- attachments.attachments.length > 0 && /* @__PURE__ */ jsx8(AttachmentStrip, { attachments: attachments.attachments, onRemove: attachments.remove }),
533
- /* @__PURE__ */ jsx8("div", { className: "flex items-center gap-3 rounded-[var(--fourty-convo-composer-radius)] border border-[rgb(255_255_255/0.6)] bg-[rgb(255_255_255/0.78)] py-2 ps-3.5 pe-2 shadow-[0_12px_40px_rgb(0_0_0/0.18)] backdrop-blur-xl backdrop-saturate-150", children: isRunning ? /* @__PURE__ */ jsxs5(Fragment5, { children: [
596
+ showFollowUps && /* @__PURE__ */ jsx9(ComposerChipStrip, { value, starterSuggestions: starters, onStarterClick: setValue, onChipSelect, orientation: "row" }),
597
+ attachments.attachments.length > 0 && /* @__PURE__ */ jsx9(AttachmentStrip, { attachments: attachments.attachments, onRemove: attachments.remove }),
598
+ /* @__PURE__ */ jsx9("div", { className: "flex items-center gap-3 rounded-[var(--fourty-convo-composer-radius)] border border-[rgb(255_255_255/0.6)] bg-[rgb(255_255_255/0.78)] py-2 ps-3.5 pe-2 shadow-[0_12px_40px_rgb(0_0_0/0.18)] backdrop-blur-xl backdrop-saturate-150", children: isRunning ? /* @__PURE__ */ jsxs5(Fragment5, { children: [
534
599
  /* @__PURE__ */ jsxs5("span", { "aria-hidden": true, className: "flex flex-none gap-1", children: [
535
- /* @__PURE__ */ jsx8("span", { className: "h-1.5 w-1.5 animate-pulse bg-[var(--fourty-convo-accent)]" }),
536
- /* @__PURE__ */ jsx8("span", { className: "h-1.5 w-1.5 animate-pulse bg-[var(--fourty-convo-accent)] [animation-delay:200ms]" }),
537
- /* @__PURE__ */ jsx8("span", { className: "h-1.5 w-1.5 animate-pulse bg-[var(--fourty-convo-accent)] [animation-delay:400ms]" })
600
+ /* @__PURE__ */ jsx9("span", { className: "h-1.5 w-1.5 animate-pulse bg-[var(--fourty-convo-accent)]" }),
601
+ /* @__PURE__ */ jsx9("span", { className: "h-1.5 w-1.5 animate-pulse bg-[var(--fourty-convo-accent)] [animation-delay:200ms]" }),
602
+ /* @__PURE__ */ jsx9("span", { className: "h-1.5 w-1.5 animate-pulse bg-[var(--fourty-convo-accent)] [animation-delay:400ms]" })
538
603
  ] }),
539
- /* @__PURE__ */ jsx8("span", { className: "relative min-w-0 flex-1 py-2 text-[14.5px] text-[var(--color-text-muted)]", children: /* @__PURE__ */ jsx8(AnimatePresence, { mode: "popLayout", initial: false, children: /* @__PURE__ */ jsx8(motion.span, { className: "block truncate", initial: { opacity: 0, y: 4 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -4 }, transition: { duration: 0.3 }, children: status }, status) }) })
604
+ /* @__PURE__ */ jsx9("span", { className: "relative min-w-0 flex-1 py-2 text-[14.5px] text-[var(--color-text-muted)]", children: /* @__PURE__ */ jsx9(AnimatePresence, { mode: "popLayout", initial: false, children: /* @__PURE__ */ jsx9(motion.span, { className: "block truncate", initial: { opacity: 0, y: 4 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -4 }, transition: { duration: 0.3 }, children: status }, status) }) })
540
605
  ] }) : /* @__PURE__ */ jsxs5(Fragment5, { children: [
541
- /* @__PURE__ */ jsx8(AttachButton, { onFiles: attachments.addFiles }),
542
- /* @__PURE__ */ jsx8(
606
+ /* @__PURE__ */ jsx9(AttachButton, { onFiles: attachments.addFiles }),
607
+ /* @__PURE__ */ jsx9(
543
608
  "textarea",
544
609
  {
610
+ ref: originRef,
545
611
  id: PAGE_COMPOSER_INPUT_ID,
546
612
  rows: 1,
547
613
  value,
@@ -553,8 +619,8 @@ function PageComposer({ placeholder, starters }) {
553
619
  className: "min-w-0 flex-1 resize-none border-0 bg-transparent py-2 text-[16px] leading-[1.4] text-[var(--color-text)] outline-none placeholder:text-[var(--color-text-muted)]"
554
620
  }
555
621
  ),
556
- /* @__PURE__ */ jsx8(DictationButton, { listening: dictation.listening, supported: dictation.supported, onToggle: dictation.toggle }),
557
- /* @__PURE__ */ jsx8(
622
+ /* @__PURE__ */ jsx9(DictationButton, { listening: dictation.listening, supported: dictation.supported, onToggle: dictation.toggle }),
623
+ /* @__PURE__ */ jsx9(
558
624
  "button",
559
625
  {
560
626
  type: "button",
@@ -562,7 +628,7 @@ function PageComposer({ placeholder, starters }) {
562
628
  disabled: !canSend,
563
629
  "aria-label": labels.send,
564
630
  className: "flex h-10 w-10 flex-none cursor-pointer items-center justify-center rounded-[var(--fourty-chat-send-radius)] border-0 bg-[var(--color-primary)] text-[var(--color-on-dark)] disabled:opacity-40",
565
- children: /* @__PURE__ */ jsx8("svg", { width: "17", height: "17", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx8("path", { d: "M12 19V5M5 12l7-7 7 7" }) })
631
+ children: /* @__PURE__ */ jsx9("svg", { width: "17", height: "17", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: /* @__PURE__ */ jsx9("path", { d: "M12 19V5M5 12l7-7 7 7" }) })
566
632
  }
567
633
  )
568
634
  ] }) })
@@ -572,7 +638,7 @@ function PageComposer({ placeholder, starters }) {
572
638
  }
573
639
 
574
640
  // src/conversation/blocks/blocks.tsx
575
- import * as React7 from "react";
641
+ import * as React8 from "react";
576
642
  import { catalogComponent, useAction } from "@40rty/ams-sdk";
577
643
 
578
644
  // src/conversation/blocks/schemas.ts
@@ -637,23 +703,23 @@ var noteProps = {
637
703
  };
638
704
 
639
705
  // src/conversation/blocks/ProductTile.tsx
640
- import * as React6 from "react";
706
+ import * as React7 from "react";
641
707
  import { useHydrationState, useProductCard as useProductCard2 } from "@40rty/ams-sdk";
642
- import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
643
- var TileContext = React6.createContext(null);
708
+ import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
709
+ var TileContext = React7.createContext(null);
644
710
  function ConversationProvider({ tile, children }) {
645
- return /* @__PURE__ */ jsx9(TileContext.Provider, { value: tile, children });
711
+ return /* @__PURE__ */ jsx10(TileContext.Provider, { value: tile, children });
646
712
  }
647
713
  function PlainTile({ product, badge, blurb }) {
648
714
  const { primaryImage, priceLabel, onCardClick } = useProductCard2(product);
649
715
  return /* @__PURE__ */ jsxs6("button", { type: "button", onClick: onCardClick, className: "flex h-full w-full cursor-pointer flex-col gap-2 border-0 bg-transparent p-0 text-start text-inherit", children: [
650
716
  /* @__PURE__ */ jsxs6("span", { className: "relative block aspect-square bg-[var(--fourty-convo-surface)]", children: [
651
- primaryImage !== void 0 && /* @__PURE__ */ jsx9("img", { src: primaryImage.url, alt: primaryImage.altText, className: "block h-full w-full object-contain p-4" }),
652
- badge !== void 0 && /* @__PURE__ */ jsx9("span", { className: "absolute start-3 top-3 bg-[var(--fourty-convo-accent)] px-2 py-1 text-xs font-bold text-[var(--fourty-convo-on-accent)]", children: badge })
717
+ primaryImage !== void 0 && /* @__PURE__ */ jsx10("img", { src: primaryImage.url, alt: primaryImage.altText, className: "block h-full w-full object-contain p-4" }),
718
+ badge !== void 0 && /* @__PURE__ */ jsx10("span", { className: "absolute start-3 top-3 bg-[var(--fourty-convo-accent)] px-2 py-1 text-xs font-bold text-[var(--fourty-convo-on-accent)]", children: badge })
653
719
  ] }),
654
- /* @__PURE__ */ jsx9("span", { className: "text-base leading-5", children: product.title }),
655
- blurb !== void 0 && /* @__PURE__ */ jsx9("span", { className: "text-sm leading-5 text-[var(--fourty-convo-muted)]", children: blurb }),
656
- /* @__PURE__ */ jsx9("span", { className: "text-base", children: priceLabel })
720
+ /* @__PURE__ */ jsx10("span", { className: "text-base leading-5", children: product.title }),
721
+ blurb !== void 0 && /* @__PURE__ */ jsx10("span", { className: "text-sm leading-5 text-[var(--fourty-convo-muted)]", children: blurb }),
722
+ /* @__PURE__ */ jsx10("span", { className: "text-base", children: priceLabel })
657
723
  ] });
658
724
  }
659
725
  function useReserved(items) {
@@ -664,26 +730,26 @@ function useReserved(items) {
664
730
  return out;
665
731
  }
666
732
  function ProductTile(props) {
667
- const Tile = React6.useContext(TileContext);
668
- return /* @__PURE__ */ jsx9("div", { className: "@container h-full", children: Tile === null ? /* @__PURE__ */ jsx9(PlainTile, { ...props }) : /* @__PURE__ */ jsx9(Tile, { ...props }) });
733
+ const Tile = React7.useContext(TileContext);
734
+ return /* @__PURE__ */ jsx10("div", { className: "@container h-full", children: Tile === null ? /* @__PURE__ */ jsx10(PlainTile, { ...props }) : /* @__PURE__ */ jsx10(Tile, { ...props }) });
669
735
  }
670
736
  function TileReserve({ blurb }) {
671
737
  return /* @__PURE__ */ jsxs6("div", { "aria-hidden": true, className: "flex h-full flex-col gap-2", children: [
672
- /* @__PURE__ */ jsx9("div", { className: "aspect-square animate-pulse bg-[var(--fourty-convo-surface)]" }),
673
- /* @__PURE__ */ jsx9("span", { className: "h-5 w-3/4 animate-pulse bg-[var(--fourty-convo-surface)]" }),
674
- blurb !== void 0 && /* @__PURE__ */ jsx9("p", { className: "m-0 text-sm leading-5 text-[var(--fourty-convo-muted)]", children: blurb })
738
+ /* @__PURE__ */ jsx10("div", { className: "aspect-square animate-pulse bg-[var(--fourty-convo-surface)]" }),
739
+ /* @__PURE__ */ jsx10("span", { className: "h-5 w-3/4 animate-pulse bg-[var(--fourty-convo-surface)]" }),
740
+ blurb !== void 0 && /* @__PURE__ */ jsx10("p", { className: "m-0 text-sm leading-5 text-[var(--fourty-convo-muted)]", children: blurb })
675
741
  ] });
676
742
  }
677
743
  function useLanded(reserved) {
678
- const [landed, setLanded] = React6.useState(false);
679
- React6.useEffect(() => {
744
+ const [landed, setLanded] = React7.useState(false);
745
+ React7.useEffect(() => {
680
746
  if (!reserved && !landed) setLanded(true);
681
747
  }, [reserved, landed]);
682
748
  return landed || !reserved;
683
749
  }
684
750
 
685
751
  // src/conversation/blocks/blocks.tsx
686
- import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
752
+ import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
687
753
  var PILL = "inline-flex h-12 min-h-12 items-center justify-center whitespace-nowrap rounded-[var(--fourty-convo-radius)] [text-transform:var(--fourty-convo-button-transform)] px-5 text-sm font-medium leading-5 cursor-pointer [transition:background-color_0.3s,color_0.3s,border-color_0.3s,opacity_0.3s]";
688
754
  var PILL_SOLID = `${PILL} border border-[var(--fourty-convo-ink)] bg-[var(--fourty-convo-ink)] text-[var(--fourty-convo-sheet)] hover:bg-[var(--fourty-convo-sheet)] hover:text-[var(--fourty-convo-ink)] disabled:cursor-default disabled:opacity-40`;
689
755
  var PILL_OUTLINE = `${PILL} border border-current bg-transparent text-current hover:border-[var(--fourty-convo-ink)] hover:bg-[var(--fourty-convo-ink)] hover:text-[var(--fourty-convo-sheet)]`;
@@ -696,47 +762,47 @@ var CARD_SKIN = {
696
762
  accent: "bg-[var(--fourty-convo-accent)] text-[var(--fourty-convo-on-accent)]"
697
763
  };
698
764
  function Card({ children, tone = "plain" }) {
699
- return /* @__PURE__ */ jsx10("div", { className: `@container box-border flex h-full flex-col gap-4 p-8 max-[1025px]:p-4 ${CARD_SKIN[tone]}`, children });
765
+ return /* @__PURE__ */ jsx11("div", { className: `@container box-border flex h-full flex-col gap-4 p-8 max-[1025px]:p-4 ${CARD_SKIN[tone]}`, children });
700
766
  }
701
767
  function Eyebrow({ children }) {
702
- return /* @__PURE__ */ jsx10("p", { className: "m-0 text-sm font-medium leading-5 opacity-60", children });
768
+ return /* @__PURE__ */ jsx11("p", { className: "m-0 text-sm font-medium leading-5 opacity-60", children });
703
769
  }
704
770
  function Title({ children }) {
705
- return /* @__PURE__ */ jsx10("h3", { className: "m-0 text-2xl font-bold leading-7 @[560px]:text-[2rem] @[560px]:leading-[2.1875rem]", children });
771
+ return /* @__PURE__ */ jsx11("h3", { className: "m-0 text-2xl font-bold leading-7 @[560px]:text-[2rem] @[560px]:leading-[2.1875rem]", children });
706
772
  }
707
773
  function AskChip({ label, text }) {
708
- const action = React7.useMemo(() => ({ id: `ask-${label}`, type: "message", payload: { text } }), [label, text]);
774
+ const action = React8.useMemo(() => ({ id: `ask-${label}`, type: "message", payload: { text } }), [label, text]);
709
775
  const onClick = useAction(label, action);
710
- return /* @__PURE__ */ jsx10("button", { type: "button", onClick: onClick !== null ? onClick : void 0, className: PILL_OUTLINE, children: label });
776
+ return /* @__PURE__ */ jsx11("button", { type: "button", onClick: onClick !== null ? onClick : void 0, className: PILL_OUTLINE, children: label });
711
777
  }
712
778
  var arr = (v) => Array.isArray(v) ? v : [];
713
779
  function GuidedPick(p) {
714
780
  return /* @__PURE__ */ jsxs7(Card, { children: [
715
- p.eyebrow !== void 0 && /* @__PURE__ */ jsx10(Eyebrow, { children: p.eyebrow }),
716
- /* @__PURE__ */ jsx10(Title, { children: p.question }),
717
- /* @__PURE__ */ jsx10("div", { className: "flex flex-wrap gap-2", children: arr(p.options).map((o) => /* @__PURE__ */ jsx10(AskChip, { label: o.hint !== void 0 ? `${o.label} \u2014 ${o.hint}` : o.label, text: o.label }, o.label)) })
781
+ p.eyebrow !== void 0 && /* @__PURE__ */ jsx11(Eyebrow, { children: p.eyebrow }),
782
+ /* @__PURE__ */ jsx11(Title, { children: p.question }),
783
+ /* @__PURE__ */ jsx11("div", { className: "flex flex-wrap gap-2", children: arr(p.options).map((o) => /* @__PURE__ */ jsx11(AskChip, { label: o.hint !== void 0 ? `${o.label} \u2014 ${o.hint}` : o.label, text: o.label }, o.label)) })
718
784
  ] });
719
785
  }
720
786
  function Paths(p) {
721
787
  const labels = useLabels().conversation;
722
788
  return /* @__PURE__ */ jsxs7(Card, { tone: "accent", children: [
723
- /* @__PURE__ */ jsx10(Title, { children: p.title !== void 0 ? p.title : labels.pathsTitle }),
724
- /* @__PURE__ */ jsx10("div", { className: "flex flex-wrap gap-2", children: arr(p.paths).map((x) => /* @__PURE__ */ jsx10(AskChip, { label: x.label, text: x.prompt }, x.label)) })
789
+ /* @__PURE__ */ jsx11(Title, { children: p.title !== void 0 ? p.title : labels.pathsTitle }),
790
+ /* @__PURE__ */ jsx11("div", { className: "flex flex-wrap gap-2", children: arr(p.paths).map((x) => /* @__PURE__ */ jsx11(AskChip, { label: x.label, text: x.prompt }, x.label)) })
725
791
  ] });
726
792
  }
727
793
  function Note(p) {
728
794
  const labels = useLabels().conversation;
729
795
  return /* @__PURE__ */ jsxs7(Card, { tone: "highlight", children: [
730
- /* @__PURE__ */ jsx10(Eyebrow, { children: p.eyebrow !== void 0 ? p.eyebrow : labels.noteEyebrow }),
731
- /* @__PURE__ */ jsx10("div", { className: "text-2xl font-bold leading-7 @[560px]:text-[2rem] @[560px]:leading-[2.1875rem]", children: p.text })
796
+ /* @__PURE__ */ jsx11(Eyebrow, { children: p.eyebrow !== void 0 ? p.eyebrow : labels.noteEyebrow }),
797
+ /* @__PURE__ */ jsx11("div", { className: "text-2xl font-bold leading-7 @[560px]:text-[2rem] @[560px]:leading-[2.1875rem]", children: p.text })
732
798
  ] });
733
799
  }
734
800
  function Facts2(p) {
735
801
  return /* @__PURE__ */ jsxs7(Card, { children: [
736
- p.title !== void 0 && /* @__PURE__ */ jsx10(Eyebrow, { children: p.title }),
737
- /* @__PURE__ */ jsx10("dl", { className: "m-0 grid grid-cols-2 gap-x-4 gap-y-3", children: arr(p.items).map((f) => /* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
738
- /* @__PURE__ */ jsx10("dt", { className: "text-sm leading-5 text-[var(--fourty-convo-muted)]", children: f.label }),
739
- /* @__PURE__ */ jsx10("dd", { className: "m-0 text-base font-bold leading-6", children: f.value })
802
+ p.title !== void 0 && /* @__PURE__ */ jsx11(Eyebrow, { children: p.title }),
803
+ /* @__PURE__ */ jsx11("dl", { className: "m-0 grid grid-cols-2 gap-x-4 gap-y-3", children: arr(p.items).map((f) => /* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
804
+ /* @__PURE__ */ jsx11("dt", { className: "text-sm leading-5 text-[var(--fourty-convo-muted)]", children: f.label }),
805
+ /* @__PURE__ */ jsx11("dd", { className: "m-0 text-base font-bold leading-6", children: f.value })
740
806
  ] }, f.label)) })
741
807
  ] });
742
808
  }
@@ -746,12 +812,12 @@ function Explain(p) {
746
812
  const s = p.scale;
747
813
  const pct = s !== void 0 && s.max > s.min ? (s.value - s.min) / (s.max - s.min) * 100 : null;
748
814
  return /* @__PURE__ */ jsxs7(Card, { children: [
749
- /* @__PURE__ */ jsx10(Title, { children: p.term }),
750
- /* @__PURE__ */ jsx10("div", { className: "text-base leading-[1.375rem] text-[var(--fourty-convo-muted)]", children: p.definition }),
815
+ /* @__PURE__ */ jsx11(Title, { children: p.term }),
816
+ /* @__PURE__ */ jsx11("div", { className: "text-base leading-[1.375rem] text-[var(--fourty-convo-muted)]", children: p.definition }),
751
817
  s !== void 0 && pct !== null && /* @__PURE__ */ jsxs7("div", { className: "flex flex-col gap-1", children: [
752
818
  /* @__PURE__ */ jsxs7("div", { className: "relative h-2 rounded-full bg-[var(--fourty-convo-surface)]", children: [
753
- /* @__PURE__ */ jsx10("div", { className: "absolute inset-y-0 start-0 rounded-full bg-[var(--fourty-convo-ink)]", style: { width: `${pct}%` } }),
754
- /* @__PURE__ */ jsx10(
819
+ /* @__PURE__ */ jsx11("div", { className: "absolute inset-y-0 start-0 rounded-full bg-[var(--fourty-convo-ink)]", style: { width: `${pct}%` } }),
820
+ /* @__PURE__ */ jsx11(
755
821
  "div",
756
822
  {
757
823
  className: "absolute top-1/2 h-5 w-5 -translate-y-1/2 -translate-x-1/2 rtl:translate-x-1/2 rounded-full border-2 border-[var(--fourty-convo-ink)] bg-[var(--fourty-convo-sheet)]",
@@ -760,15 +826,15 @@ function Explain(p) {
760
826
  )
761
827
  ] }),
762
828
  /* @__PURE__ */ jsxs7("div", { className: "flex justify-between text-sm leading-5 text-[var(--fourty-convo-muted)]", children: [
763
- /* @__PURE__ */ jsx10("span", { children: s.minLabel }),
764
- /* @__PURE__ */ jsx10("span", { children: s.value }),
765
- /* @__PURE__ */ jsx10("span", { children: s.maxLabel })
829
+ /* @__PURE__ */ jsx11("span", { children: s.minLabel }),
830
+ /* @__PURE__ */ jsx11("span", { children: s.value }),
831
+ /* @__PURE__ */ jsx11("span", { children: s.maxLabel })
766
832
  ] })
767
833
  ] }),
768
- p.forYou !== void 0 && /* @__PURE__ */ jsx10("p", { className: "m-0 text-base font-bold leading-6", children: p.forYou }),
834
+ p.forYou !== void 0 && /* @__PURE__ */ jsx11("p", { className: "m-0 text-base font-bold leading-6", children: p.forYou }),
769
835
  products.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "mt-2 flex flex-col gap-3 pt-2", children: [
770
- /* @__PURE__ */ jsx10(Eyebrow, { children: labels.explainProducts }),
771
- /* @__PURE__ */ jsx10("div", { className: "grid grid-cols-3 gap-4", children: products.map((prod, i) => prod === null ? /* @__PURE__ */ jsx10(TileReserve, {}, `reserve-${i}`) : /* @__PURE__ */ jsx10(ProductTile, { product: prod }, prod.id)) })
836
+ /* @__PURE__ */ jsx11(Eyebrow, { children: labels.explainProducts }),
837
+ /* @__PURE__ */ jsx11("div", { className: "grid grid-cols-3 gap-4", children: products.map((prod, i) => prod === null ? /* @__PURE__ */ jsx11(TileReserve, {}, `reserve-${i}`) : /* @__PURE__ */ jsx11(ProductTile, { product: prod }, prod.id)) })
772
838
  ] })
773
839
  ] });
774
840
  }
@@ -827,22 +893,22 @@ var explain = catalogComponent(
827
893
  );
828
894
 
829
895
  // src/conversation/blocks/product-blocks.tsx
830
- import * as React8 from "react";
896
+ import * as React9 from "react";
831
897
  import { ItemTransitionGroup } from "@40rty/ams-sdk";
832
898
  import { catalogComponent as catalogComponent2 } from "@40rty/ams-sdk";
833
- import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
899
+ import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
834
900
  var arr2 = (v) => Array.isArray(v) ? v : [];
835
901
  function Verdict(p) {
836
902
  const labels = useLabels().conversation;
837
903
  const [pick] = useReserved(p.product !== void 0 ? [p.product] : []);
838
904
  return /* @__PURE__ */ jsxs8(Card, { children: [
839
- /* @__PURE__ */ jsx11(Eyebrow, { children: labels.verdict }),
905
+ /* @__PURE__ */ jsx12(Eyebrow, { children: labels.verdict }),
840
906
  /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-1 items-start gap-8 @[640px]:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]", children: [
841
- pick === void 0 ? /* @__PURE__ */ jsx11("div", {}) : pick === null ? /* @__PURE__ */ jsx11(TileReserve, {}) : /* @__PURE__ */ jsx11(ProductTile, { product: pick, badge: labels.ourPick }),
907
+ pick === void 0 ? /* @__PURE__ */ jsx12("div", {}) : pick === null ? /* @__PURE__ */ jsx12(TileReserve, {}) : /* @__PURE__ */ jsx12(ProductTile, { product: pick, badge: labels.ourPick }),
842
908
  /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-3", children: [
843
- /* @__PURE__ */ jsx11(Title, { children: p.headline }),
844
- /* @__PURE__ */ jsx11("ul", { className: "m-0 flex list-none flex-col p-0", children: arr2(p.reasons).map((r) => /* @__PURE__ */ jsx11("li", { className: "py-1.5 text-base leading-[1.375rem] first:pt-0", children: r }, r)) }),
845
- p.caveat !== void 0 && /* @__PURE__ */ jsx11("p", { className: "m-0 text-sm leading-5 text-[var(--fourty-convo-muted)]", children: labels.tradeoffCaveat(p.caveat) })
909
+ /* @__PURE__ */ jsx12(Title, { children: p.headline }),
910
+ /* @__PURE__ */ jsx12("ul", { className: "m-0 flex list-none flex-col p-0", children: arr2(p.reasons).map((r) => /* @__PURE__ */ jsx12("li", { className: "py-1.5 text-base leading-[1.375rem] first:pt-0", children: r }, r)) }),
911
+ p.caveat !== void 0 && /* @__PURE__ */ jsx12("p", { className: "m-0 text-sm leading-5 text-[var(--fourty-convo-muted)]", children: labels.tradeoffCaveat(p.caveat) })
846
912
  ] })
847
913
  ] })
848
914
  ] });
@@ -852,32 +918,32 @@ function Shortlist(p) {
852
918
  const products = useReserved(arr2(p.products));
853
919
  const landed = useLanded(products.some((x) => x === null));
854
920
  return /* @__PURE__ */ jsxs8(Card, { children: [
855
- /* @__PURE__ */ jsx11(Title, { children: p.title }),
856
- !landed ? /* @__PURE__ */ jsx11("div", { className: FEED_GRID, children: products.map((prod, i) => /* @__PURE__ */ jsx11(React8.Fragment, { children: prod === null ? /* @__PURE__ */ jsx11(TileReserve, { blurb: i < notes.length ? notes[i] : void 0 }) : /* @__PURE__ */ jsx11(ProductTile, { product: prod, blurb: i < notes.length ? notes[i] : void 0 }) }, prod === null ? `reserve-${i}` : prod.id)) }) : /* @__PURE__ */ jsx11(ItemTransitionGroup, { className: FEED_GRID, items: arr2(p.products), getId: (prod) => prod.id, children: (prod) => {
921
+ /* @__PURE__ */ jsx12(Title, { children: p.title }),
922
+ !landed ? /* @__PURE__ */ jsx12("div", { className: FEED_GRID, children: products.map((prod, i) => /* @__PURE__ */ jsx12(React9.Fragment, { children: prod === null ? /* @__PURE__ */ jsx12(TileReserve, { blurb: i < notes.length ? notes[i] : void 0 }) : /* @__PURE__ */ jsx12(ProductTile, { product: prod, blurb: i < notes.length ? notes[i] : void 0 }) }, prod === null ? `reserve-${i}` : prod.id)) }) : /* @__PURE__ */ jsx12(ItemTransitionGroup, { className: FEED_GRID, items: arr2(p.products), getId: (prod) => prod.id, children: (prod) => {
857
923
  const i = arr2(p.products).indexOf(prod);
858
- return /* @__PURE__ */ jsx11(ProductTile, { product: prod, blurb: i >= 0 && i < notes.length ? notes[i] : void 0 });
924
+ return /* @__PURE__ */ jsx12(ProductTile, { product: prod, blurb: i >= 0 && i < notes.length ? notes[i] : void 0 });
859
925
  } })
860
926
  ] });
861
927
  }
862
928
  function SideCol({ side: side2, product }) {
863
- if (side2 === void 0) return /* @__PURE__ */ jsx11("div", {});
929
+ if (side2 === void 0) return /* @__PURE__ */ jsx12("div", {});
864
930
  return /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-2 min-w-0", children: [
865
- product === null ? /* @__PURE__ */ jsx11(TileReserve, {}) : product !== void 0 && /* @__PURE__ */ jsx11(ProductTile, { product }),
866
- /* @__PURE__ */ jsx11("p", { className: "m-0 mt-2 text-xl font-bold leading-[1.625rem]", children: side2.label }),
867
- /* @__PURE__ */ jsx11("ul", { className: "m-0 flex flex-col gap-1 ps-4 text-base leading-[1.375rem] text-[var(--fourty-convo-muted)]", children: arr2(side2.points).map((pt) => /* @__PURE__ */ jsx11("li", { children: pt }, pt)) })
931
+ product === null ? /* @__PURE__ */ jsx12(TileReserve, {}) : product !== void 0 && /* @__PURE__ */ jsx12(ProductTile, { product }),
932
+ /* @__PURE__ */ jsx12("p", { className: "m-0 mt-2 text-xl font-bold leading-[1.625rem]", children: side2.label }),
933
+ /* @__PURE__ */ jsx12("ul", { className: "m-0 flex flex-col gap-1 ps-4 text-base leading-[1.375rem] text-[var(--fourty-convo-muted)]", children: arr2(side2.points).map((pt) => /* @__PURE__ */ jsx12("li", { children: pt }, pt)) })
868
934
  ] });
869
935
  }
870
936
  function Tradeoff(p) {
871
937
  const labels = useLabels().conversation;
872
938
  const products = useReserved(arr2(p.products));
873
939
  return /* @__PURE__ */ jsxs8(Card, { children: [
874
- /* @__PURE__ */ jsx11(Eyebrow, { children: labels.tradeoff }),
875
- /* @__PURE__ */ jsx11(Title, { children: p.title }),
940
+ /* @__PURE__ */ jsx12(Eyebrow, { children: labels.tradeoff }),
941
+ /* @__PURE__ */ jsx12(Title, { children: p.title }),
876
942
  /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-2 gap-6", children: [
877
- /* @__PURE__ */ jsx11(SideCol, { side: p.left, product: products.length > 0 ? products[0] : void 0 }),
878
- /* @__PURE__ */ jsx11(SideCol, { side: p.right, product: products.length > 1 ? products[1] : void 0 })
943
+ /* @__PURE__ */ jsx12(SideCol, { side: p.left, product: products.length > 0 ? products[0] : void 0 }),
944
+ /* @__PURE__ */ jsx12(SideCol, { side: p.right, product: products.length > 1 ? products[1] : void 0 })
879
945
  ] }),
880
- p.lean !== void 0 && /* @__PURE__ */ jsx11("p", { className: "m-0 pt-2 text-base font-bold leading-6", children: p.lean })
946
+ p.lean !== void 0 && /* @__PURE__ */ jsx12("p", { className: "m-0 pt-2 text-base font-bold leading-6", children: p.lean })
881
947
  ] });
882
948
  }
883
949
  var verdict = catalogComponent2(
@@ -949,5 +1015,6 @@ export {
949
1015
  useLanded,
950
1016
  usePageProducts,
951
1017
  useReserved,
952
- verdict
1018
+ verdict,
1019
+ wordsSettleInMs
953
1020
  };
package/dist/island.js CHANGED
@@ -55,7 +55,8 @@ function SpacefrontIsland({
55
55
  const emptyText = emptyProp === void 0 ? labels.thread.empty : emptyProp;
56
56
  const workingText = workingProp === void 0 ? labels.thread.working : workingProp;
57
57
  const session = useFourtySession();
58
- const { value, setValue, attachments, dictation, onPaste, canSend, submit } = usePromptComposer();
58
+ const originRef = React.useRef(null);
59
+ const { value, setValue, attachments, dictation, onPaste, canSend, submit } = usePromptComposer({ origin: originRef });
59
60
  const presence = useConversationPresence();
60
61
  const { rows, isEmpty } = useThreadRows();
61
62
  const selectChip = useComposerChipSelect();
@@ -139,6 +140,7 @@ function SpacefrontIsland({
139
140
  /* @__PURE__ */ jsx(
140
141
  "textarea",
141
142
  {
143
+ ref: originRef,
142
144
  className: "fourty-si__field",
143
145
  rows: 1,
144
146
  "aria-label": placeholder,
package/dist/shell.js CHANGED
@@ -38,7 +38,7 @@ import {
38
38
  useOnScreen,
39
39
  usePromptComposer,
40
40
  useShellDock
41
- } from "./chunk-ODII3M4H.js";
41
+ } from "./chunk-BILXJCTS.js";
42
42
  import {
43
43
  SIDE_DOCK_EASE,
44
44
  SIDE_DOCK_REVEAL_MS,
@@ -5,8 +5,14 @@ export declare const PAGE_COMPOSER_INPUT_ID = "fourty-page-composer";
5
5
  * The conversation page's prompt input, IN the page: the agent's follow-up chips over
6
6
  * one bar pinned to the bottom of the canvas. While the agent works, the bar
7
7
  * reads what it is doing instead of taking input.
8
+ *
9
+ * `followUpsInPage`: the shell draws a turn's follow-ups in the page itself,
10
+ * under the answer (`useConversationPage().followUps`), so the composer shows
11
+ * chips only on the welcome page (its starters) — never a second set over the
12
+ * answer. Without it the composer carries the follow-ups.
8
13
  */
9
- export declare function PageComposer({ placeholder, starters }: {
14
+ export declare function PageComposer({ placeholder, starters, followUpsInPage }: {
10
15
  placeholder: string;
11
16
  starters: string[];
17
+ followUpsInPage?: boolean;
12
18
  }): React.ReactElement;
@@ -5,7 +5,7 @@ export { ResultSheet } from './ResultSheet';
5
5
  export { TurnCanvas } from './TurnCanvas';
6
6
  export { ClosingQuestion } from './ClosingQuestion';
7
7
  export { Facts, ThinkingBand, BentoSkeleton } from './presence-parts';
8
- export { Rich, RisingWords, crumbLabel, productNamed } from './turn-text';
8
+ export { Rich, RisingWords, crumbLabel, productNamed, wordsSettleInMs } from './turn-text';
9
9
  export { useActivityLine } from './activity-line';
10
10
  export { usePageProducts } from './use-page-products';
11
11
  export * from './blocks';
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * The words just sent, held where they were until the answer takes them
4
+ * (`takeSubmitOrigin`). The composer swaps its field for the agent's status the
5
+ * moment it sends, and the answer that lifts the words mounts a beat later; in
6
+ * between the sentence would blink out. This draws it in the field's exact text
7
+ * box and typography, so the hand-off to the answer's flight is seamless.
8
+ * Nothing shows once a shell takes the words, or once the send is too old.
9
+ */
10
+ export declare function SentWords(): React.ReactElement | null;
@@ -17,11 +17,17 @@ export declare function Rich({ text, products }: {
17
17
  text: string;
18
18
  products?: readonly Product[];
19
19
  }): React.ReactElement;
20
+ /**
21
+ * Milliseconds until every word queued on the page's cascade has risen — 0
22
+ * once it is still. What should follow the words rather than race them (a
23
+ * turn's lead block, landing after the answer that names it) waits this long.
24
+ */
25
+ export declare function wordsSettleInMs(): number;
20
26
  /**
21
27
  * Text whose words rise into place out of a blur, one after another — the
22
28
  * design's headline reveal. Streaming-safe: a word that was already shown
23
- * never re-animates; words arriving together cascade from where the last
24
- * batch ended. `**bold**` is honoured, and a bold run that names one of
29
+ * never re-animates; new words queue behind any still entering, on the
30
+ * page's one cascade (`cascadeEndS`), so a stalled stream resumes in order. `**bold**` is honoured, and a bold run that names one of
25
31
  * `products` is a link to it.
26
32
  */
27
33
  export declare function RisingWords({ text, products, delayS }: {
package/package.json CHANGED
@@ -76,12 +76,12 @@
76
76
  "zod": "^3.23.0"
77
77
  },
78
78
  "peerDependencies": {
79
- "@40rty/ams-sdk": "0.5.11",
79
+ "@40rty/ams-sdk": "0.5.13",
80
80
  "lucide-react": ">=0.400.0",
81
81
  "react": ">=18.0.0",
82
82
  "react-dom": ">=18.0.0"
83
83
  },
84
- "version": "0.5.11",
84
+ "version": "0.5.13",
85
85
  "homepage": "https://docs.40rty.ai",
86
86
  "license": "UNLICENSED",
87
87
  "engines": {