@knowvah/dot-engine 2.6.9 → 2.6.11
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/common/html-entities.d.ts +13 -5
- package/dist/common/html-entities.d.ts.map +1 -1
- package/dist/common/htmltable-emit-fill.d.ts +1 -1
- package/dist/common/htmltable-emit-fill.d.ts.map +1 -1
- package/dist/common/htmltable-emit.d.ts +8 -0
- package/dist/common/htmltable-emit.d.ts.map +1 -1
- package/dist/common/htmltable-lex-chardata.d.ts +9 -0
- package/dist/common/htmltable-lex-chardata.d.ts.map +1 -1
- package/dist/common/htmltable-style.d.ts +22 -0
- package/dist/common/htmltable-style.d.ts.map +1 -0
- package/dist/index.js +345 -284
- package/dist/index.js.map +4 -4
- package/dist/render.js +95 -34
- package/dist/render.js.map +4 -4
- package/package.json +1 -1
- package/src/common/html-entities.ts +77 -25
- package/src/common/htmltable-emit-fill.ts +7 -6
- package/src/common/htmltable-emit.ts +5 -22
- package/src/common/htmltable-lex-chardata.ts +42 -8
- package/src/common/htmltable-style.ts +38 -0
|
@@ -6,11 +6,19 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const HTML_ENTITIES: Readonly<Record<string, number>>;
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* Latin-1 inputs are decoded at the
|
|
12
|
-
* survey's render-one), so this
|
|
13
|
-
*
|
|
9
|
+
* Substitute entities like `{` and `&` with their characters: C's
|
|
10
|
+
* make_label UTF-8 branch. An `&` whose entity has no value stays (scanning
|
|
11
|
+
* resumes where htmlEntity left it). Latin-1 inputs are decoded at the
|
|
12
|
+
* byte->string boundary by the caller (the survey's render-one), so this
|
|
13
|
+
* covers them too, as does latin1ToUTF8's identical entity handling.
|
|
14
|
+
*
|
|
15
|
+
* C appends a value's bytes itself: below 0x7F one byte, below 0x7FF two,
|
|
16
|
+
* else three, truncated to `char`. For every value whose bytes are valid
|
|
17
|
+
* UTF-8 that is the character itself. 0x7F, 0x7FF, surrogates and values
|
|
18
|
+
* above 0xFFFF come out as invalid UTF-8, which a JS string cannot hold; the
|
|
19
|
+
* port keeps the character there (documented divergence).
|
|
20
|
+
* @see lib/common/utils.c:htmlEntityUTF8
|
|
21
|
+
* @see lib/common/utils.c:latin1ToUTF8
|
|
14
22
|
* @see lib/common/labels.c:make_label (CHAR_LATIN1 vs default)
|
|
15
23
|
*/
|
|
16
24
|
export declare function htmlEntityUTF8(s: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-entities.d.ts","sourceRoot":"","sources":["../../src/common/html-entities.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA6P1D,CAAC;
|
|
1
|
+
{"version":3,"file":"html-entities.d.ts","sourceRoot":"","sources":["../../src/common/html-entities.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA6P1D,CAAC;AA+DF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAWhD"}
|
|
@@ -25,7 +25,7 @@ export interface HtmlPaint {
|
|
|
25
25
|
pen?: string;
|
|
26
26
|
/** Pen width; default 1.0 (omitted from SVG at 1.0). */
|
|
27
27
|
penWidth?: number;
|
|
28
|
-
/**
|
|
28
|
+
/** HTML STYLE string; its dashed/dotted flags map to the pen type. */
|
|
29
29
|
penStyle?: string;
|
|
30
30
|
/**
|
|
31
31
|
* Second/stop color of a gradient fill. Presence switches the fill from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmltable-emit-fill.d.ts","sourceRoot":"","sources":["../../src/common/htmltable-emit-fill.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,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AAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAqBD,oFAAoF;AACpF,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,mFAAmF;AACnF,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAUD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,IAAI,GAAG,IAAI,CAkBxF;AA2BD;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,GAAG,KAAK,EAAE,CAgBjE;AAMD;;;;;GAKG;AACH,wBAAgB,MAAM,CACpB,CAAC,EAAE,KAAK,EACR,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,cAAc,EACxB,GAAG,EAAE,SAAS,GACb,IAAI,CAQN;AAMD,yEAAyE;AACzE,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,GAAG,CAAC;IACT,GAAG,EAAE,KAAK,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,cAAc,EACxB,GAAG,EAAE,SAAS,GACb,IAAI,CAoBN"}
|
|
@@ -42,6 +42,14 @@ export declare function emitHtmlLine(line: PlacedLine, pos: Point, renderer: Ren
|
|
|
42
42
|
* @see lib/gvc/gvrender.c:gvrender_usershape (line 670)
|
|
43
43
|
*/
|
|
44
44
|
export declare function emitHtmlImg(img: PlacedImage, pos: Point, renderer: RendererPlugin, job: RenderJob): void;
|
|
45
|
+
/**
|
|
46
|
+
* Emit one positioned HTML cell.
|
|
47
|
+
*
|
|
48
|
+
* Draw order mirrors C emit_html_cell:
|
|
49
|
+
* 1. Open anchor 2. BGCOLOR fill 3. Border 4. Content 5. Close anchor
|
|
50
|
+
*
|
|
51
|
+
* @see lib/common/htmltable.c:emit_html_cell
|
|
52
|
+
*/
|
|
45
53
|
export declare function emitHtmlCell(cell: PlacedCell, pos: Point, renderer: RendererPlugin, job: RenderJob): void;
|
|
46
54
|
/**
|
|
47
55
|
* Emit a fully positioned HTML table label.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmltable-emit.d.ts","sourceRoot":"","sources":["../../src/common/htmltable-emit.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAW1F,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;AAgBhE,6DAA6D;AAC7D,wBAAgB,WAAW,CACzB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,KAAK,EACV,QAAQ,EAAE,cAAc,EACxB,GAAG,EAAE,SAAS,GACb,IAAI,CAQN;AAmBD,qEAAqE;AACrE,wBAAgB,YAAY,CAC1B,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,SAAS,GACrE,IAAI,CAEN;AAqHD;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,KA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AAG,EAAE,KAAK,EACV,QAAQ,EAAE,cAAc,EACxB,GAAG,EAAE,SAAS,GACb,IAAI,CAiCN"}
|
|
@@ -30,6 +30,15 @@ export declare function keepLostText(st: CharDataState, lost: readonly Token[]):
|
|
|
30
30
|
* @see lib/common/htmlparse.y:table
|
|
31
31
|
*/
|
|
32
32
|
export declare function releaseXb(st: CharDataState, first: Token): void;
|
|
33
|
+
/**
|
|
34
|
+
* The characters expat hands characterData for a text run: scanEntity first
|
|
35
|
+
* rewrites each entities.h name to `&#N;` (its `&` only when no `#` follows),
|
|
36
|
+
* then expat decodes character references, of any length, and its five
|
|
37
|
+
* predefined entities. Runs expat rejects never get here (textRefError).
|
|
38
|
+
* @see lib/common/htmllex.c:findNext
|
|
39
|
+
* @see lib/common/utils.c:scanEntity
|
|
40
|
+
*/
|
|
41
|
+
export declare function decodeTextRefs(raw: string): string;
|
|
33
42
|
/** The text token of a text run, if anything is left after cleaning. */
|
|
34
43
|
export declare function textTokens(raw: string): Token[];
|
|
35
44
|
/** characterData on what expat decoded: a T_string when any character survives. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmltable-lex-chardata.d.ts","sourceRoot":"","sources":["../../src/common/htmltable-lex-chardata.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"htmltable-lex-chardata.d.ts","sourceRoot":"","sources":["../../src/common/htmltable-lex-chardata.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAElD,oFAAoF;AACpF,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,uGAAuG;AACvG,eAAO,MAAM,eAAe,QAAO,aAA2C,CAAC;AAc/E,yFAAyF;AACzF,wBAAgB,SAAS,CAAC,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAQhE;AAED,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,KAAK,EAAE,GAAG,IAAI,CAE5E;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAM/D;AAkCD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wEAAwE;AACxE,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,EAAE,CAO/C;AAED,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,EAAE,CAGvD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The HTML STYLE flags. C's stylefn sets an htmlstyle_t bitfield at lex time;
|
|
3
|
+
* the port keeps the legal tokens as a string (htmltable-attr-warn.ts joins
|
|
4
|
+
* them with ' ') and reads the flags back here, token by token in order, so
|
|
5
|
+
* SOLID still clears only the DOTTED/DASHED before it. HTML STYLE is not the
|
|
6
|
+
* node/edge style: tokens split on space or comma and compare
|
|
7
|
+
* case-insensitively, so `parseStyleFlags` cannot read it.
|
|
8
|
+
*
|
|
9
|
+
* @see lib/common/htmltable.h:htmlstyle_t
|
|
10
|
+
* @see lib/common/htmllex.c:stylefn (DELIM " ,", strview_case_str_eq)
|
|
11
|
+
*/
|
|
12
|
+
/** @see lib/common/htmltable.h:htmlstyle_t */
|
|
13
|
+
export interface HtmlStyle {
|
|
14
|
+
radial: boolean;
|
|
15
|
+
rounded: boolean;
|
|
16
|
+
invisible: boolean;
|
|
17
|
+
dotted: boolean;
|
|
18
|
+
dashed: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Read the htmlstyle_t flags from a kept HTML STYLE string. */
|
|
21
|
+
export declare function htmlStyle(style: string | undefined): HtmlStyle;
|
|
22
|
+
//# sourceMappingURL=htmltable-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"htmltable-style.d.ts","sourceRoot":"","sources":["../../src/common/htmltable-style.ts"],"names":[],"mappings":"AACA;;;;;;;;;;GAUG;AAEH,8CAA8C;AAC9C,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,gEAAgE;AAChE,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAc9D"}
|