@lexibase/rdx-core 2.1.0 → 3.0.0

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.
@@ -6,6 +6,8 @@ interface SearchDocument {
6
6
  category: string;
7
7
  href: string;
8
8
  content: string;
9
+ /** Original filename selects Markdown or MDX parsing. Omitted defaults to MDX. */
10
+ sourcePath?: string;
9
11
  }
10
12
  /** Parse text/sections without compiling MDX, evaluating JS, or exposing paths. */
11
13
  declare function buildSearchIndex(documents: SearchDocument[]): RdxSearchIndex;
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-FPBRKD4M.js";
4
4
  import {
5
5
  remarkDocumentationComponents
6
- } from "../chunk-J7VCQHSL.js";
6
+ } from "../chunk-6WNFE2QG.js";
7
7
 
8
8
  // src/search/index.ts
9
9
  import GithubSlugger from "github-slugger";
@@ -12,6 +12,7 @@ import remarkMdx from "remark-mdx";
12
12
  import remarkParse from "remark-parse";
13
13
  import { unified } from "unified";
14
14
  var parser = unified().use(remarkParse).use(remarkGfm).use(remarkMdx).use(remarkDocumentationComponents);
15
+ var markdownParser = unified().use(remarkParse).use(remarkGfm).use(remarkDocumentationComponents);
15
16
  function text(node) {
16
17
  if (node.type === "break") return " ";
17
18
  if (["mdxjsEsm", "mdxFlowExpression", "mdxTextExpression", "html"].includes(
@@ -67,7 +68,7 @@ function buildSearchIndex(documents) {
67
68
  ].includes(node.type)) {
68
69
  if (node.name && ["script", "style", "svg"].includes(node.name.toLowerCase()))
69
70
  return;
70
- const nestedInteractive = interactive || node.name === "TabsContent" || node.name === "AccordionContent";
71
+ const nestedInteractive = interactive || node.name === "TabsContent" || node.name === "AccordionContent" || node.name === "Step";
71
72
  if (node.name === "Callout") {
72
73
  const title = node.attributes?.find(
73
74
  (attribute) => attribute.type === "mdxJsxAttribute" && attribute.name === "title"
@@ -82,7 +83,8 @@ function buildSearchIndex(documents) {
82
83
  var visit = visit2;
83
84
  const firstEntry = entries.length;
84
85
  const slugger = new GithubSlugger();
85
- const tree = parser.runSync(parser.parse(document.content), {
86
+ const processor = document.sourcePath?.endsWith(".md") ? markdownParser : parser;
87
+ const tree = processor.runSync(processor.parse(document.content), {
86
88
  value: document.content
87
89
  });
88
90
  let current = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexibase/rdx-core",
3
- "version": "2.1.0",
3
+ "version": "3.0.0",
4
4
  "description": "Content indexing and document utilities for RDX documentation projects.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -53,14 +53,15 @@
53
53
  "remark-gfm": "^4.0.1",
54
54
  "remark-mdx": "^3.1.1",
55
55
  "remark-parse": "^11.0.0",
56
+ "remark-stringify": "^11.0.0",
56
57
  "unified": "^11.0.5",
57
- "@lexibase/rdx-types": "2.1.0"
58
+ "@lexibase/rdx-types": "2.3.0"
58
59
  },
59
60
  "devDependencies": {
60
61
  "@types/node": "^22.15.3",
61
62
  "@types/react": "19.3.0",
62
- "@rdx/typescript-config": "1.0.0",
63
- "@rdx/eslint-config": "1.0.0"
63
+ "@rdx/eslint-config": "1.0.0",
64
+ "@rdx/typescript-config": "1.0.0"
64
65
  },
65
66
  "engines": {
66
67
  "node": "^22.18.0 || ^24.11.0"