@ox-content/napi 2.70.0 → 2.72.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/index.d.ts +26 -14
- package/index.js +2 -0
- package/package.json +6 -6
package/index.d.ts
CHANGED
|
@@ -85,6 +85,9 @@ export declare function collectSearchMarkdownFiles(srcDir: string, extensions: A
|
|
|
85
85
|
/** Collects Markdown files for SSG from a source directory. */
|
|
86
86
|
export declare function collectSsgMarkdownFiles(srcDir: string, extensions: Array<string>): Array<string>
|
|
87
87
|
|
|
88
|
+
/** Escapes Svelte expression delimiters before emitting static compiled markup. */
|
|
89
|
+
export declare function escapeSvelteMarkup(html: string): string
|
|
90
|
+
|
|
88
91
|
/** Extracts shared CSS and JavaScript assets from generated SSG pages. */
|
|
89
92
|
export declare function externalizeSsgAssets(pages: Array<JsSsgGeneratedHtmlPage>, outDir: string, base: string): JsSsgExternalizedAssets
|
|
90
93
|
|
|
@@ -737,6 +740,13 @@ export interface JsFeatureConfig {
|
|
|
737
740
|
linkText?: string
|
|
738
741
|
}
|
|
739
742
|
|
|
743
|
+
export interface JsFrameworkComponentIsland {
|
|
744
|
+
name: string
|
|
745
|
+
props: Record<string, any>
|
|
746
|
+
id: string
|
|
747
|
+
content?: string
|
|
748
|
+
}
|
|
749
|
+
|
|
740
750
|
/** Export graph resolution options. */
|
|
741
751
|
export interface JsGraphOptions {
|
|
742
752
|
root?: string
|
|
@@ -998,7 +1008,7 @@ export interface JsParserOptions {
|
|
|
998
1008
|
autolinks?: boolean
|
|
999
1009
|
}
|
|
1000
1010
|
|
|
1001
|
-
/** Options for [`transform_pm_embeds`]. */
|
|
1011
|
+
/** Options for [`super::transform_pm_embeds`]. */
|
|
1002
1012
|
export interface JsPmOptions {
|
|
1003
1013
|
/**
|
|
1004
1014
|
* Enable opt-in synced package-manager tab groups. When `true`, a
|
|
@@ -1010,7 +1020,7 @@ export interface JsPmOptions {
|
|
|
1010
1020
|
sync?: boolean
|
|
1011
1021
|
}
|
|
1012
1022
|
|
|
1013
|
-
/** Result of [`transform_pm_embeds`]. */
|
|
1023
|
+
/** Result of [`super::transform_pm_embeds`]. */
|
|
1014
1024
|
export interface JsPmTransformResult {
|
|
1015
1025
|
/** HTML with every `<pm>` block expanded into a package-manager tab widget. */
|
|
1016
1026
|
html: string
|
|
@@ -1335,7 +1345,7 @@ export interface JsSsgSidebarItem {
|
|
|
1335
1345
|
stickyCollapsed?: boolean
|
|
1336
1346
|
}
|
|
1337
1347
|
|
|
1338
|
-
/** Result of [`transform_tabs_embeds`]. */
|
|
1348
|
+
/** Result of [`super::transform_tabs_embeds`]. */
|
|
1339
1349
|
export interface JsTabsTransformResult {
|
|
1340
1350
|
/** HTML with every `<tabs>` block expanded. */
|
|
1341
1351
|
html: string
|
|
@@ -1652,8 +1662,8 @@ export interface JsWikiLinkOptions {
|
|
|
1652
1662
|
}
|
|
1653
1663
|
|
|
1654
1664
|
/**
|
|
1655
|
-
* Options for [`transform_youtube_embeds`]; all optional, matching the
|
|
1656
|
-
* `YouTubeOptions` defaults when omitted.
|
|
1665
|
+
* Options for [`super::transform_youtube_embeds`]; all optional, matching the
|
|
1666
|
+
* TS `YouTubeOptions` defaults when omitted.
|
|
1657
1667
|
*/
|
|
1658
1668
|
export interface JsYouTubeOptions {
|
|
1659
1669
|
/**
|
|
@@ -1791,6 +1801,14 @@ export declare function prepareSourceRaw(source: string, options?: JsSourceOptio
|
|
|
1791
1801
|
/** Renders an AST (provided as JSON) to HTML. */
|
|
1792
1802
|
export declare function render(astJson: string): RenderResult
|
|
1793
1803
|
|
|
1804
|
+
/**
|
|
1805
|
+
* Renders already-produced Markdown HTML into framework-native component code.
|
|
1806
|
+
*
|
|
1807
|
+
* The `target` argument accepts `"react"`, `"vue"`, and `"svelte"`.
|
|
1808
|
+
* `mode` defaults to `"expression"` for backward compatibility.
|
|
1809
|
+
*/
|
|
1810
|
+
export declare function renderFrameworkComponentCode(html: string, target: string, islands?: Array<JsFrameworkComponentIsland> | undefined | null, mode?: string | undefined | null): string
|
|
1811
|
+
|
|
1794
1812
|
/** Render result containing the HTML output. */
|
|
1795
1813
|
export interface RenderResult {
|
|
1796
1814
|
/** The rendered HTML. */
|
|
@@ -1849,13 +1867,7 @@ export declare function transformMdastRaw(source: string, options?: JsTransformO
|
|
|
1849
1867
|
/** Transform opt-in static media embed components in already-rendered HTML. */
|
|
1850
1868
|
export declare function transformMediaEmbeds(html: string, options?: JsMediaEmbedsOptions | undefined | null): string
|
|
1851
1869
|
|
|
1852
|
-
/**
|
|
1853
|
-
* Transforms mermaid code blocks in HTML to rendered SVG diagrams.
|
|
1854
|
-
*
|
|
1855
|
-
* Extracts `<pre><code class="language-mermaid">...</code></pre>` blocks,
|
|
1856
|
-
* renders each in parallel using the mmdc CLI, and replaces them with
|
|
1857
|
-
* `<div class="ox-mermaid">...</div>`.
|
|
1858
|
-
*/
|
|
1870
|
+
/** Transforms mermaid code blocks in HTML to rendered SVG diagrams. */
|
|
1859
1871
|
export declare function transformMermaid(html: string, mmdcPath: string): MermaidTransformResult
|
|
1860
1872
|
|
|
1861
1873
|
/**
|
|
@@ -1881,14 +1893,14 @@ export interface TransformResult {
|
|
|
1881
1893
|
}
|
|
1882
1894
|
|
|
1883
1895
|
/**
|
|
1884
|
-
* Rewrites `<tabs><tab
|
|
1896
|
+
* Rewrites `<tabs><tab>...</tab></tabs>` blocks in rendered HTML into the no-JS
|
|
1885
1897
|
* CSS tab widget plus a `<details>` fallback. Rust port of the TS
|
|
1886
1898
|
* `transformTabs`. Groups are numbered from `start_group`.
|
|
1887
1899
|
*/
|
|
1888
1900
|
export declare function transformTabsEmbeds(html: string, startGroup: number): JsTabsTransformResult
|
|
1889
1901
|
|
|
1890
1902
|
/**
|
|
1891
|
-
* Rewrites `<youtube
|
|
1903
|
+
* Rewrites `<youtube ...>` elements in rendered HTML into responsive,
|
|
1892
1904
|
* privacy-enhanced iframe embeds. Rust port of the TS `transformYouTube`.
|
|
1893
1905
|
*/
|
|
1894
1906
|
export declare function transformYoutubeEmbeds(html: string, options?: JsYouTubeOptions | undefined | null): string
|
package/index.js
CHANGED
|
@@ -162,3 +162,5 @@ module.exports.validateMf2 = binding.validateMf2;
|
|
|
162
162
|
module.exports.checkI18n = binding.checkI18n;
|
|
163
163
|
module.exports.checkI18nProject = binding.checkI18nProject;
|
|
164
164
|
module.exports.extractTranslationKeys = binding.extractTranslationKeys;
|
|
165
|
+
module.exports.renderFrameworkComponentCode = binding.renderFrameworkComponentCode;
|
|
166
|
+
module.exports.escapeSvelteMarkup = binding.escapeSvelteMarkup;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ox-content/napi",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.72.0",
|
|
4
4
|
"description": "Node.js bindings for Ox Content - High-performance Markdown parser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"markdown",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
]
|
|
46
46
|
},
|
|
47
47
|
"optionalDependencies": {
|
|
48
|
-
"@ox-content/binding-darwin-x64": "2.
|
|
49
|
-
"@ox-content/binding-darwin-arm64": "2.
|
|
50
|
-
"@ox-content/binding-linux-x64-gnu": "2.
|
|
51
|
-
"@ox-content/binding-linux-arm64-gnu": "2.
|
|
52
|
-
"@ox-content/binding-win32-x64-msvc": "2.
|
|
48
|
+
"@ox-content/binding-darwin-x64": "2.72.0",
|
|
49
|
+
"@ox-content/binding-darwin-arm64": "2.72.0",
|
|
50
|
+
"@ox-content/binding-linux-x64-gnu": "2.72.0",
|
|
51
|
+
"@ox-content/binding-linux-arm64-gnu": "2.72.0",
|
|
52
|
+
"@ox-content/binding-win32-x64-msvc": "2.72.0"
|
|
53
53
|
}
|
|
54
54
|
}
|