@ox-content/napi 2.25.0 → 2.26.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.
Files changed (2) hide show
  1. package/index.d.ts +39 -0
  2. package/package.json +6 -6
package/index.d.ts CHANGED
@@ -850,6 +850,17 @@ export interface JsSsgSidebarItem {
850
850
  collapsed?: boolean
851
851
  }
852
852
 
853
+ /** Result of [`transform_tabs_embeds`]. */
854
+ export interface JsTabsTransformResult {
855
+ /** HTML with every `<tabs>` block expanded. */
856
+ html: string
857
+ /**
858
+ * Number of tab groups expanded; the caller advances its group counter by
859
+ * this amount so generated CSS covers exactly the emitted groups.
860
+ */
861
+ groupCount: number
862
+ }
863
+
853
864
  /** Theme colors for JavaScript. */
854
865
  export interface JsThemeColors {
855
866
  /** Primary accent color. */
@@ -1018,6 +1029,21 @@ export interface JsTransformOptions {
1018
1029
  autolinkTargetBlank?: boolean
1019
1030
  }
1020
1031
 
1032
+ /**
1033
+ * Options for [`transform_youtube_embeds`]; all optional, matching the TS
1034
+ * `YouTubeOptions` defaults when omitted.
1035
+ */
1036
+ export interface JsYouTubeOptions {
1037
+ /** Use privacy-enhanced mode (youtube-nocookie.com). Default: true. */
1038
+ privacyEnhanced?: boolean
1039
+ /** Default aspect ratio. Default: "16/9". */
1040
+ aspectRatio?: string
1041
+ /** Allow fullscreen. Default: true. */
1042
+ allowFullscreen?: boolean
1043
+ /** Lazy-load the iframe. Default: true. */
1044
+ lazyLoad?: boolean
1045
+ }
1046
+
1021
1047
  export declare function lintMarkdown(source: string, options?: JsMarkdownLintOptions | undefined | null): JsMarkdownLintResult
1022
1048
 
1023
1049
  export declare function lintMarkdownDocuments(sources: Array<string>, options?: JsMarkdownLintOptions | undefined | null): Array<JsMarkdownLintResult>
@@ -1197,6 +1223,19 @@ export interface TransformResult {
1197
1223
  errors: Array<string>
1198
1224
  }
1199
1225
 
1226
+ /**
1227
+ * Rewrites `<tabs><tab>…</tab></tabs>` blocks in rendered HTML into the no-JS
1228
+ * CSS tab widget plus a `<details>` fallback. Rust port of the TS
1229
+ * `transformTabs`. Groups are numbered from `start_group`.
1230
+ */
1231
+ export declare function transformTabsEmbeds(html: string, startGroup: number): JsTabsTransformResult
1232
+
1233
+ /**
1234
+ * Rewrites `<youtube …>` elements in rendered HTML into responsive,
1235
+ * privacy-enhanced iframe embeds. Rust port of the TS `transformYouTube`.
1236
+ */
1237
+ export declare function transformYoutubeEmbeds(html: string, options?: JsYouTubeOptions | undefined | null): string
1238
+
1200
1239
  /**
1201
1240
  * Validates an MF2 message string.
1202
1241
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ox-content/napi",
3
- "version": "2.25.0",
3
+ "version": "2.26.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.25.0",
49
- "@ox-content/binding-darwin-arm64": "2.25.0",
50
- "@ox-content/binding-linux-x64-gnu": "2.25.0",
51
- "@ox-content/binding-linux-arm64-gnu": "2.25.0",
52
- "@ox-content/binding-win32-x64-msvc": "2.25.0"
48
+ "@ox-content/binding-darwin-x64": "2.26.0",
49
+ "@ox-content/binding-darwin-arm64": "2.26.0",
50
+ "@ox-content/binding-linux-x64-gnu": "2.26.0",
51
+ "@ox-content/binding-linux-arm64-gnu": "2.26.0",
52
+ "@ox-content/binding-win32-x64-msvc": "2.26.0"
53
53
  }
54
54
  }