fumadocs-core 16.0.3 → 16.0.4

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.
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { R as Root, N as Node } from './definitions-BRsJlZ6m.js';
2
+ import { R as Root, N as Node } from './definitions-DQnHJeWn.js';
3
3
 
4
4
  interface BreadcrumbItem {
5
5
  name: ReactNode;
@@ -1,4 +1,4 @@
1
- import { R as Root, I as Item, F as Folder, S as Separator } from './definitions-BRsJlZ6m.js';
1
+ import { R as Root, I as Item, F as Folder, S as Separator } from './definitions-DQnHJeWn.js';
2
2
  import { I18nConfig } from './i18n/index.js';
3
3
  import { ReactNode } from 'react';
4
4
 
@@ -21,6 +21,11 @@ interface Item {
21
21
  type: 'page';
22
22
  name: ReactNode;
23
23
  url: string;
24
+ /**
25
+ * Whether the link should be treated as external (e.g. use HTML <a> tag).
26
+ *
27
+ * When unspecified, it depends on the value of `url`.
28
+ */
24
29
  external?: boolean;
25
30
  description?: ReactNode;
26
31
  icon?: ReactNode;
@@ -1,5 +1,5 @@
1
- import { N as Node, I as Item, R as Root, F as Folder } from '../definitions-BRsJlZ6m.js';
2
- export { S as Separator } from '../definitions-BRsJlZ6m.js';
1
+ import { N as Node, I as Item, R as Root, F as Folder } from '../definitions-DQnHJeWn.js';
2
+ export { S as Separator } from '../definitions-DQnHJeWn.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -3,12 +3,12 @@ import { S as StructuredData } from '../remark-structure-DkCXCzpD.js';
3
3
  import { SortedResult } from './index.js';
4
4
  export { HighlightedText, ReactSortedResult, createContentHighlighter } from './index.js';
5
5
  import { I18nConfig } from '../i18n/index.js';
6
- import { k as LoaderOutput, f as LoaderConfig, I as InferPageType } from '../builder-feW_xVjc.js';
6
+ import { k as LoaderOutput, f as LoaderConfig, I as InferPageType } from '../builder-BynMF2Pa.js';
7
7
  import 'mdast';
8
8
  import 'unified';
9
9
  import 'mdast-util-mdx-jsx';
10
10
  import 'react';
11
- import '../definitions-BRsJlZ6m.js';
11
+ import '../definitions-DQnHJeWn.js';
12
12
 
13
13
  type SimpleDocument = TypedDocument<Orama<typeof simpleSchema>>;
14
14
  declare const simpleSchema: {
@@ -1,5 +1,5 @@
1
- export { C as ContentStorage, F as FileSystem, t as InferMetaType, I as InferPageType, f as LoaderConfig, g as LoaderOptions, k as LoaderOutput, L as LoaderPlugin, j as Meta, p as MetaData, M as MetaFile, i as Page, q as PageData, e as PageFile, a as PageTreeBuilder, b as PageTreeBuilderContext, d as PageTreeOptions, P as PageTreeTransformer, R as ResolvedLoaderConfig, h as Source, S as SourceConfig, U as UrlFn, s as VirtualFile, r as VirtualMeta, V as VirtualPage, _ as _ConfigUnion_, u as buildPlugins, l as createGetUrl, c as createPageTreeBuilder, m as loader, o as map, n as multiple } from '../builder-feW_xVjc.js';
2
- import '../definitions-BRsJlZ6m.js';
1
+ export { C as ContentStorage, F as FileSystem, t as InferMetaType, I as InferPageType, f as LoaderConfig, g as LoaderOptions, k as LoaderOutput, L as LoaderPlugin, j as Meta, p as MetaData, M as MetaFile, i as Page, q as PageData, e as PageFile, a as PageTreeBuilder, b as PageTreeBuilderContext, d as PageTreeOptions, P as PageTreeTransformer, R as ResolvedLoaderConfig, h as Source, S as SourceConfig, U as UrlFn, s as VirtualFile, r as VirtualMeta, V as VirtualPage, _ as _ConfigUnion_, u as buildPlugins, l as createGetUrl, c as createPageTreeBuilder, m as loader, o as map, n as multiple } from '../builder-BynMF2Pa.js';
2
+ import '../definitions-DQnHJeWn.js';
3
3
  import 'react';
4
4
  import '../i18n/index.js';
5
5
 
@@ -48,7 +48,7 @@ function transformerFallback() {
48
48
 
49
49
  // src/source/page-tree/builder.ts
50
50
  var group = /^\((?<name>.+)\)$/;
51
- var link = /^(?:\[(?<icon>[^\]]+)])?\[(?<name>[^\]]+)]\((?<url>[^)]+)\)$/;
51
+ var link = /^(?<external>external:)?(?:\[(?<icon>[^\]]+)])?\[(?<name>[^\]]+)]\((?<url>[^)]+)\)$/;
52
52
  var separator = /^---(?:\[(?<icon>[^\]]+)])?(?<name>.+)---|^---$/;
53
53
  var rest = "...";
54
54
  var restReversed = "z...a";
@@ -92,14 +92,13 @@ function resolveFolderItem(folderPath, item, ctx, idx) {
92
92
  }
93
93
  match = link.exec(item);
94
94
  if (match?.groups) {
95
- const { icon, url, name } = match.groups;
96
- const isRelative = url.startsWith("/") || url.startsWith("#") || url.startsWith(".");
95
+ const { icon, url, name, external } = match.groups;
97
96
  let node = {
98
97
  type: "page",
99
98
  icon,
100
99
  name,
101
100
  url,
102
- external: !isRelative
101
+ external: external ? true : void 0
103
102
  };
104
103
  for (const transformer of ctx.transformers) {
105
104
  if (!transformer.file) continue;
@@ -1,6 +1,6 @@
1
- import { L as LoaderPlugin } from '../../builder-feW_xVjc.js';
1
+ import { L as LoaderPlugin } from '../../builder-BynMF2Pa.js';
2
2
  import { icons } from 'lucide-react';
3
- import '../../definitions-BRsJlZ6m.js';
3
+ import '../../definitions-DQnHJeWn.js';
4
4
  import 'react';
5
5
  import '../../i18n/index.js';
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-core",
3
- "version": "16.0.3",
3
+ "version": "16.0.4",
4
4
  "description": "The library for building a documentation website in any React.js framework",
5
5
  "keywords": [
6
6
  "Fumadocs",