@ox-content/vite-plugin-svelte 3.0.0-alpha.10 → 3.0.0-alpha.12

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.
package/dist/index.cjs CHANGED
@@ -737,7 +737,7 @@ function generateSvelteModule(content, usedComponents, _islands, frontmatter, op
737
737
  const componentMap = usedComponents.map((name) => ` ${name},`).join("\n");
738
738
  return `
739
739
  <script>
740
- import { createRawSnippet, onMount, mount, unmount } from 'svelte';
740
+ import { createRawSnippet, hydrate, mount, onMount, unmount } from 'svelte';
741
741
  import { initIslands, readIslandSlotHtml } from '@ox-content/islands';
742
742
  ${imports}
743
743
 
@@ -767,7 +767,8 @@ ${componentMap}
767
767
  }));
768
768
  }
769
769
 
770
- const instance = mount(Component, { target: element, props: componentProps });
770
+ const attach = element.dataset.oxSsr === 'true' ? hydrate : mount;
771
+ const instance = attach(Component, { target: element, props: componentProps });
771
772
  mounted.push(instance);
772
773
 
773
774
  return () => unmount(instance);
package/dist/index.d.cts CHANGED
@@ -101,6 +101,7 @@ interface SvelteIntegrationOptions extends OxContentOptions {
101
101
  embeds?: BuiltinEmbedOptions | false;
102
102
  /**
103
103
  * Optional adapter hook that replaces island inner HTML at transform time.
104
+ * The fourth argument receives the original slot HTML, when present.
104
105
  * The core renderer stays framework-neutral; do not import a framework SSR
105
106
  * runtime from `@ox-content/vite-plugin`.
106
107
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";;;;;;;;;UAQiB;;;;;;EAMf;;UAGe;EACf;EACA;;;;;KAMU,gBAAgB;;;;;;;;KAShB,mBAAmB;;;;;;;;KASnB;;;;;;;;UASK,iCAAiC;;;;;;;;EAQhD;;;;;;;;;;;;;;;;;;EAmBA,aAAa;;;;;;;;EASb,4BAA4B;;;;;;;;;EAU5B;;;;;;;;;EAUA,SAAS;;;;;;EAOT,eAAe;;;;;;;;;;;;EAaf,mBAAmB;;;;;UAMJ;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf,mBAAmB;;;;;EAMnB,sBAAsB;;UAGP;EACf,QAAQ;EACR,WAAW;;UAGI;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB,YAAY;EACZ;EACA,QAAQ;EACR;EACA;EACA,eAAe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA,aAAa;;UAGE;EACf;EACA,OAAO;EACP;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC1Jc,gBAAgB,UAAS,2BAAgC"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";;;;;;;;;UAQiB;;;;;;EAMf;;UAGe;EACf;EACA;;;;;KAMU,gBAAgB;;;;;;;;KAShB,mBAAmB;;;;;;;;KASnB;;;;;;;;UASK,iCAAiC;;;;;;;;EAQhD;;;;;;;;;;;;;;;;;;EAmBA,aAAa;;;;;;;;EASb,4BAA4B;;;;;;;;;EAU5B;;;;;;;;;EAUA,SAAS;;;;;;;EAQT,eAAe;;;;;;;;;;;;EAaf,mBAAmB;;;;;UAMJ;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf,mBAAmB;;;;;EAMnB,sBAAsB;;UAGP;EACf,QAAQ;EACR,WAAW;;UAGI;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB,YAAY;EACZ;EACA,QAAQ;EACR;EACA;EACA,eAAe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA,aAAa;;UAGE;EACf;EACA,OAAO;EACP;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC3Jc,gBAAgB,UAAS,2BAAgC"}
package/dist/index.d.mts CHANGED
@@ -101,6 +101,7 @@ interface SvelteIntegrationOptions extends OxContentOptions {
101
101
  embeds?: BuiltinEmbedOptions | false;
102
102
  /**
103
103
  * Optional adapter hook that replaces island inner HTML at transform time.
104
+ * The fourth argument receives the original slot HTML, when present.
104
105
  * The core renderer stays framework-neutral; do not import a framework SSR
105
106
  * runtime from `@ox-content/vite-plugin`.
106
107
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";;;;;;;;;UAQiB;;;;;;EAMf;;UAGe;EACf;EACA;;;;;KAMU,gBAAgB;;;;;;;;KAShB,mBAAmB;;;;;;;;KASnB;;;;;;;;UASK,iCAAiC;;;;;;;;EAQhD;;;;;;;;;;;;;;;;;;EAmBA,aAAa;;;;;;;;EASb,4BAA4B;;;;;;;;;EAU5B;;;;;;;;;EAUA,SAAS;;;;;;EAOT,eAAe;;;;;;;;;;;;EAaf,mBAAmB;;;;;UAMJ;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf,mBAAmB;;;;;EAMnB,sBAAsB;;UAGP;EACf,QAAQ;EACR,WAAW;;UAGI;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB,YAAY;EACZ;EACA,QAAQ;EACR;EACA;EACA,eAAe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA,aAAa;;UAGE;EACf;EACA,OAAO;EACP;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC1Jc,gBAAgB,UAAS,2BAAgC"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/index.ts"],"mappings":";;;;;;;;;UAQiB;;;;;;EAMf;;UAGe;EACf;EACA;;;;;KAMU,gBAAgB;;;;;;;;KAShB,mBAAmB;;;;;;;;KASnB;;;;;;;;UASK,iCAAiC;;;;;;;;EAQhD;;;;;;;;;;;;;;;;;;EAmBA,aAAa;;;;;;;;EASb,4BAA4B;;;;;;;;;EAU5B;;;;;;;;;EAUA,SAAS;;;;;;;EAQT,eAAe;;;;;;;;;;;;EAaf,mBAAmB;;;;;UAMJ;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;UAMe;;;;;EAKf,mBAAmB;;;;;EAMnB,sBAAsB;;UAGP;EACf,QAAQ;EACR,WAAW;;UAGI;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB,YAAY;EACZ;EACA,QAAQ;EACR;EACA;EACA,eAAe;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA,aAAa;;UAGE;EACf;EACA,OAAO;EACP;EACA;EACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBC3Jc,gBAAgB,UAAS,2BAAgC"}
package/dist/index.mjs CHANGED
@@ -712,7 +712,7 @@ function generateSvelteModule(content, usedComponents, _islands, frontmatter, op
712
712
  const componentMap = usedComponents.map((name) => ` ${name},`).join("\n");
713
713
  return `
714
714
  <script>
715
- import { createRawSnippet, onMount, mount, unmount } from 'svelte';
715
+ import { createRawSnippet, hydrate, mount, onMount, unmount } from 'svelte';
716
716
  import { initIslands, readIslandSlotHtml } from '@ox-content/islands';
717
717
  ${imports}
718
718
 
@@ -742,7 +742,8 @@ ${componentMap}
742
742
  }));
743
743
  }
744
744
 
745
- const instance = mount(Component, { target: element, props: componentProps });
745
+ const attach = element.dataset.oxSsr === 'true' ? hydrate : mount;
746
+ const instance = attach(Component, { target: element, props: componentProps });
746
747
  mounted.push(instance);
747
748
 
