@flamingo-stack/openframe-frontend-core 0.0.828 → 0.0.830
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/build/export-map.json +1 -1
- package/dist/{chunk-DU6AF77X.cjs → chunk-2BGLALP5.cjs} +14 -14
- package/dist/{chunk-QMQWXGCH.cjs → chunk-56EP4QM2.cjs} +29 -25
- package/dist/{chunk-4ZH7RPEA.cjs → chunk-5KSPG3TV.cjs} +388 -388
- package/dist/{chunk-BGT6JFMP.cjs → chunk-5LED4QHZ.cjs} +527 -434
- package/dist/{chunk-6ZLCEIIC.cjs → chunk-CAGQAMJ6.cjs} +23 -23
- package/dist/{chunk-ALRX2VIY.cjs → chunk-D2LXFMZI.cjs} +26 -26
- package/dist/{chunk-VAIML6YU.cjs → chunk-DUGOOTER.cjs} +13 -13
- package/dist/{chunk-XPF74L76.cjs → chunk-E6W4YDPS.cjs} +2 -2
- package/dist/{chunk-UULSSD56.cjs → chunk-FFFN4IY2.cjs} +5 -5
- package/dist/{chunk-UWGPYAB3.cjs → chunk-HYCMMECU.cjs} +51 -51
- package/dist/{chunk-DR4P7AEU.cjs → chunk-HYGWRUEM.cjs} +3 -3
- package/dist/chunk-IX2E3AN7.cjs +77 -0
- package/dist/{chunk-YKUL6JBI.cjs → chunk-M75723HD.cjs} +46 -34
- package/dist/{chunk-RPKWEBHC.cjs → chunk-PUXYAHH3.cjs} +3 -3
- package/dist/{chunk-3B6ZE4EZ.cjs → chunk-QTLWU6FY.cjs} +5 -5
- package/dist/{chunk-3WKQ2GCR.cjs → chunk-RRPID7Z7.cjs} +6 -8
- package/dist/{chunk-6SFCI6D4.cjs → chunk-SAW7V7CU.cjs} +14 -16
- package/dist/{chunk-B5H7RKFF.cjs → chunk-TUMSVFVS.cjs} +4 -4
- package/dist/{chunk-7VC5FVWT.cjs → chunk-ULF4ZOUM.cjs} +65 -65
- package/dist/{chunk-ZT7JHN7G.cjs → chunk-WCCE4WF3.cjs} +57 -62
- package/dist/{chunk-7PZQ7SHB.cjs → chunk-WWDNLMB7.cjs} +16 -16
- package/dist/{chunk-K6X7VP2Y.cjs → chunk-WZYBUJJG.cjs} +43 -43
- package/dist/{chunk-SVCTAOJR.cjs → chunk-X425BGXS.cjs} +2 -2
- package/dist/{chunk-BIG3O33P.cjs → chunk-YJZ7R3W5.cjs} +28 -2
- package/dist/{cloud-tenants-LKTWIZNS.cjs → cloud-tenants-4KQQPXPM.cjs} +12 -11
- package/dist/components/case-studies/index.cjs +24 -23
- package/dist/components/chat/assistant-ask-prompts.d.ts +5 -1
- package/dist/components/chat/assistant-ask-prompts.d.ts.map +1 -1
- package/dist/components/chat/assistant-ask-prompts.js +3 -1
- package/dist/components/chat/embeddable-chat.d.ts +3 -3
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.js +22 -14
- package/dist/components/chat/guide-welcome.d.ts +14 -16
- package/dist/components/chat/guide-welcome.d.ts.map +1 -1
- package/dist/components/chat/guide-welcome.js +9 -24
- package/dist/components/chat/hooks/use-empty-state-config.d.ts +13 -3
- package/dist/components/chat/hooks/use-empty-state-config.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-empty-state-config.js +10 -2
- package/dist/components/chat/index.cjs +13 -5
- package/dist/components/chat/mingo-quick-action-wall.d.ts +42 -16
- package/dist/components/chat/mingo-quick-action-wall.d.ts.map +1 -1
- package/dist/components/chat/mingo-quick-action-wall.js +105 -19
- package/dist/components/chat/mingo-welcome.d.ts +6 -13
- package/dist/components/chat/mingo-welcome.d.ts.map +1 -1
- package/dist/components/chat/mingo-welcome.js +5 -9
- package/dist/components/chat/quick-action-chip.d.ts +8 -2
- package/dist/components/chat/quick-action-chip.d.ts.map +1 -1
- package/dist/components/chat/quick-action-chip.js +18 -8
- package/dist/components/contact/index.cjs +13 -12
- package/dist/components/docs/index.cjs +16 -15
- package/dist/components/embeds/index.cjs +13 -12
- package/dist/components/faq/faq-ask-card.d.ts +2 -13
- package/dist/components/faq/faq-ask-card.d.ts.map +1 -1
- package/dist/components/faq/faq-ask-card.js +1 -2
- package/dist/components/faq/faq-document-page.d.ts +2 -4
- package/dist/components/faq/faq-document-page.d.ts.map +1 -1
- package/dist/components/faq/faq-document-page.js +0 -2
- package/dist/components/faq/faq-section.d.ts +16 -29
- package/dist/components/faq/faq-section.d.ts.map +1 -1
- package/dist/components/faq/faq-section.js +23 -15
- package/dist/components/faq/index.cjs +14 -13
- package/dist/components/faq/index.d.ts +1 -1
- package/dist/components/faq/index.d.ts.map +1 -1
- package/dist/components/faq/index.js +2 -2
- package/dist/components/features/index.cjs +12 -11
- package/dist/components/help-center-pages/delivery-page.d.ts +1 -8
- package/dist/components/help-center-pages/delivery-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/delivery-page.js +4 -16
- package/dist/components/help-center-pages/download-apps-page.d.ts +1 -8
- package/dist/components/help-center-pages/download-apps-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/download-apps-page.js +3 -4
- package/dist/components/help-center-pages/index.cjs +123 -171
- package/dist/components/help-center-pages/onboarding-guides-catalog-page.d.ts +1 -8
- package/dist/components/help-center-pages/onboarding-guides-catalog-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/onboarding-guides-catalog-page.js +14 -26
- package/dist/components/help-center-pages/product-releases-list-page.d.ts +1 -8
- package/dist/components/help-center-pages/product-releases-list-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/product-releases-list-page.js +12 -24
- package/dist/components/help-center-pages/roadmap-page.d.ts +1 -8
- package/dist/components/help-center-pages/roadmap-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/roadmap-page.js +13 -25
- package/dist/components/help-center-pages/trust-center-page.d.ts +1 -1
- package/dist/components/help-center-pages/trust-center-page.d.ts.map +1 -1
- package/dist/components/index.cjs +58 -49
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/meeting-scheduler/index.cjs +50 -49
- package/dist/components/navigation/index.cjs +15 -14
- package/dist/components/onboarding-guides/index.cjs +14 -13
- package/dist/components/page-topic-label.d.ts +13 -0
- package/dist/components/page-topic-label.d.ts.map +1 -0
- package/dist/components/page-topic-label.js +20 -0
- package/dist/components/product-demo/index.cjs +23 -22
- package/dist/components/shared/dev-section/dev-section-page.d.ts +1 -8
- package/dist/components/shared/dev-section/dev-section-page.d.ts.map +1 -1
- package/dist/components/shared/dev-section/dev-section-page.js +2 -3
- package/dist/components/shared/legal-document/legal-document-page.d.ts +2 -10
- package/dist/components/shared/legal-document/legal-document-page.d.ts.map +1 -1
- package/dist/components/shared/legal-document/legal-document-page.js +2 -5
- package/dist/components/shared/legal-document/use-legal-documents.d.ts +0 -2
- package/dist/components/shared/legal-document/use-legal-documents.d.ts.map +1 -1
- package/dist/components/shared/legal-document/use-legal-documents.js +0 -1
- package/dist/components/tickets/index.cjs +17 -16
- package/dist/components/ui/actions-menu.d.ts.map +1 -1
- package/dist/components/ui/actions-menu.js +27 -1
- package/dist/components/ui/index.cjs +18 -11
- package/dist/contexts/endpoints-runtime-context.d.ts +5 -0
- package/dist/contexts/endpoints-runtime-context.d.ts.map +1 -1
- package/dist/contexts/index.cjs +10 -1
- package/dist/contexts/index.d.ts +1 -0
- package/dist/contexts/index.d.ts.map +1 -1
- package/dist/contexts/index.js +4 -0
- package/dist/contexts/page-topics-context.d.ts +30 -0
- package/dist/contexts/page-topics-context.d.ts.map +1 -0
- package/dist/contexts/page-topics-context.js +27 -0
- package/dist/{devices-JWG72ANF.cjs → devices-H6C4NMIY.cjs} +13 -12
- package/dist/{embeddable-chat-5UT6UHEO.cjs → embeddable-chat-KUESE7P6.cjs} +107 -97
- package/dist/hooks/index.cjs +3 -3
- package/dist/index.cjs +33 -15
- package/dist/{knowledge-DQXVSHME.cjs → knowledge-O6IBO5Y5.cjs} +13 -12
- package/dist/{logs-Z33VBTVX.cjs → logs-Y2UCF24Z.cjs} +19 -18
- package/dist/{policies-XE4UMH6Z.cjs → policies-J6O3RLJT.cjs} +16 -15
- package/dist/{remote-session-QGFG5WAL.cjs → remote-session-RVTFWSU4.cjs} +5 -5
- package/dist/{scripts-MECQG5GG.cjs → scripts-N67MM4T2.cjs} +19 -18
- package/dist/{software-update-PCSIA6BP.cjs → software-update-HB7F6KNG.cjs} +16 -15
- package/dist/{tickets-board-KCH6ITUV.cjs → tickets-board-2K3PBCNW.cjs} +8 -8
- package/dist/utils/index.cjs +46 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +12 -0
- package/dist/utils/page-topics.cjs +48 -0
- package/dist/utils/page-topics.d.ts +34 -0
- package/dist/utils/page-topics.d.ts.map +1 -0
- package/dist/utils/page-topics.js +46 -0
- package/package.json +7 -1
- package/src/components/chat/assistant-ask-prompts.tsx +8 -2
- package/src/components/chat/embeddable-chat.tsx +32 -45
- package/src/components/chat/guide-welcome.tsx +28 -49
- package/src/components/chat/hooks/use-empty-state-config.ts +22 -5
- package/src/components/chat/mingo-quick-action-wall.tsx +166 -31
- package/src/components/chat/mingo-welcome.tsx +16 -35
- package/src/components/chat/quick-action-chip.tsx +32 -8
- package/src/components/faq/faq-ask-card.tsx +2 -12
- package/src/components/faq/faq-document-page.tsx +1 -5
- package/src/components/faq/faq-section.tsx +47 -50
- package/src/components/faq/index.ts +1 -2
- package/src/components/help-center-pages/delivery-page.tsx +1 -16
- package/src/components/help-center-pages/download-apps-page.tsx +2 -9
- package/src/components/help-center-pages/onboarding-guides-catalog-page.tsx +1 -16
- package/src/components/help-center-pages/product-releases-list-page.tsx +1 -16
- package/src/components/help-center-pages/roadmap-page.tsx +1 -16
- package/src/components/help-center-pages/trust-center-page.tsx +1 -1
- package/src/components/index.ts +1 -0
- package/src/components/page-topic-label.tsx +30 -0
- package/src/components/shared/dev-section/dev-section-page.tsx +2 -9
- package/src/components/shared/legal-document/legal-document-page.tsx +3 -13
- package/src/components/shared/legal-document/use-legal-documents.ts +0 -3
- package/src/components/ui/actions-menu.tsx +35 -1
- package/src/contexts/endpoints-runtime-context.tsx +5 -0
- package/src/contexts/index.ts +1 -0
- package/src/contexts/page-topics-context.tsx +68 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/page-topics.ts +81 -0
- package/dist/{chunk-IKWQW3YJ.cjs → chunk-AY6XJOIN.cjs} +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAK1B,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,qBAAqB,GACtB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACnG,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,EAC5B,yBAAyB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,GACpC,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,2DAA2D,CAAC;AAC3F,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,aAAa,EAClB,WAAW,EACX,oBAAoB,EACpB,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM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AK7B,cAAc,qBAAqB,CAAC;AAEpC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,eAAe,CAAC;AAE9B,cAAc,OAAO,CAAC;AAEtB,cAAc,oBAAoB,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMhH,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,UAAU,EACV,aAAa,GACd,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGjG,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/utils/index.js
CHANGED
|
@@ -218,6 +218,13 @@ import {
|
|
|
218
218
|
import { findAnchorElementByNormalizedId, normalizeAnchorId } from "./anchor-id.js";
|
|
219
219
|
import { buildListUrl, canonicalContentRefType } from "./list-url.js";
|
|
220
220
|
import { faqSectionSlug, faqItemAnchor, parseFaqHash } from "./faq-anchor.js";
|
|
221
|
+
import {
|
|
222
|
+
deepestTopic,
|
|
223
|
+
isPagePathTopic,
|
|
224
|
+
pageTopicFor,
|
|
225
|
+
topicCandidates,
|
|
226
|
+
topicMatchesPath
|
|
227
|
+
} from "./page-topics.js";
|
|
221
228
|
import {
|
|
222
229
|
CONTENT_REF_GROUPS,
|
|
223
230
|
GROUP_PAGE_SIZE,
|
|
@@ -325,6 +332,7 @@ export {
|
|
|
325
332
|
createSseSubscription,
|
|
326
333
|
createUTCTimestamp,
|
|
327
334
|
deepClone,
|
|
335
|
+
deepestTopic,
|
|
328
336
|
delay,
|
|
329
337
|
deriveActiveColor,
|
|
330
338
|
deriveHoverColor,
|
|
@@ -422,6 +430,7 @@ export {
|
|
|
422
430
|
isOpenFrameClassification,
|
|
423
431
|
isOrderedRange,
|
|
424
432
|
isOwnClick,
|
|
433
|
+
isPagePathTopic,
|
|
425
434
|
isScrollSyncedHash,
|
|
426
435
|
isToday,
|
|
427
436
|
isWithinMinutes,
|
|
@@ -433,6 +442,7 @@ export {
|
|
|
433
442
|
normalizeIconKey,
|
|
434
443
|
openInNewTab,
|
|
435
444
|
orderContentRefTypes,
|
|
445
|
+
pageTopicFor,
|
|
436
446
|
parseFaqHash,
|
|
437
447
|
parseScrollAnchor,
|
|
438
448
|
parseWireCommandOverride,
|
|
@@ -461,6 +471,8 @@ export {
|
|
|
461
471
|
stripHtml,
|
|
462
472
|
switchPlatformTheme,
|
|
463
473
|
titleCaseFromSlug,
|
|
474
|
+
topicCandidates,
|
|
475
|
+
topicMatchesPath,
|
|
464
476
|
trialLabels,
|
|
465
477
|
trialLengthLabel,
|
|
466
478
|
truncateString,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/utils/page-topics.ts
|
|
4
|
+
var HOME_PATH = "/";
|
|
5
|
+
function decodeSegment(segment) {
|
|
6
|
+
try {
|
|
7
|
+
return decodeURIComponent(segment);
|
|
8
|
+
} catch {
|
|
9
|
+
return segment;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function normalizePath(pathname) {
|
|
13
|
+
const segments = (pathname.split(/[?#]/)[0] ?? "").split("/").filter(Boolean).map((segment) => decodeSegment(segment).toLowerCase());
|
|
14
|
+
return segments.length === 0 ? HOME_PATH : `/${segments.join("/")}`;
|
|
15
|
+
}
|
|
16
|
+
function pageTopicFor(pathname, options = {}) {
|
|
17
|
+
const path = normalizePath(pathname);
|
|
18
|
+
const base = options.basePath ? normalizePath(options.basePath) : HOME_PATH;
|
|
19
|
+
if (base === HOME_PATH) return path;
|
|
20
|
+
if (path === base) return HOME_PATH;
|
|
21
|
+
return path.startsWith(`${base}/`) ? path.slice(base.length) : path;
|
|
22
|
+
}
|
|
23
|
+
function isPagePathTopic(tag) {
|
|
24
|
+
return tag.startsWith(HOME_PATH);
|
|
25
|
+
}
|
|
26
|
+
function topicMatchesPath(tag, path) {
|
|
27
|
+
if (!isPagePathTopic(tag)) return tag === path;
|
|
28
|
+
if (tag === HOME_PATH || path === HOME_PATH) return tag === path;
|
|
29
|
+
return path === tag || path.startsWith(`${tag}/`);
|
|
30
|
+
}
|
|
31
|
+
function topicCandidates(path) {
|
|
32
|
+
if (!isPagePathTopic(path) || path === HOME_PATH) return [path];
|
|
33
|
+
const segments = path.split("/").filter(Boolean);
|
|
34
|
+
return segments.map((_, i) => `/${segments.slice(0, segments.length - i).join("/")}`);
|
|
35
|
+
}
|
|
36
|
+
function deepestTopic(tags, path) {
|
|
37
|
+
let best = null;
|
|
38
|
+
for (const tag of tags) {
|
|
39
|
+
if (topicMatchesPath(tag, path) && (best === null || tag.length > best.length)) best = tag;
|
|
40
|
+
}
|
|
41
|
+
return best;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
exports.deepestTopic = deepestTopic;
|
|
45
|
+
exports.isPagePathTopic = isPagePathTopic;
|
|
46
|
+
exports.pageTopicFor = pageTopicFor;
|
|
47
|
+
exports.topicCandidates = topicCandidates;
|
|
48
|
+
exports.topicMatchesPath = topicMatchesPath;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE topic of a page is its own path: one rule for every surface that offers
|
|
3
|
+
* something "for this page" (the FAQ block, its "ask the assistant" card, the
|
|
4
|
+
* chat's quick actions). No host keeps a route to topic map: FAQs and quick
|
|
5
|
+
* actions are tagged with the paths of the pages they are written for.
|
|
6
|
+
*
|
|
7
|
+
* - A page asks with its path: query and hash dropped, trailing slash dropped,
|
|
8
|
+
* lowercased, decoded (`/Blog/My-Post/?x` asks `/blog/my-post`).
|
|
9
|
+
* - A host that mounts the hub's pages under a path states it (`basePath`):
|
|
10
|
+
* `/help-center/roadmap` asks `/roadmap`, the hub page it mirrors. A path
|
|
11
|
+
* outside the mount is asked as it is (`/devices`).
|
|
12
|
+
* - A tag is written for a page when it is the page's path or a parent of it
|
|
13
|
+
* (`/blog` is written for `/blog` and `/blog/my-post`); `/` only for the home
|
|
14
|
+
* page. A page takes its DEEPEST matching tag (`deepestTopic`), so a record
|
|
15
|
+
* page shares its list page's topic until something is tagged for it alone.
|
|
16
|
+
*
|
|
17
|
+
* A zero-import leaf: a server read and the browser resolve through the same
|
|
18
|
+
* functions.
|
|
19
|
+
*/
|
|
20
|
+
export interface PageTopicOptions {
|
|
21
|
+
/** Where the host mounts the hub's pages (`/help-center`): a path under it is asked without it. */
|
|
22
|
+
basePath?: string;
|
|
23
|
+
}
|
|
24
|
+
/** The topic the page at `pathname` asks with: its path, without the host's mount. */
|
|
25
|
+
export declare function pageTopicFor(pathname: string, options?: PageTopicOptions): string;
|
|
26
|
+
/** Whether a tag names a page (a path), as opposed to a section of a page (a word). */
|
|
27
|
+
export declare function isPagePathTopic(tag: string): boolean;
|
|
28
|
+
/** Whether `tag` is written for the page at `path` (`pageTopicFor`'s answer): the path itself or a parent of it. */
|
|
29
|
+
export declare function topicMatchesPath(tag: string, path: string): boolean;
|
|
30
|
+
/** Every tag that can be written for the page at `path`, deepest first: what a host queries its rows by. */
|
|
31
|
+
export declare function topicCandidates(path: string): string[];
|
|
32
|
+
/** The deepest of `tags` written for the page at `path`, or null when none is. */
|
|
33
|
+
export declare function deepestTopic(tags: Iterable<string>, path: string): string | null;
|
|
34
|
+
//# sourceMappingURL=page-topics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-topics.d.ts","sourceRoot":"","sources":["../../src/utils/page-topics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAsBH,MAAM,WAAW,gBAAgB;IAC/B,mGAAmG;IACnG,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,MAAM,CAMrF;AAED,uFAAuF;AACvF,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,oHAAoH;AACpH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAInE;AAED,4GAA4G;AAC5G,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAItD;AAED,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMhF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const HOME_PATH = "/";
|
|
2
|
+
function decodeSegment(segment) {
|
|
3
|
+
try {
|
|
4
|
+
return decodeURIComponent(segment);
|
|
5
|
+
} catch {
|
|
6
|
+
return segment;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function normalizePath(pathname) {
|
|
10
|
+
const segments = (pathname.split(/[?#]/)[0] ?? "").split("/").filter(Boolean).map((segment) => decodeSegment(segment).toLowerCase());
|
|
11
|
+
return segments.length === 0 ? HOME_PATH : `/${segments.join("/")}`;
|
|
12
|
+
}
|
|
13
|
+
function pageTopicFor(pathname, options = {}) {
|
|
14
|
+
const path = normalizePath(pathname);
|
|
15
|
+
const base = options.basePath ? normalizePath(options.basePath) : HOME_PATH;
|
|
16
|
+
if (base === HOME_PATH) return path;
|
|
17
|
+
if (path === base) return HOME_PATH;
|
|
18
|
+
return path.startsWith(`${base}/`) ? path.slice(base.length) : path;
|
|
19
|
+
}
|
|
20
|
+
function isPagePathTopic(tag) {
|
|
21
|
+
return tag.startsWith(HOME_PATH);
|
|
22
|
+
}
|
|
23
|
+
function topicMatchesPath(tag, path) {
|
|
24
|
+
if (!isPagePathTopic(tag)) return tag === path;
|
|
25
|
+
if (tag === HOME_PATH || path === HOME_PATH) return tag === path;
|
|
26
|
+
return path === tag || path.startsWith(`${tag}/`);
|
|
27
|
+
}
|
|
28
|
+
function topicCandidates(path) {
|
|
29
|
+
if (!isPagePathTopic(path) || path === HOME_PATH) return [path];
|
|
30
|
+
const segments = path.split("/").filter(Boolean);
|
|
31
|
+
return segments.map((_, i) => `/${segments.slice(0, segments.length - i).join("/")}`);
|
|
32
|
+
}
|
|
33
|
+
function deepestTopic(tags, path) {
|
|
34
|
+
let best = null;
|
|
35
|
+
for (const tag of tags) {
|
|
36
|
+
if (topicMatchesPath(tag, path) && (best === null || tag.length > best.length)) best = tag;
|
|
37
|
+
}
|
|
38
|
+
return best;
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
deepestTopic,
|
|
42
|
+
isPagePathTopic,
|
|
43
|
+
pageTopicFor,
|
|
44
|
+
topicCandidates,
|
|
45
|
+
topicMatchesPath
|
|
46
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flamingo-stack/openframe-frontend-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.830",
|
|
4
4
|
"description": "Shared design system and components for all Flamingo platforms",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -281,6 +281,12 @@
|
|
|
281
281
|
"require": "./dist/utils/form-rescue.cjs",
|
|
282
282
|
"default": "./dist/utils/form-rescue.js"
|
|
283
283
|
},
|
|
284
|
+
"./utils/page-topics": {
|
|
285
|
+
"types": "./dist/utils/page-topics.d.ts",
|
|
286
|
+
"import": "./dist/utils/page-topics.js",
|
|
287
|
+
"require": "./dist/utils/page-topics.cjs",
|
|
288
|
+
"default": "./dist/utils/page-topics.js"
|
|
289
|
+
},
|
|
284
290
|
"./utils/mobile-app": {
|
|
285
291
|
"types": "./dist/utils/mobile-app.d.ts",
|
|
286
292
|
"import": "./dist/utils/mobile-app.js",
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
useAssistantRuntime,
|
|
6
6
|
type AssistantOpenRequest,
|
|
7
7
|
} from '../../contexts/assistant-runtime-context';
|
|
8
|
+
import { usePageTopic } from '../../contexts/page-topics-context';
|
|
8
9
|
import { AskCard, AskPrompts, type AskPromptsProps } from './ask-prompts';
|
|
9
10
|
import { assistantAvailable, ASK_PROMPTS_DEFAULT_COUNT, useAskSurface } from './hooks/use-ask-prompts';
|
|
10
11
|
|
|
@@ -23,7 +24,11 @@ export interface AssistantAskPromptsProps extends Pick<AskPromptsProps, 'align'
|
|
|
23
24
|
* questions (a FAQ), with a title, a line of description and the launcher.
|
|
24
25
|
*/
|
|
25
26
|
variant?: 'row' | 'card';
|
|
26
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* A topic of the surface's OWN (a page section with a topic of its own, such
|
|
29
|
+
* as one row of questions). Absent: the page's topic, read from its address
|
|
30
|
+
* (`usePageTopic`), as every other surface of the page uses.
|
|
31
|
+
*/
|
|
27
32
|
topic?: string;
|
|
28
33
|
/** How many questions it offers: the same number of slots on every load. Absent: three (a card: the runtime's, else three). */
|
|
29
34
|
count?: number;
|
|
@@ -78,7 +83,8 @@ export function AssistantAskPrompts({
|
|
|
78
83
|
const card = variant === 'card';
|
|
79
84
|
const assistant = useAssistantRuntime();
|
|
80
85
|
const slots = count ?? (card ? assistant?.askCard?.count : undefined) ?? ASK_PROMPTS_DEFAULT_COUNT;
|
|
81
|
-
const
|
|
86
|
+
const pageTopic = usePageTopic();
|
|
87
|
+
const ask = useAskSurface({ topic: topic ?? pageTopic, count: slots, exclude, enabled, onOpen });
|
|
82
88
|
if (!assistantAvailable(assistant)) return null;
|
|
83
89
|
|
|
84
90
|
const shared = {
|
|
@@ -399,13 +399,10 @@ export interface EmbeddableChatProps {
|
|
|
399
399
|
* extra `quickActions` chips.
|
|
400
400
|
* Each field falls back to the built-in OpenFrame defaults, so the kit
|
|
401
401
|
* stays platform-agnostic. `onStartGuideChat` and `hasExistingChats` are
|
|
402
|
-
* wired internally and are NOT overridable here.
|
|
403
|
-
*
|
|
402
|
+
* wired internally and are NOT overridable here. A quick action's click is wired internally too: it puts the
|
|
403
|
+
* action's prompt into the composer to edit and send, then calls the action's own `onClick` (e.g. analytics).
|
|
404
404
|
*/
|
|
405
|
-
mingoWelcome?: Omit<
|
|
406
|
-
MingoWelcomeProps,
|
|
407
|
-
'onStartGuideChat' | 'hasExistingChats' | 'onQuickActionHover' | 'onQuickActionHoverEnd'
|
|
408
|
-
>;
|
|
405
|
+
mingoWelcome?: Omit<MingoWelcomeProps, 'onStartGuideChat' | 'hasExistingChats'>;
|
|
409
406
|
|
|
410
407
|
/**
|
|
411
408
|
* The host's conversation page size: how many dialogs one page of the list
|
|
@@ -1271,11 +1268,20 @@ function EmbeddableChatInner({
|
|
|
1271
1268
|
|
|
1272
1269
|
// Imperative handle to the chat input.
|
|
1273
1270
|
const chatInputRef = useRef<ChatInputRef | null>(null);
|
|
1274
|
-
//
|
|
1275
|
-
//
|
|
1276
|
-
//
|
|
1277
|
-
// draft
|
|
1278
|
-
const
|
|
1271
|
+
// A quick action (a starter) puts its prompt into the composer to edit and send, the way support prompts that
|
|
1272
|
+
// start a conversation work (AWS Cloudscape, "support prompts"): nothing is sent on the click. It never loses what
|
|
1273
|
+
// the user typed: an empty composer, or one holding only the prompt a quick action put there, takes the new prompt;
|
|
1274
|
+
// a draft of the user's own keeps its text and gets the prompt after it.
|
|
1275
|
+
const insertedPromptRef = useRef<string | null>(null);
|
|
1276
|
+
const insertQuickAction = useCallback((prompt: string) => {
|
|
1277
|
+
const input = chatInputRef.current;
|
|
1278
|
+
if (!input) return;
|
|
1279
|
+
const draft = input.getValue().trim();
|
|
1280
|
+
const next = draft === '' || draft === insertedPromptRef.current ? prompt : `${draft}\n\n${prompt}`;
|
|
1281
|
+
insertedPromptRef.current = next;
|
|
1282
|
+
input.setValue(next);
|
|
1283
|
+
input.focus();
|
|
1284
|
+
}, []);
|
|
1279
1285
|
|
|
1280
1286
|
// The slash-command registry (Guide onboarding cards) is loaded via
|
|
1281
1287
|
// react-query below, after `activeMode` is resolved — gated on Guide mode and
|
|
@@ -2117,16 +2123,6 @@ function EmbeddableChatInner({
|
|
|
2117
2123
|
// Guide-mode empty state (no open conversation) — drives the "Mingo Guide"
|
|
2118
2124
|
// header, the guide banner, and the GuideWelcome content branch.
|
|
2119
2125
|
const isGuideEmpty = !hasConversation && activeMode === 'guide';
|
|
2120
|
-
// Quick-action chips exist in BOTH empty states (Guide onboarding + Mingo
|
|
2121
|
-
// welcome). If the chip row goes away (a message is sent, or the mode
|
|
2122
|
-
// switches) while a chip is still hovered, drop the in-flight preview so it
|
|
2123
|
-
// can't leak into the next composer state.
|
|
2124
|
-
const isQuickActionEmpty = !hasConversation && (activeMode === 'guide' || activeMode === 'mingo');
|
|
2125
|
-
// Dropped while rendering, not from an effect: the composer reads
|
|
2126
|
-
// `quickActionPreview` in THIS render, so an effect committed one frame with
|
|
2127
|
-
// the hovered chip's prompt still ghosted into a composer whose chip row had
|
|
2128
|
-
// already gone. Guarded, so the extra render pass takes the early exit.
|
|
2129
|
-
if (!isQuickActionEmpty && quickActionPreview !== null) setQuickActionPreview(null);
|
|
2130
2126
|
// The guide-empty back-chevron returns to Mingo — only offer it when Mingo
|
|
2131
2127
|
// mode actually exists to return to (guide is normally entered from Mingo).
|
|
2132
2128
|
const guideCanReturnToMingo = isGuideEmpty && hasMingoMode;
|
|
@@ -2876,15 +2872,15 @@ function EmbeddableChatInner({
|
|
|
2876
2872
|
// the new-user compose surface: greeting + grid + promo +
|
|
2877
2873
|
// primary Guide chip.
|
|
2878
2874
|
hasExistingChats={false}
|
|
2879
|
-
//
|
|
2880
|
-
//
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2875
|
+
// A quick action puts its prompt into the composer to edit and send (`insertQuickAction`), then runs
|
|
2876
|
+
// the host's own click. Wired after the `{...mingoWelcome}` spread so nothing is sent from here.
|
|
2877
|
+
quickActions={mingoWelcome?.quickActions?.map(action => ({
|
|
2878
|
+
...action,
|
|
2879
|
+
onClick: () => {
|
|
2880
|
+
insertQuickAction(action.prompt ?? action.label);
|
|
2881
|
+
action.onClick?.();
|
|
2882
|
+
},
|
|
2883
|
+
}))}
|
|
2888
2884
|
/>
|
|
2889
2885
|
) : (
|
|
2890
2886
|
/* Figma node 7532:328214 — Guide-mode empty state: greeting
|
|
@@ -2897,6 +2893,9 @@ function EmbeddableChatInner({
|
|
|
2897
2893
|
// While the admin greeting is still being fetched, render a
|
|
2898
2894
|
// subtitle skeleton instead of flashing empty → text.
|
|
2899
2895
|
subtitleLoading={emptyStateLoading}
|
|
2896
|
+
// The page's topic is read with the empty state: the chip wall
|
|
2897
|
+
// draws its loading form until that topic's chips land.
|
|
2898
|
+
quickActionsLoading={!!emptyStateUrl && emptyStateLoading}
|
|
2900
2899
|
{...guideWelcome}
|
|
2901
2900
|
// Agent identity (name → title, icon → empty-state glyph)
|
|
2902
2901
|
// wins over the host `guideWelcome` spread + built-in
|
|
@@ -2919,20 +2918,8 @@ function EmbeddableChatInner({
|
|
|
2919
2918
|
? guideSuggestedActions
|
|
2920
2919
|
: (guideWelcome?.quickActions ?? guideSuggestedActions)
|
|
2921
2920
|
}
|
|
2922
|
-
//
|
|
2923
|
-
onQuickAction={action =>
|
|
2924
|
-
setQuickActionPreview(null);
|
|
2925
|
-
handleSend(action.prompt ?? action.label);
|
|
2926
|
-
}}
|
|
2927
|
-
// Hover/focus PREVIEWS the action's full prompt as ghost text
|
|
2928
|
-
// in the empty composer (the chip label is short; this reveals
|
|
2929
|
-
// what will be sent). Declarative + non-destructive — see
|
|
2930
|
-
// `quickActionPreview` / `ChatInput.previewText`.
|
|
2931
|
-
onQuickActionHover={action => setQuickActionPreview(action.prompt ?? action.label)}
|
|
2932
|
-
onQuickActionHoverEnd={() => setQuickActionPreview(null)}
|
|
2933
|
-
// In agent mode a built-in agent (fae/mingo) caps the wall at
|
|
2934
|
-
// 2 rows; host/guide mode (no active agent) keeps the default.
|
|
2935
|
-
agentSlug={activeAgentSlug}
|
|
2921
|
+
// A quick action puts its prompt into the composer to edit and send.
|
|
2922
|
+
onQuickAction={action => insertQuickAction(action.prompt ?? action.label)}
|
|
2936
2923
|
>
|
|
2937
2924
|
{/* Figma node 7363:205938 — single-column slash-command
|
|
2938
2925
|
list. No own scroll (GuideWelcome's region scrolls); the
|
|
@@ -3006,7 +2993,7 @@ function EmbeddableChatInner({
|
|
|
3006
2993
|
}
|
|
3007
2994
|
autoFocus={previewMode ? false : autoFocusInput}
|
|
3008
2995
|
slashCommands={slashCommandsProp}
|
|
3009
|
-
previewText={
|
|
2996
|
+
previewText={composerPreviewText ?? undefined}
|
|
3010
2997
|
safeAreaBottom={safeAreaBottom}
|
|
3011
2998
|
edgeLight={composerEdgeLight}
|
|
3012
2999
|
showAttachmentButton={attachmentsEnabled && activeMode === 'guide'}
|
|
@@ -7,8 +7,8 @@ import { EntityIcon } from '../icon-display';
|
|
|
7
7
|
import { TextLineSkeleton } from '../loading/unified-skeleton';
|
|
8
8
|
import { useLoadingScope } from '../ui/loading-scope';
|
|
9
9
|
import { ScrollFadeOverlay, useScrollFade } from '../ui/scroll-fade';
|
|
10
|
+
import { QuickActionSet } from './mingo-quick-action-wall';
|
|
10
11
|
import { accentFromIdentityIcon, type QuickActionAccent } from './quick-action-chip';
|
|
11
|
-
import { QuickActionWall } from './quick-action-wall';
|
|
12
12
|
|
|
13
13
|
// =============================================================================
|
|
14
14
|
// Types
|
|
@@ -48,22 +48,21 @@ export interface GuideWelcomeProps {
|
|
|
48
48
|
* `subtitle` is present. A loading scope draws the skeleton too. */
|
|
49
49
|
subtitleLoading?: boolean;
|
|
50
50
|
/** Quick-action chips — caller-provided; there are no built-in defaults, so
|
|
51
|
-
* the
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* the composer; click sends it. */
|
|
51
|
+
* the set is omitted entirely unless the host supplies actions. The first
|
|
52
|
+
* ones fill the set's slots and the rest open from its "More" slot; a click
|
|
53
|
+
* hands the action to `onQuickAction` (the chat puts its `prompt` into the composer). */
|
|
55
54
|
quickActions?: ReadonlyArray<GuideQuickAction>;
|
|
55
|
+
/** The host is still reading the chips (e.g. the quick actions of the page's
|
|
56
|
+
* topic): with none to show yet the wall draws its own loading form. A
|
|
57
|
+
* loading scope draws it too. */
|
|
58
|
+
quickActionsLoading?: boolean;
|
|
59
|
+
/** Print the page's topic (`PageTopicLabel`, the label the FAQ block prints
|
|
60
|
+
* under its heading) above the chips, so whoever edits quick actions sees
|
|
61
|
+
* which topic's chips the page asked for. Default: the host's choice
|
|
62
|
+
* (`PageTopicsProvider showTopic`), else off. */
|
|
63
|
+
showTopic?: boolean;
|
|
56
64
|
/** Fired when a quick-action chip is activated (click). */
|
|
57
65
|
onQuickAction?: (action: GuideQuickAction) => void;
|
|
58
|
-
/** Pointer/keyboard focus enters a quick-action chip — e.g. preview the
|
|
59
|
-
* action's full `prompt` in the composer input. */
|
|
60
|
-
onQuickActionHover?: (action: GuideQuickAction) => void;
|
|
61
|
-
/** Pointer/keyboard focus leaves the chip — e.g. restore the composer. */
|
|
62
|
-
onQuickActionHoverEnd?: () => void;
|
|
63
|
-
/** Agent this empty state belongs to — forwarded to the quick-action
|
|
64
|
-
* {@link QuickActionWall} so a built-in agent (`'fae'`/`'mingo'`) caps the
|
|
65
|
-
* brick stack at 2 rows. Unset (host/guide mode) keeps the full `rows` cap. */
|
|
66
|
-
agentSlug?: string;
|
|
67
66
|
/** Slash-command onboarding list — rendered inside the shared scroll region
|
|
68
67
|
* below the greeting (so greeting + list scroll together, with edge fades). */
|
|
69
68
|
children?: ReactNode;
|
|
@@ -85,8 +84,7 @@ const DEFAULT_TITLE = 'Guide Mode Chat';
|
|
|
85
84
|
*
|
|
86
85
|
* Guide-mode chat empty state: a centred greeting and the slash-command
|
|
87
86
|
* onboarding list share one scroll region (with top/bottom fade affordances),
|
|
88
|
-
* and
|
|
89
|
-
* quick actions render as chips; the remainder collapse under a "⋯" menu.
|
|
87
|
+
* and the pinned quick-action set sits above the composer.
|
|
90
88
|
*
|
|
91
89
|
* Mirrors `MingoWelcome` (the default-mode empty state) — content is
|
|
92
90
|
* configurable with OpenFrame defaults.
|
|
@@ -97,10 +95,9 @@ export function GuideWelcome({
|
|
|
97
95
|
subtitle,
|
|
98
96
|
subtitleLoading = false,
|
|
99
97
|
quickActions = [],
|
|
98
|
+
quickActionsLoading = false,
|
|
99
|
+
showTopic: showTopicProp,
|
|
100
100
|
onQuickAction,
|
|
101
|
-
onQuickActionHover,
|
|
102
|
-
onQuickActionHoverEnd,
|
|
103
|
-
agentSlug,
|
|
104
101
|
children,
|
|
105
102
|
className,
|
|
106
103
|
}: GuideWelcomeProps) {
|
|
@@ -109,13 +106,13 @@ export function GuideWelcome({
|
|
|
109
106
|
// direction. (Same behaviour as MingoWelcome.)
|
|
110
107
|
const { scrollRef, fadeTop, fadeBottom, update: updateScrollFade } = useScrollFade<HTMLDivElement>();
|
|
111
108
|
// ONE switch for the greeting (read data): a loading scope, or the host still fetching it with none to show yet.
|
|
112
|
-
const
|
|
109
|
+
const inLoadingScope = useLoadingScope();
|
|
110
|
+
const subtitleIsLoading = inLoadingScope || (subtitleLoading && !subtitle);
|
|
111
|
+
// The same switch for the chips (read data): the wall draws its loading form while there are none to show yet.
|
|
112
|
+
const chipsAreLoading = inLoadingScope || (quickActionsLoading && quickActions.length === 0);
|
|
113
113
|
|
|
114
|
-
// Map to the shared {@link QuickActionChip} shape
|
|
115
|
-
//
|
|
116
|
-
// the chat's quick actions read as "the work the agent does". Every chip
|
|
117
|
-
// stays interactive (clone copies included); `onHoverStart`/`onHoverEnd` drive
|
|
118
|
-
// the composer prompt preview and `onSelect` sends.
|
|
114
|
+
// Map to the shared {@link QuickActionChip} shape the chat's {@link QuickActionSet} draws (the set Mingo's empty
|
|
115
|
+
// state and the OpenFrame dock draw too). `onSelect` hands the action to the host.
|
|
119
116
|
const chipItems = useMemo(
|
|
120
117
|
() =>
|
|
121
118
|
quickActions.map(action => ({
|
|
@@ -133,10 +130,8 @@ export function GuideWelcome({
|
|
|
133
130
|
accent: action.accent ?? accentFromIdentityIcon(icon) ?? 'cyan',
|
|
134
131
|
},
|
|
135
132
|
onSelect: () => onQuickAction?.(action),
|
|
136
|
-
onHoverStart: () => onQuickActionHover?.(action),
|
|
137
|
-
onHoverEnd: () => onQuickActionHoverEnd?.(),
|
|
138
133
|
})),
|
|
139
|
-
[quickActions, icon, onQuickAction
|
|
134
|
+
[quickActions, icon, onQuickAction],
|
|
140
135
|
);
|
|
141
136
|
|
|
142
137
|
return (
|
|
@@ -192,27 +187,11 @@ export function GuideWelcome({
|
|
|
192
187
|
<ScrollFadeOverlay edge="bottom" visible={fadeBottom} className="h-12" />
|
|
193
188
|
</div>
|
|
194
189
|
|
|
195
|
-
{/*
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
Chips stay directly hoverable — hover/focus previews the action's full
|
|
201
|
-
prompt in the composer, click sends it — and `pauseOnHover` freezes
|
|
202
|
-
the hovered row so a moving chip never dodges a click. */}
|
|
203
|
-
{quickActions.length > 0 && (
|
|
204
|
-
<QuickActionWall
|
|
205
|
-
chips={chipItems}
|
|
206
|
-
agentSlug={agentSlug}
|
|
207
|
-
rows={4}
|
|
208
|
-
pauseOnHover
|
|
209
|
-
dragScroll
|
|
210
|
-
fade={['left', 'right']}
|
|
211
|
-
fadeSize={{ left: 32 }}
|
|
212
|
-
fadeColor="var(--color-bg)"
|
|
213
|
-
copyGap="var(--spacing-system-xxs)"
|
|
214
|
-
className="max-h-44 shrink-0"
|
|
215
|
-
/>
|
|
190
|
+
{/* The quick actions, pinned above the composer: the static {@link QuickActionSet} (fixed slots, its height
|
|
191
|
+
set by the width alone, "More" for the rest). A click hands the action to `onQuickAction`. The set prints
|
|
192
|
+
the page's topic over itself. */}
|
|
193
|
+
{(quickActions.length > 0 || chipsAreLoading) && (
|
|
194
|
+
<QuickActionSet chips={chipItems} loading={chipsAreLoading} showTopic={showTopicProp} />
|
|
216
195
|
)}
|
|
217
196
|
</div>
|
|
218
197
|
);
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { useQuery } from '@tanstack/react-query';
|
|
17
|
+
import { usePageTopic } from '../../../contexts/page-topics-context';
|
|
17
18
|
import { embedAuthedFetch } from '../../../utils/embed-authed-fetch';
|
|
18
19
|
|
|
19
20
|
/** A structured empty-state quick-action chip — `{ id, label, prompt }` plus an
|
|
@@ -122,11 +123,25 @@ export async function fetchEmptyStateConfig(
|
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
|
|
126
|
+
/**
|
|
127
|
+
* The empty-state URL for the page the chat is on: the host's endpoint with the
|
|
128
|
+
* page's `topic` (its path: `/pricing`, `/`), which the host uses to place
|
|
129
|
+
* the quick actions (that topic's first, then the ones written for no topic,
|
|
130
|
+
* never another topic's). No topic: the endpoint as given.
|
|
131
|
+
*/
|
|
132
|
+
export function emptyStateUrlForTopic(emptyStateUrl: string, topic?: string | null): string {
|
|
133
|
+
if (!topic) return emptyStateUrl;
|
|
134
|
+
return `${emptyStateUrl}${emptyStateUrl.includes('?') ? '&' : '?'}${new URLSearchParams({ topic }).toString()}`;
|
|
135
|
+
}
|
|
136
|
+
|
|
125
137
|
/**
|
|
126
138
|
* Shared empty-state config (single fetch per chat surface), via react-query
|
|
127
|
-
* so every consumer dedupes to ONE request.
|
|
128
|
-
* the
|
|
129
|
-
*
|
|
139
|
+
* so every consumer dedupes to ONE request. The request carries the topic of
|
|
140
|
+
* the page on screen, read from its address (`usePageTopic`), so the host
|
|
141
|
+
* places the quick actions for it. Keyed on the URL ALONE (the endpoint plus
|
|
142
|
+
* the topic, `emptyStateUrlForTopic`) — the request
|
|
143
|
+
* sends no `source` param (resolved server-side), so the URL fully determines
|
|
144
|
+
* the response: each topic is read once per session.
|
|
130
145
|
*
|
|
131
146
|
* `staleTime`/`gcTime: Infinity` → static per session (toggling modes or
|
|
132
147
|
* remounting the drawer reads from cache, never refetches).
|
|
@@ -140,9 +155,11 @@ export function useEmptyStateConfig(
|
|
|
140
155
|
options?: { enabled?: boolean },
|
|
141
156
|
): { config: EmptyStateConfig; loading: boolean; loaded: boolean } {
|
|
142
157
|
const enabled = (options?.enabled ?? true) && !!emptyStateUrl;
|
|
158
|
+
const topic = usePageTopic();
|
|
159
|
+
const url = emptyStateUrl ? emptyStateUrlForTopic(emptyStateUrl, topic) : undefined;
|
|
143
160
|
const query = useQuery({
|
|
144
|
-
queryKey: ['chat-empty-state',
|
|
145
|
-
queryFn: ({ signal }) => fetchEmptyStateConfig(signal,
|
|
161
|
+
queryKey: ['chat-empty-state', url],
|
|
162
|
+
queryFn: ({ signal }) => fetchEmptyStateConfig(signal, url as string),
|
|
146
163
|
enabled,
|
|
147
164
|
staleTime: Infinity,
|
|
148
165
|
gcTime: Infinity,
|