@openuji/speculator 0.3.0 → 0.3.2

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/browser.js CHANGED
@@ -1,27 +1,35 @@
1
1
  import {
2
2
  DOMHtmlRenderer,
3
3
  FormatProcessor,
4
+ FormatRegistry,
4
5
  IncludeProcessor,
5
6
  RespecXrefResolver,
6
7
  Speculator,
7
8
  SpeculatorError,
9
+ StatsTracker,
8
10
  browserFileLoader,
9
11
  createFallbackFileLoader,
10
12
  createMarkdownRenderer,
13
+ fromRespecConfig,
14
+ getChangedOutputAreas,
11
15
  getDefaultFileLoader,
12
16
  nodeFileLoader,
13
17
  parseMarkdown
14
- } from "./chunk-U4GQ6EOV.js";
18
+ } from "./chunk-ONLMOJIJ.js";
15
19
  export {
16
20
  DOMHtmlRenderer,
17
21
  FormatProcessor,
22
+ FormatRegistry,
18
23
  IncludeProcessor,
19
24
  RespecXrefResolver,
20
25
  Speculator,
21
26
  SpeculatorError,
27
+ StatsTracker,
22
28
  browserFileLoader,
23
29
  createFallbackFileLoader,
24
30
  createMarkdownRenderer,
31
+ fromRespecConfig,
32
+ getChangedOutputAreas,
25
33
  getDefaultFileLoader,
26
34
  nodeFileLoader,
27
35
  parseMarkdown
@@ -0,0 +1,28 @@
1
+ import {
2
+ Speculator
3
+ } from "./chunk-ONLMOJIJ.js";
4
+
5
+ // src/linkedom-html-renderer.ts
6
+ import { DOMParser } from "linkedom";
7
+ var LinkedomHtmlRenderer = class {
8
+ parse(html) {
9
+ const parser = new DOMParser();
10
+ const doc = parser.parseFromString(`<div>${html}</div>`, "text/html");
11
+ return doc.querySelector("div");
12
+ }
13
+ serialize(element) {
14
+ return element.innerHTML;
15
+ }
16
+ };
17
+
18
+ // src/node.ts
19
+ var Speculator2 = class extends Speculator {
20
+ constructor(options = {}) {
21
+ super({ ...options, htmlRenderer: options.htmlRenderer || new LinkedomHtmlRenderer() });
22
+ }
23
+ };
24
+
25
+ export {
26
+ LinkedomHtmlRenderer,
27
+ Speculator2 as Speculator
28
+ };