@inkeep/cxkit-primitives 0.5.33 → 0.5.34
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/atoms/cmdk/index.cjs +1 -1
- package/dist/atoms/cmdk/index.js +96 -95
- package/dist/components/embedded-search/transform-results.cjs +1 -1
- package/dist/components/embedded-search/transform-results.js +14 -15
- package/dist/components/embedded-search/use-inkeep-search.cjs +1 -1
- package/dist/components/embedded-search/use-inkeep-search.js +24 -24
- package/dist/components/embedded-search.cjs +1 -1
- package/dist/components/embedded-search.js +293 -289
- package/dist/index.d.cts +16 -4
- package/dist/index.d.ts +16 -4
- package/dist/providers/base-events-provider.cjs +1 -1
- package/dist/providers/base-events-provider.js +1 -1
- package/package.json +4 -4
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import { Command as
|
|
3
|
+
import { Command as p } from "../atoms/cmdk/index.js";
|
|
4
4
|
import { ikp as r } from "./factory.js";
|
|
5
5
|
import { dataAttr as m, maybeRender as g } from "../utils/misc.js";
|
|
6
|
-
import { forwardRef as w, useEffect as
|
|
6
|
+
import { forwardRef as w, useEffect as L, useState as G, useRef as C, useCallback as M, useMemo as E } from "react";
|
|
7
7
|
import { useSearch as l } from "./embedded-search/search-provider.js";
|
|
8
|
-
import { SearchProvider as
|
|
9
|
-
import
|
|
10
|
-
import { CustomIcon as
|
|
8
|
+
import { SearchProvider as ti } from "./embedded-search/search-provider.js";
|
|
9
|
+
import W from "./tagline-logo-icon.js";
|
|
10
|
+
import { CustomIcon as S } from "../atoms/icons/custom-icon.js";
|
|
11
11
|
import * as T from "@radix-ui/react-scroll-area";
|
|
12
|
-
import * as
|
|
13
|
-
import { useInkeepConfig as
|
|
14
|
-
import { useSearchEvents as
|
|
15
|
-
import { LinkWithQueryParams as
|
|
16
|
-
import { SourceItemProvider as
|
|
17
|
-
import { BuiltInIconRenderer as
|
|
18
|
-
import { highlightEmphasis as
|
|
19
|
-
import { useScrollingFades as
|
|
20
|
-
import { useColorModeValue as
|
|
21
|
-
import
|
|
22
|
-
import { useModal as
|
|
23
|
-
import { useComposedRefs as
|
|
24
|
-
import { composeEventHandlers as
|
|
25
|
-
import { useShadow as
|
|
26
|
-
import { Markdown as
|
|
27
|
-
const P = "__ask_ai__",
|
|
12
|
+
import * as A from "@radix-ui/react-tabs";
|
|
13
|
+
import { useInkeepConfig as b } from "../providers/config-provider.js";
|
|
14
|
+
import { useSearchEvents as q } from "../providers/search-events-provider.js";
|
|
15
|
+
import { LinkWithQueryParams as x } from "../atoms/link.js";
|
|
16
|
+
import { SourceItemProvider as U, useSourceItem as h } from "../providers/source-item-provider.js";
|
|
17
|
+
import { BuiltInIconRenderer as B } from "../atoms/icons/built-in-icon-renderer.js";
|
|
18
|
+
import { highlightEmphasis as j } from "../utils/highlight-emphasis.js";
|
|
19
|
+
import { useScrollingFades as Q } from "../hooks/use-scrolling-fades.js";
|
|
20
|
+
import { useColorModeValue as z } from "@inkeep/cxkit-color-mode";
|
|
21
|
+
import J from "../atoms/avatars/ai.js";
|
|
22
|
+
import { useModal as D } from "./modal/modal-provider.js";
|
|
23
|
+
import { useComposedRefs as k } from "../utils/compose-refs.js";
|
|
24
|
+
import { composeEventHandlers as R } from "../utils/compose-event-handlers.js";
|
|
25
|
+
import { useShadow as X } from "../atoms/shadow/context.js";
|
|
26
|
+
import { Markdown as Y } from "../atoms/markdown/index.js";
|
|
27
|
+
const P = "__ask_ai__", Z = r("div", {
|
|
28
28
|
_id: "aiSearchWrapper"
|
|
29
|
-
}),
|
|
29
|
+
}), rt = (e) => {
|
|
30
30
|
const {
|
|
31
31
|
searchSettings: { view: t }
|
|
32
|
-
} =
|
|
32
|
+
} = b(), { isHidden: i, hasContent: s, isMobile: n } = l(), o = D();
|
|
33
33
|
return /* @__PURE__ */ a(
|
|
34
|
-
|
|
34
|
+
Z,
|
|
35
35
|
{
|
|
36
36
|
"data-hidden": m(i),
|
|
37
37
|
"data-has-content": m(s),
|
|
@@ -42,14 +42,15 @@ const P = "__ask_ai__", J = r("div", {
|
|
|
42
42
|
...e
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
|
-
},
|
|
45
|
+
}, ee = r(p, {
|
|
46
46
|
_id: "aiSearchRoot"
|
|
47
|
-
}),
|
|
48
|
-
const { isHidden: t, selectedItem: i, onSelectedItemChange: s } = l();
|
|
47
|
+
}), st = (e) => {
|
|
48
|
+
const { isHidden: t, selectedItem: i, onSelectedItemChange: s, isMobile: n } = l();
|
|
49
49
|
return /* @__PURE__ */ a(
|
|
50
|
-
|
|
50
|
+
ee,
|
|
51
51
|
{
|
|
52
52
|
"data-hidden": m(t),
|
|
53
|
+
"data-mobile": m(n),
|
|
53
54
|
shouldFilter: !1,
|
|
54
55
|
loop: !1,
|
|
55
56
|
value: i,
|
|
@@ -57,57 +58,57 @@ const P = "__ask_ai__", J = r("div", {
|
|
|
57
58
|
...e
|
|
58
59
|
}
|
|
59
60
|
);
|
|
60
|
-
},
|
|
61
|
+
}, te = r(p.List, {
|
|
61
62
|
_id: "aiSearchContent"
|
|
62
|
-
}),
|
|
63
|
+
}), nt = w((e, t) => {
|
|
63
64
|
const { selectedItem: i } = l();
|
|
64
65
|
return /* @__PURE__ */ a(
|
|
65
|
-
|
|
66
|
+
te,
|
|
66
67
|
{
|
|
67
68
|
"aria-activedescendant": `aiSearchResults__Item-${i}`,
|
|
68
69
|
...e,
|
|
69
70
|
ref: t
|
|
70
71
|
}
|
|
71
72
|
);
|
|
72
|
-
}),
|
|
73
|
+
}), at = r("div", {
|
|
73
74
|
_id: "aiSearchInputGroup"
|
|
74
|
-
}),
|
|
75
|
+
}), ot = r(S, {
|
|
75
76
|
_id: "aiSearchInputIcon",
|
|
76
77
|
iconKey: "search"
|
|
77
|
-
}),
|
|
78
|
+
}), ie = r(p.Input, {
|
|
78
79
|
_id: "aiSearchInput"
|
|
79
|
-
}),
|
|
80
|
-
const { query: s, onInput: n, placeholder: o, inputRef: c, shouldAutoFocusInput: d, selectedItem: u } = l(),
|
|
81
|
-
return
|
|
80
|
+
}), ct = w(({ onInput: e, ...t }, i) => {
|
|
81
|
+
const { query: s, onInput: n, placeholder: o, inputRef: c, shouldAutoFocusInput: d, selectedItem: u } = l(), I = k(i, c), _ = D();
|
|
82
|
+
return L(() => {
|
|
82
83
|
requestAnimationFrame(() => {
|
|
83
84
|
d && c?.current && (c.current.focus(), c.current.selectionStart = c.current.value.length);
|
|
84
85
|
});
|
|
85
|
-
}, [d, c,
|
|
86
|
-
|
|
86
|
+
}, [d, c, _?.isOpen]), /* @__PURE__ */ a(
|
|
87
|
+
ie,
|
|
87
88
|
{
|
|
88
|
-
ref:
|
|
89
|
+
ref: I,
|
|
89
90
|
placeholder: o,
|
|
90
91
|
value: s,
|
|
91
|
-
onInput:
|
|
92
|
+
onInput: R(e, n),
|
|
92
93
|
"aria-activedescendant": `aiSearchResults__Item-${u}`,
|
|
93
94
|
...t
|
|
94
95
|
}
|
|
95
96
|
);
|
|
96
|
-
}),
|
|
97
|
+
}), re = r(B, {
|
|
97
98
|
_id: "aiSearchLoading",
|
|
98
99
|
iconSettings: {
|
|
99
100
|
builtIn: "LuLoaderCircle"
|
|
100
101
|
}
|
|
101
|
-
}),
|
|
102
|
+
}), lt = (e) => {
|
|
102
103
|
const { loading: t, resultsList: i } = l();
|
|
103
|
-
return !t || i.length === 0 ? null : /* @__PURE__ */ a(
|
|
104
|
-
},
|
|
104
|
+
return !t || i.length === 0 ? null : /* @__PURE__ */ a(re, { ...e });
|
|
105
|
+
}, se = r(p.Item, {
|
|
105
106
|
_id: "aiAskAITrigger",
|
|
106
107
|
value: P
|
|
107
|
-
}),
|
|
108
|
+
}), dt = (e) => {
|
|
108
109
|
const { setSelectedItem: t, results: i, tab: s } = l(), n = i[s]?.[0]?.id ?? "NONE";
|
|
109
110
|
return /* @__PURE__ */ a(
|
|
110
|
-
|
|
111
|
+
se,
|
|
111
112
|
{
|
|
112
113
|
...e,
|
|
113
114
|
id: `aiSearchResults__Item-${P}`,
|
|
@@ -115,13 +116,13 @@ const P = "__ask_ai__", J = r("div", {
|
|
|
115
116
|
onPointerLeave: () => t(n)
|
|
116
117
|
}
|
|
117
118
|
);
|
|
118
|
-
},
|
|
119
|
+
}, ne = r("img", {
|
|
119
120
|
_id: "aiAskAITrigger__Icon"
|
|
120
|
-
}),
|
|
121
|
-
const { aiChatSettings: t } =
|
|
122
|
-
return
|
|
121
|
+
}), ut = (e) => {
|
|
122
|
+
const { aiChatSettings: t } = b(), { aiAssistantAvatar: i } = t ?? {}, s = typeof i == "string" ? i : i?.light, n = (typeof i == "string" ? i : i?.dark) ?? s, o = z(s, n), [c, d] = G(o);
|
|
123
|
+
return L(() => {
|
|
123
124
|
d(o);
|
|
124
|
-
}, [o]), /* @__PURE__ */ a(
|
|
125
|
+
}, [o]), /* @__PURE__ */ a(ne, { asChild: !0, ...e, children: c ? (
|
|
125
126
|
// biome-ignore lint/a11y/useAltText: <explanation>
|
|
126
127
|
/* @__PURE__ */ a(
|
|
127
128
|
"img",
|
|
@@ -129,26 +130,26 @@ const P = "__ask_ai__", J = r("div", {
|
|
|
129
130
|
src: c,
|
|
130
131
|
alt: "AI Avatar",
|
|
131
132
|
"data-type": "image",
|
|
132
|
-
onError:
|
|
133
|
+
onError: R(() => {
|
|
133
134
|
d(null);
|
|
134
135
|
}),
|
|
135
136
|
...e
|
|
136
137
|
}
|
|
137
138
|
)
|
|
138
|
-
) : /* @__PURE__ */ a(
|
|
139
|
-
},
|
|
139
|
+
) : /* @__PURE__ */ a(J, { "data-type": "icon", ...e }) });
|
|
140
|
+
}, mt = r("span", {
|
|
140
141
|
_id: "aiAskAITrigger__Label"
|
|
141
|
-
}),
|
|
142
|
+
}), ht = r(S, {
|
|
142
143
|
_id: "aiAskAITrigger__Indicator",
|
|
143
144
|
iconKey: "openLinkInSameTab"
|
|
144
|
-
}),
|
|
145
|
+
}), ae = r(A.Root, {
|
|
145
146
|
_id: "aiSearchResults"
|
|
146
|
-
}),
|
|
147
|
+
}), It = (e) => {
|
|
147
148
|
const {
|
|
148
149
|
searchSettings: { view: t }
|
|
149
|
-
} =
|
|
150
|
+
} = b(), { tab: i, onTabChange: s, hasContent: n, isHidden: o } = l();
|
|
150
151
|
return /* @__PURE__ */ a(
|
|
151
|
-
|
|
152
|
+
ae,
|
|
152
153
|
{
|
|
153
154
|
value: i,
|
|
154
155
|
onValueChange: s,
|
|
@@ -157,60 +158,60 @@ const P = "__ask_ai__", J = r("div", {
|
|
|
157
158
|
...e
|
|
158
159
|
}
|
|
159
160
|
);
|
|
160
|
-
},
|
|
161
|
+
}, oe = r("div", {
|
|
161
162
|
_id: "aiSearchResults__Loading"
|
|
162
|
-
}),
|
|
163
|
+
}), _t = (e) => {
|
|
163
164
|
const { loading: t, resultsList: i } = l();
|
|
164
|
-
return !t || i.length > 0 ? null : /* @__PURE__ */ a(
|
|
165
|
-
},
|
|
165
|
+
return !t || i.length > 0 ? null : /* @__PURE__ */ a(oe, { ...e });
|
|
166
|
+
}, ce = r(p.Empty, {
|
|
166
167
|
_id: "aiSearchResults__Empty"
|
|
167
|
-
}),
|
|
168
|
+
}), vt = (e) => {
|
|
168
169
|
const { query: t, loading: i, results: s, tab: n } = l(), o = s[n]?.length;
|
|
169
|
-
return i || !t || o ? null : /* @__PURE__ */ a(
|
|
170
|
-
},
|
|
170
|
+
return i || !t || o ? null : /* @__PURE__ */ a(ce, { children: "No results found.", ...e });
|
|
171
|
+
}, le = r(A.List, {
|
|
171
172
|
_id: "aiSearchResults__TabList"
|
|
172
|
-
}),
|
|
173
|
+
}), bt = (e) => {
|
|
173
174
|
const { children: t, ...i } = e, {
|
|
174
175
|
searchSettings: { tabs: s }
|
|
175
|
-
} =
|
|
176
|
+
} = b(), { results: n, loading: o, resultsList: c } = l();
|
|
176
177
|
if (o && c.length === 0) return null;
|
|
177
178
|
const d = Object.keys(n);
|
|
178
|
-
return !s.length || !d.length ? null : /* @__PURE__ */ a(
|
|
179
|
-
},
|
|
179
|
+
return !s.length || !d.length ? null : /* @__PURE__ */ a(le, { tabIndex: -1, children: g(t, d), ...i });
|
|
180
|
+
}, de = r(A.Trigger, {
|
|
180
181
|
_id: "aiSearchResults__Tab"
|
|
181
|
-
}),
|
|
182
|
-
const i =
|
|
183
|
-
|
|
184
|
-
},
|
|
185
|
-
return
|
|
186
|
-
v &&
|
|
182
|
+
}), pt = w((e, t) => {
|
|
183
|
+
const i = C(null), s = k(t, i), { tab: n, onClick: o, ...c } = e, { results: d, tab: u, inputRef: I } = l(), _ = d[n].length, v = n === u, f = () => {
|
|
184
|
+
I.current?.focus();
|
|
185
|
+
}, y = X();
|
|
186
|
+
return L(() => {
|
|
187
|
+
v && y?.shadowHost?.shadowRoot?.activeElement?.hasAttribute("ikp-tab") && i.current?.focus();
|
|
187
188
|
}, [v]), /* @__PURE__ */ a(
|
|
188
|
-
|
|
189
|
+
de,
|
|
189
190
|
{
|
|
190
191
|
ref: s,
|
|
191
192
|
"ikp-tab": "",
|
|
192
193
|
tabIndex: v ? 0 : -1,
|
|
193
194
|
value: n,
|
|
194
|
-
children: `${n} (${
|
|
195
|
-
onClick:
|
|
195
|
+
children: `${n} (${_})`,
|
|
196
|
+
onClick: R(o, f),
|
|
196
197
|
...c
|
|
197
198
|
}
|
|
198
199
|
);
|
|
199
|
-
}),
|
|
200
|
+
}), St = r("div", {
|
|
200
201
|
_id: "aiSearchResults__Content"
|
|
201
|
-
}),
|
|
202
|
+
}), ue = r(T.Root, {
|
|
202
203
|
_id: "aiSearchResults__ScrollArea"
|
|
203
|
-
}),
|
|
204
|
+
}), Rt = (e) => {
|
|
204
205
|
const { loading: t, resultsList: i } = l();
|
|
205
|
-
return t && i.length === 0 ? null : /* @__PURE__ */ a(
|
|
206
|
-
},
|
|
206
|
+
return t && i.length === 0 ? null : /* @__PURE__ */ a(ue, { tabIndex: -1, ...e });
|
|
207
|
+
}, me = r(T.Viewport, {
|
|
207
208
|
_id: "aiSearchResults__ScrollAreaViewport"
|
|
208
|
-
}),
|
|
209
|
-
const s =
|
|
210
|
-
return
|
|
209
|
+
}), Pt = w(({ children: e, ...t }, i) => {
|
|
210
|
+
const s = Q(), n = k(i, s), { tab: o } = l();
|
|
211
|
+
return L(() => {
|
|
211
212
|
o && s.current?.scrollTo({ top: 0, behavior: "auto" });
|
|
212
213
|
}, [o]), /* @__PURE__ */ a(
|
|
213
|
-
|
|
214
|
+
me,
|
|
214
215
|
{
|
|
215
216
|
ref: n,
|
|
216
217
|
tabIndex: -1,
|
|
@@ -221,21 +222,21 @@ const P = "__ask_ai__", J = r("div", {
|
|
|
221
222
|
...t
|
|
222
223
|
}
|
|
223
224
|
);
|
|
224
|
-
}),
|
|
225
|
+
}), gt = r(
|
|
225
226
|
T.ScrollAreaScrollbar,
|
|
226
227
|
{
|
|
227
228
|
_id: "aiSearchResults__ScrollAreaScrollbar"
|
|
228
229
|
}
|
|
229
|
-
),
|
|
230
|
+
), wt = r(T.ScrollAreaThumb, {
|
|
230
231
|
_id: "aiSearchResults__ScrollAreaThumb"
|
|
231
|
-
}),
|
|
232
|
+
}), Tt = r(T.Corner, {
|
|
232
233
|
_id: "aiSearchResults__ScrollAreaCorner"
|
|
233
|
-
}),
|
|
234
|
+
}), he = r(A.Content, {
|
|
234
235
|
_id: "aiSearchResults__List"
|
|
235
|
-
}),
|
|
236
|
+
}), ft = (e) => {
|
|
236
237
|
const { children: t, ...i } = e, { results: s, tab: n } = l(), o = s[n] ?? [];
|
|
237
238
|
return /* @__PURE__ */ a(
|
|
238
|
-
|
|
239
|
+
he,
|
|
239
240
|
{
|
|
240
241
|
value: n,
|
|
241
242
|
"data-has-results": m(o.length > 0),
|
|
@@ -245,88 +246,91 @@ const P = "__ask_ai__", J = r("div", {
|
|
|
245
246
|
...i
|
|
246
247
|
}
|
|
247
248
|
);
|
|
248
|
-
},
|
|
249
|
+
}, Ie = r(p.Item, {
|
|
249
250
|
_id: "aiSearchResults__Item",
|
|
250
251
|
asChild: !0
|
|
251
|
-
}),
|
|
252
|
+
}), Et = w(({ item: e, onClick: t, onSelect: i, children: s, ...n }, o) => {
|
|
252
253
|
const {
|
|
253
254
|
searchSettings: { shouldOpenLinksInNewTab: c, view: d }
|
|
254
|
-
} =
|
|
255
|
-
f.current?.click();
|
|
256
|
-
},
|
|
255
|
+
} = b(), { logEvent: u } = q(), { query: I, transitionsDisabled: _, selectedItem: v } = l(), f = C(null), y = k(o, f), N = M(($) => {
|
|
256
|
+
$.trigger === "keyboard" && f.current?.click();
|
|
257
|
+
}, []), H = M(() => {
|
|
257
258
|
u({
|
|
258
259
|
eventName: "search_result_clicked",
|
|
259
260
|
properties: {
|
|
260
|
-
searchQuery:
|
|
261
|
+
searchQuery: I,
|
|
261
262
|
title: e.title,
|
|
262
263
|
url: e.url
|
|
263
264
|
}
|
|
264
265
|
});
|
|
265
|
-
},
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
}, [u, I, e.title, e.url]), O = E(
|
|
267
|
+
() => e.shouldOpenInNewTab !== void 0 ? e.shouldOpenInNewTab : c,
|
|
268
|
+
[e.shouldOpenInNewTab, c]
|
|
269
|
+
), F = v === e.id, V = F || (v === "NONE" || v === P), K = E(
|
|
270
|
+
() => ({
|
|
271
|
+
href: e.url,
|
|
272
|
+
isExternal: O,
|
|
273
|
+
appendToUrl: e.appendToUrl,
|
|
274
|
+
children: s,
|
|
275
|
+
id: `aiSearchResults__Item-${e.id}`
|
|
276
|
+
}),
|
|
277
|
+
[e.url, O, e.appendToUrl, s, e.id]
|
|
278
|
+
);
|
|
279
|
+
return /* @__PURE__ */ a(U, { source: { ...e, isExternal: O }, children: /* @__PURE__ */ a(
|
|
280
|
+
Ie,
|
|
268
281
|
{
|
|
269
|
-
ref:
|
|
282
|
+
ref: y,
|
|
270
283
|
value: e.id,
|
|
271
284
|
"data-type": e.type,
|
|
272
285
|
"data-breadcrumbs": !!e.breadcrumbs?.length,
|
|
273
|
-
"data-disable-transitions": m(
|
|
286
|
+
"data-disable-transitions": m(_),
|
|
274
287
|
"data-view": d,
|
|
275
|
-
onSelect:
|
|
276
|
-
onClick:
|
|
277
|
-
"data-selected": m(
|
|
278
|
-
tabIndex:
|
|
288
|
+
onSelect: R(i, N),
|
|
289
|
+
onClick: R(t, H),
|
|
290
|
+
"data-selected": m(F),
|
|
291
|
+
tabIndex: V ? 0 : -1,
|
|
279
292
|
...n,
|
|
280
|
-
children: /* @__PURE__ */ a(
|
|
281
|
-
O,
|
|
282
|
-
{
|
|
283
|
-
href: e.url,
|
|
284
|
-
isExternal: N,
|
|
285
|
-
appendToUrl: e.appendToUrl,
|
|
286
|
-
children: s,
|
|
287
|
-
id: `aiSearchResults__Item-${e.id}`
|
|
288
|
-
}
|
|
289
|
-
)
|
|
293
|
+
children: /* @__PURE__ */ a(x, { ...K })
|
|
290
294
|
}
|
|
291
295
|
) });
|
|
292
|
-
}),
|
|
296
|
+
}), _e = r("div", {
|
|
293
297
|
_id: "aiSearchResults__ItemBreadcrumbs"
|
|
294
|
-
}),
|
|
298
|
+
}), ve = (e) => {
|
|
295
299
|
const { source: t } = h(), { tab: i } = l();
|
|
296
300
|
if (!t.breadcrumbs?.length) return null;
|
|
297
301
|
const { children: s, ...n } = e, c = t.tabs?.find((d) => typeof d != "string" && d[0] === i)?.[1]?.breadcrumbs ?? t.breadcrumbs ?? [];
|
|
298
302
|
return /* @__PURE__ */ a(
|
|
299
|
-
|
|
303
|
+
_e,
|
|
300
304
|
{
|
|
301
305
|
"aria-hidden": "true",
|
|
302
306
|
children: g(s, c),
|
|
303
307
|
...n
|
|
304
308
|
}
|
|
305
309
|
);
|
|
306
|
-
},
|
|
310
|
+
}, be = r(S, {
|
|
307
311
|
_id: "aiSearchResults__ItemBreadcrumbIcon",
|
|
308
312
|
iconKey: "breadcrumbSeparator"
|
|
309
|
-
}),
|
|
313
|
+
}), pe = r(B, {
|
|
310
314
|
_id: "aiSearchResults__ItemIcon"
|
|
311
|
-
}),
|
|
315
|
+
}), Lt = (e) => {
|
|
312
316
|
const { source: t } = h();
|
|
313
|
-
return /* @__PURE__ */ a(
|
|
314
|
-
},
|
|
317
|
+
return /* @__PURE__ */ a(pe, { iconSettings: t.icon, "data-type": t.type, ...e });
|
|
318
|
+
}, Se = r("span", {
|
|
315
319
|
_id: "aiSearchResults__ItemTitle"
|
|
316
|
-
}),
|
|
320
|
+
}), At = (e) => {
|
|
317
321
|
const { source: t } = h();
|
|
318
|
-
return /* @__PURE__ */ a(
|
|
319
|
-
},
|
|
322
|
+
return /* @__PURE__ */ a(Se, { "data-type": t.type, children: t.title, ...e });
|
|
323
|
+
}, Re = r("span", {
|
|
320
324
|
_id: "aiSearchResults__ItemTag"
|
|
321
|
-
}),
|
|
325
|
+
}), kt = (e) => {
|
|
322
326
|
const { source: t } = h();
|
|
323
|
-
return /* @__PURE__ */ a(
|
|
324
|
-
},
|
|
327
|
+
return /* @__PURE__ */ a(Re, { "data-type": t.type, children: t.tag, ...e });
|
|
328
|
+
}, Pe = r("span", {
|
|
325
329
|
_id: "aiSearchResults__ItemDescription"
|
|
326
|
-
}),
|
|
327
|
-
const { source: t } = h(), { children: i, ...s } = e, n =
|
|
330
|
+
}), yt = (e) => {
|
|
331
|
+
const { source: t } = h(), { children: i, ...s } = e, n = E(() => t.description ? j(t.description) : [], [t.description]);
|
|
328
332
|
return n.length ? /* @__PURE__ */ a(
|
|
329
|
-
|
|
333
|
+
Pe,
|
|
330
334
|
{
|
|
331
335
|
"data-type": t.type,
|
|
332
336
|
"aria-hidden": "true",
|
|
@@ -334,12 +338,12 @@ const P = "__ask_ai__", J = r("div", {
|
|
|
334
338
|
...s
|
|
335
339
|
}
|
|
336
340
|
) : null;
|
|
337
|
-
},
|
|
341
|
+
}, ge = r("span", {
|
|
338
342
|
_id: "aiSearchResults__ItemDescriptionPart"
|
|
339
|
-
}),
|
|
343
|
+
}), Ot = (e) => {
|
|
340
344
|
const { part: t, ...i } = e, { source: s } = h();
|
|
341
345
|
return typeof t == "string" ? t : /* @__PURE__ */ a(
|
|
342
|
-
|
|
346
|
+
ge,
|
|
343
347
|
{
|
|
344
348
|
"data-type": s.type,
|
|
345
349
|
children: t.content,
|
|
@@ -347,42 +351,42 @@ const P = "__ask_ai__", J = r("div", {
|
|
|
347
351
|
...i
|
|
348
352
|
}
|
|
349
353
|
);
|
|
350
|
-
},
|
|
354
|
+
}, we = r(S, {
|
|
351
355
|
_id: "aiSearchResults__ItemIndicator"
|
|
352
|
-
}),
|
|
356
|
+
}), Ct = (e) => {
|
|
353
357
|
const { source: t } = h(), {
|
|
354
358
|
searchSettings: { view: i }
|
|
355
|
-
} =
|
|
359
|
+
} = b();
|
|
356
360
|
return /* @__PURE__ */ a(
|
|
357
|
-
|
|
361
|
+
we,
|
|
358
362
|
{
|
|
359
363
|
iconKey: t.isExternal ? "openLinkInNewTab" : "openLinkInSameTab",
|
|
360
364
|
"data-view": i,
|
|
361
365
|
...e
|
|
362
366
|
}
|
|
363
367
|
);
|
|
364
|
-
},
|
|
368
|
+
}, Te = r("div", {
|
|
365
369
|
_id: "aiSearchResults__ItemPreview",
|
|
366
370
|
"aria-hidden": !0
|
|
367
|
-
}),
|
|
371
|
+
}), xt = (e) => {
|
|
368
372
|
const {
|
|
369
373
|
searchSettings: { view: t, shouldOpenLinksInNewTab: i }
|
|
370
|
-
} =
|
|
374
|
+
} = b(), { results: s, tab: n, selectedItem: o } = l(), c = s[n] ?? [], d = C(null), u = E(() => {
|
|
371
375
|
if (o === P) return d.current;
|
|
372
|
-
const
|
|
373
|
-
return d.current =
|
|
376
|
+
const _ = c.find((v) => v.id === o);
|
|
377
|
+
return d.current = _ ?? null, _;
|
|
374
378
|
}, [o]);
|
|
375
379
|
if (t !== "dual-pane" || o === P || !u) return null;
|
|
376
|
-
const
|
|
377
|
-
return /* @__PURE__ */ a(
|
|
378
|
-
},
|
|
380
|
+
const I = u.shouldOpenInNewTab !== void 0 ? u.shouldOpenInNewTab : i;
|
|
381
|
+
return /* @__PURE__ */ a(U, { source: { ...u, isExternal: I }, children: /* @__PURE__ */ a(Te, { ...e }) });
|
|
382
|
+
}, Bt = r("div", {
|
|
379
383
|
_id: "aiSearchResults__ItemPreview__Header"
|
|
380
|
-
}),
|
|
384
|
+
}), fe = r(x, {
|
|
381
385
|
_id: "aiSearchResults__ItemPreview__Heading"
|
|
382
|
-
}),
|
|
386
|
+
}), Nt = (e) => {
|
|
383
387
|
const { source: t } = h();
|
|
384
388
|
return /* @__PURE__ */ a(
|
|
385
|
-
|
|
389
|
+
fe,
|
|
386
390
|
{
|
|
387
391
|
href: t.url,
|
|
388
392
|
isExternal: t.isExternal,
|
|
@@ -391,101 +395,101 @@ const P = "__ask_ai__", J = r("div", {
|
|
|
391
395
|
...e
|
|
392
396
|
}
|
|
393
397
|
);
|
|
394
|
-
},
|
|
398
|
+
}, Ee = r("span", {
|
|
395
399
|
_id: "aiSearchResults__ItemPreview__Title"
|
|
396
|
-
}),
|
|
400
|
+
}), Ht = (e) => {
|
|
397
401
|
const { source: t } = h();
|
|
398
|
-
return /* @__PURE__ */ a(
|
|
399
|
-
},
|
|
402
|
+
return /* @__PURE__ */ a(Ee, { children: t.title, ...e });
|
|
403
|
+
}, Le = r(S, {
|
|
400
404
|
_id: "aiSearchResults__ItemPreview__Title__LinkIcon",
|
|
401
405
|
iconKey: "openLinkInNewTab"
|
|
402
|
-
}),
|
|
406
|
+
}), Ft = (e) => {
|
|
403
407
|
const { source: t } = h();
|
|
404
408
|
return /* @__PURE__ */ a(
|
|
405
|
-
|
|
409
|
+
Le,
|
|
406
410
|
{
|
|
407
411
|
iconKey: t.isExternal ? "openLinkInNewTab" : "openLinkInSameTab",
|
|
408
412
|
...e
|
|
409
413
|
}
|
|
410
414
|
);
|
|
411
|
-
},
|
|
412
|
-
|
|
415
|
+
}, Mt = r(
|
|
416
|
+
ve,
|
|
413
417
|
{
|
|
414
418
|
_id: "aiSearchResults__ItemPreview__Breadcrumbs"
|
|
415
419
|
}
|
|
416
|
-
),
|
|
417
|
-
|
|
420
|
+
), Ut = r(
|
|
421
|
+
be,
|
|
418
422
|
{
|
|
419
423
|
_id: "aiSearchResults__ItemPreview__BreadcrumbIcon"
|
|
420
424
|
}
|
|
421
|
-
),
|
|
425
|
+
), Ae = r(Y, {
|
|
422
426
|
_id: "aiSearchResults__ItemPreview__Body"
|
|
423
|
-
}),
|
|
427
|
+
}), Dt = (e) => {
|
|
424
428
|
const { source: t } = h(), { resultsList: i } = l(), s = i.find((o) => o.id === t.id), {
|
|
425
429
|
searchSettings: { shouldOpenLinksInNewTab: n }
|
|
426
|
-
} =
|
|
430
|
+
} = b();
|
|
427
431
|
return s ? /* @__PURE__ */ a(
|
|
428
|
-
|
|
432
|
+
Ae,
|
|
429
433
|
{
|
|
430
434
|
shouldOpenLinksInNewTab: n,
|
|
431
435
|
children: s.preview,
|
|
432
436
|
...e
|
|
433
437
|
}
|
|
434
438
|
) : null;
|
|
435
|
-
},
|
|
439
|
+
}, ke = r("div", {
|
|
436
440
|
_id: "aiSearchResults__ItemPreview__Outline"
|
|
437
|
-
}),
|
|
441
|
+
}), Vt = (e) => {
|
|
438
442
|
const { source: t } = h(), { resultsList: i } = l();
|
|
439
|
-
return i.find((o) => o.id === t.id)?.rootRecord.topLevelHeadings?.length ? /* @__PURE__ */ a(
|
|
440
|
-
},
|
|
443
|
+
return i.find((o) => o.id === t.id)?.rootRecord.topLevelHeadings?.length ? /* @__PURE__ */ a(ke, { ...e }) : null;
|
|
444
|
+
}, Kt = r("span", {
|
|
441
445
|
_id: "aiSearchResults__ItemPreview__Outline__Title",
|
|
442
446
|
children: "On this page"
|
|
443
|
-
}),
|
|
447
|
+
}), ye = r("ul", {
|
|
444
448
|
_id: "aiSearchResults__ItemPreview__Outline__List"
|
|
445
|
-
}),
|
|
449
|
+
}), $t = (e) => {
|
|
446
450
|
const { source: t } = h(), { resultsList: i } = l(), s = i.find((u) => u.id === t.id), n = s?.rootRecord.topLevelHeadings;
|
|
447
451
|
if (!n?.length) return null;
|
|
448
452
|
const o = n.map((u) => {
|
|
449
|
-
const
|
|
453
|
+
const I = u?.anchor && u?.anchor === s?.content?.anchor, _ = u?.anchor === s?.pathHeadings?.[0]?.anchor;
|
|
450
454
|
return {
|
|
451
455
|
...u,
|
|
452
|
-
isMatch:
|
|
456
|
+
isMatch: I || _
|
|
453
457
|
};
|
|
454
458
|
}), { children: c, ...d } = e;
|
|
455
|
-
return /* @__PURE__ */ a(
|
|
456
|
-
},
|
|
459
|
+
return /* @__PURE__ */ a(ye, { children: g(c, o), ...d });
|
|
460
|
+
}, Oe = r(x, {
|
|
457
461
|
_id: "aiSearchResults__ItemPreview__Outline__Item"
|
|
458
|
-
}),
|
|
462
|
+
}), Gt = (e) => {
|
|
459
463
|
const {
|
|
460
464
|
searchSettings: { shouldOpenLinksInNewTab: t }
|
|
461
|
-
} =
|
|
462
|
-
return /* @__PURE__ */ a(
|
|
463
|
-
},
|
|
465
|
+
} = b();
|
|
466
|
+
return /* @__PURE__ */ a(Oe, { isExternal: t, ...e });
|
|
467
|
+
}, Wt = r(S, {
|
|
464
468
|
_id: "aiSearchResults__ItemPreview__Outline__ItemIcon",
|
|
465
469
|
iconKey: "newLine"
|
|
466
|
-
}),
|
|
470
|
+
}), Ce = r("span", {
|
|
467
471
|
_id: "aiSearchResults__ItemPreview__Outline__ItemText"
|
|
468
|
-
}),
|
|
469
|
-
|
|
472
|
+
}), qt = (e) => /* @__PURE__ */ a(Ce, { ...e }), jt = r(
|
|
473
|
+
B,
|
|
470
474
|
{
|
|
471
475
|
_id: "aiSearchResults__ItemPreview__Outline__ItemLinkIcon",
|
|
472
476
|
iconSettings: {
|
|
473
477
|
builtIn: "LuLink"
|
|
474
478
|
}
|
|
475
479
|
}
|
|
476
|
-
),
|
|
480
|
+
), xe = r("div", {
|
|
477
481
|
_id: "aiSearchFooter"
|
|
478
|
-
}),
|
|
482
|
+
}), Qt = (e) => {
|
|
479
483
|
const { hasContent: t } = l();
|
|
480
|
-
return /* @__PURE__ */ a(
|
|
481
|
-
},
|
|
484
|
+
return /* @__PURE__ */ a(xe, { "data-has-results": m(t), ...e });
|
|
485
|
+
}, zt = r("div", {
|
|
482
486
|
_id: "aiSearchTagline__Container"
|
|
483
|
-
}),
|
|
487
|
+
}), Jt = r("span", {
|
|
484
488
|
_id: "aiSearchTagline__Text",
|
|
485
489
|
children: "Powered by"
|
|
486
|
-
}),
|
|
490
|
+
}), Xt = r(W, {
|
|
487
491
|
_id: "aiSearchTagline__Logo"
|
|
488
|
-
}),
|
|
492
|
+
}), Yt = r("a", {
|
|
489
493
|
_id: "aiSearchTagline__BrandName",
|
|
490
494
|
children: "inkeep",
|
|
491
495
|
href: "https://www.inkeep.com/",
|
|
@@ -494,100 +498,100 @@ const P = "__ask_ai__", J = r("div", {
|
|
|
494
498
|
});
|
|
495
499
|
export {
|
|
496
500
|
P as ASK_AI_TRIGGER_VALUE,
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
501
|
+
dt as AskAITrigger,
|
|
502
|
+
ut as AskAITriggerIcon,
|
|
503
|
+
ht as AskAITriggerIndicator,
|
|
504
|
+
mt as AskAITriggerLabel,
|
|
505
|
+
nt as Content,
|
|
506
|
+
ot as EmbeddedSearchInputIcon,
|
|
507
|
+
dt as EmbeddedSearchPrimitiveAskAITrigger,
|
|
508
|
+
ut as EmbeddedSearchPrimitiveAskAITriggerIcon,
|
|
509
|
+
ht as EmbeddedSearchPrimitiveAskAITriggerIndicator,
|
|
510
|
+
mt as EmbeddedSearchPrimitiveAskAITriggerLabel,
|
|
511
|
+
nt as EmbeddedSearchPrimitiveContent,
|
|
512
|
+
Qt as EmbeddedSearchPrimitiveFooter,
|
|
513
|
+
ct as EmbeddedSearchPrimitiveInput,
|
|
514
|
+
at as EmbeddedSearchPrimitiveInputGroup,
|
|
515
|
+
lt as EmbeddedSearchPrimitiveLoading,
|
|
516
|
+
It as EmbeddedSearchPrimitiveResults,
|
|
517
|
+
St as EmbeddedSearchPrimitiveResultsContent,
|
|
518
|
+
vt as EmbeddedSearchPrimitiveResultsEmpty,
|
|
519
|
+
Et as EmbeddedSearchPrimitiveResultsItem,
|
|
520
|
+
ve as EmbeddedSearchPrimitiveResultsItemBreadcrumbs,
|
|
521
|
+
yt as EmbeddedSearchPrimitiveResultsItemDescription,
|
|
522
|
+
Ot as EmbeddedSearchPrimitiveResultsItemDescriptionPart,
|
|
523
|
+
Lt as EmbeddedSearchPrimitiveResultsItemIcon,
|
|
524
|
+
Ct as EmbeddedSearchPrimitiveResultsItemIndicator,
|
|
525
|
+
xt as EmbeddedSearchPrimitiveResultsItemPreview,
|
|
526
|
+
Dt as EmbeddedSearchPrimitiveResultsItemPreviewBody,
|
|
527
|
+
Ut as EmbeddedSearchPrimitiveResultsItemPreviewBreadcrumbIcon,
|
|
528
|
+
Nt as EmbeddedSearchPrimitiveResultsItemPreviewHeading,
|
|
529
|
+
Vt as EmbeddedSearchPrimitiveResultsItemPreviewOutline,
|
|
530
|
+
Gt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItem,
|
|
531
|
+
Wt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemIcon,
|
|
532
|
+
jt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemLinkIcon,
|
|
533
|
+
qt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineItemText,
|
|
534
|
+
$t as EmbeddedSearchPrimitiveResultsItemPreviewOutlineList,
|
|
535
|
+
Kt as EmbeddedSearchPrimitiveResultsItemPreviewOutlineTitle,
|
|
536
|
+
Ht as EmbeddedSearchPrimitiveResultsItemPreviewTitle,
|
|
537
|
+
Ft as EmbeddedSearchPrimitiveResultsItemPreviewTitleLinkIcon,
|
|
538
|
+
kt as EmbeddedSearchPrimitiveResultsItemTag,
|
|
539
|
+
At as EmbeddedSearchPrimitiveResultsItemTitle,
|
|
540
|
+
ft as EmbeddedSearchPrimitiveResultsList,
|
|
541
|
+
_t as EmbeddedSearchPrimitiveResultsLoading,
|
|
542
|
+
Rt as EmbeddedSearchPrimitiveResultsScrollArea,
|
|
543
|
+
Pt as EmbeddedSearchPrimitiveResultsScrollAreaViewport,
|
|
544
|
+
pt as EmbeddedSearchPrimitiveResultsTab,
|
|
545
|
+
bt as EmbeddedSearchPrimitiveResultsTabList,
|
|
546
|
+
st as EmbeddedSearchPrimitiveRoot,
|
|
547
|
+
rt as EmbeddedSearchPrimitiveWrapper,
|
|
548
|
+
Qt as Footer,
|
|
549
|
+
ct as Input,
|
|
550
|
+
at as InputGroup,
|
|
551
|
+
ot as InputIcon,
|
|
552
|
+
lt as Loading,
|
|
553
|
+
te as PrimitiveContent,
|
|
554
|
+
ti as Provider,
|
|
555
|
+
It as Results,
|
|
556
|
+
St as ResultsContent,
|
|
557
|
+
vt as ResultsEmpty,
|
|
558
|
+
Et as ResultsItem,
|
|
559
|
+
be as ResultsItemBreadcrumbIcon,
|
|
560
|
+
ve as ResultsItemBreadcrumbs,
|
|
561
|
+
yt as ResultsItemDescription,
|
|
562
|
+
Ot as ResultsItemDescriptionPart,
|
|
563
|
+
Lt as ResultsItemIcon,
|
|
564
|
+
Ct as ResultsItemIndicator,
|
|
565
|
+
xt as ResultsItemPreview,
|
|
566
|
+
Dt as ResultsItemPreviewBody,
|
|
567
|
+
Ut as ResultsItemPreviewBreadcrumbIcon,
|
|
568
|
+
Mt as ResultsItemPreviewBreadcrumbs,
|
|
569
|
+
Bt as ResultsItemPreviewHeader,
|
|
570
|
+
Nt as ResultsItemPreviewHeading,
|
|
571
|
+
Vt as ResultsItemPreviewOutline,
|
|
572
|
+
Gt as ResultsItemPreviewOutlineItem,
|
|
573
|
+
Wt as ResultsItemPreviewOutlineItemIcon,
|
|
574
|
+
jt as ResultsItemPreviewOutlineItemLinkIcon,
|
|
575
|
+
qt as ResultsItemPreviewOutlineItemText,
|
|
576
|
+
$t as ResultsItemPreviewOutlineList,
|
|
577
|
+
Kt as ResultsItemPreviewOutlineTitle,
|
|
578
|
+
Ht as ResultsItemPreviewTitle,
|
|
579
|
+
Ft as ResultsItemPreviewTitleLinkIcon,
|
|
580
|
+
kt as ResultsItemTag,
|
|
581
|
+
At as ResultsItemTitle,
|
|
582
|
+
ft as ResultsList,
|
|
583
|
+
_t as ResultsLoading,
|
|
584
|
+
Rt as ResultsScrollArea,
|
|
585
|
+
Tt as ResultsScrollAreaCorner,
|
|
586
|
+
gt as ResultsScrollAreaScrollbar,
|
|
587
|
+
wt as ResultsScrollAreaThumb,
|
|
588
|
+
Pt as ResultsScrollAreaViewport,
|
|
589
|
+
pt as ResultsTab,
|
|
590
|
+
bt as ResultsTabList,
|
|
591
|
+
st as Root,
|
|
592
|
+
Yt as TaglineBrandName,
|
|
593
|
+
zt as TaglineContainer,
|
|
594
|
+
Xt as TaglineLogo,
|
|
595
|
+
Jt as TaglineText,
|
|
596
|
+
rt as Wrapper
|
|
593
597
|
};
|