fumadocs-core 14.7.0 → 14.7.2

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.
@@ -54,4 +54,4 @@ type Client = ({
54
54
  */
55
55
  declare function useDocsSearch(client: Client, locale?: string, tag?: string, delayMs?: number, allowEmpty?: boolean, key?: string): UseDocsSearch;
56
56
 
57
- export { type AlgoliaOptions, type FetchOptions, type OramaCloudOptions, type StaticOptions, useDocsSearch };
57
+ export { type AlgoliaOptions, type Client, type FetchOptions, type OramaCloudOptions, type StaticOptions, useDocsSearch };
@@ -208,9 +208,10 @@ var STEMMERS = {
208
208
  };
209
209
 
210
210
  // src/search/orama/create-i18n.ts
211
- function defaultLocaleMap(locale) {
212
- const map = STEMMERS;
213
- return Object.keys(map).find((lang) => map[lang] === locale) ?? locale;
211
+ async function getTokenizer(locale) {
212
+ return {
213
+ language: Object.keys(STEMMERS).find((lang) => STEMMERS[lang] === locale) ?? locale
214
+ };
214
215
  }
215
216
  async function initSimple(options) {
216
217
  const map = /* @__PURE__ */ new Map();
@@ -220,7 +221,7 @@ async function initSimple(options) {
220
221
  const indexes = typeof options.indexes === "function" ? await options.indexes() : options.indexes;
221
222
  for (const locale of options.i18n.languages) {
222
223
  const localeIndexes = indexes.filter((index) => index.locale === locale);
223
- const searchLocale = options.localeMap?.[locale] ?? defaultLocaleMap(locale);
224
+ const searchLocale = options.localeMap?.[locale] ?? await getTokenizer(locale);
224
225
  map.set(
225
226
  locale,
226
227
  typeof searchLocale === "object" ? initSimpleSearch({
@@ -244,7 +245,7 @@ async function initAdvanced(options) {
244
245
  const indexes = typeof options.indexes === "function" ? await options.indexes() : options.indexes;
245
246
  for (const locale of options.i18n.languages) {
246
247
  const localeIndexes = indexes.filter((index) => index.locale === locale);
247
- const searchLocale = options.localeMap?.[locale] ?? defaultLocaleMap(locale);
248
+ const searchLocale = options.localeMap?.[locale] ?? await getTokenizer(locale);
248
249
  map.set(
249
250
  locale,
250
251
  typeof searchLocale === "object" ? initAdvancedSearch({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "14.7.0",
3
+ "version": "14.7.2",
4
4
  "description": "The library for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -95,6 +95,7 @@
95
95
  "devDependencies": {
96
96
  "@algolia/client-search": "4.24.0",
97
97
  "@mdx-js/mdx": "^3.1.0",
98
+ "@orama/tokenizers": "^2.1.1",
98
99
  "@oramacloud/client": "^2.1.4",
99
100
  "@types/estree-jsx": "^1.0.5",
100
101
  "@types/hast": "^3.0.4",
@@ -117,6 +118,7 @@
117
118
  "tsconfig": "0.0.0"
118
119
  },
119
120
  "peerDependencies": {
121
+ "@orama/tokenizers": "2.x.x",
120
122
  "@oramacloud/client": "1.x.x || 2.x.x",
121
123
  "algoliasearch": "4.24.0",
122
124
  "next": "14.x.x || 15.x.x",
@@ -124,6 +126,9 @@
124
126
  "react-dom": "18.x.x || 19.x.x"
125
127
  },
126
128
  "peerDependenciesMeta": {
129
+ "@orama/tokenizers": {
130
+ "optional": true
131
+ },
127
132
  "@oramacloud/client": {
128
133
  "optional": true
129
134
  },