@40rty/ams-ui 0.5.15 → 0.5.17

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 CHANGED
@@ -67,7 +67,7 @@ import {
67
67
  useForgetFact,
68
68
  useMeasuredHeight,
69
69
  useVisibleFactList
70
- } from "./chunk-PYH6XCHQ.js";
70
+ } from "./chunk-PD3UJKW7.js";
71
71
  import {
72
72
  PRESENCE_DURABLE_SLOTS,
73
73
  PRESENCE_FACT_LIMIT,
@@ -75,7 +75,7 @@ import {
75
75
  readLabel,
76
76
  useVisibleFacts
77
77
  } from "./chunk-RMJDSHLA.js";
78
- import "./chunk-CQXGHVS6.js";
78
+ import "./chunk-TXELEHI5.js";
79
79
  import "./chunk-ZP27BQQE.js";
80
80
  export {
81
81
  AgentPresenceWidget,
@@ -44,7 +44,7 @@ import {
44
44
  turnProps,
45
45
  ugcExamples,
46
46
  ugcProps
47
- } from "./chunk-N5XACWEX.js";
47
+ } from "./chunk-JJNKZWIG.js";
48
48
  export {
49
49
  agentTextExamples,
50
50
  agentTextProps,
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import {
3
3
  catalog
4
- } from "./chunk-KW2DLXHP.js";
5
- import "./chunk-N5XACWEX.js";
4
+ } from "./chunk-WYFP55QO.js";
5
+ import "./chunk-JJNKZWIG.js";
6
6
  export {
7
7
  catalog
8
8
  };
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-WDL5PHO2.js";
6
6
  import {
7
7
  useLabels
8
- } from "./chunk-CQXGHVS6.js";
8
+ } from "./chunk-TXELEHI5.js";
9
9
  import {
10
10
  AnimatePresence,
11
11
  motion,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  SideDock,
4
4
  useSideDockSpacing
5
- } from "./chunk-IFVVYH4T.js";
5
+ } from "./chunk-Y5TD4JQH.js";
6
6
  import {
7
7
  useMediaQuery,
8
8
  useScrollLock
@@ -11,7 +11,7 @@ import {
11
11
  AgentPresenceWidget,
12
12
  PresenceBriefRail,
13
13
  mirrorX
14
- } from "./chunk-PYH6XCHQ.js";
14
+ } from "./chunk-PD3UJKW7.js";
15
15
  import {
16
16
  submitOnEnter,
17
17
  useScrollThreshold
@@ -21,7 +21,7 @@ import {
21
21
  AttachmentStrip,
22
22
  DictationButton,
23
23
  ListeningWaveform
24
- } from "./chunk-PPKL7CCQ.js";
24
+ } from "./chunk-4EV6YK3A.js";
25
25
  import {
26
26
  Spinner,
27
27
  cn
@@ -30,7 +30,7 @@ import {
30
30
  useLabels,
31
31
  useLocale,
32
32
  useTextDirection
33
- } from "./chunk-CQXGHVS6.js";
33
+ } from "./chunk-TXELEHI5.js";
34
34
  import {
35
35
  AgentCaret,
36
36
  AnimatePresence,
@@ -383,7 +383,7 @@ var comparisonTableProps = z4.object({
383
383
  'Product gid that gets the "MY PICK" verdict highlight. MUST be one of the gids in `products`. **SET this whenever the prose declares a winner** \u2014 the prose-declared winner without a matching highlight reads as visual noise; the table must mark the same product the voice recommends. Omit ONLY on genuinely neutral compare turns where the prose explicitly stays non-committal \u2014 the absence of highlight is itself the signal that the agent is staying neutral.'
384
384
  ),
385
385
  verdict: prose2(z4.string()).optional().describe(
386
- 'Your one-line call, rendered as the headline banner ABOVE the products \u2014 the whole point of an agentic compare. Lead with the pick + the deciding reason in your voice: "For a beach party, the Jelina takes it \u2014 the low kitten walks the sand." \u2264140 chars, ONE sentence, no product enumeration beyond naming the winner. Set this on every decisive compare; pair it with `highlightedProductId` (same product). Omit only on a genuinely neutral side-by-side.'
386
+ 'Your one-line call, rendered ABOVE the products as the lead line of the compare \u2014 the whole point of an agentic compare. Lead with the pick + the deciding reason in your voice: "For a beach party, the Jelina takes it \u2014 the low kitten walks the sand." \u2264140 chars, ONE sentence, no product enumeration beyond naming the winner. Set this on every decisive compare; pair it with `highlightedProductId` (same product). Omit only on a genuinely neutral side-by-side.'
387
387
  ),
388
388
  attributeRows: z4.array(
389
389
  z4.object({
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  useLabels,
15
15
  useTextDirection
16
- } from "./chunk-CQXGHVS6.js";
16
+ } from "./chunk-TXELEHI5.js";
17
17
  import {
18
18
  AnimatePresence,
19
19
  motion,
@@ -259,14 +259,6 @@ var EN_CONTENT = {
259
259
  }
260
260
  };
261
261
 
262
- // src/labels/en/notices.ts
263
- var EN_NOTICES = {
264
- notices: {
265
- contentFailed: "Some content couldn't be loaded.",
266
- itemsUnavailable: (count) => `${count} ${count === 1 ? "item" : "items"} couldn't be loaded.`
267
- }
268
- };
269
-
270
262
  // src/labels/en/shell.ts
271
263
  var EN_SHELL = {
272
264
  menu: {
@@ -652,14 +644,6 @@ var HE_CONTENT = {
652
644
  }
653
645
  };
654
646
 
655
- // src/labels/he/notices.ts
656
- var HE_NOTICES = {
657
- notices: {
658
- contentFailed: "\u05D7\u05DC\u05E7 \u05DE\u05D4\u05EA\u05D5\u05DB\u05DF \u05DC\u05D0 \u05E0\u05D8\u05E2\u05DF.",
659
- itemsUnavailable: (count) => count === 1 ? "\u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3 \u05DC\u05D0 \u05E0\u05D8\u05E2\u05DF." : `${count} \u05E4\u05E8\u05D9\u05D8\u05D9\u05DD \u05DC\u05D0 \u05E0\u05D8\u05E2\u05E0\u05D5.`
660
- }
661
- };
662
-
663
647
  // src/labels/he/shell.ts
664
648
  var HE_SHELL = {
665
649
  menu: {
@@ -1042,14 +1026,6 @@ var PT_CONTENT = {
1042
1026
  }
1043
1027
  };
1044
1028
 
1045
- // src/labels/pt/notices.ts
1046
- var PT_NOTICES = {
1047
- notices: {
1048
- contentFailed: "Parte do conte\xFAdo n\xE3o p\xF4de ser carregada.",
1049
- itemsUnavailable: (count) => count === 1 ? "1 item n\xE3o p\xF4de ser carregado." : `${count} itens n\xE3o puderam ser carregados.`
1050
- }
1051
- };
1052
-
1053
1029
  // src/labels/pt/shell.ts
1054
1030
  var PT_SHELL = {
1055
1031
  menu: {
@@ -1166,9 +1142,9 @@ var PT_SHELL = {
1166
1142
  };
1167
1143
 
1168
1144
  // src/labels/index.ts
1169
- var EN_LABELS = { ...EN_COMMERCE, ...EN_AGENT, ...EN_SHELL, ...EN_CONTENT, ...EN_NOTICES };
1170
- var HE_LABELS = { ...HE_COMMERCE, ...HE_AGENT, ...HE_SHELL, ...HE_CONTENT, ...HE_NOTICES };
1171
- var PT_LABELS = { ...PT_COMMERCE, ...PT_AGENT, ...PT_SHELL, ...PT_CONTENT, ...PT_NOTICES };
1145
+ var EN_LABELS = { ...EN_COMMERCE, ...EN_AGENT, ...EN_SHELL, ...EN_CONTENT };
1146
+ var HE_LABELS = { ...HE_COMMERCE, ...HE_AGENT, ...HE_SHELL, ...HE_CONTENT };
1147
+ var PT_LABELS = { ...PT_COMMERCE, ...PT_AGENT, ...PT_SHELL, ...PT_CONTENT };
1172
1148
  var DEFAULT_LABELS = EN_LABELS;
1173
1149
  var LABELS_BY_LANGUAGE = /* @__PURE__ */ new Map([
1174
1150
  ["en", EN_LABELS],
@@ -37,7 +37,7 @@ import {
37
37
  turnProps,
38
38
  ugcExamples,
39
39
  ugcProps
40
- } from "./chunk-N5XACWEX.js";
40
+ } from "./chunk-JJNKZWIG.js";
41
41
 
42
42
  // src/catalog-entries.ts
43
43
  var catalog = {
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  useLabels
4
- } from "./chunk-CQXGHVS6.js";
4
+ } from "./chunk-TXELEHI5.js";
5
5
 
6
6
  // src/shell/SideDock.tsx
7
7
  import * as React from "react";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  ComposerChipStrip,
4
4
  usePromptComposer
5
- } from "./chunk-BCQU4UFO.js";
6
- import "./chunk-IFVVYH4T.js";
5
+ } from "./chunk-6LSIIVDW.js";
6
+ import "./chunk-Y5TD4JQH.js";
7
7
  import "./chunk-I5QE47QY.js";
8
- import "./chunk-PYH6XCHQ.js";
8
+ import "./chunk-PD3UJKW7.js";
9
9
  import "./chunk-RMJDSHLA.js";
10
10
  import "./chunk-PHXP2SKS.js";
11
11
  import "./chunk-GQURT3IR.js";
@@ -13,11 +13,11 @@ import {
13
13
  AttachButton,
14
14
  AttachmentStrip,
15
15
  DictationButton
16
- } from "./chunk-PPKL7CCQ.js";
16
+ } from "./chunk-4EV6YK3A.js";
17
17
  import "./chunk-WDL5PHO2.js";
18
18
  import {
19
19
  useLabels
20
- } from "./chunk-CQXGHVS6.js";
20
+ } from "./chunk-TXELEHI5.js";
21
21
  import {
22
22
  AnimatePresence,
23
23
  motion,
@@ -101,7 +101,7 @@ function useSteadyLine(line, generic) {
101
101
 
102
102
  // src/conversation/turn-text.tsx
103
103
  import * as React3 from "react";
104
- import { useProductCard } from "@40rty/ams-sdk";
104
+ import { proseRuns, useProductCard } from "@40rty/ams-sdk";
105
105
  import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
106
106
  var CRUMB_MAX_CHARS = 26;
107
107
  function crumbLabel(visitorText) {
@@ -134,13 +134,20 @@ function ProductLink({ product, children }) {
134
134
  }
135
135
  );
136
136
  }
137
+ var LINK_CLASS = "underline underline-offset-4 [color:inherit] hover:text-[var(--fourty-convo-accent)]";
138
+ function ProseLink({ href, children }) {
139
+ return /* @__PURE__ */ jsx2("a", { href, target: "_blank", rel: "noopener noreferrer", className: LINK_CLASS, children });
140
+ }
137
141
  function Rich({ text, products }) {
138
- const parts = text.split("**");
139
- return /* @__PURE__ */ jsx2(Fragment2, { children: parts.map((part, i) => {
140
- if (i % 2 === 0) return /* @__PURE__ */ jsx2(React3.Fragment, { children: part }, i);
141
- const product = products === void 0 ? void 0 : productNamed(part, products);
142
- if (product !== void 0) return /* @__PURE__ */ jsx2(ProductLink, { product, children: part }, i);
143
- return /* @__PURE__ */ jsx2("strong", { className: "text-[var(--fourty-convo-ink)]", children: part }, i);
142
+ return /* @__PURE__ */ jsx2(Fragment2, { children: proseRuns(text).map((run, r) => {
143
+ if (run.href !== void 0 && products !== void 0) return /* @__PURE__ */ jsx2(ProseLink, { href: run.href, children: run.text }, r);
144
+ return run.text.split("**").map((part, i) => {
145
+ const key = `${String(r)}:${String(i)}`;
146
+ if (i % 2 === 0) return /* @__PURE__ */ jsx2(React3.Fragment, { children: part }, key);
147
+ const product = products === void 0 ? void 0 : productNamed(part, products);
148
+ if (product !== void 0) return /* @__PURE__ */ jsx2(ProductLink, { product, children: part }, key);
149
+ return /* @__PURE__ */ jsx2("strong", { className: "text-[var(--fourty-convo-ink)]", children: part }, key);
150
+ });
144
151
  }) });
145
152
  }
146
153
  var WORD_EASE = [0.2, 0.75, 0.2, 1];
@@ -167,15 +174,20 @@ function RisingWords({ text, products, delayS = 0 }) {
167
174
  const reduce = useReducedMotion();
168
175
  const words = [];
169
176
  let gap = false;
170
- text.split("**").forEach((part, run) => {
171
- const bold = run % 2 === 1;
172
- const product = bold ? productNamed(part, products) : void 0;
173
- for (const m of part.matchAll(/(\s*)(\S+)/g)) {
174
- words.push({ w: m[2], bold, spaced: words.length > 0 && (gap || m[1].length > 0), run, product });
175
- gap = false;
176
- }
177
- if (/\s$/.test(part)) gap = true;
178
- });
177
+ let bold = false;
178
+ let runs = 0;
179
+ for (const link of proseRuns(text)) {
180
+ link.text.split("**").forEach((part, i) => {
181
+ if (i > 0) bold = !bold;
182
+ runs += 1;
183
+ const product = bold && link.href === void 0 ? productNamed(part, products) : void 0;
184
+ for (const m of part.matchAll(/(\s*)(\S+)/g)) {
185
+ words.push({ w: m[2], bold, spaced: words.length > 0 && (gap || m[1].length > 0), run: runs, product, href: link.href });
186
+ gap = false;
187
+ }
188
+ if (/\s$/.test(part)) gap = true;
189
+ });
190
+ }
179
191
  const keyOf = (i) => `${String(i)}:${words[i].w}`;
180
192
  const keys = words.map((_, i) => keyOf(i));
181
193
  const animated = reduce !== true;
@@ -190,14 +202,14 @@ function RisingWords({ text, products, delayS = 0 }) {
190
202
  shownRef.current = new Set(keys);
191
203
  });
192
204
  const word = (i) => {
193
- const { w, bold, product } = words[i];
205
+ const { w, bold: bold2, product, href } = words[i];
194
206
  const key = keyOf(i);
195
207
  const order = rank.get(key);
196
208
  const fresh = order !== void 0;
197
209
  return /* @__PURE__ */ jsx2(
198
210
  motion.span,
199
211
  {
200
- 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]" : ""}`,
212
+ className: `inline-block ${bold2 ? "font-[var(--font-weight-strong,_700)] text-[var(--fourty-convo-ink)]" : ""} ${product !== void 0 || href !== void 0 ? "underline underline-offset-[0.12em] [color:inherit]" : ""}`,
201
213
  initial: fresh ? { opacity: 0, y: "0.5em", filter: "blur(8px)" } : false,
202
214
  animate: { opacity: 1, y: 0, filter: "blur(0px)" },
203
215
  transition: { duration: WORD_RISE_S, ease: WORD_EASE, delay: delayS + (order !== void 0 ? plan.offsetS + order * plan.staggerS : 0) },
@@ -209,9 +221,9 @@ function RisingWords({ text, products, delayS = 0 }) {
209
221
  };
210
222
  const out = [];
211
223
  for (let i = 0; i < words.length; ) {
212
- const { product, run, spaced } = words[i];
224
+ const { product, href, run, spaced } = words[i];
213
225
  if (spaced) out.push(" ");
214
- if (product === void 0) {
226
+ if (product === void 0 && href === void 0) {
215
227
  out.push(word(i));
216
228
  i += 1;
217
229
  continue;
@@ -222,7 +234,8 @@ function RisingWords({ text, products, delayS = 0 }) {
222
234
  if (i > start && words[i].spaced) name.push(" ");
223
235
  name.push(word(i));
224
236
  }
225
- out.push(/* @__PURE__ */ jsx2(ProductLink, { product, children: name }, `link-${start}`));
237
+ if (product !== void 0) out.push(/* @__PURE__ */ jsx2(ProductLink, { product, children: name }, `link-${String(start)}`));
238
+ else if (href !== void 0) out.push(/* @__PURE__ */ jsx2(ProseLink, { href, children: name }, `link-${String(start)}`));
226
239
  }
227
240
  return /* @__PURE__ */ jsx2(Fragment2, { children: out });
228
241
  }