@inkeep/cxkit-primitives 0.5.30 → 0.5.31

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