@ox-content/vite-plugin 2.63.0 → 2.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/incremental-dom.cjs +179 -0
- package/dist/incremental-dom.cjs.map +1 -0
- package/dist/incremental-dom.d.cts +101 -0
- package/dist/incremental-dom.d.cts.map +1 -0
- package/dist/incremental-dom.d.mts +101 -0
- package/dist/incremental-dom.d.mts.map +1 -0
- package/dist/incremental-dom.mjs +170 -0
- package/dist/incremental-dom.mjs.map +1 -0
- package/dist/index.cjs +112 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +94 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +94 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +108 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -2
package/dist/index.mjs
CHANGED
|
@@ -881,7 +881,8 @@ function generateMarkdown(docs, options) {
|
|
|
881
881
|
groupOrder: options.groupOrder,
|
|
882
882
|
sort: options.sort,
|
|
883
883
|
sortEntryPoints: options.sortEntryPoints,
|
|
884
|
-
kindSortOrder: options.kindSortOrder
|
|
884
|
+
kindSortOrder: options.kindSortOrder,
|
|
885
|
+
singleEntryRoot: options.singleEntryRoot
|
|
885
886
|
});
|
|
886
887
|
}
|
|
887
888
|
/**
|
|
@@ -899,7 +900,8 @@ async function writeDocs(docs, outDir, extractedDocs, options) {
|
|
|
899
900
|
groupOrder: options?.groupOrder,
|
|
900
901
|
sort: options?.sort,
|
|
901
902
|
sortEntryPoints: options?.sortEntryPoints,
|
|
902
|
-
kindSortOrder: options?.kindSortOrder
|
|
903
|
+
kindSortOrder: options?.kindSortOrder,
|
|
904
|
+
singleEntryRoot: options?.singleEntryRoot
|
|
903
905
|
});
|
|
904
906
|
}
|
|
905
907
|
function toRustDocsModules(docs) {
|
|
@@ -975,6 +977,7 @@ function resolveDocsOptions(options) {
|
|
|
975
977
|
sort: opts.sort,
|
|
976
978
|
sortEntryPoints: opts.sortEntryPoints ?? true,
|
|
977
979
|
kindSortOrder: opts.kindSortOrder,
|
|
980
|
+
singleEntryRoot: opts.singleEntryRoot ?? "preserve",
|
|
978
981
|
generateNav: opts.generateNav ?? true
|
|
979
982
|
};
|
|
980
983
|
}
|
|
@@ -3055,6 +3058,108 @@ function generateI18nModule(options, root) {
|
|
|
3055
3058
|
throw new Error("[ox-content:i18n] @ox-content/napi does not expose generateI18nModule. Please rebuild the NAPI package.");
|
|
3056
3059
|
}
|
|
3057
3060
|
//#endregion
|
|
3061
|
+
//#region src/incremental.ts
|
|
3062
|
+
function toNativeParserOptions(options = {}) {
|
|
3063
|
+
return {
|
|
3064
|
+
gfm: options.gfm ?? true,
|
|
3065
|
+
footnotes: options.footnotes,
|
|
3066
|
+
taskLists: options.taskLists,
|
|
3067
|
+
tables: options.tables,
|
|
3068
|
+
strikethrough: options.strikethrough,
|
|
3069
|
+
autolinks: options.autolinks
|
|
3070
|
+
};
|
|
3071
|
+
}
|
|
3072
|
+
function parseAstJson(json) {
|
|
3073
|
+
return json ? JSON.parse(json) : null;
|
|
3074
|
+
}
|
|
3075
|
+
function normalizeParseResult(result) {
|
|
3076
|
+
const { ast, pendingAst, ...rest } = result;
|
|
3077
|
+
return {
|
|
3078
|
+
...rest,
|
|
3079
|
+
ast: parseAstJson(ast),
|
|
3080
|
+
astJson: ast,
|
|
3081
|
+
pendingAst: parseAstJson(pendingAst),
|
|
3082
|
+
pendingAstJson: pendingAst
|
|
3083
|
+
};
|
|
3084
|
+
}
|
|
3085
|
+
var IncrementalMarkdownParser = class {
|
|
3086
|
+
#native;
|
|
3087
|
+
#includePendingAst;
|
|
3088
|
+
#completeInline;
|
|
3089
|
+
constructor(options = {}) {
|
|
3090
|
+
const napi = importNapiModuleSync();
|
|
3091
|
+
this.#native = new napi.IncrementalMarkdownParser(toNativeParserOptions(options));
|
|
3092
|
+
this.#includePendingAst = options.includePendingAst ?? false;
|
|
3093
|
+
this.#completeInline = options.completeInline ?? true;
|
|
3094
|
+
}
|
|
3095
|
+
append(chunk, options = {}) {
|
|
3096
|
+
return normalizeParseResult(this.#native.append(chunk, {
|
|
3097
|
+
isFinal: options.final ?? false,
|
|
3098
|
+
includePendingAst: options.includePendingAst ?? this.#includePendingAst,
|
|
3099
|
+
completeInline: options.completeInline ?? this.#completeInline
|
|
3100
|
+
}));
|
|
3101
|
+
}
|
|
3102
|
+
finish(options = {}) {
|
|
3103
|
+
return normalizeParseResult(this.#native.finish({
|
|
3104
|
+
includePendingAst: options.includePendingAst ?? this.#includePendingAst,
|
|
3105
|
+
completeInline: options.completeInline ?? this.#completeInline
|
|
3106
|
+
}));
|
|
3107
|
+
}
|
|
3108
|
+
reset() {
|
|
3109
|
+
this.#native.reset();
|
|
3110
|
+
}
|
|
3111
|
+
get pendingMarkdown() {
|
|
3112
|
+
return this.#native.pendingMarkdown;
|
|
3113
|
+
}
|
|
3114
|
+
get committedBytes() {
|
|
3115
|
+
return this.#native.committedBytes;
|
|
3116
|
+
}
|
|
3117
|
+
get totalBytes() {
|
|
3118
|
+
return this.#native.totalBytes;
|
|
3119
|
+
}
|
|
3120
|
+
};
|
|
3121
|
+
var IncrementalMarkdownRenderer = class {
|
|
3122
|
+
#native;
|
|
3123
|
+
#renderPending;
|
|
3124
|
+
#completeInline;
|
|
3125
|
+
constructor(options = {}) {
|
|
3126
|
+
const napi = importNapiModuleSync();
|
|
3127
|
+
this.#native = new napi.IncrementalMarkdownRenderer(toNativeParserOptions(options));
|
|
3128
|
+
this.#renderPending = options.renderPending ?? true;
|
|
3129
|
+
this.#completeInline = options.completeInline ?? true;
|
|
3130
|
+
}
|
|
3131
|
+
append(chunk, options = {}) {
|
|
3132
|
+
return this.#native.append(chunk, {
|
|
3133
|
+
isFinal: options.final ?? false,
|
|
3134
|
+
renderPending: options.renderPending ?? this.#renderPending,
|
|
3135
|
+
completeInline: options.completeInline ?? this.#completeInline
|
|
3136
|
+
});
|
|
3137
|
+
}
|
|
3138
|
+
finish() {
|
|
3139
|
+
return this.#native.finish();
|
|
3140
|
+
}
|
|
3141
|
+
reset() {
|
|
3142
|
+
this.#native.reset();
|
|
3143
|
+
}
|
|
3144
|
+
get committedHtml() {
|
|
3145
|
+
return this.#native.committedHtml;
|
|
3146
|
+
}
|
|
3147
|
+
get pendingMarkdown() {
|
|
3148
|
+
return this.#native.pendingMarkdown;
|
|
3149
|
+
}
|
|
3150
|
+
};
|
|
3151
|
+
function createIncrementalMarkdownParser(options) {
|
|
3152
|
+
return new IncrementalMarkdownParser(options);
|
|
3153
|
+
}
|
|
3154
|
+
function createIncrementalMarkdownRenderer(options) {
|
|
3155
|
+
return new IncrementalMarkdownRenderer(options);
|
|
3156
|
+
}
|
|
3157
|
+
async function* renderMarkdownStream(chunks, options = {}) {
|
|
3158
|
+
const renderer = createIncrementalMarkdownRenderer(options);
|
|
3159
|
+
for await (const chunk of chunks) yield renderer.append(chunk);
|
|
3160
|
+
yield renderer.finish();
|
|
3161
|
+
}
|
|
3162
|
+
//#endregion
|
|
3058
3163
|
//#region src/docs-tests.ts
|
|
3059
3164
|
var DocsTestRunError = class extends Error {
|
|
3060
3165
|
result;
|
|
@@ -4802,6 +4907,6 @@ function normalizeRuntimeBase(base) {
|
|
|
4802
4907
|
return withLeading.endsWith("/") ? withLeading : `${withLeading}/`;
|
|
4803
4908
|
}
|
|
4804
4909
|
//#endregion
|
|
4805
|
-
export { DEFAULT_HTML_TEMPLATE, DEFAULT_MARKDOWN_EXTENSIONS, DefaultTheme, DocsTestRunError, Fragment, buildSearchIndex, buildSsg, clearRenderContext, collectDocsTests, collectGitHubRepos, collectGitHubSources, collectOgpUrls, convertVitePressNav, convertVitePressSidebar, createI18nPlugin, createMarkdownEnvironment, createTheme, defaultTheme, defineTheme, each, extractCodeBlocks, extractDocs, extractDocsTests, extractIslandInfo, extractVideoId, fetchGitHubSource, fetchOgpData, fetchRepoData, fromVitePressConfig, generateFrontmatterTypes, generateHydrationScript, generateMarkdown, generateOgImages, generateTabsCSS, generateTypes, generateVirtualModule, generateVitePressMigrationConfig, hasIslands, inferType, isMarkdownFilePath, jsx, jsxs, lintCodeBlocks, lintMarkdown, lintMarkdownAsync, lintMarkdownFile, lintMarkdownFiles, mergeThemes, mermaidClientScript, normalizeMarkdownExtensions, normalizeVitePressFrontmatter, oxContent, parseGitHubLineRange, parseGitHubPermalink, prefetchGitHubRepos, prefetchGitHubSources, prefetchOgpData, raw, renderAllPages, renderPage, renderToString, resolveBuiltinEmbedOptions, resolveDocsOptions, resolveI18nOptions, resolveOgImageOptions, resolveSearchOptions, resolveSsgOptions, resolveTheme, runDocsTests, setRenderContext, shouldLintMarkdownFile, stripMarkdownExtension, transformAllPlugins, transformGitHub, transformIslands, transformMarkdown, transformMermaidStatic, transformOgp, transformTabs, transformYouTube, typecheckCodeBlocks, useIsActive, useNav, usePageProps, useRenderContext, useSiteConfig, when, writeDocs, writeDocsTestFiles, writeSearchIndex };
|
|
4910
|
+
export { DEFAULT_HTML_TEMPLATE, DEFAULT_MARKDOWN_EXTENSIONS, DefaultTheme, DocsTestRunError, Fragment, IncrementalMarkdownParser, IncrementalMarkdownRenderer, buildSearchIndex, buildSsg, clearRenderContext, collectDocsTests, collectGitHubRepos, collectGitHubSources, collectOgpUrls, convertVitePressNav, convertVitePressSidebar, createI18nPlugin, createIncrementalMarkdownParser, createIncrementalMarkdownRenderer, createMarkdownEnvironment, createTheme, defaultTheme, defineTheme, each, extractCodeBlocks, extractDocs, extractDocsTests, extractIslandInfo, extractVideoId, fetchGitHubSource, fetchOgpData, fetchRepoData, fromVitePressConfig, generateFrontmatterTypes, generateHydrationScript, generateMarkdown, generateOgImages, generateTabsCSS, generateTypes, generateVirtualModule, generateVitePressMigrationConfig, hasIslands, inferType, isMarkdownFilePath, jsx, jsxs, lintCodeBlocks, lintMarkdown, lintMarkdownAsync, lintMarkdownFile, lintMarkdownFiles, mergeThemes, mermaidClientScript, normalizeMarkdownExtensions, normalizeVitePressFrontmatter, oxContent, parseGitHubLineRange, parseGitHubPermalink, prefetchGitHubRepos, prefetchGitHubSources, prefetchOgpData, raw, renderAllPages, renderMarkdownStream, renderPage, renderToString, resolveBuiltinEmbedOptions, resolveDocsOptions, resolveI18nOptions, resolveOgImageOptions, resolveSearchOptions, resolveSsgOptions, resolveTheme, runDocsTests, setRenderContext, shouldLintMarkdownFile, stripMarkdownExtension, transformAllPlugins, transformGitHub, transformIslands, transformMarkdown, transformMermaidStatic, transformOgp, transformTabs, transformYouTube, typecheckCodeBlocks, useIsActive, useNav, usePageProps, useRenderContext, useSiteConfig, when, writeDocs, writeDocsTestFiles, writeSearchIndex };
|
|
4806
4911
|
|
|
4807
4912
|
//# sourceMappingURL=index.mjs.map
|