748
749
  return () => unmount(instance);
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["baseTransformMarkdown","oxContent"],"sources":["../src/transform.ts","../src/environment.ts","../src/index.ts"],"sourcesContent":["import {\n applyIslandSsrHtml,\n discoverDocumentMdxIslands,\n renderIslandComponentImports,\n resolveContentRootPath,\n resolveMdxForFilePath,\n transformMarkdown as baseTransformMarkdown,\n type ResolvedDocumentComponentImport,\n} from \"@ox-content/vite-plugin\";\nimport { compile } from \"svelte/compiler\";\nimport type {\n ResolvedSvelteOptions,\n SvelteTransformResult,\n ComponentIsland,\n ComponentsMap,\n} from \"./types\";\n\nconst COMPONENT_REGEX = /<([A-Z][a-zA-Z0-9]*)\\s*([^>]*?)\\s*(?:\\/>|>([\\s\\S]*?)<\\/\\1>)/g;\nconst PROP_REGEX = /([a-zA-Z0-9-]+)(?:=(?:\"([^\"]*)\"|'([^']*)'|{([^}]*)}|\\[([^\\]]*)\\]))?/g;\n\nconst ISLAND_MARKER_PREFIX = \"OXCONTENT-ISLAND-\";\nconst ISLAND_MARKER_SUFFIX = \"-PLACEHOLDER\";\nconst DOCUMENT_PROP_MARKER_PREFIX = \"OXCONTENT-DOCUMENT-PROP-\";\nconst DOCUMENT_PROP_MARKER_SUFFIX = \"-PLACEHOLDER\";\nconst PAYLOAD_SCRIPT = /^\\s*<script type=\"application\\/json\">[\\s\\S]*?<\\/script>/i;\nconst RUST_PAYLOAD_KEYS = new Set([\"props\", \"expressions\", \"spreads\"]);\n\ninterface Range {\n start: number;\n end: number;\n}\n\nexport async function transformMarkdownWithSvelte(\n code: string,\n id: string,\n options: ResolvedSvelteOptions,\n): Promise<SvelteTransformResult> {\n const components: ComponentsMap = options.components;\n const { content: markdownContent, frontmatter } = extractFrontmatter(code);\n const mdx = resolveMdxForFilePath(id, options.mdx);\n\n const baseOptions = {\n srcDir: options.srcDir,\n outDir: options.outDir,\n base: options.base,\n extensions: options.extensions,\n mdx,\n ssg: {\n enabled: false,\n extension: \".html\",\n clean: false,\n bare: false,\n generateOgImage: false,\n lastUpdated: false,\n pagination: false,\n breadcrumbs: false,\n jsonLd: false,\n readerChrome: false,\n localeSwitcher: false,\n a11y: false,\n pageChrome: false,\n },\n gfm: options.gfm,\n frontmatter: false,\n toc: options.toc,\n tocMaxDepth: options.tocMaxDepth,\n codeAnnotations: options.codeAnnotations,\n footnotes: true,\n tables: true,\n taskLists: true,\n strikethrough: true,\n autolinks: options.autolinks,\n highlight: false,\n mermaid: false,\n ogImage: false,\n ogImageOptions: {\n vuePlugin: \"vitejs\",\n width: 1200,\n height: 630,\n cache: true,\n concurrency: 1,\n },\n transformers: [],\n docs: false,\n ogViewer: false,\n search: {\n enabled: false,\n limit: 10,\n prefix: true,\n placeholder: \"Search...\",\n hotkey: \"k\",\n },\n embeds: options.embeds,\n i18n: false,\n } as unknown as Parameters<typeof baseTransformMarkdown>[2] & {\n codeAnnotations?: ResolvedSvelteOptions[\"codeAnnotations\"];\n };\n\n if (mdx) {\n const documentExpressions = options.mdxDocumentProps\n ? prepareMdxDocumentExpressions(markdownContent, id)\n : { content: markdownContent, expressions: [] };\n const transformed = await baseTransformMarkdown(documentExpressions.content, id, baseOptions);\n const discovered = await discoverDocumentMdxIslands({\n source: markdownContent,\n html: transformed.html,\n components,\n imports: transformed.imports,\n documentPath: id,\n contentRoot: resolveContentRootPath({ srcDir: options.srcDir, root: options.root }),\n srcDir: options.srcDir,\n });\n if (options.mdxDocumentProps) {\n return compileSvelteResult(\n generateMdxDocumentPropsSvelteModule(\n transformed.html,\n discovered.usedComponents,\n frontmatter,\n options,\n id,\n discovered.localBindings,\n documentExpressions.expressions,\n ),\n id,\n discovered.usedComponents,\n frontmatter,\n options.ssr,\n );\n }\n const html = options.renderIsland\n ? await applyIslandSsrHtml(\n transformed.html,\n options.renderIsland,\n id,\n discovered.usedComponents,\n )\n : transformed.html;\n return compileSvelteResult(\n generateSvelteModule(\n html,\n discovered.usedComponents,\n discovered.usedComponents,\n frontmatter,\n options,\n id,\n discovered.localBindings,\n ),\n id,\n discovered.usedComponents,\n frontmatter,\n options.ssr,\n );\n }\n\n const usedComponents: string[] = [];\n const islands: ComponentIsland[] = [];\n let islandIndex = 0;\n\n const fenceRanges = collectFenceRanges(markdownContent);\n let processedContent = \"\";\n let lastIndex = 0;\n let match: RegExpExecArray | null;\n\n COMPONENT_REGEX.lastIndex = 0;\n while ((match = COMPONENT_REGEX.exec(markdownContent)) !== null) {\n const [fullMatch, componentName, propsString, rawIslandContent] = match;\n const matchStart = match.index;\n const matchEnd = matchStart + fullMatch.length;\n\n if (\n !Object.prototype.hasOwnProperty.call(components, componentName) ||\n isInRanges(matchStart, matchEnd, fenceRanges)\n ) {\n processedContent += markdownContent.slice(lastIndex, matchEnd);\n lastIndex = matchEnd;\n continue;\n }\n\n if (!usedComponents.includes(componentName)) {\n usedComponents.push(componentName);\n }\n\n const props = parseProps(propsString);\n const islandId = `ox-island-${islandIndex++}`;\n const islandContent =\n typeof rawIslandContent === \"string\" ? rawIslandContent.trim() : undefined;\n\n islands.push({\n name: componentName,\n props,\n position: matchStart,\n id: islandId,\n content: islandContent,\n });\n\n processedContent += markdownContent.slice(lastIndex, matchStart) + createIslandMarker(islandId);\n lastIndex = matchEnd;\n }\n processedContent += markdownContent.slice(lastIndex);\n\n const transformed = await baseTransformMarkdown(processedContent, id, baseOptions);\n const htmlWithIslands = injectIslandMarkers(transformed.html, islands);\n return compileSvelteResult(\n generateSvelteModule(htmlWithIslands, usedComponents, islands, frontmatter, options, id),\n id,\n usedComponents,\n frontmatter,\n options.ssr,\n );\n}\n\nfunction compileSvelteResult(\n svelteCode: string,\n id: string,\n usedComponents: string[],\n frontmatter: Record<string, unknown>,\n ssr = false,\n): SvelteTransformResult {\n const compiled = compile(svelteCode, {\n filename: id,\n generate: ssr ? \"server\" : \"client\",\n runes: true,\n });\n\n return {\n code: `${compiled.js.code}\\nexport const frontmatter = ${JSON.stringify(frontmatter)};`,\n map: null,\n usedComponents,\n frontmatter,\n };\n}\n\nfunction createIslandMarker(islandId: string): string {\n return `${ISLAND_MARKER_PREFIX}${islandId}${ISLAND_MARKER_SUFFIX}`;\n}\n\nfunction collectFenceRanges(content: string): Range[] {\n const ranges: Range[] = [];\n let inFence = false;\n let fenceChar = \"\";\n let fenceLength = 0;\n let fenceStart = 0;\n let pos = 0;\n\n while (pos < content.length) {\n const lineEnd = content.indexOf(\"\\n\", pos);\n const next = lineEnd === -1 ? content.length : lineEnd + 1;\n const line = content.slice(pos, lineEnd === -1 ? content.length : lineEnd);\n const fenceMatch = line.match(/^\\s{0,3}([`~]{3,})/);\n\n if (fenceMatch) {\n const marker = fenceMatch[1];\n if (!inFence) {\n inFence = true;\n fenceChar = marker[0];\n fenceLength = marker.length;\n fenceStart = pos;\n } else if (marker[0] === fenceChar && marker.length >= fenceLength) {\n inFence = false;\n ranges.push({ start: fenceStart, end: next });\n fenceChar = \"\";\n fenceLength = 0;\n }\n }\n\n pos = next;\n }\n\n if (inFence) {\n ranges.push({ start: fenceStart, end: content.length });\n }\n\n return ranges;\n}\n\nfunction isInRanges(start: number, end: number, ranges: Range[]): boolean {\n for (const range of ranges) {\n if (start < range.end && end > range.start) {\n return true;\n }\n }\n return false;\n}\n\nfunction injectIslandMarkers(html: string, islands: ComponentIsland[]): string {\n let output = html;\n\n for (const island of islands) {\n const marker = createIslandMarker(island.id);\n const propsAttr =\n Object.keys(island.props).length > 0\n ? ` data-ox-props='${JSON.stringify(island.props).replace(/'/g, \"&#39;\")}'`\n : \"\";\n const contentAttr = island.content\n ? ` data-ox-content='${island.content.replace(/'/g, \"&#39;\")}'`\n : \"\";\n const attrs = `data-ox-island=\"${island.name}\"${propsAttr}${contentAttr}`;\n output = output.replaceAll(`<p>${marker}</p>`, `<div ${attrs}></div>`);\n output = output.replaceAll(marker, `<span ${attrs}></span>`);\n }\n\n return output;\n}\n\nfunction extractFrontmatter(content: string): {\n content: string;\n frontmatter: Record<string, unknown>;\n} {\n const frontmatterRegex = /^---\\n([\\s\\S]*?)\\n---\\n/;\n const match = frontmatterRegex.exec(content);\n\n if (!match) {\n return { content, frontmatter: {} };\n }\n\n const frontmatterStr = match[1];\n const frontmatter: Record<string, unknown> = {};\n\n for (const line of frontmatterStr.split(\"\\n\")) {\n const colonIndex = line.indexOf(\":\");\n if (colonIndex > 0) {\n const key = line.slice(0, colonIndex).trim();\n let value: unknown = line.slice(colonIndex + 1).trim();\n try {\n value = JSON.parse(value as string);\n } catch {\n if (\n typeof value === \"string\" &&\n ((value.startsWith('\"') && value.endsWith('\"')) ||\n (value.startsWith(\"'\") && value.endsWith(\"'\")))\n ) {\n value = value.slice(1, -1);\n }\n }\n frontmatter[key] = value;\n }\n }\n\n return { content: content.slice(match[0].length), frontmatter };\n}\n\nfunction parseProps(propsString: string): Record<string, unknown> {\n const props: Record<string, unknown> = {};\n if (!propsString) return props;\n\n PROP_REGEX.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = PROP_REGEX.exec(propsString)) !== null) {\n const [, name, doubleQuoted, singleQuoted, braceValue, bracketValue] = match;\n if (name) {\n if (doubleQuoted !== undefined) props[name] = doubleQuoted;\n else if (singleQuoted !== undefined) props[name] = singleQuoted;\n else if (braceValue !== undefined) {\n try {\n props[name] = JSON.parse(braceValue);\n } catch {\n props[name] = braceValue;\n }\n } else if (bracketValue !== undefined) {\n try {\n props[name] = JSON.parse(`[${bracketValue}]`);\n } catch {\n props[name] = bracketValue;\n }\n } else props[name] = true;\n }\n }\n return props;\n}\n\ninterface MdxDocumentExpression {\n marker: string;\n expression: string;\n path: string[];\n}\n\ninterface PreparedMdxDocumentExpressions {\n content: string;\n expressions: MdxDocumentExpression[];\n}\n\ninterface MdxIslandRange {\n name: string;\n tag: string;\n openStart: number;\n openEnd: number;\n innerStart: number;\n contentStart: number;\n closeStart: number;\n closeEnd: number;\n propsAttr?: string;\n script?: string;\n}\n\ninterface MdxIslandPayload {\n props: Record<string, unknown>;\n expressions: Record<string, string>;\n spreads: string[];\n}\n\ninterface MdxTemplateContext {\n html: string;\n filePath: string;\n usedComponents: Set<string>;\n expressionsByMarker: Map<string, MdxDocumentExpression>;\n islandRanges: MdxIslandRange[];\n}\n\nfunction prepareMdxDocumentExpressions(\n content: string,\n filePath: string,\n): PreparedMdxDocumentExpressions {\n const skipRanges = mergeRanges([\n ...collectFenceRanges(content),\n ...collectInlineCodeRanges(content),\n ...collectMdxEsmLineRanges(content),\n ]);\n const expressions: MdxDocumentExpression[] = [];\n let output = \"\";\n let cursor = 0;\n let rangeIndex = 0;\n let inTag = false;\n let quote: string | null = null;\n\n while (cursor < content.length) {\n const range = skipRanges[rangeIndex];\n if (range && cursor >= range.end) {\n rangeIndex += 1;\n continue;\n }\n if (range && cursor === range.start) {\n output += content.slice(range.start, range.end);\n cursor = range.end;\n continue;\n }\n\n const char = content[cursor]!;\n if (inTag) {\n output += char;\n if (quote) {\n if (char === quote && content[cursor - 1] !== \"\\\\\") {\n quote = null;\n }\n } else if (char === '\"' || char === \"'\") {\n quote = char;\n } else if (char === \">\") {\n inTag = false;\n }\n cursor += 1;\n continue;\n }\n\n if (char === \"<\" && startsHtmlLikeTag(content, cursor)) {\n inTag = true;\n output += char;\n cursor += 1;\n continue;\n }\n\n if (char === \"{\" && content[cursor - 1] !== \"\\\\\") {\n const end = findMdxExpressionEnd(content, cursor + 1);\n if (end !== -1) {\n const expression = content.slice(cursor + 1, end).trim();\n const path = parseDocumentPropPath(expression);\n if (!path) {\n throw new Error(\n `[ox-content-svelte] Unsupported MDX document prop expression \"{${expression}}\" in ${filePath}. Only identifiers and dotted property paths are supported.`,\n );\n }\n const marker = `${DOCUMENT_PROP_MARKER_PREFIX}${expressions.length}${DOCUMENT_PROP_MARKER_SUFFIX}`;\n expressions.push({ marker, expression, path });\n output += marker;\n cursor = end + 1;\n continue;\n }\n }\n\n output += char;\n cursor += 1;\n }\n\n return { content: output, expressions };\n}\n\nfunction collectInlineCodeRanges(content: string): Range[] {\n const ranges: Range[] = [];\n const fenceRanges = collectFenceRanges(content);\n let lineStart = 0;\n\n while (lineStart < content.length) {\n const lineEnd = content.indexOf(\"\\n\", lineStart);\n const end = lineEnd === -1 ? content.length : lineEnd;\n if (!isInRanges(lineStart, end, fenceRanges)) {\n let cursor = lineStart;\n while (cursor < end) {\n const marker = matchBacktickRun(content, cursor);\n if (!marker) {\n cursor += 1;\n continue;\n }\n const close = content.indexOf(marker, cursor + marker.length);\n if (close === -1 || close >= end) {\n cursor += marker.length;\n continue;\n }\n ranges.push({ start: cursor, end: close + marker.length });\n cursor = close + marker.length;\n }\n }\n lineStart = lineEnd === -1 ? content.length : lineEnd + 1;\n }\n\n return ranges;\n}\n\nfunction collectMdxEsmLineRanges(content: string): Range[] {\n const ranges: Range[] = [];\n const fenceRanges = collectFenceRanges(content);\n let lineStart = 0;\n\n while (lineStart < content.length) {\n const lineEnd = content.indexOf(\"\\n\", lineStart);\n const end = lineEnd === -1 ? content.length : lineEnd + 1;\n const contentEnd = lineEnd === -1 ? content.length : lineEnd;\n if (!isInRanges(lineStart, contentEnd, fenceRanges)) {\n const line = content.slice(lineStart, contentEnd).trimStart();\n if (line.startsWith(\"import \") || line.startsWith(\"export \")) {\n ranges.push({ start: lineStart, end });\n }\n }\n lineStart = lineEnd === -1 ? content.length : lineEnd + 1;\n }\n\n return ranges;\n}\n\nfunction mergeRanges(ranges: Range[]): Range[] {\n const sorted = ranges\n .filter((range) => range.end > range.start)\n .sort((left, right) => left.start - right.start || left.end - right.end);\n const merged: Range[] = [];\n\n for (const range of sorted) {\n const previous = merged.at(-1);\n if (previous && range.start <= previous.end) {\n previous.end = Math.max(previous.end, range.end);\n } else {\n merged.push({ ...range });\n }\n }\n\n return merged;\n}\n\nfunction matchBacktickRun(content: string, index: number): string | null {\n if (content[index] !== \"`\") return null;\n let end = index + 1;\n while (content[end] === \"`\") {\n end += 1;\n }\n return content.slice(index, end);\n}\n\nfunction startsHtmlLikeTag(content: string, index: number): boolean {\n const next = content[index + 1];\n return next === \"/\" || next === \"!\" || next === \"?\" || /[A-Za-z]/.test(next ?? \"\");\n}\n\nfunction findMdxExpressionEnd(content: string, start: number): number {\n let depth = 1;\n let quote: string | null = null;\n let escaped = false;\n\n for (let index = start; index < content.length; index += 1) {\n const char = content[index]!;\n if (quote) {\n if (escaped) {\n escaped = false;\n } else if (char === \"\\\\\") {\n escaped = true;\n } else if (char === quote) {\n quote = null;\n }\n continue;\n }\n\n if (char === '\"' || char === \"'\" || char === \"`\") {\n quote = char;\n continue;\n }\n if (char === \"{\") {\n depth += 1;\n continue;\n }\n if (char === \"}\") {\n depth -= 1;\n if (depth === 0) return index;\n }\n }\n\n return -1;\n}\n\nfunction parseDocumentPropPath(expression: string): string[] | null {\n if (\n !/^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)*$/.test(expression) ||\n RESERVED_DOCUMENT_PROP_WORDS.has(expression)\n ) {\n return null;\n }\n return expression.split(\".\");\n}\n\nconst RESERVED_DOCUMENT_PROP_WORDS = new Set([\n \"false\",\n \"Infinity\",\n \"NaN\",\n \"null\",\n \"this\",\n \"true\",\n \"undefined\",\n]);\n\nfunction generateMdxDocumentPropsSvelteModule(\n html: string,\n usedComponents: string[],\n frontmatter: Record<string, unknown>,\n options: ResolvedSvelteOptions & { root?: string },\n id: string,\n localBindings: ReadonlyMap<string, ResolvedDocumentComponentImport>,\n documentExpressions: readonly MdxDocumentExpression[],\n): string {\n const filePathLiteral = JSON.stringify(id);\n const imports = renderIslandComponentImports(usedComponents, {\n globalComponents: options.components,\n localBindings,\n documentPath: id,\n root: options.root,\n });\n const template = renderMdxDocumentTemplate(html, usedComponents, id, documentExpressions);\n\n return `\n<script>\n ${imports}\n\n const frontmatter = ${JSON.stringify(frontmatter)};\n export { frontmatter };\n\n let __ox_mdx_props = $props();\n\n function __ox_mdx_document_prop(props, path, expression) {\n const propName = path.join(\".\");\n let value = props;\n for (const segment of path) {\n if (\n value == null ||\n (typeof value !== \"object\" && typeof value !== \"function\") ||\n !(segment in Object(value))\n ) {\n throw new Error('[ox-content-svelte] Missing MDX document prop \"' + propName + '\" in ' + ${filePathLiteral} + ' for expression {' + expression + '}.');\n }\n value = value[segment];\n }\n if (value === undefined) {\n throw new Error('[ox-content-svelte] Missing MDX document prop \"' + propName + '\" in ' + ${filePathLiteral} + ' for expression {' + expression + '}.');\n }\n return value;\n }\n</script>\n\n<div class=\"ox-content\">${template}</div>\n\n<style>\n .ox-content {\n line-height: 1.6;\n }\n</style>\n`;\n}\n\nfunction renderMdxDocumentTemplate(\n html: string,\n usedComponents: string[],\n filePath: string,\n documentExpressions: readonly MdxDocumentExpression[],\n): string {\n const context: MdxTemplateContext = {\n html,\n filePath,\n usedComponents: new Set(usedComponents),\n expressionsByMarker: new Map(\n documentExpressions.map((expression) => [expression.marker, expression] as const),\n ),\n islandRanges: findMdxIslandRanges(html),\n };\n return renderHtmlRange(context, 0, html.length);\n}\n\nfunction renderHtmlRange(context: MdxTemplateContext, start: number, end: number): string {\n let output = \"\";\n let cursor = start;\n\n while (cursor < end) {\n const island = findNextIslandRange(context, cursor, end);\n if (!island) {\n output += renderRawHtmlTemplate(context.html.slice(cursor, end), context.expressionsByMarker);\n break;\n }\n\n output += renderRawHtmlTemplate(\n context.html.slice(cursor, island.openStart),\n context.expressionsByMarker,\n );\n output += renderMdxIslandTemplate(context, island);\n cursor = island.closeEnd;\n }\n\n return output;\n}\n\nfunction findNextIslandRange(\n context: MdxTemplateContext,\n cursor: number,\n end: number,\n): MdxIslandRange | null {\n for (const island of context.islandRanges) {\n if (island.openStart < cursor || island.closeEnd > end) {\n continue;\n }\n if (context.usedComponents.has(island.name)) {\n return island;\n }\n }\n return null;\n}\n\nfunction renderRawHtmlTemplate(\n html: string,\n expressionsByMarker: ReadonlyMap<string, MdxDocumentExpression>,\n): string {\n if (!html) return \"\";\n let output = \"\";\n let cursor = 0;\n\n while (cursor < html.length) {\n const next = findNextDocumentExpressionMarker(html, cursor, expressionsByMarker);\n if (!next) {\n output += renderRawHtmlBlock(html.slice(cursor));\n break;\n }\n output += renderRawHtmlBlock(html.slice(cursor, next.index));\n output += renderDocumentExpression(next.expression);\n cursor = next.index + next.expression.marker.length;\n }\n\n return output;\n}\n\nfunction findNextDocumentExpressionMarker(\n html: string,\n start: number,\n expressionsByMarker: ReadonlyMap<string, MdxDocumentExpression>,\n): { index: number; expression: MdxDocumentExpression } | null {\n let nextIndex = -1;\n let nextExpression: MdxDocumentExpression | undefined;\n\n for (const expression of expressionsByMarker.values()) {\n const index = html.indexOf(expression.marker, start);\n if (index !== -1 && (nextIndex === -1 || index < nextIndex)) {\n nextIndex = index;\n nextExpression = expression;\n }\n }\n\n return nextExpression ? { index: nextIndex, expression: nextExpression } : null;\n}\n\nfunction renderRawHtmlBlock(html: string): string {\n return html ? `{@html ${JSON.stringify(html).replaceAll(\"</script\", \"<\\\\/script\")}}` : \"\";\n}\n\nfunction renderDocumentExpression(expression: MdxDocumentExpression): string {\n return `{${documentPropResolverExpression(expression.path, expression.expression)}}`;\n}\n\nfunction renderMdxIslandTemplate(context: MdxTemplateContext, island: MdxIslandRange): string {\n assertSvelteComponentName(island.name, context.filePath);\n const attrs = renderMdxIslandAttributes(readMdxIslandPayload(island), context.filePath);\n const children = renderHtmlRange(context, island.contentStart, island.closeStart);\n return children\n ? `<${island.name}${attrs}>${children}</${island.name}>`\n : `<${island.name}${attrs} />`;\n}\n\nfunction renderMdxIslandAttributes(payload: MdxIslandPayload, filePath: string): string {\n const attrs: string[] = [];\n\n for (const spread of payload.spreads) {\n const expression = spread.trim().startsWith(\"...\")\n ? spread.trim().slice(3).trim()\n : spread.trim();\n const path = parseDocumentPropPath(expression);\n if (!path) {\n throw new Error(\n `[ox-content-svelte] Unsupported MDX document prop spread \"{${spread}}\" in ${filePath}. Only identifiers and dotted property paths are supported.`,\n );\n }\n attrs.push(`{...${documentPropResolverExpression(path, expression)}}`);\n }\n\n for (const [name, value] of Object.entries(payload.props)) {\n assertSvelteAttributeName(name, filePath);\n attrs.push(`${name}={${renderSvelteLiteral(value)}}`);\n }\n\n for (const [name, expression] of Object.entries(payload.expressions)) {\n assertSvelteAttributeName(name, filePath);\n const path = parseDocumentPropPath(expression.trim());\n if (!path) {\n throw new Error(\n `[ox-content-svelte] Unsupported MDX document prop expression \"{${expression}}\" for prop \"${name}\" in ${filePath}. Only identifiers and dotted property paths are supported.`,\n );\n }\n attrs.push(`${name}={${documentPropResolverExpression(path, expression.trim())}}`);\n }\n\n return attrs.length > 0 ? ` ${attrs.join(\" \")}` : \"\";\n}\n\nfunction documentPropResolverExpression(path: readonly string[], expression: string): string {\n return `__ox_mdx_document_prop(__ox_mdx_props, ${JSON.stringify(path)}, ${JSON.stringify(expression)})`;\n}\n\nfunction renderSvelteLiteral(value: unknown): string {\n const literal = JSON.stringify(value);\n return literal === undefined ? \"undefined\" : literal.replaceAll(\"</script\", \"<\\\\/script\");\n}\n\nfunction findMdxIslandRanges(html: string): MdxIslandRange[] {\n const ranges: MdxIslandRange[] = [];\n const openRe = /<(div|span)\\b([^>]*\\bdata-ox-island=\"([^\"]+)\"[^>]*)>/gi;\n let match: RegExpExecArray | null;\n\n while ((match = openRe.exec(html)) !== null) {\n const tag = match[1]!;\n const name = decodeHtmlAttr(match[3] ?? \"\");\n if (!name) continue;\n const openStart = match.index;\n const openEnd = match.index + match[0].length;\n const closeStart = findMatchingClose(html, openEnd, tag);\n const closeEnd = closeStart < html.length ? closeStart + tag.length + 3 : html.length;\n const inner = html.slice(openEnd, closeStart);\n const scriptMatch = inner.match(PAYLOAD_SCRIPT);\n const script = scriptMatch?.[0];\n ranges.push({\n name,\n tag,\n openStart,\n openEnd,\n innerStart: openEnd,\n contentStart: openEnd + (script?.length ?? 0),\n closeStart,\n closeEnd,\n propsAttr: matchAttr(match[2] ?? \"\", \"data-ox-props\"),\n script,\n });\n }\n\n return ranges.sort((left, right) => left.openStart - right.openStart);\n}\n\nfunction findMatchingClose(html: string, from: number, tag: string): number {\n const openNeedle = `<${tag}`;\n const closeNeedle = `</${tag}>`;\n let depth = 1;\n let cursor = from;\n\n while (cursor < html.length) {\n const nextOpen = indexOfTagOpen(html, openNeedle, cursor);\n const nextClose = html.indexOf(closeNeedle, cursor);\n if (nextClose === -1) return html.length;\n if (nextOpen !== -1 && nextOpen < nextClose) {\n depth += 1;\n cursor = nextOpen + openNeedle.length;\n } else {\n depth -= 1;\n if (depth === 0) return nextClose;\n cursor = nextClose + closeNeedle.length;\n }\n }\n\n return html.length;\n}\n\nfunction indexOfTagOpen(html: string, openNeedle: string, from: number): number {\n let cursor = from;\n while (cursor < html.length) {\n const index = html.indexOf(openNeedle, cursor);\n if (index === -1) return -1;\n const next = html[index + openNeedle.length];\n if (next === \" \" || next === \">\" || next === \"\\t\" || next === \"\\n\" || next === \"/\") {\n return index;\n }\n cursor = index + openNeedle.length;\n }\n return -1;\n}\n\nfunction matchAttr(attrs: string, name: string): string | undefined {\n const match = new RegExp(`\\\\b${name}=\"([^\"]*)\"`, \"i\").exec(attrs);\n return match?.[1] === undefined ? undefined : decodeHtmlAttr(match[1]);\n}\n\nfunction readMdxIslandPayload(island: MdxIslandRange): MdxIslandPayload {\n const fromAttr = island.propsAttr ? tryParseJson(island.propsAttr) : undefined;\n const fromScript = island.script\n ? tryParseJson(\n island.script.match(/<script type=\"application\\/json\">([\\s\\S]*?)<\\/script>/i)?.[1] ?? \"\",\n )\n : undefined;\n return normalizeMdxIslandPayload(fromAttr ?? fromScript ?? {});\n}\n\nfunction normalizeMdxIslandPayload(parsed: unknown): MdxIslandPayload {\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n return { props: {}, expressions: {}, spreads: [] };\n }\n\n const record = parsed as Record<string, unknown>;\n const keys = Object.keys(record);\n if (keys.length > 0 && keys.every((key) => RUST_PAYLOAD_KEYS.has(key))) {\n return {\n props: toRecord(record.props),\n expressions: toStringRecord(record.expressions),\n spreads: toStringArray(record.spreads),\n };\n }\n\n return { props: record, expressions: {}, spreads: [] };\n}\n\nfunction toRecord(value: unknown): Record<string, unknown> {\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : {};\n}\n\nfunction toStringRecord(value: unknown): Record<string, string> {\n const record = toRecord(value);\n const output: Record<string, string> = {};\n for (const [key, entry] of Object.entries(record)) {\n if (typeof entry === \"string\") {\n output[key] = entry;\n }\n }\n return output;\n}\n\nfunction toStringArray(value: unknown): string[] {\n return Array.isArray(value)\n ? value.filter((entry): entry is string => typeof entry === \"string\")\n : [];\n}\n\nfunction tryParseJson(value: string): unknown {\n try {\n return JSON.parse(value);\n } catch {\n return undefined;\n }\n}\n\nfunction decodeHtmlAttr(value: string): string {\n return value\n .replaceAll(\"&quot;\", '\"')\n .replaceAll(\"&#39;\", \"'\")\n .replaceAll(\"&lt;\", \"<\")\n .replaceAll(\"&gt;\", \">\")\n .replaceAll(\"&amp;\", \"&\");\n}\n\nfunction assertSvelteComponentName(name: string, filePath: string): void {\n if (!/^[A-Z][A-Za-z0-9_$]*$/.test(name)) {\n throw new Error(\n `[ox-content-svelte] Unsupported MDX component name \"${name}\" in ${filePath} for mdxDocumentProps. Only simple Svelte component identifiers are supported.`,\n );\n }\n}\n\nfunction assertSvelteAttributeName(name: string, filePath: string): void {\n if (!/^[A-Za-z_$][\\w$-]*$/.test(name)) {\n throw new Error(\n `[ox-content-svelte] Unsupported MDX component prop name \"${name}\" in ${filePath}.`,\n );\n }\n}\n\nfunction generateSvelteModule(\n content: string,\n usedComponents: string[],\n _islands: ComponentIsland[] | string[],\n frontmatter: Record<string, unknown>,\n options: ResolvedSvelteOptions & { root?: string },\n id: string,\n localBindings?: ReadonlyMap<string, ResolvedDocumentComponentImport>,\n): string {\n // Rust island payloads include `</script>`; that must not close this SFC block.\n const rawHtmlLiteral = JSON.stringify(content).replaceAll(\"</script\", \"<\\\\/script\");\n\n const imports = renderIslandComponentImports(usedComponents, {\n globalComponents: options.components,\n localBindings,\n documentPath: id,\n root: options.root,\n });\n\n // If no registered islands, generate simpler code without island runtime\n if (usedComponents.length === 0) {\n return `\n<script>\n const frontmatter = ${JSON.stringify(frontmatter)};\n const rawHtml = ${rawHtmlLiteral};\n\n export { frontmatter };\n</script>\n\n<div class=\"ox-content\">\n {@html rawHtml}\n</div>\n\n<style>\n .ox-content {\n line-height: 1.6;\n }\n</style>\n`;\n }\n\n const componentMap = usedComponents.map((name) => ` ${name},`).join(\"\\n\");\n\n return `\n<script>\n import { createRawSnippet, onMount, mount, unmount } from 'svelte';\n import { initIslands, readIslandSlotHtml } from '@ox-content/islands';\n ${imports}\n\n const frontmatter = ${JSON.stringify(frontmatter)};\n const rawHtml = ${rawHtmlLiteral};\n const components = {\n${componentMap}\n };\n\n export { frontmatter };\n\n let container;\n\n function createSvelteHydrate() {\n const mounted = [];\n\n return (element, props) => {\n const componentName = element.dataset.oxIsland;\n const Component = components[componentName];\n if (!Component) return;\n\n const islandContent = readIslandSlotHtml(element);\n const componentProps = { ...props };\n if (islandContent) {\n componentProps.children = createRawSnippet(() => ({\n render: () => \\`<div>\\${islandContent}</div>\\`,\n }));\n }\n\n const instance = mount(Component, { target: element, props: componentProps });\n mounted.push(instance);\n\n return () => unmount(instance);\n };\n }\n\n onMount(() => {\n if (!container) return;\n const controller = initIslands(createSvelteHydrate(), {\n selector: '.ox-content [data-ox-island]',\n });\n return () => controller.destroy();\n });\n</script>\n\n<div class=\"ox-content\" bind:this={container}>\n {@html rawHtml}\n</div>\n\n<style>\n .ox-content {\n line-height: 1.6;\n }\n</style>\n`;\n}\n","import type { EnvironmentOptions } from \"vite\";\n\nexport function createSvelteMarkdownEnvironment(\n mode: \"ssr\" | \"client\",\n options: { outDir: string },\n): EnvironmentOptions {\n const isSSR = mode === \"ssr\";\n\n return {\n build: {\n outDir: isSSR ? `${options.outDir}/.ox-content/ssr` : `${options.outDir}/.ox-content/client`,\n ssr: isSSR,\n rollupOptions: {\n output: {\n format: \"esm\",\n entryFileNames: isSSR ? \"[name].js\" : \"[name].[hash].js\",\n },\n },\n ...(isSSR && { target: \"node18\", minify: false }),\n },\n resolve: {\n conditions: isSSR ? [\"node\", \"import\"] : [\"browser\", \"import\"],\n },\n optimizeDeps: {\n include: isSSR ? [] : [\"svelte\"],\n exclude: [\"@ox-content/vite-plugin\", \"@ox-content/vite-plugin-svelte\"],\n },\n };\n}\n","/**\n * Vite Plugin for Ox Content Svelte Integration\n *\n * Uses Vite's Environment API to enable embedding Svelte components in Markdown.\n */\n\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport type { Plugin, PluginOption, ResolvedConfig } from \"vite\";\nimport { oxContent } from \"@ox-content/vite-plugin\";\nimport { transformMarkdownWithSvelte } from \"./transform\";\nimport { createSvelteMarkdownEnvironment } from \"./environment\";\nimport type {\n SvelteIntegrationOptions,\n ResolvedSvelteOptions,\n ComponentsMap,\n ComponentsOption,\n BuiltinEmbedOptions,\n} from \"./types\";\n\nconst DEFAULT_MARKDOWN_EXTENSIONS = [\".md\", \".markdown\", \".mdx\"] as const;\n\nfunction normalizeMarkdownExtensions(extensions?: readonly string[]): string[] {\n const values = extensions?.length ? extensions : DEFAULT_MARKDOWN_EXTENSIONS;\n return Array.from(\n new Map(\n values.map((extension) => {\n const value = extension.startsWith(\".\") ? extension : `.${extension}`;\n return [value.toLowerCase(), value] as const;\n }),\n ).values(),\n );\n}\n\nfunction isMarkdownFilePath(filePath: string, extensions: readonly string[]): boolean {\n const pathname = filePath.split(\"?\")[0].split(\"#\")[0].toLowerCase();\n return extensions.some((extension) => pathname.endsWith(extension.toLowerCase()));\n}\n\nfunction resolveBuiltinEmbedOptions(\n options: BuiltinEmbedOptions | false | undefined,\n): ResolvedSvelteOptions[\"embeds\"] {\n if (options === false) return { github: false, openGraph: false };\n return {\n github: resolveSingleEmbedOptions(options?.github),\n openGraph: resolveSingleEmbedOptions(options?.openGraph),\n };\n}\n\nfunction resolveSingleEmbedOptions<T extends object>(options: boolean | T | undefined): T | false {\n if (options === false) return false;\n if (options === true || options === undefined) return {} as T;\n return options;\n}\n\nexport type {\n SvelteIntegrationOptions,\n ResolvedSvelteOptions,\n ComponentsOption,\n ComponentsMap,\n BuiltinEmbedOptions,\n MdxDocumentPropsOption,\n GitHubEmbedOptions,\n OpenGraphEmbedOptions,\n ResolvedBuiltinEmbedOptions,\n SvelteTransformResult,\n ComponentIsland,\n} from \"./types\";\n\n/**\n * Creates the Ox Content Svelte integration plugin.\n *\n * Forwards core options such as `ssg`, `redirects`, `feeds`, and `siteMaps`.\n * The Svelte Markdown transform and environments replace the generic core\n * transform/`markdown` environment; other build plugins are kept.\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { defineConfig } from 'vite';\n * import { svelte } from '@sveltejs/vite-plugin-svelte';\n * import { oxContentSvelte } from 'vite-plugin-ox-content-svelte';\n *\n * export default defineConfig({\n * plugins: [\n * svelte(),\n * oxContentSvelte({\n * srcDir: 'docs',\n * components: {\n * Counter: './src/components/Counter.svelte',\n * },\n * }),\n * ],\n * });\n * ```\n */\nexport function oxContentSvelte(options: SvelteIntegrationOptions = {}): PluginOption[] {\n const resolved = resolveSvelteOptions(options);\n let componentMap = new Map<string, string>();\n let config: ResolvedConfig;\n\n if (typeof options.components === \"object\" && !Array.isArray(options.components)) {\n componentMap = new Map(Object.entries(options.components));\n }\n\n const svelteTransformPlugin: Plugin = {\n name: \"ox-content:svelte-transform\",\n enforce: \"pre\",\n\n async configResolved(resolvedConfig) {\n config = resolvedConfig;\n\n const componentsOption = options.components;\n if (componentsOption) {\n const resolvedComponents = await resolveComponentsGlob(componentsOption, config.root);\n componentMap = new Map(Object.entries(resolvedComponents));\n }\n },\n\n async transform(code, id, transformOptions) {\n if (!isMarkdownFilePath(id, resolved.extensions)) {\n return null;\n }\n\n const result = await transformMarkdownWithSvelte(code, id, {\n ...resolved,\n components: Object.fromEntries(componentMap),\n root: config.root,\n renderIsland: options.renderIsland,\n ssr: transformOptions?.ssr,\n });\n\n return {\n code: result.code,\n map: result.map,\n };\n },\n };\n\n const svelteEnvironmentPlugin: Plugin = {\n name: \"ox-content:svelte-environment\",\n\n config() {\n return {\n environments: {\n oxcontent_ssr: createSvelteMarkdownEnvironment(\"ssr\", resolved),\n oxcontent_client: createSvelteMarkdownEnvironment(\"client\", resolved),\n },\n };\n },\n\n resolveId(id) {\n if (id === \"virtual:ox-content-svelte/runtime\") {\n return \"\\0virtual:ox-content-svelte/runtime\";\n }\n if (id === \"virtual:ox-content-svelte/components\") {\n return \"\\0virtual:ox-content-svelte/components\";\n }\n return null;\n },\n\n load(id) {\n if (id === \"\\0virtual:ox-content-svelte/runtime\") {\n return generateRuntimeModule();\n }\n if (id === \"\\0virtual:ox-content-svelte/components\") {\n return generateComponentsModule(componentMap);\n }\n return null;\n },\n\n applyToEnvironment(environment) {\n return [\"oxcontent_ssr\", \"oxcontent_client\", \"client\", \"ssr\"].includes(environment.name);\n },\n };\n\n const svelteHmrPlugin: Plugin = {\n name: \"ox-content:svelte-hmr\",\n apply: \"serve\",\n\n handleHotUpdate({ file, server, modules }) {\n const isComponent = Array.from(componentMap.values()).some((path) =>\n file.endsWith(path.replace(/^\\.\\//, \"\")),\n );\n\n if (isComponent) {\n const mdModules = Array.from(server.moduleGraph.idToModuleMap.values()).filter(\n (mod) => mod.file && isMarkdownFilePath(mod.file, resolved.extensions),\n );\n\n if (mdModules.length > 0) {\n server.ws.send({\n type: \"custom\",\n event: \"ox-content:svelte-update\",\n data: { file },\n });\n return [...modules, ...mdModules];\n }\n }\n\n return modules;\n },\n };\n\n const replacedCorePluginNames = new Set([\"ox-content\", \"ox-content:environment\"]);\n const corePlugins = (\n oxContent(options).flatMap((plugin) => (Array.isArray(plugin) ? plugin : [plugin])) as Plugin[]\n ).filter((plugin) => !replacedCorePluginNames.has(plugin.name));\n\n return [svelteTransformPlugin, svelteEnvironmentPlugin, svelteHmrPlugin, ...corePlugins];\n}\n\nfunction resolveSvelteOptions(\n options: SvelteIntegrationOptions,\n): Omit<ResolvedSvelteOptions, \"components\"> {\n return {\n srcDir: options.srcDir ?? \"docs\",\n outDir: options.outDir ?? \"dist\",\n base: options.base ?? \"/\",\n extensions: normalizeMarkdownExtensions(options.extensions),\n gfm: options.gfm ?? true,\n autolinks: options.autolinks ?? options.gfm ?? true,\n frontmatter: options.frontmatter ?? true,\n toc: options.toc ?? true,\n tocMaxDepth: options.tocMaxDepth ?? 3,\n codeAnnotations: resolveCodeAnnotationsOptions(options.codeAnnotations),\n runes: options.runes ?? true,\n embeds: resolveBuiltinEmbedOptions(options.embeds),\n mdx: options.mdx,\n mdxDocumentProps: options.mdxDocumentProps ?? false,\n };\n}\n\nfunction resolveCodeAnnotationsOptions(\n options: SvelteIntegrationOptions[\"codeAnnotations\"],\n): ResolvedSvelteOptions[\"codeAnnotations\"] {\n if (!options) {\n return {\n enabled: false,\n metaKey: \"annotate\",\n };\n }\n\n if (options === true) {\n return {\n enabled: true,\n metaKey: \"annotate\",\n };\n }\n\n return {\n enabled: true,\n metaKey: options.metaKey ?? \"annotate\",\n };\n}\n\nfunction generateRuntimeModule(): string {\n return `\n// Svelte 5 runtime for ox-content\nexport { mount, unmount } from 'svelte';\n`;\n}\n\nfunction generateComponentsModule(componentMap: Map<string, string>): string {\n const imports: string[] = [];\n const exports: string[] = [];\n\n componentMap.forEach((path, name) => {\n imports.push(`import ${name} from '${path}';`);\n exports.push(` ${name},`);\n });\n\n return `\n${imports.join(\"\\n\")}\n\nexport const components = {\n${exports.join(\"\\n\")}\n};\n\nexport default components;\n`;\n}\n\nasync function resolveComponentsGlob(\n componentsOption: ComponentsOption,\n root: string,\n): Promise<ComponentsMap> {\n if (typeof componentsOption === \"object\" && !Array.isArray(componentsOption)) {\n return componentsOption;\n }\n\n const patterns = Array.isArray(componentsOption) ? componentsOption : [componentsOption];\n\n const result: ComponentsMap = {};\n\n for (const pattern of patterns) {\n const files = await globFiles(pattern, root);\n\n for (const file of files) {\n const baseName = path.basename(file, path.extname(file));\n const componentName = toPascalCase(baseName);\n const relativePath = \"./\" + path.relative(root, file).replace(/\\\\/g, \"/\");\n\n result[componentName] = relativePath;\n }\n }\n\n return result;\n}\n\nasync function globFiles(pattern: string, root: string): Promise<string[]> {\n const files: string[] = [];\n const isGlob = pattern.includes(\"*\");\n\n if (!isGlob) {\n const fullPath = path.resolve(root, pattern);\n if (fs.existsSync(fullPath)) {\n files.push(fullPath);\n }\n return files;\n }\n\n const parts = pattern.split(\"*\");\n const baseDir = path.resolve(root, parts[0]);\n const ext = parts[1] || \"\";\n\n if (!fs.existsSync(baseDir)) {\n return files;\n }\n\n if (pattern.includes(\"**\")) {\n await walkDir(baseDir, files, ext);\n } else {\n const entries = await fs.promises.readdir(baseDir, { withFileTypes: true });\n for (const entry of entries) {\n if (entry.isFile() && entry.name.endsWith(ext)) {\n files.push(path.join(baseDir, entry.name));\n }\n }\n }\n\n return files;\n}\n\nasync function walkDir(dir: string, files: string[], ext: string): Promise<void> {\n const entries = await fs.promises.readdir(dir, { withFileTypes: true });\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n\n if (entry.isDirectory()) {\n await walkDir(fullPath, files, ext);\n } else if (entry.isFile() && entry.name.endsWith(ext)) {\n files.push(fullPath);\n }\n }\n}\n\nfunction toPascalCase(str: string): string {\n return str.replace(/[-_](\\w)/g, (_, c) => c.toUpperCase()).replace(/^\\w/, (c) => c.toUpperCase());\n}\n\nexport { oxContent, renderHead } from \"@ox-content/vite-plugin\";\nexport type { HeadInput, RenderedHead } from \"@ox-content/vite-plugin\";\n"],"mappings":";;;;;AAiBA,MAAM,kBAAkB;AACxB,MAAM,aAAa;AAEnB,MAAM,uBAAuB;AAC7B,MAAM,uBAAuB;AAC7B,MAAM,8BAA8B;AACpC,MAAM,8BAA8B;AACpC,MAAM,iBAAiB;AACvB,MAAM,oCAAoB,IAAI,IAAI;CAAC;CAAS;CAAe;AAAS,CAAC;AAOrE,eAAsB,4BACpB,MACA,IACA,SACgC;CAChC,MAAM,aAA4B,QAAQ;CAC1C,MAAM,EAAE,SAAS,iBAAiB,gBAAgB,mBAAmB,IAAI;CACzE,MAAM,MAAM,sBAAsB,IAAI,QAAQ,GAAG;CAEjD,MAAM,cAAc;EAClB,QAAQ,QAAQ;EA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;EACX,MAAM,WAAW,KAAK,QAAQ,MAAM,OAAO;EAC3C,IAAI,GAAG,WAAW,QAAQ,GACxB,MAAM,KAAK,QAAQ;EAErB,OAAO;CACT;CAEA,MAAM,QAAQ,QAAQ,MAAM,GAAG;CAC/B,MAAM,UAAU,KAAK,QAAQ,MAAM,MAAM,EAAE;CAC3C,MAAM,MAAM,MAAM,MAAM;CAExB,IAAI,CAAC,GAAG,WAAW,OAAO,GACxB,OAAO;CAGT,IAAI,QAAQ,SAAS,IAAI,GACvB,MAAM,QAAQ,SAAS,OAAO,GAAG;MAC5B;EACL,MAAM,UAAU,MAAM,GAAG,SAAS,QAAQ,SAAS,EAAE,eAAe,KAAK,CAAC;EAC1E,KAAK,MAAM,SAAS,SAClB,IAAI,MAAM,OAAO,KAAK,MAAM,KAAK,SAAS,GAAG,GAC3C,MAAM,KAAK,KAAK,KAAK,SAAS,MAAM,IAAI,CAAC;CAG/C;CAEA,OAAO;AACT;AAEA,eAAe,QAAQ,KAAa,OAAiB,KAA4B;CAC/E,MAAM,UAAU,MAAM,GAAG,SAAS,QAAQ,KAAK,EAAE,eAAe,KAAK,CAAC;CAEtE,KAAK,MAAM,SAAS,SAAS;EAC3B,MAAM,WAAW,KAAK,KAAK,KAAK,MAAM,IAAI;EAE1C,IAAI,MAAM,YAAY,GACpB,MAAM,QAAQ,UAAU,OAAO,GAAG;OAC7B,IAAI,MAAM,OAAO,KAAK,MAAM,KAAK,SAAS,GAAG,GAClD,MAAM,KAAK,QAAQ;CAEvB;AACF;AAEA,SAAS,aAAa,KAAqB;CACzC,OAAO,IAAI,QAAQ,cAAc,GAAG,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,QAAQ,MAAM,EAAE,YAAY,CAAC;AAClG"}
1
+ {"version":3,"file":"index.mjs","names":["baseTransformMarkdown","oxContent"],"sources":["../src/transform.ts","../src/environment.ts","../src/index.ts"],"sourcesContent":["import {\n applyIslandSsrHtml,\n discoverDocumentMdxIslands,\n renderIslandComponentImports,\n resolveContentRootPath,\n resolveMdxForFilePath,\n transformMarkdown as baseTransformMarkdown,\n type ResolvedDocumentComponentImport,\n} from \"@ox-content/vite-plugin\";\nimport { compile } from \"svelte/compiler\";\nimport type {\n ResolvedSvelteOptions,\n SvelteTransformResult,\n ComponentIsland,\n ComponentsMap,\n} from \"./types\";\n\nconst COMPONENT_REGEX = /<([A-Z][a-zA-Z0-9]*)\\s*([^>]*?)\\s*(?:\\/>|>([\\s\\S]*?)<\\/\\1>)/g;\nconst PROP_REGEX = /([a-zA-Z0-9-]+)(?:=(?:\"([^\"]*)\"|'([^']*)'|{([^}]*)}|\\[([^\\]]*)\\]))?/g;\n\nconst ISLAND_MARKER_PREFIX = \"OXCONTENT-ISLAND-\";\nconst ISLAND_MARKER_SUFFIX = \"-PLACEHOLDER\";\nconst DOCUMENT_PROP_MARKER_PREFIX = \"OXCONTENT-DOCUMENT-PROP-\";\nconst DOCUMENT_PROP_MARKER_SUFFIX = \"-PLACEHOLDER\";\nconst PAYLOAD_SCRIPT = /^\\s*<script type=\"application\\/json\">[\\s\\S]*?<\\/script>/i;\nconst RUST_PAYLOAD_KEYS = new Set([\"props\", \"expressions\", \"spreads\"]);\n\ninterface Range {\n start: number;\n end: number;\n}\n\nexport async function transformMarkdownWithSvelte(\n code: string,\n id: string,\n options: ResolvedSvelteOptions,\n): Promise<SvelteTransformResult> {\n const components: ComponentsMap = options.components;\n const { content: markdownContent, frontmatter } = extractFrontmatter(code);\n const mdx = resolveMdxForFilePath(id, options.mdx);\n\n const baseOptions = {\n srcDir: options.srcDir,\n outDir: options.outDir,\n base: options.base,\n extensions: options.extensions,\n mdx,\n ssg: {\n enabled: false,\n extension: \".html\",\n clean: false,\n bare: false,\n generateOgImage: false,\n lastUpdated: false,\n pagination: false,\n breadcrumbs: false,\n jsonLd: false,\n readerChrome: false,\n localeSwitcher: false,\n a11y: false,\n pageChrome: false,\n },\n gfm: options.gfm,\n frontmatter: false,\n toc: options.toc,\n tocMaxDepth: options.tocMaxDepth,\n codeAnnotations: options.codeAnnotations,\n footnotes: true,\n tables: true,\n taskLists: true,\n strikethrough: true,\n autolinks: options.autolinks,\n highlight: false,\n mermaid: false,\n ogImage: false,\n ogImageOptions: {\n vuePlugin: \"vitejs\",\n width: 1200,\n height: 630,\n cache: true,\n concurrency: 1,\n },\n transformers: [],\n docs: false,\n ogViewer: false,\n search: {\n enabled: false,\n limit: 10,\n prefix: true,\n placeholder: \"Search...\",\n hotkey: \"k\",\n },\n embeds: options.embeds,\n i18n: false,\n } as unknown as Parameters<typeof baseTransformMarkdown>[2] & {\n codeAnnotations?: ResolvedSvelteOptions[\"codeAnnotations\"];\n };\n\n if (mdx) {\n const documentExpressions = options.mdxDocumentProps\n ? prepareMdxDocumentExpressions(markdownContent, id)\n : { content: markdownContent, expressions: [] };\n const transformed = await baseTransformMarkdown(documentExpressions.content, id, baseOptions);\n const discovered = await discoverDocumentMdxIslands({\n source: markdownContent,\n html: transformed.html,\n components,\n imports: transformed.imports,\n documentPath: id,\n contentRoot: resolveContentRootPath({ srcDir: options.srcDir, root: options.root }),\n srcDir: options.srcDir,\n });\n if (options.mdxDocumentProps) {\n return compileSvelteResult(\n generateMdxDocumentPropsSvelteModule(\n transformed.html,\n discovered.usedComponents,\n frontmatter,\n options,\n id,\n discovered.localBindings,\n documentExpressions.expressions,\n ),\n id,\n discovered.usedComponents,\n frontmatter,\n options.ssr,\n );\n }\n const html = options.renderIsland\n ? await applyIslandSsrHtml(\n transformed.html,\n options.renderIsland,\n id,\n discovered.usedComponents,\n )\n : transformed.html;\n return compileSvelteResult(\n generateSvelteModule(\n html,\n discovered.usedComponents,\n discovered.usedComponents,\n frontmatter,\n options,\n id,\n discovered.localBindings,\n ),\n id,\n discovered.usedComponents,\n frontmatter,\n options.ssr,\n );\n }\n\n const usedComponents: string[] = [];\n const islands: ComponentIsland[] = [];\n let islandIndex = 0;\n\n const fenceRanges = collectFenceRanges(markdownContent);\n let processedContent = \"\";\n let lastIndex = 0;\n let match: RegExpExecArray | null;\n\n COMPONENT_REGEX.lastIndex = 0;\n while ((match = COMPONENT_REGEX.exec(markdownContent)) !== null) {\n const [fullMatch, componentName, propsString, rawIslandContent] = match;\n const matchStart = match.index;\n const matchEnd = matchStart + fullMatch.length;\n\n if (\n !Object.prototype.hasOwnProperty.call(components, componentName) ||\n isInRanges(matchStart, matchEnd, fenceRanges)\n ) {\n processedContent += markdownContent.slice(lastIndex, matchEnd);\n lastIndex = matchEnd;\n continue;\n }\n\n if (!usedComponents.includes(componentName)) {\n usedComponents.push(componentName);\n }\n\n const props = parseProps(propsString);\n const islandId = `ox-island-${islandIndex++}`;\n const islandContent =\n typeof rawIslandContent === \"string\" ? rawIslandContent.trim() : undefined;\n\n islands.push({\n name: componentName,\n props,\n position: matchStart,\n id: islandId,\n content: islandContent,\n });\n\n processedContent += markdownContent.slice(lastIndex, matchStart) + createIslandMarker(islandId);\n lastIndex = matchEnd;\n }\n processedContent += markdownContent.slice(lastIndex);\n\n const transformed = await baseTransformMarkdown(processedContent, id, baseOptions);\n const htmlWithIslands = injectIslandMarkers(transformed.html, islands);\n return compileSvelteResult(\n generateSvelteModule(htmlWithIslands, usedComponents, islands, frontmatter, options, id),\n id,\n usedComponents,\n frontmatter,\n options.ssr,\n );\n}\n\nfunction compileSvelteResult(\n svelteCode: string,\n id: string,\n usedComponents: string[],\n frontmatter: Record<string, unknown>,\n ssr = false,\n): SvelteTransformResult {\n const compiled = compile(svelteCode, {\n filename: id,\n generate: ssr ? \"server\" : \"client\",\n runes: true,\n });\n\n return {\n code: `${compiled.js.code}\\nexport const frontmatter = ${JSON.stringify(frontmatter)};`,\n map: null,\n usedComponents,\n frontmatter,\n };\n}\n\nfunction createIslandMarker(islandId: string): string {\n return `${ISLAND_MARKER_PREFIX}${islandId}${ISLAND_MARKER_SUFFIX}`;\n}\n\nfunction collectFenceRanges(content: string): Range[] {\n const ranges: Range[] = [];\n let inFence = false;\n let fenceChar = \"\";\n let fenceLength = 0;\n let fenceStart = 0;\n let pos = 0;\n\n while (pos < content.length) {\n const lineEnd = content.indexOf(\"\\n\", pos);\n const next = lineEnd === -1 ? content.length : lineEnd + 1;\n const line = content.slice(pos, lineEnd === -1 ? content.length : lineEnd);\n const fenceMatch = line.match(/^\\s{0,3}([`~]{3,})/);\n\n if (fenceMatch) {\n const marker = fenceMatch[1];\n if (!inFence) {\n inFence = true;\n fenceChar = marker[0];\n fenceLength = marker.length;\n fenceStart = pos;\n } else if (marker[0] === fenceChar && marker.length >= fenceLength) {\n inFence = false;\n ranges.push({ start: fenceStart, end: next });\n fenceChar = \"\";\n fenceLength = 0;\n }\n }\n\n pos = next;\n }\n\n if (inFence) {\n ranges.push({ start: fenceStart, end: content.length });\n }\n\n return ranges;\n}\n\nfunction isInRanges(start: number, end: number, ranges: Range[]): boolean {\n for (const range of ranges) {\n if (start < range.end && end > range.start) {\n return true;\n }\n }\n return false;\n}\n\nfunction injectIslandMarkers(html: string, islands: ComponentIsland[]): string {\n let output = html;\n\n for (const island of islands) {\n const marker = createIslandMarker(island.id);\n const propsAttr =\n Object.keys(island.props).length > 0\n ? ` data-ox-props='${JSON.stringify(island.props).replace(/'/g, \"&#39;\")}'`\n : \"\";\n const contentAttr = island.content\n ? ` data-ox-content='${island.content.replace(/'/g, \"&#39;\")}'`\n : \"\";\n const attrs = `data-ox-island=\"${island.name}\"${propsAttr}${contentAttr}`;\n output = output.replaceAll(`<p>${marker}</p>`, `<div ${attrs}></div>`);\n output = output.replaceAll(marker, `<span ${attrs}></span>`);\n }\n\n return output;\n}\n\nfunction extractFrontmatter(content: string): {\n content: string;\n frontmatter: Record<string, unknown>;\n} {\n const frontmatterRegex = /^---\\n([\\s\\S]*?)\\n---\\n/;\n const match = frontmatterRegex.exec(content);\n\n if (!match) {\n return { content, frontmatter: {} };\n }\n\n const frontmatterStr = match[1];\n const frontmatter: Record<string, unknown> = {};\n\n for (const line of frontmatterStr.split(\"\\n\")) {\n const colonIndex = line.indexOf(\":\");\n if (colonIndex > 0) {\n const key = line.slice(0, colonIndex).trim();\n let value: unknown = line.slice(colonIndex + 1).trim();\n try {\n value = JSON.parse(value as string);\n } catch {\n if (\n typeof value === \"string\" &&\n ((value.startsWith('\"') && value.endsWith('\"')) ||\n (value.startsWith(\"'\") && value.endsWith(\"'\")))\n ) {\n value = value.slice(1, -1);\n }\n }\n frontmatter[key] = value;\n }\n }\n\n return { content: content.slice(match[0].length), frontmatter };\n}\n\nfunction parseProps(propsString: string): Record<string, unknown> {\n const props: Record<string, unknown> = {};\n if (!propsString) return props;\n\n PROP_REGEX.lastIndex = 0;\n let match: RegExpExecArray | null;\n while ((match = PROP_REGEX.exec(propsString)) !== null) {\n const [, name, doubleQuoted, singleQuoted, braceValue, bracketValue] = match;\n if (name) {\n if (doubleQuoted !== undefined) props[name] = doubleQuoted;\n else if (singleQuoted !== undefined) props[name] = singleQuoted;\n else if (braceValue !== undefined) {\n try {\n props[name] = JSON.parse(braceValue);\n } catch {\n props[name] = braceValue;\n }\n } else if (bracketValue !== undefined) {\n try {\n props[name] = JSON.parse(`[${bracketValue}]`);\n } catch {\n props[name] = bracketValue;\n }\n } else props[name] = true;\n }\n }\n return props;\n}\n\ninterface MdxDocumentExpression {\n marker: string;\n expression: string;\n path: string[];\n}\n\ninterface PreparedMdxDocumentExpressions {\n content: string;\n expressions: MdxDocumentExpression[];\n}\n\ninterface MdxIslandRange {\n name: string;\n tag: string;\n openStart: number;\n openEnd: number;\n innerStart: number;\n contentStart: number;\n closeStart: number;\n closeEnd: number;\n propsAttr?: string;\n script?: string;\n}\n\ninterface MdxIslandPayload {\n props: Record<string, unknown>;\n expressions: Record<string, string>;\n spreads: string[];\n}\n\ninterface MdxTemplateContext {\n html: string;\n filePath: string;\n usedComponents: Set<string>;\n expressionsByMarker: Map<string, MdxDocumentExpression>;\n islandRanges: MdxIslandRange[];\n}\n\nfunction prepareMdxDocumentExpressions(\n content: string,\n filePath: string,\n): PreparedMdxDocumentExpressions {\n const skipRanges = mergeRanges([\n ...collectFenceRanges(content),\n ...collectInlineCodeRanges(content),\n ...collectMdxEsmLineRanges(content),\n ]);\n const expressions: MdxDocumentExpression[] = [];\n let output = \"\";\n let cursor = 0;\n let rangeIndex = 0;\n let inTag = false;\n let quote: string | null = null;\n\n while (cursor < content.length) {\n const range = skipRanges[rangeIndex];\n if (range && cursor >= range.end) {\n rangeIndex += 1;\n continue;\n }\n if (range && cursor === range.start) {\n output += content.slice(range.start, range.end);\n cursor = range.end;\n continue;\n }\n\n const char = content[cursor]!;\n if (inTag) {\n output += char;\n if (quote) {\n if (char === quote && content[cursor - 1] !== \"\\\\\") {\n quote = null;\n }\n } else if (char === '\"' || char === \"'\") {\n quote = char;\n } else if (char === \">\") {\n inTag = false;\n }\n cursor += 1;\n continue;\n }\n\n if (char === \"<\" && startsHtmlLikeTag(content, cursor)) {\n inTag = true;\n output += char;\n cursor += 1;\n continue;\n }\n\n if (char === \"{\" && content[cursor - 1] !== \"\\\\\") {\n const end = findMdxExpressionEnd(content, cursor + 1);\n if (end !== -1) {\n const expression = content.slice(cursor + 1, end).trim();\n const path = parseDocumentPropPath(expression);\n if (!path) {\n throw new Error(\n `[ox-content-svelte] Unsupported MDX document prop expression \"{${expression}}\" in ${filePath}. Only identifiers and dotted property paths are supported.`,\n );\n }\n const marker = `${DOCUMENT_PROP_MARKER_PREFIX}${expressions.length}${DOCUMENT_PROP_MARKER_SUFFIX}`;\n expressions.push({ marker, expression, path });\n output += marker;\n cursor = end + 1;\n continue;\n }\n }\n\n output += char;\n cursor += 1;\n }\n\n return { content: output, expressions };\n}\n\nfunction collectInlineCodeRanges(content: string): Range[] {\n const ranges: Range[] = [];\n const fenceRanges = collectFenceRanges(content);\n let lineStart = 0;\n\n while (lineStart < content.length) {\n const lineEnd = content.indexOf(\"\\n\", lineStart);\n const end = lineEnd === -1 ? content.length : lineEnd;\n if (!isInRanges(lineStart, end, fenceRanges)) {\n let cursor = lineStart;\n while (cursor < end) {\n const marker = matchBacktickRun(content, cursor);\n if (!marker) {\n cursor += 1;\n continue;\n }\n const close = content.indexOf(marker, cursor + marker.length);\n if (close === -1 || close >= end) {\n cursor += marker.length;\n continue;\n }\n ranges.push({ start: cursor, end: close + marker.length });\n cursor = close + marker.length;\n }\n }\n lineStart = lineEnd === -1 ? content.length : lineEnd + 1;\n }\n\n return ranges;\n}\n\nfunction collectMdxEsmLineRanges(content: string): Range[] {\n const ranges: Range[] = [];\n const fenceRanges = collectFenceRanges(content);\n let lineStart = 0;\n\n while (lineStart < content.length) {\n const lineEnd = content.indexOf(\"\\n\", lineStart);\n const end = lineEnd === -1 ? content.length : lineEnd + 1;\n const contentEnd = lineEnd === -1 ? content.length : lineEnd;\n if (!isInRanges(lineStart, contentEnd, fenceRanges)) {\n const line = content.slice(lineStart, contentEnd).trimStart();\n if (line.startsWith(\"import \") || line.startsWith(\"export \")) {\n ranges.push({ start: lineStart, end });\n }\n }\n lineStart = lineEnd === -1 ? content.length : lineEnd + 1;\n }\n\n return ranges;\n}\n\nfunction mergeRanges(ranges: Range[]): Range[] {\n const sorted = ranges\n .filter((range) => range.end > range.start)\n .sort((left, right) => left.start - right.start || left.end - right.end);\n const merged: Range[] = [];\n\n for (const range of sorted) {\n const previous = merged.at(-1);\n if (previous && range.start <= previous.end) {\n previous.end = Math.max(previous.end, range.end);\n } else {\n merged.push({ ...range });\n }\n }\n\n return merged;\n}\n\nfunction matchBacktickRun(content: string, index: number): string | null {\n if (content[index] !== \"`\") return null;\n let end = index + 1;\n while (content[end] === \"`\") {\n end += 1;\n }\n return content.slice(index, end);\n}\n\nfunction startsHtmlLikeTag(content: string, index: number): boolean {\n const next = content[index + 1];\n return next === \"/\" || next === \"!\" || next === \"?\" || /[A-Za-z]/.test(next ?? \"\");\n}\n\nfunction findMdxExpressionEnd(content: string, start: number): number {\n let depth = 1;\n let quote: string | null = null;\n let escaped = false;\n\n for (let index = start; index < content.length; index += 1) {\n const char = content[index]!;\n if (quote) {\n if (escaped) {\n escaped = false;\n } else if (char === \"\\\\\") {\n escaped = true;\n } else if (char === quote) {\n quote = null;\n }\n continue;\n }\n\n if (char === '\"' || char === \"'\" || char === \"`\") {\n quote = char;\n continue;\n }\n if (char === \"{\") {\n depth += 1;\n continue;\n }\n if (char === \"}\") {\n depth -= 1;\n if (depth === 0) return index;\n }\n }\n\n return -1;\n}\n\nfunction parseDocumentPropPath(expression: string): string[] | null {\n if (\n !/^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)*$/.test(expression) ||\n RESERVED_DOCUMENT_PROP_WORDS.has(expression)\n ) {\n return null;\n }\n return expression.split(\".\");\n}\n\nconst RESERVED_DOCUMENT_PROP_WORDS = new Set([\n \"false\",\n \"Infinity\",\n \"NaN\",\n \"null\",\n \"this\",\n \"true\",\n \"undefined\",\n]);\n\nfunction generateMdxDocumentPropsSvelteModule(\n html: string,\n usedComponents: string[],\n frontmatter: Record<string, unknown>,\n options: ResolvedSvelteOptions & { root?: string },\n id: string,\n localBindings: ReadonlyMap<string, ResolvedDocumentComponentImport>,\n documentExpressions: readonly MdxDocumentExpression[],\n): string {\n const filePathLiteral = JSON.stringify(id);\n const imports = renderIslandComponentImports(usedComponents, {\n globalComponents: options.components,\n localBindings,\n documentPath: id,\n root: options.root,\n });\n const template = renderMdxDocumentTemplate(html, usedComponents, id, documentExpressions);\n\n return `\n<script>\n ${imports}\n\n const frontmatter = ${JSON.stringify(frontmatter)};\n export { frontmatter };\n\n let __ox_mdx_props = $props();\n\n function __ox_mdx_document_prop(props, path, expression) {\n const propName = path.join(\".\");\n let value = props;\n for (const segment of path) {\n if (\n value == null ||\n (typeof value !== \"object\" && typeof value !== \"function\") ||\n !(segment in Object(value))\n ) {\n throw new Error('[ox-content-svelte] Missing MDX document prop \"' + propName + '\" in ' + ${filePathLiteral} + ' for expression {' + expression + '}.');\n }\n value = value[segment];\n }\n if (value === undefined) {\n throw new Error('[ox-content-svelte] Missing MDX document prop \"' + propName + '\" in ' + ${filePathLiteral} + ' for expression {' + expression + '}.');\n }\n return value;\n }\n</script>\n\n<div class=\"ox-content\">${template}</div>\n\n<style>\n .ox-content {\n line-height: 1.6;\n }\n</style>\n`;\n}\n\nfunction renderMdxDocumentTemplate(\n html: string,\n usedComponents: string[],\n filePath: string,\n documentExpressions: readonly MdxDocumentExpression[],\n): string {\n const context: MdxTemplateContext = {\n html,\n filePath,\n usedComponents: new Set(usedComponents),\n expressionsByMarker: new Map(\n documentExpressions.map((expression) => [expression.marker, expression] as const),\n ),\n islandRanges: findMdxIslandRanges(html),\n };\n return renderHtmlRange(context, 0, html.length);\n}\n\nfunction renderHtmlRange(context: MdxTemplateContext, start: number, end: number): string {\n let output = \"\";\n let cursor = start;\n\n while (cursor < end) {\n const island = findNextIslandRange(context, cursor, end);\n if (!island) {\n output += renderRawHtmlTemplate(context.html.slice(cursor, end), context.expressionsByMarker);\n break;\n }\n\n output += renderRawHtmlTemplate(\n context.html.slice(cursor, island.openStart),\n context.expressionsByMarker,\n );\n output += renderMdxIslandTemplate(context, island);\n cursor = island.closeEnd;\n }\n\n return output;\n}\n\nfunction findNextIslandRange(\n context: MdxTemplateContext,\n cursor: number,\n end: number,\n): MdxIslandRange | null {\n for (const island of context.islandRanges) {\n if (island.openStart < cursor || island.closeEnd > end) {\n continue;\n }\n if (context.usedComponents.has(island.name)) {\n return island;\n }\n }\n return null;\n}\n\nfunction renderRawHtmlTemplate(\n html: string,\n expressionsByMarker: ReadonlyMap<string, MdxDocumentExpression>,\n): string {\n if (!html) return \"\";\n let output = \"\";\n let cursor = 0;\n\n while (cursor < html.length) {\n const next = findNextDocumentExpressionMarker(html, cursor, expressionsByMarker);\n if (!next) {\n output += renderRawHtmlBlock(html.slice(cursor));\n break;\n }\n output += renderRawHtmlBlock(html.slice(cursor, next.index));\n output += renderDocumentExpression(next.expression);\n cursor = next.index + next.expression.marker.length;\n }\n\n return output;\n}\n\nfunction findNextDocumentExpressionMarker(\n html: string,\n start: number,\n expressionsByMarker: ReadonlyMap<string, MdxDocumentExpression>,\n): { index: number; expression: MdxDocumentExpression } | null {\n let nextIndex = -1;\n let nextExpression: MdxDocumentExpression | undefined;\n\n for (const expression of expressionsByMarker.values()) {\n const index = html.indexOf(expression.marker, start);\n if (index !== -1 && (nextIndex === -1 || index < nextIndex)) {\n nextIndex = index;\n nextExpression = expression;\n }\n }\n\n return nextExpression ? { index: nextIndex, expression: nextExpression } : null;\n}\n\nfunction renderRawHtmlBlock(html: string): string {\n return html ? `{@html ${JSON.stringify(html).replaceAll(\"</script\", \"<\\\\/script\")}}` : \"\";\n}\n\nfunction renderDocumentExpression(expression: MdxDocumentExpression): string {\n return `{${documentPropResolverExpression(expression.path, expression.expression)}}`;\n}\n\nfunction renderMdxIslandTemplate(context: MdxTemplateContext, island: MdxIslandRange): string {\n assertSvelteComponentName(island.name, context.filePath);\n const attrs = renderMdxIslandAttributes(readMdxIslandPayload(island), context.filePath);\n const children = renderHtmlRange(context, island.contentStart, island.closeStart);\n return children\n ? `<${island.name}${attrs}>${children}</${island.name}>`\n : `<${island.name}${attrs} />`;\n}\n\nfunction renderMdxIslandAttributes(payload: MdxIslandPayload, filePath: string): string {\n const attrs: string[] = [];\n\n for (const spread of payload.spreads) {\n const expression = spread.trim().startsWith(\"...\")\n ? spread.trim().slice(3).trim()\n : spread.trim();\n const path = parseDocumentPropPath(expression);\n if (!path) {\n throw new Error(\n `[ox-content-svelte] Unsupported MDX document prop spread \"{${spread}}\" in ${filePath}. Only identifiers and dotted property paths are supported.`,\n );\n }\n attrs.push(`{...${documentPropResolverExpression(path, expression)}}`);\n }\n\n for (const [name, value] of Object.entries(payload.props)) {\n assertSvelteAttributeName(name, filePath);\n attrs.push(`${name}={${renderSvelteLiteral(value)}}`);\n }\n\n for (const [name, expression] of Object.entries(payload.expressions)) {\n assertSvelteAttributeName(name, filePath);\n const path = parseDocumentPropPath(expression.trim());\n if (!path) {\n throw new Error(\n `[ox-content-svelte] Unsupported MDX document prop expression \"{${expression}}\" for prop \"${name}\" in ${filePath}. Only identifiers and dotted property paths are supported.`,\n );\n }\n attrs.push(`${name}={${documentPropResolverExpression(path, expression.trim())}}`);\n }\n\n return attrs.length > 0 ? ` ${attrs.join(\" \")}` : \"\";\n}\n\nfunction documentPropResolverExpression(path: readonly string[], expression: string): string {\n return `__ox_mdx_document_prop(__ox_mdx_props, ${JSON.stringify(path)}, ${JSON.stringify(expression)})`;\n}\n\nfunction renderSvelteLiteral(value: unknown): string {\n const literal = JSON.stringify(value);\n return literal === undefined ? \"undefined\" : literal.replaceAll(\"</script\", \"<\\\\/script\");\n}\n\nfunction findMdxIslandRanges(html: string): MdxIslandRange[] {\n const ranges: MdxIslandRange[] = [];\n const openRe = /<(div|span)\\b([^>]*\\bdata-ox-island=\"([^\"]+)\"[^>]*)>/gi;\n let match: RegExpExecArray | null;\n\n while ((match = openRe.exec(html)) !== null) {\n const tag = match[1]!;\n const name = decodeHtmlAttr(match[3] ?? \"\");\n if (!name) continue;\n const openStart = match.index;\n const openEnd = match.index + match[0].length;\n const closeStart = findMatchingClose(html, openEnd, tag);\n const closeEnd = closeStart < html.length ? closeStart + tag.length + 3 : html.length;\n const inner = html.slice(openEnd, closeStart);\n const scriptMatch = inner.match(PAYLOAD_SCRIPT);\n const script = scriptMatch?.[0];\n ranges.push({\n name,\n tag,\n openStart,\n openEnd,\n innerStart: openEnd,\n contentStart: openEnd + (script?.length ?? 0),\n closeStart,\n closeEnd,\n propsAttr: matchAttr(match[2] ?? \"\", \"data-ox-props\"),\n script,\n });\n }\n\n return ranges.sort((left, right) => left.openStart - right.openStart);\n}\n\nfunction findMatchingClose(html: string, from: number, tag: string): number {\n const openNeedle = `<${tag}`;\n const closeNeedle = `</${tag}>`;\n let depth = 1;\n let cursor = from;\n\n while (cursor < html.length) {\n const nextOpen = indexOfTagOpen(html, openNeedle, cursor);\n const nextClose = html.indexOf(closeNeedle, cursor);\n if (nextClose === -1) return html.length;\n if (nextOpen !== -1 && nextOpen < nextClose) {\n depth += 1;\n cursor = nextOpen + openNeedle.length;\n } else {\n depth -= 1;\n if (depth === 0) return nextClose;\n cursor = nextClose + closeNeedle.length;\n }\n }\n\n return html.length;\n}\n\nfunction indexOfTagOpen(html: string, openNeedle: string, from: number): number {\n let cursor = from;\n while (cursor < html.length) {\n const index = html.indexOf(openNeedle, cursor);\n if (index === -1) return -1;\n const next = html[index + openNeedle.length];\n if (next === \" \" || next === \">\" || next === \"\\t\" || next === \"\\n\" || next === \"/\") {\n return index;\n }\n cursor = index + openNeedle.length;\n }\n return -1;\n}\n\nfunction matchAttr(attrs: string, name: string): string | undefined {\n const match = new RegExp(`\\\\b${name}=\"([^\"]*)\"`, \"i\").exec(attrs);\n return match?.[1] === undefined ? undefined : decodeHtmlAttr(match[1]);\n}\n\nfunction readMdxIslandPayload(island: MdxIslandRange): MdxIslandPayload {\n const fromAttr = island.propsAttr ? tryParseJson(island.propsAttr) : undefined;\n const fromScript = island.script\n ? tryParseJson(\n island.script.match(/<script type=\"application\\/json\">([\\s\\S]*?)<\\/script>/i)?.[1] ?? \"\",\n )\n : undefined;\n return normalizeMdxIslandPayload(fromAttr ?? fromScript ?? {});\n}\n\nfunction normalizeMdxIslandPayload(parsed: unknown): MdxIslandPayload {\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n return { props: {}, expressions: {}, spreads: [] };\n }\n\n const record = parsed as Record<string, unknown>;\n const keys = Object.keys(record);\n if (keys.length > 0 && keys.every((key) => RUST_PAYLOAD_KEYS.has(key))) {\n return {\n props: toRecord(record.props),\n expressions: toStringRecord(record.expressions),\n spreads: toStringArray(record.spreads),\n };\n }\n\n return { props: record, expressions: {}, spreads: [] };\n}\n\nfunction toRecord(value: unknown): Record<string, unknown> {\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : {};\n}\n\nfunction toStringRecord(value: unknown): Record<string, string> {\n const record = toRecord(value);\n const output: Record<string, string> = {};\n for (const [key, entry] of Object.entries(record)) {\n if (typeof entry === \"string\") {\n output[key] = entry;\n }\n }\n return output;\n}\n\nfunction toStringArray(value: unknown): string[] {\n return Array.isArray(value)\n ? value.filter((entry): entry is string => typeof entry === \"string\")\n : [];\n}\n\nfunction tryParseJson(value: string): unknown {\n try {\n return JSON.parse(value);\n } catch {\n return undefined;\n }\n}\n\nfunction decodeHtmlAttr(value: string): string {\n return value\n .replaceAll(\"&quot;\", '\"')\n .replaceAll(\"&#39;\", \"'\")\n .replaceAll(\"&lt;\", \"<\")\n .replaceAll(\"&gt;\", \">\")\n .replaceAll(\"&amp;\", \"&\");\n}\n\nfunction assertSvelteComponentName(name: string, filePath: string): void {\n if (!/^[A-Z][A-Za-z0-9_$]*$/.test(name)) {\n throw new Error(\n `[ox-content-svelte] Unsupported MDX component name \"${name}\" in ${filePath} for mdxDocumentProps. Only simple Svelte component identifiers are supported.`,\n );\n }\n}\n\nfunction assertSvelteAttributeName(name: string, filePath: string): void {\n if (!/^[A-Za-z_$][\\w$-]*$/.test(name)) {\n throw new Error(\n `[ox-content-svelte] Unsupported MDX component prop name \"${name}\" in ${filePath}.`,\n );\n }\n}\n\nfunction generateSvelteModule(\n content: string,\n usedComponents: string[],\n _islands: ComponentIsland[] | string[],\n frontmatter: Record<string, unknown>,\n options: ResolvedSvelteOptions & { root?: string },\n id: string,\n localBindings?: ReadonlyMap<string, ResolvedDocumentComponentImport>,\n): string {\n // Rust island payloads include `</script>`; that must not close this SFC block.\n const rawHtmlLiteral = JSON.stringify(content).replaceAll(\"</script\", \"<\\\\/script\");\n\n const imports = renderIslandComponentImports(usedComponents, {\n globalComponents: options.components,\n localBindings,\n documentPath: id,\n root: options.root,\n });\n\n // If no registered islands, generate simpler code without island runtime\n if (usedComponents.length === 0) {\n return `\n<script>\n const frontmatter = ${JSON.stringify(frontmatter)};\n const rawHtml = ${rawHtmlLiteral};\n\n export { frontmatter };\n</script>\n\n<div class=\"ox-content\">\n {@html rawHtml}\n</div>\n\n<style>\n .ox-content {\n line-height: 1.6;\n }\n</style>\n`;\n }\n\n const componentMap = usedComponents.map((name) => ` ${name},`).join(\"\\n\");\n\n return `\n<script>\n import { createRawSnippet, hydrate, mount, onMount, unmount } from 'svelte';\n import { initIslands, readIslandSlotHtml } from '@ox-content/islands';\n ${imports}\n\n const frontmatter = ${JSON.stringify(frontmatter)};\n const rawHtml = ${rawHtmlLiteral};\n const components = {\n${componentMap}\n };\n\n export { frontmatter };\n\n let container;\n\n function createSvelteHydrate() {\n const mounted = [];\n\n return (element, props) => {\n const componentName = element.dataset.oxIsland;\n const Component = components[componentName];\n if (!Component) return;\n\n const islandContent = readIslandSlotHtml(element);\n const componentProps = { ...props };\n if (islandContent) {\n componentProps.children = createRawSnippet(() => ({\n render: () => \\`<div>\\${islandContent}</div>\\`,\n }));\n }\n\n const attach = element.dataset.oxSsr === 'true' ? hydrate : mount;\n const instance = attach(Component, { target: element, props: componentProps });\n mounted.push(instance);\n\n return () => unmount(instance);\n };\n }\n\n onMount(() => {\n if (!container) return;\n const controller = initIslands(createSvelteHydrate(), {\n selector: '.ox-content [data-ox-island]',\n });\n return () => controller.destroy();\n });\n</script>\n\n<div class=\"ox-content\" bind:this={container}>\n {@html rawHtml}\n</div>\n\n<style>\n .ox-content {\n line-height: 1.6;\n }\n</style>\n`;\n}\n","import type { EnvironmentOptions } from \"vite\";\n\nexport function createSvelteMarkdownEnvironment(\n mode: \"ssr\" | \"client\",\n options: { outDir: string },\n): EnvironmentOptions {\n const isSSR = mode === \"ssr\";\n\n return {\n build: {\n outDir: isSSR ? `${options.outDir}/.ox-content/ssr` : `${options.outDir}/.ox-content/client`,\n ssr: isSSR,\n rollupOptions: {\n output: {\n format: \"esm\",\n entryFileNames: isSSR ? \"[name].js\" : \"[name].[hash].js\",\n },\n },\n ...(isSSR && { target: \"node18\", minify: false }),\n },\n resolve: {\n conditions: isSSR ? [\"node\", \"import\"] : [\"browser\", \"import\"],\n },\n optimizeDeps: {\n include: isSSR ? [] : [\"svelte\"],\n exclude: [\"@ox-content/vite-plugin\", \"@ox-content/vite-plugin-svelte\"],\n },\n };\n}\n","/**\n * Vite Plugin for Ox Content Svelte Integration\n *\n * Uses Vite's Environment API to enable embedding Svelte components in Markdown.\n */\n\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport type { Plugin, PluginOption, ResolvedConfig } from \"vite\";\nimport { oxContent } from \"@ox-content/vite-plugin\";\nimport { transformMarkdownWithSvelte } from \"./transform\";\nimport { createSvelteMarkdownEnvironment } from \"./environment\";\nimport type {\n SvelteIntegrationOptions,\n ResolvedSvelteOptions,\n ComponentsMap,\n ComponentsOption,\n BuiltinEmbedOptions,\n} from \"./types\";\n\nconst DEFAULT_MARKDOWN_EXTENSIONS = [\".md\", \".markdown\", \".mdx\"] as const;\n\nfunction normalizeMarkdownExtensions(extensions?: readonly string[]): string[] {\n const values = extensions?.length ? extensions : DEFAULT_MARKDOWN_EXTENSIONS;\n return Array.from(\n new Map(\n values.map((extension) => {\n const value = extension.startsWith(\".\") ? extension : `.${extension}`;\n return [value.toLowerCase(), value] as const;\n }),\n ).values(),\n );\n}\n\nfunction isMarkdownFilePath(filePath: string, extensions: readonly string[]): boolean {\n const pathname = filePath.split(\"?\")[0].split(\"#\")[0].toLowerCase();\n return extensions.some((extension) => pathname.endsWith(extension.toLowerCase()));\n}\n\nfunction resolveBuiltinEmbedOptions(\n options: BuiltinEmbedOptions | false | undefined,\n): ResolvedSvelteOptions[\"embeds\"] {\n if (options === false) return { github: false, openGraph: false };\n return {\n github: resolveSingleEmbedOptions(options?.github),\n openGraph: resolveSingleEmbedOptions(options?.openGraph),\n };\n}\n\nfunction resolveSingleEmbedOptions<T extends object>(options: boolean | T | undefined): T | false {\n if (options === false) return false;\n if (options === true || options === undefined) return {} as T;\n return options;\n}\n\nexport type {\n SvelteIntegrationOptions,\n ResolvedSvelteOptions,\n ComponentsOption,\n ComponentsMap,\n BuiltinEmbedOptions,\n MdxDocumentPropsOption,\n GitHubEmbedOptions,\n OpenGraphEmbedOptions,\n ResolvedBuiltinEmbedOptions,\n SvelteTransformResult,\n ComponentIsland,\n} from \"./types\";\n\n/**\n * Creates the Ox Content Svelte integration plugin.\n *\n * Forwards core options such as `ssg`, `redirects`, `feeds`, and `siteMaps`.\n * The Svelte Markdown transform and environments replace the generic core\n * transform/`markdown` environment; other build plugins are kept.\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { defineConfig } from 'vite';\n * import { svelte } from '@sveltejs/vite-plugin-svelte';\n * import { oxContentSvelte } from 'vite-plugin-ox-content-svelte';\n *\n * export default defineConfig({\n * plugins: [\n * svelte(),\n * oxContentSvelte({\n * srcDir: 'docs',\n * components: {\n * Counter: './src/components/Counter.svelte',\n * },\n * }),\n * ],\n * });\n * ```\n */\nexport function oxContentSvelte(options: SvelteIntegrationOptions = {}): PluginOption[] {\n const resolved = resolveSvelteOptions(options);\n let componentMap = new Map<string, string>();\n let config: ResolvedConfig;\n\n if (typeof options.components === \"object\" && !Array.isArray(options.components)) {\n componentMap = new Map(Object.entries(options.components));\n }\n\n const svelteTransformPlugin: Plugin = {\n name: \"ox-content:svelte-transform\",\n enforce: \"pre\",\n\n async configResolved(resolvedConfig) {\n config = resolvedConfig;\n\n const componentsOption = options.components;\n if (componentsOption) {\n const resolvedComponents = await resolveComponentsGlob(componentsOption, config.root);\n componentMap = new Map(Object.entries(resolvedComponents));\n }\n },\n\n async transform(code, id, transformOptions) {\n if (!isMarkdownFilePath(id, resolved.extensions)) {\n return null;\n }\n\n const result = await transformMarkdownWithSvelte(code, id, {\n ...resolved,\n components: Object.fromEntries(componentMap),\n root: config.root,\n renderIsland: options.renderIsland,\n ssr: transformOptions?.ssr,\n });\n\n return {\n code: result.code,\n map: result.map,\n };\n },\n };\n\n const svelteEnvironmentPlugin: Plugin = {\n name: \"ox-content:svelte-environment\",\n\n config() {\n return {\n environments: {\n oxcontent_ssr: createSvelteMarkdownEnvironment(\"ssr\", resolved),\n oxcontent_client: createSvelteMarkdownEnvironment(\"client\", resolved),\n },\n };\n },\n\n resolveId(id) {\n if (id === \"virtual:ox-content-svelte/runtime\") {\n return \"\\0virtual:ox-content-svelte/runtime\";\n }\n if (id === \"virtual:ox-content-svelte/components\") {\n return \"\\0virtual:ox-content-svelte/components\";\n }\n return null;\n },\n\n load(id) {\n if (id === \"\\0virtual:ox-content-svelte/runtime\") {\n return generateRuntimeModule();\n }\n if (id === \"\\0virtual:ox-content-svelte/components\") {\n return generateComponentsModule(componentMap);\n }\n return null;\n },\n\n applyToEnvironment(environment) {\n return [\"oxcontent_ssr\", \"oxcontent_client\", \"client\", \"ssr\"].includes(environment.name);\n },\n };\n\n const svelteHmrPlugin: Plugin = {\n name: \"ox-content:svelte-hmr\",\n apply: \"serve\",\n\n handleHotUpdate({ file, server, modules }) {\n const isComponent = Array.from(componentMap.values()).some((path) =>\n file.endsWith(path.replace(/^\\.\\//, \"\")),\n );\n\n if (isComponent) {\n const mdModules = Array.from(server.moduleGraph.idToModuleMap.values()).filter(\n (mod) => mod.file && isMarkdownFilePath(mod.file, resolved.extensions),\n );\n\n if (mdModules.length > 0) {\n server.ws.send({\n type: \"custom\",\n event: \"ox-content:svelte-update\",\n data: { file },\n });\n return [...modules, ...mdModules];\n }\n }\n\n return modules;\n },\n };\n\n const replacedCorePluginNames = new Set([\"ox-content\", \"ox-content:environment\"]);\n const corePlugins = (\n oxContent(options).flatMap((plugin) => (Array.isArray(plugin) ? plugin : [plugin])) as Plugin[]\n ).filter((plugin) => !replacedCorePluginNames.has(plugin.name));\n\n return [svelteTransformPlugin, svelteEnvironmentPlugin, svelteHmrPlugin, ...corePlugins];\n}\n\nfunction resolveSvelteOptions(\n options: SvelteIntegrationOptions,\n): Omit<ResolvedSvelteOptions, \"components\"> {\n return {\n srcDir: options.srcDir ?? \"docs\",\n outDir: options.outDir ?? \"dist\",\n base: options.base ?? \"/\",\n extensions: normalizeMarkdownExtensions(options.extensions),\n gfm: options.gfm ?? true,\n autolinks: options.autolinks ?? options.gfm ?? true,\n frontmatter: options.frontmatter ?? true,\n toc: options.toc ?? true,\n tocMaxDepth: options.tocMaxDepth ?? 3,\n codeAnnotations: resolveCodeAnnotationsOptions(options.codeAnnotations),\n runes: options.runes ?? true,\n embeds: resolveBuiltinEmbedOptions(options.embeds),\n mdx: options.mdx,\n mdxDocumentProps: options.mdxDocumentProps ?? false,\n };\n}\n\nfunction resolveCodeAnnotationsOptions(\n options: SvelteIntegrationOptions[\"codeAnnotations\"],\n): ResolvedSvelteOptions[\"codeAnnotations\"] {\n if (!options) {\n return {\n enabled: false,\n metaKey: \"annotate\",\n };\n }\n\n if (options === true) {\n return {\n enabled: true,\n metaKey: \"annotate\",\n };\n }\n\n return {\n enabled: true,\n metaKey: options.metaKey ?? \"annotate\",\n };\n}\n\nfunction generateRuntimeModule(): string {\n return `\n// Svelte 5 runtime for ox-content\nexport { mount, unmount } from 'svelte';\n`;\n}\n\nfunction generateComponentsModule(componentMap: Map<string, string>): string {\n const imports: string[] = [];\n const exports: string[] = [];\n\n componentMap.forEach((path, name) => {\n imports.push(`import ${name} from '${path}';`);\n exports.push(` ${name},`);\n });\n\n return `\n${imports.join(\"\\n\")}\n\nexport const components = {\n${exports.join(\"\\n\")}\n};\n\nexport default components;\n`;\n}\n\nasync function resolveComponentsGlob(\n componentsOption: ComponentsOption,\n root: string,\n): Promise<ComponentsMap> {\n if (typeof componentsOption === \"object\" && !Array.isArray(componentsOption)) {\n return componentsOption;\n }\n\n const patterns = Array.isArray(componentsOption) ? componentsOption : [componentsOption];\n\n const result: ComponentsMap = {};\n\n for (const pattern of patterns) {\n const files = await globFiles(pattern, root);\n\n for (const file of files) {\n const baseName = path.basename(file, path.extname(file));\n const componentName = toPascalCase(baseName);\n const relativePath = \"./\" + path.relative(root, file).replace(/\\\\/g, \"/\");\n\n result[componentName] = relativePath;\n }\n }\n\n return result;\n}\n\nasync function globFiles(pattern: string, root: string): Promise<string[]> {\n const files: string[] = [];\n const isGlob = pattern.includes(\"*\");\n\n if (!isGlob) {\n const fullPath = path.resolve(root, pattern);\n if (fs.existsSync(fullPath)) {\n files.push(fullPath);\n }\n return files;\n }\n\n const parts = pattern.split(\"*\");\n const baseDir = path.resolve(root, parts[0]);\n const ext = parts[1] || \"\";\n\n if (!fs.existsSync(baseDir)) {\n return files;\n }\n\n if (pattern.includes(\"**\")) {\n await walkDir(baseDir, files, ext);\n } else {\n const entries = await fs.promises.readdir(baseDir, { withFileTypes: true });\n for (const entry of entries) {\n if (entry.isFile() && entry.name.endsWith(ext)) {\n files.push(path.join(baseDir, entry.name));\n }\n }\n }\n\n return files;\n}\n\nasync function walkDir(dir: string, files: string[], ext: string): Promise<void> {\n const entries = await fs.promises.readdir(dir, { withFileTypes: true });\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n\n if (entry.isDirectory()) {\n await walkDir(fullPath, files, ext);\n } else if (entry.isFile() && entry.name.endsWith(ext)) {\n files.push(fullPath);\n }\n }\n}\n\nfunction toPascalCase(str: string): string {\n return str.replace(/[-_](\\w)/g, (_, c) => c.toUpperCase()).replace(/^\\w/, (c) => c.toUpperCase());\n}\n\nexport { oxContent, renderHead } from \"@ox-content/vite-plugin\";\nexport type { HeadInput, RenderedHead } from \"@ox-content/vite-plugin\";\n"],"mappings":";;;;;AAiBA,MAAM,kBAAkB;AACxB,MAAM,aAAa;AAEnB,MAAM,uBAAuB;AAC7B,MAAM,uBAAuB;AAC7B,MAAM,8BAA8B;AACpC,MAAM,8BAA8B;AACpC,MAAM,iBAAiB;AACvB,MAAM,oCAAoB,IAAI,IAAI;CAAC;CAAS;CAAe;AAAS,CAAC;AAOrE,eAAsB,4BACpB,MACA,IACA,SACgC;CAChC,MAAM,aAA4B,QAAQ;CAC1C,MAAM,EAAE,SAAS,iBAAiB,gBAAgB,mBAAmB,IAAI;CACzE,MAAM,MAAM,sBAAsB,IAAI,QAAQ,GAAG;CAEjD,MAAM,cAAc;EAClB,QAAQ,QAAQ;EAChB,QAAQ,QAAQ;EAChB,MAAM,QAAQ;EACd,YAAY,QAAQ;EACpB;EACA,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AW,QAAQ,GACxB,MAAM,KAAK,QAAQ;EAErB,OAAO;CACT;CAEA,MAAM,QAAQ,QAAQ,MAAM,GAAG;CAC/B,MAAM,UAAU,KAAK,QAAQ,MAAM,MAAM,EAAE;CAC3C,MAAM,MAAM,MAAM,MAAM;CAExB,IAAI,CAAC,GAAG,WAAW,OAAO,GACxB,OAAO;CAGT,IAAI,QAAQ,SAAS,IAAI,GACvB,MAAM,QAAQ,SAAS,OAAO,GAAG;MAC5B;EACL,MAAM,UAAU,MAAM,GAAG,SAAS,QAAQ,SAAS,EAAE,eAAe,KAAK,CAAC;EAC1E,KAAK,MAAM,SAAS,SAClB,IAAI,MAAM,OAAO,KAAK,MAAM,KAAK,SAAS,GAAG,GAC3C,MAAM,KAAK,KAAK,KAAK,SAAS,MAAM,IAAI,CAAC;CAG/C;CAEA,OAAO;AACT;AAEA,eAAe,QAAQ,KAAa,OAAiB,KAA4B;CAC/E,MAAM,UAAU,MAAM,GAAG,SAAS,QAAQ,KAAK,EAAE,eAAe,KAAK,CAAC;CAEtE,KAAK,MAAM,SAAS,SAAS;EAC3B,MAAM,WAAW,KAAK,KAAK,KAAK,MAAM,IAAI;EAE1C,IAAI,MAAM,YAAY,GACpB,MAAM,QAAQ,UAAU,OAAO,GAAG;OAC7B,IAAI,MAAM,OAAO,KAAK,MAAM,KAAK,SAAS,GAAG,GAClD,MAAM,KAAK,QAAQ;CAEvB;AACF;AAEA,SAAS,aAAa,KAAqB;CACzC,OAAO,IAAI,QAAQ,cAAc,GAAG,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,QAAQ,MAAM,EAAE,YAAY,CAAC;AAClG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ox-content/vite-plugin-svelte",
3
- "version": "3.0.0-alpha.10",
3
+ "version": "3.0.0-alpha.12",
4
4
  "description": "Svelte integration for Ox Content - Embed Svelte components in Markdown",
5
5
  "keywords": [
6
6
  "markdown",
@@ -34,13 +34,14 @@
34
34
  "provenance": true
35
35
  },
36
36
  "dependencies": {
37
- "@ox-content/islands": "3.0.0-alpha.10",
38
- "@ox-content/vite-plugin": "3.0.0-alpha.10"
37
+ "@ox-content/islands": "3.0.0-alpha.12",
38
+ "@ox-content/vite-plugin": "3.0.0-alpha.12"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@sveltejs/vite-plugin-svelte": "^7.2.0",
42
42
  "@types/node": "^26.2.0",
43
43
  "@typescript/native-preview": "^7.0.0-dev.20260707.2",
44
+ "playwright": "^1.62.1",
44
45
  "svelte": "^5.56.10",
45
46
  "typescript": "^7.0.2",
46
47
  "vite": "npm:@voidzero-dev/vite-plus-core@0.2.8",