@flamingo-stack/openframe-frontend-core 0.0.816 → 0.0.817
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/{case-study-card-NLT2JVI7.cjs → case-study-card-IZBMHA6R.cjs} +3 -3
- package/dist/{chunk-7ERD34HQ.cjs → chunk-24M2JYM5.cjs} +566 -774
- package/dist/{chunk-3E4FIJAM.cjs → chunk-4ROR52OW.cjs} +15 -15
- package/dist/{chunk-SWBLTIN4.cjs → chunk-5TSYOIIZ.cjs} +54 -52
- package/dist/{chunk-JH65CEO4.cjs → chunk-6F4YGHGM.cjs} +36 -36
- package/dist/{chunk-VDXI26G7.cjs → chunk-7KBHLP4E.cjs} +81 -78
- package/dist/{chunk-CNTBGJA7.cjs → chunk-A34UNP5V.cjs} +65 -1
- package/dist/{chunk-633NTKO2.cjs → chunk-BL2J5RJK.cjs} +31 -53
- package/dist/{chunk-7NYWHEQM.cjs → chunk-C2OUXL3Q.cjs} +15 -15
- package/dist/{chunk-53JJLHJM.cjs → chunk-DSBRWP5M.cjs} +20 -20
- package/dist/chunk-DVHSYPDB.cjs +471 -0
- package/dist/{chunk-5TUR7O7H.cjs → chunk-EX7M3VQC.cjs} +90 -90
- package/dist/{chunk-EJCUAADF.cjs → chunk-F2LVBRHC.cjs} +4 -4
- package/dist/{chunk-GAR2IIU6.cjs → chunk-IM366HS6.cjs} +105 -157
- package/dist/{chunk-FUEK43FL.cjs → chunk-IOFIHVVW.cjs} +206 -200
- package/dist/{chunk-JOOZTRXQ.cjs → chunk-JMOCM2SW.cjs} +4 -4
- package/dist/{chunk-PAI4A3UM.cjs → chunk-K5IICQNF.cjs} +61 -54
- package/dist/{chunk-JOKOQOLJ.cjs → chunk-LUID2IB3.cjs} +2 -2
- package/dist/{chunk-L7W4455K.cjs → chunk-MAHJY2PO.cjs} +3 -3
- package/dist/{chunk-4PMD3JUC.cjs → chunk-NPNZAAOB.cjs} +2 -2
- package/dist/{chunk-EB7YAUER.cjs → chunk-P7JQGOX4.cjs} +19 -19
- package/dist/{chunk-O6VWD2SB.cjs → chunk-RDHF3F5R.cjs} +3 -3
- package/dist/{chunk-HM7VCQSX.cjs → chunk-SBFBNOKU.cjs} +4 -4
- package/dist/{chunk-7O7EX7HQ.cjs → chunk-T266OITJ.cjs} +28 -20
- package/dist/{chunk-ZAWHRYJZ.cjs → chunk-TKEYWSDZ.cjs} +45 -45
- package/dist/{chunk-F4ZJRMMM.cjs → chunk-UDLDXVY4.cjs} +8 -8
- package/dist/{chunk-Y6MJMPHV.cjs → chunk-UEULXVW2.cjs} +32 -84
- package/dist/{chunk-RYJJHSHV.cjs → chunk-UFBVOBYR.cjs} +23 -23
- package/dist/{chunk-IKB6AZPV.cjs → chunk-ZECG6GU5.cjs} +2 -2
- package/dist/{chunk-3ELDGEM2.cjs → chunk-ZP4JMX7G.cjs} +87 -84
- package/dist/{cloud-tenants-SRTX2FZC.cjs → cloud-tenants-NMAXIJLL.cjs} +11 -11
- package/dist/components/announcement-bar.d.ts.map +1 -1
- package/dist/components/announcement-bar.js +5 -5
- package/dist/components/case-studies/index.cjs +26 -26
- package/dist/components/chat/chat-markdown-link.d.ts +15 -0
- package/dist/components/chat/chat-markdown-link.d.ts.map +1 -0
- package/dist/components/chat/chat-markdown-link.js +22 -0
- package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
- package/dist/components/chat/chat-message-enhanced.js +3 -9
- package/dist/components/chat/embeddable-chat.d.ts +4 -0
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.js +30 -67
- package/dist/components/chat/entity-cards/chat-card-disclosure.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/chat-card-disclosure.js +8 -11
- package/dist/components/chat/entity-cards/dispatch.d.ts +5 -5
- package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/dispatch.js +18 -17
- package/dist/components/chat/entity-cards/github-activity-card.d.ts +1 -1
- package/dist/components/chat/entity-cards/use-entity-card-link.d.ts +3 -2
- package/dist/components/chat/entity-cards/use-entity-card-link.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/use-entity-card-link.js +6 -4
- package/dist/components/chat/index.cjs +28 -21
- package/dist/components/chat/index.d.ts +2 -2
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +4 -3
- package/dist/components/chat/{inline-app-link-chip.d.ts → inline-chip.d.ts} +1 -14
- package/dist/components/chat/inline-chip.d.ts.map +1 -0
- package/dist/components/chat/inline-chip.js +27 -0
- package/dist/components/chat/nav-link-anchor-via-runtime.d.ts +45 -11
- package/dist/components/chat/nav-link-anchor-via-runtime.d.ts.map +1 -1
- package/dist/components/chat/nav-link-anchor-via-runtime.js +32 -24
- package/dist/components/chat/source-action-button.d.ts +12 -3
- package/dist/components/chat/source-action-button.d.ts.map +1 -1
- package/dist/components/chat/source-action-button.js +41 -26
- package/dist/components/chat/types/component.types.d.ts +1 -1
- package/dist/components/chat/types/message.types.d.ts +1 -1
- package/dist/components/chat/types/message.types.d.ts.map +1 -1
- package/dist/components/chat/utils/chat-nav-resolution.d.ts +1 -6
- package/dist/components/chat/utils/chat-nav-resolution.d.ts.map +1 -1
- package/dist/components/chat/utils/chat-nav-resolution.js +2 -3
- package/dist/components/chat/utils/decide-new-tab.d.ts +0 -3
- package/dist/components/chat/utils/decide-new-tab.d.ts.map +1 -1
- package/dist/components/chat/utils/decide-new-tab.js +0 -1
- package/dist/components/chat/utils/execute-navigation.d.ts +36 -34
- package/dist/components/chat/utils/execute-navigation.d.ts.map +1 -1
- package/dist/components/chat/utils/execute-navigation.js +23 -19
- package/dist/components/chat/utils/index.d.ts +5 -5
- package/dist/components/chat/utils/index.d.ts.map +1 -1
- package/dist/components/chat/utils/index.js +14 -6
- package/dist/components/chat/utils/nav-anchor-props.d.ts +35 -8
- package/dist/components/chat/utils/nav-anchor-props.d.ts.map +1 -1
- package/dist/components/chat/utils/nav-anchor-props.js +14 -5
- package/dist/components/chat/utils/new-tab-rel.d.ts +15 -0
- package/dist/components/chat/utils/new-tab-rel.d.ts.map +1 -0
- package/dist/components/chat/utils/new-tab-rel.js +25 -0
- package/dist/components/contact/index.cjs +12 -12
- package/dist/components/docs/index.cjs +15 -15
- package/dist/components/embeds/index.cjs +12 -12
- package/dist/components/faq/index.cjs +13 -13
- package/dist/components/features/devices/devices-table-columns.d.ts.map +1 -1
- package/dist/components/features/devices/devices-table-columns.js +4 -1
- package/dist/components/features/index.cjs +11 -11
- package/dist/components/help-center-pages/index.cjs +105 -105
- package/dist/components/index.cjs +91 -83
- package/dist/components/meeting-scheduler/index.cjs +50 -50
- package/dist/components/navigation/app-header.d.ts +1 -4
- package/dist/components/navigation/app-header.d.ts.map +1 -1
- package/dist/components/navigation/app-header.js +0 -2
- package/dist/components/navigation/index.cjs +14 -14
- package/dist/components/navigation/ticket-alerts-button.d.ts +1 -4
- package/dist/components/navigation/ticket-alerts-button.d.ts.map +1 -1
- package/dist/components/navigation/ticket-alerts-button.js +5 -5
- package/dist/components/onboarding-guides/index.cjs +14 -14
- package/dist/components/product-demo/index.cjs +20 -20
- package/dist/components/related-content/card-registry.d.ts +1 -1
- package/dist/components/related-content/index.cjs +7 -7
- package/dist/components/related-content/related-content-section.d.ts +3 -3
- package/dist/components/related-content/related-content-section.d.ts.map +1 -1
- package/dist/components/related-content/related-content-section.js +5 -3
- package/dist/components/shared/doc-search/resolve-search-result-action.d.ts +10 -3
- package/dist/components/shared/doc-search/resolve-search-result-action.d.ts.map +1 -1
- package/dist/components/shared/doc-search/resolve-search-result-action.js +8 -17
- package/dist/components/shared/doc-search/use-doc-search.d.ts.map +1 -1
- package/dist/components/shared/doc-search/use-doc-search.js +15 -27
- package/dist/components/shared/product-release/product-release-card.d.ts +2 -2
- package/dist/components/shared/product-release/product-releases-view.d.ts.map +1 -1
- package/dist/components/shared/product-release/product-releases-view.js +1 -3
- package/dist/components/tickets/index.cjs +18 -18
- package/dist/components/tickets/ticket-detail-drawer.d.ts.map +1 -1
- package/dist/components/tickets/ticket-detail-drawer.js +6 -3
- package/dist/components/tickets/types.d.ts +1 -1
- package/dist/components/ui/button/button.d.ts +1 -1
- package/dist/components/ui/hover-dropdown.d.ts +2 -2
- package/dist/components/ui/index.cjs +31 -23
- package/dist/components/ui/service-card.d.ts.map +1 -1
- package/dist/components/ui/service-card.js +4 -1
- package/dist/components/vendor-display-button.d.ts.map +1 -1
- package/dist/components/vendor-display-button.js +4 -1
- package/dist/contexts/chat-runtime-context.d.ts +11 -11
- package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
- package/dist/{devices-DL4YU64N.cjs → devices-QBKWVHE6.cjs} +12 -12
- package/dist/{embeddable-chat-YRKMPFDY.cjs → embeddable-chat-WNPCPMDL.cjs} +96 -137
- package/dist/hooks/index.cjs +5 -5
- package/dist/hooks/use-contact-submission.d.ts.map +1 -1
- package/dist/hooks/use-contact-submission.js +11 -8
- package/dist/index.cjs +40 -34
- package/dist/{knowledge-VQW5JL2Z.cjs → knowledge-FSAYWM25.cjs} +12 -12
- package/dist/{logs-IY3WBLMW.cjs → logs-OZX4SYHG.cjs} +19 -19
- package/dist/{policies-IXWTWMJO.cjs → policies-LPCUCTLX.cjs} +15 -15
- package/dist/{scripts-D5CLO5EG.cjs → scripts-ZNFZSONW.cjs} +16 -16
- package/dist/{software-update-ULNP6CKJ.cjs → software-update-BRYOVQVY.cjs} +14 -14
- package/dist/utils/index.cjs +116 -89
- package/dist/utils/open-in-new-tab.d.ts +2 -1
- package/dist/utils/open-in-new-tab.d.ts.map +1 -1
- package/dist/utils/open-in-new-tab.js +2 -1
- package/dist/utils/scroll-into-view.d.ts +1 -1
- package/eslint-config/base.js +11 -0
- package/eslint-config/navigation.js +142 -0
- package/package.json +1 -1
- package/src/components/announcement-bar.tsx +8 -6
- package/src/components/chat/chat-markdown-link.tsx +42 -0
- package/src/components/chat/chat-message-enhanced.tsx +10 -36
- package/src/components/chat/embeddable-chat.tsx +63 -106
- package/src/components/chat/entity-cards/chat-card-disclosure.tsx +9 -13
- package/src/components/chat/entity-cards/dispatch.tsx +45 -35
- package/src/components/chat/entity-cards/github-activity-card.tsx +1 -1
- package/src/components/chat/entity-cards/use-entity-card-link.ts +11 -16
- package/src/components/chat/index.ts +3 -1
- package/src/components/chat/{inline-app-link-chip.tsx → inline-chip.tsx} +1 -27
- package/src/components/chat/nav-link-anchor-via-runtime.tsx +73 -33
- package/src/components/chat/source-action-button.tsx +57 -33
- package/src/components/chat/types/component.types.ts +1 -1
- package/src/components/chat/types/message.types.ts +1 -1
- package/src/components/chat/utils/chat-nav-resolution.ts +3 -8
- package/src/components/chat/utils/decide-new-tab.ts +0 -3
- package/src/components/chat/utils/execute-navigation.ts +58 -58
- package/src/components/chat/utils/index.ts +13 -6
- package/src/components/chat/utils/nav-anchor-props.ts +56 -9
- package/src/components/chat/utils/new-tab-rel.ts +39 -0
- package/src/components/features/devices/devices-table-columns.tsx +4 -1
- package/src/components/navigation/app-header.tsx +0 -5
- package/src/components/navigation/ticket-alerts-button.tsx +7 -8
- package/src/components/related-content/card-registry.tsx +1 -1
- package/src/components/related-content/related-content-section.tsx +10 -10
- package/src/components/shared/doc-search/resolve-search-result-action.ts +19 -33
- package/src/components/shared/doc-search/use-doc-search.ts +21 -44
- package/src/components/shared/product-release/product-release-card.tsx +4 -4
- package/src/components/shared/product-release/product-releases-view.tsx +2 -5
- package/src/components/tickets/ticket-detail-drawer.tsx +7 -4
- package/src/components/tickets/types.ts +1 -1
- package/src/components/ui/button/button.tsx +2 -2
- package/src/components/ui/hover-dropdown.tsx +2 -2
- package/src/components/ui/service-card.tsx +4 -1
- package/src/components/vendor-display-button.tsx +5 -2
- package/src/contexts/chat-runtime-context.tsx +15 -12
- package/src/hooks/use-contact-submission.ts +13 -8
- package/src/utils/index.ts +1 -1
- package/src/utils/open-in-new-tab.ts +4 -2
- package/src/utils/scroll-into-view.ts +1 -1
- package/dist/chunk-RD66AGUI.cjs +0 -156
- package/dist/components/chat/inline-app-link-chip.d.ts.map +0 -1
- package/dist/components/chat/inline-app-link-chip.js +0 -37
|
@@ -9,8 +9,6 @@ import { MessageSquare } from "lucide-react";
|
|
|
9
9
|
import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
10
10
|
import { chatProgressLabel } from "../../chat-protocol/progress.js";
|
|
11
11
|
import { useRequiredChatRuntime } from "../../contexts/chat-runtime-context.js";
|
|
12
|
-
import Link from "../../embed-shims/next-link.js";
|
|
13
|
-
import { useRouter } from "../../embed-shims/next-navigation.js";
|
|
14
12
|
import { useIsHydrated } from "../../hooks/ui/use-is-hydrated.js";
|
|
15
13
|
import { cn } from "../../utils/cn.js";
|
|
16
14
|
import { formatCitationIndices } from "../../utils/source-grouping.js";
|
|
@@ -32,7 +30,7 @@ import { Button } from "../ui/button/index.js";
|
|
|
32
30
|
import { Drawer, DrawerContent } from "../ui/drawer.js";
|
|
33
31
|
import { HoverDropdown } from "../ui/hover-dropdown.js";
|
|
34
32
|
import { TextHold } from "../ui/layout-hold.js";
|
|
35
|
-
import { LoadingItems } from "../ui/loading-scope.js";
|
|
33
|
+
import { LoadingItems, loadingItemProps } from "../ui/loading-scope.js";
|
|
36
34
|
import { CollisionBoundaryContext, PortalContainerContext } from "../ui/portal-container.js";
|
|
37
35
|
import { SKELETON_SURFACE_CLASS } from "../ui/skeleton-surface.js";
|
|
38
36
|
import { SquareAvatar } from "../ui/square-avatar.js";
|
|
@@ -71,14 +69,11 @@ import { SourceActionButton } from "./source-action-button.js";
|
|
|
71
69
|
import { AUTHOR_TYPE, CHAT_APPEARANCE } from "./types/chat.types.js";
|
|
72
70
|
import { ASK_AI_OPEN_EVENT, ASK_AI_OPEN_WITH_REF_EVENT, chatListensForAskAiOpens } from "./utils/ask-ai-events.js";
|
|
73
71
|
import { formatChatAttachmentMarkdownForBubble } from "./utils/chat-attachment-markdown.js";
|
|
74
|
-
import { resolveHrefForRuntime } from "./utils/chat-nav-resolution.js";
|
|
75
72
|
import { chatChipClass } from "./utils/chip-styles.js";
|
|
76
73
|
import { FALLBACK_TOP_RETRIEVED, splitCitedSources } from "./utils/cited-sources.js";
|
|
77
|
-
import { executeNavigation } from "./utils/execute-navigation.js";
|
|
78
74
|
import { flattenAssistantContent } from "./utils/flatten-assistant-content.js";
|
|
79
75
|
import { mapHostMessage, pruneTimestampCache } from "./utils/host-message.js";
|
|
80
76
|
import { resolveIcon } from "./utils/icon-library.js";
|
|
81
|
-
import { computeIsNewTab, newTabAnchorAttrs } from "./utils/nav-anchor-props.js";
|
|
82
77
|
import { formatSingularLookupInvocation } from "./utils/slash-dispatch-utils.js";
|
|
83
78
|
import { resolveSourceRowCTA, sourceRowCtxFromRuntime } from "./utils/source-row-cta.js";
|
|
84
79
|
const HISTORY_RAIL_WIDTH = 320;
|
|
@@ -173,9 +168,9 @@ function dispatchSlashCommandAction(actionId, cmdId, ref) {
|
|
|
173
168
|
}
|
|
174
169
|
}
|
|
175
170
|
const ONE_TEXT_LINE = "\xA0";
|
|
176
|
-
const SOURCE_CHIP_SKELETON_COUNT =
|
|
177
|
-
function SourceChipSkeleton(
|
|
178
|
-
return /* @__PURE__ */ jsxs("span", { "aria-hidden": true, className:
|
|
171
|
+
const SOURCE_CHIP_SKELETON_COUNT = 1;
|
|
172
|
+
function SourceChipSkeleton(props) {
|
|
173
|
+
return /* @__PURE__ */ jsxs("span", { "aria-hidden": true, className: "pointer-events-none inline-flex shrink-0 items-center", ...loadingItemProps(props), children: [
|
|
179
174
|
/* @__PURE__ */ jsxs("span", { className: chatChipClass({ tone: "secondary" }), children: [
|
|
180
175
|
/* @__PURE__ */ jsx("span", { className: cn(SKELETON_SURFACE_CLASS, "inline-block h-3.5 w-3.5 rounded-sm") }),
|
|
181
176
|
/* @__PURE__ */ jsx("span", { className: cn(SKELETON_SURFACE_CLASS, "w-28 rounded-sm"), children: ONE_TEXT_LINE })
|
|
@@ -183,15 +178,10 @@ function SourceChipSkeleton({ className }) {
|
|
|
183
178
|
/* @__PURE__ */ jsx("span", { className: cn(SKELETON_SURFACE_CLASS, "-mr-1 ml-1 inline-block h-5 w-5 rounded-sm") })
|
|
184
179
|
] });
|
|
185
180
|
}
|
|
186
|
-
function SourceChip({
|
|
187
|
-
src,
|
|
188
|
-
|
|
189
|
-
chipBasePlatform,
|
|
190
|
-
onClose,
|
|
191
|
-
onDiscuss
|
|
192
|
-
}) {
|
|
181
|
+
function SourceChip(props) {
|
|
182
|
+
const { src, baseRoute, chipBasePlatform, onDiscuss } = props;
|
|
183
|
+
const marks = loadingItemProps(props);
|
|
193
184
|
const runtime = useRequiredChatRuntime();
|
|
194
|
-
const router = useRouter();
|
|
195
185
|
const cta = resolveSourceRowCTA(
|
|
196
186
|
{
|
|
197
187
|
sourceRepo: src.sourceRepo,
|
|
@@ -207,7 +197,6 @@ function SourceChip({
|
|
|
207
197
|
const Icon = cta.icon;
|
|
208
198
|
const icon = /* @__PURE__ */ jsx(Icon, { className: "h-3.5 w-3.5" });
|
|
209
199
|
const chipClass = chatChipClass({ tone: "secondary" });
|
|
210
|
-
const decideTab = (href, targetPlatform) => computeIsNewTab(runtime, href, targetPlatform);
|
|
211
200
|
if (src.items && src.items.length > 0) {
|
|
212
201
|
const dropdownItems = src.items.map((item) => {
|
|
213
202
|
const itemCta = resolveSourceRowCTA(
|
|
@@ -241,7 +230,7 @@ function SourceChip({
|
|
|
241
230
|
});
|
|
242
231
|
const itemIndices = src.items.flatMap((item) => item.index === void 0 ? [] : [item.index]);
|
|
243
232
|
const groupIndices = itemIndices.length > 0 ? formatCitationIndices(itemIndices) : `${src.index}`;
|
|
244
|
-
return /* @__PURE__ */ jsx(
|
|
233
|
+
return /* @__PURE__ */ jsx("span", { className: "inline-flex", ...marks, children: /* @__PURE__ */ jsx(
|
|
245
234
|
HoverDropdown,
|
|
246
235
|
{
|
|
247
236
|
items: dropdownItems,
|
|
@@ -265,7 +254,7 @@ function SourceChip({
|
|
|
265
254
|
] })
|
|
266
255
|
] })
|
|
267
256
|
}
|
|
268
|
-
);
|
|
257
|
+
) });
|
|
269
258
|
}
|
|
270
259
|
const displayName = src.name || formatRelativePath(src.path);
|
|
271
260
|
const chipBody = (label) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -277,50 +266,22 @@ function SourceChip({
|
|
|
277
266
|
label
|
|
278
267
|
] })
|
|
279
268
|
] });
|
|
280
|
-
const wrapChip = (clickable) => /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center", children: [
|
|
269
|
+
const wrapChip = (clickable) => /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center", ...marks, children: [
|
|
281
270
|
clickable,
|
|
282
271
|
/* @__PURE__ */ jsx(SourceActionButton, { chatRef: cta.chatRef, onDiscuss, density: "inline", className: "-mr-1 ml-1" })
|
|
283
272
|
] });
|
|
284
|
-
const buildClickHandler = (href, path, targetPlatform, isNewTab) => (e) => {
|
|
285
|
-
const handled = executeNavigation({
|
|
286
|
-
event: e,
|
|
287
|
-
runtime,
|
|
288
|
-
href,
|
|
289
|
-
path,
|
|
290
|
-
targetPlatform,
|
|
291
|
-
fallbackNavigate: router.push
|
|
292
|
-
});
|
|
293
|
-
if (handled && !isNewTab && onClose) onClose();
|
|
294
|
-
};
|
|
295
|
-
if (cta.href && !!src.externalUrl) {
|
|
296
|
-
const resolvedHref = resolveHrefForRuntime(cta.href, runtime);
|
|
297
|
-
const isNewTab = decideTab(resolvedHref, cta.targetPlatform ?? null);
|
|
298
|
-
return wrapChip(
|
|
299
|
-
/* @__PURE__ */ jsx(
|
|
300
|
-
Link,
|
|
301
|
-
{
|
|
302
|
-
href: resolvedHref,
|
|
303
|
-
...newTabAnchorAttrs(isNewTab),
|
|
304
|
-
onClick: buildClickHandler(resolvedHref, null, cta.targetPlatform ?? null, isNewTab),
|
|
305
|
-
className: chipClass,
|
|
306
|
-
children: chipBody(src.name)
|
|
307
|
-
}
|
|
308
|
-
)
|
|
309
|
-
);
|
|
310
|
-
}
|
|
311
273
|
if (cta.href) {
|
|
312
|
-
const
|
|
313
|
-
const isNewTab = decideTab(resolvedHref, cta.targetPlatform ?? null);
|
|
274
|
+
const isEntity = !!src.externalUrl;
|
|
314
275
|
return wrapChip(
|
|
315
276
|
/* @__PURE__ */ jsx(
|
|
316
|
-
|
|
277
|
+
NavLinkAnchorViaRuntime,
|
|
317
278
|
{
|
|
318
|
-
href:
|
|
319
|
-
|
|
320
|
-
|
|
279
|
+
href: cta.href,
|
|
280
|
+
path: isEntity ? null : src.path,
|
|
281
|
+
targetPlatform: cta.targetPlatform ?? null,
|
|
321
282
|
className: chipClass,
|
|
322
|
-
title: displayName,
|
|
323
|
-
children: chipBody(displayName)
|
|
283
|
+
title: isEntity ? void 0 : displayName,
|
|
284
|
+
children: chipBody(isEntity ? src.name : displayName)
|
|
324
285
|
}
|
|
325
286
|
)
|
|
326
287
|
);
|
|
@@ -334,15 +295,15 @@ function SourceChips({
|
|
|
334
295
|
uncited,
|
|
335
296
|
baseRoute,
|
|
336
297
|
chipBasePlatform,
|
|
337
|
-
onClose,
|
|
338
298
|
onDiscuss,
|
|
339
|
-
loading
|
|
299
|
+
loading,
|
|
300
|
+
skeletonCount
|
|
340
301
|
}) {
|
|
341
302
|
const [expanded, setExpanded] = useState(false);
|
|
342
303
|
if (loading) {
|
|
343
304
|
return /* @__PURE__ */ jsxs("div", { "aria-hidden": true, className: "mt-2 flex flex-col gap-1.5 border-t border-ods-border pt-2", children: [
|
|
344
305
|
/* @__PURE__ */ jsx("span", { className: "uppercase text-ods-text-muted text-h6", children: /* @__PURE__ */ jsx(TextHold, { children: "Sources" }) }),
|
|
345
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-nowrap gap-1.5 overflow-hidden", children:
|
|
306
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-nowrap gap-1.5 overflow-hidden", children: /* @__PURE__ */ jsx(LoadingItems, { count: skeletonCount, children: () => /* @__PURE__ */ jsx(SourceChipSkeleton, { "data-loading-item": true }) }) })
|
|
346
307
|
] });
|
|
347
308
|
}
|
|
348
309
|
if (cited.length === 0) {
|
|
@@ -353,10 +314,10 @@ function SourceChips({
|
|
|
353
314
|
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: fallback.map((src) => /* @__PURE__ */ jsx(
|
|
354
315
|
SourceChip,
|
|
355
316
|
{
|
|
317
|
+
"data-loading-item": true,
|
|
356
318
|
src,
|
|
357
319
|
baseRoute,
|
|
358
320
|
chipBasePlatform,
|
|
359
|
-
onClose,
|
|
360
321
|
onDiscuss
|
|
361
322
|
},
|
|
362
323
|
src.index
|
|
@@ -371,10 +332,10 @@ function SourceChips({
|
|
|
371
332
|
cited.map((src) => /* @__PURE__ */ jsx(
|
|
372
333
|
SourceChip,
|
|
373
334
|
{
|
|
335
|
+
"data-loading-item": true,
|
|
374
336
|
src,
|
|
375
337
|
baseRoute,
|
|
376
338
|
chipBasePlatform,
|
|
377
|
-
onClose,
|
|
378
339
|
onDiscuss
|
|
379
340
|
},
|
|
380
341
|
src.index
|
|
@@ -382,10 +343,10 @@ function SourceChips({
|
|
|
382
343
|
expanded && uncited.map((src) => /* @__PURE__ */ jsx(
|
|
383
344
|
SourceChip,
|
|
384
345
|
{
|
|
346
|
+
"data-loading-item": true,
|
|
385
347
|
src,
|
|
386
348
|
baseRoute,
|
|
387
349
|
chipBasePlatform,
|
|
388
|
-
onClose,
|
|
389
350
|
onDiscuss
|
|
390
351
|
},
|
|
391
352
|
src.index
|
|
@@ -415,6 +376,7 @@ EmbeddableChat.displayName = "EmbeddableChat";
|
|
|
415
376
|
function EmbeddableChatInner({
|
|
416
377
|
baseRoute,
|
|
417
378
|
chipBasePlatform,
|
|
379
|
+
sourceSkeletonCount = SOURCE_CHIP_SKELETON_COUNT,
|
|
418
380
|
enabledRagTableIds = null,
|
|
419
381
|
emptyStateGreeting = null,
|
|
420
382
|
suggestedQueries = null,
|
|
@@ -987,15 +949,16 @@ function EmbeddableChatInner({
|
|
|
987
949
|
(message, index) => {
|
|
988
950
|
if (message.role !== "assistant") return null;
|
|
989
951
|
if (chatLoading && index === messages.length - 1) {
|
|
952
|
+
if (sourceSkeletonCount <= 0) return null;
|
|
990
953
|
return /* @__PURE__ */ jsx("div", { className: "pb-2", children: /* @__PURE__ */ jsx(
|
|
991
954
|
SourceChips,
|
|
992
955
|
{
|
|
993
956
|
loading: true,
|
|
957
|
+
skeletonCount: sourceSkeletonCount,
|
|
994
958
|
cited: [],
|
|
995
959
|
uncited: [],
|
|
996
960
|
baseRoute: resolvedBaseRoute,
|
|
997
|
-
chipBasePlatform
|
|
998
|
-
onClose: handleNavigationClose
|
|
961
|
+
chipBasePlatform
|
|
999
962
|
}
|
|
1000
963
|
) });
|
|
1001
964
|
}
|
|
@@ -1008,12 +971,12 @@ function EmbeddableChatInner({
|
|
|
1008
971
|
uncited,
|
|
1009
972
|
baseRoute: resolvedBaseRoute,
|
|
1010
973
|
chipBasePlatform,
|
|
1011
|
-
|
|
1012
|
-
|
|
974
|
+
onDiscuss: askAbout,
|
|
975
|
+
skeletonCount: sourceSkeletonCount
|
|
1013
976
|
}
|
|
1014
977
|
) });
|
|
1015
978
|
},
|
|
1016
|
-
[chatLoading, messages.length, resolvedBaseRoute, chipBasePlatform,
|
|
979
|
+
[chatLoading, messages.length, resolvedBaseRoute, chipBasePlatform, askAbout, sourceSkeletonCount]
|
|
1017
980
|
);
|
|
1018
981
|
const [portalHost, setPortalHost] = useState(null);
|
|
1019
982
|
const [panelBoundary, setPanelBoundary] = useState(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-card-disclosure.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/entity-cards/chat-card-disclosure.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;
|
|
1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B"}
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { PlayIcon } from "../../icons-v2-generated/media-playback/play-icon.js";
|
|
5
|
-
import { Button } from "../../ui/button/index.js";
|
|
6
5
|
import { ExpandChevron } from "../expand-chevron.js";
|
|
7
6
|
import { useCollapsible } from "../hooks/use-collapsible.js";
|
|
8
|
-
import { CARD_FOOTER_ACTION_CLASS,
|
|
7
|
+
import { CARD_FOOTER_ACTION_CLASS, FooterAction } from "../source-action-button.js";
|
|
9
8
|
import { ChatVideoEntityCard } from "./chat-video-entity-card.js";
|
|
10
9
|
const CHAT_CARD_DISCLOSURE = {
|
|
11
10
|
VIDEO: "VIDEO"
|
|
@@ -59,25 +58,23 @@ function ChatCardDisclosureButton({
|
|
|
59
58
|
loading
|
|
60
59
|
}) {
|
|
61
60
|
const spec = CHAT_CARD_DISCLOSURES[kind];
|
|
62
|
-
if (loading) return /* @__PURE__ */ jsx(FooterActionSkeleton, { label: spec.label, className: CARD_FOOTER_ACTION_CLASS });
|
|
63
61
|
const label = open ? spec.openLabel : spec.label;
|
|
64
62
|
const Icon = spec.icon;
|
|
65
63
|
return /* @__PURE__ */ jsx(
|
|
66
|
-
|
|
64
|
+
FooterAction,
|
|
67
65
|
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
rightIcon: /* @__PURE__ */ jsx(ExpandChevron, { expanded: open, className: "!h-3 !w-3" }),
|
|
66
|
+
label,
|
|
67
|
+
icon: /* @__PURE__ */ jsx(Icon, { className: "!h-3 !w-3" }),
|
|
68
|
+
trailingIcon: /* @__PURE__ */ jsx(ExpandChevron, { expanded: open, className: "!h-3 !w-3" }),
|
|
72
69
|
onClick: (e) => {
|
|
73
70
|
e.preventDefault();
|
|
74
71
|
e.stopPropagation();
|
|
75
72
|
onToggle?.();
|
|
76
73
|
},
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
ariaExpanded: open,
|
|
75
|
+
ariaLabel: title ? `${label}: ${title}` : label,
|
|
79
76
|
className: CARD_FOOTER_ACTION_CLASS,
|
|
80
|
-
|
|
77
|
+
loading
|
|
81
78
|
}
|
|
82
79
|
);
|
|
83
80
|
}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Lib-portable refactor of the hub's `components/shared/entity-card-dispatch.tsx`.
|
|
5
5
|
* Drops the hub-only imports:
|
|
6
|
-
* - `
|
|
6
|
+
* - `useNavLinkViaRuntime` → click routing flows through `<NavLinkAnchorViaRuntime>`
|
|
7
7
|
* (reads `useRequiredChatRuntime` internally) or
|
|
8
|
-
* the chat-runtime's `
|
|
8
|
+
* the chat-runtime's `executeNavigation` helper.
|
|
9
9
|
* - `currentPlatform` → runtime.source supplies the identifier.
|
|
10
10
|
* - `buildContentURL` → URLs arrive pre-composed by the server's
|
|
11
11
|
* RAG mapper (`ref.url`); the card just renders.
|
|
@@ -145,7 +145,7 @@ export interface ChatCardRenderOptions {
|
|
|
145
145
|
/** Pre-computed new-tab decision for the inner anchor's `target`
|
|
146
146
|
* attribute. Required — always computed by `ChatCardLoader` via the
|
|
147
147
|
* same rule source chips use, so the rendered `<a target>` matches
|
|
148
|
-
* whatever `ChatCardNavWrap` + `
|
|
148
|
+
* whatever `ChatCardNavWrap` + `executeNavigation` decide at click
|
|
149
149
|
* time. */
|
|
150
150
|
isNewTab: boolean;
|
|
151
151
|
/** Host-provided "Ask Mingo"/"Display" affordance for this card, resolved
|
|
@@ -206,7 +206,7 @@ interface ChatCardRegistryEntry {
|
|
|
206
206
|
* for ChatRef-shaped items). Result is validated via `safeHref`
|
|
207
207
|
* before being attached to the resolved ref — so the wrapper sees a
|
|
208
208
|
* non-null `href`, the pre-computed `isNewTab` reflects the actual
|
|
209
|
-
* destination, and the click goes through `
|
|
209
|
+
* destination, and the click goes through `executeNavigation` (no
|
|
210
210
|
* silent bypass of embed-mode / close-on-nav). Takes precedence over
|
|
211
211
|
* the `composeContentUrl` fallback below — but NOT over an explicit
|
|
212
212
|
* host `override` for the type (see `pickFetchedCardHref`). */
|
|
@@ -254,7 +254,7 @@ interface ChatCardLoaderProps {
|
|
|
254
254
|
* - Re-attach the resolved values onto the ref so EVERY downstream
|
|
255
255
|
* card — whether it renders an inner `<a>` from `href` prop
|
|
256
256
|
* (BlogCard, ProgramCard, …) or pulls `anchorProps` from
|
|
257
|
-
* `
|
|
257
|
+
* `navLinkTarget` — sees the SAME canonical URL the
|
|
258
258
|
* chip would render.
|
|
259
259
|
*
|
|
260
260
|
* Eliminates the entire "chip works, inline card doesn't" class of bug.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/entity-cards/dispatch.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/entity-cards/dispatch.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuD/B,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAMvG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAMjD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAYtF,OAAO,EAIL,KAAK,sBAAsB,EAI5B,MAAM,wBAAwB,CAAC;AAqBhC;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,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,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,sBAAsB,CAAC;CAC5B,GACL,KAAK,CAAC,SAAS,CAoDjB"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useRequiredChatRuntime } from "../../../contexts/chat-runtime-context.js";
|
|
4
4
|
import Image from "../../../embed-shims/next-image.js";
|
|
5
|
-
import { useRouter } from "../../../embed-shims/next-navigation.js";
|
|
6
5
|
import { IMAGE_FIXED_PX } from "../../../styles/image-sizes.js";
|
|
7
6
|
import {
|
|
8
7
|
TRUST_CENTER_DOCUMENT_TYPE,
|
|
@@ -61,10 +60,10 @@ import { SourceActionButton } from "../source-action-button.js";
|
|
|
61
60
|
import { formatInvestorUpdatePeriod } from "../types/entities/investor-update.js";
|
|
62
61
|
import { getStatusColorScheme } from "../utils/agent-status-message.js";
|
|
63
62
|
import { resolveCardDestination } from "../utils/card-destination.js";
|
|
64
|
-
import { resolveHrefForRuntime } from "../utils/chat-nav-resolution.js";
|
|
65
63
|
import { executeNavigation } from "../utils/execute-navigation.js";
|
|
66
64
|
import { clickupTaskUrl } from "../utils/external-app-urls.js";
|
|
67
|
-
import {
|
|
65
|
+
import { buildAnchorProps, navLinkTarget } from "../utils/nav-anchor-props.js";
|
|
66
|
+
import { isRelativeHref } from "../utils/new-tab-rel.js";
|
|
68
67
|
import { readFetchedCardTitle } from "../utils/resolve-fetched-card-href.js";
|
|
69
68
|
import { resolveSourceIcon, sourceRowCtxFromRuntime } from "../utils/source-row-cta.js";
|
|
70
69
|
import { BlockCard } from "./block-card.js";
|
|
@@ -137,7 +136,7 @@ function GitHubChatCard({
|
|
|
137
136
|
description,
|
|
138
137
|
icon: githubKindIcon(kind),
|
|
139
138
|
status,
|
|
140
|
-
anchorProps: buildAnchorProps(chatRef.url, isNewTab),
|
|
139
|
+
anchorProps: buildAnchorProps(chatRef.url, isNewTab, chatRef.targetPlatform),
|
|
141
140
|
menuGroups: cardMenuGroups(chatRef.url, discuss),
|
|
142
141
|
menuAriaLabel: "Activity actions"
|
|
143
142
|
}
|
|
@@ -260,7 +259,7 @@ function HubspotTicketChatCard({
|
|
|
260
259
|
description: chatRef.preview ?? void 0,
|
|
261
260
|
icon: /* @__PURE__ */ jsx(TagIcon, { size: 24 }),
|
|
262
261
|
status: statusText ? { label: statusText, variant: hubspotStatusToVariant(status) } : void 0,
|
|
263
|
-
anchorProps: buildAnchorProps(chatRef.url, isNewTab),
|
|
262
|
+
anchorProps: buildAnchorProps(chatRef.url, isNewTab, chatRef.targetPlatform),
|
|
264
263
|
menuGroups: cardMenuGroups(chatRef.url, discuss, {
|
|
265
264
|
label: "Open Ticket Details",
|
|
266
265
|
icon: /* @__PURE__ */ jsx(TagIcon, { size: 20 })
|
|
@@ -283,7 +282,7 @@ function FaqChatCard({
|
|
|
283
282
|
description: chatRef.preview ?? void 0,
|
|
284
283
|
icon: /* @__PURE__ */ jsx(QuestionCircleIcon, { size: 24 }),
|
|
285
284
|
status: { label: statusLabel, variant: "grey" },
|
|
286
|
-
anchorProps: buildAnchorProps(chatRef.url, isNewTab),
|
|
285
|
+
anchorProps: buildAnchorProps(chatRef.url, isNewTab, chatRef.targetPlatform),
|
|
287
286
|
menuGroups: cardMenuGroups(chatRef.url, discuss),
|
|
288
287
|
menuAriaLabel: "FAQ actions"
|
|
289
288
|
}
|
|
@@ -303,7 +302,7 @@ function SlackChatCard({
|
|
|
303
302
|
title,
|
|
304
303
|
description: chatRef.preview ?? void 0,
|
|
305
304
|
icon: /* @__PURE__ */ jsx(SlackLogoGreyIcon, { size: 24 }),
|
|
306
|
-
anchorProps: buildAnchorProps(chatRef.url, isNewTab),
|
|
305
|
+
anchorProps: buildAnchorProps(chatRef.url, isNewTab, chatRef.targetPlatform),
|
|
307
306
|
menuGroups: cardMenuGroups(chatRef.url, discuss),
|
|
308
307
|
menuAriaLabel: "Message actions"
|
|
309
308
|
}
|
|
@@ -321,7 +320,7 @@ function GlyphChatCard({
|
|
|
321
320
|
title: chatRef.title,
|
|
322
321
|
description: chatRef.preview ?? void 0,
|
|
323
322
|
icon,
|
|
324
|
-
anchorProps: buildAnchorProps(chatRef.url, isNewTab),
|
|
323
|
+
anchorProps: buildAnchorProps(chatRef.url, isNewTab, chatRef.targetPlatform),
|
|
325
324
|
menuGroups: cardMenuGroups(chatRef.url, discuss),
|
|
326
325
|
menuAriaLabel: "Card actions"
|
|
327
326
|
}
|
|
@@ -352,7 +351,7 @@ function TrustCenterChatCard({
|
|
|
352
351
|
description: summary || TRUST_CENTER_TAGLINE,
|
|
353
352
|
icon: /* @__PURE__ */ jsx(ShieldCheckIcon, { size: 24 }),
|
|
354
353
|
status: lead ? { label: lead.label, variant: TRUST_STATUS_TAG_VARIANT[lead.color] } : void 0,
|
|
355
|
-
anchorProps: buildAnchorProps(chatRef.url, isNewTab),
|
|
354
|
+
anchorProps: buildAnchorProps(chatRef.url, isNewTab, chatRef.targetPlatform),
|
|
356
355
|
menuGroups: cardMenuGroups(chatRef.url, discuss, {
|
|
357
356
|
label: "View trust center",
|
|
358
357
|
icon: /* @__PURE__ */ jsx(ShieldCheckIcon, { size: 20 })
|
|
@@ -374,7 +373,7 @@ function DataRoomDocChatCard({
|
|
|
374
373
|
description: chatRef.preview ?? void 0,
|
|
375
374
|
icon: /* @__PURE__ */ jsx(FileContentIcon, { size: 24 }),
|
|
376
375
|
status: { label: badgeText, variant: "grey" },
|
|
377
|
-
anchorProps: buildAnchorProps(chatRef.url, isNewTab),
|
|
376
|
+
anchorProps: buildAnchorProps(chatRef.url, isNewTab, chatRef.targetPlatform),
|
|
378
377
|
menuGroups: cardMenuGroups(chatRef.url, discuss),
|
|
379
378
|
menuAriaLabel: "Document actions"
|
|
380
379
|
}
|
|
@@ -393,7 +392,7 @@ function GenericFinancialChatCard({
|
|
|
393
392
|
title: chatRef.title,
|
|
394
393
|
description: subtitle,
|
|
395
394
|
icon,
|
|
396
|
-
anchorProps: buildAnchorProps(chatRef.url, isNewTab),
|
|
395
|
+
anchorProps: buildAnchorProps(chatRef.url, isNewTab, chatRef.targetPlatform),
|
|
397
396
|
menuGroups: cardMenuGroups(chatRef.url, discuss),
|
|
398
397
|
menuAriaLabel: "Document actions"
|
|
399
398
|
}
|
|
@@ -523,7 +522,7 @@ function EntityMingoCard({
|
|
|
523
522
|
imageAlt: typeof title === "string" ? title : void 0,
|
|
524
523
|
icon: fallbackIcon,
|
|
525
524
|
status,
|
|
526
|
-
anchorProps: buildAnchorProps(chatRef.url, isNewTab),
|
|
525
|
+
anchorProps: buildAnchorProps(chatRef.url, isNewTab, chatRef.targetPlatform),
|
|
527
526
|
menuGroups: cardMenuGroups(chatRef.url, discuss, openDetails, externalLink),
|
|
528
527
|
menuAriaLabel
|
|
529
528
|
}
|
|
@@ -626,7 +625,7 @@ function DesignDocChatCard({
|
|
|
626
625
|
description: doc ? [designDocMetaLine(doc), formatCompletionLabel(doc.completion)].join(" \xB7 ") : displayRef.preview ?? void 0,
|
|
627
626
|
icon: /* @__PURE__ */ jsx(FileContentIcon, { size: 24 }),
|
|
628
627
|
status: readiness ? { label: readiness.label, variant: readiness.scheme === "success" ? "success" : "grey" } : { label: "Design doc", variant: "grey" },
|
|
629
|
-
anchorProps: buildAnchorProps(displayRef.url, isNewTab),
|
|
628
|
+
anchorProps: buildAnchorProps(displayRef.url, isNewTab, displayRef.targetPlatform),
|
|
630
629
|
menuGroups: cardMenuGroups(displayRef.url, discuss),
|
|
631
630
|
menuAriaLabel: "Design doc actions"
|
|
632
631
|
}
|
|
@@ -1185,10 +1184,10 @@ function ChatCardNavWrap({
|
|
|
1185
1184
|
path,
|
|
1186
1185
|
targetPlatform,
|
|
1187
1186
|
isNewTab,
|
|
1187
|
+
hostRoute,
|
|
1188
1188
|
children
|
|
1189
1189
|
}) {
|
|
1190
1190
|
const runtime = useRequiredChatRuntime();
|
|
1191
|
-
const router = useRouter();
|
|
1192
1191
|
const panel = useChatPanel();
|
|
1193
1192
|
const onClickCapture = (e) => {
|
|
1194
1193
|
if (!href) return;
|
|
@@ -1197,7 +1196,7 @@ function ChatCardNavWrap({
|
|
|
1197
1196
|
if (!host?.contains(targetEl)) return;
|
|
1198
1197
|
if (targetEl?.closest?.("button")) return;
|
|
1199
1198
|
if (!targetEl?.closest?.("a")) return;
|
|
1200
|
-
const handled = executeNavigation({ event: e, runtime, href, path, targetPlatform,
|
|
1199
|
+
const handled = executeNavigation({ event: e, runtime, href, path, targetPlatform, hostRoute });
|
|
1201
1200
|
if (!handled) return;
|
|
1202
1201
|
e.stopPropagation();
|
|
1203
1202
|
if (!isNewTab && panel?.closeChat) panel.closeChat();
|
|
@@ -1242,7 +1241,7 @@ function ChatCardLoader({
|
|
|
1242
1241
|
entry: fetchEntry,
|
|
1243
1242
|
ctx: sourceRowCtxFromRuntime(runtime, { baseRoute, chipBasePlatform }),
|
|
1244
1243
|
composeContentUrl: runtime.composeContentUrl,
|
|
1245
|
-
resolveHref: (href) =>
|
|
1244
|
+
resolveHref: (href) => navLinkTarget(runtime, href).href
|
|
1246
1245
|
});
|
|
1247
1246
|
const hrefResolvedChatRef = {
|
|
1248
1247
|
...chatRef,
|
|
@@ -1253,7 +1252,8 @@ function ChatCardLoader({
|
|
|
1253
1252
|
};
|
|
1254
1253
|
const fetchedTitle = fetchEntry && item ? readFetchedCardTitle(item) : null;
|
|
1255
1254
|
const finalChatRef = fetchedTitle && (!hrefResolvedChatRef.title || hrefResolvedChatRef.title === hrefResolvedChatRef.id) ? { ...hrefResolvedChatRef, title: fetchedTitle } : hrefResolvedChatRef;
|
|
1256
|
-
const
|
|
1255
|
+
const hostRoute = (destination.source === "composed" || destination.source === "hostOverride") && !!finalChatRef.url && isRelativeHref(finalChatRef.url);
|
|
1256
|
+
const isNewTab = finalChatRef.url ? navLinkTarget(runtime, finalChatRef.url, finalChatRef.targetPlatform, { hostRoute }).isNewTab : false;
|
|
1257
1257
|
const useDisplay = !!entry.displayAction && !!onDisplay;
|
|
1258
1258
|
const discussFn = useDisplay ? onDisplay : onDiscuss;
|
|
1259
1259
|
const discuss = discussFn ? {
|
|
@@ -1276,6 +1276,7 @@ function ChatCardLoader({
|
|
|
1276
1276
|
path,
|
|
1277
1277
|
targetPlatform: finalChatRef.targetPlatform ?? null,
|
|
1278
1278
|
isNewTab,
|
|
1279
|
+
hostRoute,
|
|
1279
1280
|
children
|
|
1280
1281
|
}
|
|
1281
1282
|
);
|
|
@@ -19,7 +19,7 @@ export interface GitHubActivityCardProps {
|
|
|
19
19
|
item: GitHubActivityItem;
|
|
20
20
|
variant?: 'row' | 'compact';
|
|
21
21
|
className?: string;
|
|
22
|
-
/** Pre-composed `<Link>` prop bundle (typically from a `
|
|
22
|
+
/** Pre-composed `<Link>` prop bundle (typically from a `useNavLinkViaRuntime` hook in
|
|
23
23
|
* the consumer). When provided, the outer renders as a real `<Link>`. */
|
|
24
24
|
anchorProps?: GitHubActivityCardAnchorProps;
|
|
25
25
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { type NewTabRel } from '../utils/new-tab-rel';
|
|
1
2
|
export interface UseEntityCardLinkArgs {
|
|
2
3
|
href: string;
|
|
3
4
|
targetPlatform?: string | null;
|
|
4
5
|
/** Explicit override. When set, runtime decision is skipped. */
|
|
5
6
|
target?: '_blank';
|
|
6
7
|
/** Explicit override. When set, runtime decision is skipped. */
|
|
7
|
-
rel?:
|
|
8
|
+
rel?: NewTabRel;
|
|
8
9
|
}
|
|
9
10
|
export interface EntityCardLinkProps {
|
|
10
11
|
target: '_blank' | undefined;
|
|
11
|
-
rel:
|
|
12
|
+
rel: NewTabRel | undefined;
|
|
12
13
|
}
|
|
13
14
|
export declare function useEntityCardLink({ href, targetPlatform, target, rel }: UseEntityCardLinkArgs): EntityCardLinkProps;
|
|
14
15
|
//# sourceMappingURL=use-entity-card-link.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-entity-card-link.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/entity-cards/use-entity-card-link.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-entity-card-link.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/entity-cards/use-entity-card-link.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,sBAAsB,CAAC;AAEjE,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gEAAgE;IAChE,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,gEAAgE;IAChE,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC7B,GAAG,EAAE,SAAS,GAAG,SAAS,CAAC;CAC5B;AAED,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,qBAAqB,GAAG,mBAAmB,CAkBnH"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { useChatRuntime } from "../../../contexts/chat-runtime-context.js";
|
|
4
|
-
import {
|
|
4
|
+
import { navLinkTarget, newTabAnchorAttrs } from "../utils/nav-anchor-props.js";
|
|
5
|
+
import { newTabRel } from "../utils/new-tab-rel.js";
|
|
5
6
|
function useEntityCardLink({ href, targetPlatform, target, rel }) {
|
|
6
7
|
const runtime = useChatRuntime();
|
|
7
8
|
return useMemo(() => {
|
|
8
9
|
if (target !== void 0 || rel !== void 0) {
|
|
9
|
-
const safeRel = rel ?? (target === "_blank" ?
|
|
10
|
+
const safeRel = rel ?? (target === "_blank" ? newTabRel(href, targetPlatform) : void 0);
|
|
10
11
|
return { target, rel: safeRel };
|
|
11
12
|
}
|
|
12
|
-
const
|
|
13
|
-
|
|
13
|
+
const resolved = navLinkTarget(runtime, href, targetPlatform);
|
|
14
|
+
const attrs = newTabAnchorAttrs(resolved.isNewTab, resolved.href, targetPlatform);
|
|
15
|
+
return { target: attrs.target, rel: attrs.rel };
|
|
14
16
|
}, [target, rel, href, targetPlatform, runtime]);
|
|
15
17
|
}
|
|
16
18
|
export {
|