documonster 0.7.0 → 0.8.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/dist/browser/modules/pdf/builder/image-utils.d.ts +1 -1
- package/dist/browser/modules/pdf/builder/image-utils.js +58 -9
- package/dist/browser/modules/pdf/core/pdf-writer.d.ts +8 -0
- package/dist/browser/modules/pdf/core/pdf-writer.js +3 -0
- package/dist/browser/modules/pdf/excel-bridge.js +126 -19
- package/dist/browser/modules/pdf/index.d.ts +1 -1
- package/dist/browser/modules/pdf/render/chart-surface.d.ts +6 -1
- package/dist/browser/modules/pdf/render/chart-surface.js +86 -47
- package/dist/browser/modules/pdf/render/constants.d.ts +69 -0
- package/dist/browser/modules/pdf/render/constants.js +45 -0
- package/dist/browser/modules/pdf/render/layout-engine.d.ts +5 -1
- package/dist/browser/modules/pdf/render/layout-engine.js +586 -205
- package/dist/browser/modules/pdf/render/page-renderer.js +180 -3
- package/dist/browser/modules/pdf/render/pdf-exporter.js +176 -35
- package/dist/browser/modules/pdf/render/style-converter.d.ts +11 -0
- package/dist/browser/modules/pdf/render/style-converter.js +24 -0
- package/dist/browser/modules/pdf/types.d.ts +284 -5
- package/dist/cjs/modules/pdf/builder/image-utils.js +58 -9
- package/dist/cjs/modules/pdf/core/pdf-writer.js +3 -0
- package/dist/cjs/modules/pdf/excel-bridge.js +125 -18
- package/dist/cjs/modules/pdf/render/chart-surface.js +86 -47
- package/dist/cjs/modules/pdf/render/constants.js +46 -1
- package/dist/cjs/modules/pdf/render/layout-engine.js +583 -202
- package/dist/cjs/modules/pdf/render/page-renderer.js +179 -2
- package/dist/cjs/modules/pdf/render/pdf-exporter.js +175 -34
- package/dist/cjs/modules/pdf/render/style-converter.js +26 -0
- package/dist/esm/modules/pdf/builder/image-utils.js +58 -9
- package/dist/esm/modules/pdf/core/pdf-writer.js +3 -0
- package/dist/esm/modules/pdf/excel-bridge.js +126 -19
- package/dist/esm/modules/pdf/render/chart-surface.js +86 -47
- package/dist/esm/modules/pdf/render/constants.js +45 -0
- package/dist/esm/modules/pdf/render/layout-engine.js +586 -205
- package/dist/esm/modules/pdf/render/page-renderer.js +180 -3
- package/dist/esm/modules/pdf/render/pdf-exporter.js +176 -35
- package/dist/esm/modules/pdf/render/style-converter.js +24 -0
- package/dist/iife/documonster.archive.iife.js +1 -1
- package/dist/iife/documonster.archive.iife.min.js +1 -1
- package/dist/iife/documonster.csv.iife.js +1 -1
- package/dist/iife/documonster.csv.iife.min.js +1 -1
- package/dist/iife/documonster.excel.iife.js +1 -1
- package/dist/iife/documonster.excel.iife.min.js +1 -1
- package/dist/iife/documonster.formula.iife.js +1 -1
- package/dist/iife/documonster.formula.iife.min.js +1 -1
- package/dist/iife/documonster.markdown.iife.js +1 -1
- package/dist/iife/documonster.markdown.iife.min.js +1 -1
- package/dist/iife/documonster.pdf.iife.js +1457 -664
- package/dist/iife/documonster.pdf.iife.js.map +1 -1
- package/dist/iife/documonster.pdf.iife.min.js +33 -32
- package/dist/iife/documonster.stream.iife.js +1 -1
- package/dist/iife/documonster.stream.iife.min.js +1 -1
- package/dist/iife/documonster.word.iife.js +1 -1
- package/dist/iife/documonster.word.iife.min.js +1 -1
- package/dist/iife/documonster.xml.iife.js +1 -1
- package/dist/iife/documonster.xml.iife.min.js +1 -1
- package/dist/types/modules/pdf/builder/image-utils.d.ts +1 -1
- package/dist/types/modules/pdf/core/pdf-writer.d.ts +8 -0
- package/dist/types/modules/pdf/index.d.ts +1 -1
- package/dist/types/modules/pdf/render/chart-surface.d.ts +6 -1
- package/dist/types/modules/pdf/render/constants.d.ts +69 -0
- package/dist/types/modules/pdf/render/layout-engine.d.ts +5 -1
- package/dist/types/modules/pdf/render/style-converter.d.ts +11 -0
- package/dist/types/modules/pdf/types.d.ts +284 -5
- package/package.json +1 -1
|
@@ -28,3 +28,72 @@ export declare const INDENT_WIDTH = 10;
|
|
|
28
28
|
*/
|
|
29
29
|
export declare const MAX_DIGIT_WIDTH_PX = 7;
|
|
30
30
|
export declare const PX_TO_PT: number;
|
|
31
|
+
/**
|
|
32
|
+
* Font size of the printed row-number / column-letter headings, in points.
|
|
33
|
+
*
|
|
34
|
+
* Deliberately independent of the grid's print scale: headings are a reading
|
|
35
|
+
* aid rather than content, so a fixed size stays legible even when the grid is
|
|
36
|
+
* shrunk to fit, and lets the layout reserve exactly the space it draws.
|
|
37
|
+
*/
|
|
38
|
+
export declare const HEADING_FONT_SIZE = 8;
|
|
39
|
+
/** Padding around a heading label, in points (applied on both sides). */
|
|
40
|
+
export declare const HEADING_PADDING = 3;
|
|
41
|
+
/** Background shade and rule color of the heading bands. */
|
|
42
|
+
export declare const HEADING_FILL: {
|
|
43
|
+
r: number;
|
|
44
|
+
g: number;
|
|
45
|
+
b: number;
|
|
46
|
+
};
|
|
47
|
+
export declare const HEADING_RULE: {
|
|
48
|
+
r: number;
|
|
49
|
+
g: number;
|
|
50
|
+
b: number;
|
|
51
|
+
};
|
|
52
|
+
export declare const HEADING_TEXT: {
|
|
53
|
+
r: number;
|
|
54
|
+
g: number;
|
|
55
|
+
b: number;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Lower bound when solving "fit to N pages", matching the 10% floor of Excel's
|
|
59
|
+
* Page Setup scaling. A target that is unreachable at this scale — typically
|
|
60
|
+
* because manual page breaks force more pages than requested — yields more than
|
|
61
|
+
* N pages rather than shrinking the grid into illegibility.
|
|
62
|
+
*/
|
|
63
|
+
export declare const FIT_MIN_SCALE = 0.1;
|
|
64
|
+
/**
|
|
65
|
+
* Side length of the red corner marker Excel draws on a commented cell, in
|
|
66
|
+
* points at 100% scale.
|
|
67
|
+
*/
|
|
68
|
+
export declare const COMMENT_MARKER_SIZE = 4;
|
|
69
|
+
/** Comment box fill, border and text colors, matching Excel's note styling. */
|
|
70
|
+
export declare const COMMENT_FILL: {
|
|
71
|
+
r: number;
|
|
72
|
+
g: number;
|
|
73
|
+
b: number;
|
|
74
|
+
};
|
|
75
|
+
export declare const COMMENT_BORDER: {
|
|
76
|
+
r: number;
|
|
77
|
+
g: number;
|
|
78
|
+
b: number;
|
|
79
|
+
};
|
|
80
|
+
export declare const COMMENT_MARKER_COLOR: {
|
|
81
|
+
r: number;
|
|
82
|
+
g: number;
|
|
83
|
+
b: number;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Overflow tolerance when packing columns into a page, in points.
|
|
87
|
+
*
|
|
88
|
+
* Scaled point widths accumulate rounding error, so a column that mathematically
|
|
89
|
+
* fits can measure a hair too wide. Rows need no such slack because their
|
|
90
|
+
* heights are not derived from a character-width conversion.
|
|
91
|
+
*/
|
|
92
|
+
export declare const COLUMN_FIT_EPSILON = 0.01;
|
|
93
|
+
/**
|
|
94
|
+
* Height of the bands reserved for the fallback sheet-name header and
|
|
95
|
+
* page-number footer, in points. Excel header/footers use their own margins;
|
|
96
|
+
* these are the simple `showSheetNames` / `showPageNumbers` bands.
|
|
97
|
+
*/
|
|
98
|
+
export declare const SHEET_NAME_BAND_HEIGHT = 20;
|
|
99
|
+
export declare const PAGE_NUMBER_BAND_HEIGHT = 20;
|
|
@@ -28,3 +28,48 @@ export const INDENT_WIDTH = 10;
|
|
|
28
28
|
*/
|
|
29
29
|
export const MAX_DIGIT_WIDTH_PX = 7;
|
|
30
30
|
export const PX_TO_PT = 72 / 96; // 0.75
|
|
31
|
+
/**
|
|
32
|
+
* Font size of the printed row-number / column-letter headings, in points.
|
|
33
|
+
*
|
|
34
|
+
* Deliberately independent of the grid's print scale: headings are a reading
|
|
35
|
+
* aid rather than content, so a fixed size stays legible even when the grid is
|
|
36
|
+
* shrunk to fit, and lets the layout reserve exactly the space it draws.
|
|
37
|
+
*/
|
|
38
|
+
export const HEADING_FONT_SIZE = 8;
|
|
39
|
+
/** Padding around a heading label, in points (applied on both sides). */
|
|
40
|
+
export const HEADING_PADDING = 3;
|
|
41
|
+
/** Background shade and rule color of the heading bands. */
|
|
42
|
+
export const HEADING_FILL = { r: 0.94, g: 0.94, b: 0.94 };
|
|
43
|
+
export const HEADING_RULE = { r: 0.6, g: 0.6, b: 0.6 };
|
|
44
|
+
export const HEADING_TEXT = { r: 0.2, g: 0.2, b: 0.2 };
|
|
45
|
+
/**
|
|
46
|
+
* Lower bound when solving "fit to N pages", matching the 10% floor of Excel's
|
|
47
|
+
* Page Setup scaling. A target that is unreachable at this scale — typically
|
|
48
|
+
* because manual page breaks force more pages than requested — yields more than
|
|
49
|
+
* N pages rather than shrinking the grid into illegibility.
|
|
50
|
+
*/
|
|
51
|
+
export const FIT_MIN_SCALE = 0.1;
|
|
52
|
+
/**
|
|
53
|
+
* Side length of the red corner marker Excel draws on a commented cell, in
|
|
54
|
+
* points at 100% scale.
|
|
55
|
+
*/
|
|
56
|
+
export const COMMENT_MARKER_SIZE = 4;
|
|
57
|
+
/** Comment box fill, border and text colors, matching Excel's note styling. */
|
|
58
|
+
export const COMMENT_FILL = { r: 1, g: 1, b: 0.88 };
|
|
59
|
+
export const COMMENT_BORDER = { r: 0.4, g: 0.4, b: 0.4 };
|
|
60
|
+
export const COMMENT_MARKER_COLOR = { r: 0.8, g: 0, b: 0 };
|
|
61
|
+
/**
|
|
62
|
+
* Overflow tolerance when packing columns into a page, in points.
|
|
63
|
+
*
|
|
64
|
+
* Scaled point widths accumulate rounding error, so a column that mathematically
|
|
65
|
+
* fits can measure a hair too wide. Rows need no such slack because their
|
|
66
|
+
* heights are not derived from a character-width conversion.
|
|
67
|
+
*/
|
|
68
|
+
export const COLUMN_FIT_EPSILON = 0.01;
|
|
69
|
+
/**
|
|
70
|
+
* Height of the bands reserved for the fallback sheet-name header and
|
|
71
|
+
* page-number footer, in points. Excel header/footers use their own margins;
|
|
72
|
+
* these are the simple `showSheetNames` / `showPageNumbers` bands.
|
|
73
|
+
*/
|
|
74
|
+
export const SHEET_NAME_BAND_HEIGHT = 20;
|
|
75
|
+
export const PAGE_NUMBER_BAND_HEIGHT = 20;
|
|
@@ -44,7 +44,11 @@ export declare function layoutSheet(sheet: PdfSheetData, options: ResolvedPdfOpt
|
|
|
44
44
|
* chart-rendering path, so no exporter changes are needed here.
|
|
45
45
|
*/
|
|
46
46
|
export declare function layoutChartsheet(sheet: PdfChartsheetData, documentOptions: ResolvedPdfOptions): LayoutPage[];
|
|
47
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Row pagination. Thin wrapper over {@link paginateTracks} that also accepts a
|
|
49
|
+
* plain count, which reads better in the focused unit tests.
|
|
50
|
+
*/
|
|
51
|
+
export declare function paginateRows(rowHeights: number[], availableHeight: number, repeatRows: number | number[], rowBreaks: Set<number>): number[][];
|
|
48
52
|
/**
|
|
49
53
|
* Border precedence weight.
|
|
50
54
|
*
|