md4x 0.0.10 → 0.0.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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/build/md4x.wasm CHANGED
Binary file
Binary file
Binary file
package/lib/types.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  export type ComarkTree = {
2
- type: "comark";
3
- value: ComarkNode[];
2
+ nodes: ComarkNode[];
3
+ frontmatter: Record<string, unknown>;
4
+ meta: Record<string, unknown>;
4
5
  };
5
6
 
6
7
  export type ComarkNode = ComarkElement | ComarkText;
@@ -8,7 +9,7 @@ export type ComarkNode = ComarkElement | ComarkText;
8
9
  export type ComarkText = string;
9
10
 
10
11
  export type ComarkElement = [
11
- tag: string,
12
+ tag: string | null,
12
13
  props: ComarkElementAttributes,
13
14
  ...children: ComarkNode[],
14
15
  ];
package/lib/unwasm.mjs ADDED
@@ -0,0 +1,19 @@
1
+ import { init as _init } from "./wasm.mjs";
2
+
3
+ export {
4
+ renderToHtml,
5
+ renderToAST,
6
+ parseAST,
7
+ renderToAnsi,
8
+ parseMeta,
9
+ renderToMeta,
10
+ renderToText,
11
+ } from "./wasm.mjs";
12
+
13
+ export async function init(opts) {
14
+ if (opts?.wasm) {
15
+ return _init(opts);
16
+ }
17
+ const mod = await import("md4x/build/md4x.wasm?module");
18
+ return _init({ wasm: mod.default });
19
+ }
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "md4x",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "repository": "pi0/md4x",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "exports": {
8
- "./wasm": "./lib/wasm.mjs",
8
+ "./wasm": {
9
+ "unwasm": "./lib/unwasm.mjs",
10
+ "default": "./lib/wasm.mjs"
11
+ },
9
12
  "./napi": "./lib/napi.mjs",
13
+ "./build/md4x.wasm": "./build/md4x.wasm",
10
14
  ".": {
11
15
  "node": "./lib/napi.mjs",
12
16
  "default": "./lib/wasm.mjs"