vitepress 2.0.0-alpha.7 → 2.0.0-alpha.9

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.
@@ -12,8 +12,6 @@ const props = defineProps<{
12
12
  const router = useRouter()
13
13
  const { site, localeIndex, lang } = useData()
14
14
 
15
- type DocSearchProps = Parameters<typeof docsearch>[0]
16
-
17
15
  onMounted(update)
18
16
  watch(localeIndex, update)
19
17
 
@@ -31,37 +29,54 @@ async function update() {
31
29
  ).filter((f) => !f.startsWith('lang:')),
32
30
  `lang:${lang.value}`
33
31
  ]
32
+
33
+ // Rebuild the askAi prop as an object:
34
+ // If the askAi prop is a string, treat it as the assistantId and use
35
+ // the default indexName, apiKey and appId from the main options.
36
+ // If the askAi prop is an object, spread its explicit values.
37
+ const askAiProp = options.askAi
38
+ const isAskAiString = typeof askAiProp === 'string'
39
+
40
+ const askAi = askAiProp
41
+ ? {
42
+ indexName: isAskAiString ? options.indexName : askAiProp.indexName,
43
+ apiKey: isAskAiString ? options.apiKey : askAiProp.apiKey,
44
+ appId: isAskAiString ? options.appId : askAiProp.appId,
45
+ assistantId: isAskAiString ? askAiProp : askAiProp.assistantId,
46
+ // Re-use the merged facetFilters from the search parameters so that
47
+ // Ask AI uses the same language filtering as the regular search.
48
+ searchParameters: facetFilters.length ? { facetFilters } : undefined
49
+ }
50
+ : undefined
51
+
34
52
  initialize({
35
53
  ...options,
36
54
  searchParameters: {
37
55
  ...options.searchParameters,
38
56
  facetFilters
39
- }
57
+ },
58
+ askAi
40
59
  })
41
60
  }
42
61
 
43
62
  function initialize(userOptions: DefaultTheme.AlgoliaSearchOptions) {
44
- const options = Object.assign<
45
- {},
46
- DefaultTheme.AlgoliaSearchOptions,
47
- Partial<DocSearchProps>
48
- >({}, userOptions, {
63
+ const options = Object.assign({}, userOptions, {
49
64
  container: '#docsearch',
50
65
 
51
66
  navigator: {
52
- navigate({ itemUrl }) {
53
- router.go(itemUrl)
67
+ navigate(item: { itemUrl: string }) {
68
+ router.go(item.itemUrl)
54
69
  }
55
70
  },
56
71
 
57
- transformItems(items) {
72
+ transformItems(items: { url: string }[]) {
58
73
  return items.map((item) => {
59
74
  return Object.assign({}, item, {
60
75
  url: getRelativePath(item.url)
61
76
  })
62
77
  })
63
78
  }
64
- }) as DocSearchProps
79
+ })
65
80
 
66
81
  docsearch(options)
67
82
  }
@@ -2,12 +2,7 @@
2
2
  import '@docsearch/css'
3
3
  import { onKeyStroke } from '@vueuse/core'
4
4
  import type { DefaultTheme } from 'vitepress/theme'
5
- import {
6
- defineAsyncComponent,
7
- onMounted,
8
- onUnmounted,
9
- ref
10
- } from 'vue'
5
+ import { defineAsyncComponent, onMounted, onUnmounted, ref } from 'vue'
11
6
  import { useData } from '../composables/data'
12
7
  import VPNavBarSearchButton from './VPNavBarSearchButton.vue'
13
8
 
@@ -174,21 +169,4 @@ const provider = __ALGOLIA__ ? 'algolia' : __VP_LOCAL_SEARCH__ ? 'local' : ''
174
169
  padding-left: 32px;
175
170
  }
176
171
  }
177
-
178
- .dark .DocSearch-Footer {
179
- border-top: 1px solid var(--vp-c-divider);
180
- }
181
-
182
- .DocSearch-Form {
183
- border: 1px solid var(--vp-c-brand-1);
184
- background-color: var(--vp-c-white);
185
- }
186
-
187
- .dark .DocSearch-Form {
188
- background-color: var(--vp-c-default-soft);
189
- }
190
-
191
- .DocSearch-Screen-Icon > svg {
192
- margin: auto;
193
- }
194
172
  </style>
@@ -2,7 +2,7 @@
2
2
  import type { ButtonTranslations } from '../../../../types/local-search'
3
3
  import { createSearchTranslate } from '../support/translation'
4
4
 
