@flamingo-stack/openframe-frontend-core 0.0.725 → 0.0.727

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.
Files changed (95) hide show
  1. package/dist/{chunk-F56GNKX2.js → chunk-33AFAVBF.js} +2 -2
  2. package/dist/{chunk-7V5KFBY2.cjs → chunk-3D2SCG2E.cjs} +16 -16
  3. package/dist/{chunk-B7234BE2.cjs → chunk-3N3QA47Y.cjs} +11 -11
  4. package/dist/{chunk-OBMWSUBK.js → chunk-3Q7ZNY4B.js} +5 -5
  5. package/dist/{chunk-JVHP7Y4S.js → chunk-4FQ5ZICE.js} +2 -2
  6. package/dist/{chunk-AI3CLDZO.cjs → chunk-AM2RHT3H.cjs} +280 -280
  7. package/dist/{chunk-PUADVXJD.js → chunk-AU4WWLFP.js} +1 -1
  8. package/dist/{chunk-RU6BTELI.cjs → chunk-BKTV3VOD.cjs} +533 -488
  9. package/dist/{chunk-2VOZ37BL.cjs → chunk-BMOEUIFI.cjs} +35 -35
  10. package/dist/{chunk-IOTAUWWF.js → chunk-C6Y22J32.js} +1 -1
  11. package/dist/{chunk-ZSXZE4FJ.cjs → chunk-CGL3TJ2A.cjs} +3 -3
  12. package/dist/{chunk-MLFS5G3V.js → chunk-CIAAU44V.js} +307 -262
  13. package/dist/{chunk-4ZZ4TNCY.cjs → chunk-CNBGSWLN.cjs} +9 -9
  14. package/dist/{chunk-AX4F35C2.js → chunk-FIKAJKPE.js} +1 -1
  15. package/dist/{chunk-SEVKFMKR.cjs → chunk-FLCYWEEB.cjs} +3 -3
  16. package/dist/{chunk-ASHRHL4W.js → chunk-GKJFSE72.js} +5 -5
  17. package/dist/{chunk-ASIXPRHV.js → chunk-HVMH67Z7.js} +3 -3
  18. package/dist/{chunk-F77J34W2.js → chunk-J274GOBJ.js} +1 -1
  19. package/dist/{chunk-LYQYLPPV.cjs → chunk-MAGVU2HZ.cjs} +26 -26
  20. package/dist/{chunk-QV4GO3GW.cjs → chunk-MGVT5RT6.cjs} +29 -56
  21. package/dist/{chunk-W2DXHR2R.js → chunk-N27CSEDR.js} +1 -1
  22. package/dist/{chunk-YPEILGVZ.cjs → chunk-N2PHC6RX.cjs} +3 -3
  23. package/dist/{chunk-5FVWDDX6.js → chunk-NQRFGXDG.js} +2 -2
  24. package/dist/{chunk-772242QR.cjs → chunk-QJVG5V46.cjs} +65 -65
  25. package/dist/{chunk-LR6DJY4Z.cjs → chunk-RZFTEUV4.cjs} +9 -9
  26. package/dist/{chunk-SE4O4HCD.cjs → chunk-U6HOC7JD.cjs} +8 -8
  27. package/dist/{chunk-ZZRUKEN2.js → chunk-URDJXB75.js} +3 -3
  28. package/dist/{chunk-MGTZ2BKY.js → chunk-VTXIY33G.js} +22 -49
  29. package/dist/{chunk-2SO3OJFY.cjs → chunk-WWJOQGSH.cjs} +33 -33
  30. package/dist/{chunk-JAKG6BY7.js → chunk-WXL5G7WC.js} +3 -3
  31. package/dist/{cloud-tenants-US63E2HV.js → cloud-tenants-65EUPGVC.js} +2 -2
  32. package/dist/{cloud-tenants-SMULXU54.cjs → cloud-tenants-PT5QPWWU.cjs} +3 -3
  33. package/dist/components/case-studies/index.cjs +14 -14
  34. package/dist/components/case-studies/index.js +3 -3
  35. package/dist/components/chat/assistant-ask-prompts.d.ts +34 -14
  36. package/dist/components/chat/assistant-ask-prompts.d.ts.map +1 -1
  37. package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
  38. package/dist/components/chat/hooks/index.d.ts +1 -1
  39. package/dist/components/chat/hooks/index.d.ts.map +1 -1
  40. package/dist/components/chat/hooks/use-ask-prompts.d.ts +34 -7
  41. package/dist/components/chat/hooks/use-ask-prompts.d.ts.map +1 -1
  42. package/dist/components/chat/index.cjs +2 -4
  43. package/dist/components/chat/index.js +3 -5
  44. package/dist/components/contact/index.cjs +4 -4
  45. package/dist/components/contact/index.js +3 -3
  46. package/dist/components/docs/index.cjs +7 -7
  47. package/dist/components/docs/index.js +6 -6
  48. package/dist/components/embeds/index.cjs +4 -4
  49. package/dist/components/embeds/index.js +3 -3
  50. package/dist/components/faq/faq-ask-card.d.ts +8 -11
  51. package/dist/components/faq/faq-ask-card.d.ts.map +1 -1
  52. package/dist/components/faq/index.cjs +4 -4
  53. package/dist/components/faq/index.js +3 -3
  54. package/dist/components/features/index.cjs +3 -3
  55. package/dist/components/features/index.js +2 -2
  56. package/dist/components/help-center-pages/index.cjs +71 -71
  57. package/dist/components/help-center-pages/index.js +13 -13
  58. package/dist/components/index.cjs +35 -37
  59. package/dist/components/index.js +14 -16
  60. package/dist/components/meeting-scheduler/index.cjs +19 -19
  61. package/dist/components/meeting-scheduler/index.js +2 -2
  62. package/dist/components/navigation/index.cjs +6 -6
  63. package/dist/components/navigation/index.js +5 -5
  64. package/dist/components/onboarding-guides/index.cjs +5 -5
  65. package/dist/components/onboarding-guides/index.js +4 -4
  66. package/dist/components/product-demo/index.cjs +6 -6
  67. package/dist/components/product-demo/index.js +6 -6
  68. package/dist/components/tickets/index.cjs +7 -7
  69. package/dist/components/tickets/index.js +6 -6
  70. package/dist/components/ui/index.cjs +3 -5
  71. package/dist/components/ui/index.js +4 -6
  72. package/dist/{devices-JWHGWKLK.js → devices-J253LQNQ.js} +2 -2
  73. package/dist/{devices-6ZURNFRB.cjs → devices-ZPVLATZA.cjs} +4 -4
  74. package/dist/index.cjs +7 -9
  75. package/dist/index.js +8 -10
  76. package/dist/{knowledge-CY66JZ54.cjs → knowledge-3FAF5T7Q.cjs} +4 -4
  77. package/dist/{knowledge-TEDPLCFX.js → knowledge-IMTMYURI.js} +2 -2
  78. package/dist/{logs-S46THPPD.js → logs-55GOSGVE.js} +2 -2
  79. package/dist/{logs-MO357RE7.cjs → logs-UL7BQEXP.cjs} +11 -11
  80. package/dist/{policies-BUXT7DKF.js → policies-KRDF563O.js} +2 -2
  81. package/dist/{policies-GSH4K5YP.cjs → policies-O5F2XSCY.cjs} +7 -7
  82. package/dist/{software-update-YKS6KLX2.js → software-update-NXSC4OVM.js} +2 -2
  83. package/dist/{software-update-2ETT35NM.cjs → software-update-R2ASCRWP.cjs} +6 -6
  84. package/dist/utils/index.cjs +17 -18
  85. package/dist/utils/index.js +17 -18
  86. package/dist/utils/source-grouping.d.ts +15 -5
  87. package/dist/utils/source-grouping.d.ts.map +1 -1
  88. package/package.json +1 -1
  89. package/src/components/chat/assistant-ask-prompts.tsx +84 -39
  90. package/src/components/chat/entity-cards/dispatch.tsx +47 -58
  91. package/src/components/chat/hooks/index.ts +3 -2
  92. package/src/components/chat/hooks/use-ask-prompts.ts +140 -56
  93. package/src/components/faq/faq-ask-card.tsx +22 -67
  94. package/src/utils/source-grouping.ts +24 -14
  95. package/src/utils/source-icons.ts +16 -16