5
- // Button-Translations
5
+ // button translations
6
6
  const defaultTranslations: { button: ButtonTranslations } = {
7
7
  button: {
8
8
  buttonText: 'Search',
@@ -14,200 +14,123 @@ const translate = createSearchTranslate(defaultTranslations)
14
14
  </script>
15
15
 
16
16
  <template>
17
- <button type="button" class="DocSearch DocSearch-Button" :aria-label="translate('button.buttonAriaLabel')">
17
+ <button
18
+ type="button"
19
+ :aria-label="translate('button.buttonAriaLabel')"
20
+ aria-keyshortcuts="/ control+k meta+k"
21
+ class="DocSearch DocSearch-Button"
22
+ >
18
23
  <span class="DocSearch-Button-Container">
19
- <span class="vp-icon DocSearch-Search-Icon"></span>
24
+ <span class="vpi-search DocSearch-Search-Icon"></span>
20
25
  <span class="DocSearch-Button-Placeholder">{{ translate('button.buttonText') }}</span>
21
26
  </span>
22
27
  <span class="DocSearch-Button-Keys">
23
28
  <kbd class="DocSearch-Button-Key"></kbd>
24
- <kbd class="DocSearch-Button-Key">K</kbd>
29
+ <kbd class="DocSearch-Button-Key"></kbd>
25
30
  </span>
26
31
  </button>
27
32
  </template>
28
33
 
29
34
  <style>
30
35
  [class*='DocSearch'] {
31
- --docsearch-primary-color: var(--vp-c-brand-1);
32
- --docsearch-highlight-color: var(--docsearch-primary-color);
33
- --docsearch-text-color: var(--vp-c-text-1);
36
+ --docsearch-background-color: var(--vp-c-bg-soft);
37
+ --docsearch-container-background: var(--vp-backdrop-bg-color);
38
+ --docsearch-focus-color: var(--vp-c-brand-1);
39
+ --docsearch-footer-background: var(--vp-c-bg);
40
+ --docsearch-highlight-color: var(--vp-c-brand-1);
41
+ --docsearch-hit-background: var(--vp-c-default-soft);
42
+ --docsearch-hit-color: var(--vp-c-text-1);
43
+ --docsearch-hit-highlight-color: var(--vp-c-brand-soft);
44
+ --docsearch-icon-color: var(--vp-c-text-2);
45
+ --docsearch-key-background: transparent;
46
+ --docsearch-key-color: var(--vp-c-text-2);
47
+ --docsearch-modal-background: var(--vp-c-bg-soft);
34
48
  --docsearch-muted-color: var(--vp-c-text-2);
35
- --docsearch-searchbox-shadow: none;
36
- --docsearch-searchbox-background: transparent;
49
+ --docsearch-primary-color: var(--vp-c-brand-1);
37
50
  --docsearch-searchbox-focus-background: transparent;
38
- --docsearch-key-gradient: transparent;
39
- --docsearch-key-shadow: none;
40
- --docsearch-modal-background: var(--vp-c-bg-soft);
41
- --docsearch-footer-background: var(--vp-c-bg);
51
+ --docsearch-secondary-text-color: var(--vp-c-text-2);
52
+ --docsearch-soft-primary-color: var(--vp-c-brand-soft);
53
+ --docsearch-subtle-color: var(--vp-c-divider);
54
+ --docsearch-success-color: var(--vp-c-brand-soft);
55
+ --docsearch-text-color: var(--vp-c-text-1);
42
56
  }
43
57
 
44
58
  .dark [class*='DocSearch'] {
45
59
  --docsearch-modal-shadow: none;
46
- --docsearch-footer-shadow: none;
47
- --docsearch-logo-color: var(--vp-c-text-2);
48
- --docsearch-hit-background: var(--vp-c-default-soft);
49
- --docsearch-hit-color: var(--vp-c-text-2);
50
- --docsearch-hit-shadow: none;
51
- }
52
-
53
- .DocSearch-Button {
54
- display: flex;
55
- justify-content: center;
56
- align-items: center;
57
- margin: 0;
58
- padding: 0;
59
- width: 48px;
60
- height: 55px;
61
- background: transparent;
62
- transition: border-color 0.25s;
63
60
  }
64
61
 
65
- .DocSearch-Button:hover {
66
- background: transparent;
62
+ .DocSearch-Clear {
63
+ padding: 0 8px;
67
64
  }
68
65
 
69
- .DocSearch-Button:focus {
70
- outline: 1px dotted;
71
- outline: 5px auto -webkit-focus-ring-color;
66
+ .DocSearch-Commands-Key {
67
+ padding: 4px;
68
+ border: 1px solid var(--docsearch-subtle-color);
69
+ border-radius: 4px;
72
70
  }
73
71
 
74
- .DocSearch-Button-Key--pressed {
75
- transform: none;
76
- box-shadow: none;
72
+ .DocSearch-Hit a:focus-visible {
73
+ outline: 2px solid var(--docsearch-focus-color);
77
74
  }
78
75
 
79
- .DocSearch-Button:focus:not(:focus-visible) {
80
- outline: none !important;
81
- }
82
-
83
- @media (min-width: 768px) {
84
- .DocSearch-Button {
85
- justify-content: flex-start;
86
- border: 1px solid transparent;
87
- border-radius: 8px;
88
- padding: 0 10px 0 12px;
89
- width: 100%;
90
- height: 40px;
91
- background-color: var(--vp-c-bg-alt);
92
- }
93
-
94
- .DocSearch-Button:hover {
95
- border-color: var(--vp-c-brand-1);
96
- background: var(--vp-c-bg-alt);
97
- }
98
- }
99
-
100
- .DocSearch-Button .DocSearch-Button-Container {
101
- display: flex;
102
- align-items: center;
103
- }
104
-
105
- .DocSearch-Button .DocSearch-Search-Icon {
106
- position: relative;
107
- width: 16px;
108
- height: 16px;
109
- color: var(--vp-c-text-1);
76
+ .DocSearch-Logo [class^='cls-'] {
110
77
  fill: currentColor;
111
- transition: color 0.5s;
112
- }
113
-
114
- .DocSearch-Button:hover .DocSearch-Search-Icon {
115
- color: var(--vp-c-text-1);
116
- }
117
-
118
- @media (min-width: 768px) {
119
- .DocSearch-Button .DocSearch-Search-Icon {
120
- top: 1px;
121
- margin-right: 8px;
122
- width: 14px;
123
- height: 14px;
124
- color: var(--vp-c-text-2);
125
- }
126
78
  }
127
79
 
128
- .DocSearch-Button .DocSearch-Button-Placeholder {
129
- display: none;
130
- margin-top: 2px;
131
- padding: 0 16px 0 0;
132
- font-size: 13px;
133
- font-weight: 500;
134
- color: var(--vp-c-text-2);
135
- transition: color 0.5s;
80
+ .DocSearch-Button {
81
+ --docsearch-muted-color: var(--docsearch-text-color);
82
+ --docsearch-searchbox-background: transparent;
83
+ width: auto;
84
+ padding: 2px 12px;
85
+ border: none;
86
+ border-radius: 8px;
136
87
  }
137
88
 
138
- .DocSearch-Button:hover .DocSearch-Button-Placeholder {
139
- color: var(--vp-c-text-1);
89
+ .DocSearch-Search-Icon {
90
+ color: inherit !important;
91
+ width: 20px;
92
+ height: 20px;
140
93
  }
141
94
 
142
95
  @media (min-width: 768px) {
143
- .DocSearch-Button .DocSearch-Button-Placeholder {
144
- display: inline-block;
96
+ .DocSearch-Button {
97
+ --docsearch-muted-color: var(--docsearch-secondary-text-color);
98
+ --docsearch-searchbox-background: var(--vp-c-bg-alt);
145
99
  }
146
- }
147
-
148
- .DocSearch-Button .DocSearch-Button-Keys {
149
- /*rtl:ignore*/
150
- direction: ltr;
151
- display: none;
152
- min-width: auto;
153
- }
154
100
 
155
- @media (min-width: 768px) {
156
- .DocSearch-Button .DocSearch-Button-Keys {
157
- display: flex;
158
- align-items: center;
101
+ .DocSearch-Search-Icon {
102
+ width: 15px;
103
+ height: 15px;
159
104
  }
160
- }
161
-
162
- .DocSearch-Button .DocSearch-Button-Key {
163
- display: block;
164
- margin: 2px 0 0 0;
165
- border: 1px solid var(--vp-c-divider);
166
- /*rtl:begin:ignore*/
167
- border-right: none;
168
- border-radius: 4px 0 0 4px;
169
- padding-left: 6px;
170
- /*rtl:end:ignore*/
171
- min-width: 0;
172
- width: auto;
173
- height: 22px;
174
- line-height: 22px;
175
- font-family: var(--vp-font-family-base);
176
- font-size: 12px;
177
- font-weight: 500;
178
- transition: color 0.5s, border-color 0.5s;
179
- }
180
-
181
- .DocSearch-Button .DocSearch-Button-Key + .DocSearch-Button-Key {
182
- /*rtl:begin:ignore*/
183
- border-right: 1px solid var(--vp-c-divider);
184
- border-left: none;
185
- border-radius: 0 4px 4px 0;
186
- padding-left: 2px;
187
- padding-right: 6px;
188
- /*rtl:end:ignore*/
189
- }
190
105
 
191
- .DocSearch-Button .DocSearch-Button-Key:first-child {
192
- font-size: 0 !important;
106
+ .DocSearch-Button-Placeholder {
107
+ font-size: 13px;
108
+ }
193
109
  }
194
110
 
195
- .DocSearch-Button .DocSearch-Button-Key:first-child:after {
196
- content: 'Ctrl';
111
+ .DocSearch-Button-Keys {
112
+ min-width: auto;
113
+ margin: 0;
114
+ padding: 4px 6px;
115
+ background-color: var(--docsearch-key-background);
116
+ border: 1px solid var(--docsearch-subtle-color);
117
+ border-radius: 4px;
197
118
  font-size: 12px;
198
- letter-spacing: normal;
199
- color: var(--docsearch-muted-color);
119
+ line-height: 1;
120
+ color: var(--docsearch-key-color);
200
121
  }
201
122
 
202
- .mac .DocSearch-Button .DocSearch-Button-Key:first-child:after {
203
- content: '\2318';
123
+ .DocSearch-Button-Keys > * {
124
+ display: none;
204
125
  }
205
126
 
206
- .DocSearch-Button .DocSearch-Button-Key:first-child > * {
207
- display: none;
127
+ .DocSearch-Button-Keys:after {
128
+ /*rtl:ignore*/
129
+ direction: ltr;
130
+ content: 'Ctrl K';
208
131
  }
209
132
 
210
- .DocSearch-Search-Icon {
211
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' stroke-width='1.6' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' d='m14.386 14.386 4.088 4.088-4.088-4.088A7.533 7.533 0 1 1 3.733 3.733a7.533 7.533 0 0 1 10.653 10.653z'/%3E%3C/svg%3E");
133
+ .mac .DocSearch-Button-Keys:after {
134
+ content: '\2318 K';
212
135
  }
213
136
  </style>
@@ -35,7 +35,6 @@ useSponsorsGrid({ el, size: props.size })
35
35
  rel="sponsored noopener"
36
36
  >
37
37
  <article class="vp-sponsor-grid-box">
38
- <h4 class="visually-hidden">{{ sponsor.name }}</h4>
39
38
  <img
40
39
  class="vp-sponsor-grid-image"
41
40
  :src="sponsor.img"
@@ -23,19 +23,19 @@
23
23
 
24
24
  /* internal icons - used under ISC from https://lucide.dev/ */
25
25
  .vpi-align-left {
26
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M21 6H3M15 12H3M17 18H3'/%3E%3C/svg%3E");
26
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 12H3m14 6H3M21 6H3'/%3E%3C/svg%3E");
27
27
  }
28
28
  .vpi-arrow-right,
29
29
  .vpi-arrow-down,
30
30
  .vpi-arrow-left,
31
31
  .vpi-arrow-up {
32
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E");
32
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 12h14m-7-7l7 7l-7 7'/%3E%3C/svg%3E");
33
33
  }
34
34
  .vpi-chevron-right,
35
35
  .vpi-chevron-down,
36
36
  .vpi-chevron-left,
37
37
  .vpi-chevron-up {
38
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
38
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m9 18l6-6l-6-6'/%3E%3C/svg%3E");
39
39
  }
40
40
  .vpi-chevron-down,
41
41
  .vpi-arrow-down {
@@ -53,41 +53,41 @@
53
53
  transform: rotate(-90deg);
54
54
  }
55
55
  .vpi-square-pen {
56
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z'/%3E%3C/svg%3E");
56
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z'/%3E%3C/g%3E%3C/svg%3E");
57
57
  }
58
58
  .vpi-plus {
59
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5v14'/%3E%3C/svg%3E");
59
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 12h14m-7-7v14'/%3E%3C/svg%3E");
60
60
  }
61
61
  .vpi-sun {
62
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E");
62
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/g%3E%3C/svg%3E");
63
63
  }
64
64
  .vpi-moon {
65
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E");
65
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 3a6 6 0 0 0 9 9a9 9 0 1 1-9-9'/%3E%3C/svg%3E");
66
66
  }
67
67
  .vpi-more-horizontal {
68
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/svg%3E");
68
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/g%3E%3C/svg%3E");
69
69
  }
70
70
  .vpi-languages {
71
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m5 8 6 6M4 14l6-6 2-3M2 5h12M7 2h1M22 22l-5-10-5 10M14 18h6'/%3E%3C/svg%3E");
71
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5 8l6 6m-7 0l6-6l2-3M2 5h12M7 2h1m14 20l-5-10l-5 10m2-4h6'/%3E%3C/svg%3E");
72
72
  }
73
73
  .vpi-heart {
74
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E");
74
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2c-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E");
75
75
  }
76
76
  .vpi-search {
77
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
77
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6'%3E%3Cpath d='m21 21l-4.34-4.34'/%3E%3Ccircle cx='11' cy='11' r='8' stroke-width='1.4'/%3E%3C/g%3E%3C/svg%3E");
78
78
  }
79
79
  .vpi-layout-list {
80
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='7' height='7' x='3' y='3' rx='1'/%3E%3Crect width='7' height='7' x='3' y='14' rx='1'/%3E%3Cpath d='M14 4h7M14 9h7M14 15h7M14 20h7'/%3E%3C/svg%3E");
80
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Crect width='7' height='7' x='3' y='3' rx='1'/%3E%3Crect width='7' height='7' x='3' y='14' rx='1'/%3E%3Cpath d='M14 4h7m-7 5h7m-7 6h7m-7 5h7'/%3E%3C/g%3E%3C/svg%3E");
81
81
  }
82
82
  .vpi-delete {
83
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M20 5H9l-7 7 7 7h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2ZM18 9l-6 6M12 9l6 6'/%3E%3C/svg%3E");
83
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2zm2 4l6 6m0-6l-6 6'/%3E%3C/svg%3E");
84
84
  }
85
85
  .vpi-corner-down-left {
86
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 10-5 5 5 5'/%3E%3Cpath d='M20 4v7a4 4 0 0 1-4 4H4'/%3E%3C/svg%3E");
86
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M20 4v7a4 4 0 0 1-4 4H4'/%3E%3Cpath d='m9 10l-5 5l5 5'/%3E%3C/g%3E%3C/svg%3E");
87
87
  }
88
88
  :root {
89
89
  /* clipboard */
90
- --vp-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/svg%3E");
90
+ --vp-icon-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3C/g%3E%3C/svg%3E");
91
91
  /* clipboard-copy */
92
- --vp-icon-copied: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E");
92
+ --vp-icon-copied: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M16 4h2a2 2 0 0 1 2 2v4m1 4H11'/%3E%3Cpath d='m15 10l-4 4l4 4'/%3E%3C/g%3E%3C/svg%3E");
93
93
  }
@@ -81,7 +81,7 @@ function addBase(items, _base) {
81
81
  const item = { ..._item };
82
82
  const base = item.base || _base;
83
83
  if (base && item.link)
84
- item.link = base + item.link;
84
+ item.link = base + item.link.replace(/^\//, base.endsWith('/') ? '' : '/');
85
85
  if (item.items)
86
86
  item.items = addBase(item.items, base);
87
87
  return item;
@@ -13577,6 +13577,7 @@ function requireConstants () {
13577
13577
 
13578
13578
  // Replace globs with equivalent patterns to reduce parsing time.
13579
13579
  REPLACEMENTS: {
13580
+ __proto__: null,
13580
13581
  '***': '*',
13581
13582
  '**/**': '**',
13582
13583
  '**/**/**': '**'
@@ -16720,7 +16721,7 @@ function normalizeGlob(patterns, base) {
16720
16721
  if (!patterns) return [];
16721
16722
  if (typeof patterns === "string") patterns = [patterns];
16722
16723
  return patterns.map(
16723
- (p) => p.startsWith(".") ? normalizePath(path$1.resolve(base, p)) : normalizePath(p)
16724
+ (p) => p[0] === "!" ? "!" + normalizePath(path$1.resolve(base, p.slice(1))) : normalizePath(path$1.resolve(base, p))
16724
16725
  );
16725
16726
  }
16726
16727
  async function glob(patterns, options) {
@@ -36134,7 +36135,7 @@ async function createMarkdownRenderer(srcDir, options = {}, base = "/", logger =
36134
36135
  return tableOpen ? tableOpen(tokens, idx, options2, env, self) : self.renderToken(tokens, idx, options2);
36135
36136
  };
36136
36137
  if (options.gfmAlerts !== false) {
36137
- md.use(gitHubAlertsPlugin);
36138
+ md.use(gitHubAlertsPlugin, options.container);
36138
36139
  }
36139
36140
  if (!options.attrs?.disable) {
36140
36141
  md.use(attrsPlugin, options.attrs);
@@ -41161,6 +41162,7 @@ const webFontsPlugin = (enabled = false) => ({
41161
41162
  });
41162
41163
 
41163
41164
  const themeRE = /\/\.vitepress\/theme\/index\.(m|c)?(j|t)s$/;
41165
+ const docsearchRE = /\/@docsearch\/css\/dist\/style.css(?:$|\?)/;
41164
41166
  const hashRE = /\.([-\w]+)\.js$/;
41165
41167
  const staticInjectMarkerRE = /\bcreateStaticVNode\((?:(".*")|('.*')), (\d+)\)/g;
41166
41168
  const staticStripRE = /['"`]__VP_STATIC_START__[^]*?__VP_STATIC_END__['"`]/g;
@@ -41267,9 +41269,13 @@ async function createVitePressPlugin(siteConfig, ssr = false, pageToHashMap, cli
41267
41269
  }
41268
41270
  },
41269
41271
  async transform(code, id) {
41272
+ if (docsearchRE.test(normalizePath(id))) {
41273
+ return code.replaceAll("[data-theme=dark]", ".dark");
41274
+ }
41270
41275
  if (id.endsWith(".vue")) {
41271
41276
  return processClientJS(code, id);
41272
- } else if (id.endsWith(".md")) {
41277
+ }
41278
+ if (id.endsWith(".md")) {
41273
41279
  const { vueSrc, deadLinks, includes, pageData } = await markdownToVue(
41274
41280
  code,
41275
41281
  id,
@@ -45639,7 +45645,7 @@ async function generateSitemap(siteConfig) {
45639
45645
  });
45640
45646
  }
45641
45647
 
45642
- var version = "2.0.0-alpha.7";
45648
+ var version = "2.0.0-alpha.9";
45643
45649
 
45644
45650
  async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags, usedIcons) {
45645
45651
  const routePath = `/${page.replace(/\.md$/, "")}`;
@@ -45881,12 +45887,14 @@ async function build(root, buildOptions = {}) {
45881
45887
  ).map((asset) => siteConfig.site.base + asset.fileName);
45882
45888
  const additionalHeadTags = [];
45883
45889
  const isDefaultTheme = clientResult && clientResult.output.some(
45884
- (chunk) => chunk.type === "chunk" && chunk.name === "theme" && chunk.moduleIds.some((id) => id.includes("client/theme-default"))
45890
+ (chunk) => chunk.type === "chunk" && // @ts-ignore only exists for rolldown-vite
45891
+ (vite.rolldownVersion || chunk.name === "theme") && // FIXME: remove when rolldown-vite supports manualChunks
45892
+ chunk.moduleIds.some((id) => id.includes("client/theme-default"))
45885
45893
  );
45886
45894
  const metadataScript = generateMetadataScript(pageToHashMap, siteConfig);
45887
45895
  if (isDefaultTheme) {
45888
45896
  const fontURL = assets.find(
45889
- (file) => /inter-roman-latin\.\w+\.woff2/.test(file)
45897
+ (file) => /inter-roman-latin\.[\w-]+\.woff2/.test(file)
45890
45898
  );
45891
45899
  if (fontURL) {
45892
45900
  additionalHeadTags.push([
package/dist/node/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { z as getDefaultExportFromCjs, A as c, B as clearCache, w as disposeMdItInstance, u as init, e as build, x as serve, y as createServer, C as version } from './chunk-CWIFpuXB.js';
1
+ import { z as getDefaultExportFromCjs, A as c, B as clearCache, w as disposeMdItInstance, u as init, e as build, x as serve, y as createServer, C as version } from './chunk-DjRwZkAg.js';
2
2
  import { createLogger } from 'vite';
3
3
  import 'node:path';
4
4
  import '@shikijs/transformers';
@@ -2605,6 +2605,7 @@ interface Options {
2605
2605
  declare function postcssPrefixSelector(options: Readonly<Options>): (root: Root) => void;
2606
2606
 
2607
2607
  declare function postcssIsolateStyles(options?: Parameters<typeof postcssPrefixSelector>[0]): ReturnType<typeof postcssPrefixSelector>;
2608
+ declare function splitSelectorPseudo(selector: string): [string, string];
2608
2609
 
2609
2610
  interface ParsedURL {
2610
2611
  pathname: string;
@@ -2704,4 +2705,4 @@ declare function createServer(root?: string, serverOptions?: ServerOptions & {
2704
2705
  base?: string;
2705
2706
  }, recreateServer?: () => Promise<void>): Promise<vite.ViteDevServer>;
2706
2707
 
2707
- export { type AdditionalConfigExport, type AdditionalConfigFn, type ContentData, type ContentOptions, type LoaderModule, type MarkdownOptions, type MarkdownRenderer, type RawConfigExports, type ResolvedRouteConfig, type RouteModule, type ScaffoldOptions, ScaffoldThemeType, type ServeOptions, type SiteConfig, type ThemeOptions, type TransformContext, type TransformPageContext, type UserConfig, type UserConfigExport, type UserConfigFn, build, createContentLoader, createMarkdownRenderer, createServer, defineAdditionalConfig, defineConfig, defineConfigWithTheme, defineLoader, defineRoutes, disposeMdItInstance, init, isAdditionalConfigFile, mergeConfig, postcssIsolateStyles, resolveConfig, resolvePages, resolveSiteData, resolveSiteDataByRoute, resolveUserConfig, scaffold, serve };
2708
+ export { type AdditionalConfigExport, type AdditionalConfigFn, type ContentData, type ContentOptions, type LoaderModule, type MarkdownOptions, type MarkdownRenderer, type RawConfigExports, type ResolvedRouteConfig, type RouteModule, type ScaffoldOptions, ScaffoldThemeType, type ServeOptions, type SiteConfig, type ThemeOptions, type TransformContext, type TransformPageContext, type UserConfig, type UserConfigExport, type UserConfigFn, build, createContentLoader, createMarkdownRenderer, createServer, defineAdditionalConfig, defineConfig, defineConfigWithTheme, defineLoader, defineRoutes, disposeMdItInstance, init, isAdditionalConfigFile, mergeConfig, postcssIsolateStyles, resolveConfig, resolvePages, resolveSiteData, resolveSiteDataByRoute, resolveUserConfig, scaffold, serve, splitSelectorPseudo };
@@ -1,7 +1,7 @@
1
1
  import { normalizePath } from 'vite';
2
2
  export { loadEnv } from 'vite';
3
- import { n as normalizeGlob, g as glob, c as createMarkdownRenderer, p as pMap, f as fs, m as matter, a as postcssPrefixSelector } from './chunk-CWIFpuXB.js';
4
- export { S as ScaffoldThemeType, e as build, y as createServer, i as defineAdditionalConfig, h as defineConfig, j as defineConfigWithTheme, d as defineLoader, b as defineRoutes, w as disposeMdItInstance, u as init, k as isAdditionalConfigFile, o as mergeConfig, r as resolveConfig, s as resolvePages, q as resolveSiteData, t as resolveSiteDataByRoute, l as resolveUserConfig, v as scaffold, x as serve } from './chunk-CWIFpuXB.js';
3
+ import { n as normalizeGlob, g as glob, c as createMarkdownRenderer, p as pMap, f as fs, m as matter, a as postcssPrefixSelector } from './chunk-DjRwZkAg.js';
4
+ export { S as ScaffoldThemeType, e as build, y as createServer, i as defineAdditionalConfig, h as defineConfig, j as defineConfigWithTheme, d as defineLoader, b as defineRoutes, w as disposeMdItInstance, u as init, k as isAdditionalConfigFile, o as mergeConfig, r as resolveConfig, s as resolvePages, q as resolveSiteData, t as resolveSiteDataByRoute, l as resolveUserConfig, v as scaffold, x as serve } from './chunk-DjRwZkAg.js';
5
5
  import path from 'node:path';
6
6
  import 'node:crypto';
7
7
  import 'node:module';
@@ -97,11 +97,15 @@ function postcssIsolateStyles(options = {}) {
97
97
  prefix: ":not(:where(.vp-raw, .vp-raw *))",
98
98
  includeFiles: [/base\.css/],
99
99
  transform(prefix, _selector) {
100
- const [selector, pseudo = ""] = _selector.split(/(:\S*)$/);
100
+ const [selector, pseudo] = splitSelectorPseudo(_selector);
101
101
  return selector + prefix + pseudo;
102
102
  },
103
103
  ...options
104
104
  });
105
105
  }
106
+ function splitSelectorPseudo(selector) {
107
+ const [base, pseudo = ""] = selector.split(/(?<!\\)(:\S*)$/);
108
+ return [base, pseudo];
109
+ }
106
110
 
107
- export { createContentLoader, createMarkdownRenderer, postcssIsolateStyles };
111
+ export { createContentLoader, createMarkdownRenderer, postcssIsolateStyles, splitSelectorPseudo };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitepress",
3
- "version": "2.0.0-alpha.7",
3
+ "version": "2.0.0-alpha.9",
4
4
  "description": "Vite & Vue powered static site generator",
5
5
  "keywords": [
6
6
  "vite",
@@ -57,23 +57,23 @@
57
57
  "*": "prettier --experimental-cli --ignore-unknown --write"
58
58
  },
59
59
  "dependencies": {
60
- "@docsearch/css": "^3.9.0",
61
- "@docsearch/js": "^3.9.0",
62
- "@iconify-json/simple-icons": "^1.2.40",
63
- "@shikijs/core": "^3.7.0",
64
- "@shikijs/transformers": "^3.7.0",
65
- "@shikijs/types": "^3.7.0",
60
+ "@docsearch/css": "^4.0.0-beta.5",
61
+ "@docsearch/js": "^4.0.0-beta.5",
62
+ "@iconify-json/simple-icons": "^1.2.44",
63
+ "@shikijs/core": "^3.8.1",
64
+ "@shikijs/transformers": "^3.8.1",
65
+ "@shikijs/types": "^3.8.1",
66
66
  "@vitejs/plugin-vue": "^6.0.0",
67
67
  "@vue/devtools-api": "^7.7.7",
68
- "@vue/shared": "^3.5.17",
69
- "@vueuse/core": "^13.4.0",
70
- "@vueuse/integrations": "^13.4.0",
68
+ "@vue/shared": "^3.5.18",
69
+ "@vueuse/core": "^13.5.0",
70
+ "@vueuse/integrations": "^13.5.0",
71
71
  "focus-trap": "^7.6.5",
72
72
  "mark.js": "8.11.1",
73
73
  "minisearch": "^7.1.2",
74
- "shiki": "^3.7.0",
75
- "vite": "^7.0.0",
76
- "vue": "^3.5.17"
74
+ "shiki": "^3.8.1",
75
+ "vite": "^7.0.6",
76
+ "vue": "^3.5.18"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@clack/prompts": "^1.0.0-alpha.1",
@@ -101,15 +101,15 @@
101
101
  "@types/markdown-it-container": "^2.0.10",
102
102
  "@types/markdown-it-emoji": "^3.0.1",
103
103
  "@types/minimist": "^1.2.5",
104
- "@types/node": "^24.0.3",
105
- "@types/picomatch": "^4.0.0",
104
+ "@types/node": "^24.1.0",
105
+ "@types/picomatch": "^4.0.1",
106
106
  "@types/postcss-prefix-selector": "^1.16.3",
107
107
  "@types/prompts": "^2.4.9",
108
108
  "chokidar": "^4.0.3",
109
109
  "conventional-changelog-cli": "^5.0.0",
110
110
  "cross-spawn": "^7.0.6",
111
111
  "debug": "^4.4.1",
112
- "esbuild": "^0.25.5",
112
+ "esbuild": "^0.25.8",
113
113
  "execa": "^9.6.0",
114
114
  "fs-extra": "^11.3.0",
115
115
  "get-port": "^7.1.0",
@@ -127,20 +127,21 @@
127
127
  "minimist": "^1.2.8",
128
128
  "nanoid": "^5.1.5",
129
129
  "ora": "^8.2.0",
130
- "oxc-minify": "^0.74.0",
130
+ "oxc-minify": "^0.78.0",
131
131
  "p-map": "^7.0.3",
132
+ "package-directory": "^8.1.0",
132
133
  "path-to-regexp": "^6.3.0",
133
134
  "picocolors": "^1.1.1",
134
- "picomatch": "^4.0.2",
135
- "package-directory": "^8.1.0",
136
- "playwright-chromium": "^1.53.1",
135
+ "picomatch": "^4.0.3",
136
+ "playwright-chromium": "^1.54.1",
137
137
  "polka": "^1.0.0-next.28",
138
+ "postcss": "^8.5.6",
138
139
  "postcss-prefix-selector": "^2.1.1",
139
- "prettier": "^3.6.0",
140
+ "prettier": "^3.6.2",
140
141
  "prompts": "^2.4.2",
141
142
  "punycode": "^2.3.1",
142
143
  "rimraf": "^6.0.1",
143
- "rollup": "^4.44.0",
144
+ "rollup": "^4.45.1",
144
145
  "rollup-plugin-dts": "6.1.1",
145
146
  "rollup-plugin-esbuild": "^6.2.1",
146
147
  "semver": "^7.7.2",
@@ -149,13 +150,13 @@
149
150
  "sitemap": "^8.0.0",
150
151
  "tinyglobby": "^0.2.14",
151
152
  "typescript": "^5.8.3",
152
- "vitest": "^4.0.0-beta.1",
153
- "vue-tsc": "^3.0.0-beta.3",
154
- "wait-on": "^8.0.3"
153
+ "vitest": "^4.0.0-beta.4",
154
+ "vue-tsc": "^3.0.4",
155
+ "wait-on": "^8.0.4"
155
156
  },
156
157
  "peerDependencies": {
157
158
  "markdown-it-mathjax3": "^4",
158
- "oxc-minify": "^0.74.0",
159
+ "oxc-minify": "^0.78.0",
159
160
  "postcss": "^8"
160
161
  },
161
162
  "peerDependenciesMeta": {
@@ -8,6 +8,7 @@ export interface DocSearchProps {
8
8
  initialQuery?: string
9
9
  insights?: boolean
10
10
  translations?: DocSearchTranslations
11
+ askAi?: DocSearchAskAi | string
11
12
  }
12
13
 
13
14
  export interface SearchOptions {
@@ -101,25 +102,35 @@ export interface ModalTranslations extends ScreenStateTranslations {
101
102
  export interface ScreenStateTranslations {
102
103
  errorScreen?: ErrorScreenTranslations
103
104
  startScreen?: StartScreenTranslations
105
+ resultsScreen?: ResultsScreenTranslations
104
106
  noResultsScreen?: NoResultsScreenTranslations
107
+ askAiScreen?: AskAiScreenTranslations
105
108
  }
106
109
 
107
110
  export interface SearchBoxTranslations {
108
- resetButtonTitle?: string
109
- resetButtonAriaLabel?: string
110
- cancelButtonText?: string
111
- cancelButtonAriaLabel?: string
111
+ clearButtonTitle?: string
112
+ clearButtonAriaLabel?: string
113
+ closeButtonText?: string
114
+ closeButtonAriaLabel?: string
115
+ placeholderText?: string
116
+ placeholderTextAskAi?: string
117
+ searchInputLabel?: string
118
+ placeholderTextAskAiStreaming?: string
119
+ backToKeywordSearchButtonText?: string
120
+ backToKeywordSearchButtonAriaLabel?: string
112
121
  }
113
122
 
114
123
  export interface FooterTranslations {
115
124
  selectText?: string
125
+ submitQuestionText?: string
116
126
  selectKeyAriaLabel?: string
117
127
  navigateText?: string
118
128
  navigateUpKeyAriaLabel?: string
129
+ backToSearchText?: string
119
130
  navigateDownKeyAriaLabel?: string
120
131
  closeText?: string
121
132
  closeKeyAriaLabel?: string
122
- searchByText?: string
133
+ poweredByText?: string
123
134
  }
124
135
 
125
136
  export interface ErrorScreenTranslations {
@@ -134,6 +145,12 @@ export interface StartScreenTranslations {
134
145
  removeRecentSearchButtonTitle?: string
135
146
  favoriteSearchesTitle?: string
136
147
  removeFavoriteSearchButtonTitle?: string
148
+ recentConversationsTitle?: string
149
+ removeRecentConversationButtonTitle?: string
150
+ }
151
+
152
+ export interface ResultsScreenTranslations {
153
+ askAiPlaceholder?: string
137
154
  }
138
155
 
139
156
  export interface NoResultsScreenTranslations {
@@ -142,3 +159,47 @@ export interface NoResultsScreenTranslations {
142
159
  reportMissingResultsText?: string
143
160
  reportMissingResultsLinkText?: string
144
161
  }
162
+
163
+ export interface AskAiScreenTranslations {
164
+ disclaimerText?: string
165
+ relatedSourcesText?: string
166
+ thinkingText?: string
167
+ copyButtonText?: string
168
+ copyButtonCopiedText?: string
169
+ copyButtonTitle?: string
170
+ likeButtonTitle?: string
171
+ dislikeButtonTitle?: string
172
+ thanksForFeedbackText?: string
173
+ preToolCallText?: string
174
+ duringToolCallText?: string
175
+ afterToolCallText?: string
176
+ aggregatedToolCallText?: string
177
+ }
178
+
179
+ export interface DocSearchAskAi {
180
+ /**
181
+ * The index name to use for the ask AI feature. Your assistant will search this index for relevant documents.
182
+ * If not provided, the index name will be used.
183
+ */
184
+ indexName?: string
185
+ /**
186
+ * The API key to use for the ask AI feature. Your assistant will use this API key to search the index.
187
+ * If not provided, the API key will be used.
188
+ */
189
+ apiKey?: string
190
+ /**
191
+ * The app ID to use for the ask AI feature. Your assistant will use this app ID to search the index.
192
+ * If not provided, the app ID will be used.
193
+ */
194
+ appId?: string
195
+ /**
196
+ * The assistant ID to use for the ask AI feature.
197
+ */
198
+ assistantId: string | null
199
+ /**
200
+ * The search parameters to use for the ask AI feature.
201
+ */
202
+ searchParameters?: {
203
+ facetFilters?: SearchOptions['facetFilters']
204
+ }
205
+ }