@@ -1,21 +1,10 @@
1
1
  'use client';
2
2
 
3
- import { useMemo, useState } from 'react';
4
- import {
5
- AssistantRuntimeContext,
6
- useAssistantRuntime,
7
- type AssistantOpenRequest,
8
- type AssistantRuntime,
9
- } from '../../contexts/assistant-runtime-context';
3
+ import { useState } from 'react';
4
+ import type { AssistantOpenRequest, AssistantRuntime } from '../../contexts/assistant-runtime-context';
10
5
  import { useInView } from '../../hooks/ui/use-in-view';
11
- import { AskCard } from '../chat/ask-prompts';
12
- import {
13
- assistantAvailable,
14
- ASK_PROMPTS_DEFAULT_COUNT,
15
- useAskPrompts,
16
- useAssistantOpen,
17
- useShownAskPromptIds,
18
- } from '../chat/hooks/use-ask-prompts';
6
+ import { AssistantAskPrompts } from '../chat/assistant-ask-prompts';
7
+ import { assistantAvailable } from '../chat/hooks/use-ask-prompts';
19
8
 
20
9
  /** The card beside a FAQ, as a host may shape it. Every field is optional. */
21
10
  export interface FaqAskOptions {
@@ -29,8 +18,7 @@ export interface FaqAskOptions {
29
18
  topic?: string;
30
19
  /**
31
20
  * Ids of questions never to offer. Absent: the ones the page's other "ask"
32
- * surfaces show (`AssistantAskPrompts` rows say so themselves), which the
33
- * card waits for. `null`: wait.
21
+ * surfaces show, which the card waits for. `null`: wait.
34
22
  */
35
23
  exclude?: readonly string[] | null;
36
24
  /** How many questions the card offers. Absent: the runtime's, else three. */
@@ -46,70 +34,37 @@ export interface FaqAskOptions {
46
34
  onOpen?: (request: AssistantOpenRequest) => void;
47
35
  }
48
36
 
49
- /** The lib's own wording, when neither the host nor the runtime states it. */
50
- const DEFAULT_ASK_CARD = {
51
- title: 'Still deciding?',
52
- description: '{assistant} answers from our docs and customer stories.',
53
- } as const;
54
-
55
37
  /** How far below the viewport the card is when it picks its questions. */
56
38
  const PICK_ROOT_MARGIN = '600px';
57
39
 
58
- const fillAssistant = (text: string, name: string) => text.split('{assistant}').join(name);
59
-
60
40
  /** True when a FAQ under this runtime shows the card: a chat to open, and a name for the card's words. */
61
41
  export function faqAskCardShown(assistant: AssistantRuntime | null): assistant is AssistantRuntime {
62
42
  return assistantAvailable(assistant) && !!assistant.name;
63
43
  }
64
44
 
65
45
  /**
66
- * The "ask the assistant" card of a FAQ: the assistant's identity and the
67
- * chat's opener from the nearest assistant runtime, its questions from the
68
- * host's endpoint. It picks ONCE, when the card first comes near the viewport:
69
- * by then the page above has said which questions it shows itself, and a
70
- * visitor who never reaches the FAQ costs no request. The card is the same
71
- * height before and after the questions arrive. A host with no questions
72
- * endpoint gets the launcher with no questions.
46
+ * The "ask the assistant" card of a FAQ: THE ask surface (`AssistantAskPrompts`)
47
+ * as a card, told when to pick. It picks ONCE, when the card first comes near
48
+ * the viewport: a visitor who never reaches the FAQ costs no request, and the
49
+ * card then leaves out every question the page above already shows. The card
50
+ * is the same height before and after the questions arrive.
73
51
  */
74
52
  export function FaqAskCard({ topic, exclude, count, title, description, onOpen }: FaqAskOptions & { topic: string }) {
75
- const assistant = useAssistantRuntime();
76
53
  const { ref, inView } = useInView<HTMLDivElement>({ rootMargin: PICK_ROOT_MARGIN });
77
54
  const [reached, setReached] = useState(false);
78
55
  if (inView && !reached) setReached(true);
79
-
80
- const shownElsewhere = useShownAskPromptIds();
81
- const excluded = exclude === undefined ? shownElsewhere : exclude;
82
- const slots = count ?? assistant?.askCard?.count ?? ASK_PROMPTS_DEFAULT_COUNT;
83
- const { prompts, isLoading, supported } = useAskPrompts({
84
- topic,
85
- count: slots,
86
- exclude: excluded ?? undefined,
87
- enabled: reached && excluded !== null,
88
- });
89
- const open = useAssistantOpen(topic, onOpen);
90
- // The card's launcher opens the same chat as its questions, with the card's topic: it reads the runtime.
91
- const scoped = useMemo(() => (assistant ? { ...assistant, open } : null), [assistant, open]);
92
-
93
- if (!faqAskCardShown(assistant) || !assistant.name) return null;
94
- const name = assistant.name;
95
- const cardDescription = description ?? assistant.askCard?.description ?? DEFAULT_ASK_CARD.description;
96
56
  return (
97
- <AssistantRuntimeContext.Provider value={scoped}>
98
- <div ref={ref}>
99
- <AskCard
100
- title={fillAssistant(title ?? assistant.askCard?.title ?? DEFAULT_ASK_CARD.title, name)}
101
- description={cardDescription ? fillAssistant(cardDescription, name) : undefined}
102
- prompts={prompts}
103
- // Fixed slots, one question per row: chip skeletons until the pick lands, the same box after.
104
- count={supported ? slots : 0}
105
- loading={isLoading}
106
- source={assistant.source}
107
- label={name}
108
- icon={assistant.icon}
109
- onOpen={open}
110
- onAsk={prompt => assistant.onAsk?.({ promptId: prompt.id, topic })}
111
- />
112
- </div>
113
- </AssistantRuntimeContext.Provider>
57
+ <div ref={ref}>
58
+ <AssistantAskPrompts
59
+ variant="card"
60
+ topic={topic}
61
+ count={count}
62
+ exclude={exclude}
63
+ enabled={reached}
64
+ title={title}
65
+ description={description}
66
+ onOpen={onOpen}
67
+ />
68
+ </div>
114
69
  );
115
70
  }
@@ -28,14 +28,23 @@ import { defaultDocumentTypeForTableId, getSourceLabel } from './source-icons';
28
28
  /**
29
29
  * Doc-table documentTypes: whole documents with their own viewer (markdown =
30
30
  * product docs, data_room_doc = data room). They carry an in-app `path`, an
31
- * embedder keys `docPlatformTargets` by them, and they NEVER group: one chip
32
- * per document. The hub's per-source contract test pins this list to its
31
+ * embedder keys `docPlatformTargets` by them, and a server never folds them
32
+ * into one citation (`groupsByTable`); the strip still draws them as one chip
33
+ * per table. The hub's per-source contract test pins this list to its
33
34
  * doc-table configs.
34
35
  */
35
36
  export const DOC_TABLE_TYPES = ['markdown', 'data_room_doc'] as const;
36
37
 
37
- /** THE rule: rows of a knowledge table share one chip unless they are whole
38
- * documents. Decided by `documentType`, the one fact every producer has. */
38
+ /**
39
+ * Which tables a SERVER folds into one citation: rows of a knowledge table
40
+ * share one number (and reach the model as one table) unless they are whole
41
+ * documents, which each keep their own number and are read in full. Decided by
42
+ * `documentType`, the one fact every producer has.
43
+ *
44
+ * This is not the strip's rule. The strip (`groupSourcesByTable`) draws ONE chip
45
+ * per table for every source, documents included: a document keeps its own
46
+ * citation number inside its table's chip.
47
+ */
39
48
  export function groupsByTable(documentType: string | null | undefined): boolean {
40
49
  return !(DOC_TABLE_TYPES as readonly string[]).includes(documentType ?? '');
41
50
  }
@@ -98,16 +107,16 @@ function typeOf(source: TableSource): string {
98
107
  return source.documentType || defaultDocumentTypeForTableId(source.sourceRepo) || '';
99
108
  }
100
109
 
101
- /** A source that belongs to its table's chip: it names its table and is not a
102
- * whole document. Both shapes qualify, a flat row AND a chip the server
103
- * already grouped, so one table is never drawn twice. Naming the table is the
104
- * ONLY requirement: a row with no `id`, or no `documentType`, still joins (as
105
- * the hub's server-side chips do). Leaving it out would split one table
106
- * across a group AND a stray chip. What it lacks only limits its dropdown
107
- * row: no `id` or no type means Open-only, no Ask. */
110
+ /** A source that belongs to its table's chip: it names its table. Whole
111
+ * documents join their table's chip like every other record (each keeps its
112
+ * own citation number as a dropdown row). Both shapes qualify, a flat row AND
113
+ * a chip the server already grouped, so one table is never drawn twice.
114
+ * Naming the table is the ONLY requirement: a row with no `id`, or no
115
+ * `documentType`, still joins (as the hub's server-side chips do). Leaving it
116
+ * out would split one table across a group AND a stray chip. What it lacks
117
+ * only limits its dropdown row: no `id` or no type means Open-only, no Ask. */
108
118
  function joinsTableChip(source: ChatSource): source is TableSource {
109
- if (!source.sourceRepo) return false;
110
- return groupsByTable(typeOf({ ...source, sourceRepo: source.sourceRepo }));
119
+ return !!source.sourceRepo;
111
120
  }
112
121
 
113
122
  /** A source's dropdown rows: a grouped chip's own items, or the flat row itself. */
@@ -154,7 +163,8 @@ function uniqueRows(rows: GroupedSourceRow[]): GroupedSourceRow[] {
154
163
  * table's only source. When flat rows of the same table arrive beside it (a
155
164
  * hub-injected chip plus MCP-cited rows in one answer), they merge into it:
156
165
  * its rows first, its chip-level link kept, the count restated. Whole
157
- * documents and rows naming no table pass through as their own chips.
166
+ * documents group under their table too, each row keeping its own citation
167
+ * number; only a row naming no table passes through as its own chip.
158
168
  */
159
169
  export function groupSourcesByTable(sources: ChatSource[]): ChatSource[] {
160
170
  const membersByTable = new Map<string, TableSource[]>();
@@ -64,11 +64,11 @@ export const SOURCE_ICON_NAMES: Record<string, string> = {
64
64
 
65
65
  // Financials
66
66
  'investor-updates': 'mail',
67
- 'financial-kpis': 'activity',
68
- 'financial-cap-table': 'table',
69
- 'financial-pnl': 'trending-up',
70
- 'financial-balance-sheet': 'dollar-sign',
71
- 'financial-cash-flow': 'banknote',
67
+ 'financial-kpis': 'chart-bar-01-ver',
68
+ 'financial-cap-table': 'chart-pie',
69
+ 'financial-pnl': 'money-bill-dollar',
70
+ 'financial-balance-sheet': 'bank',
71
+ 'financial-cash-flow': 'coins-exchange-currency',
72
72
 
73
73
  // ClickUp
74
74
  'clickup-roadmap': 'clickup',
@@ -92,24 +92,24 @@ export const SOURCE_ICON_NAMES: Record<string, string> = {
92
92
  'slack-messages': 'slack',
93
93
 
94
94
  // People-hub employee content
95
- 'what-i-shipped': 'package',
96
- 'how-i-work': 'book-open',
97
- 'ai-prompts': 'message-square',
95
+ 'what-i-shipped': 'rocket-02',
96
+ 'how-i-work': 'clipboard-list',
97
+ 'ai-prompts': 'chat-quote',
98
98
 
99
99
  // Product-hub internal
100
100
  'design-docs': 'file-text',
101
101
  'openframe-tenants': 'openframe',
102
- 'prospect-calls': 'phone',
102
+ 'prospect-calls': 'call',
103
103
 
104
104
  // Code intelligence
105
- 'code-rules': 'check-square',
106
- 'code-graph-repos': 'github',
105
+ 'code-rules': 'bracket-curly-check',
106
+ 'code-graph-repos': 'coding-branch',
107
107
  'code-graph-deployments': 'package',
108
- 'code-graph-files': 'file-text',
109
- 'code-symbols': 'box',
110
- 'code-duplicates': 'search',
111
- 'code-impact': 'activity',
112
- 'change-sets': 'coding-branch',
108
+ 'code-graph-files': 'file-code',
109
+ 'code-symbols': 'code-square',
110
+ 'code-duplicates': 'copy-01',
111
+ 'code-impact': 'coding-pull-request',
112
+ 'change-sets': 'coding-merge',
113
113
  };
114
114
 
115
115
  /** Lookup an icon name by RagTableConfig.id. Returns undefined when